@harbour-enterprises/superdoc 0.9.13 → 0.9.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/chunks/{super-editor.es-C6vKHdgD.es.js → super-editor.es-BPwc4j-L.es.js} +14836 -12012
  2. package/dist/chunks/super-editor.es-gThdNxYA.cjs +419 -0
  3. package/dist/super-editor/chunks/{converter-fQkM_qkr.js → converter-CSYBOjnm.js} +4764 -3410
  4. package/dist/super-editor/chunks/{docx-zipper-C1n_Ukte.js → docx-zipper-DJz8LRe8.js} +1 -1
  5. package/dist/super-editor/chunks/{editor-DrW3w9hr.js → editor-nvPWY9O4.js} +4890 -3420
  6. package/dist/super-editor/chunks/{toolbar-CThx2ucP.js → toolbar-BMdokWM_.js} +2 -2
  7. package/dist/super-editor/converter.es.js +1 -1
  8. package/dist/super-editor/core/Editor.d.ts +2 -1
  9. package/dist/super-editor/core/Editor.d.ts.map +1 -1
  10. package/dist/super-editor/core/commands/toggleList.d.ts.map +1 -1
  11. package/dist/super-editor/core/extensions/keymap.d.ts +3 -0
  12. package/dist/super-editor/core/extensions/keymap.d.ts.map +1 -1
  13. package/dist/super-editor/core/helpers/baseListDefinitions.d.ts +444 -0
  14. package/dist/super-editor/core/helpers/baseListDefinitions.d.ts.map +1 -0
  15. package/dist/super-editor/core/super-converter/SuperConverter.d.ts +12 -1
  16. package/dist/super-editor/core/super-converter/SuperConverter.d.ts.map +1 -1
  17. package/dist/super-editor/core/super-converter/exporter.d.ts.map +1 -1
  18. package/dist/super-editor/core/super-converter/v2/exporter/helpers/base-list.definitions.d.ts +444 -0
  19. package/dist/super-editor/core/super-converter/v2/exporter/helpers/base-list.definitions.d.ts.map +1 -0
  20. package/dist/super-editor/core/super-converter/v2/importer/docxImporter.d.ts +2 -1
  21. package/dist/super-editor/core/super-converter/v2/importer/docxImporter.d.ts.map +1 -1
  22. package/dist/super-editor/core/super-converter/v2/importer/listImporter.d.ts.map +1 -1
  23. package/dist/super-editor/docx-zipper.es.js +2 -2
  24. package/dist/super-editor/editor.es.js +3 -3
  25. package/dist/super-editor/extensions/bullet-list/bullet-list.d.ts.map +1 -1
  26. package/dist/super-editor/extensions/list-item/list-item.d.ts.map +1 -1
  27. package/dist/super-editor/extensions/ordered-list/helpers/orderedListSyncPlugin.d.ts +1 -0
  28. package/dist/super-editor/extensions/ordered-list/helpers/orderedListSyncPlugin.d.ts.map +1 -1
  29. package/dist/super-editor/extensions/ordered-list/ordered-list.d.ts.map +1 -1
  30. package/dist/super-editor/file-zipper.es.js +1 -1
  31. package/dist/super-editor/super-editor.es.js +6 -6
  32. package/dist/super-editor/tests/export/export-helpers/export-helpers.d.ts.map +1 -1
  33. package/dist/super-editor/tests/export/lists/importExportListRunPrs.test.d.ts +2 -0
  34. package/dist/super-editor/tests/export/lists/importExportListRunPrs.test.d.ts.map +1 -0
  35. package/dist/super-editor/tests/export/lists/importExportLists.test.d.ts +2 -0
  36. package/dist/super-editor/tests/export/lists/importExportLists.test.d.ts.map +1 -0
  37. package/dist/super-editor/tests/export/lists/testComplexListIssues.test.d.ts +2 -0
  38. package/dist/super-editor/tests/export/lists/testComplexListIssues.test.d.ts.map +1 -0
  39. package/dist/super-editor/tests/helpers/helpers.d.ts +4 -0
  40. package/dist/super-editor/tests/helpers/helpers.d.ts.map +1 -1
  41. package/dist/super-editor/tests/import/listImporterBasic.test.d.ts +2 -0
  42. package/dist/super-editor/tests/import/listImporterBasic.test.d.ts.map +1 -0
  43. package/dist/super-editor/tests/import/listImporterCustomLists.test.d.ts +2 -0
  44. package/dist/super-editor/tests/import/listImporterCustomLists.test.d.ts.map +1 -0
  45. package/dist/super-editor/toolbar.es.js +2 -2
  46. package/dist/super-editor.cjs +1 -1
  47. package/dist/super-editor.es.js +6 -6
  48. package/dist/superdoc.cjs +4 -4
  49. package/dist/superdoc.es.js +3 -3
  50. package/dist/superdoc.umd.js +12874 -10050
  51. package/dist/superdoc.umd.js.map +1 -1
  52. package/package.json +1 -1
  53. package/dist/chunks/super-editor.es-B1uPFXk3.cjs +0 -419
@@ -1,419 +0,0 @@
1
- "use strict";const Bo=require("yjs"),b=require("./vue-Ckf0DkDN.cjs");function rS(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const $e=rS(Bo);var oS=Object.defineProperty,f0=t=>{throw TypeError(t)},iS=(t,e,n)=>e in t?oS(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Is=(t,e,n)=>iS(t,typeof e!="symbol"?e+"":e,n),sS=(t,e,n)=>e.has(t)||f0("Cannot "+n),p0=(t,e,n)=>e.has(t)?f0("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),wr=(t,e,n)=>(sS(t,e,"access private method"),n),zt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof b.global<"u"?b.global:typeof self<"u"?self:{};function ml(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function aS(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return t[r]}})}),n}var gt={},gl={};gl.byteLength=uS;gl.toByteArray=fS;gl.fromByteArray=mS;var Dn=[],ln=[],lS=typeof Uint8Array<"u"?Uint8Array:Array,ql="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var vo=0,cS=ql.length;vo<cS;++vo)Dn[vo]=ql[vo],ln[ql.charCodeAt(vo)]=vo;ln[45]=62;ln[95]=63;function h0(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");n===-1&&(n=e);var r=n===e?0:4-n%4;return[n,r]}function uS(t){var e=h0(t),n=e[0],r=e[1];return(n+r)*3/4-r}function dS(t,e,n){return(e+n)*3/4-n}function fS(t){var e,n=h0(t),r=n[0],o=n[1],i=new lS(dS(t,r,o)),s=0,a=o>0?r-4:r,l;for(l=0;l<a;l+=4)e=ln[t.charCodeAt(l)]<<18|ln[t.charCodeAt(l+1)]<<12|ln[t.charCodeAt(l+2)]<<6|ln[t.charCodeAt(l+3)],i[s++]=e>>16&255,i[s++]=e>>8&255,i[s++]=e&255;return o===2&&(e=ln[t.charCodeAt(l)]<<2|ln[t.charCodeAt(l+1)]>>4,i[s++]=e&255),o===1&&(e=ln[t.charCodeAt(l)]<<10|ln[t.charCodeAt(l+1)]<<4|ln[t.charCodeAt(l+2)]>>2,i[s++]=e>>8&255,i[s++]=e&255),i}function pS(t){return Dn[t>>18&63]+Dn[t>>12&63]+Dn[t>>6&63]+Dn[t&63]}function hS(t,e,n){for(var r,o=[],i=e;i<n;i+=3)r=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(t[i+2]&255),o.push(pS(r));return o.join("")}function mS(t){for(var e,n=t.length,r=n%3,o=[],i=16383,s=0,a=n-r;s<a;s+=i)o.push(hS(t,s,s+i>a?a:s+i));return r===1?(e=t[n-1],o.push(Dn[e>>2]+Dn[e<<4&63]+"==")):r===2&&(e=(t[n-2]<<8)+t[n-1],o.push(Dn[e>>10]+Dn[e>>4&63]+Dn[e<<2&63]+"=")),o.join("")}var cf={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */cf.read=function(t,e,n,r,o){var i,s,a=o*8-r-1,l=(1<<a)-1,c=l>>1,u=-7,d=n?o-1:0,f=n?-1:1,p=t[e+d];for(d+=f,i=p&(1<<-u)-1,p>>=-u,u+=a;u>0;i=i*256+t[e+d],d+=f,u-=8);for(s=i&(1<<-u)-1,i>>=-u,u+=r;u>0;s=s*256+t[e+d],d+=f,u-=8);if(i===0)i=1-c;else{if(i===l)return s?NaN:(p?-1:1)*(1/0);s=s+Math.pow(2,r),i=i-c}return(p?-1:1)*s*Math.pow(2,i-r)};cf.write=function(t,e,n,r,o,i){var s,a,l,c=i*8-o-1,u=(1<<c)-1,d=u>>1,f=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,h=r?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+d>=1?e+=f/l:e+=f*Math.pow(2,1-d),e*l>=2&&(s++,l/=2),s+d>=u?(a=0,s=u):s+d>=1?(a=(e*l-1)*Math.pow(2,o),s=s+d):(a=e*Math.pow(2,d-1)*Math.pow(2,o),s=0));o>=8;t[n+p]=a&255,p+=h,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;t[n+p]=s&255,p+=h,s/=256,c-=8);t[n+p-h]|=m*128};/*!
2
- * The buffer module from node.js, for the browser.
3
- *
4
- * @author Feross Aboukhadijeh <https://feross.org>
5
- * @license MIT
6
- */(function(t){const e=gl,n=cf,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=T,t.INSPECT_MAX_BYTES=50;const o=2147483647;t.kMaxLength=o;const{Uint8Array:i,ArrayBuffer:s,SharedArrayBuffer:a}=globalThis;u.TYPED_ARRAY_SUPPORT=l(),!u.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 l(){try{const v=new i(1),O={foo:function(){return 42}};return Object.setPrototypeOf(O,i.prototype),Object.setPrototypeOf(v,O),v.foo()===42}catch{return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}});function c(v){if(v>o)throw new RangeError('The value "'+v+'" is invalid for option "size"');const O=new i(v);return Object.setPrototypeOf(O,u.prototype),O}function u(v,O,_){if(typeof v=="number"){if(typeof O=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h(v)}return d(v,O,_)}u.poolSize=8192;function d(v,O,_){if(typeof v=="string")return m(v,O);if(s.isView(v))return g(v);if(v==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof v);if(ue(v,s)||v&&ue(v.buffer,s)||typeof a<"u"&&(ue(v,a)||v&&ue(v.buffer,a)))return x(v,O,_);if(typeof v=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Y=v.valueOf&&v.valueOf();if(Y!=null&&Y!==v)return u.from(Y,O,_);const j=k(v);if(j)return j;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof v[Symbol.toPrimitive]=="function")return u.from(v[Symbol.toPrimitive]("string"),O,_);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof v)}u.from=function(v,O,_){return d(v,O,_)},Object.setPrototypeOf(u.prototype,i.prototype),Object.setPrototypeOf(u,i);function f(v){if(typeof v!="number")throw new TypeError('"size" argument must be of type number');if(v<0)throw new RangeError('The value "'+v+'" is invalid for option "size"')}function p(v,O,_){return f(v),v<=0?c(v):O!==void 0?typeof _=="string"?c(v).fill(O,_):c(v).fill(O):c(v)}u.alloc=function(v,O,_){return p(v,O,_)};function h(v){return f(v),c(v<0?0:w(v)|0)}u.allocUnsafe=function(v){return h(v)},u.allocUnsafeSlow=function(v){return h(v)};function m(v,O){if((typeof O!="string"||O==="")&&(O="utf8"),!u.isEncoding(O))throw new TypeError("Unknown encoding: "+O);const _=D(v,O)|0;let Y=c(_);const j=Y.write(v,O);return j!==_&&(Y=Y.slice(0,j)),Y}function y(v){const O=v.length<0?0:w(v.length)|0,_=c(O);for(let Y=0;Y<O;Y+=1)_[Y]=v[Y]&255;return _}function g(v){if(ue(v,i)){const O=new i(v);return x(O.buffer,O.byteOffset,O.byteLength)}return y(v)}function x(v,O,_){if(O<0||v.byteLength<O)throw new RangeError('"offset" is outside of buffer bounds');if(v.byteLength<O+(_||0))throw new RangeError('"length" is outside of buffer bounds');let Y;return O===void 0&&_===void 0?Y=new i(v):_===void 0?Y=new i(v,O):Y=new i(v,O,_),Object.setPrototypeOf(Y,u.prototype),Y}function k(v){if(u.isBuffer(v)){const O=w(v.length)|0,_=c(O);return _.length===0||v.copy(_,0,0,O),_}if(v.length!==void 0)return typeof v.length!="number"||we(v.length)?c(0):y(v);if(v.type==="Buffer"&&Array.isArray(v.data))return y(v.data)}function w(v){if(v>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return v|0}function T(v){return+v!=v&&(v=0),u.alloc(+v)}u.isBuffer=function(v){return v!=null&&v._isBuffer===!0&&v!==u.prototype},u.compare=function(v,O){if(ue(v,i)&&(v=u.from(v,v.offset,v.byteLength)),ue(O,i)&&(O=u.from(O,O.offset,O.byteLength)),!u.isBuffer(v)||!u.isBuffer(O))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(v===O)return 0;let _=v.length,Y=O.length;for(let j=0,V=Math.min(_,Y);j<V;++j)if(v[j]!==O[j]){_=v[j],Y=O[j];break}return _<Y?-1:Y<_?1:0},u.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}},u.concat=function(v,O){if(!Array.isArray(v))throw new TypeError('"list" argument must be an Array of Buffers');if(v.length===0)return u.alloc(0);let _;if(O===void 0)for(O=0,_=0;_<v.length;++_)O+=v[_].length;const Y=u.allocUnsafe(O);let j=0;for(_=0;_<v.length;++_){let V=v[_];if(ue(V,i))j+V.length>Y.length?(u.isBuffer(V)||(V=u.from(V)),V.copy(Y,j)):i.prototype.set.call(Y,V,j);else if(u.isBuffer(V))V.copy(Y,j);else throw new TypeError('"list" argument must be an Array of Buffers');j+=V.length}return Y};function D(v,O){if(u.isBuffer(v))return v.length;if(s.isView(v)||ue(v,s))return v.byteLength;if(typeof v!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof v);const _=v.length,Y=arguments.length>2&&arguments[2]===!0;if(!Y&&_===0)return 0;let j=!1;for(;;)switch(O){case"ascii":case"latin1":case"binary":return _;case"utf8":case"utf-8":return fe(v).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _*2;case"hex":return _>>>1;case"base64":return ge(v).length;default:if(j)return Y?-1:fe(v).length;O=(""+O).toLowerCase(),j=!0}}u.byteLength=D;function M(v,O,_){let Y=!1;if((O===void 0||O<0)&&(O=0),O>this.length||((_===void 0||_>this.length)&&(_=this.length),_<=0)||(_>>>=0,O>>>=0,_<=O))return"";for(v||(v="utf8");;)switch(v){case"hex":return B(this,O,_);case"utf8":case"utf-8":return X(this,O,_);case"ascii":return pe(this,O,_);case"latin1":case"binary":return Q(this,O,_);case"base64":return ae(this,O,_);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ee(this,O,_);default:if(Y)throw new TypeError("Unknown encoding: "+v);v=(v+"").toLowerCase(),Y=!0}}u.prototype._isBuffer=!0;function F(v,O,_){const Y=v[O];v[O]=v[_],v[_]=Y}u.prototype.swap16=function(){const v=this.length;if(v%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let O=0;O<v;O+=2)F(this,O,O+1);return this},u.prototype.swap32=function(){const v=this.length;if(v%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let O=0;O<v;O+=4)F(this,O,O+3),F(this,O+1,O+2);return this},u.prototype.swap64=function(){const v=this.length;if(v%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let O=0;O<v;O+=8)F(this,O,O+7),F(this,O+1,O+6),F(this,O+2,O+5),F(this,O+3,O+4);return this},u.prototype.toString=function(){const v=this.length;return v===0?"":arguments.length===0?X(this,0,v):M.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(v){if(!u.isBuffer(v))throw new TypeError("Argument must be a Buffer");return this===v?!0:u.compare(this,v)===0},u.prototype.inspect=function(){let v="";const O=t.INSPECT_MAX_BYTES;return v=this.toString("hex",0,O).replace(/(.{2})/g,"$1 ").trim(),this.length>O&&(v+=" ... "),"<Buffer "+v+">"},r&&(u.prototype[r]=u.prototype.inspect),u.prototype.compare=function(v,O,_,Y,j){if(ue(v,i)&&(v=u.from(v,v.offset,v.byteLength)),!u.isBuffer(v))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof v);if(O===void 0&&(O=0),_===void 0&&(_=v?v.length:0),Y===void 0&&(Y=0),j===void 0&&(j=this.length),O<0||_>v.length||Y<0||j>this.length)throw new RangeError("out of range index");if(Y>=j&&O>=_)return 0;if(Y>=j)return-1;if(O>=_)return 1;if(O>>>=0,_>>>=0,Y>>>=0,j>>>=0,this===v)return 0;let V=j-Y,ne=_-O;const ye=Math.min(V,ne),xe=this.slice(Y,j),ke=v.slice(O,_);for(let Ae=0;Ae<ye;++Ae)if(xe[Ae]!==ke[Ae]){V=xe[Ae],ne=ke[Ae];break}return V<ne?-1:ne<V?1:0};function C(v,O,_,Y,j){if(v.length===0)return-1;if(typeof _=="string"?(Y=_,_=0):_>2147483647?_=2147483647:_<-2147483648&&(_=-2147483648),_=+_,we(_)&&(_=j?0:v.length-1),_<0&&(_=v.length+_),_>=v.length){if(j)return-1;_=v.length-1}else if(_<0)if(j)_=0;else return-1;if(typeof O=="string"&&(O=u.from(O,Y)),u.isBuffer(O))return O.length===0?-1:U(v,O,_,Y,j);if(typeof O=="number")return O=O&255,typeof i.prototype.indexOf=="function"?j?i.prototype.indexOf.call(v,O,_):i.prototype.lastIndexOf.call(v,O,_):U(v,[O],_,Y,j);throw new TypeError("val must be string, number or Buffer")}function U(v,O,_,Y,j){let V=1,ne=v.length,ye=O.length;if(Y!==void 0&&(Y=String(Y).toLowerCase(),Y==="ucs2"||Y==="ucs-2"||Y==="utf16le"||Y==="utf-16le")){if(v.length<2||O.length<2)return-1;V=2,ne/=2,ye/=2,_/=2}function xe(Ae,Oe){return V===1?Ae[Oe]:Ae.readUInt16BE(Oe*V)}let ke;if(j){let Ae=-1;for(ke=_;ke<ne;ke++)if(xe(v,ke)===xe(O,Ae===-1?0:ke-Ae)){if(Ae===-1&&(Ae=ke),ke-Ae+1===ye)return Ae*V}else Ae!==-1&&(ke-=ke-Ae),Ae=-1}else for(_+ye>ne&&(_=ne-ye),ke=_;ke>=0;ke--){let Ae=!0;for(let Oe=0;Oe<ye;Oe++)if(xe(v,ke+Oe)!==xe(O,Oe)){Ae=!1;break}if(Ae)return ke}return-1}u.prototype.includes=function(v,O,_){return this.indexOf(v,O,_)!==-1},u.prototype.indexOf=function(v,O,_){return C(this,v,O,_,!0)},u.prototype.lastIndexOf=function(v,O,_){return C(this,v,O,_,!1)};function ie(v,O,_,Y){_=Number(_)||0;const j=v.length-_;Y?(Y=Number(Y),Y>j&&(Y=j)):Y=j;const V=O.length;Y>V/2&&(Y=V/2);let ne;for(ne=0;ne<Y;++ne){const ye=parseInt(O.substr(ne*2,2),16);if(we(ye))return ne;v[_+ne]=ye}return ne}function I(v,O,_,Y){return ce(fe(O,v.length-_),v,_,Y)}function W(v,O,_,Y){return ce(me(O),v,_,Y)}function A(v,O,_,Y){return ce(ge(O),v,_,Y)}function G(v,O,_,Y){return ce(se(O,v.length-_),v,_,Y)}u.prototype.write=function(v,O,_,Y){if(O===void 0)Y="utf8",_=this.length,O=0;else if(_===void 0&&typeof O=="string")Y=O,_=this.length,O=0;else if(isFinite(O))O=O>>>0,isFinite(_)?(_=_>>>0,Y===void 0&&(Y="utf8")):(Y=_,_=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const j=this.length-O;if((_===void 0||_>j)&&(_=j),v.length>0&&(_<0||O<0)||O>this.length)throw new RangeError("Attempt to write outside buffer bounds");Y||(Y="utf8");let V=!1;for(;;)switch(Y){case"hex":return ie(this,v,O,_);case"utf8":case"utf-8":return I(this,v,O,_);case"ascii":case"latin1":case"binary":return W(this,v,O,_);case"base64":return A(this,v,O,_);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,v,O,_);default:if(V)throw new TypeError("Unknown encoding: "+Y);Y=(""+Y).toLowerCase(),V=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ae(v,O,_){return O===0&&_===v.length?e.fromByteArray(v):e.fromByteArray(v.slice(O,_))}function X(v,O,_){_=Math.min(v.length,_);const Y=[];let j=O;for(;j<_;){const V=v[j];let ne=null,ye=V>239?4:V>223?3:V>191?2:1;if(j+ye<=_){let xe,ke,Ae,Oe;switch(ye){case 1:V<128&&(ne=V);break;case 2:xe=v[j+1],(xe&192)===128&&(Oe=(V&31)<<6|xe&63,Oe>127&&(ne=Oe));break;case 3:xe=v[j+1],ke=v[j+2],(xe&192)===128&&(ke&192)===128&&(Oe=(V&15)<<12|(xe&63)<<6|ke&63,Oe>2047&&(Oe<55296||Oe>57343)&&(ne=Oe));break;case 4:xe=v[j+1],ke=v[j+2],Ae=v[j+3],(xe&192)===128&&(ke&192)===128&&(Ae&192)===128&&(Oe=(V&15)<<18|(xe&63)<<12|(ke&63)<<6|Ae&63,Oe>65535&&Oe<1114112&&(ne=Oe))}}ne===null?(ne=65533,ye=1):ne>65535&&(ne-=65536,Y.push(ne>>>10&1023|55296),ne=56320|ne&1023),Y.push(ne),j+=ye}return J(Y)}const de=4096;function J(v){const O=v.length;if(O<=de)return String.fromCharCode.apply(String,v);let _="",Y=0;for(;Y<O;)_+=String.fromCharCode.apply(String,v.slice(Y,Y+=de));return _}function pe(v,O,_){let Y="";_=Math.min(v.length,_);for(let j=O;j<_;++j)Y+=String.fromCharCode(v[j]&127);return Y}function Q(v,O,_){let Y="";_=Math.min(v.length,_);for(let j=O;j<_;++j)Y+=String.fromCharCode(v[j]);return Y}function B(v,O,_){const Y=v.length;(!O||O<0)&&(O=0),(!_||_<0||_>Y)&&(_=Y);let j="";for(let V=O;V<_;++V)j+=_e[v[V]];return j}function ee(v,O,_){const Y=v.slice(O,_);let j="";for(let V=0;V<Y.length-1;V+=2)j+=String.fromCharCode(Y[V]+Y[V+1]*256);return j}u.prototype.slice=function(v,O){const _=this.length;v=~~v,O=O===void 0?_:~~O,v<0?(v+=_,v<0&&(v=0)):v>_&&(v=_),O<0?(O+=_,O<0&&(O=0)):O>_&&(O=_),O<v&&(O=v);const Y=this.subarray(v,O);return Object.setPrototypeOf(Y,u.prototype),Y};function Z(v,O,_){if(v%1!==0||v<0)throw new RangeError("offset is not uint");if(v+O>_)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(v,O,_){v=v>>>0,O=O>>>0,_||Z(v,O,this.length);let Y=this[v],j=1,V=0;for(;++V<O&&(j*=256);)Y+=this[v+V]*j;return Y},u.prototype.readUintBE=u.prototype.readUIntBE=function(v,O,_){v=v>>>0,O=O>>>0,_||Z(v,O,this.length);let Y=this[v+--O],j=1;for(;O>0&&(j*=256);)Y+=this[v+--O]*j;return Y},u.prototype.readUint8=u.prototype.readUInt8=function(v,O){return v=v>>>0,O||Z(v,1,this.length),this[v]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(v,O){return v=v>>>0,O||Z(v,2,this.length),this[v]|this[v+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(v,O){return v=v>>>0,O||Z(v,2,this.length),this[v]<<8|this[v+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(v,O){return v=v>>>0,O||Z(v,4,this.length),(this[v]|this[v+1]<<8|this[v+2]<<16)+this[v+3]*16777216},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(v,O){return v=v>>>0,O||Z(v,4,this.length),this[v]*16777216+(this[v+1]<<16|this[v+2]<<8|this[v+3])},u.prototype.readBigUInt64LE=Ce(function(v){v=v>>>0,te(v,"offset");const O=this[v],_=this[v+7];(O===void 0||_===void 0)&&L(v,this.length-8);const Y=O+this[++v]*2**8+this[++v]*2**16+this[++v]*2**24,j=this[++v]+this[++v]*2**8+this[++v]*2**16+_*2**24;return BigInt(Y)+(BigInt(j)<<BigInt(32))}),u.prototype.readBigUInt64BE=Ce(function(v){v=v>>>0,te(v,"offset");const O=this[v],_=this[v+7];(O===void 0||_===void 0)&&L(v,this.length-8);const Y=O*2**24+this[++v]*2**16+this[++v]*2**8+this[++v],j=this[++v]*2**24+this[++v]*2**16+this[++v]*2**8+_;return(BigInt(Y)<<BigInt(32))+BigInt(j)}),u.prototype.readIntLE=function(v,O,_){v=v>>>0,O=O>>>0,_||Z(v,O,this.length);let Y=this[v],j=1,V=0;for(;++V<O&&(j*=256);)Y+=this[v+V]*j;return j*=128,Y>=j&&(Y-=Math.pow(2,8*O)),Y},u.prototype.readIntBE=function(v,O,_){v=v>>>0,O=O>>>0,_||Z(v,O,this.length);let Y=O,j=1,V=this[v+--Y];for(;Y>0&&(j*=256);)V+=this[v+--Y]*j;return j*=128,V>=j&&(V-=Math.pow(2,8*O)),V},u.prototype.readInt8=function(v,O){return v=v>>>0,O||Z(v,1,this.length),this[v]&128?(255-this[v]+1)*-1:this[v]},u.prototype.readInt16LE=function(v,O){v=v>>>0,O||Z(v,2,this.length);const _=this[v]|this[v+1]<<8;return _&32768?_|4294901760:_},u.prototype.readInt16BE=function(v,O){v=v>>>0,O||Z(v,2,this.length);const _=this[v+1]|this[v]<<8;return _&32768?_|4294901760:_},u.prototype.readInt32LE=function(v,O){return v=v>>>0,O||Z(v,4,this.length),this[v]|this[v+1]<<8|this[v+2]<<16|this[v+3]<<24},u.prototype.readInt32BE=function(v,O){return v=v>>>0,O||Z(v,4,this.length),this[v]<<24|this[v+1]<<16|this[v+2]<<8|this[v+3]},u.prototype.readBigInt64LE=Ce(function(v){v=v>>>0,te(v,"offset");const O=this[v],_=this[v+7];(O===void 0||_===void 0)&&L(v,this.length-8);const Y=this[v+4]+this[v+5]*2**8+this[v+6]*2**16+(_<<24);return(BigInt(Y)<<BigInt(32))+BigInt(O+this[++v]*2**8+this[++v]*2**16+this[++v]*2**24)}),u.prototype.readBigInt64BE=Ce(function(v){v=v>>>0,te(v,"offset");const O=this[v],_=this[v+7];(O===void 0||_===void 0)&&L(v,this.length-8);const Y=(O<<24)+this[++v]*2**16+this[++v]*2**8+this[++v];return(BigInt(Y)<<BigInt(32))+BigInt(this[++v]*2**24+this[++v]*2**16+this[++v]*2**8+_)}),u.prototype.readFloatLE=function(v,O){return v=v>>>0,O||Z(v,4,this.length),n.read(this,v,!0,23,4)},u.prototype.readFloatBE=function(v,O){return v=v>>>0,O||Z(v,4,this.length),n.read(this,v,!1,23,4)},u.prototype.readDoubleLE=function(v,O){return v=v>>>0,O||Z(v,8,this.length),n.read(this,v,!0,52,8)},u.prototype.readDoubleBE=function(v,O){return v=v>>>0,O||Z(v,8,this.length),n.read(this,v,!1,52,8)};function re(v,O,_,Y,j,V){if(!u.isBuffer(v))throw new TypeError('"buffer" argument must be a Buffer instance');if(O>j||O<V)throw new RangeError('"value" argument is out of bounds');if(_+Y>v.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(v,O,_,Y){if(v=+v,O=O>>>0,_=_>>>0,!Y){const ne=Math.pow(2,8*_)-1;re(this,v,O,_,ne,0)}let j=1,V=0;for(this[O]=v&255;++V<_&&(j*=256);)this[O+V]=v/j&255;return O+_},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(v,O,_,Y){if(v=+v,O=O>>>0,_=_>>>0,!Y){const ne=Math.pow(2,8*_)-1;re(this,v,O,_,ne,0)}let j=_-1,V=1;for(this[O+j]=v&255;--j>=0&&(V*=256);)this[O+j]=v/V&255;return O+_},u.prototype.writeUint8=u.prototype.writeUInt8=function(v,O,_){return v=+v,O=O>>>0,_||re(this,v,O,1,255,0),this[O]=v&255,O+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(v,O,_){return v=+v,O=O>>>0,_||re(this,v,O,2,65535,0),this[O]=v&255,this[O+1]=v>>>8,O+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(v,O,_){return v=+v,O=O>>>0,_||re(this,v,O,2,65535,0),this[O]=v>>>8,this[O+1]=v&255,O+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(v,O,_){return v=+v,O=O>>>0,_||re(this,v,O,4,4294967295,0),this[O+3]=v>>>24,this[O+2]=v>>>16,this[O+1]=v>>>8,this[O]=v&255,O+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(v,O,_){return v=+v,O=O>>>0,_||re(this,v,O,4,4294967295,0),this[O]=v>>>24,this[O+1]=v>>>16,this[O+2]=v>>>8,this[O+3]=v&255,O+4};function K(v,O,_,Y,j){oe(O,Y,j,v,_,7);let V=Number(O&BigInt(4294967295));v[_++]=V,V=V>>8,v[_++]=V,V=V>>8,v[_++]=V,V=V>>8,v[_++]=V;let ne=Number(O>>BigInt(32)&BigInt(4294967295));return v[_++]=ne,ne=ne>>8,v[_++]=ne,ne=ne>>8,v[_++]=ne,ne=ne>>8,v[_++]=ne,_}function $(v,O,_,Y,j){oe(O,Y,j,v,_,7);let V=Number(O&BigInt(4294967295));v[_+7]=V,V=V>>8,v[_+6]=V,V=V>>8,v[_+5]=V,V=V>>8,v[_+4]=V;let ne=Number(O>>BigInt(32)&BigInt(4294967295));return v[_+3]=ne,ne=ne>>8,v[_+2]=ne,ne=ne>>8,v[_+1]=ne,ne=ne>>8,v[_]=ne,_+8}u.prototype.writeBigUInt64LE=Ce(function(v,O=0){return K(this,v,O,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=Ce(function(v,O=0){return $(this,v,O,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(v,O,_,Y){if(v=+v,O=O>>>0,!Y){const ye=Math.pow(2,8*_-1);re(this,v,O,_,ye-1,-ye)}let j=0,V=1,ne=0;for(this[O]=v&255;++j<_&&(V*=256);)v<0&&ne===0&&this[O+j-1]!==0&&(ne=1),this[O+j]=(v/V>>0)-ne&255;return O+_},u.prototype.writeIntBE=function(v,O,_,Y){if(v=+v,O=O>>>0,!Y){const ye=Math.pow(2,8*_-1);re(this,v,O,_,ye-1,-ye)}let j=_-1,V=1,ne=0;for(this[O+j]=v&255;--j>=0&&(V*=256);)v<0&&ne===0&&this[O+j+1]!==0&&(ne=1),this[O+j]=(v/V>>0)-ne&255;return O+_},u.prototype.writeInt8=function(v,O,_){return v=+v,O=O>>>0,_||re(this,v,O,1,127,-128),v<0&&(v=255+v+1),this[O]=v&255,O+1},u.prototype.writeInt16LE=function(v,O,_){return v=+v,O=O>>>0,_||re(this,v,O,2,32767,-32768),this[O]=v&255,this[O+1]=v>>>8,O+2},u.prototype.writeInt16BE=function(v,O,_){return v=+v,O=O>>>0,_||re(this,v,O,2,32767,-32768),this[O]=v>>>8,this[O+1]=v&255,O+2},u.prototype.writeInt32LE=function(v,O,_){return v=+v,O=O>>>0,_||re(this,v,O,4,2147483647,-2147483648),this[O]=v&255,this[O+1]=v>>>8,this[O+2]=v>>>16,this[O+3]=v>>>24,O+4},u.prototype.writeInt32BE=function(v,O,_){return v=+v,O=O>>>0,_||re(this,v,O,4,2147483647,-2147483648),v<0&&(v=4294967295+v+1),this[O]=v>>>24,this[O+1]=v>>>16,this[O+2]=v>>>8,this[O+3]=v&255,O+4},u.prototype.writeBigInt64LE=Ce(function(v,O=0){return K(this,v,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=Ce(function(v,O=0){return $(this,v,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function E(v,O,_,Y,j,V){if(_+Y>v.length)throw new RangeError("Index out of range");if(_<0)throw new RangeError("Index out of range")}function H(v,O,_,Y,j){return O=+O,_=_>>>0,j||E(v,O,_,4),n.write(v,O,_,Y,23,4),_+4}u.prototype.writeFloatLE=function(v,O,_){return H(this,v,O,!0,_)},u.prototype.writeFloatBE=function(v,O,_){return H(this,v,O,!1,_)};function q(v,O,_,Y,j){return O=+O,_=_>>>0,j||E(v,O,_,8),n.write(v,O,_,Y,52,8),_+8}u.prototype.writeDoubleLE=function(v,O,_){return q(this,v,O,!0,_)},u.prototype.writeDoubleBE=function(v,O,_){return q(this,v,O,!1,_)},u.prototype.copy=function(v,O,_,Y){if(!u.isBuffer(v))throw new TypeError("argument should be a Buffer");if(_||(_=0),!Y&&Y!==0&&(Y=this.length),O>=v.length&&(O=v.length),O||(O=0),Y>0&&Y<_&&(Y=_),Y===_||v.length===0||this.length===0)return 0;if(O<0)throw new RangeError("targetStart out of bounds");if(_<0||_>=this.length)throw new RangeError("Index out of range");if(Y<0)throw new RangeError("sourceEnd out of bounds");Y>this.length&&(Y=this.length),v.length-O<Y-_&&(Y=v.length-O+_);const j=Y-_;return this===v&&typeof i.prototype.copyWithin=="function"?this.copyWithin(O,_,Y):i.prototype.set.call(v,this.subarray(_,Y),O),j},u.prototype.fill=function(v,O,_,Y){if(typeof v=="string"){if(typeof O=="string"?(Y=O,O=0,_=this.length):typeof _=="string"&&(Y=_,_=this.length),Y!==void 0&&typeof Y!="string")throw new TypeError("encoding must be a string");if(typeof Y=="string"&&!u.isEncoding(Y))throw new TypeError("Unknown encoding: "+Y);if(v.length===1){const V=v.charCodeAt(0);(Y==="utf8"&&V<128||Y==="latin1")&&(v=V)}}else typeof v=="number"?v=v&255:typeof v=="boolean"&&(v=Number(v));if(O<0||this.length<O||this.length<_)throw new RangeError("Out of range index");if(_<=O)return this;O=O>>>0,_=_===void 0?this.length:_>>>0,v||(v=0);let j;if(typeof v=="number")for(j=O;j<_;++j)this[j]=v;else{const V=u.isBuffer(v)?v:u.from(v,Y),ne=V.length;if(ne===0)throw new TypeError('The value "'+v+'" is invalid for argument "value"');for(j=0;j<_-O;++j)this[j+O]=V[j%ne]}return this};const N={};function R(v,O,_){N[v]=class extends _{constructor(){super(),Object.defineProperty(this,"message",{value:O.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${v}]`,this.stack,delete this.name}get code(){return v}set code(Y){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Y,writable:!0})}toString(){return`${this.name} [${v}]: ${this.message}`}}}R("ERR_BUFFER_OUT_OF_BOUNDS",function(v){return v?`${v} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),R("ERR_INVALID_ARG_TYPE",function(v,O){return`The "${v}" argument must be of type number. Received type ${typeof O}`},TypeError),R("ERR_OUT_OF_RANGE",function(v,O,_){let Y=`The value of "${v}" is out of range.`,j=_;return Number.isInteger(_)&&Math.abs(_)>2**32?j=le(String(_)):typeof _=="bigint"&&(j=String(_),(_>BigInt(2)**BigInt(32)||_<-(BigInt(2)**BigInt(32)))&&(j=le(j)),j+="n"),Y+=` It must be ${O}. Received ${j}`,Y},RangeError);function le(v){let O="",_=v.length;const Y=v[0]==="-"?1:0;for(;_>=Y+4;_-=3)O=`_${v.slice(_-3,_)}${O}`;return`${v.slice(0,_)}${O}`}function S(v,O,_){te(O,"offset"),(v[O]===void 0||v[O+_]===void 0)&&L(O,v.length-(_+1))}function oe(v,O,_,Y,j,V){if(v>_||v<O){const ne=typeof O=="bigint"?"n":"";let ye;throw O===0||O===BigInt(0)?ye=`>= 0${ne} and < 2${ne} ** ${(V+1)*8}${ne}`:ye=`>= -(2${ne} ** ${(V+1)*8-1}${ne}) and < 2 ** ${(V+1)*8-1}${ne}`,new N.ERR_OUT_OF_RANGE("value",ye,v)}S(Y,j,V)}function te(v,O){if(typeof v!="number")throw new N.ERR_INVALID_ARG_TYPE(O,"number",v)}function L(v,O,_){throw Math.floor(v)!==v?(te(v,_),new N.ERR_OUT_OF_RANGE("offset","an integer",v)):O<0?new N.ERR_BUFFER_OUT_OF_BOUNDS:new N.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${O}`,v)}const z=/[^+/0-9A-Za-z-_]/g;function P(v){if(v=v.split("=")[0],v=v.trim().replace(z,""),v.length<2)return"";for(;v.length%4!==0;)v=v+"=";return v}function fe(v,O){O=O||1/0;let _;const Y=v.length;let j=null;const V=[];for(let ne=0;ne<Y;++ne){if(_=v.charCodeAt(ne),_>55295&&_<57344){if(!j){if(_>56319){(O-=3)>-1&&V.push(239,191,189);continue}else if(ne+1===Y){(O-=3)>-1&&V.push(239,191,189);continue}j=_;continue}if(_<56320){(O-=3)>-1&&V.push(239,191,189),j=_;continue}_=(j-55296<<10|_-56320)+65536}else j&&(O-=3)>-1&&V.push(239,191,189);if(j=null,_<128){if((O-=1)<0)break;V.push(_)}else if(_<2048){if((O-=2)<0)break;V.push(_>>6|192,_&63|128)}else if(_<65536){if((O-=3)<0)break;V.push(_>>12|224,_>>6&63|128,_&63|128)}else if(_<1114112){if((O-=4)<0)break;V.push(_>>18|240,_>>12&63|128,_>>6&63|128,_&63|128)}else throw new Error("Invalid code point")}return V}function me(v){const O=[];for(let _=0;_<v.length;++_)O.push(v.charCodeAt(_)&255);return O}function se(v,O){let _,Y,j;const V=[];for(let ne=0;ne<v.length&&!((O-=2)<0);++ne)_=v.charCodeAt(ne),Y=_>>8,j=_%256,V.push(j),V.push(Y);return V}function ge(v){return e.toByteArray(P(v))}function ce(v,O,_,Y){let j;for(j=0;j<Y&&!(j+_>=O.length||j>=v.length);++j)O[j+_]=v[j];return j}function ue(v,O){return v instanceof O||v!=null&&v.constructor!=null&&v.constructor.name!=null&&v.constructor.name===O.name}function we(v){return v!==v}const _e=function(){const v="0123456789abcdef",O=new Array(256);for(let _=0;_<16;++_){const Y=_*16;for(let j=0;j<16;++j)O[Y+j]=v[_]+v[j]}return O}();function Ce(v){return typeof BigInt>"u"?dt:v}function dt(){throw new Error("BigInt not supported")}})(gt);const St=gt.Buffer,gS=gt.Blob,yS=gt.BlobOptions,bS=gt.Buffer,wS=gt.File,vS=gt.FileOptions,xS=gt.INSPECT_MAX_BYTES,kS=gt.SlowBuffer,SS=gt.TranscodeEncoding,CS=gt.atob,ES=gt.btoa,AS=gt.constants,$S=gt.isAscii,TS=gt.isUtf8,OS=gt.kMaxLength,DS=gt.kStringMaxLength,MS=gt.resolveObjectURL,_S=gt.transcode,NS=Object.freeze(Object.defineProperty({__proto__:null,Blob:gS,BlobOptions:yS,Buffer:bS,File:wS,FileOptions:vS,INSPECT_MAX_BYTES:xS,SlowBuffer:kS,TranscodeEncoding:SS,atob:CS,btoa:ES,constants:AS,default:St,isAscii:$S,isUtf8:TS,kMaxLength:OS,kStringMaxLength:DS,resolveObjectURL:MS,transcode:_S},Symbol.toStringTag,{value:"Module"}));var m0={},Fs={exports:{}},Dp;function uf(){if(Dp)return Fs.exports;Dp=1;var t=typeof Reflect=="object"?Reflect:null,e=t&&typeof t.apply=="function"?t.apply:function(w,T,D){return Function.prototype.apply.call(w,T,D)},n;t&&typeof t.ownKeys=="function"?n=t.ownKeys:Object.getOwnPropertySymbols?n=function(w){return Object.getOwnPropertyNames(w).concat(Object.getOwnPropertySymbols(w))}:n=function(w){return Object.getOwnPropertyNames(w)};function r(w){console&&console.warn&&console.warn(w)}var o=Number.isNaN||function(w){return w!==w};function i(){i.init.call(this)}Fs.exports=i,Fs.exports.once=g,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function a(w){if(typeof w!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof w)}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(w){if(typeof w!="number"||w<0||o(w))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+w+".");s=w}}),i.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},i.prototype.setMaxListeners=function(w){if(typeof w!="number"||w<0||o(w))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+w+".");return this._maxListeners=w,this};function l(w){return w._maxListeners===void 0?i.defaultMaxListeners:w._maxListeners}i.prototype.getMaxListeners=function(){return l(this)},i.prototype.emit=function(w){for(var T=[],D=1;D<arguments.length;D++)T.push(arguments[D]);var M=w==="error",F=this._events;if(F!==void 0)M=M&&F.error===void 0;else if(!M)return!1;if(M){var C;if(T.length>0&&(C=T[0]),C instanceof Error)throw C;var U=new Error("Unhandled error."+(C?" ("+C.message+")":""));throw U.context=C,U}var ie=F[w];if(ie===void 0)return!1;if(typeof ie=="function")e(ie,this,T);else for(var I=ie.length,W=h(ie,I),D=0;D<I;++D)e(W[D],this,T);return!0};function c(w,T,D,M){var F,C,U;if(a(D),C=w._events,C===void 0?(C=w._events=Object.create(null),w._eventsCount=0):(C.newListener!==void 0&&(w.emit("newListener",T,D.listener?D.listener:D),C=w._events),U=C[T]),U===void 0)U=C[T]=D,++w._eventsCount;else if(typeof U=="function"?U=C[T]=M?[D,U]:[U,D]:M?U.unshift(D):U.push(D),F=l(w),F>0&&U.length>F&&!U.warned){U.warned=!0;var ie=new Error("Possible EventEmitter memory leak detected. "+U.length+" "+String(T)+" listeners added. Use emitter.setMaxListeners() to increase limit");ie.name="MaxListenersExceededWarning",ie.emitter=w,ie.type=T,ie.count=U.length,r(ie)}return w}i.prototype.addListener=function(w,T){return c(this,w,T,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(w,T){return c(this,w,T,!0)};function u(){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 d(w,T,D){var M={fired:!1,wrapFn:void 0,target:w,type:T,listener:D},F=u.bind(M);return F.listener=D,M.wrapFn=F,F}i.prototype.once=function(w,T){return a(T),this.on(w,d(this,w,T)),this},i.prototype.prependOnceListener=function(w,T){return a(T),this.prependListener(w,d(this,w,T)),this},i.prototype.removeListener=function(w,T){var D,M,F,C,U;if(a(T),M=this._events,M===void 0)return this;if(D=M[w],D===void 0)return this;if(D===T||D.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete M[w],M.removeListener&&this.emit("removeListener",w,D.listener||T));else if(typeof D!="function"){for(F=-1,C=D.length-1;C>=0;C--)if(D[C]===T||D[C].listener===T){U=D[C].listener,F=C;break}if(F<0)return this;F===0?D.shift():m(D,F),D.length===1&&(M[w]=D[0]),M.removeListener!==void 0&&this.emit("removeListener",w,U||T)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(w){var T,D,M;if(D=this._events,D===void 0)return this;if(D.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):D[w]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete D[w]),this;if(arguments.length===0){var F=Object.keys(D),C;for(M=0;M<F.length;++M)C=F[M],C!=="removeListener"&&this.removeAllListeners(C);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=D[w],typeof T=="function")this.removeListener(w,T);else if(T!==void 0)for(M=T.length-1;M>=0;M--)this.removeListener(w,T[M]);return this};function f(w,T,D){var M=w._events;if(M===void 0)return[];var F=M[T];return F===void 0?[]:typeof F=="function"?D?[F.listener||F]:[F]:D?y(F):h(F,F.length)}i.prototype.listeners=function(w){return f(this,w,!0)},i.prototype.rawListeners=function(w){return f(this,w,!1)},i.listenerCount=function(w,T){return typeof w.listenerCount=="function"?w.listenerCount(T):p.call(w,T)},i.prototype.listenerCount=p;function p(w){var T=this._events;if(T!==void 0){var D=T[w];if(typeof D=="function")return 1;if(D!==void 0)return D.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function h(w,T){for(var D=new Array(T),M=0;M<T;++M)D[M]=w[M];return D}function m(w,T){for(;T+1<w.length;T++)w[T]=w[T+1];w.pop()}function y(w){for(var T=new Array(w.length),D=0;D<T.length;++D)T[D]=w[D].listener||w[D];return T}function g(w,T){return new Promise(function(D,M){function F(U){w.removeListener(T,C),M(U)}function C(){typeof w.removeListener=="function"&&w.removeListener("error",F),D([].slice.call(arguments))}k(w,T,C,{once:!0}),T!=="error"&&x(w,F,{once:!0})})}function x(w,T,D){typeof w.on=="function"&&k(w,"error",T,D)}function k(w,T,D,M){if(typeof w.on=="function")M.once?w.once(T,D):w.on(T,D);else if(typeof w.addEventListener=="function")w.addEventListener(T,function F(C){M.once&&w.removeEventListener(T,F),D(C)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof w)}return Fs.exports}var Vl={exports:{}},Mp;function ho(){return Mp||(Mp=1,typeof Object.create=="function"?Vl.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Vl.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}),Vl.exports}function IS(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var g0={exports:{}},ct=g0.exports={},An,$n;function Bu(){throw new Error("setTimeout has not been defined")}function Ru(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?An=setTimeout:An=Bu}catch{An=Bu}try{typeof clearTimeout=="function"?$n=clearTimeout:$n=Ru}catch{$n=Ru}})();function y0(t){if(An===setTimeout)return setTimeout(t,0);if((An===Bu||!An)&&setTimeout)return An=setTimeout,setTimeout(t,0);try{return An(t,0)}catch{try{return An.call(null,t,0)}catch{return An.call(this,t,0)}}}function FS(t){if($n===clearTimeout)return clearTimeout(t);if(($n===Ru||!$n)&&clearTimeout)return $n=clearTimeout,clearTimeout(t);try{return $n(t)}catch{try{return $n.call(null,t)}catch{return $n.call(this,t)}}}var Jn=[],Lo=!1,qr,ca=-1;function BS(){!Lo||!qr||(Lo=!1,qr.length?Jn=qr.concat(Jn):ca=-1,Jn.length&&b0())}function b0(){if(!Lo){var t=y0(BS);Lo=!0;for(var e=Jn.length;e;){for(qr=Jn,Jn=[];++ca<e;)qr&&qr[ca].run();ca=-1,e=Jn.length}qr=null,Lo=!1,FS(t)}}ct.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];Jn.push(new w0(t,e)),Jn.length===1&&!Lo&&y0(b0)};function w0(t,e){this.fun=t,this.array=e}w0.prototype.run=function(){this.fun.apply(null,this.array)};ct.title="browser";ct.browser=!0;ct.env={};ct.argv=[];ct.version="";ct.versions={};function or(){}ct.on=or;ct.addListener=or;ct.once=or;ct.off=or;ct.removeListener=or;ct.removeAllListeners=or;ct.emit=or;ct.prependListener=or;ct.prependOnceListener=or;ct.listeners=function(t){return[]};ct.binding=function(t){throw new Error("process.binding is not supported")};ct.cwd=function(){return"/"};ct.chdir=function(t){throw new Error("process.chdir is not supported")};ct.umask=function(){return 0};var RS=g0.exports;const Se=IS(RS);var _p,Np;function v0(){return Np||(Np=1,_p=uf().EventEmitter),_p}const yl=aS(NS);var Ip={},Fp={},Bp,Rp;function x0(){return Rp||(Rp=1,Bp=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),n=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var r=42;t[e]=r;for(var o in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var i=Object.getOwnPropertySymbols(t);if(i.length!==1||i[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,e);if(s.value!==r||s.enumerable!==!0)return!1}return!0}),Bp}var Ul,Lp;function bl(){if(Lp)return Ul;Lp=1;var t=x0();return Ul=function(){return t()&&!!Symbol.toStringTag},Ul}var Pp,zp;function k0(){return zp||(zp=1,Pp=Object),Pp}var jp,qp;function LS(){return qp||(qp=1,jp=Error),jp}var Vp,Up;function PS(){return Up||(Up=1,Vp=EvalError),Vp}var Hp,Wp;function zS(){return Wp||(Wp=1,Hp=RangeError),Hp}var Gp,Kp;function jS(){return Kp||(Kp=1,Gp=ReferenceError),Gp}var Xp,Jp;function S0(){return Jp||(Jp=1,Xp=SyntaxError),Xp}var Yp,Zp;function ws(){return Zp||(Zp=1,Yp=TypeError),Yp}var Qp,eh;function qS(){return eh||(eh=1,Qp=URIError),Qp}var th,nh;function VS(){return nh||(nh=1,th=Math.abs),th}var rh,oh;function US(){return oh||(oh=1,rh=Math.floor),rh}var ih,sh;function HS(){return sh||(sh=1,ih=Math.max),ih}var ah,lh;function WS(){return lh||(lh=1,ah=Math.min),ah}var ch,uh;function GS(){return uh||(uh=1,ch=Math.pow),ch}var dh,fh;function KS(){return fh||(fh=1,dh=Math.round),dh}var ph,hh;function XS(){return hh||(hh=1,ph=Number.isNaN||function(t){return t!==t}),ph}var Hl,mh;function JS(){if(mh)return Hl;mh=1;var t=XS();return Hl=function(e){return t(e)||e===0?e:e<0?-1:1},Hl}var gh,yh;function YS(){return yh||(yh=1,gh=Object.getOwnPropertyDescriptor),gh}var Wl,bh;function oi(){if(bh)return Wl;bh=1;var t=YS();if(t)try{t([],"length")}catch{t=null}return Wl=t,Wl}var Gl,wh;function wl(){if(wh)return Gl;wh=1;var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return Gl=t,Gl}var Kl,vh;function ZS(){if(vh)return Kl;vh=1;var t=typeof Symbol<"u"&&Symbol,e=x0();return Kl=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},Kl}var xh,kh;function C0(){return kh||(kh=1,xh=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),xh}var Xl,Sh;function E0(){if(Sh)return Xl;Sh=1;var t=k0();return Xl=t.getPrototypeOf||null,Xl}var Jl,Ch;function QS(){if(Ch)return Jl;Ch=1;var t="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,n=Math.max,r="[object Function]",o=function(a,l){for(var c=[],u=0;u<a.length;u+=1)c[u]=a[u];for(var d=0;d<l.length;d+=1)c[d+a.length]=l[d];return c},i=function(a,l){for(var c=[],u=l,d=0;u<a.length;u+=1,d+=1)c[d]=a[u];return c},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 Jl=function(a){var l=this;if(typeof l!="function"||e.apply(l)!==r)throw new TypeError(t+l);for(var c=i(arguments,1),u,d=function(){if(this instanceof u){var y=l.apply(this,o(c,arguments));return Object(y)===y?y:this}return l.apply(a,o(c,arguments))},f=n(0,l.length-c.length),p=[],h=0;h<f;h++)p[h]="$"+h;if(u=Function("binder","return function ("+s(p,",")+"){ return binder.apply(this,arguments); }")(d),l.prototype){var m=function(){};m.prototype=l.prototype,u.prototype=new m,m.prototype=null}return u},Jl}var Yl,Eh;function vs(){if(Eh)return Yl;Eh=1;var t=QS();return Yl=Function.prototype.bind||t,Yl}var Ah,$h;function df(){return $h||($h=1,Ah=Function.prototype.call),Ah}var Th,Oh;function ff(){return Oh||(Oh=1,Th=Function.prototype.apply),Th}var Dh,Mh;function e3(){return Mh||(Mh=1,Dh=typeof Reflect<"u"&&Reflect&&Reflect.apply),Dh}var Zl,_h;function A0(){if(_h)return Zl;_h=1;var t=vs(),e=ff(),n=df(),r=e3();return Zl=r||t.call(n,e),Zl}var Ql,Nh;function pf(){if(Nh)return Ql;Nh=1;var t=vs(),e=ws(),n=df(),r=A0();return Ql=function(o){if(o.length<1||typeof o[0]!="function")throw new e("a function is required");return r(t,n,o)},Ql}var ec,Ih;function t3(){if(Ih)return ec;Ih=1;var t=pf(),e=oi(),n;try{n=[].__proto__===Array.prototype}catch(s){if(!s||typeof s!="object"||!("code"in s)||s.code!=="ERR_PROTO_ACCESS")throw s}var r=!!n&&e&&e(Object.prototype,"__proto__"),o=Object,i=o.getPrototypeOf;return ec=r&&typeof r.get=="function"?t([r.get]):typeof i=="function"?function(s){return i(s==null?s:o(s))}:!1,ec}var tc,Fh;function hf(){if(Fh)return tc;Fh=1;var t=C0(),e=E0(),n=t3();return tc=t?function(r){return t(r)}:e?function(r){if(!r||typeof r!="object"&&typeof r!="function")throw new TypeError("getProto: not an object");return e(r)}:n?function(r){return n(r)}:null,tc}var nc,Bh;function $0(){if(Bh)return nc;Bh=1;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,n=vs();return nc=n.call(t,e),nc}var rc,Rh;function T0(){if(Rh)return rc;Rh=1;var t,e=k0(),n=LS(),r=PS(),o=zS(),i=jS(),s=S0(),a=ws(),l=qS(),c=VS(),u=US(),d=HS(),f=WS(),p=GS(),h=KS(),m=JS(),y=Function,g=function(H){try{return y('"use strict"; return ('+H+").constructor;")()}catch{}},x=oi(),k=wl(),w=function(){throw new a},T=x?function(){try{return arguments.callee,w}catch{try{return x(arguments,"callee").get}catch{return w}}}():w,D=ZS()(),M=hf(),F=E0(),C=C0(),U=ff(),ie=df(),I={},W=typeof Uint8Array>"u"||!M?t:M(Uint8Array),A={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":D&&M?M([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":I,"%AsyncGenerator%":I,"%AsyncGeneratorFunction%":I,"%AsyncIteratorPrototype%":I,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":r,"%Float16Array%":typeof Float16Array>"u"?t:Float16Array,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":y,"%GeneratorFunction%":I,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":D&&M?M(M([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!D||!M?t:M(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":x,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":o,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!D||!M?t:M(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":D&&M?M(""[Symbol.iterator]()):t,"%Symbol%":D?Symbol:t,"%SyntaxError%":s,"%ThrowTypeError%":T,"%TypedArray%":W,"%TypeError%":a,"%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%":l,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet,"%Function.prototype.call%":ie,"%Function.prototype.apply%":U,"%Object.defineProperty%":k,"%Object.getPrototypeOf%":F,"%Math.abs%":c,"%Math.floor%":u,"%Math.max%":d,"%Math.min%":f,"%Math.pow%":p,"%Math.round%":h,"%Math.sign%":m,"%Reflect.getPrototypeOf%":C};if(M)try{null.error}catch(H){var G=M(M(H));A["%Error.prototype%"]=G}var ae=function H(q){var N;if(q==="%AsyncFunction%")N=g("async function () {}");else if(q==="%GeneratorFunction%")N=g("function* () {}");else if(q==="%AsyncGeneratorFunction%")N=g("async function* () {}");else if(q==="%AsyncGenerator%"){var R=H("%AsyncGeneratorFunction%");R&&(N=R.prototype)}else if(q==="%AsyncIteratorPrototype%"){var le=H("%AsyncGenerator%");le&&M&&(N=M(le.prototype))}return A[q]=N,N},X={__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"]},de=vs(),J=$0(),pe=de.call(ie,Array.prototype.concat),Q=de.call(U,Array.prototype.splice),B=de.call(ie,String.prototype.replace),ee=de.call(ie,String.prototype.slice),Z=de.call(ie,RegExp.prototype.exec),re=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,K=/\\(\\)?/g,$=function(H){var q=ee(H,0,1),N=ee(H,-1);if(q==="%"&&N!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(N==="%"&&q!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var R=[];return B(H,re,function(le,S,oe,te){R[R.length]=oe?B(te,K,"$1"):S||le}),R},E=function(H,q){var N=H,R;if(J(X,N)&&(R=X[N],N="%"+R[0]+"%"),J(A,N)){var le=A[N];if(le===I&&(le=ae(N)),typeof le>"u"&&!q)throw new a("intrinsic "+H+" exists, but is not available. Please file an issue!");return{alias:R,name:N,value:le}}throw new s("intrinsic "+H+" does not exist!")};return rc=function(H,q){if(typeof H!="string"||H.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof q!="boolean")throw new a('"allowMissing" argument must be a boolean');if(Z(/^%?[^%]*%?$/,H)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var N=$(H),R=N.length>0?N[0]:"",le=E("%"+R+"%",q),S=le.name,oe=le.value,te=!1,L=le.alias;L&&(R=L[0],Q(N,pe([0,1],L)));for(var z=1,P=!0;z<N.length;z+=1){var fe=N[z],me=ee(fe,0,1),se=ee(fe,-1);if((me==='"'||me==="'"||me==="`"||se==='"'||se==="'"||se==="`")&&me!==se)throw new s("property names with quotes must have matching quotes");if((fe==="constructor"||!P)&&(te=!0),R+="."+fe,S="%"+R+"%",J(A,S))oe=A[S];else if(oe!=null){if(!(fe in oe)){if(!q)throw new a("base intrinsic for "+H+" exists, but the property is not available.");return}if(x&&z+1>=N.length){var ge=x(oe,fe);P=!!ge,P&&"get"in ge&&!("originalValue"in ge.get)?oe=ge.get:oe=oe[fe]}else P=J(oe,fe),oe=oe[fe];P&&!te&&(A[S]=oe)}}return oe},rc}var oc,Lh;function xs(){if(Lh)return oc;Lh=1;var t=T0(),e=pf(),n=e([t("%String.prototype.indexOf%")]);return oc=function(r,o){var i=t(r,!!o);return typeof i=="function"&&n(r,".prototype.")>-1?e([i]):i},oc}var ic,Ph;function n3(){if(Ph)return ic;Ph=1;var t=bl()(),e=xs(),n=e("Object.prototype.toString"),r=function(s){return t&&s&&typeof s=="object"&&Symbol.toStringTag in s?!1:n(s)==="[object Arguments]"},o=function(s){return r(s)?!0:s!==null&&typeof s=="object"&&"length"in s&&typeof s.length=="number"&&s.length>=0&&n(s)!=="[object Array]"&&"callee"in s&&n(s.callee)==="[object Function]"},i=function(){return r(arguments)}();return r.isLegacyArguments=o,ic=i?r:o,ic}var sc,zh;function r3(){if(zh)return sc;zh=1;var t=xs(),e=bl()(),n=$0(),r=oi(),o;if(e){var i=t("RegExp.prototype.exec"),s={},a=function(){throw s},l={toString:a,valueOf:a};typeof Symbol.toPrimitive=="symbol"&&(l[Symbol.toPrimitive]=a),o=function(d){if(!d||typeof d!="object")return!1;var f=r(d,"lastIndex"),p=f&&n(f,"value");if(!p)return!1;try{i(d,l)}catch(h){return h===s}}}else{var c=t("Object.prototype.toString"),u="[object RegExp]";o=function(d){return!d||typeof d!="object"&&typeof d!="function"?!1:c(d)===u}}return sc=o,sc}var ac,jh;function o3(){if(jh)return ac;jh=1;var t=xs(),e=r3(),n=t("RegExp.prototype.exec"),r=ws();return ac=function(o){if(!e(o))throw new r("`regex` must be a RegExp");return function(i){return n(o,i)!==null}},ac}var lc,qh;function i3(){if(qh)return lc;qh=1;var t=xs(),e=o3(),n=e(/^\s*(?:function)?\*/),r=bl()(),o=hf(),i=t("Object.prototype.toString"),s=t("Function.prototype.toString"),a=function(){if(!r)return!1;try{return Function("return function*() {}")()}catch{}},l;return lc=function(c){if(typeof c!="function")return!1;if(n(s(c)))return!0;if(!r){var u=i(c);return u==="[object GeneratorFunction]"}if(!o)return!1;if(typeof l>"u"){var d=a();l=d?o(d):!1}return o(c)===l},lc}var cc,Vh;function s3(){if(Vh)return cc;Vh=1;var t=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,n,r;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{n=Object.defineProperty({},"length",{get:function(){throw r}}),r={},e(function(){throw 42},null,n)}catch(x){x!==r&&(e=null)}else e=null;var o=/^\s*class\b/,i=function(x){try{var k=t.call(x);return o.test(k)}catch{return!1}},s=function(x){try{return i(x)?!1:(t.call(x),!0)}catch{return!1}},a=Object.prototype.toString,l="[object Object]",c="[object Function]",u="[object GeneratorFunction]",d="[object HTMLAllCollection]",f="[object HTML document.all class]",p="[object HTMLCollection]",h=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(x){if((m||!x)&&(typeof x>"u"||typeof x=="object"))try{var k=a.call(x);return(k===d||k===f||k===p||k===l)&&x("")==null}catch{}return!1})}return cc=e?function(x){if(y(x))return!0;if(!x||typeof x!="function"&&typeof x!="object")return!1;try{e(x,null,n)}catch(k){if(k!==r)return!1}return!i(x)&&s(x)}:function(x){if(y(x))return!0;if(!x||typeof x!="function"&&typeof x!="object")return!1;if(h)return s(x);if(i(x))return!1;var k=a.call(x);return k!==c&&k!==u&&!/^\[object HTML/.test(k)?!1:s(x)},cc}var uc,Uh;function a3(){if(Uh)return uc;Uh=1;var t=s3(),e=Object.prototype.toString,n=Object.prototype.hasOwnProperty,r=function(a,l,c){for(var u=0,d=a.length;u<d;u++)n.call(a,u)&&(c==null?l(a[u],u,a):l.call(c,a[u],u,a))},o=function(a,l,c){for(var u=0,d=a.length;u<d;u++)c==null?l(a.charAt(u),u,a):l.call(c,a.charAt(u),u,a)},i=function(a,l,c){for(var u in a)n.call(a,u)&&(c==null?l(a[u],u,a):l.call(c,a[u],u,a))};function s(a){return e.call(a)==="[object Array]"}return uc=function(a,l,c){if(!t(l))throw new TypeError("iterator must be a function");var u;arguments.length>=3&&(u=c),s(a)?r(a,l,u):typeof a=="string"?o(a,l,u):i(a,l,u)},uc}var Hh,Wh;function l3(){return Wh||(Wh=1,Hh=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Hh}var dc,Gh;function c3(){if(Gh)return dc;Gh=1;var t=l3(),e=typeof globalThis>"u"?zt:globalThis;return dc=function(){for(var n=[],r=0;r<t.length;r++)typeof e[t[r]]=="function"&&(n[n.length]=t[r]);return n},dc}var Kh={exports:{}},fc,Xh;function u3(){if(Xh)return fc;Xh=1;var t=wl(),e=S0(),n=ws(),r=oi();return fc=function(o,i,s){if(!o||typeof o!="object"&&typeof o!="function")throw new n("`obj` must be an object or a function`");if(typeof i!="string"&&typeof i!="symbol")throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new n("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,d=!!r&&r(o,i);if(t)t(o,i,{configurable:c===null&&d?d.configurable:!c,enumerable:a===null&&d?d.enumerable:!a,value:s,writable:l===null&&d?d.writable:!l});else if(u||!a&&!l&&!c)o[i]=s;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},fc}var pc,Jh;function d3(){if(Jh)return pc;Jh=1;var t=wl(),e=function(){return!!t};return e.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},pc=e,pc}var hc,Yh;function f3(){if(Yh)return hc;Yh=1;var t=T0(),e=u3(),n=d3()(),r=oi(),o=ws(),i=t("%Math.floor%");return hc=function(s,a){if(typeof s!="function")throw new o("`fn` is not a function");if(typeof a!="number"||a<0||a>4294967295||i(a)!==a)throw new o("`length` must be a positive 32-bit integer");var l=arguments.length>2&&!!arguments[2],c=!0,u=!0;if("length"in s&&r){var d=r(s,"length");d&&!d.configurable&&(c=!1),d&&!d.writable&&(u=!1)}return(c||u||!l)&&(n?e(s,"length",a,!0,!0):e(s,"length",a)),s},hc}var mc,Zh;function p3(){if(Zh)return mc;Zh=1;var t=vs(),e=ff(),n=A0();return mc=function(){return n(t,e,arguments)},mc}var Qh;function h3(){return Qh||(Qh=1,function(t){var e=f3(),n=wl(),r=pf(),o=p3();t.exports=function(i){var s=r(arguments),a=i.length-(arguments.length-1);return e(s,1+(a>0?a:0),!0)},n?n(t.exports,"apply",{value:o}):t.exports.apply=o}(Kh)),Kh.exports}var gc,em;function O0(){if(em)return gc;em=1;var t=a3(),e=c3(),n=h3(),r=xs(),o=oi(),i=hf(),s=r("Object.prototype.toString"),a=bl()(),l=typeof globalThis>"u"?zt:globalThis,c=e(),u=r("String.prototype.slice"),d=r("Array.prototype.indexOf",!0)||function(m,y){for(var g=0;g<m.length;g+=1)if(m[g]===y)return g;return-1},f={__proto__:null};a&&o&&i?t(c,function(m){var y=new l[m];if(Symbol.toStringTag in y&&i){var g=i(y),x=o(g,Symbol.toStringTag);if(!x&&g){var k=i(g);x=o(k,Symbol.toStringTag)}f["$"+m]=n(x.get)}}):t(c,function(m){var y=new l[m],g=y.slice||y.set;g&&(f["$"+m]=n(g))});var p=function(m){var y=!1;return t(f,function(g,x){if(!y)try{"$"+g(m)===x&&(y=u(x,1))}catch{}}),y},h=function(m){var y=!1;return t(f,function(g,x){if(!y)try{g(m),y=u(x,1)}catch{}}),y};return gc=function(m){if(!m||typeof m!="object")return!1;if(!a){var y=u(s(m),8,-1);return d(c,y)>-1?y:y!=="Object"?!1:h(m)}return o?p(m):null},gc}var yc,tm;function m3(){if(tm)return yc;tm=1;var t=O0();return yc=function(e){return!!t(e)},yc}var nm;function g3(){return nm||(nm=1,function(t){var e=n3(),n=i3(),r=O0(),o=m3();function i(P){return P.call.bind(P)}var s=typeof BigInt<"u",a=typeof Symbol<"u",l=i(Object.prototype.toString),c=i(Number.prototype.valueOf),u=i(String.prototype.valueOf),d=i(Boolean.prototype.valueOf);if(s)var f=i(BigInt.prototype.valueOf);if(a)var p=i(Symbol.prototype.valueOf);function h(P,fe){if(typeof P!="object")return!1;try{return fe(P),!0}catch{return!1}}t.isArgumentsObject=e,t.isGeneratorFunction=n,t.isTypedArray=o;function m(P){return typeof Promise<"u"&&P instanceof Promise||P!==null&&typeof P=="object"&&typeof P.then=="function"&&typeof P.catch=="function"}t.isPromise=m;function y(P){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(P):o(P)||ee(P)}t.isArrayBufferView=y;function g(P){return r(P)==="Uint8Array"}t.isUint8Array=g;function x(P){return r(P)==="Uint8ClampedArray"}t.isUint8ClampedArray=x;function k(P){return r(P)==="Uint16Array"}t.isUint16Array=k;function w(P){return r(P)==="Uint32Array"}t.isUint32Array=w;function T(P){return r(P)==="Int8Array"}t.isInt8Array=T;function D(P){return r(P)==="Int16Array"}t.isInt16Array=D;function M(P){return r(P)==="Int32Array"}t.isInt32Array=M;function F(P){return r(P)==="Float32Array"}t.isFloat32Array=F;function C(P){return r(P)==="Float64Array"}t.isFloat64Array=C;function U(P){return r(P)==="BigInt64Array"}t.isBigInt64Array=U;function ie(P){return r(P)==="BigUint64Array"}t.isBigUint64Array=ie;function I(P){return l(P)==="[object Map]"}I.working=typeof Map<"u"&&I(new Map);function W(P){return typeof Map>"u"?!1:I.working?I(P):P instanceof Map}t.isMap=W;function A(P){return l(P)==="[object Set]"}A.working=typeof Set<"u"&&A(new Set);function G(P){return typeof Set>"u"?!1:A.working?A(P):P instanceof Set}t.isSet=G;function ae(P){return l(P)==="[object WeakMap]"}ae.working=typeof WeakMap<"u"&&ae(new WeakMap);function X(P){return typeof WeakMap>"u"?!1:ae.working?ae(P):P instanceof WeakMap}t.isWeakMap=X;function de(P){return l(P)==="[object WeakSet]"}de.working=typeof WeakSet<"u"&&de(new WeakSet);function J(P){return de(P)}t.isWeakSet=J;function pe(P){return l(P)==="[object ArrayBuffer]"}pe.working=typeof ArrayBuffer<"u"&&pe(new ArrayBuffer);function Q(P){return typeof ArrayBuffer>"u"?!1:pe.working?pe(P):P instanceof ArrayBuffer}t.isArrayBuffer=Q;function B(P){return l(P)==="[object DataView]"}B.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&B(new DataView(new ArrayBuffer(1),0,1));function ee(P){return typeof DataView>"u"?!1:B.working?B(P):P instanceof DataView}t.isDataView=ee;var Z=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function re(P){return l(P)==="[object SharedArrayBuffer]"}function K(P){return typeof Z>"u"?!1:(typeof re.working>"u"&&(re.working=re(new Z)),re.working?re(P):P instanceof Z)}t.isSharedArrayBuffer=K;function $(P){return l(P)==="[object AsyncFunction]"}t.isAsyncFunction=$;function E(P){return l(P)==="[object Map Iterator]"}t.isMapIterator=E;function H(P){return l(P)==="[object Set Iterator]"}t.isSetIterator=H;function q(P){return l(P)==="[object Generator]"}t.isGeneratorObject=q;function N(P){return l(P)==="[object WebAssembly.Module]"}t.isWebAssemblyCompiledModule=N;function R(P){return h(P,c)}t.isNumberObject=R;function le(P){return h(P,u)}t.isStringObject=le;function S(P){return h(P,d)}t.isBooleanObject=S;function oe(P){return s&&h(P,f)}t.isBigIntObject=oe;function te(P){return a&&h(P,p)}t.isSymbolObject=te;function L(P){return R(P)||le(P)||S(P)||oe(P)||te(P)}t.isBoxedPrimitive=L;function z(P){return typeof Uint8Array<"u"&&(Q(P)||K(P))}t.isAnyArrayBuffer=z,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(P){Object.defineProperty(t,P,{enumerable:!1,value:function(){throw new Error(P+" is not supported in userland")}})})}(Fp)),Fp}var rm,om;function y3(){return om||(om=1,rm=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"}),rm}var im;function D0(){return im||(im=1,function(t){var e=Object.getOwnPropertyDescriptors||function(B){for(var ee=Object.keys(B),Z={},re=0;re<ee.length;re++)Z[ee[re]]=Object.getOwnPropertyDescriptor(B,ee[re]);return Z},n=/%[sdj%]/g;t.format=function(B){if(!T(B)){for(var ee=[],Z=0;Z<arguments.length;Z++)ee.push(s(arguments[Z]));return ee.join(" ")}for(var Z=1,re=arguments,K=re.length,$=String(B).replace(n,function(q){if(q==="%%")return"%";if(Z>=K)return q;switch(q){case"%s":return String(re[Z++]);case"%d":return Number(re[Z++]);case"%j":try{return JSON.stringify(re[Z++])}catch{return"[Circular]"}default:return q}}),E=re[Z];Z<K;E=re[++Z])x(E)||!C(E)?$+=" "+E:$+=" "+s(E);return $},t.deprecate=function(B,ee){if(typeof Se<"u"&&Se.noDeprecation===!0)return B;if(typeof Se>"u")return function(){return t.deprecate(B,ee).apply(this,arguments)};var Z=!1;function re(){if(!Z){if(Se.throwDeprecation)throw new Error(ee);Se.traceDeprecation?console.trace(ee):console.error(ee),Z=!0}return B.apply(this,arguments)}return re};var r={},o=/^$/;if(Se.env.NODE_DEBUG){var i=Se.env.NODE_DEBUG;i=i.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),o=new RegExp("^"+i+"$","i")}t.debuglog=function(B){if(B=B.toUpperCase(),!r[B])if(o.test(B)){var ee=Se.pid;r[B]=function(){var Z=t.format.apply(t,arguments);console.error("%s %d: %s",B,ee,Z)}}else r[B]=function(){};return r[B]};function s(B,ee){var Z={seen:[],stylize:l};return arguments.length>=3&&(Z.depth=arguments[2]),arguments.length>=4&&(Z.colors=arguments[3]),g(ee)?Z.showHidden=ee:ee&&t._extend(Z,ee),M(Z.showHidden)&&(Z.showHidden=!1),M(Z.depth)&&(Z.depth=2),M(Z.colors)&&(Z.colors=!1),M(Z.customInspect)&&(Z.customInspect=!0),Z.colors&&(Z.stylize=a),u(Z,B,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(B,ee){var Z=s.styles[ee];return Z?"\x1B["+s.colors[Z][0]+"m"+B+"\x1B["+s.colors[Z][1]+"m":B}function l(B,ee){return B}function c(B){var ee={};return B.forEach(function(Z,re){ee[Z]=!0}),ee}function u(B,ee,Z){if(B.customInspect&&ee&&I(ee.inspect)&&ee.inspect!==t.inspect&&!(ee.constructor&&ee.constructor.prototype===ee)){var re=ee.inspect(Z,B);return T(re)||(re=u(B,re,Z)),re}var K=d(B,ee);if(K)return K;var $=Object.keys(ee),E=c($);if(B.showHidden&&($=Object.getOwnPropertyNames(ee)),ie(ee)&&($.indexOf("message")>=0||$.indexOf("description")>=0))return f(ee);if($.length===0){if(I(ee)){var H=ee.name?": "+ee.name:"";return B.stylize("[Function"+H+"]","special")}if(F(ee))return B.stylize(RegExp.prototype.toString.call(ee),"regexp");if(U(ee))return B.stylize(Date.prototype.toString.call(ee),"date");if(ie(ee))return f(ee)}var q="",N=!1,R=["{","}"];if(y(ee)&&(N=!0,R=["[","]"]),I(ee)){var le=ee.name?": "+ee.name:"";q=" [Function"+le+"]"}if(F(ee)&&(q=" "+RegExp.prototype.toString.call(ee)),U(ee)&&(q=" "+Date.prototype.toUTCString.call(ee)),ie(ee)&&(q=" "+f(ee)),$.length===0&&(!N||ee.length==0))return R[0]+q+R[1];if(Z<0)return F(ee)?B.stylize(RegExp.prototype.toString.call(ee),"regexp"):B.stylize("[Object]","special");B.seen.push(ee);var S;return N?S=p(B,ee,Z,E,$):S=$.map(function(oe){return h(B,ee,Z,E,oe,N)}),B.seen.pop(),m(S,q,R)}function d(B,ee){if(M(ee))return B.stylize("undefined","undefined");if(T(ee)){var Z="'"+JSON.stringify(ee).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return B.stylize(Z,"string")}if(w(ee))return B.stylize(""+ee,"number");if(g(ee))return B.stylize(""+ee,"boolean");if(x(ee))return B.stylize("null","null")}function f(B){return"["+Error.prototype.toString.call(B)+"]"}function p(B,ee,Z,re,K){for(var $=[],E=0,H=ee.length;E<H;++E)de(ee,String(E))?$.push(h(B,ee,Z,re,String(E),!0)):$.push("");return K.forEach(function(q){q.match(/^\d+$/)||$.push(h(B,ee,Z,re,q,!0))}),$}function h(B,ee,Z,re,K,$){var E,H,q;if(q=Object.getOwnPropertyDescriptor(ee,K)||{value:ee[K]},q.get?q.set?H=B.stylize("[Getter/Setter]","special"):H=B.stylize("[Getter]","special"):q.set&&(H=B.stylize("[Setter]","special")),de(re,K)||(E="["+K+"]"),H||(B.seen.indexOf(q.value)<0?(x(Z)?H=u(B,q.value,null):H=u(B,q.value,Z-1),H.indexOf(`
7
- `)>-1&&($?H=H.split(`
8
- `).map(function(N){return" "+N}).join(`
9
- `).slice(2):H=`
10
- `+H.split(`
11
- `).map(function(N){return" "+N}).join(`
12
- `))):H=B.stylize("[Circular]","special")),M(E)){if($&&K.match(/^\d+$/))return H;E=JSON.stringify(""+K),E.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(E=E.slice(1,-1),E=B.stylize(E,"name")):(E=E.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),E=B.stylize(E,"string"))}return E+": "+H}function m(B,ee,Z){var re=B.reduce(function(K,$){return $.indexOf(`
13
- `)>=0,K+$.replace(/\u001b\[\d\d?m/g,"").length+1},0);return re>60?Z[0]+(ee===""?"":ee+`
14
- `)+" "+B.join(`,
15
- `)+" "+Z[1]:Z[0]+ee+" "+B.join(", ")+" "+Z[1]}t.types=g3();function y(B){return Array.isArray(B)}t.isArray=y;function g(B){return typeof B=="boolean"}t.isBoolean=g;function x(B){return B===null}t.isNull=x;function k(B){return B==null}t.isNullOrUndefined=k;function w(B){return typeof B=="number"}t.isNumber=w;function T(B){return typeof B=="string"}t.isString=T;function D(B){return typeof B=="symbol"}t.isSymbol=D;function M(B){return B===void 0}t.isUndefined=M;function F(B){return C(B)&&A(B)==="[object RegExp]"}t.isRegExp=F,t.types.isRegExp=F;function C(B){return typeof B=="object"&&B!==null}t.isObject=C;function U(B){return C(B)&&A(B)==="[object Date]"}t.isDate=U,t.types.isDate=U;function ie(B){return C(B)&&(A(B)==="[object Error]"||B instanceof Error)}t.isError=ie,t.types.isNativeError=ie;function I(B){return typeof B=="function"}t.isFunction=I;function W(B){return B===null||typeof B=="boolean"||typeof B=="number"||typeof B=="string"||typeof B=="symbol"||typeof B>"u"}t.isPrimitive=W,t.isBuffer=y3();function A(B){return Object.prototype.toString.call(B)}function G(B){return B<10?"0"+B.toString(10):B.toString(10)}var ae=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function X(){var B=new Date,ee=[G(B.getHours()),G(B.getMinutes()),G(B.getSeconds())].join(":");return[B.getDate(),ae[B.getMonth()],ee].join(" ")}t.log=function(){console.log("%s - %s",X(),t.format.apply(t,arguments))},t.inherits=ho(),t._extend=function(B,ee){if(!ee||!C(ee))return B;for(var Z=Object.keys(ee),re=Z.length;re--;)B[Z[re]]=ee[Z[re]];return B};function de(B,ee){return Object.prototype.hasOwnProperty.call(B,ee)}var J=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;t.promisify=function(B){if(typeof B!="function")throw new TypeError('The "original" argument must be of type Function');if(J&&B[J]){var ee=B[J];if(typeof ee!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(ee,J,{value:ee,enumerable:!1,writable:!1,configurable:!0}),ee}function ee(){for(var Z,re,K=new Promise(function(H,q){Z=H,re=q}),$=[],E=0;E<arguments.length;E++)$.push(arguments[E]);$.push(function(H,q){H?re(H):Z(q)});try{B.apply(this,$)}catch(H){re(H)}return K}return Object.setPrototypeOf(ee,Object.getPrototypeOf(B)),J&&Object.defineProperty(ee,J,{value:ee,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(ee,e(B))},t.promisify.custom=J;function pe(B,ee){if(!B){var Z=new Error("Promise was rejected with a falsy value");Z.reason=B,B=Z}return ee(B)}function Q(B){if(typeof B!="function")throw new TypeError('The "original" argument must be of type Function');function ee(){for(var Z=[],re=0;re<arguments.length;re++)Z.push(arguments[re]);var K=Z.pop();if(typeof K!="function")throw new TypeError("The last argument must be of type Function");var $=this,E=function(){return K.apply($,arguments)};B.apply(this,Z).then(function(H){Se.nextTick(E.bind(null,null,H))},function(H){Se.nextTick(pe.bind(null,H,E))})}return Object.setPrototypeOf(ee,Object.getPrototypeOf(B)),Object.defineProperties(ee,e(B)),ee}t.callbackify=Q}(Ip)),Ip}var bc,sm;function b3(){if(sm)return bc;sm=1;function t(h,m){var y=Object.keys(h);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(h);m&&(g=g.filter(function(x){return Object.getOwnPropertyDescriptor(h,x).enumerable})),y.push.apply(y,g)}return y}function e(h){for(var m=1;m<arguments.length;m++){var y=arguments[m]!=null?arguments[m]:{};m%2?t(Object(y),!0).forEach(function(g){n(h,g,y[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(y)):t(Object(y)).forEach(function(g){Object.defineProperty(h,g,Object.getOwnPropertyDescriptor(y,g))})}return h}function n(h,m,y){return m=s(m),m in h?Object.defineProperty(h,m,{value:y,enumerable:!0,configurable:!0,writable:!0}):h[m]=y,h}function r(h,m){if(!(h instanceof m))throw new TypeError("Cannot call a class as a function")}function o(h,m){for(var y=0;y<m.length;y++){var g=m[y];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(h,s(g.key),g)}}function i(h,m,y){return m&&o(h.prototype,m),Object.defineProperty(h,"prototype",{writable:!1}),h}function s(h){var m=a(h,"string");return typeof m=="symbol"?m:String(m)}function a(h,m){if(typeof h!="object"||h===null)return h;var y=h[Symbol.toPrimitive];if(y!==void 0){var g=y.call(h,m);if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(h)}var l=yl,c=l.Buffer,u=D0(),d=u.inspect,f=d&&d.custom||"inspect";function p(h,m,y){c.prototype.copy.call(h,m,y)}return bc=function(){function h(){r(this,h),this.head=null,this.tail=null,this.length=0}return i(h,[{key:"push",value:function(m){var y={data:m,next:null};this.length>0?this.tail.next=y:this.head=y,this.tail=y,++this.length}},{key:"unshift",value:function(m){var y={data:m,next:this.head};this.length===0&&(this.tail=y),this.head=y,++this.length}},{key:"shift",value:function(){if(this.length!==0){var m=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,m}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(m){if(this.length===0)return"";for(var y=this.head,g=""+y.data;y=y.next;)g+=m+y.data;return g}},{key:"concat",value:function(m){if(this.length===0)return c.alloc(0);for(var y=c.allocUnsafe(m>>>0),g=this.head,x=0;g;)p(g.data,y,x),x+=g.data.length,g=g.next;return y}},{key:"consume",value:function(m,y){var g;return m<this.head.data.length?(g=this.head.data.slice(0,m),this.head.data=this.head.data.slice(m)):m===this.head.data.length?g=this.shift():g=y?this._getString(m):this._getBuffer(m),g}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(m){var y=this.head,g=1,x=y.data;for(m-=x.length;y=y.next;){var k=y.data,w=m>k.length?k.length:m;if(w===k.length?x+=k:x+=k.slice(0,m),m-=w,m===0){w===k.length?(++g,y.next?this.head=y.next:this.head=this.tail=null):(this.head=y,y.data=k.slice(w));break}++g}return this.length-=g,x}},{key:"_getBuffer",value:function(m){var y=c.allocUnsafe(m),g=this.head,x=1;for(g.data.copy(y),m-=g.data.length;g=g.next;){var k=g.data,w=m>k.length?k.length:m;if(k.copy(y,y.length-m,0,w),m-=w,m===0){w===k.length?(++x,g.next?this.head=g.next:this.head=this.tail=null):(this.head=g,g.data=k.slice(w));break}++x}return this.length-=x,y}},{key:f,value:function(m,y){return d(this,e(e({},y),{},{depth:0,customInspect:!1}))}}]),h}(),bc}var wc,am;function M0(){if(am)return wc;am=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,Se.nextTick(o,this,s)):Se.nextTick(o,this,s)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(d){!a&&d?l._writableState?l._writableState.errorEmitted?Se.nextTick(n,l):(l._writableState.errorEmitted=!0,Se.nextTick(e,l,d)):Se.nextTick(e,l,d):a?(Se.nextTick(n,l),a(d)):Se.nextTick(n,l)}),this)}function e(s,a){o(s,a),n(s)}function n(s){s._writableState&&!s._writableState.emitClose||s._readableState&&!s._readableState.emitClose||s.emit("close")}function r(){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 o(s,a){s.emit("error",a)}function i(s,a){var l=s._readableState,c=s._writableState;l&&l.autoDestroy||c&&c.autoDestroy?s.destroy(a):s.emit("error",a)}return wc={destroy:t,undestroy:r,errorOrDestroy:i},wc}var vc={},lm;function ii(){if(lm)return vc;lm=1;function t(a,l){a.prototype=Object.create(l.prototype),a.prototype.constructor=a,a.__proto__=l}var e={};function n(a,l,c){c||(c=Error);function u(f,p,h){return typeof l=="string"?l:l(f,p,h)}var d=function(f){t(p,f);function p(h,m,y){return f.call(this,u(h,m,y))||this}return p}(c);d.prototype.name=c.name,d.prototype.code=a,e[a]=d}function r(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 o(a,l,c){return a.substr(0,l.length)===l}function i(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 n("ERR_INVALID_OPT_VALUE",function(a,l){return'The value "'+l+'" is invalid for option "'+a+'"'},TypeError),n("ERR_INVALID_ARG_TYPE",function(a,l,c){var u;typeof l=="string"&&o(l,"not ")?(u="must not be",l=l.replace(/^not /,"")):u="must be";var d;if(i(a," argument"))d="The ".concat(a," ").concat(u," ").concat(r(l,"type"));else{var f=s(a,".")?"property":"argument";d='The "'.concat(a,'" ').concat(f," ").concat(u," ").concat(r(l,"type"))}return d+=". Received type ".concat(typeof c),d},TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",function(a){return"The "+a+" method is not implemented"}),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",function(a){return"Cannot call "+a+" after a stream was destroyed"}),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",function(a){return"Unknown encoding: "+a},TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),vc.codes=e,vc}var xc,cm;function _0(){if(cm)return xc;cm=1;var t=ii().codes.ERR_INVALID_OPT_VALUE;function e(r,o,i){return r.highWaterMark!=null?r.highWaterMark:o?r[i]:null}function n(r,o,i,s){var a=e(o,s,i);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var l=s?i:"highWaterMark";throw new t(l,a)}return Math.floor(a)}return r.objectMode?16:16*1024}return xc={getHighWaterMark:n},xc}var kc,um;function w3(){if(um)return kc;um=1,kc=t;function t(n,r){if(e("noDeprecation"))return n;var o=!1;function i(){if(!o){if(e("throwDeprecation"))throw new Error(r);e("traceDeprecation")?console.trace(r):console.warn(r),o=!0}return n.apply(this,arguments)}return i}function e(n){try{if(!zt.localStorage)return!1}catch{return!1}var r=zt.localStorage[n];return r==null?!1:String(r).toLowerCase()==="true"}return kc}var Sc,dm;function N0(){if(dm)return Sc;dm=1,Sc=F;function t(K){var $=this;this.next=null,this.entry=null,this.finish=function(){re($,K)}}var e;F.WritableState=D;var n={deprecate:w3()},r=v0(),o=yl.Buffer,i=(typeof zt<"u"?zt:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(K){return o.from(K)}function a(K){return o.isBuffer(K)||K instanceof i}var l=M0(),c=_0(),u=c.getHighWaterMark,d=ii().codes,f=d.ERR_INVALID_ARG_TYPE,p=d.ERR_METHOD_NOT_IMPLEMENTED,h=d.ERR_MULTIPLE_CALLBACK,m=d.ERR_STREAM_CANNOT_PIPE,y=d.ERR_STREAM_DESTROYED,g=d.ERR_STREAM_NULL_VALUES,x=d.ERR_STREAM_WRITE_AFTER_END,k=d.ERR_UNKNOWN_ENCODING,w=l.errorOrDestroy;ho()(F,r);function T(){}function D(K,$,E){e=e||Uo(),K=K||{},typeof E!="boolean"&&(E=$ instanceof e),this.objectMode=!!K.objectMode,E&&(this.objectMode=this.objectMode||!!K.writableObjectMode),this.highWaterMark=u(this,K,"writableHighWaterMark",E),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var H=K.decodeStrings===!1;this.decodeStrings=!H,this.defaultEncoding=K.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(q){ae($,q)},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)}D.prototype.getBuffer=function(){for(var K=this.bufferedRequest,$=[];K;)$.push(K),K=K.next;return $},function(){try{Object.defineProperty(D.prototype,"buffer",{get:n.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var M;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(M=Function.prototype[Symbol.hasInstance],Object.defineProperty(F,Symbol.hasInstance,{value:function(K){return M.call(this,K)?!0:this!==F?!1:K&&K._writableState instanceof D}})):M=function(K){return K instanceof this};function F(K){e=e||Uo();var $=this instanceof e;if(!$&&!M.call(F,this))return new F(K);this._writableState=new D(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)),r.call(this)}F.prototype.pipe=function(){w(this,new m)};function C(K,$){var E=new x;w(K,E),Se.nextTick($,E)}function U(K,$,E,H){var q;return E===null?q=new g:typeof E!="string"&&!$.objectMode&&(q=new f("chunk",["string","Buffer"],E)),q?(w(K,q),Se.nextTick(H,q),!1):!0}F.prototype.write=function(K,$,E){var H=this._writableState,q=!1,N=!H.objectMode&&a(K);return N&&!o.isBuffer(K)&&(K=s(K)),typeof $=="function"&&(E=$,$=null),N?$="buffer":$||($=H.defaultEncoding),typeof E!="function"&&(E=T),H.ending?C(this,E):(N||U(this,H,K,E))&&(H.pendingcb++,q=I(this,H,N,K,$,E)),q},F.prototype.cork=function(){this._writableState.corked++},F.prototype.uncork=function(){var K=this._writableState;K.corked&&(K.corked--,!K.writing&&!K.corked&&!K.bufferProcessing&&K.bufferedRequest&&J(this,K))},F.prototype.setDefaultEncoding=function(K){if(typeof K=="string"&&(K=K.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((K+"").toLowerCase())>-1))throw new k(K);return this._writableState.defaultEncoding=K,this},Object.defineProperty(F.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ie(K,$,E){return!K.objectMode&&K.decodeStrings!==!1&&typeof $=="string"&&($=o.from($,E)),$}Object.defineProperty(F.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function I(K,$,E,H,q,N){if(!E){var R=ie($,H,q);H!==R&&(E=!0,q="buffer",H=R)}var le=$.objectMode?1:H.length;$.length+=le;var S=$.length<$.highWaterMark;if(S||($.needDrain=!0),$.writing||$.corked){var oe=$.lastBufferedRequest;$.lastBufferedRequest={chunk:H,encoding:q,isBuf:E,callback:N,next:null},oe?oe.next=$.lastBufferedRequest:$.bufferedRequest=$.lastBufferedRequest,$.bufferedRequestCount+=1}else W(K,$,!1,le,H,q,N);return S}function W(K,$,E,H,q,N,R){$.writelen=H,$.writecb=R,$.writing=!0,$.sync=!0,$.destroyed?$.onwrite(new y("write")):E?K._writev(q,$.onwrite):K._write(q,N,$.onwrite),$.sync=!1}function A(K,$,E,H,q){--$.pendingcb,E?(Se.nextTick(q,H),Se.nextTick(ee,K,$),K._writableState.errorEmitted=!0,w(K,H)):(q(H),K._writableState.errorEmitted=!0,w(K,H),ee(K,$))}function G(K){K.writing=!1,K.writecb=null,K.length-=K.writelen,K.writelen=0}function ae(K,$){var E=K._writableState,H=E.sync,q=E.writecb;if(typeof q!="function")throw new h;if(G(E),$)A(K,E,H,$,q);else{var N=pe(E)||K.destroyed;!N&&!E.corked&&!E.bufferProcessing&&E.bufferedRequest&&J(K,E),H?Se.nextTick(X,K,E,N,q):X(K,E,N,q)}}function X(K,$,E,H){E||de(K,$),$.pendingcb--,H(),ee(K,$)}function de(K,$){$.length===0&&$.needDrain&&($.needDrain=!1,K.emit("drain"))}function J(K,$){$.bufferProcessing=!0;var E=$.bufferedRequest;if(K._writev&&E&&E.next){var H=$.bufferedRequestCount,q=new Array(H),N=$.corkedRequestsFree;N.entry=E;for(var R=0,le=!0;E;)q[R]=E,E.isBuf||(le=!1),E=E.next,R+=1;q.allBuffers=le,W(K,$,!0,$.length,q,"",N.finish),$.pendingcb++,$.lastBufferedRequest=null,N.next?($.corkedRequestsFree=N.next,N.next=null):$.corkedRequestsFree=new t($),$.bufferedRequestCount=0}else{for(;E;){var S=E.chunk,oe=E.encoding,te=E.callback,L=$.objectMode?1:S.length;if(W(K,$,!1,L,S,oe,te),E=E.next,$.bufferedRequestCount--,$.writing)break}E===null&&($.lastBufferedRequest=null)}$.bufferedRequest=E,$.bufferProcessing=!1}F.prototype._write=function(K,$,E){E(new p("_write()"))},F.prototype._writev=null,F.prototype.end=function(K,$,E){var H=this._writableState;return typeof K=="function"?(E=K,K=null,$=null):typeof $=="function"&&(E=$,$=null),K!=null&&this.write(K,$),H.corked&&(H.corked=1,this.uncork()),H.ending||Z(this,H,E),this},Object.defineProperty(F.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function pe(K){return K.ending&&K.length===0&&K.bufferedRequest===null&&!K.finished&&!K.writing}function Q(K,$){K._final(function(E){$.pendingcb--,E&&w(K,E),$.prefinished=!0,K.emit("prefinish"),ee(K,$)})}function B(K,$){!$.prefinished&&!$.finalCalled&&(typeof K._final=="function"&&!$.destroyed?($.pendingcb++,$.finalCalled=!0,Se.nextTick(Q,K,$)):($.prefinished=!0,K.emit("prefinish")))}function ee(K,$){var E=pe($);if(E&&(B(K,$),$.pendingcb===0&&($.finished=!0,K.emit("finish"),$.autoDestroy))){var H=K._readableState;(!H||H.autoDestroy&&H.endEmitted)&&K.destroy()}return E}function Z(K,$,E){$.ending=!0,ee(K,$),E&&($.finished?Se.nextTick(E):K.once("finish",E)),$.ended=!0,K.writable=!1}function re(K,$,E){var H=K.entry;for(K.entry=null;H;){var q=H.callback;$.pendingcb--,q(E),H=H.next}$.corkedRequestsFree.next=K}return Object.defineProperty(F.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(K){this._writableState&&(this._writableState.destroyed=K)}}),F.prototype.destroy=l.destroy,F.prototype._undestroy=l.undestroy,F.prototype._destroy=function(K,$){$(K)},Sc}var Cc,fm;function Uo(){if(fm)return Cc;fm=1;var t=Object.keys||function(c){var u=[];for(var d in c)u.push(d);return u};Cc=s;var e=I0(),n=N0();ho()(s,e);for(var r=t(n.prototype),o=0;o<r.length;o++){var i=r[o];s.prototype[i]||(s.prototype[i]=n.prototype[i])}function s(c){if(!(this instanceof s))return new s(c);e.call(this,c),n.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||Se.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(c){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=c,this._writableState.destroyed=c)}}),Cc}var Ec={},Ac={exports:{}},pm;function v3(){return pm||(pm=1,function(t,e){var n=yl,r=n.Buffer;function o(s,a){for(var l in s)a[l]=s[l]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=i);function i(s,a,l){return r(s,a,l)}o(r,i),i.from=function(s,a,l){if(typeof s=="number")throw new TypeError("Argument must not be a number");return r(s,a,l)},i.alloc=function(s,a,l){if(typeof s!="number")throw new TypeError("Argument must be a number");var c=r(s);return a!==void 0?typeof l=="string"?c.fill(a,l):c.fill(a):c.fill(0),c},i.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r(s)},i.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(s)}}(Ac,Ac.exports)),Ac.exports}var hm;function Lu(){if(hm)return Ec;hm=1;var t=v3().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 n(g){if(!g)return"utf8";for(var x;;)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(x)return;g=(""+g).toLowerCase(),x=!0}}function r(g){var x=n(g);if(typeof x!="string"&&(t.isEncoding===e||!e(g)))throw new Error("Unknown encoding: "+g);return x||g}Ec.StringDecoder=o;function o(g){this.encoding=r(g);var x;switch(this.encoding){case"utf16le":this.text=d,this.end=f,x=4;break;case"utf8":this.fillLast=l,x=4;break;case"base64":this.text=p,this.end=h,x=3;break;default:this.write=m,this.end=y;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(x)}o.prototype.write=function(g){if(g.length===0)return"";var x,k;if(this.lastNeed){if(x=this.fillLast(g),x===void 0)return"";k=this.lastNeed,this.lastNeed=0}else k=0;return k<g.length?x?x+this.text(g,k):this.text(g,k):x||""},o.prototype.end=u,o.prototype.text=c,o.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 i(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,x,k){var w=x.length-1;if(w<k)return 0;var T=i(x[w]);return T>=0?(T>0&&(g.lastNeed=T-1),T):--w<k||T===-2?0:(T=i(x[w]),T>=0?(T>0&&(g.lastNeed=T-2),T):--w<k||T===-2?0:(T=i(x[w]),T>=0?(T>0&&(T===2?T=0:g.lastNeed=T-3),T):0))}function a(g,x,k){if((x[0]&192)!==128)return g.lastNeed=0,"�";if(g.lastNeed>1&&x.length>1){if((x[1]&192)!==128)return g.lastNeed=1,"�";if(g.lastNeed>2&&x.length>2&&(x[2]&192)!==128)return g.lastNeed=2,"�"}}function l(g){var x=this.lastTotal-this.lastNeed,k=a(this,g);if(k!==void 0)return k;if(this.lastNeed<=g.length)return g.copy(this.lastChar,x,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);g.copy(this.lastChar,x,0,g.length),this.lastNeed-=g.length}function c(g,x){var k=s(this,g,x);if(!this.lastNeed)return g.toString("utf8",x);this.lastTotal=k;var w=g.length-(k-this.lastNeed);return g.copy(this.lastChar,0,w),g.toString("utf8",x,w)}function u(g){var x=g&&g.length?this.write(g):"";return this.lastNeed?x+"�":x}function d(g,x){if((g.length-x)%2===0){var k=g.toString("utf16le",x);if(k){var w=k.charCodeAt(k.length-1);if(w>=55296&&w<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=g[g.length-2],this.lastChar[1]=g[g.length-1],k.slice(0,-1)}return k}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=g[g.length-1],g.toString("utf16le",x,g.length-1)}function f(g){var x=g&&g.length?this.write(g):"";if(this.lastNeed){var k=this.lastTotal-this.lastNeed;return x+this.lastChar.toString("utf16le",0,k)}return x}function p(g,x){var k=(g.length-x)%3;return k===0?g.toString("base64",x):(this.lastNeed=3-k,this.lastTotal=3,k===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",x,g.length-k))}function h(g){var x=g&&g.length?this.write(g):"";return this.lastNeed?x+this.lastChar.toString("base64",0,3-this.lastNeed):x}function m(g){return g.toString(this.encoding)}function y(g){return g&&g.length?this.write(g):""}return Ec}var $c,mm;function mf(){if(mm)return $c;mm=1;var t=ii().codes.ERR_STREAM_PREMATURE_CLOSE;function e(i){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];i.apply(this,l)}}}function n(){}function r(i){return i.setHeader&&typeof i.abort=="function"}function o(i,s,a){if(typeof s=="function")return o(i,null,s);s||(s={}),a=e(a||n);var l=s.readable||s.readable!==!1&&i.readable,c=s.writable||s.writable!==!1&&i.writable,u=function(){i.writable||f()},d=i._writableState&&i._writableState.finished,f=function(){c=!1,d=!0,l||a.call(i)},p=i._readableState&&i._readableState.endEmitted,h=function(){l=!1,p=!0,c||a.call(i)},m=function(x){a.call(i,x)},y=function(){var x;if(l&&!p)return(!i._readableState||!i._readableState.ended)&&(x=new t),a.call(i,x);if(c&&!d)return(!i._writableState||!i._writableState.ended)&&(x=new t),a.call(i,x)},g=function(){i.req.on("finish",f)};return r(i)?(i.on("complete",f),i.on("abort",y),i.req?g():i.on("request",g)):c&&!i._writableState&&(i.on("end",u),i.on("close",u)),i.on("end",h),i.on("finish",f),s.error!==!1&&i.on("error",m),i.on("close",y),function(){i.removeListener("complete",f),i.removeListener("abort",y),i.removeListener("request",g),i.req&&i.req.removeListener("finish",f),i.removeListener("end",u),i.removeListener("close",u),i.removeListener("finish",f),i.removeListener("end",h),i.removeListener("error",m),i.removeListener("close",y)}}return $c=o,$c}var Tc,gm;function x3(){if(gm)return Tc;gm=1;var t;function e(k,w,T){return w=n(w),w in k?Object.defineProperty(k,w,{value:T,enumerable:!0,configurable:!0,writable:!0}):k[w]=T,k}function n(k){var w=r(k,"string");return typeof w=="symbol"?w:String(w)}function r(k,w){if(typeof k!="object"||k===null)return k;var T=k[Symbol.toPrimitive];if(T!==void 0){var D=T.call(k,w);if(typeof D!="object")return D;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(k)}var o=mf(),i=Symbol("lastResolve"),s=Symbol("lastReject"),a=Symbol("error"),l=Symbol("ended"),c=Symbol("lastPromise"),u=Symbol("handlePromise"),d=Symbol("stream");function f(k,w){return{value:k,done:w}}function p(k){var w=k[i];if(w!==null){var T=k[d].read();T!==null&&(k[c]=null,k[i]=null,k[s]=null,w(f(T,!1)))}}function h(k){Se.nextTick(p,k)}function m(k,w){return function(T,D){k.then(function(){if(w[l]){T(f(void 0,!0));return}w[u](T,D)},D)}}var y=Object.getPrototypeOf(function(){}),g=Object.setPrototypeOf((t={get stream(){return this[d]},next:function(){var k=this,w=this[a];if(w!==null)return Promise.reject(w);if(this[l])return Promise.resolve(f(void 0,!0));if(this[d].destroyed)return new Promise(function(F,C){Se.nextTick(function(){k[a]?C(k[a]):F(f(void 0,!0))})});var T=this[c],D;if(T)D=new Promise(m(T,this));else{var M=this[d].read();if(M!==null)return Promise.resolve(f(M,!1));D=new Promise(this[u])}return this[c]=D,D}},e(t,Symbol.asyncIterator,function(){return this}),e(t,"return",function(){var k=this;return new Promise(function(w,T){k[d].destroy(null,function(D){if(D){T(D);return}w(f(void 0,!0))})})}),t),y),x=function(k){var w,T=Object.create(g,(w={},e(w,d,{value:k,writable:!0}),e(w,i,{value:null,writable:!0}),e(w,s,{value:null,writable:!0}),e(w,a,{value:null,writable:!0}),e(w,l,{value:k._readableState.endEmitted,writable:!0}),e(w,u,{value:function(D,M){var F=T[d].read();F?(T[c]=null,T[i]=null,T[s]=null,D(f(F,!1))):(T[i]=D,T[s]=M)},writable:!0}),w));return T[c]=null,o(k,function(D){if(D&&D.code!=="ERR_STREAM_PREMATURE_CLOSE"){var M=T[s];M!==null&&(T[c]=null,T[i]=null,T[s]=null,M(D)),T[a]=D;return}var F=T[i];F!==null&&(T[c]=null,T[i]=null,T[s]=null,F(f(void 0,!0))),T[l]=!0}),k.on("readable",h.bind(null,T)),T};return Tc=x,Tc}var ym,bm;function k3(){return bm||(bm=1,ym=function(){throw new Error("Readable.from is not available in the browser")}),ym}var Oc,wm;function I0(){if(wm)return Oc;wm=1,Oc=C;var t;C.ReadableState=F,uf().EventEmitter;var e=function(N,R){return N.listeners(R).length},n=v0(),r=yl.Buffer,o=(typeof zt<"u"?zt:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function i(N){return r.from(N)}function s(N){return r.isBuffer(N)||N instanceof o}var a=D0(),l;a&&a.debuglog?l=a.debuglog("stream"):l=function(){};var c=b3(),u=M0(),d=_0(),f=d.getHighWaterMark,p=ii().codes,h=p.ERR_INVALID_ARG_TYPE,m=p.ERR_STREAM_PUSH_AFTER_EOF,y=p.ERR_METHOD_NOT_IMPLEMENTED,g=p.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,x,k,w;ho()(C,n);var T=u.errorOrDestroy,D=["error","close","destroy","pause","resume"];function M(N,R,le){if(typeof N.prependListener=="function")return N.prependListener(R,le);!N._events||!N._events[R]?N.on(R,le):Array.isArray(N._events[R])?N._events[R].unshift(le):N._events[R]=[le,N._events[R]]}function F(N,R,le){t=t||Uo(),N=N||{},typeof le!="boolean"&&(le=R instanceof t),this.objectMode=!!N.objectMode,le&&(this.objectMode=this.objectMode||!!N.readableObjectMode),this.highWaterMark=f(this,N,"readableHighWaterMark",le),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=N.emitClose!==!1,this.autoDestroy=!!N.autoDestroy,this.destroyed=!1,this.defaultEncoding=N.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,N.encoding&&(x||(x=Lu().StringDecoder),this.decoder=new x(N.encoding),this.encoding=N.encoding)}function C(N){if(t=t||Uo(),!(this instanceof C))return new C(N);var R=this instanceof t;this._readableState=new F(N,this,R),this.readable=!0,N&&(typeof N.read=="function"&&(this._read=N.read),typeof N.destroy=="function"&&(this._destroy=N.destroy)),n.call(this)}Object.defineProperty(C.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(N){this._readableState&&(this._readableState.destroyed=N)}}),C.prototype.destroy=u.destroy,C.prototype._undestroy=u.undestroy,C.prototype._destroy=function(N,R){R(N)},C.prototype.push=function(N,R){var le=this._readableState,S;return le.objectMode?S=!0:typeof N=="string"&&(R=R||le.defaultEncoding,R!==le.encoding&&(N=r.from(N,R),R=""),S=!0),U(this,N,R,!1,S)},C.prototype.unshift=function(N){return U(this,N,null,!0,!1)};function U(N,R,le,S,oe){l("readableAddChunk",R);var te=N._readableState;if(R===null)te.reading=!1,ae(N,te);else{var L;if(oe||(L=I(te,R)),L)T(N,L);else if(te.objectMode||R&&R.length>0)if(typeof R!="string"&&!te.objectMode&&Object.getPrototypeOf(R)!==r.prototype&&(R=i(R)),S)te.endEmitted?T(N,new g):ie(N,te,R,!0);else if(te.ended)T(N,new m);else{if(te.destroyed)return!1;te.reading=!1,te.decoder&&!le?(R=te.decoder.write(R),te.objectMode||R.length!==0?ie(N,te,R,!1):J(N,te)):ie(N,te,R,!1)}else S||(te.reading=!1,J(N,te))}return!te.ended&&(te.length<te.highWaterMark||te.length===0)}function ie(N,R,le,S){R.flowing&&R.length===0&&!R.sync?(R.awaitDrain=0,N.emit("data",le)):(R.length+=R.objectMode?1:le.length,S?R.buffer.unshift(le):R.buffer.push(le),R.needReadable&&X(N)),J(N,R)}function I(N,R){var le;return!s(R)&&typeof R!="string"&&R!==void 0&&!N.objectMode&&(le=new h("chunk",["string","Buffer","Uint8Array"],R)),le}C.prototype.isPaused=function(){return this._readableState.flowing===!1},C.prototype.setEncoding=function(N){x||(x=Lu().StringDecoder);var R=new x(N);this._readableState.decoder=R,this._readableState.encoding=this._readableState.decoder.encoding;for(var le=this._readableState.buffer.head,S="";le!==null;)S+=R.write(le.data),le=le.next;return this._readableState.buffer.clear(),S!==""&&this._readableState.buffer.push(S),this._readableState.length=S.length,this};var W=1073741824;function A(N){return N>=W?N=W:(N--,N|=N>>>1,N|=N>>>2,N|=N>>>4,N|=N>>>8,N|=N>>>16,N++),N}function G(N,R){return N<=0||R.length===0&&R.ended?0:R.objectMode?1:N!==N?R.flowing&&R.length?R.buffer.head.data.length:R.length:(N>R.highWaterMark&&(R.highWaterMark=A(N)),N<=R.length?N:R.ended?R.length:(R.needReadable=!0,0))}C.prototype.read=function(N){l("read",N),N=parseInt(N,10);var R=this._readableState,le=N;if(N!==0&&(R.emittedReadable=!1),N===0&&R.needReadable&&((R.highWaterMark!==0?R.length>=R.highWaterMark:R.length>0)||R.ended))return l("read: emitReadable",R.length,R.ended),R.length===0&&R.ended?E(this):X(this),null;if(N=G(N,R),N===0&&R.ended)return R.length===0&&E(this),null;var S=R.needReadable;l("need readable",S),(R.length===0||R.length-N<R.highWaterMark)&&(S=!0,l("length less than watermark",S)),R.ended||R.reading?(S=!1,l("reading or ended",S)):S&&(l("do read"),R.reading=!0,R.sync=!0,R.length===0&&(R.needReadable=!0),this._read(R.highWaterMark),R.sync=!1,R.reading||(N=G(le,R)));var oe;return N>0?oe=$(N,R):oe=null,oe===null?(R.needReadable=R.length<=R.highWaterMark,N=0):(R.length-=N,R.awaitDrain=0),R.length===0&&(R.ended||(R.needReadable=!0),le!==N&&R.ended&&E(this)),oe!==null&&this.emit("data",oe),oe};function ae(N,R){if(l("onEofChunk"),!R.ended){if(R.decoder){var le=R.decoder.end();le&&le.length&&(R.buffer.push(le),R.length+=R.objectMode?1:le.length)}R.ended=!0,R.sync?X(N):(R.needReadable=!1,R.emittedReadable||(R.emittedReadable=!0,de(N)))}}function X(N){var R=N._readableState;l("emitReadable",R.needReadable,R.emittedReadable),R.needReadable=!1,R.emittedReadable||(l("emitReadable",R.flowing),R.emittedReadable=!0,Se.nextTick(de,N))}function de(N){var R=N._readableState;l("emitReadable_",R.destroyed,R.length,R.ended),!R.destroyed&&(R.length||R.ended)&&(N.emit("readable"),R.emittedReadable=!1),R.needReadable=!R.flowing&&!R.ended&&R.length<=R.highWaterMark,K(N)}function J(N,R){R.readingMore||(R.readingMore=!0,Se.nextTick(pe,N,R))}function pe(N,R){for(;!R.reading&&!R.ended&&(R.length<R.highWaterMark||R.flowing&&R.length===0);){var le=R.length;if(l("maybeReadMore read 0"),N.read(0),le===R.length)break}R.readingMore=!1}C.prototype._read=function(N){T(this,new y("_read()"))},C.prototype.pipe=function(N,R){var le=this,S=this._readableState;switch(S.pipesCount){case 0:S.pipes=N;break;case 1:S.pipes=[S.pipes,N];break;default:S.pipes.push(N);break}S.pipesCount+=1,l("pipe count=%d opts=%j",S.pipesCount,R);var oe=(!R||R.end!==!1)&&N!==Se.stdout&&N!==Se.stderr,te=oe?z:we;S.endEmitted?Se.nextTick(te):le.once("end",te),N.on("unpipe",L);function L(_e,Ce){l("onunpipe"),_e===le&&Ce&&Ce.hasUnpiped===!1&&(Ce.hasUnpiped=!0,me())}function z(){l("onend"),N.end()}var P=Q(le);N.on("drain",P);var fe=!1;function me(){l("cleanup"),N.removeListener("close",ce),N.removeListener("finish",ue),N.removeListener("drain",P),N.removeListener("error",ge),N.removeListener("unpipe",L),le.removeListener("end",z),le.removeListener("end",we),le.removeListener("data",se),fe=!0,S.awaitDrain&&(!N._writableState||N._writableState.needDrain)&&P()}le.on("data",se);function se(_e){l("ondata");var Ce=N.write(_e);l("dest.write",Ce),Ce===!1&&((S.pipesCount===1&&S.pipes===N||S.pipesCount>1&&q(S.pipes,N)!==-1)&&!fe&&(l("false write response, pause",S.awaitDrain),S.awaitDrain++),le.pause())}function ge(_e){l("onerror",_e),we(),N.removeListener("error",ge),e(N,"error")===0&&T(N,_e)}M(N,"error",ge);function ce(){N.removeListener("finish",ue),we()}N.once("close",ce);function ue(){l("onfinish"),N.removeListener("close",ce),we()}N.once("finish",ue);function we(){l("unpipe"),le.unpipe(N)}return N.emit("pipe",le),S.flowing||(l("pipe resume"),le.resume()),N};function Q(N){return function(){var R=N._readableState;l("pipeOnDrain",R.awaitDrain),R.awaitDrain&&R.awaitDrain--,R.awaitDrain===0&&e(N,"data")&&(R.flowing=!0,K(N))}}C.prototype.unpipe=function(N){var R=this._readableState,le={hasUnpiped:!1};if(R.pipesCount===0)return this;if(R.pipesCount===1)return N&&N!==R.pipes?this:(N||(N=R.pipes),R.pipes=null,R.pipesCount=0,R.flowing=!1,N&&N.emit("unpipe",this,le),this);if(!N){var S=R.pipes,oe=R.pipesCount;R.pipes=null,R.pipesCount=0,R.flowing=!1;for(var te=0;te<oe;te++)S[te].emit("unpipe",this,{hasUnpiped:!1});return this}var L=q(R.pipes,N);return L===-1?this:(R.pipes.splice(L,1),R.pipesCount-=1,R.pipesCount===1&&(R.pipes=R.pipes[0]),N.emit("unpipe",this,le),this)},C.prototype.on=function(N,R){var le=n.prototype.on.call(this,N,R),S=this._readableState;return N==="data"?(S.readableListening=this.listenerCount("readable")>0,S.flowing!==!1&&this.resume()):N==="readable"&&!S.endEmitted&&!S.readableListening&&(S.readableListening=S.needReadable=!0,S.flowing=!1,S.emittedReadable=!1,l("on readable",S.length,S.reading),S.length?X(this):S.reading||Se.nextTick(ee,this)),le},C.prototype.addListener=C.prototype.on,C.prototype.removeListener=function(N,R){var le=n.prototype.removeListener.call(this,N,R);return N==="readable"&&Se.nextTick(B,this),le},C.prototype.removeAllListeners=function(N){var R=n.prototype.removeAllListeners.apply(this,arguments);return(N==="readable"||N===void 0)&&Se.nextTick(B,this),R};function B(N){var R=N._readableState;R.readableListening=N.listenerCount("readable")>0,R.resumeScheduled&&!R.paused?R.flowing=!0:N.listenerCount("data")>0&&N.resume()}function ee(N){l("readable nexttick read 0"),N.read(0)}C.prototype.resume=function(){var N=this._readableState;return N.flowing||(l("resume"),N.flowing=!N.readableListening,Z(this,N)),N.paused=!1,this};function Z(N,R){R.resumeScheduled||(R.resumeScheduled=!0,Se.nextTick(re,N,R))}function re(N,R){l("resume",R.reading),R.reading||N.read(0),R.resumeScheduled=!1,N.emit("resume"),K(N),R.flowing&&!R.reading&&N.read(0)}C.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(N){var R=N._readableState;for(l("flow",R.flowing);R.flowing&&N.read()!==null;);}C.prototype.wrap=function(N){var R=this,le=this._readableState,S=!1;N.on("end",function(){if(l("wrapped end"),le.decoder&&!le.ended){var L=le.decoder.end();L&&L.length&&R.push(L)}R.push(null)}),N.on("data",function(L){if(l("wrapped data"),le.decoder&&(L=le.decoder.write(L)),!(le.objectMode&&L==null)&&!(!le.objectMode&&(!L||!L.length))){var z=R.push(L);z||(S=!0,N.pause())}});for(var oe in N)this[oe]===void 0&&typeof N[oe]=="function"&&(this[oe]=function(L){return function(){return N[L].apply(N,arguments)}}(oe));for(var te=0;te<D.length;te++)N.on(D[te],this.emit.bind(this,D[te]));return this._read=function(L){l("wrapped _read",L),S&&(S=!1,N.resume())},this},typeof Symbol=="function"&&(C.prototype[Symbol.asyncIterator]=function(){return k===void 0&&(k=x3()),k(this)}),Object.defineProperty(C.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(C.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(C.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(N){this._readableState&&(this._readableState.flowing=N)}}),C._fromList=$,Object.defineProperty(C.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function $(N,R){if(R.length===0)return null;var le;return R.objectMode?le=R.buffer.shift():!N||N>=R.length?(R.decoder?le=R.buffer.join(""):R.buffer.length===1?le=R.buffer.first():le=R.buffer.concat(R.length),R.buffer.clear()):le=R.buffer.consume(N,R.decoder),le}function E(N){var R=N._readableState;l("endReadable",R.endEmitted),R.endEmitted||(R.ended=!0,Se.nextTick(H,R,N))}function H(N,R){if(l("endReadableNT",N.endEmitted,N.length),!N.endEmitted&&N.length===0&&(N.endEmitted=!0,R.readable=!1,R.emit("end"),N.autoDestroy)){var le=R._writableState;(!le||le.autoDestroy&&le.finished)&&R.destroy()}}typeof Symbol=="function"&&(C.from=function(N,R){return w===void 0&&(w=k3()),w(C,N,R)});function q(N,R){for(var le=0,S=N.length;le<S;le++)if(N[le]===R)return le;return-1}return Oc}var Dc,vm;function F0(){if(vm)return Dc;vm=1,Dc=a;var t=ii().codes,e=t.ERR_METHOD_NOT_IMPLEMENTED,n=t.ERR_MULTIPLE_CALLBACK,r=t.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=t.ERR_TRANSFORM_WITH_LENGTH_0,i=Uo();ho()(a,i);function s(u,d){var f=this._transformState;f.transforming=!1;var p=f.writecb;if(p===null)return this.emit("error",new n);f.writechunk=null,f.writecb=null,d!=null&&this.push(d),p(u);var h=this._readableState;h.reading=!1,(h.needReadable||h.length<h.highWaterMark)&&this._read(h.highWaterMark)}function a(u){if(!(this instanceof a))return new a(u);i.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(d,f){c(u,d,f)}):c(this,null,null)}a.prototype.push=function(u,d){return this._transformState.needTransform=!1,i.prototype.push.call(this,u,d)},a.prototype._transform=function(u,d,f){f(new e("_transform()"))},a.prototype._write=function(u,d,f){var p=this._transformState;if(p.writecb=f,p.writechunk=u,p.writeencoding=d,!p.transforming){var h=this._readableState;(p.needTransform||h.needReadable||h.length<h.highWaterMark)&&this._read(h.highWaterMark)}},a.prototype._read=function(u){var d=this._transformState;d.writechunk!==null&&!d.transforming?(d.transforming=!0,this._transform(d.writechunk,d.writeencoding,d.afterTransform)):d.needTransform=!0},a.prototype._destroy=function(u,d){i.prototype._destroy.call(this,u,function(f){d(f)})};function c(u,d,f){if(d)return u.emit("error",d);if(f!=null&&u.push(f),u._writableState.length)throw new o;if(u._transformState.transforming)throw new r;return u.push(null)}return Dc}var Mc,xm;function S3(){if(xm)return Mc;xm=1,Mc=e;var t=F0();ho()(e,t);function e(n){if(!(this instanceof e))return new e(n);t.call(this,n)}return e.prototype._transform=function(n,r,o){o(null,n)},Mc}var _c,km;function C3(){if(km)return _c;km=1;var t;function e(f){var p=!1;return function(){p||(p=!0,f.apply(void 0,arguments))}}var n=ii().codes,r=n.ERR_MISSING_ARGS,o=n.ERR_STREAM_DESTROYED;function i(f){if(f)throw f}function s(f){return f.setHeader&&typeof f.abort=="function"}function a(f,p,h,m){m=e(m);var y=!1;f.on("close",function(){y=!0}),t===void 0&&(t=mf()),t(f,{readable:p,writable:h},function(x){if(x)return m(x);y=!0,m()});var g=!1;return function(x){if(!y&&!g){if(g=!0,s(f))return f.abort();if(typeof f.destroy=="function")return f.destroy();m(x||new o("pipe"))}}}function l(f){f()}function c(f,p){return f.pipe(p)}function u(f){return!f.length||typeof f[f.length-1]!="function"?i:f.pop()}function d(){for(var f=arguments.length,p=new Array(f),h=0;h<f;h++)p[h]=arguments[h];var m=u(p);if(Array.isArray(p[0])&&(p=p[0]),p.length<2)throw new r("streams");var y,g=p.map(function(x,k){var w=k<p.length-1,T=k>0;return a(x,w,T,function(D){y||(y=D),D&&g.forEach(l),!w&&(g.forEach(l),m(y))})});return p.reduce(c)}return _c=d,_c}var Nc,Sm;function E3(){if(Sm)return Nc;Sm=1,Nc=n;var t=uf().EventEmitter,e=ho();e(n,t),n.Readable=I0(),n.Writable=N0(),n.Duplex=Uo(),n.Transform=F0(),n.PassThrough=S3(),n.finished=mf(),n.pipeline=C3(),n.Stream=n;function n(){t.call(this)}return n.prototype.pipe=function(r,o){var i=this;function s(p){r.writable&&r.write(p)===!1&&i.pause&&i.pause()}i.on("data",s);function a(){i.readable&&i.resume&&i.resume()}r.on("drain",a),!r._isStdio&&(!o||o.end!==!1)&&(i.on("end",c),i.on("close",u));var l=!1;function c(){l||(l=!0,r.end())}function u(){l||(l=!0,typeof r.destroy=="function"&&r.destroy())}function d(p){if(f(),t.listenerCount(this,"error")===0)throw p}i.on("error",d),r.on("error",d);function f(){i.removeListener("data",s),r.removeListener("drain",a),i.removeListener("end",c),i.removeListener("close",u),i.removeListener("error",d),r.removeListener("error",d),i.removeListener("end",f),i.removeListener("close",f),r.removeListener("close",f)}return i.on("end",f),i.on("close",f),r.on("close",f),r.emit("pipe",i),r},Nc}(function(t){(function(e){e.parser=function($,E){return new r($,E)},e.SAXParser=r,e.SAXStream=u,e.createStream=c,e.MAX_BUFFER_LENGTH=64*1024;var n=["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 r($,E){if(!(this instanceof r))return new r($,E);var H=this;i(H),H.q=H.c="",H.bufferCheckPosition=e.MAX_BUFFER_LENGTH,H.opt=E||{},H.opt.lowercase=H.opt.lowercase||H.opt.lowercasetags,H.looseCase=H.opt.lowercase?"toLowerCase":"toUpperCase",H.tags=[],H.closed=H.closedRoot=H.sawRoot=!1,H.tag=H.error=null,H.strict=!!$,H.noscript=!!($||H.opt.noscript),H.state=C.BEGIN,H.strictEntities=H.opt.strictEntities,H.ENTITIES=H.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES),H.attribList=[],H.opt.xmlns&&(H.ns=Object.create(m)),H.opt.unquotedAttributeValues===void 0&&(H.opt.unquotedAttributeValues=!$),H.trackPosition=H.opt.position!==!1,H.trackPosition&&(H.position=H.line=H.column=0),ie(H,"onready")}Object.create||(Object.create=function($){function E(){}E.prototype=$;var H=new E;return H}),Object.keys||(Object.keys=function($){var E=[];for(var H in $)$.hasOwnProperty(H)&&E.push(H);return E});function o($){for(var E=Math.max(e.MAX_BUFFER_LENGTH,10),H=0,q=0,N=n.length;q<N;q++){var R=$[n[q]].length;if(R>E)switch(n[q]){case"textNode":W($);break;case"cdata":I($,"oncdata",$.cdata),$.cdata="";break;case"script":I($,"onscript",$.script),$.script="";break;default:G($,"Max buffer length exceeded: "+n[q])}H=Math.max(H,R)}var le=e.MAX_BUFFER_LENGTH-H;$.bufferCheckPosition=le+$.position}function i($){for(var E=0,H=n.length;E<H;E++)$[n[E]]=""}function s($){W($),$.cdata!==""&&(I($,"oncdata",$.cdata),$.cdata=""),$.script!==""&&(I($,"onscript",$.script),$.script="")}r.prototype={end:function(){ae(this)},write:K,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){s(this)}};var a;try{a=E3().Stream}catch{a=function(){}}a||(a=function(){});var l=e.EVENTS.filter(function($){return $!=="error"&&$!=="end"});function c($,E){return new u($,E)}function u($,E){if(!(this instanceof u))return new u($,E);a.apply(this),this._parser=new r($,E),this.writable=!0,this.readable=!0;var H=this;this._parser.onend=function(){H.emit("end")},this._parser.onerror=function(q){H.emit("error",q),H._parser.error=null},this._decoder=null,l.forEach(function(q){Object.defineProperty(H,"on"+q,{get:function(){return H._parser["on"+q]},set:function(N){if(!N)return H.removeAllListeners(q),H._parser["on"+q]=N,N;H.on(q,N)},enumerable:!0,configurable:!1})})}u.prototype=Object.create(a.prototype,{constructor:{value:u}}),u.prototype.write=function($){if(typeof St=="function"&&typeof St.isBuffer=="function"&&St.isBuffer($)){if(!this._decoder){var E=Lu().StringDecoder;this._decoder=new E("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($,E){var H=this;return!H._parser["on"+$]&&l.indexOf($)!==-1&&(H._parser["on"+$]=function(){var q=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);q.splice(0,0,$),H.emit.apply(H,q)}),a.prototype.on.call(H,$,E)};var d="[CDATA[",f="DOCTYPE",p="http://www.w3.org/XML/1998/namespace",h="http://www.w3.org/2000/xmlns/",m={xml:p,xmlns:h},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-]/,x=/[#:_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]/,k=/[#:_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 w($){return $===" "||$===`
16
- `||$==="\r"||$===" "}function T($){return $==='"'||$==="'"}function D($){return $===">"||w($)}function M($,E){return $.test(E)}function F($,E){return!M($,E)}var C=0;e.STATE={BEGIN:C++,BEGIN_WHITESPACE:C++,TEXT:C++,TEXT_ENTITY:C++,OPEN_WAKA:C++,SGML_DECL:C++,SGML_DECL_QUOTED:C++,DOCTYPE:C++,DOCTYPE_QUOTED:C++,DOCTYPE_DTD:C++,DOCTYPE_DTD_QUOTED:C++,COMMENT_STARTING:C++,COMMENT:C++,COMMENT_ENDING:C++,COMMENT_ENDED:C++,CDATA:C++,CDATA_ENDING:C++,CDATA_ENDING_2:C++,PROC_INST:C++,PROC_INST_BODY:C++,PROC_INST_ENDING:C++,OPEN_TAG:C++,OPEN_TAG_SLASH:C++,ATTRIB:C++,ATTRIB_NAME:C++,ATTRIB_NAME_SAW_WHITE:C++,ATTRIB_VALUE:C++,ATTRIB_VALUE_QUOTED:C++,ATTRIB_VALUE_CLOSED:C++,ATTRIB_VALUE_UNQUOTED:C++,ATTRIB_VALUE_ENTITY_Q:C++,ATTRIB_VALUE_ENTITY_U:C++,CLOSE_TAG:C++,CLOSE_TAG_SAW_WHITE:C++,SCRIPT:C++,SCRIPT_ENDING:C++},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 E=e.ENTITIES[$],H=typeof E=="number"?String.fromCharCode(E):E;e.ENTITIES[$]=H});for(var U in e.STATE)e.STATE[e.STATE[U]]=U;C=e.STATE;function ie($,E,H){$[E]&&$[E](H)}function I($,E,H){$.textNode&&W($),ie($,E,H)}function W($){$.textNode=A($.opt,$.textNode),$.textNode&&ie($,"ontext",$.textNode),$.textNode=""}function A($,E){return $.trim&&(E=E.trim()),$.normalize&&(E=E.replace(/\s+/g," ")),E}function G($,E){return W($),$.trackPosition&&(E+=`
17
- Line: `+$.line+`
18
- Column: `+$.column+`
19
- Char: `+$.c),E=new Error(E),$.error=E,ie($,"onerror",E),$}function ae($){return $.sawRoot&&!$.closedRoot&&X($,"Unclosed root tag"),$.state!==C.BEGIN&&$.state!==C.BEGIN_WHITESPACE&&$.state!==C.TEXT&&G($,"Unexpected end"),W($),$.c="",$.closed=!0,ie($,"onend"),r.call($,$.strict,$.opt),$}function X($,E){if(typeof $!="object"||!($ instanceof r))throw new Error("bad call to strictFail");$.strict&&G($,E)}function de($){$.strict||($.tagName=$.tagName[$.looseCase]());var E=$.tags[$.tags.length-1]||$,H=$.tag={name:$.tagName,attributes:{}};$.opt.xmlns&&(H.ns=E.ns),$.attribList.length=0,I($,"onopentagstart",H)}function J($,E){var H=$.indexOf(":"),q=H<0?["",$]:$.split(":"),N=q[0],R=q[1];return E&&$==="xmlns"&&(N="xmlns",R=""),{prefix:N,local:R}}function pe($){if($.strict||($.attribName=$.attribName[$.looseCase]()),$.attribList.indexOf($.attribName)!==-1||$.tag.attributes.hasOwnProperty($.attribName)){$.attribName=$.attribValue="";return}if($.opt.xmlns){var E=J($.attribName,!0),H=E.prefix,q=E.local;if(H==="xmlns")if(q==="xml"&&$.attribValue!==p)X($,"xml: prefix must be bound to "+p+`
20
- Actual: `+$.attribValue);else if(q==="xmlns"&&$.attribValue!==h)X($,"xmlns: prefix must be bound to "+h+`
21
- Actual: `+$.attribValue);else{var N=$.tag,R=$.tags[$.tags.length-1]||$;N.ns===R.ns&&(N.ns=Object.create(R.ns)),N.ns[q]=$.attribValue}$.attribList.push([$.attribName,$.attribValue])}else $.tag.attributes[$.attribName]=$.attribValue,I($,"onattribute",{name:$.attribName,value:$.attribValue});$.attribName=$.attribValue=""}function Q($,E){if($.opt.xmlns){var H=$.tag,q=J($.tagName);H.prefix=q.prefix,H.local=q.local,H.uri=H.ns[q.prefix]||"",H.prefix&&!H.uri&&(X($,"Unbound namespace prefix: "+JSON.stringify($.tagName)),H.uri=q.prefix);var N=$.tags[$.tags.length-1]||$;H.ns&&N.ns!==H.ns&&Object.keys(H.ns).forEach(function(se){I($,"onopennamespace",{prefix:se,uri:H.ns[se]})});for(var R=0,le=$.attribList.length;R<le;R++){var S=$.attribList[R],oe=S[0],te=S[1],L=J(oe,!0),z=L.prefix,P=L.local,fe=z===""?"":H.ns[z]||"",me={name:oe,value:te,prefix:z,local:P,uri:fe};z&&z!=="xmlns"&&!fe&&(X($,"Unbound namespace prefix: "+JSON.stringify(z)),me.uri=z),$.tag.attributes[oe]=me,I($,"onattribute",me)}$.attribList.length=0}$.tag.isSelfClosing=!!E,$.sawRoot=!0,$.tags.push($.tag),I($,"onopentag",$.tag),E||(!$.noscript&&$.tagName.toLowerCase()==="script"?$.state=C.SCRIPT:$.state=C.TEXT,$.tag=null,$.tagName=""),$.attribName=$.attribValue="",$.attribList.length=0}function B($){if(!$.tagName){X($,"Weird empty close tag."),$.textNode+="</>",$.state=C.TEXT;return}if($.script){if($.tagName!=="script"){$.script+="</"+$.tagName+">",$.tagName="",$.state=C.SCRIPT;return}I($,"onscript",$.script),$.script=""}var E=$.tags.length,H=$.tagName;$.strict||(H=H[$.looseCase]());for(var q=H;E--;){var N=$.tags[E];if(N.name!==q)X($,"Unexpected close tag");else break}if(E<0){X($,"Unmatched closing tag: "+$.tagName),$.textNode+="</"+$.tagName+">",$.state=C.TEXT;return}$.tagName=H;for(var R=$.tags.length;R-- >E;){var le=$.tag=$.tags.pop();$.tagName=$.tag.name,I($,"onclosetag",$.tagName);var S={};for(var oe in le.ns)S[oe]=le.ns[oe];var te=$.tags[$.tags.length-1]||$;$.opt.xmlns&&le.ns!==te.ns&&Object.keys(le.ns).forEach(function(L){var z=le.ns[L];I($,"onclosenamespace",{prefix:L,uri:z})})}E===0&&($.closedRoot=!0),$.tagName=$.attribValue=$.attribName="",$.attribList.length=0,$.state=C.TEXT}function ee($){var E=$.entity,H=E.toLowerCase(),q,N="";return $.ENTITIES[E]?$.ENTITIES[E]:$.ENTITIES[H]?$.ENTITIES[H]:(E=H,E.charAt(0)==="#"&&(E.charAt(1)==="x"?(E=E.slice(2),q=parseInt(E,16),N=q.toString(16)):(E=E.slice(1),q=parseInt(E,10),N=q.toString(10))),E=E.replace(/^0+/,""),isNaN(q)||N.toLowerCase()!==E?(X($,"Invalid character entity"),"&"+$.entity+";"):String.fromCodePoint(q))}function Z($,E){E==="<"?($.state=C.OPEN_WAKA,$.startTagPosition=$.position):w(E)||(X($,"Non-whitespace before first tag."),$.textNode=E,$.state=C.TEXT)}function re($,E){var H="";return E<$.length&&(H=$.charAt(E)),H}function K($){var E=this;if(this.error)throw this.error;if(E.closed)return G(E,"Cannot write after close. Assign an onready handler.");if($===null)return ae(E);typeof $=="object"&&($=$.toString());for(var H=0,q="";q=re($,H++),E.c=q,!!q;)switch(E.trackPosition&&(E.position++,q===`
22
- `?(E.line++,E.column=0):E.column++),E.state){case C.BEGIN:if(E.state=C.BEGIN_WHITESPACE,q==="\uFEFF")continue;Z(E,q);continue;case C.BEGIN_WHITESPACE:Z(E,q);continue;case C.TEXT:if(E.sawRoot&&!E.closedRoot){for(var N=H-1;q&&q!=="<"&&q!=="&";)q=re($,H++),q&&E.trackPosition&&(E.position++,q===`
23
- `?(E.line++,E.column=0):E.column++);E.textNode+=$.substring(N,H-1)}q==="<"&&!(E.sawRoot&&E.closedRoot&&!E.strict)?(E.state=C.OPEN_WAKA,E.startTagPosition=E.position):(!w(q)&&(!E.sawRoot||E.closedRoot)&&X(E,"Text data outside of root node."),q==="&"?E.state=C.TEXT_ENTITY:E.textNode+=q);continue;case C.SCRIPT:q==="<"?E.state=C.SCRIPT_ENDING:E.script+=q;continue;case C.SCRIPT_ENDING:q==="/"?E.state=C.CLOSE_TAG:(E.script+="<"+q,E.state=C.SCRIPT);continue;case C.OPEN_WAKA:if(q==="!")E.state=C.SGML_DECL,E.sgmlDecl="";else if(!w(q))if(M(y,q))E.state=C.OPEN_TAG,E.tagName=q;else if(q==="/")E.state=C.CLOSE_TAG,E.tagName="";else if(q==="?")E.state=C.PROC_INST,E.procInstName=E.procInstBody="";else{if(X(E,"Unencoded <"),E.startTagPosition+1<E.position){var R=E.position-E.startTagPosition;q=new Array(R).join(" ")+q}E.textNode+="<"+q,E.state=C.TEXT}continue;case C.SGML_DECL:if(E.sgmlDecl+q==="--"){E.state=C.COMMENT,E.comment="",E.sgmlDecl="";continue}E.doctype&&E.doctype!==!0&&E.sgmlDecl?(E.state=C.DOCTYPE_DTD,E.doctype+="<!"+E.sgmlDecl+q,E.sgmlDecl=""):(E.sgmlDecl+q).toUpperCase()===d?(I(E,"onopencdata"),E.state=C.CDATA,E.sgmlDecl="",E.cdata=""):(E.sgmlDecl+q).toUpperCase()===f?(E.state=C.DOCTYPE,(E.doctype||E.sawRoot)&&X(E,"Inappropriately located doctype declaration"),E.doctype="",E.sgmlDecl=""):q===">"?(I(E,"onsgmldeclaration",E.sgmlDecl),E.sgmlDecl="",E.state=C.TEXT):(T(q)&&(E.state=C.SGML_DECL_QUOTED),E.sgmlDecl+=q);continue;case C.SGML_DECL_QUOTED:q===E.q&&(E.state=C.SGML_DECL,E.q=""),E.sgmlDecl+=q;continue;case C.DOCTYPE:q===">"?(E.state=C.TEXT,I(E,"ondoctype",E.doctype),E.doctype=!0):(E.doctype+=q,q==="["?E.state=C.DOCTYPE_DTD:T(q)&&(E.state=C.DOCTYPE_QUOTED,E.q=q));continue;case C.DOCTYPE_QUOTED:E.doctype+=q,q===E.q&&(E.q="",E.state=C.DOCTYPE);continue;case C.DOCTYPE_DTD:q==="]"?(E.doctype+=q,E.state=C.DOCTYPE):q==="<"?(E.state=C.OPEN_WAKA,E.startTagPosition=E.position):T(q)?(E.doctype+=q,E.state=C.DOCTYPE_DTD_QUOTED,E.q=q):E.doctype+=q;continue;case C.DOCTYPE_DTD_QUOTED:E.doctype+=q,q===E.q&&(E.state=C.DOCTYPE_DTD,E.q="");continue;case C.COMMENT:q==="-"?E.state=C.COMMENT_ENDING:E.comment+=q;continue;case C.COMMENT_ENDING:q==="-"?(E.state=C.COMMENT_ENDED,E.comment=A(E.opt,E.comment),E.comment&&I(E,"oncomment",E.comment),E.comment=""):(E.comment+="-"+q,E.state=C.COMMENT);continue;case C.COMMENT_ENDED:q!==">"?(X(E,"Malformed comment"),E.comment+="--"+q,E.state=C.COMMENT):E.doctype&&E.doctype!==!0?E.state=C.DOCTYPE_DTD:E.state=C.TEXT;continue;case C.CDATA:q==="]"?E.state=C.CDATA_ENDING:E.cdata+=q;continue;case C.CDATA_ENDING:q==="]"?E.state=C.CDATA_ENDING_2:(E.cdata+="]"+q,E.state=C.CDATA);continue;case C.CDATA_ENDING_2:q===">"?(E.cdata&&I(E,"oncdata",E.cdata),I(E,"onclosecdata"),E.cdata="",E.state=C.TEXT):q==="]"?E.cdata+="]":(E.cdata+="]]"+q,E.state=C.CDATA);continue;case C.PROC_INST:q==="?"?E.state=C.PROC_INST_ENDING:w(q)?E.state=C.PROC_INST_BODY:E.procInstName+=q;continue;case C.PROC_INST_BODY:if(!E.procInstBody&&w(q))continue;q==="?"?E.state=C.PROC_INST_ENDING:E.procInstBody+=q;continue;case C.PROC_INST_ENDING:q===">"?(I(E,"onprocessinginstruction",{name:E.procInstName,body:E.procInstBody}),E.procInstName=E.procInstBody="",E.state=C.TEXT):(E.procInstBody+="?"+q,E.state=C.PROC_INST_BODY);continue;case C.OPEN_TAG:M(g,q)?E.tagName+=q:(de(E),q===">"?Q(E):q==="/"?E.state=C.OPEN_TAG_SLASH:(w(q)||X(E,"Invalid character in tag name"),E.state=C.ATTRIB));continue;case C.OPEN_TAG_SLASH:q===">"?(Q(E,!0),B(E)):(X(E,"Forward-slash in opening tag not followed by >"),E.state=C.ATTRIB);continue;case C.ATTRIB:if(w(q))continue;q===">"?Q(E):q==="/"?E.state=C.OPEN_TAG_SLASH:M(y,q)?(E.attribName=q,E.attribValue="",E.state=C.ATTRIB_NAME):X(E,"Invalid attribute name");continue;case C.ATTRIB_NAME:q==="="?E.state=C.ATTRIB_VALUE:q===">"?(X(E,"Attribute without value"),E.attribValue=E.attribName,pe(E),Q(E)):w(q)?E.state=C.ATTRIB_NAME_SAW_WHITE:M(g,q)?E.attribName+=q:X(E,"Invalid attribute name");continue;case C.ATTRIB_NAME_SAW_WHITE:if(q==="=")E.state=C.ATTRIB_VALUE;else{if(w(q))continue;X(E,"Attribute without value"),E.tag.attributes[E.attribName]="",E.attribValue="",I(E,"onattribute",{name:E.attribName,value:""}),E.attribName="",q===">"?Q(E):M(y,q)?(E.attribName=q,E.state=C.ATTRIB_NAME):(X(E,"Invalid attribute name"),E.state=C.ATTRIB)}continue;case C.ATTRIB_VALUE:if(w(q))continue;T(q)?(E.q=q,E.state=C.ATTRIB_VALUE_QUOTED):(E.opt.unquotedAttributeValues||G(E,"Unquoted attribute value"),E.state=C.ATTRIB_VALUE_UNQUOTED,E.attribValue=q);continue;case C.ATTRIB_VALUE_QUOTED:if(q!==E.q){q==="&"?E.state=C.ATTRIB_VALUE_ENTITY_Q:E.attribValue+=q;continue}pe(E),E.q="",E.state=C.ATTRIB_VALUE_CLOSED;continue;case C.ATTRIB_VALUE_CLOSED:w(q)?E.state=C.ATTRIB:q===">"?Q(E):q==="/"?E.state=C.OPEN_TAG_SLASH:M(y,q)?(X(E,"No whitespace between attributes"),E.attribName=q,E.attribValue="",E.state=C.ATTRIB_NAME):X(E,"Invalid attribute name");continue;case C.ATTRIB_VALUE_UNQUOTED:if(!D(q)){q==="&"?E.state=C.ATTRIB_VALUE_ENTITY_U:E.attribValue+=q;continue}pe(E),q===">"?Q(E):E.state=C.ATTRIB;continue;case C.CLOSE_TAG:if(E.tagName)q===">"?B(E):M(g,q)?E.tagName+=q:E.script?(E.script+="</"+E.tagName,E.tagName="",E.state=C.SCRIPT):(w(q)||X(E,"Invalid tagname in closing tag"),E.state=C.CLOSE_TAG_SAW_WHITE);else{if(w(q))continue;F(y,q)?E.script?(E.script+="</"+q,E.state=C.SCRIPT):X(E,"Invalid tagname in closing tag."):E.tagName=q}continue;case C.CLOSE_TAG_SAW_WHITE:if(w(q))continue;q===">"?B(E):X(E,"Invalid characters in closing tag");continue;case C.TEXT_ENTITY:case C.ATTRIB_VALUE_ENTITY_Q:case C.ATTRIB_VALUE_ENTITY_U:var le,S;switch(E.state){case C.TEXT_ENTITY:le=C.TEXT,S="textNode";break;case C.ATTRIB_VALUE_ENTITY_Q:le=C.ATTRIB_VALUE_QUOTED,S="attribValue";break;case C.ATTRIB_VALUE_ENTITY_U:le=C.ATTRIB_VALUE_UNQUOTED,S="attribValue";break}if(q===";"){var oe=ee(E);E.opt.unparsedEntities&&!Object.values(e.XML_ENTITIES).includes(oe)?(E.entity="",E.state=le,E.write(oe)):(E[S]+=oe,E.entity="",E.state=le)}else M(E.entity.length?k:x,q)?E.entity+=q:(X(E,"Invalid character in entity name"),E[S]+="&"+E.entity+q,E.entity="",E.state=le);continue;default:throw new Error(E,"Unknown state: "+E.state)}return E.position>=E.bufferCheckPosition&&o(E),E}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */String.fromCodePoint||function(){var $=String.fromCharCode,E=Math.floor,H=function(){var q=16384,N=[],R,le,S=-1,oe=arguments.length;if(!oe)return"";for(var te="";++S<oe;){var L=Number(arguments[S]);if(!isFinite(L)||L<0||L>1114111||E(L)!==L)throw RangeError("Invalid code point: "+L);L<=65535?N.push(L):(L-=65536,R=(L>>10)+55296,le=L%1024+56320,N.push(R,le)),(S+1===oe||N.length>q)&&(te+=$.apply(null,N),N.length=0)}return te};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:H,configurable:!0,writable:!0}):String.fromCodePoint=H}()})(t)})(m0);var gf={isArray:function(t){return Array.isArray?Array.isArray(t):Object.prototype.toString.call(t)==="[object Array]"}},A3=gf.isArray,yf={copyOptions:function(t){var e,n={};for(e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);return n},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"&&!A3(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}},$3=m0,Ue=yf,Po=gf.isArray,he,Be;function T3(t){return he=Ue.copyOptions(t),Ue.ensureFlagExists("ignoreDeclaration",he),Ue.ensureFlagExists("ignoreInstruction",he),Ue.ensureFlagExists("ignoreAttributes",he),Ue.ensureFlagExists("ignoreText",he),Ue.ensureFlagExists("ignoreComment",he),Ue.ensureFlagExists("ignoreCdata",he),Ue.ensureFlagExists("ignoreDoctype",he),Ue.ensureFlagExists("compact",he),Ue.ensureFlagExists("alwaysChildren",he),Ue.ensureFlagExists("addParent",he),Ue.ensureFlagExists("trim",he),Ue.ensureFlagExists("nativeType",he),Ue.ensureFlagExists("nativeTypeAttributes",he),Ue.ensureFlagExists("sanitize",he),Ue.ensureFlagExists("instructionHasAttributes",he),Ue.ensureFlagExists("captureSpacesBetweenElements",he),Ue.ensureAlwaysArrayExists(he),Ue.ensureKeyExists("declaration",he),Ue.ensureKeyExists("instruction",he),Ue.ensureKeyExists("attributes",he),Ue.ensureKeyExists("text",he),Ue.ensureKeyExists("comment",he),Ue.ensureKeyExists("cdata",he),Ue.ensureKeyExists("doctype",he),Ue.ensureKeyExists("type",he),Ue.ensureKeyExists("name",he),Ue.ensureKeyExists("elements",he),Ue.ensureKeyExists("parent",he),he}function B0(t){var e=Number(t);if(!isNaN(e))return e;var n=t.toLowerCase();return n==="true"?!0:n==="false"?!1:t}function ks(t,e){var n;if(he.compact){if(!Be[he[t+"Key"]]&&(Po(he.alwaysArray)?he.alwaysArray.indexOf(he[t+"Key"])!==-1:he.alwaysArray)&&(Be[he[t+"Key"]]=[]),Be[he[t+"Key"]]&&!Po(Be[he[t+"Key"]])&&(Be[he[t+"Key"]]=[Be[he[t+"Key"]]]),t+"Fn"in he&&typeof e=="string"&&(e=he[t+"Fn"](e,Be)),t==="instruction"&&("instructionFn"in he||"instructionNameFn"in he)){for(n in e)if(e.hasOwnProperty(n))if("instructionFn"in he)e[n]=he.instructionFn(e[n],n,Be);else{var r=e[n];delete e[n],e[he.instructionNameFn(n,r,Be)]=r}}Po(Be[he[t+"Key"]])?Be[he[t+"Key"]].push(e):Be[he[t+"Key"]]=e}else{Be[he.elementsKey]||(Be[he.elementsKey]=[]);var o={};if(o[he.typeKey]=t,t==="instruction"){for(n in e)if(e.hasOwnProperty(n))break;o[he.nameKey]="instructionNameFn"in he?he.instructionNameFn(n,e,Be):n,he.instructionHasAttributes?(o[he.attributesKey]=e[n][he.attributesKey],"instructionFn"in he&&(o[he.attributesKey]=he.instructionFn(o[he.attributesKey],n,Be))):("instructionFn"in he&&(e[n]=he.instructionFn(e[n],n,Be)),o[he.instructionKey]=e[n])}else t+"Fn"in he&&(e=he[t+"Fn"](e,Be)),o[he[t+"Key"]]=e;he.addParent&&(o[he.parentKey]=Be),Be[he.elementsKey].push(o)}}function R0(t){if("attributesFn"in he&&t&&(t=he.attributesFn(t,Be)),(he.trim||"attributeValueFn"in he||"attributeNameFn"in he||he.nativeTypeAttributes)&&t){var e;for(e in t)if(t.hasOwnProperty(e)&&(he.trim&&(t[e]=t[e].trim()),he.nativeTypeAttributes&&(t[e]=B0(t[e])),"attributeValueFn"in he&&(t[e]=he.attributeValueFn(t[e],e,Be)),"attributeNameFn"in he)){var n=t[e];delete t[e],t[he.attributeNameFn(e,t[e],Be)]=n}}return t}function O3(t){var e={};if(t.body&&(t.name.toLowerCase()==="xml"||he.instructionHasAttributes)){for(var n=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g,r;(r=n.exec(t.body))!==null;)e[r[1]]=r[2]||r[3]||r[4];e=R0(e)}if(t.name.toLowerCase()==="xml"){if(he.ignoreDeclaration)return;Be[he.declarationKey]={},Object.keys(e).length&&(Be[he.declarationKey][he.attributesKey]=e),he.addParent&&(Be[he.declarationKey][he.parentKey]=Be)}else{if(he.ignoreInstruction)return;he.trim&&(t.body=t.body.trim());var o={};he.instructionHasAttributes&&Object.keys(e).length?(o[t.name]={},o[t.name][he.attributesKey]=e):o[t.name]=t.body,ks("instruction",o)}}function D3(t,e){var n;if(typeof t=="object"&&(e=t.attributes,t=t.name),e=R0(e),"elementNameFn"in he&&(t=he.elementNameFn(t,Be)),he.compact){if(n={},!he.ignoreAttributes&&e&&Object.keys(e).length){n[he.attributesKey]={};var r;for(r in e)e.hasOwnProperty(r)&&(n[he.attributesKey][r]=e[r])}!(t in Be)&&(Po(he.alwaysArray)?he.alwaysArray.indexOf(t)!==-1:he.alwaysArray)&&(Be[t]=[]),Be[t]&&!Po(Be[t])&&(Be[t]=[Be[t]]),Po(Be[t])?Be[t].push(n):Be[t]=n}else Be[he.elementsKey]||(Be[he.elementsKey]=[]),n={},n[he.typeKey]="element",n[he.nameKey]=t,!he.ignoreAttributes&&e&&Object.keys(e).length&&(n[he.attributesKey]=e),he.alwaysChildren&&(n[he.elementsKey]=[]),Be[he.elementsKey].push(n);n[he.parentKey]=Be,Be=n}function M3(t){he.ignoreText||!t.trim()&&!he.captureSpacesBetweenElements||(he.trim&&(t=t.trim()),he.nativeType&&(t=B0(t)),he.sanitize&&(t=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")),ks("text",t))}function _3(t){he.ignoreComment||(he.trim&&(t=t.trim()),ks("comment",t))}function N3(t){var e=Be[he.parentKey];he.addParent||delete Be[he.parentKey],Be=e}function I3(t){he.ignoreCdata||(he.trim&&(t=t.trim()),ks("cdata",t))}function F3(t){he.ignoreDoctype||(t=t.replace(/^ /,""),he.trim&&(t=t.trim()),ks("doctype",t))}function B3(t){t.note=t}var L0=function(t,e){var n=$3.parser(!0,{}),r={};if(Be=r,he=T3(e),n.opt={strictEntities:!0},n.onopentag=D3,n.ontext=M3,n.oncomment=_3,n.onclosetag=N3,n.onerror=B3,n.oncdata=I3,n.ondoctype=F3,n.onprocessinginstruction=O3,n.write(t).close(),r[he.elementsKey]){var o=r[he.elementsKey];delete r[he.elementsKey],r[he.elementsKey]=o,delete r.text}return r},Cm=yf,R3=L0;function L3(t){var e=Cm.copyOptions(t);return Cm.ensureSpacesExists(e),e}var P3=function(t,e){var n,r,o,i;return n=L3(e),r=R3(t,n),i="compact"in n&&n.compact?"_parent":"parent","addParent"in n&&n.addParent?o=JSON.stringify(r,function(s,a){return s===i?"_":a},n.spaces):o=JSON.stringify(r,null,n.spaces),o.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")},Ke=yf,z3=gf.isArray,_t,Nt;function j3(t){var e=Ke.copyOptions(t);return Ke.ensureFlagExists("ignoreDeclaration",e),Ke.ensureFlagExists("ignoreInstruction",e),Ke.ensureFlagExists("ignoreAttributes",e),Ke.ensureFlagExists("ignoreText",e),Ke.ensureFlagExists("ignoreComment",e),Ke.ensureFlagExists("ignoreCdata",e),Ke.ensureFlagExists("ignoreDoctype",e),Ke.ensureFlagExists("compact",e),Ke.ensureFlagExists("indentText",e),Ke.ensureFlagExists("indentCdata",e),Ke.ensureFlagExists("indentAttributes",e),Ke.ensureFlagExists("indentInstruction",e),Ke.ensureFlagExists("fullTagEmptyElement",e),Ke.ensureFlagExists("noQuotesForNativeAttributes",e),Ke.ensureSpacesExists(e),typeof e.spaces=="number"&&(e.spaces=Array(e.spaces+1).join(" ")),Ke.ensureKeyExists("declaration",e),Ke.ensureKeyExists("instruction",e),Ke.ensureKeyExists("attributes",e),Ke.ensureKeyExists("text",e),Ke.ensureKeyExists("comment",e),Ke.ensureKeyExists("cdata",e),Ke.ensureKeyExists("doctype",e),Ke.ensureKeyExists("type",e),Ke.ensureKeyExists("name",e),Ke.ensureKeyExists("elements",e),e}function Tn(t,e,n){return(!n&&t.spaces?`
24
- `:"")+Array(e+1).join(t.spaces)}function vl(t,e,n){if(e.ignoreAttributes)return"";"attributesFn"in e&&(t=e.attributesFn(t,Nt,_t));var r,o,i,s,a=[];for(r in t)t.hasOwnProperty(r)&&t[r]!==null&&t[r]!==void 0&&(s=e.noQuotesForNativeAttributes&&typeof t[r]!="string"?"":'"',o=""+t[r],o=o.replace(/"/g,"&quot;"),i="attributeNameFn"in e?e.attributeNameFn(r,o,Nt,_t):r,a.push(e.spaces&&e.indentAttributes?Tn(e,n+1,!1):" "),a.push(i+"="+s+("attributeValueFn"in e?e.attributeValueFn(o,r,Nt,_t):o)+s));return t&&Object.keys(t).length&&e.spaces&&e.indentAttributes&&a.push(Tn(e,n,!1)),a.join("")}function P0(t,e,n){return _t=t,Nt="xml",e.ignoreDeclaration?"":"<?xml"+vl(t[e.attributesKey],e,n)+"?>"}function z0(t,e,n){if(e.ignoreInstruction)return"";var r;for(r in t)if(t.hasOwnProperty(r))break;var o="instructionNameFn"in e?e.instructionNameFn(r,t[r],Nt,_t):r;if(typeof t[r]=="object")return _t=t,Nt=o,"<?"+o+vl(t[r][e.attributesKey],e,n)+"?>";var i=t[r]?t[r]:"";return"instructionFn"in e&&(i=e.instructionFn(i,r,Nt,_t)),"<?"+o+(i?" "+i:"")+"?>"}function j0(t,e){return e.ignoreComment?"":"<!--"+("commentFn"in e?e.commentFn(t,Nt,_t):t)+"-->"}function q0(t,e){return e.ignoreCdata?"":"<![CDATA["+("cdataFn"in e?e.cdataFn(t,Nt,_t):t.replace("]]>","]]]]><![CDATA[>"))+"]]>"}function V0(t,e){return e.ignoreDoctype?"":"<!DOCTYPE "+("doctypeFn"in e?e.doctypeFn(t,Nt,_t):t)+">"}function bf(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,Nt,_t):t)}function q3(t,e){var n;if(t.elements&&t.elements.length)for(n=0;n<t.elements.length;++n)switch(t.elements[n][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 V3(t,e,n){_t=t,Nt=t.name;var r=[],o="elementNameFn"in e?e.elementNameFn(t.name,t):t.name;r.push("<"+o),t[e.attributesKey]&&r.push(vl(t[e.attributesKey],e,n));var i=t[e.elementsKey]&&t[e.elementsKey].length||t[e.attributesKey]&&t[e.attributesKey]["xml:space"]==="preserve";return i||("fullTagEmptyElementFn"in e?i=e.fullTagEmptyElementFn(t.name,t):i=e.fullTagEmptyElement),i?(r.push(">"),t[e.elementsKey]&&t[e.elementsKey].length&&(r.push(U0(t[e.elementsKey],e,n+1)),_t=t,Nt=t.name),r.push(e.spaces&&q3(t,e)?`
25
- `+Array(n+1).join(e.spaces):""),r.push("</"+o+">")):r.push("/>"),r.join("")}function U0(t,e,n,r){return t.reduce(function(o,i){var s=Tn(e,n,r&&!o);switch(i.type){case"element":return o+s+V3(i,e,n);case"comment":return o+s+j0(i[e.commentKey],e);case"doctype":return o+s+V0(i[e.doctypeKey],e);case"cdata":return o+(e.indentCdata?s:"")+q0(i[e.cdataKey],e);case"text":return o+(e.indentText?s:"")+bf(i[e.textKey],e);case"instruction":var a={};return a[i[e.nameKey]]=i[e.attributesKey]?i:i[e.instructionKey],o+(e.indentInstruction?s:"")+z0(a,e,n)}},"")}function H0(t,e,n){var r;for(r in t)if(t.hasOwnProperty(r))switch(r){case e.parentKey:case e.attributesKey:break;case e.textKey:if(e.indentText||n)return!0;break;case e.cdataKey:if(e.indentCdata||n)return!0;break;case e.instructionKey:if(e.indentInstruction||n)return!0;break;case e.doctypeKey:case e.commentKey:return!0;default:return!0}return!1}function U3(t,e,n,r,o){_t=t,Nt=e;var i="elementNameFn"in n?n.elementNameFn(e,t):e;if(typeof t>"u"||t===null||t==="")return"fullTagEmptyElementFn"in n&&n.fullTagEmptyElementFn(e,t)||n.fullTagEmptyElement?"<"+i+"></"+i+">":"<"+i+"/>";var s=[];if(e){if(s.push("<"+i),typeof t!="object")return s.push(">"+bf(t,n)+"</"+i+">"),s.join("");t[n.attributesKey]&&s.push(vl(t[n.attributesKey],n,r));var a=H0(t,n,!0)||t[n.attributesKey]&&t[n.attributesKey]["xml:space"]==="preserve";if(a||("fullTagEmptyElementFn"in n?a=n.fullTagEmptyElementFn(e,t):a=n.fullTagEmptyElement),a)s.push(">");else return s.push("/>"),s.join("")}return s.push(W0(t,n,r+1,!1)),_t=t,Nt=e,e&&s.push((o?Tn(n,r,!1):"")+"</"+i+">"),s.join("")}function W0(t,e,n,r){var o,i,s,a=[];for(i in t)if(t.hasOwnProperty(i))for(s=z3(t[i])?t[i]:[t[i]],o=0;o<s.length;++o){switch(i){case e.declarationKey:a.push(P0(s[o],e,n));break;case e.instructionKey:a.push((e.indentInstruction?Tn(e,n,r):"")+z0(s[o],e,n));break;case e.attributesKey:case e.parentKey:break;case e.textKey:a.push((e.indentText?Tn(e,n,r):"")+bf(s[o],e));break;case e.cdataKey:a.push((e.indentCdata?Tn(e,n,r):"")+q0(s[o],e));break;case e.doctypeKey:a.push(Tn(e,n,r)+V0(s[o],e));break;case e.commentKey:a.push(Tn(e,n,r)+j0(s[o],e));break;default:a.push(Tn(e,n,r)+U3(s[o],i,e,n,H0(s[o],e)))}r=r&&!a.length}return a.join("")}var G0=function(t,e){e=j3(e);var n=[];return _t=t,Nt="_root_",e.compact?n.push(W0(t,e,0,!0)):(t[e.declarationKey]&&n.push(P0(t[e.declarationKey],e,0)),t[e.elementsKey]&&t[e.elementsKey].length&&n.push(U0(t[e.elementsKey],e,0,!n.length))),n.join("")},H3=G0,W3=function(t,e){t instanceof St&&(t=t.toString());var n=null;if(typeof t=="string")try{n=JSON.parse(t)}catch{throw new Error("The JSON structure is invalid")}else n=t;return H3(n,e)},G3=L0,K3=P3,X3=G0,J3=W3,Y3={xml2js:G3,xml2json:K3,js2xml:X3,json2xml:J3};const K0=ml(Y3);var Bs,Z3=new Uint8Array(16);function Q3(){if(!Bs&&(Bs=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Bs))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Bs(Z3)}const eC=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function tC(t){return typeof t=="string"&&eC.test(t)}var xt=[];for(var Ic=0;Ic<256;++Ic)xt.push((Ic+256).toString(16).substr(1));function nC(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(xt[t[e+0]]+xt[t[e+1]]+xt[t[e+2]]+xt[t[e+3]]+"-"+xt[t[e+4]]+xt[t[e+5]]+"-"+xt[t[e+6]]+xt[t[e+7]]+"-"+xt[t[e+8]]+xt[t[e+9]]+"-"+xt[t[e+10]]+xt[t[e+11]]+xt[t[e+12]]+xt[t[e+13]]+xt[t[e+14]]+xt[t[e+15]]).toLowerCase();if(!tC(n))throw TypeError("Stringified UUID is invalid");return n}function mo(t,e,n){t=t||{};var r=t.random||(t.rng||Q3)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,nC(r)}var Ma={exports:{}};/*! https://mths.be/he v1.2.0 by @mathias | MIT license */Ma.exports;(function(t,e){(function(n){var r=e,o=t&&t.exports==r&&t,i=typeof zt=="object"&&zt;(i.global===i||i.window===i)&&(n=i);var s=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,a=/[\x01-\x7F]/g,l=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,c=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g,u={"­":"shy","‌":"zwnj","‍":"zwj","‎":"lrm","⁣":"ic","⁢":"it","⁡":"af","‏":"rlm","​":"ZeroWidthSpace","⁠":"NoBreak","̑":"DownBreve","⃛":"tdot","⃜":"DotDot"," ":"Tab","\n":"NewLine"," ":"puncsp"," ":"MediumSpace"," ":"thinsp"," ":"hairsp"," ":"emsp13"," ":"ensp"," ":"emsp14"," ":"emsp"," ":"numsp"," ":"nbsp","  ":"ThickSpace","‾":"oline",_:"lowbar","‐":"dash","–":"ndash","—":"mdash","―":"horbar",",":"comma",";":"semi","⁏":"bsemi",":":"colon","⩴":"Colone","!":"excl","¡":"iexcl","?":"quest","¿":"iquest",".":"period","‥":"nldr","…":"mldr","·":"middot","'":"apos","‘":"lsquo","’":"rsquo","‚":"sbquo","‹":"lsaquo","›":"rsaquo",'"':"quot","“":"ldquo","”":"rdquo","„":"bdquo","«":"laquo","»":"raquo","(":"lpar",")":"rpar","[":"lsqb","]":"rsqb","{":"lcub","}":"rcub","⌈":"lceil","⌉":"rceil","⌊":"lfloor","⌋":"rfloor","⦅":"lopar","⦆":"ropar","⦋":"lbrke","⦌":"rbrke","⦍":"lbrkslu","⦎":"rbrksld","⦏":"lbrksld","⦐":"rbrkslu","⦑":"langd","⦒":"rangd","⦓":"lparlt","⦔":"rpargt","⦕":"gtlPar","⦖":"ltrPar","⟦":"lobrk","⟧":"robrk","⟨":"lang","⟩":"rang","⟪":"Lang","⟫":"Rang","⟬":"loang","⟭":"roang","❲":"lbbrk","❳":"rbbrk","‖":"Vert","§":"sect","¶":"para","@":"commat","*":"ast","/":"sol",undefined:null,"&":"amp","#":"num","%":"percnt","‰":"permil","‱":"pertenk","†":"dagger","‡":"Dagger","•":"bull","⁃":"hybull","′":"prime","″":"Prime","‴":"tprime","⁗":"qprime","‵":"bprime","⁁":"caret","`":"grave","´":"acute","˜":"tilde","^":"Hat","¯":"macr","˘":"breve","˙":"dot","¨":"die","˚":"ring","˝":"dblac","¸":"cedil","˛":"ogon","ˆ":"circ","ˇ":"caron","°":"deg","©":"copy","®":"reg","℗":"copysr","℘":"wp","℞":"rx","℧":"mho","℩":"iiota","←":"larr","↚":"nlarr","→":"rarr","↛":"nrarr","↑":"uarr","↓":"darr","↔":"harr","↮":"nharr","↕":"varr","↖":"nwarr","↗":"nearr","↘":"searr","↙":"swarr","↝":"rarrw","↝̸":"nrarrw","↞":"Larr","↟":"Uarr","↠":"Rarr","↡":"Darr","↢":"larrtl","↣":"rarrtl","↤":"mapstoleft","↥":"mapstoup","↦":"map","↧":"mapstodown","↩":"larrhk","↪":"rarrhk","↫":"larrlp","↬":"rarrlp","↭":"harrw","↰":"lsh","↱":"rsh","↲":"ldsh","↳":"rdsh","↵":"crarr","↶":"cularr","↷":"curarr","↺":"olarr","↻":"orarr","↼":"lharu","↽":"lhard","↾":"uharr","↿":"uharl","⇀":"rharu","⇁":"rhard","⇂":"dharr","⇃":"dharl","⇄":"rlarr","⇅":"udarr","⇆":"lrarr","⇇":"llarr","⇈":"uuarr","⇉":"rrarr","⇊":"ddarr","⇋":"lrhar","⇌":"rlhar","⇐":"lArr","⇍":"nlArr","⇑":"uArr","⇒":"rArr","⇏":"nrArr","⇓":"dArr","⇔":"iff","⇎":"nhArr","⇕":"vArr","⇖":"nwArr","⇗":"neArr","⇘":"seArr","⇙":"swArr","⇚":"lAarr","⇛":"rAarr","⇝":"zigrarr","⇤":"larrb","⇥":"rarrb","⇵":"duarr","⇽":"loarr","⇾":"roarr","⇿":"hoarr","∀":"forall","∁":"comp","∂":"part","∂̸":"npart","∃":"exist","∄":"nexist","∅":"empty","∇":"Del","∈":"in","∉":"notin","∋":"ni","∌":"notni","϶":"bepsi","∏":"prod","∐":"coprod","∑":"sum","+":"plus","±":"pm","÷":"div","×":"times","<":"lt","≮":"nlt","<⃒":"nvlt","=":"equals","≠":"ne","=⃥":"bne","⩵":"Equal",">":"gt","≯":"ngt",">⃒":"nvgt","¬":"not","|":"vert","¦":"brvbar","−":"minus","∓":"mp","∔":"plusdo","⁄":"frasl","∖":"setmn","∗":"lowast","∘":"compfn","√":"Sqrt","∝":"prop","∞":"infin","∟":"angrt","∠":"ang","∠⃒":"nang","∡":"angmsd","∢":"angsph","∣":"mid","∤":"nmid","∥":"par","∦":"npar","∧":"and","∨":"or","∩":"cap","∩︀":"caps","∪":"cup","∪︀":"cups","∫":"int","∬":"Int","∭":"tint","⨌":"qint","∮":"oint","∯":"Conint","∰":"Cconint","∱":"cwint","∲":"cwconint","∳":"awconint","∴":"there4","∵":"becaus","∶":"ratio","∷":"Colon","∸":"minusd","∺":"mDDot","∻":"homtht","∼":"sim","≁":"nsim","∼⃒":"nvsim","∽":"bsim","∽̱":"race","∾":"ac","∾̳":"acE","∿":"acd","≀":"wr","≂":"esim","≂̸":"nesim","≃":"sime","≄":"nsime","≅":"cong","≇":"ncong","≆":"simne","≈":"ap","≉":"nap","≊":"ape","≋":"apid","≋̸":"napid","≌":"bcong","≍":"CupCap","≭":"NotCupCap","≍⃒":"nvap","≎":"bump","≎̸":"nbump","≏":"bumpe","≏̸":"nbumpe","≐":"doteq","≐̸":"nedot","≑":"eDot","≒":"efDot","≓":"erDot","≔":"colone","≕":"ecolon","≖":"ecir","≗":"cire","≙":"wedgeq","≚":"veeeq","≜":"trie","≟":"equest","≡":"equiv","≢":"nequiv","≡⃥":"bnequiv","≤":"le","≰":"nle","≤⃒":"nvle","≥":"ge","≱":"nge","≥⃒":"nvge","≦":"lE","≦̸":"nlE","≧":"gE","≧̸":"ngE","≨︀":"lvnE","≨":"lnE","≩":"gnE","≩︀":"gvnE","≪":"ll","≪̸":"nLtv","≪⃒":"nLt","≫":"gg","≫̸":"nGtv","≫⃒":"nGt","≬":"twixt","≲":"lsim","≴":"nlsim","≳":"gsim","≵":"ngsim","≶":"lg","≸":"ntlg","≷":"gl","≹":"ntgl","≺":"pr","⊀":"npr","≻":"sc","⊁":"nsc","≼":"prcue","⋠":"nprcue","≽":"sccue","⋡":"nsccue","≾":"prsim","≿":"scsim","≿̸":"NotSucceedsTilde","⊂":"sub","⊄":"nsub","⊂⃒":"vnsub","⊃":"sup","⊅":"nsup","⊃⃒":"vnsup","⊆":"sube","⊈":"nsube","⊇":"supe","⊉":"nsupe","⊊︀":"vsubne","⊊":"subne","⊋︀":"vsupne","⊋":"supne","⊍":"cupdot","⊎":"uplus","⊏":"sqsub","⊏̸":"NotSquareSubset","⊐":"sqsup","⊐̸":"NotSquareSuperset","⊑":"sqsube","⋢":"nsqsube","⊒":"sqsupe","⋣":"nsqsupe","⊓":"sqcap","⊓︀":"sqcaps","⊔":"sqcup","⊔︀":"sqcups","⊕":"oplus","⊖":"ominus","⊗":"otimes","⊘":"osol","⊙":"odot","⊚":"ocir","⊛":"oast","⊝":"odash","⊞":"plusb","⊟":"minusb","⊠":"timesb","⊡":"sdotb","⊢":"vdash","⊬":"nvdash","⊣":"dashv","⊤":"top","⊥":"bot","⊧":"models","⊨":"vDash","⊭":"nvDash","⊩":"Vdash","⊮":"nVdash","⊪":"Vvdash","⊫":"VDash","⊯":"nVDash","⊰":"prurel","⊲":"vltri","⋪":"nltri","⊳":"vrtri","⋫":"nrtri","⊴":"ltrie","⋬":"nltrie","⊴⃒":"nvltrie","⊵":"rtrie","⋭":"nrtrie","⊵⃒":"nvrtrie","⊶":"origof","⊷":"imof","⊸":"mumap","⊹":"hercon","⊺":"intcal","⊻":"veebar","⊽":"barvee","⊾":"angrtvb","⊿":"lrtri","⋀":"Wedge","⋁":"Vee","⋂":"xcap","⋃":"xcup","⋄":"diam","⋅":"sdot","⋆":"Star","⋇":"divonx","⋈":"bowtie","⋉":"ltimes","⋊":"rtimes","⋋":"lthree","⋌":"rthree","⋍":"bsime","⋎":"cuvee","⋏":"cuwed","⋐":"Sub","⋑":"Sup","⋒":"Cap","⋓":"Cup","⋔":"fork","⋕":"epar","⋖":"ltdot","⋗":"gtdot","⋘":"Ll","⋘̸":"nLl","⋙":"Gg","⋙̸":"nGg","⋚︀":"lesg","⋚":"leg","⋛":"gel","⋛︀":"gesl","⋞":"cuepr","⋟":"cuesc","⋦":"lnsim","⋧":"gnsim","⋨":"prnsim","⋩":"scnsim","⋮":"vellip","⋯":"ctdot","⋰":"utdot","⋱":"dtdot","⋲":"disin","⋳":"isinsv","⋴":"isins","⋵":"isindot","⋵̸":"notindot","⋶":"notinvc","⋷":"notinvb","⋹":"isinE","⋹̸":"notinE","⋺":"nisd","⋻":"xnis","⋼":"nis","⋽":"notnivc","⋾":"notnivb","⌅":"barwed","⌆":"Barwed","⌌":"drcrop","⌍":"dlcrop","⌎":"urcrop","⌏":"ulcrop","⌐":"bnot","⌒":"profline","⌓":"profsurf","⌕":"telrec","⌖":"target","⌜":"ulcorn","⌝":"urcorn","⌞":"dlcorn","⌟":"drcorn","⌢":"frown","⌣":"smile","⌭":"cylcty","⌮":"profalar","⌶":"topbot","⌽":"ovbar","⌿":"solbar","⍼":"angzarr","⎰":"lmoust","⎱":"rmoust","⎴":"tbrk","⎵":"bbrk","⎶":"bbrktbrk","⏜":"OverParenthesis","⏝":"UnderParenthesis","⏞":"OverBrace","⏟":"UnderBrace","⏢":"trpezium","⏧":"elinters","␣":"blank","─":"boxh","│":"boxv","┌":"boxdr","┐":"boxdl","└":"boxur","┘":"boxul","├":"boxvr","┤":"boxvl","┬":"boxhd","┴":"boxhu","┼":"boxvh","═":"boxH","║":"boxV","╒":"boxdR","╓":"boxDr","╔":"boxDR","╕":"boxdL","╖":"boxDl","╗":"boxDL","╘":"boxuR","╙":"boxUr","╚":"boxUR","╛":"boxuL","╜":"boxUl","╝":"boxUL","╞":"boxvR","╟":"boxVr","╠":"boxVR","╡":"boxvL","╢":"boxVl","╣":"boxVL","╤":"boxHd","╥":"boxhD","╦":"boxHD","╧":"boxHu","╨":"boxhU","╩":"boxHU","╪":"boxvH","╫":"boxVh","╬":"boxVH","▀":"uhblk","▄":"lhblk","█":"block","░":"blk14","▒":"blk12","▓":"blk34","□":"squ","▪":"squf","▫":"EmptyVerySmallSquare","▭":"rect","▮":"marker","▱":"fltns","△":"xutri","▴":"utrif","▵":"utri","▸":"rtrif","▹":"rtri","▽":"xdtri","▾":"dtrif","▿":"dtri","◂":"ltrif","◃":"ltri","◊":"loz","○":"cir","◬":"tridot","◯":"xcirc","◸":"ultri","◹":"urtri","◺":"lltri","◻":"EmptySmallSquare","◼":"FilledSmallSquare","★":"starf","☆":"star","☎":"phone","♀":"female","♂":"male","♠":"spades","♣":"clubs","♥":"hearts","♦":"diams","♪":"sung","✓":"check","✗":"cross","✠":"malt","✶":"sext","❘":"VerticalSeparator","⟈":"bsolhsub","⟉":"suphsol","⟵":"xlarr","⟶":"xrarr","⟷":"xharr","⟸":"xlArr","⟹":"xrArr","⟺":"xhArr","⟼":"xmap","⟿":"dzigrarr","⤂":"nvlArr","⤃":"nvrArr","⤄":"nvHarr","⤅":"Map","⤌":"lbarr","⤍":"rbarr","⤎":"lBarr","⤏":"rBarr","⤐":"RBarr","⤑":"DDotrahd","⤒":"UpArrowBar","⤓":"DownArrowBar","⤖":"Rarrtl","⤙":"latail","⤚":"ratail","⤛":"lAtail","⤜":"rAtail","⤝":"larrfs","⤞":"rarrfs","⤟":"larrbfs","⤠":"rarrbfs","⤣":"nwarhk","⤤":"nearhk","⤥":"searhk","⤦":"swarhk","⤧":"nwnear","⤨":"toea","⤩":"tosa","⤪":"swnwar","⤳":"rarrc","⤳̸":"nrarrc","⤵":"cudarrr","⤶":"ldca","⤷":"rdca","⤸":"cudarrl","⤹":"larrpl","⤼":"curarrm","⤽":"cularrp","⥅":"rarrpl","⥈":"harrcir","⥉":"Uarrocir","⥊":"lurdshar","⥋":"ldrushar","⥎":"LeftRightVector","⥏":"RightUpDownVector","⥐":"DownLeftRightVector","⥑":"LeftUpDownVector","⥒":"LeftVectorBar","⥓":"RightVectorBar","⥔":"RightUpVectorBar","⥕":"RightDownVectorBar","⥖":"DownLeftVectorBar","⥗":"DownRightVectorBar","⥘":"LeftUpVectorBar","⥙":"LeftDownVectorBar","⥚":"LeftTeeVector","⥛":"RightTeeVector","⥜":"RightUpTeeVector","⥝":"RightDownTeeVector","⥞":"DownLeftTeeVector","⥟":"DownRightTeeVector","⥠":"LeftUpTeeVector","⥡":"LeftDownTeeVector","⥢":"lHar","⥣":"uHar","⥤":"rHar","⥥":"dHar","⥦":"luruhar","⥧":"ldrdhar","⥨":"ruluhar","⥩":"rdldhar","⥪":"lharul","⥫":"llhard","⥬":"rharul","⥭":"lrhard","⥮":"udhar","⥯":"duhar","⥰":"RoundImplies","⥱":"erarr","⥲":"simrarr","⥳":"larrsim","⥴":"rarrsim","⥵":"rarrap","⥶":"ltlarr","⥸":"gtrarr","⥹":"subrarr","⥻":"suplarr","⥼":"lfisht","⥽":"rfisht","⥾":"ufisht","⥿":"dfisht","⦚":"vzigzag","⦜":"vangrt","⦝":"angrtvbd","⦤":"ange","⦥":"range","⦦":"dwangle","⦧":"uwangle","⦨":"angmsdaa","⦩":"angmsdab","⦪":"angmsdac","⦫":"angmsdad","⦬":"angmsdae","⦭":"angmsdaf","⦮":"angmsdag","⦯":"angmsdah","⦰":"bemptyv","⦱":"demptyv","⦲":"cemptyv","⦳":"raemptyv","⦴":"laemptyv","⦵":"ohbar","⦶":"omid","⦷":"opar","⦹":"operp","⦻":"olcross","⦼":"odsold","⦾":"olcir","⦿":"ofcir","⧀":"olt","⧁":"ogt","⧂":"cirscir","⧃":"cirE","⧄":"solb","⧅":"bsolb","⧉":"boxbox","⧍":"trisb","⧎":"rtriltri","⧏":"LeftTriangleBar","⧏̸":"NotLeftTriangleBar","⧐":"RightTriangleBar","⧐̸":"NotRightTriangleBar","⧜":"iinfin","⧝":"infintie","⧞":"nvinfin","⧣":"eparsl","⧤":"smeparsl","⧥":"eqvparsl","⧫":"lozf","⧴":"RuleDelayed","⧶":"dsol","⨀":"xodot","⨁":"xoplus","⨂":"xotime","⨄":"xuplus","⨆":"xsqcup","⨍":"fpartint","⨐":"cirfnint","⨑":"awint","⨒":"rppolint","⨓":"scpolint","⨔":"npolint","⨕":"pointint","⨖":"quatint","⨗":"intlarhk","⨢":"pluscir","⨣":"plusacir","⨤":"simplus","⨥":"plusdu","⨦":"plussim","⨧":"plustwo","⨩":"mcomma","⨪":"minusdu","⨭":"loplus","⨮":"roplus","⨯":"Cross","⨰":"timesd","⨱":"timesbar","⨳":"smashp","⨴":"lotimes","⨵":"rotimes","⨶":"otimesas","⨷":"Otimes","⨸":"odiv","⨹":"triplus","⨺":"triminus","⨻":"tritime","⨼":"iprod","⨿":"amalg","⩀":"capdot","⩂":"ncup","⩃":"ncap","⩄":"capand","⩅":"cupor","⩆":"cupcap","⩇":"capcup","⩈":"cupbrcap","⩉":"capbrcup","⩊":"cupcup","⩋":"capcap","⩌":"ccups","⩍":"ccaps","⩐":"ccupssm","⩓":"And","⩔":"Or","⩕":"andand","⩖":"oror","⩗":"orslope","⩘":"andslope","⩚":"andv","⩛":"orv","⩜":"andd","⩝":"ord","⩟":"wedbar","⩦":"sdote","⩪":"simdot","⩭":"congdot","⩭̸":"ncongdot","⩮":"easter","⩯":"apacir","⩰":"apE","⩰̸":"napE","⩱":"eplus","⩲":"pluse","⩳":"Esim","⩷":"eDDot","⩸":"equivDD","⩹":"ltcir","⩺":"gtcir","⩻":"ltquest","⩼":"gtquest","⩽":"les","⩽̸":"nles","⩾":"ges","⩾̸":"nges","⩿":"lesdot","⪀":"gesdot","⪁":"lesdoto","⪂":"gesdoto","⪃":"lesdotor","⪄":"gesdotol","⪅":"lap","⪆":"gap","⪇":"lne","⪈":"gne","⪉":"lnap","⪊":"gnap","⪋":"lEg","⪌":"gEl","⪍":"lsime","⪎":"gsime","⪏":"lsimg","⪐":"gsiml","⪑":"lgE","⪒":"glE","⪓":"lesges","⪔":"gesles","⪕":"els","⪖":"egs","⪗":"elsdot","⪘":"egsdot","⪙":"el","⪚":"eg","⪝":"siml","⪞":"simg","⪟":"simlE","⪠":"simgE","⪡":"LessLess","⪡̸":"NotNestedLessLess","⪢":"GreaterGreater","⪢̸":"NotNestedGreaterGreater","⪤":"glj","⪥":"gla","⪦":"ltcc","⪧":"gtcc","⪨":"lescc","⪩":"gescc","⪪":"smt","⪫":"lat","⪬":"smte","⪬︀":"smtes","⪭":"late","⪭︀":"lates","⪮":"bumpE","⪯":"pre","⪯̸":"npre","⪰":"sce","⪰̸":"nsce","⪳":"prE","⪴":"scE","⪵":"prnE","⪶":"scnE","⪷":"prap","⪸":"scap","⪹":"prnap","⪺":"scnap","⪻":"Pr","⪼":"Sc","⪽":"subdot","⪾":"supdot","⪿":"subplus","⫀":"supplus","⫁":"submult","⫂":"supmult","⫃":"subedot","⫄":"supedot","⫅":"subE","⫅̸":"nsubE","⫆":"supE","⫆̸":"nsupE","⫇":"subsim","⫈":"supsim","⫋︀":"vsubnE","⫋":"subnE","⫌︀":"vsupnE","⫌":"supnE","⫏":"csub","⫐":"csup","⫑":"csube","⫒":"csupe","⫓":"subsup","⫔":"supsub","⫕":"subsub","⫖":"supsup","⫗":"suphsub","⫘":"supdsub","⫙":"forkv","⫚":"topfork","⫛":"mlcp","⫤":"Dashv","⫦":"Vdashl","⫧":"Barv","⫨":"vBar","⫩":"vBarv","⫫":"Vbar","⫬":"Not","⫭":"bNot","⫮":"rnmid","⫯":"cirmid","⫰":"midcir","⫱":"topcir","⫲":"nhpar","⫳":"parsim","⫽":"parsl","⫽⃥":"nparsl","♭":"flat","♮":"natur","♯":"sharp","¤":"curren","¢":"cent",$:"dollar","£":"pound","¥":"yen","€":"euro","¹":"sup1","½":"half","⅓":"frac13","¼":"frac14","⅕":"frac15","⅙":"frac16","⅛":"frac18","²":"sup2","⅔":"frac23","⅖":"frac25","³":"sup3","¾":"frac34","⅗":"frac35","⅜":"frac38","⅘":"frac45","⅚":"frac56","⅝":"frac58","⅞":"frac78","𝒶":"ascr","𝕒":"aopf","𝔞":"afr","𝔸":"Aopf","𝔄":"Afr","𝒜":"Ascr",ª:"ordf",á:"aacute",Á:"Aacute",à:"agrave",À:"Agrave",ă:"abreve",Ă:"Abreve",â:"acirc",Â:"Acirc",å:"aring",Å:"angst",ä:"auml",Ä:"Auml",ã:"atilde",Ã:"Atilde",ą:"aogon",Ą:"Aogon",ā:"amacr",Ā:"Amacr",æ:"aelig",Æ:"AElig","𝒷":"bscr","𝕓":"bopf","𝔟":"bfr","𝔹":"Bopf",ℬ:"Bscr","𝔅":"Bfr","𝔠":"cfr","𝒸":"cscr","𝕔":"copf",ℭ:"Cfr","𝒞":"Cscr",ℂ:"Copf",ć:"cacute",Ć:"Cacute",ĉ:"ccirc",Ĉ:"Ccirc",č:"ccaron",Č:"Ccaron",ċ:"cdot",Ċ:"Cdot",ç:"ccedil",Ç:"Ccedil","℅":"incare","𝔡":"dfr","ⅆ":"dd","𝕕":"dopf","𝒹":"dscr","𝒟":"Dscr","𝔇":"Dfr","ⅅ":"DD","𝔻":"Dopf",ď:"dcaron",Ď:"Dcaron",đ:"dstrok",Đ:"Dstrok",ð:"eth",Ð:"ETH","ⅇ":"ee",ℯ:"escr","𝔢":"efr","𝕖":"eopf",ℰ:"Escr","𝔈":"Efr","𝔼":"Eopf",é:"eacute",É:"Eacute",è:"egrave",È:"Egrave",ê:"ecirc",Ê:"Ecirc",ě:"ecaron",Ě:"Ecaron",ë:"euml",Ë:"Euml",ė:"edot",Ė:"Edot",ę:"eogon",Ę:"Eogon",ē:"emacr",Ē:"Emacr","𝔣":"ffr","𝕗":"fopf","𝒻":"fscr","𝔉":"Ffr","𝔽":"Fopf",ℱ:"Fscr",ff:"fflig",ffi:"ffilig",ffl:"ffllig",fi:"filig",fj:"fjlig",fl:"fllig",ƒ:"fnof",ℊ:"gscr","𝕘":"gopf","𝔤":"gfr","𝒢":"Gscr","𝔾":"Gopf","𝔊":"Gfr",ǵ:"gacute",ğ:"gbreve",Ğ:"Gbreve",ĝ:"gcirc",Ĝ:"Gcirc",ġ:"gdot",Ġ:"Gdot",Ģ:"Gcedil","𝔥":"hfr",ℎ:"planckh","𝒽":"hscr","𝕙":"hopf",ℋ:"Hscr",ℌ:"Hfr",ℍ:"Hopf",ĥ:"hcirc",Ĥ:"Hcirc",ℏ:"hbar",ħ:"hstrok",Ħ:"Hstrok","𝕚":"iopf","𝔦":"ifr","𝒾":"iscr","ⅈ":"ii","𝕀":"Iopf",ℐ:"Iscr",ℑ:"Im",í:"iacute",Í:"Iacute",ì:"igrave",Ì:"Igrave",î:"icirc",Î:"Icirc",ï:"iuml",Ï:"Iuml",ĩ:"itilde",Ĩ:"Itilde",İ:"Idot",į:"iogon",Į:"Iogon",ī:"imacr",Ī:"Imacr",ij:"ijlig",IJ:"IJlig",ı:"imath","𝒿":"jscr","𝕛":"jopf","𝔧":"jfr","𝒥":"Jscr","𝔍":"Jfr","𝕁":"Jopf",ĵ:"jcirc",Ĵ:"Jcirc","ȷ":"jmath","𝕜":"kopf","𝓀":"kscr","𝔨":"kfr","𝒦":"Kscr","𝕂":"Kopf","𝔎":"Kfr",ķ:"kcedil",Ķ:"Kcedil","𝔩":"lfr","𝓁":"lscr",ℓ:"ell","𝕝":"lopf",ℒ:"Lscr","𝔏":"Lfr","𝕃":"Lopf",ĺ:"lacute",Ĺ:"Lacute",ľ:"lcaron",Ľ:"Lcaron",ļ:"lcedil",Ļ:"Lcedil",ł:"lstrok",Ł:"Lstrok",ŀ:"lmidot",Ŀ:"Lmidot","𝔪":"mfr","𝕞":"mopf","𝓂":"mscr","𝔐":"Mfr","𝕄":"Mopf",ℳ:"Mscr","𝔫":"nfr","𝕟":"nopf","𝓃":"nscr",ℕ:"Nopf","𝒩":"Nscr","𝔑":"Nfr",ń:"nacute",Ń:"Nacute",ň:"ncaron",Ň:"Ncaron",ñ:"ntilde",Ñ:"Ntilde",ņ:"ncedil",Ņ:"Ncedil","№":"numero",ŋ:"eng",Ŋ:"ENG","𝕠":"oopf","𝔬":"ofr",ℴ:"oscr","𝒪":"Oscr","𝔒":"Ofr","𝕆":"Oopf",º:"ordm",ó:"oacute",Ó:"Oacute",ò:"ograve",Ò:"Ograve",ô:"ocirc",Ô:"Ocirc",ö:"ouml",Ö:"Ouml",ő:"odblac",Ő:"Odblac",õ:"otilde",Õ:"Otilde",ø:"oslash",Ø:"Oslash",ō:"omacr",Ō:"Omacr",œ:"oelig",Œ:"OElig","𝔭":"pfr","𝓅":"pscr","𝕡":"popf",ℙ:"Popf","𝔓":"Pfr","𝒫":"Pscr","𝕢":"qopf","𝔮":"qfr","𝓆":"qscr","𝒬":"Qscr","𝔔":"Qfr",ℚ:"Qopf",ĸ:"kgreen","𝔯":"rfr","𝕣":"ropf","𝓇":"rscr",ℛ:"Rscr",ℜ:"Re",ℝ:"Ropf",ŕ:"racute",Ŕ:"Racute",ř:"rcaron",Ř:"Rcaron",ŗ:"rcedil",Ŗ:"Rcedil","𝕤":"sopf","𝓈":"sscr","𝔰":"sfr","𝕊":"Sopf","𝔖":"Sfr","𝒮":"Sscr","Ⓢ":"oS",ś:"sacute",Ś:"Sacute",ŝ:"scirc",Ŝ:"Scirc",š:"scaron",Š:"Scaron",ş:"scedil",Ş:"Scedil",ß:"szlig","𝔱":"tfr","𝓉":"tscr","𝕥":"topf","𝒯":"Tscr","𝔗":"Tfr","𝕋":"Topf",ť:"tcaron",Ť:"Tcaron",ţ:"tcedil",Ţ:"Tcedil","™":"trade",ŧ:"tstrok",Ŧ:"Tstrok","𝓊":"uscr","𝕦":"uopf","𝔲":"ufr","𝕌":"Uopf","𝔘":"Ufr","𝒰":"Uscr",ú:"uacute",Ú:"Uacute",ù:"ugrave",Ù:"Ugrave",ŭ:"ubreve",Ŭ:"Ubreve",û:"ucirc",Û:"Ucirc",ů:"uring",Ů:"Uring",ü:"uuml",Ü:"Uuml",ű:"udblac",Ű:"Udblac",ũ:"utilde",Ũ:"Utilde",ų:"uogon",Ų:"Uogon",ū:"umacr",Ū:"Umacr","𝔳":"vfr","𝕧":"vopf","𝓋":"vscr","𝔙":"Vfr","𝕍":"Vopf","𝒱":"Vscr","𝕨":"wopf","𝓌":"wscr","𝔴":"wfr","𝒲":"Wscr","𝕎":"Wopf","𝔚":"Wfr",ŵ:"wcirc",Ŵ:"Wcirc","𝔵":"xfr","𝓍":"xscr","𝕩":"xopf","𝕏":"Xopf","𝔛":"Xfr","𝒳":"Xscr","𝔶":"yfr","𝓎":"yscr","𝕪":"yopf","𝒴":"Yscr","𝔜":"Yfr","𝕐":"Yopf",ý:"yacute",Ý:"Yacute",ŷ:"ycirc",Ŷ:"Ycirc",ÿ:"yuml",Ÿ:"Yuml","𝓏":"zscr","𝔷":"zfr","𝕫":"zopf",ℨ:"Zfr",ℤ:"Zopf","𝒵":"Zscr",ź:"zacute",Ź:"Zacute",ž:"zcaron",Ž:"Zcaron",ż:"zdot",Ż:"Zdot",Ƶ:"imped",þ:"thorn",Þ:"THORN",ʼn:"napos",α:"alpha",Α:"Alpha",β:"beta",Β:"Beta",γ:"gamma",Γ:"Gamma",δ:"delta",Δ:"Delta",ε:"epsi","ϵ":"epsiv",Ε:"Epsilon",ϝ:"gammad",Ϝ:"Gammad",ζ:"zeta",Ζ:"Zeta",η:"eta",Η:"Eta",θ:"theta",ϑ:"thetav",Θ:"Theta",ι:"iota",Ι:"Iota",κ:"kappa",ϰ:"kappav",Κ:"Kappa",λ:"lambda",Λ:"Lambda",μ:"mu",µ:"micro",Μ:"Mu",ν:"nu",Ν:"Nu",ξ:"xi",Ξ:"Xi",ο:"omicron",Ο:"Omicron",π:"pi",ϖ:"piv",Π:"Pi",ρ:"rho",ϱ:"rhov",Ρ:"Rho",σ:"sigma",Σ:"Sigma",ς:"sigmaf",τ:"tau",Τ:"Tau",υ:"upsi",Υ:"Upsilon",ϒ:"Upsi",φ:"phi",ϕ:"phiv",Φ:"Phi",χ:"chi",Χ:"Chi",ψ:"psi",Ψ:"Psi",ω:"omega",Ω:"ohm",а:"acy",А:"Acy",б:"bcy",Б:"Bcy",в:"vcy",В:"Vcy",г:"gcy",Г:"Gcy",ѓ:"gjcy",Ѓ:"GJcy",д:"dcy",Д:"Dcy",ђ:"djcy",Ђ:"DJcy",е:"iecy",Е:"IEcy",ё:"iocy",Ё:"IOcy",є:"jukcy",Є:"Jukcy",ж:"zhcy",Ж:"ZHcy",з:"zcy",З:"Zcy",ѕ:"dscy",Ѕ:"DScy",и:"icy",И:"Icy",і:"iukcy",І:"Iukcy",ї:"yicy",Ї:"YIcy",й:"jcy",Й:"Jcy",ј:"jsercy",Ј:"Jsercy",к:"kcy",К:"Kcy",ќ:"kjcy",Ќ:"KJcy",л:"lcy",Л:"Lcy",љ:"ljcy",Љ:"LJcy",м:"mcy",М:"Mcy",н:"ncy",Н:"Ncy",њ:"njcy",Њ:"NJcy",о:"ocy",О:"Ocy",п:"pcy",П:"Pcy",р:"rcy",Р:"Rcy",с:"scy",С:"Scy",т:"tcy",Т:"Tcy",ћ:"tshcy",Ћ:"TSHcy",у:"ucy",У:"Ucy",ў:"ubrcy",Ў:"Ubrcy",ф:"fcy",Ф:"Fcy",х:"khcy",Х:"KHcy",ц:"tscy",Ц:"TScy",ч:"chcy",Ч:"CHcy",џ:"dzcy",Џ:"DZcy",ш:"shcy",Ш:"SHcy",щ:"shchcy",Щ:"SHCHcy",ъ:"hardcy",Ъ:"HARDcy",ы:"ycy",Ы:"Ycy",ь:"softcy",Ь:"SOFTcy",э:"ecy",Э:"Ecy",ю:"yucy",Ю:"YUcy",я:"yacy",Я:"YAcy",ℵ:"aleph",ℶ:"beth",ℷ:"gimel",ℸ:"daleth"},d=/["&'<>`]/g,f={'"':"&quot;","&":"&amp;","'":"&#x27;","<":"&lt;",">":"&gt;","`":"&#x60;"},p=/&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/,h=/[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,m=/&(CounterClockwiseContourIntegral|DoubleLongLeftRightArrow|ClockwiseContourIntegral|NotNestedGreaterGreater|NotSquareSupersetEqual|DiacriticalDoubleAcute|NotRightTriangleEqual|NotSucceedsSlantEqual|NotPrecedesSlantEqual|CloseCurlyDoubleQuote|NegativeVeryThinSpace|DoubleContourIntegral|FilledVerySmallSquare|CapitalDifferentialD|OpenCurlyDoubleQuote|EmptyVerySmallSquare|NestedGreaterGreater|DoubleLongRightArrow|NotLeftTriangleEqual|NotGreaterSlantEqual|ReverseUpEquilibrium|DoubleLeftRightArrow|NotSquareSubsetEqual|NotDoubleVerticalBar|RightArrowLeftArrow|NotGreaterFullEqual|NotRightTriangleBar|SquareSupersetEqual|DownLeftRightVector|DoubleLongLeftArrow|leftrightsquigarrow|LeftArrowRightArrow|NegativeMediumSpace|blacktriangleright|RightDownVectorBar|PrecedesSlantEqual|RightDoubleBracket|SucceedsSlantEqual|NotLeftTriangleBar|RightTriangleEqual|SquareIntersection|RightDownTeeVector|ReverseEquilibrium|NegativeThickSpace|longleftrightarrow|Longleftrightarrow|LongLeftRightArrow|DownRightTeeVector|DownRightVectorBar|GreaterSlantEqual|SquareSubsetEqual|LeftDownVectorBar|LeftDoubleBracket|VerticalSeparator|rightleftharpoons|NotGreaterGreater|NotSquareSuperset|blacktriangleleft|blacktriangledown|NegativeThinSpace|LeftDownTeeVector|NotLessSlantEqual|leftrightharpoons|DoubleUpDownArrow|DoubleVerticalBar|LeftTriangleEqual|FilledSmallSquare|twoheadrightarrow|NotNestedLessLess|DownLeftTeeVector|DownLeftVectorBar|RightAngleBracket|NotTildeFullEqual|NotReverseElement|RightUpDownVector|DiacriticalTilde|NotSucceedsTilde|circlearrowright|NotPrecedesEqual|rightharpoondown|DoubleRightArrow|NotSucceedsEqual|NonBreakingSpace|NotRightTriangle|LessEqualGreater|RightUpTeeVector|LeftAngleBracket|GreaterFullEqual|DownArrowUpArrow|RightUpVectorBar|twoheadleftarrow|GreaterEqualLess|downharpoonright|RightTriangleBar|ntrianglerighteq|NotSupersetEqual|LeftUpDownVector|DiacriticalAcute|rightrightarrows|vartriangleright|UpArrowDownArrow|DiacriticalGrave|UnderParenthesis|EmptySmallSquare|LeftUpVectorBar|leftrightarrows|DownRightVector|downharpoonleft|trianglerighteq|ShortRightArrow|OverParenthesis|DoubleLeftArrow|DoubleDownArrow|NotSquareSubset|bigtriangledown|ntrianglelefteq|UpperRightArrow|curvearrowright|vartriangleleft|NotLeftTriangle|nleftrightarrow|LowerRightArrow|NotHumpDownHump|NotGreaterTilde|rightthreetimes|LeftUpTeeVector|NotGreaterEqual|straightepsilon|LeftTriangleBar|rightsquigarrow|ContourIntegral|rightleftarrows|CloseCurlyQuote|RightDownVector|LeftRightVector|nLeftrightarrow|leftharpoondown|circlearrowleft|SquareSuperset|OpenCurlyQuote|hookrightarrow|HorizontalLine|DiacriticalDot|NotLessGreater|ntriangleright|DoubleRightTee|InvisibleComma|InvisibleTimes|LowerLeftArrow|DownLeftVector|NotSubsetEqual|curvearrowleft|trianglelefteq|NotVerticalBar|TildeFullEqual|downdownarrows|NotGreaterLess|RightTeeVector|ZeroWidthSpace|looparrowright|LongRightArrow|doublebarwedge|ShortLeftArrow|ShortDownArrow|RightVectorBar|GreaterGreater|ReverseElement|rightharpoonup|LessSlantEqual|leftthreetimes|upharpoonright|rightarrowtail|LeftDownVector|Longrightarrow|NestedLessLess|UpperLeftArrow|nshortparallel|leftleftarrows|leftrightarrow|Leftrightarrow|LeftRightArrow|longrightarrow|upharpoonleft|RightArrowBar|ApplyFunction|LeftTeeVector|leftarrowtail|NotEqualTilde|varsubsetneqq|varsupsetneqq|RightTeeArrow|SucceedsEqual|SucceedsTilde|LeftVectorBar|SupersetEqual|hookleftarrow|DifferentialD|VerticalTilde|VeryThinSpace|blacktriangle|bigtriangleup|LessFullEqual|divideontimes|leftharpoonup|UpEquilibrium|ntriangleleft|RightTriangle|measuredangle|shortparallel|longleftarrow|Longleftarrow|LongLeftArrow|DoubleLeftTee|Poincareplane|PrecedesEqual|triangleright|DoubleUpArrow|RightUpVector|fallingdotseq|looparrowleft|PrecedesTilde|NotTildeEqual|NotTildeTilde|smallsetminus|Proportional|triangleleft|triangledown|UnderBracket|NotHumpEqual|exponentiale|ExponentialE|NotLessTilde|HilbertSpace|RightCeiling|blacklozenge|varsupsetneq|HumpDownHump|GreaterEqual|VerticalLine|LeftTeeArrow|NotLessEqual|DownTeeArrow|LeftTriangle|varsubsetneq|Intersection|NotCongruent|DownArrowBar|LeftUpVector|LeftArrowBar|risingdotseq|GreaterTilde|RoundImplies|SquareSubset|ShortUpArrow|NotSuperset|quaternions|precnapprox|backepsilon|preccurlyeq|OverBracket|blacksquare|MediumSpace|VerticalBar|circledcirc|circleddash|CircleMinus|CircleTimes|LessGreater|curlyeqprec|curlyeqsucc|diamondsuit|UpDownArrow|Updownarrow|RuleDelayed|Rrightarrow|updownarrow|RightVector|nRightarrow|nrightarrow|eqslantless|LeftCeiling|Equilibrium|SmallCircle|expectation|NotSucceeds|thickapprox|GreaterLess|SquareUnion|NotPrecedes|NotLessLess|straightphi|succnapprox|succcurlyeq|SubsetEqual|sqsupseteq|Proportion|Laplacetrf|ImaginaryI|supsetneqq|NotGreater|gtreqqless|NotElement|ThickSpace|TildeEqual|TildeTilde|Fouriertrf|rmoustache|EqualTilde|eqslantgtr|UnderBrace|LeftVector|UpArrowBar|nLeftarrow|nsubseteqq|subsetneqq|nsupseteqq|nleftarrow|succapprox|lessapprox|UpTeeArrow|upuparrows|curlywedge|lesseqqgtr|varepsilon|varnothing|RightFloor|complement|CirclePlus|sqsubseteq|Lleftarrow|circledast|RightArrow|Rightarrow|rightarrow|lmoustache|Bernoullis|precapprox|mapstoleft|mapstodown|longmapsto|dotsquare|downarrow|DoubleDot|nsubseteq|supsetneq|leftarrow|nsupseteq|subsetneq|ThinSpace|ngeqslant|subseteqq|HumpEqual|NotSubset|triangleq|NotCupCap|lesseqgtr|heartsuit|TripleDot|Leftarrow|Coproduct|Congruent|varpropto|complexes|gvertneqq|LeftArrow|LessTilde|supseteqq|MinusPlus|CircleDot|nleqslant|NotExists|gtreqless|nparallel|UnionPlus|LeftFloor|checkmark|CenterDot|centerdot|Mellintrf|gtrapprox|bigotimes|OverBrace|spadesuit|therefore|pitchfork|rationals|PlusMinus|Backslash|Therefore|DownBreve|backsimeq|backprime|DownArrow|nshortmid|Downarrow|lvertneqq|eqvparsl|imagline|imagpart|infintie|integers|Integral|intercal|LessLess|Uarrocir|intlarhk|sqsupset|angmsdaf|sqsubset|llcorner|vartheta|cupbrcap|lnapprox|Superset|SuchThat|succnsim|succneqq|angmsdag|biguplus|curlyvee|trpezium|Succeeds|NotTilde|bigwedge|angmsdah|angrtvbd|triminus|cwconint|fpartint|lrcorner|smeparsl|subseteq|urcorner|lurdshar|laemptyv|DDotrahd|approxeq|ldrushar|awconint|mapstoup|backcong|shortmid|triangle|geqslant|gesdotol|timesbar|circledR|circledS|setminus|multimap|naturals|scpolint|ncongdot|RightTee|boxminus|gnapprox|boxtimes|andslope|thicksim|angmsdaa|varsigma|cirfnint|rtriltri|angmsdab|rppolint|angmsdac|barwedge|drbkarow|clubsuit|thetasym|bsolhsub|capbrcup|dzigrarr|doteqdot|DotEqual|dotminus|UnderBar|NotEqual|realpart|otimesas|ulcorner|hksearow|hkswarow|parallel|PartialD|elinters|emptyset|plusacir|bbrktbrk|angmsdad|pointint|bigoplus|angmsdae|Precedes|bigsqcup|varkappa|notindot|supseteq|precneqq|precnsim|profalar|profline|profsurf|leqslant|lesdotor|raemptyv|subplus|notnivb|notnivc|subrarr|zigrarr|vzigzag|submult|subedot|Element|between|cirscir|larrbfs|larrsim|lotimes|lbrksld|lbrkslu|lozenge|ldrdhar|dbkarow|bigcirc|epsilon|simrarr|simplus|ltquest|Epsilon|luruhar|gtquest|maltese|npolint|eqcolon|npreceq|bigodot|ddagger|gtrless|bnequiv|harrcir|ddotseq|equivDD|backsim|demptyv|nsqsube|nsqsupe|Upsilon|nsubset|upsilon|minusdu|nsucceq|swarrow|nsupset|coloneq|searrow|boxplus|napprox|natural|asympeq|alefsym|congdot|nearrow|bigstar|diamond|supplus|tritime|LeftTee|nvinfin|triplus|NewLine|nvltrie|nvrtrie|nwarrow|nexists|Diamond|ruluhar|Implies|supmult|angzarr|suplarr|suphsub|questeq|because|digamma|Because|olcross|bemptyv|omicron|Omicron|rotimes|NoBreak|intprod|angrtvb|orderof|uwangle|suphsol|lesdoto|orslope|DownTee|realine|cudarrl|rdldhar|OverBar|supedot|lessdot|supdsub|topfork|succsim|rbrkslu|rbrksld|pertenk|cudarrr|isindot|planckh|lessgtr|pluscir|gesdoto|plussim|plustwo|lesssim|cularrp|rarrsim|Cayleys|notinva|notinvb|notinvc|UpArrow|Uparrow|uparrow|NotLess|dwangle|precsim|Product|curarrm|Cconint|dotplus|rarrbfs|ccupssm|Cedilla|cemptyv|notniva|quatint|frac35|frac38|frac45|frac56|frac58|frac78|tridot|xoplus|gacute|gammad|Gammad|lfisht|lfloor|bigcup|sqsupe|gbreve|Gbreve|lharul|sqsube|sqcups|Gcedil|apacir|llhard|lmidot|Lmidot|lmoust|andand|sqcaps|approx|Abreve|spades|circeq|tprime|divide|topcir|Assign|topbot|gesdot|divonx|xuplus|timesd|gesles|atilde|solbar|SOFTcy|loplus|timesb|lowast|lowbar|dlcorn|dlcrop|softcy|dollar|lparlt|thksim|lrhard|Atilde|lsaquo|smashp|bigvee|thinsp|wreath|bkarow|lsquor|lstrok|Lstrok|lthree|ltimes|ltlarr|DotDot|simdot|ltrPar|weierp|xsqcup|angmsd|sigmav|sigmaf|zeetrf|Zcaron|zcaron|mapsto|vsupne|thetav|cirmid|marker|mcomma|Zacute|vsubnE|there4|gtlPar|vsubne|bottom|gtrarr|SHCHcy|shchcy|midast|midcir|middot|minusb|minusd|gtrdot|bowtie|sfrown|mnplus|models|colone|seswar|Colone|mstpos|searhk|gtrsim|nacute|Nacute|boxbox|telrec|hairsp|Tcedil|nbumpe|scnsim|ncaron|Ncaron|ncedil|Ncedil|hamilt|Scedil|nearhk|hardcy|HARDcy|tcedil|Tcaron|commat|nequiv|nesear|tcaron|target|hearts|nexist|varrho|scedil|Scaron|scaron|hellip|Sacute|sacute|hercon|swnwar|compfn|rtimes|rthree|rsquor|rsaquo|zacute|wedgeq|homtht|barvee|barwed|Barwed|rpargt|horbar|conint|swarhk|roplus|nltrie|hslash|hstrok|Hstrok|rmoust|Conint|bprime|hybull|hyphen|iacute|Iacute|supsup|supsub|supsim|varphi|coprod|brvbar|agrave|Supset|supset|igrave|Igrave|notinE|Agrave|iiiint|iinfin|copysr|wedbar|Verbar|vangrt|becaus|incare|verbar|inodot|bullet|drcorn|intcal|drcrop|cularr|vellip|Utilde|bumpeq|cupcap|dstrok|Dstrok|CupCap|cupcup|cupdot|eacute|Eacute|supdot|iquest|easter|ecaron|Ecaron|ecolon|isinsv|utilde|itilde|Itilde|curarr|succeq|Bumpeq|cacute|ulcrop|nparsl|Cacute|nprcue|egrave|Egrave|nrarrc|nrarrw|subsup|subsub|nrtrie|jsercy|nsccue|Jsercy|kappav|kcedil|Kcedil|subsim|ulcorn|nsimeq|egsdot|veebar|kgreen|capand|elsdot|Subset|subset|curren|aacute|lacute|Lacute|emptyv|ntilde|Ntilde|lagran|lambda|Lambda|capcap|Ugrave|langle|subdot|emsp13|numero|emsp14|nvdash|nvDash|nVdash|nVDash|ugrave|ufisht|nvHarr|larrfs|nvlArr|larrhk|larrlp|larrpl|nvrArr|Udblac|nwarhk|larrtl|nwnear|oacute|Oacute|latail|lAtail|sstarf|lbrace|odblac|Odblac|lbrack|udblac|odsold|eparsl|lcaron|Lcaron|ograve|Ograve|lcedil|Lcedil|Aacute|ssmile|ssetmn|squarf|ldquor|capcup|ominus|cylcty|rharul|eqcirc|dagger|rfloor|rfisht|Dagger|daleth|equals|origof|capdot|equest|dcaron|Dcaron|rdquor|oslash|Oslash|otilde|Otilde|otimes|Otimes|urcrop|Ubreve|ubreve|Yacute|Uacute|uacute|Rcedil|rcedil|urcorn|parsim|Rcaron|Vdashl|rcaron|Tstrok|percnt|period|permil|Exists|yacute|rbrack|rbrace|phmmat|ccaron|Ccaron|planck|ccedil|plankv|tstrok|female|plusdo|plusdu|ffilig|plusmn|ffllig|Ccedil|rAtail|dfisht|bernou|ratail|Rarrtl|rarrtl|angsph|rarrpl|rarrlp|rarrhk|xwedge|xotime|forall|ForAll|Vvdash|vsupnE|preceq|bigcap|frac12|frac13|frac14|primes|rarrfs|prnsim|frac15|Square|frac16|square|lesdot|frac18|frac23|propto|prurel|rarrap|rangle|puncsp|frac25|Racute|qprime|racute|lesges|frac34|abreve|AElig|eqsim|utdot|setmn|urtri|Equal|Uring|seArr|uring|searr|dashv|Dashv|mumap|nabla|iogon|Iogon|sdote|sdotb|scsim|napid|napos|equiv|natur|Acirc|dblac|erarr|nbump|iprod|erDot|ucirc|awint|esdot|angrt|ncong|isinE|scnap|Scirc|scirc|ndash|isins|Ubrcy|nearr|neArr|isinv|nedot|ubrcy|acute|Ycirc|iukcy|Iukcy|xutri|nesim|caret|jcirc|Jcirc|caron|twixt|ddarr|sccue|exist|jmath|sbquo|ngeqq|angst|ccaps|lceil|ngsim|UpTee|delta|Delta|rtrif|nharr|nhArr|nhpar|rtrie|jukcy|Jukcy|kappa|rsquo|Kappa|nlarr|nlArr|TSHcy|rrarr|aogon|Aogon|fflig|xrarr|tshcy|ccirc|nleqq|filig|upsih|nless|dharl|nlsim|fjlig|ropar|nltri|dharr|robrk|roarr|fllig|fltns|roang|rnmid|subnE|subne|lAarr|trisb|Ccirc|acirc|ccups|blank|VDash|forkv|Vdash|langd|cedil|blk12|blk14|laquo|strns|diams|notin|vDash|larrb|blk34|block|disin|uplus|vdash|vBarv|aelig|starf|Wedge|check|xrArr|lates|lbarr|lBarr|notni|lbbrk|bcong|frasl|lbrke|frown|vrtri|vprop|vnsup|gamma|Gamma|wedge|xodot|bdquo|srarr|doteq|ldquo|boxdl|boxdL|gcirc|Gcirc|boxDl|boxDL|boxdr|boxdR|boxDr|TRADE|trade|rlhar|boxDR|vnsub|npart|vltri|rlarr|boxhd|boxhD|nprec|gescc|nrarr|nrArr|boxHd|boxHD|boxhu|boxhU|nrtri|boxHu|clubs|boxHU|times|colon|Colon|gimel|xlArr|Tilde|nsime|tilde|nsmid|nspar|THORN|thorn|xlarr|nsube|nsubE|thkap|xhArr|comma|nsucc|boxul|boxuL|nsupe|nsupE|gneqq|gnsim|boxUl|boxUL|grave|boxur|boxuR|boxUr|boxUR|lescc|angle|bepsi|boxvh|varpi|boxvH|numsp|Theta|gsime|gsiml|theta|boxVh|boxVH|boxvl|gtcir|gtdot|boxvL|boxVl|boxVL|crarr|cross|Cross|nvsim|boxvr|nwarr|nwArr|sqsup|dtdot|Uogon|lhard|lharu|dtrif|ocirc|Ocirc|lhblk|duarr|odash|sqsub|Hacek|sqcup|llarr|duhar|oelig|OElig|ofcir|boxvR|uogon|lltri|boxVr|csube|uuarr|ohbar|csupe|ctdot|olarr|olcir|harrw|oline|sqcap|omacr|Omacr|omega|Omega|boxVR|aleph|lneqq|lnsim|loang|loarr|rharu|lobrk|hcirc|operp|oplus|rhard|Hcirc|orarr|Union|order|ecirc|Ecirc|cuepr|szlig|cuesc|breve|reals|eDDot|Breve|hoarr|lopar|utrif|rdquo|Umacr|umacr|efDot|swArr|ultri|alpha|rceil|ovbar|swarr|Wcirc|wcirc|smtes|smile|bsemi|lrarr|aring|parsl|lrhar|bsime|uhblk|lrtri|cupor|Aring|uharr|uharl|slarr|rbrke|bsolb|lsime|rbbrk|RBarr|lsimg|phone|rBarr|rbarr|icirc|lsquo|Icirc|emacr|Emacr|ratio|simne|plusb|simlE|simgE|simeq|pluse|ltcir|ltdot|empty|xharr|xdtri|iexcl|Alpha|ltrie|rarrw|pound|ltrif|xcirc|bumpe|prcue|bumpE|asymp|amacr|cuvee|Sigma|sigma|iiint|udhar|iiota|ijlig|IJlig|supnE|imacr|Imacr|prime|Prime|image|prnap|eogon|Eogon|rarrc|mdash|mDDot|cuwed|imath|supne|imped|Amacr|udarr|prsim|micro|rarrb|cwint|raquo|infin|eplus|range|rangd|Ucirc|radic|minus|amalg|veeeq|rAarr|epsiv|ycirc|quest|sharp|quot|zwnj|Qscr|race|qscr|Qopf|qopf|qint|rang|Rang|Zscr|zscr|Zopf|zopf|rarr|rArr|Rarr|Pscr|pscr|prop|prod|prnE|prec|ZHcy|zhcy|prap|Zeta|zeta|Popf|popf|Zdot|plus|zdot|Yuml|yuml|phiv|YUcy|yucy|Yscr|yscr|perp|Yopf|yopf|part|para|YIcy|Ouml|rcub|yicy|YAcy|rdca|ouml|osol|Oscr|rdsh|yacy|real|oscr|xvee|andd|rect|andv|Xscr|oror|ordm|ordf|xscr|ange|aopf|Aopf|rHar|Xopf|opar|Oopf|xopf|xnis|rhov|oopf|omid|xmap|oint|apid|apos|ogon|ascr|Ascr|odot|odiv|xcup|xcap|ocir|oast|nvlt|nvle|nvgt|nvge|nvap|Wscr|wscr|auml|ntlg|ntgl|nsup|nsub|nsim|Nscr|nscr|nsce|Wopf|ring|npre|wopf|npar|Auml|Barv|bbrk|Nopf|nopf|nmid|nLtv|beta|ropf|Ropf|Beta|beth|nles|rpar|nleq|bnot|bNot|nldr|NJcy|rscr|Rscr|Vscr|vscr|rsqb|njcy|bopf|nisd|Bopf|rtri|Vopf|nGtv|ngtr|vopf|boxh|boxH|boxv|nges|ngeq|boxV|bscr|scap|Bscr|bsim|Vert|vert|bsol|bull|bump|caps|cdot|ncup|scnE|ncap|nbsp|napE|Cdot|cent|sdot|Vbar|nang|vBar|chcy|Mscr|mscr|sect|semi|CHcy|Mopf|mopf|sext|circ|cire|mldr|mlcp|cirE|comp|shcy|SHcy|vArr|varr|cong|copf|Copf|copy|COPY|malt|male|macr|lvnE|cscr|ltri|sime|ltcc|simg|Cscr|siml|csub|Uuml|lsqb|lsim|uuml|csup|Lscr|lscr|utri|smid|lpar|cups|smte|lozf|darr|Lopf|Uscr|solb|lopf|sopf|Sopf|lneq|uscr|spar|dArr|lnap|Darr|dash|Sqrt|LJcy|ljcy|lHar|dHar|Upsi|upsi|diam|lesg|djcy|DJcy|leqq|dopf|Dopf|dscr|Dscr|dscy|ldsh|ldca|squf|DScy|sscr|Sscr|dsol|lcub|late|star|Star|Uopf|Larr|lArr|larr|uopf|dtri|dzcy|sube|subE|Lang|lang|Kscr|kscr|Kopf|kopf|KJcy|kjcy|KHcy|khcy|DZcy|ecir|edot|eDot|Jscr|jscr|succ|Jopf|jopf|Edot|uHar|emsp|ensp|Iuml|iuml|eopf|isin|Iscr|iscr|Eopf|epar|sung|epsi|escr|sup1|sup2|sup3|Iota|iota|supe|supE|Iopf|iopf|IOcy|iocy|Escr|esim|Esim|imof|Uarr|QUOT|uArr|uarr|euml|IEcy|iecy|Idot|Euml|euro|excl|Hscr|hscr|Hopf|hopf|TScy|tscy|Tscr|hbar|tscr|flat|tbrk|fnof|hArr|harr|half|fopf|Fopf|tdot|gvnE|fork|trie|gtcc|fscr|Fscr|gdot|gsim|Gscr|gscr|Gopf|gopf|gneq|Gdot|tosa|gnap|Topf|topf|geqq|toea|GJcy|gjcy|tint|gesl|mid|Sfr|ggg|top|ges|gla|glE|glj|geq|gne|gEl|gel|gnE|Gcy|gcy|gap|Tfr|tfr|Tcy|tcy|Hat|Tau|Ffr|tau|Tab|hfr|Hfr|ffr|Fcy|fcy|icy|Icy|iff|ETH|eth|ifr|Ifr|Eta|eta|int|Int|Sup|sup|ucy|Ucy|Sum|sum|jcy|ENG|ufr|Ufr|eng|Jcy|jfr|els|ell|egs|Efr|efr|Jfr|uml|kcy|Kcy|Ecy|ecy|kfr|Kfr|lap|Sub|sub|lat|lcy|Lcy|leg|Dot|dot|lEg|leq|les|squ|div|die|lfr|Lfr|lgE|Dfr|dfr|Del|deg|Dcy|dcy|lne|lnE|sol|loz|smt|Cup|lrm|cup|lsh|Lsh|sim|shy|map|Map|mcy|Mcy|mfr|Mfr|mho|gfr|Gfr|sfr|cir|Chi|chi|nap|Cfr|vcy|Vcy|cfr|Scy|scy|ncy|Ncy|vee|Vee|Cap|cap|nfr|scE|sce|Nfr|nge|ngE|nGg|vfr|Vfr|ngt|bot|nGt|nis|niv|Rsh|rsh|nle|nlE|bne|Bfr|bfr|nLl|nlt|nLt|Bcy|bcy|not|Not|rlm|wfr|Wfr|npr|nsc|num|ocy|ast|Ocy|ofr|xfr|Xfr|Ofr|ogt|ohm|apE|olt|Rho|ape|rho|Rfr|rfr|ord|REG|ang|reg|orv|And|and|AMP|Rcy|amp|Afr|ycy|Ycy|yen|yfr|Yfr|rcy|par|pcy|Pcy|pfr|Pfr|phi|Phi|afr|Acy|acy|zcy|Zcy|piv|acE|acd|zfr|Zfr|pre|prE|psi|Psi|qfr|Qfr|zwj|Or|ge|Gg|gt|gg|el|oS|lt|Lt|LT|Re|lg|gl|eg|ne|Im|it|le|DD|wp|wr|nu|Nu|dd|lE|Sc|sc|pi|Pi|ee|af|ll|Ll|rx|gE|xi|pm|Xi|ic|pr|Pr|in|ni|mp|mu|ac|Mu|or|ap|Gt|GT|ii);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)(?!;)([=a-zA-Z0-9]?)|&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+)/g,y={aacute:"á",Aacute:"Á",abreve:"ă",Abreve:"Ă",ac:"∾",acd:"∿",acE:"∾̳",acirc:"â",Acirc:"Â",acute:"´",acy:"а",Acy:"А",aelig:"æ",AElig:"Æ",af:"⁡",afr:"𝔞",Afr:"𝔄",agrave:"à",Agrave:"À",alefsym:"ℵ",aleph:"ℵ",alpha:"α",Alpha:"Α",amacr:"ā",Amacr:"Ā",amalg:"⨿",amp:"&",AMP:"&",and:"∧",And:"⩓",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",aogon:"ą",Aogon:"Ą",aopf:"𝕒",Aopf:"𝔸",ap:"≈",apacir:"⩯",ape:"≊",apE:"⩰",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",aring:"å",Aring:"Å",ascr:"𝒶",Ascr:"𝒜",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",Bcy:"Б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",beta:"β",Beta:"Β",beth:"ℶ",between:"≬",bfr:"𝔟",Bfr:"𝔅",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bNot:"⫭",bopf:"𝕓",Bopf:"𝔹",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxhD:"╥",boxHd:"╤",boxHD:"╦",boxhu:"┴",boxhU:"╨",boxHu:"╧",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpe:"≏",bumpE:"⪮",bumpeq:"≏",Bumpeq:"≎",cacute:"ć",Cacute:"Ć",cap:"∩",Cap:"⋒",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",ccaron:"č",Ccaron:"Č",ccedil:"ç",Ccedil:"Ç",ccirc:"ĉ",Ccirc:"Ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",Cdot:"Ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",chcy:"ч",CHcy:"Ч",check:"✓",checkmark:"✓",chi:"χ",Chi:"Χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cire:"≗",cirE:"⧃",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",colone:"≔",Colone:"⩴",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",cscr:"𝒸",Cscr:"𝒞",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",Cup:"⋓",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",dArr:"⇓",Darr:"↡",dash:"‐",dashv:"⊣",Dashv:"⫤",dbkarow:"⤏",dblac:"˝",dcaron:"ď",Dcaron:"Ď",dcy:"д",Dcy:"Д",dd:"ⅆ",DD:"ⅅ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",delta:"δ",Delta:"Δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",Dfr:"𝔇",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",DJcy:"Ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",Dopf:"𝔻",dot:"˙",Dot:"¨",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",downarrow:"↓",Downarrow:"⇓",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"𝒹",Dscr:"𝒟",dscy:"ѕ",DScy:"Ѕ",dsol:"⧶",dstrok:"đ",Dstrok:"Đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",DZcy:"Џ",dzigrarr:"⟿",eacute:"é",Eacute:"É",easter:"⩮",ecaron:"ě",Ecaron:"Ě",ecir:"≖",ecirc:"ê",Ecirc:"Ê",ecolon:"≕",ecy:"э",Ecy:"Э",eDDot:"⩷",edot:"ė",eDot:"≑",Edot:"Ė",ee:"ⅇ",efDot:"≒",efr:"𝔢",Efr:"𝔈",eg:"⪚",egrave:"è",Egrave:"È",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",Emacr:"Ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",eng:"ŋ",ENG:"Ŋ",ensp:" ",eogon:"ę",Eogon:"Ę",eopf:"𝕖",Eopf:"𝔼",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",Epsilon:"Ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",esim:"≂",Esim:"⩳",eta:"η",Eta:"Η",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",fcy:"ф",Fcy:"Ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",Ffr:"𝔉",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",Fopf:"𝔽",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",gamma:"γ",Gamma:"Γ",gammad:"ϝ",Gammad:"Ϝ",gap:"⪆",gbreve:"ğ",Gbreve:"Ğ",Gcedil:"Ģ",gcirc:"ĝ",Gcirc:"Ĝ",gcy:"г",Gcy:"Г",gdot:"ġ",Gdot:"Ġ",ge:"≥",gE:"≧",gel:"⋛",gEl:"⪌",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",Gfr:"𝔊",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",GJcy:"Ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"𝕘",Gopf:"𝔾",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",gscr:"ℊ",Gscr:"𝒢",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",Gt:"≫",GT:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",hardcy:"ъ",HARDcy:"Ъ",harr:"↔",hArr:"⇔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",hcirc:"ĥ",Hcirc:"Ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",hstrok:"ħ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",iacute:"í",Iacute:"Í",ic:"⁣",icirc:"î",Icirc:"Î",icy:"и",Icy:"И",Idot:"İ",iecy:"е",IEcy:"Е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",igrave:"ì",Igrave:"Ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",IJlig:"IJ",Im:"ℑ",imacr:"ī",Imacr:"Ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",Int:"∬",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",iocy:"ё",IOcy:"Ё",iogon:"į",Iogon:"Į",iopf:"𝕚",Iopf:"𝕀",iota:"ι",Iota:"Ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",Itilde:"Ĩ",iukcy:"і",Iukcy:"І",iuml:"ï",Iuml:"Ï",jcirc:"ĵ",Jcirc:"Ĵ",jcy:"й",Jcy:"Й",jfr:"𝔧",Jfr:"𝔍",jmath:"ȷ",jopf:"𝕛",Jopf:"𝕁",jscr:"𝒿",Jscr:"𝒥",jsercy:"ј",Jsercy:"Ј",jukcy:"є",Jukcy:"Є",kappa:"κ",Kappa:"Κ",kappav:"ϰ",kcedil:"ķ",Kcedil:"Ķ",kcy:"к",Kcy:"К",kfr:"𝔨",Kfr:"𝔎",kgreen:"ĸ",khcy:"х",KHcy:"Х",kjcy:"ќ",KJcy:"Ќ",kopf:"𝕜",Kopf:"𝕂",kscr:"𝓀",Kscr:"𝒦",lAarr:"⇚",lacute:"ĺ",Lacute:"Ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",Lambda:"Λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larr:"←",lArr:"⇐",Larr:"↞",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",lAtail:"⤛",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",Lcaron:"Ľ",lcedil:"ļ",Lcedil:"Ļ",lceil:"⌈",lcub:"{",lcy:"л",Lcy:"Л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",leftarrow:"←",Leftarrow:"⇐",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",Leftrightarrow:"⇔",LeftRightArrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",leg:"⋚",lEg:"⪋",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"𝔩",Lfr:"𝔏",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",LJcy:"Љ",ll:"≪",Ll:"⋘",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",lmidot:"ŀ",Lmidot:"Ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",Longleftarrow:"⟸",LongLeftArrow:"⟵",longleftrightarrow:"⟷",Longleftrightarrow:"⟺",LongLeftRightArrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",Longrightarrow:"⟹",LongRightArrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"𝕝",Lopf:"𝕃",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",Lstrok:"Ł",lt:"<",Lt:"≪",LT:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",map:"↦",Map:"⤅",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",Mcy:"М",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",mfr:"𝔪",Mfr:"𝔐",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"𝕞",Mopf:"𝕄",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",mu:"μ",Mu:"Μ",multimap:"⊸",mumap:"⊸",nabla:"∇",nacute:"ń",Nacute:"Ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",Ncaron:"Ň",ncedil:"ņ",Ncedil:"Ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",Ncy:"Н",ndash:"–",ne:"≠",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:`
26
- `,nexist:"∄",nexists:"∄",nfr:"𝔫",Nfr:"𝔑",nge:"≱",ngE:"≧̸",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",ngt:"≯",nGt:"≫⃒",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",NJcy:"Њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nle:"≰",nlE:"≦̸",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nlt:"≮",nLt:"≪⃒",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",not:"¬",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrarr:"↛",nrArr:"⇏",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"𝓃",Nscr:"𝒩",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsube:"⊈",nsubE:"⫅̸",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupe:"⊉",nsupE:"⫆̸",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"ñ",Ntilde:"Ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",Nu:"Ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",oacute:"ó",Oacute:"Ó",oast:"⊛",ocir:"⊚",ocirc:"ô",Ocirc:"Ô",ocy:"о",Ocy:"О",odash:"⊝",odblac:"ő",Odblac:"Ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",OElig:"Œ",ofcir:"⦿",ofr:"𝔬",Ofr:"𝔒",ogon:"˛",ograve:"ò",Ograve:"Ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",Omacr:"Ō",omega:"ω",Omega:"Ω",omicron:"ο",Omicron:"Ο",omid:"⦶",ominus:"⊖",oopf:"𝕠",Oopf:"𝕆",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",or:"∨",Or:"⩔",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",oscr:"ℴ",Oscr:"𝒪",oslash:"ø",Oslash:"Ø",osol:"⊘",otilde:"õ",Otilde:"Õ",otimes:"⊗",Otimes:"⨷",otimesas:"⨶",ouml:"ö",Ouml:"Ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",pcy:"п",Pcy:"П",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"𝔭",Pfr:"𝔓",phi:"φ",Phi:"Φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",Pi:"Π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",pr:"≺",Pr:"⪻",prap:"⪷",prcue:"≼",pre:"⪯",prE:"⪳",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"𝓅",Pscr:"𝒫",psi:"ψ",Psi:"Ψ",puncsp:" ",qfr:"𝔮",Qfr:"𝔔",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",qscr:"𝓆",Qscr:"𝒬",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",racute:"ŕ",Racute:"Ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarr:"→",rArr:"⇒",Rarr:"↠",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",Rarrtl:"⤖",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",Rcaron:"Ř",rcedil:"ŗ",Rcedil:"Ŗ",rceil:"⌉",rcub:"}",rcy:"р",Rcy:"Р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",Rho:"Ρ",rhov:"ϱ",RightAngleBracket:"⟩",rightarrow:"→",Rightarrow:"⇒",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",sacute:"ś",Sacute:"Ś",sbquo:"‚",sc:"≻",Sc:"⪼",scap:"⪸",scaron:"š",Scaron:"Š",sccue:"≽",sce:"⪰",scE:"⪴",scedil:"ş",Scedil:"Ş",scirc:"ŝ",Scirc:"Ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",Scy:"С",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"𝔰",Sfr:"𝔖",sfrown:"⌢",sharp:"♯",shchcy:"щ",SHCHcy:"Щ",shcy:"ш",SHcy:"Ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",sigma:"σ",Sigma:"Σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",SOFTcy:"Ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",Sopf:"𝕊",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",sscr:"𝓈",Sscr:"𝒮",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",Star:"⋆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",sube:"⊆",subE:"⫅",subedot:"⫃",submult:"⫁",subne:"⊊",subnE:"⫋",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup:"⊃",Sup:"⋑",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supe:"⊇",supE:"⫆",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supne:"⊋",supnE:"⫌",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",tau:"τ",Tau:"Τ",tbrk:"⎴",tcaron:"ť",Tcaron:"Ť",tcedil:"ţ",Tcedil:"Ţ",tcy:"т",Tcy:"Т",tdot:"⃛",telrec:"⌕",tfr:"𝔱",Tfr:"𝔗",there4:"∴",therefore:"∴",Therefore:"∴",theta:"θ",Theta:"Θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",thorn:"þ",THORN:"Þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"𝕥",Topf:"𝕋",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",Tscr:"𝒯",tscy:"ц",TScy:"Ц",tshcy:"ћ",TSHcy:"Ћ",tstrok:"ŧ",Tstrok:"Ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uacute:"ú",Uacute:"Ú",uarr:"↑",uArr:"⇑",Uarr:"↟",Uarrocir:"⥉",ubrcy:"ў",Ubrcy:"Ў",ubreve:"ŭ",Ubreve:"Ŭ",ucirc:"û",Ucirc:"Û",ucy:"у",Ucy:"У",udarr:"⇅",udblac:"ű",Udblac:"Ű",udhar:"⥮",ufisht:"⥾",ufr:"𝔲",Ufr:"𝔘",ugrave:"ù",Ugrave:"Ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",Umacr:"Ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",uogon:"ų",Uogon:"Ų",uopf:"𝕦",Uopf:"𝕌",uparrow:"↑",Uparrow:"⇑",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",updownarrow:"↕",Updownarrow:"⇕",UpDownArrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",upsilon:"υ",Upsilon:"Υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",Uring:"Ů",urtri:"◹",uscr:"𝓊",Uscr:"𝒰",utdot:"⋰",utilde:"ũ",Utilde:"Ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"ü",Uuml:"Ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",vcy:"в",Vcy:"В",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",vee:"∨",Vee:"⋁",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",vfr:"𝔳",Vfr:"𝔙",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"𝕧",Vopf:"𝕍",vprop:"∝",vrtri:"⊳",vscr:"𝓋",Vscr:"𝒱",vsubne:"⊊︀",vsubnE:"⫋︀",vsupne:"⊋︀",vsupnE:"⫌︀",Vvdash:"⊪",vzigzag:"⦚",wcirc:"ŵ",Wcirc:"Ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",wfr:"𝔴",Wfr:"𝔚",wopf:"𝕨",Wopf:"𝕎",wp:"℘",wr:"≀",wreath:"≀",wscr:"𝓌",Wscr:"𝒲",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"𝔵",Xfr:"𝔛",xharr:"⟷",xhArr:"⟺",xi:"ξ",Xi:"Ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"𝕩",Xopf:"𝕏",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",xscr:"𝓍",Xscr:"𝒳",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"ý",Yacute:"Ý",yacy:"я",YAcy:"Я",ycirc:"ŷ",Ycirc:"Ŷ",ycy:"ы",Ycy:"Ы",yen:"¥",yfr:"𝔶",Yfr:"𝔜",yicy:"ї",YIcy:"Ї",yopf:"𝕪",Yopf:"𝕐",yscr:"𝓎",Yscr:"𝒴",yucy:"ю",YUcy:"Ю",yuml:"ÿ",Yuml:"Ÿ",zacute:"ź",Zacute:"Ź",zcaron:"ž",Zcaron:"Ž",zcy:"з",Zcy:"З",zdot:"ż",Zdot:"Ż",zeetrf:"ℨ",ZeroWidthSpace:"​",zeta:"ζ",Zeta:"Ζ",zfr:"𝔷",Zfr:"ℨ",zhcy:"ж",ZHcy:"Ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",zscr:"𝓏",Zscr:"𝒵",zwj:"‍",zwnj:"‌"},g={aacute:"á",Aacute:"Á",acirc:"â",Acirc:"Â",acute:"´",aelig:"æ",AElig:"Æ",agrave:"à",Agrave:"À",amp:"&",AMP:"&",aring:"å",Aring:"Å",atilde:"ã",Atilde:"Ã",auml:"ä",Auml:"Ä",brvbar:"¦",ccedil:"ç",Ccedil:"Ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",eacute:"é",Eacute:"É",ecirc:"ê",Ecirc:"Ê",egrave:"è",Egrave:"È",eth:"ð",ETH:"Ð",euml:"ë",Euml:"Ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",iacute:"í",Iacute:"Í",icirc:"î",Icirc:"Î",iexcl:"¡",igrave:"ì",Igrave:"Ì",iquest:"¿",iuml:"ï",Iuml:"Ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",ntilde:"ñ",Ntilde:"Ñ",oacute:"ó",Oacute:"Ó",ocirc:"ô",Ocirc:"Ô",ograve:"ò",Ograve:"Ò",ordf:"ª",ordm:"º",oslash:"ø",Oslash:"Ø",otilde:"õ",Otilde:"Õ",ouml:"ö",Ouml:"Ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",thorn:"þ",THORN:"Þ",times:"×",uacute:"ú",Uacute:"Ú",ucirc:"û",Ucirc:"Û",ugrave:"ù",Ugrave:"Ù",uml:"¨",uuml:"ü",Uuml:"Ü",yacute:"ý",Yacute:"Ý",yen:"¥",yuml:"ÿ"},x={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},k=[1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65e3,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111],w=String.fromCharCode,T={},D=T.hasOwnProperty,M=function(J,pe){return D.call(J,pe)},F=function(J,pe){for(var Q=-1,B=J.length;++Q<B;)if(J[Q]==pe)return!0;return!1},C=function(J,pe){if(!J)return pe;var Q={},B;for(B in pe)Q[B]=M(J,B)?J[B]:pe[B];return Q},U=function(J,pe){var Q="";return J>=55296&&J<=57343||J>1114111?(pe&&W("character reference outside the permissible Unicode range"),"�"):M(x,J)?(pe&&W("disallowed character reference"),x[J]):(pe&&F(k,J)&&W("disallowed character reference"),J>65535&&(J-=65536,Q+=w(J>>>10&1023|55296),J=56320|J&1023),Q+=w(J),Q)},ie=function(J){return"&#x"+J.toString(16).toUpperCase()+";"},I=function(J){return"&#"+J+";"},W=function(J){throw Error("Parse error: "+J)},A=function(J,pe){pe=C(pe,A.options);var Q=pe.strict;Q&&h.test(J)&&W("forbidden code point");var B=pe.encodeEverything,ee=pe.useNamedReferences,Z=pe.allowUnsafeSymbols,re=pe.decimal?I:ie,K=function($){return re($.charCodeAt(0))};return B?(J=J.replace(a,function($){return ee&&M(u,$)?"&"+u[$]+";":K($)}),ee&&(J=J.replace(/&gt;\u20D2/g,"&nvgt;").replace(/&lt;\u20D2/g,"&nvlt;").replace(/&#x66;&#x6A;/g,"&fjlig;")),ee&&(J=J.replace(c,function($){return"&"+u[$]+";"}))):ee?(Z||(J=J.replace(d,function($){return"&"+u[$]+";"})),J=J.replace(/&gt;\u20D2/g,"&nvgt;").replace(/&lt;\u20D2/g,"&nvlt;"),J=J.replace(c,function($){return"&"+u[$]+";"})):Z||(J=J.replace(d,K)),J.replace(s,function($){var E=$.charCodeAt(0),H=$.charCodeAt(1),q=(E-55296)*1024+H-56320+65536;return re(q)}).replace(l,K)};A.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1,decimal:!1};var G=function(J,pe){pe=C(pe,G.options);var Q=pe.strict;return Q&&p.test(J)&&W("malformed character reference"),J.replace(m,function(B,ee,Z,re,K,$,E,H,q){var N,R,le,S,oe,te;return ee?(oe=ee,y[oe]):Z?(oe=Z,te=re,te&&pe.isAttributeValue?(Q&&te=="="&&W("`&` did not start a character reference"),B):(Q&&W("named character reference was not terminated by a semicolon"),g[oe]+(te||""))):K?(le=K,R=$,Q&&!R&&W("character reference was not terminated by a semicolon"),N=parseInt(le,10),U(N,Q)):E?(S=E,R=H,Q&&!R&&W("character reference was not terminated by a semicolon"),N=parseInt(S,16),U(N,Q)):(Q&&W("named character reference was not terminated by a semicolon"),B)})};G.options={isAttributeValue:!1,strict:!1};var ae=function(J){return J.replace(d,function(pe){return f[pe]})},X={version:"1.2.0",encode:A,decode:G,escape:ae,unescape:G};if(r&&!r.nodeType)if(o)o.exports=X;else for(var de in X)M(X,de)&&(r[de]=X[de]);else n.he=X})(zt)})(Ma,Ma.exports);var rC=Ma.exports;const oC=ml(rC);function kt(t){this.content=t}kt.prototype={constructor:kt,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,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),i=r.content.slice();return o==-1?i.push(n||t,e):(i[o+1]=e,n&&(i[o]=n)),new kt(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new kt(n)},addToStart:function(t,e){return new kt([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new kt(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),i=r.find(t);return o.splice(i==-1?o.length:i,0,e,n),new kt(o)},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=kt.from(t),t.size?new kt(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=kt.from(t),t.size?new kt(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=kt.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};kt.from=function(t){if(t instanceof kt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new kt(e)};function X0(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o==i){n+=o.nodeSize;continue}if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)n++;return n}if(o.content.size||i.content.size){let s=X0(o.content,i.content,n+1);if(s!=null)return s}n+=o.nodeSize}}function J0(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:n,b:r};let s=t.child(--o),a=e.child(--i),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};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++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let c=J0(s.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}let be=class Rt{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,o=0,i){for(let s=0,a=0;a<n;s++){let l=this.content[s],c=a+l.nodeSize;if(c>e&&r(l,o+a,i||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,o+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let i="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?o?typeof o=="function"?o(a):o:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)o.push(e.content[i]);return new Rt(o,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],o=0;if(n>e)for(let i=0,s=0;s<n;i++){let a=this.content[i],l=s+a.nodeSize;l>e&&((s<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),o+=a.nodeSize),s=l}return new Rt(r,o)}cutByIndex(e,n){return e==n?Rt.empty:e==0&&n==this.content.length?this:new Rt(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new Rt(o,i)}addToStart(e){return new Rt([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Rt(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))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 n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];e(o,r,n),r+=o.nodeSize}}findDiffStart(e,n=0){return X0(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return J0(this,e,n,r)}findIndex(e,n=-1){if(e==0)return Rs(0,e);if(e==this.size)return Rs(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,o=0;;r++){let i=this.child(r),s=o+i.nodeSize;if(s>=e)return s==e||n>0?Rs(r+1,s):Rs(r,o);o=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,n){if(!n)return Rt.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Rt(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Rt.empty;let n,r=0;for(let o=0;o<e.length;o++){let i=e[o];r+=i.nodeSize,o&&i.isText&&e[o-1].sameMarkup(i)?(n||(n=e.slice(0,o)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new Rt(n||e,r)}static from(e){if(!e)return Rt.empty;if(e instanceof Rt)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Rt([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};be.empty=new be([],0);const Fc={index:0,offset:0};function Rs(t,e){return Fc.index=t,Fc.offset=e,Fc}function _a(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!_a(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!_a(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let Ge=class Pu{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let o=0;o<e.length;o++){let i=e[o];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,o));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&_a(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let o=r.create(n.attrs);return r.checkAttrs(o.attrs),o}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Pu.none;if(e instanceof Pu)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};Ge.none=[];let Na=class extends Error{},ve=class To{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Z0(this.content,e+this.openStart,n);return r&&new To(r,this.openStart,this.openEnd)}removeBetween(e,n){return new To(Y0(this.content,e+this.openStart,n+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,n){if(!n)return To.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new To(be.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)o++;return new To(e,r,o)}};ve.empty=new ve(be.empty,0,0);function Y0(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(o==e||i.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(Y0(i.content,e-o-1,n-o-1)))}function Z0(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let a=Z0(s.content,e-i-1,n);return a&&t.replaceChild(o,s.copy(a))}function iC(t,e,n){if(n.openStart>t.depth)throw new Na("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Na("Inconsistent open depths");return Q0(t,e,n,0)}function Q0(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let s=Q0(t,e,n,r+1);return i.copy(i.content.replaceChild(o,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,a=s.content;return Xr(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=sC(n,t);return Xr(i,tw(t,s,a,e,r))}else return Xr(i,Ia(t,e,r))}function ew(t,e){if(!e.type.compatibleContent(t.type))throw new Na("Cannot join "+e.type.name+" onto "+t.type.name)}function zu(t,e,n){let r=t.node(n);return ew(r,e.node(n)),r}function Kr(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Pi(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(Kr(t.nodeAfter,r),i++));for(let a=i;a<s;a++)Kr(o.child(a),r);e&&e.depth==n&&e.textOffset&&Kr(e.nodeBefore,r)}function Xr(t,e){return t.type.checkContent(e),t.copy(e)}function tw(t,e,n,r,o){let i=t.depth>o&&zu(t,e,o+1),s=r.depth>o&&zu(n,r,o+1),a=[];return Pi(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(ew(i,s),Kr(Xr(i,tw(t,e,n,r,o+1)),a)):(i&&Kr(Xr(i,Ia(t,e,o+1)),a),Pi(e,n,o,a),s&&Kr(Xr(s,Ia(n,r,o+1)),a)),Pi(r,null,o,a),new be(a)}function Ia(t,e,n){let r=[];if(Pi(null,t,n,r),t.depth>n){let o=zu(t,e,n+1);Kr(Xr(o,Ia(t,e,n+1)),r)}return Pi(e,null,n,r),new be(r)}function sC(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)r=e.node(o).copy(be.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}let Em=class ju{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.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,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)o+=r.child(i).nodeSize;return o}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return Ge.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let a=r;r=o,o=a}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!o||!i[s].isInSet(o.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!o||!r[i].isInSet(o.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Fa(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,i=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(i),c=i-l;if(r.push(s,a,o+l),!c||(s=s.child(a),s.isText))break;i=c-1,o+=l+1}return new ju(n,r,i)}static resolveCached(e,n){let r=Am.get(e);if(r)for(let i=0;i<r.elts.length;i++){let s=r.elts[i];if(s.pos==n)return s}else Am.set(e,r=new aC);let o=r.elts[r.i]=ju.resolve(e,n);return r.i=(r.i+1)%lC,o}},aC=class{constructor(){this.elts=[],this.i=0}};const lC=12,Am=new WeakMap;let Fa=class{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}};const cC=Object.create(null);let Jr=class qu{constructor(e,n,r,o=Ge.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||be.empty}get children(){return this.content.content}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,n,r,o=0){this.content.nodesBetween(e,n,r,o,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,n,r,o){return this.content.textBetween(e,n,r,o)}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,n,r){return this.type==e&&_a(this.attrs,n||e.defaultAttrs||cC)&&Ge.sameSet(this.marks,r||Ge.none)}copy(e=null){return e==this.content?this:new qu(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new qu(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return ve.empty;let o=this.resolve(e),i=this.resolve(n),s=r?0:o.sharedDepth(n),a=o.start(s),l=o.node(s).content.cut(o.pos-a,i.pos-a);return new ve(l,o.depth-s,i.depth-s)}replace(e,n,r){return iC(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(o==e||n.isText)return n;e-=o+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(e){return Em.resolveCached(this,e)}resolveNoCache(e){return Em.resolve(this,e)}rangeHasMark(e,n,r){let o=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}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()+")"),nw(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=be.empty,o=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=o;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,n);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=Ge.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Ge.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n 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(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let o=be.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,o,r);return i.type.checkAttrs(i.attrs),i}};Jr.prototype.text=void 0;let uC=class Vu extends Jr{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):nw(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Vu(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Vu(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function nw(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}let Qi=class rw{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new dC(e,n);if(r.next==null)return rw.empty;let o=ow(r);r.next&&r.err("Unexpected trailing text");let i=bC(yC(o));return wC(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let o=this;for(let i=n;o&&i<r;i++)o=o.matchType(e.child(i).type);return o}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:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let o=[this];function i(s,a){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return be.from(a.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:u,next:d}=s.next[c];if(!(u.isText||u.hasRequiredAttrs())&&o.indexOf(d)==-1){o.push(d);let f=i(d,a.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),i=o.match;if(i.matchType(e)){let s=[];for(let a=o;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:a,next:l}=i.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!o.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:o}),n[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 n(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),e.map((r,o)=>{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return i}).join(`
27
- `)}};Qi.empty=new Qi(!0);let dC=class{constructor(e,n){this.string=e,this.nodeTypes=n,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 ow(t){let e=[];do e.push(fC(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function fC(t){let e=[];do e.push(pC(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function pC(t){let e=gC(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=hC(t,e);else break;return e}function $m(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function hC(t,e){let n=$m(t),r=n;return t.eat(",")&&(t.next!="}"?r=$m(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function mC(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let i in n){let s=n[i];s.isInGroup(e)&&o.push(s)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function gC(t){if(t.eat("(")){let e=ow(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=mC(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function yC(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let c={term:l,to:a};return e[s].push(c),c}function o(s,a){s.forEach(l=>l.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(i(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=i(s.exprs[l],a);if(l==s.exprs.length-1)return c;o(c,a=n())}else if(s.type=="star"){let l=n();return r(a,l),o(i(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return o(i(s.expr,a),l),o(i(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(i(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c<s.min;c++){let u=n();o(i(s.expr,l),u),l=u}if(s.max==-1)o(i(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let u=n();r(l,u),o(i(s.expr,l),u),l=u}return[r(l)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function iw(t,e){return e-t}function Tm(t,e){let n=[];return r(e),n.sort(iw);function r(o){let i=t[o];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(o);for(let s=0;s<i.length;s++){let{term:a,to:l}=i[s];!a&&n.indexOf(l)==-1&&r(l)}}}function bC(t){let e=Object.create(null);return n(Tm(t,0));function n(r){let o=[];r.forEach(s=>{t[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<o.length;u++)o[u][0]==a&&(c=o[u][1]);Tm(t,l).forEach(u=>{c||o.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new Qi(r.indexOf(t.length-1)>-1);for(let s=0;s<o.length;s++){let a=o[s][1].sort(iw);i.next.push({type:o[s][0],next:e[a.join(",")]||n(a)})}return i}}function wC(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],i=!o.validEnd,s=[];for(let a=0;a<o.next.length;a++){let{type:l,next:c}=o.next[a];s.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function sw(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function aw(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let i=t[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function lw(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${o}`);for(let o in t){let i=t[o];i.validate&&i.validate(e[o])}}function cw(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new xC(t,r,e[r]);return n}let Om=class uw{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=cw(e,r.attrs),this.defaultAttrs=sw(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Qi.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}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:aw(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Jr(this,this.computeAttrs(e),be.from(n),Ge.setFrom(r))}createChecked(e=null,n,r){return n=be.from(n),this.checkContent(n),new Jr(this,this.computeAttrs(e),n,Ge.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=be.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let o=this.contentMatch.matchFragment(n),i=o&&o.fillBefore(be.empty,!0);return i?new Jr(this,e,n.append(i),Ge.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){lw(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 n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:Ge.none:e}static compile(e,n){let r=Object.create(null);e.forEach((i,s)=>r[i]=new uw(i,n,s));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function vC(t,e,n){let r=n.split("|");return o=>{let i=o===null?"null":typeof o;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}let xC=class{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?vC(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}},dw=class fw{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=cw(e,o.attrs),this.excluded=null;let i=sw(this.attrs);this.instance=i?new Ge(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Ge(this,aw(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((i,s)=>r[i]=new fw(i,o++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){lw(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},pw=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=kt.from(e.nodes),n.marks=kt.from(e.marks||{}),this.nodes=Om.compile(this.spec.nodes,this),this.marks=dw.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;if(i.contentMatch=r[s]||(r[s]=Qi.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=a=="_"?null:a?Dm(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:Dm(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,n=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Om){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(n,r,o)}text(e,n){let r=this.nodes.text;return new uC(r,r.defaultAttrs,e,Ge.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return Jr.fromJSON(this,e)}markFromJSON(e){return Ge.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};function Dm(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],i=t.marks[o],s=i;if(i)n.push(i);else for(let a in t.marks){let l=t.marks[a];(o=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function kC(t){return t.tag!=null}function SC(t){return t.style!=null}let Yr=class Uu{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(kC(o))this.tags.push(o);else if(SC(o)){let i=/[^=]*/.exec(o.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let i=e.nodes[o.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new _m(this,n,!1);return r.addAll(e,Ge.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new _m(this,n,!0);return r.addAll(e,Ge.none,n.from,n.to),ve.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let i=this.tags[o];if(AC(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(e);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(e,n,r,o){for(let i=o?this.styles.indexOf(o)+1:0;i<this.styles.length;i++){let s=this.styles[i],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(o){let i=o.priority==null?50:o.priority,s=0;for(;s<n.length;s++){let a=n[s];if((a.priority==null?50:a.priority)<i)break}n.splice(s,0,o)}for(let o in e.marks){let i=e.marks[o].spec.parseDOM;i&&i.forEach(s=>{r(s=Nm(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in e.nodes){let i=e.nodes[o].spec.parseDOM;i&&i.forEach(s=>{r(s=Nm(s)),s.node||s.ignore||s.mark||(s.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Uu(e,Uu.schemaRules(e)))}};const hw={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},CC={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},mw={ol:!0,ul:!0},es=1,Hu=2,ua=4;function Mm(t,e,n){return e!=null?(e?es:0)|(e==="full"?Hu:0):t&&t.whitespace=="pre"?es|Hu:n&-5}let Ls=class{constructor(e,n,r,o,i,s){this.type=e,this.attrs=n,this.marks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=Ge.none,this.match=i||(s&ua?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(be.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&es)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let n=be.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(be.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!hw.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},_m=class{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let o=n.topNode,i,s=Mm(null,n.preserveWhitespace,0)|(r?ua:0);o?i=new Ls(o.type,o.attrs,Ge.none,!0,n.topMatch||o.type.contentMatch,s):r?i=new Ls(null,null,Ge.none,!0,null,s):i=new Ls(e.schema.topNodeType,null,Ge.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,o=this.top,i=o.options&Hu?"full":this.localPreserveWS||(o.options&es)>0;if(i==="full"||o.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)i!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
28
- `);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=o.content[o.content.length-1],a=e.previousSibling;(!s||a&&a.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let o=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),a;mw.hasOwnProperty(s)&&this.parser.normalizeLists&&EC(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:CC.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,u=this.needsBlock;if(hw.hasOwnProperty(s))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let d=l&&l.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),c&&this.sync(i),this.needsBlock=u}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=o}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
29
- `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let i=this.parser.matchedStyles[o],s=r.getPropertyValue(i);if(s)for(let a=void 0;;){let l=this.parser.matchStyle(i,s,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,o){let i,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r)||this.leafFallback(e,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(i=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}i&&this.sync(a)&&this.open--}addAll(e,n,r,o){let i=r||0;for(let s=r?e.childNodes[r]:e.firstChild,a=o==null?null:e.childNodes[o];s!=a;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s,n);this.findAtPoint(e,i)}findPlace(e,n){let r,o;for(let i=this.open;i>=0;i--){let s=this.nodes[i],a=s.findWrapping(e);if(a&&(!r||r.length>a.length)&&(r=a,o=s,!a.length)||s.solid)break}if(!r)return null;this.sync(o);for(let i=0;i<r.length;i++)n=this.enterInner(r[i],null,n,!1);return n}insertNode(e,n){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(n=this.enterInner(o,null,n))}let r=this.findPlace(e,n);if(r){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let i=Ge.none;for(let s of r.concat(e.marks))(o.type?o.type.allowsMarkType(s.type):Im(s.type,e.type))&&(i=s.addToSet(i));return o.content.push(e.mark(i)),!0}return!1}enter(e,n,r,o){let i=this.findPlace(e.create(n),r);return i&&(i=this.enterInner(e,n,r,!0,o)),i}enterInner(e,n,r,o=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let a=Mm(e,i,s.options);s.options&ua&&s.content.length==0&&(a|=ua);let l=Ge.none;return r=r.filter(c=>(s.type?s.type.allowsMarkType(c.type):Im(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new Ls(e,n,l,o,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].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 n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=es)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=i;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&o?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}};function EC(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&mw.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function AC(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Nm(t){let e={};for(let n in t)e[n]=t[n];return e}function Im(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=a=>{i.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==e||i.indexOf(u)<0&&s(u))return!0}};if(s(o.contentMatch))return!0}}let si=class gw{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Bc(n).createDocumentFragment());let o=r,i=[];return e.forEach(s=>{if(i.length||s.marks.length){let a=0,l=0;for(;a<i.length&&l<s.marks.length;){let c=s.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(i[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<i.length;)o=i.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],u=this.serializeMark(c,s.isInline,n);u&&(i.push([c,o]),o.appendChild(u.dom),o=u.contentDOM||u.dom)}}o.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:o}=da(Bc(n),this.nodes[e.type.name](e),null,e.attrs);if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,o)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let o=e.marks.length-1;o>=0;o--){let i=this.serializeMark(e.marks[o],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&da(Bc(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return da(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new gw(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Fm(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Fm(e.marks)}};function Fm(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Bc(t){return t.document||window.document}const Bm=new WeakMap;function $C(t){let e=Bm.get(t);return e===void 0&&Bm.set(t,e=TC(t)),e}function TC(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let o=0;o<r.length;o++)n(r[o]);else for(let o in r)n(r[o])}return n(t),e}function da(t,e,n,r){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 o=e[0],i;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=$C(r))&&i.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=o.indexOf(" ");s>0&&(n=o.slice(0,s),o=o.slice(s+1));let a,l=n?t.createElementNS(n,o):t.createElement(o),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?l.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):l.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:p,contentDOM:h}=da(t,f,n,r);if(l.appendChild(p),h){if(a)throw new RangeError("Multiple content holes");a=h}}}return{dom:l,contentDOM:a}}const yw=65535,bw=Math.pow(2,16);function OC(t,e){return t+e*bw}function Rm(t){return t&yw}function DC(t){return(t-(t&yw))/bw}const ww=1,vw=2,fa=4,xw=8;let Wu=class{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&xw)>0}get deletedBefore(){return(this.delInfo&(ww|fa))>0}get deletedAfter(){return(this.delInfo&(vw|fa))>0}get deletedAcross(){return(this.delInfo&fa)>0}};class Qt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Qt.empty)return Qt.empty}recover(e){let n=0,r=Rm(e);if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+DC(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let o=0,i=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?o:0);if(l>e)break;let c=this.ranges[a+i],u=this.ranges[a+s],d=l+c;if(e<=d){let f=c?e==l?-1:e==d?1:n:n,p=l+o+(f<0?0:u);if(r)return p;let h=e==(n<0?l:d)?null:OC(a/3,e-l),m=e==l?vw:e==d?ww:fa;return(n<0?e!=l:e!=d)&&(m|=xw),new Wu(p,m,h)}o+=u-c}return r?e+o:new Wu(e+o,0,null)}touches(e,n){let r=0,o=Rm(n),i=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?r:0);if(l>e)break;let c=this.ranges[a+i],u=l+c;if(e<=u&&a==o*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o<this.ranges.length;o+=3){let s=this.ranges[o],a=s-(this.inverted?i:0),l=s+(this.inverted?0:i),c=this.ranges[o+n],u=this.ranges[o+r];e(a,a+c,l,l+u),i+=u-c}}invert(){return new Qt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Qt.empty:new Qt(e<0?[0,-e,0]:[0,0,e])}}Qt.empty=new Qt([]);let Ho=class Gu{constructor(e,n,r=0,o=e?e.length:0){this.mirror=n,this.from=r,this.to=o,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new Gu(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let o=e.getMirror(n);this.appendMap(e._maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let o=e.getMirror(n);this.appendMap(e._maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new Gu;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let o=0;for(let i=this.from;i<this.to;i++){let s=this._maps[i],a=s.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,e=this._maps[l].recover(a.recover);continue}}o|=a.delInfo,e=a.pos}return r?e:new Wu(e,o,null)}};const Rc=Object.create(null);let Bt=class{getMap(){return Qt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Rc[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Rc)throw new RangeError("Duplicate use of step JSON ID "+e);return Rc[e]=n,n.prototype.jsonID=e,n}},jt=class xi{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new xi(e,null)}static fail(e){return new xi(null,e)}static fromReplace(e,n,r,o){try{return xi.ok(e.replace(n,r,o))}catch(i){if(i instanceof Na)return xi.fail(i.message);throw i}}};function wf(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(wf(i.content,e,i))),i.isInline&&(i=e(i,n,o)),r.push(i)}return be.fromArray(r)}let Ss=class ki extends Bt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new ve(wf(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),n.openStart,n.openEnd);return jt.fromReplace(e,this.from,this.to,i)}invert(){return new gn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new ki(n.pos,r.pos,this.mark)}merge(e){return e instanceof ki&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ki(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ki(n.from,n.to,e.markFromJSON(n.mark))}};Bt.jsonID("addMark",Ss);let gn=class Si extends Bt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new ve(wf(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return jt.fromReplace(e,this.from,this.to,r)}invert(){return new Ss(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Si(n.pos,r.pos,this.mark)}merge(e){return e instanceof Si&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Si(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Si(n.from,n.to,e.markFromJSON(n.mark))}};Bt.jsonID("removeMark",gn);let vf=class Ci extends Bt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return jt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return jt.fromReplace(e,this.pos,this.pos+1,new ve(be.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new Ci(this.pos,n.marks[o]);return new Ci(this.pos,this.mark)}}return new xf(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Ci(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Ci(n.pos,e.markFromJSON(n.mark))}};Bt.jsonID("addNodeMark",vf);let xf=class Ku extends Bt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return jt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return jt.fromReplace(e,this.pos,this.pos+1,new ve(be.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new vf(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Ku(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ku(n.pos,e.markFromJSON(n.mark))}};Bt.jsonID("removeNodeMark",xf);let $t=class Rr extends Bt{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&Xu(e,this.from,this.to)?jt.fail("Structure replace would overwrite content"):jt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Qt([this.from,this.to-this.from,this.slice.size])}invert(e){return new Rr(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Rr(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Rr)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?ve.empty:new ve(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Rr(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?ve.empty:new ve(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Rr(e.from,this.to,n,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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Rr(n.from,n.to,ve.fromJSON(e,n.slice),!!n.structure)}};Bt.jsonID("replace",$t);let Jt=class pa extends Bt{constructor(e,n,r,o,i,s,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=a}apply(e){if(this.structure&&(Xu(e,this.from,this.gapFrom)||Xu(e,this.gapTo,this.to)))return jt.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return jt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?jt.fromReplace(e,this.from,this.to,r):jt.fail("Content does not fit in gap")}getMap(){return new Qt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new pa(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||i>r.pos?null:new pa(n.pos,r.pos,o,i,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,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new pa(n.from,n.to,n.gapFrom,n.gapTo,ve.fromJSON(e,n.slice),n.insert,!!n.structure)}};Bt.jsonID("replaceAround",Jt);function Xu(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function MC(t,e,n,r){let o=[],i=[],s,a;t.doc.nodesBetween(e,n,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),p=Math.min(c+l.nodeSize,n),h=r.addToSet(d);for(let m=0;m<d.length;m++)d[m].isInSet(h)||(s&&s.to==f&&s.mark.eq(d[m])?s.to=p:o.push(s=new gn(f,p,d[m])));a&&a.to==f?a.to=p:i.push(a=new Ss(f,p,r))}}),o.forEach(l=>t.step(l)),i.forEach(l=>t.step(l))}function _C(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(r instanceof dw){let c=s.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,n);for(let u=0;u<l.length;u++){let d=l[u],f;for(let p=0;p<o.length;p++){let h=o[p];h.step==i-1&&d.eq(o[p].style)&&(f=h)}f?(f.to=c,f.step=i):o.push({style:d,from:Math.max(a,e),to:c,step:i})}}}),o.forEach(s=>t.step(new gn(s.from,s.to,s.style)))}function kf(t,e,n,r=n.contentMatch,o=!0){let i=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l<i.childCount;l++){let c=i.child(l),u=a+c.nodeSize,d=r.matchType(c.type);if(!d)s.push(new $t(a,u,ve.empty));else{r=d;for(let f=0;f<c.marks.length;f++)n.allowsMarkType(c.marks[f].type)||t.step(new gn(a,u,c.marks[f]));if(o&&c.isText&&n.whitespace!="pre"){let f,p=/\r?\n|\r/g,h;for(;f=p.exec(c.text);)h||(h=new ve(be.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),s.push(new $t(a+f.index,a+f.index+f[0].length,h))}}a=u}if(!r.validEnd){let l=r.fillBefore(be.empty,!0);t.replace(a,a,new ve(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}function NC(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Cs(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let r=t.$from.node(n),o=t.$from.index(n),i=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(o,i,e))return n;if(n==0||r.type.spec.isolating||!NC(r,o,i))break}return null}function IC(t,e,n){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),a=o.after(i+1),l=s,c=a,u=be.empty,d=0;for(let h=i,m=!1;h>n;h--)m||r.index(h)>0?(m=!0,u=be.from(r.node(h).copy(u)),d++):l--;let f=be.empty,p=0;for(let h=i,m=!1;h>n;h--)m||o.after(h+1)<o.end(h)?(m=!0,f=be.from(o.node(h).copy(f)),p++):c++;t.step(new Jt(l,c,s,a,new ve(u.append(f),d,p),u.size-d,!0))}function kw(t,e,n=null,r=t){let o=FC(t,e),i=o&&BC(r,e);return i?o.map(Lm).concat({type:e,attrs:n}).concat(i.map(Lm)):null}function Lm(t){return{type:t,attrs:null}}function FC(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,o,s)?i:null}function BC(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let a=(s.length?s[s.length-1]:e).contentMatch;for(let l=r;a&&l<o;l++)a=a.matchType(n.child(l).type);return!a||!a.validEnd?null:s}function RC(t,e,n){let r=be.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=be.from(n[s].type.create(n[s].attrs,r))}let o=e.start,i=e.end;t.step(new Jt(o,i,o,i,new ve(r,0,0),n.length,!0))}function LC(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{let l=typeof o=="function"?o(s):o;if(s.isTextblock&&!s.hasMarkup(r,l)&&PC(t.doc,t.mapping.slice(i).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",h=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!h?c=!1:!p&&h&&(c=!0)}c===!1&&Cw(t,s,a,i),kf(t,t.mapping.slice(i).map(a,1),r,void 0,c===null);let u=t.mapping.slice(i),d=u.map(a,1),f=u.map(a+s.nodeSize,1);return t.step(new Jt(d,f,d+1,f-1,new ve(be.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&Sw(t,s,a,i),!1}})}function Sw(t,e,n,r){e.forEach((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(o.text);){let l=t.mapping.slice(r).map(n+1+i+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function Cw(t,e,n,r){e.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+i);t.replaceWith(s,s+1,e.type.schema.text(`
30
- `))}})}function PC(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function zC(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Jt(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new ve(be.from(s),0,0),1,!0))}function Zn(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=n-2;c>i;c--,u--){let d=o.node(c),f=o.index(c);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),h=r&&r[u+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let m=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(p))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function jC(t,e,n=1,r){let o=t.doc.resolve(e),i=be.empty,s=be.empty;for(let a=o.depth,l=o.depth-n,c=n-1;a>l;a--,c--){i=be.from(o.node(a).copy(i));let u=r&&r[c];s=be.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}t.step(new $t(e,e,new ve(i.append(s),n,n),!0))}function _r(t,e){let n=t.resolve(e),r=n.index();return Ew(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function qC(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o<e.childCount;o++){let i=e.child(o),s=i.type==r?t.type.schema.nodes.text:i.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(i.marks))return!1}return n.validEnd}function Ew(t,e){return!!(t&&e&&!t.isLeaf&&qC(t,e))}function Aw(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let i,s,a=r.index(o);if(o==r.depth?(i=r.nodeBefore,s=r.nodeAfter):n>0?(i=r.node(o+1),a++,s=r.node(o).maybeChild(a)):(i=r.node(o).maybeChild(a-1),s=r.node(o+1)),i&&!i.isTextblock&&Ew(i,s)&&r.node(o).canReplace(a,a+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function VC(t,e,n){let r=null,{linebreakReplacement:o}=t.doc.type.schema,i=t.doc.resolve(e-n),s=i.node().type;if(o&&s.inlineContent){let u=s.whitespace=="pre",d=!!s.contentMatch.matchType(o);u&&!d?r=!1:!u&&d&&(r=!0)}let a=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);Cw(t,u.node(),u.before(),a)}s.inlineContent&&kf(t,e+n-1,s,i.node().contentMatchAt(i.index()),r==null);let l=t.mapping.slice(a),c=l.map(e-n);if(t.step(new $t(c,l.map(e+n,-1),ve.empty,!0)),r===!0){let u=t.doc.resolve(c);Sw(t,u.node(),u.before(),t.steps.length)}return t}function UC(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function $w(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let i=0;i<n.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),c=r.node(s),u=!1;if(i==1)u=c.canReplace(l,l,o);else{let d=c.contentMatchAt(l).findWrapping(o.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function Sf(t,e,n=e,r=ve.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return Tw(o,i,r)?new $t(e,n,r):new HC(o,i,r).fit()}function Tw(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}let HC=class{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=be.empty;for(let o=0;o<=e.depth;o++){let i=e.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=be.from(e.node(o).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(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let i=this.placed,s=r.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new ve(i,s,a);return e>-1?new Jt(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new $t(r.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let i=n.firstChild;if(n.childCount>1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=Lc(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(n==1&&(s?c.matchType(s.type)||(d=c.fillBefore(be.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:d};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Lc(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new ve(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Lc(e,n);if(o.childCount<=1&&n>0){let i=e.size-n<=n+o.size;this.unplaced=new ve(Ei(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new ve(Ei(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let m=0;m<i.length;m++)this.openFrontierNode(i[m]);let s=this.unplaced,a=r?r.content:s.content,l=s.openStart-e,c=0,u=[],{match:d,type:f}=this.frontier[n];if(o){for(let m=0;m<o.childCount;m++)u.push(o.child(m));d=d.matchFragment(o)}let p=a.size+e-(s.content.size-s.openEnd);for(;c<a.childCount;){let m=a.child(c),y=d.matchType(m.type);if(!y)break;c++,(c>1||l==0||m.content.size)&&(d=y,u.push(Ow(m.mark(f.allowedMarks(m.marks)),c==1?l:0,c==a.childCount?p:-1)))}let h=c==a.childCount;h||(p=-1),this.placed=Ai(this.placed,n,be.from(u)),this.frontier[n].match=d,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,y=a;m<p;m++){let g=y.lastChild;this.frontier.push({type:g.type,match:g.contentMatchAt(g.childCount)}),y=g.content}this.unplaced=h?e==0?ve.empty:new ve(Ei(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new ve(Ei(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Pc(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],i=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=Pc(e,n,o,r,i);if(s){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],u=Pc(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Ai(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,i)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=Ai(this.placed,this.depth,be.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(be.empty,!0);e.childCount&&(this.placed=Ai(this.placed,this.frontier.length,e))}};function Ei(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Ei(t.firstChild.content,e-1,n)))}function Ai(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Ai(t.lastChild.content,e-1,n)))}function Lc(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Ow(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Ow(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(be.empty,!0)))),t.copy(r)}function Pc(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!WC(n,i.content,s)?a:null}function WC(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function GC(t){return t.spec.defining||t.spec.definingForContent}function KC(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),i=t.doc.resolve(n);if(Tw(o,i,r))return t.step(new $t(e,n,r));let s=Mw(o,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let f=o.depth,p=o.pos-1;f>0;f--,p--){let h=o.node(f).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(f)>-1?a=f:o.before(f)==p&&s.splice(1,0,-f)}let l=s.indexOf(a),c=[],u=r.openStart;for(let f=r.content,p=0;;p++){let h=f.firstChild;if(c.push(h),p==r.openStart)break;f=h.content}for(let f=u-1;f>=0;f--){let p=c[f],h=GC(p.type);if(h&&!p.sameMarkup(o.node(Math.abs(a)-1)))u=f;else if(h||!p.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let p=(f+u+1)%(r.openStart+1),h=c[p];if(h)for(let m=0;m<s.length;m++){let y=s[(m+l)%s.length],g=!0;y<0&&(g=!1,y=-y);let x=o.node(y-1),k=o.index(y-1);if(x.canReplaceWith(k,k,h.type,h.marks))return t.replace(o.before(y),g?i.after(y):n,new ve(Dw(r.content,0,r.openStart,p),p,r.openEnd))}}let d=t.steps.length;for(let f=s.length-1;f>=0&&(t.replace(e,n,r),!(t.steps.length>d));f--){let p=s[f];p<0||(e=o.before(p),n=i.after(p))}}function Dw(t,e,n,r,o){if(e<n){let i=t.firstChild;t=t.replaceChild(0,i.copy(Dw(i.content,e+1,n,r,i)))}if(e>r){let i=o.contentMatchAt(0),s=i.fillBefore(t).append(t);t=s.append(i.matchFragment(s).fillBefore(be.empty,!0))}return t}function XC(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=UC(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new ve(be.from(r),0,0))}function JC(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),i=Mw(r,o);for(let s=0;s<i.length;s++){let a=i[s],l=s==i.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),o.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return t.delete(r.before(a),o.after(a))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.depth-s&&r.start(s-1)==o.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),o.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}function Mw(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let i=t.start(o);if(i<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&n.push(o)}return n}let _w=class ha extends Bt{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return jt.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return jt.fromReplace(e,this.pos,this.pos+1,new ve(be.from(o),0,n.isLeaf?0:1))}getMap(){return Qt.empty}invert(e){return new ha(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new ha(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new ha(n.pos,n.attr,n.value)}};Bt.jsonID("attr",_w);let Nw=class Ju extends Bt{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return jt.ok(r)}getMap(){return Qt.empty}invert(e){return new Ju(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Ju(n.attr,n.value)}};Bt.jsonID("docAttr",Nw);let Wo=class extends Error{};Wo=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Wo.prototype=Object.create(Error.prototype);Wo.prototype.constructor=Wo;Wo.prototype.name="TransformError";let Iw=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Ho}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Wo(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=ve.empty){let o=Sf(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new ve(be.from(r),0,0))}delete(e,n){return this.replace(e,n,ve.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return KC(this,e,n,r),this}replaceRangeWith(e,n,r){return XC(this,e,n,r),this}deleteRange(e,n){return JC(this,e,n),this}lift(e,n){return IC(this,e,n),this}join(e,n=1){return VC(this,e,n),this}wrap(e,n){return RC(this,e,n),this}setBlockType(e,n=e,r,o=null){return LC(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return zC(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new _w(e,n,r)),this}setDocAttribute(e,n){return this.step(new Nw(e,n)),this}addNodeMark(e,n){return this.step(new vf(e,n)),this}removeNodeMark(e,n){if(!(n instanceof Ge)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new xf(e,n)),this}split(e,n=1,r){return jC(this,e,n,r),this}addMark(e,n,r){return MC(this,e,n,r),this}removeMark(e,n,r){return _C(this,e,n,r),this}clearIncompatible(e,n,r){return kf(this,e,n,r),this}};const zc=Object.create(null);let Re=class{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new Fw(e.min(n),e.max(n))]}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 n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=ve.empty){let r=n.content.lastChild,o=null;for(let a=0;a<n.openEnd;a++)o=r,r=r.lastChild;let i=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(i);e.replaceRange(u.map(l.pos),u.map(c.pos),a?ve.empty:n),a==0&&jm(e,i,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,o=this.ranges;for(let i=0;i<o.length;i++){let{$from:s,$to:a}=o[i],l=e.mapping.slice(r),c=l.map(s.pos),u=l.map(a.pos);i?e.deleteRange(c,u):(e.replaceRangeWith(c,u,n),jm(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new Le(e):Oo(e.node(0),e.parent,e.pos,e.index(),n,r);if(o)return o;for(let i=e.depth-1;i>=0;i--){let s=n<0?Oo(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):Oo(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Mn(e.node(0))}static atStart(e){return Oo(e,e,0,0,1)||new Mn(e)}static atEnd(e){return Oo(e,e,e.content.size,e.childCount,-1)||new Mn(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=zc[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in zc)throw new RangeError("Duplicate use of selection JSON ID "+e);return zc[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Le.between(this.$anchor,this.$head).getBookmark()}};Re.prototype.visible=!0;let Fw=class{constructor(e,n){this.$from=e,this.$to=n}},Pm=!1;function zm(t){!Pm&&!t.parent.inlineContent&&(Pm=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}let Le=class $i extends Re{constructor(e,n=e){zm(e),zm(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return Re.near(r);let o=e.resolve(n.map(this.anchor));return new $i(o.parent.inlineContent?o:r,r)}replace(e,n=ve.empty){if(super.replace(e,n),n==ve.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof $i&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Bw(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new $i(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let o=e.resolve(n);return new this(o,r==n?o:e.resolve(r))}static between(e,n,r){let o=e.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let i=Re.findFrom(n,r,!0)||Re.findFrom(n,-r,!0);if(i)n=i.$head;else return Re.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(Re.findFrom(e,-r,!0)||Re.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new $i(e,n)}};Re.jsonID("text",Le);let Bw=class Rw{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Rw(e.map(this.anchor),e.map(this.head))}resolve(e){return Le.between(e.resolve(this.anchor),e.resolve(this.head))}},Ne=class Ti extends Re{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),i=e.resolve(o);return r?Re.near(i):new Ti(i)}content(){return new ve(be.from(this.node),0,0)}eq(e){return e instanceof Ti&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new YC(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Ti(e.resolve(n.anchor))}static create(e,n){return new Ti(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};Ne.prototype.visible=!1;Re.jsonID("node",Ne);let YC=class Lw{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Bw(r,r):new Lw(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&Ne.isSelectable(r)?new Ne(n):Re.near(n)}},Mn=class ma extends Re{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=ve.empty){if(n==ve.empty){e.delete(0,e.doc.content.size);let r=Re.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new ma(e)}map(e){return new ma(e)}eq(e){return e instanceof ma}getBookmark(){return ZC}};Re.jsonID("all",Mn);const ZC={map(){return this},resolve(t){return new Mn(t)}};function Oo(t,e,n,r,o,i=!1){if(e.inlineContent)return Le.create(t,n);for(let s=r-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){let a=e.child(s);if(a.isAtom){if(!i&&Ne.isSelectable(a))return Ne.create(t,n-(o<0?a.nodeSize:0))}else{let l=Oo(t,a,n+o,o<0?a.childCount:0,o,i);if(l)return l}n+=a.nodeSize*o}return null}function jm(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof $t||o instanceof Jt))return;let i=t.mapping.maps[r],s;i.forEach((a,l,c,u)=>{s==null&&(s=u)}),t.setSelection(Re.near(t.doc.resolve(s),n))}const qm=1,Vm=2,Um=4;let QC=class extends Iw{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|qm)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&qm)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Vm,this}ensureMarks(e){return Ge.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&Vm)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Ge.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let o=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(n);i=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,i)),this.selection.empty||this.setSelection(Re.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,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|=Um,this}get scrolledIntoView(){return(this.updated&Um)>0}};function Hm(t,e){return!e||!t?t:t.bind(e)}let Oi=class{constructor(e,n,r){this.name=e,this.init=Hm(n.init,r),this.apply=Hm(n.apply,r)}};const eE=[new Oi("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Oi("selection",{init(t,e){return t.selection||Re.atStart(e.doc)},apply(t){return t.selection}}),new Oi("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Oi("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];let jc=class{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=eE.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Oi(r.key,r.spec.state,r))})}},zi=class Di{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,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),o=null;for(;;){let i=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=o?o[s].n:0,c=o?o[s].state:this,u=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,c,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",e),!o){o=[];for(let d=0;d<this.config.plugins.length;d++)o.push(d<s?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),i=!0}o&&(o[s]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Di(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let i=r[o];n[i.name]=i.apply(e,this[i.name],this,n)}return n}get tr(){return new QC(this)}static create(e){let n=new jc(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Di(n);for(let o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(e,r);return r}reconfigure(e){let n=new jc(this.schema,e.plugins),r=n.fields,o=new Di(n);for(let i=0;i<r.length;i++){let s=r[i].name;o[s]=this.hasOwnProperty(s)?this[s]:r[i].init(e,o)}return o}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=e[r],i=o.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(o,this[o.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new jc(e.schema,e.plugins),i=new Di(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=Jr.fromJSON(e.schema,n.doc);else if(s.name=="selection")i.selection=Re.fromJSON(i.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){i[s.name]=c.fromJSON.call(l,e,n[a],i);return}}i[s.name]=s.init(e,i)}}),i}};function Pw(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=Pw(o,e,{})),n[r]=o}return n}let Ze=class{constructor(e){this.spec=e,this.props={},e.props&&Pw(e.props,this,this.props),this.key=e.key?e.key.key:zw("plugin")}getState(e){return e[this.key]}};const qc=Object.create(null);function zw(t){return t in qc?t+"$"+ ++qc[t]:(qc[t]=0,t+"$")}let et=class{constructor(e="key"){this.key=zw(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};const Ba=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),tE=t=>Ba(t),ga=Object.freeze({RESOLVED:"resolved",NEW:"new",ADD:"add",UPDATE:"update",DELETED:"deleted",PENDING:"pending",SELECTED:"selected",COMMENTS_LIST:"comments-list",CHANGE_ACCEPTED:"change-accepted",CHANGE_REJECTED:"change-rejected"}),nE={mounted(t,e,n){const r=o=>{t.contains(o.target)||e.value(o)};document.addEventListener("click",r),t.__clickOutsideHandler=r},unmounted(t){document.removeEventListener("click",t.__clickOutsideHandler),delete t.__clickOutsideHandler}};function ao(t){if(t!=null)return typeof t=="string"&&(t=parseFloat(t)),Math.round(t*1440)}function Wt(t){if(t!=null)return typeof t=="string"&&(t=parseInt(t,10)),Math.round(t/1440*100)/100}function ut(t){if(t!=null)return t=Wt(t),Math.round(t*96)}function Ct(t){if(t!=null)return t=t/96,ao(t)}function zo(t){if(t!=null)return t/240}function jw(t){if(t!=null)return t*240}function rE(t){if(t!=null)return Math.round(t/2)}function En(t){if(t==null)return;typeof t=="string"&&(t=parseFloat(t));const e=t*96/914400;return Math.round(e)}function mi(t){if(t!=null)return typeof t=="string"&&(t=parseFloat(t)),Math.round(t*9525)}function qw(t){return t==null?void 0:parseFloat(t)/8*1.3333}function Vw(t){if(t!=null)return Math.round(t*6)}const oE=async t=>await(await fetch(t)).arrayBuffer(),iE=t=>{const e=new window.DOMParser().parseFromString(t,"text/xml").querySelectorAll("Default");return Array.from(e).map(n=>n.getAttribute("Extension"))},sE=t=>new Map([["yellow","#ffff00"],["green","#00ff00"],["blue","#0000FFFF"],["cyan","#00ffff"],["magenta","#ff00ff"],["red","#ff0000"],["darkYellow","#808000FF"],["darkGreen","#008000FF"],["darkBlue","#000080"],["darkCyan","#008080FF"],["darkMagenta","#800080FF"],["darkGray","#808080FF"],["darkRed","#800000FF"],["lightGray","#C0C0C0FF"],["black","#000"]]).get(t)||null;function aE(t){if(!t||typeof t!="string")return!1;switch(t.length){case 3:return/^[0-9A-F]{3}$/i.test(t);case 6:return/^[0-9A-F]{6}$/i.test(t);case 8:return/^[0-9A-F]{8}$/i.test(t);default:return!1}}const lE=t=>{const e=Number(t).toString(16);return e.length===1?"0"+e:e},cE=t=>"#"+t.match(/\d+/g).map(lE).join("");function Xn(t=8){const e="0123456789abcdef";let n=[];for(let r=0;r<t;r++){const o=Math.floor(Math.random()*e.length);n.push(e[o])}return n.join("")}function Cf(){return Math.floor(Math.random()*2147483647).toString(16).toUpperCase().padStart(8,"0")}const uE={"xmlns:wpc":"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas","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:oel":"http://schemas.microsoft.com/office/2019/extlst","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:w16du":"http://schemas.microsoft.com/office/word/2023/wordml/word16du","xmlns:w16sdtdh":"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash","xmlns:w16sdtfl":"http://schemas.microsoft.com/office/word/2024/wordml/sdtformatlock","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","mc:Ignorable":"w14 w15 w16se w16cid w16 w16cex w16sdtdh w16sdtfl w16du wp14"},dE={elements:[{type:"element",name:"Properties",attributes:{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties","xmlns:vt":"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"},elements:[]}]},fE={elements:[{type:"element",name:"w:settings",attributes:{"xmlns:w":"http://schemas.openxmlformats.org/wordprocessingml/2006/main"},elements:[]}]},pE={type:"element",name:"w:r",elements:[{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rStyle",attributes:{"w:val":"CommentReference"}}]},{type:"element",name:"w:annotationRef"}]},Wm={Normal:{type:"element",name:"w:style",attributes:{"w:type":"paragraph","w:default":"1","w:styleId":"Normal"},elements:[{type:"element",name:"w:name",attributes:{"w:val":"Normal"}},{type:"element",name:"w:qFormat"}]},Title:{type:"element",name:"w:style",attributes:{"w:type":"paragraph","w:styleId":"Title"},elements:[{type:"element",name:"w:name",attributes:{"w:val":"Title"}},{type:"element",name:"w:basedOn",attributes:{"w:val":"Normal"}},{type:"element",name:"w:next",attributes:{"w:val":"Normal"}},{type:"element",name:"w:link",attributes:{"w:val":"TitleChar"}},{type:"element",name:"w:uiPriority",attributes:{"w:val":"10"}},{type:"element",name:"w:qFormat"},{type:"element",name:"w:rsid",attributes:{"w:val":"00B72667"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:spacing",attributes:{"w:after":"80"}},{type:"element",name:"w:contextualSpacing"}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:asciiTheme":"majorHAnsi","w:eastAsiaTheme":"majorEastAsia","w:hAnsiTheme":"majorHAnsi","w:cstheme":"majorBidi"}},{type:"element",name:"w:spacing",attributes:{"w:val":"-10"}},{type:"element",name:"w:kern",attributes:{"w:val":"28"}},{type:"element",name:"w:sz",attributes:{"w:val":"56"}},{type:"element",name:"w:szCs",attributes:{"w:val":"56"}}]}]},Subtitle:{type:"element",name:"w:style",attributes:{"w:type":"paragraph","w:styleId":"Subtitle"},elements:[{type:"element",name:"w:name",attributes:{"w:val":"Subtitle"}},{type:"element",name:"w:basedOn",attributes:{"w:val":"Normal"}},{type:"element",name:"w:next",attributes:{"w:val":"Normal"}},{type:"element",name:"w:link",attributes:{"w:val":"SubtitleChar"}},{type:"element",name:"w:uiPriority",attributes:{"w:val":"11"}},{type:"element",name:"w:qFormat"},{type:"element",name:"w:rsid",attributes:{"w:val":"00B72667"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:numPr",elements:[{type:"element",name:"w:ilvl",attributes:{"w:val":"1"}}]},{type:"element",name:"w:spacing",attributes:{"w:after":"160"}}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:asciiTheme":"minorHAnsi","w:eastAsiaTheme":"majorEastAsia","w:hAnsiTheme":"minorHAnsi","w:cstheme":"majorBidi"}},{type:"element",name:"w:color",attributes:{"w:val":"595959","w:themeColor":"text1","w:themeTint":"A6"}},{type:"element",name:"w:spacing",attributes:{"w:val":"15"}},{type:"element",name:"w:sz",attributes:{"w:val":"28"}},{type:"element",name:"w:szCs",attributes:{"w:val":"28"}}]}]},Heading1:{type:"element",name:"w:style",attributes:{"w:type":"paragraph","w:styleId":"Heading1"},elements:[{type:"element",name:"w:name",attributes:{"w:val":"heading 1"}},{type:"element",name:"w:basedOn",attributes:{"w:val":"Normal"}},{type:"element",name:"w:next",attributes:{"w:val":"Normal"}},{type:"element",name:"w:link",attributes:{"w:val":"Heading1Char"}},{type:"element",name:"w:uiPriority",attributes:{"w:val":"9"}},{type:"element",name:"w:qFormat"},{type:"element",name:"w:rsid",attributes:{"w:val":"00233D7B"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:keepNext"},{type:"element",name:"w:keepLines"},{type:"element",name:"w:spacing",attributes:{"w:before":"360","w:after":"80"}},{type:"element",name:"w:outlineLvl",attributes:{"w:val":"0"}}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:asciiTheme":"majorHAnsi","w:eastAsiaTheme":"majorEastAsia","w:hAnsiTheme":"majorHAnsi","w:cstheme":"majorBidi"}},{type:"element",name:"w:color",attributes:{"w:val":"0F4761","w:themeColor":"accent1","w:themeShade":"BF"}},{type:"element",name:"w:sz",attributes:{"w:val":"40"}},{type:"element",name:"w:szCs",attributes:{"w:val":"40"}}]}]},Heading2:{type:"element",name:"w:style",attributes:{"w:type":"paragraph","w:styleId":"Heading2"},elements:[{type:"element",name:"w:name",attributes:{"w:val":"heading 2"}},{type:"element",name:"w:basedOn",attributes:{"w:val":"Normal"}},{type:"element",name:"w:next",attributes:{"w:val":"Normal"}},{type:"element",name:"w:link",attributes:{"w:val":"Heading2Char"}},{type:"element",name:"w:uiPriority",attributes:{"w:val":"9"}},{type:"element",name:"w:semiHidden"},{type:"element",name:"w:unhideWhenUsed"},{type:"element",name:"w:qFormat"},{type:"element",name:"w:rsid",attributes:{"w:val":"00233D7B"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:keepNext"},{type:"element",name:"w:keepLines"},{type:"element",name:"w:spacing",attributes:{"w:before":"160","w:after":"80"}},{type:"element",name:"w:outlineLvl",attributes:{"w:val":"1"}}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:asciiTheme":"majorHAnsi","w:eastAsiaTheme":"majorEastAsia","w:hAnsiTheme":"majorHAnsi","w:cstheme":"majorBidi"}},{type:"element",name:"w:color",attributes:{"w:val":"0F4761","w:themeColor":"accent1","w:themeShade":"BF"}},{type:"element",name:"w:sz",attributes:{"w:val":"32"}},{type:"element",name:"w:szCs",attributes:{"w:val":"32"}}]}]},Heading3:{type:"element",name:"w:style",attributes:{"w:type":"paragraph","w:styleId":"Heading3"},elements:[{type:"element",name:"w:name",attributes:{"w:val":"heading 3"}},{type:"element",name:"w:basedOn",attributes:{"w:val":"Normal"}},{type:"element",name:"w:next",attributes:{"w:val":"Normal"}},{type:"element",name:"w:link",attributes:{"w:val":"Heading3Char"}},{type:"element",name:"w:uiPriority",attributes:{"w:val":"9"}},{type:"element",name:"w:semiHidden"},{type:"element",name:"w:unhideWhenUsed"},{type:"element",name:"w:qFormat"},{type:"element",name:"w:rsid",attributes:{"w:val":"00233D7B"}},{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:keepNext"},{type:"element",name:"w:keepLines"},{type:"element",name:"w:spacing",attributes:{"w:before":"160","w:after":"80"}},{type:"element",name:"w:outlineLvl",attributes:{"w:val":"2"}}]},{type:"element",name:"w:rPr",elements:[{type:"element",name:"w:rFonts",attributes:{"w:eastAsiaTheme":"majorEastAsia","w:cstheme":"majorBidi"}},{type:"element",name:"w:color",attributes:{"w:val":"0F4761","w:themeColor":"accent1","w:themeShade":"BF"}},{type:"element",name:"w:sz",attributes:{"w:val":"28"}},{type:"element",name:"w:szCs",attributes:{"w:val":"28"}}]}]}},hE={declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[{type:"element",name:"w:comments",attributes:{"xmlns:wpc":"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas","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:oel":"http://schemas.microsoft.com/office/2019/extlst","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:w16du":"http://schemas.microsoft.com/office/word/2023/wordml/word16du","xmlns:w16sdtdh":"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash","xmlns:w16sdtfl":"http://schemas.microsoft.com/office/word/2024/wordml/sdtformatlock","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","mc:Ignorable":"w14 w15 w16se w16cid w16 w16cex w16sdtdh w16sdtfl w16du wp14"},elements:[]}]},mE={declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[{type:"element",name:"w15:commentsEx",attributes:{"xmlns:wpc":"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas","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:oel":"http://schemas.microsoft.com/office/2019/extlst","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:w16du":"http://schemas.microsoft.com/office/word/2023/wordml/word16du","xmlns:w16sdtdh":"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash","xmlns:w16sdtfl":"http://schemas.microsoft.com/office/word/2024/wordml/sdtformatlock","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","mc:Ignorable":"w14 w15 w16se w16cid w16 w16cex w16sdtdh w16sdtfl w16du wp14"},elements:[]}]},gE={declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[{type:"element",name:"w16cex:commentsExtensible",attributes:{"xmlns:wpc":"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas","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:cr":"http://schemas.microsoft.com/office/comments/2020/reactions","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:oel":"http://schemas.microsoft.com/office/2019/extlst","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:w16du":"http://schemas.microsoft.com/office/word/2023/wordml/word16du","xmlns:w16sdtdh":"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash","xmlns:w16sdtfl":"http://schemas.microsoft.com/office/word/2024/wordml/sdtformatlock","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","mc:Ignorable":"w14 w15 w16se w16cid w16 w16cex w16sdtdh w16sdtfl cr w16du wp14"},elements:[]}]},yE={declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[{type:"element",name:"w16cid:commentsIds",attributes:{"xmlns:wpc":"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas","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:oel":"http://schemas.microsoft.com/office/2019/extlst","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:w16du":"http://schemas.microsoft.com/office/word/2023/wordml/word16du","xmlns:w16sdtdh":"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash","xmlns:w16sdtfl":"http://schemas.microsoft.com/office/word/2024/wordml/sdtformatlock","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","mc:Ignorable":"w14 w15 w16se w16cid w16 w16cex w16sdtdh w16sdtfl w16du wp14"},elements:[]}]},bE={elements:[{type:"element",name:"Relationships",attributes:{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},elements:[{type:"element",name:"Relationship",attributes:{Id:"rId8",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",Target:"fontTable.xml"}},{type:"element",name:"Relationship",attributes:{Id:"rId3",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings",Target:"webSettings.xml"}},{type:"element",name:"Relationship",attributes:{Id:"rId7",Type:"http://schemas.microsoft.com/office/2018/08/relationships/commentsExtensible",Target:"commentsExtensible.xml"}},{type:"element",name:"Relationship",attributes:{Id:"rId2",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",Target:"settings.xml"}},{type:"element",name:"Relationship",attributes:{Id:"rId1",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Target:"styles.xml"}},{type:"element",name:"Relationship",attributes:{Id:"rId6",Type:"http://schemas.microsoft.com/office/2016/09/relationships/commentsIds",Target:"commentsIds.xml"}},{type:"element",name:"Relationship",attributes:{Id:"rId5",Type:"http://schemas.microsoft.com/office/2011/relationships/commentsExtended",Target:"commentsExtended.xml"}},{type:"element",name:"Relationship",attributes:{Id:"rId10",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Target:"theme/theme1.xml"}},{type:"element",name:"Relationship",attributes:{Id:"rId4",Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",Target:"comments.xml"}}]}]},wE={declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[{type:"element",name:"Types",attributes:{xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"},elements:[{type:"element",name:"Default",attributes:{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}},{type:"element",name:"Default",attributes:{Extension:"xml",ContentType:"application/xml"}},{type:"element",name:"Override",attributes:{PartName:"/word/document.xml",ContentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"}},{type:"element",name:"Override",attributes:{PartName:"/word/styles.xml",ContentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"}},{type:"element",name:"Override",attributes:{PartName:"/word/settings.xml",ContentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml"}},{type:"element",name:"Override",attributes:{PartName:"/word/webSettings.xml",ContentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml"}},{type:"element",name:"Override",attributes:{PartName:"/word/comments.xml",ContentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml"}},{type:"element",name:"Override",attributes:{PartName:"/word/commentsExtended.xml",ContentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml"}},{type:"element",name:"Override",attributes:{PartName:"/word/commentsIds.xml",ContentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsIds+xml"}},{type:"element",name:"Override",attributes:{PartName:"/word/commentsExtensible.xml",ContentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtensible+xml"}},{type:"element",name:"Override",attributes:{PartName:"/word/fontTable.xml",ContentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml"}},{type:"element",name:"Override",attributes:{PartName:"/word/people.xml",ContentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.people+xml"}},{type:"element",name:"Override",attributes:{PartName:"/word/theme/theme1.xml",ContentType:"application/vnd.openxmlformats-officedocument.theme+xml"}},{type:"element",name:"Override",attributes:{PartName:"/docProps/core.xml",ContentType:"application/vnd.openxmlformats-package.core-properties+xml"}},{type:"element",name:"Override",attributes:{PartName:"/docProps/app.xml",ContentType:"application/vnd.openxmlformats-officedocument.extended-properties+xml"}},{type:"element",name:"Override",attributes:{PartName:"/word/numbering.xml",ContentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml"}}]}]},Do={COMMENTS_XML_DEF:hE,COMMENTS_EXTENDED_XML_DEF:mE,COMMENTS_EXTENSIBLE_XML_DEF:gE,COMMENTS_IDS_XML_DEF:yE,DOCUMENT_RELS_XML_DEF:bE,CONTENT_TYPES:wE},It="trackInsert",lt="trackDelete",bt="trackFormat",yn=t=>{if(t)try{return JSON.parse(JSON.stringify(t))}catch(e){console.error("Error in carbonCopy",t,e);return}};function Gm(t,e){const{node:n,commentsExportType:r,exportedCommentDefs:o=[]}=t;if(!o.length||r==="clean")return;const i=n.attrs["w:id"],s=t.comments.find(f=>f.commentId==i);if(!s)return;const a=t.comments?.findIndex(f=>f.commentId===s.commentId),l=s.parentCommentId;let c;l&&(c=t.comments.find(f=>f.commentId===l||f.importedId===l));const u=c?.isInternal||s.isInternal;if(r==="external"&&u||s.resolvedTime)return;let d=vE(e,a);if(e==="End"){const f={name:"w:r",elements:[{name:"w:commentReference",attributes:{"w:id":String(a)}}]};d=[d,f]}return d}const vE=(t,e)=>({name:`w:commentRange${t}`,attributes:{"w:id":String(e)}}),xE=t=>({...t,commentParaId:Cf()}),kE=(t,e,n)=>{const r=Hw({node:t.commentJSON}),o={"w:id":String(e),"w:author":t.creatorName||t.importedAuthor?.name,"w:email":t.creatorEmail||t.importedAuthor?.email,"w:date":Uw(t.createdTime),"w:initials":SE(t.creatorName),"w:done":t.resolvedTime?"1":"0","w15:paraId":t.commentParaId,"custom:internalId":t.commentId||t.internalId,"custom:trackedChange":t.trackedChange,"custom:trackedChangeText":t.trackedChangeText||null,"custom:trackedChangeType":t.trackedChangeType,"custom:trackedDeletedText":t.deletedText||null};if(t?.parentCommentId){const i=n.find(s=>s.commentId===t.parentCommentId);o["w15:paraIdParent"]=i.commentParaId}return{type:"element",name:"w:comment",attributes:o,elements:[r]}},SE=t=>t?t.replace("(imported)","").trim().split(" ").map(e=>e[0]).join(""):null,Uw=t=>new Date(t||Date.now()).toISOString().replace(/\.\d{3}Z$/,"Z"),CE=(t=[],e)=>{const n=yn(e);return t.forEach(r=>{r.elements[0].elements.unshift(pE);const o=r.attributes["w15:paraId"];r.elements[0].attributes["w14:paraId"]=o,r.attributes={"w:id":r.attributes["w:id"],"w:author":r.attributes["w:author"],"w:email":r.attributes["w:email"],"w:date":r.attributes["w:date"],"w:initials":r.attributes["w:initials"],"custom:internalId":r.attributes["custom:internalId"],"custom:trackedChange":r.attributes["custom:trackedChange"],"custom:trackedChangeText":r.attributes["custom:trackedChangeText"],"custom:trackedChangeType":r.attributes["custom:trackedChangeType"],"custom:trackedDeletedText":r.attributes["custom:trackedDeletedText"],"xmlns:custom":"http://schemas.openxmlformats.org/wordprocessingml/2006/main"}}),n.elements[0].elements=t,n},EE=(t=[],e)=>{const n=yn(e),r=t.map(o=>{const i={"w15:paraId":o.commentParaId,"w15:done":o.resolvedTime?"1":"0"},s=o.parentCommentId;if(s){const a=t.find(l=>l.commentId===s);i["w15:paraIdParent"]=a.commentParaId}return{type:"element",name:"w15:commentEx",attributes:i}});return n.elements[0].elements=r,n},AE=(t=[],e,n)=>{const r=yn(e),o=yn(n);return r.elements[0].elements=[],o.elements[0].elements=[],t.forEach(i=>{const s=Cf(),a={type:"element",name:"w16cid:commentId",attributes:{"w16cid:paraId":i.commentParaId,"w16cid:durableId":s}};r.elements[0].elements.push(a);const l={type:"element",name:"w16cex:commentExtensible",attributes:{"w16cex:durableId":s,"w16cex:dateUtc":Uw()}};o.elements[0].elements.push(l)}),{documentIdsUpdated:r,extensibleUpdated:o}},$E=t=>{const e=yn(t);return e["word/comments.xml"]=Do.COMMENTS_XML_DEF,e["word/commentsExtended.xml"]=Do.COMMENTS_EXTENDED_XML_DEF,e["word/commentsExtensible.xml"]=Do.COMMENTS_EXTENSIBLE_XML_DEF,e["word/commentsIds.xml"]=Do.COMMENTS_IDS_XML_DEF,e["[Content_Types].xml"]=Do.CONTENT_TYPES,e},TE=t=>{const e=yn(t);return delete e["word/comments.xml"],delete e["word/commentsExtended.xml"],delete e["word/commentsExtensible.xml"],delete e["word/commentsIds.xml"],e},Ps=t=>({...Do.DOCUMENT_RELS_XML_DEF.elements[0].elements.find(e=>e.attributes.Target===t)}),OE=({convertedXml:t,defs:e,commentsWithParaIds:n,exportType:r,converter:o})=>{const i=[];if(r==="clean")return{documentXml:TE(t),relationships:i};const s=$E(t);s["word/comments.xml"]=CE(e,s["word/comments.xml"]),i.push(Ps("comments.xml")),s["word/commentsExtended.xml"]=EE(n,s["word/commentsExtended.xml"]),i.push(Ps("commentsExtended.xml"));const{documentIdsUpdated:a,extensibleUpdated:l}=AE(n,s["word/commentsIds.xml"],s["word/commentsExtensible.xml"]);return s["word/commentsIds.xml"]=a,s["word/commentsExtensible.xml"]=l,i.push(Ps("commentsIds.xml")),i.push(Ps("commentsExtensible.xml")),{relationships:i,documentXml:s}};function ai(t){const{type:e}=t.node||{},n={doc:_E,body:DE,paragraph:Hw,text:NE,bulletList:Xm,orderedList:Xm,lineBreak:PE,table:zE,tableRow:WE,tableCell:KE,bookmarkStart:YE,fieldAnnotation:iA,tab:qE,image:Kw,hardBreak:sA,commentRangeStart:()=>Gm(t,"Start"),commentRangeEnd:()=>Gm(t,"End"),commentReference:()=>null};return n[e]?n[e](t):(console.error("No translation function found for node type:",e),null)}function DE(t){const e=t.bodyNode?.elements.find(n=>n.name==="w:sectPr")||{};if(t.converter){const n=t.converter.pageStyles.pageMargins,r=e.elements.find(i=>i.name==="w:pgMar"),{attributes:o}=r;Object.entries(n).forEach(([i,s])=>{const a=ao(s);o[`w:${i}`]=a}),r.attributes=o}return{name:"w:body",elements:[...li(t),e]}}function Hw(t){const e=li(t),n=e.find(i=>i.name==="htmlAnnotation");if(e.length===1&&n)return n.elements;const r=ME(t.node);r&&e.unshift(r);let o={};return t.node.attrs?.rsidRDefault&&(o["w:rsidRDefault"]=t.node.attrs.rsidRDefault),{name:"w:p",elements:e,attributes:o}}function ME(t){const{attrs:e={}}=t,n=[],{styleId:r}=e;r&&n.push({name:"w:pStyle",attributes:{"w:val":r}});const{spacing:o,indent:i,textAlign:s,textIndent:a,marksAttrs:l,keepLines:c,keepNext:u}=e;if(o){const{lineSpaceBefore:d,lineSpaceAfter:f,line:p,lineRule:h}=o,m={};d>=0&&(m["w:before"]=Ct(d)),f>=0&&(m["w:after"]=Ct(f)),p&&(m["w:line"]=jw(p)),m["w:lineRule"]=h||"auto";const y={name:"w:spacing",attributes:m};n.push(y)}if(i){const{left:d,right:f,firstLine:p,hanging:h}=i,m={};(d||d===0)&&(m["w:left"]=Ct(d)),(f||f===0)&&(m["w:right"]=Ct(f)),(p||p===0)&&(m["w:firstLine"]=Ct(p)),(h||h===0)&&(m["w:hanging"]=Ct(h)),a&&!m["w:left"]&&(m["w:left"]=ao(a));const y={name:"w:ind",attributes:m};n.push(y)}else if(a){const d={name:"w:ind",attributes:{"w:left":ao(a)}};n.push(d)}if(s){const d={name:"w:jc",attributes:{"w:val":s}};n.push(d)}if(l){const d=kl(l),f=Ww(d);n.push(f)}return c&&n.push({name:"w:keepLines",attributes:{"w:val":c}}),u&&n.push({name:"w:keepNext",attributes:{"w:val":u}}),n.length?{name:"w:pPr",elements:n}:null}function _E(t){const e={type:"body",content:t.node.content};return[{name:"w:document",elements:[ai({...t,node:e})],attributes:uE},t]}function li(t){const{content:e}=t.node;if(!e)return[];const n=[];return e.forEach(r=>{const o=ai({...t,node:r});o instanceof Array?n.push(...o):n.push(o)}),n.filter(r=>r)}function xl(t,e){const n=/^\s|\s$/.test(t)?"preserve":null,r=n?{"xml:space":n}:null,o=kl(e);return Ef({name:"w:t",elements:[{text:t,type:"text"}],attributes:r},o)}function NE(t){const{node:e}=t,n=[It,lt];if(e.marks?.some(i=>n.includes(i.type)))return FE(t);if(e.marks?.some(i=>i.type==="link"))return BE(t);const{text:r,marks:o=[]}=e;return xl(r,o)}function IE(t){const e=t.find(n=>n.type===bt);if(e)return{type:"element",name:"w:rPrChange",attributes:{"w:id":e.attrs.id,"w:author":e.attrs.author,"w:authorEmail":e.attrs.authorEmail,"w:date":e.attrs.date},elements:e.attrs.before.map(n=>kl([n])).filter(n=>n!==void 0)}}function FE(t){const{node:e}=t,n=e.marks,r=[It,lt,bt],o=n.find(l=>r.includes(l.type)),i=o.type===It,s=IE(n);e.marks=n.filter(l=>!r.includes(l.type)),s&&e.marks.push(s);const a=ai({...t,node:e});if(!i){const l=a.elements.find(c=>c.name==="w:t");l.name="w:delText"}return{name:i?"w:ins":"w:del",type:"element",attributes:{"w:id":o.attrs.id,"w:author":o.attrs.author,"w:authorEmail":o.attrs.authorEmail,"w:date":o.attrs.date},elements:[a]}}function Ef(t,e){const n=[t];return e&&e.length&&n.unshift(Ww(e)),{name:"w:r",elements:n}}function Ww(t=[]){return{name:"w:rPr",elements:t.filter(e=>!!Object.keys(e).length)}}function kl(t=[]){return t.flatMap(e=>e.type==="textStyle"?Object.entries(e.attrs).filter(([n,r])=>r).map(([n,r])=>{const o={type:n,attrs:e.attrs};return Jm(o)}):Jm(e))}function BE(t){const{node:e}=t,n=e.marks.find(s=>s.type==="link"),r=n.attrs.href;let o=n.attrs.rId;o||(o=Gw(t,r)),e.marks=e.marks.filter(s=>s.type!=="link");const i=ai({...t,node:e});return{name:"w:hyperlink",type:"element",attributes:{"r:id":o},elements:[i]}}function Gw(t,e){const n="rId"+Xn();return(!t.relationships||!Array.isArray(t.relationships))&&(t.relationships=[]),t.relationships.push({type:"element",name:"Relationship",attributes:{Id:n,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",Target:e,TargetMode:"External"}}),n}function Km(t,e){const n="rId"+Xn(),r={type:"element",name:"Relationship",attributes:{Id:n,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:e}};return t.relationships.push(r),n}function Xm(t){const{content:e,type:n}=t.node,r=LE(e),o=[];return r.forEach(i=>{const{content:s,level:a}=i;s.forEach(l=>{const c=Object.assign({},l);c.attrs={...c.attrs,...i.attrs};const u=ai({...t,node:c});u.elements||(u.elements=[]);const d=u.elements.findIndex(p=>p.name==="w:pPr"),f=RE(i,a,n,d>-1);if(!u.elements.filter(p=>p.name!=="w:pPr").length){const p=u.elements[d]?.elements.find(m=>m.name==="w:spacing"),h={name:"w:p",type:"element",elements:p?[{name:"w:pPr",type:"element",elements:[p]}]:[]};return o.push(h)}d===-1?u.elements.unshift(f):u.elements[d].elements=[...u.elements[d].elements,...f],o.push(u)})}),o}function RE(t,e,n,r){let o=n==="bulletList"?1:2;t.attrs.numId&&(o=t.attrs.numId);const i=[{name:"w:numPr",type:"element",elements:[{name:"w:ilvl",type:"element",attributes:{"w:val":e}},{name:"w:numId",type:"element",attributes:{"w:val":o}}]}];let s;return t.attrs.attributes?.parentAttributes&&(s=t.attrs.attributes.parentAttributes.paragraphProperties.elements.find(a=>a.name==="w:ind")),s&&i.push(s),r?i:{name:"w:pPr",type:"element",elements:i}}function LE(t){const e=[];function n(r,o=0){!r||!r.length||r.forEach(i=>{const s=i.content?.filter(c=>c.type==="bulletList"||c.type==="orderedList")||[],a=i.content?.filter(c=>c.type!=="bulletList"&&c.type!=="orderedList")||[],l={...i,content:a};l.level=o,e.push(l),s.length&&n(s[0].content,o+1)})}return n(t),e}function PE(t){const e={},{lineBreakType:n}=t.node?.attrs||{};return n&&(e["w:type"]=n),{name:"w:br",attributes:e}}function zE(t){t.node=jE(t.node,t);const e=li(t),n=VE(t.node),r=HE(t.node);return e.unshift(n),e.unshift(r),{name:"w:tbl",elements:e}}function jE(t,{editorSchema:e}){const{content:n}=t;for(let r=0;r<n.length;r++){const o=n[r];if(o.content)for(let i=0;i<o.content?.length;i++){const s=o.content[i];if(!s){console.log("no cell");continue}const{attrs:a}=s;if(a.rowspan>1){const l=n.slice(r+1,r+a.rowspan),c={type:s.type,content:[e.nodes.paragraph.createAndFill().toJSON()],attrs:{...s.attrs,colspan:null,rowspan:null,continueMerge:!0}};l.forEach((u,d)=>{u.content.splice(i,0,c)})}}}return t}function qE(t){const{marks:e=[]}=t.node,n=kl(e);return Ef({name:"w:tab"},n)}function VE(t){const e=[],{attrs:n}=t,{tableWidth:r,tableWidthType:o,tableStyleId:i,borders:s,tableIndent:a,tableLayout:l,tableCellSpacing:c}=n;if(i){const u={name:"w:tblStyle",attributes:{"w:val":i}};e.push(u)}if(s){const u=UE(t);e.push(u)}if(a){const{width:u,type:d}=a,f={name:"w:tblInd",attributes:{"w:w":Ct(u),"w:type":d}};e.push(f)}if(l){const u={name:"w:tblLayout",attributes:{"w:type":l}};e.push(u)}if(r&&r.width){const u={name:"w:tblW",attributes:{"w:w":Ct(r.width),"w:type":r.type}};e.push(u)}return c&&e.push({name:"w:tblCellSpacing",attributes:{"w:w":c.w,"w:type":c.type}}),{name:"w:tblPr",elements:e}}function UE(t){const{borders:e}=t.attrs,n=[];return e?(["top","bottom","left","right","insideH","insideV"].forEach(r=>{const o=e[r];if(!o)return;let i={};!Object.keys(o).length||!o.size?i={"w:val":"nil"}:i={"w:val":"single","w:sz":Vw(o.size),"w:space":o.space||0,"w:color":o?.color?.substring(1)||"000000"};const s={name:`w:${r}`,attributes:i};n.push(s)}),{name:"w:tblBorders",elements:n}):void 0}function HE(t){const{gridColumnWidths:e}=t.attrs,n=[];return e?.forEach(r=>{n.push({name:"w:gridCol",attributes:{"w:w":ao(r)}})}),{name:"w:tblGrid",elements:n}}function WE(t){const e=li(t),n=GE(t.node);return n.elements.length&&e.unshift(n),{name:"w:tr",elements:e}}function GE(t){const{attrs:e}=t,n=[],{rowHeight:r,rowHeightType:o}=e;if(r){const i={"w:val":Ct(r)};o&&(i["w:hRule"]=o);const s={name:"w:trHeight",attributes:i};n.push(s)}return{name:"w:trPr",elements:n}}function KE(t){const e=li({...t,tableCell:t.node}),n=XE(t.node);return e.unshift(n),{name:"w:tc",elements:e}}function XE(t){const e=[],{attrs:n}=t,{colwidth:r=[],cellWidthType:o="dxa",background:i={},colspan:s,rowspan:a,widthUnit:l}=n,c=r.reduce((m,y)=>m+y,0),u={name:"w:tcW",attributes:{"w:w":l==="px"?Ct(c):ao(c),"w:type":o}};if(e.push(u),s){const m={name:"w:gridSpan",attributes:{"w:val":`${s}`}};e.push(m)}const{color:d}=i||{};if(d){const m={name:"w:shd",attributes:{"w:fill":d}};e.push(m)}const{cellMargins:f}=n;if(f){const m={name:"w:tcMar",elements:JE(f)};e.push(m)}const{verticalAlign:p}=n;if(p){const m={name:"w:vAlign",attributes:{"w:val":p}};e.push(m)}if(a&&a>1){const m={name:"w:vMerge",type:"element",attributes:{"w:val":"restart"}};e.push(m)}else if(n.continueMerge){const m={name:"w:vMerge",type:"element"};e.push(m)}const{borders:h={}}=n;if(h&&Object.keys(h).length){const m={name:"w:tcBorders",elements:Object.entries(h).map(([y,g])=>g.size?{name:`w:${y}`,attributes:{"w:val":"single","w:color":g.color?g.color.substring(1):"auto","w:sz":Vw(g.size),"w:space":g.space||0}}:{name:`w:${y}`,attributes:{"w:val":"nil"}})};e.push(m)}return{name:"w:tcPr",elements:e}}function JE(t){const e=[],{top:n,right:r,bottom:o,left:i}=t;return n!=null&&e.push({name:"w:top",attributes:{"w:w":Ct(n)}}),r!=null&&e.push({name:"w:right",attributes:{"w:w":Ct(r)}}),o!=null&&e.push({name:"w:bottom",attributes:{"w:w":Ct(o)}}),i!=null&&e.push({name:"w:left",attributes:{"w:w":Ct(i)}}),e}function YE(t){const e={name:"w:bookmarkStart",attributes:{"w:id":t.node.attrs.id,"w:name":t.node.attrs.name}},n={name:"w:bookmarkEnd",attributes:{"w:id":t.node.attrs.id}};return[e,n]}function Jm(t){const e=$r.markTypes.find(i=>i.type===t.type);if(!e)return{};const n={name:e.name,attributes:{}},{attrs:r}=t;let o;switch(t.type){case"bold":case"italic":delete n.attributes,n.type="element";break;case"underline":n.type="element",n.attributes["w:val"]=r.underlineType;break;case"fontSize":o=r.fontSize,n.attributes["w:val"]=o.slice(0,-2)*2;break;case"fontFamily":o=r.fontFamily,["w:ascii","w:eastAsia","w:hAnsi","w:cs"].forEach(s=>{n.attributes[s]=o});break;case"color":let i=r.color.replace(/^#/,"").replace(/;$/,"");i.startsWith("rgb")&&(i=cE(i)),n.attributes["w:val"]=i;break;case"textAlign":n.attributes["w:val"]=r.textAlign;break;case"textIndent":n.attributes["w:firstline"]=ao(r.textIndent);break;case"lineHeight":n.attributes["w:line"]=jw(r.lineHeight);break;case"highlight":n.attributes["w:fill"]=r.color?.substring(1),n.attributes["w:color"]="auto",n.attributes["w:val"]="clear",n.name="w:shd";break}return n}function ZE(t){if(!t)return{};const e=t.split(";")[0].split("/")[1];if(!t||e!=="png")return{originalWidth:void 0,originalHeight:void 0};let n=t.split(",")[1].slice(0,50),r=Uint8Array.from(atob(n),i=>i.charCodeAt(0)),o=new DataView(r.buffer,0,28);return{originalWidth:o.getInt32(16),originalHeight:o.getInt32(20)}}function QE(t,e,n,r){let o=t,i=e,s=Math.min(n/t,r/e);return o=Math.round(o*s),i=Math.round(i*s),{scaledWidth:o,scaledHeight:i}}function Kw(t,e){const{node:{attrs:n={},marks:r=[]},tableCell:o}=t;let i=n.rId;const s=n.src||n.imageSrc,{originalWidth:a,originalHeight:l}=ZE(s);let c=n.size?{w:mi(n.size.width),h:mi(n.size.height)}:e;if(a&&l){const p=En(c.w),h=En(c.h),{scaledWidth:m,scaledHeight:y}=QE(a,l,p,h);c={w:mi(m),h:mi(y)}}if(o){const p=o.attrs.colwidth.reduce((k,w)=>k+w,0),h=o.attrs.cellMargins?.left||8,m=o.attrs.cellMargins?.right||8,y=mi(p-(h+m)),{width:g,height:x}=aA(c.w,c.h,y);g&&x&&(c={w:g,h:x})}if(t.node.type==="image"&&!i){const p=s?.split("word/")[1];i=Km(t,p)}else if(t.node.type==="fieldAnnotation"&&!i){const p=s?.split(";")[0].split("/")[1];if(!p)return Xw(t);const h=Xn(4),m=n.fieldId.replace("-","_"),y=`media/${m}_${h}.${p}`;i=Km(t,y),t.media[`${m}_${h}.${p}`]=s}const u=n.originalPadding||{distT:0,distB:0,distL:0,distR:0},d="http://schemas.openxmlformats.org/drawingml/2006/main",f="http://schemas.openxmlformats.org/drawingml/2006/picture";return Ef({name:"w:drawing",elements:[{name:"wp:inline",attributes:u,elements:[{name:"wp:extent",attributes:{cx:c.w,cy:c.h}},{name:"wp:effectExtent",attributes:{l:0,t:0,r:0,b:0}},{name:"wp:docPr",attributes:{id:0,name:"",descr:""}},{name:"wp:cNvGraphicFramePr",elements:[{name:"a:graphicFrameLocks",attributes:{"xmlns:a":d,noChangeAspect:1}}]},{name:"a:graphic",attributes:{"xmlns:a":d},elements:[{name:"a:graphicData",attributes:{uri:f},elements:[{name:"pic:pic",attributes:{"xmlns:pic":f},elements:[{name:"pic:nvPicPr",elements:[{name:"pic:cNvPr",attributes:{id:0,name:"",desc:""}},{name:"pic:cNvPicPr",elements:[{name:"a:picLocks",attributes:{noChangeAspect:1,noChangeArrowheads:1}}]}]},{name:"pic:blipFill",elements:[{name:"a:blip",attributes:{"r:embed":i,cstate:"none"}},{name:"a:srcRect"},{name:"a:stretch",elements:[{name:"a:fillRect"}]}]},{name:"pic:spPr",attributes:{bwMode:"auto"},elements:[{name:"a:xfrm",elements:[{name:"a:ext",attributes:{cx:c.w,cy:c.h}},{name:"a:off",attributes:{x:0,y:0}}]},{name:"a:prstGeom",attributes:{prst:"rect"},elements:[{name:"a:avLst"}]}]}]}]}]}]}]},[])}function Xw(t){const{node:{attrs:e={},marks:n=[]}}=t,r=oA(e);return xl(e.displayLabel,[...n,...r])}function eA(t){const{node:{attrs:e={},marks:n=[]}}=t,r=oC.decode(e.displayLabel);return xl(r,n)}function tA(t){const{node:{attrs:e={}}}=t,n=new window.DOMParser().parseFromString(e.rawHtml,"text/html"),r=zi.create({doc:Yr.fromSchema(t.editorSchema).parse(n)}).doc.toJSON();return{name:"htmlAnnotation",elements:li({node:r})}}function Ym(t,e){return Kw(t,e)}function nA(t){const{node:{attrs:e={},marks:n=[]}}=t,r=Gw(t,e.linkUrl),o=xl(e.linkUrl,n);return{name:"w:hyperlink",type:"element",attributes:{"r:id":r,"w:history":1},elements:[o]}}function rA(t){const e={w:4286250,h:4286250},n={w:99e4,h:495e3};return{text:Xw,image:r=>Ym(r,e),signature:r=>Ym(r,n),checkbox:eA,html:tA,link:nA}[t]}const oA=(t={})=>{const{fontFamily:e,fontSize:n,bold:r,underline:o,italic:i}=t,s=[];return e&&s.push({type:"fontFamily",attrs:{fontFamily:e}}),n&&s.push({type:"fontSize",attrs:{fontSize:n}}),r&&s.push({type:"bold",attrs:{}}),o&&s.push({type:"underline",attrs:{}}),i&&s.push({type:"italic",attrs:{}}),s};function iA(t){const{node:e,isFinalDoc:n}=t,{attrs:r={}}=e,o=rA(r.type);if(!o)return{};let i,s;if(n)return o(t);i=o(t),s=[i],r.type==="html"&&(s=[...i.elements]);const a="http://schemas.openxmlformats.org/wordprocessingml/2006/main";return{name:"w:sdt",elements:[{name:"w:sdtPr",elements:[{name:"w:tag",attributes:{"w:val":r.fieldId}},{name:"w:alias",attributes:{"w:val":r.displayLabel}},{name:"w:fieldType",attributes:{"xmlns:w":a,"w:val":r.fieldType}},{name:"w:fieldTypeShort",attributes:{"xmlns:w":a,"w:val":r.type}},{name:"w:fieldColor",attributes:{"xmlns:w":a,"w:val":r.fieldColor}},{name:"w:fieldMultipleImage",attributes:{"xmlns:w":a,"w:val":r.multipleImage}}]},{name:"w:sdtContent",elements:s}]}}function sA(){return{name:"w:r",elements:[{name:"w:br",type:"element",attributes:{"w:type":"page"}}]}}var zr,Jw,Vc,Uc;let Zm=class{constructor(e){p0(this,zr),this.converter=e}schemaToXml(e,n=!1){return console.debug("[SuperConverter] schemaToXml:",e),wr(this,zr,Jw).call(this,e,n).join("")}};zr=new WeakSet,Jw=function(t,e=falase){const n=JSON.parse(JSON.stringify(t)),r=this.converter.declaration.attributes,o=`<?xml${Object.entries(r).map(([s,a])=>` ${s}="${a}"`).join("")}?>`,i=wr(this,zr,Uc).call(this,n,e);return[o,...i]},Vc=function(t){if(t)return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},Uc=function(t,e=!1){if(!t)return null;let{name:n}=t;const{elements:r,attributes:o}=t;let i=`<${n}`;for(let l in o){const c=typeof o[l]=="string"?wr(this,zr,Vc).call(this,o[l]):o[l];i+=` ${l}="${c}"`}const s=n&&(!r||!r.length);s?i+=" />":i+=">";let a=[i];if(n==="w:instrText")a.push(r[0].text);else if(n==="w:t"||n==="w:delText"){const l=wr(this,zr,Vc).call(this,r[0].text);a.push(l)}else if(r)for(let l of r){const c=wr(this,zr,Uc).call(this,l);if(!c)continue;const u=c.filter(d=>d!=="<undefined>"&&d!=="</undefined>");a.push(...u)}return s||a.push(`</${n}>`),a};function aA(t,e,n){if(t>n){let r=n/t,o=Math.round(e*r);return{width:n,height:o}}return{width:t,height:e}}const lA='<w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" 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:oel="http://schemas.microsoft.com/office/2019/extlst" 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" mc:Ignorable="w14 w15 w16se w16cid w16 w16cex w16sdtdh wp14"><w:body></w:body></w:document>',cA=t=>JSON.parse(K0.xml2json(t,null,2)),uA=(t,e=lA)=>t["word/document.xml"]||cA(e),dA=t=>{const{nodes:e}=t;if(e.length===0)return{nodes:[],consumed:0};const n=e[0];switch(n.name){case"w:tbl":return{nodes:[pA(n,t)],consumed:1}}return{nodes:[],consumed:0}},fA={handlerName:"tableNodeHandler",handler:dA};function pA(t,e){const{docx:n,nodeListHandler:r}=e,o=t.elements.find(k=>k.name==="w:tblPr"),i=o.elements.find(k=>k.name==="w:tblBorders")?.elements||[],{borders:s,rowBorders:a}=Zw(i),l=o.elements.find(k=>k.name==="w:tblStyle"),c={tableStyleId:l?.attributes["w:val"]},u=o?.elements.find(k=>k.name==="w:tblInd");if(u){const{"w:w":k,"w:type":w}=u.attributes;c.tableIndent={width:ut(k),type:w}}const d=o?.elements.find(k=>k.name==="w:tblLayout");if(d){const{"w:type":k}=d.attributes;c.tableLayout=k}const f=Yw(l,n),p=o.elements.find(k=>k.name==="w:tblW");p&&(c.tableWidth={width:ut(p.attributes["w:w"]),type:p.attributes["w:type"]});const h=o.elements.find(k=>k.name==="w:tblCellSpacing");h&&(c.tableCellSpacing={w:h.attributes["w:w"],type:h.attributes["w:type"]},c.borderCollapse="separate");const m=t.elements.filter(k=>k.name==="w:tr"),y=Object.keys(s)?.length?s:f?.borders,g=Object.keys(a)?.length?a:f?.rowBorders;c.borders=y;const x=[];return m.forEach(k=>{const w=gA(k,t,g,l,e);w.content?.length&&x.push(w)}),{type:"table",content:x,attrs:c}}function hA(t,e,n,r,o=null,i,s){const{docx:a,nodeListHandler:l}=s,c=t.elements.find(U=>U.name==="w:tcPr"),u=c?.elements?.find(U=>U.name==="w:tcBorders"),d=mA(u,r);Qw(n);const f=c?.elements?.find(U=>U.name==="w:tcW");let p=f?ut(f.attributes["w:w"]):null;const h=f?.attributes["w:type"];!p&&o&&(p=o);const m=Qm(t),{attributes:y}=m||{},g={color:c?.elements?.find(U=>U.name==="w:shd")?.attributes["w:fill"]},x=c?.elements?.find(U=>U.name==="w:gridSpan")?.attributes["w:val"],k=c?.elements?.find(U=>U.name==="w:tcMar"),w=c?.elements?.find(U=>U.name==="w:vAlign")?.attributes["w:val"]||"top",T={},D=Yw(i,a)||{};T.cellMargins=yA(k,D);const{fontSize:M,fonts:F={}}=D,C=F.ascii;if(p&&(T.colwidth=[p],T.widthUnit="px"),h&&(T.widthType=h),x&&(T.colspan=Number(x)),g&&(T.background=g),T.verticalAlign=w,M&&(T.fontSize=M),C&&(T.fontFamily=C.ascii),r&&(T.borders={...r}),d&&(T.borders=Object.assign(T.borders||{},d)),y&&y["w:val"]==="restart"){const U=n.elements.filter(G=>G.name==="w:tr"),ie=U.findIndex(G=>G===e),I=U.slice(ie+1);let W=e.elements.filter(G=>G.name==="w:tc").findIndex(G=>G===t),A=1;for(let G of I){const ae=G.elements.findIndex(pe=>pe.name==="w:tc"),X=G.elements[ae+W];if(!X)break;const de=Qm(X),{attributes:J}=de||{};if(!de&&!J||J&&J["w:val"]==="restart")break;A++,G.elements.splice(ae+W,1)}T.rowspan=A}return{type:"tableCell",content:l.handler({...s,nodes:t.elements}),attrs:T}}const Qm=t=>t.elements.find(e=>e.name==="w:tcPr")?.elements?.find(e=>e.name==="w:vMerge"),zs=(t,e,n={})=>{const r=t?.elements?.find(o=>o.name===`w:${e}`)?.attributes;if(r&&r["w:val"]!=="nil"){const o={},i=r["w:color"];i&&(o.color=i==="auto"?"#000000":`#${i}`);const s=r["w:sz"];return s&&(o.size=qw(s)),o}if(r&&r["w:val"]==="nil"){const o=Object.assign({},n[e]||{});return Object.keys(o)?(o.val="none",o):null}return null},mA=(t,e)=>{if(!t)return null;const n={},r=zs(t,"bottom",e);r&&(n.bottom=r);const o=zs(t,"top",e);o&&(n.top=o);const i=zs(t,"left",e);i&&(n.left=i);const s=zs(t,"right",e);return s&&(n.right=s),n};function Yw(t,e,n){if(!t)return null;const r={},{attributes:o={}}=t,i=o["w:val"];if(!i)return null;const s=e["word/styles.xml"],{elements:a}=s.elements[0],l=a.filter(m=>m.name==="w:style"),c=l.find(m=>m.attributes["w:styleId"]===i);if(!c)return null;r.name=c.elements.find(m=>m.name==="w:name");const u=c.elements.find(m=>m.name==="w:basedOn");c.elements.find(m=>m.name==="w:uiPriority");let d;if(u?.attributes){const m=l.find(y=>y.attributes["w:styleId"]===u.attributes["w:val"]);d=m?m.elements.find(y=>y.name==="w:tblPr"):{}}const f=c.elements.find(m=>m.name==="w:pPr");if(f){const m=f.elements.find(y=>y.name==="w:jc");m?.attributes&&(r.justification=m.attributes["w:val"])}const p=c?.elements.find(m=>m.name==="w:rPr");if(p){const m=p.elements.find(g=>g.name==="w:rFonts");if(m){const{"w:ascii":g,"w:hAnsi":x,"w:cs":k}=m.attributes;r.fonts={ascii:g,hAnsi:x,cs:k}}const y=p.elements.find(g=>g.name==="w:sz");y?.attributes&&(r.fontSize=rE(y.attributes["w:val"])+"pt")}const h=c.elements.find(m=>m.name==="w:tblPr");if(h&&h.elements){d&&d.elements&&h.elements.push(...d.elements);const m=h?.elements?.find(w=>w.name==="w:tblBorders"),{elements:y=[]}=m||{},{borders:g,rowBorders:x}=Zw(y);g&&(r.borders=g),x&&(r.rowBorders=x);const k=h?.elements.find(w=>w.name==="w:tblCellMar");if(k){const w=k.elements.find(F=>F.name==="w:left"),T=k.elements.find(F=>F.name==="w:right"),D=k.elements.find(F=>F.name==="w:top"),M=k.elements.find(F=>F.name==="w:bottom");r.cellMargins={marginLeft:w?.attributes["w:w"],marginRight:T?.attributes["w:w"],marginTop:D?.attributes["w:w"],marginBottom:M?.attributes["w:w"]}}}return r}function Zw(t){const e={},n={};return t.forEach(r=>{const{name:o}=r,i=o.split("w:")[1],{attributes:s}=r,a={},l=s["w:color"],c=s["w:sz"];l&&l!=="auto"&&(a.color=l.startsWith("#")?l:`#${l}`),c&&c!=="auto"&&(a.size=qw(c)),["insideH","insideV"].includes(i)&&(n[i]=a),e[i]=a}),{borders:e,rowBorders:n}}function gA(t,e,n,r,o){const i={},s=t.elements.find(d=>d.name==="w:trPr")?.elements?.find(d=>d.name==="w:trHeight"),a=s?.attributes["w:val"];s?.attributes["w:hRule"];const l={};n?.insideH&&(l.bottom=n.insideH),n?.insideV&&(l.right=n.insideV),i.borders=l,a&&(i.rowHeight=ut(a));const c=Qw(e),u=t.elements.filter(d=>d.name==="w:tc");return{type:"tableRow",content:u?.map((d,f)=>{const p=u.length>1?c[f]:null;return hA(d,t,e,l,p,r,o)})||[],attrs:i}}const yA=(t,e)=>{const n=t?.elements?.find(m=>m.name==="w:left"),r=t?.elements?.find(m=>m.name==="w:right"),o=t?.elements?.find(m=>m.name==="w:top"),i=t?.elements?.find(m=>m.name==="w:bottom"),s=n?.attributes["w:w"],a=r?.attributes["w:w"],l=o?.attributes["w:w"],c=i?.attributes["w:w"],{cellMargins:u={}}=e,{marginLeft:d,marginRight:f,marginTop:p,marginBottom:h}=u;return{left:ut(s??d),right:ut(a??f),top:ut(l??p),bottom:ut(c??h)}},Qw=t=>t.elements.find(e=>e.name==="w:tblGrid")?.elements?.flatMap(e=>e.name!=="w:gridCol"?[]:ut(e.attributes["w:w"]))||{},bA=t=>{const{nodes:e,filename:n}=t;if(e.length===0||e[0].name!=="w:drawing")return{nodes:[],consumed:0};const r=e[0];let o;const{elements:i}=r,s=n||null;i.find(l=>l.name==="wp:anchor")&&(o=eg(i[0],s,t));const a=i.find(l=>l.name==="wp:inline");return a&&(o=eg(a,s,t)),{nodes:o?[o]:[],consumed:1}};function eg(t,e,n){const{docx:r}=n,{attributes:o}=t,i={top:En(o.distT),bottom:En(o.distB),left:En(o.distL),right:En(o.distR)},s=t.elements.find(D=>D.name==="wp:extent"),a={width:En(s.attributes?.cx),height:En(s.attributes?.cy)},l=t.elements.find(D=>D.name==="a:graphic").elements.find(D=>D.name==="a:graphicData").elements.find(D=>D.name==="pic:pic");if(!l||!l.elements)return null;const c=l.elements.find(D=>D.name==="pic:blipFill").elements.find(D=>D.name==="a:blip"),u=t.elements.find(D=>D.name==="wp:positionH")?.elements.find(D=>D.name==="wp:posOffset"),d=En(u?.elements[0]?.text),f=t.elements.find(D=>D.name==="wp:positionV")?.elements.find(D=>D.name==="wp:posOffset"),p=En(f?.elements[0]?.text),h={left:d,top:p},{attributes:m}=c,y=m["r:embed"];let g=r[`word/_rels/${e||"document.xml"}.rels`];g||(g=r["word/_rels/document.xml.rels"]);const x=g.elements.find(D=>D.name==="Relationships"),{elements:k}=x,w=k.find(D=>D.attributes.Id===y),{attributes:T}=w;return{type:"image",attrs:{src:`word/${T.Target}`,alt:"Image",inline:!0,padding:i,marginOffset:h,size:a,originalPadding:{distT:o.distT,distB:o.distB,distL:o.distL,distR:o.distR},rId:T.Id}}}const wA={handlerName:"drawingNodeHandler",handler:bA};function Go(t,e=[],n=null){const r=[],o=new Set;return t?.elements?.forEach(i=>{const s=$r.markTypes.filter(a=>a.name===i.name);s.length||["w:shd","w:rStyle","w:pStyle","w:numPr","w:outlineLvl","w:bdr","w:pBdr","w:noProof","w:contextualSpacing","w:keepNext","w:tabs","w:keepLines"].includes(i.name)&&e.push(i.name),s.forEach(a=>{if(!a||o.has(a.type))return;o.add(a.type);const{attributes:l={}}=i,c={type:a.type};if(!(l["w:val"]=="0"||l["w:val"]==="none")){if(a.mark&&(c.type=a.mark),Object.keys(l).length){const u=xA(a.type,l,n);if(u==null)return;c.attrs={},c.attrs[a.property]=u}r.push(c)}})}),Yu(r)}function vA(t,e){const n=t.elements?.find(s=>s.name==="w:rPrChange");if(!n)return[];const{attributes:r}=n,o={id:r["w:id"],date:r["w:date"],author:r["w:author"],authorEmail:r["w:authorEmail"]},i=Go(n);return[{type:bt,attrs:{...o,before:i,after:[...e]}}]}function Yu(t){const e=t.filter(o=>o.type==="textStyle"),n=t.filter(o=>o.type!=="textStyle"),r={};return e.length&&e.forEach(o=>{const{attrs:i={}}=o;Object.keys(i).forEach(s=>{r[s]=i[s]})}),[...n,{type:"textStyle",attrs:r}]}function xA(t,e,n){t==="tabs"&&(t="textIndent");const r={color:()=>`#${e["w:val"]}`,fontSize:()=>`${e["w:val"]/2}pt`,textIndent:()=>SA(e),fontFamily:()=>kA(e,n),lineHeight:()=>CA(e),textAlign:()=>e["w:val"],link:()=>e.href,underline:()=>e["w:val"],bold:()=>e?.["w:val"]||null,italic:()=>e?.["w:val"]||null,highlight:()=>EA(e)};if(t in r||console.debug("❗️❗️ No value mapper for:",t,"Attributes:",e),t in r)return r[t],r[t]()}function kA(t,e){const n=t["w:ascii"],r=t["w:asciiTheme"];if(!e||!r)return n;const o=e["word/theme/theme1.xml"];if(!o)return n;const{elements:i}=o,{elements:s}=i[0];return s.find(a=>a.name==="a:themeElements").elements.find(a=>a.name==="a:fontScheme").elements.find(a=>a.name==="a:majorFont").elements.find(a=>a.name==="a:latin").attributes.typeface}function SA(t){let e=t["w:left"];return e?`${Wt(e)}in`:null}function CA(t){let e=t["w:line"];return!e||e==="0"?null:`${zo(e)}`}function EA(t){return t["w:fill"]?`#${t["w:fill"]}`:aE(t?.["w:val"])?`#${t["w:val"]}`:sE(t?.["w:val"])||null}function ci(t,e){const n=[],r=[],{attributes:o={},elements:i=[]}=t,{nodes:s,paragraphProperties:a={},runProperties:l={}}=AA(i);return i.find(c=>c.name==="w:r")&&(a.elements=a?.elements?.filter(c=>c.name!=="w:rPr")),l&&l?.elements?.length&&n.push(...Go(l,r)),a&&a.elements?.length&&n.push(...Go(a,r)),n.push(...vA(l,n)),a&&a.elements?.length&&(o.paragraphProperties=a),n&&t.name==="w:p"&&n.forEach(c=>{const u=Object.keys(c.attrs??{})[0];if(u){const d=c.attrs[u];o[u]=d}}),{elements:s,attributes:o,marks:n,unknownMarks:r}}function AA(t){const e=t.find(o=>o.name==="w:pPr"),n=t.find(o=>o.name==="w:rPr"),r=t.find(o=>o.name==="w:sectPr");return{nodes:t.filter(o=>o.name!=="w:pPr"&&o.name!=="w:rPr"&&o.name!=="w:sectPr"),paragraphProperties:e,runProperties:n,sectionProperties:r}}function ya(t){return $r.allowedElements[t.name||t.type]}const $A=t=>!!$r.propertyTypes[t.name||t.type];function ev(t){return t.filter(e=>e.name==="w:r").some(e=>e.elements.some(n=>n.name==="w:t"))}const TA=t=>{const{nodes:e,nodeListHandler:n}=t;if(e.length===0||!(e[0].name==="w:del"||e[0].name==="w:ins"))return{nodes:[],consumed:0};const r=e[0],{name:o}=r,{attributes:i,elements:s}=ci(r),a=n.handler({...t,insideTrackChange:!0,nodes:s}),l=o==="w:del"?lt:It,c={id:i["w:id"],date:i["w:date"],author:i["w:author"],authorEmail:i["w:authorEmail"]};return a.forEach(u=>{u.marks===void 0&&(u.marks=[]),u.marks.push({type:l,attrs:c})}),{nodes:a,consumed:1}},OA={handlerName:"trackChangeNodeHandler",handler:TA},DA=t=>{const{nodes:e,docx:n,nodeListHandler:r}=t;if(e.length===0||e[0].name!=="w:hyperlink")return{nodes:[],consumed:0};const o=e[0],i=n["word/_rels/document.xml.rels"].elements.find(m=>m.name==="Relationships"),{elements:s}=i,{attributes:a}=o,l=a["r:id"],c=a["w:anchor"];a["w:history"];const u=s.find(m=>m.attributes.Id===l)||{},{attributes:d={}}=u;let f=d.Target;c&&!f&&(f=`#${c}`);const p=o.elements.filter(m=>m.name==="w:r"),h={type:"link",attrs:{href:f,rId:l}};for(const m of p){m.marks||(m.marks=[]),m.marks.push(h);const y=m.elements.find(g=>g.name==="w:rPr");if(y&&y.elements.find(g=>g.name==="w:rStyle")){const g=n["word/styles.xml"],{elements:x}=g.elements[0],k=x.filter(w=>w.name==="w:style").find(w=>w.attributes["w:styleId"]==="Hyperlink")?.elements?.find(w=>w.name==="w:rPr");k&&m.elements.unshift(k)}}return{nodes:r.handler({...t,nodes:p}),consumed:1}},MA={handlerName:"hyperlinkNodeHandler",handler:DA},_A=t=>{const{nodes:e,nodeListHandler:n,parentStyleId:r,docx:o}=t;if(e.length===0||e[0].name!=="w:r")return{nodes:[],consumed:0};const i=e[0],s={...t,nodes:i.elements};let a=n.handler(s)?.filter(u=>u)||[];const l=i.elements?.some(u=>u.name==="w:rPr"),c=NA(o,r);if(l){const{marks:u=[],attributes:d={}}=ci(i),f=u.find(h=>h.type==="textStyle"),p=f&&Object.keys(f.attrs).length>0;c.marks&&!p&&u.push(...c.marks),i.marks&&u.push(...i.marks),a=a.map(h=>({...h,marks:Yu(u),attributes:d}))}else c.marks&&(a=a.map(u=>({...u,marks:Yu(c.marks)})));return{nodes:a,consumed:1}},NA=(t,e)=>{const n=t?.["word/styles.xml"];if(!n)return{};const r=n.elements[0].elements.filter(o=>o.name==="w:style").find(o=>o.attributes["w:styleId"]===e)||{};return r?ci(r):{}},IA={handlerName:"runNodeHandler",handler:_A},FA=t=>{const{nodes:e,insideTrackChange:n}=t;if(e.length===0||!(e[0].name==="w:t"||n&&e[0].name==="w:delText"))return{nodes:[],consumed:0};const r=e[0],{type:o}=r,{attributes:i,elements:s,marks:a=[]}=ci(r);let l;if(s.length===1)l=s[0].text;else if(!s.length&&"attributes"in r&&r.attributes["xml:space"]==="preserve")l=" ";else return{nodes:[],consumed:0};return{nodes:[{type:ya(r),text:l,attrs:{type:o,attributes:i||{}},marks:a}],consumed:1}},BA={handlerName:"textNodeHandler",handler:FA},tv=t=>Object.prototype.toString.call(t)==="[object RegExp]";function Ko(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:tv(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}const nv=t=>{if(!t||!Array.isArray(t))return t;let e=[],n=null;for(let r of t)r.type==="text"?n&&RA(n,r)?n={...n,text:n.text+=r.text}:(n&&e.push(n),n={...r}):(n&&(e.push(n),n=null),e.push(r));return n&&e.push(n),e},RA=(t,e)=>{if(!t||!e)return!1;let n=t.marks??[],r=e.marks??[];if(n.length!==r.length)return!1;for(let o=0;o<n.length;o++)if(n[o].type!==r[o].type||!LA(n[o].attrs,r[o].attrs))return!1;return!0},LA=(t={},e={})=>Ko(t,e);function rv(t,e,n){this.name=t,this.message=e||"",this.details=n;const r=new Error(this.message);this.stack=r.stack,r.name=this.name}rv.prototype=Object.create(Error.prototype);const PA=t=>{const{nodes:e}=t;if(e.length===0||e[0].name!=="w:p")return{nodes:[],consumed:0};const n=yn(e[0]),r=sv(n.elements);if(n.elements=r,n.elements.find(o=>o.name==="w:pPr"),Zu(n)){const o=yn(e),i=[];let s=o.shift();for(;s&&Zu(s,!0);)i.push(s),s=o.shift(),s?.elements&&!ev(s.elements)&&(i.push(s),s=o.shift());return{nodes:[ov(i,t,0)],consumed:i.filter(a=>a.seen).length}}else return{nodes:[],consumed:0}},zA={handlerName:"listHandler",handler:PA};function ov(t,e,n=0,r=0,o=null,i="",s=!1){const{docx:a,nodeListHandler:l,insideTrackChange:c}=e,u=[];let d,f;const p=l.handlerEntities.find(w=>w.handlerName==="standardNodeHandler")?.handler;if(!p)return console.error("Standard node handler not found"),{nodes:[],consumed:0};let h={};const m=t[0].elements.find(w=>w.name==="w:pPr")?.elements?.find(w=>w.name==="w:numPr"),y=m?.elements?.find(w=>w.name==="w:numId")||{},{attributes:g={}}=y;o=g["w:val"],r=parseInt(m?.elements?.find(w=>w.name==="w:ilvl")?.attributes["w:val"])||0;let x=0;for(let[w,T]of t.entries()){if(T.seen)continue;if(T.elements&&!ev(T.elements)){const re=p({...e,nodes:[T]}).nodes[0];re&&u[u.length-1]?.content.push(re),T.seen=!0;continue}const{attributes:D,elements:M,marks:F=[]}=ci(T),C=F.find(re=>re.type==="textStyle"),{listType:U,listOrderingType:ie,ilvl:I,listrPrs:W,listpPrs:A,start:G,lvlText:ae,lvlJc:X,numId:de}=UA(D,n,a);f=ie;const J=parseInt(I),pe=r===J&&de===o,Q=VA({firstListId:de,secondListId:o,level:J,pStyleId:null,docx:a}),B=de!==o&&!Q,ee=n<J||n===J&&B&&x===n,Z={};if(pe){d=U,T.seen=!0;const re=[];let K={type:"paragraph",content:l.handler({...e,nodes:[D.paragraphProperties,...M]})?.filter(H=>H)};K.content&&(K={...K,attrs:{textAlign:C?.attrs.textAlign||null,rsidRDefault:D?.["w:rsidRDefault"]||null},content:nv(K.content)}),re.push(K),x=n,J in h?h[J]+=1:h[J]=parseInt(G);let $=[];f!=="bullet"&&($=[...i,h[J]]),A&&(Z.listParagraphProperties=A),W&&(Z.listRunProperties=W),Z.textStyle=C,Z.order=G,Z.lvlText=ae,Z.lvlJc=C?.attrs.textAlign,Z.listLevel=$,Z.listNumberingType=ie,Z.attributes={parentAttributes:T?.attributes||null},Z.numId=de,a&&(Z.spacing=iv(T,a));const E=tg(re,Z,[]);u.push(E)}else if(ee){const re=[...i,h[n]],K=ov(t.slice(w),e,n+1,n,de,re,!0);x=K.lastNestedListLevel,delete K.lastNestedListLevel;const $=u[u.length-1];$?$.content.push(K):u.push(tg([K],Z,[]))}else{x=n;break}}const k={type:d||"bulletList",content:u,attrs:{"list-style-type":f,attributes:{parentAttributes:t[0]?.attributes||null}}};return s&&(k.lastNestedListLevel=x),k}function Zu(t,e=!1){const{elements:n}=t,r=n?.find(s=>s.name==="w:pPr");if(!r)return!1;const o=r.elements?.find(s=>s.name==="w:pStyle")?.attributes["w:val"]==="ListParagraph",i=r.elements?.find(s=>s.name==="w:numPr");return o||i}function tg(t,e,n){return{type:"listItem",content:t,attrs:e,marks:n}}const jA=["decimal","decimalZero","lowerRoman","upperRoman","lowerLetter","upperLetter","ordinal","cardinalText","ordinalText","hex","chicago","none"],qA=["bullet","square","circle","disc"],VA=({firstListId:t,secondListId:e,level:n,pStyleId:r,docx:o})=>{const{numFmt:i,lvlText:s,lvlJc:a}=Ra(t,n,r,o),{numFmt:l,lvlText:c,lvlJc:u}=Ra(e,n,r,o);return i===l&&s===c&&a===u},ng=(t,e)=>{const n=e["word/styles.xml"];if(!n)return null;const{elements:r}=n,o=r[0].elements.filter(h=>h.name==="w:style"),i=o.find(h=>h.attributes["w:styleId"]===t)||{},s=i?.elements?.find(h=>h.name==="w:pPr");if(!s)return null;let a=s?.elements?.find(h=>h.name==="w:numPr");if(!a)return null;let l=a?.elements?.find(h=>h.name==="w:numId")||{},c=l?.attributes?.["w:val"],u=a?.elements?.find(h=>h.name==="w:ilvl"),d=u?.attributes?.["w:val"];const f=i?.elements?.find(h=>h.name==="w:basedOn")?.attributes?.["w:val"];let p=0;for(;a&&!c&&p<10;)a=(o.find(h=>h.attributes["w:styleId"]===f)||{})?.elements?.find(h=>h.name==="w:pPr")?.elements?.find(h=>h.name==="w:numPr"),l=a?.elements?.find(h=>h.name==="w:numId")||{},c=l?.attributes?.["w:val"],u||(u=a?.elements?.find(h=>h.name==="w:ilvl"),d=u?.attributes?.["w:val"]),p++;return{numId:c,ilvl:d}},Ra=(t,e,n,r)=>{const o=r["word/numbering.xml"];if(!o)return{};const{elements:i}=o,s=i[0];if(n){const{numId:k,ilvl:w}=ng(n,r)||{};k&&(t=k),w&&(e=w?parseInt(w):null)}const a=s.elements,l=a.filter(k=>k.name==="w:abstractNum"),c=a.filter(k=>k.name==="w:num").find(k=>k.attributes["w:numId"]===t)?.elements[0].attributes["w:val"],u=l?.find(k=>k.attributes["w:abstractNumId"]===c),d=HA(u,e),f=u?.elements?.find(k=>k.name==="w:numStyleLink")?.attributes["w:val"];if(f){const k=ng(f,r);return Ra(k.numId,e,null,r)}const p=d?.elements?.find(k=>k.name==="w:start")?.attributes["w:val"],h=d?.elements?.find(k=>k.name==="w:numFmt")?.attributes["w:val"],m=d?.elements?.find(k=>k.name==="w:lvlText").attributes["w:val"],y=d?.elements?.find(k=>k.name==="w:lvlJc").attributes["w:val"],g=d?.elements?.find(k=>k.name==="w:pPr"),x=d?.elements?.find(k=>k.name==="w:rPr");return{start:p,numFmt:h,lvlText:m,lvlJc:y,pPr:g,rPr:x}};function UA(t,e,n){if(!t)return;const{paragraphProperties:r={}}=t,{elements:o=[]}=r,i=o.find(x=>x.name==="w:numPr");if(!i)return{};const s=i.elements.find(x=>x.name==="w:ilvl").attributes["w:val"],a=i.elements.find(x=>x.name==="w:numId").attributes["w:val"],l=o.find(x=>x.name==="w:pStyle")?.attributes["w:val"],{start:c,numFmt:u,lvlText:d,lvlJc:f,pPr:p,rPr:h}=Ra(a,e,l,n);let m,y;p&&(m=WA(p)),h&&(y=GA(h));let g;if(qA.includes(u?.toLowerCase()))g="bulletList";else if(jA.includes(u))g="orderedList";else throw new rv("ListParsingError",`Unknown list type found during import: ${u}`,{listOrderingType:u,ilvl:s,numId:a,listrPrs:y,listpPrs:m,start:c,lvlText:d,lvlJc:f});return{listType:g,listOrderingType:u,ilvl:s,numId:a,listrPrs:y,listpPrs:m,start:c,lvlText:d,lvlJc:f}}function HA(t,e){return t?.elements?.find(n=>Number(n.attributes["w:ilvl"])===e)}function WA(t){const{elements:e}=t,n=["w:ind","w:jc","w:tabs"],r={};return e&&e.forEach(o=>{n.includes(o.name);const{attributes:i={}}=o;Object.keys(i).forEach(s=>{r[s]=i[s]})}),r}function GA(t){const{elements:e}=t,n=["w:rFonts","w:b","w:bCs","w:i","w:iCs","w:strike","w:dstrike","w:color","w:sz","w:szCs","w:u","w:bdr","w:shd","w:vertAlign","w:jc","w:spacing","w:w","w:smallCaps","w:position","w:lang"],r={};return e&&e.forEach(o=>{n.includes(o.name);const{attributes:i={}}=o;Object.keys(i).forEach(s=>{r[s]=i[s]})}),r}const KA=t=>{const{nodes:e,docx:n,nodeListHandler:r,filename:o}=t;if(e.length===0||e[0].name!=="w:p")return{nodes:[],consumed:0};const i=yn(e[0]);let s;const a=sv(i.elements);if(i.elements=a,Zu(i))return{nodes:[],consumed:0};const l=r.handlerEntities.find(x=>x.handlerName==="standardNodeHandler")?.handler;if(!l)return console.error("Standard node handler not found"),{nodes:[],consumed:0};const c={...t,nodes:[i]},u=l(c);u.nodes.length===1&&(s=u.nodes[0]);const d=i.elements?.find(x=>x.name==="w:pPr"),f=d?.elements?.find(x=>x.name==="w:pStyle"),p=d?.elements?.find(x=>x.name==="w:rPr");p&&(s.attrs.marksAttrs=Go(p,[])),f&&(s.attrs.styleId=f.attributes["w:val"]);const h=d?.elements?.find(x=>x.name==="w:ind");if(h&&h.attributes){const{"w:left":x,"w:right":k,"w:firstLine":w,"w:hanging":T}=h?.attributes;s.attrs&&(s.attrs.indent||(s.attrs.indent={}),x&&(s.attrs.indent.left=ut(x)),k&&(s.attrs.indent.right=ut(k)),w&&(s.attrs.indent.firstLine=ut(w)),T&&(s.attrs.indent.hanging=ut(T)));const D=x-parseInt(T||0)||0;D&&(s.attrs.textIndent=`${Wt(D)}in`)}const m=d?.elements?.find(x=>x.name==="w:jc");m&&m.attributes&&(s.attrs.textAlign=m.attributes["w:val"]);const y=d?.elements?.find(x=>x.name==="w:keepLines");y&&y.attributes&&(s.attrs.keepLines=y.attributes["w:val"]);const g=d?.elements?.find(x=>x.name==="w:keepNext");if(g&&g.attributes&&(s.attrs.keepNext=g.attributes["w:val"]),n){const x=i.attributes?.["w:rsidRDefault"];s.attrs.spacing=iv(i,n,s.attrs.styleId,s.attrs.marksAttrs),s.attrs.rsidRDefault=x}return s.attrs.filename=o,s&&s.content&&(s={...s,content:nv(s.content)}),{nodes:s?[s]:[],consumed:1}},iv=(t,e,n="",r=[])=>{const o={lineSpaceAfter:0,lineSpaceBefore:0,line:0,lineRule:null},{spacing:i={}}=XA(e,n);let s,a,l,c;const u=t.elements?.find(y=>y.name==="w:pPr")?.elements?.find(y=>y.name==="w:spacing")?.attributes||{},d=r.find(y=>y.type==="textStyle")?.attrs?.fontSize,f=u?.["w:line"]||l||i?.["w:line"];f&&(o.line=zo(f));const p=u?.["w:before"]||a||i?.["w:before"];p&&(o.lineSpaceBefore=ut(p)),u?.["w:beforeAutospacing"]==="1"&&d&&(o.lineSpaceBefore+=Math.round(parseInt(d)*.5*96/72));const h=u?.["w:after"]||s||i?.["w:after"];h&&(o.lineSpaceAfter=ut(h)),u?.["w:afterAutospacing"]==="1"&&d&&(o.lineSpaceAfter+=Math.round(parseInt(d)*.5*96/72));const m=u?.["w:lineRule"]||c||i?.["w:lineRule"];return m&&(o.lineRule=m),o},XA=(t,e="")=>{const n=t["word/styles.xml"];if(!n)return{};const r=(n.elements[0].elements?.find(c=>c.name==="w:docDefaults")).elements.find(c=>c.name==="w:pPrDefault")?.elements?.find(c=>c.name==="w:pPr")?.elements?.find(c=>c.name==="w:spacing")||{},o=n.elements[0].elements?.find(c=>c.name==="w:style"&&c.attributes["w:styleId"]==="Normal")?.elements?.find(c=>c.name==="w:pPr")?.elements?.find(c=>c.name==="w:spacing")||{};let i={};e&&(i=n.elements[0].elements?.find(c=>c.name==="w:style"&&c.attributes["w:styleId"]===e)?.elements?.find(c=>c.name==="w:pPr")?.elements?.find(c=>c.name==="w:spacing")||{});const{attributes:s}=r,{attributes:a}=o,{attributes:l}=i;return{spacing:l||s||a}},JA={handlerName:"paragraphNodeHandler",handler:KA};function YA(t,e){const n={lineSpaceBefore:null,lineSpaceAfter:null};if(!t)return n;const r=e["word/styles.xml"];if(!r)return n;const{elements:o}=r.elements[0],i=o.filter(ae=>{const{attributes:X}=ae;return X&&X["w:styleId"]===t}),s=i[0];if(!s)return n;const a=i.find(ae=>ae.elements.find(X=>X.name==="w:qFormat")),l=i.find(ae=>ae.elements.some(X=>X.name==="w:name"))?.elements.find(ae=>ae.name==="w:name")?.attributes["w:val"],c=s.elements.find(ae=>ae.name==="w:pPr"),u=c?.elements?.find(ae=>ae.name==="w:spacing"),d=c?.elements?.find(ae=>ae.name==="w:jc"),f=c?.elements?.find(ae=>ae.name==="w:ind");let p,h,m;u&&(p=ut(u?.attributes["w:before"]),h=ut(u?.attributes["w:after"]),m=zo(u?.attributes["w:line"]));let y,g,x,k;f&&(y=d?.attributes["w:val"],g=ut(f?.attributes["w:left"]),x=ut(f?.attributes["w:right"]),k=ut(f?.attributes["w:firstLine"]));const w=c?.elements?.find(ae=>ae.name==="w:keepNext"),T=c?.elements?.find(ae=>ae.name==="w:keepLines"),D=c?.elements?.find(ae=>ae.name==="w:outlineLvl"),M=D?.attributes["w:val"],F=c?.elements?.find(ae=>ae.name==="w:pageBreakBefore");let C=0;F&&(F.attributes?.["w:val"]?C=Number(F?.attributes?.["w:val"]):C=1);const U=c?.elements?.find(ae=>ae.name==="w:pageBreakAfter");let ie;U&&(U.attributes?.["w:val"]?ie=Number(U?.attributes?.["w:val"]):ie=1);const I={name:l,qFormat:!!a,keepNext:!!w,keepLines:!!T,outlineLevel:D?parseInt(M):null,pageBreakBefore:!!C,pageBreakAfter:!!ie},W=s.elements.find(ae=>ae.name==="w:rPr"),A=Go(W,[],e)||{},G={spacing:{lineSpaceAfter:h,lineSpaceBefore:p,line:m},textAlign:y,indent:{leftIndent:g,rightIndent:x,firstLine:k}};return A.forEach(ae=>{const{type:X,attrs:de}=ae;if(X==="textStyle"){Object.entries(de).forEach(([J,pe])=>{G[Ba(J)]=pe});return}G[X]=de}),{attrs:I,styles:G}}function sv(t){const e=[],n=[];let r=!1;return t?.forEach(o=>{const i=o.elements?.find(s=>s.name==="w:fldChar");if(i){const s=i.attributes["w:fldCharType"];s==="begin"?(r=!0,n.push(o)):s==="end"&&(n.push(o),r=!1)}else e.push(o);if(r)n.push(o);else if(!r&&n.length){const s=n.findIndex(p=>p.elements?.some(h=>h.name==="w:fldChar"&&h.attributes["w:fldCharType"]==="separate")),a=n.findIndex(p=>p.elements?.some(h=>h.name==="w:fldChar"&&h.attributes["w:fldCharType"]==="end")),l=n.slice(s+1,a),c=n.find(p=>p.elements?.some(h=>h.name==="w:instrText"))?.elements[0]?.elements[0].text?.match(/HYPERLINK\s+"([^"]+)"/);if(!c||c?.length<2)return[];const u=c[1],d=[];l.forEach(p=>{const h=p.elements.find(y=>y.name==="w:rPr");if(!h)return;const{elements:m}=h;m.forEach(y=>{d.push(y)})});const f={name:"w:rPr",type:"element",elements:[{name:"link",attributes:{href:u}},...d]};e.push({name:"w:r",type:"element",elements:[f,...l]})}}),e}const ZA=t=>nodeListHandler.handler({...t,nodes:node.elements}),QA=t=>{const{nodes:e}=t;if(e.length===0||e[0].name!=="w:sdt")return{nodes:[],consumed:0};const n=e[0],r=n.elements.find(s=>s.name==="w:sdtPr")?.elements.find(s=>s.name==="w:docPartObj")?.elements.find(s=>s.name==="w:docPartGallery")?.attributes["w:val"];if(!r)return{nodes:[],consumed:0};if(!rg[r])return{nodes:[],consumed:0};const o=n?.elements.find(s=>s.name==="w:sdtContent"),i=rg[r];return{nodes:i({...t,nodes:[o]}),consumed:1}},rg={"Table of Contents":ZA},e$=t=>{const{nodes:e,docx:n,nodeListHandler:r,insideTrackChange:o}=t;if(e.length===0||e[0].name!=="w:sdt")return{nodes:[],consumed:0};const i=e[0],s=i.elements.find(x=>x.name==="w:sdtPr"),a=i.elements.find(x=>x.name==="w:sdtContent"),{attrs:l,marks:c}=t$(a);if(s?.elements.find(x=>x.name==="w:docPartObj"))return QA({nodes:e,docx:n,nodeListHandler:r,insideTrackChange:o});const u=s?.elements.find(x=>x.name==="w:alias"),d=s?.elements.find(x=>x.name==="w:tag"),f=s?.elements.find(x=>x.name==="w:fieldType")?.attributes["w:val"],p=s?.elements.find(x=>x.name==="w:fieldTypeShort")?.attributes["w:val"],h=s?.elements.find(x=>x.name==="w:fieldColor")?.attributes["w:val"],m=s?.elements.find(x=>x.name==="w:fieldMultipleImage")?.attributes["w:val"],y={type:p,fieldId:d?.attributes["w:val"],displayLabel:u?.attributes["w:val"],fieldType:f,fieldColor:h,multipleImage:m==="true"};if(!y.fieldId||!y.displayLabel)return{nodes:[],consumed:0};let g={type:"text",text:`{{${y.displayLabel}}}`,attrs:{...y,...l},marks:c};return t.editor.options.annotations&&(g={type:"fieldAnnotation",attrs:{...y,...l}}),{nodes:[g],consumed:1}},t$=(t={})=>{const e=t.elements?.find(i=>i.name==="w:r")?.elements?.find(i=>i.name==="w:rPr");if(!e)return{};const n=Go(e,[])||[],r=[];n.forEach(i=>{const{type:s}=i;if(s==="textStyle"){const{attrs:a}=i;Object.keys(a).forEach(l=>{r.push({type:l,attrs:a[l]})})}else r.push(i)});const o={};return r?.forEach(i=>{const{type:s}=i;o[s]=i.attrs||!0}),{attrs:o,marks:n}},n$={handlerName:"annotationNodeHandler",handler:e$},r$=t=>{const{nodes:e,docx:n,nodeListHandler:r}=t;if(!e||e.length===0)return{nodes:[],consumed:0};const o=e[0],{name:i}=o,{attributes:s,elements:a,marks:l=[]}=ci(o);if(i==="w:sdt")return{nodes:[],consumed:0};if($A(o))return{nodes:[{type:ya(o),attrs:{...s},marks:[]}],consumed:0};if(!ya(o))return{nodes:[{type:i,content:a,attrs:{...s},marks:l}],consumed:0,unhandled:!0};const c=[],u=o$(o);if(a&&a.length){const d=a.map(h=>(h.marks||(h.marks=[]),h.marks.push(...l),h)),f={...t,nodes:d,parentStyleId:u},p=r.handler(f);c.push(...p)}return{nodes:[{type:ya(o),content:c,attrs:{...s},marks:[]}],consumed:1}},o$=t=>{const e=t.elements?.find(n=>n.name==="w:pPr")?.elements?.find(n=>n.name==="w:pStyle");return e?e.attributes["w:val"]:null},i$={handlerName:"standardNodeHandler",handler:r$},s$=t=>{const{nodes:e}=t;return e.length===0||e[0].name!=="w:br"?{nodes:[],consumed:0}:{nodes:[{type:e[0].attributes?.["w:type"]==="page"?"hardBreak":"lineBreak"}],consumed:1}},a$={handlerName:"lineBreakNodeHandler",handler:s$},l$=t=>{const{nodes:e,nodeListHandler:n}=t;if(e.length===0||e[0].name!=="w:bookmarkStart")return{nodes:[],consumed:0};const r=e[0],o=n.handlerEntities.find(a=>a.handlerName==="standardNodeHandler")?.handler;if(!o)return console.error("Standard node handler not found"),{nodes:[],consumed:0};const i={...t,nodes:[r]},s=o(i);return s.nodes.length===1&&(s.nodes[0].attrs.name=r.attributes["w:name"],s.nodes[0].attrs.id=r.attributes["w:id"]),s},c$={handlerName:"bookmarkNodeHandler",handler:l$},u$=t=>{const{nodes:e}=t;if(e.length===0||e[0].name!=="w:tab")return{nodes:[],consumed:0};const n=e[0],{attributes:r={}}=n;return{nodes:[{type:"tab",attrs:{tabSize:r["w:val"]||48},content:[]}],consumed:1}},d$={handlerName:"runNodeHandler",handler:u$};function f$({docx:t}){const e=Af(),n=t["word/comments.xml"];if(!n)return;const{elements:r}=n;if(!r||!r.length)return;const{elements:o=[]}=r[0],i=o.map(s=>{const{attributes:a}=s,l=a["w:id"],c=a["w:author"],u=a["w:email"],d=a["w:initials"],f=a["w:date"],p=a["custom:internalId"],h=a["custom:trackedChange"]==="true",m=a["custom:trackedChangeType"],y=a["custom:trackedChangeText"]!=="null"?a["custom:trackedChangeText"]:null,g=a["custom:trackedDeletedText"]!=="null"?a["custom:trackedDeletedText"]:null,x=new Date(f).getTime(),{elements:k}=s,w=k[0],{elements:T}=w,D=e.handler({nodes:s.elements,nodeListHandler:e,docx:t}),{attrs:M}=D[0],F=M["w14:paraId"];return{commentId:p||mo(),importedId:l,creatorName:c,creatorEmail:u,createdTime:x,textJson:D[0],initials:d,paraId:F,trackedChange:h,trackedChangeText:y,trackedChangeType:m,trackedDeletedText:g}});return p$({docx:t,comments:i})}const p$=({docx:t,comments:e})=>{const n=t["word/commentsExtended.xml"];if(!n)return[];const{elements:r}=n,{elements:o}=r[0],i=o.filter(s=>s.name==="w15:commentEx");return e.map(s=>{const a=i.find(d=>d.attributes["w15:paraId"]===s.paraId);if(!a)return{...s};const{isDone:l,paraIdParent:c}=h$(a);let u;return c&&(u=e.find(d=>d.paraId===c)),{...s,isDone:l,parentCommentId:u?.commentId}})},h$=t=>{const{attributes:e}=t,n=e["w15:paraId"],r=e["w15:done"]==="1",o=e["w15:paraIdParent"];return{paraId:n,isDone:r,paraIdParent:o}},m$=(t,e,n)=>{const r=yn(uA(t));if(!r)return null;if(e?.telemetry){const s=Object.keys(t).map(a=>{const l=a.split("/");return{filePath:a,fileDepth:l.length,fileType:a.split(".").pop()}});e.telemetry.trackFileStructure({totalFiles:s.length,maxDepth:Math.max(...s.map(a=>a.fileDepth)),totalNodes:0,files:s},e.fileSource,e.documentId,e.documentInternalId)}const o=Af(),i=r.elements[0].elements.find(s=>s.name==="w:body");if(i){const s=i,a=["w:sectPr"],l=s.elements?.filter(d=>!a.includes(d.name))??[],c=f$({docx:t}),u={type:"doc",content:o.handler({nodes:l,nodeListHandler:o,docx:t,converter:e,editor:n}),attrs:{attributes:r.elements[0].attributes}};return u.content.length>1&&e?.telemetry?.trackUsage("document_import",{documentType:"docx",timestamp:new Date().toISOString()}),{pmDoc:u,savedTagsToRestore:s,pageStyles:y$(s,t,e,n),comments:c,linkedStyles:b$(t)}}return null},Af=()=>{const t=[IA,JA,zA,BA,a$,n$,c$,MA,wA,OA,fA,d$,i$];return{handler:g$(t),handlerEntities:t}},g$=t=>{const e=(r,o,i,s)=>!r||o<0||o>=r.length?{elementIndex:o,error:"index_out_of_bounds",arrayLength:r?.length}:{elementName:r[o]?.name,attributes:i?.attrs,marks:i?.marks,elementPath:s,type:i?.type,content:i?.content},n=({nodes:r,docx:o,insideTrackChange:i,converter:s,editor:a,filename:l,parentStyleId:c})=>{if(!r||!r.length)return[];const u=[];try{for(let d=0;d<r.length;d++)try{const f=r.slice(d);if(!f||f.length===0)continue;const{nodes:p,consumed:h,unhandled:m}=t.reduce((g,x)=>g.consumed>0?g:x.handler({nodes:f,docx:o,nodeListHandler:{handler:n,handlerEntities:t},insideTrackChange:i,converter:s,editor:a,filename:l,parentStyleId:c}),{nodes:[],consumed:0}),y=e(r,d,p[0],`/word/${l||"document.xml"}`);if(m){if(!y.elementName)continue;s?.telemetry?.trackStatistic("unknown",y);continue}else{s?.telemetry?.trackStatistic("node",y),(y.type==="orderedList"||y.type==="bulletList")&&y.content.forEach(x=>{const k=e([x],0,x,`/word/${l||"document.xml"}`);s?.telemetry?.trackStatistic("attributes",k)});const g=p[0]?.marks?.find(x=>x.type==="highlight");g&&s?.docHiglightColors.add(g.attrs.color.toUpperCase())}h>0&&(d+=h-1),p&&p.forEach(g=>{if(g?.type&&!["runProperties"].includes(g.type)){if(g.type==="text"&&Array.isArray(g.content)&&!g.content.length)return;u.push(g)}})}catch(f){console.debug("Import error",f),a?.emit("exception",{error:f}),s?.telemetry?.trackStatistic("error",{type:"processing_error",message:f.message,name:f.name,stack:f.stack,fileName:`/word/${l||"document.xml"}`})}return u}catch(d){throw console.debug("Error during import",d),a?.emit("exception",{error:d}),s?.telemetry?.trackStatistic("error",{type:"fatal_error",message:d.message,name:d.name,stack:d.stack,fileName:`/word/${l||"document.xml"}`}),d}};return n};function y$(t,e,n,r){const o=t.elements?.find(s=>s.name==="w:sectPr"),i={};return o?.elements?.forEach(s=>{const{name:a,attributes:l}=s;switch(a){case"w:pgSz":i.pageSize={width:Wt(l["w:w"]),height:Wt(l["w:h"])};break;case"w:pgMar":i.pageMargins={top:Wt(l["w:top"]),right:Wt(l["w:right"]),bottom:Wt(l["w:bottom"]),left:Wt(l["w:left"]),header:Wt(l["w:header"]),footer:Wt(l["w:footer"]),gutter:Wt(l["w:gutter"])};break;case"w:cols":i.columns={space:Wt(l["w:space"]),num:l["w:num"],equalWidth:l["w:equalWidth"]};break;case"w:docGrid":i.docGrid={linePitch:Wt(l["w:linePitch"]),type:l["w:type"]};break;case"w:headerReference":og(s,"header",e,n,r);break;case"w:footerReference":og(s,"footer",e,n,r);break;case"w:titlePg":n.headerIds.titlePg=!0}}),i}function b$(t){const e=t["word/styles.xml"];if(!e)return[];const{elements:n}=e.elements[0],r=n.filter(i=>i.name==="w:style");n.find(i=>i.name==="w:latentStyles")?.elements.forEach(i=>{const{attributes:s}=i;r.find(a=>a.attributes["w:styleId"]===s["w:name"])});const o=[];return r.forEach(i=>{const s=i.attributes["w:styleId"],a=YA(s,t),l={id:i.attributes["w:styleId"],type:i.attributes["w:type"],definition:a,attributes:{}};o.push(l)}),o}function w$(t){if(!t)return null;const e=yn(t),{elements:n}=e.elements[0];return Object.keys(Wm).forEach(r=>{if(!n.some(o=>o.attributes?.["w:styleId"]===r)){const o=Wm[r];e.elements[0].elements.push(o)}}),e}function og(t,e,n,r,o){const i=n["word/_rels/document.xml.rels"].elements.find(y=>y.name==="Relationships"),{elements:s}=i,a=t.attributes["w:type"],l=t.attributes["r:id"],c=s.find(y=>y.attributes.Id===l).attributes.Target,u=n[`word/${c}`],d=c,f=Af(),p=f.handler({nodes:u.elements[0].elements,nodeListHandler:f,docx:n,converter:r,editor:o,filename:d});let h,m;e==="header"?(h=r.headers,m=r.headerIds):e==="footer"&&(h=r.footers,m=r.footerIds),h[l]={type:"doc",content:[...p]},m[a]=l}var Mi,av,lv,cv;const _i=class uv{constructor(e=null){p0(this,Mi),this.debug=e?.debug||!1,this.declaration=null,this.documentAttributes=null,this.convertedXml={},this.docx=e?.docx||[],this.media=e?.media||{},this.addedMedia={},this.comments=[],this.docHiglightColors=new Set([]),this.xml=e?.xml,this.declaration=null,this.numbering=null,this.pageStyles=null,this.initialJSON=null,this.headers={},this.headerIds={default:null,even:null,odd:null,first:null},this.footers={},this.footerIds={default:null,even:null,odd:null,first:null},this.linkedStyles=[],this.json=e?.json,this.tagsNotInSchema=["w:body"],this.savedTagsToRestore=[],this.telemetry=e?.telemetry||null,this.documentInternalId=null,this.fileSource=e?.fileSource||null,this.documentId=e?.documentId||null,(this.docx.length||this.xml)&&this.parseFromXml()}parseFromXml(){this.docx?.forEach(e=>{this.convertedXml[e.name]=this.parseXmlToJson(e.content),e.name==="word/document.xml"&&(this.documentAttributes=this.convertedXml[e.name].elements[0]?.attributes),e.name==="word/styles.xml"&&(this.convertedXml[e.name]=w$(this.convertedXml[e.name]))}),this.initialJSON=this.convertedXml["word/document.xml"],this.initialJSON||(this.initialJSON=this.parseXmlToJson(this.xml)),this.declaration=this.initialJSON?.declaration}parseXmlToJson(e){return JSON.parse(K0.xml2json(e,null,2))}static getStoredSuperdocVersion(e){try{const n=e.find(a=>a.name==="docProps/custom.xml");if(!n)return;const r=new uv,o=n.content,i=r.parseXmlToJson(o).elements.find(a=>a.name==="Properties");if(!i.elements)return;const s=i.elements.find(a=>a.name==="property"&&a.attributes.name==="SuperdocVersion");return s?s.elements[0].elements[0].text:void 0}catch(n){console.warn("Error getting Superdoc version",n);return}}static updateDocumentVersion(e=this.convertedXml,n="0.9.13"){const r="docProps/custom.xml";e[r]||(e[r]=dv());const o=e["docProps/custom.xml"];if(!o)return;const i=o.elements.find(a=>a.name==="Properties");i.elements||(i.elements=[]);const s=i.elements.find(a=>a.name==="property"&&a.attributes.name==="SuperdocVersion");if(s)s.elements[0].elements[0].elements[0].text=n;else{const a=fv();i.elements.push(a)}return e}getDocumentDefaultStyles(){const e=this.convertedXml["word/styles.xml"];if(!e)return{};const n=e.elements[0].elements.find(i=>i.name==="w:docDefaults").elements.find(i=>i.name==="w:rPrDefault"),r=n.elements[0].elements,o=r?.find(i=>i.name==="w:rFonts");if("elements"in n){const i=r.find(u=>u.name==="w:rFonts")?.attributes["w:asciiTheme"];let s,a;if(i){const u=this.getThemeInfo(i);s=u.typeface,a=u.panose}else o?s=o?.attributes["w:ascii"]:(e.elements[0].elements.filter(u=>u.name==="w:style"&&u.attributes["w:styleId"]==="Normal")||[]).forEach(u=>{s=u.elements.find(d=>d.name==="w:rPr")?.elements?.find(d=>d.name==="w:rFonts")?.attributes["w:ascii"]});const l=Number(r.find(u=>u.name==="w:sz")?.attributes["w:val"])/2||12,c=r.find(u=>u.name==="w:kern")?.attributes["w:val"];return{fontSizePt:l,kern:c,typeface:s,panose:a}}}getDocumentInternalId(){const e="word/settings.xml";this.convertedXml[e]||(this.convertedXml[e]=fE);const n=Object.assign({},this.convertedXml[e]);if(!n.elements[0]?.elements?.length){const o=this.createDocumentIdElement(n);n.elements[0].elements=[o],n.elements[0].attributes["xmlns:w15"]||(n.elements[0].attributes["xmlns:w15"]="http://schemas.microsoft.com/office/word/2012/wordml"),this.convertedXml[e]=n;return}const r=n.elements[0].elements.find(o=>o.name==="w15:docId");this.documentInternalId=r?.attributes["w15:val"]}createDocumentIdElement(){const e=mo().toUpperCase();return this.documentInternalId=e,{type:"element",name:"w15:docId",attributes:{"w15:val":`{${e}}`}}}getThemeInfo(e){e=e.toLowerCase();const n=this.convertedXml["word/theme/theme1.xml"].elements.find(s=>s.name==="a:theme").elements.find(s=>s.name==="a:themeElements").elements.find(s=>s.name==="a:fontScheme");let r;e.startsWith("major")?r=n.elements.find(s=>s.name==="a:majorFont").elements[0]:e.startsWith("minor")&&(r=n.elements.find(s=>s.name==="a:minorFont").elements[0]);const{typeface:o,panose:i}=r.attributes;return{typeface:o,panose:i}}getSchema(e){this.getDocumentInternalId();const n=m$({...this.convertedXml,media:this.media},this,e);return n?(this.savedTagsToRestore.push({...n.savedTagsToRestore}),this.pageStyles=n.pageStyles,this.comments=n.comments,this.linkedStyles=n.linkedStyles,n.pmDoc):null}schemaToXml(e,n=!1){return new Zm(this).schemaToXml(e,n)}async exportToDocx(e,n,r,o=!1,i,s=[]){const a=this.savedTagsToRestore.find(m=>m.name==="w:body"),l=s.map(m=>xE(m)),c=l.map((m,y)=>kE(m,y,l)),[u,d]=ai({node:e,bodyNode:a,relationships:[],documentMedia:{},media:{},isFinalDoc:o,editorSchema:n,converter:this,pageStyles:this.pageStyles,comments:s,commentsExportType:i,exportedCommentDefs:c}),f=new Zm(this).schemaToXml(u);await wr(this,Mi,cv).call(this,{...r,...d.media,...this.media});let p={...this.convertedXml},h=[];if(s.length){const{documentXml:m,relationships:y}=wr(this,Mi,av).call(this,{defs:d.exportedCommentDefs,exportType:i,commentsWithParaIds:l});p={...m},h=y}return this.convertedXml={...this.convertedXml,...p},wr(this,Mi,lv).call(this,[...d.relationships,...h]),v$(this.convertedXml),f}};Mi=new WeakSet,av=function({defs:t,exportType:e,commentsWithParaIds:n}){const{documentXml:r,relationships:o}=OE({exportType:e,convertedXml:this.convertedXml,defs:t,commentsWithParaIds:n,converter:this});return{documentXml:r,relationships:o}},lv=function(t=[]){const e=this.convertedXml["word/_rels/document.xml.rels"],n=e.elements.find(s=>s.name==="Relationships"),r=[],o=/rId|mi/g;let i=Math.max(...n.elements.map(s=>Number(s.attributes.Id.replace(o,""))));t.forEach(s=>{const a=s.attributes.Id,l=n.elements.find(u=>u.attributes.Target===s.attributes.Target),c=s.attributes.Target?.startsWith("media/")&&a.length>6;l&&!c||(s.attributes.Target=s.attributes?.Target?.replace(/&/g,"&amp;"),s.attributes.Id=a.length>6?a:`rId${++i}`,r.push(s))}),n.elements=[...n.elements,...r],this.convertedXml["word/_rels/document.xml.rels"]=e},cv=async function(t){const e={};for(const n in t){if(typeof t[n]!="string")return;const r=n.split("/").pop();e[r]=await oE(t[n])}this.convertedXml.media={...this.convertedXml.media,...e},this.media=this.convertedXml.media,this.addedMedia=e},Is(_i,"allowedElements",Object.freeze({"w:document":"doc","w:body":"body","w:p":"paragraph","w:r":"run","w:t":"text","w:delText":"text","w:br":"lineBreak","w:tbl":"table","w:tr":"tableRow","w:tc":"tableCell","w:drawing":"drawing","w:bookmarkStart":"bookmarkStart","w:sectPr":"sectionProperties","w:rPr":"runProperties","w:commentRangeStart":"commentRangeStart","w:commentRangeEnd":"commentRangeEnd","w:commentReference":"commentReference"})),Is(_i,"markTypes",[{name:"w:b",type:"bold"},{name:"w:bCs",type:"bold"},{name:"w:i",type:"italic"},{name:"w:iCs",type:"italic"},{name:"w:u",type:"underline",mark:"underline",property:"underlineType"},{name:"w:strike",type:"strike"},{name:"w:color",type:"color",mark:"textStyle",property:"color"},{name:"w:sz",type:"fontSize",mark:"textStyle",property:"fontSize"},{name:"w:szCs",type:"fontSize",mark:"textStyle",property:"fontSize"},{name:"w:rFonts",type:"fontFamily",mark:"textStyle",property:"fontFamily"},{name:"w:jc",type:"textAlign",mark:"textStyle",property:"textAlign"},{name:"w:ind",type:"textIndent",mark:"textStyle",property:"textIndent"},{name:"w:spacing",type:"lineHeight",mark:"textStyle",property:"lineHeight"},{name:"link",type:"link",mark:"link",property:"href"},{name:"w:highlight",type:"highlight",mark:"highlight",property:"color"}]),Is(_i,"propertyTypes",Object.freeze({"w:pPr":"paragraphProperties","w:rPr":"runProperties","w:sectPr":"sectionProperties","w:numPr":"numberingProperties","w:tcPr":"tableCellProperties"})),Is(_i,"elements",new Set(["w:document","w:body","w:p","w:r","w:t","w:delText"]));let $r=_i;function v$(t){const e="docProps/custom.xml";t[e]||(t[e]=dv());const n=t[e].elements.find(s=>s.name==="Properties");n.elements||(n.elements=[]);const r=n.elements,o=r.filter(s=>typeof s=="object"&&s!==null).filter(s=>{const{attributes:a}=s;return a.name!=="SuperdocVersion"});let i=2;try{i=o.length?Math.max(...r.map(s=>s.attributes.pid))+1:2}catch{}return o.push(fv(i)),n.elements=o,t}function dv(){return dE}function fv(t=2,e="0.9.13"){return{type:"element",name:"property",attributes:{name:"SuperdocVersion",fmtid:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:t},elements:[{type:"element",name:"vt:lpwstr",elements:[{type:"text",text:e}]}]}}function js(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 pv={exports:{}};(function(t,e){(function(n){t.exports=n()})(function(){return function n(r,o,i){function s(c,u){if(!o[c]){if(!r[c]){var d=typeof js=="function"&&js;if(!u&&d)return d(c,!0);if(a)return a(c,!0);var f=new Error("Cannot find module '"+c+"'");throw f.code="MODULE_NOT_FOUND",f}var p=o[c]={exports:{}};r[c][0].call(p.exports,function(h){var m=r[c][1][h];return s(m||h)},p,p.exports,n,r,o,i)}return o[c].exports}for(var a=typeof js=="function"&&js,l=0;l<i.length;l++)s(i[l]);return s}({1:[function(n,r,o){var i=n("./utils"),s=n("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";o.encode=function(l){for(var c,u,d,f,p,h,m,y=[],g=0,x=l.length,k=x,w=i.getTypeOf(l)!=="string";g<l.length;)k=x-g,d=w?(c=l[g++],u=g<x?l[g++]:0,g<x?l[g++]:0):(c=l.charCodeAt(g++),u=g<x?l.charCodeAt(g++):0,g<x?l.charCodeAt(g++):0),f=c>>2,p=(3&c)<<4|u>>4,h=1<k?(15&u)<<2|d>>6:64,m=2<k?63&d:64,y.push(a.charAt(f)+a.charAt(p)+a.charAt(h)+a.charAt(m));return y.join("")},o.decode=function(l){var c,u,d,f,p,h,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 x,k=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===a.charAt(64)&&k--,l.charAt(l.length-2)===a.charAt(64)&&k--,k%1!=0)throw new Error("Invalid base64 input, bad content length.");for(x=s.uint8array?new Uint8Array(0|k):new Array(0|k);m<l.length;)c=a.indexOf(l.charAt(m++))<<2|(f=a.indexOf(l.charAt(m++)))>>4,u=(15&f)<<4|(p=a.indexOf(l.charAt(m++)))>>2,d=(3&p)<<6|(h=a.indexOf(l.charAt(m++))),x[y++]=c,p!==64&&(x[y++]=u),h!==64&&(x[y++]=d);return x}},{"./support":30,"./utils":32}],2:[function(n,r,o){var i=n("./external"),s=n("./stream/DataWorker"),a=n("./stream/Crc32Probe"),l=n("./stream/DataLengthProbe");function c(u,d,f,p,h){this.compressedSize=u,this.uncompressedSize=d,this.crc32=f,this.compression=p,this.compressedContent=h}c.prototype={getContentWorker:function(){var u=new s(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),d=this;return u.on("end",function(){if(this.streamInfo.data_length!==d.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new s(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(u,d,f){return u.pipe(new a).pipe(new l("uncompressedSize")).pipe(d.compressWorker(f)).pipe(new l("compressedSize")).withStreamInfo("compression",d)},r.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,o){var i=n("./stream/GenericWorker");o.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},o.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,o){var i=n("./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}();r.exports=function(a,l){return a!==void 0&&a.length?i.getTypeOf(a)!=="string"?function(c,u,d,f){var p=s,h=f+d;c^=-1;for(var m=f;m<h;m++)c=c>>>8^p[255&(c^u[m])];return-1^c}(0|l,a,a.length,0):function(c,u,d,f){var p=s,h=f+d;c^=-1;for(var m=f;m<h;m++)c=c>>>8^p[255&(c^u.charCodeAt(m))];return-1^c}(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(n,r,o){o.base64=!1,o.binary=!1,o.dir=!1,o.createFolders=!0,o.date=null,o.compression=null,o.compressionOptions=null,o.comment=null,o.unixPermissions=null,o.dosPermissions=null},{}],6:[function(n,r,o){var i=null;i=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:i}},{lie:37}],7:[function(n,r,o){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=n("pako"),a=n("./utils"),l=n("./stream/GenericWorker"),c=i?"uint8array":"array";function u(d,f){l.call(this,"FlateWorker/"+d),this._pako=null,this._pakoAction=d,this._pakoOptions=f,this.meta={}}o.magic="\b\0",a.inherits(u,l),u.prototype.processChunk=function(d){this.meta=d.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(c,d.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 d=this;this._pako.onData=function(f){d.push({data:f,meta:d.meta})}},o.compressWorker=function(d){return new u("Deflate",d)},o.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,o){function i(p,h){var m,y="";for(m=0;m<h;m++)y+=String.fromCharCode(255&p),p>>>=8;return y}function s(p,h,m,y,g,x){var k,w,T=p.file,D=p.compression,M=x!==c.utf8encode,F=a.transformTo("string",x(T.name)),C=a.transformTo("string",c.utf8encode(T.name)),U=T.comment,ie=a.transformTo("string",x(U)),I=a.transformTo("string",c.utf8encode(U)),W=C.length!==T.name.length,A=I.length!==U.length,G="",ae="",X="",de=T.dir,J=T.date,pe={crc32:0,compressedSize:0,uncompressedSize:0};h&&!m||(pe.crc32=p.crc32,pe.compressedSize=p.compressedSize,pe.uncompressedSize=p.uncompressedSize);var Q=0;h&&(Q|=8),M||!W&&!A||(Q|=2048);var B=0,ee=0;de&&(B|=16),g==="UNIX"?(ee=798,B|=function(re,K){var $=re;return re||($=K?16893:33204),(65535&$)<<16}(T.unixPermissions,de)):(ee=20,B|=function(re){return 63&(re||0)}(T.dosPermissions)),k=J.getUTCHours(),k<<=6,k|=J.getUTCMinutes(),k<<=5,k|=J.getUTCSeconds()/2,w=J.getUTCFullYear()-1980,w<<=4,w|=J.getUTCMonth()+1,w<<=5,w|=J.getUTCDate(),W&&(ae=i(1,1)+i(u(F),4)+C,G+="up"+i(ae.length,2)+ae),A&&(X=i(1,1)+i(u(ie),4)+I,G+="uc"+i(X.length,2)+X);var Z="";return Z+=`
31
- \0`,Z+=i(Q,2),Z+=D.magic,Z+=i(k,2),Z+=i(w,2),Z+=i(pe.crc32,4),Z+=i(pe.compressedSize,4),Z+=i(pe.uncompressedSize,4),Z+=i(F.length,2),Z+=i(G.length,2),{fileRecord:d.LOCAL_FILE_HEADER+Z+F+G,dirRecord:d.CENTRAL_FILE_HEADER+i(ee,2)+Z+i(ie.length,2)+"\0\0\0\0"+i(B,4)+i(y,4)+F+G+ie}}var a=n("../utils"),l=n("../stream/GenericWorker"),c=n("../utf8"),u=n("../crc32"),d=n("../signature");function f(p,h,m,y){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=h,this.zipPlatform=m,this.encodeFileName=y,this.streamFiles=p,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(f,l),f.prototype.push=function(p){var h=p.meta.percent||0,m=this.entriesCount,y=this._sources.length;this.accumulate?this.contentBuffer.push(p):(this.bytesWritten+=p.data.length,l.prototype.push.call(this,{data:p.data,meta:{currentFile:this.currentFile,percent:m?(h+100*(m-y-1))/m:100}}))},f.prototype.openedSource=function(p){this.currentSourceOffset=this.bytesWritten,this.currentFile=p.file.name;var h=this.streamFiles&&!p.file.dir;if(h){var m=s(p,h,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},f.prototype.closedSource=function(p){this.accumulate=!1;var h=this.streamFiles&&!p.file.dir,m=s(p,h,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),h)this.push({data:function(y){return d.DATA_DESCRIPTOR+i(y.crc32,4)+i(y.compressedSize,4)+i(y.uncompressedSize,4)}(p),meta:{percent:100}});else for(this.push({data:m.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},f.prototype.flush=function(){for(var p=this.bytesWritten,h=0;h<this.dirRecords.length;h++)this.push({data:this.dirRecords[h],meta:{percent:100}});var m=this.bytesWritten-p,y=function(g,x,k,w,T){var D=a.transformTo("string",T(w));return d.CENTRAL_DIRECTORY_END+"\0\0\0\0"+i(g,2)+i(g,2)+i(x,4)+i(k,4)+i(D.length,2)+D}(this.dirRecords.length,m,p,this.zipComment,this.encodeFileName);this.push({data:y,meta:{percent:100}})},f.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},f.prototype.registerPrevious=function(p){this._sources.push(p);var h=this;return p.on("data",function(m){h.processChunk(m)}),p.on("end",function(){h.closedSource(h.previous.streamInfo),h._sources.length?h.prepareNextSource():h.end()}),p.on("error",function(m){h.error(m)}),this},f.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))},f.prototype.error=function(p){var h=this._sources;if(!l.prototype.error.call(this,p))return!1;for(var m=0;m<h.length;m++)try{h[m].error(p)}catch{}return!0},f.prototype.lock=function(){l.prototype.lock.call(this);for(var p=this._sources,h=0;h<p.length;h++)p[h].lock()},r.exports=f},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(n,r,o){var i=n("../compressions"),s=n("./ZipFileWorker");o.generateWorker=function(a,l,c){var u=new s(l.streamFiles,c,l.platform,l.encodeFileName),d=0;try{a.forEach(function(f,p){d++;var h=function(x,k){var w=x||k,T=i[w];if(!T)throw new Error(w+" is not a valid compression method !");return T}(p.options.compression,l.compression),m=p.options.compressionOptions||l.compressionOptions||{},y=p.dir,g=p.date;p._compressWorker(h,m).withStreamInfo("file",{name:f,dir:y,date:g,comment:p.comment||"",unixPermissions:p.unixPermissions,dosPermissions:p.dosPermissions}).pipe(u)}),u.entriesCount=d}catch(f){u.error(f)}return u}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(n,r,o){function i(){if(!(this instanceof i))return new i;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 i;for(var a in this)typeof this[a]!="function"&&(s[a]=this[a]);return s}}(i.prototype=n("./object")).loadAsync=n("./load"),i.support=n("./support"),i.defaults=n("./defaults"),i.version="3.10.1",i.loadAsync=function(s,a){return new i().loadAsync(s,a)},i.external=n("./external"),r.exports=i},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(n,r,o){var i=n("./utils"),s=n("./external"),a=n("./utf8"),l=n("./zipEntries"),c=n("./stream/Crc32Probe"),u=n("./nodejsUtils");function d(f){return new s.Promise(function(p,h){var m=f.decompressed.getContentWorker().pipe(new c);m.on("error",function(y){h(y)}).on("end",function(){m.streamInfo.crc32!==f.decompressed.crc32?h(new Error("Corrupted zip : CRC32 mismatch")):p()}).resume()})}r.exports=function(f,p){var h=this;return p=i.extend(p||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),u.isNode&&u.isStream(f)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):i.prepareContent("the loaded zip file",f,!0,p.optimizedBinaryString,p.base64).then(function(m){var y=new l(p);return y.load(m),y}).then(function(m){var y=[s.Promise.resolve(m)],g=m.files;if(p.checkCRC32)for(var x=0;x<g.length;x++)y.push(d(g[x]));return s.Promise.all(y)}).then(function(m){for(var y=m.shift(),g=y.files,x=0;x<g.length;x++){var k=g[x],w=k.fileNameStr,T=i.resolve(k.fileNameStr);h.file(T,k.decompressed,{binary:!0,optimizedBinaryString:!0,date:k.date,dir:k.dir,comment:k.fileCommentStr.length?k.fileCommentStr:null,unixPermissions:k.unixPermissions,dosPermissions:k.dosPermissions,createFolders:p.createFolders}),k.dir||(h.file(T).unsafeOriginalName=w)}return y.zipComment.length&&(h.comment=y.zipComment),h})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(n,r,o){var i=n("../utils"),s=n("../stream/GenericWorker");function a(l,c){s.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}i.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)},r.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(n,r,o){var i=n("readable-stream").Readable;function s(a,l,c){i.call(this,l),this._helper=a;var u=this;a.on("data",function(d,f){u.push(d)||u._helper.pause(),c&&c(f)}).on("error",function(d){u.emit("error",d)}).on("end",function(){u.push(null)})}n("../utils").inherits(s,i),s.prototype._read=function(){this._helper.resume()},r.exports=s},{"../utils":32,"readable-stream":16}],14:[function(n,r,o){r.exports={isNode:typeof St<"u",newBufferFrom:function(i,s){if(St.from&&St.from!==Uint8Array.from)return St.from(i,s);if(typeof i=="number")throw new Error('The "data" argument must not be a number');return new St(i,s)},allocBuffer:function(i){if(St.alloc)return St.alloc(i);var s=new St(i);return s.fill(0),s},isBuffer:function(i){return St.isBuffer(i)},isStream:function(i){return i&&typeof i.on=="function"&&typeof i.pause=="function"&&typeof i.resume=="function"}}},{}],15:[function(n,r,o){function i(T,D,M){var F,C=a.getTypeOf(D),U=a.extend(M||{},u);U.date=U.date||new Date,U.compression!==null&&(U.compression=U.compression.toUpperCase()),typeof U.unixPermissions=="string"&&(U.unixPermissions=parseInt(U.unixPermissions,8)),U.unixPermissions&&16384&U.unixPermissions&&(U.dir=!0),U.dosPermissions&&16&U.dosPermissions&&(U.dir=!0),U.dir&&(T=g(T)),U.createFolders&&(F=y(T))&&x.call(this,F,!0);var ie=C==="string"&&U.binary===!1&&U.base64===!1;M&&M.binary!==void 0||(U.binary=!ie),(D instanceof d&&D.uncompressedSize===0||U.dir||!D||D.length===0)&&(U.base64=!1,U.binary=!0,D="",U.compression="STORE",C="string");var I=null;I=D instanceof d||D instanceof l?D:h.isNode&&h.isStream(D)?new m(T,D):a.prepareContent(T,D,U.binary,U.optimizedBinaryString,U.base64);var W=new f(T,I,U);this.files[T]=W}var s=n("./utf8"),a=n("./utils"),l=n("./stream/GenericWorker"),c=n("./stream/StreamHelper"),u=n("./defaults"),d=n("./compressedObject"),f=n("./zipObject"),p=n("./generate"),h=n("./nodejsUtils"),m=n("./nodejs/NodejsStreamInputAdapter"),y=function(T){T.slice(-1)==="/"&&(T=T.substring(0,T.length-1));var D=T.lastIndexOf("/");return 0<D?T.substring(0,D):""},g=function(T){return T.slice(-1)!=="/"&&(T+="/"),T},x=function(T,D){return D=D!==void 0?D:u.createFolders,T=g(T),this.files[T]||i.call(this,T,null,{dir:!0,createFolders:D}),this.files[T]};function k(T){return Object.prototype.toString.call(T)==="[object RegExp]"}var w={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(T){var D,M,F;for(D in this.files)F=this.files[D],(M=D.slice(this.root.length,D.length))&&D.slice(0,this.root.length)===this.root&&T(M,F)},filter:function(T){var D=[];return this.forEach(function(M,F){T(M,F)&&D.push(F)}),D},file:function(T,D,M){if(arguments.length!==1)return T=this.root+T,i.call(this,T,D,M),this;if(k(T)){var F=T;return this.filter(function(U,ie){return!ie.dir&&F.test(U)})}var C=this.files[this.root+T];return C&&!C.dir?C:null},folder:function(T){if(!T)return this;if(k(T))return this.filter(function(C,U){return U.dir&&T.test(C)});var D=this.root+T,M=x.call(this,D),F=this.clone();return F.root=M.name,F},remove:function(T){T=this.root+T;var D=this.files[T];if(D||(T.slice(-1)!=="/"&&(T+="/"),D=this.files[T]),D&&!D.dir)delete this.files[T];else for(var M=this.filter(function(C,U){return U.name.slice(0,T.length)===T}),F=0;F<M.length;F++)delete this.files[M[F].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(T){var D,M={};try{if((M=a.extend(T||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=M.type.toLowerCase(),M.compression=M.compression.toUpperCase(),M.type==="binarystring"&&(M.type="string"),!M.type)throw new Error("No output type specified.");a.checkSupport(M.type),M.platform!=="darwin"&&M.platform!=="freebsd"&&M.platform!=="linux"&&M.platform!=="sunos"||(M.platform="UNIX"),M.platform==="win32"&&(M.platform="DOS");var F=M.comment||this.comment||"";D=p.generateWorker(this,M,F)}catch(C){(D=new l("error")).error(C)}return new c(D,M.type||"string",M.mimeType)},generateAsync:function(T,D){return this.generateInternalStream(T).accumulate(D)},generateNodeStream:function(T,D){return(T=T||{}).type||(T.type="nodebuffer"),this.generateInternalStream(T).toNodejsStream(D)}};r.exports=w},{"./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(n,r,o){r.exports=n("stream")},{stream:void 0}],17:[function(n,r,o){var i=n("./DataReader");function s(a){i.call(this,a);for(var l=0;l<this.data.length;l++)a[l]=255&a[l]}n("../utils").inherits(s,i),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),d=a.charCodeAt(3),f=this.length-4;0<=f;--f)if(this.data[f]===l&&this.data[f+1]===c&&this.data[f+2]===u&&this.data[f+3]===d)return f-this.zero;return-1},s.prototype.readAndCheckSignature=function(a){var l=a.charCodeAt(0),c=a.charCodeAt(1),u=a.charCodeAt(2),d=a.charCodeAt(3),f=this.readData(4);return l===f[0]&&c===f[1]&&u===f[2]&&d===f[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},r.exports=s},{"../utils":32,"./DataReader":18}],18:[function(n,r,o){var i=n("../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 i.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))}},r.exports=s},{"../utils":32}],19:[function(n,r,o){var i=n("./Uint8ArrayReader");function s(a){i.call(this,a)}n("../utils").inherits(s,i),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},r.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,o){var i=n("./DataReader");function s(a){i.call(this,a)}n("../utils").inherits(s,i),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},r.exports=s},{"../utils":32,"./DataReader":18}],21:[function(n,r,o){var i=n("./ArrayReader");function s(a){i.call(this,a)}n("../utils").inherits(s,i),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},r.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,o){var i=n("../utils"),s=n("../support"),a=n("./ArrayReader"),l=n("./StringReader"),c=n("./NodeBufferReader"),u=n("./Uint8ArrayReader");r.exports=function(d){var f=i.getTypeOf(d);return i.checkSupport(f),f!=="string"||s.uint8array?f==="nodebuffer"?new c(d):s.uint8array?new u(i.transformTo("uint8array",d)):new a(i.transformTo("array",d)):new l(d)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,o){o.LOCAL_FILE_HEADER="PK",o.CENTRAL_FILE_HEADER="PK",o.CENTRAL_DIRECTORY_END="PK",o.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",o.ZIP64_CENTRAL_DIRECTORY_END="PK",o.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,o){var i=n("./GenericWorker"),s=n("../utils");function a(l){i.call(this,"ConvertWorker to "+l),this.destType=l}s.inherits(a,i),a.prototype.processChunk=function(l){this.push({data:s.transformTo(this.destType,l.data),meta:l.meta})},r.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,o){var i=n("./GenericWorker"),s=n("../crc32");function a(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(a,i),a.prototype.processChunk=function(l){this.streamInfo.crc32=s(l.data,this.streamInfo.crc32||0),this.push(l)},r.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,o){var i=n("../utils"),s=n("./GenericWorker");function a(l){s.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}i.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)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,o){var i=n("../utils"),s=n("./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=i.getTypeOf(u),c.isPaused||c._tickAndRepeat()},function(u){c.error(u)})}i.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,i.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.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}})},r.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,o){function i(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}i.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}},r.exports=i},{}],29:[function(n,r,o){var i=n("../utils"),s=n("./ConvertWorker"),a=n("./GenericWorker"),l=n("../base64"),c=n("../support"),u=n("../external"),d=null;if(c.nodestream)try{d=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function f(h,m){return new u.Promise(function(y,g){var x=[],k=h._internalType,w=h._outputType,T=h._mimeType;h.on("data",function(D,M){x.push(D),m&&m(M)}).on("error",function(D){x=[],g(D)}).on("end",function(){try{var D=function(M,F,C){switch(M){case"blob":return i.newBlob(i.transformTo("arraybuffer",F),C);case"base64":return l.encode(F);default:return i.transformTo(M,F)}}(w,function(M,F){var C,U=0,ie=null,I=0;for(C=0;C<F.length;C++)I+=F[C].length;switch(M){case"string":return F.join("");case"array":return Array.prototype.concat.apply([],F);case"uint8array":for(ie=new Uint8Array(I),C=0;C<F.length;C++)ie.set(F[C],U),U+=F[C].length;return ie;case"nodebuffer":return St.concat(F);default:throw new Error("concat : unsupported type '"+M+"'")}}(k,x),T);y(D)}catch(M){g(M)}x=[]}).resume()})}function p(h,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,i.checkSupport(g),this._worker=h.pipe(new s(g)),h.lock()}catch(x){this._worker=new a("error"),this._worker.error(x)}}p.prototype={accumulate:function(h){return f(this,h)},on:function(h,m){var y=this;return h==="data"?this._worker.on(h,function(g){m.call(y,g.data,g.meta)}):this._worker.on(h,function(){i.delay(m,arguments,y)}),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(h){if(i.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new d(this,{objectMode:this._outputType!=="nodebuffer"},h)}},r.exports=p},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(n,r,o){if(o.base64=!0,o.array=!0,o.string=!0,o.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",o.nodebuffer=typeof St<"u",o.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")o.blob=!1;else{var i=new ArrayBuffer(0);try{o.blob=new Blob([i],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(i),o.blob=s.getBlob("application/zip").size===0}catch{o.blob=!1}}}try{o.nodestream=!!n("readable-stream").Readable}catch{o.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,o){for(var i=n("./utils"),s=n("./support"),a=n("./nodejsUtils"),l=n("./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 d(){l.call(this,"utf-8 decode"),this.leftOver=null}function f(){l.call(this,"utf-8 encode")}o.utf8encode=function(p){return s.nodebuffer?a.newBufferFrom(p,"utf-8"):function(h){var m,y,g,x,k,w=h.length,T=0;for(x=0;x<w;x++)(64512&(y=h.charCodeAt(x)))==55296&&x+1<w&&(64512&(g=h.charCodeAt(x+1)))==56320&&(y=65536+(y-55296<<10)+(g-56320),x++),T+=y<128?1:y<2048?2:y<65536?3:4;for(m=s.uint8array?new Uint8Array(T):new Array(T),x=k=0;k<T;x++)(64512&(y=h.charCodeAt(x)))==55296&&x+1<w&&(64512&(g=h.charCodeAt(x+1)))==56320&&(y=65536+(y-55296<<10)+(g-56320),x++),y<128?m[k++]=y:(y<2048?m[k++]=192|y>>>6:(y<65536?m[k++]=224|y>>>12:(m[k++]=240|y>>>18,m[k++]=128|y>>>12&63),m[k++]=128|y>>>6&63),m[k++]=128|63&y);return m}(p)},o.utf8decode=function(p){return s.nodebuffer?i.transformTo("nodebuffer",p).toString("utf-8"):function(h){var m,y,g,x,k=h.length,w=new Array(2*k);for(m=y=0;m<k;)if((g=h[m++])<128)w[y++]=g;else if(4<(x=c[g]))w[y++]=65533,m+=x-1;else{for(g&=x===2?31:x===3?15:7;1<x&&m<k;)g=g<<6|63&h[m++],x--;1<x?w[y++]=65533:g<65536?w[y++]=g:(g-=65536,w[y++]=55296|g>>10&1023,w[y++]=56320|1023&g)}return w.length!==y&&(w.subarray?w=w.subarray(0,y):w.length=y),i.applyFromCharCode(w)}(p=i.transformTo(s.uint8array?"uint8array":"array",p))},i.inherits(d,l),d.prototype.processChunk=function(p){var h=i.transformTo(s.uint8array?"uint8array":"array",p.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var m=h;(h=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),h.set(m,this.leftOver.length)}else h=this.leftOver.concat(h);this.leftOver=null}var y=function(x,k){var w;for((k=k||x.length)>x.length&&(k=x.length),w=k-1;0<=w&&(192&x[w])==128;)w--;return w<0||w===0?k:w+c[x[w]]>k?w:k}(h),g=h;y!==h.length&&(s.uint8array?(g=h.subarray(0,y),this.leftOver=h.subarray(y,h.length)):(g=h.slice(0,y),this.leftOver=h.slice(y,h.length))),this.push({data:o.utf8decode(g),meta:p.meta})},d.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:o.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},o.Utf8DecodeWorker=d,i.inherits(f,l),f.prototype.processChunk=function(p){this.push({data:o.utf8encode(p.data),meta:p.meta})},o.Utf8EncodeWorker=f},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,o){var i=n("./support"),s=n("./base64"),a=n("./nodejsUtils"),l=n("./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}n("setimmediate"),o.newBlob=function(m,y){o.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 d={stringifyByChunk:function(m,y,g){var x=[],k=0,w=m.length;if(w<=g)return String.fromCharCode.apply(null,m);for(;k<w;)y==="array"||y==="nodebuffer"?x.push(String.fromCharCode.apply(null,m.slice(k,Math.min(k+g,w)))):x.push(String.fromCharCode.apply(null,m.subarray(k,Math.min(k+g,w)))),k+=g;return x.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 i.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return i.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}}()}};function f(m){var y=65536,g=o.getTypeOf(m),x=!0;if(g==="uint8array"?x=d.applyCanBeUsed.uint8array:g==="nodebuffer"&&(x=d.applyCanBeUsed.nodebuffer),x)for(;1<y;)try{return d.stringifyByChunk(m,g,y)}catch{y=Math.floor(y/2)}return d.stringifyByChar(m)}function p(m,y){for(var g=0;g<m.length;g++)y[g]=m[g];return y}o.applyFromCharCode=f;var h={};h.string={string:c,array:function(m){return u(m,new Array(m.length))},arraybuffer:function(m){return h.string.uint8array(m).buffer},uint8array:function(m){return u(m,new Uint8Array(m.length))},nodebuffer:function(m){return u(m,a.allocBuffer(m.length))}},h.array={string:f,array:c,arraybuffer:function(m){return new Uint8Array(m).buffer},uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(m)}},h.arraybuffer={string:function(m){return f(new Uint8Array(m))},array:function(m){return p(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))}},h.uint8array={string:f,array:function(m){return p(m,new Array(m.length))},arraybuffer:function(m){return m.buffer},uint8array:c,nodebuffer:function(m){return a.newBufferFrom(m)}},h.nodebuffer={string:f,array:function(m){return p(m,new Array(m.length))},arraybuffer:function(m){return h.nodebuffer.uint8array(m).buffer},uint8array:function(m){return p(m,new Uint8Array(m.length))},nodebuffer:c},o.transformTo=function(m,y){if(y=y||"",!m)return y;o.checkSupport(m);var g=o.getTypeOf(y);return h[g][m](y)},o.resolve=function(m){for(var y=m.split("/"),g=[],x=0;x<y.length;x++){var k=y[x];k==="."||k===""&&x!==0&&x!==y.length-1||(k===".."?g.pop():g.push(k))}return g.join("/")},o.getTypeOf=function(m){return typeof m=="string"?"string":Object.prototype.toString.call(m)==="[object Array]"?"array":i.nodebuffer&&a.isBuffer(m)?"nodebuffer":i.uint8array&&m instanceof Uint8Array?"uint8array":i.arraybuffer&&m instanceof ArrayBuffer?"arraybuffer":void 0},o.checkSupport=function(m){if(!i[m.toLowerCase()])throw new Error(m+" is not supported by this platform")},o.MAX_VALUE_16BITS=65535,o.MAX_VALUE_32BITS=-1,o.pretty=function(m){var y,g,x="";for(g=0;g<(m||"").length;g++)x+="\\x"+((y=m.charCodeAt(g))<16?"0":"")+y.toString(16).toUpperCase();return x},o.delay=function(m,y,g){setImmediate(function(){m.apply(g||null,y||[])})},o.inherits=function(m,y){function g(){}g.prototype=y.prototype,m.prototype=new g},o.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},o.prepareContent=function(m,y,g,x,k){return l.Promise.resolve(y).then(function(w){return i.blob&&(w instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(w))!==-1)&&typeof FileReader<"u"?new l.Promise(function(T,D){var M=new FileReader;M.onload=function(F){T(F.target.result)},M.onerror=function(F){D(F.target.error)},M.readAsArrayBuffer(w)}):w}).then(function(w){var T=o.getTypeOf(w);return T?(T==="arraybuffer"?w=o.transformTo("uint8array",w):T==="string"&&(k?w=s.decode(w):g&&x!==!0&&(w=function(D){return u(D,i.uint8array?new Uint8Array(D.length):new Array(D.length))}(w))),w):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(n,r,o){var i=n("./reader/readerFor"),s=n("./utils"),a=n("./signature"),l=n("./zipEntry"),c=n("./support");function u(d){this.files=[],this.loadOptions=d}u.prototype={checkSignature:function(d){if(!this.reader.readAndCheckSignature(d)){this.reader.index-=4;var f=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+s.pretty(f)+", expected "+s.pretty(d)+")")}},isSignature:function(d,f){var p=this.reader.index;this.reader.setIndex(d);var h=this.reader.readString(4)===f;return this.reader.setIndex(p),h},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 d=this.reader.readData(this.zipCommentLength),f=c.uint8array?"uint8array":"array",p=s.transformTo(f,d);this.zipComment=this.loadOptions.decodeFileName(p)},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 d,f,p,h=this.zip64EndOfCentralSize-44;0<h;)d=this.reader.readInt(2),f=this.reader.readInt(4),p=this.reader.readData(f),this.zip64ExtensibleData[d]={id:d,length:f,value:p}},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 d,f;for(d=0;d<this.files.length;d++)f=this.files[d],this.reader.setIndex(f.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),f.readLocalPart(this.reader),f.handleUTF8(),f.processAttributes()},readCentralDir:function(){var d;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(d=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(d);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 d=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(d<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(d);var f=d;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,(d=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(d),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 p=this.centralDirOffset+this.centralDirSize;this.zip64&&(p+=20,p+=12+this.zip64EndOfCentralSize);var h=f-p;if(0<h)this.isSignature(f,a.CENTRAL_FILE_HEADER)||(this.reader.zero=h);else if(h<0)throw new Error("Corrupted zip: missing "+Math.abs(h)+" bytes.")},prepareReader:function(d){this.reader=i(d)},load:function(d){this.prepareReader(d),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=u},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(n,r,o){var i=n("./reader/readerFor"),s=n("./utils"),a=n("./compressedObject"),l=n("./crc32"),c=n("./utf8"),u=n("./compressions"),d=n("./support");function f(p,h){this.options=p,this.loadOptions=h}f.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(p){var h,m;if(p.skip(22),this.fileNameLength=p.readInt(2),m=p.readInt(2),this.fileName=p.readData(this.fileNameLength),p.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((h=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,h,p.readData(this.compressedSize))},readCentralPart:function(p){this.versionMadeBy=p.readInt(2),p.skip(2),this.bitFlag=p.readInt(2),this.compressionMethod=p.readString(2),this.date=p.readDate(),this.crc32=p.readInt(4),this.compressedSize=p.readInt(4),this.uncompressedSize=p.readInt(4);var h=p.readInt(2);if(this.extraFieldsLength=p.readInt(2),this.fileCommentLength=p.readInt(2),this.diskNumberStart=p.readInt(2),this.internalFileAttributes=p.readInt(2),this.externalFileAttributes=p.readInt(4),this.localHeaderOffset=p.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");p.skip(h),this.readExtraFields(p),this.parseZIP64ExtraField(p),this.fileComment=p.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var p=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),p==0&&(this.dosPermissions=63&this.externalFileAttributes),p==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var p=i(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=p.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=p.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=p.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=p.readInt(4))}},readExtraFields:function(p){var h,m,y,g=p.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});p.index+4<g;)h=p.readInt(2),m=p.readInt(2),y=p.readData(m),this.extraFields[h]={id:h,length:m,value:y};p.setIndex(g)},handleUTF8:function(){var p=d.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var h=this.findExtraFieldUnicodePath();if(h!==null)this.fileNameStr=h;else{var m=s.transformTo(p,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(m)}var y=this.findExtraFieldUnicodeComment();if(y!==null)this.fileCommentStr=y;else{var g=s.transformTo(p,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(g)}}},findExtraFieldUnicodePath:function(){var p=this.extraFields[28789];if(p){var h=i(p.value);return h.readInt(1)!==1||l(this.fileName)!==h.readInt(4)?null:c.utf8decode(h.readData(p.length-5))}return null},findExtraFieldUnicodeComment:function(){var p=this.extraFields[25461];if(p){var h=i(p.value);return h.readInt(1)!==1||l(this.fileComment)!==h.readInt(4)?null:c.utf8decode(h.readData(p.length-5))}return null}},r.exports=f},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(n,r,o){function i(h,m,y){this.name=h,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=n("./stream/StreamHelper"),a=n("./stream/DataWorker"),l=n("./utf8"),c=n("./compressedObject"),u=n("./stream/GenericWorker");i.prototype={internalStream:function(h){var m=null,y="string";try{if(!h)throw new Error("No output type specified.");var g=(y=h.toLowerCase())==="string"||y==="text";y!=="binarystring"&&y!=="text"||(y="string"),m=this._decompressWorker();var x=!this._dataBinary;x&&!g&&(m=m.pipe(new l.Utf8EncodeWorker)),!x&&g&&(m=m.pipe(new l.Utf8DecodeWorker))}catch(k){(m=new u("error")).error(k)}return new s(m,y,"")},async:function(h,m){return this.internalStream(h).accumulate(m)},nodeStream:function(h,m){return this.internalStream(h||"nodebuffer").toNodejsStream(m)},_compressWorker:function(h,m){if(this._data instanceof c&&this._data.compression.magic===h.magic)return this._data.getCompressedWorker();var y=this._decompressWorker();return this._dataBinary||(y=y.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(y,h,m)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof u?this._data:new a(this._data)}};for(var d=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],f=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},p=0;p<d.length;p++)i.prototype[d[p]]=f;r.exports=i},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(n,r,o){(function(i){var s,a,l=i.MutationObserver||i.WebKitMutationObserver;if(l){var c=0,u=new l(h),d=i.document.createTextNode("");u.observe(d,{characterData:!0}),s=function(){d.data=c=++c%2}}else if(i.setImmediate||i.MessageChannel===void 0)s="document"in i&&"onreadystatechange"in i.document.createElement("script")?function(){var m=i.document.createElement("script");m.onreadystatechange=function(){h(),m.onreadystatechange=null,m.parentNode.removeChild(m),m=null},i.document.documentElement.appendChild(m)}:function(){setTimeout(h,0)};else{var f=new i.MessageChannel;f.port1.onmessage=h,s=function(){f.port2.postMessage(0)}}var p=[];function h(){var m,y;a=!0;for(var g=p.length;g;){for(y=p,p=[],m=-1;++m<g;)y[m]();g=p.length}a=!1}r.exports=function(m){p.push(m)!==1||a||s()}}).call(this,typeof zt<"u"?zt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(n,r,o){var i=n("immediate");function s(){}var a={},l=["REJECTED"],c=["FULFILLED"],u=["PENDING"];function d(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 f(g,x,k){this.promise=g,typeof x=="function"&&(this.onFulfilled=x,this.callFulfilled=this.otherCallFulfilled),typeof k=="function"&&(this.onRejected=k,this.callRejected=this.otherCallRejected)}function p(g,x,k){i(function(){var w;try{w=x(k)}catch(T){return a.reject(g,T)}w===g?a.reject(g,new TypeError("Cannot resolve promise with itself")):a.resolve(g,w)})}function h(g){var x=g&&g.then;if(g&&(typeof g=="object"||typeof g=="function")&&typeof x=="function")return function(){x.apply(g,arguments)}}function m(g,x){var k=!1;function w(M){k||(k=!0,a.reject(g,M))}function T(M){k||(k=!0,a.resolve(g,M))}var D=y(function(){x(T,w)});D.status==="error"&&w(D.value)}function y(g,x){var k={};try{k.value=g(x),k.status="success"}catch(w){k.status="error",k.value=w}return k}(r.exports=d).prototype.finally=function(g){if(typeof g!="function")return this;var x=this.constructor;return this.then(function(k){return x.resolve(g()).then(function(){return k})},function(k){return x.resolve(g()).then(function(){throw k})})},d.prototype.catch=function(g){return this.then(null,g)},d.prototype.then=function(g,x){if(typeof g!="function"&&this.state===c||typeof x!="function"&&this.state===l)return this;var k=new this.constructor(s);return this.state!==u?p(k,this.state===c?g:x,this.outcome):this.queue.push(new f(k,g,x)),k},f.prototype.callFulfilled=function(g){a.resolve(this.promise,g)},f.prototype.otherCallFulfilled=function(g){p(this.promise,this.onFulfilled,g)},f.prototype.callRejected=function(g){a.reject(this.promise,g)},f.prototype.otherCallRejected=function(g){p(this.promise,this.onRejected,g)},a.resolve=function(g,x){var k=y(h,x);if(k.status==="error")return a.reject(g,k.value);var w=k.value;if(w)m(g,w);else{g.state=c,g.outcome=x;for(var T=-1,D=g.queue.length;++T<D;)g.queue[T].callFulfilled(x)}return g},a.reject=function(g,x){g.state=l,g.outcome=x;for(var k=-1,w=g.queue.length;++k<w;)g.queue[k].callRejected(x);return g},d.resolve=function(g){return g instanceof this?g:a.resolve(new this(s),g)},d.reject=function(g){var x=new this(s);return a.reject(x,g)},d.all=function(g){var x=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,w=!1;if(!k)return this.resolve([]);for(var T=new Array(k),D=0,M=-1,F=new this(s);++M<k;)C(g[M],M);return F;function C(U,ie){x.resolve(U).then(function(I){T[ie]=I,++D!==k||w||(w=!0,a.resolve(F,T))},function(I){w||(w=!0,a.reject(F,I))})}},d.race=function(g){var x=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,w=!1;if(!k)return this.resolve([]);for(var T=-1,D=new this(s);++T<k;)M=g[T],x.resolve(M).then(function(F){w||(w=!0,a.resolve(D,F))},function(F){w||(w=!0,a.reject(D,F))});var M;return D}},{immediate:36}],38:[function(n,r,o){var i={};(0,n("./lib/utils/common").assign)(i,n("./lib/deflate"),n("./lib/inflate"),n("./lib/zlib/constants")),r.exports=i},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(n,r,o){var i=n("./zlib/deflate"),s=n("./utils/common"),a=n("./utils/strings"),l=n("./zlib/messages"),c=n("./zlib/zstream"),u=Object.prototype.toString,d=0,f=-1,p=0,h=8;function m(g){if(!(this instanceof m))return new m(g);this.options=s.assign({level:f,method:h,chunkSize:16384,windowBits:15,memLevel:8,strategy:p,to:""},g||{});var x=this.options;x.raw&&0<x.windowBits?x.windowBits=-x.windowBits:x.gzip&&0<x.windowBits&&x.windowBits<16&&(x.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var k=i.deflateInit2(this.strm,x.level,x.method,x.windowBits,x.memLevel,x.strategy);if(k!==d)throw new Error(l[k]);if(x.header&&i.deflateSetHeader(this.strm,x.header),x.dictionary){var w;if(w=typeof x.dictionary=="string"?a.string2buf(x.dictionary):u.call(x.dictionary)==="[object ArrayBuffer]"?new Uint8Array(x.dictionary):x.dictionary,(k=i.deflateSetDictionary(this.strm,w))!==d)throw new Error(l[k]);this._dict_set=!0}}function y(g,x){var k=new m(x);if(k.push(g,!0),k.err)throw k.msg||l[k.err];return k.result}m.prototype.push=function(g,x){var k,w,T=this.strm,D=this.options.chunkSize;if(this.ended)return!1;w=x===~~x?x:x===!0?4:0,typeof g=="string"?T.input=a.string2buf(g):u.call(g)==="[object ArrayBuffer]"?T.input=new Uint8Array(g):T.input=g,T.next_in=0,T.avail_in=T.input.length;do{if(T.avail_out===0&&(T.output=new s.Buf8(D),T.next_out=0,T.avail_out=D),(k=i.deflate(T,w))!==1&&k!==d)return this.onEnd(k),!(this.ended=!0);T.avail_out!==0&&(T.avail_in!==0||w!==4&&w!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(s.shrinkBuf(T.output,T.next_out))):this.onData(s.shrinkBuf(T.output,T.next_out)))}while((0<T.avail_in||T.avail_out===0)&&k!==1);return w===4?(k=i.deflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===d):w!==2||(this.onEnd(d),!(T.avail_out=0))},m.prototype.onData=function(g){this.chunks.push(g)},m.prototype.onEnd=function(g){g===d&&(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},o.Deflate=m,o.deflate=y,o.deflateRaw=function(g,x){return(x=x||{}).raw=!0,y(g,x)},o.gzip=function(g,x){return(x=x||{}).gzip=!0,y(g,x)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(n,r,o){var i=n("./zlib/inflate"),s=n("./utils/common"),a=n("./utils/strings"),l=n("./zlib/constants"),c=n("./zlib/messages"),u=n("./zlib/zstream"),d=n("./zlib/gzheader"),f=Object.prototype.toString;function p(m){if(!(this instanceof p))return new p(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=i.inflateInit2(this.strm,y.windowBits);if(g!==l.Z_OK)throw new Error(c[g]);this.header=new d,i.inflateGetHeader(this.strm,this.header)}function h(m,y){var g=new p(y);if(g.push(m,!0),g.err)throw g.msg||c[g.err];return g.result}p.prototype.push=function(m,y){var g,x,k,w,T,D,M=this.strm,F=this.options.chunkSize,C=this.options.dictionary,U=!1;if(this.ended)return!1;x=y===~~y?y:y===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof m=="string"?M.input=a.binstring2buf(m):f.call(m)==="[object ArrayBuffer]"?M.input=new Uint8Array(m):M.input=m,M.next_in=0,M.avail_in=M.input.length;do{if(M.avail_out===0&&(M.output=new s.Buf8(F),M.next_out=0,M.avail_out=F),(g=i.inflate(M,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&C&&(D=typeof C=="string"?a.string2buf(C):f.call(C)==="[object ArrayBuffer]"?new Uint8Array(C):C,g=i.inflateSetDictionary(this.strm,D)),g===l.Z_BUF_ERROR&&U===!0&&(g=l.Z_OK,U=!1),g!==l.Z_STREAM_END&&g!==l.Z_OK)return this.onEnd(g),!(this.ended=!0);M.next_out&&(M.avail_out!==0&&g!==l.Z_STREAM_END&&(M.avail_in!==0||x!==l.Z_FINISH&&x!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(k=a.utf8border(M.output,M.next_out),w=M.next_out-k,T=a.buf2string(M.output,k),M.next_out=w,M.avail_out=F-w,w&&s.arraySet(M.output,M.output,k,w,0),this.onData(T)):this.onData(s.shrinkBuf(M.output,M.next_out)))),M.avail_in===0&&M.avail_out===0&&(U=!0)}while((0<M.avail_in||M.avail_out===0)&&g!==l.Z_STREAM_END);return g===l.Z_STREAM_END&&(x=l.Z_FINISH),x===l.Z_FINISH?(g=i.inflateEnd(this.strm),this.onEnd(g),this.ended=!0,g===l.Z_OK):x!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(M.avail_out=0))},p.prototype.onData=function(m){this.chunks.push(m)},p.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},o.Inflate=p,o.inflate=h,o.inflateRaw=function(m,y){return(y=y||{}).raw=!0,h(m,y)},o.ungzip=h},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(n,r,o){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";o.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 d in u)u.hasOwnProperty(d)&&(l[d]=u[d])}}return l},o.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,d,f){if(c.subarray&&l.subarray)l.set(c.subarray(u,u+d),f);else for(var p=0;p<d;p++)l[f+p]=c[u+p]},flattenChunks:function(l){var c,u,d,f,p,h;for(c=d=0,u=l.length;c<u;c++)d+=l[c].length;for(h=new Uint8Array(d),c=f=0,u=l.length;c<u;c++)p=l[c],h.set(p,f),f+=p.length;return h}},a={arraySet:function(l,c,u,d,f){for(var p=0;p<d;p++)l[f+p]=c[u+p]},flattenChunks:function(l){return[].concat.apply([],l)}};o.setTyped=function(l){l?(o.Buf8=Uint8Array,o.Buf16=Uint16Array,o.Buf32=Int32Array,o.assign(o,s)):(o.Buf8=Array,o.Buf16=Array,o.Buf32=Array,o.assign(o,a))},o.setTyped(i)},{}],42:[function(n,r,o){var i=n("./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 i.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(d,f){if(f<65537&&(d.subarray&&a||!d.subarray&&s))return String.fromCharCode.apply(null,i.shrinkBuf(d,f));for(var p="",h=0;h<f;h++)p+=String.fromCharCode(d[h]);return p}l[254]=l[254]=1,o.string2buf=function(d){var f,p,h,m,y,g=d.length,x=0;for(m=0;m<g;m++)(64512&(p=d.charCodeAt(m)))==55296&&m+1<g&&(64512&(h=d.charCodeAt(m+1)))==56320&&(p=65536+(p-55296<<10)+(h-56320),m++),x+=p<128?1:p<2048?2:p<65536?3:4;for(f=new i.Buf8(x),m=y=0;y<x;m++)(64512&(p=d.charCodeAt(m)))==55296&&m+1<g&&(64512&(h=d.charCodeAt(m+1)))==56320&&(p=65536+(p-55296<<10)+(h-56320),m++),p<128?f[y++]=p:(p<2048?f[y++]=192|p>>>6:(p<65536?f[y++]=224|p>>>12:(f[y++]=240|p>>>18,f[y++]=128|p>>>12&63),f[y++]=128|p>>>6&63),f[y++]=128|63&p);return f},o.buf2binstring=function(d){return u(d,d.length)},o.binstring2buf=function(d){for(var f=new i.Buf8(d.length),p=0,h=f.length;p<h;p++)f[p]=d.charCodeAt(p);return f},o.buf2string=function(d,f){var p,h,m,y,g=f||d.length,x=new Array(2*g);for(p=h=0;p<g;)if((m=d[p++])<128)x[h++]=m;else if(4<(y=l[m]))x[h++]=65533,p+=y-1;else{for(m&=y===2?31:y===3?15:7;1<y&&p<g;)m=m<<6|63&d[p++],y--;1<y?x[h++]=65533:m<65536?x[h++]=m:(m-=65536,x[h++]=55296|m>>10&1023,x[h++]=56320|1023&m)}return u(x,h)},o.utf8border=function(d,f){var p;for((f=f||d.length)>d.length&&(f=d.length),p=f-1;0<=p&&(192&d[p])==128;)p--;return p<0||p===0?f:p+l[d[p]]>f?p:f}},{"./common":41}],43:[function(n,r,o){r.exports=function(i,s,a,l){for(var c=65535&i|0,u=i>>>16&65535|0,d=0;a!==0;){for(a-=d=2e3<a?2e3:a;u=u+(c=c+s[l++]|0)|0,--d;);c%=65521,u%=65521}return c|u<<16|0}},{}],44:[function(n,r,o){r.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(n,r,o){var i=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}();r.exports=function(s,a,l,c){var u=i,d=c+l;s^=-1;for(var f=c;f<d;f++)s=s>>>8^u[255&(s^a[f])];return-1^s}},{}],46:[function(n,r,o){var i,s=n("../utils/common"),a=n("./trees"),l=n("./adler32"),c=n("./crc32"),u=n("./messages"),d=0,f=4,p=0,h=-2,m=-1,y=4,g=2,x=8,k=9,w=286,T=30,D=19,M=2*w+1,F=15,C=3,U=258,ie=U+C+1,I=42,W=113,A=1,G=2,ae=3,X=4;function de(S,oe){return S.msg=u[oe],oe}function J(S){return(S<<1)-(4<S?9:0)}function pe(S){for(var oe=S.length;0<=--oe;)S[oe]=0}function Q(S){var oe=S.state,te=oe.pending;te>S.avail_out&&(te=S.avail_out),te!==0&&(s.arraySet(S.output,oe.pending_buf,oe.pending_out,te,S.next_out),S.next_out+=te,oe.pending_out+=te,S.total_out+=te,S.avail_out-=te,oe.pending-=te,oe.pending===0&&(oe.pending_out=0))}function B(S,oe){a._tr_flush_block(S,0<=S.block_start?S.block_start:-1,S.strstart-S.block_start,oe),S.block_start=S.strstart,Q(S.strm)}function ee(S,oe){S.pending_buf[S.pending++]=oe}function Z(S,oe){S.pending_buf[S.pending++]=oe>>>8&255,S.pending_buf[S.pending++]=255&oe}function re(S,oe){var te,L,z=S.max_chain_length,P=S.strstart,fe=S.prev_length,me=S.nice_match,se=S.strstart>S.w_size-ie?S.strstart-(S.w_size-ie):0,ge=S.window,ce=S.w_mask,ue=S.prev,we=S.strstart+U,_e=ge[P+fe-1],Ce=ge[P+fe];S.prev_length>=S.good_match&&(z>>=2),me>S.lookahead&&(me=S.lookahead);do if(ge[(te=oe)+fe]===Ce&&ge[te+fe-1]===_e&&ge[te]===ge[P]&&ge[++te]===ge[P+1]){P+=2,te++;do;while(ge[++P]===ge[++te]&&ge[++P]===ge[++te]&&ge[++P]===ge[++te]&&ge[++P]===ge[++te]&&ge[++P]===ge[++te]&&ge[++P]===ge[++te]&&ge[++P]===ge[++te]&&ge[++P]===ge[++te]&&P<we);if(L=U-(we-P),P=we-U,fe<L){if(S.match_start=oe,me<=(fe=L))break;_e=ge[P+fe-1],Ce=ge[P+fe]}}while((oe=ue[oe&ce])>se&&--z!=0);return fe<=S.lookahead?fe:S.lookahead}function K(S){var oe,te,L,z,P,fe,me,se,ge,ce,ue=S.w_size;do{if(z=S.window_size-S.lookahead-S.strstart,S.strstart>=ue+(ue-ie)){for(s.arraySet(S.window,S.window,ue,ue,0),S.match_start-=ue,S.strstart-=ue,S.block_start-=ue,oe=te=S.hash_size;L=S.head[--oe],S.head[oe]=ue<=L?L-ue:0,--te;);for(oe=te=ue;L=S.prev[--oe],S.prev[oe]=ue<=L?L-ue:0,--te;);z+=ue}if(S.strm.avail_in===0)break;if(fe=S.strm,me=S.window,se=S.strstart+S.lookahead,ge=z,ce=void 0,ce=fe.avail_in,ge<ce&&(ce=ge),te=ce===0?0:(fe.avail_in-=ce,s.arraySet(me,fe.input,fe.next_in,ce,se),fe.state.wrap===1?fe.adler=l(fe.adler,me,ce,se):fe.state.wrap===2&&(fe.adler=c(fe.adler,me,ce,se)),fe.next_in+=ce,fe.total_in+=ce,ce),S.lookahead+=te,S.lookahead+S.insert>=C)for(P=S.strstart-S.insert,S.ins_h=S.window[P],S.ins_h=(S.ins_h<<S.hash_shift^S.window[P+1])&S.hash_mask;S.insert&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[P+C-1])&S.hash_mask,S.prev[P&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=P,P++,S.insert--,!(S.lookahead+S.insert<C)););}while(S.lookahead<ie&&S.strm.avail_in!==0)}function $(S,oe){for(var te,L;;){if(S.lookahead<ie){if(K(S),S.lookahead<ie&&oe===d)return A;if(S.lookahead===0)break}if(te=0,S.lookahead>=C&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+C-1])&S.hash_mask,te=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart),te!==0&&S.strstart-te<=S.w_size-ie&&(S.match_length=re(S,te)),S.match_length>=C)if(L=a._tr_tally(S,S.strstart-S.match_start,S.match_length-C),S.lookahead-=S.match_length,S.match_length<=S.max_lazy_match&&S.lookahead>=C){for(S.match_length--;S.strstart++,S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+C-1])&S.hash_mask,te=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart,--S.match_length!=0;);S.strstart++}else S.strstart+=S.match_length,S.match_length=0,S.ins_h=S.window[S.strstart],S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+1])&S.hash_mask;else L=a._tr_tally(S,0,S.window[S.strstart]),S.lookahead--,S.strstart++;if(L&&(B(S,!1),S.strm.avail_out===0))return A}return S.insert=S.strstart<C-1?S.strstart:C-1,oe===f?(B(S,!0),S.strm.avail_out===0?ae:X):S.last_lit&&(B(S,!1),S.strm.avail_out===0)?A:G}function E(S,oe){for(var te,L,z;;){if(S.lookahead<ie){if(K(S),S.lookahead<ie&&oe===d)return A;if(S.lookahead===0)break}if(te=0,S.lookahead>=C&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+C-1])&S.hash_mask,te=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart),S.prev_length=S.match_length,S.prev_match=S.match_start,S.match_length=C-1,te!==0&&S.prev_length<S.max_lazy_match&&S.strstart-te<=S.w_size-ie&&(S.match_length=re(S,te),S.match_length<=5&&(S.strategy===1||S.match_length===C&&4096<S.strstart-S.match_start)&&(S.match_length=C-1)),S.prev_length>=C&&S.match_length<=S.prev_length){for(z=S.strstart+S.lookahead-C,L=a._tr_tally(S,S.strstart-1-S.prev_match,S.prev_length-C),S.lookahead-=S.prev_length-1,S.prev_length-=2;++S.strstart<=z&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+C-1])&S.hash_mask,te=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart),--S.prev_length!=0;);if(S.match_available=0,S.match_length=C-1,S.strstart++,L&&(B(S,!1),S.strm.avail_out===0))return A}else if(S.match_available){if((L=a._tr_tally(S,0,S.window[S.strstart-1]))&&B(S,!1),S.strstart++,S.lookahead--,S.strm.avail_out===0)return A}else S.match_available=1,S.strstart++,S.lookahead--}return S.match_available&&(L=a._tr_tally(S,0,S.window[S.strstart-1]),S.match_available=0),S.insert=S.strstart<C-1?S.strstart:C-1,oe===f?(B(S,!0),S.strm.avail_out===0?ae:X):S.last_lit&&(B(S,!1),S.strm.avail_out===0)?A:G}function H(S,oe,te,L,z){this.good_length=S,this.max_lazy=oe,this.nice_length=te,this.max_chain=L,this.func=z}function q(){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=x,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*M),this.dyn_dtree=new s.Buf16(2*(2*T+1)),this.bl_tree=new s.Buf16(2*(2*D+1)),pe(this.dyn_ltree),pe(this.dyn_dtree),pe(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new s.Buf16(F+1),this.heap=new s.Buf16(2*w+1),pe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(2*w+1),pe(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 N(S){var oe;return S&&S.state?(S.total_in=S.total_out=0,S.data_type=g,(oe=S.state).pending=0,oe.pending_out=0,oe.wrap<0&&(oe.wrap=-oe.wrap),oe.status=oe.wrap?I:W,S.adler=oe.wrap===2?0:1,oe.last_flush=d,a._tr_init(oe),p):de(S,h)}function R(S){var oe=N(S);return oe===p&&function(te){te.window_size=2*te.w_size,pe(te.head),te.max_lazy_match=i[te.level].max_lazy,te.good_match=i[te.level].good_length,te.nice_match=i[te.level].nice_length,te.max_chain_length=i[te.level].max_chain,te.strstart=0,te.block_start=0,te.lookahead=0,te.insert=0,te.match_length=te.prev_length=C-1,te.match_available=0,te.ins_h=0}(S.state),oe}function le(S,oe,te,L,z,P){if(!S)return h;var fe=1;if(oe===m&&(oe=6),L<0?(fe=0,L=-L):15<L&&(fe=2,L-=16),z<1||k<z||te!==x||L<8||15<L||oe<0||9<oe||P<0||y<P)return de(S,h);L===8&&(L=9);var me=new q;return(S.state=me).strm=S,me.wrap=fe,me.gzhead=null,me.w_bits=L,me.w_size=1<<me.w_bits,me.w_mask=me.w_size-1,me.hash_bits=z+7,me.hash_size=1<<me.hash_bits,me.hash_mask=me.hash_size-1,me.hash_shift=~~((me.hash_bits+C-1)/C),me.window=new s.Buf8(2*me.w_size),me.head=new s.Buf16(me.hash_size),me.prev=new s.Buf16(me.w_size),me.lit_bufsize=1<<z+6,me.pending_buf_size=4*me.lit_bufsize,me.pending_buf=new s.Buf8(me.pending_buf_size),me.d_buf=1*me.lit_bufsize,me.l_buf=3*me.lit_bufsize,me.level=oe,me.strategy=P,me.method=te,R(S)}i=[new H(0,0,0,0,function(S,oe){var te=65535;for(te>S.pending_buf_size-5&&(te=S.pending_buf_size-5);;){if(S.lookahead<=1){if(K(S),S.lookahead===0&&oe===d)return A;if(S.lookahead===0)break}S.strstart+=S.lookahead,S.lookahead=0;var L=S.block_start+te;if((S.strstart===0||S.strstart>=L)&&(S.lookahead=S.strstart-L,S.strstart=L,B(S,!1),S.strm.avail_out===0)||S.strstart-S.block_start>=S.w_size-ie&&(B(S,!1),S.strm.avail_out===0))return A}return S.insert=0,oe===f?(B(S,!0),S.strm.avail_out===0?ae:X):(S.strstart>S.block_start&&(B(S,!1),S.strm.avail_out),A)}),new H(4,4,8,4,$),new H(4,5,16,8,$),new H(4,6,32,32,$),new H(4,4,16,16,E),new H(8,16,32,32,E),new H(8,16,128,128,E),new H(8,32,128,256,E),new H(32,128,258,1024,E),new H(32,258,258,4096,E)],o.deflateInit=function(S,oe){return le(S,oe,x,15,8,0)},o.deflateInit2=le,o.deflateReset=R,o.deflateResetKeep=N,o.deflateSetHeader=function(S,oe){return S&&S.state?S.state.wrap!==2?h:(S.state.gzhead=oe,p):h},o.deflate=function(S,oe){var te,L,z,P;if(!S||!S.state||5<oe||oe<0)return S?de(S,h):h;if(L=S.state,!S.output||!S.input&&S.avail_in!==0||L.status===666&&oe!==f)return de(S,S.avail_out===0?-5:h);if(L.strm=S,te=L.last_flush,L.last_flush=oe,L.status===I)if(L.wrap===2)S.adler=0,ee(L,31),ee(L,139),ee(L,8),L.gzhead?(ee(L,(L.gzhead.text?1:0)+(L.gzhead.hcrc?2:0)+(L.gzhead.extra?4:0)+(L.gzhead.name?8:0)+(L.gzhead.comment?16:0)),ee(L,255&L.gzhead.time),ee(L,L.gzhead.time>>8&255),ee(L,L.gzhead.time>>16&255),ee(L,L.gzhead.time>>24&255),ee(L,L.level===9?2:2<=L.strategy||L.level<2?4:0),ee(L,255&L.gzhead.os),L.gzhead.extra&&L.gzhead.extra.length&&(ee(L,255&L.gzhead.extra.length),ee(L,L.gzhead.extra.length>>8&255)),L.gzhead.hcrc&&(S.adler=c(S.adler,L.pending_buf,L.pending,0)),L.gzindex=0,L.status=69):(ee(L,0),ee(L,0),ee(L,0),ee(L,0),ee(L,0),ee(L,L.level===9?2:2<=L.strategy||L.level<2?4:0),ee(L,3),L.status=W);else{var fe=x+(L.w_bits-8<<4)<<8;fe|=(2<=L.strategy||L.level<2?0:L.level<6?1:L.level===6?2:3)<<6,L.strstart!==0&&(fe|=32),fe+=31-fe%31,L.status=W,Z(L,fe),L.strstart!==0&&(Z(L,S.adler>>>16),Z(L,65535&S.adler)),S.adler=1}if(L.status===69)if(L.gzhead.extra){for(z=L.pending;L.gzindex<(65535&L.gzhead.extra.length)&&(L.pending!==L.pending_buf_size||(L.gzhead.hcrc&&L.pending>z&&(S.adler=c(S.adler,L.pending_buf,L.pending-z,z)),Q(S),z=L.pending,L.pending!==L.pending_buf_size));)ee(L,255&L.gzhead.extra[L.gzindex]),L.gzindex++;L.gzhead.hcrc&&L.pending>z&&(S.adler=c(S.adler,L.pending_buf,L.pending-z,z)),L.gzindex===L.gzhead.extra.length&&(L.gzindex=0,L.status=73)}else L.status=73;if(L.status===73)if(L.gzhead.name){z=L.pending;do{if(L.pending===L.pending_buf_size&&(L.gzhead.hcrc&&L.pending>z&&(S.adler=c(S.adler,L.pending_buf,L.pending-z,z)),Q(S),z=L.pending,L.pending===L.pending_buf_size)){P=1;break}P=L.gzindex<L.gzhead.name.length?255&L.gzhead.name.charCodeAt(L.gzindex++):0,ee(L,P)}while(P!==0);L.gzhead.hcrc&&L.pending>z&&(S.adler=c(S.adler,L.pending_buf,L.pending-z,z)),P===0&&(L.gzindex=0,L.status=91)}else L.status=91;if(L.status===91)if(L.gzhead.comment){z=L.pending;do{if(L.pending===L.pending_buf_size&&(L.gzhead.hcrc&&L.pending>z&&(S.adler=c(S.adler,L.pending_buf,L.pending-z,z)),Q(S),z=L.pending,L.pending===L.pending_buf_size)){P=1;break}P=L.gzindex<L.gzhead.comment.length?255&L.gzhead.comment.charCodeAt(L.gzindex++):0,ee(L,P)}while(P!==0);L.gzhead.hcrc&&L.pending>z&&(S.adler=c(S.adler,L.pending_buf,L.pending-z,z)),P===0&&(L.status=103)}else L.status=103;if(L.status===103&&(L.gzhead.hcrc?(L.pending+2>L.pending_buf_size&&Q(S),L.pending+2<=L.pending_buf_size&&(ee(L,255&S.adler),ee(L,S.adler>>8&255),S.adler=0,L.status=W)):L.status=W),L.pending!==0){if(Q(S),S.avail_out===0)return L.last_flush=-1,p}else if(S.avail_in===0&&J(oe)<=J(te)&&oe!==f)return de(S,-5);if(L.status===666&&S.avail_in!==0)return de(S,-5);if(S.avail_in!==0||L.lookahead!==0||oe!==d&&L.status!==666){var me=L.strategy===2?function(se,ge){for(var ce;;){if(se.lookahead===0&&(K(se),se.lookahead===0)){if(ge===d)return A;break}if(se.match_length=0,ce=a._tr_tally(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++,ce&&(B(se,!1),se.strm.avail_out===0))return A}return se.insert=0,ge===f?(B(se,!0),se.strm.avail_out===0?ae:X):se.last_lit&&(B(se,!1),se.strm.avail_out===0)?A:G}(L,oe):L.strategy===3?function(se,ge){for(var ce,ue,we,_e,Ce=se.window;;){if(se.lookahead<=U){if(K(se),se.lookahead<=U&&ge===d)return A;if(se.lookahead===0)break}if(se.match_length=0,se.lookahead>=C&&0<se.strstart&&(ue=Ce[we=se.strstart-1])===Ce[++we]&&ue===Ce[++we]&&ue===Ce[++we]){_e=se.strstart+U;do;while(ue===Ce[++we]&&ue===Ce[++we]&&ue===Ce[++we]&&ue===Ce[++we]&&ue===Ce[++we]&&ue===Ce[++we]&&ue===Ce[++we]&&ue===Ce[++we]&&we<_e);se.match_length=U-(_e-we),se.match_length>se.lookahead&&(se.match_length=se.lookahead)}if(se.match_length>=C?(ce=a._tr_tally(se,1,se.match_length-C),se.lookahead-=se.match_length,se.strstart+=se.match_length,se.match_length=0):(ce=a._tr_tally(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++),ce&&(B(se,!1),se.strm.avail_out===0))return A}return se.insert=0,ge===f?(B(se,!0),se.strm.avail_out===0?ae:X):se.last_lit&&(B(se,!1),se.strm.avail_out===0)?A:G}(L,oe):i[L.level].func(L,oe);if(me!==ae&&me!==X||(L.status=666),me===A||me===ae)return S.avail_out===0&&(L.last_flush=-1),p;if(me===G&&(oe===1?a._tr_align(L):oe!==5&&(a._tr_stored_block(L,0,0,!1),oe===3&&(pe(L.head),L.lookahead===0&&(L.strstart=0,L.block_start=0,L.insert=0))),Q(S),S.avail_out===0))return L.last_flush=-1,p}return oe!==f?p:L.wrap<=0?1:(L.wrap===2?(ee(L,255&S.adler),ee(L,S.adler>>8&255),ee(L,S.adler>>16&255),ee(L,S.adler>>24&255),ee(L,255&S.total_in),ee(L,S.total_in>>8&255),ee(L,S.total_in>>16&255),ee(L,S.total_in>>24&255)):(Z(L,S.adler>>>16),Z(L,65535&S.adler)),Q(S),0<L.wrap&&(L.wrap=-L.wrap),L.pending!==0?p:1)},o.deflateEnd=function(S){var oe;return S&&S.state?(oe=S.state.status)!==I&&oe!==69&&oe!==73&&oe!==91&&oe!==103&&oe!==W&&oe!==666?de(S,h):(S.state=null,oe===W?de(S,-3):p):h},o.deflateSetDictionary=function(S,oe){var te,L,z,P,fe,me,se,ge,ce=oe.length;if(!S||!S.state||(P=(te=S.state).wrap)===2||P===1&&te.status!==I||te.lookahead)return h;for(P===1&&(S.adler=l(S.adler,oe,ce,0)),te.wrap=0,ce>=te.w_size&&(P===0&&(pe(te.head),te.strstart=0,te.block_start=0,te.insert=0),ge=new s.Buf8(te.w_size),s.arraySet(ge,oe,ce-te.w_size,te.w_size,0),oe=ge,ce=te.w_size),fe=S.avail_in,me=S.next_in,se=S.input,S.avail_in=ce,S.next_in=0,S.input=oe,K(te);te.lookahead>=C;){for(L=te.strstart,z=te.lookahead-(C-1);te.ins_h=(te.ins_h<<te.hash_shift^te.window[L+C-1])&te.hash_mask,te.prev[L&te.w_mask]=te.head[te.ins_h],te.head[te.ins_h]=L,L++,--z;);te.strstart=L,te.lookahead=C-1,K(te)}return te.strstart+=te.lookahead,te.block_start=te.strstart,te.insert=te.lookahead,te.lookahead=0,te.match_length=te.prev_length=C-1,te.match_available=0,S.next_in=me,S.input=se,S.avail_in=fe,te.wrap=P,p},o.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(n,r,o){r.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(n,r,o){r.exports=function(i,s){var a,l,c,u,d,f,p,h,m,y,g,x,k,w,T,D,M,F,C,U,ie,I,W,A,G;a=i.state,l=i.next_in,A=i.input,c=l+(i.avail_in-5),u=i.next_out,G=i.output,d=u-(s-i.avail_out),f=u+(i.avail_out-257),p=a.dmax,h=a.wsize,m=a.whave,y=a.wnext,g=a.window,x=a.hold,k=a.bits,w=a.lencode,T=a.distcode,D=(1<<a.lenbits)-1,M=(1<<a.distbits)-1;e:do{k<15&&(x+=A[l++]<<k,k+=8,x+=A[l++]<<k,k+=8),F=w[x&D];t:for(;;){if(x>>>=C=F>>>24,k-=C,(C=F>>>16&255)===0)G[u++]=65535&F;else{if(!(16&C)){if(!(64&C)){F=w[(65535&F)+(x&(1<<C)-1)];continue t}if(32&C){a.mode=12;break e}i.msg="invalid literal/length code",a.mode=30;break e}U=65535&F,(C&=15)&&(k<C&&(x+=A[l++]<<k,k+=8),U+=x&(1<<C)-1,x>>>=C,k-=C),k<15&&(x+=A[l++]<<k,k+=8,x+=A[l++]<<k,k+=8),F=T[x&M];n:for(;;){if(x>>>=C=F>>>24,k-=C,!(16&(C=F>>>16&255))){if(!(64&C)){F=T[(65535&F)+(x&(1<<C)-1)];continue n}i.msg="invalid distance code",a.mode=30;break e}if(ie=65535&F,k<(C&=15)&&(x+=A[l++]<<k,(k+=8)<C&&(x+=A[l++]<<k,k+=8)),p<(ie+=x&(1<<C)-1)){i.msg="invalid distance too far back",a.mode=30;break e}if(x>>>=C,k-=C,(C=u-d)<ie){if(m<(C=ie-C)&&a.sane){i.msg="invalid distance too far back",a.mode=30;break e}if(W=g,(I=0)===y){if(I+=h-C,C<U){for(U-=C;G[u++]=g[I++],--C;);I=u-ie,W=G}}else if(y<C){if(I+=h+y-C,(C-=y)<U){for(U-=C;G[u++]=g[I++],--C;);if(I=0,y<U){for(U-=C=y;G[u++]=g[I++],--C;);I=u-ie,W=G}}}else if(I+=y-C,C<U){for(U-=C;G[u++]=g[I++],--C;);I=u-ie,W=G}for(;2<U;)G[u++]=W[I++],G[u++]=W[I++],G[u++]=W[I++],U-=3;U&&(G[u++]=W[I++],1<U&&(G[u++]=W[I++]))}else{for(I=u-ie;G[u++]=G[I++],G[u++]=G[I++],G[u++]=G[I++],2<(U-=3););U&&(G[u++]=G[I++],1<U&&(G[u++]=G[I++]))}break}}break}}while(l<c&&u<f);l-=U=k>>3,x&=(1<<(k-=U<<3))-1,i.next_in=l,i.next_out=u,i.avail_in=l<c?c-l+5:5-(l-c),i.avail_out=u<f?f-u+257:257-(u-f),a.hold=x,a.bits=k}},{}],49:[function(n,r,o){var i=n("../utils/common"),s=n("./adler32"),a=n("./crc32"),l=n("./inffast"),c=n("./inftrees"),u=1,d=2,f=0,p=-2,h=1,m=852,y=592;function g(I){return(I>>>24&255)+(I>>>8&65280)+((65280&I)<<8)+((255&I)<<24)}function x(){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 i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function k(I){var W;return I&&I.state?(W=I.state,I.total_in=I.total_out=W.total=0,I.msg="",W.wrap&&(I.adler=1&W.wrap),W.mode=h,W.last=0,W.havedict=0,W.dmax=32768,W.head=null,W.hold=0,W.bits=0,W.lencode=W.lendyn=new i.Buf32(m),W.distcode=W.distdyn=new i.Buf32(y),W.sane=1,W.back=-1,f):p}function w(I){var W;return I&&I.state?((W=I.state).wsize=0,W.whave=0,W.wnext=0,k(I)):p}function T(I,W){var A,G;return I&&I.state?(G=I.state,W<0?(A=0,W=-W):(A=1+(W>>4),W<48&&(W&=15)),W&&(W<8||15<W)?p:(G.window!==null&&G.wbits!==W&&(G.window=null),G.wrap=A,G.wbits=W,w(I))):p}function D(I,W){var A,G;return I?(G=new x,(I.state=G).window=null,(A=T(I,W))!==f&&(I.state=null),A):p}var M,F,C=!0;function U(I){if(C){var W;for(M=new i.Buf32(512),F=new i.Buf32(32),W=0;W<144;)I.lens[W++]=8;for(;W<256;)I.lens[W++]=9;for(;W<280;)I.lens[W++]=7;for(;W<288;)I.lens[W++]=8;for(c(u,I.lens,0,288,M,0,I.work,{bits:9}),W=0;W<32;)I.lens[W++]=5;c(d,I.lens,0,32,F,0,I.work,{bits:5}),C=!1}I.lencode=M,I.lenbits=9,I.distcode=F,I.distbits=5}function ie(I,W,A,G){var ae,X=I.state;return X.window===null&&(X.wsize=1<<X.wbits,X.wnext=0,X.whave=0,X.window=new i.Buf8(X.wsize)),G>=X.wsize?(i.arraySet(X.window,W,A-X.wsize,X.wsize,0),X.wnext=0,X.whave=X.wsize):(G<(ae=X.wsize-X.wnext)&&(ae=G),i.arraySet(X.window,W,A-G,ae,X.wnext),(G-=ae)?(i.arraySet(X.window,W,A-G,G,0),X.wnext=G,X.whave=X.wsize):(X.wnext+=ae,X.wnext===X.wsize&&(X.wnext=0),X.whave<X.wsize&&(X.whave+=ae))),0}o.inflateReset=w,o.inflateReset2=T,o.inflateResetKeep=k,o.inflateInit=function(I){return D(I,15)},o.inflateInit2=D,o.inflate=function(I,W){var A,G,ae,X,de,J,pe,Q,B,ee,Z,re,K,$,E,H,q,N,R,le,S,oe,te,L,z=0,P=new i.Buf8(4),fe=[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 p;(A=I.state).mode===12&&(A.mode=13),de=I.next_out,ae=I.output,pe=I.avail_out,X=I.next_in,G=I.input,J=I.avail_in,Q=A.hold,B=A.bits,ee=J,Z=pe,oe=f;e:for(;;)switch(A.mode){case h:if(A.wrap===0){A.mode=13;break}for(;B<16;){if(J===0)break e;J--,Q+=G[X++]<<B,B+=8}if(2&A.wrap&&Q===35615){P[A.check=0]=255&Q,P[1]=Q>>>8&255,A.check=a(A.check,P,2,0),B=Q=0,A.mode=2;break}if(A.flags=0,A.head&&(A.head.done=!1),!(1&A.wrap)||(((255&Q)<<8)+(Q>>8))%31){I.msg="incorrect header check",A.mode=30;break}if((15&Q)!=8){I.msg="unknown compression method",A.mode=30;break}if(B-=4,S=8+(15&(Q>>>=4)),A.wbits===0)A.wbits=S;else if(S>A.wbits){I.msg="invalid window size",A.mode=30;break}A.dmax=1<<S,I.adler=A.check=1,A.mode=512&Q?10:12,B=Q=0;break;case 2:for(;B<16;){if(J===0)break e;J--,Q+=G[X++]<<B,B+=8}if(A.flags=Q,(255&A.flags)!=8){I.msg="unknown compression method",A.mode=30;break}if(57344&A.flags){I.msg="unknown header flags set",A.mode=30;break}A.head&&(A.head.text=Q>>8&1),512&A.flags&&(P[0]=255&Q,P[1]=Q>>>8&255,A.check=a(A.check,P,2,0)),B=Q=0,A.mode=3;case 3:for(;B<32;){if(J===0)break e;J--,Q+=G[X++]<<B,B+=8}A.head&&(A.head.time=Q),512&A.flags&&(P[0]=255&Q,P[1]=Q>>>8&255,P[2]=Q>>>16&255,P[3]=Q>>>24&255,A.check=a(A.check,P,4,0)),B=Q=0,A.mode=4;case 4:for(;B<16;){if(J===0)break e;J--,Q+=G[X++]<<B,B+=8}A.head&&(A.head.xflags=255&Q,A.head.os=Q>>8),512&A.flags&&(P[0]=255&Q,P[1]=Q>>>8&255,A.check=a(A.check,P,2,0)),B=Q=0,A.mode=5;case 5:if(1024&A.flags){for(;B<16;){if(J===0)break e;J--,Q+=G[X++]<<B,B+=8}A.length=Q,A.head&&(A.head.extra_len=Q),512&A.flags&&(P[0]=255&Q,P[1]=Q>>>8&255,A.check=a(A.check,P,2,0)),B=Q=0}else A.head&&(A.head.extra=null);A.mode=6;case 6:if(1024&A.flags&&(J<(re=A.length)&&(re=J),re&&(A.head&&(S=A.head.extra_len-A.length,A.head.extra||(A.head.extra=new Array(A.head.extra_len)),i.arraySet(A.head.extra,G,X,re,S)),512&A.flags&&(A.check=a(A.check,G,re,X)),J-=re,X+=re,A.length-=re),A.length))break e;A.length=0,A.mode=7;case 7:if(2048&A.flags){if(J===0)break e;for(re=0;S=G[X+re++],A.head&&S&&A.length<65536&&(A.head.name+=String.fromCharCode(S)),S&&re<J;);if(512&A.flags&&(A.check=a(A.check,G,re,X)),J-=re,X+=re,S)break e}else A.head&&(A.head.name=null);A.length=0,A.mode=8;case 8:if(4096&A.flags){if(J===0)break e;for(re=0;S=G[X+re++],A.head&&S&&A.length<65536&&(A.head.comment+=String.fromCharCode(S)),S&&re<J;);if(512&A.flags&&(A.check=a(A.check,G,re,X)),J-=re,X+=re,S)break e}else A.head&&(A.head.comment=null);A.mode=9;case 9:if(512&A.flags){for(;B<16;){if(J===0)break e;J--,Q+=G[X++]<<B,B+=8}if(Q!==(65535&A.check)){I.msg="header crc mismatch",A.mode=30;break}B=Q=0}A.head&&(A.head.hcrc=A.flags>>9&1,A.head.done=!0),I.adler=A.check=0,A.mode=12;break;case 10:for(;B<32;){if(J===0)break e;J--,Q+=G[X++]<<B,B+=8}I.adler=A.check=g(Q),B=Q=0,A.mode=11;case 11:if(A.havedict===0)return I.next_out=de,I.avail_out=pe,I.next_in=X,I.avail_in=J,A.hold=Q,A.bits=B,2;I.adler=A.check=1,A.mode=12;case 12:if(W===5||W===6)break e;case 13:if(A.last){Q>>>=7&B,B-=7&B,A.mode=27;break}for(;B<3;){if(J===0)break e;J--,Q+=G[X++]<<B,B+=8}switch(A.last=1&Q,B-=1,3&(Q>>>=1)){case 0:A.mode=14;break;case 1:if(U(A),A.mode=20,W!==6)break;Q>>>=2,B-=2;break e;case 2:A.mode=17;break;case 3:I.msg="invalid block type",A.mode=30}Q>>>=2,B-=2;break;case 14:for(Q>>>=7&B,B-=7&B;B<32;){if(J===0)break e;J--,Q+=G[X++]<<B,B+=8}if((65535&Q)!=(Q>>>16^65535)){I.msg="invalid stored block lengths",A.mode=30;break}if(A.length=65535&Q,B=Q=0,A.mode=15,W===6)break e;case 15:A.mode=16;case 16:if(re=A.length){if(J<re&&(re=J),pe<re&&(re=pe),re===0)break e;i.arraySet(ae,G,X,re,de),J-=re,X+=re,pe-=re,de+=re,A.length-=re;break}A.mode=12;break;case 17:for(;B<14;){if(J===0)break e;J--,Q+=G[X++]<<B,B+=8}if(A.nlen=257+(31&Q),Q>>>=5,B-=5,A.ndist=1+(31&Q),Q>>>=5,B-=5,A.ncode=4+(15&Q),Q>>>=4,B-=4,286<A.nlen||30<A.ndist){I.msg="too many length or distance symbols",A.mode=30;break}A.have=0,A.mode=18;case 18:for(;A.have<A.ncode;){for(;B<3;){if(J===0)break e;J--,Q+=G[X++]<<B,B+=8}A.lens[fe[A.have++]]=7&Q,Q>>>=3,B-=3}for(;A.have<19;)A.lens[fe[A.have++]]=0;if(A.lencode=A.lendyn,A.lenbits=7,te={bits:A.lenbits},oe=c(0,A.lens,0,19,A.lencode,0,A.work,te),A.lenbits=te.bits,oe){I.msg="invalid code lengths set",A.mode=30;break}A.have=0,A.mode=19;case 19:for(;A.have<A.nlen+A.ndist;){for(;H=(z=A.lencode[Q&(1<<A.lenbits)-1])>>>16&255,q=65535&z,!((E=z>>>24)<=B);){if(J===0)break e;J--,Q+=G[X++]<<B,B+=8}if(q<16)Q>>>=E,B-=E,A.lens[A.have++]=q;else{if(q===16){for(L=E+2;B<L;){if(J===0)break e;J--,Q+=G[X++]<<B,B+=8}if(Q>>>=E,B-=E,A.have===0){I.msg="invalid bit length repeat",A.mode=30;break}S=A.lens[A.have-1],re=3+(3&Q),Q>>>=2,B-=2}else if(q===17){for(L=E+3;B<L;){if(J===0)break e;J--,Q+=G[X++]<<B,B+=8}B-=E,S=0,re=3+(7&(Q>>>=E)),Q>>>=3,B-=3}else{for(L=E+7;B<L;){if(J===0)break e;J--,Q+=G[X++]<<B,B+=8}B-=E,S=0,re=11+(127&(Q>>>=E)),Q>>>=7,B-=7}if(A.have+re>A.nlen+A.ndist){I.msg="invalid bit length repeat",A.mode=30;break}for(;re--;)A.lens[A.have++]=S}}if(A.mode===30)break;if(A.lens[256]===0){I.msg="invalid code -- missing end-of-block",A.mode=30;break}if(A.lenbits=9,te={bits:A.lenbits},oe=c(u,A.lens,0,A.nlen,A.lencode,0,A.work,te),A.lenbits=te.bits,oe){I.msg="invalid literal/lengths set",A.mode=30;break}if(A.distbits=6,A.distcode=A.distdyn,te={bits:A.distbits},oe=c(d,A.lens,A.nlen,A.ndist,A.distcode,0,A.work,te),A.distbits=te.bits,oe){I.msg="invalid distances set",A.mode=30;break}if(A.mode=20,W===6)break e;case 20:A.mode=21;case 21:if(6<=J&&258<=pe){I.next_out=de,I.avail_out=pe,I.next_in=X,I.avail_in=J,A.hold=Q,A.bits=B,l(I,Z),de=I.next_out,ae=I.output,pe=I.avail_out,X=I.next_in,G=I.input,J=I.avail_in,Q=A.hold,B=A.bits,A.mode===12&&(A.back=-1);break}for(A.back=0;H=(z=A.lencode[Q&(1<<A.lenbits)-1])>>>16&255,q=65535&z,!((E=z>>>24)<=B);){if(J===0)break e;J--,Q+=G[X++]<<B,B+=8}if(H&&!(240&H)){for(N=E,R=H,le=q;H=(z=A.lencode[le+((Q&(1<<N+R)-1)>>N)])>>>16&255,q=65535&z,!(N+(E=z>>>24)<=B);){if(J===0)break e;J--,Q+=G[X++]<<B,B+=8}Q>>>=N,B-=N,A.back+=N}if(Q>>>=E,B-=E,A.back+=E,A.length=q,H===0){A.mode=26;break}if(32&H){A.back=-1,A.mode=12;break}if(64&H){I.msg="invalid literal/length code",A.mode=30;break}A.extra=15&H,A.mode=22;case 22:if(A.extra){for(L=A.extra;B<L;){if(J===0)break e;J--,Q+=G[X++]<<B,B+=8}A.length+=Q&(1<<A.extra)-1,Q>>>=A.extra,B-=A.extra,A.back+=A.extra}A.was=A.length,A.mode=23;case 23:for(;H=(z=A.distcode[Q&(1<<A.distbits)-1])>>>16&255,q=65535&z,!((E=z>>>24)<=B);){if(J===0)break e;J--,Q+=G[X++]<<B,B+=8}if(!(240&H)){for(N=E,R=H,le=q;H=(z=A.distcode[le+((Q&(1<<N+R)-1)>>N)])>>>16&255,q=65535&z,!(N+(E=z>>>24)<=B);){if(J===0)break e;J--,Q+=G[X++]<<B,B+=8}Q>>>=N,B-=N,A.back+=N}if(Q>>>=E,B-=E,A.back+=E,64&H){I.msg="invalid distance code",A.mode=30;break}A.offset=q,A.extra=15&H,A.mode=24;case 24:if(A.extra){for(L=A.extra;B<L;){if(J===0)break e;J--,Q+=G[X++]<<B,B+=8}A.offset+=Q&(1<<A.extra)-1,Q>>>=A.extra,B-=A.extra,A.back+=A.extra}if(A.offset>A.dmax){I.msg="invalid distance too far back",A.mode=30;break}A.mode=25;case 25:if(pe===0)break e;if(re=Z-pe,A.offset>re){if((re=A.offset-re)>A.whave&&A.sane){I.msg="invalid distance too far back",A.mode=30;break}K=re>A.wnext?(re-=A.wnext,A.wsize-re):A.wnext-re,re>A.length&&(re=A.length),$=A.window}else $=ae,K=de-A.offset,re=A.length;for(pe<re&&(re=pe),pe-=re,A.length-=re;ae[de++]=$[K++],--re;);A.length===0&&(A.mode=21);break;case 26:if(pe===0)break e;ae[de++]=A.length,pe--,A.mode=21;break;case 27:if(A.wrap){for(;B<32;){if(J===0)break e;J--,Q|=G[X++]<<B,B+=8}if(Z-=pe,I.total_out+=Z,A.total+=Z,Z&&(I.adler=A.check=A.flags?a(A.check,ae,Z,de-Z):s(A.check,ae,Z,de-Z)),Z=pe,(A.flags?Q:g(Q))!==A.check){I.msg="incorrect data check",A.mode=30;break}B=Q=0}A.mode=28;case 28:if(A.wrap&&A.flags){for(;B<32;){if(J===0)break e;J--,Q+=G[X++]<<B,B+=8}if(Q!==(4294967295&A.total)){I.msg="incorrect length check",A.mode=30;break}B=Q=0}A.mode=29;case 29:oe=1;break e;case 30:oe=-3;break e;case 31:return-4;case 32:default:return p}return I.next_out=de,I.avail_out=pe,I.next_in=X,I.avail_in=J,A.hold=Q,A.bits=B,(A.wsize||Z!==I.avail_out&&A.mode<30&&(A.mode<27||W!==4))&&ie(I,I.output,I.next_out,Z-I.avail_out)?(A.mode=31,-4):(ee-=I.avail_in,Z-=I.avail_out,I.total_in+=ee,I.total_out+=Z,A.total+=Z,A.wrap&&Z&&(I.adler=A.check=A.flags?a(A.check,ae,Z,I.next_out-Z):s(A.check,ae,Z,I.next_out-Z)),I.data_type=A.bits+(A.last?64:0)+(A.mode===12?128:0)+(A.mode===20||A.mode===15?256:0),(ee==0&&Z===0||W===4)&&oe===f&&(oe=-5),oe)},o.inflateEnd=function(I){if(!I||!I.state)return p;var W=I.state;return W.window&&(W.window=null),I.state=null,f},o.inflateGetHeader=function(I,W){var A;return I&&I.state&&2&(A=I.state).wrap?((A.head=W).done=!1,f):p},o.inflateSetDictionary=function(I,W){var A,G=W.length;return I&&I.state?(A=I.state).wrap!==0&&A.mode!==11?p:A.mode===11&&s(1,W,G,0)!==A.check?-3:ie(I,W,G,G)?(A.mode=31,-4):(A.havedict=1,f):p},o.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(n,r,o){var i=n("../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];r.exports=function(u,d,f,p,h,m,y,g){var x,k,w,T,D,M,F,C,U,ie=g.bits,I=0,W=0,A=0,G=0,ae=0,X=0,de=0,J=0,pe=0,Q=0,B=null,ee=0,Z=new i.Buf16(16),re=new i.Buf16(16),K=null,$=0;for(I=0;I<=15;I++)Z[I]=0;for(W=0;W<p;W++)Z[d[f+W]]++;for(ae=ie,G=15;1<=G&&Z[G]===0;G--);if(G<ae&&(ae=G),G===0)return h[m++]=20971520,h[m++]=20971520,g.bits=1,0;for(A=1;A<G&&Z[A]===0;A++);for(ae<A&&(ae=A),I=J=1;I<=15;I++)if(J<<=1,(J-=Z[I])<0)return-1;if(0<J&&(u===0||G!==1))return-1;for(re[1]=0,I=1;I<15;I++)re[I+1]=re[I]+Z[I];for(W=0;W<p;W++)d[f+W]!==0&&(y[re[d[f+W]]++]=W);if(M=u===0?(B=K=y,19):u===1?(B=s,ee-=257,K=a,$-=257,256):(B=l,K=c,-1),I=A,D=m,de=W=Q=0,w=-1,T=(pe=1<<(X=ae))-1,u===1&&852<pe||u===2&&592<pe)return 1;for(;;){for(F=I-de,U=y[W]<M?(C=0,y[W]):y[W]>M?(C=K[$+y[W]],B[ee+y[W]]):(C=96,0),x=1<<I-de,A=k=1<<X;h[D+(Q>>de)+(k-=x)]=F<<24|C<<16|U|0,k!==0;);for(x=1<<I-1;Q&x;)x>>=1;if(x!==0?(Q&=x-1,Q+=x):Q=0,W++,--Z[I]==0){if(I===G)break;I=d[f+y[W]]}if(ae<I&&(Q&T)!==w){for(de===0&&(de=ae),D+=A,J=1<<(X=I-de);X+de<G&&!((J-=Z[X+de])<=0);)X++,J<<=1;if(pe+=1<<X,u===1&&852<pe||u===2&&592<pe)return 1;h[w=Q&T]=ae<<24|X<<16|D-m|0}}return Q!==0&&(h[D+Q]=I-de<<24|64<<16|0),g.bits=ae,0}},{"../utils/common":41}],51:[function(n,r,o){r.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(n,r,o){var i=n("../utils/common"),s=0,a=1;function l(z){for(var P=z.length;0<=--P;)z[P]=0}var c=0,u=29,d=256,f=d+1+u,p=30,h=19,m=2*f+1,y=15,g=16,x=7,k=256,w=16,T=17,D=18,M=[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],F=[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],C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],U=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ie=new Array(2*(f+2));l(ie);var I=new Array(2*p);l(I);var W=new Array(512);l(W);var A=new Array(256);l(A);var G=new Array(u);l(G);var ae,X,de,J=new Array(p);function pe(z,P,fe,me,se){this.static_tree=z,this.extra_bits=P,this.extra_base=fe,this.elems=me,this.max_length=se,this.has_stree=z&&z.length}function Q(z,P){this.dyn_tree=z,this.max_code=0,this.stat_desc=P}function B(z){return z<256?W[z]:W[256+(z>>>7)]}function ee(z,P){z.pending_buf[z.pending++]=255&P,z.pending_buf[z.pending++]=P>>>8&255}function Z(z,P,fe){z.bi_valid>g-fe?(z.bi_buf|=P<<z.bi_valid&65535,ee(z,z.bi_buf),z.bi_buf=P>>g-z.bi_valid,z.bi_valid+=fe-g):(z.bi_buf|=P<<z.bi_valid&65535,z.bi_valid+=fe)}function re(z,P,fe){Z(z,fe[2*P],fe[2*P+1])}function K(z,P){for(var fe=0;fe|=1&z,z>>>=1,fe<<=1,0<--P;);return fe>>>1}function $(z,P,fe){var me,se,ge=new Array(y+1),ce=0;for(me=1;me<=y;me++)ge[me]=ce=ce+fe[me-1]<<1;for(se=0;se<=P;se++){var ue=z[2*se+1];ue!==0&&(z[2*se]=K(ge[ue]++,ue))}}function E(z){var P;for(P=0;P<f;P++)z.dyn_ltree[2*P]=0;for(P=0;P<p;P++)z.dyn_dtree[2*P]=0;for(P=0;P<h;P++)z.bl_tree[2*P]=0;z.dyn_ltree[2*k]=1,z.opt_len=z.static_len=0,z.last_lit=z.matches=0}function H(z){8<z.bi_valid?ee(z,z.bi_buf):0<z.bi_valid&&(z.pending_buf[z.pending++]=z.bi_buf),z.bi_buf=0,z.bi_valid=0}function q(z,P,fe,me){var se=2*P,ge=2*fe;return z[se]<z[ge]||z[se]===z[ge]&&me[P]<=me[fe]}function N(z,P,fe){for(var me=z.heap[fe],se=fe<<1;se<=z.heap_len&&(se<z.heap_len&&q(P,z.heap[se+1],z.heap[se],z.depth)&&se++,!q(P,me,z.heap[se],z.depth));)z.heap[fe]=z.heap[se],fe=se,se<<=1;z.heap[fe]=me}function R(z,P,fe){var me,se,ge,ce,ue=0;if(z.last_lit!==0)for(;me=z.pending_buf[z.d_buf+2*ue]<<8|z.pending_buf[z.d_buf+2*ue+1],se=z.pending_buf[z.l_buf+ue],ue++,me===0?re(z,se,P):(re(z,(ge=A[se])+d+1,P),(ce=M[ge])!==0&&Z(z,se-=G[ge],ce),re(z,ge=B(--me),fe),(ce=F[ge])!==0&&Z(z,me-=J[ge],ce)),ue<z.last_lit;);re(z,k,P)}function le(z,P){var fe,me,se,ge=P.dyn_tree,ce=P.stat_desc.static_tree,ue=P.stat_desc.has_stree,we=P.stat_desc.elems,_e=-1;for(z.heap_len=0,z.heap_max=m,fe=0;fe<we;fe++)ge[2*fe]!==0?(z.heap[++z.heap_len]=_e=fe,z.depth[fe]=0):ge[2*fe+1]=0;for(;z.heap_len<2;)ge[2*(se=z.heap[++z.heap_len]=_e<2?++_e:0)]=1,z.depth[se]=0,z.opt_len--,ue&&(z.static_len-=ce[2*se+1]);for(P.max_code=_e,fe=z.heap_len>>1;1<=fe;fe--)N(z,ge,fe);for(se=we;fe=z.heap[1],z.heap[1]=z.heap[z.heap_len--],N(z,ge,1),me=z.heap[1],z.heap[--z.heap_max]=fe,z.heap[--z.heap_max]=me,ge[2*se]=ge[2*fe]+ge[2*me],z.depth[se]=(z.depth[fe]>=z.depth[me]?z.depth[fe]:z.depth[me])+1,ge[2*fe+1]=ge[2*me+1]=se,z.heap[1]=se++,N(z,ge,1),2<=z.heap_len;);z.heap[--z.heap_max]=z.heap[1],function(Ce,dt){var v,O,_,Y,j,V,ne=dt.dyn_tree,ye=dt.max_code,xe=dt.stat_desc.static_tree,ke=dt.stat_desc.has_stree,Ae=dt.stat_desc.extra_bits,Oe=dt.stat_desc.extra_base,We=dt.stat_desc.max_length,ot=0;for(Y=0;Y<=y;Y++)Ce.bl_count[Y]=0;for(ne[2*Ce.heap[Ce.heap_max]+1]=0,v=Ce.heap_max+1;v<m;v++)We<(Y=ne[2*ne[2*(O=Ce.heap[v])+1]+1]+1)&&(Y=We,ot++),ne[2*O+1]=Y,ye<O||(Ce.bl_count[Y]++,j=0,Oe<=O&&(j=Ae[O-Oe]),V=ne[2*O],Ce.opt_len+=V*(Y+j),ke&&(Ce.static_len+=V*(xe[2*O+1]+j)));if(ot!==0){do{for(Y=We-1;Ce.bl_count[Y]===0;)Y--;Ce.bl_count[Y]--,Ce.bl_count[Y+1]+=2,Ce.bl_count[We]--,ot-=2}while(0<ot);for(Y=We;Y!==0;Y--)for(O=Ce.bl_count[Y];O!==0;)ye<(_=Ce.heap[--v])||(ne[2*_+1]!==Y&&(Ce.opt_len+=(Y-ne[2*_+1])*ne[2*_],ne[2*_+1]=Y),O--)}}(z,P),$(ge,_e,z.bl_count)}function S(z,P,fe){var me,se,ge=-1,ce=P[1],ue=0,we=7,_e=4;for(ce===0&&(we=138,_e=3),P[2*(fe+1)+1]=65535,me=0;me<=fe;me++)se=ce,ce=P[2*(me+1)+1],++ue<we&&se===ce||(ue<_e?z.bl_tree[2*se]+=ue:se!==0?(se!==ge&&z.bl_tree[2*se]++,z.bl_tree[2*w]++):ue<=10?z.bl_tree[2*T]++:z.bl_tree[2*D]++,ge=se,_e=(ue=0)===ce?(we=138,3):se===ce?(we=6,3):(we=7,4))}function oe(z,P,fe){var me,se,ge=-1,ce=P[1],ue=0,we=7,_e=4;for(ce===0&&(we=138,_e=3),me=0;me<=fe;me++)if(se=ce,ce=P[2*(me+1)+1],!(++ue<we&&se===ce)){if(ue<_e)for(;re(z,se,z.bl_tree),--ue!=0;);else se!==0?(se!==ge&&(re(z,se,z.bl_tree),ue--),re(z,w,z.bl_tree),Z(z,ue-3,2)):ue<=10?(re(z,T,z.bl_tree),Z(z,ue-3,3)):(re(z,D,z.bl_tree),Z(z,ue-11,7));ge=se,_e=(ue=0)===ce?(we=138,3):se===ce?(we=6,3):(we=7,4)}}l(J);var te=!1;function L(z,P,fe,me){Z(z,(c<<1)+(me?1:0),3),function(se,ge,ce,ue){H(se),ee(se,ce),ee(se,~ce),i.arraySet(se.pending_buf,se.window,ge,ce,se.pending),se.pending+=ce}(z,P,fe)}o._tr_init=function(z){te||(function(){var P,fe,me,se,ge,ce=new Array(y+1);for(se=me=0;se<u-1;se++)for(G[se]=me,P=0;P<1<<M[se];P++)A[me++]=se;for(A[me-1]=se,se=ge=0;se<16;se++)for(J[se]=ge,P=0;P<1<<F[se];P++)W[ge++]=se;for(ge>>=7;se<p;se++)for(J[se]=ge<<7,P=0;P<1<<F[se]-7;P++)W[256+ge++]=se;for(fe=0;fe<=y;fe++)ce[fe]=0;for(P=0;P<=143;)ie[2*P+1]=8,P++,ce[8]++;for(;P<=255;)ie[2*P+1]=9,P++,ce[9]++;for(;P<=279;)ie[2*P+1]=7,P++,ce[7]++;for(;P<=287;)ie[2*P+1]=8,P++,ce[8]++;for($(ie,f+1,ce),P=0;P<p;P++)I[2*P+1]=5,I[2*P]=K(P,5);ae=new pe(ie,M,d+1,f,y),X=new pe(I,F,0,p,y),de=new pe(new Array(0),C,0,h,x)}(),te=!0),z.l_desc=new Q(z.dyn_ltree,ae),z.d_desc=new Q(z.dyn_dtree,X),z.bl_desc=new Q(z.bl_tree,de),z.bi_buf=0,z.bi_valid=0,E(z)},o._tr_stored_block=L,o._tr_flush_block=function(z,P,fe,me){var se,ge,ce=0;0<z.level?(z.strm.data_type===2&&(z.strm.data_type=function(ue){var we,_e=4093624447;for(we=0;we<=31;we++,_e>>>=1)if(1&_e&&ue.dyn_ltree[2*we]!==0)return s;if(ue.dyn_ltree[18]!==0||ue.dyn_ltree[20]!==0||ue.dyn_ltree[26]!==0)return a;for(we=32;we<d;we++)if(ue.dyn_ltree[2*we]!==0)return a;return s}(z)),le(z,z.l_desc),le(z,z.d_desc),ce=function(ue){var we;for(S(ue,ue.dyn_ltree,ue.l_desc.max_code),S(ue,ue.dyn_dtree,ue.d_desc.max_code),le(ue,ue.bl_desc),we=h-1;3<=we&&ue.bl_tree[2*U[we]+1]===0;we--);return ue.opt_len+=3*(we+1)+5+5+4,we}(z),se=z.opt_len+3+7>>>3,(ge=z.static_len+3+7>>>3)<=se&&(se=ge)):se=ge=fe+5,fe+4<=se&&P!==-1?L(z,P,fe,me):z.strategy===4||ge===se?(Z(z,2+(me?1:0),3),R(z,ie,I)):(Z(z,4+(me?1:0),3),function(ue,we,_e,Ce){var dt;for(Z(ue,we-257,5),Z(ue,_e-1,5),Z(ue,Ce-4,4),dt=0;dt<Ce;dt++)Z(ue,ue.bl_tree[2*U[dt]+1],3);oe(ue,ue.dyn_ltree,we-1),oe(ue,ue.dyn_dtree,_e-1)}(z,z.l_desc.max_code+1,z.d_desc.max_code+1,ce+1),R(z,z.dyn_ltree,z.dyn_dtree)),E(z),me&&H(z)},o._tr_tally=function(z,P,fe){return z.pending_buf[z.d_buf+2*z.last_lit]=P>>>8&255,z.pending_buf[z.d_buf+2*z.last_lit+1]=255&P,z.pending_buf[z.l_buf+z.last_lit]=255&fe,z.last_lit++,P===0?z.dyn_ltree[2*fe]++:(z.matches++,P--,z.dyn_ltree[2*(A[fe]+d+1)]++,z.dyn_dtree[2*B(P)]++),z.last_lit===z.lit_bufsize-1},o._tr_align=function(z){Z(z,2,3),re(z,k,ie),function(P){P.bi_valid===16?(ee(P,P.bi_buf),P.bi_buf=0,P.bi_valid=0):8<=P.bi_valid&&(P.pending_buf[P.pending++]=255&P.bi_buf,P.bi_buf>>=8,P.bi_valid-=8)}(z)}},{"../utils/common":41}],53:[function(n,r,o){r.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(n,r,o){(function(i){(function(s,a){if(!s.setImmediate){var l,c,u,d,f=1,p={},h=!1,m=s.document,y=Object.getPrototypeOf&&Object.getPrototypeOf(s);y=y&&y.setTimeout?y:s,l={}.toString.call(s.process)==="[object process]"?function(w){Se.nextTick(function(){x(w)})}:function(){if(s.postMessage&&!s.importScripts){var w=!0,T=s.onmessage;return s.onmessage=function(){w=!1},s.postMessage("","*"),s.onmessage=T,w}}()?(d="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",k,!1):s.attachEvent("onmessage",k),function(w){s.postMessage(d+w,"*")}):s.MessageChannel?((u=new MessageChannel).port1.onmessage=function(w){x(w.data)},function(w){u.port2.postMessage(w)}):m&&"onreadystatechange"in m.createElement("script")?(c=m.documentElement,function(w){var T=m.createElement("script");T.onreadystatechange=function(){x(w),T.onreadystatechange=null,c.removeChild(T),T=null},c.appendChild(T)}):function(w){setTimeout(x,0,w)},y.setImmediate=function(w){typeof w!="function"&&(w=new Function(""+w));for(var T=new Array(arguments.length-1),D=0;D<T.length;D++)T[D]=arguments[D+1];var M={callback:w,args:T};return p[f]=M,l(f),f++},y.clearImmediate=g}function g(w){delete p[w]}function x(w){if(h)setTimeout(x,0,w);else{var T=p[w];if(T){h=!0;try{(function(D){var M=D.callback,F=D.args;switch(F.length){case 0:M();break;case 1:M(F[0]);break;case 2:M(F[0],F[1]);break;case 3:M(F[0],F[1],F[2]);break;default:M.apply(a,F)}})(T)}finally{g(w),h=!1}}}}function k(w){w.source===s&&typeof w.data=="string"&&w.data.indexOf(d)===0&&x(+w.data.slice(d.length))}})(typeof self>"u"?i===void 0?this:i:self)}).call(this,typeof zt<"u"?zt:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(pv);var x$=pv.exports;const Qu=ml(x$);let ed=class{constructor(e={}){this.debug=e.debug||!1,this.zip=new Qu,this.files=[],this.media={},this.mediaFiles={},this.fonts={}}async getDocxData(e,n=!1){const r=await this.unzip(e),o=Object.entries(r.files),i={},s=["xml","rels"];for(const a of o){const[l,c]=a;if(s.some(u=>c.name.endsWith(u))){const u=await c.async("string");this.files.push({name:c.name,content:u})}else if(c.name.startsWith("word/media")&&c.name!=="word/media/")if(n){const u=(await c.async("nodebuffer")).toString("base64");i[c.name]=u}else{const u=await c.async("blob"),d=this.getFileExtension(c.name),f=await c.async("base64");this.mediaFiles[c.name]=`data:image/${d};base64,${f}`;const p=new File([u],c.name,{type:u.type}),h=URL.createObjectURL(p);this.media[c.name]=h}else if(c.name.startsWith("word/fonts")&&c.name!=="word/fonts/"){const u=await c.async("uint8array");this.fonts[c.name]=u}}return this.files}getFileExtension(e){return e.split(".").pop()}async updateContentTypes(e,n){const r=Object.keys(n).map(d=>this.getFileExtension(d)),o="[Content_Types].xml",i=await e.file(o).async("string");let s="";const a=iE(i),l=new Set;for(let d of r){if(a.includes(d)||l.has(d))continue;const f=`<Default Extension="${d}" ContentType="image/${d}"/>`;s+=f,l.add(d)}if(e.files["word/comments.xml"]){const d='<Override PartName="/word/comments.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml" />';i.includes(d)||(s+=d)}if(e.files["word/commentsExtended.xml"]){const d='<Override PartName="/word/commentsExtended.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml" />';i.includes(d)||(s+=d)}if(e.files["word/commentsIds.xml"]){const d='<Override PartName="/word/commentsIds.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsIds+xml" />';i.includes(d)||(s+=d)}if(e.files["word/commentsExtensible.xml"]){const d='<Override PartName="/word/commentsExtensible.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtensible+xml" />';i.includes(d)||(s+=d)}const c='<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">',u=i.replace(c,`${c}${s}`);e.file(o,u)}async unzip(e){return await this.zip.loadAsync(e)}async updateZip({docx:e,updatedDocs:n,originalDocxFile:r,media:o,fonts:i,isHeadless:s}){let a;r?a=await this.exportFromOriginalFile(r,n,o):a=await this.exportFromCollaborativeDocx(e,n,o,i);const l=s?"nodebuffer":"blob";return await a.generateAsync({type:l})}async exportFromCollaborativeDocx(e,n,r,o){const i=new Qu;for(const s of e){const a=s.content;i.file(s.name,a)}Object.keys(n).forEach(s=>{const a=n[s];i.file(s,a)}),Object.keys(r).forEach(s=>{const a=St.from(r[s],"base64");i.file(`word/media/${s}`,a)});for(const[s,a]of Object.entries(o))i.file(s,a);return await this.updateContentTypes(i,r),i}async exportFromOriginalFile(e,n,r){const o=await this.unzip(e),i=[];return o.forEach((s,a)=>{const l=a.async("string").then(c=>{o.file(a.name,c)});i.push(l)}),await Promise.all(i),Object.keys(n).forEach(s=>{o.file(s,n[s])}),Object.keys(r).forEach(s=>{o.file(`word/media/${s}`,r[s])}),await this.updateContentTypes(o,r),o}};var k$=Object.defineProperty,hv=t=>{throw TypeError(t)},S$=(t,e,n)=>e in t?k$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Fe=(t,e,n)=>S$(t,typeof e!="symbol"?e+"":e,n),$f=(t,e,n)=>e.has(t)||hv("Cannot "+n),Kn=(t,e,n)=>($f(t,e,"read from private field"),n?n.call(t):e.get(t)),Cr=(t,e,n)=>e.has(t)?hv("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),mv=(t,e,n,r)=>($f(t,e,"write to private field"),e.set(t,n),n),Ie=(t,e,n)=>($f(t,e,"access private method"),n);function Es(t){const{from:e,to:n,empty:r}=t.selection,o=[];return r?(t.storedMarks&&o.push(...t.storedMarks),o.push(...t.selection.$head.marks())):t.doc.nodesBetween(e,n,i=>{o.push(...i.marks)}),o}const Sl=(t,e,n=!1)=>{const{selection:r,doc:o}=t,{$from:i,$to:s}=r,a=i.marks().find(d=>d.type===e),l=s.marks().find(d=>d.type===e);let c;const u=[];return o.nodesBetween(i.pos,s.pos,(d,f)=>{if(d.marks){const p=d.marks.find(h=>h.type===e);p&&(c={from:f,to:f+d.nodeSize,attrs:p.attrs,contained:!a||!l||a===l},u.push(c))}}),n?u:c};function Tf(t){const{state:e}=t,{selection:n}=e,r=Es(e),o=n.$head.parent.attrs.marksAttrs,i=r.filter(d=>!["textStyle","link"].includes(d.type.name)).map(d=>({name:d.type.name,attrs:d.attrs})),s=r.filter(d=>d.type.name==="textStyle");if(i.push(...s.flatMap(ig)),o){const d=o.filter(p=>!["textStyle","link"].includes(p.type)).map(p=>({name:p.type,attrs:p.attrs||{}})),f=o.filter(p=>p.type==="textStyle");i.push(...d),i.push(...f.flatMap(ig))}const a=e.schema.marks.link,l=Sl(e,a);if(l){let{from:d,to:f,attrs:p}=l;n.from>=d&&n.to<=f&&i.push({name:"link",attrs:p})}const c=["paragraphSpacing"],u=C$(e);return Object.keys(u).forEach(d=>{if(c.includes(d))return;const f={};f[d]=u[d],i.push({name:d,attrs:f})}),t.storage.formatCommands?.storedStyle&&i.push({name:"copyFormat",attrs:!0}),i}function ig(t){const e=[],{attrs:n}=t;return Object.keys(n).forEach(r=>{n[r]&&e.push({name:r,attrs:{[r]:n[r]}})}),e}function C$(t){try{const{from:e,to:n,empty:r}=t.selection,o={},i=l=>{Object.keys(l.attrs).forEach(c=>{const u=l.attrs[c];u&&(o[c]=u)})};let s=e,a=n;return r?t.doc.nodesBetween(s,a+1,l=>i(l)):t.doc.nodesBetween(e,n,l=>i(l)),o}catch{return{}}}var La=200,wt=function(){};wt.prototype.append=function(t){return t.length?(t=wt.from(t),!this.length&&t||t.length<La&&this.leafAppend(t)||this.length<La&&t.leafPrepend(this)||this.appendInner(t)):this};wt.prototype.prepend=function(t){return t.length?wt.from(t).append(this):this};wt.prototype.appendInner=function(t){return new E$(this,t)};wt.prototype.slice=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.length),t>=e?wt.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))};wt.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};wt.prototype.forEach=function(t,e,n){e===void 0&&(e=0),n===void 0&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)};wt.prototype.map=function(t,e,n){e===void 0&&(e=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(o,i){return r.push(t(o,i))},e,n),r};wt.from=function(t){return t instanceof wt?t:t&&t.length?new gv(t):wt.empty};var gv=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,o){return r==0&&o==this.length?this:new e(this.values.slice(r,o))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,o,i,s){for(var a=o;a<i;a++)if(r(this.values[a],s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,i,s){for(var a=o-1;a>=i;a--)if(r(this.values[a],s+a)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=La)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=La)return new e(r.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(wt);wt.empty=new gv([]);var E$=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,r,o,i){var s=this.left.length;if(r<s&&this.left.forEachInner(n,r,Math.min(o,s),i)===!1||o>s&&this.right.forEachInner(n,Math.max(r-s,0),Math.min(this.length,o)-s,i+s)===!1)return!1},e.prototype.forEachInvertedInner=function(n,r,o,i){var s=this.left.length;if(r>s&&this.right.forEachInvertedInner(n,r-s,Math.max(o,s)-s,i+s)===!1||o<s&&this.left.forEachInvertedInner(n,Math.min(r,s),o,i)===!1)return!1},e.prototype.sliceInner=function(n,r){if(n==0&&r==this.length)return this;var o=this.left.length;return r<=o?this.left.slice(n,r):n>=o?this.right.slice(n-o,r-o):this.left.slice(n,o).append(this.right.slice(0,r-o))},e.prototype.leafAppend=function(n){var r=this.right.leafAppend(n);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(n){var r=this.left.leafPrepend(n);if(r)return new e(r,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}(wt);const A$=500;let ts=class Mo{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,i;n&&(o=this.remapping(r,this.items.length),i=o.maps.length);let s=e.tr,a,l,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(r,f+1),i=o.maps.length),i--,u.push(d);return}if(o){u.push(new cr(d.map));let p=d.step.map(o.slice(i)),h;p&&s.maybeStep(p).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],c.push(new cr(h,void 0,void 0,c.length+u.length))),i--,h&&o.appendMap(h,i)}else s.maybeStep(d.step);if(d.selection)return a=o?d.selection.map(o.slice(i)):d.selection,l=new Mo(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,n,r,o){let i=[],s=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let d=e.steps[u].invert(e.docs[u]),f=new cr(e.mapping.maps[u],d,n),p;(p=l&&l.merge(f))&&(f=p,u?i.pop():a=a.slice(0,a.length-1)),i.push(f),n&&(s++,n=void 0),o||(l=f)}let c=s-r.depth;return c>T$&&(a=$$(a,c),s-=c),new Mo(a.append(i),s)}remapping(e,n){let r=new Ho;return this.items.forEach((o,i)=>{let s=o.mirrorOffset!=null&&i-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new Mo(this.items.append(e.map(n=>new cr(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),i=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},o);let l=n;this.items.forEach(f=>{let p=i.getMirror(--l);if(p==null)return;s=Math.min(s,p);let h=i.maps[p];if(f.step){let m=e.steps[p].invert(e.docs[p]),y=f.selection&&f.selection.map(i.slice(l+1,p));y&&a++,r.push(new cr(h,m,y))}else r.push(new cr(h))},o);let c=[];for(let f=n;f<s;f++)c.push(new cr(i.maps[f]));let u=this.items.slice(0,o).append(c).append(r),d=new Mo(u,a);return d.emptyItemCount()>A$&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,o=[],i=0;return this.items.forEach((s,a)=>{if(a>=e)o.push(s),s.selection&&i++;else if(s.step){let l=s.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let u=s.selection&&s.selection.map(n.slice(r));u&&i++;let d=new cr(c.invert(),l,u),f,p=o.length-1;(f=o.length&&o[p].merge(d))?o[p]=f:o.push(d)}}else s.map&&r--},this.items.length,0),new Mo(wt.from(o.reverse()),i)}};ts.empty=new ts(wt.empty,0);function $$(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}let cr=class yv{constructor(e,n,r,o){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new yv(n.getMap().invert(),n,this.selection)}}},mr=class{constructor(e,n,r,o,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=i}};const T$=20;function O$(t,e,n,r){let o=n.getMeta(Qn),i;if(o)return o.historyState;n.getMeta(_$)&&(t=new mr(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(Qn))return s.getMeta(Qn).redo?new mr(t.done.addTransform(n,void 0,r,ba(e)),t.undone,sg(n.mapping.maps),t.prevTime,t.prevComposition):new mr(t.done,t.undone.addTransform(n,void 0,r,ba(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!D$(n,t.prevRanges)),c=s?Hc(t.prevRanges,n.mapping):sg(n.mapping.maps);return new mr(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,ba(e)),ts.empty,c,n.time,a??t.prevComposition)}else return(i=n.getMeta("rebased"))?new mr(t.done.rebased(n,i),t.undone.rebased(n,i),Hc(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new mr(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Hc(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function D$(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let i=0;i<e.length;i+=2)r<=e[i+1]&&o>=e[i]&&(n=!0)}),n}function sg(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,o,i,s)=>e.push(i,s));return e}function Hc(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),i=e.map(t[r+1],-1);o<=i&&n.push(o,i)}return n}function M$(t,e,n){let r=ba(e),o=Qn.get(e).spec.config,i=(n?t.undone:t.done).popEvent(e,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),a=(n?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),o,r),l=new mr(n?a:i.remaining,n?i.remaining:a,null,0,-1);return i.transform.setSelection(s).setMeta(Qn,{redo:n,historyState:l})}let Wc=!1,ag=null;function ba(t){let e=t.plugins;if(ag!=e){Wc=!1,ag=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Wc=!0;break}}return Wc}const Qn=new et("history"),_$=new et("closeHistory");function N$(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Ze({key:Qn,state:{init(){return new mr(ts.empty,ts.empty,null,0,-1)},apply(e,n,r){return O$(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?wv:r=="historyRedo"?vv:null;return o?(n.preventDefault(),o(e.state,e.dispatch)):!1}}}})}function bv(t,e){return(n,r)=>{let o=Qn.getState(n);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let i=M$(o,n,t);i&&r(i.scrollIntoView())}return!0}}const wv=bv(!1),vv=bv(!0);function I$(t){let e=Qn.getState(t);return e?e.done.eventCount:0}function F$(t){let e=Qn.getState(t);return e?e.undone.eventCount:0}function De(t,e,n={}){return typeof t.config[e]=="function"?t.config[e].bind({...n}):t.config[e]}function He(t,e=null,...n){return typeof t=="function"?e?t.bind(e)(...n):t(...n):t}class Qe{constructor(e){Fe(this,"type","extension"),Fe(this,"name","extension"),Fe(this,"options"),Fe(this,"storage"),Fe(this,"config",{name:this.name}),this.config={...this.config,...e},this.name=this.config.name,this.config.addOptions&&(this.options=He(De(this,"addOptions",{name:this.name}))),this.storage=He(De(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(...e){return new Qe(...e)}}const B$=Qe.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addPmPlugins(){return[N$(this.options)]},addCommands(){return{undo:()=>({state:t,dispatch:e,tr:n})=>(n.setMeta("inputType","historyUndo"),wv(t,e)),redo:()=>({state:t,dispatch:e,tr:n})=>(n.setMeta("inputType","historyRedo"),vv(t,e))}},addShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Shift-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo()}}}),Vr=globalThis||void 0||self,Et=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Xo=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let td=null;const Wn=function(t,e,n){let r=td||(td=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},R$=function(){td=null},lo=function(t,e,n,r){return n&&(lg(t,e,n,r,-1)||lg(t,e,n,r,1))},L$=/^(img|br|input|textarea|hr)$/i;function lg(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:un(t))){let i=t.parentNode;if(!i||i.nodeType!=1||As(t)||L$.test(t.nodeName)||t.contentEditable=="false")return!1;e=Et(t)+(o<0?0:1),t=i}else if(t.nodeType==1){if(t=t.childNodes[e+(o<0?-1:0)],t.contentEditable=="false")return!1;e=o<0?un(t):0}else return!1}}function un(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function P$(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=un(t)}else if(t.parentNode&&!As(t))e=Et(t),t=t.parentNode;else return null}}function z$(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&&!As(t))e=Et(t)+1,t=t.parentNode;else return null}}function j$(t,e,n){for(let r=e==0,o=e==un(t);r||o;){if(t==n)return!0;let i=Et(t);if(t=t.parentNode,!t)return!1;r=r&&i==0,o=o&&i==un(t)}}function As(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Cl=function(t){return t.focusNode&&lo(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function jr(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function q$(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function V$(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(un(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(un(r.startContainer),r.startOffset)}}}const In=typeof navigator<"u"?navigator:null,cg=typeof document<"u"?document:null,Nr=In&&In.userAgent||"",nd=/Edge\/(\d+)/.exec(Nr),xv=/MSIE \d/.exec(Nr),rd=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Nr),Gt=!!(xv||rd||nd),Er=xv?document.documentMode:rd?+rd[1]:nd?+nd[1]:0,bn=!Gt&&/gecko\/(\d+)/i.test(Nr);bn&&+(/Firefox\/(\d+)/.exec(Nr)||[0,0])[1];const od=!Gt&&/Chrome\/(\d+)/.exec(Nr),Mt=!!od,kv=od?+od[1]:0,qt=!Gt&&!!In&&/Apple Computer/.test(In.vendor),Jo=qt&&(/Mobile\/\w+/.test(Nr)||!!In&&In.maxTouchPoints>2),cn=Jo||(In?/Mac/.test(In.platform):!1),U$=In?/Win/.test(In.platform):!1,Yn=/Android \d/.test(Nr),$s=!!cg&&"webkitFontSmoothing"in cg.documentElement.style,H$=$s?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function W$(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 qn(t,e){return typeof t=="number"?t:t[e]}function G$(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function ug(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let s=n||t.dom;s;){if(s.nodeType!=1){s=Xo(s);continue}let a=s,l=a==i.body,c=l?W$(i):G$(a),u=0,d=0;if(e.top<c.top+qn(r,"top")?d=-(c.top-e.top+qn(o,"top")):e.bottom>c.bottom-qn(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+qn(o,"top")-c.top:e.bottom-c.bottom+qn(o,"bottom")),e.left<c.left+qn(r,"left")?u=-(c.left-e.left+qn(o,"left")):e.right>c.right-qn(r,"right")&&(u=e.right-c.right+qn(o,"right")),u||d)if(l)i.defaultView.scrollBy(u,d);else{let p=a.scrollLeft,h=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let m=a.scrollLeft-p,y=a.scrollTop-h;e={left:e.left-m,top:e.top-y,right:e.right-m,bottom:e.bottom-y}}let f=l?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(f))break;s=f=="absolute"?s.offsetParent:Xo(s)}}function K$(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let i=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=t.root.elementFromPoint(i,s);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,o=l.top;break}}return{refDOM:r,refTop:o,stack:Sv(t.dom)}}function Sv(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Xo(r));return e}function X$({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Cv(n,r==0?0:r-e)}function Cv(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:i}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let xo=null;function J$(t){if(t.setActive)return t.setActive();if(xo)return t.focus(xo);let e=Sv(t);t.focus(xo==null?{get preventScroll(){return xo={preventScroll:!0},!0}}:void 0),xo||(xo=!1,Cv(e,0))}function Ev(t,e){let n,r=2e8,o,i=0,s=e.top,a=e.top,l,c;for(let u=t.firstChild,d=0;u;u=u.nextSibling,d++){let f;if(u.nodeType==1)f=u.getClientRects();else if(u.nodeType==3)f=Wn(u).getClientRects();else continue;for(let p=0;p<f.length;p++){let h=f[p];if(h.top<=s&&h.bottom>=a){s=Math.max(h.bottom,s),a=Math.min(h.top,a);let m=h.left>e.left?h.left-e.left:h.right<e.left?e.left-h.right:0;if(m<r){n=u,r=m,o=m&&n.nodeType==3?{left:h.right<e.left?h.right:h.left,top:e.top}:e,u.nodeType==1&&m&&(i=d+(e.left>=(h.left+h.right)/2?1:0));continue}}else h.top>e.top&&!l&&h.left<=e.left&&h.right>=e.left&&(l=u,c={left:Math.max(h.left,Math.min(h.right,e.left)),top:h.top});!n&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(i=d+1)}}return!n&&l&&(n=l,o=c,r=0),n&&n.nodeType==3?Y$(n,o):!n||r&&n.nodeType==1?{node:t,offset:i}:Ev(n,o)}function Y$(t,e){let n=t.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);let i=dr(r,1);if(i.top!=i.bottom&&Of(e,i))return{node:t,offset:o+(e.left>=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}function Of(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Z$(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function Q$(t,e,n){let{node:r,offset:o}=Ev(e,n),i=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();i=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,o,i)}function eT(t,e,n,r){let o=-1;for(let i=e,s=!1;i!=t.dom;){let a=t.docView.nearestDesc(i,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&(!s&&l.left>r.left||l.top>r.top?o=a.posBefore:(!s&&l.right<r.left||l.bottom<r.top)&&(o=a.posAfter),s=!0),!a.contentDOM&&o<0&&!a.node.isText))return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;i=a.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function Av(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let s=t.childNodes[i];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(Of(e,c))return Av(s,e,c)}}if((i=(i+1)%r)==o)break}return t}function tT(t,e){let n=t.dom.ownerDocument,r,o=0,i=V$(n,e.left,e.top);i&&({node:r,offset:o}=i);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let c=t.dom.getBoundingClientRect();if(!Of(e,c)||(s=Av(t.dom,e,c),!s))return null}if(qt)for(let c=s;r&&c;c=Xo(c))c.draggable&&(r=void 0);if(s=Z$(s,e),r){if(bn&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let u=r.childNodes[o],d;u.nodeName=="IMG"&&(d=u.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&o++}let c;$s&&o&&r.nodeType==1&&(c=r.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&o--,r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(a=eT(t,r,o,e))}a==null&&(a=Q$(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function dg(t){return t.top<t.bottom||t.left<t.right}function dr(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(dg(r))return r}return Array.prototype.find.call(n,dg)||t.getBoundingClientRect()}const nT=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function $v(t,e,n){let{node:r,offset:o,atom:i}=t.docView.domFromPos(e,n<0?-1:1),s=$s||bn;if(r.nodeType==3)if(s&&(nT.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let a=dr(Wn(r,o,o),n);if(bn&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let l=dr(Wn(r,o-1,o-1),-1);if(l.top==a.top){let c=dr(Wn(r,o,o+1),-1);if(c.top!=a.top)return gi(c,c.left<l.left)}}return a}else{let a=o,l=o,c=n<0?1:-1;return n<0&&!o?(l++,c=-1):n>=0&&o==r.nodeValue.length?(a--,c=1):n<0?a--:l++,gi(dr(Wn(r,a,l),c),c<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&o&&(n<0||o==un(r))){let a=r.childNodes[o-1];if(a.nodeType==1)return Gc(a.getBoundingClientRect(),!1)}if(i==null&&o<un(r)){let a=r.childNodes[o];if(a.nodeType==1)return Gc(a.getBoundingClientRect(),!0)}return Gc(r.getBoundingClientRect(),n>=0)}if(i==null&&o&&(n<0||o==un(r))){let a=r.childNodes[o-1],l=a.nodeType==3?Wn(a,un(a)-(s?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(l)return gi(dr(l,1),!1)}if(i==null&&o<un(r)){let a=r.childNodes[o];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let l=a?a.nodeType==3?Wn(a,0,s?0:1):a.nodeType==1?a:null:null;if(l)return gi(dr(l,-1),!0)}return gi(dr(r.nodeType==3?Wn(r):r,-n),n>=0)}function gi(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Gc(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Tv(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}function rT(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return Tv(t,e,()=>{let{node:i}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=$v(t,o.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Wn(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&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const oT=/[\u0590-\u08ac]/;function iT(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=t.domSelection();return a?!oT.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?i:s:Tv(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=t.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:h,focusOffset:m}=t.domSelectionRange(),y=h&&!p.contains(h.nodeType==1?h:h.parentNode)||l==h&&c==m;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return f!=null&&(a.caretBidiLevel=f),y}):r.pos==r.start()||r.pos==r.end()}let fg=null,pg=null,hg=!1;function sT(t,e,n){return fg==e&&pg==n?hg:(fg=e,pg=n,hg=n=="up"||n=="down"?rT(t,e,n):iT(t,e,n))}const dn=0,mg=1,Ur=2,Fn=3;class Ts{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=dn,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].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 n=0,r=this.posAtStart;;n++){let o=this.children[n];if(o==e)return r;r+=o.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,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let i,s;if(e==this.contentDOM)i=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.previousSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(s)+s.size:this.posAtStart}else{let i,s;if(e==this.contentDOM)i=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}let o;if(e==this.dom&&this.contentDOM)o=n>Et(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&n==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,o=e;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!n||i.node))if(r&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return i}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let o=e;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],i=r+o.size;if(r==e&&i!=r){for(;!o.border&&o.children.length;)for(let s=0;s<o.children.length;s++){let a=o.children[s];if(a.size){o=a;break}}return o}if(e<i)return o.descAt(e-r-o.border);r=i}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,o=0;for(let i=0;r<this.children.length;r++){let s=this.children[r],a=i+s.size;if(a>e||s instanceof Nv){o=e-i;break}i=a}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof Ov&&i.side>=0;r--);if(n<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&n&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?Et(i.dom)+1:0}}else{let i,s=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,s=!1);return i&&s&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?Et(i.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,i=-1;for(let s=r,a=0;;a++){let l=this.children[a],c=s+l.size;if(o==-1&&e<=c){let u=s+l.border;if(e>=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,u);e=s;for(let d=a;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){o=Et(f.dom)+1;break}e-=f.size}o==-1&&(o=0)}if(o>-1&&(c>n||a==this.children.length-1)){n=c;for(let u=a+1;u<this.children.length;u++){let d=this.children[u];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){i=Et(d.dom);break}n+=d.size}i==-1&&(i=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:e,to:n,fromOffset:o,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,o=!1){let i=Math.min(e,n),s=Math.max(e,n);for(let p=0,h=0;p<this.children.length;p++){let m=this.children[p],y=h+m.size;if(i>h&&s<y)return m.setSelection(e-h-m.border,n-h-m.border,r,o);h=y}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),u=r.domSelectionRange(),d=!1;if((bn||qt)&&e==n){let{node:p,offset:h}=a;if(p.nodeType==3){if(d=!!(h&&p.nodeValue[h-1]==`
32
- `),d&&h==p.nodeValue.length)for(let m=p,y;m;m=m.parentNode){if(y=m.nextSibling){y.nodeName=="BR"&&(a=l={node:y.parentNode,offset:Et(y)+1});break}let g=m.pmViewDesc;if(g&&g.node&&g.node.isBlock)break}}else{let m=p.childNodes[h-1];d=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(bn&&u.focusNode&&u.focusNode!=l.node&&u.focusNode.nodeType==1){let p=u.focusNode.childNodes[u.focusOffset];p&&p.contentEditable=="false"&&(o=!0)}if(!(o||d&&qt)&&lo(a.node,a.offset,u.anchorNode,u.anchorOffset)&&lo(l.node,l.offset,u.focusNode,u.focusOffset))return;let f=!1;if((c.extend||e==n)&&!d){c.collapse(a.node,a.offset);try{e!=n&&c.extend(l.node,l.offset),f=!0}catch{}}if(!f){if(e>n){let h=a;a=l,l=h}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,o=0;o<this.children.length;o++){let i=this.children[o],s=r+i.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let a=r+i.border,l=s-i.border;if(e>=a&&n<=l){this.dirty=e==r||n==s?Ur:mg,e==a&&n==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Fn:i.markDirty(e-a,n-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Ur:Fn}r=s}this.dirty=Ur}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Ur:mg;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}let Ov=class extends Ts{constructor(e,n,r,o){let i,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!n.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=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==dn&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(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}},aT=class extends Ts{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}},Pa=class id extends Ts{constructor(e,n,r,o,i){super(e,[],r,o),this.mark=n,this.spec=i}static create(e,n,r,o){let i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return(!s||!s.dom)&&(s=si.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new id(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Fn||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Fn&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=dn){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=dn}}slice(e,n,r){let o=id.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=ad(i,n,s,r)),e>0&&(i=ad(i,0,e,r));for(let a=0;a<i.length;a++)i[a].parent=o;return o.children=i,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},jo=class Dv extends Ts{constructor(e,n,r,o,i,s,a,l,c){super(e,[],i,s),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=a}static create(e,n,r,o,i,s){let a=i.nodeViews[n.type.name],l,c=a&&a(n,i,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,o),u=c&&c.dom,d=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=si.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!d&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Bv(u,r,n),c?l=new lT(e,n,r,o,u,d||null,f,c,i,s+1):n.isText?new Mv(e,n,r,o,u,f,i):new Dv(e,n,r,o,u,d||null,f,i,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 n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>be.empty)}return e}matchesNode(e,n,r){return this.dirty==dn&&e.eq(this.node)&&za(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,o=n,i=e.composing?this.localCompositionInfo(e,n):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new uT(this,s&&s.node,e);pT(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?Ge.none:this.node.child(u).marks,r,e),l.placeWidget(c,e,o)},(c,u,d,f)=>{l.syncToMarks(c.marks,r,e);let p;l.findNodeMatch(c,u,d,f)||a&&e.state.selection.from>o&&e.state.selection.to<o+c.nodeSize&&(p=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(c,u,d,p,e)||l.updateNextNode(c,u,d,e,f,o)||l.addNode(c,u,d,e,o),o+=c.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Ur)&&(s&&this.protectLocalComposition(e,s),Iv(this.contentDOM,this.children,e),Jo&&hT(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof Le)||r<n||o>n+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let s=i.nodeValue,a=mT(this.node.content,s,r-n,o-n);return a<0?null:{node:i,pos:a,text:s}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new aT(this,i,n,o);e.input.compositionNodes.push(s),this.children=ad(this.children,r,r+o.length,e,s)}update(e,n,r,o){return this.dirty==Fn||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,o),!0)}updateInner(e,n,r,o){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=dn}updateOuterDeco(e){if(za(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Fv(this.dom,this.nodeDOM,sd(this.outerDeco,this.node,n),sd(e,this.node,n)),this.dom!=r&&(r.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 gg(t,e,n,r,o){Bv(r,e,t);let i=new jo(void 0,t,e,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}let Mv=class _v extends jo{constructor(e,n,r,o,i,s,a){super(e,n,r,o,i,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,n,r,o){return this.dirty==Fn||this.dirty!=dn&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=dn||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=dn,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let o=this.node.cut(e,n),i=document.createTextNode(o.text);return new _v(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Fn)}get domAtom(){return!1}isText(e){return this.node.text==e}},Nv=class extends Ts{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==dn&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}},lT=class extends jo{constructor(e,n,r,o,i,s,a,l,c,u){super(e,n,r,o,i,s,a,c,u),this.spec=l}update(e,n,r,o){if(this.dirty==Fn)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,o),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,o)}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 Iv(t,e,n){let r=t.firstChild,o=!1;for(let i=0;i<e.length;i++){let s=e[i],a=s.dom;if(a.parentNode==t){for(;a!=r;)r=yg(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(a,r);if(s instanceof Pa){let l=r?r.previousSibling:t.lastChild;Iv(s.contentDOM,s.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=yg(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const ji=function(t){t&&(this.nodeName=t)};ji.prototype=Object.create(null);const Hr=[new ji];function sd(t,e,n){if(t.length==0)return Hr;let r=n?Hr[0]:new ji,o=[r];for(let i=0;i<t.length;i++){let s=t[i].type.attrs;if(s){s.nodeName&&o.push(r=new ji(s.nodeName));for(let a in s){let l=s[a];l!=null&&(n&&o.length==1&&o.push(r=new ji(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return o}function Fv(t,e,n,r){if(n==Hr&&r==Hr)return e;let o=e;for(let i=0;i<r.length;i++){let s=r[i],a=n[i];if(i){let l;a&&a.nodeName==s.nodeName&&o!=t&&(l=o.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(o),a=Hr[0]),o=l}cT(o,a||Hr[0],s)}return o}function cT(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)o.indexOf(r[i])==-1&&t.classList.remove(r[i]);for(let i=0;i<o.length;i++)r.indexOf(o[i])==-1&&t.classList.add(o[i]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(e.style);)t.style.removeProperty(o[1])}n.style&&(t.style.cssText+=n.style)}}function Bv(t,e,n){return Fv(t,t,Hr,sd(e,n,t.nodeType!=1))}function za(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function yg(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}let uT=class{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=dT(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let o=0,i=this.stack.length>>1,s=Math.min(i,e.length);for(;o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&e[o].type.spec.spanning!==!1;)o++;for(;o<i;)this.destroyRest(),this.top.dirty=dn,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<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[i])&&!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=Pa.create(this.top,e[i],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(e,n,r,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))i=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,n,r)&&!this.preMatch.matched.has(c)){i=a;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,n,r,o,i){let s=this.top.children[o];return s.dirty==Fn&&s.dom==s.contentDOM&&(s.dirty=Ur),s.update(e,n,r,i)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}e=n}}updateNextNode(e,n,r,o,i,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof jo){let c=this.preMatch.matched.get(l);if(c!=null&&c!=i)return!1;let u=l.dom,d,f=this.isLocked(u)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=Fn&&za(n,l.outerDeco));if(!f&&l.update(e,n,r,o))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(l,e,n,r,o,s)))return this.destroyBetween(this.index,a),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=Ur,d.updateChildren(o,s+1),d.dirty=dn),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,o,i,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!za(r,e.outerDeco)||!o.eq(e.innerDeco))return null;let a=jo.create(this.top,n,r,o,i,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,n,r,o,i){let s=jo.create(this.top,e,n,r,o,i);s.contentDOM&&s.updateChildren(o,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(e)&&(e==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let i=new Ov(this.top,e,n,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Pa;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Mv)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((qt||Mt)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new Nv(this.top,[],r,null);n!=this.top?n.children.push(o):n.children.splice(this.index++,0,o),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}};function dT(t,e){let n=e,r=n.children.length,o=t.childCount,i=new Map,s=[];e:for(;o>0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof Pa)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function fT(t,e){return t.type.side-e.type.side}function pT(t,e,n,r){let o=e.locals(t),i=0;if(o.length==0){for(let c=0;c<t.childCount;c++){let u=t.child(c);r(u,o,e.forChild(i,u),c),i+=u.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let u,d;for(;s<o.length&&o[s].to==i;){let y=o[s++];y.widget&&(u?(d||(d=[u])).push(y):u=y)}if(u)if(d){d.sort(fT);for(let y=0;y<d.length;y++)n(d[y],c,!!l)}else n(u,c,!!l);let f,p;if(l)p=-1,f=l,l=null;else if(c<t.childCount)p=c,f=t.child(c++);else break;for(let y=0;y<a.length;y++)a[y].to<=i&&a.splice(y--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)a.push(o[s++]);let h=i+f.nodeSize;if(f.isText){let y=h;s<o.length&&o[s].from<y&&(y=o[s].from);for(let g=0;g<a.length;g++)a[g].to<y&&(y=a[g].to);y<h&&(l=f.cut(y-i),f=f.cut(0,y-i),h=y,p=-1)}else for(;s<o.length&&o[s].to<h;)s++;let m=f.isInline&&!f.isLeaf?a.filter(y=>!y.inline):a.slice();r(f,m,e.forChild(i,f),p),i=h}}function hT(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 mT(t,e,n,r){for(let o=0,i=0;o<t.childCount&&i<=r;){let s=t.child(o++),a=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;o<t.childCount;){let c=t.child(o++);if(i+=c.nodeSize,!c.isText)break;l+=c.text}if(i>=n){if(i>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a<r?l.lastIndexOf(e,r-a-1):-1;if(c>=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function ad(t,e,n,r,o){let i=[];for(let s=0,a=0;s<t.length;s++){let l=t[s],c=a,u=a+=l.size;c>=n||u<=e?i.push(l):(c<e&&i.push(l.slice(0,e-c,r)),o&&(i.push(o),o=void 0),u>n&&i.push(l.slice(n-c,l.size,r)))}return i}function Df(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),i=o&&o.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(Cl(n)){for(l=s;o&&!o.node;)o=o.parent;let d=o.node;if(o&&d.isAtom&&Ne.isSelectable(d)&&o.parent&&!(d.isInline&&j$(n.focusNode,n.focusOffset,o.dom))){let f=o.posBefore;c=new Ne(s==f?a:r.resolve(f))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let d=s,f=s;for(let p=0;p<n.rangeCount;p++){let h=n.getRangeAt(p);d=Math.min(d,t.docView.posFromDOM(h.startContainer,h.startOffset,1)),f=Math.max(f,t.docView.posFromDOM(h.endContainer,h.endOffset,-1))}if(d<0)return null;[l,s]=f==t.state.selection.anchor?[f,d]:[d,f],a=r.resolve(s)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let u=r.resolve(l);if(!c){let d=e=="pointer"||t.state.selection.head<a.pos&&!i?1:-1;c=Mf(t,u,a,d)}return c}function Rv(t){return t.editable?t.hasFocus():Pv(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function er(t,e=!1){let n=t.state.selection;if(Lv(t,n),!!Rv(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Mt){let r=t.domSelectionRange(),o=t.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&lo(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)yT(t);else{let{anchor:r,head:o}=n,i,s;bg&&!(n instanceof Le)&&(n.$from.parent.inlineContent||(i=wg(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=wg(t,n.to))),t.docView.setSelection(r,o,t,e),bg&&(i&&vg(i),s&&vg(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&gT(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const bg=qt||Mt&&kv<63;function wg(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(qt&&o&&o.contentEditable=="false")return Kc(o);if((!o||o.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(o)return Kc(o);if(i)return Kc(i)}}function Kc(t){return t.contentEditable="true",qt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function vg(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function gT(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=o)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Rv(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function yT(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,o=r.nodeName=="IMG";o?n.setStart(r.parentNode,Et(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&Gt&&Er<=11&&(r.disabled=!0,r.disabled=!1)}function Lv(t,e){if(e instanceof Ne){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(xg(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else xg(t)}function xg(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Mf(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||Le.between(e,n,r)}function kg(t){return t.editable&&!t.hasFocus()?!1:Pv(t)}function Pv(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 bT(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return lo(e.node,e.offset,n.anchorNode,n.anchorOffset)}function ld(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return i&&Re.findFrom(i,e)}function gr(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Sg(t,e,n){let r=t.state.selection;if(r instanceof Le)if(n.indexOf("s")>-1){let{$head:o}=r,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=t.state.doc.resolve(o.pos+i.nodeSize*(e<0?-1:1));return gr(t,new Le(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=ld(t.state,e);return o&&o instanceof Ne?gr(t,o):!1}else if(!(cn&&n.indexOf("m")>-1)){let o=r.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let a=e<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?Ne.isSelectable(i)?gr(t,new Ne(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):$s?gr(t,new Le(t.state.doc.resolve(e<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Ne&&r.node.isInline)return gr(t,new Le(e>0?r.$to:r.$from));{let o=ld(t.state,e);return o?gr(t,o):!1}}}function ja(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function qi(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function ko(t,e){return e<0?wT(t):vT(t)}function wT(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=!1;for(bn&&n.nodeType==1&&r<ja(n)&&qi(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(qi(a,-1))o=n,i=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(zv(n))break;{let a=n.previousSibling;for(;a&&qi(a,-1);)o=n.parentNode,i=Et(a),a=a.previousSibling;if(a)n=a,r=ja(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?cd(t,n,r):o&&cd(t,o,i)}function vT(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=ja(n),i,s;for(;;)if(r<o){if(n.nodeType!=1)break;let a=n.childNodes[r];if(qi(a,1))i=n,s=++r;else break}else{if(zv(n))break;{let a=n.nextSibling;for(;a&&qi(a,1);)i=a.parentNode,s=Et(a)+1,a=a.nextSibling;if(a)n=a,r=0,o=ja(n);else{if(n=n.parentNode,n==t.dom)break;r=o=0}}}i&&cd(t,i,s)}function zv(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function xT(t,e){for(;t&&e==t.childNodes.length&&!As(t);)e=Et(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function kT(t,e){for(;t&&!e&&!As(t);)e=Et(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function cd(t,e,n){if(e.nodeType!=3){let i,s;(s=xT(e,n))?(e=s,n=0):(i=kT(e,n))&&(e=i,n=i.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Cl(r)){let i=document.createRange();i.setEnd(e,n),i.setStart(e,n),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&er(t)},50)}function Cg(t,e){let n=t.state.doc.resolve(e);if(!(Mt||U$)&&n.parent.inlineContent){let r=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),i=(o.top+o.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(o.left-r.left)>1)return o.left<r.left?"ltr":"rtl"}if(e<n.end()){let o=t.coordsAtPos(e+1),i=(o.top+o.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(o.left-r.left)>1)return o.left>r.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function Eg(t,e,n){let r=t.state.selection;if(r instanceof Le&&!r.empty||n.indexOf("s")>-1||cn&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=ld(t.state,e);if(s&&s instanceof Ne)return gr(t,s)}if(!o.parent.inlineContent){let s=e<0?o:i,a=r instanceof Mn?Re.near(s,e):Re.findFrom(s,e);return a?gr(t,a):!1}return!1}function Ag(t,e){if(!(t.state.selection instanceof Le))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let s=t.state.tr;return e<0?s.delete(n.pos-i.nodeSize,n.pos):s.delete(n.pos,n.pos+i.nodeSize),t.dispatch(s),!0}return!1}function $g(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function ST(t){if(!qt||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;$g(t,r,"true"),setTimeout(()=>$g(t,r,"false"),20)}return!1}function CT(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function ET(t,e){let n=e.keyCode,r=CT(e);if(n==8||cn&&n==72&&r=="c")return Ag(t,-1)||ko(t,-1);if(n==46&&!e.shiftKey||cn&&n==68&&r=="c")return Ag(t,1)||ko(t,1);if(n==13||n==27)return!0;if(n==37||cn&&n==66&&r=="c"){let o=n==37?Cg(t,t.state.selection.from)=="ltr"?-1:1:-1;return Sg(t,o,r)||ko(t,o)}else if(n==39||cn&&n==70&&r=="c"){let o=n==39?Cg(t,t.state.selection.from)=="ltr"?1:-1:1;return Sg(t,o,r)||ko(t,o)}else{if(n==38||cn&&n==80&&r=="c")return Eg(t,-1,r)||ko(t,-1);if(n==40||cn&&n==78&&r=="c")return ST(t)||Eg(t,1,r)||ko(t,1);if(r==(cn?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function _f(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=t.someProp("clipboardSerializer")||si.fromSchema(t.state.schema),a=Wv(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=Hv[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let h=a.createElement(u[p]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(n)}`);let f=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`
33
-
34
- `);return{dom:l,text:f,slice:e}}function jv(t,e,n,r,o){let i=o.parent.type.spec.code,s,a;if(!n&&!e)return null;let l=e&&(r||i||!n);if(l){if(t.someProp("transformPastedText",f=>{e=f(e,i||r,t)}),i)return e?new ve(be.from(t.state.schema.text(e.replace(/\r\n?/g,`
35
- `))),0,0):ve.empty;let d=t.someProp("clipboardTextParser",f=>f(e,o,r,t));if(d)a=d;else{let f=o.marks(),{schema:p}=t.state,h=si.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let y=s.appendChild(document.createElement("p"));m&&y.appendChild(h.serializeNode(p.text(m,f)))})}}else t.someProp("transformPastedHTML",d=>{n=d(n,t)}),s=OT(n),$s&&DT(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 d=+u[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Yr.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:o,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!AT.test(d.parentNode.nodeName)?{ignore:!0}:null}})),u)a=MT(Tg(a,+u[1],+u[2]),u[4]);else if(a=ve.maxOpen($T(a.content,o),!0),a.openStart||a.openEnd){let d=0,f=0;for(let p=a.content.firstChild;d<a.openStart&&!p.type.spec.isolating;d++,p=p.firstChild);for(let p=a.content.lastChild;f<a.openEnd&&!p.type.spec.isolating;f++,p=p.lastChild);a=Tg(a,d,f)}return t.someProp("transformPasted",d=>{a=d(a,t)}),a}const AT=/^(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 $T(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.index(n)),o,i=[];if(t.forEach(s=>{if(!i)return;let a=r.findWrapping(s.type),l;if(!a)return i=null;if(l=i.length&&o.length&&Vv(a,o,s,i[i.length-1],0))i[i.length-1]=l;else{i.length&&(i[i.length-1]=Uv(i[i.length-1],o.length));let c=qv(s,a);i.push(c),r=r.matchType(c.type),o=a}}),i)return be.from(i)}return t}function qv(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,be.from(t));return t}function Vv(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let i=Vv(t,e,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(be.from(qv(n,t,o+1))))}}function Uv(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Uv(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(be.empty,!0);return t.copy(n.append(r))}function ud(t,e,n,r,o,i){let s=e<0?t.firstChild:t.lastChild,a=s.content;return t.childCount>1&&(i=0),o<r-1&&(a=ud(a,e,n,r,o+1,i)),o>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(be.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function Tg(t,e,n){return e<t.openStart&&(t=new ve(ud(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new ve(ud(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Hv={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 Og=null;function Wv(){return Og||(Og=document.implementation.createHTMLDocument("title"))}let Xc=null;function TT(t){let e=window.trustedTypes;return e?(Xc||(Xc=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Xc.createHTML(t)):t}function OT(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Wv().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),o;if((o=r&&Hv[r[1].toLowerCase()])&&(t=o.map(i=>"<"+i+">").join("")+t+o.map(i=>"</"+i+">").reverse().join("")),n.innerHTML=TT(t),o)for(let i=0;i<o.length;i++)n=n.querySelector(o[i])||n;return n}function DT(t){let e=t.querySelectorAll(Mt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function MT(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:o,openStart:i,openEnd:s}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;o=be.from(l.create(r[a+1],o)),i++,s++}return new ve(o,i,s)}const Vt={},Ut={},_T={touchstart:!0,touchmove:!0};let NT=class{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.lastChromeDelete=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 IT(t){for(let e in Vt){let n=Vt[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{BT(t,r)&&!Nf(t,r)&&(t.editable||!(r.type in Ut))&&n(t,r)},_T[e]?{passive:!0}:void 0)}qt&&t.dom.addEventListener("input",()=>null),dd(t)}function vr(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function FT(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 dd(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Nf(t,r))})}function Nf(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function BT(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function RT(t,e){!Nf(t,e)&&Vt[e.type]&&(t.editable||!(e.type in Ut))&&Vt[e.type](t,e)}Ut.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Kv(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Yn&&Mt&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Jo&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",o=>o(t,jr(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||ET(t,n)?n.preventDefault():vr(t,"key")};Ut.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Ut.keypress=(t,e)=>{let n=e;if(Kv(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||cn&&n.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Le)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode);!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",i=>i(t,r.$from.pos,r.$to.pos,o))&&t.dispatch(t.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}};function El(t){return{left:t.clientX,top:t.clientY}}function LT(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function If(t,e,n,r,o){if(r==-1)return!1;let i=t.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(t.someProp(e,a=>s>i.depth?a(t,n,i.nodeAfter,i.before(s),o,!0):a(t,n,i.node(s),i.before(s),o,!1)))return!0;return!1}function qo(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function PT(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Ne.isSelectable(r)?(qo(t,new Ne(n)),!0):!1}function zT(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof Ne&&(r=n.node);let i=t.state.doc.resolve(e);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(Ne.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?o=i.before(n.$from.depth):o=i.before(s);break}}return o!=null?(qo(t,Ne.create(t.state.doc,o)),!0):!1}function jT(t,e,n,r,o){return If(t,"handleClickOn",e,n,r)||t.someProp("handleClick",i=>i(t,e,r))||(o?zT(t,n):PT(t,n))}function qT(t,e,n,r){return If(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function VT(t,e,n,r){return If(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||UT(t,n,r)}function UT(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(qo(t,Le.create(r,0,r.content.size)),!0):!1;let o=r.resolve(e);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)qo(t,Le.create(r,a+1,a+1+s.content.size));else if(Ne.isSelectable(s))qo(t,Ne.create(r,a));else continue;return!0}}function Ff(t){return qa(t)}const Gv=cn?"metaKey":"ctrlKey";Vt.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Ff(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&LT(n,t.input.lastClick)&&!n[Gv]&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=t.posAtCoords(El(n));s&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new HT(t,s,n,!!r)):(i=="doubleClick"?qT:VT)(t,s.pos,s.inside,n)?n.preventDefault():vr(t,"pointer"))};let HT=class{constructor(e,n,r,o){this.view=e,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Gv],this.allowDefault=r.shiftKey;let i,s;if(n.inside>-1)i=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);i=u.parent,s=u.depth?u.before():0}const a=o?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:c}=e.state;(r.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof Ne&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&bn&&!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)),vr(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(()=>er(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(El(e))),this.updateAllowDefault(e),this.allowDefault||!n?vr(this.view,"pointer"):jT(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||qt&&this.mightDrag&&!this.mightDrag.node.isAtom||Mt&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(qo(this.view,Re.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):vr(this.view,"pointer")}move(e){this.updateAllowDefault(e),vr(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)}};Vt.touchstart=t=>{t.input.lastTouch=Date.now(),Ff(t),vr(t,"pointer")};Vt.touchmove=t=>{t.input.lastTouch=Date.now(),vr(t,"pointer")};Vt.contextmenu=t=>Ff(t);function Kv(t,e){return t.composing?!0:qt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const WT=Yn?5e3:-1;Ut.compositionstart=Ut.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Le&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),qa(t,!0),t.markCursor=null;else if(qa(t,!e.selection.empty),bn&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,i=r.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){let a=t.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else o=s,i=-1}}t.input.composing=!0}Xv(t,WT)};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++,Xv(t,20))};function Xv(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>qa(t),e))}function Jv(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=KT());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function GT(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=P$(e.focusNode,e.focusOffset),r=z$(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let o=r.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!o||!o.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function KT(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function qa(t,e=!1){if(!(Yn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Jv(t),e||t.docView&&t.docView.dirty){let n=Df(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function XT(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const ns=Gt&&Er<15||Jo&&H$<604;Vt.copy=Ut.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let i=ns?null:n.clipboardData,s=r.content(),{dom:a,text:l}=_f(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):XT(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function JT(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function YT(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?rs(t,r.value,null,o,e):rs(t,r.textContent,r.innerHTML,o,e)},50)}function rs(t,e,n,r,o){let i=jv(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,o,i||ve.empty)))return!0;if(!i)return!1;let s=JT(i),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(i);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Yv(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Ut.paste=(t,e)=>{let n=e;if(t.composing&&!Yn)return;let r=ns?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&rs(t,Yv(r),r.getData("text/html"),o,n)?n.preventDefault():YT(t,n)};let Zv=class{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}};const Qv=cn?"altKey":"ctrlKey";Vt.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,i=o.empty?null:t.posAtCoords(El(n)),s;if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof Ne?o.to-1:o.to))){if(r&&r.mightDrag)s=Ne.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=t.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=t.docView&&(s=Ne.create(t.state.doc,d.posBefore))}}let a=(s||t.state.selection).content(),{dom:l,text:c,slice:u}=_f(t,a);(!n.dataTransfer.files.length||!Mt||kv>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(ns?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",ns||n.dataTransfer.setData("text/plain",c),t.dragging=new Zv(u,!n[Qv],s)};Vt.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 n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(El(n));if(!o)return;let i=t.state.doc.resolve(o.pos),s=r&&r.slice;s?t.someProp("transformPasted",h=>{s=h(s,t)}):s=jv(t,Yv(n.dataTransfer),ns?null:n.dataTransfer.getData("text/html"),!1,i);let a=!!(r&&!n[Qv]);if(t.someProp("handleDrop",h=>h(t,n,s||ve.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?$w(t.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let c=t.state.tr;if(a){let{node:h}=r;h?h.replace(c):c.deleteSelection()}let u=c.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let p=c.doc.resolve(u);if(d&&Ne.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Ne(p));else{let h=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((m,y,g,x)=>h=x),c.setSelection(Mf(t,p,c.doc.resolve(h)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};Vt.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())&&er(t)},20))};Vt.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};Vt.beforeinput=(t,e)=>{if(Mt&&Yn&&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,jr(8,"Backspace")))))return;let{$cursor:r}=t.state.selection;r&&r.pos>0&&t.dispatch(t.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let t in Ut)Vt[t]=Ut[t];function is(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}let Dg=class e1{constructor(e,n){this.toDOM=e,this.spec=n||Zr,this.side=this.spec.side||0}map(e,n,r,o){let{pos:i,deleted:s}=e.mapResult(n.from+o,this.side<0?-1:1);return s?null:new Pe(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof e1&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&is(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},Vi=class fd{constructor(e,n){this.attrs=e,this.spec=n||Zr}map(e,n,r,o){let i=e.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new Pe(i,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof fd&&is(this.attrs,e.attrs)&&is(this.spec,e.spec)}static is(e){return e.type instanceof fd}destroy(){}},ZT=class t1{constructor(e,n){this.attrs=e,this.spec=n||Zr}map(e,n,r,o){let i=e.mapResult(n.from+o,1);if(i.deleted)return null;let s=e.mapResult(n.to+o,-1);return s.deleted||s.pos<=i.pos?null:new Pe(i.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:o}=e.content.findIndex(n.from),i;return o==n.from&&!(i=e.child(r)).isText&&o+i.nodeSize==n.to}eq(e){return this==e||e instanceof t1&&is(this.attrs,e.attrs)&&is(this.spec,e.spec)}destroy(){}};class Pe{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Pe(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new Pe(e,e,new Dg(n,r))}static inline(e,n,r,o){return new Pe(e,n,new Vi(r,o))}static node(e,n,r,o){return new Pe(e,n,new ZT(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof Vi}get widget(){return this.type instanceof Dg}}const _o=[],Zr={};let qe=class fr{constructor(e,n){this.local=e.length?e:_o,this.children=n.length?n:_o}static create(e,n){return n.length?Va(n,e,0,Zr):Ot}find(e,n,r){let o=[];return this.findInner(e??0,n??1e9,o,0,r),o}findInner(e,n,r,o,i){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=e&&(!i||i(a.spec))&&r.push(a.copy(a.from+o,a.to+o))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,o+a,i)}}map(e,n,r){return this==Ot||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Zr)}mapInner(e,n,r,o,i){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,o);l&&l.type.valid(n,l)?(s||(s=[])).push(l):i.onRemove&&i.onRemove(this.local[a].spec)}return this.children.length?QT(this.children,s||[],e,n,r,o,i):s?new fr(s.sort(Qr),_o):Ot}add(e,n){return n.length?this==Ot?fr.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let o,i=0;e.forEach((a,l)=>{let c=l+r,u;if(u=o1(n,a,c)){for(o||(o=this.children.slice());i<o.length&&o[i]<l;)i+=3;o[i]==l?o[i+2]=o[i+2].addInner(a,u,c+1):o.splice(i,0,l,l+a.nodeSize,Va(u,a,c+1,Zr)),i+=3}});let s=r1(i?i1(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new fr(s.length?this.local.concat(s).sort(Qr):this.local,o||this.children)}remove(e){return e.length==0||this==Ot?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,o=this.local;for(let i=0;i<r.length;i+=3){let s,a=r[i]+n,l=r[i+1]+n;for(let u=0,d;u<e.length;u++)(d=e[u])&&d.from>a&&d.to<l&&(e[u]=null,(s||(s=[])).push(d));if(!s)continue;r==this.children&&(r=this.children.slice());let c=r[i+2].removeInner(s,a+1);c!=Ot?r[i+2]=c:(r.splice(i,3),i-=3)}if(o.length){for(let i=0,s;i<e.length;i++)if(s=e[i])for(let a=0;a<o.length;a++)o[a].eq(s,n)&&(o==this.local&&(o=this.local.slice()),o.splice(a--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new fr(o,r):Ot}forChild(e,n){if(this==Ot)return this;if(n.isLeaf)return fr.empty;let r,o;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let i=e+1,s=i+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>i&&l.type instanceof Vi){let c=Math.max(i,l.from)-i,u=Math.min(s,l.to)-i;c<u&&(o||(o=[])).push(l.copy(c,u))}}if(o){let a=new fr(o.sort(Qr),_o);return r?new n1([a,r]):a}return r||Ot}eq(e){if(this==e)return!0;if(!(e instanceof fr)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Bf(this.localsInner(e))}localsInner(e){if(this==Ot)return _o;if(e.inlineContent||!this.local.some(Vi.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Vi||n.push(this.local[r]);return n}forEachSet(e){e(this)}};qe.empty=new qe([],[]);qe.removeOverlap=Bf;const Ot=qe.empty;let n1=class No{constructor(e){this.members=e}map(e,n){const r=this.members.map(o=>o.map(e,n,Zr));return No.from(r)}forChild(e,n){if(n.isLeaf)return qe.empty;let r=[];for(let o=0;o<this.members.length;o++){let i=this.members[o].forChild(e,n);i!=Ot&&(i instanceof No?r=r.concat(i.members):r.push(i))}return No.from(r)}eq(e){if(!(e instanceof No)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let o=0;o<this.members.length;o++){let i=this.members[o].localsInner(e);if(i.length)if(!n)n=i;else{r&&(n=n.slice(),r=!1);for(let s=0;s<i.length;s++)n.push(i[s])}}return n?Bf(r?n:n.sort(Qr)):_o}static from(e){switch(e.length){case 0:return Ot;case 1:return e[0];default:return new No(e.every(n=>n instanceof qe)?e:e.reduce((n,r)=>n.concat(r instanceof qe?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}};function QT(t,e,n,r,o,i,s){let a=t.slice();for(let c=0,u=i;c<n.maps.length;c++){let d=0;n.maps[c].forEach((f,p,h,m)=>{let y=m-h-(p-f);for(let g=0;g<a.length;g+=3){let x=a[g+1];if(x<0||f>x+u-d)continue;let k=a[g]+u-d;p>=k?a[g+1]=f<=k?-2:-1:f>=u&&y&&(a[g]+=y,a[g+1]+=y)}d+=y}),u=n.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=n.map(t[c]+i),d=u-o;if(d<0||d>=r.content.size){l=!0;continue}let f=n.map(t[c+1]+i,-1),p=f-o,{index:h,offset:m}=r.content.findIndex(d),y=r.maybeChild(h);if(y&&m==d&&m+y.nodeSize==p){let g=a[c+2].mapInner(n,y,u+1,t[c]+i+1,s);g!=Ot?(a[c]=d,a[c+1]=p,a[c+2]=g):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=e4(a,t,e,n,o,i,s),u=Va(c,r,0,s);e=u.local;for(let d=0;d<a.length;d+=3)a[d+1]<0&&(a.splice(d,3),d-=3);for(let d=0,f=0;d<u.children.length;d+=3){let p=u.children[d];for(;f<a.length&&a[f]<p;)f+=3;a.splice(f,0,u.children[d],u.children[d+1],u.children[d+2])}}return new qe(e.sort(Qr),a)}function r1(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new Pe(o.from+e,o.to+e,o.type))}return n}function e4(t,e,n,r,o,i,s){function a(l,c){for(let u=0;u<l.local.length;u++){let d=l.local[u].map(r,o,c);d?n.push(d):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]+i+1);return n}function o1(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let i=0,s;i<t.length;i++)(s=t[i])&&s.from>n&&s.to<r&&((o||(o=[])).push(s),t[i]=null);return o}function i1(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Va(t,e,n,r){let o=[],i=!1;e.forEach((a,l)=>{let c=o1(t,a,l+n);if(c){i=!0;let u=Va(c,a,n+l+1,r);u!=Ot&&o.push(l,l+a.nodeSize,u)}});let s=r1(i?i1(t):t,-n).sort(Qr);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||o.length?new qe(s,o):Ot}function Qr(t,e){return t.from-e.from||t.to-e.to}function Bf(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let i=e[o];if(i.from==r.from){i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),Mg(e,o+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),Mg(e,o,r.copy(i.from,r.to)));break}}}return e}function Mg(t,e,n){for(;e<t.length&&Qr(n,t[e])>0;)e++;t.splice(e,0,n)}function Jc(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Ot&&e.push(r)}),t.cursorWrapper&&e.push(qe.create(t.state.doc,[t.cursorWrapper.deco])),n1.from(e)}const t4={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},n4=Gt&&Er<=11;let r4=class{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 o4{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new r4,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);Gt&&Er<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),n4&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.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,t4)),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 n=0;n<e.length;n++)this.queue.push(e[n]);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(kg(this.view)){if(this.suppressingSelectionUpdates)return er(this.view);if(Gt&&Er<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&lo(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 n=new Set,r;for(let i=e.focusNode;i;i=Xo(i))n.add(i);for(let i=e.anchorNode;i;i=Xo(i))if(n.has(i)){r=i;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))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 n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&kg(e)&&!this.ignoreSelectionChange(r),i=-1,s=-1,a=!1,l=[];if(e.editable)for(let u=0;u<n.length;u++){let d=this.registerMutation(n[u],l);d&&(i=i<0?d.from:Math.min(d.from,i),s=s<0?d.to:Math.max(d.to,s),d.typeOver&&(a=!0))}if(bn&&l.length){let u=l.filter(d=>d.nodeName=="BR");if(u.length==2){let[d,f]=u;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of u){let p=f.parentNode;p&&p.nodeName=="LI"&&(!d||a4(e,d)!=p)&&f.remove()}}}let c=null;i<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Cl(r)&&(c=Df(e))&&c.eq(Re.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,er(e),this.currentSelection.set(r),e.scrollToSelection()):(i>-1||o)&&(i>-1&&(e.docView.markDirty(i,s),i4(e)),this.handleDOMChange(i,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||er(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let d=e.addedNodes[u];n.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let o=e.previousSibling,i=e.nextSibling;if(Gt&&Er<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:d,nextSibling:f}=e.addedNodes[u];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(o=d),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f)}let s=o&&o.parentNode==e.target?Et(o)+1:0,a=r.localPosFromDOM(e.target,s,-1),l=i&&i.parentNode==e.target?Et(i):e.target.childNodes.length,c=r.localPosFromDOM(e.target,l,1);return{from:a,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let _g=new WeakMap,Ng=!1;function i4(t){if(!_g.has(t)&&(_g.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=bn,Ng)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."),Ng=!0}}function Ig(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,i=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return lo(s.node,s.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}function s4(t,e){if(e.getComposedRanges){let o=e.getComposedRanges(t.root)[0];if(o)return Ig(t,o)}let n;function r(o){o.preventDefault(),o.stopImmediatePropagation(),n=o.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?Ig(t,n):null}function a4(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function l4(t,e,n){let{node:r,fromOffset:o,toOffset:i,from:s,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),c,u=l.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:l.anchorOffset}],Cl(l)||c.push({node:l.focusNode,offset:l.focusOffset})),Mt&&t.input.lastKeyCode===8)for(let y=i;y>o;y--){let g=r.childNodes[y-1],x=g.pmViewDesc;if(g.nodeName=="BR"&&!x){i=y;break}if(!x||x.size)break}let d=t.state.doc,f=t.someProp("domParser")||Yr.fromSchema(t.state.schema),p=d.resolve(s),h=null,m=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:o,to:i,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:c4,context:p});if(c&&c[0].pos!=null){let y=c[0].pos,g=c[1]&&c[1].pos;g==null&&(g=y),h={anchor:y+s,head:g+s}}return{doc:m,sel:h,from:s,to:a}}function c4(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(qt&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||qt&&/^(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 u4=/^(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 d4(t,e,n,r,o){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let C=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,U=Df(t,C);if(U&&!t.state.selection.eq(U)){if(Mt&&Yn&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",I=>I(t,jr(13,"Enter"))))return;let ie=t.state.tr.setSelection(U);C=="pointer"?ie.setMeta("pointer",!0):C=="key"&&ie.scrollIntoView(),i&&ie.setMeta("composition",i),t.dispatch(ie)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,c=l4(t,e,n),u=t.state.doc,d=u.slice(c.from,c.to),f,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(f=t.state.selection.to,p="end"):(f=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let h=h4(d.content,c.doc.content,c.from,f,p);if(h&&t.input.domChangeCount++,(Jo&&t.input.lastIOSEnter>Date.now()-225||Yn)&&o.some(C=>C.nodeType==1&&!u4.test(C.nodeName))&&(!h||h.endA>=h.endB)&&t.someProp("handleKeyDown",C=>C(t,jr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!h)if(r&&l instanceof Le&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))h={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let C=Fg(t,t.state.doc,c.sel);if(C&&!C.eq(t.state.selection)){let U=t.state.tr.setSelection(C);i&&U.setMeta("composition",i),t.dispatch(U)}}return}t.state.selection.from<t.state.selection.to&&h.start==h.endB&&t.state.selection instanceof Le&&(h.start>t.state.selection.from&&h.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?h.start=t.state.selection.from:h.endA<t.state.selection.to&&h.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(h.endB+=t.state.selection.to-h.endA,h.endA=t.state.selection.to)),Gt&&Er<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>c.from&&c.doc.textBetween(h.start-c.from-1,h.start-c.from+1)=="  "&&(h.start--,h.endA--,h.endB--);let m=c.doc.resolveNoCache(h.start-c.from),y=c.doc.resolveNoCache(h.endB-c.from),g=u.resolve(h.start),x=m.sameParent(y)&&m.parent.inlineContent&&g.end()>=h.endA,k;if((Jo&&t.input.lastIOSEnter>Date.now()-225&&(!x||o.some(C=>C.nodeName=="DIV"||C.nodeName=="P"))||!x&&m.pos<c.doc.content.size&&!m.sameParent(y)&&(k=Re.findFrom(c.doc.resolve(m.pos+1),1,!0))&&k.head==y.pos)&&t.someProp("handleKeyDown",C=>C(t,jr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>h.start&&p4(u,h.start,h.endA,m,y)&&t.someProp("handleKeyDown",C=>C(t,jr(8,"Backspace")))){Yn&&Mt&&t.domObserver.suppressSelectionUpdates();return}Mt&&h.endB==h.start&&(t.input.lastChromeDelete=Date.now()),Yn&&!x&&m.start()!=y.start()&&y.parentOffset==0&&m.depth==y.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==h.endA&&(h.endB-=2,y=c.doc.resolveNoCache(h.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(C){return C(t,jr(13,"Enter"))})},20));let w=h.start,T=h.endA,D,M,F;if(x){if(m.pos==y.pos)Gt&&Er<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>er(t),20)),D=t.state.tr.delete(w,T),M=u.resolve(h.start).marksAcross(u.resolve(h.endA));else if(h.endA==h.endB&&(F=f4(m.parent.content.cut(m.parentOffset,y.parentOffset),g.parent.content.cut(g.parentOffset,h.endA-g.start()))))D=t.state.tr,F.type=="add"?D.addMark(w,T,F.mark):D.removeMark(w,T,F.mark);else if(m.parent.child(m.index()).isText&&m.index()==y.index()-(y.textOffset?0:1)){let C=m.parent.textBetween(m.parentOffset,y.parentOffset);if(t.someProp("handleTextInput",U=>U(t,w,T,C)))return;D=t.state.tr.insertText(C,w,T)}}if(D||(D=t.state.tr.replace(w,T,c.doc.slice(h.start-c.from,h.endB-c.from))),c.sel){let C=Fg(t,D.doc,c.sel);C&&!(Mt&&t.composing&&C.empty&&(h.start!=h.endB||t.input.lastChromeDelete<Date.now()-100)&&(C.head==w||C.head==D.mapping.map(T)-1)||Gt&&C.empty&&C.head==w)&&D.setSelection(C)}M&&D.ensureMarks(M),i&&D.setMeta("composition",i),t.dispatch(D.scrollIntoView())}function Fg(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Mf(t,e.resolve(n.anchor),e.resolve(n.head))}function f4(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,i=r,s,a,l;for(let u=0;u<r.length;u++)o=r[u].removeFromSet(o);for(let u=0;u<n.length;u++)i=n[u].removeFromSet(i);if(o.length==1&&i.length==0)a=o[0],s="add",l=u=>u.mark(a.addToSet(u.marks));else if(o.length==0&&i.length==1)a=i[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(be.from(c).eq(t))return{mark:a,type:s}}function p4(t,e,n,r,o){if(n-e<=o.pos-r.pos||Yc(r,!0,!1)<o.pos)return!1;let i=t.resolve(e);if(!r.parent.isTextblock){let a=i.nodeAfter;return a!=null&&n==e+a.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=t.resolve(Yc(i,!0,!0));return!s.parent.isTextblock||s.pos>n||Yc(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function Yc(t,e,n){let r=t.depth,o=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let i=t.node(r).maybeChild(t.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function h4(t,e,n,r,o){let i=t.findDiffStart(e,n);if(i==null)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(o=="end"){let l=Math.max(0,i-Math.min(s,a));r-=s+l-i}if(s<i&&t.size<e.size){let l=r<=i&&r>=s?i-r:0;i-=l,i&&i<e.size&&Bg(e.textBetween(i-1,i+1))&&(i+=l?1:-1),a=i+(a-s),s=i}else if(a<i){let l=r<=i&&r>=a?i-r:0;i-=l,i&&i<t.size&&Bg(t.textBetween(i-1,i+1))&&(i+=l?1:-1),s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}function Bg(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}let s1=class{constructor(e,n){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 NT,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(jg),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=Pg(this),Lg(this),this.nodeViews=zg(this),this.docView=gg(this.state.doc,Rg(this),Jc(this),this.dom,this),this.domObserver=new o4(this,(r,o,i,s)=>d4(this,r,o,i,s)),this.domObserver.start(),IT(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 n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&dd(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(jg),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let o=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&(Jv(this),s=!0),this.state=e;let a=o.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=zg(this);g4(p,this.nodeViews)&&(this.nodeViews=p,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&dd(this),this.editable=Pg(this),Lg(this);let l=Jc(this),c=Rg(this),u=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",d=i||!this.docView.matchesNode(e.doc,c,l);(d||!e.selection.eq(o.selection))&&(s=!0);let f=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&K$(this);if(s){this.domObserver.stop();let p=d&&(Gt||Mt)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&m4(o.selection,e.selection);if(d){let h=Mt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=GT(this)),(i||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=gg(e.doc,c,l,this.dom,this)),h&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&bT(this))?er(this,p):(Lv(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&X$(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))&&!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Ne){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&ug(this,n.getBoundingClientRect(),e)}else ug(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 n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,o=-1;if(this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let i=r.from+(this.state.doc.content.size-n.doc.content.size);(i>0&&this.state.doc.nodeAt(i))==r.node&&(o=i)}this.dragging=new Zv(e.slice,e.move,o<0?void 0:Ne.create(this.state.doc,o))}someProp(e,n){let r=this._props&&this._props[e],o;if(r!=null&&(o=n?n(r):r))return o;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(o=n?n(a):a))return o}let i=this.state.plugins;if(i)for(let s=0;s<i.length;s++){let a=i[s].props[e];if(a!=null&&(o=n?n(a):a))return o}}hasFocus(){if(Gt){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&&J$(this.dom),er(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return tT(this,e)}coordsAtPos(e,n=1){return $v(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let o=this.docView.posFromDOM(e,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,n){return sT(this,n||this.state,e)}pasteHTML(e,n){return rs(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return rs(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return _f(this,e)}destroy(){this.docView&&(FT(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Jc(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,R$())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return RT(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?qt&&this.root.nodeType===11&&q$(this.dom.ownerDocument)==this.dom&&s4(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};function Rg(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Pe.node(0,t.state.doc.content.size,e)]}function Lg(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:Pe.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Pg(t){return!t.someProp("editable",e=>e(t.state)===!1)}function m4(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function zg(t){let e=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function g4(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r}function jg(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")}const y4=Math.floor,eo=(t,e)=>t<e?t:e,Ua=(t,e)=>t>e?t:e,b4=()=>new Set,w4=t=>t.toLowerCase(),v4=/^\s*/g,x4=t=>t.replace(v4,""),k4=/([A-Z])/g,qg=(t,e)=>x4(t.replace(k4,n=>`${e}${w4(n)}`));typeof TextEncoder<"u"&&new TextEncoder;let Zc=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});Zc&&Zc.decode(new Uint8Array).length===1&&(Zc=null);const a1=t=>new Error(t),S4=()=>{throw a1("Method unimplemented")},l1=()=>{throw a1("Unexpected case")},wa=()=>new Map,C4=(t,e,n)=>{let r=t.get(e);return r===void 0&&t.set(e,r=n()),r},E4=Object.keys,A4=(t,e)=>e.includes(t),$4=()=>{let t=!0;return(e,n)=>{if(t){t=!1;try{e()}finally{t=!0}}else n!==void 0&&n()}},T4=/[\uD800-\uDBFF]/,O4=/[\uDC00-\uDFFF]/,D4=(t,e)=>{let n=0,r=0;for(;n<t.length&&n<e.length&&t[n]===e[n];)n++;for(n>0&&T4.test(t[n-1])&&n--;r+n<t.length&&r+n<e.length&&t[t.length-r-1]===e[e.length-r-1];)r++;return r>0&&O4.test(t[t.length-r])&&r--,{index:n,remove:t.length-n-r,insert:e.slice(n,e.length-r)}},M4=D4,tt=new et("y-sync"),Ar=new et("y-undo"),qs=new et("yjs-cursor"),_4=Math.random,N4=t=>t[y4(_4()*t.length)],I4=t=>t===void 0?null:t;let F4=class{constructor(){this.map=new Map}setItem(e,n){this.map.set(e,n)}getItem(e){return this.map.get(e)}},c1=new F4,B4=!0;try{typeof localStorage<"u"&&localStorage&&(c1=localStorage,B4=!1)}catch{}const R4=c1,Yo=typeof Se<"u"&&Se.release&&/node|io\.js/.test(Se.release.name)&&Object.prototype.toString.call(typeof Se<"u"?Se:0)==="[object process]",L4=typeof window<"u"&&typeof document<"u"&&!Yo;let kn;const P4=()=>{if(kn===void 0)if(Yo){kn=wa();const t=Se.argv;let e=null;for(let n=0;n<t.length;n++){const r=t[n];r[0]==="-"?(e!==null&&kn.set(e,""),e=r):e!==null&&(kn.set(e,r),e=null)}e!==null&&kn.set(e,"")}else typeof location=="object"?(kn=wa(),(location.search||"?").slice(1).split("&").forEach(t=>{if(t.length!==0){const[e,n]=t.split("=");kn.set(`--${qg(e,"-")}`,n),kn.set(`-${qg(e,"-")}`,n)}})):kn=wa();return kn},pd=t=>P4().has(t),hd=t=>I4(Yo?Se.env[t.toUpperCase().replaceAll("-","_")]:R4.getItem(t)),u1=t=>pd("--"+t)||hd(t)!==null;u1("production");const z4=Yo&&A4(Se.env.FORCE_COLOR,["true","1","2"]);z4||!pd("--no-colors")&&!u1("no-color")&&(!Yo||Se.stdout.isTTY)&&(!Yo||pd("--color")||hd("COLORTERM")!==null||(hd("TERM")||"").includes("color"));const j4=typeof document<"u"?document:{};typeof DOMParser<"u"&&new DOMParser;const q4=t=>class{constructor(e){this._=e}destroy(){t(this._)}},V4=q4(clearTimeout),Rf=(t,e)=>new V4(setTimeout(e,t)),Ha=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&e.sv.get(t.id.client)>t.id.clock&&!$e.isDeleted(e.ds,t.id),U4=[{light:"#ecd44433",dark:"#ecd444"}],H4=(t,e,n)=>{if(!t.has(n)){if(t.size<e.length){const r=b4();t.forEach(o=>r.add(o)),e=e.filter(o=>!r.has(o))}t.set(n,N4(e))}return t.get(n)},W4=(t,{colors:e=U4,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:o=()=>{},mapping:i}={})=>{let s=!1;const a=new K4(t,i),l=new Ze({props:{editable:c=>{const u=tt.getState(c);return u.snapshot==null&&u.prevSnapshot==null}},key:tt,state:{init:(c,u)=>({type:t,doc:t.doc,binding:a,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:e,colorMapping:n,permanentUserData:r}),apply:(c,u)=>{const d=c.getMeta(tt);if(d!==void 0){u=Object.assign({},u);for(const f in d)u[f]=d[f]}return u.addToHistory=c.getMeta("addToHistory")!==!1,u.isChangeOrigin=d!==void 0&&!!d.isChangeOrigin,u.isUndoRedoOperation=d!==void 0&&!!d.isChangeOrigin&&!!d.isUndoRedoOperation,a.prosemirrorView!==null&&d!==void 0&&(d.snapshot!=null||d.prevSnapshot!=null)&&Rf(0,()=>{a.prosemirrorView!=null&&(d.restore==null?a._renderSnapshot(d.snapshot,d.prevSnapshot,u):(a._renderSnapshot(d.snapshot,d.snapshot,u),delete u.restore,delete u.snapshot,delete u.prevSnapshot,a.mux(()=>{a._prosemirrorChanged(a.prosemirrorView.state.doc)})))}),u}},view:c=>(a.initView(c),i==null&&a._forceRerender(),o(),{update:()=>{const u=l.getState(c.state);if(u.snapshot==null&&u.prevSnapshot==null&&(s||c.state.doc.content.findDiffStart(c.state.doc.type.createAndFill().content)!==null)){if(s=!0,u.addToHistory===!1&&!u.isChangeOrigin){const d=Ar.getState(c.state),f=d&&d.undoManager;f&&f.stopCapturing()}a.mux(()=>{u.doc.transact(d=>{d.meta.set("addToHistory",u.addToHistory),a._prosemirrorChanged(c.state.doc)},tt)})}},destroy:()=>{a.destroy()}})});return l},G4=(t,e,n)=>{if(e!==null&&e.anchor!==null&&e.head!==null)if(e.type==="all")t.setSelection(new Mn(t.doc));else{const r=as(n.doc,n.type,e.anchor,n.mapping),o=as(n.doc,n.type,e.head,n.mapping);r!==null&&o!==null&&(t=t.setSelection(Le.create(t.doc,r,o)))}},md=(t,e)=>({type:e.selection.jsonID,anchor:Ga(e.selection.anchor,t.type,t.mapping),head:Ga(e.selection.head,t.type,t.mapping)});let K4=class{constructor(e,n=new Map){this.type=e,this.prosemirrorView=null,this.mux=$4(),this.mapping=n,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&this.prosemirrorView!=null&&(this.beforeTransactionSelection=md(this,this.prosemirrorView.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta("addToHistory",!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(L4&&this._domSelectionInView===null&&(Rf(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){const e=this.prosemirrorView._root.getSelection();if(e==null||e.anchorNode==null)return!1;const n=this.prosemirrorView._root.createRange();n.setStart(e.anchorNode,e.anchorOffset),n.setEnd(e.focusNode,e.focusOffset),n.getClientRects().length===0&&n.startContainer&&n.collapsed&&n.selectNodeContents(n.startContainer);const r=n.getBoundingClientRect(),o=j4.documentElement;return r.bottom>=0&&r.right>=0&&r.left<=(window.innerWidth||o.clientWidth||0)&&r.top<=(window.innerHeight||o.clientHeight||0)}renderSnapshot(e,n){n||(n=$e.createSnapshot($e.createDeleteSet(),new Map)),this.prosemirrorView.dispatch(this._tr.setMeta(tt,{snapshot:e,prevSnapshot:n}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{const e=this.type.toArray().map(r=>Ui(r,this.prosemirrorView.state.schema,this.mapping)).filter(r=>r!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new ve(be.from(e),0,0));n.setMeta(tt,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(n)})}_forceRerender(){this.mapping.clear(),this.mux(()=>{const e=this.beforeTransactionSelection!==null?null:this.prosemirrorView.state.selection,n=this.type.toArray().map(o=>Ui(o,this.prosemirrorView.state.schema,this.mapping)).filter(o=>o!==null),r=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new ve(be.from(n),0,0));if(e){const o=eo(Ua(e.anchor,0),r.doc.content.size),i=eo(Ua(e.head,0),r.doc.content.size);r.setSelection(Le.create(r.doc,o,i))}this.prosemirrorView.dispatch(r.setMeta(tt,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,n,r){let o=this.doc;e||(e=$e.snapshot(this.doc)),(e instanceof Uint8Array||n instanceof Uint8Array)&&((!(e instanceof Uint8Array)||!(n instanceof Uint8Array))&&l1(),o=new $e.Doc({gc:!1}),$e.applyUpdateV2(o,n),n=$e.snapshot(o),$e.applyUpdateV2(o,e),e=$e.snapshot(o)),this.mapping.clear(),this.mux(()=>{o.transact(i=>{const s=r.permanentUserData;s&&s.dss.forEach(u=>{$e.iterateDeletedStructs(i,u,d=>{})});const a=(u,d)=>{const f=u==="added"?s.getUserByClientId(d.client):s.getUserByDeletedId(d);return{user:f,type:u,color:H4(r.colorMapping,r.colors,f)}},l=$e.typeListToArraySnapshot(this.type,new $e.Snapshot(n.ds,e.sv)).map(u=>!u._item.deleted||Ha(u._item,e)||Ha(u._item,n)?Ui(u,this.prosemirrorView.state.schema,new Map,e,n,a):null).filter(u=>u!==null),c=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new ve(be.from(l),0,0));this.prosemirrorView.dispatch(c.setMeta(tt,{isChangeOrigin:!0}))},tt)})}_typeChanged(e,n){if(this.prosemirrorView==null)return;const r=tt.getState(this.prosemirrorView.state);if(e.length===0||r.snapshot!=null||r.prevSnapshot!=null){this.renderSnapshot(r.snapshot,r.prevSnapshot);return}this.mux(()=>{const o=(a,l)=>this.mapping.delete(l);$e.iterateDeletedStructs(n,n.deleteSet,a=>{if(a.constructor===$e.Item){const l=a.content.type;l&&this.mapping.delete(l)}}),n.changed.forEach(o),n.changedParentTypes.forEach(o);const i=this.type.toArray().map(a=>d1(a,this.prosemirrorView.state.schema,this.mapping)).filter(a=>a!==null);let s=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new ve(be.from(i),0,0));G4(s,this.beforeTransactionSelection,this),s=s.setMeta(tt,{isChangeOrigin:!0,isUndoRedoOperation:n.origin instanceof $e.UndoManager}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&s.scrollIntoView(),this.prosemirrorView.dispatch(s)})}_prosemirrorChanged(e){this.doc.transact(()=>{yd(this.doc,this.type,e,this.mapping),this.beforeTransactionSelection=md(this,this.prosemirrorView.state)},tt)}initView(e){this.prosemirrorView!=null&&this.destroy(),this.prosemirrorView=e,this.doc.on("beforeAllTransactions",this.beforeAllTransactions),this.doc.on("afterAllTransactions",this.afterAllTransactions),this.type.observeDeep(this._observeFunction)}destroy(){this.prosemirrorView!=null&&(this.prosemirrorView=null,this.type.unobserveDeep(this._observeFunction),this.doc.off("beforeAllTransactions",this.beforeAllTransactions),this.doc.off("afterAllTransactions",this.afterAllTransactions))}};const d1=(t,e,n,r,o,i)=>{const s=n.get(t);if(s===void 0){if(t instanceof $e.XmlElement)return Ui(t,e,n,r,o,i);throw S4()}return s},Ui=(t,e,n,r,o,i)=>{const s=[],a=l=>{if(l.constructor===$e.XmlElement){const c=d1(l,e,n,r,o,i);c!==null&&s.push(c)}else{const c=l._item.right?.content.type;c instanceof $e.Text&&!c._item.deleted&&c._item.id.client===c.doc.clientID&&(l.applyDelta([{retain:l.length},...c.toDelta()]),c.doc.transact(d=>{c._item.delete(d)}));const u=X4(l,e,n,r,o,i);u!==null&&u.forEach(d=>{d!==null&&s.push(d)})}};r===void 0||o===void 0?t.toArray().forEach(a):$e.typeListToArraySnapshot(t,new $e.Snapshot(o.ds,r.sv)).forEach(a);try{const l=t.getAttributes(r);r!==void 0&&(Ha(t._item,r)?Ha(t._item,o)||(l.ychange=i?i("added",t._item.id):{type:"added"}):l.ychange=i?i("removed",t._item.id):{type:"removed"});const c=e.node(t.nodeName,l,s);return n.set(t,c),c}catch{return t.doc.transact(l=>{t._item.delete(l)},tt),n.delete(t),null}},X4=(t,e,n,r,o,i)=>{const s=[],a=t.toDelta(r,o,i);try{for(let l=0;l<a.length;l++){const c=a[l],u=[];for(const d in c.attributes)u.push(e.mark(d,c.attributes[d]));s.push(e.text(c.insert,u))}}catch{return t.doc.transact(l=>{t._item.delete(l)},tt),null}return s},J4=(t,e)=>{const n=new $e.XmlText,r=t.map(o=>({insert:o.text,attributes:p1(o.marks)}));return n.applyDelta(r),e.set(n,t),n},Y4=(t,e)=>{const n=new $e.XmlElement(t.type.name);for(const r in t.attrs){const o=t.attrs[r];o!==null&&r!=="ychange"&&n.setAttribute(r,o)}return n.insert(0,Al(t).map(r=>gd(r,e))),e.set(n,t),n},gd=(t,e)=>t instanceof Array?J4(t,e):Y4(t,e),Vg=t=>typeof t=="object"&&t!==null,Lf=(t,e)=>{const n=Object.keys(t).filter(o=>t[o]!==null);let r=n.length===Object.keys(e).filter(o=>e[o]!==null).length;for(let o=0;o<n.length&&r;o++){const i=n[o],s=t[i],a=e[i];r=i==="ychange"||s===a||Vg(s)&&Vg(a)&&Lf(s,a)}return r},Al=t=>{const e=t.content.content,n=[];for(let r=0;r<e.length;r++){const o=e[r];if(o.isText){const i=[];for(let s=e[r];r<e.length&&s.isText;s=e[++r])i.push(s);r--,n.push(i)}else n.push(o)}return n},f1=(t,e)=>{const n=t.toDelta();return n.length===e.length&&n.every((r,o)=>r.insert===e[o].text&&E4(r.attributes||{}).length===e[o].marks.length&&e[o].marks.every(i=>Lf(r.attributes[i.type.name]||{},i.attrs)))},ss=(t,e)=>{if(t instanceof $e.XmlElement&&!(e instanceof Array)&&bd(t,e)){const n=Al(e);return t._length===n.length&&Lf(t.getAttributes(),e.attrs)&&t.toArray().every((r,o)=>ss(r,n[o]))}return t instanceof $e.XmlText&&e instanceof Array&&f1(t,e)},Wa=(t,e)=>t===e||t instanceof Array&&e instanceof Array&&t.length===e.length&&t.every((n,r)=>e[r]===n),Ug=(t,e,n)=>{const r=t.toArray(),o=Al(e),i=o.length,s=r.length,a=eo(s,i);let l=0,c=0,u=!1;for(;l<a;l++){const d=r[l],f=o[l];if(Wa(n.get(d),f))u=!0;else if(!ss(d,f))break}for(;l+c<a;c++){const d=r[s-c-1],f=o[i-c-1];if(Wa(n.get(d),f))u=!0;else if(!ss(d,f))break}return{equalityFactor:l+c,foundMappedChild:u}},Z4=t=>{let e="",n=t._start;const r={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof $e.ContentString?e+=n.content.str:n.content instanceof $e.ContentFormat&&(r[n.content.key]=null)),n=n.right;return{str:e,nAttrs:r}},Q4=(t,e,n)=>{n.set(t,e);const{nAttrs:r,str:o}=Z4(t),i=e.map(c=>({insert:c.text,attributes:Object.assign({},r,p1(c.marks))})),{insert:s,remove:a,index:l}=M4(o,i.map(c=>c.insert).join(""));t.delete(l,a),t.insert(l,s),t.applyDelta(i.map(c=>({retain:c.insert.length,attributes:c.attributes})))},p1=t=>{const e={};return t.forEach(n=>{n.type.name!=="ychange"&&(e[n.type.name]=n.attrs)}),e},yd=(t,e,n,r)=>{if(e instanceof $e.XmlElement&&e.nodeName!==n.type.name)throw new Error("node name mismatch!");if(r.set(e,n),e instanceof $e.XmlElement){const d=e.getAttributes(),f=n.attrs;for(const p in f)f[p]!==null?d[p]!==f[p]&&p!=="ychange"&&e.setAttribute(p,f[p]):e.removeAttribute(p);for(const p in d)f[p]===void 0&&e.removeAttribute(p)}const o=Al(n),i=o.length,s=e.toArray(),a=s.length,l=eo(i,a);let c=0,u=0;for(;c<l;c++){const d=s[c],f=o[c];if(!Wa(r.get(d),f))if(ss(d,f))r.set(d,f);else break}for(;u+c+1<l;u++){const d=s[a-u-1],f=o[i-u-1];if(!Wa(r.get(d),f))if(ss(d,f))r.set(d,f);else break}t.transact(()=>{for(;a-c-u>0&&i-c-u>0;){const f=s[c],p=o[c],h=s[a-u-1],m=o[i-u-1];if(f instanceof $e.XmlText&&p instanceof Array)f1(f,p)||Q4(f,p,r),c+=1;else{let y=f instanceof $e.XmlElement&&bd(f,p),g=h instanceof $e.XmlElement&&bd(h,m);if(y&&g){const x=Ug(f,p,r),k=Ug(h,m,r);x.foundMappedChild&&!k.foundMappedChild?g=!1:!x.foundMappedChild&&k.foundMappedChild||x.equalityFactor<k.equalityFactor?y=!1:g=!1}y?(yd(t,f,p,r),c+=1):g?(yd(t,h,m,r),u+=1):(r.delete(e.get(c)),e.delete(c,1),e.insert(c,[gd(p,r)]),c+=1)}}const d=a-c-u;if(a===1&&i===0&&s[0]instanceof $e.XmlText?(r.delete(s[0]),s[0].delete(0,s[0].length)):d>0&&(e.slice(c,c+d).forEach(f=>r.delete(f)),e.delete(c,d)),c+u<i){const f=[];for(let p=c;p<i-u;p++)f.push(gd(o[p],r));e.insert(c,f)}},tt)},bd=(t,e)=>!(e instanceof Array)&&t.nodeName===e.type.name;let Hi=null;const e6=()=>{const t=Hi;Hi=null,t.forEach((e,n)=>{const r=n.state.tr,o=tt.getState(n.state);o&&o.binding&&!o.binding.isDestroyed&&(e.forEach((i,s)=>{r.setMeta(s,i)}),n.dispatch(r))})},t6=(t,e,n)=>{Hi||(Hi=new Map,Rf(0,e6)),C4(Hi,t,wa).set(e,n)},Ga=(t,e,n)=>{if(t===0)return $e.createRelativePositionFromTypeIndex(e,0,-1);let r=e._first===null?null:e._first.content.type;for(;r!==null&&e!==r;){if(r instanceof $e.XmlText){if(r._length>=t)return $e.createRelativePositionFromTypeIndex(r,t,-1);if(t-=r._length,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{do r=r._item===null?null:r._item.parent,t--;while(r!==e&&r!==null&&r._item!==null&&r._item.next===null);r!==null&&r!==e&&(r=r._item===null?null:r._item.next.content.type)}}else{const o=(n.get(r)||{nodeSize:0}).nodeSize;if(r._first!==null&&t<o)r=r._first.content.type,t--;else{if(t===1&&r._length===0&&o>1)return new $e.RelativePosition(r._item===null?null:r._item.id,r._item===null?$e.findRootTypeKey(r):null,null);if(t-=o,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{if(t===0)return r=r._item===null?r:r._item.parent,new $e.RelativePosition(r._item===null?null:r._item.id,r._item===null?$e.findRootTypeKey(r):null,null);do r=r._item.parent,t--;while(r!==e&&r._item.next===null);r!==e&&(r=r._item.next.content.type)}}}if(r===null)throw l1();if(t===0&&r.constructor!==$e.XmlText&&r!==e)return n6(r._item.parent,r._item)}return $e.createRelativePositionFromTypeIndex(e,e._length,-1)},n6=(t,e)=>{let n=null,r=null;return t._item===null?r=$e.findRootTypeKey(t):n=$e.createID(t._item.id.client,t._item.id.clock),new $e.RelativePosition(n,r,e.id)},as=(t,e,n,r)=>{const o=$e.createAbsolutePositionFromRelativePosition(n,t);if(o===null||o.type!==e&&!$e.isParentOf(e,o.type._item))return null;let i=o.type,s=0;if(i.constructor===$e.XmlText)s=o.index;else if(i._item===null||!i._item.deleted){let a=i._first,l=0;for(;l<i._length&&l<o.index&&a!==null;){if(!a.deleted){const c=a.content.type;l++,c instanceof $e.XmlText?s+=c._length:s+=r.get(c).nodeSize}a=a.right}s+=1}for(;i!==e&&i._item!==null;){const a=i._item.parent;if(a._item===null||!a._item.deleted){s+=1;let l=a._first;for(;l!==null;){const c=l.content.type;if(c===i)break;l.deleted||(c instanceof $e.XmlText?s+=c._length:s+=r.get(c).nodeSize),l=l.right}}i=a}return s-1},r6=(t,e)=>{const n=t.toArray().map(r=>Ui(r,e,new Map)).filter(r=>r!==null);return be.fromArray(n)},o6=(t,e)=>e.topNodeType.create(null,r6(t,e)),i6=(t,e,n)=>t!==e,s6=t=>{const e=document.createElement("span");e.classList.add("ProseMirror-yjs-cursor"),e.setAttribute("style",`border-color: ${t.color}`);const n=document.createElement("div");n.setAttribute("style",`background-color: ${t.color}`),n.insertBefore(document.createTextNode(t.name),null);const r=document.createTextNode("⁠"),o=document.createTextNode("⁠");return e.insertBefore(r,null),e.insertBefore(n,null),e.insertBefore(o,null),e},a6=t=>({style:`background-color: ${t.color}70`,class:"ProseMirror-yjs-selection"}),l6=/^#[0-9a-fA-F]{6}$/,Hg=(t,e,n,r,o)=>{const i=tt.getState(t),s=i.doc,a=[];return i.snapshot!=null||i.prevSnapshot!=null||i.binding.mapping.size===0?qe.create(t.doc,[]):(e.getStates().forEach((l,c)=>{if(n(s.clientID,c,l)&&l.cursor!=null){const u=l.user||{};u.color==null?u.color="#ffa500":l6.test(u.color)||console.warn("A user uses an unsupported color format",u),u.name==null&&(u.name=`User: ${c}`);let d=as(s,i.type,$e.createRelativePositionFromJSON(l.cursor.anchor),i.binding.mapping),f=as(s,i.type,$e.createRelativePositionFromJSON(l.cursor.head),i.binding.mapping);if(d!==null&&f!==null){const p=Ua(t.doc.content.size-1,0);d=eo(d,p),f=eo(f,p),a.push(Pe.widget(f,()=>r(u,c),{key:c+"",side:10}));const h=eo(d,f),m=Ua(d,f);a.push(Pe.inline(h,m,o(u,c),{inclusiveEnd:!0,inclusiveStart:!1}))}}}),qe.create(t.doc,a))},c6=(t,{awarenessStateFilter:e=i6,cursorBuilder:n=s6,selectionBuilder:r=a6,getSelection:o=s=>s.selection}={},i="cursor")=>new Ze({key:qs,state:{init(s,a){return Hg(a,t,e,n,r)},apply(s,a,l,c){const u=tt.getState(c),d=s.getMeta(qs);return u&&u.isChangeOrigin||d&&d.awarenessUpdated?Hg(c,t,e,n,r):a.map(s.mapping,s.doc)}},props:{decorations:s=>qs.getState(s)},view:s=>{const a=()=>{s.docView&&t6(s,qs,{awarenessUpdated:!0})},l=()=>{const c=tt.getState(s.state),u=t.getLocalState()||{};if(s.hasFocus()){const d=o(s.state),f=Ga(d.anchor,c.type,c.binding.mapping),p=Ga(d.head,c.type,c.binding.mapping);(u.cursor==null||!$e.compareRelativePositions($e.createRelativePositionFromJSON(u.cursor.anchor),f)||!$e.compareRelativePositions($e.createRelativePositionFromJSON(u.cursor.head),p))&&t.setLocalStateField(i,{anchor:f,head:p})}else u.cursor!=null&&as(c.doc,c.type,$e.createRelativePositionFromJSON(u.cursor.anchor),c.binding.mapping)!==null&&t.setLocalStateField(i,null)};return t.on("change",a),s.dom.addEventListener("focusin",l),s.dom.addEventListener("focusout",l),{update:l,destroy:()=>{s.dom.removeEventListener("focusin",l),s.dom.removeEventListener("focusout",l),t.off("change",a),t.setLocalStateField(i,null)}}}}),u6=t=>{const e=Ar.getState(t).undoManager;if(e!=null)return e.undo(),!0},d6=t=>{const e=Ar.getState(t).undoManager;if(e!=null)return e.redo(),!0},f6=new Set(["paragraph"]),p6=(t,e)=>!(t instanceof Bo.Item)||!(t.content instanceof Bo.ContentType)||!(t.content.type instanceof Bo.Text||t.content.type instanceof Bo.XmlElement&&e.has(t.content.type.nodeName))||t.content.type._length===0,h6=({protectedNodes:t=f6,trackedOrigins:e=[],undoManager:n=null}={})=>new Ze({key:Ar,state:{init:(r,o)=>{const i=tt.getState(o),s=n||new Bo.UndoManager(i.type,{trackedOrigins:new Set([tt].concat(e)),deleteFilter:a=>p6(a,t),captureTransaction:a=>a.meta.get("addToHistory")!==!1});return{undoManager:s,prevSel:null,hasUndoOps:s.undoStack.length>0,hasRedoOps:s.redoStack.length>0}},apply:(r,o,i,s)=>{const a=tt.getState(s).binding,l=o.undoManager,c=l.undoStack.length>0,u=l.redoStack.length>0;return a?{undoManager:l,prevSel:md(a,i),hasUndoOps:c,hasRedoOps:u}:c!==o.hasUndoOps||u!==o.hasRedoOps?Object.assign({},o,{hasUndoOps:l.undoStack.length>0,hasRedoOps:l.redoStack.length>0}):o}},view:r=>{const o=tt.getState(r.state),i=Ar.getState(r.state).undoManager;return i.on("stack-item-added",({stackItem:s})=>{const a=o.binding;a&&s.meta.set(a,Ar.getState(r.state).prevSel)}),i.on("stack-item-popped",({stackItem:s})=>{const a=o.binding;a&&(a.beforeTransactionSelection=s.meta.get(a)||a.beforeTransactionSelection)}),{destroy:()=>{i.destroy()}}}});var Un;let m6=class{constructor(){Cr(this,Un,new Map)}on(e,n){const r=Kn(this,Un).get(e);r?r.push(n):Kn(this,Un).set(e,[n])}emit(e,...n){const r=Kn(this,Un).get(e);if(r)for(const o of r)o.apply(this,n)}off(e,n){const r=Kn(this,Un).get(e);r&&(n?Kn(this,Un).set(e,r.filter(o=>o!==n)):Kn(this,Un).delete(e))}removeAllListeners(){mv(this,Un,new Map)}};Un=new WeakMap;var Tr={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:"'"},Ka={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},g6=typeof navigator<"u"&&/Mac/.test(navigator.platform),y6=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var At=0;At<10;At++)Tr[48+At]=Tr[96+At]=String(At);for(var At=1;At<=24;At++)Tr[At+111]="F"+At;for(var At=65;At<=90;At++)Tr[At]=String.fromCharCode(At+32),Ka[At]=String.fromCharCode(At);for(var Qc in Tr)Ka.hasOwnProperty(Qc)||(Ka[Qc]=Tr[Qc]);function b6(t){var e=g6&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||y6&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Ka:Tr)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const w6=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function v6(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,i,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))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))w6?s=!0:o=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),s&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function x6(t){let e=Object.create(null);for(let n in t)e[v6(n)]=t[n];return e}function eu(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function k6(t){return new Ze({props:{handleKeyDown:Pf(t)}})}function Pf(t){let e=x6(t);return function(n,r){let o=b6(r),i,s=e[eu(o,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let a=e[eu(o,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||o.charCodeAt(0)>127)&&(i=Tr[r.keyCode])&&i!=o){let a=e[eu(i,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}function ht(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}' in schema.`);return e.nodes[t]}return t}function ir(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}' in schema.`);return e.marks[t]}return t}function Os(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}var Xa,h1,m1;class Me{static getAttributesFromExtensions(e){const n=[],r={default:null,rendered:!0,renderDOM:null,parseDOM:null,keepOnSplit:!0},o=Ie(this,Xa,h1).call(this,e,r),i=Ie(this,Xa,m1).call(this,e,r);return n.push(...o,...i),n}static insertExtensionAttrsToParseRule(e,n){return"style"in e?e:{...e,getAttrs:r=>{const o=e.getAttrs?e.getAttrs(r):e.attrs;if(o===!1)return!1;const i=a=>typeof a!="string"?a:a.match(/^[+-]?(\d*\.)?\d+$/)?Number(a):a==="true"?!0:a==="false"?!1:a;let s={};for(const a of n){const l=a.attribute.parseDOM?a.attribute.parseDOM(r):i(r.getAttribute(a.name));l!=null&&(s={...s,[a.name]:l})}return{...o,...s}}}}static getAttributesToRender(e,n){const r=n.filter(i=>i.attribute.rendered).map(i=>i.attribute.renderDOM?i.attribute.renderDOM(e.attrs)||{}:{[i.name]:e.attrs[i.name]});let o={};for(const i of r)o=this.mergeAttributes(o,i);return o}static mergeAttributes(...e){const n=e.filter(o=>!!o);let r={};for(const o of n){const i={...r};for(const[s,a]of Object.entries(o)){if(!i[s]){i[s]=a;continue}if(s==="class"){const l=a?a.split(" "):[],c=i[s]?i[s].split(" "):[],u=l.filter(d=>!c.includes(d));i[s]=[...c,...u].join(" ")}else s==="style"?i[s]=[i[s],a].join("; "):i[s]=a}r=i}return r}static getSplittedAttributes(e,n,r){const o=Object.entries(r).filter(([i])=>{const s=e.find(a=>a.type===n&&a.name===i);return s?s.attribute.keepOnSplit:!1});return Object.fromEntries(o)}static getMarkAttributes(e,n){const r=ir(n,e.schema),o=Es(e).find(i=>i.type.name===r.name);return o?{...o.attrs}:{}}static getNodeAttributes(e,n){const r=ht(n,e.schema),{from:o,to:i}=e.selection,s=[];e.doc.nodesBetween(o,i,l=>{s.push(l)});const a=s.reverse().find(l=>l.type.name===r.name);return a?{...a.attrs}:{}}static getAttributes(e,n){const r=Os(typeof n=="string"?n:n.name,e.schema);return r==="node"?this.getNodeAttributes(e,n):r==="mark"?this.getMarkAttributes(e,n):{}}}Xa=new WeakSet,h1=function(t,e){const n=[],r=o=>{for(const i of o.types){const s=Object.entries(o.attributes);for(const[a,l]of s)n.push({type:i,name:a,attribute:{...e,...l}})}};for(const o of t){const i={name:o.name,options:o.options,storage:o.storage},s=De(o,"addGlobalAttributes",i);if(!s)continue;const a=s();for(const l of a)r(l)}return n},m1=function(t,e){const n=[],r=t.filter(o=>o.type==="node"||o.type==="mark");for(const o of r){const i={name:o.name,options:o.options,storage:o.storage},s=De(o,"addAttributes",i);if(!s)continue;const a=s();for(const[l,c]of Object.entries(a)){const u={...e,...c};typeof u.default=="function"&&(u.default=u.default()),n.push({type:o.name,name:l,attribute:u})}}return n},Cr(Me,Xa);function S6(t={}){return Object.keys(t).length===0&&t.constructor===Object}function wd(t){const e=Object.entries(t).filter(([n,r])=>n==="attrs"&&S6(r)?!1:r!=null);return Object.fromEntries(e)}var Ja,g1,y1;const b1=class vd{static createSchemaByExtensions(e,n){var r,o;const i=e.filter(d=>d.type==="node"),s=e.filter(d=>d.type==="mark"),a=i.find(d=>De(d,"topNode"))?.name,l=Me.getAttributesFromExtensions(e),c=Ie(r=vd,Ja,g1).call(r,i,l,n),u=Ie(o=vd,Ja,y1).call(o,s,l,n);return new pw({topNode:a,nodes:c,marks:u})}};Ja=new WeakSet,g1=function(t,e,n){const r=t.map(o=>{const i=e.filter(p=>p.type===o.name),s={name:o.name,options:o.options,storage:o.storage,editor:n},a=Object.fromEntries(i.map(p=>[p.name,{default:p?.attribute?.default}])),l=t.reduce((p,h)=>{const m=De(h,"extendNodeSchema",s);return{...p,...m?m(o):{}}},{}),c=wd({content:He(De(o,"content",s)),group:He(De(o,"group",s)),marks:He(De(o,"marks",s)),inline:He(De(o,"inline",s)),atom:He(De(o,"atom",s)),selectable:He(De(o,"selectable",s)),draggable:He(De(o,"draggable",s)),code:He(De(o,"code",s)),defining:He(De(o,"defining",s)),isolating:He(De(o,"isolating",s)),attrs:a,...l}),u=He(De(o,"parseDOM",s));u&&(c.parseDOM=u.map(p=>Me.insertExtensionAttrsToParseRule(p,i)));const d=De(o,"renderDOM",s);d&&(c.toDOM=p=>d({node:p,htmlAttributes:Me.getAttributesToRender(p,i)}));const f=De(o,"renderText",s);return f&&(c.toText=f),[o.name,c]});return Object.fromEntries(r)},y1=function(t,e,n){const r=t.map(o=>{const i=e.filter(d=>d.type===o.name),s={name:o.name,options:o.options,storage:o.storage,editor:n},a=Object.fromEntries(i.map(d=>[d.name,{default:d?.attribute?.default}])),l=wd({group:He(De(o,"group",s)),inclusive:He(De(o,"inclusive",s)),excludes:He(De(o,"excludes",s)),spanning:He(De(o,"spanning",s)),code:He(De(o,"code",s)),attrs:a}),c=He(De(o,"parseDOM",s));c&&(l.parseDOM=c.map(d=>Me.insertExtensionAttrsToParseRule(d,i)));const u=De(o,"renderDOM",s);return u&&(l.toDOM=d=>u({mark:d,htmlAttributes:Me.getAttributesToRender(d,i)})),[o.name,l]});return Object.fromEntries(r)},Cr(b1,Ja);let C6=b1;function ls(t,e){return e.nodes[t]||e.marks[t]||null}function E6(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function zf(t,e){let{selection:n,doc:r,storedMarks:o}=t;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 r},get tr(){return n=t.selection,r=t.doc,o=t.storedMarks,t}}}let w1=class v1{constructor(e){Fe(this,"editor"),Fe(this,"rawCommands"),this.editor=e.editor,this.rawCommands=this.editor.extensionService.commands}static create(...e){return new v1(...e)}get state(){return this.editor.state}get commands(){const{editor:e,state:n}=this,{view:r}=e,{tr:o}=n,i=this.createProps(o),s=Object.entries(this.rawCommands).map(([a,l])=>[a,(...c)=>{const u=l(...c)(i);return o.getMeta("preventDispatch")||r.dispatch(o),u}]);return Object.fromEntries(s)}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{editor:r,state:o,rawCommands:i}=this,{view:s}=r,a=[],l=!!e,c=e||o.tr,u=()=>(!l&&n&&!c.getMeta("preventDispatch")&&s.dispatch(c),a.every(p=>p===!0)),d=Object.entries(i).map(([p,h])=>[p,(...m)=>{const y=this.createProps(c,n),g=h(...m)(y);return a.push(g),f}]),f={...Object.fromEntries(d),run:u};return f}createCan(e){const{rawCommands:n,state:r}=this,o=!1,i=e||r.tr,s=this.createProps(i,o);return{...Object.fromEntries(Object.entries(n).map(([a,l])=>[a,(...c)=>l(...c)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,o)}}createProps(e,n=!0){const{editor:r,state:o,rawCommands:i}=this,{view:s}=r,a={tr:e,editor:r,view:s,state:zf(e,o),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(i).map(([l,c])=>[l,(...u)=>c(...u)(a)]))}};return a}};function A6(t,e){const n=si.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}const $6=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,i,s,a)=>{const l=o.type.spec.toText?.({node:o,pos:i,parent:s,index:a})||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?l:l.slice(0,Math.max(0,r-i))}),n};class T6{constructor(e){Fe(this,"match"),Fe(this,"handler"),this.match=e.match,this.handler=e.handler}}const O6=(t,e)=>{if(tv(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[super-editor warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r},tu=t=>{const{editor:e,from:n,to:r,text:o,rules:i,plugin:s}=t,{view:a}=e;if(a.composing)return!1;const l=a.state.doc.resolve(n);if(l.parent.type.spec.code||(l.nodeBefore||l.nodeAfter)?.marks.find(d=>d.type.spec.code))return!1;let c=!1;const u=$6(l)+o;return i.forEach(d=>{if(c)return;const f=O6(u,d.match);if(!f)return;const p=a.state.tr,h=zf(p,a.state),m={from:n-(f[0].length-o.length),to:r},{commands:y,chain:g,can:x}=new w1({editor:e,state:h});d.handler({state:h,range:m,match:f,commands:y,chain:g,can:x})===null||!p.steps.length||(p.setMeta(s,{transform:p,from:n,to:r,text:o}),a.dispatch(p),c=!0)}),c},D6=({editor:t,rules:e})=>{const n=new Ze({key:new et("inputRulesPlugin"),state:{init(){return null},apply(r,o,i){const s=r.getMeta(n);if(s)return s;const a=r.getMeta("applyInputRules");return a&&setTimeout(()=>{let{text:l}=a;typeof l!="string"&&(l=A6(be.from(l),i.schema));const{from:c}=a,u=c+l.length;tu({editor:t,from:c,to:u,text:l,rules:e,plugin:n})}),r.selectionSet||r.docChanged?null:o}},props:{handleTextInput(r,o,i,s){return tu({editor:t,from:o,to:i,text:s,rules:e,plugin:n})},handleKeyDown(r,o){if(o.key!=="Enter")return!1;const{$cursor:i}=r.state.selection;return i?tu({editor:t,from:i.pos,to:i.pos,text:`
36
- `,rules:e,plugin:n}):!1}},isInputRules:!0});return n};var Ya,x1,Wg;const M6=class Ni{constructor(e,n,r){Cr(this,Ya),Fe(this,"editor"),Fe(this,"schema"),Fe(this,"extensions"),Fe(this,"externalExtensions",[]),Fe(this,"splittableMarks",[]),this.editor=r,this.externalExtensions=n||[],this.extensions=Ni.getResolvedExtensions([...e,...this.externalExtensions]),this.schema=C6.createSchemaByExtensions(this.extensions,r),Ie(this,Ya,x1).call(this)}static create(...e){return new Ni(...e)}static getResolvedExtensions(e){return Ni.sortByPriority(e)}static sortByPriority(e){return e.sort((n,r)=>{const o=De(n,"priority")||100,i=De(r,"priority")||100;return o>i?-1:o<i?1:0})}get attributes(){return Me.getAttributesFromExtensions(this.extensions)}get commands(){let e={};for(const n of this.extensions){const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:ls(n.name,this.schema)},o=De(n,"addCommands",r);o&&(e={...e,...o()})}return e}get plugins(){const e=this.editor,n=Ni.sortByPriority([...this.extensions].reverse()),r=[],o=n.map(i=>{const s={name:i.name,options:i.options,storage:i.storage,editor:e,type:ls(i.name,this.schema)},a=[],l=De(i,"addShortcuts",s);let c={};if(l){const f=Object.entries(l()).map(([p,h])=>[p,(...m)=>h({editor:e,keymapArgs:m})]);c={...Object.fromEntries(f)}}a.push(k6(c));const u=De(i,"addInputRules",s);E6(i,e.options.enableInputRules)&&u&&r.push(...u());const d=De(i,"addPmPlugins",s);if(d){const f=d();a.push(...f)}return a}).flat();return[D6({editor:e,rules:r}),...o]}get nodeViews(){const{editor:e}=this,n=this.extensions.filter(r=>r.type==="node").filter(r=>!!De(r,"addNodeView")).map(r=>{const o=this.attributes.filter(l=>l.type===r.name),i={name:r.name,options:r.options,storage:r.storage,editor:e,type:ht(r.name,this.schema)},s=De(r,"addNodeView",i);if(!s)return[];const a=(l,c,u,d)=>{const f=Me.getAttributesToRender(l,o);return s()({editor:e,node:l,getPos:u,decorations:d,htmlAttributes:f,extension:r})};return[r.name,a]});return Object.fromEntries(n)}};Ya=new WeakSet,x1=function(){for(const t of this.extensions){this.editor.extensionStorage[t.name]=t.storage;const e={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:ls(t.name,this.schema)};t.type==="mark"&&(He(De(t,"keepOnSplit",e))??!0)&&this.splittableMarks.push(t.name),Ie(this,Ya,Wg).call(this,t)}},Wg=function(t){const e={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:ls(t.name,this.schema)},n=De(t,"onBeforeCreate",e),r=De(t,"onCreate",e),o=De(t,"onUpdate",e),i=De(t,"onSelectionUpdate",e),s=De(t,"onTransaction",e),a=De(t,"onFocus",e),l=De(t,"onBlur",e),c=De(t,"onDestroy",e);n&&this.editor.on("beforeCreate",n),r&&this.editor.on("create",r),o&&this.editor.on("update",o),i&&this.editor.on("selectionUpdate",i),s&&this.editor.on("transaction",s),a&&this.editor.on("focus",a),l&&this.editor.on("blur",l),c&&this.editor.on("destroy",c)};let _6=M6;const N6=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1},I6=t=>e=>t(e),F6=()=>({tr:t})=>(t.insertText(" ",t.selection.from,t.selection.to),!0),B6=()=>({tr:t,state:e})=>{let n=t.selection.from;const r=e.schema.nodes.tab.create();return t.insert(n,r),!0},R6=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),jf=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function L6(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const k1=(t,e,n)=>{let r=L6(t,n);if(!r)return!1;let o=C1(r);if(!o){let s=r.blockRange(),a=s&&Cs(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(M1(t,o,e,-1))return!0;if(r.parent.content.size==0&&(Zo(i,"end")||Ne.isSelectable(i)))for(let s=r.depth;;s--){let a=Sf(t.doc,r.before(s),r.after(s),ve.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(Zo(i,"end")?Re.findFrom(l.doc.resolve(l.mapping.map(o.pos,-1)),-1):Ne.create(l.doc,o.pos-i.nodeSize)),e(l.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return i.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0):!1};function Zo(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const S1=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=C1(r)}let s=i&&i.nodeBefore;return!s||!Ne.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Ne.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function C1(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 P6(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const E1=(t,e,n)=>{let r=P6(t,n);if(!r)return!1;let o=$1(r);if(!o)return!1;let i=o.nodeAfter;if(M1(t,o,e,1))return!0;if(r.parent.content.size==0&&(Zo(i,"start")||Ne.isSelectable(i))){let s=Sf(t.doc,r.before(),r.after(),ve.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(Zo(i,"start")?Re.findFrom(a.doc.resolve(a.mapping.map(o.pos)),1):Ne.create(a.doc,a.mapping.map(o.pos))),e(a.scrollIntoView())}return!0}}return i.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0):!1},A1=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=$1(r)}let s=i&&i.nodeAfter;return!s||!Ne.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Ne.create(t.doc,i.pos)).scrollIntoView()),!0)};function $1(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const z6=(t,e)=>{let n=t.selection,r=n instanceof Ne,o;if(r){if(n.node.isTextblock||!_r(t.doc,n.from))return!1;o=n.from}else if(o=Aw(t.doc,n.from,-1),o==null)return!1;if(e){let i=t.tr.join(o);r&&i.setSelection(Ne.create(i.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},j6=(t,e)=>{let n=t.selection,r;if(n instanceof Ne){if(n.node.isTextblock||!_r(t.doc,n.to))return!1;r=n.to}else if(r=Aw(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},T1=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
37
- `).scrollIntoView()),!0)};function qf(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const q6=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=qf(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(Re.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},O1=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof Mn||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=qf(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,a=t.tr.insert(s,i.createAndFill());a.setSelection(Le.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},D1=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(Zn(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Cs(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function V6(t){return(e,n)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof Ne&&e.selection.node.isBlock)return!r.parentOffset||!Zn(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let i=[],s,a,l=!1,c=!1;for(let p=r.depth;;p--)if(r.node(p).isBlock){l=r.end(p)==r.pos+(r.depth-p),c=r.start(p)==r.pos-(r.depth-p),a=qf(r.node(p-1).contentMatchAt(r.indexAfter(p-1))),i.unshift(l&&a?{type:a}:null),s=p;break}else{if(p==1)return!1;i.unshift(null)}let u=e.tr;(e.selection instanceof Le||e.selection instanceof Mn)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=Zn(u.doc,d,i.length,i);if(f||(i[0]=a?{type:a}:null,f=Zn(u.doc,d,i.length,i)),u.split(d,i.length,i),!l&&c&&r.node(s).type!=a){let p=u.mapping.map(r.before(s)),h=u.doc.resolve(p);a&&r.node(s-1).canReplaceWith(h.index(),h.index()+1,a)&&u.setNodeMarkup(u.mapping.map(r.before(s)),a)}return n&&n(u.scrollIntoView()),!0}}const U6=V6(),H6=(t,e)=>(e&&e(t.tr.setSelection(new Mn(t.doc))),!0);function W6(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(o.isTextblock||_r(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function M1(t,e,n,r){let o=e.nodeBefore,i=e.nodeAfter,s,a,l=o.type.spec.isolating||i.type.spec.isolating;if(!l&&W6(t,e,n))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(a=o.contentMatchAt(o.childCount)).findWrapping(i.type))&&a.matchType(s[0]||i.type).validEnd){if(n){let p=e.pos+i.nodeSize,h=be.empty;for(let g=s.length-1;g>=0;g--)h=be.from(s[g].create(null,h));h=be.from(o.copy(h));let m=t.tr.step(new Jt(e.pos-1,p,e.pos,p,new ve(h,1,0),s.length,!0)),y=m.doc.resolve(p+2*s.length);y.nodeAfter&&y.nodeAfter.type==o.type&&_r(m.doc,y.pos)&&m.join(y.pos),n(m.scrollIntoView())}return!0}let u=i.type.spec.isolating||r>0&&l?null:Re.findFrom(e,1),d=u&&u.$from.blockRange(u.$to),f=d&&Cs(d);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(d,f).scrollIntoView()),!0;if(c&&Zo(i,"start",!0)&&Zo(o,"end")){let p=o,h=[];for(;h.push(p),!p.isTextblock;)p=p.lastChild;let m=i,y=1;for(;!m.isTextblock;m=m.firstChild)y++;if(p.canReplace(p.childCount,p.childCount,m.content)){if(n){let g=be.empty;for(let k=h.length-1;k>=0;k--)g=be.from(h[k].copy(g));let x=t.tr.step(new Jt(e.pos-h.length,e.pos+i.nodeSize,e.pos+y,e.pos+i.nodeSize-y,new ve(g,h.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function _1(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(n&&n(e.tr.setSelection(Le.create(e.doc,t<0?o.start(i):o.end(i)))),!0):!1}}const G6=_1(-1),K6=_1(1);function Gg(t,e=null){return function(n,r){let o=!1;for(let i=0;i<n.selection.ranges.length&&!o;i++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[i];n.doc.nodesBetween(s,a,(l,c)=>{if(o)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)o=!0;else{let u=n.doc.resolve(c),d=u.index();o=u.parent.canReplaceWith(d,d+1,t)}})}if(!o)return!1;if(r){let i=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];i.setBlockType(a,l,t,e)}r(i.scrollIntoView())}return!0}}function Vf(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}Vf(jf,k1,S1);Vf(jf,E1,A1);Vf(T1,O1,D1,U6);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function N1(t){for(let e=0;e<t.edgeCount;e++){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Kg=(t,e)=>{const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(o=>e?.includes(o.type.name));t.tr.ensureMarks(r)}},X6=({keepMarks:t=!0}={})=>e=>{const{tr:n,state:r,dispatch:o,editor:i}=e,{selection:s,doc:a}=n,{$from:l,$to:c}=s,u=i.extensionService.attributes,d=Me.getSplittedAttributes(u,l.node().type.name,l.node().attrs);if(s instanceof Ne&&s.node.isBlock)return!l.parentOffset||!Zn(a,l.pos)?!1:(o&&(t&&Kg(r,i.extensionService.splittableMarks),n.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;if(o){const f=c.parentOffset===c.parent.content.size;s instanceof Le&&n.deleteSelection();const p=l.depth===0?null:N1(l.node(-1).contentMatchAt(l.indexAfter(-1)));let h=f&&p?[{type:p,attrs:d}]:void 0,m=Zn(n.doc,n.mapping.map(l.pos),1,h);if(!h&&!m&&Zn(n.doc,n.mapping.map(l.pos),1,p?[{type:p}]:void 0)&&(m=!0,h=p?[{type:p,attrs:d}]:void 0),m&&(n.split(n.mapping.map(l.pos),1,h),p&&!f&&!l.parentOffset&&l.parent.type!==p)){const y=n.mapping.map(l.before()),g=n.doc.resolve(y);l.node(-1).canReplaceWith(g.index(),g.index()+1,p)&&n.setNodeMarkup(n.mapping.map(l.before()),p)}t&&Kg(r,i.extensionService.splittableMarks),n.scrollIntoView()}return!0},J6=()=>({state:t,dispatch:e})=>D1(t,e),Y6=()=>({state:t,dispatch:e})=>O1(t,e),Z6=()=>({state:t,dispatch:e})=>T1(t,e),Q6=()=>({state:t,dispatch:e})=>q6(t,e),I1=t=>{};function eO(t,e,n){const{selection:r}=e;let o=null;if(I1()&&(o=r.$cursor),o){const i=t.storedMarks??o.marks();return!!n.isInSet(i)||!i.some(s=>s.type.excludes(n))}return r.ranges.some(({$from:i,$to:s})=>{let a=i.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(i.pos,s.pos,(l,c,u)=>{if(a)return!1;if(l.isInline){const d=!u||u.type.allowsMarkType(n),f=!!n.isInSet(l.marks)||!l.marks.some(p=>p.type.excludes(n));a=d&&f}return!a}),a})}const tO=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:a}=i,l=ir(t,r.schema);if(o)if(s){const c=Me.getMarkAttributes(r,l);n.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(u,d,(f,p)=>{const h=Math.max(p,u),m=Math.min(p+f.nodeSize,d);f.marks.find(y=>y.type===l)?f.marks.forEach(y=>{l===y.type&&n.addMark(h,m,l.create({...y.attrs,...e}))}):n.addMark(h,m,l.create(e))})});return eO(r,n,l)};function xd(t,e,n={}){return t.find(r=>r.type===e&&Ko(r.attrs,n))}function nO(t,e,n={}){return!!xd(t,e,n)}function Uf(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&r.offset!==0&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const o=xd([...r.node.marks],e,n);if(!o)return;let i=r.index,s=t.start()+r.offset,a=i+1,l=s+r.node.nodeSize;for(xd([...r.node.marks],e,n);i>0&&o.isInSet(t.parent.child(i-1).marks);)i-=1,s-=t.parent.child(i).nodeSize;for(;a<t.parent.childCount&&nO([...t.parent.child(a).marks],e,n);)l+=t.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}const rO=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{extendEmptyMarkRange:i=!1}=e,{selection:s}=n,a=ir(t,r.schema),{$from:l,empty:c,ranges:u}=s;if(!o)return!0;if(c&&i){let{from:d,to:f}=s;const p=l.marks().find(m=>m.type===a)?.attrs,h=Uf(l,a,p);h&&(d=h.from,f=h.to),n.removeMark(d,f,a)}else u.forEach(d=>{n.removeMark(d.$from.pos,d.$to.pos,a)});return n.removeStoredMark(a),!0},oO=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:o}=n;return r||e&&o.forEach(i=>{t.removeMark(i.$from.pos,i.$to.pos)}),!0};function Za(t,e,n={}){const{empty:r,ranges:o}=t.selection,i=e?ir(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(u=>i?i.name===u.type.name:!0).find(u=>Ko(u.attrs,n,{strict:!1}));let s=0;const a=[];if(o.forEach(({$from:u,$to:d})=>{const f=u.pos,p=d.pos;t.doc.nodesBetween(f,p,(h,m)=>{if(!h.isText&&!h.marks.length)return;const y=Math.max(f,m),g=Math.min(p,m+h.nodeSize),x=g-y;s+=x,a.push(...h.marks.map(k=>({mark:k,from:y,to:g})))})}),s===0)return!1;const l=a.filter(u=>i?i.name===u.mark.type.name:!0).filter(u=>Ko(u.mark.attrs,n,{strict:!1})).reduce((u,d)=>u+d.to-d.from,0),c=a.filter(u=>i?u.mark.type!==i&&u.mark.type.excludes(i):!0).reduce((u,d)=>u+d.to-d.from,0);return(l>0?l+c:l)>=s}const iO=(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=ir(t,r.schema);return Za(r,s,e)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,e)},sO=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return n&&o.forEach(({$from:i,$to:s})=>{t.doc.nodesBetween(i.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:u}=e,d=c.resolve(u.map(l)),f=c.resolve(u.map(l+a.nodeSize)),p=d.blockRange(f);if(!p)return;const h=Cs(p);if(a.type.isTextblock){const{defaultType:m}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(p.start,m)}(h||h===0)&&e.lift(p,h)})}),!0},aO=(t,e={})=>({state:n,dispatch:r,chain:o})=>{const i=ht(t,n.schema);return i.isTextblock?o().command(({commands:s})=>Gg(i,e)(n)?!0:s.clearNodes()).command(({state:s})=>Gg(i,e)(s,r)).run():!1};function Qa(t,e,n={}){const{from:r,to:o,empty:i}=t.selection,s=e?ht(e,t.schema):null,a=[];t.doc.nodesBetween(r,o,(u,d)=>{if(u.isText)return;const f=Math.max(r,d),p=Math.min(o,d+u.nodeSize);a.push({node:u,from:f,to:p})});const l=o-r,c=a.filter(u=>s?s.name===u.node.type.name:!0).filter(u=>Ko(u.node.attrs,n,{strict:!1}));return i?!!c.length:c.reduce((u,d)=>u+d.to-d.from,0)>=l}const lO=(t,e,n={})=>({state:r,commands:o})=>{const i=ht(t,r.schema),s=ht(e,r.schema);return Qa(r,i,n)?o.setNode(s):o.setNode(i,n)},cO=()=>({state:t,dispatch:e})=>H6(t,e),uO=()=>({state:t,dispatch:e})=>jf(t,e),dO=(t,e={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=Os(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(i=ht(t,r.schema)),a==="mark"&&(s=ir(t,r.schema)),o&&n.selection.ranges.forEach(l=>{const c=l.$from.pos,u=l.$to.pos;r.doc.nodesBetween(c,u,(d,f)=>{i&&i===d.type&&n.setNodeMarkup(f,void 0,{...d.attrs,...e}),s&&d.marks.length&&d.marks.forEach(p=>{if(s===p.type){const h=Math.max(f,c),m=Math.min(f+d.nodeSize,u);n.addMark(h,m,s.create({...p.attrs,...e}))}})})}),!0):!1};function Xg(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,o)=>(n.includes(o)||(r[o]=t[o]),r),{})}const fO=(t,e)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=Os(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(i=ht(t,r.schema)),a==="mark"&&(s=ir(t,r.schema)),o&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,u)=>{i&&i===c.type&&n.setNodeMarkup(u,void 0,Xg(c.attrs,e)),s&&c.marks.length&&c.marks.forEach(d=>{s===d.type&&n.addMark(u,u+c.nodeSize,s.create(Xg(d.attrs,e)))})})}),!0):!1},pO=()=>({state:t,dispatch:e})=>z6(t,e),hO=()=>({state:t,dispatch:e})=>j6(t,e),mO=()=>({state:t,dispatch:e})=>k1(t,e),gO=()=>({state:t,dispatch:e})=>E1(t,e),yO=()=>({state:t,dispatch:e})=>S1(t,e),bO=()=>({state:t,dispatch:e})=>A1(t,e),wO=()=>({state:t,dispatch:e})=>G6(t,e),vO=()=>({state:t,dispatch:e})=>K6(t,e),xO=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),F1=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&F1(r)}return t};function Vs(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return F1(n)}function kd(t,e,n){n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,o=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return be.fromArray(t.map(s=>e.nodeFromJSON(s)));const i=e.nodeFromJSON(t);return n.errorOnInvalidContent&&i.check(),i}catch(i){if(n.errorOnInvalidContent)throw new Error("[super-editor error]: Invalid JSON content",{cause:i});return console.warn("[super-editor warn]: Invalid content.","Passed value:",t,"Error:",i),kd("",e,n)}if(o){if(n.errorOnInvalidContent){let s=!1,a="";const l=new pw({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__supereditor__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?Yr.fromSchema(l).parseSlice(Vs(t),n.parseOptions):Yr.fromSchema(l).parse(Vs(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[super-editor error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const i=Yr.fromSchema(e);return n.slice?i.parseSlice(Vs(t),n.parseOptions).content:i.parse(Vs(t),n.parseOptions)}return kd("",e,n)}function kO(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof $t||o instanceof Jt))return;const i=t.mapping.maps[r];let s=0;i.forEach((a,l,c,u)=>{s===0&&(s=u)}),t.setSelection(Re.near(t.doc.resolve(s),n))}const SO=t=>!("type"in t),CO=(t,e,n)=>({tr:r,dispatch:o,editor:i})=>{if(o){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let s;try{s=kd(e,i.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:n.errorOnInvalidContent??i.options.enableContentCheck})}catch(f){return i.emit("contentError",{editor:i,error:f,disableCollaboration:()=>{console.error("[super-editor error]: Unable to disable collaboration at this point in time")}}),!1}let{from:a,to:l}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},c=!0,u=!0;if((SO(s)?s:[s]).forEach(f=>{f.check(),c=c?f.isText&&f.marks.length===0:!1,u=u?f.isBlock:!1}),a===l&&u){const{parent:f}=r.doc.resolve(a);f.isTextblock&&!f.type.spec.code&&!f.childCount&&(a-=1,l+=1)}let d;c?(Array.isArray(e)?d=e.map(f=>f.text||"").join(""):typeof e=="object"&&e&&e.text?d=e.text:d=e,r.insertText(d,a,l)):(d=s,r.replaceWith(a,l,d)),n.updateSelection&&kO(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:a,text:d}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:a,text:d})}return!0},EO=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let i;if(o.spec.isInputRules&&(i=o.getState(t))){if(e){const s=t.tr,a=i.transform;for(let l=a.steps.length-1;l>=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(i.text){const l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,t.schema.text(i.text,l))}else s.delete(i.from,i.to)}return!0}}return!1};function AO(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i);if(!s)return!1;let a=r?n.tr:null;return $O(a,s,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function $O(t,e,n,r=null){let o=!1,i=e,s=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=s.resolve(e.start-2);i=new Fa(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new Fa(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),o=!0}let a=kw(i,n,r,e);return a?(t&&TO(t,e,a,o,n),!0):!1}function TO(t,e,n,r,o){let i=be.empty;for(let u=n.length-1;u>=0;u--)i=be.from(n[u].type.create(n[u].attrs,i));t.step(new Jt(e.start-(r?2:0),e.end,e.start,e.end,new ve(i,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==o&&(s=u+1);let a=n.length-s,l=e.start+n.length-(r?2:0),c=e.parent;for(let u=e.startIndex,d=e.endIndex,f=!0;u<d;u++,f=!1)!f&&Zn(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(u).nodeSize;return t}function OO(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,s=>s.childCount>0&&s.firstChild.type==t);return i?n?r.node(i.depth-1).type==t?DO(e,n,t,i):MO(e,n,i):!0:!1}}function DO(t,e,n,r){let o=t.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new Jt(i-1,s,i,s,new ve(be.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Fa(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const a=Cs(r);if(a==null)return!1;o.lift(r,a);let l=o.doc.resolve(o.mapping.map(i,-1)-1);return _r(o.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&o.join(l.pos),e(o.scrollIntoView()),!0}function MO(t,e,n){let r=t.tr,o=n.parent;for(let p=n.end,h=n.endIndex-1,m=n.startIndex;h>m;h--)p-=o.child(h).nodeSize,r.delete(p-1,p+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?be.empty:be.from(o))))return!1;let d=i.pos,f=d+s.nodeSize;return r.step(new Jt(d-(a?1:0),f+(l?1:0),d+1,f-1,new ve((a?be.empty:be.from(o.copy(be.empty))).append(l?be.empty:be.from(o.copy(be.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function _O(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,c=>c.childCount>0&&c.firstChild.type==t);if(!i)return!1;let s=i.startIndex;if(s==0)return!1;let a=i.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,u=be.from(c?t.create():null),d=new ve(be.from(t.create(null,be.from(a.type.create(null,u)))),c?3:1,0),f=i.start,p=i.end;n(e.tr.step(new Jt(f-(c?3:1),p,f,p,d,1,!0)).scrollIntoView())}return!0}}const NO=(t,e={})=>({state:n,dispatch:r})=>{const o=ht(t,n.schema);return AO(o,e)(n,r)},$l=(t,e)=>{for(let n=t.depth;n>0;n--){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}},Bn=t=>({$from:e})=>$l(e,t),Sd=(t,e)=>{const n=e.filter(i=>i.type==="node").find(i=>i.name===t);if(!n)return!1;const r={name:n.name,options:n.options,storage:n.storage},o=He(De(n,"group",r));return typeof o!="string"?!1:o.split(" ").includes("list")},nu=(t,e)=>{const n=Bn(i=>i.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===o?.type&&_r(t.doc,n.pos)&&t.join(n.pos),!0},ru=(t,e)=>{const n=Bn(i=>i.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===o?.type&&_r(t.doc,r)&&t.join(r),!0},IO=(t,e,n,r={})=>o=>{const{editor:i,tr:s,state:a,dispatch:l,chain:c,can:u,commands:d}=o,{extensions:f,splittableMarks:p}=i.extensionService,h=ht(t,a.schema),m=ht(e,a.schema),{selection:y,storedMarks:g}=a,{$from:x,$to:k}=y,w=x.blockRange(k),T=g||y.$to.parentOffset&&y.$from.marks();if(!w)return!1;const D=Bn(F=>Sd(F.type.name,f))(y);if(w.depth>=1&&D&&w.depth-D.depth<=1){if(D.node.type===h)return d.liftListItem(m);if(Sd(D.node.type.name,f)&&h.validContent(D.node.content)&&l)return c().command(()=>(s.setNodeMarkup(D.pos,h),!0)).command(()=>nu(s,h)).command(()=>ru(s,h)).run()}const M=({ensureMarks:F=!1})=>()=>{const C=u().wrapInList(h,r);if(F){const U=T.filter(ie=>p.includes(ie.type.name));s.ensureMarks(U)}return C?!0:d.clearNodes()};return!n||!T||!l?c().command(M({ensureMarks:!1})).wrapInList(h,r).command(()=>nu(s,h)).command(()=>ru(s,h)).run():c().command(M({ensureMarks:!0})).wrapInList(h,r).command(()=>nu(s,h)).command(()=>ru(s,h)).run()},FO=t=>e=>{const{tr:n,state:r,dispatch:o,editor:i}=e,s=ht(t,r.schema),{$from:a,$to:l,node:c}=r.selection;if(c&&c.isBlock||a.depth<2||!a.sameParent(l))return!1;const u=a.node(-1);if(u.type!==s)return!1;const d=i.extensionService.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(o){let y=be.empty;const g=a.index(-1)?1:a.index(-2)?2:3;for(let M=a.depth-g;M>=a.depth-3;M--)y=be.from(a.node(M).copy(y));const x=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,k=Me.getSplittedAttributes(d,a.node().type.name,a.node().attrs),w=s.contentMatch.defaultType?.createAndFill(k)||void 0;y=y.append(be.from(s.createAndFill(null,w)||void 0));const T=a.before(a.depth-(g-1));n.replace(T,a.after(-x),new ve(y,4-g,0));let D=-1;n.doc.nodesBetween(T,n.doc.content.size,(M,F)=>{if(D>-1)return!1;M.isTextblock&&M.content.size===0&&(D=F+1)}),D>-1&&n.setSelection(Le.near(n.doc.resolve(D))),n.scrollIntoView()}return!0}const f=l.pos===a.end()?u.contentMatchAt(0).defaultType:null,p=Me.getSplittedAttributes(d,u.type.name,u.attrs),h=Me.getSplittedAttributes(d,a.node().type.name,a.node().attrs);n.delete(a.pos,l.pos);const m=f?[{type:s,attrs:p},{type:f,attrs:h}]:[{type:s,attrs:p}];if(!Zn(n.doc,a.pos,2))return!1;if(o){const{selection:y,storedMarks:g}=r,{splittableMarks:x}=i.extensionService,k=g||y.$to.parentOffset&&y.$from.marks();if(n.split(a.pos,2,m).scrollIntoView(),!k||!o)return!0;const w=k.filter(T=>x.includes(T.type.name));n.ensureMarks(w)}return!0},BO=t=>({state:e,dispatch:n})=>{const r=ht(t,e.schema);return _O(r)(e,n)},RO=t=>({state:e,dispatch:n})=>{const r=ht(t,e.schema);return OO(r)(e,n)},LO=Object.freeze(Object.defineProperty({__proto__:null,clearNodes:sO,command:I6,createParagraphNear:Y6,deleteSelection:uO,exitCode:Q6,first:N6,insertContent:xO,insertContentAt:CO,insertTabChar:F6,insertTabNode:B6,joinBackward:mO,joinDown:hO,joinForward:gO,joinUp:pO,liftEmptyBlock:J6,liftListItem:RO,newlineInCode:Z6,resetAttributes:fO,selectAll:cO,selectNodeBackward:yO,selectNodeForward:bO,selectTextblockEnd:vO,selectTextblockStart:wO,setMark:tO,setMeta:R6,setNode:aO,sinkListItem:BO,splitBlock:X6,splitListItem:FO,toggleList:IO,toggleMark:iO,toggleNode:lO,undoInputRule:EO,unsetAllMarks:oO,unsetMark:rO,updateAttributes:dO,wrapInList:NO},Symbol.toStringTag,{value:"Module"})),PO=Qe.create({name:"commands",addCommands(){return{...LO}}}),zO=()=>["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform),jO=()=>typeof navigator<"u"?/Mac/.test(navigator.platform):!1,qO=Qe.create({name:"keymap",addShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),e=()=>this.editor.commands.first(({commands:s,tr:a})=>[()=>s.undoInputRule(),()=>(a.setMeta("inputType","deleteContentBackward"),!1),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),n=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:t,"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:n,"Mod-Delete":n,"Mod-a":()=>this.editor.commands.selectAll(),Tab:()=>this.editor.commands.insertTabNode()},o={...r},i={...r,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":n,"Ctrl-Alt-Backspace":n,"Alt-Delete":n,"Alt-d":n,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd(),"Ctrl-t":()=>this.editor.commands.insertTabChar()};return jO()||zO()?i:o}}),VO=Qe.create({name:"editable",addPmPlugins(){return[new Ze({key:new et("editable"),props:{editable:()=>this.editor.options.editable}})]}}),UO=Qe.create({name:"editorFocus",addPmPlugins(){const t=this.editor;return[new Ze({key:new et("editorFocus"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}});function B1(t,e,n,{check:r=!1}={}){const o=t.getSchema(n);if(o){const i=e.nodeFromJSON(o);return r&&i.check(),i}return e.topNodeType.createAndFill()}function R1(t,e,n={}){if(!e)return Qa(t,null,n)||Za(t,null,n);const r=Os(e,t.schema);return r==="node"?Qa(t,e,n):r==="mark"?Za(t,e,n):!1}const Hf=({tr:t,from:e,to:n,markName:r,attrs:o={},offset:i=1})=>{const{doc:s}=t,a=Math.max(e-i,0),l=Math.min(n+i,s.content.size);let c;return s.nodesBetween(a,l,(u,d)=>{if(!u||u?.nodeSize===void 0)return;const f=u.marks.find(p=>p.type.name===r&&Object.keys(o).every(h=>p.attrs[h]===o[h]));f&&!c&&(c={from:d,to:d+u.nodeSize,mark:f})}),c},L1=({tr:t,from:e,to:n,user:r,date:o})=>{t.removeMark(e,n,t.doc.type.schema.marks[lt]),t.removeMark(e,n,t.doc.type.schema.marks[It]);let i=Hf({tr:t,from:e,to:n,markName:It,attrs:{authorEmail:r.email}}),s;i?s=i.mark.attrs.id:s=mo();const a=t.doc.type.schema.marks[It].create({id:s,author:r.name,authorEmail:r.email,date:o});return t.addMark(e,n,a),t.doc.nodesBetween(e,n,(l,c)=>{if(c<e||["bulletList","orderedList"].includes(l.type.name))return!0;if(l.isInline||["tableRow","tableCell"].includes(l.type.name)||(l.attrs.track,l.type.name==="table"))return!1}),a},P1=({tr:t,from:e,to:n,user:r,date:o})=>{let i=Hf({tr:t,from:e,to:n,markName:lt,attrs:{authorEmail:r.email}}),s;i?s=i.mark.attrs.id:s=mo();const a=t.doc.type.schema.marks[lt].create({id:s,author:r.name,authorEmail:r.email,date:o}),l=new Ho;let c=[];return t.doc.nodesBetween(e,n,(u,d)=>{if(!u.type.name.includes("table"))if(u.isInline&&u.marks.find(f=>f.type.name===It&&f.attrs.authorEmail===r.email)){const f=new $t(l.map(Math.max(e,d)),l.map(Math.min(n,d+u.nodeSize)),ve.empty);t.maybeStep(f).failed||l.appendMap(f.getMap())}else u.isInline&&!u.marks.find(f=>f.type.name===lt)?(c.push(u),t.addMark(l.map(Math.max(e,d)),l.map(Math.min(n,d+u.nodeSize)),a)):u.attrs.track&&!u.attrs.track.find(f=>f.type===lt)&&["bulletList","orderedList"].includes(u.type.name)}),{deletionMark:a,deletionMap:l,nodes:c}};function Wf(t){const e={bulletList:1,orderedList:2};return{attributes:{parentAttributes:{"w14:paraId":Xn(),"w14:textId":Xn(),"w:rsidR":Xn(),"w:rsidRDefault":Xn(),"w:rsidP":Xn(),paragraphProperties:{type:"element",name:"w:pPr",elements:[{type:"element",name:"w:pStyle",attributes:{"w:val":"ListParagraph"}},{type:"element",name:"w:numPr",elements:[{type:"element",name:"w:ilvl",attributes:{"w:val":"0"}},{type:"element",name:"w:numId",attributes:{"w:val":e[t]||0}}]}]}}}}}function HO(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(o=>{const i=n.resolve(t-1),s=Uf(i,o.type);s&&r.push({mark:o,...s})}):n.nodesBetween(t,e,(o,i)=>{!o||o?.nodeSize===void 0||r.push(...o.marks.map(s=>({from:i,to:i+o.nodeSize,mark:s})))}),r}function Gf(t,e){const n=[];return t.descendants((r,o)=>{e(r)&&n.push({node:r,pos:o})}),n}function el(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function z1(t,e,n){const r=t.state.doc.content.size,o=el(e,0,r),i=el(n,0,r),s=t.coordsAtPos(o),a=t.coordsAtPos(i,-1),l=Math.min(s.top,a.top),c=Math.max(s.bottom,a.bottom),u=Math.min(s.left,a.left),d=Math.max(s.right,a.right),f=d-u,p=c-l,h={top:l,bottom:c,left:u,right:d,width:f,height:p,x:u,y:l};return{...h,toJSON:()=>h}}const Kf=t=>{const{$head:e}=t.selection;for(let n=e.depth;n>0;n-=1)if(e.node(n).type?.spec?.tableRole==="row")return!0;return!1},Xf=Object.freeze(Object.defineProperty({__proto__:null,chainableEditorState:zf,cleanSchemaItem:wd,createDocument:B1,defaultBlockAt:N1,findChildren:Gf,findMark:Sl,findParentNode:Bn,findParentNodeClosestToPos:$l,generateDocxListAttributes:Wf,generateDocxRandomId:Xn,generateRandom32BitHex:Cf,getActiveFormatting:Tf,getExtensionConfigField:De,getMarkRange:Uf,getMarkType:ir,getMarksBetween:HO,getMarksFromSelection:Es,getNodeType:ht,getSchemaTypeByName:ls,getSchemaTypeNameByName:Os,isActive:R1,isInTable:Kf,isList:Sd,isMarkActive:Za,isNodeActive:Qa,isTextSelection:I1,posToDOMRect:z1},Symbol.toStringTag,{value:"Module"})),WO=(t,e,n)=>{const r=t.resolve(e),o=r.parent,i=o.childAfter(r.parentOffset);if(!i.node)return null;const s=i.node.marks.find(d=>d.type.name===n);let a=r.index(),l=r.start()+i.offset;for(;a>0&&s.isInSet(o.child(a-1).marks);)l-=o.child(--a).nodeSize;let c=r.index()+1,u=r.start()+i.offset+i.node.nodeSize;for(;c<o.childCount&&s.isInSet(o.child(c).marks);)u+=o.child(c++).nodeSize;return{from:l,to:u,attrs:s.attrs}},j1=(t,e=!0)=>{if(!t)throw new Error('Invalid "node" parameter');const n=[];return t.descendants((r,o)=>{if(n.push({node:r,pos:o}),!e)return!1}),n},q1=(t,e,n)=>{if(t){if(!e)throw new Error('Invalid "predicate" parameter')}else throw new Error('Invalid "node" parameter');return j1(t,n).filter(r=>e(r.node))},V1=(t,e)=>q1(t,n=>n.isInline,e),GO=Object.freeze(Object.defineProperty({__proto__:null,findChildren:q1,findInlineNodes:V1,findMarkPosition:WO,flatten:j1},Symbol.toStringTag,{value:"Module"})),Jf=(t,e=null)=>{const n=[],r=V1(t.doc);return r.length?(r.forEach(({node:o,pos:i})=>{const{marks:s}=o,a=[It,lt,bt];s.length>0&&s.forEach(l=>{a.includes(l.type.name)&&n.push({mark:l,from:i,to:i+o.nodeSize})})}),e?n.filter(({mark:o})=>o.attrs.id===e):n):n},pt=new et("TrackChangesBase"),KO=(t={})=>new Ze({key:pt,state:{init(e,n){return{isTrackChangesActive:!1,onlyOriginalShown:!1,onlyModifiedShown:!1,decorations:So(n,!1,!1)}},apply(e,n,r,o){const i=e.getMeta(pt);return i?i.type==="TRACK_CHANGES_ENABLE"?{...n,isTrackChangesActive:i.value===!0,decorations:So(o,n.onlyOriginalShown,n.onlyModifiedShown)}:i.type==="SHOW_ONLY_ORIGINAL"?{...n,onlyOriginalShown:i.value===!0,onlyModifiedShown:!1,decorations:So(o,i.value===!0,!1)}:i.type==="SHOW_ONLY_MODIFIED"?{...n,onlyOriginalShown:!1,onlyModifiedShown:i.value===!0,decorations:So(o,!1,i.value===!0)}:{...n,decorations:So(o,n.onlyOriginalShown,n.onlyModifiedShown)}:{...n,decorations:So(o,n.onlyOriginalShown,n.onlyModifiedShown)}}},props:{decorations(e){return this.getState(e)?.decorations}}}),So=(t,e,n)=>{if(!t.doc||!t.doc.nodeSize||n&&e)return qe.empty;const r=[],o=Jf(t);return o.length?(o.forEach(({mark:i,from:s,to:a})=>{if(i.type.name===It)if(e){const l=Pe.inline(s,a,{class:"track-insert-dec hidden"});r.push(l)}else if(n){const l=Pe.inline(s,a,{class:"track-insert-dec normal"});r.push(l)}else{const l=Pe.inline(s,a,{class:"track-insert-dec highlighted"});r.push(l)}if(i.type.name===lt)if(e){const l=Pe.inline(s,a,{class:"track-delete-dec normal"});r.push(l)}else if(n){const l=Pe.inline(s,a,{class:"track-delete-dec hidden"});r.push(l)}else{const l=Pe.inline(s,a,{class:"track-delete-dec highlighted"});r.push(l);const c=Pe.widget(s,()=>{const u=document.createElement("span");return u.classList.add("track-delete-widget"),u.contentEditable=!1,u},{ignoreSelection:!0});r.push(c)}if(i.type.name===bt)if(e){const l=Pe.inline(s,a,{class:"track-format-dec before"});r.push(l)}else if(n){const l=Pe.inline(s,a,{class:"track-format-dec normal"});r.push(l)}else{const l=Pe.inline(s,a,{class:"track-format-dec highlighted"});r.push(l)}}),qe.create(t.doc,r)):qe.empty},nn="commentMark",Jg=({commentId:t,state:e,tr:n,dispatch:r})=>{XO(t,e.doc).forEach(({from:o,to:i})=>{n.removeMark(o,i,e.schema.marks[nn])}),r(n)},XO=(t,e)=>{const n=[];return e.descendants((r,o)=>{const{marks:i}=r,s=i.find(a=>a.type.name===nn);if(s){const{attrs:a}=s,{commentId:l}=a;t===l&&n.push({from:o,to:o+r.nodeSize})}}),n},JO=(t,e,n,r=[])=>{const o=[],i=[],s=new Set;return t.descendants((a,l)=>{(a.marks?.filter(c=>c.type.name===nn)).forEach(c=>{if(c){const{attrs:u={}}=c,{commentId:d}=u;if(d==="pending"||s.has(d))return;s.add(d);const f=Yg(c.attrs),p=n.nodes.commentRangeStart.create(f);o.push({pos:l,node:p});const h=n.nodes.commentRangeEnd.create(f);i.push({pos:l+a.nodeSize,node:h});const m=d;m&&r.filter(y=>y.parentCommentId===m).sort((y,g)=>y.createdTime-g.createdTime).forEach(y=>{const g=Yg(y),x=n.nodes.commentRangeStart.create(g);s.add(y.commentId),o.push({pos:l,node:x});const k=n.nodes.commentRangeEnd.create(g);i.push({pos:l+a.nodeSize,node:k})})}})}),o.forEach(a=>{const{pos:l,node:c}=a,u=e.mapping.map(l);e.insert(u,c)}),i.forEach(a=>{const{pos:l,node:c}=a,u=e.mapping.map(l);e.insert(u,c)}),e},Yg=t=>{const{commentId:e,internal:n}=t;return{"w:id":e,internal:n}},YO=(t,e,n,r)=>{const o=[],i=[];t.descendants((s,a)=>{const{type:l}=s;if(!["commentRangeStart","commentRangeEnd","commentReference"].includes(l.name))return;const c=r.comments?.find(d=>d.importedId==s.attrs["w:id"])||{},{commentId:u}=c;if(u)if(l.name==="commentRangeStart")o.push({"w:id":u,importedId:s.attrs["w:id"],internal:!1,start:a}),i.push({start:a,end:a+1});else if(l.name==="commentRangeEnd"){const d=o.find(h=>h.importedId===s.attrs["w:id"]);if(!d)return;const{start:f}=d,p={commentId:u,importedId:s.attrs["w:id"],internal:d.internal};e.addMark(f,a+1,n.marks[nn].create(p)),i.push({start:a,end:a+1})}else l.name==="commentReference"&&i.push({start:a,end:a+1})}),i.sort((s,a)=>a.start-s.start).forEach(({start:s,end:a})=>{e.delete(s,a)})},ZO=(t={})=>{const{before:e=[],after:n=[]}=t,r=new Set(e.map(h=>h.type)),o=new Set(n.map(h=>h.type)),i=[...o].filter(h=>!r.has(h)),s=[...r].filter(h=>!o.has(h)),a=[],l=i.filter(h=>!["textStyle","commentMark"].includes(h));l.length&&a.push(`Added formatting: ${l.join(", ")}`);const c=s.filter(h=>!["textStyle","commentMark"].includes(h));c.length&&a.push(`Removed formatting: ${c.join(", ")}`);const u=e.find(h=>h.type==="textStyle")?.attrs||{},d=n.find(h=>h.type==="textStyle")?.attrs||{},f=[],p=h=>h.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase();return Object.keys({...u,...d}).forEach(h=>{const m=u[h],y=d[h];if(m!==y){if(y===null)return;if(h==="color")f.push("Changed color");else{const g=p(h);m==null?f.push(`Set ${g} to ${y}`):f.push(`Changed ${g} from ${m} to ${y}`)}}}),f.length&&a.push(`Modified text style: ${f.join(", ")}`),a.length?a.join(". "):"No formatting changes."},QO=({activeThreadId:t,threadId:e,isInternal:n,editor:r})=>{if(!r.options.isInternal&&n)return"transparent";const o=yt.getState(r.state),i=n?o.internalColor:o.externalColor,s=t==e?"44":"22";return`${i}${s}`},to=new et("paginationPlugin"),eD=async t=>{if(!t.converter)return;const e={headers:{},footers:{}},n=t.converter.headerIds,r=t.converter.footerIds;for(let o in n){const i=n[o];if(!i)continue;const s=t.converter.headers[i];e.headers[i]||(e.headers[i]={}),e.headers[i].data=s;const{height:a,sectionEditor:l,sectionContainer:c}=await Zg(t,s);e.headers[i].height=a,e.headers[i].sectionEditor=l,e.headers[i].sectionContainer=c}for(let o in r){const i=r[o];if(!i)continue;const s=t.converter.footers[i];e.headers[i]||(e.footers[i]={}),e.footers[i].data=s;const{height:a,sectionEditor:l,sectionContainer:c}=await Zg(t,s);e.footers[i].height=a,e.footers[i].sectionEditor=l,e.footers[i].sectionContainer=c}return e},Zg=async(t,e)=>new Promise(n=>{const r=document.createElement("div");r.className="super-editor",r.style.padding=0,r.style.margin=0;const o=t.converter.getDocumentDefaultStyles(),{fontSizePt:i,typeface:s}=o,a=i*1.3333,l=a*1.15;Object.assign(r.style,{padding:"0",margin:"0",border:"none",boxSizing:"border-box",position:"absolute",top:"0",left:"0",width:"auto",maxWidth:"none",fontFamily:s,fontSize:`${a}px`,lineHeight:`${l}px`}),document.body.appendChild(r);const c=new cs({loadFromSchema:!0,mode:"text",editable:!1,element:r,content:e,extensions:up(),documentId:"sectionId"});c.on("create",()=>{requestAnimationFrame(()=>{const u=r.offsetHeight;document.body.removeChild(r),Object.assign(r.style,{padding:"0",margin:"0",border:"none",boxSizing:"border-box",position:"relative",top:"initial",left:"initial",width:"initial",maxWidth:"initial",fontFamily:"initial",fontSize:"initial",lineHeight:"initial"}),n({height:u,sectionEditor:c,sectionContainer:r})})})}),Yf=[It,lt,bt],yt=new et("comments"),tD=Qe.create({name:"comments",addCommands(){return{insertComment:t=>({tr:e,dispatch:n,state:r})=>{const{selection:o}=e,{$from:i,$to:s}=o,{commentId:a,isInternal:l}=t;return e.setMeta(yt,{event:"add"}),e.addMark(i.pos,s.pos,this.editor.schema.marks[nn].create({commentId:a,internal:l})),n(e),!0},removeComment:({commentId:t,importedId:e})=>({tr:n,dispatch:r,state:o})=>{n.setMeta(yt,{event:"deleted"}),Jg({commentId:t,state:o,tr:n,dispatch:r})},setActiveComment:({commentId:t})=>({tr:e,dispatch:n})=>{let r=t;return e.setMeta(yt,{type:"setActiveComment",activeThreadId:r}),!0},setCommentInternal:({commentId:t,isInternal:e})=>({tr:n,dispatch:r,state:o})=>{const{doc:i}=o;let s,a;return n.setMeta(yt,{event:"update"}),i.descendants((l,c)=>{if(s)return;const{marks:u=[]}=l,d=u.find(f=>f.type.name===nn);if(d){const{attrs:f}=d;f.commentId===t&&(s=l,a=c)}}),s?(n.addMark(a,a+s.nodeSize,this.editor.schema.marks[nn].create({commentId:t,internal:e})),n.setMeta(yt,{type:"setCommentInternal"}),r(n),!0):!1},resolveComment:({commentId:t})=>({tr:e,dispatch:n,state:r})=>{e.setMeta(yt,{event:"update"}),Jg({commentId:t,state:r,tr:e,dispatch:n})}}},addPmPlugins(){const t=this.editor;let e,n;return t.options.isHeadless?[]:[new Ze({key:yt,state:{init(){return{activeThreadId:null,externalColor:"#B1124B",internalColor:"#078383",decorations:qe.empty,allCommentPositions:{},allCommentIds:[],changedActiveThread:!1,trackedChanges:{}}},apply(r,o,i,s){const a=r.getMeta(to)?.isReadyToInit;a&&(e=!0);const l=r.getMeta(yt),{type:c}=l||{};if(c==="force"&&(e=!0),!a&&!e&&l&&l.decorations)return{...o,decorations:l.decorations,allCommentPositions:l.allCommentPositions};const u=r.getMeta(pt),d=o.trackedChanges;u&&(o.trackedChanges=rD(u,d,s,t));const f=l?.type==="setActiveComment";if(!r.docChanged&&r.selectionSet||f){const{selection:p}=r;let h=nD(s.doc,p);if(f&&(h=l.activeThreadId),n!==h){n=h;const m={type:ga.SELECTED,activeCommentId:n||null};e=!0,t.emit("commentsUpdate",m);const{tr:y}=t.view.state,{dispatch:g}=t.view;y.setMeta(yt,{type:"force"}),g(y)}}return o}},props:{decorations(r){return this.getState(r).decorations}},view(r){let o;return{update(i,s){const{state:a}=i,{doc:l,tr:c}=a;if(o&&!o.eq(l)&&(e=!0),!e)return;o=l,e=!1;const u=[],d={};l.descendants((p,h)=>{const{marks:m=[]}=p,y=m.filter(k=>k.type.name===nn);let g=!1;y.forEach(k=>{const{attrs:w}=k,T=w.commentId||w.importedId,D=i.coordsAtPos(h);Qg({allCommentPositions:d,threadId:T,pos:h,currentBounds:D,node:p});const M=w.internal;g||(g=n===T);let F=QO({activeThreadId:n,threadId:T,isInternal:M,editor:t});const C=Pe.inline(h,h+p.nodeSize,{style:`background-color: ${F};`,"data-thread-id":T,class:"comment-highlight"});g&&n!==T||u.push(C)});const x=U1({doc:l,from:h,to:h+p.nodeSize});if(x){const k=i.coordsAtPos(h),{id:w}=x.mark.attrs;Qg({allCommentPositions:d,threadId:w,pos:h,currentBounds:k,node:p})}});const f=qe.create(l,u);if(!yt.getState(a).decorations.eq(f)){const p=a.tr.setMeta(yt,{decorations:f,allCommentPositions:d});i.dispatch(p)}t.emit("comment-positions",{allCommentPositions:d})}}}})]}}),Qg=({allCommentPositions:t,threadId:e,pos:n,currentBounds:r,node:o})=>{let i={};if(r instanceof DOMRect?i={top:r.top,bottom:r.bottom,left:r.left,right:r.right}:i={...r},!t[e])t[e]={threadId:e,start:n,end:n+o.nodeSize,bounds:i};else{const s=t[e];s.start=Math.min(s.start,n),s.end=Math.max(s.end,n+o.nodeSize),s.bounds.top=Math.min(s.bounds.top,r.top),s.bounds.bottom=Math.max(s.bounds.bottom,r.bottom)}},nD=(t,e)=>{if(!e)return;const{$from:n,$to:r}=e;if(n.pos!==r.pos||!t.nodeAt(n.pos))return;const o=U1({doc:t,from:n.pos,to:r.pos});if(o)return o.mark.attrs.id;const i=[];let s=!1;t.descendants((d,f)=>{if(s)return;const p=f+d.nodeSize;if(n.pos<f||n.pos>=p)return;const{marks:h=[]}=d;h.find(m=>m.type.name===nn)&&i.push({node:d,pos:f,size:d.nodeSize}),f>n.pos&&(s=!0)});let a=null,l=null;i.forEach(({pos:d,node:f})=>{a||(a=n.pos-d);const p=n.pos-d;p>=0&&p<=a&&(l=f,a=p)});const{marks:c=[]}=l||{},u=c.find(d=>d.type.name===nn);return u?.attrs?.commentId||u?.attrs?.importedId},U1=({doc:t,from:e,to:n,offset:r=1})=>{const o=Math.max(e-r,0),i=Math.min(n+r,t.content.size);let s;return t.nodesBetween(o,i,(a,l)=>{if(!a||a?.nodeSize===void 0)return;const c=a.marks.find(u=>Yf.includes(u.type.name));c&&!s&&(s={from:l,to:l+a.nodeSize,mark:c})}),s},rD=(t,e,n,r)=>{const{insertedMark:o,deletionMark:i,formatMark:s,deletionNodes:a}=t;if(!o&&!i&&!s)return;const l={...e};let c=o?.attrs?.id||i?.attrs?.id||s?.attrs?.id;if(!c)return e;let u=!1;l[c]||(l[c]={},u=!0),o&&(l[c].insertion=c),i&&(l[c].deletion=i.attrs?.id),s&&(l[c].format=s.attrs?.id);const{step:d}=t;let f=d?.slice?.content?.content||[];f.length||n.doc.descendants((h,m)=>{if(h.marks.find(y=>y.type.name===bt))return f=[h],!1});const p=iD({documentId:r.options.documentId,event:u?"add":"update",marks:{insertedMark:o,deletionMark:i,formatMark:s},deletionNodes:a,nodes:f,newEditorState:n});return p&&r.emit("commentsUpdate",p),l},oD=({state:t,node:e,mark:n,marks:r,trackedChangeType:o,isDeletionInsertion:i,deletionNodes:s=[]})=>{let a="",l="";if(o===It&&(a=e?.text??""),o===bt&&(a=ZO(n.attrs)),(o===lt||i)&&(l=e?.text??"",i)){let{id:c}=r.deletionMark.attrs;l=sD(t.doc,u=>{const{marks:d=[]}=u,f=d.filter(p=>Yf.includes(p.type.name));if(!f.length)return!1;if(f.find(p=>p.attrs.id===c))return!0})?.node.text??""}return{deletionText:l,trackedChangeText:a}},iD=({event:t,marks:e,deletionNodes:n,nodes:r,newEditorState:o,documentId:i})=>{const s=e.insertedMark||e.deletionMark||e.formatMark,{type:a,attrs:l}=s,{name:c}=a,{author:u,authorEmail:d,date:f}=l,p=l.id,h=r[0],m=!!(e.insertedMark&&e.deletionMark);let y;o.doc.descendants((w,T)=>{const{marks:D=[]}=w,M=D.filter(F=>Yf.includes(F.type.name));if(M.length&&(M.find(F=>F.attrs.id===p)&&(y=w),y))return!1});const{deletionText:g,trackedChangeText:x}=oD({state:o,node:y||h,mark:s,marks:e,trackedChangeType:c,isDeletionInsertion:m,deletionNodes:n});if(!g&&!x)return;const k={event:ga.ADD,type:"trackedChange",documentId:i,changeId:p,trackedChangeType:m?"both":c,trackedChangeText:x,deletedText:e.deletionMark?g:null,author:u,authorEmail:d,date:f};return t==="add"?k.event=ga.ADD:t==="update"&&(k.event=ga.UPDATE),k};function sD(t,e){let n=null;return t.descendants((r,o)=>{if(e(r)&&(n={node:r,pos:o}),n)return!1}),n}const H1=({state:t,tr:e,step:n,newTr:r,map:o,doc:i,user:s,date:a,originalStep:l,originalStepIndex:c})=>{const u=t.schema.marks[lt],d=Sl(t,u,!1),f=d?d.to:n.to,p=new $t(f,f,n.slice,n.structure),h=l.invert(e.docs[c]).map(o);o.appendMap(h.getMap());const m={};if(p){const y=t.apply(r).tr;if(y.maybeStep(p).failed)return;const g=p.getMap().map(p.to),x=L1({tr:y,from:p.from,to:g,user:s,date:a}),k=new $t(p.from,p.to,y.doc.slice(p.from,g));r.step(k);const w=o.maps.length-1;o.appendMap(k.getMap(),w),p.from!==g&&(m.insertedMark=x,m.step=k),r.selection.eq(y.selection)||r.setSelection(y.selection)}if(n.from!==n.to){const{deletionMark:y,deletionMap:g,nodes:x}=P1({tr:r,from:n.from,to:n.to,user:s,date:a});m.deletionNodes=x,m.deletionMark=y,o.appendMapping(g)}r.setMeta(pt,m),r.setMeta(yt,{type:"force"})},aD=()=>{},lD=()=>{},W1=({state:t,tr:e,step:n,newTr:r,map:o,doc:i,user:s,date:a})=>{const l={};i.nodesBetween(n.from,n.to,(c,u)=>{if(!c.isInline)return;if(c.marks.find(p=>p.type.name===lt))return!1;const d=c.marks.find(p=>[lt,bt].includes(p.type.name)),f=d?d.attrs.id:mo();if(r.addMark(Math.max(n.from,u),Math.min(n.to,u+c.nodeSize),n.mark),["bold","italic","strike","underline","textStyle"].includes(n.mark.type.name)&&!c.marks.find(p=>p.type===n.mark.type)){const p=c.marks.find(y=>y.type.name===bt);let h=[],m=[];if(p?p.attrs.before.find(y=>y.type==="textStyle"?y.type===n.mark.type.name&&Ko(y.attrs,n.mark.attrs):y.type===n.mark.type.name)?(m=[...p.attrs.before.filter(y=>y.type!==n.mark.type.name)],h=[...p.attrs.after]):(m=[...p.attrs.before],h=[...p.attrs.after,{type:n.mark.type.name,attrs:{...n.mark.attrs}}]):(m=c.marks.map(y=>({type:y.type.name,attrs:{...y.attrs}})),h=[{type:n.mark.type.name,attrs:{...n.mark.attrs}}]),h.length||m.length){const y=t.schema.marks[bt].create({id:f,author:s.name,authorEmail:s.email,date:a,before:m,after:h});r.addMark(n.from,n.to,y),l.formatMark=y,l.step=n,r.setMeta(pt,l),r.setMeta(yt,{type:"force"})}else p&&r.removeMark(Math.max(n.from,u),Math.min(n.to,u+c.nodeSize),p)}})},G1=({state:t,tr:e,step:n,newTr:r,map:o,doc:i,user:s,date:a})=>{const l={};i.nodesBetween(n.from,n.to,(c,u)=>{if(!c.isInline)return!0;if(c.marks.find(d=>d.type.name===lt))return!1;if(r.removeMark(Math.max(n.from,u),Math.min(n.to,u+c.nodeSize),n.mark),["bold","italic","strike","underline","textStyle"].includes(n.mark.type.name)&&c.marks.find(d=>d.type===n.mark.type)){const d=c.marks.find(h=>h.type.name===bt);let f=[],p=[];if(d?d.attrs.after.find(h=>h.type===n.mark.type.name)?(f=[...d.attrs.after.filter(h=>h.type!==n.mark.type.name)],p=[...d.attrs.before]):(f=[...d.attrs.after],p=[...d.attrs.before,{type:n.mark.type.name,attrs:{...n.mark.attrs}}]):(f=[],p=[{type:n.mark.type.name,attrs:{...n.mark.attrs}}]),f.length||p.length){const h=t.schema.marks[bt].create({id:mo(),author:s.name,authorEmail:s.email,date:a,before:p,after:f});r.addMark(Math.max(n.from,u),Math.min(n.to,u+c.nodeSize),h),l.formatMark=h,l.step=n,r.setMeta(pt,l),r.setMeta(yt,{type:"force"})}else d&&r.removeMark(Math.max(n.from,u),Math.min(n.to,u+c.nodeSize),d)}})},K1=({tr:t,state:e,user:n})=>{const r=["inputType","uiEvent","paste","pointer"],o=["historyUndo","historyRedo","acceptReject"];if(!t.steps.length||t.meta&&!Object.keys(t.meta).every(c=>r.includes(c))||o.includes(t.getMeta("inputType"))||t.getMeta(yt))return t;const i=e.tr,s=new Ho,a=Math.floor(Date.now()/6e5)*6e5,l=new Date(a).toISOString();if(t.steps.forEach((c,u)=>{const d=c.map(s),{doc:f}=i;d&&(d instanceof $t?(H1({state:e,tr:t,step:d,newTr:i,map:s,doc:f,user:n,date:l,originalStep:c,originalStepIndex:u}),console.debug("[track-changes]: replaceStep")):d instanceof Ss?(W1({state:e,tr:t,step:d,newTr:i,map:s,doc:f,user:n,date:l}),console.debug("[track-changes]: addMarkStep")):d instanceof gn?(G1({state:e,tr:t,step:d,newTr:i,map:s,doc:f,user:n,date:l}),console.debug("[track-changes]: removeMarkStep")):(i.step(d),console.log("[track-changes]: otherStep")))}),t.getMeta("inputType")&&i.setMeta(t.getMeta("inputType")),t.getMeta("uiEvent")&&i.setMeta(t.getMeta("uiEvent")),t.selectionSet){const c=e.schema.marks[lt],u=Sl(e,c,!1);if(t.selection instanceof Le&&(t.selection.from<e.selection.from||t.getMeta("inputType")==="deleteContentBackward")){const d=s.map(t.selection.from,-1);i.setSelection(new Le(i.doc.resolve(d)))}else if(t.selection.from>e.selection.from&&u){const d=s.map(u.to+1,1);i.setSelection(new Le(i.doc.resolve(d)))}else i.setSelection(t.selection.map(i.doc,s))}else if(e.selection.from-t.selection.from>1&&t.selection.$head.depth>1){const c=s.map(t.selection.from-2,-1);i.setSelection(new Le(i.doc.resolve(c)))}return t.storedMarksSet&&i.setStoredMarks(t.storedMarks),t.scrolledIntoView&&i.scrollIntoView(),i},cD=t=>{const{state:e}=t,{dispatch:n}=t.view,{tr:r}=e;if(n)return e.doc.descendants((o,i)=>{if(o.type.name==="paragraph"){const{attrs:s}=o,{spacing:a}=s;if(!a)return;const l={line:zo(Ct(a.line)),lineSpaceBefore:zo(Ct(a.lineSpaceBefore)),lineSpaceAfter:zo(Ct(a.lineSpaceAfter))};r.setNodeMarkup(i,void 0,{...s,spacing:{...a,...l}})}}),n(r),!0},uD={initial:cD},ey=t=>{if(t==="initial"||t==="0.4.14")return Object.values(uD)};var Ro,X1,je,J1,Y1,ou,Z1,Cd,Ed,iu,su,Ad,$d,au,lu,cu,ty,Ii,Fi,ny,ry,Q1,e2;const dD=class t2 extends m6{constructor(e){super(),Cr(this,je),Cr(this,Ro),Fe(this,"extensionService"),Fe(this,"extensionStorage",{}),Fe(this,"schema"),Fe(this,"view"),Fe(this,"isFocused",!1),Cr(this,X1),Fe(this,"options",{element:null,isHeadless:!1,mockDocument:null,mockWindow:null,content:"",user:null,users:[],media:{},mediaFiles:{},fonts:{},documentMode:"editing",mode:"docx",role:"editor",colors:[],converter:null,fileSource:null,initialState:null,documentId:null,extensions:[],editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,isCommentsEnabled:!1,isNewFile:!1,scale:1,annotations:!1,isInternal:!1,externalExtensions:[],onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onTrackedChangesUpdate:()=>null,onCommentsUpdate:()=>null,onCommentsLoaded:()=>null,onCommentClicked:()=>null,onCommentLocationsUpdate:()=>null,onDocumentLocked:()=>null,onFirstRender:()=>null,onCollaborationReady:()=>null,onPaginationUpdate:()=>null,onException:()=>null,handleImageUpload:null,telemetry:null}),e.element=e.isHeadless?null:e.element||document.createElement("div"),Ie(this,je,Z1).call(this,e),this.setOptions(e);let n={docx:()=>Ie(this,je,J1).call(this,this.options),text:()=>Ie(this,je,Y1).call(this,this.options),default:()=>{console.log("Not implemented.")}};(n[this.options.mode]??n.default)()}setToolbar(e){this.toolbar=e}get state(){return this.view.state}get storage(){return this.extensionStorage}get commands(){return Kn(this,Ro).commands}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get isDestroyed(){return this.view.isDestroyed}get element(){return this.options.element}get users(){return this.options.users}chain(){return Kn(this,Ro).chain()}can(){return Kn(this,Ro).can()}setDocumentMode(e){let n=e?.toLowerCase()||"editing";this.extensionService&&(this.options.role==="viewer"&&(n="viewing"),this.options.role==="suggester"&&n==="editing"&&(n="suggesting"),n==="viewing"?(this.commands.toggleTrackChangesShowOriginal(),this.setEditable(!1,!1)):n==="suggesting"?(Ie(this,je,Ed).call(this,"TrackChangesBase"),this.commands.disableTrackChangesShowOriginal(),this.commands.enableTrackChanges(),this.setEditable(!0,!1)):n==="editing"&&(Ie(this,je,Ed).call(this,"TrackChangesBase"),this.commands.disableTrackChangesShowOriginal(),this.commands.disableTrackChanges(),this.setEditable(!0,!1)))}initializeCollaborationData(){if(!this.options.isNewFile||!this.options.collaborationProvider)return;const{collaborationProvider:e}=this.options,n=()=>{e.off("synced",n),Ie(this,je,Cd).call(this)};e.synced?Ie(this,je,Cd).call(this):e.on("synced",n)}setOptions(e){this.options={...this.options,...e},this.options.isNewFile&&this.options.isCommentsEnabled&&(this.options.shouldLoadComments=!0),!(!this.view||!this.state||this.ifsDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}registerPlugin(e,n){const r=typeof n=="function"?n(e,[...this.state.plugins]):[...this.state.plugins,e],o=this.state.reconfigure({plugins:r});this.view.updateState(o)}unregisterPlugin(e){if(this.isDestroyed)return;const n=typeof e=="string"?`${e}$`:e.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(o=>!o.key.startsWith(n))});this.view.updateState(r)}static async loadXmlData(e){if(!e)return;const n=new ed,r=await n.getDocxData(e),o=n.media;return[r,o,n.mediaFiles,n.fonts]}static getDocumentVersion(e){return $r.getStoredSuperdocVersion(e)}static updateDocumentVersion(e,n){return $r.updateDocumentVersion(e,n)}createNodeViews(){this.view.setProps({nodeViews:this.extensionService.nodeViews})}getMaxContentSize(){const{pageSize:e={},pageMargins:n={}}=this.converter.pageStyles??{},{width:r,height:o}=e,{top:i=0,bottom:s=0,left:a=0,right:l=0}=n;if(!r||!o)return{};const c=o*96-i*96-s*96-50;return{width:r*96-a*96-l*96-20,height:c}}initDefaultStyles(e=this.element){if(this.options.isHeadless)return;const n=e?.querySelector(".ProseMirror"),{pageSize:r,pageMargins:o}=this.converter.pageStyles??{};if(!n||!r||!o)return;e.style.width=r.width+"in",e.style.minWidth=r.width+"in",e.style.minHeight=r.height+"in",e.style.paddingLeft=o.left+"in",e.style.paddingRight=o.right+"in",e.style.boxSizing="border-box",n.style.outline="none",n.style.border="none";const{typeface:i,fontSizePt:s}=this.converter.getDocumentDefaultStyles()??{};i&&(e.style.fontFamily=i),s&&(e.style.fontSize=`${s}pt`),e.style.transformOrigin="top left",e.style.touchAction="auto",e.style.webkitOverflowScrolling="touch";const a=1.15;n.style.lineHeight=a,this.options.extensions.find(l=>l.name==="pagination")||(n.style.paddingTop="1in",n.style.paddingBottom="1in"),this.initMobileStyles(e)}initMobileStyles(e){if(!e)return;const n=e.offsetWidth,r=()=>{const i=n,s=document.documentElement.clientWidth-10;this.options.scale=Math.min(1,s/i);const a=e.closest(".super-editor"),l=e.closest(".super-editor-container");!a||!l||(this.options.scale<1?(a.style.maxWidth=`${i*this.options.scale}px`,l.style.minWidth="0px",e.style.transform=`scale(${this.options.scale})`):(a.style.maxWidth="",l.style.minWidth="",e.style.transform="none"))};r();const o=()=>{setTimeout(()=>{r()},150)};"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",o):window.matchMedia("(orientation: portrait)").addEventListener("change",o),window.addEventListener("resize",()=>o)}getAttributes(e){return Me.getAttributes(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,o=typeof e=="string"?n:e;return R1(this.state,r,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){const e=document.createElement("div"),n=si.fromSchema(this.schema).serializeFragment(this.state.doc.content);return e.appendChild(n),e.innerHTML}getPageStyles(){return this.converter?.pageStyles||{}}updatePageStyle({pageMargins:e}){if(!this.converter)return;let n=!1;if(e&&(this.converter.pageStyles.pageMargins=e,this.initDefaultStyles(),n=!0),n){const r=this.view.state.tr;r.setMeta("forceUpdatePagination",!0),this.view.dispatch(r)}}async exportDocx({isFinalDoc:e=!1,commentsType:n,comments:r=[]}={}){const o=Ie(this,je,Q1).call(this,r),i=await this.converter.exportToDocx(o,this.schema,this.storage.image.media,e,n,r),s=this.converter.schemaToXml(this.converter.convertedXml["docProps/custom.xml"].elements[0]),a=this.converter.schemaToXml(this.converter.convertedXml["word/styles.xml"].elements[0]),l=this.converter.schemaToXml(this.converter.convertedXml["word/settings.xml"].elements[0]),c=this.converter.schemaToXml(this.converter.convertedXml["word/_rels/document.xml.rels"].elements[0]),u=this.converter.addedMedia,d={"word/document.xml":String(i),"docProps/custom.xml":String(s),"word/settings.xml":String(l),"word/_rels/document.xml.rels":String(c),"word/styles.xml":String(a).replace(/&/gi,"&amp;")};if(r.length){const p=this.converter.schemaToXml(this.converter.convertedXml["word/comments.xml"].elements[0]),h=this.converter.schemaToXml(this.converter.convertedXml["word/commentsExtended.xml"].elements[0]),m=this.converter.schemaToXml(this.converter.convertedXml["word/commentsExtensible.xml"].elements[0]),y=this.converter.schemaToXml(this.converter.convertedXml["word/commentsIds.xml"].elements[0]);d["word/comments.xml"]=String(p),d["word/commentsExtended.xml"]=String(h),d["word/commentsExtensible.xml"]=String(m),d["word/commentsIds.xml"]=String(y)}const f=await new ed().updateZip({docx:this.options.content,updatedDocs:d,originalDocxFile:this.options.fileSource,media:u,fonts:this.options.fonts,isHeadless:this.options.isHeadless});return this.options.telemetry?.trackUsage("document_export",{documentType:"docx",timestamp:new Date().toISOString()}),f}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),Ie(this,je,e2).call(this),this.removeAllListeners()}static checkIfMigrationsNeeded(e){e||(e="initial");const n=ey(e)||[];return console.debug("[checkVersionMigrations] Migrations needed:",e,n.length),n.length>0}processCollaborationMigrations(){if(console.debug("[checkVersionMigrations] Current editor version","0.9.13"),!this.options.ydoc)return;let e=this.options.ydoc.getMap("meta").get("version");e||(e="initial"),console.debug("[checkVersionMigrations] Document version",e);const n=ey(e)||[],r=this.state.plugins.find(i=>i.key.startsWith("y-sync"));if(!r)return this.options.ydoc;let o=!1;for(let i of n)if(console.debug("🏃‍♂️ Running migration",i.name),i(this))o=!0;else throw new Error("Migration failed at "+i.name);return o?(r?.getState(this.state)).doc:void 0}async replaceFile(e){const[n,r,o,i]=await t2.loadXmlData(e);this.setOptions({fileSource:e,content:n,media:r,mediaFiles:o,fonts:i,isNewFile:!0,shouldLoadComments:!0,replacedFile:!0}),Ie(this,je,Ad).call(this),Ie(this,je,$d).call(this),this.initDefaultStyles(),this.initializeCollaborationData(!0),this.options.ydoc||(Ie(this,je,Fi).call(this),Ie(this,je,Ii).call(this))}};Ro=new WeakMap,X1=new WeakMap,je=new WeakSet,J1=function(t){Ie(this,je,iu).call(this),Ie(this,je,su).call(this),Ie(this,je,au).call(this),Ie(this,je,Ad).call(this),Ie(this,je,$d).call(this),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.on("exception",this.options.onException),Ie(this,je,cu).call(this),this.initDefaultStyles(),this.setDocumentMode(t.documentMode),!this.options.isHeadless&&(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",Ie(this,je,ou)),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("trackedChangesUpdate",this.options.onTrackedChangesUpdate),this.on("commentsLoaded",this.options.onCommentsLoaded),this.on("commentClick",this.options.onCommentClicked),this.on("commentsUpdate",this.options.onCommentsUpdate),this.on("locked",this.options.onDocumentLocked),this.on("collaborationReady",Ie(this,je,ty)),this.on("paginationUpdate",this.options.onPaginationUpdate),this.on("comment-positions",this.options.onCommentLocationsUpdate),this.initializeCollaborationData(),this.options.ydoc||(Ie(this,je,Fi).call(this),Ie(this,je,Ii).call(this)),window.setTimeout(()=>{this.isDestroyed||this.emit("create",{editor:this})},0))},Y1=function(t){(!t.extensions||!t.extensions.length)&&(this.options.extensions=cp()),Ie(this,je,iu).call(this),Ie(this,je,su).call(this),Ie(this,je,au).call(this),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),Ie(this,je,cu).call(this),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",Ie(this,je,ou)),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("commentsLoaded",this.options.onCommentsLoaded),this.on("commentClick",this.options.onCommentClicked),this.on("locked",this.options.onDocumentLocked),window.setTimeout(()=>{this.isDestroyed||this.emit("create",{editor:this})},0)},ou=function({editor:t,event:e}){this.toolbar?.setActiveEditor(t),this.options.onFocus({editor:t,event:e})},Z1=function(t){t.isHeadless&&(typeof navigator>"u"&&(Vr.navigator={isHeadless:!0}),t.mockDocument&&(Vr.document=t.mockDocument,Vr.window=t.mockWindow))},Cd=function(){if(!this.options.isNewFile)return;this.options.isNewFile=!1;const t=Ie(this,je,lu).call(this),e=this.state.tr.replaceWith(0,this.state.doc.content.size,t);this.view.dispatch(e),setTimeout(()=>{Ie(this,je,Fi).call(this),Ie(this,je,Ii).call(this)},50)},Ed=function(t){const e=this.extensionService?.plugins.find(r=>r.key.startsWith(t)),n=this.state.plugins.find(r=>r.key.startsWith(t));return e&&!n&&this.registerPlugin(e),e?.key},iu=function(){const t=["extension","node","mark"],e=[VO,PO,UO,qO],n=this.options.externalExtensions||[],r=[...e,...this.options.extensions].filter(o=>t.includes(o?.type));this.extensionService=_6.create(r,n,this)},su=function(){mv(this,Ro,w1.create({editor:this}))},Ad=function(){this.options.converter?this.converter=this.options.converter:this.converter=new $r({docx:this.options.content,media:this.options.mediaFiles,debug:!0,telemetry:this.options.telemetry,fileSource:this.options.fileSource,documentId:this.options.documentId})},$d=function(){if(!this.options.ydoc)return this.storage.image.media=this.options.mediaFiles;const t=this.options.ydoc.getMap("media");this.options.isNewFile?(Object.entries(this.options.mediaFiles).forEach(([e,n])=>{t.set(e,n)}),this.storage.image.media=this.options.mediaFiles):this.storage.image.media=Object.fromEntries(t.entries())},au=function(){this.schema=this.extensionService.schema},lu=function(){let t;try{const{mode:e,fragment:n,isHeadless:r,content:o,loadFromSchema:i}=this.options;e==="docx"?(t=B1(this.converter,this.schema,this),t=Ie(this,je,ry).call(this,t),n&&r&&(t=o6(n,this.schema))):e==="text"&&(o?t=i?this.schema.nodeFromJSON(o):Yr.fromSchema(this.schema).parse(o):t=this.schema.topNodeType.createAndFill())}catch(e){console.error(e),this.emit("contentError",{editor:this,error:e})}return t},cu=function(){let t=Ie(this,je,lu).call(this);const e={schema:this.schema};this.options.ydoc||(e.doc=t),this.view=new s1(this.options.element,{...this.options.editorProps,dispatchTransaction:Ie(this,je,ny).bind(this),state:zi.create(e)});const n=this.state.reconfigure({plugins:this.extensionService.plugins});this.view.updateState(n),this.createNodeViews();const r=this.view.dom;r.editor=this,this.options.telemetry?.sendReport()},ty=function({editor:t,ydoc:e}){this.options.collaborationIsReady||(console.debug("🔗 [super-editor] Collaboration ready"),this.options.onCollaborationReady({editor:t,ydoc:e}),this.options.collaborationIsReady=!0,this.options.isNewFile||(Ie(this,je,Fi).call(this),Ie(this,je,Ii).call(this)))},Ii=function(){if(!this.options.isCommentsEnabled||this.options.isHeadless||!this.options.shouldLoadComments)return;const t=this.options.replacedFile;this.emit("commentsLoaded",{editor:this,replacedFile:t,comments:this.converter.comments||[]}),setTimeout(()=>{this.options.replacedFile=!1;const{state:e,dispatch:n}=this.view,r=e.tr.setMeta(yt,{type:"force"});n(r)},50)},Fi=async function(){if(!(this.options.isHeadless||!this.extensionService)&&this.options.extensions.find(t=>t.name==="pagination")&&this.options.pagination){console.debug("🔗 [super-editor] Initializing pagination");const t=await eD(this);this.storage.pagination.sectionData=t;const{state:e,dispatch:n}=this.view,r=e.tr.setMeta(to,{isReadyToInit:!0});n(r)}},ny=function(t){if(this.view.isDestroyed)return;let e;try{const i=pt.getState(this.view.state)?.isTrackChangesActive??!1?K1({tr:t,state:this.state,user:this.options.user}):t,{state:s}=this.view.state.applyTransaction(i);e=s}catch(i){e=this.state.apply(t),console.log(i)}const n=!this.state.selection.eq(e.selection);this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t}),n&&this.emit("selectionUpdate",{editor:this,transaction:t});const r=t.getMeta("focus");r&&this.emit("focus",{editor:this,event:r.event,transaction:t});const o=t.getMeta("blur");o&&this.emit("blur",{editor:this,event:o.event,transaction:t}),t.docChanged&&this.emit("update",{editor:this,transaction:t})},ry=function(t){const e=zi.create({schema:this.schema,doc:t}),{tr:n,doc:r}=e;return YO(r,n,this.schema,this.converter),e.apply(n).doc},Q1=function(t=[]){const e=zi.create({schema:this.schema,doc:this.state.doc,plugins:this.state.plugins}),{tr:n,doc:r}=e;return JO(r,n,this.schema,t),e.apply(n).doc.toJSON()},e2=function(){if(this.options.ydoc)try{console.debug("🔗 [super-editor] Ending collaboration"),this.options.collaborationProvider&&this.options.collaborationProvider.disconnect(),this.options.ydoc&&this.options.ydoc.destroy()}catch{}};let cs=dD,rt=class n2{constructor(e){Fe(this,"type","node"),Fe(this,"name","node"),Fe(this,"options"),Fe(this,"storage"),Fe(this,"config",{name:this.name}),this.config={...this.config,...e},this.name=this.config.name,this.config.addOptions&&(this.options=He(De(this,"addOptions",{name:this.name}))),this.storage=He(De(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(...e){return new n2(...e)}},wn=class r2{constructor(e){Fe(this,"type","mark"),Fe(this,"name","mark"),Fe(this,"options"),Fe(this,"storage"),Fe(this,"config",{name:this.name}),this.config={...this.config,...e},this.name=this.config.name,this.config.addOptions&&(this.options=He(De(this,"addOptions",{name:this.name}))),this.storage=He(De(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(...e){return new r2(...e)}};const fD=/[\d-.]+(\w+)$/,pD=["px","rem","em","in","q","mm","cm","pt","pc","vh","vw","vmin","vmax"];function tr(t="0"){const e=t||"0",n=Number.parseFloat(e),r=(e.match(fD)?.[1]??"").toLowerCase();return[n,pD.includes(r)?r:null]}const o2=Qe.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseDOM:t=>t.style.color?.replace(/['"]+/g,""),renderDOM: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()}}}),i2=Qe.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseDOM:t=>t.style.fontFamily?.replace(/['"]+/g,""),renderDOM: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()}}}),s2=Qe.create({name:"fontSize",addOptions(){return{types:["textStyle","tableCell"],defaults:{value:12,unit:"pt",min:8,max:96}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseDOM:t=>t.style.fontSize,renderDOM:t=>{if(!t.fontSize)return{};let[e,n]=tr(t.fontSize);return Number.isNaN(e)?{}:(n=n||this.options.defaults.unit,{style:`font-size: ${e}${n}`})}}}}]},addCommands(){return{setFontSize:t=>({chain:e})=>{let[n,r]=tr(t);if(Number.isNaN(n))return!1;let{min:o,max:i,unit:s}=this.options.defaults;return n=el(n,o,i),r=r||s,e().setMark("textStyle",{fontSize:`${n}${r}`}).run()},unsetFontSize:()=>({chain:t})=>t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),a2=Qe.create({name:"textAlign",addOptions(){return{types:["heading","paragraph"],alignments:["left","center","right","justify"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseDOM:t=>{const e=t.style.textAlign||this.options.defaultAlignment;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderDOM:t=>t.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${t.textAlign==="both"?"justify":t.textAlign}`}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).every(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e)}},addShortcuts(){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")}}}),l2=Qe.create({name:"textIndent",addOptions(){return{types:["heading","paragraph"],defaults:{unit:"in",increment:.125}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textIndent:{default:null,parseDOM:t=>t.style.textIndent,renderDOM:t=>{if(!t.textIndent)return{};let[e,n]=tr(t.textIndent);return Number.isNaN(e)||!e?{}:(n=n||this.options.defaults.unit,{style:`margin-left: ${e}${n}`})}}}}]},addCommands(){return{setTextIndent:t=>({commands:e})=>t?this.options.types.map(n=>e.updateAttributes(n,{textIndent:t})).every(n=>n):!1,unsetTextIndent:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textIndent")).every(e=>e),increaseTextIndent:()=>({commands:t})=>this.options.types.map(e=>{let{textIndent:n}=this.editor.getAttributes(e);if(!n){let{increment:i,unit:s}=this.options.defaults;return t.updateAttributes(e,{textIndent:`${i}${s}`})}let[r,o]=tr(n);return r=r+this.options.defaults.increment,o=o||this.options.defaults.unit,Number.isNaN(r)?!1:t.updateAttributes(e,{textIndent:`${r}${o}`})}).every(e=>e),decreaseTextIndent:()=>({commands:t})=>this.options.types.map(e=>{let{textIndent:n}=this.editor.getAttributes(e);if(!n)return!1;let[r,o]=tr(n);return r=r-this.options.defaults.increment,o=o||this.options.defaults.unit,Number.isNaN(r)?!1:r<=0?t.unsetTextIndent():t.updateAttributes(e,{textIndent:`${r}${o}`})}).every(e=>e)}}}),c2=Qe.create({name:"lineHeight",addOptions(){return{types:["heading","paragraph"],defaults:{unit:""}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseDOM:t=>t.style.lineHeight,renderDOM:t=>{if(!t.lineHeight)return{};let[e,n]=tr(t.lineHeight);return Number.isNaN(e)?{}:(n=n||this.options.defaults.unit,{style:`line-height: ${e}${n}`})}}}}]},addCommands(){return{setLineHeight:t=>({commands:e})=>t?this.options.types.map(n=>e.updateAttributes(n,{lineHeight:t})).every(n=>n):!1,unsetLineHeight:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"lineHeight")).every(e=>e)}}}),u2=Qe.create({name:"formatCommands",addOptions(){return{}},addStorage(){return{storedStyle:null}},addCommands(){return{clearFormat:()=>({chain:t})=>t().clearNodes().unsetAllMarks().run(),clearMarksFormat:()=>({chain:t})=>t().unsetAllMarks().run(),clearNodesFormat:()=>({chain:t})=>t().clearNodes().run(),copyFormat:()=>({chain:t})=>{if(!this.storage.storedStyle){const i=Es(this.editor.state);return this.storage.storedStyle=i,!0}if(!this.storage.storedStyle.length)return this.storage.storedStyle=null,t().clearFormat().run();const e=this.storage.storedStyle,n=[];e.forEach(i=>{const{type:s,attrs:a}=i,{name:l}=s;l==="textStyle"?Object.keys(a).forEach(c=>{if(!a[c])return;const u={};u[c]=a[c],n.push({name:c,attrs:u})}):n.push({name:l,attrs:a})});const r={bold:["setBold","unsetBold"],italic:["setItalic","unsetItalic"],underline:["setUnderline","unsetUnderline"],color:["setColor","setColor",null],fontSize:["setFontSize","unsetFontSize"],fontFamily:["setFontFamily","unsetFontFamily"]};let o=t();return Object.keys(r).forEach(i=>{const[s,a,l]=r[i],c=n.find(f=>f.name===i),u=c?.attrs&&c?.attrs[i];let d={};!c&&!u?d={command:a,argument:l}:d={command:s,argument:c.attrs[i]||l},o=o[d.command](d.argument)}),this.storage.storedStyle=null,o}}},addShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.clearFormat()}}});function hD(t={}){return new Ze({view(e){return new mD(e,t)}})}class mD{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let i=s=>{this[o](s)};return e.dom.addEventListener(o,i),{name:o,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let 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(),d=a?u.bottom:u.top;a&&l&&(d=(d+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:d-this.width/2,bottom:d+this.width/2}}}}if(!r){let a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let o=this.editorView.dom.offsetParent;this.element||(this.element=o.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let i,s;if(!o||o==document.body&&getComputedStyle(o).position=="static")i=-pageXOffset,s=-pageYOffset;else{let a=o.getBoundingClientRect();i=a.left-o.scrollLeft,s=a.top-o.scrollTop}this.element.style.left=r.left-i+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),o=r&&r.type.spec.disableDropCursor,i=typeof o=="function"?o(this.editorView,n,e):o;if(n&&!i){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=$w(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 d2=Qe.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:2,class:void 0}},addPmPlugins(){return[hD(this.options)]}});class st extends Re{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return st.valid(r)?new st(r):Re.near(r)}content(){return ve.empty}eq(e){return e instanceof st&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new st(e.resolve(n.pos))}getBookmark(){return new Zf(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!gD(e)||!yD(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&st.valid(e))return e;let o=e.pos,i=null;for(let s=e.depth;;s--){let a=e.node(s);if(n>0?e.indexAfter(s)<a.childCount:e.index(s)>0){i=a.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;o+=n;let l=e.doc.resolve(o);if(st.valid(l))return l}for(;;){let s=n>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!Ne.isSelectable(i)){e=e.doc.resolve(o+i.nodeSize*n),r=!1;continue e}break}i=s,o+=n;let a=e.doc.resolve(o);if(st.valid(a))return a}return null}}}st.prototype.visible=!1;st.findFrom=st.findGapCursorFrom;Re.jsonID("gapcursor",st);class Zf{constructor(e){this.pos=e}map(e){return new Zf(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return st.valid(n)?new st(n):Re.near(n)}}function gD(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function yD(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function bD(){return new Ze({props:{decorations:kD,createSelectionBetween(t,e,n){return e.pos==n.pos&&st.valid(n)?new st(n):null},handleClick:vD,handleKeyDown:wD,handleDOMEvents:{beforeinput:xD}}})}const wD=Pf({ArrowLeft:Us("horiz",-1),ArrowRight:Us("horiz",1),ArrowUp:Us("vert",-1),ArrowDown:Us("vert",1)});function Us(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,i){let s=r.selection,a=e>0?s.$to:s.$from,l=s.empty;if(s instanceof Le){if(!i.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=st.findGapCursorFrom(a,e,l);return c?(o&&o(r.tr.setSelection(new st(c))),!0):!1}}function vD(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!st.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&Ne.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new st(r))),!0)}function xD(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof st))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let o=be.empty;for(let s=r.length-1;s>=0;s--)o=be.from(r[s].createAndFill(null,o));let i=t.state.tr.replace(n.pos,n.pos,new ve(o,0,0));return i.setSelection(Le.near(i.doc.resolve(n.pos+1))),t.dispatch(i),!1}function kD(t){if(!(t.selection instanceof st))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",qe.create(t.doc,[Pe.widget(t.selection.head,e,{key:"gapcursor"})])}const SD=Qe.create({name:"gapCursor",addPmPlugins(){return[bD()]},extendNodeSchema(t){return{allowGapCursor:He(De(t,"allowGapCursor",{name:t.name,options:t.options,storage:t.storage}))??null}}}),CD=new et("collaboration"),ED=Qe.create({name:"collaboration",priority:1e3,addOptions(){return{ydoc:null,field:"supereditor",fragment:null,isReady:!1}},addPmPlugins(){if(!this.editor.options.ydoc)return[];this.options.ydoc=this.editor.options.ydoc;const t=$D();TD(this.options.ydoc,this.editor),OD(this.options.ydoc,this.editor,this);const[e,n]=AD(this.options.ydoc,this.editor);this.options.fragment=n;const r=this.options.ydoc.getMap("media");return r.observe(o=>{o.changes.keys.forEach((i,s)=>{if(!(s in this.editor.storage.image.media)){const a=r.get(s);this.editor.storage.image.media[s]=a}})}),[e,t]},addCommands(){return{undo:()=>({tr:t,state:e,dispatch:n})=>(t.setMeta("preventDispatch",!0),t.setMeta("inputType","historyUndo"),Ar.getState(e).undoManager.undoStack.length===0?!1:n?u6(e):!0),redo:()=>({tr:t,state:e,dispatch:n})=>(t.setMeta("preventDispatch",!0),t.setMeta("inputType","historyRedo"),Ar.getState(e).undoManager.redoStack.length===0?!1:n?d6(e):!0),addImageToCollaboration:({mediaPath:t,fileData:e})=>()=>{this.options.ydoc&&this.options.ydoc.getMap("media").set(t,e)}}},addShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Shift-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo()}}}),AD=(t,e)=>{const n=t.getXmlFragment("supereditor");return[W4(n,{onFirstRender:()=>{if(!e.options.isNewFile)return;const r=t.getMap("meta");r.set("docx",e.options.content),r.set("fonts",e.options.fonts)}}),n]},$D=()=>h6(),TD=(t,e)=>{const n=t.getMap("meta");n.observe(r=>{const o=n.get("lockedBy"),i=n.get("locked");if(!e.options.user||!o)return;const s=o?.email!==e.options.user?.email,a=e.options.editable!==!i;!s||!a||(i?console.debug("--- Locking editor ---",o,e.options.user):console.debug("--- Unlocking editor ---",o),e.setEditable(!i),e.emit("locked",{editor:e,isLocked:i,lockedBy:o}))})},OD=(t,e,n)=>{const r=e.options.collaborationProvider;if(!r)return;const o=()=>{n.options.isReady=!0,r.off("synced",o),e.emit("collaborationReady",{editor:e,ydoc:t})};if(r.synced){setTimeout(()=>{o()},250);return}r.on("synced",o)},DD=Qe.create({name:"collaborationCursor",priority:999,addOptions(){return{provider:null,user:{name:null,color:null}}},addStorage(){return{users:[]}},addPmPlugins(){const{collaborationProvider:t=null}=this.editor.options;return t?[c6(t.awareness,{cursorBuilder:MD})]:[]}}),MD=t=>{const e=document.createElement("span");e.classList.add("ProseMirror-yjs-cursor"),e.setAttribute("style",`border-color: ${t.color}`);const n=document.createElement("div");return n.setAttribute("style",`background-color: ${t.color}`),n.insertBefore(document.createTextNode(t.name||t.email),null),e.insertBefore(n,null),e},f2=rt.create({name:"doc",topNode:!0,content:"block+",parseDOM(){return[{tag:"doc"}]},renderDOM(){return["doc",0]},addAttributes(){return{attributes:{rendered:!1}}}}),p2=rt.create({name:"text",group:"inline",inline:!0}),_D=rt.create({name:"run",group:"inline",content:"text*",inline:!0,parseDOM(){return[{tag:"run"}]},renderDOM(){return["run",0]},addAttributes(){return{attributes:{rendered:!1}}}});function tl(t){return new T6({match:t.match,handler:({state:e,range:n,match:r,chain:o})=>{const i=He(t.getAttributes,null,r)||{},s=e.tr.delete(n.from,n.to),a=s.doc.resolve(n.from).blockRange(),l=a&&kw(a,t.type,i);if(!l)return null;if(s.wrap(a,l),t.keepMarks&&t.editor){const{selection:u,storedMarks:d}=e,{splittableMarks:f}=t.editor.extensionService,p=d||u.$to.parentOffset&&u.$from.marks();if(p){const h=p.filter(m=>f.includes(m.type.name));s.ensureMarks(h)}}if(t.keepAttributes){const u=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":t.type.name;o().updateAttributes(u,i).run()}const c=s.doc.resolve(n.from-1).nodeBefore;c&&c.type===t.type&&_r(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,c))&&s.join(n.from-1)}})}const oy=/^\s*([-+*])\s$/,h2=rt.create({name:"bulletList",group:"block list",content(){return`${this.options.itemTypeName}+`},addOptions(){return{itemTypeName:"listItem",htmlAttributes:{},keepMarks:!0,keepAttributes:!1}},parseDOM(){return[{tag:"ul"}]},renderDOM({htmlAttributes:t}){return["ul",Me.mergeAttributes(this.options.htmlAttributes,t),0]},addAttributes(){return{"list-style-type":{default:"bullet",rendered:!1},attributes:{rendered:!1,keepOnSplit:!0}}},addCommands(){return{toggleBulletList:()=>t=>{const{commands:e,chain:n}=t,r=Wf("bulletList");return console.debug("[bulletList] Toggling bullet list",r),e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks,r)}}},addShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=tl({match:oy,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=tl({match:oy,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes("textStyle"),editor:this.editor})),[t]}});function ND(t={}){return new Ze({key:new et("orderedListSync"),appendTransaction:(e,n,r)=>{if(!(e.some(l=>l.docChanged)&&!n.doc.eq(r.doc)))return;let{doc:o,tr:i}=r,s={};if(o.descendants((l,c)=>{if(l.type.name==="orderedList"&&l.attrs.syncId){let u=l.attrs.syncId;s[u]||(s[u]=[]),s[u].push({node:l,pos:c})}}),!Object.keys(s).length)return;let a=!1;return Object.entries(s).forEach(([l,c])=>{if(c.length<2){let[f]=c;i.setNodeMarkup(f.pos,void 0,{...f.node.attrs,syncId:null}),a=!0;return}let[u]=c,d=u.node.attrs.order;c.forEach((f,p)=>{if(p===0)return;let{node:h,pos:m}=f,y=c[p-1],g=d+y.node.childCount;h.attrs.order!==g&&(i.setNodeMarkup(m,void 0,{...h.attrs,order:g}),a=!0),d=g})}),a?i:null}})}function ID(t={}){return new Ze({key:new et("orderedListMarker"),appendTransaction:(e,n,r)=>{if(!(e.some(l=>l.docChanged)&&!n.doc.eq(r.doc)))return;let{doc:o,tr:i}=r,s=FD(r);if(!s.size)return;let a=!1;return Array.from(s).forEach(([l,c])=>{let u=c,d=l.type.name==="bulletList";l.attrs.syncId;let f=l.childCount!==u.length;if(d){u.forEach(g=>RD(i,g)),a=!0;return}if(f){let g=BD({state:r,list:l});g.length&&(u=g)}let p=u[0],h=LD({state:r,listItems:u}),m=m2(),y={lvlText:p.node.attrs.lvlText??m.lvlText,listLevel:p.node.attrs.listLevel??m.listLevel,listNumberingType:p.node.attrs.listNumberingType??m.listNumberingType};y.lvlText===h.lvlText&&y.listNumberingType===h.listNumberingType&&iy(y.listLevel,h.listLevel)||(i.setNodeMarkup(p.pos,void 0,{...p.node.attrs,...h}),a=!0,y=h),u.forEach((g,x)=>{if(x===0)return;let{node:k,pos:w}=g,{lvlText:T,listLevel:D,listNumberingType:M}=k.attrs,F=[...y.listLevel.slice(0,-1),y.listLevel.at(-1)+1];if(!(T===y.lvlText&&M===y.listNumberingType&&iy(D,F))){let{selection:C,storedMarks:U}=r,ie=U||C.$to.parentOffset&&C.$from.marks();i.setNodeMarkup(w,void 0,{...k.attrs,listLevel:F,lvlText:y.lvlText,listNumberingType:y.listNumberingType}),ie&&i.ensureMarks(ie),a=!0}y={...y,listLevel:F}})}),a?i:null}})}function FD(t){let{doc:e}=t,n=new Map;return e.descendants((r,o)=>{let{attrs:i}=r,s=r.type.name==="listItem",a=!!i.listLevel?.length,l=!!i.lvlText,c=i.listNumberingType&&i.listNumberingType!=="bullet";if(s&&a&&l&&c){let u=e.resolve(o).parent;n.get(u)||n.set(u,[]),n.get(u).push({node:r,pos:o})}}),n}function BD({state:t,list:e}){let{doc:n}=t,r=[];return n.descendants((o,i)=>{let s=o.type.name==="listItem",a=n.resolve(i);s&&a.parent===e&&r.push({node:o,pos:i})}),r}function m2({lvlText:t="",listLevel:e=[],listNumberingType:n="decimal"}={}){return{lvlText:t,listLevel:e,listNumberingType:n}}function RD(t,e){let{pos:n,node:r}=e;t.setNodeMarkup(n,void 0,{...r.attrs,lvlText:null,listLevel:null,listNumberingType:null})}function iy(t,e){return t.length===e.length&&t.every((n,r)=>n===e[r])}function LD({state:t,listItems:e}){let{doc:n}=t,r=e[0],{lvlText:o,listLevel:i,listNumberingType:s}=r.node.attrs,a=m2({lvlText:"%1.",listLevel:[1],listNumberingType:"decimal"}),l=(n.resolve(r.pos).depth-1)/2;if(!(o&&i?.length&&s))({lvlText:o,listLevel:i,listNumberingType:s}=a);else{let c=l>0;c&&l>=3?{lvlText:o,listLevel:i,listNumberingType:s}=a:c&&l<3&&(i=[...i.slice(0,-1),1])}return{lvlText:o,listLevel:i,listNumberingType:s}}const sy=/^(\d+)\.\s$/,g2=rt.create({name:"orderedList",group:"block list",content(){return`${this.options.itemTypeName}+`},addOptions(){return{itemTypeName:"listItem",htmlAttributes:{},keepMarks:!0,keepAttributes:!1,listStyleTypes:["decimal","lowerAlpha","lowerRoman"]}},addAttributes(){return{order:{default:1,parseDOM:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1,renderDOM:t=>({start:t.order})},syncId:{default:null,parseDOM:t=>t.getAttribute("data-sync-id"),renderDOM:t=>t.syncId?{"data-sync-id":t.syncId}:{}},"list-style-type":{default:"decimal",renderDOM:t=>{let e=t["list-style-type"];return e?(e==="lowerLetter"&&(e="lowerAlpha"),{style:`list-style-type: ${tE(e)};`}):{}}},attributes:{rendered:!1,keepOnSplit:!0}}},parseDOM(){return[{tag:"ol"}]},renderDOM({htmlAttributes:t}){const{start:e,...n}=t;return e===1?["ol",Me.mergeAttributes(this.options.htmlAttributes,n),0]:["ol",Me.mergeAttributes(this.options.htmlAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t})=>{const e=Wf("orderedList");return t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks,e)},updateOrderedListStyleType:()=>({dispatch:t,state:e,tr:n})=>{let r=Bn(o=>o.type.name===this.name)(e.selection);if(!r)return!0;if(t){let o=(r.depth-1)/2,i=this.options.listStyleTypes,s=i[o%i.length],a=r.node.attrs["list-style-type"],l=n.doc.nodeAt(r.pos);a!==s&&l.eq(r.node)&&n.setNodeMarkup(r.pos,void 0,{...r.node.attrs,"list-style-type":s})}return!0},liftEmptyBlockAndContinueListOrder:()=>({editor:t,dispatch:e,state:n,tr:r,commands:o})=>{let i=Bn(d=>d.type.name===this.name)(n.selection);if(!i)return!1;let s=t.can().liftEmptyBlock(),a=i.depth===1,l=i.node.childCount===1,c=n.selection.$from.node(-1),u=i.node.lastChild.eq(c);if(!(s&&a&&!l&&!u))return!1;if(e){let d=i.pos;if(!o.liftEmptyBlock(n,e))return!1;let{$from:f}=r.selection,p=r.doc.nodeAt(d),h=f.after(),m=r.doc.nodeAt(h),y=p?.type.name===this.name,g=m?.type.name===this.name;if(y&&g){let x=p.attrs.order||1,k=p.childCount,w=p.attrs.syncId,T=k+x,D=w||PD();r.setNodeMarkup(h,void 0,{...m.attrs,order:T,syncId:D}),w||r.setNodeMarkup(d,void 0,{...p.attrs,syncId:D})}}return!0}}},addShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList(),Enter:()=>this.editor.commands.liftEmptyBlockAndContinueListOrder()}},addPmPlugins(){return[ID(),ND()]},addInputRules(){let t=tl({match:sy,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=tl({match:sy,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes("textStyle")}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}});function PD(){return Math.floor(Math.random()*4294967295).toString()}const zD=({listLevel:t,lvlText:e,listNumberingType:n})=>{const r=UD[n];return r?r(t,e):null},jD=(t,e)=>Qf(t,e,String),y2=(t,e)=>Qf(t,e,WD),qD=(t,e)=>y2(t,e).toLowerCase(),VD=(t,e)=>b2(t,e).toLowerCase(),b2=(t,e)=>Qf(t,e,n=>GD(n)),UD={decimal:jD,lowerRoman:qD,upperRoman:y2,lowerLetter:VD,upperLetter:b2},HD=(t,e)=>t.reduce((n,r,o)=>n.replace(`%${o+1}`,r),e),Qf=(t,e,n)=>{const r=t.map(n);return HD(r,e)},WD=t=>{const e=[{value:1e3,numeral:"M"},{value:900,numeral:"CM"},{value:500,numeral:"D"},{value:400,numeral:"CD"},{value:100,numeral:"C"},{value:90,numeral:"XC"},{value:50,numeral:"L"},{value:40,numeral:"XL"},{value:10,numeral:"X"},{value:9,numeral:"IX"},{value:5,numeral:"V"},{value:4,numeral:"IV"},{value:1,numeral:"I"}];let n="";for(const{value:r,numeral:o}of e)for(;t>=r;)n+=o,t-=r;return n},GD=t=>{let e="";const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(;t>0;){let r=(t-1)%26;e=n[r]+e,t=Math.floor((t-1)/26)}return e};function KD(t={}){return new Ze({key:new et("styledListMarker"),state:{init(e,n){const r=[...ay(n),...ly(n)];return qe.create(n.doc,r)},apply(e,n,r,o){if(!e.docChanged)return n;const i=[...ay(o),...ly(o)];return qe.create(o.doc,i)}},props:{decorations(e){return this.getState(e)}}})}function ay(t){let{doc:e,storedMarks:n}=t,r=[],o=Gf(e,i=>i.type.name==="listItem");return o.length&&o.forEach(({node:i,pos:s})=>{let a=[],l=ir("textStyle",e.type.schema);if(JD(i)&&n){let m=n.filter(y=>y.type===l);a.push(...m)}else{let m=XD(i,e,l);a.push(...m)}let c=null,u=null;a.forEach(m=>{let{attrs:y}=m;if(y.fontSize&&!c){let[g,x]=tr(y.fontSize);Number.isNaN(g)||(x=x??"pt",c=`${g}${x}`)}y.fontFamily&&!u&&(u=y.fontFamily)});let d={style:`--marker-font-size: ${c??"initial"}`},f={style:`--marker-font-family: ${u??"initial"}`},p=Me.mergeAttributes(d,f),h=Pe.node(s,s+i.nodeSize,p);r.push(h)}),r}function ly(t){let{doc:e}=t,n=[],r=Gf(e,o=>o.type.name==="listItem");return r.length&&r.forEach(({node:o,pos:i})=>{let s={};if(o.attrs.spacing){const{lineSpaceBefore:l,lineSpaceAfter:c,line:u}=o.attrs.spacing;s={style:`
38
- ${l?`margin-top: ${l}px;`:""}
39
- ${c?`margin-bottom: ${c}px;`:""}
40
- ${u?`line-height: ${u};`:""}
41
- `.trim()}}let a=Pe.node(i,i+o.nodeSize,s);n.push(a)}),n}function XD(t,e,n){let r=[];return t.forEach(o=>{o.type.name==="paragraph"&&o.forEach(i=>{let s=i.type.name==="text",a=n.isInSet(i.marks);if(s&&a){let l=i.marks.filter(c=>c.type===n);r.push(...l)}})}),r}function JD(t){return t.childCount===1&&t.firstChild?.type.name==="paragraph"&&t.firstChild?.content.size===0}const w2=rt.create({name:"listItem",content:"paragraph* block*",defining:!0,priority:101,addOptions(){return{htmlAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},parseDOM(){return[{tag:"li"}]},renderDOM({htmlAttributes:t}){return["li",Me.mergeAttributes(this.options.htmlAttributes,t),0]},addAttributes(){return{markerType:{default:null,renderDOM:t=>{let{listLevel:e,listNumberingType:n,lvlText:r}=t;if(!e?.length||!r)return{};let o=zD({listLevel:e,lvlText:r,listNumberingType:n});return o?{"data-marker-type":o}:{}}},lvlText:{default:null,rendered:!1},listNumberingType:{default:null,rendered:!1},listLevel:{default:null,rendered:!1},lvlJc:{default:null,rendered:!1},listParagraphProperties:{default:null,rendered:!1},listRunProperties:{default:null,rendered:!1},numId:{default:null,rendered:!1},attributes:{rendered:!1},spacing:{default:null,rendered:!1}}},addShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Enter":()=>this.editor.commands.first(({commands:t})=>[()=>t.createParagraphNear(),()=>t.splitBlock()]),Tab:()=>this.editor.chain().sinkListItem(this.name).updateOrderedListStyleType().run(),"Shift-Tab":()=>this.editor.chain().liftListItem(this.name).updateOrderedListStyleType().run()}},addPmPlugins(){return[KD()]}}),va=new et("linkedStyles"),YD=Qe.create({name:"linkedStyles",addPmPlugins(){return[ZD(this.editor)]},addCommands(){return{setLinkedStyle:t=>e=>{if(!t)return;const{tr:n}=e,r=n.selection,{from:o,to:i}=r;if(o===i)return;let s=o,a=n.doc.nodeAt(o);if(a.type.name!=="paragraph"){const l=Bn(c=>c.type.name==="paragraph")(n.selection)||{};s=l.pos,a=l.node}n.setNodeMarkup(s,void 0,{...a.attrs,styleId:t.id})}}}}),ZD=t=>new Ze({key:va,state:{init(e,{doc:n,selection:r}){if(!t.converter||t.options.mode!=="docx")return{};const o=t.converter?.linkedStyles||[];return{styles:o,decorations:cy(t.state?.doc,o)}},apply(e,n,r,o){if(!t.converter||t.options.mode!=="docx")return{...n};let i=n.decorations||qe.empty;if(e.docChanged){const s=va.getState(t.state).styles;i=cy(o.doc,s)}return{...n,decorations:i}}},props:{decorations(e){return va.getState(e)?.decorations}}}),cy=(t,e)=>{const n=[];let r=null;return t.descendants((o,i)=>{const{name:s}=o.type;if(o?.attrs?.styleId&&(r=o.attrs.styleId),s==="paragraph"&&!o.attrs?.styleId&&(r=null),s!=="text")return;const a=QD(r,e);if(!a)return;const l=v2(a,o);if(!l)return;const c=Pe.inline(i,i+o.nodeSize,{style:l});n.push(c)}),qe.create(t,n)},v2=(t,e,n=!0)=>{if(!t?.definition?.styles)return"";const r={};return Object.entries(t.definition.styles).forEach(([o,i])=>{const s=Ba(o),a=[];if(e?.marks?.forEach(l=>{if(l.type.name==="textStyle"){Object.entries(l.attrs).forEach(([c,u])=>{const d=Ba(c);u&&a.push({key:d,value:u})});return}a.push({key:l.type.name,value:l.attrs[s]})}),!a.find(l=>l.key===s))if(s==="spacing"&&n){const l=eM(i);Object.entries(l).forEach(([c,u])=>{r[c]=u})}else if(s==="indent"&&n){const{leftIndent:l,rightIndent:c,firstLine:u}=i;l&&(r["margin-left"]=l+"px"),c&&(r["margin-right"]=c+"px"),u&&(r["text-indent"]=u+"px")}else s==="bold"?r["font-weight"]="bold":r[s]=i}),Object.entries(r).map(([o,i])=>`${o}: ${i}`).join(";")},QD=(t,e=[])=>e.find(n=>n.id===t),eM=t=>{const{lineSpaceBefore:e,lineSpaceAfter:n,line:r,lineRule:o}=t;return{"margin-top":e+"px","margin-bottom":n+"px","line-height":r}},tM=t=>{const{lineSpaceBefore:e,lineSpaceAfter:n,line:r,lineRule:o}=t;return`
42
- ${e?`margin-top: ${e}px;`:""}
43
- ${n?`margin-bottom: ${n}px;`:""}
44
- ${r?`line-height: ${r};`:""}
45
- `.trim()},nM=t=>{let e="";for(const n of t)switch(n.type){case"bold":e+="font-weight: bold; ";break;case"italic":e+="font-style: italic; ";break;case"underline":e+="text-decoration: underline; ";break;case"highlight":e+=`background-color: ${n.attrs.color}; `;break;case"textStyle":const{fontFamily:r,fontSize:o}=n.attrs;e+=`${r?`font-family: ${r};`:""} ${o?`font-size: ${o};`:""}`}return e.trim()},x2=t=>t?.converter?(t.converter.linkedStyles||[]).filter(e=>e.type==="paragraph"&&e.definition.attrs).sort((e,n)=>e.definition.attrs?.name.localeCompare(n.definition.attrs?.name)):[],k2=rt.create({name:"paragraph",priority:1e3,group:"block",content:"inline*",inline:!1,addOptions(){return{htmlAttributes:{}}},addAttributes(){return{spacing:{renderDOM:t=>{const{spacing:e}=t;if(!e)return{};const n=tM(e);return n?{style:n}:{}}},extraAttrs:{default:{},parseHTML:t=>{const e={};return Array.from(t.attributes).forEach(n=>{e[n.name]=n.value}),e},renderDOM:t=>t.extraAttrs||{}},marksAttrs:{renderDOM:t=>{const{marksAttrs:e}=t;if(!e?.length)return{};const n=nM(e);return n?{style:n}:{}}},indent:{renderDOM:({indent:t})=>{if(!t)return{};const{left:e,right:n,firstLine:r,hanging:o}=t;let i="";return e&&(i+=`margin-left: ${e}px;`),n&&(i+=`margin-right: ${n}px;`),r&&!o&&(i+=`text-indent: ${r}px;`),r&&o&&(i+=`text-indent: ${r-o}px;`),!r&&o&&(i+=`text-indent: ${-o}px;`),{style:i}}},styleId:{rendered:!1},attributes:{rendered:!1},filename:{rendered:!1},rsidRDefault:{rendered:!1},keepLines:{rendered:!1},keepNext:{rendered:!1}}},parseDOM(){return[{tag:"p",getAttrs:t=>{let e={};return Array.from(t.attributes).forEach(n=>{e[n.name]=n.value}),{extraAttrs:e}}}]},renderDOM({htmlAttributes:t}){return["p",Me.mergeAttributes(this.options.htmlAttributes,t),0]}}),S2=rt.create({name:"heading",group:"block",content:"inline*",defining:!0,addOptions(){return{levels:[1,2,3,4,5,6],htmlAttributes:{}}},addAttributes(){return{level:{default:1,rendered:!1}}},parseDOM(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderDOM({node:t,htmlAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Me.mergeAttributes(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}},addShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})}}),rM=rt.create({name:"commentRangeStart",group:"inline",inline:!0,atom:!0,selectable:!1,draggable:!1,parseDOM(){return[{tag:"commentRangeStart"}]},addOptions(){return{htmlAttributes:{contentEditable:"false"}}},renderDOM({htmlAttributes:t}){return["commentRangeStart",Me.mergeAttributes(this.options.htmlAttributes,t)]},addAttributes(){return{"w:id":{rendered:!1},internal:{default:!0,rendered:!1}}}}),oM=rt.create({name:"commentRangeEnd",group:"inline",inline:!0,atom:!0,selectable:!1,draggable:!1,addOptions(){return{htmlAttributes:{contentEditable:"false"}}},parseDOM(){return[{tag:"commentRangeEnd"}]},renderDOM({htmlAttributes:t}){return["commentRangeEnd",Me.mergeAttributes(this.options.htmlAttributes,t)]},addAttributes(){return{"w:id":{rendered:!1}}}}),iM=rt.create({name:"commentReference",group:"inline",inline:!0,atom:!0,selectable:!1,draggable:!1,addOptions(){return{htmlAttributes:{contentEditable:"false"}}},parseDOM(){return[{tag:"commentReference"}]},renderDOM({htmlAttributes:t}){return["commentReference",Me.mergeAttributes(this.options.htmlAttributes,t)]},addAttributes(){return{attributes:{rendered:!1}}}}),sM=wn.create({name:nn,group:"comments",excludes:"",addOptions(){return{htmlAttributes:{class:"super-editor-comment"}}},addAttributes(){return{commentId:{},importedId:{},internal:{default:!0,rendered:!1}}},parseDOM(){return[{tag:nn}]},renderDOM({htmlAttributes:t}){return[nn,Me.mergeAttributes(this.options.htmlAttributes,t)]}}),aM=rt.create({name:"tab",group:"inline",inline:!0,content:"inline*",selectable:!1,atom:!0,addOptions(){return{htmlAttributes:{class:"tab",contentEditable:!1}}},parseDOM(){return[{tag:"span.tab"}]},renderDOM({htmlAttributes:t}){return["span",Me.mergeAttributes(this.options.htmlAttributes,t),0]},addAttributes(){return{tabSize:{renderDOM:({tabSize:t})=>t?{style:`width: ${t}px;`}:{}}}},addPmPlugins(){const{view:t}=this.editor;return[new Ze({name:"tabPlugin",key:new et("tabPlugin"),state:{init(e,n){let r=uy(n,t);return qe.create(n.doc,r)},apply(e,n,r,o){const i=uy(o,t);return qe.create(o.doc,i)}},props:{decorations(e){return this.getState(e)}}})]}}),uu=48,uy=(t,e)=>{let n=[];return t.doc.descendants((r,o)=>{if(r.type.name==="tab"){let i=t.doc.resolve(o);const s=i.nodeBefore?.nodeSize||0;let a=0;try{t.doc.nodesBetween(o-s-1,o-1,(u,d)=>{if(u.isText&&u.textContent!==" "){const f=lM(e,d);a+=f}})}catch{return}const l=i.nodeBefore?.type.name==="tab"?uu:uu-a%uu,c=cM(i);n.push(Pe.node(o,o+r.nodeSize,{style:`width: ${l}px; height: ${c};`}))}}),n};function lM(t,e){const n=t.nodeDOM(e);if(n){const r=document.createRange();return r.selectNodeContents(n),r.getBoundingClientRect().width}return 0}function cM(t){const e=t.node(1).firstChild.marks.find(n=>n.type.name==="textStyle");return`${(parseInt(e?.attrs.fontSize)*1.333||16)*1.1}px`}const C2=rt.create({name:"lineBreak",group:"inline",inline:!0,parseDOM(){return[{tag:"br"}]},renderDOM(){return["br",{},0]}}),E2=rt.create({name:"hardBreak",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions(){return{htmlAttributes:{contentEditable:"false",lineBreakType:"page"}}},parseDOM(){return[{tag:"span"}]},renderDOM({htmlAttributes:t}){return["span",Me.mergeAttributes(this.options.htmlAttributes,t)]}}),Td=(t,e)=>e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`],uM=({editor:t})=>class{constructor(e,n){Fe(this,"editor"),Fe(this,"node"),Fe(this,"dom"),Fe(this,"table"),Fe(this,"colgroup"),Fe(this,"contentDOM"),Fe(this,"cellMinWidth"),this.editor=t,this.node=e,this.cellMinWidth=n,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")),fy(this.editor,this.node,this.table),dy(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,fy(this.editor,e,this.table),dy(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}};function dy(t,e,n,r,o,i){let s=0,a=!0,l=e.firstChild;const c=t.firstChild;if(c!==null)for(let u=0,d=0;u<c.childCount;u++){const{colspan:f,colwidth:p}=c.child(u).attrs;for(let h=0;h<f;h++,d++){const m=o===d?i:p&&p[h],y=m?`${m}px`:"";if(s+=m||r,m||(a=!1),l){if(l.style.width!==y){const[g,x]=Td(r,m);l.style.setProperty(g,x)}l=l.nextSibling}else{const g=document.createElement("col"),[x,k]=Td(r,m);g.style.setProperty(x,k),e.appendChild(g)}}}for(;l;){const u=l.nextSibling;l.parentNode?.removeChild(l),l=u}a?(n.style.width=`${s}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${s}px`)}function fy(t,e,n){const r=t.extensionService.attributes.filter(i=>i.type==="table"),o=Me.getAttributesToRender(e,r);Object.entries(o).forEach(([i,s])=>{n.setAttribute(i,s)})}const py=(t,e=null)=>e?t.createChecked(null,e):t.createAndFill(),A2=({size:t=.66665,color:e="#000000"}={})=>({top:{size:t,color:e},left:{size:t,color:e},bottom:{size:t,color:e},right:{size:t,color:e},insideH:{size:t,color:e},insideV:{size:t,color:e}}),dM=(t,e,n,r,o=null)=>{const i={table:ht("table",t),tableRow:ht("tableRow",t),tableCell:ht("tableCell",t),tableHeader:ht("tableHeader",t)},s=[],a=[];for(let u=0;u<n;u++){const d=py(i.tableCell,o);if(d&&a.push(d),r){const f=py(i.tableHeader,o);f&&s.push(f)}}const l=[];for(let u=0;u<e;u++){const d=r&&u===0?s:a;l.push(i.tableRow.createChecked(null,d))}const c=A2();return i.table.createChecked({borders:c},l)},fM=(t,e,n,r)=>{let o=0,i=!0;const s=[],a=t.firstChild;if(!a)return{};for(let u=0,d=0;u<a.childCount;u++){const{colspan:f,colwidth:p}=a.child(u).attrs;for(let h=0;h<f;h++,d++){const m=n===d?r:p&&p[h];o+=m||e,m||(i=!1);const[y,g]=Td(e,m);s.push(["col",{style:`${y}: ${g}`}])}}const l=i?`${o}px`:"",c=i?"":`${o}px`;return{colgroup:["colgroup",{},...s],tableWidth:l,tableMinWidth:c}};var Od,Dd;if(typeof WeakMap<"u"){let t=new WeakMap;Od=e=>t.get(e),Dd=(e,n)=>(t.set(e,n),n)}else{const t=[];let e=0;Od=n=>{for(let r=0;r<t.length;r+=2)if(t[r]==n)return t[r+1]},Dd=(n,r)=>(e==10&&(e=0),t[e++]=n,t[e++]=r)}var at=class{constructor(e,n,r,o){this.width=e,this.height=n,this.map=r,this.problems=o}findCell(e){for(let n=0;n<this.map.length;n++){const r=this.map[n];if(r!=e)continue;const o=n%this.width,i=n/this.width|0;let s=o+1,a=i+1;for(let l=1;s<this.width&&this.map[n+l]==r;l++)s++;for(let l=1;a<this.height&&this.map[n+this.width*l]==r;l++)a++;return{left:o,top:i,right:s,bottom:a}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let n=0;n<this.map.length;n++)if(this.map[n]==e)return n%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,n,r){const{left:o,right:i,top:s,bottom:a}=this.findCell(e);return n=="horiz"?(r<0?o==0:i==this.width)?null:this.map[s*this.width+(r<0?o-1:i)]:(r<0?s==0:a==this.height)?null:this.map[o+this.width*(r<0?s-1:a)]}rectBetween(e,n){const{left:r,right:o,top:i,bottom:s}=this.findCell(e),{left:a,right:l,top:c,bottom:u}=this.findCell(n);return{left:Math.min(r,a),top:Math.min(i,c),right:Math.max(o,l),bottom:Math.max(s,u)}}cellsInRect(e){const n=[],r={};for(let o=e.top;o<e.bottom;o++)for(let i=e.left;i<e.right;i++){const s=o*this.width+i,a=this.map[s];r[a]||(r[a]=!0,!(i==e.left&&i&&this.map[s-1]==a||o==e.top&&o&&this.map[s-this.width]==a)&&n.push(a))}return n}positionAt(e,n,r){for(let o=0,i=0;;o++){const s=i+r.child(o).nodeSize;if(o==e){let a=n+e*this.width;const l=(e+1)*this.width;for(;a<l&&this.map[a]<i;)a++;return a==l?s-1:this.map[a]}i=s}}static get(e){return Od(e)||Dd(e,pM(e))}};function pM(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=hM(t),n=t.childCount,r=[];let o=0,i=null;const s=[];for(let c=0,u=e*n;c<u;c++)r[c]=0;for(let c=0,u=0;c<n;c++){const d=t.child(c);u++;for(let h=0;;h++){for(;o<r.length&&r[o]!=0;)o++;if(h==d.childCount)break;const m=d.child(h),{colspan:y,rowspan:g,colwidth:x}=m.attrs;for(let k=0;k<g;k++){if(k+c>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:u,n:g-k});break}const w=o+k*e;for(let T=0;T<y;T++){r[w+T]==0?r[w+T]=u:(i||(i=[])).push({type:"collision",row:c,pos:u,n:y-T});const D=x&&x[T];if(D){const M=(w+T)%e*2,F=s[M];F==null||F!=D&&s[M+1]==1?(s[M]=D,s[M+1]=1):F==D&&s[M+1]++}}}o+=y,u+=m.nodeSize}const f=(c+1)*e;let p=0;for(;o<f;)r[o++]==0&&p++;p&&(i||(i=[])).push({type:"missing",row:c,n:p}),u++}(e===0||n===0)&&(i||(i=[])).push({type:"zero_sized"});const a=new at(e,n,r,i);let l=!1;for(let c=0;!l&&c<s.length;c+=2)s[c]!=null&&s[c+1]<n&&(l=!0);return l&&mM(a,s,t),a}function hM(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const o=t.child(r);let i=0;if(n)for(let s=0;s<r;s++){const a=t.child(s);for(let l=0;l<a.childCount;l++){const c=a.child(l);s+c.attrs.rowspan>r&&(i+=c.attrs.colspan)}}for(let s=0;s<o.childCount;s++){const a=o.child(s);i+=a.attrs.colspan,a.attrs.rowspan>1&&(n=!0)}e==-1?e=i:e!=i&&(e=Math.max(e,i))}return e}function mM(t,e,n){t.problems||(t.problems=[]);const r={};for(let o=0;o<t.map.length;o++){const i=t.map[o];if(r[i])continue;r[i]=!0;const s=n.nodeAt(i);if(!s)throw new RangeError(`No cell with offset ${i} found`);let a=null;const l=s.attrs;for(let c=0;c<l.colspan;c++){const u=(o+c)%t.width,d=e[u*2];d!=null&&(!l.colwidth||l.colwidth[c]!=d)&&((a||(a=gM(l)))[c]=d)}a&&t.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:a})}}function gM(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function Ft(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],o=r.spec.tableRole;o&&(e[o]=r)}}return e}var br=new et("selectingCells");function ui(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 yM(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function vn(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function Tl(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=ui(e.$head)||bM(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function bM(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function Md(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function wM(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function ep(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function $2(t,e,n){const r=t.node(-1),o=at.get(r),i=t.start(-1),s=o.nextCell(t.pos-i,e,n);return s==null?null:t.node(0).resolve(i+s)}function co(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(o=>o>0)||(r.colwidth=null)),r}function T2(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let o=0;o<n;o++)r.colwidth.splice(e,0,0)}return r}function vM(t,e,n){const r=Ft(e.type.schema).header_cell;for(let o=0;o<t.height;o++)if(e.nodeAt(t.map[n+o*t.width]).type!=r)return!1;return!0}var Je=class Hn extends Re{constructor(e,n=e){const r=e.node(-1),o=at.get(r),i=e.start(-1),s=o.rectBetween(e.pos-i,n.pos-i),a=e.node(0),l=o.cellsInRect(s).filter(u=>u!=n.pos-i);l.unshift(n.pos-i);const c=l.map(u=>{const d=r.nodeAt(u);if(!d)throw RangeError(`No cell with offset ${u} found`);const f=i+u+1;return new Fw(a.resolve(f),a.resolve(f+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),o=e.resolve(n.map(this.$headCell.pos));if(Md(r)&&Md(o)&&ep(r,o)){const i=this.$anchorCell.node(-1)!=r.node(-1);return i&&this.isRowSelection()?Hn.rowSelection(r,o):i&&this.isColSelection()?Hn.colSelection(r,o):new Hn(r,o)}return Le.between(r,o)}content(){const e=this.$anchorCell.node(-1),n=at.get(e),r=this.$anchorCell.start(-1),o=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),i={},s=[];for(let l=o.top;l<o.bottom;l++){const c=[];for(let u=l*n.width+o.left,d=o.left;d<o.right;d++,u++){const f=n.map[u];if(i[f])continue;i[f]=!0;const p=n.findCell(f);let h=e.nodeAt(f);if(!h)throw RangeError(`No cell with offset ${f} found`);const m=o.left-p.left,y=p.right-o.right;if(m>0||y>0){let g=h.attrs;if(m>0&&(g=co(g,0,m)),y>0&&(g=co(g,g.colspan-y,y)),p.left<o.left){if(h=h.type.createAndFill(g),!h)throw RangeError(`Could not create cell with attrs ${JSON.stringify(g)}`)}else h=h.type.create(g,h.content)}if(p.top<o.top||p.bottom>o.bottom){const g={...h.attrs,rowspan:Math.min(p.bottom,o.bottom)-Math.max(p.top,o.top)};p.top<o.top?h=h.type.createAndFill(g):h=h.type.create(g,h.content)}c.push(h)}s.push(e.child(l).copy(be.from(c)))}const a=this.isColSelection()&&this.isRowSelection()?e:s;return new ve(be.from(a),1,1)}replace(e,n=ve.empty){const r=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){const{$from:a,$to:l}=o[s],c=e.mapping.slice(r);e.replace(c.map(a.pos),c.map(l.pos),s?ve.empty:n)}const i=Re.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,n){this.replace(e,new ve(be.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=at.get(n),o=this.$anchorCell.start(-1),i=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o));for(let s=0;s<i.length;s++)e(n.nodeAt(i[s]),o+i[s])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,o=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,o)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),o=at.get(r),i=e.start(-1),s=o.findCell(e.pos-i),a=o.findCell(n.pos-i),l=e.node(0);return s.top<=a.top?(s.top>0&&(e=l.resolve(i+o.map[s.left])),a.bottom<o.height&&(n=l.resolve(i+o.map[o.width*(o.height-1)+a.right-1]))):(a.top>0&&(n=l.resolve(i+o.map[a.left])),s.bottom<o.height&&(e=l.resolve(i+o.map[o.width*(o.height-1)+s.right-1]))),new Hn(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=at.get(e),r=this.$anchorCell.start(-1),o=n.colCount(this.$anchorCell.pos-r),i=n.colCount(this.$headCell.pos-r);if(Math.min(o,i)>0)return!1;const s=o+this.$anchorCell.nodeAfter.attrs.colspan,a=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,a)==n.width}eq(e){return e instanceof Hn&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),o=at.get(r),i=e.start(-1),s=o.findCell(e.pos-i),a=o.findCell(n.pos-i),l=e.node(0);return s.left<=a.left?(s.left>0&&(e=l.resolve(i+o.map[s.top*o.width])),a.right<o.width&&(n=l.resolve(i+o.map[o.width*(a.top+1)-1]))):(a.left>0&&(n=l.resolve(i+o.map[a.top*o.width])),s.right<o.width&&(e=l.resolve(i+o.map[o.width*(s.top+1)-1]))),new Hn(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new Hn(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new Hn(e.resolve(n),e.resolve(r))}getBookmark(){return new xM(this.$anchorCell.pos,this.$headCell.pos)}};Je.prototype.visible=!1;Re.jsonID("cell",Je);var xM=class O2{constructor(e,n){this.anchor=e,this.head=n}map(e){return new O2(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&ep(n,r)?new Je(n,r):Re.near(r,1)}};function kM(t){if(!(t.selection instanceof Je))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(Pe.node(r,r+n.nodeSize,{class:"selectedCell"}))}),qe.create(t.doc,e)}function SM({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,r=e.pos,o=t.depth;for(;o>=0&&!(t.after(o+1)<t.end(o));o--,n++);for(let i=e.depth;i>=0&&!(e.before(i+1)>e.start(i));i--,r--);return n==r&&/row|table/.test(t.node(o).type.spec.tableRole)}function CM({$from:t,$to:e}){let n,r;for(let o=t.depth;o>0;o--){const i=t.node(o);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){n=i;break}}for(let o=e.depth;o>0;o--){const i=e.node(o);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){r=i;break}}return n!==r&&e.parentOffset===0}function EM(t,e,n){const r=(e||t).selection,o=(e||t).doc;let i,s;if(r instanceof Ne&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")i=Je.create(o,r.from);else if(s=="row"){const a=o.resolve(r.from+1);i=Je.rowSelection(a,a)}else if(!n){const a=at.get(r.node),l=r.from+1,c=l+a.map[a.width*a.height-1];i=Je.create(o,l+1,c)}}else r instanceof Le&&SM(r)?i=Le.create(o,r.from):r instanceof Le&&CM(r)&&(i=Le.create(o,r.$from.start(),r.$from.end()));return i&&(e||(e=t.tr)).setSelection(i),e}var AM=new et("fix-tables");function D2(t,e,n,r){const o=t.childCount,i=e.childCount;e:for(let s=0,a=0;s<i;s++){const l=e.child(s);for(let c=a,u=Math.min(o,s+3);c<u;c++)if(t.child(c)==l){a=c+1,n+=l.nodeSize;continue e}r(l,n),a<o&&t.child(a).sameMarkup(l)?D2(t.child(a),l,n+1,r):l.nodesBetween(0,l.content.size,r,n+1),n+=l.nodeSize}}function M2(t,e){let n;const r=(o,i)=>{o.type.spec.tableRole=="table"&&(n=$M(t,o,i,n))};return e?e.doc!=t.doc&&D2(e.doc,t.doc,0,r):t.doc.descendants(r),n}function $M(t,e,n,r){const o=at.get(e);if(!o.problems)return r;r||(r=t.tr);const i=[];for(let l=0;l<o.height;l++)i.push(0);for(let l=0;l<o.problems.length;l++){const c=o.problems[l];if(c.type=="collision"){const u=e.nodeAt(c.pos);if(!u)continue;const d=u.attrs;for(let f=0;f<d.rowspan;f++)i[c.row+f]+=c.n;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,co(d,d.colspan-c.n,c.n))}else if(c.type=="missing")i[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=e.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+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;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const u=r.mapping.map(n);r.delete(u,u+e.nodeSize)}}let s,a;for(let l=0;l<i.length;l++)i[l]&&(s==null&&(s=l),a=l);for(let l=0,c=n+1;l<o.height;l++){const u=e.child(l),d=c+u.nodeSize,f=i[l];if(f>0){let p="cell";u.firstChild&&(p=u.firstChild.type.spec.tableRole);const h=[];for(let y=0;y<f;y++){const g=Ft(t.schema)[p].createAndFill();g&&h.push(g)}const m=(l==0||s==l-1)&&a==l?c+1:d-1;r.insert(r.mapping.map(m),h)}c=d}return r.setMeta(AM,{fixTables:!0})}function Ln(t){const e=t.selection,n=Tl(t),r=n.node(-1),o=n.start(-1),i=at.get(r);return{...e instanceof Je?i.rectBetween(e.$anchorCell.pos-o,e.$headCell.pos-o):i.findCell(n.pos-o),tableStart:o,map:i,table:r}}function _2(t,{map:e,tableStart:n,table:r},o){let i=o>0?-1:0;vM(e,r,o+i)&&(i=o==0||o==e.width?null:0);for(let s=0;s<e.height;s++){const a=s*e.width+o;if(o>0&&o<e.width&&e.map[a-1]==e.map[a]){const l=e.map[a],c=r.nodeAt(l);t.setNodeMarkup(t.mapping.map(n+l),null,T2(c.attrs,o-e.colCount(l))),s+=c.attrs.rowspan-1}else{const l=i==null?Ft(r.type.schema).cell:r.nodeAt(e.map[a+i]).type,c=e.positionAt(s,o,r);t.insert(t.mapping.map(n+c),l.createAndFill())}}return t}function TM(t,e){if(!vn(t))return!1;if(e){const n=Ln(t);e(_2(t.tr,n,n.left))}return!0}function OM(t,e){if(!vn(t))return!1;if(e){const n=Ln(t);e(_2(t.tr,n,n.right))}return!0}function DM(t,{map:e,table:n,tableStart:r},o){const i=t.mapping.maps.length;for(let s=0;s<e.height;){const a=s*e.width+o,l=e.map[a],c=n.nodeAt(l),u=c.attrs;if(o>0&&e.map[a-1]==l||o<e.width-1&&e.map[a+1]==l)t.setNodeMarkup(t.mapping.slice(i).map(r+l),null,co(u,o-e.colCount(l)));else{const d=t.mapping.slice(i).map(r+l);t.delete(d,d+c.nodeSize)}s+=u.rowspan}}function MM(t,e){if(!vn(t))return!1;if(e){const n=Ln(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let o=n.right-1;DM(r,n,o),o!=n.left;o--){const i=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!i)throw RangeError("No table found");n.table=i,n.map=at.get(i)}e(r)}return!0}function _M(t,e,n){var r;const o=Ft(e.type.schema).header_cell;for(let i=0;i<t.width;i++)if(((r=e.nodeAt(t.map[i+n*t.width]))==null?void 0:r.type)!=o)return!1;return!0}function N2(t,{map:e,tableStart:n,table:r},o){var i;let s=n;for(let c=0;c<o;c++)s+=r.child(c).nodeSize;const a=[];let l=o>0?-1:0;_M(e,r,o+l)&&(l=o==0||o==e.height?null:0);for(let c=0,u=e.width*o;c<e.width;c++,u++)if(o>0&&o<e.height&&e.map[u]==e.map[u-e.width]){const d=e.map[u],f=r.nodeAt(d).attrs;t.setNodeMarkup(n+d,null,{...f,rowspan:f.rowspan+1}),c+=f.colspan-1}else{const d=l==null?Ft(r.type.schema).cell:(i=r.nodeAt(e.map[u+l*e.width]))==null?void 0:i.type,f=d?.createAndFill();f&&a.push(f)}return t.insert(s,Ft(r.type.schema).row.create(null,a)),t}function NM(t,e){if(!vn(t))return!1;if(e){const n=Ln(t);e(N2(t.tr,n,n.top))}return!0}function IM(t,e){if(!vn(t))return!1;if(e){const n=Ln(t);e(N2(t.tr,n,n.bottom))}return!0}function FM(t,{map:e,table:n,tableStart:r},o){let i=0;for(let c=0;c<o;c++)i+=n.child(c).nodeSize;const s=i+n.child(o).nodeSize,a=t.mapping.maps.length;t.delete(i+r,s+r);const l=new Set;for(let c=0,u=o*e.width;c<e.width;c++,u++){const d=e.map[u];if(!l.has(d)){if(l.add(d),o>0&&d==e.map[u-e.width]){const f=n.nodeAt(d).attrs;t.setNodeMarkup(t.mapping.slice(a).map(d+r),null,{...f,rowspan:f.rowspan-1}),c+=f.colspan-1}else if(o<e.height&&d==e.map[u+e.width]){const f=n.nodeAt(d),p=f.attrs,h=f.type.create({...p,rowspan:f.attrs.rowspan-1},f.content),m=e.positionAt(o+1,c,n);t.insert(t.mapping.slice(a).map(r+m),h),c+=p.colspan-1}}}}function BM(t,e){if(!vn(t))return!1;if(e){const n=Ln(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let o=n.bottom-1;FM(r,n,o),o!=n.top;o--){const i=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!i)throw RangeError("No table found");n.table=i,n.map=at.get(n.table)}e(r)}return!0}function hy(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function RM({width:t,height:e,map:n},r){let o=r.top*t+r.left,i=o,s=(r.bottom-1)*t+r.left,a=o+(r.right-r.left-1);for(let l=r.top;l<r.bottom;l++){if(r.left>0&&n[i]==n[i-1]||r.right<t&&n[a]==n[a+1])return!0;i+=t,a+=t}for(let l=r.left;l<r.right;l++){if(r.top>0&&n[o]==n[o-t]||r.bottom<e&&n[s]==n[s+t])return!0;o++,s++}return!1}function my(t,e){const n=t.selection;if(!(n instanceof Je)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=Ln(t),{map:o}=r;if(RM(o,r))return!1;if(e){const i=t.tr,s={};let a=be.empty,l,c;for(let u=r.top;u<r.bottom;u++)for(let d=r.left;d<r.right;d++){const f=o.map[u*o.width+d],p=r.table.nodeAt(f);if(!(s[f]||!p))if(s[f]=!0,l==null)l=f,c=p;else{hy(p)||(a=a.append(p.content));const h=i.mapping.map(f+r.tableStart);i.delete(h,h+p.nodeSize)}}if(l==null||c==null)return!0;if(i.setNodeMarkup(l+r.tableStart,null,{...T2(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),a.size){const u=l+1+c.content.size,d=hy(c)?l+1:u;i.replaceWith(d+r.tableStart,u+r.tableStart,a)}i.setSelection(new Je(i.doc.resolve(l+r.tableStart))),e(i)}return!0}function gy(t,e){const n=Ft(t.schema);return LM(({node:r})=>n[r.type.spec.tableRole])(t,e)}function LM(t){return(e,n)=>{var r;const o=e.selection;let i,s;if(o instanceof Je){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;i=o.$anchorCell.nodeAfter,s=o.$anchorCell.pos}else{if(i=yM(o.$from),!i)return!1;s=(r=ui(o.$from))==null?void 0:r.pos}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let a=i.attrs;const l=[],c=a.colwidth;a.rowspan>1&&(a={...a,rowspan:1}),a.colspan>1&&(a={...a,colspan:1});const u=Ln(e),d=e.tr;for(let p=0;p<u.right-u.left;p++)l.push(c?{...a,colwidth:c&&c[p]?[c[p]]:null}:a);let f;for(let p=u.top;p<u.bottom;p++){let h=u.map.positionAt(p,u.left,u.table);p==u.top&&(h+=i.nodeSize);for(let m=u.left,y=0;m<u.right;m++,y++)m==u.left&&p==u.top||d.insert(f=d.mapping.map(h+u.tableStart,1),t({node:i,row:p,col:m}).createAndFill(l[y]))}d.setNodeMarkup(s,t({node:i,row:u.top,col:u.left}),l[0]),o instanceof Je&&d.setSelection(new Je(d.doc.resolve(o.$anchorCell.pos),f?d.doc.resolve(f):void 0)),n(d)}return!0}}function PM(t,e){return function(n,r){if(!vn(n))return!1;const o=Tl(n);if(o.nodeAfter.attrs[t]===e)return!1;if(r){const i=n.tr;n.selection instanceof Je?n.selection.forEachCell((s,a)=>{s.attrs[t]!==e&&i.setNodeMarkup(a,null,{...s.attrs,[t]:e})}):i.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[t]:e}),r(i)}return!0}}function zM(t){return function(e,n){if(!vn(e))return!1;if(n){const r=Ft(e.schema),o=Ln(e),i=e.tr,s=o.map.cellsInRect(t=="column"?{left:o.left,top:0,right:o.right,bottom:o.map.height}:t=="row"?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),a=s.map(l=>o.table.nodeAt(l));for(let l=0;l<s.length;l++)a[l].type==r.header_cell&&i.setNodeMarkup(o.tableStart+s[l],r.cell,a[l].attrs);if(i.steps.length==0)for(let l=0;l<s.length;l++)i.setNodeMarkup(o.tableStart+s[l],r.header_cell,a[l].attrs);n(i)}return!0}}function yy(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let o=0;o<r.length;o++){const i=e.table.nodeAt(r[o]);if(i&&i.type!==n.header_cell)return!1}return!0}function us(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?zM(t):function(n,r){if(!vn(n))return!1;if(r){const o=Ft(n.schema),i=Ln(n),s=n.tr,a=yy("row",i,o),l=yy("column",i,o),c=(t==="column"?a:t==="row"&&l)?1:0,u=t=="column"?{left:0,top:c,right:1,bottom:i.map.height}:t=="row"?{left:c,top:0,right:i.map.width,bottom:1}:i,d=t=="column"?l?o.cell:o.header_cell:t=="row"?a?o.cell:o.header_cell:o.cell;i.map.cellsInRect(u).forEach(f=>{const p=f+i.tableStart,h=s.doc.nodeAt(p);h&&s.setNodeMarkup(p,d,h.attrs)}),r(s)}return!0}}us("row",{useDeprecatedLogic:!0});us("column",{useDeprecatedLogic:!0});var jM=us("cell",{useDeprecatedLogic:!0});function qM(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,o=t.before();r>=0;r--){const i=t.node(-1).child(r),s=i.lastChild;if(s)return o-1-s.nodeSize;o-=i.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let r=t.indexAfter(-1),o=t.after();r<n.childCount;r++){const i=n.child(r);if(i.childCount)return o+1;o+=i.nodeSize}}return null}function by(t){return function(e,n){if(!vn(e))return!1;const r=qM(Tl(e),t);if(r==null)return!1;if(n){const o=e.doc.resolve(r);n(e.tr.setSelection(Le.between(o,wM(o))).scrollIntoView())}return!0}}function VM(t,e){const n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function Hs(t,e){const n=t.selection;if(!(n instanceof Je))return!1;if(e){const r=t.tr,o=Ft(t.schema).cell.createAndFill().content;n.forEachCell((i,s)=>{i.content.eq(o)||r.replace(r.mapping.map(s+1),r.mapping.map(s+i.nodeSize-1),new ve(o,0,0))}),r.docChanged&&e(r)}return!0}function UM(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const o=e.child(0),i=o.type.spec.tableRole,s=o.type.schema,a=[];if(i=="row")for(let l=0;l<e.childCount;l++){let c=e.child(l).content;const u=l?0:Math.max(0,n-1),d=l<e.childCount-1?0:Math.max(0,r-1);(u||d)&&(c=_d(Ft(s).row,new ve(c,u,d)).content),a.push(c)}else if(i=="cell"||i=="header_cell")a.push(n||r?_d(Ft(s).row,new ve(e,n,r)).content:e);else return null;return HM(s,a)}function HM(t,e){const n=[];for(let o=0;o<e.length;o++){const i=e[o];for(let s=i.childCount-1;s>=0;s--){const{rowspan:a,colspan:l}=i.child(s).attrs;for(let c=o;c<o+a;c++)n[c]=(n[c]||0)+l}}let r=0;for(let o=0;o<n.length;o++)r=Math.max(r,n[o]);for(let o=0;o<n.length;o++)if(o>=e.length&&e.push(be.empty),n[o]<r){const i=Ft(t).cell.createAndFill(),s=[];for(let a=n[o];a<r;a++)s.push(i);e[o]=e[o].append(be.from(s))}return{height:e.length,width:r,rows:e}}function _d(t,e){const n=t.createAndFill();return new Iw(n).replace(0,n.content.size,e).doc}function WM({width:t,height:e,rows:n},r,o){if(t!=r){const i=[],s=[];for(let a=0;a<n.length;a++){const l=n[a],c=[];for(let u=i[a]||0,d=0;u<r;d++){let f=l.child(d%l.childCount);u+f.attrs.colspan>r&&(f=f.type.createChecked(co(f.attrs,f.attrs.colspan,u+f.attrs.colspan-r),f.content)),c.push(f),u+=f.attrs.colspan;for(let p=1;p<f.attrs.rowspan;p++)i[a+p]=(i[a+p]||0)+f.attrs.colspan}s.push(be.from(c))}n=s,t=r}if(e!=o){const i=[];for(let s=0,a=0;s<o;s++,a++){const l=[],c=n[a%e];for(let u=0;u<c.childCount;u++){let d=c.child(u);s+d.attrs.rowspan>o&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,o-d.attrs.rowspan)},d.content)),l.push(d)}i.push(be.from(l))}n=i,e=o}return{width:t,height:e,rows:n}}function GM(t,e,n,r,o,i,s){const a=t.doc.type.schema,l=Ft(a);let c,u;if(o>e.width)for(let d=0,f=0;d<e.height;d++){const p=n.child(d);f+=p.nodeSize;const h=[];let m;p.lastChild==null||p.lastChild.type==l.cell?m=c||(c=l.cell.createAndFill()):m=u||(u=l.header_cell.createAndFill());for(let y=e.width;y<o;y++)h.push(m);t.insert(t.mapping.slice(s).map(f-1+r),h)}if(i>e.height){const d=[];for(let h=0,m=(e.height-1)*e.width;h<Math.max(e.width,o);h++){const y=h>=e.width?!1:n.nodeAt(e.map[m+h]).type==l.header_cell;d.push(y?u||(u=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}const f=l.row.create(null,be.from(d)),p=[];for(let h=e.height;h<i;h++)p.push(f);t.insert(t.mapping.slice(s).map(r+n.nodeSize-2),p)}return!!(c||u)}function wy(t,e,n,r,o,i,s,a){if(s==0||s==e.height)return!1;let l=!1;for(let c=o;c<i;c++){const u=s*e.width+c,d=e.map[u];if(e.map[u-e.width]==d){l=!0;const f=n.nodeAt(d),{top:p,left:h}=e.findCell(d);t.setNodeMarkup(t.mapping.slice(a).map(d+r),null,{...f.attrs,rowspan:s-p}),t.insert(t.mapping.slice(a).map(e.positionAt(s,h,n)),f.type.createAndFill({...f.attrs,rowspan:p+f.attrs.rowspan-s})),c+=f.attrs.colspan-1}}return l}function vy(t,e,n,r,o,i,s,a){if(s==0||s==e.width)return!1;let l=!1;for(let c=o;c<i;c++){const u=c*e.width+s,d=e.map[u];if(e.map[u-1]==d){l=!0;const f=n.nodeAt(d),p=e.colCount(d),h=t.mapping.slice(a).map(d+r);t.setNodeMarkup(h,null,co(f.attrs,s-p,f.attrs.colspan-(s-p))),t.insert(h+f.nodeSize,f.type.createAndFill(co(f.attrs,0,s-p))),c+=f.attrs.rowspan-1}}return l}function xy(t,e,n,r,o){let i=n?t.doc.nodeAt(n-1):t.doc;if(!i)throw new Error("No table found");let s=at.get(i);const{top:a,left:l}=r,c=l+o.width,u=a+o.height,d=t.tr;let f=0;function p(){if(i=n?d.doc.nodeAt(n-1):d.doc,!i)throw new Error("No table found");s=at.get(i),f=d.mapping.maps.length}GM(d,s,i,n,c,u,f)&&p(),wy(d,s,i,n,l,c,a,f)&&p(),wy(d,s,i,n,l,c,u,f)&&p(),vy(d,s,i,n,a,u,l,f)&&p(),vy(d,s,i,n,a,u,c,f)&&p();for(let h=a;h<u;h++){const m=s.positionAt(h,l,i),y=s.positionAt(h,c,i);d.replace(d.mapping.slice(f).map(m+n),d.mapping.slice(f).map(y+n),new ve(o.rows[h-a],0,0))}p(),d.setSelection(new Je(d.doc.resolve(n+s.positionAt(a,l,i)),d.doc.resolve(n+s.positionAt(u-1,c-1,i)))),e(d)}var KM=Pf({ArrowLeft:Ws("horiz",-1),ArrowRight:Ws("horiz",1),ArrowUp:Ws("vert",-1),ArrowDown:Ws("vert",1),"Shift-ArrowLeft":Gs("horiz",-1),"Shift-ArrowRight":Gs("horiz",1),"Shift-ArrowUp":Gs("vert",-1),"Shift-ArrowDown":Gs("vert",1),Backspace:Hs,"Mod-Backspace":Hs,Delete:Hs,"Mod-Delete":Hs});function xa(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function Ws(t,e){return(n,r,o)=>{if(!o)return!1;const i=n.selection;if(i instanceof Je)return xa(n,r,Re.near(i.$headCell,e));if(t!="horiz"&&!i.empty)return!1;const s=I2(o,t,e);if(s==null)return!1;if(t=="horiz")return xa(n,r,Re.near(n.doc.resolve(i.head+e),e));{const a=n.doc.resolve(s),l=$2(a,t,e);let c;return l?c=Re.near(l,1):e<0?c=Re.near(n.doc.resolve(a.before(-1)),-1):c=Re.near(n.doc.resolve(a.after(-1)),1),xa(n,r,c)}}}function Gs(t,e){return(n,r,o)=>{if(!o)return!1;const i=n.selection;let s;if(i instanceof Je)s=i;else{const l=I2(o,t,e);if(l==null)return!1;s=new Je(n.doc.resolve(l))}const a=$2(s.$headCell,t,e);return a?xa(n,r,new Je(s.$anchorCell,a)):!1}}function XM(t,e){const n=t.state.doc,r=ui(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new Je(r))),!0):!1}function JM(t,e,n){if(!vn(t.state))return!1;let r=UM(n);const o=t.state.selection;if(o instanceof Je){r||(r={width:1,height:1,rows:[be.from(_d(Ft(t.state.schema).cell,n))]});const i=o.$anchorCell.node(-1),s=o.$anchorCell.start(-1),a=at.get(i).rectBetween(o.$anchorCell.pos-s,o.$headCell.pos-s);return r=WM(r,a.right-a.left,a.bottom-a.top),xy(t.state,t.dispatch,s,a,r),!0}else if(r){const i=Tl(t.state),s=i.start(-1);return xy(t.state,t.dispatch,s,at.get(i.node(-1)).findCell(i.pos-s),r),!0}else return!1}function YM(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=ky(t,e.target);let o;if(e.shiftKey&&t.state.selection instanceof Je)i(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(o=ui(t.state.selection.$anchor))!=null&&((n=du(t,e))==null?void 0:n.pos)!=o.pos)i(o,e),e.preventDefault();else if(!r)return;function i(l,c){let u=du(t,c);const d=br.getState(t.state)==null;if(!u||!ep(l,u))if(d)u=l;else return;const f=new Je(l,u);if(d||!t.state.selection.eq(f)){const p=t.state.tr.setSelection(f);d&&p.setMeta(br,l.pos),t.dispatch(p)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",a),br.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(br,-1))}function a(l){const c=l,u=br.getState(t.state);let d;if(u!=null)d=t.state.doc.resolve(u);else if(ky(t,c.target)!=r&&(d=du(t,e),!d))return s();d&&i(d,c)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",a)}function I2(t,e,n){if(!(t.state.selection instanceof Le))return null;const{$head:r}=t.state.selection;for(let o=r.depth-1;o>=0;o--){const i=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:i.childCount))return null;if(i.type.spec.tableRole=="cell"||i.type.spec.tableRole=="header_cell"){const s=r.before(o),a=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(a)?s:null}}return null}function ky(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function du(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?ui(t.state.doc.resolve(n.pos)):null}var ZM=class{constructor(t,e){this.node=t,this.defaultCellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${e}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Nd(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,Nd(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function Nd(t,e,n,r,o,i){var s;let a=0,l=!0,c=e.firstChild;const u=t.firstChild;if(u){for(let d=0,f=0;d<u.childCount;d++){const{colspan:p,colwidth:h}=u.child(d).attrs;for(let m=0;m<p;m++,f++){const y=o==f?i:h&&h[m],g=y?y+"px":"";if(a+=y||r,y||(l=!1),c)c.style.width!=g&&(c.style.width=g),c=c.nextSibling;else{const x=document.createElement("col");x.style.width=g,e.appendChild(x)}}}for(;c;){const d=c.nextSibling;(s=c.parentNode)==null||s.removeChild(c),c=d}l?(n.style.width=a+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=a+"px")}}var en=new et("tableColumnResizing");function QM({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:r=ZM,lastColumnResizable:o=!0}={}){const i=new Ze({key:en,state:{init(s,a){var l,c;const u=(c=(l=i.spec)==null?void 0:l.props)==null?void 0:c.nodeViews,d=Ft(a.schema).table.name;return r&&u&&(u[d]=(f,p)=>new r(f,n,p)),new e5(-1,!1)},apply(s,a){return a.apply(s)}},props:{attributes:s=>{const a=en.getState(s);return a&&a.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,a)=>{t5(s,a,t,o)},mouseleave:s=>{n5(s)},mousedown:(s,a)=>{r5(s,a,e,n)}},decorations:s=>{const a=en.getState(s);if(a&&a.activeHandle>-1)return l5(s,a.activeHandle)},nodeViews:{}}});return i}var e5=class ka{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(en);if(r&&r.setHandle!=null)return new ka(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new ka(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let o=e.mapping.map(n.activeHandle,-1);return Md(e.doc.resolve(o))||(o=-1),new ka(o,n.dragging)}return n}};function t5(t,e,n,r){if(!t.editable)return;const o=en.getState(t.state);if(o&&!o.dragging){const i=i5(e.target);let s=-1;if(i){const{left:a,right:l}=i.getBoundingClientRect();e.clientX-a<=n?s=Sy(t,e,"left",n):l-e.clientX<=n&&(s=Sy(t,e,"right",n))}if(s!=o.activeHandle){if(!r&&s!==-1){const a=t.state.doc.resolve(s),l=a.node(-1),c=at.get(l),u=a.start(-1);if(c.colCount(a.pos-u)+a.nodeAfter.attrs.colspan-1==c.width-1)return}F2(t,s)}}}function n5(t){if(!t.editable)return;const e=en.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&F2(t,-1)}function r5(t,e,n,r){var o;if(!t.editable)return!1;const i=(o=t.dom.ownerDocument.defaultView)!=null?o:window,s=en.getState(t.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const a=t.state.doc.nodeAt(s.activeHandle),l=o5(t,s.activeHandle,a.attrs);t.dispatch(t.state.tr.setMeta(en,{setDragging:{startX:e.clientX,startWidth:l}}));function c(d){i.removeEventListener("mouseup",c),i.removeEventListener("mousemove",u);const f=en.getState(t.state);f?.dragging&&(s5(t,f.activeHandle,Cy(f.dragging,d,n)),t.dispatch(t.state.tr.setMeta(en,{setDragging:null})))}function u(d){if(!d.which)return c(d);const f=en.getState(t.state);if(f&&f.dragging){const p=Cy(f.dragging,d,n);Ey(t,f.activeHandle,p,r)}}return Ey(t,s.activeHandle,l,r),i.addEventListener("mouseup",c),i.addEventListener("mousemove",u),e.preventDefault(),!0}function o5(t,e,{colspan:n,colwidth:r}){const o=r&&r[r.length-1];if(o)return o;const i=t.domAtPos(e);let s=i.node.childNodes[i.offset].offsetWidth,a=n;if(r)for(let l=0;l<n;l++)r[l]&&(s-=r[l],a--);return s/a}function i5(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function Sy(t,e,n,r){const o=n=="right"?-r:r,i=t.posAtCoords({left:e.clientX+o,top:e.clientY});if(!i)return-1;const{pos:s}=i,a=ui(t.state.doc.resolve(s));if(!a)return-1;if(n=="right")return a.pos;const l=at.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 Cy(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function F2(t,e){t.dispatch(t.state.tr.setMeta(en,{setHandle:e}))}function s5(t,e,n){const r=t.state.doc.resolve(e),o=r.node(-1),i=at.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,l=t.state.tr;for(let c=0;c<i.height;c++){const u=c*i.width+a;if(c&&i.map[u]==i.map[u-i.width])continue;const d=i.map[u],f=o.nodeAt(d).attrs,p=f.colspan==1?0:a-i.colCount(d);if(f.colwidth&&f.colwidth[p]==n)continue;const h=f.colwidth?f.colwidth.slice():a5(f.colspan);h[p]=n,l.setNodeMarkup(s+d,null,{...f,colwidth:h})}l.docChanged&&t.dispatch(l)}function Ey(t,e,n,r){const o=t.state.doc.resolve(e),i=o.node(-1),s=o.start(-1),a=at.get(i).colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1;let l=t.domAtPos(o.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&Nd(i,l.firstChild,l,r,a,n)}function a5(t){return Array(t).fill(0)}function l5(t,e){var n;const r=[],o=t.doc.resolve(e),i=o.node(-1);if(!i)return qe.empty;const s=at.get(i),a=o.start(-1),l=s.colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1;for(let c=0;c<s.height;c++){const u=l+c*s.width;if((l==s.width-1||s.map[u]!=s.map[u+1])&&(c==0||s.map[u]!=s.map[u-s.width])){const d=s.map[u],f=a+d+i.nodeAt(d).nodeSize-1,p=document.createElement("div");p.className="column-resize-handle",(n=en.getState(t))!=null&&n.dragging&&r.push(Pe.node(a+d,a+d+i.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),r.push(Pe.widget(f,p))}}return qe.create(t.doc,r)}function c5({allowTableNodeSelection:t=!1}={}){return new Ze({key:br,state:{init(){return null},apply(e,n){const r=e.getMeta(br);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:o,pos:i}=e.mapping.mapResult(n);return o?null:i}},props:{decorations:kM,handleDOMEvents:{mousedown:YM},createSelectionBetween(e){return br.getState(e.state)!=null?e.state.selection:null},handleTripleClick:XM,handleKeyDown:KM,handlePaste:JM},appendTransaction(e,n,r){return EM(r,M2(r,n),t)}})}const u5=t=>t instanceof Je,Ks=({editor:t})=>{const{selection:e}=t.state;if(!u5(e))return!1;let n=0;return $l(e.ranges[0].$from,r=>r.type.name==="table")?.node.descendants(r=>{if(r.type.name==="table")return!1;["tableCell","tableHeader"].includes(r.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},B2=({size:t=.66665,color:e="#000000"}={})=>({top:{size:t,color:e},left:{size:t,color:e},bottom:{size:t,color:e},right:{size:t,color:e}}),R2=rt.create({name:"table",content:"tableRow+",group:"block",isolating:!0,tableRole:"table",addOptions(){return{htmlAttributes:{},resizable:!0,handleWidth:5,cellMinWidth:25,lastColumnResizable:!0,allowTableNodeSelection:!1}},addAttributes(){return{tableIndent:{renderDOM:({tableIndent:t})=>{if(!t)return{};const{width:e,type:n="dxa"}=t;let r="";return e&&(r+=`margin-left: ${e}px`),{style:r}}},borders:{default:{},renderDOM({borders:t}){return t?{style:Object.entries(t).reduce((e,[n,{size:r,color:o}])=>`${e}border-${n}: ${r}px solid ${o||"black"};`,"")}:{}}},borderCollapse:{default:null,renderDOM({borderCollapse:t}){return{style:`border-collapse: ${t||"collapse"}`}}},tableStyleId:{rendered:!1},tableLayout:{rendered:!1},tableCellSpacing:{default:null,rendered:!1}}},parseDOM(){return[{tag:"table"}]},renderDOM({node:t,htmlAttributes:e}){const{colgroup:n,tableWidth:r,tableMinWidth:o}=fM(t,this.options.cellMinWidth);return["table",Me.mergeAttributes(this.options.htmlAttributes,e,{style:r?`width: ${r}`:`min-width: ${o}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!1}={})=>({tr:r,dispatch:o,editor:i})=>{const s=dM(i.schema,t,e,n);if(o){const a=r.selection.from+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(Le.near(r.doc.resolve(a)))}return!0},deleteTable:()=>({state:t,dispatch:e})=>VM(t,e),addColumnBefore:()=>({state:t,dispatch:e})=>TM(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>OM(t,e),deleteColumn:()=>({state:t,dispatch:e})=>MM(t,e),addRowBefore:()=>({state:t,dispatch:e})=>NM(t,e),addRowAfter:()=>({state:t,dispatch:e})=>IM(t,e),deleteRow:()=>({state:t,dispatch:e})=>BM(t,e),mergeCells:()=>({state:t,dispatch:e})=>my(t,e),splitCell:()=>({state:t,dispatch:e})=>gy(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>my(t,e)?!0:gy(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>us("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>us("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>jM(t,e),setCellAttr:(t,e)=>({state:n,dispatch:r})=>PM(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>by(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>by(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&M2(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>(n&&e.setSelection(Je.create(e.doc,t.anchorCell,t.headCell)),!0),deleteCellAndTableBorders:()=>({chain:t,state:e,tr:n})=>{if(!Kf(e))return!1;const r=Bn(s=>s.type.name===this.name)(e.selection);if(!r)return!1;const o=r.pos,i=r.pos+r.node.nodeSize;return e.doc.nodesBetween(o,i,(s,a)=>{["tableCell","tableHeader"].includes(s.type.name)&&n.setNodeMarkup(a,void 0,{...s.attrs,borders:B2({size:0})})}),n.setNodeMarkup(r.pos,void 0,{...r.node.attrs,borders:A2({size:0})}),!0}}},addShortcuts(){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:Ks,"Mod-Backspace":Ks,Delete:Ks,"Mod-Delete":Ks}},addPmPlugins(){return[...this.options.resizable&&this.editor.isEditable?[QM({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,lastColumnResizable:this.options.lastColumnResizable,View:uM({editor:this.editor})})]:[],c5({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){return{tableRole:He(De(t,"tableRole",{name:t.name,options:t.options,storage:t.storage}))}}}),L2=rt.create({name:"tableHeader",content:"block+",tableRole:"header_cell",isolating:!0,addOptions(){return{htmlAttributes:{}}},addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseDOM:t=>{const e=t.getAttribute("data-colwidth");return e?e.split(",").map(n=>parseInt(n,10)):null},renderDOM:t=>t.colwidth?{"data-colwidth":t.colwidth.join(",")}:{}}}},parseDOM(){return[{tag:"th"}]},renderDOM({htmlAttributes:t}){return["th",Me.mergeAttributes(this.options.htmlAttributes,t),0]}}),P2=rt.create({name:"tableRow",content:"(tableCell | tableHeader)*",tableRole:"row",addOptions(){return{htmlAttributes:{}}},addAttributes(){return{rowHeight:{renderDOM({rowHeight:t}){return t?{style:`height: ${t}px`}:{}}}}},parseDOM(){return[{tag:"tr"}]},renderDOM({htmlAttributes:t}){return["tr",Me.mergeAttributes(this.options.htmlAttributes,t),0]}}),z2=rt.create({name:"tableCell",content:"block+",tableRole:"cell",isolating:!0,addOptions(){return{htmlAttributes:{}}},addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:[100],parseDOM:t=>{const e=t.getAttribute("data-colwidth");return e?e.split(",").map(n=>parseInt(n,10)):null},renderDOM:t=>t.colwidth?{"data-colwidth":t.colwidth.join(",")}:{}},background:{renderDOM({background:t}){if(!t)return{};const{color:e}=t||{};return{style:`background-color: ${e?`#${e}`:"transparent"}`}}},verticalAlign:{renderDOM({verticalAlign:t}){return t?{style:`vertical-align: ${t}`}:{}}},cellMargins:{renderDOM({cellMargins:t}){return t?{style:["top","right","bottom","left"].map(e=>{const n=t?.[e];return n?`padding-${e}: ${n}px;`:""}).join(" ")}:{}}},borders:{default:()=>B2(),renderDOM({borders:t}){return t?{style:["top","right","bottom","left"].map(e=>{const n=t?.[e];return n&&n.val==="none"?`border-${e}: ${n.val};`:n?`border-${e}: ${n.size}px solid ${n.color||"black"};`:""}).join(" ")}:{}}},widthType:{default:"auto",rendered:!1},widthUnit:{default:"px",rendered:!1}}},parseDOM(){return[{tag:"td"}]},renderDOM({htmlAttributes:t}){return["td",Me.mergeAttributes(this.options.htmlAttributes,t),0]}});var pr,Lr;class d5{constructor(e){Cr(this,pr),Fe(this,"editor"),Fe(this,"node"),Fe(this,"decorations"),Fe(this,"getPos"),Fe(this,"htmlAttributes"),Fe(this,"dom"),Fe(this,"annotationClass"),Fe(this,"annotationContentClass"),Fe(this,"borderColor"),this.editor=e.editor,this.node=e.node,this.decorations=e.decorations,this.getPos=e.getPos,this.htmlAttributes=e.htmlAttributes,this.annotationClass=e.annotationClass,this.annotationContentClass=e.annotationContentClass,this.borderColor=e.borderColor,this.handleAnnotationClick=this.handleAnnotationClick.bind(this),this.handleAnnotationDoubleClick=this.handleAnnotationDoubleClick.bind(this),this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.buildView(),this.attachEventListeners()}buildView(){let{type:e}=this.node.attrs,n={text:(...r)=>this.buildTextView(...r),image:(...r)=>this.buildImageView(...r),signature:(...r)=>this.buildSignatureView(...r),checkbox:(...r)=>this.buildCheckboxView(...r),html:(...r)=>this.buildHTMLView(...r),link:(...r)=>this.buildLinkView(...r),default:(...r)=>this.buildTextView(...r)};(n[e]??n.default)()}buildTextView(){let{displayLabel:e}=this.node.attrs,{annotation:n}=Ie(this,pr,Lr).call(this,{displayLabel:e});this.dom=n}buildImageView(){let{displayLabel:e,imageSrc:n}=this.node.attrs,{annotation:r,content:o}=Ie(this,pr,Lr).call(this);if(n){let i=document.createElement("img");i.src=n,i.alt=e,i.style.height="auto",i.style.maxWidth="100%",i.style.pointerEvents="none",i.style.verticalAlign="middle",o.append(i),r.style.display="inline-block",o.style.display="inline-block"}else o.textContent=e;this.dom=r}buildSignatureView(){let{displayLabel:e,imageSrc:n}=this.node.attrs;e=e||"Signature";let{annotation:r,content:o}=Ie(this,pr,Lr).call(this);if(n){let i=document.createElement("img");i.src=n,i.alt=e,i.style.height="auto",i.style.maxWidth="100%",i.style.maxHeight="28px",i.style.pointerEvents="none",i.style.verticalAlign="middle",o.append(i),r.style.display="inline-block",o.style.display="inline-block"}else o.textContent=e;this.dom=r}buildCheckboxView(){let{displayLabel:e}=this.node.attrs,{annotation:n}=Ie(this,pr,Lr).call(this,{displayLabel:e});this.dom=n}buildHTMLView(){let{displayLabel:e,rawHtml:n}=this.node.attrs,{annotation:r,content:o}=Ie(this,pr,Lr).call(this);n?(o.innerHTML=n.trim(),r.style.display="inline-block",o.style.display="inline-block"):o.textContent=e,this.dom=r}buildLinkView(){let{displayLabel:e,linkUrl:n}=this.node.attrs,{annotation:r,content:o}=Ie(this,pr,Lr).call(this);if(n){let i=document.createElement("a");i.href=n,i.target="_blank",i.textContent=n,i.style.textDecoration="none",o.append(i),o.style.pointerEvents="all"}else o.textContent=e;this.dom=r}attachEventListeners(){this.dom.addEventListener("click",this.handleAnnotationClick),this.dom.addEventListener("dblclick",this.handleAnnotationDoubleClick),this.editor.on("selectionUpdate",this.handleSelectionUpdate)}removeEventListeners(){this.dom.removeEventListener("click",this.handleAnnotationClick),this.dom.removeEventListener("dblclick",this.handleAnnotationDoubleClick),this.editor.off("selectionUpdate",this.handleSelectionUpdate)}handleSelectionUpdate({editor:e,transaction:n}){if(!this.editor.isEditable)return;let{selection:r}=e.state;if(r instanceof Ne){let o=r.node;this.node.eq(o)&&this.editor.emit("fieldAnnotationSelected",{editor:this.editor,node:this.node,nodePos:this.getPos(),target:this.dom})}}handleAnnotationClick(e){this.editor.isEditable&&this.editor.emit("fieldAnnotationClicked",{editor:this.editor,node:this.node,nodePos:this.getPos(),event:e,currentTarget:e.currentTarget})}handleAnnotationDoubleClick(e){this.editor.isEditable&&this.editor.emit("fieldAnnotationDoubleClicked",{editor:this.editor,node:this.node,nodePos:this.getPos(),event:e,currentTarget:e.currentTarget})}stopEvent(e){return this.editor.isEditable?!1:(e.preventDefault(),!0)}update(e){return!1}ignoreMutation(e){return!0}destroy(){this.removeEventListeners()}updateAttributes(e){this.editor.commands.command(({tr:n})=>(n.setNodeMarkup(this.getPos(),void 0,{...this.node.attrs,...e}),!0))}}pr=new WeakSet,Lr=function({displayLabel:t}={}){let{highlighted:e}=this.node.attrs,n=document.createElement("span");n.classList.add(this.annotationClass);let r=document.createElement("span");r.classList.add(this.annotationContentClass),r.style.pointerEvents="none",r.contentEditable="false",t&&(r.textContent=t),n.append(r);let o=e===!1,i=[`border: 2px solid ${this.borderColor}`,"border-radius: 2px","padding: 1px 2px","box-sizing: border-box"].join("; "),s=Me.mergeAttributes(this.htmlAttributes,{style:o?"":i});for(let[a,l]of Object.entries(s))n.setAttribute(a,l);return{annotation:n,content:r}};function j2(t){let e=[];return!t.steps.length||t.meta&&!Object.keys(t.meta).every(n=>["inputType","uiEvent","paste"].includes(n))||["historyUndo","historyRedo"].includes(t.getMeta("inputType"))||["drop"].includes(t.getMeta("uiEvent"))||t.getMeta("fieldAnnotationUpdate")===!0||t.steps.forEach((n,r)=>{if(n instanceof $t&&n.from!==n.to){let o=t.mapping.maps[r];t.before.nodesBetween(n.from,n.to,(i,s)=>{i.type.name==="fieldAnnotation"&&o.mapResult(s).deleted&&e.push({node:i,pos:s})})}}),e}function q2(t,e){let n=j2(e);n.length>0&&setTimeout(()=>{t.emit("fieldAnnotationDeleted",{editor:t,removedNodes:n})},0)}const{findChildren:f5}=Xf;function xr(t){return f5(t.doc,e=>e.type.name==="fieldAnnotation")}const p5=(t={})=>{let{editor:e,annotationClass:n}=t;return new Ze({key:new et("fieldAnnotation"),state:{init(){return null},apply(r,o){return q2(e,r),o}},props:{handleDrop(r,o,i,s){if(s)return!1;let a=o?.dataTransfer.getData("fieldAnnotation");if(a){if(t.handleDropOutside)h5({fieldAnnotation:a,editor:e,view:r,event:o});else{let l;try{l=JSON.parse(a).attributes}catch{return!1}const c=r.posAtCoords({left:o.clientX,top:o.clientY});c&&e.commands.addFieldAnnotation(c.pos,{...l})}return!0}return!1},handlePaste(r,o,i){const s=i.content.content.filter(a=>a.type.name==="fieldAnnotation");return s.length&&e.emit("fieldAnnotationPaste",{content:s,editor:e}),!1},handleDOMEvents:{dragstart:(r,o)=>{if(!o.target)return!1;let{target:i}=o;return i.classList?.contains(n)&&o.dataTransfer?.setDragImage(i,0,0),!1}}},appendTransaction:(r,o,i)=>{if(!(r.some(u=>u.docChanged)&&!o.doc.eq(i.doc)))return;let{tr:s,doc:a}=i,l=!1,c=xr(i);if(c.length)return c.forEach(({node:u,pos:d})=>{let{marks:f}=u,p=s.doc.nodeAt(d);f.length>0&&u.eq(p)&&(s.removeMark(d,d+u.nodeSize,null),l=!0)}),l?s:null}})};function h5({fieldAnnotation:t,editor:e,view:n,event:r}){let o;try{o=JSON.parse(t).sourceField}catch{return}let i=n.posAtCoords({left:r.clientX,top:r.clientY});i&&e.emit("fieldAnnotationDropped",{sourceField:o,editor:e,coordinates:i,pos:i.pos})}function m5(t,e){return xr(e).map(({node:n,pos:r})=>{let o=z1(t,r,r+n.nodeSize);return{node:n,pos:r,rect:o}})}function g5(t,e){let n=xr(e),r=[];return n.forEach(o=>{t(o.node)&&r.push(o)}),r}const{findChildren:y5}=Xf;function Sa(t,e){return y5(e.doc,n=>{let r=n.type.name==="fieldAnnotation";return Array.isArray(t)?r&&t.includes(n.attrs.fieldId):r&&n.attrs.fieldId===t})}function b5(t,e){return w5(e.doc,n=>n.type.name==="fieldAnnotation"&&n.attrs.fieldId===t)}function w5(t,e){let n=null;return t.descendants((r,o)=>{if(e(r)&&(n={node:r,pos:o}),n)return!1}),n}function Ca(t,e,n){let r=[];return n.nodesBetween(t,e,(o,i)=>{!o||o?.nodeSize===void 0||o.type.name==="fieldAnnotation"&&r.push({node:o,pos:i})}),r}const v5=Object.freeze(Object.defineProperty({__proto__:null,findFieldAnnotations:g5,findFieldAnnotationsBetween:Ca,findFieldAnnotationsByFieldId:Sa,findFirstFieldAnnotationByFieldId:b5,findRemovedFieldAnnotations:j2,getAllFieldAnnotations:xr,getAllFieldAnnotationsWithRect:m5,trackFieldAnnotationsDeletion:q2},Symbol.toStringTag,{value:"Module"}));function Id(t,e,n){return Math.min(Math.max(t,n),e)}class x5 extends Error{constructor(e){super(`Failed to parse color: "${e}"`)}}var Bi=x5;function k5(t){if(typeof t!="string")throw new Bi(t);if(t.trim().toLowerCase()==="transparent")return[0,0,0,0];let e=t.trim();e=D5.test(t)?E5(t):t;const n=A5.exec(e);if(n){const s=Array.from(n).slice(1);return[...s.slice(0,3).map(a=>parseInt(ds(a,2),16)),parseInt(ds(s[3]||"f",2),16)/255]}const r=$5.exec(e);if(r){const s=Array.from(r).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,16)),parseInt(s[3]||"ff",16)/255]}const o=T5.exec(e);if(o){const s=Array.from(o).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,10)),parseFloat(s[3]||"1")]}const i=O5.exec(e);if(i){const[s,a,l,c]=Array.from(i).slice(1).map(parseFloat);if(Id(0,100,a)!==a)throw new Bi(t);if(Id(0,100,l)!==l)throw new Bi(t);return[...M5(s,a,l),Number.isNaN(c)?1:c]}throw new Bi(t)}function S5(t){let e=5381,n=t.length;for(;n;)e=e*33^t.charCodeAt(--n);return(e>>>0)%2341}const Ay=t=>parseInt(t.replace(/_/g,""),36),C5="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((t,e)=>{const n=Ay(e.substring(0,3)),r=Ay(e.substring(3)).toString(16);let o="";for(let i=0;i<6-r.length;i++)o+="0";return t[n]=`${o}${r}`,t},{});function E5(t){const e=t.toLowerCase().trim(),n=C5[S5(e)];if(!n)throw new Bi(t);return`#${n}`}const ds=(t,e)=>Array.from(Array(e)).map(()=>t).join(""),A5=new RegExp(`^#${ds("([a-f0-9])",3)}([a-f0-9])?$`,"i"),$5=new RegExp(`^#${ds("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),T5=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${ds(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),O5=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,D5=/^[a-z]+$/i,$y=t=>Math.round(t*255),M5=(t,e,n)=>{let r=n/100;if(e===0)return[r,r,r].map($y);const o=(t%360+360)%360/60,i=(1-Math.abs(2*r-1))*(e/100),s=i*(1-Math.abs(o%2-1));let a=0,l=0,c=0;o>=0&&o<1?(a=i,l=s):o>=1&&o<2?(a=s,l=i):o>=2&&o<3?(l=i,c=s):o>=3&&o<4?(l=s,c=i):o>=4&&o<5?(a=s,c=i):o>=5&&o<6&&(a=i,c=s);const u=r-i/2,d=a+u,f=l+u,p=c+u;return[d,f,p].map($y)};function _5(t){const[e,n,r,o]=k5(t);let i=s=>{const a=Id(0,255,s).toString(16);return a.length===1?`0${a}`:a};return`#${i(e)}${i(n)}${i(r)}${o<1?i(Math.round(o*255)):""}`}const Fd="annotation",V2="annotation-content",U2=rt.create({name:"fieldAnnotation",group:"inline",inline:!0,atom:!0,draggable:!0,selectable:!0,addOptions(){return{htmlAttributes:{class:Fd},annotationClass:Fd,annotationContentClass:V2,types:["text","image","signature","checkbox","html","link"],defaultType:"text",borderColor:"#b015b3",visibilityOptions:["visible","hidden"],handleDropOutside:!0,toggleFormatNames:["bold","italic","underline"]}},addAttributes(){return{type:{default:this.options.defaultType,parseDOM:t=>t.getAttribute("data-type"),renderDOM:t=>t.type?{"data-type":t.type}:{}},displayLabel:{default:"Text field",parseDOM:t=>t.getAttribute("data-display-label"),renderDOM:t=>t.displayLabel?{"data-display-label":t.displayLabel}:{}},imageSrc:{default:null,rendered:!1,parseDOM:t=>t.querySelector("img")?.getAttribute("src")||null},rawHtml:{default:null,parseDOM:t=>{try{return JSON.parse(t.getAttribute("data-raw-html"))}catch(e){console.warn("Paste parse error",e)}return null},renderDOM:t=>t.rawHtml?{"data-raw-html":JSON.stringify(t.rawHtml)}:{}},linkUrl:{default:null,rendered:!1,parseDOM:t=>t.querySelector("a")?.getAttribute("href")||null},fieldId:{default:null,parseDOM:t=>t.getAttribute("data-field-id"),renderDOM:t=>t.fieldId?{"data-field-id":t.fieldId}:{}},fieldType:{default:null,parseDOM:t=>t.getAttribute("data-field-type"),renderDOM:t=>t.fieldType?{"data-field-type":t.fieldType}:{}},fieldColor:{default:"#980043",parseDOM:t=>t.getAttribute("data-field-color")||t.style.backgroundColor||null,renderDOM:t=>{if(!t.fieldColor)return{};let e=_5(t.fieldColor);return e.slice(1).length===6&&(e=`${e}33`),t.highlighted===!1?{"data-field-color":e}:{"data-field-color":e,style:`background-color: ${e}`}}},hidden:{default:!1,parseDOM:t=>{let e=t.hasAttribute("hidden"),n=t.style.display==="none";return e||n},renderDOM:t=>t.hidden?{style:"display: none"}:{}},visibility:{default:"visible",parseDOM:t=>{let e=t.style.visibility||"visible";return this.options.visibilityOptions.includes(e)?e:"visible"},renderDOM:t=>!t.visibility||t.visibility==="visible"?{}:{style:`visibility: ${t.visibility}`}},highlighted:{default:!0,rendered:!1},multipleImage:{default:!1,parseDOM:t=>t.getAttribute("data-multiple-image"),renderDOM:t=>t.multipleImage?{"data-multiple-image":t.multipleImage}:{}},size:{default:null,renderDOM:({size:t})=>!t||!t.width?{}:{style:`width: ${t.width}px; height: ${t.height}px; overflow: hidden;`}},extras:{default:{},rendered:!1},bold:{default:!1,parseDOM:t=>t.getAttribute("data-bold")==="true",renderDOM:t=>t.bold?{"data-bold":"true",style:"font-weight: bold"}:{}},italic:{default:!1,parseDOM:t=>t.getAttribute("data-italic")==="true",renderDOM:t=>t.italic?{"data-italic":"true",style:"font-style: italic"}:{}},underline:{default:!1,parseDOM:t=>t.getAttribute("data-underline")==="true",renderDOM:t=>t.underline?{"data-underline":"true",style:"text-decoration: underline"}:{}},fontFamily:{default:null,parseDOM:t=>t.getAttribute("data-font-family")||t.style.fontFamily||null,renderDOM:t=>t.fontFamily?{"data-font-family":t.fontFamily,style:`font-family: ${t.fontFamily}`}:{}},fontSize:{default:null,parseDOM:t=>t.getAttribute("data-font-size")||t.style.fontSize||null,renderDOM:t=>{if(!t.fontSize)return{};let[e,n]=tr(t.fontSize);if(Number.isNaN(e))return{};n=n||"pt";let r=`${e}${n}`;return{"data-font-size":r,style:`font-size: ${r}`}}}}},parseDOM(){return[{tag:`span.${this.options.annotationClass}`,priority:60}]},renderDOM({node:t,htmlAttributes:e}){let{type:n,displayLabel:r,imageSrc:o,rawHtml:i,linkUrl:s}=t.attrs,a=()=>["span",Me.mergeAttributes(this.options.htmlAttributes,e),["span",{class:`${this.options.annotationContentClass}`},r]],l=()=>{let d=()=>o?["img",{src:o,alt:r}]:r;return["span",Me.mergeAttributes(this.options.htmlAttributes,e),["span",{class:`${this.options.annotationContentClass}`},d()]]},c=()=>{let d=()=>s?["a",{href:s,target:"_blank"},s]:r;return["span",Me.mergeAttributes(this.options.htmlAttributes,e),["span",{class:`${this.options.annotationContentClass}`},d()]]},u={text:()=>a(),image:()=>l(),signature:()=>l(),checkbox:()=>a(),html:()=>a(),link:()=>c(),default:()=>a()};return(u[n]??u.default)()},addCommands(){return{addFieldAnnotation:(t,e={},n=!1)=>({editor:r,dispatch:o,state:i,tr:s})=>{if(o){let{schema:a}=r,l=s.mapping.map(t),c=i.doc.resolve(l).marks();c=c.length?[...c]:null;let u=N5(c),d=a.nodes[this.name].create({...e,...u},null,null);i.tr.insert(l,d).setSelection(Re.near(s.doc.resolve(l+d.nodeSize))),n&&this.editor.view.focus()}return!0},updateFieldAnnotations:(t,e={})=>({dispatch:n,state:r,commands:o})=>{let i=Sa(t,r);return i.length&&n?o.updateFieldAnnotationsAttributes(i,e):!0},updateFieldAnnotation:(t,e={})=>({dispatch:n,commands:r})=>(t&&n&&(r.updateFieldAnnotationsAttributes([t],e),this.editor.options.pagination&&setTimeout(()=>{const o=this.editor.view.state.tr;o.setMeta("forceUpdatePagination",!0),this.editor.view.dispatch(o)},50)),!0),updateFieldAnnotationsAttributes:(t,e={})=>({dispatch:n,tr:r})=>(n&&(r.setMeta("fieldAnnotationUpdate",!0),t.forEach(o=>{let{pos:i,node:s}=o,a=r.mapping.map(i),l=r.doc.nodeAt(a);s.attrs.fieldId===l?.attrs?.fieldId&&r.setNodeMarkup(a,void 0,{...s.attrs,...e})})),!0),deleteFieldAnnotations:t=>({dispatch:e,state:n,tr:r})=>{let o=Sa(t,n);return o.length&&e&&o.forEach(i=>{let{pos:s,node:a}=i,l=r.mapping.map(s),c=r.mapping.map(s+a.nodeSize),u=r.doc.nodeAt(l);a.eq(u)&&r.delete(l,c)}),!0},deleteFieldAnnotationsByNode:t=>({dispatch:e,state:n,tr:r})=>(t.length&&e&&t.forEach(o=>{let{pos:i,node:s}=o,a=r.mapping.map(i),l=r.mapping.map(i+s.nodeSize),c=r.doc.nodeAt(a);s.eq(c)&&r.delete(a,l)}),!0),deleteFieldAnnotation:t=>({dispatch:e,state:n,tr:r})=>{if(!t)return!0;if(e){let{pos:o,node:i}=t,s=r.mapping.map(o),a=r.mapping.map(o+i.nodeSize),l=r.doc.nodeAt(s);i.eq(l)&&r.delete(s,a)}return!0},sliceFieldAnnotations:(t,e)=>({dispatch:n,state:r,tr:o})=>{let i=Sa(t,r);return i.length&&n&&i.forEach((s,a)=>{if(a>=e){let{pos:l,node:c}=s,u=o.mapping.map(l),d=o.mapping.map(l+c.nodeSize),f=o.doc.nodeAt(u);c.eq(f)&&o.delete(u,d)}}),!0},setFieldAnnotationsHiddenByCondition:(t=()=>!1,e=!1)=>({dispatch:n,state:r,chain:o})=>{let i=xr(r);if(!i.length)return!0;if(n){let s=[],a=i.filter(l=>{if(t(l.node))return l;s.push(l)});return e?o().updateFieldAnnotationsAttributes(a,{hidden:!0}).updateFieldAnnotationsAttributes(s,{hidden:!1}).run():o().updateFieldAnnotationsAttributes(a,{hidden:!0}).run()}return!0},unsetFieldAnnotationsHidden:()=>({dispatch:t,state:e,commands:n})=>{let r=xr(e);return r.length&&t?n.updateFieldAnnotationsAttributes(r,{hidden:!1}):!0},setFieldAnnotationsVisibility:(t="visible")=>({dispatch:e,state:n,commands:r})=>{let o=xr(n);return o.length?this.options.visibilityOptions.includes(t)?e?r.updateFieldAnnotationsAttributes(o,{visibility:t}):!0:!1:!0},setFieldAnnotationsHighlighted:(t=()=>!1,e=!0)=>({dispatch:n,state:r,commands:o})=>{let i=xr(r);if(!i.length)return!0;if(n){let s=i.filter(a=>{if(t(a.node))return a});return o.updateFieldAnnotationsAttributes(s,{highlighted:e})}return!0},toggleFieldAnnotationsFormat:(t,e=!1)=>({dispatch:n,tr:r,state:o,commands:i})=>{if(!this.options.toggleFormatNames.includes(t))return!1;let{from:s,to:a,node:l}=o.selection,c=Ca(s,a,o.doc);return c.length&&n&&(c.forEach(u=>{i.updateFieldAnnotationsAttributes([u],{[t]:!u.node.attrs[t]})}),e&&l?.type.name===this.name&&r.setSelection(Ne.create(r.doc,s))),!0},setFieldAnnotationsFontFamily:(t,e=!1)=>({dispatch:n,tr:r,state:o,commands:i})=>{let{from:s,to:a,node:l}=o.selection,c=Ca(s,a,o.doc);return c.length&&n&&(c.forEach(u=>{i.updateFieldAnnotationsAttributes([u],{fontFamily:t})}),e&&l?.type.name===this.name&&r.setSelection(Ne.create(r.doc,s))),!0},setFieldAnnotationsFontSize:(t,e=!1)=>({dispatch:n,tr:r,state:o,commands:i})=>{let{from:s,to:a,node:l}=o.selection,c=Ca(s,a,o.doc);if(!c.length)return!0;let[u,d]=tr(t);return Number.isNaN(u)?!1:(u=el(u,8,96),d=d||"pt",n&&(c.forEach(m=>{i.updateFieldAnnotationsAttributes([m],{fontSize:`${u}${d}`})}),e&&l?.type.name===this.name&&r.setSelection(Ne.create(r.doc,s))),!0)}}},addNodeView(){return t=>new d5({...t,annotationClass:this.options.annotationClass,annotationContentClass:this.options.annotationContentClass,borderColor:this.options.borderColor})},addPmPlugins(){return[p5({editor:this.editor,annotationClass:this.options.annotationClass,handleDropOutside:this.options.handleDropOutside})]}});function N5(t){if(!t)return{};let e={bold:!1,italic:!1,underline:!1,fontFamily:null,fontSize:null};if(t&&t.length){e.bold=t.some(r=>r.type.name==="bold"),e.italic=t.some(r=>r.type.name==="italic"),e.underline=t.some(r=>r.type.name==="underline");let n=t.find(r=>r.type.name==="textStyle");n&&(e.fontFamily=n.attrs.fontFamily??null,e.fontSize=n.attrs.fontSize??null)}return e}const no=new et("ImagePlaceholder"),I5=(t={})=>new Ze({key:no,state:{init(){return qe.empty},apply(e,n,r,o){n=n.map(e.mapping,e.doc);let i=e.getMeta(no);if(i?.type==="add"){let s=document.createElement("placeholder"),a=Pe.widget(i.pos,s,{id:i.id});n=n.add(e.doc,[a])}else i?.type==="remove"&&(n=n.remove(n.find(null,null,s=>s.id==i.id)));return n}},props:{decorations(e){return this.getState(e)}}}),F5=(t,e)=>{let n=no.getState(t)?.find(null,null,r=>r.id===e);return n?.length?n[0].from:null},B5=rt.create({name:"image",group:"inline",inline:!0,draggable:!0,addOptions(){return{allowBase64:!0,htmlAttributes:{}}},addStorage(){return{media:{}}},addAttributes(){return{src:{default:null,renderDOM:({src:t})=>({src:this.storage.media[t]})},alt:{default:null},title:{default:null},rId:{default:null,rendered:!1},originalPadding:{default:null,rendered:!1},size:{default:{},renderDOM:({size:t})=>{let e="display: inline-block;",{width:n,height:r}=t??{};return n&&(e+=`width: ${n}px;`),r&&(e+="height: auto;"),{style:e}}},marginOffset:{default:{},renderDOM:({marginOffset:t})=>{let{left:e=0,top:n=0}=t??{},r="";return e&&(r+=`margin-left: ${e}px;`),n&&(r+=`margin-top: ${n}px;`),{style:r}}}}},parseDOM(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderDOM({htmlAttributes:t}){return["img",Me.mergeAttributes(this.options.htmlAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addPmPlugins(){return[I5()]}}),R5=rt.create({name:"bookmarkStart",group:"inline",content:"inline*",inline:!0,addOptions(){return{htmlAttributes:{style:"height: 0; width: 0;"}}},addAttributes(){return{name:{default:null,renderDOM:({name:t})=>t?{name:t}:{}},id:{default:null,renderDOM:({id:t})=>t?{id:t}:{}}}},renderDOM({htmlAttributes:t}){return["a",Me.mergeAttributes(this.options.htmlAttributes,t)]}}),H2=rt.create({name:"mention",group:"inline",inline:!0,selectable:!1,atom:!0,addOptions(){return{htmlAttributes:{class:"super-editor-mention"}}},parseDOM(){return[{tag:`span[data-type="${this.name||this.email}"]`,getAttrs:t=>({name:t.getAttribute("name")||null,email:t.getAttribute("email")||null})}]},renderDOM({node:t,htmlAttributes:e}){const{name:n,email:r}=t.attrs;return["span",Me.mergeAttributes({"data-type":this.name||this.email},this.options.htmlAttributes,e),`@${n||r}`]},addAttributes(){return{name:{default:null},email:{default:null}}}}),W2=wn.create({name:"textStyle",addOptions(){return{htmlAttributes:{}}},parseDOM(){return[{tag:"span",getAttrs:t=>{const e=t.hasAttribute("style"),n=t.classList.contains(Fd)||t.classList.contains(V2);return!e||n?!1:{}}}]},renderDOM({htmlAttributes:t}){return["span",Me.mergeAttributes(this.options.htmlAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Me.getMarkAttributes(t,this.type);return Object.entries(n).some(([,r])=>!!r)?!0:e.unsetMark(this.name)}}}}),G2=wn.create({name:"bold",addOptions(){return{htmlAttributes:{}}},parseDOM(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name=="strong"},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderDOM({htmlAttributes:t}){return["strong",Me.mergeAttributes(this.options.htmlAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name)}},addShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}}}),K2=wn.create({name:"italic",addOptions(){return{htmlAttributes:{}}},parseDOM(){return[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:t=>t.type.name=="em"}]},renderDOM({htmlAttributes:t}){return["em",Me.mergeAttributes(this.options.htmlAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name)}},addShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}}}),X2=wn.create({name:"underline",addOptions(){return{htmlAttributes:{}}},parseDOM(){return[{tag:"u"},{style:"text-decoration=underline"},{style:"text-decoration=auto",clearMark:t=>t.type.name=="u"}]},renderDOM({htmlAttributes:t}){return["u",Me.mergeAttributes(this.options.htmlAttributes,t),0]},addAttributes(){return{underlineType:{default:"single"}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name)}},addShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),J2=wn.create({name:"highlight",addOptions(){return{htmlAttributes:{}}},addAttributes(){return{color:{default:null,parseDOM:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderDOM:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}},parseDOM(){return[{tag:"mark"}]},renderDOM({htmlAttributes:t}){return["mark",Me.mergeAttributes(this.options.htmlAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,{color:t}),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name),toggleHighlight:()=>({commands:t})=>t.toggleMark(this.name)}},addShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}}}),Y2=wn.create({name:"strike",addOptions(){return{htmlAttributes:{}}},parseDOM(){return[{tag:"s"},{style:"text-decoration=line-through"},{style:"text-decoration=auto",clearMark:t=>t.type.name=="s"}]},renderDOM({htmlAttributes:t}){return["s",Me.mergeAttributes(this.options.htmlAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name)}},addShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}}}),Z2=wn.create({name:"link",priority:1e3,keepOnSplit:!1,inclusive:!1,addOptions(){return{protocols:["http","https"],htmlAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null}}},parseDOM(){return[{tag:"a"}]},renderDOM({htmlAttributes:t}){return Ty(t.href,this.options.protocols)?["a",Me.mergeAttributes(this.options.htmlAttributes,t),0]:["a",mergeAttributes(this.options.htmlAttributes,{...t,href:""}),0]},addAttributes(){return{href:{default:null,renderDOM:({href:t,name:e})=>t&&Ty(t,this.options.protocols)?{href:t}:e?{href:`#${e}`}:{}},target:{default:this.options.htmlAttributes.target},rel:{default:this.options.htmlAttributes.rel},rId:{default:this.options.htmlAttributes.rId||null},text:{default:null},name:{default:null}}},addCommands(){return{setLink:({href:t})=>({chain:e})=>e().setMark(this.name,{href:t}).run(),unsetLink:()=>({chain:t})=>t().unsetMark("underline").unsetColor().unsetMark(this.name,{extendEmptyMarkRange:!0}).run(),toggleLink:({href:t})=>({commands:e})=>t?e.setLink({href:t}):e.unsetLink()}}}),L5=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Ty(t,e){const n=["http","https","mailto"];return e&&e.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&n.push(o)}),!t||t.replace(L5,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))`,"i"))}const P5="track-insert",Q2=wn.create({name:It,group:"track",inclusive:!1,addOptions(){return{htmlAttributes:{class:P5}}},addAttributes(){return{id:{default:"",parseDOM:t=>t.getAttribute("data-id"),renderDOM:t=>t.id?{"data-id":t.id}:{}},author:{default:"",parseDOM:t=>t.getAttribute("data-author"),renderDOM:t=>t.author?{"data-author":t.author}:{}},authorEmail:{default:"",parseDOM:t=>t.getAttribute("data-authoremail"),renderDOM:t=>t.authorEmail?{"data-authoremail":t.authorEmail}:{}},date:{default:"",parseDOM:t=>t.getAttribute("data-date"),renderDOM:t=>t.date?{"data-date":t.date}:{}}}},parseDOM(){return!1},renderDOM({htmlAttributes:t}){return["span",Me.mergeAttributes(this.options.htmlAttributes,t),0]}}),z5="track-delete",ex=wn.create({name:lt,group:"track",inclusive:!1,addOptions(){return{htmlAttributes:{class:z5}}},addAttributes(){return{id:{default:"",parseDOM:t=>t.getAttribute("data-id"),renderDOM:t=>t.id?{"data-id":t.id}:{}},author:{default:"",parseDOM:t=>t.getAttribute("data-author"),renderDOM:t=>t.author?{"data-author":t.author}:{}},authorEmail:{default:"",parseDOM:t=>t.getAttribute("data-authoremail"),renderDOM:t=>t.authorEmail?{"data-authoremail":t.authorEmail}:{}},date:{default:"",parseDOM:t=>t.getAttribute("data-date"),renderDOM:t=>t.date?{"data-date":t.date}:{}}}},parseDOM(){return!1},renderDOM({htmlAttributes:t}){return["span",Me.mergeAttributes(this.options.htmlAttributes,t),0]}}),Bd=t=>{if(!t)return[];let e;try{e=JSON.parse(t)}catch{return[]}return Array.isArray(e)?e.filter(n=>Object.hasOwn(n,"type")&&Object.hasOwn(n,"attrs")):[]},j5=Object.freeze(Object.defineProperty({__proto__:null,addMarkStep:W1,documentHelpers:GO,findTrackedMarkBetween:Hf,getTrackChanges:Jf,markDeletion:P1,markInsertion:L1,markWrapping:aD,parseFormatList:Bd,removeMarkStep:G1,replaceAroundStep:lD,replaceStep:H1,trackedTransaction:K1},Symbol.toStringTag,{value:"Module"})),q5="track-format",tx=wn.create({name:bt,group:"track",inclusive:!1,addOptions(){return{htmlAttributes:{class:q5}}},addAttributes(){return{id:{default:"",parseDOM:t=>t.getAttribute("data-id"),renderDOM:t=>t.id?{"data-id":t.id}:{}},author:{default:"",parseDOM:t=>t.getAttribute("data-author"),renderDOM:t=>t.author?{"data-author":t.author}:{}},authorEmail:{default:"",parseDOM:t=>t.getAttribute("data-authoremail"),renderDOM:t=>t.authorEmail?{"data-authoremail":t.authorEmail}:{}},date:{default:"",parseDOM:t=>t.getAttribute("data-date"),renderDOM:t=>t.date?{"data-date":t.date}:{}},before:{default:[],parseDOM:t=>Bd(t.getAttribute("data-before")),renderDOM:t=>t.before?{"data-before":JSON.stringify(t.before)}:{}},after:{default:[],parseDOM:t=>Bd(t.getAttribute("data-after")),renderDOM:t=>t.after?{"data-after":JSON.stringify(t.after)}:{}}}},parseDOM(){return!1},renderDOM({htmlAttributes:t}){return["span",Me.mergeAttributes(this.options.htmlAttributes,t),0]}}),V5=Qe.create({name:"trackChanges",addCommands(){return{acceptTrackedChangesBetween:(t,e)=>({state:n,dispatch:r})=>{let{tr:o,doc:i}=n;o.setMeta("acceptReject",!0);const s=new Ho;return i.nodesBetween(t,e,(a,l)=>{if(a.marks&&a.marks.find(c=>c.type.name===lt)){const c=new $t(s.map(Math.max(l,t)),s.map(Math.min(l+a.nodeSize,e)),ve.empty);o.step(c),s.appendMap(c.getMap())}else if(a.marks&&a.marks.find(c=>c.type.name===It)){const c=a.marks.find(u=>u.type.name===It);o.step(new gn(s.map(Math.max(l,t)),s.map(Math.min(l+a.nodeSize,e)),c))}else if(a.marks&&a.marks.find(c=>c.type.name===bt)){const c=a.marks.find(u=>u.type.name===bt);o.step(new gn(s.map(Math.max(l,t)),s.map(Math.min(l+a.nodeSize,e)),c))}}),o.steps.length&&r(o),!0},rejectTrackedChangesBetween:(t,e)=>({state:n,dispatch:r})=>{const{tr:o,doc:i}=n;o.setMeta("acceptReject",!0);const s=new Ho;return i.nodesBetween(t,e,(a,l)=>{if(a.marks&&a.marks.find(c=>c.type.name===lt)){const c=a.marks.find(u=>u.type.name===lt);o.step(new gn(s.map(Math.max(l,t)),s.map(Math.min(l+a.nodeSize,e)),c))}else if(a.marks&&a.marks.find(c=>c.type.name===It)){const c=new $t(s.map(Math.max(l,t)),s.map(Math.min(l+a.nodeSize,e)),ve.empty);o.step(c),s.appendMap(c.getMap())}else if(a.marks&&a.marks.find(c=>c.type.name===bt)){const c=a.marks.find(u=>u.type.name===bt);c.attrs.before.forEach(u=>{o.step(new Ss(s.map(Math.max(l,t)),s.map(Math.min(l+a.nodeSize,e)),n.schema.marks[u.type].create(u.attrs)))}),c.attrs.after.forEach(u=>{o.step(new gn(s.map(Math.max(l,t)),s.map(Math.min(l+a.nodeSize,e)),a.marks.find(d=>d.type.name===u.type)))}),o.step(new gn(s.map(Math.max(l,t)),s.map(Math.min(l+a.nodeSize,e)),c))}}),o.steps.length&&r(o),!0},acceptTrackedChange:({trackedChange:t})=>({commands:e})=>{const{start:n,end:r}=t;return e.acceptTrackedChangesBetween(n,r)},acceptTrackedChangeBySelection:()=>({state:t,commands:e})=>{const{from:n,to:r}=t.selection;return e.acceptTrackedChangesBetween(n,r)},acceptTrackedChangeById:t=>({state:e,tr:n,commands:r})=>(Oy(e,t)||[]).map(({from:o,to:i})=>{let s=n.mapping.map(o),a=n.mapping.map(i);return r.acceptTrackedChangesBetween(s,a)}).every(o=>o),acceptAllTrackedChanges:()=>({state:t,commands:e})=>{const n=t.doc.content.size;return e.acceptTrackedChangesBetween(0,n)},rejectTrackedChangeById:t=>({state:e,tr:n,commands:r})=>(Oy(e,t)||[]).map(({from:o,to:i})=>{let s=n.mapping.map(o),a=n.mapping.map(i);return r.rejectTrackedChangesBetween(s,a)}).every(o=>o),rejectTrackedChange:({trackedChange:t})=>({commands:e})=>{const{start:n,end:r}=t;return e.rejectTrackedChangesBetween(n,r)},rejectTrackedChangeOnSelection:()=>({state:t,commands:e})=>{const{from:n,to:r}=t.selection;return e.rejectTrackedChangesBetween(n,r)},rejectAllTrackedChanges:()=>({state:t,commands:e})=>{const n=t.doc.content.size;return e.rejectTrackedChangesBetween(0,n)},toggleTrackChanges:()=>({state:t})=>{const e=pt.getState(t);return e===void 0?!1:(t.tr.setMeta(pt,{type:"TRACK_CHANGES_ENABLE",value:!e.isTrackChangesActive}),!0)},enableTrackChanges:()=>({state:t})=>(t.tr.setMeta(pt,{type:"TRACK_CHANGES_ENABLE",value:!0}),!0),disableTrackChanges:()=>({state:t})=>(t.tr.setMeta(pt,{type:"TRACK_CHANGES_ENABLE",value:!1}),!0),toggleTrackChangesShowOriginal:()=>({state:t})=>{const e=pt.getState(t);return e===void 0?!1:(t.tr.setMeta(pt,{type:"SHOW_ONLY_ORIGINAL",value:!e.onlyOriginalShown}),!0)},enableTrackChangesShowOriginal:()=>({state:t})=>(t.tr.setMeta(pt,{type:"SHOW_ONLY_ORIGINAL",value:!0}),!0),disableTrackChangesShowOriginal:()=>({state:t})=>(t.tr.setMeta(pt,{type:"SHOW_ONLY_ORIGINAL",value:!1}),!0),toggleTrackChangesShowFinal:()=>({state:t,dispatch:e})=>{const n=pt.getState(t);return n===void 0?!1:(t.tr.setMeta(pt,{type:"SHOW_ONLY_MODIFIED",value:!n.onlyModifiedShown}),!0)},enableTrackChangesShowFinal:()=>({state:t})=>(t.tr.setMeta(pt,{type:"SHOW_ONLY_MODIFIED",value:!0}),!0)}},addPmPlugins(){return[KO()]}}),Oy=(t,e)=>{const n=Jf(t),r=n.findIndex(({mark:l})=>l.attrs.id===e);if(r===-1)return;const o=n[r],i=n[r-1],s=n[r+1];let a;return i&&o.start===i.end?a=i:s&&o.end===s.start&&(a=s),[o,a].filter(Boolean)},nx=Qe.create({name:"placeholder",addOptions(){return{placeholder:"Type something..."}},addPmPlugins(){const t=e=>{if(e.doc.textBetween(0,e.doc.content.size," "," ")!=="")return qe.empty;const{$from:n}=e.selection,r=Pe.node(n.before(),n.after(),{"data-placeholder":this.options.placeholder,class:"super-editor-placeholder"});return qe.create(e.doc,[r])};return[new Ze({key:new et("placeholder"),state:{init:(e,n)=>t(n),apply:(e,n,r,o)=>t(o)},props:{decorations(e){return this.getState(e)}}})]}});var Kt="top",pn="bottom",hn="right",Xt="left",tp="auto",Ds=[Kt,pn,hn,Xt],Qo="start",fs="end",U5="clippingParents",rx="viewport",yi="popper",H5="reference",Dy=Ds.reduce(function(t,e){return t.concat([e+"-"+Qo,e+"-"+fs])},[]),ox=[].concat(Ds,[tp]).reduce(function(t,e){return t.concat([e,e+"-"+Qo,e+"-"+fs])},[]),W5="beforeRead",G5="read",K5="afterRead",X5="beforeMain",J5="main",Y5="afterMain",Z5="beforeWrite",Q5="write",e_="afterWrite",t_=[W5,G5,K5,X5,J5,Y5,Z5,Q5,e_];function Rn(t){return t?(t.nodeName||"").toLowerCase():null}function sn(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function uo(t){var e=sn(t).Element;return t instanceof e||t instanceof Element}function fn(t){var e=sn(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function np(t){if(typeof ShadowRoot>"u")return!1;var e=sn(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function n_(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},o=e.attributes[n]||{},i=e.elements[n];!fn(i)||!Rn(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(s){var a=o[s];a===!1?i.removeAttribute(s):i.setAttribute(s,a===!0?"":a)}))})}function r_(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var o=e.elements[r],i=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=s.reduce(function(l,c){return l[c]="",l},{});!fn(o)||!Rn(o)||(Object.assign(o.style,a),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const ix={name:"applyStyles",enabled:!0,phase:"write",fn:n_,effect:r_,requires:["computeStyles"]};function _n(t){return t.split("-")[0]}var ro=Math.max,nl=Math.min,ei=Math.round;function Rd(){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 sx(){return!/^((?!chrome|android).)*safari/i.test(Rd())}function ti(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),o=1,i=1;e&&fn(t)&&(o=t.offsetWidth>0&&ei(r.width)/t.offsetWidth||1,i=t.offsetHeight>0&&ei(r.height)/t.offsetHeight||1);var s=uo(t)?sn(t):window,a=s.visualViewport,l=!sx()&&n,c=(r.left+(l&&a?a.offsetLeft:0))/o,u=(r.top+(l&&a?a.offsetTop:0))/i,d=r.width/o,f=r.height/i;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c,x:c,y:u}}function rp(t){var e=ti(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function ax(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&np(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function rr(t){return sn(t).getComputedStyle(t)}function o_(t){return["table","td","th"].indexOf(Rn(t))>=0}function Ir(t){return((uo(t)?t.ownerDocument:t.document)||window.document).documentElement}function Ol(t){return Rn(t)==="html"?t:t.assignedSlot||t.parentNode||(np(t)?t.host:null)||Ir(t)}function My(t){return!fn(t)||rr(t).position==="fixed"?null:t.offsetParent}function i_(t){var e=/firefox/i.test(Rd()),n=/Trident/i.test(Rd());if(n&&fn(t)){var r=rr(t);if(r.position==="fixed")return null}var o=Ol(t);for(np(o)&&(o=o.host);fn(o)&&["html","body"].indexOf(Rn(o))<0;){var i=rr(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function Ms(t){for(var e=sn(t),n=My(t);n&&o_(n)&&rr(n).position==="static";)n=My(n);return n&&(Rn(n)==="html"||Rn(n)==="body"&&rr(n).position==="static")?e:n||i_(t)||e}function op(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Wi(t,e,n){return ro(t,nl(e,n))}function s_(t,e,n){var r=Wi(t,e,n);return r>n?n:r}function lx(){return{top:0,right:0,bottom:0,left:0}}function cx(t){return Object.assign({},lx(),t)}function ux(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var a_=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,cx(typeof t!="number"?t:ux(t,Ds))};function l_(t){var e,n=t.state,r=t.name,o=t.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=_n(n.placement),l=op(a),c=[Xt,hn].indexOf(a)>=0,u=c?"height":"width";if(!(!i||!s)){var d=a_(o.padding,n),f=rp(i),p=l==="y"?Kt:Xt,h=l==="y"?pn:hn,m=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],y=s[l]-n.rects.reference[l],g=Ms(i),x=g?l==="y"?g.clientHeight||0:g.clientWidth||0:0,k=m/2-y/2,w=d[p],T=x-f[u]-d[h],D=x/2-f[u]/2+k,M=Wi(w,D,T),F=l;n.modifiersData[r]=(e={},e[F]=M,e.centerOffset=M-D,e)}}function c_(t){var e=t.state,n=t.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=e.elements.popper.querySelector(o),!o)||ax(e.elements.popper,o)&&(e.elements.arrow=o))}const u_={name:"arrow",enabled:!0,phase:"main",fn:l_,effect:c_,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ni(t){return t.split("-")[1]}var d_={top:"auto",right:"auto",bottom:"auto",left:"auto"};function f_(t,e){var n=t.x,r=t.y,o=e.devicePixelRatio||1;return{x:ei(n*o)/o||0,y:ei(r*o)/o||0}}function _y(t){var e,n=t.popper,r=t.popperRect,o=t.placement,i=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,d=t.isFixed,f=s.x,p=f===void 0?0:f,h=s.y,m=h===void 0?0:h,y=typeof u=="function"?u({x:p,y:m}):{x:p,y:m};p=y.x,m=y.y;var g=s.hasOwnProperty("x"),x=s.hasOwnProperty("y"),k=Xt,w=Kt,T=window;if(c){var D=Ms(n),M="clientHeight",F="clientWidth";if(D===sn(n)&&(D=Ir(n),rr(D).position!=="static"&&a==="absolute"&&(M="scrollHeight",F="scrollWidth")),D=D,o===Kt||(o===Xt||o===hn)&&i===fs){w=pn;var C=d&&D===T&&T.visualViewport?T.visualViewport.height:D[M];m-=C-r.height,m*=l?1:-1}if(o===Xt||(o===Kt||o===pn)&&i===fs){k=hn;var U=d&&D===T&&T.visualViewport?T.visualViewport.width:D[F];p-=U-r.width,p*=l?1:-1}}var ie=Object.assign({position:a},c&&d_),I=u===!0?f_({x:p,y:m},sn(n)):{x:p,y:m};if(p=I.x,m=I.y,l){var W;return Object.assign({},ie,(W={},W[w]=x?"0":"",W[k]=g?"0":"",W.transform=(T.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",W))}return Object.assign({},ie,(e={},e[w]=x?m+"px":"",e[k]=g?p+"px":"",e.transform="",e))}function p_(t){var e=t.state,n=t.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,s=i===void 0?!0:i,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:_n(e.placement),variation:ni(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,_y(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,_y(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 h_={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:p_,data:{}};var Xs={passive:!0};function m_(t){var e=t.state,n=t.instance,r=t.options,o=r.scroll,i=o===void 0?!0:o,s=r.resize,a=s===void 0?!0:s,l=sn(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",n.update,Xs)}),a&&l.addEventListener("resize",n.update,Xs),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",n.update,Xs)}),a&&l.removeEventListener("resize",n.update,Xs)}}const g_={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:m_,data:{}};var y_={left:"right",right:"left",bottom:"top",top:"bottom"};function Ea(t){return t.replace(/left|right|bottom|top/g,function(e){return y_[e]})}var b_={start:"end",end:"start"};function Ny(t){return t.replace(/start|end/g,function(e){return b_[e]})}function ip(t){var e=sn(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function sp(t){return ti(Ir(t)).left+ip(t).scrollLeft}function w_(t,e){var n=sn(t),r=Ir(t),o=n.visualViewport,i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;var c=sx();(c||!c&&e==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a+sp(t),y:l}}function v_(t){var e,n=Ir(t),r=ip(t),o=(e=t.ownerDocument)==null?void 0:e.body,i=ro(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=ro(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+sp(t),l=-r.scrollTop;return rr(o||n).direction==="rtl"&&(a+=ro(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function ap(t){var e=rr(t),n=e.overflow,r=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function dx(t){return["html","body","#document"].indexOf(Rn(t))>=0?t.ownerDocument.body:fn(t)&&ap(t)?t:dx(Ol(t))}function Gi(t,e){var n;e===void 0&&(e=[]);var r=dx(t),o=r===((n=t.ownerDocument)==null?void 0:n.body),i=sn(r),s=o?[i].concat(i.visualViewport||[],ap(r)?r:[]):r,a=e.concat(s);return o?a:a.concat(Gi(Ol(s)))}function Ld(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function x_(t,e){var n=ti(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function Iy(t,e,n){return e===rx?Ld(w_(t,n)):uo(e)?x_(e,n):Ld(v_(Ir(t)))}function k_(t){var e=Gi(Ol(t)),n=["absolute","fixed"].indexOf(rr(t).position)>=0,r=n&&fn(t)?Ms(t):t;return uo(r)?e.filter(function(o){return uo(o)&&ax(o,r)&&Rn(o)!=="body"}):[]}function S_(t,e,n,r){var o=e==="clippingParents"?k_(t):[].concat(e),i=[].concat(o,[n]),s=i[0],a=i.reduce(function(l,c){var u=Iy(t,c,r);return l.top=ro(u.top,l.top),l.right=nl(u.right,l.right),l.bottom=nl(u.bottom,l.bottom),l.left=ro(u.left,l.left),l},Iy(t,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function fx(t){var e=t.reference,n=t.element,r=t.placement,o=r?_n(r):null,i=r?ni(r):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(o){case Kt:l={x:s,y:e.y-n.height};break;case pn:l={x:s,y:e.y+e.height};break;case hn:l={x:e.x+e.width,y:a};break;case Xt:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var c=o?op(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case Qo:l[c]=l[c]-(e[u]/2-n[u]/2);break;case fs:l[c]=l[c]+(e[u]/2-n[u]/2);break}}return l}function ps(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=r===void 0?t.placement:r,i=n.strategy,s=i===void 0?t.strategy:i,a=n.boundary,l=a===void 0?U5:a,c=n.rootBoundary,u=c===void 0?rx:c,d=n.elementContext,f=d===void 0?yi:d,p=n.altBoundary,h=p===void 0?!1:p,m=n.padding,y=m===void 0?0:m,g=cx(typeof y!="number"?y:ux(y,Ds)),x=f===yi?H5:yi,k=t.rects.popper,w=t.elements[h?x:f],T=S_(uo(w)?w:w.contextElement||Ir(t.elements.popper),l,u,s),D=ti(t.elements.reference),M=fx({reference:D,element:k,placement:o}),F=Ld(Object.assign({},k,M)),C=f===yi?F:D,U={top:T.top-C.top+g.top,bottom:C.bottom-T.bottom+g.bottom,left:T.left-C.left+g.left,right:C.right-T.right+g.right},ie=t.modifiersData.offset;if(f===yi&&ie){var I=ie[o];Object.keys(U).forEach(function(W){var A=[hn,pn].indexOf(W)>=0?1:-1,G=[Kt,pn].indexOf(W)>=0?"y":"x";U[W]+=I[G]*A})}return U}function C_(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?ox:l,u=ni(r),d=u?a?Dy:Dy.filter(function(h){return ni(h)===u}):Ds,f=d.filter(function(h){return c.indexOf(h)>=0});f.length===0&&(f=d);var p=f.reduce(function(h,m){return h[m]=ps(t,{placement:m,boundary:o,rootBoundary:i,padding:s})[_n(m)],h},{});return Object.keys(p).sort(function(h,m){return p[h]-p[m]})}function E_(t){if(_n(t)===tp)return[];var e=Ea(t);return[Ny(t),e,Ny(e)]}function A_(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,h=p===void 0?!0:p,m=n.allowedAutoPlacements,y=e.options.placement,g=_n(y),x=g===y,k=l||(x||!h?[Ea(y)]:E_(y)),w=[y].concat(k).reduce(function(Z,re){return Z.concat(_n(re)===tp?C_(e,{placement:re,boundary:u,rootBoundary:d,padding:c,flipVariations:h,allowedAutoPlacements:m}):re)},[]),T=e.rects.reference,D=e.rects.popper,M=new Map,F=!0,C=w[0],U=0;U<w.length;U++){var ie=w[U],I=_n(ie),W=ni(ie)===Qo,A=[Kt,pn].indexOf(I)>=0,G=A?"width":"height",ae=ps(e,{placement:ie,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),X=A?W?hn:Xt:W?pn:Kt;T[G]>D[G]&&(X=Ea(X));var de=Ea(X),J=[];if(i&&J.push(ae[I]<=0),a&&J.push(ae[X]<=0,ae[de]<=0),J.every(function(Z){return Z})){C=ie,F=!1;break}M.set(ie,J)}if(F)for(var pe=h?3:1,Q=function(Z){var re=w.find(function(K){var $=M.get(K);if($)return $.slice(0,Z).every(function(E){return E})});if(re)return C=re,"break"},B=pe;B>0;B--){var ee=Q(B);if(ee==="break")break}e.placement!==C&&(e.modifiersData[r]._skip=!0,e.placement=C,e.reset=!0)}}const $_={name:"flip",enabled:!0,phase:"main",fn:A_,requiresIfExists:["offset"],data:{_skip:!1}};function Fy(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function By(t){return[Kt,hn,pn,Xt].some(function(e){return t[e]>=0})}function T_(t){var e=t.state,n=t.name,r=e.rects.reference,o=e.rects.popper,i=e.modifiersData.preventOverflow,s=ps(e,{elementContext:"reference"}),a=ps(e,{altBoundary:!0}),l=Fy(s,r),c=Fy(a,o,i),u=By(l),d=By(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const O_={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:T_};function D_(t,e,n){var r=_n(t),o=[Xt,Kt].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[Xt,hn].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function M_(t){var e=t.state,n=t.options,r=t.name,o=n.offset,i=o===void 0?[0,0]:o,s=ox.reduce(function(u,d){return u[d]=D_(d,e.rects,i),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[r]=s}const __={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:M_};function N_(t){var e=t.state,n=t.name;e.modifiersData[n]=fx({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const I_={name:"popperOffsets",enabled:!0,phase:"read",fn:N_,data:{}};function F_(t){return t==="x"?"y":"x"}function B_(t){var e=t.state,n=t.options,r=t.name,o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0?!0:f,h=n.tetherOffset,m=h===void 0?0:h,y=ps(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),g=_n(e.placement),x=ni(e.placement),k=!x,w=op(g),T=F_(w),D=e.modifiersData.popperOffsets,M=e.rects.reference,F=e.rects.popper,C=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,U=typeof C=="number"?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),ie=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,I={x:0,y:0};if(D){if(i){var W,A=w==="y"?Kt:Xt,G=w==="y"?pn:hn,ae=w==="y"?"height":"width",X=D[w],de=X+y[A],J=X-y[G],pe=p?-F[ae]/2:0,Q=x===Qo?M[ae]:F[ae],B=x===Qo?-F[ae]:-M[ae],ee=e.elements.arrow,Z=p&&ee?rp(ee):{width:0,height:0},re=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:lx(),K=re[A],$=re[G],E=Wi(0,M[ae],Z[ae]),H=k?M[ae]/2-pe-E-K-U.mainAxis:Q-E-K-U.mainAxis,q=k?-M[ae]/2+pe+E+$+U.mainAxis:B+E+$+U.mainAxis,N=e.elements.arrow&&Ms(e.elements.arrow),R=N?w==="y"?N.clientTop||0:N.clientLeft||0:0,le=(W=ie?.[w])!=null?W:0,S=X+H-le-R,oe=X+q-le,te=Wi(p?nl(de,S):de,X,p?ro(J,oe):J);D[w]=te,I[w]=te-X}if(a){var L,z=w==="x"?Kt:Xt,P=w==="x"?pn:hn,fe=D[T],me=T==="y"?"height":"width",se=fe+y[z],ge=fe-y[P],ce=[Kt,Xt].indexOf(g)!==-1,ue=(L=ie?.[T])!=null?L:0,we=ce?se:fe-M[me]-F[me]-ue+U.altAxis,_e=ce?fe+M[me]+F[me]-ue-U.altAxis:ge,Ce=p&&ce?s_(we,fe,_e):Wi(p?we:se,fe,p?_e:ge);D[T]=Ce,I[T]=Ce-fe}e.modifiersData[r]=I}}const R_={name:"preventOverflow",enabled:!0,phase:"main",fn:B_,requiresIfExists:["offset"]};function L_(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function P_(t){return t===sn(t)||!fn(t)?ip(t):L_(t)}function z_(t){var e=t.getBoundingClientRect(),n=ei(e.width)/t.offsetWidth||1,r=ei(e.height)/t.offsetHeight||1;return n!==1||r!==1}function j_(t,e,n){n===void 0&&(n=!1);var r=fn(e),o=fn(e)&&z_(e),i=Ir(e),s=ti(t,o,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Rn(e)!=="body"||ap(i))&&(a=P_(e)),fn(e)?(l=ti(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):i&&(l.x=sp(i))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function q_(t){var e=new Map,n=new Set,r=[];t.forEach(function(i){e.set(i.name,i)});function o(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&o(l)}}),r.push(i)}return t.forEach(function(i){n.has(i.name)||o(i)}),r}function V_(t){var e=q_(t);return t_.reduce(function(n,r){return n.concat(e.filter(function(o){return o.phase===r}))},[])}function U_(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function H_(t){var e=t.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Ry={placement:"bottom",modifiers:[],strategy:"absolute"};function Ly(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function W_(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,o=e.defaultOptions,i=o===void 0?Ry:o;return function(s,a,l){l===void 0&&(l=i);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ry,i),modifiersData:{},elements:{reference:s,popper:a},attributes:{},styles:{}},u=[],d=!1,f={state:c,setOptions:function(m){var y=typeof m=="function"?m(c.options):m;h(),c.options=Object.assign({},i,c.options,y),c.scrollParents={reference:uo(s)?Gi(s):s.contextElement?Gi(s.contextElement):[],popper:Gi(a)};var g=V_(H_([].concat(r,c.options.modifiers)));return c.orderedModifiers=g.filter(function(x){return x.enabled}),p(),f.update()},forceUpdate:function(){if(!d){var m=c.elements,y=m.reference,g=m.popper;if(Ly(y,g)){c.rects={reference:j_(y,Ms(g),c.options.strategy==="fixed"),popper:rp(g)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(F){return c.modifiersData[F.name]=Object.assign({},F.data)});for(var x=0;x<c.orderedModifiers.length;x++){if(c.reset===!0){c.reset=!1,x=-1;continue}var k=c.orderedModifiers[x],w=k.fn,T=k.options,D=T===void 0?{}:T,M=k.name;typeof w=="function"&&(c=w({state:c,options:D,name:M,instance:f})||c)}}}},update:U_(function(){return new Promise(function(m){f.forceUpdate(),m(c)})}),destroy:function(){h(),d=!0}};if(!Ly(s,a))return f;f.setOptions(l).then(function(m){!d&&l.onFirstUpdate&&l.onFirstUpdate(m)});function p(){c.orderedModifiers.forEach(function(m){var y=m.name,g=m.options,x=g===void 0?{}:g,k=m.effect;if(typeof k=="function"){var w=k({state:c,name:y,instance:f,options:x}),T=function(){};u.push(w||T)}})}function h(){u.forEach(function(m){return m()}),u=[]}return f}}var G_=[g_,I_,h_,ix,__,$_,R_,u_,O_],K_=W_({defaultModifiers:G_}),X_="tippy-box",px="tippy-content",J_="tippy-backdrop",hx="tippy-arrow",mx="tippy-svg-arrow",Pr={passive:!0,capture:!0},gx=function(){return document.body};function Y_(t,e){return{}.hasOwnProperty.call(t,e)}function fu(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function lp(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function yx(t,e){return typeof t=="function"?t.apply(void 0,e):t}function Py(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function Z_(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function Q_(t){return t.split(/\s+/).filter(Boolean)}function Io(t){return[].concat(t)}function zy(t,e){t.indexOf(e)===-1&&t.push(e)}function eN(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function tN(t){return t.split("-")[0]}function rl(t){return[].slice.call(t)}function jy(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function Ki(){return document.createElement("div")}function hs(t){return["Element","Fragment"].some(function(e){return lp(t,e)})}function nN(t){return lp(t,"NodeList")}function rN(t){return lp(t,"MouseEvent")}function oN(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function iN(t){return hs(t)?[t]:nN(t)?rl(t):Array.isArray(t)?t:rl(document.querySelectorAll(t))}function pu(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function qy(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function sN(t){var e,n=Io(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function aN(t,e){var n=e.clientX,r=e.clientY;return t.every(function(o){var i=o.popperRect,s=o.popperState,a=o.props,l=a.interactiveBorder,c=tN(s.placement),u=s.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,f=c==="top"?u.bottom.y:0,p=c==="right"?u.left.x:0,h=c==="left"?u.right.x:0,m=i.top-r+d>l,y=r-i.bottom-f>l,g=i.left-n+p>l,x=n-i.right-h>l;return m||y||g||x})}function hu(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){t[r](o,n)})}function Vy(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var On={isTouch:!1},Uy=0;function lN(){On.isTouch||(On.isTouch=!0,window.performance&&document.addEventListener("mousemove",bx))}function bx(){var t=performance.now();t-Uy<20&&(On.isTouch=!1,document.removeEventListener("mousemove",bx)),Uy=t}function cN(){var t=document.activeElement;if(oN(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function uN(){document.addEventListener("touchstart",lN,Pr),window.addEventListener("blur",cN)}var dN=typeof window<"u"&&typeof document<"u",fN=dN?!!window.msCrypto:!1;function Co(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 Hy(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function pN(t){return Hy(`
46
- %ctippy.js
47
-
48
- %c`+Hy(t)+`
49
-
50
- %c👷‍ This is a development-only message. It will be removed in production.
51
- `)}function wx(t){return[pN(t),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var ms;Se.env.NODE_ENV!=="production"&&hN();function hN(){ms=new Set}function Gn(t,e){if(t&&!ms.has(e)){var n;ms.add(e),(n=console).warn.apply(n,wx(e))}}function Pd(t,e){if(t&&!ms.has(e)){var n;ms.add(e),(n=console).error.apply(n,wx(e))}}function mN(t){var e=!t,n=Object.prototype.toString.call(t)==="[object Object]"&&!t.addEventListener;Pd(e,["tippy() was passed","`"+String(t)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),Pd(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var vx={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},gN={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},tn=Object.assign({appendTo:gx,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},vx,gN),yN=Object.keys(tn),bN=function(t){Se.env.NODE_ENV!=="production"&&kx(t,[]);var e=Object.keys(t);e.forEach(function(n){tn[n]=t[n]})};function xx(t){var e=t.plugins||[],n=e.reduce(function(r,o){var i=o.name,s=o.defaultValue;if(i){var a;r[i]=t[i]!==void 0?t[i]:(a=tn[i])!=null?a:s}return r},{});return Object.assign({},t,n)}function wN(t,e){var n=e?Object.keys(xx(Object.assign({},tn,{plugins:e}))):yN,r=n.reduce(function(o,i){var s=(t.getAttribute("data-tippy-"+i)||"").trim();if(!s)return o;if(i==="content")o[i]=s;else try{o[i]=JSON.parse(s)}catch{o[i]=s}return o},{});return r}function Wy(t,e){var n=Object.assign({},e,{content:yx(e.content,[t])},e.ignoreAttributes?{}:wN(t,e.plugins));return n.aria=Object.assign({},tn.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}function kx(t,e){t===void 0&&(t={}),e===void 0&&(e=[]);var n=Object.keys(t);n.forEach(function(r){var o=Z_(tn,Object.keys(vx)),i=!Y_(o,r);i&&(i=e.filter(function(s){return s.name===r}).length===0),Gn(i,["`"+r+"`","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.",`
52
-
53
- `,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
54
- `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var vN=function(){return"innerHTML"};function zd(t,e){t[vN()]=e}function Gy(t){var e=Ki();return t===!0?e.className=hx:(e.className=mx,hs(t)?e.appendChild(t):zd(e,t)),e}function Ky(t,e){hs(e.content)?(zd(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?zd(t,e.content):t.textContent=e.content)}function jd(t){var e=t.firstElementChild,n=rl(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(px)}),arrow:n.find(function(r){return r.classList.contains(hx)||r.classList.contains(mx)}),backdrop:n.find(function(r){return r.classList.contains(J_)})}}function Sx(t){var e=Ki(),n=Ki();n.className=X_,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Ki();r.className=px,r.setAttribute("data-state","hidden"),Ky(r,t.props),e.appendChild(n),n.appendChild(r),o(t.props,t.props);function o(i,s){var a=jd(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"),(i.content!==s.content||i.allowHTML!==s.allowHTML)&&Ky(c,t.props),s.arrow?u?i.arrow!==s.arrow&&(l.removeChild(u),l.appendChild(Gy(s.arrow))):l.appendChild(Gy(s.arrow)):u&&l.removeChild(u)}return{popper:e,onUpdate:o}}Sx.$$tippy=!0;var xN=1,Js=[],mu=[];function kN(t,e){var n=Wy(t,Object.assign({},tn,xx(jy(e)))),r,o,i,s=!1,a=!1,l=!1,c=!1,u,d,f,p=[],h=Py(S,n.interactiveDebounce),m,y=xN++,g=null,x=eN(n.plugins),k={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},w={id:y,reference:t,popper:Ki(),popperInstance:g,props:n,state:k,plugins:x,clearDelayTimeouts:we,setProps:_e,setContent:Ce,show:dt,hide:v,hideWithInteractivity:O,enable:ce,disable:ue,unmount:_,destroy:Y};if(!n.render)return Se.env.NODE_ENV!=="production"&&Pd(!0,"render() function has not been supplied."),w;var T=n.render(w),D=T.popper,M=T.onUpdate;D.setAttribute("data-tippy-root",""),D.id="tippy-"+w.id,w.popper=D,t._tippy=w,D._tippy=w;var F=x.map(function(j){return j.fn(w)}),C=t.hasAttribute("aria-expanded");return N(),pe(),X(),de("onCreate",[w]),n.showOnCreate&&se(),D.addEventListener("mouseenter",function(){w.props.interactive&&w.state.isVisible&&w.clearDelayTimeouts()}),D.addEventListener("mouseleave",function(){w.props.interactive&&w.props.trigger.indexOf("mouseenter")>=0&&A().addEventListener("mousemove",h)}),w;function U(){var j=w.props.touch;return Array.isArray(j)?j:[j,0]}function ie(){return U()[0]==="hold"}function I(){var j;return!!((j=w.props.render)!=null&&j.$$tippy)}function W(){return m||t}function A(){var j=W().parentNode;return j?sN(j):document}function G(){return jd(D)}function ae(j){return w.state.isMounted&&!w.state.isVisible||On.isTouch||u&&u.type==="focus"?0:fu(w.props.delay,j?0:1,tn.delay)}function X(j){j===void 0&&(j=!1),D.style.pointerEvents=w.props.interactive&&!j?"":"none",D.style.zIndex=""+w.props.zIndex}function de(j,V,ne){if(ne===void 0&&(ne=!0),F.forEach(function(xe){xe[j]&&xe[j].apply(xe,V)}),ne){var ye;(ye=w.props)[j].apply(ye,V)}}function J(){var j=w.props.aria;if(j.content){var V="aria-"+j.content,ne=D.id,ye=Io(w.props.triggerTarget||t);ye.forEach(function(xe){var ke=xe.getAttribute(V);if(w.state.isVisible)xe.setAttribute(V,ke?ke+" "+ne:ne);else{var Ae=ke&&ke.replace(ne,"").trim();Ae?xe.setAttribute(V,Ae):xe.removeAttribute(V)}})}}function pe(){if(!(C||!w.props.aria.expanded)){var j=Io(w.props.triggerTarget||t);j.forEach(function(V){w.props.interactive?V.setAttribute("aria-expanded",w.state.isVisible&&V===W()?"true":"false"):V.removeAttribute("aria-expanded")})}}function Q(){A().removeEventListener("mousemove",h),Js=Js.filter(function(j){return j!==h})}function B(j){if(!(On.isTouch&&(l||j.type==="mousedown"))){var V=j.composedPath&&j.composedPath()[0]||j.target;if(!(w.props.interactive&&Vy(D,V))){if(Io(w.props.triggerTarget||t).some(function(ne){return Vy(ne,V)})){if(On.isTouch||w.state.isVisible&&w.props.trigger.indexOf("click")>=0)return}else de("onClickOutside",[w,j]);w.props.hideOnClick===!0&&(w.clearDelayTimeouts(),w.hide(),a=!0,setTimeout(function(){a=!1}),w.state.isMounted||K())}}}function ee(){l=!0}function Z(){l=!1}function re(){var j=A();j.addEventListener("mousedown",B,!0),j.addEventListener("touchend",B,Pr),j.addEventListener("touchstart",Z,Pr),j.addEventListener("touchmove",ee,Pr)}function K(){var j=A();j.removeEventListener("mousedown",B,!0),j.removeEventListener("touchend",B,Pr),j.removeEventListener("touchstart",Z,Pr),j.removeEventListener("touchmove",ee,Pr)}function $(j,V){H(j,function(){!w.state.isVisible&&D.parentNode&&D.parentNode.contains(D)&&V()})}function E(j,V){H(j,V)}function H(j,V){var ne=G().box;function ye(xe){xe.target===ne&&(hu(ne,"remove",ye),V())}if(j===0)return V();hu(ne,"remove",d),hu(ne,"add",ye),d=ye}function q(j,V,ne){ne===void 0&&(ne=!1);var ye=Io(w.props.triggerTarget||t);ye.forEach(function(xe){xe.addEventListener(j,V,ne),p.push({node:xe,eventType:j,handler:V,options:ne})})}function N(){ie()&&(q("touchstart",le,{passive:!0}),q("touchend",oe,{passive:!0})),Q_(w.props.trigger).forEach(function(j){if(j!=="manual")switch(q(j,le),j){case"mouseenter":q("mouseleave",oe);break;case"focus":q(fN?"focusout":"blur",te);break;case"focusin":q("focusout",te);break}})}function R(){p.forEach(function(j){var V=j.node,ne=j.eventType,ye=j.handler,xe=j.options;V.removeEventListener(ne,ye,xe)}),p=[]}function le(j){var V,ne=!1;if(!(!w.state.isEnabled||L(j)||a)){var ye=((V=u)==null?void 0:V.type)==="focus";u=j,m=j.currentTarget,pe(),!w.state.isVisible&&rN(j)&&Js.forEach(function(xe){return xe(j)}),j.type==="click"&&(w.props.trigger.indexOf("mouseenter")<0||s)&&w.props.hideOnClick!==!1&&w.state.isVisible?ne=!0:se(j),j.type==="click"&&(s=!ne),ne&&!ye&&ge(j)}}function S(j){var V=j.target,ne=W().contains(V)||D.contains(V);if(!(j.type==="mousemove"&&ne)){var ye=me().concat(D).map(function(xe){var ke,Ae=xe._tippy,Oe=(ke=Ae.popperInstance)==null?void 0:ke.state;return Oe?{popperRect:xe.getBoundingClientRect(),popperState:Oe,props:n}:null}).filter(Boolean);aN(ye,j)&&(Q(),ge(j))}}function oe(j){var V=L(j)||w.props.trigger.indexOf("click")>=0&&s;if(!V){if(w.props.interactive){w.hideWithInteractivity(j);return}ge(j)}}function te(j){w.props.trigger.indexOf("focusin")<0&&j.target!==W()||w.props.interactive&&j.relatedTarget&&D.contains(j.relatedTarget)||ge(j)}function L(j){return On.isTouch?ie()!==j.type.indexOf("touch")>=0:!1}function z(){P();var j=w.props,V=j.popperOptions,ne=j.placement,ye=j.offset,xe=j.getReferenceClientRect,ke=j.moveTransition,Ae=I()?jd(D).arrow:null,Oe=xe?{getBoundingClientRect:xe,contextElement:xe.contextElement||W()}:t,We={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(xn){var lr=xn.state;if(I()){var jl=G(),hi=jl.box;["placement","reference-hidden","escaped"].forEach(function(wo){wo==="placement"?hi.setAttribute("data-placement",lr.placement):lr.attributes.popper["data-popper-"+wo]?hi.setAttribute("data-"+wo,""):hi.removeAttribute("data-"+wo)}),lr.attributes.popper={}}}},ot=[{name:"offset",options:{offset:ye}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ke}},We];I()&&Ae&&ot.push({name:"arrow",options:{element:Ae,padding:3}}),ot.push.apply(ot,V?.modifiers||[]),w.popperInstance=K_(Oe,D,Object.assign({},V,{placement:ne,onFirstUpdate:f,modifiers:ot}))}function P(){w.popperInstance&&(w.popperInstance.destroy(),w.popperInstance=null)}function fe(){var j=w.props.appendTo,V,ne=W();w.props.interactive&&j===gx||j==="parent"?V=ne.parentNode:V=yx(j,[ne]),V.contains(D)||V.appendChild(D),w.state.isMounted=!0,z(),Se.env.NODE_ENV!=="production"&&Gn(w.props.interactive&&j===tn.appendTo&&ne.nextElementSibling!==D,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
55
-
56
- `,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
57
-
58
- `,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
59
-
60
- `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function me(){return rl(D.querySelectorAll("[data-tippy-root]"))}function se(j){w.clearDelayTimeouts(),j&&de("onTrigger",[w,j]),re();var V=ae(!0),ne=U(),ye=ne[0],xe=ne[1];On.isTouch&&ye==="hold"&&xe&&(V=xe),V?r=setTimeout(function(){w.show()},V):w.show()}function ge(j){if(w.clearDelayTimeouts(),de("onUntrigger",[w,j]),!w.state.isVisible){K();return}if(!(w.props.trigger.indexOf("mouseenter")>=0&&w.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(j.type)>=0&&s)){var V=ae(!1);V?o=setTimeout(function(){w.state.isVisible&&w.hide()},V):i=requestAnimationFrame(function(){w.hide()})}}function ce(){w.state.isEnabled=!0}function ue(){w.hide(),w.state.isEnabled=!1}function we(){clearTimeout(r),clearTimeout(o),cancelAnimationFrame(i)}function _e(j){if(Se.env.NODE_ENV!=="production"&&Gn(w.state.isDestroyed,Co("setProps")),!w.state.isDestroyed){de("onBeforeUpdate",[w,j]),R();var V=w.props,ne=Wy(t,Object.assign({},V,jy(j),{ignoreAttributes:!0}));w.props=ne,N(),V.interactiveDebounce!==ne.interactiveDebounce&&(Q(),h=Py(S,ne.interactiveDebounce)),V.triggerTarget&&!ne.triggerTarget?Io(V.triggerTarget).forEach(function(ye){ye.removeAttribute("aria-expanded")}):ne.triggerTarget&&t.removeAttribute("aria-expanded"),pe(),X(),M&&M(V,ne),w.popperInstance&&(z(),me().forEach(function(ye){requestAnimationFrame(ye._tippy.popperInstance.forceUpdate)})),de("onAfterUpdate",[w,j])}}function Ce(j){w.setProps({content:j})}function dt(){Se.env.NODE_ENV!=="production"&&Gn(w.state.isDestroyed,Co("show"));var j=w.state.isVisible,V=w.state.isDestroyed,ne=!w.state.isEnabled,ye=On.isTouch&&!w.props.touch,xe=fu(w.props.duration,0,tn.duration);if(!(j||V||ne||ye)&&!W().hasAttribute("disabled")&&(de("onShow",[w],!1),w.props.onShow(w)!==!1)){if(w.state.isVisible=!0,I()&&(D.style.visibility="visible"),X(),re(),w.state.isMounted||(D.style.transition="none"),I()){var ke=G(),Ae=ke.box,Oe=ke.content;pu([Ae,Oe],0)}f=function(){var We;if(!(!w.state.isVisible||c)){if(c=!0,D.offsetHeight,D.style.transition=w.props.moveTransition,I()&&w.props.animation){var ot=G(),xn=ot.box,lr=ot.content;pu([xn,lr],xe),qy([xn,lr],"visible")}J(),pe(),zy(mu,w),(We=w.popperInstance)==null||We.forceUpdate(),de("onMount",[w]),w.props.animation&&I()&&E(xe,function(){w.state.isShown=!0,de("onShown",[w])})}},fe()}}function v(){Se.env.NODE_ENV!=="production"&&Gn(w.state.isDestroyed,Co("hide"));var j=!w.state.isVisible,V=w.state.isDestroyed,ne=!w.state.isEnabled,ye=fu(w.props.duration,1,tn.duration);if(!(j||V||ne)&&(de("onHide",[w],!1),w.props.onHide(w)!==!1)){if(w.state.isVisible=!1,w.state.isShown=!1,c=!1,s=!1,I()&&(D.style.visibility="hidden"),Q(),K(),X(!0),I()){var xe=G(),ke=xe.box,Ae=xe.content;w.props.animation&&(pu([ke,Ae],ye),qy([ke,Ae],"hidden"))}J(),pe(),w.props.animation?I()&&$(ye,w.unmount):w.unmount()}}function O(j){Se.env.NODE_ENV!=="production"&&Gn(w.state.isDestroyed,Co("hideWithInteractivity")),A().addEventListener("mousemove",h),zy(Js,h),h(j)}function _(){Se.env.NODE_ENV!=="production"&&Gn(w.state.isDestroyed,Co("unmount")),w.state.isVisible&&w.hide(),w.state.isMounted&&(P(),me().forEach(function(j){j._tippy.unmount()}),D.parentNode&&D.parentNode.removeChild(D),mu=mu.filter(function(j){return j!==w}),w.state.isMounted=!1,de("onHidden",[w]))}function Y(){Se.env.NODE_ENV!=="production"&&Gn(w.state.isDestroyed,Co("destroy")),!w.state.isDestroyed&&(w.clearDelayTimeouts(),w.unmount(),R(),delete t._tippy,w.state.isDestroyed=!0,de("onDestroy",[w]))}}function _s(t,e){e===void 0&&(e={});var n=tn.plugins.concat(e.plugins||[]);Se.env.NODE_ENV!=="production"&&(mN(t),kx(e,n)),uN();var r=Object.assign({},e,{plugins:n}),o=iN(t);if(Se.env.NODE_ENV!=="production"){var i=hs(r.content),s=o.length>1;Gn(i&&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.",`
61
-
62
- `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
63
-
64
- `,`1) content: element.innerHTML
65
- `,"2) content: () => element.cloneNode(true)"].join(" "))}var a=o.reduce(function(l,c){var u=c&&kN(c,r);return u&&l.push(u),l},[]);return hs(t)?a[0]:a}_s.defaultProps=tn;_s.setDefaultProps=bN;_s.currentInput=On;Object.assign({},ix,{effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow)}});_s.setDefaultProps({render:Sx});const vt=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},SN=["onClick","onMouseenter"],CN={key:0},EN={key:0},AN={key:1},$N={key:1},TN={__name:"Mentions",props:{users:{type:Array,required:!0},mention:{type:String,default:""},inserMention:{type:Function,required:!0}},setup(t){const e=t,n=b.ref(null),r=b.ref(null),o=b.computed(()=>{const l=e.mention.slice(1)?.toLowerCase();return e.users.filter(c=>{const u=c.role==="viewer",d=c.name?.toLowerCase().startsWith(l),f=c.email?.toLowerCase().startsWith(l);return!u&&(d||f)})||[]}),i=l=>{e.inserMention(l)},s=l=>{if(l.key==="ArrowDown")r.value+=1,r.value===o.value.length&&(r.value=0);else if(l.key==="ArrowUp")r.value-=1,r.value<0&&(r.value=o.value.length-1);else if(l.key==="Enter"){const c=o.value[r.value];c&&e.inserMention(c)}},a=()=>{r.value=0};return(l,c)=>(b.openBlock(),b.createElementBlock("div",{class:"mentions-container",ref_key:"container",ref:n,onKeydown:b.withModifiers(s,["prevent"]),onFocus:b.withModifiers(a,["stop","prevent"]),tabindex:"0"},[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(o.value,(u,d)=>(b.openBlock(),b.createElementBlock("div",{onClick:b.withModifiers(f=>i(u),["stop","prevent"]),onMouseenter:f=>r.value=d,onMouseleave:c[0]||(c[0]=f=>r.value=null),key:u.email,class:b.normalizeClass(["user-row",{selected:r.value===d}])},[u.name?(b.openBlock(),b.createElementBlock("div",CN,[u.name?(b.openBlock(),b.createElementBlock("span",EN,b.toDisplayString(u.name),1)):b.createCommentVNode("",!0),u.name&&u.email?(b.openBlock(),b.createElementBlock("span",AN," ("+b.toDisplayString(u.email)+")",1)):b.createCommentVNode("",!0)])):(b.openBlock(),b.createElementBlock("div",$N,[b.createBaseVNode("span",null,b.toDisplayString(u.email),1)]))],42,SN))),128))],544))}},ON=vt(TN,[["__scopeId","data-v-0a2a8b4e"]]),Xy=new et("popoverPlugin"),DN=Qe.create({name:"popoverPlugin",addPmPlugins(){return[new Ze({key:Xy,state:{init:()=>({}),apply:(t,e,n,r)=>{let o={...e};return t.docChanged?o.shouldUpdate=!0:o.shouldUpdate=!1,o}},view:t=>{const e=new MN(t,this.editor);return{update:(n,r)=>{Xy.getState(n.state).shouldUpdate&&e.update(n,r)},destroy:()=>{e.destroy()}}}})]}});class MN{constructor(e,n){Fe(this,"handleKeyDown",r=>{const o=r.key==="ArrowDown"||r.key==="ArrowUp";this.tippyInstance.state.isVisible&&o&&(r.preventDefault(),this.popover.firstChild.focus())}),this.editor=n,this.view=e,this.popover=document.createElement("div"),this.popover.className="popover",document.body.appendChild(this.popover),this.tippyInstance=_s(this.popover,{trigger:"manual",placement:"bottom-start",interactive:!0,appendTo:document.body,arrow:!1,onShow:r=>{r.setProps({getReferenceClientRect:()=>this.popoverRect}),this.bindKeyDownEvents()},onHide:()=>{this.unbindKeyDownEvents()},theme:"popover"})}bindKeyDownEvents(){this.view.dom.addEventListener("keydown",this.handleKeyDown)}unbindKeyDownEvents(){this.view.dom.removeEventListener("keydown",this.handleKeyDown)}mountVueComponent(e,n={}){this.app&&this.app.unmount(),this.app=b.createApp(e,n),this.app.mount(this.popover),this.tippyInstance.setContent(this.popover)}update(e,n){this.state=e.state;const r=this.isShowMentions;let o={component:null,props:null};if(this.isShowMentions){const{from:i}=this.state.selection,s=this.getMentionText(i);o={component:ON,props:{users:this.editor.users,mention:s,inserMention:a=>{const{$from:l}=this.state.selection,c=s.length,u={...a},d=this.editor.schema.nodes.mention.create(u),f=this.state.tr.replaceWith(l.pos-c,l.pos,d);this.editor.view.dispatch(f),this.editor.view.focus()}}}}if(r&&o.component){const{to:i}=this.state.selection,{component:s,props:a}=o;this.mountVueComponent(s,a),this.showPopoverAtPosition(i)}else this.tippyInstance.hide()}showPopoverAtPosition(e){const n=this.view.coordsAtPos(e);this.popoverRect={width:0,height:0,top:n.bottom,left:n.left,bottom:n.bottom,right:n.left},this.tippyInstance.show()}getMentionText(e){const n=Math.max(0,e-20),r=this.state.doc.textBetween(n,e,`
66
- `,"\0"),o=r.lastIndexOf("@");return o!==-1?r.substring(o):""}get isShowMentions(){const{from:e}=this.state.selection;if(e<1)return!1;const n=this.getMentionText(e),r=/(?:^|\s)@[\w]*$/;return n.match(r)&&this.state.selection.empty}destroy(){this.tippyInstance.destroy(),this.popover.remove()}}const _N=!1,NN=Qe.create({name:"pagination",addStorage(){return{height:0,sectionData:null}},addCommands(){return{insertPageBreak:()=>({commands:t})=>t.insertContent({type:"hardBreak"})}},addShortcuts(){return{"Mod-Enter":()=>this.editor.commands.insertPageBreak()}},addPmPlugins(){const t=this.editor;let e=!1,n=!1,r=!1,o=!1;return[new Ze({key:to,state:{isReadyToInit:!1,init(i,s){return{isReadyToInit:!1,decorations:qe.empty,isDebugging:_N}},apply(i,s,a,l){const c=i.getMeta(to);c&&c.isReadyToInit&&(n=!0,o=c.isReadyToInit);const u=i.getMeta(no);if(u){if(u.type==="remove"){const f=u.pos,p=t.view.domAtPos(f).node.querySelector("img");p.complete?Yy(t):p.onload=()=>Yy(t)}return{...s}}if(i.getMeta("fieldAnnotationUpdate"))return{...s};if(!o&&!s.isReadyToInit)return{...s};if(c&&c.decorations)return n=!0,{...s,decorations:c.decorations.map(i.mapping,l.doc)};const d=i.getMeta("forceUpdatePagination");return!d&&a.doc.eq(l.doc)&&r?(n=!1,{...s}):(n=!0,d&&(n=!0),{...s,isReadyToInit:o})}},view:i=>{let s=qe.empty;return{update:a=>{!n||e||(e=!0,r=!0,IN(t,a,s),e=!1,n=!1)}}},props:{decorations(i){return to.getState(i).decorations}}})]}}),IN=(t,e,n)=>{const r=t.storage.pagination.sectionData,o=FN(e,t,r);if(!n.eq(o)){const i=e.state.tr.setMeta(to,{decorations:o});e.dispatch(i)}t.emit("paginationUpdate")},FN=(t,e,n)=>{if(!e.converter)return qe.empty;const r=e.converter.pageStyles?.pageSize,{width:o,height:i}=r;if(!o||!i)return qe.empty;const s=[CD,to],{state:a}=t,l=zi.create({schema:a.schema,doc:a.doc,plugins:a.plugins.filter(h=>s.includes(h.key))}),c=e.options.element.cloneNode();if(!c)return[];c.className="temp-container super-editor";const u=0,d=0;c.style.left=u+"px",c.style.top=d+"px",c.style.position="fixed",c.style.visibility="hidden",document.body.appendChild(c);const f=new s1(c,{state:l,dispatchTransaction:()=>{}});e.initDefaultStyles(c);const p=BN(l.doc,f,e,n);return f.destroy(),document.body.removeChild(c),qe.create(t.state.doc,p)};function BN(t,e,n,r){const o=[],{pageSize:i,pageMargins:s}=n.converter.pageStyles,a=i.height*96;n.options.scale;let l=1,c=a,u=null,d=null;const{headerIds:f,footerIds:p}=n.converter;let h=f.first||f.even||f.default||"default";f.titlePg&&(h=null);const m=gu(s,i,r,h),y=bu({editor:n,header:m,isFirstHeader:!0});o.push(Pe.widget(0,y,{key:"stable-key"}));const g=p.last||p.default||"default",x=yu(s,i,r,g),k=bu({editor:n,footer:x,isLastFooter:!0});c-=m.headerHeight+x.footerHeight;let w=e?.coordsAtPos(t.content.size);if(!w)return[];t.descendants((I,W)=>{let A=I,G=W;if(w=e?.coordsAtPos(G),!w)return;let ae=w.bottom>c;const X=A.type.name==="hardBreak";if(A.type.name==="paragraph"&&A.attrs.styleId){const de=va.getState(n.state)?.styles?.find(J=>J.id===A.attrs.styleId);if(de){const{definition:J={}}=de,{pageBreakBefore:pe,pageBreakAfter:Q}=J.attrs||{};(pe||Q)&&(ae=!0)}}if(X||ae){const de=e.state.doc.resolve(G),J=$l(de,H=>H.type.name==="tableRow");J&&(A=J.node,G=J.pos);const{top:pe,bottom:Q,pos:B}=RN(e,G,c);l++;const ee=(l%2===0?f.even:f.odd)||f.default,Z=(l%2===0?p.even:p.odd)||p.default;d=gu(s,i,r,ee),u=yu(s,i,r,Z);const re=c-Q,{node:K}=Jy(re),$=Pe.widget(B,K,{key:"stable-key"});o.push($);const E=bu({editor:n,header:d,footer:u});o.push(Pe.widget(B,E,{key:"stable-key"})),c=Q+(a-d.headerHeight-u.footerHeight)}});let T=t.content.size;const D=e.coordsAtPos(T),M=(l%2===0?f.even:f.odd)||f.default,F=(l%2===0?p.even:p.odd)||p.default;d=gu(s,i,r,M),u=yu(s,i,r,F);const C=c-D.bottom,{node:U}=Jy(C),ie=Pe.widget(t.content.size,U,{key:"stable-key"});return o.push(ie),o.push(Pe.widget(t.content.size,k,{key:"stable-key"})),o}function Jy(t){const e=document.createElement("div");return e.className="pagination-page-spacer",e.style.userSelect="none",e.style.pointerEvents="none",e.style.height=t+"px",{nodeHeight:t,node:e}}function gu(t,e,n,r){const o=n.headers?.[r],i=t.top*96,s=t.header*96,a=o?.height>i-s?s:0,l=Math.max(o?.height||0,i)+a;let c=o?.sectionContainer?.cloneNode(!0);return c||(c=document.createElement("div")),c.className="pagination-section-header",c.style.paddingTop=s+"px",c.style.paddingLeft=t.left*96+"px",c.style.paddingRight=t.right*96+"px",c.style.height=l+"px",c.style.width=e.width*96+"px",{section:c,headerHeight:l}}function yu(t,e,n,r){const o=n.footers?.[r],i=t.bottom*96,s=t.footer*96,a=Math.max(o?.height||0,i)-s;let l=o?.sectionContainer?.cloneNode(!0);return l||(l=document.createElement("div")),l.className="pagination-section-footer",l.style.height=a+"px",l.style.marginBottom=s+"px",l.style.paddingLeft=t.left*96+"px",l.style.paddingRight=t.right*96+"px",l.style.width=e.width*96+"px",{section:l,footerHeight:a+s}}function bu({editor:t,header:e,footer:n,footerBottom:r=null,isFirstHeader:o,isLastFooter:i}){const{pageSize:s,pageMargins:a}=t.converter.pageStyles;let l=0;const c=document.createElement("div");c.className="pagination-break-wrapper";const u=document.createElement("div");if(u.className="pagination-inner",u.style.width=s.width*96-1+"px",o?u.style.borderRadius="8px 8px 0 0":i&&(u.style.borderRadius="0 0 8px 8px"),c.appendChild(u),n&&(u.appendChild(n.section),l+=n.footerHeight),e&&n){l+=20;const d=document.createElement("div");d.className="pagination-separator",u.appendChild(d)}return e&&(u.appendChild(e.section),l+=e.headerHeight),c.style.height=l+"px",c.style.minHeight=l+"px",c.style.maxHeight=l+"px",u.style.height=l+"px",c.style.width="100px",c.style.marginLeft=a.left*-96+"px",r!==null&&(c.style.position="absolute",c.style.bottom=r+"px"),c}function RN(t,e,n){let r=e-1;const o={top:0,bottom:0,pos:0};for(;r>0;){const{top:i,bottom:s}=t.coordsAtPos(r);if(s<n){Object.assign(o,{top:i,bottom:s,pos:r+1});break}r--}return o}const Yy=t=>{requestAnimationFrame(()=>{const e=t.view.state.tr;e.setMeta("forceUpdatePagination",!0),t.view.dispatch(e)})},cp=()=>[G2,h2,o2,f2,i2,s2,B$,S2,K2,w2,c2,Z2,g2,k2,C2,E2,Y2,p2,a2,l2,W2,X2,nx,DN,H2,J2,u2,R2,P2,z2,L2,U2,d2,Q2,ex,tx],up=()=>[G2,h2,o2,rM,oM,iM,f2,i2,s2,S2,K2,w2,c2,Z2,g2,k2,C2,E2,_D,Y2,aM,p2,a2,l2,W2,X2,u2,tD,SD,R2,P2,z2,L2,U2,d2,B5,R5,H2,ED,DD,V5,Q2,ex,tx,sM,NN,J2,YD],LN=(t,e)=>{let n=t.replace(/[^0-9.]/g,"");return n=parseFloat(n),isNaN(n)&&(n=e),n=parseFloat(n),n},PN=(t,e,n)=>{let r,o,i,s,a=0;n||(n={});const l=function(){a=n.leading===!1?0:Date.now(),r=null,s=t.apply(o,i),r||(o=i=null)},c=function(){const u=Date.now();!a&&n.leading===!1&&(a=u);const d=e-(u-a);return o=this,i=arguments,d<=0||d>e?(r&&(clearTimeout(r),r=null),a=u,s=t.apply(o,i),r||(o=i=null)):!r&&n.trailing!==!1&&(r=setTimeout(l,d)),s};return c.cancel=function(){clearTimeout(r),a=0,r=o=i=null},c},zN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M0 64C0 46.3 14.3 32 32 32l48 0 16 0 128 0c70.7 0 128 57.3 128 128c0 31.3-11.3 60.1-30 82.3c37.1 22.4 62 63.1 62 109.7c0 70.7-57.3 128-128 128L96 480l-16 0-48 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l16 0 0-160L48 96 32 96C14.3 96 0 81.7 0 64zM224 224c35.3 0 64-28.7 64-64s-28.7-64-64-64L112 96l0 128 112 0zM112 288l0 128 144 0c35.3 0 64-28.7 64-64s-28.7-64-64-64l-32 0-112 0z"/></svg>',jN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M128 64c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-58.7 0L160 416l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l58.7 0L224 96l-64 0c-17.7 0-32-14.3-32-32z"/></svg>',qN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M16 64c0-17.7 14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0 0 128c0 53 43 96 96 96s96-43 96-96l0-128-16 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-16 0 0 128c0 88.4-71.6 160-160 160s-160-71.6-160-160L64 96 48 96C30.3 96 16 81.7 16 64zM0 448c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32z"/></svg>',VN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M40 48C26.7 48 16 58.7 16 72l0 48c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24L40 48zM192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L192 64zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l288 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-288 0zM16 232l0 48c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24l-48 0c-13.3 0-24 10.7-24 24zM40 368c-13.3 0-24 10.7-24 24l0 48c0 13.3 10.7 24 24 24l48 0c13.3 0 24-10.7 24-24l0-48c0-13.3-10.7-24-24-24l-48 0z"/></svg>',UN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M24 56c0-13.3 10.7-24 24-24l32 0c13.3 0 24 10.7 24 24l0 120 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-96-8 0C34.7 80 24 69.3 24 56zM86.7 341.2c-6.5-7.4-18.3-6.9-24 1.2L51.5 357.9c-7.7 10.8-22.7 13.3-33.5 5.6s-13.3-22.7-5.6-33.5l11.1-15.6c23.7-33.2 72.3-35.6 99.2-4.9c21.3 24.4 20.8 60.9-1.1 84.7L86.8 432l33.2 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-88 0c-9.5 0-18.2-5.6-22-14.4s-2.1-18.9 4.3-25.9l72-78c5.3-5.8 5.4-14.6 .3-20.5zM224 64l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 160l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z"/></svg>',HN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6l96 0 32 0 208 0c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"/></svg>',Zy='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M579.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114L422.3 334.8c-31.5 31.5-82.5 31.5-114 0c-27.9-27.9-31.5-71.8-8.6-103.8l1.1-1.6c10.3-14.4 6.9-34.4-7.4-44.6s-34.4-6.9-44.6 7.4l-1.1 1.6C206.5 251.2 213 330 263 380c56.5 56.5 148 56.5 204.5 0L579.8 267.7zM60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5L217.7 177.2c31.5-31.5 82.5-31.5 114 0c27.9 27.9 31.5 71.8 8.6 103.9l-1.1 1.6c-10.3 14.4-6.9 34.4 7.4 44.6s34.4 6.9 44.6-7.4l1.1-1.6C433.5 260.8 427 182 377 132c-56.5-56.5-148-56.5-204.5 0L60.2 244.3z"/></svg>',WN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M288 64c0 17.7-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32L32 352c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"/></svg>',GN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M352 64c0-17.7-14.3-32-32-32L128 32c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32zm96 128c0-17.7-14.3-32-32-32L32 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32zM0 448c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 416c-17.7 0-32 14.3-32 32zM352 320c0-17.7-14.3-32-32-32l-192 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l192 0c17.7 0 32-14.3 32-32z"/></svg>',KN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M448 64c0 17.7-14.3 32-32 32L192 96c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l224 0c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 224c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"/></svg>',XN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M448 64c0-17.7-14.3-32-32-32L32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l384 0c17.7 0 32-14.3 32-32zm0 256c0-17.7-14.3-32-32-32L32 288c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32zM0 192c0 17.7 14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 160c-17.7 0-32 14.3-32 32zM448 448c0-17.7-14.3-32-32-32L32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32z"/></svg>',JN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M0 64C0 46.3 14.3 32 32 32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64zM192 192c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32zm32 96l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zM0 448c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32zM127.8 268.6L25.8 347.9C15.3 356.1 0 348.6 0 335.3L0 176.7c0-13.3 15.3-20.8 25.8-12.6l101.9 79.3c8.2 6.4 8.2 18.9 0 25.3z"/></svg>',YN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M0 64C0 46.3 14.3 32 32 32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64zM192 192c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32zm32 96l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zM0 448c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32zM.2 268.6c-8.2-6.4-8.2-18.9 0-25.3l101.9-79.3c10.5-8.2 25.8-.7 25.8 12.6l0 158.6c0 13.3-15.3 20.8-25.8 12.6L.2 268.6z"/></svg>',ZN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M0 64C0 28.7 28.7 0 64 0L352 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64L64 192c-35.3 0-64-28.7-64-64L0 64zM160 352c0-17.7 14.3-32 32-32l0-16c0-44.2 35.8-80 80-80l144 0c17.7 0 32-14.3 32-32l0-32 0-90.5c37.3 13.2 64 48.7 64 90.5l0 32c0 53-43 96-96 96l-144 0c-8.8 0-16 7.2-16 16l0 16c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-128z"/></svg>',QN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L355.7 253.5 400.2 96 503 96 497 120.2c-4.3 17.1 6.1 34.5 23.3 38.8s34.5-6.1 38.8-23.3l11-44.1C577.6 61.3 554.7 32 523.5 32L376.1 32l-.3 0L204.5 32c-22 0-41.2 15-46.6 36.4l-6.3 25.2L38.8 5.1zm168 131.7c.1-.3 .2-.7 .3-1L217 96l116.7 0L301.3 210.8l-94.5-74.1zM243.3 416L192 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-42.2 0 17.6-62.1L272.9 311 243.3 416z"/></svg>',eI='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M48.5 224L40 224c-13.3 0-24-10.7-24-24L16 72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2L98.6 96.6c87.6-86.5 228.7-86.2 315.8 1c87.5 87.5 87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3c-62.2-62.2-162.7-62.5-225.3-1L185 183c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8L48.5 224z"/></svg>',tI='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M463.5 224l8.5 0c13.3 0 24-10.7 24-24l0-128c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8l119.5 0z"/></svg>',nI='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 48 0c26.5 0 48 21.5 48 48l0 48L0 160l0-48C0 85.5 21.5 64 48 64l48 0 0-32c0-17.7 14.3-32 32-32zM0 192l448 0 0 272c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 192zM329 305c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-95 95-47-47c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l64 64c9.4 9.4 24.6 9.4 33.9 0L329 305z"/></svg>',rI='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 48 0c26.5 0 48 21.5 48 48l0 48L0 160l0-48C0 85.5 21.5 64 48 64l48 0 0-32c0-17.7 14.3-32 32-32zM0 192l448 0 0 272c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 192zM305 305c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-47 47-47-47c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l47 47-47 47c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l47-47 47 47c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-47-47 47-47z"/></svg>',oI='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M152.1 38.2c9.9 8.9 10.7 24 1.8 33.9l-72 80c-4.4 4.9-10.6 7.8-17.2 7.9s-12.9-2.4-17.6-7L7 113C-2.3 103.6-2.3 88.4 7 79s24.6-9.4 33.9 0l22.1 22.1 55.1-61.2c8.9-9.9 24-10.7 33.9-1.8zm0 160c9.9 8.9 10.7 24 1.8 33.9l-72 80c-4.4 4.9-10.6 7.8-17.2 7.9s-12.9-2.4-17.6-7L7 273c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l22.1 22.1 55.1-61.2c8.9-9.9 24-10.7 33.9-1.8zM224 96c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32zm0 160c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32zM160 416c0-17.7 14.3-32 32-32l288 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-288 0c-17.7 0-32-14.3-32-32zM48 368a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"/></svg>',Qy='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512l293.1 0c-3.1-8.8-3.7-18.4-1.4-27.8l15-60.1c2.8-11.3 8.6-21.5 16.8-29.7l40.3-40.3c-32.1-31-75.7-50.1-123.9-50.1l-91.4 0zm435.5-68.3c-15.6-15.6-40.9-15.6-56.6 0l-29.4 29.4 71 71 29.4-29.4c15.6-15.6 15.6-40.9 0-56.6l-14.4-14.4zM375.9 417c-4.1 4.1-7 9.2-8.4 14.9l-15 60.1c-1.4 5.5 .2 11.2 4.2 15.2s9.7 5.6 15.2 4.2l60.1-15c5.6-1.4 10.8-4.3 14.9-8.4L576.1 358.7l-71-71L375.9 417z"/></svg>',eb='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64c-7.1 0-13.9-1.2-20.3-3.3c-5.5-1.8-11.9 1.6-11.7 7.4c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3z"/></svg>',iI='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 288c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128z"/></svg>',sI='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M254 52.8C249.3 40.3 237.3 32 224 32s-25.3 8.3-30 20.8L57.8 416 32 416c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-1.8 0 18-48 159.6 0 18 48-1.8 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-25.8 0L254 52.8zM279.8 304l-111.6 0L224 155.1 279.8 304z"/></svg>',aI='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M64 0C28.7 0 0 28.7 0 64L0 320l384 0 0-160-128 0c-17.7 0-32-14.3-32-32L224 0 64 0zM256 0l0 128 128 0L256 0zM0 416l64 0 0-64L0 352l0 64zm288 32l-80 0 0 64 80 0 0-64zm-112 0l-80 0 0 64 80 0 0-64zM64 448L0 448c0 35.3 28.7 64 64 64l0-64zm256 0l0 64c35.3 0 64-28.7 64-64l-64 0zm64-32l0-64-64 0 0 64 64 0z"/></svg>',lI='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M512 240c0 114.9-114.6 208-256 208c-37.1 0-72.3-6.4-104.1-17.9c-11.9 8.7-31.3 20.6-54.3 30.6C73.6 471.1 44.7 480 16 480c-6.5 0-12.3-3.9-14.8-9.9c-2.5-6-1.1-12.8 3.4-17.4c0 0 0 0 0 0s0 0 0 0s0 0 0 0c0 0 0 0 0 0l.3-.3c.3-.3 .7-.7 1.3-1.4c1.1-1.2 2.8-3.1 4.9-5.7c4.1-5 9.6-12.4 15.2-21.6c10-16.6 19.5-38.4 21.4-62.9C17.7 326.8 0 285.1 0 240C0 125.1 114.6 32 256 32s256 93.1 256 208z"/></svg>',cI='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512z"/></svg>',uI='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"/></svg>',dI='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"/></svg>',fI='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M352 0c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9L370.7 96 201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L416 141.3l41.4 41.4c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6l0-128c0-17.7-14.3-32-32-32L352 0zM80 32C35.8 32 0 67.8 0 112L0 432c0 44.2 35.8 80 80 80l320 0c44.2 0 80-35.8 80-80l0-112c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112c0 8.8-7.2 16-16 16L80 448c-8.8 0-16-7.2-16-16l0-320c0-8.8 7.2-16 16-16l112 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 32z"/></svg>',pI='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M64 360a56 56 0 1 0 0 112 56 56 0 1 0 0-112zm0-160a56 56 0 1 0 0 112 56 56 0 1 0 0-112zM120 96A56 56 0 1 0 8 96a56 56 0 1 0 112 0z"/></svg>',hI='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M182.6 137.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-9.2 9.2-11.9 22.9-6.9 34.9s16.6 19.8 29.6 19.8l256 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-128-128z"/></svg>',mI='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z"/></svg>',gI='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M177.9 494.1c-18.7 18.7-49.1 18.7-67.9 0L17.9 401.9c-18.7-18.7-18.7-49.1 0-67.9l50.7-50.7 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 41.4-41.4 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 41.4-41.4 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 41.4-41.4 48 48c6.2 6.2 16.4 6.2 22.6 0s6.2-16.4 0-22.6l-48-48 50.7-50.7c18.7-18.7 49.1-18.7 67.9 0l92.1 92.1c18.7 18.7 18.7 49.1 0 67.9L177.9 494.1z"/></svg>',yI='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M339.3 367.1c27.3-3.9 51.9-19.4 67.2-42.9L568.2 74.1c12.6-19.5 9.4-45.3-7.6-61.2S517.7-4.4 499.1 9.6L262.4 187.2c-24 18-38.2 46.1-38.4 76.1L339.3 367.1zm-19.6 25.4l-116-104.4C143.9 290.3 96 339.6 96 400c0 3.9 .2 7.8 .6 11.6C98.4 429.1 86.4 448 68.8 448L64 448c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0c61.9 0 112-50.1 112-112c0-2.5-.1-5-.2-7.5z"/></svg>',bI=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M315 315l158.4-215L444.1 70.6 229 229 315 315zm-187 5s0 0 0 0l0-71.7c0-15.3 7.2-29.6 19.5-38.6L420.6 8.4C428 2.9 437 0 446.2 0c11.4 0 22.4 4.5 30.5 12.6l54.8 54.8c8.1 8.1 12.6 19 12.6 30.5c0 9.2-2.9 18.2-8.4 25.6L334.4 396.5c-9 12.3-23.4 19.5-38.6 19.5L224 416l-25.4 25.4c-12.5 12.5-32.8 12.5-45.3 0l-50.7-50.7c-12.5-12.5-12.5-32.8 0-45.3L128 320zM7 466.3l63-63 70.6 70.6-31 31c-4.5 4.5-10.6 7-17 7L24 512c-13.3 0-24-10.7-24-24l0-4.7c0-6.4 2.5-12.5 7-17z"/></svg>
67
- `,wI='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M64 256l0-96 160 0 0 96L64 256zm0 64l160 0 0 96L64 416l0-96zm224 96l0-96 160 0 0 96-160 0zM448 256l-160 0 0-96 160 0 0 96zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z"/></svg>',vI='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm64 64l0 256 160 0 0-256L64 160zm384 0l-160 0 0 256 160 0 0-256z"/></svg>',xI='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M406.6 374.6l96-96c12.5-12.5 12.5-32.8 0-45.3l-96-96c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 224l-293.5 0 41.4-41.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 288l293.5 0-41.4 41.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"/></svg>',kI='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M256 0c17.7 0 32 14.3 32 32l0 32 32 0c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9l-64 64c-12.5 12.5-32.8 12.5-45.3 0l-64-64c-9.2-9.2-11.9-22.9-6.9-34.9s16.6-19.8 29.6-19.8l32 0 0-32c0-17.7 14.3-32 32-32zM169.4 393.4l64-64c12.5-12.5 32.8-12.5 45.3 0l64 64c9.2 9.2 11.9 22.9 6.9 34.9s-16.6 19.8-29.6 19.8l-32 0 0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-32 0c-12.9 0-24.6-7.8-29.6-19.8s-2.2-25.7 6.9-34.9zM32 224l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l64 64c12.5 12.5 12.5 32.8 0 45.3l-64 64c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6l0-32-32 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm297.4 54.6c-12.5-12.5-12.5-32.8 0-45.3l64-64c9.2-9.2 22.9-11.9 34.9-6.9s19.8 16.6 19.8 29.6l0 32 32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0 0 32c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-64-64zM256 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"/></svg>',Ys='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 144L48 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0 0 144c0 17.7 14.3 32 32 32s32-14.3 32-32l0-144 144 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-144 0 0-144z"/></svg>',wu='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M135.2 17.7C140.6 6.8 151.7 0 163.8 0L284.2 0c12.1 0 23.2 6.8 28.6 17.7L320 32l96 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64S14.3 32 32 32l96 0 7.2-14.3zM32 128l384 0 0 320c0 35.3-28.7 64-64 64L96 512c-35.3 0-64-28.7-64-64l0-320zm96 64c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16s16-7.2 16-16l0-224c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16s16-7.2 16-16l0-224c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16l0 224c0 8.8 7.2 16 16 16s16-7.2 16-16l0-224c0-8.8-7.2-16-16-16z"/></svg>',SI='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M352 320c88.4 0 160-71.6 160-160c0-15.3-2.2-30.1-6.2-44.2c-3.1-10.8-16.4-13.2-24.3-5.3l-76.8 76.8c-3 3-7.1 4.7-11.3 4.7L336 192c-8.8 0-16-7.2-16-16l0-57.4c0-4.2 1.7-8.3 4.7-11.3l76.8-76.8c7.9-7.9 5.4-21.2-5.3-24.3C382.1 2.2 367.3 0 352 0C263.6 0 192 71.6 192 160c0 19.1 3.4 37.5 9.5 54.5L19.9 396.1C7.2 408.8 0 426.1 0 444.1C0 481.6 30.4 512 67.9 512c18 0 35.3-7.2 48-19.9L297.5 310.5c17 6.2 35.4 9.5 54.5 9.5zM80 408a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"/></svg>',CI='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M32 480a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm96-64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0-384a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0 256a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM320 416a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0-320a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm0 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM224 480a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm0-448a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0 256a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM416 416a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm0-384a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM32 96a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM416 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM32 288a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm192 32a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm192 64a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM32 320a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM416 192a32 32 0 1 1 0-64 32 32 0 1 1 0 64zM32 128a32 32 0 1 1 0 64 32 32 0 1 1 0-64zm192 64a32 32 0 1 1 0-64 32 32 0 1 1 0 64z"/></svg>',rn={undo:eI,redo:tI,bold:zN,italic:jN,underline:qN,color:sI,link:Zy,image:HN,alignLeft:WN,alignRight:KN,alignCenter:GN,alignJustify:XN,bulletList:VN,numberedList:UN,indentLeft:YN,indentRight:JN,pageBreak:aI,copyFormat:ZN,clearFormatting:QN,trackChanges:oI,trackChangesFinal:iI,trackChangesOriginal:eb,trackChangesAccept:nI,trackChangesReject:rI,documentMode:Qy,documentEditingMode:Qy,documentSuggestingMode:lI,documentViewingMode:eb,colorOption:cI,colorOptionCheck:uI,linkInput:Zy,removeLink:dI,openLink:fI,overflow:pI,dropdownCaretUp:hI,dropdownCaretDown:mI,ruler:gI,paintbrush:yI,highlight:bI,table:wI,tableActions:vI,splitCell:xI,mergeCells:kI,addRowBefore:Ys,addRowAfter:Ys,addColumnBefore:Ys,addColumnAfter:Ys,deleteRow:wu,deleteColumn:wu,deleteTable:wu,deleteBorders:CI,fixTables:SI},EI={class:"toolbar-icon"},AI=["innerHTML"],$I={__name:"ToolbarButtonIcon",props:{name:{type:String,required:!0},color:{type:String,default:null},icon:{type:String,default:null}},setup(t){const e=t,n=b.computed(()=>{if(e.name==="color")return{backgroundColor:e.color||"#111111"};if(e.name==="highlight")return{backgroundColor:e.color||"#D6D6D6"}}),r=b.computed(()=>["color","highlight"].includes(e.name));return(o,i)=>(b.openBlock(),b.createElementBlock("div",EI,[b.createBaseVNode("div",{class:b.normalizeClass(["toolbar-icon__icon",[`toolbar-icon__icon--${e.name}`]]),innerHTML:t.icon},null,10,AI),r.value?(b.openBlock(),b.createElementBlock("div",{key:0,class:"color-bar",style:b.normalizeStyle(n.value)},null,4)):b.createCommentVNode("",!0)]))}},TI=vt($I,[["__scopeId","data-v-6d7523ab"]]),OI={key:1,class:"button-label"},DI={key:2},MI=["placeholder","onKeydown","id"],_I=["placeholder","onKeydown","id"],NI=["innerHTML"],II={__name:"ToolbarButton",props:{iconColor:{type:String,default:null},active:{type:Boolean,default:!1},isNarrow:{type:Boolean,default:!1},isWide:{type:Boolean,default:!1},toolbarItem:{type:Object,required:!0},defaultLabel:{type:String,default:null}},emits:["buttonClick","textSubmit"],setup(t,{emit:e}){const n=e,r=t,{name:o,active:i,icon:s,label:a,hideLabel:l,iconColor:c,hasCaret:u,disabled:d,inlineTextInputVisible:f,hasInlineTextInput:p,minWidth:h,style:m,attributes:y}=r.toolbarItem,g=b.ref(r.defaultLabel),x=b.ref(null),k=()=>{p&&(x.value?.focus(),x.value?.select()),n("buttonClick")},w=()=>{n("textSubmit",g.value),g.value=""},T=b.computed(()=>m.value?m.value:{minWidth:r.minWidth}),D=F=>{let{value:C}=F.target;g.value=C.replace(/[^0-9]/g,"")},M=b.computed(()=>i.value?rn.dropdownCaretUp:rn.dropdownCaretDown);return(F,C)=>(b.openBlock(),b.createElementBlock("div",{class:b.normalizeClass(["toolbar-item",b.unref(y).className]),style:b.normalizeStyle(T.value)},[b.createBaseVNode("div",{onClick:k,class:b.normalizeClass(["toolbar-button",{active:b.unref(i),disabled:b.unref(d),narrow:t.isNarrow,wide:t.isWide,"has-inline-text-input":b.unref(p)}])},[b.unref(s)?(b.openBlock(),b.createBlock(TI,{key:0,color:b.unref(c),class:"toolbar-icon",icon:b.unref(s),name:b.unref(o)},null,8,["color","icon","name"])):b.createCommentVNode("",!0),b.unref(a)&&!b.unref(l)&&!b.unref(f)?(b.openBlock(),b.createElementBlock("div",OI,b.toDisplayString(b.unref(a)),1)):b.createCommentVNode("",!0),b.unref(f)?(b.openBlock(),b.createElementBlock("span",DI,[b.unref(o)==="fontSize"?b.withDirectives((b.openBlock(),b.createElementBlock("input",{key:0,"onUpdate:modelValue":C[0]||(C[0]=U=>g.value=U),onInput:D,placeholder:b.unref(a),onKeydown:b.withKeys(b.withModifiers(w,["prevent"]),["enter"]),type:"text",class:"button-text-input",id:"inlineTextInput-"+b.unref(o),autoccomplete:"off",ref_key:"inlineInput",ref:x},null,40,MI)),[[b.vModelText,g.value]]):b.withDirectives((b.openBlock(),b.createElementBlock("input",{key:1,"onUpdate:modelValue":C[1]||(C[1]=U=>g.value=U),placeholder:b.unref(a),onKeydown:b.withKeys(b.withModifiers(w,["prevent"]),["enter"]),type:"text",class:"button-text-input",id:"inlineTextInput-"+b.unref(o),autoccomplete:"off",ref_key:"inlineInput",ref:x},null,40,_I)),[[b.vModelText,g.value]])])):b.createCommentVNode("",!0),b.unref(u)?(b.openBlock(),b.createElementBlock("div",{key:3,class:"dropdown-caret",innerHTML:M.value,style:b.normalizeStyle({opacity:b.unref(d)?.6:1})},null,12,NI)):b.createCommentVNode("",!0)],2)],6))}},qd=vt(II,[["__scopeId","data-v-33900b15"]]),FI={class:"toolbar-separator"},BI={__name:"ToolbarSeparator",props:{active:{type:Boolean,default:!1}},emits:["command"],setup(t,{emit:e}){return(n,r)=>(b.openBlock(),b.createElementBlock("div",FI,r[0]||(r[0]=[b.createBaseVNode("div",{class:"separator-inner"},null,-1)])))}},RI=vt(BI,[["__scopeId","data-v-ac2ee4f9"]]),LI={class:"overflow-menu"},PI={class:"overflow-menu-trigger"},zI={key:0,class:"overflow-menu_items"},jI={__name:"OverflowMenu",props:{toolbarItem:{type:Object,required:!0},overflowItems:{type:Array,required:!0}},setup(t){const{proxy:e}=b.getCurrentInstance(),n=t,r=b.ref(!1),o=b.computed(()=>({...n.toolbarItem,active:r})),i=()=>{r.value=!r.value},s=({item:a,argument:l})=>{e.$toolbar.emitCommand({item:a,argument:l})};return(a,l)=>(b.openBlock(),b.createElementBlock("div",LI,[b.createBaseVNode("div",PI,[b.createVNode(qd,{"toolbar-item":o.value,onButtonClick:i},null,8,["toolbar-item"])]),r.value?(b.openBlock(),b.createElementBlock("div",zI,[b.createVNode(Da,{"toolbar-items":t.overflowItems,onCommand:s,class:"superdoc-toolbar-overflow"},null,8,["toolbar-items"])])):b.createCommentVNode("",!0)]))}},qI=vt(jI,[["__scopeId","data-v-ca29bf1d"]]);function VI(t){let e=".",n="__",r="--",o;if(t){let u=t.blockPrefix;u&&(e=u),u=t.elementPrefix,u&&(n=u),u=t.modifierPrefix,u&&(r=u)}const i={install(u){o=u.c;const d=u.context;d.bem={},d.bem.b=null,d.bem.els=null}};function s(u){let d,f;return{before(p){d=p.bem.b,f=p.bem.els,p.bem.els=null},after(p){p.bem.b=d,p.bem.els=f},$({context:p,props:h}){return u=typeof u=="string"?u:u({context:p,props:h}),p.bem.b=u,`${h?.bPrefix||e}${p.bem.b}`}}}function a(u){let d;return{before(f){d=f.bem.els},after(f){f.bem.els=d},$({context:f,props:p}){return u=typeof u=="string"?u:u({context:f,props:p}),f.bem.els=u.split(",").map(h=>h.trim()),f.bem.els.map(h=>`${p?.bPrefix||e}${f.bem.b}${n}${h}`).join(", ")}}}function l(u){return{$({context:d,props:f}){u=typeof u=="string"?u:u({context:d,props:f});const p=u.split(",").map(y=>y.trim());function h(y){return p.map(g=>`&${f?.bPrefix||e}${d.bem.b}${y!==void 0?`${n}${y}`:""}${r}${g}`).join(", ")}const m=d.bem.els;if(m!==null){if(Se.env.NODE_ENV!=="production"&&m.length>=2)throw Error(`[css-render/plugin-bem]: m(${u}) is invalid, using modifier inside multiple elements is not allowed`);return h(m[0])}else return h()}}}function c(u){return{$({context:d,props:f}){u=typeof u=="string"?u:u({context:d,props:f});const p=d.bem.els;if(Se.env.NODE_ENV!=="production"&&p!==null&&p.length>=2)throw Error(`[css-render/plugin-bem]: notM(${u}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${f?.bPrefix||e}${d.bem.b}${p!==null&&p.length>0?`${n}${p[0]}`:""}${r}${u})`}}}return Object.assign(i,{cB:(...u)=>o(s(u[0]),u[1],u[2]),cE:(...u)=>o(a(u[0]),u[1],u[2]),cM:(...u)=>o(l(u[0]),u[1],u[2]),cNotM:(...u)=>o(c(u[0]),u[1],u[2])}),i}function UI(t){let e=0;for(let n=0;n<t.length;++n)t[n]==="&"&&++e;return e}const Cx=/\s*,(?![^(]*\))\s*/g,HI=/\s+/g;function WI(t,e){const n=[];return e.split(Cx).forEach(r=>{let o=UI(r);if(o){if(o===1){t.forEach(s=>{n.push(r.replace("&",s))});return}}else{t.forEach(s=>{n.push((s&&s+" ")+r)});return}let i=[r];for(;o--;){const s=[];i.forEach(a=>{t.forEach(l=>{s.push(a.replace("&",l))})}),i=s}i.forEach(s=>n.push(s))}),n}function GI(t,e){const n=[];return e.split(Cx).forEach(r=>{t.forEach(o=>{n.push((o&&o+" ")+r)})}),n}function KI(t){let e=[""];return t.forEach(n=>{n=n&&n.trim(),n&&(n.includes("&")?e=WI(e,n):e=GI(e,n))}),e.join(", ").replace(HI," ")}function tb(t){if(!t)return;const e=t.parentElement;e&&e.removeChild(t)}function Dl(t,e){return(e??document.head).querySelector(`style[cssr-id="${t}"]`)}function XI(t){const e=document.createElement("style");return e.setAttribute("cssr-id",t),e}function Zs(t){return t?/^\s*@(s|m)/.test(t):!1}const JI=/[A-Z]/g;function Ex(t){return t.replace(JI,e=>"-"+e.toLowerCase())}function YI(t,e=" "){return typeof t=="object"&&t!==null?` {
68
- `+Object.entries(t).map(n=>e+` ${Ex(n[0])}: ${n[1]};`).join(`
69
- `)+`
70
- `+e+"}":`: ${t};`}function ZI(t,e,n){return typeof t=="function"?t({context:e.context,props:n}):t}function nb(t,e,n,r){if(!e)return"";const o=ZI(e,n,r);if(!o)return"";if(typeof o=="string")return`${t} {
71
- ${o}
72
- }`;const i=Object.keys(o);if(i.length===0)return n.config.keepEmptyBlock?t+` {
73
- }`:"";const s=t?[t+" {"]:[];return i.forEach(a=>{const l=o[a];if(a==="raw"){s.push(`
74
- `+l+`
75
- `);return}a=Ex(a),l!=null&&s.push(` ${a}${YI(l)}`)}),t&&s.push("}"),s.join(`
76
- `)}function Vd(t,e,n){t&&t.forEach(r=>{if(Array.isArray(r))Vd(r,e,n);else if(typeof r=="function"){const o=r(e);Array.isArray(o)?Vd(o,e,n):o&&n(o)}else r&&n(r)})}function Ax(t,e,n,r,o){const i=t.$;let s="";if(!i||typeof i=="string")Zs(i)?s=i:e.push(i);else if(typeof i=="function"){const c=i({context:r.context,props:o});Zs(c)?s=c:e.push(c)}else if(i.before&&i.before(r.context),!i.$||typeof i.$=="string")Zs(i.$)?s=i.$:e.push(i.$);else if(i.$){const c=i.$({context:r.context,props:o});Zs(c)?s=c:e.push(c)}const a=KI(e),l=nb(a,t.props,r,o);s?n.push(`${s} {`):l.length&&n.push(l),t.children&&Vd(t.children,{context:r.context,props:o},c=>{if(typeof c=="string"){const u=nb(a,{raw:c},r,o);n.push(u)}else Ax(c,e,n,r,o)}),e.pop(),s&&n.push("}"),i&&i.after&&i.after(r.context)}function QI(t,e,n){const r=[];return Ax(t,[],r,e,n),r.join(`
77
-
78
- `)}function Ud(t){for(var e=0,n,r=0,o=t.length;o>=4;++r,o-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(o){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function e8(t,e,n,r){const{els:o}=e;if(n===void 0)o.forEach(tb),e.els=[];else{const i=Dl(n,r);i&&o.includes(i)&&(tb(i),e.els=o.filter(s=>s!==i))}}function rb(t,e){t.push(e)}function t8(t,e,n,r,o,i,s,a,l){let c;if(n===void 0&&(c=e.render(r),n=Ud(c)),l){l.adapter(n,c??e.render(r));return}a===void 0&&(a=document.head);const u=Dl(n,a);if(u!==null&&!i)return u;const d=u??XI(n);if(c===void 0&&(c=e.render(r)),d.textContent=c,u!==null)return u;if(s){const f=a.querySelector(`meta[name="${s}"]`);if(f)return a.insertBefore(d,f),rb(e.els,d),d}return o?a.insertBefore(d,a.querySelector("style, link")):a.appendChild(d),rb(e.els,d),d}function n8(t){return QI(this,this.instance,t)}function r8(t={}){const{id:e,ssr:n,props:r,head:o=!1,force:i=!1,anchorMetaName:s,parent:a}=t;return t8(this.instance,this,e,r,o,i,s,a,n)}function o8(t={}){const{id:e,parent:n}=t;e8(this.instance,this,e,n)}const Qs=function(t,e,n,r){return{instance:t,$:e,props:n,children:r,els:[],render:n8,mount:r8,unmount:o8}},i8=function(t,e,n,r){return Array.isArray(e)?Qs(t,{$:null},null,e):Array.isArray(n)?Qs(t,e,null,n):Array.isArray(r)?Qs(t,e,n,r):Qs(t,e,n,null)};function $x(t={}){const e={c:(...n)=>i8(e,...n),use:(n,...r)=>n.install(e,...r),find:Dl,context:{},config:t};return e}function s8(t,e){if(t===void 0)return!1;if(e){const{context:{ids:n}}=e;return n.has(t)}return Dl(t)!==null}const a8="n",l8=`.${a8}-`,c8="__",u8="--",Tx=$x(),Ox=VI({blockPrefix:l8,elementPrefix:c8,modifierPrefix:u8});Tx.use(Ox);const{c:ze,find:kj}=Tx,{cB:Xe,cE:Pt,cM:it,cNotM:Xi}=Ox,d8=(...t)=>ze(">",[Xe(...t)]);function hr(t,e){return t+(e==="default"?"":e.replace(/^[a-z]/,n=>n.toUpperCase()))}let ol=[];const Dx=new WeakMap;function f8(){ol.forEach(t=>t(...Dx.get(t))),ol=[]}function p8(t,...e){Dx.set(t,e),!ol.includes(t)&&ol.push(t)===1&&requestAnimationFrame(f8)}function ob(t,e){let{target:n}=t;for(;n;){if(n.dataset&&n.dataset[e]!==void 0)return!0;n=n.parentElement}return!1}function il(t){return t.composedPath()[0]||null}function ib(t){return typeof t=="string"?t.endsWith("px")?Number(t.slice(0,t.length-2)):Number(t):t}function sb(t){if(t!=null)return typeof t=="number"?`${t}px`:t.endsWith("px")?t:`${t}px`}function Ri(t,e){const n=t.trim().split(/\s+/g),r={top:n[0]};switch(n.length){case 1:r.right=n[0],r.bottom=n[0],r.left=n[0];break;case 2:r.right=n[1],r.left=n[1],r.bottom=n[0];break;case 3:r.right=n[1],r.bottom=n[2],r.left=n[1];break;case 4:r.right=n[1],r.bottom=n[2],r.left=n[3];break;default:throw new Error("[seemly/getMargin]:"+t+" is not a valid value.")}return r}const ab={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#0FF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000",blanchedalmond:"#FFEBCD",blue:"#00F",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#0FF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#F0F",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#0F0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#F0F",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#F00",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFF",whitesmoke:"#F5F5F5",yellow:"#FF0",yellowgreen:"#9ACD32",transparent:"#0000"};function h8(t,e,n){e/=100,n/=100;let r=(o,i=(o+t/60)%6)=>n-n*e*Math.max(Math.min(i,4-i,1),0);return[r(5)*255,r(3)*255,r(1)*255]}function m8(t,e,n){e/=100,n/=100;let r=e*Math.min(n,1-n),o=(i,s=(i+t/30)%12)=>n-r*Math.max(Math.min(s-3,9-s,1),-1);return[o(0)*255,o(8)*255,o(4)*255]}const Pn="^\\s*",zn="\\s*$",Or="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",on="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",Wr="([0-9A-Fa-f])",Gr="([0-9A-Fa-f]{2})",Mx=new RegExp(`${Pn}hsl\\s*\\(${on},${Or},${Or}\\)${zn}`),_x=new RegExp(`${Pn}hsv\\s*\\(${on},${Or},${Or}\\)${zn}`),Nx=new RegExp(`${Pn}hsla\\s*\\(${on},${Or},${Or},${on}\\)${zn}`),Ix=new RegExp(`${Pn}hsva\\s*\\(${on},${Or},${Or},${on}\\)${zn}`),g8=new RegExp(`${Pn}rgb\\s*\\(${on},${on},${on}\\)${zn}`),y8=new RegExp(`${Pn}rgba\\s*\\(${on},${on},${on},${on}\\)${zn}`),b8=new RegExp(`${Pn}#${Wr}${Wr}${Wr}${zn}`),w8=new RegExp(`${Pn}#${Gr}${Gr}${Gr}${zn}`),v8=new RegExp(`${Pn}#${Wr}${Wr}${Wr}${Wr}${zn}`),x8=new RegExp(`${Pn}#${Gr}${Gr}${Gr}${Gr}${zn}`);function Ht(t){return parseInt(t,16)}function k8(t){try{let e;if(e=Nx.exec(t))return[sl(e[1]),kr(e[5]),kr(e[9]),oo(e[13])];if(e=Mx.exec(t))return[sl(e[1]),kr(e[5]),kr(e[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${t}.`)}catch(e){throw e}}function S8(t){try{let e;if(e=Ix.exec(t))return[sl(e[1]),kr(e[5]),kr(e[9]),oo(e[13])];if(e=_x.exec(t))return[sl(e[1]),kr(e[5]),kr(e[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${t}.`)}catch(e){throw e}}function fo(t){try{let e;if(e=w8.exec(t))return[Ht(e[1]),Ht(e[2]),Ht(e[3]),1];if(e=g8.exec(t))return[Dt(e[1]),Dt(e[5]),Dt(e[9]),1];if(e=y8.exec(t))return[Dt(e[1]),Dt(e[5]),Dt(e[9]),oo(e[13])];if(e=b8.exec(t))return[Ht(e[1]+e[1]),Ht(e[2]+e[2]),Ht(e[3]+e[3]),1];if(e=x8.exec(t))return[Ht(e[1]),Ht(e[2]),Ht(e[3]),oo(Ht(e[4])/255)];if(e=v8.exec(t))return[Ht(e[1]+e[1]),Ht(e[2]+e[2]),Ht(e[3]+e[3]),oo(Ht(e[4]+e[4])/255)];if(t in ab)return fo(ab[t]);if(Mx.test(t)||Nx.test(t)){const[n,r,o,i]=k8(t);return[...m8(n,r,o),i]}else if(_x.test(t)||Ix.test(t)){const[n,r,o,i]=S8(t);return[...h8(n,r,o),i]}throw new Error(`[seemly/rgba]: Invalid color value ${t}.`)}catch(e){throw e}}function C8(t){return t>1?1:t<0?0:t}function Hd(t,e,n,r){return`rgba(${Dt(t)}, ${Dt(e)}, ${Dt(n)}, ${C8(r)})`}function vu(t,e,n,r,o){return Dt((t*e*(1-r)+n*r)/o)}function Fx(t,e){Array.isArray(t)||(t=fo(t)),Array.isArray(e)||(e=fo(e));const n=t[3],r=e[3],o=oo(n+r-n*r);return Hd(vu(t[0],n,e[0],r,o),vu(t[1],n,e[1],r,o),vu(t[2],n,e[2],r,o),o)}function E8(t,e){const[n,r,o,i=1]=Array.isArray(t)?t:fo(t);return typeof e.alpha=="number"?Hd(n,r,o,e.alpha):Hd(n,r,o,i)}function ea(t,e){const[n,r,o,i=1]=Array.isArray(t)?t:fo(t),{lightness:s=1,alpha:a=1}=e;return A8([n*s,r*s,o*s,i*a])}function oo(t){const e=Math.round(Number(t)*100)/100;return e>1?1:e<0?0:e}function sl(t){const e=Math.round(Number(t));return e>=360||e<0?0:e}function Dt(t){const e=Math.round(Number(t));return e>255?255:e<0?0:e}function kr(t){const e=Math.round(Number(t));return e>100?100:e<0?0:e}function A8(t){const[e,n,r]=t;return 3 in t?`rgba(${Dt(e)}, ${Dt(n)}, ${Dt(r)}, ${oo(t[3])})`:`rgba(${Dt(e)}, ${Dt(n)}, ${Dt(r)}, 1)`}function $8(t=8){return Math.random().toString(16).slice(2,2+t)}function T8(t,e){const n=[];for(let r=0;r<t;++r)n.push(e);return n}function Aa(t){return t.composedPath()[0]}const O8={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function D8(t,e,n){if(t==="mousemoveoutside"){const r=o=>{e.contains(Aa(o))||n(o)};return{mousemove:r,touchstart:r}}else if(t==="clickoutside"){let r=!1;const o=s=>{r=!e.contains(Aa(s))},i=s=>{r&&(e.contains(Aa(s))||n(s))};return{mousedown:o,mouseup:i,touchstart:o,touchend:i}}return console.error(`[evtd/create-trap-handler]: name \`${t}\` is invalid. This could be a bug of evtd.`),{}}function Bx(t,e,n){const r=O8[t];let o=r.get(e);o===void 0&&r.set(e,o=new WeakMap);let i=o.get(n);return i===void 0&&o.set(n,i=D8(t,e,n)),i}function M8(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const o=Bx(t,e,n);return Object.keys(o).forEach(i=>{mt(i,document,o[i],r)}),!0}return!1}function _8(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const o=Bx(t,e,n);return Object.keys(o).forEach(i=>{nt(i,document,o[i],r)}),!0}return!1}function N8(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const t=new WeakMap,e=new WeakMap;function n(){t.set(this,!0)}function r(){t.set(this,!0),e.set(this,!0)}function o(M,F,C){const U=M[F];return M[F]=function(){return C.apply(M,arguments),U.apply(M,arguments)},M}function i(M,F){M[F]=Event.prototype[F]}const s=new WeakMap,a=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function l(){var M;return(M=s.get(this))!==null&&M!==void 0?M:null}function c(M,F){a!==void 0&&Object.defineProperty(M,"currentTarget",{configurable:!0,enumerable:!0,get:F??a.get})}const u={bubble:{},capture:{}},d={};function f(){const M=function(F){const{type:C,eventPhase:U,bubbles:ie}=F,I=Aa(F);if(U===2)return;const W=U===1?"capture":"bubble";let A=I;const G=[];for(;A===null&&(A=window),G.push(A),A!==window;)A=A.parentNode||null;const ae=u.capture[C],X=u.bubble[C];if(o(F,"stopPropagation",n),o(F,"stopImmediatePropagation",r),c(F,l),W==="capture"){if(ae===void 0)return;for(let de=G.length-1;de>=0&&!t.has(F);--de){const J=G[de],pe=ae.get(J);if(pe!==void 0){s.set(F,J);for(const Q of pe){if(e.has(F))break;Q(F)}}if(de===0&&!ie&&X!==void 0){const Q=X.get(J);if(Q!==void 0)for(const B of Q){if(e.has(F))break;B(F)}}}}else if(W==="bubble"){if(X===void 0)return;for(let de=0;de<G.length&&!t.has(F);++de){const J=G[de],pe=X.get(J);if(pe!==void 0){s.set(F,J);for(const Q of pe){if(e.has(F))break;Q(F)}}}}i(F,"stopPropagation"),i(F,"stopImmediatePropagation"),c(F)};return M.displayName="evtdUnifiedHandler",M}function p(){const M=function(F){const{type:C,eventPhase:U}=F;if(U!==2)return;const ie=d[C];ie!==void 0&&ie.forEach(I=>I(F))};return M.displayName="evtdUnifiedWindowEventHandler",M}const h=f(),m=p();function y(M,F){const C=u[M];return C[F]===void 0&&(C[F]=new Map,window.addEventListener(F,h,M==="capture")),C[F]}function g(M){return d[M]===void 0&&(d[M]=new Set,window.addEventListener(M,m)),d[M]}function x(M,F){let C=M.get(F);return C===void 0&&M.set(F,C=new Set),C}function k(M,F,C,U){const ie=u[F][C];if(ie!==void 0){const I=ie.get(M);if(I!==void 0&&I.has(U))return!0}return!1}function w(M,F){const C=d[M];return!!(C!==void 0&&C.has(F))}function T(M,F,C,U){let ie;if(typeof U=="object"&&U.once===!0?ie=G=>{D(M,F,ie,U),C(G)}:ie=C,M8(M,F,ie,U))return;const I=U===!0||typeof U=="object"&&U.capture===!0?"capture":"bubble",W=y(I,M),A=x(W,F);if(A.has(ie)||A.add(ie),F===window){const G=g(M);G.has(ie)||G.add(ie)}}function D(M,F,C,U){if(_8(M,F,C,U))return;const ie=U===!0||typeof U=="object"&&U.capture===!0,I=ie?"capture":"bubble",W=y(I,M),A=x(W,F);if(F===window&&!k(F,ie?"bubble":"capture",M,C)&&w(M,C)){const G=d[M];G.delete(C),G.size===0&&(window.removeEventListener(M,m),d[M]=void 0)}A.has(C)&&A.delete(C),A.size===0&&W.delete(F),W.size===0&&(window.removeEventListener(M,h,I==="capture"),u[I][M]=void 0)}return{on:T,off:D}}const{on:mt,off:nt}=N8();function I8(t){const e=b.ref(!!t.value);if(e.value)return b.readonly(e);const n=b.watch(t,r=>{r&&(e.value=!0,n())});return b.readonly(e)}function nr(t){const e=b.computed(t),n=b.ref(e.value);return b.watch(e,r=>{n.value=r}),typeof t=="function"?n:{__v_isRef:!0,get value(){return n.value},set value(r){t.set(r)}}}function F8(){return b.getCurrentInstance()!==null}const B8=typeof window<"u";let $a,Ji;const R8=()=>{var t,e;$a=B8?(e=(t=document)===null||t===void 0?void 0:t.fonts)===null||e===void 0?void 0:e.ready:void 0,Ji=!1,$a!==void 0?$a.then(()=>{Ji=!0}):Ji=!0};R8();function L8(t){if(Ji)return;let e=!1;b.onMounted(()=>{Ji||$a?.then(()=>{e||t()})}),b.onBeforeUnmount(()=>{e=!0})}function Rx(t,e){return b.watch(t,n=>{n!==void 0&&(e.value=n)}),b.computed(()=>t.value===void 0?e.value:t.value)}function Lx(){const t=b.ref(!1);return b.onMounted(()=>{t.value=!0}),b.readonly(t)}function P8(t,e){return b.computed(()=>{for(const n of e)if(t[n]!==void 0)return t[n];return t[e[e.length-1]]})}const z8=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function j8(){return z8}function q8(t={},e){const n=b.reactive({ctrl:!1,command:!1,win:!1,shift:!1,tab:!1}),{keydown:r,keyup:o}=t,i=l=>{switch(l.key){case"Control":n.ctrl=!0;break;case"Meta":n.command=!0,n.win=!0;break;case"Shift":n.shift=!0;break;case"Tab":n.tab=!0;break}r!==void 0&&Object.keys(r).forEach(c=>{if(c!==l.key)return;const u=r[c];if(typeof u=="function")u(l);else{const{stop:d=!1,prevent:f=!1}=u;d&&l.stopPropagation(),f&&l.preventDefault(),u.handler(l)}})},s=l=>{switch(l.key){case"Control":n.ctrl=!1;break;case"Meta":n.command=!1,n.win=!1;break;case"Shift":n.shift=!1;break;case"Tab":n.tab=!1;break}o!==void 0&&Object.keys(o).forEach(c=>{if(c!==l.key)return;const u=o[c];if(typeof u=="function")u(l);else{const{stop:d=!1,prevent:f=!1}=u;d&&l.stopPropagation(),f&&l.preventDefault(),u.handler(l)}})},a=()=>{(e===void 0||e.value)&&(mt("keydown",document,i),mt("keyup",document,s)),e!==void 0&&b.watch(e,l=>{l?(mt("keydown",document,i),mt("keyup",document,s)):(nt("keydown",document,i),nt("keyup",document,s))})};return F8()?(b.onBeforeMount(a),b.onBeforeUnmount(()=>{(e===void 0||e.value)&&(nt("keydown",document,i),nt("keyup",document,s))})):a(),b.readonly(n)}const V8="n-internal-select-menu-body",dp="n-drawer-body",fp="n-modal-body",Ml="n-popover-body",Px="__disabled__";function ri(t){const e=b.inject(fp,null),n=b.inject(dp,null),r=b.inject(Ml,null),o=b.inject(V8,null),i=b.ref();if(typeof document<"u"){i.value=document.fullscreenElement;const s=()=>{i.value=document.fullscreenElement};b.onMounted(()=>{mt("fullscreenchange",document,s)}),b.onBeforeUnmount(()=>{nt("fullscreenchange",document,s)})}return nr(()=>{var s;const{to:a}=t;return a!==void 0?a===!1?Px:a===!0?i.value||"body":a:e?.value?(s=e.value.$el)!==null&&s!==void 0?s:e.value:n?.value?n.value:r?.value?r.value:o?.value?o.value:a??(i.value||"body")})}ri.tdkey=Px;ri.propTo={type:[String,Object,Boolean],default:void 0};function U8(t,e,n){const r=b.ref(t.value);let o=null;return b.watch(t,i=>{o!==null&&window.clearTimeout(o),i===!0?n&&!n.value?r.value=!0:o=window.setTimeout(()=>{r.value=!0},e):r.value=!1}),r}const H8=typeof document<"u"&&typeof window<"u";let lb=!1;function W8(){if(H8&&window.CSS&&!lb&&(lb=!0,"registerProperty"in window?.CSS))try{CSS.registerProperty({name:"--n-color-start",syntax:"<color>",inherits:!1,initialValue:"#0000"}),CSS.registerProperty({name:"--n-color-end",syntax:"<color>",inherits:!1,initialValue:"#0000"})}catch{}}function G8(t){const e={isDeactivated:!1};let n=!1;return b.onActivated(()=>{if(e.isDeactivated=!1,!n){n=!0;return}t()}),b.onDeactivated(()=>{e.isDeactivated=!0,n||(n=!0)}),e}function Wd(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);return r()}function Gd(t,e=!0,n=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(b.createTextVNode(String(r)));return}if(Array.isArray(r)){Gd(r,e,n);return}if(r.type===b.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Gd(r.children,e,n)}else r.type!==b.Comment&&n.push(r)}}),n}function cb(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);const o=Gd(r());if(o.length===1)return o[0];throw new Error(`[vueuc/${t}]: slot[${n}] should have exactly one child.`)}let ur=null;function zx(){if(ur===null&&(ur=document.getElementById("v-binder-view-measurer"),ur===null)){ur=document.createElement("div"),ur.id="v-binder-view-measurer";const{style:t}=ur;t.position="fixed",t.left="0",t.right="0",t.top="0",t.bottom="0",t.pointerEvents="none",t.visibility="hidden",document.body.appendChild(ur)}return ur.getBoundingClientRect()}function K8(t,e){const n=zx();return{top:e,left:t,height:0,width:0,right:n.width-t,bottom:n.height-e}}function xu(t){const e=t.getBoundingClientRect(),n=zx();return{left:e.left-n.left,top:e.top-n.top,bottom:n.height+n.top-e.bottom,right:n.width+n.left-e.right,width:e.width,height:e.height}}function X8(t){return t.nodeType===9?null:t.parentNode}function jx(t){if(t===null)return null;const e=X8(t);if(e===null)return null;if(e.nodeType===9)return document;if(e.nodeType===1){const{overflow:n,overflowX:r,overflowY:o}=getComputedStyle(e);if(/(auto|scroll|overlay)/.test(n+o+r))return e}return jx(e)}const qx=b.defineComponent({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(t){var e;b.provide("VBinder",(e=b.getCurrentInstance())===null||e===void 0?void 0:e.proxy);const n=b.inject("VBinder",null),r=b.ref(null),o=g=>{r.value=g,n&&t.syncTargetWithParent&&n.setTargetRef(g)};let i=[];const s=()=>{let g=r.value;for(;g=jx(g),g!==null;)i.push(g);for(const x of i)mt("scroll",x,d,!0)},a=()=>{for(const g of i)nt("scroll",g,d,!0);i=[]},l=new Set,c=g=>{l.size===0&&s(),l.has(g)||l.add(g)},u=g=>{l.has(g)&&l.delete(g),l.size===0&&a()},d=()=>{p8(f)},f=()=>{l.forEach(g=>g())},p=new Set,h=g=>{p.size===0&&mt("resize",window,y),p.has(g)||p.add(g)},m=g=>{p.has(g)&&p.delete(g),p.size===0&&nt("resize",window,y)},y=()=>{p.forEach(g=>g())};return b.onBeforeUnmount(()=>{nt("resize",window,y),a()}),{targetRef:r,setTargetRef:o,addScrollListener:c,removeScrollListener:u,addResizeListener:h,removeResizeListener:m}},render(){return Wd("binder",this.$slots)}}),Vx=b.defineComponent({name:"Target",setup(){const{setTargetRef:t,syncTarget:e}=b.inject("VBinder");return{syncTarget:e,setTargetDirective:{mounted:t,updated:t}}},render(){const{syncTarget:t,setTargetDirective:e}=this;return t?b.withDirectives(cb("follower",this.$slots),[[e]]):cb("follower",this.$slots)}}),Eo="@@mmoContext",J8={mounted(t,{value:e}){t[Eo]={handler:void 0},typeof e=="function"&&(t[Eo].handler=e,mt("mousemoveoutside",t,e))},updated(t,{value:e}){const n=t[Eo];typeof e=="function"?n.handler?n.handler!==e&&(nt("mousemoveoutside",t,n.handler),n.handler=e,mt("mousemoveoutside",t,e)):(t[Eo].handler=e,mt("mousemoveoutside",t,e)):n.handler&&(nt("mousemoveoutside",t,n.handler),n.handler=void 0)},unmounted(t){const{handler:e}=t[Eo];e&&nt("mousemoveoutside",t,e),t[Eo].handler=void 0}},Ao="@@coContext",ub={mounted(t,{value:e,modifiers:n}){t[Ao]={handler:void 0},typeof e=="function"&&(t[Ao].handler=e,mt("clickoutside",t,e,{capture:n.capture}))},updated(t,{value:e,modifiers:n}){const r=t[Ao];typeof e=="function"?r.handler?r.handler!==e&&(nt("clickoutside",t,r.handler,{capture:n.capture}),r.handler=e,mt("clickoutside",t,e,{capture:n.capture})):(t[Ao].handler=e,mt("clickoutside",t,e,{capture:n.capture})):r.handler&&(nt("clickoutside",t,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(t,{modifiers:e}){const{handler:n}=t[Ao];n&&nt("clickoutside",t,n,{capture:e.capture}),t[Ao].handler=void 0}};function Y8(t,e){console.error(`[vdirs/${t}]: ${e}`)}class Z8{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(e,n){const{elementZIndex:r}=this;if(n!==void 0){e.style.zIndex=`${n}`,r.delete(e);return}const{nextZIndex:o}=this;r.has(e)&&r.get(e)+1===this.nextZIndex||(e.style.zIndex=`${o}`,r.set(e,o),this.nextZIndex=o+1,this.squashState())}unregister(e,n){const{elementZIndex:r}=this;r.has(e)?r.delete(e):n===void 0&&Y8("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:e}=this;e||(this.nextZIndex=2e3),this.nextZIndex-e>2500&&this.rearrange()}rearrange(){const e=Array.from(this.elementZIndex.entries());e.sort((n,r)=>n[1]-r[1]),this.nextZIndex=2e3,e.forEach(n=>{const r=n[0],o=this.nextZIndex++;`${o}`!==r.style.zIndex&&(r.style.zIndex=`${o}`)})}}const ku=new Z8,$o="@@ziContext",Ux={mounted(t,e){const{value:n={}}=e,{zIndex:r,enabled:o}=n;t[$o]={enabled:!!o,initialized:!1},o&&(ku.ensureZIndex(t,r),t[$o].initialized=!0)},updated(t,e){const{value:n={}}=e,{zIndex:r,enabled:o}=n,i=t[$o].enabled;o&&!i&&(ku.ensureZIndex(t,r),t[$o].initialized=!0),t[$o].enabled=!!o},unmounted(t,e){if(!t[$o].initialized)return;const{value:n={}}=e,{zIndex:r}=n;ku.unregister(t,r)}},Q8="@css-render/vue3-ssr";function eF(t,e){return`<style cssr-id="${t}">
79
- ${e}
80
- </style>`}function tF(t,e,n){const{styles:r,ids:o}=n;o.has(t)||r!==null&&(o.add(t),r.push(eF(t,e)))}const nF=typeof document<"u";function _l(){if(nF)return;const t=b.inject(Q8,null);if(t!==null)return{adapter:(e,n)=>tF(e,n,t),context:t}}function db(t,e){console.error(`[vueuc/${t}]: ${e}`)}const{c:ta}=$x(),rF="vueuc-style";function fb(t){return typeof t=="string"?document.querySelector(t):t()}const oF=b.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(t){return{showTeleport:I8(b.toRef(t,"show")),mergedTo:b.computed(()=>{const{to:e}=t;return e??"body"})}},render(){return this.showTeleport?this.disabled?Wd("lazy-teleport",this.$slots):b.h(b.Teleport,{disabled:this.disabled,to:this.mergedTo},Wd("lazy-teleport",this.$slots)):null}}),na={top:"bottom",bottom:"top",left:"right",right:"left"},pb={start:"end",center:"center",end:"start"},Su={top:"height",bottom:"height",left:"width",right:"width"},iF={"bottom-start":"top left",bottom:"top center","bottom-end":"top right","top-start":"bottom left",top:"bottom center","top-end":"bottom right","right-start":"top left",right:"center left","right-end":"bottom left","left-start":"top right",left:"center right","left-end":"bottom right"},sF={"bottom-start":"bottom left",bottom:"bottom center","bottom-end":"bottom right","top-start":"top left",top:"top center","top-end":"top right","right-start":"top right",right:"center right","right-end":"bottom right","left-start":"top left",left:"center left","left-end":"bottom left"},aF={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},hb={top:!0,bottom:!1,left:!0,right:!1},mb={top:"end",bottom:"start",left:"end",right:"start"};function lF(t,e,n,r,o,i){if(!o||i)return{placement:t,top:0,left:0};const[s,a]=t.split("-");let l=a??"center",c={top:0,left:0};const u=(p,h,m)=>{let y=0,g=0;const x=n[p]-e[h]-e[p];return x>0&&r&&(m?g=hb[h]?x:-x:y=hb[h]?x:-x),{left:y,top:g}},d=s==="left"||s==="right";if(l!=="center"){const p=aF[t],h=na[p],m=Su[p];if(n[m]>e[m]){if(e[p]+e[m]<n[m]){const y=(n[m]-e[m])/2;e[p]<y||e[h]<y?e[p]<e[h]?(l=pb[a],c=u(m,h,d)):c=u(m,p,d):l="center"}}else n[m]<e[m]&&e[h]<0&&e[p]>e[h]&&(l=pb[a])}else{const p=s==="bottom"||s==="top"?"left":"top",h=na[p],m=Su[p],y=(n[m]-e[m])/2;(e[p]<y||e[h]<y)&&(e[p]>e[h]?(l=mb[p],c=u(m,p,d)):(l=mb[h],c=u(m,h,d)))}let f=s;return e[s]<n[Su[s]]&&e[s]<e[na[s]]&&(f=na[s]),{placement:l!=="center"?`${f}-${l}`:f,left:c.left,top:c.top}}function cF(t,e){return e?sF[t]:iF[t]}function uF(t,e,n,r,o,i){if(i)switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"top-end":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"left-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:""};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:""};case"right-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+o)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+o)}px`,transform:"translateX(-50%)"}}}const dF=ta([ta(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),ta(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[ta("> *",{pointerEvents:"all"})])]),Hx=b.defineComponent({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(t){const e=b.inject("VBinder"),n=nr(()=>t.enabled!==void 0?t.enabled:t.show),r=b.ref(null),o=b.ref(null),i=()=>{const{syncTrigger:f}=t;f.includes("scroll")&&e.addScrollListener(l),f.includes("resize")&&e.addResizeListener(l)},s=()=>{e.removeScrollListener(l),e.removeResizeListener(l)};b.onMounted(()=>{n.value&&(l(),i())});const a=_l();dF.mount({id:"vueuc/binder",head:!0,anchorMetaName:rF,ssr:a}),b.onBeforeUnmount(()=>{s()}),L8(()=>{n.value&&l()});const l=()=>{if(!n.value)return;const f=r.value;if(f===null)return;const p=e.targetRef,{x:h,y:m,overlap:y}=t,g=h!==void 0&&m!==void 0?K8(h,m):xu(p);f.style.setProperty("--v-target-width",`${Math.round(g.width)}px`),f.style.setProperty("--v-target-height",`${Math.round(g.height)}px`);const{width:x,minWidth:k,placement:w,internalShift:T,flip:D}=t;f.setAttribute("v-placement",w),y?f.setAttribute("v-overlap",""):f.removeAttribute("v-overlap");const{style:M}=f;x==="target"?M.width=`${g.width}px`:x!==void 0?M.width=x:M.width="",k==="target"?M.minWidth=`${g.width}px`:k!==void 0?M.minWidth=k:M.minWidth="";const F=xu(f),C=xu(o.value),{left:U,top:ie,placement:I}=lF(w,g,F,T,D,y),W=cF(I,y),{left:A,top:G,transform:ae}=uF(I,C,g,ie,U,y);f.setAttribute("v-placement",I),f.style.setProperty("--v-offset-left",`${Math.round(U)}px`),f.style.setProperty("--v-offset-top",`${Math.round(ie)}px`),f.style.transform=`translateX(${A}) translateY(${G}) ${ae}`,f.style.setProperty("--v-transform-origin",W),f.style.transformOrigin=W};b.watch(n,f=>{f?(i(),c()):s()});const c=()=>{b.nextTick().then(l).catch(f=>console.error(f))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(f=>{b.watch(b.toRef(t,f),l)}),["teleportDisabled"].forEach(f=>{b.watch(b.toRef(t,f),c)}),b.watch(b.toRef(t,"syncTrigger"),f=>{f.includes("resize")?e.addResizeListener(l):e.removeResizeListener(l),f.includes("scroll")?e.addScrollListener(l):e.removeScrollListener(l)});const u=Lx(),d=nr(()=>{const{to:f}=t;if(f!==void 0)return f;u.value});return{VBinder:e,mergedEnabled:n,offsetContainerRef:o,followerRef:r,mergedTo:d,syncPosition:l}},render(){return b.h(oF,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var t,e;const n=b.h("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[b.h("div",{class:"v-binder-follower-content",ref:"followerRef"},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))]);return this.zindexable?b.withDirectives(n,[[Ux,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var io=[],fF=function(){return io.some(function(t){return t.activeTargets.length>0})},pF=function(){return io.some(function(t){return t.skippedTargets.length>0})},gb="ResizeObserver loop completed with undelivered notifications.",hF=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:gb}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=gb),window.dispatchEvent(t)},gs;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(gs||(gs={}));var so=function(t){return Object.freeze(t)},mF=function(){function t(e,n){this.inlineSize=e,this.blockSize=n,so(this)}return t}(),Wx=function(){function t(e,n,r,o){return this.x=e,this.y=n,this.width=r,this.height=o,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,so(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,r=e.y,o=e.top,i=e.right,s=e.bottom,a=e.left,l=e.width,c=e.height;return{x:n,y:r,top:o,right:i,bottom:s,left:a,width:l,height:c}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),pp=function(t){return t instanceof SVGElement&&"getBBox"in t},Gx=function(t){if(pp(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var o=t,i=o.offsetWidth,s=o.offsetHeight;return!(i||s||t.getClientRects().length)},yb=function(t){var e;if(t instanceof Element)return!0;var n=(e=t?.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},gF=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},Yi=typeof window<"u"?window:{},ra=new WeakMap,bb=/auto|scroll/,yF=/^tb|vertical/,bF=/msie|trident/i.test(Yi.navigator&&Yi.navigator.userAgent),Sn=function(t){return parseFloat(t||"0")},Vo=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new mF((n?e:t)||0,(n?t:e)||0)},wb=so({devicePixelContentBoxSize:Vo(),borderBoxSize:Vo(),contentBoxSize:Vo(),contentRect:new Wx(0,0,0,0)}),Kx=function(t,e){if(e===void 0&&(e=!1),ra.has(t)&&!e)return ra.get(t);if(Gx(t))return ra.set(t,wb),wb;var n=getComputedStyle(t),r=pp(t)&&t.ownerSVGElement&&t.getBBox(),o=!bF&&n.boxSizing==="border-box",i=yF.test(n.writingMode||""),s=!r&&bb.test(n.overflowY||""),a=!r&&bb.test(n.overflowX||""),l=r?0:Sn(n.paddingTop),c=r?0:Sn(n.paddingRight),u=r?0:Sn(n.paddingBottom),d=r?0:Sn(n.paddingLeft),f=r?0:Sn(n.borderTopWidth),p=r?0:Sn(n.borderRightWidth),h=r?0:Sn(n.borderBottomWidth),m=r?0:Sn(n.borderLeftWidth),y=d+c,g=l+u,x=m+p,k=f+h,w=a?t.offsetHeight-k-t.clientHeight:0,T=s?t.offsetWidth-x-t.clientWidth:0,D=o?y+x:0,M=o?g+k:0,F=r?r.width:Sn(n.width)-D-T,C=r?r.height:Sn(n.height)-M-w,U=F+y+T+x,ie=C+g+w+k,I=so({devicePixelContentBoxSize:Vo(Math.round(F*devicePixelRatio),Math.round(C*devicePixelRatio),i),borderBoxSize:Vo(U,ie,i),contentBoxSize:Vo(F,C,i),contentRect:new Wx(d,l,F,C)});return ra.set(t,I),I},Xx=function(t,e,n){var r=Kx(t,n),o=r.borderBoxSize,i=r.contentBoxSize,s=r.devicePixelContentBoxSize;switch(e){case gs.DEVICE_PIXEL_CONTENT_BOX:return s;case gs.BORDER_BOX:return o;default:return i}},wF=function(){function t(e){var n=Kx(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=so([n.borderBoxSize]),this.contentBoxSize=so([n.contentBoxSize]),this.devicePixelContentBoxSize=so([n.devicePixelContentBoxSize])}return t}(),Jx=function(t){if(Gx(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},vF=function(){var t=1/0,e=[];io.forEach(function(i){if(i.activeTargets.length!==0){var s=[];i.activeTargets.forEach(function(a){var l=new wF(a.target),c=Jx(a.target);s.push(l),a.lastReportedSize=Xx(a.target,a.observedBox),c<t&&(t=c)}),e.push(function(){i.callback.call(i.observer,s,i.observer)}),i.activeTargets.splice(0,i.activeTargets.length)}});for(var n=0,r=e;n<r.length;n++){var o=r[n];o()}return t},vb=function(t){io.forEach(function(e){e.activeTargets.splice(0,e.activeTargets.length),e.skippedTargets.splice(0,e.skippedTargets.length),e.observationTargets.forEach(function(n){n.isActive()&&(Jx(n.target)>t?e.activeTargets.push(n):e.skippedTargets.push(n))})})},xF=function(){var t=0;for(vb(t);fF();)t=vF(),vb(t);return pF()&&hF(),t>0},Cu,Yx=[],kF=function(){return Yx.splice(0).forEach(function(t){return t()})},SF=function(t){if(!Cu){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return kF()}).observe(n,r),Cu=function(){n.textContent="".concat(e?e--:e++)}}Yx.push(t),Cu()},CF=function(t){SF(function(){requestAnimationFrame(t)})},Ta=0,EF=function(){return!!Ta},AF=250,$F={attributes:!0,characterData:!0,childList:!0,subtree:!0},xb=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],kb=function(t){return t===void 0&&(t=0),Date.now()+t},Eu=!1,TF=function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=AF),!Eu){Eu=!0;var r=kb(e);CF(function(){var o=!1;try{o=xF()}finally{if(Eu=!1,e=r-kb(),!EF())return;o?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,$F)};document.body?n():Yi.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),xb.forEach(function(n){return Yi.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),xb.forEach(function(n){return Yi.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t}(),Kd=new TF,Sb=function(t){!Ta&&t>0&&Kd.start(),Ta+=t,!Ta&&Kd.stop()},OF=function(t){return!pp(t)&&!gF(t)&&getComputedStyle(t).display==="inline"},DF=function(){function t(e,n){this.target=e,this.observedBox=n||gs.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=Xx(this.target,this.observedBox,!0);return OF(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),MF=function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t}(),oa=new WeakMap,Cb=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},ia=function(){function t(){}return t.connect=function(e,n){var r=new MF(e,n);oa.set(e,r)},t.observe=function(e,n,r){var o=oa.get(e),i=o.observationTargets.length===0;Cb(o.observationTargets,n)<0&&(i&&io.push(o),o.observationTargets.push(new DF(n,r&&r.box)),Sb(1),Kd.schedule())},t.unobserve=function(e,n){var r=oa.get(e),o=Cb(r.observationTargets,n),i=r.observationTargets.length===1;o>=0&&(i&&io.splice(io.indexOf(r),1),r.observationTargets.splice(o,1),Sb(-1))},t.disconnect=function(e){var n=this,r=oa.get(e);r.observationTargets.slice().forEach(function(o){return n.unobserve(e,o.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t}(),_F=function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");ia.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!yb(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");ia.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!yb(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");ia.unobserve(this,e)},t.prototype.disconnect=function(){ia.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();class NF{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||_F)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(const n of e){const r=this.elHandlersMap.get(n.target);r!==void 0&&r(n)}}registerHandler(e,n){this.elHandlersMap.set(e,n),this.observer.observe(e)}unregisterHandler(e){this.elHandlersMap.has(e)&&(this.elHandlersMap.delete(e),this.observer.unobserve(e))}}const Eb=new NF,Ab=b.defineComponent({name:"ResizeObserver",props:{onResize:Function},setup(t){let e=!1;const n=b.getCurrentInstance().proxy;function r(o){const{onResize:i}=t;i!==void 0&&i(o)}b.onMounted(()=>{const o=n.$el;if(o===void 0){db("resize-observer","$el does not exist.");return}if(o.nextElementSibling!==o.nextSibling&&o.nodeType===3&&o.nodeValue!==""){db("resize-observer","$el can not be observed (it may be a text node).");return}o.nextElementSibling!==null&&(Eb.registerHandler(o.nextElementSibling,r),e=!0)}),b.onBeforeUnmount(()=>{e&&Eb.unregisterHandler(n.$el.nextElementSibling)})},render(){return b.renderSlot(this.$slots,"default")}});function Zx(t){return t instanceof HTMLElement}function Qx(t){for(let e=0;e<t.childNodes.length;e++){const n=t.childNodes[e];if(Zx(n)&&(tk(n)||Qx(n)))return!0}return!1}function ek(t){for(let e=t.childNodes.length-1;e>=0;e--){const n=t.childNodes[e];if(Zx(n)&&(tk(n)||ek(n)))return!0}return!1}function tk(t){if(!IF(t))return!1;try{t.focus({preventScroll:!0})}catch{}return document.activeElement===t}function IF(t){if(t.tabIndex>0||t.tabIndex===0&&t.getAttribute("tabIndex")!==null)return!0;if(t.getAttribute("disabled"))return!1;switch(t.nodeName){case"A":return!!t.href&&t.rel!=="ignore";case"INPUT":return t.type!=="hidden"&&t.type!=="file";case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}}let bi=[];const FF=b.defineComponent({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:String,finalFocusTo:String,returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(t){const e=$8(),n=b.ref(null),r=b.ref(null);let o=!1,i=!1;const s=typeof document>"u"?null:document.activeElement;function a(){return bi[bi.length-1]===e}function l(y){var g;y.code==="Escape"&&a()&&((g=t.onEsc)===null||g===void 0||g.call(t,y))}b.onMounted(()=>{b.watch(()=>t.active,y=>{y?(d(),mt("keydown",document,l)):(nt("keydown",document,l),o&&f())},{immediate:!0})}),b.onBeforeUnmount(()=>{nt("keydown",document,l),o&&f()});function c(y){if(!i&&a()){const g=u();if(g===null||g.contains(il(y)))return;p("first")}}function u(){const y=n.value;if(y===null)return null;let g=y;for(;g=g.nextSibling,!(g===null||g instanceof Element&&g.tagName==="DIV"););return g}function d(){var y;if(!t.disabled){if(bi.push(e),t.autoFocus){const{initialFocusTo:g}=t;g===void 0?p("first"):(y=fb(g))===null||y===void 0||y.focus({preventScroll:!0})}o=!0,document.addEventListener("focus",c,!0)}}function f(){var y;if(t.disabled||(document.removeEventListener("focus",c,!0),bi=bi.filter(x=>x!==e),a()))return;const{finalFocusTo:g}=t;g!==void 0?(y=fb(g))===null||y===void 0||y.focus({preventScroll:!0}):t.returnFocusOnDeactivated&&s instanceof HTMLElement&&(i=!0,s.focus({preventScroll:!0}),i=!1)}function p(y){if(a()&&t.active){const g=n.value,x=r.value;if(g!==null&&x!==null){const k=u();if(k==null||k===x){i=!0,g.focus({preventScroll:!0}),i=!1;return}i=!0;const w=y==="first"?Qx(k):ek(k);i=!1,w||(i=!0,g.focus({preventScroll:!0}),i=!1)}}}function h(y){if(i)return;const g=u();g!==null&&(y.relatedTarget!==null&&g.contains(y.relatedTarget)?p("last"):p("first"))}function m(y){i||(y.relatedTarget!==null&&y.relatedTarget===n.value?p("last"):p("first"))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:h,handleEndFocus:m}},render(){const{default:t}=this.$slots;if(t===void 0)return null;if(this.disabled)return t();const{active:e,focusableStyle:n}=this;return b.h(b.Fragment,null,[b.h("div",{"aria-hidden":"true",tabindex:e?"0":"-1",ref:"focusableStartRef",style:n,onFocus:this.handleStartFocus}),t(),b.h("div",{"aria-hidden":"true",style:n,ref:"focusableEndRef",tabindex:e?"0":"-1",onFocus:this.handleEndFocus})])}}),BF=/^(\d|\.)+$/,$b=/(\d|\.)+/;function Oa(t,{c:e=1,offset:n=0,attachPx:r=!0}={}){if(typeof t=="number"){const o=(t+n)*e;return o===0?"0":`${o}px`}else if(typeof t=="string")if(BF.test(t)){const o=(Number(t)+n)*e;return r?o===0?"0":`${o}px`:`${o}`}else{const o=$b.exec(t);return o?t.replace($b,String((Number(o[0])+n)*e)):t}return t}function Tb(t){const{left:e,right:n,top:r,bottom:o}=Ri(t);return`${r} ${e} ${o} ${n}`}let Au;function RF(){return Au===void 0&&(Au=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),Au}const Ob=new Set;function wi(t,e){const n=`[naive/${t}]: ${e}`;Ob.has(n)||(Ob.add(n),console.error(n))}function al(t,e){console.error(`[naive/${t}]: ${e}`)}function LF(t,e){throw new Error(`[naive/${t}]: ${e}`)}function Sr(t,...e){if(Array.isArray(t))t.forEach(n=>Sr(n,...e));else return t(...e)}function PF(t){return e=>{e?t.value=e.$el:t.value=null}}function Xd(t,e=!0,n=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(b.createTextVNode(String(r)));return}if(Array.isArray(r)){Xd(r,e,n);return}if(r.type===b.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Xd(r.children,e,n)}else{if(r.type===b.Comment&&e)return;n.push(r)}}}),n}function zF(t,e="default",n=void 0){const r=t[e];if(!r)return al("getFirstSlotVNode",`slot[${e}] is empty`),null;const o=Xd(r(n));return o.length===1?o[0]:(al("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function nk(t,e=[],n){const r={};return e.forEach(o=>{r[o]=t[o]}),Object.assign(r,n)}function ll(t,...e){return typeof t=="function"?t(...e):typeof t=="string"?b.createTextVNode(t):typeof t=="number"?b.createTextVNode(String(t)):null}function hp(t){return t.some(e=>b.isVNode(e)?!(e.type===b.Comment||e.type===b.Fragment&&!hp(e.children)):!0)?t:null}function $u(t,e){const n=t&&hp(t());return e(n||null)}function Db(t){return!(t&&hp(t()))}const Mb=b.defineComponent({render(){var t,e;return(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)}}),Nl="n-config-provider",jF="n";function di(t={},e={defaultBordered:!0}){const n=b.inject(Nl,null);return{inlineThemeDisabled:n?.inlineThemeDisabled,mergedRtlRef:n?.mergedRtlRef,mergedComponentPropsRef:n?.mergedComponentPropsRef,mergedBreakpointsRef:n?.mergedBreakpointsRef,mergedBorderedRef:b.computed(()=>{var r,o;const{bordered:i}=t;return i!==void 0?i:(o=(r=n?.mergedBorderedRef.value)!==null&&r!==void 0?r:e.defaultBordered)!==null&&o!==void 0?o:!0}),mergedClsPrefixRef:n?n.mergedClsPrefixRef:b.shallowRef(jF),namespaceRef:b.computed(()=>n?.mergedNamespaceRef.value)}}function Il(t,e,n,r){n||LF("useThemeClass","cssVarsRef is not passed");const o=b.inject(Nl,null),i=o?.mergedThemeHashRef,s=o?.styleMountTarget,a=b.ref(""),l=_l();let c;const u=`__${t}`,d=()=>{let f=u;const p=e?e.value:void 0,h=i?.value;h&&(f+=`-${h}`),p&&(f+=`-${p}`);const{themeOverrides:m,builtinThemeOverrides:y}=r;m&&(f+=`-${Ud(JSON.stringify(m))}`),y&&(f+=`-${Ud(JSON.stringify(y))}`),a.value=f,c=()=>{const g=n.value;let x="";for(const k in g)x+=`${k}: ${g[k]};`;ze(`.${f}`,x).mount({id:f,ssr:l,parent:s}),c=void 0}};return b.watchEffect(()=>{d()}),{themeClass:a,onRender:()=>{c?.()}}}var rk=typeof Vr=="object"&&Vr&&Vr.Object===Object&&Vr,qF=typeof self=="object"&&self&&self.Object===Object&&self,jn=rk||qF||Function("return this")(),Dr=jn.Symbol,ok=Object.prototype,VF=ok.hasOwnProperty,UF=ok.toString,vi=Dr?Dr.toStringTag:void 0;function HF(t){var e=VF.call(t,vi),n=t[vi];try{t[vi]=void 0;var r=!0}catch{}var o=UF.call(t);return r&&(e?t[vi]=n:delete t[vi]),o}var WF=Object.prototype,GF=WF.toString;function KF(t){return GF.call(t)}var XF="[object Null]",JF="[object Undefined]",_b=Dr?Dr.toStringTag:void 0;function go(t){return t==null?t===void 0?JF:XF:_b&&_b in Object(t)?HF(t):KF(t)}function Mr(t){return t!=null&&typeof t=="object"}var YF="[object Symbol]";function mp(t){return typeof t=="symbol"||Mr(t)&&go(t)==YF}function ik(t,e){for(var n=-1,r=t==null?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}var mn=Array.isArray,Nb=Dr?Dr.prototype:void 0,Ib=Nb?Nb.toString:void 0;function sk(t){if(typeof t=="string")return t;if(mn(t))return ik(t,sk)+"";if(mp(t))return Ib?Ib.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function Fr(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function gp(t){return t}var ZF="[object AsyncFunction]",QF="[object Function]",eB="[object GeneratorFunction]",tB="[object Proxy]";function yp(t){if(!Fr(t))return!1;var e=go(t);return e==QF||e==eB||e==ZF||e==tB}var Tu=jn["__core-js_shared__"],Fb=function(){var t=/[^.]+$/.exec(Tu&&Tu.keys&&Tu.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function nB(t){return!!Fb&&Fb in t}var rB=Function.prototype,oB=rB.toString;function yo(t){if(t!=null){try{return oB.call(t)}catch{}try{return t+""}catch{}}return""}var iB=/[\\^$.*+?()[\]{}|]/g,sB=/^\[object .+?Constructor\]$/,aB=Function.prototype,lB=Object.prototype,cB=aB.toString,uB=lB.hasOwnProperty,dB=RegExp("^"+cB.call(uB).replace(iB,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function fB(t){if(!Fr(t)||nB(t))return!1;var e=yp(t)?dB:sB;return e.test(yo(t))}function pB(t,e){return t?.[e]}function bo(t,e){var n=pB(t,e);return fB(n)?n:void 0}var Jd=bo(jn,"WeakMap"),Bb=Object.create,hB=function(){function t(){}return function(e){if(!Fr(e))return{};if(Bb)return Bb(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function mB(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function gB(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var yB=800,bB=16,wB=Date.now;function vB(t){var e=0,n=0;return function(){var r=wB(),o=bB-(r-n);if(n=r,o>0){if(++e>=yB)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function xB(t){return function(){return t}}var cl=function(){try{var t=bo(Object,"defineProperty");return t({},"",{}),t}catch{}}(),kB=cl?function(t,e){return cl(t,"toString",{configurable:!0,enumerable:!1,value:xB(e),writable:!0})}:gp,SB=vB(kB),CB=9007199254740991,EB=/^(?:0|[1-9]\d*)$/;function bp(t,e){var n=typeof t;return e=e??CB,!!e&&(n=="number"||n!="symbol"&&EB.test(t))&&t>-1&&t%1==0&&t<e}function wp(t,e,n){e=="__proto__"&&cl?cl(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Ns(t,e){return t===e||t!==t&&e!==e}var AB=Object.prototype,$B=AB.hasOwnProperty;function TB(t,e,n){var r=t[e];(!($B.call(t,e)&&Ns(r,n))||n===void 0&&!(e in t))&&wp(t,e,n)}function OB(t,e,n,r){var o=!n;n||(n={});for(var i=-1,s=e.length;++i<s;){var a=e[i],l=void 0;l===void 0&&(l=t[a]),o?wp(n,a,l):TB(n,a,l)}return n}var Rb=Math.max;function DB(t,e,n){return e=Rb(e===void 0?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=Rb(r.length-e,0),s=Array(i);++o<i;)s[o]=r[e+o];o=-1;for(var a=Array(e+1);++o<e;)a[o]=r[o];return a[e]=n(s),mB(t,this,a)}}function MB(t,e){return SB(DB(t,e,gp),t+"")}var _B=9007199254740991;function vp(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=_B}function fi(t){return t!=null&&vp(t.length)&&!yp(t)}function NB(t,e,n){if(!Fr(n))return!1;var r=typeof e;return(r=="number"?fi(n)&&bp(e,n.length):r=="string"&&e in n)?Ns(n[e],t):!1}function IB(t){return MB(function(e,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(i=t.length>3&&typeof i=="function"?(o--,i):void 0,s&&NB(n[0],n[1],s)&&(i=o<3?void 0:i,o=1),e=Object(e);++r<o;){var a=n[r];a&&t(e,a,r,i)}return e})}var FB=Object.prototype;function xp(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||FB;return t===n}function BB(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var RB="[object Arguments]";function Lb(t){return Mr(t)&&go(t)==RB}var ak=Object.prototype,LB=ak.hasOwnProperty,PB=ak.propertyIsEnumerable,ul=Lb(function(){return arguments}())?Lb:function(t){return Mr(t)&&LB.call(t,"callee")&&!PB.call(t,"callee")};function zB(){return!1}var lk=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Pb=lk&&typeof module=="object"&&module&&!module.nodeType&&module,jB=Pb&&Pb.exports===lk,zb=jB?jn.Buffer:void 0,qB=zb?zb.isBuffer:void 0,dl=qB||zB,VB="[object Arguments]",UB="[object Array]",HB="[object Boolean]",WB="[object Date]",GB="[object Error]",KB="[object Function]",XB="[object Map]",JB="[object Number]",YB="[object Object]",ZB="[object RegExp]",QB="[object Set]",eR="[object String]",tR="[object WeakMap]",nR="[object ArrayBuffer]",rR="[object DataView]",oR="[object Float32Array]",iR="[object Float64Array]",sR="[object Int8Array]",aR="[object Int16Array]",lR="[object Int32Array]",cR="[object Uint8Array]",uR="[object Uint8ClampedArray]",dR="[object Uint16Array]",fR="[object Uint32Array]",Ye={};Ye[oR]=Ye[iR]=Ye[sR]=Ye[aR]=Ye[lR]=Ye[cR]=Ye[uR]=Ye[dR]=Ye[fR]=!0;Ye[VB]=Ye[UB]=Ye[nR]=Ye[HB]=Ye[rR]=Ye[WB]=Ye[GB]=Ye[KB]=Ye[XB]=Ye[JB]=Ye[YB]=Ye[ZB]=Ye[QB]=Ye[eR]=Ye[tR]=!1;function pR(t){return Mr(t)&&vp(t.length)&&!!Ye[go(t)]}function hR(t){return function(e){return t(e)}}var ck=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Zi=ck&&typeof module=="object"&&module&&!module.nodeType&&module,mR=Zi&&Zi.exports===ck,Ou=mR&&rk.process,jb=function(){try{var t=Zi&&Zi.require&&Zi.require("util").types;return t||Ou&&Ou.binding&&Ou.binding("util")}catch{}}(),qb=jb&&jb.isTypedArray,kp=qb?hR(qb):pR,gR=Object.prototype,yR=gR.hasOwnProperty;function uk(t,e){var n=mn(t),r=!n&&ul(t),o=!n&&!r&&dl(t),i=!n&&!r&&!o&&kp(t),s=n||r||o||i,a=s?BB(t.length,String):[],l=a.length;for(var c in t)(e||yR.call(t,c))&&!(s&&(c=="length"||o&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||bp(c,l)))&&a.push(c);return a}function dk(t,e){return function(n){return t(e(n))}}var bR=dk(Object.keys,Object),wR=Object.prototype,vR=wR.hasOwnProperty;function xR(t){if(!xp(t))return bR(t);var e=[];for(var n in Object(t))vR.call(t,n)&&n!="constructor"&&e.push(n);return e}function Sp(t){return fi(t)?uk(t):xR(t)}function kR(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var SR=Object.prototype,CR=SR.hasOwnProperty;function ER(t){if(!Fr(t))return kR(t);var e=xp(t),n=[];for(var r in t)r=="constructor"&&(e||!CR.call(t,r))||n.push(r);return n}function fk(t){return fi(t)?uk(t,!0):ER(t)}var AR=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$R=/^\w*$/;function Cp(t,e){if(mn(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||mp(t)?!0:$R.test(t)||!AR.test(t)||e!=null&&t in Object(e)}var ys=bo(Object,"create");function TR(){this.__data__=ys?ys(null):{},this.size=0}function OR(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var DR="__lodash_hash_undefined__",MR=Object.prototype,_R=MR.hasOwnProperty;function NR(t){var e=this.__data__;if(ys){var n=e[t];return n===DR?void 0:n}return _R.call(e,t)?e[t]:void 0}var IR=Object.prototype,FR=IR.hasOwnProperty;function BR(t){var e=this.__data__;return ys?e[t]!==void 0:FR.call(e,t)}var RR="__lodash_hash_undefined__";function LR(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ys&&e===void 0?RR:e,this}function po(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}po.prototype.clear=TR;po.prototype.delete=OR;po.prototype.get=NR;po.prototype.has=BR;po.prototype.set=LR;function PR(){this.__data__=[],this.size=0}function Fl(t,e){for(var n=t.length;n--;)if(Ns(t[n][0],e))return n;return-1}var zR=Array.prototype,jR=zR.splice;function qR(t){var e=this.__data__,n=Fl(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():jR.call(e,n,1),--this.size,!0}function VR(t){var e=this.__data__,n=Fl(e,t);return n<0?void 0:e[n][1]}function UR(t){return Fl(this.__data__,t)>-1}function HR(t,e){var n=this.__data__,r=Fl(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function sr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}sr.prototype.clear=PR;sr.prototype.delete=qR;sr.prototype.get=VR;sr.prototype.has=UR;sr.prototype.set=HR;var bs=bo(jn,"Map");function WR(){this.size=0,this.__data__={hash:new po,map:new(bs||sr),string:new po}}function GR(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Bl(t,e){var n=t.__data__;return GR(e)?n[typeof e=="string"?"string":"hash"]:n.map}function KR(t){var e=Bl(this,t).delete(t);return this.size-=e?1:0,e}function XR(t){return Bl(this,t).get(t)}function JR(t){return Bl(this,t).has(t)}function YR(t,e){var n=Bl(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function ar(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}ar.prototype.clear=WR;ar.prototype.delete=KR;ar.prototype.get=XR;ar.prototype.has=JR;ar.prototype.set=YR;var ZR="Expected a function";function Ep(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(ZR);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=t.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(Ep.Cache||ar),n}Ep.Cache=ar;var QR=500;function eL(t){var e=Ep(t,function(r){return n.size===QR&&n.clear(),r}),n=e.cache;return e}var tL=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nL=/\\(\\)?/g,rL=eL(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(tL,function(n,r,o,i){e.push(o?i.replace(nL,"$1"):r||n)}),e});function oL(t){return t==null?"":sk(t)}function pk(t,e){return mn(t)?t:Cp(t,e)?[t]:rL(oL(t))}function Rl(t){if(typeof t=="string"||mp(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function hk(t,e){e=pk(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Rl(e[n++])];return n&&n==r?t:void 0}function iL(t,e,n){var r=t==null?void 0:hk(t,e);return r===void 0?n:r}function sL(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}var mk=dk(Object.getPrototypeOf,Object),aL="[object Object]",lL=Function.prototype,cL=Object.prototype,gk=lL.toString,uL=cL.hasOwnProperty,dL=gk.call(Object);function fL(t){if(!Mr(t)||go(t)!=aL)return!1;var e=mk(t);if(e===null)return!0;var n=uL.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&gk.call(n)==dL}function pL(){this.__data__=new sr,this.size=0}function hL(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function mL(t){return this.__data__.get(t)}function gL(t){return this.__data__.has(t)}var yL=200;function bL(t,e){var n=this.__data__;if(n instanceof sr){var r=n.__data__;if(!bs||r.length<yL-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new ar(r)}return n.set(t,e),this.size=n.size,this}function Nn(t){var e=this.__data__=new sr(t);this.size=e.size}Nn.prototype.clear=pL;Nn.prototype.delete=hL;Nn.prototype.get=mL;Nn.prototype.has=gL;Nn.prototype.set=bL;var yk=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Vb=yk&&typeof module=="object"&&module&&!module.nodeType&&module,wL=Vb&&Vb.exports===yk,Ub=wL?jn.Buffer:void 0;Ub&&Ub.allocUnsafe;function vL(t,e){return t.slice()}function xL(t,e){for(var n=-1,r=t==null?0:t.length,o=0,i=[];++n<r;){var s=t[n];e(s,n,t)&&(i[o++]=s)}return i}function kL(){return[]}var SL=Object.prototype,CL=SL.propertyIsEnumerable,Hb=Object.getOwnPropertySymbols,EL=Hb?function(t){return t==null?[]:(t=Object(t),xL(Hb(t),function(e){return CL.call(t,e)}))}:kL;function AL(t,e,n){var r=e(t);return mn(t)?r:sL(r,n(t))}function Wb(t){return AL(t,Sp,EL)}var Yd=bo(jn,"DataView"),Zd=bo(jn,"Promise"),Qd=bo(jn,"Set"),Gb="[object Map]",$L="[object Object]",Kb="[object Promise]",Xb="[object Set]",Jb="[object WeakMap]",Yb="[object DataView]",TL=yo(Yd),OL=yo(bs),DL=yo(Zd),ML=yo(Qd),_L=yo(Jd),yr=go;(Yd&&yr(new Yd(new ArrayBuffer(1)))!=Yb||bs&&yr(new bs)!=Gb||Zd&&yr(Zd.resolve())!=Kb||Qd&&yr(new Qd)!=Xb||Jd&&yr(new Jd)!=Jb)&&(yr=function(t){var e=go(t),n=e==$L?t.constructor:void 0,r=n?yo(n):"";if(r)switch(r){case TL:return Yb;case OL:return Gb;case DL:return Kb;case ML:return Xb;case _L:return Jb}return e});var fl=jn.Uint8Array;function NL(t){var e=new t.constructor(t.byteLength);return new fl(e).set(new fl(t)),e}function IL(t,e){var n=NL(t.buffer);return new t.constructor(n,t.byteOffset,t.length)}function FL(t){return typeof t.constructor=="function"&&!xp(t)?hB(mk(t)):{}}var BL="__lodash_hash_undefined__";function RL(t){return this.__data__.set(t,BL),this}function LL(t){return this.__data__.has(t)}function pl(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new ar;++e<n;)this.add(t[e])}pl.prototype.add=pl.prototype.push=RL;pl.prototype.has=LL;function PL(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function zL(t,e){return t.has(e)}var jL=1,qL=2;function bk(t,e,n,r,o,i){var s=n&jL,a=t.length,l=e.length;if(a!=l&&!(s&&l>a))return!1;var c=i.get(t),u=i.get(e);if(c&&u)return c==e&&u==t;var d=-1,f=!0,p=n&qL?new pl:void 0;for(i.set(t,e),i.set(e,t);++d<a;){var h=t[d],m=e[d];if(r)var y=s?r(m,h,d,e,t,i):r(h,m,d,t,e,i);if(y!==void 0){if(y)continue;f=!1;break}if(p){if(!PL(e,function(g,x){if(!zL(p,x)&&(h===g||o(h,g,n,r,i)))return p.push(x)})){f=!1;break}}else if(!(h===m||o(h,m,n,r,i))){f=!1;break}}return i.delete(t),i.delete(e),f}function VL(t){var e=-1,n=Array(t.size);return t.forEach(function(r,o){n[++e]=[o,r]}),n}function UL(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var HL=1,WL=2,GL="[object Boolean]",KL="[object Date]",XL="[object Error]",JL="[object Map]",YL="[object Number]",ZL="[object RegExp]",QL="[object Set]",eP="[object String]",tP="[object Symbol]",nP="[object ArrayBuffer]",rP="[object DataView]",Zb=Dr?Dr.prototype:void 0,Du=Zb?Zb.valueOf:void 0;function oP(t,e,n,r,o,i,s){switch(n){case rP:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case nP:return!(t.byteLength!=e.byteLength||!i(new fl(t),new fl(e)));case GL:case KL:case YL:return Ns(+t,+e);case XL:return t.name==e.name&&t.message==e.message;case ZL:case eP:return t==e+"";case JL:var a=VL;case QL:var l=r&HL;if(a||(a=UL),t.size!=e.size&&!l)return!1;var c=s.get(t);if(c)return c==e;r|=WL,s.set(t,e);var u=bk(a(t),a(e),r,o,i,s);return s.delete(t),u;case tP:if(Du)return Du.call(t)==Du.call(e)}return!1}var iP=1,sP=Object.prototype,aP=sP.hasOwnProperty;function lP(t,e,n,r,o,i){var s=n&iP,a=Wb(t),l=a.length,c=Wb(e),u=c.length;if(l!=u&&!s)return!1;for(var d=l;d--;){var f=a[d];if(!(s?f in e:aP.call(e,f)))return!1}var p=i.get(t),h=i.get(e);if(p&&h)return p==e&&h==t;var m=!0;i.set(t,e),i.set(e,t);for(var y=s;++d<l;){f=a[d];var g=t[f],x=e[f];if(r)var k=s?r(x,g,f,e,t,i):r(g,x,f,t,e,i);if(!(k===void 0?g===x||o(g,x,n,r,i):k)){m=!1;break}y||(y=f=="constructor")}if(m&&!y){var w=t.constructor,T=e.constructor;w!=T&&"constructor"in t&&"constructor"in e&&!(typeof w=="function"&&w instanceof w&&typeof T=="function"&&T instanceof T)&&(m=!1)}return i.delete(t),i.delete(e),m}var cP=1,Qb="[object Arguments]",e0="[object Array]",sa="[object Object]",uP=Object.prototype,t0=uP.hasOwnProperty;function dP(t,e,n,r,o,i){var s=mn(t),a=mn(e),l=s?e0:yr(t),c=a?e0:yr(e);l=l==Qb?sa:l,c=c==Qb?sa:c;var u=l==sa,d=c==sa,f=l==c;if(f&&dl(t)){if(!dl(e))return!1;s=!0,u=!1}if(f&&!u)return i||(i=new Nn),s||kp(t)?bk(t,e,n,r,o,i):oP(t,e,l,n,r,o,i);if(!(n&cP)){var p=u&&t0.call(t,"__wrapped__"),h=d&&t0.call(e,"__wrapped__");if(p||h){var m=p?t.value():t,y=h?e.value():e;return i||(i=new Nn),o(m,y,n,r,i)}}return f?(i||(i=new Nn),lP(t,e,n,r,o,i)):!1}function Ap(t,e,n,r,o){return t===e?!0:t==null||e==null||!Mr(t)&&!Mr(e)?t!==t&&e!==e:dP(t,e,n,r,Ap,o)}var fP=1,pP=2;function hP(t,e,n,r){var o=n.length,i=o;if(t==null)return!i;for(t=Object(t);o--;){var s=n[o];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<i;){s=n[o];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 Nn,d;if(!(d===void 0?Ap(c,l,fP|pP,r,u):d))return!1}}return!0}function wk(t){return t===t&&!Fr(t)}function mP(t){for(var e=Sp(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,wk(o)]}return e}function vk(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function gP(t){var e=mP(t);return e.length==1&&e[0][2]?vk(e[0][0],e[0][1]):function(n){return n===t||hP(n,t,e)}}function yP(t,e){return t!=null&&e in Object(t)}function bP(t,e,n){e=pk(e,t);for(var r=-1,o=e.length,i=!1;++r<o;){var s=Rl(e[r]);if(!(i=t!=null&&n(t,s)))break;t=t[s]}return i||++r!=o?i:(o=t==null?0:t.length,!!o&&vp(o)&&bp(s,o)&&(mn(t)||ul(t)))}function wP(t,e){return t!=null&&bP(t,e,yP)}var vP=1,xP=2;function kP(t,e){return Cp(t)&&wk(e)?vk(Rl(t),e):function(n){var r=iL(n,t);return r===void 0&&r===e?wP(n,t):Ap(e,r,vP|xP)}}function SP(t){return function(e){return e?.[t]}}function CP(t){return function(e){return hk(e,t)}}function EP(t){return Cp(t)?SP(Rl(t)):CP(t)}function AP(t){return typeof t=="function"?t:t==null?gp:typeof t=="object"?mn(t)?kP(t[0],t[1]):gP(t):EP(t)}function $P(t){return function(e,n,r){for(var o=-1,i=Object(e),s=r(e),a=s.length;a--;){var l=s[++o];if(n(i[l],l,i)===!1)break}return e}}var xk=$P();function TP(t,e){return t&&xk(t,e,Sp)}function OP(t,e){return function(n,r){if(n==null)return n;if(!fi(n))return t(n,r);for(var o=n.length,i=-1,s=Object(n);++i<o&&r(s[i],i,s)!==!1;);return n}}var DP=OP(TP);function ef(t,e,n){(n!==void 0&&!Ns(t[e],n)||n===void 0&&!(e in t))&&wp(t,e,n)}function MP(t){return Mr(t)&&fi(t)}function tf(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function _P(t){return OB(t,fk(t))}function NP(t,e,n,r,o,i,s){var a=tf(t,n),l=tf(e,n),c=s.get(l);if(c){ef(t,n,c);return}var u=i?i(a,l,n+"",t,e,s):void 0,d=u===void 0;if(d){var f=mn(l),p=!f&&dl(l),h=!f&&!p&&kp(l);u=l,f||p||h?mn(a)?u=a:MP(a)?u=gB(a):p?(d=!1,u=vL(l)):h?(d=!1,u=IL(l)):u=[]:fL(l)||ul(l)?(u=a,ul(a)?u=_P(a):(!Fr(a)||yp(a))&&(u=FL(l))):d=!1}d&&(s.set(l,u),o(u,l,r,i,s),s.delete(l)),ef(t,n,u)}function kk(t,e,n,r,o){t!==e&&xk(e,function(i,s){if(o||(o=new Nn),Fr(i))NP(t,e,s,n,kk,r,o);else{var a=r?r(tf(t,s),i,s+"",t,e,o):void 0;a===void 0&&(a=i),ef(t,s,a)}},fk)}function IP(t,e){var n=-1,r=fi(t)?Array(t.length):[];return DP(t,function(o,i,s){r[++n]=e(o,i,s)}),r}function FP(t,e){var n=mn(t)?ik:IP;return n(t,AP(e))}var aa=IB(function(t,e,n){kk(t,e,n)});const nf="naive-ui-style";function BP(t,e,n){if(!e)return;const r=_l(),o=b.computed(()=>{const{value:a}=e;if(!a)return;const l=a[t];if(l)return l}),i=b.inject(Nl,null),s=()=>{b.watchEffect(()=>{const{value:a}=n,l=`${a}${t}Rtl`;if(s8(l,r))return;const{value:c}=o;c&&c.style.mount({id:l,head:!0,anchorMetaName:nf,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:i?.styleMountTarget})})};return r?s():b.onBeforeMount(s),o}const Ll={fontFamily:'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontFamilyMono:"v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",fontWeight:"400",fontWeightStrong:"500",cubicBezierEaseInOut:"cubic-bezier(.4, 0, .2, 1)",cubicBezierEaseOut:"cubic-bezier(0, 0, .2, 1)",cubicBezierEaseIn:"cubic-bezier(.4, 0, 1, 1)",borderRadius:"3px",borderRadiusSmall:"2px",fontSize:"14px",fontSizeMini:"12px",fontSizeTiny:"12px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",lineHeight:"1.6",heightMini:"16px",heightTiny:"22px",heightSmall:"28px",heightMedium:"34px",heightLarge:"40px",heightHuge:"46px"},{fontSize:RP,fontFamily:LP,lineHeight:PP}=Ll,zP=ze("body",`
81
- margin: 0;
82
- font-size: ${RP};
83
- font-family: ${LP};
84
- line-height: ${PP};
85
- -webkit-text-size-adjust: 100%;
86
- -webkit-tap-highlight-color: transparent;
87
- `,[ze("input",`
88
- font-family: inherit;
89
- font-size: inherit;
90
- `)]);function Yt(t,e,n,r,o,i){const s=_l(),a=b.inject(Nl,null);if(n){const l=()=>{const c=i?.value;n.mount({id:c===void 0?e:c+e,head:!0,props:{bPrefix:c?`.${c}-`:void 0},anchorMetaName:nf,ssr:s,parent:a?.styleMountTarget}),a?.preflightStyleDisabled||zP.mount({id:"n-global",head:!0,anchorMetaName:nf,ssr:s,parent:a?.styleMountTarget})};s?l():b.onBeforeMount(l)}return b.computed(()=>{var l;const{theme:{common:c,self:u,peers:d={}}={},themeOverrides:f={},builtinThemeOverrides:p={}}=o,{common:h,peers:m}=f,{common:y=void 0,[t]:{common:g=void 0,self:x=void 0,peers:k={}}={}}=a?.mergedThemeRef.value||{},{common:w=void 0,[t]:T={}}=a?.mergedThemeOverridesRef.value||{},{common:D,peers:M={}}=T,F=aa({},c||g||y||r.common,w,D,h),C=aa((l=u||x||r.self)===null||l===void 0?void 0:l(F),p,T,f);return{common:F,self:C,peers:aa({},r.peers,k,d),peerOverrides:aa({},p.peers,M,m)}})}Yt.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const jP=b.defineComponent({name:"ChevronRight",render(){return b.h("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b.h("path",{d:"M5.64645 3.14645C5.45118 3.34171 5.45118 3.65829 5.64645 3.85355L9.79289 8L5.64645 12.1464C5.45118 12.3417 5.45118 12.6583 5.64645 12.8536C5.84171 13.0488 6.15829 13.0488 6.35355 12.8536L10.8536 8.35355C11.0488 8.15829 11.0488 7.84171 10.8536 7.64645L6.35355 3.14645C6.15829 2.95118 5.84171 2.95118 5.64645 3.14645Z",fill:"currentColor"}))}}),{cubicBezierEaseInOut:n0}=Ll;function qP({name:t="fade-in",enterDuration:e="0.2s",leaveDuration:n="0.2s",enterCubicBezier:r=n0,leaveCubicBezier:o=n0}={}){return[ze(`&.${t}-transition-enter-active`,{transition:`all ${e} ${r}!important`}),ze(`&.${t}-transition-leave-active`,{transition:`all ${n} ${o}!important`}),ze(`&.${t}-transition-enter-from, &.${t}-transition-leave-to`,{opacity:0}),ze(`&.${t}-transition-leave-from, &.${t}-transition-enter-to`,{opacity:1})]}const Te={neutralBase:"#FFF",neutralInvertBase:"#000",neutralTextBase:"#000",neutralPopover:"#fff",neutralCard:"#fff",neutralModal:"#fff",neutralBody:"#fff",alpha1:"0.82",alpha2:"0.72",alpha3:"0.38",alpha4:"0.24",alpha5:"0.18",alphaClose:"0.6",alphaDisabled:"0.5",alphaAvatar:"0.2",alphaProgressRail:".08",alphaInput:"0",alphaScrollbar:"0.25",alphaScrollbarHover:"0.4",primaryHover:"#36ad6a",primaryDefault:"#18a058",primaryActive:"#0c7a43",primarySuppl:"#36ad6a",infoHover:"#4098fc",infoDefault:"#2080f0",infoActive:"#1060c9",infoSuppl:"#4098fc",errorHover:"#de576d",errorDefault:"#d03050",errorActive:"#ab1f3f",errorSuppl:"#de576d",warningHover:"#fcb040",warningDefault:"#f0a020",warningActive:"#c97c10",warningSuppl:"#fcb040",successHover:"#36ad6a",successDefault:"#18a058",successActive:"#0c7a43",successSuppl:"#36ad6a"},VP=fo(Te.neutralBase),Sk=fo(Te.neutralInvertBase),UP=`rgba(${Sk.slice(0,3).join(", ")}, `;function r0(t){return`${UP+String(t)})`}function Tt(t){const e=Array.from(Sk);return e[3]=Number(t),Fx(VP,e)}const pi=Object.assign(Object.assign({name:"common"},Ll),{baseColor:Te.neutralBase,primaryColor:Te.primaryDefault,primaryColorHover:Te.primaryHover,primaryColorPressed:Te.primaryActive,primaryColorSuppl:Te.primarySuppl,infoColor:Te.infoDefault,infoColorHover:Te.infoHover,infoColorPressed:Te.infoActive,infoColorSuppl:Te.infoSuppl,successColor:Te.successDefault,successColorHover:Te.successHover,successColorPressed:Te.successActive,successColorSuppl:Te.successSuppl,warningColor:Te.warningDefault,warningColorHover:Te.warningHover,warningColorPressed:Te.warningActive,warningColorSuppl:Te.warningSuppl,errorColor:Te.errorDefault,errorColorHover:Te.errorHover,errorColorPressed:Te.errorActive,errorColorSuppl:Te.errorSuppl,textColorBase:Te.neutralTextBase,textColor1:"rgb(31, 34, 37)",textColor2:"rgb(51, 54, 57)",textColor3:"rgb(118, 124, 130)",textColorDisabled:Tt(Te.alpha4),placeholderColor:Tt(Te.alpha4),placeholderColorDisabled:Tt(Te.alpha5),iconColor:Tt(Te.alpha4),iconColorHover:ea(Tt(Te.alpha4),{lightness:.75}),iconColorPressed:ea(Tt(Te.alpha4),{lightness:.9}),iconColorDisabled:Tt(Te.alpha5),opacity1:Te.alpha1,opacity2:Te.alpha2,opacity3:Te.alpha3,opacity4:Te.alpha4,opacity5:Te.alpha5,dividerColor:"rgb(239, 239, 245)",borderColor:"rgb(224, 224, 230)",closeIconColor:Tt(Number(Te.alphaClose)),closeIconColorHover:Tt(Number(Te.alphaClose)),closeIconColorPressed:Tt(Number(Te.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:Tt(Te.alpha4),clearColorHover:ea(Tt(Te.alpha4),{lightness:.75}),clearColorPressed:ea(Tt(Te.alpha4),{lightness:.9}),scrollbarColor:r0(Te.alphaScrollbar),scrollbarColorHover:r0(Te.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:Tt(Te.alphaProgressRail),railColor:"rgb(219, 219, 223)",popoverColor:Te.neutralPopover,tableColor:Te.neutralCard,cardColor:Te.neutralCard,modalColor:Te.neutralModal,bodyColor:Te.neutralBody,tagColor:"#eee",avatarColor:Tt(Te.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:Tt(Te.alphaInput),codeColor:"rgb(244, 244, 248)",tabColor:"rgb(247, 247, 250)",actionColor:"rgb(250, 250, 252)",tableHeaderColor:"rgb(250, 250, 252)",hoverColor:"rgb(243, 243, 245)",tableColorHover:"rgba(0, 0, 100, 0.03)",tableColorStriped:"rgba(0, 0, 100, 0.02)",pressedColor:"rgb(237, 237, 239)",opacityDisabled:Te.alphaDisabled,inputColorDisabled:"rgb(250, 250, 252)",buttonColor2:"rgba(46, 51, 56, .05)",buttonColor2Hover:"rgba(46, 51, 56, .09)",buttonColor2Pressed:"rgba(46, 51, 56, .13)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .08), 0 3px 6px 0 rgba(0, 0, 0, .06), 0 5px 12px 4px rgba(0, 0, 0, .04)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"}),HP={railInsetHorizontalBottom:"auto 2px 4px 2px",railInsetHorizontalTop:"4px 2px auto 2px",railInsetVerticalRight:"2px 4px 2px auto",railInsetVerticalLeft:"2px auto 2px 4px",railColor:"transparent"};function WP(t){const{scrollbarColor:e,scrollbarColorHover:n,scrollbarHeight:r,scrollbarWidth:o,scrollbarBorderRadius:i}=t;return Object.assign(Object.assign({},HP),{height:r,width:o,borderRadius:i,color:e,colorHover:n})}const GP={common:pi,self:WP},KP=Xe("scrollbar",`
91
- overflow: hidden;
92
- position: relative;
93
- z-index: auto;
94
- height: 100%;
95
- width: 100%;
96
- `,[ze(">",[Xe("scrollbar-container",`
97
- width: 100%;
98
- overflow: scroll;
99
- height: 100%;
100
- min-height: inherit;
101
- max-height: inherit;
102
- scrollbar-width: none;
103
- `,[ze("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",`
104
- width: 0;
105
- height: 0;
106
- display: none;
107
- `),ze(">",[Xe("scrollbar-content",`
108
- box-sizing: border-box;
109
- min-width: 100%;
110
- `)])])]),ze(">, +",[Xe("scrollbar-rail",`
111
- position: absolute;
112
- pointer-events: none;
113
- user-select: none;
114
- background: var(--n-scrollbar-rail-color);
115
- -webkit-user-select: none;
116
- `,[it("horizontal",`
117
- height: var(--n-scrollbar-height);
118
- `,[ze(">",[Pt("scrollbar",`
119
- height: var(--n-scrollbar-height);
120
- border-radius: var(--n-scrollbar-border-radius);
121
- right: 0;
122
- `)])]),it("horizontal--top",`
123
- top: var(--n-scrollbar-rail-top-horizontal-top);
124
- right: var(--n-scrollbar-rail-right-horizontal-top);
125
- bottom: var(--n-scrollbar-rail-bottom-horizontal-top);
126
- left: var(--n-scrollbar-rail-left-horizontal-top);
127
- `),it("horizontal--bottom",`
128
- top: var(--n-scrollbar-rail-top-horizontal-bottom);
129
- right: var(--n-scrollbar-rail-right-horizontal-bottom);
130
- bottom: var(--n-scrollbar-rail-bottom-horizontal-bottom);
131
- left: var(--n-scrollbar-rail-left-horizontal-bottom);
132
- `),it("vertical",`
133
- width: var(--n-scrollbar-width);
134
- `,[ze(">",[Pt("scrollbar",`
135
- width: var(--n-scrollbar-width);
136
- border-radius: var(--n-scrollbar-border-radius);
137
- bottom: 0;
138
- `)])]),it("vertical--left",`
139
- top: var(--n-scrollbar-rail-top-vertical-left);
140
- right: var(--n-scrollbar-rail-right-vertical-left);
141
- bottom: var(--n-scrollbar-rail-bottom-vertical-left);
142
- left: var(--n-scrollbar-rail-left-vertical-left);
143
- `),it("vertical--right",`
144
- top: var(--n-scrollbar-rail-top-vertical-right);
145
- right: var(--n-scrollbar-rail-right-vertical-right);
146
- bottom: var(--n-scrollbar-rail-bottom-vertical-right);
147
- left: var(--n-scrollbar-rail-left-vertical-right);
148
- `),it("disabled",[ze(">",[Pt("scrollbar","pointer-events: none;")])]),ze(">",[Pt("scrollbar",`
149
- z-index: 1;
150
- position: absolute;
151
- cursor: pointer;
152
- pointer-events: all;
153
- background-color: var(--n-scrollbar-color);
154
- transition: background-color .2s var(--n-scrollbar-bezier);
155
- `,[qP(),ze("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),XP=Object.assign(Object.assign({},Yt.props),{duration:{type:Number,default:0},scrollable:{type:Boolean,default:!0},xScrollable:Boolean,trigger:{type:String,default:"hover"},useUnifiedContainer:Boolean,triggerDisplayManually:Boolean,container:Function,content:Function,containerClass:String,containerStyle:[String,Object],contentClass:[String,Array],contentStyle:[String,Object],horizontalRailStyle:[String,Object],verticalRailStyle:[String,Object],onScroll:Function,onWheel:Function,onResize:Function,internalOnUpdateScrollLeft:Function,internalHoistYRail:Boolean,yPlacement:{type:String,default:"right"},xPlacement:{type:String,default:"bottom"}}),JP=b.defineComponent({name:"Scrollbar",props:XP,inheritAttrs:!1,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedRtlRef:r}=di(t),o=BP("Scrollbar",r,e),i=b.ref(null),s=b.ref(null),a=b.ref(null),l=b.ref(null),c=b.ref(null),u=b.ref(null),d=b.ref(null),f=b.ref(null),p=b.ref(null),h=b.ref(null),m=b.ref(null),y=b.ref(0),g=b.ref(0),x=b.ref(!1),k=b.ref(!1);let w=!1,T=!1,D,M,F=0,C=0,U=0,ie=0;const I=j8(),W=Yt("Scrollbar","-scrollbar",KP,GP,t,e),A=b.computed(()=>{const{value:V}=f,{value:ne}=u,{value:ye}=h;return V===null||ne===null||ye===null?0:Math.min(V,ye*V/ne+ib(W.value.self.width)*1.5)}),G=b.computed(()=>`${A.value}px`),ae=b.computed(()=>{const{value:V}=p,{value:ne}=d,{value:ye}=m;return V===null||ne===null||ye===null?0:ye*V/ne+ib(W.value.self.height)*1.5}),X=b.computed(()=>`${ae.value}px`),de=b.computed(()=>{const{value:V}=f,{value:ne}=y,{value:ye}=u,{value:xe}=h;if(V===null||ye===null||xe===null)return 0;{const ke=ye-V;return ke?ne/ke*(xe-A.value):0}}),J=b.computed(()=>`${de.value}px`),pe=b.computed(()=>{const{value:V}=p,{value:ne}=g,{value:ye}=d,{value:xe}=m;if(V===null||ye===null||xe===null)return 0;{const ke=ye-V;return ke?ne/ke*(xe-ae.value):0}}),Q=b.computed(()=>`${pe.value}px`),B=b.computed(()=>{const{value:V}=f,{value:ne}=u;return V!==null&&ne!==null&&ne>V}),ee=b.computed(()=>{const{value:V}=p,{value:ne}=d;return V!==null&&ne!==null&&ne>V}),Z=b.computed(()=>{const{trigger:V}=t;return V==="none"||x.value}),re=b.computed(()=>{const{trigger:V}=t;return V==="none"||k.value}),K=b.computed(()=>{const{container:V}=t;return V?V():s.value}),$=b.computed(()=>{const{content:V}=t;return V?V():a.value}),E=(V,ne)=>{if(!t.scrollable)return;if(typeof V=="number"){le(V,ne??0,0,!1,"auto");return}const{left:ye,top:xe,index:ke,elSize:Ae,position:Oe,behavior:We,el:ot,debounce:xn=!0}=V;(ye!==void 0||xe!==void 0)&&le(ye??0,xe??0,0,!1,We),ot!==void 0?le(0,ot.offsetTop,ot.offsetHeight,xn,We):ke!==void 0&&Ae!==void 0?le(0,ke*Ae,Ae,xn,We):Oe==="bottom"?le(0,Number.MAX_SAFE_INTEGER,0,!1,We):Oe==="top"&&le(0,0,0,!1,We)},H=G8(()=>{t.container||E({top:y.value,left:g.value})}),q=()=>{H.isDeactivated||ue()},N=V=>{if(H.isDeactivated)return;const{onResize:ne}=t;ne&&ne(V),ue()},R=(V,ne)=>{if(!t.scrollable)return;const{value:ye}=K;ye&&(typeof V=="object"?ye.scrollBy(V):ye.scrollBy(V,ne||0))};function le(V,ne,ye,xe,ke){const{value:Ae}=K;if(Ae){if(xe){const{scrollTop:Oe,offsetHeight:We}=Ae;if(ne>Oe){ne+ye<=Oe+We||Ae.scrollTo({left:V,top:ne+ye-We,behavior:ke});return}}Ae.scrollTo({left:V,top:ne,behavior:ke})}}function S(){P(),fe(),ue()}function oe(){te()}function te(){L(),z()}function L(){M!==void 0&&window.clearTimeout(M),M=window.setTimeout(()=>{k.value=!1},t.duration)}function z(){D!==void 0&&window.clearTimeout(D),D=window.setTimeout(()=>{x.value=!1},t.duration)}function P(){D!==void 0&&window.clearTimeout(D),x.value=!0}function fe(){M!==void 0&&window.clearTimeout(M),k.value=!0}function me(V){const{onScroll:ne}=t;ne&&ne(V),se()}function se(){const{value:V}=K;V&&(y.value=V.scrollTop,g.value=V.scrollLeft*(o?.value?-1:1))}function ge(){const{value:V}=$;V&&(u.value=V.offsetHeight,d.value=V.offsetWidth);const{value:ne}=K;ne&&(f.value=ne.offsetHeight,p.value=ne.offsetWidth);const{value:ye}=c,{value:xe}=l;ye&&(m.value=ye.offsetWidth),xe&&(h.value=xe.offsetHeight)}function ce(){const{value:V}=K;V&&(y.value=V.scrollTop,g.value=V.scrollLeft*(o?.value?-1:1),f.value=V.offsetHeight,p.value=V.offsetWidth,u.value=V.scrollHeight,d.value=V.scrollWidth);const{value:ne}=c,{value:ye}=l;ne&&(m.value=ne.offsetWidth),ye&&(h.value=ye.offsetHeight)}function ue(){t.scrollable&&(t.useUnifiedContainer?ce():(ge(),se()))}function we(V){var ne;return!(!((ne=i.value)===null||ne===void 0)&&ne.contains(il(V)))}function _e(V){V.preventDefault(),V.stopPropagation(),T=!0,mt("mousemove",window,Ce,!0),mt("mouseup",window,dt,!0),C=g.value,U=o?.value?window.innerWidth-V.clientX:V.clientX}function Ce(V){if(!T)return;D!==void 0&&window.clearTimeout(D),M!==void 0&&window.clearTimeout(M);const{value:ne}=p,{value:ye}=d,{value:xe}=ae;if(ne===null||ye===null)return;const ke=(o?.value?window.innerWidth-V.clientX-U:V.clientX-U)*(ye-ne)/(ne-xe),Ae=ye-ne;let Oe=C+ke;Oe=Math.min(Ae,Oe),Oe=Math.max(Oe,0);const{value:We}=K;if(We){We.scrollLeft=Oe*(o?.value?-1:1);const{internalOnUpdateScrollLeft:ot}=t;ot&&ot(Oe)}}function dt(V){V.preventDefault(),V.stopPropagation(),nt("mousemove",window,Ce,!0),nt("mouseup",window,dt,!0),T=!1,ue(),we(V)&&te()}function v(V){V.preventDefault(),V.stopPropagation(),w=!0,mt("mousemove",window,O,!0),mt("mouseup",window,_,!0),F=y.value,ie=V.clientY}function O(V){if(!w)return;D!==void 0&&window.clearTimeout(D),M!==void 0&&window.clearTimeout(M);const{value:ne}=f,{value:ye}=u,{value:xe}=A;if(ne===null||ye===null)return;const ke=(V.clientY-ie)*(ye-ne)/(ne-xe),Ae=ye-ne;let Oe=F+ke;Oe=Math.min(Ae,Oe),Oe=Math.max(Oe,0);const{value:We}=K;We&&(We.scrollTop=Oe)}function _(V){V.preventDefault(),V.stopPropagation(),nt("mousemove",window,O,!0),nt("mouseup",window,_,!0),w=!1,ue(),we(V)&&te()}b.watchEffect(()=>{const{value:V}=ee,{value:ne}=B,{value:ye}=e,{value:xe}=c,{value:ke}=l;xe&&(V?xe.classList.remove(`${ye}-scrollbar-rail--disabled`):xe.classList.add(`${ye}-scrollbar-rail--disabled`)),ke&&(ne?ke.classList.remove(`${ye}-scrollbar-rail--disabled`):ke.classList.add(`${ye}-scrollbar-rail--disabled`))}),b.onMounted(()=>{t.container||ue()}),b.onBeforeUnmount(()=>{D!==void 0&&window.clearTimeout(D),M!==void 0&&window.clearTimeout(M),nt("mousemove",window,O,!0),nt("mouseup",window,_,!0)});const Y=b.computed(()=>{const{common:{cubicBezierEaseInOut:V},self:{color:ne,colorHover:ye,height:xe,width:ke,borderRadius:Ae,railInsetHorizontalTop:Oe,railInsetHorizontalBottom:We,railInsetVerticalRight:ot,railInsetVerticalLeft:xn,railColor:lr}}=W.value,{top:jl,right:hi,bottom:wo,left:Uk}=Ri(Oe),{top:Hk,right:Wk,bottom:Gk,left:Kk}=Ri(We),{top:Xk,right:Jk,bottom:Yk,left:Zk}=Ri(o?.value?Tb(ot):ot),{top:Qk,right:eS,bottom:tS,left:nS}=Ri(o?.value?Tb(xn):xn);return{"--n-scrollbar-bezier":V,"--n-scrollbar-color":ne,"--n-scrollbar-color-hover":ye,"--n-scrollbar-border-radius":Ae,"--n-scrollbar-width":ke,"--n-scrollbar-height":xe,"--n-scrollbar-rail-top-horizontal-top":jl,"--n-scrollbar-rail-right-horizontal-top":hi,"--n-scrollbar-rail-bottom-horizontal-top":wo,"--n-scrollbar-rail-left-horizontal-top":Uk,"--n-scrollbar-rail-top-horizontal-bottom":Hk,"--n-scrollbar-rail-right-horizontal-bottom":Wk,"--n-scrollbar-rail-bottom-horizontal-bottom":Gk,"--n-scrollbar-rail-left-horizontal-bottom":Kk,"--n-scrollbar-rail-top-vertical-right":Xk,"--n-scrollbar-rail-right-vertical-right":Jk,"--n-scrollbar-rail-bottom-vertical-right":Yk,"--n-scrollbar-rail-left-vertical-right":Zk,"--n-scrollbar-rail-top-vertical-left":Qk,"--n-scrollbar-rail-right-vertical-left":eS,"--n-scrollbar-rail-bottom-vertical-left":tS,"--n-scrollbar-rail-left-vertical-left":nS,"--n-scrollbar-rail-color":lr}}),j=n?Il("scrollbar",void 0,Y,t):void 0;return Object.assign(Object.assign({},{scrollTo:E,scrollBy:R,sync:ue,syncUnifiedContainer:ce,handleMouseEnterWrapper:S,handleMouseLeaveWrapper:oe}),{mergedClsPrefix:e,rtlEnabled:o,containerScrollTop:y,wrapperRef:i,containerRef:s,contentRef:a,yRailRef:l,xRailRef:c,needYBar:B,needXBar:ee,yBarSizePx:G,xBarSizePx:X,yBarTopPx:J,xBarLeftPx:Q,isShowXBar:Z,isShowYBar:re,isIos:I,handleScroll:me,handleContentResize:q,handleContainerResize:N,handleYScrollMouseDown:v,handleXScrollMouseDown:_e,cssVars:n?void 0:Y,themeClass:j?.themeClass,onRender:j?.onRender})},render(){var t;const{$slots:e,mergedClsPrefix:n,triggerDisplayManually:r,rtlEnabled:o,internalHoistYRail:i,yPlacement:s,xPlacement:a,xScrollable:l}=this;if(!this.scrollable)return(t=e.default)===null||t===void 0?void 0:t.call(e);const c=this.trigger==="none",u=(p,h)=>b.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${s}`,p],"data-scrollbar-rail":!0,style:[h||"",this.verticalRailStyle],"aria-hidden":!0},b.h(c?Mb:b.Transition,c?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?b.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),d=()=>{var p,h;return(p=this.onRender)===null||p===void 0||p.call(this),b.h("div",b.mergeProps(this.$attrs,{role:"none",ref:"wrapperRef",class:[`${n}-scrollbar`,this.themeClass,o&&`${n}-scrollbar--rtl`],style:this.cssVars,onMouseenter:r?void 0:this.handleMouseEnterWrapper,onMouseleave:r?void 0:this.handleMouseLeaveWrapper}),[this.container?(h=e.default)===null||h===void 0?void 0:h.call(e):b.h("div",{role:"none",ref:"containerRef",class:[`${n}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},b.h(Ab,{onResize:this.handleContentResize},{default:()=>b.h("div",{ref:"contentRef",role:"none",style:[{width:this.xScrollable?"fit-content":null},this.contentStyle],class:[`${n}-scrollbar-content`,this.contentClass]},e)})),i?null:u(void 0,void 0),l&&b.h("div",{ref:"xRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--horizontal`,`${n}-scrollbar-rail--horizontal--${a}`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},b.h(c?Mb:b.Transition,c?null:{name:"fade-in-transition"},{default:()=>this.needXBar&&this.isShowXBar&&!this.isIos?b.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{width:this.xBarSizePx,right:o?this.xBarLeftPx:void 0,left:o?void 0:this.xBarLeftPx},onMousedown:this.handleXScrollMouseDown}):null}))])},f=this.container?d():b.h(Ab,{onResize:this.handleContainerResize},{default:d});return i?b.h(b.Fragment,null,f,u(this.themeClass,this.cssVars)):f}}),Ck=JP;function o0(t){return Array.isArray(t)?t:[t]}const rf={STOP:"STOP"};function Ek(t,e){const n=e(t);t.children!==void 0&&n!==rf.STOP&&t.children.forEach(r=>Ek(r,e))}function YP(t,e={}){const{preserveGroup:n=!1}=e,r=[],o=n?s=>{s.isLeaf||(r.push(s.key),i(s.children))}:s=>{s.isLeaf||(s.isGroup||r.push(s.key),i(s.children))};function i(s){s.forEach(o)}return i(t),r}function ZP(t,e){const{isLeaf:n}=t;return n!==void 0?n:!e(t)}function QP(t){return t.children}function ez(t){return t.key}function tz(){return!1}function nz(t,e){const{isLeaf:n}=t;return!(n===!1&&!Array.isArray(e(t)))}function rz(t){return t.disabled===!0}function oz(t,e){return t.isLeaf===!1&&!Array.isArray(e(t))}function iz(t,e){if(t.isLeaf===!0){const n=e(t);if(Array.isArray(n)&&n.length>0)return!0}return!1}function Mu(t){var e;return t==null?[]:Array.isArray(t)?t:(e=t.checkedKeys)!==null&&e!==void 0?e:[]}function _u(t){var e;return t==null||Array.isArray(t)?[]:(e=t.indeterminateKeys)!==null&&e!==void 0?e:[]}function sz(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function az(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function lz(t){return t?.type==="group"}class cz extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function uz(t,e,n,r){return hl(e.concat(t),n,r,!1)}function dz(t,e){const n=new Set;return t.forEach(r=>{const o=e.treeNodeMap.get(r);if(o!==void 0){let i=o.parent;for(;i!==null&&!(i.disabled||n.has(i.key));)n.add(i.key),i=i.parent}}),n}function fz(t,e,n,r){const o=hl(e,n,r,!1),i=hl(t,n,r,!0),s=dz(t,n),a=[];return o.forEach(l=>{(i.has(l)||s.has(l))&&a.push(l)}),a.forEach(l=>o.delete(l)),o}function Nu(t,e){const{checkedKeys:n,keysToCheck:r,keysToUncheck:o,indeterminateKeys:i,cascade:s,leafOnly:a,checkStrategy:l,allowNotLoaded:c}=t;if(!s)return r!==void 0?{checkedKeys:sz(n,r),indeterminateKeys:Array.from(i)}:o!==void 0?{checkedKeys:az(n,o),indeterminateKeys:Array.from(i)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(i)};const{levelTreeNodeMap:u}=e;let d;o!==void 0?d=fz(o,n,e,c):r!==void 0?d=uz(r,n,e,c):d=hl(n,e,c,!1);const f=l==="parent",p=l==="child"||a,h=d,m=new Set,y=Math.max.apply(null,Array.from(u.keys()));for(let g=y;g>=0;g-=1){const x=g===0,k=u.get(g);for(const w of k){if(w.isLeaf)continue;const{key:T,shallowLoaded:D}=w;if(p&&D&&w.children.forEach(U=>{!U.disabled&&!U.isLeaf&&U.shallowLoaded&&h.has(U.key)&&h.delete(U.key)}),w.disabled||!D)continue;let M=!0,F=!1,C=!0;for(const U of w.children){const ie=U.key;if(!U.disabled){if(C&&(C=!1),h.has(ie))F=!0;else if(m.has(ie)){F=!0,M=!1;break}else if(M=!1,F)break}}M&&!C?(f&&w.children.forEach(U=>{!U.disabled&&h.has(U.key)&&h.delete(U.key)}),h.add(T)):F&&m.add(T),x&&p&&h.has(T)&&h.delete(T)}}return{checkedKeys:Array.from(h),indeterminateKeys:Array.from(m)}}function hl(t,e,n,r){const{treeNodeMap:o,getChildren:i}=e,s=new Set,a=new Set(t);return t.forEach(l=>{const c=o.get(l);c!==void 0&&Ek(c,u=>{if(u.disabled)return rf.STOP;const{key:d}=u;if(!s.has(d)&&(s.add(d),a.add(d),oz(u.rawNode,i))){if(r)return rf.STOP;if(!n)throw new cz}})}),a}function pz(t,{includeGroup:e=!1,includeSelf:n=!0},r){var o;const i=r.treeNodeMap;let s=t==null?null:(o=i.get(t))!==null&&o!==void 0?o:null;const a={keyPath:[],treeNodePath:[],treeNode:s};if(s?.ignored)return a.treeNode=null,a;for(;s;)!s.ignored&&(e||!s.isGroup)&&a.treeNodePath.push(s),s=s.parent;return a.treeNodePath.reverse(),n||a.treeNodePath.pop(),a.keyPath=a.treeNodePath.map(l=>l.key),a}function hz(t){if(t.length===0)return null;const e=t[0];return e.isGroup||e.ignored||e.disabled?e.getNext():e}function mz(t,e){const n=t.siblings,r=n.length,{index:o}=t;return e?n[(o+1)%r]:o===n.length-1?null:n[o+1]}function i0(t,e,{loop:n=!1,includeDisabled:r=!1}={}){const o=e==="prev"?gz:mz,i={reverse:e==="prev"};let s=!1,a=null;function l(c){if(c!==null){if(c===t){if(!s)s=!0;else if(!t.disabled&&!t.isGroup){a=t;return}}else if((!c.disabled||r)&&!c.ignored&&!c.isGroup){a=c;return}if(c.isGroup){const u=$p(c,i);u!==null?a=u:l(o(c,n))}else{const u=o(c,!1);if(u!==null)l(u);else{const d=yz(c);d?.isGroup?l(o(d,n)):n&&l(o(c,!0))}}}}return l(t),a}function gz(t,e){const n=t.siblings,r=n.length,{index:o}=t;return e?n[(o-1+r)%r]:o===0?null:n[o-1]}function yz(t){return t.parent}function $p(t,e={}){const{reverse:n=!1}=e,{children:r}=t;if(r){const{length:o}=r,i=n?o-1:0,s=n?-1:o,a=n?-1:1;for(let l=i;l!==s;l+=a){const c=r[l];if(!c.disabled&&!c.ignored)if(c.isGroup){const u=$p(c,e);if(u!==null)return u}else return c}}return null}const bz={getChild(){return this.ignored?null:$p(this)},getParent(){const{parent:t}=this;return t?.isGroup?t.getParent():t},getNext(t={}){return i0(this,"next",t)},getPrev(t={}){return i0(this,"prev",t)}};function wz(t,e){const n=e?new Set(e):void 0,r=[];function o(i){i.forEach(s=>{r.push(s),!(s.isLeaf||!s.children||s.ignored)&&(s.isGroup||n===void 0||n.has(s.key))&&o(s.children)})}return o(t),r}function vz(t,e){const n=t.key;for(;e;){if(e.key===n)return!0;e=e.parent}return!1}function Ak(t,e,n,r,o,i=null,s=0){const a=[];return t.forEach((l,c)=>{var u;Se.env.NODE_ENV!=="production"&&iz(l,o)&&console.error("[treemate]: node",l,"is invalid");const d=Object.create(r);if(d.rawNode=l,d.siblings=a,d.level=s,d.index=c,d.isFirstChild=c===0,d.isLastChild=c+1===t.length,d.parent=i,!d.ignored){const f=o(l);Array.isArray(f)&&(d.children=Ak(f,e,n,r,o,d,s+1))}a.push(d),e.set(d.key,d),n.has(s)||n.set(s,[]),(u=n.get(s))===null||u===void 0||u.push(d)}),a}function xz(t,e={}){var n;const r=new Map,o=new Map,{getDisabled:i=rz,getIgnored:s=tz,getIsGroup:a=lz,getKey:l=ez}=e,c=(n=e.getChildren)!==null&&n!==void 0?n:QP,u=e.ignoreEmptyChildren?w=>{const T=c(w);return Array.isArray(T)?T.length?T:null:T}:c,d=Object.assign({get key(){return l(this.rawNode)},get disabled(){return i(this.rawNode)},get isGroup(){return a(this.rawNode)},get isLeaf(){return ZP(this.rawNode,u)},get shallowLoaded(){return nz(this.rawNode,u)},get ignored(){return s(this.rawNode)},contains(w){return vz(this,w)}},bz),f=Ak(t,r,o,d,u);function p(w){if(w==null)return null;const T=r.get(w);return T&&!T.isGroup&&!T.ignored?T:null}function h(w){if(w==null)return null;const T=r.get(w);return T&&!T.ignored?T:null}function m(w,T){const D=h(w);return D?D.getPrev(T):null}function y(w,T){const D=h(w);return D?D.getNext(T):null}function g(w){const T=h(w);return T?T.getParent():null}function x(w){const T=h(w);return T?T.getChild():null}const k={treeNodes:f,treeNodeMap:r,levelTreeNodeMap:o,maxLevel:Math.max(...o.keys()),getChildren:u,getFlattenedNodes(w){return wz(f,w)},getNode:p,getPrev:m,getNext:y,getParent:g,getChild:x,getFirstAvailableNode(){return hz(f)},getPath(w,T={}){return pz(w,T,k)},getCheckedKeys(w,T={}){const{cascade:D=!0,leafOnly:M=!1,checkStrategy:F="all",allowNotLoaded:C=!1}=T;return Nu({checkedKeys:Mu(w),indeterminateKeys:_u(w),cascade:D,leafOnly:M,checkStrategy:F,allowNotLoaded:C},k)},check(w,T,D={}){const{cascade:M=!0,leafOnly:F=!1,checkStrategy:C="all",allowNotLoaded:U=!1}=D;return Nu({checkedKeys:Mu(T),indeterminateKeys:_u(T),keysToCheck:w==null?[]:o0(w),cascade:M,leafOnly:F,checkStrategy:C,allowNotLoaded:U},k)},uncheck(w,T,D={}){const{cascade:M=!0,leafOnly:F=!1,checkStrategy:C="all",allowNotLoaded:U=!1}=D;return Nu({checkedKeys:Mu(T),indeterminateKeys:_u(T),keysToUncheck:w==null?[]:o0(w),cascade:M,leafOnly:F,checkStrategy:C,allowNotLoaded:U},k)},getNonLeafKeys(w={}){return YP(f,w)}};return k}const{cubicBezierEaseIn:s0,cubicBezierEaseOut:a0}=Ll;function kz({transformOrigin:t="inherit",duration:e=".2s",enterScale:n=".9",originalTransform:r="",originalTransition:o=""}={}){return[ze("&.fade-in-scale-up-transition-leave-active",{transformOrigin:t,transition:`opacity ${e} ${s0}, transform ${e} ${s0} ${o&&`,${o}`}`}),ze("&.fade-in-scale-up-transition-enter-active",{transformOrigin:t,transition:`opacity ${e} ${a0}, transform ${e} ${a0} ${o&&`,${o}`}`}),ze("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to",{opacity:0,transform:`${r} scale(${n})`}),ze("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to",{opacity:1,transform:`${r} scale(1)`})]}const Sz={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"};function Cz(t){const{boxShadow2:e,popoverColor:n,textColor2:r,borderRadius:o,fontSize:i,dividerColor:s}=t;return Object.assign(Object.assign({},Sz),{fontSize:i,borderRadius:o,color:n,dividerColor:s,textColor:r,boxShadow:e})}const Tp={name:"Popover",common:pi,self:Cz},Iu={top:"bottom",bottom:"top",left:"right",right:"left"},ft="var(--n-arrow-height) * 1.414",Ez=ze([Xe("popover",`
156
- transition:
157
- box-shadow .3s var(--n-bezier),
158
- background-color .3s var(--n-bezier),
159
- color .3s var(--n-bezier);
160
- position: relative;
161
- font-size: var(--n-font-size);
162
- color: var(--n-text-color);
163
- box-shadow: var(--n-box-shadow);
164
- word-break: break-word;
165
- `,[ze(">",[Xe("scrollbar",`
166
- height: inherit;
167
- max-height: inherit;
168
- `)]),Xi("raw",`
169
- background-color: var(--n-color);
170
- border-radius: var(--n-border-radius);
171
- `,[Xi("scrollable",[Xi("show-header-or-footer","padding: var(--n-padding);")])]),Pt("header",`
172
- padding: var(--n-padding);
173
- border-bottom: 1px solid var(--n-divider-color);
174
- transition: border-color .3s var(--n-bezier);
175
- `),Pt("footer",`
176
- padding: var(--n-padding);
177
- border-top: 1px solid var(--n-divider-color);
178
- transition: border-color .3s var(--n-bezier);
179
- `),it("scrollable, show-header-or-footer",[Pt("content",`
180
- padding: var(--n-padding);
181
- `)])]),Xe("popover-shared",`
182
- transform-origin: inherit;
183
- `,[Xe("popover-arrow-wrapper",`
184
- position: absolute;
185
- overflow: hidden;
186
- pointer-events: none;
187
- `,[Xe("popover-arrow",`
188
- transition: background-color .3s var(--n-bezier);
189
- position: absolute;
190
- display: block;
191
- width: calc(${ft});
192
- height: calc(${ft});
193
- box-shadow: 0 0 8px 0 rgba(0, 0, 0, .12);
194
- transform: rotate(45deg);
195
- background-color: var(--n-color);
196
- pointer-events: all;
197
- `)]),ze("&.popover-transition-enter-from, &.popover-transition-leave-to",`
198
- opacity: 0;
199
- transform: scale(.85);
200
- `),ze("&.popover-transition-enter-to, &.popover-transition-leave-from",`
201
- transform: scale(1);
202
- opacity: 1;
203
- `),ze("&.popover-transition-enter-active",`
204
- transition:
205
- box-shadow .3s var(--n-bezier),
206
- background-color .3s var(--n-bezier),
207
- color .3s var(--n-bezier),
208
- opacity .15s var(--n-bezier-ease-out),
209
- transform .15s var(--n-bezier-ease-out);
210
- `),ze("&.popover-transition-leave-active",`
211
- transition:
212
- box-shadow .3s var(--n-bezier),
213
- background-color .3s var(--n-bezier),
214
- color .3s var(--n-bezier),
215
- opacity .15s var(--n-bezier-ease-in),
216
- transform .15s var(--n-bezier-ease-in);
217
- `)]),an("top-start",`
218
- top: calc(${ft} / -2);
219
- left: calc(${Vn("top-start")} - var(--v-offset-left));
220
- `),an("top",`
221
- top: calc(${ft} / -2);
222
- transform: translateX(calc(${ft} / -2)) rotate(45deg);
223
- left: 50%;
224
- `),an("top-end",`
225
- top: calc(${ft} / -2);
226
- right: calc(${Vn("top-end")} + var(--v-offset-left));
227
- `),an("bottom-start",`
228
- bottom: calc(${ft} / -2);
229
- left: calc(${Vn("bottom-start")} - var(--v-offset-left));
230
- `),an("bottom",`
231
- bottom: calc(${ft} / -2);
232
- transform: translateX(calc(${ft} / -2)) rotate(45deg);
233
- left: 50%;
234
- `),an("bottom-end",`
235
- bottom: calc(${ft} / -2);
236
- right: calc(${Vn("bottom-end")} + var(--v-offset-left));
237
- `),an("left-start",`
238
- left: calc(${ft} / -2);
239
- top: calc(${Vn("left-start")} - var(--v-offset-top));
240
- `),an("left",`
241
- left: calc(${ft} / -2);
242
- transform: translateY(calc(${ft} / -2)) rotate(45deg);
243
- top: 50%;
244
- `),an("left-end",`
245
- left: calc(${ft} / -2);
246
- bottom: calc(${Vn("left-end")} + var(--v-offset-top));
247
- `),an("right-start",`
248
- right: calc(${ft} / -2);
249
- top: calc(${Vn("right-start")} - var(--v-offset-top));
250
- `),an("right",`
251
- right: calc(${ft} / -2);
252
- transform: translateY(calc(${ft} / -2)) rotate(45deg);
253
- top: 50%;
254
- `),an("right-end",`
255
- right: calc(${ft} / -2);
256
- bottom: calc(${Vn("right-end")} + var(--v-offset-top));
257
- `),...FP({top:["right-start","left-start"],right:["top-end","bottom-end"],bottom:["right-end","left-end"],left:["top-start","bottom-start"]},(t,e)=>{const n=["right","left"].includes(e),r=n?"width":"height";return t.map(o=>{const i=o.split("-")[1]==="end",s=`calc((${`var(--v-target-${r}, 0px)`} - ${ft}) / 2)`,a=Vn(o);return ze(`[v-placement="${o}"] >`,[Xe("popover-shared",[it("center-arrow",[Xe("popover-arrow",`${e}: calc(max(${s}, ${a}) ${i?"+":"-"} var(--v-offset-${n?"left":"top"}));`)])])])})})]);function Vn(t){return["top","bottom"].includes(t.split("-")[0])?"var(--n-arrow-offset)":"var(--n-arrow-offset-vertical)"}function an(t,e){const n=t.split("-")[0],r=["top","bottom"].includes(n)?"height: var(--n-space-arrow);":"width: var(--n-space-arrow);";return ze(`[v-placement="${t}"] >`,[Xe("popover-shared",`
258
- margin-${Iu[n]}: var(--n-space);
259
- `,[it("show-arrow",`
260
- margin-${Iu[n]}: var(--n-space-arrow);
261
- `),it("overlap",`
262
- margin: 0;
263
- `),d8("popover-arrow-wrapper",`
264
- right: 0;
265
- left: 0;
266
- top: 0;
267
- bottom: 0;
268
- ${n}: 100%;
269
- ${Iu[n]}: auto;
270
- ${r}
271
- `,[Xe("popover-arrow",e)])])])}const $k=Object.assign(Object.assign({},Yt.props),{to:ri.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number});function Tk({arrowClass:t,arrowStyle:e,arrowWrapperClass:n,arrowWrapperStyle:r,clsPrefix:o}){return b.h("div",{key:"__popover-arrow__",style:r,class:[`${o}-popover-arrow-wrapper`,n]},b.h("div",{class:[`${o}-popover-arrow`,t],style:e}))}const Az=b.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:$k,setup(t,{slots:e,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:o,inlineThemeDisabled:i}=di(t),s=Yt("Popover","-popover",Ez,Tp,t,o),a=b.ref(null),l=b.inject("NPopover"),c=b.ref(null),u=b.ref(t.show),d=b.ref(!1);b.watchEffect(()=>{const{show:M}=t;M&&!RF()&&!t.internalDeactivateImmediately&&(d.value=!0)});const f=b.computed(()=>{const{trigger:M,onClickoutside:F}=t,C=[],{positionManuallyRef:{value:U}}=l;return U||(M==="click"&&!F&&C.push([ub,w,void 0,{capture:!0}]),M==="hover"&&C.push([J8,k])),F&&C.push([ub,w,void 0,{capture:!0}]),(t.displayDirective==="show"||t.animated&&d.value)&&C.push([b.vShow,t.show]),C}),p=b.computed(()=>{const{common:{cubicBezierEaseInOut:M,cubicBezierEaseIn:F,cubicBezierEaseOut:C},self:{space:U,spaceArrow:ie,padding:I,fontSize:W,textColor:A,dividerColor:G,color:ae,boxShadow:X,borderRadius:de,arrowHeight:J,arrowOffset:pe,arrowOffsetVertical:Q}}=s.value;return{"--n-box-shadow":X,"--n-bezier":M,"--n-bezier-ease-in":F,"--n-bezier-ease-out":C,"--n-font-size":W,"--n-text-color":A,"--n-color":ae,"--n-divider-color":G,"--n-border-radius":de,"--n-arrow-height":J,"--n-arrow-offset":pe,"--n-arrow-offset-vertical":Q,"--n-padding":I,"--n-space":U,"--n-space-arrow":ie}}),h=b.computed(()=>{const M=t.width==="trigger"?void 0:Oa(t.width),F=[];M&&F.push({width:M});const{maxWidth:C,minWidth:U}=t;return C&&F.push({maxWidth:Oa(C)}),U&&F.push({maxWidth:Oa(U)}),i||F.push(p.value),F}),m=i?Il("popover",void 0,p,t):void 0;l.setBodyInstance({syncPosition:y}),b.onBeforeUnmount(()=>{l.setBodyInstance(null)}),b.watch(b.toRef(t,"show"),M=>{t.animated||(M?u.value=!0:u.value=!1)});function y(){var M;(M=a.value)===null||M===void 0||M.syncPosition()}function g(M){t.trigger==="hover"&&t.keepAliveOnHover&&t.show&&l.handleMouseEnter(M)}function x(M){t.trigger==="hover"&&t.keepAliveOnHover&&l.handleMouseLeave(M)}function k(M){t.trigger==="hover"&&!T().contains(il(M))&&l.handleMouseMoveOutside(M)}function w(M){(t.trigger==="click"&&!T().contains(il(M))||t.onClickoutside)&&l.handleClickOutside(M)}function T(){return l.getTriggerElement()}b.provide(Ml,c),b.provide(dp,null),b.provide(fp,null);function D(){if(m?.onRender(),!(t.displayDirective==="show"||t.show||t.animated&&d.value))return null;let M;const F=l.internalRenderBodyRef.value,{value:C}=o;if(F)M=F([`${C}-popover-shared`,m?.themeClass.value,t.overlap&&`${C}-popover-shared--overlap`,t.showArrow&&`${C}-popover-shared--show-arrow`,t.arrowPointToCenter&&`${C}-popover-shared--center-arrow`],c,h.value,g,x);else{const{value:U}=l.extraClassRef,{internalTrapFocus:ie}=t,I=!Db(e.header)||!Db(e.footer),W=()=>{var A,G;const ae=I?b.h(b.Fragment,null,$u(e.header,J=>J?b.h("div",{class:[`${C}-popover__header`,t.headerClass],style:t.headerStyle},J):null),$u(e.default,J=>J?b.h("div",{class:[`${C}-popover__content`,t.contentClass],style:t.contentStyle},e):null),$u(e.footer,J=>J?b.h("div",{class:[`${C}-popover__footer`,t.footerClass],style:t.footerStyle},J):null)):t.scrollable?(A=e.default)===null||A===void 0?void 0:A.call(e):b.h("div",{class:[`${C}-popover__content`,t.contentClass],style:t.contentStyle},e),X=t.scrollable?b.h(Ck,{contentClass:I?void 0:`${C}-popover__content ${(G=t.contentClass)!==null&&G!==void 0?G:""}`,contentStyle:I?void 0:t.contentStyle},{default:()=>ae}):ae,de=t.showArrow?Tk({arrowClass:t.arrowClass,arrowStyle:t.arrowStyle,arrowWrapperClass:t.arrowWrapperClass,arrowWrapperStyle:t.arrowWrapperStyle,clsPrefix:C}):null;return[X,de]};M=b.h("div",b.mergeProps({class:[`${C}-popover`,`${C}-popover-shared`,m?.themeClass.value,U.map(A=>`${C}-${A}`),{[`${C}-popover--scrollable`]:t.scrollable,[`${C}-popover--show-header-or-footer`]:I,[`${C}-popover--raw`]:t.raw,[`${C}-popover-shared--overlap`]:t.overlap,[`${C}-popover-shared--show-arrow`]:t.showArrow,[`${C}-popover-shared--center-arrow`]:t.arrowPointToCenter}],ref:c,style:h.value,onKeydown:l.handleKeydown,onMouseenter:g,onMouseleave:x},n),ie?b.h(FF,{active:t.show,autoFocus:!0},{default:W}):W())}return b.withDirectives(M,f.value)}return{displayed:d,namespace:r,isMounted:l.isMountedRef,zIndex:l.zIndexRef,followerRef:a,adjustedTo:ri(t),followerEnabled:u,renderContentNode:D}},render(){return b.h(Hx,{ref:"followerRef",zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width==="trigger"?"target":void 0,teleportDisabled:this.adjustedTo===ri.tdkey},{default:()=>this.animated?b.h(b.Transition,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var t;(t=this.internalOnAfterLeave)===null||t===void 0||t.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}}),$z=Object.keys($k),Tz={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function Oz(t,e,n){Tz[e].forEach(r=>{t.props?t.props=Object.assign({},t.props):t.props={};const o=t.props[r],i=n[r];o?t.props[r]=(...s)=>{o(...s),i(...s)}:t.props[r]=i})}const Pl={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:"hover"},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:"top"},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:"if"},arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:ri.propTo,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},Dz=Object.assign(Object.assign(Object.assign({},Yt.props),Pl),{internalOnAfterLeave:Function,internalRenderBody:Function}),Ok=b.defineComponent({name:"Popover",inheritAttrs:!1,props:Dz,slots:Object,__popover__:!0,setup(t){Se.env.NODE_ENV!=="production"&&b.watchEffect(()=>{t.maxWidth!==void 0&&wi("popover","`max-width` is deprecated, please use `style` instead."),t.minWidth!==void 0&&wi("popover","`min-width` is deprecated, please use `style` instead."),t.arrow!==void 0&&wi("popover","`arrow` is deprecated, please use `showArrow` instead."),t.onHide!==void 0&&wi("popover","`on-hide` is deprecated, please use `on-update:show` instead."),t.onShow!==void 0&&wi("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const e=Lx(),n=b.ref(null),r=b.computed(()=>t.show),o=b.ref(t.defaultShow),i=Rx(r,o),s=nr(()=>t.disabled?!1:i.value),a=()=>{if(t.disabled)return!0;const{getDisabled:A}=t;return!!A?.()},l=()=>a()?!1:i.value,c=P8(t,["arrow","showArrow"]),u=b.computed(()=>t.overlap?!1:c.value);let d=null;const f=b.ref(null),p=b.ref(null),h=nr(()=>t.x!==void 0&&t.y!==void 0);function m(A){const{"onUpdate:show":G,onUpdateShow:ae,onShow:X,onHide:de}=t;o.value=A,G&&Sr(G,A),ae&&Sr(ae,A),A&&X&&Sr(X,!0),A&&de&&Sr(de,!1)}function y(){d&&d.syncPosition()}function g(){const{value:A}=f;A&&(window.clearTimeout(A),f.value=null)}function x(){const{value:A}=p;A&&(window.clearTimeout(A),p.value=null)}function k(){const A=a();if(t.trigger==="focus"&&!A){if(l())return;m(!0)}}function w(){const A=a();if(t.trigger==="focus"&&!A){if(!l())return;m(!1)}}function T(){const A=a();if(t.trigger==="hover"&&!A){if(x(),f.value!==null||l())return;const G=()=>{m(!0),f.value=null},{delay:ae}=t;ae===0?G():f.value=window.setTimeout(G,ae)}}function D(){const A=a();if(t.trigger==="hover"&&!A){if(g(),p.value!==null||!l())return;const G=()=>{m(!1),p.value=null},{duration:ae}=t;ae===0?G():p.value=window.setTimeout(G,ae)}}function M(){D()}function F(A){var G;l()&&(t.trigger==="click"&&(g(),x(),m(!1)),(G=t.onClickoutside)===null||G===void 0||G.call(t,A))}function C(){if(t.trigger==="click"&&!a()){g(),x();const A=!l();m(A)}}function U(A){t.internalTrapFocus&&A.key==="Escape"&&(g(),x(),m(!1))}function ie(A){o.value=A}function I(){var A;return(A=n.value)===null||A===void 0?void 0:A.targetRef}function W(A){d=A}return b.provide("NPopover",{getTriggerElement:I,handleKeydown:U,handleMouseEnter:T,handleMouseLeave:D,handleClickOutside:F,handleMouseMoveOutside:M,setBodyInstance:W,positionManuallyRef:h,isMountedRef:e,zIndexRef:b.toRef(t,"zIndex"),extraClassRef:b.toRef(t,"internalExtraClass"),internalRenderBodyRef:b.toRef(t,"internalRenderBody")}),b.watchEffect(()=>{i.value&&a()&&m(!1)}),{binderInstRef:n,positionManually:h,mergedShowConsideringDisabledProp:s,uncontrolledShow:o,mergedShowArrow:u,getMergedShow:l,setShow:ie,handleClick:C,handleMouseEnter:T,handleMouseLeave:D,handleFocus:k,handleBlur:w,syncPosition:y}},render(){var t;const{positionManually:e,$slots:n}=this;let r,o=!1;if(!e&&(r=zF(n,"trigger"),r)){r=b.cloneVNode(r),r=r.type===b.Text?b.h("span",[r]):r;const i={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(!((t=r.type)===null||t===void 0)&&t.__popover__)o=!0,r.props||(r.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),r.props.internalSyncTargetWithParent=!0,r.props.internalInheritedEventHandlers?r.props.internalInheritedEventHandlers=[i,...r.props.internalInheritedEventHandlers]:r.props.internalInheritedEventHandlers=[i];else{const{internalInheritedEventHandlers:s}=this,a=[i,...s],l={onBlur:c=>{a.forEach(u=>{u.onBlur(c)})},onFocus:c=>{a.forEach(u=>{u.onFocus(c)})},onClick:c=>{a.forEach(u=>{u.onClick(c)})},onMouseenter:c=>{a.forEach(u=>{u.onMouseenter(c)})},onMouseleave:c=>{a.forEach(u=>{u.onMouseleave(c)})}};Oz(r,s?"nested":e?"manual":this.trigger,l)}}return b.h(qx,{ref:"binderInstRef",syncTarget:!o,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;const i=this.getMergedShow();return[this.internalTrapFocus&&i?b.withDirectives(b.h("div",{style:{position:"fixed",top:0,right:0,bottom:0,left:0}}),[[Ux,{enabled:i,zIndex:this.zIndex}]]):null,e?null:b.h(Vx,null,{default:()=>r}),b.h(Az,nk(this.$props,$z,Object.assign(Object.assign({},this.$attrs),{showArrow:this.mergedShowArrow,show:i})),{default:()=>{var s,a;return(a=(s=this.$slots).default)===null||a===void 0?void 0:a.call(s)},header:()=>{var s,a;return(a=(s=this.$slots).header)===null||a===void 0?void 0:a.call(s)},footer:()=>{var s,a;return(a=(s=this.$slots).footer)===null||a===void 0?void 0:a.call(s)}})]}})}}),Mz={padding:"4px 0",optionIconSizeSmall:"14px",optionIconSizeMedium:"16px",optionIconSizeLarge:"16px",optionIconSizeHuge:"18px",optionSuffixWidthSmall:"14px",optionSuffixWidthMedium:"14px",optionSuffixWidthLarge:"16px",optionSuffixWidthHuge:"16px",optionIconSuffixWidthSmall:"32px",optionIconSuffixWidthMedium:"32px",optionIconSuffixWidthLarge:"36px",optionIconSuffixWidthHuge:"36px",optionPrefixWidthSmall:"14px",optionPrefixWidthMedium:"14px",optionPrefixWidthLarge:"16px",optionPrefixWidthHuge:"16px",optionIconPrefixWidthSmall:"36px",optionIconPrefixWidthMedium:"36px",optionIconPrefixWidthLarge:"40px",optionIconPrefixWidthHuge:"40px"};function _z(t){const{primaryColor:e,textColor2:n,dividerColor:r,hoverColor:o,popoverColor:i,invertedColor:s,borderRadius:a,fontSizeSmall:l,fontSizeMedium:c,fontSizeLarge:u,fontSizeHuge:d,heightSmall:f,heightMedium:p,heightLarge:h,heightHuge:m,textColor3:y,opacityDisabled:g}=t;return Object.assign(Object.assign({},Mz),{optionHeightSmall:f,optionHeightMedium:p,optionHeightLarge:h,optionHeightHuge:m,borderRadius:a,fontSizeSmall:l,fontSizeMedium:c,fontSizeLarge:u,fontSizeHuge:d,optionTextColor:n,optionTextColorHover:n,optionTextColorActive:e,optionTextColorChildActive:e,color:i,dividerColor:r,suffixColor:n,prefixColor:n,optionColorHover:o,optionColorActive:E8(e,{alpha:.1}),groupHeaderTextColor:y,optionTextColorInverted:"#BBB",optionTextColorHoverInverted:"#FFF",optionTextColorActiveInverted:"#FFF",optionTextColorChildActiveInverted:"#FFF",colorInverted:s,dividerColorInverted:"#BBB",suffixColorInverted:"#BBB",prefixColorInverted:"#BBB",optionColorHoverInverted:e,optionColorActiveInverted:e,groupHeaderTextColorInverted:"#AAA",optionOpacityDisabled:g})}const Nz={common:pi,peers:{Popover:Tp},self:_z},Iz={padding:"8px 14px"};function Fz(t){const{borderRadius:e,boxShadow2:n,baseColor:r}=t;return Object.assign(Object.assign({},Iz),{borderRadius:e,boxShadow:n,color:Fx(r,"rgba(0, 0, 0, .85)"),textColor:r})}const Bz={common:pi,peers:{Popover:Tp},self:Fz},Rz=Object.assign(Object.assign({},Pl),Yt.props),Lz=b.defineComponent({name:"Tooltip",props:Rz,slots:Object,__popover__:!0,setup(t){const{mergedClsPrefixRef:e}=di(t),n=Yt("Tooltip","-tooltip",void 0,Bz,t,e),r=b.ref(null);return Object.assign(Object.assign({},{syncPosition(){r.value.syncPosition()},setShow(o){r.value.setShow(o)}}),{popoverRef:r,mergedTheme:n,popoverThemeOverrides:b.computed(()=>n.value.self)})},render(){const{mergedTheme:t,internalExtraClass:e}=this;return b.h(Ok,Object.assign(Object.assign({},this.$props),{theme:t.peers.Popover,themeOverrides:t.peerOverrides.Popover,builtinThemeOverrides:this.popoverThemeOverrides,internalExtraClass:e.concat("tooltip"),ref:"popoverRef"}),this.$slots)}}),Op="n-dropdown-menu",zl="n-dropdown",l0="n-dropdown-option",Dk=b.defineComponent({name:"DropdownDivider",props:{clsPrefix:{type:String,required:!0}},render(){return b.h("div",{class:`${this.clsPrefix}-dropdown-divider`})}}),Pz=b.defineComponent({name:"DropdownGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{showIconRef:t,hasSubmenuRef:e}=b.inject(Op),{renderLabelRef:n,labelFieldRef:r,nodePropsRef:o,renderOptionRef:i}=b.inject(zl);return{labelField:r,showIcon:t,hasSubmenu:e,renderLabel:n,nodeProps:o,renderOption:i}},render(){var t;const{clsPrefix:e,hasSubmenu:n,showIcon:r,nodeProps:o,renderLabel:i,renderOption:s}=this,{rawNode:a}=this.tmNode,l=b.h("div",Object.assign({class:`${e}-dropdown-option`},o?.(a)),b.h("div",{class:`${e}-dropdown-option-body ${e}-dropdown-option-body--group`},b.h("div",{"data-dropdown-option":!0,class:[`${e}-dropdown-option-body__prefix`,r&&`${e}-dropdown-option-body__prefix--show-icon`]},ll(a.icon)),b.h("div",{class:`${e}-dropdown-option-body__label`,"data-dropdown-option":!0},i?i(a):ll((t=a.title)!==null&&t!==void 0?t:a[this.labelField])),b.h("div",{class:[`${e}-dropdown-option-body__suffix`,n&&`${e}-dropdown-option-body__suffix--has-submenu`],"data-dropdown-option":!0})));return s?s({node:l,option:a}):l}});function zz(t){const{textColorBase:e,opacity1:n,opacity2:r,opacity3:o,opacity4:i,opacity5:s}=t;return{color:e,opacity1Depth:n,opacity2Depth:r,opacity3Depth:o,opacity4Depth:i,opacity5Depth:s}}const jz={common:pi,self:zz},qz=Xe("icon",`
272
- height: 1em;
273
- width: 1em;
274
- line-height: 1em;
275
- text-align: center;
276
- display: inline-block;
277
- position: relative;
278
- fill: currentColor;
279
- transform: translateZ(0);
280
- `,[it("color-transition",{transition:"color .3s var(--n-bezier)"}),it("depth",{color:"var(--n-color)"},[ze("svg",{opacity:"var(--n-opacity)",transition:"opacity .3s var(--n-bezier)"})]),ze("svg",{height:"1em",width:"1em"})]),Vz=Object.assign(Object.assign({},Yt.props),{depth:[String,Number],size:[Number,String],color:String,component:[Object,Function]}),Uz=b.defineComponent({_n_icon__:!0,name:"Icon",inheritAttrs:!1,props:Vz,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n}=di(t),r=Yt("Icon","-icon",qz,jz,t,e),o=b.computed(()=>{const{depth:s}=t,{common:{cubicBezierEaseInOut:a},self:l}=r.value;if(s!==void 0){const{color:c,[`opacity${s}Depth`]:u}=l;return{"--n-bezier":a,"--n-color":c,"--n-opacity":u}}return{"--n-bezier":a,"--n-color":"","--n-opacity":""}}),i=n?Il("icon",b.computed(()=>`${t.depth||"d"}`),o,t):void 0;return{mergedClsPrefix:e,mergedStyle:b.computed(()=>{const{size:s,color:a}=t;return{fontSize:Oa(s),color:a}}),cssVars:n?void 0:o,themeClass:i?.themeClass,onRender:i?.onRender}},render(){var t;const{$parent:e,depth:n,mergedClsPrefix:r,component:o,onRender:i,themeClass:s}=this;return!((t=e?.$options)===null||t===void 0)&&t._n_icon__&&al("icon","don't wrap `n-icon` inside `n-icon`"),i?.(),b.h("i",b.mergeProps(this.$attrs,{role:"img",class:[`${r}-icon`,s,{[`${r}-icon--depth`]:n,[`${r}-icon--color-transition`]:n!==void 0}],style:[this.cssVars,this.mergedStyle]}),o?b.h(o):this.$slots)}});function of(t,e){return t.type==="submenu"||t.type===void 0&&t[e]!==void 0}function Hz(t){return t.type==="group"}function Mk(t){return t.type==="divider"}function Wz(t){return t.type==="render"}const _k=b.defineComponent({name:"DropdownOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null},placement:{type:String,default:"right-start"},props:Object,scrollable:Boolean},setup(t){const e=b.inject(zl),{hoverKeyRef:n,keyboardKeyRef:r,lastToggledSubmenuKeyRef:o,pendingKeyPathRef:i,activeKeyPathRef:s,animatedRef:a,mergedShowRef:l,renderLabelRef:c,renderIconRef:u,labelFieldRef:d,childrenFieldRef:f,renderOptionRef:p,nodePropsRef:h,menuPropsRef:m}=e,y=b.inject(l0,null),g=b.inject(Op),x=b.inject(Ml),k=b.computed(()=>t.tmNode.rawNode),w=b.computed(()=>{const{value:X}=f;return of(t.tmNode.rawNode,X)}),T=b.computed(()=>{const{disabled:X}=t.tmNode;return X}),D=b.computed(()=>{if(!w.value)return!1;const{key:X,disabled:de}=t.tmNode;if(de)return!1;const{value:J}=n,{value:pe}=r,{value:Q}=o,{value:B}=i;return J!==null?B.includes(X):pe!==null?B.includes(X)&&B[B.length-1]!==X:Q!==null?B.includes(X):!1}),M=b.computed(()=>r.value===null&&!a.value),F=U8(D,300,M),C=b.computed(()=>!!y?.enteringSubmenuRef.value),U=b.ref(!1);b.provide(l0,{enteringSubmenuRef:U});function ie(){U.value=!0}function I(){U.value=!1}function W(){const{parentKey:X,tmNode:de}=t;de.disabled||l.value&&(o.value=X,r.value=null,n.value=de.key)}function A(){const{tmNode:X}=t;X.disabled||l.value&&n.value!==X.key&&W()}function G(X){if(t.tmNode.disabled||!l.value)return;const{relatedTarget:de}=X;de&&!ob({target:de},"dropdownOption")&&!ob({target:de},"scrollbarRail")&&(n.value=null)}function ae(){const{value:X}=w,{tmNode:de}=t;l.value&&!X&&!de.disabled&&(e.doSelect(de.key,de.rawNode),e.doUpdateShow(!1))}return{labelField:d,renderLabel:c,renderIcon:u,siblingHasIcon:g.showIconRef,siblingHasSubmenu:g.hasSubmenuRef,menuProps:m,popoverBody:x,animated:a,mergedShowSubmenu:b.computed(()=>F.value&&!C.value),rawNode:k,hasSubmenu:w,pending:nr(()=>{const{value:X}=i,{key:de}=t.tmNode;return X.includes(de)}),childActive:nr(()=>{const{value:X}=s,{key:de}=t.tmNode,J=X.findIndex(pe=>de===pe);return J===-1?!1:J<X.length-1}),active:nr(()=>{const{value:X}=s,{key:de}=t.tmNode,J=X.findIndex(pe=>de===pe);return J===-1?!1:J===X.length-1}),mergedDisabled:T,renderOption:p,nodeProps:h,handleClick:ae,handleMouseMove:A,handleMouseEnter:W,handleMouseLeave:G,handleSubmenuBeforeEnter:ie,handleSubmenuAfterEnter:I}},render(){var t,e;const{animated:n,rawNode:r,mergedShowSubmenu:o,clsPrefix:i,siblingHasIcon:s,siblingHasSubmenu:a,renderLabel:l,renderIcon:c,renderOption:u,nodeProps:d,props:f,scrollable:p}=this;let h=null;if(o){const x=(t=this.menuProps)===null||t===void 0?void 0:t.call(this,r,r.children);h=b.h(Nk,Object.assign({},x,{clsPrefix:i,scrollable:this.scrollable,tmNodes:this.tmNode.children,parentKey:this.tmNode.key}))}const m={class:[`${i}-dropdown-option-body`,this.pending&&`${i}-dropdown-option-body--pending`,this.active&&`${i}-dropdown-option-body--active`,this.childActive&&`${i}-dropdown-option-body--child-active`,this.mergedDisabled&&`${i}-dropdown-option-body--disabled`],onMousemove:this.handleMouseMove,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onClick:this.handleClick},y=d?.(r),g=b.h("div",Object.assign({class:[`${i}-dropdown-option`,y?.class],"data-dropdown-option":!0},y),b.h("div",b.mergeProps(m,f),[b.h("div",{class:[`${i}-dropdown-option-body__prefix`,s&&`${i}-dropdown-option-body__prefix--show-icon`]},[c?c(r):ll(r.icon)]),b.h("div",{"data-dropdown-option":!0,class:`${i}-dropdown-option-body__label`},l?l(r):ll((e=r[this.labelField])!==null&&e!==void 0?e:r.title)),b.h("div",{"data-dropdown-option":!0,class:[`${i}-dropdown-option-body__suffix`,a&&`${i}-dropdown-option-body__suffix--has-submenu`]},this.hasSubmenu?b.h(Uz,null,{default:()=>b.h(jP,null)}):null)]),this.hasSubmenu?b.h(qx,null,{default:()=>[b.h(Vx,null,{default:()=>b.h("div",{class:`${i}-dropdown-offset-container`},b.h(Hx,{show:this.mergedShowSubmenu,placement:this.placement,to:p&&this.popoverBody||void 0,teleportDisabled:!p},{default:()=>b.h("div",{class:`${i}-dropdown-menu-wrapper`},n?b.h(b.Transition,{onBeforeEnter:this.handleSubmenuBeforeEnter,onAfterEnter:this.handleSubmenuAfterEnter,name:"fade-in-scale-up-transition",appear:!0},{default:()=>h}):h)}))})]}):null);return u?u({node:g,option:r}):g}}),Gz=b.defineComponent({name:"NDropdownGroup",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null}},render(){const{tmNode:t,parentKey:e,clsPrefix:n}=this,{children:r}=t;return b.h(b.Fragment,null,b.h(Pz,{clsPrefix:n,tmNode:t,key:t.key}),r?.map(o=>{const{rawNode:i}=o;return i.show===!1?null:Mk(i)?b.h(Dk,{clsPrefix:n,key:o.key}):o.isGroup?(al("dropdown","`group` node is not allowed to be put in `group` node."),null):b.h(_k,{clsPrefix:n,tmNode:o,parentKey:e,key:o.key})}))}}),Kz=b.defineComponent({name:"DropdownRenderOption",props:{tmNode:{type:Object,required:!0}},render(){const{rawNode:{render:t,props:e}}=this.tmNode;return b.h("div",e,[t?.()])}}),Nk=b.defineComponent({name:"DropdownMenu",props:{scrollable:Boolean,showArrow:Boolean,arrowStyle:[String,Object],clsPrefix:{type:String,required:!0},tmNodes:{type:Array,default:()=>[]},parentKey:{type:[String,Number],default:null}},setup(t){const{renderIconRef:e,childrenFieldRef:n}=b.inject(zl);b.provide(Op,{showIconRef:b.computed(()=>{const o=e.value;return t.tmNodes.some(i=>{var s;if(i.isGroup)return(s=i.children)===null||s===void 0?void 0:s.some(({rawNode:l})=>o?o(l):l.icon);const{rawNode:a}=i;return o?o(a):a.icon})}),hasSubmenuRef:b.computed(()=>{const{value:o}=n;return t.tmNodes.some(i=>{var s;if(i.isGroup)return(s=i.children)===null||s===void 0?void 0:s.some(({rawNode:l})=>of(l,o));const{rawNode:a}=i;return of(a,o)})})});const r=b.ref(null);return b.provide(fp,null),b.provide(dp,null),b.provide(Ml,r),{bodyRef:r}},render(){const{parentKey:t,clsPrefix:e,scrollable:n}=this,r=this.tmNodes.map(o=>{const{rawNode:i}=o;return i.show===!1?null:Wz(i)?b.h(Kz,{tmNode:o,key:o.key}):Mk(i)?b.h(Dk,{clsPrefix:e,key:o.key}):Hz(i)?b.h(Gz,{clsPrefix:e,tmNode:o,parentKey:t,key:o.key}):b.h(_k,{clsPrefix:e,tmNode:o,parentKey:t,key:o.key,props:i.props,scrollable:n})});return b.h("div",{class:[`${e}-dropdown-menu`,n&&`${e}-dropdown-menu--scrollable`],ref:"bodyRef"},n?b.h(Ck,{contentClass:`${e}-dropdown-menu__content`},{default:()=>r}):r,this.showArrow?Tk({clsPrefix:e,arrowStyle:this.arrowStyle,arrowClass:void 0,arrowWrapperClass:void 0,arrowWrapperStyle:void 0}):null)}}),Xz=Xe("dropdown-menu",`
281
- transform-origin: var(--v-transform-origin);
282
- background-color: var(--n-color);
283
- border-radius: var(--n-border-radius);
284
- box-shadow: var(--n-box-shadow);
285
- position: relative;
286
- transition:
287
- background-color .3s var(--n-bezier),
288
- box-shadow .3s var(--n-bezier);
289
- `,[kz(),Xe("dropdown-option",`
290
- position: relative;
291
- `,[ze("a",`
292
- text-decoration: none;
293
- color: inherit;
294
- outline: none;
295
- `,[ze("&::before",`
296
- content: "";
297
- position: absolute;
298
- left: 0;
299
- right: 0;
300
- top: 0;
301
- bottom: 0;
302
- `)]),Xe("dropdown-option-body",`
303
- display: flex;
304
- cursor: pointer;
305
- position: relative;
306
- height: var(--n-option-height);
307
- line-height: var(--n-option-height);
308
- font-size: var(--n-font-size);
309
- color: var(--n-option-text-color);
310
- transition: color .3s var(--n-bezier);
311
- `,[ze("&::before",`
312
- content: "";
313
- position: absolute;
314
- top: 0;
315
- bottom: 0;
316
- left: 4px;
317
- right: 4px;
318
- transition: background-color .3s var(--n-bezier);
319
- border-radius: var(--n-border-radius);
320
- `),Xi("disabled",[it("pending",`
321
- color: var(--n-option-text-color-hover);
322
- `,[Pt("prefix, suffix",`
323
- color: var(--n-option-text-color-hover);
324
- `),ze("&::before","background-color: var(--n-option-color-hover);")]),it("active",`
325
- color: var(--n-option-text-color-active);
326
- `,[Pt("prefix, suffix",`
327
- color: var(--n-option-text-color-active);
328
- `),ze("&::before","background-color: var(--n-option-color-active);")]),it("child-active",`
329
- color: var(--n-option-text-color-child-active);
330
- `,[Pt("prefix, suffix",`
331
- color: var(--n-option-text-color-child-active);
332
- `)])]),it("disabled",`
333
- cursor: not-allowed;
334
- opacity: var(--n-option-opacity-disabled);
335
- `),it("group",`
336
- font-size: calc(var(--n-font-size) - 1px);
337
- color: var(--n-group-header-text-color);
338
- `,[Pt("prefix",`
339
- width: calc(var(--n-option-prefix-width) / 2);
340
- `,[it("show-icon",`
341
- width: calc(var(--n-option-icon-prefix-width) / 2);
342
- `)])]),Pt("prefix",`
343
- width: var(--n-option-prefix-width);
344
- display: flex;
345
- justify-content: center;
346
- align-items: center;
347
- color: var(--n-prefix-color);
348
- transition: color .3s var(--n-bezier);
349
- z-index: 1;
350
- `,[it("show-icon",`
351
- width: var(--n-option-icon-prefix-width);
352
- `),Xe("icon",`
353
- font-size: var(--n-option-icon-size);
354
- `)]),Pt("label",`
355
- white-space: nowrap;
356
- flex: 1;
357
- z-index: 1;
358
- `),Pt("suffix",`
359
- box-sizing: border-box;
360
- flex-grow: 0;
361
- flex-shrink: 0;
362
- display: flex;
363
- justify-content: flex-end;
364
- align-items: center;
365
- min-width: var(--n-option-suffix-width);
366
- padding: 0 8px;
367
- transition: color .3s var(--n-bezier);
368
- color: var(--n-suffix-color);
369
- z-index: 1;
370
- `,[it("has-submenu",`
371
- width: var(--n-option-icon-suffix-width);
372
- `),Xe("icon",`
373
- font-size: var(--n-option-icon-size);
374
- `)]),Xe("dropdown-menu","pointer-events: all;")]),Xe("dropdown-offset-container",`
375
- pointer-events: none;
376
- position: absolute;
377
- left: 0;
378
- right: 0;
379
- top: -4px;
380
- bottom: -4px;
381
- `)]),Xe("dropdown-divider",`
382
- transition: background-color .3s var(--n-bezier);
383
- background-color: var(--n-divider-color);
384
- height: 1px;
385
- margin: 4px 0;
386
- `),Xe("dropdown-menu-wrapper",`
387
- transform-origin: var(--v-transform-origin);
388
- width: fit-content;
389
- `),ze(">",[Xe("scrollbar",`
390
- height: inherit;
391
- max-height: inherit;
392
- `)]),Xi("scrollable",`
393
- padding: var(--n-padding);
394
- `),it("scrollable",[Pt("content",`
395
- padding: var(--n-padding);
396
- `)])]),Jz={animated:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},size:{type:String,default:"medium"},inverted:Boolean,placement:{type:String,default:"bottom"},onSelect:[Function,Array],options:{type:Array,default:()=>[]},menuProps:Function,showArrow:Boolean,renderLabel:Function,renderIcon:Function,renderOption:Function,nodeProps:Function,labelField:{type:String,default:"label"},keyField:{type:String,default:"key"},childrenField:{type:String,default:"children"},value:[String,Number]},Yz=Object.keys(Pl),Zz=Object.assign(Object.assign(Object.assign({},Pl),Jz),Yt.props),Qz=b.defineComponent({name:"Dropdown",inheritAttrs:!1,props:Zz,setup(t){const e=b.ref(!1),n=Rx(b.toRef(t,"show"),e),r=b.computed(()=>{const{keyField:I,childrenField:W}=t;return xz(t.options,{getKey(A){return A[I]},getDisabled(A){return A.disabled===!0},getIgnored(A){return A.type==="divider"||A.type==="render"},getChildren(A){return A[W]}})}),o=b.computed(()=>r.value.treeNodes),i=b.ref(null),s=b.ref(null),a=b.ref(null),l=b.computed(()=>{var I,W,A;return(A=(W=(I=i.value)!==null&&I!==void 0?I:s.value)!==null&&W!==void 0?W:a.value)!==null&&A!==void 0?A:null}),c=b.computed(()=>r.value.getPath(l.value).keyPath),u=b.computed(()=>r.value.getPath(t.value).keyPath),d=nr(()=>t.keyboard&&n.value);q8({keydown:{ArrowUp:{prevent:!0,handler:T},ArrowRight:{prevent:!0,handler:w},ArrowDown:{prevent:!0,handler:D},ArrowLeft:{prevent:!0,handler:k},Enter:{prevent:!0,handler:M},Escape:x}},d);const{mergedClsPrefixRef:f,inlineThemeDisabled:p}=di(t),h=Yt("Dropdown","-dropdown",Xz,Nz,t,f);b.provide(zl,{labelFieldRef:b.toRef(t,"labelField"),childrenFieldRef:b.toRef(t,"childrenField"),renderLabelRef:b.toRef(t,"renderLabel"),renderIconRef:b.toRef(t,"renderIcon"),hoverKeyRef:i,keyboardKeyRef:s,lastToggledSubmenuKeyRef:a,pendingKeyPathRef:c,activeKeyPathRef:u,animatedRef:b.toRef(t,"animated"),mergedShowRef:n,nodePropsRef:b.toRef(t,"nodeProps"),renderOptionRef:b.toRef(t,"renderOption"),menuPropsRef:b.toRef(t,"menuProps"),doSelect:m,doUpdateShow:y}),b.watch(n,I=>{!t.animated&&!I&&g()});function m(I,W){const{onSelect:A}=t;A&&Sr(A,I,W)}function y(I){const{"onUpdate:show":W,onUpdateShow:A}=t;W&&Sr(W,I),A&&Sr(A,I),e.value=I}function g(){i.value=null,s.value=null,a.value=null}function x(){y(!1)}function k(){C("left")}function w(){C("right")}function T(){C("up")}function D(){C("down")}function M(){const I=F();I?.isLeaf&&n.value&&(m(I.key,I.rawNode),y(!1))}function F(){var I;const{value:W}=r,{value:A}=l;return!W||A===null?null:(I=W.getNode(A))!==null&&I!==void 0?I:null}function C(I){const{value:W}=l,{value:{getFirstAvailableNode:A}}=r;let G=null;if(W===null){const ae=A();ae!==null&&(G=ae.key)}else{const ae=F();if(ae){let X;switch(I){case"down":X=ae.getNext();break;case"up":X=ae.getPrev();break;case"right":X=ae.getChild();break;case"left":X=ae.getParent();break}X&&(G=X.key)}}G!==null&&(i.value=null,s.value=G)}const U=b.computed(()=>{const{size:I,inverted:W}=t,{common:{cubicBezierEaseInOut:A},self:G}=h.value,{padding:ae,dividerColor:X,borderRadius:de,optionOpacityDisabled:J,[hr("optionIconSuffixWidth",I)]:pe,[hr("optionSuffixWidth",I)]:Q,[hr("optionIconPrefixWidth",I)]:B,[hr("optionPrefixWidth",I)]:ee,[hr("fontSize",I)]:Z,[hr("optionHeight",I)]:re,[hr("optionIconSize",I)]:K}=G,$={"--n-bezier":A,"--n-font-size":Z,"--n-padding":ae,"--n-border-radius":de,"--n-option-height":re,"--n-option-prefix-width":ee,"--n-option-icon-prefix-width":B,"--n-option-suffix-width":Q,"--n-option-icon-suffix-width":pe,"--n-option-icon-size":K,"--n-divider-color":X,"--n-option-opacity-disabled":J};return W?($["--n-color"]=G.colorInverted,$["--n-option-color-hover"]=G.optionColorHoverInverted,$["--n-option-color-active"]=G.optionColorActiveInverted,$["--n-option-text-color"]=G.optionTextColorInverted,$["--n-option-text-color-hover"]=G.optionTextColorHoverInverted,$["--n-option-text-color-active"]=G.optionTextColorActiveInverted,$["--n-option-text-color-child-active"]=G.optionTextColorChildActiveInverted,$["--n-prefix-color"]=G.prefixColorInverted,$["--n-suffix-color"]=G.suffixColorInverted,$["--n-group-header-text-color"]=G.groupHeaderTextColorInverted):($["--n-color"]=G.color,$["--n-option-color-hover"]=G.optionColorHover,$["--n-option-color-active"]=G.optionColorActive,$["--n-option-text-color"]=G.optionTextColor,$["--n-option-text-color-hover"]=G.optionTextColorHover,$["--n-option-text-color-active"]=G.optionTextColorActive,$["--n-option-text-color-child-active"]=G.optionTextColorChildActive,$["--n-prefix-color"]=G.prefixColor,$["--n-suffix-color"]=G.suffixColor,$["--n-group-header-text-color"]=G.groupHeaderTextColor),$}),ie=p?Il("dropdown",b.computed(()=>`${t.size[0]}${t.inverted?"i":""}`),U,t):void 0;return{mergedClsPrefix:f,mergedTheme:h,tmNodes:o,mergedShow:n,handleAfterLeave:()=>{t.animated&&g()},doUpdateShow:y,cssVars:p?void 0:U,themeClass:ie?.themeClass,onRender:ie?.onRender}},render(){const t=(r,o,i,s,a)=>{var l;const{mergedClsPrefix:c,menuProps:u}=this;(l=this.onRender)===null||l===void 0||l.call(this);const d=u?.(void 0,this.tmNodes.map(p=>p.rawNode))||{},f={ref:PF(o),class:[r,`${c}-dropdown`,this.themeClass],clsPrefix:c,tmNodes:this.tmNodes,style:[...i,this.cssVars],showArrow:this.showArrow,arrowStyle:this.arrowStyle,scrollable:this.scrollable,onMouseenter:s,onMouseleave:a};return b.h(Nk,b.mergeProps(this.$attrs,f,d))},{mergedTheme:e}=this,n={show:this.mergedShow,theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,internalOnAfterLeave:this.handleAfterLeave,internalRenderBody:t,onUpdateShow:this.doUpdateShow,"onUpdate:show":void 0};return b.h(Ok,Object.assign({},nk(this.$props,Yz),n),{trigger:()=>{var r,o;return(o=(r=this.$slots).default)===null||o===void 0?void 0:o.call(r)}})}});function e9(t){const{heightSmall:e,heightMedium:n,heightLarge:r,borderRadius:o}=t;return{color:"#eee",colorEnd:"#ddd",borderRadius:o,heightSmall:e,heightMedium:n,heightLarge:r}}const t9={common:pi,self:e9},n9=ze([Xe("skeleton",`
397
- height: 1em;
398
- width: 100%;
399
- transition:
400
- --n-color-start .3s var(--n-bezier),
401
- --n-color-end .3s var(--n-bezier),
402
- background-color .3s var(--n-bezier);
403
- animation: 2s skeleton-loading infinite cubic-bezier(0.36, 0, 0.64, 1);
404
- background-color: var(--n-color-start);
405
- `),ze("@keyframes skeleton-loading",`
406
- 0% {
407
- background: var(--n-color-start);
408
- }
409
- 40% {
410
- background: var(--n-color-end);
411
- }
412
- 80% {
413
- background: var(--n-color-start);
414
- }
415
- 100% {
416
- background: var(--n-color-start);
417
- }
418
- `)]),r9=Object.assign(Object.assign({},Yt.props),{text:Boolean,round:Boolean,circle:Boolean,height:[String,Number],width:[String,Number],size:String,repeat:{type:Number,default:1},animated:{type:Boolean,default:!0},sharp:{type:Boolean,default:!0}}),Cn=b.defineComponent({name:"Skeleton",inheritAttrs:!1,props:r9,setup(t){W8();const{mergedClsPrefixRef:e}=di(t),n=Yt("Skeleton","-skeleton",n9,t9,t,e);return{mergedClsPrefix:e,style:b.computed(()=>{var r,o;const i=n.value,{common:{cubicBezierEaseInOut:s}}=i,a=i.self,{color:l,colorEnd:c,borderRadius:u}=a;let d;const{circle:f,sharp:p,round:h,width:m,height:y,size:g,text:x,animated:k}=t;g!==void 0&&(d=a[hr("height",g)]);const w=f?(r=m??y)!==null&&r!==void 0?r:d:m,T=(o=f?m??y:y)!==null&&o!==void 0?o:d;return{display:x?"inline-block":"",verticalAlign:x?"-0.125em":"",borderRadius:f?"50%":h?"4096px":p?"":u,width:typeof w=="number"?sb(w):w,height:typeof T=="number"?sb(T):T,animation:k?"":"none","--n-bezier":s,"--n-color-start":l,"--n-color-end":c}})}},render(){const{repeat:t,style:e,mergedClsPrefix:n,$attrs:r}=this,o=b.h("div",b.mergeProps({class:`${n}-skeleton`,style:e},r));return t>1?b.h(b.Fragment,null,T8(t,null).map(i=>[o,`
419
- `])):o}}),o9={key:0},i9={key:0},s9={__name:"ButtonGroup",props:{toolbarItems:{type:Array,required:!0},overflowItems:{type:Array,default:()=>[]},position:{type:String,default:"left"}},emits:["command"],setup(t,{emit:e}){const n=e,r=t,o=b.ref(null),i=window.matchMedia("(max-width: 768px)").matches,s={left:{minWidth:"140px",justifyContent:"flex-start"},right:{minWidth:"140px",justifyContent:"flex-end"},default:{flexGrow:i?0:1,justifyContent:"center"}},a=b.computed(()=>s[r.position]||s.default),l=g=>g.type==="button",c=g=>g.type==="dropdown",u=g=>g.type==="separator",d=g=>g.type==="overflow",f=(g,x=null)=>{o.value=g,o.value.expand=!0,!g.disabled.value&&n("command",{item:g,argument:x})},p=(g,x)=>{g.disabled.value||(o.value=null,n("command",{item:g,argument:x}))},h=()=>{o.value&&(o.value.expand=!1,o.value=null)},m=(g,x)=>{h(),n("command",{item:g,argument:x.label})},y=g=>{h()};return(g,x)=>(b.openBlock(),b.createElementBlock("div",{style:b.normalizeStyle(a.value),class:"button-group"},[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.toolbarItems,k=>(b.openBlock(),b.createElementBlock("div",{key:k.id.value,class:b.normalizeClass([{narrow:k.isNarrow.value,wide:k.isWide.value},"toolbar-item-ctn"])},[u(k)?(b.openBlock(),b.createBlock(RI,{key:0,style:{width:"20px"}})):b.createCommentVNode("",!0),c(k)&&k.nestedOptions?.value?.length?(b.openBlock(),b.createBlock(b.unref(Qz),{key:1,options:k.nestedOptions.value,trigger:k.disabled.value?null:"click",show:k.expand.value,size:"medium",placement:"bottom-start",class:"toolbar-button toolbar-dropdown",onSelect:(w,T)=>m(k,T),onClickoutside:y},{default:b.withCtx(()=>[b.createVNode(qd,{"toolbar-item":k,onTextSubmit:w=>p(k,w),onButtonClick:w=>f(k)},null,8,["toolbar-item","onTextSubmit","onButtonClick"])]),_:2},1032,["options","trigger","show","onSelect"])):l(k)?(b.openBlock(),b.createBlock(b.unref(Lz),{key:2,trigger:"hover"},{trigger:b.withCtx(()=>[b.createVNode(qd,{"toolbar-item":k,onTextSubmit:w=>p(k,w),onButtonClick:w=>f(k)},null,8,["toolbar-item","onTextSubmit","onButtonClick"])]),default:b.withCtx(()=>[k.tooltip?(b.openBlock(),b.createElementBlock("div",o9,[b.createTextVNode(b.toDisplayString(k.tooltip)+" ",1),k.disabled.value?(b.openBlock(),b.createElementBlock("span",i9,"(disabled)")):b.createCommentVNode("",!0)])):b.createCommentVNode("",!0)]),_:2},1024)):b.createCommentVNode("",!0),d(k)&&t.overflowItems.length?(b.openBlock(),b.createBlock(qI,{key:3,"toolbar-item":k,"overflow-items":t.overflowItems},null,8,["toolbar-item","overflow-items"])):b.createCommentVNode("",!0)],2))),128))],4))}},Da=vt(s9,[["__scopeId","data-v-4b88ec39"]]),a9={__name:"Toolbar",emits:["command","toggle","select"],setup(t,{emit:e}){const{proxy:n}=b.getCurrentInstance();let r=b.ref(1);const o=n.$toolbar.config?.toolbarGroups?.includes("left"),i=n.$toolbar.config?.toolbarGroups?.includes("right"),s=n.$toolbar.config?.toolbarButtonsExclude||[],a=u=>n.$toolbar.getToolbarItemByGroup(u).filter(d=>!s.includes(d.name.value));b.onMounted(()=>{window.addEventListener("resize",l)}),b.onDeactivated(()=>{window.removeEventListener("resize",l)});const l=PN(async()=>{await n.$toolbar.onToolbarResize(),r.value+=1},300),c=({item:u,argument:d})=>{n.$toolbar.emitCommand({item:u,argument:d})};return(u,d)=>(b.openBlock(),b.createElementBlock("div",{class:"superdoc-toolbar",key:b.unref(r)},[b.unref(o)?(b.openBlock(),b.createBlock(Da,{key:0,"toolbar-items":a("left"),position:"left",onCommand:c,class:"superdoc-toolbar-group-side"},null,8,["toolbar-items"])):b.createCommentVNode("",!0),b.createVNode(Da,{"toolbar-items":a("center"),"overflow-items":b.unref(n).$toolbar.overflowItems,position:"center",onCommand:c},null,8,["toolbar-items","overflow-items"]),b.unref(i)?(b.openBlock(),b.createBlock(Da,{key:1,"toolbar-items":a("right"),position:"right",onCommand:c,class:"superdoc-toolbar-group-side"},null,8,["toolbar-items"])):b.createCommentVNode("",!0)]))}},Ik=vt(a9,[["__scopeId","data-v-4b88e275"]]);async function l9(t,e){const n=new Qu;return t.forEach((r,o)=>{n.file(e[o],r)}),await n.generateAsync({type:"blob"})}var c9=Object.defineProperty,Fk=t=>{throw TypeError(t)},u9=(t,e,n)=>e in t?c9(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,c0=(t,e,n)=>u9(t,typeof e!="symbol"?e+"":e,n),Bk=(t,e,n)=>e.has(t)||Fk("Cannot "+n),Fu=(t,e,n)=>(Bk(t,e,"read from private field"),n?n.call(t):e.get(t)),u0=(t,e,n)=>e.has(t)?Fk("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Zt=(t,e,n)=>(Bk(t,e,"access private method"),n),Rk={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function o(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function i(l,c,u,d,f){if(typeof u!="function")throw new TypeError("The listener must be a function");var p=new o(u,d||l,f),h=n?n+c:c;return l._events[h]?l._events[h].fn?l._events[h]=[l._events[h],p]:l._events[h].push(p):(l._events[h]=p,l._eventsCount++),l}function s(l,c){--l._eventsCount===0?l._events=new r:delete l._events[c]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],c,u;if(this._eventsCount===0)return l;for(u in c=this._events)e.call(c,u)&&l.push(n?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},a.prototype.listeners=function(l){var c=n?n+l:l,u=this._events[c];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,f=u.length,p=new Array(f);d<f;d++)p[d]=u[d].fn;return p},a.prototype.listenerCount=function(l){var c=n?n+l:l,u=this._events[c];return u?u.fn?1:u.length:0},a.prototype.emit=function(l,c,u,d,f,p){var h=n?n+l:l;if(!this._events[h])return!1;var m=this._events[h],y=arguments.length,g,x;if(m.fn){switch(m.once&&this.removeListener(l,m.fn,void 0,!0),y){case 1:return m.fn.call(m.context),!0;case 2:return m.fn.call(m.context,c),!0;case 3:return m.fn.call(m.context,c,u),!0;case 4:return m.fn.call(m.context,c,u,d),!0;case 5:return m.fn.call(m.context,c,u,d,f),!0;case 6:return m.fn.call(m.context,c,u,d,f,p),!0}for(x=1,g=new Array(y-1);x<y;x++)g[x-1]=arguments[x];m.fn.apply(m.context,g)}else{var k=m.length,w;for(x=0;x<k;x++)switch(m[x].once&&this.removeListener(l,m[x].fn,void 0,!0),y){case 1:m[x].fn.call(m[x].context);break;case 2:m[x].fn.call(m[x].context,c);break;case 3:m[x].fn.call(m[x].context,c,u);break;case 4:m[x].fn.call(m[x].context,c,u,d);break;default:if(!g)for(w=1,g=new Array(y-1);w<y;w++)g[w-1]=arguments[w];m[x].fn.apply(m[x].context,g)}}return!0},a.prototype.on=function(l,c,u){return i(this,l,c,u,!1)},a.prototype.once=function(l,c,u){return i(this,l,c,u,!0)},a.prototype.removeListener=function(l,c,u,d){var f=n?n+l:l;if(!this._events[f])return this;if(!c)return s(this,f),this;var p=this._events[f];if(p.fn)p.fn===c&&(!d||p.once)&&(!u||p.context===u)&&s(this,f);else{for(var h=0,m=[],y=p.length;h<y;h++)(p[h].fn!==c||d&&!p[h].once||u&&p[h].context!==u)&&m.push(p[h]);m.length?this._events[f]=m.length===1?m[0]:m:s(this,f)}return this},a.prototype.removeAllListeners=function(l){var c;return l?(c=n?n+l:l,this._events[c]&&s(this,c)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a})(Rk);var d9=Rk.exports;const f9=ml(d9);function p9(t){let e=t;for(;e;){const n=window.getComputedStyle(e).overflowY;if(/(auto|scroll)/.test(n)&&e.scrollHeight>e.clientHeight)return e;e=e.parentElement}return document.scrollingElement||document.documentElement}function h9(t,e={behavior:"smooth",block:"start"}){if(!t)return;const n=p9(t),r=n.getBoundingClientRect(),o=t.getBoundingClientRect().top-r.top+n.scrollTop;n.scrollTo({top:e.block==="start"?o:o-n.clientHeight+t.offsetHeight,behavior:e.behavior})}const Ve=t=>{if(!["button","options","separator","dropdown","overflow"].includes(t.type))throw new Error("Invalid toolbar item type - "+t.type);if(t.type==="button"&&!t.defaultLabel&&!t.icon)throw new Error("Toolbar button item needs either icon or label - "+t.name);if(!t.name)throw new Error("Invalid toolbar item name - "+t.name);const e=b.ref(mo()),n=t.type,r=b.ref(t.name),o=t.command,i=b.ref(t.icon),s=b.ref(t.group||"center"),a=b.ref(t.allowWithoutEditor),l=b.ref(t.attributes||{}),c=t.disabled||!1,u=b.ref(t.disabled),d=b.ref(!1),f=b.ref(!1),p=b.ref(t.style),h=b.ref(t.isNarrow),m=b.ref(t.isWide),y=b.ref(t.minWidth),g=b.ref(t.suppressActiveHighlight||!1),x=b.ref(t.argument),k=b.ref(null),w=b.ref(null),T=b.ref(t.iconColor),D=b.ref(t.hasCaret),M=b.ref(t.tooltip),F=b.ref(t.tooltipVisible),C=b.ref(t.tooltipTimeout),U=b.ref(t.defaultLabel),ie=b.ref(t.label),I=b.ref(t.hideLabel),W=b.ref(t.inlineTextInputVisible),A=b.ref(t.hasInlineTextInput),G=b.ref(t.markName),ae=b.ref(t.labelAttr),X=b.ref([]);if(t.options){if(!Array.isArray(t.options))throw new Error("Invalid toolbar item options - "+t.options);X.value.push(...t.options)}const de=K=>{B(K),!g.value&&(d.value=!0)},J=()=>{ee(),d.value=!1},pe=K=>{u.value=K},Q=()=>{u.value=c},B=t.onActivate||(()=>null),ee=t.onDeactivate||(()=>null),Z=()=>{const K={};return Object.keys(re).forEach($=>{re[$].value!==void 0&&(K[$]=re[$].value)}),K},re={id:e,name:r,type:n,command:o,icon:i,tooltip:M,group:s,attributes:l,disabled:u,active:d,expand:f,nestedOptions:X,style:p,isNarrow:h,isWide:m,minWidth:y,argument:x,parentItem:w,iconColor:T,hasCaret:D,tooltipVisible:F,tooltipTimeout:C,defaultLabel:U,label:ie,hideLabel:I,inlineTextInputVisible:W,hasInlineTextInput:A,markName:G,labelAttr:ae,childItem:k,allowWithoutEditor:a};return{...re,unref:Z,activate:de,deactivate:J,setDisabled:pe,resetDisabled:Q,onActivate:B,onDeactivate:ee}},m9={class:"alignment-buttons"},g9=["innerHTML"],y9=["innerHTML"],b9=["innerHTML"],w9=["innerHTML"],v9={__name:"AlignmentButtons",emits:["select"],setup(t,{emit:e}){const n=e,r=o=>{n("select",o)};return(o,i)=>(b.openBlock(),b.createElementBlock("div",m9,[b.createBaseVNode("div",{class:"button-icon",onClick:i[0]||(i[0]=s=>r("left")),innerHTML:b.unref(rn).alignLeft},null,8,g9),b.createBaseVNode("div",{class:"button-icon",onClick:i[1]||(i[1]=s=>r("center")),innerHTML:b.unref(rn).alignCenter},null,8,y9),b.createBaseVNode("div",{class:"button-icon",onClick:i[2]||(i[2]=s=>r("right")),innerHTML:b.unref(rn).alignRight},null,8,b9),b.createBaseVNode("div",{class:"button-icon",onClick:i[3]||(i[3]=s=>r("justify")),innerHTML:b.unref(rn).alignJustify},null,8,w9)]))}},x9=vt(v9,[["__scopeId","data-v-d6fae878"]]),k9={class:"link-input-ctn"},S9={key:0,class:"link-title"},C9={key:1,class:"link-title"},E9={key:2,class:"link-title"},A9={key:3},$9={class:"input-row"},T9=["innerHTML"],O9=["onKeydown"],D9=["innerHTML"],M9={class:"input-row link-buttons"},_9=["innerHTML"],N9={key:4,class:"input-row go-to-anchor clickable"},I9={__name:"LinkInput",props:{initialText:{type:String,default:""},href:{type:String,default:""},showInput:{type:Boolean,default:!0},showLink:{type:Boolean,default:!0},goToAnchor:{type:Function,default:()=>{}}},emits:["submit","cancel"],setup(t,{emit:e}){const n=e,r=t,{proxy:o}=b.getCurrentInstance(),i=()=>{if(o?.$submit instanceof Function&&o.$submit(),c.value&&d.value){n("submit",{text:l.value,href:u.value});return}else if(!c.value){n("submit",{text:l.value,href:null});return}console.debug("[LinkInput] Invalid URL in handleSubmit"),a.value=!0},s=()=>{n("submit",{text:l.value,href:null})},a=b.ref(!1),l=b.ref(r.initialText),c=b.ref(r.href),u=b.computed(()=>c.value?.startsWith("http")?c.value:"http://"+c.value),d=b.computed(()=>{const k=u.value.split(".").filter(Boolean);return u.value.includes(".")&&k.length>1}),f=b.computed(()=>h.value?"Apply":"Remove"),p=b.computed(()=>!d.value),h=b.computed(()=>!m.value),m=b.computed(()=>r.href&&!c.value),y=b.computed(()=>r.href.startsWith("#")),g=()=>{window.open(u.value,"_blank")};b.watch(()=>r.href,k=>{c.value=k});const x=()=>{const k=document.querySelector(".link-input-ctn input");k&&k.focus()};return b.onMounted(()=>{r.showInput&&x()}),(k,w)=>(b.openBlock(),b.createElementBlock("div",k9,[t.href?y.value?(b.openBlock(),b.createElementBlock("div",C9,"Page anchor")):(b.openBlock(),b.createElementBlock("div",E9,"Edit link")):(b.openBlock(),b.createElementBlock("div",S9,"Add link")),t.showInput&&!y.value?(b.openBlock(),b.createElementBlock("div",A9,[b.createBaseVNode("div",$9,[b.createBaseVNode("div",{class:"input-icon",innerHTML:b.unref(rn).linkInput},null,8,T9),b.withDirectives(b.createBaseVNode("input",{type:"text",placeholder:"Type or paste a link",class:b.normalizeClass({error:a.value}),"onUpdate:modelValue":w[0]||(w[0]=T=>c.value=T),onKeydown:[b.withKeys(b.withModifiers(i,["stop","prevent"]),["enter"]),w[1]||(w[1]=T=>a.value=!1)]},null,42,O9),[[b.vModelText,c.value]]),b.createBaseVNode("div",{class:b.normalizeClass(["open-link-icon",{disabled:!d.value}]),innerHTML:b.unref(rn).openLink,onClick:g},null,10,D9)]),b.createBaseVNode("div",M9,[t.href?(b.openBlock(),b.createElementBlock("button",{key:0,class:"remove-btn",onClick:s},[b.createBaseVNode("div",{class:"remove-btn__icon",innerHTML:b.unref(rn).removeLink},null,8,_9),w[3]||(w[3]=b.createTextVNode(" Remove "))])):b.createCommentVNode("",!0),h.value?(b.openBlock(),b.createElementBlock("button",{key:1,class:b.normalizeClass(["submit-btn",{"disable-btn":p.value}]),onClick:i},b.toDisplayString(f.value),3)):b.createCommentVNode("",!0)])])):y.value?(b.openBlock(),b.createElementBlock("div",N9,[b.createBaseVNode("a",{onClick:w[2]||(w[2]=b.withModifiers((...T)=>t.goToAnchor&&t.goToAnchor(...T),["stop","prevent"]))},"Go to "+b.toDisplayString(t.href.startsWith("#_")?t.href.substring(2):t.href),1)])):b.createCommentVNode("",!0)]))}},F9=vt(I9,[["__scopeId","data-v-6990d5b2"]]),B9={class:"document-mode"},R9=["onClick"],L9={class:"document-mode-column icon-column"},P9=["innerHTML"],z9={class:"document-mode-column text-column"},j9={class:"document-mode-type"},q9={class:"document-mode-description"},V9={__name:"DocumentMode",props:{options:{type:Array}},emits:["select"],setup(t,{emit:e}){const n=e,r=o=>{n("select",o)};return(o,i)=>(b.openBlock(),b.createElementBlock("div",B9,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.options,s=>(b.openBlock(),b.createElementBlock("div",{class:b.normalizeClass(["option-item",{disabled:s.disabled}]),onClick:a=>r(s)},[b.createBaseVNode("div",L9,[b.createBaseVNode("div",{class:"icon-column__icon",innerHTML:s.icon},null,8,P9)]),b.createBaseVNode("div",z9,[b.createBaseVNode("div",j9,b.toDisplayString(s.label),1),b.createBaseVNode("div",q9,b.toDisplayString(s.description),1)])],10,R9))),256))]))}},U9=vt(V9,[["__scopeId","data-v-f86e1477"]]),H9={key:0,class:"linked-style-buttons"},W9=["onClick"],G9={__name:"LinkedStyle",props:{editor:{type:Object,required:!0}},emits:["select"],setup(t,{emit:e}){const n=e,r=t,o=i=>{n("select",i)};return(i,s)=>r.editor?(b.openBlock(),b.createElementBlock("div",H9,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(b.unref(x2)(t.editor),a=>(b.openBlock(),b.createElementBlock("div",{class:"style-item",onClick:l=>o(a)},[b.createBaseVNode("div",{class:"style-name",style:b.normalizeStyle(b.unref(v2)(a,null,!1))},b.toDisplayString(a.definition.attrs.name),5)],8,W9))),256))])):b.createCommentVNode("",!0)}},K9=vt(G9,[["__scopeId","data-v-97e3296a"]]),X9=["onClick"],J9=["innerHTML"],Y9=["innerHTML"],Z9={__name:"IconGridRow",props:{icons:{type:Array,required:!0},activeColor:{type:Object,required:!1}},emits:["select"],setup(t,{emit:e}){const n=e,r=t,o=b.computed(()=>a=>r.activeColor.value?r.activeColor.value.toUpperCase()===a.value:!1),i=(a,l)=>l===5||["#FFFFFF","#FAFF09"].includes(a)?{color:"#000"}:{color:"#FFF"},s=a=>{n("select",a.value)};return b.onMounted(()=>{if(!r.icons.every(a=>Array.isArray(a)))throw new Error("icon props must be 2d array")}),(a,l)=>(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.icons,(c,u)=>(b.openBlock(),b.createElementBlock("div",{class:"option-row",key:u},[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(c,(d,f)=>(b.openBlock(),b.createElementBlock("div",{class:"option",key:f,onClick:b.withModifiers(p=>s(d),["stop","prevent"])},[b.createBaseVNode("div",{class:"option__icon",innerHTML:d.icon,style:b.normalizeStyle(d.style)},null,12,J9),o.value(d)?(b.openBlock(),b.createElementBlock("div",{key:0,class:"option__check",innerHTML:b.unref(rn).colorOptionCheck,style:b.normalizeStyle(i(d.value,f))},null,12,Y9)):b.createCommentVNode("",!0)],8,X9))),128))]))),128))}},d0=vt(Z9,[["__scopeId","data-v-6a2a9a40"]]),Q9={class:"option-grid-ctn"},e7={__name:"IconGrid",props:{icons:{type:Array,required:!0},customIcons:{type:Array,required:!1},activeColor:{type:Object,required:!1}},emits:["select","clickoutside"],setup(t,{emit:e}){const n=e,r=o=>{n("select",o)};return(o,i)=>(b.openBlock(),b.createElementBlock("div",Q9,[b.createVNode(d0,{icons:t.icons,"active-color":t.activeColor,onSelect:r},null,8,["icons","active-color"]),t.customIcons.flat().length?(b.openBlock(),b.createElementBlock(b.Fragment,{key:0},[i[0]||(i[0]=b.createBaseVNode("span",{class:"option-grid-ctn__subtitle"},"Custom colors",-1)),b.createVNode(d0,{icons:t.customIcons,"active-color":t.activeColor,onSelect:r},null,8,["icons","active-color"])],64)):b.createCommentVNode("",!0)]))}},t7=vt(e7,[["__scopeId","data-v-fa2949d8"]]),n7=t=>{t.expand.value=!1},Ee=(t,e=null)=>({label:e,icon:rn.colorOption,value:t,style:{color:t,boxShadow:"0 0 5px 1px rgba(0, 0, 0, 0.1)",borderRadius:"50%"}}),sf=(t,e,n=[])=>{const r=o=>{e.iconColor.value=o,t.emitCommand({item:e,argument:o}),n7(e)};return b.h("div",{},[b.h(t7,{icons:Lk,customIcons:n,activeColor:e.iconColor,onSelect:r})])},Lk=[[Ee("#111111"),Ee("#333333"),Ee("#5C5C5C"),Ee("#858585"),Ee("#ADADAD"),Ee("#D6D6D6"),Ee("#FFFFFF")],[Ee("#860028"),Ee("#D2003F"),Ee("#DB3365"),Ee("#E4668C"),Ee("#ED99B2"),Ee("#F6CCD9"),Ee("#FF004D")],[Ee("#83015E"),Ee("#CD0194"),Ee("#D734A9"),Ee("#E167BF"),Ee("#EB99D4"),Ee("#F5CCEA"),Ee("#FF00A8")],[Ee("#8E220A"),Ee("#DD340F"),Ee("#E45C3F"),Ee("#EB856F"),Ee("#F1AE9F"),Ee("#F8D6CF"),Ee("#FF7A00")],[Ee("#947D02"),Ee("#E7C302"),Ee("#ECCF35"),Ee("#F1DB67"),Ee("#F5E79A"),Ee("#FAF3CC"),Ee("#FAFF09")],[Ee("#055432"),Ee("#07834F"),Ee("#399C72"),Ee("#6AB595"),Ee("#9CCDB9"),Ee("#CDE6DC"),Ee("#05F38F")],[Ee("#063E7E"),Ee("#0A60C5"),Ee("#3B80D1"),Ee("#6CA0DC"),Ee("#9DBFE8"),Ee("#CEDFF3"),Ee("#00E0FF")],[Ee("#3E027A"),Ee("#6103BF"),Ee("#8136CC"),Ee("#A068D9"),Ee("#C09AE6"),Ee("#DFCDF2"),Ee("#A91DFF")]],r7=()=>Lk.flat().map(t=>t.value),o7={class:"toolbar-table-grid-wrapper"},i7=["data-cols","data-rows","onClick"],s7={class:"toolbar-table-grid-value"},a7={__name:"TableGrid",emits:["select","clickoutside"],setup(t,{emit:e}){const n=e,r=b.ref(0),o=b.ref(0),i=a=>{let l=a.target;if(l.dataset.grid)return;let c=[...l.parentElement.querySelectorAll("[data-item]")],u=parseInt(l.dataset.cols,10),d=parseInt(l.dataset.rows,10);o.value=u,r.value=d;for(let f=0;f<c.length;f++){let p=c[f],h=parseInt(p.dataset.cols,10),m=parseInt(p.dataset.rows,10);h<=u&&m<=d?p.classList.add("selected"):p.classList.remove("selected")}},s=({cols:a,rows:l})=>{n("select",{cols:a,rows:l})};return(a,l)=>(b.openBlock(),b.createElementBlock("div",o7,[b.createBaseVNode("div",{class:"toolbar-table-grid",onMouseover:i,"data-grid":"true"},[(b.openBlock(),b.createElementBlock(b.Fragment,null,b.renderList(5,c=>(b.openBlock(),b.createElementBlock(b.Fragment,{key:c},[(b.openBlock(),b.createElementBlock(b.Fragment,null,b.renderList(5,u=>b.createBaseVNode("div",{class:"toolbar-table-grid__item",key:`${c}_${u}`,"data-cols":u,"data-rows":c,"data-item":"true",onClick:b.withModifiers(d=>s({cols:u,rows:c}),["stop","prevent"])},null,8,i7)),64))],64))),64))],32),b.createBaseVNode("div",s7,b.toDisplayString(r.value)+" x "+b.toDisplayString(o.value),1)]))}},l7=vt(a7,[["__scopeId","data-v-06352ab9"]]),c7={class:"toolbar-table-actions"},u7=["onClick"],d7={class:"toolbar-table-actions__icon"},f7=["innerHTML"],p7={class:"toolbar-table-actions__label"},h7={__name:"TableActions",props:{options:{type:Array}},emits:["select"],setup(t,{emit:e}){const n=e,r=o=>{n("select",{command:o.command})};return(o,i)=>(b.openBlock(),b.createElementBlock("div",c7,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(t.options,s=>(b.openBlock(),b.createElementBlock("div",{class:b.normalizeClass(["toolbar-table-actions__item",{"toolbar-table-actions__item--border":s.bottomBorder}]),onClick:a=>r(s)},[b.createBaseVNode("div",d7,[b.createBaseVNode("div",{class:"toolbar-table-actions__icon-wrapper",innerHTML:s.icon},null,8,f7)]),b.createBaseVNode("div",p7,b.toDisplayString(s.label),1)],10,u7))),256))]))}},m7=vt(h7,[["__scopeId","data-v-9a702d7f"]]),Br=t=>{t.expand.value=!1},g7=(t,e=!1,n,r,o)=>{const i=Ve({type:"button",name:"bold",command:"toggleBold",icon:o.bold,tooltip:"Bold"}),s=Ve({type:"dropdown",name:"fontFamily",tooltip:"Font",command:"setFontFamily",defaultLabel:"Arial",label:"Arial",markName:"textStyle",labelAttr:"fontFamily",hasCaret:!0,isWide:!0,style:{width:"116px"},suppressActiveHighlight:!0,options:[{label:"Georgia",key:"Georgia, serif",fontWeight:400,props:{style:{fontFamily:"Georgia, serif"}}},{label:"Arial",key:"Arial, sans-serif",fontWeight:400,props:{style:{fontFamily:"Arial, sans-serif"}}},{label:"Courier New",key:"Courier New, monospace",fontWeight:400,props:{style:{fontFamily:"Courier New, monospace"}}},{label:"Times New Roman",key:"Times New Roman, serif",fontWeight:400,props:{style:{fontFamily:"Times New Roman, serif"}}}],onActivate:({fontFamily:ce})=>{ce&&(s.label.value=ce)},onDeactivate:()=>s.label.value=s.defaultLabel.value}),a=Ve({type:"dropdown",name:"fontSize",defaultLabel:"12",label:"12",minWidth:"50px",markName:"textStyle",labelAttr:"fontSize",tooltip:"Font size",hasCaret:!0,hasInlineTextInput:!1,inlineTextInputVisible:!0,suppressActiveHighlight:!0,isWide:!0,command:"setFontSize",options:[{label:"8",key:"8pt"},{label:"9",key:"9pt"},{label:"10",key:"10pt"},{label:"11",key:"11pt"},{label:"12",key:"12pt"},{label:"14",key:"14pt"},{label:"18",key:"18pt"},{label:"24",key:"24pt"},{label:"30",key:"30pt"},{label:"36",key:"36pt"},{label:"48",key:"48pt"},{label:"60",key:"60pt"},{label:"72",key:"72pt"},{label:"96",key:"96pt"}],onActivate:({fontSize:ce})=>{if(!ce)return a.label.value=a.defaultLabel.value;let ue=LN(ce,12);ue<8&&(ue=8),ue>96&&(ue=96),a.label.value=String(ue)},onDeactivate:()=>a.label.value=a.defaultLabel.value}),l=Ve({type:"separator",name:"separator",isNarrow:!0}),c=Ve({type:"button",name:"italic",command:"toggleItalic",icon:o.italic,tooltip:"Italic"}),u=Ve({type:"button",name:"underline",command:"toggleUnderline",icon:o.underline,tooltip:"Underline"}),d=Ve({type:"dropdown",name:"highlight",icon:o.highlight,hideLabel:!0,markName:"highlight",labelAttr:"color",tooltip:"Highlight color",command:"setHighlight",suppressActiveHighlight:!0,options:[{key:"color",type:"render",render:()=>sf(t,d)}],onActivate:({color:ce})=>{d.iconColor.value=ce||""},onDeactivate:()=>d.iconColor.value=""}),f=Ve({type:"dropdown",name:"color",icon:o.color,hideLabel:!0,markName:"textStyle",labelAttr:"color",tooltip:"Text color",command:"setColor",suppressActiveHighlight:!0,options:[{key:"color",type:"render",render:()=>sf(t,f)}],onActivate:({color:ce})=>{f.iconColor.value=ce},onDeactivate:()=>f.iconColor.value="#000"}),p=Ve({type:"dropdown",name:"link",markName:"link",icon:o.link,tooltip:"Link",options:[{type:"render",key:"linkDropdown",render:()=>h(p)}],onActivate:({href:ce})=>{ce?p.attributes.value={href:ce}:p.attributes.value={},p.expand.value=!0},onDeactivate:()=>{p.attributes.value={},p.expand.value=!1}});function h(ce){return b.h("div",{},[b.h(F9,{onSubmit:({href:ue})=>{Br(ce),ce.attributes.value.link={href:ue};const we={...ce,command:"toggleLink"};t.emitCommand({item:we,argument:{href:ue,text:""}}),ue||(ce.active.value=!1)},href:ce.attributes.value.href,goToAnchor:()=>{if(Br(ce),!t.activeEditor||!ce.attributes.value?.href)return;const ue=ce.attributes.value?.href?.slice(1),we=t.activeEditor.element.querySelector(`a[name='${ue}']`);we&&h9(we)}})])}const m=Ve({type:"options",name:"linkInput",command:"toggleLink"});p.childItem=m,m.parentItem=p;const y=Ve({type:"button",name:"image",command:"startImageUpload",icon:o.image,tooltip:"Image",disabled:!1}),g=Ve({type:"dropdown",name:"table",icon:o.table,hideLabel:!0,labelAttr:"table",tooltip:"Insert table",command:"insertTable",suppressActiveHighlight:!0,options:[{key:"table",type:"render",render:()=>x(g)}]});function x(ce){return b.h("div",{},[b.h(l7,{onSelect:ue=>{t.emitCommand({item:ce,argument:ue}),Br(ce)}})])}const k=Ve({type:"dropdown",name:"tableActions",command:"executeTableCommand",icon:o.tableActions,hideLabel:!0,disabled:!0,options:[{type:"render",render:()=>T(k)}]}),w=[{label:"Insert row above",command:"addRowBefore",icon:o.addRowBefore},{label:"Insert row below",command:"addRowAfter",icon:o.addRowAfter},{label:"Insert column left",command:"addColumnBefore",icon:o.addColumnBefore},{label:"Insert column right",command:"addColumnAfter",icon:o.addColumnAfter,bottomBorder:!0},{label:"Delete row",command:"deleteRow",icon:o.deleteRow},{label:"Delete column",command:"deleteColumn",icon:o.deleteColumn},{label:"Delete table",command:"deleteTable",icon:o.deleteTable},{label:"Transparent borders",command:"deleteCellAndTableBorders",icon:o.deleteBorders,bottomBorder:!0},{label:"Merge cells",command:"mergeCells",icon:o.mergeCells},{label:"Split cell",command:"splitCell",icon:o.splitCell},{label:"Fix tables",command:"fixTables",icon:o.fixTables}];function T(ce){return b.h(m7,{options:w,onSelect:ue=>{Br(ce);const{command:we}=ue;t.emitCommand({item:ce,argument:{command:we}})}})}const D=Ve({type:"dropdown",name:"textAlign",tooltip:"Alignment",icon:o.alignLeft,command:"setTextAlign",hasCaret:!0,markName:"textAlign",labelAttr:"textAlign",suppressActiveHighlight:!0,options:[{type:"render",render:()=>b.h("div",{},[b.h(x9,{onSelect:ce=>{Br(D);const ue={...D,command:"setTextAlign"};ue.command="setTextAlign",t.emitCommand({item:ue,argument:ce}),M(D,ce)}})]),key:"alignment"}],onActivate:({textAlign:ce})=>{M(D,ce)},onDeactivate:()=>{M(D,"left")}}),M=(ce,ue)=>{let we=ue==="both"?"justify":ue,_e={left:o.alignLeft,right:o.alignRight,center:o.alignCenter,justify:o.alignJustify},Ce=_e[we]??_e.left;ce.icon.value=Ce},F=Ve({type:"button",name:"list",command:"toggleBulletList",icon:o.bulletList,tooltip:"Bullet list"}),C=Ve({type:"button",name:"numberedlist",command:"toggleOrderedList",icon:o.numberedList,tooltip:"Numbered list"}),U=Ve({type:"button",name:"indentleft",command:"decreaseTextIndent",icon:o.indentLeft,tooltip:"Left indent",disabled:!1}),ie=Ve({type:"button",name:"indentright",command:"increaseTextIndent",icon:o.indentRight,tooltip:"Right indent",disabled:!1}),I=Ve({type:"overflow",name:"overflow",command:"toggleOverflow",icon:o.overflow,disabled:!1}),W=Ve({type:"dropdown",name:"zoom",allowWithoutEditor:!0,tooltip:"Zoom",defaultLabel:"100%",label:"100%",hasCaret:!0,command:"setZoom",isWide:!0,inlineTextInputVisible:!1,hasInlineTextInput:!0,options:[{label:"50%",key:.5},{label:"75%",key:.75},{label:"90%",key:.9},{label:"100%",key:1},{label:"125%",key:1.25},{label:"150%",key:1.5},{label:"200%",key:2}],onActivate:({zoom:ce})=>{ce&&(W.label.value=ce)}}),A=Ve({type:"button",name:"undo",disabled:!0,tooltip:"Undo",command:"undo",icon:o.undo,group:"left",onDeactivate:()=>{A.disabled.value=!t.undoDepth}}),G=Ve({type:"button",disabled:!0,name:"redo",tooltip:"Redo",command:"redo",icon:o.redo,group:"left",onDeactivate:()=>{G.disabled.value=!t.redoDepth}}),ae=Ve({type:"button",disabled:!1,name:"toggleTrackChanges",tooltip:"Track Changes",command:"toggleTrackChanges",icon:o.trackChanges,group:"left"}),X=Ve({type:"button",disabled:!1,name:"acceptTrackedChangeBySelection",tooltip:"Accept changes under selection",command:"acceptTrackedChangeBySelection",icon:o.trackChangesAccept,group:"left"}),de=Ve({type:"button",disabled:!1,name:"rejectTrackedChangeOnSelection",tooltip:"Reject changes under selection",command:"rejectTrackedChangeOnSelection",icon:o.trackChangesReject,group:"left"}),J=Ve({type:"button",disabled:!1,name:"toggleTrackChangesShowOriginal",tooltip:"Toggle Show Original",command:"toggleTrackChangesShowOriginal",icon:o.trackChangesOriginal,group:"left"}),pe=Ve({type:"button",disabled:!1,name:"toggleTrackChangesShowFinal",tooltip:"Toggle Show Final",command:"toggleTrackChangesShowFinal",icon:o.trackChangesFinal,group:"left"}),Q=Ve({type:"button",name:"clearFormatting",command:"clearFormat",tooltip:"Clear formatting",icon:o.clearFormatting});[i,c,u,ie,U,I].map(ce=>ce.name);const B=Ve({type:"button",name:"copyFormat",tooltip:"Format painter",icon:o.copyFormat,command:"copyFormat"}),ee=(ce,ue)=>ce==="editor"?ue:ce==="suggester"?ue.filter(we=>we.value==="suggesting"):ue.filter(we=>we.value==="viewing"),Z=ce=>ce==="editor"?"Editing":ce==="suggester"?"Suggesting":"Viewing",re=Ve({type:"dropdown",name:"documentMode",command:"setDocumentMode",allowWithoutEditor:!0,icon:o.documentMode,defaultLabel:Z(r),label:Z(r),hasCaret:r==="editor",isWide:!0,style:{display:"flex",justifyContent:"flex-end"},inlineTextInputVisible:!1,hasInlineTextInput:!1,group:"right",disabled:r!=="editor",attributes:{dropdownPosition:"right",className:"toolbar-item--doc-mode"},options:[{type:"render",render:()=>$(re)}]}),K=[{label:"Editing",value:"editing",icon:o.documentEditingMode,description:"Edit document directly"},{label:"Suggesting",value:"suggesting",icon:o.documentSuggestingMode,description:"Edits become suggestions"},{label:"Viewing",value:"viewing",icon:o.documentViewingMode,description:"View clean version of document only"}];function $(ce){const ue=ee(r,K);return b.h(U9,{options:ue,onSelect:we=>{Br(ce);const{label:_e,icon:Ce}=we;re.label.value=_e,re.icon.value=Ce,t.emitCommand({item:re,argument:_e})}})}const E=Ve({type:"button",name:"pageBreakTool",command:"insertPageBreak",icon:o.pageBreak,tooltip:"Insert page break"}),H=new Map([["separator",20],["zoom",71],["fontFamily",118],["fontSize",57],["textAlign",40],["linkedStyles",142],["documentMode",47],["default",32]]),q=Ve({type:"button",name:"ruler",command:"toggleRuler",icon:o.ruler,tooltip:"Show or hide ruler"}),N=Ve({type:"dropdown",name:"linkedStyles",command:"setLinkedStyle",icon:o.paintbrush,defaultLabel:"Format text",label:"Format text",hasCaret:!0,isWide:!0,style:{width:"140px"},suppressActiveHighlight:!0,disabled:!1,attributes:{className:"toolbar-item--linked-styles"},options:[{type:"render",key:"linkedStyle",render:()=>{const ce=ue=>{Br(N);const we={...N,command:"setLinkedStyle"};t.emitCommand({item:we,argument:ue})};return b.h("div",{},[b.h(K9,{editor:t.activeEditor,onSelect:ce})])}}],onActivate:()=>{N.disabled.value=!1},onDeactivate:()=>{N.disabled.value=!0}}),R={sm:768,md:1024,xl:1410},le=120,S=32,oe=["linkedStyles","clearFormatting","copyFormat","ruler"],te=["zoom","fontFamily","fontSize","redo"];let L=[A,G,X,de,W,l,s,l,a,l,i,c,u,f,d,l,p,y,g,k,l,D,F,C,U,ie,l,N,l,E,B,Q,q,I,re];if(n<=R.md&&(L=L.filter(ce=>ce.type!=="separator")),t.config.pagination||(L=L.filter(ce=>ce.name.value!=="pageBreakTool")),t.config.mode!=="docx"){const ce=L.findIndex(ue=>ue.name.value==="linkedStyles");L.splice(ce-1,2),L=L.filter(ue=>ue.name.value!=="ruler")}const z=[ae,J,pe];e||(r==="viewer"&&z.push(X,de),L=L.filter(ce=>!z.includes(ce)));const P=[A,I,re].map(ce=>ce.name),fe=ce=>P.includes(ce.name),me=[],se=[];let ge=S+le;return L.forEach(ce=>{const ue=H.get(ce.name.value)||H.get("default");if(n<R.xl&&oe.includes(ce.name.value)){if(me.push(ce),ce.name.value==="linkedStyles"){const we=L.findIndex(_e=>_e.name.value==="linkedStyles");L.splice(we+1,1)}return}if(n<R.sm&&te.includes(ce.name.value)){me.push(ce);return}if(fe(ce)){se.push(ce),ge+=ue;return}ge<n?(se.push(ce),ge+=ue):me.push(ce)}),{defaultItems:se,overflowItems:me.filter(ce=>ce.type!=="separator")}},y7=[".jpg",".jpeg",".png","image/jpeg","image/png"],b7=()=>{let t=document.createElement("input");t.type="file";let e=y7;return t.accept=e.join(","),()=>new Promise((n,r)=>{t.onchange=async()=>{const o=t.files;if(!o)return n(null);const i=o.item(0);return n(i?{file:i}:null)},t.oncancel=()=>n(null),t.onerror=r,t.click()})},w7=t=>new Promise((e,n)=>{let r=new FileReader;r.onload=o=>e(o.target.result),r.onerror=n,setTimeout(()=>r.readAsDataURL(t),250)}),v7=(t,e)=>new Promise((n,r)=>{const o=new window.Image;o.onload=()=>{const i=document.createElement("canvas"),{width:s,height:a}=Pk(o.width,o.height,e);if(i.width=s,i.height=a,i.getContext("2d").drawImage(o,0,0,s,a),typeof t=="string"){const l=i.toDataURL();n(l)}else i.toBlob(l=>{const c=new File([l],t.name,{type:t.type,lastModified:Date.now()});n({file:c,width:s,height:a})})},o.onerror=i=>r(i),o.src=typeof t=="string"?t:URL.createObjectURL(t)}),Pk=(t,e,n)=>{const{width:r,height:o}=n.getMaxContentSize();if(!r||!o)return{width:t,height:e};let i=t,s=e;const a=t/e;return e>o&&(s=o,i=Math.round(o*a)),i>r&&(i=r,s=Math.round(r/a)),{width:i,height:s}},x7=async({editor:t,view:e,file:n})=>{let r=typeof t.options.handleImageUpload=="function"?t.options.handleImageUpload:w7;if((n.size/(1024*1024)).toFixed(4)>5){window.alert("Image size must be less than 5MB");return}let o,i;try{const u=await v7(n,t);o=u.width,i=u.height,n=u.file}catch(u){console.warn("Error processing image:",u);return}let s={},{tr:a,schema:l}=e.state;a.selection.empty||a.deleteSelection();let c={type:"add",pos:a.selection.from,id:s};a.setMeta(no,c),e.dispatch(a),r(n).then(u=>{let d=n.name.replace(" ","_"),f=F5(e.state,s);if(f==null)return;let p={type:"remove",id:s},h=`word/media/${d}`,m=l.nodes.image.create({src:h,size:{width:o,height:i}});t.storage.image.media=Object.assign(t.storage.image.media,{[h]:u}),t.options.ydoc&&t.commands.addImageToCollaboration({mediaPath:h,fileData:u}),e.dispatch(e.state.tr.replaceWith(f,f,m).setMeta(no,p))},()=>{let u={type:"remove",id:s};e.dispatch(a.setMeta(no,u))})};var Lt,zk,Li,af,jk,qk,lf,Vk,Fo;class k7 extends f9{constructor(e){super(),u0(this,Lt),c0(this,"config",{selector:null,toolbarGroups:["left","center","right"],role:"editor",pagination:!1,icons:{...rn},mode:"docx",excludeItems:[]}),u0(this,Li,{setZoom:({item:r,argument:o})=>{if(!o)return;r.onActivate({zoom:o}),this.emit("superdoc-command",{item:r,argument:o});const i=document.querySelector(this.superdoc.config.selector)?.querySelector(".layers");if(!i)return;const s=typeof screen.orientation<"u",a=window.matchMedia("(max-width: 834px)").matches;s&&a?(i.style.transformOrigin="0 0",i.style.transform=`scale(${parseInt(o)/100})`):i.style.zoom=parseInt(o)/100,this.superdoc.superdocStore.activeZoom=parseInt(o)},setDocumentMode:({item:r,argument:o})=>{o&&this.emit("superdoc-command",{item:r,argument:o})},setFontSize:({item:r,argument:o})=>{Zt(this,Lt,Fo).call(this,{item:r,argument:o},()=>{this.activeEditor?.commands.setFieldAnnotationsFontSize(o,!0)})},setFontFamily:({item:r,argument:o})=>{Zt(this,Lt,Fo).call(this,{item:r,argument:o},()=>{this.activeEditor?.commands.setFieldAnnotationsFontFamily(o,!0)})},setColor:({item:r,argument:o})=>{Zt(this,Lt,Fo).call(this,{item:r,argument:o})},setHighlight:({item:r,argument:o})=>{Zt(this,Lt,Fo).call(this,{item:r,argument:o})},toggleRuler:({item:r,argument:o})=>{this.superdoc.toggleRuler()},startImageUpload:async({item:r,argument:o})=>{let i=await b7()();i?.file&&x7({editor:this.activeEditor,view:this.activeEditor.view,file:i.file})},increaseTextIndent:({item:r,argument:o})=>{let i=r.command,{state:s}=this.activeEditor;if(Bn(a=>a.type.name==="listItem")(s.selection))return this.activeEditor.chain().sinkListItem("listItem").updateOrderedListStyleType().run();i in this.activeEditor.commands&&this.activeEditor.commands[i](o)},decreaseTextIndent:({item:r,argument:o})=>{let i=r.command,{state:s}=this.activeEditor;if(Bn(a=>a.type.name==="listItem")(s.selection))return this.activeEditor.chain().liftListItem("listItem").updateOrderedListStyleType().run();i in this.activeEditor.commands&&this.activeEditor.commands[i](o)},toggleBold:({item:r,argument:o})=>{let i=r.command;i in this.activeEditor.commands&&(this.activeEditor.commands[i](o),this.activeEditor.commands.toggleFieldAnnotationsFormat("bold",!0)),this.updateToolbarState()},toggleItalic:({item:r,argument:o})=>{let i=r.command;i in this.activeEditor.commands&&(this.activeEditor.commands[i](o),this.activeEditor.commands.toggleFieldAnnotationsFormat("italic",!0)),this.updateToolbarState()},toggleUnderline:({item:r,argument:o})=>{let i=r.command;i in this.activeEditor.commands&&(this.activeEditor.commands[i](o),this.activeEditor.commands.toggleFieldAnnotationsFormat("underline",!0)),this.updateToolbarState()},toggleLink:({item:r,argument:o})=>{let i=r.command;if(i in this.activeEditor.commands){this.activeEditor.commands[i](o);const{view:s}=this.activeEditor,a=s.state.selection.$to.pos,l=new Le(s.state.doc.resolve(a)),c=s.state.tr.setSelection(l),u=s.state.apply(c);s.updateState(u),setTimeout(()=>{s.focus()},100)}this.updateToolbarState()},insertTable:({item:r,argument:o})=>{Zt(this,Lt,Fo).call(this,{item:r,argument:o})},executeTableCommand:({item:r,argument:o})=>{if(!o)return;let i=o.command;i in this.activeEditor.commands&&this.activeEditor.commands[i](o),this.updateToolbarState()}}),c0(this,"onToolbarResize",()=>{Zt(this,Lt,af).call(this,this,this.config.icons,this.isDev),this.role==="viewer"&&Zt(this,Lt,lf).call(this)}),this.config={...this.config,...e},this.toolbarItems=[],this.overflowItems=[],this.documentMode=e.documentMode||"editing",this.isDev=e.isDev||!1,this.superdoc=e.superdoc,this.role=e.role||"editor",this.config.icons={...rn,...e.icons},!this.config.selector&&this.config.element&&(this.config.selector=this.config.element),Zt(this,Lt,zk).call(this),Zt(this,Lt,af).call(this,this,this.config.icons,e.isDev);let n=null;if(this.config.selector&&(n=document.getElementById(this.config.selector),!n)){console.warn(`[super-toolbar 🎨] Element not found: ${this.config.selector}`);return}this.app=b.createApp(Ik),this.app.directive("click-outside",nE),this.app.config.globalProperties.$toolbar=this,n&&(this.toolbar=this.app.mount(n)),this.activeEditor=e.editor||null,this.updateToolbarState()}log(...e){console.debug("[🎨 super-toolbar]",...e)}setZoom(e){const n=[...this.toolbarItems,...this.overflowItems].find(r=>r.name.value==="zoom");Fu(this,Li).setZoom({item:n,argument:e})}setActiveEditor(e){this.activeEditor=e,this.activeEditor.on("transaction",this.onEditorTransaction.bind(this))}getToolbarItemByGroup(e){return this.toolbarItems.filter(n=>n.group.value===e)}updateToolbarState(){if(Zt(this,Lt,Vk).call(this),Zt(this,Lt,jk).call(this),Zt(this,Lt,qk).call(this),!this.activeEditor||this.documentMode==="viewing"){Zt(this,Lt,lf).call(this);return}const e=Tf(this.activeEditor),n=Kf(this.activeEditor.state);this.toolbarItems.forEach(r=>{if(r.resetDisabled(),r.name.value==="linkedStyles")return this.activeEditor&&!x2(this.activeEditor).length?r.deactivate():r.activate();const o=e.find(i=>i.name===r.name.value);o?r.activate(o.attrs):r.deactivate(),r.name.value==="tableActions"&&(n?r.disabled.value=!1:r.disabled.value=!0)})}onEditorTransaction({editor:e,transaction:n}){!n.docChanged&&!n.selectionSet||this.updateToolbarState()}emitCommand({item:e,argument:n}){const{command:r}=e;if(r){if(this.log("(emmitCommand) Command:",r,e,n),r in Fu(this,Li))return Fu(this,Li)[r]({item:e,argument:n});if(r in this.activeEditor?.commands)this.activeEditor.commands[r](n),this.updateToolbarState();else throw new Error(`[super-toolbar 🎨] Command not found: ${r}`)}}}Lt=new WeakSet,zk=function(){this.config.groups&&!Array.isArray(this.config.groups)&&Object.keys(this.config.groups).length&&(this.config.toolbarGroups=Object.keys(this.config.groups))},Li=new WeakMap,af=function(t,e,n=!1){const r=document.documentElement.clientWidth,{defaultItems:o,overflowItems:i}=g7(t,n,r,this.role,e);let s=[...o.map(l=>l.name.value),...i.map(l=>l.name.value)];this.config.groups&&(s=Object.values(this.config.groups).flatMap(l=>l));const a=o.filter(l=>s.includes(l.name.value)).filter(l=>!this.config.excludeItems.includes(l.name.value));this.toolbarItems=a,this.overflowItems=i.filter(l=>s.includes(l.name.value))},jk=function(){if(!this.activeEditor||!this.activeEditor.converter)return;const{typeface:t="Arial",fontSizePt:e=12}=this.activeEditor.converter.getDocumentDefaultStyles()??{},n=this.toolbarItems.find(o=>o.name.value==="fontSize");n&&(n.defaultLabel.value=e);const r=this.toolbarItems.find(o=>o.name.value==="fontFamily");r&&(r.defaultLabel.value=t)},qk=function(){if(!this.activeEditor||!this.activeEditor.converter||!this.activeEditor.converter.docHiglightColors.size)return;const t=this.toolbarItems.find(i=>i.name.value==="highlight"),e=r7(),n=7,r=Array.from(this.activeEditor.converter.docHiglightColors).reduce((i,s,a)=>{const l=Math.floor(a/n);return i[l]||(i[l]=[]),e.includes(s)||i[l].push(Ee(s)),i},[]),o={key:"color",type:"render",render:()=>sf(this,t,r)};t.nestedOptions.value=[o]},lf=function(){this.activeEditor=null,this.toolbarItems.forEach(t=>{const{allowWithoutEditor:e}=t;e.value||t.setDisabled(!0)})},Vk=function(){this.activeEditor&&(this.undoDepth=I$(this.activeEditor.state),this.redoDepth=F$(this.activeEditor.state))},Fo=function({item:t,argument:e},n){if(!e||!this.activeEditor)return;let r=t.command;r in this.activeEditor?.commands&&(this.activeEditor.commands[r](e),typeof n=="function"&&n(e),this.updateToolbarState())};function S7(t,e){if(!t.value||!e?.value?.options?.scale)return;const n=e.value.options.scale,r=t.value.getBoundingClientRect(),o=t.value.querySelectorAll(".pagination-break-wrapper");let i;o.forEach(s=>{const a=(s.getBoundingClientRect().left-r.left)/n*-1+1;if(i||(i=a),a!==i){const l=a-i;s.style.transform=`translateX(${l}px)`}})}const C7=(t,e)=>{const n=t.clientY,r=t.clientX,{view:o}=e,i=o.dom.getBoundingClientRect();let s={left:0,top:n},a=!1;r>i.right?(s.left=i.left+i.width-1,a=!0):r<i.left&&(s.left=i.left);const l=o.posAtCoords(s)?.pos;if(l){let c=l;if(a){const d=o.state.doc.resolve(l).textOffset,f=o.state.doc.nodeAt(l),p=f?.text?.charAt(d);c=f?.isText&&p!==" "?l-1:l}const u=o.state.tr.setSelection(Le.create(o.state.doc,c));o.dispatch(u),o.focus()}},E7={class:"numbering"},la=200,A7="flex-end",$7={__name:"Ruler",props:{orientation:{type:String,default:"horizontal"},length:{type:Number,default:0},editor:{type:Object,required:!0}},emits:["margin-change"],setup(t,{emit:e}){const n=e,r=t,o=b.ref(null),i=b.ref([]),s=b.ref("#CCCCCC"),a=b.ref("#2563EB66"),l=b.ref(null),c=b.ref(null),u=b.ref(!1),d=b.ref(null),f=b.reactive({side:"left",x:0}),p=b.reactive({side:"right",x:0}),h=b.ref(!1),m=b.ref(0);let y=0;const g=()=>{const W=[],{pageMargins:A,pageSize:G}=r.editor.getPageStyles();l.value=G,c.value=A,p.x=G.width*96-A.right*96,f.x=A.left*96;for(let ae=0;ae<G.width;ae++){const X=`${5.5}px`,de=G.width-ae;if(W.push(...x(1,"main","20%",X,ae)),W.push(...x(3,"eighth","10%",X)),W.push(...x(1,"half","40%",X)),de<=.5)break;W.push(...x(3,"eighth","10%",X))}return W},x=(W,A,G,ae,X)=>Array.from({length:W},(de,J)=>{const pe={className:`${A}-unit ruler-section`,height:G,margin:ae};return X!==void 0&&(pe.numbering=X),pe}),k=b.computed(()=>W=>({width:"1px",minWidth:"1px",maxWidth:"1px",height:W.height,backgroundColor:W.color||"#666",marginLeft:W.numbering===0?null:W.margin,marginRight:W.margin})),w=b.computed(()=>W=>({left:`${(W==="left"?f:p).x}px`})),T=b.computed(()=>{if(!o.value)return;const W=o.value.parentElement.querySelector(".super-editor").getBoundingClientRect();return{left:`${d.value.x}px`,minHeight:`${W.height}px`}}),D=W=>{u.value=!0,C();const A=W.currentTarget.id;d.value=A==="left-margin-handle"?f:p,m.value=d.value.x,y=W.clientX-d.value.x,h.value=!0},M=W=>{if(!u.value)return;const A=W.clientX-y;d.value.x=A,d.value.side==="left"?A<=0?d.value.x=0:A>=p.x-la&&(d.value.x=p.x-la):A>=l.value.width*96?d.value.x=l.value.width*96:A<=f.x+la&&(d.value.x=f.x+la)},F=()=>{if(u.value=!1,h.value=!1,U(),d.value&&d.value.x!==m.value){const W=ie();n("margin-change",{side:d.value.side,value:W})}},C=()=>{s.value=a.value},U=()=>{s.value="#CCC"},ie=()=>d.value.side==="left"?d.value.x/96:(l.value.width*96-d.value.x)/96,I=b.computed(()=>({"--alignment":A7,"--ruler-handle-color":s.value,"--ruler-handle-active-color":a.value}));return b.onMounted(()=>{i.value=g(),window.addEventListener("mousemove",M),window.addEventListener("mouseup",F)}),b.onUnmounted(()=>{window.removeEventListener("mousemove",M),window.removeEventListener("mouseup",F)}),(W,A)=>(b.openBlock(),b.createElementBlock("div",{class:"ruler",ref_key:"ruler",ref:o,style:b.normalizeStyle(I.value)},[b.createBaseVNode("div",{class:"margin-handle handle-left",id:"left-margin-handle",onMousedown:D,style:b.normalizeStyle(w.value("left"))},null,36),b.createBaseVNode("div",{class:"margin-handle handle-right",id:"right-margin-handle",onMousedown:D,style:b.normalizeStyle(w.value("right"))},null,36),h.value?(b.openBlock(),b.createElementBlock("div",{key:0,class:"vertical-indicator",style:b.normalizeStyle(T.value)},null,4)):b.createCommentVNode("",!0),(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(i.value,G=>(b.openBlock(),b.createElementBlock("div",{class:b.normalizeClass(G.className),style:b.normalizeStyle(k.value(G))},[b.createBaseVNode("div",E7,b.toDisplayString(G.numbering),1),(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(G.elements,ae=>(b.openBlock(),b.createElementBlock("div",{class:b.normalizeClass(ae.className),style:b.normalizeStyle(k.value(ae))},[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(ae.elements,X=>(b.openBlock(),b.createElementBlock("div",{class:b.normalizeClass(X.className),style:b.normalizeStyle(k.value(X))},null,6))),256))],6))),256))],6))),256))],4))}},T7=vt($7,[["__scopeId","data-v-82812cc5"]]),O7={class:"super-editor-container"},D7={key:1,class:"placeholder-editor"},M7={class:"placeholder-title"},_7={__name:"SuperEditor",props:{documentId:{type:String,required:!1},fileSource:{type:File,required:!1},state:{type:Object,required:!1,default:()=>null},options:{type:Object,required:!1,default:()=>({})}},emits:["editor-ready","editor-click","editor-keydown","comments-loaded","selection-update"],setup(t,{emit:e}){const n=e,r=t,o=b.ref(!1),i=b.shallowRef(null),s=b.ref(null),a=b.ref(null);let l;const c=()=>{clearTimeout(l)},u=(k,w=10,T=500)=>{const D=k.getMap("meta"),M=()=>{const F=D.get("docx");F?(c(),h({content:F})):w>0?(console.debug(`Waiting for 'docx' data... retries left: ${w}`),l=setTimeout(M,T),w--):console.warn("Failed to load docx data from meta map.")};M()},d=async()=>{try{const[k,w,T,D]=await cs.loadXmlData(r.fileSource);return{content:k,media:w,mediaFiles:T,fonts:D}}catch(k){console.debug("Error loading new file data:",k)}},f=async()=>{if(r.fileSource){const k=await d();return h(k)}else if(r.options.ydoc&&r.options.collaborationProvider){delete r.options.content;const k=r.options.ydoc,w=r.options.collaborationProvider,T=()=>{u(k),w.off("synced",T)};w.on("synced",T)}},p=()=>{const k=up();return r.options.pagination?k:k.filter(w=>w.name!=="pagination")},h=async({content:k,media:w={},mediaFiles:T={},fonts:D={}}={})=>{i.value=new cs({mode:"docx",element:a.value,fileSource:r.fileSource,extensions:p(),externalExtensions:r.options.externalExtensions,documentId:r.documentId,content:k,media:w,mediaFiles:T,fonts:D,...r.options}),i.value.on("paginationUpdate",()=>{S7(a,i)}),i.value.on("collaborationReady",()=>{setTimeout(()=>{o.value=!0},150)})},m=k=>{n("editor-keydown",{editor:i.value})},y=k=>{n("editor-click",{editor:i.value});let w=a.value?.querySelector(".ProseMirror");!w||!i.value||!w.contains(k.target)&&i.value.isEditable&&i.value.view?.focus()};b.onMounted(()=>{f(),(r.options?.suppressSkeletonLoader||!r.options?.collaborationProvider)&&(o.value=!0)});const g=k=>{k.target.classList.contains("ProseMirror")||C7(k,i.value)},x=({side:k,value:w})=>{if(!i.value)return;const T=i.value.getPageStyles(),{pageMargins:D}=T,M={...D,[k]:w};i.value?.updatePageStyle({pageMargins:M})};return b.onBeforeUnmount(()=>{c(),i.value?.destroy(),i.value=null}),(k,w)=>(b.openBlock(),b.createElementBlock("div",O7,[t.options.rulers&&i.value?(b.openBlock(),b.createBlock(T7,{key:0,class:"ruler",editor:i.value,onMarginChange:x},null,8,["editor"])):b.createCommentVNode("",!0),b.createBaseVNode("div",{class:"super-editor",ref_key:"editorWrapper",ref:s,onKeydown:m,onClick:y,onMousedown:g},[b.createBaseVNode("div",{ref_key:"editorElem",ref:a,class:"editor-element super-editor__element"},null,512)],544),o.value?b.createCommentVNode("",!0):(b.openBlock(),b.createElementBlock("div",D7,[b.createBaseVNode("div",M7,[b.createVNode(b.unref(Cn),{text:"",style:{width:"60%"}})]),b.createVNode(b.unref(Cn),{text:"",repeat:6}),b.createVNode(b.unref(Cn),{text:"",style:{width:"60%"}}),b.createVNode(b.unref(Cn),{text:"",repeat:6,style:{width:"30%",display:"block",margin:"20px"}}),b.createVNode(b.unref(Cn),{text:"",style:{width:"60%"}}),b.createVNode(b.unref(Cn),{text:"",repeat:5}),b.createVNode(b.unref(Cn),{text:"",style:{width:"30%"}}),b.createVNode(b.unref(Cn),{text:"",style:{"margin-top":"50px"}}),b.createVNode(b.unref(Cn),{text:"",repeat:6}),b.createVNode(b.unref(Cn),{text:"",style:{width:"70%"}})]))]))}},N7=vt(_7,[["__scopeId","data-v-ff8f86f4"]]),I7={__name:"BasicUpload",emits:["file-change"],setup(t,{emit:e}){const n=e,r=o=>{n("file-change",o.target.files[0])};return(o,i)=>(b.openBlock(),b.createElementBlock("div",null,[b.createBaseVNode("input",{type:"file",id:"fileInput",onChange:r,accept:".docx"},null,32)]))}},F7=["innerHTML"],B7={__name:"SuperInput",props:{modelValue:{type:String},placeholder:{type:String,required:!1,default:"Type something..."},options:{type:Object,required:!1,default:()=>({})},users:{type:Array,required:!1,default:()=>[]}},emits:["update:modelValue","focus","blur"],setup(t,{emit:e}){const n=e,r=t,o=b.shallowRef(),i=b.ref(null),s=b.ref(!1),a=({editor:p,transaction:h})=>{const m=p.getHTML();n("update:modelValue",m)},l=({editor:p,transaction:h})=>{s.value=!0,f(),n("focus",{editor:p,transaction:h})},c=({editor:p,transaction:h})=>{s.value=!1,n("blur",{editor:p,transaction:h})},u=async()=>{nx.options.placeholder=r.placeholder||"Type something...",r.options.onTransaction=a,r.options.onFocus=l,r.options.onBlur=c,o.value=new cs({mode:"text",content:document.getElementById("currentContent"),element:i.value,extensions:cp(),users:r.users,...r.options})},d=()=>{s.value=!0,o.value?.view?.focus()},f=()=>{o.value?.setOptions({users:r.users})};return b.onMounted(()=>{u()}),b.onBeforeUnmount(()=>{o.value?.destroy(),o.value=null}),(p,h)=>(b.openBlock(),b.createElementBlock("div",{class:b.normalizeClass(["super-editor super-input",{"super-input-active":s.value}]),onClick:b.withModifiers(d,["stop","prevent"])},[b.createBaseVNode("div",{id:"currentContent",style:{display:"none"},innerHTML:t.modelValue},null,8,F7),b.createBaseVNode("div",{ref_key:"editorElem",ref:i,class:"editor-element super-editor__element"},null,512)],2))}},R7=vt(B7,[["__scopeId","data-v-4d5cff52"]]),L7={Node:rt,Attribute:Me,Extension:Qe,Plugin:Ze};exports.Dv=j5;exports.Gn=Pk;exports.Ni=cs;exports.Nt=ed;exports.Ov=v5;exports._p=Ik;exports.c=l9;exports.de=pt;exports.fo=N7;exports.go=L7;exports.gv=up;exports.he=yt;exports.ho=I7;exports.kt=$r;exports.lf=Tf;exports.mv=cp;exports.nd=Xf;exports.po=k7;exports.vo=R7;exports.vo$1=Es;