@univerjs/core 0.5.3 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +9 -8
- package/lib/es/index.js +10234 -7967
- package/lib/types/common/error.d.ts +3 -0
- package/lib/types/docs/data-model/rich-text-builder.d.ts +1340 -0
- package/lib/types/docs/data-model/text-x/build-utils/index.d.ts +2 -1
- package/lib/types/docs/data-model/text-x/build-utils/text-x-utils.d.ts +2 -2
- package/lib/types/facade/f-blob.d.ts +12 -12
- package/lib/types/facade/f-doc.d.ts +7 -0
- package/lib/types/facade/f-enum.d.ts +51 -0
- package/lib/types/facade/f-event.d.ts +168 -13
- package/lib/types/facade/f-univer.d.ts +95 -20
- package/lib/types/facade/f-usermanager.d.ts +4 -3
- package/lib/types/facade/f-util.d.ts +16 -23
- package/lib/types/index.d.ts +3 -1
- package/lib/types/services/image-io/image-io.service.d.ts +12 -0
- package/lib/types/shared/check-if-move.d.ts +1 -1
- package/lib/types/shared/rectangle.d.ts +267 -12
- package/lib/types/sheets/column-manager.d.ts +3 -1
- package/lib/types/sheets/row-manager.d.ts +3 -1
- package/lib/types/sheets/typedef.d.ts +8 -0
- package/lib/types/sheets/workbook.d.ts +11 -1
- package/lib/types/sheets/worksheet.d.ts +11 -1
- package/lib/types/types/const/const.d.ts +9 -0
- package/lib/types/types/interfaces/i-document-data.d.ts +2 -52
- package/lib/types/types/interfaces/i-drawing.d.ts +93 -0
- package/lib/types/types/interfaces/i-slide-data.d.ts +2 -1
- package/lib/types/types/interfaces/i-style-data.d.ts +12 -0
- package/lib/types/types/interfaces/index.d.ts +1 -0
- package/lib/umd/index.js +9 -8
- package/package.json +3 -3
package/lib/cjs/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
"use strict";var zc=Object.defineProperty;var Vc=(e,t,n)=>t in e?zc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var C=(e,t,n)=>Vc(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ye=require("rxjs"),Dr=require("rxjs/operators"),ot=require("react");function Gc(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}function Kc(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const bt=Gc(ot);function Xc(){Qc()}const Er=typeof global<"u"?global:typeof self<"u"?self:window;function Qc(){typeof Er.requestIdleCallback!="function"&&(Er.requestIdleCallback=function(n){const r=Date.now();return setTimeout(function(){const i=Math.max(0,50-(Date.now()-r));n({didTimeout:i===0,timeRemaining(){return i}})},1)}),typeof Er.cancelIdleCallback!="function"&&(Er.cancelIdleCallback=function(n){clearTimeout(n)})}var ya=typeof global=="object"&&global&&global.Object===Object&&global,Jc=typeof self=="object"&&self&&self.Object===Object&&self,dn=ya||Jc||Function("return this")(),bn=dn.Symbol,Oa=Object.prototype,qc=Oa.hasOwnProperty,Zc=Oa.toString,Un=bn?bn.toStringTag:void 0;function eh(e){var t=qc.call(e,Un),n=e[Un];try{e[Un]=void 0;var r=!0}catch{}var s=Zc.call(e);return r&&(t?e[Un]=n:delete e[Un]),s}var th=Object.prototype,nh=th.toString;function rh(e){return nh.call(e)}var sh="[object Null]",ih="[object Undefined]",eo=bn?bn.toStringTag:void 0;function ir(e){return e==null?e===void 0?ih:sh:eo&&eo in Object(e)?eh(e):rh(e)}function Mn(e){return e!=null&&typeof e=="object"}var oh="[object Symbol]";function os(e){return typeof e=="symbol"||Mn(e)&&ir(e)==oh}function ah(e,t){for(var n=-1,r=e==null?0:e.length,s=Array(r);++n<r;)s[n]=t(e[n],n,e);return s}var An=Array.isArray,lh=1/0,to=bn?bn.prototype:void 0,no=to?to.toString:void 0;function wa(e){if(typeof e=="string")return e;if(An(e))return ah(e,wa)+"";if(os(e))return no?no.call(e):"";var t=e+"";return t=="0"&&1/e==-lh?"-0":t}var uh=/\s/;function ch(e){for(var t=e.length;t--&&uh.test(e.charAt(t)););return t}var hh=/^\s+/;function dh(e){return e&&e.slice(0,ch(e)+1).replace(hh,"")}function Rt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ro=NaN,fh=/^[-+]0x[0-9a-f]+$/i,gh=/^0b[01]+$/i,ph=/^0o[0-7]+$/i,mh=parseInt;function so(e){if(typeof e=="number")return e;if(os(e))return ro;if(Rt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Rt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=dh(e);var n=gh.test(e);return n||ph.test(e)?mh(e.slice(2),n?2:8):fh.test(e)?ro:+e}function ba(e){return e}var _h="[object AsyncFunction]",Eh="[object Function]",vh="[object GeneratorFunction]",Ch="[object Proxy]";function pi(e){if(!Rt(e))return!1;var t=ir(e);return t==Eh||t==vh||t==_h||t==Ch}var Es=dn["__core-js_shared__"],io=function(){var e=/[^.]+$/.exec(Es&&Es.keys&&Es.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Rh(e){return!!io&&io in e}var Ih=Function.prototype,Sh=Ih.toString;function yh(e){if(e!=null){try{return Sh.call(e)}catch{}try{return e+""}catch{}}return""}var Oh=/[\\^$.*+?()[\]{}|]/g,wh=/^\[object .+?Constructor\]$/,bh=Function.prototype,Ah=Object.prototype,Th=bh.toString,Nh=Ah.hasOwnProperty,Mh=RegExp("^"+Th.call(Nh).replace(Oh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Dh(e){if(!Rt(e)||Rh(e))return!1;var t=pi(e)?Mh:wh;return t.test(yh(e))}function xh(e,t){return e==null?void 0:e[t]}function mi(e,t){var n=xh(e,t);return Dh(n)?n:void 0}var oo=Object.create,Lh=function(){function e(){}return function(t){if(!Rt(t))return{};if(oo)return oo(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Uh(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Ph(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Fh=800,kh=16,$h=Date.now;function jh(e){var t=0,n=0;return function(){var r=$h(),s=kh-(r-n);if(n=r,s>0){if(++t>=Fh)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Bh(e){return function(){return e}}var Gr=function(){try{var e=mi(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Hh=Gr?function(e,t){return Gr(e,"toString",{configurable:!0,enumerable:!1,value:Bh(t),writable:!0})}:ba,Wh=jh(Hh),Yh=9007199254740991,zh=/^(?:0|[1-9]\d*)$/;function _i(e,t){var n=typeof e;return t=t==null?Yh:t,!!t&&(n=="number"||n!="symbol"&&zh.test(e))&&e>-1&&e%1==0&&e<t}function Ei(e,t,n){t=="__proto__"&&Gr?Gr(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function as(e,t){return e===t||e!==e&&t!==t}var Vh=Object.prototype,Gh=Vh.hasOwnProperty;function Aa(e,t,n){var r=e[t];(!(Gh.call(e,t)&&as(r,n))||n===void 0&&!(t in e))&&Ei(e,t,n)}function Kh(e,t,n,r){var s=!n;n||(n={});for(var i=-1,o=t.length;++i<o;){var a=t[i],l=void 0;l===void 0&&(l=e[a]),s?Ei(n,a,l):Aa(n,a,l)}return n}var ao=Math.max;function Xh(e,t,n){return t=ao(t===void 0?e.length-1:t,0),function(){for(var r=arguments,s=-1,i=ao(r.length-t,0),o=Array(i);++s<i;)o[s]=r[t+s];s=-1;for(var a=Array(t+1);++s<t;)a[s]=r[s];return a[t]=n(o),Uh(e,this,a)}}function Qh(e,t){return Wh(Xh(e,t,ba),e+"")}var Jh=9007199254740991;function Ta(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Jh}function vi(e){return e!=null&&Ta(e.length)&&!pi(e)}function qh(e,t,n){if(!Rt(n))return!1;var r=typeof t;return(r=="number"?vi(n)&&_i(t,n.length):r=="string"&&t in n)?as(n[t],e):!1}function Na(e){return Qh(function(t,n){var r=-1,s=n.length,i=s>1?n[s-1]:void 0,o=s>2?n[2]:void 0;for(i=e.length>3&&typeof i=="function"?(s--,i):void 0,o&&qh(n[0],n[1],o)&&(i=s<3?void 0:i,s=1),t=Object(t);++r<s;){var a=n[r];a&&e(t,a,r,i)}return t})}var Zh=Object.prototype;function Ma(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Zh;return e===n}function ed(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var td="[object Arguments]";function lo(e){return Mn(e)&&ir(e)==td}var Da=Object.prototype,nd=Da.hasOwnProperty,rd=Da.propertyIsEnumerable,Us=lo(function(){return arguments}())?lo:function(e){return Mn(e)&&nd.call(e,"callee")&&!rd.call(e,"callee")};function sd(){return!1}var xa=typeof exports=="object"&&exports&&!exports.nodeType&&exports,uo=xa&&typeof module=="object"&&module&&!module.nodeType&&module,id=uo&&uo.exports===xa,co=id?dn.Buffer:void 0,od=co?co.isBuffer:void 0,La=od||sd,ad="[object Arguments]",ld="[object Array]",ud="[object Boolean]",cd="[object Date]",hd="[object Error]",dd="[object Function]",fd="[object Map]",gd="[object Number]",pd="[object Object]",md="[object RegExp]",_d="[object Set]",Ed="[object String]",vd="[object WeakMap]",Cd="[object ArrayBuffer]",Rd="[object DataView]",Id="[object Float32Array]",Sd="[object Float64Array]",yd="[object Int8Array]",Od="[object Int16Array]",wd="[object Int32Array]",bd="[object Uint8Array]",Ad="[object Uint8ClampedArray]",Td="[object Uint16Array]",Nd="[object Uint32Array]",Je={};Je[Id]=Je[Sd]=Je[yd]=Je[Od]=Je[wd]=Je[bd]=Je[Ad]=Je[Td]=Je[Nd]=!0;Je[ad]=Je[ld]=Je[Cd]=Je[ud]=Je[Rd]=Je[cd]=Je[hd]=Je[dd]=Je[fd]=Je[gd]=Je[pd]=Je[md]=Je[_d]=Je[Ed]=Je[vd]=!1;function Md(e){return Mn(e)&&Ta(e.length)&&!!Je[ir(e)]}function Dd(e){return function(t){return e(t)}}var Ua=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Kn=Ua&&typeof module=="object"&&module&&!module.nodeType&&module,xd=Kn&&Kn.exports===Ua,vs=xd&&ya.process,ho=function(){try{var e=Kn&&Kn.require&&Kn.require("util").types;return e||vs&&vs.binding&&vs.binding("util")}catch{}}(),fo=ho&&ho.isTypedArray,Pa=fo?Dd(fo):Md;function Ld(e,t){var n=An(e),r=!n&&Us(e),s=!n&&!r&&La(e),i=!n&&!r&&!s&&Pa(e),o=n||r||s||i,a=o?ed(e.length,String):[],l=a.length;for(var c in e)o&&(c=="length"||s&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||_i(c,l))||a.push(c);return a}function Ud(e,t){return function(n){return e(t(n))}}function Pd(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Fd=Object.prototype,kd=Fd.hasOwnProperty;function $d(e){if(!Rt(e))return Pd(e);var t=Ma(e),n=[];for(var r in e)r=="constructor"&&(t||!kd.call(e,r))||n.push(r);return n}function Fa(e){return vi(e)?Ld(e):$d(e)}var jd=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Bd=/^\w*$/;function Hd(e,t){if(An(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||os(e)?!0:Bd.test(e)||!jd.test(e)||t!=null&&e in Object(t)}var qn=mi(Object,"create");function Wd(){this.__data__=qn?qn(null):{},this.size=0}function Yd(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var zd="__lodash_hash_undefined__",Vd=Object.prototype,Gd=Vd.hasOwnProperty;function Kd(e){var t=this.__data__;if(qn){var n=t[e];return n===zd?void 0:n}return Gd.call(t,e)?t[e]:void 0}var Xd=Object.prototype,Qd=Xd.hasOwnProperty;function Jd(e){var t=this.__data__;return qn?t[e]!==void 0:Qd.call(t,e)}var qd="__lodash_hash_undefined__";function Zd(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=qn&&t===void 0?qd:t,this}function an(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}an.prototype.clear=Wd;an.prototype.delete=Yd;an.prototype.get=Kd;an.prototype.has=Jd;an.prototype.set=Zd;function ef(){this.__data__=[],this.size=0}function ls(e,t){for(var n=e.length;n--;)if(as(e[n][0],t))return n;return-1}var tf=Array.prototype,nf=tf.splice;function rf(e){var t=this.__data__,n=ls(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():nf.call(t,n,1),--this.size,!0}function sf(e){var t=this.__data__,n=ls(t,e);return n<0?void 0:t[n][1]}function of(e){return ls(this.__data__,e)>-1}function af(e,t){var n=this.__data__,r=ls(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function jt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}jt.prototype.clear=ef;jt.prototype.delete=rf;jt.prototype.get=sf;jt.prototype.has=of;jt.prototype.set=af;var ka=mi(dn,"Map");function lf(){this.size=0,this.__data__={hash:new an,map:new(ka||jt),string:new an}}function uf(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function us(e,t){var n=e.__data__;return uf(t)?n[typeof t=="string"?"string":"hash"]:n.map}function cf(e){var t=us(this,e).delete(e);return this.size-=t?1:0,t}function hf(e){return us(this,e).get(e)}function df(e){return us(this,e).has(e)}function ff(e,t){var n=us(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Zt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Zt.prototype.clear=lf;Zt.prototype.delete=cf;Zt.prototype.get=hf;Zt.prototype.has=df;Zt.prototype.set=ff;var gf="Expected a function";function Ci(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(gf);var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],i=n.cache;if(i.has(s))return i.get(s);var o=e.apply(this,r);return n.cache=i.set(s,o)||i,o};return n.cache=new(Ci.Cache||Zt),n}Ci.Cache=Zt;var pf=500;function mf(e){var t=Ci(e,function(r){return n.size===pf&&n.clear(),r}),n=t.cache;return t}var _f=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ef=/\\(\\)?/g,vf=mf(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(_f,function(n,r,s,i){t.push(s?i.replace(Ef,"$1"):r||n)}),t});function Cf(e){return e==null?"":wa(e)}function $a(e,t){return An(e)?e:Hd(e,t)?[e]:vf(Cf(e))}var Rf=1/0;function ja(e){if(typeof e=="string"||os(e))return e;var t=e+"";return t=="0"&&1/e==-Rf?"-0":t}function If(e,t){t=$a(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[ja(t[n++])];return n&&n==r?e:void 0}function Sf(e,t,n){var r=e==null?void 0:If(e,t);return r===void 0?n:r}var Ba=Ud(Object.getPrototypeOf,Object),yf="[object Object]",Of=Function.prototype,wf=Object.prototype,Ha=Of.toString,bf=wf.hasOwnProperty,Af=Ha.call(Object);function Tf(e){if(!Mn(e)||ir(e)!=yf)return!1;var t=Ba(e);if(t===null)return!0;var n=bf.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Ha.call(n)==Af}function Nf(){this.__data__=new jt,this.size=0}function Mf(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Df(e){return this.__data__.get(e)}function xf(e){return this.__data__.has(e)}var Lf=200;function Uf(e,t){var n=this.__data__;if(n instanceof jt){var r=n.__data__;if(!ka||r.length<Lf-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Zt(r)}return n.set(e,t),this.size=n.size,this}function Dn(e){var t=this.__data__=new jt(e);this.size=t.size}Dn.prototype.clear=Nf;Dn.prototype.delete=Mf;Dn.prototype.get=Df;Dn.prototype.has=xf;Dn.prototype.set=Uf;var Wa=typeof exports=="object"&&exports&&!exports.nodeType&&exports,go=Wa&&typeof module=="object"&&module&&!module.nodeType&&module,Pf=go&&go.exports===Wa,po=Pf?dn.Buffer:void 0;po&&po.allocUnsafe;function Ff(e,t){return e.slice()}var mo=dn.Uint8Array;function kf(e){var t=new e.constructor(e.byteLength);return new mo(t).set(new mo(e)),t}function $f(e,t){var n=kf(e.buffer);return new e.constructor(n,e.byteOffset,e.length)}function jf(e){return typeof e.constructor=="function"&&!Ma(e)?Lh(Ba(e)):{}}function Bf(e){return function(t,n,r){for(var s=-1,i=Object(t),o=r(t),a=o.length;a--;){var l=o[++s];if(n(i[l],l,i)===!1)break}return t}}var Hf=Bf(),Cs=function(){return dn.Date.now()},Wf="Expected a function",Yf=Math.max,zf=Math.min;function Vf(e,t,n){var r,s,i,o,a,l,c=0,h=!1,u=!1,d=!0;if(typeof e!="function")throw new TypeError(Wf);t=so(t)||0,Rt(n)&&(h=!!n.leading,u="maxWait"in n,i=u?Yf(so(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d);function f(A){var H=r,q=s;return r=s=void 0,c=A,o=e.apply(q,H),o}function E(A){return c=A,a=setTimeout(T,t),h?f(A):o}function v(A){var H=A-l,q=A-c,de=t-H;return u?zf(de,i-q):de}function O(A){var H=A-l,q=A-c;return l===void 0||H>=t||H<0||u&&q>=i}function T(){var A=Cs();if(O(A))return V(A);a=setTimeout(T,v(A))}function V(A){return a=void 0,d&&r?f(A):(r=s=void 0,o)}function Y(){a!==void 0&&clearTimeout(a),c=0,r=l=s=a=void 0}function ie(){return a===void 0?o:V(Cs())}function N(){var A=Cs(),H=O(A);if(r=arguments,s=this,l=A,H){if(a===void 0)return E(l);if(u)return clearTimeout(a),a=setTimeout(T,t),f(l)}return a===void 0&&(a=setTimeout(T,t)),o}return N.cancel=Y,N.flush=ie,N}function Ps(e,t,n){(n!==void 0&&!as(e[t],n)||n===void 0&&!(t in e))&&Ei(e,t,n)}function Gf(e){return Mn(e)&&vi(e)}function Fs(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function Kf(e){return Kh(e,Fa(e))}function Xf(e,t,n,r,s,i,o){var a=Fs(e,n),l=Fs(t,n),c=o.get(l);if(c){Ps(e,n,c);return}var h=i?i(a,l,n+"",e,t,o):void 0,u=h===void 0;if(u){var d=An(l),f=!d&&La(l),E=!d&&!f&&Pa(l);h=l,d||f||E?An(a)?h=a:Gf(a)?h=Ph(a):f?(u=!1,h=Ff(l)):E?(u=!1,h=$f(l)):h=[]:Tf(l)||Us(l)?(h=a,Us(a)?h=Kf(a):(!Rt(a)||pi(a))&&(h=jf(l))):u=!1}u&&(o.set(l,h),s(h,l,r,i,o),o.delete(l)),Ps(e,n,h)}function Ri(e,t,n,r,s){e!==t&&Hf(t,function(i,o){if(s||(s=new Dn),Rt(i))Xf(e,t,o,n,Ri,r,s);else{var a=r?r(Fs(e,o),i,o+"",e,t,s):void 0;a===void 0&&(a=i),Ps(e,o,a)}},Fa)}var Qf=Na(function(e,t,n,r){Ri(e,t,n,r)}),Ii=Na(function(e,t,n){Ri(e,t,n)});function Jf(e,t,n,r){if(!Rt(e))return e;t=$a(t,e);for(var s=-1,i=t.length,o=i-1,a=e;a!=null&&++s<i;){var l=ja(t[s]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(s!=o){var h=a[l];c=void 0,c===void 0&&(c=Rt(h)?h:_i(t[s+1])?[]:{})}Aa(a,l,c),a=a[l]}return e}function qf(e,t,n){return e==null?e:Jf(e,t,n)}function It(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rs,_o;function Zf(){if(_o)return Rs;_o=1;var e=-1,t=1,n=0;function r(m,B,S,D,w){if(m===B)return m?[[n,m]]:[];if(S!=null){var y=de(m,B,S);if(y)return y}var F=a(m,B),$=m.substring(0,F);m=m.substring(F),B=B.substring(F),F=c(m,B);var G=m.substring(m.length-F);m=m.substring(0,m.length-F),B=B.substring(0,B.length-F);var re=s(m,B);return $&&re.unshift([n,$]),G&&re.push([n,G]),V(re,w),D&&u(re),re}function s(m,B){var S;if(!m)return[[t,B]];if(!B)return[[e,m]];var D=m.length>B.length?m:B,w=m.length>B.length?B:m,y=D.indexOf(w);if(y!==-1)return S=[[t,D.substring(0,y)],[n,w],[t,D.substring(y+w.length)]],m.length>B.length&&(S[0][0]=S[2][0]=e),S;if(w.length===1)return[[e,m],[t,B]];var F=h(m,B);if(F){var $=F[0],G=F[1],re=F[2],he=F[3],fe=F[4],Ae=r($,re),we=r(G,he);return Ae.concat([[n,fe]],we)}return i(m,B)}function i(m,B){for(var S=m.length,D=B.length,w=Math.ceil((S+D)/2),y=w,F=2*w,$=new Array(F),G=new Array(F),re=0;re<F;re++)$[re]=-1,G[re]=-1;$[y+1]=0,G[y+1]=0;for(var he=S-D,fe=he%2!==0,Ae=0,we=0,I=0,k=0,K=0;K<w;K++){for(var Q=-K+Ae;Q<=K-we;Q+=2){var z=y+Q,W;Q===-K||Q!==K&&$[z-1]<$[z+1]?W=$[z+1]:W=$[z-1]+1;for(var le=W-Q;W<S&&le<D&&m.charAt(W)===B.charAt(le);)W++,le++;if($[z]=W,W>S)we+=2;else if(le>D)Ae+=2;else if(fe){var oe=y+he-Q;if(oe>=0&&oe<F&&G[oe]!==-1){var j=S-G[oe];if(W>=j)return o(m,B,W,le)}}}for(var te=-K+I;te<=K-k;te+=2){var oe=y+te,j;te===-K||te!==K&&G[oe-1]<G[oe+1]?j=G[oe+1]:j=G[oe-1]+1;for(var se=j-te;j<S&&se<D&&m.charAt(S-j-1)===B.charAt(D-se-1);)j++,se++;if(G[oe]=j,j>S)k+=2;else if(se>D)I+=2;else if(!fe){var z=y+he-te;if(z>=0&&z<F&&$[z]!==-1){var W=$[z],le=y+W-z;if(j=S-j,W>=j)return o(m,B,W,le)}}}}return[[e,m],[t,B]]}function o(m,B,S,D){var w=m.substring(0,S),y=B.substring(0,D),F=m.substring(S),$=B.substring(D),G=r(w,y),re=r(F,$);return G.concat(re)}function a(m,B){if(!m||!B||m.charAt(0)!==B.charAt(0))return 0;for(var S=0,D=Math.min(m.length,B.length),w=D,y=0;S<w;)m.substring(y,w)==B.substring(y,w)?(S=w,y=S):D=w,w=Math.floor((D-S)/2+S);return Y(m.charCodeAt(w-1))&&w--,w}function l(m,B){var S=m.length,D=B.length;if(S==0||D==0)return 0;S>D?m=m.substring(S-D):S<D&&(B=B.substring(0,S));var w=Math.min(S,D);if(m==B)return w;for(var y=0,F=1;;){var $=m.substring(w-F),G=B.indexOf($);if(G==-1)return y;F+=G,(G==0||m.substring(w-F)==B.substring(0,F))&&(y=F,F++)}}function c(m,B){if(!m||!B||m.slice(-1)!==B.slice(-1))return 0;for(var S=0,D=Math.min(m.length,B.length),w=D,y=0;S<w;)m.substring(m.length-w,m.length-y)==B.substring(B.length-w,B.length-y)?(S=w,y=S):D=w,w=Math.floor((D-S)/2+S);return ie(m.charCodeAt(m.length-w))&&w--,w}function h(m,B){var S=m.length>B.length?m:B,D=m.length>B.length?B:m;if(S.length<4||D.length*2<S.length)return null;function w(we,I,k){for(var K=we.substring(k,k+Math.floor(we.length/4)),Q=-1,z="",W,le,oe,j;(Q=I.indexOf(K,Q+1))!==-1;){var te=a(we.substring(k),I.substring(Q)),se=c(we.substring(0,k),I.substring(0,Q));z.length<se+te&&(z=I.substring(Q-se,Q)+I.substring(Q,Q+te),W=we.substring(0,k-se),le=we.substring(k+te),oe=I.substring(0,Q-se),j=I.substring(Q+te))}return z.length*2>=we.length?[W,le,oe,j,z]:null}var y=w(S,D,Math.ceil(S.length/4)),F=w(S,D,Math.ceil(S.length/2)),$;if(!y&&!F)return null;F?y?$=y[4].length>F[4].length?y:F:$=F:$=y;var G,re,he,fe;m.length>B.length?(G=$[0],re=$[1],he=$[2],fe=$[3]):(he=$[0],fe=$[1],G=$[2],re=$[3]);var Ae=$[4];return[G,re,he,fe,Ae]}function u(m){for(var B=!1,S=[],D=0,w=null,y=0,F=0,$=0,G=0,re=0;y<m.length;)m[y][0]==n?(S[D++]=y,F=G,$=re,G=0,re=0,w=m[y][1]):(m[y][0]==t?G+=m[y][1].length:re+=m[y][1].length,w&&w.length<=Math.max(F,$)&&w.length<=Math.max(G,re)&&(m.splice(S[D-1],0,[e,w]),m[S[D-1]+1][0]=t,D--,D--,y=D>0?S[D-1]:-1,F=0,$=0,G=0,re=0,w=null,B=!0)),y++;for(B&&V(m),T(m),y=1;y<m.length;){if(m[y-1][0]==e&&m[y][0]==t){var he=m[y-1][1],fe=m[y][1],Ae=l(he,fe),we=l(fe,he);Ae>=we?(Ae>=he.length/2||Ae>=fe.length/2)&&(m.splice(y,0,[n,fe.substring(0,Ae)]),m[y-1][1]=he.substring(0,he.length-Ae),m[y+1][1]=fe.substring(Ae),y++):(we>=he.length/2||we>=fe.length/2)&&(m.splice(y,0,[n,he.substring(0,we)]),m[y-1][0]=t,m[y-1][1]=fe.substring(0,fe.length-we),m[y+1][0]=e,m[y+1][1]=he.substring(we),y++),y++}y++}}var d=/[^a-zA-Z0-9]/,f=/\s/,E=/[\r\n]/,v=/\n\r?\n$/,O=/^\r?\n\r?\n/;function T(m){function B(we,I){if(!we||!I)return 6;var k=we.charAt(we.length-1),K=I.charAt(0),Q=k.match(d),z=K.match(d),W=Q&&k.match(f),le=z&&K.match(f),oe=W&&k.match(E),j=le&&K.match(E),te=oe&&we.match(v),se=j&&I.match(O);return te||se?5:oe||j?4:Q&&!W&&le?3:W||le?2:Q||z?1:0}for(var S=1;S<m.length-1;){if(m[S-1][0]==n&&m[S+1][0]==n){var D=m[S-1][1],w=m[S][1],y=m[S+1][1],F=c(D,w);if(F){var $=w.substring(w.length-F);D=D.substring(0,D.length-F),w=$+w.substring(0,w.length-F),y=$+y}for(var G=D,re=w,he=y,fe=B(D,w)+B(w,y);w.charAt(0)===y.charAt(0);){D+=w.charAt(0),w=w.substring(1)+y.charAt(0),y=y.substring(1);var Ae=B(D,w)+B(w,y);Ae>=fe&&(fe=Ae,G=D,re=w,he=y)}m[S-1][1]!=G&&(G?m[S-1][1]=G:(m.splice(S-1,1),S--),m[S][1]=re,he?m[S+1][1]=he:(m.splice(S+1,1),S--))}S++}}function V(m,B){m.push([n,""]);for(var S=0,D=0,w=0,y="",F="",$;S<m.length;){if(S<m.length-1&&!m[S][1]){m.splice(S,1);continue}switch(m[S][0]){case t:w++,F+=m[S][1],S++;break;case e:D++,y+=m[S][1],S++;break;case n:var G=S-w-D-1;if(B){if(G>=0&&A(m[G][1])){var re=m[G][1].slice(-1);if(m[G][1]=m[G][1].slice(0,-1),y=re+y,F=re+F,!m[G][1]){m.splice(G,1),S--;var he=G-1;m[he]&&m[he][0]===t&&(w++,F=m[he][1]+F,he--),m[he]&&m[he][0]===e&&(D++,y=m[he][1]+y,he--),G=he}}if(N(m[S][1])){var re=m[S][1].charAt(0);m[S][1]=m[S][1].slice(1),y+=re,F+=re}}if(S<m.length-1&&!m[S][1]){m.splice(S,1);break}if(y.length>0||F.length>0){y.length>0&&F.length>0&&($=a(F,y),$!==0&&(G>=0?m[G][1]+=F.substring(0,$):(m.splice(0,0,[n,F.substring(0,$)]),S++),F=F.substring($),y=y.substring($)),$=c(F,y),$!==0&&(m[S][1]=F.substring(F.length-$)+m[S][1],F=F.substring(0,F.length-$),y=y.substring(0,y.length-$)));var fe=w+D;y.length===0&&F.length===0?(m.splice(S-fe,fe),S=S-fe):y.length===0?(m.splice(S-fe,fe,[t,F]),S=S-fe+1):F.length===0?(m.splice(S-fe,fe,[e,y]),S=S-fe+1):(m.splice(S-fe,fe,[e,y],[t,F]),S=S-fe+2)}S!==0&&m[S-1][0]===n?(m[S-1][1]+=m[S][1],m.splice(S,1)):S++,w=0,D=0,y="",F="";break}}m[m.length-1][1]===""&&m.pop();var Ae=!1;for(S=1;S<m.length-1;)m[S-1][0]===n&&m[S+1][0]===n&&(m[S][1].substring(m[S][1].length-m[S-1][1].length)===m[S-1][1]?(m[S][1]=m[S-1][1]+m[S][1].substring(0,m[S][1].length-m[S-1][1].length),m[S+1][1]=m[S-1][1]+m[S+1][1],m.splice(S-1,1),Ae=!0):m[S][1].substring(0,m[S+1][1].length)==m[S+1][1]&&(m[S-1][1]+=m[S+1][1],m[S][1]=m[S][1].substring(m[S+1][1].length)+m[S+1][1],m.splice(S+1,1),Ae=!0)),S++;Ae&&V(m,B)}function Y(m){return m>=55296&&m<=56319}function ie(m){return m>=56320&&m<=57343}function N(m){return ie(m.charCodeAt(0))}function A(m){return Y(m.charCodeAt(m.length-1))}function H(m){for(var B=[],S=0;S<m.length;S++)m[S][1].length>0&&B.push(m[S]);return B}function q(m,B,S,D){return A(m)||N(D)?null:H([[n,m],[e,B],[t,S],[n,D]])}function de(m,B,S){var D=typeof S=="number"?{index:S,length:0}:S.oldRange,w=typeof S=="number"?null:S.newRange,y=m.length,F=B.length;if(D.length===0&&(w===null||w.length===0)){var $=D.index,G=m.slice(0,$),re=m.slice($),he=w?w.index:null;e:{var fe=$+F-y;if(he!==null&&he!==fe||fe<0||fe>F)break e;var Ae=B.slice(0,fe),we=B.slice(fe);if(we!==re)break e;var I=Math.min($,fe),k=G.slice(0,I),K=Ae.slice(0,I);if(k!==K)break e;var Q=G.slice(I),z=Ae.slice(I);return q(k,Q,z,re)}e:{if(he!==null&&he!==$)break e;var W=$,Ae=B.slice(0,W),we=B.slice(W);if(Ae!==G)break e;var le=Math.min(y-W,F-W),oe=re.slice(re.length-le),j=we.slice(we.length-le);if(oe!==j)break e;var Q=re.slice(0,re.length-le),z=we.slice(0,we.length-le);return q(G,Q,z,oe)}}if(D.length>0&&w&&w.length===0)e:{var k=m.slice(0,D.index),oe=m.slice(D.index+D.length),I=k.length,le=oe.length;if(F<I+le)break e;var K=B.slice(0,I),j=B.slice(F-le);if(k!==K||oe!==j)break e;var Q=m.slice(I,y-le),z=B.slice(I,F-le);return q(k,Q,z,oe)}return null}function ae(m,B,S,D){return r(m,B,S,D,!0)}return ae.INSERT=t,ae.DELETE=e,ae.EQUAL=n,Rs=ae,Rs}var eg=Zf();const Ya=It(eg);function or(e,t){const n=e.indexOf(t);return n>-1?(e.splice(n,1),!0):!1}function tg(e){const t=new Set,n=[];for(const r of e)t.has(r)||(t.add(r),n.push(r));return n}function ng(e,t){for(let n=e.length-1;n>-1;n--){const r=e[n];if(t(r,n))return r}return null}function rg(e,t){if(e.length===0)return e;const n=t%e.length;return e.slice(n).concat(e.slice(0,n))}function sg(e,t){const n=new Map;return e.forEach(r=>{const s=t(r);let i=n.get(s);n.has(s)||(i=[],n.set(s,i)),i.push(r)}),n}function ig(e){return Array.isArray(e)?e:[e]}function og(e){return["true","false"].includes(e.toLowerCase())}const ar="__INTERNAL_EDITOR__",Si=`${ar}DOCS_NORMAL`,yi=`${ar}DOCS_FORMULA_BAR`,za=`${ar}ZEN_EDITOR`,Va=`\r
|
|
2
|
-
`,ag="isRowStylePrecedeColumnStyle";function lg(e){return`${ar}${e}`}function Ga(e){return e.startsWith(ar)}var Oi=Symbol("$$IDENTIFIER_DECORATOR");function ug(e){return e&&e[Oi]===!0}function wi(e){return typeof e=="function"}function ks(e){return!!(e&&typeof e.useClass<"u")}function $s(e){return!!(e&&typeof e.useFactory<"u")}function js(e){return!!(e&&typeof e.useValue<"u")}function cg(e){return!!(e&&typeof e.useExisting<"u")}function Bs(e){return!!(e&&typeof e.useAsync<"u")}var Ka=Symbol("AsyncHook");function xr(e){return!!(e&&e.__symbol===Ka)}function _t(e){return typeof e>"u"?"undefined":wi(e)&&!e[Oi]?e.name:e.toString()}var hg=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),st=function(e){hg(t,e);function t(n){return e.call(this,"[redi]: ".concat(n))||this}return t}(Error);exports.Quantity=void 0;(function(e){e.MANY="many",e.OPTIONAL="optional",e.REQUIRED="required"})(exports.Quantity||(exports.Quantity={}));exports.LookUp=void 0;(function(e){e.SELF="self",e.SKIP_SELF="skipSelf"})(exports.LookUp||(exports.LookUp={}));var Xa=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Eo=Symbol("$$TARGET"),Hs=Symbol("$$DEPENDENCIES"),dg=function(e){Xa(t,e);function t(n,r){var s="Could not find dependency registered on the ".concat(n,' (indexed) parameter of the constructor of "').concat(_t(r),'".');return e.call(this,s)||this}return t}(st),Qa=function(e){Xa(t,e);function t(n,r){var s='It seems that you register "undefined" as dependency on the '.concat(r+1,' parameter of "').concat(_t(n),'". Please make sure that there is not cyclic dependency among your TypeScript files, or consider using "forwardRef". For more info please visit our website https://redi.wendell.fun/docs/debug#could-not-find-dependency-registered-on');return e.call(this,s)||this}return t}(st);function Ja(e){var t=e;return t[Hs]||[]}function bi(e,t){var n=Ja(e),r=n.find(function(s){return s.paramIndex===t});if(!r)throw new dg(t,e);return r}function Ai(e,t,n,r,s){r===void 0&&(r=exports.Quantity.REQUIRED);var i={paramIndex:n,identifier:t,quantity:r,lookUp:s,withNew:!1};if(typeof t>"u")throw new Qa(e,n);var o=e;o[Eo]===o?o[Hs].push(i):(o[Hs]=[i],o[Eo]=o)}var vo=new Set;function mt(e){if(vo.has(e))throw new st('Identifier "'.concat(e,'" already exists.'));vo.add(e);var t=function(n,r,s){Ai(n,t,s)};return t.toString=function(){return e},t[Oi]=!0,t}function fg(e,t,n){var r=bi(e,t);r.lookUp=n}function qa(e){return function t(){return this instanceof t?this:function(n,r,s){fg(n,s,e)}}}var Za=qa(exports.LookUp.SKIP_SELF),el=qa(exports.LookUp.SELF),gg=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ws=function(e){gg(t,e);function t(n,r,s){var i=this,o='Expect "'.concat(r,'" dependency items for id "').concat(_t(n),'" but get ').concat(s,".");return s===0&&(o+=" Did you forget to register it?"),s>1&&(o+=" You register it more than once."),i=e.call(this,o)||this,i.quantity=r,i.actual=s,i}return t}(st);function Ti(e,t,n){if(t===exports.Quantity.OPTIONAL&&n>1||t===exports.Quantity.REQUIRED&&n!==1)throw new Ws(e,t,n)}function pg(e,t){return e===exports.Quantity.MANY?t:t[0]}function mg(e,t,n){var r=bi(e,t);r.quantity=n}function Ni(e){return function t(n){return this instanceof t?this:function(r,s,i){if(n)Ai(r,n,i,e);else{if(e===exports.Quantity.REQUIRED)throw new Qa(r,i);mg(r,i,e)}}}}var tl=Ni(exports.Quantity.MANY),nl=Ni(exports.Quantity.OPTIONAL),at=Ni(exports.Quantity.REQUIRED);function _g(e,t,n){var r=bi(e,t);r.withNew=n}function Eg(e){return function t(){return this instanceof t?this:function(n,r,s){_g(n,s,e)}}}var rl=Eg(!0);function sl(e,t){return t===void 0&&(t=0),e?e.map(function(n,r){if(r+=t,!Array.isArray(n))return{paramIndex:r,identifier:n,quantity:exports.Quantity.REQUIRED,withNew:!1};var s=n.slice(0,n.length-1),i=n[n.length-1],o,a=exports.Quantity.REQUIRED,l=!1;return s.forEach(function(c){if(c instanceof el)o=exports.LookUp.SELF;else if(c instanceof Za)o=exports.LookUp.SKIP_SELF;else if(c instanceof nl)a=exports.Quantity.OPTIONAL;else if(c instanceof tl)a=exports.Quantity.MANY;else if(c instanceof rl)l=!0;else throw new st("unknown dep modifier ".concat(c,"."))}),{paramIndex:r,identifier:i,quantity:a,lookUp:o,withNew:l}}):[]}function vg(e,t,n){n===void 0&&(n=0);var r=sl(t,n);r.forEach(function(s){Ai(e,s.identifier,s.paramIndex,s.quantity,s.lookUp)})}function Cg(e){return{unwrap:e}}function Rg(e){return!!e&&typeof e.unwrap=="function"}function Ig(e){return Rg(e)?e.unwrap():e}function Ys(e){return!!e&&typeof e.dispose=="function"}var il=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();function Sg(e){return e.length===1}var cs=[];function Co(e){cs.push(e)}function Ro(){cs.pop()}function yg(){cs.length=0}var Io=function(e){il(t,e);function t(n,r,s){var i='Cannot find "'.concat(_t(r),'" registered by any injector. It is the ').concat(s,'th param of "').concat(ug(n)?_t(n):n.name,'".');return e.call(this,i)||this}return t}(st),Lr=function(e){il(t,e);function t(n){var r=this,s='Cannot find "'.concat(_t(n),'" registered by any injector. The stack of dependencies is: "').concat(cs.map(function(i){return _t(i)}).join(" -> "),'".');return r=e.call(this,s)||this,yg(),r}return t}(st),Og=function(){function e(t){var n=this;this.dependencyMap=new Map,this.normalizeDependencies(t).map(function(r){return n.add(r[0],r[1])})}return e.prototype.add=function(t,n){typeof n>"u"&&(n={useClass:t,lazy:!1});var r=this.dependencyMap.get(t);typeof r>"u"&&(r=[],this.dependencyMap.set(t,r)),r.push(n)},e.prototype.delete=function(t){this.dependencyMap.delete(t)},e.prototype.get=function(t,n){n===void 0&&(n=exports.Quantity.REQUIRED);var r=this.dependencyMap.get(t);return Ti(t,n,r.length),pg(n,r)},e.prototype.has=function(t){return this.dependencyMap.has(t)},e.prototype.append=function(t){var n=this;this.normalizeDependencies(t).forEach(function(r){return n.add(r[0],r[1])})},e.prototype.dispose=function(){this.dependencyMap.clear()},e.prototype.normalizeDependencies=function(t){return t.map(function(n){var r=n[0],s;return Sg(n)?s={useClass:n[0],lazy:!1}:s=n[1],[r,s]})},e}(),wg=function(){function e(){this.resolvedDependencies=new Map}return e.prototype.add=function(t,n){var r=this.resolvedDependencies.get(t);typeof r>"u"&&(r=[],this.resolvedDependencies.set(t,r)),r.push(n)},e.prototype.has=function(t){return this.resolvedDependencies.has(t)},e.prototype.delete=function(t){if(this.resolvedDependencies.has(t)){var n=this.resolvedDependencies.get(t);n.forEach(function(r){return Ys(r)?r.dispose():void 0}),this.resolvedDependencies.delete(t)}},e.prototype.get=function(t,n){n===void 0&&(n=exports.Quantity.REQUIRED);var r=this.resolvedDependencies.get(t);if(!r)throw new Lr(t);return Ti(t,n,r.length),n===exports.Quantity.MANY?r:r[0]},e.prototype.dispose=function(){Array.from(this.resolvedDependencies.values()).forEach(function(t){t.forEach(function(n){return Ys(n)?n.dispose():void 0})}),this.resolvedDependencies.clear()},e}(),zs;(function(){if(typeof requestIdleCallback<"u"&&typeof cancelIdleCallback<"u")zs=function(t,n){var r=requestIdleCallback(t,typeof n=="number"?{timeout:n}:void 0),s=!1;return function(){s||(s=!0,cancelIdleCallback(r))}};else{var e=Object.freeze({didTimeout:!0,timeRemaining:function(){return 15}});zs=function(t){var n=setTimeout(function(){return t(e)}),r=!1;return function(){r||(r=!0,clearTimeout(n))}}}})();var bg=function(){function e(t){var n=this;this.didRun=!1,this.selfExecutor=function(){try{n.value=t()}catch(r){n.error=r}finally{n.didRun=!0}},this.disposeCallback=zs(function(){return n.selfExecutor()})}return e.prototype.hasRun=function(){return this.didRun},e.prototype.dispose=function(){this.disposeCallback()},e.prototype.getValue=function(){if(this.didRun||(this.dispose(),this.selfExecutor()),this.error)throw this.error;return this.value},e}(),xn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Kr=function(){return Kr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},Kr.apply(this,arguments)},tn=function(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))},Ag=300,vr=Symbol("$$NOT_INSTANTIATED_SYMBOL"),Tg=function(e){xn(t,e);function t(n){return e.call(this,'Detecting cyclic dependency. The last identifier is "'.concat(_t(n),'".'))||this}return t}(st),Ng=function(e){xn(t,e);function t(){return e.call(this,"Injector cannot be accessed after it was disposed.")||this}return t}(st),Mg=function(e){xn(t,e);function t(n){return e.call(this,'Async item "'.concat(_t(n),'" returns another async item.'))||this}return t}(st),Dg=function(e){xn(t,e);function t(n){return e.call(this,'Cannot get async item "'.concat(_t(n),'" from sync api.'))||this}return t}(st),So=function(e){xn(t,e);function t(n){return e.call(this,'Cannot add dependency "'.concat(_t(n),'" after it is already resolved.'))||this}return t}(st),xg=function(e){xn(t,e);function t(n){return e.call(this,'Cannot dependency dependency "'.concat(_t(n),'" after it is already resolved.'))||this}return t}(st),St=function(){function e(t,n){n===void 0&&(n=null),this.parent=n,this.children=[],this.resolutionOngoing=0,this.disposingCallbacks=new Set,this.disposed=!1,this.dependencyCollection=new Og(t||[]),this.resolvedDependencyCollection=new wg,n&&n.children.push(this)}return e.prototype.onDispose=function(t){var n=this;return this.disposingCallbacks.add(t),{dispose:function(){return n.disposingCallbacks.delete(t)}}},e.prototype.createChild=function(t){return this._ensureInjectorNotDisposed(),new e(t,this)},e.prototype.dispose=function(){this.children.forEach(function(t){return t.dispose()}),this.children.length=0,this.dependencyCollection.dispose(),this.resolvedDependencyCollection.dispose(),this.deleteSelfFromParent(),this.disposed=!0,this.disposingCallbacks.forEach(function(t){return t()}),this.disposingCallbacks.clear()},e.prototype.deleteSelfFromParent=function(){if(this.parent){var t=this.parent.children.indexOf(this);t>-1&&this.parent.children.splice(t,1)}},e.prototype.add=function(t){this._ensureInjectorNotDisposed();var n=t[0],r=t[1];if(this.resolvedDependencyCollection.has(n))throw new So(n);typeof r>"u"?this.dependencyCollection.add(n):Bs(r)||ks(r)||js(r)||$s(r)?this.dependencyCollection.add(n,r):this.resolvedDependencyCollection.add(n,r)},e.prototype.replace=function(t){this._ensureInjectorNotDisposed();var n=t[0];if(this.resolvedDependencyCollection.has(n))throw new So(n);this.dependencyCollection.delete(n),t.length===1?this.dependencyCollection.add(n):this.dependencyCollection.add(n,t[1])},e.prototype.delete=function(t){if(this._ensureInjectorNotDisposed(),this.resolvedDependencyCollection.has(t))throw new xg(t);this.dependencyCollection.delete(t)},e.prototype.invoke=function(t){for(var n=this,r=[],s=1;s<arguments.length;s++)r[s-1]=arguments[s];this._ensureInjectorNotDisposed();var i={get:function(o,a,l){return n._get(o,a,l)},has:function(o){return n.has(o)}};return t.apply(void 0,tn([i],r,!1))},e.prototype.has=function(t){var n;return this.dependencyCollection.has(t)||((n=this.parent)===null||n===void 0?void 0:n.has(t))||!1},e.prototype.get=function(t,n,r){this._ensureInjectorNotDisposed();var s=this._get(t,n,r);if(Array.isArray(s)&&s.some(function(i){return xr(i)})||xr(s))throw new Dg(t);return s},e.prototype._get=function(t,n,r,s){var i=exports.Quantity.REQUIRED;if(n===exports.Quantity.REQUIRED||n===exports.Quantity.OPTIONAL||n===exports.Quantity.MANY?i=n:r=n,!s){var o=this.getValue(t,i,r);if(o!==vr)return o}return this.createDependency(t,i,r,!s)},e.prototype.getAsync=function(t){this._ensureInjectorNotDisposed();var n=this.getValue(t,exports.Quantity.REQUIRED);if(n!==vr)return Promise.resolve(n);var r=this.createDependency(t,exports.Quantity.REQUIRED);return xr(r)?r.whenReady():Promise.resolve(r)},e.prototype.createInstance=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return this._ensureInjectorNotDisposed(),this._resolveClassImpl.apply(this,tn([{useClass:t}],n,!1))},e.prototype._resolveDependency=function(t,n,r){r===void 0&&(r=!0);var s;Co(t);try{js(n)?s=this._resolveValueDependency(t,n):$s(n)?s=this._resolveFactory(t,n,r):ks(n)?s=this._resolveClass(t,n,r):cg(n)?s=this._resolveExisting(t,n):s=this._resolveAsync(t,n),Ro()}catch(i){throw Ro(),i}return s},e.prototype._resolveExisting=function(t,n){var r=this.get(n.useExisting);return this.resolvedDependencyCollection.add(t,r),r},e.prototype._resolveValueDependency=function(t,n){var r=n.useValue;return this.resolvedDependencyCollection.add(t,r),r},e.prototype._resolveClass=function(t,n,r){var s=this;r===void 0&&(r=!0);var i;if(n.lazy){var o=new bg(function(){return s._ensureInjectorNotDisposed(),s._resolveClassImpl(n)});i=new Proxy(Object.create(null),{get:function(a,l){if(l in a)return a[l];if(l!=="whenReady"){var c=o.getValue(),h=c[l];return typeof h!="function"||(h=h.bind(c),a[l]=h),h}},set:function(a,l,c){return o.getValue()[l]=c,!0}})}else i=this._resolveClassImpl(n);return t&&r&&this.resolvedDependencyCollection.add(t,i),i},e.prototype._resolveClassImpl=function(t){for(var n,r=[],s=1;s<arguments.length;s++)r[s-1]=arguments[s];var i=t.useClass;this.markNewResolution(i);for(var o=Ja(i).sort(function(O,T){return O.paramIndex-T.paramIndex}).map(function(O){return Kr(Kr({},O),{identifier:Ig(O.identifier)})}),a=[],l=0,c=o;l<c.length;l++){var h=c[l];try{var u=this._get(h.identifier,h.quantity,h.lookUp,h.withNew);a.push(u)}catch(O){throw O instanceof Lr||O instanceof Ws&&O.actual===0?new Io(i,h.identifier,h.paramIndex):O}}var d=tn([],r,!0),f=o.length>0?o[0].paramIndex:d.length;if(d.length!==f){console.warn("[redi]: Expect ".concat(f," custom parameter(s) of ").concat(_t(i)," but get ").concat(d.length,"."));var E=f-d.length;E>0?d=tn(tn([],d,!0),Array.from({length:E}).fill(void 0),!0):d=d.slice(0,f)}var v=new(i.bind.apply(i,tn(tn([void 0],d,!1),a,!1)));return(n=t==null?void 0:t.onInstantiation)===null||n===void 0||n.call(t,v),this.markResolutionCompleted(),v},e.prototype._resolveFactory=function(t,n,r){var s;this.markNewResolution(t);for(var i=sl(n.deps),o=[],a=0,l=i;a<l.length;a++){var c=l[a];try{var h=this._get(c.identifier,c.quantity,c.lookUp,c.withNew);o.push(h)}catch(d){throw d instanceof Lr||d instanceof Ws&&d.actual===0?new Io(t,c.identifier,c.paramIndex):d}}var u=n.useFactory.apply(null,o);return r&&this.resolvedDependencyCollection.add(t,u),this.markResolutionCompleted(),(s=n==null?void 0:n.onInstantiation)===null||s===void 0||s.call(n,u),u},e.prototype._resolveAsync=function(t,n){var r=this,s={__symbol:Ka,whenReady:function(){return r._resolveAsyncImpl(t,n)}};return s},e.prototype._resolveAsyncImpl=function(t,n){var r=this;return n.useAsync().then(function(s){var i=r.getValue(t);if(i!==vr)return i;var o;if(Array.isArray(s)){var a=s[1];if(Bs(a))throw new Mg(t);o=r._resolveDependency(t,a)}else wi(s)?o=r._resolveClassImpl({useClass:s,onInstantiation:n.onInstantiation}):o=s;return r.resolvedDependencyCollection.add(t,o),o})},e.prototype.getValue=function(t,n,r){var s=this;n===void 0&&(n=exports.Quantity.REQUIRED);var i=function(){return s.dependencyCollection.has(t)&&!s.resolvedDependencyCollection.has(t)?vr:s.resolvedDependencyCollection.get(t,n)},o=function(){return s.parent?s.parent.getValue(t,n):(Ti(t,n,0),n===exports.Quantity.MANY?[]:null)};return r===exports.LookUp.SKIP_SELF?o():t===e?this:r===exports.LookUp.SELF||this.resolvedDependencyCollection.has(t)||this.dependencyCollection.has(t)?i():o()},e.prototype.createDependency=function(t,n,r,s){var i=this;n===void 0&&(n=exports.Quantity.REQUIRED),s===void 0&&(s=!0);var o=function(){var l=i.dependencyCollection.get(t,n),c=null;return Array.isArray(l)?c=l.map(function(h){return i._resolveDependency(t,h,s)}):l&&(c=i._resolveDependency(t,l,s)),c},a=function(){if(i.parent)return i.parent.createDependency(t,n,void 0,s);if(n===exports.Quantity.OPTIONAL)return null;throw Co(t),new Lr(t)};return r===exports.LookUp.SKIP_SELF?a():this.dependencyCollection.has(t)?o():a()},e.prototype.markNewResolution=function(t){if(this.resolutionOngoing+=1,this.resolutionOngoing>=Ag)throw new Tg(t)},e.prototype.markResolutionCompleted=function(){this.resolutionOngoing-=1},e.prototype._ensureInjectorNotDisposed=function(){if(this.disposed)throw new Ng},e}(),yo=typeof globalThis<"u"&&globalThis||typeof window<"u"&&window||typeof global<"u"&&global,Oo="REDI_GLOBAL_LOCK",Lg=typeof process<"u"&&process.versions!=null&&process.versions.node!=null;yo[Oo]?Lg||console.error(`[redi]: You are loading scripts of redi more than once! This may cause undesired behavior in your application.
|
|
1
|
+
"use strict";var rh=Object.defineProperty;var sh=(e,t,n)=>t in e?rh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var C=(e,t,n)=>sh(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Oe=require("rxjs"),$r=require("rxjs/operators"),lt=require("react");function ih(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}function oh(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const wt=ih(lt);function ah(){lh()}const Or=typeof global<"u"?global:typeof self<"u"?self:window;function lh(){typeof Or.requestIdleCallback!="function"&&(Or.requestIdleCallback=function(n){const r=Date.now();return setTimeout(function(){const i=Math.max(0,50-(Date.now()-r));n({didTimeout:i===0,timeRemaining(){return i}})},1)}),typeof Or.cancelIdleCallback!="function"&&(Or.cancelIdleCallback=function(n){clearTimeout(n)})}var Pa=typeof global=="object"&&global&&global.Object===Object&&global,uh=typeof self=="object"&&self&&self.Object===Object&&self,Cn=Pa||uh||Function("return this")(),Ln=Cn.Symbol,Fa=Object.prototype,ch=Fa.hasOwnProperty,hh=Fa.toString,Gn=Ln?Ln.toStringTag:void 0;function dh(e){var t=ch.call(e,Gn),n=e[Gn];try{e[Gn]=void 0;var r=!0}catch{}var s=hh.call(e);return r&&(t?e[Gn]=n:delete e[Gn]),s}var fh=Object.prototype,gh=fh.toString;function ph(e){return gh.call(e)}var mh="[object Null]",_h="[object Undefined]",fo=Ln?Ln.toStringTag:void 0;function fr(e){return e==null?e===void 0?_h:mh:fo&&fo in Object(e)?dh(e):ph(e)}function Bn(e){return e!=null&&typeof e=="object"}var Eh="[object Symbol]";function ps(e){return typeof e=="symbol"||Bn(e)&&fr(e)==Eh}function Ch(e,t){for(var n=-1,r=e==null?0:e.length,s=Array(r);++n<r;)s[n]=t(e[n],n,e);return s}var Un=Array.isArray,go=Ln?Ln.prototype:void 0,po=go?go.toString:void 0;function ka(e){if(typeof e=="string")return e;if(Un(e))return Ch(e,ka)+"";if(ps(e))return po?po.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var Rh=/\s/;function Ih(e){for(var t=e.length;t--&&Rh.test(e.charAt(t)););return t}var vh=/^\s+/;function yh(e){return e&&e.slice(0,Ih(e)+1).replace(vh,"")}function yt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var mo=NaN,Sh=/^[-+]0x[0-9a-f]+$/i,Oh=/^0b[01]+$/i,bh=/^0o[0-7]+$/i,wh=parseInt;function _o(e){if(typeof e=="number")return e;if(ps(e))return mo;if(yt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=yt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=yh(e);var n=Oh.test(e);return n||bh.test(e)?wh(e.slice(2),n?2:8):Sh.test(e)?mo:+e}function $a(e){return e}var Ah="[object AsyncFunction]",Th="[object Function]",Nh="[object GeneratorFunction]",Mh="[object Proxy]";function Oi(e){if(!yt(e))return!1;var t=fr(e);return t==Th||t==Nh||t==Ah||t==Mh}var ws=Cn["__core-js_shared__"],Eo=function(){var e=/[^.]+$/.exec(ws&&ws.keys&&ws.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Dh(e){return!!Eo&&Eo in e}var xh=Function.prototype,Lh=xh.toString;function Uh(e){if(e!=null){try{return Lh.call(e)}catch{}try{return e+""}catch{}}return""}var Ph=/[\\^$.*+?()[\]{}|]/g,Fh=/^\[object .+?Constructor\]$/,kh=Function.prototype,$h=Object.prototype,Bh=kh.toString,jh=$h.hasOwnProperty,Hh=RegExp("^"+Bh.call(jh).replace(Ph,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Wh(e){if(!yt(e)||Dh(e))return!1;var t=Oi(e)?Hh:Fh;return t.test(Uh(e))}function zh(e,t){return e==null?void 0:e[t]}function bi(e,t){var n=zh(e,t);return Wh(n)?n:void 0}var Co=Object.create,Yh=function(){function e(){}return function(t){if(!yt(t))return{};if(Co)return Co(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Vh(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Gh(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Kh=800,Xh=16,Qh=Date.now;function qh(e){var t=0,n=0;return function(){var r=Qh(),s=Xh-(r-n);if(n=r,s>0){if(++t>=Kh)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Jh(e){return function(){return e}}var es=function(){try{var e=bi(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Zh=es?function(e,t){return es(e,"toString",{configurable:!0,enumerable:!1,value:Jh(t),writable:!0})}:$a,ed=qh(Zh),td=9007199254740991,nd=/^(?:0|[1-9]\d*)$/;function wi(e,t){var n=typeof e;return t=t==null?td:t,!!t&&(n=="number"||n!="symbol"&&nd.test(e))&&e>-1&&e%1==0&&e<t}function Ai(e,t,n){t=="__proto__"&&es?es(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ms(e,t){return e===t||e!==e&&t!==t}var rd=Object.prototype,sd=rd.hasOwnProperty;function Ba(e,t,n){var r=e[t];(!(sd.call(e,t)&&ms(r,n))||n===void 0&&!(t in e))&&Ai(e,t,n)}function id(e,t,n,r){var s=!n;n||(n={});for(var i=-1,o=t.length;++i<o;){var a=t[i],l=void 0;l===void 0&&(l=e[a]),s?Ai(n,a,l):Ba(n,a,l)}return n}var Ro=Math.max;function od(e,t,n){return t=Ro(t===void 0?e.length-1:t,0),function(){for(var r=arguments,s=-1,i=Ro(r.length-t,0),o=Array(i);++s<i;)o[s]=r[t+s];s=-1;for(var a=Array(t+1);++s<t;)a[s]=r[s];return a[t]=n(o),Vh(e,this,a)}}function ad(e,t){return ed(od(e,t,$a),e+"")}var ld=9007199254740991;function ja(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ld}function Ti(e){return e!=null&&ja(e.length)&&!Oi(e)}function ud(e,t,n){if(!yt(n))return!1;var r=typeof t;return(r=="number"?Ti(n)&&wi(t,n.length):r=="string"&&t in n)?ms(n[t],e):!1}function Ha(e){return ad(function(t,n){var r=-1,s=n.length,i=s>1?n[s-1]:void 0,o=s>2?n[2]:void 0;for(i=e.length>3&&typeof i=="function"?(s--,i):void 0,o&&ud(n[0],n[1],o)&&(i=s<3?void 0:i,s=1),t=Object(t);++r<s;){var a=n[r];a&&e(t,a,r,i)}return t})}var cd=Object.prototype;function Wa(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||cd;return e===n}function hd(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var dd="[object Arguments]";function Io(e){return Bn(e)&&fr(e)==dd}var za=Object.prototype,fd=za.hasOwnProperty,gd=za.propertyIsEnumerable,zs=Io(function(){return arguments}())?Io:function(e){return Bn(e)&&fd.call(e,"callee")&&!gd.call(e,"callee")};function pd(){return!1}var Ya=typeof exports=="object"&&exports&&!exports.nodeType&&exports,vo=Ya&&typeof module=="object"&&module&&!module.nodeType&&module,md=vo&&vo.exports===Ya,yo=md?Cn.Buffer:void 0,_d=yo?yo.isBuffer:void 0,Va=_d||pd,Ed="[object Arguments]",Cd="[object Array]",Rd="[object Boolean]",Id="[object Date]",vd="[object Error]",yd="[object Function]",Sd="[object Map]",Od="[object Number]",bd="[object Object]",wd="[object RegExp]",Ad="[object Set]",Td="[object String]",Nd="[object WeakMap]",Md="[object ArrayBuffer]",Dd="[object DataView]",xd="[object Float32Array]",Ld="[object Float64Array]",Ud="[object Int8Array]",Pd="[object Int16Array]",Fd="[object Int32Array]",kd="[object Uint8Array]",$d="[object Uint8ClampedArray]",Bd="[object Uint16Array]",jd="[object Uint32Array]",Je={};Je[xd]=Je[Ld]=Je[Ud]=Je[Pd]=Je[Fd]=Je[kd]=Je[$d]=Je[Bd]=Je[jd]=!0;Je[Ed]=Je[Cd]=Je[Md]=Je[Rd]=Je[Dd]=Je[Id]=Je[vd]=Je[yd]=Je[Sd]=Je[Od]=Je[bd]=Je[wd]=Je[Ad]=Je[Td]=Je[Nd]=!1;function Hd(e){return Bn(e)&&ja(e.length)&&!!Je[fr(e)]}function Wd(e){return function(t){return e(t)}}var Ga=typeof exports=="object"&&exports&&!exports.nodeType&&exports,or=Ga&&typeof module=="object"&&module&&!module.nodeType&&module,zd=or&&or.exports===Ga,As=zd&&Pa.process,So=function(){try{var e=or&&or.require&&or.require("util").types;return e||As&&As.binding&&As.binding("util")}catch{}}(),Oo=So&&So.isTypedArray,Ka=Oo?Wd(Oo):Hd;function Yd(e,t){var n=Un(e),r=!n&&zs(e),s=!n&&!r&&Va(e),i=!n&&!r&&!s&&Ka(e),o=n||r||s||i,a=o?hd(e.length,String):[],l=a.length;for(var c in e)o&&(c=="length"||s&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||wi(c,l))||a.push(c);return a}function Vd(e,t){return function(n){return e(t(n))}}function Gd(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Kd=Object.prototype,Xd=Kd.hasOwnProperty;function Qd(e){if(!yt(e))return Gd(e);var t=Wa(e),n=[];for(var r in e)r=="constructor"&&(t||!Xd.call(e,r))||n.push(r);return n}function Xa(e){return Ti(e)?Yd(e):Qd(e)}var qd=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Jd=/^\w*$/;function Zd(e,t){if(Un(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||ps(e)?!0:Jd.test(e)||!qd.test(e)||t!=null&&e in Object(t)}var cr=bi(Object,"create");function ef(){this.__data__=cr?cr(null):{},this.size=0}function tf(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var nf="__lodash_hash_undefined__",rf=Object.prototype,sf=rf.hasOwnProperty;function of(e){var t=this.__data__;if(cr){var n=t[e];return n===nf?void 0:n}return sf.call(t,e)?t[e]:void 0}var af=Object.prototype,lf=af.hasOwnProperty;function uf(e){var t=this.__data__;return cr?t[e]!==void 0:lf.call(t,e)}var cf="__lodash_hash_undefined__";function hf(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=cr&&t===void 0?cf:t,this}function mn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}mn.prototype.clear=ef;mn.prototype.delete=tf;mn.prototype.get=of;mn.prototype.has=uf;mn.prototype.set=hf;function df(){this.__data__=[],this.size=0}function _s(e,t){for(var n=e.length;n--;)if(ms(e[n][0],t))return n;return-1}var ff=Array.prototype,gf=ff.splice;function pf(e){var t=this.__data__,n=_s(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():gf.call(t,n,1),--this.size,!0}function mf(e){var t=this.__data__,n=_s(t,e);return n<0?void 0:t[n][1]}function _f(e){return _s(this.__data__,e)>-1}function Ef(e,t){var n=this.__data__,r=_s(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Gt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Gt.prototype.clear=df;Gt.prototype.delete=pf;Gt.prototype.get=mf;Gt.prototype.has=_f;Gt.prototype.set=Ef;var Qa=bi(Cn,"Map");function Cf(){this.size=0,this.__data__={hash:new mn,map:new(Qa||Gt),string:new mn}}function Rf(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Es(e,t){var n=e.__data__;return Rf(t)?n[typeof t=="string"?"string":"hash"]:n.map}function If(e){var t=Es(this,e).delete(e);return this.size-=t?1:0,t}function vf(e){return Es(this,e).get(e)}function yf(e){return Es(this,e).has(e)}function Sf(e,t){var n=Es(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function ln(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ln.prototype.clear=Cf;ln.prototype.delete=If;ln.prototype.get=vf;ln.prototype.has=yf;ln.prototype.set=Sf;var Of="Expected a function";function Ni(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Of);var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],i=n.cache;if(i.has(s))return i.get(s);var o=e.apply(this,r);return n.cache=i.set(s,o)||i,o};return n.cache=new(Ni.Cache||ln),n}Ni.Cache=ln;var bf=500;function wf(e){var t=Ni(e,function(r){return n.size===bf&&n.clear(),r}),n=t.cache;return t}var Af=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Tf=/\\(\\)?/g,Nf=wf(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Af,function(n,r,s,i){t.push(s?i.replace(Tf,"$1"):r||n)}),t});function Mf(e){return e==null?"":ka(e)}function qa(e,t){return Un(e)?e:Zd(e,t)?[e]:Nf(Mf(e))}function Ja(e){if(typeof e=="string"||ps(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Df(e,t){t=qa(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Ja(t[n++])];return n&&n==r?e:void 0}function xf(e,t,n){var r=e==null?void 0:Df(e,t);return r===void 0?n:r}var Za=Vd(Object.getPrototypeOf,Object),Lf="[object Object]",Uf=Function.prototype,Pf=Object.prototype,el=Uf.toString,Ff=Pf.hasOwnProperty,kf=el.call(Object);function $f(e){if(!Bn(e)||fr(e)!=Lf)return!1;var t=Za(e);if(t===null)return!0;var n=Ff.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&el.call(n)==kf}function Bf(){this.__data__=new Gt,this.size=0}function jf(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Hf(e){return this.__data__.get(e)}function Wf(e){return this.__data__.has(e)}var zf=200;function Yf(e,t){var n=this.__data__;if(n instanceof Gt){var r=n.__data__;if(!Qa||r.length<zf-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ln(r)}return n.set(e,t),this.size=n.size,this}function jn(e){var t=this.__data__=new Gt(e);this.size=t.size}jn.prototype.clear=Bf;jn.prototype.delete=jf;jn.prototype.get=Hf;jn.prototype.has=Wf;jn.prototype.set=Yf;var tl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,bo=tl&&typeof module=="object"&&module&&!module.nodeType&&module,Vf=bo&&bo.exports===tl,wo=Vf?Cn.Buffer:void 0;wo&&wo.allocUnsafe;function Gf(e,t){return e.slice()}var Ao=Cn.Uint8Array;function Kf(e){var t=new e.constructor(e.byteLength);return new Ao(t).set(new Ao(e)),t}function Xf(e,t){var n=Kf(e.buffer);return new e.constructor(n,e.byteOffset,e.length)}function Qf(e){return typeof e.constructor=="function"&&!Wa(e)?Yh(Za(e)):{}}function qf(e){return function(t,n,r){for(var s=-1,i=Object(t),o=r(t),a=o.length;a--;){var l=o[++s];if(n(i[l],l,i)===!1)break}return t}}var Jf=qf(),Ts=function(){return Cn.Date.now()},Zf="Expected a function",eg=Math.max,tg=Math.min;function ng(e,t,n){var r,s,i,o,a,l,c=0,h=!1,u=!1,d=!0;if(typeof e!="function")throw new TypeError(Zf);t=_o(t)||0,yt(n)&&(h=!!n.leading,u="maxWait"in n,i=u?eg(_o(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d);function f(A){var H=r,J=s;return r=s=void 0,c=A,o=e.apply(J,H),o}function E(A){return c=A,a=setTimeout(T,t),h?f(A):o}function R(A){var H=A-l,J=A-c,de=t-H;return u?tg(de,i-J):de}function O(A){var H=A-l,J=A-c;return l===void 0||H>=t||H<0||u&&J>=i}function T(){var A=Ts();if(O(A))return V(A);a=setTimeout(T,R(A))}function V(A){return a=void 0,d&&r?f(A):(r=s=void 0,o)}function z(){a!==void 0&&clearTimeout(a),c=0,r=l=s=a=void 0}function oe(){return a===void 0?o:V(Ts())}function N(){var A=Ts(),H=O(A);if(r=arguments,s=this,l=A,H){if(a===void 0)return E(l);if(u)return clearTimeout(a),a=setTimeout(T,t),f(l)}return a===void 0&&(a=setTimeout(T,t)),o}return N.cancel=z,N.flush=oe,N}function Ys(e,t,n){(n!==void 0&&!ms(e[t],n)||n===void 0&&!(t in e))&&Ai(e,t,n)}function rg(e){return Bn(e)&&Ti(e)}function Vs(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function sg(e){return id(e,Xa(e))}function ig(e,t,n,r,s,i,o){var a=Vs(e,n),l=Vs(t,n),c=o.get(l);if(c){Ys(e,n,c);return}var h=i?i(a,l,n+"",e,t,o):void 0,u=h===void 0;if(u){var d=Un(l),f=!d&&Va(l),E=!d&&!f&&Ka(l);h=l,d||f||E?Un(a)?h=a:rg(a)?h=Gh(a):f?(u=!1,h=Gf(l)):E?(u=!1,h=Xf(l)):h=[]:$f(l)||zs(l)?(h=a,zs(a)?h=sg(a):(!yt(a)||Oi(a))&&(h=Qf(l))):u=!1}u&&(o.set(l,h),s(h,l,r,i,o),o.delete(l)),Ys(e,n,h)}function Mi(e,t,n,r,s){e!==t&&Jf(t,function(i,o){if(s||(s=new jn),yt(i))ig(e,t,o,n,Mi,r,s);else{var a=r?r(Vs(e,o),i,o+"",e,t,s):void 0;a===void 0&&(a=i),Ys(e,o,a)}},Xa)}var og=Ha(function(e,t,n,r){Mi(e,t,n,r)}),Di=Ha(function(e,t,n){Mi(e,t,n)});function ag(e,t,n,r){if(!yt(e))return e;t=qa(t,e);for(var s=-1,i=t.length,o=i-1,a=e;a!=null&&++s<i;){var l=Ja(t[s]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(s!=o){var h=a[l];c=void 0,c===void 0&&(c=yt(h)?h:wi(t[s+1])?[]:{})}Ba(a,l,c),a=a[l]}return e}function lg(e,t,n){return e==null?e:ag(e,t,n)}function St(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ns,To;function ug(){if(To)return Ns;To=1;var e=-1,t=1,n=0;function r(m,j,y,D,b){if(m===j)return m?[[n,m]]:[];if(y!=null){var S=de(m,j,y);if(S)return S}var F=a(m,j),$=m.substring(0,F);m=m.substring(F),j=j.substring(F),F=c(m,j);var G=m.substring(m.length-F);m=m.substring(0,m.length-F),j=j.substring(0,j.length-F);var se=s(m,j);return $&&se.unshift([n,$]),G&&se.push([n,G]),V(se,b),D&&u(se),se}function s(m,j){var y;if(!m)return[[t,j]];if(!j)return[[e,m]];var D=m.length>j.length?m:j,b=m.length>j.length?j:m,S=D.indexOf(b);if(S!==-1)return y=[[t,D.substring(0,S)],[n,b],[t,D.substring(S+b.length)]],m.length>j.length&&(y[0][0]=y[2][0]=e),y;if(b.length===1)return[[e,m],[t,j]];var F=h(m,j);if(F){var $=F[0],G=F[1],se=F[2],he=F[3],ge=F[4],Te=r($,se),we=r(G,he);return Te.concat([[n,ge]],we)}return i(m,j)}function i(m,j){for(var y=m.length,D=j.length,b=Math.ceil((y+D)/2),S=b,F=2*b,$=new Array(F),G=new Array(F),se=0;se<F;se++)$[se]=-1,G[se]=-1;$[S+1]=0,G[S+1]=0;for(var he=y-D,ge=he%2!==0,Te=0,we=0,v=0,k=0,K=0;K<b;K++){for(var Q=-K+Te;Q<=K-we;Q+=2){var Y=S+Q,W;Q===-K||Q!==K&&$[Y-1]<$[Y+1]?W=$[Y+1]:W=$[Y-1]+1;for(var ue=W-Q;W<y&&ue<D&&m.charAt(W)===j.charAt(ue);)W++,ue++;if($[Y]=W,W>y)we+=2;else if(ue>D)Te+=2;else if(ge){var ae=S+he-Q;if(ae>=0&&ae<F&&G[ae]!==-1){var B=y-G[ae];if(W>=B)return o(m,j,W,ue)}}}for(var te=-K+v;te<=K-k;te+=2){var ae=S+te,B;te===-K||te!==K&&G[ae-1]<G[ae+1]?B=G[ae+1]:B=G[ae-1]+1;for(var ie=B-te;B<y&&ie<D&&m.charAt(y-B-1)===j.charAt(D-ie-1);)B++,ie++;if(G[ae]=B,B>y)k+=2;else if(ie>D)v+=2;else if(!ge){var Y=S+he-te;if(Y>=0&&Y<F&&$[Y]!==-1){var W=$[Y],ue=S+W-Y;if(B=y-B,W>=B)return o(m,j,W,ue)}}}}return[[e,m],[t,j]]}function o(m,j,y,D){var b=m.substring(0,y),S=j.substring(0,D),F=m.substring(y),$=j.substring(D),G=r(b,S),se=r(F,$);return G.concat(se)}function a(m,j){if(!m||!j||m.charAt(0)!==j.charAt(0))return 0;for(var y=0,D=Math.min(m.length,j.length),b=D,S=0;y<b;)m.substring(S,b)==j.substring(S,b)?(y=b,S=y):D=b,b=Math.floor((D-y)/2+y);return z(m.charCodeAt(b-1))&&b--,b}function l(m,j){var y=m.length,D=j.length;if(y==0||D==0)return 0;y>D?m=m.substring(y-D):y<D&&(j=j.substring(0,y));var b=Math.min(y,D);if(m==j)return b;for(var S=0,F=1;;){var $=m.substring(b-F),G=j.indexOf($);if(G==-1)return S;F+=G,(G==0||m.substring(b-F)==j.substring(0,F))&&(S=F,F++)}}function c(m,j){if(!m||!j||m.slice(-1)!==j.slice(-1))return 0;for(var y=0,D=Math.min(m.length,j.length),b=D,S=0;y<b;)m.substring(m.length-b,m.length-S)==j.substring(j.length-b,j.length-S)?(y=b,S=y):D=b,b=Math.floor((D-y)/2+y);return oe(m.charCodeAt(m.length-b))&&b--,b}function h(m,j){var y=m.length>j.length?m:j,D=m.length>j.length?j:m;if(y.length<4||D.length*2<y.length)return null;function b(we,v,k){for(var K=we.substring(k,k+Math.floor(we.length/4)),Q=-1,Y="",W,ue,ae,B;(Q=v.indexOf(K,Q+1))!==-1;){var te=a(we.substring(k),v.substring(Q)),ie=c(we.substring(0,k),v.substring(0,Q));Y.length<ie+te&&(Y=v.substring(Q-ie,Q)+v.substring(Q,Q+te),W=we.substring(0,k-ie),ue=we.substring(k+te),ae=v.substring(0,Q-ie),B=v.substring(Q+te))}return Y.length*2>=we.length?[W,ue,ae,B,Y]:null}var S=b(y,D,Math.ceil(y.length/4)),F=b(y,D,Math.ceil(y.length/2)),$;if(!S&&!F)return null;F?S?$=S[4].length>F[4].length?S:F:$=F:$=S;var G,se,he,ge;m.length>j.length?(G=$[0],se=$[1],he=$[2],ge=$[3]):(he=$[0],ge=$[1],G=$[2],se=$[3]);var Te=$[4];return[G,se,he,ge,Te]}function u(m){for(var j=!1,y=[],D=0,b=null,S=0,F=0,$=0,G=0,se=0;S<m.length;)m[S][0]==n?(y[D++]=S,F=G,$=se,G=0,se=0,b=m[S][1]):(m[S][0]==t?G+=m[S][1].length:se+=m[S][1].length,b&&b.length<=Math.max(F,$)&&b.length<=Math.max(G,se)&&(m.splice(y[D-1],0,[e,b]),m[y[D-1]+1][0]=t,D--,D--,S=D>0?y[D-1]:-1,F=0,$=0,G=0,se=0,b=null,j=!0)),S++;for(j&&V(m),T(m),S=1;S<m.length;){if(m[S-1][0]==e&&m[S][0]==t){var he=m[S-1][1],ge=m[S][1],Te=l(he,ge),we=l(ge,he);Te>=we?(Te>=he.length/2||Te>=ge.length/2)&&(m.splice(S,0,[n,ge.substring(0,Te)]),m[S-1][1]=he.substring(0,he.length-Te),m[S+1][1]=ge.substring(Te),S++):(we>=he.length/2||we>=ge.length/2)&&(m.splice(S,0,[n,he.substring(0,we)]),m[S-1][0]=t,m[S-1][1]=ge.substring(0,ge.length-we),m[S+1][0]=e,m[S+1][1]=he.substring(we),S++),S++}S++}}var d=/[^a-zA-Z0-9]/,f=/\s/,E=/[\r\n]/,R=/\n\r?\n$/,O=/^\r?\n\r?\n/;function T(m){function j(we,v){if(!we||!v)return 6;var k=we.charAt(we.length-1),K=v.charAt(0),Q=k.match(d),Y=K.match(d),W=Q&&k.match(f),ue=Y&&K.match(f),ae=W&&k.match(E),B=ue&&K.match(E),te=ae&&we.match(R),ie=B&&v.match(O);return te||ie?5:ae||B?4:Q&&!W&&ue?3:W||ue?2:Q||Y?1:0}for(var y=1;y<m.length-1;){if(m[y-1][0]==n&&m[y+1][0]==n){var D=m[y-1][1],b=m[y][1],S=m[y+1][1],F=c(D,b);if(F){var $=b.substring(b.length-F);D=D.substring(0,D.length-F),b=$+b.substring(0,b.length-F),S=$+S}for(var G=D,se=b,he=S,ge=j(D,b)+j(b,S);b.charAt(0)===S.charAt(0);){D+=b.charAt(0),b=b.substring(1)+S.charAt(0),S=S.substring(1);var Te=j(D,b)+j(b,S);Te>=ge&&(ge=Te,G=D,se=b,he=S)}m[y-1][1]!=G&&(G?m[y-1][1]=G:(m.splice(y-1,1),y--),m[y][1]=se,he?m[y+1][1]=he:(m.splice(y+1,1),y--))}y++}}function V(m,j){m.push([n,""]);for(var y=0,D=0,b=0,S="",F="",$;y<m.length;){if(y<m.length-1&&!m[y][1]){m.splice(y,1);continue}switch(m[y][0]){case t:b++,F+=m[y][1],y++;break;case e:D++,S+=m[y][1],y++;break;case n:var G=y-b-D-1;if(j){if(G>=0&&A(m[G][1])){var se=m[G][1].slice(-1);if(m[G][1]=m[G][1].slice(0,-1),S=se+S,F=se+F,!m[G][1]){m.splice(G,1),y--;var he=G-1;m[he]&&m[he][0]===t&&(b++,F=m[he][1]+F,he--),m[he]&&m[he][0]===e&&(D++,S=m[he][1]+S,he--),G=he}}if(N(m[y][1])){var se=m[y][1].charAt(0);m[y][1]=m[y][1].slice(1),S+=se,F+=se}}if(y<m.length-1&&!m[y][1]){m.splice(y,1);break}if(S.length>0||F.length>0){S.length>0&&F.length>0&&($=a(F,S),$!==0&&(G>=0?m[G][1]+=F.substring(0,$):(m.splice(0,0,[n,F.substring(0,$)]),y++),F=F.substring($),S=S.substring($)),$=c(F,S),$!==0&&(m[y][1]=F.substring(F.length-$)+m[y][1],F=F.substring(0,F.length-$),S=S.substring(0,S.length-$)));var ge=b+D;S.length===0&&F.length===0?(m.splice(y-ge,ge),y=y-ge):S.length===0?(m.splice(y-ge,ge,[t,F]),y=y-ge+1):F.length===0?(m.splice(y-ge,ge,[e,S]),y=y-ge+1):(m.splice(y-ge,ge,[e,S],[t,F]),y=y-ge+2)}y!==0&&m[y-1][0]===n?(m[y-1][1]+=m[y][1],m.splice(y,1)):y++,b=0,D=0,S="",F="";break}}m[m.length-1][1]===""&&m.pop();var Te=!1;for(y=1;y<m.length-1;)m[y-1][0]===n&&m[y+1][0]===n&&(m[y][1].substring(m[y][1].length-m[y-1][1].length)===m[y-1][1]?(m[y][1]=m[y-1][1]+m[y][1].substring(0,m[y][1].length-m[y-1][1].length),m[y+1][1]=m[y-1][1]+m[y+1][1],m.splice(y-1,1),Te=!0):m[y][1].substring(0,m[y+1][1].length)==m[y+1][1]&&(m[y-1][1]+=m[y+1][1],m[y][1]=m[y][1].substring(m[y+1][1].length)+m[y+1][1],m.splice(y+1,1),Te=!0)),y++;Te&&V(m,j)}function z(m){return m>=55296&&m<=56319}function oe(m){return m>=56320&&m<=57343}function N(m){return oe(m.charCodeAt(0))}function A(m){return z(m.charCodeAt(m.length-1))}function H(m){for(var j=[],y=0;y<m.length;y++)m[y][1].length>0&&j.push(m[y]);return j}function J(m,j,y,D){return A(m)||N(D)?null:H([[n,m],[e,j],[t,y],[n,D]])}function de(m,j,y){var D=typeof y=="number"?{index:y,length:0}:y.oldRange,b=typeof y=="number"?null:y.newRange,S=m.length,F=j.length;if(D.length===0&&(b===null||b.length===0)){var $=D.index,G=m.slice(0,$),se=m.slice($),he=b?b.index:null;e:{var ge=$+F-S;if(he!==null&&he!==ge||ge<0||ge>F)break e;var Te=j.slice(0,ge),we=j.slice(ge);if(we!==se)break e;var v=Math.min($,ge),k=G.slice(0,v),K=Te.slice(0,v);if(k!==K)break e;var Q=G.slice(v),Y=Te.slice(v);return J(k,Q,Y,se)}e:{if(he!==null&&he!==$)break e;var W=$,Te=j.slice(0,W),we=j.slice(W);if(Te!==G)break e;var ue=Math.min(S-W,F-W),ae=se.slice(se.length-ue),B=we.slice(we.length-ue);if(ae!==B)break e;var Q=se.slice(0,se.length-ue),Y=we.slice(0,we.length-ue);return J(G,Q,Y,ae)}}if(D.length>0&&b&&b.length===0)e:{var k=m.slice(0,D.index),ae=m.slice(D.index+D.length),v=k.length,ue=ae.length;if(F<v+ue)break e;var K=j.slice(0,v),B=j.slice(F-ue);if(k!==K||ae!==B)break e;var Q=m.slice(v,S-ue),Y=j.slice(v,F-ue);return J(k,Q,Y,ae)}return null}function le(m,j,y,D){return r(m,j,y,D,!0)}return le.INSERT=t,le.DELETE=e,le.EQUAL=n,Ns=le,Ns}var cg=ug();const nl=St(cg);function gr(e,t){const n=e.indexOf(t);return n>-1?(e.splice(n,1),!0):!1}function hg(e){const t=new Set,n=[];for(const r of e)t.has(r)||(t.add(r),n.push(r));return n}function dg(e,t){for(let n=e.length-1;n>-1;n--){const r=e[n];if(t(r,n))return r}return null}function fg(e,t){if(e.length===0)return e;const n=t%e.length;return e.slice(n).concat(e.slice(0,n))}function gg(e,t){const n=new Map;return e.forEach(r=>{const s=t(r);let i=n.get(s);n.has(s)||(i=[],n.set(s,i)),i.push(r)}),n}function pg(e){return Array.isArray(e)?e:[e]}function mg(e){return["true","false"].includes(e.toLowerCase())}const pr="__INTERNAL_EDITOR__",xi=`${pr}DOCS_NORMAL`,Li=`${pr}DOCS_FORMULA_BAR`,rl=`${pr}ZEN_EDITOR`,sl=`\r
|
|
2
|
+
`,_g="isRowStylePrecedeColumnStyle";function Eg(e){return`${pr}${e}`}function il(e){return e.startsWith(pr)}var Ui=Symbol("$$IDENTIFIER_DECORATOR");function Cg(e){return e&&e[Ui]===!0}function Pi(e){return typeof e=="function"}function Gs(e){return!!(e&&typeof e.useClass<"u")}function Ks(e){return!!(e&&typeof e.useFactory<"u")}function Xs(e){return!!(e&&typeof e.useValue<"u")}function Rg(e){return!!(e&&typeof e.useExisting<"u")}function Qs(e){return!!(e&&typeof e.useAsync<"u")}var ol=Symbol("AsyncHook");function Br(e){return!!(e&&e.__symbol===ol)}function Et(e){return typeof e>"u"?"undefined":Pi(e)&&!e[Ui]?e.name:e.toString()}var Ig=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ot=function(e){Ig(t,e);function t(n){return e.call(this,"[redi]: ".concat(n))||this}return t}(Error);exports.Quantity=void 0;(function(e){e.MANY="many",e.OPTIONAL="optional",e.REQUIRED="required"})(exports.Quantity||(exports.Quantity={}));exports.LookUp=void 0;(function(e){e.SELF="self",e.SKIP_SELF="skipSelf"})(exports.LookUp||(exports.LookUp={}));var al=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),No=Symbol("$$TARGET"),qs=Symbol("$$DEPENDENCIES"),vg=function(e){al(t,e);function t(n,r){var s="Could not find dependency registered on the ".concat(n,' (indexed) parameter of the constructor of "').concat(Et(r),'".');return e.call(this,s)||this}return t}(ot),ll=function(e){al(t,e);function t(n,r){var s='It seems that you register "undefined" as dependency on the '.concat(r+1,' parameter of "').concat(Et(n),'". Please make sure that there is not cyclic dependency among your TypeScript files, or consider using "forwardRef". For more info please visit our website https://redi.wendell.fun/docs/debug#could-not-find-dependency-registered-on');return e.call(this,s)||this}return t}(ot);function ul(e){var t=e;return t[qs]||[]}function Fi(e,t){var n=ul(e),r=n.find(function(s){return s.paramIndex===t});if(!r)throw new vg(t,e);return r}function ki(e,t,n,r,s){r===void 0&&(r=exports.Quantity.REQUIRED);var i={paramIndex:n,identifier:t,quantity:r,lookUp:s,withNew:!1};if(typeof t>"u")throw new ll(e,n);var o=e;o[No]===o?o[qs].push(i):(o[qs]=[i],o[No]=o)}var Mo=new Set;function _t(e){if(Mo.has(e))throw new ot('Identifier "'.concat(e,'" already exists.'));Mo.add(e);var t=function(n,r,s){ki(n,t,s)};return t.toString=function(){return e},t[Ui]=!0,t}function yg(e,t,n){var r=Fi(e,t);r.lookUp=n}function cl(e){return function t(){return this instanceof t?this:function(n,r,s){yg(n,s,e)}}}var hl=cl(exports.LookUp.SKIP_SELF),dl=cl(exports.LookUp.SELF),Sg=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Js=function(e){Sg(t,e);function t(n,r,s){var i=this,o='Expect "'.concat(r,'" dependency items for id "').concat(Et(n),'" but get ').concat(s,".");return s===0&&(o+=" Did you forget to register it?"),s>1&&(o+=" You register it more than once."),i=e.call(this,o)||this,i.quantity=r,i.actual=s,i}return t}(ot);function $i(e,t,n){if(t===exports.Quantity.OPTIONAL&&n>1||t===exports.Quantity.REQUIRED&&n!==1)throw new Js(e,t,n)}function Og(e,t){return e===exports.Quantity.MANY?t:t[0]}function bg(e,t,n){var r=Fi(e,t);r.quantity=n}function Bi(e){return function t(n){return this instanceof t?this:function(r,s,i){if(n)ki(r,n,i,e);else{if(e===exports.Quantity.REQUIRED)throw new ll(r,i);bg(r,i,e)}}}}var fl=Bi(exports.Quantity.MANY),gl=Bi(exports.Quantity.OPTIONAL),it=Bi(exports.Quantity.REQUIRED);function wg(e,t,n){var r=Fi(e,t);r.withNew=n}function Ag(e){return function t(){return this instanceof t?this:function(n,r,s){wg(n,s,e)}}}var pl=Ag(!0);function ml(e,t){return t===void 0&&(t=0),e?e.map(function(n,r){if(r+=t,!Array.isArray(n))return{paramIndex:r,identifier:n,quantity:exports.Quantity.REQUIRED,withNew:!1};var s=n.slice(0,n.length-1),i=n[n.length-1],o,a=exports.Quantity.REQUIRED,l=!1;return s.forEach(function(c){if(c instanceof dl)o=exports.LookUp.SELF;else if(c instanceof hl)o=exports.LookUp.SKIP_SELF;else if(c instanceof gl)a=exports.Quantity.OPTIONAL;else if(c instanceof fl)a=exports.Quantity.MANY;else if(c instanceof pl)l=!0;else throw new ot("unknown dep modifier ".concat(c,"."))}),{paramIndex:r,identifier:i,quantity:a,lookUp:o,withNew:l}}):[]}function Tg(e,t,n){n===void 0&&(n=0);var r=ml(t,n);r.forEach(function(s){ki(e,s.identifier,s.paramIndex,s.quantity,s.lookUp)})}function Ng(e){return{unwrap:e}}function Mg(e){return!!e&&typeof e.unwrap=="function"}function Dg(e){return Mg(e)?e.unwrap():e}function Zs(e){return!!e&&typeof e.dispose=="function"}var _l=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();function xg(e){return e.length===1}var Cs=[];function Do(e){Cs.push(e)}function xo(){Cs.pop()}function Lg(){Cs.length=0}var Lo=function(e){_l(t,e);function t(n,r,s){var i='Cannot find "'.concat(Et(r),'" registered by any injector. It is the ').concat(s,'th param of "').concat(Cg(n)?Et(n):n.name,'".');return e.call(this,i)||this}return t}(ot),jr=function(e){_l(t,e);function t(n){var r=this,s='Cannot find "'.concat(Et(n),'" registered by any injector. The stack of dependencies is: "').concat(Cs.map(function(i){return Et(i)}).join(" -> "),'".');return r=e.call(this,s)||this,Lg(),r}return t}(ot),Ug=function(){function e(t){var n=this;this.dependencyMap=new Map,this.normalizeDependencies(t).map(function(r){return n.add(r[0],r[1])})}return e.prototype.add=function(t,n){typeof n>"u"&&(n={useClass:t,lazy:!1});var r=this.dependencyMap.get(t);typeof r>"u"&&(r=[],this.dependencyMap.set(t,r)),r.push(n)},e.prototype.delete=function(t){this.dependencyMap.delete(t)},e.prototype.get=function(t,n){n===void 0&&(n=exports.Quantity.REQUIRED);var r=this.dependencyMap.get(t);return $i(t,n,r.length),Og(n,r)},e.prototype.has=function(t){return this.dependencyMap.has(t)},e.prototype.append=function(t){var n=this;this.normalizeDependencies(t).forEach(function(r){return n.add(r[0],r[1])})},e.prototype.dispose=function(){this.dependencyMap.clear()},e.prototype.normalizeDependencies=function(t){return t.map(function(n){var r=n[0],s;return xg(n)?s={useClass:n[0],lazy:!1}:s=n[1],[r,s]})},e}(),Pg=function(){function e(){this.resolvedDependencies=new Map}return e.prototype.add=function(t,n){var r=this.resolvedDependencies.get(t);typeof r>"u"&&(r=[],this.resolvedDependencies.set(t,r)),r.push(n)},e.prototype.has=function(t){return this.resolvedDependencies.has(t)},e.prototype.delete=function(t){if(this.resolvedDependencies.has(t)){var n=this.resolvedDependencies.get(t);n.forEach(function(r){return Zs(r)?r.dispose():void 0}),this.resolvedDependencies.delete(t)}},e.prototype.get=function(t,n){n===void 0&&(n=exports.Quantity.REQUIRED);var r=this.resolvedDependencies.get(t);if(!r)throw new jr(t);return $i(t,n,r.length),n===exports.Quantity.MANY?r:r[0]},e.prototype.dispose=function(){Array.from(this.resolvedDependencies.values()).forEach(function(t){t.forEach(function(n){return Zs(n)?n.dispose():void 0})}),this.resolvedDependencies.clear()},e}(),ei;(function(){if(typeof requestIdleCallback<"u"&&typeof cancelIdleCallback<"u")ei=function(t,n){var r=requestIdleCallback(t,typeof n=="number"?{timeout:n}:void 0),s=!1;return function(){s||(s=!0,cancelIdleCallback(r))}};else{var e=Object.freeze({didTimeout:!0,timeRemaining:function(){return 15}});ei=function(t){var n=setTimeout(function(){return t(e)}),r=!1;return function(){r||(r=!0,clearTimeout(n))}}}})();var Fg=function(){function e(t){var n=this;this.didRun=!1,this.selfExecutor=function(){try{n.value=t()}catch(r){n.error=r}finally{n.didRun=!0}},this.disposeCallback=ei(function(){return n.selfExecutor()})}return e.prototype.hasRun=function(){return this.didRun},e.prototype.dispose=function(){this.disposeCallback()},e.prototype.getValue=function(){if(this.didRun||(this.dispose(),this.selfExecutor()),this.error)throw this.error;return this.value},e}(),Hn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ts=function(){return ts=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},ts.apply(this,arguments)},cn=function(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))},kg=300,br=Symbol("$$NOT_INSTANTIATED_SYMBOL"),$g=function(e){Hn(t,e);function t(n){return e.call(this,'Detecting cyclic dependency. The last identifier is "'.concat(Et(n),'".'))||this}return t}(ot),Bg=function(e){Hn(t,e);function t(){return e.call(this,"Injector cannot be accessed after it was disposed.")||this}return t}(ot),jg=function(e){Hn(t,e);function t(n){return e.call(this,'Async item "'.concat(Et(n),'" returns another async item.'))||this}return t}(ot),Hg=function(e){Hn(t,e);function t(n){return e.call(this,'Cannot get async item "'.concat(Et(n),'" from sync api.'))||this}return t}(ot),Uo=function(e){Hn(t,e);function t(n){return e.call(this,'Cannot add dependency "'.concat(Et(n),'" after it is already resolved.'))||this}return t}(ot),Wg=function(e){Hn(t,e);function t(n){return e.call(this,'Cannot dependency dependency "'.concat(Et(n),'" after it is already resolved.'))||this}return t}(ot),Ct=function(){function e(t,n){n===void 0&&(n=null),this.parent=n,this.children=[],this.resolutionOngoing=0,this.disposingCallbacks=new Set,this.disposed=!1,this.dependencyCollection=new Ug(t||[]),this.resolvedDependencyCollection=new Pg,n&&n.children.push(this)}return e.prototype.onDispose=function(t){var n=this;return this.disposingCallbacks.add(t),{dispose:function(){return n.disposingCallbacks.delete(t)}}},e.prototype.createChild=function(t){return this._ensureInjectorNotDisposed(),new e(t,this)},e.prototype.dispose=function(){this.children.forEach(function(t){return t.dispose()}),this.children.length=0,this.dependencyCollection.dispose(),this.resolvedDependencyCollection.dispose(),this.deleteSelfFromParent(),this.disposed=!0,this.disposingCallbacks.forEach(function(t){return t()}),this.disposingCallbacks.clear()},e.prototype.deleteSelfFromParent=function(){if(this.parent){var t=this.parent.children.indexOf(this);t>-1&&this.parent.children.splice(t,1)}},e.prototype.add=function(t){this._ensureInjectorNotDisposed();var n=t[0],r=t[1];if(this.resolvedDependencyCollection.has(n))throw new Uo(n);typeof r>"u"?this.dependencyCollection.add(n):Qs(r)||Gs(r)||Xs(r)||Ks(r)?this.dependencyCollection.add(n,r):this.resolvedDependencyCollection.add(n,r)},e.prototype.replace=function(t){this._ensureInjectorNotDisposed();var n=t[0];if(this.resolvedDependencyCollection.has(n))throw new Uo(n);this.dependencyCollection.delete(n),t.length===1?this.dependencyCollection.add(n):this.dependencyCollection.add(n,t[1])},e.prototype.delete=function(t){if(this._ensureInjectorNotDisposed(),this.resolvedDependencyCollection.has(t))throw new Wg(t);this.dependencyCollection.delete(t)},e.prototype.invoke=function(t){for(var n=this,r=[],s=1;s<arguments.length;s++)r[s-1]=arguments[s];this._ensureInjectorNotDisposed();var i={get:function(o,a,l){return n._get(o,a,l)},has:function(o){return n.has(o)}};return t.apply(void 0,cn([i],r,!1))},e.prototype.has=function(t){var n;return this.dependencyCollection.has(t)||((n=this.parent)===null||n===void 0?void 0:n.has(t))||!1},e.prototype.get=function(t,n,r){this._ensureInjectorNotDisposed();var s=this._get(t,n,r);if(Array.isArray(s)&&s.some(function(i){return Br(i)})||Br(s))throw new Hg(t);return s},e.prototype._get=function(t,n,r,s){var i=exports.Quantity.REQUIRED;if(n===exports.Quantity.REQUIRED||n===exports.Quantity.OPTIONAL||n===exports.Quantity.MANY?i=n:r=n,!s){var o=this.getValue(t,i,r);if(o!==br)return o}return this.createDependency(t,i,r,!s)},e.prototype.getAsync=function(t){this._ensureInjectorNotDisposed();var n=this.getValue(t,exports.Quantity.REQUIRED);if(n!==br)return Promise.resolve(n);var r=this.createDependency(t,exports.Quantity.REQUIRED);return Br(r)?r.whenReady():Promise.resolve(r)},e.prototype.createInstance=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return this._ensureInjectorNotDisposed(),this._resolveClassImpl.apply(this,cn([{useClass:t}],n,!1))},e.prototype._resolveDependency=function(t,n,r){r===void 0&&(r=!0);var s;Do(t);try{Xs(n)?s=this._resolveValueDependency(t,n):Ks(n)?s=this._resolveFactory(t,n,r):Gs(n)?s=this._resolveClass(t,n,r):Rg(n)?s=this._resolveExisting(t,n):s=this._resolveAsync(t,n),xo()}catch(i){throw xo(),i}return s},e.prototype._resolveExisting=function(t,n){var r=this.get(n.useExisting);return this.resolvedDependencyCollection.add(t,r),r},e.prototype._resolveValueDependency=function(t,n){var r=n.useValue;return this.resolvedDependencyCollection.add(t,r),r},e.prototype._resolveClass=function(t,n,r){var s=this;r===void 0&&(r=!0);var i;if(n.lazy){var o=new Fg(function(){return s._ensureInjectorNotDisposed(),s._resolveClassImpl(n)});i=new Proxy(Object.create(null),{get:function(a,l){if(l in a)return a[l];if(l!=="whenReady"){var c=o.getValue(),h=c[l];return typeof h!="function"||(h=h.bind(c),a[l]=h),h}},set:function(a,l,c){return o.getValue()[l]=c,!0}})}else i=this._resolveClassImpl(n);return t&&r&&this.resolvedDependencyCollection.add(t,i),i},e.prototype._resolveClassImpl=function(t){for(var n,r=[],s=1;s<arguments.length;s++)r[s-1]=arguments[s];var i=t.useClass;this.markNewResolution(i);for(var o=ul(i).sort(function(O,T){return O.paramIndex-T.paramIndex}).map(function(O){return ts(ts({},O),{identifier:Dg(O.identifier)})}),a=[],l=0,c=o;l<c.length;l++){var h=c[l];try{var u=this._get(h.identifier,h.quantity,h.lookUp,h.withNew);a.push(u)}catch(O){throw O instanceof jr||O instanceof Js&&O.actual===0?new Lo(i,h.identifier,h.paramIndex):O}}var d=cn([],r,!0),f=o.length>0?o[0].paramIndex:d.length;if(d.length!==f){console.warn("[redi]: Expect ".concat(f," custom parameter(s) of ").concat(Et(i)," but get ").concat(d.length,"."));var E=f-d.length;E>0?d=cn(cn([],d,!0),Array.from({length:E}).fill(void 0),!0):d=d.slice(0,f)}var R=new(i.bind.apply(i,cn(cn([void 0],d,!1),a,!1)));return(n=t==null?void 0:t.onInstantiation)===null||n===void 0||n.call(t,R),this.markResolutionCompleted(),R},e.prototype._resolveFactory=function(t,n,r){var s;this.markNewResolution(t);for(var i=ml(n.deps),o=[],a=0,l=i;a<l.length;a++){var c=l[a];try{var h=this._get(c.identifier,c.quantity,c.lookUp,c.withNew);o.push(h)}catch(d){throw d instanceof jr||d instanceof Js&&d.actual===0?new Lo(t,c.identifier,c.paramIndex):d}}var u=n.useFactory.apply(null,o);return r&&this.resolvedDependencyCollection.add(t,u),this.markResolutionCompleted(),(s=n==null?void 0:n.onInstantiation)===null||s===void 0||s.call(n,u),u},e.prototype._resolveAsync=function(t,n){var r=this,s={__symbol:ol,whenReady:function(){return r._resolveAsyncImpl(t,n)}};return s},e.prototype._resolveAsyncImpl=function(t,n){var r=this;return n.useAsync().then(function(s){var i=r.getValue(t);if(i!==br)return i;var o;if(Array.isArray(s)){var a=s[1];if(Qs(a))throw new jg(t);o=r._resolveDependency(t,a)}else Pi(s)?o=r._resolveClassImpl({useClass:s,onInstantiation:n.onInstantiation}):o=s;return r.resolvedDependencyCollection.add(t,o),o})},e.prototype.getValue=function(t,n,r){var s=this;n===void 0&&(n=exports.Quantity.REQUIRED);var i=function(){return s.dependencyCollection.has(t)&&!s.resolvedDependencyCollection.has(t)?br:s.resolvedDependencyCollection.get(t,n)},o=function(){return s.parent?s.parent.getValue(t,n):($i(t,n,0),n===exports.Quantity.MANY?[]:null)};return r===exports.LookUp.SKIP_SELF?o():t===e?this:r===exports.LookUp.SELF||this.resolvedDependencyCollection.has(t)||this.dependencyCollection.has(t)?i():o()},e.prototype.createDependency=function(t,n,r,s){var i=this;n===void 0&&(n=exports.Quantity.REQUIRED),s===void 0&&(s=!0);var o=function(){var l=i.dependencyCollection.get(t,n),c=null;return Array.isArray(l)?c=l.map(function(h){return i._resolveDependency(t,h,s)}):l&&(c=i._resolveDependency(t,l,s)),c},a=function(){if(i.parent)return i.parent.createDependency(t,n,void 0,s);if(n===exports.Quantity.OPTIONAL)return null;throw Do(t),new jr(t)};return r===exports.LookUp.SKIP_SELF?a():this.dependencyCollection.has(t)?o():a()},e.prototype.markNewResolution=function(t){if(this.resolutionOngoing+=1,this.resolutionOngoing>=kg)throw new $g(t)},e.prototype.markResolutionCompleted=function(){this.resolutionOngoing-=1},e.prototype._ensureInjectorNotDisposed=function(){if(this.disposed)throw new Bg},e}(),Po=typeof globalThis<"u"&&globalThis||typeof window<"u"&&window||typeof global<"u"&&global,Fo="REDI_GLOBAL_LOCK",zg=typeof process<"u"&&process.versions!=null&&process.versions.node!=null;Po[Fo]?zg||console.error(`[redi]: You are loading scripts of redi more than once! This may cause undesired behavior in your application.
|
|
3
3
|
Maybe your dependencies added redi as its dependency and bundled redi to its dist files. Or you import different versions of redi.
|
|
4
|
-
For more info please visit our website: https://redi.wendell.fun/en-US/docs/debug#import-scripts-of-redi-more-than-once`):
|
|
4
|
+
For more info please visit our website: https://redi.wendell.fun/en-US/docs/debug#import-scripts-of-redi-more-than-once`):Po[Fo]=!0;var ko="REDI_CONTEXT_LOCK",Yg=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,$o=typeof globalThis<"u"&&globalThis||typeof window<"u"&&window||typeof global<"u"&&global;$o[ko]?Yg||console.error(`[redi]: "RediContext" is already created. You may import "RediContext" from different paths. Use "import { RediContext } from '@wendellhu/redi/react-bindings'; instead."`):$o[ko]=!0;var mr=wt.createContext({injector:null});mr.displayName="RediContext";var ji=mr.Provider,El=mr.Consumer,ns=function(){return ns=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},ns.apply(this,arguments)};function Vg(e){var t=e.children,n=e.dependencies,r=wt.useRef(null);return wt.useEffect(function(){return function(){var s;return(s=r.current)===null||s===void 0?void 0:s.dispose()}},[]),wt.createElement(El,null,function(s){var i;return r.current?i=r.current:(i=s.injector?s.injector.createChild(n):new Ct(n),r.current=i),wt.createElement(ji,{value:{injector:i}},t)})}function Gg(e,t){return function(r){return wt.createElement(ji,{value:{injector:t}},wt.createElement(e,ns({},r)))}}function Kg(e,t){return function(r){return wt.createElement(Vg,{dependencies:t},wt.createElement(e,ns({},r)))}}var Xg=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qg=function(e){Xg(t,e);function t(n){return e.call(this,'You should make "RediContext" as '.concat(n.constructor.name,"'s default context type. ")+"If you want to use multiple context, please check this on React doc site. https://reactjs.org/docs/context.html#classcontexttype")||this}return t}(ot);function qg(e,t,n){return function(){return{get:function(){var r=this,s=r.context;if(!s||!s.injector)throw new Qg(r);var i=s.injector,o=i.get(e,t||exports.Quantity.REQUIRED,n);return o}}}}var Jg=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Zg=function(e){Jg(t,e);function t(){return e.call(this,"Using dependency injection outside of a RediContext.")||this}return t}(ot);function Cl(){var e=wt.useContext(mr);if(!e.injector)throw new Zg;return e.injector}function ep(e,t,n){var r=Cl();return wt.useMemo(function(){return r.get(e,t,n)},[e,t,n])}var tp=function(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))};function Rl(e,t){var n=e instanceof Oe.BehaviorSubject&&typeof t>"u"?e.getValue():t,r=lt.useState(n),s=r[0],i=r[1];return lt.useEffect(function(){var o=e.subscribe(function(a){return i(a)});return function(){return o.unsubscribe()}},[e]),s}function Bo(e){return typeof e=="function"?e():e}function np(e,t,n,r){if(typeof e=="function"&&!r)throw new ot("Expected deps to be provided when observable is a function!");var s=lt.useRef(null),i=lt.useRef(!1),o=lt.useMemo(function(){return e},tp([],typeof r<"u"?r:[e],!0)),a=lt.useState(0);a[0];var l=a[1],c=lt.useRef(function(){var h;if(o){var u=Bo(o).subscribe(function(d){i.current=!0,h=d});u.unsubscribe()}return h!=null?h:t}());if(lt.useEffect(function(){var h=null;return o&&(s.current=Bo(o),h=s.current.subscribe(function(u){c.current=u,l(function(d){return d+1})})),function(){return h==null?void 0:h.unsubscribe()}},[o]),n&&!i.current)throw new Error("Expect `shouldHaveSyncValue` but not getting a sync value!");return c.current}function rp(e){var t=lt.useState(0),n=t[1];lt.useEffect(function(){var r=e.subscribe(function(){return n(function(s){return s+1})});return function(){return r.unsubscribe()}},[])}var ti=new WeakMap;function sp(e,t){var n=lt.useRef(void 0),r=Rl(e,t),s=lt.useMemo(function(){return lt.createContext(r)},[e]),i=lt.useCallback(function(o){return lt.createElement(s.Provider,{value:r},o.children)},[e,r]);return n.current!==e&&(n.current&&ti.delete(n.current),n.current=e,ti.set(e,s)),{Provider:i,value:r}}function ip(e){var t=ti.get(e);if(!t)throw new ot("try to read context value but no ancestor component subscribed it.");return lt.useContext(t)}function op(e,t){t.forEach(n=>e.add(n))}function Il(e,t){t.forEach(([n])=>{e.has(n)&&e.get(n)})}function vl(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const s=Object.prototype.hasOwnProperty.bind(t);for(let i=0;i<n.length;i++){const o=n[i];if(!s(o))return!1;const a=e[o],l=t[o];if(a!==l)return!1}return!0}class ni extends Error{constructor(t){super(t),this.name="CustomCommandExecutionError"}}class yl extends Error{constructor(){super("Canceled by facade"),this.name="CanceledError"}}async function Sl(e){for(const[t,n]of e.entries())try{if(!await n())return{index:t,result:!1}}catch(r){return{index:t,result:!1,error:r}}return{result:!0,index:-1}}function Ol(e){for(const[t,n]of e.entries())try{if(!n())return{index:t,result:!1}}catch(r){return{index:t,result:!1,error:r}}return{result:!0,index:-1}}function jo(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ho(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),s,i=[],o;try{for(;(t===void 0||t-- >0)&&!(s=r.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return i}function Wo(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}function ar(e){return typeof e=="function"}function ap(e){var t=function(r){Error.call(r),r.stack=new Error().stack},n=e(t);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var Ms=ap(function(e){return function(n){e(this),this.message=n?n.length+` errors occurred during unsubscription:
|
|
5
5
|
`+n.map(function(r,s){return s+1+") "+r.toString()}).join(`
|
|
6
|
-
`):"",this.name="UnsubscriptionError",this.errors=n}});function Do(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var gl=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,n,r,s,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=To(o),l=a.next();!l.done;l=a.next()){var c=l.value;c.remove(this)}}catch(v){t={error:v}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}else o.remove(this);var h=this.initialTeardown;if(Xn(h))try{h()}catch(v){i=v instanceof Is?v.errors:[v]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var d=To(u),f=d.next();!f.done;f=d.next()){var E=f.value;try{xo(E)}catch(v){i=i!=null?i:[],v instanceof Is?i=Mo(Mo([],No(i)),No(v.errors)):i.push(v)}}}catch(v){r={error:v}}finally{try{f&&!f.done&&(s=d.return)&&s.call(d)}finally{if(r)throw r.error}}}if(i)throw new Is(i)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)xo(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}},e.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},e.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},e.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&Do(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&Do(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();gl.EMPTY;function ip(e){return e instanceof gl||e&&"closed"in e&&Xn(e.remove)&&Xn(e.add)&&Xn(e.unsubscribe)}function xo(e){Xn(e)?e():e.unsubscribe()}function Xe(e){let t=!1;return e?ip(e)?{dispose:()=>e.unsubscribe()}:typeof e=="function"?{dispose:()=>{t||(t=!0,e())}}:e:Xe(()=>{})}function op(e){return Xe(()=>{e.unsubscribe()})}class hs{constructor(){C(this,"_disposables",new Set)}add(t){const n=Xe(t);return this._disposables.add(n),{dispose:(r=!1)=>{r||n.dispose(),this._disposables.delete(n)}}}dispose(){this._disposables.forEach(t=>{t.dispose()}),this._disposables.clear()}}class tt{constructor(){C(this,"_disposed",!1);C(this,"_collection",new hs)}disposeWithMe(t){return this._collection.add(t)}ensureNotDisposed(){if(this._disposed)throw new Error("[Disposable]: object is disposed!")}dispose(){this._disposed||(this._disposed=!0,this._collection.dispose())}}class ap extends tt{constructor(){super(...arguments);C(this,"dispose$",new ye.Subject)}dispose(){super.dispose(),this.dispose$.next(),this.dispose$.complete()}}class lp extends tt{constructor(n){super();C(this,"_ref",0);this._rootDisposable=n}inc(){if(this._disposed)throw new Error("[RCDisposable]: should not ref to a disposed.");this._ref+=1}dec(){this._ref-=1,this._ref===0&&(this._rootDisposable.dispose(),this.dispose())}}const ur=mt("univer.context-service");class pl extends tt{constructor(){super(...arguments);C(this,"_contextChanged$",new ye.Subject);C(this,"contextChanged$",this._contextChanged$.asObservable());C(this,"_contextMap",new Map)}dispose(){super.dispose(),this._contextChanged$.complete()}getContextValue(n){var r;return(r=this._contextMap.get(n))!=null?r:!1}setContextValue(n,r){this._contextMap.set(n,r),this._contextChanged$.next({[n]:r})}subscribeContextValue$(n){return new ye.Observable(r=>{const s=this._contextChanged$.pipe(ye.filter(i=>typeof i[n]<"u")).subscribe(i=>r.next(i[n]));return this._contextMap.has(n)&&r.next(this._contextMap.get(n)),()=>s.unsubscribe()})}}var ml=(e=>(e[e.SILENT=0]="SILENT",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.VERBOSE=4]="VERBOSE",e))(ml||{});const At=mt("univer.log");class _l extends tt{constructor(){super(...arguments);C(this,"_logLevel",3)}debug(...n){this._logLevel>=4&&this._log(console.debug,...n)}log(...n){this._logLevel>=3&&this._log(console.log,...n)}warn(...n){this._logLevel>=2&&this._log(console.warn,...n)}error(...n){this._logLevel>=1&&this._log(console.error,...n)}setLogLevel(n){this._logLevel=n}_log(n,...r){const s=r[0];/^\[(.*?)\]/g.test(s)?n(`\x1B[97;104m${s}\x1B[0m`,...r.slice(1)):n(...r)}}var up=Object.defineProperty,cp=Object.getOwnPropertyDescriptor,hp=(e,t,n,r)=>{for(var s=r>1?void 0:r?cp(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&up(t,n,s),s},Lo=(e,t)=>(n,r)=>t(n,r,e),cr=(e=>(e[e.COMMAND=0]="COMMAND",e[e.OPERATION=1]="OPERATION",e[e.MUTATION=2]="MUTATION",e))(cr||{});const Dt=mt("anywhere.command-service");class dp{constructor(){C(this,"_commands",new Map);C(this,"_commandTypes",new Map)}registerCommand(t){if(this._commands.has(t.id))throw new Error(`[CommandRegistry]: command "${t.id}" has been registered before.`);return this._commands.set(t.id,t),this._commandTypes.set(t.id,t.type),Xe(()=>{this._commands.delete(t.id),this._commandTypes.delete(t.id)})}hasCommand(t){return this._commands.has(t)}getCommand(t){return this._commands.has(t)?[this._commands.get(t)]:null}getCommandType(t){return this._commandTypes.get(t)}}const El={id:"nil",type:0,handler:()=>!0};exports.CommandService=class extends tt{constructor(n,r){super();C(this,"_commandRegistry");C(this,"_beforeCommandExecutionListeners",[]);C(this,"_commandExecutedListeners",[]);C(this,"_multiCommandDisposables",new Map);C(this,"_commandExecutingLevel",0);C(this,"_commandExecutionStack",[]);this._injector=n,this._logService=r,this._commandRegistry=new dp,this._registerCommand(El)}dispose(){super.dispose(),this._commandExecutedListeners.length=0,this._beforeCommandExecutionListeners.length=0}hasCommand(n){return this._commandRegistry.hasCommand(n)}registerCommand(n){return this._registerCommand(n)}registerMultipleCommand(n){return this._registerMultiCommand(n)}beforeCommandExecuted(n){if(this._beforeCommandExecutionListeners.indexOf(n)===-1)return this._beforeCommandExecutionListeners.push(n),Xe(()=>{const r=this._beforeCommandExecutionListeners.indexOf(n);this._beforeCommandExecutionListeners.splice(r,1)});throw new Error("[CommandService]: could not add a listener twice.")}onCommandExecuted(n){if(this._commandExecutedListeners.indexOf(n)===-1)return this._commandExecutedListeners.push(n),Xe(()=>{const r=this._commandExecutedListeners.indexOf(n);this._commandExecutedListeners.splice(r,1)});throw new Error("[CommandService]: could not add a listener twice.")}async executeCommand(n,r,s){try{const i=this._commandRegistry.getCommand(n);if(i){const[o]=i,a={id:o.id,type:o.type,params:r},l=this._pushCommandExecutionStack(a);this._beforeCommandExecutionListeners.forEach(h=>h(a,s));const c=await this._execute(o,r,s);return this._commandExecutedListeners.forEach(h=>h(a,s)),l.dispose(),c}throw new Error(`[CommandService]: command "${n}" is not registered.`)}catch(i){if(i instanceof Gs)return!1;throw i}}syncExecuteCommand(n,r,s){var i;try{const o=this._commandRegistry.getCommand(n);if(o){const[a]=o,l={id:a.id,type:a.type,params:r};if(a.type===2){const u=ng(this._commandExecutionStack,d=>d.type===0);u&&(l.params=(i=l.params)!=null?i:{},l.params.trigger=u.id)}const c=this._pushCommandExecutionStack(l);this._beforeCommandExecutionListeners.forEach(u=>u(l,s));const h=this._syncExecute(a,r,s);return this._commandExecutedListeners.forEach(u=>u(l,s)),c.dispose(),h}throw new Error(`[CommandService]: command "${n}" is not registered.`)}catch(o){if(o instanceof Gs)return!1;throw o}}_pushCommandExecutionStack(n){return this._commandExecutionStack.push(n),Xe(()=>or(this._commandExecutionStack,n))}_registerCommand(n){return this._commandRegistry.registerCommand(n)}_registerMultiCommand(n){const r=this._commandRegistry.getCommand(n.id);let s;if(r){if(r[0].multi!==!0)throw new Error("Command has registered as a single command.");s=r[0]}else{const o=new hs;s=new fp(n.id),o.add(this._commandRegistry.registerCommand(s)),o.add(Xe(()=>{this._multiCommandDisposables.delete(n.id)})),this._multiCommandDisposables.set(n.id,o)}const i=s.registerImplementation(n);return Xe(()=>{var o;i.dispose(),s.hasImplementations()||(o=this._multiCommandDisposables.get(n.id))==null||o.dispose()})}async _execute(n,r,s){this._logService.debug("[CommandService]",`${"|-".repeat(Math.max(this._commandExecutingLevel,0))}executing command "${n.id}"`),this._commandExecutingLevel++;let i;try{i=await this._injector.invoke(n.handler,r,s),this._commandExecutingLevel--}catch(o){throw i=!1,this._commandExecutingLevel=0,o}return i}_syncExecute(n,r,s){this._logService.debug("[CommandService]",`${"|-".repeat(Math.max(0,this._commandExecutingLevel))}executing command "${n.id}".`),this._commandExecutingLevel++;let i;try{if(i=this._injector.invoke(n.handler,r,s),i instanceof Promise)throw new TypeError("[CommandService]: Command handler should not return a promise.");this._commandExecutingLevel--}catch(o){throw i=!1,this._commandExecutingLevel=0,o}return i}};exports.CommandService=hp([Lo(0,at(St)),Lo(1,At)],exports.CommandService);class fp{constructor(t){C(this,"name");C(this,"multi",!0);C(this,"type",0);C(this,"priority",0);C(this,"_implementations",[]);C(this,"handler",async(t,n)=>{if(!this._implementations.length)return!1;const r=t.get(At),s=t.get(ur),i=t.get(St);for(const o of this._implementations){const a=o.command.preconditions;if((!a||a&&a(s))&&(r.debug("[MultiCommand]",`executing implementation "${o.command.name}".`),await i.invoke(o.command.handler,n)))return!0}return!1});this.id=t,this.name=t}registerImplementation(t){const n={command:t};return this._implementations.push(n),this._implementations.sort((r,s)=>s.command.priority-r.command.priority),Xe(()=>{const r=this._implementations.indexOf(n);this._implementations.splice(r,1)})}hasImplementations(){return this._implementations.length>0}}function Di(e,t,n){const r=e.map(s=>()=>t.syncExecuteCommand(s.id,s.params,n));return fl(r)}function gp(e,t,n){const r=e.map(s=>()=>t.executeCommand(s.id,s.params,n));return dl(r)}function vl(e){return new ye.Observable(t=>{const n=e((...r)=>t.next(r));return()=>n==null?void 0:n.dispose()})}function Cl(e){return function(n){return new ye.Observable(r=>(n.subscribe({next:s=>{r.next(s),e(s)&&r.complete()},complete:()=>r.complete(),error:s=>r.error(s)}),()=>r.unsubscribe()))}}function pp(e=0){return t=>{let n=[];return t.pipe(ye.tap(r=>n.push(r)),ye.debounceTime(e),ye.map(()=>n),ye.tap(()=>n=[]))}}function mp(e){const t=new ye.ReplaySubject(1);return setTimeout(()=>t.next(),e),t.pipe(ye.take(1))}const _p=e=>new Promise(t=>{ye.merge(vl(e.onCommandExecuted.bind(e)).pipe(Dr.filter(([n])=>n.type===cr.MUTATION)),ye.timer(300)).pipe(Dr.debounceTime(16),Dr.first()).subscribe(()=>{t()})});function Rl(e,t){let n=0,r=e.length-1;if(t<e[0])return 0;if(t>=e[e.length-1])return e.length-1;for(;n<=r;){if(e[n]===t){for(;n<e.length&&e[n]===t;)n++;return n}if(t>e[n]&&t<e[n+1])return n+1;if(e[r]===t){for(;r<e.length&&e[r]===t;)r++;return r}if(t>e[r-1]&&t<e[r])return r;n++,r--}return-1}function Ep(e,t){let n=0,r=e.length-1;for(;n<=r;){const s=Math.floor((r+n)/2);if(t<e[s]&&(s===0||t>=e[s-1]))return s;if(t>=e[s])n=s+1;else if(t<e[s])r=s-1;else return-1}return-1}function Il(e,t){let n=0,r=e.length;for(;n<r;){const s=Math.floor((n+r)/2);e[s]<=t?n=s+1:r=s}return n<e.length?n:e.length-1}function vp(e,t,n=!1){let r=e.length-1;if(t<0||t<e[0])return 0;if(e.length<40||t<=e[20]||t>=e[r-20]?r=Rl(e,t):r=Il(e,t),n){const s=e[r];return e.indexOf(s)}return r}function Cp(e){const t=new Blob([e],{type:"text/javascript"});return window.URL.createObjectURL(t)}const jn=2,Sl=1;function Rp(e,t){if(t==null||e==null)return!0;const{left:n=0,top:r=0,height:s=0,width:i=0,angle:o=0}=t,{left:a=0,top:l=0,height:c=0,width:h=0,angle:u=0}=e,d=h,f=c,E=i,v=s;return Math.abs(a-n)>jn||Math.abs(l-r)>jn||Math.abs(d-E)>jn||Math.abs(f-v)>jn||Math.abs(u-o)>Sl}var yl=(e=>(e[e.DEFAULT_SERIES=0]="DEFAULT_SERIES",e[e.ALTERNATE_SERIES=1]="ALTERNATE_SERIES",e))(yl||{}),Ke=(e=>(e[e.NONE=0]="NONE",e[e.THIN=1]="THIN",e[e.HAIR=2]="HAIR",e[e.DOTTED=3]="DOTTED",e[e.DASHED=4]="DASHED",e[e.DASH_DOT=5]="DASH_DOT",e[e.DASH_DOT_DOT=6]="DASH_DOT_DOT",e[e.DOUBLE=7]="DOUBLE",e[e.MEDIUM=8]="MEDIUM",e[e.MEDIUM_DASHED=9]="MEDIUM_DASHED",e[e.MEDIUM_DASH_DOT=10]="MEDIUM_DASH_DOT",e[e.MEDIUM_DASH_DOT_DOT=11]="MEDIUM_DASH_DOT_DOT",e[e.SLANT_DASH_DOT=12]="SLANT_DASH_DOT",e[e.THICK=13]="THICK",e))(Ke||{}),Ol=(e=>(e.TOP="top",e.BOTTOM="bottom",e.LEFT="left",e.RIGHT="right",e.NONE="none",e.ALL="all",e.OUTSIDE="outside",e.INSIDE="inside",e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e.TLBR="tlbr",e.TLBC_TLMR="tlbc_tlmr",e.TLBR_TLBC_TLMR="tlbr_tlbc_tlmr",e.BLTR="bl_tr",e.MLTR_BCTR="mltr_bctr",e))(Ol||{}),Ct=(e=>(e[e.UNSUPPORTED=0]="UNSUPPORTED",e[e.RGB=1]="RGB",e[e.HEX=2]="HEX",e[e.THEME=3]="THEME",e))(Ct||{}),wl=(e=>(e[e.ON=0]="ON",e[e.OFF=1]="OFF",e))(wl||{}),bl=(e=>(e[e.PASTE_NORMAL=0]="PASTE_NORMAL",e[e.PASTE_NO_BORDERS=1]="PASTE_NO_BORDERS",e[e.PASTE_FORMAT=2]="PASTE_FORMAT",e[e.PASTE_FORMULA=3]="PASTE_FORMULA",e[e.PASTE_DATA_VALIDATION=4]="PASTE_DATA_VALIDATION",e[e.PASTE_VALUES=5]="PASTE_VALUES",e[e.PASTE_CONDITIONAL_FORMATTING=6]="PASTE_CONDITIONAL_FORMATTING",e[e.PASTE_COLUMN_WIDTHS=7]="PASTE_COLUMN_WIDTHS",e))(bl||{}),Al=(e=>(e[e.LEFT=0]="LEFT",e[e.RIGHT=1]="RIGHT",e))(Al||{}),Tl=(e=>(e[e.DOCUMENT=0]="DOCUMENT",e[e.PROJECT=1]="PROJECT",e))(Tl||{}),Nl=(e=>(e[e.COLUMNS=0]="COLUMNS",e[e.ROWS=1]="ROWS",e))(Nl||{}),Ml=(e=>(e[e.UP=0]="UP",e[e.RIGHT=1]="RIGHT",e[e.DOWN=2]="DOWN",e[e.LEFT=3]="LEFT",e))(Ml||{});function Ip(e){switch(e){case 3:return 1;case 1:return 3;case 0:return 2;case 2:return 0}}var Dl=(e=>(e[e.INTERPOLATION_POINT_TYPE_UNSPECIFIED=0]="INTERPOLATION_POINT_TYPE_UNSPECIFIED",e[e.MIN=1]="MIN",e[e.MAX=2]="MAX",e[e.NUMBER=3]="NUMBER",e[e.PERCENT=4]="PERCENT",e[e.PERCENTILE=5]="PERCENTILE",e))(Dl||{}),hr=(e=>(e.EN_US="enUS",e.FR_FR="frFR",e.ZH_CN="zhCN",e.RU_RU="ruRU",e.ZH_TW="zhTW",e.VI_VN="viVN",e.FA_IR="faIR",e))(hr||{}),Qr=(e=>(e[e.PERSON=0]="PERSON",e[e.FILE=1]="FILE",e[e.DATE=2]="DATE",e[e.LOCATION=3]="LOCATION",e[e.EVENT=4]="EVENT",e))(Qr||{}),xl=(e=>(e[e.RANGE=0]="RANGE",e[e.SHEET=1]="SHEET",e))(xl||{}),Ll=(e=>(e.Line="line",e.LineInv="lineInv",e.Triangle="triangle",e.RtTriangle="rtTriangle",e.Rect="rect",e.Diamond="diamond",e.Parallelogram="parallelogram",e.Trapezoid="trapezoid",e.NonIsocelesTrapezoid="nonIsocelesTrapezoid",e.Pentagon="pentagon",e.Hexagon="hexagon",e.Heptagon="heptagon",e.Octagon="octagon",e.Decagon="decagon",e.Dodecagon="dodecagon",e.Star4="star4",e.Star5="star5",e.Star6="star6",e.Star7="star7",e.Star8="star8",e.Star10="star10",e.Star12="star12",e.Star16="star16",e.Star24="star24",e.Star32="star32",e.RoundRect="roundRect",e.Round1Rect="round1Rect",e.Round2SameRect="round2SameRect",e.Round2DiagRect="round2DiagRect",e.Ellipse="ellipse",e))(Ll||{}),Ul=(e=>(e.RightArrow="rightArrow",e.LeftArrow="leftArrow",e.UpArrow="upArrow",e.DownArrow="downArrow",e.LeftRightArrow="leftRightArrow",e.UpDownArrow="upDownArrow",e.QuadArrow="quadArrow",e.LeftRightUpArrow="leftRightUpArrow",e.BentArrow="bentArrow",e.UturnArrow="uturnArrow",e.CircularArrow="circularArrow",e.NotchedRightArrow="notchedRightArrow",e.HomePlate="homePlate",e.Chevron="chevron",e.LeftCircularArrow="leftCircularArrow",e.LeftRightCircularArrow="leftRightCircularArrow",e))(Ul||{}),Pl=(e=>(e.Plaque="plaque",e.Can="can",e.Cube="cube",e.Bevel="bevel",e.Donut="donut",e.NoSmoking="noSmoking",e.BlockArc="blockArc",e.FoldedCorner="foldedCorner",e))(Pl||{}),Fl=(e=>(e.SmileyFace="smileyFace",e.Heart="heart",e.LightningBolt="lightningBolt",e.Sun="sun",e.Moon="moon",e.Cloud="cloud",e.Arc="arc",e.Backpack="backpack",e.Frame="frame",e.HalfFrame="halfFrame",e.Corner="corner",e.Chord="chord",e.Pie="pie",e.Teardrop="teardrop",e.WedgeRectCallout="wedgeRectCallout",e.WedgeRRectCallout="wedgeRRectCallout",e.WedgeEllipseCallout="wedgeEllipseCallout",e.CloudCallout="cloudCallout",e.BorderCallout1="borderCallout1",e.BorderCallout2="borderCallout2",e.BorderCallout3="borderCallout3",e.AccentCallout1="accentCallout1",e.AccentCallout2="accentCallout2",e.AccentCallout3="accentCallout3",e.Callout1="callout1",e.Callout2="callout2",e.Callout3="callout3",e.ActionButtonBackPrevious="actionButtonBackPrevious",e.ActionButtonEnd="actionButtonEnd",e.ActionButtonForwardNext="actionButtonForwardNext",e.ActionButtonHelp="actionButtonHelp",e.ActionButtonHome="actionButtonHome",e.ActionButtonInformation="actionButtonInformation",e.ActionButtonMovie="actionButtonMovie",e.ActionButtonReturn="actionButtonReturn",e.ActionButtonSound="actionButtonSound",e))(Fl||{}),kl=(e=>(e[e.RELATIVE_DATE_UNSPECIFIED=0]="RELATIVE_DATE_UNSPECIFIED",e[e.PAST_YEAR=1]="PAST_YEAR",e[e.PAST_MONTH=2]="PAST_MONTH",e[e.PAST_WEEK=3]="PAST_WEEK",e[e.YESTERDAY=4]="YESTERDAY",e[e.TODAY=5]="TODAY",e[e.TOMORROW=6]="TOMORROW",e))(kl||{}),$l=(e=>(e[e.GRID=0]="GRID",e[e.KANBAN=1]="KANBAN",e[e.GANTT=2]="GANTT",e))($l||{}),Zn=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LEFT_TO_RIGHT=1]="LEFT_TO_RIGHT",e[e.RIGHT_TO_LEFT=2]="RIGHT_TO_LEFT",e))(Zn||{}),jl=(e=>(e[e.DASH=0]="DASH",e[e.DASH_DOT_DOT_HEAVY=1]="DASH_DOT_DOT_HEAVY",e[e.DASH_DOT_HEAVY=2]="DASH_DOT_HEAVY",e[e.DASHED_HEAVY=3]="DASHED_HEAVY",e[e.DASH_LONG=4]="DASH_LONG",e[e.DASH_LONG_HEAVY=5]="DASH_LONG_HEAVY",e[e.DOT_DASH=6]="DOT_DASH",e[e.DOT_DOT_DASH=7]="DOT_DOT_DASH",e[e.DOTTED=8]="DOTTED",e[e.DOTTED_HEAVY=9]="DOTTED_HEAVY",e[e.DOUBLE=10]="DOUBLE",e[e.NONE=11]="NONE",e[e.SINGLE=12]="SINGLE",e[e.THICK=13]="THICK",e[e.WAVE=14]="WAVE",e[e.WAVY_DOUBLE=15]="WAVY_DOUBLE",e[e.WAVY_HEAVY=16]="WAVY_HEAVY",e[e.WORDS=17]="WORDS",e))(jl||{}),Gt=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LEFT=1]="LEFT",e[e.CENTER=2]="CENTER",e[e.RIGHT=3]="RIGHT",e[e.JUSTIFIED=4]="JUSTIFIED",e[e.BOTH=5]="BOTH",e[e.DISTRIBUTED=6]="DISTRIBUTED",e))(Gt||{}),sn=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TOP=1]="TOP",e[e.MIDDLE=2]="MIDDLE",e[e.BOTTOM=3]="BOTTOM",e))(sn||{}),ln=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.OVERFLOW=1]="OVERFLOW",e[e.CLIP=2]="CLIP",e[e.WRAP=3]="WRAP",e))(ln||{}),Jr=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ITALIC=1]="ITALIC",e))(Jr||{}),qr=(e=>(e[e.NORMAL=0]="NORMAL",e[e.BOLD=1]="BOLD",e))(qr||{}),Ft=(e=>(e[e.NORMAL=1]="NORMAL",e[e.SUBSCRIPT=2]="SUBSCRIPT",e[e.SUPERSCRIPT=3]="SUPERSCRIPT",e))(Ft||{}),xe=(e=>(e[e.FALSE=0]="FALSE",e[e.TRUE=1]="TRUE",e))(xe||{}),Xt=(e=>(e[e.STRING=1]="STRING",e[e.NUMBER=2]="NUMBER",e[e.BOOLEAN=3]="BOOLEAN",e[e.FORCE_STRING=4]="FORCE_STRING",e))(Xt||{}),ft=(e=>(e[e.DARK1=0]="DARK1",e[e.LIGHT1=1]="LIGHT1",e[e.DARK2=2]="DARK2",e[e.LIGHT2=3]="LIGHT2",e[e.ACCENT1=4]="ACCENT1",e[e.ACCENT2=5]="ACCENT2",e[e.ACCENT3=6]="ACCENT3",e[e.ACCENT4=7]="ACCENT4",e[e.ACCENT5=8]="ACCENT5",e[e.ACCENT6=9]="ACCENT6",e[e.HYPERLINK=10]="HYPERLINK",e[e.FOLLOWED_HYPERLINK=11]="FOLLOWED_HYPERLINK",e))(ft||{}),ds=(e=>(e.OFFICE="Office",e.OFFICE_2007_2010="Office 2007-2010",e.GRAYSCALE="Grayscale",e.BLUE_WARM="Blue Warm",e.BLUE="Blue",e.BLUE_II="Blue II",e.BLUE_GREEN="Blue Green",e.GREEN="Green",e.GREEN_YELLOW="Green Yellow",e.YELLOW="Yellow",e.YELLOW_ORANGE="Yellow Orange",e.ORANGE="Orange",e.ORANGE_RED="Orange Red",e.RED_ORANGE="Red Orange",e.RED="Red",e.RED_VIOLET="Red Violet",e.VIOLET="Violet",e.VIOLET_II="Violet II",e.MEDIAN="Median",e.PAPER="Paper",e.MARQUEE="Marquee",e.SLIPSTREAM="Slipstream",e.Aspect="Aspect",e))(ds||{});const Sp="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let yp=e=>crypto.getRandomValues(new Uint8Array(e)),Op=(e,t,n)=>{let r=(2<<Math.log2(e.length-1))-1,s=-~(1.6*r*t/e.length);return(i=t)=>{let o="";for(;;){let a=n(s),l=s|0;for(;l--;)if(o+=e[a[l]&r]||"",o.length>=i)return o}}},wp=(e,t=21)=>Op(e,t|0,yp),bp=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=Sp[n[e]&63];return t};const Bl=new Set(["ac","ad","ae","aero","af","ag","ai","al","am","ao","aq","ar","arpa","as","asia","at","au","aw","ax","az","ba","bb","bd","be","bf","bg","bh","bi","biz","bj","bm","bn","bo","br","bs","bt","bv","bw","by","bz","ca","cat","cc","cd","cf","cg","ch","ci","ck","cl","cm","cn","co","com","coop","cr","cu","cv","cw","cx","cy","cz","de","dj","dk","dm","do","dz","ec","edu","ee","eg","er","es","et","eu","fi","fj","fk","fm","fo","fr","ga","gb","gd","ge","gf","gg","gh","gi","gl","gm","gn","gov","gp","gq","gr","gs","gt","gu","gw","gy","hk","hm","hn","hr","ht","hu","id","ie","il","im","in","info","int","io","iq","ir","is","it","je","jm","jo","jobs","jp","ke","kg","kh","ki","km","kn","kp","kr","kw","ky","kz","la","lb","lc","li","lk","lr","ls","lt","lu","lv","ly","ma","mc","md","me","mg","mh","mil","mk","ml","mm","mn","mo","mobi","mp","mq","mr","ms","mt","mu","museum","mv","mw","mx","my","mz","na","name","nc","ne","net","nf","ng","ni","nl","no","np","nr","nu","nz","om","onion","org","pa","pe","pf","pg","ph","pk","pl","pm","pn","post","pr","pro","ps","pt","pw","py","qa","re","ro","rs","ru","rw","sa","sb","sc","sd","se","sg","sh","si","sj","sk","sl","sm","sn","so","sr","ss","st","su","sv","sx","sy","sz","tc","td","tel","tf","tg","th","tj","tk","tl","tm","tn","to","tr","tt","tv","tw","tz","ua","ug","uk","us","uy","uz","va","vc","ve","vg","vi","vn","vu","wf","ws","yt","za","zm","zw"]),Ap=new RegExp("^(?:(?:(?:https?|ftp):)?\\/\\/)?(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u00a1-\\uffff][a-z0-9\\u00a1-\\uffff_-]{0,62})?[a-z0-9\\u00a1-\\uffff]\\.)+(?:[a-z\\u00a1-\\uffff]{2,}\\.?))(?::\\d{2,5})?(?:[/?#]\\S*)?$","i");function Tp(e){if(!Number.isNaN(+e))return!1;if(e.startsWith("http://localhost:3002")||e.startsWith("localhost:3002"))return!0;if(Ap.test(e)){if(Hl(e))return!0;try{const r=new URL(Wl(e)).hostname.split(".").pop();if(r&&Bl.has(r))return!0}catch{return!1}}return!1}function Hl(e){return/^[a-zA-Z]+:\/\//.test(e)}function Np(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e)}function Wl(e){return Hl(e)?e:Np(e)?`mailto://${e}`:`https://${e}`}const Mp=/^-ms-/,Dp=/-([a-z])/g,Yt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];function xi(e,t){const n=ce.getValueType(e),r=ce.getValueType(t);return n!==r?!1:ce.isArray(e)?xp(e,t):ce.isObject(e)?Lp(e,t):ce.isDate(e)?e.getTime()===t.getTime():ce.isRegExp(e)?e.toString()===t.toString():e===t}function xp(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++){const s=e[n],i=t[n];if(!xi(s,i))return!1}return!0}function Lp(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n){if(!r.includes(s))return!1;const i=e[s],o=t[s];if(!xi(i,o))return!1}return!0}class ce{static stringAt(t){let n="",r=t;for(;r>=Yt.length;)r/=Yt.length,r-=1,n+=Yt[r%Yt.length];const s=t%Yt.length;return n+=Yt[s],n}static indexAt(t){let n=0;for(let r=0;r<t.length-1;r+=1){const s=t.charCodeAt(r)-65,i=t.length-1-r;n+=Yt.length**i+Yt.length*s}return n+=t.charCodeAt(t.length-1)-65,n}static deleteBlank(t){return ce.isString(t)?t.replace(/\s/g,""):t}static getSystemType(){const t=navigator.userAgent,n=navigator.platform==="Win32"||navigator.platform==="Windows",r=navigator.platform==="Mac68K"||navigator.platform==="MacPPC"||navigator.platform==="Macintosh"||navigator.platform==="MacIntel";if(r)return"Mac";if(navigator.platform==="X11"&&!n&&!r)return"Unix";if(String(navigator.platform).indexOf("Linux")>-1)return"Linux";if(n){if(t.indexOf("Windows NT 5.0")>-1||t.indexOf("Windows 2000")>-1)return"Windows 2000";if(t.indexOf("Windows NT 5.1")>-1||t.indexOf("Windows XP")>-1)return"Windows XP";if(t.indexOf("Windows NT 5.2")>-1||t.indexOf("Windows 2003")>-1)return"Windows 2003";if(t.indexOf("Windows NT 6.0")>-1||t.indexOf("Windows Vista")>-1)return"Windows Vista";if(t.indexOf("Windows NT 6.1")>-1||t.indexOf("Windows 7")>-1)return"Windows 7";if(t.indexOf("Windows NT 10")>-1||t.indexOf("Windows 10")>-1)return"Windows 10";if(t.indexOf("Windows NT 11")>-1||t.indexOf("Windows 11")>-1)return"Windows 11"}return"Unknown system"}static getBrowserType(){const t=navigator.userAgent,n=t.indexOf("Opera")>-1,r=t.indexOf("compatible")>-1&&t.indexOf("MSIE")>-1&&!n,s=t.indexOf("Trident")>-1&&t.indexOf("rv:11.0")>-1,i=t.indexOf("Edge")>-1,o=t.indexOf("Firefox")>-1,a=t.indexOf("Safari")>-1&&t.indexOf("Chrome")===-1,l=t.indexOf("Chrome")>-1&&t.indexOf("Safari")>-1;if(r){new RegExp("MSIE (\\d+\\.\\d+);").test(t);const h=Number.parseFloat(RegExp.$1);return h===7?"IE7":h===8?"IE8":h===9?"IE9":h===10?"IE10":"0"}return o?"FF":n?"Opera":a?"Safari":l?"Chrome":i?"Edge":s?"IE11":"Unknown browser"}static generateRandomId(t=21,n){return un(t,n)}static getClassName(t){return t.constructor.name}static deepMerge(t,...n){n.forEach(o=>o&&i(o));function r(o,a){o.forEach((l,c)=>{var h,u;if(ce.isArray(l)){const d=(h=a[c])!=null?h:[];a[c]=d,r(l,d);return}if(ce.isObject(l)){const d=(u=a[c])!=null?u:{};a[c]=d,s(l,d);return}a[c]=l})}function s(o,a){Object.keys(o).forEach(l=>{var h,u;const c=o[l];if(ce.isObject(c)){const d=(h=a[l])!=null?h:{};a[l]=d,s(c,d);return}if(ce.isArray(c)){const d=(u=a[l])!=null?u:[];a[l]=d,r(c,d);return}a[l]=c})}function i(o){Object.keys(o).forEach(a=>{var c,h;const l=o[a];if(ce.isArray(l)){const u=(c=t[a])!=null?c:[];t[a]=u,r(l,u);return}if(ce.isObject(l)){const u=(h=t[a])!=null?h:{};t[a]=u,s(l,u);return}t[a]=l})}return t}static numberFixed(t,n){return Number(Number(t).toFixed(n))}static diffValue(t,n){return xi(t,n)}static deepClone(t){if(!this.isDefine(t))return t;if(this.isRegExp(t))return new RegExp(t);if(this.isDate(t))return new Date(t);if(this.isArray(t)){const n=[];return t.forEach((r,s)=>{n[s]=ce.deepClone(r)}),n}if(this.isObject(t)){const n={};return Object.keys(t).forEach(r=>{const s=t[r];n[r]=ce.deepClone(s)}),Object.setPrototypeOf(n,Object.getPrototypeOf(t)),n}return t}static getLanguage(){const t="en-US";return globalThis.navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||t}static getValueType(t){return Object.prototype.toString.apply(t)}static isDefine(t){return t!=null}static isBlank(t){return this.isDefine(t)?this.isString(t)?t.trim()==="":!1:!0}static isBoolean(t){return this.getValueType(t)==="[object Boolean]"}static isPlainObject(t){return this.isDefine(t)?Object.getPrototypeOf(t)===Object.getPrototypeOf({}):!1}static isFunction(t){return this.getValueType(t)==="[object Function]"}static isDate(t){return this.getValueType(t)==="[object Date]"}static isRegExp(t){return this.getValueType(t)==="[object RegExp]"}static isArray(t){return this.getValueType(t)==="[object Array]"}static isString(t){return this.getValueType(t)==="[object String]"}static isNumber(t){return this.getValueType(t)==="[object Number]"}static isStringNumber(t){return!isNaN(Number.parseFloat(t))&&isFinite(t)}static isObject(t){return this.getValueType(t)==="[object Object]"}static isEmptyObject(t){for(const n in t)return!1;return!0}static isMobile(){let t=0,n=0;return document.body.clientWidth&&(t=document.body.clientWidth),document.body.clientHeight&&(n=document.body.clientHeight),this.isAndroid()||this.isIPhone()||this.isTablet()||t<350&&n<500}static isTablet(){return/ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(navigator.userAgent.toLowerCase())}static isWeChat(){const t=navigator.userAgent.toLowerCase();return String(t.match(/MicroMessenger/i))==="micromessenger"}static isAndroid(){const t=navigator.userAgent;return t.indexOf("Android")>-1||t.indexOf("Linux")>-1}static isIPhone(){return/iPhone/i.test(navigator.userAgent)}static isLegalUrl(t){return Tp(t)}static normalizeUrl(t){return Wl(t)}static topLevelDomainCombiningString(){return[...Bl].join("|")}static itCount(t){return n=>{for(let r=0;r<t;r++)n&&n()}}static hasLength(t,n){return ce.isDefine(t)?ce.isDefine(n)?t.length===n:t.length>0:!1}static capitalize(t){return t.charAt(0).toUpperCase()+t.slice(1)}static fCamelCase(t,n){return n.toUpperCase()}static camelCase(t){return t.replace(Mp,"ms-").replace(Dp,this.fCamelCase)}static removeNull(t){return this.isObject(t)&&Object.keys(t).forEach(n=>{const r=t[n];r==null?delete t[n]:ce.removeNull(r)}),t}static fillTwoDimensionalArray(t,n,r){return new Array(t).fill(r).map(s=>new Array(n).fill(r))}static numToWord(t){let n="";for(;t>0;){let r=t%26;r=r===0?r=26:r,n=String.fromCharCode(96+r)+n,t=(t-r)/26}return n.toLocaleUpperCase()}static ABCatNum(t){if(t==null||t.length===0)return Number.NaN;const n=t.toLowerCase().split(""),r=n.length;let s=0,i=0;for(let o=0;o<r;o++)i=n[o].charCodeAt(0)-96,s+=i*26**(r-o-1);return s===0?Number.NaN:s-1}static chatAtABC(t){let i="";for(;t>=0;)i=String.fromCharCode(t%26+97)+i,t=Math.floor(t/26)-1;return i.toUpperCase()}static randSort(t){for(let n=0,r=t.length;n<r;n++){const s=Number.parseInt((Math.random()*r).toString()),i=t[s];t[s]=t[n],t[n]=i}return t}static commonExtend(t,n){const r={};for(const s in t)r[s]=t[s];for(const s in n)n[s]!=null&&(r[s]=n[s]);return r}static commonExtend1(t,n){for(const r in t)n[r]==null&&(n[r]=t[r]);return n}static arrayToObject(t){const n={};return t.forEach((r,s)=>{n[s]={},r.forEach((i,o)=>{n[s][o]=i})}),n}static hasIntersectionBetweenTwoRanges(t,n,r,s){return n>=r&&s>=t}static isStartValidPosition(t){return/^[A-Za-z_]/.test(t)}static isValidParameter(t){const n=/[~!@#$%^&*()+=\-{}\[\]\|:;"'<>,?\/ ]+/.test(t),r=t.length<=255;return!n&&r}static clamp(t,n,r){return Math.max(n,Math.min(r,t))}static now(){return performance&&performance.now?performance.now():Date.now()}}function un(e=21,t){return t?wp(t,e)():bp(e)}function Ks(...e){const t={},n=e.length;for(let r=n-1;r>=0;r--){const s=e[r];if(s){const i=Object.keys(s);for(const o of i)t[o]===void 0&&(t[o]=s[o])}}return t}const Up=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null;function Ur(e,t,n){const{dataStream:r,textRuns:s=[]}=e;let i=t;const o=[];for(const a of s){const{st:l,ed:c}=a;ce.hasIntersectionBetweenTwoRanges(t,n,l,c)&&(l>i?(o.push(r.slice(i,l)),o.push(Xs(r,{...a,ed:Math.min(c,n)}))):o.push(Xs(r,{...a,st:i,ed:Math.min(c,n)}))),i=Math.max(t,Math.min(c,n))}return i!==n&&o.push(r.slice(i,n)),o.join("")}function Pp(e,t=!0){var n;if(t&&((n=e.paragraphs)!=null&&n.length)){const{dataStream:r,paragraphs:s=[]}=e;let i="",o=-1;for(const a of s){const{startIndex:l,paragraphStyle:c={}}=a,{spaceAbove:h,spaceBelow:u,lineSpacing:d}=c,f=[];h!=null&&(typeof h=="number"?f.push(`margin-top: ${h}px`):f.push(`margin-top: ${h.v}px`)),u!=null&&(typeof u=="number"?f.push(`margin-bottom: ${u}px`):f.push(`margin-bottom: ${u.v}px`)),d!=null&&f.push(`line-height: ${d}`),l>o+1?i+=`<p class="UniverNormal" ${f.length?`style="${f.join("; ")};"`:""}>${Ur(e,o+1,l)}</p>`:i+=`<p class="UniverNormal" ${f.length?`style="${f.join("; ")};"`:""}></p>`,o=l}return o!==r.length&&(i+=Ur(e,o,r.length)),i}else return Ur(e,0,e.dataStream.length)}function Xs(e,t){const{st:n,ed:r,ts:s={}}=t,{ff:i,fs:o,it:a,bl:l,ul:c,st:h,ol:u,bg:d,cl:f,va:E}=s;let v=e.slice(n,r);const O=[];return a===xe.TRUE&&(v=`<i>${v}</i>`),E===Ft.SUPERSCRIPT?v=`<sup>${v}</sup>`:E===Ft.SUBSCRIPT&&(v=`<sub>${v}</sub>`),(c==null?void 0:c.s)===xe.TRUE&&(v=`<u>${v}</u>`),(h==null?void 0:h.s)===xe.TRUE&&(v=`<s>${v}</s>`),l===xe.TRUE&&(v=`<strong>${v}</strong>`),i&&O.push(`font-family: ${i}`),f&&O.push(`color: ${f.rgb}`),o&&O.push(`font-size: ${o}pt`),u&&O.push("text-decoration: overline"),d&&O.push(`background: ${d.rgb}`),O.length?`<span style="${O.join("; ")};">${v}</span>`:v}const Yl={[ds.OFFICE]:{[ft.ACCENT1]:"#4472C4",[ft.ACCENT2]:"#ED7D31",[ft.ACCENT3]:"#A5A5A5",[ft.ACCENT4]:"#70AD47",[ft.ACCENT5]:"#5B9BD5",[ft.ACCENT6]:"#70AD47",[ft.DARK1]:"#000000",[ft.DARK2]:"#44546A",[ft.LIGHT1]:"#FFFFFF",[ft.LIGHT2]:"#E7E6E6",[ft.HYPERLINK]:"#0563C1",[ft.FOLLOWED_HYPERLINK]:"#954F72"}};class dr{constructor(){C(this,"_themeValue",ft.LIGHT1);C(this,"_themeColors");C(this,"_themeTint");C(this,"_rgbValue","");C(this,"_colorType");this._colorType=Ct.UNSUPPORTED,this._themeColors=ds.OFFICE,this._themeTint=0}asRgbColor(){return new Zr(this._rgbValue,this)}asThemeColor(){return new es(this._themeValue,this._themeTint,this._themeColors,this)}build(){switch(this._colorType){case Ct.THEME:return this.asThemeColor();case Ct.RGB:return this.asRgbColor();case Ct.UNSUPPORTED:throw new Error("unsupported color type")}}setRgbColor(t){return this._colorType=Ct.RGB,this._rgbValue=t,this}setThemeColors(t){this._colorType=Ct.THEME,this._themeColors=t}setThemeTint(t){this._colorType=Ct.THEME,this._themeTint=t}setThemeColor(t){return this._colorType=Ct.THEME,this._themeValue=t,this}getColorType(){return this._colorType}}class cn{constructor(t){C(this,"_builder");this._builder=t}static rgbColorToHexValue(t){return`#${((1<<24)+(t.getRed()<<16)+(t.getGreen()<<8)+t.getBlue()).toString(16).slice(1)}`}static hexValueToRgbColor(t){t?t.indexOf("#")>-1&&(t=t.substring(1)):t="#000000";const n=+`0x${t[0]}${t[1]}`,r=+`0x${t[2]}${t[3]}`,s=+`0x${t[4]}${t[5]}`;return new dr().setRgbColor(`rgb(${n},${r},${s})`).asRgbColor()}static hexToRgbString(t){const n=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;t=t.replace(n,(i,o,a,l)=>o+o+a+a+l+l);const r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);let s=null;if(r){const i=Number.parseInt(r[1],16),o=Number.parseInt(r[2],16),a=Number.parseInt(r[3],16);s=`rgba(${i},${o},${a})`}return s}asRgbColor(){return this._builder.asRgbColor()}asThemeColor(){return this._builder.asThemeColor()}getColorType(){return this._builder.getColorType()}clone(){return new cn(this._builder)}equals(t){return!1}}class zl{constructor(t){C(this,"_saturation",0);C(this,"_hue",0);C(this,"_lightness",0);C(this,"_alpha",0);const n=t.getRed()/255,r=t.getGreen()/255,s=t.getBlue()/255,i=t.getAlpha()/255,o=Math.min(n,Math.min(r,s)),a=Math.max(n,Math.max(r,s)),l=a-o;if(a===o){this._hue=0,this._saturation=0,this._lightness=a;return}this._lightness=(o+a)/2,this._lightness<.5?this._saturation=l/(a+o):this._saturation=l/(2-a-o),n===a&&(this._hue=(r-s)/l),r===a&&(this._hue=2+(s-n)/l),s===a&&(this._hue=4+(n-r)/l),this._hue*=60,this._hue<0&&(this._hue+=360),this._alpha=i}asRgbColor(){const t=new dr;if(this._saturation===0)return t.setRgbColor(`rgba(${this._lightness*255},${this._lightness*255},${this._lightness*255},${this._alpha*255})`),t.asRgbColor();let n;this._lightness<.5?n=this._lightness*(1+this._saturation):n=this._lightness+this._saturation-this._lightness*this._saturation;const r=2*this._lightness-n,s=this._hue/360,i=s+1/3,o=this.setColor(n,r,i),a=this.setColor(n,r,s),l=s-1/3,c=this.setColor(n,r,l);return t.setRgbColor(`rgba(${Math.round(o*255)},${Math.round(a*255)},${Math.round(c*255)},${this._alpha*255})`),t.asRgbColor()}getLightness(){return this._lightness}getHue(){return this._hue}getSaturation(){return this._saturation}getAlpha(){return this._alpha}setColor(t,n,r){r<0&&(r+=1),r>1&&(r-=1);let s;return 6*r<1?s=n+(t-n)*6*r:2*r<1?s=t:3*r<2?s=n+(t-n)*(2/3-r)*6:s=n,s}setLightness(t){this._lightness=t}}const vt=class vt extends cn{constructor(n,r){super(r);C(this,"_cssString");C(this,"_red");C(this,"_green");C(this,"_blue");C(this,"_alpha");let s=n.match(vt.RGBA_EXTRACT);if(s){const i=+s[1],o=+s[2],a=+s[3],l=+s[4];this._cssString=n,this._red=i,this._green=o,this._blue=a,this._alpha=l;return}if(s=n.match(vt.RGB_EXTRACT),s){const i=+s[1],o=+s[2],a=+s[3];this._cssString=n,this._red=i,this._green=o,this._blue=a,this._alpha=1;return}throw new Error("Invalid rgba or rgb color")}asHexString(){return cn.rgbColorToHexValue(this)}getRed(){let n=this._red+vt.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getGreen(){let n=this._green+vt.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getBlue(){let n=this._blue+vt.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getAlpha(){return this._alpha}getColorType(){return Ct.RGB}clone(){return new vt(this._cssString,this._builder)}asThemeColor(){throw new Error("rgb color not support to themeColor")}equals(n){return n instanceof vt?n._red===this._red&&n._blue===this._blue&&n._green===this._green&&n._alpha===this._alpha:!1}getCssString(){return this._cssString}};C(vt,"RGB_COLOR_AMT",0),C(vt,"RGBA_EXTRACT",new RegExp("\\s*rgba\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d.\\d|\\d\\s*)\\)\\s*")),C(vt,"RGB_EXTRACT",new RegExp("\\s*rgb\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*)\\)\\s*"));let Zr=vt;const Vt=class Vt extends cn{constructor(n,r,s,i){super(i);C(this,"_themeColorType");C(this,"_themeTint");C(this,"_themeColors");this._themeColorType=n,this._themeTint=r,this._themeColors=s}lumValue(n,r){if(n==null)return r;let s;return n<0?s=r*(1+n):s=r*(1-n)+(255-255*(1-n)),s}asRgbColor(){const n=Yl[this._themeColors];if(n==null)throw new Error("not find themeColors type");const r=n[this._themeColorType];if(r==null)throw new Error("not find themeColors value");let s;if(Vt._cacheThemeColor.has(this._themeColors)){if(s=Vt._cacheThemeColor.get(this._themeColors),s.has(this._themeColorType))return s.get(this._themeColorType)}else s=new Map,Vt._cacheThemeColor.set(this._themeColors,s);const i=new zl(cn.hexValueToRgbColor(r));i.setLightness(this.lumValue(this._themeTint,i.getLightness()*255)/255);const o=i.asRgbColor();return s.set(this._themeColorType,o),o}clone(){return new Vt(this._themeColorType,this._themeTint,this._themeColors,this._builder)}equals(n){return n instanceof Vt?n._themeColorType===this._themeColorType:!1}getColorType(){return Ct.THEME}getThemeColorType(){return this._themeColorType}};C(Vt,"_cacheThemeColor",new Map);let es=Vt;const Fp="rgb(",kp="rgba(",Qs={aliceBlue:[240,248,255],antiqueWhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blancheAlmond:[255,235,205],blue:[0,0,255],blueViolet:[138,43,226],brown:[165,42,42],burlyWood:[222,184,135],cadetBlue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornFlowerBlue:[100,149,237],cornSilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkCyan:[0,139,139],darkGoldenrod:[184,132,11],darkGray:[169,169,169],darkGreen:[0,100,0],darkGrey:[169,169,169],darkKhaki:[189,183,107],darkMagenta:[139,0,139],darkOliveGreen:[85,107,47],darkOrange:[255,140,0],darkOrchid:[153,50,204],darkRed:[139,0,0],darkSalmon:[233,150,122],darkSeaGreen:[143,188,143],darkSlateBlue:[72,61,139],darkSlateGray:[47,79,79],darkSlateGrey:[47,79,79],darkTurquoise:[0,206,209],darkViolet:[148,0,211],deepPink:[255,20,147],deepSkyBlue:[0,191,255],dimGray:[105,105,105],dimGrey:[105,105,105],dodgerBlue:[30,144,255],firebrick:[178,34,34],floralWhite:[255,255,240],forestGreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostWhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenYellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotPink:[255,105,180],indianRed:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderBlush:[255,240,245],lawnGreen:[124,252,0],lemonChiffon:[255,250,205],lightblue:[173,216,230],lightCoral:[240,128,128],lightCyan:[224,255,255],lightGoldenrodYellow:[250,250,210],lightGray:[211,211,211],lightGreen:[144,238,144],lightGrey:[211,211,211],lightPink:[255,182,193],lightSalmon:[255,160,122],lightSeaGreen:[32,178,170],lightSkyBlue:[135,206,250],lightSlateGray:[119,136,153],lightSlateGrey:[119,136,153],lightSteelBlue:[176,196,222],lightYellow:[255,255,224],lime:[0,255,0],limeGreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumAquamarine:[102,205,170],mediumBlue:[0,0,205],mediumOrchid:[186,85,211],mediumPurple:[147,112,219],mediumSeaGreen:[60,179,113],mediumSlateBlue:[123,104,238],mediumSpringGreen:[0,250,154],mediumTurquoise:[72,209,204],mediumVioletRed:[199,21,133],midBightBlue:[25,25,112],mintCream:[245,255,250],mistyRose:[255,228,225],moccasin:[255,228,181],navajoWhite:[255,222,173],navy:[0,0,128],oldLace:[253,245,230],olive:[128,128,0],oliveDrab:[107,142,35],orange:[255,165,0],orangeRed:[255,69,0],orchid:[218,112,214],paleGoldenrod:[238,232,170],paleGreen:[152,251,152],paleTurquoise:[175,238,238],paleVioletRed:[219,112,147],papayaWhip:[255,239,213],peachPuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderBlue:[176,224,230],purple:[128,0,128],rebeccaPurple:[102,51,153],red:[255,0,0],rosyBrown:[188,143,143],royalBlue:[65,105,225],saddleBrown:[139,69,19],salmon:[250,128,114],sandyBrown:[244,164,96],seaGreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyBlue:[135,206,235],slateBlue:[106,90,205],slateGray:[119,128,144],slateGrey:[119,128,144],snow:[255,255,250],springGreen:[0,255,127],steelBlue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whiteSmoke:[245,245,245],yellow:[255,255,0],yellowGreen:[154,205,5]};class Ot{constructor(t){C(this,"_color");C(this,"_rgbColor");C(this,"_isValid",!1);if(t==null){this._setNullColor();return}if(t instanceof Ot){this._color={...t._color},this._rgbColor={...t._rgbColor};return}const n=Vl(t);if(n==null){this._setNullColor();return}this._color=n;const r=Wp(this._color);if(r==null){this._setNullColor();return}this._rgbColor=r,this._isValid=!0}static mix(t,n,r){var c,h;r=Math.min(1,Math.max(0,r));const s=new Ot(t).toRgb(),i=new Ot(n).toRgb(),o=(c=s.a)!=null?c:1,a=(h=i.a)!=null?h:1,l={r:(i.r-s.r)*r+s.r,g:(i.g-s.g)*r+s.g,b:(i.b-s.b)*r+s.b,a:(a-o)*r+o};return new Ot(l)}static getContrastRatio(t,n){const r=new Ot(t).getLuminance(),s=new Ot(n).getLuminance();return(Math.max(r,s)+.05)/(Math.min(r,s)+.05)}get isValid(){return this._isValid}toRgb(){return this._rgbColor}toRgbString(){const{r:t,g:n,b:r,a:s=1}=this.toRgb(),i=s<1;return`rgb${i?"a":""}(${t},${n},${r}${i?`,${s}`:""})`}toString(){return this.toRgbString()}toHexString(t){const{r:n,g:r,b:s,a:i=1}=this.toRgb(),o=i<1,a=[Cr(Math.round(n).toString(16)),Cr(Math.round(r).toString(16)),Cr(Math.round(s).toString(16)),Cr(Math.round(i*255).toString(16))];return t&&a[0][0]===a[0][1]&&a[1][0]===a[1][1]&&a[2][0]===a[2][1]&&a[3][0]===a[3][1]?o?`#${a[0][0]}${a[1][0]}${a[2][0]}${a[3][0]}`:`#${a[0][0]}${a[1][0]}${a[2][0]}`:o?`#${a[0]}${a[1]}${a[2]}${a[3]}`:`#${a[0]}${a[1]}${a[2]}`}toHsv(){return Gp(this.toRgb())}toHsl(){return Vp(this.toRgb())}lighten(t=10){const n=this.toHsl();return n.l+=t,n.l=Math.min(Math.max(n.l,0),100),new Ot(n)}darken(t=10){const n=this.toHsl();return n.l-=t,n.l=Math.min(Math.max(n.l,0),100),new Ot(n)}setAlpha(t){return new Ot({...this._rgbColor,a:t})}getLuminance(){let{r:t,g:n,b:r}=this.toRgb();return t=Ss(t),n=Ss(n),r=Ss(r),Number((.2126*t+.7152*n+.0722*r).toFixed(3))}getBrightness(){const{r:t,g:n,b:r}=this.toRgb();return(t*299+n*587+r*114)/1e3}getAlpha(){var t;return(t=this._color.a)!=null?t:1}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}_setNullColor(){this._isValid=!1,this._color={r:0,g:0,b:0,a:0},this._rgbColor={r:0,g:0,b:0,a:0}}}const Cr=e=>e.length===1?`0${e}`:e,Ss=e=>(e/=255,e<=.03928?e/12.92:((e+.055)/1.055)**2.4),Vl=e=>{if(Xp(e)){if("r"in e){const r={r:Math.round(e.r),g:Math.round(e.g),b:Math.round(e.b)};return e.a!==void 0&&(r.a=e.a),r}if("l"in e){const r={h:Math.round(e.h),s:e.s,l:e.l};return e.a!==void 0&&(r.a=e.a),r}const n={h:Math.round(e.h),s:e.s,v:e.v};return e.a!==void 0&&(n.a=e.a),n}const t=e.trim();if(Qs[t]){const n=Qs[t],r={r:Math.round(n[0]),g:Math.round(n[1]),b:Math.round(n[2])};return r.a=n[3]||1,r}if(t.startsWith("#"))return $p(t);if(t.startsWith("rgb"))return jp(t);if(t.startsWith("hsl"))return Bp(t);if(t.startsWith("hsv"))return Hp(t)},$p=e=>{const t=e.substring(1),n=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let r=t.match(n);if(!r||r.length<3)throw new Error(`The color '${e}' is illegal hex color`);r[0].length===1&&(r=r.map(i=>i+i));const s={r:Number.parseInt(r[0],16),g:Number.parseInt(r[1],16),b:Number.parseInt(r[2],16)};return r.length>3&&(s.a=Number.parseInt(r[3],16)/255),s},jp=e=>{const t=e.indexOf("(");if(t===-1)throw new Error(`The color '${e}' is illegal rgb color`);const n=e.substring(t+1,e.length-1).split(",");if(n.length<3)throw new Error(`The color '${e}' is illegal rgb color`);const r={r:Number.parseInt(n[0],10),g:Number.parseInt(n[1],10),b:Number.parseInt(n[2],10)};return n.length>3&&(r.a=Number.parseFloat(n[3])),r},Bp=e=>{const t=e.indexOf("(");if(t===-1)throw new Error(`The color '${e}' is illegal hsl color`);const n=e.substring(t+1,e.length-1).split(",");if(n.length<3)throw new Error(`The color '${e}' is illegal hsl color`);const r={h:Number.parseInt(n[0],10),s:Number.parseFloat(n[1]),l:Number.parseFloat(n[2])};return n.length>3&&(r.a=Number.parseFloat(n[3])),r},Hp=e=>{const t=e.indexOf("(");if(t===-1)throw new Error(`The color '${e}' is illegal hsv color`);const n=e.substring(t+1,e.length-1).split(",");if(n.length<3)throw new Error(`The color '${e}' is illegal hsv color`);const r={h:Number.parseInt(n[0],10),s:Number.parseFloat(n[1]),v:Number.parseFloat(n[2])};return n.length>3&&(r.a=Number.parseFloat(n[3])),r},Wp=e=>{const t=Vl(e);if(t!=null)return"r"in t?t:"l"in t?Yp(t):zp(t)},ys=(e,t,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),Yp=e=>{let{h:t,s:n,l:r}=e;t/=360,n/=100,r/=100;let s=0,i=0,o=0;if(n===0)s=i=o=r;else{const l=r<.5?r*(1+n):r+n-r*n,c=2*r-l;s=ys(c,l,t+1/3),i=ys(c,l,t),o=ys(c,l,t-1/3)}const a={r:Math.round(s*255),g:Math.round(i*255),b:Math.round(o*255)};return e.a!==void 0&&(a.a=e.a),a},zp=e=>{let{h:t,s:n,v:r}=e;t=t/360*6,n/=100,r/=100;const s=Math.floor(t),i=t-s,o=r*(1-n),a=r*(1-i*n),l=r*(1-(1-i)*n),c=s%6,h=[r,a,o,o,l,r][c],u=[l,r,r,a,o,o][c],d=[o,o,l,r,r,a][c],f={r:h*255,g:u*255,b:d*255};return e.a!==void 0&&(f.a=e.a),f},Vp=e=>{let{r:t,g:n,b:r}=e;t/=255,n/=255,r/=255;const s=Math.max(t,n,r),i=Math.min(t,n,r),o=(s+i)/2;let a,l;if(s===i)a=l=0;else{const h=s-i;switch(l=o>.5?h/(2-s-i):h/(s+i),s){case t:a=(n-r)/h+(n<r?6:0);break;case n:a=(r-t)/h+2;break;default:a=(t-n)/h+4;break}a/=6}const c={h:Math.round(a*360),s:Math.round(l*100),l:Math.round(o*100)};return e.a!==void 0&&(c.a=e.a),c},Gp=e=>{let{r:t,g:n,b:r}=e;t/=255,n/=255,r/=255;const s=Math.max(t,n,r),i=Math.min(t,n,r);let o;const a=s,l=s-i,c=s===0?0:l/s;if(s===i)o=0;else{switch(s){case t:o=(n-r)/l+(n<r?6:0);break;case n:o=(r-t)/l+2;break;default:o=(t-n)/l+4;break}o/=6}const h={h:Math.round(o*360),s:Math.round(c*100),v:Math.round(a*100)};return e.a!==void 0&&(h.a=e.a),h},Kp=e=>e==null,Xp=e=>!Kp(e)&&typeof e=="object";function Qp(e){const t=/^#(?:[0]{3}|[0]{6})\b/,n=/^rgb\s*\(\s*0+\s*,\s*0+\s*,\s*0+\s*\)$/,r=/^rgba\s*\(\s*0+\s*,\s*0+\s*,\s*0+\s*,\s*(1|1\.0*|0?\.\d+)\)$/,s=/^hsl\s*\(\s*0*\s*,\s*0%*\s*,\s*0%*\s*\)$/,i=/^hsla\s*\(\s*0*\s*,\s*0%*\s*,\s*0%*\s*,\s*(1|1\.0*|0?\.\d+)\)$/;return!!(t.test(e)||n.test(e)||r.test(e)||s.test(e)||i.test(e))}function Jp(e){const t=/^#(?:[Ff]{3}|[Ff]{6})\b/,n=/^rgb\s*\(\s*255\s*,\s*255\s*,\s*255\s*\)$/,r=/^rgba\s*\(\s*255\s*,\s*255\s*,\s*255\s*,\s*(1|1\.0*|0?\.\d+)\)$/,s=/^hsl\s*\(\s*0*\s*,\s*0%*\s*,\s*100%*\s*\)$/,i=/^hsla\s*\(\s*0*\s*,\s*0%*\s*,\s*100%*\s*,\s*(1|1\.0*|0?\.\d+)\)$/;return!!(t.test(e)||n.test(e)||r.test(e)||s.test(e)||i.test(e))}var Pe=(e=>(e[e.COVER=0]="COVER",e[e.REPLACE=1]="REPLACE",e))(Pe||{});function qp(e){return e&&(e.s!==void 0||e.p!==void 0||e.v!==void 0||e.t!==void 0||e.f!==void 0||e.si!==void 0||e.custom!==void 0)}function Zp(e){if(e.t!==void 0)return e.t;if(typeof e.v=="string")return Xt.STRING;if(typeof e.v=="number")return Xt.NUMBER;if(typeof e.v=="boolean")return Xt.BOOLEAN}function em(e){if(e==null)return!0;const{v:t,f:n,si:r,p:s,custom:i}=e;return!(!(t==null||typeof t=="string"&&t.length===0)||n!=null&&n.length>0||r!=null&&r.length>0||s!=null||i!=null)}function tm(e){return e!=null&&(typeof e=="string"||typeof e=="number"||typeof e=="boolean")}var De=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ROW=1]="ROW",e[e.COLUMN=2]="COLUMN",e[e.ALL=3]="ALL",e))(De||{}),et=(e=>(e[e.NONE=0]="NONE",e[e.ROW=1]="ROW",e[e.COLUMN=2]="COLUMN",e[e.ALL=3]="ALL",e))(et||{});function nm(e){return[e.startRow,e.startColumn,e.endRow,e.endColumn]}var Gl=(e=>(e.NONE="none",e.BACKWARD="backward",e.FORWARD="forward",e))(Gl||{}),Kl=(e=>(e.RECT="RECT",e.TEXT="TEXT",e))(Kl||{});function rm(e,t,n){let r=!1,s=!1,i=e,o=t,a=e,l=t;if(n==null)return{actualRow:e,actualColumn:t,isMergedMainCell:s,isMerged:r,endRow:i,endColumn:o,startRow:a,startColumn:l};for(let c=0;c<n.length;c++){const{startRow:h,endRow:u,startColumn:d,endColumn:f}=n[c];if(e===h&&t===d){i=u,o=f,a=h,l=d,s=!0;break}if(e>=h&&e<=u&&t>=d&&t<=f){i=u,o=f,a=h,l=d,r=!0;break}}return{actualRow:e,actualColumn:t,isMergedMainCell:s,isMerged:r,endRow:i,endColumn:o,startRow:a,startColumn:l}}var Cn=(e=>(e.Raw="raw",e.Intercepted="intercepted",e.Both="both",e))(Cn||{});function Xl(e){const{actualRow:t,actualColumn:n,isMerged:r,isMergedMainCell:s,mergeInfo:i}=e;let{startY:o,endY:a,startX:l,endX:c}=e,h=t,u=n,d=t,f=n;if(r&&i){const{startRow:E,startColumn:v,endRow:O,endColumn:T,startY:V,endY:Y,startX:ie,endX:N}=i;h=E,u=v,d=O,f=T,o=V,a=Y,l=ie,c=N}return s&&(o=i.startY,a=i.endY,l=i.startX,c=i.endX,d=i.endRow,f=i.endColumn),{startRow:h,startColumn:u,endRow:d,endColumn:f,startY:o,endY:a,startX:l,endX:c}}const sm=Xl;function im(e){if(!e)return;const{actualRow:t,actualColumn:n,isMerged:r,isMergedMainCell:s,startRow:i,startColumn:o,endRow:a,endColumn:l}=e;let c=t,h=n,u=t,d=n;return(r||s)&&(c=i,h=o,u=a,d=l),{startRow:c,startColumn:h,endRow:u,endColumn:d}}function Ql(e){var n;return!e||(((n=e==null?void 0:e.v)==null?void 0:n.toString())||"").length===0&&!e.p}function om(e){return Ql(e)&&(e==null?void 0:e.coverable)!==!1}function Nt(e){if(e){if(e.rgb)return e.rgb;if(e.th)return new dr().setThemeColor(e.th).asThemeColor().asRgbColor().getCssString()}return null}function am(e){return ce.isString(e)&&e.substring(0,1)==="="&&e.length>1}function lm(e){return ce.isString(e)&&e.length>0}function um(e,t=!1){var i;let n="";const r=new Map([["ff",()=>{e.ff&&(n+=`font-family: ${e.ff}; `)}],["fs",()=>{if(e.fs){let o=e.fs;e.va&&(o/=2),n+=`font-size: ${o}pt; `}}],["it",()=>{e.it&&(n+="font-style: italic; ")}],["bl",()=>{e.bl&&(n+="font-weight: bold; ")}],["ul",()=>{var o;(o=e.ul)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} underline`):n+="text-decoration: underline; ",e.ul.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${Nt(e.ul.cl)}; `),e.ul.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.ul.t} `))}],["st",()=>{var o;(o=e.st)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} line-through`):n+="text-decoration-line: line-through; ",e.st.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${Nt(e.st.cl)}; `),e.st.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.st.t} `))}],["ol",()=>{var o;(o=e.ol)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} overline`):n+="text-decoration-line: overline; ",e.ol.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${Nt(e.ol.cl)}; `),e.ol.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.ol.t} `))}],["bg",()=>{e.bg&&(n+=`background: ${Nt(e.bg)}; `)}],["bd",()=>{var o,a,l,c,h,u,d,f,E,v,O,T;(o=e.bd)!=null&&o.b&&(n+=`border-bottom: ${Rr((a=e.bd)==null?void 0:a.b.s)} ${(l=Nt(e.bd.b.cl))!=null?l:""}; `),(c=e.bd)!=null&&c.t&&(n+=`border-top: ${Rr((h=e.bd)==null?void 0:h.t.s)} ${(u=Nt(e.bd.t.cl))!=null?u:""}; `),(d=e.bd)!=null&&d.r&&(n+=`border-right: ${Rr((f=e.bd)==null?void 0:f.r.s)} ${(E=Nt(e.bd.r.cl))!=null?E:""}; `),(v=e.bd)!=null&&v.l&&(n+=`border-left: ${Rr((O=e.bd)==null?void 0:O.l.s)} ${(T=Nt(e.bd.l.cl))!=null?T:""}; `)}],["cl",()=>{e.cl&&(n+=`color: ${Nt(e.cl)}; `)}],["va",()=>{e.va===Ft.SUBSCRIPT?n+="vertical-align: sub; ":e.va===Ft.SUPERSCRIPT&&(n+="vertical-align: super; ")}],["td",()=>{e.td===Zn.LEFT_TO_RIGHT?n+="direction: ltr; ":e.td===Zn.RIGHT_TO_LEFT&&(n+="direction: rtl; ")}],["tr",()=>{var o,a,l;e.tr&&(n+=`--data-rotate: (${(o=e.tr)==null?void 0:o.a}deg${(a=e.tr)!=null&&a.v?` ,${(l=e.tr)==null?void 0:l.v}`:""});`)}],["ht",()=>{e.ht===Gt.LEFT?n+="text-align: left; ":e.ht===Gt.RIGHT?n+="text-align: right; ":e.ht===Gt.CENTER?n+="text-align: center; ":e.ht===Gt.JUSTIFIED&&(n+="text-align: justify; ")}],["vt",()=>{e.vt===sn.BOTTOM?n+="vertical-align: bottom; ":e.vt===sn.TOP?n+="vertical-align: top; ":e.vt===sn.MIDDLE&&(n+="vertical-align: middle; ")}],["tb",()=>{e.tb===ln.CLIP?n+="white-space: nowrap; overflow-x: hidden; ":e.tb===ln.WRAP&&(n+="white-space: normal;")}],["pd",()=>{var h,u,d,f,E,v,O,T;const o=`${(h=e.pd)==null?void 0:h.b}pt`,a=`${(u=e.pd)==null?void 0:u.t}pt`,l=`${(d=e.pd)==null?void 0:d.l}pt`,c=`${(f=e.pd)==null?void 0:f.r}pt`;(E=e.pd)!=null&&E.b&&(n+=`padding-bottom: ${o}; `),(v=e.pd)!=null&&v.t&&(n+=`padding-top: ${a}; `),(O=e.pd)!=null&&O.l&&(n+=`padding-left: ${l}; `),(T=e.pd)!=null&&T.r&&(n+=`padding-right: ${c}; `)}]]),s=["bd","tr","tb"];for(const o in e)t&&s.includes(o)||(i=r.get(o))==null||i();return n}function Rr(e){let t="";return e===Ke.NONE?t="none":e===Ke.THIN?t="0.5pt solid":e===Ke.HAIR?t="0.5pt double":e===Ke.DOTTED?t="0.5pt dotted":e===Ke.DASHED||e===Ke.DASH_DOT?t="0.5pt dashed":e===Ke.DASH_DOT_DOT?t="0.5pt dotted":e===Ke.DOUBLE?t="0.5pt double":e===Ke.MEDIUM?t="1pt solid":e===Ke.MEDIUM_DASHED||e===Ke.MEDIUM_DASH_DOT?t="1pt dashed":e===Ke.MEDIUM_DASH_DOT_DOT?t="1pt dotted":e===Ke.SLANT_DASH_DOT?t="0.5pt dashed":e===Ke.THICK&&(t="1.5pt solid"),t}function cm(e){let t=0;if(e=e.trim(),e==="none")t=Ke.NONE;else if(e==="0.5pt solid")t=Ke.THIN;else if(e==="0.5pt double")t=Ke.HAIR;else if(e==="0.5pt dotted")t=Ke.DOTTED;else if(e==="0.5pt dashed")t=Ke.DASHED;else if(e==="1pt solid")t=Ke.MEDIUM;else if(e==="1pt dashed")t=Ke.MEDIUM_DASHED;else if(e==="1pt dotted")t=Ke.MEDIUM_DASH_DOT_DOT;else if(e==="1.5pt solid")t=Ke.THICK;else if(!e.includes("none"))t=Ke.THIN;else return Ke.NONE;return t}function hm(e,t){let n=e.body;if(t){const{headers:r,footers:s}=e;r!=null&&r[t]?n=r[t].body:s!=null&&s[t]&&(n=s[t].body)}return n}function dm(e,t){const{startRow:n,endRow:r,startColumn:s,endColumn:i,rangeType:o}=e;if(n<0||s<0||r<0||i<0||!(Number.isNaN(n)&&Number.isNaN(r))&&o===De.COLUMN||!(Number.isNaN(s)&&Number.isNaN(i))&&o===De.ROW||o!==De.ROW&&o!==De.COLUMN&&(Number.isNaN(s)||Number.isNaN(n)||Number.isNaN(i)||Number.isNaN(r)))return!1;if(t){const a=t.getRowCount(),l=t.getColumnCount();if(r>=a||i>=l)return!1}return!0}function fm(e,t){return{startRow:e,endRow:e,startColumn:t,endColumn:t}}function Li(e,t){return Object.prototype.toString.call(e)===Object.prototype.toString.call(t)?Object.prototype.toString.call(e)==="[object Object]"||Object.prototype.toString.call(e)==="[object Array]"?Object.keys(e).length!==Object.keys(t).length?!1:Object.keys(e).every(n=>Li(e[n],t[n])):e===t:!1}function Jl(e,t){const n=e.ts||{},r=t.ts||{};return e.sId!==t.sId?!1:Li(n,r)}function gm(e,t){return t.some(n=>e.indexOf(n)>-1)}var Pr={exports:{}},pm=Pr.exports,Uo;function mm(){return Uo||(Uo=1,function(e,t){(function(n,r){e.exports=r()})(pm,function(){var n=1e3,r=6e4,s=36e5,i="millisecond",o="second",a="minute",l="hour",c="day",h="week",u="month",d="quarter",f="year",E="date",v="Invalid Date",O=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,T=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,V={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(D){var w=["th","st","nd","rd"],y=D%100;return"["+D+(w[(y-20)%10]||w[y]||w[0])+"]"}},Y=function(D,w,y){var F=String(D);return!F||F.length>=w?D:""+Array(w+1-F.length).join(y)+D},ie={s:Y,z:function(D){var w=-D.utcOffset(),y=Math.abs(w),F=Math.floor(y/60),$=y%60;return(w<=0?"+":"-")+Y(F,2,"0")+":"+Y($,2,"0")},m:function D(w,y){if(w.date()<y.date())return-D(y,w);var F=12*(y.year()-w.year())+(y.month()-w.month()),$=w.clone().add(F,u),G=y-$<0,re=w.clone().add(F+(G?-1:1),u);return+(-(F+(y-$)/(G?$-re:re-$))||0)},a:function(D){return D<0?Math.ceil(D)||0:Math.floor(D)},p:function(D){return{M:u,y:f,w:h,d:c,D:E,h:l,m:a,s:o,ms:i,Q:d}[D]||String(D||"").toLowerCase().replace(/s$/,"")},u:function(D){return D===void 0}},N="en",A={};A[N]=V;var H="$isDayjsObject",q=function(D){return D instanceof B||!(!D||!D[H])},de=function D(w,y,F){var $;if(!w)return N;if(typeof w=="string"){var G=w.toLowerCase();A[G]&&($=G),y&&(A[G]=y,$=G);var re=w.split("-");if(!$&&re.length>1)return D(re[0])}else{var he=w.name;A[he]=w,$=he}return!F&&$&&(N=$),$||!F&&N},ae=function(D,w){if(q(D))return D.clone();var y=typeof w=="object"?w:{};return y.date=D,y.args=arguments,new B(y)},m=ie;m.l=de,m.i=q,m.w=function(D,w){return ae(D,{locale:w.$L,utc:w.$u,x:w.$x,$offset:w.$offset})};var B=function(){function D(y){this.$L=de(y.locale,null,!0),this.parse(y),this.$x=this.$x||y.x||{},this[H]=!0}var w=D.prototype;return w.parse=function(y){this.$d=function(F){var $=F.date,G=F.utc;if($===null)return new Date(NaN);if(m.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var re=$.match(O);if(re){var he=re[2]-1||0,fe=(re[7]||"0").substring(0,3);return G?new Date(Date.UTC(re[1],he,re[3]||1,re[4]||0,re[5]||0,re[6]||0,fe)):new Date(re[1],he,re[3]||1,re[4]||0,re[5]||0,re[6]||0,fe)}}return new Date($)}(y),this.init()},w.init=function(){var y=this.$d;this.$y=y.getFullYear(),this.$M=y.getMonth(),this.$D=y.getDate(),this.$W=y.getDay(),this.$H=y.getHours(),this.$m=y.getMinutes(),this.$s=y.getSeconds(),this.$ms=y.getMilliseconds()},w.$utils=function(){return m},w.isValid=function(){return this.$d.toString()!==v},w.isSame=function(y,F){var $=ae(y);return this.startOf(F)<=$&&$<=this.endOf(F)},w.isAfter=function(y,F){return ae(y)<this.startOf(F)},w.isBefore=function(y,F){return this.endOf(F)<ae(y)},w.$g=function(y,F,$){return m.u(y)?this[F]:this.set($,y)},w.unix=function(){return Math.floor(this.valueOf()/1e3)},w.valueOf=function(){return this.$d.getTime()},w.startOf=function(y,F){var $=this,G=!!m.u(F)||F,re=m.p(y),he=function(z,W){var le=m.w($.$u?Date.UTC($.$y,W,z):new Date($.$y,W,z),$);return G?le:le.endOf(c)},fe=function(z,W){return m.w($.toDate()[z].apply($.toDate("s"),(G?[0,0,0,0]:[23,59,59,999]).slice(W)),$)},Ae=this.$W,we=this.$M,I=this.$D,k="set"+(this.$u?"UTC":"");switch(re){case f:return G?he(1,0):he(31,11);case u:return G?he(1,we):he(0,we+1);case h:var K=this.$locale().weekStart||0,Q=(Ae<K?Ae+7:Ae)-K;return he(G?I-Q:I+(6-Q),we);case c:case E:return fe(k+"Hours",0);case l:return fe(k+"Minutes",1);case a:return fe(k+"Seconds",2);case o:return fe(k+"Milliseconds",3);default:return this.clone()}},w.endOf=function(y){return this.startOf(y,!1)},w.$set=function(y,F){var $,G=m.p(y),re="set"+(this.$u?"UTC":""),he=($={},$[c]=re+"Date",$[E]=re+"Date",$[u]=re+"Month",$[f]=re+"FullYear",$[l]=re+"Hours",$[a]=re+"Minutes",$[o]=re+"Seconds",$[i]=re+"Milliseconds",$)[G],fe=G===c?this.$D+(F-this.$W):F;if(G===u||G===f){var Ae=this.clone().set(E,1);Ae.$d[he](fe),Ae.init(),this.$d=Ae.set(E,Math.min(this.$D,Ae.daysInMonth())).$d}else he&&this.$d[he](fe);return this.init(),this},w.set=function(y,F){return this.clone().$set(y,F)},w.get=function(y){return this[m.p(y)]()},w.add=function(y,F){var $,G=this;y=Number(y);var re=m.p(F),he=function(we){var I=ae(G);return m.w(I.date(I.date()+Math.round(we*y)),G)};if(re===u)return this.set(u,this.$M+y);if(re===f)return this.set(f,this.$y+y);if(re===c)return he(1);if(re===h)return he(7);var fe=($={},$[a]=r,$[l]=s,$[o]=n,$)[re]||1,Ae=this.$d.getTime()+y*fe;return m.w(Ae,this)},w.subtract=function(y,F){return this.add(-1*y,F)},w.format=function(y){var F=this,$=this.$locale();if(!this.isValid())return $.invalidDate||v;var G=y||"YYYY-MM-DDTHH:mm:ssZ",re=m.z(this),he=this.$H,fe=this.$m,Ae=this.$M,we=$.weekdays,I=$.months,k=$.meridiem,K=function(W,le,oe,j){return W&&(W[le]||W(F,G))||oe[le].slice(0,j)},Q=function(W){return m.s(he%12||12,W,"0")},z=k||function(W,le,oe){var j=W<12?"AM":"PM";return oe?j.toLowerCase():j};return G.replace(T,function(W,le){return le||function(oe){switch(oe){case"YY":return String(F.$y).slice(-2);case"YYYY":return m.s(F.$y,4,"0");case"M":return Ae+1;case"MM":return m.s(Ae+1,2,"0");case"MMM":return K($.monthsShort,Ae,I,3);case"MMMM":return K(I,Ae);case"D":return F.$D;case"DD":return m.s(F.$D,2,"0");case"d":return String(F.$W);case"dd":return K($.weekdaysMin,F.$W,we,2);case"ddd":return K($.weekdaysShort,F.$W,we,3);case"dddd":return we[F.$W];case"H":return String(he);case"HH":return m.s(he,2,"0");case"h":return Q(1);case"hh":return Q(2);case"a":return z(he,fe,!0);case"A":return z(he,fe,!1);case"m":return String(fe);case"mm":return m.s(fe,2,"0");case"s":return String(F.$s);case"ss":return m.s(F.$s,2,"0");case"SSS":return m.s(F.$ms,3,"0");case"Z":return re}return null}(W)||re.replace(":","")})},w.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},w.diff=function(y,F,$){var G,re=this,he=m.p(F),fe=ae(y),Ae=(fe.utcOffset()-this.utcOffset())*r,we=this-fe,I=function(){return m.m(re,fe)};switch(he){case f:G=I()/12;break;case u:G=I();break;case d:G=I()/3;break;case h:G=(we-Ae)/6048e5;break;case c:G=(we-Ae)/864e5;break;case l:G=we/s;break;case a:G=we/r;break;case o:G=we/n;break;default:G=we}return $?G:m.a(G)},w.daysInMonth=function(){return this.endOf(u).$D},w.$locale=function(){return A[this.$L]},w.locale=function(y,F){if(!y)return this.$L;var $=this.clone(),G=de(y,F,!0);return G&&($.$L=G),$},w.clone=function(){return m.w(this.$d,this)},w.toDate=function(){return new Date(this.valueOf())},w.toJSON=function(){return this.isValid()?this.toISOString():null},w.toISOString=function(){return this.$d.toISOString()},w.toString=function(){return this.$d.toUTCString()},D}(),S=B.prototype;return ae.prototype=S,[["$ms",i],["$s",o],["$m",a],["$H",l],["$W",c],["$M",u],["$y",f],["$D",E]].forEach(function(D){S[D[1]]=function(w){return this.$g(w,D[0],D[1])}}),ae.extend=function(D,w){return D.$i||(D(w,B,ae),D.$i=!0),ae},ae.locale=de,ae.isDayjs=q,ae.unix=function(D){return ae(1e3*D)},ae.en=A[N],ae.Ls=A,ae.p={},ae})}(Pr)),Pr.exports}var _m=mm();const Bt=It(_m);var Fr={exports:{}},Em=Fr.exports,Po;function vm(){return Po||(Po=1,function(e,t){(function(n,r){e.exports=r()})(Em,function(){return function(n,r){var s=r.prototype,i=s.format;s.format=function(o){var a=this,l=this.$locale();if(!this.isValid())return i.bind(this)(o);var c=this.$utils(),h=(o||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(u){switch(u){case"Q":return Math.ceil((a.$M+1)/3);case"Do":return l.ordinal(a.$D);case"gggg":return a.weekYear();case"GGGG":return a.isoWeekYear();case"wo":return l.ordinal(a.week(),"W");case"w":case"ww":return c.s(a.week(),u==="w"?1:2,"0");case"W":case"WW":return c.s(a.isoWeek(),u==="W"?1:2,"0");case"k":case"kk":return c.s(String(a.$H===0?24:a.$H),u==="k"?1:2,"0");case"X":return Math.floor(a.$d.getTime()/1e3);case"x":return a.$d.getTime();case"z":return"["+a.offsetName()+"]";case"zzz":return"["+a.offsetName("long")+"]";default:return u}});return i.bind(this)(h)}}})}(Fr)),Fr.exports}var Cm=vm();const Rm=It(Cm);var kr={exports:{}},Im=kr.exports,Fo;function Sm(){return Fo||(Fo=1,function(e,t){(function(n,r){e.exports=r()})(Im,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,s=/\d/,i=/\d\d/,o=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,l={},c=function(O){return(O=+O)+(O>68?1900:2e3)},h=function(O){return function(T){this[O]=+T}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(O){(this.zone||(this.zone={})).offset=function(T){if(!T||T==="Z")return 0;var V=T.match(/([+-]|\d\d)/g),Y=60*V[1]+(+V[2]||0);return Y===0?0:V[0]==="+"?-Y:Y}(O)}],d=function(O){var T=l[O];return T&&(T.indexOf?T:T.s.concat(T.f))},f=function(O,T){var V,Y=l.meridiem;if(Y){for(var ie=1;ie<=24;ie+=1)if(O.indexOf(Y(ie,0,T))>-1){V=ie>12;break}}else V=O===(T?"pm":"PM");return V},E={A:[a,function(O){this.afternoon=f(O,!1)}],a:[a,function(O){this.afternoon=f(O,!0)}],Q:[s,function(O){this.month=3*(O-1)+1}],S:[s,function(O){this.milliseconds=100*+O}],SS:[i,function(O){this.milliseconds=10*+O}],SSS:[/\d{3}/,function(O){this.milliseconds=+O}],s:[o,h("seconds")],ss:[o,h("seconds")],m:[o,h("minutes")],mm:[o,h("minutes")],H:[o,h("hours")],h:[o,h("hours")],HH:[o,h("hours")],hh:[o,h("hours")],D:[o,h("day")],DD:[i,h("day")],Do:[a,function(O){var T=l.ordinal,V=O.match(/\d+/);if(this.day=V[0],T)for(var Y=1;Y<=31;Y+=1)T(Y).replace(/\[|\]/g,"")===O&&(this.day=Y)}],w:[o,h("week")],ww:[i,h("week")],M:[o,h("month")],MM:[i,h("month")],MMM:[a,function(O){var T=d("months"),V=(d("monthsShort")||T.map(function(Y){return Y.slice(0,3)})).indexOf(O)+1;if(V<1)throw new Error;this.month=V%12||V}],MMMM:[a,function(O){var T=d("months").indexOf(O)+1;if(T<1)throw new Error;this.month=T%12||T}],Y:[/[+-]?\d+/,h("year")],YY:[i,function(O){this.year=c(O)}],YYYY:[/\d{4}/,h("year")],Z:u,ZZ:u};function v(O){var T,V;T=O,V=l&&l.formats;for(var Y=(O=T.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(ae,m,B){var S=B&&B.toUpperCase();return m||V[B]||n[B]||V[S].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(D,w,y){return w||y.slice(1)})})).match(r),ie=Y.length,N=0;N<ie;N+=1){var A=Y[N],H=E[A],q=H&&H[0],de=H&&H[1];Y[N]=de?{regex:q,parser:de}:A.replace(/^\[|\]$/g,"")}return function(ae){for(var m={},B=0,S=0;B<ie;B+=1){var D=Y[B];if(typeof D=="string")S+=D.length;else{var w=D.regex,y=D.parser,F=ae.slice(S),$=w.exec(F)[0];y.call(m,$),ae=ae.replace($,"")}}return function(G){var re=G.afternoon;if(re!==void 0){var he=G.hours;re?he<12&&(G.hours+=12):he===12&&(G.hours=0),delete G.afternoon}}(m),m}}return function(O,T,V){V.p.customParseFormat=!0,O&&O.parseTwoDigitYear&&(c=O.parseTwoDigitYear);var Y=T.prototype,ie=Y.parse;Y.parse=function(N){var A=N.date,H=N.utc,q=N.args;this.$u=H;var de=q[1];if(typeof de=="string"){var ae=q[2]===!0,m=q[3]===!0,B=ae||m,S=q[2];m&&(S=q[2]),l=this.$locale(),!ae&&S&&(l=V.Ls[S]),this.$d=function(F,$,G,re){try{if(["x","X"].indexOf($)>-1)return new Date(($==="X"?1e3:1)*F);var he=v($)(F),fe=he.year,Ae=he.month,we=he.day,I=he.hours,k=he.minutes,K=he.seconds,Q=he.milliseconds,z=he.zone,W=he.week,le=new Date,oe=we||(fe||Ae?1:le.getDate()),j=fe||le.getFullYear(),te=0;fe&&!Ae||(te=Ae>0?Ae-1:le.getMonth());var se,ge=I||0,Oe=k||0,Me=K||0,X=Q||0;return z?new Date(Date.UTC(j,te,oe,ge,Oe,Me,X+60*z.offset*1e3)):G?new Date(Date.UTC(j,te,oe,ge,Oe,Me,X)):(se=new Date(j,te,oe,ge,Oe,Me,X),W&&(se=re(se).week(W).toDate()),se)}catch{return new Date("")}}(A,de,H,V),this.init(),S&&S!==!0&&(this.$L=this.locale(S).$L),B&&A!=this.format(de)&&(this.$d=new Date("")),l={}}else if(de instanceof Array)for(var D=de.length,w=1;w<=D;w+=1){q[1]=de[w-1];var y=V.apply(this,q);if(y.isValid()){this.$d=y.$d,this.$L=y.$L,this.init();break}w===D&&(this.$d=new Date(""))}else ie.call(this,N)}}})}(kr)),kr.exports}var ym=Sm();const Om=It(ym);var $r={exports:{}},wm=$r.exports,ko;function bm(){return ko||(ko=1,function(e,t){(function(n,r){e.exports=r()})(wm,function(){return function(n,r,s){var i=r.prototype,o=function(u){return u&&(u.indexOf?u:u.s)},a=function(u,d,f,E,v){var O=u.name?u:u.$locale(),T=o(O[d]),V=o(O[f]),Y=T||V.map(function(N){return N.slice(0,E)});if(!v)return Y;var ie=O.weekStart;return Y.map(function(N,A){return Y[(A+(ie||0))%7]})},l=function(){return s.Ls[s.locale()]},c=function(u,d){return u.formats[d]||function(f){return f.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(E,v,O){return v||O.slice(1)})}(u.formats[d.toUpperCase()])},h=function(){var u=this;return{months:function(d){return d?d.format("MMMM"):a(u,"months")},monthsShort:function(d){return d?d.format("MMM"):a(u,"monthsShort","months",3)},firstDayOfWeek:function(){return u.$locale().weekStart||0},weekdays:function(d){return d?d.format("dddd"):a(u,"weekdays")},weekdaysMin:function(d){return d?d.format("dd"):a(u,"weekdaysMin","weekdays",2)},weekdaysShort:function(d){return d?d.format("ddd"):a(u,"weekdaysShort","weekdays",3)},longDateFormat:function(d){return c(u.$locale(),d)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};i.localeData=function(){return h.bind(this)()},s.localeData=function(){var u=l();return{firstDayOfWeek:function(){return u.weekStart||0},weekdays:function(){return s.weekdays()},weekdaysShort:function(){return s.weekdaysShort()},weekdaysMin:function(){return s.weekdaysMin()},months:function(){return s.months()},monthsShort:function(){return s.monthsShort()},longDateFormat:function(d){return c(u,d)},meridiem:u.meridiem,ordinal:u.ordinal}},s.months=function(){return a(l(),"months")},s.monthsShort=function(){return a(l(),"monthsShort","months",3)},s.weekdays=function(u){return a(l(),"weekdays",null,null,u)},s.weekdaysShort=function(u){return a(l(),"weekdaysShort","weekdays",3,u)},s.weekdaysMin=function(u){return a(l(),"weekdaysMin","weekdays",2,u)}}})}($r)),$r.exports}var Am=bm();const Tm=It(Am);var jr={exports:{}},Nm=jr.exports,$o;function Mm(){return $o||($o=1,function(e,t){(function(n,r){e.exports=r()})(Nm,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,s,i){var o=s.prototype,a=o.format;i.en.formats=n,o.format=function(l){l===void 0&&(l="YYYY-MM-DDTHH:mm:ssZ");var c=this.$locale().formats,h=function(u,d){return u.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(f,E,v){var O=v&&v.toUpperCase();return E||d[v]||n[v]||d[O].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(T,V,Y){return V||Y.slice(1)})})}(l,c===void 0?{}:c);return a.call(this,h)}}})}(jr)),jr.exports}var Dm=Mm();const xm=It(Dm);var Br={exports:{}},Lm=Br.exports,jo;function Um(){return jo||(jo=1,function(e,t){(function(n,r){e.exports=r()})(Lm,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(i,o,a){var l=o.prototype;a.utc=function(v){var O={date:v,utc:!0,args:arguments};return new o(O)},l.utc=function(v){var O=a(this.toDate(),{locale:this.$L,utc:!0});return v?O.add(this.utcOffset(),n):O},l.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var c=l.parse;l.parse=function(v){v.utc&&(this.$u=!0),this.$utils().u(v.$offset)||(this.$offset=v.$offset),c.call(this,v)};var h=l.init;l.init=function(){if(this.$u){var v=this.$d;this.$y=v.getUTCFullYear(),this.$M=v.getUTCMonth(),this.$D=v.getUTCDate(),this.$W=v.getUTCDay(),this.$H=v.getUTCHours(),this.$m=v.getUTCMinutes(),this.$s=v.getUTCSeconds(),this.$ms=v.getUTCMilliseconds()}else h.call(this)};var u=l.utcOffset;l.utcOffset=function(v,O){var T=this.$utils().u;if(T(v))return this.$u?0:T(this.$offset)?u.call(this):this.$offset;if(typeof v=="string"&&(v=function(N){N===void 0&&(N="");var A=N.match(r);if(!A)return null;var H=(""+A[0]).match(s)||["-",0,0],q=H[0],de=60*+H[1]+ +H[2];return de===0?0:q==="+"?de:-de}(v),v===null))return this;var V=Math.abs(v)<=16?60*v:v,Y=this;if(O)return Y.$offset=V,Y.$u=v===0,Y;if(v!==0){var ie=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(Y=this.local().add(V+ie,n)).$offset=V,Y.$x.$localOffset=ie}else Y=this.utc();return Y};var d=l.format;l.format=function(v){var O=v||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,O)},l.valueOf=function(){var v=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*v},l.isUTC=function(){return!!this.$u},l.toISOString=function(){return this.toDate().toISOString()},l.toString=function(){return this.toDate().toUTCString()};var f=l.toDate;l.toDate=function(v){return v==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():f.call(this)};var E=l.diff;l.diff=function(v,O,T){if(v&&this.$u===v.$u)return E.call(this,v,O,T);var V=this.local(),Y=a(v).local();return E.call(V,Y,O,T)}}})}(Br)),Br.exports}var Pm=Um();const Fm=It(Pm);var Hr={exports:{}},km=Hr.exports,Bo;function $m(){return Bo||(Bo=1,function(e,t){(function(n,r){e.exports=r()})(km,function(){return function(n,r){r.prototype.weekday=function(s){var i=this.$locale().weekStart||0,o=this.$W,a=(o<i?o+7:o)-i;return this.$utils().u(s)?a:this.subtract(a,"day").add(s,"day")}}})}(Hr)),Hr.exports}var jm=$m();const Bm=It(jm);var Wr={exports:{}},Hm=Wr.exports,Ho;function Wm(){return Ho||(Ho=1,function(e,t){(function(n,r){e.exports=r()})(Hm,function(){var n="week",r="year";return function(s,i,o){var a=i.prototype;a.week=function(l){if(l===void 0&&(l=null),l!==null)return this.add(7*(l-this.week()),"day");var c=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var h=o(this).startOf(r).add(1,r).date(c),u=o(this).endOf(n);if(h.isBefore(u))return 1}var d=o(this).startOf(r).date(c).startOf(n).subtract(1,"millisecond"),f=this.diff(d,n,!0);return f<0?o(this).startOf("week").week():Math.ceil(f)},a.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}})}(Wr)),Wr.exports}var Ym=Wm();const zm=It(Ym);var Yr={exports:{}},Vm=Yr.exports,Wo;function Gm(){return Wo||(Wo=1,function(e,t){(function(n,r){e.exports=r()})(Vm,function(){return function(n,r){r.prototype.weekYear=function(){var s=this.month(),i=this.week(),o=this.year();return i===1&&s===11?o+1:s===0&&i>=52?o-1:o}}})}(Yr)),Yr.exports}var Km=Gm();const Xm=It(Km);Bt.extend(Om);Bt.extend(Rm);Bt.extend(Bm);Bt.extend(Tm);Bt.extend(zm);Bt.extend(Xm);Bt.extend(Fm);Bt.extend(xm);function fs(e,t,n,r){if(e>t)throw new Error("a1 should be less than a2");if(n>r)throw new Error("b1 should be less than b2");if(t<n||r<e)return[e,t];if(n<=e&&r>=t)return[];const s=r-n+1;return e<n&&t>r?[e,t-s]:n<=e&&r<t?[r+1-s,t-s]:n>e&&r>=t?[e,n-1]:[e,t]}function Qm(e){if(e==null)return!1;const t=e.bullet;return(t==null?void 0:t.listId)!=null}function Jm(e){if(e==null)return!1;const t=e.paragraphStyle;return ql(t)}function ql(e){var t;return!(e==null||(e.indentStart==null||e.indentStart.v===0)&&e.hanging==null||((t=e.hanging)==null?void 0:t.v)===0)}function Zl(e,t,n){return e.slice(0,t)+n+e.slice(t)}function eu(e,t,n){return t>n?e:e.slice(0,t)+e.slice(n)}const qm=/\s/g;function Zm(e){return e===null||e.toString().replace(qm,"")===""||typeof e=="boolean"?!1:!isNaN(e)}function e_(e){let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+(t<<6)+(t<<16)-t;return t>>>0}const Ge=Symbol("newer"),rt=Symbol("older");class t_{constructor(t){C(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Ge],{done:!1,value:t.key}):{done:!0,value:void 0}}}class n_{constructor(t){C(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Ge],{done:!1,value:t.value}):{done:!0,value:void 0}}}class r_{constructor(t){C(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Ge],{done:!1,value:[t.key,t.value]}):{done:!0,value:void 0}}}var Ia,Sa;Sa=Ge,Ia=rt;class Yo{constructor(t,n){C(this,"key");C(this,"value");C(this,Sa);C(this,Ia);this.key=t,this.value=n,this[Ge]=void 0,this[rt]=void 0}toJSON(){return{key:this.key,value:this.value}}}class er{constructor(...t){C(this,"_keymap");C(this,"size",0);C(this,"limit");C(this,"oldest");C(this,"newest");C(this,"_onShiftListeners",[]);if(Bn.hasLength(t,1)){if(Bn.isNumber(t[0])){const n=t[0];this._initialize(n,void 0);return}if(Bn.isIterable(t[0])){const n=t[0];this._initialize(0,n);return}return}if(Bn.hasLength(t,2)){const n=t[0],r=t[1];this._initialize(n,r)}}onShift(t){if(this._onShiftListeners.indexOf(t)===-1)return this._onShiftListeners.push(t),Xe(()=>or(this._onShiftListeners,t));throw new Error("[LRUMap]: the listener has been registered!")}_initialize(t,n){this.oldest=void 0,this.newest=void 0,this.size=0,this.limit=t,this._keymap=new Map,n&&(this.assign(n),t<1&&(this.limit=this.size))}_markEntryAsUsed(t){t!==this.newest&&(t[Ge]&&(t===this.oldest&&(this.oldest=t[Ge]),t[Ge][rt]=t[rt]),t[rt]&&(t[rt][Ge]=t[Ge]),t[Ge]=void 0,t[rt]=this.newest,this.newest&&(this.newest[Ge]=t),this.newest=t)}assign(t){let n,r=this.limit||Number.MAX_VALUE;this._keymap.clear();const s=t[Symbol.iterator]();for(let i=s.next();!i.done;i=s.next()){const o=new Yo(i.value[0],i.value[1]);if(this._keymap.set(o.key,o),n?(n[Ge]=o,o[rt]=n):this.oldest=o,n=o,r--===0)throw new Error("overflow")}this.newest=n,this.size=this._keymap.size}set(t,n){let r=this._keymap.get(t);return r?(r.value=n,this._markEntryAsUsed(r),this):(this._keymap.set(t,r=new Yo(t,n)),this.newest?(this.newest[Ge]=r,r[rt]=this.newest):this.oldest=r,this.newest=r,++this.size,this.size>this.limit&&this.shift(),this)}shift(){const t=this.oldest;if(t)return this.oldest&&this.oldest[Ge]?(this.oldest=this.oldest[Ge],this.oldest[rt]=void 0):(this.oldest=void 0,this.newest=void 0),t[Ge]=t[rt]=void 0,this._keymap.delete(t.key),--this.size,this._onShiftListeners.forEach(n=>n(t)),[t.key,t.value]}get(t){const n=this._keymap.get(t);if(n)return this._markEntryAsUsed(n),n.value}has(t){return this._keymap.has(t)}find(t){const n=this._keymap.get(t);return n?n.value:void 0}delete(t){const n=this._keymap.get(t);if(n)return this._keymap.delete(n.key),n[Ge]&&n[rt]?(n[rt][Ge]=n[Ge],n[Ge][rt]=n[rt]):n[Ge]?(n[Ge][rt]=void 0,this.oldest=n[Ge]):n[rt]?(n[rt][Ge]=void 0,this.newest=n[rt]):this.oldest=this.newest=void 0,this.size--,n.value}clear(){this.oldest=void 0,this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new t_(this.oldest)}values(){return new n_(this.oldest)}entries(){return this[Symbol.iterator]()}[Symbol.iterator](){return new r_(this.oldest)}forEach(t,n){typeof n!="object"&&(n=this);let r=this.oldest;for(;r;)t.call(n,r.value,r.key,this),r=r[Ge]}toJSON(){const t=new Array(this.size);let n=0,r=this.oldest;for(;r;)t[n++]={key:r.key,value:r.value},r=r[Ge];return t}toString(){let t="",n=this.oldest;for(;n;)t+=`${String(n.key)}:${n.value}`,n=n[Ge],n&&(t+=" < ");return t}}class Bn{static hasLength(t,n){return t.length===n}static getValueType(t){return Object.prototype.toString.apply(t)}static isObject(t){return this.getValueType(t)==="[object Object]"}static isIterable(t){return t[Symbol.iterator]!=null}static isNumber(t){return this.getValueType(t)==="[object Number]"}}var zr={exports:{}},s_=zr.exports,zo;function i_(){return zo||(zo=1,function(e,t){(function(n,r){e.exports=r()})(typeof self<"u"?self:s_,function(){return function(){var n={d:function(_,g){for(var p in g)n.o(g,p)&&!n.o(_,p)&&Object.defineProperty(_,p,{enumerable:!0,get:g[p]})},o:function(_,g){return Object.prototype.hasOwnProperty.call(_,g)}},r={};n.d(r,{default:function(){return ht}});var s={1078:"af",1052:"sq",1118:"am",5121:"ar_DZ",15361:"ar_BH",3073:"ar_EG",2049:"ar_IQ",11265:"ar_JO",13313:"ar_KW",12289:"ar_LB",4097:"ar_LY",6145:"ar_MA",8193:"ar_OM",16385:"ar_QA",1025:"ar_SA",10241:"ar_SY",7169:"ar_TN",14337:"ar_AE",9217:"ar_YE",1067:"hy",1101:"as",2092:"az_AZ",1068:"az_AZ",1069:"eu",1059:"be",2117:"bn",1093:"bn_IN",5146:"bs",1026:"bg",1109:"my",1027:"ca",2052:"zh_CN",3076:"zh_HK",5124:"zh_MO",4100:"zh_SG",1028:"zh_TW",1050:"hr",1029:"cs",1030:"da",1125:"dv",2067:"nl_BE",1043:"nl_NL",1126:"bin",3081:"en_AU",10249:"en_BZ",4105:"en_CA",9225:"en_CB",2057:"en_GB",16393:"en_IN",6153:"en_IE",8201:"en_JM",5129:"en_NZ",13321:"en_PH",7177:"en_ZA",11273:"en_TT",1033:"en_US",12297:"en_ZW",1061:"et",1071:"mk",1080:"fo",1065:"fa",1124:"fil",1035:"fi",2060:"fr_BE",11276:"fr_CM",3084:"fr_CA",9228:"fr_CG",12300:"fr_CI",1036:"fr_FR",5132:"fr_LU",13324:"fr_ML",6156:"fr_MC",14348:"fr_MA",10252:"fr_SN",4108:"fr_CH",7180:"fr",1122:"fy_NL",2108:"gd_IE",1084:"gd",1110:"gl",1079:"ka",3079:"de_AT",1031:"de_DE",5127:"de_LI",4103:"de_LU",2055:"de_CH",1032:"el",1140:"gn",1095:"gu",1279:"en",1037:"he",1081:"hi",1038:"hu",1039:"is",1136:"ig_NG",1057:"id",1040:"it_IT",2064:"it_CH",1041:"ja",1099:"kn",1120:"ks",1087:"kk",1107:"km",1111:"kok",1042:"ko",1088:"ky",1108:"lo",1142:"la",1062:"lv",1063:"lt",2110:"ms_BN",1086:"ms_MY",1100:"ml",1082:"mt",1112:"mni",1153:"mi",1102:"mr",1104:"mn",2128:"mn",1121:"ne",1044:"no_NO",2068:"no_NO",1096:"or",1045:"pl",1046:"pt_BR",2070:"pt_PT",1094:"pa",1047:"rm",2072:"ro_MO",1048:"ro_RO",1049:"ru",2073:"ru_MO",1083:"se",1103:"sa",3098:"sr_SP",2074:"sr_SP",1072:"st",1074:"tn",1113:"sd",1115:"si",1051:"sk",1060:"sl",1143:"so",1070:"sb",11274:"es_AR",16394:"es_BO",13322:"es_CL",9226:"es_CO",5130:"es_CR",7178:"es_DO",12298:"es_EC",17418:"es_SV",4106:"es_GT",18442:"es_HN",2058:"es_MX",19466:"es_NI",6154:"es_PA",15370:"es_PY",10250:"es_PE",20490:"es_PR",1034:"es_ES",14346:"es_UY",8202:"es_VE",1089:"sw",2077:"sv_FI",1053:"sv_SE",1114:"syc",1064:"tg",1097:"ta",1092:"tt",1098:"te",1054:"th",1105:"bo",1073:"ts",1055:"tr",1090:"tk",1058:"uk",1056:"ur",2115:"uz_UZ",1091:"uz_UZ",1075:"ve",1066:"vi",1106:"cy",1076:"xh",1085:"yi",1077:"zu"};const i=/^([a-z\d]+)(?:[_-]([a-z\d]+))?(?:\.([a-z\d]+))?(?:@([a-z\d]+))?$/i,o={},a={group:" ",decimal:".",positive:"+",negative:"-",percent:"%",exponent:"E",nan:"NaN",infinity:"∞",ampm:["AM","PM"],mmmm6:["Muharram","Safar","Rabiʻ I","Rabiʻ II","Jumada I","Jumada II","Rajab","Shaʻban","Ramadan","Shawwal","Dhuʻl-Qiʻdah","Dhuʻl-Hijjah"],mmm6:["Muh.","Saf.","Rab. I","Rab. II","Jum. I","Jum. II","Raj.","Sha.","Ram.","Shaw.","Dhuʻl-Q.","Dhuʻl-H."],mmmm:["January","February","March","April","May","June","July","August","September","October","November","December"],mmm:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dddd:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ddd:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]};function l(_){const g=i.exec(_);if(!g)throw new SyntaxError("Malformed locale: ".concat(_));return{lang:g[1]+(g[2]?"_"+g[2]:""),language:g[1],territory:g[2]||"",codeset:g[3]||"",modifier:g[4]||""}}function c(_){if(typeof _=="number")return s[65535&_]||null;const g=parseInt(_,16);return isFinite(g)&&s[65535&g]?s[65535&g]||null:i.test(_)?_:null}function h(_){const g=c(_);let p=null;if(g){const b=l(g);p=o[b.lang]||o[b.language]||null}return p}function u(_){return Object.assign({},a,_)}function d(_,g){const p=typeof g=="object"?g:l(g);return o[p.lang]=u(_),p.language===p.lang||o[p.language]||(o[p.language]=u(_)),o[p.lang]}const f=u({group:","});function E(_,g){if(typeof _!="number")return _;if(_<0)return-E(-_,g);if(g){const p=10**(g||0)||1;return E(_*p,0)/p}return Math.round(_)}f.isDefault=!0,d({group:",",ampm:["上午","下午"],mmmm:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],mmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],ddd:["周日","周一","周二","周三","周四","周五","周六"]},"zh_CN"),d({group:",",nan:"非數值",ampm:["上午","下午"],mmmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],mmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],ddd:["週日","週一","週二","週三","週四","週五","週六"]},"zh_TW"),d({group:",",ampm:["午前","午後"],mmmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],mmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],ddd:["日","月","火","水","木","金","土"]},"ja"),d({group:",",ampm:["오전","오후"],mmmm:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],mmm:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],dddd:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],ddd:["일","월","화","수","목","금","토"]},"ko"),d({group:",",ampm:["ก่อนเที่ยง","หลังเที่ยง"],mmmm:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],mmm:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],dddd:["วันอาทิตย์","วันจันทร์","วันอังคาร","วันพุธ","วันพฤหัสบดี","วันศุกร์","วันเสาร์"],ddd:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."]},"th"),d({decimal:",",ampm:["dop.","odp."],mmmm:["ledna","února","března","dubna","května","června","července","srpna","září","října","listopadu","prosince"],mmm:["led","úno","bře","dub","kvě","čvn","čvc","srp","zář","říj","lis","pro"],dddd:["neděle","pondělí","úterý","středa","čtvrtek","pátek","sobota"],ddd:["ne","po","út","st","čt","pá","so"]},"cs"),d({group:".",decimal:",",mmmm:["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december"],mmm:["jan.","feb.","mar.","apr.","maj","jun.","jul.","aug.","sep.","okt.","nov.","dec."],dddd:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],ddd:["søn.","man.","tir.","ons.","tor.","fre.","lør."]},"da"),d({group:".",decimal:",",ampm:["a.m.","p.m."],mmmm:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],mmm:["jan.","feb.","mrt.","apr.","mei","jun.","jul.","aug.","sep.","okt.","nov.","dec."],dddd:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],ddd:["zo","ma","di","wo","do","vr","za"]},"nl"),d({group:","},"en"),d({decimal:",",nan:"epäluku",ampm:["ap.","ip."],mmmm:["tammikuuta","helmikuuta","maaliskuuta","huhtikuuta","toukokuuta","kesäkuuta","heinäkuuta","elokuuta","syyskuuta","lokakuuta","marraskuuta","joulukuuta"],mmm:["tammik.","helmik.","maalisk.","huhtik.","toukok.","kesäk.","heinäk.","elok.","syysk.","lokak.","marrask.","jouluk."],dddd:["sunnuntaina","maanantaina","tiistaina","keskiviikkona","torstaina","perjantaina","lauantaina"],ddd:["su","ma","ti","ke","to","pe","la"]},"fi"),d({group:" ",decimal:",",mmmm:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],mmm:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],dddd:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],ddd:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."]},"fr"),d({group:".",decimal:",",mmmm:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],mmm:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sept.","Okt.","Nov.","Dez."],dddd:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],ddd:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."]},"de"),d({group:".",decimal:",",ampm:["π.μ.","μ.μ."],mmmm:["Ιανουαρίου","Φεβρουαρίου","Μαρτίου","Απριλίου","Μαΐου","Ιουνίου","Ιουλίου","Αυγούστου","Σεπτεμβρίου","Οκτωβρίου","Νοεμβρίου","Δεκεμβρίου"],mmm:["Ιαν","Φεβ","Μαρ","Απρ","Μαΐ","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"],dddd:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"],ddd:["Κυρ","Δευ","Τρί","Τετ","Πέμ","Παρ","Σάβ"]},"el"),d({decimal:",",ampm:["de.","du."],mmmm:["január","február","március","április","május","június","július","augusztus","szeptember","október","november","december"],mmm:["jan.","febr.","márc.","ápr.","máj.","jún.","júl.","aug.","szept.","okt.","nov.","dec."],dddd:["vasárnap","hétfő","kedd","szerda","csütörtök","péntek","szombat"],ddd:["V","H","K","Sze","Cs","P","Szo"]},"hu"),d({group:".",decimal:",",ampm:["f.h.","e.h."],mmmm:["janúar","febrúar","mars","apríl","maí","júní","júlí","ágúst","september","október","nóvember","desember"],mmm:["jan.","feb.","mar.","apr.","maí","jún.","júl.","ágú.","sep.","okt.","nóv.","des."],dddd:["sunnudagur","mánudagur","þriðjudagur","miðvikudagur","fimmtudagur","föstudagur","laugardagur"],ddd:["sun.","mán.","þri.","mið.","fim.","fös.","lau."]},"is"),d({group:".",decimal:",",mmmm:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],mmm:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agu","Sep","Okt","Nov","Des"],dddd:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"],ddd:["Min","Sen","Sel","Rab","Kam","Jum","Sab"]},"id"),d({group:".",decimal:",",mmmm:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],mmm:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],dddd:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],ddd:["dom","lun","mar","mer","gio","ven","sab"]},"it"),d({decimal:",",ampm:["a.m.","p.m."],mmmm:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],mmm:["jan.","feb.","mar.","apr.","mai","jun.","jul.","aug.","sep.","okt.","nov.","des."],dddd:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],ddd:["søn.","man.","tir.","ons.","tor.","fre.","lør."]},"nb"),d({decimal:",",mmmm:["stycznia","lutego","marca","kwietnia","maja","czerwca","lipca","sierpnia","września","października","listopada","grudnia"],mmm:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","paź","lis","gru"],dddd:["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"],ddd:["niedz.","pon.","wt.","śr.","czw.","pt.","sob."]},"pl"),d({group:".",decimal:",",mmmm:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],mmm:["jan.","fev.","mar.","abr.","mai.","jun.","jul.","ago.","set.","out.","nov.","dez."],dddd:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"],ddd:["dom.","seg.","ter.","qua.","qui.","sex.","sáb."]},"pt"),d({decimal:",",nan:"не число",mmmm:["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"],mmm:["янв.","февр.","мар.","апр.","мая","июн.","июл.","авг.","сент.","окт.","нояб.","дек."],dddd:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],ddd:["вс","пн","вт","ср","чт","пт","сб"]},"ru"),d({decimal:",",mmmm:["januára","februára","marca","apríla","mája","júna","júla","augusta","septembra","októbra","novembra","decembra"],mmm:["jan","feb","mar","apr","máj","jún","júl","aug","sep","okt","nov","dec"],dddd:["nedeľa","pondelok","utorok","streda","štvrtok","piatok","sobota"],ddd:["ne","po","ut","st","št","pi","so"]},"sk"),d({group:".",decimal:",",ampm:["a. m.","p. m."],mmmm:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],mmm:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sept.","oct.","nov.","dic."],dddd:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],ddd:["dom.","lun.","mar.","mié.","jue.","vie.","sáb."]},"es"),d({decimal:",",ampm:["fm","em"],mmmm:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],mmm:["jan.","feb.","mars","apr.","maj","juni","juli","aug.","sep.","okt.","nov.","dec."],dddd:["söndag","måndag","tisdag","onsdag","torsdag","fredag","lördag"],ddd:["sön","mån","tis","ons","tors","fre","lör"]},"sv"),d({group:".",decimal:",",ampm:["ÖÖ","ÖS"],mmmm:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],mmm:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],dddd:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],ddd:["Paz","Pzt","Sal","Çar","Per","Cum","Cmt"]},"tr");function v(_,g,p){const b=_<0?-1:1,M=10**(g||2),U=10**(p||2);let L,P,R=Math.abs(_),Z=0,_e=0,J=0,pe=1;if((_=R)%1==0)P=[_*b,1];else if(_<1e-19)P=[b,1e19];else if(_>1e19)P=[1e19*b,1];else{do if(R=1/(R-Math.floor(R)),L=pe,pe=pe*Math.floor(R)+Z,Z=L,_e=J,J=Math.floor(_*pe+.5),J>=M||pe>=U)return[b*_e,Z];while(Math.abs(_-J/pe)>=1e-10&&R!==Math.floor(R));P=[b*J,pe]}return P}const O={overflow:"######",dateErrorThrows:!1,dateErrorNumber:!0,dateSpanLarge:!0,leap1900:!0,nbsp:!0,throws:!0,invalid:"######",locale:"",ignoreTimezone:!1},T=Object.assign({},O);function V(_){if(_===null&&(_=O),_){for(const g in _)if(g in O){const p=_[g];T[g]=p==null?O[g]:p}}return{...T}}const Y={"#":"",0:"0","?":" "},ie={"@":"text","-":"minus","+":"plus"},N=["#000","#FFF","#F00","#0F0","#00F","#FF0","#F0F","#0FF","#000","#FFF","#F00","#0F0","#00F","#FF0","#F0F","#0FF","#800","#080","#008","#880","#808","#088","#CCC","#888","#99F","#936","#FFC","#CFF","#606","#F88","#06C","#CCF","#008","#F0F","#FF0","#0FF","#808","#800","#088","#00F","#0CF","#CFF","#CFC","#FF9","#9CF","#F9C","#C9F","#FC9","#36F","#3CC","#9C0","#FC0"],A=["¤","$","£","¥","֏","؋","৳","฿","៛","₡","₦","₩","₪","₫","€","₭","₮","₱","₲","₴","₸","₹","₺","₼","₽","₾","₿"],H=new RegExp("["+A.join("")+"]");function q(_,g,p){return g[p+"_max"]=_.length,g[p+"_min"]=_.replace(/#/g,"").length,g}const de={};function ae(_){if(!(_ in de)){const g=[],p=_.replace(/^[#,]+/,"").replace(/[1-9]\d*/g,b=>"?".repeat(b.length));for(let b=0;b<p.length;b++){const M=p.charAt(b);g[b]=M in Y?Y[M]:M}de[_]=g.join("")}return de[_]}function m(_,g){typeof _=="string"&&(_={type:"string",value:_=_.replace(/ /g,Y["?"])}),g.push(_)}function B(_){const g=[],p={scale:1,percent:!1,text:!1,date:0,date_eval:!1,date_system:1,sec_decimals:0,general:!1,clock:24,int_pattern:[],frac_pattern:[],man_pattern:[],den_pattern:[],num_pattern:[],tokens:g};let b=_+"",M="int",U=!1,L=null;const P=[];let R,Z,_e=!1;for(;b&&!U;){if(R=/^General/i.exec(b))p.general=!0,m({type:"general"},g);else if(M==="int"&&(R=/^[#?0]+(?:,[#?0]+)*/.exec(b))||M==="den"&&(R=/^[#?\d]+/.exec(b))||(R=/^[#?0]+/.exec(b)))p[M+"_pattern"].push(R[0]),L={type:M,num:R[0]},m(L,g);else if((R=/^\//.exec(b))&&p[M+"_pattern"].length){if(!L)throw new SyntaxError("Missing a numerator in pattern ".concat(_));p.fractions=!0,p.num_pattern.push(p[M+"_pattern"].pop()),L.type="num",M="den",m({type:"div"},g)}else if(R=/^,+/.exec(b)){const x=b.charAt(1)in Y;Z.slice(-1)in Y&&(R[0].length>1||!x)?p.scale=.001**R[0].length:p.dec_fractions||m(R[0],g)}else{if(R=/^;/.exec(b)){U=!0;break}if(R=/^[@+-]/.exec(b))R[0]==="@"&&(p.text=!0),m({type:ie[R[0]]},g);else if(R=/^(?:\[(h+|m+|s+)\])/i.exec(b)){const x=R[1].toLowerCase(),ee=x[0],ve={type:"",size:0,date:1,raw:R[0],pad:x.length};ee==="h"?(ve.size=16,ve.type="hour-elap"):ee==="m"?(ve.size=32,ve.type="min-elap"):(ve.size=64,ve.type="sec-elap"),p.date=p.date|ve.size,P.push(ve),m(ve,g)}else if(R=/^(?:B2)/i.exec(b))_e||(p.date_system=6);else if(R=/^(?:B1)/i.exec(b))_e||(p.date_system=1);else if(R=/^(?:([hHmMsSyYbBdDegG])\1*)/.exec(b)){const x={type:"",size:0,date:1,raw:R[0]},ee=R[0].toLowerCase(),ve=ee[0];if(ee==="y"||ee==="yy")x.size=2,x.type="year-short";else if(ve==="y"||ve==="e")x.size=2,x.type="year";else if(ee==="b"||ee==="bb")x.size=2,x.type="b-year-short";else if(ve==="b")x.size=2,x.type="b-year";else if(ee==="d"||ee==="dd")x.size=8,x.type="day",x.pad=/dd/.test(ee);else if(ee==="ddd")x.size=8,x.type="weekday-short";else if(ve==="d")x.size=8,x.type="weekday";else if(ve==="h")x.size=16,x.type="hour",x.pad=/hh/i.test(ee);else if(ve==="m"){ee.length===3?(x.size=4,x.type="monthname-short"):ee.length===5?(x.size=4,x.type="monthname-single"):ee.length>=4&&(x.size=4,x.type="monthname");const be=P[P.length-1];!x.type&&be&&!be.used&&80&be.size&&(be.used=!0,x.size=32,x.type="min",x.pad=/mm/.test(ee)),x.type||(x.size=4,x.type="month",x.pad=/mm/.test(ee),x.indeterminate=!0)}else if(ve==="s"){x.size=64,x.type="sec",x.pad=/ss/.test(ee);const be=P[P.length-1];be&&32&be.size?x.used=!0:be&&be.indeterminate&&(delete be.indeterminate,be.size=32,be.type="min",x.used=!0)}p.date=p.date|x.size,p.date_eval=!0,P.push(x),m(x,g)}else if(R=/^(?:AM\/PM|am\/pm|A\/P)/.exec(b))p.clock=12,p.date=16|p.date,p.date_eval=!0,m({type:"am",short:R[0]==="A/P"},g);else if(p.date&&(R=/^\.0{1,3}/i.exec(b))){const x=R[0].length-1,ee=[64,128,256,512][x];p.date=p.date|ee,p.date_eval=!0,p.sec_decimals=Math.max(p.sec_decimals,x),m({type:"subsec",size:ee,decimals:x,date:1,raw:R[0]},g)}else if((R=/^\\(.)/.exec(b))||(R=/^"([^"]*?)"/.exec(b)))m(R[1],g);else if(R=/^\[(<[=>]?|>=?|=)\s*(-?[.\d]+)\]/.exec(b))p.condition=[R[1],parseFloat(R[2],10)];else if(R=/^\[\$([^\]]+)\]/.exec(b)){const x=R[1].split("-"),ee=x.length<2?"":x[x.length-1],ve=x[0];ve&&m(ve,g);const be=c(ee);be&&(p.locale=be);const Ue=parseInt(ee,16);isFinite(Ue)&&16711680&Ue&&(Ue>>16&255)===6&&(p.date_system=6),_e=!0}else if(R=/^\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*(\d+))\]/i.exec(b))p.color=R[2]?N[parseInt(R[2],10)]||"#000":R[1].toLowerCase();else if(!(R=/^\[(DBNum1|ENG|HIJ|JPN|TWN)\]/i.exec(b))){if(R=/^%/.exec(b))p.scale=100,p.percent=!0,m("%",g);else if(R=/^_(\\.|.)/.exec(b))m(" ",g);else if(R=/^\./.exec(b))m({type:"point",value:R[0]},g),p.dec_fractions=!0,M="frac";else if(R=/^[Ee]([+-]?|(?=[0#?]))/.exec(b))p.exponential=!0,p.exp_plus=R[1]==="+",M="man",m({type:"exp",plus:R[1]==="+"},g);else if(!(R=/^\*(\\.|.)/.exec(b))){if(R=/^[BENn[]/.exec(b))throw new SyntaxError("Unexpected char ".concat(b.charAt(0)," in pattern ").concat(_));b[0]==="("&&(p.parens=!0),R=[b[0]],m(R[0],g)}}}Z=R[0],b=b.slice(R?R[0].length:1)}if(p.pattern=_.slice(0,_.length-b.length),/^((?:\[[^\]]+\])+)(;|$)/.test(p.pattern)&&!/^\[(?:h+|m+|s+)\]/.test(p.pattern)&&m({type:"text"},g),p.fractions&&p.dec_fractions||p.fractions&&p.exponential)throw new SyntaxError("Invalid pattern: ".concat(p.pattern));const J=p.int_pattern.join("");if(p.grouping=J.indexOf(",")>=0,p.grouping){const x=J.split(","),ee=x.length;ee===2?(p.group_pri=x[1].length,p.group_sec=p.group_pri):ee>2&&(p.group_pri=x[ee-1].length,p.group_sec=x[ee-2].length)}else p.group_pri=0,p.group_sec=0;q(J.replace(/[,]/g,""),p,"int"),q(p.frac_pattern.join(""),p,"frac"),q(p.man_pattern.join(""),p,"man");let pe=p.num_pattern.join(""),Se=p.den_pattern.join("");const ue=/\?/.test(Se)||/\?/.test(pe);return Se=Se.replace(/\d/g,ue?"?":"#"),ue&&(Se=Se.replace(/#$/g,"?")),q(pe,p,"num"),q(Se,p,"den"),ue&&(pe=pe.replace(/#$/g,"?")),p.int_padding=ae(p.int_pattern.join("")),p.man_padding=ae(p.man_pattern.join("")),p.num_padding=ae(pe),p.den_padding=ae(Se),p.den_pattern.length&&(p.denominator=parseInt(p.den_pattern.join("").replace(/\D/g,""),10)),p.integer=!!p.int_pattern.join("").length,p.fractions&&g.forEach((x,ee)=>{const ve=g[ee+1];x.type==="string"&&ve&&(ve.type==="num"?x.rule="num+int":ve.type==="div"?x.rule="num":ve.type==="den"&&(x.rule="den"))}),p}const S=_=>{const g=_.condition;g&&g[1]<0&&(g[0]==="<"||g[0]==="<="||g[0]==="=")||_.tokens.unshift({type:"minus",volatile:!0})};function D(_){const g=[];let p,b=!1,M=null,U=_,L=0,P=!1,R=0,Z=0;do{if(P=B(U),(P.date||P.general)&&(P.int_pattern.length||P.frac_pattern.length||P.scale!==1||P.text))throw new Error("Illegal format");if(P.condition&&(Z++,b=!0),P.text){if(M)throw new Error("Unexpected partition");M=P}P.locale&&(p=c(P.locale)),g.push(P),L=U.charAt(P.pattern.length)===";"?1:0,U=U.slice(P.pattern.length+L),R++}while(L&&R<4&&Z<3);if(L)throw new Error("Unexpected partition");if(Z>2)throw new Error("Unexpected condition");const _e=g[3];if(_e&&(_e.int_pattern.length||_e.frac_pattern.length||_e.date))throw new Error("Unexpected partition");if(b){const J=g.length;if(J===1&&(g[1]=B("General"),g[1].generated=!0),J<3){const pe=g[0],Se=g[1];if(S(pe),Se.condition)S(Se);else{const ue=pe.condition;(ue[0]==="="||ue[1]>=0&&(ue[0]===">"||ue[0]===">="))&&Se.tokens.unshift({type:"minus",volatile:!0})}}else g.forEach(S)}else{if(g.length<4&&M)for(let J=0,pe=g.length;J<pe;J++)g[J]===M&&g.splice(J,1);if(g.length<1&&M&&(g[0]=B("General"),g[0].generated=!0),g.length<2){const J=B(g[0].pattern);J.tokens.unshift({type:"minus",volatile:!0}),J.generated=!0,g.push(J)}if(g.length<3){const J=B(g[0].pattern);J.generated=!0,g.push(J)}if(g.length<4)if(M)g.push(M);else{const J=B("@");J.generated=!0,g.push(J)}g[0].condition=[">",0],g[1].condition=["<",0],g[2].condition=null}return{pattern:_,partitions:g,locale:p}}const w=Math.floor;function y(_){if((!(arguments.length>1&&arguments[1]!==void 0)||arguments[1])&&_>=0){if(_===0)return[1900,1,0];if(_===60)return[1900,2,29];if(_<60)return[1900,_<32?1:2,(_-1)%31+1]}let p=_+68569+2415019;const b=w(4*p/146097);p-=w((146097*b+3)/4);const M=w(4e3*(p+1)/1461001);p=p-w(1461*M/4)+31;const U=w(80*p/2447),L=p-w(2447*U/80);p=w(U/11);const P=U+2-12*p;return[0|100*(b-49)+M+p,0|P,0|L]}function F(_){return y(_+1462)}function $(_){if(_===60)throw new Error("#VALUE!");if(_<=1)return[1317,8,29];if(_<60)return[1317,_<32?9:10,1+(_-2)%30];const g=10631/30,p=.1335;let b=_+466935;const M=w(b/10631);b-=10631*M;const U=w((b-p)/g);b-=w(U*g+p);const L=w((b+28.5001)/29.5);return L===13?[30*M+U,12,30]:[30*M+U,L,b-w(29.5001*L-29)]}function G(_){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];const b=w(_);return g===6?$(b):g===-1?F(b):y(b,p)}const re=Math.floor,he=86400;function fe(_,g){let p=null;if(Array.isArray(_)){const[b,M,U,L,P,R]=_;p=Date.UTC(b,M==null?0:M-1,U!=null?U:1,L||0,P||0,R||0)}else if(_ instanceof Date&&(p=1*_,!g||!g.ignoreTimezone)){const b=new Date;b.setUTCFullYear(_.getFullYear(),_.getMonth(),_.getDate()),b.setUTCHours(_.getHours(),_.getMinutes(),_.getSeconds(),_.getMilliseconds()),p=1*b}if(p!=null&&isFinite(p)){const b=p/864e5;return b-(b<=-25509?-25568:-25569)}return _}function Ae(_,g){let p=0|_;const b=he*(_-p);let M=re(b);b-M>.9999&&(M+=1,M===he&&(M=0,p+=1));const U=M<0?he+M:M,[L,P,R]=G(_,0,g&&g.leap1900),Z=re(U/60/60)%60,_e=re(U/60)%60,J=re(U)%60;if(g&&g.nativeDate){const pe=new Date(0);return pe.setUTCFullYear(L,P-1,R),pe.setUTCHours(Z,_e,J),pe}return[L,P,R,Z,_e,J]}function we(_){return!!(_[0]&&_[0].percent||_[1]&&_[1].percent||_[2]&&_[2].percent||_[3]&&_[3].percent)}function I(_){return!!(_[0]&&_[0].date||_[1]&&_[1].date||_[2]&&_[2].date||_[3]&&_[3].date)}function k(_){const[g,p,b,M]=_;return!(g&&!g.generated||p&&!p.generated||b&&!b.generated||!M||!M.text||M.generated)}const K={text:15,datetime:10.8,date:10.8,time:10.8,percent:10.6,currency:10.4,grouped:10.2,scientific:6,number:4,fraction:2,general:0,error:0},Q=[["DMY",1],["DM",2],["MY",3],["MDY",4],["MD",5],["hmsa",6],["hma",7],["hms",8],["hm",9]],z={total:1,sign:0,period:0,int:1,frac:0},W=(_,g)=>_.replace(/\./,g.decimal);function le(_,g,p,b){const M=0|p;if(typeof p=="string")_.push(p);else if(p===M)_.push(Math.abs(M));else{const U=Math.abs(p);let L=U?Math.floor(Math.log10(U)):0,P=L<0?U*10**-L:U/10**L;P===10&&(P=1,L++);const R=function(_e){let J=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];const pe=Math.abs(_e);if(!pe)return z;const Se=J&&_e<0?1:0,ue=Math.floor(pe),x=Math.floor(Math.log10(pe)+1);let ee=0,ve=0;if(ue!==pe){ee=1;const be=String(E(x<0?pe*10**-x:pe/10**x,15));let Ue=be.length,Fe=!0,He=0;for(;He<=be.length;){if(be[He]==="."){Ue--;break}be[He]==="0"&&Fe?Ue--:Fe=!1,He++}ve=Ue-x,ve<0&&(ve=0,ee=0)}return{total:Se+Math.max(x,1)+ee+ve,digits:Math.max(x,0)+ve,sign:Se,period:ee,int:Math.max(x,1),frac:ve}}(U),Z=()=>{const _e=Math.abs(L);let J;J=P===1?P:E(P,5),_.push(W(J+"",b),b.exponent,L<0?b.negative:b.positive,_e<10?"0":"",_e)};if(L>=-4&&L<=-1){const _e=U.toPrecision(10+L).replace(/\.?0+$/,"");_.push(W(_e,b))}else if(L===10){const _e=U.toFixed(10).slice(0,12).replace(/\.$/,"");_.push(W(_e,b))}else if(Math.abs(L)<=9)if(R.total<=11){const _e=E(U,9).toFixed(R.frac);_.push(W(_e,b))}else L===9?_.push(Math.floor(U)):L>=0&&L<9?_.push(E(U,9-L)):Z();else R.total>=12?Z():Math.floor(U)===U?_.push(Math.floor(U)):_.push(W(E(U,9).toFixed(R.frac),b))}return _}const oe=86400,j={int:"integer",frac:"fraction",man:"mantissa",num:"numerator",den:"denominator"},te=function(_){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const p=Math.floor(Math.log10(_));return g>1?Math.floor(p/g)*g:p};function se(_,g,p,b){let M="",U="",L="",P="",R="",Z=0,_e=0|_,J=0,pe=0,Se=1,ue=0,x=0,ee=0,ve=0,be=0,Ue=0;const Fe=b||f;if(!g.text&&isFinite(g.scale)&&g.scale!==1&&(_=function(Re){if(Re===0)return Re;const Ne=Math.ceil(Math.log10(Re<0?-Re:Re)),ne=10**(16-Math.floor(Ne));return Math.round(Re*ne)/ne}(_*g.scale)),g.exponential){let Re=Math.abs(_);if(Re){const Ne=10**-te(Re,g.int_max),ne=E(Re*Ne,g.frac_max)/Ne;Z=te(ne,g.int_max)}Re/=10**Z,_=_<0?-Re:Re,M+=Math.abs(Z)}if(g.integer){const Re=Math.abs(E(_,g.fractions?1:g.frac_max));R+=Re<1?"":Math.floor(Re)}if(g.grouping){let Re="",Ne=R.length;for(Ne>g.group_pri&&(Ne-=g.group_pri,Re=Fe.group+R.slice(Ne,Ne+g.group_pri)+Re);Ne>g.group_sec;)Ne-=g.group_sec,Re=Fe.group+R.slice(Ne,Ne+g.group_sec)+Re;R=Ne?R.slice(0,Ne)+Re:Re}g.dec_fractions&&(P=String(E(_,g.frac_max)).split(".")[1]||"");let He=!1;if(g.fractions){const Re=Math.abs(g.integer?_%1:_);if(Re)if(He=!0,isFinite(g.denominator))L+=g.denominator,U+=E(Re*g.denominator),U==="0"&&(U="",L="",He=!1,R||(R="0"));else{const Ne=v(Re,g.integer?g.num_max:1/0,g.den_max);U+=Ne[0],L+=Ne[1],g.integer&&U==="0"&&(R||(R="0"),U="",L="",He=!1)}}if(g.date){_e=Math.trunc(_);const Re=oe*(_-_e);if(J=Math.floor(Re),Ue=Re-J,Math.abs(Ue)<1e-6?Ue=0:Ue>.9999&&(Ue=0,J+=1,J===oe&&(J=0,_e+=1)),Ue){const Ne=512&g.date||256&g.date||128&g.date;(Ne===512&&Ue>.9995||Ne===256&&Ue>.995||Ne===128&&Ue>.95||!Ne&&Ue>=.5)&&(J++,Ue=0)}if(_e||g.date_system){const Ne=G(_,g.date_system,p.leap1900);pe=Ne[0],Se=Ne[1],ue=Ne[2]}if(J){const Ne=J<0?oe+J:J;be=Math.floor(Ne)%60,ve=Math.floor(Ne/60)%60,ee=Math.floor(Ne/60/60)%60}if(x=(6+_e)%7,g.date_eval&&(dt=_,gt=_e+J/oe,p.dateSpanLarge?dt<-694324||gt>=35830291:dt<0||gt>=2958466)){if(p.dateErrorThrows)throw new Error("Date out of bounds");return p.dateErrorNumber?le(_<0?[Fe.negative]:[],0,_,Fe).join(""):p.overflow}}var dt,gt;if(g.int_padding&&(R=g.int_padding.length===1?R||g.int_padding:g.int_padding.substring(0,g.int_padding.length-R.length)+R),g.num_padding&&(U=g.num_padding.length===1?U||g.num_padding:g.num_padding.substring(0,g.num_padding.length-U.length)+U),g.den_padding&&(L=g.den_padding.length===1?L||g.den_padding:L+g.den_padding.slice(L.length)),g.man_padding){const Re=g.exp_plus?"+":"";M=g.man_padding.length===1?(Z<0?"-":Re)+(M||g.man_padding):(Z<0?"-":Re)+g.man_padding.slice(0,g.man_padding.length-M.length)+M}const Ee=[];let qe=0;const Ie={int:0,frac:0,man:0,num:0,den:0};for(let Re=0,Ne=g.tokens.length;Re<Ne;Re++){const ne=g.tokens[Re],lt=ne.num?ne.num.length:0;if(ne.type==="string")ne.rule?ne.rule==="num"?He?Ee.push(ne.value):(g.num_min>0||g.den_min>0)&&Ee.push(ne.value.replace(/./g,Y["?"])):ne.rule==="num+int"?He&&R?Ee.push(ne.value):g.den_min>0&&(R||g.num_min)&&Ee.push(ne.value.replace(/./g,Y["?"])):ne.rule==="den"&&(He?Ee.push(ne.value):(g.den_min>0||g.den_min>0)&&Ee.push(ne.value.replace(/./g,Y["?"]))):Ee.push(ne.value);else if(ne.type==="error")Ee.push(p.invalid);else if(ne.type==="point")Ee.push(g.date?ne.value:Fe.decimal);else if(ne.type==="general")le(Ee,0,_,Fe);else if(ne.type==="exp")Ee.push(Fe.exponent);else if(ne.type==="minus")ne.volatile&&g.date||ne.volatile&&(_>=0||typeof _!="number")||(ne.volatile&&!g.fractions&&(g.integer||g.dec_fractions)?(_<0&&R&&R!=="0"||P)&&Ee.push(Fe.negative):Ee.push(Fe.negative));else if(ne.type==="plus")Ee.push(Fe.positive);else if(ne.type==="text")Ee.push(_);else if(ne.type==="div")He?Ee.push("/"):g.num_min>0||g.den_min>0?Ee.push(Y["?"]):Ee.push(Y["#"]);else if(ne.type==="int")if(g.int_pattern.length===1)Ee.push(R);else{const je=qe?g.int_pattern.join("").length-Ie.int:1/0,Tt=qe===g.int_pattern.length-1?0:g.int_pattern.join("").length-(Ie.int+ne.num.length);Ee.push(R.substring(R.length-je,R.length-Tt)),qe++,Ie.int+=ne.num.length}else if(ne.type==="frac"){const je=Ie.frac;for(let Tt=0;Tt<lt;Tt++)Ee.push(P[Tt+je]||Y[ne.num[Tt]]);Ie.frac+=lt}else if(ne.type in j)g[ne.type+"_pattern"].length===1?(ne.type==="int"&&Ee.push(R),ne.type==="frac"&&Ee.push(P),ne.type==="man"&&Ee.push(M),ne.type==="num"&&Ee.push(U),ne.type==="den"&&Ee.push(L)):(Ee.push(j[ne.type].slice(Ie[ne.type],Ie[ne.type]+lt)),Ie[ne.type]+=lt);else if(ne.type==="year")pe<0&&Ee.push(Fe.negative),Ee.push(String(Math.abs(pe)).padStart(4,"0"));else if(ne.type==="year-short"){const je=pe%100;Ee.push(je<10?"0":"",je)}else if(ne.type==="month")Ee.push(ne.pad&&Se<10?"0":"",Se);else if(ne.type==="monthname-single")g.date_system===6?Ee.push(Fe.mmmm6[Se-1].charAt(0)):Ee.push(Fe.mmmm[Se-1].charAt(0));else if(ne.type==="monthname-short")g.date_system===6?Ee.push(Fe.mmm6[Se-1]):Ee.push(Fe.mmm[Se-1]);else if(ne.type==="monthname")g.date_system===6?Ee.push(Fe.mmmm6[Se-1]):Ee.push(Fe.mmmm[Se-1]);else if(ne.type==="weekday-short")Ee.push(Fe.ddd[x]);else if(ne.type==="weekday")Ee.push(Fe.dddd[x]);else if(ne.type==="day")Ee.push(ne.pad&&ue<10?"0":"",ue);else if(ne.type==="hour"){const je=ee%g.clock||(g.clock<24?g.clock:0);Ee.push(ne.pad&&je<10?"0":"",je)}else if(ne.type==="min")Ee.push(ne.pad&&ve<10?"0":"",ve);else if(ne.type==="sec")Ee.push(ne.pad&&be<10?"0":"",be);else if(ne.type==="subsec"){Ee.push(Fe.decimal);const je=Ue.toFixed(g.sec_decimals);Ee.push(je.slice(2,2+ne.decimals))}else if(ne.type==="am"){const je=ee<12?0:1;ne.short&&!b?Ee.push("AP"[je]):Ee.push(Fe.ampm[je])}else if(ne.type==="hour-elap"){_<0&&Ee.push(Fe.negative);const je=24*_e+Math.floor(Math.abs(J)/3600);Ee.push(String(Math.abs(je)).padStart(ne.pad,"0"))}else if(ne.type==="min-elap"){_<0&&Ee.push(Fe.negative);const je=1440*_e+Math.floor(Math.abs(J)/60);Ee.push(String(Math.abs(je)).padStart(ne.pad,"0"))}else if(ne.type==="sec-elap"){_<0&&Ee.push(Fe.negative);const je=_e*oe+Math.abs(J);Ee.push(String(Math.abs(je)).padStart(ne.pad,"0"))}else if(ne.type==="b-year")Ee.push(pe+543);else if(ne.type==="b-year-short"){const je=(pe+543)%100;Ee.push(je<10?"0":"",je)}}return p.nbsp?Ee.join(""):Ee.join("").replace(/\u00a0/g," ")}function ge(_,g){for(let p=0;p<3;p++){const b=g[p];if(b){let M;if(b.condition){const U=b.condition[0],L=b.condition[1];U==="="?M=_===L:U===">"?M=_>L:U==="<"?M=_<L:U===">="?M=_>=L:U==="<="?M=_<=L:U==="<>"&&(M=_!==L)}else M=!0;if(M)return b}}}const Oe=B("@"),Me="black",X={};function Ce(_,g){if(_){const p=_[0];g[p]=g[p]||{},Ce(_.slice(1),g[p])}else g.$=!0}["d-F-y","d-F-Y","d-M-y","d-M-Y","F-d-y","F-d-Y","F-j-y","F-j-Y","j-F-y","j-F-Y","j-M-y","j-M-Y","M-d-y","M-d-Y","M-j-y","M-j-Y","m-d-y","m-d-Y","m-j-y","m-j-Y","n-d-y","n-d-Y","n-j-y","n-j-Y","y-F-d","y-F-j","y-M-d","y-M-j","Y-F-d","Y-F-j","Y-M-d","Y-m-d","Y-M-j","Y-m-j","Y-n-d","Y-n-j","j-F","j-M","d-F","d-M","n-d","n-j","n-Y","m-d","m-j","m-Y","M-Y","M-y","F-y","F-Y","Y-M","Y-n","Y-m","Y-F","Y-M"].forEach(_=>{Ce(_,X),Ce(_+" x",X),Ce(_+" l",X),Ce(_+" l x",X),Ce("l "+_,X),Ce("l "+_+" x",X),Ce(_+" D",X),Ce(_+" D x",X),Ce("D "+_,X),Ce("D "+_+" x",X)});const Ye={jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12},Be={january:1,february:2,march:3,april:4,june:6,july:7,august:8,september:9,october:10,november:11,december:12},Le={sunday:"l",monday:"l",tuesday:"l",wednesday:"l",thursday:"l",friday:"l",saturday:"l",sun:"D",mon:"D",tue:"D",wed:"D",thu:"D",fri:"D",sat:"D"},Qe=new Date().getUTCFullYear();function Et(_){const g=new RegExp("^([\\s+%"+A.join("")+"(-]*)(((?:(?:\\d[\\d,]*)(?:\\.\\d*)?|(?:\\.\\d+)))([eE][+-]?\\d+)?)([\\s%"+A.join("")+")]*)$").exec(_);if(g){const[,p,b,M,U,L]=g;let P=1,R="",Z=!1,_e=!1,J=!1,pe=!1,Se=!1,ue=null,x=!1,ee=parseFloat(b.replace(/,/g,""));if(!isFinite(ee))return null;for(let be=0;be<p.length;be++){const Ue=p[be];if(Ue==="-"){if(Z||_e)return null;Z=!0,P=-1}else if(H.test(Ue)){if(Se)return null;Se=!0,ue=Ue}else if(Ue==="("){if(_e||Z)return null;_e=!0,P=-1}else if(Ue==="%"){if(pe)return null;pe=!0}}for(let be=0;be<L.length;be++){const Ue=L[be];if(H.test(Ue)){if(Se)return null;Se=!0,ue=Ue,x=!0}else if(Ue===")"){if(J||!_e)return null;J=!0}else if(Ue==="%"){if(pe)return null;pe=!0}}if(U){if(pe||Se)return null;R="0.00E+00"}else if(pe){if(Se)return null;R=M.includes(".")?"0.00%":"0%",ee*=.01}else if(Se){const be=M.includes(".")?"#,##0.00":"#,##0";R=x?be+ue:ue+be}else M.includes(",")&&(R=M.includes(".")?"#,##0.00":"#,##0");const ve={v:ee*P};return R&&(ve.z=R),ve}}const ze=(_,g,p)=>{const b=p.path||"",M=Object.keys(g);for(let U=0;U<M.length;U++){let L;const P=M[U];if(g[P]){if(P==="$"||P==="€")_||(L=p);else if(P==="-"){const R=/^(\s*([./-]|,\s)\s*|\s+)/.exec(_);if(R){const Z=R[1]==="-"||R[1]==="/"||R[1]==="."?R[1]:" ";if(!p.sep||p.sep===Z){const _e=R[0].replace(/\s+/g," ");L=ze(_.slice(R[0].length),g[P],{...p,sep:Z,path:b+_e})}}}else if(P===" "){const R=/^[,.]?\s+/.exec(_);if(R){const Z=R[0].replace(/\s+/g," ");L=ze(_.slice(R[0].length),g[P],{...p,path:b+Z})}}else if(P==="j"||P==="d"){const R=/^(0?[1-9]|1\d|2\d|3[01])\b/.exec(_);R&&(L=ze(_.slice(R[0].length),g[P],{...p,day:R[0],path:b+P}))}else if(P==="n"||P==="m"){const R=/^(0?[1-9]|1[012])\b/.exec(_);R&&(L=ze(_.slice(R[0].length),g[P],{...p,month:+R[0],_mon:R[0],path:b+P}))}else if(P==="F"||P==="M"){const R=/^([a-z]{3,9})\b/i.exec(_),Z=R&&(P==="F"?Be:Ye)[R[0].toLowerCase()];Z&&(L=ze(_.slice(R[0].length),g[P],{...p,month:Z,_mon:R[0],path:b+P}))}else if(P==="l"||P==="D"){const R=/^([a-z]{3,9})\b/i.exec(_);(R&&Le[R[0].toLowerCase()])===P&&(L=ze(_.slice(R[0].length),g[P],{...p,path:b+P}))}else if(P==="y"){const R=/^\d\d\b/.exec(_);if(R){const Z=+R[0]>=30?+R[0]+1900:+R[0]+2e3;L=ze(_.slice(R[0].length),g[P],{...p,year:Z,path:b+P})}}else if(P==="Y"){const R=/^\d\d\d\d\b/.exec(_);R&&(L=ze(_.slice(R[0].length),g[P],{...p,year:+R[0],path:b+P}))}else{if(P!=="x")throw new Error('Unknown date token "'.concat(P,'"'));{const R=Ve(_);R&&(L=ze("",g[P],{...p,time:R.v,tf:R.z,path:b+P}))}}if(L)return L}}};function Ze(_,g){const p=ze(_.trim(),X,{path:""});if(p){var b;if(p.sep==="."&&p.path.length===3)return null;const M=+((b=p.year)!==null&&b!==void 0?b:Qe);if(p.day||(p.day=1),!function(P,R,Z){if(Z<1||R<1||R>12)return!1;if(R===2){if(Z>(P%4==0&&P%100!=0||P%400==0||P===1900?29:28))return!1}else if((R===4||R===6||R===9||R===11)&&Z>30||(R===1||R===3||R===5||R===7||R===8||R===10||R===12)&&Z>31)return!1;return!0}(M,p.month,p.day))return null;let U=-1/0;if(M<1900)return null;M<=1900&&p.month<=2?U=25568:M<1e4&&(U=25569);const L=Date.UTC(M,p.month-1,p.day)/864e5+U+(p.time||0);if(L>=0&&L<=2958465){const P=p._mon[0]==="0"||p.day[0]==="0"||p._mon.length===2&&p.day.length===2,R=p.path.replace(/[jdlDnmMFyYx-]/g,Z=>Z==="j"||Z==="d"?P?"dd":"d":Z==="D"?"ddd":Z==="l"?"dddd":Z==="n"||Z==="m"?P?"mm":"m":Z==="M"?"mmm":Z==="F"?"mmmm":Z==="y"?"yy":Z==="x"?p.tf||"":Z==="Y"?"yyyy":Z);return g&&g.nativeDate?{v:Ae(L,g),z:R}:{v:L,z:R}}}return null}function Ve(_){const g=/^\s*([10]?\d|2[0-4])(?::([0-5]\d|\d))?(?::([0-5]\d|\d))?(\.\d{1,10})?(?:\s*([AP])M?)?\s*$/i.exec(_);if(g){const[,p,b,M,U,L]=g;if(U&&!M||!L&&!b&&!M)return null;let P=1*(p||0);if(L){if(P>=13)return null;L[0]!=="p"&&L[0]!=="P"||(P+=12)}return{v:(60*P*60+60*(1*(b||0))+1*(M||0)+1*(U||0))/86400,z:(p.length===2?"hh":"h")+":mm"+(M?":ss":"")+(L?" AM/PM":"")}}return null}function ct(_){return/^\s*true\s*$/i.test(_)?{v:!0}:/^\s*false\s*$/i.test(_)?{v:!1}:null}const it={};function Ut(_,g){const{pattern:p,partitions:b,locale:M}=_,U=R=>{const Z=Object.assign({},V(),g,R);return M&&(Z.locale=M),Z},L=(R,Z)=>{const _e=U(Z);return function(J,pe,Se){const ue=h(Se.locale),x=pe[3]?pe[3]:Oe;if(typeof J=="boolean"&&(J=J?"TRUE":"FALSE"),J==null)return"";if(typeof J!="number")return se(J,x,Se,ue);if(!isFinite(J)){const ve=ue||f;return isNaN(J)?ve.nan:(J<0?ve.negative:"")+ve.infinity}const ee=ge(J,pe);return ee?se(J,ee,Se,ue):Se.overflow}(fe(R,_e),b,_e)};L.color=(R,Z)=>function(_e,J){if(typeof _e!="number"||!isFinite(_e))return(J[3]?J[3].color:Oe.color)||Me;const pe=ge(_e,J);return pe&&pe.color||Me}(fe(R,U(Z)),b);const P=function(R){var Z;let _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const[J,pe]=R,Se=J.frac_max,ue={type:"general",isDate:I(R),isText:k(R),isPercent:we(R),maxDecimals:J.general?9:Se,scale:(Z=J.scale)!==null&&Z!==void 0?Z:1,color:0,parentheses:0,grouped:J.grouping?1:0,_partitions:R},x=!ue.isDate&&!ue.isText&&!J.error&&J.tokens.some(Fe=>Fe.type==="string"&&(_e?Fe.value===_e:H.test(Fe.value)));let ee="G",ve=Se>=0?Math.min(15,Se):"",be="",Ue="";if(pe&&pe.color&&(Ue="-",ue.color=1),J.parens&&(be="()",ue.parentheses=1),x)ee="C",ue.type="currency";else if(J.error)ue.type="error",ue.maxDecimals=0;else if(ue.isDate){let Fe=0,He=0,dt="";J.tokens.forEach(Ee=>{const qe=Ee.type;/^(b-)?year/.test(qe)?(dt+="Y",He++):qe.startsWith("month")?(dt+="M",He++):/^(week)?day/.test(qe)?(dt+="D",He++):qe!=="hour"&&qe!=="min"&&qe!=="sec"&&qe!=="am"||(dt+=qe[0],Fe++)}),ue.type="date",He&&Fe?ue.type="datetime":!He&&Fe&&(ue.type="time");const gt=Q.find(Ee=>dt.startsWith(Ee[0]));ee=gt?"D":"G",ve=gt?gt[1]:""}else ue.isText?(ee="G",ue.type="text",ve="",ue.maxDecimals=0):J.general?(ee="G",ue.type="general",ve=""):J.fractions?(ee="G",ue.type="fraction",ve=""):J.exponential?(ee="S",ue.type="scientific"):ue.isPercent?(ee="P",ue.type="percent"):J.grouping?(ee=",",ue.type="grouped"):(J.int_max||Se)&&(ee="F",ue.type="number");return ue.code=ee+ve+Ue+be,ue.level=K[ue.type],Object.freeze(ue)}(b,(g||{}).currency)||new SyntaxError;return L.info=P,L.dateInfo=function(R){const[Z]=R;return{year:!!(2&Z.date),month:!!(4&Z.date),day:!!(8&Z.date),hours:!!(16&Z.date),minutes:!!(32&Z.date),seconds:!!(64&Z.date),clockType:Z.clock===12?12:24}}(b),L.isPercent=()=>!!P.isPercent,L.isDate=()=>!!P.isDate,L.isText=()=>!!P.isText,L.pattern=p,_.error&&(L.error=_.error),L.options=U,L.locale=M||g&&g.locale||"",Object.freeze(L)}function ke(_,g){_||(_="General");let p=null;return it[_]?p=it[_]:(p=Object.assign({},V(),g).throws?D(_):function(b){try{return D(b)}catch(M){const U={tokens:[{type:"error"}],error:M.message};return{pattern:b,partitions:[U,U,U,U],error:M.message,locale:null}}}(_),p.error||(it[_]=p)),Ut(p,g)}ke.isDate=_=>ke(_,{throws:!1}).isDate(),ke.isPercent=_=>ke(_,{throws:!1}).isPercent(),ke.isText=_=>ke(_,{throws:!1}).isText(),ke.getInfo=(_,g)=>ke(_,{...g,throws:!1}).info,ke.getDateInfo=(_,g)=>ke(_,{...g,throws:!1}).dateInfo,ke.dateToSerial=fe,ke.dateFromSerial=Ae,ke.options=V,ke.dec2frac=v,ke.round=E,ke.codeToLocale=s,ke.parseLocale=l,ke.getLocale=h,ke.addLocale=(_,g)=>{const p=l(g);return delete it[p.lang],delete it[p.language],d(_,p)},ke.format=function(_,g,p){let b=arguments.length>3&&arguments[3]!==void 0&&arguments[3];const M=p&&typeof p=="object"?p:{locale:p,throws:!b};return ke(_,M)(fe(g,M),M)},ke.is_date=ke.isDate,ke.parseNumber=Et,ke.parseDate=Ze,ke.parseTime=Ve,ke.parseBool=ct,ke.parseValue=function(_,g){var p,b,M;return(p=(b=(M=Et(_))!==null&&M!==void 0?M:Ze(_,g))!==null&&b!==void 0?b:Ve(_))!==null&&p!==void 0?p:ct(_)};var ht=ke;return r=r.default}()})}(zr)),zr.exports}var Os,Vo;function o_(){return Vo||(Vo=1,Os=i_()),Os}var a_=o_();const l_=It(a_),u_=l_;function Qt(e){let t=0;const n=Object.keys(e);for(const r of n){const s=Number(r);t=Math.max(t,s)}return t+1}function Js(e,t,n){const r=Qt(n),s=n;for(let i=r-1;i>=e;i--)s[i+1]=s[i];s[e]=t}function qs(e,t,n){const r=Object.keys(n).reduce((s,i)=>Math.max(s,Number.parseInt(i)),0)+1;for(let s=e;s<r;s++)s<e+t?delete n[s]:n[s]!==void 0&&(n[s-t]=n[s],delete n[s])}function c_(e,t){const n=e,r=Object.keys(n),s=r.length,i=t,o=Object.keys(i),a=o.length,l={};let c=0;for(let h=0;h<s;h++,c++){const u=r[h];l[c]=n[u]}for(let h=0;h<a;h++,c++){const u=o[h];l[c]=i[u]}return l}function h_(e,t,n){const r=n;if(Qt(n)>0){const i={};let o=0;for(let a=e;a<=t;a++)r[a]&&(i[o]=r[a],o++);return i}return{}}function Zs(e,t,n,r){const s=e>n;if(!s&&e+t>n)throw new Error("Invalid move operation");s?d_(e,t,n,r):f_(e,t,n,r)}function d_(e,t,n,r){const s=r,i=[];for(let o=e;o<e+t;o++)i.push(s[o]);for(let o=e-1;o>=n;o--){const a=s[o];s[o+t]=a,a===void 0&&delete s[o+t]}i.forEach((o,a)=>{s[n+a]=o,o===void 0&&delete s[n+a]})}function f_(e,t,n,r){const s=r,i=[];for(let o=e;o<e+t;o++)i.push(s[o]);for(let o=e+t;o<n;o++){const a=s[o];s[o-t]=a,a===void 0&&delete s[o-t]}i.forEach((o,a)=>{s[n+a-t]=o,o===void 0&&delete s[n+a-t]})}class xt{constructor(t={}){C(this,"_matrix");this._setOriginValue(t)}static MakeObjectMatrixSize(t){return new xt({[t-1]:{}})}getMatrix(){return this._matrix}forEach(t){const n=this._matrix,r=Object.keys(n);for(const s of r){const i=Number(s),o=n[i];if(t(i,o)===!1)return this}return this}forRow(t){const n=this._matrix,r=Object.keys(n);for(const s of r){const i=Number(s),o=n[i];if(t(i,Object.keys(o).map(l=>Number(l)))===!1)return this}return this}forValue(t){const n=this._matrix;for(const r in n){const s=Number(r),i=n[s];if(i)for(const o in i){const a=Number(o),l=i[a];if(t(s,a,l)===!1)return this}}return this}swapRow(t,n){const r=this._matrix[t],s=this._matrix[n];this._matrix[t]=s,this._matrix[n]=r}getRow(t){return this._matrix[t]}getRowOrCreate(t){let n=this.getRow(t);return n==null&&(n={},this._matrix[t]=n),n}reset(){this._setOriginValue({})}hasValue(){const t=this._matrix,n=Object.keys(t);if(n.length===0)return!1;for(const r of n){const s=Number(r),i=t[s];if(Object.keys(i).length>0)return!0}return!1}getValue(t,n){var r,s;return(s=(r=this._matrix)==null?void 0:r[t])==null?void 0:s[n]}setValue(t,n,r){const s=this.getRowOrCreate(t);s[n]=r}deleteValue(t,n){var r,s;(s=(r=this._matrix)==null?void 0:r[t])==null||delete s[n]}realDeleteValue(t,n){var r,s,i;if((s=(r=this._matrix)==null?void 0:r[t])==null||delete s[n],this.getRow(t)){const o=this.getRow(t);if(o==null)return;Object.keys(o).length===0&&((i=this._matrix)==null||delete i[t])}}setRow(t,n){this._matrix[t]=n}moveRows(t,n,r){Zs(t,n,r,this._matrix)}moveColumns(t,n,r){this.forEach((s,i)=>{Zs(t,n,r,i)})}insertRows(t,n){for(let r=t;r<t+n;r++)Js(r,{},this._matrix)}insertColumns(t,n){for(let r=t;r<t+n;r++)this.forEach((s,i)=>{i&&Js(r,void 0,i)})}removeRows(t,n){qs(t,n,this._matrix)}removeColumns(t,n){this.forEach((r,s)=>{s&&qs(t,n,s)})}getFragment(t,n,r,s){const i=new xt;let o=0;for(let a=t;a<=n;a++){const l={};let c=0;for(let h=r;h<=s;h++){const u=this.getValue(a,h);l[c]=u,c++}i.setRow(o,l),o++}return i}getSlice(t,n,r,s){const i=new xt;for(let o=t;o<=n;o++)for(let a=r;a<=s;a++){const l=this.getValue(o,a);l&&i.setValue(o,a,ce.deepClone(l))}return i}getSizeOf(){return Object.keys(this._matrix).length}getLength(){return Qt(this._matrix)}getRange(){const r=this.getLength()-1;let s=0;const i=this.getLength();for(let o=0;o<i;o++){const a=this.getRow(o);if(a){const l=Qt(a)-1;s=l>s?l:s}}return{startRow:0,startColumn:0,endRow:r,endColumn:s}}toNativeArray(){const t=new Array;return this.forValue((n,r,s)=>{t.push(s)}),t}toArray(){const t=[];return this.forRow((n,r)=>{t[n]==null&&(t[n]=[]),r.forEach(s=>{t[n][s]=this.getValue(n,s)})}),t}toFullArray(){const t=this.getRange(),{endColumn:n,endRow:r}=t,s=[];for(let i=0;i<=r;i++){const o=new Array(n+1).fill(void 0);s.push(o)}return this.forValue((i,o,a)=>{s[i][o]=a}),s}toJSON(){return this._matrix}clone(){const t=JSON.stringify(this._matrix);return JSON.parse(t)}getData(){const t=JSON.stringify(this._matrix);return JSON.parse(t)}getArrayData(){let t=0,n=0,r=!1,s=!1;const i=new xt;return this.forEach((o,a)=>{r||(r=!0,t=o),Object.keys(a).forEach(l=>{const c=Number(l);s?c<n&&(n=c):(s=!0,n=c);const h=this.getValue(o,c);i.setValue(o-t,c-n,h)})}),i.getData()}getStartEndScope(){let t=1/0,n=-1/0,r=1/0,s=-1/0;const i=Object.keys(this._matrix);i.length>0&&(t=+i[0],n=+i[i.length-1]);for(const o of i){const a=Object.keys(this._matrix[o]);a.length>0&&(r=Math.min(r,+a[0]),s=Math.max(s,+a[a.length-1]))}return{startRow:t,endRow:n,startColumn:r,endColumn:s}}getDataRange(){let t=0,n=0,r=0,s=-1,i=!1,o=!1;return this.forEach((a,l)=>{if(i||(i=!0,t=a),l==null)return;const c=Qt(l)-1;c>r&&(r=c),Object.keys(l).forEach(h=>{const u=Number(h);o?u<n&&(n=u):(o=!0,n=u)}),a>s&&(s=a)}),{startRow:t,startColumn:n,endRow:s,endColumn:r}}getDiscreteRanges(){const t=[];return this.forEach((n,r)=>{Object.keys(r).forEach(s=>{const i=Number(s);let o=!1;for(const a of t)if(n>=a.startRow&&n<=a.endRow+1&&i>=a.startColumn&&i<=a.endColumn+1){a.endRow=Math.max(n,a.endRow),a.endColumn=Math.max(i,a.endColumn),o=!0;break}o||t.push({startRow:n,endRow:n,startColumn:i,endColumn:i})})}),t}merge(t){this.forValue((n,r)=>{const s=t.getValue(n,r);s!=null&&this.setValue(n,r,s)})}_setOriginValue(t={}){this._matrix=t}}const g_={sheetId:"",range:{startRow:-1,endRow:-1,startColumn:-1,endColumn:-1}},p_={startRow:-1,startColumn:-1,endRow:-1,endColumn:-1},m_={startRow:0,startColumn:0,endRow:0,endColumn:0},__={row:0,column:0},ut={ff:"Arial",fs:11,it:xe.FALSE,bl:xe.FALSE,ul:{s:xe.FALSE},st:{s:xe.FALSE},ol:{s:xe.FALSE},tr:{a:0,v:xe.FALSE},td:Zn.UNSPECIFIED,cl:{rgb:"#000"},bg:{rgb:"#fff"},ht:Gt.UNSPECIFIED,vt:sn.UNSPECIFIED,tb:ln.UNSPECIFIED,pd:{t:0,r:0,b:0,l:0},n:null},tu={id:"default_slide",title:"defaultSlide",pageSize:{width:300,height:300}},E_=[Si,za,yi];var nu=(e=>(e.ARRAY_CONVERTOR="ARRAY_CONVERTOR",e.MATRIX_CONVERTOR="MATRIX_CONVERTOR",e))(nu||{});function Ir(e,t){const{textRuns:n=[]}=t;let r=0;for(const i of n){const{ts:o={},st:a,ed:l}=i;if(o[e]==null)return xe.FALSE;switch(e){case"bl":case"it":{if(o[e]===xe.FALSE)return xe.FALSE;break}case"ul":case"st":{if(o[e].s===xe.FALSE)return xe.FALSE;break}default:throw new Error(`unknown style key: ${e} in IStyleBase`)}r+=l-a}return t.dataStream.indexOf(`\r
|
|
7
|
-
`)===r?xe.TRUE:xe.FALSE}const Jn=class Jn{constructor(t,n,r){C(this,"_range");C(this,"_worksheet");this._deps=r,this._range=n,this._worksheet=t}static foreach(t,n){const{startRow:r,startColumn:s,endRow:i,endColumn:o}=t;for(let a=r;a<=i;a++)for(let l=s;l<=o;l++)n(a,l)}getRangeData(){return this._range}getValue(){return this.getValues()[0][0]}getValues(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range,i=[];for(let o=t;o<=n;o++){const a=[];for(let l=r;l<=s;l++)a.push(this.getMatrix().getValue(o,l)||null);i.push(a)}return i}getMatrix(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range,i=this._worksheet.getCellMatrix(),o=new xt;for(let a=t;a<=n;a++)for(let l=r;l<=s;l++)o.setValue(a,l,i.getValue(a,l)||null);return o}getMatrixObject(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range,i=this._worksheet.getCellMatrix(),o=new xt;for(let a=t;a<=n;a++)for(let l=r;l<=s;l++)o.setValue(a-t,l-r,i.getValue(a,l)||{});return o}getA1Notation(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range;let i,o;return r<s?(i=ce.numToWord(r+1)+(t+1),o=ce.numToWord(s+1)+(n+1)):(i=ce.numToWord(s+1)+(n+1),o=ce.numToWord(r+1)+(t+1)),i===o?`${i}`:`${i}:${o}`}getBackground(){return this.getBackgrounds()[0][0]}getBackgrounds(){const t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>{var i;const s=t.getStyleByCell(r);return((i=s==null?void 0:s.bg)==null?void 0:i.rgb)||ut.bg.rgb}))}getCell(t,n){const{startRow:r,startColumn:s}=this._range,i={startRow:r+t,endRow:r+t,startColumn:s+n,endColumn:s+n};return new Jn(this._worksheet,i,this._deps)}getColumn(){return this._range.startColumn}getObjectValue(t={}){return this.getObjectValues(t)[0][0]}getObjectValues(t={}){var a;const{startRow:n,endRow:r,startColumn:s,endColumn:i}=this._range,o=this._worksheet.getCellMatrix().getFragment(n,r,s,i).getData();if(t.isIncludeStyle){const l=this._deps.getStyles();for(let c=0;c<=r-n;c++)for(let h=0;h<=i-s;h++){if(o==null||((a=o==null?void 0:o[c])==null?void 0:a[h])==null)continue;const u=o[c][h].s;u&&(o[c][h].s=l.get(u))}}return o}getFontColor(){return this.getFontColors()[0][0]}getFontColors(){const t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>{var i;const s=t.getStyleByCell(r);return((i=s==null?void 0:s.cl)==null?void 0:i.rgb)||ut.cl.rgb}))}getFontFamilies(){return this._getStyles("ff")}getFontFamily(){return this.getFontFamilies()[0][0]}getUnderlines(){return this._getStyles("ul")}getUnderline(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Ir("ul",t.body)===xe.TRUE?{s:xe.TRUE}:{s:xe.FALSE}:this.getUnderlines()[0][0]}getOverlines(){return this._getStyles("ol")}getOverline(){return this.getOverlines()[0][0]}getStrikeThrough(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Ir("st",t.body)===xe.TRUE?{s:xe.TRUE}:{s:xe.FALSE}:this.getStrikeThroughs()[0][0]}getStrikeThroughs(){return this._getStyles("st")}getFontSize(){var n,r;const t=((n=this.getValue())==null?void 0:n.p)||{};return Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?t.body.textRuns.some(s=>{var i;return((i=s==null?void 0:s.ts)==null?void 0:i.fs)!=null})?Math.max(...t.body.textRuns.map(s=>{var i;return((i=s==null?void 0:s.ts)==null?void 0:i.fs)||0})):this.getFontSizes()[0][0]:this.getFontSizes()[0][0]}getFontSizes(){return this._getStyles("fs")}getBorder(){return this.getBorders()[0][0]}getBorders(){return this._getStyles("bd")}getFontStyle(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Ir("it",t.body)===xe.TRUE?Jr.ITALIC:Jr.NORMAL:this._getFontStyles()[0][0]}_getFontStyles(){return this._getStyles("it")}getFontWeight(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Ir("bl",t.body)===xe.TRUE?qr.BOLD:qr.NORMAL:this._getFontWeights()[0][0]}_getFontWeights(){return this._getStyles("bl")}getGridId(){return this._worksheet.getSheetId()}getHeight(){const{_range:t,_worksheet:n}=this,{startRow:r,endRow:s}=t;let i=0;for(let o=0;o<=s-r;o++){const a=n.getRowHeight(o);i+=a}return i}getHorizontalAlignment(){return this.getHorizontalAlignments()[0][0]}getHorizontalAlignments(){return this._getStyles("ht")}getLastColumn(){return this._range.endColumn}getLastRow(){return this._range.endRow}getNumColumns(){const{startColumn:t,endColumn:n}=this._range;return n-t+1}getNumRows(){const{startRow:t,endRow:n}=this._range;return n-t+1}getRichTextValue(){return this.getRichTextValues()[0][0]}getRichTextValues(){return this.getValues().map(t=>t.map(n=>(n==null?void 0:n.p)||""))}getRowIndex(){return this._range.startRow}getSheet(){return this._worksheet}getTextDirection(){return this.getTextDirections()[0][0]}getTextDirections(){return this._getStyles("td")}getTextRotation(){return this.getTextRotations()[0][0]}getTextRotations(){return this._getStyles("tr")}getTextStyle(){return this.getTextStyles()[0][0]}getTextStyles(){const t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>t.getStyleByCell(r)))}getVerticalAlignment(){return this.getVerticalAlignments()[0][0]}getVerticalAlignments(){return this._getStyles("vt")}getWidth(){const{_range:t,_worksheet:n}=this,{startColumn:r,endColumn:s}=t;let i=0;for(let o=0;o<=s-r;o++)i+=n.getColumnWidth(o);return i}getWrap(){return this.getWrapStrategy()===ln.WRAP?xe.TRUE:xe.FALSE}getWrapStrategies(){return this._getStyles("tb")}getWrapStrategy(){return this.getWrapStrategies()[0][0]}forEach(t){Jn.foreach(this._range,t)}_getStyles(t){const n=this._deps.getStyles();return this.getValues().map(r=>r.map(s=>{const i=n&&n.getStyleByCell(s);return i&&i[t]||ut[t]}))}};C(Jn,"transformRange",(t,n)=>{const r=n.getMaxColumns()-1,s=n.getMaxRows()-1;return t.rangeType===De.ALL?{startColumn:0,startRow:0,endColumn:r,endRow:s}:t.rangeType===De.COLUMN?{startRow:0,endRow:s,startColumn:t.startColumn,endColumn:t.endColumn}:t.rangeType===De.ROW?{startColumn:0,endColumn:r,startRow:t.startRow,endRow:t.endRow}:{startColumn:t.startColumn,endColumn:Math.min(t.endColumn,r),startRow:t.startRow,endRow:Math.min(t.endRow,s)}});let Tn=Jn;function v_(e,t,n,r=!1){if(t===0&&n===0)return e;let s={...e};const i=s.startAbsoluteRefType||et.NONE,o=s.endAbsoluteRefType||et.NONE,a=s.rangeType||De.NORMAL;if(!r&&i===et.ALL&&o===et.ALL)return s;const l=Go(s.startRow,n,s.startColumn,t,a),c=Go(s.endRow,n,s.endColumn,t,a);return r||i===et.NONE&&o===et.NONE?s={...s,startRow:l.row,startColumn:l.column,endRow:c.row,endColumn:c.column}:(i===et.NONE?s={...s,startRow:l.row,startColumn:l.column}:i===et.COLUMN?s={...s,startRow:l.row}:i===et.ROW&&(s={...s,startColumn:l.column}),o===et.NONE?s={...s,endRow:c.row,endColumn:c.column}:o===et.COLUMN?s={...s,endRow:c.row}:o===et.ROW&&(s={...s,endColumn:c.column}),s)}function Go(e,t,n,r,s){return s===De.NORMAL?{row:e+t,column:n+r}:s===De.ROW?{row:e+t,column:n}:s===De.COLUMN?{row:e,column:n+r}:{row:e,column:n}}function Ui(e){const t=new Set,n=new Set;for(const o of e)t.add(o.startColumn),t.add(o.endColumn+1),n.add(o.startRow),n.add(o.endRow+1);const r=Array.from(t).sort((o,a)=>o-a),s=Array.from(n).sort((o,a)=>o-a);e.sort((o,a)=>o.startRow-a.startRow||o.startColumn-a.startColumn);const i=[];for(let o=0;o<s.length-1;o++)for(let a=0;a<r.length-1;a++){const l=r[a],c=r[a+1]-1,h=s[o],u=s[o+1]-1;for(const d of e){if(d.startRow>u)break;if(d.startRow<=h&&d.endRow>=u&&d.startColumn<=l&&d.endColumn>=c){i.push({startColumn:l,endColumn:c,startRow:h,endRow:u});break}}}return i}function C_(e){e.sort((r,s)=>r.startRow-s.startRow||r.startColumn-s.startColumn);const t={};for(const r of e)t[r.startRow]||(t[r.startRow]=[]),t[r.startRow].push(r);const n=[];for(const r in t){const s=t[+r];s.sort((o,a)=>o.startColumn-a.startColumn);let i=s[0];for(let o=1;o<s.length;o++){const a=s[o];a.startColumn<=i.endColumn+1&&a.startRow===i.startRow&&a.endRow===i.endRow?i.endColumn=Math.max(i.endColumn,a.endColumn):(n.push(i),i=a)}n.push(i)}return n}function R_(e){e.sort((r,s)=>r.startColumn-s.startColumn||r.startRow-s.startRow);const t={};for(const r of e)t[r.startColumn]||(t[r.startColumn]=[]),t[r.startColumn].push(r);const n=[];for(const r in t){const s=t[+r];s.sort((o,a)=>o.startRow-a.startRow);let i=s[0];for(let o=1;o<s.length;o++){const a=s[o];a.startRow<=i.endRow+1&&a.startColumn===i.startColumn&&a.endColumn===i.endColumn?i.endRow=Math.max(i.endRow,a.endRow):(n.push(i),i=a)}n.push(i)}return n}function I_(e){const t=Ui(e),n=C_(t);return R_(n)}function S_(e,t){const n=[];return e.forEach(r=>{n.push(...qt.subtract(r,t))}),qt.mergeRanges(n)}function y_(e,t){const n=Ko(e.startRow,e.endRow,t.startRow,t.endRow),r=Ko(e.startColumn,e.endColumn,t.startColumn,t.endColumn);if(!n||!r)return null;const[s,i]=n,[o,a]=r,l=O_(e.rangeType,t.rangeType,s,i,o,a);return{startRow:s,endRow:i,startColumn:o,endColumn:a,rangeType:l}}function Ko(e,t,n,r){const s=isNaN(e)?-1/0:e,i=isNaN(t)?1/0:t,o=isNaN(n)?-1/0:n,a=isNaN(r)?1/0:r,l=Math.max(s,o),c=Math.min(i,a);if(l<=c){const h=l===-1/0?Number.NaN:l,u=c===1/0?Number.NaN:c;return[h,u]}else return null}function O_(e,t,n,r,s,i){const o=e!==void 0?e:Xo(n,r,s,i),a=t!==void 0?t:Xo(n,r,s,i);return o===De.ALL||a===De.ALL?o===a?o:o===De.ALL?a:o:o===a?o:(o===De.NORMAL||a===De.NORMAL,De.NORMAL)}function Xo(e,t,n,r){const s=!isNaN(e)&&!isNaN(t),i=!isNaN(n)&&!isNaN(r);return s&&i?De.NORMAL:s?De.ROW:i?De.COLUMN:De.ALL}const Pt=class Pt{static clone(t){return t.rangeType!==void 0?{startRow:t.startRow,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn,rangeType:t.rangeType}:{startRow:t.startRow,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn}}static equals(t,n){return t==null||n==null?!1:t.endRow===n.endRow&&t.endColumn===n.endColumn&&t.startRow===n.startRow&&t.startColumn===n.startColumn&&(t.rangeType===n.rangeType||t.rangeType===void 0&&n.rangeType===De.NORMAL||n.rangeType===void 0&&t.rangeType===De.NORMAL)}static simpleRangesIntersect(t,n){const{startRow:r,endRow:s,startColumn:i,endColumn:o}=t,{startRow:a,endRow:l,startColumn:c,endColumn:h}=n,u=r<=l&&s>=a,d=i<=h&&o>=c;return u&&d}static intersects(t,n){if(t.rangeType===De.ROW&&n.rangeType===De.COLUMN||t.rangeType===De.COLUMN&&n.rangeType===De.ROW)return!0;if(t.rangeType===De.ROW&&n.rangeType===De.ROW)return t.startRow<=n.endRow&&t.endRow>=n.startRow;if(t.rangeType===De.COLUMN&&n.rangeType===De.COLUMN)return t.startColumn<=n.endColumn&&t.endColumn>=n.startColumn;const r=Math.floor(Number.MAX_SAFE_INTEGER/10),s=Number.isNaN(t.startRow)?0:t.startRow,i=Number.isNaN(t.endRow)?r:t.endRow,o=Number.isNaN(t.startColumn)?0:t.startColumn,a=Number.isNaN(t.endColumn)?r:t.endColumn,l=Number.isNaN(n.startRow)?0:n.startRow,c=Number.isNaN(n.endRow)?r:n.endRow,h=Number.isNaN(n.startColumn)?0:n.startColumn,u=Number.isNaN(n.endColumn)?r:n.endColumn,d=Math.abs(o+a-h-u),f=Math.abs(o-a)+Math.abs(h-u),E=Math.abs(s+i-l-c),v=Math.abs(s-i)+Math.abs(l-c);return d<=f&&E<=v}static getIntersects(t,n){const r=t.startRow,s=t.endRow,i=t.startColumn,o=t.endColumn,a=n.startRow,l=n.endRow,c=n.startColumn,h=n.endColumn;let u,d,f,E;if(a<=s)a>=r?d=a:d=r;else return null;if(l>=r)l>=s?E=s:E=l;else return null;if(c<=o)c>i?u=c:u=i;else return null;if(h>=i)h>=o?f=o:f=h;else return null;return{startRow:d,endRow:E,startColumn:u,endColumn:f,rangeType:De.NORMAL}}static contains(t,n){return t.startRow<=n.startRow&&t.endRow>=n.endRow&&t.startColumn<=n.startColumn&&t.endColumn>=n.endColumn}static realContain(t,n){return Pt.contains(t,n)&&(t.startRow<n.startRow||t.endRow>n.endRow||t.startColumn<n.startColumn||t.endColumn>n.endColumn)}static union(...t){return t.reduce((n,r)=>({startRow:Math.min(n.startRow,r.startRow),startColumn:Math.min(n.startColumn,r.startColumn),endRow:Math.max(n.endRow,r.endRow),endColumn:Math.max(n.endColumn,r.endColumn),rangeType:De.NORMAL}),t[0])}static realUnion(...t){const n=t.some(i=>i.rangeType===De.COLUMN),r=t.some(i=>i.rangeType===De.ROW),s=Pt.union(...t);return{startColumn:r?Number.NaN:s.startColumn,endColumn:r?Number.NaN:s.endColumn,startRow:n?Number.NaN:s.startRow,endRow:n?Number.NaN:s.endRow,rangeType:r?De.ROW:n?De.COLUMN:De.NORMAL}}static subtract(t,n){if(n.startRow>t.endRow||n.endRow<t.startRow||n.startColumn>t.endColumn||n.endColumn<t.startColumn)return[t];const r=[];n.startRow>=t.startRow&&r.push({startRow:t.startRow,startColumn:t.startColumn,endRow:n.startRow-1,endColumn:t.endColumn}),n.endRow<=t.endRow&&r.push({startRow:n.endRow+1,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn});const s=Math.max(t.startRow,n.startRow),i=Math.min(t.endRow,n.endRow);return n.startColumn>=t.startColumn&&r.push({startRow:s,startColumn:t.startColumn,endRow:i,endColumn:n.startColumn-1}),n.endColumn<=t.endColumn&&r.push({startRow:s,startColumn:n.endColumn+1,endRow:i,endColumn:t.endColumn}),r.filter(a=>a.startRow<=a.endRow&&a.startColumn<=a.endColumn)}static mergeRanges(t){return I_(t)}static splitIntoGrid(t){return Ui(t)}static subtractMulti(t,n){if(!n.length)return t;let r=t;return n.forEach(s=>{r=S_(r,s)}),r}static hasIntersectionBetweenTwoRect(t,n){return!(t.left>n.right||t.right<n.left||t.top>n.bottom||t.bottom<n.top)}static getIntersectionBetweenTwoRect(t,n){const r=Math.max(t.left,n.left),s=Math.min(t.right,n.right),i=Math.max(t.top,n.top),o=Math.min(t.bottom,n.bottom);return s<=r||o<=i?null:{left:r,right:s,top:i,bottom:o,width:s-r,height:o-i}}static sort(t){return t.sort((n,r)=>n.startRow-r.startRow||n.startColumn-r.startColumn)}};C(Pt,"getRelativeRange",(t,n)=>({startRow:t.startRow-n.startRow,endRow:t.endRow-t.startRow,startColumn:t.startColumn-n.startColumn,endColumn:t.endColumn-t.startColumn})),C(Pt,"getPositionRange",(t,n,r)=>({...r||{},startRow:r&&[et.ROW,et.ALL].includes(r.startAbsoluteRefType||0)?r.startRow:t.startRow+n.startRow,endRow:r&&[et.ROW,et.ALL].includes(r.endAbsoluteRefType||0)?r.endRow:t.endRow+t.startRow+n.startRow,startColumn:r&&[et.COLUMN,et.ALL].includes(r.startAbsoluteRefType||0)?r.startColumn:t.startColumn+n.startColumn,endColumn:r&&[et.COLUMN,et.ALL].includes(r.endAbsoluteRefType||0)?r.endColumn:t.endColumn+t.startColumn+n.startColumn})),C(Pt,"moveHorizontal",(t,n=0,r=0)=>({...t,startColumn:t.startColumn+n,endColumn:t.endColumn+n+r})),C(Pt,"moveVertical",(t,n=0,r=0)=>({...t,startRow:t.startRow+n,endRow:t.endRow+n+r})),C(Pt,"moveOffset",(t,n,r)=>({...t,startRow:t.startRow+r,endRow:t.endRow+r,startColumn:t.startColumn+n,endColumn:t.endColumn+n}));let qt=Pt;function w_(e,t){if(e.length===0||e[0].length===0)return null;const n=new Array(e[0].length).fill(0);let r=0,s=null;for(let i=0;i<e.length;i++){for(let a=0;a<e[0].length;a++)n[a]=t(e[i][a])?n[a]+1:0;const o=b_(n);o.area>r&&(r=o.area,s={startColumn:o.start,startRow:i-o.height+1,endColumn:o.end,endRow:i})}return s}function b_(e){const t=[];let n=0,r={area:0,height:0,start:0,end:0},s=0;for(;s<e.length;)if(t.length===0||e[s]>=e[t[t.length-1]])t.push(s++);else{const i=e[t.pop()],o=t.length===0?s:s-t[t.length-1]-1;i*o>n&&(n=i*o,r={area:n,height:i,start:t.length===0?0:t[t.length-1]+1,end:s-1})}for(;t.length>0;){const i=e[t.pop()],o=t.length===0?s:s-t[t.length-1]-1;i*o>n&&(n=i*o,r={area:n,height:i,start:t.length===0?0:t[t.length-1]+1,end:s-1})}return r}function A_(e,t){Tn.foreach(t,(n,r)=>{e[n][r]=void 0})}function T_(e,t){const n=e.toFullArray(),r=[];for(;;){const s=w_(n,t);if(!s)break;r.push(s),A_(n,s)}return r}class N_{constructor(t,n){C(this,"_values",[]);C(this,"_keys",[]);C(this,"_keyMaps",new Map);this._values=t,this._keys=n,t.forEach(r=>{this._initKeyMap(r)})}_initKeyMap(t){this._keys.forEach(n=>{const r=t[n],s=this._keyMaps.get(n)||new Map;s.set(r,t),this._keyMaps.set(n,s)})}getValue(t,n){const r=n||this._keys;for(let s=0;s<r.length;s++){const i=this._keyMaps.get(r[s]);if(i!=null&&i.has(t))return i.get(t)}return null}hasValue(t){for(let n=0;n<this._keys.length;n++){const r=this._keyMaps.get(this._keys[n]);if(r!=null&&r.has(t))return!0}return!1}addValue(t){this._values.push(t),this._initKeyMap(t)}setValue(t,n,r){const s=this.getValue(t);s&&Object.keys(s).includes(n)&&(s[n]=r)}deleteValue(t,n){const r=this.getValue(t,n);if(r){this._keys.forEach(i=>{const o=this._keyMaps.get(i),a=r[i];o==null||o.delete(a)});const s=this._values.findIndex(i=>i===r);this._values.splice(s,1)}}getValues(){return this._values}getKeyMap(t){var n;return[...((n=this._keyMaps.get(t))==null?void 0:n.keys())||[]]}clear(){this._values=[],this._keys=[],this._keyMaps.clear()}}function ei(e,t,n,r){return{forEach(s){for(let i=e;i<=t;i++)for(let o=n;o<=r;o++)s(i,o)}}}function M_(e){if(e==null||e.length===0)return Number.NaN;const t=e.toLowerCase().split(""),n=t.length,r=o=>o.charCodeAt(0)-96;let s=0,i=0;for(let o=0;o<n;o++)i=r(t[o]),s+=i*26**(n-o-1);return s===0?Number.NaN:s-1}const ts=65,ru=90,D_=97;function x_(e){const t=ru-ts+1;let n="";for(;e>=0;)n=String.fromCharCode(e%t+ts)+n,e=Math.floor(e/t)-1;return n}function su(e,t){let n="";for(;t>0;)n+=e,t--;return n}function L_(e,t=!1){const n=ru-ts+1;let r=D_;t&&(r=ts);const s=String.fromCharCode(e%n+r),i=Math.floor(e/n)+1;return su(s,i)}function U_(e,t){return e.zIndex>t.zIndex?1:e.zIndex===t.zIndex?0:-1}function P_(e,t){return e.zIndex>t.zIndex?-1:e.zIndex===t.zIndex?0:1}function fr(e="index",t=1){return(n,r)=>n[e]>r[e]?t:n[e]===r[e]?0:-t}class gs extends tt{static extend(t){Object.getOwnPropertyNames(t.prototype).forEach(n=>{n!=="constructor"&&(this.prototype[n]=t.prototype[n])}),Object.getOwnPropertyNames(t).forEach(n=>{n!=="prototype"&&n!=="name"&&n!=="length"&&(this[n]=t[n])})}}const ws=Symbol("initializers");class iu extends tt{constructor(t){super(),this._injector=t;const n=this,r=Object.getPrototypeOf(this)[ws];r&&r.forEach(function(s){s.apply(n,[t])})}_initialize(t){}static extend(t){Object.getOwnPropertyNames(t.prototype).forEach(n=>{if(n==="_initialize"){let r=this.prototype[ws];r||(r=[],this.prototype[ws]=r),r.push(t.prototype._initialize)}else n!=="constructor"&&(this.prototype[n]=t.prototype[n])}),Object.getOwnPropertyNames(t).forEach(n=>{n!=="prototype"&&n!=="name"&&n!=="length"&&(this[n]=t[n])})}}class ps{constructor(){C(this,"_data",[])}static create(){return new ps}add(t){this._data.indexOf(t)>-1||this._data.push(t)}delete(t){const n=this._data.indexOf(t);this._data.splice(n,1)}getData(){return this._data}}class Pi{constructor(){C(this,"_data",new Map)}static create(){return new Pi}add(t,n){this._data.has(t)||this._data.set(t,n)}delete(t){this._data.delete(t)}getData(){return this._data}}var $e=(e=>(e[e.UNIVER_UNKNOWN=0]="UNIVER_UNKNOWN",e[e.UNIVER_DOC=1]="UNIVER_DOC",e[e.UNIVER_SHEET=2]="UNIVER_SHEET",e[e.UNIVER_SLIDE=3]="UNIVER_SLIDE",e[e.UNIVER_PROJECT=4]="UNIVER_PROJECT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))($e||{}),Mt=(e=>(e[e.Reader=0]="Reader",e[e.Editor=1]="Editor",e[e.Owner=2]="Owner",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(Mt||{}),ti=(e=>(e[e.SomeCollaborator=0]="SomeCollaborator",e[e.AllCollaborator=1]="AllCollaborator",e[e.OneSelf=2]="OneSelf",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(ti||{});class ms extends tt{}var ou=(e=>(e[e.character=0]="character",e[e.paragraph=1]="paragraph",e[e.table=2]="table",e[e.numbering=3]="numbering",e))(ou||{}),au=(e=>(e[e.TAB=0]="TAB",e[e.SPACE=1]="SPACE",e[e.NOTHING=2]="NOTHING",e))(au||{}),Te=(e=>(e[e.BULLET=0]="BULLET",e[e.NONE=1]="NONE",e[e.DECIMAL=2]="DECIMAL",e[e.DECIMAL_ZERO=3]="DECIMAL_ZERO",e[e.UPPER_LETTER=4]="UPPER_LETTER",e[e.LOWER_LETTER=5]="LOWER_LETTER",e[e.UPPER_ROMAN=6]="UPPER_ROMAN",e[e.LOWER_ROMAN=7]="LOWER_ROMAN",e[e.ORDINAL=8]="ORDINAL",e[e.CARDINAL_TEXT=9]="CARDINAL_TEXT",e[e.ORDINAL_TEXT=10]="ORDINAL_TEXT",e[e.HEX=11]="HEX",e[e.CHICAGO=12]="CHICAGO",e[e.IDEOGRAPH_DIGITAL=13]="IDEOGRAPH_DIGITAL",e[e.JAPANESE_COUNTING=14]="JAPANESE_COUNTING",e[e.AIUEO=15]="AIUEO",e[e.IROHA=16]="IROHA",e[e.DECIMAL_FULL_WIDTH=17]="DECIMAL_FULL_WIDTH",e[e.DECIMAL_HALF_WIDTH=18]="DECIMAL_HALF_WIDTH",e[e.JAPANESE_LEGAL=19]="JAPANESE_LEGAL",e[e.JAPANESE_DIGITAL_TEN_THOUSAND=20]="JAPANESE_DIGITAL_TEN_THOUSAND",e[e.DECIMAL_ENCLOSED_CIRCLE=21]="DECIMAL_ENCLOSED_CIRCLE",e[e.DECIMAL_FULL_WIDTH2=22]="DECIMAL_FULL_WIDTH2",e[e.AIUEO_FULL_WIDTH=23]="AIUEO_FULL_WIDTH",e[e.IROHA_FULL_WIDTH=24]="IROHA_FULL_WIDTH",e[e.GANADA=25]="GANADA",e[e.CHOSUNG=26]="CHOSUNG",e[e.DECIMAL_ENCLOSED_FULLSTOP=27]="DECIMAL_ENCLOSED_FULLSTOP",e[e.DECIMAL_ENCLOSED_PAREN=28]="DECIMAL_ENCLOSED_PAREN",e[e.DECIMAL_ENCLOSED_CIRCLE_CHINESE=29]="DECIMAL_ENCLOSED_CIRCLE_CHINESE",e[e.IDEOGRAPH_ENCLOSED_CIRCLE=30]="IDEOGRAPH_ENCLOSED_CIRCLE",e[e.IDEOGRAPH_TRADITIONAL=31]="IDEOGRAPH_TRADITIONAL",e[e.IDEOGRAPH_ZODIAC=32]="IDEOGRAPH_ZODIAC",e[e.IDEOGRAPH_ZODIAC_TRADITIONAL=33]="IDEOGRAPH_ZODIAC_TRADITIONAL",e[e.TAIWANESE_COUNTING=34]="TAIWANESE_COUNTING",e[e.IDEOGRAPH_LEGAL_TRADITIONAL=35]="IDEOGRAPH_LEGAL_TRADITIONAL",e[e.TAIWANESE_COUNTING_THOUSAND=36]="TAIWANESE_COUNTING_THOUSAND",e[e.TAIWANESE_DIGITAL=37]="TAIWANESE_DIGITAL",e[e.CHINESE_COUNTING=38]="CHINESE_COUNTING",e[e.CHINESE_LEGAL_SIMPLIFIED=39]="CHINESE_LEGAL_SIMPLIFIED",e[e.CHINESE_COUNTING_THOUSAND=40]="CHINESE_COUNTING_THOUSAND",e[e.KOREAN_DIGITAL=41]="KOREAN_DIGITAL",e[e.KOREAN_COUNTING=42]="KOREAN_COUNTING",e[e.KOREAN_LEGAL=43]="KOREAN_LEGAL",e[e.KOREAN_DIGITAL2=44]="KOREAN_DIGITAL2",e[e.VIETNAMESE_COUNTING=45]="VIETNAMESE_COUNTING",e[e.RUSSIAN_LOWER=46]="RUSSIAN_LOWER",e[e.RUSSIAN_UPPER=47]="RUSSIAN_UPPER",e[e.NUMBER_IN_DASH=48]="NUMBER_IN_DASH",e[e.HEBREW1=49]="HEBREW1",e[e.HEBREW2=50]="HEBREW2",e[e.ARABIC_ALPHA=51]="ARABIC_ALPHA",e[e.ARABIC_ABJAD=52]="ARABIC_ABJAD",e[e.HINDI_VOWELS=53]="HINDI_VOWELS",e[e.HINDI_CONSONANTS=54]="HINDI_CONSONANTS",e[e.HINDI_NUMBERS=55]="HINDI_NUMBERS",e[e.HINDI_COUNTING=56]="HINDI_COUNTING",e[e.THAI_LETTERS=57]="THAI_LETTERS",e[e.THAI_NUMBERS=58]="THAI_NUMBERS",e[e.THAI_COUNTING=59]="THAI_COUNTING",e[e.CUSTOM=60]="CUSTOM",e))(Te||{}),gr=(e=>(e[e.BULLET_ALIGNMENT_UNSPECIFIED=0]="BULLET_ALIGNMENT_UNSPECIFIED",e[e.START=1]="START",e[e.CENTER=2]="CENTER",e[e.END=3]="END",e[e.BOTH=4]="BOTH",e))(gr||{}),tr=(e=>(e[e.HYPERLINK=0]="HYPERLINK",e[e.FIELD=1]="FIELD",e[e.SDT=2]="SDT",e[e.BOOKMARK=3]="BOOKMARK",e[e.COMMENT=4]="COMMENT",e[e.CUSTOM=5]="CUSTOM",e[e.MENTION=6]="MENTION",e[e.UNI_FORMULA=7]="UNI_FORMULA",e[e.DELTED=9999]="DELTED",e))(tr||{}),on=(e=>(e[e.COMMENT=0]="COMMENT",e[e.DELETED=9999]="DELETED",e))(on||{}),lu=(e=>(e[e.DRAWING=0]="DRAWING",e[e.CUSTOM=1]="CUSTOM",e))(lu||{}),Fi=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRADITIONAL=1]="TRADITIONAL",e[e.MODERN=2]="MODERN",e))(Fi||{}),uu=(e=>(e[e.DEFAULT=0]="DEFAULT",e[e.LINES=1]="LINES",e[e.LINES_AND_CHARS=2]="LINES_AND_CHARS",e[e.SNAP_TO_CHARS=3]="SNAP_TO_CHARS",e))(uu||{}),cu=(e=>(e[e.SECTION_TYPE_UNSPECIFIED=0]="SECTION_TYPE_UNSPECIFIED",e[e.CONTINUOUS=1]="CONTINUOUS",e[e.NEXT_PAGE=2]="NEXT_PAGE",e[e.EVEN_PAGE=3]="EVEN_PAGE",e[e.ODD_PAGE=4]="ODD_PAGE",e))(cu||{}),hu=(e=>(e[e.COLUMN_SEPARATOR_STYLE_UNSPECIFIED=0]="COLUMN_SEPARATOR_STYLE_UNSPECIFIED",e[e.NONE=1]="NONE",e[e.BETWEEN_EACH_COLUMN=2]="BETWEEN_EACH_COLUMN",e))(hu||{}),du=(e=>(e[e.NORMAL=0]="NORMAL",e[e.TBRL=1]="TBRL",e[e.LRTBV=2]="LRTBV",e))(du||{}),fu=(e=>(e[e.TEXT_RUN=0]="TEXT_RUN",e[e.AUTO_TEXT=1]="AUTO_TEXT",e[e.PAGE_BREAK=2]="PAGE_BREAK",e[e.COLUMN_BREAK=3]="COLUMN_BREAK",e[e.FOOT_NOTE_REFERENCE=4]="FOOT_NOTE_REFERENCE",e[e.HORIZONTAL_RULE=5]="HORIZONTAL_RULE",e[e.EQUATION=6]="EQUATION",e[e.DRAWING=7]="DRAWING",e[e.PERSON=8]="PERSON",e[e.RICH_LINK=9]="RICH_LINK",e))(fu||{}),gu=(e=>(e[e.BOTH_SIDES=0]="BOTH_SIDES",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.LARGEST=3]="LARGEST",e))(gu||{}),pu=(e=>(e[e.INLINE=0]="INLINE",e[e.WRAP_NONE=1]="WRAP_NONE",e[e.WRAP_POLYGON=2]="WRAP_POLYGON",e[e.WRAP_SQUARE=3]="WRAP_SQUARE",e[e.WRAP_THROUGH=4]="WRAP_THROUGH",e[e.WRAP_TIGHT=5]="WRAP_TIGHT",e[e.WRAP_TOP_AND_BOTTOM=6]="WRAP_TOP_AND_BOTTOM",e))(pu||{}),mu=(e=>(e[e.NAMED_STYLE_TYPE_UNSPECIFIED=0]="NAMED_STYLE_TYPE_UNSPECIFIED",e[e.NORMAL_TEXT=1]="NORMAL_TEXT",e[e.TITLE=2]="TITLE",e[e.SUBTITLE=3]="SUBTITLE",e[e.HEADING_1=4]="HEADING_1",e[e.HEADING_2=5]="HEADING_2",e[e.HEADING_3=6]="HEADING_3",e[e.HEADING_4=7]="HEADING_4",e[e.HEADING_5=8]="HEADING_5",e[e.HEADING_6=9]="HEADING_6",e))(mu||{}),_u=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(_u||{}),Eu=(e=>(e[e.DASH_STYLE_UNSPECIFIED=0]="DASH_STYLE_UNSPECIFIED",e[e.SOLID=1]="SOLID",e[e.DOT=2]="DOT",e[e.DASH=3]="DASH",e))(Eu||{}),vu=(e=>(e[e.TAB_STOP_ALIGNMENT_UNSPECIFIED=0]="TAB_STOP_ALIGNMENT_UNSPECIFIED",e[e.START=1]="START",e[e.CENTER=2]="CENTER",e[e.END=3]="END",e))(vu||{}),Cu=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SPECIFIED=1]="SPECIFIED",e))(Cu||{}),Ru=(e=>(e[e.START=0]="START",e[e.CENTER=1]="CENTER",e[e.END=2]="END",e))(Ru||{}),Iu=(e=>(e[e.AUTO_FIT=0]="AUTO_FIT",e[e.FIXED=1]="FIXED",e))(Iu||{}),Su=(e=>(e[e.NONE=0]="NONE",e[e.WRAP=1]="WRAP",e))(Su||{}),yu=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(yu||{}),Ou=(e=>(e[e.CONTENT_ALIGNMENT_UNSPECIFIED=0]="CONTENT_ALIGNMENT_UNSPECIFIED",e[e.BOTH=1]="BOTH",e[e.TOP=2]="TOP",e[e.CENTER=3]="CENTER",e[e.BOTTOM=4]="BOTTOM",e))(Ou||{}),Rn=(e=>(e.NORMAL="normal",e.BOLD="bold",e.ITALIC="italic",e))(Rn||{}),wu=(e=>(e[e.PAGE=0]="PAGE",e[e.COLUMN=1]="COLUMN",e[e.CHARACTER=2]="CHARACTER",e[e.MARGIN=3]="MARGIN",e[e.INSIDE_MARGIN=4]="INSIDE_MARGIN",e[e.OUTSIDE_MARGIN=5]="OUTSIDE_MARGIN",e[e.LEFT_MARGIN=6]="LEFT_MARGIN",e[e.RIGHT_MARGIN=7]="RIGHT_MARGIN",e))(wu||{}),bu=(e=>(e[e.PAGE=0]="PAGE",e[e.PARAGRAPH=1]="PARAGRAPH",e[e.LINE=2]="LINE",e[e.MARGIN=3]="MARGIN",e[e.TOP_MARGIN=4]="TOP_MARGIN",e[e.BOTTOM_MARGIN=5]="BOTTOM_MARGIN",e[e.INSIDE_MARGIN=6]="INSIDE_MARGIN",e[e.OUTSIDE_MARGIN=7]="OUTSIDE_MARGIN",e))(bu||{}),Au=(e=>(e[e.POINT=0]="POINT",e[e.LINE=1]="LINE",e[e.CHARACTER=2]="CHARACTER",e[e.PIXEL=3]="PIXEL",e[e.PERCENT=4]="PERCENT",e))(Au||{}),Tu=(e=>(e[e.CENTER=0]="CENTER",e[e.INSIDE=1]="INSIDE",e[e.LEFT=2]="LEFT",e[e.OUTSIDE=3]="OUTSIDE",e[e.RIGHT=4]="RIGHT",e[e.BOTH=5]="BOTH",e[e.DISTRIBUTE=6]="DISTRIBUTE",e))(Tu||{}),Nu=(e=>(e[e.BOTTOM=0]="BOTTOM",e[e.CENTER=1]="CENTER",e[e.INSIDE=2]="INSIDE",e[e.OUTSIDE=3]="OUTSIDE",e[e.TOP=4]="TOP",e))(Nu||{}),Mu=(e=>(e[e.compressPunctuation=0]="compressPunctuation",e[e.compressPunctuationAndJapaneseKana=1]="compressPunctuationAndJapaneseKana",e[e.doNotCompress=2]="doNotCompress",e))(Mu||{}),Du=(e=>(e[e.PORTRAIT=0]="PORTRAIT",e[e.LANDSCAPE=1]="LANDSCAPE",e))(Du||{}),xu=(e=>(e[e.forward=0]="forward",e[e.backward=1]="backward",e[e.front=2]="front",e[e.back=3]="back",e))(xu||{}),Lu=(e=>(e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e[e.DRAWING_IMAGE=0]="DRAWING_IMAGE",e[e.DRAWING_SHAPE=1]="DRAWING_SHAPE",e[e.DRAWING_CHART=2]="DRAWING_CHART",e[e.DRAWING_TABLE=3]="DRAWING_TABLE",e[e.DRAWING_SMART_ART=4]="DRAWING_SMART_ART",e[e.DRAWING_VIDEO=5]="DRAWING_VIDEO",e[e.DRAWING_GROUP=6]="DRAWING_GROUP",e[e.DRAWING_UNIT=7]="DRAWING_UNIT",e[e.DRAWING_DOM=8]="DRAWING_DOM",e))(Lu||{}),ki=(e=>(e[e.SLIDE=0]="SLIDE",e[e.MASTER=1]="MASTER",e[e.LAYOUT=2]="LAYOUT",e[e.HANDOUT_MASTER=3]="HANDOUT_MASTER",e[e.NOTES_MASTER=4]="NOTES_MASTER",e))(ki||{}),Uu=(e=>(e[e.SHAPE=0]="SHAPE",e[e.IMAGE=1]="IMAGE",e[e.TEXT=2]="TEXT",e[e.SPREADSHEET=3]="SPREADSHEET",e[e.DOCUMENT=4]="DOCUMENT",e[e.SLIDE=5]="SLIDE",e))(Uu||{}),Pu=(e=>(e[e.RELATIVE_SLIDE_LINK_UNSPECIFIED=0]="RELATIVE_SLIDE_LINK_UNSPECIFIED",e[e.NEXT_SLIDE=1]="NEXT_SLIDE",e[e.PREVIOUS_SLIDE=2]="PREVIOUS_SLIDE",e[e.FIRST_SLIDE=3]="FIRST_SLIDE",e[e.LAST_SLIDE=4]="LAST_SLIDE",e))(Pu||{});function F_(e=ce.generateRandomId(6),t=hr.EN_US,n=""){return{id:e,locale:t,title:n,tableSource:{},drawings:{},drawingsOrder:[],headers:{},footers:{},body:{dataStream:`\r
|
|
8
|
-
`,textRuns:[],customBlocks:[],tables:[],paragraphs:[{startIndex:0,paragraphStyle:{spaceAbove:{v:5},lineSpacing:1,spaceBelow:{v:0}}}],sectionBreaks:[{startIndex:1}]},documentStyle:{pageSize:{width:793.3333333333334,height:1122.6666666666667},documentFlavor:Fi.TRADITIONAL,marginTop:50,marginBottom:50,marginRight:50,marginLeft:50,renderConfig:{zeroWidthParagraphBreak:xe.FALSE,vertexAngle:0,centerAngle:0,background:{rgb:"#ccc"}},autoHyphenation:xe.TRUE,doNotHyphenateCaps:xe.FALSE,consecutiveHyphenLimit:2,defaultHeaderId:"",defaultFooterId:"",evenPageHeaderId:"",evenPageFooterId:"",firstPageHeaderId:"",firstPageFooterId:"",evenAndOddHeaders:xe.FALSE,useFirstPageHeaderFooter:xe.FALSE,marginHeader:30,marginFooter:30},settings:{}}}var Pn={},Sr={},yr={},Qo;function k_(){if(Qo)return yr;Qo=1,Object.defineProperty(yr,"__esModule",{value:!0});function e(r,s){if(Array.isArray(s))return!1;for(let i in r)if(!n(r[i],s[i]))return!1;for(let i in s)if(r[i]===void 0)return!1;return!0}function t(r,s){if(!Array.isArray(s)||r.length!==s.length)return!1;for(let i=0;i<r.length;i++)if(!n(r[i],s[i]))return!1;return!0}function n(r,s){return r===s?!0:r===null||s===null||typeof r!="object"||typeof s!="object"?!1:Array.isArray(r)?t(r,s):e(r,s)}return yr.default=n,yr}var Or={},Jo;function $_(){if(Jo)return Or;Jo=1,Object.defineProperty(Or,"__esModule",{value:!0});function e(t){if(t===null)return null;if(Array.isArray(t))return t.map(e);if(typeof t=="object"){const n={};for(let r in t)n[r]=e(t[r]);return n}else return t}return Or.default=e,Or}var bs={},qo;function Fu(){return qo||(qo=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.eachChildOf=e.advancer=e.readCursor=e.writeCursor=e.WriteCursor=e.ReadCursor=e.isValidPathItem=void 0;function t(h,u){if(!h)throw new Error(u)}const n=h=>h!=null&&typeof h=="object"&&!Array.isArray(h),r=(h,u)=>typeof h==typeof u?h>u:typeof h=="string"&&typeof u=="number";function s(h,u){for(let d in h){const f=d;u.write(f,h[f])}}e.isValidPathItem=h=>typeof h=="number"||typeof h=="string"&&h!=="__proto__";class i{constructor(u=null){this.parents=[],this.indexes=[],this.lcIdx=-1,this.idx=-1,this.container=u}ascend(){t(this.parents.length===this.indexes.length/2),this.idx===0?this.parents.length?(this.lcIdx=this.indexes.pop(),this.container=this.parents.pop(),this.idx=this.indexes.pop()):(this.lcIdx=0,this.idx=-1):(t(this.idx>0),this.idx--,n(this.container[this.idx])&&this.idx--)}getPath(){const u=[];let d=this.container,f=this.parents.length-1,E=this.idx;for(;E>=0;)u.unshift(d[E]),E===0?(E=this.indexes[f*2],d=this.parents[f--]):E-=n(d[E-1])?2:1;return u}}class o extends i{get(){return this.container?this.container.slice(this.idx+1):null}getKey(){return t(this.container!=null,"Invalid call to getKey before cursor descended"),this.container[this.idx]}getComponent(){let u;return this.container&&this.container.length>this.idx+1&&n(u=this.container[this.idx+1])?u:null}descendFirst(){let u=this.idx+1;if(!this.container||u>=this.container.length||n(this.container[u])&&u+1>=this.container.length)return!1;n(this.container[u])&&u++;const d=this.container[u];return Array.isArray(d)?(this.indexes.push(this.idx),this.parents.push(this.container),this.indexes.push(u),this.idx=0,this.container=d):this.idx=u,!0}nextSibling(){if(t(this.parents.length===this.indexes.length/2),this.idx>0||this.parents.length===0)return!1;const u=this.indexes[this.indexes.length-1]+1,d=this.parents[this.parents.length-1];return u>=d.length?!1:(t(!isNaN(u)),this.indexes[this.indexes.length-1]=u,this.container=d[u],!0)}_init(u,d,f,E){this.container=u,this.idx=d,this.parents=f.slice(),this.indexes=E.slice()}clone(){const u=new o;return u._init(this.container,this.idx,this.parents,this.indexes),u}*[Symbol.iterator](){if(this.descendFirst()){do yield this.getKey();while(this.nextSibling());this.ascend()}}traverse(u,d){const f=this.getComponent();f&&d(f,u);for(const E of this)u&&u.descend(E),this.traverse(u,d),u&&u.ascend()}eachPick(u,d){this.traverse(u,(f,E)=>{f.p!=null&&d(f.p,E)})}eachDrop(u,d){this.traverse(u,(f,E)=>{f.d!=null&&d(f.d,E)})}}e.ReadCursor=o;class a extends i{constructor(u=null){super(u),this.pendingDescent=[],this._op=u}flushDescent(){t(this.parents.length===this.indexes.length/2),this.container===null&&(this._op=this.container=[]);for(let u=0;u<this.pendingDescent.length;u++){const d=this.pendingDescent[u];let f=this.idx+1;if(f<this.container.length&&n(this.container[f])&&f++,t(f===this.container.length||!n(this.container[f])),f===this.container.length)this.container.push(d),this.idx=f;else if(this.container[f]===d)this.idx=f;else{if(!Array.isArray(this.container[f])){const E=this.container.splice(f,this.container.length-f);this.container.push(E),this.lcIdx>-1&&(this.lcIdx=f)}for(this.indexes.push(this.idx),this.parents.push(this.container),this.lcIdx!==-1&&(t(r(d,this.container[this.lcIdx][0])),f=this.lcIdx+1,this.lcIdx=-1);f<this.container.length&&r(d,this.container[f][0]);)f++;if(this.indexes.push(f),this.idx=0,f<this.container.length&&this.container[f][0]===d)this.container=this.container[f];else{const E=[d];this.container.splice(f,0,E),this.container=E}}}this.pendingDescent.length=0}reset(){this.lcIdx=-1}getComponent(){this.flushDescent();const u=this.idx+1;if(u<this.container.length&&n(this.container[u]))return this.container[u];{const d={};return this.container.splice(u,0,d),d}}write(u,d){const f=this.getComponent();t(f[u]==null||f[u]===d,"Internal consistency error: Overwritten component. File a bug"),f[u]=d}get(){return this._op}descend(u){if(!e.isValidPathItem(u))throw Error("Invalid JSON key");this.pendingDescent.push(u)}descendPath(u){return this.pendingDescent.push(...u),this}ascend(){this.pendingDescent.length?this.pendingDescent.pop():super.ascend()}mergeTree(u,d=s){if(u===null)return;if(t(Array.isArray(u)),u===this._op)throw Error("Cannot merge into my own tree");const f=this.lcIdx,E=this.parents.length;let v=0;for(let O=0;O<u.length;O++){const T=u[O];typeof T=="string"||typeof T=="number"?(v++,this.descend(T)):Array.isArray(T)?this.mergeTree(T,d):typeof T=="object"&&d(T,this)}for(;v--;)this.ascend();this.lcIdx=this.parents.length===E?f:-1}at(u,d){this.descendPath(u),d(this);for(let f=0;f<u.length;f++)this.ascend();return this}writeAtPath(u,d,f){return this.at(u,()=>this.write(d,f)),this.reset(),this}writeMove(u,d,f=0){return this.writeAtPath(u,"p",f).writeAtPath(d,"d",f)}getPath(){const u=super.getPath();return u.push(...this.pendingDescent),u}}e.WriteCursor=a,e.writeCursor=()=>new a,e.readCursor=h=>new o(h);function l(h,u,d){let f,E;E=f=h?h.descendFirst():!1;function v(O){let T;for(;E;){const V=T=h.getKey();if(O!=null){let Y=!1;if(u&&typeof V=="number"&&(T=u(V,h.getComponent()),T<0&&(T=~T,Y=!0)),r(T,O))return null;if(T===O&&!Y)return h}d&&typeof T=="number"&&d(T,h.getComponent()),E=h.nextSibling()}return null}return v.end=()=>{f&&h.ascend()},v}e.advancer=l;function c(h,u,d){let f,E,v,O;for(f=E=h&&h.descendFirst(),v=O=u&&u.descendFirst();f||v;){let T=f?h.getKey():null,V=v?u.getKey():null;T!==null&&V!==null&&(r(V,T)?V=null:T!==V&&(T=null)),d(T==null?V:T,T!=null?h:null,V!=null?u:null),T!=null&&f&&(f=h.nextSibling()),V!=null&&v&&(v=u.nextSibling())}E&&h.ascend(),O&&u.ascend()}e.eachChildOf=c}(bs)),bs}var As={},Zo;function ku(){return Zo||(Zo=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConflictType=void 0,function(t){t[t.RM_UNEXPECTED_CONTENT=1]="RM_UNEXPECTED_CONTENT",t[t.DROP_COLLISION=2]="DROP_COLLISION",t[t.BLACKHOLE=3]="BLACKHOLE"}(e.ConflictType||(e.ConflictType={}))}(As)),As}var nn={},rn={},ea;function $i(){return ea||(ea=1,Object.defineProperty(rn,"__esModule",{value:!0}),rn.uniToStrPos=rn.strPosToUni=void 0,rn.strPosToUni=(e,t=e.length)=>{let n=0,r=0;for(;r<t;r++){const s=e.charCodeAt(r);s>=55296&&s<=57343&&(n++,r++)}if(r!==t)throw Error("Invalid offset - splits unicode bytes");return r-n},rn.uniToStrPos=(e,t)=>{let n=0;for(;t>0;t--){const r=e.charCodeAt(n);n+=r>=55296&&r<=57343?2:1}return n}),rn}var Ts={},ta;function ni(){return ta||(ta=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.uniSlice=e.dlen=e.eachOp=void 0;const t=$i(),n=N=>{if(!Array.isArray(N))throw Error("Op must be an array of components");let A=null;for(let H=0;H<N.length;H++){const q=N[H];switch(typeof q){case"object":if(typeof q.d!="number"&&typeof q.d!="string")throw Error("Delete must be number or string");if(e.dlen(q.d)<=0)throw Error("Deletes must not be empty");break;case"string":if(!(q.length>0))throw Error("Inserts cannot be empty");break;case"number":if(!(q>0))throw Error("Skip components must be >0");if(typeof A=="number")throw Error("Adjacent skip components should be combined");break}A=q}if(typeof A=="number")throw Error("Op has a trailing skip")};function r(N,A){let H=0,q=0;for(let de=0;de<N.length;de++){const ae=N[de];switch(A(ae,H,q),typeof ae){case"object":H+=e.dlen(ae.d);break;case"string":q+=t.strPosToUni(ae);break;case"number":H+=ae,q+=ae;break}}}e.eachOp=r;function s(N,A){const H=[],q=a(H);return r(N,(de,ae,m)=>{q(A(de,ae,m))}),u(H)}const i=N=>N,o=N=>s(N,i);e.dlen=N=>typeof N=="number"?N:t.strPosToUni(N);const a=N=>A=>{if(!(!A||A.d===0||A.d===""))if(N.length===0)N.push(A);else if(typeof A==typeof N[N.length-1])if(typeof A=="object"){const H=N[N.length-1];H.d=typeof H.d=="string"&&typeof A.d=="string"?H.d+A.d:e.dlen(H.d)+e.dlen(A.d)}else N[N.length-1]+=A;else N.push(A)},l=N=>typeof N=="number"?N:typeof N=="string"?t.strPosToUni(N):typeof N.d=="number"?N.d:t.strPosToUni(N.d);e.uniSlice=(N,A,H)=>{const q=t.uniToStrPos(N,A),de=H==null?1/0:t.uniToStrPos(N,H);return N.slice(q,de)};const c=(N,A,H)=>typeof N=="number"?H==null?N-A:Math.min(N,H)-A:e.uniSlice(N,A,H),h=N=>{let A=0,H=0;return{take:(ae,m)=>{if(A===N.length)return ae===-1?null:ae;const B=N[A];let S;if(typeof B=="number")return ae===-1||B-H<=ae?(S=B-H,++A,H=0,S):(H+=ae,ae);if(typeof B=="string"){if(ae===-1||m==="i"||t.strPosToUni(B.slice(H))<=ae)return S=B.slice(H),++A,H=0,S;{const D=H+t.uniToStrPos(B.slice(H),ae);return S=B.slice(H,D),H=D,S}}else{if(ae===-1||m==="d"||e.dlen(B.d)-H<=ae)return S={d:c(B.d,H)},++A,H=0,S;{let D=c(B.d,H,H+ae);return H+=ae,{d:D}}}},peek:()=>N[A]}},u=N=>(N.length>0&&typeof N[N.length-1]=="number"&&N.pop(),N);function d(N,A,H){if(H!=="left"&&H!=="right")throw Error("side ("+H+") must be 'left' or 'right'");n(N),n(A);const q=[],de=a(q),{take:ae,peek:m}=h(N);for(let S=0;S<A.length;S++){const D=A[S];let w,y;switch(typeof D){case"number":for(w=D;w>0;)y=ae(w,"i"),de(y),typeof y!="string"&&(w-=l(y));break;case"string":H==="left"&&typeof m()=="string"&&de(ae(-1)),de(t.strPosToUni(D));break;case"object":for(w=e.dlen(D.d);w>0;)switch(y=ae(w,"i"),typeof y){case"number":w-=y;break;case"string":de(y);break;case"object":w-=e.dlen(y.d)}break}}let B;for(;B=ae(-1);)de(B);return u(q)}function f(N,A){n(N),n(A);const H=[],q=a(H),{take:de}=h(N);for(let m=0;m<A.length;m++){const B=A[m];let S,D;switch(typeof B){case"number":for(S=B;S>0;)D=de(S,"d"),q(D),typeof D!="object"&&(S-=l(D));break;case"string":q(B);break;case"object":S=e.dlen(B.d);let w=0;for(;w<S;)switch(D=de(S-w,"d"),typeof D){case"number":q({d:c(B.d,w,w+D)}),w+=D;break;case"string":w+=t.strPosToUni(D);break;case"object":q(D)}break}}let ae;for(;ae=de(-1);)q(ae);return u(H)}const E=(N,A)=>{let H=0;for(let q=0;q<A.length&&N>H;q++){const de=A[q];switch(typeof de){case"number":{H+=de;break}case"string":const ae=t.strPosToUni(de);H+=ae,N+=ae;break;case"object":N-=Math.min(e.dlen(de.d),N-H);break}}return N},v=(N,A)=>typeof N=="number"?E(N,A):N.map(H=>E(H,A));function O(N,A,H){return s(N,(q,de)=>typeof q=="object"&&typeof q.d=="number"?{d:H.slice(A,de,de+q.d)}:q)}function T(N){return s(N,A=>{switch(typeof A){case"object":if(typeof A.d=="number")throw Error("Cannot invert text op: Deleted characters missing from operation. makeInvertible must be called first.");return A.d;case"string":return{d:A};case"number":return A}})}function V(N){return s(N,A=>typeof A=="object"&&typeof A.d=="string"?{d:t.strPosToUni(A.d)}:A)}function Y(N){let A=!0;return r(N,H=>{typeof H=="object"&&typeof H.d=="number"&&(A=!1)}),A}function ie(N){return{name:"text-unicode",uri:"http://sharejs.org/types/text-unicode",trim:u,normalize:o,checkOp:n,create(A=""){if(typeof A!="string")throw Error("Initial data must be a string");return N.create(A)},apply(A,H){n(H);const q=N.builder(A);for(let de=0;de<H.length;de++){const ae=H[de];switch(typeof ae){case"number":q.skip(ae);break;case"string":q.append(ae);break;case"object":q.del(e.dlen(ae.d));break}}return q.build()},transform:d,compose:f,transformPosition:E,transformSelection:v,isInvertible:Y,makeInvertible(A,H){return O(A,H,N)},stripInvertible:V,invert:T,invertWithDoc(A,H){return T(O(A,H,N))},isNoop:A=>A.length===0}}e.default=ie}(Ts)),Ts}var wr={},na;function j_(){if(na)return wr;na=1,Object.defineProperty(wr,"__esModule",{value:!0});const e=ni(),t=$i();function n(r,s){return{get:r,getLength(){return r().length},insert(i,o,a){const l=t.strPosToUni(r(),i);return s([l,o],a)},remove(i,o,a){const l=t.strPosToUni(r(),i);return s([l,{d:o}],a)},_onOp(i){e.eachOp(i,(o,a,l)=>{switch(typeof o){case"string":this.onInsert&&this.onInsert(l,o);break;case"object":const c=e.dlen(o.d);this.onRemove&&this.onRemove(l,c)}})},onInsert:null,onRemove:null}}return wr.default=n,n.provides={text:!0},wr}var ra;function B_(){return ra||(ra=1,function(e){var t=nn.__createBinding||(Object.create?function(d,f,E,v){v===void 0&&(v=E),Object.defineProperty(d,v,{enumerable:!0,get:function(){return f[E]}})}:function(d,f,E,v){v===void 0&&(v=E),d[v]=f[E]}),n=nn.__setModuleDefault||(Object.create?function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}:function(d,f){d.default=f}),r=nn.__importStar||function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var E in d)Object.hasOwnProperty.call(d,E)&&t(f,d,E);return n(f,d),f},s=nn.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.type=e.remove=e.insert=void 0;const i=$i(),o=r(ni()),a=s(j_()),l={create(d){return d},toString(d){return d},builder(d){if(typeof d!="string")throw Error("Invalid document snapshot: "+d);const f=[];return{skip(E){let v=i.uniToStrPos(d,E);if(v>d.length)throw Error("The op is too long for this document");f.push(d.slice(0,v)),d=d.slice(v)},append(E){f.push(E)},del(E){d=d.slice(i.uniToStrPos(d,E))},build(){return f.join("")+d}}},slice:o.uniSlice},c=o.default(l),h=Object.assign(Object.assign({},c),{api:a.default});e.type=h,e.insert=(d,f)=>f.length===0?[]:d===0?[f]:[d,f],e.remove=(d,f)=>o.dlen(f)===0?[]:d===0?[{d:f}]:[d,{d:f}];var u=ni();Object.defineProperty(e,"makeType",{enumerable:!0,get:function(){return u.default}})}(nn)),nn}var sa;function H_(){return sa||(sa=1,function(e){var t=Sr.__importDefault||function(I){return I&&I.__esModule?I:{default:I}};Object.defineProperty(e,"__esModule",{value:!0}),e.editOp=e.replaceOp=e.insertOp=e.moveOp=e.removeOp=e.type=void 0;const n=t(k_()),r=t($_()),s=Fu(),i=ku();function o(I,k){if(!I)throw new Error(k)}e.type={name:"json1",uri:"http://sharejs.org/types/JSONv1",readCursor:s.readCursor,writeCursor:s.writeCursor,create:I=>I,isNoop:I=>I==null,setDebug(I){},registerSubtype:T,checkValidOp:de,normalize:ae,apply:m,transformPosition:B,compose:S,tryTransform:G,transform:he,makeInvertible:y,invert:D,invertWithDoc:F,RM_UNEXPECTED_CONTENT:i.ConflictType.RM_UNEXPECTED_CONTENT,DROP_COLLISION:i.ConflictType.DROP_COLLISION,BLACKHOLE:i.ConflictType.BLACKHOLE,transformNoConflict:(I,k,K)=>we(()=>!0,I,k,K),typeAllowingConflictsPred:I=>Object.assign(Object.assign({},e.type),{transform:(k,K,Q)=>we(I,k,K,Q)})};const a=I=>I?I.getComponent():null;function l(I){return I&&typeof I=="object"&&!Array.isArray(I)}const c=I=>Array.isArray(I)?I.slice():I!==null&&typeof I=="object"?Object.assign({},I):I,h=I=>I&&(I.p!=null||I.r!==void 0),u=I=>I&&(I.d!=null||I.i!==void 0);function d(I,k){return o(I!=null),typeof k=="number"?(o(Array.isArray(I),"Invalid key - child is not an array"),(I=I.slice()).splice(k,1)):(o(l(I),"Invalid key - child is not an object"),delete(I=Object.assign({},I))[k]),I}function f(I,k,K){return typeof k=="number"?(o(I!=null,"Container is missing for key"),o(Array.isArray(I),"Cannot use numerical key for object container"),o(I.length>=k,"Cannot insert into out of bounds index"),I.splice(k,0,K)):(o(l(I),"Cannot insert into missing item"),o(I[k]===void 0,"Trying to overwrite value at key. Your op needs to remove it first"),I[k]=K),K}e.removeOp=(I,k=!0)=>s.writeCursor().writeAtPath(I,"r",k).get(),e.moveOp=(I,k)=>s.writeCursor().writeMove(I,k).get(),e.insertOp=(I,k)=>s.writeCursor().writeAtPath(I,"i",k).get(),e.replaceOp=(I,k,K)=>s.writeCursor().at(I,Q=>{Q.write("r",k),Q.write("i",K)}).get(),e.editOp=(I,k,K,Q=!1)=>s.writeCursor().at(I,z=>A(z,k,K,Q)).get();const E=(I,k)=>I!=null&&(typeof k=="number"?Array.isArray(I):typeof I=="object"),v=(I,k)=>E(I,k)?I[k]:void 0,O={};function T(I){let k=I.type?I.type:I;k.name&&(O[k.name]=k),k.uri&&(O[k.uri]=k)}const V=I=>{const k=O[I];if(k)return k;throw Error("Missing type: "+I)};T(B_());const Y=(I,k)=>I+k;T({name:"number",apply:Y,compose:Y,invert:I=>-I,transform:I=>I});const ie=I=>I==null?null:I.et?V(I.et):I.es?O["text-unicode"]:I.ena!=null?O.number:null,N=I=>I.es?I.es:I.ena!=null?I.ena:I.e,A=(I,k,K,Q=!1)=>{const[z,W]=typeof k=="string"?[V(k),k]:[k,k.name];!Q&&z.isNoop&&z.isNoop(K)||(W==="number"?I.write("ena",K):W==="text-unicode"?I.write("es",K):(I.write("et",W),I.write("e",K)))};function H(I){o(typeof I=="number"),o(I>=0),o(I===(0|I))}function q(I){typeof I=="number"?H(I):o(typeof I=="string")}function de(I){if(I===null)return;const k=new Set,K=new Set,Q=W=>{let le=!0,oe=!1;for(let j in W){const te=W[j];if(le=!1,o(j==="p"||j==="r"||j==="d"||j==="i"||j==="e"||j==="es"||j==="ena"||j==="et","Invalid component item '"+j+"'"),j==="p")H(te),o(!k.has(te)),k.add(te),o(W.r===void 0);else if(j==="d")H(te),o(!K.has(te)),K.add(te),o(W.i===void 0);else if(j==="e"||j==="es"||j==="ena"){o(!oe),oe=!0;const se=ie(W);o(se,"Missing type in edit"),se.checkValidOp&&se.checkValidOp(N(W))}}o(!le)},z=(W,le,oe)=>{if(!Array.isArray(W))throw Error("Op must be null or a list");if(W.length===0)throw Error("Empty descent");le||q(W[0]);let j=1,te=0,se=0;for(let ge=0;ge<W.length;ge++){const Oe=W[ge];if(o(Oe!=null),Array.isArray(Oe)){const Me=z(Oe,!1);if(te){const X=typeof se,Ce=typeof Me;X===Ce?o(se<Me,"descent keys are not in order"):o(X==="number"&&Ce==="string")}se=Me,te++,j=3}else typeof Oe=="object"?(o(j===1,`Prev not scalar - instead ${j}`),Q(Oe),j=2):(o(j!==3),q(Oe),o(s.isValidPathItem(Oe),"Invalid path key"),j=1)}return o(te!==1,"Operation makes multiple descents. Remove some []"),o(j===2||j===3),W[0]};z(I,!0),o(k.size===K.size,"Mismatched picks and drops in op");for(let W=0;W<k.size;W++)o(k.has(W)),o(K.has(W))}function ae(I){let k=0,K=[];const Q=s.writeCursor();return Q.mergeTree(I,(z,W)=>{const le=ie(z);if(le){const j=N(z);A(W,le,le.normalize?le.normalize(j):j)}for(const j of["r","p","i","d"])if(z[j]!==void 0){const te=j==="p"||j==="d"?(oe=z[j],K[oe]==null&&(K[oe]=k++),K[oe]):z[j];W.write(j,te)}var oe}),Q.get()}function m(I,k){if(de(k),k===null)return I;const K=[];return function Q(z,W){let le=z,oe=0,j={root:z},te=0,se=j,ge="root";function Oe(){for(;te<oe;te++){let Me=W[te];typeof Me!="object"&&(o(E(se,ge)),se=se[ge]=c(se[ge]),ge=Me)}}for(;oe<W.length;oe++){const Me=W[oe];if(Array.isArray(Me)){const X=Q(le,Me);X!==le&&X!==void 0&&(Oe(),le=se[ge]=X)}else if(typeof Me=="object"){Me.d!=null?(Oe(),le=f(se,ge,K[Me.d])):Me.i!==void 0&&(Oe(),le=f(se,ge,Me.i));const X=ie(Me);if(X)Oe(),le=se[ge]=X.apply(le,N(Me));else if(Me.e!==void 0)throw Error("Subtype "+Me.et+" undefined")}else le=v(le,Me)}return j.root}(I=function Q(z,W){const le=[];let oe=0;for(;oe<W.length;oe++){const ge=W[oe];if(Array.isArray(ge))break;typeof ge!="object"&&(le.push(z),z=v(z,ge))}for(let ge=W.length-1;ge>=oe;ge--)z=Q(z,W[ge]);for(--oe;oe>=0;oe--){const ge=W[oe];if(typeof ge!="object"){const Oe=le.pop();z=z===v(Oe,ge)?Oe:z===void 0?d(Oe,ge):(te=ge,se=z,(j=c(j=Oe))[te]=se,j)}else h(ge)&&(o(z!==void 0,"Cannot pick up or remove undefined"),ge.p!=null&&(K[ge.p]=z),z=void 0)}var j,te,se;return z}(I,k),k)}function B(I,k){I=I.slice(),de(k);const K=s.readCursor(k);let Q,z,W=!1;const le=[];for(let j=0;;j++){const te=I[j],se=K.getComponent();if(se&&(se.r!==void 0?W=!0:se.p!=null&&(W=!1,Q=se.p,z=j)),j>=I.length)break;let ge=0;const Oe=s.advancer(K,void 0,(X,Ce)=>{h(Ce)&&ge++});le.unshift(Oe);const Me=Oe(te);if(typeof te=="number"&&(I[j]-=ge),!Me)break}if(le.forEach(j=>j.end()),W)return null;const oe=()=>{let j=0;if(Q!=null){const te=K.getPath();j=te.length,I=te.concat(I.slice(z))}for(;j<I.length;j++){const te=I[j],se=a(K),ge=ie(se);if(ge){const X=N(se);ge.transformPosition&&(I[j]=ge.transformPosition(I[j],X));break}let Oe=0;const Me=s.advancer(K,(X,Ce)=>u(Ce)?~(X-Oe):X-Oe,(X,Ce)=>{u(Ce)&&Oe++})(te);if(typeof te=="number"&&(I[j]+=Oe),!Me)break}};return Q!=null?K.eachDrop(null,j=>{j===Q&&oe()}):oe(),I}function S(I,k){if(de(I),de(k),I==null)return k;if(k==null)return I;let K=0;const Q=s.readCursor(I),z=s.readCursor(k),W=s.writeCursor(),le=[],oe=[],j=[],te=[],se=[],ge=[],Oe=new Set;Q.traverse(null,X=>{X.p!=null&&(j[X.p]=Q.clone())}),z.traverse(null,X=>{X.d!=null&&(te[X.d]=z.clone())});const Me=s.writeCursor();return function X(Ce,Ye,Be,Le,Qe,Et,ze,Ze){o(Ye||Be);const Ve=a(Ye),ct=a(Be),it=!!ct&&ct.r!==void 0,Ut=!!Ve&&Ve.i!==void 0,ke=Ve?Ve.d:null,ht=ct?ct.p:null,_=(Et||it)&&ht==null;if(ht!=null)Le=te[ht],ze=oe[ht]=new s.WriteCursor;else if(ct&&ct.r!==void 0)Le=null;else{const x=a(Le);x&&x.d!=null&&(Le=null)}const g=a(Le);if(ke!=null)if(Ce=j[ke],Ze=le[ke]=new s.WriteCursor,_)Et&&!it&&Ze.write("r",!0);else{const x=se[ke]=K++;ze.write("d",x)}else if(Ve&&Ve.i!==void 0)Ce=null;else{const x=a(Ce);x&&x.p!=null&&(Ce=null)}let p;Ut?(o(Qe===void 0),p=Ve.i):p=Qe;const b=(ht==null?!Ut||Et||it:p===void 0)?null:ze.getComponent();if(ht!=null){if(!(Qe!==void 0||Ut)){const x=ke!=null?se[ke]:K++;ge[ht]=x,Ze.write("p",x)}}else it&&(Ut||Qe!==void 0||(ct.r,Ze.write("r",ct.r)));const M=_?null:ie(Ve),U=ie(g);if((M||U)&&(M&&M.name,U&&U.name),M&&U){o(M===U);const x=N(Ve),ee=N(g),ve=M.compose(x,ee);A(ze,M,ve),Oe.add(g)}else M?A(ze,M,N(Ve)):U&&(A(ze,U,N(g)),Oe.add(g));const L=typeof p=="object"&&p!=null;let P=!1,R=0,Z=0,_e=0,J=0,pe=0;const Se=s.advancer(Le,(x,ee)=>u(ee)?J-x-1:x-J,(x,ee)=>{u(ee)&&J++}),ue=s.advancer(Ce,(x,ee)=>h(ee)?R-x-1:x-R,(x,ee)=>{h(ee)&&R++});if(s.eachChildOf(Ye,Be,(x,ee,ve)=>{let be,Ue,Fe=x,He=x,dt=x;if(typeof x=="number"){let Ne=x+_e;Ue=Se(Ne),He=Ne+J;let ne=x+Z;be=ue(ne),u(a(Ue))&&(be=null),Fe=ne+R,dt=x+pe,o(Fe>=0,"p1PickKey is negative"),o(He>=0,"p2DropKey is negative");const lt=u(a(ee)),je=h(a(ve));(lt||je&&!_)&&pe--,lt&&Z--,je&&_e--}else be=ue(x),Ue=Se(x);Ze.descend(Fe),ze.descend(He);const gt=L&&!u(a(ee))?p[dt]:void 0,Ee=X(be,ee,ve,Ue,gt,_,ze,Ze);var qe,Ie,Re;L&&!_?gt!==Ee&&(P||(p=Array.isArray(p)?p.slice():Object.assign({},p),P=!0),qe=p,Re=Ee,typeof(Ie=dt)=="number"?(o(Array.isArray(qe)),o(Ie<qe.length)):(o(!Array.isArray(qe)),o(qe[Ie]!==void 0)),Re===void 0?typeof Ie=="number"?qe.splice(Ie,1):delete qe[Ie]:qe[Ie]=Re):o(Ee===void 0),ze.ascend(),Ze.ascend()}),ue.end(),Se.end(),b!=null)b.i=p;else if(!Et&&!it&&ht==null)return p}(Q,Q.clone(),z,z.clone(),void 0,!1,W,Me),W.reset(),W.mergeTree(Me.get()),W.reset(),W.get(),le.map(X=>X.get()),oe.map(X=>X.get()),Q.traverse(W,(X,Ce)=>{const Ye=X.p;if(Ye!=null){const Be=se[Ye];Be!=null&&Ce.write("p",Be);const Le=le[Ye];Le&&Le.get(),Le&&Ce.mergeTree(Le.get())}else X.r!==void 0&&Ce.write("r",X.r)}),W.reset(),W.get(),z.traverse(W,(X,Ce)=>{const Ye=X.d;if(Ye!=null){const Le=ge[Ye];Le!=null&&Ce.write("d",Le);const Qe=oe[Ye];Qe&&Ce.mergeTree(Qe.get())}else X.i!==void 0&&Ce.write("i",X.i);const Be=ie(X);Be&&!Oe.has(X)&&A(Ce,Be,N(X))}),W.get()}function D(I){if(I==null)return null;const k=new s.ReadCursor(I),K=new s.WriteCursor;let Q;const z=[],W=[];return function le(oe,j,te){const se=oe.getComponent();let ge,Oe=!1;if(se){se.p!=null&&(j.write("d",se.p),z[se.p]=oe.clone()),se.r!==void 0&&j.write("i",se.r),se.d!=null&&(j.write("p",se.d),te=void 0),se.i!==void 0&&(te=ge=se.i);const X=ie(se);X&&(te===void 0?(Q||(Q=new Set),Q.add(se)):(N(se),te=X.apply(te,N(se)),Oe=!0))}let Me=0;for(const X of oe){j.descend(X);const Ce=typeof X=="number"?X-Me:X,Ye=v(te,Ce);u(oe.getComponent())&&Me++;const Be=le(oe,j,Ye);if(te!==void 0&&Be!==void 0){if(Oe||(Oe=!0,te=c(te)),!E(te,Ce))throw Error("Cannot modify child - invalid operation");te[Ce]=Be}j.ascend()}if(ge===void 0)return Oe?te:void 0;j.write("r",te)}(k,K,void 0),Q&&(K.reset(),function le(oe,j,te){const se=j.getComponent();if(se){const X=se.d;if(X!=null&&(oe=z[X],te=W[X]=s.writeCursor()),Q.has(se)){const Ce=ie(se);if(!Ce.invert)throw Error(`Cannot invert subtype ${Ce.name}`);A(te,Ce,Ce.invert(N(se)))}}let ge=0,Oe=0;const Me=s.advancer(oe,(X,Ce)=>h(Ce)?ge-X-1:X-ge,(X,Ce)=>{h(Ce)&&ge++});for(const X of j)if(typeof X=="number"){const Ce=X-Oe,Ye=Me(Ce),Be=Ce+ge;te.descend(Be),le(Ye,j,te),u(j.getComponent())&&Oe++,te.ascend()}else te.descend(X),le(Me(X),j,te),te.ascend();Me.end()}(k.clone(),k,K),W.length&&(K.reset(),k.traverse(K,(le,oe)=>{const j=le.p;if(j!=null){const te=W[j];te&&te.get(),te&&oe.mergeTree(te.get())}}))),K.get()}const w=(I,k)=>I.some(K=>typeof K=="object"&&(Array.isArray(K)?w(K,k):k(K)));function y(I,k){if(I==null||!w(I,j=>{var te;return j.r!==void 0||((te=ie(j))===null||te===void 0?void 0:te.makeInvertible)!=null}))return I;const K=new s.ReadCursor(I),Q=new s.WriteCursor;let z=!1;const W=[],le=[],oe=(j,te,se)=>{const ge=j.getComponent();let Oe=!1;if(ge){ge.d!=null&&te.write("d",ge.d),ge.i!==void 0&&te.write("i",ge.i);const X=ge.p;if(X!=null&&(W[X]=j.clone(),o(se!==void 0,"Operation picks up at an invalid key"),le[X]=se,te.write("p",ge.p)),ge.r!==void 0&&se===void 0)throw Error("Invalid doc / op in makeInvertible: removed item missing from doc");const Ce=ie(ge);Ce&&(Ce.makeInvertible?z=!0:A(te,Ce,N(ge),!0))}let Me=0;for(const X of j){te.descend(X);const Ce=typeof X=="number"?X-Me:X,Ye=v(se,Ce),Be=oe(j,te,Ye);Ye!==Be&&(Oe||(Oe=!0,se=c(se)),Be===void 0?(se=d(se,Ce),typeof X=="number"&&Me++):se[Ce]=Be),te.ascend()}return ge&&(ge.r!==void 0?(te.write("r",r.default(se)),se=void 0):ge.p!=null&&(se=void 0)),se};return oe(K,Q,k),Q.get(),z&&(Q.reset(),function j(te,se,ge,Oe,Me){const X=se.getComponent();if(X){X.i!==void 0?(Oe=X.i,Me=!0):X.d!=null&&(Oe=le[X.d],te=W[X.d],Me=!1,X.d);let Le=ie(X);if(Le&&Le.makeInvertible){const Qe=N(X);A(ge,Le,Le.makeInvertible(Qe,Oe),!0)}}let Ce=0,Ye=0;const Be=s.advancer(te,(Le,Qe)=>h(Qe)?Ce-Le-1:Le-Ce,(Le,Qe)=>{h(Qe)&&Ce++});for(const Le of se)if(typeof Le=="number"){const Qe=Le-Ye,Et=Be(Qe),ze=Qe+Ce,Ze=v(Oe,Me?Qe:ze);ge.descend(Le),j(Et,se,ge,Ze,Me),u(se.getComponent())&&Ye++,ge.ascend()}else{const Qe=v(Oe,Le);ge.descend(Le),j(Be(Le),se,ge,Qe,Me),ge.ascend()}Be.end()}(K.clone(),K,Q,k,!1)),Q.get()}function F(I,k){return D(y(I,k))}const $=I=>{if(I==null)return null;const k=I.slice();for(let K=0;K<I.length;K++){const Q=k[K];Array.isArray(Q)&&(k[K]=$(Q))}return k};function G(I,k,K){o(K==="left"||K==="right","Direction must be left or right");const Q=K==="left"?0:1;if(k==null)return{ok:!0,result:I};de(I),de(k);let z=null;const W=[],le=[],oe=[],j=[],te=[],se=[],ge=[],Oe=[],Me=[],X=[],Ce=[],Ye=[],Be=[],Le=[],Qe=[];let Et=0;const ze=s.readCursor(I),Ze=s.readCursor(k),Ve=s.writeCursor();if(function g(p,b=null,M){const U=a(b);U&&(U.r!==void 0?M=b.clone():U.p!=null&&(M=null,se[U.p]=p.clone()));const L=p.getComponent();let P;L&&(P=L.p)!=null&&(te[P]=b?b.clone():null,oe[P]=p.clone(),M&&(X[P]=!0,Me[P]=M),U&&U.p!=null&&(Le[P]=U.p));const R=s.advancer(b);for(const Z of p)g(p,R(Z),M);R.end()}(Ze,ze,null),function g(p,b,M,U,L){const P=M.getComponent();let R,Z=!1;P&&((R=P.d)!=null?(j[R]=M.clone(),U!=null&&(Qe[U]==null&&(Qe[U]=[]),Qe[U].push(R)),X[R],p=te[R]||null,b=oe[R]||null,X[R]?(L&&(Ce[R]=!0),L=Me[R]||null):!L||Q!==1&&Le[R]!=null||z==null&&(z={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(L.getPath()),op2:e.moveOp(b.getPath(),M.getPath())}),Z=!0):P.i!==void 0&&(p=b=null,Z=!0,L&&z==null&&(z={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(L.getPath()),op2:e.insertOp(M.getPath(),P.i)})));const _e=a(p);_e&&(_e.r!==void 0?L=p.clone():_e.p!=null&&(_e.p,U=_e.p,L=null));const J=ie(P);J&&L&&z==null&&(z={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(L.getPath()),op2:e.editOp(M.getPath(),J,N(P),!0)});let pe=0,Se=0;const ue=s.advancer(b,(ee,ve)=>h(ve)?pe-ee-1:ee-pe,(ee,ve)=>{h(ve)&&pe++}),x=s.advancer(p);for(const ee of M)if(typeof ee=="number"){const ve=ee-Se,be=ue(ve);Se+=+g(x(ve+pe),be,M,U,L)}else{const ve=ue(ee);g(x(ee),ve,M,U,L)}return ue.end(),x.end(),Z}(ze,Ze,Ze.clone(),null,null),j.map(g=>g&&g.get()),z)return{ok:!1,conflict:z};Ce.map(g=>!!g);const ct=[];let it=null;(function g(p,b,M,U,L){let P=!1;const R=a(b);if(h(R)){const ue=R.p;ue!=null?(M=j[ue],U=Ye[ue]=s.writeCursor(),P=!0,L=null):(M=null,L=b.clone())}else u(a(M))&&(M=null);const Z=p.getComponent();if(Z){const ue=Z.p;ue!=null?(L&&(Oe[ue]=L),ct[ue]=L||Q===1&&P?null:U.getComponent(),W[ue]=p.clone(),M&&(ge[ue]=M.clone())):Z.r!==void 0&&(L||U.write("r",!0),(L||P)&&(it==null&&(it=new Set),it.add(Z)))}let _e=0,J=0;const pe=s.advancer(b,void 0,(ue,x)=>{h(x)&&_e++}),Se=s.advancer(M,(ue,x)=>u(x)?~(ue-J):ue-J,(ue,x)=>{u(x)&&J++});if(p)for(const ue of p)if(typeof ue=="string"){const x=pe(ue),ee=Se(ue);U.descend(ue),g(p,x,ee,U,L),U.ascend()}else{const x=pe(ue),ee=ue-_e,ve=h(a(x))?null:Se(ee),be=ee+J;o(be>=0),U.descend(be),g(p,x,ve,U,L),U.ascend()}pe.end(),Se.end()})(ze,Ze,Ze.clone(),Ve,null),Ve.reset();let Ut=[];if(function g(p,b,M,U,L,P){o(b);const R=b.getComponent();let Z=a(U),_e=!1;const J=(Ie,Re,Ne)=>Ie?e.moveOp(Ie.getPath(),Re.getPath()):e.insertOp(Re.getPath(),Ne.i);if(u(R)){const Ie=R.d;Ie!=null&&(le[Ie]=b.clone());const Re=Ie!=null?ct[Ie]:null;let Ne=!1;if(R.i!==void 0||Ie!=null&&Re){let ne;Z&&(Z.i!==void 0||(ne=Z.d)!=null&&!X[ne])&&(Ne=ne!=null?Ie!=null&&Ie===Le[ne]:n.default(Z.i,R.i),Ne||ne!=null&&Q!==1&&Le[ne]!=null||z==null&&(z={type:i.ConflictType.DROP_COLLISION,op1:J(Ie!=null?W[Ie]:null,b,R),op2:J(ne!=null?oe[ne]:null,U,Z)})),Ne||(P?z==null&&(z={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:J(Ie!=null?W[Ie]:null,b,R),op2:e.removeOp(P.getPath())}):(Ie!=null?(Ut[Et]=Ie,L.write("d",Re.p=Et++)):L.write("i",r.default(R.i)),_e=!0))}else if(Ie!=null&&!Re){const ne=Oe[Ie];ne&&(P=ne.clone())}Ie!=null?(p=W[Ie],M=se[Ie],U=ge[Ie]):R.i!==void 0&&(p=M=null,Ne||(U=null))}else h(a(p))&&(p=M=U=null);const pe=a(p),Se=a(M);if(h(Se)){const Ie=Se.p;Se.r!==void 0&&(!pe||pe.r===void 0)||X[Ie]?(U=null,P=M.clone()):Ie!=null&&(U=j[Ie],Q!==1&&Le[Ie]!=null||((L=Be[Ie])||(L=Be[Ie]=s.writeCursor()),L.reset(),P=null))}else!u(R)&&u(Z)&&(U=null);Z=U!=null?U.getComponent():null;const ue=ie(R);if(ue){const Ie=N(R);if(P)z==null&&(z={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.editOp(b.getPath(),ue,Ie,!0),op2:e.removeOp(P.getPath())});else{const Re=ie(Z);let Ne;if(Re){if(ue!==Re)throw Error("Transforming incompatible types");const ne=N(Z);Ne=ue.transform(Ie,ne,K)}else Ne=r.default(Ie);A(L,ue,Ne)}}let x=0,ee=0,ve=0,be=0,Ue=0,Fe=0,He=p!=null&&p.descendFirst(),dt=He;const gt=s.advancer(M,void 0,(Ie,Re)=>{h(Re)&&ve++});let Ee=U!=null&&U.descendFirst(),qe=Ee;for(const Ie of b)if(typeof Ie=="number"){let Re;const Ne=u(b.getComponent()),ne=Ie-ee;{let Ht;for(;He&&typeof(Ht=p.getKey())=="number";){Ht+=x;const yt=p.getComponent(),fn=h(yt);if(Ht>ne||Ht===ne&&(!fn||Q===0&&Ne))break;if(fn){x--;const en=yt.p;Le.includes(en),yt.d,a(Be[yt.d]),h(a(Be[yt.d])),(yt.r===void 0||it&&it.has(yt))&&(en==null||!ct[en]||Q!==1&&Le.includes(en))||Ue--}He=p.nextSibling()}Re=He&&Ht===ne?p:null}const lt=ne-x;let je=gt(lt);const Tt=lt-ve;let _r=null;{let Ht,yt;for(;Ee&&typeof(Ht=U.getKey())=="number";){yt=Ht-be;const fn=U.getComponent(),en=u(fn);if(yt>Tt)break;if(yt===Tt){if(!en){_r=U;break}{if(Q===0&&Ne){_r=U;break}const Wt=je&&h(je.getComponent());if(Q===0&&Wt)break}}if(en){const Wt=fn.d;X[Wt],Le[Wt],fn.i===void 0&&(X[Wt]||Le[Wt]!=null&&Q!==1)?(X[Wt]||Le[Wt]!=null&&Q===0)&&(be++,Fe--):be++}Ee=U.nextSibling()}}const Zi=Tt+be+Ue+Fe;o(Zi>=0,"trying to descend to a negative index"),L.descend(Zi),Ne&&(Re=je=_r=null,ee++),g(Re,b,je,_r,L,P)&&Fe++,L.ascend()}else{let Re;for(;He&&(Re=p.getKey(),typeof Re!="string"||!(Re>Ie||Re===Ie));)He=p.nextSibling();const Ne=He&&Re===Ie?p:null,ne=gt(Ie);let lt;for(;Ee&&(lt=U.getKey(),typeof lt!="string"||!(lt>Ie||lt===Ie));)Ee=U.nextSibling();const je=Ee&<===Ie?U:null;L.descend(Ie),g(Ne,b,ne,je,L,P),L.ascend()}return gt.end(),dt&&p.ascend(),qe&&U.ascend(),_e}(ze,ze.clone(),Ze,Ze.clone(),Ve,null),z)return{ok:!1,conflict:z};Ve.reset();const ke=(g,p,b)=>g.traverse(p,(M,U)=>{M.d!=null&&b(M.d,g,U)});(X.length||Ye.length)&&(ke(Ze,Ve,(g,p,b)=>{X[g]&&!Ce[g]&&b.write("r",!0),Ye[g]&&b.mergeTree(Ye[g].get())}),Ve.reset());const ht=[],_=[];if((Be.length||X.length)&&!z){const g=s.readCursor($(Ve.get()));if(ke(g,null,(p,b)=>{ht[p]=b.clone()}),Be.forEach(p=>{p&&ke(s.readCursor(p.get()),null,(b,M)=>{ht[b]=M.clone()})}),function p(b,M,U,L,P,R){const Z=a(M);if(Z&&h(Z))if(Z.p!=null){const x=Z.p;ht[x].getPath(),U=ht[x],L=_[x]=s.writeCursor()}else Z.r!==void 0&&(U=null);else u(a(U))&&(U=null);const _e=b.getComponent();if(_e){let x;if((x=_e.d)!=null){const ee=Be[x];ee&&(ee.get(),L.mergeTree(ee.get()),U=s.readCursor(ee.get()))}}let J=0,pe=0;const Se=s.advancer(M,void 0,(x,ee)=>{h(ee)&&J--}),ue=s.advancer(U,(x,ee)=>u(ee)?-(x-pe)-1:x-pe,(x,ee)=>{u(ee)&&pe++});for(const x of b)if(typeof x=="number"){const ee=Se(x),ve=x+J,be=ue(ve),Ue=ve+pe;L.descend(Ue),p(b,ee,be,L),L.ascend()}else L.descend(x),p(b,Se(x),ue(x),L),L.ascend();Se.end(),ue.end()}(Ze,g,g.clone(),Ve),Ve.reset(),z)return{ok:!1,conflict:z};if(Ve.get(),_.length){const p=_.map(M=>M?M.get():null),b=s.readCursor($(Ve.get()));if(ke(b,Ve,(M,U,L)=>{const P=p[M];P&&(L.mergeTree(P),p[M]=null)}),p.find(M=>M)){const M=s.writeCursor(),U=s.writeCursor();let L=0,P=0;p.forEach(R=>{R!=null&&ke(s.readCursor(R),null,Z=>{const _e=Ut[Z];M.writeMove(W[_e].getPath(),le[_e].getPath(),L++);const J=Qe[_e];J&&J.forEach(pe=>{X[pe]||Q!==1&&Le[pe]!=null||U.writeMove(oe[pe].getPath(),j[pe].getPath(),P++)})})}),z={type:i.ConflictType.BLACKHOLE,op1:M.get(),op2:U.get()}}}}return z?{ok:!1,conflict:z}:{ok:!0,result:Ve.get()}}const re=I=>{const k=new Error("Transform detected write conflict");throw k.conflict=I,k.type=k.name="writeConflict",k};function he(I,k,K){const Q=G(I,k,K);if(Q.ok)return Q.result;re(Q.conflict)}const fe=I=>{const k=s.writeCursor();return s.readCursor(I).traverse(k,(K,Q)=>{(u(K)||ie(K))&&Q.write("r",!0)}),k.get()},Ae=(I,k)=>{const{type:K,op1:Q,op2:z}=I;switch(K){case i.ConflictType.DROP_COLLISION:return k==="left"?[null,fe(z)]:[fe(Q),null];case i.ConflictType.RM_UNEXPECTED_CONTENT:let W=!1;return s.readCursor(Q).traverse(null,le=>{le.r!==void 0&&(W=!0)}),W?[null,fe(z)]:[fe(Q),null];case i.ConflictType.BLACKHOLE:return[fe(Q),fe(z)];default:throw Error("Unrecognised conflict: "+K)}};function we(I,k,K,Q){let z=null;for(;;){const W=G(k,K,Q);if(W.ok)return S(z,W.result);{const{conflict:le}=W;I(le)||re(le);const[oe,j]=Ae(le,Q);k=S(ae(k),oe),K=S(ae(K),j),z=S(z,j)}}}}(Sr)),Sr}var ia;function W_(){return ia||(ia=1,function(e){var t=Pn.__createBinding||(Object.create?function(i,o,a,l){l===void 0&&(l=a),Object.defineProperty(i,l,{enumerable:!0,get:function(){return o[a]}})}:function(i,o,a,l){l===void 0&&(l=a),i[l]=o[a]}),n=Pn.__exportStar||function(i,o){for(var a in i)a!=="default"&&!o.hasOwnProperty(a)&&t(o,i,a)};Object.defineProperty(e,"__esModule",{value:!0}),n(H_(),e);var r=Fu();Object.defineProperty(e,"ReadCursor",{enumerable:!0,get:function(){return r.ReadCursor}}),Object.defineProperty(e,"WriteCursor",{enumerable:!0,get:function(){return r.WriteCursor}});var s=ku();Object.defineProperty(e,"ConflictType",{enumerable:!0,get:function(){return s.ConflictType}})}(Pn)),Pn}var pt=W_();const Y_=It(pt),z_=Kc({__proto__:null,default:Y_},[pt]);var me=(e=>(e.RETAIN="r",e.INSERT="i",e.DELETE="d",e))(me||{});function pr(e,t=!1){const n=[];for(const r of e){const{st:s,ed:i,ts:o}=r;if(r.sId===void 0&&delete r.sId,s===i||!t&&ce.isEmptyObject(o)&&r.sId==null)continue;if(n.length===0){n.push(r);continue}const a=n.pop();Jl(r,a)&&ce.hasIntersectionBetweenTwoRanges(a.st,a.ed,r.st,r.ed)?n.push({...r,st:a.st,ed:i}):n.push(a,r)}return n}function $u(e,t,n,r){var c;const{textRuns:s}=e;if(s==null)return;const i=[],o=s.length;let a=!1;const l=(c=t.textRuns)!=null?c:[];if(l.length)for(const h of l)h.st+=r,h.ed+=r;for(let h=0;h<o;h++){const u=s[h],{st:d,ed:f}=u;if(f<=r)i.push(u);else if(r>d&&r<f){a=!0;const E={...u,ed:r};i.push(E),l.length&&i.push(...l);const v={...u,st:r+n,ed:f+n};i.push(v)}else u.st+=n,u.ed+=n,a||(a=!0,i.push(...l)),i.push(u)}a||(a=!0,i.push(...l)),e.textRuns=pr(i)}function ju(e,t,n,r){const{paragraphs:s}=e;if(s==null)return;const{paragraphs:i}=t,o=[];for(let l=0,c=s.length;l<c;l++){const h=s[l],{startIndex:u}=h;u>=r&&(h.startIndex+=n),o.push(h.startIndex)}let a=-1;if(i){for(let l=0,c=i.length;l<c;l++){const h=i[l];h.startIndex+=r;const u=h.startIndex;a=o.indexOf(u)}a!==-1&&s.splice(a,1),s.push(...i),s.sort(fr("startIndex"))}}function Bu(e,t,n,r){const{sectionBreaks:s}=e;if(s==null)return;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=n)}const i=t.sectionBreaks;if(i){for(let o=0,a=i.length;o<a;o++){const l=i[o];l.startIndex+=r}s.push(...i),s.sort(fr("startIndex"))}}function Hu(e,t,n,r){const{customBlocks:s=[]}=e;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=n)}const i=t.customBlocks;if(i){for(let o=0,a=i.length;o<a;o++){const l=i[o];l.startIndex+=r}s.push(...i),s.sort(fr("startIndex"))}s.length&&!e.customBlocks&&(e.customBlocks=s)}function Wu(e,t,n,r){const{tables:s}=e;if(s==null)return;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c,endIndex:h}=l;c>r?(l.startIndex+=n,l.endIndex+=n):h>r&&(l.endIndex+=n)}const i=t.tables;if(i){for(let o=0,a=i.length;o<a;o++){const l=i[o];l.startIndex+=r,l.endIndex+=r}s.push(...i),s.sort(fr("startIndex"))}}const Yu="$",oa=e=>e.split(Yu)[0];function ji(e){if(e.length<=1)return e;e.sort((s,i)=>s.startIndex-i.startIndex);const t=[];let n={...e[0]};n.rangeId=oa(n.rangeId);for(let s=1;s<e.length;s++){const i=e[s];i.rangeId=oa(i.rangeId),i.rangeId===n.rangeId&&cl(n.properties,i.properties)&&n.endIndex+1>=i.startIndex?n.endIndex=i.endIndex:(t.push(n),n={...i})}t.push(n);const r=Object.create(null);for(let s=0,i=t.length;s<i;s++){const o=t[s],a=o.rangeId;r[a]?(o.rangeId=`${a}${Yu}${r[a]}`,r[a]=r[a]+1):r[a]=1}return t}function ri(e,t){const n=e.findIndex(s=>s.startIndex<t&&s.endIndex>=t),r=e[n];r&&e.splice(n,1,{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:r.startIndex,endIndex:t-1,properties:{...r.properties}},{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:t,endIndex:r.endIndex,properties:{...r.properties}})}function zu(e){if(e.length<=1)return e;e.sort((r,s)=>r.startIndex-s.startIndex);const t=[];let n={...e[0]};for(let r=1;r<e.length;r++){const s=e[r];s.id===n.id&&n.endIndex+1>=s.startIndex?n.endIndex=s.endIndex:(t.push(n),n={...s})}return t.push(n),t}function si(e,t){e.filter(r=>r.startIndex<t&&r.endIndex>=t).forEach(r=>{const s=e.indexOf(r);e.splice(s,1,{id:r.id,type:r.type,startIndex:r.startIndex,endIndex:t-1},{id:r.id,type:r.type,startIndex:t,endIndex:r.endIndex})})}function V_(e,t,n,r){e.customRanges||(e.customRanges=[]);const{customRanges:s}=e;ri(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=n,l.endIndex+=n)}const i=[];if(t.customRanges){for(let o=0,a=t.customRanges.length;o<a;o++){const l=t.customRanges[o];l.startIndex+=r,l.endIndex+=r,i.push(l)}s.push(...i)}e.customRanges=ji(s)}function G_(e,t,n,r){e.customDecorations||(e.customDecorations=[]);const{customDecorations:s}=e;si(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=n,l.endIndex+=n)}const i=[];if(t.customDecorations){for(let o=0,a=t.customDecorations.length;o<a;o++){const l=t.customDecorations[o];l.startIndex+=r,l.endIndex+=r,i.push(l)}s.push(...i)}e.customDecorations=zu(s)}function Vu(e,t,n){const{textRuns:r}=e,s=n,i=n+t,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{st:u,ed:d}=h;if(s<=u&&i>=d){o.push({...h,st:u-s,ed:d-s});continue}else u<=s&&d>=i?(o.push({...h,st:s-s,ed:i-s}),h.ed-=t):s>=u&&s<d?(o.push({...h,st:s-s,ed:d-s}),h.ed=s):i>u&&i<=d?(o.push({...h,st:u-s,ed:i-s}),h.st=i-t,h.ed-=t):u>=i&&(h.st-=t,h.ed-=t);a.push(h)}e.textRuns=a}return o.length===0&&o.push({st:0,ed:t,ts:{}}),o}function Gu(e,t,n){const{paragraphs:r}=e,s=n,i=n+t,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u}=h;if(u>=s&&u<i){o.push({...h,startIndex:u-n});continue}else u>=i&&(h.startIndex-=t);a.push(h)}e.paragraphs=a}return o}function Ku(e,t,n){const{sectionBreaks:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u}=h;if(u>=s&&u<=i){o.push({...h,startIndex:u-n});continue}else u>i&&(h.startIndex-=t);a.push(h)}e.sectionBreaks=a}return o}function Xu(e,t,n){const{customBlocks:r=[]}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u}=h;if(u>=s&&u<=i){o.push({...h,startIndex:u-n});continue}else u>i&&(h.startIndex-=t);a.push(h)}e.customBlocks=a}return r.length&&!e.customBlocks&&(e.customBlocks=r),o}function Qu(e,t,n){const{tables:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u,endIndex:d}=h;if(s<=u&&i>=d){o.push({...h,startIndex:u-n,endIndex:d-n});continue}else if(u<=s&&d>=i){const f=fs(u,d,s,i);if(f.length===0||(h.startIndex=f[0],h.endIndex=f[1],h.startIndex===h.endIndex))continue}else i<u&&(h.startIndex-=t,h.endIndex-=t);a.push(h)}e.tables=a}return o}function K_(e,t,n){const{customRanges:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u,endIndex:d}=h;if(u>=s&&d<=i){o.push(h);continue}else if(Math.max(s,u)<=Math.min(i,d)){const f=fs(u,d,s,i);if(f.length===0)continue;h.startIndex=f[0],h.endIndex=f[1]}else i<u&&(h.startIndex-=t,h.endIndex-=t);a.push(h)}e.customRanges=ji(a)}return o}function X_(e,t,n,r=!0){const{customDecorations:s}=e,i=n,o=n+t-1,a=[];if(s){const l=[];for(let c=0,h=s.length;c<h;c++){const u=s[c],{startIndex:d,endIndex:f}=u;if(d>=i&&f<=o){a.push(u);continue}else if(Math.max(i,d)<=Math.min(o,f)){const E=fs(d,f,i,o);if(E.length===0)continue;u.startIndex=E[0],u.endIndex=E[1]}else o<d&&r&&(u.startIndex-=t,u.endIndex-=t);l.push(u)}e.customDecorations=l}return a}var Ju=(e=>(e.ORDER_LIST_QUICK_1="1.",e.ORDER_LIST_QUICK_2="a)",e.ORDER_LIST_QUICK_3="a.",e.ORDER_LIST_QUICK_4="i.",e.ORDER_LIST_QUICK_5="A.",e.ORDER_LIST_QUICK_6="I.",e.ORDER_LIST_QUICK_7="01.",e))(Ju||{}),Lt=(e=>(e.BULLET_LIST="BULLET_LIST",e.BULLET_LIST_1="BULLET_LIST_1",e.BULLET_LIST_2="BULLET_LIST_2",e.BULLET_LIST_3="BULLET_LIST_3",e.BULLET_LIST_4="BULLET_LIST_4",e.BULLET_LIST_5="BULLET_LIST_5",e.ORDER_LIST="ORDER_LIST",e.ORDER_LIST_1="ORDER_LIST_1",e.ORDER_LIST_2="ORDER_LIST_2",e.ORDER_LIST_3="ORDER_LIST_3",e.ORDER_LIST_4="ORDER_LIST_4",e.ORDER_LIST_5="ORDER_LIST_5",e.ORDER_LIST_QUICK_2="ORDER_LIST_QUICK_2",e.ORDER_LIST_QUICK_3="ORDER_LIST_QUICK_3",e.ORDER_LIST_QUICK_4="ORDER_LIST_QUICK_4",e.ORDER_LIST_QUICK_5="ORDER_LIST_QUICK_5",e.ORDER_LIST_QUICK_6="ORDER_LIST_QUICK_6",e.CHECK_LIST="CHECK_LIST",e.CHECK_LIST_CHECKED="CHECK_LIST_CHECKED",e))(Lt||{});const br={"a)":{glyphFormat:"%1)",glyphType:Te.DECIMAL},"1.":{glyphFormat:"%1.",glyphType:Te.DECIMAL},"a.":{glyphFormat:"%1.",glyphType:Te.LOWER_LETTER},"A.":{glyphFormat:"%1.",glyphType:Te.UPPER_LETTER},"i.":{glyphFormat:"%1.",glyphType:Te.LOWER_ROMAN},"I.":{glyphFormat:"%1.",glyphType:Te.UPPER_LETTER}},gn=e=>[...e,...e,...e].map((t,n)=>({glyphFormat:` %${n+1}`,glyphSymbol:t,bulletAlignment:gr.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*n}}})),pn=e=>e.map((t,n)=>({...t,bulletAlignment:gr.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*n}}})),aa=(e,t)=>new Array(9).fill(0).map((n,r)=>({glyphFormat:` %${r+1}`,glyphSymbol:e,bulletAlignment:gr.START,textStyle:{fs:16},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*r},textStyle:t}})),mr={BULLET_LIST:{listType:"BULLET_LIST",nestingLevel:gn(["●","○","■"])},BULLET_LIST_1:{listType:"BULLET_LIST",nestingLevel:gn(["❖","➢","■"])},BULLET_LIST_2:{listType:"BULLET_LIST",nestingLevel:gn(["✔","●","◆"])},BULLET_LIST_3:{listType:"BULLET_LIST",nestingLevel:gn(["■","◆","○"])},BULLET_LIST_4:{listType:"BULLET_LIST",nestingLevel:gn(["✧","○","■"])},BULLET_LIST_5:{listType:"BULLET_LIST",nestingLevel:gn(["➢","○","◆"])},ORDER_LIST:{listType:"ORDER_LIST",nestingLevel:pn([{glyphFormat:"%1.",glyphType:Te.DECIMAL},{glyphFormat:"%2.",glyphType:Te.LOWER_LETTER},{glyphFormat:"%3.",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Te.DECIMAL},{glyphFormat:"%5.",glyphType:Te.LOWER_LETTER},{glyphFormat:"%6.",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Te.DECIMAL},{glyphFormat:"%8.",glyphType:Te.LOWER_LETTER},{glyphFormat:"%9.",glyphType:Te.LOWER_ROMAN}])},ORDER_LIST_1:{listType:"ORDER_LIST",nestingLevel:pn([{glyphFormat:"%1)",glyphType:Te.DECIMAL},{glyphFormat:"%2)",glyphType:Te.LOWER_LETTER},{glyphFormat:"%3)",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%4)",glyphType:Te.DECIMAL},{glyphFormat:"%5)",glyphType:Te.LOWER_LETTER},{glyphFormat:"%6)",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%7)",glyphType:Te.DECIMAL},{glyphFormat:"%8)",glyphType:Te.LOWER_LETTER},{glyphFormat:"%9)",glyphType:Te.LOWER_ROMAN}])},ORDER_LIST_2:{listType:"ORDER_LIST",nestingLevel:pn(["%1.","%1.%2.","%1.%2.%3.","%1.%2.%3.%4.","%1.%2.%3.%4.%5.","%1.%2.%3.%4.%5.%6.","%1.%2.%3.%4.%5.%6.%7."].map(e=>({glyphFormat:e,glyphType:Te.DECIMAL})))},ORDER_LIST_3:{listType:"ORDER_LIST",nestingLevel:pn([{glyphFormat:"%1.",glyphType:Te.UPPER_LETTER},{glyphFormat:"%2.",glyphType:Te.LOWER_LETTER},{glyphFormat:"%3.",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Te.UPPER_LETTER},{glyphFormat:"%5.",glyphType:Te.LOWER_LETTER},{glyphFormat:"%6.",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Te.UPPER_LETTER},{glyphFormat:"%8.",glyphType:Te.LOWER_LETTER},{glyphFormat:"%9.",glyphType:Te.LOWER_ROMAN}])},ORDER_LIST_4:{listType:"ORDER_LIST",nestingLevel:pn([{glyphFormat:"%1.",glyphType:Te.UPPER_LETTER},{glyphFormat:"%2.",glyphType:Te.DECIMAL},{glyphFormat:"%3.",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Te.UPPER_LETTER},{glyphFormat:"%5.",glyphType:Te.DECIMAL},{glyphFormat:"%6.",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Te.UPPER_LETTER},{glyphFormat:"%8.",glyphType:Te.DECIMAL},{glyphFormat:"%9.",glyphType:Te.LOWER_ROMAN}])},ORDER_LIST_5:{listType:"ORDER_LIST",nestingLevel:pn([{glyphFormat:"%1.",glyphType:Te.DECIMAL_ZERO},{glyphFormat:"%2.",glyphType:Te.LOWER_LETTER},{glyphFormat:"%3.",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Te.DECIMAL_ZERO},{glyphFormat:"%5.",glyphType:Te.LOWER_LETTER},{glyphFormat:"%6.",glyphType:Te.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Te.DECIMAL_ZERO},{glyphFormat:"%8.",glyphType:Te.LOWER_LETTER},{glyphFormat:"%9.",glyphType:Te.LOWER_ROMAN}])},CHECK_LIST:{listType:"CHECK_LIST",nestingLevel:aa("☐")},CHECK_LIST_CHECKED:{listType:"CHECK_LIST_CHECKED",nestingLevel:aa("☑",{st:{s:xe.TRUE}})}},Ar=e=>{const{glyphFormat:t,glyphType:n}=e,r=ce.deepClone(mr.ORDER_LIST);return r.nestingLevel[0].glyphFormat=t,r.nestingLevel[0].glyphType=n,r},Q_={ORDER_LIST_QUICK_2:Ar(br["a)"]),ORDER_LIST_QUICK_3:Ar(br["a."]),ORDER_LIST_QUICK_4:Ar(br["i."]),ORDER_LIST_QUICK_6:Ar(br["I."])};Object.assign(mr,Q_);const J_={"1.":"ORDER_LIST","a)":"ORDER_LIST_QUICK_2","a.":"ORDER_LIST_QUICK_3","i.":"ORDER_LIST_QUICK_4","A.":"ORDER_LIST_3","I.":"ORDER_LIST_QUICK_6","01.":"ORDER_LIST_5"};function q_(e,t,n,r,s){const i=Z_(e,t,n,r,s),o=eE(e,t,n,r,s),a=tE(e,t,n,r,s),l=nE(e,t,n,r,s),c=rE(e,t,n,r,s),h=sE(e,t,n,r),u=iE(e,t,n,r,s);return{dataStream:"",textRuns:i,paragraphs:o,sectionBreaks:a,customBlocks:l,tables:c,customRanges:h,customDecorations:u}}function Z_(e,t,n,r,s){const{textRuns:i}=e,{textRuns:o}=t;if(i==null||o==null)return;const a=Vu(e,n,r);if(s!==Pe.REPLACE){const l=qu(o,a,s);t.textRuns=l}return $u(e,t,n,r),a}function qu(e,t,n){if(t.length===0)return e;e=ce.deepClone(e),t=ce.deepClone(t);const r=[],s=e.length,i=t.length;let o=0,a=0,l=null;function c(){return l?(r.push(l),l=null,!0):!1}for(;o<s&&a<i;){const{st:f,ed:E,ts:v}=e[o],{st:O,ed:T,ts:V,sId:Y}=t[a];let ie;if(n===Pe.COVER?ie={...V,...v}:ie={...v},E<O)c()||r.push(e[o]),o++;else if(T<f)c()||r.push(t[a]),a++;else{const N={st:Math.min(f,O),ed:Math.max(f,O),ts:f<O?{...v}:{...V},sId:f<O?void 0:Y};N.ed>N.st&&r.push(N),r.push({st:Math.max(f,O),ed:Math.min(E,T),ts:ie,sId:Y}),E<T?(o++,t[a].st=E,t[a].st===t[a].ed&&a++):(a++,e[o].st=T,e[o].st===e[o].ed&&o++);const A={st:Math.min(E,T),ed:Math.max(E,T),ts:E<T?{...V}:{...v},sId:E<T?Y:void 0};l=A.ed>A.st?A:null}}c();const h=r[r.length-1],u=e[s-1],d=t[i-1];return h&&h.ed!==Math.max(u.ed,d.ed)&&(u.ed>d.ed?r.push(u):r.push(d)),pr(r)}function eE(e,t,n,r,s){const{paragraphs:i}=e,{paragraphs:o}=t;if(i==null||o==null)return;const a=Gu(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const c of o){const{startIndex:h,paragraphStyle:u,bullet:d}=c;let f=[];for(const E of a){const{startIndex:v,paragraphStyle:O,bullet:T}=E;let V,Y;if(s===Pe.COVER?(V={...O,...u},Y={listId:"",listType:Lt.BULLET_LIST,nestingLevel:0,textStyle:{},...T,...d}):(V={...u,...O},Y={listId:"",listType:Lt.BULLET_LIST,nestingLevel:0,textStyle:{},...d,...T}),h===v){f.push({startIndex:h,paragraphStyle:V,bullet:Y});break}}l.push(...f),f=[]}t.paragraphs=l}return ju(e,t,n,r),a}function tE(e,t,n,r,s){const{sectionBreaks:i}=e,{sectionBreaks:o}=t;if(i==null||o==null)return;const a=Ku(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const c of o){const{startIndex:h}=c;let u=[];for(const d of a){const{startIndex:f}=d;if(h===f){s===Pe.COVER?u.push({...d,...c}):u.push({...c,...d});break}}l.push(...u),u=[]}t.sectionBreaks=l}return Bu(e,t,n,r),a}function nE(e,t,n,r,s){const{customBlocks:i=[]}=e,{customBlocks:o}=t;if(i==null||o==null)return;const a=Xu(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const c of o){const{startIndex:h}=c;let u=[];for(const d of a){const{startIndex:f}=d;if(h===f){s===Pe.COVER?u.push({...d,...c}):u.push({...c,...d});break}}l.push(...u),u=[]}t.customBlocks=l}return Hu(e,t,n,r),i.length&&!e.customBlocks&&(e.customBlocks=i),a}function rE(e,t,n,r,s){const{tables:i}=e,{tables:o}=t;if(i==null||o==null)return;const a=Qu(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const c of o){const{startIndex:h,endIndex:u}=c;let d=[];for(const f of a){const{startIndex:E,endIndex:v}=f;if(E>=h&&v<=u){s===Pe.COVER?d.push({...f,...c}):d.push({...c,...f});break}}l.push(...d),d=[]}t.tables=l}return Wu(e,t,n,r),a}function sE(e,t,n,r,s){e.customRanges||(e.customRanges=[]),ri(e.customRanges,r),ri(e.customRanges,r+n);const i=r,o=r+n-1,{customRanges:a}=t,l=[],c=new Map;e.customRanges.forEach(u=>{const{startIndex:d,endIndex:f}=u;d>=i&&f<=o?c.set(u.rangeId,u):l.push(u)});const h=[];return a?(a.forEach(u=>{const{startIndex:d,endIndex:f}=u;l.push({...u,startIndex:d+r,endIndex:f+r})}),e.customRanges=ji(l),h):[]}function iE(e,t,n,r,s){e.customDecorations||(e.customDecorations=[]),si(e.customDecorations,r),si(e.customDecorations,r+n);const i=[],{customDecorations:o}=e,{customDecorations:a=[]}=t;if(s===Pe.REPLACE){for(let l=0;l<o.length;l++){const c=o[l],{startIndex:h,endIndex:u}=c;h>=r&&u<=r+n-1&&i.push(c)}a.forEach(l=>{const{startIndex:c,endIndex:h}=l;o.push({...l,startIndex:c+r,endIndex:h+r})})}else for(const l of a){const{id:c}=l;if(l.type===on.DELETED){const h=o.filter(u=>u.id===c);h.length&&i.push(...h)}else o.push({...l,startIndex:l.startIndex+r,endIndex:l.endIndex+r})}for(const l of i){const{id:c}=l,h=o.findIndex(u=>u.id===c);h!==-1&&o.splice(h,1)}return e.customDecorations=zu(o),i}var Bi=(e=>(e[e.copy=0]="copy",e[e.cut=1]="cut",e))(Bi||{});function Jt(e,t,n,r=!0,s=1){const{dataStream:i,textRuns:o,paragraphs:a=[],customBlocks:l=[],tables:c=[],sectionBreaks:h=[]}=e,u={dataStream:i.slice(t,n)};if(o){const T=[];for(const V of o){const Y=ce.deepClone(V),{st:ie,ed:N}=Y;ce.hasIntersectionBetweenTwoRanges(ie,N,t,n)&&(t>=ie&&t<=N?T.push({...Y,st:t,ed:Math.min(n,N)}):n>=ie&&n<=N?T.push({...Y,st:Math.max(t,ie),ed:n}):T.push(Y))}u.textRuns=pr(T.map(V=>{const{st:Y,ed:ie}=V;return{...V,st:Y-t,ed:ie-t}}))}else r&&(u.textRuns=[{st:0,ed:n-t,ts:{}}]);const d=[];for(const T of c){const V=ce.deepClone(T),{startIndex:Y,endIndex:ie}=V;Y>=t&&ie<=n&&d.push({...V,startIndex:Y-t,endIndex:ie-t})}d.length&&(u.tables=d);const f=[];for(const T of a){const{startIndex:V}=T;V>=t&&V<n&&f.push(ce.deepClone(T))}f.length&&(u.paragraphs=f.map(T=>({...T,startIndex:T.startIndex-t})));const E=[];for(const T of h){const{startIndex:V}=T;V>=t&&V<=n&&E.push(ce.deepClone(T))}if(E.length&&(u.sectionBreaks=E.map(T=>({...T,startIndex:T.startIndex-t}))),s===1){const T=ec(e,t,n);T?u.customDecorations=T:r&&(u.customDecorations=[])}const{customRanges:v}=Zu(e,t,n);v?u.customRanges=v:r&&(u.customRanges=[]);const O=[];for(const T of l){const{startIndex:V}=T;V>=t&&V<=n&&O.push(ce.deepClone(T))}return O.length&&(u.customBlocks=O.map(T=>({...T,startIndex:T.startIndex-t}))),u}function oE(e){const{dataStream:t,textRuns:n,paragraphs:r,customRanges:s,customDecorations:i,tables:o}=e;let a=0,l=0;s==null||s.forEach(h=>{h.startIndex<0&&(a=Math.max(a,-h.startIndex)),h.endIndex>t.length-1&&(l=Math.max(l,h.endIndex-t.length+1))});const c=`${t}`;return n&&(n[0]&&(n[0].st=n[0].st-a),n[n.length-1]&&(n[n.length-1].ed=n[n.length-1].ed+l)),n==null||n.forEach(h=>{h.st+=a,h.ed+=a}),r==null||r.forEach(h=>{h.startIndex+=a}),s==null||s.forEach(h=>{h.startIndex+=a,h.endIndex+=a}),i==null||i.forEach(h=>{h.startIndex+=a,h.endIndex+=l}),o==null||o.forEach(h=>{h.startIndex+=a,h.endIndex+=l}),{...e,dataStream:c,textRuns:n,paragraphs:r,customRanges:s,customDecorations:i,tables:o}}function Zu(e,t,n){if(e.customRanges==null)return{};const{customRanges:r}=e;return{customRanges:r.filter(a=>Math.max(a.startIndex,t)<=Math.min(a.endIndex,n-1)).map(a=>({...a,startIndex:Math.max(a.startIndex,t),endIndex:Math.min(a.endIndex,n-1)})).map(a=>({...a,startIndex:a.startIndex-t,endIndex:a.endIndex-t})),leftOffset:0,rightOffset:0}}function ec(e,t,n){if(e.customDecorations==null)return;const{customDecorations:r=[]}=e,s=[];return r.forEach(i=>{if(Math.max(i.startIndex,t)<=Math.min(i.endIndex,n-1)){const o=ce.deepClone(i);s.push({...o,startIndex:Math.max(o.startIndex-t,0),endIndex:Math.min(o.endIndex,n-1)-t})}}),s}function aE(e,t,n){return e==null||t==null?e!=null?e:t:qu(e,t,n)}function lE(e,t,n){if(e==null||t==null)return e!=null?e:t;if(t.length===0||e.length===0)return e;if(t.length>1||e.length>1)throw new Error("Cannot cover multiple customRanges");return n===Pe.REPLACE?[{...e[0]}]:[{...t[0],...e[0]}]}function uE(e,t,n){return t.length===0||e.length===0||n===Pe.REPLACE?e:[...e,...t.filter(r=>!e.some(s=>r.id===s.id))]}function ii(e,t,n=Pe.COVER){if(t.dataStream!=="")throw new Error("Cannot compose other body with non-empty dataStream");const r={dataStream:e.dataStream},{textRuns:s,paragraphs:i=[],customRanges:o,customDecorations:a=[]}=e,{textRuns:l,paragraphs:c=[],customRanges:h,customDecorations:u=[]}=t;r.textRuns=aE(l,s,n),r.customRanges=lE(h,o,n);const d=uE(u,a,n);d.length&&(r.customDecorations=d);const f=[];let E=0,v=0;for(;E<i.length&&v<c.length;){const O=i[E],T=c[v],{startIndex:V}=O,{startIndex:Y}=T;V===Y?(f.push(ce.deepMerge(O,T)),E++,v++):V<Y?(f.push(ce.deepClone(O)),E++):(f.push(ce.deepClone(T)),v++)}return E<i.length&&f.push(...i.slice(E)),v<c.length&&f.push(...c.slice(v)),f.length&&(r.paragraphs=f),r}function cE(e){const{body:t}=e;if(t==null)return!0;const{textRuns:n,paragraphs:r,customRanges:s,customBlocks:i,customDecorations:o,tables:a}=t;return n==null&&r==null&&s==null&&i==null&&o==null&&a==null}class _n{constructor(t){C(this,"_index",0);C(this,"_offset",0);this._actions=t}hasNext(){return this.peekLength()<Number.POSITIVE_INFINITY}next(t){t||(t=Number.POSITIVE_INFINITY);const n=this._actions[this._index];if(n){const r=this._offset,s=n.len;return t>=s-r?(t=s-r,this._index+=1,this._offset=0):this._offset+=t,n.t===me.DELETE||n.t===me.RETAIN&&n.body==null?ce.deepClone({...n,len:t}):ce.deepClone({...n,len:t,body:Jt(n.body,r,r+t,!1)})}else return{t:me.RETAIN,len:Number.POSITIVE_INFINITY}}peek(){return this._actions[this._index]}peekLength(){return this._actions[this._index]?this._actions[this._index].len-this._offset:Number.POSITIVE_INFINITY}peekType(){const t=this._actions[this._index];return t?t.t:me.RETAIN}rest(){if(this.hasNext()){if(this._offset===0)return this._actions.slice(this._index);{const t=this._offset,n=this._index,r=this.next(),s=this._actions.slice(this._index);return this._offset=t,this._index=n,[r].concat(s)}}else return[]}}function tc(e,t,n){const{dataStream:r}=e,s=n,i=n+t,o=Vu(e,t,n),a=Gu(e,t,n),l=Ku(e,t,n),c=Xu(e,t,n),h=Qu(e,t,n),u=K_(e,t,n),d=X_(e,t,n);let f="";return r&&(e.dataStream=eu(r,s,i),f=r.slice(s,i)),{dataStream:f,textRuns:o,paragraphs:a,sectionBreaks:l,customBlocks:c,tables:h,customRanges:u,customDecorations:d}}function nc(e,t,n,r){e.dataStream=Zl(e.dataStream,r,t.dataStream),$u(e,t,n,r),ju(e,t,n,r),Bu(e,t,n,r),Hu(e,t,n,r),Wu(e,t,n,r),V_(e,t,n,r),G_(e,t,n,r)}function hE(e,t,n,r,s=Pe.COVER){return q_(e,t,n,r,s)}function dE(e,t,n){return t<=0?{dataStream:""}:tc(e,t,n)}function fE(e,t,n,r){n!==0&&nc(e,t,n,r)}function gE(e,t){const n=new Ln;return n.reset(),t.forEach(r=>{const s=ce.deepClone(r);switch(s.t){case me.RETAIN:{const{coverType:i,body:o,len:a}=s;o!=null&&hE(e,o,a,n.cursor,i),n.moveCursor(a);break}case me.INSERT:{const{body:i,len:o}=s;fE(e,i,o,n.cursor),n.moveCursor(o);break}case me.DELETE:{const{len:i}=s;dE(e,i,n.cursor);break}default:throw new Error(`Unknown action type for action: ${s}.`)}}),e}function pE(e,t,n,r,s){if(e==null||t==null)return t;if(e.length===0||t.length===0)return[];t=ce.deepClone(t),e=ce.deepClone(e);const i=[],o=t.length,a=e.length;let l=0,c=0,h=null;function u(){return h?(i.push(h),h=null,!0):!1}for(;l<o&&c<a;){const{st:v,ed:O,ts:T}=t[l],{st:V,ed:Y,ts:ie,sId:N}=e[c];let A={};if(s===0)A={...T},n===Pe.COVER&&r===Pe.REPLACE&&ie&&(A=Object.assign({},ie,A));else if(A={...T},n===Pe.REPLACE){if(r===Pe.REPLACE)A={...ie};else if(T&&ie){const H=Object.keys(T);for(const q of H)ie[q]&&delete A[q]}}else if(r===Pe.REPLACE){if(ie){const H=Object.keys(ie);for(const q of H)ie[q]!==void 0&&(A[q]=ie[q])}}else if(ie){const H=Object.keys(ie);for(const q of H)A[q]!==void 0&&delete A[q]}if(O<V)u()||i.push(t[l]),l++;else if(Y<v)u()||i.push(e[c]),c++;else{const H={st:Math.min(v,V),ed:Math.max(v,V),ts:v<V?{...T}:{...ie},sId:v<V?void 0:N};H.ed>H.st&&i.push(),i.push({st:Math.max(v,V),ed:Math.min(O,Y),ts:A,sId:N}),O<Y?(l++,e[c].st=O,e[c].st===e[c].ed&&c++):(c++,t[l].st=Y,t[l].st===t[l].ed&&l++);const q={st:Math.min(O,Y),ed:Math.max(O,Y),ts:O<Y?{...ie}:{...T},sId:O<Y?N:void 0};h=q.ed>q.st?q:null}}u();const d=i[i.length-1],f=t[o-1],E=e[a-1];return d.ed!==Math.max(f.ed,E.ed)&&(f.ed>E.ed?i.push(f):i.push(E)),pr(i,!0)}function mE(e,t,n,r,s){if(e==null||t==null)return t;if(e.length===0||t.length===0)return[];if(e.length>1||t.length>1)throw new Error("CustomRanges is only supported transform for length one now.");const i=e[0],o=t[0];if(n===Pe.REPLACE)return s===1?[ce.deepClone(i)]:[ce.deepClone(o)];if(r===Pe.REPLACE){const a=ce.deepClone(o);return s===1&&Object.assign(a,ce.deepClone(i)),[a]}else{const a=ce.deepClone(o);return s===1&&Object.assign(a,ce.deepClone(i)),[a]}}function la(e,t,n,r,s){const i={startIndex:t.startIndex};if(t.paragraphStyle&&(i.paragraphStyle=ce.deepClone(t.paragraphStyle),e.paragraphStyle)){if(n===Pe.REPLACE)if(r===Pe.REPLACE)s===1&&(i.paragraphStyle={...e.paragraphStyle});else if(s===1){const o=Object.keys(e.paragraphStyle);for(const a of o)e.paragraphStyle[a]!==void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else{const o=Object.keys(e.paragraphStyle);for(const a of o)i.paragraphStyle[a]===void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else if(r===Pe.REPLACE)if(s===1){const o=Object.keys(e.paragraphStyle);for(const a of o)e.paragraphStyle[a]!==void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else{const o=Object.keys(e.paragraphStyle);for(const a of o)i.paragraphStyle[a]===void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else if(s===1){const o=Object.keys(e.paragraphStyle);for(const a of o)i.paragraphStyle[a]&&delete i.paragraphStyle[a]}}return n===Pe.REPLACE&&r===Pe.REPLACE?i.bullet=s===1?ce.deepClone(e.bullet):ce.deepClone(t.bullet):e.bullet===void 0?i.bullet=ce.deepClone(t.bullet):n===Pe.REPLACE||r===Pe.REPLACE?i.bullet=s===0&&t.bullet?ce.deepClone(t.bullet):ce.deepClone(e.bullet):s===0&&t.bullet!==void 0&&(i.bullet=ce.deepClone(t.bullet)),i}function _E(e,t){if(e==null||t==null)return t;if(e.length===0||t.length===0)return ce.deepClone(t);const n=[];for(const r of t){const{id:s,type:i}=r;let o=!1;for(const a of e)if(a.id===s){(a.type===on.DELETED||i===on.DELETED)&&(o=!0,n.push({...r,type:on.DELETED}));break}o||n.push(r)}return n}function EE(e,t,n=!1){const{body:r,coverType:s=Pe.COVER}=e,{body:i,coverType:o=Pe.COVER}=t;if(r==null||r.dataStream!==""||i==null||i.dataStream!=="")throw new Error("Data stream is not supported in retain transform.");const a={dataStream:""},l=o,{textRuns:c,paragraphs:h=[],customRanges:u,customDecorations:d}=r,{textRuns:f,paragraphs:E=[],customRanges:v,customDecorations:O}=i,T=pE(c,f,s,o,n?1:0);T&&(a.textRuns=T);const V=mE(u,v,s,o,n?1:0);V&&(a.customRanges=V);const Y=_E(d,O);Y&&(a.customDecorations=Y);const ie=[];let N=0,A=0;for(;N<h.length&&A<E.length;){const H=h[N],q=E[A],{startIndex:de}=H,{startIndex:ae}=q;if(de===ae){let m={startIndex:de};n?m=la(H,q,s,o,1):m=la(H,q,s,o,0),ie.push(m),N++,A++}else de<ae?N++:(ie.push(ce.deepClone(q)),A++)}return A<E.length&&ie.push(...E.slice(A)),ie.length&&(a.paragraphs=ie),{coverType:l,body:a}}function ua(e){return Object.keys(e).length===1}const Sn=class Sn{constructor(){C(this,"_actions",[])}static apply(t,n){return gE(t,n)}static compose(t,n){const r=new _n(t),s=new _n(n),i=new Sn;for(;r.hasNext()||s.hasNext();)if(s.peekType()===me.INSERT)i.push(s.next());else if(r.peekType()===me.DELETE)i.push(r.next());else{const o=Math.min(r.peekLength(),s.peekLength()),a=r.next(o),l=s.next(o);if(a.t===me.INSERT&&l.t===me.RETAIN)l.body==null?i.push(a):i.push({...a,body:ii(a.body,l.body,l.coverType)});else if(a.t===me.RETAIN&&l.t===me.RETAIN)if(a.body==null&&l.body==null)i.push(a.len!==Number.POSITIVE_INFINITY?a:l);else if(a.body&&l.body){const c=a.coverType===Pe.REPLACE||l.coverType===Pe.REPLACE?Pe.REPLACE:Pe.COVER;i.push({...a,t:me.RETAIN,coverType:c,body:ii(a.body,l.body,l.coverType)})}else i.push(a.body?a:l);else a.t===me.RETAIN&&l.t===me.DELETE?i.push(l):a.t===me.INSERT&&(l.t,me.DELETE)}return i.trimEndUselessRetainAction(),i.serialize()}static transform(t,n,r="right"){return this._transform(n,t,r==="left"?"right":"left")}static _transform(t,n,r="right"){const s=new _n(t),i=new _n(n),o=new Sn;for(;s.hasNext()||i.hasNext();)if(s.peekType()===me.INSERT&&(r==="left"||i.peekType()!==me.INSERT)){const a=s.next();o.retain(a.len)}else if(i.peekType()===me.INSERT)o.push(i.next());else{const a=Math.min(s.peekLength(),i.peekLength()),l=s.next(a),c=i.next(a);if(l.t===me.DELETE)continue;if(c.t===me.DELETE){o.push(c);continue}if(l.body==null||c.body==null)o.push(c);else{const{coverType:h,body:u}=EE(l,c,r==="left");o.push({...c,t:me.RETAIN,coverType:h,body:u})}}return o.trimEndUselessRetainAction(),o.serialize()}static transformPosition(t,n,r=!1){const s=new _n(t);let i=0;for(;s.hasNext()&&i<=n;){const o=s.peekLength(),a=s.peekType();if(s.next(),a===me.DELETE){n-=Math.min(o,n-i);continue}else a===me.INSERT&&(i<n||!r)&&(n+=o);i+=o}return n}static isNoop(t){return t.length===0}static invert(t){const n=[];for(const r of t)if(r.t===me.INSERT)n.push({t:me.DELETE,len:r.len,body:r.body});else if(r.t===me.DELETE){if(r.body==null)throw new Error("Can not invert DELETE action without body property, makeInvertible must be called first.");n.push({t:me.INSERT,body:r.body,len:r.len})}else if(r.body!=null){if(r.oldBody==null)throw new Error("Can not invert RETAIN action without oldBody property, makeInvertible must be called first.");n.push({t:me.RETAIN,body:r.oldBody,oldBody:r.body,len:r.len,coverType:Pe.REPLACE})}else n.push(r);return n}static makeInvertible(t,n){const r=[];let s=0;for(const i of t){if(i.t===me.DELETE&&(i.body==null||i.body&&i.body.dataStream.length!==i.len)){const o=Jt(n,s,s+i.len,!1);i.len=o.dataStream.length,i.body=o}if(i.t===me.RETAIN&&i.body!=null){const o=Jt(n,s,s+i.len,!0);i.oldBody={...o,dataStream:""},i.len=o.dataStream.length}r.push(i),i.t!==me.INSERT&&(s+=i.len)}return r}insert(t,n){const r={t:me.INSERT,body:n,len:t};return this.push(r),this}retain(t,n,r){const s={t:me.RETAIN,len:t};return n!=null&&(s.body=n),r!=null&&(s.coverType=r),this.push(s),this}delete(t){const n={t:me.DELETE,len:t};return this.push(n),this}empty(){return this._actions=[],this}serialize(){return this._actions}push(...t){if(t.length>1){for(const i of t)this.push(i);return this}let n=this._actions.length,r=this._actions[n-1];const s=ce.deepClone(t[0]);if(s.t===me.RETAIN&&s.len===0&&s.body==null)return this;if(typeof r=="object"){if(r.t===me.DELETE&&s.t===me.DELETE)return r.len+=s.len,this;if(r.t===me.DELETE&&s.t===me.INSERT&&(n-=1,r=this._actions[n-1],r==null))return this._actions.unshift(s),this;if(r.t===me.RETAIN&&s.t===me.RETAIN&&r.body==null&&s.body==null)return r.len+=s.len,this;if(r.t===me.INSERT&&ua(r.body)&&s.t===me.INSERT&&ua(s.body))return r.len+=s.len,r.body.dataStream+=s.body.dataStream,this}return n===this._actions.length?this._actions.push(s):this._actions.splice(n,0,s),this}trimEndUselessRetainAction(){let t=this._actions[this._actions.length-1];for(;t&&t.t===me.RETAIN&&cE(t);)this._actions.pop(),t=this._actions[this._actions.length-1];return this}};C(Sn,"id","text-x"),C(Sn,"uri","https://github.com/dream-num/univer#text-x");let nt=Sn;Object.defineProperty(nt,"name",{value:"text-x"});const yn=class yn{static registerSubtype(t){var n;t==null||this._subTypes.has(t.name)&&((n=this._subTypes.get(t.name))==null?void 0:n.id)!==nt.id||(this._subTypes.set(t.name,t),pt.type.registerSubtype(t))}static apply(t,n){if(!pt.type.isNoop(n))return pt.type.apply(t,n)}static compose(t,n){return pt.type.compose(t,n)}static transform(t,n,r){return pt.type.transform(t,n,r)}static transformPosition(t,n,r="right"){return t&&t.length===2&&t[0]==="body"&&t[1].et===nt.name?nt.transformPosition(t[1].e,n,r==="left"):n}static invertWithDoc(t,n){return pt.type.invertWithDoc(t,n)}static isNoop(t){return pt.type.isNoop(t)}static getInstance(){return this._instance==null&&(this._instance=new yn),this._instance}removeOp(t,n){return pt.removeOp(t,n)}moveOp(t,n){return pt.moveOp(t,n)}insertOp(t,n){return pt.insertOp(t,n)}replaceOp(t,n,r){return pt.replaceOp(t,n,r)}editOp(t,n=["body"]){return pt.editOp(n,nt.name,t)}};C(yn,"uri","https://github.com/dream-num/univer#json-x"),C(yn,"_subTypes",new Map),C(yn,"_instance",null);let kt=yn;kt.registerSubtype(nt);const Hi={id:"default_doc",documentStyle:{}};class vE extends ms{constructor(n){var r;super();C(this,"type",$e.UNIVER_DOC);C(this,"_name$",new ye.BehaviorSubject(""));C(this,"name$",this._name$.asObservable());C(this,"snapshot");this.snapshot={...Hi,...n},this._name$.next((r=this.snapshot.title)!=null?r:"No Title")}getUnitId(){throw new Error("Method not implemented.")}getRev(){var n;return(n=this.snapshot.rev)!=null?n:1}incrementRev(){this.snapshot.rev=this.getRev()+1}setRev(n){this.snapshot.rev=n}setName(n){this.snapshot.title=n,this._name$.next(n)}get drawings(){return this.snapshot.drawings}get documentStyle(){return this.snapshot.documentStyle}get lists(){return this.snapshot.lists}get zoomRatio(){var n;return((n=this.snapshot.settings)==null?void 0:n.zoomRatio)||1}resetDrawing(n,r){this.snapshot.drawings=n,this.snapshot.drawingsOrder=r}getBody(){return this.snapshot.body}getSnapshot(){return this.snapshot}getBulletPresetList(){var s;const n=(s=this.snapshot.lists)!=null?s:{};return{...mr,...n}}updateDocumentId(n){this.snapshot.id=n}updateDocumentRenderConfig(n){const{documentStyle:r}=this.snapshot;r.renderConfig==null?r.renderConfig=n:r.renderConfig={...r.renderConfig,...n}}updateDocumentStyle(n){this.snapshot.documentStyle==null?this.snapshot.documentStyle=n:this.snapshot.documentStyle={...this.snapshot.documentStyle,...n}}updateDocumentDataMargin(n){const{t:r,l:s,b:i,r:o}=n,{documentStyle:a}=this.snapshot;r!=null&&(a.marginTop=r),s!=null&&(a.marginLeft=s),i!=null&&(a.marginBottom=i),o!=null&&(a.marginRight=o)}updateDocumentDataPageSize(n,r){const{documentStyle:s}=this.snapshot;if(!s.pageSize){n=n!=null?n:Number.POSITIVE_INFINITY,r=r!=null?r:Number.POSITIVE_INFINITY,s.pageSize={width:n,height:r};return}n!==void 0&&(s.pageSize.width=n),r!==void 0&&(s.pageSize.height=r)}updateDrawing(n,r){const{drawings:s}=this,{width:i,height:o,left:a,top:l}=r,c=s==null?void 0:s[n];if(!c)return;const h=c.docTransform;h.size.width=i,h.size.height=o,h.positionH.posOffset=a,h.positionV.posOffset=l}setZoomRatio(n=1){this.snapshot.settings==null?this.snapshot.settings={zoomRatio:n}:this.snapshot.settings.zoomRatio=1}}class $t extends vE{constructor(n){var s,i;super(ce.isEmptyObject(n)?F_():n);C(this,"_unitId");C(this,"headerModelMap",new Map);C(this,"footerModelMap",new Map);const r=6;this._unitId=(s=this.snapshot.id)!=null?s:ce.generateRandomId(r),this._initializeHeaderFooterModel(),this._name$.next((i=this.snapshot.title)!=null?i:"")}dispose(){super.dispose(),this.headerModelMap.forEach(n=>{n.dispose()}),this.footerModelMap.forEach(n=>{n.dispose()}),this._name$.complete()}getDrawings(){return this.snapshot.drawings}getDrawingsOrder(){return this.snapshot.drawingsOrder}getCustomRanges(){var n;return(n=this.snapshot.body)==null?void 0:n.customRanges}getCustomDecorations(){var n;return(n=this.snapshot.body)==null?void 0:n.customDecorations}getSettings(){return this.snapshot.settings}reset(n){if(n.id&&n.id!==this._unitId)throw new Error("Cannot reset a document model with a different unit id!");this.snapshot={...Hi,...n},this._initializeHeaderFooterModel()}getSelfOrHeaderFooterModel(n){if(n!=null){if(this.headerModelMap.has(n))return this.headerModelMap.get(n);if(this.footerModelMap.has(n))return this.footerModelMap.get(n)}return this}getUnitId(){return this._unitId}apply(n){if(!kt.isNoop(n))return this.snapshot=kt.apply(this.snapshot,n),n!=null&&n.some(r=>Array.isArray(r)&&((r==null?void 0:r[0])==="headers"||(r==null?void 0:r[0])==="footers"))&&(this.headerModelMap.clear(),this.footerModelMap.clear(),this._initializeHeaderFooterModel()),this.snapshot}sliceBody(n,r,s=Bi.copy){const i=this.getBody();if(i!=null)return Jt(i,n,r,!1,s)}_initializeHeaderFooterModel(){const{headers:n,footers:r}=this.getSnapshot();if(n)for(const s in n){const i=n[s];this.headerModelMap.set(s,new $t(i)),this.headerModelMap.get(s).updateDocumentId(this.getUnitId())}if(r)for(const s in r){const i=r[s];this.footerModelMap.set(s,new $t(i)),this.footerModelMap.get(s).updateDocumentId(this.getUnitId())}}updateDocumentId(n){super.updateDocumentId(n),this._unitId=n}}const CE="0.5.3";function RE(e="",t=hr.ZH_CN,n=""){return{id:e,sheetOrder:[],name:n,appVersion:CE,locale:t,styles:{},sheets:{},resources:[]}}class rc{constructor(t={}){C(this,"_styles");C(this,"_cacheMap",new er(1e5));this._styles=t,this._generateCacheMap()}each(t){return Object.entries(this._styles).forEach(t),this}search(t,n){if(this._cacheMap.has(n))return this._cacheMap.get(n);const r=this._getExistingStyleId(t);return r||"-1"}get(t){return typeof t!="string"?t:(t=String(t),this._styles[t])}add(t,n){const r=ce.generateRandomId(6);return this._styles[r]=t,this._cacheMap.set(n,r),r}setValue(t){if(t==null)return;const n=JSON.stringify(t),r=this.search(t,n);return r!=="-1"?r:this.add(t,n)}toJSON(){return this._styles}getStyleByCell(t){let n;t&&ce.isObject(t.s)?n=t.s:n=(t==null?void 0:t.s)&&this.get(t.s);const r=t==null?void 0:t.interceptorStyle;return r?{...n,...r}:n}_generateCacheMap(){const{_styles:t,_cacheMap:n}=this;for(const r in t){const s=JSON.stringify(t[r]);n.set(s,r)}}_getExistingStyleId(t){const{_styles:n}=this;for(const r in n)if(ce.diffValue(n[r],t))return r;return null}}function IE(e){const{ranges:t,id:n,type:r}=e,s=new nt;let i=0;for(let o=0;o<t.length;o++){const a=t[o],{startOffset:l,endOffset:c}=a;l>0&&s.push({t:me.RETAIN,len:l-i}),s.push({t:me.RETAIN,body:{dataStream:"",customDecorations:[{id:n,type:r,startIndex:0,endIndex:c-l-1}]},len:c-l}),i=c}return s}function SE(e){var h,u,d;const{id:t,segmentId:n,documentDataModel:r}=e,s=r==null?void 0:r.getBody();if(!r||!s)return!1;const i=(d=(u=(h=r.getSelfOrHeaderFooterModel(n))==null?void 0:h.getBody())==null?void 0:u.customDecorations)==null?void 0:d.find(f=>f.id===t);if(!i)return!1;const o=new nt,{startIndex:a,endIndex:l}=i,c=l-a+1;return o.push({t:me.RETAIN,len:a}),o.push({t:me.RETAIN,len:c,body:{dataStream:"",customDecorations:[{startIndex:0,endIndex:c-1,id:t,type:on.DELETED}]}}),o}function sc(e,t,n,r){return e<=n&&t>=n||e>=n&&e<=r}function yE(e,t){const n=[];for(let r=0,s=t.length;r<s;r++){const i=t[r];e.collapsed?i.startIndex<e.startOffset&&e.startOffset<=i.endIndex&&n.push(i):sc(e.startOffset,e.endOffset-1,i.startIndex,i.endIndex)&&n.push(i)}return n}function OE(e){return{...ce.deepClone(e),rangeId:un()}}function wE(e,t){const n=[];let r=e[0];for(const s of t)s<e[0]||s>e[1]||(r<s&&n.push([r,s-1]),r=s+1);return r<=e[1]&&n.push([r,e[1]]),n}function ic(e,t,n,r){const s=[];for(let i=0,o=n.length;i<o;i++){const a=n[i];if((r===void 0||a.rangeType===r)&&Math.max(a.startIndex,e)<=Math.min(a.endIndex,t)&&s.push({...a}),a.startIndex>t)break}return s}function bE(e,t){var i,o,a,l,c;const n=ic(e.startOffset,e.collapsed?e.startOffset:e.endOffset-1,(i=t.customRanges)!=null?i:[]),r=Math.min(e.startOffset,(a=(o=n[0])==null?void 0:o.startIndex)!=null?a:1/0),s=Math.max(e.endOffset,((c=(l=n[n.length-1])==null?void 0:l.endIndex)!=null?c:-1/0)+1);return{startOffset:r,endOffset:s,collapsed:r===s}}function AE(e,t){var d,f,E;const{rangeId:n,segmentId:r,documentDataModel:s,insert:i}=t,o=(f=(d=s.getSelfOrHeaderFooterModel(r).getBody())==null?void 0:d.customRanges)==null?void 0:f.find(v=>v.rangeId===n);if(!o)return!1;const{startIndex:a,endIndex:l}=o,c=new nt,h=l-a+1;c.push({t:me.RETAIN,len:a}),c.push({t:me.RETAIN,len:h,body:{dataStream:"",customRanges:[]}}),i&&c.push({t:me.INSERT,body:i,len:i.dataStream.length});const u=l+1+((E=i==null?void 0:i.dataStream.length)!=null?E:0);return c.selections=[{startOffset:u,endOffset:u,collapsed:!0}],c}function TE(e){const{ranges:t,rangeId:n,rangeType:r,wholeEntity:s,properties:i,body:o}=e;let a=0;const l=new nt;let c=!1;return t.forEach(h=>{var Y,ie,N;const u=bE(h,o);if(!u||!o)return!1;const{startOffset:d,endOffset:f}=u,E=(Y=o.customRanges)!=null?Y:[],v=(A,H,q)=>{var S,D,w,y;const de=ic(A,H,E,r),ae=Math.min((D=(S=de[0])==null?void 0:S.startIndex)!=null?D:1/0,A),m=Math.max((y=(w=de[de.length-1])==null?void 0:w.endIndex)!=null?y:-1/0,H),B={rangeId:q?`${n}$${q}`:n,rangeType:r,startIndex:0,endIndex:m-ae,wholeEntity:s,properties:{...i}};l.push({t:me.RETAIN,len:ae-a}),l.push({t:me.RETAIN,len:m-ae+1,body:{dataStream:"",customRanges:[B]},coverType:Pe.COVER}),a=m+1},O=((ie=o.paragraphs)!=null?ie:[]).filter(A=>A.startIndex<f&&A.startIndex>d),T=((N=o.customBlocks)!=null?N:[]).filter(A=>A.startIndex<f&&A.startIndex>d);wE([d,f-1],[...O.map(A=>A.startIndex),...T.map(A=>A.startIndex)]).forEach(([A,H],q)=>v(A,H,q)),c=!0,l.selections=[{startOffset:u.endOffset,endOffset:u.endOffset,collapsed:!0}]}),c?l:!1}function oc(e,t,n=0,r=null,s=!0){e.sort((c,h)=>c.startOffset-h.startOffset);const i=[],{paragraphs:o=[]}=t,a=o==null?void 0:o.find(c=>c.startIndex>=e[0].startOffset&&c.startIndex<e[0].endOffset);let l=n;if(e.forEach(c=>{const{startOffset:h,endOffset:u}=c;h>l&&(i.push({t:me.RETAIN,len:h-l}),l=h),l<u&&(i.push({t:me.DELETE,len:u-l}),l=u)}),r&&i.push({t:me.INSERT,body:r,len:r.dataStream.length}),a&&s){const c=o.find(h=>h.startIndex-n>=e[e.length-1].endOffset-1);c&&(c.startIndex>l&&(i.push({t:me.RETAIN,len:c.startIndex-l}),l=c.startIndex),i.push({t:me.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...c,startIndex:0,bullet:a==null?void 0:a.bullet}]},coverType:Pe.REPLACE}))}return i}const NE=e=>{var u;const{selection:t,body:n,doc:r}=e,s=t.segmentId,i=(u=r.getSelfOrHeaderFooterModel(s))==null?void 0:u.getBody();if(!i)return!1;const o=t.collapsed?null:Jt(i,t.startOffset,t.endOffset),a=Ya(o?o.dataStream:"",n.dataStream);let l=0;const c=a.map(([d,f])=>{switch(d){case 0:{const E={t:me.RETAIN,body:{...Jt(n,l,l+f.length,!1),dataStream:""},len:f.length};return l+=f.length,E}case 1:{const E={t:me.INSERT,body:Jt(n,l,l+f.length),len:f.length};return l+=f.length,E}default:return{t:me.DELETE,len:f.length}}}),h=new nt;return h.push({t:me.RETAIN,len:t.startOffset}),h.push(...c),h};function ME(e,t){const n=[],{customBlocks:r=[]}=e;for(const s of t){const{startOffset:i,endOffset:o}=s;if(!(i==null||o==null))for(const a of r){const{startIndex:l}=a;l>=i&&l<o&&n.push(a.blockId)}}return n}function DE(e,t=""){if(!t)return["body"];const{headers:n,footers:r}=e.getSnapshot();if(n==null&&r==null)throw new Error("Document data model must have headers or footers when update by segment id");if((n==null?void 0:n[t])!=null)return["headers",t,"body"];if((r==null?void 0:r[t])!=null)return["footers",t,"body"];throw new Error("Segment id not found in headers or footers")}const xE=e=>{var v,O,T,V;const{selection:t,documentDataModel:n,drawings:r}=e,{collapsed:s,startOffset:i,segmentId:o}=t,a=new nt,l=kt.getInstance(),c=[],h=n.getSelfOrHeaderFooterModel(o).getBody();if(!h)return!1;const u=(O=(v=n.getSnapshot().drawingsOrder)==null?void 0:v.length)!=null?O:0;let d=0;if(s)i>0&&a.push({t:me.RETAIN,len:i});else{const Y=oc([t],h,0,null,!1);a.push(...Y);const ie=ME(h,[t]),N=(T=n.getDrawings())!=null?T:{},A=(V=n.getDrawingsOrder())!=null?V:[],H=ie.sort((q,de)=>A.indexOf(q)>A.indexOf(de)?-1:A.indexOf(q)<A.indexOf(de)?1:0);if(H.length>0)for(const q of H){const de=N[q],ae=A.indexOf(q);if(de==null||ae<0)continue;const m=l.removeOp(["drawings",q],de),B=l.removeOp(["drawingsOrder",ae],q);c.push(m),c.push(B),d++}}a.push({t:me.INSERT,body:{dataStream:"\b".repeat(r.length),customBlocks:r.map((Y,ie)=>({startIndex:ie,blockId:Y.drawingId}))},len:r.length});const f=DE(n,o),E=l.editOp(a.serialize(),f);c.push(E);for(const Y of r){const{drawingId:ie}=Y,N=l.insertOp(["drawings",ie],Y),A=l.insertOp(["drawingsOrder",u-d],ie);c.push(N),c.push(A)}return c.reduce((Y,ie)=>kt.compose(Y,ie),null)},LE=e=>{var u,d,f;const{paragraphs:t,segmentId:n,document:r}=e;let s=e.listType;const i=(d=(u=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:u.paragraphs)!=null?d:[],o=t.every(E=>{var v;return((v=E.bullet)==null?void 0:v.listType.indexOf(s))===0});let l=ce.generateRandomId(6);if(t.length===1){const E=i.indexOf(t[0]),v=i[E-1],O=i[E+1];v&&v.bullet&&v.bullet.listType.indexOf(s)===0?(l=v.bullet.listId,s!==Lt.CHECK_LIST&&(s=v.bullet.listType)):O&&O.bullet&&O.bullet.listType.indexOf(s)===0&&(l=O.bullet.listId,s!==Lt.CHECK_LIST&&(s=O.bullet.listType))}const c=new Ln;c.reset();const h=new nt;for(const E of t){const{startIndex:v,paragraphStyle:O={},bullet:T}=E;h.push({t:me.RETAIN,len:v-c.cursor}),h.push({t:me.RETAIN,len:1,body:{dataStream:"",paragraphs:[o?{paragraphStyle:O,startIndex:0}:{startIndex:0,paragraphStyle:{...O},bullet:{nestingLevel:(f=T==null?void 0:T.nestingLevel)!=null?f:0,textStyle:{fs:20},listType:s,listId:l}}]},coverType:Pe.REPLACE}),c.moveCursorTo(v+1)}return h},UE=e=>{var u;const{paragraphIndex:t,segmentId:n,document:r}=e,s=(u=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:u.paragraphs;if(s==null)return!1;const i=s.find(d=>d.startIndex===t);if(!(i!=null&&i.bullet)||i.bullet.listType.indexOf(Lt.CHECK_LIST)===-1)return!1;const o=new Ln;o.reset();const a=new nt,{startIndex:l,paragraphStyle:c={}}=i,h=i.bullet.listType===Lt.CHECK_LIST?Lt.CHECK_LIST_CHECKED:Lt.CHECK_LIST;return a.push({t:me.RETAIN,len:l-o.cursor}),a.push({t:me.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...i,paragraphStyle:c,startIndex:0,bullet:{...i.bullet,listType:h}}]},coverType:Pe.REPLACE}),o.moveCursorTo(l+1),a},PE=e=>{var h,u;const{paragraphs:t,listType:n,segmentId:r,document:s}=e;if(((h=s.getSelfOrHeaderFooterModel(r).getBody())==null?void 0:h.paragraphs)==null)return!1;const a=ce.generateRandomId(6),l=new Ln;l.reset();const c=new nt;for(const d of t){const{startIndex:f,paragraphStyle:E={},bullet:v}=d;c.push({t:me.RETAIN,len:f-l.cursor}),c.push({t:me.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:E,bullet:{nestingLevel:(u=v==null?void 0:v.nestingLevel)!=null?u:0,textStyle:(v==null?void 0:v.listType)===n?v.textStyle:{fs:20},listType:n,listId:a}}]},coverType:Pe.REPLACE}),l.moveCursorTo(f+1)}return c};function FE(e,t){return t.some(n=>e.startIndex>n.startIndex&&e.startIndex<n.endIndex)}const kE=e=>{var h,u,d;const{paragraphs:t,segmentId:n,document:r,type:s}=e,i=new Ln;i.reset();const o=new nt,a=(h=r.getSnapshot().lists)!=null?h:{},l=(d=(u=r.getBody())==null?void 0:u.tables)!=null?d:[],c={...mr,...a};for(const f of t){const{startIndex:E,paragraphStyle:v={},bullet:O}=f,T=FE(f,l);if(o.push({t:me.RETAIN,len:E-i.cursor}),O){const V=O.listType;let Y=c[V].nestingLevel.length-1;T&&(Y=Math.min(Y,2)),o.push({t:me.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:{...v},bullet:{...O,nestingLevel:Math.max(Math.min(O.nestingLevel+s,Y),0)}}]},coverType:Pe.REPLACE})}else o.push({t:me.RETAIN,len:1});i.moveCursorTo(E+1)}return o};var ac=(e=>(e.PARAGRAPH="PARAGRAPH",e.SECTION_BREAK="SECTION_BREAK",e.TABLE="TABLE",e.TABLE_ROW="TABLE_ROW",e.TABLE_CELL="TABLE_CELL",e.CUSTOM_BLOCK="CUSTOM_BLOCK",e))(ac||{}),zt=(e=>(e.PARAGRAPH="\r",e.SECTION_BREAK=`
|
|
9
|
-
`,e.TABLE_START="",e.TABLE_ROW_START="\x1B",e.TABLE_CELL_START="",e.TABLE_CELL_END="",e.TABLE_ROW_END="",e.TABLE_END="",e.CUSTOM_RANGE_START="",e.CUSTOM_RANGE_END="",e.COLUMN_BREAK="\v",e.PAGE_BREAK="\f",e.DOCS_END="\0",e.TAB=" ",e.CUSTOM_BLOCK="\b",e.LETTER="",e.SPACE=" ",e))(
|
|
10
|
-
`)?e.slice(0,-2):e;return jE.reduce((n,r)=>n.replaceAll(r,""),t)},BE=e=>e?lc(e).replaceAll("\r","")==="":!0,HE=e=>{const t=e.replace(/\n/g,"\r"),n=[],r=[];let s=0,i="";const o=(l,c=!0)=>{const h=t.slice(s,l);if(ce.isLegalUrl(h)){const u=un(),d=`${h}`,f={startIndex:s,endIndex:s+d.length-1,rangeId:u,rangeType:tr.HYPERLINK,properties:{url:e}};r.push(f),i+=d,s=l+1,c&&(i+="\r",n.push({startIndex:l}))}else i+=t.slice(s,l+1),s=l+1,c&&n.push({startIndex:l})};let a=0;for(let l=0;l<t.length;l++)t[l]==="\r"&&(o(l),a=l);return(a!==t.length-1||t.length===1)&&o(t.length,!1),{dataStream:i,paragraphs:n,customRanges:r}};function WE(e,t){if(typeof t>"u")return{startOffset:e,endOffset:e,collapsed:!0};if(t<e)throw new Error(`Cannot make a doc selection when endOffset ${t} is less than startOffset ${e}.`);return{startOffset:e,endOffset:t,collapsed:e===t}}function YE(e){const{startOffset:t,endOffset:n,collapsed:r}=e,s=Math.min(t,n),i=Math.max(t,n);return{startOffset:s,endOffset:i,collapsed:r}}function zE(e,t,n,r){return Math.max(e,n)<=Math.min(t,r)}class wt{}C(wt,"customRange",{add:TE,delete:AE,copyCustomRange:OE,getCustomRangesInterestsWithSelection:yE,isIntersecting:sc}),C(wt,"customDecoration",{add:IE,delete:SE}),C(wt,"selection",{replace:NE,makeSelection:WE,normalizeSelection:YE,delete:oc}),C(wt,"range",{isIntersects:zE}),C(wt,"transform",{getPlainText:lc,fromPlainText:HE,isEmptyDocument:BE}),C(wt,"paragraph",{bullet:{set:PE,switch:LE,toggleChecklist:UE,changeNestLevel:kE}}),C(wt,"drawing",{add:xE});const VE=(e,t)=>t.length===e.length&&!e.some(n=>t.some(r=>!qt.equals(r,n))),GE=(e,t)=>t.length===e.length&&e.every((n,r)=>{const s=t[r];return s.unitId===n.unitId&&s.sheetId===n.sheetId&&qt.equals(n.range,s.range)}),oi={t:0,b:2,l:2,r:2},KE=e=>({sbr:.6,sbo:e,spr:.6,spo:e}),ca=90;function Hn(e,t,n={}){const r=e.length,{textRotation:s,paddingData:i,horizontalAlign:o=Gt.UNSPECIFIED,verticalAlign:a=sn.UNSPECIFIED,wrapStrategy:l=ln.UNSPECIFIED,cellValueType:c}=n,{t:h,r:u,b:d,l:f}=i||oi,{vertexAngle:E,centerAngle:v}=hc(s),O={id:"d",body:{dataStream:`${e}${Va}`,textRuns:[{ts:t,st:0,ed:r}],paragraphs:[{startIndex:r,paragraphStyle:{horizontalAlign:o}}],sectionBreaks:[{startIndex:r+1}]},documentStyle:{pageSize:{width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},marginTop:h,marginBottom:d,marginRight:u,marginLeft:f,renderConfig:{horizontalAlign:o,verticalAlign:a,centerAngle:v,vertexAngle:E,wrapStrategy:l,cellValueType:c,zeroWidthParagraphBreak:1}},drawings:{},drawingsOrder:[]};return new $t(O)}function XE(e){if(!e)return{};const{tr:t,td:n,ht:r,vt:s,tb:i,pd:o}=e;return{textRotation:t,textDirection:n,horizontalAlign:r,verticalAlign:s,wrapStrategy:i,paddingData:o}}function ha(e){if(!e)return{};const{ff:t,fs:n,it:r,bl:s,ul:i,st:o,ol:a,cl:l}=e,c={};return t&&(c.ff=t),n&&(c.fs=n),r&&(c.it=r),s&&(c.bl=s),i&&(c.ul=i),o&&(c.st=o),a&&(c.ol=a),l&&(c.cl=l),c}function uc(e,t,n){var i;const r=e.getBody();if((i=r.customRanges)!=null&&i.some(o=>o.rangeType===tr.HYPERLINK))return;const s=wt.customRange.add({ranges:[{startOffset:0,endOffset:r.dataStream.length-1,collapsed:!1}],rangeId:n,rangeType:tr.HYPERLINK,body:r,properties:{url:t,refId:n}});s&&nt.apply(r,s.serialize())}function cc(e){return e!=null}const QE='"Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif';function da(e){const t=ut.ff,n=ut.fs;if(!e){const u=`${n}pt ${t}`;return{fontCache:u,fontString:u,fontSize:n,originFontSize:n,fontFamily:t}}let r=Rn.ITALIC;(e.it===0||e.it===void 0)&&(r=Rn.NORMAL);let s=Rn.BOLD;(e.bl===0||e.bl===void 0)&&(s=Rn.NORMAL);let i=n;e.fs&&(i=Math.ceil(e.fs));let o=t;if(e.ff){let u=e.ff;u=u.replace(/"/g,"").replace(/'/g,""),u.indexOf(" ")>-1&&(u=`"${u}"`),u==null&&(u=t),o=u}const{va:a}=e;let l=i;if(a===Ft.SUBSCRIPT||a===Ft.SUPERSCRIPT){const u=JE(o,l),{sbr:d,spr:f}=u;l*=a===Ft.SUBSCRIPT?d:f}const c=`${r} ${s} ${l}pt ${o}`,h=`${c}, ${QE} `;return{fontCache:c,fontString:h,fontSize:l,originFontSize:i,fontFamily:o}}function JE(e,t){return KE(t)}function hc(e){const{a:t=0,v:n=xe.FALSE}=e||{a:0,v:xe.FALSE};let r=0,s=t;return n===xe.TRUE&&(r=ca,s=ca),{centerAngle:r,vertexAngle:s}}class qE{constructor(t,n){C(this,"_columnData",{});this._config=t,this._columnData=n}getColumnData(){return this._columnData}getColVisible(t){const{_columnData:n}=this,r=n[t];return r?r.hd!==xe.TRUE:!0}getColumnStyle(t){var n;return(n=this._columnData[t])==null?void 0:n.s}setColumnStyle(t,n){const r=this.getColumnOrCreate(t);r.s=n}getHiddenCols(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getColVisible(o);s&&a?(s=!1,r.push({rangeType:De.COLUMN,startColumn:i,endColumn:o-1,startRow:0,endRow:0})):!s&&!a&&(s=!0,i=o)}return s&&r.push({startRow:0,endRow:0,startColumn:i,endColumn:n,rangeType:De.COLUMN}),r}getVisibleCols(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getColVisible(o);s&&!a?(s=!1,r.push({rangeType:De.COLUMN,startColumn:i,endColumn:o-1,startRow:0,endRow:0})):!s&&a&&(s=!0,i=o)}return s&&r.push({startRow:0,endRow:0,startColumn:i,endColumn:n,rangeType:De.COLUMN}),r}getColumnDatas(t,n){const r={};let s=0;for(let i=t;i<t+n;i++){const o=this.getColumnOrCreate(i);r[s]=o,s++}return r}getSize(){return Qt(this._columnData)}getColumnWidth(t){const{_columnData:n}=this,r=this._config;let s=0;return s=(n[t]||{hd:xe.FALSE,w:r.defaultColumnWidth}).w||r.defaultColumnWidth,s}getColumn(t){const n=this._columnData[t];if(n)return n}removeColumn(t){delete this._columnData[t]}getColumnOrCreate(t){const{_columnData:n}=this,r=n[t];if(r)return r;const s={};return this._columnData[t]=s,s}}class ZE{constructor(t,n,r){C(this,"_rowData");this._config=t,this._viewModel=n,this._rowData=r}getRowData(){return this._rowData}getRowStyle(t){var n;return(n=this._rowData[t])==null?void 0:n.s}setRowStyle(t,n){const r=this.getRowOrCreate(t);r.s=n}getRowDatas(t,n){const r={};let s=0;for(let i=t;i<t+n;i++){const o=this.getRowOrCreate(i);r[s]=o,s++}return r}getRowHeight(t,n=1){const{_rowData:r}=this,s=this._config;let i=0;for(let o=0;o<n;o++){const a=r[o+t]||{hd:xe.FALSE,h:s.defaultRowHeight},{ia:l,ah:c,h=s.defaultRowHeight}=a;i+=(l==null||l===xe.TRUE)&&typeof c=="number"?c:h}return i}getRow(t){return this._rowData[t]}removeRow(t){delete this._rowData[t]}getRowOrCreate(t){const{_rowData:n}=this,r=n[t];if(r)return r;const s={};return n[t]=s,s}getHiddenRows(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getRowRawVisible(o);s&&a?(s=!1,r.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:De.ROW})):!s&&!a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:n,startColumn:0,endColumn:0,rangeType:De.ROW}),r}getVisibleRows(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getRowRawVisible(o);s&&!a?(s=!1,r.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:De.ROW})):!s&&a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:n,startColumn:0,endColumn:0,rangeType:De.ROW}),r}getRowRawVisible(t){const n=this.getRow(t);return n?n.hd!==xe.TRUE:!0}getSize(){return Qt(this._rowData)}}const e0="DEFAULT_WORKSHEET_ROW_COUNT",dc=1e3,t0="DEFAULT_WORKSHEET_COLUMN_COUNT",fc=20,n0="DEFAULT_WORKSHEET_ROW_HEIGHT",gc=24,r0="DEFAULT_WORKSHEET_COLUMN_WIDTH",pc=88,s0="DEFAULT_WORKSHEET_ROW_TITLE_WIDTH",mc=46,i0="DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT",_c=20;function Ec(e){const t={name:"Sheet1",id:"sheet-01",tabColor:"",hidden:xe.FALSE,rowCount:dc,columnCount:fc,zoomRatio:1,freeze:{xSplit:0,ySplit:0,startRow:-1,startColumn:-1},scrollTop:0,scrollLeft:0,defaultColumnWidth:pc,defaultRowHeight:gc,mergeData:[],cellData:{},rowData:{},columnData:{},showGridlines:xe.TRUE,rowHeader:{width:mc,hidden:xe.FALSE},columnHeader:{height:_c,hidden:xe.FALSE},rightToLeft:xe.FALSE};return Object.keys(t).forEach(n=>{const r=n;typeof e[r]>"u"&&(e[r]=t[r])}),e}class o0 extends tt{constructor(n){super();C(this,"_cellCache",new Map);C(this,"_rowCache",new Map);C(this,"_columnCache",new Map);C(this,"_hasRow",!1);C(this,"_hasColumn",!1);C(this,"_hasAll",!1);C(this,"_allIndex",-1);C(this,"_mergeData");C(this,"_rangeMap",new er(5e4));C(this,"_skeletonCache",new er(5e4));this._init(n.concat())}_init(n){this._mergeData=n,this._createCache(n)}_clearCache(){this._cellCache.clear(),this._rowCache.clear(),this._columnCache.clear(),this._hasAll=!1,this._allIndex=-1,this._rangeMap.clear(),this._skeletonCache.clear(),this._hasColumn=!1,this._hasRow=!1}_createCache(n){let r=0;for(const s of n){const{rangeType:i}=s;i===De.ROW?this._createRowCache(s,r):i===De.COLUMN?this._createColumnCache(s,r):i===De.ALL?this._createCellAllCache(r):this._createCellCache(s,r),r++}}rebuild(n){this._clearCache(),this._init(n.concat())}_createRowCache(n,r){const{startRow:s,endRow:i}=n;for(let o=s;o<=i;o++)this._rowCache.set(o,r),this._hasRow=!0}_createColumnCache(n,r){const{startColumn:s,endColumn:i}=n;for(let o=s;o<=i;o++)this._columnCache.set(o,r),this._hasColumn=!0}_createCellAllCache(n){this._hasAll=!0,this._allIndex=n}_createCellCache(n,r){for(let s=n.startRow;s<=n.endRow;s++){let i=this._cellCache.get(s);i==null&&(i=new Map,this._cellCache.set(s,i));for(let o=n.startColumn;o<=n.endColumn;o++)i.set(o,r)}}add(n){this._mergeData.push(n),this._clearCache(),this._createCache(this._mergeData)}remove(n,r){const s=this._getMergeDataIndex(n,r);s!==-1&&(this._mergeData.splice(s,1),this._clearCache(),this._createCache(this._mergeData))}getMergedCell(n,r){const s=this._getMergeDataIndex(n,r);return s!==-1?this._mergeData[s]:null}getMergeDataIndex(n,r){return this._getMergeDataIndex(n,r)}isRowContainsMergedCell(n){return this._hasAll||!ce.isEmptyObject(this._columnCache)?!0:this._mergeData.some(r=>r.startRow<=n&&n<=r.endRow)}isColumnContainsMergedCell(n){return this._hasAll||!ce.isEmptyObject(this._rowCache)?!0:this._mergeData.some(r=>r.startColumn<=n&&n<=r.endColumn)}getMergedCellRange(n,r,s,i){const o=[],a=`${n}-${r}-${s}-${i}`;if(this._rangeMap.has(a))return this._getRangeFromCache(a);let l=0;const c=[];for(const h of this._mergeData||[])qt.intersects(h,{startRow:n,endRow:s,startColumn:r,endColumn:i})&&(o.push({...h}),c.push(l)),l++;return this._rangeMap.set(a,c),o}getMergedCellRangeForSkeleton(n,r,s,i){const o=[],a=this._mergeData,l=`${n}-${r}-${s}-${i}`;if(this._skeletonCache.has(l))return this._getSkeletonRangeFromCache(l);const c=[];for(let h=0;h<a.length;h++){const{startRow:u,endRow:d,startColumn:f,endColumn:E}=a[h];for(let v=n;v<=s;v++){let O=!1;for(let T=r;T<=i;T++)if(v>=u&&v<=d&&T>=f&&T<=E){o.push({startRow:u,endRow:d,startColumn:f,endColumn:E}),c.push(h),O=!0;break}if(O)break}}return this._skeletonCache.set(l,c),o}_getRangeFromCache(n){const r=this._rangeMap.get(n)||[],s=[];for(const i of r)s.push({...this._mergeData[i]});return s}_getSkeletonRangeFromCache(n){const r=this._skeletonCache.get(n)||[],s=[];for(const i of r)s.push({...this._mergeData[i]});return s}_getMergeDataIndex(n,r){var i;if(this._hasAll)return this._allIndex;if(this._hasRow){const o=this._rowCache.get(n);if(o!==void 0)return o}if(this._hasColumn){const o=this._columnCache.get(r);if(o!==void 0)return o}const s=(i=this._cellCache.get(n))==null?void 0:i.get(r);return s!==void 0?s:-1}getMergeDataSnapshot(){return this._mergeData}dispose(){this._clearCache(),this._mergeData=[]}}class vc extends tt{constructor(n){super();C(this,"_cellContentInterceptor",null);C(this,"_rowFilteredInterceptor",null);this.getRawCell=n}dispose(){super.dispose(),this._cellContentInterceptor=null,this._rowFilteredInterceptor=null}getCell(n,r,s,i){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,vn.Value|vn.Style,s,i):this.getRawCell(n,r)}getCellValueOnly(n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,vn.Value):this.getRawCell(n,r)}getCellStyleOnly(n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,vn.Style):this.getRawCell(n,r)}getRowFiltered(n){var r,s;return(s=(r=this._rowFilteredInterceptor)==null?void 0:r.getRowFiltered(n))!=null?s:!1}registerCellContentInterceptor(n){if(this._cellContentInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._cellContentInterceptor=n,Xe(()=>this._cellContentInterceptor=null)}registerRowFilteredInterceptor(n){if(this._rowFilteredInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._rowFilteredInterceptor=n,Xe(()=>this._rowFilteredInterceptor=null)}}const fa={isDeepClone:!1,displayRawFormula:!1,ignoreTextRotation:!1};class nr{constructor(t,n,r){C(this,"_sheetId");C(this,"_snapshot");C(this,"_cellData");C(this,"_rowManager");C(this,"_columnManager");C(this,"_viewModel");C(this,"_spanModel");var a;this.unitId=t,this._styles=r,this._snapshot=Ec(n);const{columnData:s,rowData:i,cellData:o}=this._snapshot;this._sheetId=(a=this._snapshot.id)!=null?a:ce.generateRandomId(6),this._cellData=new xt(o),this._viewModel=new vc((l,c)=>this.getCellRaw(l,c)),this._rowManager=new ZE(this._snapshot,this._viewModel,i),this._columnManager=new qE(this._snapshot,s),this._spanModel=new o0(this._snapshot.mergeData)}__interceptViewModel(t){t(this._viewModel)}getSnapshot(){return this._snapshot}setMergeData(t){this._snapshot.mergeData=t,this.getSpanModel().rebuild(t)}getSpanModel(){return this._spanModel}getStyleDataByHash(t){return{...this._styles.get(t)}}setStyleData(t){return this._styles.setValue(t)}getColumnStyle(t,n=!1){return n?this._columnManager.getColumnStyle(t):this._styles.get(this._columnManager.getColumnStyle(t))}setColumnStyle(t,n){this._columnManager.setColumnStyle(t,n)}getRowStyle(t,n=!1){return n?this._rowManager.getRowStyle(t):this._styles.get(this._rowManager.getRowStyle(t))}setRowStyle(t,n){this._rowManager.setRowStyle(t,n)}mixinDefaultStyleToCellRaw(t,n,r,s){const i=this.getColumnStyle(n),o=this.getRowStyle(t),a=this.getDefaultCellStyleInternal();if(a||i||o){let l=r==null?void 0:r.s;typeof l=="string"&&(l=this._styles.get(l));const c=s?Ks(a,i,o,l):Ks(a,o,i,l);r||(r={}),r.s=c}}getDefaultCellStyle(){return this._snapshot.defaultStyle}getDefaultCellStyleInternal(){const t=this._snapshot.defaultStyle;return this._styles.get(t)}setDefaultCellStyle(t){this._snapshot.defaultStyle=t}getCellMatrix(){return this._cellData}getCellMatrixPrintRange(){const t=this.getCellMatrix(),n=this.getMergeData();let r=-1,s=-1,i=-1,o=-1,a=!1,l=!1;return t.forEach((c,h)=>{Object.keys(h).forEach(u=>{const d=+u,f=t.getValue(c,d),E=f!=null&&f.s?this._styles.get(f.s):null,v=(E==null?void 0:E.bd)&&(E.bd.b||E.bd.l||E.bd.r||E.bd.t||E.bd.bc_tr||E.bd.bl_tr||E.bd.ml_tr||E.bd.tl_bc||E.bd.tl_br||E.bd.tl_mr);(f&&(f.v||f.p)||E!=null&&E.bg||v)&&(a?r=Math.min(r,c):(r=c,a=!0),s=Math.max(s,c),l?i=Math.min(i,d):(l=!0,i=d),o=Math.max(o,d))})}),n.forEach(c=>{a?r=Math.min(r,c.startRow):(r=c.startRow,a=!0),s=Math.max(s,c.endRow),l?i=Math.min(i,c.startColumn):(i=c.startColumn,a=!0),o=Math.max(o,c.endColumn)}),!a||!l?null:{startColumn:i,startRow:r,endColumn:o,endRow:s}}getRowManager(){return this._rowManager}getUnitId(){return this.unitId}getSheetId(){return this._sheetId}getColumnManager(){return this._columnManager}getName(){return this._snapshot.name}clone(){const{_snapshot:t}=this,n=ce.deepClone(t);return new nr(this.unitId,n,this._styles)}getMergeData(){return this._spanModel.getMergeDataSnapshot()}getMergedCell(t,n){return this._spanModel.getMergedCell(t,n)}getMergedCellRange(t,n,r,s){return this._spanModel.getMergedCellRange(t,n,r,s)}isRowContainsMergedCell(t){return this._spanModel.isRowContainsMergedCell(t)}isColumnContainsMergedCell(t){return this._spanModel.isColumnContainsMergedCell(t)}getCellInfoInMergeData(t,n){const r=this.getMergedCell(t,n);let s=!1,i=!1,o=t,a=n,l=t,c=n;if(r){const{startRow:h,endRow:u,startColumn:d,endColumn:f}=r;t===h&&n===d?(o=u,a=f,l=h,c=d,i=!0):t>=h&&t<=u&&n>=d&&n<=f&&(o=u,a=f,l=h,c=d,s=!0)}return{actualRow:t,actualColumn:n,isMergedMainCell:i,isMerged:s,endRow:o,endColumn:a,startRow:l,startColumn:c}}getCell(t,n){return t<0||n<0?null:this._viewModel.getCell(t,n)}getCellValueOnly(t,n){return t<0||n<0?null:this._viewModel.getCellValueOnly(t,n)}getCellStyleOnly(t,n){return t<0||n<0?null:this._viewModel.getCellStyleOnly(t,n)}getCellRaw(t,n){return this.getCellMatrix().getValue(t,n)}getCellWithFilteredInterceptors(t,n,r,s){return this._viewModel.getCell(t,n,r,s)}getRowFiltered(t){return this._viewModel.getRowFiltered(t)}getMatrixWithMergedCells(t,n,r,s,i=Cn.Raw){const o=this.getCellMatrix(),a=this._spanModel.getMergedCellRange(t,n,r,s),l=new xt;return ei(t,r,n,s).forEach((c,h)=>{var d;let u;if(i===Cn.Raw)u=this.getCellRaw(c,h);else if(i===Cn.Intercepted)u=this.getCell(c,h);else if(i===Cn.Both){const f=this.getCellRaw(c,h);if(f){u={...f};const E=(d=this.getCell(c,h))==null?void 0:d.v;cc(E)&&u&&(u.displayV=String(E))}}u&&l.setValue(c,h,u)}),a.forEach(c=>{const{startColumn:h,startRow:u,endColumn:d,endRow:f}=c;ei(u,f,h,d).forEach((E,v)=>{E===u&&v===h&&l.setValue(E,v,{...o.getValue(E,v),rowSpan:f-u+1,colSpan:d-h+1}),(E!==u||v!==h)&&l.realDeleteValue(E,v)})}),l}getRange(t,n,r,s){return typeof t=="object"?new Tn(this,t,{getStyles:()=>this._styles}):new Tn(this,{startRow:t,startColumn:n,endColumn:s||n,endRow:r||t},{getStyles:()=>this._styles})}getScrollLeftTopFromSnapshot(){return{scrollLeft:this._snapshot.scrollLeft,scrollTop:this._snapshot.scrollTop}}getZoomRatio(){return this._snapshot.zoomRatio||1}getConfig(){return this._snapshot}getFreeze(){return this._snapshot.freeze}getMaxColumns(){const{_snapshot:t}=this,{columnCount:n}=t;return n}getMaxRows(){const{_snapshot:t}=this,{rowCount:n}=t;return n}getRowCount(){return this._snapshot.rowCount}setRowCount(t){this._snapshot.rowCount=t}getColumnCount(){return this._snapshot.columnCount}setColumnCount(t){this._snapshot.columnCount=t}isSheetHidden(){return this._snapshot.hidden}hasHiddenGridlines(){const{_snapshot:t}=this,{showGridlines:n}=t;return n===0}getGridlinesColor(){return this.getConfig().gridlinesColor}getTabColor(){const{_snapshot:t}=this,{tabColor:n}=t;return n}getColumnWidth(t){return this.getColumnManager().getColumnWidth(t)}getRowHeight(t){return this._viewModel.getRowFiltered(t)?0:this.getRowManager().getRowHeight(t)}isRowFiltered(t){return this._viewModel.getRowFiltered(t)}getRowVisible(t){return!this.isRowFiltered(t)&&this.getRowRawVisible(t)}getRowRawVisible(t){return this.getRowManager().getRowRawVisible(t)}getHiddenRows(t,n){const r=this.getMaxColumns()-1,s=this._rowManager.getHiddenRows(t,n);return s.forEach(i=>i.endColumn=r),s}getColVisible(t){return this._columnManager.getColVisible(t)}getHiddenCols(t,n){const r=this.getMaxRows()-1,s=this._columnManager.getHiddenCols(t,n);return s.forEach(i=>i.endRow=r),s}getVisibleRows(){const t=this.getRowCount();return this._rowManager.getVisibleRows(0,t-1)}getVisibleCols(){const t=this.getColumnCount();return this._columnManager.getVisibleCols(0,t-1)}isRightToLeft(){const{_snapshot:t}=this,{rightToLeft:n}=t;return n}getLastRowWithContent(){return this._cellData.getLength()-1}getLastColumnWithContent(){return this._cellData.getRange().endColumn}getDataRangeScope(){return this._cellData.getStartEndScope()}cellHasValue(t){return t&&(t.v!==void 0||t.f!==void 0||t.p!==void 0)}iterateByRow(t,n=!0){const{startRow:r,startColumn:s,endRow:i,endColumn:o}=t,a=this;return{[Symbol.iterator]:()=>{let l=r,c=s;return{next(){for(;;){if(c>o&&(l+=1,c=s),l>i)return{done:!0,value:void 0};const h=a.getCell(l,c),u=!h,d=a.getMergedCell(l,c);if(d){if(l!==d.startRow||c!==d.startColumn){c=d.endColumn+1;continue}if(u&&n){c=d.endColumn+1;continue}const E={row:l,col:c,value:h};return E.colSpan=d.endColumn-d.startColumn+1,E.rowSpan=d.endRow-d.startRow+1,c=d.endColumn+1,{done:!1,value:E}}if(u&&n)c+=1;else{const f={row:l,col:c,value:h};return c+=1,{done:!1,value:f}}}}}}}}iterateByColumn(t,n=!0,r=!0){const{startRow:s,startColumn:i,endRow:o,endColumn:a}=t,l=this;return{[Symbol.iterator]:()=>{let c=s,h=i;return{next(){for(;;){if(c>o&&(h+=1,c=s),h>a)return{done:!0,value:void 0};const u=l.getMergedCell(c,h);if(u){const E=c!==u.startRow,v=E||h!==u.startColumn;if(r&&v||!r&&E){c=u.endRow+1;continue}const O=l.getCell(u.startRow,u.startColumn);if(!O&&n){c=u.endRow+1;continue}const V={row:c,col:u.startColumn,value:O};return V.colSpan=u.endColumn-u.startColumn+1,V.rowSpan=u.endRow-u.startRow+1,c=u.endRow+1,{done:!1,value:V}}const d=l.getCell(c,h);if(!d&&n)c+=1;else{const E={row:c,col:h,value:d};return c+=1,{done:!1,value:E}}}}}}}}_getCellDocumentModel(t,n=fa){var v;const{isDeepClone:r,displayRawFormula:s,ignoreTextRotation:i}={...fa,...n},o=this._styles.getStyleByCell(t);if(!t)return;let a,l="document";const c=XE(o),h=i?ut.tr:c.textRotation||ut.tr;let u=c.horizontalAlign||ut.ht;const d=c.verticalAlign||ut.vt,f=c.wrapStrategy||ut.tb,E=c.paddingData||oi;if(t.f&&s)a=Hn(t.f.toString(),{},{verticalAlign:d}),u=ut.ht;else if(t.p){const{centerAngle:O,vertexAngle:T}=hc(h);a=this._updateConfigAndGetDocumentModel(r?ce.deepClone(t.p):t.p,u,E,{horizontalAlign:u,verticalAlign:d,centerAngle:O,vertexAngle:T,wrapStrategy:f,zeroWidthParagraphBreak:1})}else if(t.v!=null){const O=ha(o);l=da(O).fontCache;let T=Cc(t);t.t===Xt.FORCE_STRING&&s&&(T=`'${T}`),a=Hn(T,O,{...c,textRotation:h,cellValueType:t.t})}return a&&t.linkUrl&&t.linkId&&uc(a,t.linkUrl,t.linkId),{documentModel:a,fontString:l,textRotation:h,wrapStrategy:f,verticalAlign:d,horizontalAlign:u,paddingData:E,fill:(v=o==null?void 0:o.bg)==null?void 0:v.rgb}}_updateConfigAndGetDocumentModel(t,n,r,s){var o,a,l,c,h;if(!s||!((o=t.body)!=null&&o.dataStream))return;t.documentStyle||(t.documentStyle={}),t.documentStyle.marginTop=(a=r.t)!=null?a:0,t.documentStyle.marginBottom=(l=r.b)!=null?l:2,t.documentStyle.marginLeft=(c=r.l)!=null?c:2,t.documentStyle.marginRight=(h=r.r)!=null?h:2,t.documentStyle.pageSize={width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},t.documentStyle.renderConfig={...t.documentStyle.renderConfig,...s};const i=t.body.paragraphs||[];for(const u of i)u.paragraphStyle||(u.paragraphStyle={}),u.paragraphStyle.horizontalAlign=n;return new $t(t)}getBlankCellDocumentModel(t){const n=this._getCellDocumentModel(t,{ignoreTextRotation:!0}),r=this._styles.getStyleByCell(t),s=ha(r);if(n!=null)return n.documentModel==null&&(n.documentModel=Hn("",s)),n;const i="";let o="document";const a=ut.tr,l=ut.ht,c=ut.vt,h=ut.tb,u=oi;return o=da({}).fontCache,{documentModel:Hn(i,s),fontString:o,textRotation:a,wrapStrategy:h,verticalAlign:c,horizontalAlign:l,paddingData:u}}getCellDocumentModelWithFormula(t){return this._getCellDocumentModel(t,{isDeepClone:!0,displayRawFormula:!0,ignoreTextRotation:!0})}}function Cc(e){var r,s;if(!e)return"";const t=(s=(r=e.p)==null?void 0:r.body)==null?void 0:s.dataStream;if(t)return wt.transform.getPlainText(t);const n=e.v;return typeof n=="string"?e.t===Xt.BOOLEAN?n.toUpperCase():n.replace(/[\r\n]/g,""):typeof n=="number"?e.t===Xt.BOOLEAN?n?"TRUE":"FALSE":n.toString():typeof n=="boolean"?n?"TRUE":"FALSE":""}function a0(e){if(e===null)return"";if(e!=null&&e.p){const t=e==null?void 0:e.p.body;if(t==null)return"";const n=t.dataStream;return wt.transform.getPlainText(n)}return e==null?void 0:e.v}var l0=Object.defineProperty,u0=Object.getOwnPropertyDescriptor,c0=(e,t,n,r)=>{for(var s=r>1?void 0:r?u0(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&l0(t,n,s),s},h0=(e,t)=>(n,r)=>t(n,r,e);function d0(e,t){return`${e.getUnitId()}|${t.getSheetId()}`}exports.Workbook=class extends ms{constructor(n={},r){super();C(this,"type",$e.UNIVER_SHEET);C(this,"_sheetCreated$",new ye.Subject);C(this,"sheetCreated$",this._sheetCreated$.asObservable());C(this,"_sheetDisposed$",new ye.Subject);C(this,"sheetDisposed$",this._sheetDisposed$.asObservable());C(this,"_activeSheet$",new ye.BehaviorSubject(null));C(this,"activeSheet$",this._activeSheet$.asObservable());C(this,"_worksheets");C(this,"_styles");C(this,"_snapshot");C(this,"_unitId");C(this,"_count");C(this,"_name$");C(this,"name$");this._logService=r;const s=RE();ce.isEmptyObject(n)?this._snapshot=s:this._snapshot=ce.commonExtend(s,n);const{styles:i}=this._snapshot;(this._snapshot.id==null||this._snapshot.id.length===0)&&(this._snapshot.id=ce.generateRandomId(6)),this._unitId=this._snapshot.id,this._styles=new rc(i),this._count=1,this._worksheets=new Map,this._name$=new ye.BehaviorSubject(n.name||""),this.name$=this._name$.asObservable(),this._parseWorksheetSnapshots()}get _activeSheet(){return this._activeSheet$.getValue()}get name(){return this._name$.getValue()}static isIRangeType(n){return typeof n=="string"||"startRow"in n||"row"in n}dispose(){super.dispose(),this._sheetCreated$.complete(),this._sheetDisposed$.complete(),this._activeSheet$.complete(),this._name$.complete()}save(){return ce.deepClone(this._snapshot)}getSnapshot(){return this._snapshot}getName(){return this._snapshot.name}setName(n){this._name$.next(n),this._snapshot.name=n}getUnitId(){return this._unitId}getRev(){var n;return(n=this._snapshot.rev)!=null?n:1}incrementRev(){this._snapshot.rev=this.getRev()+1}setRev(n){this._snapshot.rev=n}addWorksheet(n,r,s){const{sheets:i,sheetOrder:o}=this._snapshot;if(i[n])return!1;i[n]=s,o.splice(r,0,n);const a=new nr(this._unitId,s,this._styles);return this._worksheets.set(n,a),this._sheetCreated$.next(a),!0}getSheetOrders(){return this._snapshot.sheetOrder}getWorksheets(){return this._worksheets}getActiveSpreadsheet(){return this}getStyles(){return this._styles}getConfig(){return this._snapshot}getIndexBySheetId(n){const{sheetOrder:r}=this._snapshot;return r.findIndex(s=>s===n)}getActiveSheet(n){if(!this._activeSheet&&typeof n>"u")throw new Error(`[Workbook]: no active Worksheet on Workbook ${this._unitId}!`);return this._activeSheet}ensureActiveSheet(){const n=this._activeSheet;if(n)return n;const r=this._snapshot.sheetOrder;for(let i=0,o=r.length;i<o;i++){const a=this._worksheets.get(r[i]);if(a&&a.isSheetHidden()!==xe.TRUE)return this.setActiveSheet(a),a}const s=this._worksheets.get(r[0]);return this.setActiveSheet(s),s}setActiveSheet(n){this._activeSheet$.next(n)}removeSheet(n){const r=this._worksheets.get(n);return r?(this._worksheets.delete(n),this._snapshot.sheetOrder.splice(this._snapshot.sheetOrder.indexOf(n),1),delete this._snapshot.sheets[n],this._sheetDisposed$.next(r),!0):!1}getActiveSheetIndex(){const{sheetOrder:n}=this._snapshot;return n.findIndex(r=>this._worksheets.get(r)===this._activeSheet)}getSheetSize(){return this._snapshot.sheetOrder.length}getSheets(){const{sheetOrder:n}=this._snapshot;return n.map(r=>this._worksheets.get(r))}getSheetsName(){const{sheetOrder:n}=this._snapshot,r=[];return n.forEach(s=>{const i=this._worksheets.get(s);i&&r.push(i.getName())}),r}getSheetIndex(n){const{sheetOrder:r}=this._snapshot;return r.findIndex(s=>n.getSheetId()===s)}getSheetBySheetName(n){const{sheetOrder:r}=this._snapshot,s=r.find(i=>this._worksheets.get(i).getName()===n);return this._worksheets.get(s)}getSheetBySheetId(n){return this._worksheets.get(n)}getSheetByIndex(n){const{sheetOrder:r}=this._snapshot;return this._worksheets.get(r[n])}getHiddenWorksheets(){return this.getSheets().filter(n=>n.getConfig().hidden===xe.TRUE).map(n=>n.getConfig().id)}getUnhiddenWorksheets(){return this.getSheets().filter(n=>n.getConfig().hidden!==xe.TRUE).map(n=>n.getConfig().id)}load(n){this._snapshot=n}checkSheetName(n){return this.getSheetsName().includes(n)}uniqueSheetName(n="Sheet1"){let r=n;for(;this.checkSheetName(r);)r=n+this._count,this._count++;return r}generateNewSheetName(n){let r=n+this._count;for(;this.checkSheetName(r);)r=n+this._count,this._count++;return r}_parseWorksheetSnapshots(){const{_snapshot:n,_worksheets:r}=this,{sheets:s,sheetOrder:i}=n;if(ce.isEmptyObject(s)){const o=ce.generateRandomId();s[o]={id:o}}for(const o in s){const a=s[o],{name:l}=a;a.name=this.uniqueSheetName(l),a.name!==l&&this._logService.debug("[Workbook]",`The worksheet name ${l} is duplicated, we changed it to ${a.name}. Please fix the problem in your snapshot.`);const c=new nr(this._unitId,a,this._styles);r.set(o,c),i.includes(o)||i.push(o)}this.ensureActiveSheet()}};exports.Workbook=c0([h0(1,At)],exports.Workbook);class Wi extends ms{constructor(n){var r;super();C(this,"type",$e.UNIVER_SLIDE);C(this,"_activePage$",new ye.BehaviorSubject(null));C(this,"activePage$",this._activePage$.asObservable());C(this,"_name$");C(this,"name$");C(this,"_snapshot");C(this,"_unitId");this._snapshot={...tu,...n},this._unitId=(r=this._snapshot.id)!=null?r:ce.generateRandomId(6),this._name$=new ye.BehaviorSubject(this._snapshot.title),this.name$=this._name$.asObservable()}get _activePage(){var r,s;const n=this._activePage$.getValue();if(!n){const i=(r=this.getPageOrder())==null?void 0:r[0];return i?(s=this.getPages())==null?void 0:s[i]:null}return n}setName(n){var r;this._snapshot.title=n,this._name$.next(n),this._unitId=(r=this._snapshot.id)!=null?r:un(6)}getRev(){return 0}incrementRev(){}setRev(n){}getSnapshot(){return this._snapshot}getUnitId(){return this._unitId}getPages(){var n;return(n=this._snapshot.body)==null?void 0:n.pages}getPageOrder(){var n;return(n=this._snapshot.body)==null?void 0:n.pageOrder}getPage(n){const r=this.getPages();return r==null?void 0:r[n]}getElementsByPage(n){var r;return(r=this.getPage(n))==null?void 0:r.pageElements}getElement(n,r){var s;return(s=this.getElementsByPage(n))==null?void 0:s[r]}getPageSize(){return this._snapshot.pageSize}getBlankPage(){const n=un(6);return{id:n,pageType:ki.SLIDE,zIndex:10,title:n,description:"",pageBackgroundFill:{rgb:"rgb(255,255,255)"},pageElements:{}}}setActivePage(n){this._activePage$.next(n)}getActivePage(){return this._activePage}updatePage(n,r){this._snapshot.body&&(this._snapshot.body.pages[n]=r)}appendPage(n){var i;if(!this._snapshot.body)return;this._snapshot.body.pages[n.id]=n;const r=this._activePage,s=this._snapshot.body.pageOrder.indexOf((i=r==null?void 0:r.id)!=null?i:"");this._snapshot.body.pageOrder.splice(s+1,0,n.id)}}const Wn="FOCUSING_UNIT",In="FOCUSING_SHEET",Yn="FOCUSING_DOC",zn="FOCUSING_SLIDE",f0="FOCUSING_EDITOR_BUT_HIDDEN",Rc="EDITOR_ACTIVATED",g0="FOCUSING_EDITOR_INPUT_FORMULA",Ic="FOCUSING_FX_BAR_EDITOR",p0="FOCUSING_UNIVER_EDITOR",m0="FOCUSING_EDITOR_INPUT_FORMULA",_0="FOCUSING_PANEL_EDITOR",E0="FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE",v0="FOCUSING_COMMON_DRAWINGS",C0="FORMULA_EDITOR_ACTIVATED";var R0=Object.defineProperty,I0=Object.getOwnPropertyDescriptor,S0=(e,t,n,r)=>{for(var s=r>1?void 0:r?I0(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&R0(t,n,s),s},ga=(e,t)=>(n,r)=>t(n,r,e);const hn=mt("univer.current");exports.UniverInstanceService=class extends tt{constructor(n,r){super();C(this,"_unitsByType",new Map);C(this,"_createHandler");C(this,"_ctorByType",new Map);C(this,"_currentUnits",new Map);C(this,"_currentUnits$",new ye.BehaviorSubject(this._currentUnits));C(this,"currentUnits$",this._currentUnits$.asObservable());C(this,"_unitAdded$",new ye.Subject);C(this,"unitAdded$",this._unitAdded$.asObservable());C(this,"_unitDisposed$",new ye.Subject);C(this,"unitDisposed$",this._unitDisposed$.asObservable());C(this,"_focused$",new ye.BehaviorSubject(null));C(this,"focused$",this._focused$.asObservable());this._injector=n,this._contextService=r}dispose(){super.dispose(),this._focused$.complete()}__setCreateHandler(n){this._createHandler=n}createUnit(n,r,s){return this._createHandler(n,r,this._ctorByType.get(n),s)}registerCtorForType(n,r){return this._ctorByType.set(n,r),{dispose:()=>{this._ctorByType.delete(n)}}}getCurrentTypeOfUnit$(n){return this.currentUnits$.pipe(ye.map(r=>{var s;return(s=r.get(n))!=null?s:null}),ye.distinctUntilChanged())}getCurrentUnitForType(n){return this._currentUnits.get(n)}setCurrentUnitForType(n){const r=this._getUnitById(n);if(!r)throw new Error(`[UniverInstanceService]: no document with unitId ${n}!`);this._currentUnits.set(r[1],r[0]),this._currentUnits$.next(this._currentUnits)}getTypeOfUnitAdded$(n){return this._unitAdded$.pipe(ye.filter(r=>r.type===n))}__addUnit(n,r){var a;const s=n.type;this._unitsByType.has(s)||this._unitsByType.set(s,[]);const i=this._unitsByType.get(s),o=n.getUnitId();if(i.findIndex(l=>l.getUnitId()===o)!==-1)throw new Error(`[UniverInstanceService]: cannot create a unit with the same unit id: ${o}.`);i.push(n),this._unitAdded$.next(n),((a=r==null?void 0:r.makeCurrent)==null||a)&&this.setCurrentUnitForType(n.getUnitId())}getTypeOfUnitDisposed$(n){return this.unitDisposed$.pipe(ye.filter(r=>r.type===n))}getUnit(n,r){var i;const s=(i=this._getUnitById(n))==null?void 0:i[0];return r&&(s==null?void 0:s.type)!==r?null:s}getCurrentUniverDocInstance(){return this.getCurrentUnitForType($e.UNIVER_DOC)}getUniverDocInstance(n){return this.getUnit(n,$e.UNIVER_DOC)}getUniverSheetInstance(n){return this.getUnit(n,$e.UNIVER_SHEET)}getAllUnitsForType(n){var r;return(r=this._unitsByType.get(n))!=null?r:[]}changeDoc(n,r){const s=this.getAllUnitsForType($e.UNIVER_DOC),i=s.find(o=>o.getUnitId()===n);if(i!=null){const o=s.indexOf(i);s.splice(o,1)}this.__addUnit(r)}get focused(){var r;const n=this._focused$.getValue();return n?(r=this._getUnitById(n))==null?void 0:r[0]:null}focusUnit(n){this._focused$.next(n),this.focused instanceof exports.Workbook?(this._contextService.setContextValue(Wn,!0),this._contextService.setContextValue(Yn,!1),this._contextService.setContextValue(In,!0),this._contextService.setContextValue(zn,!1),this.setCurrentUnitForType(n)):this.focused instanceof $t?(this._contextService.setContextValue(Wn,!0),this._contextService.setContextValue(Yn,!0),this._contextService.setContextValue(In,!1),this._contextService.setContextValue(zn,!1),this.setCurrentUnitForType(n)):this.focused instanceof Wi?(this._contextService.setContextValue(Wn,!0),this._contextService.setContextValue(Yn,!1),this._contextService.setContextValue(In,!1),this._contextService.setContextValue(zn,!0),this.setCurrentUnitForType(n)):(this._contextService.setContextValue(Wn,!1),this._contextService.setContextValue(Yn,!1),this._contextService.setContextValue(In,!1),this._contextService.setContextValue(zn,!1))}getFocusedUnit(){return this.focused}getUnitType(n){const r=this._getUnitById(n);return r?r[1]:$e.UNRECOGNIZED}disposeUnit(n){const r=this._getUnitById(n);if(!r)return!1;const[s,i]=r,o=this._unitsByType.get(i),a=o.indexOf(s);return o.splice(a,1),this._tryRemoveCurrentUnitForType(n,i),this._tryBlurUnitOnRemoval(n),this._unitDisposed$.next(s),!0}_tryRemoveCurrentUnitForType(n,r){const s=this.getCurrentUnitForType(r);(s==null?void 0:s.getUnitId())===n&&(this._currentUnits.set(r,null),this._currentUnits$.next(this._currentUnits))}_tryBlurUnitOnRemoval(n){var r;((r=this.focused)==null?void 0:r.getUnitId())===n&&this._focused$.next(null)}_getUnitById(n){for(const[r,s]of this._unitsByType){const i=s.find(o=>o.getUnitId()===n);if(i)return[i,r]}}};exports.UniverInstanceService=S0([ga(0,at(St)),ga(1,ur)],exports.UniverInstanceService);var We=(e=>(e[e.Starting=0]="Starting",e[e.Ready=1]="Ready",e[e.Rendered=2]="Rendered",e[e.Steady=3]="Steady",e))(We||{});const y0={0:"Starting",1:"Ready",2:"Rendered",3:"Steady"};var O0=Object.defineProperty,w0=Object.getOwnPropertyDescriptor,b0=(e,t,n,r)=>{for(var s=r>1?void 0:r?w0(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&O0(t,n,s),s},A0=(e,t)=>(n,r)=>t(n,r,e);exports.LifecycleService=class extends tt{constructor(n){super();C(this,"_lifecycle$",new ye.BehaviorSubject(We.Starting));C(this,"lifecycle$",this._lifecycle$.asObservable());C(this,"_lock",!1);this._logService=n,this._reportProgress(We.Starting)}get stage(){return this._lifecycle$.getValue()}set stage(n){if(this._lock)throw new Error("[LifecycleService]: cannot set new stage when related logic is all handled!");if(n<this.stage)throw new Error("[LifecycleService]: lifecycle stage cannot go backward!");n!==this.stage&&(this._lock=!0,this._reportProgress(n),this._lifecycle$.next(n),this._lock=!1)}dispose(){this._lifecycle$.complete(),super.dispose()}subscribeWithPrevious(){return ye.merge(Sc(this.stage),this._lifecycle$.pipe(ye.skip(1))).pipe(Cl(n=>n===We.Steady))}_reportProgress(n){this._logService.debug("[LifecycleService]",`lifecycle progressed to "${y0[n]}".`)}};exports.LifecycleService=b0([A0(0,At)],exports.LifecycleService);function Sc(e){switch(e){case We.Starting:return ye.of(We.Starting);case We.Ready:return ye.of(We.Starting,We.Ready);case We.Rendered:return ye.of(We.Starting,We.Ready,We.Rendered);default:return ye.of(We.Starting,We.Ready,We.Rendered,We.Steady)}}var T0=Object.defineProperty,N0=Object.getOwnPropertyDescriptor,M0=(e,t,n,r)=>{for(var s=r>1?void 0:r?N0(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&T0(t,n,s),s},Ns=(e,t)=>(n,r)=>t(n,r,e);const Kt=mt("univer.undo-redo.service"),D0=20;class yc{dispose(){}async dispatchToHandlers(){return!1}}const Oc="univer.command.redo",wc="univer.command.undo",rr=new class extends yc{constructor(){super(...arguments);C(this,"type",cr.COMMAND);C(this,"id",wc)}handler(t){const n=t.get(Kt),r=n.pitchTopUndoElement();if(!r)return!1;const s=t.get(Dt);return Di(r.undoMutations,s)?(n.popUndoToRedo(),!0):!1}},sr=new class extends yc{constructor(){super(...arguments);C(this,"type",cr.COMMAND);C(this,"id",Oc)}handler(t){const n=t.get(Kt),r=n.pitchTopRedoElement();if(!r)return!1;const s=t.get(Dt);return Di(r.redoMutations,s)?(n.popRedoToUndo(),!0):!1}};exports.LocalUndoRedoService=class extends tt{constructor(n,r,s){super();C(this,"undoRedoStatus$");C(this,"_undoRedoStatus$",new ye.BehaviorSubject({undos:0,redos:0}));C(this,"_undoStacks",new Map);C(this,"_redoStacks",new Map);C(this,"_batchingStatus",new Map);this._univerInstanceService=n,this._commandService=r,this._contextService=s,this.undoRedoStatus$=this._undoRedoStatus$.asObservable(),this.disposeWithMe(this._commandService.registerCommand(rr)),this.disposeWithMe(this._commandService.registerCommand(sr)),this.disposeWithMe(Xe(()=>this._undoRedoStatus$.complete())),this.disposeWithMe(Xe(this._univerInstanceService.focused$.subscribe(()=>this._updateStatus())))}pushUndoRedo(n){const{unitID:r}=n,s=this._getRedoStack(r,!0),i=this._getUndoStack(r,!0);if(s.length=0,this._batchingStatus.has(n.unitID)){const a=this._batchingStatus.get(n.unitID),l=this._pitchUndoElement(n.unitID);a===0||!l?(o(n),this._batchingStatus.set(n.unitID,1)):this._tryBatchingElements(l,n)}else o(n);function o(a){i.push(a),i.length>D0&&i.splice(0,1)}this._updateStatus()}clearUndoRedo(n){const r=this._getRedoStack(n);r&&(r.length=0);const s=this._getUndoStack(n);s&&(s.length=0),this._updateStatus()}pitchTopUndoElement(){const n=this._getFocusedUnitId();return this._pitchUndoElement(n)}pitchTopRedoElement(){const n=this._getFocusedUnitId();return this._pitchRedoElement(n)}_pitchUndoElement(n){const r=this._getUndoStack(n);return r!=null&&r.length?r[r.length-1]:null}_pitchRedoElement(n){const r=this._getRedoStack(n);return r!=null&&r.length?r[r.length-1]:null}popUndoToRedo(){const r=this._getUndoStackForFocused().pop();r&&(this._getRedoStackForFocused().push(r),this._updateStatus())}popRedoToUndo(){const r=this._getRedoStackForFocused().pop();r&&(this._getUndoStackForFocused().push(r),this._updateStatus())}__tempBatchingUndoRedo(n){if(this._batchingStatus.has(n))throw new Error("[LocalUndoRedoService]: cannot batching undo redo twice at the same time!");return this._batchingStatus.set(n,0),Xe(()=>this._batchingStatus.delete(n))}_updateStatus(){var i,o;const n=this._getFocusedUnitId(),r=n&&((i=this._undoStacks.get(n))==null?void 0:i.length)||0,s=n&&((o=this._redoStacks.get(n))==null?void 0:o.length)||0;this._undoRedoStatus$.next({undos:r,redos:s})}_getUndoStack(n,r=!1){let s=this._undoStacks.get(n);return!s&&r&&(s=[],this._undoStacks.set(n,s)),s||null}_getRedoStack(n,r=!1){let s=this._redoStacks.get(n);return!s&&r&&(s=[],this._redoStacks.set(n,s)),s||null}_getUndoStackForFocused(){const n=this._getFocusedUnitId();if(!n)throw new Error("No focused univer instance!");return this._getUndoStack(n,!0)}_getRedoStackForFocused(){const n=this._getFocusedUnitId();if(!n)throw new Error("No focused univer instance!");return this._getRedoStack(n,!0)}_tryBatchingElements(n,r){n.redoMutations.push(...r.redoMutations),n.undoMutations.push(...r.undoMutations)}_getFocusedUnitId(){var o,a,l,c;let n="";const r=this._contextService.getContextValue(In),s=this._contextService.getContextValue(Ic),i=this._contextService.getContextValue(Rc);return r?s?n=yi:i?n=Si:n=(a=(o=this._univerInstanceService.getFocusedUnit())==null?void 0:o.getUnitId())!=null?a:"":n=(c=(l=this._univerInstanceService.getFocusedUnit())==null?void 0:l.getUnitId())!=null?c:"",n}};exports.LocalUndoRedoService=M0([Ns(0,hn),Ns(1,Dt),Ns(2,ur)],exports.LocalUndoRedoService);const _s=mt("core.resource-manager.service"),ai={[Mt.Editor]:"Editor",[Mt.Owner]:"Owner",[Mt.Reader]:"Reader",[Mt.UNRECOGNIZED]:"UNRECOGNIZED"},ns=e=>e?{userID:`${ai[e]}_${ce.generateRandomId(8)}`,name:ai[e],avatar:""}:{userID:"",name:"",avatar:"",anonymous:!0,canBindAnonymous:!1},x0=(e,t)=>e.startsWith(ai[t]);class Nn{constructor(){C(this,"_model",new Map);C(this,"_userChange$",new ye.Subject);C(this,"userChange$",this._userChange$.asObservable());C(this,"_currentUser$",new ye.BehaviorSubject(ns()));C(this,"currentUser$",this._currentUser$.asObservable())}getCurrentUser(){return this._currentUser$.getValue()}setCurrentUser(t){this.addUser(t),this._currentUser$.next(t)}addUser(t){this._model.set(t.userID,t),this._userChange$.next({type:"add",user:t})}getUser(t,n){const r=this._model.get(t);if(r)return r;n&&n()}delete(t){const n=this.getUser(t);this._model.delete(t),n&&this._userChange$.next({type:"delete",user:n})}clear(){this._model.clear(),this._userChange$.next({type:"clear"})}list(){return Array.from(this._model.values())}}var L0=Object.defineProperty,U0=Object.getOwnPropertyDescriptor,P0=(e,t,n,r)=>{for(var s=r>1?void 0:r?U0(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&L0(t,n,s),s},pa=(e,t)=>(n,r)=>t(n,r,e);exports.AuthzIoLocalService=class{constructor(t,n){C(this,"_permissionMap",new Map([]));this._resourceManagerService=t,this._userManagerService=n,this._initSnapshot(),this._initDefaultUser()}_initDefaultUser(){const t=this._userManagerService.getCurrentUser();t&&t.userID||this._userManagerService.setCurrentUser(ns(Mt.Owner))}_getRole(t){const n=this._userManagerService.getCurrentUser();return n?x0(n.userID,t):!1}_initSnapshot(){this._resourceManagerService.registerPluginResource({toJson:t=>{const n=[...this._permissionMap.keys()].reduce((r,s)=>{const i=this._permissionMap.get(s);return r[s]=i,r},{});return JSON.stringify(n)},parseJson:t=>JSON.parse(t),pluginName:"SHEET_AuthzIoMockService_PLUGIN",businesses:[$e.UNIVER_SHEET,$e.UNIVER_DOC,$e.UNIVER_SLIDE],onLoad:(t,n)=>{for(const r in n)this._permissionMap.set(r,n[r])},onUnLoad:()=>{this._permissionMap.clear()}})}async create(t){return un(8)}async allowed(t){return Promise.resolve([])}async batchAllowed(t){return Promise.resolve([])}async list(t){const n=[];return t.objectIDs.forEach(r=>{const s=this._permissionMap.get(r);if(s){const i={objectID:r,unitID:t.unitID,objectType:s.objectType,name:s.name,shareOn:!1,shareRole:Mt.Owner,shareScope:-1,scope:{read:ti.AllCollaborator,edit:ti.AllCollaborator},creator:ns(Mt.Owner),strategies:[{action:6,role:1},{action:16,role:1},{action:17,role:1},{action:18,role:1},{action:19,role:1},{action:33,role:1},{action:34,role:1},{action:35,role:1},{action:36,role:1},{action:37,role:1},{action:38,role:1},{action:39,role:1},{action:40,role:1}],actions:t.actions.map(o=>({action:o,allowed:this._getRole(Mt.Owner)||this._getRole(Mt.Editor)}))};n.push(i)}}),n}async listCollaborators(){return[]}async listRoles(){return{roles:[],actions:[]}}async deleteCollaborator(){}async update(t){}async updateCollaborator(){}async createCollaborator(){}async putCollaborators(t){}};exports.AuthzIoLocalService=P0([pa(0,_s),pa(1,at(Nn))],exports.AuthzIoLocalService);const bc=mt("IAuthzIoIoService"),Ac=mt("univer.config-service");class Tc{constructor(){C(this,"_configChanged$",new ye.Subject);C(this,"configChanged$",this._configChanged$.asObservable());C(this,"_config",new Map)}dispose(){this._configChanged$.complete()}getConfig(t){return this._config.get(t)}setConfig(t,n,r){var o;const{merge:s=!1}=r||{};let i=(o=this._config.get(t))!=null?o:{};s?i=Ii(i,n):i=n,this._config.set(t,i),this._configChanged$.next({[t]:i})}deleteConfig(t){return this._config.delete(t)}subscribeConfigValue$(t){return new ye.Observable(n=>{Object.prototype.hasOwnProperty.call(this._config,t)&&n.next(this._config.get(t));const r=this.configChanged$.pipe(ye.filter(s=>Object.prototype.hasOwnProperty.call(s,t))).subscribe(s=>n.next(s[t]));return()=>r.unsubscribe()})}}class Nc extends tt{constructor(){super(...arguments);C(this,"_error$",new ye.Subject);C(this,"error$",this._error$.asObservable())}dispose(){this._error$.complete()}emit(n){this._error$.next({errorKey:n})}}class Qn extends tt{constructor(){super();C(this,"_currentLocale$",new ye.BehaviorSubject(hr.ZH_CN));C(this,"currentLocale$",this._currentLocale$.asObservable());C(this,"_locales",null);C(this,"localeChanged$",new ye.Subject);C(this,"t",(n,...r)=>{if(!this._locales)throw new Error("[LocaleService]: Locale not initialized");const s=n.split("."),i=this.resolveKeyPath(this._locales[this._currentLocale],s);if(typeof i=="string"){let o=i;return r.forEach((a,l)=>{o=o.replace(`{${l}}`,a)}),o}else return n});this.disposeWithMe(Xe(()=>this.localeChanged$.complete()))}get _currentLocale(){return this._currentLocale$.value}load(n){var r;this._locales=Ii((r=this._locales)!=null?r:{},n)}setLocale(n){this._currentLocale$.next(n),this.localeChanged$.next()}getLocales(){var n;return(n=this._locales)==null?void 0:n[this._currentLocale]}getCurrentLocale(){return this._currentLocale}resolveKeyPath(n,r){const s=r.shift();if(s&&n&&s in n){const i=n[s];return r.length>0&&(typeof i=="object"||Array.isArray(i))?this.resolveKeyPath(i,r):i}return null}}var F0=Object.defineProperty,k0=Object.getOwnPropertyDescriptor,$0=(e,t,n,r)=>{for(var s=r>1?void 0:r?k0(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&F0(t,n,s),s},j0=(e,t)=>(n,r)=>t(n,r,e);exports.MentionIOLocalService=class{constructor(t){this._userManagerService=t}async list(t){return{list:[{type:Qr.PERSON,mentions:[{objectType:Qr.PERSON,objectId:this._userManagerService.getCurrentUser().userID,label:this._userManagerService.getCurrentUser().name,metadata:{icon:this._userManagerService.getCurrentUser().avatar}}],metadata:{},title:"PEOPLE"}],page:t.page,size:t.size,total:1}}};exports.MentionIOLocalService=$0([j0(0,at(Nn))],exports.MentionIOLocalService);const Mc=mt("univer.service.mention-io");var Yi=(e=>(e.INIT="init",e.FETCHING="fetching",e.DONE="done",e))(Yi||{});const Dc=mt("univer.permission-service");class xc extends tt{constructor(){super(...arguments);C(this,"_permissionPointMap",new Map);C(this,"_permissionPointUpdate$",new ye.Subject);C(this,"permissionPointUpdate$",this._permissionPointUpdate$.asObservable());C(this,"_showComponents",!0)}setShowComponents(n){this._showComponents=n}getShowComponents(){return this._showComponents}deletePermissionPoint(n){const r=this._permissionPointMap.get(n);r&&(r.complete(),this._permissionPointMap.delete(n))}addPermissionPoint(n){const r=n instanceof ye.BehaviorSubject,s=r?n.getValue():n;if(!s.id)return!1;if(this._permissionPointMap.get(s.id))throw new Error(`${s.id} PermissionPoint already exists`);return this._permissionPointMap.set(s.id,r?n:new ye.BehaviorSubject(s)),this._permissionPointUpdate$.next(s),!0}updatePermissionPoint(n,r){const s=this._permissionPointMap.get(n);if(!s)return;const i=s.getValue();i.value=r,i.status=Yi.DONE,s.next(i),this._permissionPointUpdate$.next(i)}clearPermissionMap(){this._permissionPointMap.clear()}getPermissionPoint(n){const r=this._permissionPointMap.get(n);if(r)return r.getValue()}getPermissionPoint$(n){const r=this._permissionPointMap.get(n);if(r)return r}composePermission$(n){const r=n.map(s=>{var o;const i=(o=this._permissionPointMap)==null?void 0:o.get(s);if(!i)throw new Error(`[PermissionService]: ${s} permissionPoint does not exist!`);return i.asObservable()});return ye.combineLatest(r).pipe(Dr.map(s=>s))}composePermission(n){return n.map(s=>{var o;const i=(o=this._permissionPointMap)==null?void 0:o.get(s);if(!i)throw new Error(`[PermissionService]: ${s} permissionPoint does not exist!`);return i.getValue()})}getAllPermissionPoint(){const n=new Map;return this._permissionPointMap.forEach((r,s)=>{n.set(s,r)}),n}}function Lc(e,t){if(!t)return e;const n=[];for(const r of e){const s=t.find(([i])=>i===r[0]);if(s){if(s[1]===null)continue;n.push([r[0],s[1]])}else n.push(r)}return n}const Uc=Symbol("DependentOn");class li extends tt{onStarting(){}onReady(){}onRendered(){}onSteady(){}getUniverInstanceType(){return this.constructor.type}getPluginName(){return this.constructor.pluginName}}C(li,"pluginName"),C(li,"type",$e.UNIVER_UNKNOWN);class B0{constructor(){C(this,"_plugins",[])}addPlugin(t){this._plugins.push(t)}removePlugins(){const t=this._plugins.slice();return this._plugins.length=0,t}forEachPlugin(t){this._plugins.forEach(t)}}class H0{constructor(){C(this,"_pluginsRegistered",[])}registerPlugin(t,n){this._pluginsRegistered.push({plugin:t,options:n})}getRegisterPlugins(){return this._pluginsRegistered.slice()}removePlugins(){this._pluginsRegistered=[]}}var W0=Object.defineProperty,Y0=Object.getOwnPropertyDescriptor,Pc=(e,t,n,r)=>{for(var s=r>1?void 0:r?Y0(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&W0(t,n,s),s},Vr=(e,t)=>(n,r)=>t(n,r,e);const z0=4;function V0(...e){return function(t){t[Uc]=e}}exports.PluginService=class{constructor(t){C(this,"_pluginHolderForUniver");C(this,"_pluginHoldersForTypes",new Map);C(this,"_seenPlugins",new Set);C(this,"_flushTimer");this._injector=t,this._pluginHolderForUniver=this._injector.createInstance(rs,this._checkPluginSeen.bind(this),this._immediateInitPlugin.bind(this)),this._pluginHoldersForTypes.set($e.UNIVER_UNKNOWN,this._pluginHolderForUniver),this._pluginHolderForUniver.start()}dispose(){this._clearFlushTimer();for(const t of this._pluginHoldersForTypes.values())t.dispose();this._pluginHolderForUniver.dispose()}registerPlugin(t,n){this._assertPluginValid(t),this._scheduleInitPlugin();const{type:r}=t;r===$e.UNIVER_UNKNOWN?(this._pluginHolderForUniver.register(t,n),this._pluginHolderForUniver.flush()):this._ensurePluginHolderForType(r).register(t,n)}startPluginForType(t){this._ensurePluginHolderForType(t).start()}_ensurePluginHolderForType(t){if(!this._pluginHoldersForTypes.has(t)){const n=this._injector.createInstance(rs,this._checkPluginSeen.bind(this),this._immediateInitPlugin.bind(this));return this._pluginHoldersForTypes.set(t,n),n}return this._pluginHoldersForTypes.get(t)}_immediateInitPlugin(t){this._seenPlugins.add(t.pluginName),this._ensurePluginHolderForType(t.type).immediateInitPlugin(t)}_checkPluginSeen(t){return this._seenPlugins.has(t.pluginName)}_assertPluginValid(t){const{type:n,pluginName:r}=t;if(n===$e.UNRECOGNIZED)throw new Error(`[PluginService]: invalid plugin type for ${t.name}. Please assign a "type" to your plugin.`);if(!r)throw new Error(`[PluginService]: no plugin name for ${t.name}. Please assign a "pluginName" to your plugin.`);if(this._seenPlugins.has(r))throw new Error(`[PluginService]: duplicated plugin name for "${r}". Maybe a plugin that dependents on "${r} has already registered it. In that case please register "${r}" before the that plugin.`);this._seenPlugins.add(t.pluginName)}_scheduleInitPlugin(){this._flushTimer===void 0&&(this._flushTimer=setTimeout(()=>{this._pluginHolderForUniver.started||this._pluginHolderForUniver.start(),this._flushPlugins(),this._clearFlushTimer()},z0))}_clearFlushTimer(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)}_flushPlugins(){this._pluginHolderForUniver.flush();for(const[t,n]of this._pluginHoldersForTypes)n.started&&n.flush()}};exports.PluginService=Pc([Vr(0,at(St))],exports.PluginService);let rs=class extends tt{constructor(t,n,r,s,i){super();C(this,"_started",!1);C(this,"_warnedAboutOnStartingDeprecation",!1);C(this,"_pluginRegistry",new H0);C(this,"_pluginStore",new B0);C(this,"_pluginsInBatches",[]);this._checkPluginRegistered=t,this._registerPlugin=n,this._logService=r,this._injector=s,this._lifecycleService=i,this.disposeWithMe(this._lifecycleService.lifecycle$.pipe(ye.skip(1)).subscribe(o=>{this._pluginsInBatches.forEach(a=>this._runStage(a,o))}))}get started(){return this._started}dispose(){super.dispose(),this._pluginStore.forEachPlugin(t=>t.dispose()),this._pluginStore.removePlugins(),this._pluginRegistry.removePlugins(),this._pluginsInBatches.length=0}register(t,n){this._pluginRegistry.registerPlugin(t,n)}immediateInitPlugin(t){const n=this._initPlugin(t,void 0);this._pluginsRunLifecycle([n])}start(){this._started||(this._started=!0,this.flush())}flush(){if(!this._started)return;const t=this._pluginRegistry.getRegisterPlugins().map(({plugin:n,options:r})=>this._initPlugin(n,r));t.length&&(this._pluginsRunLifecycle(t),this._pluginRegistry.removePlugins())}_initPlugin(t,n){const r=t[Uc];if(r){const i=()=>{const o=r.find(a=>!this._checkPluginRegistered(a));return o?(this._logService.debug("[PluginService]",`Plugin "${t.pluginName}" depends on "${o.pluginName}" which is not registered. Univer will automatically register it with default configuration.`),this._registerPlugin(o,void 0),!0):!1};for(;i(););}const s=this._injector.createInstance(t,n);return this._pluginStore.addPlugin(s),this._logService.debug("[PluginService]",`Plugin "${s.getPluginName()}" registered.`),s}_pluginsRunLifecycle(t){Sc(this._lifecycleService.stage).subscribe(n=>this._runStage(t,n)),this._pluginsInBatches.push(t)}_runStage(t,n){t.forEach(r=>{switch(n){case We.Starting:r.onStarting();break;case We.Ready:r.onReady();break;case We.Rendered:r.onRendered();break;case We.Steady:r.onSteady();break}})}};rs=Pc([Vr(2,At),Vr(3,at(St)),Vr(4,at(exports.LifecycleService))],rs);var G0=Object.defineProperty,K0=Object.getOwnPropertyDescriptor,X0=(e,t,n,r)=>{for(var s=r>1?void 0:r?K0(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&G0(t,n,s),s},ma=(e,t)=>(n,r)=>t(n,r,e);let ui=class extends tt{constructor(e,t){super(),this._resourceManagerService=e,this._univerInstanceService=t,this._init()}_init(){const e=n=>{n.businesses.forEach(r=>{switch(r){case $e.UNRECOGNIZED:case $e.UNIVER_UNKNOWN:case $e.UNIVER_SLIDE:case $e.UNIVER_DOC:{this._univerInstanceService.getAllUnitsForType($e.UNIVER_DOC).forEach(s=>{const o=(s.getSnapshot().resources||[]).find(a=>a.name===n.pluginName);if(o)try{const a=n.parseJson(o.data);n.onLoad(s.getUnitId(),a)}catch{console.error(`Load Document{${s.getUnitId()}} Resources{${n.pluginName}} Data Error.`)}});break}case $e.UNIVER_SHEET:this._univerInstanceService.getAllUnitsForType($e.UNIVER_SHEET).forEach(s=>{const o=(s.getSnapshot().resources||[]).find(a=>a.name===n.pluginName);if(o)try{const a=n.parseJson(o.data);n.onLoad(s.getUnitId(),a)}catch{console.error(`Load Workbook{${s.getUnitId()}} Resources{${n.pluginName}} Data Error.`)}})}})};this._resourceManagerService.getAllResourceHooks().forEach(n=>e(n)),this.disposeWithMe(this._resourceManagerService.register$.subscribe(n=>e(n))),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$($e.UNIVER_SHEET).subscribe(n=>{this._resourceManagerService.loadResources(n.getUnitId(),n.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$($e.UNIVER_DOC).subscribe(n=>{const r=n.getUnitId();Ga(r)||this._resourceManagerService.loadResources(n.getUnitId(),n.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$($e.UNIVER_SHEET).subscribe(n=>{this._resourceManagerService.unloadResources(n.getUnitId())})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$($e.UNIVER_DOC).subscribe(n=>{this._resourceManagerService.unloadResources(n.getUnitId())}))}saveUnit(e){const t=this._univerInstanceService.getUnit(e);if(!t)return null;const n=this._resourceManagerService.getResources(e,t.type),r=ce.deepClone(t.getSnapshot());return r.resources=n,r}};ui=X0([ma(0,at(_s)),ma(1,at(hn))],ui);const ci=mt("resource-loader-service");class Fc extends tt{constructor(){super(...arguments);C(this,"_resourceMap",new Map);C(this,"_register$",new ye.Subject);C(this,"register$",this._register$.asObservable())}getAllResourceHooks(){return[...this._resourceMap.values()]}getResources(n,r){return r?this.getResourcesByType(n,r):this.getAllResourceHooks().map(o=>{const a=o.toJson(n);return{name:o.pluginName,data:a}})}getResourcesByType(n,r){return this.getAllResourceHooks().filter(o=>o.businesses.includes(r)).map(o=>{const a=o.toJson(n);return{name:o.pluginName,data:a}})}registerPluginResource(n){const r=n.pluginName;if(this._resourceMap.has(r))throw new Error(`the pluginName is registered {${r}}`);return this._resourceMap.set(r,n),this._register$.next(n),Xe(()=>this._resourceMap.delete(r))}disposePluginResource(n){this._resourceMap.delete(n)}loadResources(n,r){this.getAllResourceHooks().forEach(s=>{var o;const i=(o=r==null?void 0:r.find(a=>a.name===s.pluginName))==null?void 0:o.data;if(i)try{const a=s.parseJson(i);s.onLoad(n,a)}catch{console.error("LoadResources Error!")}})}unloadResources(n){this.getAllResourceHooks().forEach(r=>{r.onUnLoad(n)})}dispose(){this._register$.complete(),this._resourceMap.clear()}}class zi extends tt{constructor(){super();C(this,"_currentTheme");C(this,"_currentTheme$",new ye.BehaviorSubject({}));C(this,"currentTheme$",this._currentTheme$.asObservable());this.disposeWithMe(Xe(()=>this._currentTheme$.complete()))}getCurrentTheme(){if(!this._currentTheme)throw new Error("[ThemeService]: current theme is not set!");return this._currentTheme}setTheme(n){this._currentTheme=n,this._currentTheme$.next(n)}}class kc{constructor(t={},n){C(this,"_startedTypes",new Set);C(this,"_injector");C(this,"_disposingCallbacks",new hs);const r=this._injector=Q0(n,t==null?void 0:t.override),{theme:s,locale:i,locales:o,logLevel:a}=t;s&&this._injector.get(zi).setTheme(s),o&&this._injector.get(Qn).load(o),i&&this._injector.get(Qn).setLocale(i),a&&this._injector.get(At).setLogLevel(a),this._init(r)}get _univerInstanceService(){return this._injector.get(hn)}get _pluginService(){return this._injector.get(exports.PluginService)}__getInjector(){return this._injector}onDispose(t){const n=this._disposingCallbacks.add(Xe(t));return Xe(()=>n.dispose(!0))}dispose(){this._disposingCallbacks.dispose(),this._injector.dispose()}setLocale(t){this._injector.get(Qn).setLocale(t)}createUnit(t,n){return this._univerInstanceService.createUnit(t,n)}createUniverSheet(t){return this._injector.get(At).warn("[Univer]: Univer.createUniverSheet is deprecated, use createUnit instead"),this._univerInstanceService.createUnit($e.UNIVER_SHEET,t)}createUniverDoc(t){return this._injector.get(At).warn("[Univer]: Univer.createUniverDoc is deprecated, use createUnit instead"),this._univerInstanceService.createUnit($e.UNIVER_DOC,t)}createUniverSlide(t){return this._injector.get(At).warn("[Univer]: Univer.createUniverSlide is deprecated, use createUnit instead"),this._univerInstanceService.createUnit($e.UNIVER_SLIDE,t)}_init(t){this._univerInstanceService.registerCtorForType($e.UNIVER_SHEET,exports.Workbook),this._univerInstanceService.registerCtorForType($e.UNIVER_DOC,$t),this._univerInstanceService.registerCtorForType($e.UNIVER_SLIDE,Wi);const n=t.get(hn);n.__setCreateHandler((r,s,i,o)=>{if(!this._startedTypes.has(r)){this._pluginService.startPluginForType(r),this._startedTypes.add(r);const l=t.createInstance(i,s);return n.__addUnit(l,o),this._tryProgressToReady(),l}const a=t.createInstance(i,s);return n.__addUnit(a,o),a})}_tryProgressToReady(){this._injector.get(exports.LifecycleService).stage<We.Ready&&(this._injector.get(exports.LifecycleService).stage=We.Ready)}registerPlugin(t,n){this._pluginService.registerPlugin(t,n)}}function Q0(e,t){const n=Lc([[Nc],[Qn],[zi],[exports.LifecycleService],[exports.PluginService],[Nn],[hn,{useClass:exports.UniverInstanceService}],[Dc,{useClass:xc}],[At,{useClass:_l,lazy:!0}],[Dt,{useClass:exports.CommandService}],[Kt,{useClass:exports.LocalUndoRedoService,lazy:!0}],[Ac,{useClass:Tc}],[ur,{useClass:pl}],[_s,{useClass:Fc,lazy:!0}],[ci,{useClass:ui,lazy:!0}],[bc,{useClass:exports.AuthzIoLocalService,lazy:!0}],[Mc,{useClass:exports.MentionIOLocalService,lazy:!0}]],t),r=e?e.createChild(n):new St(n);return ul(r,[[Nn],[ci]]),r}var J0=Object.defineProperty,q0=Object.getOwnPropertyDescriptor,Z0=(e,t,n,r)=>{for(var s=r>1?void 0:r?q0(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&J0(t,n,s),s},ev=(e,t)=>(n,r)=>t(n,r,e);exports.FBlob=class extends gs{constructor(t,n){super(),this._blob=t,this._injector=n}copyBlob(){return this._injector.createInstance(exports.FBlob,this._blob)}getAs(t){const n=this.copyBlob();return n.setContentType(t),n}getDataAsString(t){return this._blob===null?Promise.resolve(""):t===void 0?this._blob.text():new Promise((n,r)=>{this._blob.arrayBuffer().then(s=>{const i=new TextDecoder(t).decode(s);n(i)}).catch(s=>{r(new Error(`Failed to read Blob as ArrayBuffer: ${s.message}`))})})}getBytes(){return this._blob?this._blob.arrayBuffer().then(t=>new Uint8Array(t)):Promise.reject(new Error("Blob is undefined or null."))}setBytes(t){return this._blob=new Blob([t]),this}setDataFromString(t,n){const r=n!=null?n:"text/plain",s=new Blob([t],{type:r});return this._blob=s,this}getContentType(){var t;return(t=this._blob)==null?void 0:t.type}setContentType(t){var n;return this._blob=(n=this._blob)==null?void 0:n.slice(0,this._blob.size,t),this}};exports.FBlob=Z0([ev(1,at(St))],exports.FBlob);var Vi=(e=>(e[e.INFO=0]="INFO",e[e.STOP=1]="STOP",e[e.WARNING=2]="WARNING",e))(Vi||{}),Gi=(e=>(e.BETWEEN="between",e.EQUAL="equal",e.GREATER_THAN="greaterThan",e.GREATER_THAN_OR_EQUAL="greaterThanOrEqual",e.LESS_THAN="lessThan",e.LESS_THAN_OR_EQUAL="lessThanOrEqual",e.NOT_BETWEEN="notBetween",e.NOT_EQUAL="notEqual",e))(Gi||{}),Ki=(e=>(e[e.TEXT=0]="TEXT",e[e.ARROW=1]="ARROW",e[e.CUSTOM=2]="CUSTOM",e))(Ki||{}),Xi=(e=>(e.VALID="valid",e.INVALID="invalid",e.VALIDATING="validating",e))(Xi||{}),Qi=(e=>(e.CUSTOM="custom",e.LIST="list",e.LIST_MULTIPLE="listMultiple",e.NONE="none",e.TEXT_LENGTH="textLength",e.DATE="date",e.TIME="time",e.WHOLE="whole",e.DECIMAL="decimal",e.CHECKBOX="checkbox",e.ANY="any",e))(Qi||{});const On=class On{static get(){if(this._instance)return this._instance;const t=new On;return this._instance=t,t}static extend(t){Object.getOwnPropertyNames(t.prototype).forEach(n=>{n!=="constructor"&&(this.prototype[n]=t.prototype[n])}),Object.getOwnPropertyNames(t).forEach(n=>{n!=="prototype"&&n!=="name"&&n!=="length"&&(this[n]=t[n])})}constructor(){for(const t in On.prototype)this[t]=On.prototype[t]}get UniverInstanceType(){return $e}get LifecycleStages(){return We}get DataValidationType(){return Qi}get DataValidationErrorStyle(){return Vi}get DataValidationRenderMode(){return Ki}get DataValidationOperator(){return Gi}get DataValidationStatus(){return Xi}};C(On,"_instance");let ss=On;const wn=class wn{static get(){if(this._instance)return this._instance;const t=new wn;return this._instance=t,t}static extend(t){Object.getOwnPropertyNames(t.prototype).forEach(n=>{n!=="constructor"&&(this.prototype[n]=t.prototype[n])}),Object.getOwnPropertyNames(t).forEach(n=>{n!=="prototype"&&n!=="name"&&n!=="length"&&(this[n]=t[n])})}constructor(){for(const t in wn.prototype)this[t]=wn.prototype[t]}get UnitCreated(){return"UnitCreated"}get LifeCycleChanged(){return"LifeCycleChanged"}};C(wn,"_instance");let is=wn;var tv=Object.defineProperty,nv=Object.getOwnPropertyDescriptor,rv=(e,t,n,r)=>{for(var s=r>1?void 0:r?nv(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&tv(t,n,s),s},_a=(e,t)=>(n,r)=>t(n,r,e);exports.FHooks=class extends gs{constructor(t,n){super(),this._injector=t,this._lifecycleService=n}onStarting(t){return Xe(this._lifecycleService.lifecycle$.pipe(ye.filter(n=>n===We.Starting)).subscribe(t))}onReady(t){return Xe(this._lifecycleService.lifecycle$.pipe(ye.filter(n=>n===We.Ready)).subscribe(t))}onRendered(t){return Xe(this._lifecycleService.lifecycle$.pipe(ye.filter(n=>n===We.Rendered)).subscribe(t))}onSteady(t){return Xe(this._lifecycleService.lifecycle$.pipe(ye.filter(n=>n===We.Steady)).subscribe(t))}onBeforeUndo(t){return this._injector.get(Dt).beforeCommandExecuted(r=>{if(r.id===rr.id){const i=this._injector.get(Kt).pitchTopUndoElement();i&&t(i)}})}onUndo(t){return this._injector.get(Dt).onCommandExecuted(r=>{if(r.id===rr.id){const i=this._injector.get(Kt).pitchTopUndoElement();i&&t(i)}})}onBeforeRedo(t){return this._injector.get(Dt).beforeCommandExecuted(r=>{if(r.id===sr.id){const i=this._injector.get(Kt).pitchTopRedoElement();i&&t(i)}})}onRedo(t){return this._injector.get(Dt).onCommandExecuted(r=>{if(r.id===sr.id){const i=this._injector.get(Kt).pitchTopRedoElement();i&&t(i)}})}};exports.FHooks=rv([_a(0,at(St)),_a(1,at(exports.LifecycleService))],exports.FHooks);var sv=Object.defineProperty,iv=Object.getOwnPropertyDescriptor,ov=(e,t,n,r)=>{for(var s=r>1?void 0:r?iv(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&sv(t,n,s),s},Ea=(e,t)=>(n,r)=>t(n,r,e);let hi=class extends gs{constructor(e,t){super(),this._injector=e,this._userManagerService=t}getCurrentUser(){return this._userManagerService.getCurrentUser()}};hi=ov([Ea(0,at(St)),Ea(1,at(Nn))],hi);var av=Object.defineProperty,lv=Object.getOwnPropertyDescriptor,uv=(e,t,n,r)=>{for(var s=r>1?void 0:r?lv(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&av(t,n,s),s},Tr=(e,t)=>(n,r)=>t(n,r,e);exports.FUniver=class extends iu{constructor(n,r,s,i){super(n);C(this,"_eventRegistry",new Map);this._injector=n,this._commandService=r,this._univerInstanceService=s,this._lifecycleService=i,this.disposeWithMe(this._lifecycleService.lifecycle$.subscribe(o=>{this.fireEvent(this.Event.LifeCycleChanged,{stage:o})})),this._injector.onDispose(()=>{this.dispose()})}static newAPI(n){return(n instanceof kc?n.__getInjector():n).createInstance(exports.FUniver)}_ensureEventRegistry(n){return this._eventRegistry.has(n)||this._eventRegistry.set(n,new ps),this._eventRegistry.get(n)}disposeUnit(n){return this._univerInstanceService.disposeUnit(n)}getCurrentLifecycleStage(){return this._injector.get(exports.LifecycleService).stage}undo(){return this._commandService.executeCommand(rr.id)}redo(){return this._commandService.executeCommand(sr.id)}onBeforeCommandExecute(n){return this._commandService.beforeCommandExecuted((r,s)=>{n(r,s)})}onCommandExecuted(n){return this._commandService.onCommandExecuted((r,s)=>{n(r,s)})}executeCommand(n,r,s){return this._commandService.executeCommand(n,r,s)}syncExecuteCommand(n,r,s){return this._commandService.syncExecuteCommand(n,r,s)}getHooks(){return this._injector.createInstance(exports.FHooks)}newBlob(){return this._injector.createInstance(exports.FBlob)}newColor(){return new dr}get Enum(){return ss.get()}get Event(){return is.get()}addEvent(n,r){return this._ensureEventRegistry(n).add(r),Xe(()=>this._ensureEventRegistry(n).delete(r))}fireEvent(n,r){var s;return(s=this._eventRegistry.get(n))==null||s.getData().forEach(i=>{i(r)}),r.cancel}getUserManager(){return this._injector.createInstance(hi)}};exports.FUniver=uv([Tr(0,at(St)),Tr(1,Dt),Tr(2,hn),Tr(3,at(exports.LifecycleService))],exports.FUniver);function $c(e){return/^-?\d+(\.\d+)?$/.test(e)}function cv(e){return $c(e)?Number(e)<=Number.MAX_SAFE_INTEGER:!1}function hv(e){const t=new MessageChannel;let n=!1;const r=()=>{n||e()};return t.port1.onmessage=r,t.port2.postMessage(null),()=>{n=!0,t.port1.close(),t.port2.close()}}function dv(e,t){return t.forEach(n=>e.add(n)),e}function fv(e,t,n,r){var c;if(t==="")return e;const s={id:"mock-id",body:e,documentStyle:{}},i=new $t(s),o=t.length;let a;for(;(a=(r?i.getBody().dataStream:i.getBody().dataStream.toLowerCase()).indexOf(t))>=0;){const h=new nt,u=kt.getInstance();if(a>0&&h.retain(a),n.length>0){const d=i.sliceBody(a,a+o),f={dataStream:n};if(Array.isArray(d==null?void 0:d.textRuns)&&d.textRuns.length&&(f.textRuns=[{...d.textRuns[0],st:0,ed:n.length}]),(c=d==null?void 0:d.customRanges)!=null&&c.length){const E=d.customRanges[0];f.customRanges=[{...E,startIndex:0,endIndex:n.length-1}]}h.insert(n.length,f)}h.delete(o),i.apply(u.editOp(h.serialize()))}const l=i.getBody();return i.dispose(),l}const gv="__default_document_sub_component_id20231101__";class jc{constructor(){C(this,"skipNextObservers",!1);C(this,"lastReturnValue");C(this,"isStopPropagation",!1)}stopPropagation(){this.isStopPropagation=!0}}class pv extends ye.Subject{constructor(){super(...arguments);C(this,"_sortedObservers",[])}subscribe(){throw new Error("[EventSubject]: please use `subscribeEvent` instead of `subscribe` method for `EventSubject`.")}next(){throw new Error("[EventSubject]: please use `emitEvent` instead of `next` method for `EventSubject`.")}unsubscribe(){super.unsubscribe(),this._sortedObservers.length=0}complete(){super.complete(),this._sortedObservers.length=0}subscribeEvent(n){let r;typeof n=="function"?r={next:([i,o])=>n(i,o)}:r=n;const s=super.subscribe(r);return this._sortedObservers.push(r),this._sortedObservers.sort((i,o)=>{var a,l;return((a=i.priority)!=null?a:0)-((l=o.priority)!=null?l:0)}),s.add(()=>this._sortedObservers=this._sortedObservers.filter(i=>i!==r)),s}clearObservers(){this._sortedObservers.forEach(n=>{var r;return(r=n.complete)==null?void 0:r.call(n)}),this._sortedObservers.length=0}emitEvent(n){var r;if(!this.closed){const s=new jc;s.lastReturnValue=n;for(const i of this._sortedObservers){const o=(r=i.next)==null?void 0:r.call(i,[n,s]);if(s.lastReturnValue=o,s.skipNextObservers)return{handled:!0,lastReturnValue:s.lastReturnValue,stopPropagation:s.isStopPropagation}}return{handled:this._sortedObservers.length>0,lastReturnValue:s.lastReturnValue,stopPropagation:s.isStopPropagation}}throw new Error("[EventSubject]: cannot emit event on a closed subject.")}}function mv(e){return new ye.Observable(t=>{const n=e.subscribeEvent(r=>{t.next(r)});return()=>n.unsubscribe()})}const _v=mt("ILocalStorageService");function Ev(e){return!(e.length===0||e.length>31||e.startsWith("'")||e.endsWith("'")||/[:\\\/\?\*\[\]]/.test(e))}function vv(e){return new Promise(t=>setTimeout(t,e))}function Cv(e=1){return new Promise(t=>{let n=0;const r=()=>{n++,n>=e?t():requestAnimationFrame(r)};requestAnimationFrame(r)})}var Ji=(e=>(e.URL="URL",e.UUID="UUID",e.BASE64="BASE64",e))(Ji||{}),Bc=(e=>(e.SUCCUSS="0",e.ERROR_EXCEED_SIZE="1",e.ERROR_IMAGE_TYPE="2",e.ERROR_UPLOAD_COUNT_LIMIT="3",e.ERROR_IMAGE="4",e))(Bc||{});const di=mt("core.image-io.service");class Rv{constructor(t,n=100){C(this,"_imageCacheMap");this._injector=t,this._imageCacheMap=new er(n)}_getImageCacheKey(t,n){return`${t}-${n}`}getImage(t,n,r,s){const i=this._getImageCacheKey(t,n);let o=this._imageCacheMap.get(i);return o||((async()=>{o=new Image;const a=this._injector.has(di)?this._injector.get(di):null;if(t===Ji.UUID)try{o.src=await(a==null?void 0:a.getImage(n))||""}catch(l){console.error(l)}else o.src=n;o.onload=()=>{r==null||r()},o.onerror=()=>{s==null||s()},this._imageCacheMap.set(i,o)})(),null)}}const Iv=["script","style","meta","comment","link"];var Hc=(e=>(e[e.DISABLED=0]="DISABLED",e[e.FULL_ALPHA=1]="FULL_ALPHA",e[e.FULL_HANGUL=2]="FULL_HANGUL",e[e.FULL_KATAKANA=3]="FULL_KATAKANA",e[e.HALF_ALPHA=4]="HALF_ALPHA",e[e.HALF_HANGUL=5]="HALF_HANGUL",e[e.HALF_KATAKANA=6]="HALF_KATAKANA",e[e.HIRAGANA=7]="HIRAGANA",e[e.NO_CONTROL=8]="NO_CONTROL",e[e.OFF=9]="OFF",e[e.ON=10]="ON",e))(Hc||{});const va=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Ms=1,Fn=8;class qi{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[n,r]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=r>>4;if(s!==Ms)throw new Error(`Got v${s} data when expected v${Ms}.`);const i=va[r&15];if(!i)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new qi(a,o,i,t)}constructor(t,n=64,r=Float64Array,s){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=r,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const i=va.indexOf(this.ArrayType),o=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-a%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${r}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,Fn,t),this.coords=new this.ArrayType(this.data,Fn+a+l,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(Fn+o+a+l),this.ids=new this.IndexArrayType(this.data,Fn,t),this.coords=new this.ArrayType(this.data,Fn+a+l,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(Ms<<4)+i]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=t,this.coords[this._pos++]=n,r}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return fi(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:o,nodeSize:a}=this,l=[0,i.length-1,0],c=[];for(;l.length;){const h=l.pop()||0,u=l.pop()||0,d=l.pop()||0;if(u-d<=a){for(let O=d;O<=u;O++){const T=o[2*O],V=o[2*O+1];T>=t&&T<=r&&V>=n&&V<=s&&c.push(i[O])}continue}const f=d+u>>1,E=o[2*f],v=o[2*f+1];E>=t&&E<=r&&v>=n&&v<=s&&c.push(i[f]),(h===0?t<=E:n<=v)&&(l.push(d),l.push(f-1),l.push(1-h)),(h===0?r>=E:s>=v)&&(l.push(f+1),l.push(u),l.push(1-h))}return c}within(t,n,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:i,nodeSize:o}=this,a=[0,s.length-1,0],l=[],c=r*r;for(;a.length;){const h=a.pop()||0,u=a.pop()||0,d=a.pop()||0;if(u-d<=o){for(let O=d;O<=u;O++)Ca(i[2*O],i[2*O+1],t,n)<=c&&l.push(s[O]);continue}const f=d+u>>1,E=i[2*f],v=i[2*f+1];Ca(E,v,t,n)<=c&&l.push(s[f]),(h===0?t-r<=E:n-r<=v)&&(a.push(d),a.push(f-1),a.push(1-h)),(h===0?t+r>=E:n+r>=v)&&(a.push(f+1),a.push(u),a.push(1-h))}return l}}function fi(e,t,n,r,s,i){if(s-r<=n)return;const o=r+s>>1;Wc(e,t,o,r,s,i),fi(e,t,n,r,o-1,1-i),fi(e,t,n,o+1,s,1-i)}function Wc(e,t,n,r,s,i){for(;s>r;){if(s-r>600){const c=s-r+1,h=n-r+1,u=Math.log(c),d=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*d*(c-d)/c)*(h-c/2<0?-1:1),E=Math.max(r,Math.floor(n-h*d/c+f)),v=Math.min(s,Math.floor(n+(c-h)*d/c+f));Wc(e,t,n,E,v,i)}const o=t[2*n+i];let a=r,l=s;for(kn(e,t,r,n),t[2*s+i]>o&&kn(e,t,r,s);a<l;){for(kn(e,t,a,l),a++,l--;t[2*a+i]<o;)a++;for(;t[2*l+i]>o;)l--}t[2*r+i]===o?kn(e,t,r,l):(l++,kn(e,t,l,s)),l<=n&&(r=l+1),n<=l&&(s=l-1)}}function kn(e,t,n,r){Ds(e,n,r),Ds(t,2*n,2*r),Ds(t,2*n+1,2*r+1)}function Ds(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Ca(e,t,n,r){const s=e-n,i=t-r;return s*s+i*i}function Yc(e,t,n=0,r=e.length-1,s=Sv){for(;r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,h=Math.log(l),u=.5*Math.exp(2*h/3),d=.5*Math.sqrt(h*u*(l-u)/l)*(c-l/2<0?-1:1),f=Math.max(n,Math.floor(t-c*u/l+d)),E=Math.min(r,Math.floor(t+(l-c)*u/l+d));Yc(e,t,f,E,s)}const i=e[t];let o=n,a=r;for($n(e,n,t),s(e[r],i)>0&&$n(e,n,r);o<a;){for($n(e,o,a),o++,a--;s(e[o],i)<0;)o++;for(;s(e[a],i)>0;)a--}s(e[n],i)===0?$n(e,n,a):(a++,$n(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}}function $n(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Sv(e,t){return e<t?-1:e>t?1:0}class gi{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data;const r=[];if(!Mr(t,n))return r;const s=this.toBBox,i=[];for(;n;){for(let o=0;o<n.children.length;o++){const a=n.children[o],l=n.leaf?s(a):a;Mr(t,l)&&(n.leaf?r.push(a):Ls(t,l)?this._all(a,r):i.push(a))}n=i.pop()}return r}collides(t){let n=this.data;if(!Mr(t,n))return!1;const r=[];for(;n;){for(let s=0;s<n.children.length;s++){const i=n.children[s],o=n.leaf?this.toBBox(i):i;if(Mr(t,o)){if(n.leaf||Ls(t,o))return!0;r.push(i)}}n=r.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let r=0;r<t.length;r++)this.insert(t[r]);return this}let n=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){const r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=En([]),this}remove(t,n){if(!t)return this;let r=this.data;const s=this.toBBox(t),i=[],o=[];let a,l,c;for(;r||i.length;){if(r||(r=i.pop(),l=i[i.length-1],a=o.pop(),c=!0),r.leaf){const h=yv(t,r.children,n);if(h!==-1)return r.children.splice(h,1),i.push(r),this._condense(i),this}!c&&!r.leaf&&Ls(r,s)?(i.push(r),o.push(a),a=0,l=r,r=r.children[0]):l?(a++,r=l.children[a],c=!1):r=null}return this}toBBox(t){return t}compareMinX(t,n){return t.minX-n.minX}compareMinY(t,n){return t.minY-n.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,n){const r=[];for(;t;)t.leaf?n.push(...t.children):r.push(...t.children),t=r.pop();return n}_build(t,n,r,s){const i=r-n+1;let o=this._maxEntries,a;if(i<=o)return a=En(t.slice(n,r+1)),mn(a,this.toBBox),a;s||(s=Math.ceil(Math.log(i)/Math.log(o)),o=Math.ceil(i/Math.pow(o,s-1))),a=En([]),a.leaf=!1,a.height=s;const l=Math.ceil(i/o),c=l*Math.ceil(Math.sqrt(o));Ra(t,n,r,c,this.compareMinX);for(let h=n;h<=r;h+=c){const u=Math.min(h+c-1,r);Ra(t,h,u,l,this.compareMinY);for(let d=h;d<=u;d+=l){const f=Math.min(d+l-1,u);a.children.push(this._build(t,d,f,s-1))}}return mn(a,this.toBBox),a}_chooseSubtree(t,n,r,s){for(;s.push(n),!(n.leaf||s.length-1===r);){let i=1/0,o=1/0,a;for(let l=0;l<n.children.length;l++){const c=n.children[l],h=xs(c),u=bv(t,c)-h;u<o?(o=u,i=h<i?h:i,a=c):u===o&&h<i&&(i=h,a=c)}n=a||n.children[0]}return n}_insert(t,n,r){const s=r?t:this.toBBox(t),i=[],o=this._chooseSubtree(s,this.data,n,i);for(o.children.push(t),Gn(o,s);n>=0&&i[n].children.length>this._maxEntries;)this._split(i,n),n--;this._adjustParentBBoxes(s,i,n)}_split(t,n){const r=t[n],s=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,s);const o=this._chooseSplitIndex(r,i,s),a=En(r.children.splice(o,r.children.length-o));a.height=r.height,a.leaf=r.leaf,mn(r,this.toBBox),mn(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(r,a)}_splitRoot(t,n){this.data=En([t,n]),this.data.height=t.height+1,this.data.leaf=!1,mn(this.data,this.toBBox)}_chooseSplitIndex(t,n,r){let s,i=1/0,o=1/0;for(let a=n;a<=r-n;a++){const l=Vn(t,0,a,this.toBBox),c=Vn(t,a,r,this.toBBox),h=Av(l,c),u=xs(l)+xs(c);h<i?(i=h,s=a,o=u<o?u:o):h===i&&u<o&&(o=u,s=a)}return s||r-n}_chooseSplitAxis(t,n,r){const s=t.leaf?this.compareMinX:Ov,i=t.leaf?this.compareMinY:wv,o=this._allDistMargin(t,n,r,s),a=this._allDistMargin(t,n,r,i);o<a&&t.children.sort(s)}_allDistMargin(t,n,r,s){t.children.sort(s);const i=this.toBBox,o=Vn(t,0,n,i),a=Vn(t,r-n,r,i);let l=Nr(o)+Nr(a);for(let c=n;c<r-n;c++){const h=t.children[c];Gn(o,t.leaf?i(h):h),l+=Nr(o)}for(let c=r-n-1;c>=n;c--){const h=t.children[c];Gn(a,t.leaf?i(h):h),l+=Nr(a)}return l}_adjustParentBBoxes(t,n,r){for(let s=r;s>=0;s--)Gn(n[s],t)}_condense(t){for(let n=t.length-1,r;n>=0;n--)t[n].children.length===0?n>0?(r=t[n-1].children,r.splice(r.indexOf(t[n]),1)):this.clear():mn(t[n],this.toBBox)}}function yv(e,t,n){if(!n)return t.indexOf(e);for(let r=0;r<t.length;r++)if(n(e,t[r]))return r;return-1}function mn(e,t){Vn(e,0,e.children.length,t,e)}function Vn(e,t,n,r,s){s||(s=En(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(let i=t;i<n;i++){const o=e.children[i];Gn(s,e.leaf?r(o):o)}return s}function Gn(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function Ov(e,t){return e.minX-t.minX}function wv(e,t){return e.minY-t.minY}function xs(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function Nr(e){return e.maxX-e.minX+(e.maxY-e.minY)}function bv(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function Av(e,t){const n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),s=Math.min(e.maxX,t.maxX),i=Math.min(e.maxY,t.maxY);return Math.max(0,s-n)*Math.max(0,i-r)}function Ls(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function Mr(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function En(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Ra(e,t,n,r,s){const i=[t,n];for(;i.length;){if(n=i.pop(),t=i.pop(),n-t<=r)continue;const o=t+Math.ceil((n-t)/r/2)*r;Yc(e,o,t,n,s),i.push(t,o,o,n)}}class Tv{constructor(t=!1){C(this,"_tree",new Map);C(this,"_oneCellCache",new Map);C(this,"_kdTree",new Map);this._enableOneCellCache=t}dispose(){this.clear()}getTree(t,n){return this._tree.has(t)||this._tree.set(t,new Map),this._tree.get(t).has(n)||this._tree.get(t).set(n,new gi),this._tree.get(t).get(n)}_getOneCellCache(t,n,r,s){return this._oneCellCache.has(t)||this._oneCellCache.set(t,new Map),this._oneCellCache.get(t).has(n)||this._oneCellCache.get(t).set(n,new Map),this._oneCellCache.get(t).get(n).has(r)||this._oneCellCache.get(t).get(n).set(r,new Map),this._oneCellCache.get(t).get(n).get(r).has(s)||this._oneCellCache.get(t).get(n).get(r).set(s,new Set),this._oneCellCache.get(t).get(n).get(r).get(s)}_removeOneCellCache(t,n,r,s,i){const o=this._oneCellCache.get(t);if(!o)return;const a=o.get(n);if(!a)return;const l=a.get(r);if(!l)return;const c=l.get(s);c&&c.delete(i)}_removeCellCacheByRange(t){const{unitId:n,sheetId:r,range:s,id:i}=t,o=this._oneCellCache.get(n);if(!o)return;const a=o.get(r);if(!a)return;const{startRow:l,startColumn:c,endRow:h,endColumn:u}=s;for(let d=l;d<=h;d++){const f=a.get(d);if(f)for(let E=c;E<=u;E++){const v=f.get(E);v&&v.delete(i)}}}_insertOneCellCache(t,n,r,s,i){this._getOneCellCache(t,n,r,s).add(i)}_getRdTreeItems(t){const n=[];for(const[r,s]of t)for(const[i,o]of s)n.push({x:i,y:r,ids:o});return n}_searchByOneCellCache(t){var E;const{unitId:n,sheetId:r,range:s}=t,{startRow:i,startColumn:o,endRow:a,endColumn:l}=s,c=(E=this._kdTree.get(n))==null?void 0:E.get(r);if(!c)return[];const{tree:h,items:u}=c,d=h.range(o,i,l,a),f=[];for(const v of d){const O=u[v];f.push(...Array.from(O.ids))}return f}openKdTree(){var t;for(const[n,r]of this._oneCellCache){this._kdTree.has(n)||this._kdTree.set(n,new Map);for(const[s,i]of r){const o=this._getRdTreeItems(i),a=new qi(o.length);(t=this._kdTree.get(n))==null||t.set(s,{tree:a,items:o});for(const l of o)a.add(l.x,l.y);a.finish()}}}closeKdTree(){var t;for(const[n,r]of this._oneCellCache)for(const[s,i]of r)(t=this._kdTree.get(n))==null||t.set(s,void 0)}insert(t){const{unitId:n,sheetId:r,range:s,id:i}=t;if(!n||n.length===0)return;let{startRow:o,endRow:a,startColumn:l,endColumn:c}=s;if(this._enableOneCellCache&&o===a&&l===c){this._insertOneCellCache(n,r,o,l,i);return}const h=this.getTree(n,r);Number.isNaN(o)&&(o=0),Number.isNaN(l)&&(l=0),Number.isNaN(a)&&(a=Number.POSITIVE_INFINITY),Number.isNaN(c)&&(c=Number.POSITIVE_INFINITY),h.insert({minX:l,minY:o,maxX:c,maxY:a,id:i})}bulkInsert(t){for(const n of t)this.insert(n)}*searchGenerator(t){var a;const{unitId:n,sheetId:r,range:s}=t;if(this._enableOneCellCache){const l=this._searchByOneCellCache(t);for(const c of l)yield c}const i=(a=this._tree.get(n))==null?void 0:a.get(r);if(!i)return;const o=i.search({minX:s.startColumn,minY:s.startRow,maxX:s.endColumn,maxY:s.endRow});for(const l of o)yield l.id}bulkSearch(t,n){const r=new Set;for(const s of t)for(const i of this.searchGenerator(s))(n==null?void 0:n.has(i))!==!0&&r.add(i);return r}removeById(t,n){var r,s;n?((r=this._tree.get(t))==null||r.delete(n),(s=this._oneCellCache.get(t))==null||s.delete(n)):(this._tree.delete(t),this._oneCellCache.delete(t))}_removeRTreeItem(t){const{unitId:n,sheetId:r,range:s,id:i}=t,o=this.getTree(n,r),a=o.search({minX:s.startColumn,minY:s.startRow,maxX:s.endColumn,maxY:s.endRow});for(let l=0;l<a.length;l++)a[l].id===i&&o.remove(a[l])}remove(t){const{unitId:n,sheetId:r,range:s,id:i}=t,{startRow:o,startColumn:a,endRow:l,endColumn:c}=s;this._enableOneCellCache?o===l&&a===c?this._removeOneCellCache(n,r,s.startRow,s.startColumn,i):(this._removeCellCacheByRange(t),this._removeRTreeItem(t)):this._removeRTreeItem(t)}bulkRemove(t){for(const n of t)this.remove(n)}clear(){this._tree.clear(),this._oneCellCache.clear()}toJSON(){const t={};return this._tree.forEach((n,r)=>{t[r]={},n.forEach((s,i)=>{t[r][i]=s.toJSON()})}),t}fromJSON(t){this._tree.clear();for(const n in t){this._tree.set(n,new Map);for(const r in t[n]){const s=new gi;s.fromJSON(t[n][r]),this._tree.get(n).set(r,s)}}}}Xc();exports.ABCToNumber=M_;exports.AbsoluteRefType=et;exports.ActionIterator=_n;exports.AlignTypeH=Tu;exports.AlignTypeV=Nu;exports.ArrangeTypeEnum=xu;exports.ArrowsAndMarkersShapes=Ul;exports.AsyncInterceptorManager=np;exports.AutoFillSeries=yl;exports.BaselineOffset=Ft;exports.BasicShapes=Ll;exports.BlockType=lu;exports.BooleanNumber=xe;exports.BorderStyleTypes=Ke;exports.BorderType=Ol;exports.BuildTextUtils=wt;exports.BulletAlignment=gr;exports.COLORS=Qs;exports.CellModeEnum=Cn;exports.CellValueType=Xt;exports.Color=cn;exports.ColorBuilder=dr;exports.ColorKit=Ot;exports.ColorType=Ct;exports.ColumnSeparatorType=hu;exports.CommandType=cr;exports.CommonHideTypes=wl;exports.ConfigService=Tc;exports.ContextService=pl;exports.CopyPasteType=bl;exports.CustomCommandExecutionError=Gs;exports.CustomDecorationType=on;exports.CustomRangeType=tr;exports.DEFAULT_CELL=__;exports.DEFAULT_DOC=Hi;exports.DEFAULT_DOCUMENT_SUB_COMPONENT_ID=gv;exports.DEFAULT_EMPTY_DOCUMENT_VALUE=Va;exports.DEFAULT_RANGE=p_;exports.DEFAULT_RANGE_ARRAY=g_;exports.DEFAULT_SELECTION=m_;exports.DEFAULT_SLIDE=tu;exports.DEFAULT_STYLES=ut;exports.DEFAULT_WORKSHEET_COLUMN_COUNT=fc;exports.DEFAULT_WORKSHEET_COLUMN_COUNT_KEY=t0;exports.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT=_c;exports.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY=i0;exports.DEFAULT_WORKSHEET_COLUMN_WIDTH=pc;exports.DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY=r0;exports.DEFAULT_WORKSHEET_ROW_COUNT=dc;exports.DEFAULT_WORKSHEET_ROW_COUNT_KEY=e0;exports.DEFAULT_WORKSHEET_ROW_HEIGHT=gc;exports.DEFAULT_WORKSHEET_ROW_HEIGHT_KEY=n0;exports.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH=mc;exports.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY=s0;exports.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY=yi;exports.DOCS_NORMAL_EDITOR_UNIT_ID_KEY=Si;exports.DOCS_ZEN_EDITOR_UNIT_ID_KEY=za;exports.DOC_RANGE_TYPE=Kl;exports.DashStyleType=Eu;exports.DataStreamTreeNodeType=ac;exports.DataStreamTreeTokenType=zt;exports.DataValidationErrorStyle=Vi;exports.DataValidationImeMode=Hc;exports.DataValidationOperator=Gi;exports.DataValidationRenderMode=Ki;exports.DataValidationStatus=Xi;exports.DataValidationType=Qi;exports.DeleteDirection=Al;exports.DependentOn=V0;exports.DesktopLogService=_l;exports.DeveloperMetadataVisibility=Tl;exports.Dimension=Nl;exports.Direction=Ml;exports.Disposable=tt;exports.DisposableCollection=hs;exports.DocStyleType=ou;exports.DocumentDataModel=$t;exports.DocumentFlavor=Fi;exports.DrawingTypeEnum=Lu;exports.EDITOR_ACTIVATED=Rc;exports.EXTENSION_NAMES=nu;exports.ErrorService=Nc;exports.EventState=jc;exports.EventSubject=pv;exports.FBase=gs;exports.FBaseInitialable=iu;exports.FEnum=ss;exports.FEventName=is;exports.FOCUSING_COMMON_DRAWINGS=v0;exports.FOCUSING_DOC=Yn;exports.FOCUSING_EDITOR_BUT_HIDDEN=f0;exports.FOCUSING_EDITOR_INPUT_FORMULA=g0;exports.FOCUSING_EDITOR_STANDALONE=m0;exports.FOCUSING_FX_BAR_EDITOR=Ic;exports.FOCUSING_PANEL_EDITOR=_0;exports.FOCUSING_SHEET=In;exports.FOCUSING_SLIDE=zn;exports.FOCUSING_UNIT=Wn;exports.FOCUSING_UNIVER_EDITOR=p0;exports.FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE=E0;exports.FORMULA_EDITOR_ACTIVATED=C0;exports.FollowNumberWithType=au;exports.FontItalic=Jr;exports.FontStyleType=Rn;exports.FontWeight=qr;exports.GridType=uu;exports.HLSColor=zl;exports.HorizontalAlign=Gt;exports.IAuthzIoService=bc;exports.ICommandService=Dt;exports.IConfigService=Ac;exports.IContextService=ur;exports.IImageIoService=di;exports.ILocalStorageService=_v;exports.ILogService=At;exports.IMentionIOService=Mc;exports.IPermissionService=Dc;exports.IResourceLoaderService=ci;exports.IResourceManagerService=_s;exports.IS_ROW_STYLE_PRECEDE_COLUMN_STYLE=ag;exports.IUndoRedoService=Kt;exports.IUniverInstanceService=hn;exports.ImageCacheMap=Rv;exports.ImageSourceType=Ji;exports.ImageUploadStatusType=Bc;exports.Inject=at;exports.Injector=St;exports.InterceptorEffectEnum=vn;exports.InterceptorManager=Zg;exports.InterpolationPointType=Dl;exports.JSON1=z_;exports.JSONX=kt;exports.LRUHelper=Bn;exports.LRUMap=er;exports.LifecycleStages=We;exports.ListGlyphType=Te;exports.LocaleService=Qn;exports.LocaleType=hr;exports.LogLevel=ml;exports.MOVE_BUFFER_VALUE=jn;exports.Many=tl;exports.MemoryCursor=Ln;exports.MentionType=Qr;exports.NamedStyleType=mu;exports.NilCommand=El;exports.NumberUnitType=Au;exports.ObjectMatrix=xt;exports.ObjectRelativeFromH=wu;exports.ObjectRelativeFromV=bu;exports.Optional=nl;exports.OtherShapes=Pl;exports.PRESET_LIST_TYPE=mr;exports.PageElementType=Uu;exports.PageOrientType=Du;exports.PageType=ki;exports.ParagraphElementType=fu;exports.PermissionService=xc;exports.PermissionStatus=Yi;exports.Plugin=li;exports.PositionedObjectLayoutType=pu;exports.PresetListType=Lt;exports.ProtectionType=xl;exports.QuickListType=Ju;exports.QuickListTypeMap=J_;exports.RANGE_DIRECTION=Gl;exports.RANGE_TYPE=De;exports.RBush=gi;exports.RCDisposable=lp;exports.RGBA_PAREN=kp;exports.RGB_PAREN=Fp;exports.ROTATE_BUFFER_VALUE=Sl;exports.RTree=Tv;exports.Range=Tn;exports.Rectangle=qt;exports.RediConsumer=ol;exports.RediContext=lr;exports.RediError=st;exports.RediProvider=Mi;exports.RedoCommand=sr;exports.RedoCommandId=Oc;exports.RefAlias=N_;exports.Registry=ps;exports.RegistryAsMap=Pi;exports.RelativeDate=kl;exports.RelativeSlideLink=Pu;exports.ResourceManagerService=Fc;exports.RgbColor=Zr;exports.RxDisposable=ap;exports.SHEET_EDITOR_UNITS=E_;exports.SectionType=cu;exports.Self=el;exports.SheetTypes=$l;exports.SheetViewModel=vc;exports.SkipSelf=Za;exports.SliceBodyType=Bi;exports.SlideDataModel=Wi;exports.SpacingRule=_u;exports.SpecialShapes=Fl;exports.Styles=rc;exports.THEME_COLORS=Yl;exports.TabStopAlignment=vu;exports.TableAlignmentType=Ru;exports.TableLayoutType=Iu;exports.TableRowHeightRule=yu;exports.TableSizeType=Cu;exports.TableTextWrapType=Su;exports.TextDecoration=jl;exports.TextDirection=Zn;exports.TextDirectionType=du;exports.TextX=nt;exports.TextXActionType=me;exports.ThemeColor=es;exports.ThemeColorType=ft;exports.ThemeColors=ds;exports.ThemeService=zi;exports.Tools=ce;exports.UndoCommand=rr;exports.UndoCommandId=wc;exports.UnitModel=ms;exports.Univer=kc;exports.UniverInstanceType=$e;exports.UpdateDocsAttributeType=Pe;exports.UserManagerService=Nn;exports.VerticalAlign=sn;exports.VerticalAlignmentType=Ou;exports.WithDependency=Bg;exports.WithNew=rl;exports.Worksheet=nr;exports.WrapStrategy=ln;exports.WrapTextType=gu;exports.addLinkToDocumentModel=uc;exports.afterInitApply=_p;exports.afterTime=mp;exports.awaitTime=vv;exports.binSearchFirstGreaterThanTarget=Il;exports.binarySearchArray=Ep;exports.bufferDebounceTime=pp;exports.cellToRange=fm;exports.characterSpacingControlType=Mu;exports.checkForSubstrings=gm;exports.checkIfMove=Rp;exports.checkParagraphHasBullet=Qm;exports.checkParagraphHasIndent=Jm;exports.checkParagraphHasIndentByStyle=ql;exports.codeToBlob=Cp;exports.composeBody=ii;exports.composeInterceptors=hl;exports.composeStyles=Ks;exports.concatMatrixArray=c_;exports.connectDependencies=kg;exports.connectInjector=Fg;exports.convertBodyToHtml=Pp;exports.convertCellToRange=Xl;exports.covertTextRunToHtml=Xs;exports.createAsyncInterceptorKey=ep;exports.createDefaultUser=ns;exports.createDocumentModelWithStyle=Hn;exports.createIdentifier=mt;exports.createInterceptorKey=qg;exports.createInternalEditorID=lg;exports.createRowColIter=ei;exports.dayjs=Bt;exports.debounce=Vf;exports.dedupe=tg;exports.deepCompare=Li;exports.delayAnimationFrame=Cv;exports.deleteContent=eu;exports.extractPureTextFromCell=Cc;exports.forwardRef=Cg;exports.fromCallback=vl;exports.fromEventSubject=mv;exports.fromObservable=op;exports.generateRandomId=un;exports.get=Sf;exports.getArrayLength=Qt;exports.getBodySlice=Jt;exports.getBodySliceHtml=Ur;exports.getBorderStyleType=cm;exports.getCellInfoInMergeData=rm;exports.getCellValueType=Zp;exports.getColorStyle=Nt;exports.getCustomDecorationSlice=ec;exports.getCustomRangeSlice=Zu;exports.getDocsUpdateBody=hm;exports.getIntersectRange=y_;exports.getOriginCellValue=a0;exports.getReverseDirection=Ip;exports.getWorksheetUID=d0;exports.groupBy=sg;exports.handleStyleToString=um;exports.hashAlgorithm=e_;exports.horizontalLineSegmentsSubtraction=fs;exports.insertMatrixArray=Js;exports.insertTextToContent=Zl;exports.isAsyncDependencyItem=Bs;exports.isAsyncHook=xr;exports.isBlackColor=Qp;exports.isBooleanString=og;exports.isCellCoverable=om;exports.isCellV=tm;exports.isClassDependencyItem=ks;exports.isCtor=wi;exports.isDisposable=Ys;exports.isEmptyCell=Ql;exports.isFactoryDependencyItem=$s;exports.isFormulaId=lm;exports.isFormulaString=am;exports.isICellData=qp;exports.isInternalEditorID=Ga;exports.isNodeEnv=Up;exports.isNotNullOrUndefined=cc;exports.isNullCell=em;exports.isNumeric=$c;exports.isRangesEqual=VE;exports.isRealNum=Zm;exports.isSafeNumeric=cv;exports.isSameStyleTextRun=Jl;exports.isUnitRangesEqual=GE;exports.isValidRange=dm;exports.isValueDependencyItem=js;exports.isWhiteColor=Jp;exports.makeArray=ig;exports.makeCellRangeToRangeData=im;exports.makeCellToSelection=sm;exports.makeCustomRangeStream=$E;exports.merge=Ii;exports.mergeOverrideWithDependencies=Lc;exports.mergeSets=dv;exports.mergeWith=Qf;exports.mergeWorksheetSnapshotWithDefault=Ec;exports.mixinClass=rp;exports.moveMatrixArray=Zs;exports.moveRangeByOffset=v_;exports.nameCharacterCheck=Ev;exports.normalizeBody=oE;exports.normalizeTextRuns=pr;exports.numberToABC=x_;exports.numberToListABC=L_;exports.numfmt=u_;exports.queryObjectMatrix=T_;exports.registerDependencies=Qg;exports.remove=or;exports.repeatStringNumTimes=su;exports.replaceInDocumentBody=fv;exports.requestImmediateMacroTask=hv;exports.rotate=rg;exports.searchArray=vp;exports.searchInOrderedArray=Rl;exports.selectionToArray=nm;exports.sequence=fl;exports.sequenceAsync=dl;exports.sequenceExecute=Di;exports.sequenceExecuteAsync=gp;exports.set=qf;exports.setDependencies=vg;exports.shallowEqual=cl;exports.skipParseTagNames=Iv;exports.sliceMatrixArray=h_;exports.sortRules=U_;exports.sortRulesByDesc=P_;exports.sortRulesFactory=fr;exports.spliceArray=qs;exports.splitIntoGrid=Ui;exports.takeAfter=Cl;exports.textDiff=Ya;exports.throttle=Jg;exports.toDisposable=Xe;exports.touchDependencies=ul;exports.updateAttributeByDelete=tc;exports.updateAttributeByInsert=nc;exports.useDependency=Yg;exports.useDependencyContext=Kg;exports.useDependencyContextValue=Xg;exports.useDependencyValue=ll;exports.useInjector=al;exports.useObservable=Vg;exports.useUpdateBinder=Gg;
|
|
6
|
+
`):"",this.name="UnsubscriptionError",this.errors=n}});function zo(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var bl=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,n,r,s,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=jo(o),l=a.next();!l.done;l=a.next()){var c=l.value;c.remove(this)}}catch(R){t={error:R}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}else o.remove(this);var h=this.initialTeardown;if(ar(h))try{h()}catch(R){i=R instanceof Ms?R.errors:[R]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var d=jo(u),f=d.next();!f.done;f=d.next()){var E=f.value;try{Yo(E)}catch(R){i=i!=null?i:[],R instanceof Ms?i=Wo(Wo([],Ho(i)),Ho(R.errors)):i.push(R)}}}catch(R){r={error:R}}finally{try{f&&!f.done&&(s=d.return)&&s.call(d)}finally{if(r)throw r.error}}}if(i)throw new Ms(i)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Yo(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}},e.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},e.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},e.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&zo(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&zo(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();bl.EMPTY;function lp(e){return e instanceof bl||e&&"closed"in e&&ar(e.remove)&&ar(e.add)&&ar(e.unsubscribe)}function Yo(e){ar(e)?e():e.unsubscribe()}function Qe(e){let t=!1;return e?lp(e)?{dispose:()=>e.unsubscribe()}:typeof e=="function"?{dispose:()=>{t||(t=!0,e())}}:e:Qe(()=>{})}function up(e){return Qe(()=>{e.unsubscribe()})}class Rs{constructor(){C(this,"_disposables",new Set)}add(t){const n=Qe(t);return this._disposables.add(n),{dispose:(r=!1)=>{r||n.dispose(),this._disposables.delete(n)}}}dispose(){this._disposables.forEach(t=>{t.dispose()}),this._disposables.clear()}}class nt{constructor(){C(this,"_disposed",!1);C(this,"_collection",new Rs)}disposeWithMe(t){return this._collection.add(t)}ensureNotDisposed(){if(this._disposed)throw new Error("[Disposable]: object is disposed!")}dispose(){this._disposed||(this._disposed=!0,this._collection.dispose())}}class cp extends nt{constructor(){super(...arguments);C(this,"dispose$",new Oe.Subject)}dispose(){super.dispose(),this.dispose$.next(),this.dispose$.complete()}}class hp extends nt{constructor(n){super();C(this,"_ref",0);this._rootDisposable=n}inc(){if(this._disposed)throw new Error("[RCDisposable]: should not ref to a disposed.");this._ref+=1}dec(){this._ref-=1,this._ref===0&&(this._rootDisposable.dispose(),this.dispose())}}const _r=_t("univer.context-service");class wl extends nt{constructor(){super(...arguments);C(this,"_contextChanged$",new Oe.Subject);C(this,"contextChanged$",this._contextChanged$.asObservable());C(this,"_contextMap",new Map)}dispose(){super.dispose(),this._contextChanged$.complete()}getContextValue(n){var r;return(r=this._contextMap.get(n))!=null?r:!1}setContextValue(n,r){this._contextMap.set(n,r),this._contextChanged$.next({[n]:r})}subscribeContextValue$(n){return new Oe.Observable(r=>{const s=this._contextChanged$.pipe(Oe.filter(i=>typeof i[n]<"u")).subscribe(i=>r.next(i[n]));return this._contextMap.has(n)&&r.next(this._contextMap.get(n)),()=>s.unsubscribe()})}}var Al=(e=>(e[e.SILENT=0]="SILENT",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.VERBOSE=4]="VERBOSE",e))(Al||{});const At=_t("univer.log");class Tl extends nt{constructor(){super(...arguments);C(this,"_logLevel",3)}debug(...n){this._logLevel>=4&&this._log(console.debug,...n)}log(...n){this._logLevel>=3&&this._log(console.log,...n)}warn(...n){this._logLevel>=2&&this._log(console.warn,...n)}error(...n){this._logLevel>=1&&this._log(console.error,...n)}setLogLevel(n){this._logLevel=n}_log(n,...r){const s=r[0];/^\[(.*?)\]/g.test(s)?n(`\x1B[97;104m${s}\x1B[0m`,...r.slice(1)):n(...r)}}var dp=Object.defineProperty,fp=Object.getOwnPropertyDescriptor,gp=(e,t,n,r)=>{for(var s=r>1?void 0:r?fp(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&dp(t,n,s),s},Vo=(e,t)=>(n,r)=>t(n,r,e),Wn=(e=>(e[e.COMMAND=0]="COMMAND",e[e.OPERATION=1]="OPERATION",e[e.MUTATION=2]="MUTATION",e))(Wn||{});const Dt=_t("anywhere.command-service");class pp{constructor(){C(this,"_commands",new Map);C(this,"_commandTypes",new Map)}registerCommand(t){if(this._commands.has(t.id))throw new Error(`[CommandRegistry]: command "${t.id}" has been registered before.`);return this._commands.set(t.id,t),this._commandTypes.set(t.id,t.type),Qe(()=>{this._commands.delete(t.id),this._commandTypes.delete(t.id)})}hasCommand(t){return this._commands.has(t)}getCommand(t){return this._commands.has(t)?[this._commands.get(t)]:null}getCommandType(t){return this._commandTypes.get(t)}}const Nl={id:"nil",type:0,handler:()=>!0};exports.CommandService=class extends nt{constructor(n,r){super();C(this,"_commandRegistry");C(this,"_beforeCommandExecutionListeners",[]);C(this,"_commandExecutedListeners",[]);C(this,"_multiCommandDisposables",new Map);C(this,"_commandExecutingLevel",0);C(this,"_commandExecutionStack",[]);this._injector=n,this._logService=r,this._commandRegistry=new pp,this._registerCommand(Nl)}dispose(){super.dispose(),this._commandExecutedListeners.length=0,this._beforeCommandExecutionListeners.length=0}hasCommand(n){return this._commandRegistry.hasCommand(n)}registerCommand(n){return this._registerCommand(n)}registerMultipleCommand(n){return this._registerMultiCommand(n)}beforeCommandExecuted(n){if(this._beforeCommandExecutionListeners.indexOf(n)===-1)return this._beforeCommandExecutionListeners.push(n),Qe(()=>{const r=this._beforeCommandExecutionListeners.indexOf(n);this._beforeCommandExecutionListeners.splice(r,1)});throw new Error("[CommandService]: could not add a listener twice.")}onCommandExecuted(n){if(this._commandExecutedListeners.indexOf(n)===-1)return this._commandExecutedListeners.push(n),Qe(()=>{const r=this._commandExecutedListeners.indexOf(n);this._commandExecutedListeners.splice(r,1)});throw new Error("[CommandService]: could not add a listener twice.")}async executeCommand(n,r,s){try{const i=this._commandRegistry.getCommand(n);if(i){const[o]=i,a={id:o.id,type:o.type,params:r},l=this._pushCommandExecutionStack(a);this._beforeCommandExecutionListeners.forEach(h=>h(a,s));const c=await this._execute(o,r,s);return this._commandExecutedListeners.forEach(h=>h(a,s)),l.dispose(),c}throw new Error(`[CommandService]: command "${n}" is not registered.`)}catch(i){if(i instanceof ni)return!1;throw i}}syncExecuteCommand(n,r,s){var i;try{const o=this._commandRegistry.getCommand(n);if(o){const[a]=o,l={id:a.id,type:a.type,params:r};if(a.type===2){const u=dg(this._commandExecutionStack,d=>d.type===0);u&&(l.params=(i=l.params)!=null?i:{},l.params.trigger=u.id)}const c=this._pushCommandExecutionStack(l);this._beforeCommandExecutionListeners.forEach(u=>u(l,s));const h=this._syncExecute(a,r,s);return this._commandExecutedListeners.forEach(u=>u(l,s)),c.dispose(),h}throw new Error(`[CommandService]: command "${n}" is not registered.`)}catch(o){if(o instanceof ni)return!1;throw o}}_pushCommandExecutionStack(n){return this._commandExecutionStack.push(n),Qe(()=>gr(this._commandExecutionStack,n))}_registerCommand(n){return this._commandRegistry.registerCommand(n)}_registerMultiCommand(n){const r=this._commandRegistry.getCommand(n.id);let s;if(r){if(r[0].multi!==!0)throw new Error("Command has registered as a single command.");s=r[0]}else{const o=new Rs;s=new mp(n.id),o.add(this._commandRegistry.registerCommand(s)),o.add(Qe(()=>{this._multiCommandDisposables.delete(n.id)})),this._multiCommandDisposables.set(n.id,o)}const i=s.registerImplementation(n);return Qe(()=>{var o;i.dispose(),s.hasImplementations()||(o=this._multiCommandDisposables.get(n.id))==null||o.dispose()})}async _execute(n,r,s){this._logService.debug("[CommandService]",`${"|-".repeat(Math.max(this._commandExecutingLevel,0))}executing command "${n.id}"`),this._commandExecutingLevel++;let i;try{i=await this._injector.invoke(n.handler,r,s),this._commandExecutingLevel--}catch(o){throw i=!1,this._commandExecutingLevel=0,o}return i}_syncExecute(n,r,s){this._logService.debug("[CommandService]",`${"|-".repeat(Math.max(0,this._commandExecutingLevel))}executing command "${n.id}".`),this._commandExecutingLevel++;let i;try{if(i=this._injector.invoke(n.handler,r,s),i instanceof Promise)throw new TypeError("[CommandService]: Command handler should not return a promise.");this._commandExecutingLevel--}catch(o){throw i=!1,this._commandExecutingLevel=0,o}return i}};exports.CommandService=gp([Vo(0,it(Ct)),Vo(1,At)],exports.CommandService);class mp{constructor(t){C(this,"name");C(this,"multi",!0);C(this,"type",0);C(this,"priority",0);C(this,"_implementations",[]);C(this,"handler",async(t,n)=>{if(!this._implementations.length)return!1;const r=t.get(At),s=t.get(_r),i=t.get(Ct);for(const o of this._implementations){const a=o.command.preconditions;if((!a||a&&a(s))&&(r.debug("[MultiCommand]",`executing implementation "${o.command.name}".`),await i.invoke(o.command.handler,n)))return!0}return!1});this.id=t,this.name=t}registerImplementation(t){const n={command:t};return this._implementations.push(n),this._implementations.sort((r,s)=>s.command.priority-r.command.priority),Qe(()=>{const r=this._implementations.indexOf(n);this._implementations.splice(r,1)})}hasImplementations(){return this._implementations.length>0}}function Hi(e,t,n){const r=e.map(s=>()=>t.syncExecuteCommand(s.id,s.params,n));return Ol(r)}function _p(e,t,n){const r=e.map(s=>()=>t.executeCommand(s.id,s.params,n));return Sl(r)}function Ml(e){return new Oe.Observable(t=>{const n=e((...r)=>t.next(r));return()=>n==null?void 0:n.dispose()})}function Dl(e){return function(n){return new Oe.Observable(r=>(n.subscribe({next:s=>{r.next(s),e(s)&&r.complete()},complete:()=>r.complete(),error:s=>r.error(s)}),()=>r.unsubscribe()))}}function Ep(e=0){return t=>{let n=[];return t.pipe(Oe.tap(r=>n.push(r)),Oe.debounceTime(e),Oe.map(()=>n),Oe.tap(()=>n=[]))}}function Cp(e){const t=new Oe.ReplaySubject(1);return setTimeout(()=>t.next(),e),t.pipe(Oe.take(1))}const Rp=e=>new Promise(t=>{Oe.merge(Ml(e.onCommandExecuted.bind(e)).pipe($r.filter(([n])=>n.type===Wn.MUTATION)),Oe.timer(300)).pipe($r.debounceTime(16),$r.first()).subscribe(()=>{t()})});function xl(e,t){let n=0,r=e.length-1;if(t<e[0])return 0;if(t>=e[e.length-1])return e.length-1;for(;n<=r;){if(e[n]===t){for(;n<e.length&&e[n]===t;)n++;return n}if(t>e[n]&&t<e[n+1])return n+1;if(e[r]===t){for(;r<e.length&&e[r]===t;)r++;return r}if(t>e[r-1]&&t<e[r])return r;n++,r--}return-1}function Ip(e,t){let n=0,r=e.length-1;for(;n<=r;){const s=Math.floor((r+n)/2);if(t<e[s]&&(s===0||t>=e[s-1]))return s;if(t>=e[s])n=s+1;else if(t<e[s])r=s-1;else return-1}return-1}function Ll(e,t){let n=0,r=e.length;for(;n<r;){const s=Math.floor((n+r)/2);e[s]<=t?n=s+1:r=s}return n<e.length?n:e.length-1}function vp(e,t,n=!1){let r=e.length-1;if(t<0||t<e[0])return 0;if(e.length<40||t<=e[20]||t>=e[r-20]?r=xl(e,t):r=Ll(e,t),n){const s=e[r];return e.indexOf(s)}return r}function yp(e){const t=new Blob([e],{type:"text/javascript"});return window.URL.createObjectURL(t)}const Jn=2,Ul=1;function Sp(e,t){if(t==null||e==null)return!0;const{left:n=0,top:r=0,height:s=0,width:i=0,angle:o=0}=t,{left:a=0,top:l=0,height:c=0,width:h=0,angle:u=0}=e,d=h,f=c,E=i,R=s;return Math.abs(a-n)>Jn||Math.abs(l-r)>Jn||Math.abs(d-E)>Jn||Math.abs(f-R)>Jn||Math.abs(u-o)>Ul}var Pl=(e=>(e[e.DEFAULT_SERIES=0]="DEFAULT_SERIES",e[e.ALTERNATE_SERIES=1]="ALTERNATE_SERIES",e))(Pl||{}),Xe=(e=>(e[e.NONE=0]="NONE",e[e.THIN=1]="THIN",e[e.HAIR=2]="HAIR",e[e.DOTTED=3]="DOTTED",e[e.DASHED=4]="DASHED",e[e.DASH_DOT=5]="DASH_DOT",e[e.DASH_DOT_DOT=6]="DASH_DOT_DOT",e[e.DOUBLE=7]="DOUBLE",e[e.MEDIUM=8]="MEDIUM",e[e.MEDIUM_DASHED=9]="MEDIUM_DASHED",e[e.MEDIUM_DASH_DOT=10]="MEDIUM_DASH_DOT",e[e.MEDIUM_DASH_DOT_DOT=11]="MEDIUM_DASH_DOT_DOT",e[e.SLANT_DASH_DOT=12]="SLANT_DASH_DOT",e[e.THICK=13]="THICK",e))(Xe||{}),Fl=(e=>(e.TOP="top",e.BOTTOM="bottom",e.LEFT="left",e.RIGHT="right",e.NONE="none",e.ALL="all",e.OUTSIDE="outside",e.INSIDE="inside",e.HORIZONTAL="horizontal",e.VERTICAL="vertical",e.TLBR="tlbr",e.TLBC_TLMR="tlbc_tlmr",e.TLBR_TLBC_TLMR="tlbr_tlbc_tlmr",e.BLTR="bl_tr",e.MLTR_BCTR="mltr_bctr",e))(Fl||{}),vt=(e=>(e[e.UNSUPPORTED=0]="UNSUPPORTED",e[e.RGB=1]="RGB",e[e.HEX=2]="HEX",e[e.THEME=3]="THEME",e))(vt||{}),kl=(e=>(e[e.ON=0]="ON",e[e.OFF=1]="OFF",e))(kl||{}),$l=(e=>(e[e.PASTE_NORMAL=0]="PASTE_NORMAL",e[e.PASTE_NO_BORDERS=1]="PASTE_NO_BORDERS",e[e.PASTE_FORMAT=2]="PASTE_FORMAT",e[e.PASTE_FORMULA=3]="PASTE_FORMULA",e[e.PASTE_DATA_VALIDATION=4]="PASTE_DATA_VALIDATION",e[e.PASTE_VALUES=5]="PASTE_VALUES",e[e.PASTE_CONDITIONAL_FORMATTING=6]="PASTE_CONDITIONAL_FORMATTING",e[e.PASTE_COLUMN_WIDTHS=7]="PASTE_COLUMN_WIDTHS",e))($l||{}),Bl=(e=>(e[e.LEFT=0]="LEFT",e[e.RIGHT=1]="RIGHT",e))(Bl||{}),jl=(e=>(e[e.DOCUMENT=0]="DOCUMENT",e[e.PROJECT=1]="PROJECT",e))(jl||{}),Hl=(e=>(e[e.COLUMNS=0]="COLUMNS",e[e.ROWS=1]="ROWS",e))(Hl||{}),Wl=(e=>(e[e.UP=0]="UP",e[e.RIGHT=1]="RIGHT",e[e.DOWN=2]="DOWN",e[e.LEFT=3]="LEFT",e))(Wl||{});function Op(e){switch(e){case 3:return 1;case 1:return 3;case 0:return 2;case 2:return 0}}var zl=(e=>(e[e.INTERPOLATION_POINT_TYPE_UNSPECIFIED=0]="INTERPOLATION_POINT_TYPE_UNSPECIFIED",e[e.MIN=1]="MIN",e[e.MAX=2]="MAX",e[e.NUMBER=3]="NUMBER",e[e.PERCENT=4]="PERCENT",e[e.PERCENTILE=5]="PERCENTILE",e))(zl||{}),Er=(e=>(e.EN_US="enUS",e.FR_FR="frFR",e.ZH_CN="zhCN",e.RU_RU="ruRU",e.ZH_TW="zhTW",e.VI_VN="viVN",e.FA_IR="faIR",e))(Er||{}),rs=(e=>(e[e.PERSON=0]="PERSON",e[e.FILE=1]="FILE",e[e.DATE=2]="DATE",e[e.LOCATION=3]="LOCATION",e[e.EVENT=4]="EVENT",e))(rs||{}),Yl=(e=>(e[e.RANGE=0]="RANGE",e[e.SHEET=1]="SHEET",e))(Yl||{}),Vl=(e=>(e.Line="line",e.LineInv="lineInv",e.Triangle="triangle",e.RtTriangle="rtTriangle",e.Rect="rect",e.Diamond="diamond",e.Parallelogram="parallelogram",e.Trapezoid="trapezoid",e.NonIsocelesTrapezoid="nonIsocelesTrapezoid",e.Pentagon="pentagon",e.Hexagon="hexagon",e.Heptagon="heptagon",e.Octagon="octagon",e.Decagon="decagon",e.Dodecagon="dodecagon",e.Star4="star4",e.Star5="star5",e.Star6="star6",e.Star7="star7",e.Star8="star8",e.Star10="star10",e.Star12="star12",e.Star16="star16",e.Star24="star24",e.Star32="star32",e.RoundRect="roundRect",e.Round1Rect="round1Rect",e.Round2SameRect="round2SameRect",e.Round2DiagRect="round2DiagRect",e.Ellipse="ellipse",e))(Vl||{}),Gl=(e=>(e.RightArrow="rightArrow",e.LeftArrow="leftArrow",e.UpArrow="upArrow",e.DownArrow="downArrow",e.LeftRightArrow="leftRightArrow",e.UpDownArrow="upDownArrow",e.QuadArrow="quadArrow",e.LeftRightUpArrow="leftRightUpArrow",e.BentArrow="bentArrow",e.UturnArrow="uturnArrow",e.CircularArrow="circularArrow",e.NotchedRightArrow="notchedRightArrow",e.HomePlate="homePlate",e.Chevron="chevron",e.LeftCircularArrow="leftCircularArrow",e.LeftRightCircularArrow="leftRightCircularArrow",e))(Gl||{}),Kl=(e=>(e.Plaque="plaque",e.Can="can",e.Cube="cube",e.Bevel="bevel",e.Donut="donut",e.NoSmoking="noSmoking",e.BlockArc="blockArc",e.FoldedCorner="foldedCorner",e))(Kl||{}),Xl=(e=>(e.SmileyFace="smileyFace",e.Heart="heart",e.LightningBolt="lightningBolt",e.Sun="sun",e.Moon="moon",e.Cloud="cloud",e.Arc="arc",e.Backpack="backpack",e.Frame="frame",e.HalfFrame="halfFrame",e.Corner="corner",e.Chord="chord",e.Pie="pie",e.Teardrop="teardrop",e.WedgeRectCallout="wedgeRectCallout",e.WedgeRRectCallout="wedgeRRectCallout",e.WedgeEllipseCallout="wedgeEllipseCallout",e.CloudCallout="cloudCallout",e.BorderCallout1="borderCallout1",e.BorderCallout2="borderCallout2",e.BorderCallout3="borderCallout3",e.AccentCallout1="accentCallout1",e.AccentCallout2="accentCallout2",e.AccentCallout3="accentCallout3",e.Callout1="callout1",e.Callout2="callout2",e.Callout3="callout3",e.ActionButtonBackPrevious="actionButtonBackPrevious",e.ActionButtonEnd="actionButtonEnd",e.ActionButtonForwardNext="actionButtonForwardNext",e.ActionButtonHelp="actionButtonHelp",e.ActionButtonHome="actionButtonHome",e.ActionButtonInformation="actionButtonInformation",e.ActionButtonMovie="actionButtonMovie",e.ActionButtonReturn="actionButtonReturn",e.ActionButtonSound="actionButtonSound",e))(Xl||{}),Ql=(e=>(e[e.RELATIVE_DATE_UNSPECIFIED=0]="RELATIVE_DATE_UNSPECIFIED",e[e.PAST_YEAR=1]="PAST_YEAR",e[e.PAST_MONTH=2]="PAST_MONTH",e[e.PAST_WEEK=3]="PAST_WEEK",e[e.YESTERDAY=4]="YESTERDAY",e[e.TODAY=5]="TODAY",e[e.TOMORROW=6]="TOMORROW",e))(Ql||{}),ql=(e=>(e[e.GRID=0]="GRID",e[e.KANBAN=1]="KANBAN",e[e.GANTT=2]="GANTT",e))(ql||{}),Pn=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LEFT_TO_RIGHT=1]="LEFT_TO_RIGHT",e[e.RIGHT_TO_LEFT=2]="RIGHT_TO_LEFT",e))(Pn||{}),Wi=(e=>(e[e.DASH=0]="DASH",e[e.DASH_DOT_DOT_HEAVY=1]="DASH_DOT_DOT_HEAVY",e[e.DASH_DOT_HEAVY=2]="DASH_DOT_HEAVY",e[e.DASHED_HEAVY=3]="DASHED_HEAVY",e[e.DASH_LONG=4]="DASH_LONG",e[e.DASH_LONG_HEAVY=5]="DASH_LONG_HEAVY",e[e.DOT_DASH=6]="DOT_DASH",e[e.DOT_DOT_DASH=7]="DOT_DOT_DASH",e[e.DOTTED=8]="DOTTED",e[e.DOTTED_HEAVY=9]="DOTTED_HEAVY",e[e.DOUBLE=10]="DOUBLE",e[e.NONE=11]="NONE",e[e.SINGLE=12]="SINGLE",e[e.THICK=13]="THICK",e[e.WAVE=14]="WAVE",e[e.WAVY_DOUBLE=15]="WAVY_DOUBLE",e[e.WAVY_HEAVY=16]="WAVY_HEAVY",e[e.WORDS=17]="WORDS",e))(Wi||{}),$t=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LEFT=1]="LEFT",e[e.CENTER=2]="CENTER",e[e.RIGHT=3]="RIGHT",e[e.JUSTIFIED=4]="JUSTIFIED",e[e.BOTH=5]="BOTH",e[e.DISTRIBUTED=6]="DISTRIBUTED",e))($t||{}),tn=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TOP=1]="TOP",e[e.MIDDLE=2]="MIDDLE",e[e.BOTTOM=3]="BOTTOM",e))(tn||{}),_n=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.OVERFLOW=1]="OVERFLOW",e[e.CLIP=2]="CLIP",e[e.WRAP=3]="WRAP",e))(_n||{}),ss=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ITALIC=1]="ITALIC",e))(ss||{}),is=(e=>(e[e.NORMAL=0]="NORMAL",e[e.BOLD=1]="BOLD",e))(is||{}),Ut=(e=>(e[e.NORMAL=1]="NORMAL",e[e.SUBSCRIPT=2]="SUBSCRIPT",e[e.SUPERSCRIPT=3]="SUPERSCRIPT",e))(Ut||{}),Se=(e=>(e[e.FALSE=0]="FALSE",e[e.TRUE=1]="TRUE",e))(Se||{}),nn=(e=>(e[e.STRING=1]="STRING",e[e.NUMBER=2]="NUMBER",e[e.BOOLEAN=3]="BOOLEAN",e[e.FORCE_STRING=4]="FORCE_STRING",e))(nn||{}),gt=(e=>(e[e.DARK1=0]="DARK1",e[e.LIGHT1=1]="LIGHT1",e[e.DARK2=2]="DARK2",e[e.LIGHT2=3]="LIGHT2",e[e.ACCENT1=4]="ACCENT1",e[e.ACCENT2=5]="ACCENT2",e[e.ACCENT3=6]="ACCENT3",e[e.ACCENT4=7]="ACCENT4",e[e.ACCENT5=8]="ACCENT5",e[e.ACCENT6=9]="ACCENT6",e[e.HYPERLINK=10]="HYPERLINK",e[e.FOLLOWED_HYPERLINK=11]="FOLLOWED_HYPERLINK",e))(gt||{}),Is=(e=>(e.OFFICE="Office",e.OFFICE_2007_2010="Office 2007-2010",e.GRAYSCALE="Grayscale",e.BLUE_WARM="Blue Warm",e.BLUE="Blue",e.BLUE_II="Blue II",e.BLUE_GREEN="Blue Green",e.GREEN="Green",e.GREEN_YELLOW="Green Yellow",e.YELLOW="Yellow",e.YELLOW_ORANGE="Yellow Orange",e.ORANGE="Orange",e.ORANGE_RED="Orange Red",e.RED_ORANGE="Red Orange",e.RED="Red",e.RED_VIOLET="Red Violet",e.VIOLET="Violet",e.VIOLET_II="Violet II",e.MEDIAN="Median",e.PAPER="Paper",e.MARQUEE="Marquee",e.SLIPSTREAM="Slipstream",e.Aspect="Aspect",e))(Is||{});const bp="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let wp=e=>crypto.getRandomValues(new Uint8Array(e)),Ap=(e,t,n)=>{let r=(2<<Math.log2(e.length-1))-1,s=-~(1.6*r*t/e.length);return(i=t)=>{let o="";for(;;){let a=n(s),l=s|0;for(;l--;)if(o+=e[a[l]&r]||"",o.length>=i)return o}}},Tp=(e,t=21)=>Ap(e,t|0,wp),Np=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=bp[n[e]&63];return t};const Jl=new Set(["ac","ad","ae","aero","af","ag","ai","al","am","ao","aq","ar","arpa","as","asia","at","au","aw","ax","az","ba","bb","bd","be","bf","bg","bh","bi","biz","bj","bm","bn","bo","br","bs","bt","bv","bw","by","bz","ca","cat","cc","cd","cf","cg","ch","ci","ck","cl","cm","cn","co","com","coop","cr","cu","cv","cw","cx","cy","cz","de","dj","dk","dm","do","dz","ec","edu","ee","eg","er","es","et","eu","fi","fj","fk","fm","fo","fr","ga","gb","gd","ge","gf","gg","gh","gi","gl","gm","gn","gov","gp","gq","gr","gs","gt","gu","gw","gy","hk","hm","hn","hr","ht","hu","id","ie","il","im","in","info","int","io","iq","ir","is","it","je","jm","jo","jobs","jp","ke","kg","kh","ki","km","kn","kp","kr","kw","ky","kz","la","lb","lc","li","lk","lr","ls","lt","lu","lv","ly","ma","mc","md","me","mg","mh","mil","mk","ml","mm","mn","mo","mobi","mp","mq","mr","ms","mt","mu","museum","mv","mw","mx","my","mz","na","name","nc","ne","net","nf","ng","ni","nl","no","np","nr","nu","nz","om","onion","org","pa","pe","pf","pg","ph","pk","pl","pm","pn","post","pr","pro","ps","pt","pw","py","qa","re","ro","rs","ru","rw","sa","sb","sc","sd","se","sg","sh","si","sj","sk","sl","sm","sn","so","sr","ss","st","su","sv","sx","sy","sz","tc","td","tel","tf","tg","th","tj","tk","tl","tm","tn","to","tr","tt","tv","tw","tz","ua","ug","uk","us","uy","uz","va","vc","ve","vg","vi","vn","vu","wf","ws","yt","za","zm","zw"]),Mp=new RegExp("^(?:(?:(?:https?|ftp):)?\\/\\/)?(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u00a1-\\uffff][a-z0-9\\u00a1-\\uffff_-]{0,62})?[a-z0-9\\u00a1-\\uffff]\\.)+(?:[a-z\\u00a1-\\uffff]{2,}\\.?))(?::\\d{2,5})?(?:[/?#]\\S*)?$","i");function Dp(e){if(!Number.isNaN(+e))return!1;if(e.startsWith("http://localhost:3002")||e.startsWith("localhost:3002"))return!0;if(Mp.test(e)){if(Zl(e))return!0;try{const r=new URL(eu(e)).hostname.split(".").pop();if(r&&Jl.has(r))return!0}catch{return!1}}return!1}function Zl(e){return/^[a-zA-Z]+:\/\//.test(e)}function xp(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e)}function eu(e){return Zl(e)?e:xp(e)?`mailto://${e}`:`https://${e}`}const Lp=/^-ms-/,Up=/-([a-z])/g,qt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];function zi(e,t){const n=re.getValueType(e),r=re.getValueType(t);return n!==r?!1:re.isArray(e)?Pp(e,t):re.isObject(e)?Fp(e,t):re.isDate(e)?e.getTime()===t.getTime():re.isRegExp(e)?e.toString()===t.toString():e===t}function Pp(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++){const s=e[n],i=t[n];if(!zi(s,i))return!1}return!0}function Fp(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n){if(!r.includes(s))return!1;const i=e[s],o=t[s];if(!zi(i,o))return!1}return!0}class re{static stringAt(t){let n="",r=t;for(;r>=qt.length;)r/=qt.length,r-=1,n+=qt[r%qt.length];const s=t%qt.length;return n+=qt[s],n}static indexAt(t){let n=0;for(let r=0;r<t.length-1;r+=1){const s=t.charCodeAt(r)-65,i=t.length-1-r;n+=qt.length**i+qt.length*s}return n+=t.charCodeAt(t.length-1)-65,n}static deleteBlank(t){return re.isString(t)?t.replace(/\s/g,""):t}static getSystemType(){const t=navigator.userAgent,n=navigator.platform==="Win32"||navigator.platform==="Windows",r=navigator.platform==="Mac68K"||navigator.platform==="MacPPC"||navigator.platform==="Macintosh"||navigator.platform==="MacIntel";if(r)return"Mac";if(navigator.platform==="X11"&&!n&&!r)return"Unix";if(String(navigator.platform).indexOf("Linux")>-1)return"Linux";if(n){if(t.indexOf("Windows NT 5.0")>-1||t.indexOf("Windows 2000")>-1)return"Windows 2000";if(t.indexOf("Windows NT 5.1")>-1||t.indexOf("Windows XP")>-1)return"Windows XP";if(t.indexOf("Windows NT 5.2")>-1||t.indexOf("Windows 2003")>-1)return"Windows 2003";if(t.indexOf("Windows NT 6.0")>-1||t.indexOf("Windows Vista")>-1)return"Windows Vista";if(t.indexOf("Windows NT 6.1")>-1||t.indexOf("Windows 7")>-1)return"Windows 7";if(t.indexOf("Windows NT 10")>-1||t.indexOf("Windows 10")>-1)return"Windows 10";if(t.indexOf("Windows NT 11")>-1||t.indexOf("Windows 11")>-1)return"Windows 11"}return"Unknown system"}static getBrowserType(){const t=navigator.userAgent,n=t.indexOf("Opera")>-1,r=t.indexOf("compatible")>-1&&t.indexOf("MSIE")>-1&&!n,s=t.indexOf("Trident")>-1&&t.indexOf("rv:11.0")>-1,i=t.indexOf("Edge")>-1,o=t.indexOf("Firefox")>-1,a=t.indexOf("Safari")>-1&&t.indexOf("Chrome")===-1,l=t.indexOf("Chrome")>-1&&t.indexOf("Safari")>-1;if(r){new RegExp("MSIE (\\d+\\.\\d+);").test(t);const h=Number.parseFloat(RegExp.$1);return h===7?"IE7":h===8?"IE8":h===9?"IE9":h===10?"IE10":"0"}return o?"FF":n?"Opera":a?"Safari":l?"Chrome":i?"Edge":s?"IE11":"Unknown browser"}static generateRandomId(t=21,n){return zt(t,n)}static getClassName(t){return t.constructor.name}static deepMerge(t,...n){n.forEach(o=>o&&i(o));function r(o,a){o.forEach((l,c)=>{var h,u;if(re.isArray(l)){const d=(h=a[c])!=null?h:[];a[c]=d,r(l,d);return}if(re.isObject(l)){const d=(u=a[c])!=null?u:{};a[c]=d,s(l,d);return}a[c]=l})}function s(o,a){Object.keys(o).forEach(l=>{var h,u;const c=o[l];if(re.isObject(c)){const d=(h=a[l])!=null?h:{};a[l]=d,s(c,d);return}if(re.isArray(c)){const d=(u=a[l])!=null?u:[];a[l]=d,r(c,d);return}a[l]=c})}function i(o){Object.keys(o).forEach(a=>{var c,h;const l=o[a];if(re.isArray(l)){const u=(c=t[a])!=null?c:[];t[a]=u,r(l,u);return}if(re.isObject(l)){const u=(h=t[a])!=null?h:{};t[a]=u,s(l,u);return}t[a]=l})}return t}static numberFixed(t,n){return Number(Number(t).toFixed(n))}static diffValue(t,n){return zi(t,n)}static deepClone(t){if(!this.isDefine(t))return t;if(this.isRegExp(t))return new RegExp(t);if(this.isDate(t))return new Date(t);if(this.isArray(t)){const n=[];return t.forEach((r,s)=>{n[s]=re.deepClone(r)}),n}if(this.isObject(t)){const n={};return Object.keys(t).forEach(r=>{const s=t[r];n[r]=re.deepClone(s)}),Object.setPrototypeOf(n,Object.getPrototypeOf(t)),n}return t}static getLanguage(){const t="en-US";return globalThis.navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||t}static getValueType(t){return Object.prototype.toString.apply(t)}static isDefine(t){return t!=null}static isBlank(t){return this.isDefine(t)?this.isString(t)?t.trim()==="":!1:!0}static isBoolean(t){return this.getValueType(t)==="[object Boolean]"}static isPlainObject(t){return this.isDefine(t)?Object.getPrototypeOf(t)===Object.getPrototypeOf({}):!1}static isFunction(t){return this.getValueType(t)==="[object Function]"}static isDate(t){return this.getValueType(t)==="[object Date]"}static isRegExp(t){return this.getValueType(t)==="[object RegExp]"}static isArray(t){return this.getValueType(t)==="[object Array]"}static isString(t){return this.getValueType(t)==="[object String]"}static isNumber(t){return this.getValueType(t)==="[object Number]"}static isStringNumber(t){return!isNaN(Number.parseFloat(t))&&isFinite(t)}static isObject(t){return this.getValueType(t)==="[object Object]"}static isEmptyObject(t){for(const n in t)return!1;return!0}static isMobile(){let t=0,n=0;return document.body.clientWidth&&(t=document.body.clientWidth),document.body.clientHeight&&(n=document.body.clientHeight),this.isAndroid()||this.isIPhone()||this.isTablet()||t<350&&n<500}static isTablet(){return/ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(navigator.userAgent.toLowerCase())}static isWeChat(){const t=navigator.userAgent.toLowerCase();return String(t.match(/MicroMessenger/i))==="micromessenger"}static isAndroid(){const t=navigator.userAgent;return t.indexOf("Android")>-1||t.indexOf("Linux")>-1}static isIPhone(){return/iPhone/i.test(navigator.userAgent)}static isLegalUrl(t){return Dp(t)}static normalizeUrl(t){return eu(t)}static topLevelDomainCombiningString(){return[...Jl].join("|")}static itCount(t){return n=>{for(let r=0;r<t;r++)n&&n()}}static hasLength(t,n){return re.isDefine(t)?re.isDefine(n)?t.length===n:t.length>0:!1}static capitalize(t){return t.charAt(0).toUpperCase()+t.slice(1)}static fCamelCase(t,n){return n.toUpperCase()}static camelCase(t){return t.replace(Lp,"ms-").replace(Up,this.fCamelCase)}static removeNull(t){return this.isObject(t)&&Object.keys(t).forEach(n=>{const r=t[n];r==null?delete t[n]:re.removeNull(r)}),t}static fillTwoDimensionalArray(t,n,r){return new Array(t).fill(r).map(s=>new Array(n).fill(r))}static numToWord(t){let n="";for(;t>0;){let r=t%26;r=r===0?r=26:r,n=String.fromCharCode(96+r)+n,t=(t-r)/26}return n.toLocaleUpperCase()}static ABCatNum(t){if(t==null||t.length===0)return Number.NaN;const n=t.toLowerCase().split(""),r=n.length;let s=0,i=0;for(let o=0;o<r;o++)i=n[o].charCodeAt(0)-96,s+=i*26**(r-o-1);return s===0?Number.NaN:s-1}static chatAtABC(t){let i="";for(;t>=0;)i=String.fromCharCode(t%26+97)+i,t=Math.floor(t/26)-1;return i.toUpperCase()}static randSort(t){for(let n=0,r=t.length;n<r;n++){const s=Number.parseInt((Math.random()*r).toString()),i=t[s];t[s]=t[n],t[n]=i}return t}static commonExtend(t,n){const r={};for(const s in t)r[s]=t[s];for(const s in n)n[s]!=null&&(r[s]=n[s]);return r}static commonExtend1(t,n){for(const r in t)n[r]==null&&(n[r]=t[r]);return n}static arrayToObject(t){const n={};return t.forEach((r,s)=>{n[s]={},r.forEach((i,o)=>{n[s][o]=i})}),n}static hasIntersectionBetweenTwoRanges(t,n,r,s){return n>=r&&s>=t}static isStartValidPosition(t){return/^[A-Za-z_]/.test(t)}static isValidParameter(t){const n=/[~!@#$%^&*()+=\-{}\[\]\|:;"'<>,?\/ ]+/.test(t),r=t.length<=255;return!n&&r}static clamp(t,n,r){return Math.max(n,Math.min(r,t))}static now(){return performance&&performance.now?performance.now():Date.now()}}function zt(e=21,t){return t?Tp(t,e)():Np(e)}function ri(...e){const t={},n=e.length;for(let r=n-1;r>=0;r--){const s=e[r];if(s){const i=Object.keys(s);for(const o of i)t[o]===void 0&&(t[o]=s[o])}}return t}const kp=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null;function Hr(e,t,n){const{dataStream:r,textRuns:s=[]}=e;let i=t;const o=[];for(const a of s){const{st:l,ed:c}=a;re.hasIntersectionBetweenTwoRanges(t,n,l,c)&&(l>i?(o.push(r.slice(i,l)),o.push(si(r,{...a,ed:Math.min(c,n)}))):o.push(si(r,{...a,st:i,ed:Math.min(c,n)}))),i=Math.max(t,Math.min(c,n))}return i!==n&&o.push(r.slice(i,n)),o.join("")}function $p(e,t=!0){var n;if(t&&((n=e.paragraphs)!=null&&n.length)){const{dataStream:r,paragraphs:s=[]}=e;let i="",o=-1;for(const a of s){const{startIndex:l,paragraphStyle:c={}}=a,{spaceAbove:h,spaceBelow:u,lineSpacing:d}=c,f=[];h!=null&&(typeof h=="number"?f.push(`margin-top: ${h}px`):f.push(`margin-top: ${h.v}px`)),u!=null&&(typeof u=="number"?f.push(`margin-bottom: ${u}px`):f.push(`margin-bottom: ${u.v}px`)),d!=null&&f.push(`line-height: ${d}`),l>o+1?i+=`<p class="UniverNormal" ${f.length?`style="${f.join("; ")};"`:""}>${Hr(e,o+1,l)}</p>`:i+=`<p class="UniverNormal" ${f.length?`style="${f.join("; ")};"`:""}></p>`,o=l}return o!==r.length&&(i+=Hr(e,o,r.length)),i}else return Hr(e,0,e.dataStream.length)}function si(e,t){const{st:n,ed:r,ts:s={}}=t,{ff:i,fs:o,it:a,bl:l,ul:c,st:h,ol:u,bg:d,cl:f,va:E}=s;let R=e.slice(n,r);const O=[];return a===Se.TRUE&&(R=`<i>${R}</i>`),E===Ut.SUPERSCRIPT?R=`<sup>${R}</sup>`:E===Ut.SUBSCRIPT&&(R=`<sub>${R}</sub>`),(c==null?void 0:c.s)===Se.TRUE&&(R=`<u>${R}</u>`),(h==null?void 0:h.s)===Se.TRUE&&(R=`<s>${R}</s>`),l===Se.TRUE&&(R=`<strong>${R}</strong>`),i&&O.push(`font-family: ${i}`),f&&O.push(`color: ${f.rgb}`),o&&O.push(`font-size: ${o}pt`),u&&O.push("text-decoration: overline"),d&&O.push(`background: ${d.rgb}`),O.length?`<span style="${O.join("; ")};">${R}</span>`:R}const tu={[Is.OFFICE]:{[gt.ACCENT1]:"#4472C4",[gt.ACCENT2]:"#ED7D31",[gt.ACCENT3]:"#A5A5A5",[gt.ACCENT4]:"#70AD47",[gt.ACCENT5]:"#5B9BD5",[gt.ACCENT6]:"#70AD47",[gt.DARK1]:"#000000",[gt.DARK2]:"#44546A",[gt.LIGHT1]:"#FFFFFF",[gt.LIGHT2]:"#E7E6E6",[gt.HYPERLINK]:"#0563C1",[gt.FOLLOWED_HYPERLINK]:"#954F72"}};class Cr{constructor(){C(this,"_themeValue",gt.LIGHT1);C(this,"_themeColors");C(this,"_themeTint");C(this,"_rgbValue","");C(this,"_colorType");this._colorType=vt.UNSUPPORTED,this._themeColors=Is.OFFICE,this._themeTint=0}asRgbColor(){return new os(this._rgbValue,this)}asThemeColor(){return new as(this._themeValue,this._themeTint,this._themeColors,this)}build(){switch(this._colorType){case vt.THEME:return this.asThemeColor();case vt.RGB:return this.asRgbColor();case vt.UNSUPPORTED:throw new Error("unsupported color type")}}setRgbColor(t){return this._colorType=vt.RGB,this._rgbValue=t,this}setThemeColors(t){this._colorType=vt.THEME,this._themeColors=t}setThemeTint(t){this._colorType=vt.THEME,this._themeTint=t}setThemeColor(t){return this._colorType=vt.THEME,this._themeValue=t,this}getColorType(){return this._colorType}}class En{constructor(t){C(this,"_builder");this._builder=t}static rgbColorToHexValue(t){return`#${((1<<24)+(t.getRed()<<16)+(t.getGreen()<<8)+t.getBlue()).toString(16).slice(1)}`}static hexValueToRgbColor(t){t?t.indexOf("#")>-1&&(t=t.substring(1)):t="#000000";const n=+`0x${t[0]}${t[1]}`,r=+`0x${t[2]}${t[3]}`,s=+`0x${t[4]}${t[5]}`;return new Cr().setRgbColor(`rgb(${n},${r},${s})`).asRgbColor()}static hexToRgbString(t){const n=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;t=t.replace(n,(i,o,a,l)=>o+o+a+a+l+l);const r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);let s=null;if(r){const i=Number.parseInt(r[1],16),o=Number.parseInt(r[2],16),a=Number.parseInt(r[3],16);s=`rgba(${i},${o},${a})`}return s}asRgbColor(){return this._builder.asRgbColor()}asThemeColor(){return this._builder.asThemeColor()}getColorType(){return this._builder.getColorType()}clone(){return new En(this._builder)}equals(t){return!1}}class nu{constructor(t){C(this,"_saturation",0);C(this,"_hue",0);C(this,"_lightness",0);C(this,"_alpha",0);const n=t.getRed()/255,r=t.getGreen()/255,s=t.getBlue()/255,i=t.getAlpha()/255,o=Math.min(n,Math.min(r,s)),a=Math.max(n,Math.max(r,s)),l=a-o;if(a===o){this._hue=0,this._saturation=0,this._lightness=a;return}this._lightness=(o+a)/2,this._lightness<.5?this._saturation=l/(a+o):this._saturation=l/(2-a-o),n===a&&(this._hue=(r-s)/l),r===a&&(this._hue=2+(s-n)/l),s===a&&(this._hue=4+(n-r)/l),this._hue*=60,this._hue<0&&(this._hue+=360),this._alpha=i}asRgbColor(){const t=new Cr;if(this._saturation===0)return t.setRgbColor(`rgba(${this._lightness*255},${this._lightness*255},${this._lightness*255},${this._alpha*255})`),t.asRgbColor();let n;this._lightness<.5?n=this._lightness*(1+this._saturation):n=this._lightness+this._saturation-this._lightness*this._saturation;const r=2*this._lightness-n,s=this._hue/360,i=s+1/3,o=this.setColor(n,r,i),a=this.setColor(n,r,s),l=s-1/3,c=this.setColor(n,r,l);return t.setRgbColor(`rgba(${Math.round(o*255)},${Math.round(a*255)},${Math.round(c*255)},${this._alpha*255})`),t.asRgbColor()}getLightness(){return this._lightness}getHue(){return this._hue}getSaturation(){return this._saturation}getAlpha(){return this._alpha}setColor(t,n,r){r<0&&(r+=1),r>1&&(r-=1);let s;return 6*r<1?s=n+(t-n)*6*r:2*r<1?s=t:3*r<2?s=n+(t-n)*(2/3-r)*6:s=n,s}setLightness(t){this._lightness=t}}const It=class It extends En{constructor(n,r){super(r);C(this,"_cssString");C(this,"_red");C(this,"_green");C(this,"_blue");C(this,"_alpha");let s=n.match(It.RGBA_EXTRACT);if(s){const i=+s[1],o=+s[2],a=+s[3],l=+s[4];this._cssString=n,this._red=i,this._green=o,this._blue=a,this._alpha=l;return}if(s=n.match(It.RGB_EXTRACT),s){const i=+s[1],o=+s[2],a=+s[3];this._cssString=n,this._red=i,this._green=o,this._blue=a,this._alpha=1;return}throw new Error("Invalid rgba or rgb color")}asHexString(){return En.rgbColorToHexValue(this)}getRed(){let n=this._red+It.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getGreen(){let n=this._green+It.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getBlue(){let n=this._blue+It.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getAlpha(){return this._alpha}getColorType(){return vt.RGB}clone(){return new It(this._cssString,this._builder)}asThemeColor(){throw new Error("rgb color not support to themeColor")}equals(n){return n instanceof It?n._red===this._red&&n._blue===this._blue&&n._green===this._green&&n._alpha===this._alpha:!1}getCssString(){return this._cssString}};C(It,"RGB_COLOR_AMT",0),C(It,"RGBA_EXTRACT",new RegExp("\\s*rgba\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d.\\d|\\d\\s*)\\)\\s*")),C(It,"RGB_EXTRACT",new RegExp("\\s*rgb\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*)\\)\\s*"));let os=It;const Zt=class Zt extends En{constructor(n,r,s,i){super(i);C(this,"_themeColorType");C(this,"_themeTint");C(this,"_themeColors");this._themeColorType=n,this._themeTint=r,this._themeColors=s}lumValue(n,r){if(n==null)return r;let s;return n<0?s=r*(1+n):s=r*(1-n)+(255-255*(1-n)),s}asRgbColor(){const n=tu[this._themeColors];if(n==null)throw new Error("not find themeColors type");const r=n[this._themeColorType];if(r==null)throw new Error("not find themeColors value");let s;if(Zt._cacheThemeColor.has(this._themeColors)){if(s=Zt._cacheThemeColor.get(this._themeColors),s.has(this._themeColorType))return s.get(this._themeColorType)}else s=new Map,Zt._cacheThemeColor.set(this._themeColors,s);const i=new nu(En.hexValueToRgbColor(r));i.setLightness(this.lumValue(this._themeTint,i.getLightness()*255)/255);const o=i.asRgbColor();return s.set(this._themeColorType,o),o}clone(){return new Zt(this._themeColorType,this._themeTint,this._themeColors,this._builder)}equals(n){return n instanceof Zt?n._themeColorType===this._themeColorType:!1}getColorType(){return vt.THEME}getThemeColorType(){return this._themeColorType}};C(Zt,"_cacheThemeColor",new Map);let as=Zt;const Bp="rgb(",jp="rgba(",ii={aliceBlue:[240,248,255],antiqueWhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blancheAlmond:[255,235,205],blue:[0,0,255],blueViolet:[138,43,226],brown:[165,42,42],burlyWood:[222,184,135],cadetBlue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornFlowerBlue:[100,149,237],cornSilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkCyan:[0,139,139],darkGoldenrod:[184,132,11],darkGray:[169,169,169],darkGreen:[0,100,0],darkGrey:[169,169,169],darkKhaki:[189,183,107],darkMagenta:[139,0,139],darkOliveGreen:[85,107,47],darkOrange:[255,140,0],darkOrchid:[153,50,204],darkRed:[139,0,0],darkSalmon:[233,150,122],darkSeaGreen:[143,188,143],darkSlateBlue:[72,61,139],darkSlateGray:[47,79,79],darkSlateGrey:[47,79,79],darkTurquoise:[0,206,209],darkViolet:[148,0,211],deepPink:[255,20,147],deepSkyBlue:[0,191,255],dimGray:[105,105,105],dimGrey:[105,105,105],dodgerBlue:[30,144,255],firebrick:[178,34,34],floralWhite:[255,255,240],forestGreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostWhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenYellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotPink:[255,105,180],indianRed:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderBlush:[255,240,245],lawnGreen:[124,252,0],lemonChiffon:[255,250,205],lightblue:[173,216,230],lightCoral:[240,128,128],lightCyan:[224,255,255],lightGoldenrodYellow:[250,250,210],lightGray:[211,211,211],lightGreen:[144,238,144],lightGrey:[211,211,211],lightPink:[255,182,193],lightSalmon:[255,160,122],lightSeaGreen:[32,178,170],lightSkyBlue:[135,206,250],lightSlateGray:[119,136,153],lightSlateGrey:[119,136,153],lightSteelBlue:[176,196,222],lightYellow:[255,255,224],lime:[0,255,0],limeGreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumAquamarine:[102,205,170],mediumBlue:[0,0,205],mediumOrchid:[186,85,211],mediumPurple:[147,112,219],mediumSeaGreen:[60,179,113],mediumSlateBlue:[123,104,238],mediumSpringGreen:[0,250,154],mediumTurquoise:[72,209,204],mediumVioletRed:[199,21,133],midBightBlue:[25,25,112],mintCream:[245,255,250],mistyRose:[255,228,225],moccasin:[255,228,181],navajoWhite:[255,222,173],navy:[0,0,128],oldLace:[253,245,230],olive:[128,128,0],oliveDrab:[107,142,35],orange:[255,165,0],orangeRed:[255,69,0],orchid:[218,112,214],paleGoldenrod:[238,232,170],paleGreen:[152,251,152],paleTurquoise:[175,238,238],paleVioletRed:[219,112,147],papayaWhip:[255,239,213],peachPuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderBlue:[176,224,230],purple:[128,0,128],rebeccaPurple:[102,51,153],red:[255,0,0],rosyBrown:[188,143,143],royalBlue:[65,105,225],saddleBrown:[139,69,19],salmon:[250,128,114],sandyBrown:[244,164,96],seaGreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyBlue:[135,206,235],slateBlue:[106,90,205],slateGray:[119,128,144],slateGrey:[119,128,144],snow:[255,255,250],springGreen:[0,255,127],steelBlue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whiteSmoke:[245,245,245],yellow:[255,255,0],yellowGreen:[154,205,5]};class bt{constructor(t){C(this,"_color");C(this,"_rgbColor");C(this,"_isValid",!1);if(t==null){this._setNullColor();return}if(t instanceof bt){this._color={...t._color},this._rgbColor={...t._rgbColor};return}const n=ru(t);if(n==null){this._setNullColor();return}this._color=n;const r=Vp(this._color);if(r==null){this._setNullColor();return}this._rgbColor=r,this._isValid=!0}static mix(t,n,r){var c,h;r=Math.min(1,Math.max(0,r));const s=new bt(t).toRgb(),i=new bt(n).toRgb(),o=(c=s.a)!=null?c:1,a=(h=i.a)!=null?h:1,l={r:(i.r-s.r)*r+s.r,g:(i.g-s.g)*r+s.g,b:(i.b-s.b)*r+s.b,a:(a-o)*r+o};return new bt(l)}static getContrastRatio(t,n){const r=new bt(t).getLuminance(),s=new bt(n).getLuminance();return(Math.max(r,s)+.05)/(Math.min(r,s)+.05)}get isValid(){return this._isValid}toRgb(){return this._rgbColor}toRgbString(){const{r:t,g:n,b:r,a:s=1}=this.toRgb(),i=s<1;return`rgb${i?"a":""}(${t},${n},${r}${i?`,${s}`:""})`}toString(){return this.toRgbString()}toHexString(t){const{r:n,g:r,b:s,a:i=1}=this.toRgb(),o=i<1,a=[wr(Math.round(n).toString(16)),wr(Math.round(r).toString(16)),wr(Math.round(s).toString(16)),wr(Math.round(i*255).toString(16))];return t&&a[0][0]===a[0][1]&&a[1][0]===a[1][1]&&a[2][0]===a[2][1]&&a[3][0]===a[3][1]?o?`#${a[0][0]}${a[1][0]}${a[2][0]}${a[3][0]}`:`#${a[0][0]}${a[1][0]}${a[2][0]}`:o?`#${a[0]}${a[1]}${a[2]}${a[3]}`:`#${a[0]}${a[1]}${a[2]}`}toHsv(){return Qp(this.toRgb())}toHsl(){return Xp(this.toRgb())}lighten(t=10){const n=this.toHsl();return n.l+=t,n.l=Math.min(Math.max(n.l,0),100),new bt(n)}darken(t=10){const n=this.toHsl();return n.l-=t,n.l=Math.min(Math.max(n.l,0),100),new bt(n)}setAlpha(t){return new bt({...this._rgbColor,a:t})}getLuminance(){let{r:t,g:n,b:r}=this.toRgb();return t=Ds(t),n=Ds(n),r=Ds(r),Number((.2126*t+.7152*n+.0722*r).toFixed(3))}getBrightness(){const{r:t,g:n,b:r}=this.toRgb();return(t*299+n*587+r*114)/1e3}getAlpha(){var t;return(t=this._color.a)!=null?t:1}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}_setNullColor(){this._isValid=!1,this._color={r:0,g:0,b:0,a:0},this._rgbColor={r:0,g:0,b:0,a:0}}}const wr=e=>e.length===1?`0${e}`:e,Ds=e=>(e/=255,e<=.03928?e/12.92:((e+.055)/1.055)**2.4),ru=e=>{if(Jp(e)){if("r"in e){const r={r:Math.round(e.r),g:Math.round(e.g),b:Math.round(e.b)};return e.a!==void 0&&(r.a=e.a),r}if("l"in e){const r={h:Math.round(e.h),s:e.s,l:e.l};return e.a!==void 0&&(r.a=e.a),r}const n={h:Math.round(e.h),s:e.s,v:e.v};return e.a!==void 0&&(n.a=e.a),n}const t=e.trim();if(ii[t]){const n=ii[t],r={r:Math.round(n[0]),g:Math.round(n[1]),b:Math.round(n[2])};return r.a=n[3]||1,r}if(t.startsWith("#"))return Hp(t);if(t.startsWith("rgb"))return Wp(t);if(t.startsWith("hsl"))return zp(t);if(t.startsWith("hsv"))return Yp(t)},Hp=e=>{const t=e.substring(1),n=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let r=t.match(n);if(!r||r.length<3)throw new Error(`The color '${e}' is illegal hex color`);r[0].length===1&&(r=r.map(i=>i+i));const s={r:Number.parseInt(r[0],16),g:Number.parseInt(r[1],16),b:Number.parseInt(r[2],16)};return r.length>3&&(s.a=Number.parseInt(r[3],16)/255),s},Wp=e=>{const t=e.indexOf("(");if(t===-1)throw new Error(`The color '${e}' is illegal rgb color`);const n=e.substring(t+1,e.length-1).split(",");if(n.length<3)throw new Error(`The color '${e}' is illegal rgb color`);const r={r:Number.parseInt(n[0],10),g:Number.parseInt(n[1],10),b:Number.parseInt(n[2],10)};return n.length>3&&(r.a=Number.parseFloat(n[3])),r},zp=e=>{const t=e.indexOf("(");if(t===-1)throw new Error(`The color '${e}' is illegal hsl color`);const n=e.substring(t+1,e.length-1).split(",");if(n.length<3)throw new Error(`The color '${e}' is illegal hsl color`);const r={h:Number.parseInt(n[0],10),s:Number.parseFloat(n[1]),l:Number.parseFloat(n[2])};return n.length>3&&(r.a=Number.parseFloat(n[3])),r},Yp=e=>{const t=e.indexOf("(");if(t===-1)throw new Error(`The color '${e}' is illegal hsv color`);const n=e.substring(t+1,e.length-1).split(",");if(n.length<3)throw new Error(`The color '${e}' is illegal hsv color`);const r={h:Number.parseInt(n[0],10),s:Number.parseFloat(n[1]),v:Number.parseFloat(n[2])};return n.length>3&&(r.a=Number.parseFloat(n[3])),r},Vp=e=>{const t=ru(e);if(t!=null)return"r"in t?t:"l"in t?Gp(t):Kp(t)},xs=(e,t,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),Gp=e=>{let{h:t,s:n,l:r}=e;t/=360,n/=100,r/=100;let s=0,i=0,o=0;if(n===0)s=i=o=r;else{const l=r<.5?r*(1+n):r+n-r*n,c=2*r-l;s=xs(c,l,t+1/3),i=xs(c,l,t),o=xs(c,l,t-1/3)}const a={r:Math.round(s*255),g:Math.round(i*255),b:Math.round(o*255)};return e.a!==void 0&&(a.a=e.a),a},Kp=e=>{let{h:t,s:n,v:r}=e;t=t/360*6,n/=100,r/=100;const s=Math.floor(t),i=t-s,o=r*(1-n),a=r*(1-i*n),l=r*(1-(1-i)*n),c=s%6,h=[r,a,o,o,l,r][c],u=[l,r,r,a,o,o][c],d=[o,o,l,r,r,a][c],f={r:h*255,g:u*255,b:d*255};return e.a!==void 0&&(f.a=e.a),f},Xp=e=>{let{r:t,g:n,b:r}=e;t/=255,n/=255,r/=255;const s=Math.max(t,n,r),i=Math.min(t,n,r),o=(s+i)/2;let a,l;if(s===i)a=l=0;else{const h=s-i;switch(l=o>.5?h/(2-s-i):h/(s+i),s){case t:a=(n-r)/h+(n<r?6:0);break;case n:a=(r-t)/h+2;break;default:a=(t-n)/h+4;break}a/=6}const c={h:Math.round(a*360),s:Math.round(l*100),l:Math.round(o*100)};return e.a!==void 0&&(c.a=e.a),c},Qp=e=>{let{r:t,g:n,b:r}=e;t/=255,n/=255,r/=255;const s=Math.max(t,n,r),i=Math.min(t,n,r);let o;const a=s,l=s-i,c=s===0?0:l/s;if(s===i)o=0;else{switch(s){case t:o=(n-r)/l+(n<r?6:0);break;case n:o=(r-t)/l+2;break;default:o=(t-n)/l+4;break}o/=6}const h={h:Math.round(o*360),s:Math.round(c*100),v:Math.round(a*100)};return e.a!==void 0&&(h.a=e.a),h},qp=e=>e==null,Jp=e=>!qp(e)&&typeof e=="object";function Zp(e){const t=/^#(?:[0]{3}|[0]{6})\b/,n=/^rgb\s*\(\s*0+\s*,\s*0+\s*,\s*0+\s*\)$/,r=/^rgba\s*\(\s*0+\s*,\s*0+\s*,\s*0+\s*,\s*(1|1\.0*|0?\.\d+)\)$/,s=/^hsl\s*\(\s*0*\s*,\s*0%*\s*,\s*0%*\s*\)$/,i=/^hsla\s*\(\s*0*\s*,\s*0%*\s*,\s*0%*\s*,\s*(1|1\.0*|0?\.\d+)\)$/;return!!(t.test(e)||n.test(e)||r.test(e)||s.test(e)||i.test(e))}function em(e){const t=/^#(?:[Ff]{3}|[Ff]{6})\b/,n=/^rgb\s*\(\s*255\s*,\s*255\s*,\s*255\s*\)$/,r=/^rgba\s*\(\s*255\s*,\s*255\s*,\s*255\s*,\s*(1|1\.0*|0?\.\d+)\)$/,s=/^hsl\s*\(\s*0*\s*,\s*0%*\s*,\s*100%*\s*\)$/,i=/^hsla\s*\(\s*0*\s*,\s*0%*\s*,\s*100%*\s*,\s*(1|1\.0*|0?\.\d+)\)$/;return!!(t.test(e)||n.test(e)||r.test(e)||s.test(e)||i.test(e))}var Pe=(e=>(e[e.COVER=0]="COVER",e[e.REPLACE=1]="REPLACE",e))(Pe||{});function tm(e){return e&&(e.s!==void 0||e.p!==void 0||e.v!==void 0||e.t!==void 0||e.f!==void 0||e.si!==void 0||e.custom!==void 0)}function nm(e){if(e.t!==void 0)return e.t;if(typeof e.v=="string")return nn.STRING;if(typeof e.v=="number")return nn.NUMBER;if(typeof e.v=="boolean")return nn.BOOLEAN}function rm(e){if(e==null)return!0;const{v:t,f:n,si:r,p:s,custom:i}=e;return!(!(t==null||typeof t=="string"&&t.length===0)||n!=null&&n.length>0||r!=null&&r.length>0||s!=null||i!=null)}function sm(e){return e!=null&&(typeof e=="string"||typeof e=="number"||typeof e=="boolean")}var xe=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ROW=1]="ROW",e[e.COLUMN=2]="COLUMN",e[e.ALL=3]="ALL",e))(xe||{}),tt=(e=>(e[e.NONE=0]="NONE",e[e.ROW=1]="ROW",e[e.COLUMN=2]="COLUMN",e[e.ALL=3]="ALL",e))(tt||{});function im(e){return[e.startRow,e.startColumn,e.endRow,e.endColumn]}var su=(e=>(e.NONE="none",e.BACKWARD="backward",e.FORWARD="forward",e))(su||{}),iu=(e=>(e.RECT="RECT",e.TEXT="TEXT",e))(iu||{});function om(e,t,n){let r=!1,s=!1,i=e,o=t,a=e,l=t;if(n==null)return{actualRow:e,actualColumn:t,isMergedMainCell:s,isMerged:r,endRow:i,endColumn:o,startRow:a,startColumn:l};for(let c=0;c<n.length;c++){const{startRow:h,endRow:u,startColumn:d,endColumn:f}=n[c];if(e===h&&t===d){i=u,o=f,a=h,l=d,s=!0;break}if(e>=h&&e<=u&&t>=d&&t<=f){i=u,o=f,a=h,l=d,r=!0;break}}return{actualRow:e,actualColumn:t,isMergedMainCell:s,isMerged:r,endRow:i,endColumn:o,startRow:a,startColumn:l}}var bn=(e=>(e.Raw="raw",e.Intercepted="intercepted",e.Both="both",e))(bn||{});function ou(e){const{actualRow:t,actualColumn:n,isMerged:r,isMergedMainCell:s,mergeInfo:i}=e;let{startY:o,endY:a,startX:l,endX:c}=e,h=t,u=n,d=t,f=n;if(r&&i){const{startRow:E,startColumn:R,endRow:O,endColumn:T,startY:V,endY:z,startX:oe,endX:N}=i;h=E,u=R,d=O,f=T,o=V,a=z,l=oe,c=N}return s&&(o=i.startY,a=i.endY,l=i.startX,c=i.endX,d=i.endRow,f=i.endColumn),{startRow:h,startColumn:u,endRow:d,endColumn:f,startY:o,endY:a,startX:l,endX:c}}const am=ou;function lm(e){if(!e)return;const{actualRow:t,actualColumn:n,isMerged:r,isMergedMainCell:s,startRow:i,startColumn:o,endRow:a,endColumn:l}=e;let c=t,h=n,u=t,d=n;return(r||s)&&(c=i,h=o,u=a,d=l),{startRow:c,startColumn:h,endRow:u,endColumn:d}}function au(e){var n;return!e||(((n=e==null?void 0:e.v)==null?void 0:n.toString())||"").length===0&&!e.p}function um(e){return au(e)&&(e==null?void 0:e.coverable)!==!1}function Nt(e){if(e){if(e.rgb)return e.rgb;if(e.th)return new Cr().setThemeColor(e.th).asThemeColor().asRgbColor().getCssString()}return null}function cm(e){return re.isString(e)&&e.substring(0,1)==="="&&e.length>1}function hm(e){return re.isString(e)&&e.length>0}function dm(e,t=!1){var i;let n="";const r=new Map([["ff",()=>{e.ff&&(n+=`font-family: ${e.ff}; `)}],["fs",()=>{if(e.fs){let o=e.fs;e.va&&(o/=2),n+=`font-size: ${o}pt; `}}],["it",()=>{e.it&&(n+="font-style: italic; ")}],["bl",()=>{e.bl&&(n+="font-weight: bold; ")}],["ul",()=>{var o;(o=e.ul)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} underline`):n+="text-decoration: underline; ",e.ul.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${Nt(e.ul.cl)}; `),e.ul.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.ul.t} `))}],["st",()=>{var o;(o=e.st)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} line-through`):n+="text-decoration-line: line-through; ",e.st.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${Nt(e.st.cl)}; `),e.st.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.st.t} `))}],["ol",()=>{var o;(o=e.ol)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} overline`):n+="text-decoration-line: overline; ",e.ol.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${Nt(e.ol.cl)}; `),e.ol.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.ol.t} `))}],["bg",()=>{e.bg&&(n+=`background: ${Nt(e.bg)}; `)}],["bd",()=>{var o,a,l,c,h,u,d,f,E,R,O,T;(o=e.bd)!=null&&o.b&&(n+=`border-bottom: ${Ar((a=e.bd)==null?void 0:a.b.s)} ${(l=Nt(e.bd.b.cl))!=null?l:""}; `),(c=e.bd)!=null&&c.t&&(n+=`border-top: ${Ar((h=e.bd)==null?void 0:h.t.s)} ${(u=Nt(e.bd.t.cl))!=null?u:""}; `),(d=e.bd)!=null&&d.r&&(n+=`border-right: ${Ar((f=e.bd)==null?void 0:f.r.s)} ${(E=Nt(e.bd.r.cl))!=null?E:""}; `),(R=e.bd)!=null&&R.l&&(n+=`border-left: ${Ar((O=e.bd)==null?void 0:O.l.s)} ${(T=Nt(e.bd.l.cl))!=null?T:""}; `)}],["cl",()=>{e.cl&&(n+=`color: ${Nt(e.cl)}; `)}],["va",()=>{e.va===Ut.SUBSCRIPT?n+="vertical-align: sub; ":e.va===Ut.SUPERSCRIPT&&(n+="vertical-align: super; ")}],["td",()=>{e.td===Pn.LEFT_TO_RIGHT?n+="direction: ltr; ":e.td===Pn.RIGHT_TO_LEFT&&(n+="direction: rtl; ")}],["tr",()=>{var o,a,l;e.tr&&(n+=`--data-rotate: (${(o=e.tr)==null?void 0:o.a}deg${(a=e.tr)!=null&&a.v?` ,${(l=e.tr)==null?void 0:l.v}`:""});`)}],["ht",()=>{e.ht===$t.LEFT?n+="text-align: left; ":e.ht===$t.RIGHT?n+="text-align: right; ":e.ht===$t.CENTER?n+="text-align: center; ":e.ht===$t.JUSTIFIED&&(n+="text-align: justify; ")}],["vt",()=>{e.vt===tn.BOTTOM?n+="vertical-align: bottom; ":e.vt===tn.TOP?n+="vertical-align: top; ":e.vt===tn.MIDDLE&&(n+="vertical-align: middle; ")}],["tb",()=>{e.tb===_n.CLIP?n+="white-space: nowrap; overflow-x: hidden; ":e.tb===_n.WRAP&&(n+="white-space: normal;")}],["pd",()=>{var h,u,d,f,E,R,O,T;const o=`${(h=e.pd)==null?void 0:h.b}pt`,a=`${(u=e.pd)==null?void 0:u.t}pt`,l=`${(d=e.pd)==null?void 0:d.l}pt`,c=`${(f=e.pd)==null?void 0:f.r}pt`;(E=e.pd)!=null&&E.b&&(n+=`padding-bottom: ${o}; `),(R=e.pd)!=null&&R.t&&(n+=`padding-top: ${a}; `),(O=e.pd)!=null&&O.l&&(n+=`padding-left: ${l}; `),(T=e.pd)!=null&&T.r&&(n+=`padding-right: ${c}; `)}]]),s=["bd","tr","tb"];for(const o in e)t&&s.includes(o)||(i=r.get(o))==null||i();return n}function Ar(e){let t="";return e===Xe.NONE?t="none":e===Xe.THIN?t="0.5pt solid":e===Xe.HAIR?t="0.5pt double":e===Xe.DOTTED?t="0.5pt dotted":e===Xe.DASHED||e===Xe.DASH_DOT?t="0.5pt dashed":e===Xe.DASH_DOT_DOT?t="0.5pt dotted":e===Xe.DOUBLE?t="0.5pt double":e===Xe.MEDIUM?t="1pt solid":e===Xe.MEDIUM_DASHED||e===Xe.MEDIUM_DASH_DOT?t="1pt dashed":e===Xe.MEDIUM_DASH_DOT_DOT?t="1pt dotted":e===Xe.SLANT_DASH_DOT?t="0.5pt dashed":e===Xe.THICK&&(t="1.5pt solid"),t}function fm(e){let t=0;if(e=e.trim(),e==="none")t=Xe.NONE;else if(e==="0.5pt solid")t=Xe.THIN;else if(e==="0.5pt double")t=Xe.HAIR;else if(e==="0.5pt dotted")t=Xe.DOTTED;else if(e==="0.5pt dashed")t=Xe.DASHED;else if(e==="1pt solid")t=Xe.MEDIUM;else if(e==="1pt dashed")t=Xe.MEDIUM_DASHED;else if(e==="1pt dotted")t=Xe.MEDIUM_DASH_DOT_DOT;else if(e==="1.5pt solid")t=Xe.THICK;else if(!e.includes("none"))t=Xe.THIN;else return Xe.NONE;return t}function gm(e,t){let n=e.body;if(t){const{headers:r,footers:s}=e;r!=null&&r[t]?n=r[t].body:s!=null&&s[t]&&(n=s[t].body)}return n}function pm(e,t){const{startRow:n,endRow:r,startColumn:s,endColumn:i,rangeType:o}=e;if(n<0||s<0||r<0||i<0||!(Number.isNaN(n)&&Number.isNaN(r))&&o===xe.COLUMN||!(Number.isNaN(s)&&Number.isNaN(i))&&o===xe.ROW||o!==xe.ROW&&o!==xe.COLUMN&&(Number.isNaN(s)||Number.isNaN(n)||Number.isNaN(i)||Number.isNaN(r)))return!1;if(t){const a=t.getRowCount(),l=t.getColumnCount();if(r>=a||i>=l)return!1}return!0}function mm(e,t){return{startRow:e,endRow:e,startColumn:t,endColumn:t}}function Yi(e,t){return Object.prototype.toString.call(e)===Object.prototype.toString.call(t)?Object.prototype.toString.call(e)==="[object Object]"||Object.prototype.toString.call(e)==="[object Array]"?Object.keys(e).length!==Object.keys(t).length?!1:Object.keys(e).every(n=>Yi(e[n],t[n])):e===t:!1}function lu(e,t){const n=e.ts||{},r=t.ts||{};return e.sId!==t.sId?!1:Yi(n,r)}function _m(e,t){return t.some(n=>e.indexOf(n)>-1)}var Wr={exports:{}},Em=Wr.exports,Go;function Cm(){return Go||(Go=1,function(e,t){(function(n,r){e.exports=r()})(Em,function(){var n=1e3,r=6e4,s=36e5,i="millisecond",o="second",a="minute",l="hour",c="day",h="week",u="month",d="quarter",f="year",E="date",R="Invalid Date",O=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,T=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,V={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(D){var b=["th","st","nd","rd"],S=D%100;return"["+D+(b[(S-20)%10]||b[S]||b[0])+"]"}},z=function(D,b,S){var F=String(D);return!F||F.length>=b?D:""+Array(b+1-F.length).join(S)+D},oe={s:z,z:function(D){var b=-D.utcOffset(),S=Math.abs(b),F=Math.floor(S/60),$=S%60;return(b<=0?"+":"-")+z(F,2,"0")+":"+z($,2,"0")},m:function D(b,S){if(b.date()<S.date())return-D(S,b);var F=12*(S.year()-b.year())+(S.month()-b.month()),$=b.clone().add(F,u),G=S-$<0,se=b.clone().add(F+(G?-1:1),u);return+(-(F+(S-$)/(G?$-se:se-$))||0)},a:function(D){return D<0?Math.ceil(D)||0:Math.floor(D)},p:function(D){return{M:u,y:f,w:h,d:c,D:E,h:l,m:a,s:o,ms:i,Q:d}[D]||String(D||"").toLowerCase().replace(/s$/,"")},u:function(D){return D===void 0}},N="en",A={};A[N]=V;var H="$isDayjsObject",J=function(D){return D instanceof j||!(!D||!D[H])},de=function D(b,S,F){var $;if(!b)return N;if(typeof b=="string"){var G=b.toLowerCase();A[G]&&($=G),S&&(A[G]=S,$=G);var se=b.split("-");if(!$&&se.length>1)return D(se[0])}else{var he=b.name;A[he]=b,$=he}return!F&&$&&(N=$),$||!F&&N},le=function(D,b){if(J(D))return D.clone();var S=typeof b=="object"?b:{};return S.date=D,S.args=arguments,new j(S)},m=oe;m.l=de,m.i=J,m.w=function(D,b){return le(D,{locale:b.$L,utc:b.$u,x:b.$x,$offset:b.$offset})};var j=function(){function D(S){this.$L=de(S.locale,null,!0),this.parse(S),this.$x=this.$x||S.x||{},this[H]=!0}var b=D.prototype;return b.parse=function(S){this.$d=function(F){var $=F.date,G=F.utc;if($===null)return new Date(NaN);if(m.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var se=$.match(O);if(se){var he=se[2]-1||0,ge=(se[7]||"0").substring(0,3);return G?new Date(Date.UTC(se[1],he,se[3]||1,se[4]||0,se[5]||0,se[6]||0,ge)):new Date(se[1],he,se[3]||1,se[4]||0,se[5]||0,se[6]||0,ge)}}return new Date($)}(S),this.init()},b.init=function(){var S=this.$d;this.$y=S.getFullYear(),this.$M=S.getMonth(),this.$D=S.getDate(),this.$W=S.getDay(),this.$H=S.getHours(),this.$m=S.getMinutes(),this.$s=S.getSeconds(),this.$ms=S.getMilliseconds()},b.$utils=function(){return m},b.isValid=function(){return this.$d.toString()!==R},b.isSame=function(S,F){var $=le(S);return this.startOf(F)<=$&&$<=this.endOf(F)},b.isAfter=function(S,F){return le(S)<this.startOf(F)},b.isBefore=function(S,F){return this.endOf(F)<le(S)},b.$g=function(S,F,$){return m.u(S)?this[F]:this.set($,S)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(S,F){var $=this,G=!!m.u(F)||F,se=m.p(S),he=function(Y,W){var ue=m.w($.$u?Date.UTC($.$y,W,Y):new Date($.$y,W,Y),$);return G?ue:ue.endOf(c)},ge=function(Y,W){return m.w($.toDate()[Y].apply($.toDate("s"),(G?[0,0,0,0]:[23,59,59,999]).slice(W)),$)},Te=this.$W,we=this.$M,v=this.$D,k="set"+(this.$u?"UTC":"");switch(se){case f:return G?he(1,0):he(31,11);case u:return G?he(1,we):he(0,we+1);case h:var K=this.$locale().weekStart||0,Q=(Te<K?Te+7:Te)-K;return he(G?v-Q:v+(6-Q),we);case c:case E:return ge(k+"Hours",0);case l:return ge(k+"Minutes",1);case a:return ge(k+"Seconds",2);case o:return ge(k+"Milliseconds",3);default:return this.clone()}},b.endOf=function(S){return this.startOf(S,!1)},b.$set=function(S,F){var $,G=m.p(S),se="set"+(this.$u?"UTC":""),he=($={},$[c]=se+"Date",$[E]=se+"Date",$[u]=se+"Month",$[f]=se+"FullYear",$[l]=se+"Hours",$[a]=se+"Minutes",$[o]=se+"Seconds",$[i]=se+"Milliseconds",$)[G],ge=G===c?this.$D+(F-this.$W):F;if(G===u||G===f){var Te=this.clone().set(E,1);Te.$d[he](ge),Te.init(),this.$d=Te.set(E,Math.min(this.$D,Te.daysInMonth())).$d}else he&&this.$d[he](ge);return this.init(),this},b.set=function(S,F){return this.clone().$set(S,F)},b.get=function(S){return this[m.p(S)]()},b.add=function(S,F){var $,G=this;S=Number(S);var se=m.p(F),he=function(we){var v=le(G);return m.w(v.date(v.date()+Math.round(we*S)),G)};if(se===u)return this.set(u,this.$M+S);if(se===f)return this.set(f,this.$y+S);if(se===c)return he(1);if(se===h)return he(7);var ge=($={},$[a]=r,$[l]=s,$[o]=n,$)[se]||1,Te=this.$d.getTime()+S*ge;return m.w(Te,this)},b.subtract=function(S,F){return this.add(-1*S,F)},b.format=function(S){var F=this,$=this.$locale();if(!this.isValid())return $.invalidDate||R;var G=S||"YYYY-MM-DDTHH:mm:ssZ",se=m.z(this),he=this.$H,ge=this.$m,Te=this.$M,we=$.weekdays,v=$.months,k=$.meridiem,K=function(W,ue,ae,B){return W&&(W[ue]||W(F,G))||ae[ue].slice(0,B)},Q=function(W){return m.s(he%12||12,W,"0")},Y=k||function(W,ue,ae){var B=W<12?"AM":"PM";return ae?B.toLowerCase():B};return G.replace(T,function(W,ue){return ue||function(ae){switch(ae){case"YY":return String(F.$y).slice(-2);case"YYYY":return m.s(F.$y,4,"0");case"M":return Te+1;case"MM":return m.s(Te+1,2,"0");case"MMM":return K($.monthsShort,Te,v,3);case"MMMM":return K(v,Te);case"D":return F.$D;case"DD":return m.s(F.$D,2,"0");case"d":return String(F.$W);case"dd":return K($.weekdaysMin,F.$W,we,2);case"ddd":return K($.weekdaysShort,F.$W,we,3);case"dddd":return we[F.$W];case"H":return String(he);case"HH":return m.s(he,2,"0");case"h":return Q(1);case"hh":return Q(2);case"a":return Y(he,ge,!0);case"A":return Y(he,ge,!1);case"m":return String(ge);case"mm":return m.s(ge,2,"0");case"s":return String(F.$s);case"ss":return m.s(F.$s,2,"0");case"SSS":return m.s(F.$ms,3,"0");case"Z":return se}return null}(W)||se.replace(":","")})},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(S,F,$){var G,se=this,he=m.p(F),ge=le(S),Te=(ge.utcOffset()-this.utcOffset())*r,we=this-ge,v=function(){return m.m(se,ge)};switch(he){case f:G=v()/12;break;case u:G=v();break;case d:G=v()/3;break;case h:G=(we-Te)/6048e5;break;case c:G=(we-Te)/864e5;break;case l:G=we/s;break;case a:G=we/r;break;case o:G=we/n;break;default:G=we}return $?G:m.a(G)},b.daysInMonth=function(){return this.endOf(u).$D},b.$locale=function(){return A[this.$L]},b.locale=function(S,F){if(!S)return this.$L;var $=this.clone(),G=de(S,F,!0);return G&&($.$L=G),$},b.clone=function(){return m.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},D}(),y=j.prototype;return le.prototype=y,[["$ms",i],["$s",o],["$m",a],["$H",l],["$W",c],["$M",u],["$y",f],["$D",E]].forEach(function(D){y[D[1]]=function(b){return this.$g(b,D[0],D[1])}}),le.extend=function(D,b){return D.$i||(D(b,j,le),D.$i=!0),le},le.locale=de,le.isDayjs=J,le.unix=function(D){return le(1e3*D)},le.en=A[N],le.Ls=A,le.p={},le})}(Wr)),Wr.exports}var Rm=Cm();const Kt=St(Rm);var zr={exports:{}},Im=zr.exports,Ko;function vm(){return Ko||(Ko=1,function(e,t){(function(n,r){e.exports=r()})(Im,function(){return function(n,r){var s=r.prototype,i=s.format;s.format=function(o){var a=this,l=this.$locale();if(!this.isValid())return i.bind(this)(o);var c=this.$utils(),h=(o||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(u){switch(u){case"Q":return Math.ceil((a.$M+1)/3);case"Do":return l.ordinal(a.$D);case"gggg":return a.weekYear();case"GGGG":return a.isoWeekYear();case"wo":return l.ordinal(a.week(),"W");case"w":case"ww":return c.s(a.week(),u==="w"?1:2,"0");case"W":case"WW":return c.s(a.isoWeek(),u==="W"?1:2,"0");case"k":case"kk":return c.s(String(a.$H===0?24:a.$H),u==="k"?1:2,"0");case"X":return Math.floor(a.$d.getTime()/1e3);case"x":return a.$d.getTime();case"z":return"["+a.offsetName()+"]";case"zzz":return"["+a.offsetName("long")+"]";default:return u}});return i.bind(this)(h)}}})}(zr)),zr.exports}var ym=vm();const Sm=St(ym);var Yr={exports:{}},Om=Yr.exports,Xo;function bm(){return Xo||(Xo=1,function(e,t){(function(n,r){e.exports=r()})(Om,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,s=/\d/,i=/\d\d/,o=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,l={},c=function(O){return(O=+O)+(O>68?1900:2e3)},h=function(O){return function(T){this[O]=+T}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(O){(this.zone||(this.zone={})).offset=function(T){if(!T||T==="Z")return 0;var V=T.match(/([+-]|\d\d)/g),z=60*V[1]+(+V[2]||0);return z===0?0:V[0]==="+"?-z:z}(O)}],d=function(O){var T=l[O];return T&&(T.indexOf?T:T.s.concat(T.f))},f=function(O,T){var V,z=l.meridiem;if(z){for(var oe=1;oe<=24;oe+=1)if(O.indexOf(z(oe,0,T))>-1){V=oe>12;break}}else V=O===(T?"pm":"PM");return V},E={A:[a,function(O){this.afternoon=f(O,!1)}],a:[a,function(O){this.afternoon=f(O,!0)}],Q:[s,function(O){this.month=3*(O-1)+1}],S:[s,function(O){this.milliseconds=100*+O}],SS:[i,function(O){this.milliseconds=10*+O}],SSS:[/\d{3}/,function(O){this.milliseconds=+O}],s:[o,h("seconds")],ss:[o,h("seconds")],m:[o,h("minutes")],mm:[o,h("minutes")],H:[o,h("hours")],h:[o,h("hours")],HH:[o,h("hours")],hh:[o,h("hours")],D:[o,h("day")],DD:[i,h("day")],Do:[a,function(O){var T=l.ordinal,V=O.match(/\d+/);if(this.day=V[0],T)for(var z=1;z<=31;z+=1)T(z).replace(/\[|\]/g,"")===O&&(this.day=z)}],w:[o,h("week")],ww:[i,h("week")],M:[o,h("month")],MM:[i,h("month")],MMM:[a,function(O){var T=d("months"),V=(d("monthsShort")||T.map(function(z){return z.slice(0,3)})).indexOf(O)+1;if(V<1)throw new Error;this.month=V%12||V}],MMMM:[a,function(O){var T=d("months").indexOf(O)+1;if(T<1)throw new Error;this.month=T%12||T}],Y:[/[+-]?\d+/,h("year")],YY:[i,function(O){this.year=c(O)}],YYYY:[/\d{4}/,h("year")],Z:u,ZZ:u};function R(O){var T,V;T=O,V=l&&l.formats;for(var z=(O=T.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(le,m,j){var y=j&&j.toUpperCase();return m||V[j]||n[j]||V[y].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(D,b,S){return b||S.slice(1)})})).match(r),oe=z.length,N=0;N<oe;N+=1){var A=z[N],H=E[A],J=H&&H[0],de=H&&H[1];z[N]=de?{regex:J,parser:de}:A.replace(/^\[|\]$/g,"")}return function(le){for(var m={},j=0,y=0;j<oe;j+=1){var D=z[j];if(typeof D=="string")y+=D.length;else{var b=D.regex,S=D.parser,F=le.slice(y),$=b.exec(F)[0];S.call(m,$),le=le.replace($,"")}}return function(G){var se=G.afternoon;if(se!==void 0){var he=G.hours;se?he<12&&(G.hours+=12):he===12&&(G.hours=0),delete G.afternoon}}(m),m}}return function(O,T,V){V.p.customParseFormat=!0,O&&O.parseTwoDigitYear&&(c=O.parseTwoDigitYear);var z=T.prototype,oe=z.parse;z.parse=function(N){var A=N.date,H=N.utc,J=N.args;this.$u=H;var de=J[1];if(typeof de=="string"){var le=J[2]===!0,m=J[3]===!0,j=le||m,y=J[2];m&&(y=J[2]),l=this.$locale(),!le&&y&&(l=V.Ls[y]),this.$d=function(F,$,G,se){try{if(["x","X"].indexOf($)>-1)return new Date(($==="X"?1e3:1)*F);var he=R($)(F),ge=he.year,Te=he.month,we=he.day,v=he.hours,k=he.minutes,K=he.seconds,Q=he.milliseconds,Y=he.zone,W=he.week,ue=new Date,ae=we||(ge||Te?1:ue.getDate()),B=ge||ue.getFullYear(),te=0;ge&&!Te||(te=Te>0?Te-1:ue.getMonth());var ie,pe=v||0,be=k||0,De=K||0,X=Q||0;return Y?new Date(Date.UTC(B,te,ae,pe,be,De,X+60*Y.offset*1e3)):G?new Date(Date.UTC(B,te,ae,pe,be,De,X)):(ie=new Date(B,te,ae,pe,be,De,X),W&&(ie=se(ie).week(W).toDate()),ie)}catch{return new Date("")}}(A,de,H,V),this.init(),y&&y!==!0&&(this.$L=this.locale(y).$L),j&&A!=this.format(de)&&(this.$d=new Date("")),l={}}else if(de instanceof Array)for(var D=de.length,b=1;b<=D;b+=1){J[1]=de[b-1];var S=V.apply(this,J);if(S.isValid()){this.$d=S.$d,this.$L=S.$L,this.init();break}b===D&&(this.$d=new Date(""))}else oe.call(this,N)}}})}(Yr)),Yr.exports}var wm=bm();const Am=St(wm);var Vr={exports:{}},Tm=Vr.exports,Qo;function Nm(){return Qo||(Qo=1,function(e,t){(function(n,r){e.exports=r()})(Tm,function(){return function(n,r,s){var i=r.prototype,o=function(u){return u&&(u.indexOf?u:u.s)},a=function(u,d,f,E,R){var O=u.name?u:u.$locale(),T=o(O[d]),V=o(O[f]),z=T||V.map(function(N){return N.slice(0,E)});if(!R)return z;var oe=O.weekStart;return z.map(function(N,A){return z[(A+(oe||0))%7]})},l=function(){return s.Ls[s.locale()]},c=function(u,d){return u.formats[d]||function(f){return f.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(E,R,O){return R||O.slice(1)})}(u.formats[d.toUpperCase()])},h=function(){var u=this;return{months:function(d){return d?d.format("MMMM"):a(u,"months")},monthsShort:function(d){return d?d.format("MMM"):a(u,"monthsShort","months",3)},firstDayOfWeek:function(){return u.$locale().weekStart||0},weekdays:function(d){return d?d.format("dddd"):a(u,"weekdays")},weekdaysMin:function(d){return d?d.format("dd"):a(u,"weekdaysMin","weekdays",2)},weekdaysShort:function(d){return d?d.format("ddd"):a(u,"weekdaysShort","weekdays",3)},longDateFormat:function(d){return c(u.$locale(),d)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};i.localeData=function(){return h.bind(this)()},s.localeData=function(){var u=l();return{firstDayOfWeek:function(){return u.weekStart||0},weekdays:function(){return s.weekdays()},weekdaysShort:function(){return s.weekdaysShort()},weekdaysMin:function(){return s.weekdaysMin()},months:function(){return s.months()},monthsShort:function(){return s.monthsShort()},longDateFormat:function(d){return c(u,d)},meridiem:u.meridiem,ordinal:u.ordinal}},s.months=function(){return a(l(),"months")},s.monthsShort=function(){return a(l(),"monthsShort","months",3)},s.weekdays=function(u){return a(l(),"weekdays",null,null,u)},s.weekdaysShort=function(u){return a(l(),"weekdaysShort","weekdays",3,u)},s.weekdaysMin=function(u){return a(l(),"weekdaysMin","weekdays",2,u)}}})}(Vr)),Vr.exports}var Mm=Nm();const Dm=St(Mm);var Gr={exports:{}},xm=Gr.exports,qo;function Lm(){return qo||(qo=1,function(e,t){(function(n,r){e.exports=r()})(xm,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,s,i){var o=s.prototype,a=o.format;i.en.formats=n,o.format=function(l){l===void 0&&(l="YYYY-MM-DDTHH:mm:ssZ");var c=this.$locale().formats,h=function(u,d){return u.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(f,E,R){var O=R&&R.toUpperCase();return E||d[R]||n[R]||d[O].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(T,V,z){return V||z.slice(1)})})}(l,c===void 0?{}:c);return a.call(this,h)}}})}(Gr)),Gr.exports}var Um=Lm();const Pm=St(Um);var Kr={exports:{}},Fm=Kr.exports,Jo;function km(){return Jo||(Jo=1,function(e,t){(function(n,r){e.exports=r()})(Fm,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(i,o,a){var l=o.prototype;a.utc=function(R){var O={date:R,utc:!0,args:arguments};return new o(O)},l.utc=function(R){var O=a(this.toDate(),{locale:this.$L,utc:!0});return R?O.add(this.utcOffset(),n):O},l.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var c=l.parse;l.parse=function(R){R.utc&&(this.$u=!0),this.$utils().u(R.$offset)||(this.$offset=R.$offset),c.call(this,R)};var h=l.init;l.init=function(){if(this.$u){var R=this.$d;this.$y=R.getUTCFullYear(),this.$M=R.getUTCMonth(),this.$D=R.getUTCDate(),this.$W=R.getUTCDay(),this.$H=R.getUTCHours(),this.$m=R.getUTCMinutes(),this.$s=R.getUTCSeconds(),this.$ms=R.getUTCMilliseconds()}else h.call(this)};var u=l.utcOffset;l.utcOffset=function(R,O){var T=this.$utils().u;if(T(R))return this.$u?0:T(this.$offset)?u.call(this):this.$offset;if(typeof R=="string"&&(R=function(N){N===void 0&&(N="");var A=N.match(r);if(!A)return null;var H=(""+A[0]).match(s)||["-",0,0],J=H[0],de=60*+H[1]+ +H[2];return de===0?0:J==="+"?de:-de}(R),R===null))return this;var V=Math.abs(R)<=16?60*R:R,z=this;if(O)return z.$offset=V,z.$u=R===0,z;if(R!==0){var oe=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(z=this.local().add(V+oe,n)).$offset=V,z.$x.$localOffset=oe}else z=this.utc();return z};var d=l.format;l.format=function(R){var O=R||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,O)},l.valueOf=function(){var R=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*R},l.isUTC=function(){return!!this.$u},l.toISOString=function(){return this.toDate().toISOString()},l.toString=function(){return this.toDate().toUTCString()};var f=l.toDate;l.toDate=function(R){return R==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():f.call(this)};var E=l.diff;l.diff=function(R,O,T){if(R&&this.$u===R.$u)return E.call(this,R,O,T);var V=this.local(),z=a(R).local();return E.call(V,z,O,T)}}})}(Kr)),Kr.exports}var $m=km();const Bm=St($m);var Xr={exports:{}},jm=Xr.exports,Zo;function Hm(){return Zo||(Zo=1,function(e,t){(function(n,r){e.exports=r()})(jm,function(){return function(n,r){r.prototype.weekday=function(s){var i=this.$locale().weekStart||0,o=this.$W,a=(o<i?o+7:o)-i;return this.$utils().u(s)?a:this.subtract(a,"day").add(s,"day")}}})}(Xr)),Xr.exports}var Wm=Hm();const zm=St(Wm);var Qr={exports:{}},Ym=Qr.exports,ea;function Vm(){return ea||(ea=1,function(e,t){(function(n,r){e.exports=r()})(Ym,function(){var n="week",r="year";return function(s,i,o){var a=i.prototype;a.week=function(l){if(l===void 0&&(l=null),l!==null)return this.add(7*(l-this.week()),"day");var c=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var h=o(this).startOf(r).add(1,r).date(c),u=o(this).endOf(n);if(h.isBefore(u))return 1}var d=o(this).startOf(r).date(c).startOf(n).subtract(1,"millisecond"),f=this.diff(d,n,!0);return f<0?o(this).startOf("week").week():Math.ceil(f)},a.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}})}(Qr)),Qr.exports}var Gm=Vm();const Km=St(Gm);var qr={exports:{}},Xm=qr.exports,ta;function Qm(){return ta||(ta=1,function(e,t){(function(n,r){e.exports=r()})(Xm,function(){return function(n,r){r.prototype.weekYear=function(){var s=this.month(),i=this.week(),o=this.year();return i===1&&s===11?o+1:s===0&&i>=52?o-1:o}}})}(qr)),qr.exports}var qm=Qm();const Jm=St(qm);Kt.extend(Am);Kt.extend(Sm);Kt.extend(zm);Kt.extend(Dm);Kt.extend(Km);Kt.extend(Jm);Kt.extend(Bm);Kt.extend(Pm);function vs(e,t,n,r){if(e>t)throw new Error("a1 should be less than a2");if(n>r)throw new Error("b1 should be less than b2");if(t<n||r<e)return[e,t];if(n<=e&&r>=t)return[];const s=r-n+1;return e<n&&t>r?[e,t-s]:n<=e&&r<t?[r+1-s,t-s]:n>e&&r>=t?[e,n-1]:[e,t]}function Zm(e){if(e==null)return!1;const t=e.bullet;return(t==null?void 0:t.listId)!=null}function e_(e){if(e==null)return!1;const t=e.paragraphStyle;return uu(t)}function uu(e){var t;return!(e==null||(e.indentStart==null||e.indentStart.v===0)&&e.hanging==null||((t=e.hanging)==null?void 0:t.v)===0)}function cu(e,t,n){return e.slice(0,t)+n+e.slice(t)}function hu(e,t,n){return t>n?e:e.slice(0,t)+e.slice(n)}const t_=/\s/g;function n_(e){return e===null||e.toString().replace(t_,"")===""||typeof e=="boolean"?!1:!isNaN(e)}function r_(e){let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+(t<<6)+(t<<16)-t;return t>>>0}const Ge=Symbol("newer"),rt=Symbol("older");class s_{constructor(t){C(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Ge],{done:!1,value:t.key}):{done:!0,value:void 0}}}class i_{constructor(t){C(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Ge],{done:!1,value:t.value}):{done:!0,value:void 0}}}class o_{constructor(t){C(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Ge],{done:!1,value:[t.key,t.value]}):{done:!0,value:void 0}}}var La,Ua;Ua=Ge,La=rt;class na{constructor(t,n){C(this,"key");C(this,"value");C(this,Ua);C(this,La);this.key=t,this.value=n,this[Ge]=void 0,this[rt]=void 0}toJSON(){return{key:this.key,value:this.value}}}class hr{constructor(...t){C(this,"_keymap");C(this,"size",0);C(this,"limit");C(this,"oldest");C(this,"newest");C(this,"_onShiftListeners",[]);if(Zn.hasLength(t,1)){if(Zn.isNumber(t[0])){const n=t[0];this._initialize(n,void 0);return}if(Zn.isIterable(t[0])){const n=t[0];this._initialize(0,n);return}return}if(Zn.hasLength(t,2)){const n=t[0],r=t[1];this._initialize(n,r)}}onShift(t){if(this._onShiftListeners.indexOf(t)===-1)return this._onShiftListeners.push(t),Qe(()=>gr(this._onShiftListeners,t));throw new Error("[LRUMap]: the listener has been registered!")}_initialize(t,n){this.oldest=void 0,this.newest=void 0,this.size=0,this.limit=t,this._keymap=new Map,n&&(this.assign(n),t<1&&(this.limit=this.size))}_markEntryAsUsed(t){t!==this.newest&&(t[Ge]&&(t===this.oldest&&(this.oldest=t[Ge]),t[Ge][rt]=t[rt]),t[rt]&&(t[rt][Ge]=t[Ge]),t[Ge]=void 0,t[rt]=this.newest,this.newest&&(this.newest[Ge]=t),this.newest=t)}assign(t){let n,r=this.limit||Number.MAX_VALUE;this._keymap.clear();const s=t[Symbol.iterator]();for(let i=s.next();!i.done;i=s.next()){const o=new na(i.value[0],i.value[1]);if(this._keymap.set(o.key,o),n?(n[Ge]=o,o[rt]=n):this.oldest=o,n=o,r--===0)throw new Error("overflow")}this.newest=n,this.size=this._keymap.size}set(t,n){let r=this._keymap.get(t);return r?(r.value=n,this._markEntryAsUsed(r),this):(this._keymap.set(t,r=new na(t,n)),this.newest?(this.newest[Ge]=r,r[rt]=this.newest):this.oldest=r,this.newest=r,++this.size,this.size>this.limit&&this.shift(),this)}shift(){const t=this.oldest;if(t)return this.oldest&&this.oldest[Ge]?(this.oldest=this.oldest[Ge],this.oldest[rt]=void 0):(this.oldest=void 0,this.newest=void 0),t[Ge]=t[rt]=void 0,this._keymap.delete(t.key),--this.size,this._onShiftListeners.forEach(n=>n(t)),[t.key,t.value]}get(t){const n=this._keymap.get(t);if(n)return this._markEntryAsUsed(n),n.value}has(t){return this._keymap.has(t)}find(t){const n=this._keymap.get(t);return n?n.value:void 0}delete(t){const n=this._keymap.get(t);if(n)return this._keymap.delete(n.key),n[Ge]&&n[rt]?(n[rt][Ge]=n[Ge],n[Ge][rt]=n[rt]):n[Ge]?(n[Ge][rt]=void 0,this.oldest=n[Ge]):n[rt]?(n[rt][Ge]=void 0,this.newest=n[rt]):this.oldest=this.newest=void 0,this.size--,n.value}clear(){this.oldest=void 0,this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new s_(this.oldest)}values(){return new i_(this.oldest)}entries(){return this[Symbol.iterator]()}[Symbol.iterator](){return new o_(this.oldest)}forEach(t,n){typeof n!="object"&&(n=this);let r=this.oldest;for(;r;)t.call(n,r.value,r.key,this),r=r[Ge]}toJSON(){const t=new Array(this.size);let n=0,r=this.oldest;for(;r;)t[n++]={key:r.key,value:r.value},r=r[Ge];return t}toString(){let t="",n=this.oldest;for(;n;)t+=`${String(n.key)}:${n.value}`,n=n[Ge],n&&(t+=" < ");return t}}class Zn{static hasLength(t,n){return t.length===n}static getValueType(t){return Object.prototype.toString.apply(t)}static isObject(t){return this.getValueType(t)==="[object Object]"}static isIterable(t){return t[Symbol.iterator]!=null}static isNumber(t){return this.getValueType(t)==="[object Number]"}}var Jr={exports:{}},a_=Jr.exports,ra;function l_(){return ra||(ra=1,function(e,t){(function(n,r){e.exports=r()})(typeof self<"u"?self:a_,function(){return function(){var n={d:function(_,g){for(var p in g)n.o(g,p)&&!n.o(_,p)&&Object.defineProperty(_,p,{enumerable:!0,get:g[p]})},o:function(_,g){return Object.prototype.hasOwnProperty.call(_,g)}},r={};n.d(r,{default:function(){return dt}});var s={1078:"af",1052:"sq",1118:"am",5121:"ar_DZ",15361:"ar_BH",3073:"ar_EG",2049:"ar_IQ",11265:"ar_JO",13313:"ar_KW",12289:"ar_LB",4097:"ar_LY",6145:"ar_MA",8193:"ar_OM",16385:"ar_QA",1025:"ar_SA",10241:"ar_SY",7169:"ar_TN",14337:"ar_AE",9217:"ar_YE",1067:"hy",1101:"as",2092:"az_AZ",1068:"az_AZ",1069:"eu",1059:"be",2117:"bn",1093:"bn_IN",5146:"bs",1026:"bg",1109:"my",1027:"ca",2052:"zh_CN",3076:"zh_HK",5124:"zh_MO",4100:"zh_SG",1028:"zh_TW",1050:"hr",1029:"cs",1030:"da",1125:"dv",2067:"nl_BE",1043:"nl_NL",1126:"bin",3081:"en_AU",10249:"en_BZ",4105:"en_CA",9225:"en_CB",2057:"en_GB",16393:"en_IN",6153:"en_IE",8201:"en_JM",5129:"en_NZ",13321:"en_PH",7177:"en_ZA",11273:"en_TT",1033:"en_US",12297:"en_ZW",1061:"et",1071:"mk",1080:"fo",1065:"fa",1124:"fil",1035:"fi",2060:"fr_BE",11276:"fr_CM",3084:"fr_CA",9228:"fr_CG",12300:"fr_CI",1036:"fr_FR",5132:"fr_LU",13324:"fr_ML",6156:"fr_MC",14348:"fr_MA",10252:"fr_SN",4108:"fr_CH",7180:"fr",1122:"fy_NL",2108:"gd_IE",1084:"gd",1110:"gl",1079:"ka",3079:"de_AT",1031:"de_DE",5127:"de_LI",4103:"de_LU",2055:"de_CH",1032:"el",1140:"gn",1095:"gu",1279:"en",1037:"he",1081:"hi",1038:"hu",1039:"is",1136:"ig_NG",1057:"id",1040:"it_IT",2064:"it_CH",1041:"ja",1099:"kn",1120:"ks",1087:"kk",1107:"km",1111:"kok",1042:"ko",1088:"ky",1108:"lo",1142:"la",1062:"lv",1063:"lt",2110:"ms_BN",1086:"ms_MY",1100:"ml",1082:"mt",1112:"mni",1153:"mi",1102:"mr",1104:"mn",2128:"mn",1121:"ne",1044:"no_NO",2068:"no_NO",1096:"or",1045:"pl",1046:"pt_BR",2070:"pt_PT",1094:"pa",1047:"rm",2072:"ro_MO",1048:"ro_RO",1049:"ru",2073:"ru_MO",1083:"se",1103:"sa",3098:"sr_SP",2074:"sr_SP",1072:"st",1074:"tn",1113:"sd",1115:"si",1051:"sk",1060:"sl",1143:"so",1070:"sb",11274:"es_AR",16394:"es_BO",13322:"es_CL",9226:"es_CO",5130:"es_CR",7178:"es_DO",12298:"es_EC",17418:"es_SV",4106:"es_GT",18442:"es_HN",2058:"es_MX",19466:"es_NI",6154:"es_PA",15370:"es_PY",10250:"es_PE",20490:"es_PR",1034:"es_ES",14346:"es_UY",8202:"es_VE",1089:"sw",2077:"sv_FI",1053:"sv_SE",1114:"syc",1064:"tg",1097:"ta",1092:"tt",1098:"te",1054:"th",1105:"bo",1073:"ts",1055:"tr",1090:"tk",1058:"uk",1056:"ur",2115:"uz_UZ",1091:"uz_UZ",1075:"ve",1066:"vi",1106:"cy",1076:"xh",1085:"yi",1077:"zu"};const i=/^([a-z\d]+)(?:[_-]([a-z\d]+))?(?:\.([a-z\d]+))?(?:@([a-z\d]+))?$/i,o={},a={group:" ",decimal:".",positive:"+",negative:"-",percent:"%",exponent:"E",nan:"NaN",infinity:"∞",ampm:["AM","PM"],mmmm6:["Muharram","Safar","Rabiʻ I","Rabiʻ II","Jumada I","Jumada II","Rajab","Shaʻban","Ramadan","Shawwal","Dhuʻl-Qiʻdah","Dhuʻl-Hijjah"],mmm6:["Muh.","Saf.","Rab. I","Rab. II","Jum. I","Jum. II","Raj.","Sha.","Ram.","Shaw.","Dhuʻl-Q.","Dhuʻl-H."],mmmm:["January","February","March","April","May","June","July","August","September","October","November","December"],mmm:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dddd:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ddd:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]};function l(_){const g=i.exec(_);if(!g)throw new SyntaxError("Malformed locale: ".concat(_));return{lang:g[1]+(g[2]?"_"+g[2]:""),language:g[1],territory:g[2]||"",codeset:g[3]||"",modifier:g[4]||""}}function c(_){if(typeof _=="number")return s[65535&_]||null;const g=parseInt(_,16);return isFinite(g)&&s[65535&g]?s[65535&g]||null:i.test(_)?_:null}function h(_){const g=c(_);let p=null;if(g){const w=l(g);p=o[w.lang]||o[w.language]||null}return p}function u(_){return Object.assign({},a,_)}function d(_,g){const p=typeof g=="object"?g:l(g);return o[p.lang]=u(_),p.language===p.lang||o[p.language]||(o[p.language]=u(_)),o[p.lang]}const f=u({group:","});function E(_,g){if(typeof _!="number")return _;if(_<0)return-E(-_,g);if(g){const p=10**(g||0)||1;return E(_*p,0)/p}return Math.round(_)}f.isDefault=!0,d({group:",",ampm:["上午","下午"],mmmm:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],mmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],ddd:["周日","周一","周二","周三","周四","周五","周六"]},"zh_CN"),d({group:",",nan:"非數值",ampm:["上午","下午"],mmmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],mmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],ddd:["週日","週一","週二","週三","週四","週五","週六"]},"zh_TW"),d({group:",",ampm:["午前","午後"],mmmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],mmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],ddd:["日","月","火","水","木","金","土"]},"ja"),d({group:",",ampm:["오전","오후"],mmmm:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],mmm:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],dddd:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],ddd:["일","월","화","수","목","금","토"]},"ko"),d({group:",",ampm:["ก่อนเที่ยง","หลังเที่ยง"],mmmm:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],mmm:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],dddd:["วันอาทิตย์","วันจันทร์","วันอังคาร","วันพุธ","วันพฤหัสบดี","วันศุกร์","วันเสาร์"],ddd:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."]},"th"),d({decimal:",",ampm:["dop.","odp."],mmmm:["ledna","února","března","dubna","května","června","července","srpna","září","října","listopadu","prosince"],mmm:["led","úno","bře","dub","kvě","čvn","čvc","srp","zář","říj","lis","pro"],dddd:["neděle","pondělí","úterý","středa","čtvrtek","pátek","sobota"],ddd:["ne","po","út","st","čt","pá","so"]},"cs"),d({group:".",decimal:",",mmmm:["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december"],mmm:["jan.","feb.","mar.","apr.","maj","jun.","jul.","aug.","sep.","okt.","nov.","dec."],dddd:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],ddd:["søn.","man.","tir.","ons.","tor.","fre.","lør."]},"da"),d({group:".",decimal:",",ampm:["a.m.","p.m."],mmmm:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],mmm:["jan.","feb.","mrt.","apr.","mei","jun.","jul.","aug.","sep.","okt.","nov.","dec."],dddd:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],ddd:["zo","ma","di","wo","do","vr","za"]},"nl"),d({group:","},"en"),d({decimal:",",nan:"epäluku",ampm:["ap.","ip."],mmmm:["tammikuuta","helmikuuta","maaliskuuta","huhtikuuta","toukokuuta","kesäkuuta","heinäkuuta","elokuuta","syyskuuta","lokakuuta","marraskuuta","joulukuuta"],mmm:["tammik.","helmik.","maalisk.","huhtik.","toukok.","kesäk.","heinäk.","elok.","syysk.","lokak.","marrask.","jouluk."],dddd:["sunnuntaina","maanantaina","tiistaina","keskiviikkona","torstaina","perjantaina","lauantaina"],ddd:["su","ma","ti","ke","to","pe","la"]},"fi"),d({group:" ",decimal:",",mmmm:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],mmm:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],dddd:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],ddd:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."]},"fr"),d({group:".",decimal:",",mmmm:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],mmm:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sept.","Okt.","Nov.","Dez."],dddd:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],ddd:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."]},"de"),d({group:".",decimal:",",ampm:["π.μ.","μ.μ."],mmmm:["Ιανουαρίου","Φεβρουαρίου","Μαρτίου","Απριλίου","Μαΐου","Ιουνίου","Ιουλίου","Αυγούστου","Σεπτεμβρίου","Οκτωβρίου","Νοεμβρίου","Δεκεμβρίου"],mmm:["Ιαν","Φεβ","Μαρ","Απρ","Μαΐ","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"],dddd:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"],ddd:["Κυρ","Δευ","Τρί","Τετ","Πέμ","Παρ","Σάβ"]},"el"),d({decimal:",",ampm:["de.","du."],mmmm:["január","február","március","április","május","június","július","augusztus","szeptember","október","november","december"],mmm:["jan.","febr.","márc.","ápr.","máj.","jún.","júl.","aug.","szept.","okt.","nov.","dec."],dddd:["vasárnap","hétfő","kedd","szerda","csütörtök","péntek","szombat"],ddd:["V","H","K","Sze","Cs","P","Szo"]},"hu"),d({group:".",decimal:",",ampm:["f.h.","e.h."],mmmm:["janúar","febrúar","mars","apríl","maí","júní","júlí","ágúst","september","október","nóvember","desember"],mmm:["jan.","feb.","mar.","apr.","maí","jún.","júl.","ágú.","sep.","okt.","nóv.","des."],dddd:["sunnudagur","mánudagur","þriðjudagur","miðvikudagur","fimmtudagur","föstudagur","laugardagur"],ddd:["sun.","mán.","þri.","mið.","fim.","fös.","lau."]},"is"),d({group:".",decimal:",",mmmm:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],mmm:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agu","Sep","Okt","Nov","Des"],dddd:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"],ddd:["Min","Sen","Sel","Rab","Kam","Jum","Sab"]},"id"),d({group:".",decimal:",",mmmm:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],mmm:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],dddd:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],ddd:["dom","lun","mar","mer","gio","ven","sab"]},"it"),d({decimal:",",ampm:["a.m.","p.m."],mmmm:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],mmm:["jan.","feb.","mar.","apr.","mai","jun.","jul.","aug.","sep.","okt.","nov.","des."],dddd:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],ddd:["søn.","man.","tir.","ons.","tor.","fre.","lør."]},"nb"),d({decimal:",",mmmm:["stycznia","lutego","marca","kwietnia","maja","czerwca","lipca","sierpnia","września","października","listopada","grudnia"],mmm:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","paź","lis","gru"],dddd:["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"],ddd:["niedz.","pon.","wt.","śr.","czw.","pt.","sob."]},"pl"),d({group:".",decimal:",",mmmm:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],mmm:["jan.","fev.","mar.","abr.","mai.","jun.","jul.","ago.","set.","out.","nov.","dez."],dddd:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"],ddd:["dom.","seg.","ter.","qua.","qui.","sex.","sáb."]},"pt"),d({decimal:",",nan:"не число",mmmm:["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"],mmm:["янв.","февр.","мар.","апр.","мая","июн.","июл.","авг.","сент.","окт.","нояб.","дек."],dddd:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],ddd:["вс","пн","вт","ср","чт","пт","сб"]},"ru"),d({decimal:",",mmmm:["januára","februára","marca","apríla","mája","júna","júla","augusta","septembra","októbra","novembra","decembra"],mmm:["jan","feb","mar","apr","máj","jún","júl","aug","sep","okt","nov","dec"],dddd:["nedeľa","pondelok","utorok","streda","štvrtok","piatok","sobota"],ddd:["ne","po","ut","st","št","pi","so"]},"sk"),d({group:".",decimal:",",ampm:["a. m.","p. m."],mmmm:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],mmm:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sept.","oct.","nov.","dic."],dddd:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],ddd:["dom.","lun.","mar.","mié.","jue.","vie.","sáb."]},"es"),d({decimal:",",ampm:["fm","em"],mmmm:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],mmm:["jan.","feb.","mars","apr.","maj","juni","juli","aug.","sep.","okt.","nov.","dec."],dddd:["söndag","måndag","tisdag","onsdag","torsdag","fredag","lördag"],ddd:["sön","mån","tis","ons","tors","fre","lör"]},"sv"),d({group:".",decimal:",",ampm:["ÖÖ","ÖS"],mmmm:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],mmm:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],dddd:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],ddd:["Paz","Pzt","Sal","Çar","Per","Cum","Cmt"]},"tr");function R(_,g,p){const w=_<0?-1:1,M=10**(g||2),U=10**(p||2);let L,P,I=Math.abs(_),Z=0,_e=0,q=0,me=1;if((_=I)%1==0)P=[_*w,1];else if(_<1e-19)P=[w,1e19];else if(_>1e19)P=[1e19*w,1];else{do if(I=1/(I-Math.floor(I)),L=me,me=me*Math.floor(I)+Z,Z=L,_e=q,q=Math.floor(_*me+.5),q>=M||me>=U)return[w*_e,Z];while(Math.abs(_-q/me)>=1e-10&&I!==Math.floor(I));P=[w*q,me]}return P}const O={overflow:"######",dateErrorThrows:!1,dateErrorNumber:!0,dateSpanLarge:!0,leap1900:!0,nbsp:!0,throws:!0,invalid:"######",locale:"",ignoreTimezone:!1},T=Object.assign({},O);function V(_){if(_===null&&(_=O),_){for(const g in _)if(g in O){const p=_[g];T[g]=p==null?O[g]:p}}return{...T}}const z={"#":"",0:"0","?":" "},oe={"@":"text","-":"minus","+":"plus"},N=["#000","#FFF","#F00","#0F0","#00F","#FF0","#F0F","#0FF","#000","#FFF","#F00","#0F0","#00F","#FF0","#F0F","#0FF","#800","#080","#008","#880","#808","#088","#CCC","#888","#99F","#936","#FFC","#CFF","#606","#F88","#06C","#CCF","#008","#F0F","#FF0","#0FF","#808","#800","#088","#00F","#0CF","#CFF","#CFC","#FF9","#9CF","#F9C","#C9F","#FC9","#36F","#3CC","#9C0","#FC0"],A=["¤","$","£","¥","֏","؋","৳","฿","៛","₡","₦","₩","₪","₫","€","₭","₮","₱","₲","₴","₸","₹","₺","₼","₽","₾","₿"],H=new RegExp("["+A.join("")+"]");function J(_,g,p){return g[p+"_max"]=_.length,g[p+"_min"]=_.replace(/#/g,"").length,g}const de={};function le(_){if(!(_ in de)){const g=[],p=_.replace(/^[#,]+/,"").replace(/[1-9]\d*/g,w=>"?".repeat(w.length));for(let w=0;w<p.length;w++){const M=p.charAt(w);g[w]=M in z?z[M]:M}de[_]=g.join("")}return de[_]}function m(_,g){typeof _=="string"&&(_={type:"string",value:_=_.replace(/ /g,z["?"])}),g.push(_)}function j(_){const g=[],p={scale:1,percent:!1,text:!1,date:0,date_eval:!1,date_system:1,sec_decimals:0,general:!1,clock:24,int_pattern:[],frac_pattern:[],man_pattern:[],den_pattern:[],num_pattern:[],tokens:g};let w=_+"",M="int",U=!1,L=null;const P=[];let I,Z,_e=!1;for(;w&&!U;){if(I=/^General/i.exec(w))p.general=!0,m({type:"general"},g);else if(M==="int"&&(I=/^[#?0]+(?:,[#?0]+)*/.exec(w))||M==="den"&&(I=/^[#?\d]+/.exec(w))||(I=/^[#?0]+/.exec(w)))p[M+"_pattern"].push(I[0]),L={type:M,num:I[0]},m(L,g);else if((I=/^\//.exec(w))&&p[M+"_pattern"].length){if(!L)throw new SyntaxError("Missing a numerator in pattern ".concat(_));p.fractions=!0,p.num_pattern.push(p[M+"_pattern"].pop()),L.type="num",M="den",m({type:"div"},g)}else if(I=/^,+/.exec(w)){const x=w.charAt(1)in z;Z.slice(-1)in z&&(I[0].length>1||!x)?p.scale=.001**I[0].length:p.dec_fractions||m(I[0],g)}else{if(I=/^;/.exec(w)){U=!0;break}if(I=/^[@+-]/.exec(w))I[0]==="@"&&(p.text=!0),m({type:oe[I[0]]},g);else if(I=/^(?:\[(h+|m+|s+)\])/i.exec(w)){const x=I[1].toLowerCase(),ee=x[0],Ce={type:"",size:0,date:1,raw:I[0],pad:x.length};ee==="h"?(Ce.size=16,Ce.type="hour-elap"):ee==="m"?(Ce.size=32,Ce.type="min-elap"):(Ce.size=64,Ce.type="sec-elap"),p.date=p.date|Ce.size,P.push(Ce),m(Ce,g)}else if(I=/^(?:B2)/i.exec(w))_e||(p.date_system=6);else if(I=/^(?:B1)/i.exec(w))_e||(p.date_system=1);else if(I=/^(?:([hHmMsSyYbBdDegG])\1*)/.exec(w)){const x={type:"",size:0,date:1,raw:I[0]},ee=I[0].toLowerCase(),Ce=ee[0];if(ee==="y"||ee==="yy")x.size=2,x.type="year-short";else if(Ce==="y"||Ce==="e")x.size=2,x.type="year";else if(ee==="b"||ee==="bb")x.size=2,x.type="b-year-short";else if(Ce==="b")x.size=2,x.type="b-year";else if(ee==="d"||ee==="dd")x.size=8,x.type="day",x.pad=/dd/.test(ee);else if(ee==="ddd")x.size=8,x.type="weekday-short";else if(Ce==="d")x.size=8,x.type="weekday";else if(Ce==="h")x.size=16,x.type="hour",x.pad=/hh/i.test(ee);else if(Ce==="m"){ee.length===3?(x.size=4,x.type="monthname-short"):ee.length===5?(x.size=4,x.type="monthname-single"):ee.length>=4&&(x.size=4,x.type="monthname");const Ae=P[P.length-1];!x.type&&Ae&&!Ae.used&&80&Ae.size&&(Ae.used=!0,x.size=32,x.type="min",x.pad=/mm/.test(ee)),x.type||(x.size=4,x.type="month",x.pad=/mm/.test(ee),x.indeterminate=!0)}else if(Ce==="s"){x.size=64,x.type="sec",x.pad=/ss/.test(ee);const Ae=P[P.length-1];Ae&&32&Ae.size?x.used=!0:Ae&&Ae.indeterminate&&(delete Ae.indeterminate,Ae.size=32,Ae.type="min",x.used=!0)}p.date=p.date|x.size,p.date_eval=!0,P.push(x),m(x,g)}else if(I=/^(?:AM\/PM|am\/pm|A\/P)/.exec(w))p.clock=12,p.date=16|p.date,p.date_eval=!0,m({type:"am",short:I[0]==="A/P"},g);else if(p.date&&(I=/^\.0{1,3}/i.exec(w))){const x=I[0].length-1,ee=[64,128,256,512][x];p.date=p.date|ee,p.date_eval=!0,p.sec_decimals=Math.max(p.sec_decimals,x),m({type:"subsec",size:ee,decimals:x,date:1,raw:I[0]},g)}else if((I=/^\\(.)/.exec(w))||(I=/^"([^"]*?)"/.exec(w)))m(I[1],g);else if(I=/^\[(<[=>]?|>=?|=)\s*(-?[.\d]+)\]/.exec(w))p.condition=[I[1],parseFloat(I[2],10)];else if(I=/^\[\$([^\]]+)\]/.exec(w)){const x=I[1].split("-"),ee=x.length<2?"":x[x.length-1],Ce=x[0];Ce&&m(Ce,g);const Ae=c(ee);Ae&&(p.locale=Ae);const Ue=parseInt(ee,16);isFinite(Ue)&&16711680&Ue&&(Ue>>16&255)===6&&(p.date_system=6),_e=!0}else if(I=/^\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*(\d+))\]/i.exec(w))p.color=I[2]?N[parseInt(I[2],10)]||"#000":I[1].toLowerCase();else if(!(I=/^\[(DBNum1|ENG|HIJ|JPN|TWN)\]/i.exec(w))){if(I=/^%/.exec(w))p.scale=100,p.percent=!0,m("%",g);else if(I=/^_(\\.|.)/.exec(w))m(" ",g);else if(I=/^\./.exec(w))m({type:"point",value:I[0]},g),p.dec_fractions=!0,M="frac";else if(I=/^[Ee]([+-]?|(?=[0#?]))/.exec(w))p.exponential=!0,p.exp_plus=I[1]==="+",M="man",m({type:"exp",plus:I[1]==="+"},g);else if(!(I=/^\*(\\.|.)/.exec(w))){if(I=/^[BENn[]/.exec(w))throw new SyntaxError("Unexpected char ".concat(w.charAt(0)," in pattern ").concat(_));w[0]==="("&&(p.parens=!0),I=[w[0]],m(I[0],g)}}}Z=I[0],w=w.slice(I?I[0].length:1)}if(p.pattern=_.slice(0,_.length-w.length),/^((?:\[[^\]]+\])+)(;|$)/.test(p.pattern)&&!/^\[(?:h+|m+|s+)\]/.test(p.pattern)&&m({type:"text"},g),p.fractions&&p.dec_fractions||p.fractions&&p.exponential)throw new SyntaxError("Invalid pattern: ".concat(p.pattern));const q=p.int_pattern.join("");if(p.grouping=q.indexOf(",")>=0,p.grouping){const x=q.split(","),ee=x.length;ee===2?(p.group_pri=x[1].length,p.group_sec=p.group_pri):ee>2&&(p.group_pri=x[ee-1].length,p.group_sec=x[ee-2].length)}else p.group_pri=0,p.group_sec=0;J(q.replace(/[,]/g,""),p,"int"),J(p.frac_pattern.join(""),p,"frac"),J(p.man_pattern.join(""),p,"man");let me=p.num_pattern.join(""),ye=p.den_pattern.join("");const ce=/\?/.test(ye)||/\?/.test(me);return ye=ye.replace(/\d/g,ce?"?":"#"),ce&&(ye=ye.replace(/#$/g,"?")),J(me,p,"num"),J(ye,p,"den"),ce&&(me=me.replace(/#$/g,"?")),p.int_padding=le(p.int_pattern.join("")),p.man_padding=le(p.man_pattern.join("")),p.num_padding=le(me),p.den_padding=le(ye),p.den_pattern.length&&(p.denominator=parseInt(p.den_pattern.join("").replace(/\D/g,""),10)),p.integer=!!p.int_pattern.join("").length,p.fractions&&g.forEach((x,ee)=>{const Ce=g[ee+1];x.type==="string"&&Ce&&(Ce.type==="num"?x.rule="num+int":Ce.type==="div"?x.rule="num":Ce.type==="den"&&(x.rule="den"))}),p}const y=_=>{const g=_.condition;g&&g[1]<0&&(g[0]==="<"||g[0]==="<="||g[0]==="=")||_.tokens.unshift({type:"minus",volatile:!0})};function D(_){const g=[];let p,w=!1,M=null,U=_,L=0,P=!1,I=0,Z=0;do{if(P=j(U),(P.date||P.general)&&(P.int_pattern.length||P.frac_pattern.length||P.scale!==1||P.text))throw new Error("Illegal format");if(P.condition&&(Z++,w=!0),P.text){if(M)throw new Error("Unexpected partition");M=P}P.locale&&(p=c(P.locale)),g.push(P),L=U.charAt(P.pattern.length)===";"?1:0,U=U.slice(P.pattern.length+L),I++}while(L&&I<4&&Z<3);if(L)throw new Error("Unexpected partition");if(Z>2)throw new Error("Unexpected condition");const _e=g[3];if(_e&&(_e.int_pattern.length||_e.frac_pattern.length||_e.date))throw new Error("Unexpected partition");if(w){const q=g.length;if(q===1&&(g[1]=j("General"),g[1].generated=!0),q<3){const me=g[0],ye=g[1];if(y(me),ye.condition)y(ye);else{const ce=me.condition;(ce[0]==="="||ce[1]>=0&&(ce[0]===">"||ce[0]===">="))&&ye.tokens.unshift({type:"minus",volatile:!0})}}else g.forEach(y)}else{if(g.length<4&&M)for(let q=0,me=g.length;q<me;q++)g[q]===M&&g.splice(q,1);if(g.length<1&&M&&(g[0]=j("General"),g[0].generated=!0),g.length<2){const q=j(g[0].pattern);q.tokens.unshift({type:"minus",volatile:!0}),q.generated=!0,g.push(q)}if(g.length<3){const q=j(g[0].pattern);q.generated=!0,g.push(q)}if(g.length<4)if(M)g.push(M);else{const q=j("@");q.generated=!0,g.push(q)}g[0].condition=[">",0],g[1].condition=["<",0],g[2].condition=null}return{pattern:_,partitions:g,locale:p}}const b=Math.floor;function S(_){if((!(arguments.length>1&&arguments[1]!==void 0)||arguments[1])&&_>=0){if(_===0)return[1900,1,0];if(_===60)return[1900,2,29];if(_<60)return[1900,_<32?1:2,(_-1)%31+1]}let p=_+68569+2415019;const w=b(4*p/146097);p-=b((146097*w+3)/4);const M=b(4e3*(p+1)/1461001);p=p-b(1461*M/4)+31;const U=b(80*p/2447),L=p-b(2447*U/80);p=b(U/11);const P=U+2-12*p;return[0|100*(w-49)+M+p,0|P,0|L]}function F(_){return S(_+1462)}function $(_){if(_===60)throw new Error("#VALUE!");if(_<=1)return[1317,8,29];if(_<60)return[1317,_<32?9:10,1+(_-2)%30];const g=10631/30,p=.1335;let w=_+466935;const M=b(w/10631);w-=10631*M;const U=b((w-p)/g);w-=b(U*g+p);const L=b((w+28.5001)/29.5);return L===13?[30*M+U,12,30]:[30*M+U,L,w-b(29.5001*L-29)]}function G(_){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];const w=b(_);return g===6?$(w):g===-1?F(w):S(w,p)}const se=Math.floor,he=86400;function ge(_,g){let p=null;if(Array.isArray(_)){const[w,M,U,L,P,I]=_;p=Date.UTC(w,M==null?0:M-1,U!=null?U:1,L||0,P||0,I||0)}else if(_ instanceof Date&&(p=1*_,!g||!g.ignoreTimezone)){const w=new Date;w.setUTCFullYear(_.getFullYear(),_.getMonth(),_.getDate()),w.setUTCHours(_.getHours(),_.getMinutes(),_.getSeconds(),_.getMilliseconds()),p=1*w}if(p!=null&&isFinite(p)){const w=p/864e5;return w-(w<=-25509?-25568:-25569)}return _}function Te(_,g){let p=0|_;const w=he*(_-p);let M=se(w);w-M>.9999&&(M+=1,M===he&&(M=0,p+=1));const U=M<0?he+M:M,[L,P,I]=G(_,0,g&&g.leap1900),Z=se(U/60/60)%60,_e=se(U/60)%60,q=se(U)%60;if(g&&g.nativeDate){const me=new Date(0);return me.setUTCFullYear(L,P-1,I),me.setUTCHours(Z,_e,q),me}return[L,P,I,Z,_e,q]}function we(_){return!!(_[0]&&_[0].percent||_[1]&&_[1].percent||_[2]&&_[2].percent||_[3]&&_[3].percent)}function v(_){return!!(_[0]&&_[0].date||_[1]&&_[1].date||_[2]&&_[2].date||_[3]&&_[3].date)}function k(_){const[g,p,w,M]=_;return!(g&&!g.generated||p&&!p.generated||w&&!w.generated||!M||!M.text||M.generated)}const K={text:15,datetime:10.8,date:10.8,time:10.8,percent:10.6,currency:10.4,grouped:10.2,scientific:6,number:4,fraction:2,general:0,error:0},Q=[["DMY",1],["DM",2],["MY",3],["MDY",4],["MD",5],["hmsa",6],["hma",7],["hms",8],["hm",9]],Y={total:1,sign:0,period:0,int:1,frac:0},W=(_,g)=>_.replace(/\./,g.decimal);function ue(_,g,p,w){const M=0|p;if(typeof p=="string")_.push(p);else if(p===M)_.push(Math.abs(M));else{const U=Math.abs(p);let L=U?Math.floor(Math.log10(U)):0,P=L<0?U*10**-L:U/10**L;P===10&&(P=1,L++);const I=function(_e){let q=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];const me=Math.abs(_e);if(!me)return Y;const ye=q&&_e<0?1:0,ce=Math.floor(me),x=Math.floor(Math.log10(me)+1);let ee=0,Ce=0;if(ce!==me){ee=1;const Ae=String(E(x<0?me*10**-x:me/10**x,15));let Ue=Ae.length,Fe=!0,He=0;for(;He<=Ae.length;){if(Ae[He]==="."){Ue--;break}Ae[He]==="0"&&Fe?Ue--:Fe=!1,He++}Ce=Ue-x,Ce<0&&(Ce=0,ee=0)}return{total:ye+Math.max(x,1)+ee+Ce,digits:Math.max(x,0)+Ce,sign:ye,period:ee,int:Math.max(x,1),frac:Ce}}(U),Z=()=>{const _e=Math.abs(L);let q;q=P===1?P:E(P,5),_.push(W(q+"",w),w.exponent,L<0?w.negative:w.positive,_e<10?"0":"",_e)};if(L>=-4&&L<=-1){const _e=U.toPrecision(10+L).replace(/\.?0+$/,"");_.push(W(_e,w))}else if(L===10){const _e=U.toFixed(10).slice(0,12).replace(/\.$/,"");_.push(W(_e,w))}else if(Math.abs(L)<=9)if(I.total<=11){const _e=E(U,9).toFixed(I.frac);_.push(W(_e,w))}else L===9?_.push(Math.floor(U)):L>=0&&L<9?_.push(E(U,9-L)):Z();else I.total>=12?Z():Math.floor(U)===U?_.push(Math.floor(U)):_.push(W(E(U,9).toFixed(I.frac),w))}return _}const ae=86400,B={int:"integer",frac:"fraction",man:"mantissa",num:"numerator",den:"denominator"},te=function(_){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const p=Math.floor(Math.log10(_));return g>1?Math.floor(p/g)*g:p};function ie(_,g,p,w){let M="",U="",L="",P="",I="",Z=0,_e=0|_,q=0,me=0,ye=1,ce=0,x=0,ee=0,Ce=0,Ae=0,Ue=0;const Fe=w||f;if(!g.text&&isFinite(g.scale)&&g.scale!==1&&(_=function(Ie){if(Ie===0)return Ie;const Me=Math.ceil(Math.log10(Ie<0?-Ie:Ie)),ne=10**(16-Math.floor(Me));return Math.round(Ie*ne)/ne}(_*g.scale)),g.exponential){let Ie=Math.abs(_);if(Ie){const Me=10**-te(Ie,g.int_max),ne=E(Ie*Me,g.frac_max)/Me;Z=te(ne,g.int_max)}Ie/=10**Z,_=_<0?-Ie:Ie,M+=Math.abs(Z)}if(g.integer){const Ie=Math.abs(E(_,g.fractions?1:g.frac_max));I+=Ie<1?"":Math.floor(Ie)}if(g.grouping){let Ie="",Me=I.length;for(Me>g.group_pri&&(Me-=g.group_pri,Ie=Fe.group+I.slice(Me,Me+g.group_pri)+Ie);Me>g.group_sec;)Me-=g.group_sec,Ie=Fe.group+I.slice(Me,Me+g.group_sec)+Ie;I=Me?I.slice(0,Me)+Ie:Ie}g.dec_fractions&&(P=String(E(_,g.frac_max)).split(".")[1]||"");let He=!1;if(g.fractions){const Ie=Math.abs(g.integer?_%1:_);if(Ie)if(He=!0,isFinite(g.denominator))L+=g.denominator,U+=E(Ie*g.denominator),U==="0"&&(U="",L="",He=!1,I||(I="0"));else{const Me=R(Ie,g.integer?g.num_max:1/0,g.den_max);U+=Me[0],L+=Me[1],g.integer&&U==="0"&&(I||(I="0"),U="",L="",He=!1)}}if(g.date){_e=Math.trunc(_);const Ie=ae*(_-_e);if(q=Math.floor(Ie),Ue=Ie-q,Math.abs(Ue)<1e-6?Ue=0:Ue>.9999&&(Ue=0,q+=1,q===ae&&(q=0,_e+=1)),Ue){const Me=512&g.date||256&g.date||128&g.date;(Me===512&&Ue>.9995||Me===256&&Ue>.995||Me===128&&Ue>.95||!Me&&Ue>=.5)&&(q++,Ue=0)}if(_e||g.date_system){const Me=G(_,g.date_system,p.leap1900);me=Me[0],ye=Me[1],ce=Me[2]}if(q){const Me=q<0?ae+q:q;Ae=Math.floor(Me)%60,Ce=Math.floor(Me/60)%60,ee=Math.floor(Me/60/60)%60}if(x=(6+_e)%7,g.date_eval&&(ft=_,pt=_e+q/ae,p.dateSpanLarge?ft<-694324||pt>=35830291:ft<0||pt>=2958466)){if(p.dateErrorThrows)throw new Error("Date out of bounds");return p.dateErrorNumber?ue(_<0?[Fe.negative]:[],0,_,Fe).join(""):p.overflow}}var ft,pt;if(g.int_padding&&(I=g.int_padding.length===1?I||g.int_padding:g.int_padding.substring(0,g.int_padding.length-I.length)+I),g.num_padding&&(U=g.num_padding.length===1?U||g.num_padding:g.num_padding.substring(0,g.num_padding.length-U.length)+U),g.den_padding&&(L=g.den_padding.length===1?L||g.den_padding:L+g.den_padding.slice(L.length)),g.man_padding){const Ie=g.exp_plus?"+":"";M=g.man_padding.length===1?(Z<0?"-":Ie)+(M||g.man_padding):(Z<0?"-":Ie)+g.man_padding.slice(0,g.man_padding.length-M.length)+M}const Ee=[];let Ze=0;const ve={int:0,frac:0,man:0,num:0,den:0};for(let Ie=0,Me=g.tokens.length;Ie<Me;Ie++){const ne=g.tokens[Ie],ut=ne.num?ne.num.length:0;if(ne.type==="string")ne.rule?ne.rule==="num"?He?Ee.push(ne.value):(g.num_min>0||g.den_min>0)&&Ee.push(ne.value.replace(/./g,z["?"])):ne.rule==="num+int"?He&&I?Ee.push(ne.value):g.den_min>0&&(I||g.num_min)&&Ee.push(ne.value.replace(/./g,z["?"])):ne.rule==="den"&&(He?Ee.push(ne.value):(g.den_min>0||g.den_min>0)&&Ee.push(ne.value.replace(/./g,z["?"]))):Ee.push(ne.value);else if(ne.type==="error")Ee.push(p.invalid);else if(ne.type==="point")Ee.push(g.date?ne.value:Fe.decimal);else if(ne.type==="general")ue(Ee,0,_,Fe);else if(ne.type==="exp")Ee.push(Fe.exponent);else if(ne.type==="minus")ne.volatile&&g.date||ne.volatile&&(_>=0||typeof _!="number")||(ne.volatile&&!g.fractions&&(g.integer||g.dec_fractions)?(_<0&&I&&I!=="0"||P)&&Ee.push(Fe.negative):Ee.push(Fe.negative));else if(ne.type==="plus")Ee.push(Fe.positive);else if(ne.type==="text")Ee.push(_);else if(ne.type==="div")He?Ee.push("/"):g.num_min>0||g.den_min>0?Ee.push(z["?"]):Ee.push(z["#"]);else if(ne.type==="int")if(g.int_pattern.length===1)Ee.push(I);else{const Be=Ze?g.int_pattern.join("").length-ve.int:1/0,Tt=Ze===g.int_pattern.length-1?0:g.int_pattern.join("").length-(ve.int+ne.num.length);Ee.push(I.substring(I.length-Be,I.length-Tt)),Ze++,ve.int+=ne.num.length}else if(ne.type==="frac"){const Be=ve.frac;for(let Tt=0;Tt<ut;Tt++)Ee.push(P[Tt+Be]||z[ne.num[Tt]]);ve.frac+=ut}else if(ne.type in B)g[ne.type+"_pattern"].length===1?(ne.type==="int"&&Ee.push(I),ne.type==="frac"&&Ee.push(P),ne.type==="man"&&Ee.push(M),ne.type==="num"&&Ee.push(U),ne.type==="den"&&Ee.push(L)):(Ee.push(B[ne.type].slice(ve[ne.type],ve[ne.type]+ut)),ve[ne.type]+=ut);else if(ne.type==="year")me<0&&Ee.push(Fe.negative),Ee.push(String(Math.abs(me)).padStart(4,"0"));else if(ne.type==="year-short"){const Be=me%100;Ee.push(Be<10?"0":"",Be)}else if(ne.type==="month")Ee.push(ne.pad&&ye<10?"0":"",ye);else if(ne.type==="monthname-single")g.date_system===6?Ee.push(Fe.mmmm6[ye-1].charAt(0)):Ee.push(Fe.mmmm[ye-1].charAt(0));else if(ne.type==="monthname-short")g.date_system===6?Ee.push(Fe.mmm6[ye-1]):Ee.push(Fe.mmm[ye-1]);else if(ne.type==="monthname")g.date_system===6?Ee.push(Fe.mmmm6[ye-1]):Ee.push(Fe.mmmm[ye-1]);else if(ne.type==="weekday-short")Ee.push(Fe.ddd[x]);else if(ne.type==="weekday")Ee.push(Fe.dddd[x]);else if(ne.type==="day")Ee.push(ne.pad&&ce<10?"0":"",ce);else if(ne.type==="hour"){const Be=ee%g.clock||(g.clock<24?g.clock:0);Ee.push(ne.pad&&Be<10?"0":"",Be)}else if(ne.type==="min")Ee.push(ne.pad&&Ce<10?"0":"",Ce);else if(ne.type==="sec")Ee.push(ne.pad&&Ae<10?"0":"",Ae);else if(ne.type==="subsec"){Ee.push(Fe.decimal);const Be=Ue.toFixed(g.sec_decimals);Ee.push(Be.slice(2,2+ne.decimals))}else if(ne.type==="am"){const Be=ee<12?0:1;ne.short&&!w?Ee.push("AP"[Be]):Ee.push(Fe.ampm[Be])}else if(ne.type==="hour-elap"){_<0&&Ee.push(Fe.negative);const Be=24*_e+Math.floor(Math.abs(q)/3600);Ee.push(String(Math.abs(Be)).padStart(ne.pad,"0"))}else if(ne.type==="min-elap"){_<0&&Ee.push(Fe.negative);const Be=1440*_e+Math.floor(Math.abs(q)/60);Ee.push(String(Math.abs(Be)).padStart(ne.pad,"0"))}else if(ne.type==="sec-elap"){_<0&&Ee.push(Fe.negative);const Be=_e*ae+Math.abs(q);Ee.push(String(Math.abs(Be)).padStart(ne.pad,"0"))}else if(ne.type==="b-year")Ee.push(me+543);else if(ne.type==="b-year-short"){const Be=(me+543)%100;Ee.push(Be<10?"0":"",Be)}}return p.nbsp?Ee.join(""):Ee.join("").replace(/\u00a0/g," ")}function pe(_,g){for(let p=0;p<3;p++){const w=g[p];if(w){let M;if(w.condition){const U=w.condition[0],L=w.condition[1];U==="="?M=_===L:U===">"?M=_>L:U==="<"?M=_<L:U===">="?M=_>=L:U==="<="?M=_<=L:U==="<>"&&(M=_!==L)}else M=!0;if(M)return w}}}const be=j("@"),De="black",X={};function Re(_,g){if(_){const p=_[0];g[p]=g[p]||{},Re(_.slice(1),g[p])}else g.$=!0}["d-F-y","d-F-Y","d-M-y","d-M-Y","F-d-y","F-d-Y","F-j-y","F-j-Y","j-F-y","j-F-Y","j-M-y","j-M-Y","M-d-y","M-d-Y","M-j-y","M-j-Y","m-d-y","m-d-Y","m-j-y","m-j-Y","n-d-y","n-d-Y","n-j-y","n-j-Y","y-F-d","y-F-j","y-M-d","y-M-j","Y-F-d","Y-F-j","Y-M-d","Y-m-d","Y-M-j","Y-m-j","Y-n-d","Y-n-j","j-F","j-M","d-F","d-M","n-d","n-j","n-Y","m-d","m-j","m-Y","M-Y","M-y","F-y","F-Y","Y-M","Y-n","Y-m","Y-F","Y-M"].forEach(_=>{Re(_,X),Re(_+" x",X),Re(_+" l",X),Re(_+" l x",X),Re("l "+_,X),Re("l "+_+" x",X),Re(_+" D",X),Re(_+" D x",X),Re("D "+_,X),Re("D "+_+" x",X)});const ze={jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12},je={january:1,february:2,march:3,april:4,june:6,july:7,august:8,september:9,october:10,november:11,december:12},Le={sunday:"l",monday:"l",tuesday:"l",wednesday:"l",thursday:"l",friday:"l",saturday:"l",sun:"D",mon:"D",tue:"D",wed:"D",thu:"D",fri:"D",sat:"D"},qe=new Date().getUTCFullYear();function Rt(_){const g=new RegExp("^([\\s+%"+A.join("")+"(-]*)(((?:(?:\\d[\\d,]*)(?:\\.\\d*)?|(?:\\.\\d+)))([eE][+-]?\\d+)?)([\\s%"+A.join("")+")]*)$").exec(_);if(g){const[,p,w,M,U,L]=g;let P=1,I="",Z=!1,_e=!1,q=!1,me=!1,ye=!1,ce=null,x=!1,ee=parseFloat(w.replace(/,/g,""));if(!isFinite(ee))return null;for(let Ae=0;Ae<p.length;Ae++){const Ue=p[Ae];if(Ue==="-"){if(Z||_e)return null;Z=!0,P=-1}else if(H.test(Ue)){if(ye)return null;ye=!0,ce=Ue}else if(Ue==="("){if(_e||Z)return null;_e=!0,P=-1}else if(Ue==="%"){if(me)return null;me=!0}}for(let Ae=0;Ae<L.length;Ae++){const Ue=L[Ae];if(H.test(Ue)){if(ye)return null;ye=!0,ce=Ue,x=!0}else if(Ue===")"){if(q||!_e)return null;q=!0}else if(Ue==="%"){if(me)return null;me=!0}}if(U){if(me||ye)return null;I="0.00E+00"}else if(me){if(ye)return null;I=M.includes(".")?"0.00%":"0%",ee*=.01}else if(ye){const Ae=M.includes(".")?"#,##0.00":"#,##0";I=x?Ae+ce:ce+Ae}else M.includes(",")&&(I=M.includes(".")?"#,##0.00":"#,##0");const Ce={v:ee*P};return I&&(Ce.z=I),Ce}}const Ye=(_,g,p)=>{const w=p.path||"",M=Object.keys(g);for(let U=0;U<M.length;U++){let L;const P=M[U];if(g[P]){if(P==="$"||P==="€")_||(L=p);else if(P==="-"){const I=/^(\s*([./-]|,\s)\s*|\s+)/.exec(_);if(I){const Z=I[1]==="-"||I[1]==="/"||I[1]==="."?I[1]:" ";if(!p.sep||p.sep===Z){const _e=I[0].replace(/\s+/g," ");L=Ye(_.slice(I[0].length),g[P],{...p,sep:Z,path:w+_e})}}}else if(P===" "){const I=/^[,.]?\s+/.exec(_);if(I){const Z=I[0].replace(/\s+/g," ");L=Ye(_.slice(I[0].length),g[P],{...p,path:w+Z})}}else if(P==="j"||P==="d"){const I=/^(0?[1-9]|1\d|2\d|3[01])\b/.exec(_);I&&(L=Ye(_.slice(I[0].length),g[P],{...p,day:I[0],path:w+P}))}else if(P==="n"||P==="m"){const I=/^(0?[1-9]|1[012])\b/.exec(_);I&&(L=Ye(_.slice(I[0].length),g[P],{...p,month:+I[0],_mon:I[0],path:w+P}))}else if(P==="F"||P==="M"){const I=/^([a-z]{3,9})\b/i.exec(_),Z=I&&(P==="F"?je:ze)[I[0].toLowerCase()];Z&&(L=Ye(_.slice(I[0].length),g[P],{...p,month:Z,_mon:I[0],path:w+P}))}else if(P==="l"||P==="D"){const I=/^([a-z]{3,9})\b/i.exec(_);(I&&Le[I[0].toLowerCase()])===P&&(L=Ye(_.slice(I[0].length),g[P],{...p,path:w+P}))}else if(P==="y"){const I=/^\d\d\b/.exec(_);if(I){const Z=+I[0]>=30?+I[0]+1900:+I[0]+2e3;L=Ye(_.slice(I[0].length),g[P],{...p,year:Z,path:w+P})}}else if(P==="Y"){const I=/^\d\d\d\d\b/.exec(_);I&&(L=Ye(_.slice(I[0].length),g[P],{...p,year:+I[0],path:w+P}))}else{if(P!=="x")throw new Error('Unknown date token "'.concat(P,'"'));{const I=Ve(_);I&&(L=Ye("",g[P],{...p,time:I.v,tf:I.z,path:w+P}))}}if(L)return L}}};function et(_,g){const p=Ye(_.trim(),X,{path:""});if(p){var w;if(p.sep==="."&&p.path.length===3)return null;const M=+((w=p.year)!==null&&w!==void 0?w:qe);if(p.day||(p.day=1),!function(P,I,Z){if(Z<1||I<1||I>12)return!1;if(I===2){if(Z>(P%4==0&&P%100!=0||P%400==0||P===1900?29:28))return!1}else if((I===4||I===6||I===9||I===11)&&Z>30||(I===1||I===3||I===5||I===7||I===8||I===10||I===12)&&Z>31)return!1;return!0}(M,p.month,p.day))return null;let U=-1/0;if(M<1900)return null;M<=1900&&p.month<=2?U=25568:M<1e4&&(U=25569);const L=Date.UTC(M,p.month-1,p.day)/864e5+U+(p.time||0);if(L>=0&&L<=2958465){const P=p._mon[0]==="0"||p.day[0]==="0"||p._mon.length===2&&p.day.length===2,I=p.path.replace(/[jdlDnmMFyYx-]/g,Z=>Z==="j"||Z==="d"?P?"dd":"d":Z==="D"?"ddd":Z==="l"?"dddd":Z==="n"||Z==="m"?P?"mm":"m":Z==="M"?"mmm":Z==="F"?"mmmm":Z==="y"?"yy":Z==="x"?p.tf||"":Z==="Y"?"yyyy":Z);return g&&g.nativeDate?{v:Te(L,g),z:I}:{v:L,z:I}}}return null}function Ve(_){const g=/^\s*([10]?\d|2[0-4])(?::([0-5]\d|\d))?(?::([0-5]\d|\d))?(\.\d{1,10})?(?:\s*([AP])M?)?\s*$/i.exec(_);if(g){const[,p,w,M,U,L]=g;if(U&&!M||!L&&!w&&!M)return null;let P=1*(p||0);if(L){if(P>=13)return null;L[0]!=="p"&&L[0]!=="P"||(P+=12)}return{v:(60*P*60+60*(1*(w||0))+1*(M||0)+1*(U||0))/86400,z:(p.length===2?"hh":"h")+":mm"+(M?":ss":"")+(L?" AM/PM":"")}}return null}function ht(_){return/^\s*true\s*$/i.test(_)?{v:!0}:/^\s*false\s*$/i.test(_)?{v:!1}:null}const at={};function Ft(_,g){const{pattern:p,partitions:w,locale:M}=_,U=I=>{const Z=Object.assign({},V(),g,I);return M&&(Z.locale=M),Z},L=(I,Z)=>{const _e=U(Z);return function(q,me,ye){const ce=h(ye.locale),x=me[3]?me[3]:be;if(typeof q=="boolean"&&(q=q?"TRUE":"FALSE"),q==null)return"";if(typeof q!="number")return ie(q,x,ye,ce);if(!isFinite(q)){const Ce=ce||f;return isNaN(q)?Ce.nan:(q<0?Ce.negative:"")+Ce.infinity}const ee=pe(q,me);return ee?ie(q,ee,ye,ce):ye.overflow}(ge(I,_e),w,_e)};L.color=(I,Z)=>function(_e,q){if(typeof _e!="number"||!isFinite(_e))return(q[3]?q[3].color:be.color)||De;const me=pe(_e,q);return me&&me.color||De}(ge(I,U(Z)),w);const P=function(I){var Z;let _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const[q,me]=I,ye=q.frac_max,ce={type:"general",isDate:v(I),isText:k(I),isPercent:we(I),maxDecimals:q.general?9:ye,scale:(Z=q.scale)!==null&&Z!==void 0?Z:1,color:0,parentheses:0,grouped:q.grouping?1:0,_partitions:I},x=!ce.isDate&&!ce.isText&&!q.error&&q.tokens.some(Fe=>Fe.type==="string"&&(_e?Fe.value===_e:H.test(Fe.value)));let ee="G",Ce=ye>=0?Math.min(15,ye):"",Ae="",Ue="";if(me&&me.color&&(Ue="-",ce.color=1),q.parens&&(Ae="()",ce.parentheses=1),x)ee="C",ce.type="currency";else if(q.error)ce.type="error",ce.maxDecimals=0;else if(ce.isDate){let Fe=0,He=0,ft="";q.tokens.forEach(Ee=>{const Ze=Ee.type;/^(b-)?year/.test(Ze)?(ft+="Y",He++):Ze.startsWith("month")?(ft+="M",He++):/^(week)?day/.test(Ze)?(ft+="D",He++):Ze!=="hour"&&Ze!=="min"&&Ze!=="sec"&&Ze!=="am"||(ft+=Ze[0],Fe++)}),ce.type="date",He&&Fe?ce.type="datetime":!He&&Fe&&(ce.type="time");const pt=Q.find(Ee=>ft.startsWith(Ee[0]));ee=pt?"D":"G",Ce=pt?pt[1]:""}else ce.isText?(ee="G",ce.type="text",Ce="",ce.maxDecimals=0):q.general?(ee="G",ce.type="general",Ce=""):q.fractions?(ee="G",ce.type="fraction",Ce=""):q.exponential?(ee="S",ce.type="scientific"):ce.isPercent?(ee="P",ce.type="percent"):q.grouping?(ee=",",ce.type="grouped"):(q.int_max||ye)&&(ee="F",ce.type="number");return ce.code=ee+Ce+Ue+Ae,ce.level=K[ce.type],Object.freeze(ce)}(w,(g||{}).currency)||new SyntaxError;return L.info=P,L.dateInfo=function(I){const[Z]=I;return{year:!!(2&Z.date),month:!!(4&Z.date),day:!!(8&Z.date),hours:!!(16&Z.date),minutes:!!(32&Z.date),seconds:!!(64&Z.date),clockType:Z.clock===12?12:24}}(w),L.isPercent=()=>!!P.isPercent,L.isDate=()=>!!P.isDate,L.isText=()=>!!P.isText,L.pattern=p,_.error&&(L.error=_.error),L.options=U,L.locale=M||g&&g.locale||"",Object.freeze(L)}function ke(_,g){_||(_="General");let p=null;return at[_]?p=at[_]:(p=Object.assign({},V(),g).throws?D(_):function(w){try{return D(w)}catch(M){const U={tokens:[{type:"error"}],error:M.message};return{pattern:w,partitions:[U,U,U,U],error:M.message,locale:null}}}(_),p.error||(at[_]=p)),Ft(p,g)}ke.isDate=_=>ke(_,{throws:!1}).isDate(),ke.isPercent=_=>ke(_,{throws:!1}).isPercent(),ke.isText=_=>ke(_,{throws:!1}).isText(),ke.getInfo=(_,g)=>ke(_,{...g,throws:!1}).info,ke.getDateInfo=(_,g)=>ke(_,{...g,throws:!1}).dateInfo,ke.dateToSerial=ge,ke.dateFromSerial=Te,ke.options=V,ke.dec2frac=R,ke.round=E,ke.codeToLocale=s,ke.parseLocale=l,ke.getLocale=h,ke.addLocale=(_,g)=>{const p=l(g);return delete at[p.lang],delete at[p.language],d(_,p)},ke.format=function(_,g,p){let w=arguments.length>3&&arguments[3]!==void 0&&arguments[3];const M=p&&typeof p=="object"?p:{locale:p,throws:!w};return ke(_,M)(ge(g,M),M)},ke.is_date=ke.isDate,ke.parseNumber=Rt,ke.parseDate=et,ke.parseTime=Ve,ke.parseBool=ht,ke.parseValue=function(_,g){var p,w,M;return(p=(w=(M=Rt(_))!==null&&M!==void 0?M:et(_,g))!==null&&w!==void 0?w:Ve(_))!==null&&p!==void 0?p:ht(_)};var dt=ke;return r=r.default}()})}(Jr)),Jr.exports}var Ls,sa;function u_(){return sa||(sa=1,Ls=l_()),Ls}var c_=u_();const h_=St(c_),du=h_;function rn(e){let t=0;const n=Object.keys(e);for(const r of n){const s=Number(r);t=Math.max(t,s)}return t+1}function oi(e,t,n){const r=rn(n),s=n;for(let i=r-1;i>=e;i--)s[i+1]=s[i];s[e]=t}function ai(e,t,n){const r=Object.keys(n).reduce((s,i)=>Math.max(s,Number.parseInt(i)),0)+1;for(let s=e;s<r;s++)s<e+t?delete n[s]:n[s]!==void 0&&(n[s-t]=n[s],delete n[s])}function d_(e,t){const n=e,r=Object.keys(n),s=r.length,i=t,o=Object.keys(i),a=o.length,l={};let c=0;for(let h=0;h<s;h++,c++){const u=r[h];l[c]=n[u]}for(let h=0;h<a;h++,c++){const u=o[h];l[c]=i[u]}return l}function f_(e,t,n){const r=n;if(rn(n)>0){const i={};let o=0;for(let a=e;a<=t;a++)r[a]&&(i[o]=r[a],o++);return i}return{}}function li(e,t,n,r){const s=e>n;if(!s&&e+t>n)throw new Error("Invalid move operation");s?g_(e,t,n,r):p_(e,t,n,r)}function g_(e,t,n,r){const s=r,i=[];for(let o=e;o<e+t;o++)i.push(s[o]);for(let o=e-1;o>=n;o--){const a=s[o];s[o+t]=a,a===void 0&&delete s[o+t]}i.forEach((o,a)=>{s[n+a]=o,o===void 0&&delete s[n+a]})}function p_(e,t,n,r){const s=r,i=[];for(let o=e;o<e+t;o++)i.push(s[o]);for(let o=e+t;o<n;o++){const a=s[o];s[o-t]=a,a===void 0&&delete s[o-t]}i.forEach((o,a)=>{s[n+a-t]=o,o===void 0&&delete s[n+a-t]})}class xt{constructor(t={}){C(this,"_matrix");this._setOriginValue(t)}static MakeObjectMatrixSize(t){return new xt({[t-1]:{}})}getMatrix(){return this._matrix}forEach(t){const n=this._matrix,r=Object.keys(n);for(const s of r){const i=Number(s),o=n[i];if(t(i,o)===!1)return this}return this}forRow(t){const n=this._matrix,r=Object.keys(n);for(const s of r){const i=Number(s),o=n[i];if(t(i,Object.keys(o).map(l=>Number(l)))===!1)return this}return this}forValue(t){const n=this._matrix;for(const r in n){const s=Number(r),i=n[s];if(i)for(const o in i){const a=Number(o),l=i[a];if(t(s,a,l)===!1)return this}}return this}swapRow(t,n){const r=this._matrix[t],s=this._matrix[n];this._matrix[t]=s,this._matrix[n]=r}getRow(t){return this._matrix[t]}getRowOrCreate(t){let n=this.getRow(t);return n==null&&(n={},this._matrix[t]=n),n}reset(){this._setOriginValue({})}hasValue(){const t=this._matrix,n=Object.keys(t);if(n.length===0)return!1;for(const r of n){const s=Number(r),i=t[s];if(Object.keys(i).length>0)return!0}return!1}getValue(t,n){var r,s;return(s=(r=this._matrix)==null?void 0:r[t])==null?void 0:s[n]}setValue(t,n,r){const s=this.getRowOrCreate(t);s[n]=r}deleteValue(t,n){var r,s;(s=(r=this._matrix)==null?void 0:r[t])==null||delete s[n]}realDeleteValue(t,n){var r,s,i;if((s=(r=this._matrix)==null?void 0:r[t])==null||delete s[n],this.getRow(t)){const o=this.getRow(t);if(o==null)return;Object.keys(o).length===0&&((i=this._matrix)==null||delete i[t])}}setRow(t,n){this._matrix[t]=n}moveRows(t,n,r){li(t,n,r,this._matrix)}moveColumns(t,n,r){this.forEach((s,i)=>{li(t,n,r,i)})}insertRows(t,n){for(let r=t;r<t+n;r++)oi(r,{},this._matrix)}insertColumns(t,n){for(let r=t;r<t+n;r++)this.forEach((s,i)=>{i&&oi(r,void 0,i)})}removeRows(t,n){ai(t,n,this._matrix)}removeColumns(t,n){this.forEach((r,s)=>{s&&ai(t,n,s)})}getFragment(t,n,r,s){const i=new xt;let o=0;for(let a=t;a<=n;a++){const l={};let c=0;for(let h=r;h<=s;h++){const u=this.getValue(a,h);l[c]=u,c++}i.setRow(o,l),o++}return i}getSlice(t,n,r,s){const i=new xt;for(let o=t;o<=n;o++)for(let a=r;a<=s;a++){const l=this.getValue(o,a);l&&i.setValue(o,a,re.deepClone(l))}return i}getSizeOf(){return Object.keys(this._matrix).length}getLength(){return rn(this._matrix)}getRange(){const r=this.getLength()-1;let s=0;const i=this.getLength();for(let o=0;o<i;o++){const a=this.getRow(o);if(a){const l=rn(a)-1;s=l>s?l:s}}return{startRow:0,startColumn:0,endRow:r,endColumn:s}}toNativeArray(){const t=new Array;return this.forValue((n,r,s)=>{t.push(s)}),t}toArray(){const t=[];return this.forRow((n,r)=>{t[n]==null&&(t[n]=[]),r.forEach(s=>{t[n][s]=this.getValue(n,s)})}),t}toFullArray(){const t=this.getRange(),{endColumn:n,endRow:r}=t,s=[];for(let i=0;i<=r;i++){const o=new Array(n+1).fill(void 0);s.push(o)}return this.forValue((i,o,a)=>{s[i][o]=a}),s}toJSON(){return this._matrix}clone(){const t=JSON.stringify(this._matrix);return JSON.parse(t)}getData(){const t=JSON.stringify(this._matrix);return JSON.parse(t)}getArrayData(){let t=0,n=0,r=!1,s=!1;const i=new xt;return this.forEach((o,a)=>{r||(r=!0,t=o),Object.keys(a).forEach(l=>{const c=Number(l);s?c<n&&(n=c):(s=!0,n=c);const h=this.getValue(o,c);i.setValue(o-t,c-n,h)})}),i.getData()}getStartEndScope(){let t=1/0,n=-1/0,r=1/0,s=-1/0;const i=Object.keys(this._matrix);i.length>0&&(t=+i[0],n=+i[i.length-1]);for(const o of i){const a=Object.keys(this._matrix[o]);a.length>0&&(r=Math.min(r,+a[0]),s=Math.max(s,+a[a.length-1]))}return{startRow:t,endRow:n,startColumn:r,endColumn:s}}getDataRange(){let t=0,n=0,r=0,s=-1,i=!1,o=!1;return this.forEach((a,l)=>{if(i||(i=!0,t=a),l==null)return;const c=rn(l)-1;c>r&&(r=c),Object.keys(l).forEach(h=>{const u=Number(h);o?u<n&&(n=u):(o=!0,n=u)}),a>s&&(s=a)}),{startRow:t,startColumn:n,endRow:s,endColumn:r}}getDiscreteRanges(){const t=[];return this.forEach((n,r)=>{Object.keys(r).forEach(s=>{const i=Number(s);let o=!1;for(const a of t)if(n>=a.startRow&&n<=a.endRow+1&&i>=a.startColumn&&i<=a.endColumn+1){a.endRow=Math.max(n,a.endRow),a.endColumn=Math.max(i,a.endColumn),o=!0;break}o||t.push({startRow:n,endRow:n,startColumn:i,endColumn:i})})}),t}merge(t){this.forValue((n,r)=>{const s=t.getValue(n,r);s!=null&&this.setValue(n,r,s)})}_setOriginValue(t={}){this._matrix=t}}const m_={sheetId:"",range:{startRow:-1,endRow:-1,startColumn:-1,endColumn:-1}},__={startRow:-1,startColumn:-1,endRow:-1,endColumn:-1},E_={startRow:0,startColumn:0,endRow:0,endColumn:0},C_={row:0,column:0},ct={ff:"Arial",fs:11,it:Se.FALSE,bl:Se.FALSE,ul:{s:Se.FALSE},st:{s:Se.FALSE},ol:{s:Se.FALSE},tr:{a:0,v:Se.FALSE},td:Pn.UNSPECIFIED,cl:{rgb:"#000"},bg:{rgb:"#fff"},ht:$t.UNSPECIFIED,vt:tn.UNSPECIFIED,tb:_n.UNSPECIFIED,pd:{t:0,r:0,b:0,l:0},n:null,bd:{b:null,l:null,r:null,t:null}},fu={id:"default_slide",title:"defaultSlide",pageSize:{width:300,height:300}},R_=[xi,rl,Li];var gu=(e=>(e.ARRAY_CONVERTOR="ARRAY_CONVERTOR",e.MATRIX_CONVERTOR="MATRIX_CONVERTOR",e))(gu||{});function Tr(e,t){const{textRuns:n=[]}=t;let r=0;for(const i of n){const{ts:o={},st:a,ed:l}=i;if(o[e]==null)return Se.FALSE;switch(e){case"bl":case"it":{if(o[e]===Se.FALSE)return Se.FALSE;break}case"ul":case"st":{if(o[e].s===Se.FALSE)return Se.FALSE;break}default:throw new Error(`unknown style key: ${e} in IStyleBase`)}r+=l-a}return t.dataStream.indexOf(`\r
|
|
7
|
+
`)===r?Se.TRUE:Se.FALSE}const ur=class ur{constructor(t,n,r){C(this,"_range");C(this,"_worksheet");this._deps=r,this._range=n,this._worksheet=t}static foreach(t,n){const{startRow:r,startColumn:s,endRow:i,endColumn:o}=t;for(let a=r;a<=i;a++)for(let l=s;l<=o;l++)n(a,l)}getRangeData(){return this._range}getValue(){return this.getValues()[0][0]}getValues(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range,i=[];for(let o=t;o<=n;o++){const a=[];for(let l=r;l<=s;l++)a.push(this.getMatrix().getValue(o,l)||null);i.push(a)}return i}getMatrix(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range,i=this._worksheet.getCellMatrix(),o=new xt;for(let a=t;a<=n;a++)for(let l=r;l<=s;l++)o.setValue(a,l,i.getValue(a,l)||null);return o}getMatrixObject(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range,i=this._worksheet.getCellMatrix(),o=new xt;for(let a=t;a<=n;a++)for(let l=r;l<=s;l++)o.setValue(a-t,l-r,i.getValue(a,l)||{});return o}getA1Notation(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range;let i,o;return r<s?(i=re.numToWord(r+1)+(t+1),o=re.numToWord(s+1)+(n+1)):(i=re.numToWord(s+1)+(n+1),o=re.numToWord(r+1)+(t+1)),i===o?`${i}`:`${i}:${o}`}getBackground(){return this.getBackgrounds()[0][0]}getBackgrounds(){const t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>{var i;const s=t.getStyleByCell(r);return((i=s==null?void 0:s.bg)==null?void 0:i.rgb)||ct.bg.rgb}))}getCell(t,n){const{startRow:r,startColumn:s}=this._range,i={startRow:r+t,endRow:r+t,startColumn:s+n,endColumn:s+n};return new ur(this._worksheet,i,this._deps)}getColumn(){return this._range.startColumn}getObjectValue(t={}){return this.getObjectValues(t)[0][0]}getObjectValues(t={}){var a;const{startRow:n,endRow:r,startColumn:s,endColumn:i}=this._range,o=this._worksheet.getCellMatrix().getFragment(n,r,s,i).getData();if(t.isIncludeStyle){const l=this._deps.getStyles();for(let c=0;c<=r-n;c++)for(let h=0;h<=i-s;h++){if(o==null||((a=o==null?void 0:o[c])==null?void 0:a[h])==null)continue;const u=o[c][h].s;u&&(o[c][h].s=l.get(u))}}return o}getFontColor(){return this.getFontColors()[0][0]}getFontColors(){const t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>{var i;const s=t.getStyleByCell(r);return((i=s==null?void 0:s.cl)==null?void 0:i.rgb)||ct.cl.rgb}))}getFontFamilies(){return this._getStyles("ff")}getFontFamily(){return this.getFontFamilies()[0][0]}getUnderlines(){return this._getStyles("ul")}getUnderline(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Tr("ul",t.body)===Se.TRUE?{s:Se.TRUE}:{s:Se.FALSE}:this.getUnderlines()[0][0]}getOverlines(){return this._getStyles("ol")}getOverline(){return this.getOverlines()[0][0]}getStrikeThrough(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Tr("st",t.body)===Se.TRUE?{s:Se.TRUE}:{s:Se.FALSE}:this.getStrikeThroughs()[0][0]}getStrikeThroughs(){return this._getStyles("st")}getFontSize(){var n,r;const t=((n=this.getValue())==null?void 0:n.p)||{};return Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?t.body.textRuns.some(s=>{var i;return((i=s==null?void 0:s.ts)==null?void 0:i.fs)!=null})?Math.max(...t.body.textRuns.map(s=>{var i;return((i=s==null?void 0:s.ts)==null?void 0:i.fs)||0})):this.getFontSizes()[0][0]:this.getFontSizes()[0][0]}getFontSizes(){return this._getStyles("fs")}getBorder(){return this.getBorders()[0][0]}getBorders(){return this._getStyles("bd")}getFontStyle(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Tr("it",t.body)===Se.TRUE?ss.ITALIC:ss.NORMAL:this._getFontStyles()[0][0]}_getFontStyles(){return this._getStyles("it")}getFontWeight(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Tr("bl",t.body)===Se.TRUE?is.BOLD:is.NORMAL:this._getFontWeights()[0][0]}_getFontWeights(){return this._getStyles("bl")}getGridId(){return this._worksheet.getSheetId()}getHeight(){const{_range:t,_worksheet:n}=this,{startRow:r,endRow:s}=t;let i=0;for(let o=0;o<=s-r;o++){const a=n.getRowHeight(o);i+=a}return i}getHorizontalAlignment(){return this.getHorizontalAlignments()[0][0]}getHorizontalAlignments(){return this._getStyles("ht")}getLastColumn(){return this._range.endColumn}getLastRow(){return this._range.endRow}getNumColumns(){const{startColumn:t,endColumn:n}=this._range;return n-t+1}getNumRows(){const{startRow:t,endRow:n}=this._range;return n-t+1}getRichTextValue(){return this.getRichTextValues()[0][0]}getRichTextValues(){return this.getValues().map(t=>t.map(n=>(n==null?void 0:n.p)||""))}getRowIndex(){return this._range.startRow}getSheet(){return this._worksheet}getTextDirection(){return this.getTextDirections()[0][0]}getTextDirections(){return this._getStyles("td")}getTextRotation(){return this.getTextRotations()[0][0]}getTextRotations(){return this._getStyles("tr")}getTextStyle(){return this.getTextStyles()[0][0]}getTextStyles(){const t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>t.getStyleByCell(r)))}getVerticalAlignment(){return this.getVerticalAlignments()[0][0]}getVerticalAlignments(){return this._getStyles("vt")}getWidth(){const{_range:t,_worksheet:n}=this,{startColumn:r,endColumn:s}=t;let i=0;for(let o=0;o<=s-r;o++)i+=n.getColumnWidth(o);return i}getWrap(){return this.getWrapStrategy()===_n.WRAP?Se.TRUE:Se.FALSE}getWrapStrategies(){return this._getStyles("tb")}getWrapStrategy(){return this.getWrapStrategies()[0][0]}forEach(t){ur.foreach(this._range,t)}_getStyles(t){const n=this._deps.getStyles();return this.getValues().map(r=>r.map(s=>{const i=n&&n.getStyleByCell(s);return i&&i[t]||ct[t]}))}};C(ur,"transformRange",(t,n)=>{const r=n.getMaxColumns()-1,s=n.getMaxRows()-1;return t.rangeType===xe.ALL?{startColumn:0,startRow:0,endColumn:r,endRow:s}:t.rangeType===xe.COLUMN?{startRow:0,endRow:s,startColumn:t.startColumn,endColumn:t.endColumn}:t.rangeType===xe.ROW?{startColumn:0,endColumn:r,startRow:t.startRow,endRow:t.endRow}:{startColumn:t.startColumn,endColumn:Math.min(t.endColumn,r),startRow:t.startRow,endRow:Math.min(t.endRow,s)}});let Fn=ur;function I_(e,t,n,r=!1){if(t===0&&n===0)return e;let s={...e};const i=s.startAbsoluteRefType||tt.NONE,o=s.endAbsoluteRefType||tt.NONE,a=s.rangeType||xe.NORMAL;if(!r&&i===tt.ALL&&o===tt.ALL)return s;const l=ia(s.startRow,n,s.startColumn,t,a),c=ia(s.endRow,n,s.endColumn,t,a);return r||i===tt.NONE&&o===tt.NONE?s={...s,startRow:l.row,startColumn:l.column,endRow:c.row,endColumn:c.column}:(i===tt.NONE?s={...s,startRow:l.row,startColumn:l.column}:i===tt.COLUMN?s={...s,startRow:l.row}:i===tt.ROW&&(s={...s,startColumn:l.column}),o===tt.NONE?s={...s,endRow:c.row,endColumn:c.column}:o===tt.COLUMN?s={...s,endRow:c.row}:o===tt.ROW&&(s={...s,endColumn:c.column}),s)}function ia(e,t,n,r,s){return s===xe.NORMAL?{row:e+t,column:n+r}:s===xe.ROW?{row:e+t,column:n}:s===xe.COLUMN?{row:e,column:n+r}:{row:e,column:n}}function Vi(e){const t=new Set,n=new Set;for(const o of e)t.add(o.startColumn),t.add(o.endColumn+1),n.add(o.startRow),n.add(o.endRow+1);const r=Array.from(t).sort((o,a)=>o-a),s=Array.from(n).sort((o,a)=>o-a);e.sort((o,a)=>o.startRow-a.startRow||o.startColumn-a.startColumn);const i=[];for(let o=0;o<s.length-1;o++)for(let a=0;a<r.length-1;a++){const l=r[a],c=r[a+1]-1,h=s[o],u=s[o+1]-1;for(const d of e){if(d.startRow>u)break;if(d.startRow<=h&&d.endRow>=u&&d.startColumn<=l&&d.endColumn>=c){i.push({startColumn:l,endColumn:c,startRow:h,endRow:u});break}}}return i}function v_(e){e.sort((r,s)=>r.startRow-s.startRow||r.startColumn-s.startColumn);const t={};for(const r of e)t[r.startRow]||(t[r.startRow]=[]),t[r.startRow].push(r);const n=[];for(const r in t){const s=t[+r];s.sort((o,a)=>o.startColumn-a.startColumn);let i=s[0];for(let o=1;o<s.length;o++){const a=s[o];a.startColumn<=i.endColumn+1&&a.startRow===i.startRow&&a.endRow===i.endRow?i.endColumn=Math.max(i.endColumn,a.endColumn):(n.push(i),i=a)}n.push(i)}return n}function y_(e){e.sort((r,s)=>r.startColumn-s.startColumn||r.startRow-s.startRow);const t={};for(const r of e)t[r.startColumn]||(t[r.startColumn]=[]),t[r.startColumn].push(r);const n=[];for(const r in t){const s=t[+r];s.sort((o,a)=>o.startRow-a.startRow);let i=s[0];for(let o=1;o<s.length;o++){const a=s[o];a.startRow<=i.endRow+1&&a.startColumn===i.startColumn&&a.endColumn===i.endColumn?i.endRow=Math.max(i.endRow,a.endRow):(n.push(i),i=a)}n.push(i)}return n}function S_(e){const t=Vi(e),n=v_(t);return y_(n)}function O_(e,t){const n=[];return e.forEach(r=>{n.push(...Yt.subtract(r,t))}),Yt.mergeRanges(n)}function b_(e,t){const n=oa(e.startRow,e.endRow,t.startRow,t.endRow),r=oa(e.startColumn,e.endColumn,t.startColumn,t.endColumn);if(!n||!r)return null;const[s,i]=n,[o,a]=r,l=w_(e.rangeType,t.rangeType,s,i,o,a);return{startRow:s,endRow:i,startColumn:o,endColumn:a,rangeType:l}}function oa(e,t,n,r){const s=isNaN(e)?-1/0:e,i=isNaN(t)?1/0:t,o=isNaN(n)?-1/0:n,a=isNaN(r)?1/0:r,l=Math.max(s,o),c=Math.min(i,a);if(l<=c){const h=l===-1/0?Number.NaN:l,u=c===1/0?Number.NaN:c;return[h,u]}else return null}function w_(e,t,n,r,s,i){const o=e!==void 0?e:aa(n,r,s,i),a=t!==void 0?t:aa(n,r,s,i);return o===xe.ALL||a===xe.ALL?o===a?o:o===xe.ALL?a:o:o===a?o:(o===xe.NORMAL||a===xe.NORMAL,xe.NORMAL)}function aa(e,t,n,r){const s=!isNaN(e)&&!isNaN(t),i=!isNaN(n)&&!isNaN(r);return s&&i?xe.NORMAL:s?xe.ROW:i?xe.COLUMN:xe.ALL}const kt=class kt{static clone(t){return t.rangeType!==void 0?{startRow:t.startRow,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn,rangeType:t.rangeType}:{startRow:t.startRow,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn}}static equals(t,n){return t==null||n==null?!1:t.endRow===n.endRow&&t.endColumn===n.endColumn&&t.startRow===n.startRow&&t.startColumn===n.startColumn&&(t.rangeType===n.rangeType||t.rangeType===void 0&&n.rangeType===xe.NORMAL||n.rangeType===void 0&&t.rangeType===xe.NORMAL)}static simpleRangesIntersect(t,n){const{startRow:r,endRow:s,startColumn:i,endColumn:o}=t,{startRow:a,endRow:l,startColumn:c,endColumn:h}=n,u=r<=l&&s>=a,d=i<=h&&o>=c;return u&&d}static intersects(t,n){if(t.rangeType===xe.ROW&&n.rangeType===xe.COLUMN||t.rangeType===xe.COLUMN&&n.rangeType===xe.ROW)return!0;if(t.rangeType===xe.ROW&&n.rangeType===xe.ROW)return t.startRow<=n.endRow&&t.endRow>=n.startRow;if(t.rangeType===xe.COLUMN&&n.rangeType===xe.COLUMN)return t.startColumn<=n.endColumn&&t.endColumn>=n.startColumn;const r=Math.floor(Number.MAX_SAFE_INTEGER/10),s=Number.isNaN(t.startRow)?0:t.startRow,i=Number.isNaN(t.endRow)?r:t.endRow,o=Number.isNaN(t.startColumn)?0:t.startColumn,a=Number.isNaN(t.endColumn)?r:t.endColumn,l=Number.isNaN(n.startRow)?0:n.startRow,c=Number.isNaN(n.endRow)?r:n.endRow,h=Number.isNaN(n.startColumn)?0:n.startColumn,u=Number.isNaN(n.endColumn)?r:n.endColumn,d=Math.abs(o+a-h-u),f=Math.abs(o-a)+Math.abs(h-u),E=Math.abs(s+i-l-c),R=Math.abs(s-i)+Math.abs(l-c);return d<=f&&E<=R}static getIntersects(t,n){const r=t.startRow,s=t.endRow,i=t.startColumn,o=t.endColumn,a=n.startRow,l=n.endRow,c=n.startColumn,h=n.endColumn;let u,d,f,E;if(a<=s)a>=r?d=a:d=r;else return null;if(l>=r)l>=s?E=s:E=l;else return null;if(c<=o)c>i?u=c:u=i;else return null;if(h>=i)h>=o?f=o:f=h;else return null;return{startRow:d,endRow:E,startColumn:u,endColumn:f,rangeType:xe.NORMAL}}static contains(t,n){return t.startRow<=n.startRow&&t.endRow>=n.endRow&&t.startColumn<=n.startColumn&&t.endColumn>=n.endColumn}static realContain(t,n){return kt.contains(t,n)&&(t.startRow<n.startRow||t.endRow>n.endRow||t.startColumn<n.startColumn||t.endColumn>n.endColumn)}static union(...t){return t.reduce((n,r)=>({startRow:Math.min(n.startRow,r.startRow),startColumn:Math.min(n.startColumn,r.startColumn),endRow:Math.max(n.endRow,r.endRow),endColumn:Math.max(n.endColumn,r.endColumn),rangeType:xe.NORMAL}),t[0])}static realUnion(...t){const n=t.some(i=>i.rangeType===xe.COLUMN),r=t.some(i=>i.rangeType===xe.ROW),s=kt.union(...t);return{startColumn:r?Number.NaN:s.startColumn,endColumn:r?Number.NaN:s.endColumn,startRow:n?Number.NaN:s.startRow,endRow:n?Number.NaN:s.endRow,rangeType:r?xe.ROW:n?xe.COLUMN:xe.NORMAL}}static subtract(t,n){if(n.startRow>t.endRow||n.endRow<t.startRow||n.startColumn>t.endColumn||n.endColumn<t.startColumn)return[t];const r=[];n.startRow>=t.startRow&&r.push({startRow:t.startRow,startColumn:t.startColumn,endRow:n.startRow-1,endColumn:t.endColumn}),n.endRow<=t.endRow&&r.push({startRow:n.endRow+1,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn});const s=Math.max(t.startRow,n.startRow),i=Math.min(t.endRow,n.endRow);return n.startColumn>=t.startColumn&&r.push({startRow:s,startColumn:t.startColumn,endRow:i,endColumn:n.startColumn-1}),n.endColumn<=t.endColumn&&r.push({startRow:s,startColumn:n.endColumn+1,endRow:i,endColumn:t.endColumn}),r.filter(a=>a.startRow<=a.endRow&&a.startColumn<=a.endColumn)}static mergeRanges(t){return S_(t)}static splitIntoGrid(t){return Vi(t)}static subtractMulti(t,n){if(!n.length)return t;let r=t;return n.forEach(s=>{r=O_(r,s)}),r}static hasIntersectionBetweenTwoRect(t,n){return!(t.left>n.right||t.right<n.left||t.top>n.bottom||t.bottom<n.top)}static getIntersectionBetweenTwoRect(t,n){const r=Math.max(t.left,n.left),s=Math.min(t.right,n.right),i=Math.max(t.top,n.top),o=Math.min(t.bottom,n.bottom);return s<=r||o<=i?null:{left:r,right:s,top:i,bottom:o,width:s-r,height:o-i}}static sort(t){return t.sort((n,r)=>n.startRow-r.startRow||n.startColumn-r.startColumn)}};C(kt,"getRelativeRange",(t,n)=>({startRow:t.startRow-n.startRow,endRow:t.endRow-t.startRow,startColumn:t.startColumn-n.startColumn,endColumn:t.endColumn-t.startColumn})),C(kt,"getPositionRange",(t,n,r)=>({...r||{},startRow:r&&[tt.ROW,tt.ALL].includes(r.startAbsoluteRefType||0)?r.startRow:t.startRow+n.startRow,endRow:r&&[tt.ROW,tt.ALL].includes(r.endAbsoluteRefType||0)?r.endRow:t.endRow+t.startRow+n.startRow,startColumn:r&&[tt.COLUMN,tt.ALL].includes(r.startAbsoluteRefType||0)?r.startColumn:t.startColumn+n.startColumn,endColumn:r&&[tt.COLUMN,tt.ALL].includes(r.endAbsoluteRefType||0)?r.endColumn:t.endColumn+t.startColumn+n.startColumn})),C(kt,"moveHorizontal",(t,n=0,r=0)=>({...t,startColumn:t.startColumn+n,endColumn:t.endColumn+n+r})),C(kt,"moveVertical",(t,n=0,r=0)=>({...t,startRow:t.startRow+n,endRow:t.endRow+n+r})),C(kt,"moveOffset",(t,n,r)=>({...t,startRow:t.startRow+r,endRow:t.endRow+r,startColumn:t.startColumn+n,endColumn:t.endColumn+n}));let Yt=kt;function A_(e,t){if(e.length===0||e[0].length===0)return null;const n=new Array(e[0].length).fill(0);let r=0,s=null;for(let i=0;i<e.length;i++){for(let a=0;a<e[0].length;a++)n[a]=t(e[i][a])?n[a]+1:0;const o=T_(n);o.area>r&&(r=o.area,s={startColumn:o.start,startRow:i-o.height+1,endColumn:o.end,endRow:i})}return s}function T_(e){const t=[];let n=0,r={area:0,height:0,start:0,end:0},s=0;for(;s<e.length;)if(t.length===0||e[s]>=e[t[t.length-1]])t.push(s++);else{const i=e[t.pop()],o=t.length===0?s:s-t[t.length-1]-1;i*o>n&&(n=i*o,r={area:n,height:i,start:t.length===0?0:t[t.length-1]+1,end:s-1})}for(;t.length>0;){const i=e[t.pop()],o=t.length===0?s:s-t[t.length-1]-1;i*o>n&&(n=i*o,r={area:n,height:i,start:t.length===0?0:t[t.length-1]+1,end:s-1})}return r}function N_(e,t){Fn.foreach(t,(n,r)=>{e[n][r]=void 0})}function M_(e,t){const n=e.toFullArray(),r=[];for(;;){const s=A_(n,t);if(!s)break;r.push(s),N_(n,s)}return r}class D_{constructor(t,n){C(this,"_values",[]);C(this,"_keys",[]);C(this,"_keyMaps",new Map);this._values=t,this._keys=n,t.forEach(r=>{this._initKeyMap(r)})}_initKeyMap(t){this._keys.forEach(n=>{const r=t[n],s=this._keyMaps.get(n)||new Map;s.set(r,t),this._keyMaps.set(n,s)})}getValue(t,n){const r=n||this._keys;for(let s=0;s<r.length;s++){const i=this._keyMaps.get(r[s]);if(i!=null&&i.has(t))return i.get(t)}return null}hasValue(t){for(let n=0;n<this._keys.length;n++){const r=this._keyMaps.get(this._keys[n]);if(r!=null&&r.has(t))return!0}return!1}addValue(t){this._values.push(t),this._initKeyMap(t)}setValue(t,n,r){const s=this.getValue(t);s&&Object.keys(s).includes(n)&&(s[n]=r)}deleteValue(t,n){const r=this.getValue(t,n);if(r){this._keys.forEach(i=>{const o=this._keyMaps.get(i),a=r[i];o==null||o.delete(a)});const s=this._values.findIndex(i=>i===r);this._values.splice(s,1)}}getValues(){return this._values}getKeyMap(t){var n;return[...((n=this._keyMaps.get(t))==null?void 0:n.keys())||[]]}clear(){this._values=[],this._keys=[],this._keyMaps.clear()}}function ui(e,t,n,r){return{forEach(s){for(let i=e;i<=t;i++)for(let o=n;o<=r;o++)s(i,o)}}}function x_(e){if(e==null||e.length===0)return Number.NaN;const t=e.toLowerCase().split(""),n=t.length,r=o=>o.charCodeAt(0)-96;let s=0,i=0;for(let o=0;o<n;o++)i=r(t[o]),s+=i*26**(n-o-1);return s===0?Number.NaN:s-1}const ls=65,pu=90,L_=97;function U_(e){const t=pu-ls+1;let n="";for(;e>=0;)n=String.fromCharCode(e%t+ls)+n,e=Math.floor(e/t)-1;return n}function mu(e,t){let n="";for(;t>0;)n+=e,t--;return n}function P_(e,t=!1){const n=pu-ls+1;let r=L_;t&&(r=ls);const s=String.fromCharCode(e%n+r),i=Math.floor(e/n)+1;return mu(s,i)}function F_(e,t){return e.zIndex>t.zIndex?1:e.zIndex===t.zIndex?0:-1}function k_(e,t){return e.zIndex>t.zIndex?-1:e.zIndex===t.zIndex?0:1}function Rr(e="index",t=1){return(n,r)=>n[e]>r[e]?t:n[e]===r[e]?0:-t}var _u=(e=>(e[e.character=0]="character",e[e.paragraph=1]="paragraph",e[e.table=2]="table",e[e.numbering=3]="numbering",e))(_u||{}),Eu=(e=>(e[e.TAB=0]="TAB",e[e.SPACE=1]="SPACE",e[e.NOTHING=2]="NOTHING",e))(Eu||{}),Ne=(e=>(e[e.BULLET=0]="BULLET",e[e.NONE=1]="NONE",e[e.DECIMAL=2]="DECIMAL",e[e.DECIMAL_ZERO=3]="DECIMAL_ZERO",e[e.UPPER_LETTER=4]="UPPER_LETTER",e[e.LOWER_LETTER=5]="LOWER_LETTER",e[e.UPPER_ROMAN=6]="UPPER_ROMAN",e[e.LOWER_ROMAN=7]="LOWER_ROMAN",e[e.ORDINAL=8]="ORDINAL",e[e.CARDINAL_TEXT=9]="CARDINAL_TEXT",e[e.ORDINAL_TEXT=10]="ORDINAL_TEXT",e[e.HEX=11]="HEX",e[e.CHICAGO=12]="CHICAGO",e[e.IDEOGRAPH_DIGITAL=13]="IDEOGRAPH_DIGITAL",e[e.JAPANESE_COUNTING=14]="JAPANESE_COUNTING",e[e.AIUEO=15]="AIUEO",e[e.IROHA=16]="IROHA",e[e.DECIMAL_FULL_WIDTH=17]="DECIMAL_FULL_WIDTH",e[e.DECIMAL_HALF_WIDTH=18]="DECIMAL_HALF_WIDTH",e[e.JAPANESE_LEGAL=19]="JAPANESE_LEGAL",e[e.JAPANESE_DIGITAL_TEN_THOUSAND=20]="JAPANESE_DIGITAL_TEN_THOUSAND",e[e.DECIMAL_ENCLOSED_CIRCLE=21]="DECIMAL_ENCLOSED_CIRCLE",e[e.DECIMAL_FULL_WIDTH2=22]="DECIMAL_FULL_WIDTH2",e[e.AIUEO_FULL_WIDTH=23]="AIUEO_FULL_WIDTH",e[e.IROHA_FULL_WIDTH=24]="IROHA_FULL_WIDTH",e[e.GANADA=25]="GANADA",e[e.CHOSUNG=26]="CHOSUNG",e[e.DECIMAL_ENCLOSED_FULLSTOP=27]="DECIMAL_ENCLOSED_FULLSTOP",e[e.DECIMAL_ENCLOSED_PAREN=28]="DECIMAL_ENCLOSED_PAREN",e[e.DECIMAL_ENCLOSED_CIRCLE_CHINESE=29]="DECIMAL_ENCLOSED_CIRCLE_CHINESE",e[e.IDEOGRAPH_ENCLOSED_CIRCLE=30]="IDEOGRAPH_ENCLOSED_CIRCLE",e[e.IDEOGRAPH_TRADITIONAL=31]="IDEOGRAPH_TRADITIONAL",e[e.IDEOGRAPH_ZODIAC=32]="IDEOGRAPH_ZODIAC",e[e.IDEOGRAPH_ZODIAC_TRADITIONAL=33]="IDEOGRAPH_ZODIAC_TRADITIONAL",e[e.TAIWANESE_COUNTING=34]="TAIWANESE_COUNTING",e[e.IDEOGRAPH_LEGAL_TRADITIONAL=35]="IDEOGRAPH_LEGAL_TRADITIONAL",e[e.TAIWANESE_COUNTING_THOUSAND=36]="TAIWANESE_COUNTING_THOUSAND",e[e.TAIWANESE_DIGITAL=37]="TAIWANESE_DIGITAL",e[e.CHINESE_COUNTING=38]="CHINESE_COUNTING",e[e.CHINESE_LEGAL_SIMPLIFIED=39]="CHINESE_LEGAL_SIMPLIFIED",e[e.CHINESE_COUNTING_THOUSAND=40]="CHINESE_COUNTING_THOUSAND",e[e.KOREAN_DIGITAL=41]="KOREAN_DIGITAL",e[e.KOREAN_COUNTING=42]="KOREAN_COUNTING",e[e.KOREAN_LEGAL=43]="KOREAN_LEGAL",e[e.KOREAN_DIGITAL2=44]="KOREAN_DIGITAL2",e[e.VIETNAMESE_COUNTING=45]="VIETNAMESE_COUNTING",e[e.RUSSIAN_LOWER=46]="RUSSIAN_LOWER",e[e.RUSSIAN_UPPER=47]="RUSSIAN_UPPER",e[e.NUMBER_IN_DASH=48]="NUMBER_IN_DASH",e[e.HEBREW1=49]="HEBREW1",e[e.HEBREW2=50]="HEBREW2",e[e.ARABIC_ALPHA=51]="ARABIC_ALPHA",e[e.ARABIC_ABJAD=52]="ARABIC_ABJAD",e[e.HINDI_VOWELS=53]="HINDI_VOWELS",e[e.HINDI_CONSONANTS=54]="HINDI_CONSONANTS",e[e.HINDI_NUMBERS=55]="HINDI_NUMBERS",e[e.HINDI_COUNTING=56]="HINDI_COUNTING",e[e.THAI_LETTERS=57]="THAI_LETTERS",e[e.THAI_NUMBERS=58]="THAI_NUMBERS",e[e.THAI_COUNTING=59]="THAI_COUNTING",e[e.CUSTOM=60]="CUSTOM",e))(Ne||{}),Ir=(e=>(e[e.BULLET_ALIGNMENT_UNSPECIFIED=0]="BULLET_ALIGNMENT_UNSPECIFIED",e[e.START=1]="START",e[e.CENTER=2]="CENTER",e[e.END=3]="END",e[e.BOTH=4]="BOTH",e))(Ir||{}),on=(e=>(e[e.HYPERLINK=0]="HYPERLINK",e[e.FIELD=1]="FIELD",e[e.SDT=2]="SDT",e[e.BOOKMARK=3]="BOOKMARK",e[e.COMMENT=4]="COMMENT",e[e.CUSTOM=5]="CUSTOM",e[e.MENTION=6]="MENTION",e[e.UNI_FORMULA=7]="UNI_FORMULA",e[e.DELTED=9999]="DELTED",e))(on||{}),fn=(e=>(e[e.COMMENT=0]="COMMENT",e[e.DELETED=9999]="DELETED",e))(fn||{}),Cu=(e=>(e[e.DRAWING=0]="DRAWING",e[e.CUSTOM=1]="CUSTOM",e))(Cu||{}),Gi=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRADITIONAL=1]="TRADITIONAL",e[e.MODERN=2]="MODERN",e))(Gi||{}),Ru=(e=>(e[e.DEFAULT=0]="DEFAULT",e[e.LINES=1]="LINES",e[e.LINES_AND_CHARS=2]="LINES_AND_CHARS",e[e.SNAP_TO_CHARS=3]="SNAP_TO_CHARS",e))(Ru||{}),Iu=(e=>(e[e.SECTION_TYPE_UNSPECIFIED=0]="SECTION_TYPE_UNSPECIFIED",e[e.CONTINUOUS=1]="CONTINUOUS",e[e.NEXT_PAGE=2]="NEXT_PAGE",e[e.EVEN_PAGE=3]="EVEN_PAGE",e[e.ODD_PAGE=4]="ODD_PAGE",e))(Iu||{}),vu=(e=>(e[e.COLUMN_SEPARATOR_STYLE_UNSPECIFIED=0]="COLUMN_SEPARATOR_STYLE_UNSPECIFIED",e[e.NONE=1]="NONE",e[e.BETWEEN_EACH_COLUMN=2]="BETWEEN_EACH_COLUMN",e))(vu||{}),yu=(e=>(e[e.NORMAL=0]="NORMAL",e[e.TBRL=1]="TBRL",e[e.LRTBV=2]="LRTBV",e))(yu||{}),Su=(e=>(e[e.TEXT_RUN=0]="TEXT_RUN",e[e.AUTO_TEXT=1]="AUTO_TEXT",e[e.PAGE_BREAK=2]="PAGE_BREAK",e[e.COLUMN_BREAK=3]="COLUMN_BREAK",e[e.FOOT_NOTE_REFERENCE=4]="FOOT_NOTE_REFERENCE",e[e.HORIZONTAL_RULE=5]="HORIZONTAL_RULE",e[e.EQUATION=6]="EQUATION",e[e.DRAWING=7]="DRAWING",e[e.PERSON=8]="PERSON",e[e.RICH_LINK=9]="RICH_LINK",e))(Su||{}),Ou=(e=>(e[e.BOTH_SIDES=0]="BOTH_SIDES",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.LARGEST=3]="LARGEST",e))(Ou||{}),bu=(e=>(e[e.INLINE=0]="INLINE",e[e.WRAP_NONE=1]="WRAP_NONE",e[e.WRAP_POLYGON=2]="WRAP_POLYGON",e[e.WRAP_SQUARE=3]="WRAP_SQUARE",e[e.WRAP_THROUGH=4]="WRAP_THROUGH",e[e.WRAP_TIGHT=5]="WRAP_TIGHT",e[e.WRAP_TOP_AND_BOTTOM=6]="WRAP_TOP_AND_BOTTOM",e))(bu||{}),wu=(e=>(e[e.NAMED_STYLE_TYPE_UNSPECIFIED=0]="NAMED_STYLE_TYPE_UNSPECIFIED",e[e.NORMAL_TEXT=1]="NORMAL_TEXT",e[e.TITLE=2]="TITLE",e[e.SUBTITLE=3]="SUBTITLE",e[e.HEADING_1=4]="HEADING_1",e[e.HEADING_2=5]="HEADING_2",e[e.HEADING_3=6]="HEADING_3",e[e.HEADING_4=7]="HEADING_4",e[e.HEADING_5=8]="HEADING_5",e[e.HEADING_6=9]="HEADING_6",e))(wu||{}),Au=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(Au||{}),Tu=(e=>(e[e.DASH_STYLE_UNSPECIFIED=0]="DASH_STYLE_UNSPECIFIED",e[e.SOLID=1]="SOLID",e[e.DOT=2]="DOT",e[e.DASH=3]="DASH",e))(Tu||{}),Nu=(e=>(e[e.TAB_STOP_ALIGNMENT_UNSPECIFIED=0]="TAB_STOP_ALIGNMENT_UNSPECIFIED",e[e.START=1]="START",e[e.CENTER=2]="CENTER",e[e.END=3]="END",e))(Nu||{}),Mu=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SPECIFIED=1]="SPECIFIED",e))(Mu||{}),Du=(e=>(e[e.START=0]="START",e[e.CENTER=1]="CENTER",e[e.END=2]="END",e))(Du||{}),xu=(e=>(e[e.AUTO_FIT=0]="AUTO_FIT",e[e.FIXED=1]="FIXED",e))(xu||{}),Lu=(e=>(e[e.NONE=0]="NONE",e[e.WRAP=1]="WRAP",e))(Lu||{}),Uu=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(Uu||{}),Pu=(e=>(e[e.CONTENT_ALIGNMENT_UNSPECIFIED=0]="CONTENT_ALIGNMENT_UNSPECIFIED",e[e.BOTH=1]="BOTH",e[e.TOP=2]="TOP",e[e.CENTER=3]="CENTER",e[e.BOTTOM=4]="BOTTOM",e))(Pu||{}),wn=(e=>(e.NORMAL="normal",e.BOLD="bold",e.ITALIC="italic",e))(wn||{}),Fu=(e=>(e[e.PAGE=0]="PAGE",e[e.COLUMN=1]="COLUMN",e[e.CHARACTER=2]="CHARACTER",e[e.MARGIN=3]="MARGIN",e[e.INSIDE_MARGIN=4]="INSIDE_MARGIN",e[e.OUTSIDE_MARGIN=5]="OUTSIDE_MARGIN",e[e.LEFT_MARGIN=6]="LEFT_MARGIN",e[e.RIGHT_MARGIN=7]="RIGHT_MARGIN",e))(Fu||{}),ku=(e=>(e[e.PAGE=0]="PAGE",e[e.PARAGRAPH=1]="PARAGRAPH",e[e.LINE=2]="LINE",e[e.MARGIN=3]="MARGIN",e[e.TOP_MARGIN=4]="TOP_MARGIN",e[e.BOTTOM_MARGIN=5]="BOTTOM_MARGIN",e[e.INSIDE_MARGIN=6]="INSIDE_MARGIN",e[e.OUTSIDE_MARGIN=7]="OUTSIDE_MARGIN",e))(ku||{}),$u=(e=>(e[e.POINT=0]="POINT",e[e.LINE=1]="LINE",e[e.CHARACTER=2]="CHARACTER",e[e.PIXEL=3]="PIXEL",e[e.PERCENT=4]="PERCENT",e))($u||{}),Bu=(e=>(e[e.CENTER=0]="CENTER",e[e.INSIDE=1]="INSIDE",e[e.LEFT=2]="LEFT",e[e.OUTSIDE=3]="OUTSIDE",e[e.RIGHT=4]="RIGHT",e[e.BOTH=5]="BOTH",e[e.DISTRIBUTE=6]="DISTRIBUTE",e))(Bu||{}),ju=(e=>(e[e.BOTTOM=0]="BOTTOM",e[e.CENTER=1]="CENTER",e[e.INSIDE=2]="INSIDE",e[e.OUTSIDE=3]="OUTSIDE",e[e.TOP=4]="TOP",e))(ju||{}),Hu=(e=>(e[e.compressPunctuation=0]="compressPunctuation",e[e.compressPunctuationAndJapaneseKana=1]="compressPunctuationAndJapaneseKana",e[e.doNotCompress=2]="doNotCompress",e))(Hu||{}),Wu=(e=>(e[e.PORTRAIT=0]="PORTRAIT",e[e.LANDSCAPE=1]="LANDSCAPE",e))(Wu||{}),zu=(e=>(e[e.forward=0]="forward",e[e.backward=1]="backward",e[e.front=2]="front",e[e.back=3]="back",e))(zu||{}),Yu=(e=>(e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e[e.DRAWING_IMAGE=0]="DRAWING_IMAGE",e[e.DRAWING_SHAPE=1]="DRAWING_SHAPE",e[e.DRAWING_CHART=2]="DRAWING_CHART",e[e.DRAWING_TABLE=3]="DRAWING_TABLE",e[e.DRAWING_SMART_ART=4]="DRAWING_SMART_ART",e[e.DRAWING_VIDEO=5]="DRAWING_VIDEO",e[e.DRAWING_GROUP=6]="DRAWING_GROUP",e[e.DRAWING_UNIT=7]="DRAWING_UNIT",e[e.DRAWING_DOM=8]="DRAWING_DOM",e))(Yu||{}),Ki=(e=>(e[e.SLIDE=0]="SLIDE",e[e.MASTER=1]="MASTER",e[e.LAYOUT=2]="LAYOUT",e[e.HANDOUT_MASTER=3]="HANDOUT_MASTER",e[e.NOTES_MASTER=4]="NOTES_MASTER",e))(Ki||{}),Vu=(e=>(e[e.SHAPE=0]="SHAPE",e[e.IMAGE=1]="IMAGE",e[e.TEXT=2]="TEXT",e[e.SPREADSHEET=3]="SPREADSHEET",e[e.DOCUMENT=4]="DOCUMENT",e[e.SLIDE=5]="SLIDE",e))(Vu||{}),Gu=(e=>(e[e.RELATIVE_SLIDE_LINK_UNSPECIFIED=0]="RELATIVE_SLIDE_LINK_UNSPECIFIED",e[e.NEXT_SLIDE=1]="NEXT_SLIDE",e[e.PREVIOUS_SLIDE=2]="PREVIOUS_SLIDE",e[e.FIRST_SLIDE=3]="FIRST_SLIDE",e[e.LAST_SLIDE=4]="LAST_SLIDE",e))(Gu||{}),$e=(e=>(e[e.UNIVER_UNKNOWN=0]="UNIVER_UNKNOWN",e[e.UNIVER_DOC=1]="UNIVER_DOC",e[e.UNIVER_SHEET=2]="UNIVER_SHEET",e[e.UNIVER_SLIDE=3]="UNIVER_SLIDE",e[e.UNIVER_PROJECT=4]="UNIVER_PROJECT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))($e||{}),Mt=(e=>(e[e.Reader=0]="Reader",e[e.Editor=1]="Editor",e[e.Owner=2]="Owner",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(Mt||{}),ci=(e=>(e[e.SomeCollaborator=0]="SomeCollaborator",e[e.AllCollaborator=1]="AllCollaborator",e[e.OneSelf=2]="OneSelf",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(ci||{});class ys extends nt{}function $_(e=re.generateRandomId(6),t=Er.EN_US,n=""){return{id:e,locale:t,title:n,tableSource:{},drawings:{},drawingsOrder:[],headers:{},footers:{},body:{dataStream:`\r
|
|
8
|
+
`,textRuns:[],customBlocks:[],tables:[],paragraphs:[{startIndex:0,paragraphStyle:{spaceAbove:{v:5},lineSpacing:1,spaceBelow:{v:0}}}],sectionBreaks:[{startIndex:1}]},documentStyle:{pageSize:{width:793.3333333333334,height:1122.6666666666667},documentFlavor:Gi.TRADITIONAL,marginTop:50,marginBottom:50,marginRight:50,marginLeft:50,renderConfig:{zeroWidthParagraphBreak:Se.FALSE,vertexAngle:0,centerAngle:0,background:{rgb:"#ccc"}},autoHyphenation:Se.TRUE,doNotHyphenateCaps:Se.FALSE,consecutiveHyphenLimit:2,defaultHeaderId:"",defaultFooterId:"",evenPageHeaderId:"",evenPageFooterId:"",firstPageHeaderId:"",firstPageFooterId:"",evenAndOddHeaders:Se.FALSE,useFirstPageHeaderFooter:Se.FALSE,marginHeader:30,marginFooter:30},settings:{}}}var Kn={},Nr={},Mr={},la;function B_(){if(la)return Mr;la=1,Object.defineProperty(Mr,"__esModule",{value:!0});function e(r,s){if(Array.isArray(s))return!1;for(let i in r)if(!n(r[i],s[i]))return!1;for(let i in s)if(r[i]===void 0)return!1;return!0}function t(r,s){if(!Array.isArray(s)||r.length!==s.length)return!1;for(let i=0;i<r.length;i++)if(!n(r[i],s[i]))return!1;return!0}function n(r,s){return r===s?!0:r===null||s===null||typeof r!="object"||typeof s!="object"?!1:Array.isArray(r)?t(r,s):e(r,s)}return Mr.default=n,Mr}var Dr={},ua;function j_(){if(ua)return Dr;ua=1,Object.defineProperty(Dr,"__esModule",{value:!0});function e(t){if(t===null)return null;if(Array.isArray(t))return t.map(e);if(typeof t=="object"){const n={};for(let r in t)n[r]=e(t[r]);return n}else return t}return Dr.default=e,Dr}var Us={},ca;function Ku(){return ca||(ca=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.eachChildOf=e.advancer=e.readCursor=e.writeCursor=e.WriteCursor=e.ReadCursor=e.isValidPathItem=void 0;function t(h,u){if(!h)throw new Error(u)}const n=h=>h!=null&&typeof h=="object"&&!Array.isArray(h),r=(h,u)=>typeof h==typeof u?h>u:typeof h=="string"&&typeof u=="number";function s(h,u){for(let d in h){const f=d;u.write(f,h[f])}}e.isValidPathItem=h=>typeof h=="number"||typeof h=="string"&&h!=="__proto__";class i{constructor(u=null){this.parents=[],this.indexes=[],this.lcIdx=-1,this.idx=-1,this.container=u}ascend(){t(this.parents.length===this.indexes.length/2),this.idx===0?this.parents.length?(this.lcIdx=this.indexes.pop(),this.container=this.parents.pop(),this.idx=this.indexes.pop()):(this.lcIdx=0,this.idx=-1):(t(this.idx>0),this.idx--,n(this.container[this.idx])&&this.idx--)}getPath(){const u=[];let d=this.container,f=this.parents.length-1,E=this.idx;for(;E>=0;)u.unshift(d[E]),E===0?(E=this.indexes[f*2],d=this.parents[f--]):E-=n(d[E-1])?2:1;return u}}class o extends i{get(){return this.container?this.container.slice(this.idx+1):null}getKey(){return t(this.container!=null,"Invalid call to getKey before cursor descended"),this.container[this.idx]}getComponent(){let u;return this.container&&this.container.length>this.idx+1&&n(u=this.container[this.idx+1])?u:null}descendFirst(){let u=this.idx+1;if(!this.container||u>=this.container.length||n(this.container[u])&&u+1>=this.container.length)return!1;n(this.container[u])&&u++;const d=this.container[u];return Array.isArray(d)?(this.indexes.push(this.idx),this.parents.push(this.container),this.indexes.push(u),this.idx=0,this.container=d):this.idx=u,!0}nextSibling(){if(t(this.parents.length===this.indexes.length/2),this.idx>0||this.parents.length===0)return!1;const u=this.indexes[this.indexes.length-1]+1,d=this.parents[this.parents.length-1];return u>=d.length?!1:(t(!isNaN(u)),this.indexes[this.indexes.length-1]=u,this.container=d[u],!0)}_init(u,d,f,E){this.container=u,this.idx=d,this.parents=f.slice(),this.indexes=E.slice()}clone(){const u=new o;return u._init(this.container,this.idx,this.parents,this.indexes),u}*[Symbol.iterator](){if(this.descendFirst()){do yield this.getKey();while(this.nextSibling());this.ascend()}}traverse(u,d){const f=this.getComponent();f&&d(f,u);for(const E of this)u&&u.descend(E),this.traverse(u,d),u&&u.ascend()}eachPick(u,d){this.traverse(u,(f,E)=>{f.p!=null&&d(f.p,E)})}eachDrop(u,d){this.traverse(u,(f,E)=>{f.d!=null&&d(f.d,E)})}}e.ReadCursor=o;class a extends i{constructor(u=null){super(u),this.pendingDescent=[],this._op=u}flushDescent(){t(this.parents.length===this.indexes.length/2),this.container===null&&(this._op=this.container=[]);for(let u=0;u<this.pendingDescent.length;u++){const d=this.pendingDescent[u];let f=this.idx+1;if(f<this.container.length&&n(this.container[f])&&f++,t(f===this.container.length||!n(this.container[f])),f===this.container.length)this.container.push(d),this.idx=f;else if(this.container[f]===d)this.idx=f;else{if(!Array.isArray(this.container[f])){const E=this.container.splice(f,this.container.length-f);this.container.push(E),this.lcIdx>-1&&(this.lcIdx=f)}for(this.indexes.push(this.idx),this.parents.push(this.container),this.lcIdx!==-1&&(t(r(d,this.container[this.lcIdx][0])),f=this.lcIdx+1,this.lcIdx=-1);f<this.container.length&&r(d,this.container[f][0]);)f++;if(this.indexes.push(f),this.idx=0,f<this.container.length&&this.container[f][0]===d)this.container=this.container[f];else{const E=[d];this.container.splice(f,0,E),this.container=E}}}this.pendingDescent.length=0}reset(){this.lcIdx=-1}getComponent(){this.flushDescent();const u=this.idx+1;if(u<this.container.length&&n(this.container[u]))return this.container[u];{const d={};return this.container.splice(u,0,d),d}}write(u,d){const f=this.getComponent();t(f[u]==null||f[u]===d,"Internal consistency error: Overwritten component. File a bug"),f[u]=d}get(){return this._op}descend(u){if(!e.isValidPathItem(u))throw Error("Invalid JSON key");this.pendingDescent.push(u)}descendPath(u){return this.pendingDescent.push(...u),this}ascend(){this.pendingDescent.length?this.pendingDescent.pop():super.ascend()}mergeTree(u,d=s){if(u===null)return;if(t(Array.isArray(u)),u===this._op)throw Error("Cannot merge into my own tree");const f=this.lcIdx,E=this.parents.length;let R=0;for(let O=0;O<u.length;O++){const T=u[O];typeof T=="string"||typeof T=="number"?(R++,this.descend(T)):Array.isArray(T)?this.mergeTree(T,d):typeof T=="object"&&d(T,this)}for(;R--;)this.ascend();this.lcIdx=this.parents.length===E?f:-1}at(u,d){this.descendPath(u),d(this);for(let f=0;f<u.length;f++)this.ascend();return this}writeAtPath(u,d,f){return this.at(u,()=>this.write(d,f)),this.reset(),this}writeMove(u,d,f=0){return this.writeAtPath(u,"p",f).writeAtPath(d,"d",f)}getPath(){const u=super.getPath();return u.push(...this.pendingDescent),u}}e.WriteCursor=a,e.writeCursor=()=>new a,e.readCursor=h=>new o(h);function l(h,u,d){let f,E;E=f=h?h.descendFirst():!1;function R(O){let T;for(;E;){const V=T=h.getKey();if(O!=null){let z=!1;if(u&&typeof V=="number"&&(T=u(V,h.getComponent()),T<0&&(T=~T,z=!0)),r(T,O))return null;if(T===O&&!z)return h}d&&typeof T=="number"&&d(T,h.getComponent()),E=h.nextSibling()}return null}return R.end=()=>{f&&h.ascend()},R}e.advancer=l;function c(h,u,d){let f,E,R,O;for(f=E=h&&h.descendFirst(),R=O=u&&u.descendFirst();f||R;){let T=f?h.getKey():null,V=R?u.getKey():null;T!==null&&V!==null&&(r(V,T)?V=null:T!==V&&(T=null)),d(T==null?V:T,T!=null?h:null,V!=null?u:null),T!=null&&f&&(f=h.nextSibling()),V!=null&&R&&(R=u.nextSibling())}E&&h.ascend(),O&&u.ascend()}e.eachChildOf=c}(Us)),Us}var Ps={},ha;function Xu(){return ha||(ha=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConflictType=void 0,function(t){t[t.RM_UNEXPECTED_CONTENT=1]="RM_UNEXPECTED_CONTENT",t[t.DROP_COLLISION=2]="DROP_COLLISION",t[t.BLACKHOLE=3]="BLACKHOLE"}(e.ConflictType||(e.ConflictType={}))}(Ps)),Ps}var hn={},dn={},da;function Xi(){return da||(da=1,Object.defineProperty(dn,"__esModule",{value:!0}),dn.uniToStrPos=dn.strPosToUni=void 0,dn.strPosToUni=(e,t=e.length)=>{let n=0,r=0;for(;r<t;r++){const s=e.charCodeAt(r);s>=55296&&s<=57343&&(n++,r++)}if(r!==t)throw Error("Invalid offset - splits unicode bytes");return r-n},dn.uniToStrPos=(e,t)=>{let n=0;for(;t>0;t--){const r=e.charCodeAt(n);n+=r>=55296&&r<=57343?2:1}return n}),dn}var Fs={},fa;function hi(){return fa||(fa=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.uniSlice=e.dlen=e.eachOp=void 0;const t=Xi(),n=N=>{if(!Array.isArray(N))throw Error("Op must be an array of components");let A=null;for(let H=0;H<N.length;H++){const J=N[H];switch(typeof J){case"object":if(typeof J.d!="number"&&typeof J.d!="string")throw Error("Delete must be number or string");if(e.dlen(J.d)<=0)throw Error("Deletes must not be empty");break;case"string":if(!(J.length>0))throw Error("Inserts cannot be empty");break;case"number":if(!(J>0))throw Error("Skip components must be >0");if(typeof A=="number")throw Error("Adjacent skip components should be combined");break}A=J}if(typeof A=="number")throw Error("Op has a trailing skip")};function r(N,A){let H=0,J=0;for(let de=0;de<N.length;de++){const le=N[de];switch(A(le,H,J),typeof le){case"object":H+=e.dlen(le.d);break;case"string":J+=t.strPosToUni(le);break;case"number":H+=le,J+=le;break}}}e.eachOp=r;function s(N,A){const H=[],J=a(H);return r(N,(de,le,m)=>{J(A(de,le,m))}),u(H)}const i=N=>N,o=N=>s(N,i);e.dlen=N=>typeof N=="number"?N:t.strPosToUni(N);const a=N=>A=>{if(!(!A||A.d===0||A.d===""))if(N.length===0)N.push(A);else if(typeof A==typeof N[N.length-1])if(typeof A=="object"){const H=N[N.length-1];H.d=typeof H.d=="string"&&typeof A.d=="string"?H.d+A.d:e.dlen(H.d)+e.dlen(A.d)}else N[N.length-1]+=A;else N.push(A)},l=N=>typeof N=="number"?N:typeof N=="string"?t.strPosToUni(N):typeof N.d=="number"?N.d:t.strPosToUni(N.d);e.uniSlice=(N,A,H)=>{const J=t.uniToStrPos(N,A),de=H==null?1/0:t.uniToStrPos(N,H);return N.slice(J,de)};const c=(N,A,H)=>typeof N=="number"?H==null?N-A:Math.min(N,H)-A:e.uniSlice(N,A,H),h=N=>{let A=0,H=0;return{take:(le,m)=>{if(A===N.length)return le===-1?null:le;const j=N[A];let y;if(typeof j=="number")return le===-1||j-H<=le?(y=j-H,++A,H=0,y):(H+=le,le);if(typeof j=="string"){if(le===-1||m==="i"||t.strPosToUni(j.slice(H))<=le)return y=j.slice(H),++A,H=0,y;{const D=H+t.uniToStrPos(j.slice(H),le);return y=j.slice(H,D),H=D,y}}else{if(le===-1||m==="d"||e.dlen(j.d)-H<=le)return y={d:c(j.d,H)},++A,H=0,y;{let D=c(j.d,H,H+le);return H+=le,{d:D}}}},peek:()=>N[A]}},u=N=>(N.length>0&&typeof N[N.length-1]=="number"&&N.pop(),N);function d(N,A,H){if(H!=="left"&&H!=="right")throw Error("side ("+H+") must be 'left' or 'right'");n(N),n(A);const J=[],de=a(J),{take:le,peek:m}=h(N);for(let y=0;y<A.length;y++){const D=A[y];let b,S;switch(typeof D){case"number":for(b=D;b>0;)S=le(b,"i"),de(S),typeof S!="string"&&(b-=l(S));break;case"string":H==="left"&&typeof m()=="string"&&de(le(-1)),de(t.strPosToUni(D));break;case"object":for(b=e.dlen(D.d);b>0;)switch(S=le(b,"i"),typeof S){case"number":b-=S;break;case"string":de(S);break;case"object":b-=e.dlen(S.d)}break}}let j;for(;j=le(-1);)de(j);return u(J)}function f(N,A){n(N),n(A);const H=[],J=a(H),{take:de}=h(N);for(let m=0;m<A.length;m++){const j=A[m];let y,D;switch(typeof j){case"number":for(y=j;y>0;)D=de(y,"d"),J(D),typeof D!="object"&&(y-=l(D));break;case"string":J(j);break;case"object":y=e.dlen(j.d);let b=0;for(;b<y;)switch(D=de(y-b,"d"),typeof D){case"number":J({d:c(j.d,b,b+D)}),b+=D;break;case"string":b+=t.strPosToUni(D);break;case"object":J(D)}break}}let le;for(;le=de(-1);)J(le);return u(H)}const E=(N,A)=>{let H=0;for(let J=0;J<A.length&&N>H;J++){const de=A[J];switch(typeof de){case"number":{H+=de;break}case"string":const le=t.strPosToUni(de);H+=le,N+=le;break;case"object":N-=Math.min(e.dlen(de.d),N-H);break}}return N},R=(N,A)=>typeof N=="number"?E(N,A):N.map(H=>E(H,A));function O(N,A,H){return s(N,(J,de)=>typeof J=="object"&&typeof J.d=="number"?{d:H.slice(A,de,de+J.d)}:J)}function T(N){return s(N,A=>{switch(typeof A){case"object":if(typeof A.d=="number")throw Error("Cannot invert text op: Deleted characters missing from operation. makeInvertible must be called first.");return A.d;case"string":return{d:A};case"number":return A}})}function V(N){return s(N,A=>typeof A=="object"&&typeof A.d=="string"?{d:t.strPosToUni(A.d)}:A)}function z(N){let A=!0;return r(N,H=>{typeof H=="object"&&typeof H.d=="number"&&(A=!1)}),A}function oe(N){return{name:"text-unicode",uri:"http://sharejs.org/types/text-unicode",trim:u,normalize:o,checkOp:n,create(A=""){if(typeof A!="string")throw Error("Initial data must be a string");return N.create(A)},apply(A,H){n(H);const J=N.builder(A);for(let de=0;de<H.length;de++){const le=H[de];switch(typeof le){case"number":J.skip(le);break;case"string":J.append(le);break;case"object":J.del(e.dlen(le.d));break}}return J.build()},transform:d,compose:f,transformPosition:E,transformSelection:R,isInvertible:z,makeInvertible(A,H){return O(A,H,N)},stripInvertible:V,invert:T,invertWithDoc(A,H){return T(O(A,H,N))},isNoop:A=>A.length===0}}e.default=oe}(Fs)),Fs}var xr={},ga;function H_(){if(ga)return xr;ga=1,Object.defineProperty(xr,"__esModule",{value:!0});const e=hi(),t=Xi();function n(r,s){return{get:r,getLength(){return r().length},insert(i,o,a){const l=t.strPosToUni(r(),i);return s([l,o],a)},remove(i,o,a){const l=t.strPosToUni(r(),i);return s([l,{d:o}],a)},_onOp(i){e.eachOp(i,(o,a,l)=>{switch(typeof o){case"string":this.onInsert&&this.onInsert(l,o);break;case"object":const c=e.dlen(o.d);this.onRemove&&this.onRemove(l,c)}})},onInsert:null,onRemove:null}}return xr.default=n,n.provides={text:!0},xr}var pa;function W_(){return pa||(pa=1,function(e){var t=hn.__createBinding||(Object.create?function(d,f,E,R){R===void 0&&(R=E),Object.defineProperty(d,R,{enumerable:!0,get:function(){return f[E]}})}:function(d,f,E,R){R===void 0&&(R=E),d[R]=f[E]}),n=hn.__setModuleDefault||(Object.create?function(d,f){Object.defineProperty(d,"default",{enumerable:!0,value:f})}:function(d,f){d.default=f}),r=hn.__importStar||function(d){if(d&&d.__esModule)return d;var f={};if(d!=null)for(var E in d)Object.hasOwnProperty.call(d,E)&&t(f,d,E);return n(f,d),f},s=hn.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.type=e.remove=e.insert=void 0;const i=Xi(),o=r(hi()),a=s(H_()),l={create(d){return d},toString(d){return d},builder(d){if(typeof d!="string")throw Error("Invalid document snapshot: "+d);const f=[];return{skip(E){let R=i.uniToStrPos(d,E);if(R>d.length)throw Error("The op is too long for this document");f.push(d.slice(0,R)),d=d.slice(R)},append(E){f.push(E)},del(E){d=d.slice(i.uniToStrPos(d,E))},build(){return f.join("")+d}}},slice:o.uniSlice},c=o.default(l),h=Object.assign(Object.assign({},c),{api:a.default});e.type=h,e.insert=(d,f)=>f.length===0?[]:d===0?[f]:[d,f],e.remove=(d,f)=>o.dlen(f)===0?[]:d===0?[{d:f}]:[d,{d:f}];var u=hi();Object.defineProperty(e,"makeType",{enumerable:!0,get:function(){return u.default}})}(hn)),hn}var ma;function z_(){return ma||(ma=1,function(e){var t=Nr.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(e,"__esModule",{value:!0}),e.editOp=e.replaceOp=e.insertOp=e.moveOp=e.removeOp=e.type=void 0;const n=t(B_()),r=t(j_()),s=Ku(),i=Xu();function o(v,k){if(!v)throw new Error(k)}e.type={name:"json1",uri:"http://sharejs.org/types/JSONv1",readCursor:s.readCursor,writeCursor:s.writeCursor,create:v=>v,isNoop:v=>v==null,setDebug(v){},registerSubtype:T,checkValidOp:de,normalize:le,apply:m,transformPosition:j,compose:y,tryTransform:G,transform:he,makeInvertible:S,invert:D,invertWithDoc:F,RM_UNEXPECTED_CONTENT:i.ConflictType.RM_UNEXPECTED_CONTENT,DROP_COLLISION:i.ConflictType.DROP_COLLISION,BLACKHOLE:i.ConflictType.BLACKHOLE,transformNoConflict:(v,k,K)=>we(()=>!0,v,k,K),typeAllowingConflictsPred:v=>Object.assign(Object.assign({},e.type),{transform:(k,K,Q)=>we(v,k,K,Q)})};const a=v=>v?v.getComponent():null;function l(v){return v&&typeof v=="object"&&!Array.isArray(v)}const c=v=>Array.isArray(v)?v.slice():v!==null&&typeof v=="object"?Object.assign({},v):v,h=v=>v&&(v.p!=null||v.r!==void 0),u=v=>v&&(v.d!=null||v.i!==void 0);function d(v,k){return o(v!=null),typeof k=="number"?(o(Array.isArray(v),"Invalid key - child is not an array"),(v=v.slice()).splice(k,1)):(o(l(v),"Invalid key - child is not an object"),delete(v=Object.assign({},v))[k]),v}function f(v,k,K){return typeof k=="number"?(o(v!=null,"Container is missing for key"),o(Array.isArray(v),"Cannot use numerical key for object container"),o(v.length>=k,"Cannot insert into out of bounds index"),v.splice(k,0,K)):(o(l(v),"Cannot insert into missing item"),o(v[k]===void 0,"Trying to overwrite value at key. Your op needs to remove it first"),v[k]=K),K}e.removeOp=(v,k=!0)=>s.writeCursor().writeAtPath(v,"r",k).get(),e.moveOp=(v,k)=>s.writeCursor().writeMove(v,k).get(),e.insertOp=(v,k)=>s.writeCursor().writeAtPath(v,"i",k).get(),e.replaceOp=(v,k,K)=>s.writeCursor().at(v,Q=>{Q.write("r",k),Q.write("i",K)}).get(),e.editOp=(v,k,K,Q=!1)=>s.writeCursor().at(v,Y=>A(Y,k,K,Q)).get();const E=(v,k)=>v!=null&&(typeof k=="number"?Array.isArray(v):typeof v=="object"),R=(v,k)=>E(v,k)?v[k]:void 0,O={};function T(v){let k=v.type?v.type:v;k.name&&(O[k.name]=k),k.uri&&(O[k.uri]=k)}const V=v=>{const k=O[v];if(k)return k;throw Error("Missing type: "+v)};T(W_());const z=(v,k)=>v+k;T({name:"number",apply:z,compose:z,invert:v=>-v,transform:v=>v});const oe=v=>v==null?null:v.et?V(v.et):v.es?O["text-unicode"]:v.ena!=null?O.number:null,N=v=>v.es?v.es:v.ena!=null?v.ena:v.e,A=(v,k,K,Q=!1)=>{const[Y,W]=typeof k=="string"?[V(k),k]:[k,k.name];!Q&&Y.isNoop&&Y.isNoop(K)||(W==="number"?v.write("ena",K):W==="text-unicode"?v.write("es",K):(v.write("et",W),v.write("e",K)))};function H(v){o(typeof v=="number"),o(v>=0),o(v===(0|v))}function J(v){typeof v=="number"?H(v):o(typeof v=="string")}function de(v){if(v===null)return;const k=new Set,K=new Set,Q=W=>{let ue=!0,ae=!1;for(let B in W){const te=W[B];if(ue=!1,o(B==="p"||B==="r"||B==="d"||B==="i"||B==="e"||B==="es"||B==="ena"||B==="et","Invalid component item '"+B+"'"),B==="p")H(te),o(!k.has(te)),k.add(te),o(W.r===void 0);else if(B==="d")H(te),o(!K.has(te)),K.add(te),o(W.i===void 0);else if(B==="e"||B==="es"||B==="ena"){o(!ae),ae=!0;const ie=oe(W);o(ie,"Missing type in edit"),ie.checkValidOp&&ie.checkValidOp(N(W))}}o(!ue)},Y=(W,ue,ae)=>{if(!Array.isArray(W))throw Error("Op must be null or a list");if(W.length===0)throw Error("Empty descent");ue||J(W[0]);let B=1,te=0,ie=0;for(let pe=0;pe<W.length;pe++){const be=W[pe];if(o(be!=null),Array.isArray(be)){const De=Y(be,!1);if(te){const X=typeof ie,Re=typeof De;X===Re?o(ie<De,"descent keys are not in order"):o(X==="number"&&Re==="string")}ie=De,te++,B=3}else typeof be=="object"?(o(B===1,`Prev not scalar - instead ${B}`),Q(be),B=2):(o(B!==3),J(be),o(s.isValidPathItem(be),"Invalid path key"),B=1)}return o(te!==1,"Operation makes multiple descents. Remove some []"),o(B===2||B===3),W[0]};Y(v,!0),o(k.size===K.size,"Mismatched picks and drops in op");for(let W=0;W<k.size;W++)o(k.has(W)),o(K.has(W))}function le(v){let k=0,K=[];const Q=s.writeCursor();return Q.mergeTree(v,(Y,W)=>{const ue=oe(Y);if(ue){const B=N(Y);A(W,ue,ue.normalize?ue.normalize(B):B)}for(const B of["r","p","i","d"])if(Y[B]!==void 0){const te=B==="p"||B==="d"?(ae=Y[B],K[ae]==null&&(K[ae]=k++),K[ae]):Y[B];W.write(B,te)}var ae}),Q.get()}function m(v,k){if(de(k),k===null)return v;const K=[];return function Q(Y,W){let ue=Y,ae=0,B={root:Y},te=0,ie=B,pe="root";function be(){for(;te<ae;te++){let De=W[te];typeof De!="object"&&(o(E(ie,pe)),ie=ie[pe]=c(ie[pe]),pe=De)}}for(;ae<W.length;ae++){const De=W[ae];if(Array.isArray(De)){const X=Q(ue,De);X!==ue&&X!==void 0&&(be(),ue=ie[pe]=X)}else if(typeof De=="object"){De.d!=null?(be(),ue=f(ie,pe,K[De.d])):De.i!==void 0&&(be(),ue=f(ie,pe,De.i));const X=oe(De);if(X)be(),ue=ie[pe]=X.apply(ue,N(De));else if(De.e!==void 0)throw Error("Subtype "+De.et+" undefined")}else ue=R(ue,De)}return B.root}(v=function Q(Y,W){const ue=[];let ae=0;for(;ae<W.length;ae++){const pe=W[ae];if(Array.isArray(pe))break;typeof pe!="object"&&(ue.push(Y),Y=R(Y,pe))}for(let pe=W.length-1;pe>=ae;pe--)Y=Q(Y,W[pe]);for(--ae;ae>=0;ae--){const pe=W[ae];if(typeof pe!="object"){const be=ue.pop();Y=Y===R(be,pe)?be:Y===void 0?d(be,pe):(te=pe,ie=Y,(B=c(B=be))[te]=ie,B)}else h(pe)&&(o(Y!==void 0,"Cannot pick up or remove undefined"),pe.p!=null&&(K[pe.p]=Y),Y=void 0)}var B,te,ie;return Y}(v,k),k)}function j(v,k){v=v.slice(),de(k);const K=s.readCursor(k);let Q,Y,W=!1;const ue=[];for(let B=0;;B++){const te=v[B],ie=K.getComponent();if(ie&&(ie.r!==void 0?W=!0:ie.p!=null&&(W=!1,Q=ie.p,Y=B)),B>=v.length)break;let pe=0;const be=s.advancer(K,void 0,(X,Re)=>{h(Re)&&pe++});ue.unshift(be);const De=be(te);if(typeof te=="number"&&(v[B]-=pe),!De)break}if(ue.forEach(B=>B.end()),W)return null;const ae=()=>{let B=0;if(Q!=null){const te=K.getPath();B=te.length,v=te.concat(v.slice(Y))}for(;B<v.length;B++){const te=v[B],ie=a(K),pe=oe(ie);if(pe){const X=N(ie);pe.transformPosition&&(v[B]=pe.transformPosition(v[B],X));break}let be=0;const De=s.advancer(K,(X,Re)=>u(Re)?~(X-be):X-be,(X,Re)=>{u(Re)&&be++})(te);if(typeof te=="number"&&(v[B]+=be),!De)break}};return Q!=null?K.eachDrop(null,B=>{B===Q&&ae()}):ae(),v}function y(v,k){if(de(v),de(k),v==null)return k;if(k==null)return v;let K=0;const Q=s.readCursor(v),Y=s.readCursor(k),W=s.writeCursor(),ue=[],ae=[],B=[],te=[],ie=[],pe=[],be=new Set;Q.traverse(null,X=>{X.p!=null&&(B[X.p]=Q.clone())}),Y.traverse(null,X=>{X.d!=null&&(te[X.d]=Y.clone())});const De=s.writeCursor();return function X(Re,ze,je,Le,qe,Rt,Ye,et){o(ze||je);const Ve=a(ze),ht=a(je),at=!!ht&&ht.r!==void 0,Ft=!!Ve&&Ve.i!==void 0,ke=Ve?Ve.d:null,dt=ht?ht.p:null,_=(Rt||at)&&dt==null;if(dt!=null)Le=te[dt],Ye=ae[dt]=new s.WriteCursor;else if(ht&&ht.r!==void 0)Le=null;else{const x=a(Le);x&&x.d!=null&&(Le=null)}const g=a(Le);if(ke!=null)if(Re=B[ke],et=ue[ke]=new s.WriteCursor,_)Rt&&!at&&et.write("r",!0);else{const x=ie[ke]=K++;Ye.write("d",x)}else if(Ve&&Ve.i!==void 0)Re=null;else{const x=a(Re);x&&x.p!=null&&(Re=null)}let p;Ft?(o(qe===void 0),p=Ve.i):p=qe;const w=(dt==null?!Ft||Rt||at:p===void 0)?null:Ye.getComponent();if(dt!=null){if(!(qe!==void 0||Ft)){const x=ke!=null?ie[ke]:K++;pe[dt]=x,et.write("p",x)}}else at&&(Ft||qe!==void 0||(ht.r,et.write("r",ht.r)));const M=_?null:oe(Ve),U=oe(g);if((M||U)&&(M&&M.name,U&&U.name),M&&U){o(M===U);const x=N(Ve),ee=N(g),Ce=M.compose(x,ee);A(Ye,M,Ce),be.add(g)}else M?A(Ye,M,N(Ve)):U&&(A(Ye,U,N(g)),be.add(g));const L=typeof p=="object"&&p!=null;let P=!1,I=0,Z=0,_e=0,q=0,me=0;const ye=s.advancer(Le,(x,ee)=>u(ee)?q-x-1:x-q,(x,ee)=>{u(ee)&&q++}),ce=s.advancer(Re,(x,ee)=>h(ee)?I-x-1:x-I,(x,ee)=>{h(ee)&&I++});if(s.eachChildOf(ze,je,(x,ee,Ce)=>{let Ae,Ue,Fe=x,He=x,ft=x;if(typeof x=="number"){let Me=x+_e;Ue=ye(Me),He=Me+q;let ne=x+Z;Ae=ce(ne),u(a(Ue))&&(Ae=null),Fe=ne+I,ft=x+me,o(Fe>=0,"p1PickKey is negative"),o(He>=0,"p2DropKey is negative");const ut=u(a(ee)),Be=h(a(Ce));(ut||Be&&!_)&&me--,ut&&Z--,Be&&_e--}else Ae=ce(x),Ue=ye(x);et.descend(Fe),Ye.descend(He);const pt=L&&!u(a(ee))?p[ft]:void 0,Ee=X(Ae,ee,Ce,Ue,pt,_,Ye,et);var Ze,ve,Ie;L&&!_?pt!==Ee&&(P||(p=Array.isArray(p)?p.slice():Object.assign({},p),P=!0),Ze=p,Ie=Ee,typeof(ve=ft)=="number"?(o(Array.isArray(Ze)),o(ve<Ze.length)):(o(!Array.isArray(Ze)),o(Ze[ve]!==void 0)),Ie===void 0?typeof ve=="number"?Ze.splice(ve,1):delete Ze[ve]:Ze[ve]=Ie):o(Ee===void 0),Ye.ascend(),et.ascend()}),ce.end(),ye.end(),w!=null)w.i=p;else if(!Rt&&!at&&dt==null)return p}(Q,Q.clone(),Y,Y.clone(),void 0,!1,W,De),W.reset(),W.mergeTree(De.get()),W.reset(),W.get(),ue.map(X=>X.get()),ae.map(X=>X.get()),Q.traverse(W,(X,Re)=>{const ze=X.p;if(ze!=null){const je=ie[ze];je!=null&&Re.write("p",je);const Le=ue[ze];Le&&Le.get(),Le&&Re.mergeTree(Le.get())}else X.r!==void 0&&Re.write("r",X.r)}),W.reset(),W.get(),Y.traverse(W,(X,Re)=>{const ze=X.d;if(ze!=null){const Le=pe[ze];Le!=null&&Re.write("d",Le);const qe=ae[ze];qe&&Re.mergeTree(qe.get())}else X.i!==void 0&&Re.write("i",X.i);const je=oe(X);je&&!be.has(X)&&A(Re,je,N(X))}),W.get()}function D(v){if(v==null)return null;const k=new s.ReadCursor(v),K=new s.WriteCursor;let Q;const Y=[],W=[];return function ue(ae,B,te){const ie=ae.getComponent();let pe,be=!1;if(ie){ie.p!=null&&(B.write("d",ie.p),Y[ie.p]=ae.clone()),ie.r!==void 0&&B.write("i",ie.r),ie.d!=null&&(B.write("p",ie.d),te=void 0),ie.i!==void 0&&(te=pe=ie.i);const X=oe(ie);X&&(te===void 0?(Q||(Q=new Set),Q.add(ie)):(N(ie),te=X.apply(te,N(ie)),be=!0))}let De=0;for(const X of ae){B.descend(X);const Re=typeof X=="number"?X-De:X,ze=R(te,Re);u(ae.getComponent())&&De++;const je=ue(ae,B,ze);if(te!==void 0&&je!==void 0){if(be||(be=!0,te=c(te)),!E(te,Re))throw Error("Cannot modify child - invalid operation");te[Re]=je}B.ascend()}if(pe===void 0)return be?te:void 0;B.write("r",te)}(k,K,void 0),Q&&(K.reset(),function ue(ae,B,te){const ie=B.getComponent();if(ie){const X=ie.d;if(X!=null&&(ae=Y[X],te=W[X]=s.writeCursor()),Q.has(ie)){const Re=oe(ie);if(!Re.invert)throw Error(`Cannot invert subtype ${Re.name}`);A(te,Re,Re.invert(N(ie)))}}let pe=0,be=0;const De=s.advancer(ae,(X,Re)=>h(Re)?pe-X-1:X-pe,(X,Re)=>{h(Re)&&pe++});for(const X of B)if(typeof X=="number"){const Re=X-be,ze=De(Re),je=Re+pe;te.descend(je),ue(ze,B,te),u(B.getComponent())&&be++,te.ascend()}else te.descend(X),ue(De(X),B,te),te.ascend();De.end()}(k.clone(),k,K),W.length&&(K.reset(),k.traverse(K,(ue,ae)=>{const B=ue.p;if(B!=null){const te=W[B];te&&te.get(),te&&ae.mergeTree(te.get())}}))),K.get()}const b=(v,k)=>v.some(K=>typeof K=="object"&&(Array.isArray(K)?b(K,k):k(K)));function S(v,k){if(v==null||!b(v,B=>{var te;return B.r!==void 0||((te=oe(B))===null||te===void 0?void 0:te.makeInvertible)!=null}))return v;const K=new s.ReadCursor(v),Q=new s.WriteCursor;let Y=!1;const W=[],ue=[],ae=(B,te,ie)=>{const pe=B.getComponent();let be=!1;if(pe){pe.d!=null&&te.write("d",pe.d),pe.i!==void 0&&te.write("i",pe.i);const X=pe.p;if(X!=null&&(W[X]=B.clone(),o(ie!==void 0,"Operation picks up at an invalid key"),ue[X]=ie,te.write("p",pe.p)),pe.r!==void 0&&ie===void 0)throw Error("Invalid doc / op in makeInvertible: removed item missing from doc");const Re=oe(pe);Re&&(Re.makeInvertible?Y=!0:A(te,Re,N(pe),!0))}let De=0;for(const X of B){te.descend(X);const Re=typeof X=="number"?X-De:X,ze=R(ie,Re),je=ae(B,te,ze);ze!==je&&(be||(be=!0,ie=c(ie)),je===void 0?(ie=d(ie,Re),typeof X=="number"&&De++):ie[Re]=je),te.ascend()}return pe&&(pe.r!==void 0?(te.write("r",r.default(ie)),ie=void 0):pe.p!=null&&(ie=void 0)),ie};return ae(K,Q,k),Q.get(),Y&&(Q.reset(),function B(te,ie,pe,be,De){const X=ie.getComponent();if(X){X.i!==void 0?(be=X.i,De=!0):X.d!=null&&(be=ue[X.d],te=W[X.d],De=!1,X.d);let Le=oe(X);if(Le&&Le.makeInvertible){const qe=N(X);A(pe,Le,Le.makeInvertible(qe,be),!0)}}let Re=0,ze=0;const je=s.advancer(te,(Le,qe)=>h(qe)?Re-Le-1:Le-Re,(Le,qe)=>{h(qe)&&Re++});for(const Le of ie)if(typeof Le=="number"){const qe=Le-ze,Rt=je(qe),Ye=qe+Re,et=R(be,De?qe:Ye);pe.descend(Le),B(Rt,ie,pe,et,De),u(ie.getComponent())&&ze++,pe.ascend()}else{const qe=R(be,Le);pe.descend(Le),B(je(Le),ie,pe,qe,De),pe.ascend()}je.end()}(K.clone(),K,Q,k,!1)),Q.get()}function F(v,k){return D(S(v,k))}const $=v=>{if(v==null)return null;const k=v.slice();for(let K=0;K<v.length;K++){const Q=k[K];Array.isArray(Q)&&(k[K]=$(Q))}return k};function G(v,k,K){o(K==="left"||K==="right","Direction must be left or right");const Q=K==="left"?0:1;if(k==null)return{ok:!0,result:v};de(v),de(k);let Y=null;const W=[],ue=[],ae=[],B=[],te=[],ie=[],pe=[],be=[],De=[],X=[],Re=[],ze=[],je=[],Le=[],qe=[];let Rt=0;const Ye=s.readCursor(v),et=s.readCursor(k),Ve=s.writeCursor();if(function g(p,w=null,M){const U=a(w);U&&(U.r!==void 0?M=w.clone():U.p!=null&&(M=null,ie[U.p]=p.clone()));const L=p.getComponent();let P;L&&(P=L.p)!=null&&(te[P]=w?w.clone():null,ae[P]=p.clone(),M&&(X[P]=!0,De[P]=M),U&&U.p!=null&&(Le[P]=U.p));const I=s.advancer(w);for(const Z of p)g(p,I(Z),M);I.end()}(et,Ye,null),function g(p,w,M,U,L){const P=M.getComponent();let I,Z=!1;P&&((I=P.d)!=null?(B[I]=M.clone(),U!=null&&(qe[U]==null&&(qe[U]=[]),qe[U].push(I)),X[I],p=te[I]||null,w=ae[I]||null,X[I]?(L&&(Re[I]=!0),L=De[I]||null):!L||Q!==1&&Le[I]!=null||Y==null&&(Y={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(L.getPath()),op2:e.moveOp(w.getPath(),M.getPath())}),Z=!0):P.i!==void 0&&(p=w=null,Z=!0,L&&Y==null&&(Y={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(L.getPath()),op2:e.insertOp(M.getPath(),P.i)})));const _e=a(p);_e&&(_e.r!==void 0?L=p.clone():_e.p!=null&&(_e.p,U=_e.p,L=null));const q=oe(P);q&&L&&Y==null&&(Y={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(L.getPath()),op2:e.editOp(M.getPath(),q,N(P),!0)});let me=0,ye=0;const ce=s.advancer(w,(ee,Ce)=>h(Ce)?me-ee-1:ee-me,(ee,Ce)=>{h(Ce)&&me++}),x=s.advancer(p);for(const ee of M)if(typeof ee=="number"){const Ce=ee-ye,Ae=ce(Ce);ye+=+g(x(Ce+me),Ae,M,U,L)}else{const Ce=ce(ee);g(x(ee),Ce,M,U,L)}return ce.end(),x.end(),Z}(Ye,et,et.clone(),null,null),B.map(g=>g&&g.get()),Y)return{ok:!1,conflict:Y};Re.map(g=>!!g);const ht=[];let at=null;(function g(p,w,M,U,L){let P=!1;const I=a(w);if(h(I)){const ce=I.p;ce!=null?(M=B[ce],U=ze[ce]=s.writeCursor(),P=!0,L=null):(M=null,L=w.clone())}else u(a(M))&&(M=null);const Z=p.getComponent();if(Z){const ce=Z.p;ce!=null?(L&&(be[ce]=L),ht[ce]=L||Q===1&&P?null:U.getComponent(),W[ce]=p.clone(),M&&(pe[ce]=M.clone())):Z.r!==void 0&&(L||U.write("r",!0),(L||P)&&(at==null&&(at=new Set),at.add(Z)))}let _e=0,q=0;const me=s.advancer(w,void 0,(ce,x)=>{h(x)&&_e++}),ye=s.advancer(M,(ce,x)=>u(x)?~(ce-q):ce-q,(ce,x)=>{u(x)&&q++});if(p)for(const ce of p)if(typeof ce=="string"){const x=me(ce),ee=ye(ce);U.descend(ce),g(p,x,ee,U,L),U.ascend()}else{const x=me(ce),ee=ce-_e,Ce=h(a(x))?null:ye(ee),Ae=ee+q;o(Ae>=0),U.descend(Ae),g(p,x,Ce,U,L),U.ascend()}me.end(),ye.end()})(Ye,et,et.clone(),Ve,null),Ve.reset();let Ft=[];if(function g(p,w,M,U,L,P){o(w);const I=w.getComponent();let Z=a(U),_e=!1;const q=(ve,Ie,Me)=>ve?e.moveOp(ve.getPath(),Ie.getPath()):e.insertOp(Ie.getPath(),Me.i);if(u(I)){const ve=I.d;ve!=null&&(ue[ve]=w.clone());const Ie=ve!=null?ht[ve]:null;let Me=!1;if(I.i!==void 0||ve!=null&&Ie){let ne;Z&&(Z.i!==void 0||(ne=Z.d)!=null&&!X[ne])&&(Me=ne!=null?ve!=null&&ve===Le[ne]:n.default(Z.i,I.i),Me||ne!=null&&Q!==1&&Le[ne]!=null||Y==null&&(Y={type:i.ConflictType.DROP_COLLISION,op1:q(ve!=null?W[ve]:null,w,I),op2:q(ne!=null?ae[ne]:null,U,Z)})),Me||(P?Y==null&&(Y={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:q(ve!=null?W[ve]:null,w,I),op2:e.removeOp(P.getPath())}):(ve!=null?(Ft[Rt]=ve,L.write("d",Ie.p=Rt++)):L.write("i",r.default(I.i)),_e=!0))}else if(ve!=null&&!Ie){const ne=be[ve];ne&&(P=ne.clone())}ve!=null?(p=W[ve],M=ie[ve],U=pe[ve]):I.i!==void 0&&(p=M=null,Me||(U=null))}else h(a(p))&&(p=M=U=null);const me=a(p),ye=a(M);if(h(ye)){const ve=ye.p;ye.r!==void 0&&(!me||me.r===void 0)||X[ve]?(U=null,P=M.clone()):ve!=null&&(U=B[ve],Q!==1&&Le[ve]!=null||((L=je[ve])||(L=je[ve]=s.writeCursor()),L.reset(),P=null))}else!u(I)&&u(Z)&&(U=null);Z=U!=null?U.getComponent():null;const ce=oe(I);if(ce){const ve=N(I);if(P)Y==null&&(Y={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.editOp(w.getPath(),ce,ve,!0),op2:e.removeOp(P.getPath())});else{const Ie=oe(Z);let Me;if(Ie){if(ce!==Ie)throw Error("Transforming incompatible types");const ne=N(Z);Me=ce.transform(ve,ne,K)}else Me=r.default(ve);A(L,ce,Me)}}let x=0,ee=0,Ce=0,Ae=0,Ue=0,Fe=0,He=p!=null&&p.descendFirst(),ft=He;const pt=s.advancer(M,void 0,(ve,Ie)=>{h(Ie)&&Ce++});let Ee=U!=null&&U.descendFirst(),Ze=Ee;for(const ve of w)if(typeof ve=="number"){let Ie;const Me=u(w.getComponent()),ne=ve-ee;{let Xt;for(;He&&typeof(Xt=p.getKey())=="number";){Xt+=x;const Ot=p.getComponent(),Rn=h(Ot);if(Xt>ne||Xt===ne&&(!Rn||Q===0&&Me))break;if(Rn){x--;const un=Ot.p;Le.includes(un),Ot.d,a(je[Ot.d]),h(a(je[Ot.d])),(Ot.r===void 0||at&&at.has(Ot))&&(un==null||!ht[un]||Q!==1&&Le.includes(un))||Ue--}He=p.nextSibling()}Ie=He&&Xt===ne?p:null}const ut=ne-x;let Be=pt(ut);const Tt=ut-Ce;let Sr=null;{let Xt,Ot;for(;Ee&&typeof(Xt=U.getKey())=="number";){Ot=Xt-Ae;const Rn=U.getComponent(),un=u(Rn);if(Ot>Tt)break;if(Ot===Tt){if(!un){Sr=U;break}{if(Q===0&&Me){Sr=U;break}const Qt=Be&&h(Be.getComponent());if(Q===0&&Qt)break}}if(un){const Qt=Rn.d;X[Qt],Le[Qt],Rn.i===void 0&&(X[Qt]||Le[Qt]!=null&&Q!==1)?(X[Qt]||Le[Qt]!=null&&Q===0)&&(Ae++,Fe--):Ae++}Ee=U.nextSibling()}}const ho=Tt+Ae+Ue+Fe;o(ho>=0,"trying to descend to a negative index"),L.descend(ho),Me&&(Ie=Be=Sr=null,ee++),g(Ie,w,Be,Sr,L,P)&&Fe++,L.ascend()}else{let Ie;for(;He&&(Ie=p.getKey(),typeof Ie!="string"||!(Ie>ve||Ie===ve));)He=p.nextSibling();const Me=He&&Ie===ve?p:null,ne=pt(ve);let ut;for(;Ee&&(ut=U.getKey(),typeof ut!="string"||!(ut>ve||ut===ve));)Ee=U.nextSibling();const Be=Ee&&ut===ve?U:null;L.descend(ve),g(Me,w,ne,Be,L,P),L.ascend()}return pt.end(),ft&&p.ascend(),Ze&&U.ascend(),_e}(Ye,Ye.clone(),et,et.clone(),Ve,null),Y)return{ok:!1,conflict:Y};Ve.reset();const ke=(g,p,w)=>g.traverse(p,(M,U)=>{M.d!=null&&w(M.d,g,U)});(X.length||ze.length)&&(ke(et,Ve,(g,p,w)=>{X[g]&&!Re[g]&&w.write("r",!0),ze[g]&&w.mergeTree(ze[g].get())}),Ve.reset());const dt=[],_=[];if((je.length||X.length)&&!Y){const g=s.readCursor($(Ve.get()));if(ke(g,null,(p,w)=>{dt[p]=w.clone()}),je.forEach(p=>{p&&ke(s.readCursor(p.get()),null,(w,M)=>{dt[w]=M.clone()})}),function p(w,M,U,L,P,I){const Z=a(M);if(Z&&h(Z))if(Z.p!=null){const x=Z.p;dt[x].getPath(),U=dt[x],L=_[x]=s.writeCursor()}else Z.r!==void 0&&(U=null);else u(a(U))&&(U=null);const _e=w.getComponent();if(_e){let x;if((x=_e.d)!=null){const ee=je[x];ee&&(ee.get(),L.mergeTree(ee.get()),U=s.readCursor(ee.get()))}}let q=0,me=0;const ye=s.advancer(M,void 0,(x,ee)=>{h(ee)&&q--}),ce=s.advancer(U,(x,ee)=>u(ee)?-(x-me)-1:x-me,(x,ee)=>{u(ee)&&me++});for(const x of w)if(typeof x=="number"){const ee=ye(x),Ce=x+q,Ae=ce(Ce),Ue=Ce+me;L.descend(Ue),p(w,ee,Ae,L),L.ascend()}else L.descend(x),p(w,ye(x),ce(x),L),L.ascend();ye.end(),ce.end()}(et,g,g.clone(),Ve),Ve.reset(),Y)return{ok:!1,conflict:Y};if(Ve.get(),_.length){const p=_.map(M=>M?M.get():null),w=s.readCursor($(Ve.get()));if(ke(w,Ve,(M,U,L)=>{const P=p[M];P&&(L.mergeTree(P),p[M]=null)}),p.find(M=>M)){const M=s.writeCursor(),U=s.writeCursor();let L=0,P=0;p.forEach(I=>{I!=null&&ke(s.readCursor(I),null,Z=>{const _e=Ft[Z];M.writeMove(W[_e].getPath(),ue[_e].getPath(),L++);const q=qe[_e];q&&q.forEach(me=>{X[me]||Q!==1&&Le[me]!=null||U.writeMove(ae[me].getPath(),B[me].getPath(),P++)})})}),Y={type:i.ConflictType.BLACKHOLE,op1:M.get(),op2:U.get()}}}}return Y?{ok:!1,conflict:Y}:{ok:!0,result:Ve.get()}}const se=v=>{const k=new Error("Transform detected write conflict");throw k.conflict=v,k.type=k.name="writeConflict",k};function he(v,k,K){const Q=G(v,k,K);if(Q.ok)return Q.result;se(Q.conflict)}const ge=v=>{const k=s.writeCursor();return s.readCursor(v).traverse(k,(K,Q)=>{(u(K)||oe(K))&&Q.write("r",!0)}),k.get()},Te=(v,k)=>{const{type:K,op1:Q,op2:Y}=v;switch(K){case i.ConflictType.DROP_COLLISION:return k==="left"?[null,ge(Y)]:[ge(Q),null];case i.ConflictType.RM_UNEXPECTED_CONTENT:let W=!1;return s.readCursor(Q).traverse(null,ue=>{ue.r!==void 0&&(W=!0)}),W?[null,ge(Y)]:[ge(Q),null];case i.ConflictType.BLACKHOLE:return[ge(Q),ge(Y)];default:throw Error("Unrecognised conflict: "+K)}};function we(v,k,K,Q){let Y=null;for(;;){const W=G(k,K,Q);if(W.ok)return y(Y,W.result);{const{conflict:ue}=W;v(ue)||se(ue);const[ae,B]=Te(ue,Q);k=y(le(k),ae),K=y(le(K),B),Y=y(Y,B)}}}}(Nr)),Nr}var _a;function Y_(){return _a||(_a=1,function(e){var t=Kn.__createBinding||(Object.create?function(i,o,a,l){l===void 0&&(l=a),Object.defineProperty(i,l,{enumerable:!0,get:function(){return o[a]}})}:function(i,o,a,l){l===void 0&&(l=a),i[l]=o[a]}),n=Kn.__exportStar||function(i,o){for(var a in i)a!=="default"&&!o.hasOwnProperty(a)&&t(o,i,a)};Object.defineProperty(e,"__esModule",{value:!0}),n(z_(),e);var r=Ku();Object.defineProperty(e,"ReadCursor",{enumerable:!0,get:function(){return r.ReadCursor}}),Object.defineProperty(e,"WriteCursor",{enumerable:!0,get:function(){return r.WriteCursor}});var s=Xu();Object.defineProperty(e,"ConflictType",{enumerable:!0,get:function(){return s.ConflictType}})}(Kn)),Kn}var mt=Y_();const V_=St(mt),G_=oh({__proto__:null,default:V_},[mt]);var fe=(e=>(e.RETAIN="r",e.INSERT="i",e.DELETE="d",e))(fe||{});function vr(e,t=!1){const n=[];for(const r of e){const{st:s,ed:i,ts:o}=r;if(r.sId===void 0&&delete r.sId,s===i||!t&&re.isEmptyObject(o)&&r.sId==null)continue;if(n.length===0){n.push(r);continue}const a=n.pop();lu(r,a)&&re.hasIntersectionBetweenTwoRanges(a.st,a.ed,r.st,r.ed)?n.push({...r,st:a.st,ed:i}):n.push(a,r)}return n}function Qu(e,t,n,r){var c;const{textRuns:s}=e;if(s==null)return;const i=[],o=s.length;let a=!1;const l=(c=t.textRuns)!=null?c:[];if(l.length)for(const h of l)h.st+=r,h.ed+=r;for(let h=0;h<o;h++){const u=s[h],{st:d,ed:f}=u;if(f<=r)i.push(u);else if(r>d&&r<f){a=!0;const E={...u,ed:r};i.push(E),l.length&&i.push(...l);const R={...u,st:r+n,ed:f+n};i.push(R)}else u.st+=n,u.ed+=n,a||(a=!0,i.push(...l)),i.push(u)}a||(a=!0,i.push(...l)),e.textRuns=vr(i)}function qu(e,t,n,r){const{paragraphs:s}=e;if(s==null)return;const{paragraphs:i}=t,o=[];for(let l=0,c=s.length;l<c;l++){const h=s[l],{startIndex:u}=h;u>=r&&(h.startIndex+=n),o.push(h.startIndex)}let a=-1;if(i){for(let l=0,c=i.length;l<c;l++){const h=i[l];h.startIndex+=r;const u=h.startIndex;a=o.indexOf(u)}a!==-1&&s.splice(a,1),s.push(...i),s.sort(Rr("startIndex"))}}function Ju(e,t,n,r){const{sectionBreaks:s}=e;if(s==null)return;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=n)}const i=t.sectionBreaks;if(i){for(let o=0,a=i.length;o<a;o++){const l=i[o];l.startIndex+=r}s.push(...i),s.sort(Rr("startIndex"))}}function Zu(e,t,n,r){const{customBlocks:s=[]}=e;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=n)}const i=t.customBlocks;if(i){for(let o=0,a=i.length;o<a;o++){const l=i[o];l.startIndex+=r}s.push(...i),s.sort(Rr("startIndex"))}s.length&&!e.customBlocks&&(e.customBlocks=s)}function ec(e,t,n,r){const{tables:s}=e;if(s==null)return;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c,endIndex:h}=l;c>r?(l.startIndex+=n,l.endIndex+=n):h>r&&(l.endIndex+=n)}const i=t.tables;if(i){for(let o=0,a=i.length;o<a;o++){const l=i[o];l.startIndex+=r,l.endIndex+=r}s.push(...i),s.sort(Rr("startIndex"))}}const tc="$",Ea=e=>e.split(tc)[0];function Qi(e){if(e.length<=1)return e;e.sort((s,i)=>s.startIndex-i.startIndex);const t=[];let n={...e[0]};n.rangeId=Ea(n.rangeId);for(let s=1;s<e.length;s++){const i=e[s];i.rangeId=Ea(i.rangeId),i.rangeId===n.rangeId&&vl(n.properties,i.properties)&&n.endIndex+1>=i.startIndex?n.endIndex=i.endIndex:(t.push(n),n={...i})}t.push(n);const r=Object.create(null);for(let s=0,i=t.length;s<i;s++){const o=t[s],a=o.rangeId;r[a]?(o.rangeId=`${a}${tc}${r[a]}`,r[a]=r[a]+1):r[a]=1}return t}function di(e,t){const n=e.findIndex(s=>s.startIndex<t&&s.endIndex>=t),r=e[n];r&&e.splice(n,1,{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:r.startIndex,endIndex:t-1,properties:{...r.properties}},{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:t,endIndex:r.endIndex,properties:{...r.properties}})}function nc(e){if(e.length<=1)return e;e.sort((r,s)=>r.startIndex-s.startIndex);const t=[];let n={...e[0]};for(let r=1;r<e.length;r++){const s=e[r];s.id===n.id&&n.endIndex+1>=s.startIndex?n.endIndex=s.endIndex:(t.push(n),n={...s})}return t.push(n),t}function fi(e,t){e.filter(r=>r.startIndex<t&&r.endIndex>=t).forEach(r=>{const s=e.indexOf(r);e.splice(s,1,{id:r.id,type:r.type,startIndex:r.startIndex,endIndex:t-1},{id:r.id,type:r.type,startIndex:t,endIndex:r.endIndex})})}function K_(e,t,n,r){e.customRanges||(e.customRanges=[]);const{customRanges:s}=e;di(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=n,l.endIndex+=n)}const i=[];if(t.customRanges){for(let o=0,a=t.customRanges.length;o<a;o++){const l=t.customRanges[o];l.startIndex+=r,l.endIndex+=r,i.push(l)}s.push(...i)}e.customRanges=Qi(s)}function X_(e,t,n,r){e.customDecorations||(e.customDecorations=[]);const{customDecorations:s}=e;fi(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=n,l.endIndex+=n)}const i=[];if(t.customDecorations){for(let o=0,a=t.customDecorations.length;o<a;o++){const l=t.customDecorations[o];l.startIndex+=r,l.endIndex+=r,i.push(l)}s.push(...i)}e.customDecorations=nc(s)}function rc(e,t,n){const{textRuns:r}=e,s=n,i=n+t,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{st:u,ed:d}=h;if(s<=u&&i>=d){o.push({...h,st:u-s,ed:d-s});continue}else u<=s&&d>=i?(o.push({...h,st:s-s,ed:i-s}),h.ed-=t):s>=u&&s<d?(o.push({...h,st:s-s,ed:d-s}),h.ed=s):i>u&&i<=d?(o.push({...h,st:u-s,ed:i-s}),h.st=i-t,h.ed-=t):u>=i&&(h.st-=t,h.ed-=t);a.push(h)}e.textRuns=a}return o.length===0&&o.push({st:0,ed:t,ts:{}}),o}function sc(e,t,n){const{paragraphs:r}=e,s=n,i=n+t,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u}=h;if(u>=s&&u<i){o.push({...h,startIndex:u-n});continue}else u>=i&&(h.startIndex-=t);a.push(h)}e.paragraphs=a}return o}function ic(e,t,n){const{sectionBreaks:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u}=h;if(u>=s&&u<=i){o.push({...h,startIndex:u-n});continue}else u>i&&(h.startIndex-=t);a.push(h)}e.sectionBreaks=a}return o}function oc(e,t,n){const{customBlocks:r=[]}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u}=h;if(u>=s&&u<=i){o.push({...h,startIndex:u-n});continue}else u>i&&(h.startIndex-=t);a.push(h)}e.customBlocks=a}return r.length&&!e.customBlocks&&(e.customBlocks=r),o}function ac(e,t,n){const{tables:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u,endIndex:d}=h;if(s<=u&&i>=d){o.push({...h,startIndex:u-n,endIndex:d-n});continue}else if(u<=s&&d>=i){const f=vs(u,d,s,i);if(f.length===0||(h.startIndex=f[0],h.endIndex=f[1],h.startIndex===h.endIndex))continue}else i<u&&(h.startIndex-=t,h.endIndex-=t);a.push(h)}e.tables=a}return o}function Q_(e,t,n){const{customRanges:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u,endIndex:d}=h;if(u>=s&&d<=i){o.push(h);continue}else if(Math.max(s,u)<=Math.min(i,d)){const f=vs(u,d,s,i);if(f.length===0)continue;h.startIndex=f[0],h.endIndex=f[1]}else i<u&&(h.startIndex-=t,h.endIndex-=t);a.push(h)}e.customRanges=Qi(a)}return o}function q_(e,t,n,r=!0){const{customDecorations:s}=e,i=n,o=n+t-1,a=[];if(s){const l=[];for(let c=0,h=s.length;c<h;c++){const u=s[c],{startIndex:d,endIndex:f}=u;if(d>=i&&f<=o){a.push(u);continue}else if(Math.max(i,d)<=Math.min(o,f)){const E=vs(d,f,i,o);if(E.length===0)continue;u.startIndex=E[0],u.endIndex=E[1]}else o<d&&r&&(u.startIndex-=t,u.endIndex-=t);l.push(u)}e.customDecorations=l}return a}var lc=(e=>(e.ORDER_LIST_QUICK_1="1.",e.ORDER_LIST_QUICK_2="a)",e.ORDER_LIST_QUICK_3="a.",e.ORDER_LIST_QUICK_4="i.",e.ORDER_LIST_QUICK_5="A.",e.ORDER_LIST_QUICK_6="I.",e.ORDER_LIST_QUICK_7="01.",e))(lc||{}),Lt=(e=>(e.BULLET_LIST="BULLET_LIST",e.BULLET_LIST_1="BULLET_LIST_1",e.BULLET_LIST_2="BULLET_LIST_2",e.BULLET_LIST_3="BULLET_LIST_3",e.BULLET_LIST_4="BULLET_LIST_4",e.BULLET_LIST_5="BULLET_LIST_5",e.ORDER_LIST="ORDER_LIST",e.ORDER_LIST_1="ORDER_LIST_1",e.ORDER_LIST_2="ORDER_LIST_2",e.ORDER_LIST_3="ORDER_LIST_3",e.ORDER_LIST_4="ORDER_LIST_4",e.ORDER_LIST_5="ORDER_LIST_5",e.ORDER_LIST_QUICK_2="ORDER_LIST_QUICK_2",e.ORDER_LIST_QUICK_3="ORDER_LIST_QUICK_3",e.ORDER_LIST_QUICK_4="ORDER_LIST_QUICK_4",e.ORDER_LIST_QUICK_5="ORDER_LIST_QUICK_5",e.ORDER_LIST_QUICK_6="ORDER_LIST_QUICK_6",e.CHECK_LIST="CHECK_LIST",e.CHECK_LIST_CHECKED="CHECK_LIST_CHECKED",e))(Lt||{});const Lr={"a)":{glyphFormat:"%1)",glyphType:Ne.DECIMAL},"1.":{glyphFormat:"%1.",glyphType:Ne.DECIMAL},"a.":{glyphFormat:"%1.",glyphType:Ne.LOWER_LETTER},"A.":{glyphFormat:"%1.",glyphType:Ne.UPPER_LETTER},"i.":{glyphFormat:"%1.",glyphType:Ne.LOWER_ROMAN},"I.":{glyphFormat:"%1.",glyphType:Ne.UPPER_LETTER}},In=e=>[...e,...e,...e].map((t,n)=>({glyphFormat:` %${n+1}`,glyphSymbol:t,bulletAlignment:Ir.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*n}}})),vn=e=>e.map((t,n)=>({...t,bulletAlignment:Ir.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*n}}})),Ca=(e,t)=>new Array(9).fill(0).map((n,r)=>({glyphFormat:` %${r+1}`,glyphSymbol:e,bulletAlignment:Ir.START,textStyle:{fs:16},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*r},textStyle:t}})),yr={BULLET_LIST:{listType:"BULLET_LIST",nestingLevel:In(["●","○","■"])},BULLET_LIST_1:{listType:"BULLET_LIST",nestingLevel:In(["❖","➢","■"])},BULLET_LIST_2:{listType:"BULLET_LIST",nestingLevel:In(["✔","●","◆"])},BULLET_LIST_3:{listType:"BULLET_LIST",nestingLevel:In(["■","◆","○"])},BULLET_LIST_4:{listType:"BULLET_LIST",nestingLevel:In(["✧","○","■"])},BULLET_LIST_5:{listType:"BULLET_LIST",nestingLevel:In(["➢","○","◆"])},ORDER_LIST:{listType:"ORDER_LIST",nestingLevel:vn([{glyphFormat:"%1.",glyphType:Ne.DECIMAL},{glyphFormat:"%2.",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%3.",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Ne.DECIMAL},{glyphFormat:"%5.",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%6.",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Ne.DECIMAL},{glyphFormat:"%8.",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%9.",glyphType:Ne.LOWER_ROMAN}])},ORDER_LIST_1:{listType:"ORDER_LIST",nestingLevel:vn([{glyphFormat:"%1)",glyphType:Ne.DECIMAL},{glyphFormat:"%2)",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%3)",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%4)",glyphType:Ne.DECIMAL},{glyphFormat:"%5)",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%6)",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%7)",glyphType:Ne.DECIMAL},{glyphFormat:"%8)",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%9)",glyphType:Ne.LOWER_ROMAN}])},ORDER_LIST_2:{listType:"ORDER_LIST",nestingLevel:vn(["%1.","%1.%2.","%1.%2.%3.","%1.%2.%3.%4.","%1.%2.%3.%4.%5.","%1.%2.%3.%4.%5.%6.","%1.%2.%3.%4.%5.%6.%7."].map(e=>({glyphFormat:e,glyphType:Ne.DECIMAL})))},ORDER_LIST_3:{listType:"ORDER_LIST",nestingLevel:vn([{glyphFormat:"%1.",glyphType:Ne.UPPER_LETTER},{glyphFormat:"%2.",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%3.",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Ne.UPPER_LETTER},{glyphFormat:"%5.",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%6.",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Ne.UPPER_LETTER},{glyphFormat:"%8.",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%9.",glyphType:Ne.LOWER_ROMAN}])},ORDER_LIST_4:{listType:"ORDER_LIST",nestingLevel:vn([{glyphFormat:"%1.",glyphType:Ne.UPPER_LETTER},{glyphFormat:"%2.",glyphType:Ne.DECIMAL},{glyphFormat:"%3.",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Ne.UPPER_LETTER},{glyphFormat:"%5.",glyphType:Ne.DECIMAL},{glyphFormat:"%6.",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Ne.UPPER_LETTER},{glyphFormat:"%8.",glyphType:Ne.DECIMAL},{glyphFormat:"%9.",glyphType:Ne.LOWER_ROMAN}])},ORDER_LIST_5:{listType:"ORDER_LIST",nestingLevel:vn([{glyphFormat:"%1.",glyphType:Ne.DECIMAL_ZERO},{glyphFormat:"%2.",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%3.",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Ne.DECIMAL_ZERO},{glyphFormat:"%5.",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%6.",glyphType:Ne.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Ne.DECIMAL_ZERO},{glyphFormat:"%8.",glyphType:Ne.LOWER_LETTER},{glyphFormat:"%9.",glyphType:Ne.LOWER_ROMAN}])},CHECK_LIST:{listType:"CHECK_LIST",nestingLevel:Ca("☐")},CHECK_LIST_CHECKED:{listType:"CHECK_LIST_CHECKED",nestingLevel:Ca("☑",{st:{s:Se.TRUE}})}},Ur=e=>{const{glyphFormat:t,glyphType:n}=e,r=re.deepClone(yr.ORDER_LIST);return r.nestingLevel[0].glyphFormat=t,r.nestingLevel[0].glyphType=n,r},J_={ORDER_LIST_QUICK_2:Ur(Lr["a)"]),ORDER_LIST_QUICK_3:Ur(Lr["a."]),ORDER_LIST_QUICK_4:Ur(Lr["i."]),ORDER_LIST_QUICK_6:Ur(Lr["I."])};Object.assign(yr,J_);const Z_={"1.":"ORDER_LIST","a)":"ORDER_LIST_QUICK_2","a.":"ORDER_LIST_QUICK_3","i.":"ORDER_LIST_QUICK_4","A.":"ORDER_LIST_3","I.":"ORDER_LIST_QUICK_6","01.":"ORDER_LIST_5"};function eE(e,t,n,r,s){const i=tE(e,t,n,r,s),o=nE(e,t,n,r,s),a=rE(e,t,n,r,s),l=sE(e,t,n,r,s),c=iE(e,t,n,r,s),h=oE(e,t,n,r),u=aE(e,t,n,r,s);return{dataStream:"",textRuns:i,paragraphs:o,sectionBreaks:a,customBlocks:l,tables:c,customRanges:h,customDecorations:u}}function tE(e,t,n,r,s){const{textRuns:i}=e,{textRuns:o}=t;if(i==null||o==null)return;const a=rc(e,n,r);if(s!==Pe.REPLACE){const l=uc(o,a,s);t.textRuns=l}return Qu(e,t,n,r),a}function uc(e,t,n){if(t.length===0)return e;e=re.deepClone(e),t=re.deepClone(t);const r=[],s=e.length,i=t.length;let o=0,a=0,l=null;function c(){return l?(r.push(l),l=null,!0):!1}for(;o<s&&a<i;){const{st:f,ed:E,ts:R}=e[o],{st:O,ed:T,ts:V,sId:z}=t[a];let oe;if(n===Pe.COVER?oe={...V,...R}:oe={...R},E<O)c()||r.push(e[o]),o++;else if(T<f)c()||r.push(t[a]),a++;else{const N={st:Math.min(f,O),ed:Math.max(f,O),ts:f<O?{...R}:{...V},sId:f<O?void 0:z};N.ed>N.st&&r.push(N),r.push({st:Math.max(f,O),ed:Math.min(E,T),ts:oe,sId:z}),E<T?(o++,t[a].st=E,t[a].st===t[a].ed&&a++):(a++,e[o].st=T,e[o].st===e[o].ed&&o++);const A={st:Math.min(E,T),ed:Math.max(E,T),ts:E<T?{...V}:{...R},sId:E<T?z:void 0};l=A.ed>A.st?A:null}}c();const h=r[r.length-1],u=e[s-1],d=t[i-1];return h&&h.ed!==Math.max(u.ed,d.ed)&&(u.ed>d.ed?r.push(u):r.push(d)),vr(r)}function nE(e,t,n,r,s){const{paragraphs:i}=e,{paragraphs:o}=t;if(i==null||o==null)return;const a=sc(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const c of o){const{startIndex:h,paragraphStyle:u,bullet:d}=c;let f=[];for(const E of a){const{startIndex:R,paragraphStyle:O,bullet:T}=E;let V,z;if(s===Pe.COVER?(V={...O,...u},z={listId:"",listType:Lt.BULLET_LIST,nestingLevel:0,textStyle:{},...T,...d}):(V={...u,...O},z={listId:"",listType:Lt.BULLET_LIST,nestingLevel:0,textStyle:{},...d,...T}),h===R){f.push({startIndex:h,paragraphStyle:V,bullet:z});break}}l.push(...f),f=[]}t.paragraphs=l}return qu(e,t,n,r),a}function rE(e,t,n,r,s){const{sectionBreaks:i}=e,{sectionBreaks:o}=t;if(i==null||o==null)return;const a=ic(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const c of o){const{startIndex:h}=c;let u=[];for(const d of a){const{startIndex:f}=d;if(h===f){s===Pe.COVER?u.push({...d,...c}):u.push({...c,...d});break}}l.push(...u),u=[]}t.sectionBreaks=l}return Ju(e,t,n,r),a}function sE(e,t,n,r,s){const{customBlocks:i=[]}=e,{customBlocks:o}=t;if(i==null||o==null)return;const a=oc(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const c of o){const{startIndex:h}=c;let u=[];for(const d of a){const{startIndex:f}=d;if(h===f){s===Pe.COVER?u.push({...d,...c}):u.push({...c,...d});break}}l.push(...u),u=[]}t.customBlocks=l}return Zu(e,t,n,r),i.length&&!e.customBlocks&&(e.customBlocks=i),a}function iE(e,t,n,r,s){const{tables:i}=e,{tables:o}=t;if(i==null||o==null)return;const a=ac(e,n,r);if(s!==Pe.REPLACE){const l=[];for(const c of o){const{startIndex:h,endIndex:u}=c;let d=[];for(const f of a){const{startIndex:E,endIndex:R}=f;if(E>=h&&R<=u){s===Pe.COVER?d.push({...f,...c}):d.push({...c,...f});break}}l.push(...d),d=[]}t.tables=l}return ec(e,t,n,r),a}function oE(e,t,n,r,s){e.customRanges||(e.customRanges=[]),di(e.customRanges,r),di(e.customRanges,r+n);const i=r,o=r+n-1,{customRanges:a}=t,l=[],c=new Map;e.customRanges.forEach(u=>{const{startIndex:d,endIndex:f}=u;d>=i&&f<=o?c.set(u.rangeId,u):l.push(u)});const h=[];return a?(a.forEach(u=>{const{startIndex:d,endIndex:f}=u;l.push({...u,startIndex:d+r,endIndex:f+r})}),e.customRanges=Qi(l),h):[]}function aE(e,t,n,r,s){e.customDecorations||(e.customDecorations=[]),fi(e.customDecorations,r),fi(e.customDecorations,r+n);const i=[],{customDecorations:o}=e,{customDecorations:a=[]}=t;if(s===Pe.REPLACE){for(let l=0;l<o.length;l++){const c=o[l],{startIndex:h,endIndex:u}=c;h>=r&&u<=r+n-1&&i.push(c)}a.forEach(l=>{const{startIndex:c,endIndex:h}=l;o.push({...l,startIndex:c+r,endIndex:h+r})})}else for(const l of a){const{id:c}=l;if(l.type===fn.DELETED){const h=o.filter(u=>u.id===c);h.length&&i.push(...h)}else o.push({...l,startIndex:l.startIndex+r,endIndex:l.endIndex+r})}for(const l of i){const{id:c}=l,h=o.findIndex(u=>u.id===c);h!==-1&&o.splice(h,1)}return e.customDecorations=nc(o),i}var qi=(e=>(e[e.copy=0]="copy",e[e.cut=1]="cut",e))(qi||{});function Ht(e,t,n,r=!0,s=1){const{dataStream:i,textRuns:o,paragraphs:a=[],customBlocks:l=[],tables:c=[],sectionBreaks:h=[]}=e,u={dataStream:i.slice(t,n)};if(o){const T=[];for(const V of o){const z=re.deepClone(V),{st:oe,ed:N}=z;re.hasIntersectionBetweenTwoRanges(oe,N,t,n)&&(t>=oe&&t<=N?T.push({...z,st:t,ed:Math.min(n,N)}):n>=oe&&n<=N?T.push({...z,st:Math.max(t,oe),ed:n}):T.push(z))}u.textRuns=vr(T.map(V=>{const{st:z,ed:oe}=V;return{...V,st:z-t,ed:oe-t}}))}else r&&(u.textRuns=[{st:0,ed:n-t,ts:{}}]);const d=[];for(const T of c){const V=re.deepClone(T),{startIndex:z,endIndex:oe}=V;z>=t&&oe<=n&&d.push({...V,startIndex:z-t,endIndex:oe-t})}d.length&&(u.tables=d);const f=[];for(const T of a){const{startIndex:V}=T;V>=t&&V<n&&f.push(re.deepClone(T))}f.length&&(u.paragraphs=f.map(T=>({...T,startIndex:T.startIndex-t})));const E=[];for(const T of h){const{startIndex:V}=T;V>=t&&V<=n&&E.push(re.deepClone(T))}if(E.length&&(u.sectionBreaks=E.map(T=>({...T,startIndex:T.startIndex-t}))),s===1){const T=hc(e,t,n);T?u.customDecorations=T:r&&(u.customDecorations=[])}const{customRanges:R}=cc(e,t,n);R?u.customRanges=R:r&&(u.customRanges=[]);const O=[];for(const T of l){const{startIndex:V}=T;V>=t&&V<=n&&O.push(re.deepClone(T))}return O.length&&(u.customBlocks=O.map(T=>({...T,startIndex:T.startIndex-t}))),u}function lE(e){const{dataStream:t,textRuns:n,paragraphs:r,customRanges:s,customDecorations:i,tables:o}=e;let a=0,l=0;s==null||s.forEach(h=>{h.startIndex<0&&(a=Math.max(a,-h.startIndex)),h.endIndex>t.length-1&&(l=Math.max(l,h.endIndex-t.length+1))});const c=`${t}`;return n&&(n[0]&&(n[0].st=n[0].st-a),n[n.length-1]&&(n[n.length-1].ed=n[n.length-1].ed+l)),n==null||n.forEach(h=>{h.st+=a,h.ed+=a}),r==null||r.forEach(h=>{h.startIndex+=a}),s==null||s.forEach(h=>{h.startIndex+=a,h.endIndex+=a}),i==null||i.forEach(h=>{h.startIndex+=a,h.endIndex+=l}),o==null||o.forEach(h=>{h.startIndex+=a,h.endIndex+=l}),{...e,dataStream:c,textRuns:n,paragraphs:r,customRanges:s,customDecorations:i,tables:o}}function cc(e,t,n){if(e.customRanges==null)return{};const{customRanges:r}=e;return{customRanges:r.filter(a=>Math.max(a.startIndex,t)<=Math.min(a.endIndex,n-1)).map(a=>({...a,startIndex:Math.max(a.startIndex,t),endIndex:Math.min(a.endIndex,n-1)})).map(a=>({...a,startIndex:a.startIndex-t,endIndex:a.endIndex-t})),leftOffset:0,rightOffset:0}}function hc(e,t,n){if(e.customDecorations==null)return;const{customDecorations:r=[]}=e,s=[];return r.forEach(i=>{if(Math.max(i.startIndex,t)<=Math.min(i.endIndex,n-1)){const o=re.deepClone(i);s.push({...o,startIndex:Math.max(o.startIndex-t,0),endIndex:Math.min(o.endIndex,n-1)-t})}}),s}function uE(e,t,n){return e==null||t==null?e!=null?e:t:uc(e,t,n)}function cE(e,t,n){if(e==null||t==null)return e!=null?e:t;if(t.length===0||e.length===0)return e;if(t.length>1||e.length>1)throw new Error("Cannot cover multiple customRanges");return n===Pe.REPLACE?[{...e[0]}]:[{...t[0],...e[0]}]}function hE(e,t,n){return t.length===0||e.length===0||n===Pe.REPLACE?e:[...e,...t.filter(r=>!e.some(s=>r.id===s.id))]}function gi(e,t,n=Pe.COVER){if(t.dataStream!=="")throw new Error("Cannot compose other body with non-empty dataStream");const r={dataStream:e.dataStream},{textRuns:s,paragraphs:i=[],customRanges:o,customDecorations:a=[]}=e,{textRuns:l,paragraphs:c=[],customRanges:h,customDecorations:u=[]}=t;r.textRuns=uE(l,s,n),r.customRanges=cE(h,o,n);const d=hE(u,a,n);d.length&&(r.customDecorations=d);const f=[];let E=0,R=0;for(;E<i.length&&R<c.length;){const O=i[E],T=c[R],{startIndex:V}=O,{startIndex:z}=T;V===z?(f.push(re.deepMerge(O,T)),E++,R++):V<z?(f.push(re.deepClone(O)),E++):(f.push(re.deepClone(T)),R++)}return E<i.length&&f.push(...i.slice(E)),R<c.length&&f.push(...c.slice(R)),f.length&&(r.paragraphs=f),r}function dE(e){const{body:t}=e;if(t==null)return!0;const{textRuns:n,paragraphs:r,customRanges:s,customBlocks:i,customDecorations:o,tables:a}=t;return n==null&&r==null&&s==null&&i==null&&o==null&&a==null}class Sn{constructor(t){C(this,"_index",0);C(this,"_offset",0);this._actions=t}hasNext(){return this.peekLength()<Number.POSITIVE_INFINITY}next(t){t||(t=Number.POSITIVE_INFINITY);const n=this._actions[this._index];if(n){const r=this._offset,s=n.len;return t>=s-r?(t=s-r,this._index+=1,this._offset=0):this._offset+=t,n.t===fe.DELETE||n.t===fe.RETAIN&&n.body==null?re.deepClone({...n,len:t}):re.deepClone({...n,len:t,body:Ht(n.body,r,r+t,!1)})}else return{t:fe.RETAIN,len:Number.POSITIVE_INFINITY}}peek(){return this._actions[this._index]}peekLength(){return this._actions[this._index]?this._actions[this._index].len-this._offset:Number.POSITIVE_INFINITY}peekType(){const t=this._actions[this._index];return t?t.t:fe.RETAIN}rest(){if(this.hasNext()){if(this._offset===0)return this._actions.slice(this._index);{const t=this._offset,n=this._index,r=this.next(),s=this._actions.slice(this._index);return this._offset=t,this._index=n,[r].concat(s)}}else return[]}}class zn{constructor(){C(this,"cursor",0)}reset(){return this.cursor=0,this}moveCursor(t){this.cursor+=t}moveCursorTo(t){this.cursor=t}}function dc(e,t,n){const{dataStream:r}=e,s=n,i=n+t,o=rc(e,t,n),a=sc(e,t,n),l=ic(e,t,n),c=oc(e,t,n),h=ac(e,t,n),u=Q_(e,t,n),d=q_(e,t,n);let f="";return r&&(e.dataStream=hu(r,s,i),f=r.slice(s,i)),{dataStream:f,textRuns:o,paragraphs:a,sectionBreaks:l,customBlocks:c,tables:h,customRanges:u,customDecorations:d}}function fc(e,t,n,r){e.dataStream=cu(e.dataStream,r,t.dataStream),Qu(e,t,n,r),qu(e,t,n,r),Ju(e,t,n,r),Zu(e,t,n,r),ec(e,t,n,r),K_(e,t,n,r),X_(e,t,n,r)}function fE(e,t,n,r,s=Pe.COVER){return eE(e,t,n,r,s)}function gE(e,t,n){return t<=0?{dataStream:""}:dc(e,t,n)}function pE(e,t,n,r){n!==0&&fc(e,t,n,r)}function mE(e,t){const n=new zn;return n.reset(),t.forEach(r=>{const s=re.deepClone(r);switch(s.t){case fe.RETAIN:{const{coverType:i,body:o,len:a}=s;o!=null&&fE(e,o,a,n.cursor,i),n.moveCursor(a);break}case fe.INSERT:{const{body:i,len:o}=s;pE(e,i,o,n.cursor),n.moveCursor(o);break}case fe.DELETE:{const{len:i}=s;gE(e,i,n.cursor);break}default:throw new Error(`Unknown action type for action: ${s}.`)}}),e}function _E(e,t,n,r,s){if(e==null||t==null)return t;if(e.length===0||t.length===0)return[];t=re.deepClone(t),e=re.deepClone(e);const i=[],o=t.length,a=e.length;let l=0,c=0,h=null;function u(){return h?(i.push(h),h=null,!0):!1}for(;l<o&&c<a;){const{st:R,ed:O,ts:T}=t[l],{st:V,ed:z,ts:oe,sId:N}=e[c];let A={};if(s===0)A={...T},n===Pe.COVER&&r===Pe.REPLACE&&oe&&(A=Object.assign({},oe,A));else if(A={...T},n===Pe.REPLACE){if(r===Pe.REPLACE)A={...oe};else if(T&&oe){const H=Object.keys(T);for(const J of H)oe[J]&&delete A[J]}}else if(r===Pe.REPLACE){if(oe){const H=Object.keys(oe);for(const J of H)oe[J]!==void 0&&(A[J]=oe[J])}}else if(oe){const H=Object.keys(oe);for(const J of H)A[J]!==void 0&&delete A[J]}if(O<V)u()||i.push(t[l]),l++;else if(z<R)u()||i.push(e[c]),c++;else{const H={st:Math.min(R,V),ed:Math.max(R,V),ts:R<V?{...T}:{...oe},sId:R<V?void 0:N};H.ed>H.st&&i.push(),i.push({st:Math.max(R,V),ed:Math.min(O,z),ts:A,sId:N}),O<z?(l++,e[c].st=O,e[c].st===e[c].ed&&c++):(c++,t[l].st=z,t[l].st===t[l].ed&&l++);const J={st:Math.min(O,z),ed:Math.max(O,z),ts:O<z?{...oe}:{...T},sId:O<z?N:void 0};h=J.ed>J.st?J:null}}u();const d=i[i.length-1],f=t[o-1],E=e[a-1];return d.ed!==Math.max(f.ed,E.ed)&&(f.ed>E.ed?i.push(f):i.push(E)),vr(i,!0)}function EE(e,t,n,r,s){if(e==null||t==null)return t;if(e.length===0||t.length===0)return[];if(e.length>1||t.length>1)throw new Error("CustomRanges is only supported transform for length one now.");const i=e[0],o=t[0];if(n===Pe.REPLACE)return s===1?[re.deepClone(i)]:[re.deepClone(o)];if(r===Pe.REPLACE){const a=re.deepClone(o);return s===1&&Object.assign(a,re.deepClone(i)),[a]}else{const a=re.deepClone(o);return s===1&&Object.assign(a,re.deepClone(i)),[a]}}function Ra(e,t,n,r,s){const i={startIndex:t.startIndex};if(t.paragraphStyle&&(i.paragraphStyle=re.deepClone(t.paragraphStyle),e.paragraphStyle)){if(n===Pe.REPLACE)if(r===Pe.REPLACE)s===1&&(i.paragraphStyle={...e.paragraphStyle});else if(s===1){const o=Object.keys(e.paragraphStyle);for(const a of o)e.paragraphStyle[a]!==void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else{const o=Object.keys(e.paragraphStyle);for(const a of o)i.paragraphStyle[a]===void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else if(r===Pe.REPLACE)if(s===1){const o=Object.keys(e.paragraphStyle);for(const a of o)e.paragraphStyle[a]!==void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else{const o=Object.keys(e.paragraphStyle);for(const a of o)i.paragraphStyle[a]===void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else if(s===1){const o=Object.keys(e.paragraphStyle);for(const a of o)i.paragraphStyle[a]&&delete i.paragraphStyle[a]}}return n===Pe.REPLACE&&r===Pe.REPLACE?i.bullet=s===1?re.deepClone(e.bullet):re.deepClone(t.bullet):e.bullet===void 0?i.bullet=re.deepClone(t.bullet):n===Pe.REPLACE||r===Pe.REPLACE?i.bullet=s===0&&t.bullet?re.deepClone(t.bullet):re.deepClone(e.bullet):s===0&&t.bullet!==void 0&&(i.bullet=re.deepClone(t.bullet)),i}function CE(e,t){if(e==null||t==null)return t;if(e.length===0||t.length===0)return re.deepClone(t);const n=[];for(const r of t){const{id:s,type:i}=r;let o=!1;for(const a of e)if(a.id===s){(a.type===fn.DELETED||i===fn.DELETED)&&(o=!0,n.push({...r,type:fn.DELETED}));break}o||n.push(r)}return n}function RE(e,t,n=!1){const{body:r,coverType:s=Pe.COVER}=e,{body:i,coverType:o=Pe.COVER}=t;if(r==null||r.dataStream!==""||i==null||i.dataStream!=="")throw new Error("Data stream is not supported in retain transform.");const a={dataStream:""},l=o,{textRuns:c,paragraphs:h=[],customRanges:u,customDecorations:d}=r,{textRuns:f,paragraphs:E=[],customRanges:R,customDecorations:O}=i,T=_E(c,f,s,o,n?1:0);T&&(a.textRuns=T);const V=EE(u,R,s,o,n?1:0);V&&(a.customRanges=V);const z=CE(d,O);z&&(a.customDecorations=z);const oe=[];let N=0,A=0;for(;N<h.length&&A<E.length;){const H=h[N],J=E[A],{startIndex:de}=H,{startIndex:le}=J;if(de===le){let m={startIndex:de};n?m=Ra(H,J,s,o,1):m=Ra(H,J,s,o,0),oe.push(m),N++,A++}else de<le?N++:(oe.push(re.deepClone(J)),A++)}return A<E.length&&oe.push(...E.slice(A)),oe.length&&(a.paragraphs=oe),{coverType:l,body:a}}function Ia(e){return Object.keys(e).length===1}const Nn=class Nn{constructor(){C(this,"_actions",[])}static apply(t,n){return mE(t,n)}static compose(t,n){const r=new Sn(t),s=new Sn(n),i=new Nn;for(;r.hasNext()||s.hasNext();)if(s.peekType()===fe.INSERT)i.push(s.next());else if(r.peekType()===fe.DELETE)i.push(r.next());else{const o=Math.min(r.peekLength(),s.peekLength()),a=r.next(o),l=s.next(o);if(a.t===fe.INSERT&&l.t===fe.RETAIN)l.body==null?i.push(a):i.push({...a,body:gi(a.body,l.body,l.coverType)});else if(a.t===fe.RETAIN&&l.t===fe.RETAIN)if(a.body==null&&l.body==null)i.push(a.len!==Number.POSITIVE_INFINITY?a:l);else if(a.body&&l.body){const c=a.coverType===Pe.REPLACE||l.coverType===Pe.REPLACE?Pe.REPLACE:Pe.COVER;i.push({...a,t:fe.RETAIN,coverType:c,body:gi(a.body,l.body,l.coverType)})}else i.push(a.body?a:l);else a.t===fe.RETAIN&&l.t===fe.DELETE?i.push(l):a.t===fe.INSERT&&(l.t,fe.DELETE)}return i.trimEndUselessRetainAction(),i.serialize()}static transform(t,n,r="right"){return this._transform(n,t,r==="left"?"right":"left")}static _transform(t,n,r="right"){const s=new Sn(t),i=new Sn(n),o=new Nn;for(;s.hasNext()||i.hasNext();)if(s.peekType()===fe.INSERT&&(r==="left"||i.peekType()!==fe.INSERT)){const a=s.next();o.retain(a.len)}else if(i.peekType()===fe.INSERT)o.push(i.next());else{const a=Math.min(s.peekLength(),i.peekLength()),l=s.next(a),c=i.next(a);if(l.t===fe.DELETE)continue;if(c.t===fe.DELETE){o.push(c);continue}if(l.body==null||c.body==null)o.push(c);else{const{coverType:h,body:u}=RE(l,c,r==="left");o.push({...c,t:fe.RETAIN,coverType:h,body:u})}}return o.trimEndUselessRetainAction(),o.serialize()}static transformPosition(t,n,r=!1){const s=new Sn(t);let i=0;for(;s.hasNext()&&i<=n;){const o=s.peekLength(),a=s.peekType();if(s.next(),a===fe.DELETE){n-=Math.min(o,n-i);continue}else a===fe.INSERT&&(i<n||!r)&&(n+=o);i+=o}return n}static isNoop(t){return t.length===0}static invert(t){const n=[];for(const r of t)if(r.t===fe.INSERT)n.push({t:fe.DELETE,len:r.len,body:r.body});else if(r.t===fe.DELETE){if(r.body==null)throw new Error("Can not invert DELETE action without body property, makeInvertible must be called first.");n.push({t:fe.INSERT,body:r.body,len:r.len})}else if(r.body!=null){if(r.oldBody==null)throw new Error("Can not invert RETAIN action without oldBody property, makeInvertible must be called first.");n.push({t:fe.RETAIN,body:r.oldBody,oldBody:r.body,len:r.len,coverType:Pe.REPLACE})}else n.push(r);return n}static makeInvertible(t,n){const r=[];let s=0;for(const i of t){if(i.t===fe.DELETE&&(i.body==null||i.body&&i.body.dataStream.length!==i.len)){const o=Ht(n,s,s+i.len,!1);i.len=o.dataStream.length,i.body=o}if(i.t===fe.RETAIN&&i.body!=null){const o=Ht(n,s,s+i.len,!0);i.oldBody={...o,dataStream:""},i.len=o.dataStream.length}r.push(i),i.t!==fe.INSERT&&(s+=i.len)}return r}insert(t,n){const r={t:fe.INSERT,body:n,len:t};return this.push(r),this}retain(t,n,r){const s={t:fe.RETAIN,len:t};return n!=null&&(s.body=n),r!=null&&(s.coverType=r),this.push(s),this}delete(t){const n={t:fe.DELETE,len:t};return this.push(n),this}empty(){return this._actions=[],this}serialize(){return this._actions}push(...t){if(t.length>1){for(const i of t)this.push(i);return this}let n=this._actions.length,r=this._actions[n-1];const s=re.deepClone(t[0]);if(s.t===fe.RETAIN&&s.len===0&&s.body==null)return this;if(typeof r=="object"){if(r.t===fe.DELETE&&s.t===fe.DELETE)return r.len+=s.len,this;if(r.t===fe.DELETE&&s.t===fe.INSERT&&(n-=1,r=this._actions[n-1],r==null))return this._actions.unshift(s),this;if(r.t===fe.RETAIN&&s.t===fe.RETAIN&&r.body==null&&s.body==null)return r.len+=s.len,this;if(r.t===fe.INSERT&&Ia(r.body)&&s.t===fe.INSERT&&Ia(s.body))return r.len+=s.len,r.body.dataStream+=s.body.dataStream,this}return n===this._actions.length?this._actions.push(s):this._actions.splice(n,0,s),this}trimEndUselessRetainAction(){let t=this._actions[this._actions.length-1];for(;t&&t.t===fe.RETAIN&&dE(t);)this._actions.pop(),t=this._actions[this._actions.length-1];return this}};C(Nn,"id","text-x"),C(Nn,"uri","https://github.com/dream-num/univer#text-x");let Ke=Nn;Object.defineProperty(Ke,"name",{value:"text-x"});const Mn=class Mn{static registerSubtype(t){var n;t==null||this._subTypes.has(t.name)&&((n=this._subTypes.get(t.name))==null?void 0:n.id)!==Ke.id||(this._subTypes.set(t.name,t),mt.type.registerSubtype(t))}static apply(t,n){if(!mt.type.isNoop(n))return mt.type.apply(t,n)}static compose(t,n){return mt.type.compose(t,n)}static transform(t,n,r){return mt.type.transform(t,n,r)}static transformPosition(t,n,r="right"){return t&&t.length===2&&t[0]==="body"&&t[1].et===Ke.name?Ke.transformPosition(t[1].e,n,r==="left"):n}static invertWithDoc(t,n){return mt.type.invertWithDoc(t,n)}static isNoop(t){return mt.type.isNoop(t)}static getInstance(){return this._instance==null&&(this._instance=new Mn),this._instance}removeOp(t,n){return mt.removeOp(t,n)}moveOp(t,n){return mt.moveOp(t,n)}insertOp(t,n){return mt.insertOp(t,n)}replaceOp(t,n,r){return mt.replaceOp(t,n,r)}editOp(t,n=["body"]){return mt.editOp(n,Ke.name,t)}};C(Mn,"uri","https://github.com/dream-num/univer#json-x"),C(Mn,"_subTypes",new Map),C(Mn,"_instance",null);let Vt=Mn;Vt.registerSubtype(Ke);const Ji={id:"default_doc",documentStyle:{}};class IE extends ys{constructor(n){var r;super();C(this,"type",$e.UNIVER_DOC);C(this,"_name$",new Oe.BehaviorSubject(""));C(this,"name$",this._name$.asObservable());C(this,"snapshot");this.snapshot={...Ji,...n},this._name$.next((r=this.snapshot.title)!=null?r:"No Title")}getUnitId(){throw new Error("Method not implemented.")}getRev(){var n;return(n=this.snapshot.rev)!=null?n:1}incrementRev(){this.snapshot.rev=this.getRev()+1}setRev(n){this.snapshot.rev=n}setName(n){this.snapshot.title=n,this._name$.next(n)}get drawings(){return this.snapshot.drawings}get documentStyle(){return this.snapshot.documentStyle}get lists(){return this.snapshot.lists}get zoomRatio(){var n;return((n=this.snapshot.settings)==null?void 0:n.zoomRatio)||1}resetDrawing(n,r){this.snapshot.drawings=n,this.snapshot.drawingsOrder=r}getBody(){return this.snapshot.body}getSnapshot(){return this.snapshot}getBulletPresetList(){var s;const n=(s=this.snapshot.lists)!=null?s:{};return{...yr,...n}}updateDocumentId(n){this.snapshot.id=n}updateDocumentRenderConfig(n){const{documentStyle:r}=this.snapshot;r.renderConfig==null?r.renderConfig=n:r.renderConfig={...r.renderConfig,...n}}updateDocumentStyle(n){this.snapshot.documentStyle==null?this.snapshot.documentStyle=n:this.snapshot.documentStyle={...this.snapshot.documentStyle,...n}}updateDocumentDataMargin(n){const{t:r,l:s,b:i,r:o}=n,{documentStyle:a}=this.snapshot;r!=null&&(a.marginTop=r),s!=null&&(a.marginLeft=s),i!=null&&(a.marginBottom=i),o!=null&&(a.marginRight=o)}updateDocumentDataPageSize(n,r){const{documentStyle:s}=this.snapshot;if(!s.pageSize){n=n!=null?n:Number.POSITIVE_INFINITY,r=r!=null?r:Number.POSITIVE_INFINITY,s.pageSize={width:n,height:r};return}n!==void 0&&(s.pageSize.width=n),r!==void 0&&(s.pageSize.height=r)}updateDrawing(n,r){const{drawings:s}=this,{width:i,height:o,left:a,top:l}=r,c=s==null?void 0:s[n];if(!c)return;const h=c.docTransform;h.size.width=i,h.size.height=o,h.positionH.posOffset=a,h.positionV.posOffset=l}setZoomRatio(n=1){this.snapshot.settings==null?this.snapshot.settings={zoomRatio:n}:this.snapshot.settings.zoomRatio=1}}class Pt extends IE{constructor(n){var s,i;super(re.isEmptyObject(n)?$_():n);C(this,"_unitId");C(this,"headerModelMap",new Map);C(this,"footerModelMap",new Map);const r=6;this._unitId=(s=this.snapshot.id)!=null?s:re.generateRandomId(r),this._initializeHeaderFooterModel(),this._name$.next((i=this.snapshot.title)!=null?i:"")}dispose(){super.dispose(),this.headerModelMap.forEach(n=>{n.dispose()}),this.footerModelMap.forEach(n=>{n.dispose()}),this._name$.complete()}getDrawings(){return this.snapshot.drawings}getDrawingsOrder(){return this.snapshot.drawingsOrder}getCustomRanges(){var n;return(n=this.snapshot.body)==null?void 0:n.customRanges}getCustomDecorations(){var n;return(n=this.snapshot.body)==null?void 0:n.customDecorations}getSettings(){return this.snapshot.settings}reset(n){if(n.id&&n.id!==this._unitId)throw new Error("Cannot reset a document model with a different unit id!");this.snapshot={...Ji,...n},this._initializeHeaderFooterModel()}getSelfOrHeaderFooterModel(n){if(n!=null){if(this.headerModelMap.has(n))return this.headerModelMap.get(n);if(this.footerModelMap.has(n))return this.footerModelMap.get(n)}return this}getUnitId(){return this._unitId}apply(n){if(!Vt.isNoop(n))return this.snapshot=Vt.apply(this.snapshot,n),n!=null&&n.some(r=>Array.isArray(r)&&((r==null?void 0:r[0])==="headers"||(r==null?void 0:r[0])==="footers"))&&(this.headerModelMap.clear(),this.footerModelMap.clear(),this._initializeHeaderFooterModel()),this.snapshot}sliceBody(n,r,s=qi.copy){const i=this.getBody();if(i!=null)return Ht(i,n,r,!1,s)}_initializeHeaderFooterModel(){const{headers:n,footers:r}=this.getSnapshot();if(n)for(const s in n){const i=n[s];this.headerModelMap.set(s,new Pt(i)),this.headerModelMap.get(s).updateDocumentId(this.getUnitId())}if(r)for(const s in r){const i=r[s];this.footerModelMap.set(s,new Pt(i)),this.footerModelMap.get(s).updateDocumentId(this.getUnitId())}}updateDocumentId(n){super.updateDocumentId(n),this._unitId=n}}function vE(e){const{ranges:t,id:n,type:r}=e,s=new Ke;let i=0;for(let o=0;o<t.length;o++){const a=t[o],{startOffset:l,endOffset:c}=a;l>0&&s.push({t:fe.RETAIN,len:l-i}),s.push({t:fe.RETAIN,body:{dataStream:"",customDecorations:[{id:n,type:r,startIndex:0,endIndex:c-l-1}]},len:c-l}),i=c}return s}function yE(e){var h,u,d;const{id:t,segmentId:n,documentDataModel:r}=e,s=r==null?void 0:r.getBody();if(!r||!s)return!1;const i=(d=(u=(h=r.getSelfOrHeaderFooterModel(n))==null?void 0:h.getBody())==null?void 0:u.customDecorations)==null?void 0:d.find(f=>f.id===t);if(!i)return!1;const o=new Ke,{startIndex:a,endIndex:l}=i,c=l-a+1;return o.push({t:fe.RETAIN,len:a}),o.push({t:fe.RETAIN,len:c,body:{dataStream:"",customDecorations:[{startIndex:0,endIndex:c-1,id:t,type:fn.DELETED}]}}),o}function gc(e,t,n,r){return e<=n&&t>=n||e>=n&&e<=r}function SE(e,t){const n=[];for(let r=0,s=t.length;r<s;r++){const i=t[r];e.collapsed?i.startIndex<e.startOffset&&e.startOffset<=i.endIndex&&n.push(i):gc(e.startOffset,e.endOffset-1,i.startIndex,i.endIndex)&&n.push(i)}return n}function OE(e){return{...re.deepClone(e),rangeId:zt()}}function bE(e,t){const n=[];let r=e[0];for(const s of t)s<e[0]||s>e[1]||(r<s&&n.push([r,s-1]),r=s+1);return r<=e[1]&&n.push([r,e[1]]),n}function pc(e,t,n,r){const s=[];for(let i=0,o=n.length;i<o;i++){const a=n[i];if((r===void 0||a.rangeType===r)&&Math.max(a.startIndex,e)<=Math.min(a.endIndex,t)&&s.push({...a}),a.startIndex>t)break}return s}function wE(e,t){var i,o,a,l,c;const n=pc(e.startOffset,e.collapsed?e.startOffset:e.endOffset-1,(i=t.customRanges)!=null?i:[]),r=Math.min(e.startOffset,(a=(o=n[0])==null?void 0:o.startIndex)!=null?a:1/0),s=Math.max(e.endOffset,((c=(l=n[n.length-1])==null?void 0:l.endIndex)!=null?c:-1/0)+1);return{startOffset:r,endOffset:s,collapsed:r===s}}function AE(e){var u,d,f;const{rangeId:t,segmentId:n,documentDataModel:r,insert:s}=e,i=(d=(u=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:u.customRanges)==null?void 0:d.find(E=>E.rangeId===t);if(!i)return!1;const{startIndex:o,endIndex:a}=i,l=new Ke,c=a-o+1;l.push({t:fe.RETAIN,len:o}),l.push({t:fe.RETAIN,len:c,body:{dataStream:"",customRanges:[]}}),s&&l.push({t:fe.INSERT,body:s,len:s.dataStream.length});const h=a+1+((f=s==null?void 0:s.dataStream.length)!=null?f:0);return l.selections=[{startOffset:h,endOffset:h,collapsed:!0}],l}function TE(e){const{ranges:t,rangeId:n,rangeType:r,wholeEntity:s,properties:i,body:o}=e;let a=0;const l=new Ke;let c=!1;return t.forEach(h=>{var z,oe,N;const u=wE(h,o);if(!u||!o)return!1;const{startOffset:d,endOffset:f}=u,E=(z=o.customRanges)!=null?z:[],R=(A,H,J)=>{var y,D,b,S;const de=pc(A,H,E,r),le=Math.min((D=(y=de[0])==null?void 0:y.startIndex)!=null?D:1/0,A),m=Math.max((S=(b=de[de.length-1])==null?void 0:b.endIndex)!=null?S:-1/0,H),j={rangeId:J?`${n}$${J}`:n,rangeType:r,startIndex:0,endIndex:m-le,wholeEntity:s,properties:{...i}};l.push({t:fe.RETAIN,len:le-a}),l.push({t:fe.RETAIN,len:m-le+1,body:{dataStream:"",customRanges:[j]},coverType:Pe.COVER}),a=m+1},O=((oe=o.paragraphs)!=null?oe:[]).filter(A=>A.startIndex<f&&A.startIndex>d),T=((N=o.customBlocks)!=null?N:[]).filter(A=>A.startIndex<f&&A.startIndex>d);bE([d,f-1],[...O.map(A=>A.startIndex),...T.map(A=>A.startIndex)]).forEach(([A,H],J)=>R(A,H,J)),c=!0,l.selections=[{startOffset:u.endOffset,endOffset:u.endOffset,collapsed:!0}]}),c?l:!1}function mc(e,t,n=0,r=null,s=!0){e.sort((c,h)=>c.startOffset-h.startOffset);const i=[],{paragraphs:o=[]}=t,a=o==null?void 0:o.find(c=>c.startIndex>=e[0].startOffset&&c.startIndex<e[0].endOffset);let l=n;if(e.forEach(c=>{const{startOffset:h,endOffset:u}=c;h>l&&(i.push({t:fe.RETAIN,len:h-l}),l=h),l<u&&(i.push({t:fe.DELETE,len:u-l}),l=u)}),r&&i.push({t:fe.INSERT,body:r,len:r.dataStream.length}),a&&s){const c=o.find(h=>h.startIndex-n>=e[e.length-1].endOffset-1);c&&(c.startIndex>l&&(i.push({t:fe.RETAIN,len:c.startIndex-l}),l=c.startIndex),i.push({t:fe.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...c,startIndex:0,bullet:a==null?void 0:a.bullet}]},coverType:Pe.REPLACE}))}return i}function NE(e,t,n=0){const r=[];let s=n;return e.forEach(i=>{const{startOffset:o,endOffset:a}=i;o>s&&(r.push({t:fe.RETAIN,len:o-s}),s=o),a>s&&(r.push({t:fe.RETAIN,len:a-s,body:{...re.deepClone(t),dataStream:""}}),s=a)}),r}const ME=e=>{var u;const{selection:t,body:n,doc:r}=e,s=t.segmentId,i=(u=r.getSelfOrHeaderFooterModel(s))==null?void 0:u.getBody();if(!i)return!1;const o=t.collapsed?null:Ht(i,t.startOffset,t.endOffset),a=nl(o?o.dataStream:"",n.dataStream);let l=0;const c=a.map(([d,f])=>{switch(d){case 0:{const E={t:fe.RETAIN,body:{...Ht(n,l,l+f.length,!1),dataStream:""},len:f.length};return l+=f.length,E}case 1:{const E={t:fe.INSERT,body:Ht(n,l,l+f.length),len:f.length};return l+=f.length,E}default:return{t:fe.DELETE,len:f.length}}}),h=new Ke;return h.push({t:fe.RETAIN,len:t.startOffset}),h.push(...c),h};function DE(e,t){const n=[],{customBlocks:r=[]}=e;for(const s of t){const{startOffset:i,endOffset:o}=s;if(!(i==null||o==null))for(const a of r){const{startIndex:l}=a;l>=i&&l<o&&n.push(a.blockId)}}return n}function xE(e,t=""){if(!t)return["body"];const{headers:n,footers:r}=e.getSnapshot();if(n==null&&r==null)throw new Error("Document data model must have headers or footers when update by segment id");if((n==null?void 0:n[t])!=null)return["headers",t,"body"];if((r==null?void 0:r[t])!=null)return["footers",t,"body"];throw new Error("Segment id not found in headers or footers")}const LE=e=>{var R,O,T,V;const{selection:t,documentDataModel:n,drawings:r}=e,{collapsed:s,startOffset:i,segmentId:o}=t,a=new Ke,l=Vt.getInstance(),c=[],h=n.getSelfOrHeaderFooterModel(o).getBody();if(!h)return!1;const u=(O=(R=n.getSnapshot().drawingsOrder)==null?void 0:R.length)!=null?O:0;let d=0;if(s)i>0&&a.push({t:fe.RETAIN,len:i});else{const z=mc([t],h,0,null,!1);a.push(...z);const oe=DE(h,[t]),N=(T=n.getDrawings())!=null?T:{},A=(V=n.getDrawingsOrder())!=null?V:[],H=oe.sort((J,de)=>A.indexOf(J)>A.indexOf(de)?-1:A.indexOf(J)<A.indexOf(de)?1:0);if(H.length>0)for(const J of H){const de=N[J],le=A.indexOf(J);if(de==null||le<0)continue;const m=l.removeOp(["drawings",J],de),j=l.removeOp(["drawingsOrder",le],J);c.push(m),c.push(j),d++}}a.push({t:fe.INSERT,body:{dataStream:"\b".repeat(r.length),customBlocks:r.map((z,oe)=>({startIndex:oe,blockId:z.drawingId}))},len:r.length});const f=xE(n,o),E=l.editOp(a.serialize(),f);c.push(E);for(const z of r){const{drawingId:oe}=z,N=l.insertOp(["drawings",oe],z),A=l.insertOp(["drawingsOrder",u-d],oe);c.push(N),c.push(A)}return c.reduce((z,oe)=>Vt.compose(z,oe),null)},UE=e=>{var u,d,f;const{paragraphs:t,segmentId:n,document:r}=e;let s=e.listType;const i=(d=(u=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:u.paragraphs)!=null?d:[],o=t.every(E=>{var R;return((R=E.bullet)==null?void 0:R.listType.indexOf(s))===0});let l=re.generateRandomId(6);if(t.length===1){const E=i.indexOf(t[0]),R=i[E-1],O=i[E+1];R&&R.bullet&&R.bullet.listType.indexOf(s)===0?(l=R.bullet.listId,s!==Lt.CHECK_LIST&&(s=R.bullet.listType)):O&&O.bullet&&O.bullet.listType.indexOf(s)===0&&(l=O.bullet.listId,s!==Lt.CHECK_LIST&&(s=O.bullet.listType))}const c=new zn;c.reset();const h=new Ke;for(const E of t){const{startIndex:R,paragraphStyle:O={},bullet:T}=E;h.push({t:fe.RETAIN,len:R-c.cursor}),h.push({t:fe.RETAIN,len:1,body:{dataStream:"",paragraphs:[o?{paragraphStyle:O,startIndex:0}:{startIndex:0,paragraphStyle:{...O},bullet:{nestingLevel:(f=T==null?void 0:T.nestingLevel)!=null?f:0,textStyle:{fs:20},listType:s,listId:l}}]},coverType:Pe.REPLACE}),c.moveCursorTo(R+1)}return h},PE=e=>{var u;const{paragraphIndex:t,segmentId:n,document:r}=e,s=(u=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:u.paragraphs;if(s==null)return!1;const i=s.find(d=>d.startIndex===t);if(!(i!=null&&i.bullet)||i.bullet.listType.indexOf(Lt.CHECK_LIST)===-1)return!1;const o=new zn;o.reset();const a=new Ke,{startIndex:l,paragraphStyle:c={}}=i,h=i.bullet.listType===Lt.CHECK_LIST?Lt.CHECK_LIST_CHECKED:Lt.CHECK_LIST;return a.push({t:fe.RETAIN,len:l-o.cursor}),a.push({t:fe.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...i,paragraphStyle:c,startIndex:0,bullet:{...i.bullet,listType:h}}]},coverType:Pe.REPLACE}),o.moveCursorTo(l+1),a},FE=e=>{var h,u;const{paragraphs:t,listType:n,segmentId:r,document:s}=e;if(((h=s.getSelfOrHeaderFooterModel(r).getBody())==null?void 0:h.paragraphs)==null)return!1;const a=re.generateRandomId(6),l=new zn;l.reset();const c=new Ke;for(const d of t){const{startIndex:f,paragraphStyle:E={},bullet:R}=d;c.push({t:fe.RETAIN,len:f-l.cursor}),c.push({t:fe.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:E,bullet:{nestingLevel:(u=R==null?void 0:R.nestingLevel)!=null?u:0,textStyle:(R==null?void 0:R.listType)===n?R.textStyle:{fs:20},listType:n,listId:a}}]},coverType:Pe.REPLACE}),l.moveCursorTo(f+1)}return c};function kE(e,t){return t.some(n=>e.startIndex>n.startIndex&&e.startIndex<n.endIndex)}const $E=e=>{var h,u,d;const{paragraphs:t,segmentId:n,document:r,type:s}=e,i=new zn;i.reset();const o=new Ke,a=(h=r.getSnapshot().lists)!=null?h:{},l=(d=(u=r.getBody())==null?void 0:u.tables)!=null?d:[],c={...yr,...a};for(const f of t){const{startIndex:E,paragraphStyle:R={},bullet:O}=f,T=kE(f,l);if(o.push({t:fe.RETAIN,len:E-i.cursor}),O){const V=O.listType;let z=c[V].nestingLevel.length-1;T&&(z=Math.min(z,2)),o.push({t:fe.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:{...R},bullet:{...O,nestingLevel:Math.max(Math.min(O.nestingLevel+s,z),0)}}]},coverType:Pe.REPLACE})}else o.push({t:fe.RETAIN,len:1});i.moveCursorTo(E+1)}return o};var _c=(e=>(e.PARAGRAPH="PARAGRAPH",e.SECTION_BREAK="SECTION_BREAK",e.TABLE="TABLE",e.TABLE_ROW="TABLE_ROW",e.TABLE_CELL="TABLE_CELL",e.CUSTOM_BLOCK="CUSTOM_BLOCK",e))(_c||{}),Jt=(e=>(e.PARAGRAPH="\r",e.SECTION_BREAK=`
|
|
9
|
+
`,e.TABLE_START="",e.TABLE_ROW_START="\x1B",e.TABLE_CELL_START="",e.TABLE_CELL_END="",e.TABLE_ROW_END="",e.TABLE_END="",e.CUSTOM_RANGE_START="",e.CUSTOM_RANGE_END="",e.COLUMN_BREAK="\v",e.PAGE_BREAK="\f",e.DOCS_END="\0",e.TAB=" ",e.CUSTOM_BLOCK="\b",e.LETTER="",e.SPACE=" ",e))(Jt||{});function BE(e){return`${e}`}const jE=[Jt.TABLE_START,Jt.TABLE_ROW_START,Jt.TABLE_CELL_START,Jt.TABLE_CELL_END,Jt.TABLE_ROW_END,Jt.TABLE_END],Ec=e=>{const t=e.endsWith(`\r
|
|
10
|
+
`)?e.slice(0,-2):e;return jE.reduce((n,r)=>n.replaceAll(r,""),t)},HE=e=>e?Ec(e).replaceAll("\r","")==="":!0,WE=e=>{const t=e.replace(/\n/g,"\r"),n=[],r=[];let s=0,i="";const o=(l,c=!0)=>{const h=t.slice(s,l);if(re.isLegalUrl(h)){const u=zt(),d=`${h}`,f={startIndex:s,endIndex:s+d.length-1,rangeId:u,rangeType:on.HYPERLINK,properties:{url:e}};r.push(f),i+=d,s=l+1,c&&(i+="\r",n.push({startIndex:l}))}else i+=t.slice(s,l+1),s=l+1,c&&n.push({startIndex:l})};let a=0;for(let l=0;l<t.length;l++)t[l]==="\r"&&(o(l),a=l);return(a!==t.length-1||t.length===1)&&o(t.length,!1),{dataStream:i,paragraphs:n,customRanges:r}};function zE(e,t){if(typeof t>"u")return{startOffset:e,endOffset:e,collapsed:!0};if(t<e)throw new Error(`Cannot make a doc selection when endOffset ${t} is less than startOffset ${e}.`);return{startOffset:e,endOffset:t,collapsed:e===t}}function YE(e){const{startOffset:t,endOffset:n,collapsed:r}=e,s=Math.min(t,n),i=Math.max(t,n);return{startOffset:s,endOffset:i,collapsed:r}}function VE(e,t,n,r){return Math.max(e,n)<=Math.min(t,r)}class st{}C(st,"customRange",{add:TE,delete:AE,copyCustomRange:OE,getCustomRangesInterestsWithSelection:SE,isIntersecting:gc}),C(st,"customDecoration",{add:vE,delete:yE}),C(st,"selection",{replace:ME,makeSelection:zE,normalizeSelection:YE,delete:mc,retain:NE}),C(st,"range",{isIntersects:VE}),C(st,"transform",{getPlainText:Ec,fromPlainText:WE,isEmptyDocument:HE}),C(st,"paragraph",{bullet:{set:FE,switch:UE,toggleChecklist:PE,changeNestLevel:$E}}),C(st,"drawing",{add:LE});class Yn{constructor(t={}){C(this,"_style");this._style=t}static create(t={}){return new Yn(t)}get fontFamily(){return this._style.ff}get fontSize(){return this._style.fs}get italic(){return this._style.it===Se.TRUE}get bold(){return this._style.bl===Se.TRUE}get underline(){return this._style.ul&&Bt.create(this._style.ul)}get bottomBorderLine(){return this._style.bbl&&Bt.create(this._style.bbl)}get strikethrough(){return this._style.st&&Bt.create(this._style.st)}get overline(){return this._style.ol&&Bt.create(this._style.ol)}get background(){return this._style.bg}get border(){return this._style.bd}get color(){return this._style.cl}get verticalAlign(){return this._style.va}get numberFormat(){return this._style.n}copy(){return Wt.create(re.deepClone(this._style))}getValue(){return{...this._style}}}class Wt extends Yn{static create(t={}){return new Wt(t)}constructor(t={}){super(t)}setFontFamily(t){return this._style.ff=t,this}setFontSize(t){return this._style.fs=t,this}setItalic(t){return this._style.it=t?1:0,this}setBold(t){return this._style.bl=t?1:0,this}setUnderline(t){return this._style.ul=t.build(),this}setBottomBorderLine(t){return this._style.bbl=t.build(),this}setStrikethrough(t){return this._style.st=t.build(),this}setOverline(t){return this._style.ol=t.build(),this}setBackground(t){return this._style.bg=t,this}setBorder(t){return this._style.bd=t,this}setColor(t){return this._style.cl=t,this}setVerticalAlign(t){return this._style.va=t,this}copy(){return Wt.create(re.deepClone(this._style))}build(){return this.getValue()}}class Bt{constructor(t={s:1}){C(this,"_decoration");this._decoration=t}static create(t={s:1}){return new Bt(t)}get show(){return this._decoration.s===Se.TRUE}get followFontColor(){return this._decoration.c===Se.TRUE}get color(){return this._decoration.cl}get type(){return this._decoration.t}setShow(t){return this._decoration.s=t?1:0,this}setFollowFontColor(t){return this._decoration.c=t?1:0,this}setColor(t){return this._decoration.cl=t,this}setLineType(t){return this._decoration.t=t,this}copy(){return Bt.create(re.deepClone(this._decoration))}build(){return{...this._decoration}}}class Vn{constructor(t={}){C(this,"_style");this._style=t}static create(t={}){return new Vn(t)}get indentFirstLine(){return this._style.indentFirstLine}get hanging(){return this._style.hanging}get indentStart(){return this._style.indentStart}get tabStops(){return this._style.tabStops}get indentEnd(){return this._style.indentEnd}get textStyle(){return this._style.textStyle}get headingId(){return this._style.headingId}get namedStyleType(){return this._style.namedStyleType}get horizontalAlign(){return this._style.horizontalAlign}get lineSpacing(){return this._style.lineSpacing}get direction(){return this._style.direction}get spacingRule(){return this._style.spacingRule}get snapToGrid(){return this._style.snapToGrid}get spaceAbove(){return this._style.spaceAbove}get spaceBelow(){return this._style.spaceBelow}get borderBetween(){return this._style.borderBetween}get borderTop(){return this._style.borderTop}get borderBottom(){return this._style.borderBottom}get borderLeft(){return this._style.borderLeft}get borderRight(){return this._style.borderRight}get keepLines(){return this._style.keepLines===Se.TRUE}get keepNext(){return this._style.keepNext===Se.TRUE}get wordWrap(){return this._style.wordWrap===Se.TRUE}get widowControl(){return this._style.widowControl===Se.TRUE}get shading(){return this._style.shading}get suppressHyphenation(){return this._style.suppressHyphenation===Se.TRUE}copy(){return kn.create(re.deepClone(this._style))}getValue(){return this._style}}class kn extends Vn{static create(t={}){return new kn(t)}constructor(t={}){super(t)}setIndentFirstLine(t){return this._style.indentFirstLine=t,this}setHanging(t){return this._style.hanging=t,this}setIndentStart(t){return this._style.indentStart=t,this}setTabStops(t){return this._style.tabStops=t,this}setIndentEnd(t){return this._style.indentEnd=t,this}setTextStyle(t){return this._style.textStyle=t,this}setHeadingId(t){return this._style.headingId=t,this}setNamedStyleType(t){return this._style.namedStyleType=t,this}setHorizontalAlign(t){return this._style.horizontalAlign=t,this}setLineSpacing(t){return this._style.lineSpacing=t,this}setDirection(t){return this._style.direction=t,this}setSpacingRule(t){return this._style.spacingRule=t,this}setSnapToGrid(t){return this._style.snapToGrid=t?1:0,this}setSpaceAbove(t){return this._style.spaceAbove=t,this}setSpaceBelow(t){return this._style.spaceBelow=t,this}setBorderBetween(t){return this._style.borderBetween=t,this}setBorderTop(t){return this._style.borderTop=t,this}setBorderBottom(t){return this._style.borderBottom=t,this}setBorderLeft(t){return this._style.borderLeft=t,this}setBorderRight(t){return this._style.borderRight=t,this}setKeepLines(t){return this._style.keepLines=t?1:0,this}setKeepNext(t){return this._style.keepNext=t?1:0,this}setWordWrap(t){return this._style.wordWrap=t?1:0,this}setWidowControl(t){return this._style.widowControl=t?1:0,this}setShading(t){return this._style.shading=t,this}setSuppressHyphenation(t){return this._style.suppressHyphenation=t?1:0,this}copy(){return kn.create(re.deepClone(this._style))}build(){return this.getValue()}}class jt{constructor(t){C(this,"_data");if(!t.body)throw new Error("Invalid document data, body is required");this._data=t}static create(t){return new jt(t)}static createByBody(t){return new jt({body:t,id:"d",documentStyle:{}})}copy(){return sn.create(re.deepClone(this._data))}slice(t,n){const{body:r,...s}=this._data;return sn.create({...re.deepClone(s),body:Ht(r,t,n)})}toPlainText(){var t,n;return st.transform.getPlainText((n=(t=this._data.body)==null?void 0:t.dataStream)!=null?n:"")}getParagraphStyle(){var t,n;return Vn.create((n=(t=this._data.body)==null?void 0:t.paragraphs)==null?void 0:n[0].paragraphStyle)}getParagraphBullet(){var t,n;return(n=(t=this._data.body)==null?void 0:t.paragraphs)==null?void 0:n[0].bullet}getParagraphs(){var r,s;const t=(s=(r=this._data.body)==null?void 0:r.paragraphs)!=null?s:[];let n=0;return t.map(i=>{const o=this.slice(n,i.startIndex);return n=i.startIndex,o})}getTextRuns(){var t,n;return((n=(t=this._data.body)==null?void 0:t.textRuns)!=null?n:[]).map(r=>({...r,ts:r.ts?Yn.create(r.ts):null}))}getLinks(){var t,n,r;return(r=(n=(t=this._data.body)==null?void 0:t.customRanges)==null?void 0:n.filter(s=>s.rangeType===on.HYPERLINK))!=null?r:[]}getData(){return this._data}}class sn extends jt{constructor(n){super(n);C(this,"_doc");this._doc=new Pt(n)}static newEmptyData(){return{id:"d",documentStyle:{},drawings:{},drawingsOrder:[],body:{dataStream:`\r
|
|
11
|
+
`,customBlocks:[],customRanges:[],paragraphs:[{startIndex:0}],textRuns:[],tables:[],sectionBreaks:[]}}}static create(n){return new sn(n!=null?n:sn.newEmptyData())}insertText(n,r,s){var h,u;let i=((u=(h=this._data.body)==null?void 0:h.dataStream.length)!=null?u:2)-2,o,a;if(typeof n=="string"?o=n:(i=Math.min(n,i),o=r),typeof r=="object"?a=r instanceof Wt?r.build():r:a=s instanceof Wt?s.build():s,!o)return this;const l={dataStream:o,textRuns:a?[{ts:a,st:i,ed:i+o.length}]:[]},c=st.selection.replace({doc:this._doc,selection:{startOffset:i,endOffset:i,collapsed:!0},body:l});if(!c)throw new Error("Insert text failed, please check.");return Ke.apply(this._doc.getBody(),c.serialize()),this}insertRichText(n,r){var a,l;let s=((l=(a=this._data.body)==null?void 0:a.dataStream.length)!=null?l:2)-2,i;typeof n=="object"?i=n instanceof jt?n.getData():n:(s=Math.min(n,s),i=r instanceof jt?r.getData():r);const o=st.selection.replace({doc:this._doc,selection:{startOffset:s,endOffset:s,collapsed:!0},body:i.body});if(!o)throw new Error("Insert text failed, please check.");return Ke.apply(this._doc.getBody(),o.serialize()),this}delete(n,r){if(r!==void 0){if(!r)return this;const s=st.selection.delete([{startOffset:n,endOffset:n+r,collapsed:!0}],this._data.body);Ke.apply(this._doc.getBody(),s)}return this}setStyle(n,r,s){const i={dataStream:"",textRuns:[{ts:s instanceof Wt?s.build():s,st:0,ed:r-n}]},o=st.selection.retain([{startOffset:n,endOffset:r,collapsed:!0}],i);return Ke.apply(this._doc.getBody(),o),this}setLink(n,r,s){const i=st.customRange.add({rangeType:on.HYPERLINK,rangeId:zt(),properties:{url:s},ranges:[{startOffset:n,endOffset:r,collapsed:!1}],body:this._data.body});if(!i)throw new Error("Insert text failed, please check.");return Ke.apply(this._doc.getBody(),i.serialize()),this}cancelLink(n,r){if(typeof n=="string"){const s=st.customRange.delete({rangeId:n,documentDataModel:this._doc});if(!s)throw new Error("Insert text failed, please check.");Ke.apply(this._doc.getBody(),s.serialize())}else this.slice(n,r).getLinks().forEach(i=>{const o=st.customRange.delete({rangeId:i.rangeId,documentDataModel:this._doc});if(!o)throw new Error("Insert text failed, please check.");Ke.apply(this._doc.getBody(),o.serialize())});return this}updateLink(n,r){var i,o;const s=(o=(i=this._data.body)==null?void 0:i.customRanges)==null?void 0:o.find(a=>a.rangeId===n);if(!s)throw new Error("Link not found");return s.properties.url=r,this}insertParagraph(n,r){var o,a;let s,i;return typeof n=="object"?(s={dataStream:"\r",paragraphs:[{startIndex:0,paragraphStyle:n.build()}]},i=((a=(o=this._data.body)==null?void 0:o.dataStream.length)!=null?a:2)-2):(i=n,s={dataStream:"\r",paragraphs:[{startIndex:0,paragraphStyle:r==null?void 0:r.build()}]}),this.insertRichText(i,jt.create({body:s,id:"d",documentStyle:{}})),this}insertLink(n,r,s){let i="",o="";typeof n=="string"?(i=n,o=r):(i=r,o=s);const a=sn.createByBody({dataStream:i,customRanges:[{rangeType:on.HYPERLINK,rangeId:zt(),properties:{url:o},startIndex:0,endIndex:i.length-1}]});return typeof n=="number"?this.insertRichText(n,a):this.insertRichText(a)}}function GE(e,t=16){let n=0,r=null;return function(...i){const o=Date.now();o-n<t?(r&&clearTimeout(r),r=setTimeout(()=>{n=o,e.apply(this,i)},t)):(n=o,e.apply(this,i))}}var An=(e=>(e[e.Style=1]="Style",e[e.Value=2]="Value",e))(An||{});function KE(e){return`sheet_interceptor_${e}`}const Cc=e=>function(t,n){let r=-1,s=t;for(let i=0;i<=e.length;i++){if(i<=r)throw new Error("[SheetInterceptorService]: next() called multiple times!");if(r=i,i===e.length)return s;const o=e[i];let a=!1;if(s=o.handler(s,n,l=>(a=!0,l)),!a)break}return s};class XE{constructor(t){C(this,"_interceptorsByName",new Map);C(this,"_interceptorPoints");this._interceptorPoints=t}fetchThroughInterceptors(t,n){const r=t;let s=this._interceptorsByName.get(r);return n&&(s=s.filter(n)),Cc(s||[])}intercept(t,n){const r=t;this._interceptorsByName.has(r)||this._interceptorsByName.set(r,[]);const s=this._interceptorsByName.get(r);return s.push(n),this._interceptorsByName.set(r,s.sort((i,o)=>{var a,l;return((a=o.priority)!=null?a:0)-((l=i.priority)!=null?l:0)})),()=>gr(this._interceptorsByName.get(r),n)}getInterceptPoints(){return this._interceptorPoints}dispose(){this._interceptorsByName.clear()}}function QE(e){return`sheet_async_interceptor_${e}`}const qE=e=>async function(t,n){let r=-1,s=t;for(let i=0;i<=e.length;i++){if(i<=r)throw new Error("[SheetInterceptorService]: next() called multiple times!");if(r=i,i===e.length)return s;const o=e[i];let a=!1;if(s=await o.handler(s,n,async l=>(a=!0,l)),!a)break}return s};class JE{constructor(t){C(this,"_asyncInterceptorsByName",new Map);C(this,"_asyncInterceptorPoints");this._asyncInterceptorPoints=t}fetchThroughAsyncInterceptors(t,n){const r=t;let s=this._asyncInterceptorsByName.get(r);return n&&(s=s.filter(n)),qE(s||[])}async interceptAsync(t,n){const r=t;this._asyncInterceptorsByName.has(r)||this._asyncInterceptorsByName.set(r,[]);const s=this._asyncInterceptorsByName.get(r);return s.push(n),this._asyncInterceptorsByName.set(r,s.sort((i,o)=>{var a,l;return((a=o.priority)!=null?a:0)-((l=i.priority)!=null?l:0)})),()=>gr(this._asyncInterceptorsByName.get(r),n)}getInterceptPoints(){return this._asyncInterceptorPoints}dispose(){this._asyncInterceptorsByName.clear()}}function ZE(e,t){for(const n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}class Ss extends nt{static extend(t){Object.getOwnPropertyNames(t.prototype).forEach(n=>{n!=="constructor"&&(this.prototype[n]=t.prototype[n])}),Object.getOwnPropertyNames(t).forEach(n=>{n!=="prototype"&&n!=="name"&&n!=="length"&&(this[n]=t[n])})}}const ks=Symbol("initializers");class Zi extends nt{constructor(t){super(),this._injector=t;const n=this,r=Object.getPrototypeOf(this)[ks];r&&r.forEach(function(s){s.apply(n,[t])})}_initialize(t){}static extend(t){Object.getOwnPropertyNames(t.prototype).forEach(n=>{if(n==="_initialize"){let r=this.prototype[ks];r||(r=[],this.prototype[ks]=r),r.push(t.prototype._initialize)}else n!=="constructor"&&(this.prototype[n]=t.prototype[n])}),Object.getOwnPropertyNames(t).forEach(n=>{n!=="prototype"&&n!=="name"&&n!=="length"&&(this[n]=t[n])})}}class Os{constructor(){C(this,"_data",[])}static create(){return new Os}add(t){this._data.indexOf(t)>-1||this._data.push(t)}delete(t){const n=this._data.indexOf(t);this._data.splice(n,1)}getData(){return this._data}}class eo{constructor(){C(this,"_data",new Map)}static create(){return new eo}add(t,n){this._data.has(t)||this._data.set(t,n)}delete(t){this._data.delete(t)}getData(){return this._data}}const eC="0.5.4";function tC(e="",t=Er.ZH_CN,n=""){return{id:e,sheetOrder:[],name:n,appVersion:eC,locale:t,styles:{},sheets:{},resources:[]}}class Rc{constructor(t={}){C(this,"_styles");C(this,"_cacheMap",new hr(1e5));this._styles=t,this._generateCacheMap()}each(t){return Object.entries(this._styles).forEach(t),this}search(t,n){if(this._cacheMap.has(n))return this._cacheMap.get(n);const r=this._getExistingStyleId(t);return r||"-1"}get(t){return typeof t!="string"?t:(t=String(t),this._styles[t])}add(t,n){const r=re.generateRandomId(6);return this._styles[r]=t,this._cacheMap.set(n,r),r}setValue(t){if(t==null)return;const n=JSON.stringify(t),r=this.search(t,n);return r!=="-1"?r:this.add(t,n)}toJSON(){return this._styles}getStyleByCell(t){let n;t&&re.isObject(t.s)?n=t.s:n=(t==null?void 0:t.s)&&this.get(t.s);const r=t==null?void 0:t.interceptorStyle;return r?{...n,...r}:n}_generateCacheMap(){const{_styles:t,_cacheMap:n}=this;for(const r in t){const s=JSON.stringify(t[r]);n.set(s,r)}}_getExistingStyleId(t){const{_styles:n}=this;for(const r in n)if(re.diffValue(n[r],t))return r;return null}}const nC=(e,t)=>t.length===e.length&&!e.some(n=>t.some(r=>!Yt.equals(r,n))),rC=(e,t)=>t.length===e.length&&e.every((n,r)=>{const s=t[r];return s.unitId===n.unitId&&s.sheetId===n.sheetId&&Yt.equals(n.range,s.range)}),pi={t:0,b:2,l:2,r:2},sC=e=>({sbr:.6,sbo:e,spr:.6,spo:e}),va=90;function er(e,t,n={}){const r=e.length,{textRotation:s,paddingData:i,horizontalAlign:o=$t.UNSPECIFIED,verticalAlign:a=tn.UNSPECIFIED,wrapStrategy:l=_n.UNSPECIFIED,cellValueType:c}=n,{t:h,r:u,b:d,l:f}=i||pi,{vertexAngle:E,centerAngle:R}=yc(s),O={id:"d",body:{dataStream:`${e}${sl}`,textRuns:[{ts:t,st:0,ed:r}],paragraphs:[{startIndex:r,paragraphStyle:{horizontalAlign:o}}],sectionBreaks:[{startIndex:r+1}]},documentStyle:{pageSize:{width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},marginTop:h,marginBottom:d,marginRight:u,marginLeft:f,renderConfig:{horizontalAlign:o,verticalAlign:a,centerAngle:R,vertexAngle:E,wrapStrategy:l,cellValueType:c,zeroWidthParagraphBreak:1}},drawings:{},drawingsOrder:[]};return new Pt(O)}function iC(e){if(!e)return{};const{tr:t,td:n,ht:r,vt:s,tb:i,pd:o}=e;return{textRotation:t,textDirection:n,horizontalAlign:r,verticalAlign:s,wrapStrategy:i,paddingData:o}}function ya(e){if(!e)return{};const{ff:t,fs:n,it:r,bl:s,ul:i,st:o,ol:a,cl:l}=e,c={};return t&&(c.ff=t),n&&(c.fs=n),r&&(c.it=r),s&&(c.bl=s),i&&(c.ul=i),o&&(c.st=o),a&&(c.ol=a),l&&(c.cl=l),c}function Ic(e,t,n){var i;const r=e.getBody();if((i=r.customRanges)!=null&&i.some(o=>o.rangeType===on.HYPERLINK))return;const s=st.customRange.add({ranges:[{startOffset:0,endOffset:r.dataStream.length-1,collapsed:!1}],rangeId:n,rangeType:on.HYPERLINK,body:r,properties:{url:t,refId:n}});s&&Ke.apply(r,s.serialize())}function vc(e){return e!=null}const oC='"Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif';function Sa(e){const t=ct.ff,n=ct.fs;if(!e){const u=`${n}pt ${t}`;return{fontCache:u,fontString:u,fontSize:n,originFontSize:n,fontFamily:t}}let r=wn.ITALIC;(e.it===0||e.it===void 0)&&(r=wn.NORMAL);let s=wn.BOLD;(e.bl===0||e.bl===void 0)&&(s=wn.NORMAL);let i=n;e.fs&&(i=Math.ceil(e.fs));let o=t;if(e.ff){let u=e.ff;u=u.replace(/"/g,"").replace(/'/g,""),u.indexOf(" ")>-1&&(u=`"${u}"`),u==null&&(u=t),o=u}const{va:a}=e;let l=i;if(a===Ut.SUBSCRIPT||a===Ut.SUPERSCRIPT){const u=aC(o,l),{sbr:d,spr:f}=u;l*=a===Ut.SUBSCRIPT?d:f}const c=`${r} ${s} ${l}pt ${o}`,h=`${c}, ${oC} `;return{fontCache:c,fontString:h,fontSize:l,originFontSize:i,fontFamily:o}}function aC(e,t){return sC(t)}function yc(e){const{a:t=0,v:n=Se.FALSE}=e||{a:0,v:Se.FALSE};let r=0,s=t;return n===Se.TRUE&&(r=va,s=va),{centerAngle:r,vertexAngle:s}}class lC{constructor(t,n){C(this,"_columnData",{});this._config=t,this._columnData=n}getColumnData(){return this._columnData}getColVisible(t){const{_columnData:n}=this,r=n[t];return r?r.hd!==Se.TRUE:!0}getColumnStyle(t){var n;return(n=this._columnData[t])==null?void 0:n.s}setColumnStyle(t,n){const r=this.getColumnOrCreate(t);r.s=n}getHiddenCols(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getColVisible(o);s&&a?(s=!1,r.push({rangeType:xe.COLUMN,startColumn:i,endColumn:o-1,startRow:0,endRow:0})):!s&&!a&&(s=!0,i=o)}return s&&r.push({startRow:0,endRow:0,startColumn:i,endColumn:n,rangeType:xe.COLUMN}),r}getVisibleCols(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getColVisible(o);s&&!a?(s=!1,r.push({rangeType:xe.COLUMN,startColumn:i,endColumn:o-1,startRow:0,endRow:0})):!s&&a&&(s=!0,i=o)}return s&&r.push({startRow:0,endRow:0,startColumn:i,endColumn:n,rangeType:xe.COLUMN}),r}getColumnDatas(t,n){const r={};let s=0;for(let i=t;i<t+n;i++){const o=this.getColumnOrCreate(i);r[s]=o,s++}return r}getSize(){return rn(this._columnData)}getColumnWidth(t){const{_columnData:n}=this,r=this._config;let s=0;return s=(n[t]||{hd:Se.FALSE,w:r.defaultColumnWidth}).w||r.defaultColumnWidth,s}getColumn(t){const n=this._columnData[t];if(n)return n}removeColumn(t){delete this._columnData[t]}getColumnOrCreate(t){const{_columnData:n}=this,r=n[t];if(r)return r;const s={};return this._columnData[t]=s,s}setCustomMetadata(t,n){const r=this.getColumn(t);r&&(r.custom=n)}getCustomMetadata(t){var n;return(n=this.getColumn(t))==null?void 0:n.custom}}class uC{constructor(t,n,r){C(this,"_rowData");this._config=t,this._viewModel=n,this._rowData=r}getRowData(){return this._rowData}getRowStyle(t){var n;return(n=this._rowData[t])==null?void 0:n.s}setRowStyle(t,n){const r=this.getRowOrCreate(t);r.s=n}getRowDatas(t,n){const r={};let s=0;for(let i=t;i<t+n;i++){const o=this.getRowOrCreate(i);r[s]=o,s++}return r}getRowHeight(t,n=1){const{_rowData:r}=this,s=this._config;let i=0;for(let o=0;o<n;o++){const a=r[o+t]||{hd:Se.FALSE,h:s.defaultRowHeight},{ia:l,ah:c,h=s.defaultRowHeight}=a;i+=(l==null||l===Se.TRUE)&&typeof c=="number"?c:h}return i}getRow(t){return this._rowData[t]}removeRow(t){delete this._rowData[t]}getRowOrCreate(t){const{_rowData:n}=this,r=n[t];if(r)return r;const s={};return n[t]=s,s}getHiddenRows(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getRowRawVisible(o);s&&a?(s=!1,r.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:xe.ROW})):!s&&!a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:n,startColumn:0,endColumn:0,rangeType:xe.ROW}),r}getVisibleRows(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getRowRawVisible(o);s&&!a?(s=!1,r.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:xe.ROW})):!s&&a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:n,startColumn:0,endColumn:0,rangeType:xe.ROW}),r}getRowRawVisible(t){const n=this.getRow(t);return n?n.hd!==Se.TRUE:!0}getSize(){return rn(this._rowData)}setCustomMetadata(t,n){const r=this.getRow(t);r&&(r.custom=n)}getCustomMetadata(t){var n;return(n=this.getRow(t))==null?void 0:n.custom}}const cC="DEFAULT_WORKSHEET_ROW_COUNT",Sc=1e3,hC="DEFAULT_WORKSHEET_COLUMN_COUNT",Oc=20,dC="DEFAULT_WORKSHEET_ROW_HEIGHT",bc=24,fC="DEFAULT_WORKSHEET_COLUMN_WIDTH",wc=88,gC="DEFAULT_WORKSHEET_ROW_TITLE_WIDTH",Ac=46,pC="DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT",Tc=20;function Nc(e){const t={name:"Sheet1",id:"sheet-01",tabColor:"",hidden:Se.FALSE,rowCount:Sc,columnCount:Oc,zoomRatio:1,freeze:{xSplit:0,ySplit:0,startRow:-1,startColumn:-1},scrollTop:0,scrollLeft:0,defaultColumnWidth:wc,defaultRowHeight:bc,mergeData:[],cellData:{},rowData:{},columnData:{},showGridlines:Se.TRUE,rowHeader:{width:Ac,hidden:Se.FALSE},columnHeader:{height:Tc,hidden:Se.FALSE},rightToLeft:Se.FALSE};return Object.keys(t).forEach(n=>{const r=n;typeof e[r]>"u"&&(e[r]=t[r])}),e}class mC extends nt{constructor(n){super();C(this,"_cellCache",new Map);C(this,"_rowCache",new Map);C(this,"_columnCache",new Map);C(this,"_hasRow",!1);C(this,"_hasColumn",!1);C(this,"_hasAll",!1);C(this,"_allIndex",-1);C(this,"_mergeData");C(this,"_rangeMap",new hr(5e4));C(this,"_skeletonCache",new hr(5e4));this._init(n.concat())}_init(n){this._mergeData=n,this._createCache(n)}_clearCache(){this._cellCache.clear(),this._rowCache.clear(),this._columnCache.clear(),this._hasAll=!1,this._allIndex=-1,this._rangeMap.clear(),this._skeletonCache.clear(),this._hasColumn=!1,this._hasRow=!1}_createCache(n){let r=0;for(const s of n){const{rangeType:i}=s;i===xe.ROW?this._createRowCache(s,r):i===xe.COLUMN?this._createColumnCache(s,r):i===xe.ALL?this._createCellAllCache(r):this._createCellCache(s,r),r++}}rebuild(n){this._clearCache(),this._init(n.concat())}_createRowCache(n,r){const{startRow:s,endRow:i}=n;for(let o=s;o<=i;o++)this._rowCache.set(o,r),this._hasRow=!0}_createColumnCache(n,r){const{startColumn:s,endColumn:i}=n;for(let o=s;o<=i;o++)this._columnCache.set(o,r),this._hasColumn=!0}_createCellAllCache(n){this._hasAll=!0,this._allIndex=n}_createCellCache(n,r){for(let s=n.startRow;s<=n.endRow;s++){let i=this._cellCache.get(s);i==null&&(i=new Map,this._cellCache.set(s,i));for(let o=n.startColumn;o<=n.endColumn;o++)i.set(o,r)}}add(n){this._mergeData.push(n),this._clearCache(),this._createCache(this._mergeData)}remove(n,r){const s=this._getMergeDataIndex(n,r);s!==-1&&(this._mergeData.splice(s,1),this._clearCache(),this._createCache(this._mergeData))}getMergedCell(n,r){const s=this._getMergeDataIndex(n,r);return s!==-1?this._mergeData[s]:null}getMergeDataIndex(n,r){return this._getMergeDataIndex(n,r)}isRowContainsMergedCell(n){return this._hasAll||!re.isEmptyObject(this._columnCache)?!0:this._mergeData.some(r=>r.startRow<=n&&n<=r.endRow)}isColumnContainsMergedCell(n){return this._hasAll||!re.isEmptyObject(this._rowCache)?!0:this._mergeData.some(r=>r.startColumn<=n&&n<=r.endColumn)}getMergedCellRange(n,r,s,i){const o=[],a=`${n}-${r}-${s}-${i}`;if(this._rangeMap.has(a))return this._getRangeFromCache(a);let l=0;const c=[];for(const h of this._mergeData||[])Yt.intersects(h,{startRow:n,endRow:s,startColumn:r,endColumn:i})&&(o.push({...h}),c.push(l)),l++;return this._rangeMap.set(a,c),o}getMergedCellRangeForSkeleton(n,r,s,i){const o=[],a=this._mergeData,l=`${n}-${r}-${s}-${i}`;if(this._skeletonCache.has(l))return this._getSkeletonRangeFromCache(l);const c=[];for(let h=0;h<a.length;h++){const{startRow:u,endRow:d,startColumn:f,endColumn:E}=a[h];for(let R=n;R<=s;R++){let O=!1;for(let T=r;T<=i;T++)if(R>=u&&R<=d&&T>=f&&T<=E){o.push({startRow:u,endRow:d,startColumn:f,endColumn:E}),c.push(h),O=!0;break}if(O)break}}return this._skeletonCache.set(l,c),o}_getRangeFromCache(n){const r=this._rangeMap.get(n)||[],s=[];for(const i of r)s.push({...this._mergeData[i]});return s}_getSkeletonRangeFromCache(n){const r=this._skeletonCache.get(n)||[],s=[];for(const i of r)s.push({...this._mergeData[i]});return s}_getMergeDataIndex(n,r){var i;if(this._hasAll)return this._allIndex;if(this._hasRow){const o=this._rowCache.get(n);if(o!==void 0)return o}if(this._hasColumn){const o=this._columnCache.get(r);if(o!==void 0)return o}const s=(i=this._cellCache.get(n))==null?void 0:i.get(r);return s!==void 0?s:-1}getMergeDataSnapshot(){return this._mergeData}dispose(){this._clearCache(),this._mergeData=[]}}class Mc extends nt{constructor(n){super();C(this,"_cellContentInterceptor",null);C(this,"_rowFilteredInterceptor",null);this.getRawCell=n}dispose(){super.dispose(),this._cellContentInterceptor=null,this._rowFilteredInterceptor=null}getCell(n,r,s,i){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,An.Value|An.Style,s,i):this.getRawCell(n,r)}getCellValueOnly(n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,An.Value):this.getRawCell(n,r)}getCellStyleOnly(n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,An.Style):this.getRawCell(n,r)}getRowFiltered(n){var r,s;return(s=(r=this._rowFilteredInterceptor)==null?void 0:r.getRowFiltered(n))!=null?s:!1}registerCellContentInterceptor(n){if(this._cellContentInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._cellContentInterceptor=n,Qe(()=>this._cellContentInterceptor=null)}registerRowFilteredInterceptor(n){if(this._rowFilteredInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._rowFilteredInterceptor=n,Qe(()=>this._rowFilteredInterceptor=null)}}const Oa={isDeepClone:!1,displayRawFormula:!1,ignoreTextRotation:!1};class dr{constructor(t,n,r){C(this,"_sheetId");C(this,"_snapshot");C(this,"_cellData");C(this,"_rowManager");C(this,"_columnManager");C(this,"_viewModel");C(this,"_spanModel");var a;this.unitId=t,this._styles=r,this._snapshot=Nc(n);const{columnData:s,rowData:i,cellData:o}=this._snapshot;this._sheetId=(a=this._snapshot.id)!=null?a:re.generateRandomId(6),this._cellData=new xt(o),this._viewModel=new Mc((l,c)=>this.getCellRaw(l,c)),this._rowManager=new uC(this._snapshot,this._viewModel,i),this._columnManager=new lC(this._snapshot,s),this._spanModel=new mC(this._snapshot.mergeData)}__interceptViewModel(t){t(this._viewModel)}getSnapshot(){return this._snapshot}setMergeData(t){this._snapshot.mergeData=t,this.getSpanModel().rebuild(t)}getSpanModel(){return this._spanModel}getStyleDataByHash(t){return{...this._styles.get(t)}}setStyleData(t){return this._styles.setValue(t)}getColumnStyle(t,n=!1){return n?this._columnManager.getColumnStyle(t):this._styles.get(this._columnManager.getColumnStyle(t))}setColumnStyle(t,n){this._columnManager.setColumnStyle(t,n)}getRowStyle(t,n=!1){return n?this._rowManager.getRowStyle(t):this._styles.get(this._rowManager.getRowStyle(t))}setRowStyle(t,n){this._rowManager.setRowStyle(t,n)}mixinDefaultStyleToCellRaw(t,n,r,s){const i=this.getColumnStyle(n),o=this.getRowStyle(t),a=this.getDefaultCellStyleInternal();if(a||i||o){let l=r==null?void 0:r.s;typeof l=="string"&&(l=this._styles.get(l));const c=s?ri(a,i,o,l):ri(a,o,i,l);r||(r={}),r.s=c}}getDefaultCellStyle(){return this._snapshot.defaultStyle}getDefaultCellStyleInternal(){const t=this._snapshot.defaultStyle;return this._styles.get(t)}setDefaultCellStyle(t){this._snapshot.defaultStyle=t}getCellMatrix(){return this._cellData}getCellMatrixPrintRange(){const t=this.getCellMatrix(),n=this.getMergeData();let r=-1,s=-1,i=-1,o=-1,a=!1,l=!1;return t.forEach((c,h)=>{Object.keys(h).forEach(u=>{const d=+u,f=t.getValue(c,d),E=f!=null&&f.s?this._styles.get(f.s):null,R=(E==null?void 0:E.bd)&&(E.bd.b||E.bd.l||E.bd.r||E.bd.t||E.bd.bc_tr||E.bd.bl_tr||E.bd.ml_tr||E.bd.tl_bc||E.bd.tl_br||E.bd.tl_mr);(f&&(f.v||f.p)||E!=null&&E.bg||R)&&(a?r=Math.min(r,c):(r=c,a=!0),s=Math.max(s,c),l?i=Math.min(i,d):(l=!0,i=d),o=Math.max(o,d))})}),n.forEach(c=>{a?r=Math.min(r,c.startRow):(r=c.startRow,a=!0),s=Math.max(s,c.endRow),l?i=Math.min(i,c.startColumn):(i=c.startColumn,a=!0),o=Math.max(o,c.endColumn)}),!a||!l?null:{startColumn:i,startRow:r,endColumn:o,endRow:s}}getRowManager(){return this._rowManager}getUnitId(){return this.unitId}getSheetId(){return this._sheetId}getColumnManager(){return this._columnManager}getName(){return this._snapshot.name}clone(){const{_snapshot:t}=this,n=re.deepClone(t);return new dr(this.unitId,n,this._styles)}getMergeData(){return this._spanModel.getMergeDataSnapshot()}getMergedCell(t,n){return this._spanModel.getMergedCell(t,n)}getMergedCellRange(t,n,r,s){return this._spanModel.getMergedCellRange(t,n,r,s)}isRowContainsMergedCell(t){return this._spanModel.isRowContainsMergedCell(t)}isColumnContainsMergedCell(t){return this._spanModel.isColumnContainsMergedCell(t)}getCellInfoInMergeData(t,n){const r=this.getMergedCell(t,n);let s=!1,i=!1,o=t,a=n,l=t,c=n;if(r){const{startRow:h,endRow:u,startColumn:d,endColumn:f}=r;t===h&&n===d?(o=u,a=f,l=h,c=d,i=!0):t>=h&&t<=u&&n>=d&&n<=f&&(o=u,a=f,l=h,c=d,s=!0)}return{actualRow:t,actualColumn:n,isMergedMainCell:i,isMerged:s,endRow:o,endColumn:a,startRow:l,startColumn:c}}getCell(t,n){return t<0||n<0?null:this._viewModel.getCell(t,n)}getCellValueOnly(t,n){return t<0||n<0?null:this._viewModel.getCellValueOnly(t,n)}getCellStyleOnly(t,n){return t<0||n<0?null:this._viewModel.getCellStyleOnly(t,n)}getCellRaw(t,n){return this.getCellMatrix().getValue(t,n)}getCellWithFilteredInterceptors(t,n,r,s){return this._viewModel.getCell(t,n,r,s)}getRowFiltered(t){return this._viewModel.getRowFiltered(t)}getMatrixWithMergedCells(t,n,r,s,i=bn.Raw){const o=this.getCellMatrix(),a=this._spanModel.getMergedCellRange(t,n,r,s),l=new xt;return ui(t,r,n,s).forEach((c,h)=>{var d;let u;if(i===bn.Raw)u=this.getCellRaw(c,h);else if(i===bn.Intercepted)u=this.getCell(c,h);else if(i===bn.Both){const f=this.getCellRaw(c,h);if(f){u={...f};const E=(d=this.getCell(c,h))==null?void 0:d.v;vc(E)&&u&&(u.displayV=String(E))}}u&&l.setValue(c,h,u)}),a.forEach(c=>{const{startColumn:h,startRow:u,endColumn:d,endRow:f}=c;ui(u,f,h,d).forEach((E,R)=>{E===u&&R===h&&l.setValue(E,R,{...o.getValue(E,R),rowSpan:f-u+1,colSpan:d-h+1}),(E!==u||R!==h)&&l.realDeleteValue(E,R)})}),l}getRange(t,n,r,s){return typeof t=="object"?new Fn(this,t,{getStyles:()=>this._styles}):new Fn(this,{startRow:t,startColumn:n,endColumn:s||n,endRow:r||t},{getStyles:()=>this._styles})}getScrollLeftTopFromSnapshot(){return{scrollLeft:this._snapshot.scrollLeft,scrollTop:this._snapshot.scrollTop}}getZoomRatio(){return this._snapshot.zoomRatio||1}getConfig(){return this._snapshot}getFreeze(){return this._snapshot.freeze}getMaxColumns(){const{_snapshot:t}=this,{columnCount:n}=t;return n}getMaxRows(){const{_snapshot:t}=this,{rowCount:n}=t;return n}getRowCount(){return this._snapshot.rowCount}setRowCount(t){this._snapshot.rowCount=t}getColumnCount(){return this._snapshot.columnCount}setColumnCount(t){this._snapshot.columnCount=t}isSheetHidden(){return this._snapshot.hidden}hasHiddenGridlines(){const{_snapshot:t}=this,{showGridlines:n}=t;return n===0}getGridlinesColor(){return this.getConfig().gridlinesColor}getTabColor(){const{_snapshot:t}=this,{tabColor:n}=t;return n}getColumnWidth(t){return this.getColumnManager().getColumnWidth(t)}getRowHeight(t){return this._viewModel.getRowFiltered(t)?0:this.getRowManager().getRowHeight(t)}isRowFiltered(t){return this._viewModel.getRowFiltered(t)}getRowVisible(t){return!this.isRowFiltered(t)&&this.getRowRawVisible(t)}getRowRawVisible(t){return this.getRowManager().getRowRawVisible(t)}getHiddenRows(t,n){const r=this.getMaxColumns()-1,s=this._rowManager.getHiddenRows(t,n);return s.forEach(i=>i.endColumn=r),s}getColVisible(t){return this._columnManager.getColVisible(t)}getHiddenCols(t,n){const r=this.getMaxRows()-1,s=this._columnManager.getHiddenCols(t,n);return s.forEach(i=>i.endRow=r),s}getVisibleRows(){const t=this.getRowCount();return this._rowManager.getVisibleRows(0,t-1)}getVisibleCols(){const t=this.getColumnCount();return this._columnManager.getVisibleCols(0,t-1)}isRightToLeft(){const{_snapshot:t}=this,{rightToLeft:n}=t;return n}getLastRowWithContent(){return this._cellData.getLength()-1}getLastColumnWithContent(){return this._cellData.getRange().endColumn}getDataRangeScope(){return this._cellData.getStartEndScope()}cellHasValue(t){return t&&(t.v!==void 0||t.f!==void 0||t.p!==void 0)}iterateByRow(t,n=!0){const{startRow:r,startColumn:s,endRow:i,endColumn:o}=t,a=this;return{[Symbol.iterator]:()=>{let l=r,c=s;return{next(){for(;;){if(c>o&&(l+=1,c=s),l>i)return{done:!0,value:void 0};const h=a.getCell(l,c),u=!h,d=a.getMergedCell(l,c);if(d){if(l!==d.startRow||c!==d.startColumn){c=d.endColumn+1;continue}if(u&&n){c=d.endColumn+1;continue}const E={row:l,col:c,value:h};return E.colSpan=d.endColumn-d.startColumn+1,E.rowSpan=d.endRow-d.startRow+1,c=d.endColumn+1,{done:!1,value:E}}if(u&&n)c+=1;else{const f={row:l,col:c,value:h};return c+=1,{done:!1,value:f}}}}}}}}iterateByColumn(t,n=!0,r=!0){const{startRow:s,startColumn:i,endRow:o,endColumn:a}=t,l=this;return{[Symbol.iterator]:()=>{let c=s,h=i;return{next(){for(;;){if(c>o&&(h+=1,c=s),h>a)return{done:!0,value:void 0};const u=l.getMergedCell(c,h);if(u){const E=c!==u.startRow,R=E||h!==u.startColumn;if(r&&R||!r&&E){c=u.endRow+1;continue}const O=l.getCell(u.startRow,u.startColumn);if(!O&&n){c=u.endRow+1;continue}const V={row:c,col:u.startColumn,value:O};return V.colSpan=u.endColumn-u.startColumn+1,V.rowSpan=u.endRow-u.startRow+1,c=u.endRow+1,{done:!1,value:V}}const d=l.getCell(c,h);if(!d&&n)c+=1;else{const E={row:c,col:h,value:d};return c+=1,{done:!1,value:E}}}}}}}}_getCellDocumentModel(t,n=Oa){var R;const{isDeepClone:r,displayRawFormula:s,ignoreTextRotation:i}={...Oa,...n},o=this._styles.getStyleByCell(t);if(!t)return;let a,l="document";const c=iC(o),h=i?ct.tr:c.textRotation||ct.tr;let u=c.horizontalAlign||ct.ht;const d=c.verticalAlign||ct.vt,f=c.wrapStrategy||ct.tb,E=c.paddingData||pi;if(t.f&&s)a=er(t.f.toString(),{},{verticalAlign:d}),u=ct.ht;else if(t.p){const{centerAngle:O,vertexAngle:T}=yc(h);a=this._updateConfigAndGetDocumentModel(r?re.deepClone(t.p):t.p,u,E,{horizontalAlign:u,verticalAlign:d,centerAngle:O,vertexAngle:T,wrapStrategy:f,zeroWidthParagraphBreak:1})}else if(t.v!=null){const O=ya(o);l=Sa(O).fontCache;let T=Dc(t);t.t===nn.FORCE_STRING&&s&&(T=`'${T}`),a=er(T,O,{...c,textRotation:h,cellValueType:t.t})}return a&&t.linkUrl&&t.linkId&&Ic(a,t.linkUrl,t.linkId),{documentModel:a,fontString:l,textRotation:h,wrapStrategy:f,verticalAlign:d,horizontalAlign:u,paddingData:E,fill:(R=o==null?void 0:o.bg)==null?void 0:R.rgb}}_updateConfigAndGetDocumentModel(t,n,r,s){var o,a,l,c,h;if(!s||!((o=t.body)!=null&&o.dataStream))return;t.documentStyle||(t.documentStyle={}),t.documentStyle.marginTop=(a=r.t)!=null?a:0,t.documentStyle.marginBottom=(l=r.b)!=null?l:2,t.documentStyle.marginLeft=(c=r.l)!=null?c:2,t.documentStyle.marginRight=(h=r.r)!=null?h:2,t.documentStyle.pageSize={width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},t.documentStyle.renderConfig={...t.documentStyle.renderConfig,...s};const i=t.body.paragraphs||[];for(const u of i)u.paragraphStyle||(u.paragraphStyle={}),u.paragraphStyle.horizontalAlign=n;return new Pt(t)}getBlankCellDocumentModel(t){const n=this._getCellDocumentModel(t,{ignoreTextRotation:!0}),r=this._styles.getStyleByCell(t),s=ya(r);if(n!=null)return n.documentModel==null&&(n.documentModel=er("",s)),n;const i="";let o="document";const a=ct.tr,l=ct.ht,c=ct.vt,h=ct.tb,u=pi;return o=Sa({}).fontCache,{documentModel:er(i,s),fontString:o,textRotation:a,wrapStrategy:h,verticalAlign:c,horizontalAlign:l,paddingData:u}}getCellDocumentModelWithFormula(t){return this._getCellDocumentModel(t,{isDeepClone:!0,displayRawFormula:!0,ignoreTextRotation:!0})}getCustomMetadata(){return this._snapshot.custom}setCustomMetadata(t){this._snapshot.custom=t}}function Dc(e){var r,s;if(!e)return"";const t=(s=(r=e.p)==null?void 0:r.body)==null?void 0:s.dataStream;if(t)return st.transform.getPlainText(t);const n=e.v;return typeof n=="string"?e.t===nn.BOOLEAN?n.toUpperCase():n.replace(/[\r\n]/g,""):typeof n=="number"?e.t===nn.BOOLEAN?n?"TRUE":"FALSE":n.toString():typeof n=="boolean"?n?"TRUE":"FALSE":""}function _C(e){if(e===null)return"";if(e!=null&&e.p){const t=e==null?void 0:e.p.body;if(t==null)return"";const n=t.dataStream;return st.transform.getPlainText(n)}return e==null?void 0:e.v}var EC=Object.defineProperty,CC=Object.getOwnPropertyDescriptor,RC=(e,t,n,r)=>{for(var s=r>1?void 0:r?CC(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&EC(t,n,s),s},IC=(e,t)=>(n,r)=>t(n,r,e);function vC(e,t){return`${e.getUnitId()}|${t.getSheetId()}`}exports.Workbook=class extends ys{constructor(n={},r){super();C(this,"type",$e.UNIVER_SHEET);C(this,"_sheetCreated$",new Oe.Subject);C(this,"sheetCreated$",this._sheetCreated$.asObservable());C(this,"_sheetDisposed$",new Oe.Subject);C(this,"sheetDisposed$",this._sheetDisposed$.asObservable());C(this,"_activeSheet$",new Oe.BehaviorSubject(null));C(this,"activeSheet$",this._activeSheet$.asObservable());C(this,"_worksheets");C(this,"_styles");C(this,"_snapshot");C(this,"_unitId");C(this,"_count");C(this,"_name$");C(this,"name$");this._logService=r;const s=tC();re.isEmptyObject(n)?this._snapshot=s:this._snapshot=re.commonExtend(s,n);const{styles:i}=this._snapshot;(this._snapshot.id==null||this._snapshot.id.length===0)&&(this._snapshot.id=re.generateRandomId(6)),this._unitId=this._snapshot.id,this._styles=new Rc(i),this._count=1,this._worksheets=new Map,this._name$=new Oe.BehaviorSubject(n.name||""),this.name$=this._name$.asObservable(),this._parseWorksheetSnapshots()}get _activeSheet(){return this._activeSheet$.getValue()}get name(){return this._name$.getValue()}static isIRangeType(n){return typeof n=="string"||"startRow"in n||"row"in n}dispose(){super.dispose(),this._sheetCreated$.complete(),this._sheetDisposed$.complete(),this._activeSheet$.complete(),this._name$.complete()}save(){return re.deepClone(this._snapshot)}getSnapshot(){return this._snapshot}getName(){return this._snapshot.name}setName(n){this._name$.next(n),this._snapshot.name=n}getUnitId(){return this._unitId}getRev(){var n;return(n=this._snapshot.rev)!=null?n:1}incrementRev(){this._snapshot.rev=this.getRev()+1}setRev(n){this._snapshot.rev=n}addWorksheet(n,r,s){const{sheets:i,sheetOrder:o}=this._snapshot;if(i[n])return!1;i[n]=s,o.splice(r,0,n);const a=new dr(this._unitId,s,this._styles);return this._worksheets.set(n,a),this._sheetCreated$.next(a),!0}getSheetOrders(){return this._snapshot.sheetOrder}getWorksheets(){return this._worksheets}getActiveSpreadsheet(){return this}getStyles(){return this._styles}getConfig(){return this._snapshot}getIndexBySheetId(n){const{sheetOrder:r}=this._snapshot;return r.findIndex(s=>s===n)}getActiveSheet(n){if(!this._activeSheet&&typeof n>"u")throw new Error(`[Workbook]: no active Worksheet on Workbook ${this._unitId}!`);return this._activeSheet}ensureActiveSheet(){const n=this._activeSheet;if(n)return n;const r=this._snapshot.sheetOrder;for(let i=0,o=r.length;i<o;i++){const a=this._worksheets.get(r[i]);if(a&&a.isSheetHidden()!==Se.TRUE)return this.setActiveSheet(a),a}const s=this._worksheets.get(r[0]);return this.setActiveSheet(s),s}setActiveSheet(n){this._activeSheet$.next(n)}removeSheet(n){const r=this._worksheets.get(n);return r?(this._worksheets.delete(n),this._snapshot.sheetOrder.splice(this._snapshot.sheetOrder.indexOf(n),1),delete this._snapshot.sheets[n],this._sheetDisposed$.next(r),!0):!1}getActiveSheetIndex(){const{sheetOrder:n}=this._snapshot;return n.findIndex(r=>this._worksheets.get(r)===this._activeSheet)}getSheetSize(){return this._snapshot.sheetOrder.length}getSheets(){const{sheetOrder:n}=this._snapshot;return n.map(r=>this._worksheets.get(r))}getSheetsName(){const{sheetOrder:n}=this._snapshot,r=[];return n.forEach(s=>{const i=this._worksheets.get(s);i&&r.push(i.getName())}),r}getSheetIndex(n){const{sheetOrder:r}=this._snapshot;return r.findIndex(s=>n.getSheetId()===s)}getSheetBySheetName(n){const{sheetOrder:r}=this._snapshot,s=r.find(i=>this._worksheets.get(i).getName()===n);return this._worksheets.get(s)}getSheetBySheetId(n){return this._worksheets.get(n)}getSheetByIndex(n){const{sheetOrder:r}=this._snapshot;return this._worksheets.get(r[n])}getHiddenWorksheets(){return this.getSheets().filter(n=>n.getConfig().hidden===Se.TRUE).map(n=>n.getConfig().id)}getUnhiddenWorksheets(){return this.getSheets().filter(n=>n.getConfig().hidden!==Se.TRUE).map(n=>n.getConfig().id)}load(n){this._snapshot=n}checkSheetName(n){return this.getSheetsName().includes(n)}uniqueSheetName(n="Sheet1"){let r=n;for(;this.checkSheetName(r);)r=n+this._count,this._count++;return r}generateNewSheetName(n){let r=n+this._count;for(;this.checkSheetName(r);)r=n+this._count,this._count++;return r}_parseWorksheetSnapshots(){const{_snapshot:n,_worksheets:r}=this,{sheets:s,sheetOrder:i}=n;if(re.isEmptyObject(s)){const o=re.generateRandomId();s[o]={id:o}}for(const o in s){const a=s[o],{name:l}=a;a.name=this.uniqueSheetName(l),a.name!==l&&this._logService.debug("[Workbook]",`The worksheet name ${l} is duplicated, we changed it to ${a.name}. Please fix the problem in your snapshot.`);const c=new dr(this._unitId,a,this._styles);r.set(o,c),i.includes(o)||i.push(o)}this.ensureActiveSheet()}getCustomMetadata(){return this._snapshot.custom}setCustomMetadata(n){this._snapshot.custom=n}};exports.Workbook=RC([IC(1,At)],exports.Workbook);class to extends ys{constructor(n){var r;super();C(this,"type",$e.UNIVER_SLIDE);C(this,"_activePage$",new Oe.BehaviorSubject(null));C(this,"activePage$",this._activePage$.asObservable());C(this,"_name$");C(this,"name$");C(this,"_snapshot");C(this,"_unitId");this._snapshot={...fu,...n},this._unitId=(r=this._snapshot.id)!=null?r:re.generateRandomId(6),this._name$=new Oe.BehaviorSubject(this._snapshot.title),this.name$=this._name$.asObservable()}get _activePage(){var r,s;const n=this._activePage$.getValue();if(!n){const i=(r=this.getPageOrder())==null?void 0:r[0];return i?(s=this.getPages())==null?void 0:s[i]:null}return n}setName(n){var r;this._snapshot.title=n,this._name$.next(n),this._unitId=(r=this._snapshot.id)!=null?r:zt(6)}getRev(){return 0}incrementRev(){}setRev(n){}getSnapshot(){return this._snapshot}getUnitId(){return this._unitId}getPages(){var n;return(n=this._snapshot.body)==null?void 0:n.pages}getPageOrder(){var n;return(n=this._snapshot.body)==null?void 0:n.pageOrder}getPage(n){const r=this.getPages();return r==null?void 0:r[n]}getElementsByPage(n){var r;return(r=this.getPage(n))==null?void 0:r.pageElements}getElement(n,r){var s;return(s=this.getElementsByPage(n))==null?void 0:s[r]}getPageSize(){return this._snapshot.pageSize}getBlankPage(){const n=zt(6);return{id:n,pageType:Ki.SLIDE,zIndex:10,title:n,description:"",pageBackgroundFill:{rgb:"rgb(255,255,255)"},pageElements:{}}}setActivePage(n){this._activePage$.next(n)}getActivePage(){return this._activePage}updatePage(n,r){this._snapshot.body&&(this._snapshot.body.pages[n]=r)}appendPage(n){var i;if(!this._snapshot.body)return;this._snapshot.body.pages[n.id]=n;const r=this._activePage,s=this._snapshot.body.pageOrder.indexOf((i=r==null?void 0:r.id)!=null?i:"");this._snapshot.body.pageOrder.splice(s+1,0,n.id)}}const tr="FOCUSING_UNIT",Tn="FOCUSING_SHEET",nr="FOCUSING_DOC",rr="FOCUSING_SLIDE",yC="FOCUSING_EDITOR_BUT_HIDDEN",xc="EDITOR_ACTIVATED",SC="FOCUSING_EDITOR_INPUT_FORMULA",Lc="FOCUSING_FX_BAR_EDITOR",OC="FOCUSING_UNIVER_EDITOR",bC="FOCUSING_EDITOR_INPUT_FORMULA",wC="FOCUSING_PANEL_EDITOR",AC="FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE",TC="FOCUSING_COMMON_DRAWINGS",NC="FORMULA_EDITOR_ACTIVATED";var MC=Object.defineProperty,DC=Object.getOwnPropertyDescriptor,xC=(e,t,n,r)=>{for(var s=r>1?void 0:r?DC(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&MC(t,n,s),s},ba=(e,t)=>(n,r)=>t(n,r,e);const an=_t("univer.current");exports.UniverInstanceService=class extends nt{constructor(n,r){super();C(this,"_unitsByType",new Map);C(this,"_createHandler");C(this,"_ctorByType",new Map);C(this,"_currentUnits",new Map);C(this,"_currentUnits$",new Oe.BehaviorSubject(this._currentUnits));C(this,"currentUnits$",this._currentUnits$.asObservable());C(this,"_unitAdded$",new Oe.Subject);C(this,"unitAdded$",this._unitAdded$.asObservable());C(this,"_unitDisposed$",new Oe.Subject);C(this,"unitDisposed$",this._unitDisposed$.asObservable());C(this,"_focused$",new Oe.BehaviorSubject(null));C(this,"focused$",this._focused$.asObservable());this._injector=n,this._contextService=r}dispose(){super.dispose(),this._focused$.complete()}__setCreateHandler(n){this._createHandler=n}createUnit(n,r,s){return this._createHandler(n,r,this._ctorByType.get(n),s)}registerCtorForType(n,r){return this._ctorByType.set(n,r),{dispose:()=>{this._ctorByType.delete(n)}}}getCurrentTypeOfUnit$(n){return this.currentUnits$.pipe(Oe.map(r=>{var s;return(s=r.get(n))!=null?s:null}),Oe.distinctUntilChanged())}getCurrentUnitForType(n){return this._currentUnits.get(n)}setCurrentUnitForType(n){const r=this._getUnitById(n);if(!r)throw new Error(`[UniverInstanceService]: no document with unitId ${n}!`);this._currentUnits.set(r[1],r[0]),this._currentUnits$.next(this._currentUnits)}getTypeOfUnitAdded$(n){return this._unitAdded$.pipe(Oe.filter(r=>r.type===n))}__addUnit(n,r){var a;const s=n.type;this._unitsByType.has(s)||this._unitsByType.set(s,[]);const i=this._unitsByType.get(s),o=n.getUnitId();if(i.findIndex(l=>l.getUnitId()===o)!==-1)throw new Error(`[UniverInstanceService]: cannot create a unit with the same unit id: ${o}.`);i.push(n),this._unitAdded$.next(n),((a=r==null?void 0:r.makeCurrent)==null||a)&&this.setCurrentUnitForType(n.getUnitId())}getTypeOfUnitDisposed$(n){return this.unitDisposed$.pipe(Oe.filter(r=>r.type===n))}getUnit(n,r){var i;const s=(i=this._getUnitById(n))==null?void 0:i[0];return r&&(s==null?void 0:s.type)!==r?null:s}getCurrentUniverDocInstance(){return this.getCurrentUnitForType($e.UNIVER_DOC)}getUniverDocInstance(n){return this.getUnit(n,$e.UNIVER_DOC)}getUniverSheetInstance(n){return this.getUnit(n,$e.UNIVER_SHEET)}getAllUnitsForType(n){var r;return(r=this._unitsByType.get(n))!=null?r:[]}changeDoc(n,r){const s=this.getAllUnitsForType($e.UNIVER_DOC),i=s.find(o=>o.getUnitId()===n);if(i!=null){const o=s.indexOf(i);s.splice(o,1)}this.__addUnit(r)}get focused(){var r;const n=this._focused$.getValue();return n?(r=this._getUnitById(n))==null?void 0:r[0]:null}focusUnit(n){this._focused$.next(n),this.focused instanceof exports.Workbook?(this._contextService.setContextValue(tr,!0),this._contextService.setContextValue(nr,!1),this._contextService.setContextValue(Tn,!0),this._contextService.setContextValue(rr,!1),this.setCurrentUnitForType(n)):this.focused instanceof Pt?(this._contextService.setContextValue(tr,!0),this._contextService.setContextValue(nr,!0),this._contextService.setContextValue(Tn,!1),this._contextService.setContextValue(rr,!1),this.setCurrentUnitForType(n)):this.focused instanceof to?(this._contextService.setContextValue(tr,!0),this._contextService.setContextValue(nr,!1),this._contextService.setContextValue(Tn,!1),this._contextService.setContextValue(rr,!0),this.setCurrentUnitForType(n)):(this._contextService.setContextValue(tr,!1),this._contextService.setContextValue(nr,!1),this._contextService.setContextValue(Tn,!1),this._contextService.setContextValue(rr,!1))}getFocusedUnit(){return this.focused}getUnitType(n){const r=this._getUnitById(n);return r?r[1]:$e.UNRECOGNIZED}disposeUnit(n){const r=this._getUnitById(n);if(!r)return!1;const[s,i]=r,o=this._unitsByType.get(i),a=o.indexOf(s);return o.splice(a,1),this._tryRemoveCurrentUnitForType(n,i),this._tryBlurUnitOnRemoval(n),this._unitDisposed$.next(s),!0}_tryRemoveCurrentUnitForType(n,r){const s=this.getCurrentUnitForType(r);(s==null?void 0:s.getUnitId())===n&&(this._currentUnits.set(r,null),this._currentUnits$.next(this._currentUnits))}_tryBlurUnitOnRemoval(n){var r;((r=this.focused)==null?void 0:r.getUnitId())===n&&this._focused$.next(null)}_getUnitById(n){for(const[r,s]of this._unitsByType){const i=s.find(o=>o.getUnitId()===n);if(i)return[i,r]}}};exports.UniverInstanceService=xC([ba(0,it(Ct)),ba(1,_r)],exports.UniverInstanceService);var We=(e=>(e[e.Starting=0]="Starting",e[e.Ready=1]="Ready",e[e.Rendered=2]="Rendered",e[e.Steady=3]="Steady",e))(We||{});const LC={0:"Starting",1:"Ready",2:"Rendered",3:"Steady"};var UC=Object.defineProperty,PC=Object.getOwnPropertyDescriptor,FC=(e,t,n,r)=>{for(var s=r>1?void 0:r?PC(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&UC(t,n,s),s},kC=(e,t)=>(n,r)=>t(n,r,e);exports.LifecycleService=class extends nt{constructor(n){super();C(this,"_lifecycle$",new Oe.BehaviorSubject(We.Starting));C(this,"lifecycle$",this._lifecycle$.asObservable());C(this,"_lock",!1);this._logService=n,this._reportProgress(We.Starting)}get stage(){return this._lifecycle$.getValue()}set stage(n){if(this._lock)throw new Error("[LifecycleService]: cannot set new stage when related logic is all handled!");if(n<this.stage)throw new Error("[LifecycleService]: lifecycle stage cannot go backward!");n!==this.stage&&(this._lock=!0,this._reportProgress(n),this._lifecycle$.next(n),this._lock=!1)}dispose(){this._lifecycle$.complete(),super.dispose()}subscribeWithPrevious(){return Oe.merge(Uc(this.stage),this._lifecycle$.pipe(Oe.skip(1))).pipe(Dl(n=>n===We.Steady))}_reportProgress(n){this._logService.debug("[LifecycleService]",`lifecycle progressed to "${LC[n]}".`)}};exports.LifecycleService=FC([kC(0,At)],exports.LifecycleService);function Uc(e){switch(e){case We.Starting:return Oe.of(We.Starting);case We.Ready:return Oe.of(We.Starting,We.Ready);case We.Rendered:return Oe.of(We.Starting,We.Ready,We.Rendered);default:return Oe.of(We.Starting,We.Ready,We.Rendered,We.Steady)}}var $C=Object.defineProperty,BC=Object.getOwnPropertyDescriptor,jC=(e,t,n,r)=>{for(var s=r>1?void 0:r?BC(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&$C(t,n,s),s},$s=(e,t)=>(n,r)=>t(n,r,e);const en=_t("univer.undo-redo.service"),HC=20;class Pc{dispose(){}async dispatchToHandlers(){return!1}}const Fc="univer.command.redo",kc="univer.command.undo",gn=new class extends Pc{constructor(){super(...arguments);C(this,"type",Wn.COMMAND);C(this,"id",kc)}handler(t){const n=t.get(en),r=n.pitchTopUndoElement();if(!r)return!1;const s=t.get(Dt);return Hi(r.undoMutations,s)?(n.popUndoToRedo(),!0):!1}},pn=new class extends Pc{constructor(){super(...arguments);C(this,"type",Wn.COMMAND);C(this,"id",Fc)}handler(t){const n=t.get(en),r=n.pitchTopRedoElement();if(!r)return!1;const s=t.get(Dt);return Hi(r.redoMutations,s)?(n.popRedoToUndo(),!0):!1}};exports.LocalUndoRedoService=class extends nt{constructor(n,r,s){super();C(this,"undoRedoStatus$");C(this,"_undoRedoStatus$",new Oe.BehaviorSubject({undos:0,redos:0}));C(this,"_undoStacks",new Map);C(this,"_redoStacks",new Map);C(this,"_batchingStatus",new Map);this._univerInstanceService=n,this._commandService=r,this._contextService=s,this.undoRedoStatus$=this._undoRedoStatus$.asObservable(),this.disposeWithMe(this._commandService.registerCommand(gn)),this.disposeWithMe(this._commandService.registerCommand(pn)),this.disposeWithMe(Qe(()=>this._undoRedoStatus$.complete())),this.disposeWithMe(Qe(this._univerInstanceService.focused$.subscribe(()=>this._updateStatus())))}pushUndoRedo(n){const{unitID:r}=n,s=this._getRedoStack(r,!0),i=this._getUndoStack(r,!0);if(s.length=0,this._batchingStatus.has(n.unitID)){const a=this._batchingStatus.get(n.unitID),l=this._pitchUndoElement(n.unitID);a===0||!l?(o(n),this._batchingStatus.set(n.unitID,1)):this._tryBatchingElements(l,n)}else o(n);function o(a){i.push(a),i.length>HC&&i.splice(0,1)}this._updateStatus()}clearUndoRedo(n){const r=this._getRedoStack(n);r&&(r.length=0);const s=this._getUndoStack(n);s&&(s.length=0),this._updateStatus()}pitchTopUndoElement(){const n=this._getFocusedUnitId();return this._pitchUndoElement(n)}pitchTopRedoElement(){const n=this._getFocusedUnitId();return this._pitchRedoElement(n)}_pitchUndoElement(n){const r=this._getUndoStack(n);return r!=null&&r.length?r[r.length-1]:null}_pitchRedoElement(n){const r=this._getRedoStack(n);return r!=null&&r.length?r[r.length-1]:null}popUndoToRedo(){const r=this._getUndoStackForFocused().pop();r&&(this._getRedoStackForFocused().push(r),this._updateStatus())}popRedoToUndo(){const r=this._getRedoStackForFocused().pop();r&&(this._getUndoStackForFocused().push(r),this._updateStatus())}__tempBatchingUndoRedo(n){if(this._batchingStatus.has(n))throw new Error("[LocalUndoRedoService]: cannot batching undo redo twice at the same time!");return this._batchingStatus.set(n,0),Qe(()=>this._batchingStatus.delete(n))}_updateStatus(){var i,o;const n=this._getFocusedUnitId(),r=n&&((i=this._undoStacks.get(n))==null?void 0:i.length)||0,s=n&&((o=this._redoStacks.get(n))==null?void 0:o.length)||0;this._undoRedoStatus$.next({undos:r,redos:s})}_getUndoStack(n,r=!1){let s=this._undoStacks.get(n);return!s&&r&&(s=[],this._undoStacks.set(n,s)),s||null}_getRedoStack(n,r=!1){let s=this._redoStacks.get(n);return!s&&r&&(s=[],this._redoStacks.set(n,s)),s||null}_getUndoStackForFocused(){const n=this._getFocusedUnitId();if(!n)throw new Error("No focused univer instance!");return this._getUndoStack(n,!0)}_getRedoStackForFocused(){const n=this._getFocusedUnitId();if(!n)throw new Error("No focused univer instance!");return this._getRedoStack(n,!0)}_tryBatchingElements(n,r){n.redoMutations.push(...r.redoMutations),n.undoMutations.push(...r.undoMutations)}_getFocusedUnitId(){var o,a,l,c;let n="";const r=this._contextService.getContextValue(Tn),s=this._contextService.getContextValue(Lc),i=this._contextService.getContextValue(xc);return r?s?n=Li:i?n=xi:n=(a=(o=this._univerInstanceService.getFocusedUnit())==null?void 0:o.getUnitId())!=null?a:"":n=(c=(l=this._univerInstanceService.getFocusedUnit())==null?void 0:l.getUnitId())!=null?c:"",n}};exports.LocalUndoRedoService=jC([$s(0,an),$s(1,Dt),$s(2,_r)],exports.LocalUndoRedoService);const bs=_t("core.resource-manager.service"),mi={[Mt.Editor]:"Editor",[Mt.Owner]:"Owner",[Mt.Reader]:"Reader",[Mt.UNRECOGNIZED]:"UNRECOGNIZED"},us=e=>e?{userID:`${mi[e]}_${re.generateRandomId(8)}`,name:mi[e],avatar:""}:{userID:"",name:"",avatar:"",anonymous:!0,canBindAnonymous:!1},WC=(e,t)=>e.startsWith(mi[t]);class $n{constructor(){C(this,"_model",new Map);C(this,"_userChange$",new Oe.Subject);C(this,"userChange$",this._userChange$.asObservable());C(this,"_currentUser$",new Oe.BehaviorSubject(us()));C(this,"currentUser$",this._currentUser$.asObservable())}getCurrentUser(){return this._currentUser$.getValue()}setCurrentUser(t){this.addUser(t),this._currentUser$.next(t)}addUser(t){this._model.set(t.userID,t),this._userChange$.next({type:"add",user:t})}getUser(t,n){const r=this._model.get(t);if(r)return r;n&&n()}delete(t){const n=this.getUser(t);this._model.delete(t),n&&this._userChange$.next({type:"delete",user:n})}clear(){this._model.clear(),this._userChange$.next({type:"clear"})}list(){return Array.from(this._model.values())}}var zC=Object.defineProperty,YC=Object.getOwnPropertyDescriptor,VC=(e,t,n,r)=>{for(var s=r>1?void 0:r?YC(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&zC(t,n,s),s},wa=(e,t)=>(n,r)=>t(n,r,e);exports.AuthzIoLocalService=class{constructor(t,n){C(this,"_permissionMap",new Map([]));this._resourceManagerService=t,this._userManagerService=n,this._initSnapshot(),this._initDefaultUser()}_initDefaultUser(){const t=this._userManagerService.getCurrentUser();t&&t.userID||this._userManagerService.setCurrentUser(us(Mt.Owner))}_getRole(t){const n=this._userManagerService.getCurrentUser();return n?WC(n.userID,t):!1}_initSnapshot(){this._resourceManagerService.registerPluginResource({toJson:t=>{const n=[...this._permissionMap.keys()].reduce((r,s)=>{const i=this._permissionMap.get(s);return r[s]=i,r},{});return JSON.stringify(n)},parseJson:t=>JSON.parse(t),pluginName:"SHEET_AuthzIoMockService_PLUGIN",businesses:[$e.UNIVER_SHEET,$e.UNIVER_DOC,$e.UNIVER_SLIDE],onLoad:(t,n)=>{for(const r in n)this._permissionMap.set(r,n[r])},onUnLoad:()=>{this._permissionMap.clear()}})}async create(t){return zt(8)}async allowed(t){return Promise.resolve([])}async batchAllowed(t){return Promise.resolve([])}async list(t){const n=[];return t.objectIDs.forEach(r=>{const s=this._permissionMap.get(r);if(s){const i={objectID:r,unitID:t.unitID,objectType:s.objectType,name:s.name,shareOn:!1,shareRole:Mt.Owner,shareScope:-1,scope:{read:ci.AllCollaborator,edit:ci.AllCollaborator},creator:us(Mt.Owner),strategies:[{action:6,role:1},{action:16,role:1},{action:17,role:1},{action:18,role:1},{action:19,role:1},{action:33,role:1},{action:34,role:1},{action:35,role:1},{action:36,role:1},{action:37,role:1},{action:38,role:1},{action:39,role:1},{action:40,role:1}],actions:t.actions.map(o=>({action:o,allowed:this._getRole(Mt.Owner)||this._getRole(Mt.Editor)}))};n.push(i)}}),n}async listCollaborators(){return[]}async listRoles(){return{roles:[],actions:[]}}async deleteCollaborator(){}async update(t){}async updateCollaborator(){}async createCollaborator(){}async putCollaborators(t){}};exports.AuthzIoLocalService=VC([wa(0,bs),wa(1,it($n))],exports.AuthzIoLocalService);const $c=_t("IAuthzIoIoService"),Bc=_t("univer.config-service");class jc{constructor(){C(this,"_configChanged$",new Oe.Subject);C(this,"configChanged$",this._configChanged$.asObservable());C(this,"_config",new Map)}dispose(){this._configChanged$.complete()}getConfig(t){return this._config.get(t)}setConfig(t,n,r){var o;const{merge:s=!1}=r||{};let i=(o=this._config.get(t))!=null?o:{};s?i=Di(i,n):i=n,this._config.set(t,i),this._configChanged$.next({[t]:i})}deleteConfig(t){return this._config.delete(t)}subscribeConfigValue$(t){return new Oe.Observable(n=>{Object.prototype.hasOwnProperty.call(this._config,t)&&n.next(this._config.get(t));const r=this.configChanged$.pipe(Oe.filter(s=>Object.prototype.hasOwnProperty.call(s,t))).subscribe(s=>n.next(s[t]));return()=>r.unsubscribe()})}}class Hc extends nt{constructor(){super(...arguments);C(this,"_error$",new Oe.Subject);C(this,"error$",this._error$.asObservable())}dispose(){this._error$.complete()}emit(n){this._error$.next({errorKey:n})}}class lr extends nt{constructor(){super();C(this,"_currentLocale$",new Oe.BehaviorSubject(Er.ZH_CN));C(this,"currentLocale$",this._currentLocale$.asObservable());C(this,"_locales",null);C(this,"localeChanged$",new Oe.Subject);C(this,"t",(n,...r)=>{if(!this._locales)throw new Error("[LocaleService]: Locale not initialized");const s=n.split("."),i=this.resolveKeyPath(this._locales[this._currentLocale],s);if(typeof i=="string"){let o=i;return r.forEach((a,l)=>{o=o.replace(`{${l}}`,a)}),o}else return n});this.disposeWithMe(Qe(()=>this.localeChanged$.complete()))}get _currentLocale(){return this._currentLocale$.value}load(n){var r;this._locales=Di((r=this._locales)!=null?r:{},n)}setLocale(n){this._currentLocale$.next(n),this.localeChanged$.next()}getLocales(){var n;return(n=this._locales)==null?void 0:n[this._currentLocale]}getCurrentLocale(){return this._currentLocale}resolveKeyPath(n,r){const s=r.shift();if(s&&n&&s in n){const i=n[s];return r.length>0&&(typeof i=="object"||Array.isArray(i))?this.resolveKeyPath(i,r):i}return null}}var GC=Object.defineProperty,KC=Object.getOwnPropertyDescriptor,XC=(e,t,n,r)=>{for(var s=r>1?void 0:r?KC(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&GC(t,n,s),s},QC=(e,t)=>(n,r)=>t(n,r,e);exports.MentionIOLocalService=class{constructor(t){this._userManagerService=t}async list(t){return{list:[{type:rs.PERSON,mentions:[{objectType:rs.PERSON,objectId:this._userManagerService.getCurrentUser().userID,label:this._userManagerService.getCurrentUser().name,metadata:{icon:this._userManagerService.getCurrentUser().avatar}}],metadata:{},title:"PEOPLE"}],page:t.page,size:t.size,total:1}}};exports.MentionIOLocalService=XC([QC(0,it($n))],exports.MentionIOLocalService);const Wc=_t("univer.service.mention-io");var no=(e=>(e.INIT="init",e.FETCHING="fetching",e.DONE="done",e))(no||{});const zc=_t("univer.permission-service");class Yc extends nt{constructor(){super(...arguments);C(this,"_permissionPointMap",new Map);C(this,"_permissionPointUpdate$",new Oe.Subject);C(this,"permissionPointUpdate$",this._permissionPointUpdate$.asObservable());C(this,"_showComponents",!0)}setShowComponents(n){this._showComponents=n}getShowComponents(){return this._showComponents}deletePermissionPoint(n){const r=this._permissionPointMap.get(n);r&&(r.complete(),this._permissionPointMap.delete(n))}addPermissionPoint(n){const r=n instanceof Oe.BehaviorSubject,s=r?n.getValue():n;if(!s.id)return!1;if(this._permissionPointMap.get(s.id))throw new Error(`${s.id} PermissionPoint already exists`);return this._permissionPointMap.set(s.id,r?n:new Oe.BehaviorSubject(s)),this._permissionPointUpdate$.next(s),!0}updatePermissionPoint(n,r){const s=this._permissionPointMap.get(n);if(!s)return;const i=s.getValue();i.value=r,i.status=no.DONE,s.next(i),this._permissionPointUpdate$.next(i)}clearPermissionMap(){this._permissionPointMap.clear()}getPermissionPoint(n){const r=this._permissionPointMap.get(n);if(r)return r.getValue()}getPermissionPoint$(n){const r=this._permissionPointMap.get(n);if(r)return r}composePermission$(n){const r=n.map(s=>{var o;const i=(o=this._permissionPointMap)==null?void 0:o.get(s);if(!i)throw new Error(`[PermissionService]: ${s} permissionPoint does not exist!`);return i.asObservable()});return Oe.combineLatest(r).pipe($r.map(s=>s))}composePermission(n){return n.map(s=>{var o;const i=(o=this._permissionPointMap)==null?void 0:o.get(s);if(!i)throw new Error(`[PermissionService]: ${s} permissionPoint does not exist!`);return i.getValue()})}getAllPermissionPoint(){const n=new Map;return this._permissionPointMap.forEach((r,s)=>{n.set(s,r)}),n}}function Vc(e,t){if(!t)return e;const n=[];for(const r of e){const s=t.find(([i])=>i===r[0]);if(s){if(s[1]===null)continue;n.push([r[0],s[1]])}else n.push(r)}return n}const Gc=Symbol("DependentOn");class _i extends nt{onStarting(){}onReady(){}onRendered(){}onSteady(){}getUniverInstanceType(){return this.constructor.type}getPluginName(){return this.constructor.pluginName}}C(_i,"pluginName"),C(_i,"type",$e.UNIVER_UNKNOWN);class qC{constructor(){C(this,"_plugins",[])}addPlugin(t){this._plugins.push(t)}removePlugins(){const t=this._plugins.slice();return this._plugins.length=0,t}forEachPlugin(t){this._plugins.forEach(t)}}class JC{constructor(){C(this,"_pluginsRegistered",[])}registerPlugin(t,n){this._pluginsRegistered.push({plugin:t,options:n})}getRegisterPlugins(){return this._pluginsRegistered.slice()}removePlugins(){this._pluginsRegistered=[]}}var ZC=Object.defineProperty,eR=Object.getOwnPropertyDescriptor,Kc=(e,t,n,r)=>{for(var s=r>1?void 0:r?eR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&ZC(t,n,s),s},Zr=(e,t)=>(n,r)=>t(n,r,e);const tR=4;function nR(...e){return function(t){t[Gc]=e}}exports.PluginService=class{constructor(t){C(this,"_pluginHolderForUniver");C(this,"_pluginHoldersForTypes",new Map);C(this,"_seenPlugins",new Set);C(this,"_flushTimer");this._injector=t,this._pluginHolderForUniver=this._injector.createInstance(cs,this._checkPluginSeen.bind(this),this._immediateInitPlugin.bind(this)),this._pluginHoldersForTypes.set($e.UNIVER_UNKNOWN,this._pluginHolderForUniver),this._pluginHolderForUniver.start()}dispose(){this._clearFlushTimer();for(const t of this._pluginHoldersForTypes.values())t.dispose();this._pluginHolderForUniver.dispose()}registerPlugin(t,n){this._assertPluginValid(t),this._scheduleInitPlugin();const{type:r}=t;r===$e.UNIVER_UNKNOWN?(this._pluginHolderForUniver.register(t,n),this._pluginHolderForUniver.flush()):this._ensurePluginHolderForType(r).register(t,n)}startPluginForType(t){this._ensurePluginHolderForType(t).start()}_ensurePluginHolderForType(t){if(!this._pluginHoldersForTypes.has(t)){const n=this._injector.createInstance(cs,this._checkPluginSeen.bind(this),this._immediateInitPlugin.bind(this));return this._pluginHoldersForTypes.set(t,n),n}return this._pluginHoldersForTypes.get(t)}_immediateInitPlugin(t){this._seenPlugins.add(t.pluginName),this._ensurePluginHolderForType(t.type).immediateInitPlugin(t)}_checkPluginSeen(t){return this._seenPlugins.has(t.pluginName)}_assertPluginValid(t){const{type:n,pluginName:r}=t;if(n===$e.UNRECOGNIZED)throw new Error(`[PluginService]: invalid plugin type for ${t.name}. Please assign a "type" to your plugin.`);if(!r)throw new Error(`[PluginService]: no plugin name for ${t.name}. Please assign a "pluginName" to your plugin.`);if(this._seenPlugins.has(r))throw new Error(`[PluginService]: duplicated plugin name for "${r}". Maybe a plugin that dependents on "${r} has already registered it. In that case please register "${r}" before the that plugin.`);this._seenPlugins.add(t.pluginName)}_scheduleInitPlugin(){this._flushTimer===void 0&&(this._flushTimer=setTimeout(()=>{this._pluginHolderForUniver.started||this._pluginHolderForUniver.start(),this._flushPlugins(),this._clearFlushTimer()},tR))}_clearFlushTimer(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)}_flushPlugins(){this._pluginHolderForUniver.flush();for(const[t,n]of this._pluginHoldersForTypes)n.started&&n.flush()}};exports.PluginService=Kc([Zr(0,it(Ct))],exports.PluginService);let cs=class extends nt{constructor(t,n,r,s,i){super();C(this,"_started",!1);C(this,"_warnedAboutOnStartingDeprecation",!1);C(this,"_pluginRegistry",new JC);C(this,"_pluginStore",new qC);C(this,"_pluginsInBatches",[]);this._checkPluginRegistered=t,this._registerPlugin=n,this._logService=r,this._injector=s,this._lifecycleService=i,this.disposeWithMe(this._lifecycleService.lifecycle$.pipe(Oe.skip(1)).subscribe(o=>{this._pluginsInBatches.forEach(a=>this._runStage(a,o))}))}get started(){return this._started}dispose(){super.dispose(),this._pluginStore.forEachPlugin(t=>t.dispose()),this._pluginStore.removePlugins(),this._pluginRegistry.removePlugins(),this._pluginsInBatches.length=0}register(t,n){this._pluginRegistry.registerPlugin(t,n)}immediateInitPlugin(t){const n=this._initPlugin(t,void 0);this._pluginsRunLifecycle([n])}start(){this._started||(this._started=!0,this.flush())}flush(){if(!this._started)return;const t=this._pluginRegistry.getRegisterPlugins().map(({plugin:n,options:r})=>this._initPlugin(n,r));t.length&&(this._pluginsRunLifecycle(t),this._pluginRegistry.removePlugins())}_initPlugin(t,n){const r=t[Gc];if(r){const i=()=>{const o=r.find(a=>!this._checkPluginRegistered(a));return o?(this._logService.debug("[PluginService]",`Plugin "${t.pluginName}" depends on "${o.pluginName}" which is not registered. Univer will automatically register it with default configuration.`),this._registerPlugin(o,void 0),!0):!1};for(;i(););}const s=this._injector.createInstance(t,n);return this._pluginStore.addPlugin(s),this._logService.debug("[PluginService]",`Plugin "${s.getPluginName()}" registered.`),s}_pluginsRunLifecycle(t){Uc(this._lifecycleService.stage).subscribe(n=>this._runStage(t,n)),this._pluginsInBatches.push(t)}_runStage(t,n){t.forEach(r=>{switch(n){case We.Starting:r.onStarting();break;case We.Ready:r.onReady();break;case We.Rendered:r.onRendered();break;case We.Steady:r.onSteady();break}})}};cs=Kc([Zr(2,At),Zr(3,it(Ct)),Zr(4,it(exports.LifecycleService))],cs);var rR=Object.defineProperty,sR=Object.getOwnPropertyDescriptor,iR=(e,t,n,r)=>{for(var s=r>1?void 0:r?sR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&rR(t,n,s),s},Aa=(e,t)=>(n,r)=>t(n,r,e);let Ei=class extends nt{constructor(e,t){super(),this._resourceManagerService=e,this._univerInstanceService=t,this._init()}_init(){const e=n=>{n.businesses.forEach(r=>{switch(r){case $e.UNRECOGNIZED:case $e.UNIVER_UNKNOWN:case $e.UNIVER_SLIDE:case $e.UNIVER_DOC:{this._univerInstanceService.getAllUnitsForType($e.UNIVER_DOC).forEach(s=>{const o=(s.getSnapshot().resources||[]).find(a=>a.name===n.pluginName);if(o)try{const a=n.parseJson(o.data);n.onLoad(s.getUnitId(),a)}catch{console.error(`Load Document{${s.getUnitId()}} Resources{${n.pluginName}} Data Error.`)}});break}case $e.UNIVER_SHEET:this._univerInstanceService.getAllUnitsForType($e.UNIVER_SHEET).forEach(s=>{const o=(s.getSnapshot().resources||[]).find(a=>a.name===n.pluginName);if(o)try{const a=n.parseJson(o.data);n.onLoad(s.getUnitId(),a)}catch{console.error(`Load Workbook{${s.getUnitId()}} Resources{${n.pluginName}} Data Error.`)}})}})};this._resourceManagerService.getAllResourceHooks().forEach(n=>e(n)),this.disposeWithMe(this._resourceManagerService.register$.subscribe(n=>e(n))),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$($e.UNIVER_SHEET).subscribe(n=>{this._resourceManagerService.loadResources(n.getUnitId(),n.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$($e.UNIVER_DOC).subscribe(n=>{const r=n.getUnitId();il(r)||this._resourceManagerService.loadResources(n.getUnitId(),n.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$($e.UNIVER_SHEET).subscribe(n=>{this._resourceManagerService.unloadResources(n.getUnitId())})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$($e.UNIVER_DOC).subscribe(n=>{this._resourceManagerService.unloadResources(n.getUnitId())}))}saveUnit(e){const t=this._univerInstanceService.getUnit(e);if(!t)return null;const n=this._resourceManagerService.getResources(e,t.type),r=re.deepClone(t.getSnapshot());return r.resources=n,r}};Ei=iR([Aa(0,it(bs)),Aa(1,it(an))],Ei);const Ci=_t("resource-loader-service");class Xc extends nt{constructor(){super(...arguments);C(this,"_resourceMap",new Map);C(this,"_register$",new Oe.Subject);C(this,"register$",this._register$.asObservable())}getAllResourceHooks(){return[...this._resourceMap.values()]}getResources(n,r){return r?this.getResourcesByType(n,r):this.getAllResourceHooks().map(o=>{const a=o.toJson(n);return{name:o.pluginName,data:a}})}getResourcesByType(n,r){return this.getAllResourceHooks().filter(o=>o.businesses.includes(r)).map(o=>{const a=o.toJson(n);return{name:o.pluginName,data:a}})}registerPluginResource(n){const r=n.pluginName;if(this._resourceMap.has(r))throw new Error(`the pluginName is registered {${r}}`);return this._resourceMap.set(r,n),this._register$.next(n),Qe(()=>this._resourceMap.delete(r))}disposePluginResource(n){this._resourceMap.delete(n)}loadResources(n,r){this.getAllResourceHooks().forEach(s=>{var o;const i=(o=r==null?void 0:r.find(a=>a.name===s.pluginName))==null?void 0:o.data;if(i)try{const a=s.parseJson(i);s.onLoad(n,a)}catch{console.error("LoadResources Error!")}})}unloadResources(n){this.getAllResourceHooks().forEach(r=>{r.onUnLoad(n)})}dispose(){this._register$.complete(),this._resourceMap.clear()}}class ro extends nt{constructor(){super();C(this,"_currentTheme");C(this,"_currentTheme$",new Oe.BehaviorSubject({}));C(this,"currentTheme$",this._currentTheme$.asObservable());this.disposeWithMe(Qe(()=>this._currentTheme$.complete()))}getCurrentTheme(){if(!this._currentTheme)throw new Error("[ThemeService]: current theme is not set!");return this._currentTheme}setTheme(n){this._currentTheme=n,this._currentTheme$.next(n)}}class Qc{constructor(t={},n){C(this,"_startedTypes",new Set);C(this,"_injector");C(this,"_disposingCallbacks",new Rs);const r=this._injector=oR(n,t==null?void 0:t.override),{theme:s,locale:i,locales:o,logLevel:a}=t;s&&this._injector.get(ro).setTheme(s),o&&this._injector.get(lr).load(o),i&&this._injector.get(lr).setLocale(i),a&&this._injector.get(At).setLogLevel(a),this._init(r)}get _univerInstanceService(){return this._injector.get(an)}get _pluginService(){return this._injector.get(exports.PluginService)}__getInjector(){return this._injector}onDispose(t){const n=this._disposingCallbacks.add(Qe(t));return Qe(()=>n.dispose(!0))}dispose(){this._disposingCallbacks.dispose(),this._injector.dispose()}setLocale(t){this._injector.get(lr).setLocale(t)}createUnit(t,n){return this._univerInstanceService.createUnit(t,n)}createUniverSheet(t){return this._injector.get(At).warn("[Univer]: Univer.createUniverSheet is deprecated, use createUnit instead"),this._univerInstanceService.createUnit($e.UNIVER_SHEET,t)}createUniverDoc(t){return this._injector.get(At).warn("[Univer]: Univer.createUniverDoc is deprecated, use createUnit instead"),this._univerInstanceService.createUnit($e.UNIVER_DOC,t)}createUniverSlide(t){return this._injector.get(At).warn("[Univer]: Univer.createUniverSlide is deprecated, use createUnit instead"),this._univerInstanceService.createUnit($e.UNIVER_SLIDE,t)}_init(t){this._univerInstanceService.registerCtorForType($e.UNIVER_SHEET,exports.Workbook),this._univerInstanceService.registerCtorForType($e.UNIVER_DOC,Pt),this._univerInstanceService.registerCtorForType($e.UNIVER_SLIDE,to);const n=t.get(an);n.__setCreateHandler((r,s,i,o)=>{if(!this._startedTypes.has(r)){this._pluginService.startPluginForType(r),this._startedTypes.add(r);const l=t.createInstance(i,s);return n.__addUnit(l,o),this._tryProgressToReady(),l}const a=t.createInstance(i,s);return n.__addUnit(a,o),a})}_tryProgressToReady(){this._injector.get(exports.LifecycleService).stage<We.Ready&&(this._injector.get(exports.LifecycleService).stage=We.Ready)}registerPlugin(t,n){this._pluginService.registerPlugin(t,n)}}function oR(e,t){const n=Vc([[Hc],[lr],[ro],[exports.LifecycleService],[exports.PluginService],[$n],[an,{useClass:exports.UniverInstanceService}],[zc,{useClass:Yc}],[At,{useClass:Tl,lazy:!0}],[Dt,{useClass:exports.CommandService}],[en,{useClass:exports.LocalUndoRedoService,lazy:!0}],[Bc,{useClass:jc}],[_r,{useClass:wl}],[bs,{useClass:Xc,lazy:!0}],[Ci,{useClass:Ei,lazy:!0}],[$c,{useClass:exports.AuthzIoLocalService,lazy:!0}],[Wc,{useClass:exports.MentionIOLocalService,lazy:!0}]],t),r=e?e.createChild(n):new Ct(n);return Il(r,[[$n],[Ci]]),r}var aR=Object.defineProperty,lR=Object.getOwnPropertyDescriptor,uR=(e,t,n,r)=>{for(var s=r>1?void 0:r?lR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&aR(t,n,s),s},cR=(e,t)=>(n,r)=>t(n,r,e);exports.FBlob=class extends Ss{constructor(t,n){super(),this._blob=t,this._injector=n}copyBlob(){return this._injector.createInstance(exports.FBlob,this._blob)}getAs(t){const n=this.copyBlob();return n.setContentType(t),n}getDataAsString(t){return this._blob===null?Promise.resolve(""):t===void 0?this._blob.text():new Promise((n,r)=>{this._blob.arrayBuffer().then(s=>{const i=new TextDecoder(t).decode(s);n(i)}).catch(s=>{r(new Error(`Failed to read Blob as ArrayBuffer: ${s.message}`))})})}getBytes(){return this._blob?this._blob.arrayBuffer().then(t=>new Uint8Array(t)):Promise.reject(new Error("Blob is undefined or null."))}setBytes(t){return this._blob=new Blob([t]),this}setDataFromString(t,n){const r=n!=null?n:"text/plain",s=new Blob([t],{type:r});return this._blob=s,this}getContentType(){var t;return(t=this._blob)==null?void 0:t.type}setContentType(t){var n;return this._blob=(n=this._blob)==null?void 0:n.slice(0,this._blob.size,t),this}};exports.FBlob=uR([cR(1,it(Ct))],exports.FBlob);var hR=Object.defineProperty,dR=Object.getOwnPropertyDescriptor,fR=(e,t,n,r)=>{for(var s=r>1?void 0:r?dR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&hR(t,n,s),s},gR=(e,t)=>(n,r)=>t(n,r,e);let Ri=class extends Zi{constructor(e,t){super(t),this.doc=e}};Ri=fR([gR(1,it(Ct))],Ri);var so=(e=>(e[e.INFO=0]="INFO",e[e.STOP=1]="STOP",e[e.WARNING=2]="WARNING",e))(so||{}),io=(e=>(e.BETWEEN="between",e.EQUAL="equal",e.GREATER_THAN="greaterThan",e.GREATER_THAN_OR_EQUAL="greaterThanOrEqual",e.LESS_THAN="lessThan",e.LESS_THAN_OR_EQUAL="lessThanOrEqual",e.NOT_BETWEEN="notBetween",e.NOT_EQUAL="notEqual",e))(io||{}),oo=(e=>(e[e.TEXT=0]="TEXT",e[e.ARROW=1]="ARROW",e[e.CUSTOM=2]="CUSTOM",e))(oo||{}),ao=(e=>(e.VALID="valid",e.INVALID="invalid",e.VALIDATING="validating",e))(ao||{}),lo=(e=>(e.CUSTOM="custom",e.LIST="list",e.LIST_MULTIPLE="listMultiple",e.NONE="none",e.TEXT_LENGTH="textLength",e.DATE="date",e.TIME="time",e.WHOLE="whole",e.DECIMAL="decimal",e.CHECKBOX="checkbox",e.ANY="any",e))(lo||{});const Dn=class Dn{static get(){if(this._instance)return this._instance;const t=new Dn;return this._instance=t,t}static extend(t){Object.getOwnPropertyNames(t.prototype).forEach(n=>{n!=="constructor"&&(this.prototype[n]=t.prototype[n])}),Object.getOwnPropertyNames(t).forEach(n=>{n!=="prototype"&&n!=="name"&&n!=="length"&&(this[n]=t[n])})}constructor(){for(const t in Dn.prototype)this[t]=Dn.prototype[t]}get UniverInstanceType(){return $e}get LifecycleStages(){return We}get DataValidationType(){return lo}get DataValidationErrorStyle(){return so}get DataValidationRenderMode(){return oo}get DataValidationOperator(){return io}get DataValidationStatus(){return ao}get CommandType(){return Wn}get BaselineOffset(){return Ut}get BooleanNumber(){return Se}get HorizontalAlign(){return $t}get TextDecoration(){return Wi}get TextDirection(){return Pn}get VerticalAlign(){return tn}};C(Dn,"_instance");let hs=Dn;const xn=class xn{static get(){if(this._instance)return this._instance;const t=new xn;return this._instance=t,t}static extend(t){Object.getOwnPropertyNames(t.prototype).forEach(n=>{n!=="constructor"&&(this.prototype[n]=t.prototype[n])}),Object.getOwnPropertyNames(t).forEach(n=>{n!=="prototype"&&n!=="name"&&n!=="length"&&(this[n]=t[n])})}constructor(){for(const t in xn.prototype)this[t]=xn.prototype[t]}get DocCreated(){return"DocCreated"}get DocDisposed(){return"DocDisposed"}get LifeCycleChanged(){return"LifeCycleChanged"}get Redo(){return"Redo"}get Undo(){return"Undo"}get BeforeRedo(){return"BeforeRedo"}get BeforeUndo(){return"BeforeUndo"}get CommandExecuted(){return"CommandExecuted"}get BeforeCommandExecute(){return"BeforeCommandExecute"}};C(xn,"_instance");let ds=xn;var pR=Object.defineProperty,mR=Object.getOwnPropertyDescriptor,_R=(e,t,n,r)=>{for(var s=r>1?void 0:r?mR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&pR(t,n,s),s},Ta=(e,t)=>(n,r)=>t(n,r,e);exports.FHooks=class extends Ss{constructor(t,n){super(),this._injector=t,this._lifecycleService=n}onStarting(t){return Qe(this._lifecycleService.lifecycle$.pipe(Oe.filter(n=>n===We.Starting)).subscribe(t))}onReady(t){return Qe(this._lifecycleService.lifecycle$.pipe(Oe.filter(n=>n===We.Ready)).subscribe(t))}onRendered(t){return Qe(this._lifecycleService.lifecycle$.pipe(Oe.filter(n=>n===We.Rendered)).subscribe(t))}onSteady(t){return Qe(this._lifecycleService.lifecycle$.pipe(Oe.filter(n=>n===We.Steady)).subscribe(t))}onBeforeUndo(t){return this._injector.get(Dt).beforeCommandExecuted(r=>{if(r.id===gn.id){const i=this._injector.get(en).pitchTopUndoElement();i&&t(i)}})}onUndo(t){return this._injector.get(Dt).onCommandExecuted(r=>{if(r.id===gn.id){const i=this._injector.get(en).pitchTopUndoElement();i&&t(i)}})}onBeforeRedo(t){return this._injector.get(Dt).beforeCommandExecuted(r=>{if(r.id===pn.id){const i=this._injector.get(en).pitchTopRedoElement();i&&t(i)}})}onRedo(t){return this._injector.get(Dt).onCommandExecuted(r=>{if(r.id===pn.id){const i=this._injector.get(en).pitchTopRedoElement();i&&t(i)}})}};exports.FHooks=_R([Ta(0,it(Ct)),Ta(1,it(exports.LifecycleService))],exports.FHooks);var ER=Object.defineProperty,CR=Object.getOwnPropertyDescriptor,RR=(e,t,n,r)=>{for(var s=r>1?void 0:r?CR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&ER(t,n,s),s},Na=(e,t)=>(n,r)=>t(n,r,e);let Ii=class extends Ss{constructor(e,t){super(),this._injector=e,this._userManagerService=t}getCurrentUser(){return this._userManagerService.getCurrentUser()}};Ii=RR([Na(0,it(Ct)),Na(1,it($n))],Ii);const gs=class gs{static get(){if(this._instance)return this._instance;const t=new gs;return this._instance=t,t}static extend(t){Object.getOwnPropertyNames(t.prototype).forEach(n=>{n!=="constructor"&&(this.prototype[n]=t.prototype[n])}),Object.getOwnPropertyNames(t).forEach(n=>{n!=="prototype"&&n!=="name"&&n!=="length"&&(this[n]=t[n])})}get rectangle(){return Yt}get numfmt(){return du}get tools(){return re}};C(gs,"_instance");let fs=gs;var IR=Object.defineProperty,vR=Object.getOwnPropertyDescriptor,yR=(e,t,n,r)=>{for(var s=r>1?void 0:r?vR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(t,n,s):o(s))||s);return r&&s&&IR(t,n,s),s},Pr=(e,t)=>(n,r)=>t(n,r,e);exports.FUniver=class extends Zi{constructor(n,r,s,i){super(n);C(this,"_eventRegistry",new Map);this._injector=n,this._commandService=r,this._univerInstanceService=s,this._lifecycleService=i,this.disposeWithMe(this._lifecycleService.lifecycle$.subscribe(o=>{this.fireEvent(this.Event.LifeCycleChanged,{stage:o})})),this.disposeWithMe(this._commandService.beforeCommandExecuted(o=>{if(!this._eventRegistry.get(this.Event.BeforeRedo)&&!this._eventRegistry.get(this.Event.BeforeUndo)&&!this._eventRegistry.get(this.Event.BeforeCommandExecute))return;const{id:a,type:l,params:c}=o,u={id:a,type:l,params:c};switch(o.id){case pn.id:this.fireEvent(this.Event.BeforeRedo,u);break;case gn.id:this.fireEvent(this.Event.BeforeUndo,u);break;default:this.fireEvent(this.Event.BeforeCommandExecute,u);break}if(u.cancel)throw new yl})),this.disposeWithMe(this._commandService.onCommandExecuted(o=>{if(!this._eventRegistry.get(this.Event.Redo)&&!this._eventRegistry.get(this.Event.Undo)&&!this._eventRegistry.get(this.Event.CommandExecuted))return;const{id:a,type:l,params:c}=o,u={id:a,type:l,params:c};switch(o.id){case pn.id:this.fireEvent(this.Event.Redo,u);break;case gn.id:this.fireEvent(this.Event.Undo,u);break;default:this.fireEvent(this.Event.CommandExecuted,u);break}})),this._initUnitEvent(this._injector),this._injector.onDispose(()=>{this.dispose()})}static newAPI(n){return(n instanceof Qc?n.__getInjector():n).createInstance(exports.FUniver)}_ensureEventRegistry(n){return this._eventRegistry.has(n)||this._eventRegistry.set(n,new Os),this._eventRegistry.get(n)}_initUnitEvent(n){const r=n.get(an);this.disposeWithMe(r.unitDisposed$.subscribe(s=>{this._eventRegistry.get(this.Event.DocDisposed)&&s.type===$e.UNIVER_DOC&&this.fireEvent(this.Event.DocDisposed,{unitId:s.getUnitId(),unitType:s.type,snapshot:s.getSnapshot()})})),this.disposeWithMe(r.unitAdded$.subscribe(s=>{if(this._eventRegistry.get(this.Event.DocCreated)&&s.type===$e.UNIVER_DOC){const i=s,o=n.createInstance(Ri,i);this.fireEvent(this.Event.DocCreated,{unitId:s.getUnitId(),type:s.type,doc:o,unit:o})}}))}_eventListend(n){return this._eventRegistry.get(n)}disposeUnit(n){return this._univerInstanceService.disposeUnit(n)}getCurrentLifecycleStage(){return this._injector.get(exports.LifecycleService).stage}undo(){return this._commandService.executeCommand(gn.id)}redo(){return this._commandService.executeCommand(pn.id)}onBeforeCommandExecute(n){return this._commandService.beforeCommandExecuted((r,s)=>{n(r,s)})}onCommandExecuted(n){return this._commandService.onCommandExecuted((r,s)=>{n(r,s)})}executeCommand(n,r,s){return this._commandService.executeCommand(n,r,s)}syncExecuteCommand(n,r,s){return this._commandService.syncExecuteCommand(n,r,s)}getHooks(){return this._injector.createInstance(exports.FHooks)}get Enum(){return hs.get()}get Event(){return ds.get()}get Util(){return fs.get()}addEvent(n,r){return this._ensureEventRegistry(n).add(r),Qe(()=>this._ensureEventRegistry(n).delete(r))}fireEvent(n,r){var s;return(s=this._eventRegistry.get(n))==null||s.getData().forEach(i=>{i(r)}),r.cancel}hasEventCallback(n){var s,i;return((i=(s=this._eventRegistry.get(n))==null?void 0:s.getData().length)!=null?i:0)>0}getUserManager(){return this._injector.createInstance(Ii)}newBlob(){return this._injector.createInstance(exports.FBlob)}newColor(){return new Cr}newRichText(n){return sn.create(n)}newRichTextValue(n){return jt.create(n)}newParagraphStyle(n){return kn.create(n)}newParagraphStyleValue(n){return Vn.create(n)}newTextStyle(n){return Wt.create(n)}newTextStyleValue(n){return Yn.create(n)}newTextDecoration(n){return new Bt(n)}};exports.FUniver=yR([Pr(0,it(Ct)),Pr(1,Dt),Pr(2,an),Pr(3,it(exports.LifecycleService))],exports.FUniver);function qc(e){return/^-?\d+(\.\d+)?$/.test(e)}function SR(e){return qc(e)?Number(e)<=Number.MAX_SAFE_INTEGER:!1}function OR(e){const t=new MessageChannel;let n=!1;const r=()=>{n||e()};return t.port1.onmessage=r,t.port2.postMessage(null),()=>{n=!0,t.port1.close(),t.port2.close()}}function bR(e,t){return t.forEach(n=>e.add(n)),e}function wR(e,t,n,r){var c;if(t==="")return e;const s={id:"mock-id",body:e,documentStyle:{}},i=new Pt(s),o=t.length;let a;for(;(a=(r?i.getBody().dataStream:i.getBody().dataStream.toLowerCase()).indexOf(t))>=0;){const h=new Ke,u=Vt.getInstance();if(a>0&&h.retain(a),n.length>0){const d=i.sliceBody(a,a+o),f={dataStream:n};if(Array.isArray(d==null?void 0:d.textRuns)&&d.textRuns.length&&(f.textRuns=[{...d.textRuns[0],st:0,ed:n.length}]),(c=d==null?void 0:d.customRanges)!=null&&c.length){const E=d.customRanges[0];f.customRanges=[{...E,startIndex:0,endIndex:n.length-1}]}h.insert(n.length,f)}h.delete(o),i.apply(u.editOp(h.serialize()))}const l=i.getBody();return i.dispose(),l}const AR="__default_document_sub_component_id20231101__";class Jc{constructor(){C(this,"skipNextObservers",!1);C(this,"lastReturnValue");C(this,"isStopPropagation",!1)}stopPropagation(){this.isStopPropagation=!0}}class TR extends Oe.Subject{constructor(){super(...arguments);C(this,"_sortedObservers",[])}subscribe(){throw new Error("[EventSubject]: please use `subscribeEvent` instead of `subscribe` method for `EventSubject`.")}next(){throw new Error("[EventSubject]: please use `emitEvent` instead of `next` method for `EventSubject`.")}unsubscribe(){super.unsubscribe(),this._sortedObservers.length=0}complete(){super.complete(),this._sortedObservers.length=0}subscribeEvent(n){let r;typeof n=="function"?r={next:([i,o])=>n(i,o)}:r=n;const s=super.subscribe(r);return this._sortedObservers.push(r),this._sortedObservers.sort((i,o)=>{var a,l;return((a=i.priority)!=null?a:0)-((l=o.priority)!=null?l:0)}),s.add(()=>this._sortedObservers=this._sortedObservers.filter(i=>i!==r)),s}clearObservers(){this._sortedObservers.forEach(n=>{var r;return(r=n.complete)==null?void 0:r.call(n)}),this._sortedObservers.length=0}emitEvent(n){var r;if(!this.closed){const s=new Jc;s.lastReturnValue=n;for(const i of this._sortedObservers){const o=(r=i.next)==null?void 0:r.call(i,[n,s]);if(s.lastReturnValue=o,s.skipNextObservers)return{handled:!0,lastReturnValue:s.lastReturnValue,stopPropagation:s.isStopPropagation}}return{handled:this._sortedObservers.length>0,lastReturnValue:s.lastReturnValue,stopPropagation:s.isStopPropagation}}throw new Error("[EventSubject]: cannot emit event on a closed subject.")}}function NR(e){return new Oe.Observable(t=>{const n=e.subscribeEvent(r=>{t.next(r)});return()=>n.unsubscribe()})}const MR=_t("ILocalStorageService");function DR(e){return!(e.length===0||e.length>31||e.startsWith("'")||e.endsWith("'")||/[:\\\/\?\*\[\]]/.test(e))}function xR(e){return new Promise(t=>setTimeout(t,e))}function LR(e=1){return new Promise(t=>{let n=0;const r=()=>{n++,n>=e?t():requestAnimationFrame(r)};requestAnimationFrame(r)})}var uo=(e=>(e.URL="URL",e.UUID="UUID",e.BASE64="BASE64",e))(uo||{}),Zc=(e=>(e.SUCCUSS="0",e.ERROR_EXCEED_SIZE="1",e.ERROR_IMAGE_TYPE="2",e.ERROR_UPLOAD_COUNT_LIMIT="3",e.ERROR_IMAGE="4",e))(Zc||{});const vi=_t("core.image-io.service");class UR{constructor(t,n=100){C(this,"_imageCacheMap");this._injector=t,this._imageCacheMap=new hr(n)}_getImageCacheKey(t,n){return`${t}-${n}`}getImage(t,n,r,s){const i=this._getImageCacheKey(t,n);let o=this._imageCacheMap.get(i);return o||((async()=>{o=new Image;const a=this._injector.has(vi)?this._injector.get(vi):null;if(t===uo.UUID)try{o.src=await(a==null?void 0:a.getImage(n))||""}catch(l){console.error(l)}else o.src=n;o.onload=()=>{r==null||r()},o.onerror=()=>{s==null||s()},this._imageCacheMap.set(i,o)})(),null)}}const PR=["script","style","meta","comment","link"];var eh=(e=>(e[e.DISABLED=0]="DISABLED",e[e.FULL_ALPHA=1]="FULL_ALPHA",e[e.FULL_HANGUL=2]="FULL_HANGUL",e[e.FULL_KATAKANA=3]="FULL_KATAKANA",e[e.HALF_ALPHA=4]="HALF_ALPHA",e[e.HALF_HANGUL=5]="HALF_HANGUL",e[e.HALF_KATAKANA=6]="HALF_KATAKANA",e[e.HIRAGANA=7]="HIRAGANA",e[e.NO_CONTROL=8]="NO_CONTROL",e[e.OFF=9]="OFF",e[e.ON=10]="ON",e))(eh||{});const Ma=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Bs=1,Xn=8;class co{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[n,r]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=r>>4;if(s!==Bs)throw new Error(`Got v${s} data when expected v${Bs}.`);const i=Ma[r&15];if(!i)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new co(a,o,i,t)}constructor(t,n=64,r=Float64Array,s){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=r,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const i=Ma.indexOf(this.ArrayType),o=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-a%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${r}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,Xn,t),this.coords=new this.ArrayType(this.data,Xn+a+l,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(Xn+o+a+l),this.ids=new this.IndexArrayType(this.data,Xn,t),this.coords=new this.ArrayType(this.data,Xn+a+l,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(Bs<<4)+i]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=t,this.coords[this._pos++]=n,r}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return yi(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:o,nodeSize:a}=this,l=[0,i.length-1,0],c=[];for(;l.length;){const h=l.pop()||0,u=l.pop()||0,d=l.pop()||0;if(u-d<=a){for(let O=d;O<=u;O++){const T=o[2*O],V=o[2*O+1];T>=t&&T<=r&&V>=n&&V<=s&&c.push(i[O])}continue}const f=d+u>>1,E=o[2*f],R=o[2*f+1];E>=t&&E<=r&&R>=n&&R<=s&&c.push(i[f]),(h===0?t<=E:n<=R)&&(l.push(d),l.push(f-1),l.push(1-h)),(h===0?r>=E:s>=R)&&(l.push(f+1),l.push(u),l.push(1-h))}return c}within(t,n,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:i,nodeSize:o}=this,a=[0,s.length-1,0],l=[],c=r*r;for(;a.length;){const h=a.pop()||0,u=a.pop()||0,d=a.pop()||0;if(u-d<=o){for(let O=d;O<=u;O++)Da(i[2*O],i[2*O+1],t,n)<=c&&l.push(s[O]);continue}const f=d+u>>1,E=i[2*f],R=i[2*f+1];Da(E,R,t,n)<=c&&l.push(s[f]),(h===0?t-r<=E:n-r<=R)&&(a.push(d),a.push(f-1),a.push(1-h)),(h===0?t+r>=E:n+r>=R)&&(a.push(f+1),a.push(u),a.push(1-h))}return l}}function yi(e,t,n,r,s,i){if(s-r<=n)return;const o=r+s>>1;th(e,t,o,r,s,i),yi(e,t,n,r,o-1,1-i),yi(e,t,n,o+1,s,1-i)}function th(e,t,n,r,s,i){for(;s>r;){if(s-r>600){const c=s-r+1,h=n-r+1,u=Math.log(c),d=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*d*(c-d)/c)*(h-c/2<0?-1:1),E=Math.max(r,Math.floor(n-h*d/c+f)),R=Math.min(s,Math.floor(n+(c-h)*d/c+f));th(e,t,n,E,R,i)}const o=t[2*n+i];let a=r,l=s;for(Qn(e,t,r,n),t[2*s+i]>o&&Qn(e,t,r,s);a<l;){for(Qn(e,t,a,l),a++,l--;t[2*a+i]<o;)a++;for(;t[2*l+i]>o;)l--}t[2*r+i]===o?Qn(e,t,r,l):(l++,Qn(e,t,l,s)),l<=n&&(r=l+1),n<=l&&(s=l-1)}}function Qn(e,t,n,r){js(e,n,r),js(t,2*n,2*r),js(t,2*n+1,2*r+1)}function js(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Da(e,t,n,r){const s=e-n,i=t-r;return s*s+i*i}function nh(e,t,n=0,r=e.length-1,s=FR){for(;r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,h=Math.log(l),u=.5*Math.exp(2*h/3),d=.5*Math.sqrt(h*u*(l-u)/l)*(c-l/2<0?-1:1),f=Math.max(n,Math.floor(t-c*u/l+d)),E=Math.min(r,Math.floor(t+(l-c)*u/l+d));nh(e,t,f,E,s)}const i=e[t];let o=n,a=r;for(qn(e,n,t),s(e[r],i)>0&&qn(e,n,r);o<a;){for(qn(e,o,a),o++,a--;s(e[o],i)<0;)o++;for(;s(e[a],i)>0;)a--}s(e[n],i)===0?qn(e,n,a):(a++,qn(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}}function qn(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function FR(e,t){return e<t?-1:e>t?1:0}class Si{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data;const r=[];if(!kr(t,n))return r;const s=this.toBBox,i=[];for(;n;){for(let o=0;o<n.children.length;o++){const a=n.children[o],l=n.leaf?s(a):a;kr(t,l)&&(n.leaf?r.push(a):Ws(t,l)?this._all(a,r):i.push(a))}n=i.pop()}return r}collides(t){let n=this.data;if(!kr(t,n))return!1;const r=[];for(;n;){for(let s=0;s<n.children.length;s++){const i=n.children[s],o=n.leaf?this.toBBox(i):i;if(kr(t,o)){if(n.leaf||Ws(t,o))return!0;r.push(i)}}n=r.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let r=0;r<t.length;r++)this.insert(t[r]);return this}let n=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){const r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=On([]),this}remove(t,n){if(!t)return this;let r=this.data;const s=this.toBBox(t),i=[],o=[];let a,l,c;for(;r||i.length;){if(r||(r=i.pop(),l=i[i.length-1],a=o.pop(),c=!0),r.leaf){const h=kR(t,r.children,n);if(h!==-1)return r.children.splice(h,1),i.push(r),this._condense(i),this}!c&&!r.leaf&&Ws(r,s)?(i.push(r),o.push(a),a=0,l=r,r=r.children[0]):l?(a++,r=l.children[a],c=!1):r=null}return this}toBBox(t){return t}compareMinX(t,n){return t.minX-n.minX}compareMinY(t,n){return t.minY-n.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,n){const r=[];for(;t;)t.leaf?n.push(...t.children):r.push(...t.children),t=r.pop();return n}_build(t,n,r,s){const i=r-n+1;let o=this._maxEntries,a;if(i<=o)return a=On(t.slice(n,r+1)),yn(a,this.toBBox),a;s||(s=Math.ceil(Math.log(i)/Math.log(o)),o=Math.ceil(i/Math.pow(o,s-1))),a=On([]),a.leaf=!1,a.height=s;const l=Math.ceil(i/o),c=l*Math.ceil(Math.sqrt(o));xa(t,n,r,c,this.compareMinX);for(let h=n;h<=r;h+=c){const u=Math.min(h+c-1,r);xa(t,h,u,l,this.compareMinY);for(let d=h;d<=u;d+=l){const f=Math.min(d+l-1,u);a.children.push(this._build(t,d,f,s-1))}}return yn(a,this.toBBox),a}_chooseSubtree(t,n,r,s){for(;s.push(n),!(n.leaf||s.length-1===r);){let i=1/0,o=1/0,a;for(let l=0;l<n.children.length;l++){const c=n.children[l],h=Hs(c),u=jR(t,c)-h;u<o?(o=u,i=h<i?h:i,a=c):u===o&&h<i&&(i=h,a=c)}n=a||n.children[0]}return n}_insert(t,n,r){const s=r?t:this.toBBox(t),i=[],o=this._chooseSubtree(s,this.data,n,i);for(o.children.push(t),ir(o,s);n>=0&&i[n].children.length>this._maxEntries;)this._split(i,n),n--;this._adjustParentBBoxes(s,i,n)}_split(t,n){const r=t[n],s=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,s);const o=this._chooseSplitIndex(r,i,s),a=On(r.children.splice(o,r.children.length-o));a.height=r.height,a.leaf=r.leaf,yn(r,this.toBBox),yn(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(r,a)}_splitRoot(t,n){this.data=On([t,n]),this.data.height=t.height+1,this.data.leaf=!1,yn(this.data,this.toBBox)}_chooseSplitIndex(t,n,r){let s,i=1/0,o=1/0;for(let a=n;a<=r-n;a++){const l=sr(t,0,a,this.toBBox),c=sr(t,a,r,this.toBBox),h=HR(l,c),u=Hs(l)+Hs(c);h<i?(i=h,s=a,o=u<o?u:o):h===i&&u<o&&(o=u,s=a)}return s||r-n}_chooseSplitAxis(t,n,r){const s=t.leaf?this.compareMinX:$R,i=t.leaf?this.compareMinY:BR,o=this._allDistMargin(t,n,r,s),a=this._allDistMargin(t,n,r,i);o<a&&t.children.sort(s)}_allDistMargin(t,n,r,s){t.children.sort(s);const i=this.toBBox,o=sr(t,0,n,i),a=sr(t,r-n,r,i);let l=Fr(o)+Fr(a);for(let c=n;c<r-n;c++){const h=t.children[c];ir(o,t.leaf?i(h):h),l+=Fr(o)}for(let c=r-n-1;c>=n;c--){const h=t.children[c];ir(a,t.leaf?i(h):h),l+=Fr(a)}return l}_adjustParentBBoxes(t,n,r){for(let s=r;s>=0;s--)ir(n[s],t)}_condense(t){for(let n=t.length-1,r;n>=0;n--)t[n].children.length===0?n>0?(r=t[n-1].children,r.splice(r.indexOf(t[n]),1)):this.clear():yn(t[n],this.toBBox)}}function kR(e,t,n){if(!n)return t.indexOf(e);for(let r=0;r<t.length;r++)if(n(e,t[r]))return r;return-1}function yn(e,t){sr(e,0,e.children.length,t,e)}function sr(e,t,n,r,s){s||(s=On(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(let i=t;i<n;i++){const o=e.children[i];ir(s,e.leaf?r(o):o)}return s}function ir(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function $R(e,t){return e.minX-t.minX}function BR(e,t){return e.minY-t.minY}function Hs(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function Fr(e){return e.maxX-e.minX+(e.maxY-e.minY)}function jR(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function HR(e,t){const n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),s=Math.min(e.maxX,t.maxX),i=Math.min(e.maxY,t.maxY);return Math.max(0,s-n)*Math.max(0,i-r)}function Ws(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function kr(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function On(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function xa(e,t,n,r,s){const i=[t,n];for(;i.length;){if(n=i.pop(),t=i.pop(),n-t<=r)continue;const o=t+Math.ceil((n-t)/r/2)*r;nh(e,o,t,n,s),i.push(t,o,o,n)}}class WR{constructor(t=!1){C(this,"_tree",new Map);C(this,"_oneCellCache",new Map);C(this,"_kdTree",new Map);this._enableOneCellCache=t}dispose(){this.clear()}getTree(t,n){return this._tree.has(t)||this._tree.set(t,new Map),this._tree.get(t).has(n)||this._tree.get(t).set(n,new Si),this._tree.get(t).get(n)}_getOneCellCache(t,n,r,s){return this._oneCellCache.has(t)||this._oneCellCache.set(t,new Map),this._oneCellCache.get(t).has(n)||this._oneCellCache.get(t).set(n,new Map),this._oneCellCache.get(t).get(n).has(r)||this._oneCellCache.get(t).get(n).set(r,new Map),this._oneCellCache.get(t).get(n).get(r).has(s)||this._oneCellCache.get(t).get(n).get(r).set(s,new Set),this._oneCellCache.get(t).get(n).get(r).get(s)}_removeOneCellCache(t,n,r,s,i){const o=this._oneCellCache.get(t);if(!o)return;const a=o.get(n);if(!a)return;const l=a.get(r);if(!l)return;const c=l.get(s);c&&c.delete(i)}_removeCellCacheByRange(t){const{unitId:n,sheetId:r,range:s,id:i}=t,o=this._oneCellCache.get(n);if(!o)return;const a=o.get(r);if(!a)return;const{startRow:l,startColumn:c,endRow:h,endColumn:u}=s;for(let d=l;d<=h;d++){const f=a.get(d);if(f)for(let E=c;E<=u;E++){const R=f.get(E);R&&R.delete(i)}}}_insertOneCellCache(t,n,r,s,i){this._getOneCellCache(t,n,r,s).add(i)}_getRdTreeItems(t){const n=[];for(const[r,s]of t)for(const[i,o]of s)n.push({x:i,y:r,ids:o});return n}_searchByOneCellCache(t){var E;const{unitId:n,sheetId:r,range:s}=t,{startRow:i,startColumn:o,endRow:a,endColumn:l}=s,c=(E=this._kdTree.get(n))==null?void 0:E.get(r);if(!c)return[];const{tree:h,items:u}=c,d=h.range(o,i,l,a),f=[];for(const R of d){const O=u[R];f.push(...Array.from(O.ids))}return f}openKdTree(){var t;for(const[n,r]of this._oneCellCache){this._kdTree.has(n)||this._kdTree.set(n,new Map);for(const[s,i]of r){const o=this._getRdTreeItems(i),a=new co(o.length);(t=this._kdTree.get(n))==null||t.set(s,{tree:a,items:o});for(const l of o)a.add(l.x,l.y);a.finish()}}}closeKdTree(){var t;for(const[n,r]of this._oneCellCache)for(const[s,i]of r)(t=this._kdTree.get(n))==null||t.set(s,void 0)}insert(t){const{unitId:n,sheetId:r,range:s,id:i}=t;if(!n||n.length===0)return;let{startRow:o,endRow:a,startColumn:l,endColumn:c}=s;if(this._enableOneCellCache&&o===a&&l===c){this._insertOneCellCache(n,r,o,l,i);return}const h=this.getTree(n,r);Number.isNaN(o)&&(o=0),Number.isNaN(l)&&(l=0),Number.isNaN(a)&&(a=Number.POSITIVE_INFINITY),Number.isNaN(c)&&(c=Number.POSITIVE_INFINITY),h.insert({minX:l,minY:o,maxX:c,maxY:a,id:i})}bulkInsert(t){for(const n of t)this.insert(n)}*searchGenerator(t){var a;const{unitId:n,sheetId:r,range:s}=t;if(this._enableOneCellCache){const l=this._searchByOneCellCache(t);for(const c of l)yield c}const i=(a=this._tree.get(n))==null?void 0:a.get(r);if(!i)return;const o=i.search({minX:s.startColumn,minY:s.startRow,maxX:s.endColumn,maxY:s.endRow});for(const l of o)yield l.id}bulkSearch(t,n){const r=new Set;for(const s of t)for(const i of this.searchGenerator(s))(n==null?void 0:n.has(i))!==!0&&r.add(i);return r}removeById(t,n){var r,s;n?((r=this._tree.get(t))==null||r.delete(n),(s=this._oneCellCache.get(t))==null||s.delete(n)):(this._tree.delete(t),this._oneCellCache.delete(t))}_removeRTreeItem(t){const{unitId:n,sheetId:r,range:s,id:i}=t,o=this.getTree(n,r),a=o.search({minX:s.startColumn,minY:s.startRow,maxX:s.endColumn,maxY:s.endRow});for(let l=0;l<a.length;l++)a[l].id===i&&o.remove(a[l])}remove(t){const{unitId:n,sheetId:r,range:s,id:i}=t,{startRow:o,startColumn:a,endRow:l,endColumn:c}=s;this._enableOneCellCache?o===l&&a===c?this._removeOneCellCache(n,r,s.startRow,s.startColumn,i):(this._removeCellCacheByRange(t),this._removeRTreeItem(t)):this._removeRTreeItem(t)}bulkRemove(t){for(const n of t)this.remove(n)}clear(){this._tree.clear(),this._oneCellCache.clear()}toJSON(){const t={};return this._tree.forEach((n,r)=>{t[r]={},n.forEach((s,i)=>{t[r][i]=s.toJSON()})}),t}fromJSON(t){this._tree.clear();for(const n in t){this._tree.set(n,new Map);for(const r in t[n]){const s=new Si;s.fromJSON(t[n][r]),this._tree.get(n).set(r,s)}}}}ah();exports.ABCToNumber=x_;exports.AbsoluteRefType=tt;exports.ActionIterator=Sn;exports.AlignTypeH=Bu;exports.AlignTypeV=ju;exports.ArrangeTypeEnum=zu;exports.ArrowsAndMarkersShapes=Gl;exports.AsyncInterceptorManager=JE;exports.AutoFillSeries=Pl;exports.BaselineOffset=Ut;exports.BasicShapes=Vl;exports.BlockType=Cu;exports.BooleanNumber=Se;exports.BorderStyleTypes=Xe;exports.BorderType=Fl;exports.BuildTextUtils=st;exports.BulletAlignment=Ir;exports.COLORS=ii;exports.CanceledError=yl;exports.CellModeEnum=bn;exports.CellValueType=nn;exports.Color=En;exports.ColorBuilder=Cr;exports.ColorKit=bt;exports.ColorType=vt;exports.ColumnSeparatorType=vu;exports.CommandType=Wn;exports.CommonHideTypes=kl;exports.ConfigService=jc;exports.ContextService=wl;exports.CopyPasteType=$l;exports.CustomCommandExecutionError=ni;exports.CustomDecorationType=fn;exports.CustomRangeType=on;exports.DEFAULT_CELL=C_;exports.DEFAULT_DOC=Ji;exports.DEFAULT_DOCUMENT_SUB_COMPONENT_ID=AR;exports.DEFAULT_EMPTY_DOCUMENT_VALUE=sl;exports.DEFAULT_RANGE=__;exports.DEFAULT_RANGE_ARRAY=m_;exports.DEFAULT_SELECTION=E_;exports.DEFAULT_SLIDE=fu;exports.DEFAULT_STYLES=ct;exports.DEFAULT_WORKSHEET_COLUMN_COUNT=Oc;exports.DEFAULT_WORKSHEET_COLUMN_COUNT_KEY=hC;exports.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT=Tc;exports.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY=pC;exports.DEFAULT_WORKSHEET_COLUMN_WIDTH=wc;exports.DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY=fC;exports.DEFAULT_WORKSHEET_ROW_COUNT=Sc;exports.DEFAULT_WORKSHEET_ROW_COUNT_KEY=cC;exports.DEFAULT_WORKSHEET_ROW_HEIGHT=bc;exports.DEFAULT_WORKSHEET_ROW_HEIGHT_KEY=dC;exports.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH=Ac;exports.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY=gC;exports.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY=Li;exports.DOCS_NORMAL_EDITOR_UNIT_ID_KEY=xi;exports.DOCS_ZEN_EDITOR_UNIT_ID_KEY=rl;exports.DOC_RANGE_TYPE=iu;exports.DashStyleType=Tu;exports.DataStreamTreeNodeType=_c;exports.DataStreamTreeTokenType=Jt;exports.DataValidationErrorStyle=so;exports.DataValidationImeMode=eh;exports.DataValidationOperator=io;exports.DataValidationRenderMode=oo;exports.DataValidationStatus=ao;exports.DataValidationType=lo;exports.DeleteDirection=Bl;exports.DependentOn=nR;exports.DesktopLogService=Tl;exports.DeveloperMetadataVisibility=jl;exports.Dimension=Hl;exports.Direction=Wl;exports.Disposable=nt;exports.DisposableCollection=Rs;exports.DocStyleType=_u;exports.DocumentDataModel=Pt;exports.DocumentFlavor=Gi;exports.DrawingTypeEnum=Yu;exports.EDITOR_ACTIVATED=xc;exports.EXTENSION_NAMES=gu;exports.ErrorService=Hc;exports.EventState=Jc;exports.EventSubject=TR;exports.FBase=Ss;exports.FBaseInitialable=Zi;exports.FEnum=hs;exports.FEventName=ds;exports.FOCUSING_COMMON_DRAWINGS=TC;exports.FOCUSING_DOC=nr;exports.FOCUSING_EDITOR_BUT_HIDDEN=yC;exports.FOCUSING_EDITOR_INPUT_FORMULA=SC;exports.FOCUSING_EDITOR_STANDALONE=bC;exports.FOCUSING_FX_BAR_EDITOR=Lc;exports.FOCUSING_PANEL_EDITOR=wC;exports.FOCUSING_SHEET=Tn;exports.FOCUSING_SLIDE=rr;exports.FOCUSING_UNIT=tr;exports.FOCUSING_UNIVER_EDITOR=OC;exports.FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE=AC;exports.FORMULA_EDITOR_ACTIVATED=NC;exports.FUtil=fs;exports.FollowNumberWithType=Eu;exports.FontItalic=ss;exports.FontStyleType=wn;exports.FontWeight=is;exports.GridType=Ru;exports.HLSColor=nu;exports.HorizontalAlign=$t;exports.IAuthzIoService=$c;exports.ICommandService=Dt;exports.IConfigService=Bc;exports.IContextService=_r;exports.IImageIoService=vi;exports.ILocalStorageService=MR;exports.ILogService=At;exports.IMentionIOService=Wc;exports.IPermissionService=zc;exports.IResourceLoaderService=Ci;exports.IResourceManagerService=bs;exports.IS_ROW_STYLE_PRECEDE_COLUMN_STYLE=_g;exports.IUndoRedoService=en;exports.IUniverInstanceService=an;exports.ImageCacheMap=UR;exports.ImageSourceType=uo;exports.ImageUploadStatusType=Zc;exports.Inject=it;exports.Injector=Ct;exports.InterceptorEffectEnum=An;exports.InterceptorManager=XE;exports.InterpolationPointType=zl;exports.JSON1=G_;exports.JSONX=Vt;exports.LRUHelper=Zn;exports.LRUMap=hr;exports.LifecycleStages=We;exports.ListGlyphType=Ne;exports.LocaleService=lr;exports.LocaleType=Er;exports.LogLevel=Al;exports.MOVE_BUFFER_VALUE=Jn;exports.Many=fl;exports.MemoryCursor=zn;exports.MentionType=rs;exports.NamedStyleType=wu;exports.NilCommand=Nl;exports.NumberUnitType=$u;exports.ObjectMatrix=xt;exports.ObjectRelativeFromH=Fu;exports.ObjectRelativeFromV=ku;exports.Optional=gl;exports.OtherShapes=Kl;exports.PRESET_LIST_TYPE=yr;exports.PageElementType=Vu;exports.PageOrientType=Wu;exports.PageType=Ki;exports.ParagraphElementType=Su;exports.ParagraphStyleBuilder=kn;exports.ParagraphStyleValue=Vn;exports.PermissionService=Yc;exports.PermissionStatus=no;exports.Plugin=_i;exports.PositionedObjectLayoutType=bu;exports.PresetListType=Lt;exports.ProtectionType=Yl;exports.QuickListType=lc;exports.QuickListTypeMap=Z_;exports.RANGE_DIRECTION=su;exports.RANGE_TYPE=xe;exports.RBush=Si;exports.RCDisposable=hp;exports.RGBA_PAREN=jp;exports.RGB_PAREN=Bp;exports.ROTATE_BUFFER_VALUE=Ul;exports.RTree=WR;exports.Range=Fn;exports.Rectangle=Yt;exports.RediConsumer=El;exports.RediContext=mr;exports.RediError=ot;exports.RediProvider=ji;exports.RedoCommand=pn;exports.RedoCommandId=Fc;exports.RefAlias=D_;exports.Registry=Os;exports.RegistryAsMap=eo;exports.RelativeDate=Ql;exports.RelativeSlideLink=Gu;exports.ResourceManagerService=Xc;exports.RgbColor=os;exports.RichTextBuilder=sn;exports.RichTextValue=jt;exports.RxDisposable=cp;exports.SHEET_EDITOR_UNITS=R_;exports.SectionType=Iu;exports.Self=dl;exports.SheetTypes=ql;exports.SheetViewModel=Mc;exports.SkipSelf=hl;exports.SliceBodyType=qi;exports.SlideDataModel=to;exports.SpacingRule=Au;exports.SpecialShapes=Xl;exports.Styles=Rc;exports.THEME_COLORS=tu;exports.TabStopAlignment=Nu;exports.TableAlignmentType=Du;exports.TableLayoutType=xu;exports.TableRowHeightRule=Uu;exports.TableSizeType=Mu;exports.TableTextWrapType=Lu;exports.TextDecoration=Wi;exports.TextDecorationBuilder=Bt;exports.TextDirection=Pn;exports.TextDirectionType=yu;exports.TextStyleBuilder=Wt;exports.TextStyleValue=Yn;exports.TextX=Ke;exports.TextXActionType=fe;exports.ThemeColor=as;exports.ThemeColorType=gt;exports.ThemeColors=Is;exports.ThemeService=ro;exports.Tools=re;exports.UndoCommand=gn;exports.UndoCommandId=kc;exports.UnitModel=ys;exports.Univer=Qc;exports.UniverInstanceType=$e;exports.UpdateDocsAttributeType=Pe;exports.UserManagerService=$n;exports.VerticalAlign=tn;exports.VerticalAlignmentType=Pu;exports.WithDependency=qg;exports.WithNew=pl;exports.Worksheet=dr;exports.WrapStrategy=_n;exports.WrapTextType=Ou;exports.addLinkToDocumentModel=Ic;exports.afterInitApply=Rp;exports.afterTime=Cp;exports.awaitTime=xR;exports.binSearchFirstGreaterThanTarget=Ll;exports.binarySearchArray=Ip;exports.bufferDebounceTime=Ep;exports.cellToRange=mm;exports.characterSpacingControlType=Hu;exports.checkForSubstrings=_m;exports.checkIfMove=Sp;exports.checkParagraphHasBullet=Zm;exports.checkParagraphHasIndent=e_;exports.checkParagraphHasIndentByStyle=uu;exports.codeToBlob=yp;exports.composeBody=gi;exports.composeInterceptors=Cc;exports.composeStyles=ri;exports.concatMatrixArray=d_;exports.connectDependencies=Kg;exports.connectInjector=Gg;exports.convertBodyToHtml=$p;exports.convertCellToRange=ou;exports.covertTextRunToHtml=si;exports.createAsyncInterceptorKey=QE;exports.createDefaultUser=us;exports.createDocumentModelWithStyle=er;exports.createIdentifier=_t;exports.createInterceptorKey=KE;exports.createInternalEditorID=Eg;exports.createRowColIter=ui;exports.dayjs=Kt;exports.debounce=ng;exports.dedupe=hg;exports.deepCompare=Yi;exports.delayAnimationFrame=LR;exports.deleteContent=hu;exports.extractPureTextFromCell=Dc;exports.forwardRef=Ng;exports.fromCallback=Ml;exports.fromEventSubject=NR;exports.fromObservable=up;exports.generateRandomId=zt;exports.get=xf;exports.getArrayLength=rn;exports.getBodySlice=Ht;exports.getBodySliceHtml=Hr;exports.getBorderStyleType=fm;exports.getCellInfoInMergeData=om;exports.getCellValueType=nm;exports.getColorStyle=Nt;exports.getCustomDecorationSlice=hc;exports.getCustomRangeSlice=cc;exports.getDocsUpdateBody=gm;exports.getIntersectRange=b_;exports.getOriginCellValue=_C;exports.getReverseDirection=Op;exports.getWorksheetUID=vC;exports.groupBy=gg;exports.handleStyleToString=dm;exports.hashAlgorithm=r_;exports.horizontalLineSegmentsSubtraction=vs;exports.insertMatrixArray=oi;exports.insertTextToContent=cu;exports.isAsyncDependencyItem=Qs;exports.isAsyncHook=Br;exports.isBlackColor=Zp;exports.isBooleanString=mg;exports.isCellCoverable=um;exports.isCellV=sm;exports.isClassDependencyItem=Gs;exports.isCtor=Pi;exports.isDisposable=Zs;exports.isEmptyCell=au;exports.isFactoryDependencyItem=Ks;exports.isFormulaId=hm;exports.isFormulaString=cm;exports.isICellData=tm;exports.isInternalEditorID=il;exports.isNodeEnv=kp;exports.isNotNullOrUndefined=vc;exports.isNullCell=rm;exports.isNumeric=qc;exports.isRangesEqual=nC;exports.isRealNum=n_;exports.isSafeNumeric=SR;exports.isSameStyleTextRun=lu;exports.isUnitRangesEqual=rC;exports.isValidRange=pm;exports.isValueDependencyItem=Xs;exports.isWhiteColor=em;exports.makeArray=pg;exports.makeCellRangeToRangeData=lm;exports.makeCellToSelection=am;exports.makeCustomRangeStream=BE;exports.merge=Di;exports.mergeOverrideWithDependencies=Vc;exports.mergeSets=bR;exports.mergeWith=og;exports.mergeWorksheetSnapshotWithDefault=Nc;exports.mixinClass=ZE;exports.moveMatrixArray=li;exports.moveRangeByOffset=I_;exports.nameCharacterCheck=DR;exports.normalizeBody=lE;exports.normalizeTextRuns=vr;exports.numberToABC=U_;exports.numberToListABC=P_;exports.numfmt=du;exports.queryObjectMatrix=M_;exports.registerDependencies=op;exports.remove=gr;exports.repeatStringNumTimes=mu;exports.replaceInDocumentBody=wR;exports.requestImmediateMacroTask=OR;exports.rotate=fg;exports.searchArray=vp;exports.searchInOrderedArray=xl;exports.selectionToArray=im;exports.sequence=Ol;exports.sequenceAsync=Sl;exports.sequenceExecute=Hi;exports.sequenceExecuteAsync=_p;exports.set=lg;exports.setDependencies=Tg;exports.shallowEqual=vl;exports.skipParseTagNames=PR;exports.sliceMatrixArray=f_;exports.sortRules=F_;exports.sortRulesByDesc=k_;exports.sortRulesFactory=Rr;exports.spliceArray=ai;exports.splitIntoGrid=Vi;exports.takeAfter=Dl;exports.textDiff=nl;exports.throttle=GE;exports.toDisposable=Qe;exports.touchDependencies=Il;exports.updateAttributeByDelete=dc;exports.updateAttributeByInsert=fc;exports.useDependency=ep;exports.useDependencyContext=sp;exports.useDependencyContextValue=ip;exports.useDependencyValue=Rl;exports.useInjector=Cl;exports.useObservable=np;exports.useUpdateBinder=rp;
|