@univerjs/core 0.5.0-alpha.0 → 0.5.0-beta.1

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/umd/index.js CHANGED
@@ -1,10 +1,10 @@
1
- (function(d,re){typeof exports=="object"&&typeof module<"u"?re(exports,require("rxjs"),require("rxjs/operators"),require("react")):typeof define=="function"&&define.amd?define(["exports","rxjs","rxjs/operators","react"],re):(d=typeof globalThis<"u"?globalThis:d||self,re(d.UniverCore={},d.rxjs,d.rxjs.operators,d.React))})(this,function(d,re,Mt,Ze){"use strict";var o0=Object.defineProperty;var a0=(d,re,Mt)=>re in d?o0(d,re,{enumerable:!0,configurable:!0,writable:!0,value:Mt}):d[re]=Mt;var R=(d,re,Mt)=>a0(d,typeof re!="symbol"?re+"":re,Mt);var du,fu;function mu(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}function _u(e,n){for(var t=0;t<n.length;t++){const r=n[t];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 Ct=mu(Ze);function pu(){Eu()}const dr=typeof global<"u"?global:typeof self<"u"?self:window;function Eu(){typeof dr.requestIdleCallback!="function"&&(dr.requestIdleCallback=function(t){const r=Date.now();return setTimeout(function(){const i=Math.max(0,50-(Date.now()-r));t({didTimeout:i===0,timeRemaining(){return i}})},1)}),typeof dr.cancelIdleCallback!="function"&&(dr.cancelIdleCallback=function(t){clearTimeout(t)})}var Mi=typeof global=="object"&&global&&global.Object===Object&&global,Cu=typeof self=="object"&&self&&self.Object===Object&&self,Xt=Mi||Cu||Function("return this")(),cn=Xt.Symbol,Li=Object.prototype,Ru=Li.hasOwnProperty,Iu=Li.toString,Nn=cn?cn.toStringTag:void 0;function vu(e){var n=Ru.call(e,Nn),t=e[Nn];try{e[Nn]=void 0;var r=!0}catch{}var s=Iu.call(e);return r&&(n?e[Nn]=t:delete e[Nn]),s}var Su=Object.prototype,Ou=Su.toString;function bu(e){return Ou.call(e)}var yu="[object Null]",wu="[object Undefined]",Di=cn?cn.toStringTag:void 0;function Tn(e){return e==null?e===void 0?wu:yu:Di&&Di in Object(e)?vu(e):bu(e)}function un(e){return e!=null&&typeof e=="object"}var Au="[object Symbol]";function fr(e){return typeof e=="symbol"||un(e)&&Tn(e)==Au}function Nu(e,n){for(var t=-1,r=e==null?0:e.length,s=Array(r);++t<r;)s[t]=n(e[t],t,e);return s}var hn=Array.isArray,Tu=1/0,Ui=cn?cn.prototype:void 0,Pi=Ui?Ui.toString:void 0;function Fi(e){if(typeof e=="string")return e;if(hn(e))return Nu(e,Fi)+"";if(fr(e))return Pi?Pi.call(e):"";var n=e+"";return n=="0"&&1/e==-Tu?"-0":n}var Mu=/\s/;function Lu(e){for(var n=e.length;n--&&Mu.test(e.charAt(n)););return n}var Du=/^\s+/;function Uu(e){return e&&e.slice(0,Lu(e)+1).replace(Du,"")}function ft(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var ki=NaN,Pu=/^[-+]0x[0-9a-f]+$/i,Fu=/^0b[01]+$/i,ku=/^0o[0-7]+$/i,xu=parseInt;function xi(e){if(typeof e=="number")return e;if(fr(e))return ki;if(ft(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=ft(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=Uu(e);var t=Fu.test(e);return t||ku.test(e)?xu(e.slice(2),t?2:8):Pu.test(e)?ki:+e}function Hi(e){return e}var Hu="[object AsyncFunction]",Bu="[object Function]",ju="[object GeneratorFunction]",$u="[object Proxy]";function es(e){if(!ft(e))return!1;var n=Tn(e);return n==Bu||n==ju||n==Hu||n==$u}var ts=Xt["__core-js_shared__"],Bi=function(){var e=/[^.]+$/.exec(ts&&ts.keys&&ts.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Wu(e){return!!Bi&&Bi in e}var Vu=Function.prototype,zu=Vu.toString;function Gu(e){if(e!=null){try{return zu.call(e)}catch{}try{return e+""}catch{}}return""}var Ku=/[\\^$.*+?()[\]{}|]/g,Yu=/^\[object .+?Constructor\]$/,Xu=Function.prototype,Qu=Object.prototype,Ju=Xu.toString,Zu=Qu.hasOwnProperty,qu=RegExp("^"+Ju.call(Zu).replace(Ku,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function eh(e){if(!ft(e)||Wu(e))return!1;var n=es(e)?qu:Yu;return n.test(Gu(e))}function th(e,n){return e==null?void 0:e[n]}function ns(e,n){var t=th(e,n);return eh(t)?t:void 0}var ji=Object.create,nh=function(){function e(){}return function(n){if(!ft(n))return{};if(ji)return ji(n);e.prototype=n;var t=new e;return e.prototype=void 0,t}}();function rh(e,n,t){switch(t.length){case 0:return e.call(n);case 1:return e.call(n,t[0]);case 2:return e.call(n,t[0],t[1]);case 3:return e.call(n,t[0],t[1],t[2])}return e.apply(n,t)}function sh(e,n){var t=-1,r=e.length;for(n||(n=Array(r));++t<r;)n[t]=e[t];return n}var ih=800,oh=16,ah=Date.now;function lh(e){var n=0,t=0;return function(){var r=ah(),s=oh-(r-t);if(t=r,s>0){if(++n>=ih)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}function ch(e){return function(){return e}}var gr=function(){try{var e=ns(Object,"defineProperty");return e({},"",{}),e}catch{}}(),uh=gr?function(e,n){return gr(e,"toString",{configurable:!0,enumerable:!1,value:ch(n),writable:!0})}:Hi,hh=lh(uh),dh=9007199254740991,fh=/^(?:0|[1-9]\d*)$/;function rs(e,n){var t=typeof e;return n=n==null?dh:n,!!n&&(t=="number"||t!="symbol"&&fh.test(e))&&e>-1&&e%1==0&&e<n}function ss(e,n,t){n=="__proto__"&&gr?gr(e,n,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[n]=t}function mr(e,n){return e===n||e!==e&&n!==n}var gh=Object.prototype,mh=gh.hasOwnProperty;function $i(e,n,t){var r=e[n];(!(mh.call(e,n)&&mr(r,t))||t===void 0&&!(n in e))&&ss(e,n,t)}function _h(e,n,t,r){var s=!t;t||(t={});for(var i=-1,o=n.length;++i<o;){var a=n[i],l=void 0;l===void 0&&(l=e[a]),s?ss(t,a,l):$i(t,a,l)}return t}var Wi=Math.max;function ph(e,n,t){return n=Wi(n===void 0?e.length-1:n,0),function(){for(var r=arguments,s=-1,i=Wi(r.length-n,0),o=Array(i);++s<i;)o[s]=r[n+s];s=-1;for(var a=Array(n+1);++s<n;)a[s]=r[s];return a[n]=t(o),rh(e,this,a)}}function Eh(e,n){return hh(ph(e,n,Hi),e+"")}var Ch=9007199254740991;function Vi(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ch}function is(e){return e!=null&&Vi(e.length)&&!es(e)}function Rh(e,n,t){if(!ft(t))return!1;var r=typeof n;return(r=="number"?is(t)&&rs(n,t.length):r=="string"&&n in t)?mr(t[n],e):!1}function zi(e){return Eh(function(n,t){var r=-1,s=t.length,i=s>1?t[s-1]:void 0,o=s>2?t[2]:void 0;for(i=e.length>3&&typeof i=="function"?(s--,i):void 0,o&&Rh(t[0],t[1],o)&&(i=s<3?void 0:i,s=1),n=Object(n);++r<s;){var a=t[r];a&&e(n,a,r,i)}return n})}var Ih=Object.prototype;function Gi(e){var n=e&&e.constructor,t=typeof n=="function"&&n.prototype||Ih;return e===t}function vh(e,n){for(var t=-1,r=Array(e);++t<e;)r[t]=n(t);return r}var Sh="[object Arguments]";function Ki(e){return un(e)&&Tn(e)==Sh}var Yi=Object.prototype,Oh=Yi.hasOwnProperty,bh=Yi.propertyIsEnumerable,os=Ki(function(){return arguments}())?Ki:function(e){return un(e)&&Oh.call(e,"callee")&&!bh.call(e,"callee")};function yh(){return!1}var Xi=typeof d=="object"&&d&&!d.nodeType&&d,Qi=Xi&&typeof module=="object"&&module&&!module.nodeType&&module,wh=Qi&&Qi.exports===Xi,Ji=wh?Xt.Buffer:void 0,Ah=Ji?Ji.isBuffer:void 0,Zi=Ah||yh,Nh="[object Arguments]",Th="[object Array]",Mh="[object Boolean]",Lh="[object Date]",Dh="[object Error]",Uh="[object Function]",Ph="[object Map]",Fh="[object Number]",kh="[object Object]",xh="[object RegExp]",Hh="[object Set]",Bh="[object String]",jh="[object WeakMap]",$h="[object ArrayBuffer]",Wh="[object DataView]",Vh="[object Float32Array]",zh="[object Float64Array]",Gh="[object Int8Array]",Kh="[object Int16Array]",Yh="[object Int32Array]",Xh="[object Uint8Array]",Qh="[object Uint8ClampedArray]",Jh="[object Uint16Array]",Zh="[object Uint32Array]",$e={};$e[Vh]=$e[zh]=$e[Gh]=$e[Kh]=$e[Yh]=$e[Xh]=$e[Qh]=$e[Jh]=$e[Zh]=!0,$e[Nh]=$e[Th]=$e[$h]=$e[Mh]=$e[Wh]=$e[Lh]=$e[Dh]=$e[Uh]=$e[Ph]=$e[Fh]=$e[kh]=$e[xh]=$e[Hh]=$e[Bh]=$e[jh]=!1;function qh(e){return un(e)&&Vi(e.length)&&!!$e[Tn(e)]}function ed(e){return function(n){return e(n)}}var qi=typeof d=="object"&&d&&!d.nodeType&&d,Mn=qi&&typeof module=="object"&&module&&!module.nodeType&&module,td=Mn&&Mn.exports===qi,as=td&&Mi.process,eo=function(){try{var e=Mn&&Mn.require&&Mn.require("util").types;return e||as&&as.binding&&as.binding("util")}catch{}}(),to=eo&&eo.isTypedArray,no=to?ed(to):qh;function nd(e,n){var t=hn(e),r=!t&&os(e),s=!t&&!r&&Zi(e),i=!t&&!r&&!s&&no(e),o=t||r||s||i,a=o?vh(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")||rs(c,l))||a.push(c);return a}function rd(e,n){return function(t){return e(n(t))}}function sd(e){var n=[];if(e!=null)for(var t in Object(e))n.push(t);return n}var id=Object.prototype,od=id.hasOwnProperty;function ad(e){if(!ft(e))return sd(e);var n=Gi(e),t=[];for(var r in e)r=="constructor"&&(n||!od.call(e,r))||t.push(r);return t}function ro(e){return is(e)?nd(e):ad(e)}var ld=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,cd=/^\w*$/;function ud(e,n){if(hn(e))return!1;var t=typeof e;return t=="number"||t=="symbol"||t=="boolean"||e==null||fr(e)?!0:cd.test(e)||!ld.test(e)||n!=null&&e in Object(n)}var Ln=ns(Object,"create");function hd(){this.__data__=Ln?Ln(null):{},this.size=0}function dd(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}var fd="__lodash_hash_undefined__",gd=Object.prototype,md=gd.hasOwnProperty;function _d(e){var n=this.__data__;if(Ln){var t=n[e];return t===fd?void 0:t}return md.call(n,e)?n[e]:void 0}var pd=Object.prototype,Ed=pd.hasOwnProperty;function Cd(e){var n=this.__data__;return Ln?n[e]!==void 0:Ed.call(n,e)}var Rd="__lodash_hash_undefined__";function Id(e,n){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=Ln&&n===void 0?Rd:n,this}function Qt(e){var n=-1,t=e==null?0:e.length;for(this.clear();++n<t;){var r=e[n];this.set(r[0],r[1])}}Qt.prototype.clear=hd,Qt.prototype.delete=dd,Qt.prototype.get=_d,Qt.prototype.has=Cd,Qt.prototype.set=Id;function vd(){this.__data__=[],this.size=0}function _r(e,n){for(var t=e.length;t--;)if(mr(e[t][0],n))return t;return-1}var Sd=Array.prototype,Od=Sd.splice;function bd(e){var n=this.__data__,t=_r(n,e);if(t<0)return!1;var r=n.length-1;return t==r?n.pop():Od.call(n,t,1),--this.size,!0}function yd(e){var n=this.__data__,t=_r(n,e);return t<0?void 0:n[t][1]}function wd(e){return _r(this.__data__,e)>-1}function Ad(e,n){var t=this.__data__,r=_r(t,e);return r<0?(++this.size,t.push([e,n])):t[r][1]=n,this}function Lt(e){var n=-1,t=e==null?0:e.length;for(this.clear();++n<t;){var r=e[n];this.set(r[0],r[1])}}Lt.prototype.clear=vd,Lt.prototype.delete=bd,Lt.prototype.get=yd,Lt.prototype.has=wd,Lt.prototype.set=Ad;var so=ns(Xt,"Map");function Nd(){this.size=0,this.__data__={hash:new Qt,map:new(so||Lt),string:new Qt}}function Td(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}function pr(e,n){var t=e.__data__;return Td(n)?t[typeof n=="string"?"string":"hash"]:t.map}function Md(e){var n=pr(this,e).delete(e);return this.size-=n?1:0,n}function Ld(e){return pr(this,e).get(e)}function Dd(e){return pr(this,e).has(e)}function Ud(e,n){var t=pr(this,e),r=t.size;return t.set(e,n),this.size+=t.size==r?0:1,this}function Ht(e){var n=-1,t=e==null?0:e.length;for(this.clear();++n<t;){var r=e[n];this.set(r[0],r[1])}}Ht.prototype.clear=Nd,Ht.prototype.delete=Md,Ht.prototype.get=Ld,Ht.prototype.has=Dd,Ht.prototype.set=Ud;var Pd="Expected a function";function ls(e,n){if(typeof e!="function"||n!=null&&typeof n!="function")throw new TypeError(Pd);var t=function(){var r=arguments,s=n?n.apply(this,r):r[0],i=t.cache;if(i.has(s))return i.get(s);var o=e.apply(this,r);return t.cache=i.set(s,o)||i,o};return t.cache=new(ls.Cache||Ht),t}ls.Cache=Ht;var Fd=500;function kd(e){var n=ls(e,function(r){return t.size===Fd&&t.clear(),r}),t=n.cache;return n}var xd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Hd=/\\(\\)?/g,Bd=kd(function(e){var n=[];return e.charCodeAt(0)===46&&n.push(""),e.replace(xd,function(t,r,s,i){n.push(s?i.replace(Hd,"$1"):r||t)}),n});function jd(e){return e==null?"":Fi(e)}function io(e,n){return hn(e)?e:ud(e,n)?[e]:Bd(jd(e))}var $d=1/0;function oo(e){if(typeof e=="string"||fr(e))return e;var n=e+"";return n=="0"&&1/e==-$d?"-0":n}function Wd(e,n){n=io(n,e);for(var t=0,r=n.length;e!=null&&t<r;)e=e[oo(n[t++])];return t&&t==r?e:void 0}function Vd(e,n,t){var r=e==null?void 0:Wd(e,n);return r===void 0?t:r}var ao=rd(Object.getPrototypeOf,Object),zd="[object Object]",Gd=Function.prototype,Kd=Object.prototype,lo=Gd.toString,Yd=Kd.hasOwnProperty,Xd=lo.call(Object);function Qd(e){if(!un(e)||Tn(e)!=zd)return!1;var n=ao(e);if(n===null)return!0;var t=Yd.call(n,"constructor")&&n.constructor;return typeof t=="function"&&t instanceof t&&lo.call(t)==Xd}function Jd(){this.__data__=new Lt,this.size=0}function Zd(e){var n=this.__data__,t=n.delete(e);return this.size=n.size,t}function qd(e){return this.__data__.get(e)}function ef(e){return this.__data__.has(e)}var tf=200;function nf(e,n){var t=this.__data__;if(t instanceof Lt){var r=t.__data__;if(!so||r.length<tf-1)return r.push([e,n]),this.size=++t.size,this;t=this.__data__=new Ht(r)}return t.set(e,n),this.size=t.size,this}function dn(e){var n=this.__data__=new Lt(e);this.size=n.size}dn.prototype.clear=Jd,dn.prototype.delete=Zd,dn.prototype.get=qd,dn.prototype.has=ef,dn.prototype.set=nf;var co=typeof d=="object"&&d&&!d.nodeType&&d,uo=co&&typeof module=="object"&&module&&!module.nodeType&&module,rf=uo&&uo.exports===co,ho=rf?Xt.Buffer:void 0;ho&&ho.allocUnsafe;function sf(e,n){return e.slice()}var fo=Xt.Uint8Array;function of(e){var n=new e.constructor(e.byteLength);return new fo(n).set(new fo(e)),n}function af(e,n){var t=of(e.buffer);return new e.constructor(t,e.byteOffset,e.length)}function lf(e){return typeof e.constructor=="function"&&!Gi(e)?nh(ao(e)):{}}function cf(e){return function(n,t,r){for(var s=-1,i=Object(n),o=r(n),a=o.length;a--;){var l=o[++s];if(t(i[l],l,i)===!1)break}return n}}var uf=cf(),cs=function(){return Xt.Date.now()},hf="Expected a function",df=Math.max,ff=Math.min;function gf(e,n,t){var r,s,i,o,a,l,c=0,u=!1,h=!1,f=!0;if(typeof e!="function")throw new TypeError(hf);n=xi(n)||0,ft(t)&&(u=!!t.leading,h="maxWait"in t,i=h?df(xi(t.maxWait)||0,n):i,f="trailing"in t?!!t.trailing:f);function g(b){var D=r,G=s;return r=s=void 0,c=b,o=e.apply(G,D),o}function E(b){return c=b,a=setTimeout(O,n),u?g(b):o}function I(b){var D=b-l,G=b-c,_e=n-D;return h?ff(_e,i-G):_e}function M(b){var D=b-l,G=b-c;return l===void 0||D>=n||D<0||h&&G>=i}function O(){var b=cs();if(M(b))return P(b);a=setTimeout(O,I(b))}function P(b){return a=void 0,f&&r?g(b):(r=s=void 0,o)}function $(){a!==void 0&&clearTimeout(a),c=0,r=l=s=a=void 0}function z(){return a===void 0?o:P(cs())}function w(){var b=cs(),D=M(b);if(r=arguments,s=this,l=b,D){if(a===void 0)return E(l);if(h)return clearTimeout(a),a=setTimeout(O,n),g(l)}return a===void 0&&(a=setTimeout(O,n)),o}return w.cancel=$,w.flush=z,w}function us(e,n,t){(t!==void 0&&!mr(e[n],t)||t===void 0&&!(n in e))&&ss(e,n,t)}function mf(e){return un(e)&&is(e)}function hs(e,n){if(!(n==="constructor"&&typeof e[n]=="function")&&n!="__proto__")return e[n]}function _f(e){return _h(e,ro(e))}function pf(e,n,t,r,s,i,o){var a=hs(e,t),l=hs(n,t),c=o.get(l);if(c){us(e,t,c);return}var u=i?i(a,l,t+"",e,n,o):void 0,h=u===void 0;if(h){var f=hn(l),g=!f&&Zi(l),E=!f&&!g&&no(l);u=l,f||g||E?hn(a)?u=a:mf(a)?u=sh(a):g?(h=!1,u=sf(l)):E?(h=!1,u=af(l)):u=[]:Qd(l)||os(l)?(u=a,os(a)?u=_f(a):(!ft(a)||es(a))&&(u=lf(l))):h=!1}h&&(o.set(l,u),s(u,l,r,i,o),o.delete(l)),us(e,t,u)}function ds(e,n,t,r,s){e!==n&&uf(n,function(i,o){if(s||(s=new dn),ft(i))pf(e,n,o,t,ds,r,s);else{var a=r?r(hs(e,o),i,o+"",e,n,s):void 0;a===void 0&&(a=i),us(e,o,a)}},ro)}var Ef=zi(function(e,n,t,r){ds(e,n,t,r)}),Cf=zi(function(e,n,t){ds(e,n,t)});function Rf(e,n,t,r){if(!ft(e))return e;n=io(n,e);for(var s=-1,i=n.length,o=i-1,a=e;a!=null&&++s<i;){var l=oo(n[s]),c=t;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(s!=o){var u=a[l];c=void 0,c===void 0&&(c=ft(u)?u:rs(n[s+1])?[]:{})}$i(a,l,c),a=a[l]}return e}function If(e,n,t){return e==null?e:Rf(e,n,t)}var nt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ht=-1,rt=1,Ye=0;function Dn(e,n,t,r,s){if(e===n)return e?[[Ye,e]]:[];if(t!=null){var i=Tf(e,n,t);if(i)return i}var o=gs(e,n),a=e.substring(0,o);e=e.substring(o),n=n.substring(o),o=Er(e,n);var l=e.substring(e.length-o);e=e.substring(0,e.length-o),n=n.substring(0,n.length-o);var c=vf(e,n);return a&&c.unshift([Ye,a]),l&&c.push([Ye,l]),ms(c,s),r&&bf(c),c}function vf(e,n){var t;if(!e)return[[rt,n]];if(!n)return[[ht,e]];var r=e.length>n.length?e:n,s=e.length>n.length?n:e,i=r.indexOf(s);if(i!==-1)return t=[[rt,r.substring(0,i)],[Ye,s],[rt,r.substring(i+s.length)]],e.length>n.length&&(t[0][0]=t[2][0]=ht),t;if(s.length===1)return[[ht,e],[rt,n]];var o=Of(e,n);if(o){var a=o[0],l=o[1],c=o[2],u=o[3],h=o[4],f=Dn(a,c),g=Dn(l,u);return f.concat([[Ye,h]],g)}return Sf(e,n)}function Sf(e,n){for(var t=e.length,r=n.length,s=Math.ceil((t+r)/2),i=s,o=2*s,a=new Array(o),l=new Array(o),c=0;c<o;c++)a[c]=-1,l[c]=-1;a[i+1]=0,l[i+1]=0;for(var u=t-r,h=u%2!==0,f=0,g=0,E=0,I=0,M=0;M<s;M++){for(var O=-M+f;O<=M-g;O+=2){var P=i+O,$;O===-M||O!==M&&a[P-1]<a[P+1]?$=a[P+1]:$=a[P-1]+1;for(var z=$-O;$<t&&z<r&&e.charAt($)===n.charAt(z);)$++,z++;if(a[P]=$,$>t)g+=2;else if(z>r)f+=2;else if(h){var w=i+u-O;if(w>=0&&w<o&&l[w]!==-1){var b=t-l[w];if($>=b)return go(e,n,$,z)}}}for(var D=-M+E;D<=M-I;D+=2){var w=i+D,b;D===-M||D!==M&&l[w-1]<l[w+1]?b=l[w+1]:b=l[w-1]+1;for(var G=b-D;b<t&&G<r&&e.charAt(t-b-1)===n.charAt(r-G-1);)b++,G++;if(l[w]=b,b>t)I+=2;else if(G>r)E+=2;else if(!h){var P=i+u-D;if(P>=0&&P<o&&a[P]!==-1){var $=a[P],z=i+$-P;if(b=t-b,$>=b)return go(e,n,$,z)}}}}return[[ht,e],[rt,n]]}function go(e,n,t,r){var s=e.substring(0,t),i=n.substring(0,r),o=e.substring(t),a=n.substring(r),l=Dn(s,i),c=Dn(o,a);return l.concat(c)}function gs(e,n){if(!e||!n||e.charAt(0)!==n.charAt(0))return 0;for(var t=0,r=Math.min(e.length,n.length),s=r,i=0;t<s;)e.substring(i,s)==n.substring(i,s)?(t=s,i=t):r=s,s=Math.floor((r-t)/2+t);return Co(e.charCodeAt(s-1))&&s--,s}function mo(e,n){var t=e.length,r=n.length;if(t==0||r==0)return 0;t>r?e=e.substring(t-r):t<r&&(n=n.substring(0,t));var s=Math.min(t,r);if(e==n)return s;for(var i=0,o=1;;){var a=e.substring(s-o),l=n.indexOf(a);if(l==-1)return i;o+=l,(l==0||e.substring(s-o)==n.substring(0,o))&&(i=o,o++)}}function Er(e,n){if(!e||!n||e.slice(-1)!==n.slice(-1))return 0;for(var t=0,r=Math.min(e.length,n.length),s=r,i=0;t<s;)e.substring(e.length-s,e.length-i)==n.substring(n.length-s,n.length-i)?(t=s,i=t):r=s,s=Math.floor((r-t)/2+t);return Ro(e.charCodeAt(e.length-s))&&s--,s}function Of(e,n){var t=e.length>n.length?e:n,r=e.length>n.length?n:e;if(t.length<4||r.length*2<t.length)return null;function s(g,E,I){for(var M=g.substring(I,I+Math.floor(g.length/4)),O=-1,P="",$,z,w,b;(O=E.indexOf(M,O+1))!==-1;){var D=gs(g.substring(I),E.substring(O)),G=Er(g.substring(0,I),E.substring(0,O));P.length<G+D&&(P=E.substring(O-G,O)+E.substring(O,O+D),$=g.substring(0,I-G),z=g.substring(I+D),w=E.substring(0,O-G),b=E.substring(O+D))}return P.length*2>=g.length?[$,z,w,b,P]:null}var i=s(t,r,Math.ceil(t.length/4)),o=s(t,r,Math.ceil(t.length/2)),a;if(!i&&!o)return null;o?i?a=i[4].length>o[4].length?i:o:a=o:a=i;var l,c,u,h;e.length>n.length?(l=a[0],c=a[1],u=a[2],h=a[3]):(u=a[0],h=a[1],l=a[2],c=a[3]);var f=a[4];return[l,c,u,h,f]}function bf(e){for(var n=!1,t=[],r=0,s=null,i=0,o=0,a=0,l=0,c=0;i<e.length;)e[i][0]==Ye?(t[r++]=i,o=l,a=c,l=0,c=0,s=e[i][1]):(e[i][0]==rt?l+=e[i][1].length:c+=e[i][1].length,s&&s.length<=Math.max(o,a)&&s.length<=Math.max(l,c)&&(e.splice(t[r-1],0,[ht,s]),e[t[r-1]+1][0]=rt,r--,r--,i=r>0?t[r-1]:-1,o=0,a=0,l=0,c=0,s=null,n=!0)),i++;for(n&&ms(e),Af(e),i=1;i<e.length;){if(e[i-1][0]==ht&&e[i][0]==rt){var u=e[i-1][1],h=e[i][1],f=mo(u,h),g=mo(h,u);f>=g?(f>=u.length/2||f>=h.length/2)&&(e.splice(i,0,[Ye,h.substring(0,f)]),e[i-1][1]=u.substring(0,u.length-f),e[i+1][1]=h.substring(f),i++):(g>=u.length/2||g>=h.length/2)&&(e.splice(i,0,[Ye,u.substring(0,g)]),e[i-1][0]=rt,e[i-1][1]=h.substring(0,h.length-g),e[i+1][0]=ht,e[i+1][1]=u.substring(g),i++),i++}i++}}var _o=/[^a-zA-Z0-9]/,po=/\s/,Eo=/[\r\n]/,yf=/\n\r?\n$/,wf=/^\r?\n\r?\n/;function Af(e){function n(g,E){if(!g||!E)return 6;var I=g.charAt(g.length-1),M=E.charAt(0),O=I.match(_o),P=M.match(_o),$=O&&I.match(po),z=P&&M.match(po),w=$&&I.match(Eo),b=z&&M.match(Eo),D=w&&g.match(yf),G=b&&E.match(wf);return D||G?5:w||b?4:O&&!$&&z?3:$||z?2:O||P?1:0}for(var t=1;t<e.length-1;){if(e[t-1][0]==Ye&&e[t+1][0]==Ye){var r=e[t-1][1],s=e[t][1],i=e[t+1][1],o=Er(r,s);if(o){var a=s.substring(s.length-o);r=r.substring(0,r.length-o),s=a+s.substring(0,s.length-o),i=a+i}for(var l=r,c=s,u=i,h=n(r,s)+n(s,i);s.charAt(0)===i.charAt(0);){r+=s.charAt(0),s=s.substring(1)+i.charAt(0),i=i.substring(1);var f=n(r,s)+n(s,i);f>=h&&(h=f,l=r,c=s,u=i)}e[t-1][1]!=l&&(l?e[t-1][1]=l:(e.splice(t-1,1),t--),e[t][1]=c,u?e[t+1][1]=u:(e.splice(t+1,1),t--))}t++}}function ms(e,n){e.push([Ye,""]);for(var t=0,r=0,s=0,i="",o="",a;t<e.length;){if(t<e.length-1&&!e[t][1]){e.splice(t,1);continue}switch(e[t][0]){case rt:s++,o+=e[t][1],t++;break;case ht:r++,i+=e[t][1],t++;break;case Ye:var l=t-s-r-1;if(n){if(l>=0&&vo(e[l][1])){var c=e[l][1].slice(-1);if(e[l][1]=e[l][1].slice(0,-1),i=c+i,o=c+o,!e[l][1]){e.splice(l,1),t--;var u=l-1;e[u]&&e[u][0]===rt&&(s++,o=e[u][1]+o,u--),e[u]&&e[u][0]===ht&&(r++,i=e[u][1]+i,u--),l=u}}if(Io(e[t][1])){var c=e[t][1].charAt(0);e[t][1]=e[t][1].slice(1),i+=c,o+=c}}if(t<e.length-1&&!e[t][1]){e.splice(t,1);break}if(i.length>0||o.length>0){i.length>0&&o.length>0&&(a=gs(o,i),a!==0&&(l>=0?e[l][1]+=o.substring(0,a):(e.splice(0,0,[Ye,o.substring(0,a)]),t++),o=o.substring(a),i=i.substring(a)),a=Er(o,i),a!==0&&(e[t][1]=o.substring(o.length-a)+e[t][1],o=o.substring(0,o.length-a),i=i.substring(0,i.length-a)));var h=s+r;i.length===0&&o.length===0?(e.splice(t-h,h),t=t-h):i.length===0?(e.splice(t-h,h,[rt,o]),t=t-h+1):o.length===0?(e.splice(t-h,h,[ht,i]),t=t-h+1):(e.splice(t-h,h,[ht,i],[rt,o]),t=t-h+2)}t!==0&&e[t-1][0]===Ye?(e[t-1][1]+=e[t][1],e.splice(t,1)):t++,s=0,r=0,i="",o="";break}}e[e.length-1][1]===""&&e.pop();var f=!1;for(t=1;t<e.length-1;)e[t-1][0]===Ye&&e[t+1][0]===Ye&&(e[t][1].substring(e[t][1].length-e[t-1][1].length)===e[t-1][1]?(e[t][1]=e[t-1][1]+e[t][1].substring(0,e[t][1].length-e[t-1][1].length),e[t+1][1]=e[t-1][1]+e[t+1][1],e.splice(t-1,1),f=!0):e[t][1].substring(0,e[t+1][1].length)==e[t+1][1]&&(e[t-1][1]+=e[t+1][1],e[t][1]=e[t][1].substring(e[t+1][1].length)+e[t+1][1],e.splice(t+1,1),f=!0)),t++;f&&ms(e,n)}function Co(e){return e>=55296&&e<=56319}function Ro(e){return e>=56320&&e<=57343}function Io(e){return Ro(e.charCodeAt(0))}function vo(e){return Co(e.charCodeAt(e.length-1))}function Nf(e){for(var n=[],t=0;t<e.length;t++)e[t][1].length>0&&n.push(e[t]);return n}function _s(e,n,t,r){return vo(e)||Io(r)?null:Nf([[Ye,e],[ht,n],[rt,t],[Ye,r]])}function Tf(e,n,t){var r=typeof t=="number"?{index:t,length:0}:t.oldRange,s=typeof t=="number"?null:t.newRange,i=e.length,o=n.length;if(r.length===0&&(s===null||s.length===0)){var a=r.index,l=e.slice(0,a),c=e.slice(a),u=s?s.index:null;e:{var h=a+o-i;if(u!==null&&u!==h||h<0||h>o)break e;var f=n.slice(0,h),g=n.slice(h);if(g!==c)break e;var E=Math.min(a,h),I=l.slice(0,E),M=f.slice(0,E);if(I!==M)break e;var O=l.slice(E),P=f.slice(E);return _s(I,O,P,c)}e:{if(u!==null&&u!==a)break e;var $=a,f=n.slice(0,$),g=n.slice($);if(f!==l)break e;var z=Math.min(i-$,o-$),w=c.slice(c.length-z),b=g.slice(g.length-z);if(w!==b)break e;var O=c.slice(0,c.length-z),P=g.slice(0,g.length-z);return _s(l,O,P,w)}}if(r.length>0&&s&&s.length===0)e:{var I=e.slice(0,r.index),w=e.slice(r.index+r.length),E=I.length,z=w.length;if(o<E+z)break e;var M=n.slice(0,E),b=n.slice(o-z);if(I!==M||w!==b)break e;var O=e.slice(E,i-z),P=n.slice(E,o-z);return _s(I,O,P,w)}return null}function Cr(e,n,t,r){return Dn(e,n,t,r,!0)}Cr.INSERT=rt,Cr.DELETE=ht,Cr.EQUAL=Ye;var Mf=Cr;const So=fs(Mf);function Un(e,n){const t=e.indexOf(n);return t>-1?(e.splice(t,1),!0):!1}function Lf(e){const n=new Set,t=[];for(const r of e)n.has(r)||(n.add(r),t.push(r));return t}function Df(e,n){for(let t=e.length-1;t>-1;t--){const r=e[t];if(n(r,t))return r}return null}function Uf(e,n){if(e.length===0)return e;const t=n%e.length;return e.slice(t).concat(e.slice(0,t))}function Pf(e,n){const t=new Map;return e.forEach(r=>{const s=n(r);let i=t.get(s);t.has(s)||(i=[],t.set(s,i)),i.push(r)}),t}function Ff(e){return Array.isArray(e)?e:[e]}function kf(e){return["true","false"].includes(e.toLowerCase())}const Pn="__INTERNAL_EDITOR__",ps=`${Pn}DOCS_NORMAL`,Es=`${Pn}DOCS_FORMULA_BAR`,Oo=`${Pn}ZEN_EDITOR`,bo=`\r
2
- `,xf="isRowStylePrecedeColumnStyle";function Hf(e){return`${Pn}${e}`}function yo(e){return e.startsWith(Pn)}var Cs=Symbol("$$IDENTIFIER_DECORATOR");function Bf(e){return e&&e[Cs]===!0}function Rs(e){return typeof e=="function"}function Is(e){return!!(e&&typeof e.useClass<"u")}function vs(e){return!!(e&&typeof e.useFactory<"u")}function Ss(e){return!!(e&&typeof e.useValue<"u")}function jf(e){return!!(e&&typeof e.useExisting<"u")}function Os(e){return!!(e&&typeof e.useAsync<"u")}var wo=Symbol("AsyncHook");function Rr(e){return!!(e&&e.__symbol===wo)}function dt(e){return typeof e>"u"?"undefined":Rs(e)&&!e[Cs]?e.name:e.toString()}d.Quantity=void 0,function(e){e.MANY="many",e.OPTIONAL="optional",e.REQUIRED="required"}(d.Quantity||(d.Quantity={})),d.LookUp=void 0,function(e){e.SELF="self",e.SKIP_SELF="skipSelf"}(d.LookUp||(d.LookUp={}));var $f=function(){var e=function(n,t){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(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Qe=function(e){$f(n,e);function n(t){return e.call(this,"[redi]: ".concat(t))||this}return n}(Error),Ao=function(){var e=function(n,t){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(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),No=Symbol("$$TARGET"),bs=Symbol("$$DEPENDENCIES"),Wf=function(e){Ao(n,e);function n(t,r){var s="Could not find dependency registered on the ".concat(t,' (indexed) parameter of the constructor of "').concat(dt(r),'".');return e.call(this,s)||this}return n}(Qe),To=function(e){Ao(n,e);function n(t,r){var s='It seems that you register "undefined" as dependency on the '.concat(r+1,' parameter of "').concat(dt(t),'". 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 n}(Qe);function Mo(e){var n=e;return n[bs]||[]}function ys(e,n){var t=Mo(e),r=t.find(function(s){return s.paramIndex===n});if(!r)throw new Wf(n,e);return r}function ws(e,n,t,r,s){r===void 0&&(r=d.Quantity.REQUIRED);var i={paramIndex:t,identifier:n,quantity:r,lookUp:s,withNew:!1};if(typeof n>"u")throw new To(e,t);var o=e;o[No]===o?o[bs].push(i):(o[bs]=[i],o[No]=o)}var Lo=new Set;function gt(e){if(Lo.has(e))throw new Qe('Identifier "'.concat(e,'" already exists.'));Lo.add(e);var n=function(t,r,s){ws(t,n,s)};return n.toString=function(){return e},n[Cs]=!0,n}var Vf=function(){var e=function(n,t){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(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),zf=function(e){Vf(n,e);function n(t,r,s){var i='Expect "'.concat(r,'" dependency items for id "').concat(dt(t),'" but get ').concat(s,".");return e.call(this,i)||this}return n}(Qe);function Do(e,n,t){if(n===d.Quantity.OPTIONAL&&t>1||n===d.Quantity.REQUIRED&&t!==1)throw new zf(e,n,t)}function Gf(e,n){return e===d.Quantity.MANY?n:n[0]}function Kf(e,n,t){var r=ys(e,n);r.quantity=t}function As(e){return function n(t){return this instanceof n?this:function(r,s,i){if(t)ws(r,t,i,e);else{if(e===d.Quantity.REQUIRED)throw new To(r,i);Kf(r,i,e)}}}}var Uo=As(d.Quantity.MANY),Po=As(d.Quantity.OPTIONAL),mt=As(d.Quantity.REQUIRED);function Yf(e){return{unwrap:e}}function Xf(e){return!!e&&typeof e.unwrap=="function"}function Qf(e){return Xf(e)?e.unwrap():e}function Ns(e){return!!e&&typeof e.dispose=="function"}var Fo=function(){var e=function(n,t){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(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();function Jf(e){return e.length===1}var Ir=[];function ko(e){Ir.push(e)}function xo(){Ir.pop()}function Zf(){Ir.length=0}var Ho=function(e){Fo(n,e);function n(t,r,s){var i='Cannot find "'.concat(dt(r),'" registered by any injector. It is the ').concat(s,'th param of "').concat(Bf(t)?dt(t):t.name,'".');return e.call(this,i)||this}return n}(Qe),vr=function(e){Fo(n,e);function n(t){var r=this,s='Cannot find "'.concat(dt(t),'" registered by any injector. The stack of dependencies is: "').concat(Ir.map(function(i){return dt(i)}).join(" -> "),'".');return r=e.call(this,s)||this,Zf(),r}return n}(Qe),qf=function(){function e(n){var t=this;this.dependencyMap=new Map,this.normalizeDependencies(n).map(function(r){return t.add(r[0],r[1])})}return e.prototype.add=function(n,t){typeof t>"u"&&(t={useClass:n,lazy:!1});var r=this.dependencyMap.get(n);typeof r>"u"&&(r=[],this.dependencyMap.set(n,r)),r.push(t)},e.prototype.delete=function(n){this.dependencyMap.delete(n)},e.prototype.get=function(n,t){t===void 0&&(t=d.Quantity.REQUIRED);var r=this.dependencyMap.get(n);return Do(n,t,r.length),Gf(t,r)},e.prototype.has=function(n){return this.dependencyMap.has(n)},e.prototype.append=function(n){var t=this;this.normalizeDependencies(n).forEach(function(r){return t.add(r[0],r[1])})},e.prototype.dispose=function(){this.dependencyMap.clear()},e.prototype.normalizeDependencies=function(n){return n.map(function(t){var r=t[0],s;return Jf(t)?s={useClass:t[0],lazy:!1}:s=t[1],[r,s]})},e}(),eg=function(){function e(){this.resolvedDependencies=new Map}return e.prototype.add=function(n,t){var r=this.resolvedDependencies.get(n);typeof r>"u"&&(r=[],this.resolvedDependencies.set(n,r)),r.push(t)},e.prototype.has=function(n){return this.resolvedDependencies.has(n)},e.prototype.delete=function(n){if(this.resolvedDependencies.has(n)){var t=this.resolvedDependencies.get(n);t.forEach(function(r){return Ns(r)?r.dispose():void 0}),this.resolvedDependencies.delete(n)}},e.prototype.get=function(n,t){t===void 0&&(t=d.Quantity.REQUIRED);var r=this.resolvedDependencies.get(n);if(!r)throw new vr(n);return Do(n,t,r.length),t===d.Quantity.MANY?r:r[0]},e.prototype.dispose=function(){Array.from(this.resolvedDependencies.values()).forEach(function(n){n.forEach(function(t){return Ns(t)?t.dispose():void 0})}),this.resolvedDependencies.clear()},e}();function tg(e,n,t){var r=ys(e,n);r.lookUp=t}function Bo(e){return function n(){return this instanceof n?this:function(t,r,s){tg(t,s,e)}}}var jo=Bo(d.LookUp.SKIP_SELF),$o=Bo(d.LookUp.SELF);function ng(e,n,t){var r=ys(e,n);r.withNew=t}function rg(e){return function n(){return this instanceof n?this:function(t,r,s){ng(t,s,e)}}}var Wo=rg(!0);function Vo(e,n){return n===void 0&&(n=0),e?e.map(function(t,r){if(r+=n,!Array.isArray(t))return{paramIndex:r,identifier:t,quantity:d.Quantity.REQUIRED,withNew:!1};var s=t.slice(0,t.length-1),i=t[t.length-1],o=void 0,a=d.Quantity.REQUIRED,l=!1;return s.forEach(function(c){if(c instanceof $o)o=d.LookUp.SELF;else if(c instanceof jo)o=d.LookUp.SKIP_SELF;else if(c instanceof Po)a=d.Quantity.OPTIONAL;else if(c instanceof Uo)a=d.Quantity.MANY;else if(c instanceof Wo)l=!0;else throw new Qe("unknown dep modifier ".concat(c,"."))}),{paramIndex:r,identifier:i,quantity:a,lookUp:o,withNew:l}}):[]}var Ts;(function(){if(typeof requestIdleCallback<"u"&&typeof cancelIdleCallback<"u")Ts=function(n,t){var r=requestIdleCallback(n,typeof t=="number"?{timeout:t}:void 0),s=!1;return function(){s||(s=!0,cancelIdleCallback(r))}};else{var e=Object.freeze({didTimeout:!0,timeRemaining:function(){return 15}});Ts=function(n){var t=setTimeout(function(){return n(e)}),r=!1;return function(){r||(r=!0,clearTimeout(t))}}}})();var sg=function(){function e(n){var t=this;this.didRun=!1,this.selfExecutor=function(){try{t.value=n()}catch(r){t.error=r}finally{t.didRun=!0}},this.disposeCallback=Ts(function(){return t.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}(),fn=function(){var e=function(n,t){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(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Sr=function(){return Sr=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++){n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Sr.apply(this,arguments)},Jt=function(e,n,t){if(t||arguments.length===2)for(var r=0,s=n.length,i;r<s;r++)(i||!(r in n))&&(i||(i=Array.prototype.slice.call(n,0,r)),i[r]=n[r]);return e.concat(i||Array.prototype.slice.call(n))},ig=300,Fn=Symbol("$$NOT_INSTANTIATED_SYMBOL"),og=function(e){fn(n,e);function n(t){return e.call(this,'Detecting cyclic dependency. The last identifier is "'.concat(dt(t),'".'))||this}return n}(Qe),ag=function(e){fn(n,e);function n(){return e.call(this,"Injector cannot be accessed after it was disposed.")||this}return n}(Qe),lg=function(e){fn(n,e);function n(t){return e.call(this,'Async item "'.concat(dt(t),'" returns another async item.'))||this}return n}(Qe),cg=function(e){fn(n,e);function n(t){return e.call(this,'Cannot get async item "'.concat(dt(t),'" from sync api.'))||this}return n}(Qe),zo=function(e){fn(n,e);function n(t){return e.call(this,'Cannot add dependency "'.concat(dt(t),'" after it is already resolved.'))||this}return n}(Qe),ug=function(e){fn(n,e);function n(t){return e.call(this,'Cannot dependency dependency "'.concat(dt(t),'" after it is already resolved.'))||this}return n}(Qe),Ot=function(){function e(n,t){t===void 0&&(t=null),this.parent=t,this.children=[],this.resolutionOngoing=0,this.disposed=!1,this.dependencyCollection=new qf(n||[]),this.resolvedDependencyCollection=new eg,t&&t.children.push(this)}return e.prototype.createChild=function(n){return this._ensureInjectorNotDisposed(),new e(n,this)},e.prototype.dispose=function(){this.children.forEach(function(n){return n.dispose()}),this.children.length=0,this.dependencyCollection.dispose(),this.resolvedDependencyCollection.dispose(),this.deleteSelfFromParent(),this.disposed=!0},e.prototype.deleteSelfFromParent=function(){if(this.parent){var n=this.parent.children.indexOf(this);n>-1&&this.parent.children.splice(n,1)}},e.prototype.add=function(n){this._ensureInjectorNotDisposed();var t=n[0],r=n[1];if(this.resolvedDependencyCollection.has(t))throw new zo(t);typeof r>"u"?this.dependencyCollection.add(t):Os(r)||Is(r)||Ss(r)||vs(r)?this.dependencyCollection.add(t,r):this.resolvedDependencyCollection.add(t,r)},e.prototype.replace=function(n){this._ensureInjectorNotDisposed();var t=n[0];if(this.resolvedDependencyCollection.has(t))throw new zo(t);this.dependencyCollection.delete(t),n.length===1?this.dependencyCollection.add(t):this.dependencyCollection.add(t,n[1])},e.prototype.delete=function(n){if(this._ensureInjectorNotDisposed(),this.resolvedDependencyCollection.has(n))throw new ug(n);this.dependencyCollection.delete(n)},e.prototype.invoke=function(n){for(var t=this,r=[],s=1;s<arguments.length;s++)r[s-1]=arguments[s];this._ensureInjectorNotDisposed();var i={get:function(o,a,l){return t._get(o,a,l)},has:function(o){return t.has(o)}};return n.apply(void 0,Jt([i],r,!1))},e.prototype.has=function(n){var t;return this.dependencyCollection.has(n)||((t=this.parent)===null||t===void 0?void 0:t.has(n))||!1},e.prototype.get=function(n,t,r){this._ensureInjectorNotDisposed();var s=this._get(n,t,r);if(Array.isArray(s)&&s.some(function(i){return Rr(i)})||Rr(s))throw new cg(n);return s},e.prototype._get=function(n,t,r,s){var i=d.Quantity.REQUIRED;if(t===d.Quantity.REQUIRED||t===d.Quantity.OPTIONAL||t===d.Quantity.MANY?i=t:r=t,!s){var o=this.getValue(n,i,r);if(o!==Fn)return o}return this.createDependency(n,i,r,!s)},e.prototype.getAsync=function(n){this._ensureInjectorNotDisposed();var t=this.getValue(n,d.Quantity.REQUIRED);if(t!==Fn)return Promise.resolve(t);var r=this.createDependency(n,d.Quantity.REQUIRED);return Rr(r)?r.whenReady():Promise.resolve(r)},e.prototype.createInstance=function(n){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return this._ensureInjectorNotDisposed(),this._resolveClassImpl.apply(this,Jt([{useClass:n}],t,!1))},e.prototype._resolveDependency=function(n,t,r){r===void 0&&(r=!0);var s;ko(n);try{Ss(t)?s=this._resolveValueDependency(n,t):vs(t)?s=this._resolveFactory(n,t,r):Is(t)?s=this._resolveClass(n,t,r):jf(t)?s=this._resolveExisting(n,t):s=this._resolveAsync(n,t),xo()}catch(i){throw xo(),i}return s},e.prototype._resolveExisting=function(n,t){var r=this.get(t.useExisting);return this.resolvedDependencyCollection.add(n,r),r},e.prototype._resolveValueDependency=function(n,t){var r=t.useValue;return this.resolvedDependencyCollection.add(n,r),r},e.prototype._resolveClass=function(n,t,r){var s=this;r===void 0&&(r=!0);var i;if(t.lazy){var o=new sg(function(){return s._ensureInjectorNotDisposed(),s._resolveClassImpl(t)});i=new Proxy(Object.create(null),{get:function(a,l){if(l in a)return a[l];if(l!=="whenReady"){var c=o.getValue(),u=c[l];return typeof u!="function"||(u=u.bind(c),a[l]=u),u}},set:function(a,l,c){return o.getValue()[l]=c,!0}})}else i=this._resolveClassImpl(t);return n&&r&&this.resolvedDependencyCollection.add(n,i),i},e.prototype._resolveClassImpl=function(n){for(var t,r=[],s=1;s<arguments.length;s++)r[s-1]=arguments[s];var i=n.useClass;this.markNewResolution(i);for(var o=Mo(i).sort(function(M,O){return M.paramIndex-O.paramIndex}).map(function(M){return Sr(Sr({},M),{identifier:Qf(M.identifier)})}),a=[],l=0,c=o;l<c.length;l++){var u=c[l];try{var h=this._get(u.identifier,u.quantity,u.lookUp,u.withNew);a.push(h)}catch(M){throw M instanceof vr?new Ho(i,u.identifier,u.paramIndex):M}}var f=Jt([],r,!0),g=o.length>0?o[0].paramIndex:f.length;if(f.length!==g){console.warn("[redi]: Expect ".concat(g," custom parameter(s) of ").concat(dt(i)," but get ").concat(f.length,"."));var E=g-f.length;E>0?f=Jt(Jt([],f,!0),new Array(E).fill(void 0),!0):f=f.slice(0,g)}var I=new(i.bind.apply(i,Jt(Jt([void 0],f,!1),a,!1)));return(t=n==null?void 0:n.onInstantiation)===null||t===void 0||t.call(n,I),this.markResolutionCompleted(),I},e.prototype._resolveFactory=function(n,t,r){var s;this.markNewResolution(n);for(var i=Vo(t.deps),o=[],a=0,l=i;a<l.length;a++){var c=l[a];try{var u=this._get(c.identifier,c.quantity,c.lookUp,c.withNew);o.push(u)}catch(f){throw f instanceof vr?new Ho(n,c.identifier,c.paramIndex):f}}var h=t.useFactory.apply(null,o);return r&&this.resolvedDependencyCollection.add(n,h),this.markResolutionCompleted(),(s=t==null?void 0:t.onInstantiation)===null||s===void 0||s.call(t,h),h},e.prototype._resolveAsync=function(n,t){var r=this,s={__symbol:wo,whenReady:function(){return r._resolveAsyncImpl(n,t)}};return s},e.prototype._resolveAsyncImpl=function(n,t){var r=this;return t.useAsync().then(function(s){var i=r.getValue(n);if(i!==Fn)return i;var o;if(Array.isArray(s)){var a=s[1];if(Os(a))throw new lg(n);o=r._resolveDependency(n,a)}else Rs(s)?o=r._resolveClassImpl({useClass:s,onInstantiation:t.onInstantiation}):o=s;return r.resolvedDependencyCollection.add(n,o),o})},e.prototype.getValue=function(n,t,r){var s=this;t===void 0&&(t=d.Quantity.REQUIRED);var i=function(){return s.dependencyCollection.has(n)&&!s.resolvedDependencyCollection.has(n)?Fn:s.resolvedDependencyCollection.get(n,t)},o=function(){return s.parent?s.parent.getValue(n,t):Fn};return r===d.LookUp.SKIP_SELF?o():r===d.LookUp.SELF||this.resolvedDependencyCollection.has(n)||this.dependencyCollection.has(n)?i():o()},e.prototype.createDependency=function(n,t,r,s){var i=this;t===void 0&&(t=d.Quantity.REQUIRED),s===void 0&&(s=!0);var o=function(){var l=i.dependencyCollection.get(n,t),c=null;return Array.isArray(l)?c=l.map(function(u){return i._resolveDependency(n,u,s)}):l&&(c=i._resolveDependency(n,l,s)),c},a=function(){if(i.parent)return i.parent.createDependency(n,t,void 0,s);if(t===d.Quantity.OPTIONAL)return null;throw ko(n),new vr(n)};return r===d.LookUp.SKIP_SELF?a():n===e?this:this.dependencyCollection.has(n)?o():a()},e.prototype.markNewResolution=function(n){if(this.resolutionOngoing+=1,this.resolutionOngoing>=ig)throw new og(n)},e.prototype.markResolutionCompleted=function(){this.resolutionOngoing-=1},e.prototype._ensureInjectorNotDisposed=function(){if(this.disposed)throw new ag},e}();function hg(e,n,t){t===void 0&&(t=0);var r=Vo(n,t);r.forEach(function(s){ws(e,s.identifier,s.paramIndex,s.quantity,s.lookUp)})}var Go=typeof globalThis<"u"&&globalThis||typeof window<"u"&&window||typeof global<"u"&&global,Ko="REDI_GLOBAL_LOCK",dg=typeof process<"u"&&process.versions!=null&&process.versions.node!=null;Go[Ko]?dg||console.error(`[redi]: You are loading scripts of redi more than once! This may cause undesired behavior in your application.
1
+ (function(d,ce){typeof exports=="object"&&typeof module<"u"?ce(exports,require("rxjs"),require("rxjs/operators"),require("react")):typeof define=="function"&&define.amd?define(["exports","rxjs","rxjs/operators","react"],ce):(d=typeof globalThis<"u"?globalThis:d||self,ce(d.UniverCore={},d.rxjs,d.rxjs.operators,d.React))})(this,function(d,ce,Ht,lt){"use strict";var k0=Object.defineProperty;var F0=(d,ce,Ht)=>ce in d?k0(d,ce,{enumerable:!0,configurable:!0,writable:!0,value:Ht}):d[ce]=Ht;var R=(d,ce,Ht)=>F0(d,typeof ce!="symbol"?ce+"":ce,Ht);var Oc,yc;function bc(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}function Ac(e,n){for(var t=0;t<n.length;t++){const r=n[t];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 At=bc(lt);function Tc(){Nc()}const Er=typeof global<"u"?global:typeof self<"u"?self:window;function Nc(){typeof Er.requestIdleCallback!="function"&&(Er.requestIdleCallback=function(t){const r=Date.now();return setTimeout(function(){const i=Math.max(0,50-(Date.now()-r));t({didTimeout:i===0,timeRemaining(){return i}})},1)}),typeof Er.cancelIdleCallback!="function"&&(Er.cancelIdleCallback=function(t){clearTimeout(t)})}var Li=typeof global=="object"&&global&&global.Object===Object&&global,Mc=typeof self=="object"&&self&&self.Object===Object&&self,sn=Li||Mc||Function("return this")(),En=sn.Symbol,Ui=Object.prototype,Dc=Ui.hasOwnProperty,Lc=Ui.toString,kn=En?En.toStringTag:void 0;function Uc(e){var n=Dc.call(e,kn),t=e[kn];try{e[kn]=void 0;var r=!0}catch{}var s=Lc.call(e);return r&&(n?e[kn]=t:delete e[kn]),s}var Pc=Object.prototype,kc=Pc.toString;function Fc(e){return kc.call(e)}var $c="[object Null]",xc="[object Undefined]",Pi=En?En.toStringTag:void 0;function Fn(e){return e==null?e===void 0?xc:$c:Pi&&Pi in Object(e)?Uc(e):Fc(e)}function Cn(e){return e!=null&&typeof e=="object"}var Hc="[object Symbol]";function Cr(e){return typeof e=="symbol"||Cn(e)&&Fn(e)==Hc}function Bc(e,n){for(var t=-1,r=e==null?0:e.length,s=Array(r);++t<r;)s[t]=n(e[t],t,e);return s}var vn=Array.isArray,jc=1/0,ki=En?En.prototype:void 0,Fi=ki?ki.toString:void 0;function $i(e){if(typeof e=="string")return e;if(vn(e))return Bc(e,$i)+"";if(Cr(e))return Fi?Fi.call(e):"";var n=e+"";return n=="0"&&1/e==-jc?"-0":n}var Wc=/\s/;function Yc(e){for(var n=e.length;n--&&Wc.test(e.charAt(n)););return n}var zc=/^\s+/;function Vc(e){return e&&e.slice(0,Yc(e)+1).replace(zc,"")}function Rt(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var xi=NaN,Gc=/^[-+]0x[0-9a-f]+$/i,Kc=/^0b[01]+$/i,Xc=/^0o[0-7]+$/i,Qc=parseInt;function Hi(e){if(typeof e=="number")return e;if(Cr(e))return xi;if(Rt(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=Rt(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=Vc(e);var t=Kc.test(e);return t||Xc.test(e)?Qc(e.slice(2),t?2:8):Gc.test(e)?xi:+e}function Bi(e){return e}var Jc="[object AsyncFunction]",Zc="[object Function]",qc="[object GeneratorFunction]",eh="[object Proxy]";function rs(e){if(!Rt(e))return!1;var n=Fn(e);return n==Zc||n==qc||n==Jc||n==eh}var ss=sn["__core-js_shared__"],ji=function(){var e=/[^.]+$/.exec(ss&&ss.keys&&ss.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function th(e){return!!ji&&ji in e}var nh=Function.prototype,rh=nh.toString;function sh(e){if(e!=null){try{return rh.call(e)}catch{}try{return e+""}catch{}}return""}var ih=/[\\^$.*+?()[\]{}|]/g,oh=/^\[object .+?Constructor\]$/,ah=Function.prototype,lh=Object.prototype,uh=ah.toString,ch=lh.hasOwnProperty,hh=RegExp("^"+uh.call(ch).replace(ih,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function dh(e){if(!Rt(e)||th(e))return!1;var n=rs(e)?hh:oh;return n.test(sh(e))}function fh(e,n){return e==null?void 0:e[n]}function is(e,n){var t=fh(e,n);return dh(t)?t:void 0}var Wi=Object.create,gh=function(){function e(){}return function(n){if(!Rt(n))return{};if(Wi)return Wi(n);e.prototype=n;var t=new e;return e.prototype=void 0,t}}();function mh(e,n,t){switch(t.length){case 0:return e.call(n);case 1:return e.call(n,t[0]);case 2:return e.call(n,t[0],t[1]);case 3:return e.call(n,t[0],t[1],t[2])}return e.apply(n,t)}function _h(e,n){var t=-1,r=e.length;for(n||(n=Array(r));++t<r;)n[t]=e[t];return n}var ph=800,Eh=16,Ch=Date.now;function vh(e){var n=0,t=0;return function(){var r=Ch(),s=Eh-(r-t);if(t=r,s>0){if(++n>=ph)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}function Rh(e){return function(){return e}}var vr=function(){try{var e=is(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Ih=vr?function(e,n){return vr(e,"toString",{configurable:!0,enumerable:!1,value:Rh(n),writable:!0})}:Bi,Sh=vh(Ih),Oh=9007199254740991,yh=/^(?:0|[1-9]\d*)$/;function os(e,n){var t=typeof e;return n=n==null?Oh:n,!!n&&(t=="number"||t!="symbol"&&yh.test(e))&&e>-1&&e%1==0&&e<n}function as(e,n,t){n=="__proto__"&&vr?vr(e,n,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[n]=t}function Rr(e,n){return e===n||e!==e&&n!==n}var wh=Object.prototype,bh=wh.hasOwnProperty;function Yi(e,n,t){var r=e[n];(!(bh.call(e,n)&&Rr(r,t))||t===void 0&&!(n in e))&&as(e,n,t)}function Ah(e,n,t,r){var s=!t;t||(t={});for(var i=-1,o=n.length;++i<o;){var a=n[i],l=void 0;l===void 0&&(l=e[a]),s?as(t,a,l):Yi(t,a,l)}return t}var zi=Math.max;function Th(e,n,t){return n=zi(n===void 0?e.length-1:n,0),function(){for(var r=arguments,s=-1,i=zi(r.length-n,0),o=Array(i);++s<i;)o[s]=r[n+s];s=-1;for(var a=Array(n+1);++s<n;)a[s]=r[s];return a[n]=t(o),mh(e,this,a)}}function Nh(e,n){return Sh(Th(e,n,Bi),e+"")}var Mh=9007199254740991;function Vi(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Mh}function ls(e){return e!=null&&Vi(e.length)&&!rs(e)}function Dh(e,n,t){if(!Rt(t))return!1;var r=typeof n;return(r=="number"?ls(t)&&os(n,t.length):r=="string"&&n in t)?Rr(t[n],e):!1}function Gi(e){return Nh(function(n,t){var r=-1,s=t.length,i=s>1?t[s-1]:void 0,o=s>2?t[2]:void 0;for(i=e.length>3&&typeof i=="function"?(s--,i):void 0,o&&Dh(t[0],t[1],o)&&(i=s<3?void 0:i,s=1),n=Object(n);++r<s;){var a=t[r];a&&e(n,a,r,i)}return n})}var Lh=Object.prototype;function Ki(e){var n=e&&e.constructor,t=typeof n=="function"&&n.prototype||Lh;return e===t}function Uh(e,n){for(var t=-1,r=Array(e);++t<e;)r[t]=n(t);return r}var Ph="[object Arguments]";function Xi(e){return Cn(e)&&Fn(e)==Ph}var Qi=Object.prototype,kh=Qi.hasOwnProperty,Fh=Qi.propertyIsEnumerable,us=Xi(function(){return arguments}())?Xi:function(e){return Cn(e)&&kh.call(e,"callee")&&!Fh.call(e,"callee")};function $h(){return!1}var Ji=typeof d=="object"&&d&&!d.nodeType&&d,Zi=Ji&&typeof module=="object"&&module&&!module.nodeType&&module,xh=Zi&&Zi.exports===Ji,qi=xh?sn.Buffer:void 0,Hh=qi?qi.isBuffer:void 0,eo=Hh||$h,Bh="[object Arguments]",jh="[object Array]",Wh="[object Boolean]",Yh="[object Date]",zh="[object Error]",Vh="[object Function]",Gh="[object Map]",Kh="[object Number]",Xh="[object Object]",Qh="[object RegExp]",Jh="[object Set]",Zh="[object String]",qh="[object WeakMap]",ed="[object ArrayBuffer]",td="[object DataView]",nd="[object Float32Array]",rd="[object Float64Array]",sd="[object Int8Array]",id="[object Int16Array]",od="[object Int32Array]",ad="[object Uint8Array]",ld="[object Uint8ClampedArray]",ud="[object Uint16Array]",cd="[object Uint32Array]",Qe={};Qe[nd]=Qe[rd]=Qe[sd]=Qe[id]=Qe[od]=Qe[ad]=Qe[ld]=Qe[ud]=Qe[cd]=!0,Qe[Bh]=Qe[jh]=Qe[ed]=Qe[Wh]=Qe[td]=Qe[Yh]=Qe[zh]=Qe[Vh]=Qe[Gh]=Qe[Kh]=Qe[Xh]=Qe[Qh]=Qe[Jh]=Qe[Zh]=Qe[qh]=!1;function hd(e){return Cn(e)&&Vi(e.length)&&!!Qe[Fn(e)]}function dd(e){return function(n){return e(n)}}var to=typeof d=="object"&&d&&!d.nodeType&&d,$n=to&&typeof module=="object"&&module&&!module.nodeType&&module,fd=$n&&$n.exports===to,cs=fd&&Li.process,no=function(){try{var e=$n&&$n.require&&$n.require("util").types;return e||cs&&cs.binding&&cs.binding("util")}catch{}}(),ro=no&&no.isTypedArray,so=ro?dd(ro):hd;function gd(e,n){var t=vn(e),r=!t&&us(e),s=!t&&!r&&eo(e),i=!t&&!r&&!s&&so(e),o=t||r||s||i,a=o?Uh(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")||os(c,l))||a.push(c);return a}function md(e,n){return function(t){return e(n(t))}}function _d(e){var n=[];if(e!=null)for(var t in Object(e))n.push(t);return n}var pd=Object.prototype,Ed=pd.hasOwnProperty;function Cd(e){if(!Rt(e))return _d(e);var n=Ki(e),t=[];for(var r in e)r=="constructor"&&(n||!Ed.call(e,r))||t.push(r);return t}function io(e){return ls(e)?gd(e):Cd(e)}var vd=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Rd=/^\w*$/;function Id(e,n){if(vn(e))return!1;var t=typeof e;return t=="number"||t=="symbol"||t=="boolean"||e==null||Cr(e)?!0:Rd.test(e)||!vd.test(e)||n!=null&&e in Object(n)}var xn=is(Object,"create");function Sd(){this.__data__=xn?xn(null):{},this.size=0}function Od(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}var yd="__lodash_hash_undefined__",wd=Object.prototype,bd=wd.hasOwnProperty;function Ad(e){var n=this.__data__;if(xn){var t=n[e];return t===yd?void 0:t}return bd.call(n,e)?n[e]:void 0}var Td=Object.prototype,Nd=Td.hasOwnProperty;function Md(e){var n=this.__data__;return xn?n[e]!==void 0:Nd.call(n,e)}var Dd="__lodash_hash_undefined__";function Ld(e,n){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=xn&&n===void 0?Dd:n,this}function on(e){var n=-1,t=e==null?0:e.length;for(this.clear();++n<t;){var r=e[n];this.set(r[0],r[1])}}on.prototype.clear=Sd,on.prototype.delete=Od,on.prototype.get=Ad,on.prototype.has=Md,on.prototype.set=Ld;function Ud(){this.__data__=[],this.size=0}function Ir(e,n){for(var t=e.length;t--;)if(Rr(e[t][0],n))return t;return-1}var Pd=Array.prototype,kd=Pd.splice;function Fd(e){var n=this.__data__,t=Ir(n,e);if(t<0)return!1;var r=n.length-1;return t==r?n.pop():kd.call(n,t,1),--this.size,!0}function $d(e){var n=this.__data__,t=Ir(n,e);return t<0?void 0:n[t][1]}function xd(e){return Ir(this.__data__,e)>-1}function Hd(e,n){var t=this.__data__,r=Ir(t,e);return r<0?(++this.size,t.push([e,n])):t[r][1]=n,this}function Bt(e){var n=-1,t=e==null?0:e.length;for(this.clear();++n<t;){var r=e[n];this.set(r[0],r[1])}}Bt.prototype.clear=Ud,Bt.prototype.delete=Fd,Bt.prototype.get=$d,Bt.prototype.has=xd,Bt.prototype.set=Hd;var oo=is(sn,"Map");function Bd(){this.size=0,this.__data__={hash:new on,map:new(oo||Bt),string:new on}}function jd(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}function Sr(e,n){var t=e.__data__;return jd(n)?t[typeof n=="string"?"string":"hash"]:t.map}function Wd(e){var n=Sr(this,e).delete(e);return this.size-=n?1:0,n}function Yd(e){return Sr(this,e).get(e)}function zd(e){return Sr(this,e).has(e)}function Vd(e,n){var t=Sr(this,e),r=t.size;return t.set(e,n),this.size+=t.size==r?0:1,this}function Kt(e){var n=-1,t=e==null?0:e.length;for(this.clear();++n<t;){var r=e[n];this.set(r[0],r[1])}}Kt.prototype.clear=Bd,Kt.prototype.delete=Wd,Kt.prototype.get=Yd,Kt.prototype.has=zd,Kt.prototype.set=Vd;var Gd="Expected a function";function hs(e,n){if(typeof e!="function"||n!=null&&typeof n!="function")throw new TypeError(Gd);var t=function(){var r=arguments,s=n?n.apply(this,r):r[0],i=t.cache;if(i.has(s))return i.get(s);var o=e.apply(this,r);return t.cache=i.set(s,o)||i,o};return t.cache=new(hs.Cache||Kt),t}hs.Cache=Kt;var Kd=500;function Xd(e){var n=hs(e,function(r){return t.size===Kd&&t.clear(),r}),t=n.cache;return n}var Qd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Jd=/\\(\\)?/g,Zd=Xd(function(e){var n=[];return e.charCodeAt(0)===46&&n.push(""),e.replace(Qd,function(t,r,s,i){n.push(s?i.replace(Jd,"$1"):r||t)}),n});function qd(e){return e==null?"":$i(e)}function ao(e,n){return vn(e)?e:Id(e,n)?[e]:Zd(qd(e))}var ef=1/0;function lo(e){if(typeof e=="string"||Cr(e))return e;var n=e+"";return n=="0"&&1/e==-ef?"-0":n}function tf(e,n){n=ao(n,e);for(var t=0,r=n.length;e!=null&&t<r;)e=e[lo(n[t++])];return t&&t==r?e:void 0}function nf(e,n,t){var r=e==null?void 0:tf(e,n);return r===void 0?t:r}var uo=md(Object.getPrototypeOf,Object),rf="[object Object]",sf=Function.prototype,of=Object.prototype,co=sf.toString,af=of.hasOwnProperty,lf=co.call(Object);function uf(e){if(!Cn(e)||Fn(e)!=rf)return!1;var n=uo(e);if(n===null)return!0;var t=af.call(n,"constructor")&&n.constructor;return typeof t=="function"&&t instanceof t&&co.call(t)==lf}function cf(){this.__data__=new Bt,this.size=0}function hf(e){var n=this.__data__,t=n.delete(e);return this.size=n.size,t}function df(e){return this.__data__.get(e)}function ff(e){return this.__data__.has(e)}var gf=200;function mf(e,n){var t=this.__data__;if(t instanceof Bt){var r=t.__data__;if(!oo||r.length<gf-1)return r.push([e,n]),this.size=++t.size,this;t=this.__data__=new Kt(r)}return t.set(e,n),this.size=t.size,this}function Rn(e){var n=this.__data__=new Bt(e);this.size=n.size}Rn.prototype.clear=cf,Rn.prototype.delete=hf,Rn.prototype.get=df,Rn.prototype.has=ff,Rn.prototype.set=mf;var ho=typeof d=="object"&&d&&!d.nodeType&&d,fo=ho&&typeof module=="object"&&module&&!module.nodeType&&module,_f=fo&&fo.exports===ho,go=_f?sn.Buffer:void 0;go&&go.allocUnsafe;function pf(e,n){return e.slice()}var mo=sn.Uint8Array;function Ef(e){var n=new e.constructor(e.byteLength);return new mo(n).set(new mo(e)),n}function Cf(e,n){var t=Ef(e.buffer);return new e.constructor(t,e.byteOffset,e.length)}function vf(e){return typeof e.constructor=="function"&&!Ki(e)?gh(uo(e)):{}}function Rf(e){return function(n,t,r){for(var s=-1,i=Object(n),o=r(n),a=o.length;a--;){var l=o[++s];if(t(i[l],l,i)===!1)break}return n}}var If=Rf(),ds=function(){return sn.Date.now()},Sf="Expected a function",Of=Math.max,yf=Math.min;function wf(e,n,t){var r,s,i,o,a,l,c=0,h=!1,u=!1,f=!0;if(typeof e!="function")throw new TypeError(Sf);n=Hi(n)||0,Rt(t)&&(h=!!t.leading,u="maxWait"in t,i=u?Of(Hi(t.maxWait)||0,n):i,f="trailing"in t?!!t.trailing:f);function g(b){var P=r,W=s;return r=s=void 0,c=b,o=e.apply(W,P),o}function p(b){return c=b,a=setTimeout(S,n),h?g(b):o}function C(b){var P=b-l,W=b-c,he=n-P;return u?yf(he,i-W):he}function I(b){var P=b-l,W=b-c;return l===void 0||P>=n||P<0||u&&W>=i}function S(){var b=ds();if(I(b))return D(b);a=setTimeout(S,C(b))}function D(b){return a=void 0,f&&r?g(b):(r=s=void 0,o)}function U(){a!==void 0&&clearTimeout(a),c=0,r=l=s=a=void 0}function B(){return a===void 0?o:D(ds())}function w(){var b=ds(),P=I(b);if(r=arguments,s=this,l=b,P){if(a===void 0)return p(l);if(u)return clearTimeout(a),a=setTimeout(S,n),g(l)}return a===void 0&&(a=setTimeout(S,n)),o}return w.cancel=U,w.flush=B,w}function fs(e,n,t){(t!==void 0&&!Rr(e[n],t)||t===void 0&&!(n in e))&&as(e,n,t)}function bf(e){return Cn(e)&&ls(e)}function gs(e,n){if(!(n==="constructor"&&typeof e[n]=="function")&&n!="__proto__")return e[n]}function Af(e){return Ah(e,io(e))}function Tf(e,n,t,r,s,i,o){var a=gs(e,t),l=gs(n,t),c=o.get(l);if(c){fs(e,t,c);return}var h=i?i(a,l,t+"",e,n,o):void 0,u=h===void 0;if(u){var f=vn(l),g=!f&&eo(l),p=!f&&!g&&so(l);h=l,f||g||p?vn(a)?h=a:bf(a)?h=_h(a):g?(u=!1,h=pf(l)):p?(u=!1,h=Cf(l)):h=[]:uf(l)||us(l)?(h=a,us(a)?h=Af(a):(!Rt(a)||rs(a))&&(h=vf(l))):u=!1}u&&(o.set(l,h),s(h,l,r,i,o),o.delete(l)),fs(e,t,h)}function ms(e,n,t,r,s){e!==n&&If(n,function(i,o){if(s||(s=new Rn),Rt(i))Tf(e,n,o,t,ms,r,s);else{var a=r?r(gs(e,o),i,o+"",e,n,s):void 0;a===void 0&&(a=i),fs(e,o,a)}},io)}var Nf=Gi(function(e,n,t,r){ms(e,n,t,r)}),Mf=Gi(function(e,n,t){ms(e,n,t)});function Df(e,n,t,r){if(!Rt(e))return e;n=ao(n,e);for(var s=-1,i=n.length,o=i-1,a=e;a!=null&&++s<i;){var l=lo(n[s]),c=t;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:os(n[s+1])?[]:{})}Yi(a,l,c),a=a[l]}return e}function Lf(e,n,t){return e==null?e:Df(e,n,t)}var Je=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function It(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ct=-1,dt=1,it=0;function Hn(e,n,t,r,s){if(e===n)return e?[[it,e]]:[];if(t!=null){var i=jf(e,n,t);if(i)return i}var o=_s(e,n),a=e.substring(0,o);e=e.substring(o),n=n.substring(o),o=Or(e,n);var l=e.substring(e.length-o);e=e.substring(0,e.length-o),n=n.substring(0,n.length-o);var c=Uf(e,n);return a&&c.unshift([it,a]),l&&c.push([it,l]),ps(c,s),r&&Ff(c),c}function Uf(e,n){var t;if(!e)return[[dt,n]];if(!n)return[[Ct,e]];var r=e.length>n.length?e:n,s=e.length>n.length?n:e,i=r.indexOf(s);if(i!==-1)return t=[[dt,r.substring(0,i)],[it,s],[dt,r.substring(i+s.length)]],e.length>n.length&&(t[0][0]=t[2][0]=Ct),t;if(s.length===1)return[[Ct,e],[dt,n]];var o=kf(e,n);if(o){var a=o[0],l=o[1],c=o[2],h=o[3],u=o[4],f=Hn(a,c),g=Hn(l,h);return f.concat([[it,u]],g)}return Pf(e,n)}function Pf(e,n){for(var t=e.length,r=n.length,s=Math.ceil((t+r)/2),i=s,o=2*s,a=new Array(o),l=new Array(o),c=0;c<o;c++)a[c]=-1,l[c]=-1;a[i+1]=0,l[i+1]=0;for(var h=t-r,u=h%2!==0,f=0,g=0,p=0,C=0,I=0;I<s;I++){for(var S=-I+f;S<=I-g;S+=2){var D=i+S,U;S===-I||S!==I&&a[D-1]<a[D+1]?U=a[D+1]:U=a[D-1]+1;for(var B=U-S;U<t&&B<r&&e.charAt(U)===n.charAt(B);)U++,B++;if(a[D]=U,U>t)g+=2;else if(B>r)f+=2;else if(u){var w=i+h-S;if(w>=0&&w<o&&l[w]!==-1){var b=t-l[w];if(U>=b)return _o(e,n,U,B)}}}for(var P=-I+p;P<=I-C;P+=2){var w=i+P,b;P===-I||P!==I&&l[w-1]<l[w+1]?b=l[w+1]:b=l[w-1]+1;for(var W=b-P;b<t&&W<r&&e.charAt(t-b-1)===n.charAt(r-W-1);)b++,W++;if(l[w]=b,b>t)C+=2;else if(W>r)p+=2;else if(!u){var D=i+h-P;if(D>=0&&D<o&&a[D]!==-1){var U=a[D],B=i+U-D;if(b=t-b,U>=b)return _o(e,n,U,B)}}}}return[[Ct,e],[dt,n]]}function _o(e,n,t,r){var s=e.substring(0,t),i=n.substring(0,r),o=e.substring(t),a=n.substring(r),l=Hn(s,i),c=Hn(o,a);return l.concat(c)}function _s(e,n){if(!e||!n||e.charAt(0)!==n.charAt(0))return 0;for(var t=0,r=Math.min(e.length,n.length),s=r,i=0;t<s;)e.substring(i,s)==n.substring(i,s)?(t=s,i=t):r=s,s=Math.floor((r-t)/2+t);return Ro(e.charCodeAt(s-1))&&s--,s}function po(e,n){var t=e.length,r=n.length;if(t==0||r==0)return 0;t>r?e=e.substring(t-r):t<r&&(n=n.substring(0,t));var s=Math.min(t,r);if(e==n)return s;for(var i=0,o=1;;){var a=e.substring(s-o),l=n.indexOf(a);if(l==-1)return i;o+=l,(l==0||e.substring(s-o)==n.substring(0,o))&&(i=o,o++)}}function Or(e,n){if(!e||!n||e.slice(-1)!==n.slice(-1))return 0;for(var t=0,r=Math.min(e.length,n.length),s=r,i=0;t<s;)e.substring(e.length-s,e.length-i)==n.substring(n.length-s,n.length-i)?(t=s,i=t):r=s,s=Math.floor((r-t)/2+t);return Io(e.charCodeAt(e.length-s))&&s--,s}function kf(e,n){var t=e.length>n.length?e:n,r=e.length>n.length?n:e;if(t.length<4||r.length*2<t.length)return null;function s(g,p,C){for(var I=g.substring(C,C+Math.floor(g.length/4)),S=-1,D="",U,B,w,b;(S=p.indexOf(I,S+1))!==-1;){var P=_s(g.substring(C),p.substring(S)),W=Or(g.substring(0,C),p.substring(0,S));D.length<W+P&&(D=p.substring(S-W,S)+p.substring(S,S+P),U=g.substring(0,C-W),B=g.substring(C+P),w=p.substring(0,S-W),b=p.substring(S+P))}return D.length*2>=g.length?[U,B,w,b,D]:null}var i=s(t,r,Math.ceil(t.length/4)),o=s(t,r,Math.ceil(t.length/2)),a;if(!i&&!o)return null;o?i?a=i[4].length>o[4].length?i:o:a=o:a=i;var l,c,h,u;e.length>n.length?(l=a[0],c=a[1],h=a[2],u=a[3]):(h=a[0],u=a[1],l=a[2],c=a[3]);var f=a[4];return[l,c,h,u,f]}function Ff(e){for(var n=!1,t=[],r=0,s=null,i=0,o=0,a=0,l=0,c=0;i<e.length;)e[i][0]==it?(t[r++]=i,o=l,a=c,l=0,c=0,s=e[i][1]):(e[i][0]==dt?l+=e[i][1].length:c+=e[i][1].length,s&&s.length<=Math.max(o,a)&&s.length<=Math.max(l,c)&&(e.splice(t[r-1],0,[Ct,s]),e[t[r-1]+1][0]=dt,r--,r--,i=r>0?t[r-1]:-1,o=0,a=0,l=0,c=0,s=null,n=!0)),i++;for(n&&ps(e),Hf(e),i=1;i<e.length;){if(e[i-1][0]==Ct&&e[i][0]==dt){var h=e[i-1][1],u=e[i][1],f=po(h,u),g=po(u,h);f>=g?(f>=h.length/2||f>=u.length/2)&&(e.splice(i,0,[it,u.substring(0,f)]),e[i-1][1]=h.substring(0,h.length-f),e[i+1][1]=u.substring(f),i++):(g>=h.length/2||g>=u.length/2)&&(e.splice(i,0,[it,h.substring(0,g)]),e[i-1][0]=dt,e[i-1][1]=u.substring(0,u.length-g),e[i+1][0]=Ct,e[i+1][1]=h.substring(g),i++),i++}i++}}var Eo=/[^a-zA-Z0-9]/,Co=/\s/,vo=/[\r\n]/,$f=/\n\r?\n$/,xf=/^\r?\n\r?\n/;function Hf(e){function n(g,p){if(!g||!p)return 6;var C=g.charAt(g.length-1),I=p.charAt(0),S=C.match(Eo),D=I.match(Eo),U=S&&C.match(Co),B=D&&I.match(Co),w=U&&C.match(vo),b=B&&I.match(vo),P=w&&g.match($f),W=b&&p.match(xf);return P||W?5:w||b?4:S&&!U&&B?3:U||B?2:S||D?1:0}for(var t=1;t<e.length-1;){if(e[t-1][0]==it&&e[t+1][0]==it){var r=e[t-1][1],s=e[t][1],i=e[t+1][1],o=Or(r,s);if(o){var a=s.substring(s.length-o);r=r.substring(0,r.length-o),s=a+s.substring(0,s.length-o),i=a+i}for(var l=r,c=s,h=i,u=n(r,s)+n(s,i);s.charAt(0)===i.charAt(0);){r+=s.charAt(0),s=s.substring(1)+i.charAt(0),i=i.substring(1);var f=n(r,s)+n(s,i);f>=u&&(u=f,l=r,c=s,h=i)}e[t-1][1]!=l&&(l?e[t-1][1]=l:(e.splice(t-1,1),t--),e[t][1]=c,h?e[t+1][1]=h:(e.splice(t+1,1),t--))}t++}}function ps(e,n){e.push([it,""]);for(var t=0,r=0,s=0,i="",o="",a;t<e.length;){if(t<e.length-1&&!e[t][1]){e.splice(t,1);continue}switch(e[t][0]){case dt:s++,o+=e[t][1],t++;break;case Ct:r++,i+=e[t][1],t++;break;case it:var l=t-s-r-1;if(n){if(l>=0&&Oo(e[l][1])){var c=e[l][1].slice(-1);if(e[l][1]=e[l][1].slice(0,-1),i=c+i,o=c+o,!e[l][1]){e.splice(l,1),t--;var h=l-1;e[h]&&e[h][0]===dt&&(s++,o=e[h][1]+o,h--),e[h]&&e[h][0]===Ct&&(r++,i=e[h][1]+i,h--),l=h}}if(So(e[t][1])){var c=e[t][1].charAt(0);e[t][1]=e[t][1].slice(1),i+=c,o+=c}}if(t<e.length-1&&!e[t][1]){e.splice(t,1);break}if(i.length>0||o.length>0){i.length>0&&o.length>0&&(a=_s(o,i),a!==0&&(l>=0?e[l][1]+=o.substring(0,a):(e.splice(0,0,[it,o.substring(0,a)]),t++),o=o.substring(a),i=i.substring(a)),a=Or(o,i),a!==0&&(e[t][1]=o.substring(o.length-a)+e[t][1],o=o.substring(0,o.length-a),i=i.substring(0,i.length-a)));var u=s+r;i.length===0&&o.length===0?(e.splice(t-u,u),t=t-u):i.length===0?(e.splice(t-u,u,[dt,o]),t=t-u+1):o.length===0?(e.splice(t-u,u,[Ct,i]),t=t-u+1):(e.splice(t-u,u,[Ct,i],[dt,o]),t=t-u+2)}t!==0&&e[t-1][0]===it?(e[t-1][1]+=e[t][1],e.splice(t,1)):t++,s=0,r=0,i="",o="";break}}e[e.length-1][1]===""&&e.pop();var f=!1;for(t=1;t<e.length-1;)e[t-1][0]===it&&e[t+1][0]===it&&(e[t][1].substring(e[t][1].length-e[t-1][1].length)===e[t-1][1]?(e[t][1]=e[t-1][1]+e[t][1].substring(0,e[t][1].length-e[t-1][1].length),e[t+1][1]=e[t-1][1]+e[t+1][1],e.splice(t-1,1),f=!0):e[t][1].substring(0,e[t+1][1].length)==e[t+1][1]&&(e[t-1][1]+=e[t+1][1],e[t][1]=e[t][1].substring(e[t+1][1].length)+e[t+1][1],e.splice(t+1,1),f=!0)),t++;f&&ps(e,n)}function Ro(e){return e>=55296&&e<=56319}function Io(e){return e>=56320&&e<=57343}function So(e){return Io(e.charCodeAt(0))}function Oo(e){return Ro(e.charCodeAt(e.length-1))}function Bf(e){for(var n=[],t=0;t<e.length;t++)e[t][1].length>0&&n.push(e[t]);return n}function Es(e,n,t,r){return Oo(e)||So(r)?null:Bf([[it,e],[Ct,n],[dt,t],[it,r]])}function jf(e,n,t){var r=typeof t=="number"?{index:t,length:0}:t.oldRange,s=typeof t=="number"?null:t.newRange,i=e.length,o=n.length;if(r.length===0&&(s===null||s.length===0)){var a=r.index,l=e.slice(0,a),c=e.slice(a),h=s?s.index:null;e:{var u=a+o-i;if(h!==null&&h!==u||u<0||u>o)break e;var f=n.slice(0,u),g=n.slice(u);if(g!==c)break e;var p=Math.min(a,u),C=l.slice(0,p),I=f.slice(0,p);if(C!==I)break e;var S=l.slice(p),D=f.slice(p);return Es(C,S,D,c)}e:{if(h!==null&&h!==a)break e;var U=a,f=n.slice(0,U),g=n.slice(U);if(f!==l)break e;var B=Math.min(i-U,o-U),w=c.slice(c.length-B),b=g.slice(g.length-B);if(w!==b)break e;var S=c.slice(0,c.length-B),D=g.slice(0,g.length-B);return Es(l,S,D,w)}}if(r.length>0&&s&&s.length===0)e:{var C=e.slice(0,r.index),w=e.slice(r.index+r.length),p=C.length,B=w.length;if(o<p+B)break e;var I=n.slice(0,p),b=n.slice(o-B);if(C!==I||w!==b)break e;var S=e.slice(p,i-B),D=n.slice(p,o-B);return Es(C,S,D,w)}return null}function yr(e,n,t,r){return Hn(e,n,t,r,!0)}yr.INSERT=dt,yr.DELETE=Ct,yr.EQUAL=it;var Wf=yr;const yo=It(Wf);function Bn(e,n){const t=e.indexOf(n);return t>-1?(e.splice(t,1),!0):!1}function Yf(e){const n=new Set,t=[];for(const r of e)n.has(r)||(n.add(r),t.push(r));return t}function zf(e,n){for(let t=e.length-1;t>-1;t--){const r=e[t];if(n(r,t))return r}return null}function Vf(e,n){if(e.length===0)return e;const t=n%e.length;return e.slice(t).concat(e.slice(0,t))}function Gf(e,n){const t=new Map;return e.forEach(r=>{const s=n(r);let i=t.get(s);t.has(s)||(i=[],t.set(s,i)),i.push(r)}),t}function Kf(e){return Array.isArray(e)?e:[e]}function Xf(e){return["true","false"].includes(e.toLowerCase())}const jn="__INTERNAL_EDITOR__",Cs=`${jn}DOCS_NORMAL`,vs=`${jn}DOCS_FORMULA_BAR`,wo=`${jn}ZEN_EDITOR`,bo=`\r
2
+ `,Qf="isRowStylePrecedeColumnStyle";function Jf(e){return`${jn}${e}`}function Ao(e){return e.startsWith(jn)}var Rs=Symbol("$$IDENTIFIER_DECORATOR");function Zf(e){return e&&e[Rs]===!0}function Is(e){return typeof e=="function"}function Ss(e){return!!(e&&typeof e.useClass<"u")}function Os(e){return!!(e&&typeof e.useFactory<"u")}function ys(e){return!!(e&&typeof e.useValue<"u")}function qf(e){return!!(e&&typeof e.useExisting<"u")}function ws(e){return!!(e&&typeof e.useAsync<"u")}var To=Symbol("AsyncHook");function wr(e){return!!(e&&e.__symbol===To)}function vt(e){return typeof e>"u"?"undefined":Is(e)&&!e[Rs]?e.name:e.toString()}d.Quantity=void 0,function(e){e.MANY="many",e.OPTIONAL="optional",e.REQUIRED="required"}(d.Quantity||(d.Quantity={})),d.LookUp=void 0,function(e){e.SELF="self",e.SKIP_SELF="skipSelf"}(d.LookUp||(d.LookUp={}));var eg=function(){var e=function(n,t){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(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),at=function(e){eg(n,e);function n(t){return e.call(this,"[redi]: ".concat(t))||this}return n}(Error),No=function(){var e=function(n,t){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(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Mo=Symbol("$$TARGET"),bs=Symbol("$$DEPENDENCIES"),tg=function(e){No(n,e);function n(t,r){var s="Could not find dependency registered on the ".concat(t,' (indexed) parameter of the constructor of "').concat(vt(r),'".');return e.call(this,s)||this}return n}(at),Do=function(e){No(n,e);function n(t,r){var s='It seems that you register "undefined" as dependency on the '.concat(r+1,' parameter of "').concat(vt(t),'". 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 n}(at);function Lo(e){var n=e;return n[bs]||[]}function As(e,n){var t=Lo(e),r=t.find(function(s){return s.paramIndex===n});if(!r)throw new tg(n,e);return r}function Ts(e,n,t,r,s){r===void 0&&(r=d.Quantity.REQUIRED);var i={paramIndex:t,identifier:n,quantity:r,lookUp:s,withNew:!1};if(typeof n>"u")throw new Do(e,t);var o=e;o[Mo]===o?o[bs].push(i):(o[bs]=[i],o[Mo]=o)}var Uo=new Set;function St(e){if(Uo.has(e))throw new at('Identifier "'.concat(e,'" already exists.'));Uo.add(e);var n=function(t,r,s){Ts(t,n,s)};return n.toString=function(){return e},n[Rs]=!0,n}var ng=function(){var e=function(n,t){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(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),rg=function(e){ng(n,e);function n(t,r,s){var i='Expect "'.concat(r,'" dependency items for id "').concat(vt(t),'" but get ').concat(s,".");return e.call(this,i)||this}return n}(at);function Po(e,n,t){if(n===d.Quantity.OPTIONAL&&t>1||n===d.Quantity.REQUIRED&&t!==1)throw new rg(e,n,t)}function sg(e,n){return e===d.Quantity.MANY?n:n[0]}function ig(e,n,t){var r=As(e,n);r.quantity=t}function Ns(e){return function n(t){return this instanceof n?this:function(r,s,i){if(t)Ts(r,t,i,e);else{if(e===d.Quantity.REQUIRED)throw new Do(r,i);ig(r,i,e)}}}}var ko=Ns(d.Quantity.MANY),Fo=Ns(d.Quantity.OPTIONAL),Ot=Ns(d.Quantity.REQUIRED);function og(e){return{unwrap:e}}function ag(e){return!!e&&typeof e.unwrap=="function"}function lg(e){return ag(e)?e.unwrap():e}function Ms(e){return!!e&&typeof e.dispose=="function"}var $o=function(){var e=function(n,t){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(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();function ug(e){return e.length===1}var br=[];function xo(e){br.push(e)}function Ho(){br.pop()}function cg(){br.length=0}var Bo=function(e){$o(n,e);function n(t,r,s){var i='Cannot find "'.concat(vt(r),'" registered by any injector. It is the ').concat(s,'th param of "').concat(Zf(t)?vt(t):t.name,'".');return e.call(this,i)||this}return n}(at),Ar=function(e){$o(n,e);function n(t){var r=this,s='Cannot find "'.concat(vt(t),'" registered by any injector. The stack of dependencies is: "').concat(br.map(function(i){return vt(i)}).join(" -> "),'".');return r=e.call(this,s)||this,cg(),r}return n}(at),hg=function(){function e(n){var t=this;this.dependencyMap=new Map,this.normalizeDependencies(n).map(function(r){return t.add(r[0],r[1])})}return e.prototype.add=function(n,t){typeof t>"u"&&(t={useClass:n,lazy:!1});var r=this.dependencyMap.get(n);typeof r>"u"&&(r=[],this.dependencyMap.set(n,r)),r.push(t)},e.prototype.delete=function(n){this.dependencyMap.delete(n)},e.prototype.get=function(n,t){t===void 0&&(t=d.Quantity.REQUIRED);var r=this.dependencyMap.get(n);return Po(n,t,r.length),sg(t,r)},e.prototype.has=function(n){return this.dependencyMap.has(n)},e.prototype.append=function(n){var t=this;this.normalizeDependencies(n).forEach(function(r){return t.add(r[0],r[1])})},e.prototype.dispose=function(){this.dependencyMap.clear()},e.prototype.normalizeDependencies=function(n){return n.map(function(t){var r=t[0],s;return ug(t)?s={useClass:t[0],lazy:!1}:s=t[1],[r,s]})},e}(),dg=function(){function e(){this.resolvedDependencies=new Map}return e.prototype.add=function(n,t){var r=this.resolvedDependencies.get(n);typeof r>"u"&&(r=[],this.resolvedDependencies.set(n,r)),r.push(t)},e.prototype.has=function(n){return this.resolvedDependencies.has(n)},e.prototype.delete=function(n){if(this.resolvedDependencies.has(n)){var t=this.resolvedDependencies.get(n);t.forEach(function(r){return Ms(r)?r.dispose():void 0}),this.resolvedDependencies.delete(n)}},e.prototype.get=function(n,t){t===void 0&&(t=d.Quantity.REQUIRED);var r=this.resolvedDependencies.get(n);if(!r)throw new Ar(n);return Po(n,t,r.length),t===d.Quantity.MANY?r:r[0]},e.prototype.dispose=function(){Array.from(this.resolvedDependencies.values()).forEach(function(n){n.forEach(function(t){return Ms(t)?t.dispose():void 0})}),this.resolvedDependencies.clear()},e}();function fg(e,n,t){var r=As(e,n);r.lookUp=t}function jo(e){return function n(){return this instanceof n?this:function(t,r,s){fg(t,s,e)}}}var Wo=jo(d.LookUp.SKIP_SELF),Yo=jo(d.LookUp.SELF);function gg(e,n,t){var r=As(e,n);r.withNew=t}function mg(e){return function n(){return this instanceof n?this:function(t,r,s){gg(t,s,e)}}}var zo=mg(!0);function Vo(e,n){return n===void 0&&(n=0),e?e.map(function(t,r){if(r+=n,!Array.isArray(t))return{paramIndex:r,identifier:t,quantity:d.Quantity.REQUIRED,withNew:!1};var s=t.slice(0,t.length-1),i=t[t.length-1],o=void 0,a=d.Quantity.REQUIRED,l=!1;return s.forEach(function(c){if(c instanceof Yo)o=d.LookUp.SELF;else if(c instanceof Wo)o=d.LookUp.SKIP_SELF;else if(c instanceof Fo)a=d.Quantity.OPTIONAL;else if(c instanceof ko)a=d.Quantity.MANY;else if(c instanceof zo)l=!0;else throw new at("unknown dep modifier ".concat(c,"."))}),{paramIndex:r,identifier:i,quantity:a,lookUp:o,withNew:l}}):[]}var Ds;(function(){if(typeof requestIdleCallback<"u"&&typeof cancelIdleCallback<"u")Ds=function(n,t){var r=requestIdleCallback(n,typeof t=="number"?{timeout:t}:void 0),s=!1;return function(){s||(s=!0,cancelIdleCallback(r))}};else{var e=Object.freeze({didTimeout:!0,timeRemaining:function(){return 15}});Ds=function(n){var t=setTimeout(function(){return n(e)}),r=!1;return function(){r||(r=!0,clearTimeout(t))}}}})();var _g=function(){function e(n){var t=this;this.didRun=!1,this.selfExecutor=function(){try{t.value=n()}catch(r){t.error=r}finally{t.didRun=!0}},this.disposeCallback=Ds(function(){return t.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}(),In=function(){var e=function(n,t){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(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Tr=function(){return Tr=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++){n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Tr.apply(this,arguments)},an=function(e,n,t){if(t||arguments.length===2)for(var r=0,s=n.length,i;r<s;r++)(i||!(r in n))&&(i||(i=Array.prototype.slice.call(n,0,r)),i[r]=n[r]);return e.concat(i||Array.prototype.slice.call(n))},pg=300,Wn=Symbol("$$NOT_INSTANTIATED_SYMBOL"),Eg=function(e){In(n,e);function n(t){return e.call(this,'Detecting cyclic dependency. The last identifier is "'.concat(vt(t),'".'))||this}return n}(at),Cg=function(e){In(n,e);function n(){return e.call(this,"Injector cannot be accessed after it was disposed.")||this}return n}(at),vg=function(e){In(n,e);function n(t){return e.call(this,'Async item "'.concat(vt(t),'" returns another async item.'))||this}return n}(at),Rg=function(e){In(n,e);function n(t){return e.call(this,'Cannot get async item "'.concat(vt(t),'" from sync api.'))||this}return n}(at),Go=function(e){In(n,e);function n(t){return e.call(this,'Cannot add dependency "'.concat(vt(t),'" after it is already resolved.'))||this}return n}(at),Ig=function(e){In(n,e);function n(t){return e.call(this,'Cannot dependency dependency "'.concat(vt(t),'" after it is already resolved.'))||this}return n}(at),Dt=function(){function e(n,t){t===void 0&&(t=null),this.parent=t,this.children=[],this.resolutionOngoing=0,this.disposed=!1,this.dependencyCollection=new hg(n||[]),this.resolvedDependencyCollection=new dg,t&&t.children.push(this)}return e.prototype.createChild=function(n){return this._ensureInjectorNotDisposed(),new e(n,this)},e.prototype.dispose=function(){this.children.forEach(function(n){return n.dispose()}),this.children.length=0,this.dependencyCollection.dispose(),this.resolvedDependencyCollection.dispose(),this.deleteSelfFromParent(),this.disposed=!0},e.prototype.deleteSelfFromParent=function(){if(this.parent){var n=this.parent.children.indexOf(this);n>-1&&this.parent.children.splice(n,1)}},e.prototype.add=function(n){this._ensureInjectorNotDisposed();var t=n[0],r=n[1];if(this.resolvedDependencyCollection.has(t))throw new Go(t);typeof r>"u"?this.dependencyCollection.add(t):ws(r)||Ss(r)||ys(r)||Os(r)?this.dependencyCollection.add(t,r):this.resolvedDependencyCollection.add(t,r)},e.prototype.replace=function(n){this._ensureInjectorNotDisposed();var t=n[0];if(this.resolvedDependencyCollection.has(t))throw new Go(t);this.dependencyCollection.delete(t),n.length===1?this.dependencyCollection.add(t):this.dependencyCollection.add(t,n[1])},e.prototype.delete=function(n){if(this._ensureInjectorNotDisposed(),this.resolvedDependencyCollection.has(n))throw new Ig(n);this.dependencyCollection.delete(n)},e.prototype.invoke=function(n){for(var t=this,r=[],s=1;s<arguments.length;s++)r[s-1]=arguments[s];this._ensureInjectorNotDisposed();var i={get:function(o,a,l){return t._get(o,a,l)},has:function(o){return t.has(o)}};return n.apply(void 0,an([i],r,!1))},e.prototype.has=function(n){var t;return this.dependencyCollection.has(n)||((t=this.parent)===null||t===void 0?void 0:t.has(n))||!1},e.prototype.get=function(n,t,r){this._ensureInjectorNotDisposed();var s=this._get(n,t,r);if(Array.isArray(s)&&s.some(function(i){return wr(i)})||wr(s))throw new Rg(n);return s},e.prototype._get=function(n,t,r,s){var i=d.Quantity.REQUIRED;if(t===d.Quantity.REQUIRED||t===d.Quantity.OPTIONAL||t===d.Quantity.MANY?i=t:r=t,!s){var o=this.getValue(n,i,r);if(o!==Wn)return o}return this.createDependency(n,i,r,!s)},e.prototype.getAsync=function(n){this._ensureInjectorNotDisposed();var t=this.getValue(n,d.Quantity.REQUIRED);if(t!==Wn)return Promise.resolve(t);var r=this.createDependency(n,d.Quantity.REQUIRED);return wr(r)?r.whenReady():Promise.resolve(r)},e.prototype.createInstance=function(n){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return this._ensureInjectorNotDisposed(),this._resolveClassImpl.apply(this,an([{useClass:n}],t,!1))},e.prototype._resolveDependency=function(n,t,r){r===void 0&&(r=!0);var s;xo(n);try{ys(t)?s=this._resolveValueDependency(n,t):Os(t)?s=this._resolveFactory(n,t,r):Ss(t)?s=this._resolveClass(n,t,r):qf(t)?s=this._resolveExisting(n,t):s=this._resolveAsync(n,t),Ho()}catch(i){throw Ho(),i}return s},e.prototype._resolveExisting=function(n,t){var r=this.get(t.useExisting);return this.resolvedDependencyCollection.add(n,r),r},e.prototype._resolveValueDependency=function(n,t){var r=t.useValue;return this.resolvedDependencyCollection.add(n,r),r},e.prototype._resolveClass=function(n,t,r){var s=this;r===void 0&&(r=!0);var i;if(t.lazy){var o=new _g(function(){return s._ensureInjectorNotDisposed(),s._resolveClassImpl(t)});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(t);return n&&r&&this.resolvedDependencyCollection.add(n,i),i},e.prototype._resolveClassImpl=function(n){for(var t,r=[],s=1;s<arguments.length;s++)r[s-1]=arguments[s];var i=n.useClass;this.markNewResolution(i);for(var o=Lo(i).sort(function(I,S){return I.paramIndex-S.paramIndex}).map(function(I){return Tr(Tr({},I),{identifier:lg(I.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(I){throw I instanceof Ar?new Bo(i,h.identifier,h.paramIndex):I}}var f=an([],r,!0),g=o.length>0?o[0].paramIndex:f.length;if(f.length!==g){console.warn("[redi]: Expect ".concat(g," custom parameter(s) of ").concat(vt(i)," but get ").concat(f.length,"."));var p=g-f.length;p>0?f=an(an([],f,!0),new Array(p).fill(void 0),!0):f=f.slice(0,g)}var C=new(i.bind.apply(i,an(an([void 0],f,!1),a,!1)));return(t=n==null?void 0:n.onInstantiation)===null||t===void 0||t.call(n,C),this.markResolutionCompleted(),C},e.prototype._resolveFactory=function(n,t,r){var s;this.markNewResolution(n);for(var i=Vo(t.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(f){throw f instanceof Ar?new Bo(n,c.identifier,c.paramIndex):f}}var u=t.useFactory.apply(null,o);return r&&this.resolvedDependencyCollection.add(n,u),this.markResolutionCompleted(),(s=t==null?void 0:t.onInstantiation)===null||s===void 0||s.call(t,u),u},e.prototype._resolveAsync=function(n,t){var r=this,s={__symbol:To,whenReady:function(){return r._resolveAsyncImpl(n,t)}};return s},e.prototype._resolveAsyncImpl=function(n,t){var r=this;return t.useAsync().then(function(s){var i=r.getValue(n);if(i!==Wn)return i;var o;if(Array.isArray(s)){var a=s[1];if(ws(a))throw new vg(n);o=r._resolveDependency(n,a)}else Is(s)?o=r._resolveClassImpl({useClass:s,onInstantiation:t.onInstantiation}):o=s;return r.resolvedDependencyCollection.add(n,o),o})},e.prototype.getValue=function(n,t,r){var s=this;t===void 0&&(t=d.Quantity.REQUIRED);var i=function(){return s.dependencyCollection.has(n)&&!s.resolvedDependencyCollection.has(n)?Wn:s.resolvedDependencyCollection.get(n,t)},o=function(){return s.parent?s.parent.getValue(n,t):Wn};return r===d.LookUp.SKIP_SELF?o():r===d.LookUp.SELF||this.resolvedDependencyCollection.has(n)||this.dependencyCollection.has(n)?i():o()},e.prototype.createDependency=function(n,t,r,s){var i=this;t===void 0&&(t=d.Quantity.REQUIRED),s===void 0&&(s=!0);var o=function(){var l=i.dependencyCollection.get(n,t),c=null;return Array.isArray(l)?c=l.map(function(h){return i._resolveDependency(n,h,s)}):l&&(c=i._resolveDependency(n,l,s)),c},a=function(){if(i.parent)return i.parent.createDependency(n,t,void 0,s);if(t===d.Quantity.OPTIONAL)return null;throw xo(n),new Ar(n)};return r===d.LookUp.SKIP_SELF?a():n===e?this:this.dependencyCollection.has(n)?o():a()},e.prototype.markNewResolution=function(n){if(this.resolutionOngoing+=1,this.resolutionOngoing>=pg)throw new Eg(n)},e.prototype.markResolutionCompleted=function(){this.resolutionOngoing-=1},e.prototype._ensureInjectorNotDisposed=function(){if(this.disposed)throw new Cg},e}();function Sg(e,n,t){t===void 0&&(t=0);var r=Vo(n,t);r.forEach(function(s){Ts(e,s.identifier,s.paramIndex,s.quantity,s.lookUp)})}var Ko=typeof globalThis<"u"&&globalThis||typeof window<"u"&&window||typeof global<"u"&&global,Xo="REDI_GLOBAL_LOCK",Og=typeof process<"u"&&process.versions!=null&&process.versions.node!=null;Ko[Xo]?Og||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`):Go[Ko]=!0;var Yo="REDI_CONTEXT_LOCK",fg=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,Xo=typeof globalThis<"u"&&globalThis||typeof window<"u"&&window||typeof global<"u"&&global;Xo[Yo]?fg||console.error(`[redi]: "RediContext" is already created. You may import "RediContext" from different paths. Use "import { RediContext } from '@wendellhu/redi/react-bindings'; instead."`):Xo[Yo]=!0;var kn=Ct.createContext({injector:null});kn.displayName="RediContext";var Ms=kn.Provider,Qo=kn.Consumer,gg=function(){var e=function(n,t){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(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),mg=function(e){gg(n,e);function n(){return e.call(this,"Using dependency injection outside of a RediContext.")||this}return n}(Qe);function Jo(){var e=Ct.useContext(kn);if(!e.injector)throw new mg;return e.injector}function _g(e,n,t){var r=Jo();return Ct.useMemo(function(){return r.get(e,n,t)},[e,n,t])}var Or=function(){return Or=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++){n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Or.apply(this,arguments)};function pg(e){var n=e.children,t=e.dependencies,r=Ct.useRef(null);return Ct.useEffect(function(){return function(){var s;return(s=r.current)===null||s===void 0?void 0:s.dispose()}},[]),Ct.createElement(Qo,null,function(s){var i;return r.current?i=r.current:(i=s.injector?s.injector.createChild(t):new Ot(t),r.current=i),Ct.createElement(Ms,{value:{injector:i}},n)})}function Eg(e,n){return function(r){return Ct.createElement(Ms,{value:{injector:n}},Ct.createElement(e,Or({},r)))}}function Cg(e,n){return function(r){return Ct.createElement(pg,{dependencies:n},Ct.createElement(e,Or({},r)))}}var Rg=function(){var e=function(n,t){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(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Ig=function(e){Rg(n,e);function n(t){return e.call(this,'You should make "RediContext" as '.concat(t.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 n}(Qe);function vg(e,n,t){return function(){return{get:function(){var r=this,s=r.context;if(!s||!s.injector)throw new Ig(r);var i=s.injector,o=i.get(e,n||d.Quantity.REQUIRED,t);return o}}}}var Sg=function(e,n,t){if(t||arguments.length===2)for(var r=0,s=n.length,i;r<s;r++)(i||!(r in n))&&(i||(i=Array.prototype.slice.call(n,0,r)),i[r]=n[r]);return e.concat(i||Array.prototype.slice.call(n))};function Zo(e,n){var t=e instanceof re.BehaviorSubject&&typeof n>"u"?e.getValue():n,r=Ze.useState(t),s=r[0],i=r[1];return Ze.useEffect(function(){var o=e.subscribe(function(a){return i(a)});return function(){return o.unsubscribe()}},[e]),s}function qo(e){return typeof e=="function"?e():e}function Og(e,n,t,r){if(typeof e=="function"&&!r)throw new Qe("Expected deps to be provided when observable is a function!");var s=Ze.useRef(null),i=Ze.useRef(!1),o=Ze.useMemo(function(){return e},Sg([],typeof r<"u"?r:[e],!0)),a=Ze.useState(0);a[0];var l=a[1],c=Ze.useRef(function(){var u;if(o){var h=qo(o).subscribe(function(f){i.current=!0,u=f});h.unsubscribe()}return u!=null?u:n}());if(Ze.useEffect(function(){var u=null;return o&&(s.current=qo(o),u=s.current.subscribe(function(h){c.current=h,l(function(f){return f+1})})),function(){return u==null?void 0:u.unsubscribe()}},[o]),t&&!i.current)throw new Error("Expect `shouldHaveSyncValue` but not getting a sync value!");return c.current}function bg(e){var n=Ze.useState(0),t=n[1];Ze.useEffect(function(){var r=e.subscribe(function(){return t(function(s){return s+1})});return function(){return r.unsubscribe()}},[])}var Ls=new WeakMap;function yg(e,n){var t=Ze.useRef(void 0),r=Zo(e,n),s=Ze.useMemo(function(){return Ze.createContext(r)},[e]),i=Ze.useCallback(function(o){return Ze.createElement(s.Provider,{value:r},o.children)},[e,r]);return t.current!==e&&(t.current&&Ls.delete(t.current),t.current=e,Ls.set(e,s)),{Provider:i,value:r}}function wg(e){var n=Ls.get(e);if(!n)throw new Qe("try to read context value but no ancestor component subscribed it.");return Ze.useContext(n)}function Ag(e,n){n.forEach(t=>e.add(t))}function ea(e,n){n.forEach(([t])=>{e.has(t)&&e.get(t)})}function ta(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||!e||typeof n!="object"||!n)return!1;const t=Object.keys(e),r=Object.keys(n);if(t.length!==r.length)return!1;const s=Object.prototype.hasOwnProperty.bind(n);for(let i=0;i<t.length;i++){const o=t[i];if(!s(o))return!1;const a=e[o],l=n[o];if(a!==l)return!1}return!0}class Ds extends Error{constructor(n){super(n),this.name="CustomCommandExecutionError"}}function Ng(e,n=16){let t=0,r=null;return function(...i){const o=Date.now();o-t<n?(r&&clearTimeout(r),r=setTimeout(()=>{t=o,e.apply(this,i)},n)):(t=o,e.apply(this,i))}}var gn=(e=>(e[e.Style=1]="Style",e[e.Value=2]="Value",e))(gn||{});function Tg(e){return`sheet_interceptor_${e}`}const na=e=>function(n,t){let r=-1,s=n;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,t,l=>(a=!0,l)),!a)break}return s};class Mg{constructor(n){R(this,"_interceptorsByName",new Map);R(this,"_interceptorPoints");this._interceptorPoints=n}fetchThroughInterceptors(n){const t=n,r=this._interceptorsByName.get(t);return na(r||[])}intercept(n,t){const r=n;this._interceptorsByName.has(r)||this._interceptorsByName.set(r,[]);const s=this._interceptorsByName.get(r);return s.push(t),this._interceptorsByName.set(r,s.sort((i,o)=>{var a,l;return((a=o.priority)!=null?a:0)-((l=i.priority)!=null?l:0)})),()=>Un(this._interceptorsByName.get(r),t)}getInterceptPoints(){return this._interceptorPoints}dispose(){this._interceptorsByName.clear()}}function Lg(e){return`sheet_async_interceptor_${e}`}const Dg=e=>async function(n,t){let r=-1,s=n;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,t,async l=>(a=!0,l)),!a)break}return s};class Ug{constructor(n){R(this,"_asyncInterceptorsByName",new Map);R(this,"_asyncInterceptorPoints");this._asyncInterceptorPoints=n}fetchThroughAsyncInterceptors(n){const t=n,r=this._asyncInterceptorsByName.get(t);return Dg(r||[])}async interceptAsync(n,t){const r=n;this._asyncInterceptorsByName.has(r)||this._asyncInterceptorsByName.set(r,[]);const s=this._asyncInterceptorsByName.get(r);return s.push(t),this._asyncInterceptorsByName.set(r,s.sort((i,o)=>{var a,l;return((a=o.priority)!=null?a:0)-((l=i.priority)!=null?l:0)})),()=>Un(this._asyncInterceptorsByName.get(r),t)}getInterceptPoints(){return this._asyncInterceptorPoints}dispose(){this._asyncInterceptorsByName.clear()}}class mn{constructor(){R(this,"cursor",0)}reset(){return this.cursor=0,this}moveCursor(n){this.cursor+=n}moveCursorTo(n){this.cursor=n}}function Pg(e,n){for(const t in n)n.hasOwnProperty(t)&&(e[t]=n[t])}const lr=class lr{constructor(){const n=this;lr._constructorQueue.forEach(function(t){t.apply(n)})}_initialize(){}static extend(n){Object.getOwnPropertyNames(n.prototype).forEach(t=>{t==="_initialize"?lr._constructorQueue.push(n.prototype._initialize):t!=="constructor"&&(this.prototype[t]=n.prototype[t])}),Object.getOwnPropertyNames(n).forEach(t=>{t!=="prototype"&&t!=="name"&&t!=="length"&&(this[t]=n[t])})}};R(lr,"_constructorQueue",[]);let xn=lr;async function ra(e){for(const[n,t]of e.entries())try{if(!await t())return{index:n,result:!1}}catch(r){return{index:n,result:!1,error:r}}return{result:!0,index:-1}}function sa(e){for(const[n,t]of e.entries())try{if(!t())return{index:n,result:!1}}catch(r){return{index:n,result:!1,error:r}}return{result:!0,index:-1}}function ia(e){var n=typeof Symbol=="function"&&Symbol.iterator,t=n&&e[n],r=0;if(t)return t.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(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function oa(e,n){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var r=t.call(e),s,i=[],o;try{for(;(n===void 0||n-- >0)&&!(s=r.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return i}function aa(e,n,t){if(t||arguments.length===2)for(var r=0,s=n.length,i;r<s;r++)(i||!(r in n))&&(i||(i=Array.prototype.slice.call(n,0,r)),i[r]=n[r]);return e.concat(i||Array.prototype.slice.call(n))}typeof SuppressedError=="function"&&SuppressedError;function Hn(e){return typeof e=="function"}function Fg(e){var n=function(r){Error.call(r),r.stack=new Error().stack},t=e(n);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Us=Fg(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
4
+ For more info please visit our website: https://redi.wendell.fun/en-US/docs/debug#import-scripts-of-redi-more-than-once`):Ko[Xo]=!0;var Qo="REDI_CONTEXT_LOCK",yg=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,Jo=typeof globalThis<"u"&&globalThis||typeof window<"u"&&window||typeof global<"u"&&global;Jo[Qo]?yg||console.error(`[redi]: "RediContext" is already created. You may import "RediContext" from different paths. Use "import { RediContext } from '@wendellhu/redi/react-bindings'; instead."`):Jo[Qo]=!0;var Yn=At.createContext({injector:null});Yn.displayName="RediContext";var Ls=Yn.Provider,Zo=Yn.Consumer,wg=function(){var e=function(n,t){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(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),bg=function(e){wg(n,e);function n(){return e.call(this,"Using dependency injection outside of a RediContext.")||this}return n}(at);function qo(){var e=At.useContext(Yn);if(!e.injector)throw new bg;return e.injector}function Ag(e,n,t){var r=qo();return At.useMemo(function(){return r.get(e,n,t)},[e,n,t])}var Nr=function(){return Nr=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++){n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Nr.apply(this,arguments)};function Tg(e){var n=e.children,t=e.dependencies,r=At.useRef(null);return At.useEffect(function(){return function(){var s;return(s=r.current)===null||s===void 0?void 0:s.dispose()}},[]),At.createElement(Zo,null,function(s){var i;return r.current?i=r.current:(i=s.injector?s.injector.createChild(t):new Dt(t),r.current=i),At.createElement(Ls,{value:{injector:i}},n)})}function Ng(e,n){return function(r){return At.createElement(Ls,{value:{injector:n}},At.createElement(e,Nr({},r)))}}function Mg(e,n){return function(r){return At.createElement(Tg,{dependencies:n},At.createElement(e,Nr({},r)))}}var Dg=function(){var e=function(n,t){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(n,t)};return function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");e(n,t);function r(){this.constructor=n}n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Lg=function(e){Dg(n,e);function n(t){return e.call(this,'You should make "RediContext" as '.concat(t.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 n}(at);function Ug(e,n,t){return function(){return{get:function(){var r=this,s=r.context;if(!s||!s.injector)throw new Lg(r);var i=s.injector,o=i.get(e,n||d.Quantity.REQUIRED,t);return o}}}}var Pg=function(e,n,t){if(t||arguments.length===2)for(var r=0,s=n.length,i;r<s;r++)(i||!(r in n))&&(i||(i=Array.prototype.slice.call(n,0,r)),i[r]=n[r]);return e.concat(i||Array.prototype.slice.call(n))};function ea(e,n){var t=e instanceof ce.BehaviorSubject&&typeof n>"u"?e.getValue():n,r=lt.useState(t),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 ta(e){return typeof e=="function"?e():e}function kg(e,n,t,r){if(typeof e=="function"&&!r)throw new at("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},Pg([],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=ta(o).subscribe(function(f){i.current=!0,h=f});u.unsubscribe()}return h!=null?h:n}());if(lt.useEffect(function(){var h=null;return o&&(s.current=ta(o),h=s.current.subscribe(function(u){c.current=u,l(function(f){return f+1})})),function(){return h==null?void 0:h.unsubscribe()}},[o]),t&&!i.current)throw new Error("Expect `shouldHaveSyncValue` but not getting a sync value!");return c.current}function Fg(e){var n=lt.useState(0),t=n[1];lt.useEffect(function(){var r=e.subscribe(function(){return t(function(s){return s+1})});return function(){return r.unsubscribe()}},[])}var Us=new WeakMap;function $g(e,n){var t=lt.useRef(void 0),r=ea(e,n),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 t.current!==e&&(t.current&&Us.delete(t.current),t.current=e,Us.set(e,s)),{Provider:i,value:r}}function xg(e){var n=Us.get(e);if(!n)throw new at("try to read context value but no ancestor component subscribed it.");return lt.useContext(n)}function Hg(e,n){n.forEach(t=>e.add(t))}function na(e,n){n.forEach(([t])=>{e.has(t)&&e.get(t)})}function ra(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||!e||typeof n!="object"||!n)return!1;const t=Object.keys(e),r=Object.keys(n);if(t.length!==r.length)return!1;const s=Object.prototype.hasOwnProperty.bind(n);for(let i=0;i<t.length;i++){const o=t[i];if(!s(o))return!1;const a=e[o],l=n[o];if(a!==l)return!1}return!0}class Ps extends Error{constructor(n){super(n),this.name="CustomCommandExecutionError"}}function Bg(e,n=16){let t=0,r=null;return function(...i){const o=Date.now();o-t<n?(r&&clearTimeout(r),r=setTimeout(()=>{t=o,e.apply(this,i)},n)):(t=o,e.apply(this,i))}}var Sn=(e=>(e[e.Style=1]="Style",e[e.Value=2]="Value",e))(Sn||{});function jg(e){return`sheet_interceptor_${e}`}const sa=e=>function(n,t){let r=-1,s=n;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,t,l=>(a=!0,l)),!a)break}return s};class Wg{constructor(n){R(this,"_interceptorsByName",new Map);R(this,"_interceptorPoints");this._interceptorPoints=n}fetchThroughInterceptors(n){const t=n,r=this._interceptorsByName.get(t);return sa(r||[])}intercept(n,t){const r=n;this._interceptorsByName.has(r)||this._interceptorsByName.set(r,[]);const s=this._interceptorsByName.get(r);return s.push(t),this._interceptorsByName.set(r,s.sort((i,o)=>{var a,l;return((a=o.priority)!=null?a:0)-((l=i.priority)!=null?l:0)})),()=>Bn(this._interceptorsByName.get(r),t)}getInterceptPoints(){return this._interceptorPoints}dispose(){this._interceptorsByName.clear()}}function Yg(e){return`sheet_async_interceptor_${e}`}const zg=e=>async function(n,t){let r=-1,s=n;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,t,async l=>(a=!0,l)),!a)break}return s};class Vg{constructor(n){R(this,"_asyncInterceptorsByName",new Map);R(this,"_asyncInterceptorPoints");this._asyncInterceptorPoints=n}fetchThroughAsyncInterceptors(n){const t=n,r=this._asyncInterceptorsByName.get(t);return zg(r||[])}async interceptAsync(n,t){const r=n;this._asyncInterceptorsByName.has(r)||this._asyncInterceptorsByName.set(r,[]);const s=this._asyncInterceptorsByName.get(r);return s.push(t),this._asyncInterceptorsByName.set(r,s.sort((i,o)=>{var a,l;return((a=o.priority)!=null?a:0)-((l=i.priority)!=null?l:0)})),()=>Bn(this._asyncInterceptorsByName.get(r),t)}getInterceptPoints(){return this._asyncInterceptorPoints}dispose(){this._asyncInterceptorsByName.clear()}}class On{constructor(){R(this,"cursor",0)}reset(){return this.cursor=0,this}moveCursor(n){this.cursor+=n}moveCursorTo(n){this.cursor=n}}function Gg(e,n){for(const t in n)n.hasOwnProperty(t)&&(e[t]=n[t])}const _r=class _r{constructor(){const n=this;_r._constructorQueue.forEach(function(t){t.apply(n)})}_initialize(){}static extend(n){Object.getOwnPropertyNames(n.prototype).forEach(t=>{t==="_initialize"?_r._constructorQueue.push(n.prototype._initialize):t!=="constructor"&&(this.prototype[t]=n.prototype[t])}),Object.getOwnPropertyNames(n).forEach(t=>{t!=="prototype"&&t!=="name"&&t!=="length"&&(this[t]=n[t])})}};R(_r,"_constructorQueue",[]);let zn=_r;async function ia(e){for(const[n,t]of e.entries())try{if(!await t())return{index:n,result:!1}}catch(r){return{index:n,result:!1,error:r}}return{result:!0,index:-1}}function oa(e){for(const[n,t]of e.entries())try{if(!t())return{index:n,result:!1}}catch(r){return{index:n,result:!1,error:r}}return{result:!0,index:-1}}function aa(e){var n=typeof Symbol=="function"&&Symbol.iterator,t=n&&e[n],r=0;if(t)return t.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(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function la(e,n){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var r=t.call(e),s,i=[],o;try{for(;(n===void 0||n-- >0)&&!(s=r.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return i}function ua(e,n,t){if(t||arguments.length===2)for(var r=0,s=n.length,i;r<s;r++)(i||!(r in n))&&(i||(i=Array.prototype.slice.call(n,0,r)),i[r]=n[r]);return e.concat(i||Array.prototype.slice.call(n))}typeof SuppressedError=="function"&&SuppressedError;function Vn(e){return typeof e=="function"}function Kg(e){var n=function(r){Error.call(r),r.stack=new Error().stack},t=e(n);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var ks=Kg(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
5
5
  `+t.map(function(r,s){return s+1+") "+r.toString()}).join(`
6
- `):"",this.name="UnsubscriptionError",this.errors=t}});function la(e,n){if(e){var t=e.indexOf(n);0<=t&&e.splice(t,1)}}var ca=function(){function e(n){this.initialTeardown=n,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var n,t,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=ia(o),l=a.next();!l.done;l=a.next()){var c=l.value;c.remove(this)}}catch(I){n={error:I}}finally{try{l&&!l.done&&(t=a.return)&&t.call(a)}finally{if(n)throw n.error}}else o.remove(this);var u=this.initialTeardown;if(Hn(u))try{u()}catch(I){i=I instanceof Us?I.errors:[I]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var f=ia(h),g=f.next();!g.done;g=f.next()){var E=g.value;try{ua(E)}catch(I){i=i!=null?i:[],I instanceof Us?i=aa(aa([],oa(i)),oa(I.errors)):i.push(I)}}}catch(I){r={error:I}}finally{try{g&&!g.done&&(s=f.return)&&s.call(f)}finally{if(r)throw r.error}}}if(i)throw new Us(i)}},e.prototype.add=function(n){var t;if(n&&n!==this)if(this.closed)ua(n);else{if(n instanceof e){if(n.closed||n._hasParent(this))return;n._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(n)}},e.prototype._hasParent=function(n){var t=this._parentage;return t===n||Array.isArray(t)&&t.includes(n)},e.prototype._addParent=function(n){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(n),t):t?[t,n]:n},e.prototype._removeParent=function(n){var t=this._parentage;t===n?this._parentage=null:Array.isArray(t)&&la(t,n)},e.prototype.remove=function(n){var t=this._finalizers;t&&la(t,n),n instanceof e&&n._removeParent(this)},e.EMPTY=function(){var n=new e;return n.closed=!0,n}(),e}();ca.EMPTY;function kg(e){return e instanceof ca||e&&"closed"in e&&Hn(e.remove)&&Hn(e.add)&&Hn(e.unsubscribe)}function ua(e){Hn(e)?e():e.unsubscribe()}function We(e){let n=!1;return e?kg(e)?{dispose:()=>e.unsubscribe()}:typeof e=="function"?{dispose:()=>{n||(n=!0,e())}}:e:We(()=>{})}function xg(e){return We(()=>{e.unsubscribe()})}class Ps{constructor(){R(this,"_disposables",new Set)}add(n){const t=We(n);return this._disposables.add(t),{dispose:()=>{t.dispose(),this._disposables.delete(t)}}}dispose(){this._disposables.forEach(n=>{n.dispose()}),this._disposables.clear()}}class Ke{constructor(){R(this,"_disposed",!1);R(this,"_collection",new Ps)}disposeWithMe(n){return this._collection.add(n)}ensureNotDisposed(){if(this._disposed)throw new Error("[Disposable]: object is disposed!")}dispose(){this._disposed||(this._disposed=!0,this._collection.dispose())}}class Hg extends Ke{constructor(){super(...arguments);R(this,"dispose$",new re.Subject)}dispose(){super.dispose(),this.dispose$.next(),this.dispose$.complete()}}class Bg extends Ke{constructor(t){super();R(this,"_ref",0);this._rootDisposable=t}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 Bn=gt("univer.context-service");class ha extends Ke{constructor(){super(...arguments);R(this,"_contextChanged$",new re.Subject);R(this,"contextChanged$",this._contextChanged$.asObservable());R(this,"_contextMap",new Map)}dispose(){super.dispose(),this._contextChanged$.complete()}getContextValue(t){var r;return(r=this._contextMap.get(t))!=null?r:!1}setContextValue(t,r){this._contextMap.set(t,r),this._contextChanged$.next({[t]:r})}subscribeContextValue$(t){return new re.Observable(r=>{const s=this._contextChanged$.pipe(re.filter(i=>typeof i[t]<"u")).subscribe(i=>r.next(i[t]));return this._contextMap.has(t)&&r.next(this._contextMap.get(t)),()=>s.unsubscribe()})}}var da=(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))(da||{});const Rt=gt("univer.log");class fa extends Ke{constructor(){super(...arguments);R(this,"_logLevel",3)}debug(...t){this._logLevel>=4&&this._log(console.debug,...t)}log(...t){this._logLevel>=3&&this._log(console.log,...t)}warn(...t){this._logLevel>=2&&this._log(console.warn,...t)}error(...t){this._logLevel>=1&&this._log(console.error,...t)}setLogLevel(t){this._logLevel=t}_log(t,...r){const s=r[0];/^\[(.*?)\]/g.test(s)?t(`\x1B[97;104m${s}\x1B[0m`,...r.slice(1)):t(...r)}}var jg=Object.defineProperty,$g=Object.getOwnPropertyDescriptor,Wg=(e,n,t,r)=>{for(var s=r>1?void 0:r?$g(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&jg(n,t,s),s},ga=(e,n)=>(t,r)=>n(t,r,e),jn=(e=>(e[e.COMMAND=0]="COMMAND",e[e.OPERATION=1]="OPERATION",e[e.MUTATION=2]="MUTATION",e))(jn||{});const bt=gt("anywhere.command-service");class Vg{constructor(){R(this,"_commands",new Map);R(this,"_commandTypes",new Map)}registerCommand(n){if(this._commands.has(n.id))throw new Error(`[CommandRegistry]: command "${n.id}" has been registered before.`);return this._commands.set(n.id,n),this._commandTypes.set(n.id,n.type),We(()=>{this._commands.delete(n.id),this._commandTypes.delete(n.id)})}hasCommand(n){return this._commands.has(n)}getCommand(n){return this._commands.has(n)?[this._commands.get(n)]:null}getCommandType(n){return this._commandTypes.get(n)}}const ma={id:"nil",type:0,handler:()=>!0};d.CommandService=class extends Ke{constructor(t,r){super();R(this,"_commandRegistry");R(this,"_beforeCommandExecutionListeners",[]);R(this,"_commandExecutedListeners",[]);R(this,"_multiCommandDisposables",new Map);R(this,"_commandExecutingLevel",0);R(this,"_commandExecutionStack",[]);this._injector=t,this._logService=r,this._commandRegistry=new Vg,this._registerCommand(ma)}dispose(){super.dispose(),this._commandExecutedListeners.length=0,this._beforeCommandExecutionListeners.length=0}hasCommand(t){return this._commandRegistry.hasCommand(t)}registerCommand(t){return this._registerCommand(t)}registerMultipleCommand(t){return this._registerMultiCommand(t)}beforeCommandExecuted(t){if(this._beforeCommandExecutionListeners.indexOf(t)===-1)return this._beforeCommandExecutionListeners.push(t),We(()=>{const r=this._beforeCommandExecutionListeners.indexOf(t);this._beforeCommandExecutionListeners.splice(r,1)});throw new Error("[CommandService]: could not add a listener twice.")}onCommandExecuted(t){if(this._commandExecutedListeners.indexOf(t)===-1)return this._commandExecutedListeners.push(t),We(()=>{const r=this._commandExecutedListeners.indexOf(t);this._commandExecutedListeners.splice(r,1)});throw new Error("[CommandService]: could not add a listener twice.")}async executeCommand(t,r,s){try{const i=this._commandRegistry.getCommand(t);if(i){const[o]=i,a={id:o.id,type:o.type,params:r},l=this._pushCommandExecutionStack(a);this._beforeCommandExecutionListeners.forEach(u=>u(a,s));const c=await this._execute(o,r,s);return this._commandExecutedListeners.forEach(u=>u(a,s)),l.dispose(),c}throw new Error(`[CommandService]: command "${t}" is not registered.`)}catch(i){if(i instanceof Ds)return!1;throw i}}syncExecuteCommand(t,r,s){var i;try{const o=this._commandRegistry.getCommand(t);if(o){const[a]=o,l={id:a.id,type:a.type,params:r};if(a.type===2){const h=Df(this._commandExecutionStack,f=>f.type===0);h&&(l.params=(i=l.params)!=null?i:{},l.params.trigger=h.id)}const c=this._pushCommandExecutionStack(l);this._beforeCommandExecutionListeners.forEach(h=>h(l,s));const u=this._syncExecute(a,r,s);return this._commandExecutedListeners.forEach(h=>h(l,s)),c.dispose(),u}throw new Error(`[CommandService]: command "${t}" is not registered.`)}catch(o){if(o instanceof Ds)return!1;throw o}}_pushCommandExecutionStack(t){return this._commandExecutionStack.push(t),We(()=>Un(this._commandExecutionStack,t))}_registerCommand(t){return this._commandRegistry.registerCommand(t)}_registerMultiCommand(t){const r=this._commandRegistry.getCommand(t.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 Ps;s=new zg(t.id),o.add(this._commandRegistry.registerCommand(s)),o.add(We(()=>{this._multiCommandDisposables.delete(t.id)})),this._multiCommandDisposables.set(t.id,o)}const i=s.registerImplementation(t);return We(()=>{var o;i.dispose(),s.hasImplementations()||(o=this._multiCommandDisposables.get(t.id))==null||o.dispose()})}async _execute(t,r,s){this._logService.debug("[CommandService]",`${"|-".repeat(Math.max(this._commandExecutingLevel,0))}executing command "${t.id}"`),this._commandExecutingLevel++;let i;try{i=await this._injector.invoke(t.handler,r,s),this._commandExecutingLevel--}catch(o){throw i=!1,this._commandExecutingLevel=0,o}return i}_syncExecute(t,r,s){this._logService.debug("[CommandService]",`${"|-".repeat(Math.max(0,this._commandExecutingLevel))}executing command "${t.id}".`),this._commandExecutingLevel++;let i;try{if(i=this._injector.invoke(t.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}},d.CommandService=Wg([ga(0,mt(Ot)),ga(1,Rt)],d.CommandService);class zg{constructor(n){R(this,"name");R(this,"multi",!0);R(this,"type",0);R(this,"priority",0);R(this,"_implementations",[]);R(this,"handler",async(n,t)=>{if(!this._implementations.length)return!1;const r=n.get(Rt),s=n.get(Bn),i=n.get(Ot);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,t)))return!0}return!1});this.id=n,this.name=n}registerImplementation(n){const t={command:n};return this._implementations.push(t),this._implementations.sort((r,s)=>s.command.priority-r.command.priority),We(()=>{const r=this._implementations.indexOf(t);this._implementations.splice(r,1)})}hasImplementations(){return this._implementations.length>0}}function Fs(e,n,t){const r=e.map(s=>()=>n.syncExecuteCommand(s.id,s.params,t));return sa(r)}function Gg(e,n,t){const r=e.map(s=>()=>n.executeCommand(s.id,s.params,t));return ra(r)}function _a(e){return new re.Observable(n=>{const t=e((...r)=>n.next(r));return()=>t==null?void 0:t.dispose()})}function pa(e){return function(t){return new re.Observable(r=>(t.subscribe({next:s=>{r.next(s),e(s)&&r.complete()},complete:()=>r.complete(),error:s=>r.error(s)}),()=>r.unsubscribe()))}}function Kg(e=0){return n=>{let t=[];return n.pipe(re.tap(r=>t.push(r)),re.debounceTime(e),re.map(()=>t),re.tap(()=>t=[]))}}function Yg(e){const n=new re.ReplaySubject(1);return setTimeout(()=>n.next(),e),n.pipe(re.take(1))}const Xg=e=>new Promise(n=>{re.merge(_a(e.onCommandExecuted.bind(e)).pipe(Mt.filter(([t])=>t.type===jn.MUTATION)),re.timer(300)).pipe(Mt.debounceTime(16),Mt.first()).subscribe(()=>{n()})});function Ea(e,n){let t=0,r=e.length-1;if(n<e[0])return 0;if(n>=e[e.length-1])return e.length-1;for(;t<=r;){if(e[t]===n){for(;t<e.length&&e[t]===n;)t++;return t}if(n>e[t]&&n<e[t+1])return t+1;if(e[r]===n){for(;r<e.length&&e[r]===n;)r++;return r}if(n>e[r-1]&&n<e[r])return r;t++,r--}return-1}function Qg(e,n){let t=0,r=e.length-1;for(;t<=r;){const s=Math.floor((r+t)/2);if(n<e[s]&&(s===0||n>=e[s-1]))return s;if(n>=e[s])t=s+1;else if(n<e[s])r=s-1;else return-1}return-1}function Ca(e,n){let t=0,r=e.length;for(;t<r;){const s=Math.floor((t+r)/2);e[s]<=n?t=s+1:r=s}return t<e.length?t:e.length-1}function Jg(e,n,t=!1){let r=e.length-1;if(n<0||n<e[0])return 0;if(e.length<40||n<=e[20]||n>=e[r-20]?r=Ea(e,n):r=Ca(e,n),t){const s=e[r];return e.indexOf(s)}return r}function Zg(e){const n=new Blob([e],{type:"text/javascript"});return window.URL.createObjectURL(n)}const $n=2,Ra=1;function qg(e,n){if(n==null||e==null)return!0;const{left:t=0,top:r=0,height:s=0,width:i=0,angle:o=0}=n,{left:a=0,top:l=0,height:c=0,width:u=0,angle:h=0}=e,f=u,g=c,E=i,I=s;return Math.abs(a-t)>$n||Math.abs(l-r)>$n||Math.abs(f-E)>$n||Math.abs(g-I)>$n||Math.abs(h-o)>Ra}var Ia=(e=>(e[e.DEFAULT_SERIES=0]="DEFAULT_SERIES",e[e.ALTERNATE_SERIES=1]="ALTERNATE_SERIES",e))(Ia||{}),He=(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))(He||{}),va=(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))(va||{}),_t=(e=>(e[e.UNSUPPORTED=0]="UNSUPPORTED",e[e.RGB=1]="RGB",e[e.HEX=2]="HEX",e[e.THEME=3]="THEME",e))(_t||{}),Sa=(e=>(e[e.ON=0]="ON",e[e.OFF=1]="OFF",e))(Sa||{}),Oa=(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))(Oa||{}),ba=(e=>(e[e.LEFT=0]="LEFT",e[e.RIGHT=1]="RIGHT",e))(ba||{}),ya=(e=>(e[e.DOCUMENT=0]="DOCUMENT",e[e.PROJECT=1]="PROJECT",e))(ya||{}),wa=(e=>(e[e.COLUMNS=0]="COLUMNS",e[e.ROWS=1]="ROWS",e))(wa||{}),Aa=(e=>(e[e.UP=0]="UP",e[e.RIGHT=1]="RIGHT",e[e.DOWN=2]="DOWN",e[e.LEFT=3]="LEFT",e))(Aa||{});function em(e){switch(e){case 3:return 1;case 1:return 3;case 0:return 2;case 2:return 0}}var Na=(e=>(e[e.NUMBER_FORMAT_TYPE_UNSPECIFIED=0]="NUMBER_FORMAT_TYPE_UNSPECIFIED",e[e.TEXT=1]="TEXT",e[e.NUMBER=2]="NUMBER",e[e.PERCENT=3]="PERCENT",e[e.CURRENCY=4]="CURRENCY",e[e.DATE=5]="DATE",e[e.TIME=6]="TIME",e[e.DATE_TIME=7]="DATE_TIME",e[e.SCIENTIFIC=8]="SCIENTIFIC",e))(Na||{}),Ta=(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))(Ta||{}),Wn=(e=>(e.EN_US="enUS",e.ZH_CN="zhCN",e.RU_RU="ruRU",e.ZH_TW="zhTW",e.VI_VN="viVN",e.FA_IR="faIR",e))(Wn||{}),Ma=(e=>(e[e.RANGE=0]="RANGE",e[e.SHEET=1]="SHEET",e))(Ma||{}),La=(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))(La||{}),Da=(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))(Da||{}),Ua=(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))(Ua||{}),Pa=(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))(Pa||{}),Fa=(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))(Fa||{}),ka=(e=>(e[e.GRID=0]="GRID",e[e.KANBAN=1]="KANBAN",e[e.GANTT=2]="GANTT",e))(ka||{}),Vn=(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))(Vn||{}),xa=(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))(xa||{}),Bt=(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))(Bt||{}),Zt=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TOP=1]="TOP",e[e.MIDDLE=2]="MIDDLE",e[e.BOTTOM=3]="BOTTOM",e))(Zt||{}),qt=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.OVERFLOW=1]="OVERFLOW",e[e.CLIP=2]="CLIP",e[e.WRAP=3]="WRAP",e))(qt||{}),br=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ITALIC=1]="ITALIC",e))(br||{}),yr=(e=>(e[e.NORMAL=0]="NORMAL",e[e.BOLD=1]="BOLD",e))(yr||{}),Dt=(e=>(e[e.NORMAL=1]="NORMAL",e[e.SUBSCRIPT=2]="SUBSCRIPT",e[e.SUPERSCRIPT=3]="SUPERSCRIPT",e))(Dt||{}),Re=(e=>(e[e.FALSE=0]="FALSE",e[e.TRUE=1]="TRUE",e))(Re||{}),jt=(e=>(e[e.STRING=1]="STRING",e[e.NUMBER=2]="NUMBER",e[e.BOOLEAN=3]="BOOLEAN",e[e.FORCE_STRING=4]="FORCE_STRING",e))(jt||{}),st=(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))(st||{}),wr=(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))(wr||{});const tm="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let nm=e=>crypto.getRandomValues(new Uint8Array(e)),rm=(e,n,t)=>{let r=(2<<Math.log2(e.length-1))-1,s=-~(1.6*r*n/e.length);return(i=n)=>{let o="";for(;;){let a=t(s),l=s;for(;l--;)if(o+=e[a[l]&r]||"",o.length===i)return o}}},sm=(e,n=21)=>rm(e,n,nm),im=(e=21)=>{let n="",t=crypto.getRandomValues(new Uint8Array(e));for(;e--;)n+=tm[t[e]&63];return n};const om=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"]),am=new RegExp("^(?:(?:(?:https?|ftp):)?\\/\\/)?(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[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 lm(e){if(!Number.isNaN(+e))return!1;if(e.startsWith("http://localhost:3002")||e.startsWith("localhost:3002"))return!0;if(am.test(e)){if(Ha(e))return!0;try{const r=new URL(Ba(e)).hostname.split(".").pop();if(r&&om.has(r))return!0}catch{return!1}}return!1}function Ha(e){return/^[a-zA-Z]+:\/\//.test(e)}function cm(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e)}function Ba(e){return Ha(e)?e:cm(e)?`mailto://${e}`:`https://${e}`}const um=/^-ms-/,hm=/-([a-z])/g,$t=["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 ks(e,n){const t=W.getValueType(e),r=W.getValueType(n);return t!==r?!1:W.isArray(e)?dm(e,n):W.isObject(e)?fm(e,n):W.isDate(e)?e.getTime()===n.getTime():W.isRegExp(e)?e.toString()===n.toString():e===n}function dm(e,n){if(e.length!==n.length)return!1;for(let t=0,r=e.length;t<r;t++){const s=e[t],i=n[t];if(!ks(s,i))return!1}return!0}function fm(e,n){const t=Object.keys(e),r=Object.keys(n);if(t.length!==r.length)return!1;for(const s of t){if(!r.includes(s))return!1;const i=e[s],o=n[s];if(!ks(i,o))return!1}return!0}class W{static stringAt(n){let t="",r=n;for(;r>=$t.length;)r/=$t.length,r-=1,t+=$t[r%$t.length];const s=n%$t.length;return t+=$t[s],t}static indexAt(n){let t=0;for(let r=0;r<n.length-1;r+=1){const s=n.charCodeAt(r)-65,i=n.length-1-r;t+=$t.length**i+$t.length*s}return t+=n.charCodeAt(n.length-1)-65,t}static deleteBlank(n){return W.isString(n)?n.replace(/\s/g,""):n}static getSystemType(){const n=navigator.userAgent,t=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"&&!t&&!r)return"Unix";if(String(navigator.platform).indexOf("Linux")>-1)return"Linux";if(t){if(n.indexOf("Windows NT 5.0")>-1||n.indexOf("Windows 2000")>-1)return"Windows 2000";if(n.indexOf("Windows NT 5.1")>-1||n.indexOf("Windows XP")>-1)return"Windows XP";if(n.indexOf("Windows NT 5.2")>-1||n.indexOf("Windows 2003")>-1)return"Windows 2003";if(n.indexOf("Windows NT 6.0")>-1||n.indexOf("Windows Vista")>-1)return"Windows Vista";if(n.indexOf("Windows NT 6.1")>-1||n.indexOf("Windows 7")>-1)return"Windows 7";if(n.indexOf("Windows NT 10")>-1||n.indexOf("Windows 10")>-1)return"Windows 10";if(n.indexOf("Windows NT 11")>-1||n.indexOf("Windows 11")>-1)return"Windows 11"}return"Unknown system"}static getBrowserType(){const n=navigator.userAgent,t=n.indexOf("Opera")>-1,r=n.indexOf("compatible")>-1&&n.indexOf("MSIE")>-1&&!t,s=n.indexOf("Trident")>-1&&n.indexOf("rv:11.0")>-1,i=n.indexOf("Edge")>-1,o=n.indexOf("Firefox")>-1,a=n.indexOf("Safari")>-1&&n.indexOf("Chrome")===-1,l=n.indexOf("Chrome")>-1&&n.indexOf("Safari")>-1;if(r){new RegExp("MSIE (\\d+\\.\\d+);").test(n);const u=Number.parseFloat(RegExp.$1);return u===7?"IE7":u===8?"IE8":u===9?"IE9":u===10?"IE10":"0"}return o?"FF":t?"Opera":a?"Safari":l?"Chrome":i?"Edge":s?"IE11":"Unknown browser"}static generateRandomId(n=21,t){return en(n,t)}static getClassName(n){return n.constructor.name}static deepMerge(n,...t){t.forEach(o=>o&&i(o));function r(o,a){o.forEach((l,c)=>{var u,h;if(W.isArray(l)){const f=(u=a[c])!=null?u:[];a[c]=f,r(l,f);return}if(W.isObject(l)){const f=(h=a[c])!=null?h:{};a[c]=f,s(l,f);return}a[c]=l})}function s(o,a){Object.keys(o).forEach(l=>{var u,h;const c=o[l];if(W.isObject(c)){const f=(u=a[l])!=null?u:{};a[l]=f,s(c,f);return}if(W.isArray(c)){const f=(h=a[l])!=null?h:[];a[l]=f,r(c,f);return}a[l]=c})}function i(o){Object.keys(o).forEach(a=>{var c,u;const l=o[a];if(W.isArray(l)){const h=(c=n[a])!=null?c:[];n[a]=h,r(l,h);return}if(W.isObject(l)){const h=(u=n[a])!=null?u:{};n[a]=h,s(l,h);return}n[a]=l})}return n}static numberFixed(n,t){return Number(Number(n).toFixed(t))}static diffValue(n,t){return ks(n,t)}static deepClone(n){if(!this.isDefine(n))return n;if(this.isRegExp(n))return new RegExp(n);if(this.isDate(n))return new Date(n);if(this.isArray(n)){const t=[];return n.forEach((r,s)=>{t[s]=W.deepClone(r)}),t}if(this.isObject(n)){const t={};return Object.keys(n).forEach(r=>{const s=n[r];t[r]=W.deepClone(s)}),Object.setPrototypeOf(t,Object.getPrototypeOf(n)),t}return n}static getLanguage(){const n="en-US";return globalThis.navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||n}static getValueType(n){return Object.prototype.toString.apply(n)}static isDefine(n){return n!=null}static isBlank(n){return this.isDefine(n)?this.isString(n)?n.trim()==="":!1:!0}static isBoolean(n){return this.getValueType(n)==="[object Boolean]"}static isPlainObject(n){return this.isDefine(n)?Object.getPrototypeOf(n)===Object.getPrototypeOf({}):!1}static isFunction(n){return this.getValueType(n)==="[object Function]"}static isDate(n){return this.getValueType(n)==="[object Date]"}static isRegExp(n){return this.getValueType(n)==="[object RegExp]"}static isArray(n){return this.getValueType(n)==="[object Array]"}static isString(n){return this.getValueType(n)==="[object String]"}static isNumber(n){return this.getValueType(n)==="[object Number]"}static isStringNumber(n){return!isNaN(Number.parseFloat(n))&&isFinite(n)}static isObject(n){return this.getValueType(n)==="[object Object]"}static isEmptyObject(n){for(const t in n)return!1;return!0}static isMobile(){let n=0,t=0;return document.body.clientWidth&&(n=document.body.clientWidth),document.body.clientHeight&&(t=document.body.clientHeight),this.isAndroid()||this.isIPhone()||this.isTablet()||n<350&&t<500}static isTablet(){return/ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(navigator.userAgent.toLowerCase())}static isWeChat(){const n=navigator.userAgent.toLowerCase();return String(n.match(/MicroMessenger/i))==="micromessenger"}static isAndroid(){const n=navigator.userAgent;return n.indexOf("Android")>-1||n.indexOf("Linux")>-1}static isIPhone(){return/iPhone/i.test(navigator.userAgent)}static isLegalUrl(n){return lm(n)}static normalizeUrl(n){return Ba(n)}static itCount(n){return t=>{for(let r=0;r<n;r++)t&&t()}}static hasLength(n,t){return W.isDefine(n)?W.isDefine(t)?n.length===t:n.length>0:!1}static capitalize(n){return n.charAt(0).toUpperCase()+n.slice(1)}static fCamelCase(n,t){return t.toUpperCase()}static camelCase(n){return n.replace(um,"ms-").replace(hm,this.fCamelCase)}static removeNull(n){return this.isObject(n)&&Object.keys(n).forEach(t=>{const r=n[t];r==null?delete n[t]:W.removeNull(r)}),n}static fillTwoDimensionalArray(n,t,r){return new Array(n).fill(r).map(s=>new Array(t).fill(r))}static numToWord(n){let t="";for(;n>0;){let r=n%26;r=r===0?r=26:r,t=String.fromCharCode(96+r)+t,n=(n-r)/26}return t.toLocaleUpperCase()}static ABCatNum(n){if(n==null||n.length===0)return Number.NaN;const t=n.toLowerCase().split(""),r=t.length;let s=0,i=0;for(let o=0;o<r;o++)i=t[o].charCodeAt(0)-96,s+=i*26**(r-o-1);return s===0?Number.NaN:s-1}static chatAtABC(n){let i="";for(;n>=0;)i=String.fromCharCode(n%26+97)+i,n=Math.floor(n/26)-1;return i.toUpperCase()}static randSort(n){for(let t=0,r=n.length;t<r;t++){const s=Number.parseInt((Math.random()*r).toString()),i=n[s];n[s]=n[t],n[t]=i}return n}static commonExtend(n,t){const r={};for(const s in n)r[s]=n[s];for(const s in t)t[s]!=null&&(r[s]=t[s]);return r}static commonExtend1(n,t){for(const r in n)t[r]==null&&(t[r]=n[r]);return t}static arrayToObject(n){const t={};return n.forEach((r,s)=>{t[s]={},r.forEach((i,o)=>{t[s][o]=i})}),t}static hasIntersectionBetweenTwoRanges(n,t,r,s){return t>=r&&s>=n}static isStartValidPosition(n){return/^[A-Za-z_]/.test(n)}static isValidParameter(n){const t=/[~!@#$%^&*()+=\-{}\[\]\|:;"'<>,?\/ ]+/.test(n),r=n.length<=255;return!t&&r}static clamp(n,t,r){return Math.max(t,Math.min(r,n))}static now(){return performance&&performance.now?performance.now():Date.now()}}function en(e=21,n){return n?sm(n,e)():im(e)}function xs(...e){const n={},t=e.length;for(let r=t-1;r>=0;r--){const s=e[r];if(s){const i=Object.keys(s);for(const o of i)n[o]===void 0&&(n[o]=s[o])}}return n}const gm=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null;function Ar(e,n,t){const{dataStream:r,textRuns:s=[]}=e;let i=n;const o=[];for(const a of s){const{st:l,ed:c}=a;W.hasIntersectionBetweenTwoRanges(n,t,l,c)&&(l>i?(o.push(r.slice(i,l)),o.push(Hs(r,{...a,ed:Math.min(c,t)}))):o.push(Hs(r,{...a,st:i,ed:Math.min(c,t)}))),i=Math.max(n,Math.min(c,t))}return i!==t&&o.push(r.slice(i,t)),o.join("")}function mm(e,n=!0){var t;if(n&&((t=e.paragraphs)!=null&&t.length)){const{dataStream:r,paragraphs:s=[]}=e;let i="",o=-1;for(const a of s){const{startIndex:l,paragraphStyle:c={}}=a,{spaceAbove:u,spaceBelow:h,lineSpacing:f}=c,g=[];u!=null&&(typeof u=="number"?g.push(`margin-top: ${u}px`):g.push(`margin-top: ${u.v}px`)),h!=null&&(typeof h=="number"?g.push(`margin-bottom: ${h}px`):g.push(`margin-bottom: ${h.v}px`)),f!=null&&g.push(`line-height: ${f}`),l>o+1?i+=`<p class="UniverNormal" ${g.length?`style="${g.join("; ")};"`:""}>${Ar(e,o+1,l)}</p>`:i+=`<p class="UniverNormal" ${g.length?`style="${g.join("; ")};"`:""}></p>`,o=l}return o!==r.length&&(i+=Ar(e,o,r.length)),i}else return Ar(e,0,e.dataStream.length)}function Hs(e,n){const{st:t,ed:r,ts:s={}}=n,{ff:i,fs:o,it:a,bl:l,ul:c,st:u,ol:h,bg:f,cl:g,va:E}=s;let I=e.slice(t,r);const M=[];return a===Re.TRUE&&(I=`<i>${I}</i>`),E===Dt.SUPERSCRIPT?I=`<sup>${I}</sup>`:E===Dt.SUBSCRIPT&&(I=`<sub>${I}</sub>`),(c==null?void 0:c.s)===Re.TRUE&&(I=`<u>${I}</u>`),(u==null?void 0:u.s)===Re.TRUE&&(I=`<s>${I}</s>`),l===Re.TRUE&&(I=`<strong>${I}</strong>`),i&&M.push(`font-family: ${i}`),g&&M.push(`color: ${g.rgb}`),o&&M.push(`font-size: ${o}pt`),h&&M.push("text-decoration: overline"),f&&M.push(`background: ${f.rgb}`),M.length?`<span style="${M.join("; ")};">${I}</span>`:I}const ja={[wr.OFFICE]:{[st.ACCENT1]:"#4472C4",[st.ACCENT2]:"#ED7D31",[st.ACCENT3]:"#A5A5A5",[st.ACCENT4]:"#70AD47",[st.ACCENT5]:"#5B9BD5",[st.ACCENT6]:"#70AD47",[st.DARK1]:"#000000",[st.DARK2]:"#44546A",[st.LIGHT1]:"#FFFFFF",[st.LIGHT2]:"#E7E6E6",[st.HYPERLINK]:"#0563C1",[st.FOLLOWED_HYPERLINK]:"#954F72"}};class Nr{constructor(){R(this,"_themeValue",st.LIGHT1);R(this,"_themeColors");R(this,"_themeTint");R(this,"_rgbValue","");R(this,"_colorType");this._colorType=_t.UNSUPPORTED,this._themeColors=wr.OFFICE,this._themeTint=0}asRgbColor(){return new Tr(this._rgbValue,this)}asThemeColor(){return new Mr(this._themeValue,this._themeTint,this._themeColors,this)}build(){switch(this._colorType){case _t.THEME:return this.asThemeColor();case _t.RGB:return this.asRgbColor();case _t.UNSUPPORTED:throw new Error("unsupported color type")}}setRgbColor(n){return this._colorType=_t.RGB,this._rgbValue=n,this}setThemeColors(n){this._colorType=_t.THEME,this._themeColors=n}setThemeTint(n){this._colorType=_t.THEME,this._themeTint=n}setThemeColor(n){return this._colorType=_t.THEME,this._themeValue=n,this}getColorType(){return this._colorType}}class tn{constructor(n){R(this,"_builder");this._builder=n}static rgbColorToHexValue(n){return`#${((1<<24)+(n.getRed()<<16)+(n.getGreen()<<8)+n.getBlue()).toString(16).slice(1)}`}static hexValueToRgbColor(n){n?n.indexOf("#")>-1&&(n=n.substring(1)):n="#000000";const t=+`0x${n[0]}${n[1]}`,r=+`0x${n[2]}${n[3]}`,s=+`0x${n[4]}${n[5]}`;return new Nr().setRgbColor(`rgb(${t},${r},${s})`).asRgbColor()}static hexToRgbString(n){const t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;n=n.replace(t,(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(n);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 tn(this._builder)}equals(n){return!1}}class $a{constructor(n){R(this,"_saturation",0);R(this,"_hue",0);R(this,"_lightness",0);R(this,"_alpha",0);const t=n.getRed()/255,r=n.getGreen()/255,s=n.getBlue()/255,i=n.getAlpha()/255,o=Math.min(t,Math.min(r,s)),a=Math.max(t,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),t===a&&(this._hue=(r-s)/l),r===a&&(this._hue=2+(s-t)/l),s===a&&(this._hue=4+(t-r)/l),this._hue*=60,this._hue<0&&(this._hue+=360),this._alpha=i}asRgbColor(){const n=new Nr;if(this._saturation===0)return n.setRgbColor(`rgba(${this._lightness*255},${this._lightness*255},${this._lightness*255},${this._alpha*255})`),n.asRgbColor();let t;this._lightness<.5?t=this._lightness*(1+this._saturation):t=this._lightness+this._saturation-this._lightness*this._saturation;const r=2*this._lightness-t,s=this._hue/360,i=s+1/3,o=this.setColor(t,r,i),a=this.setColor(t,r,s),l=s-1/3,c=this.setColor(t,r,l);return n.setRgbColor(`rgba(${Math.round(o*255)},${Math.round(a*255)},${Math.round(c*255)},${this._alpha*255})`),n.asRgbColor()}getLightness(){return this._lightness}getHue(){return this._hue}getSaturation(){return this._saturation}getAlpha(){return this._alpha}setColor(n,t,r){r<0&&(r+=1),r>1&&(r-=1);let s;return 6*r<1?s=t+(n-t)*6*r:2*r<1?s=n:3*r<2?s=t+(n-t)*(2/3-r)*6:s=t,s}setLightness(n){this._lightness=n}}const pt=class pt extends tn{constructor(t,r){super(r);R(this,"_cssString");R(this,"_red");R(this,"_green");R(this,"_blue");R(this,"_alpha");let s=t.match(pt.RGBA_EXTRACT);if(s){const i=+s[1],o=+s[2],a=+s[3],l=+s[4];this._cssString=t,this._red=i,this._green=o,this._blue=a,this._alpha=l;return}if(s=t.match(pt.RGB_EXTRACT),s){const i=+s[1],o=+s[2],a=+s[3];this._cssString=t,this._red=i,this._green=o,this._blue=a,this._alpha=1;return}throw new Error("Invalid rgba or rgb color")}asHexString(){return tn.rgbColorToHexValue(this)}getRed(){let t=this._red+pt.RGB_COLOR_AMT;return t>255?t=255:t<0&&(t=0),t}getGreen(){let t=this._green+pt.RGB_COLOR_AMT;return t>255?t=255:t<0&&(t=0),t}getBlue(){let t=this._blue+pt.RGB_COLOR_AMT;return t>255?t=255:t<0&&(t=0),t}getAlpha(){return this._alpha}getColorType(){return _t.RGB}clone(){return new pt(this._cssString,this._builder)}asThemeColor(){throw new Error("rgb color not support to themeColor")}equals(t){return t instanceof pt?t._red===this._red&&t._blue===this._blue&&t._green===this._green&&t._alpha===this._alpha:!1}getCssString(){return this._cssString}};R(pt,"RGB_COLOR_AMT",0),R(pt,"RGBA_EXTRACT",new RegExp("\\s*rgba\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d.\\d|\\d\\s*)\\)\\s*")),R(pt,"RGB_EXTRACT",new RegExp("\\s*rgb\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*)\\)\\s*"));let Tr=pt;const Kt=class Kt extends tn{constructor(t,r,s,i){super(i);R(this,"_themeColorType");R(this,"_themeTint");R(this,"_themeColors");this._themeColorType=t,this._themeTint=r,this._themeColors=s}lumValue(t,r){if(t==null)return r;let s;return t<0?s=r*(1+t):s=r*(1-t)+(255-255*(1-t)),s}asRgbColor(){const t=ja[this._themeColors];if(t==null)throw new Error("not find themeColors type");const r=t[this._themeColorType];if(r==null)throw new Error("not find themeColors value");let s;if(Kt._cacheThemeColor.has(this._themeColors)){if(s=Kt._cacheThemeColor.get(this._themeColors),s.has(this._themeColorType))return s.get(this._themeColorType)}else s=new Map,Kt._cacheThemeColor.set(this._themeColors,s);const i=new $a(tn.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 Kt(this._themeColorType,this._themeTint,this._themeColors,this._builder)}equals(t){return t instanceof Kt?t._themeColorType===this._themeColorType:!1}getColorType(){return _t.THEME}getThemeColorType(){return this._themeColorType}};R(Kt,"_cacheThemeColor",new Map);let Mr=Kt;const _m="rgb(",pm="rgba(",Bs={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 It{constructor(n){R(this,"_color");R(this,"_rgbColor");R(this,"_isValid",!1);if(n==null){this._setNullColor();return}if(n instanceof It){this._color={...n._color},this._rgbColor={...n._rgbColor};return}const t=Wa(n);if(t==null){this._setNullColor();return}this._color=t;const r=vm(this._color);if(r==null){this._setNullColor();return}this._rgbColor=r,this._isValid=!0}static mix(n,t,r){var c,u;r=Math.min(1,Math.max(0,r));const s=new It(n).toRgb(),i=new It(t).toRgb(),o=(c=s.a)!=null?c:1,a=(u=i.a)!=null?u: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 It(l)}static getContrastRatio(n,t){const r=new It(n).getLuminance(),s=new It(t).getLuminance();return(Math.max(r,s)+.05)/(Math.min(r,s)+.05)}get isValid(){return this._isValid}toRgb(){return this._rgbColor}toRgbString(){const{r:n,g:t,b:r,a:s=1}=this.toRgb(),i=s<1;return`rgb${i?"a":""}(${n},${t},${r}${i?`,${s}`:""})`}toString(){return this.toRgbString()}toHexString(n){const{r:t,g:r,b:s,a:i=1}=this.toRgb(),o=i<1,a=[Lr(Math.round(t).toString(16)),Lr(Math.round(r).toString(16)),Lr(Math.round(s).toString(16)),Lr(Math.round(i*255).toString(16))];return n&&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 ym(this.toRgb())}toHsl(){return bm(this.toRgb())}lighten(n=10){const t=this.toHsl();return t.l+=n,t.l=Math.min(Math.max(t.l,0),100),new It(t)}darken(n=10){const t=this.toHsl();return t.l-=n,t.l=Math.min(Math.max(t.l,0),100),new It(t)}setAlpha(n){return new It({...this._rgbColor,a:n})}getLuminance(){let{r:n,g:t,b:r}=this.toRgb();return n=js(n),t=js(t),r=js(r),Number((.2126*n+.7152*t+.0722*r).toFixed(3))}getBrightness(){const{r:n,g:t,b:r}=this.toRgb();return(n*299+t*587+r*114)/1e3}getAlpha(){var n;return(n=this._color.a)!=null?n: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 Lr=e=>e.length===1?`0${e}`:e,js=e=>(e/=255,e<=.03928?e/12.92:((e+.055)/1.055)**2.4),Wa=e=>{if(Am(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 t={h:Math.round(e.h),s:e.s,v:e.v};return e.a!==void 0&&(t.a=e.a),t}const n=e.trim();if(Bs[n]){const t=Bs[n],r={r:Math.round(t[0]),g:Math.round(t[1]),b:Math.round(t[2])};return r.a=t[3]||1,r}if(n.startsWith("#"))return Em(n);if(n.startsWith("rgb"))return Cm(n);if(n.startsWith("hsl"))return Rm(n);if(n.startsWith("hsv"))return Im(n)},Em=e=>{const n=e.substring(1),t=new RegExp(`.{1,${n.length>=6?2:1}}`,"g");let r=n.match(t);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},Cm=e=>{const n=e.indexOf("(");if(n===-1)throw new Error(`The color '${e}' is illegal rgb color`);const t=e.substring(n+1,e.length-1).split(",");if(t.length<3)throw new Error(`The color '${e}' is illegal rgb color`);const r={r:Number.parseInt(t[0],10),g:Number.parseInt(t[1],10),b:Number.parseInt(t[2],10)};return t.length>3&&(r.a=Number.parseFloat(t[3])),r},Rm=e=>{const n=e.indexOf("(");if(n===-1)throw new Error(`The color '${e}' is illegal hsl color`);const t=e.substring(n+1,e.length-1).split(",");if(t.length<3)throw new Error(`The color '${e}' is illegal hsl color`);const r={h:Number.parseInt(t[0],10),s:Number.parseFloat(t[1]),l:Number.parseFloat(t[2])};return t.length>3&&(r.a=Number.parseFloat(t[3])),r},Im=e=>{const n=e.indexOf("(");if(n===-1)throw new Error(`The color '${e}' is illegal hsv color`);const t=e.substring(n+1,e.length-1).split(",");if(t.length<3)throw new Error(`The color '${e}' is illegal hsv color`);const r={h:Number.parseInt(t[0],10),s:Number.parseFloat(t[1]),v:Number.parseFloat(t[2])};return t.length>3&&(r.a=Number.parseFloat(t[3])),r},vm=e=>{const n=Wa(e);if(n!=null)return"r"in n?n:"l"in n?Sm(n):Om(n)},$s=(e,n,t)=>(t<0&&(t+=1),t>1&&(t-=1),t<1/6?e+(n-e)*6*t:t<1/2?n:t<2/3?e+(n-e)*(2/3-t)*6:e),Sm=e=>{let{h:n,s:t,l:r}=e;n/=360,t/=100,r/=100;let s=0,i=0,o=0;if(t===0)s=i=o=r;else{const l=r<.5?r*(1+t):r+t-r*t,c=2*r-l;s=$s(c,l,n+1/3),i=$s(c,l,n),o=$s(c,l,n-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},Om=e=>{let{h:n,s:t,v:r}=e;n=n/360*6,t/=100,r/=100;const s=Math.floor(n),i=n-s,o=r*(1-t),a=r*(1-i*t),l=r*(1-(1-i)*t),c=s%6,u=[r,a,o,o,l,r][c],h=[l,r,r,a,o,o][c],f=[o,o,l,r,r,a][c],g={r:u*255,g:h*255,b:f*255};return e.a!==void 0&&(g.a=e.a),g},bm=e=>{let{r:n,g:t,b:r}=e;n/=255,t/=255,r/=255;const s=Math.max(n,t,r),i=Math.min(n,t,r),o=(s+i)/2;let a,l;if(s===i)a=l=0;else{const u=s-i;switch(l=o>.5?u/(2-s-i):u/(s+i),s){case n:a=(t-r)/u+(t<r?6:0);break;case t:a=(r-n)/u+2;break;default:a=(n-t)/u+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},ym=e=>{let{r:n,g:t,b:r}=e;n/=255,t/=255,r/=255;const s=Math.max(n,t,r),i=Math.min(n,t,r);let o;const a=s,l=s-i,c=s===0?0:l/s;if(s===i)o=0;else{switch(s){case n:o=(t-r)/l+(t<r?6:0);break;case t:o=(r-n)/l+2;break;default:o=(n-t)/l+4;break}o/=6}const u={h:Math.round(o*360),s:Math.round(c*100),v:Math.round(a*100)};return e.a!==void 0&&(u.a=e.a),u},wm=e=>e==null,Am=e=>!wm(e)&&typeof e=="object";function Nm(e){const n=/^#(?:[0]{3}|[0]{6})\b/,t=/^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!!(n.test(e)||t.test(e)||r.test(e)||s.test(e)||i.test(e))}function Tm(e){const n=/^#(?:[Ff]{3}|[Ff]{6})\b/,t=/^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!!(n.test(e)||t.test(e)||r.test(e)||s.test(e)||i.test(e))}var Ie=(e=>(e[e.COVER=0]="COVER",e[e.REPLACE=1]="REPLACE",e))(Ie||{});function Mm(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 Lm(e){if(e.t!==void 0)return e.t;if(typeof e.v=="string")return jt.STRING;if(typeof e.v=="number")return jt.NUMBER;if(typeof e.v=="boolean")return jt.BOOLEAN}function Dm(e){if(e==null)return!0;const{v:n,f:t,si:r,p:s,s:i,custom:o}=e;return!(!(n==null||typeof n=="string"&&n.length===0)||t!=null&&t.length>0||r!=null&&r.length>0||s!=null||o!=null)}function Um(e){return e!=null&&(typeof e=="string"||typeof e=="number"||typeof e=="boolean")}var me=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ROW=1]="ROW",e[e.COLUMN=2]="COLUMN",e[e.ALL=3]="ALL",e))(me||{}),ze=(e=>(e[e.NONE=0]="NONE",e[e.ROW=1]="ROW",e[e.COLUMN=2]="COLUMN",e[e.ALL=3]="ALL",e))(ze||{});function Pm(e){return[e.startRow,e.startColumn,e.endRow,e.endColumn]}var Va=(e=>(e.NONE="none",e.BACKWARD="backward",e.FORWARD="forward",e))(Va||{}),za=(e=>(e.RECT="RECT",e.TEXT="TEXT",e))(za||{});function Fm(e,n,t){let r=!1,s=!1,i=e,o=n,a=e,l=n;if(t==null)return{actualRow:e,actualColumn:n,isMergedMainCell:s,isMerged:r,endRow:i,endColumn:o,startRow:a,startColumn:l};for(let c=0;c<t.length;c++){const{startRow:u,endRow:h,startColumn:f,endColumn:g}=t[c];if(e===u&&n===f){i=h,o=g,a=u,l=f,s=!0;break}if(e>=u&&e<=h&&n>=f&&n<=g){i=h,o=g,a=u,l=f,r=!0;break}}return{actualRow:e,actualColumn:n,isMergedMainCell:s,isMerged:r,endRow:i,endColumn:o,startRow:a,startColumn:l}}function km(e){const{actualRow:n,actualColumn:t,isMerged:r,isMergedMainCell:s,mergeInfo:i}=e;let{startY:o,endY:a,startX:l,endX:c}=e,u=n,h=t,f=n,g=t;if(r&&i){const{startRow:E,startColumn:I,endRow:M,endColumn:O,startY:P,endY:$,startX:z,endX:w}=i;u=E,h=I,f=M,g=O,o=P,a=$,l=z,c=w}return s&&(o=i.startY,a=i.endY,l=i.startX,c=i.endX,f=i.endRow,g=i.endColumn),{startRow:u,startColumn:h,endRow:f,endColumn:g,startY:o,endY:a,startX:l,endX:c}}function xm(e){if(!e)return;const{actualRow:n,actualColumn:t,isMerged:r,isMergedMainCell:s,startRow:i,startColumn:o,endRow:a,endColumn:l}=e;let c=n,u=t,h=n,f=t;return(r||s)&&(c=i,u=o,h=a,f=l),{startRow:c,startColumn:u,endRow:h,endColumn:f}}function Ga(e){var t;return!e||(((t=e==null?void 0:e.v)==null?void 0:t.toString())||"").length===0&&!e.p}function Hm(e){return Ga(e)&&(e==null?void 0:e.coverable)!==!1}function yt(e){if(e){if(e.rgb)return e.rgb;if(e.th)return new Nr().setThemeColor(e.th).asThemeColor().asRgbColor().getCssString()}return null}function Bm(e){return W.isString(e)&&e.substring(0,1)==="="&&e.length>1}function jm(e){return W.isString(e)&&e.length>0}function $m(e,n=!1){var i;let t="";const r=new Map([["ff",()=>{e.ff&&(t+=`font-family: ${e.ff}; `)}],["fs",()=>{if(e.fs){let o=e.fs;e.va&&(o/=2),t+=`font-size: ${o}pt; `}}],["it",()=>{e.it&&(t+="font-style: italic; ")}],["bl",()=>{e.bl&&(t+="font-weight: bold; ")}],["ul",()=>{var o;(o=e.ul)!=null&&o.s&&(t.indexOf("text-decoration-line")>-1?t=t.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} underline`):t+="text-decoration: underline; ",e.ul.cl&&t.indexOf("text-decoration-color")===-1&&(t+=`text-decoration-color: ${yt(e.ul.cl)}; `),e.ul.t&&t.indexOf("text-decoration-style")===-1&&(t+=`text-decoration-style: ${e.ul.t} `))}],["st",()=>{var o;(o=e.st)!=null&&o.s&&(t.indexOf("text-decoration-line")>-1?t=t.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} line-through`):t+="text-decoration-line: line-through; ",e.st.cl&&t.indexOf("text-decoration-color")===-1&&(t+=`text-decoration-color: ${yt(e.st.cl)}; `),e.st.t&&t.indexOf("text-decoration-style")===-1&&(t+=`text-decoration-style: ${e.st.t} `))}],["ol",()=>{var o;(o=e.ol)!=null&&o.s&&(t.indexOf("text-decoration-line")>-1?t=t.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} overline`):t+="text-decoration-line: overline; ",e.ol.cl&&t.indexOf("text-decoration-color")===-1&&(t+=`text-decoration-color: ${yt(e.ol.cl)}; `),e.ol.t&&t.indexOf("text-decoration-style")===-1&&(t+=`text-decoration-style: ${e.ol.t} `))}],["bg",()=>{e.bg&&(t+=`background: ${yt(e.bg)}; `)}],["bd",()=>{var o,a,l,c,u,h,f,g,E,I,M,O;(o=e.bd)!=null&&o.b&&(t+=`border-bottom: ${Dr((a=e.bd)==null?void 0:a.b.s)} ${(l=yt(e.bd.b.cl))!=null?l:""}; `),(c=e.bd)!=null&&c.t&&(t+=`border-top: ${Dr((u=e.bd)==null?void 0:u.t.s)} ${(h=yt(e.bd.t.cl))!=null?h:""}; `),(f=e.bd)!=null&&f.r&&(t+=`border-right: ${Dr((g=e.bd)==null?void 0:g.r.s)} ${(E=yt(e.bd.r.cl))!=null?E:""}; `),(I=e.bd)!=null&&I.l&&(t+=`border-left: ${Dr((M=e.bd)==null?void 0:M.l.s)} ${(O=yt(e.bd.l.cl))!=null?O:""}; `)}],["cl",()=>{e.cl&&(t+=`color: ${yt(e.cl)}; `)}],["va",()=>{e.va===Dt.SUBSCRIPT?t+="vertical-align: sub; ":e.va===Dt.SUPERSCRIPT&&(t+="vertical-align: super; ")}],["td",()=>{e.td===Vn.LEFT_TO_RIGHT?t+="direction: ltr; ":e.td===Vn.RIGHT_TO_LEFT&&(t+="direction: rtl; ")}],["tr",()=>{var o,a,l;e.tr&&(t+=`--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===Bt.LEFT?t+="text-align: left; ":e.ht===Bt.RIGHT?t+="text-align: right; ":e.ht===Bt.CENTER?t+="text-align: center; ":e.ht===Bt.JUSTIFIED&&(t+="text-align: justify; ")}],["vt",()=>{e.vt===Zt.BOTTOM?t+="vertical-align: bottom; ":e.vt===Zt.TOP?t+="vertical-align: top; ":e.vt===Zt.MIDDLE&&(t+="vertical-align: middle; ")}],["tb",()=>{e.tb===qt.CLIP?t+="white-space: nowrap; overflow-x: hidden; ":e.tb===qt.WRAP&&(t+="white-space: normal;")}],["pd",()=>{var u,h,f,g,E,I,M,O;const o=`${(u=e.pd)==null?void 0:u.b}pt`,a=`${(h=e.pd)==null?void 0:h.t}pt`,l=`${(f=e.pd)==null?void 0:f.l}pt`,c=`${(g=e.pd)==null?void 0:g.r}pt`;(E=e.pd)!=null&&E.b&&(t+=`padding-bottom: ${o}; `),(I=e.pd)!=null&&I.t&&(t+=`padding-top: ${a}; `),(M=e.pd)!=null&&M.l&&(t+=`padding-left: ${l}; `),(O=e.pd)!=null&&O.r&&(t+=`padding-right: ${c}; `)}]]),s=["bd","tr","tb"];for(const o in e)n&&s.includes(o)||(i=r.get(o))==null||i();return t}function Dr(e){let n="";return e===He.NONE?n="none":e===He.THIN?n="0.5pt solid":e===He.HAIR?n="0.5pt double":e===He.DOTTED?n="0.5pt dotted":e===He.DASHED||e===He.DASH_DOT?n="0.5pt dashed":e===He.DASH_DOT_DOT?n="0.5pt dotted":e===He.DOUBLE?n="0.5pt double":e===He.MEDIUM?n="1pt solid":e===He.MEDIUM_DASHED||e===He.MEDIUM_DASH_DOT?n="1pt dashed":e===He.MEDIUM_DASH_DOT_DOT?n="1pt dotted":e===He.SLANT_DASH_DOT?n="0.5pt dashed":e===He.THICK&&(n="1.5pt solid"),n}function Wm(e){let n=0;if(e=e.trim(),e==="none")n=He.NONE;else if(e==="0.5pt solid")n=He.THIN;else if(e==="0.5pt double")n=He.HAIR;else if(e==="0.5pt dotted")n=He.DOTTED;else if(e==="0.5pt dashed")n=He.DASHED;else if(e==="1pt solid")n=He.MEDIUM;else if(e==="1pt dashed")n=He.MEDIUM_DASHED;else if(e==="1pt dotted")n=He.MEDIUM_DASH_DOT_DOT;else if(e==="1.5pt solid")n=He.THICK;else if(!e.includes("none"))n=He.THIN;else return He.NONE;return n}function Vm(e,n){let t=e.body;if(n){const{headers:r,footers:s}=e;r!=null&&r[n]?t=r[n].body:s!=null&&s[n]&&(t=s[n].body)}return t}function zm(e,n){const{startRow:t,endRow:r,startColumn:s,endColumn:i,rangeType:o}=e;if(t<0||s<0||r<0||i<0||!(Number.isNaN(t)&&Number.isNaN(r))&&o===me.COLUMN||!(Number.isNaN(s)&&Number.isNaN(i))&&o===me.ROW||o!==me.ROW&&o!==me.COLUMN&&(Number.isNaN(s)||Number.isNaN(t)||Number.isNaN(i)||Number.isNaN(r)))return!1;if(n){const a=n.getRowCount(),l=n.getColumnCount();if(r>=a||i>=l)return!1}return!0}function Gm(e,n){return{startRow:e,endRow:e,startColumn:n,endColumn:n}}function Ws(e,n){return Object.prototype.toString.call(e)===Object.prototype.toString.call(n)?Object.prototype.toString.call(e)==="[object Object]"||Object.prototype.toString.call(e)==="[object Array]"?Object.keys(e).length!==Object.keys(n).length?!1:Object.keys(e).every(t=>Ws(e[t],n[t])):e===n:!1}function Ka(e,n){const t=e.ts||{},r=n.ts||{};return e.sId!==n.sId?!1:Ws(t,r)}function Km(e,n){return n.some(t=>e.indexOf(t)>-1)}function Ur(e,n,t,r){if(e>n&&([e,n]=[n,e]),t>r&&([t,r]=[r,t]),n<t||r<e)return[e,n];t<e&&(t=e),r>n&&(r=n);const s=r-t+1;let i=[];return e===t?i=[r+1-s,n-s]:n===r?i=[e,t-1]:i=[e,n-s],i}function Ym(e){if(e==null)return!1;const n=e.bullet;return(n==null?void 0:n.listId)!=null}function Xm(e){if(e==null)return!1;const n=e.paragraphStyle;return Ya(n)}function Ya(e){var n;return!(e==null||(e.indentStart==null||e.indentStart.v===0)&&e.hanging==null||((n=e.hanging)==null?void 0:n.v)===0)}function Xa(e,n,t){return e.slice(0,n)+t+e.slice(n)}function Qa(e,n,t){return n>t?e:e.slice(0,n)+e.slice(t)}const Qm=/\s/g;function Jm(e){return e===null||e.toString().replace(Qm,"")===""||typeof e=="boolean"?!1:!isNaN(e)}function Zm(e){let n=0;for(let t=0;t<e.length;t++)n=e.charCodeAt(t)+(n<<6)+(n<<16)-n;return n>>>0}const Ue=Symbol("newer"),Xe=Symbol("older");class qm{constructor(n){R(this,"entry");this.entry=n}[Symbol.iterator](){return this}next(){const n=this.entry;return n?(this.entry=n[Ue],{done:!1,value:n.key}):{done:!0,value:void 0}}}class e_{constructor(n){R(this,"entry");this.entry=n}[Symbol.iterator](){return this}next(){const n=this.entry;return n?(this.entry=n[Ue],{done:!1,value:n.value}):{done:!0,value:void 0}}}class t_{constructor(n){R(this,"entry");this.entry=n}[Symbol.iterator](){return this}next(){const n=this.entry;return n?(this.entry=n[Ue],{done:!1,value:[n.key,n.value]}):{done:!0,value:void 0}}}fu=Ue,du=Xe;class Ja{constructor(n,t){R(this,"key");R(this,"value");R(this,fu);R(this,du);this.key=n,this.value=t,this[Ue]=void 0,this[Xe]=void 0}toJSON(){return{key:this.key,value:this.value}}}class Pr{constructor(...n){R(this,"_keymap");R(this,"size",0);R(this,"limit");R(this,"oldest");R(this,"newest");R(this,"_onShiftListeners",[]);if(zn.hasLength(n,1)){if(zn.isNumber(n[0])){const t=n[0];this._initialize(t,void 0);return}if(zn.isIterable(n[0])){const t=n[0];this._initialize(0,t);return}return}if(zn.hasLength(n,2)){const t=n[0],r=n[1];this._initialize(t,r)}}onShift(n){if(this._onShiftListeners.indexOf(n)===-1)return this._onShiftListeners.push(n),We(()=>Un(this._onShiftListeners,n));throw new Error("[LRUMap]: the listener has been registered!")}_initialize(n,t){this.oldest=void 0,this.newest=void 0,this.size=0,this.limit=n,this._keymap=new Map,t&&(this.assign(t),n<1&&(this.limit=this.size))}_markEntryAsUsed(n){n!==this.newest&&(n[Ue]&&(n===this.oldest&&(this.oldest=n[Ue]),n[Ue][Xe]=n[Xe]),n[Xe]&&(n[Xe][Ue]=n[Ue]),n[Ue]=void 0,n[Xe]=this.newest,this.newest&&(this.newest[Ue]=n),this.newest=n)}assign(n){let t,r=this.limit||Number.MAX_VALUE;this._keymap.clear();const s=n[Symbol.iterator]();for(let i=s.next();!i.done;i=s.next()){const o=new Ja(i.value[0],i.value[1]);if(this._keymap.set(o.key,o),t?(t[Ue]=o,o[Xe]=t):this.oldest=o,t=o,r--===0)throw new Error("overflow")}this.newest=t,this.size=this._keymap.size}set(n,t){let r=this._keymap.get(n);return r?(r.value=t,this._markEntryAsUsed(r),this):(this._keymap.set(n,r=new Ja(n,t)),this.newest?(this.newest[Ue]=r,r[Xe]=this.newest):this.oldest=r,this.newest=r,++this.size,this.size>this.limit&&this.shift(),this)}shift(){const n=this.oldest;if(n)return this.oldest&&this.oldest[Ue]?(this.oldest=this.oldest[Ue],this.oldest[Xe]=void 0):(this.oldest=void 0,this.newest=void 0),n[Ue]=n[Xe]=void 0,this._keymap.delete(n.key),--this.size,this._onShiftListeners.forEach(t=>t(n)),[n.key,n.value]}get(n){const t=this._keymap.get(n);if(t)return this._markEntryAsUsed(t),t.value}has(n){return this._keymap.has(n)}find(n){const t=this._keymap.get(n);return t?t.value:void 0}delete(n){const t=this._keymap.get(n);if(t)return this._keymap.delete(t.key),t[Ue]&&t[Xe]?(t[Xe][Ue]=t[Ue],t[Ue][Xe]=t[Xe]):t[Ue]?(t[Ue][Xe]=void 0,this.oldest=t[Ue]):t[Xe]?(t[Xe][Ue]=void 0,this.newest=t[Xe]):this.oldest=this.newest=void 0,this.size--,t.value}clear(){this.oldest=void 0,this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new qm(this.oldest)}values(){return new e_(this.oldest)}entries(){return this[Symbol.iterator]()}[Symbol.iterator](){return new t_(this.oldest)}forEach(n,t){typeof t!="object"&&(t=this);let r=this.oldest;for(;r;)n.call(t,r.value,r.key,this),r=r[Ue]}toJSON(){const n=new Array(this.size);let t=0,r=this.oldest;for(;r;)n[t++]={key:r.key,value:r.value},r=r[Ue];return n}toString(){let n="",t=this.oldest;for(;t;)n+=`${String(t.key)}:${t.value}`,t=t[Ue],t&&(n+=" < ");return n}}class zn{static hasLength(n,t){return n.length===t}static getValueType(n){return Object.prototype.toString.apply(n)}static isObject(n){return this.getValueType(n)==="[object Object]"}static isIterable(n){return n[Symbol.iterator]!=null}static isNumber(n){return this.getValueType(n)==="[object Number]"}}var Za={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(typeof self<"u"?self:nt,function(){return function(){var t={d:function(p,m){for(var _ in m)t.o(m,_)&&!t.o(p,_)&&Object.defineProperty(p,_,{enumerable:!0,get:m[_]})},o:function(p,m){return Object.prototype.hasOwnProperty.call(p,m)}},r={};t.d(r,{default:function(){return lt}});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(p){const m=i.exec(p);if(!m)throw new SyntaxError("Malformed locale: ".concat(p));return{lang:m[1]+(m[2]?"_"+m[2]:""),language:m[1],territory:m[2]||"",codeset:m[3]||"",modifier:m[4]||""}}function c(p){if(typeof p=="number")return s[65535&p]||null;const m=parseInt(p,16);return isFinite(m)&&s[65535&m]?s[65535&m]||null:i.test(p)?p:null}function u(p){const m=c(p);let _=null;if(m){const v=l(m);_=o[v.lang]||o[v.language]||null}return _}function h(p){return Object.assign({},a,p)}function f(p,m){const _=typeof m=="object"?m:l(m);return o[_.lang]=h(p),_.language===_.lang||o[_.language]||(o[_.language]=h(p)),o[_.lang]}const g=h({group:","});function E(p,m){if(typeof p!="number")return p;if(p<0)return-E(-p,m);if(m){const _=10**(m||0)||1;return E(p*_,0)/_}return Math.round(p)}g.isDefault=!0,f({group:",",ampm:["上午","下午"],mmmm:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],mmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],ddd:["周日","周一","周二","周三","周四","周五","周六"]},"zh_CN"),f({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"),f({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"),f({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"),f({group:",",ampm:["ก่อนเที่ยง","หลังเที่ยง"],mmmm:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],mmm:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],dddd:["วันอาทิตย์","วันจันทร์","วันอังคาร","วันพุธ","วันพฤหัสบดี","วันศุกร์","วันเสาร์"],ddd:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."]},"th"),f({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"),f({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"),f({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"),f({group:","},"en"),f({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"),f({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"),f({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"),f({group:".",decimal:",",ampm:["π.μ.","μ.μ."],mmmm:["Ιανουαρίου","Φεβρουαρίου","Μαρτίου","Απριλίου","Μαΐου","Ιουνίου","Ιουλίου","Αυγούστου","Σεπτεμβρίου","Οκτωβρίου","Νοεμβρίου","Δεκεμβρίου"],mmm:["Ιαν","Φεβ","Μαρ","Απρ","Μαΐ","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"],dddd:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"],ddd:["Κυρ","Δευ","Τρί","Τετ","Πέμ","Παρ","Σάβ"]},"el"),f({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"),f({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"),f({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"),f({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"),f({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"),f({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"),f({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"),f({decimal:",",nan:"не число",mmmm:["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"],mmm:["янв.","февр.","мар.","апр.","мая","июн.","июл.","авг.","сент.","окт.","нояб.","дек."],dddd:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],ddd:["вс","пн","вт","ср","чт","пт","сб"]},"ru"),f({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"),f({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"),f({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"),f({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 I(p,m,_){const v=p<0?-1:1,y=10**(m||2),T=10**(_||2);let N,L,C=Math.abs(p),k=0,q=0,F=0,J=1;if((p=C)%1==0)L=[p*v,1];else if(p<1e-19)L=[v,1e19];else if(p>1e19)L=[1e19*v,1];else{do if(C=1/(C-Math.floor(C)),N=J,J=J*Math.floor(C)+k,k=N,q=F,F=Math.floor(p*J+.5),F>=y||J>=T)return[v*q,k];while(Math.abs(p-F/J)>=1e-10&&C!==Math.floor(C));L=[v*F,J]}return L}const M={overflow:"######",dateErrorThrows:!1,dateErrorNumber:!0,dateSpanLarge:!0,leap1900:!0,nbsp:!0,throws:!0,invalid:"######",locale:"",ignoreTimezone:!1},O=Object.assign({},M);function P(p){if(p===null&&(p=M),p){for(const m in p)if(m in M){const _=p[m];O[m]=_==null?M[m]:_}}return{...O}}const $={"#":"",0:"0","?":" "},z={"@":"text","-":"minus","+":"plus"},w=["#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"],b=["¤","$","£","¥","֏","؋","৳","฿","៛","₡","₦","₩","₪","₫","€","₭","₮","₱","₲","₴","₸","₹","₺","₼","₽","₾","₿"],D=new RegExp("["+b.join("")+"]");function G(p,m,_){return m[_+"_max"]=p.length,m[_+"_min"]=p.replace(/#/g,"").length,m}const _e={};function fe(p){if(!(p in _e)){const m=[],_=p.replace(/^[#,]+/,"").replace(/[1-9]\d*/g,v=>"?".repeat(v.length));for(let v=0;v<_.length;v++){const y=_.charAt(v);m[v]=y in $?$[y]:y}_e[p]=m.join("")}return _e[p]}function ye(p,m){typeof p=="string"&&(p={type:"string",value:p=p.replace(/ /g,$["?"])}),m.push(p)}function Ae(p){const m=[],_={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:m};let v=p+"",y="int",T=!1,N=null;const L=[];let C,k,q=!1;for(;v&&!T;){if(C=/^General/i.exec(v))_.general=!0,ye({type:"general"},m);else if(y==="int"&&(C=/^[#?0]+(?:,[#?0]+)*/.exec(v))||y==="den"&&(C=/^[#?\d]+/.exec(v))||(C=/^[#?0]+/.exec(v)))_[y+"_pattern"].push(C[0]),N={type:y,num:C[0]},ye(N,m);else if((C=/^\//.exec(v))&&_[y+"_pattern"].length){if(!N)throw new SyntaxError("Missing a numerator in pattern ".concat(p));_.fractions=!0,_.num_pattern.push(_[y+"_pattern"].pop()),N.type="num",y="den",ye({type:"div"},m)}else if(C=/^,+/.exec(v)){const A=v.charAt(1)in $;k.slice(-1)in $&&(C[0].length>1||!A)?_.scale=.001**C[0].length:_.dec_fractions||ye(C[0],m)}else{if(C=/^;/.exec(v)){T=!0;break}if(C=/^[@+-]/.exec(v))C[0]==="@"&&(_.text=!0),ye({type:z[C[0]]},m);else if(C=/^(?:\[(h+|m+|s+)\])/i.exec(v)){const A=C[1].toLowerCase(),H=A[0],ie={type:"",size:0,date:1,raw:C[0],pad:A.length};H==="h"?(ie.size=16,ie.type="hour-elap"):H==="m"?(ie.size=32,ie.type="min-elap"):(ie.size=64,ie.type="sec-elap"),_.date=_.date|ie.size,L.push(ie),ye(ie,m)}else if(C=/^(?:B2)/i.exec(v))q||(_.date_system=6);else if(C=/^(?:B1)/i.exec(v))q||(_.date_system=1);else if(C=/^(?:([hHmMsSyYbBdDegG])\1*)/.exec(v)){const A={type:"",size:0,date:1,raw:C[0]},H=C[0].toLowerCase(),ie=H[0];if(H==="y"||H==="yy")A.size=2,A.type="year-short";else if(ie==="y"||ie==="e")A.size=2,A.type="year";else if(H==="b"||H==="bb")A.size=2,A.type="b-year-short";else if(ie==="b")A.size=2,A.type="b-year";else if(H==="d"||H==="dd")A.size=8,A.type="day",A.pad=/dd/.test(H);else if(H==="ddd")A.size=8,A.type="weekday-short";else if(ie==="d")A.size=8,A.type="weekday";else if(ie==="h")A.size=16,A.type="hour",A.pad=/hh/i.test(H);else if(ie==="m"){H.length===3?(A.size=4,A.type="monthname-short"):H.length===5?(A.size=4,A.type="monthname-single"):H.length>=4&&(A.size=4,A.type="monthname");const he=L[L.length-1];!A.type&&he&&!he.used&&80&he.size&&(he.used=!0,A.size=32,A.type="min",A.pad=/mm/.test(H)),A.type||(A.size=4,A.type="month",A.pad=/mm/.test(H),A.indeterminate=!0)}else if(ie==="s"){A.size=64,A.type="sec",A.pad=/ss/.test(H);const he=L[L.length-1];he&&32&he.size?A.used=!0:he&&he.indeterminate&&(delete he.indeterminate,he.size=32,he.type="min",A.used=!0)}_.date=_.date|A.size,_.date_eval=!0,L.push(A),ye(A,m)}else if(C=/^(?:AM\/PM|am\/pm|A\/P)/.exec(v))_.clock=12,_.date=16|_.date,_.date_eval=!0,ye({type:"am",short:C[0]==="A/P"},m);else if(_.date&&(C=/^\.0{1,3}/i.exec(v))){const A=C[0].length-1,H=[64,128,256,512][A];_.date=_.date|H,_.date_eval=!0,_.sec_decimals=Math.max(_.sec_decimals,A),ye({type:"subsec",size:H,decimals:A,date:1,raw:C[0]},m)}else if((C=/^\\(.)/.exec(v))||(C=/^"([^"]*?)"/.exec(v)))ye(C[1],m);else if(C=/^\[(<[=>]?|>=?|=)\s*(-?[.\d]+)\]/.exec(v))_.condition=[C[1],parseFloat(C[2],10)];else if(C=/^\[\$([^\]]+)\]/.exec(v)){const A=C[1].split("-"),H=A.length<2?"":A[A.length-1],ie=A[0];ie&&ye(ie,m);const he=c(H);he&&(_.locale=he);const Se=parseInt(H,16);isFinite(Se)&&16711680&Se&&(Se>>16&255)===6&&(_.date_system=6),q=!0}else if(C=/^\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*(\d+))\]/i.exec(v))_.color=C[2]?w[parseInt(C[2],10)]||"#000":C[1].toLowerCase();else if(!(C=/^\[(DBNum1|ENG|HIJ|JPN|TWN)\]/i.exec(v))){if(C=/^%/.exec(v))_.scale=100,_.percent=!0,ye("%",m);else if(C=/^_(\\.|.)/.exec(v))ye(" ",m);else if(C=/^\./.exec(v))ye({type:"point",value:C[0]},m),_.dec_fractions=!0,y="frac";else if(C=/^[Ee]([+-]?|(?=[0#?]))/.exec(v))_.exponential=!0,_.exp_plus=C[1]==="+",y="man",ye({type:"exp",plus:C[1]==="+"},m);else if(!(C=/^\*(\\.|.)/.exec(v))){if(C=/^[BENn[]/.exec(v))throw new SyntaxError("Unexpected char ".concat(v.charAt(0)," in pattern ").concat(p));v[0]==="("&&(_.parens=!0),C=[v[0]],ye(C[0],m)}}}k=C[0],v=v.slice(C?C[0].length:1)}if(_.pattern=p.slice(0,p.length-v.length),/^((?:\[[^\]]+\])+)(;|$)/.test(_.pattern)&&!/^\[(?:h+|m+|s+)\]/.test(_.pattern)&&ye({type:"text"},m),_.fractions&&_.dec_fractions||_.fractions&&_.exponential)throw new SyntaxError("Invalid pattern: ".concat(_.pattern));const F=_.int_pattern.join("");if(_.grouping=F.indexOf(",")>=0,_.grouping){const A=F.split(","),H=A.length;H===2?(_.group_pri=A[1].length,_.group_sec=_.group_pri):H>2&&(_.group_pri=A[H-1].length,_.group_sec=A[H-2].length)}else _.group_pri=0,_.group_sec=0;G(F.replace(/[,]/g,""),_,"int"),G(_.frac_pattern.join(""),_,"frac"),G(_.man_pattern.join(""),_,"man");let J=_.num_pattern.join(""),ce=_.den_pattern.join("");const V=/\?/.test(ce)||/\?/.test(J);return ce=ce.replace(/\d/g,V?"?":"#"),V&&(ce=ce.replace(/#$/g,"?")),G(J,_,"num"),G(ce,_,"den"),V&&(J=J.replace(/#$/g,"?")),_.int_padding=fe(_.int_pattern.join("")),_.man_padding=fe(_.man_pattern.join("")),_.num_padding=fe(J),_.den_padding=fe(ce),_.den_pattern.length&&(_.denominator=parseInt(_.den_pattern.join("").replace(/\D/g,""),10)),_.integer=!!_.int_pattern.join("").length,_.fractions&&m.forEach((A,H)=>{const ie=m[H+1];A.type==="string"&&ie&&(ie.type==="num"?A.rule="num+int":ie.type==="div"?A.rule="num":ie.type==="den"&&(A.rule="den"))}),_}const Le=p=>{const m=p.condition;m&&m[1]<0&&(m[0]==="<"||m[0]==="<="||m[0]==="=")||p.tokens.unshift({type:"minus",volatile:!0})};function Be(p){const m=[];let _,v=!1,y=null,T=p,N=0,L=!1,C=0,k=0;do{if(L=Ae(T),(L.date||L.general)&&(L.int_pattern.length||L.frac_pattern.length||L.scale!==1||L.text))throw new Error("Illegal format");if(L.condition&&(k++,v=!0),L.text){if(y)throw new Error("Unexpected partition");y=L}L.locale&&(_=c(L.locale)),m.push(L),N=T.charAt(L.pattern.length)===";"?1:0,T=T.slice(L.pattern.length+N),C++}while(N&&C<4&&k<3);if(N)throw new Error("Unexpected partition");if(k>2)throw new Error("Unexpected condition");const q=m[3];if(q&&(q.int_pattern.length||q.frac_pattern.length||q.date))throw new Error("Unexpected partition");if(v){const F=m.length;if(F===1&&(m[1]=Ae("General"),m[1].generated=!0),F<3){const J=m[0],ce=m[1];if(Le(J),ce.condition)Le(ce);else{const V=J.condition;(V[0]==="="||V[1]>=0&&(V[0]===">"||V[0]===">="))&&ce.tokens.unshift({type:"minus",volatile:!0})}}else m.forEach(Le)}else{if(m.length<4&&y)for(let F=0,J=m.length;F<J;F++)m[F]===y&&m.splice(F,1);if(m.length<1&&y&&(m[0]=Ae("General"),m[0].generated=!0),m.length<2){const F=Ae(m[0].pattern);F.tokens.unshift({type:"minus",volatile:!0}),F.generated=!0,m.push(F)}if(m.length<3){const F=Ae(m[0].pattern);F.generated=!0,m.push(F)}if(m.length<4)if(y)m.push(y);else{const F=Ae("@");F.generated=!0,m.push(F)}m[0].condition=[">",0],m[1].condition=["<",0],m[2].condition=null}return{pattern:p,partitions:m,locale:_}}const Ne=Math.floor;function ot(p){if((!(arguments.length>1&&arguments[1]!==void 0)||arguments[1])&&p>=0){if(p===0)return[1900,1,0];if(p===60)return[1900,2,29];if(p<60)return[1900,p<32?1:2,(p-1)%31+1]}let _=p+68569+2415019;const v=Ne(4*_/146097);_-=Ne((146097*v+3)/4);const y=Ne(4e3*(_+1)/1461001);_=_-Ne(1461*y/4)+31;const T=Ne(80*_/2447),N=_-Ne(2447*T/80);_=Ne(T/11);const L=T+2-12*_;return[0|100*(v-49)+y+_,0|L,0|N]}function Ti(p){return ot(p+1462)}function ur(p){if(p===60)throw new Error("#VALUE!");if(p<=1)return[1317,8,29];if(p<60)return[1317,p<32?9:10,1+(p-2)%30];const m=10631/30,_=.1335;let v=p+466935;const y=Ne(v/10631);v-=10631*y;const T=Ne((v-_)/m);v-=Ne(T*m+_);const N=Ne((v+28.5001)/29.5);return N===13?[30*y+T,12,30]:[30*y+T,N,v-Ne(29.5001*N-29)]}function wn(p){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,_=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];const v=Ne(p);return m===6?ur(v):m===-1?Ti(v):ot(v,_)}const on=Math.floor,hr=86400;function vt(p,m){let _=null;if(Array.isArray(p)){const[v,y,T,N,L,C]=p;_=Date.UTC(v,y==null?0:y-1,T!=null?T:1,N||0,L||0,C||0)}else if(p instanceof Date&&(_=1*p,!m||!m.ignoreTimezone)){const v=new Date;v.setUTCFullYear(p.getFullYear(),p.getMonth(),p.getDate()),v.setUTCHours(p.getHours(),p.getMinutes(),p.getSeconds(),p.getMilliseconds()),_=1*v}if(_!=null&&isFinite(_)){const v=_/864e5;return v-(v<=-25509?-25568:-25569)}return p}function Jr(p,m){let _=0|p;const v=hr*(p-_);let y=on(v);v-y>.9999&&(y+=1,y===hr&&(y=0,_+=1));const T=y<0?hr+y:y,[N,L,C]=wn(p,0,m&&m.leap1900),k=on(T/60/60)%60,q=on(T/60)%60,F=on(T)%60;if(m&&m.nativeDate){const J=new Date(0);return J.setUTCFullYear(N,L-1,C),J.setUTCHours(k,q,F),J}return[N,L,C,k,q,F]}function Zr(p){return!!(p[0]&&p[0].percent||p[1]&&p[1].percent||p[2]&&p[2].percent||p[3]&&p[3].percent)}function S(p){return!!(p[0]&&p[0].date||p[1]&&p[1].date||p[2]&&p[2].date||p[3]&&p[3].date)}function U(p){const[m,_,v,y]=p;return!(m&&!m.generated||_&&!_.generated||v&&!v.generated||!y||!y.text||y.generated)}const Y={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},se=[["DMY",1],["DM",2],["MY",3],["MDY",4],["MD",5],["hmsa",6],["hma",7],["hms",8],["hm",9]],X={total:1,sign:0,period:0,int:1,frac:0},Z=(p,m)=>p.replace(/\./,m.decimal);function Ee(p,m,_,v){const y=0|_;if(typeof _=="string")p.push(_);else if(_===y)p.push(Math.abs(y));else{const T=Math.abs(_);let N=T?Math.floor(Math.log10(T)):0,L=N<0?T*10**-N:T/10**N;L===10&&(L=1,N++);const C=function(q){let F=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];const J=Math.abs(q);if(!J)return X;const ce=F&&q<0?1:0,V=Math.floor(J),A=Math.floor(Math.log10(J)+1);let H=0,ie=0;if(V!==J){H=1;const he=String(E(A<0?J*10**-A:J/10**A,15));let Se=he.length,Oe=!0,De=0;for(;De<=he.length;){if(he[De]==="."){Se--;break}he[De]==="0"&&Oe?Se--:Oe=!1,De++}ie=Se-A,ie<0&&(ie=0,H=0)}return{total:ce+Math.max(A,1)+H+ie,digits:Math.max(A,0)+ie,sign:ce,period:H,int:Math.max(A,1),frac:ie}}(T),k=()=>{const q=Math.abs(N);let F;F=L===1?L:E(L,5),p.push(Z(F+"",v),v.exponent,N<0?v.negative:v.positive,q<10?"0":"",q)};if(N>=-4&&N<=-1){const q=T.toPrecision(10+N).replace(/\.?0+$/,"");p.push(Z(q,v))}else if(N===10){const q=T.toFixed(10).slice(0,12).replace(/\.$/,"");p.push(Z(q,v))}else if(Math.abs(N)<=9)if(C.total<=11){const q=E(T,9).toFixed(C.frac);p.push(Z(q,v))}else N===9?p.push(Math.floor(T)):N>=0&&N<9?p.push(E(T,9-N)):k();else C.total>=12?k():Math.floor(T)===T?p.push(Math.floor(T)):p.push(Z(E(T,9).toFixed(C.frac),v))}return p}const ue=86400,B={int:"integer",frac:"fraction",man:"mantissa",num:"numerator",den:"denominator"},K=function(p){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const _=Math.floor(Math.log10(p));return m>1?Math.floor(_/m)*m:_};function Q(p,m,_,v){let y="",T="",N="",L="",C="",k=0,q=0|p,F=0,J=0,ce=1,V=0,A=0,H=0,ie=0,he=0,Se=0;const Oe=v||g;if(!m.text&&isFinite(m.scale)&&m.scale!==1&&(p=function(ae){if(ae===0)return ae;const ge=Math.ceil(Math.log10(ae<0?-ae:ae)),j=10**(16-Math.floor(ge));return Math.round(ae*j)/j}(p*m.scale)),m.exponential){let ae=Math.abs(p);if(ae){const ge=10**-K(ae,m.int_max),j=E(ae*ge,m.frac_max)/ge;k=K(j,m.int_max)}ae/=10**k,p=p<0?-ae:ae,y+=Math.abs(k)}if(m.integer){const ae=Math.abs(E(p,m.fractions?1:m.frac_max));C+=ae<1?"":Math.floor(ae)}if(m.grouping){let ae="",ge=C.length;for(ge>m.group_pri&&(ge-=m.group_pri,ae=Oe.group+C.slice(ge,ge+m.group_pri)+ae);ge>m.group_sec;)ge-=m.group_sec,ae=Oe.group+C.slice(ge,ge+m.group_sec)+ae;C=ge?C.slice(0,ge)+ae:ae}m.dec_fractions&&(L=String(E(p,m.frac_max)).split(".")[1]||"");let De=!1;if(m.fractions){const ae=Math.abs(m.integer?p%1:p);if(ae)if(De=!0,isFinite(m.denominator))N+=m.denominator,T+=E(ae*m.denominator),T==="0"&&(T="",N="",De=!1,C||(C="0"));else{const ge=I(ae,m.integer?m.num_max:1/0,m.den_max);T+=ge[0],N+=ge[1],m.integer&&T==="0"&&(C||(C="0"),T="",N="",De=!1)}}if(m.date){q=Math.trunc(p);const ae=ue*(p-q);if(F=Math.floor(ae),Se=ae-F,Math.abs(Se)<1e-6?Se=0:Se>.9999&&(Se=0,F+=1,F===ue&&(F=0,q+=1)),Se){const ge=512&m.date||256&m.date||128&m.date;(ge===512&&Se>.9995||ge===256&&Se>.995||ge===128&&Se>.95||!ge&&Se>=.5)&&(F++,Se=0)}if(q||m.date_system){const ge=wn(p,m.date_system,_.leap1900);J=ge[0],ce=ge[1],V=ge[2]}if(F){const ge=F<0?ue+F:F;he=Math.floor(ge)%60,ie=Math.floor(ge/60)%60,H=Math.floor(ge/60/60)%60}if(A=(6+q)%7,m.date_eval&&(ct=p,ut=q+F/ue,_.dateSpanLarge?ct<-694324||ut>=35830291:ct<0||ut>=2958466)){if(_.dateErrorThrows)throw new Error("Date out of bounds");return _.dateErrorNumber?Ee(p<0?[Oe.negative]:[],0,p,Oe).join(""):_.overflow}}var ct,ut;if(m.int_padding&&(C=m.int_padding.length===1?C||m.int_padding:m.int_padding.substring(0,m.int_padding.length-C.length)+C),m.num_padding&&(T=m.num_padding.length===1?T||m.num_padding:m.num_padding.substring(0,m.num_padding.length-T.length)+T),m.den_padding&&(N=m.den_padding.length===1?N||m.den_padding:N+m.den_padding.slice(N.length)),m.man_padding){const ae=m.exp_plus?"+":"";y=m.man_padding.length===1?(k<0?"-":ae)+(y||m.man_padding):(k<0?"-":ae)+m.man_padding.slice(0,m.man_padding.length-y.length)+y}const ne=[];let Ve=0;const le={int:0,frac:0,man:0,num:0,den:0};for(let ae=0,ge=m.tokens.length;ae<ge;ae++){const j=m.tokens[ae],tt=j.num?j.num.length:0;if(j.type==="string")j.rule?j.rule==="num"?De?ne.push(j.value):(m.num_min>0||m.den_min>0)&&ne.push(j.value.replace(/./g,$["?"])):j.rule==="num+int"?De&&C?ne.push(j.value):m.den_min>0&&(C||m.num_min)&&ne.push(j.value.replace(/./g,$["?"])):j.rule==="den"&&(De?ne.push(j.value):(m.den_min>0||m.den_min>0)&&ne.push(j.value.replace(/./g,$["?"]))):ne.push(j.value);else if(j.type==="error")ne.push(_.invalid);else if(j.type==="point")ne.push(m.date?j.value:Oe.decimal);else if(j.type==="general")Ee(ne,0,p,Oe);else if(j.type==="exp")ne.push(Oe.exponent);else if(j.type==="minus")j.volatile&&m.date||j.volatile&&(p>=0||typeof p!="number")||(j.volatile&&!m.fractions&&(m.integer||m.dec_fractions)?(p<0&&C&&C!=="0"||L)&&ne.push(Oe.negative):ne.push(Oe.negative));else if(j.type==="plus")ne.push(Oe.positive);else if(j.type==="text")ne.push(p);else if(j.type==="div")De?ne.push("/"):m.num_min>0||m.den_min>0?ne.push($["?"]):ne.push($["#"]);else if(j.type==="int")if(m.int_pattern.length===1)ne.push(C);else{const Te=Ve?m.int_pattern.join("").length-le.int:1/0,Tt=Ve===m.int_pattern.length-1?0:m.int_pattern.join("").length-(le.int+j.num.length);ne.push(C.substring(C.length-Te,C.length-Tt)),Ve++,le.int+=j.num.length}else if(j.type==="frac"){const Te=le.frac;for(let Tt=0;Tt<tt;Tt++)ne.push(L[Tt+Te]||$[j.num[Tt]]);le.frac+=tt}else if(j.type in B)m[j.type+"_pattern"].length===1?(j.type==="int"&&ne.push(C),j.type==="frac"&&ne.push(L),j.type==="man"&&ne.push(y),j.type==="num"&&ne.push(T),j.type==="den"&&ne.push(N)):(ne.push(B[j.type].slice(le[j.type],le[j.type]+tt)),le[j.type]+=tt);else if(j.type==="year")J<0&&ne.push(Oe.negative),ne.push(String(Math.abs(J)).padStart(4,"0"));else if(j.type==="year-short"){const Te=J%100;ne.push(Te<10?"0":"",Te)}else if(j.type==="month")ne.push(j.pad&&ce<10?"0":"",ce);else if(j.type==="monthname-single")m.date_system===6?ne.push(Oe.mmmm6[ce-1].charAt(0)):ne.push(Oe.mmmm[ce-1].charAt(0));else if(j.type==="monthname-short")m.date_system===6?ne.push(Oe.mmm6[ce-1]):ne.push(Oe.mmm[ce-1]);else if(j.type==="monthname")m.date_system===6?ne.push(Oe.mmmm6[ce-1]):ne.push(Oe.mmmm[ce-1]);else if(j.type==="weekday-short")ne.push(Oe.ddd[A]);else if(j.type==="weekday")ne.push(Oe.dddd[A]);else if(j.type==="day")ne.push(j.pad&&V<10?"0":"",V);else if(j.type==="hour"){const Te=H%m.clock||(m.clock<24?m.clock:0);ne.push(j.pad&&Te<10?"0":"",Te)}else if(j.type==="min")ne.push(j.pad&&ie<10?"0":"",ie);else if(j.type==="sec")ne.push(j.pad&&he<10?"0":"",he);else if(j.type==="subsec"){ne.push(Oe.decimal);const Te=Se.toFixed(m.sec_decimals);ne.push(Te.slice(2,2+j.decimals))}else if(j.type==="am"){const Te=H<12?0:1;j.short&&!v?ne.push("AP"[Te]):ne.push(Oe.ampm[Te])}else if(j.type==="hour-elap"){p<0&&ne.push(Oe.negative);const Te=24*q+Math.floor(Math.abs(F)/3600);ne.push(String(Math.abs(Te)).padStart(j.pad,"0"))}else if(j.type==="min-elap"){p<0&&ne.push(Oe.negative);const Te=1440*q+Math.floor(Math.abs(F)/60);ne.push(String(Math.abs(Te)).padStart(j.pad,"0"))}else if(j.type==="sec-elap"){p<0&&ne.push(Oe.negative);const Te=q*ue+Math.abs(F);ne.push(String(Math.abs(Te)).padStart(j.pad,"0"))}else if(j.type==="b-year")ne.push(J+543);else if(j.type==="b-year-short"){const Te=(J+543)%100;ne.push(Te<10?"0":"",Te)}}return _.nbsp?ne.join(""):ne.join("").replace(/\u00a0/g," ")}function ee(p,m){for(let _=0;_<3;_++){const v=m[_];if(v){let y;if(v.condition){const T=v.condition[0],N=v.condition[1];T==="="?y=p===N:T===">"?y=p>N:T==="<"?y=p<N:T===">="?y=p>=N:T==="<="?y=p<=N:T==="<>"&&(y=p!==N)}else y=!0;if(y)return v}}}const pe=Ae("@"),Ce="black",x={};function oe(p,m){if(p){const _=p[0];m[_]=m[_]||{},oe(p.slice(1),m[_])}else m.$=!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(p=>{oe(p,x),oe(p+" x",x),oe(p+" l",x),oe(p+" l x",x),oe("l "+p,x),oe("l "+p+" x",x),oe(p+" D",x),oe(p+" D x",x),oe("D "+p,x),oe("D "+p+" x",x)});const Fe={jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12},Me={january:1,february:2,march:3,april:4,june:6,july:7,august:8,september:9,october:10,november:11,december:12},ve={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"},je=new Date().getUTCFullYear();function Et(p){const m=new RegExp("^([\\s+%"+b.join("")+"(-]*)(((?:(?:\\d[\\d,]*)(?:\\.\\d*)?|(?:\\.\\d+)))([eE][+-]?\\d+)?)([\\s%"+b.join("")+")]*)$").exec(p);if(m){const[,_,v,y,T,N]=m;let L=1,C="",k=!1,q=!1,F=!1,J=!1,ce=!1,V=null,A=!1,H=parseFloat(v.replace(/,/g,""));if(!isFinite(H))return null;for(let he=0;he<_.length;he++){const Se=_[he];if(Se==="-"){if(k||q)return null;k=!0,L=-1}else if(D.test(Se)){if(ce)return null;ce=!0,V=Se}else if(Se==="("){if(q||k)return null;q=!0,L=-1}else if(Se==="%"){if(J)return null;J=!0}}for(let he=0;he<N.length;he++){const Se=N[he];if(D.test(Se)){if(ce)return null;ce=!0,V=Se,A=!0}else if(Se===")"){if(F||!q)return null;F=!0}else if(Se==="%"){if(J)return null;J=!0}}if(T){if(J||ce)return null;C="0.00E+00"}else if(J){if(ce)return null;C=y.includes(".")?"0.00%":"0%",H*=.01}else if(ce){const he=y.includes(".")?"#,##0.00":"#,##0";C=A?he+V:V+he}else y.includes(",")&&(C=y.includes(".")?"#,##0.00":"#,##0");const ie={v:H*L};return C&&(ie.z=C),ie}}const ke=(p,m,_)=>{const v=_.path||"",y=Object.keys(m);for(let T=0;T<y.length;T++){let N;const L=y[T];if(m[L]){if(L==="$"||L==="€")p||(N=_);else if(L==="-"){const C=/^(\s*([./-]|,\s)\s*|\s+)/.exec(p);if(C){const k=C[1]==="-"||C[1]==="/"||C[1]==="."?C[1]:" ";if(!_.sep||_.sep===k){const q=C[0].replace(/\s+/g," ");N=ke(p.slice(C[0].length),m[L],{..._,sep:k,path:v+q})}}}else if(L===" "){const C=/^[,.]?\s+/.exec(p);if(C){const k=C[0].replace(/\s+/g," ");N=ke(p.slice(C[0].length),m[L],{..._,path:v+k})}}else if(L==="j"||L==="d"){const C=/^(0?[1-9]|1\d|2\d|3[01])\b/.exec(p);C&&(N=ke(p.slice(C[0].length),m[L],{..._,day:C[0],path:v+L}))}else if(L==="n"||L==="m"){const C=/^(0?[1-9]|1[012])\b/.exec(p);C&&(N=ke(p.slice(C[0].length),m[L],{..._,month:+C[0],_mon:C[0],path:v+L}))}else if(L==="F"||L==="M"){const C=/^([a-z]{3,9})\b/i.exec(p),k=C&&(L==="F"?Me:Fe)[C[0].toLowerCase()];k&&(N=ke(p.slice(C[0].length),m[L],{..._,month:k,_mon:C[0],path:v+L}))}else if(L==="l"||L==="D"){const C=/^([a-z]{3,9})\b/i.exec(p);(C&&ve[C[0].toLowerCase()])===L&&(N=ke(p.slice(C[0].length),m[L],{..._,path:v+L}))}else if(L==="y"){const C=/^\d\d\b/.exec(p);if(C){const k=+C[0]>=30?+C[0]+1900:+C[0]+2e3;N=ke(p.slice(C[0].length),m[L],{..._,year:k,path:v+L})}}else if(L==="Y"){const C=/^\d\d\d\d\b/.exec(p);C&&(N=ke(p.slice(C[0].length),m[L],{..._,year:+C[0],path:v+L}))}else{if(L!=="x")throw new Error('Unknown date token "'.concat(L,'"'));{const C=xe(p);C&&(N=ke("",m[L],{..._,time:C.v,tf:C.z,path:v+L}))}}if(N)return N}}};function Ge(p,m){const _=ke(p.trim(),x,{path:""});if(_){var v;if(_.sep==="."&&_.path.length===3)return null;const y=+((v=_.year)!==null&&v!==void 0?v:je);if(_.day||(_.day=1),!function(L,C,k){if(k<1||C<1||C>12)return!1;if(C===2){if(k>(L%4==0&&L%100!=0||L%400==0||L===1900?29:28))return!1}else if((C===4||C===6||C===9||C===11)&&k>30||(C===1||C===3||C===5||C===7||C===8||C===10||C===12)&&k>31)return!1;return!0}(y,_.month,_.day))return null;let T=-1/0;if(y<1900)return null;y<=1900&&_.month<=2?T=25568:y<1e4&&(T=25569);const N=Date.UTC(y,_.month-1,_.day)/864e5+T+(_.time||0);if(N>=0&&N<=2958465){const L=_._mon[0]==="0"||_.day[0]==="0"||_._mon.length===2&&_.day.length===2,C=_.path.replace(/[jdlDnmMFyYx-]/g,k=>k==="j"||k==="d"?L?"dd":"d":k==="D"?"ddd":k==="l"?"dddd":k==="n"||k==="m"?L?"mm":"m":k==="M"?"mmm":k==="F"?"mmmm":k==="y"?"yy":k==="x"?_.tf||"":k==="Y"?"yyyy":k);return m&&m.nativeDate?{v:Jr(N,m),z:C}:{v:N,z:C}}}return null}function xe(p){const m=/^\s*([10]?\d|2[0-4])(?::([0-5]\d|\d))?(?::([0-5]\d|\d))?(\.\d{1,10})?(?:\s*([AP])M?)?\s*$/i.exec(p);if(m){const[,_,v,y,T,N]=m;if(T&&!y||!N&&!v&&!y)return null;let L=1*(_||0);if(N){if(L>=13)return null;N[0]!=="p"&&N[0]!=="P"||(L+=12)}return{v:(60*L*60+60*(1*(v||0))+1*(y||0)+1*(T||0))/86400,z:(_.length===2?"hh":"h")+":mm"+(y?":ss":"")+(N?" AM/PM":"")}}return null}function at(p){return/^\s*true\s*$/i.test(p)?{v:!0}:/^\s*false\s*$/i.test(p)?{v:!1}:null}const qe={};function xt(p,m){const{pattern:_,partitions:v,locale:y}=p,T=C=>{const k=Object.assign({},P(),m,C);return y&&(k.locale=y),k},N=(C,k)=>{const q=T(k);return function(F,J,ce){const V=u(ce.locale),A=J[3]?J[3]:pe;if(typeof F=="boolean"&&(F=F?"TRUE":"FALSE"),F==null)return"";if(typeof F!="number")return Q(F,A,ce,V);if(!isFinite(F)){const ie=V||g;return isNaN(F)?ie.nan:(F<0?ie.negative:"")+ie.infinity}const H=ee(F,J);return H?Q(F,H,ce,V):ce.overflow}(vt(C,q),v,q)};N.color=(C,k)=>function(q,F){if(typeof q!="number"||!isFinite(q))return(F[3]?F[3].color:pe.color)||Ce;const J=ee(q,F);return J&&J.color||Ce}(vt(C,T(k)),v);const L=function(C){var k;let q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const[F,J]=C,ce=F.frac_max,V={type:"general",isDate:S(C),isText:U(C),isPercent:Zr(C),maxDecimals:F.general?9:ce,scale:(k=F.scale)!==null&&k!==void 0?k:1,color:0,parentheses:0,grouped:F.grouping?1:0,_partitions:C},A=!V.isDate&&!V.isText&&!F.error&&F.tokens.some(Oe=>Oe.type==="string"&&(q?Oe.value===q:D.test(Oe.value)));let H="G",ie=ce>=0?Math.min(15,ce):"",he="",Se="";if(J&&J.color&&(Se="-",V.color=1),F.parens&&(he="()",V.parentheses=1),A)H="C",V.type="currency";else if(F.error)V.type="error",V.maxDecimals=0;else if(V.isDate){let Oe=0,De=0,ct="";F.tokens.forEach(ne=>{const Ve=ne.type;/^(b-)?year/.test(Ve)?(ct+="Y",De++):Ve.startsWith("month")?(ct+="M",De++):/^(week)?day/.test(Ve)?(ct+="D",De++):Ve!=="hour"&&Ve!=="min"&&Ve!=="sec"&&Ve!=="am"||(ct+=Ve[0],Oe++)}),V.type="date",De&&Oe?V.type="datetime":!De&&Oe&&(V.type="time");const ut=se.find(ne=>ct.startsWith(ne[0]));H=ut?"D":"G",ie=ut?ut[1]:""}else V.isText?(H="G",V.type="text",ie="",V.maxDecimals=0):F.general?(H="G",V.type="general",ie=""):F.fractions?(H="G",V.type="fraction",ie=""):F.exponential?(H="S",V.type="scientific"):V.isPercent?(H="P",V.type="percent"):F.grouping?(H=",",V.type="grouped"):(F.int_max||ce)&&(H="F",V.type="number");return V.code=H+ie+Se+he,V.level=Y[V.type],Object.freeze(V)}(v,(m||{}).currency)||new SyntaxError;return N.info=L,N.dateInfo=function(C){const[k]=C;return{year:!!(2&k.date),month:!!(4&k.date),day:!!(8&k.date),hours:!!(16&k.date),minutes:!!(32&k.date),seconds:!!(64&k.date),clockType:k.clock===12?12:24}}(v),N.isPercent=()=>!!L.isPercent,N.isDate=()=>!!L.isDate,N.isText=()=>!!L.isText,N.pattern=_,p.error&&(N.error=p.error),N.options=T,N.locale=y||m&&m.locale||"",Object.freeze(N)}function be(p,m){p||(p="General");let _=null;return qe[p]?_=qe[p]:(_=Object.assign({},P(),m).throws?Be(p):function(v){try{return Be(v)}catch(y){const T={tokens:[{type:"error"}],error:y.message};return{pattern:v,partitions:[T,T,T,T],error:y.message,locale:null}}}(p),_.error||(qe[p]=_)),xt(_,m)}be.isDate=p=>be(p,{throws:!1}).isDate(),be.isPercent=p=>be(p,{throws:!1}).isPercent(),be.isText=p=>be(p,{throws:!1}).isText(),be.getInfo=(p,m)=>be(p,{...m,throws:!1}).info,be.getDateInfo=(p,m)=>be(p,{...m,throws:!1}).dateInfo,be.dateToSerial=vt,be.dateFromSerial=Jr,be.options=P,be.dec2frac=I,be.round=E,be.codeToLocale=s,be.parseLocale=l,be.getLocale=u,be.addLocale=(p,m)=>{const _=l(m);return delete qe[_.lang],delete qe[_.language],f(p,_)},be.format=function(p,m,_){let v=arguments.length>3&&arguments[3]!==void 0&&arguments[3];const y=_&&typeof _=="object"?_:{locale:_,throws:!v};return be(p,y)(vt(m,y),y)},be.is_date=be.isDate,be.parseNumber=Et,be.parseDate=Ge,be.parseTime=xe,be.parseBool=at,be.parseValue=function(p,m){var _,v,y;return(_=(v=(y=Et(p))!==null&&y!==void 0?y:Ge(p,m))!==null&&v!==void 0?v:xe(p))!==null&&_!==void 0?_:at(p)};var lt=be;return r=r.default}()})})(Za);var n_=Za.exports,r_=n_;const s_=fs(r_);function Wt(e){let n=0;const t=Object.keys(e);for(const r of t){const s=Number(r);n=Math.max(n,s)}return n+1}function Vs(e,n,t){const r=Wt(t),s=t;for(let i=r-1;i>=e;i--)s[i+1]=s[i];s[e]=n}function zs(e,n,t){const r=Object.keys(t).reduce((s,i)=>Math.max(s,Number.parseInt(i)),0)+1;for(let s=e;s<r;s++)s<e+n?delete t[s]:t[s]!==void 0&&(t[s-n]=t[s],delete t[s])}function i_(e,n){const t=e,r=Object.keys(t),s=r.length,i=n,o=Object.keys(i),a=o.length,l={};let c=0;for(let u=0;u<s;u++,c++){const h=r[u];l[c]=t[h]}for(let u=0;u<a;u++,c++){const h=o[u];l[c]=i[h]}return l}function o_(e,n,t){const r=t;if(Wt(t)>0){const i={};let o=0;for(let a=e;a<=n;a++)r[a]&&(i[o]=r[a],o++);return i}return{}}function Gs(e,n,t,r){const s=e>t;if(!s&&e+n>t)throw new Error("Invalid move operation");s?a_(e,n,t,r):l_(e,n,t,r)}function a_(e,n,t,r){const s=r,i=[];for(let o=e;o<e+n;o++)i.push(s[o]);for(let o=e-1;o>=t;o--){const a=s[o];s[o+n]=a,a===void 0&&delete s[o+n]}i.forEach((o,a)=>{s[t+a]=o,o===void 0&&delete s[t+a]})}function l_(e,n,t,r){const s=r,i=[];for(let o=e;o<e+n;o++)i.push(s[o]);for(let o=e+n;o<t;o++){const a=s[o];s[o-n]=a,a===void 0&&delete s[o-n]}i.forEach((o,a)=>{s[t+a-n]=o,o===void 0&&delete s[t+a-n]})}class wt{constructor(n={}){R(this,"_matrix");this._setOriginValue(n)}static MakeObjectMatrixSize(n){return new wt({[n-1]:{}})}getMatrix(){return this._matrix}forEach(n){const t=this._matrix,r=Object.keys(t);for(const s of r){const i=Number(s),o=t[i];if(n(i,o)===!1)return this}return this}forRow(n){const t=this._matrix,r=Object.keys(t);for(const s of r){const i=Number(s),o=t[i];if(n(i,Object.keys(o).map(l=>Number(l)))===!1)return this}return this}forValue(n){const t=this._matrix;for(const r in t){const s=Number(r),i=t[s];if(i)for(const o in i){const a=Number(o),l=i[a];if(n(s,a,l)===!1)return this}}return this}swapRow(n,t){const r=this._matrix[n],s=this._matrix[t];this._matrix[n]=s,this._matrix[t]=r}getRow(n){return this._matrix[n]}getRowOrCreate(n){let t=this.getRow(n);return t==null&&(t={},this._matrix[n]=t),t}reset(){this._setOriginValue({})}hasValue(){const n=this._matrix,t=Object.keys(n);if(t.length===0)return!1;for(const r of t){const s=Number(r),i=n[s];if(Object.keys(i).length>0)return!0}return!1}getValue(n,t){var r,s;return(s=(r=this._matrix)==null?void 0:r[n])==null?void 0:s[t]}setValue(n,t,r){const s=this.getRowOrCreate(n);s[t]=r}deleteValue(n,t){var r,s;(s=(r=this._matrix)==null?void 0:r[n])==null||delete s[t]}realDeleteValue(n,t){var r,s,i;if((s=(r=this._matrix)==null?void 0:r[n])==null||delete s[t],this.getRow(n)){const o=this.getRow(n);if(o==null)return;Object.keys(o).length===0&&((i=this._matrix)==null||delete i[n])}}setRow(n,t){this._matrix[n]=t}moveRows(n,t,r){Gs(n,t,r,this._matrix)}moveColumns(n,t,r){this.forEach((s,i)=>{Gs(n,t,r,i)})}insertRows(n,t){for(let r=n;r<n+t;r++)Vs(r,{},this._matrix)}insertColumns(n,t){for(let r=n;r<n+t;r++)this.forEach((s,i)=>{i&&Vs(r,void 0,i)})}removeRows(n,t){zs(n,t,this._matrix)}removeColumns(n,t){this.forEach((r,s)=>{s&&zs(n,t,s)})}getFragment(n,t,r,s){const i=new wt;let o=0;for(let a=n;a<=t;a++){const l={};let c=0;for(let u=r;u<=s;u++){const h=this.getValue(a,u);l[c]=h,c++}i.setRow(o,l),o++}return i}getSlice(n,t,r,s){const i=new wt;for(let o=n;o<=t;o++)for(let a=r;a<=s;a++){const l=this.getValue(o,a);l&&i.setValue(o,a,W.deepClone(l))}return i}getSizeOf(){return Object.keys(this._matrix).length}getLength(){return Wt(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=Wt(a)-1;s=l>s?l:s}}return{startRow:0,startColumn:0,endRow:r,endColumn:s}}toNativeArray(){const n=new Array;return this.forValue((t,r,s)=>{n.push(s)}),n}toArray(){const n=[];return this.forRow((t,r)=>{n[t]==null&&(n[t]=[]),r.forEach(s=>{n[t][s]=this.getValue(t,s)})}),n}toFullArray(){const n=this.getRange(),{endColumn:t,endRow:r}=n,s=[];for(let i=0;i<=r;i++){const o=new Array(t+1).fill(void 0);s.push(o)}return this.forValue((i,o,a)=>{s[i][o]=a}),s}toJSON(){return this._matrix}clone(){const n=JSON.stringify(this._matrix);return JSON.parse(n)}getData(){const n=JSON.stringify(this._matrix);return JSON.parse(n)}getArrayData(){let n=0,t=0,r=!1,s=!1;const i=new wt;return this.forEach((o,a)=>{r||(r=!0,n=o),Object.keys(a).forEach(l=>{const c=Number(l);s?c<t&&(t=c):(s=!0,t=c);const u=this.getValue(o,c);i.setValue(o-n,c-t,u)})}),i.getData()}getStartEndScope(){let n=1/0,t=-1/0,r=1/0,s=-1/0;const i=Object.keys(this._matrix);i.length>0&&(n=+i[0],t=+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:n,endRow:t,startColumn:r,endColumn:s}}getDataRange(){let n=0,t=0,r=0,s=-1,i=!1,o=!1;return this.forEach((a,l)=>{if(i||(i=!0,n=a),l==null)return;const c=Wt(l)-1;c>r&&(r=c),Object.keys(l).forEach(u=>{const h=Number(u);o?h<t&&(t=h):(o=!0,t=h)}),a>s&&(s=a)}),{startRow:n,startColumn:t,endRow:s,endColumn:r}}getDiscreteRanges(){const n=[];return this.forEach((t,r)=>{Object.keys(r).forEach(s=>{const i=Number(s);let o=!1;for(const a of n)if(t>=a.startRow&&t<=a.endRow+1&&i>=a.startColumn&&i<=a.endColumn+1){a.endRow=Math.max(t,a.endRow),a.endColumn=Math.max(i,a.endColumn),o=!0;break}o||n.push({startRow:t,endRow:t,startColumn:i,endColumn:i})})}),n}merge(n){this.forValue((t,r)=>{const s=n.getValue(t,r);s!=null&&this.setValue(t,r,s)})}_setOriginValue(n={}){this._matrix=n}}const c_={sheetId:"",range:{startRow:-1,endRow:-1,startColumn:-1,endColumn:-1}},u_={startRow:-1,startColumn:-1,endRow:-1,endColumn:-1},h_={startRow:0,startColumn:0,endRow:0,endColumn:0},d_={row:0,column:0},et={ff:"Arial",fs:11,it:Re.FALSE,bl:Re.FALSE,ul:{s:Re.FALSE},st:{s:Re.FALSE},ol:{s:Re.FALSE},tr:{a:0,v:Re.FALSE},td:Vn.UNSPECIFIED,cl:{rgb:"#000"},bg:{rgb:"#fff"},ht:Bt.UNSPECIFIED,vt:Zt.UNSPECIFIED,tb:qt.UNSPECIFIED,pd:{t:0,r:0,b:0,l:0},n:null},qa={id:"default_slide",title:"defaultSlide",pageSize:{width:300,height:300}},f_=[ps,Oo,Es];var el=(e=>(e.ARRAY_CONVERTOR="ARRAY_CONVERTOR",e.MATRIX_CONVERTOR="MATRIX_CONVERTOR",e))(el||{});function Fr(e,n){const{textRuns:t=[]}=n;let r=0;for(const i of t){const{ts:o={},st:a,ed:l}=i;if(o[e]==null)return Re.FALSE;switch(e){case"bl":case"it":{if(o[e]===Re.FALSE)return Re.FALSE;break}case"ul":case"st":{if(o[e].s===Re.FALSE)return Re.FALSE;break}default:throw new Error(`unknown style key: ${e} in IStyleBase`)}r+=l-a}return n.dataStream.indexOf(`\r
7
- `)===r?Re.TRUE:Re.FALSE}const cr=class cr{constructor(n,t,r){R(this,"_range");R(this,"_worksheet");this._deps=r,this._range=t,this._worksheet=n}static foreach(n,t){const{startRow:r,startColumn:s,endRow:i,endColumn:o}=n;for(let a=r;a<=i;a++)for(let l=s;l<=o;l++)t(a,l)}getRangeData(){return this._range}getValue(){return this.getValues()[0][0]}getValues(){const{startRow:n,endRow:t,startColumn:r,endColumn:s}=this._range,i=[];for(let o=n;o<=t;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:n,endRow:t,startColumn:r,endColumn:s}=this._range,i=this._worksheet.getCellMatrix(),o=new wt;for(let a=n;a<=t;a++)for(let l=r;l<=s;l++)o.setValue(a,l,i.getValue(a,l)||null);return o}getMatrixObject(){const{startRow:n,endRow:t,startColumn:r,endColumn:s}=this._range,i=this._worksheet.getCellMatrix(),o=new wt;for(let a=n;a<=t;a++)for(let l=r;l<=s;l++)o.setValue(a-n,l-r,i.getValue(a,l)||{});return o}getA1Notation(){const{startRow:n,endRow:t,startColumn:r,endColumn:s}=this._range;let i,o;return r<s?(i=W.numToWord(r+1)+(n+1),o=W.numToWord(s+1)+(t+1)):(i=W.numToWord(s+1)+(t+1),o=W.numToWord(r+1)+(n+1)),i===o?`${i}`:`${i}:${o}`}getBackground(){return this.getBackgrounds()[0][0]}getBackgrounds(){const n=this._deps.getStyles();return this.getValues().map(t=>t.map(r=>{var i;const s=n.getStyleByCell(r);return((i=s==null?void 0:s.bg)==null?void 0:i.rgb)||et.bg.rgb}))}getCell(n,t){const{startRow:r,startColumn:s}=this._range,i={startRow:r+n,endRow:r+n,startColumn:s+t,endColumn:s+t};return new cr(this._worksheet,i,this._deps)}getColumn(){return this._range.startColumn}getObjectValue(n={}){return this.getObjectValues(n)[0][0]}getObjectValues(n={}){var a;const{startRow:t,endRow:r,startColumn:s,endColumn:i}=this._range,o=this._worksheet.getCellMatrix().getFragment(t,r,s,i).getData();if(n.isIncludeStyle){const l=this._deps.getStyles();for(let c=0;c<=r-t;c++)for(let u=0;u<=i-s;u++){if(o==null||((a=o==null?void 0:o[c])==null?void 0:a[u])==null)continue;const h=o[c][u].s;h&&(o[c][u].s=l.get(h))}}return o}getFontColor(){return this.getFontColors()[0][0]}getFontColors(){const n=this._deps.getStyles();return this.getValues().map(t=>t.map(r=>{var i;const s=n.getStyleByCell(r);return((i=s==null?void 0:s.cl)==null?void 0:i.rgb)||et.cl.rgb}))}getFontFamilies(){return this._getStyles("ff")}getFontFamily(){return this.getFontFamilies()[0][0]}getUnderlines(){return this._getStyles("ul")}getUnderline(){var t,r;const{p:n}=(t=this.getValue())!=null?t:{};return n&&Array.isArray((r=n.body)==null?void 0:r.textRuns)&&n.body.textRuns.length>0?Fr("ul",n.body)===Re.TRUE?{s:Re.TRUE}:{s:Re.FALSE}:this.getUnderlines()[0][0]}getOverlines(){return this._getStyles("ol")}getOverline(){return this.getOverlines()[0][0]}getStrikeThrough(){var t,r;const{p:n}=(t=this.getValue())!=null?t:{};return n&&Array.isArray((r=n.body)==null?void 0:r.textRuns)&&n.body.textRuns.length>0?Fr("st",n.body)===Re.TRUE?{s:Re.TRUE}:{s:Re.FALSE}:this.getStrikeThroughs()[0][0]}getStrikeThroughs(){return this._getStyles("st")}getFontSize(){var t,r;const n=((t=this.getValue())==null?void 0:t.p)||{};return n&&Array.isArray((r=n.body)==null?void 0:r.textRuns)&&n.body.textRuns.length>0?n.body.textRuns.some(s=>{var i;return((i=s==null?void 0:s.ts)==null?void 0:i.fs)!=null})?Math.max(...n.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 t,r;const{p:n}=(t=this.getValue())!=null?t:{};return n&&Array.isArray((r=n.body)==null?void 0:r.textRuns)&&n.body.textRuns.length>0?Fr("it",n.body)===Re.TRUE?br.ITALIC:br.NORMAL:this._getFontStyles()[0][0]}_getFontStyles(){return this._getStyles("it")}getFontWeight(){var t,r;const{p:n}=(t=this.getValue())!=null?t:{};return n&&Array.isArray((r=n.body)==null?void 0:r.textRuns)&&n.body.textRuns.length>0?Fr("bl",n.body)===Re.TRUE?yr.BOLD:yr.NORMAL:this._getFontWeights()[0][0]}_getFontWeights(){return this._getStyles("bl")}getGridId(){return this._worksheet.getSheetId()}getHeight(){const{_range:n,_worksheet:t}=this,{startRow:r,endRow:s}=n;let i=0;for(let o=0;o<=s-r;o++){const a=t.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:n,endColumn:t}=this._range;return t-n+1}getNumRows(){const{startRow:n,endRow:t}=this._range;return t-n+1}getRichTextValue(){return this.getRichTextValues()[0][0]}getRichTextValues(){return this.getValues().map(n=>n.map(t=>(t==null?void 0:t.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 n=this._deps.getStyles();return this.getValues().map(t=>t.map(r=>n.getStyleByCell(r)))}getVerticalAlignment(){return this.getVerticalAlignments()[0][0]}getVerticalAlignments(){return this._getStyles("vt")}getWidth(){const{_range:n,_worksheet:t}=this,{startColumn:r,endColumn:s}=n;let i=0;for(let o=0;o<=s-r;o++)i+=t.getColumnWidth(o);return i}getWrap(){return this.getWrapStrategy()===qt.WRAP?Re.TRUE:Re.FALSE}getWrapStrategies(){return this._getStyles("tb")}getWrapStrategy(){return this.getWrapStrategies()[0][0]}forEach(n){cr.foreach(this._range,n)}_getStyles(n){const t=this._deps.getStyles();return this.getValues().map(r=>r.map(s=>{const i=t&&t.getStyleByCell(s);return i&&i[n]||et[n]}))}};R(cr,"transformRange",(n,t)=>{const r=t.getMaxColumns()-1,s=t.getMaxRows()-1;return n.rangeType===me.ALL?{startColumn:0,startRow:0,endColumn:r,endRow:s}:n.rangeType===me.COLUMN?{startRow:0,endRow:s,startColumn:n.startColumn,endColumn:n.endColumn}:n.rangeType===me.ROW?{startColumn:0,endColumn:r,startRow:n.startRow,endRow:n.endRow}:{startColumn:n.startColumn,endColumn:Math.min(n.endColumn,r),startRow:n.startRow,endRow:Math.min(n.endRow,s)}});let _n=cr;function g_(e,n,t,r=!1){if(n===0&&t===0)return e;let s={...e};const i=s.startAbsoluteRefType||ze.NONE,o=s.endAbsoluteRefType||ze.NONE,a=s.rangeType||me.NORMAL;if(!r&&i===ze.ALL&&o===ze.ALL)return s;const l=tl(s.startRow,t,s.startColumn,n,a),c=tl(s.endRow,t,s.endColumn,n,a);return r||i===ze.NONE&&o===ze.NONE?s={...s,startRow:l.row,startColumn:l.column,endRow:c.row,endColumn:c.column}:(i===ze.NONE?s={...s,startRow:l.row,startColumn:l.column}:i===ze.COLUMN?s={...s,startRow:l.row}:i===ze.ROW&&(s={...s,startColumn:l.column}),o===ze.NONE?s={...s,endRow:c.row,endColumn:c.column}:o===ze.COLUMN?s={...s,endRow:c.row}:o===ze.ROW&&(s={...s,endColumn:c.column}),s)}function tl(e,n,t,r,s){return s===me.NORMAL?{row:e+n,column:t+r}:s===me.ROW?{row:e+n,column:t}:s===me.COLUMN?{row:e,column:t+r}:{row:e,column:t}}function nl(e){const n=new Set,t=new Set;for(const o of e)n.add(o.startColumn),n.add(o.endColumn+1),t.add(o.startRow),t.add(o.endRow+1);const r=Array.from(n).sort((o,a)=>o-a),s=Array.from(t).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,u=s[o],h=s[o+1]-1;for(const f of e){if(f.startRow>h)break;if(f.startRow<=u&&f.endRow>=h&&f.startColumn<=l&&f.endColumn>=c){i.push({startColumn:l,endColumn:c,startRow:u,endRow:h});break}}}return i}function m_(e){e.sort((r,s)=>r.startRow-s.startRow||r.startColumn-s.startColumn);const n={};for(const r of e)n[r.startRow]||(n[r.startRow]=[]),n[r.startRow].push(r);const t=[];for(const r in n){const s=n[+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):(t.push(i),i=a)}t.push(i)}return t}function __(e){e.sort((r,s)=>r.startColumn-s.startColumn||r.startRow-s.startRow);const n={};for(const r of e)n[r.startColumn]||(n[r.startColumn]=[]),n[r.startColumn].push(r);const t=[];for(const r in n){const s=n[+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):(t.push(i),i=a)}t.push(i)}return t}function p_(e){const n=nl(e),t=m_(n);return __(t)}function E_(e,n){const t=[];return e.forEach(r=>{t.push(...Vt.subtract(r,n))}),Vt.mergeRanges(t)}function C_(e,n){const t=rl(e.startRow,e.endRow,n.startRow,n.endRow),r=rl(e.startColumn,e.endColumn,n.startColumn,n.endColumn);if(!t||!r)return null;const[s,i]=t,[o,a]=r,l=R_(e.rangeType,n.rangeType,s,i,o,a);return{startRow:s,endRow:i,startColumn:o,endColumn:a,rangeType:l}}function rl(e,n,t,r){const s=isNaN(e)?-1/0:e,i=isNaN(n)?1/0:n,o=isNaN(t)?-1/0:t,a=isNaN(r)?1/0:r,l=Math.max(s,o),c=Math.min(i,a);if(l<=c){const u=l===-1/0?Number.NaN:l,h=c===1/0?Number.NaN:c;return[u,h]}else return null}function R_(e,n,t,r,s,i){const o=e!==void 0?e:sl(t,r,s,i),a=n!==void 0?n:sl(t,r,s,i);return o===me.ALL||a===me.ALL?o===a?o:o===me.ALL?a:o:o===a?o:(o===me.NORMAL||a===me.NORMAL,me.NORMAL)}function sl(e,n,t,r){const s=!isNaN(e)&&!isNaN(n),i=!isNaN(t)&&!isNaN(r);return s&&i?me.NORMAL:s?me.ROW:i?me.COLUMN:me.ALL}const kt=class kt{static clone(n){return n.rangeType!==void 0?{startRow:n.startRow,startColumn:n.startColumn,endRow:n.endRow,endColumn:n.endColumn,rangeType:n.rangeType}:{startRow:n.startRow,startColumn:n.startColumn,endRow:n.endRow,endColumn:n.endColumn}}static equals(n,t){return n==null||t==null?!1:n.endRow===t.endRow&&n.endColumn===t.endColumn&&n.startRow===t.startRow&&n.startColumn===t.startColumn&&(n.rangeType===t.rangeType||n.rangeType===void 0&&t.rangeType===me.NORMAL||t.rangeType===void 0&&n.rangeType===me.NORMAL)}static simpleRangesIntersect(n,t){const{startRow:r,endRow:s,startColumn:i,endColumn:o}=n,{startRow:a,endRow:l,startColumn:c,endColumn:u}=t,h=r<=l&&s>=a,f=i<=u&&o>=c;return h&&f}static intersects(n,t){if(n.rangeType===me.ROW&&t.rangeType===me.COLUMN||n.rangeType===me.COLUMN&&t.rangeType===me.ROW)return!0;if(n.rangeType===me.ROW&&t.rangeType===me.ROW)return n.startRow<=t.endRow&&n.endRow>=t.startRow;if(n.rangeType===me.COLUMN&&t.rangeType===me.COLUMN)return n.startColumn<=t.endColumn&&n.endColumn>=t.startColumn;const r=Math.floor(Number.MAX_SAFE_INTEGER/10),s=Number.isNaN(n.startRow)?0:n.startRow,i=Number.isNaN(n.endRow)?r:n.endRow,o=Number.isNaN(n.startColumn)?0:n.startColumn,a=Number.isNaN(n.endColumn)?r:n.endColumn,l=Number.isNaN(t.startRow)?0:t.startRow,c=Number.isNaN(t.endRow)?r:t.endRow,u=Number.isNaN(t.startColumn)?0:t.startColumn,h=Number.isNaN(t.endColumn)?r:t.endColumn,f=Math.abs(o+a-u-h),g=Math.abs(o-a)+Math.abs(u-h),E=Math.abs(s+i-l-c),I=Math.abs(s-i)+Math.abs(l-c);return f<=g&&E<=I}static getIntersects(n,t){const r=n.startRow,s=n.endRow,i=n.startColumn,o=n.endColumn,a=t.startRow,l=t.endRow,c=t.startColumn,u=t.endColumn;let h,f,g,E;if(a<=s)a>=r?f=a:f=r;else return null;if(l>=r)l>=s?E=s:E=l;else return null;if(c<=o)c>i?h=c:h=i;else return null;if(u>=i)u>=o?g=o:g=u;else return null;return{startRow:f,endRow:E,startColumn:h,endColumn:g,rangeType:me.NORMAL}}static contains(n,t){return n.startRow<=t.startRow&&n.endRow>=t.endRow&&n.startColumn<=t.startColumn&&n.endColumn>=t.endColumn}static realContain(n,t){return kt.contains(n,t)&&(n.startRow<t.startRow||n.endRow>t.endRow||n.startColumn<t.startColumn||n.endColumn>t.endColumn)}static union(...n){return n.reduce((t,r)=>({startRow:Math.min(t.startRow,r.startRow),startColumn:Math.min(t.startColumn,r.startColumn),endRow:Math.max(t.endRow,r.endRow),endColumn:Math.max(t.endColumn,r.endColumn),rangeType:me.NORMAL}),n[0])}static realUnion(...n){const t=n.some(i=>i.rangeType===me.COLUMN),r=n.some(i=>i.rangeType===me.ROW),s=kt.union(...n);return{startColumn:r?Number.NaN:s.startColumn,endColumn:r?Number.NaN:s.endColumn,startRow:t?Number.NaN:s.startRow,endRow:t?Number.NaN:s.endRow,rangeType:r?me.ROW:t?me.COLUMN:me.NORMAL}}static subtract(n,t){if(t.startRow>n.endRow||t.endRow<n.startRow||t.startColumn>n.endColumn||t.endColumn<n.startColumn)return[n];const r=[];t.startRow>=n.startRow&&r.push({startRow:n.startRow,startColumn:n.startColumn,endRow:t.startRow-1,endColumn:n.endColumn}),t.endRow<=n.endRow&&r.push({startRow:t.endRow+1,startColumn:n.startColumn,endRow:n.endRow,endColumn:n.endColumn});const s=Math.max(n.startRow,t.startRow),i=Math.min(n.endRow,t.endRow);return t.startColumn>=n.startColumn&&r.push({startRow:s,startColumn:n.startColumn,endRow:i,endColumn:t.startColumn-1}),t.endColumn<=n.endColumn&&r.push({startRow:s,startColumn:t.endColumn+1,endRow:i,endColumn:n.endColumn}),r.filter(a=>a.startRow<=a.endRow&&a.startColumn<=a.endColumn)}static mergeRanges(n){return p_(n)}static subtractMulti(n,t){if(!t.length)return n;let r=n;return t.forEach(s=>{r=E_(r,s)}),r}static hasIntersectionBetweenTwoRect(n,t){return!(n.left>t.right||n.right<t.left||n.top>t.bottom||n.bottom<t.top)}static getIntersectionBetweenTwoRect(n,t){const r=Math.max(n.left,t.left),s=Math.min(n.right,t.right),i=Math.max(n.top,t.top),o=Math.min(n.bottom,t.bottom);return s<=r||o<=i?null:{left:r,right:s,top:i,bottom:o,width:s-r,height:o-i}}static sort(n){return n.sort((t,r)=>t.startRow-r.startRow||t.startColumn-r.startColumn)}};R(kt,"getRelativeRange",(n,t)=>({startRow:n.startRow-t.startRow,endRow:n.endRow-n.startRow,startColumn:n.startColumn-t.startColumn,endColumn:n.endColumn-n.startColumn})),R(kt,"getPositionRange",(n,t,r)=>({...r||{},startRow:r&&[ze.ROW,ze.ALL].includes(r.startAbsoluteRefType||0)?r.startRow:n.startRow+t.startRow,endRow:r&&[ze.ROW,ze.ALL].includes(r.endAbsoluteRefType||0)?r.endRow:n.endRow+n.startRow+t.startRow,startColumn:r&&[ze.COLUMN,ze.ALL].includes(r.startAbsoluteRefType||0)?r.startColumn:n.startColumn+t.startColumn,endColumn:r&&[ze.COLUMN,ze.ALL].includes(r.endAbsoluteRefType||0)?r.endColumn:n.endColumn+n.startColumn+t.startColumn})),R(kt,"moveHorizontal",(n,t=0,r=0)=>({...n,startColumn:n.startColumn+t,endColumn:n.endColumn+t+r})),R(kt,"moveVertical",(n,t=0,r=0)=>({...n,startRow:n.startRow+t,endRow:n.endRow+t+r})),R(kt,"moveOffset",(n,t,r)=>({...n,startRow:n.startRow+r,endRow:n.endRow+r,startColumn:n.startColumn+t,endColumn:n.endColumn+t}));let Vt=kt;function I_(e,n){if(e.length===0||e[0].length===0)return null;const t=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++)t[a]=n(e[i][a])?t[a]+1:0;const o=v_(t);o.area>r&&(r=o.area,s={startColumn:o.start,startRow:i-o.height+1,endColumn:o.end,endRow:i})}return s}function v_(e){const n=[];let t=0,r={area:0,height:0,start:0,end:0},s=0;for(;s<e.length;)if(n.length===0||e[s]>=e[n[n.length-1]])n.push(s++);else{const i=e[n.pop()],o=n.length===0?s:s-n[n.length-1]-1;i*o>t&&(t=i*o,r={area:t,height:i,start:n.length===0?0:n[n.length-1]+1,end:s-1})}for(;n.length>0;){const i=e[n.pop()],o=n.length===0?s:s-n[n.length-1]-1;i*o>t&&(t=i*o,r={area:t,height:i,start:n.length===0?0:n[n.length-1]+1,end:s-1})}return r}function S_(e,n){_n.foreach(n,(t,r)=>{e[t][r]=void 0})}function O_(e,n){const t=e.toFullArray(),r=[];for(;;){const s=I_(t,n);if(!s)break;r.push(s),S_(t,s)}return r}class b_{constructor(n,t){R(this,"_values",[]);R(this,"_keys",[]);R(this,"_keyMaps",new Map);this._values=n,this._keys=t,n.forEach(r=>{this._initKeyMap(r)})}_initKeyMap(n){this._keys.forEach(t=>{const r=n[t],s=this._keyMaps.get(t)||new Map;s.set(r,n),this._keyMaps.set(t,s)})}getValue(n,t){const r=t||this._keys;for(let s=0;s<r.length;s++){const i=this._keyMaps.get(r[s]);if(i!=null&&i.has(n))return i.get(n)}return null}hasValue(n){for(let t=0;t<this._keys.length;t++){const r=this._keyMaps.get(this._keys[t]);if(r!=null&&r.has(n))return!0}return!1}addValue(n){this._values.push(n),this._initKeyMap(n)}setValue(n,t,r){const s=this.getValue(n);s&&Object.keys(s).includes(t)&&(s[t]=r)}deleteValue(n,t){const r=this.getValue(n,t);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(n){var t;return[...((t=this._keyMaps.get(n))==null?void 0:t.keys())||[]]}clear(){this._values=[],this._keys=[],this._keyMaps.clear()}}function Ks(e,n,t,r){return{forEach(s){for(let i=e;i<=n;i++)for(let o=t;o<=r;o++)s(i,o)}}}function y_(e){if(e==null||e.length===0)return Number.NaN;const n=e.toLowerCase().split(""),t=n.length,r=o=>o.charCodeAt(0)-96;let s=0,i=0;for(let o=0;o<t;o++)i=r(n[o]),s+=i*26**(t-o-1);return s===0?Number.NaN:s-1}const kr=65,il=90,w_=97;function A_(e){const n=il-kr+1;let t="";for(;e>=0;)t=String.fromCharCode(e%n+kr)+t,e=Math.floor(e/n)-1;return t}function ol(e,n){let t="";for(;n>0;)t+=e,n--;return t}function N_(e,n=!1){const t=il-kr+1;let r=w_;n&&(r=kr);const s=String.fromCharCode(e%t+r),i=Math.floor(e/t)+1;return ol(s,i)}function T_(e,n){return e.zIndex>n.zIndex?1:e.zIndex===n.zIndex?0:-1}function M_(e,n){return e.zIndex>n.zIndex?-1:e.zIndex===n.zIndex?0:1}function Gn(e="index",n=1){return(t,r)=>t[e]>r[e]?n:t[e]===r[e]?0:-n}var we=(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))(we||{}),At=(e=>(e[e.Reader=0]="Reader",e[e.Editor=1]="Editor",e[e.Owner=2]="Owner",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(At||{}),Ys=(e=>(e[e.SomeCollaborator=0]="SomeCollaborator",e[e.AllCollaborator=1]="AllCollaborator",e[e.OneSelf=2]="OneSelf",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(Ys||{});class xr extends Ke{}function L_(e=W.generateRandomId(6),n=Wn.EN_US,t=""){return{id:e,locale:n,title:t,body:{dataStream:`\r
8
- `,textRuns:[],paragraphs:[{startIndex:0,paragraphStyle:{spaceAbove:{v:5},lineSpacing:1,spaceBelow:{v:0}}}],sectionBreaks:[{startIndex:1}]},documentStyle:{pageSize:{width:793.3333333333334,height:1122.6666666666667},marginTop:50,marginBottom:50,marginRight:40,marginLeft:40,renderConfig:{vertexAngle:0,centerAngle:0}},settings:{}}}var it={},al={},Xs={};Object.defineProperty(Xs,"__esModule",{value:!0});function D_(e,n){if(Array.isArray(n))return!1;for(let t in e)if(!Qs(e[t],n[t]))return!1;for(let t in n)if(e[t]===void 0)return!1;return!0}function U_(e,n){if(!Array.isArray(n)||e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(!Qs(e[t],n[t]))return!1;return!0}function Qs(e,n){return e===n?!0:e===null||n===null||typeof e!="object"||typeof n!="object"?!1:Array.isArray(e)?U_(e,n):D_(e,n)}Xs.default=Qs;var Js={};Object.defineProperty(Js,"__esModule",{value:!0});function Zs(e){if(e===null)return null;if(Array.isArray(e))return e.map(Zs);if(typeof e=="object"){const n={};for(let t in e)n[t]=Zs(e[t]);return n}else return e}Js.default=Zs;var qs={};(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 n(u,h){if(!u)throw new Error(h)}const t=u=>u!=null&&typeof u=="object"&&!Array.isArray(u),r=(u,h)=>typeof u==typeof h?u>h:typeof u=="string"&&typeof h=="number";function s(u,h){for(let f in u){const g=f;h.write(g,u[g])}}e.isValidPathItem=u=>typeof u=="number"||typeof u=="string"&&u!=="__proto__";class i{constructor(h=null){this.parents=[],this.indexes=[],this.lcIdx=-1,this.idx=-1,this.container=h}ascend(){n(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):(n(this.idx>0),this.idx--,t(this.container[this.idx])&&this.idx--)}getPath(){const h=[];let f=this.container,g=this.parents.length-1,E=this.idx;for(;E>=0;)h.unshift(f[E]),E===0?(E=this.indexes[g*2],f=this.parents[g--]):E-=t(f[E-1])?2:1;return h}}class o extends i{get(){return this.container?this.container.slice(this.idx+1):null}getKey(){return n(this.container!=null,"Invalid call to getKey before cursor descended"),this.container[this.idx]}getComponent(){let h;return this.container&&this.container.length>this.idx+1&&t(h=this.container[this.idx+1])?h:null}descendFirst(){let h=this.idx+1;if(!this.container||h>=this.container.length||t(this.container[h])&&h+1>=this.container.length)return!1;t(this.container[h])&&h++;const f=this.container[h];return Array.isArray(f)?(this.indexes.push(this.idx),this.parents.push(this.container),this.indexes.push(h),this.idx=0,this.container=f):this.idx=h,!0}nextSibling(){if(n(this.parents.length===this.indexes.length/2),this.idx>0||this.parents.length===0)return!1;const h=this.indexes[this.indexes.length-1]+1,f=this.parents[this.parents.length-1];return h>=f.length?!1:(n(!isNaN(h)),this.indexes[this.indexes.length-1]=h,this.container=f[h],!0)}_init(h,f,g,E){this.container=h,this.idx=f,this.parents=g.slice(),this.indexes=E.slice()}clone(){const h=new o;return h._init(this.container,this.idx,this.parents,this.indexes),h}*[Symbol.iterator](){if(this.descendFirst()){do yield this.getKey();while(this.nextSibling());this.ascend()}}traverse(h,f){const g=this.getComponent();g&&f(g,h);for(const E of this)h&&h.descend(E),this.traverse(h,f),h&&h.ascend()}eachPick(h,f){this.traverse(h,(g,E)=>{g.p!=null&&f(g.p,E)})}eachDrop(h,f){this.traverse(h,(g,E)=>{g.d!=null&&f(g.d,E)})}}e.ReadCursor=o;class a extends i{constructor(h=null){super(h),this.pendingDescent=[],this._op=h}flushDescent(){n(this.parents.length===this.indexes.length/2),this.container===null&&(this._op=this.container=[]);for(let h=0;h<this.pendingDescent.length;h++){const f=this.pendingDescent[h];let g=this.idx+1;if(g<this.container.length&&t(this.container[g])&&g++,n(g===this.container.length||!t(this.container[g])),g===this.container.length)this.container.push(f),this.idx=g;else if(this.container[g]===f)this.idx=g;else{if(!Array.isArray(this.container[g])){const E=this.container.splice(g,this.container.length-g);this.container.push(E),this.lcIdx>-1&&(this.lcIdx=g)}for(this.indexes.push(this.idx),this.parents.push(this.container),this.lcIdx!==-1&&(n(r(f,this.container[this.lcIdx][0])),g=this.lcIdx+1,this.lcIdx=-1);g<this.container.length&&r(f,this.container[g][0]);)g++;if(this.indexes.push(g),this.idx=0,g<this.container.length&&this.container[g][0]===f)this.container=this.container[g];else{const E=[f];this.container.splice(g,0,E),this.container=E}}}this.pendingDescent.length=0}reset(){this.lcIdx=-1}getComponent(){this.flushDescent();const h=this.idx+1;if(h<this.container.length&&t(this.container[h]))return this.container[h];{const f={};return this.container.splice(h,0,f),f}}write(h,f){const g=this.getComponent();n(g[h]==null||g[h]===f,"Internal consistency error: Overwritten component. File a bug"),g[h]=f}get(){return this._op}descend(h){if(!e.isValidPathItem(h))throw Error("Invalid JSON key");this.pendingDescent.push(h)}descendPath(h){return this.pendingDescent.push(...h),this}ascend(){this.pendingDescent.length?this.pendingDescent.pop():super.ascend()}mergeTree(h,f=s){if(h===null)return;if(n(Array.isArray(h)),h===this._op)throw Error("Cannot merge into my own tree");const g=this.lcIdx,E=this.parents.length;let I=0;for(let M=0;M<h.length;M++){const O=h[M];typeof O=="string"||typeof O=="number"?(I++,this.descend(O)):Array.isArray(O)?this.mergeTree(O,f):typeof O=="object"&&f(O,this)}for(;I--;)this.ascend();this.lcIdx=this.parents.length===E?g:-1}at(h,f){this.descendPath(h),f(this);for(let g=0;g<h.length;g++)this.ascend();return this}writeAtPath(h,f,g){return this.at(h,()=>this.write(f,g)),this.reset(),this}writeMove(h,f,g=0){return this.writeAtPath(h,"p",g).writeAtPath(f,"d",g)}getPath(){const h=super.getPath();return h.push(...this.pendingDescent),h}}e.WriteCursor=a,e.writeCursor=()=>new a,e.readCursor=u=>new o(u);function l(u,h,f){let g,E;E=g=u?u.descendFirst():!1;function I(M){let O;for(;E;){const P=O=u.getKey();if(M!=null){let $=!1;if(h&&typeof P=="number"&&(O=h(P,u.getComponent()),O<0&&(O=~O,$=!0)),r(O,M))return null;if(O===M&&!$)return u}f&&typeof O=="number"&&f(O,u.getComponent()),E=u.nextSibling()}return null}return I.end=()=>{g&&u.ascend()},I}e.advancer=l;function c(u,h,f){let g,E,I,M;for(g=E=u&&u.descendFirst(),I=M=h&&h.descendFirst();g||I;){let O=g?u.getKey():null,P=I?h.getKey():null;O!==null&&P!==null&&(r(P,O)?P=null:O!==P&&(O=null)),f(O==null?P:O,O!=null?u:null,P!=null?h:null),O!=null&&g&&(g=u.nextSibling()),P!=null&&I&&(I=h.nextSibling())}E&&u.ascend(),M&&h.ascend()}e.eachChildOf=c})(qs);var ei={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConflictType=void 0,function(n){n[n.RM_UNEXPECTED_CONTENT=1]="RM_UNEXPECTED_CONTENT",n[n.DROP_COLLISION=2]="DROP_COLLISION",n[n.BLACKHOLE=3]="BLACKHOLE"}(e.ConflictType||(e.ConflictType={}))})(ei);var ti={},nn={},ll;function ni(){return ll||(ll=1,Object.defineProperty(nn,"__esModule",{value:!0}),nn.uniToStrPos=nn.strPosToUni=void 0,nn.strPosToUni=(e,n=e.length)=>{let t=0,r=0;for(;r<n;r++){const s=e.charCodeAt(r);s>=55296&&s<=57343&&(t++,r++)}if(r!==n)throw Error("Invalid offset - splits unicode bytes");return r-t},nn.uniToStrPos=(e,n)=>{let t=0;for(;n>0;n--){const r=e.charCodeAt(t);t+=r>=55296&&r<=57343?2:1}return t}),nn}var ri={},cl;function si(){return cl||(cl=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.uniSlice=e.dlen=e.eachOp=void 0;const n=ni(),t=w=>{if(!Array.isArray(w))throw Error("Op must be an array of components");let b=null;for(let D=0;D<w.length;D++){const G=w[D];switch(typeof G){case"object":if(typeof G.d!="number"&&typeof G.d!="string")throw Error("Delete must be number or string");if(e.dlen(G.d)<=0)throw Error("Deletes must not be empty");break;case"string":if(!(G.length>0))throw Error("Inserts cannot be empty");break;case"number":if(!(G>0))throw Error("Skip components must be >0");if(typeof b=="number")throw Error("Adjacent skip components should be combined");break}b=G}if(typeof b=="number")throw Error("Op has a trailing skip")};function r(w,b){let D=0,G=0;for(let _e=0;_e<w.length;_e++){const fe=w[_e];switch(b(fe,D,G),typeof fe){case"object":D+=e.dlen(fe.d);break;case"string":G+=n.strPosToUni(fe);break;case"number":D+=fe,G+=fe;break}}}e.eachOp=r;function s(w,b){const D=[],G=a(D);return r(w,(_e,fe,ye)=>{G(b(_e,fe,ye))}),h(D)}const i=w=>w,o=w=>s(w,i);e.dlen=w=>typeof w=="number"?w:n.strPosToUni(w);const a=w=>b=>{if(!(!b||b.d===0||b.d===""))if(w.length===0)w.push(b);else if(typeof b==typeof w[w.length-1])if(typeof b=="object"){const D=w[w.length-1];D.d=typeof D.d=="string"&&typeof b.d=="string"?D.d+b.d:e.dlen(D.d)+e.dlen(b.d)}else w[w.length-1]+=b;else w.push(b)},l=w=>typeof w=="number"?w:typeof w=="string"?n.strPosToUni(w):typeof w.d=="number"?w.d:n.strPosToUni(w.d);e.uniSlice=(w,b,D)=>{const G=n.uniToStrPos(w,b),_e=D==null?1/0:n.uniToStrPos(w,D);return w.slice(G,_e)};const c=(w,b,D)=>typeof w=="number"?D==null?w-b:Math.min(w,D)-b:e.uniSlice(w,b,D),u=w=>{let b=0,D=0;return{take:(fe,ye)=>{if(b===w.length)return fe===-1?null:fe;const Ae=w[b];let Le;if(typeof Ae=="number")return fe===-1||Ae-D<=fe?(Le=Ae-D,++b,D=0,Le):(D+=fe,fe);if(typeof Ae=="string"){if(fe===-1||ye==="i"||n.strPosToUni(Ae.slice(D))<=fe)return Le=Ae.slice(D),++b,D=0,Le;{const Be=D+n.uniToStrPos(Ae.slice(D),fe);return Le=Ae.slice(D,Be),D=Be,Le}}else{if(fe===-1||ye==="d"||e.dlen(Ae.d)-D<=fe)return Le={d:c(Ae.d,D)},++b,D=0,Le;{let Be=c(Ae.d,D,D+fe);return D+=fe,{d:Be}}}},peek:()=>w[b]}},h=w=>(w.length>0&&typeof w[w.length-1]=="number"&&w.pop(),w);function f(w,b,D){if(D!=="left"&&D!=="right")throw Error("side ("+D+") must be 'left' or 'right'");t(w),t(b);const G=[],_e=a(G),{take:fe,peek:ye}=u(w);for(let Le=0;Le<b.length;Le++){const Be=b[Le];let Ne,ot;switch(typeof Be){case"number":for(Ne=Be;Ne>0;)ot=fe(Ne,"i"),_e(ot),typeof ot!="string"&&(Ne-=l(ot));break;case"string":D==="left"&&typeof ye()=="string"&&_e(fe(-1)),_e(n.strPosToUni(Be));break;case"object":for(Ne=e.dlen(Be.d);Ne>0;)switch(ot=fe(Ne,"i"),typeof ot){case"number":Ne-=ot;break;case"string":_e(ot);break;case"object":Ne-=e.dlen(ot.d)}break}}let Ae;for(;Ae=fe(-1);)_e(Ae);return h(G)}function g(w,b){t(w),t(b);const D=[],G=a(D),{take:_e}=u(w);for(let ye=0;ye<b.length;ye++){const Ae=b[ye];let Le,Be;switch(typeof Ae){case"number":for(Le=Ae;Le>0;)Be=_e(Le,"d"),G(Be),typeof Be!="object"&&(Le-=l(Be));break;case"string":G(Ae);break;case"object":Le=e.dlen(Ae.d);let Ne=0;for(;Ne<Le;)switch(Be=_e(Le-Ne,"d"),typeof Be){case"number":G({d:c(Ae.d,Ne,Ne+Be)}),Ne+=Be;break;case"string":Ne+=n.strPosToUni(Be);break;case"object":G(Be)}break}}let fe;for(;fe=_e(-1);)G(fe);return h(D)}const E=(w,b)=>{let D=0;for(let G=0;G<b.length&&w>D;G++){const _e=b[G];switch(typeof _e){case"number":{D+=_e;break}case"string":const fe=n.strPosToUni(_e);D+=fe,w+=fe;break;case"object":w-=Math.min(e.dlen(_e.d),w-D);break}}return w},I=(w,b)=>typeof w=="number"?E(w,b):w.map(D=>E(D,b));function M(w,b,D){return s(w,(G,_e)=>typeof G=="object"&&typeof G.d=="number"?{d:D.slice(b,_e,_e+G.d)}:G)}function O(w){return s(w,b=>{switch(typeof b){case"object":if(typeof b.d=="number")throw Error("Cannot invert text op: Deleted characters missing from operation. makeInvertible must be called first.");return b.d;case"string":return{d:b};case"number":return b}})}function P(w){return s(w,b=>typeof b=="object"&&typeof b.d=="string"?{d:n.strPosToUni(b.d)}:b)}function $(w){let b=!0;return r(w,D=>{typeof D=="object"&&typeof D.d=="number"&&(b=!1)}),b}function z(w){return{name:"text-unicode",uri:"http://sharejs.org/types/text-unicode",trim:h,normalize:o,checkOp:t,create(b=""){if(typeof b!="string")throw Error("Initial data must be a string");return w.create(b)},apply(b,D){t(D);const G=w.builder(b);for(let _e=0;_e<D.length;_e++){const fe=D[_e];switch(typeof fe){case"number":G.skip(fe);break;case"string":G.append(fe);break;case"object":G.del(e.dlen(fe.d));break}}return G.build()},transform:f,compose:g,transformPosition:E,transformSelection:I,isInvertible:$,makeInvertible(b,D){return M(b,D,w)},stripInvertible:P,invert:O,invertWithDoc(b,D){return O(M(b,D,w))},isNoop:b=>b.length===0}}e.default=z}(ri)),ri}var Hr={},ul;function P_(){if(ul)return Hr;ul=1,Object.defineProperty(Hr,"__esModule",{value:!0});const e=si(),n=ni();function t(r,s){return{get:r,getLength(){return r().length},insert(i,o,a){const l=n.strPosToUni(r(),i);return s([l,o],a)},remove(i,o,a){const l=n.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 Hr.default=t,t.provides={text:!0},Hr}var hl;function F_(){return hl||(hl=1,function(e){var n=nt&&nt.__createBinding||(Object.create?function(f,g,E,I){I===void 0&&(I=E),Object.defineProperty(f,I,{enumerable:!0,get:function(){return g[E]}})}:function(f,g,E,I){I===void 0&&(I=E),f[I]=g[E]}),t=nt&&nt.__setModuleDefault||(Object.create?function(f,g){Object.defineProperty(f,"default",{enumerable:!0,value:g})}:function(f,g){f.default=g}),r=nt&&nt.__importStar||function(f){if(f&&f.__esModule)return f;var g={};if(f!=null)for(var E in f)Object.hasOwnProperty.call(f,E)&&n(g,f,E);return t(g,f),g},s=nt&&nt.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.type=e.remove=e.insert=void 0;const i=ni(),o=r(si()),a=s(P_()),l={create(f){return f},toString(f){return f},builder(f){if(typeof f!="string")throw Error("Invalid document snapshot: "+f);const g=[];return{skip(E){let I=i.uniToStrPos(f,E);if(I>f.length)throw Error("The op is too long for this document");g.push(f.slice(0,I)),f=f.slice(I)},append(E){g.push(E)},del(E){f=f.slice(i.uniToStrPos(f,E))},build(){return g.join("")+f}}},slice:o.uniSlice},c=o.default(l),u=Object.assign(Object.assign({},c),{api:a.default});e.type=u,e.insert=(f,g)=>g.length===0?[]:f===0?[g]:[f,g],e.remove=(f,g)=>o.dlen(g)===0?[]:f===0?[{d:g}]:[f,{d:g}];var h=si();Object.defineProperty(e,"makeType",{enumerable:!0,get:function(){return h.default}})}(ti)),ti}(function(e){var n=nt&&nt.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.editOp=e.replaceOp=e.insertOp=e.moveOp=e.removeOp=e.type=void 0;const t=n(Xs),r=n(Js),s=qs,i=ei;function o(S,U){if(!S)throw new Error(U)}e.type={name:"json1",uri:"http://sharejs.org/types/JSONv1",readCursor:s.readCursor,writeCursor:s.writeCursor,create:S=>S,isNoop:S=>S==null,setDebug(S){},registerSubtype:O,checkValidOp:_e,normalize:fe,apply:ye,transformPosition:Ae,compose:Le,tryTransform:wn,transform:hr,makeInvertible:ot,invert:Be,invertWithDoc:Ti,RM_UNEXPECTED_CONTENT:i.ConflictType.RM_UNEXPECTED_CONTENT,DROP_COLLISION:i.ConflictType.DROP_COLLISION,BLACKHOLE:i.ConflictType.BLACKHOLE,transformNoConflict:(S,U,Y)=>Zr(()=>!0,S,U,Y),typeAllowingConflictsPred:S=>Object.assign(Object.assign({},e.type),{transform:(U,Y,se)=>Zr(S,U,Y,se)})};const a=S=>S?S.getComponent():null;function l(S){return S&&typeof S=="object"&&!Array.isArray(S)}const c=S=>Array.isArray(S)?S.slice():S!==null&&typeof S=="object"?Object.assign({},S):S,u=S=>S&&(S.p!=null||S.r!==void 0),h=S=>S&&(S.d!=null||S.i!==void 0);function f(S,U){return o(S!=null),typeof U=="number"?(o(Array.isArray(S),"Invalid key - child is not an array"),(S=S.slice()).splice(U,1)):(o(l(S),"Invalid key - child is not an object"),delete(S=Object.assign({},S))[U]),S}function g(S,U,Y){return typeof U=="number"?(o(S!=null,"Container is missing for key"),o(Array.isArray(S),"Cannot use numerical key for object container"),o(S.length>=U,"Cannot insert into out of bounds index"),S.splice(U,0,Y)):(o(l(S),"Cannot insert into missing item"),o(S[U]===void 0,"Trying to overwrite value at key. Your op needs to remove it first"),S[U]=Y),Y}e.removeOp=(S,U=!0)=>s.writeCursor().writeAtPath(S,"r",U).get(),e.moveOp=(S,U)=>s.writeCursor().writeMove(S,U).get(),e.insertOp=(S,U)=>s.writeCursor().writeAtPath(S,"i",U).get(),e.replaceOp=(S,U,Y)=>s.writeCursor().at(S,se=>{se.write("r",U),se.write("i",Y)}).get(),e.editOp=(S,U,Y,se=!1)=>s.writeCursor().at(S,X=>b(X,U,Y,se)).get();const E=(S,U)=>S!=null&&(typeof U=="number"?Array.isArray(S):typeof S=="object"),I=(S,U)=>E(S,U)?S[U]:void 0,M={};function O(S){let U=S.type?S.type:S;U.name&&(M[U.name]=U),U.uri&&(M[U.uri]=U)}const P=S=>{const U=M[S];if(U)return U;throw Error("Missing type: "+S)};O(F_());const $=(S,U)=>S+U;O({name:"number",apply:$,compose:$,invert:S=>-S,transform:S=>S});const z=S=>S==null?null:S.et?P(S.et):S.es?M["text-unicode"]:S.ena!=null?M.number:null,w=S=>S.es?S.es:S.ena!=null?S.ena:S.e,b=(S,U,Y,se=!1)=>{const[X,Z]=typeof U=="string"?[P(U),U]:[U,U.name];!se&&X.isNoop&&X.isNoop(Y)||(Z==="number"?S.write("ena",Y):Z==="text-unicode"?S.write("es",Y):(S.write("et",Z),S.write("e",Y)))};function D(S){o(typeof S=="number"),o(S>=0),o(S===(0|S))}function G(S){typeof S=="number"?D(S):o(typeof S=="string")}function _e(S){if(S===null)return;const U=new Set,Y=new Set,se=Z=>{let Ee=!0,ue=!1;for(let B in Z){const K=Z[B];if(Ee=!1,o(B==="p"||B==="r"||B==="d"||B==="i"||B==="e"||B==="es"||B==="ena"||B==="et","Invalid component item '"+B+"'"),B==="p")D(K),o(!U.has(K)),U.add(K),o(Z.r===void 0);else if(B==="d")D(K),o(!Y.has(K)),Y.add(K),o(Z.i===void 0);else if(B==="e"||B==="es"||B==="ena"){o(!ue),ue=!0;const Q=z(Z);o(Q,"Missing type in edit"),Q.checkValidOp&&Q.checkValidOp(w(Z))}}o(!Ee)},X=(Z,Ee,ue)=>{if(!Array.isArray(Z))throw Error("Op must be null or a list");if(Z.length===0)throw Error("Empty descent");Ee||G(Z[0]);let B=1,K=0,Q=0;for(let ee=0;ee<Z.length;ee++){const pe=Z[ee];if(o(pe!=null),Array.isArray(pe)){const Ce=X(pe,!1);if(K){const x=typeof Q,oe=typeof Ce;x===oe?o(Q<Ce,"descent keys are not in order"):o(x==="number"&&oe==="string")}Q=Ce,K++,B=3}else typeof pe=="object"?(o(B===1,`Prev not scalar - instead ${B}`),se(pe),B=2):(o(B!==3),G(pe),o(s.isValidPathItem(pe),"Invalid path key"),B=1)}return o(K!==1,"Operation makes multiple descents. Remove some []"),o(B===2||B===3),Z[0]};X(S,!0),o(U.size===Y.size,"Mismatched picks and drops in op");for(let Z=0;Z<U.size;Z++)o(U.has(Z)),o(Y.has(Z))}function fe(S){let U=0,Y=[];const se=s.writeCursor();return se.mergeTree(S,(X,Z)=>{const Ee=z(X);if(Ee){const B=w(X);b(Z,Ee,Ee.normalize?Ee.normalize(B):B)}for(const B of["r","p","i","d"])if(X[B]!==void 0){const K=B==="p"||B==="d"?(ue=X[B],Y[ue]==null&&(Y[ue]=U++),Y[ue]):X[B];Z.write(B,K)}var ue}),se.get()}function ye(S,U){if(_e(U),U===null)return S;const Y=[];return function se(X,Z){let Ee=X,ue=0,B={root:X},K=0,Q=B,ee="root";function pe(){for(;K<ue;K++){let Ce=Z[K];typeof Ce!="object"&&(o(E(Q,ee)),Q=Q[ee]=c(Q[ee]),ee=Ce)}}for(;ue<Z.length;ue++){const Ce=Z[ue];if(Array.isArray(Ce)){const x=se(Ee,Ce);x!==Ee&&x!==void 0&&(pe(),Ee=Q[ee]=x)}else if(typeof Ce=="object"){Ce.d!=null?(pe(),Ee=g(Q,ee,Y[Ce.d])):Ce.i!==void 0&&(pe(),Ee=g(Q,ee,Ce.i));const x=z(Ce);if(x)pe(),Ee=Q[ee]=x.apply(Ee,w(Ce));else if(Ce.e!==void 0)throw Error("Subtype "+Ce.et+" undefined")}else Ee=I(Ee,Ce)}return B.root}(S=function se(X,Z){const Ee=[];let ue=0;for(;ue<Z.length;ue++){const ee=Z[ue];if(Array.isArray(ee))break;typeof ee!="object"&&(Ee.push(X),X=I(X,ee))}for(let ee=Z.length-1;ee>=ue;ee--)X=se(X,Z[ee]);for(--ue;ue>=0;ue--){const ee=Z[ue];if(typeof ee!="object"){const pe=Ee.pop();X=X===I(pe,ee)?pe:X===void 0?f(pe,ee):(K=ee,Q=X,(B=c(B=pe))[K]=Q,B)}else u(ee)&&(o(X!==void 0,"Cannot pick up or remove undefined"),ee.p!=null&&(Y[ee.p]=X),X=void 0)}var B,K,Q;return X}(S,U),U)}function Ae(S,U){S=S.slice(),_e(U);const Y=s.readCursor(U);let se,X,Z=!1;const Ee=[];for(let B=0;;B++){const K=S[B],Q=Y.getComponent();if(Q&&(Q.r!==void 0?Z=!0:Q.p!=null&&(Z=!1,se=Q.p,X=B)),B>=S.length)break;let ee=0;const pe=s.advancer(Y,void 0,(x,oe)=>{u(oe)&&ee++});Ee.unshift(pe);const Ce=pe(K);if(typeof K=="number"&&(S[B]-=ee),!Ce)break}if(Ee.forEach(B=>B.end()),Z)return null;const ue=()=>{let B=0;if(se!=null){const K=Y.getPath();B=K.length,S=K.concat(S.slice(X))}for(;B<S.length;B++){const K=S[B],Q=a(Y),ee=z(Q);if(ee){const x=w(Q);ee.transformPosition&&(S[B]=ee.transformPosition(S[B],x));break}let pe=0;const Ce=s.advancer(Y,(x,oe)=>h(oe)?~(x-pe):x-pe,(x,oe)=>{h(oe)&&pe++})(K);if(typeof K=="number"&&(S[B]+=pe),!Ce)break}};return se!=null?Y.eachDrop(null,B=>{B===se&&ue()}):ue(),S}function Le(S,U){if(_e(S),_e(U),S==null)return U;if(U==null)return S;let Y=0;const se=s.readCursor(S),X=s.readCursor(U),Z=s.writeCursor(),Ee=[],ue=[],B=[],K=[],Q=[],ee=[],pe=new Set;se.traverse(null,x=>{x.p!=null&&(B[x.p]=se.clone())}),X.traverse(null,x=>{x.d!=null&&(K[x.d]=X.clone())});const Ce=s.writeCursor();return function x(oe,Fe,Me,ve,je,Et,ke,Ge){o(Fe||Me);const xe=a(Fe),at=a(Me),qe=!!at&&at.r!==void 0,xt=!!xe&&xe.i!==void 0,be=xe?xe.d:null,lt=at?at.p:null,p=(Et||qe)&&lt==null;if(lt!=null)ve=K[lt],ke=ue[lt]=new s.WriteCursor;else if(at&&at.r!==void 0)ve=null;else{const A=a(ve);A&&A.d!=null&&(ve=null)}const m=a(ve);if(be!=null)if(oe=B[be],Ge=Ee[be]=new s.WriteCursor,p)Et&&!qe&&Ge.write("r",!0);else{const A=Q[be]=Y++;ke.write("d",A)}else if(xe&&xe.i!==void 0)oe=null;else{const A=a(oe);A&&A.p!=null&&(oe=null)}let _;xt?(o(je===void 0),_=xe.i):_=je;const v=(lt==null?!xt||Et||qe:_===void 0)?null:ke.getComponent();if(lt!=null){if(!(je!==void 0||xt)){const A=be!=null?Q[be]:Y++;ee[lt]=A,Ge.write("p",A)}}else qe&&(xt||je!==void 0||(at.r,Ge.write("r",at.r)));const y=p?null:z(xe),T=z(m);if((y||T)&&(y&&y.name,T&&T.name),y&&T){o(y===T);const A=w(xe),H=w(m),ie=y.compose(A,H);b(ke,y,ie),pe.add(m)}else y?b(ke,y,w(xe)):T&&(b(ke,T,w(m)),pe.add(m));const N=typeof _=="object"&&_!=null;let L=!1,C=0,k=0,q=0,F=0,J=0;const ce=s.advancer(ve,(A,H)=>h(H)?F-A-1:A-F,(A,H)=>{h(H)&&F++}),V=s.advancer(oe,(A,H)=>u(H)?C-A-1:A-C,(A,H)=>{u(H)&&C++});if(s.eachChildOf(Fe,Me,(A,H,ie)=>{let he,Se,Oe=A,De=A,ct=A;if(typeof A=="number"){let ge=A+q;Se=ce(ge),De=ge+F;let j=A+k;he=V(j),h(a(Se))&&(he=null),Oe=j+C,ct=A+J,o(Oe>=0,"p1PickKey is negative"),o(De>=0,"p2DropKey is negative");const tt=h(a(H)),Te=u(a(ie));(tt||Te&&!p)&&J--,tt&&k--,Te&&q--}else he=V(A),Se=ce(A);Ge.descend(Oe),ke.descend(De);const ut=N&&!h(a(H))?_[ct]:void 0,ne=x(he,H,ie,Se,ut,p,ke,Ge);var Ve,le,ae;N&&!p?ut!==ne&&(L||(_=Array.isArray(_)?_.slice():Object.assign({},_),L=!0),Ve=_,ae=ne,typeof(le=ct)=="number"?(o(Array.isArray(Ve)),o(le<Ve.length)):(o(!Array.isArray(Ve)),o(Ve[le]!==void 0)),ae===void 0?typeof le=="number"?Ve.splice(le,1):delete Ve[le]:Ve[le]=ae):o(ne===void 0),ke.ascend(),Ge.ascend()}),V.end(),ce.end(),v!=null)v.i=_;else if(!Et&&!qe&&lt==null)return _}(se,se.clone(),X,X.clone(),void 0,!1,Z,Ce),Z.reset(),Z.mergeTree(Ce.get()),Z.reset(),Z.get(),Ee.map(x=>x.get()),ue.map(x=>x.get()),se.traverse(Z,(x,oe)=>{const Fe=x.p;if(Fe!=null){const Me=Q[Fe];Me!=null&&oe.write("p",Me);const ve=Ee[Fe];ve&&ve.get(),ve&&oe.mergeTree(ve.get())}else x.r!==void 0&&oe.write("r",x.r)}),Z.reset(),Z.get(),X.traverse(Z,(x,oe)=>{const Fe=x.d;if(Fe!=null){const ve=ee[Fe];ve!=null&&oe.write("d",ve);const je=ue[Fe];je&&oe.mergeTree(je.get())}else x.i!==void 0&&oe.write("i",x.i);const Me=z(x);Me&&!pe.has(x)&&b(oe,Me,w(x))}),Z.get()}function Be(S){if(S==null)return null;const U=new s.ReadCursor(S),Y=new s.WriteCursor;let se;const X=[],Z=[];return function Ee(ue,B,K){const Q=ue.getComponent();let ee,pe=!1;if(Q){Q.p!=null&&(B.write("d",Q.p),X[Q.p]=ue.clone()),Q.r!==void 0&&B.write("i",Q.r),Q.d!=null&&(B.write("p",Q.d),K=void 0),Q.i!==void 0&&(K=ee=Q.i);const x=z(Q);x&&(K===void 0?(se||(se=new Set),se.add(Q)):(w(Q),K=x.apply(K,w(Q)),pe=!0))}let Ce=0;for(const x of ue){B.descend(x);const oe=typeof x=="number"?x-Ce:x,Fe=I(K,oe);h(ue.getComponent())&&Ce++;const Me=Ee(ue,B,Fe);if(K!==void 0&&Me!==void 0){if(pe||(pe=!0,K=c(K)),!E(K,oe))throw Error("Cannot modify child - invalid operation");K[oe]=Me}B.ascend()}if(ee===void 0)return pe?K:void 0;B.write("r",K)}(U,Y,void 0),se&&(Y.reset(),function Ee(ue,B,K){const Q=B.getComponent();if(Q){const x=Q.d;if(x!=null&&(ue=X[x],K=Z[x]=s.writeCursor()),se.has(Q)){const oe=z(Q);if(!oe.invert)throw Error(`Cannot invert subtype ${oe.name}`);b(K,oe,oe.invert(w(Q)))}}let ee=0,pe=0;const Ce=s.advancer(ue,(x,oe)=>u(oe)?ee-x-1:x-ee,(x,oe)=>{u(oe)&&ee++});for(const x of B)if(typeof x=="number"){const oe=x-pe,Fe=Ce(oe),Me=oe+ee;K.descend(Me),Ee(Fe,B,K),h(B.getComponent())&&pe++,K.ascend()}else K.descend(x),Ee(Ce(x),B,K),K.ascend();Ce.end()}(U.clone(),U,Y),Z.length&&(Y.reset(),U.traverse(Y,(Ee,ue)=>{const B=Ee.p;if(B!=null){const K=Z[B];K&&K.get(),K&&ue.mergeTree(K.get())}}))),Y.get()}const Ne=(S,U)=>S.some(Y=>typeof Y=="object"&&(Array.isArray(Y)?Ne(Y,U):U(Y)));function ot(S,U){if(S==null||!Ne(S,B=>{var K;return B.r!==void 0||((K=z(B))===null||K===void 0?void 0:K.makeInvertible)!=null}))return S;const Y=new s.ReadCursor(S),se=new s.WriteCursor;let X=!1;const Z=[],Ee=[],ue=(B,K,Q)=>{const ee=B.getComponent();let pe=!1;if(ee){ee.d!=null&&K.write("d",ee.d),ee.i!==void 0&&K.write("i",ee.i);const x=ee.p;if(x!=null&&(Z[x]=B.clone(),o(Q!==void 0,"Operation picks up at an invalid key"),Ee[x]=Q,K.write("p",ee.p)),ee.r!==void 0&&Q===void 0)throw Error("Invalid doc / op in makeInvertible: removed item missing from doc");const oe=z(ee);oe&&(oe.makeInvertible?X=!0:b(K,oe,w(ee),!0))}let Ce=0;for(const x of B){K.descend(x);const oe=typeof x=="number"?x-Ce:x,Fe=I(Q,oe),Me=ue(B,K,Fe);Fe!==Me&&(pe||(pe=!0,Q=c(Q)),Me===void 0?(Q=f(Q,oe),typeof x=="number"&&Ce++):Q[oe]=Me),K.ascend()}return ee&&(ee.r!==void 0?(K.write("r",r.default(Q)),Q=void 0):ee.p!=null&&(Q=void 0)),Q};return ue(Y,se,U),se.get(),X&&(se.reset(),function B(K,Q,ee,pe,Ce){const x=Q.getComponent();if(x){x.i!==void 0?(pe=x.i,Ce=!0):x.d!=null&&(pe=Ee[x.d],K=Z[x.d],Ce=!1,x.d);let ve=z(x);if(ve&&ve.makeInvertible){const je=w(x);b(ee,ve,ve.makeInvertible(je,pe),!0)}}let oe=0,Fe=0;const Me=s.advancer(K,(ve,je)=>u(je)?oe-ve-1:ve-oe,(ve,je)=>{u(je)&&oe++});for(const ve of Q)if(typeof ve=="number"){const je=ve-Fe,Et=Me(je),ke=je+oe,Ge=I(pe,Ce?je:ke);ee.descend(ve),B(Et,Q,ee,Ge,Ce),h(Q.getComponent())&&Fe++,ee.ascend()}else{const je=I(pe,ve);ee.descend(ve),B(Me(ve),Q,ee,je,Ce),ee.ascend()}Me.end()}(Y.clone(),Y,se,U,!1)),se.get()}function Ti(S,U){return Be(ot(S,U))}const ur=S=>{if(S==null)return null;const U=S.slice();for(let Y=0;Y<S.length;Y++){const se=U[Y];Array.isArray(se)&&(U[Y]=ur(se))}return U};function wn(S,U,Y){o(Y==="left"||Y==="right","Direction must be left or right");const se=Y==="left"?0:1;if(U==null)return{ok:!0,result:S};_e(S),_e(U);let X=null;const Z=[],Ee=[],ue=[],B=[],K=[],Q=[],ee=[],pe=[],Ce=[],x=[],oe=[],Fe=[],Me=[],ve=[],je=[];let Et=0;const ke=s.readCursor(S),Ge=s.readCursor(U),xe=s.writeCursor();if(function m(_,v=null,y){const T=a(v);T&&(T.r!==void 0?y=v.clone():T.p!=null&&(y=null,Q[T.p]=_.clone()));const N=_.getComponent();let L;N&&(L=N.p)!=null&&(K[L]=v?v.clone():null,ue[L]=_.clone(),y&&(x[L]=!0,Ce[L]=y),T&&T.p!=null&&(ve[L]=T.p));const C=s.advancer(v);for(const k of _)m(_,C(k),y);C.end()}(Ge,ke,null),function m(_,v,y,T,N){const L=y.getComponent();let C,k=!1;L&&((C=L.d)!=null?(B[C]=y.clone(),T!=null&&(je[T]==null&&(je[T]=[]),je[T].push(C)),_=K[C]||null,v=ue[C]||null,x[C]?(N&&(oe[C]=!0),N=Ce[C]||null):!N||se!==1&&ve[C]!=null||X==null&&(X={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(N.getPath()),op2:e.moveOp(v.getPath(),y.getPath())}),k=!0):L.i!==void 0&&(_=v=null,k=!0,N&&X==null&&(X={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(N.getPath()),op2:e.insertOp(y.getPath(),L.i)})));const q=a(_);q&&(q.r!==void 0?N=_.clone():q.p!=null&&(q.p,T=q.p,N=null));const F=z(L);F&&N&&X==null&&(X={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(N.getPath()),op2:e.editOp(y.getPath(),F,w(L),!0)});let J=0,ce=0;const V=s.advancer(v,(H,ie)=>u(ie)?J-H-1:H-J,(H,ie)=>{u(ie)&&J++}),A=s.advancer(_);for(const H of y)if(typeof H=="number"){const ie=H-ce,he=V(ie);ce+=+m(A(ie+J),he,y,T,N)}else{const ie=V(H);m(A(H),ie,y,T,N)}return V.end(),A.end(),k}(ke,Ge,Ge.clone(),null,null),B.map(m=>m&&m.get()),X)return{ok:!1,conflict:X};oe.map(m=>!!m);const at=[];let qe=null;(function m(_,v,y,T,N){let L=!1;const C=a(v);if(u(C)){const V=C.p;V!=null?(y=B[V],T=Fe[V]=s.writeCursor(),L=!0,N=null):(y=null,N=v.clone())}else h(a(y))&&(y=null);const k=_.getComponent();if(k){const V=k.p;V!=null?(N&&(pe[V]=N),at[V]=N||se===1&&L?null:T.getComponent(),Z[V]=_.clone(),y&&(ee[V]=y.clone())):k.r!==void 0&&(N||T.write("r",!0),(N||L)&&(qe==null&&(qe=new Set),qe.add(k)))}let q=0,F=0;const J=s.advancer(v,void 0,(V,A)=>{u(A)&&q++}),ce=s.advancer(y,(V,A)=>h(A)?~(V-F):V-F,(V,A)=>{h(A)&&F++});if(_)for(const V of _)if(typeof V=="string"){const A=J(V),H=ce(V);T.descend(V),m(_,A,H,T,N),T.ascend()}else{const A=J(V),H=V-q,ie=u(a(A))?null:ce(H),he=H+F;o(he>=0),T.descend(he),m(_,A,ie,T,N),T.ascend()}J.end(),ce.end()})(ke,Ge,Ge.clone(),xe,null),xe.reset();let xt=[];if(function m(_,v,y,T,N,L){o(v);const C=v.getComponent();let k=a(T),q=!1;const F=(le,ae,ge)=>le?e.moveOp(le.getPath(),ae.getPath()):e.insertOp(ae.getPath(),ge.i);if(h(C)){const le=C.d;le!=null&&(Ee[le]=v.clone());const ae=le!=null?at[le]:null;let ge=!1;if(C.i!==void 0||le!=null&&ae){let j;k&&(k.i!==void 0||(j=k.d)!=null&&!x[j])&&(ge=j!=null?le!=null&&le===ve[j]:t.default(k.i,C.i),ge||j!=null&&se!==1&&ve[j]!=null||X==null&&(X={type:i.ConflictType.DROP_COLLISION,op1:F(le!=null?Z[le]:null,v,C),op2:F(j!=null?ue[j]:null,T,k)})),ge||(L?X==null&&(X={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:F(le!=null?Z[le]:null,v,C),op2:e.removeOp(L.getPath())}):(le!=null?(xt[Et]=le,N.write("d",ae.p=Et++)):N.write("i",r.default(C.i)),q=!0))}else if(le!=null&&!ae){const j=pe[le];j&&(L=j.clone())}le!=null?(_=Z[le],y=Q[le],T=ee[le]):C.i!==void 0&&(_=y=null,ge||(T=null))}else u(a(_))&&(_=y=T=null);const J=a(_),ce=a(y);if(u(ce)){const le=ce.p;ce.r!==void 0&&(!J||J.r===void 0)||x[le]?(T=null,L=y.clone()):le!=null&&(T=B[le],se!==1&&ve[le]!=null||((N=Me[le])||(N=Me[le]=s.writeCursor()),N.reset(),L=null))}else!h(C)&&h(k)&&(T=null);k=T!=null?T.getComponent():null;const V=z(C);if(V){const le=w(C);if(L)X==null&&(X={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.editOp(v.getPath(),V,le,!0),op2:e.removeOp(L.getPath())});else{const ae=z(k);let ge;if(ae){if(V!==ae)throw Error("Transforming incompatible types");const j=w(k);ge=V.transform(le,j,Y)}else ge=r.default(le);b(N,V,ge)}}let A=0,H=0,ie=0,he=0,Se=0,Oe=0,De=_!=null&&_.descendFirst(),ct=De;const ut=s.advancer(y,void 0,(le,ae)=>{u(ae)&&ie++});let ne=T!=null&&T.descendFirst(),Ve=ne;for(const le of v)if(typeof le=="number"){let ae;const ge=h(v.getComponent()),j=le-H;{let Yt;for(;De&&typeof(Yt=_.getKey())=="number";){Yt+=A;const St=_.getComponent(),An=u(St);if(Yt>j||Yt===j&&(!An||se===0&&ge))break;if(An){A--;const an=St.p;ve.includes(an),St.d,a(Me[St.d]),u(a(Me[St.d])),(St.r===void 0||qe&&qe.has(St))&&(an==null||!at[an]||se!==1&&ve.includes(an))||Se--}De=_.nextSibling()}ae=De&&Yt===j?_:null}const tt=j-A;let Te=ut(tt);const Tt=tt-ie;let qr=null;{let Yt,St;for(;ne&&typeof(Yt=T.getKey())=="number";){St=Yt-he;const An=T.getComponent(),an=h(An);if(St>Tt)break;if(St===Tt){if(!an){qr=T;break}{if(se===0&&ge){qr=T;break}const ln=Te&&u(Te.getComponent());if(se===0&&ln)break}}if(an){const ln=An.d;ve[ln],An.i===void 0&&(x[ln]||ve[ln]!=null&&se!==1)?(x[ln]||ve[ln]!=null&&se===0)&&(he++,Oe--):he++}ne=T.nextSibling()}}const gu=Tt+he+Se+Oe;o(gu>=0,"trying to descend to a negative index"),N.descend(gu),ge&&(ae=Te=qr=null,H++),m(ae,v,Te,qr,N,L)&&Oe++,N.ascend()}else{let ae;for(;De&&(ae=_.getKey(),typeof ae!="string"||!(ae>le||ae===le));)De=_.nextSibling();const ge=De&&ae===le?_:null,j=ut(le);let tt;for(;ne&&(tt=T.getKey(),typeof tt!="string"||!(tt>le||tt===le));)ne=T.nextSibling();const Te=ne&&tt===le?T:null;N.descend(le),m(ge,v,j,Te,N,L),N.ascend()}return ut.end(),ct&&_.ascend(),Ve&&T.ascend(),q}(ke,ke.clone(),Ge,Ge.clone(),xe,null),X)return{ok:!1,conflict:X};xe.reset();const be=(m,_,v)=>m.traverse(_,(y,T)=>{y.d!=null&&v(y.d,m,T)});(x.length||Fe.length)&&(be(Ge,xe,(m,_,v)=>{x[m]&&!oe[m]&&v.write("r",!0),Fe[m]&&v.mergeTree(Fe[m].get())}),xe.reset());const lt=[],p=[];if((Me.length||x.length)&&!X){const m=s.readCursor(ur(xe.get()));if(be(m,null,(_,v)=>{lt[_]=v.clone()}),Me.forEach(_=>{_&&be(s.readCursor(_.get()),null,(v,y)=>{lt[v]=y.clone()})}),function _(v,y,T,N,L,C){const k=a(y);if(k&&u(k))if(k.p!=null){const A=k.p;lt[A].getPath(),T=lt[A],N=p[A]=s.writeCursor()}else k.r!==void 0&&(T=null);else h(a(T))&&(T=null);const q=v.getComponent();if(q){let A;if((A=q.d)!=null){const H=Me[A];H&&(H.get(),N.mergeTree(H.get()),T=s.readCursor(H.get()))}}let F=0,J=0;const ce=s.advancer(y,void 0,(A,H)=>{u(H)&&F--}),V=s.advancer(T,(A,H)=>h(H)?-(A-J)-1:A-J,(A,H)=>{h(H)&&J++});for(const A of v)if(typeof A=="number"){const H=ce(A),ie=A+F,he=V(ie),Se=ie+J;N.descend(Se),_(v,H,he,N),N.ascend()}else N.descend(A),_(v,ce(A),V(A),N),N.ascend();ce.end(),V.end()}(Ge,m,m.clone(),xe),xe.reset(),X)return{ok:!1,conflict:X};if(xe.get(),p.length){const _=p.map(y=>y?y.get():null),v=s.readCursor(ur(xe.get()));if(be(v,xe,(y,T,N)=>{const L=_[y];L&&(N.mergeTree(L),_[y]=null)}),_.find(y=>y)){const y=s.writeCursor(),T=s.writeCursor();let N=0,L=0;_.forEach(C=>{C!=null&&be(s.readCursor(C),null,k=>{const q=xt[k];y.writeMove(Z[q].getPath(),Ee[q].getPath(),N++);const F=je[q];F&&F.forEach(J=>{x[J]||se!==1&&ve[J]!=null||T.writeMove(ue[J].getPath(),B[J].getPath(),L++)})})}),X={type:i.ConflictType.BLACKHOLE,op1:y.get(),op2:T.get()}}}}return X?{ok:!1,conflict:X}:{ok:!0,result:xe.get()}}const on=S=>{const U=new Error("Transform detected write conflict");throw U.conflict=S,U.type=U.name="writeConflict",U};function hr(S,U,Y){const se=wn(S,U,Y);if(se.ok)return se.result;on(se.conflict)}const vt=S=>{const U=s.writeCursor();return s.readCursor(S).traverse(U,(Y,se)=>{(h(Y)||z(Y))&&se.write("r",!0)}),U.get()},Jr=(S,U)=>{const{type:Y,op1:se,op2:X}=S;switch(Y){case i.ConflictType.DROP_COLLISION:return U==="left"?[null,vt(X)]:[vt(se),null];case i.ConflictType.RM_UNEXPECTED_CONTENT:let Z=!1;return s.readCursor(se).traverse(null,Ee=>{Ee.r!==void 0&&(Z=!0)}),Z?[null,vt(X)]:[vt(se),null];case i.ConflictType.BLACKHOLE:return[vt(se),vt(X)];default:throw Error("Unrecognised conflict: "+Y)}};function Zr(S,U,Y,se){let X=null;for(;;){const Z=wn(U,Y,se);if(Z.ok)return Le(X,Z.result);{const{conflict:Ee}=Z;S(Ee)||on(Ee);const[ue,B]=Jr(Ee,se);U=Le(fe(U),ue),Y=Le(fe(Y),B),X=Le(X,B)}}}})(al),function(e){var n=nt&&nt.__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]}),t=nt&&nt.__exportStar||function(i,o){for(var a in i)a!=="default"&&!o.hasOwnProperty(a)&&n(o,i,a)};Object.defineProperty(e,"__esModule",{value:!0}),t(al,e);var r=qs;Object.defineProperty(e,"ReadCursor",{enumerable:!0,get:function(){return r.ReadCursor}}),Object.defineProperty(e,"WriteCursor",{enumerable:!0,get:function(){return r.WriteCursor}});var s=ei;Object.defineProperty(e,"ConflictType",{enumerable:!0,get:function(){return s.ConflictType}})}(it);const k_=_u({__proto__:null,default:fs(it)},[it]);var te=(e=>(e.RETAIN="r",e.INSERT="i",e.DELETE="d",e))(te||{}),dl=(e=>(e[e.character=0]="character",e[e.paragraph=1]="paragraph",e[e.table=2]="table",e[e.numbering=3]="numbering",e))(dl||{}),fl=(e=>(e[e.TAB=0]="TAB",e[e.SPACE=1]="SPACE",e[e.NOTHING=2]="NOTHING",e))(fl||{}),de=(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))(de||{}),Kn=(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))(Kn||{}),Yn=(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))(Yn||{}),pn=(e=>(e[e.COMMENT=0]="COMMENT",e[e.DELETED=9999]="DELETED",e))(pn||{}),gl=(e=>(e[e.DRAWING=0]="DRAWING",e[e.CUSTOM=1]="CUSTOM",e))(gl||{}),ml=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRADITIONAL=1]="TRADITIONAL",e[e.MODERN=2]="MODERN",e))(ml||{}),_l=(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))(_l||{}),pl=(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))(pl||{}),El=(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))(El||{}),Cl=(e=>(e[e.NORMAL=0]="NORMAL",e[e.TBRL=1]="TBRL",e[e.LRTBV=2]="LRTBV",e))(Cl||{}),Rl=(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))(Rl||{}),Il=(e=>(e[e.BOTH_SIDES=0]="BOTH_SIDES",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.LARGEST=3]="LARGEST",e))(Il||{}),vl=(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))(vl||{}),Sl=(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))(Sl||{}),Ol=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(Ol||{}),bl=(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))(bl||{}),yl=(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))(yl||{}),wl=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SPECIFIED=1]="SPECIFIED",e))(wl||{}),Al=(e=>(e[e.START=0]="START",e[e.CENTER=1]="CENTER",e[e.END=2]="END",e))(Al||{}),Nl=(e=>(e[e.AUTO_FIT=0]="AUTO_FIT",e[e.FIXED=1]="FIXED",e))(Nl||{}),Tl=(e=>(e[e.NONE=0]="NONE",e[e.WRAP=1]="WRAP",e))(Tl||{}),Ml=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(Ml||{}),Ll=(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))(Ll||{}),En=(e=>(e.NORMAL="normal",e.BOLD="bold",e.ITALIC="italic",e))(En||{}),Dl=(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))(Dl||{}),Ul=(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))(Ul||{}),Pl=(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))(Pl||{}),Fl=(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))(Fl||{}),kl=(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))(kl||{}),xl=(e=>(e[e.compressPunctuation=0]="compressPunctuation",e[e.compressPunctuationAndJapaneseKana=1]="compressPunctuationAndJapaneseKana",e[e.doNotCompress=2]="doNotCompress",e))(xl||{}),Hl=(e=>(e[e.PORTRAIT=0]="PORTRAIT",e[e.LANDSCAPE=1]="LANDSCAPE",e))(Hl||{}),Bl=(e=>(e[e.forward=0]="forward",e[e.backward=1]="backward",e[e.front=2]="front",e[e.back=3]="back",e))(Bl||{}),jl=(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))(jl||{}),ii=(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))(ii||{}),$l=(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))($l||{}),Wl=(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))(Wl||{}),Vl=(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))(Vl||{}),Nt=(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))(Nt||{});const Br={"a)":{glyphFormat:"%1)",glyphType:de.DECIMAL},"1.":{glyphFormat:"%1.",glyphType:de.DECIMAL},"a.":{glyphFormat:"%1.",glyphType:de.LOWER_LETTER},"A.":{glyphFormat:"%1.",glyphType:de.UPPER_LETTER},"i.":{glyphFormat:"%1.",glyphType:de.LOWER_ROMAN},"I.":{glyphFormat:"%1.",glyphType:de.UPPER_LETTER}},Cn=e=>[...e,...e,...e].map((n,t)=>({glyphFormat:` %${t+1}`,glyphSymbol:n,bulletAlignment:Kn.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*t}}})),Rn=e=>e.map((n,t)=>({...n,bulletAlignment:Kn.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*t}}})),zl=(e,n)=>new Array(9).fill(0).map((t,r)=>({glyphFormat:` %${r+1}`,glyphSymbol:e,bulletAlignment:Kn.START,textStyle:{fs:16},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*r},textStyle:n}})),Xn={BULLET_LIST:{listType:"BULLET_LIST",nestingLevel:Cn(["●","○","■"])},BULLET_LIST_1:{listType:"BULLET_LIST",nestingLevel:Cn(["❖","➢","■"])},BULLET_LIST_2:{listType:"BULLET_LIST",nestingLevel:Cn(["✔","●","◆"])},BULLET_LIST_3:{listType:"BULLET_LIST",nestingLevel:Cn(["■","◆","○"])},BULLET_LIST_4:{listType:"BULLET_LIST",nestingLevel:Cn(["✧","○","■"])},BULLET_LIST_5:{listType:"BULLET_LIST",nestingLevel:Cn(["➢","○","◆"])},ORDER_LIST:{listType:"ORDER_LIST",nestingLevel:Rn([{glyphFormat:"%1.",glyphType:de.DECIMAL},{glyphFormat:"%2.",glyphType:de.LOWER_LETTER},{glyphFormat:"%3.",glyphType:de.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:de.DECIMAL},{glyphFormat:"%5.",glyphType:de.LOWER_LETTER},{glyphFormat:"%6.",glyphType:de.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:de.DECIMAL},{glyphFormat:"%8.",glyphType:de.LOWER_LETTER},{glyphFormat:"%9.",glyphType:de.LOWER_ROMAN}])},ORDER_LIST_1:{listType:"ORDER_LIST",nestingLevel:Rn([{glyphFormat:"%1)",glyphType:de.DECIMAL},{glyphFormat:"%2)",glyphType:de.LOWER_LETTER},{glyphFormat:"%3)",glyphType:de.LOWER_ROMAN},{glyphFormat:"%4)",glyphType:de.DECIMAL},{glyphFormat:"%5)",glyphType:de.LOWER_LETTER},{glyphFormat:"%6)",glyphType:de.LOWER_ROMAN},{glyphFormat:"%7)",glyphType:de.DECIMAL},{glyphFormat:"%8)",glyphType:de.LOWER_LETTER},{glyphFormat:"%9)",glyphType:de.LOWER_ROMAN}])},ORDER_LIST_2:{listType:"ORDER_LIST",nestingLevel:Rn(["%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:de.DECIMAL})))},ORDER_LIST_3:{listType:"ORDER_LIST",nestingLevel:Rn([{glyphFormat:"%1.",glyphType:de.UPPER_LETTER},{glyphFormat:"%2.",glyphType:de.LOWER_LETTER},{glyphFormat:"%3.",glyphType:de.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:de.UPPER_LETTER},{glyphFormat:"%5.",glyphType:de.LOWER_LETTER},{glyphFormat:"%6.",glyphType:de.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:de.UPPER_LETTER},{glyphFormat:"%8.",glyphType:de.LOWER_LETTER},{glyphFormat:"%9.",glyphType:de.LOWER_ROMAN}])},ORDER_LIST_4:{listType:"ORDER_LIST",nestingLevel:Rn([{glyphFormat:"%1.",glyphType:de.UPPER_LETTER},{glyphFormat:"%2.",glyphType:de.DECIMAL},{glyphFormat:"%3.",glyphType:de.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:de.UPPER_LETTER},{glyphFormat:"%5.",glyphType:de.DECIMAL},{glyphFormat:"%6.",glyphType:de.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:de.UPPER_LETTER},{glyphFormat:"%8.",glyphType:de.DECIMAL},{glyphFormat:"%9.",glyphType:de.LOWER_ROMAN}])},ORDER_LIST_5:{listType:"ORDER_LIST",nestingLevel:Rn([{glyphFormat:"%1.",glyphType:de.DECIMAL_ZERO},{glyphFormat:"%2.",glyphType:de.LOWER_LETTER},{glyphFormat:"%3.",glyphType:de.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:de.DECIMAL_ZERO},{glyphFormat:"%5.",glyphType:de.LOWER_LETTER},{glyphFormat:"%6.",glyphType:de.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:de.DECIMAL_ZERO},{glyphFormat:"%8.",glyphType:de.LOWER_LETTER},{glyphFormat:"%9.",glyphType:de.LOWER_ROMAN}])},CHECK_LIST:{listType:"CHECK_LIST",nestingLevel:zl("☐")},CHECK_LIST_CHECKED:{listType:"CHECK_LIST_CHECKED",nestingLevel:zl("☑",{st:{s:Re.TRUE}})}},jr=e=>{const{glyphFormat:n,glyphType:t}=e,r=W.deepClone(Xn.ORDER_LIST);return r.nestingLevel[0].glyphFormat=n,r.nestingLevel[0].glyphType=t,r},x_={ORDER_LIST_QUICK_2:jr(Br["a)"]),ORDER_LIST_QUICK_3:jr(Br["a."]),ORDER_LIST_QUICK_4:jr(Br["i."]),ORDER_LIST_QUICK_6:jr(Br["I."])};Object.assign(Xn,x_);const H_={"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 $r(e,n=!1){const t=[];for(const r of e){const{st:s,ed:i,ts:o}=r;if(r.sId===void 0&&delete r.sId,s===i||!n&&W.isEmptyObject(o)&&r.sId==null)continue;if(t.length===0){t.push(r);continue}const a=t.pop();Ka(r,a)&&W.hasIntersectionBetweenTwoRanges(a.st,a.ed,r.st,r.ed)?t.push({...r,st:a.st,ed:i}):t.push(a,r)}return t}function Gl(e,n,t,r){var c;const{textRuns:s}=e;if(s==null)return;const i=[],o=s.length;let a=!1;const l=(c=n.textRuns)!=null?c:[];if(l.length)for(const u of l)u.st+=r,u.ed+=r;for(let u=0;u<o;u++){const h=s[u],{st:f,ed:g}=h;if(g<=r)i.push(h);else if(r>f&&r<g){a=!0;const E={...h,ed:r};i.push(E),l.length&&i.push(...l);const I={...h,st:r+t,ed:g+t};i.push(I)}else h.st+=t,h.ed+=t,a||(a=!0,i.push(...l)),i.push(h)}a||(a=!0,i.push(...l)),e.textRuns=$r(i)}function Kl(e,n,t,r){const{paragraphs:s}=e;if(s==null)return;const{paragraphs:i}=n,o=[];for(let l=0,c=s.length;l<c;l++){const u=s[l],{startIndex:h}=u;h>=r&&(u.startIndex+=t),o.push(u.startIndex)}let a=-1;if(i){for(let l=0,c=i.length;l<c;l++){const u=i[l];u.startIndex+=r;const h=u.startIndex;a=o.indexOf(h)}a!==-1&&s.splice(a,1),s.push(...i),s.sort(Gn("startIndex"))}}function Yl(e,n,t,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+=t)}const i=n.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(Gn("startIndex"))}}function Xl(e,n,t,r){const{customBlocks: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+=t)}const i=n.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(Gn("startIndex"))}}function Ql(e,n,t,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:u}=l;c>r?(l.startIndex+=t,l.endIndex+=t):u>r&&(l.endIndex+=t)}const i=n.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(Gn("startIndex"))}}const Jl="$",Zl=e=>e.split(Jl)[0];function oi(e){if(e.length<=1)return e;e.sort((s,i)=>s.startIndex-i.startIndex);const n=[];let t={...e[0]};t.rangeId=Zl(t.rangeId);for(let s=1;s<e.length;s++){const i=e[s];i.rangeId=Zl(i.rangeId),i.rangeId===t.rangeId&&ta(t.properties,i.properties)&&t.endIndex+1>=i.startIndex?t.endIndex=i.endIndex:(n.push(t),t={...i})}n.push(t);const r=Object.create(null);for(let s=0,i=n.length;s<i;s++){const o=n[s],a=o.rangeId;r[a]?(o.rangeId=`${a}${Jl}${r[a]}`,r[a]=r[a]+1):r[a]=1}return n}function ai(e,n){const t=e.findIndex(s=>s.startIndex<n&&s.endIndex>=n),r=e[t];r&&e.splice(t,1,{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:r.startIndex,endIndex:n-1,properties:{...r.properties}},{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:n,endIndex:r.endIndex,properties:{...r.properties}})}function ql(e){if(e.length<=1)return e;e.sort((r,s)=>r.startIndex-s.startIndex);const n=[];let t={...e[0]};for(let r=1;r<e.length;r++){const s=e[r];s.id===t.id&&t.endIndex+1>=s.startIndex?t.endIndex=s.endIndex:(n.push(t),t={...s})}return n.push(t),n}function li(e,n){e.filter(r=>r.startIndex<n&&r.endIndex>=n).forEach(r=>{const s=e.indexOf(r);e.splice(s,1,{id:r.id,type:r.type,startIndex:r.startIndex,endIndex:n-1},{id:r.id,type:r.type,startIndex:n,endIndex:r.endIndex})})}function B_(e,n,t,r){e.customRanges||(e.customRanges=[]);const{customRanges:s}=e;ai(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=t,l.endIndex+=t)}const i=[];if(n.customRanges){for(let o=0,a=n.customRanges.length;o<a;o++){const l=n.customRanges[o];l.startIndex+=r,l.endIndex+=r,i.push(l)}s.push(...i)}e.customRanges=oi(s)}function j_(e,n,t,r){e.customDecorations||(e.customDecorations=[]);const{customDecorations:s}=e;li(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=t,l.endIndex+=t)}const i=[];if(n.customDecorations){for(let o=0,a=n.customDecorations.length;o<a;o++){const l=n.customDecorations[o];l.startIndex+=r,l.endIndex+=r,i.push(l)}s.push(...i)}e.customDecorations=ql(s)}function ec(e,n,t){const{textRuns:r}=e,s=t,i=t+n,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{st:h,ed:f}=u;if(s<=h&&i>=f){o.push({...u,st:h-s,ed:f-s});continue}else h<=s&&f>=i?(o.push({...u,st:s-s,ed:i-s}),u.ed-=n):s>=h&&s<f?(o.push({...u,st:s-s,ed:f-s}),u.ed=s):i>h&&i<=f?(o.push({...u,st:h-s,ed:i-s}),u.st=i-n,u.ed-=n):h>=i&&(u.st-=n,u.ed-=n);a.push(u)}e.textRuns=a}return o.length===0&&o.push({st:0,ed:n,ts:{}}),o}function tc(e,n,t){const{paragraphs:r}=e,s=t,i=t+n,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{startIndex:h}=u;if(h>=s&&h<i){o.push({...u,startIndex:h-t});continue}else h>=i&&(u.startIndex-=n);a.push(u)}e.paragraphs=a}return o}function nc(e,n,t){const{sectionBreaks:r}=e,s=t,i=t+n-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{startIndex:h}=u;if(h>=s&&h<=i){o.push({...u,startIndex:h-t});continue}else h>i&&(u.startIndex-=n);a.push(u)}e.sectionBreaks=a}return o}function rc(e,n,t){const{customBlocks:r}=e,s=t,i=t+n-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{startIndex:h}=u;if(h>=s&&h<=i){o.push({...u,startIndex:h-t});continue}else h>i&&(u.startIndex-=n);a.push(u)}e.customBlocks=a}return o}function sc(e,n,t){const{tables:r}=e,s=t,i=t+n-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{startIndex:h,endIndex:f}=u;if(s<=h&&i>=f){o.push({...u,startIndex:h-t,endIndex:f-t});continue}else if(h<=s&&f>=i){const g=Ur(h,f,s,i);if(u.startIndex=g[0],u.endIndex=g[1],u.startIndex===u.endIndex)continue}else i<h&&(u.startIndex-=n,u.endIndex-=n);a.push(u)}e.tables=a}return o}function $_(e,n,t){const{customRanges:r}=e,s=t,i=t+n-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{startIndex:h,endIndex:f}=u;if(h>=s&&f<=i){o.push(u);continue}else if(Math.max(s,h)<=Math.min(i,f)){const g=Ur(h,f,s,i);u.startIndex=g[0],u.endIndex=g[1]}else i<h&&(u.startIndex-=n,u.endIndex-=n);a.push(u)}e.customRanges=oi(a)}return o}function W_(e,n,t,r=!0){const{customDecorations:s}=e,i=t,o=t+n-1,a=[];if(s){const l=[];for(let c=0,u=s.length;c<u;c++){const h=s[c],{startIndex:f,endIndex:g}=h;if(f>=i&&g<=o){a.push(h);continue}else if(Math.max(i,f)<=Math.min(o,g)){const E=Ur(f,g,i,o);h.startIndex=E[0],h.endIndex=E[1]}else o<f&&r&&(h.startIndex-=n,h.endIndex-=n);l.push(h)}e.customDecorations=l}return a}function V_(e,n,t,r,s){const i=z_(e,n,t,r,s),o=G_(e,n,t,r,s),a=K_(e,n,t,r,s),l=Y_(e,n,t,r,s),c=X_(e,n,t,r,s),u=Q_(e,n,t,r),h=J_(e,n,t,r,s);return{dataStream:"",textRuns:i,paragraphs:o,sectionBreaks:a,customBlocks:l,tables:c,customRanges:u,customDecorations:h}}function z_(e,n,t,r,s){const{textRuns:i}=e,{textRuns:o}=n;if(i==null||o==null)return;const a=ec(e,t,r);if(s!==Ie.REPLACE){const l=ic(o,a,s);n.textRuns=l}return Gl(e,n,t,r),a}function ic(e,n,t){if(n.length===0)return e;e=W.deepClone(e),n=W.deepClone(n);const r=[],s=e.length,i=n.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:g,ed:E,ts:I}=e[o],{st:M,ed:O,ts:P,sId:$}=n[a];let z;if(t===Ie.COVER?z={...P,...I}:z={...I},E<M)c()||r.push(e[o]),o++;else if(O<g)c()||r.push(n[a]),a++;else{const w={st:Math.min(g,M),ed:Math.max(g,M),ts:g<M?{...I}:{...P},sId:g<M?void 0:$};w.ed>w.st&&r.push(w),r.push({st:Math.max(g,M),ed:Math.min(E,O),ts:z,sId:$}),E<O?(o++,n[a].st=E,n[a].st===n[a].ed&&a++):(a++,e[o].st=O,e[o].st===e[o].ed&&o++);const b={st:Math.min(E,O),ed:Math.max(E,O),ts:E<O?{...P}:{...I},sId:E<O?$:void 0};l=b.ed>b.st?b:null}}c();const u=r[r.length-1],h=e[s-1],f=n[i-1];return u&&u.ed!==Math.max(h.ed,f.ed)&&(h.ed>f.ed?r.push(h):r.push(f)),$r(r)}function G_(e,n,t,r,s){const{paragraphs:i}=e,{paragraphs:o}=n;if(i==null||o==null)return;const a=tc(e,t,r);if(s!==Ie.REPLACE){const l=[];for(const c of o){const{startIndex:u,paragraphStyle:h,bullet:f}=c;let g=[];for(const E of a){const{startIndex:I,paragraphStyle:M,bullet:O}=E;let P,$;if(s===Ie.COVER?(P={...M,...h},$={listId:"",listType:Nt.BULLET_LIST,nestingLevel:0,textStyle:{},...O,...f}):(P={...h,...M},$={listId:"",listType:Nt.BULLET_LIST,nestingLevel:0,textStyle:{},...f,...O}),u===I){g.push({startIndex:u,paragraphStyle:P,bullet:$});break}}l.push(...g),g=[]}n.paragraphs=l}return Kl(e,n,t,r),a}function K_(e,n,t,r,s){const{sectionBreaks:i}=e,{sectionBreaks:o}=n;if(i==null||o==null)return;const a=nc(e,t,r);if(s!==Ie.REPLACE){const l=[];for(const c of o){const{startIndex:u}=c;let h=[];for(const f of a){const{startIndex:g}=f;if(u===g){s===Ie.COVER?h.push({...f,...c}):h.push({...c,...f});break}}l.push(...h),h=[]}n.sectionBreaks=l}return Yl(e,n,t,r),a}function Y_(e,n,t,r,s){const{customBlocks:i}=e,{customBlocks:o}=n;if(i==null||o==null)return;const a=rc(e,t,r);if(s!==Ie.REPLACE){const l=[];for(const c of o){const{startIndex:u}=c;let h=[];for(const f of a){const{startIndex:g}=f;if(u===g){s===Ie.COVER?h.push({...f,...c}):h.push({...c,...f});break}}l.push(...h),h=[]}n.customBlocks=l}return Xl(e,n,t,r),a}function X_(e,n,t,r,s){const{tables:i}=e,{tables:o}=n;if(i==null||o==null)return;const a=sc(e,t,r);if(s!==Ie.REPLACE){const l=[];for(const c of o){const{startIndex:u,endIndex:h}=c;let f=[];for(const g of a){const{startIndex:E,endIndex:I}=g;if(E>=u&&I<=h){s===Ie.COVER?f.push({...g,...c}):f.push({...c,...g});break}}l.push(...f),f=[]}n.tables=l}return Ql(e,n,t,r),a}function Q_(e,n,t,r,s){e.customRanges||(e.customRanges=[]),ai(e.customRanges,r),ai(e.customRanges,r+t);const i=r,o=r+t-1,{customRanges:a}=n,l=[],c=new Map;e.customRanges.forEach(h=>{const{startIndex:f,endIndex:g}=h;f>=i&&g<=o?c.set(h.rangeId,h):l.push(h)});const u=[];return a?(a.forEach(h=>{const{startIndex:f,endIndex:g}=h;l.push({...h,startIndex:f+r,endIndex:g+r})}),e.customRanges=oi(l),u):[]}function J_(e,n,t,r,s){e.customDecorations||(e.customDecorations=[]),li(e.customDecorations,r),li(e.customDecorations,r+t);const i=[],{customDecorations:o}=e,{customDecorations:a=[]}=n;if(s===Ie.REPLACE){for(let l=0;l<o.length;l++){const c=o[l],{startIndex:u,endIndex:h}=c;u>=r&&h<=r+t-1&&i.push(c)}a.forEach(l=>{const{startIndex:c,endIndex:u}=l;o.push({...l,startIndex:c+r,endIndex:u+r})})}else for(const l of a){const{id:c}=l;if(l.type===pn.DELETED){const u=o.filter(h=>h.id===c);u.length&&i.push(...u)}else o.push({...l,startIndex:l.startIndex+r,endIndex:l.endIndex+r})}for(const l of i){const{id:c}=l,u=o.findIndex(h=>h.id===c);u!==-1&&o.splice(u,1)}return e.customDecorations=ql(o),i}var ci=(e=>(e[e.copy=0]="copy",e[e.cut=1]="cut",e))(ci||{});function zt(e,n,t,r=!0,s=1){const{dataStream:i,textRuns:o,paragraphs:a=[],customBlocks:l=[],tables:c=[],sectionBreaks:u=[]}=e,h={dataStream:i.slice(n,t)};if(o){const O=[];for(const P of o){const $=W.deepClone(P),{st:z,ed:w}=$;W.hasIntersectionBetweenTwoRanges(z,w,n,t)&&(n>=z&&n<=w?O.push({...$,st:n,ed:Math.min(t,w)}):t>=z&&t<=w?O.push({...$,st:Math.max(n,z),ed:t}):O.push($))}h.textRuns=O.map(P=>{const{st:$,ed:z}=P;return{...P,st:$-n,ed:z-n}})}else r&&(h.textRuns=[{st:0,ed:t-n,ts:{}}]);const f=[];for(const O of c){const P=W.deepClone(O),{startIndex:$,endIndex:z}=P;$>=n&&z<=t&&f.push({...P,startIndex:$-n,endIndex:z-n})}f.length&&(h.tables=f);const g=[];for(const O of a){const{startIndex:P}=O;P>=n&&P<t&&g.push(W.deepClone(O))}g.length&&(h.paragraphs=g.map(O=>({...O,startIndex:O.startIndex-n})));const E=[];for(const O of u){const{startIndex:P}=O;P>=n&&P<=t&&E.push(W.deepClone(O))}if(E.length&&(h.sectionBreaks=E.map(O=>({...O,startIndex:O.startIndex-n}))),s===1){const O=ac(e,n,t);O?h.customDecorations=O:r&&(h.customDecorations=[])}const{customRanges:I}=oc(e,n,t);I?h.customRanges=I:r&&(h.customRanges=[]);const M=[];for(const O of l){const{startIndex:P}=O;P>=n&&P<=t&&M.push(W.deepClone(O))}return M.length&&(h.customBlocks=M.map(O=>({...O,startIndex:O.startIndex-n}))),h}function Z_(e){const{dataStream:n,textRuns:t,paragraphs:r,customRanges:s,customDecorations:i,tables:o}=e;let a=0,l=0;s==null||s.forEach(u=>{u.startIndex<0&&(a=Math.max(a,-u.startIndex)),u.endIndex>n.length-1&&(l=Math.max(l,u.endIndex-n.length+1))});const c=`${n}`;return t&&(t[0]&&(t[0].st=t[0].st-a),t[t.length-1]&&(t[t.length-1].ed=t[t.length-1].ed+l)),t==null||t.forEach(u=>{u.st+=a,u.ed+=a}),r==null||r.forEach(u=>{u.startIndex+=a}),s==null||s.forEach(u=>{u.startIndex+=a,u.endIndex+=a}),i==null||i.forEach(u=>{u.startIndex+=a,u.endIndex+=l}),o==null||o.forEach(u=>{u.startIndex+=a,u.endIndex+=l}),{...e,dataStream:c,textRuns:t,paragraphs:r,customRanges:s,customDecorations:i,tables:o}}function oc(e,n,t){if(e.customRanges==null)return{};const{customRanges:r}=e;return{customRanges:r.filter(a=>Math.max(a.startIndex,n)<=Math.min(a.endIndex,t-1)).map(a=>({...a,startIndex:Math.max(a.startIndex,n),endIndex:Math.min(a.endIndex,t-1)})).map(a=>({...a,startIndex:a.startIndex-n,endIndex:a.endIndex-n})),leftOffset:0,rightOffset:0}}function ac(e,n,t){if(e.customDecorations==null)return;const{customDecorations:r=[]}=e,s=[];return r.forEach(i=>{if(Math.max(i.startIndex,n)<=Math.min(i.endIndex,t-1)){const o=W.deepClone(i);s.push({...o,startIndex:Math.max(o.startIndex-n,0),endIndex:Math.min(o.endIndex,t-1)-n})}}),s}function q_(e,n,t){return e==null||n==null?e!=null?e:n:ic(e,n,t)}function ep(e,n,t){if(e==null||n==null)return e!=null?e:n;if(n.length===0||e.length===0)return e;if(n.length>1||e.length>1)throw new Error("Cannot cover multiple customRanges");return t===Ie.REPLACE?[{...e[0]}]:[{...n[0],...e[0]}]}function tp(e,n,t){return n.length===0||e.length===0||t===Ie.REPLACE?e:[...e,...n.filter(r=>!e.some(s=>r.id===s.id))]}function ui(e,n,t=Ie.COVER){if(n.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:u,customDecorations:h=[]}=n;r.textRuns=q_(l,s,t),r.customRanges=ep(u,o,t);const f=tp(h,a,t);f.length&&(r.customDecorations=f);const g=[];let E=0,I=0;for(;E<i.length&&I<c.length;){const M=i[E],O=c[I],{startIndex:P}=M,{startIndex:$}=O;P===$?(g.push(W.deepMerge(M,O)),E++,I++):P<$?(g.push(W.deepClone(M)),E++):(g.push(W.deepClone(O)),I++)}return E<i.length&&g.push(...i.slice(E)),I<c.length&&g.push(...c.slice(I)),g.length&&(r.paragraphs=g),r}function np(e){const{body:n}=e;if(n==null)return!0;const{textRuns:t,paragraphs:r,customRanges:s,customBlocks:i,customDecorations:o,tables:a}=n;return t==null&&r==null&&s==null&&i==null&&o==null&&a==null}class In{constructor(n){R(this,"_index",0);R(this,"_offset",0);this._actions=n}hasNext(){return this.peekLength()<Number.POSITIVE_INFINITY}next(n){n||(n=Number.POSITIVE_INFINITY);const t=this._actions[this._index];if(t){const r=this._offset,s=t.len;return n>=s-r?(n=s-r,this._index+=1,this._offset=0):this._offset+=n,t.t===te.DELETE||t.t===te.RETAIN&&t.body==null?W.deepClone({...t,len:n}):W.deepClone({...t,len:n,body:zt(t.body,r,r+n,!1)})}else return{t:te.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 n=this._actions[this._index];return n?n.t:te.RETAIN}rest(){if(this.hasNext()){if(this._offset===0)return this._actions.slice(this._index);{const n=this._offset,t=this._index,r=this.next(),s=this._actions.slice(this._index);return this._offset=n,this._index=t,[r].concat(s)}}else return[]}}function lc(e,n,t){const{dataStream:r}=e,s=t,i=t+n,o=ec(e,n,t),a=tc(e,n,t),l=nc(e,n,t),c=rc(e,n,t),u=sc(e,n,t),h=$_(e,n,t),f=W_(e,n,t);let g="";return r&&(e.dataStream=Qa(r,s,i),g=r.slice(s,i)),{dataStream:g,textRuns:o,paragraphs:a,sectionBreaks:l,customBlocks:c,tables:u,customRanges:h,customDecorations:f}}function cc(e,n,t,r){e.dataStream=Xa(e.dataStream,r,n.dataStream),Gl(e,n,t,r),Kl(e,n,t,r),Yl(e,n,t,r),Xl(e,n,t,r),Ql(e,n,t,r),B_(e,n,t,r),j_(e,n,t,r)}function rp(e,n,t,r,s=Ie.COVER){return V_(e,n,t,r,s)}function sp(e,n,t){return n<=0?{dataStream:""}:lc(e,n,t)}function ip(e,n,t,r){t!==0&&cc(e,n,t,r)}function op(e,n){const t=new mn;return t.reset(),n.forEach(r=>{const s=W.deepClone(r);switch(s.t){case te.RETAIN:{const{coverType:i,body:o,len:a}=s;o!=null&&rp(e,o,a,t.cursor,i),t.moveCursor(a);break}case te.INSERT:{const{body:i,len:o}=s;ip(e,i,o,t.cursor),t.moveCursor(o);break}case te.DELETE:{const{len:i}=s;sp(e,i,t.cursor);break}default:throw new Error(`Unknown action type for action: ${s}.`)}}),e}function ap(e,n,t,r,s){if(e==null||n==null)return n;if(e.length===0||n.length===0)return[];n=W.deepClone(n),e=W.deepClone(e);const i=[],o=n.length,a=e.length;let l=0,c=0,u=null;function h(){return u?(i.push(u),u=null,!0):!1}for(;l<o&&c<a;){const{st:I,ed:M,ts:O}=n[l],{st:P,ed:$,ts:z,sId:w}=e[c];let b={};if(s===0)b={...O},t===Ie.COVER&&r===Ie.REPLACE&&z&&(b=Object.assign({},z,b));else if(b={...O},t===Ie.REPLACE){if(r===Ie.REPLACE)b={...z};else if(O&&z){const D=Object.keys(O);for(const G of D)z[G]&&delete b[G]}}else if(r===Ie.REPLACE){if(z){const D=Object.keys(z);for(const G of D)z[G]!==void 0&&(b[G]=z[G])}}else if(z){const D=Object.keys(z);for(const G of D)b[G]!==void 0&&delete b[G]}if(M<P)h()||i.push(n[l]),l++;else if($<I)h()||i.push(e[c]),c++;else{const D={st:Math.min(I,P),ed:Math.max(I,P),ts:I<P?{...O}:{...z},sId:I<P?void 0:w};D.ed>D.st&&i.push(),i.push({st:Math.max(I,P),ed:Math.min(M,$),ts:b,sId:w}),M<$?(l++,e[c].st=M,e[c].st===e[c].ed&&c++):(c++,n[l].st=$,n[l].st===n[l].ed&&l++);const G={st:Math.min(M,$),ed:Math.max(M,$),ts:M<$?{...z}:{...O},sId:M<$?w:void 0};u=G.ed>G.st?G:null}}h();const f=i[i.length-1],g=n[o-1],E=e[a-1];return f.ed!==Math.max(g.ed,E.ed)&&(g.ed>E.ed?i.push(g):i.push(E)),$r(i,!0)}function lp(e,n,t,r,s){if(e==null||n==null)return n;if(e.length===0||n.length===0)return[];if(e.length>1||n.length>1)throw new Error("CustomRanges is only supported transform for length one now.");const i=e[0],o=n[0];if(t===Ie.REPLACE)return s===1?[W.deepClone(i)]:[W.deepClone(o)];if(r===Ie.REPLACE){const a=W.deepClone(o);return s===1&&Object.assign(a,W.deepClone(i)),[a]}else{const a=W.deepClone(o);return s===1&&Object.assign(a,W.deepClone(i)),[a]}}function uc(e,n,t,r,s){const i={startIndex:n.startIndex};if(n.paragraphStyle&&(i.paragraphStyle=W.deepClone(n.paragraphStyle),e.paragraphStyle)){if(t===Ie.REPLACE)if(r===Ie.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===Ie.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 t===Ie.REPLACE&&r===Ie.REPLACE?i.bullet=s===1?W.deepClone(e.bullet):W.deepClone(n.bullet):e.bullet===void 0?i.bullet=W.deepClone(n.bullet):t===Ie.REPLACE||r===Ie.REPLACE?i.bullet=s===0&&n.bullet?W.deepClone(n.bullet):W.deepClone(e.bullet):s===0&&n.bullet!==void 0&&(i.bullet=W.deepClone(n.bullet)),i}function cp(e,n){if(e==null||n==null)return n;if(e.length===0||n.length===0)return W.deepClone(n);const t=[];for(const r of n){const{id:s,type:i}=r;let o=!1;for(const a of e)if(a.id===s){(a.type===pn.DELETED||i===pn.DELETED)&&(o=!0,t.push({...r,type:pn.DELETED}));break}o||t.push(r)}return t}function up(e,n,t=!1){const{body:r,coverType:s=Ie.COVER}=e,{body:i,coverType:o=Ie.COVER}=n;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:u=[],customRanges:h,customDecorations:f}=r,{textRuns:g,paragraphs:E=[],customRanges:I,customDecorations:M}=i,O=ap(c,g,s,o,t?1:0);O&&(a.textRuns=O);const P=lp(h,I,s,o,t?1:0);P&&(a.customRanges=P);const $=cp(f,M);$&&(a.customDecorations=$);const z=[];let w=0,b=0;for(;w<u.length&&b<E.length;){const D=u[w],G=E[b],{startIndex:_e}=D,{startIndex:fe}=G;if(_e===fe){let ye={startIndex:_e};t?ye=uc(D,G,s,o,1):ye=uc(D,G,s,o,0),z.push(ye),w++,b++}else _e<fe?w++:(z.push(W.deepClone(G)),b++)}return b<E.length&&z.push(...E.slice(b)),z.length&&(a.paragraphs=z),{coverType:l,body:a}}function hc(e){return Object.keys(e).length===1}const bn=class bn{constructor(){R(this,"_actions",[])}static apply(n,t){return op(n,t)}static compose(n,t){const r=new In(n),s=new In(t),i=new bn;for(;r.hasNext()||s.hasNext();)if(s.peekType()===te.INSERT)i.push(s.next());else if(r.peekType()===te.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===te.INSERT&&l.t===te.RETAIN)l.body==null?i.push(a):i.push({...a,body:ui(a.body,l.body,l.coverType)});else if(a.t===te.RETAIN&&l.t===te.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===Ie.REPLACE||l.coverType===Ie.REPLACE?Ie.REPLACE:Ie.COVER;i.push({...a,t:te.RETAIN,coverType:c,body:ui(a.body,l.body,l.coverType)})}else i.push(a.body?a:l);else a.t===te.RETAIN&&l.t===te.DELETE?i.push(l):a.t===te.INSERT&&(l.t,te.DELETE)}return i.trimEndUselessRetainAction(),i.serialize()}static transform(n,t,r="right"){return this._transform(t,n,r==="left"?"right":"left")}static _transform(n,t,r="right"){const s=new In(n),i=new In(t),o=new bn;for(;s.hasNext()||i.hasNext();)if(s.peekType()===te.INSERT&&(r==="left"||i.peekType()!==te.INSERT)){const a=s.next();o.retain(a.len)}else if(i.peekType()===te.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===te.DELETE)continue;if(c.t===te.DELETE){o.push(c);continue}if(l.body==null||c.body==null)o.push(c);else{const{coverType:u,body:h}=up(l,c,r==="left");o.push({...c,t:te.RETAIN,coverType:u,body:h})}}return o.trimEndUselessRetainAction(),o.serialize()}static transformPosition(n,t,r=!1){const s=new In(n);let i=0;for(;s.hasNext()&&i<=t;){const o=s.peekLength(),a=s.peekType();if(s.next(),a===te.DELETE){t-=Math.min(o,t-i);continue}else a===te.INSERT&&(i<t||!r)&&(t+=o);i+=o}return t}static isNoop(n){return n.length===0}static invert(n){const t=[];for(const r of n)if(r.t===te.INSERT)t.push({t:te.DELETE,len:r.len,body:r.body});else if(r.t===te.DELETE){if(r.body==null)throw new Error("Can not invert DELETE action without body property, makeInvertible must be called first.");t.push({t:te.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.");t.push({t:te.RETAIN,body:r.oldBody,oldBody:r.body,len:r.len,coverType:Ie.REPLACE})}else t.push(r);return t}static makeInvertible(n,t){const r=[];let s=0;for(const i of n){if(i.t===te.DELETE&&i.body==null){const o=zt(t,s,s+i.len,!1);i.len=o.dataStream.length,i.body=o}if(i.t===te.RETAIN&&i.body!=null){const o=zt(t,s,s+i.len,!0);i.oldBody={...o,dataStream:""},i.len=o.dataStream.length}r.push(i),i.t!==te.INSERT&&(s+=i.len)}return r}insert(n,t){const r={t:te.INSERT,body:t,len:n};return this.push(r),this}retain(n,t,r){const s={t:te.RETAIN,len:n};return t!=null&&(s.body=t),r!=null&&(s.coverType=r),this.push(s),this}delete(n){const t={t:te.DELETE,len:n};return this.push(t),this}empty(){return this._actions=[],this}serialize(){return this._actions}push(...n){if(n.length>1){for(const i of n)this.push(i);return this}let t=this._actions.length,r=this._actions[t-1];const s=W.deepClone(n[0]);if(s.t===te.RETAIN&&s.len===0&&s.body==null)return this;if(typeof r=="object"){if(r.t===te.DELETE&&s.t===te.DELETE)return r.len+=s.len,this;if(r.t===te.DELETE&&s.t===te.INSERT&&(t-=1,r=this._actions[t-1],r==null))return this._actions.unshift(s),this;if(r.t===te.RETAIN&&s.t===te.RETAIN&&r.body==null&&s.body==null)return r.len+=s.len,this;if(r.t===te.INSERT&&hc(r.body)&&s.t===te.INSERT&&hc(s.body))return r.len+=s.len,r.body.dataStream+=s.body.dataStream,this}return t===this._actions.length?this._actions.push(s):this._actions.splice(t,0,s),this}trimEndUselessRetainAction(){let n=this._actions[this._actions.length-1];for(;n&&n.t===te.RETAIN&&np(n);)this._actions.pop(),n=this._actions[this._actions.length-1];return this}};R(bn,"id","text-x"),R(bn,"uri","https://github.com/dream-num/univer#text-x");let Je=bn;Object.defineProperty(Je,"name",{value:"text-x"});const yn=class yn{static registerSubtype(n){var t;n==null||this._subTypes.has(n.name)&&((t=this._subTypes.get(n.name))==null?void 0:t.id)!==Je.id||(this._subTypes.set(n.name,n),it.type.registerSubtype(n))}static apply(n,t){if(!it.type.isNoop(t))return it.type.apply(n,t)}static compose(n,t){return it.type.compose(n,t)}static transform(n,t,r){return it.type.transform(n,t,r)}static transformPosition(n,t,r="right"){return n&&n.length===2&&n[0]==="body"&&n[1].et===Je.name?Je.transformPosition(n[1].e,t,r==="left"):t}static invertWithDoc(n,t){return it.type.invertWithDoc(n,t)}static isNoop(n){return it.type.isNoop(n)}static getInstance(){return this._instance==null&&(this._instance=new yn),this._instance}removeOp(n,t){return it.removeOp(n,t)}moveOp(n,t){return it.moveOp(n,t)}insertOp(n,t){return it.insertOp(n,t)}replaceOp(n,t,r){return it.replaceOp(n,t,r)}editOp(n,t=["body"]){return it.editOp(t,Je.name,n)}};R(yn,"uri","https://github.com/dream-num/univer#json-x"),R(yn,"_subTypes",new Map),R(yn,"_instance",null);let rn=yn;rn.registerSubtype(Je);const hi={id:"default_doc",documentStyle:{}};class hp extends xr{constructor(t){var r;super();R(this,"type",we.UNIVER_DOC);R(this,"_name$",new re.BehaviorSubject(""));R(this,"name$",this._name$.asObservable());R(this,"snapshot");this.snapshot={...hi,...t},this._name$.next((r=this.snapshot.title)!=null?r:"No Title")}getUnitId(){throw new Error("Method not implemented.")}getRev(){var t;return(t=this.snapshot.rev)!=null?t:1}incrementRev(){this.snapshot.rev=this.getRev()+1}setRev(t){this.snapshot.rev=t}setName(t){this.snapshot.title=t,this._name$.next(t)}get drawings(){return this.snapshot.drawings}get documentStyle(){return this.snapshot.documentStyle}get lists(){return this.snapshot.lists}get zoomRatio(){var t;return((t=this.snapshot.settings)==null?void 0:t.zoomRatio)||1}resetDrawing(t,r){this.snapshot.drawings=t,this.snapshot.drawingsOrder=r}getBody(){return this.snapshot.body}getSnapshot(){return this.snapshot}getBulletPresetList(){var s;const t=(s=this.snapshot.lists)!=null?s:{};return{...Xn,...t}}updateDocumentId(t){this.snapshot.id=t}updateDocumentRenderConfig(t){const{documentStyle:r}=this.snapshot;r.renderConfig==null?r.renderConfig=t:r.renderConfig={...r.renderConfig,...t}}updateDocumentStyle(t){this.snapshot.documentStyle==null?this.snapshot.documentStyle=t:this.snapshot.documentStyle={...this.snapshot.documentStyle,...t}}updateDocumentDataMargin(t){const{t:r,l:s,b:i,r:o}=t,{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(t,r){const{documentStyle:s}=this.snapshot;if(!s.pageSize){t=t!=null?t:Number.POSITIVE_INFINITY,r=r!=null?r:Number.POSITIVE_INFINITY,s.pageSize={width:t,height:r};return}t!==void 0&&(s.pageSize.width=t),r!==void 0&&(s.pageSize.height=r)}updateDrawing(t,r){const{drawings:s}=this,{width:i,height:o,left:a,top:l}=r,c=s==null?void 0:s[t];if(!c)return;const u=c.docTransform;u.size.width=i,u.size.height=o,u.positionH.posOffset=a,u.positionV.posOffset=l}setZoomRatio(t=1){this.snapshot.settings==null?this.snapshot.settings={zoomRatio:t}:this.snapshot.settings.zoomRatio=1}}class Ut extends hp{constructor(t){var s,i;super(W.isEmptyObject(t)?L_():t);R(this,"_unitId");R(this,"headerModelMap",new Map);R(this,"footerModelMap",new Map);const r=6;this._unitId=(s=this.snapshot.id)!=null?s:W.generateRandomId(r),this._initializeHeaderFooterModel(),this._name$.next((i=this.snapshot.title)!=null?i:"")}dispose(){super.dispose(),this.headerModelMap.forEach(t=>{t.dispose()}),this.footerModelMap.forEach(t=>{t.dispose()}),this._name$.complete()}getDrawings(){return this.snapshot.drawings}getDrawingsOrder(){return this.snapshot.drawingsOrder}getCustomRanges(){var t;return(t=this.snapshot.body)==null?void 0:t.customRanges}getCustomDecorations(){var t;return(t=this.snapshot.body)==null?void 0:t.customDecorations}getSettings(){return this.snapshot.settings}reset(t){if(t.id&&t.id!==this._unitId)throw new Error("Cannot reset a document model with a different unit id!");this.snapshot={...hi,...t},this._initializeHeaderFooterModel()}getSelfOrHeaderFooterModel(t){if(t!=null){if(this.headerModelMap.has(t))return this.headerModelMap.get(t);if(this.footerModelMap.has(t))return this.footerModelMap.get(t)}return this}getUnitId(){return this._unitId}apply(t){if(!rn.isNoop(t))return this.snapshot=rn.apply(this.snapshot,t),t!=null&&t.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(t,r,s=ci.copy){const i=this.getBody();if(i!=null)return zt(i,t,r,!1,s)}_initializeHeaderFooterModel(){const{headers:t,footers:r}=this.getSnapshot();if(t)for(const s in t){const i=t[s];this.headerModelMap.set(s,new Ut(i)),this.headerModelMap.get(s).updateDocumentId(this.getUnitId())}if(r)for(const s in r){const i=r[s];this.footerModelMap.set(s,new Ut(i)),this.footerModelMap.get(s).updateDocumentId(this.getUnitId())}}updateDocumentId(t){super.updateDocumentId(t),this._unitId=t}}const dp="0.5.0-alpha.0";function fp(e="",n=Wn.ZH_CN,t=""){return{id:e,sheetOrder:[],name:t,appVersion:dp,locale:n,styles:{},sheets:{},resources:[]}}class dc{constructor(n={}){R(this,"_styles");R(this,"_cacheMap",new Pr(1e5));this._styles=n,this._generateCacheMap()}each(n){return Object.entries(this._styles).forEach(n),this}search(n,t){if(this._cacheMap.has(t))return this._cacheMap.get(t);const r=this._getExistingStyleId(n);return r||"-1"}get(n){return typeof n!="string"?n:(n=String(n),this._styles[n])}add(n,t){const r=W.generateRandomId(6);return this._styles[r]=n,this._cacheMap.set(t,r),r}setValue(n){if(n==null)return;const t=JSON.stringify(n),r=this.search(n,t);return r!=="-1"?r:this.add(n,t)}toJSON(){return this._styles}getStyleByCell(n){let t;n&&W.isObject(n.s)?t=n.s:t=(n==null?void 0:n.s)&&this.get(n.s);const r=n==null?void 0:n.interceptorStyle;return r?{...t,...r}:t}_generateCacheMap(){const{_styles:n,_cacheMap:t}=this;for(const r in n){const s=JSON.stringify(n[r]);t.set(s,r)}}_getExistingStyleId(n){const{_styles:t}=this;for(const r in t)if(W.diffValue(t[r],n))return r;return null}}function fc(e,n,t,r){return e<=t&&n>=t||e>=t&&e<=r}function gp(e,n){const t=[];for(let r=0,s=n.length;r<s;r++){const i=n[r];e.collapsed?i.startIndex<e.startOffset&&e.startOffset<=i.endIndex&&t.push(i):fc(e.startOffset,e.endOffset-1,i.startIndex,i.endIndex)&&t.push(i)}return t}function mp(e){return{...W.deepClone(e),rangeId:en()}}function _p(e,n){const t=[];let r=e[0];for(const s of n)s<e[0]||s>e[1]||(r<s&&t.push([r,s-1]),r=s+1);return r<=e[1]&&t.push([r,e[1]]),t}function gc(e,n,t,r){const s=[];for(let i=0,o=t.length;i<o;i++){const a=t[i];if((r===void 0||a.rangeType===r)&&Math.max(a.startIndex,e)<=Math.min(a.endIndex,n)&&s.push({...a}),a.startIndex>n)break}return s}function pp(e,n){var i,o,a,l,c;const t=gc(e.startOffset,e.collapsed?e.startOffset:e.endOffset-1,(i=n.customRanges)!=null?i:[]),r=Math.min(e.startOffset,(a=(o=t[0])==null?void 0:o.startIndex)!=null?a:1/0),s=Math.max(e.endOffset,((c=(l=t[t.length-1])==null?void 0:l.endIndex)!=null?c:-1/0)+1);return{startOffset:r,endOffset:s,collapsed:r===s}}const Ep=e=>{var h,f,g;const{paragraphs:n,segmentId:t,document:r}=e;let s=e.listType;const i=(f=(h=r.getSelfOrHeaderFooterModel(t).getBody())==null?void 0:h.paragraphs)!=null?f:[],o=n.every(E=>{var I;return((I=E.bullet)==null?void 0:I.listType.indexOf(s))===0});let l=W.generateRandomId(6);if(n.length===1){const E=i.indexOf(n[0]),I=i[E-1],M=i[E+1];I&&I.bullet&&I.bullet.listType.indexOf(s)===0?(l=I.bullet.listId,s!==Nt.CHECK_LIST&&(s=I.bullet.listType)):M&&M.bullet&&M.bullet.listType.indexOf(s)===0&&(l=M.bullet.listId,s!==Nt.CHECK_LIST&&(s=M.bullet.listType))}const c=new mn;c.reset();const u=new Je;for(const E of n){const{startIndex:I,paragraphStyle:M={},bullet:O}=E;u.push({t:te.RETAIN,len:I-c.cursor}),u.push({t:te.RETAIN,len:1,body:{dataStream:"",paragraphs:[o?{paragraphStyle:M,startIndex:0}:{startIndex:0,paragraphStyle:{...M},bullet:{nestingLevel:(g=O==null?void 0:O.nestingLevel)!=null?g:0,textStyle:{fs:20},listType:s,listId:l}}]},coverType:Ie.REPLACE}),c.moveCursorTo(I+1)}return u},Cp=e=>{var h;const{paragraphIndex:n,segmentId:t,document:r}=e,s=(h=r.getSelfOrHeaderFooterModel(t).getBody())==null?void 0:h.paragraphs;if(s==null)return!1;const i=s.find(f=>f.startIndex===n);if(!(i!=null&&i.bullet)||i.bullet.listType.indexOf(Nt.CHECK_LIST)===-1)return!1;const o=new mn;o.reset();const a=new Je,{startIndex:l,paragraphStyle:c={}}=i,u=i.bullet.listType===Nt.CHECK_LIST?Nt.CHECK_LIST_CHECKED:Nt.CHECK_LIST;return a.push({t:te.RETAIN,len:l-o.cursor}),a.push({t:te.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...i,paragraphStyle:c,startIndex:0,bullet:{...i.bullet,listType:u}}]},coverType:Ie.REPLACE}),o.moveCursorTo(l+1),a},Rp=e=>{var u,h;const{paragraphs:n,listType:t,segmentId:r,document:s}=e;if(((u=s.getSelfOrHeaderFooterModel(r).getBody())==null?void 0:u.paragraphs)==null)return!1;const a=W.generateRandomId(6),l=new mn;l.reset();const c=new Je;for(const f of n){const{startIndex:g,paragraphStyle:E={},bullet:I}=f;c.push({t:te.RETAIN,len:g-l.cursor}),c.push({t:te.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:E,bullet:{nestingLevel:(h=I==null?void 0:I.nestingLevel)!=null?h:0,textStyle:(I==null?void 0:I.listType)===t?I.textStyle:{fs:20},listType:t,listId:a}}]},coverType:Ie.REPLACE}),l.moveCursorTo(g+1)}return c};function Ip(e,n){return n.some(t=>e.startIndex>t.startIndex&&e.startIndex<t.endIndex)}const vp=e=>{var u,h,f;const{paragraphs:n,segmentId:t,document:r,type:s}=e,i=new mn;i.reset();const o=new Je,a=(u=r.getSnapshot().lists)!=null?u:{},l=(f=(h=r.getBody())==null?void 0:h.tables)!=null?f:[],c={...Xn,...a};for(const g of n){const{startIndex:E,paragraphStyle:I={},bullet:M}=g,O=Ip(g,l);if(o.push({t:te.RETAIN,len:E-i.cursor}),M){const P=M.listType;let $=c[P].nestingLevel.length-1;O&&($=Math.min($,2)),o.push({t:te.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:{...I},bullet:{...M,nestingLevel:Math.max(Math.min(M.nestingLevel+s,$),0)}}]},coverType:Ie.REPLACE})}else o.push({t:te.RETAIN,len:1});i.moveCursorTo(E+1)}return o};var mc=(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))(mc||{}),Pt=(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))(Pt||{});function Sp(e){return`${e}`}const Op=[Pt.TABLE_START,Pt.TABLE_ROW_START,Pt.TABLE_CELL_START,Pt.TABLE_CELL_END,Pt.TABLE_ROW_END,Pt.TABLE_END,Pt.CUSTOM_BLOCK],_c=e=>{const n=e.endsWith(`\r
10
- `)?e.slice(0,-2):e;return Op.reduce((t,r)=>t.replaceAll(r,""),n)},bp=e=>e?_c(e).replaceAll("\r","")==="":!0,yp=e=>{const n=e.replace(/\n/g,"\r"),t=[],r=[];let s=0,i="";const o=(l,c=!0)=>{const u=n.slice(s,l);if(W.isLegalUrl(u)){const h=en(),f=`${u}`,g={startIndex:s,endIndex:s+f.length-1,rangeId:h,rangeType:Yn.HYPERLINK,properties:{url:e}};r.push(g),i+=f,s=l+1,c&&(i+="\r",t.push({startIndex:l}))}else i+=n.slice(s,l+1),s=l+1,c&&t.push({startIndex:l})};let a=0;for(let l=0;l<n.length;l++)n[l]==="\r"&&(o(l),a=l);return a!==n.length-1&&o(n.length,!1),{dataStream:i,paragraphs:t,customRanges:r}};function wp(e,n){if(typeof n>"u")return{startOffset:e,endOffset:e,collapsed:!0};if(n<e)throw new Error(`Cannot make a doc selection when endOffset ${n} is less than startOffset ${e}.`);return{startOffset:e,endOffset:n,collapsed:e===n}}function Ap(e){const{startOffset:n,endOffset:t,collapsed:r}=e,s=Math.min(n,t),i=Math.max(n,t);return{startOffset:s,endOffset:i,collapsed:r}}function Np(e,n,t,r){return Math.max(e,t)<=Math.min(n,r)}function Tp(e,n){var f,g,E;const{rangeId:t,segmentId:r,documentDataModel:s,insert:i}=n,o=(g=(f=s.getSelfOrHeaderFooterModel(r).getBody())==null?void 0:f.customRanges)==null?void 0:g.find(I=>I.rangeId===t);if(!o)return!1;const{startIndex:a,endIndex:l}=o,c=new Je,u=l-a+1;c.push({t:te.RETAIN,len:a}),c.push({t:te.RETAIN,len:u,body:{dataStream:"",customRanges:[]}}),i&&c.push({t:te.INSERT,body:i,len:i.dataStream.length});const h=l+1+((E=i==null?void 0:i.dataStream.length)!=null?E:0);return c.selections=[{startOffset:h,endOffset:h,collapsed:!0}],c}function Mp(e){var M,O;const{range:n,rangeId:t,rangeType:r,wholeEntity:s,properties:i,body:o}=e,a=pp(n,o);if(!a||!o)return!1;const{startOffset:l,endOffset:c}=a,u=(M=o.customRanges)!=null?M:[];let h=0;const f=new Je,g=(P,$,z)=>{var _e,fe,ye,Ae;const w=gc(P,$,u,r),b=Math.min((fe=(_e=w[0])==null?void 0:_e.startIndex)!=null?fe:1/0,P),D=Math.max((Ae=(ye=w[w.length-1])==null?void 0:ye.endIndex)!=null?Ae:-1/0,$),G={rangeId:z?`${t}-${z}`:t,rangeType:r,startIndex:0,endIndex:D-b,wholeEntity:s,properties:{...i}};f.push({t:te.RETAIN,len:b-h}),f.push({t:te.RETAIN,len:D-b+1,body:{dataStream:"",customRanges:[G]},coverType:Ie.COVER}),h=D+1},E=((O=o.paragraphs)!=null?O:[]).filter(P=>P.startIndex<c&&P.startIndex>l);return _p([l,c-1],E.map(P=>P.startIndex)).forEach(([P,$],z)=>g(P,$,z)),f.selections=[{startOffset:a.endOffset,endOffset:a.endOffset,collapsed:!0}],f}function Lp(e,n,t=0,r=null,s=!0){e.sort((c,u)=>c.startOffset-u.startOffset);const i=[],{paragraphs:o=[]}=n,a=o==null?void 0:o.find(c=>c.startIndex>=e[0].startOffset&&c.startIndex<e[0].endOffset);let l=t;if(e.forEach(c=>{const{startOffset:u,endOffset:h}=c;u>l&&(i.push({t:te.RETAIN,len:u-l}),l=u),l<h&&(i.push({t:te.DELETE,len:h-l}),l=h)}),r&&i.push({t:te.INSERT,body:r,len:r.dataStream.length}),a&&s){const c=o.find(u=>u.startIndex-t>=e[e.length-1].endOffset-1);c&&(c.startIndex>l&&(i.push({t:te.RETAIN,len:c.startIndex-l}),l=c.startIndex),i.push({t:te.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...c,startIndex:0,bullet:a==null?void 0:a.bullet}]},coverType:Ie.REPLACE}))}return i}const Dp=e=>{var h;const{selection:n,body:t,doc:r}=e,s=n.segmentId,i=(h=r.getSelfOrHeaderFooterModel(s))==null?void 0:h.getBody();if(!i)return!1;const o=n.collapsed?null:zt(i,n.startOffset,n.endOffset),a=So(o?o.dataStream:"",t.dataStream);let l=0;const c=a.map(([f,g])=>{switch(f){case 0:{const E={t:te.RETAIN,body:{...zt(t,l,l+g.length,!1),dataStream:""},len:g.length};return l+=g.length,E}case 1:{const E={t:te.INSERT,body:zt(t,l,l+g.length),len:g.length};return l+=g.length,E}default:return{t:te.DELETE,len:g.length}}}),u=new Je;return u.push({t:te.RETAIN,len:n.startOffset}),u.push(...c),u};class Ft{}R(Ft,"customRange",{add:Mp,delete:Tp,copyCustomRange:mp,getCustomRangesInterestsWithSelection:gp,isIntersecting:fc}),R(Ft,"selection",{replace:Dp,makeSelection:wp,normalizeSelection:Ap,delete:Lp}),R(Ft,"range",{isIntersects:Np}),R(Ft,"transform",{getPlainText:_c,fromPlainText:yp,isEmptyDocument:bp}),R(Ft,"paragraph",{bullet:{set:Rp,switch:Ep,toggleChecklist:Cp,changeNestLevel:vp}});const Up=(e,n)=>n.length===e.length&&!e.some(t=>n.some(r=>!Vt.equals(r,t))),Pp=(e,n)=>n.length===e.length&&e.every((t,r)=>{const s=n[r];return s.unitId===t.unitId&&s.sheetId===t.sheetId&&Vt.equals(t.range,s.range)}),di={t:0,b:2,l:2,r:2},Fp=e=>({sbr:.6,sbo:e,spr:.6,spo:e}),pc=90;function Wr(e,n,t={}){const r=e.length,{textRotation:s,paddingData:i,horizontalAlign:o=Bt.UNSPECIFIED,verticalAlign:a=Zt.UNSPECIFIED,wrapStrategy:l=qt.UNSPECIFIED,cellValueType:c}=t,{t:u,r:h,b:f,l:g}=i||di,{vertexAngle:E,centerAngle:I}=Rc(s),M={id:"d",body:{dataStream:`${e}${bo}`,textRuns:[{ts:n,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:u,marginBottom:f,marginRight:h,marginLeft:g,renderConfig:{horizontalAlign:o,verticalAlign:a,centerAngle:I,vertexAngle:E,wrapStrategy:l,cellValueType:c}},drawings:{},drawingsOrder:[]};return new Ut(M)}function kp(e){if(!e)return{};const{tr:n,td:t,ht:r,vt:s,tb:i,pd:o}=e;return{textRotation:n,textDirection:t,horizontalAlign:r,verticalAlign:s,wrapStrategy:i,paddingData:o}}function Ec(e){if(!e)return{};const{ff:n,fs:t,it:r,bl:s,ul:i,st:o,ol:a,cl:l}=e,c={};return n&&(c.ff=n),t&&(c.fs=t),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 xp(e,n,t){var i;const r=e.getBody();if((i=r.customRanges)!=null&&i.some(o=>o.rangeType===Yn.HYPERLINK))return;const s=Ft.customRange.add({range:{startOffset:0,endOffset:r.dataStream.length-1,collapsed:!1},rangeId:t,rangeType:Yn.HYPERLINK,body:r,properties:{url:n,refId:t}});s&&Je.apply(r,s.serialize())}const Hp='"Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif';function Cc(e){const n=et.ff,t=et.fs;if(!e){const h=`${t}pt ${n}`;return{fontCache:h,fontString:h,fontSize:t,originFontSize:t,fontFamily:n}}let r=En.ITALIC;(e.it===0||e.it===void 0)&&(r=En.NORMAL);let s=En.BOLD;(e.bl===0||e.bl===void 0)&&(s=En.NORMAL);let i=t;e.fs&&(i=Math.ceil(e.fs));let o=n;if(e.ff){let h=e.ff;h=h.replace(/"/g,"").replace(/'/g,""),h.indexOf(" ")>-1&&(h=`"${h}"`),h==null&&(h=n),o=h}const{va:a}=e;let l=i;if(a===Dt.SUBSCRIPT||a===Dt.SUPERSCRIPT){const h=Bp(o,l),{sbr:f,spr:g}=h;l*=a===Dt.SUBSCRIPT?f:g}const c=`${r} ${s} ${l}pt ${o}`,u=`${c}, ${Hp} `;return{fontCache:c,fontString:u,fontSize:l,originFontSize:i,fontFamily:o}}function Bp(e,n){return Fp(n)}function Rc(e){const{a:n=0,v:t=Re.FALSE}=e||{a:0,v:Re.FALSE};let r=0,s=n;return t===Re.TRUE&&(r=pc,s=pc),{centerAngle:r,vertexAngle:s}}class jp{constructor(n,t){R(this,"_columnData",{});this._config=n,this._columnData=t}getColumnData(){return this._columnData}getColVisible(n){const{_columnData:t}=this,r=t[n];return r?r.hd!==Re.TRUE:!0}getColumnStyle(n){var t;return(t=this._columnData[n])==null?void 0:t.s}setColumnStyle(n,t){const r=this.getColumnOrCreate(n);r.s=t}getHiddenCols(n=0,t=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=n;o<=t;o++){const a=this.getColVisible(o);s&&a?(s=!1,r.push({rangeType:me.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:t,rangeType:me.COLUMN}),r}getVisibleCols(n=0,t=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=n;o<=t;o++){const a=this.getColVisible(o);s&&!a?(s=!1,r.push({rangeType:me.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:t,rangeType:me.COLUMN}),r}getColumnDatas(n,t){const r={};let s=0;for(let i=n;i<n+t;i++){const o=this.getColumnOrCreate(i);r[s]=o,s++}return r}getSize(){return Wt(this._columnData)}getColumnWidth(n){const{_columnData:t}=this,r=this._config;let s=0;return s=(t[n]||{hd:Re.FALSE,w:r.defaultColumnWidth}).w||r.defaultColumnWidth,s}getColumn(n){const t=this._columnData[n];if(t)return t}removeColumn(n){delete this._columnData[n]}getColumnOrCreate(n){const{_columnData:t}=this,r=t[n];if(r)return r;const s={};return this._columnData[n]=s,s}}class $p{constructor(n,t,r){R(this,"_rowData");this._config=n,this._viewModel=t,this._rowData=r}getRowData(){return this._rowData}getRowStyle(n){var t;return(t=this._rowData[n])==null?void 0:t.s}setRowStyle(n,t){const r=this.getRowOrCreate(n);r.s=t}getRowDatas(n,t){const r={};let s=0;for(let i=n;i<n+t;i++){const o=this.getRowOrCreate(i);r[s]=o,s++}return r}getRowHeight(n,t=1){const{_rowData:r}=this,s=this._config;let i=0;for(let o=0;o<t;o++){const a=r[o+n]||{hd:Re.FALSE,h:s.defaultRowHeight},{ia:l,ah:c,h:u=s.defaultRowHeight}=a;i+=(l==null||l===Re.TRUE)&&typeof c=="number"?c:u}return i}getRow(n){return this._rowData[n]}removeRow(n){delete this._rowData[n]}getRowOrCreate(n){const{_rowData:t}=this,r=t[n];if(r)return r;const s={};return t[n]=s,s}getHiddenRows(n=0,t=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=n;o<=t;o++){const a=this.getRowRawVisible(o);s&&a?(s=!1,r.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:me.ROW})):!s&&!a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:t,startColumn:0,endColumn:0,rangeType:me.ROW}),r}getVisibleRows(n=0,t=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=n;o<=t;o++){const a=this.getRowRawVisible(o);s&&!a?(s=!1,r.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:me.ROW})):!s&&a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:t,startColumn:0,endColumn:0,rangeType:me.ROW}),r}getRowRawVisible(n){const t=this.getRow(n);return t?t.hd!==Re.TRUE:!0}getSize(){return Wt(this._rowData)}}const Wp="DEFAULT_WORKSHEET_ROW_COUNT",Ic=1e3,Vp="DEFAULT_WORKSHEET_COLUMN_COUNT",vc=20,zp="DEFAULT_WORKSHEET_ROW_HEIGHT",Sc=24,Gp="DEFAULT_WORKSHEET_COLUMN_WIDTH",Oc=88,Kp="DEFAULT_WORKSHEET_ROW_TITLE_WIDTH",bc=46,Yp="DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT",yc=20;function wc(e){const n={name:"Sheet1",id:"sheet-01",tabColor:"",hidden:Re.FALSE,rowCount:Ic,columnCount:vc,zoomRatio:1,freeze:{xSplit:0,ySplit:0,startRow:-1,startColumn:-1},scrollTop:0,scrollLeft:0,defaultColumnWidth:Oc,defaultRowHeight:Sc,mergeData:[],cellData:{},rowData:{},columnData:{},showGridlines:Re.TRUE,rowHeader:{width:bc,hidden:Re.FALSE},columnHeader:{height:yc,hidden:Re.FALSE},rightToLeft:Re.FALSE};return Object.keys(n).forEach(t=>{const r=t;typeof e[r]>"u"&&(e[r]=n[r])}),e}class Xp extends Ke{constructor(t){super();R(this,"_cellCache",new Map);R(this,"_rowCache",new Map);R(this,"_columnCache",new Map);R(this,"_hasRow",!1);R(this,"_hasColumn",!1);R(this,"_hasAll",!1);R(this,"_allIndex",-1);R(this,"_mergeData");R(this,"_rangeMap",new Pr(5e4));R(this,"_skeletonCache",new Pr(5e4));this._init(t.concat())}_init(t){this._mergeData=t,this._createCache(t)}_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(t){let r=0;for(const s of t){const{rangeType:i}=s;i===me.ROW?this._createRowCache(s,r):i===me.COLUMN?this._createColumnCache(s,r):i===me.ALL?this._createCellAllCache(r):this._createCellCache(s,r),r++}}rebuild(t){this._clearCache(),this._init(t.concat())}_createRowCache(t,r){const{startRow:s,endRow:i}=t;for(let o=s;o<=i;o++)this._rowCache.set(o,r),this._hasRow=!0}_createColumnCache(t,r){const{startColumn:s,endColumn:i}=t;for(let o=s;o<=i;o++)this._columnCache.set(o,r),this._hasColumn=!0}_createCellAllCache(t){this._hasAll=!0,this._allIndex=t}_createCellCache(t,r){for(let s=t.startRow;s<=t.endRow;s++){let i=this._cellCache.get(s);i==null&&(i=new Map,this._cellCache.set(s,i));for(let o=t.startColumn;o<=t.endColumn;o++)i.set(o,r)}}add(t){this._mergeData.push(t),this._clearCache(),this._createCache(this._mergeData)}remove(t,r){const s=this._getMergeDataIndex(t,r);s!==-1&&(this._mergeData.splice(s,1),this._clearCache(),this._createCache(this._mergeData))}getMergedCell(t,r){const s=this._getMergeDataIndex(t,r);return s!==-1?this._mergeData[s]:null}getMergeDataIndex(t,r){return this._getMergeDataIndex(t,r)}isRowContainsMergedCell(t){return this._hasAll||!W.isEmptyObject(this._columnCache)?!0:this._mergeData.some(r=>r.startRow<=t&&t<=r.endRow)}isColumnContainsMergedCell(t){return this._hasAll||!W.isEmptyObject(this._rowCache)?!0:this._mergeData.some(r=>r.startColumn<=t&&t<=r.endColumn)}getMergedCellRange(t,r,s,i){const o=[],a=`${t}-${r}-${s}-${i}`;if(this._rangeMap.has(a))return this._getRangeFromCache(a);let l=0;const c=[];for(const u of this._mergeData||[])Vt.intersects(u,{startRow:t,endRow:s,startColumn:r,endColumn:i})&&(o.push({...u}),c.push(l)),l++;return this._rangeMap.set(a,c),o}getMergedCellRangeForSkeleton(t,r,s,i){const o=[],a=this._mergeData,l=`${t}-${r}-${s}-${i}`;if(this._skeletonCache.has(l))return this._getSkeletonRangeFromCache(l);const c=[];for(let u=0;u<a.length;u++){const{startRow:h,endRow:f,startColumn:g,endColumn:E}=a[u];for(let I=t;I<=s;I++){let M=!1;for(let O=r;O<=i;O++)if(I>=h&&I<=f&&O>=g&&O<=E){o.push({startRow:h,endRow:f,startColumn:g,endColumn:E}),c.push(u),M=!0;break}if(M)break}}return this._skeletonCache.set(l,c),o}_getRangeFromCache(t){const r=this._rangeMap.get(t)||[],s=[];for(const i of r)s.push({...this._mergeData[i]});return s}_getSkeletonRangeFromCache(t){const r=this._skeletonCache.get(t)||[],s=[];for(const i of r)s.push({...this._mergeData[i]});return s}_getMergeDataIndex(t,r){var i;if(this._hasAll)return this._allIndex;if(this._hasRow){const o=this._rowCache.get(t);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(t))==null?void 0:i.get(r);return s!==void 0?s:-1}getMergeDataSnapshot(){return this._mergeData}dispose(){this._clearCache(),this._mergeData=[]}}class Ac extends Ke{constructor(t){super();R(this,"_cellContentInterceptor",null);R(this,"_rowFilteredInterceptor",null);this.getRawCell=t}dispose(){super.dispose(),this._cellContentInterceptor=null,this._rowFilteredInterceptor=null}getCell(t,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(t,r,gn.Value|gn.Style):this.getRawCell(t,r)}getCellValueOnly(t,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(t,r,gn.Value):this.getRawCell(t,r)}getCellStyleOnly(t,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(t,r,gn.Style):this.getRawCell(t,r)}getRowFiltered(t){var r,s;return(s=(r=this._rowFilteredInterceptor)==null?void 0:r.getRowFiltered(t))!=null?s:!1}registerCellContentInterceptor(t){if(this._cellContentInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._cellContentInterceptor=t,We(()=>this._cellContentInterceptor=null)}registerRowFilteredInterceptor(t){if(this._rowFilteredInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._rowFilteredInterceptor=t,We(()=>this._rowFilteredInterceptor=null)}}const Nc={isDeepClone:!1,displayRawFormula:!1,ignoreTextRotation:!1};class Qn{constructor(n,t,r){R(this,"_sheetId");R(this,"_snapshot");R(this,"_cellData");R(this,"_rowManager");R(this,"_columnManager");R(this,"_viewModel");R(this,"_spanModel");var a;this.unitId=n,this._styles=r,this._snapshot=wc(t);const{columnData:s,rowData:i,cellData:o}=this._snapshot;this._sheetId=(a=this._snapshot.id)!=null?a:W.generateRandomId(6),this._cellData=new wt(o),this._viewModel=new Ac((l,c)=>this.getCellRaw(l,c)),this._rowManager=new $p(this._snapshot,this._viewModel,i),this._columnManager=new jp(this._snapshot,s),this._spanModel=new Xp(this._snapshot.mergeData)}__interceptViewModel(n){n(this._viewModel)}getSnapshot(){return this._snapshot}setMergeData(n){this._snapshot.mergeData=n,this.getSpanModel().rebuild(n)}getSpanModel(){return this._spanModel}getColumnStyle(n,t=!1){return t?this._columnManager.getColumnStyle(n):this._styles.get(this._columnManager.getColumnStyle(n))}setColumnStyle(n,t){this._columnManager.setColumnStyle(n,t)}getRowStyle(n,t=!1){return t?this._rowManager.getRowStyle(n):this._styles.get(this._rowManager.getRowStyle(n))}setRowStyle(n,t){this._rowManager.setRowStyle(n,t)}mixinDefaultStyleToCellRaw(n,t,r,s){const i=this.getColumnStyle(t),o=this.getRowStyle(n),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?xs(a,i,o,l):xs(a,o,i,l);r||(r={}),r.s=c}}getDefaultCellStyle(){return this._snapshot.defaultStyle}getDefaultCellStyleInternal(){const n=this._snapshot.defaultStyle;return this._styles.get(n)}setDefaultCellStyle(n){this._snapshot.defaultStyle=n}getCellMatrix(){return this._cellData}getCellMatrixPrintRange(){const n=this.getCellMatrix(),t=this.getMergeData();let r=-1,s=-1,i=-1,o=-1,a=!1,l=!1;return n.forEach((c,u)=>{Object.keys(u).forEach(h=>{const f=+h,g=n.getValue(c,f),E=g!=null&&g.s?this._styles.get(g.s):null,I=(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);(g&&(g.v||g.p)||E!=null&&E.bg||I)&&(a?r=Math.min(r,c):(r=c,a=!0),s=Math.max(s,c),l?i=Math.min(i,f):(l=!0,i=f),o=Math.max(o,f))})}),t.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:n}=this,t=W.deepClone(n);return new Qn(this.unitId,t,this._styles)}getMergeData(){return this._spanModel.getMergeDataSnapshot()}getMergedCell(n,t){return this._spanModel.getMergedCell(n,t)}getMergedCellRange(n,t,r,s){return this._spanModel.getMergedCellRange(n,t,r,s)}isRowContainsMergedCell(n){return this._spanModel.isRowContainsMergedCell(n)}isColumnContainsMergedCell(n){return this._spanModel.isColumnContainsMergedCell(n)}getCellInfoInMergeData(n,t){const r=this.getMergedCell(n,t);let s=!1,i=!1,o=n,a=t,l=n,c=t;if(r){const{startRow:u,endRow:h,startColumn:f,endColumn:g}=r;n===u&&t===f?(o=h,a=g,l=u,c=f,i=!0):n>=u&&n<=h&&t>=f&&t<=g&&(o=h,a=g,l=u,c=f,s=!0)}return{actualRow:n,actualColumn:t,isMergedMainCell:i,isMerged:s,endRow:o,endColumn:a,startRow:l,startColumn:c}}getCell(n,t){return n<0||t<0?null:this._viewModel.getCell(n,t)}getCellValueOnly(n,t){return n<0||t<0?null:this._viewModel.getCellValueOnly(n,t)}getCellStyleOnly(n,t){return n<0||t<0?null:this._viewModel.getCellStyleOnly(n,t)}getCellRaw(n,t){return this.getCellMatrix().getValue(n,t)}getRowFiltered(n){return this._viewModel.getRowFiltered(n)}getMatrixWithMergedCells(n,t,r,s,i=!1){const o=this.getCellMatrix(),a=this._spanModel.getMergedCellRange(n,t,r,s),l=new wt;return Ks(n,r,t,s).forEach((c,u)=>{const h=i?this.getCellRaw(c,u):this.getCell(c,u);h&&l.setValue(c,u,h)}),a.forEach(c=>{const{startColumn:u,startRow:h,endColumn:f,endRow:g}=c;Ks(h,g,u,f).forEach((E,I)=>{E===h&&I===u&&l.setValue(E,I,{...o.getValue(E,I),rowSpan:g-h+1,colSpan:f-u+1}),(E!==h||I!==u)&&l.realDeleteValue(E,I)})}),l}getRange(n,t,r,s){return typeof n=="object"?new _n(this,n,{getStyles:()=>this._styles}):new _n(this,{startRow:n,startColumn:t,endColumn:s||t,endRow:r||n},{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:n}=this,{columnCount:t}=n;return t}getMaxRows(){const{_snapshot:n}=this,{rowCount:t}=n;return t}getRowCount(){return this._snapshot.rowCount}setRowCount(n){this._snapshot.rowCount=n}getColumnCount(){return this._snapshot.columnCount}setColumnCount(n){this._snapshot.columnCount=n}isSheetHidden(){return this._snapshot.hidden}hasHiddenGridlines(){const{_snapshot:n}=this,{showGridlines:t}=n;return t===0}getTabColor(){const{_snapshot:n}=this,{tabColor:t}=n;return t}getColumnWidth(n){return this.getColumnManager().getColumnWidth(n)}getRowHeight(n){return this._viewModel.getRowFiltered(n)?0:this.getRowManager().getRowHeight(n)}isRowFiltered(n){return this._viewModel.getRowFiltered(n)}getRowVisible(n){return!this.isRowFiltered(n)&&this.getRowRawVisible(n)}getRowRawVisible(n){return this.getRowManager().getRowRawVisible(n)}getHiddenRows(n,t){const r=this.getMaxColumns()-1,s=this._rowManager.getHiddenRows(n,t);return s.forEach(i=>i.endColumn=r),s}getColVisible(n){return this._columnManager.getColVisible(n)}getHiddenCols(n,t){const r=this.getMaxRows()-1,s=this._columnManager.getHiddenCols(n,t);return s.forEach(i=>i.endRow=r),s}getVisibleRows(){const n=this.getRowCount();return this._rowManager.getVisibleRows(0,n-1)}getVisibleCols(){const n=this.getColumnCount();return this._columnManager.getVisibleCols(0,n-1)}isRightToLeft(){const{_snapshot:n}=this,{rightToLeft:t}=n;return t}getLastRowWithContent(){return this._cellData.getLength()-1}getLastColumnWithContent(){return this._cellData.getRange().endColumn}cellHasValue(n){return n&&(n.v!==void 0||n.f!==void 0||n.p!==void 0)}iterateByRow(n,t=!0){const{startRow:r,startColumn:s,endRow:i,endColumn:o}=n,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 u=a.getCell(l,c),h=!u,f=a.getMergedCell(l,c);if(f){if(l!==f.startRow||c!==f.startColumn){c=f.endColumn+1;continue}if(h&&t){c=f.endColumn+1;continue}const E={row:l,col:c,value:u};return E.colSpan=f.endColumn-f.startColumn+1,E.rowSpan=f.endRow-f.startRow+1,c=f.endColumn+1,{done:!1,value:E}}if(h&&t)c+=1;else{const g={row:l,col:c,value:u};return c+=1,{done:!1,value:g}}}}}}}}iterateByColumn(n,t=!0,r=!0){const{startRow:s,startColumn:i,endRow:o,endColumn:a}=n,l=this;return{[Symbol.iterator]:()=>{let c=s,u=i;return{next(){for(;;){if(c>o&&(u+=1,c=s),u>a)return{done:!0,value:void 0};const h=l.getMergedCell(c,u);if(h){const E=c!==h.startRow,I=E||u!==h.startColumn;if(r&&I||!r&&E){c=h.endRow+1;continue}const M=l.getCell(h.startRow,h.startColumn);if(!M&&t){c=h.endRow+1;continue}const P={row:c,col:h.startColumn,value:M};return P.colSpan=h.endColumn-h.startColumn+1,P.rowSpan=h.endRow-h.startRow+1,c=h.endRow+1,{done:!1,value:P}}const f=l.getCell(c,u);if(!f&&t)c+=1;else{const E={row:c,col:u,value:f};return c+=1,{done:!1,value:E}}}}}}}}_getCellDocumentModel(n,t=Nc){var I;const{isDeepClone:r,displayRawFormula:s,ignoreTextRotation:i}={...Nc,...t},o=this._styles.getStyleByCell(n);if(!n)return;let a,l="document";const c=kp(o),u=i?et.tr:c.textRotation||et.tr;let h=c.horizontalAlign||et.ht;const f=c.verticalAlign||et.vt,g=c.wrapStrategy||et.tb,E=c.paddingData||di;if(n.f&&s)a=Wr(n.f.toString(),{},{verticalAlign:f}),h=et.ht;else if(n.p){const{centerAngle:M,vertexAngle:O}=Rc(u);a=this._updateConfigAndGetDocumentModel(r?W.deepClone(n.p):n.p,h,E,{horizontalAlign:h,verticalAlign:f,centerAngle:M,vertexAngle:O,wrapStrategy:g})}else if(n.v!=null){const M=Ec(o);l=Cc(M).fontCache;let O=Tc(n);n.t===jt.FORCE_STRING&&s&&(O=`'${O}`),a=Wr(O,M,{...c,textRotation:u,cellValueType:n.t})}return a&&n.linkUrl&&n.linkId&&xp(a,n.linkUrl,n.linkId),{documentModel:a,fontString:l,textRotation:u,wrapStrategy:g,verticalAlign:f,horizontalAlign:h,paddingData:E,fill:(I=o==null?void 0:o.bg)==null?void 0:I.rgb}}_updateConfigAndGetDocumentModel(n,t,r,s){var o,a,l,c,u;if(!s||!((o=n.body)!=null&&o.dataStream))return;n.documentStyle||(n.documentStyle={}),n.documentStyle.marginTop=(a=r.t)!=null?a:0,n.documentStyle.marginBottom=(l=r.b)!=null?l:2,n.documentStyle.marginLeft=(c=r.l)!=null?c:2,n.documentStyle.marginRight=(u=r.r)!=null?u:2,n.documentStyle.pageSize={width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},n.documentStyle.renderConfig=s;const i=n.body.paragraphs||[];for(const h of i)h.paragraphStyle||(h.paragraphStyle={}),h.paragraphStyle.horizontalAlign=t;return new Ut(n)}getBlankCellDocumentModel(n){const t=this._getCellDocumentModel(n,{ignoreTextRotation:!0}),r=this._styles.getStyleByCell(n),s=Ec(r);if(t!=null)return t.documentModel==null&&(t.documentModel=Wr("",s)),t;const i="";let o="document";const a=et.tr,l=et.ht,c=et.vt,u=et.tb,h=di;return o=Cc({}).fontCache,{documentModel:Wr(i,s),fontString:o,textRotation:a,wrapStrategy:u,verticalAlign:c,horizontalAlign:l,paddingData:h}}getCellDocumentModelWithFormula(n){return this._getCellDocumentModel(n,{isDeepClone:!0,displayRawFormula:!0,ignoreTextRotation:!0})}}function Tc(e){var r,s;if(!e)return"";const n=(s=(r=e.p)==null?void 0:r.body)==null?void 0:s.dataStream;if(n)return Ft.transform.getPlainText(n);const t=e.v;return typeof t=="string"?e.t===jt.BOOLEAN?t.toUpperCase():t.replace(/[\r\n]/g,""):typeof t=="number"?e.t===jt.BOOLEAN?t?"TRUE":"FALSE":t.toString():typeof t=="boolean"?t?"TRUE":"FALSE":""}function Qp(e){if(e===null)return"";if(e!=null&&e.p){const n=e==null?void 0:e.p.body;if(n==null)return"";const t=n.dataStream;return Ft.transform.getPlainText(t)}return e==null?void 0:e.v}var Jp=Object.defineProperty,Zp=Object.getOwnPropertyDescriptor,qp=(e,n,t,r)=>{for(var s=r>1?void 0:r?Zp(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&Jp(n,t,s),s},eE=(e,n)=>(t,r)=>n(t,r,e);function tE(e,n){return`${e.getUnitId()}|${n.getSheetId()}`}d.Workbook=class extends xr{constructor(t={},r){super();R(this,"type",we.UNIVER_SHEET);R(this,"_sheetCreated$",new re.Subject);R(this,"sheetCreated$",this._sheetCreated$.asObservable());R(this,"_sheetDisposed$",new re.Subject);R(this,"sheetDisposed$",this._sheetDisposed$.asObservable());R(this,"_activeSheet$",new re.BehaviorSubject(null));R(this,"activeSheet$",this._activeSheet$.asObservable());R(this,"_worksheets");R(this,"_styles");R(this,"_snapshot");R(this,"_unitId");R(this,"_count");R(this,"_name$");R(this,"name$");this._logService=r;const s=fp();W.isEmptyObject(t)?this._snapshot=s:this._snapshot=W.commonExtend(s,t);const{styles:i}=this._snapshot;(this._snapshot.id==null||this._snapshot.id.length===0)&&(this._snapshot.id=W.generateRandomId(6)),this._unitId=this._snapshot.id,this._styles=new dc(i),this._count=1,this._worksheets=new Map,this._name$=new re.BehaviorSubject(t.name||""),this.name$=this._name$.asObservable(),this._parseWorksheetSnapshots()}get _activeSheet(){return this._activeSheet$.getValue()}get name(){return this._name$.getValue()}static isIRangeType(t){return typeof t=="string"||"startRow"in t||"row"in t}dispose(){super.dispose(),this._sheetCreated$.complete(),this._sheetDisposed$.complete(),this._activeSheet$.complete(),this._name$.complete()}save(){return W.deepClone(this._snapshot)}getSnapshot(){return this._snapshot}getName(){return this._snapshot.name}setName(t){this._name$.next(t),this._snapshot.name=t}getUnitId(){return this._unitId}getRev(){var t;return(t=this._snapshot.rev)!=null?t:1}incrementRev(){this._snapshot.rev=this.getRev()+1}setRev(t){this._snapshot.rev=t}addWorksheet(t,r,s){const{sheets:i,sheetOrder:o}=this._snapshot;if(i[t])return!1;i[t]=s,o.splice(r,0,t);const a=new Qn(this._unitId,s,this._styles);return this._worksheets.set(t,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(t){const{sheetOrder:r}=this._snapshot;return r.findIndex(s=>s===t)}getActiveSheet(t){if(!this._activeSheet&&typeof t>"u")throw new Error(`[Workbook]: no active Worksheet on Workbook ${this._unitId}!`);return this._activeSheet}ensureActiveSheet(){const t=this._activeSheet;if(t)return t;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()!==Re.TRUE)return this.setActiveSheet(a),a}const s=this._worksheets.get(r[0]);return this.setActiveSheet(s),s}setActiveSheet(t){this._activeSheet$.next(t)}removeSheet(t){const r=this._worksheets.get(t);return r?(this._worksheets.delete(t),this._snapshot.sheetOrder.splice(this._snapshot.sheetOrder.indexOf(t),1),delete this._snapshot.sheets[t],this._sheetDisposed$.next(r),!0):!1}getActiveSheetIndex(){const{sheetOrder:t}=this._snapshot;return t.findIndex(r=>this._worksheets.get(r)===this._activeSheet)}getSheetSize(){return this._snapshot.sheetOrder.length}getSheets(){const{sheetOrder:t}=this._snapshot;return t.map(r=>this._worksheets.get(r))}getSheetsName(){const{sheetOrder:t}=this._snapshot,r=[];return t.forEach(s=>{const i=this._worksheets.get(s);i&&r.push(i.getName())}),r}getSheetIndex(t){const{sheetOrder:r}=this._snapshot;return r.findIndex(s=>t.getSheetId()===s)}getSheetBySheetName(t){const{sheetOrder:r}=this._snapshot,s=r.find(i=>this._worksheets.get(i).getName()===t);return this._worksheets.get(s)}getSheetBySheetId(t){return this._worksheets.get(t)}getSheetByIndex(t){const{sheetOrder:r}=this._snapshot;return this._worksheets.get(r[t])}getHiddenWorksheets(){return this.getSheets().filter(t=>t.getConfig().hidden===Re.TRUE).map(t=>t.getConfig().id)}getUnhiddenWorksheets(){return this.getSheets().filter(t=>t.getConfig().hidden!==Re.TRUE).map(t=>t.getConfig().id)}load(t){this._snapshot=t}checkSheetName(t){return this.getSheetsName().includes(t)}uniqueSheetName(t="Sheet1"){let r=t;for(;this.checkSheetName(r);)r=t+this._count,this._count++;return r}generateNewSheetName(t){let r=t+this._count;for(;this.checkSheetName(r);)r=t+this._count,this._count++;return r}_parseWorksheetSnapshots(){const{_snapshot:t,_worksheets:r}=this,{sheets:s,sheetOrder:i}=t;if(W.isEmptyObject(s)){const o=W.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 Qn(this._unitId,a,this._styles);r.set(o,c),i.includes(o)||i.push(o)}this.ensureActiveSheet()}},d.Workbook=qp([eE(1,Rt)],d.Workbook);class fi extends xr{constructor(t){var r;super();R(this,"type",we.UNIVER_SLIDE);R(this,"_activePage$",new re.BehaviorSubject(null));R(this,"activePage$",this._activePage$.asObservable());R(this,"_name$");R(this,"name$");R(this,"_snapshot");R(this,"_unitId");this._snapshot={...qa,...t},this._unitId=(r=this._snapshot.id)!=null?r:W.generateRandomId(6),this._name$=new re.BehaviorSubject(this._snapshot.title),this.name$=this._name$.asObservable()}get _activePage(){var r,s;const t=this._activePage$.getValue();if(!t){const i=(r=this.getPageOrder())==null?void 0:r[0];return i?(s=this.getPages())==null?void 0:s[i]:null}return t}setName(t){var r;this._snapshot.title=t,this._name$.next(t),this._unitId=(r=this._snapshot.id)!=null?r:en(6)}getRev(){return 0}incrementRev(){}setRev(t){}getSnapshot(){return this._snapshot}getUnitId(){return this._unitId}getPages(){var t;return(t=this._snapshot.body)==null?void 0:t.pages}getPageOrder(){var t;return(t=this._snapshot.body)==null?void 0:t.pageOrder}getPage(t){const r=this.getPages();return r==null?void 0:r[t]}getElementsByPage(t){var r;return(r=this.getPage(t))==null?void 0:r.pageElements}getElement(t,r){var s;return(s=this.getElementsByPage(t))==null?void 0:s[r]}getPageSize(){return this._snapshot.pageSize}getBlankPage(){const t=en(6);return{id:t,pageType:ii.SLIDE,zIndex:10,title:t,description:"",pageBackgroundFill:{rgb:"rgb(255,255,255)"},pageElements:{}}}setActivePage(t){this._activePage$.next(t)}getActivePage(){return this._activePage}updatePage(t,r){this._snapshot.body&&(this._snapshot.body.pages[t]=r)}appendPage(t){var i;if(!this._snapshot.body)return;this._snapshot.body.pages[t.id]=t;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,t.id)}}const Jn="FOCUSING_UNIT",vn="FOCUSING_SHEET",Zn="FOCUSING_DOC",qn="FOCUSING_SLIDE",nE="FOCUSING_EDITOR_BUT_HIDDEN",Mc="EDITOR_ACTIVATED",rE="FOCUSING_EDITOR_INPUT_FORMULA",Lc="FOCUSING_FX_BAR_EDITOR",sE="FOCUSING_UNIVER_EDITOR",iE="FOCUSING_EDITOR_INPUT_FORMULA",oE="FOCUSING_PANEL_EDITOR",aE="FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE",lE="FOCUSING_COMMON_DRAWINGS",cE="FORMULA_EDITOR_ACTIVATED";var uE=Object.defineProperty,hE=Object.getOwnPropertyDescriptor,dE=(e,n,t,r)=>{for(var s=r>1?void 0:r?hE(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&uE(n,t,s),s},Dc=(e,n)=>(t,r)=>n(t,r,e);const sn=gt("univer.current");d.UniverInstanceService=class extends Ke{constructor(t,r){super();R(this,"_unitsByType",new Map);R(this,"_createHandler");R(this,"_ctorByType",new Map);R(this,"_currentUnits",new Map);R(this,"_currentUnits$",new re.BehaviorSubject(this._currentUnits));R(this,"currentUnits$",this._currentUnits$.asObservable());R(this,"_unitAdded$",new re.Subject);R(this,"unitAdded$",this._unitAdded$.asObservable());R(this,"_unitDisposed$",new re.Subject);R(this,"unitDisposed$",this._unitDisposed$.asObservable());R(this,"_focused$",new re.BehaviorSubject(null));R(this,"focused$",this._focused$.asObservable());this._injector=t,this._contextService=r}dispose(){super.dispose(),this._focused$.complete()}__setCreateHandler(t){this._createHandler=t}createUnit(t,r,s){return this._createHandler(t,r,this._ctorByType.get(t),s)}registerCtorForType(t,r){return this._ctorByType.set(t,r),{dispose:()=>{this._ctorByType.delete(t)}}}getCurrentTypeOfUnit$(t){return this.currentUnits$.pipe(re.map(r=>{var s;return(s=r.get(t))!=null?s:null}),re.distinctUntilChanged())}getCurrentUnitForType(t){return this._currentUnits.get(t)}setCurrentUnitForType(t){const r=this._getUnitById(t);if(!r)throw new Error(`[UniverInstanceService]: no document with unitId ${t}!`);this._currentUnits.set(r[1],r[0]),this._currentUnits$.next(this._currentUnits)}getTypeOfUnitAdded$(t){return this._unitAdded$.pipe(re.filter(r=>r.type===t))}__addUnit(t,r){var a;const s=t.type;this._unitsByType.has(s)||this._unitsByType.set(s,[]);const i=this._unitsByType.get(s),o=t.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(t),this._unitAdded$.next(t),((a=r==null?void 0:r.makeCurrent)==null||a)&&this.setCurrentUnitForType(t.getUnitId())}getTypeOfUnitDisposed$(t){return this.unitDisposed$.pipe(re.filter(r=>r.type===t))}getUnit(t,r){var i;const s=(i=this._getUnitById(t))==null?void 0:i[0];return r&&(s==null?void 0:s.type)!==r?null:s}getCurrentUniverDocInstance(){return this.getCurrentUnitForType(we.UNIVER_DOC)}getUniverDocInstance(t){return this.getUnit(t,we.UNIVER_DOC)}getUniverSheetInstance(t){return this.getUnit(t,we.UNIVER_SHEET)}getAllUnitsForType(t){var r;return(r=this._unitsByType.get(t))!=null?r:[]}changeDoc(t,r){const s=this.getAllUnitsForType(we.UNIVER_DOC),i=s.find(o=>o.getUnitId()===t);if(i!=null){const o=s.indexOf(i);s.splice(o,1)}this.__addUnit(r)}get focused(){var r;const t=this._focused$.getValue();return t?(r=this._getUnitById(t))==null?void 0:r[0]:null}focusUnit(t){this._focused$.next(t),this.focused instanceof d.Workbook?(this._contextService.setContextValue(Jn,!0),this._contextService.setContextValue(Zn,!1),this._contextService.setContextValue(vn,!0),this._contextService.setContextValue(qn,!1),this.setCurrentUnitForType(t)):this.focused instanceof Ut?(this._contextService.setContextValue(Jn,!0),this._contextService.setContextValue(Zn,!0),this._contextService.setContextValue(vn,!1),this._contextService.setContextValue(qn,!1),this.setCurrentUnitForType(t)):this.focused instanceof fi?(this._contextService.setContextValue(Jn,!0),this._contextService.setContextValue(Zn,!1),this._contextService.setContextValue(vn,!1),this._contextService.setContextValue(qn,!0),this.setCurrentUnitForType(t)):(this._contextService.setContextValue(Jn,!1),this._contextService.setContextValue(Zn,!1),this._contextService.setContextValue(vn,!1),this._contextService.setContextValue(qn,!1))}getFocusedUnit(){return this.focused}getUnitType(t){const r=this._getUnitById(t);return r?r[1]:we.UNRECOGNIZED}disposeUnit(t){const r=this._getUnitById(t);if(!r)return!1;const[s,i]=r,o=this._unitsByType.get(i),a=o.indexOf(s);return o.splice(a,1),this._tryRemoveCurrentUnitForType(t,i),this._tryBlurUnitOnRemoval(t),this._unitDisposed$.next(s),!0}_tryRemoveCurrentUnitForType(t,r){const s=this.getCurrentUnitForType(r);(s==null?void 0:s.getUnitId())===t&&(this._currentUnits.set(r,null),this._currentUnits$.next(this._currentUnits))}_tryBlurUnitOnRemoval(t){var r;((r=this.focused)==null?void 0:r.getUnitId())===t&&this._focused$.next(null)}_getUnitById(t){for(const[r,s]of this._unitsByType){const i=s.find(o=>o.getUnitId()===t);if(i)return[i,r]}}},d.UniverInstanceService=dE([Dc(0,mt(Ot)),Dc(1,Bn)],d.UniverInstanceService);var Pe=(e=>(e[e.Starting=0]="Starting",e[e.Ready=1]="Ready",e[e.Rendered=2]="Rendered",e[e.Steady=3]="Steady",e))(Pe||{});const fE={0:"Starting",1:"Ready",2:"Rendered",3:"Steady"};var gE=Object.defineProperty,mE=Object.getOwnPropertyDescriptor,_E=(e,n,t,r)=>{for(var s=r>1?void 0:r?mE(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&gE(n,t,s),s},pE=(e,n)=>(t,r)=>n(t,r,e);d.LifecycleService=class extends Ke{constructor(t){super();R(this,"_lifecycle$",new re.BehaviorSubject(Pe.Starting));R(this,"lifecycle$",this._lifecycle$.asObservable());R(this,"_lock",!1);this._logService=t,this._reportProgress(Pe.Starting)}get stage(){return this._lifecycle$.getValue()}set stage(t){if(this._lock)throw new Error("[LifecycleService]: cannot set new stage when related logic is all handled!");if(t<this.stage)throw new Error("[LifecycleService]: lifecycle stage cannot go backward!");t!==this.stage&&(this._lock=!0,this._reportProgress(t),this._lifecycle$.next(t),this._lock=!1)}dispose(){this._lifecycle$.complete(),super.dispose()}subscribeWithPrevious(){return re.merge(Uc(this.stage),this._lifecycle$.pipe(re.skip(1))).pipe(pa(t=>t===Pe.Steady))}_reportProgress(t){this._logService.debug("[LifecycleService]",`lifecycle progressed to "${fE[t]}".`)}},d.LifecycleService=_E([pE(0,Rt)],d.LifecycleService);function Uc(e){switch(e){case Pe.Starting:return re.of(Pe.Starting);case Pe.Ready:return re.of(Pe.Starting,Pe.Ready);case Pe.Rendered:return re.of(Pe.Starting,Pe.Ready,Pe.Rendered);default:return re.of(Pe.Starting,Pe.Ready,Pe.Rendered,Pe.Steady)}}var EE=Object.defineProperty,CE=Object.getOwnPropertyDescriptor,RE=(e,n,t,r)=>{for(var s=r>1?void 0:r?CE(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&EE(n,t,s),s},gi=(e,n)=>(t,r)=>n(t,r,e);const Gt=gt("univer.undo-redo.service"),IE=20;class Pc{dispose(){}async dispatchToHandlers(){return!1}}const Fc="univer.command.redo",kc="univer.command.undo",er=new class extends Pc{constructor(){super(...arguments);R(this,"type",jn.COMMAND);R(this,"id",kc)}async handler(n){const t=n.get(Gt),r=t.pitchTopUndoElement();if(!r)return!1;const s=n.get(bt);return Fs(r.undoMutations,s)?(t.popUndoToRedo(),!0):!1}},tr=new class extends Pc{constructor(){super(...arguments);R(this,"type",jn.COMMAND);R(this,"id",Fc)}async handler(n){const t=n.get(Gt),r=t.pitchTopRedoElement();if(!r)return!1;const s=n.get(bt);return Fs(r.redoMutations,s)?(t.popRedoToUndo(),!0):!1}};d.LocalUndoRedoService=class extends Ke{constructor(t,r,s){super();R(this,"undoRedoStatus$");R(this,"_undoRedoStatus$",new re.BehaviorSubject({undos:0,redos:0}));R(this,"_undoStacks",new Map);R(this,"_redoStacks",new Map);R(this,"_batchingStatus",new Map);this._univerInstanceService=t,this._commandService=r,this._contextService=s,this.undoRedoStatus$=this._undoRedoStatus$.asObservable(),this.disposeWithMe(this._commandService.registerCommand(er)),this.disposeWithMe(this._commandService.registerCommand(tr)),this.disposeWithMe(We(()=>this._undoRedoStatus$.complete())),this.disposeWithMe(We(this._univerInstanceService.focused$.subscribe(()=>this._updateStatus())))}pushUndoRedo(t){const{unitID:r}=t,s=this._getRedoStack(r,!0),i=this._getUndoStack(r,!0);if(s.length=0,this._batchingStatus.has(t.unitID)){const a=this._batchingStatus.get(t.unitID),l=this._pitchUndoElement(t.unitID);a===0||!l?(o(t),this._batchingStatus.set(t.unitID,1)):this._tryBatchingElements(l,t)}else o(t);function o(a){i.push(a),i.length>IE&&i.splice(0,1)}this._updateStatus()}clearUndoRedo(t){const r=this._getRedoStack(t);r&&(r.length=0);const s=this._getUndoStack(t);s&&(s.length=0),this._updateStatus()}pitchTopUndoElement(){const t=this._getFocusedUnitId();return this._pitchUndoElement(t)}pitchTopRedoElement(){const t=this._getFocusedUnitId();return this._pitchRedoElement(t)}_pitchUndoElement(t){const r=this._getUndoStack(t);return r!=null&&r.length?r[r.length-1]:null}_pitchRedoElement(t){const r=this._getRedoStack(t);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(t){if(this._batchingStatus.has(t))throw new Error("[LocalUndoRedoService]: cannot batching undo redo twice at the same time!");return this._batchingStatus.set(t,0),We(()=>this._batchingStatus.delete(t))}_updateStatus(){var i,o;const t=this._getFocusedUnitId(),r=t&&((i=this._undoStacks.get(t))==null?void 0:i.length)||0,s=t&&((o=this._redoStacks.get(t))==null?void 0:o.length)||0;this._undoRedoStatus$.next({undos:r,redos:s})}_getUndoStack(t,r=!1){let s=this._undoStacks.get(t);return!s&&r&&(s=[],this._undoStacks.set(t,s)),s||null}_getRedoStack(t,r=!1){let s=this._redoStacks.get(t);return!s&&r&&(s=[],this._redoStacks.set(t,s)),s||null}_getUndoStackForFocused(){const t=this._getFocusedUnitId();if(!t)throw new Error("No focused univer instance!");return this._getUndoStack(t,!0)}_getRedoStackForFocused(){const t=this._getFocusedUnitId();if(!t)throw new Error("No focused univer instance!");return this._getRedoStack(t,!0)}_tryBatchingElements(t,r){t.redoMutations.push(...r.redoMutations),t.undoMutations.push(...r.undoMutations)}_getFocusedUnitId(){var o,a,l,c;let t="";const r=this._contextService.getContextValue(vn),s=this._contextService.getContextValue(Lc),i=this._contextService.getContextValue(Mc);return r?s?t=Es:i?t=ps:t=(a=(o=this._univerInstanceService.getFocusedUnit())==null?void 0:o.getUnitId())!=null?a:"":t=(c=(l=this._univerInstanceService.getFocusedUnit())==null?void 0:l.getUnitId())!=null?c:"",t}},d.LocalUndoRedoService=RE([gi(0,sn),gi(1,bt),gi(2,Bn)],d.LocalUndoRedoService);const Vr=gt("core.resource-manager.service"),mi={[At.Editor]:"Editor",[At.Owner]:"Owner",[At.Reader]:"Reader",[At.UNRECOGNIZED]:"UNRECOGNIZED"},zr=e=>e?{userID:`${mi[e]}_${W.generateRandomId(8)}`,name:mi[e],avatar:""}:{userID:"",name:"",avatar:"",anonymous:!0,canBindAnonymous:!1},vE=(e,n)=>e.startsWith(mi[n]);class Gr{constructor(){R(this,"_model",new Map);R(this,"_userChange$",new re.Subject);R(this,"userChange$",this._userChange$.asObservable());R(this,"_currentUser$",new re.BehaviorSubject(zr()));R(this,"currentUser$",this._currentUser$.asObservable())}getCurrentUser(){return this._currentUser$.getValue()}setCurrentUser(n){this.addUser(n),this._currentUser$.next(n)}addUser(n){this._model.set(n.userID,n),this._userChange$.next({type:"add",user:n})}getUser(n,t){const r=this._model.get(n);if(r)return r;t&&t()}delete(n){const t=this.getUser(n);this._model.delete(n),t&&this._userChange$.next({type:"delete",user:t})}clear(){this._model.clear(),this._userChange$.next({type:"clear"})}list(){return Array.from(this._model.values())}}var SE=Object.defineProperty,OE=Object.getOwnPropertyDescriptor,bE=(e,n,t,r)=>{for(var s=r>1?void 0:r?OE(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&SE(n,t,s),s},xc=(e,n)=>(t,r)=>n(t,r,e);d.AuthzIoLocalService=class{constructor(n,t){R(this,"_permissionMap",new Map([]));this._resourceManagerService=n,this._userManagerService=t,this._initSnapshot(),this._initDefaultUser()}_initDefaultUser(){const n=this._userManagerService.getCurrentUser();n&&n.userID||this._userManagerService.setCurrentUser(zr(At.Owner))}_getRole(n){const t=this._userManagerService.getCurrentUser();return t?vE(t.userID,n):!1}_initSnapshot(){this._resourceManagerService.registerPluginResource({toJson:n=>{const t=[...this._permissionMap.keys()].reduce((r,s)=>{const i=this._permissionMap.get(s);return r[s]=i,r},{});return JSON.stringify(t)},parseJson:n=>JSON.parse(n),pluginName:"SHEET_AuthzIoMockService_PLUGIN",businesses:[we.UNIVER_SHEET,we.UNIVER_DOC,we.UNIVER_SLIDE],onLoad:(n,t)=>{for(const r in t)this._permissionMap.set(r,t[r])},onUnLoad:()=>{this._permissionMap.clear()}})}async create(n){return en(8)}async allowed(n){return Promise.resolve([])}async batchAllowed(n){return Promise.resolve([])}async list(n){const t=[];return n.objectIDs.forEach(r=>{const s=this._permissionMap.get(r);if(s){const i={objectID:r,unitID:n.unitID,objectType:s.objectType,name:s.name,shareOn:!1,shareRole:At.Owner,shareScope:-1,scope:{read:Ys.AllCollaborator,edit:Ys.AllCollaborator},creator:zr(At.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:n.actions.map(o=>({action:o,allowed:this._getRole(At.Owner)||this._getRole(At.Editor)}))};t.push(i)}}),t}async listCollaborators(){return[]}async listRoles(){return{roles:[],actions:[]}}async deleteCollaborator(){}async update(n){}async updateCollaborator(){}async createCollaborator(){}async putCollaborators(n){}},d.AuthzIoLocalService=bE([xc(0,Vr),xc(1,mt(Gr))],d.AuthzIoLocalService);const Hc=gt("IAuthzIoIoService"),Bc=gt("univer.config-service");class jc{constructor(){R(this,"_configChanged$",new re.Subject);R(this,"configChanged$",this._configChanged$.asObservable());R(this,"_config",new Map)}dispose(){this._configChanged$.complete()}getConfig(n){return this._config.get(n)}setConfig(n,t,r){var o;const{merge:s=!1}=r||{};let i=(o=this._config.get(n))!=null?o:{};s?i=W.deepMerge(i,t):i=t,this._config.set(n,i),this._configChanged$.next({[n]:i})}deleteConfig(n){return this._config.delete(n)}subscribeConfigValue$(n){return new re.Observable(t=>{Object.prototype.hasOwnProperty.call(this._config,n)&&t.next(this._config.get(n));const r=this.configChanged$.pipe(re.filter(s=>Object.prototype.hasOwnProperty.call(s,n))).subscribe(s=>t.next(s[n]));return()=>r.unsubscribe()})}}class $c extends Ke{constructor(){super(...arguments);R(this,"_error$",new re.Subject);R(this,"error$",this._error$.asObservable())}dispose(){this._error$.complete()}emit(t){this._error$.next({errorKey:t})}}class nr extends Ke{constructor(){super();R(this,"_currentLocale$",new re.BehaviorSubject(Wn.ZH_CN));R(this,"currentLocale$",this._currentLocale$.asObservable());R(this,"_locales",null);R(this,"localeChanged$",new re.Subject);R(this,"t",(t,...r)=>{if(!this._locales)throw new Error("[LocaleService]: Locale not initialized");const s=t.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 t});this.disposeWithMe(We(()=>this.localeChanged$.complete()))}get _currentLocale(){return this._currentLocale$.value}load(t){var r;this._locales=W.deepMerge((r=this._locales)!=null?r:{},t)}setLocale(t){this._currentLocale$.next(t),this.localeChanged$.next()}getLocales(){var t;return(t=this._locales)==null?void 0:t[this._currentLocale]}getCurrentLocale(){return this._currentLocale}resolveKeyPath(t,r){const s=r.shift();if(s&&t&&s in t){const i=t[s];return r.length>0&&(typeof i=="object"||Array.isArray(i))?this.resolveKeyPath(i,r):i}return null}}var _i=(e=>(e.INIT="init",e.FETCHING="fetching",e.DONE="done",e))(_i||{});const Wc=gt("univer.permission-service");class Vc extends Ke{constructor(){super(...arguments);R(this,"_permissionPointMap",new Map);R(this,"_permissionPointUpdate$",new re.Subject);R(this,"permissionPointUpdate$",this._permissionPointUpdate$.asObservable());R(this,"_showComponents",!0)}setShowComponents(t){this._showComponents=t}getShowComponents(){return this._showComponents}deletePermissionPoint(t){const r=this._permissionPointMap.get(t);r&&(r.complete(),this._permissionPointMap.delete(t))}addPermissionPoint(t){const r=t instanceof re.BehaviorSubject,s=r?t.getValue():t;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?t:new re.BehaviorSubject(s)),this._permissionPointUpdate$.next(s),!0}updatePermissionPoint(t,r){const s=this._permissionPointMap.get(t);if(!s)return;const i=s.getValue();i.value=r,i.status=_i.DONE,s.next(i),this._permissionPointUpdate$.next(i)}clearPermissionMap(){this._permissionPointMap.clear()}getPermissionPoint(t){const r=this._permissionPointMap.get(t);if(r)return r.getValue()}getPermissionPoint$(t){const r=this._permissionPointMap.get(t);if(r)return r}composePermission$(t){const r=t.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 re.combineLatest(r).pipe(Mt.map(s=>s))}composePermission(t){return t.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 t=new Map;return this._permissionPointMap.forEach((r,s)=>{t.set(s,r)}),t}}const zc=Symbol("DependentOn");class pi extends Ke{onStarting(){}onReady(){}onRendered(){}onSteady(){}getUniverInstanceType(){return this.constructor.type}getPluginName(){return this.constructor.pluginName}}R(pi,"pluginName"),R(pi,"type",we.UNIVER_UNKNOWN);class yE{constructor(){R(this,"_plugins",[])}addPlugin(n){this._plugins.push(n)}removePlugins(){const n=this._plugins.slice();return this._plugins.length=0,n}forEachPlugin(n){this._plugins.forEach(n)}}class wE{constructor(){R(this,"_pluginsRegistered",[])}registerPlugin(n,t){this._pluginsRegistered.push({plugin:n,options:t})}getRegisterPlugins(){return this._pluginsRegistered.slice()}removePlugins(){this._pluginsRegistered=[]}}var AE=Object.defineProperty,NE=Object.getOwnPropertyDescriptor,Gc=(e,n,t,r)=>{for(var s=r>1?void 0:r?NE(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&AE(n,t,s),s},Kr=(e,n)=>(t,r)=>n(t,r,e);const TE=4;function ME(...e){return function(n){n[zc]=e}}d.PluginService=class{constructor(n){R(this,"_pluginHolderForUniver");R(this,"_pluginHoldersForTypes",new Map);R(this,"_seenPlugins",new Set);R(this,"_flushTimer");this._injector=n,this._pluginHolderForUniver=this._injector.createInstance(Yr,this._checkPluginSeen.bind(this),this._immediateInitPlugin.bind(this)),this._pluginHoldersForTypes.set(we.UNIVER_UNKNOWN,this._pluginHolderForUniver),this._pluginHolderForUniver.start()}dispose(){this._clearFlushTimer();for(const n of this._pluginHoldersForTypes.values())n.dispose();this._pluginHolderForUniver.dispose()}registerPlugin(n,t){this._assertPluginValid(n),this._scheduleInitPlugin();const{type:r}=n;r===we.UNIVER_UNKNOWN?(this._pluginHolderForUniver.register(n,t),this._pluginHolderForUniver.flush()):this._ensurePluginHolderForType(r).register(n,t)}startPluginForType(n){this._ensurePluginHolderForType(n).start()}_ensurePluginHolderForType(n){if(!this._pluginHoldersForTypes.has(n)){const t=this._injector.createInstance(Yr,this._checkPluginSeen.bind(this),this._immediateInitPlugin.bind(this));return this._pluginHoldersForTypes.set(n,t),t}return this._pluginHoldersForTypes.get(n)}_immediateInitPlugin(n){this._seenPlugins.add(n.pluginName),this._ensurePluginHolderForType(n.type).immediateInitPlugin(n)}_checkPluginSeen(n){return this._seenPlugins.has(n.pluginName)}_assertPluginValid(n){const{type:t,pluginName:r}=n;if(t===we.UNRECOGNIZED)throw new Error(`[PluginService]: invalid plugin type for ${n.name}. Please assign a "type" to your plugin.`);if(!r)throw new Error(`[PluginService]: no plugin name for ${n.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(n.pluginName)}_scheduleInitPlugin(){this._flushTimer===void 0&&(this._flushTimer=setTimeout(()=>{this._pluginHolderForUniver.started||this._pluginHolderForUniver.start(),this._flushPlugins(),this._clearFlushTimer()},TE))}_clearFlushTimer(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)}_flushPlugins(){this._pluginHolderForUniver.flush();for(const[n,t]of this._pluginHoldersForTypes)t.started&&t.flush()}},d.PluginService=Gc([Kr(0,mt(Ot))],d.PluginService);let Yr=class extends Ke{constructor(n,t,r,s,i){super();R(this,"_started",!1);R(this,"_warnedAboutOnStartingDeprecation",!1);R(this,"_pluginRegistry",new wE);R(this,"_pluginStore",new yE);R(this,"_pluginsInBatches",[]);this._checkPluginRegistered=n,this._registerPlugin=t,this._logService=r,this._injector=s,this._lifecycleService=i,this.disposeWithMe(this._lifecycleService.lifecycle$.pipe(re.skip(1)).subscribe(o=>{this._pluginsInBatches.forEach(a=>this._runStage(a,o))}))}get started(){return this._started}dispose(){super.dispose(),this._pluginStore.forEachPlugin(n=>n.dispose()),this._pluginStore.removePlugins(),this._pluginRegistry.removePlugins(),this._pluginsInBatches.length=0}register(n,t){this._pluginRegistry.registerPlugin(n,t)}immediateInitPlugin(n){const t=this._initPlugin(n,void 0);this._pluginsRunLifecycle([t])}start(){this._started||(this._started=!0,this.flush())}flush(){if(!this._started)return;const n=this._pluginRegistry.getRegisterPlugins().map(({plugin:t,options:r})=>this._initPlugin(t,r));n.length&&(this._pluginsRunLifecycle(n),this._pluginRegistry.removePlugins())}_initPlugin(n,t){const r=n[zc];if(r){const i=()=>{const o=r.find(a=>!this._checkPluginRegistered(a));return o?(this._logService.debug("[PluginService]",`Plugin "${n.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(n,t);return this._pluginStore.addPlugin(s),this._logService.debug("[PluginService]",`Plugin "${s.getPluginName()}" registered.`),s}_pluginsRunLifecycle(n){Uc(this._lifecycleService.stage).subscribe(t=>this._runStage(n,t)),this._pluginsInBatches.push(n)}_runStage(n,t){n.forEach(r=>{switch(t){case Pe.Starting:r.onStarting();break;case Pe.Ready:r.onReady();break;case Pe.Rendered:r.onRendered();break;case Pe.Steady:r.onSteady();break}})}};Yr=Gc([Kr(2,Rt),Kr(3,mt(Ot)),Kr(4,mt(d.LifecycleService))],Yr);function Kc(e,n){if(!n)return e;const t=[];for(const r of e){const s=n.find(([i])=>i===r[0]);if(s){if(s[1]===null)continue;t.push([r[0],s[1]])}else t.push(r)}return t}var LE=Object.defineProperty,DE=Object.getOwnPropertyDescriptor,UE=(e,n,t,r)=>{for(var s=r>1?void 0:r?DE(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&LE(n,t,s),s},Yc=(e,n)=>(t,r)=>n(t,r,e);let Ei=class extends Ke{constructor(e,n){super(),this._resourceManagerService=e,this._univerInstanceService=n,this._init()}_init(){const e=t=>{t.businesses.forEach(r=>{switch(r){case we.UNRECOGNIZED:case we.UNIVER_UNKNOWN:case we.UNIVER_SLIDE:case we.UNIVER_DOC:{this._univerInstanceService.getAllUnitsForType(we.UNIVER_DOC).forEach(s=>{const o=(s.getSnapshot().resources||[]).find(a=>a.name===t.pluginName);if(o)try{const a=t.parseJson(o.data);t.onLoad(s.getUnitId(),a)}catch{console.error(`Load Document{${s.getUnitId()}} Resources{${t.pluginName}} Data Error.`)}});break}case we.UNIVER_SHEET:this._univerInstanceService.getAllUnitsForType(we.UNIVER_SHEET).forEach(s=>{const o=(s.getSnapshot().resources||[]).find(a=>a.name===t.pluginName);if(o)try{const a=t.parseJson(o.data);t.onLoad(s.getUnitId(),a)}catch{console.error(`Load Workbook{${s.getUnitId()}} Resources{${t.pluginName}} Data Error.`)}})}})};this._resourceManagerService.getAllResourceHooks().forEach(t=>e(t)),this.disposeWithMe(this._resourceManagerService.register$.subscribe(t=>e(t))),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(we.UNIVER_SHEET).subscribe(t=>{this._resourceManagerService.loadResources(t.getUnitId(),t.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(we.UNIVER_DOC).subscribe(t=>{const r=t.getUnitId();yo(r)||this._resourceManagerService.loadResources(t.getUnitId(),t.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(we.UNIVER_SHEET).subscribe(t=>{this._resourceManagerService.unloadResources(t.getUnitId())})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(we.UNIVER_DOC).subscribe(t=>{this._resourceManagerService.unloadResources(t.getUnitId())}))}saveUnit(e){const n=this._univerInstanceService.getUnit(e);if(!n)return null;const t=this._resourceManagerService.getResources(e,n.type),r=W.deepClone(n.getSnapshot());return r.resources=t,r}};Ei=UE([Yc(0,mt(Vr)),Yc(1,mt(sn))],Ei);const Ci=gt("resource-loader-service");class Xc extends Ke{constructor(){super(...arguments);R(this,"_resourceMap",new Map);R(this,"_register$",new re.Subject);R(this,"register$",this._register$.asObservable())}getAllResourceHooks(){return[...this._resourceMap.values()]}getResources(t,r){return r?this.getResourcesByType(t,r):this.getAllResourceHooks().map(o=>{const a=o.toJson(t);return{name:o.pluginName,data:a}})}getResourcesByType(t,r){return this.getAllResourceHooks().filter(o=>o.businesses.includes(r)).map(o=>{const a=o.toJson(t);return{name:o.pluginName,data:a}})}registerPluginResource(t){const r=t.pluginName;if(this._resourceMap.has(r))throw new Error(`the pluginName is registered {${r}}`);return this._resourceMap.set(r,t),this._register$.next(t),We(()=>this._resourceMap.delete(r))}disposePluginResource(t){this._resourceMap.delete(t)}loadResources(t,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(t,a)}catch{console.error("LoadResources Error!")}})}unloadResources(t){this.getAllResourceHooks().forEach(r=>{r.onUnLoad(t)})}dispose(){this._register$.complete(),this._resourceMap.clear()}}class Ri extends Ke{constructor(){super();R(this,"_currentTheme");R(this,"_currentTheme$",new re.BehaviorSubject({}));R(this,"currentTheme$",this._currentTheme$.asObservable());this.disposeWithMe(We(()=>this._currentTheme$.complete()))}getCurrentTheme(){if(!this._currentTheme)throw new Error("[ThemeService]: current theme is not set!");return this._currentTheme}setTheme(t){this._currentTheme=t,this._currentTheme$.next(t)}}class Qc{constructor(n={},t){R(this,"_startedTypes",new Set);R(this,"_injector");const r=this._injector=PE(t,n==null?void 0:n.override),{theme:s,locale:i,locales:o,logLevel:a}=n;s&&this._injector.get(Ri).setTheme(s),o&&this._injector.get(nr).load(o),i&&this._injector.get(nr).setLocale(i),a&&this._injector.get(Rt).setLogLevel(a),this._init(r)}get _univerInstanceService(){return this._injector.get(sn)}get _pluginService(){return this._injector.get(d.PluginService)}__getInjector(){return this._injector}dispose(){this._injector.dispose()}setLocale(n){this._injector.get(nr).setLocale(n)}createUnit(n,t){return this._univerInstanceService.createUnit(n,t)}createUniverSheet(n){return this._injector.get(Rt).warn("[Univer]: Univer.createUniverSheet is deprecated, use createUnit instead"),this._univerInstanceService.createUnit(we.UNIVER_SHEET,n)}createUniverDoc(n){return this._injector.get(Rt).warn("[Univer]: Univer.createUniverDoc is deprecated, use createUnit instead"),this._univerInstanceService.createUnit(we.UNIVER_DOC,n)}createUniverSlide(n){return this._injector.get(Rt).warn("[Univer]: Univer.createUniverSlide is deprecated, use createUnit instead"),this._univerInstanceService.createUnit(we.UNIVER_SLIDE,n)}_init(n){this._univerInstanceService.registerCtorForType(we.UNIVER_SHEET,d.Workbook),this._univerInstanceService.registerCtorForType(we.UNIVER_DOC,Ut),this._univerInstanceService.registerCtorForType(we.UNIVER_SLIDE,fi);const t=n.get(sn);t.__setCreateHandler((r,s,i,o)=>{if(!this._startedTypes.has(r)){this._pluginService.startPluginForType(r),this._startedTypes.add(r);const l=n.createInstance(i,s);return t.__addUnit(l,o),this._tryProgressToReady(),l}const a=n.createInstance(i,s);return t.__addUnit(a,o),a})}_tryProgressToReady(){this._injector.get(d.LifecycleService).stage<Pe.Ready&&(this._injector.get(d.LifecycleService).stage=Pe.Ready)}registerPlugin(n,t){this._pluginService.registerPlugin(n,t)}}function PE(e,n){const t=Kc([[$c],[nr],[Ri],[d.LifecycleService],[d.PluginService],[Gr],[sn,{useClass:d.UniverInstanceService}],[Wc,{useClass:Vc}],[Rt,{useClass:fa,lazy:!0}],[bt,{useClass:d.CommandService}],[Gt,{useClass:d.LocalUndoRedoService,lazy:!0}],[Bc,{useClass:jc}],[Bn,{useClass:ha}],[Vr,{useClass:Xc,lazy:!0}],[Ci,{useClass:Ei,lazy:!0}],[Hc,{useClass:d.AuthzIoLocalService,lazy:!0}]],n),r=e?e.createChild(t):new Ot(t);return ea(r,[[Gr],[Ci]]),r}var FE=Object.defineProperty,kE=Object.getOwnPropertyDescriptor,xE=(e,n,t,r)=>{for(var s=r>1?void 0:r?kE(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&FE(n,t,s),s},Jc=(e,n)=>(t,r)=>n(t,r,e);d.FHooks=class extends xn{constructor(n,t){super(),this._injector=n,this._lifecycleService=t}onStarting(n){return We(this._lifecycleService.lifecycle$.pipe(re.filter(t=>t===Pe.Starting)).subscribe(n))}onReady(n){return We(this._lifecycleService.lifecycle$.pipe(re.filter(t=>t===Pe.Ready)).subscribe(n))}onRendered(n){return We(this._lifecycleService.lifecycle$.pipe(re.filter(t=>t===Pe.Rendered)).subscribe(n))}onSteady(n){return We(this._lifecycleService.lifecycle$.pipe(re.filter(t=>t===Pe.Steady)).subscribe(n))}onBeforeUndo(n){return this._injector.get(bt).beforeCommandExecuted(r=>{if(r.id===er.id){const i=this._injector.get(Gt).pitchTopUndoElement();i&&n(i)}})}onUndo(n){return this._injector.get(bt).onCommandExecuted(r=>{if(r.id===er.id){const i=this._injector.get(Gt).pitchTopUndoElement();i&&n(i)}})}onBeforeRedo(n){return this._injector.get(bt).beforeCommandExecuted(r=>{if(r.id===tr.id){const i=this._injector.get(Gt).pitchTopRedoElement();i&&n(i)}})}onRedo(n){return this._injector.get(bt).onCommandExecuted(r=>{if(r.id===tr.id){const i=this._injector.get(Gt).pitchTopRedoElement();i&&n(i)}})}},d.FHooks=xE([Jc(0,mt(Ot)),Jc(1,mt(d.LifecycleService))],d.FHooks);var HE=Object.defineProperty,BE=Object.getOwnPropertyDescriptor,jE=(e,n,t,r)=>{for(var s=r>1?void 0:r?BE(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&HE(n,t,s),s},Ii=(e,n)=>(t,r)=>n(t,r,e);d.FUniver=class extends xn{constructor(n,t,r){super(),this._injector=n,this._commandService=t,this._univerInstanceService=r}static newAPI(n){return(n instanceof Qc?n.__getInjector():n).createInstance(d.FUniver)}disposeUnit(n){return this._univerInstanceService.disposeUnit(n)}getCurrentLifecycleStage(){return this._injector.get(d.LifecycleService).stage}undo(){return this._commandService.executeCommand(er.id)}redo(){return this._commandService.executeCommand(tr.id)}onBeforeCommandExecute(n){return this._commandService.beforeCommandExecuted((t,r)=>{n(t,r)})}onCommandExecuted(n){return this._commandService.onCommandExecuted((t,r)=>{n(t,r)})}executeCommand(n,t,r){return this._commandService.executeCommand(n,t,r)}getHooks(){return this._injector.createInstance(d.FHooks)}},d.FUniver=jE([Ii(0,mt(Ot)),Ii(1,bt),Ii(2,sn)],d.FUniver);function Zc(e){return/^-?\d+(\.\d+)?$/.test(e)}function $E(e){return Zc(e)?Number(e)<=Number.MAX_SAFE_INTEGER:!1}class vi{constructor(){R(this,"_data",[])}static create(){return new vi}add(n){this._data.indexOf(n)>-1||this._data.push(n)}delete(n){const t=this._data.indexOf(n);this._data.splice(t,1)}getData(){return this._data}}class Si{constructor(){R(this,"_data",new Map)}static create(){return new Si}add(n,t){this._data.has(n)||this._data.set(n,t)}delete(n){this._data.delete(n)}getData(){return this._data}}function WE(e){const n=new MessageChannel;let t=!1;const r=()=>{t||e()};return n.port1.onmessage=r,n.port2.postMessage(null),()=>{t=!0,n.port1.close(),n.port2.close()}}function VE(e,n){return n.forEach(t=>e.add(t)),e}function zE(e,n,t,r){var c;if(n==="")return e;const s={id:"mock-id",body:e,documentStyle:{}},i=new Ut(s),o=n.length;let a;for(;(a=(r?i.getBody().dataStream:i.getBody().dataStream.toLowerCase()).indexOf(n))>=0;){const u=new Je,h=rn.getInstance();if(a>0&&u.retain(a),t.length>0){const f=i.sliceBody(a,a+o),g={dataStream:t};if(Array.isArray(f==null?void 0:f.textRuns)&&f.textRuns.length&&(g.textRuns=[{...f.textRuns[0],st:0,ed:t.length}]),(c=f==null?void 0:f.customRanges)!=null&&c.length){const E=f.customRanges[0];g.customRanges=[{...E,startIndex:0,endIndex:t.length-1}]}u.insert(t.length,g)}u.delete(o),i.apply(h.editOp(u.serialize()))}const l=i.getBody();return i.dispose(),l}const GE="__default_document_sub_component_id20231101__";class qc{constructor(){R(this,"skipNextObservers",!1);R(this,"lastReturnValue");R(this,"isStopPropagation",!1)}stopPropagation(){this.isStopPropagation=!0}}class KE extends re.Subject{constructor(){super(...arguments);R(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(t){let r;typeof t=="function"?r={next:([i,o])=>t(i,o)}:r=t;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(t=>{var r;return(r=t.complete)==null?void 0:r.call(t)}),this._sortedObservers.length=0}emitEvent(t){var r;if(!this.closed){const s=new qc;s.lastReturnValue=t;for(const i of this._sortedObservers){const o=(r=i.next)==null?void 0:r.call(i,[t,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 YE(e){return new re.Observable(n=>{const t=e.subscribeEvent(r=>{n.next(r)});return()=>t.unsubscribe()})}const XE=gt("ILocalStorageService");function QE(e){return!(e.length===0||e.length>31||e.startsWith("'")||e.endsWith("'")||/[:\\\/\?\*\[\]]/.test(e))}function JE(e){return new Promise(n=>setTimeout(n,e))}const ZE=["script","style","meta","comment","link"];var eu=(e=>(e[e.INFO=0]="INFO",e[e.STOP=1]="STOP",e[e.WARNING=2]="WARNING",e))(eu||{}),tu=(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))(tu||{}),nu=(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))(nu||{}),ru=(e=>(e[e.TEXT=0]="TEXT",e[e.ARROW=1]="ARROW",e[e.CUSTOM=2]="CUSTOM",e))(ru||{}),su=(e=>(e.VALID="valid",e.INVALID="invalid",e.VALIDATING="validating",e))(su||{}),iu=(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))(iu||{});const ou=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Oi=1,rr=8;class bi{static from(n){if(!(n instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[t,r]=new Uint8Array(n,0,2);if(t!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=r>>4;if(s!==Oi)throw new Error(`Got v${s} data when expected v${Oi}.`);const i=ou[r&15];if(!i)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(n,2,1),[a]=new Uint32Array(n,4,1);return new bi(a,o,i,n)}constructor(n,t=64,r=Float64Array,s){if(isNaN(n)||n<0)throw new Error(`Unpexpected numItems value: ${n}.`);this.numItems=+n,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=r,this.IndexArrayType=n<65536?Uint16Array:Uint32Array;const i=ou.indexOf(this.ArrayType),o=n*2*this.ArrayType.BYTES_PER_ELEMENT,a=n*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,rr,n),this.coords=new this.ArrayType(this.data,rr+a+l,n*2),this._pos=n*2,this._finished=!0):(this.data=new ArrayBuffer(rr+o+a+l),this.ids=new this.IndexArrayType(this.data,rr,n),this.coords=new this.ArrayType(this.data,rr+a+l,n*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(Oi<<4)+i]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=n)}add(n,t){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=n,this.coords[this._pos++]=t,r}finish(){const n=this._pos>>1;if(n!==this.numItems)throw new Error(`Added ${n} items when expected ${this.numItems}.`);return yi(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(n,t,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 u=l.pop()||0,h=l.pop()||0,f=l.pop()||0;if(h-f<=a){for(let M=f;M<=h;M++){const O=o[2*M],P=o[2*M+1];O>=n&&O<=r&&P>=t&&P<=s&&c.push(i[M])}continue}const g=f+h>>1,E=o[2*g],I=o[2*g+1];E>=n&&E<=r&&I>=t&&I<=s&&c.push(i[g]),(u===0?n<=E:t<=I)&&(l.push(f),l.push(g-1),l.push(1-u)),(u===0?r>=E:s>=I)&&(l.push(g+1),l.push(h),l.push(1-u))}return c}within(n,t,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 u=a.pop()||0,h=a.pop()||0,f=a.pop()||0;if(h-f<=o){for(let M=f;M<=h;M++)lu(i[2*M],i[2*M+1],n,t)<=c&&l.push(s[M]);continue}const g=f+h>>1,E=i[2*g],I=i[2*g+1];lu(E,I,n,t)<=c&&l.push(s[g]),(u===0?n-r<=E:t-r<=I)&&(a.push(f),a.push(g-1),a.push(1-u)),(u===0?n+r>=E:t+r>=I)&&(a.push(g+1),a.push(h),a.push(1-u))}return l}}function yi(e,n,t,r,s,i){if(s-r<=t)return;const o=r+s>>1;au(e,n,o,r,s,i),yi(e,n,t,r,o-1,1-i),yi(e,n,t,o+1,s,1-i)}function au(e,n,t,r,s,i){for(;s>r;){if(s-r>600){const c=s-r+1,u=t-r+1,h=Math.log(c),f=.5*Math.exp(2*h/3),g=.5*Math.sqrt(h*f*(c-f)/c)*(u-c/2<0?-1:1),E=Math.max(r,Math.floor(t-u*f/c+g)),I=Math.min(s,Math.floor(t+(c-u)*f/c+g));au(e,n,t,E,I,i)}const o=n[2*t+i];let a=r,l=s;for(sr(e,n,r,t),n[2*s+i]>o&&sr(e,n,r,s);a<l;){for(sr(e,n,a,l),a++,l--;n[2*a+i]<o;)a++;for(;n[2*l+i]>o;)l--}n[2*r+i]===o?sr(e,n,r,l):(l++,sr(e,n,l,s)),l<=t&&(r=l+1),t<=l&&(s=l-1)}}function sr(e,n,t,r){wi(e,t,r),wi(n,2*t,2*r),wi(n,2*t+1,2*r+1)}function wi(e,n,t){const r=e[n];e[n]=e[t],e[t]=r}function lu(e,n,t,r){const s=e-t,i=n-r;return s*s+i*i}function cu(e,n,t=0,r=e.length-1,s=qE){for(;r>t;){if(r-t>600){const l=r-t+1,c=n-t+1,u=Math.log(l),h=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*h*(l-h)/l)*(c-l/2<0?-1:1),g=Math.max(t,Math.floor(n-c*h/l+f)),E=Math.min(r,Math.floor(n+(l-c)*h/l+f));cu(e,n,g,E,s)}const i=e[n];let o=t,a=r;for(ir(e,t,n),s(e[r],i)>0&&ir(e,t,r);o<a;){for(ir(e,o,a),o++,a--;s(e[o],i)<0;)o++;for(;s(e[a],i)>0;)a--}s(e[t],i)===0?ir(e,t,a):(a++,ir(e,a,r)),a<=n&&(t=a+1),n<=a&&(r=a-1)}}function ir(e,n,t){const r=e[n];e[n]=e[t],e[t]=r}function qE(e,n){return e<n?-1:e>n?1:0}class uu{constructor(n=9){this._maxEntries=Math.max(4,n),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(n){let t=this.data;const r=[];if(!Qr(n,t))return r;const s=this.toBBox,i=[];for(;t;){for(let o=0;o<t.children.length;o++){const a=t.children[o],l=t.leaf?s(a):a;Qr(n,l)&&(t.leaf?r.push(a):Ni(n,l)?this._all(a,r):i.push(a))}t=i.pop()}return r}collides(n){let t=this.data;if(!Qr(n,t))return!1;const r=[];for(;t;){for(let s=0;s<t.children.length;s++){const i=t.children[s],o=t.leaf?this.toBBox(i):i;if(Qr(n,o)){if(t.leaf||Ni(n,o))return!0;r.push(i)}}t=r.pop()}return!1}load(n){if(!(n&&n.length))return this;if(n.length<this._minEntries){for(let r=0;r<n.length;r++)this.insert(n[r]);return this}let t=this._build(n.slice(),0,n.length-1,0);if(!this.data.children.length)this.data=t;else if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){const r=this.data;this.data=t,t=r}this._insert(t,this.data.height-t.height-1,!0)}return this}insert(n){return n&&this._insert(n,this.data.height-1),this}clear(){return this.data=On([]),this}remove(n,t){if(!n)return this;let r=this.data;const s=this.toBBox(n),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 u=e0(n,r.children,t);if(u!==-1)return r.children.splice(u,1),i.push(r),this._condense(i),this}!c&&!r.leaf&&Ni(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(n){return n}compareMinX(n,t){return n.minX-t.minX}compareMinY(n,t){return n.minY-t.minY}toJSON(){return this.data}fromJSON(n){return this.data=n,this}_all(n,t){const r=[];for(;n;)n.leaf?t.push(...n.children):r.push(...n.children),n=r.pop();return t}_build(n,t,r,s){const i=r-t+1;let o=this._maxEntries,a;if(i<=o)return a=On(n.slice(t,r+1)),Sn(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));hu(n,t,r,c,this.compareMinX);for(let u=t;u<=r;u+=c){const h=Math.min(u+c-1,r);hu(n,u,h,l,this.compareMinY);for(let f=u;f<=h;f+=l){const g=Math.min(f+l-1,h);a.children.push(this._build(n,f,g,s-1))}}return Sn(a,this.toBBox),a}_chooseSubtree(n,t,r,s){for(;s.push(t),!(t.leaf||s.length-1===r);){let i=1/0,o=1/0,a;for(let l=0;l<t.children.length;l++){const c=t.children[l],u=Ai(c),h=r0(n,c)-u;h<o?(o=h,i=u<i?u:i,a=c):h===o&&u<i&&(i=u,a=c)}t=a||t.children[0]}return t}_insert(n,t,r){const s=r?n:this.toBBox(n),i=[],o=this._chooseSubtree(s,this.data,t,i);for(o.children.push(n),ar(o,s);t>=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(s,i,t)}_split(n,t){const r=n[t],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,Sn(r,this.toBBox),Sn(a,this.toBBox),t?n[t-1].children.push(a):this._splitRoot(r,a)}_splitRoot(n,t){this.data=On([n,t]),this.data.height=n.height+1,this.data.leaf=!1,Sn(this.data,this.toBBox)}_chooseSplitIndex(n,t,r){let s,i=1/0,o=1/0;for(let a=t;a<=r-t;a++){const l=or(n,0,a,this.toBBox),c=or(n,a,r,this.toBBox),u=s0(l,c),h=Ai(l)+Ai(c);u<i?(i=u,s=a,o=h<o?h:o):u===i&&h<o&&(o=h,s=a)}return s||r-t}_chooseSplitAxis(n,t,r){const s=n.leaf?this.compareMinX:t0,i=n.leaf?this.compareMinY:n0,o=this._allDistMargin(n,t,r,s),a=this._allDistMargin(n,t,r,i);o<a&&n.children.sort(s)}_allDistMargin(n,t,r,s){n.children.sort(s);const i=this.toBBox,o=or(n,0,t,i),a=or(n,r-t,r,i);let l=Xr(o)+Xr(a);for(let c=t;c<r-t;c++){const u=n.children[c];ar(o,n.leaf?i(u):u),l+=Xr(o)}for(let c=r-t-1;c>=t;c--){const u=n.children[c];ar(a,n.leaf?i(u):u),l+=Xr(a)}return l}_adjustParentBBoxes(n,t,r){for(let s=r;s>=0;s--)ar(t[s],n)}_condense(n){for(let t=n.length-1,r;t>=0;t--)n[t].children.length===0?t>0?(r=n[t-1].children,r.splice(r.indexOf(n[t]),1)):this.clear():Sn(n[t],this.toBBox)}}function e0(e,n,t){if(!t)return n.indexOf(e);for(let r=0;r<n.length;r++)if(t(e,n[r]))return r;return-1}function Sn(e,n){or(e,0,e.children.length,n,e)}function or(e,n,t,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=n;i<t;i++){const o=e.children[i];ar(s,e.leaf?r(o):o)}return s}function ar(e,n){return e.minX=Math.min(e.minX,n.minX),e.minY=Math.min(e.minY,n.minY),e.maxX=Math.max(e.maxX,n.maxX),e.maxY=Math.max(e.maxY,n.maxY),e}function t0(e,n){return e.minX-n.minX}function n0(e,n){return e.minY-n.minY}function Ai(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function Xr(e){return e.maxX-e.minX+(e.maxY-e.minY)}function r0(e,n){return(Math.max(n.maxX,e.maxX)-Math.min(n.minX,e.minX))*(Math.max(n.maxY,e.maxY)-Math.min(n.minY,e.minY))}function s0(e,n){const t=Math.max(e.minX,n.minX),r=Math.max(e.minY,n.minY),s=Math.min(e.maxX,n.maxX),i=Math.min(e.maxY,n.maxY);return Math.max(0,s-t)*Math.max(0,i-r)}function Ni(e,n){return e.minX<=n.minX&&e.minY<=n.minY&&n.maxX<=e.maxX&&n.maxY<=e.maxY}function Qr(e,n){return n.minX<=e.maxX&&n.minY<=e.maxY&&n.maxX>=e.minX&&n.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 hu(e,n,t,r,s){const i=[n,t];for(;i.length;){if(t=i.pop(),n=i.pop(),t-n<=r)continue;const o=n+Math.ceil((t-n)/r/2)*r;cu(e,o,n,t,s),i.push(n,o,o,t)}}class i0{constructor(n=!1){R(this,"_tree",new Map);R(this,"_oneCellCache",new Map);R(this,"_kdTree",new Map);this._enableOneCellCache=n}dispose(){this.clear()}getTree(n,t){return this._tree.has(n)||this._tree.set(n,new Map),this._tree.get(n).has(t)||this._tree.get(n).set(t,new uu),this._tree.get(n).get(t)}_getOneCellCache(n,t,r,s){return this._oneCellCache.has(n)||this._oneCellCache.set(n,new Map),this._oneCellCache.get(n).has(t)||this._oneCellCache.get(n).set(t,new Map),this._oneCellCache.get(n).get(t).has(r)||this._oneCellCache.get(n).get(t).set(r,new Map),this._oneCellCache.get(n).get(t).get(r).has(s)||this._oneCellCache.get(n).get(t).get(r).set(s,new Set),this._oneCellCache.get(n).get(t).get(r).get(s)}_removeOneCellCache(n,t,r,s,i){const o=this._oneCellCache.get(n);if(!o)return;const a=o.get(t);if(!a)return;const l=a.get(r);if(!l)return;const c=l.get(s);c&&c.delete(i)}_removeCellCacheByRange(n){const{unitId:t,sheetId:r,range:s,id:i}=n,o=this._oneCellCache.get(t);if(!o)return;const a=o.get(r);if(!a)return;const{startRow:l,startColumn:c,endRow:u,endColumn:h}=s;for(let f=l;f<=u;f++){const g=a.get(f);if(g)for(let E=c;E<=h;E++){const I=g.get(E);I&&I.delete(i)}}}_insertOneCellCache(n,t,r,s,i){this._getOneCellCache(n,t,r,s).add(i)}_getRdTreeItems(n){const t=[];for(const[r,s]of n)for(const[i,o]of s)t.push({x:i,y:r,ids:o});return t}_searchByOneCellCache(n){var E;const{unitId:t,sheetId:r,range:s}=n,{startRow:i,startColumn:o,endRow:a,endColumn:l}=s,c=(E=this._kdTree.get(t))==null?void 0:E.get(r);if(!c)return[];const{tree:u,items:h}=c,f=u.range(o,i,l,a),g=[];for(const I of f){const M=h[I];g.push(...Array.from(M.ids))}return g}openKdTree(){var n;for(const[t,r]of this._oneCellCache){this._kdTree.has(t)||this._kdTree.set(t,new Map);for(const[s,i]of r){const o=this._getRdTreeItems(i),a=new bi(o.length);(n=this._kdTree.get(t))==null||n.set(s,{tree:a,items:o});for(const l of o)a.add(l.x,l.y);a.finish()}}}closeKdTree(){var n;for(const[t,r]of this._oneCellCache)for(const[s,i]of r)(n=this._kdTree.get(t))==null||n.set(s,void 0)}insert(n){const{unitId:t,sheetId:r,range:s,id:i}=n;if(!t||t.length===0)return;let{startRow:o,endRow:a,startColumn:l,endColumn:c}=s;if(this._enableOneCellCache&&o===a&&l===c){this._insertOneCellCache(t,r,o,l,i);return}const u=this.getTree(t,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),u.insert({minX:l,minY:o,maxX:c,maxY:a,id:i})}bulkInsert(n){for(const t of n)this.insert(t)}*searchGenerator(n){var a;const{unitId:t,sheetId:r,range:s}=n;if(this._enableOneCellCache){const l=this._searchByOneCellCache(n);for(const c of l)yield c}const i=(a=this._tree.get(t))==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(n,t){const r=new Set;for(const s of n)for(const i of this.searchGenerator(s))(t==null?void 0:t.has(i))!==!0&&r.add(i);return r}removeById(n,t){var r,s;t?((r=this._tree.get(n))==null||r.delete(t),(s=this._oneCellCache.get(n))==null||s.delete(t)):(this._tree.delete(n),this._oneCellCache.delete(n))}_removeRTreeItem(n){const{unitId:t,sheetId:r,range:s,id:i}=n,o=this.getTree(t,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(n){const{unitId:t,sheetId:r,range:s,id:i}=n,{startRow:o,startColumn:a,endRow:l,endColumn:c}=s;this._enableOneCellCache?o===l&&a===c?this._removeOneCellCache(t,r,s.startRow,s.startColumn,i):(this._removeCellCacheByRange(n),this._removeRTreeItem(n)):this._removeRTreeItem(n)}bulkRemove(n){for(const t of n)this.remove(t)}clear(){this._tree.clear(),this._oneCellCache.clear()}toJSON(){const n={};return this._tree.forEach((t,r)=>{n[r]={},t.forEach((s,i)=>{n[r][i]=s.toJSON()})}),n}fromJSON(n){this._tree.clear();for(const t in n){this._tree.set(t,new Map);for(const r in n[t]){const s=new uu;s.fromJSON(n[t][r]),this._tree.get(t).set(r,s)}}}}pu(),d.ABCToNumber=y_,d.AbsoluteRefType=ze,d.ActionIterator=In,d.AlignTypeH=Fl,d.AlignTypeV=kl,d.ArrangeTypeEnum=Bl,d.ArrowsAndMarkersShapes=Da,d.AsyncInterceptorManager=Ug,d.AutoFillSeries=Ia,d.BaselineOffset=Dt,d.BasicShapes=La,d.BlockType=gl,d.BooleanNumber=Re,d.BorderStyleTypes=He,d.BorderType=va,d.BuildTextUtils=Ft,d.BulletAlignment=Kn,d.COLORS=Bs,d.CellValueType=jt,d.Color=tn,d.ColorBuilder=Nr,d.ColorKit=It,d.ColorType=_t,d.ColumnSeparatorType=El,d.CommandType=jn,d.CommonHideTypes=Sa,d.ConfigService=jc,d.ContextService=ha,d.CopyPasteType=Oa,d.CustomCommandExecutionError=Ds,d.CustomDecorationType=pn,d.CustomRangeType=Yn,d.DEFAULT_CELL=d_,d.DEFAULT_DOC=hi,d.DEFAULT_DOCUMENT_SUB_COMPONENT_ID=GE,d.DEFAULT_EMPTY_DOCUMENT_VALUE=bo,d.DEFAULT_RANGE=u_,d.DEFAULT_RANGE_ARRAY=c_,d.DEFAULT_SELECTION=h_,d.DEFAULT_SLIDE=qa,d.DEFAULT_STYLES=et,d.DEFAULT_WORKSHEET_COLUMN_COUNT=vc,d.DEFAULT_WORKSHEET_COLUMN_COUNT_KEY=Vp,d.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT=yc,d.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY=Yp,d.DEFAULT_WORKSHEET_COLUMN_WIDTH=Oc,d.DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY=Gp,d.DEFAULT_WORKSHEET_ROW_COUNT=Ic,d.DEFAULT_WORKSHEET_ROW_COUNT_KEY=Wp,d.DEFAULT_WORKSHEET_ROW_HEIGHT=Sc,d.DEFAULT_WORKSHEET_ROW_HEIGHT_KEY=zp,d.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH=bc,d.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY=Kp,d.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY=Es,d.DOCS_NORMAL_EDITOR_UNIT_ID_KEY=ps,d.DOCS_ZEN_EDITOR_UNIT_ID_KEY=Oo,d.DOC_RANGE_TYPE=za,d.DashStyleType=bl,d.DataStreamTreeNodeType=mc,d.DataStreamTreeTokenType=Pt,d.DataValidationErrorStyle=eu,d.DataValidationImeMode=tu,d.DataValidationOperator=nu,d.DataValidationRenderMode=ru,d.DataValidationStatus=su,d.DataValidationType=iu,d.DeleteDirection=ba,d.DependentOn=ME,d.DesktopLogService=fa,d.DeveloperMetadataVisibility=ya,d.Dimension=wa,d.Direction=Aa,d.Disposable=Ke,d.DisposableCollection=Ps,d.DocStyleType=dl,d.DocumentDataModel=Ut,d.DocumentFlavor=ml,d.DrawingTypeEnum=jl,d.EDITOR_ACTIVATED=Mc,d.EXTENSION_NAMES=el,d.ErrorService=$c,d.EventState=qc,d.EventSubject=KE,d.FBase=xn,d.FOCUSING_COMMON_DRAWINGS=lE,d.FOCUSING_DOC=Zn,d.FOCUSING_EDITOR_BUT_HIDDEN=nE,d.FOCUSING_EDITOR_INPUT_FORMULA=rE,d.FOCUSING_EDITOR_STANDALONE=iE,d.FOCUSING_FX_BAR_EDITOR=Lc,d.FOCUSING_PANEL_EDITOR=oE,d.FOCUSING_SHEET=vn,d.FOCUSING_SLIDE=qn,d.FOCUSING_UNIT=Jn,d.FOCUSING_UNIVER_EDITOR=sE,d.FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE=aE,d.FORMULA_EDITOR_ACTIVATED=cE,d.FollowNumberWithType=fl,d.FontItalic=br,d.FontStyleType=En,d.FontWeight=yr,d.FormatType=Na,d.GlyphType=de,d.GridType=_l,d.HLSColor=$a,d.HorizontalAlign=Bt,d.IAuthzIoService=Hc,d.ICommandService=bt,d.IConfigService=Bc,d.IContextService=Bn,d.ILocalStorageService=XE,d.ILogService=Rt,d.IPermissionService=Wc,d.IResourceLoaderService=Ci,d.IResourceManagerService=Vr,d.IS_ROW_STYLE_PRECEDE_COLUMN_STYLE=xf,d.IUndoRedoService=Gt,d.IUniverInstanceService=sn,d.Inject=mt,d.Injector=Ot,d.InterceptorEffectEnum=gn,d.InterceptorManager=Mg,d.InterpolationPointType=Ta,d.JSON1=k_,d.JSONX=rn,d.LRUHelper=zn,d.LRUMap=Pr,d.LifecycleStages=Pe,d.LocaleService=nr,d.LocaleType=Wn,d.LogLevel=da,d.MOVE_BUFFER_VALUE=$n,d.Many=Uo,d.MemoryCursor=mn,d.NamedStyleType=Sl,d.NilCommand=ma,d.NumberUnitType=Pl,d.ObjectMatrix=wt,d.ObjectRelativeFromH=Dl,d.ObjectRelativeFromV=Ul,d.Optional=Po,d.OtherShapes=Ua,d.PRESET_LIST_TYPE=Xn,d.PageElementType=$l,d.PageOrientType=Hl,d.PageType=ii,d.ParagraphElementType=Rl,d.PermissionService=Vc,d.PermissionStatus=_i,d.Plugin=pi,d.PositionedObjectLayoutType=vl,d.PresetListType=Nt,d.ProtectionType=Ma,d.QuickListType=Vl,d.QuickListTypeMap=H_,d.RANGE_DIRECTION=Va,d.RANGE_TYPE=me,d.RCDisposable=Bg,d.RGBA_PAREN=pm,d.RGB_PAREN=_m,d.ROTATE_BUFFER_VALUE=Ra,d.RTree=i0,d.Range=_n,d.Rectangle=Vt,d.RediConsumer=Qo,d.RediContext=kn,d.RediError=Qe,d.RediProvider=Ms,d.RedoCommand=tr,d.RedoCommandId=Fc,d.RefAlias=b_,d.Registry=vi,d.RegistryAsMap=Si,d.RelativeDate=Fa,d.RelativeSlideLink=Wl,d.ResourceManagerService=Xc,d.RgbColor=Tr,d.RxDisposable=Hg,d.SHEET_EDITOR_UNITS=f_,d.SectionType=pl,d.Self=$o,d.SheetTypes=ka,d.SheetViewModel=Ac,d.SkipSelf=jo,d.SliceBodyType=ci,d.SlideDataModel=fi,d.SpacingRule=Ol,d.SpecialShapes=Pa,d.Styles=dc,d.THEME_COLORS=ja,d.TabStopAlignment=yl,d.TableAlignmentType=Al,d.TableCellHeightRule=Ml,d.TableLayoutType=Nl,d.TableSizeType=wl,d.TableTextWrapType=Tl,d.TextDecoration=xa,d.TextDirection=Vn,d.TextDirectionType=Cl,d.TextX=Je,d.TextXActionType=te,d.ThemeColor=Mr,d.ThemeColorType=st,d.ThemeColors=wr,d.ThemeService=Ri,d.Tools=W,d.UndoCommand=er,d.UndoCommandId=kc,d.UnitModel=xr,d.Univer=Qc,d.UniverInstanceType=we,d.UpdateDocsAttributeType=Ie,d.UserManagerService=Gr,d.VerticalAlign=Zt,d.VerticalAlignmentType=Ll,d.WithDependency=vg,d.WithNew=Wo,d.Worksheet=Qn,d.WrapStrategy=qt,d.WrapTextType=Il,d.afterInitApply=Xg,d.afterTime=Yg,d.awaitTime=JE,d.binSearchFirstGreaterThanTarget=Ca,d.binarySearchArray=Qg,d.bufferDebounceTime=Kg,d.cellToRange=Gm,d.characterSpacingControlType=xl,d.checkForSubstrings=Km,d.checkIfMove=qg,d.checkParagraphHasBullet=Ym,d.checkParagraphHasIndent=Xm,d.checkParagraphHasIndentByStyle=Ya,d.codeToBlob=Zg,d.composeBody=ui,d.composeInterceptors=na,d.composeStyles=xs,d.concatMatrixArray=i_,d.connectDependencies=Cg,d.connectInjector=Eg,d.convertBodyToHtml=mm,d.covertTextRunToHtml=Hs,d.createAsyncInterceptorKey=Lg,d.createDefaultUser=zr,d.createIdentifier=gt,d.createInterceptorKey=Tg,d.createInternalEditorID=Hf,d.createRowColIter=Ks,d.debounce=gf,d.dedupe=Lf,d.deepCompare=Ws,d.deleteContent=Qa,d.extractPureTextFromCell=Tc,d.forwardRef=Yf,d.fromCallback=_a,d.fromEventSubject=YE,d.fromObservable=xg,d.generateRandomId=en,d.get=Vd,d.getArrayLength=Wt,d.getBodySlice=zt,d.getBodySliceHtml=Ar,d.getBorderStyleType=Wm,d.getCellInfoInMergeData=Fm,d.getCellValueType=Lm,d.getColorStyle=yt,d.getCustomDecorationSlice=ac,d.getCustomRangeSlice=oc,d.getDocsUpdateBody=Vm,d.getIntersectRange=C_,d.getOriginCellValue=Qp,d.getReverseDirection=em,d.getWorksheetUID=tE,d.groupBy=Pf,d.handleStyleToString=$m,d.hashAlgorithm=Zm,d.horizontalLineSegmentsSubtraction=Ur,d.insertMatrixArray=Vs,d.insertTextToContent=Xa,d.isAsyncDependencyItem=Os,d.isAsyncHook=Rr,d.isBlackColor=Nm,d.isBooleanString=kf,d.isCellCoverable=Hm,d.isCellV=Um,d.isClassDependencyItem=Is,d.isCtor=Rs,d.isDisposable=Ns,d.isEmptyCell=Ga,d.isFactoryDependencyItem=vs,d.isFormulaId=jm,d.isFormulaString=Bm,d.isICellData=Mm,d.isInternalEditorID=yo,d.isNodeEnv=gm,d.isNullCell=Dm,d.isNumeric=Zc,d.isRangesEqual=Up,d.isRealNum=Jm,d.isSafeNumeric=$E,d.isSameStyleTextRun=Ka,d.isUnitRangesEqual=Pp,d.isValidRange=zm,d.isValueDependencyItem=Ss,d.isWhiteColor=Tm,d.makeArray=Ff,d.makeCellRangeToRangeData=xm,d.makeCellToSelection=km,d.makeCustomRangeStream=Sp,d.merge=Cf,d.mergeOverrideWithDependencies=Kc,d.mergeSets=VE,d.mergeWith=Ef,d.mergeWorksheetSnapshotWithDefault=wc,d.mixinClass=Pg,d.moveMatrixArray=Gs,d.moveRangeByOffset=g_,d.nameCharacterCheck=QE,d.normalizeBody=Z_,d.normalizeTextRuns=$r,d.numberToABC=A_,d.numberToListABC=N_,d.numfmt=s_,d.queryObjectMatrix=O_,d.registerDependencies=Ag,d.remove=Un,d.repeatStringNumTimes=ol,d.replaceInDocumentBody=zE,d.requestImmediateMacroTask=WE,d.rotate=Uf,d.searchArray=Jg,d.searchInOrderedArray=Ea,d.selectionToArray=Pm,d.sequence=sa,d.sequenceAsync=ra,d.sequenceExecute=Fs,d.sequenceExecuteAsync=Gg,d.set=If,d.setDependencies=hg,d.shallowEqual=ta,d.skipParseTagNames=ZE,d.sliceMatrixArray=o_,d.sortRules=T_,d.sortRulesByDesc=M_,d.sortRulesFactory=Gn,d.spliceArray=zs,d.splitIntoGrid=nl,d.takeAfter=pa,d.textDiff=So,d.throttle=Ng,d.toDisposable=We,d.touchDependencies=ea,d.updateAttributeByDelete=lc,d.updateAttributeByInsert=cc,d.useDependency=_g,d.useDependencyContext=yg,d.useDependencyContextValue=wg,d.useDependencyValue=Zo,d.useInjector=Jo,d.useObservable=Og,d.useUpdateBinder=bg,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
6
+ `):"",this.name="UnsubscriptionError",this.errors=t}});function ca(e,n){if(e){var t=e.indexOf(n);0<=t&&e.splice(t,1)}}var ha=function(){function e(n){this.initialTeardown=n,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var n,t,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=aa(o),l=a.next();!l.done;l=a.next()){var c=l.value;c.remove(this)}}catch(C){n={error:C}}finally{try{l&&!l.done&&(t=a.return)&&t.call(a)}finally{if(n)throw n.error}}else o.remove(this);var h=this.initialTeardown;if(Vn(h))try{h()}catch(C){i=C instanceof ks?C.errors:[C]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var f=aa(u),g=f.next();!g.done;g=f.next()){var p=g.value;try{da(p)}catch(C){i=i!=null?i:[],C instanceof ks?i=ua(ua([],la(i)),la(C.errors)):i.push(C)}}}catch(C){r={error:C}}finally{try{g&&!g.done&&(s=f.return)&&s.call(f)}finally{if(r)throw r.error}}}if(i)throw new ks(i)}},e.prototype.add=function(n){var t;if(n&&n!==this)if(this.closed)da(n);else{if(n instanceof e){if(n.closed||n._hasParent(this))return;n._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(n)}},e.prototype._hasParent=function(n){var t=this._parentage;return t===n||Array.isArray(t)&&t.includes(n)},e.prototype._addParent=function(n){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(n),t):t?[t,n]:n},e.prototype._removeParent=function(n){var t=this._parentage;t===n?this._parentage=null:Array.isArray(t)&&ca(t,n)},e.prototype.remove=function(n){var t=this._finalizers;t&&ca(t,n),n instanceof e&&n._removeParent(this)},e.EMPTY=function(){var n=new e;return n.closed=!0,n}(),e}();ha.EMPTY;function Xg(e){return e instanceof ha||e&&"closed"in e&&Vn(e.remove)&&Vn(e.add)&&Vn(e.unsubscribe)}function da(e){Vn(e)?e():e.unsubscribe()}function Ze(e){let n=!1;return e?Xg(e)?{dispose:()=>e.unsubscribe()}:typeof e=="function"?{dispose:()=>{n||(n=!0,e())}}:e:Ze(()=>{})}function Qg(e){return Ze(()=>{e.unsubscribe()})}class Fs{constructor(){R(this,"_disposables",new Set)}add(n){const t=Ze(n);return this._disposables.add(t),{dispose:()=>{t.dispose(),this._disposables.delete(t)}}}dispose(){this._disposables.forEach(n=>{n.dispose()}),this._disposables.clear()}}class rt{constructor(){R(this,"_disposed",!1);R(this,"_collection",new Fs)}disposeWithMe(n){return this._collection.add(n)}ensureNotDisposed(){if(this._disposed)throw new Error("[Disposable]: object is disposed!")}dispose(){this._disposed||(this._disposed=!0,this._collection.dispose())}}class Jg extends rt{constructor(){super(...arguments);R(this,"dispose$",new ce.Subject)}dispose(){super.dispose(),this.dispose$.next(),this.dispose$.complete()}}class Zg extends rt{constructor(t){super();R(this,"_ref",0);this._rootDisposable=t}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 Gn=St("univer.context-service");class fa extends rt{constructor(){super(...arguments);R(this,"_contextChanged$",new ce.Subject);R(this,"contextChanged$",this._contextChanged$.asObservable());R(this,"_contextMap",new Map)}dispose(){super.dispose(),this._contextChanged$.complete()}getContextValue(t){var r;return(r=this._contextMap.get(t))!=null?r:!1}setContextValue(t,r){this._contextMap.set(t,r),this._contextChanged$.next({[t]:r})}subscribeContextValue$(t){return new ce.Observable(r=>{const s=this._contextChanged$.pipe(ce.filter(i=>typeof i[t]<"u")).subscribe(i=>r.next(i[t]));return this._contextMap.has(t)&&r.next(this._contextMap.get(t)),()=>s.unsubscribe()})}}var ga=(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))(ga||{});const Tt=St("univer.log");class ma extends rt{constructor(){super(...arguments);R(this,"_logLevel",3)}debug(...t){this._logLevel>=4&&this._log(console.debug,...t)}log(...t){this._logLevel>=3&&this._log(console.log,...t)}warn(...t){this._logLevel>=2&&this._log(console.warn,...t)}error(...t){this._logLevel>=1&&this._log(console.error,...t)}setLogLevel(t){this._logLevel=t}_log(t,...r){const s=r[0];/^\[(.*?)\]/g.test(s)?t(`\x1B[97;104m${s}\x1B[0m`,...r.slice(1)):t(...r)}}var qg=Object.defineProperty,em=Object.getOwnPropertyDescriptor,tm=(e,n,t,r)=>{for(var s=r>1?void 0:r?em(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&qg(n,t,s),s},_a=(e,n)=>(t,r)=>n(t,r,e),Kn=(e=>(e[e.COMMAND=0]="COMMAND",e[e.OPERATION=1]="OPERATION",e[e.MUTATION=2]="MUTATION",e))(Kn||{});const Lt=St("anywhere.command-service");class nm{constructor(){R(this,"_commands",new Map);R(this,"_commandTypes",new Map)}registerCommand(n){if(this._commands.has(n.id))throw new Error(`[CommandRegistry]: command "${n.id}" has been registered before.`);return this._commands.set(n.id,n),this._commandTypes.set(n.id,n.type),Ze(()=>{this._commands.delete(n.id),this._commandTypes.delete(n.id)})}hasCommand(n){return this._commands.has(n)}getCommand(n){return this._commands.has(n)?[this._commands.get(n)]:null}getCommandType(n){return this._commandTypes.get(n)}}const pa={id:"nil",type:0,handler:()=>!0};d.CommandService=class extends rt{constructor(t,r){super();R(this,"_commandRegistry");R(this,"_beforeCommandExecutionListeners",[]);R(this,"_commandExecutedListeners",[]);R(this,"_multiCommandDisposables",new Map);R(this,"_commandExecutingLevel",0);R(this,"_commandExecutionStack",[]);this._injector=t,this._logService=r,this._commandRegistry=new nm,this._registerCommand(pa)}dispose(){super.dispose(),this._commandExecutedListeners.length=0,this._beforeCommandExecutionListeners.length=0}hasCommand(t){return this._commandRegistry.hasCommand(t)}registerCommand(t){return this._registerCommand(t)}registerMultipleCommand(t){return this._registerMultiCommand(t)}beforeCommandExecuted(t){if(this._beforeCommandExecutionListeners.indexOf(t)===-1)return this._beforeCommandExecutionListeners.push(t),Ze(()=>{const r=this._beforeCommandExecutionListeners.indexOf(t);this._beforeCommandExecutionListeners.splice(r,1)});throw new Error("[CommandService]: could not add a listener twice.")}onCommandExecuted(t){if(this._commandExecutedListeners.indexOf(t)===-1)return this._commandExecutedListeners.push(t),Ze(()=>{const r=this._commandExecutedListeners.indexOf(t);this._commandExecutedListeners.splice(r,1)});throw new Error("[CommandService]: could not add a listener twice.")}async executeCommand(t,r,s){try{const i=this._commandRegistry.getCommand(t);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 "${t}" is not registered.`)}catch(i){if(i instanceof Ps)return!1;throw i}}syncExecuteCommand(t,r,s){var i;try{const o=this._commandRegistry.getCommand(t);if(o){const[a]=o,l={id:a.id,type:a.type,params:r};if(a.type===2){const u=zf(this._commandExecutionStack,f=>f.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 "${t}" is not registered.`)}catch(o){if(o instanceof Ps)return!1;throw o}}_pushCommandExecutionStack(t){return this._commandExecutionStack.push(t),Ze(()=>Bn(this._commandExecutionStack,t))}_registerCommand(t){return this._commandRegistry.registerCommand(t)}_registerMultiCommand(t){const r=this._commandRegistry.getCommand(t.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 Fs;s=new rm(t.id),o.add(this._commandRegistry.registerCommand(s)),o.add(Ze(()=>{this._multiCommandDisposables.delete(t.id)})),this._multiCommandDisposables.set(t.id,o)}const i=s.registerImplementation(t);return Ze(()=>{var o;i.dispose(),s.hasImplementations()||(o=this._multiCommandDisposables.get(t.id))==null||o.dispose()})}async _execute(t,r,s){this._logService.debug("[CommandService]",`${"|-".repeat(Math.max(this._commandExecutingLevel,0))}executing command "${t.id}"`),this._commandExecutingLevel++;let i;try{i=await this._injector.invoke(t.handler,r,s),this._commandExecutingLevel--}catch(o){throw i=!1,this._commandExecutingLevel=0,o}return i}_syncExecute(t,r,s){this._logService.debug("[CommandService]",`${"|-".repeat(Math.max(0,this._commandExecutingLevel))}executing command "${t.id}".`),this._commandExecutingLevel++;let i;try{if(i=this._injector.invoke(t.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}},d.CommandService=tm([_a(0,Ot(Dt)),_a(1,Tt)],d.CommandService);class rm{constructor(n){R(this,"name");R(this,"multi",!0);R(this,"type",0);R(this,"priority",0);R(this,"_implementations",[]);R(this,"handler",async(n,t)=>{if(!this._implementations.length)return!1;const r=n.get(Tt),s=n.get(Gn),i=n.get(Dt);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,t)))return!0}return!1});this.id=n,this.name=n}registerImplementation(n){const t={command:n};return this._implementations.push(t),this._implementations.sort((r,s)=>s.command.priority-r.command.priority),Ze(()=>{const r=this._implementations.indexOf(t);this._implementations.splice(r,1)})}hasImplementations(){return this._implementations.length>0}}function $s(e,n,t){const r=e.map(s=>()=>n.syncExecuteCommand(s.id,s.params,t));return oa(r)}function sm(e,n,t){const r=e.map(s=>()=>n.executeCommand(s.id,s.params,t));return ia(r)}function Ea(e){return new ce.Observable(n=>{const t=e((...r)=>n.next(r));return()=>t==null?void 0:t.dispose()})}function Ca(e){return function(t){return new ce.Observable(r=>(t.subscribe({next:s=>{r.next(s),e(s)&&r.complete()},complete:()=>r.complete(),error:s=>r.error(s)}),()=>r.unsubscribe()))}}function im(e=0){return n=>{let t=[];return n.pipe(ce.tap(r=>t.push(r)),ce.debounceTime(e),ce.map(()=>t),ce.tap(()=>t=[]))}}function om(e){const n=new ce.ReplaySubject(1);return setTimeout(()=>n.next(),e),n.pipe(ce.take(1))}const am=e=>new Promise(n=>{ce.merge(Ea(e.onCommandExecuted.bind(e)).pipe(Ht.filter(([t])=>t.type===Kn.MUTATION)),ce.timer(300)).pipe(Ht.debounceTime(16),Ht.first()).subscribe(()=>{n()})});function va(e,n){let t=0,r=e.length-1;if(n<e[0])return 0;if(n>=e[e.length-1])return e.length-1;for(;t<=r;){if(e[t]===n){for(;t<e.length&&e[t]===n;)t++;return t}if(n>e[t]&&n<e[t+1])return t+1;if(e[r]===n){for(;r<e.length&&e[r]===n;)r++;return r}if(n>e[r-1]&&n<e[r])return r;t++,r--}return-1}function lm(e,n){let t=0,r=e.length-1;for(;t<=r;){const s=Math.floor((r+t)/2);if(n<e[s]&&(s===0||n>=e[s-1]))return s;if(n>=e[s])t=s+1;else if(n<e[s])r=s-1;else return-1}return-1}function Ra(e,n){let t=0,r=e.length;for(;t<r;){const s=Math.floor((t+r)/2);e[s]<=n?t=s+1:r=s}return t<e.length?t:e.length-1}function um(e,n,t=!1){let r=e.length-1;if(n<0||n<e[0])return 0;if(e.length<40||n<=e[20]||n>=e[r-20]?r=va(e,n):r=Ra(e,n),t){const s=e[r];return e.indexOf(s)}return r}function cm(e){const n=new Blob([e],{type:"text/javascript"});return window.URL.createObjectURL(n)}const Xn=2,Ia=1;function hm(e,n){if(n==null||e==null)return!0;const{left:t=0,top:r=0,height:s=0,width:i=0,angle:o=0}=n,{left:a=0,top:l=0,height:c=0,width:h=0,angle:u=0}=e,f=h,g=c,p=i,C=s;return Math.abs(a-t)>Xn||Math.abs(l-r)>Xn||Math.abs(f-p)>Xn||Math.abs(g-C)>Xn||Math.abs(u-o)>Ia}var Sa=(e=>(e[e.DEFAULT_SERIES=0]="DEFAULT_SERIES",e[e.ALTERNATE_SERIES=1]="ALTERNATE_SERIES",e))(Sa||{}),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||{}),Oa=(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))(Oa||{}),yt=(e=>(e[e.UNSUPPORTED=0]="UNSUPPORTED",e[e.RGB=1]="RGB",e[e.HEX=2]="HEX",e[e.THEME=3]="THEME",e))(yt||{}),ya=(e=>(e[e.ON=0]="ON",e[e.OFF=1]="OFF",e))(ya||{}),wa=(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))(wa||{}),ba=(e=>(e[e.LEFT=0]="LEFT",e[e.RIGHT=1]="RIGHT",e))(ba||{}),Aa=(e=>(e[e.DOCUMENT=0]="DOCUMENT",e[e.PROJECT=1]="PROJECT",e))(Aa||{}),Ta=(e=>(e[e.COLUMNS=0]="COLUMNS",e[e.ROWS=1]="ROWS",e))(Ta||{}),Na=(e=>(e[e.UP=0]="UP",e[e.RIGHT=1]="RIGHT",e[e.DOWN=2]="DOWN",e[e.LEFT=3]="LEFT",e))(Na||{});function dm(e){switch(e){case 3:return 1;case 1:return 3;case 0:return 2;case 2:return 0}}var Ma=(e=>(e[e.NUMBER_FORMAT_TYPE_UNSPECIFIED=0]="NUMBER_FORMAT_TYPE_UNSPECIFIED",e[e.TEXT=1]="TEXT",e[e.NUMBER=2]="NUMBER",e[e.PERCENT=3]="PERCENT",e[e.CURRENCY=4]="CURRENCY",e[e.DATE=5]="DATE",e[e.TIME=6]="TIME",e[e.DATE_TIME=7]="DATE_TIME",e[e.SCIENTIFIC=8]="SCIENTIFIC",e))(Ma||{}),Da=(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))(Da||{}),Qn=(e=>(e.EN_US="enUS",e.ZH_CN="zhCN",e.RU_RU="ruRU",e.ZH_TW="zhTW",e.VI_VN="viVN",e.FA_IR="faIR",e))(Qn||{}),La=(e=>(e[e.RANGE=0]="RANGE",e[e.SHEET=1]="SHEET",e))(La||{}),Ua=(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))(Ua||{}),Pa=(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))(Pa||{}),ka=(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))(ka||{}),Fa=(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))(Fa||{}),$a=(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))($a||{}),xa=(e=>(e[e.GRID=0]="GRID",e[e.KANBAN=1]="KANBAN",e[e.GANTT=2]="GANTT",e))(xa||{}),Jn=(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))(Jn||{}),Ha=(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))(Ha||{}),Xt=(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))(Xt||{}),ln=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TOP=1]="TOP",e[e.MIDDLE=2]="MIDDLE",e[e.BOTTOM=3]="BOTTOM",e))(ln||{}),un=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.OVERFLOW=1]="OVERFLOW",e[e.CLIP=2]="CLIP",e[e.WRAP=3]="WRAP",e))(un||{}),Mr=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ITALIC=1]="ITALIC",e))(Mr||{}),Dr=(e=>(e[e.NORMAL=0]="NORMAL",e[e.BOLD=1]="BOLD",e))(Dr||{}),jt=(e=>(e[e.NORMAL=1]="NORMAL",e[e.SUBSCRIPT=2]="SUBSCRIPT",e[e.SUPERSCRIPT=3]="SUPERSCRIPT",e))(jt||{}),Te=(e=>(e[e.FALSE=0]="FALSE",e[e.TRUE=1]="TRUE",e))(Te||{}),Qt=(e=>(e[e.STRING=1]="STRING",e[e.NUMBER=2]="NUMBER",e[e.BOOLEAN=3]="BOOLEAN",e[e.FORCE_STRING=4]="FORCE_STRING",e))(Qt||{}),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||{}),Lr=(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))(Lr||{});const fm="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let gm=e=>crypto.getRandomValues(new Uint8Array(e)),mm=(e,n,t)=>{let r=(2<<Math.log2(e.length-1))-1,s=-~(1.6*r*n/e.length);return(i=n)=>{let o="";for(;;){let a=t(s),l=s;for(;l--;)if(o+=e[a[l]&r]||"",o.length===i)return o}}},_m=(e,n=21)=>mm(e,n,gm),pm=(e=21)=>{let n="",t=crypto.getRandomValues(new Uint8Array(e));for(;e--;)n+=fm[t[e]&63];return n};const Em=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"]),Cm=new RegExp("^(?:(?:(?:https?|ftp):)?\\/\\/)?(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[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 vm(e){if(!Number.isNaN(+e))return!1;if(e.startsWith("http://localhost:3002")||e.startsWith("localhost:3002"))return!0;if(Cm.test(e)){if(Ba(e))return!0;try{const r=new URL(ja(e)).hostname.split(".").pop();if(r&&Em.has(r))return!0}catch{return!1}}return!1}function Ba(e){return/^[a-zA-Z]+:\/\//.test(e)}function Rm(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e)}function ja(e){return Ba(e)?e:Rm(e)?`mailto://${e}`:`https://${e}`}const Im=/^-ms-/,Sm=/-([a-z])/g,Jt=["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 xs(e,n){const t=K.getValueType(e),r=K.getValueType(n);return t!==r?!1:K.isArray(e)?Om(e,n):K.isObject(e)?ym(e,n):K.isDate(e)?e.getTime()===n.getTime():K.isRegExp(e)?e.toString()===n.toString():e===n}function Om(e,n){if(e.length!==n.length)return!1;for(let t=0,r=e.length;t<r;t++){const s=e[t],i=n[t];if(!xs(s,i))return!1}return!0}function ym(e,n){const t=Object.keys(e),r=Object.keys(n);if(t.length!==r.length)return!1;for(const s of t){if(!r.includes(s))return!1;const i=e[s],o=n[s];if(!xs(i,o))return!1}return!0}class K{static stringAt(n){let t="",r=n;for(;r>=Jt.length;)r/=Jt.length,r-=1,t+=Jt[r%Jt.length];const s=n%Jt.length;return t+=Jt[s],t}static indexAt(n){let t=0;for(let r=0;r<n.length-1;r+=1){const s=n.charCodeAt(r)-65,i=n.length-1-r;t+=Jt.length**i+Jt.length*s}return t+=n.charCodeAt(n.length-1)-65,t}static deleteBlank(n){return K.isString(n)?n.replace(/\s/g,""):n}static getSystemType(){const n=navigator.userAgent,t=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"&&!t&&!r)return"Unix";if(String(navigator.platform).indexOf("Linux")>-1)return"Linux";if(t){if(n.indexOf("Windows NT 5.0")>-1||n.indexOf("Windows 2000")>-1)return"Windows 2000";if(n.indexOf("Windows NT 5.1")>-1||n.indexOf("Windows XP")>-1)return"Windows XP";if(n.indexOf("Windows NT 5.2")>-1||n.indexOf("Windows 2003")>-1)return"Windows 2003";if(n.indexOf("Windows NT 6.0")>-1||n.indexOf("Windows Vista")>-1)return"Windows Vista";if(n.indexOf("Windows NT 6.1")>-1||n.indexOf("Windows 7")>-1)return"Windows 7";if(n.indexOf("Windows NT 10")>-1||n.indexOf("Windows 10")>-1)return"Windows 10";if(n.indexOf("Windows NT 11")>-1||n.indexOf("Windows 11")>-1)return"Windows 11"}return"Unknown system"}static getBrowserType(){const n=navigator.userAgent,t=n.indexOf("Opera")>-1,r=n.indexOf("compatible")>-1&&n.indexOf("MSIE")>-1&&!t,s=n.indexOf("Trident")>-1&&n.indexOf("rv:11.0")>-1,i=n.indexOf("Edge")>-1,o=n.indexOf("Firefox")>-1,a=n.indexOf("Safari")>-1&&n.indexOf("Chrome")===-1,l=n.indexOf("Chrome")>-1&&n.indexOf("Safari")>-1;if(r){new RegExp("MSIE (\\d+\\.\\d+);").test(n);const h=Number.parseFloat(RegExp.$1);return h===7?"IE7":h===8?"IE8":h===9?"IE9":h===10?"IE10":"0"}return o?"FF":t?"Opera":a?"Safari":l?"Chrome":i?"Edge":s?"IE11":"Unknown browser"}static generateRandomId(n=21,t){return cn(n,t)}static getClassName(n){return n.constructor.name}static deepMerge(n,...t){t.forEach(o=>o&&i(o));function r(o,a){o.forEach((l,c)=>{var h,u;if(K.isArray(l)){const f=(h=a[c])!=null?h:[];a[c]=f,r(l,f);return}if(K.isObject(l)){const f=(u=a[c])!=null?u:{};a[c]=f,s(l,f);return}a[c]=l})}function s(o,a){Object.keys(o).forEach(l=>{var h,u;const c=o[l];if(K.isObject(c)){const f=(h=a[l])!=null?h:{};a[l]=f,s(c,f);return}if(K.isArray(c)){const f=(u=a[l])!=null?u:[];a[l]=f,r(c,f);return}a[l]=c})}function i(o){Object.keys(o).forEach(a=>{var c,h;const l=o[a];if(K.isArray(l)){const u=(c=n[a])!=null?c:[];n[a]=u,r(l,u);return}if(K.isObject(l)){const u=(h=n[a])!=null?h:{};n[a]=u,s(l,u);return}n[a]=l})}return n}static numberFixed(n,t){return Number(Number(n).toFixed(t))}static diffValue(n,t){return xs(n,t)}static deepClone(n){if(!this.isDefine(n))return n;if(this.isRegExp(n))return new RegExp(n);if(this.isDate(n))return new Date(n);if(this.isArray(n)){const t=[];return n.forEach((r,s)=>{t[s]=K.deepClone(r)}),t}if(this.isObject(n)){const t={};return Object.keys(n).forEach(r=>{const s=n[r];t[r]=K.deepClone(s)}),Object.setPrototypeOf(t,Object.getPrototypeOf(n)),t}return n}static getLanguage(){const n="en-US";return globalThis.navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||n}static getValueType(n){return Object.prototype.toString.apply(n)}static isDefine(n){return n!=null}static isBlank(n){return this.isDefine(n)?this.isString(n)?n.trim()==="":!1:!0}static isBoolean(n){return this.getValueType(n)==="[object Boolean]"}static isPlainObject(n){return this.isDefine(n)?Object.getPrototypeOf(n)===Object.getPrototypeOf({}):!1}static isFunction(n){return this.getValueType(n)==="[object Function]"}static isDate(n){return this.getValueType(n)==="[object Date]"}static isRegExp(n){return this.getValueType(n)==="[object RegExp]"}static isArray(n){return this.getValueType(n)==="[object Array]"}static isString(n){return this.getValueType(n)==="[object String]"}static isNumber(n){return this.getValueType(n)==="[object Number]"}static isStringNumber(n){return!isNaN(Number.parseFloat(n))&&isFinite(n)}static isObject(n){return this.getValueType(n)==="[object Object]"}static isEmptyObject(n){for(const t in n)return!1;return!0}static isMobile(){let n=0,t=0;return document.body.clientWidth&&(n=document.body.clientWidth),document.body.clientHeight&&(t=document.body.clientHeight),this.isAndroid()||this.isIPhone()||this.isTablet()||n<350&&t<500}static isTablet(){return/ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(navigator.userAgent.toLowerCase())}static isWeChat(){const n=navigator.userAgent.toLowerCase();return String(n.match(/MicroMessenger/i))==="micromessenger"}static isAndroid(){const n=navigator.userAgent;return n.indexOf("Android")>-1||n.indexOf("Linux")>-1}static isIPhone(){return/iPhone/i.test(navigator.userAgent)}static isLegalUrl(n){return vm(n)}static normalizeUrl(n){return ja(n)}static itCount(n){return t=>{for(let r=0;r<n;r++)t&&t()}}static hasLength(n,t){return K.isDefine(n)?K.isDefine(t)?n.length===t:n.length>0:!1}static capitalize(n){return n.charAt(0).toUpperCase()+n.slice(1)}static fCamelCase(n,t){return t.toUpperCase()}static camelCase(n){return n.replace(Im,"ms-").replace(Sm,this.fCamelCase)}static removeNull(n){return this.isObject(n)&&Object.keys(n).forEach(t=>{const r=n[t];r==null?delete n[t]:K.removeNull(r)}),n}static fillTwoDimensionalArray(n,t,r){return new Array(n).fill(r).map(s=>new Array(t).fill(r))}static numToWord(n){let t="";for(;n>0;){let r=n%26;r=r===0?r=26:r,t=String.fromCharCode(96+r)+t,n=(n-r)/26}return t.toLocaleUpperCase()}static ABCatNum(n){if(n==null||n.length===0)return Number.NaN;const t=n.toLowerCase().split(""),r=t.length;let s=0,i=0;for(let o=0;o<r;o++)i=t[o].charCodeAt(0)-96,s+=i*26**(r-o-1);return s===0?Number.NaN:s-1}static chatAtABC(n){let i="";for(;n>=0;)i=String.fromCharCode(n%26+97)+i,n=Math.floor(n/26)-1;return i.toUpperCase()}static randSort(n){for(let t=0,r=n.length;t<r;t++){const s=Number.parseInt((Math.random()*r).toString()),i=n[s];n[s]=n[t],n[t]=i}return n}static commonExtend(n,t){const r={};for(const s in n)r[s]=n[s];for(const s in t)t[s]!=null&&(r[s]=t[s]);return r}static commonExtend1(n,t){for(const r in n)t[r]==null&&(t[r]=n[r]);return t}static arrayToObject(n){const t={};return n.forEach((r,s)=>{t[s]={},r.forEach((i,o)=>{t[s][o]=i})}),t}static hasIntersectionBetweenTwoRanges(n,t,r,s){return t>=r&&s>=n}static isStartValidPosition(n){return/^[A-Za-z_]/.test(n)}static isValidParameter(n){const t=/[~!@#$%^&*()+=\-{}\[\]\|:;"'<>,?\/ ]+/.test(n),r=n.length<=255;return!t&&r}static clamp(n,t,r){return Math.max(t,Math.min(r,n))}static now(){return performance&&performance.now?performance.now():Date.now()}}function cn(e=21,n){return n?_m(n,e)():pm(e)}function Hs(...e){const n={},t=e.length;for(let r=t-1;r>=0;r--){const s=e[r];if(s){const i=Object.keys(s);for(const o of i)n[o]===void 0&&(n[o]=s[o])}}return n}const wm=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null;function Ur(e,n,t){const{dataStream:r,textRuns:s=[]}=e;let i=n;const o=[];for(const a of s){const{st:l,ed:c}=a;K.hasIntersectionBetweenTwoRanges(n,t,l,c)&&(l>i?(o.push(r.slice(i,l)),o.push(Bs(r,{...a,ed:Math.min(c,t)}))):o.push(Bs(r,{...a,st:i,ed:Math.min(c,t)}))),i=Math.max(n,Math.min(c,t))}return i!==t&&o.push(r.slice(i,t)),o.join("")}function bm(e,n=!0){var t;if(n&&((t=e.paragraphs)!=null&&t.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:f}=c,g=[];h!=null&&(typeof h=="number"?g.push(`margin-top: ${h}px`):g.push(`margin-top: ${h.v}px`)),u!=null&&(typeof u=="number"?g.push(`margin-bottom: ${u}px`):g.push(`margin-bottom: ${u.v}px`)),f!=null&&g.push(`line-height: ${f}`),l>o+1?i+=`<p class="UniverNormal" ${g.length?`style="${g.join("; ")};"`:""}>${Ur(e,o+1,l)}</p>`:i+=`<p class="UniverNormal" ${g.length?`style="${g.join("; ")};"`:""}></p>`,o=l}return o!==r.length&&(i+=Ur(e,o,r.length)),i}else return Ur(e,0,e.dataStream.length)}function Bs(e,n){const{st:t,ed:r,ts:s={}}=n,{ff:i,fs:o,it:a,bl:l,ul:c,st:h,ol:u,bg:f,cl:g,va:p}=s;let C=e.slice(t,r);const I=[];return a===Te.TRUE&&(C=`<i>${C}</i>`),p===jt.SUPERSCRIPT?C=`<sup>${C}</sup>`:p===jt.SUBSCRIPT&&(C=`<sub>${C}</sub>`),(c==null?void 0:c.s)===Te.TRUE&&(C=`<u>${C}</u>`),(h==null?void 0:h.s)===Te.TRUE&&(C=`<s>${C}</s>`),l===Te.TRUE&&(C=`<strong>${C}</strong>`),i&&I.push(`font-family: ${i}`),g&&I.push(`color: ${g.rgb}`),o&&I.push(`font-size: ${o}pt`),u&&I.push("text-decoration: overline"),f&&I.push(`background: ${f.rgb}`),I.length?`<span style="${I.join("; ")};">${C}</span>`:C}const Wa={[Lr.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 Pr{constructor(){R(this,"_themeValue",ft.LIGHT1);R(this,"_themeColors");R(this,"_themeTint");R(this,"_rgbValue","");R(this,"_colorType");this._colorType=yt.UNSUPPORTED,this._themeColors=Lr.OFFICE,this._themeTint=0}asRgbColor(){return new kr(this._rgbValue,this)}asThemeColor(){return new Fr(this._themeValue,this._themeTint,this._themeColors,this)}build(){switch(this._colorType){case yt.THEME:return this.asThemeColor();case yt.RGB:return this.asRgbColor();case yt.UNSUPPORTED:throw new Error("unsupported color type")}}setRgbColor(n){return this._colorType=yt.RGB,this._rgbValue=n,this}setThemeColors(n){this._colorType=yt.THEME,this._themeColors=n}setThemeTint(n){this._colorType=yt.THEME,this._themeTint=n}setThemeColor(n){return this._colorType=yt.THEME,this._themeValue=n,this}getColorType(){return this._colorType}}class hn{constructor(n){R(this,"_builder");this._builder=n}static rgbColorToHexValue(n){return`#${((1<<24)+(n.getRed()<<16)+(n.getGreen()<<8)+n.getBlue()).toString(16).slice(1)}`}static hexValueToRgbColor(n){n?n.indexOf("#")>-1&&(n=n.substring(1)):n="#000000";const t=+`0x${n[0]}${n[1]}`,r=+`0x${n[2]}${n[3]}`,s=+`0x${n[4]}${n[5]}`;return new Pr().setRgbColor(`rgb(${t},${r},${s})`).asRgbColor()}static hexToRgbString(n){const t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;n=n.replace(t,(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(n);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 hn(this._builder)}equals(n){return!1}}class Ya{constructor(n){R(this,"_saturation",0);R(this,"_hue",0);R(this,"_lightness",0);R(this,"_alpha",0);const t=n.getRed()/255,r=n.getGreen()/255,s=n.getBlue()/255,i=n.getAlpha()/255,o=Math.min(t,Math.min(r,s)),a=Math.max(t,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),t===a&&(this._hue=(r-s)/l),r===a&&(this._hue=2+(s-t)/l),s===a&&(this._hue=4+(t-r)/l),this._hue*=60,this._hue<0&&(this._hue+=360),this._alpha=i}asRgbColor(){const n=new Pr;if(this._saturation===0)return n.setRgbColor(`rgba(${this._lightness*255},${this._lightness*255},${this._lightness*255},${this._alpha*255})`),n.asRgbColor();let t;this._lightness<.5?t=this._lightness*(1+this._saturation):t=this._lightness+this._saturation-this._lightness*this._saturation;const r=2*this._lightness-t,s=this._hue/360,i=s+1/3,o=this.setColor(t,r,i),a=this.setColor(t,r,s),l=s-1/3,c=this.setColor(t,r,l);return n.setRgbColor(`rgba(${Math.round(o*255)},${Math.round(a*255)},${Math.round(c*255)},${this._alpha*255})`),n.asRgbColor()}getLightness(){return this._lightness}getHue(){return this._hue}getSaturation(){return this._saturation}getAlpha(){return this._alpha}setColor(n,t,r){r<0&&(r+=1),r>1&&(r-=1);let s;return 6*r<1?s=t+(n-t)*6*r:2*r<1?s=n:3*r<2?s=t+(n-t)*(2/3-r)*6:s=t,s}setLightness(n){this._lightness=n}}const wt=class wt extends hn{constructor(t,r){super(r);R(this,"_cssString");R(this,"_red");R(this,"_green");R(this,"_blue");R(this,"_alpha");let s=t.match(wt.RGBA_EXTRACT);if(s){const i=+s[1],o=+s[2],a=+s[3],l=+s[4];this._cssString=t,this._red=i,this._green=o,this._blue=a,this._alpha=l;return}if(s=t.match(wt.RGB_EXTRACT),s){const i=+s[1],o=+s[2],a=+s[3];this._cssString=t,this._red=i,this._green=o,this._blue=a,this._alpha=1;return}throw new Error("Invalid rgba or rgb color")}asHexString(){return hn.rgbColorToHexValue(this)}getRed(){let t=this._red+wt.RGB_COLOR_AMT;return t>255?t=255:t<0&&(t=0),t}getGreen(){let t=this._green+wt.RGB_COLOR_AMT;return t>255?t=255:t<0&&(t=0),t}getBlue(){let t=this._blue+wt.RGB_COLOR_AMT;return t>255?t=255:t<0&&(t=0),t}getAlpha(){return this._alpha}getColorType(){return yt.RGB}clone(){return new wt(this._cssString,this._builder)}asThemeColor(){throw new Error("rgb color not support to themeColor")}equals(t){return t instanceof wt?t._red===this._red&&t._blue===this._blue&&t._green===this._green&&t._alpha===this._alpha:!1}getCssString(){return this._cssString}};R(wt,"RGB_COLOR_AMT",0),R(wt,"RGBA_EXTRACT",new RegExp("\\s*rgba\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d.\\d|\\d\\s*)\\)\\s*")),R(wt,"RGB_EXTRACT",new RegExp("\\s*rgb\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*)\\)\\s*"));let kr=wt;const nn=class nn extends hn{constructor(t,r,s,i){super(i);R(this,"_themeColorType");R(this,"_themeTint");R(this,"_themeColors");this._themeColorType=t,this._themeTint=r,this._themeColors=s}lumValue(t,r){if(t==null)return r;let s;return t<0?s=r*(1+t):s=r*(1-t)+(255-255*(1-t)),s}asRgbColor(){const t=Wa[this._themeColors];if(t==null)throw new Error("not find themeColors type");const r=t[this._themeColorType];if(r==null)throw new Error("not find themeColors value");let s;if(nn._cacheThemeColor.has(this._themeColors)){if(s=nn._cacheThemeColor.get(this._themeColors),s.has(this._themeColorType))return s.get(this._themeColorType)}else s=new Map,nn._cacheThemeColor.set(this._themeColors,s);const i=new Ya(hn.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 nn(this._themeColorType,this._themeTint,this._themeColors,this._builder)}equals(t){return t instanceof nn?t._themeColorType===this._themeColorType:!1}getColorType(){return yt.THEME}getThemeColorType(){return this._themeColorType}};R(nn,"_cacheThemeColor",new Map);let Fr=nn;const Am="rgb(",Tm="rgba(",js={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 Nt{constructor(n){R(this,"_color");R(this,"_rgbColor");R(this,"_isValid",!1);if(n==null){this._setNullColor();return}if(n instanceof Nt){this._color={...n._color},this._rgbColor={...n._rgbColor};return}const t=za(n);if(t==null){this._setNullColor();return}this._color=t;const r=Um(this._color);if(r==null){this._setNullColor();return}this._rgbColor=r,this._isValid=!0}static mix(n,t,r){var c,h;r=Math.min(1,Math.max(0,r));const s=new Nt(n).toRgb(),i=new Nt(t).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 Nt(l)}static getContrastRatio(n,t){const r=new Nt(n).getLuminance(),s=new Nt(t).getLuminance();return(Math.max(r,s)+.05)/(Math.min(r,s)+.05)}get isValid(){return this._isValid}toRgb(){return this._rgbColor}toRgbString(){const{r:n,g:t,b:r,a:s=1}=this.toRgb(),i=s<1;return`rgb${i?"a":""}(${n},${t},${r}${i?`,${s}`:""})`}toString(){return this.toRgbString()}toHexString(n){const{r:t,g:r,b:s,a:i=1}=this.toRgb(),o=i<1,a=[$r(Math.round(t).toString(16)),$r(Math.round(r).toString(16)),$r(Math.round(s).toString(16)),$r(Math.round(i*255).toString(16))];return n&&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 $m(this.toRgb())}toHsl(){return Fm(this.toRgb())}lighten(n=10){const t=this.toHsl();return t.l+=n,t.l=Math.min(Math.max(t.l,0),100),new Nt(t)}darken(n=10){const t=this.toHsl();return t.l-=n,t.l=Math.min(Math.max(t.l,0),100),new Nt(t)}setAlpha(n){return new Nt({...this._rgbColor,a:n})}getLuminance(){let{r:n,g:t,b:r}=this.toRgb();return n=Ws(n),t=Ws(t),r=Ws(r),Number((.2126*n+.7152*t+.0722*r).toFixed(3))}getBrightness(){const{r:n,g:t,b:r}=this.toRgb();return(n*299+t*587+r*114)/1e3}getAlpha(){var n;return(n=this._color.a)!=null?n: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 $r=e=>e.length===1?`0${e}`:e,Ws=e=>(e/=255,e<=.03928?e/12.92:((e+.055)/1.055)**2.4),za=e=>{if(Hm(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 t={h:Math.round(e.h),s:e.s,v:e.v};return e.a!==void 0&&(t.a=e.a),t}const n=e.trim();if(js[n]){const t=js[n],r={r:Math.round(t[0]),g:Math.round(t[1]),b:Math.round(t[2])};return r.a=t[3]||1,r}if(n.startsWith("#"))return Nm(n);if(n.startsWith("rgb"))return Mm(n);if(n.startsWith("hsl"))return Dm(n);if(n.startsWith("hsv"))return Lm(n)},Nm=e=>{const n=e.substring(1),t=new RegExp(`.{1,${n.length>=6?2:1}}`,"g");let r=n.match(t);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},Mm=e=>{const n=e.indexOf("(");if(n===-1)throw new Error(`The color '${e}' is illegal rgb color`);const t=e.substring(n+1,e.length-1).split(",");if(t.length<3)throw new Error(`The color '${e}' is illegal rgb color`);const r={r:Number.parseInt(t[0],10),g:Number.parseInt(t[1],10),b:Number.parseInt(t[2],10)};return t.length>3&&(r.a=Number.parseFloat(t[3])),r},Dm=e=>{const n=e.indexOf("(");if(n===-1)throw new Error(`The color '${e}' is illegal hsl color`);const t=e.substring(n+1,e.length-1).split(",");if(t.length<3)throw new Error(`The color '${e}' is illegal hsl color`);const r={h:Number.parseInt(t[0],10),s:Number.parseFloat(t[1]),l:Number.parseFloat(t[2])};return t.length>3&&(r.a=Number.parseFloat(t[3])),r},Lm=e=>{const n=e.indexOf("(");if(n===-1)throw new Error(`The color '${e}' is illegal hsv color`);const t=e.substring(n+1,e.length-1).split(",");if(t.length<3)throw new Error(`The color '${e}' is illegal hsv color`);const r={h:Number.parseInt(t[0],10),s:Number.parseFloat(t[1]),v:Number.parseFloat(t[2])};return t.length>3&&(r.a=Number.parseFloat(t[3])),r},Um=e=>{const n=za(e);if(n!=null)return"r"in n?n:"l"in n?Pm(n):km(n)},Ys=(e,n,t)=>(t<0&&(t+=1),t>1&&(t-=1),t<1/6?e+(n-e)*6*t:t<1/2?n:t<2/3?e+(n-e)*(2/3-t)*6:e),Pm=e=>{let{h:n,s:t,l:r}=e;n/=360,t/=100,r/=100;let s=0,i=0,o=0;if(t===0)s=i=o=r;else{const l=r<.5?r*(1+t):r+t-r*t,c=2*r-l;s=Ys(c,l,n+1/3),i=Ys(c,l,n),o=Ys(c,l,n-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},km=e=>{let{h:n,s:t,v:r}=e;n=n/360*6,t/=100,r/=100;const s=Math.floor(n),i=n-s,o=r*(1-t),a=r*(1-i*t),l=r*(1-(1-i)*t),c=s%6,h=[r,a,o,o,l,r][c],u=[l,r,r,a,o,o][c],f=[o,o,l,r,r,a][c],g={r:h*255,g:u*255,b:f*255};return e.a!==void 0&&(g.a=e.a),g},Fm=e=>{let{r:n,g:t,b:r}=e;n/=255,t/=255,r/=255;const s=Math.max(n,t,r),i=Math.min(n,t,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 n:a=(t-r)/h+(t<r?6:0);break;case t:a=(r-n)/h+2;break;default:a=(n-t)/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},$m=e=>{let{r:n,g:t,b:r}=e;n/=255,t/=255,r/=255;const s=Math.max(n,t,r),i=Math.min(n,t,r);let o;const a=s,l=s-i,c=s===0?0:l/s;if(s===i)o=0;else{switch(s){case n:o=(t-r)/l+(t<r?6:0);break;case t:o=(r-n)/l+2;break;default:o=(n-t)/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},xm=e=>e==null,Hm=e=>!xm(e)&&typeof e=="object";function Bm(e){const n=/^#(?:[0]{3}|[0]{6})\b/,t=/^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!!(n.test(e)||t.test(e)||r.test(e)||s.test(e)||i.test(e))}function jm(e){const n=/^#(?:[Ff]{3}|[Ff]{6})\b/,t=/^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!!(n.test(e)||t.test(e)||r.test(e)||s.test(e)||i.test(e))}var De=(e=>(e[e.COVER=0]="COVER",e[e.REPLACE=1]="REPLACE",e))(De||{});function Wm(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 Ym(e){if(e.t!==void 0)return e.t;if(typeof e.v=="string")return Qt.STRING;if(typeof e.v=="number")return Qt.NUMBER;if(typeof e.v=="boolean")return Qt.BOOLEAN}function zm(e){if(e==null)return!0;const{v:n,f:t,si:r,p:s,s:i,custom:o}=e;return!(!(n==null||typeof n=="string"&&n.length===0)||t!=null&&t.length>0||r!=null&&r.length>0||s!=null||o!=null)}function Vm(e){return e!=null&&(typeof e=="string"||typeof e=="number"||typeof e=="boolean")}var we=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ROW=1]="ROW",e[e.COLUMN=2]="COLUMN",e[e.ALL=3]="ALL",e))(we||{}),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 Gm(e){return[e.startRow,e.startColumn,e.endRow,e.endColumn]}var Va=(e=>(e.NONE="none",e.BACKWARD="backward",e.FORWARD="forward",e))(Va||{}),Ga=(e=>(e.RECT="RECT",e.TEXT="TEXT",e))(Ga||{});function Km(e,n,t){let r=!1,s=!1,i=e,o=n,a=e,l=n;if(t==null)return{actualRow:e,actualColumn:n,isMergedMainCell:s,isMerged:r,endRow:i,endColumn:o,startRow:a,startColumn:l};for(let c=0;c<t.length;c++){const{startRow:h,endRow:u,startColumn:f,endColumn:g}=t[c];if(e===h&&n===f){i=u,o=g,a=h,l=f,s=!0;break}if(e>=h&&e<=u&&n>=f&&n<=g){i=u,o=g,a=h,l=f,r=!0;break}}return{actualRow:e,actualColumn:n,isMergedMainCell:s,isMerged:r,endRow:i,endColumn:o,startRow:a,startColumn:l}}function Ka(e){const{actualRow:n,actualColumn:t,isMerged:r,isMergedMainCell:s,mergeInfo:i}=e;let{startY:o,endY:a,startX:l,endX:c}=e,h=n,u=t,f=n,g=t;if(r&&i){const{startRow:p,startColumn:C,endRow:I,endColumn:S,startY:D,endY:U,startX:B,endX:w}=i;h=p,u=C,f=I,g=S,o=D,a=U,l=B,c=w}return s&&(o=i.startY,a=i.endY,l=i.startX,c=i.endX,f=i.endRow,g=i.endColumn),{startRow:h,startColumn:u,endRow:f,endColumn:g,startY:o,endY:a,startX:l,endX:c}}const Xm=Ka;function Qm(e){if(!e)return;const{actualRow:n,actualColumn:t,isMerged:r,isMergedMainCell:s,startRow:i,startColumn:o,endRow:a,endColumn:l}=e;let c=n,h=t,u=n,f=t;return(r||s)&&(c=i,h=o,u=a,f=l),{startRow:c,startColumn:h,endRow:u,endColumn:f}}function Xa(e){var t;return!e||(((t=e==null?void 0:e.v)==null?void 0:t.toString())||"").length===0&&!e.p}function Jm(e){return Xa(e)&&(e==null?void 0:e.coverable)!==!1}function Ut(e){if(e){if(e.rgb)return e.rgb;if(e.th)return new Pr().setThemeColor(e.th).asThemeColor().asRgbColor().getCssString()}return null}function Zm(e){return K.isString(e)&&e.substring(0,1)==="="&&e.length>1}function qm(e){return K.isString(e)&&e.length>0}function e_(e,n=!1){var i;let t="";const r=new Map([["ff",()=>{e.ff&&(t+=`font-family: ${e.ff}; `)}],["fs",()=>{if(e.fs){let o=e.fs;e.va&&(o/=2),t+=`font-size: ${o}pt; `}}],["it",()=>{e.it&&(t+="font-style: italic; ")}],["bl",()=>{e.bl&&(t+="font-weight: bold; ")}],["ul",()=>{var o;(o=e.ul)!=null&&o.s&&(t.indexOf("text-decoration-line")>-1?t=t.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} underline`):t+="text-decoration: underline; ",e.ul.cl&&t.indexOf("text-decoration-color")===-1&&(t+=`text-decoration-color: ${Ut(e.ul.cl)}; `),e.ul.t&&t.indexOf("text-decoration-style")===-1&&(t+=`text-decoration-style: ${e.ul.t} `))}],["st",()=>{var o;(o=e.st)!=null&&o.s&&(t.indexOf("text-decoration-line")>-1?t=t.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} line-through`):t+="text-decoration-line: line-through; ",e.st.cl&&t.indexOf("text-decoration-color")===-1&&(t+=`text-decoration-color: ${Ut(e.st.cl)}; `),e.st.t&&t.indexOf("text-decoration-style")===-1&&(t+=`text-decoration-style: ${e.st.t} `))}],["ol",()=>{var o;(o=e.ol)!=null&&o.s&&(t.indexOf("text-decoration-line")>-1?t=t.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} overline`):t+="text-decoration-line: overline; ",e.ol.cl&&t.indexOf("text-decoration-color")===-1&&(t+=`text-decoration-color: ${Ut(e.ol.cl)}; `),e.ol.t&&t.indexOf("text-decoration-style")===-1&&(t+=`text-decoration-style: ${e.ol.t} `))}],["bg",()=>{e.bg&&(t+=`background: ${Ut(e.bg)}; `)}],["bd",()=>{var o,a,l,c,h,u,f,g,p,C,I,S;(o=e.bd)!=null&&o.b&&(t+=`border-bottom: ${xr((a=e.bd)==null?void 0:a.b.s)} ${(l=Ut(e.bd.b.cl))!=null?l:""}; `),(c=e.bd)!=null&&c.t&&(t+=`border-top: ${xr((h=e.bd)==null?void 0:h.t.s)} ${(u=Ut(e.bd.t.cl))!=null?u:""}; `),(f=e.bd)!=null&&f.r&&(t+=`border-right: ${xr((g=e.bd)==null?void 0:g.r.s)} ${(p=Ut(e.bd.r.cl))!=null?p:""}; `),(C=e.bd)!=null&&C.l&&(t+=`border-left: ${xr((I=e.bd)==null?void 0:I.l.s)} ${(S=Ut(e.bd.l.cl))!=null?S:""}; `)}],["cl",()=>{e.cl&&(t+=`color: ${Ut(e.cl)}; `)}],["va",()=>{e.va===jt.SUBSCRIPT?t+="vertical-align: sub; ":e.va===jt.SUPERSCRIPT&&(t+="vertical-align: super; ")}],["td",()=>{e.td===Jn.LEFT_TO_RIGHT?t+="direction: ltr; ":e.td===Jn.RIGHT_TO_LEFT&&(t+="direction: rtl; ")}],["tr",()=>{var o,a,l;e.tr&&(t+=`--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===Xt.LEFT?t+="text-align: left; ":e.ht===Xt.RIGHT?t+="text-align: right; ":e.ht===Xt.CENTER?t+="text-align: center; ":e.ht===Xt.JUSTIFIED&&(t+="text-align: justify; ")}],["vt",()=>{e.vt===ln.BOTTOM?t+="vertical-align: bottom; ":e.vt===ln.TOP?t+="vertical-align: top; ":e.vt===ln.MIDDLE&&(t+="vertical-align: middle; ")}],["tb",()=>{e.tb===un.CLIP?t+="white-space: nowrap; overflow-x: hidden; ":e.tb===un.WRAP&&(t+="white-space: normal;")}],["pd",()=>{var h,u,f,g,p,C,I,S;const o=`${(h=e.pd)==null?void 0:h.b}pt`,a=`${(u=e.pd)==null?void 0:u.t}pt`,l=`${(f=e.pd)==null?void 0:f.l}pt`,c=`${(g=e.pd)==null?void 0:g.r}pt`;(p=e.pd)!=null&&p.b&&(t+=`padding-bottom: ${o}; `),(C=e.pd)!=null&&C.t&&(t+=`padding-top: ${a}; `),(I=e.pd)!=null&&I.l&&(t+=`padding-left: ${l}; `),(S=e.pd)!=null&&S.r&&(t+=`padding-right: ${c}; `)}]]),s=["bd","tr","tb"];for(const o in e)n&&s.includes(o)||(i=r.get(o))==null||i();return t}function xr(e){let n="";return e===Ke.NONE?n="none":e===Ke.THIN?n="0.5pt solid":e===Ke.HAIR?n="0.5pt double":e===Ke.DOTTED?n="0.5pt dotted":e===Ke.DASHED||e===Ke.DASH_DOT?n="0.5pt dashed":e===Ke.DASH_DOT_DOT?n="0.5pt dotted":e===Ke.DOUBLE?n="0.5pt double":e===Ke.MEDIUM?n="1pt solid":e===Ke.MEDIUM_DASHED||e===Ke.MEDIUM_DASH_DOT?n="1pt dashed":e===Ke.MEDIUM_DASH_DOT_DOT?n="1pt dotted":e===Ke.SLANT_DASH_DOT?n="0.5pt dashed":e===Ke.THICK&&(n="1.5pt solid"),n}function t_(e){let n=0;if(e=e.trim(),e==="none")n=Ke.NONE;else if(e==="0.5pt solid")n=Ke.THIN;else if(e==="0.5pt double")n=Ke.HAIR;else if(e==="0.5pt dotted")n=Ke.DOTTED;else if(e==="0.5pt dashed")n=Ke.DASHED;else if(e==="1pt solid")n=Ke.MEDIUM;else if(e==="1pt dashed")n=Ke.MEDIUM_DASHED;else if(e==="1pt dotted")n=Ke.MEDIUM_DASH_DOT_DOT;else if(e==="1.5pt solid")n=Ke.THICK;else if(!e.includes("none"))n=Ke.THIN;else return Ke.NONE;return n}function n_(e,n){let t=e.body;if(n){const{headers:r,footers:s}=e;r!=null&&r[n]?t=r[n].body:s!=null&&s[n]&&(t=s[n].body)}return t}function r_(e,n){const{startRow:t,endRow:r,startColumn:s,endColumn:i,rangeType:o}=e;if(t<0||s<0||r<0||i<0||!(Number.isNaN(t)&&Number.isNaN(r))&&o===we.COLUMN||!(Number.isNaN(s)&&Number.isNaN(i))&&o===we.ROW||o!==we.ROW&&o!==we.COLUMN&&(Number.isNaN(s)||Number.isNaN(t)||Number.isNaN(i)||Number.isNaN(r)))return!1;if(n){const a=n.getRowCount(),l=n.getColumnCount();if(r>=a||i>=l)return!1}return!0}function s_(e,n){return{startRow:e,endRow:e,startColumn:n,endColumn:n}}function zs(e,n){return Object.prototype.toString.call(e)===Object.prototype.toString.call(n)?Object.prototype.toString.call(e)==="[object Object]"||Object.prototype.toString.call(e)==="[object Array]"?Object.keys(e).length!==Object.keys(n).length?!1:Object.keys(e).every(t=>zs(e[t],n[t])):e===n:!1}function Qa(e,n){const t=e.ts||{},r=n.ts||{};return e.sId!==n.sId?!1:zs(t,r)}function i_(e,n){return n.some(t=>e.indexOf(t)>-1)}var Ja={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Je,function(){var t=1e3,r=6e4,s=36e5,i="millisecond",o="second",a="minute",l="hour",c="day",h="week",u="month",f="quarter",g="year",p="date",C="Invalid Date",I=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,S=/\[([^\]]+)]|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,D={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(te){var $=["th","st","nd","rd"],V=te%100;return"["+te+($[(V-20)%10]||$[V]||$[0])+"]"}},U=function(te,$,V){var pe=String(te);return!pe||pe.length>=$?te:""+Array($+1-pe.length).join(V)+te},B={s:U,z:function(te){var $=-te.utcOffset(),V=Math.abs($),pe=Math.floor(V/60),ne=V%60;return($<=0?"+":"-")+U(pe,2,"0")+":"+U(ne,2,"0")},m:function te($,V){if($.date()<V.date())return-te(V,$);var pe=12*(V.year()-$.year())+(V.month()-$.month()),ne=$.clone().add(pe,u),ve=V-ne<0,Oe=$.clone().add(pe+(ve?-1:1),u);return+(-(pe+(V-ne)/(ve?ne-Oe:Oe-ne))||0)},a:function(te){return te<0?Math.ceil(te)||0:Math.floor(te)},p:function(te){return{M:u,y:g,w:h,d:c,D:p,h:l,m:a,s:o,ms:i,Q:f}[te]||String(te||"").toLowerCase().replace(/s$/,"")},u:function(te){return te===void 0}},w="en",b={};b[w]=D;var P="$isDayjsObject",W=function(te){return te instanceof Ae||!(!te||!te[P])},he=function te($,V,pe){var ne;if(!$)return w;if(typeof $=="string"){var ve=$.toLowerCase();b[ve]&&(ne=ve),V&&(b[ve]=V,ne=ve);var Oe=$.split("-");if(!ne&&Oe.length>1)return te(Oe[0])}else{var Me=$.name;b[Me]=$,ne=Me}return!pe&&ne&&(w=ne),ne||!pe&&w},ee=function(te,$){if(W(te))return te.clone();var V=typeof $=="object"?$:{};return V.date=te,V.args=arguments,new Ae(V)},ae=B;ae.l=he,ae.i=W,ae.w=function(te,$){return ee(te,{locale:$.$L,utc:$.$u,x:$.$x,$offset:$.$offset})};var Ae=function(){function te(V){this.$L=he(V.locale,null,!0),this.parse(V),this.$x=this.$x||V.x||{},this[P]=!0}var $=te.prototype;return $.parse=function(V){this.$d=function(pe){var ne=pe.date,ve=pe.utc;if(ne===null)return new Date(NaN);if(ae.u(ne))return new Date;if(ne instanceof Date)return new Date(ne);if(typeof ne=="string"&&!/Z$/i.test(ne)){var Oe=ne.match(I);if(Oe){var Me=Oe[2]-1||0,Fe=(Oe[7]||"0").substring(0,3);return ve?new Date(Date.UTC(Oe[1],Me,Oe[3]||1,Oe[4]||0,Oe[5]||0,Oe[6]||0,Fe)):new Date(Oe[1],Me,Oe[3]||1,Oe[4]||0,Oe[5]||0,Oe[6]||0,Fe)}}return new Date(ne)}(V),this.init()},$.init=function(){var V=this.$d;this.$y=V.getFullYear(),this.$M=V.getMonth(),this.$D=V.getDate(),this.$W=V.getDay(),this.$H=V.getHours(),this.$m=V.getMinutes(),this.$s=V.getSeconds(),this.$ms=V.getMilliseconds()},$.$utils=function(){return ae},$.isValid=function(){return this.$d.toString()!==C},$.isSame=function(V,pe){var ne=ee(V);return this.startOf(pe)<=ne&&ne<=this.endOf(pe)},$.isAfter=function(V,pe){return ee(V)<this.startOf(pe)},$.isBefore=function(V,pe){return this.endOf(pe)<ee(V)},$.$g=function(V,pe,ne){return ae.u(V)?this[pe]:this.set(ne,V)},$.unix=function(){return Math.floor(this.valueOf()/1e3)},$.valueOf=function(){return this.$d.getTime()},$.startOf=function(V,pe){var ne=this,ve=!!ae.u(pe)||pe,Oe=ae.p(V),Me=function(X,G){var me=ae.w(ne.$u?Date.UTC(ne.$y,G,X):new Date(ne.$y,G,X),ne);return ve?me:me.endOf(c)},Fe=function(X,G){return ae.w(ne.toDate()[X].apply(ne.toDate("s"),(ve?[0,0,0,0]:[23,59,59,999]).slice(G)),ne)},Ye=this.$W,qe=this.$M,O=this.$D,k="set"+(this.$u?"UTC":"");switch(Oe){case g:return ve?Me(1,0):Me(31,11);case u:return ve?Me(1,qe):Me(0,qe+1);case h:var J=this.$locale().weekStart||0,re=(Ye<J?Ye+7:Ye)-J;return Me(ve?O-re:O+(6-re),qe);case c:case p: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()}},$.endOf=function(V){return this.startOf(V,!1)},$.$set=function(V,pe){var ne,ve=ae.p(V),Oe="set"+(this.$u?"UTC":""),Me=(ne={},ne[c]=Oe+"Date",ne[p]=Oe+"Date",ne[u]=Oe+"Month",ne[g]=Oe+"FullYear",ne[l]=Oe+"Hours",ne[a]=Oe+"Minutes",ne[o]=Oe+"Seconds",ne[i]=Oe+"Milliseconds",ne)[ve],Fe=ve===c?this.$D+(pe-this.$W):pe;if(ve===u||ve===g){var Ye=this.clone().set(p,1);Ye.$d[Me](Fe),Ye.init(),this.$d=Ye.set(p,Math.min(this.$D,Ye.daysInMonth())).$d}else Me&&this.$d[Me](Fe);return this.init(),this},$.set=function(V,pe){return this.clone().$set(V,pe)},$.get=function(V){return this[ae.p(V)]()},$.add=function(V,pe){var ne,ve=this;V=Number(V);var Oe=ae.p(pe),Me=function(qe){var O=ee(ve);return ae.w(O.date(O.date()+Math.round(qe*V)),ve)};if(Oe===u)return this.set(u,this.$M+V);if(Oe===g)return this.set(g,this.$y+V);if(Oe===c)return Me(1);if(Oe===h)return Me(7);var Fe=(ne={},ne[a]=r,ne[l]=s,ne[o]=t,ne)[Oe]||1,Ye=this.$d.getTime()+V*Fe;return ae.w(Ye,this)},$.subtract=function(V,pe){return this.add(-1*V,pe)},$.format=function(V){var pe=this,ne=this.$locale();if(!this.isValid())return ne.invalidDate||C;var ve=V||"YYYY-MM-DDTHH:mm:ssZ",Oe=ae.z(this),Me=this.$H,Fe=this.$m,Ye=this.$M,qe=ne.weekdays,O=ne.months,k=ne.meridiem,J=function(G,me,ge,F){return G&&(G[me]||G(pe,ve))||ge[me].slice(0,F)},re=function(G){return ae.s(Me%12||12,G,"0")},X=k||function(G,me,ge){var F=G<12?"AM":"PM";return ge?F.toLowerCase():F};return ve.replace(S,function(G,me){return me||function(ge){switch(ge){case"YY":return String(pe.$y).slice(-2);case"YYYY":return ae.s(pe.$y,4,"0");case"M":return Ye+1;case"MM":return ae.s(Ye+1,2,"0");case"MMM":return J(ne.monthsShort,Ye,O,3);case"MMMM":return J(O,Ye);case"D":return pe.$D;case"DD":return ae.s(pe.$D,2,"0");case"d":return String(pe.$W);case"dd":return J(ne.weekdaysMin,pe.$W,qe,2);case"ddd":return J(ne.weekdaysShort,pe.$W,qe,3);case"dddd":return qe[pe.$W];case"H":return String(Me);case"HH":return ae.s(Me,2,"0");case"h":return re(1);case"hh":return re(2);case"a":return X(Me,Fe,!0);case"A":return X(Me,Fe,!1);case"m":return String(Fe);case"mm":return ae.s(Fe,2,"0");case"s":return String(pe.$s);case"ss":return ae.s(pe.$s,2,"0");case"SSS":return ae.s(pe.$ms,3,"0");case"Z":return Oe}return null}(G)||Oe.replace(":","")})},$.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},$.diff=function(V,pe,ne){var ve,Oe=this,Me=ae.p(pe),Fe=ee(V),Ye=(Fe.utcOffset()-this.utcOffset())*r,qe=this-Fe,O=function(){return ae.m(Oe,Fe)};switch(Me){case g:ve=O()/12;break;case u:ve=O();break;case f:ve=O()/3;break;case h:ve=(qe-Ye)/6048e5;break;case c:ve=(qe-Ye)/864e5;break;case l:ve=qe/s;break;case a:ve=qe/r;break;case o:ve=qe/t;break;default:ve=qe}return ne?ve:ae.a(ve)},$.daysInMonth=function(){return this.endOf(u).$D},$.$locale=function(){return b[this.$L]},$.locale=function(V,pe){if(!V)return this.$L;var ne=this.clone(),ve=he(V,pe,!0);return ve&&(ne.$L=ve),ne},$.clone=function(){return ae.w(this.$d,this)},$.toDate=function(){return new Date(this.valueOf())},$.toJSON=function(){return this.isValid()?this.toISOString():null},$.toISOString=function(){return this.$d.toISOString()},$.toString=function(){return this.$d.toUTCString()},te}(),Ne=Ae.prototype;return ee.prototype=Ne,[["$ms",i],["$s",o],["$m",a],["$H",l],["$W",c],["$M",u],["$y",g],["$D",p]].forEach(function(te){Ne[te[1]]=function($){return this.$g($,te[0],te[1])}}),ee.extend=function(te,$){return te.$i||(te($,Ae,ee),te.$i=!0),ee},ee.locale=he,ee.isDayjs=W,ee.unix=function(te){return ee(1e3*te)},ee.en=b[w],ee.Ls=b,ee.p={},ee})})(Ja);var o_=Ja.exports;const Wt=It(o_);var Za={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Je,function(){return function(t,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)}}})})(Za);var a_=Za.exports;const l_=It(a_);var qa={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Je,function(){var t={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(I){return(I=+I)+(I>68?1900:2e3)},h=function(I){return function(S){this[I]=+S}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(I){(this.zone||(this.zone={})).offset=function(S){if(!S||S==="Z")return 0;var D=S.match(/([+-]|\d\d)/g),U=60*D[1]+(+D[2]||0);return U===0?0:D[0]==="+"?-U:U}(I)}],f=function(I){var S=l[I];return S&&(S.indexOf?S:S.s.concat(S.f))},g=function(I,S){var D,U=l.meridiem;if(U){for(var B=1;B<=24;B+=1)if(I.indexOf(U(B,0,S))>-1){D=B>12;break}}else D=I===(S?"pm":"PM");return D},p={A:[a,function(I){this.afternoon=g(I,!1)}],a:[a,function(I){this.afternoon=g(I,!0)}],Q:[s,function(I){this.month=3*(I-1)+1}],S:[s,function(I){this.milliseconds=100*+I}],SS:[i,function(I){this.milliseconds=10*+I}],SSS:[/\d{3}/,function(I){this.milliseconds=+I}],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(I){var S=l.ordinal,D=I.match(/\d+/);if(this.day=D[0],S)for(var U=1;U<=31;U+=1)S(U).replace(/\[|\]/g,"")===I&&(this.day=U)}],w:[o,h("week")],ww:[i,h("week")],M:[o,h("month")],MM:[i,h("month")],MMM:[a,function(I){var S=f("months"),D=(f("monthsShort")||S.map(function(U){return U.slice(0,3)})).indexOf(I)+1;if(D<1)throw new Error;this.month=D%12||D}],MMMM:[a,function(I){var S=f("months").indexOf(I)+1;if(S<1)throw new Error;this.month=S%12||S}],Y:[/[+-]?\d+/,h("year")],YY:[i,function(I){this.year=c(I)}],YYYY:[/\d{4}/,h("year")],Z:u,ZZ:u};function C(I){var S,D;S=I,D=l&&l.formats;for(var U=(I=S.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(ee,ae,Ae){var Ne=Ae&&Ae.toUpperCase();return ae||D[Ae]||t[Ae]||D[Ne].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(te,$,V){return $||V.slice(1)})})).match(r),B=U.length,w=0;w<B;w+=1){var b=U[w],P=p[b],W=P&&P[0],he=P&&P[1];U[w]=he?{regex:W,parser:he}:b.replace(/^\[|\]$/g,"")}return function(ee){for(var ae={},Ae=0,Ne=0;Ae<B;Ae+=1){var te=U[Ae];if(typeof te=="string")Ne+=te.length;else{var $=te.regex,V=te.parser,pe=ee.slice(Ne),ne=$.exec(pe)[0];V.call(ae,ne),ee=ee.replace(ne,"")}}return function(ve){var Oe=ve.afternoon;if(Oe!==void 0){var Me=ve.hours;Oe?Me<12&&(ve.hours+=12):Me===12&&(ve.hours=0),delete ve.afternoon}}(ae),ae}}return function(I,S,D){D.p.customParseFormat=!0,I&&I.parseTwoDigitYear&&(c=I.parseTwoDigitYear);var U=S.prototype,B=U.parse;U.parse=function(w){var b=w.date,P=w.utc,W=w.args;this.$u=P;var he=W[1];if(typeof he=="string"){var ee=W[2]===!0,ae=W[3]===!0,Ae=ee||ae,Ne=W[2];ae&&(Ne=W[2]),l=this.$locale(),!ee&&Ne&&(l=D.Ls[Ne]),this.$d=function(pe,ne,ve,Oe){try{if(["x","X"].indexOf(ne)>-1)return new Date((ne==="X"?1e3:1)*pe);var Me=C(ne)(pe),Fe=Me.year,Ye=Me.month,qe=Me.day,O=Me.hours,k=Me.minutes,J=Me.seconds,re=Me.milliseconds,X=Me.zone,G=Me.week,me=new Date,ge=qe||(Fe||Ye?1:me.getDate()),F=Fe||me.getFullYear(),Z=0;Fe&&!Ye||(Z=Ye>0?Ye-1:me.getMonth());var q,se=O||0,Re=k||0,be=J||0,x=re||0;return X?new Date(Date.UTC(F,Z,ge,se,Re,be,x+60*X.offset*1e3)):ve?new Date(Date.UTC(F,Z,ge,se,Re,be,x)):(q=new Date(F,Z,ge,se,Re,be,x),G&&(q=Oe(q).week(G).toDate()),q)}catch{return new Date("")}}(b,he,P,D),this.init(),Ne&&Ne!==!0&&(this.$L=this.locale(Ne).$L),Ae&&b!=this.format(he)&&(this.$d=new Date("")),l={}}else if(he instanceof Array)for(var te=he.length,$=1;$<=te;$+=1){W[1]=he[$-1];var V=D.apply(this,W);if(V.isValid()){this.$d=V.$d,this.$L=V.$L,this.init();break}$===te&&(this.$d=new Date(""))}else B.call(this,w)}}})})(qa);var u_=qa.exports;const c_=It(u_);var el={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Je,function(){return function(t,r,s){var i=r.prototype,o=function(u){return u&&(u.indexOf?u:u.s)},a=function(u,f,g,p,C){var I=u.name?u:u.$locale(),S=o(I[f]),D=o(I[g]),U=S||D.map(function(w){return w.slice(0,p)});if(!C)return U;var B=I.weekStart;return U.map(function(w,b){return U[(b+(B||0))%7]})},l=function(){return s.Ls[s.locale()]},c=function(u,f){return u.formats[f]||function(g){return g.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(p,C,I){return C||I.slice(1)})}(u.formats[f.toUpperCase()])},h=function(){var u=this;return{months:function(f){return f?f.format("MMMM"):a(u,"months")},monthsShort:function(f){return f?f.format("MMM"):a(u,"monthsShort","months",3)},firstDayOfWeek:function(){return u.$locale().weekStart||0},weekdays:function(f){return f?f.format("dddd"):a(u,"weekdays")},weekdaysMin:function(f){return f?f.format("dd"):a(u,"weekdaysMin","weekdays",2)},weekdaysShort:function(f){return f?f.format("ddd"):a(u,"weekdaysShort","weekdays",3)},longDateFormat:function(f){return c(u.$locale(),f)},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(f){return c(u,f)},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)}}})})(el);var h_=el.exports;const d_=It(h_);var tl={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Je,function(){var t={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=t,o.format=function(l){l===void 0&&(l="YYYY-MM-DDTHH:mm:ssZ");var c=this.$locale().formats,h=function(u,f){return u.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(g,p,C){var I=C&&C.toUpperCase();return p||f[C]||t[C]||f[I].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(S,D,U){return D||U.slice(1)})})}(l,c===void 0?{}:c);return a.call(this,h)}}})})(tl);var f_=tl.exports;const g_=It(f_);var nl={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Je,function(){var t="minute",r=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(i,o,a){var l=o.prototype;a.utc=function(C){var I={date:C,utc:!0,args:arguments};return new o(I)},l.utc=function(C){var I=a(this.toDate(),{locale:this.$L,utc:!0});return C?I.add(this.utcOffset(),t):I},l.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var c=l.parse;l.parse=function(C){C.utc&&(this.$u=!0),this.$utils().u(C.$offset)||(this.$offset=C.$offset),c.call(this,C)};var h=l.init;l.init=function(){if(this.$u){var C=this.$d;this.$y=C.getUTCFullYear(),this.$M=C.getUTCMonth(),this.$D=C.getUTCDate(),this.$W=C.getUTCDay(),this.$H=C.getUTCHours(),this.$m=C.getUTCMinutes(),this.$s=C.getUTCSeconds(),this.$ms=C.getUTCMilliseconds()}else h.call(this)};var u=l.utcOffset;l.utcOffset=function(C,I){var S=this.$utils().u;if(S(C))return this.$u?0:S(this.$offset)?u.call(this):this.$offset;if(typeof C=="string"&&(C=function(w){w===void 0&&(w="");var b=w.match(r);if(!b)return null;var P=(""+b[0]).match(s)||["-",0,0],W=P[0],he=60*+P[1]+ +P[2];return he===0?0:W==="+"?he:-he}(C),C===null))return this;var D=Math.abs(C)<=16?60*C:C,U=this;if(I)return U.$offset=D,U.$u=C===0,U;if(C!==0){var B=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(U=this.local().add(D+B,t)).$offset=D,U.$x.$localOffset=B}else U=this.utc();return U};var f=l.format;l.format=function(C){var I=C||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return f.call(this,I)},l.valueOf=function(){var C=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*C},l.isUTC=function(){return!!this.$u},l.toISOString=function(){return this.toDate().toISOString()},l.toString=function(){return this.toDate().toUTCString()};var g=l.toDate;l.toDate=function(C){return C==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():g.call(this)};var p=l.diff;l.diff=function(C,I,S){if(C&&this.$u===C.$u)return p.call(this,C,I,S);var D=this.local(),U=a(C).local();return p.call(D,U,I,S)}}})})(nl);var m_=nl.exports;const __=It(m_);var rl={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Je,function(){return function(t,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")}}})})(rl);var p_=rl.exports;const E_=It(p_);var sl={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Je,function(){var t="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(t);if(h.isBefore(u))return 1}var f=o(this).startOf(r).date(c).startOf(t).subtract(1,"millisecond"),g=this.diff(f,t,!0);return g<0?o(this).startOf("week").week():Math.ceil(g)},a.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}})})(sl);var C_=sl.exports;const v_=It(C_);var il={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Je,function(){return function(t,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}}})})(il);var R_=il.exports;const I_=It(R_);Wt.extend(c_),Wt.extend(l_),Wt.extend(E_),Wt.extend(d_),Wt.extend(v_),Wt.extend(I_),Wt.extend(__),Wt.extend(g_);function Hr(e,n,t,r){if(e>n)throw new Error("a1 should be less than a2");if(t>r)throw new Error("b1 should be less than b2");if(n<t||r<e)return[e,n];if(t<=e&&r>=n)return[];const s=r-t+1;return e<t&&n>r?[e,n-s]:t<=e&&r<n?[r+1-s,n-s]:t>e&&r>=n?[e,t-1]:[e,n]}function S_(e){if(e==null)return!1;const n=e.bullet;return(n==null?void 0:n.listId)!=null}function O_(e){if(e==null)return!1;const n=e.paragraphStyle;return ol(n)}function ol(e){var n;return!(e==null||(e.indentStart==null||e.indentStart.v===0)&&e.hanging==null||((n=e.hanging)==null?void 0:n.v)===0)}function al(e,n,t){return e.slice(0,n)+t+e.slice(n)}function ll(e,n,t){return n>t?e:e.slice(0,n)+e.slice(t)}const y_=/\s/g;function w_(e){return e===null||e.toString().replace(y_,"")===""||typeof e=="boolean"?!1:!isNaN(e)}function b_(e){let n=0;for(let t=0;t<e.length;t++)n=e.charCodeAt(t)+(n<<6)+(n<<16)-n;return n>>>0}const je=Symbol("newer"),ot=Symbol("older");class A_{constructor(n){R(this,"entry");this.entry=n}[Symbol.iterator](){return this}next(){const n=this.entry;return n?(this.entry=n[je],{done:!1,value:n.key}):{done:!0,value:void 0}}}class T_{constructor(n){R(this,"entry");this.entry=n}[Symbol.iterator](){return this}next(){const n=this.entry;return n?(this.entry=n[je],{done:!1,value:n.value}):{done:!0,value:void 0}}}class N_{constructor(n){R(this,"entry");this.entry=n}[Symbol.iterator](){return this}next(){const n=this.entry;return n?(this.entry=n[je],{done:!1,value:[n.key,n.value]}):{done:!0,value:void 0}}}yc=je,Oc=ot;class ul{constructor(n,t){R(this,"key");R(this,"value");R(this,yc);R(this,Oc);this.key=n,this.value=t,this[je]=void 0,this[ot]=void 0}toJSON(){return{key:this.key,value:this.value}}}class Br{constructor(...n){R(this,"_keymap");R(this,"size",0);R(this,"limit");R(this,"oldest");R(this,"newest");R(this,"_onShiftListeners",[]);if(Zn.hasLength(n,1)){if(Zn.isNumber(n[0])){const t=n[0];this._initialize(t,void 0);return}if(Zn.isIterable(n[0])){const t=n[0];this._initialize(0,t);return}return}if(Zn.hasLength(n,2)){const t=n[0],r=n[1];this._initialize(t,r)}}onShift(n){if(this._onShiftListeners.indexOf(n)===-1)return this._onShiftListeners.push(n),Ze(()=>Bn(this._onShiftListeners,n));throw new Error("[LRUMap]: the listener has been registered!")}_initialize(n,t){this.oldest=void 0,this.newest=void 0,this.size=0,this.limit=n,this._keymap=new Map,t&&(this.assign(t),n<1&&(this.limit=this.size))}_markEntryAsUsed(n){n!==this.newest&&(n[je]&&(n===this.oldest&&(this.oldest=n[je]),n[je][ot]=n[ot]),n[ot]&&(n[ot][je]=n[je]),n[je]=void 0,n[ot]=this.newest,this.newest&&(this.newest[je]=n),this.newest=n)}assign(n){let t,r=this.limit||Number.MAX_VALUE;this._keymap.clear();const s=n[Symbol.iterator]();for(let i=s.next();!i.done;i=s.next()){const o=new ul(i.value[0],i.value[1]);if(this._keymap.set(o.key,o),t?(t[je]=o,o[ot]=t):this.oldest=o,t=o,r--===0)throw new Error("overflow")}this.newest=t,this.size=this._keymap.size}set(n,t){let r=this._keymap.get(n);return r?(r.value=t,this._markEntryAsUsed(r),this):(this._keymap.set(n,r=new ul(n,t)),this.newest?(this.newest[je]=r,r[ot]=this.newest):this.oldest=r,this.newest=r,++this.size,this.size>this.limit&&this.shift(),this)}shift(){const n=this.oldest;if(n)return this.oldest&&this.oldest[je]?(this.oldest=this.oldest[je],this.oldest[ot]=void 0):(this.oldest=void 0,this.newest=void 0),n[je]=n[ot]=void 0,this._keymap.delete(n.key),--this.size,this._onShiftListeners.forEach(t=>t(n)),[n.key,n.value]}get(n){const t=this._keymap.get(n);if(t)return this._markEntryAsUsed(t),t.value}has(n){return this._keymap.has(n)}find(n){const t=this._keymap.get(n);return t?t.value:void 0}delete(n){const t=this._keymap.get(n);if(t)return this._keymap.delete(t.key),t[je]&&t[ot]?(t[ot][je]=t[je],t[je][ot]=t[ot]):t[je]?(t[je][ot]=void 0,this.oldest=t[je]):t[ot]?(t[ot][je]=void 0,this.newest=t[ot]):this.oldest=this.newest=void 0,this.size--,t.value}clear(){this.oldest=void 0,this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new A_(this.oldest)}values(){return new T_(this.oldest)}entries(){return this[Symbol.iterator]()}[Symbol.iterator](){return new N_(this.oldest)}forEach(n,t){typeof t!="object"&&(t=this);let r=this.oldest;for(;r;)n.call(t,r.value,r.key,this),r=r[je]}toJSON(){const n=new Array(this.size);let t=0,r=this.oldest;for(;r;)n[t++]={key:r.key,value:r.value},r=r[je];return n}toString(){let n="",t=this.oldest;for(;t;)n+=`${String(t.key)}:${t.value}`,t=t[je],t&&(n+=" < ");return n}}class Zn{static hasLength(n,t){return n.length===t}static getValueType(n){return Object.prototype.toString.apply(n)}static isObject(n){return this.getValueType(n)==="[object Object]"}static isIterable(n){return n[Symbol.iterator]!=null}static isNumber(n){return this.getValueType(n)==="[object Number]"}}var cl={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(typeof self<"u"?self:Je,function(){return function(){var t={d:function(E,m){for(var _ in m)t.o(m,_)&&!t.o(E,_)&&Object.defineProperty(E,_,{enumerable:!0,get:m[_]})},o:function(E,m){return Object.prototype.hasOwnProperty.call(E,m)}},r={};t.d(r,{default:function(){return _t}});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(E){const m=i.exec(E);if(!m)throw new SyntaxError("Malformed locale: ".concat(E));return{lang:m[1]+(m[2]?"_"+m[2]:""),language:m[1],territory:m[2]||"",codeset:m[3]||"",modifier:m[4]||""}}function c(E){if(typeof E=="number")return s[65535&E]||null;const m=parseInt(E,16);return isFinite(m)&&s[65535&m]?s[65535&m]||null:i.test(E)?E:null}function h(E){const m=c(E);let _=null;if(m){const y=l(m);_=o[y.lang]||o[y.language]||null}return _}function u(E){return Object.assign({},a,E)}function f(E,m){const _=typeof m=="object"?m:l(m);return o[_.lang]=u(E),_.language===_.lang||o[_.language]||(o[_.language]=u(E)),o[_.lang]}const g=u({group:","});function p(E,m){if(typeof E!="number")return E;if(E<0)return-p(-E,m);if(m){const _=10**(m||0)||1;return p(E*_,0)/_}return Math.round(E)}g.isDefault=!0,f({group:",",ampm:["上午","下午"],mmmm:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],mmm:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dddd:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],ddd:["周日","周一","周二","周三","周四","周五","周六"]},"zh_CN"),f({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"),f({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"),f({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"),f({group:",",ampm:["ก่อนเที่ยง","หลังเที่ยง"],mmmm:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],mmm:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],dddd:["วันอาทิตย์","วันจันทร์","วันอังคาร","วันพุธ","วันพฤหัสบดี","วันศุกร์","วันเสาร์"],ddd:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."]},"th"),f({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"),f({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"),f({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"),f({group:","},"en"),f({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"),f({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"),f({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"),f({group:".",decimal:",",ampm:["π.μ.","μ.μ."],mmmm:["Ιανουαρίου","Φεβρουαρίου","Μαρτίου","Απριλίου","Μαΐου","Ιουνίου","Ιουλίου","Αυγούστου","Σεπτεμβρίου","Οκτωβρίου","Νοεμβρίου","Δεκεμβρίου"],mmm:["Ιαν","Φεβ","Μαρ","Απρ","Μαΐ","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"],dddd:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"],ddd:["Κυρ","Δευ","Τρί","Τετ","Πέμ","Παρ","Σάβ"]},"el"),f({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"),f({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"),f({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"),f({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"),f({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"),f({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"),f({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"),f({decimal:",",nan:"не число",mmmm:["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"],mmm:["янв.","февр.","мар.","апр.","мая","июн.","июл.","авг.","сент.","окт.","нояб.","дек."],dddd:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],ddd:["вс","пн","вт","ср","чт","пт","сб"]},"ru"),f({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"),f({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"),f({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"),f({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 C(E,m,_){const y=E<0?-1:1,A=10**(m||2),M=10**(_||2);let N,L,v=Math.abs(E),j=0,le=0,H=0,ie=1;if((E=v)%1==0)L=[E*y,1];else if(E<1e-19)L=[y,1e19];else if(E>1e19)L=[1e19*y,1];else{do if(v=1/(v-Math.floor(v)),N=ie,ie=ie*Math.floor(v)+j,j=N,le=H,H=Math.floor(E*ie+.5),H>=A||ie>=M)return[y*le,j];while(Math.abs(E-H/ie)>=1e-10&&v!==Math.floor(v));L=[y*H,ie]}return L}const I={overflow:"######",dateErrorThrows:!1,dateErrorNumber:!0,dateSpanLarge:!0,leap1900:!0,nbsp:!0,throws:!0,invalid:"######",locale:"",ignoreTimezone:!1},S=Object.assign({},I);function D(E){if(E===null&&(E=I),E){for(const m in E)if(m in I){const _=E[m];S[m]=_==null?I[m]:_}}return{...S}}const U={"#":"",0:"0","?":" "},B={"@":"text","-":"minus","+":"plus"},w=["#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"],b=["¤","$","£","¥","֏","؋","৳","฿","៛","₡","₦","₩","₪","₫","€","₭","₮","₱","₲","₴","₸","₹","₺","₼","₽","₾","₿"],P=new RegExp("["+b.join("")+"]");function W(E,m,_){return m[_+"_max"]=E.length,m[_+"_min"]=E.replace(/#/g,"").length,m}const he={};function ee(E){if(!(E in he)){const m=[],_=E.replace(/^[#,]+/,"").replace(/[1-9]\d*/g,y=>"?".repeat(y.length));for(let y=0;y<_.length;y++){const A=_.charAt(y);m[y]=A in U?U[A]:A}he[E]=m.join("")}return he[E]}function ae(E,m){typeof E=="string"&&(E={type:"string",value:E=E.replace(/ /g,U["?"])}),m.push(E)}function Ae(E){const m=[],_={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:m};let y=E+"",A="int",M=!1,N=null;const L=[];let v,j,le=!1;for(;y&&!M;){if(v=/^General/i.exec(y))_.general=!0,ae({type:"general"},m);else if(A==="int"&&(v=/^[#?0]+(?:,[#?0]+)*/.exec(y))||A==="den"&&(v=/^[#?\d]+/.exec(y))||(v=/^[#?0]+/.exec(y)))_[A+"_pattern"].push(v[0]),N={type:A,num:v[0]},ae(N,m);else if((v=/^\//.exec(y))&&_[A+"_pattern"].length){if(!N)throw new SyntaxError("Missing a numerator in pattern ".concat(E));_.fractions=!0,_.num_pattern.push(_[A+"_pattern"].pop()),N.type="num",A="den",ae({type:"div"},m)}else if(v=/^,+/.exec(y)){const T=y.charAt(1)in U;j.slice(-1)in U&&(v[0].length>1||!T)?_.scale=.001**v[0].length:_.dec_fractions||ae(v[0],m)}else{if(v=/^;/.exec(y)){M=!0;break}if(v=/^[@+-]/.exec(y))v[0]==="@"&&(_.text=!0),ae({type:B[v[0]]},m);else if(v=/^(?:\[(h+|m+|s+)\])/i.exec(y)){const T=v[1].toLowerCase(),Y=T[0],de={type:"",size:0,date:1,raw:v[0],pad:T.length};Y==="h"?(de.size=16,de.type="hour-elap"):Y==="m"?(de.size=32,de.type="min-elap"):(de.size=64,de.type="sec-elap"),_.date=_.date|de.size,L.push(de),ae(de,m)}else if(v=/^(?:B2)/i.exec(y))le||(_.date_system=6);else if(v=/^(?:B1)/i.exec(y))le||(_.date_system=1);else if(v=/^(?:([hHmMsSyYbBdDegG])\1*)/.exec(y)){const T={type:"",size:0,date:1,raw:v[0]},Y=v[0].toLowerCase(),de=Y[0];if(Y==="y"||Y==="yy")T.size=2,T.type="year-short";else if(de==="y"||de==="e")T.size=2,T.type="year";else if(Y==="b"||Y==="bb")T.size=2,T.type="b-year-short";else if(de==="b")T.size=2,T.type="b-year";else if(Y==="d"||Y==="dd")T.size=8,T.type="day",T.pad=/dd/.test(Y);else if(Y==="ddd")T.size=8,T.type="weekday-short";else if(de==="d")T.size=8,T.type="weekday";else if(de==="h")T.size=16,T.type="hour",T.pad=/hh/i.test(Y);else if(de==="m"){Y.length===3?(T.size=4,T.type="monthname-short"):Y.length===5?(T.size=4,T.type="monthname-single"):Y.length>=4&&(T.size=4,T.type="monthname");const Ie=L[L.length-1];!T.type&&Ie&&!Ie.used&&80&Ie.size&&(Ie.used=!0,T.size=32,T.type="min",T.pad=/mm/.test(Y)),T.type||(T.size=4,T.type="month",T.pad=/mm/.test(Y),T.indeterminate=!0)}else if(de==="s"){T.size=64,T.type="sec",T.pad=/ss/.test(Y);const Ie=L[L.length-1];Ie&&32&Ie.size?T.used=!0:Ie&&Ie.indeterminate&&(delete Ie.indeterminate,Ie.size=32,Ie.type="min",T.used=!0)}_.date=_.date|T.size,_.date_eval=!0,L.push(T),ae(T,m)}else if(v=/^(?:AM\/PM|am\/pm|A\/P)/.exec(y))_.clock=12,_.date=16|_.date,_.date_eval=!0,ae({type:"am",short:v[0]==="A/P"},m);else if(_.date&&(v=/^\.0{1,3}/i.exec(y))){const T=v[0].length-1,Y=[64,128,256,512][T];_.date=_.date|Y,_.date_eval=!0,_.sec_decimals=Math.max(_.sec_decimals,T),ae({type:"subsec",size:Y,decimals:T,date:1,raw:v[0]},m)}else if((v=/^\\(.)/.exec(y))||(v=/^"([^"]*?)"/.exec(y)))ae(v[1],m);else if(v=/^\[(<[=>]?|>=?|=)\s*(-?[.\d]+)\]/.exec(y))_.condition=[v[1],parseFloat(v[2],10)];else if(v=/^\[\$([^\]]+)\]/.exec(y)){const T=v[1].split("-"),Y=T.length<2?"":T[T.length-1],de=T[0];de&&ae(de,m);const Ie=c(Y);Ie&&(_.locale=Ie);const Ue=parseInt(Y,16);isFinite(Ue)&&16711680&Ue&&(Ue>>16&255)===6&&(_.date_system=6),le=!0}else if(v=/^\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*(\d+))\]/i.exec(y))_.color=v[2]?w[parseInt(v[2],10)]||"#000":v[1].toLowerCase();else if(!(v=/^\[(DBNum1|ENG|HIJ|JPN|TWN)\]/i.exec(y))){if(v=/^%/.exec(y))_.scale=100,_.percent=!0,ae("%",m);else if(v=/^_(\\.|.)/.exec(y))ae(" ",m);else if(v=/^\./.exec(y))ae({type:"point",value:v[0]},m),_.dec_fractions=!0,A="frac";else if(v=/^[Ee]([+-]?|(?=[0#?]))/.exec(y))_.exponential=!0,_.exp_plus=v[1]==="+",A="man",ae({type:"exp",plus:v[1]==="+"},m);else if(!(v=/^\*(\\.|.)/.exec(y))){if(v=/^[BENn[]/.exec(y))throw new SyntaxError("Unexpected char ".concat(y.charAt(0)," in pattern ").concat(E));y[0]==="("&&(_.parens=!0),v=[y[0]],ae(v[0],m)}}}j=v[0],y=y.slice(v?v[0].length:1)}if(_.pattern=E.slice(0,E.length-y.length),/^((?:\[[^\]]+\])+)(;|$)/.test(_.pattern)&&!/^\[(?:h+|m+|s+)\]/.test(_.pattern)&&ae({type:"text"},m),_.fractions&&_.dec_fractions||_.fractions&&_.exponential)throw new SyntaxError("Invalid pattern: ".concat(_.pattern));const H=_.int_pattern.join("");if(_.grouping=H.indexOf(",")>=0,_.grouping){const T=H.split(","),Y=T.length;Y===2?(_.group_pri=T[1].length,_.group_sec=_.group_pri):Y>2&&(_.group_pri=T[Y-1].length,_.group_sec=T[Y-2].length)}else _.group_pri=0,_.group_sec=0;W(H.replace(/[,]/g,""),_,"int"),W(_.frac_pattern.join(""),_,"frac"),W(_.man_pattern.join(""),_,"man");let ie=_.num_pattern.join(""),Ce=_.den_pattern.join("");const Q=/\?/.test(Ce)||/\?/.test(ie);return Ce=Ce.replace(/\d/g,Q?"?":"#"),Q&&(Ce=Ce.replace(/#$/g,"?")),W(ie,_,"num"),W(Ce,_,"den"),Q&&(ie=ie.replace(/#$/g,"?")),_.int_padding=ee(_.int_pattern.join("")),_.man_padding=ee(_.man_pattern.join("")),_.num_padding=ee(ie),_.den_padding=ee(Ce),_.den_pattern.length&&(_.denominator=parseInt(_.den_pattern.join("").replace(/\D/g,""),10)),_.integer=!!_.int_pattern.join("").length,_.fractions&&m.forEach((T,Y)=>{const de=m[Y+1];T.type==="string"&&de&&(de.type==="num"?T.rule="num+int":de.type==="div"?T.rule="num":de.type==="den"&&(T.rule="den"))}),_}const Ne=E=>{const m=E.condition;m&&m[1]<0&&(m[0]==="<"||m[0]==="<="||m[0]==="=")||E.tokens.unshift({type:"minus",volatile:!0})};function te(E){const m=[];let _,y=!1,A=null,M=E,N=0,L=!1,v=0,j=0;do{if(L=Ae(M),(L.date||L.general)&&(L.int_pattern.length||L.frac_pattern.length||L.scale!==1||L.text))throw new Error("Illegal format");if(L.condition&&(j++,y=!0),L.text){if(A)throw new Error("Unexpected partition");A=L}L.locale&&(_=c(L.locale)),m.push(L),N=M.charAt(L.pattern.length)===";"?1:0,M=M.slice(L.pattern.length+N),v++}while(N&&v<4&&j<3);if(N)throw new Error("Unexpected partition");if(j>2)throw new Error("Unexpected condition");const le=m[3];if(le&&(le.int_pattern.length||le.frac_pattern.length||le.date))throw new Error("Unexpected partition");if(y){const H=m.length;if(H===1&&(m[1]=Ae("General"),m[1].generated=!0),H<3){const ie=m[0],Ce=m[1];if(Ne(ie),Ce.condition)Ne(Ce);else{const Q=ie.condition;(Q[0]==="="||Q[1]>=0&&(Q[0]===">"||Q[0]===">="))&&Ce.tokens.unshift({type:"minus",volatile:!0})}}else m.forEach(Ne)}else{if(m.length<4&&A)for(let H=0,ie=m.length;H<ie;H++)m[H]===A&&m.splice(H,1);if(m.length<1&&A&&(m[0]=Ae("General"),m[0].generated=!0),m.length<2){const H=Ae(m[0].pattern);H.tokens.unshift({type:"minus",volatile:!0}),H.generated=!0,m.push(H)}if(m.length<3){const H=Ae(m[0].pattern);H.generated=!0,m.push(H)}if(m.length<4)if(A)m.push(A);else{const H=Ae("@");H.generated=!0,m.push(H)}m[0].condition=[">",0],m[1].condition=["<",0],m[2].condition=null}return{pattern:E,partitions:m,locale:_}}const $=Math.floor;function V(E){if((!(arguments.length>1&&arguments[1]!==void 0)||arguments[1])&&E>=0){if(E===0)return[1900,1,0];if(E===60)return[1900,2,29];if(E<60)return[1900,E<32?1:2,(E-1)%31+1]}let _=E+68569+2415019;const y=$(4*_/146097);_-=$((146097*y+3)/4);const A=$(4e3*(_+1)/1461001);_=_-$(1461*A/4)+31;const M=$(80*_/2447),N=_-$(2447*M/80);_=$(M/11);const L=M+2-12*_;return[0|100*(y-49)+A+_,0|L,0|N]}function pe(E){return V(E+1462)}function ne(E){if(E===60)throw new Error("#VALUE!");if(E<=1)return[1317,8,29];if(E<60)return[1317,E<32?9:10,1+(E-2)%30];const m=10631/30,_=.1335;let y=E+466935;const A=$(y/10631);y-=10631*A;const M=$((y-_)/m);y-=$(M*m+_);const N=$((y+28.5001)/29.5);return N===13?[30*A+M,12,30]:[30*A+M,N,y-$(29.5001*N-29)]}function ve(E){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,_=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];const y=$(E);return m===6?ne(y):m===-1?pe(y):V(y,_)}const Oe=Math.floor,Me=86400;function Fe(E,m){let _=null;if(Array.isArray(E)){const[y,A,M,N,L,v]=E;_=Date.UTC(y,A==null?0:A-1,M!=null?M:1,N||0,L||0,v||0)}else if(E instanceof Date&&(_=1*E,!m||!m.ignoreTimezone)){const y=new Date;y.setUTCFullYear(E.getFullYear(),E.getMonth(),E.getDate()),y.setUTCHours(E.getHours(),E.getMinutes(),E.getSeconds(),E.getMilliseconds()),_=1*y}if(_!=null&&isFinite(_)){const y=_/864e5;return y-(y<=-25509?-25568:-25569)}return E}function Ye(E,m){let _=0|E;const y=Me*(E-_);let A=Oe(y);y-A>.9999&&(A+=1,A===Me&&(A=0,_+=1));const M=A<0?Me+A:A,[N,L,v]=ve(E,0,m&&m.leap1900),j=Oe(M/60/60)%60,le=Oe(M/60)%60,H=Oe(M)%60;if(m&&m.nativeDate){const ie=new Date(0);return ie.setUTCFullYear(N,L-1,v),ie.setUTCHours(j,le,H),ie}return[N,L,v,j,le,H]}function qe(E){return!!(E[0]&&E[0].percent||E[1]&&E[1].percent||E[2]&&E[2].percent||E[3]&&E[3].percent)}function O(E){return!!(E[0]&&E[0].date||E[1]&&E[1].date||E[2]&&E[2].date||E[3]&&E[3].date)}function k(E){const[m,_,y,A]=E;return!(m&&!m.generated||_&&!_.generated||y&&!y.generated||!A||!A.text||A.generated)}const J={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},re=[["DMY",1],["DM",2],["MY",3],["MDY",4],["MD",5],["hmsa",6],["hma",7],["hms",8],["hm",9]],X={total:1,sign:0,period:0,int:1,frac:0},G=(E,m)=>E.replace(/\./,m.decimal);function me(E,m,_,y){const A=0|_;if(typeof _=="string")E.push(_);else if(_===A)E.push(Math.abs(A));else{const M=Math.abs(_);let N=M?Math.floor(Math.log10(M)):0,L=N<0?M*10**-N:M/10**N;L===10&&(L=1,N++);const v=function(le){let H=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];const ie=Math.abs(le);if(!ie)return X;const Ce=H&&le<0?1:0,Q=Math.floor(ie),T=Math.floor(Math.log10(ie)+1);let Y=0,de=0;if(Q!==ie){Y=1;const Ie=String(p(T<0?ie*10**-T:ie/10**T,15));let Ue=Ie.length,Pe=!0,Be=0;for(;Be<=Ie.length;){if(Ie[Be]==="."){Ue--;break}Ie[Be]==="0"&&Pe?Ue--:Pe=!1,Be++}de=Ue-T,de<0&&(de=0,Y=0)}return{total:Ce+Math.max(T,1)+Y+de,digits:Math.max(T,0)+de,sign:Ce,period:Y,int:Math.max(T,1),frac:de}}(M),j=()=>{const le=Math.abs(N);let H;H=L===1?L:p(L,5),E.push(G(H+"",y),y.exponent,N<0?y.negative:y.positive,le<10?"0":"",le)};if(N>=-4&&N<=-1){const le=M.toPrecision(10+N).replace(/\.?0+$/,"");E.push(G(le,y))}else if(N===10){const le=M.toFixed(10).slice(0,12).replace(/\.$/,"");E.push(G(le,y))}else if(Math.abs(N)<=9)if(v.total<=11){const le=p(M,9).toFixed(v.frac);E.push(G(le,y))}else N===9?E.push(Math.floor(M)):N>=0&&N<9?E.push(p(M,9-N)):j();else v.total>=12?j():Math.floor(M)===M?E.push(Math.floor(M)):E.push(G(p(M,9).toFixed(v.frac),y))}return E}const ge=86400,F={int:"integer",frac:"fraction",man:"mantissa",num:"numerator",den:"denominator"},Z=function(E){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const _=Math.floor(Math.log10(E));return m>1?Math.floor(_/m)*m:_};function q(E,m,_,y){let A="",M="",N="",L="",v="",j=0,le=0|E,H=0,ie=0,Ce=1,Q=0,T=0,Y=0,de=0,Ie=0,Ue=0;const Pe=y||g;if(!m.text&&isFinite(m.scale)&&m.scale!==1&&(E=function(_e){if(_e===0)return _e;const ye=Math.ceil(Math.log10(_e<0?-_e:_e)),z=10**(16-Math.floor(ye));return Math.round(_e*z)/z}(E*m.scale)),m.exponential){let _e=Math.abs(E);if(_e){const ye=10**-Z(_e,m.int_max),z=p(_e*ye,m.frac_max)/ye;j=Z(z,m.int_max)}_e/=10**j,E=E<0?-_e:_e,A+=Math.abs(j)}if(m.integer){const _e=Math.abs(p(E,m.fractions?1:m.frac_max));v+=_e<1?"":Math.floor(_e)}if(m.grouping){let _e="",ye=v.length;for(ye>m.group_pri&&(ye-=m.group_pri,_e=Pe.group+v.slice(ye,ye+m.group_pri)+_e);ye>m.group_sec;)ye-=m.group_sec,_e=Pe.group+v.slice(ye,ye+m.group_sec)+_e;v=ye?v.slice(0,ye)+_e:_e}m.dec_fractions&&(L=String(p(E,m.frac_max)).split(".")[1]||"");let Be=!1;if(m.fractions){const _e=Math.abs(m.integer?E%1:E);if(_e)if(Be=!0,isFinite(m.denominator))N+=m.denominator,M+=p(_e*m.denominator),M==="0"&&(M="",N="",Be=!1,v||(v="0"));else{const ye=C(_e,m.integer?m.num_max:1/0,m.den_max);M+=ye[0],N+=ye[1],m.integer&&M==="0"&&(v||(v="0"),M="",N="",Be=!1)}}if(m.date){le=Math.trunc(E);const _e=ge*(E-le);if(H=Math.floor(_e),Ue=_e-H,Math.abs(Ue)<1e-6?Ue=0:Ue>.9999&&(Ue=0,H+=1,H===ge&&(H=0,le+=1)),Ue){const ye=512&m.date||256&m.date||128&m.date;(ye===512&&Ue>.9995||ye===256&&Ue>.995||ye===128&&Ue>.95||!ye&&Ue>=.5)&&(H++,Ue=0)}if(le||m.date_system){const ye=ve(E,m.date_system,_.leap1900);ie=ye[0],Ce=ye[1],Q=ye[2]}if(H){const ye=H<0?ge+H:H;Ie=Math.floor(ye)%60,de=Math.floor(ye/60)%60,Y=Math.floor(ye/60/60)%60}if(T=(6+le)%7,m.date_eval&&(pt=E,Et=le+H/ge,_.dateSpanLarge?pt<-694324||Et>=35830291:pt<0||Et>=2958466)){if(_.dateErrorThrows)throw new Error("Date out of bounds");return _.dateErrorNumber?me(E<0?[Pe.negative]:[],0,E,Pe).join(""):_.overflow}}var pt,Et;if(m.int_padding&&(v=m.int_padding.length===1?v||m.int_padding:m.int_padding.substring(0,m.int_padding.length-v.length)+v),m.num_padding&&(M=m.num_padding.length===1?M||m.num_padding:m.num_padding.substring(0,m.num_padding.length-M.length)+M),m.den_padding&&(N=m.den_padding.length===1?N||m.den_padding:N+m.den_padding.slice(N.length)),m.man_padding){const _e=m.exp_plus?"+":"";A=m.man_padding.length===1?(j<0?"-":_e)+(A||m.man_padding):(j<0?"-":_e)+m.man_padding.slice(0,m.man_padding.length-A.length)+A}const ue=[];let et=0;const Ee={int:0,frac:0,man:0,num:0,den:0};for(let _e=0,ye=m.tokens.length;_e<ye;_e++){const z=m.tokens[_e],ht=z.num?z.num.length:0;if(z.type==="string")z.rule?z.rule==="num"?Be?ue.push(z.value):(m.num_min>0||m.den_min>0)&&ue.push(z.value.replace(/./g,U["?"])):z.rule==="num+int"?Be&&v?ue.push(z.value):m.den_min>0&&(v||m.num_min)&&ue.push(z.value.replace(/./g,U["?"])):z.rule==="den"&&(Be?ue.push(z.value):(m.den_min>0||m.den_min>0)&&ue.push(z.value.replace(/./g,U["?"]))):ue.push(z.value);else if(z.type==="error")ue.push(_.invalid);else if(z.type==="point")ue.push(m.date?z.value:Pe.decimal);else if(z.type==="general")me(ue,0,E,Pe);else if(z.type==="exp")ue.push(Pe.exponent);else if(z.type==="minus")z.volatile&&m.date||z.volatile&&(E>=0||typeof E!="number")||(z.volatile&&!m.fractions&&(m.integer||m.dec_fractions)?(E<0&&v&&v!=="0"||L)&&ue.push(Pe.negative):ue.push(Pe.negative));else if(z.type==="plus")ue.push(Pe.positive);else if(z.type==="text")ue.push(E);else if(z.type==="div")Be?ue.push("/"):m.num_min>0||m.den_min>0?ue.push(U["?"]):ue.push(U["#"]);else if(z.type==="int")if(m.int_pattern.length===1)ue.push(v);else{const xe=et?m.int_pattern.join("").length-Ee.int:1/0,xt=et===m.int_pattern.length-1?0:m.int_pattern.join("").length-(Ee.int+z.num.length);ue.push(v.substring(v.length-xe,v.length-xt)),et++,Ee.int+=z.num.length}else if(z.type==="frac"){const xe=Ee.frac;for(let xt=0;xt<ht;xt++)ue.push(L[xt+xe]||U[z.num[xt]]);Ee.frac+=ht}else if(z.type in F)m[z.type+"_pattern"].length===1?(z.type==="int"&&ue.push(v),z.type==="frac"&&ue.push(L),z.type==="man"&&ue.push(A),z.type==="num"&&ue.push(M),z.type==="den"&&ue.push(N)):(ue.push(F[z.type].slice(Ee[z.type],Ee[z.type]+ht)),Ee[z.type]+=ht);else if(z.type==="year")ie<0&&ue.push(Pe.negative),ue.push(String(Math.abs(ie)).padStart(4,"0"));else if(z.type==="year-short"){const xe=ie%100;ue.push(xe<10?"0":"",xe)}else if(z.type==="month")ue.push(z.pad&&Ce<10?"0":"",Ce);else if(z.type==="monthname-single")m.date_system===6?ue.push(Pe.mmmm6[Ce-1].charAt(0)):ue.push(Pe.mmmm[Ce-1].charAt(0));else if(z.type==="monthname-short")m.date_system===6?ue.push(Pe.mmm6[Ce-1]):ue.push(Pe.mmm[Ce-1]);else if(z.type==="monthname")m.date_system===6?ue.push(Pe.mmmm6[Ce-1]):ue.push(Pe.mmmm[Ce-1]);else if(z.type==="weekday-short")ue.push(Pe.ddd[T]);else if(z.type==="weekday")ue.push(Pe.dddd[T]);else if(z.type==="day")ue.push(z.pad&&Q<10?"0":"",Q);else if(z.type==="hour"){const xe=Y%m.clock||(m.clock<24?m.clock:0);ue.push(z.pad&&xe<10?"0":"",xe)}else if(z.type==="min")ue.push(z.pad&&de<10?"0":"",de);else if(z.type==="sec")ue.push(z.pad&&Ie<10?"0":"",Ie);else if(z.type==="subsec"){ue.push(Pe.decimal);const xe=Ue.toFixed(m.sec_decimals);ue.push(xe.slice(2,2+z.decimals))}else if(z.type==="am"){const xe=Y<12?0:1;z.short&&!y?ue.push("AP"[xe]):ue.push(Pe.ampm[xe])}else if(z.type==="hour-elap"){E<0&&ue.push(Pe.negative);const xe=24*le+Math.floor(Math.abs(H)/3600);ue.push(String(Math.abs(xe)).padStart(z.pad,"0"))}else if(z.type==="min-elap"){E<0&&ue.push(Pe.negative);const xe=1440*le+Math.floor(Math.abs(H)/60);ue.push(String(Math.abs(xe)).padStart(z.pad,"0"))}else if(z.type==="sec-elap"){E<0&&ue.push(Pe.negative);const xe=le*ge+Math.abs(H);ue.push(String(Math.abs(xe)).padStart(z.pad,"0"))}else if(z.type==="b-year")ue.push(ie+543);else if(z.type==="b-year-short"){const xe=(ie+543)%100;ue.push(xe<10?"0":"",xe)}}return _.nbsp?ue.join(""):ue.join("").replace(/\u00a0/g," ")}function se(E,m){for(let _=0;_<3;_++){const y=m[_];if(y){let A;if(y.condition){const M=y.condition[0],N=y.condition[1];M==="="?A=E===N:M===">"?A=E>N:M==="<"?A=E<N:M===">="?A=E>=N:M==="<="?A=E<=N:M==="<>"&&(A=E!==N)}else A=!0;if(A)return y}}}const Re=Ae("@"),be="black",x={};function fe(E,m){if(E){const _=E[0];m[_]=m[_]||{},fe(E.slice(1),m[_])}else m.$=!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(E=>{fe(E,x),fe(E+" x",x),fe(E+" l",x),fe(E+" l x",x),fe("l "+E,x),fe("l "+E+" x",x),fe(E+" D",x),fe(E+" D x",x),fe("D "+E,x),fe("D "+E+" 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},He={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"},Xe=new Date().getUTCFullYear();function bt(E){const m=new RegExp("^([\\s+%"+b.join("")+"(-]*)(((?:(?:\\d[\\d,]*)(?:\\.\\d*)?|(?:\\.\\d+)))([eE][+-]?\\d+)?)([\\s%"+b.join("")+")]*)$").exec(E);if(m){const[,_,y,A,M,N]=m;let L=1,v="",j=!1,le=!1,H=!1,ie=!1,Ce=!1,Q=null,T=!1,Y=parseFloat(y.replace(/,/g,""));if(!isFinite(Y))return null;for(let Ie=0;Ie<_.length;Ie++){const Ue=_[Ie];if(Ue==="-"){if(j||le)return null;j=!0,L=-1}else if(P.test(Ue)){if(Ce)return null;Ce=!0,Q=Ue}else if(Ue==="("){if(le||j)return null;le=!0,L=-1}else if(Ue==="%"){if(ie)return null;ie=!0}}for(let Ie=0;Ie<N.length;Ie++){const Ue=N[Ie];if(P.test(Ue)){if(Ce)return null;Ce=!0,Q=Ue,T=!0}else if(Ue===")"){if(H||!le)return null;H=!0}else if(Ue==="%"){if(ie)return null;ie=!0}}if(M){if(ie||Ce)return null;v="0.00E+00"}else if(ie){if(Ce)return null;v=A.includes(".")?"0.00%":"0%",Y*=.01}else if(Ce){const Ie=A.includes(".")?"#,##0.00":"#,##0";v=T?Ie+Q:Q+Ie}else A.includes(",")&&(v=A.includes(".")?"#,##0.00":"#,##0");const de={v:Y*L};return v&&(de.z=v),de}}const Ve=(E,m,_)=>{const y=_.path||"",A=Object.keys(m);for(let M=0;M<A.length;M++){let N;const L=A[M];if(m[L]){if(L==="$"||L==="€")E||(N=_);else if(L==="-"){const v=/^(\s*([./-]|,\s)\s*|\s+)/.exec(E);if(v){const j=v[1]==="-"||v[1]==="/"||v[1]==="."?v[1]:" ";if(!_.sep||_.sep===j){const le=v[0].replace(/\s+/g," ");N=Ve(E.slice(v[0].length),m[L],{..._,sep:j,path:y+le})}}}else if(L===" "){const v=/^[,.]?\s+/.exec(E);if(v){const j=v[0].replace(/\s+/g," ");N=Ve(E.slice(v[0].length),m[L],{..._,path:y+j})}}else if(L==="j"||L==="d"){const v=/^(0?[1-9]|1\d|2\d|3[01])\b/.exec(E);v&&(N=Ve(E.slice(v[0].length),m[L],{..._,day:v[0],path:y+L}))}else if(L==="n"||L==="m"){const v=/^(0?[1-9]|1[012])\b/.exec(E);v&&(N=Ve(E.slice(v[0].length),m[L],{..._,month:+v[0],_mon:v[0],path:y+L}))}else if(L==="F"||L==="M"){const v=/^([a-z]{3,9})\b/i.exec(E),j=v&&(L==="F"?He:ze)[v[0].toLowerCase()];j&&(N=Ve(E.slice(v[0].length),m[L],{..._,month:j,_mon:v[0],path:y+L}))}else if(L==="l"||L==="D"){const v=/^([a-z]{3,9})\b/i.exec(E);(v&&Le[v[0].toLowerCase()])===L&&(N=Ve(E.slice(v[0].length),m[L],{..._,path:y+L}))}else if(L==="y"){const v=/^\d\d\b/.exec(E);if(v){const j=+v[0]>=30?+v[0]+1900:+v[0]+2e3;N=Ve(E.slice(v[0].length),m[L],{..._,year:j,path:y+L})}}else if(L==="Y"){const v=/^\d\d\d\d\b/.exec(E);v&&(N=Ve(E.slice(v[0].length),m[L],{..._,year:+v[0],path:y+L}))}else{if(L!=="x")throw new Error('Unknown date token "'.concat(L,'"'));{const v=Ge(E);v&&(N=Ve("",m[L],{..._,time:v.v,tf:v.z,path:y+L}))}}if(N)return N}}};function nt(E,m){const _=Ve(E.trim(),x,{path:""});if(_){var y;if(_.sep==="."&&_.path.length===3)return null;const A=+((y=_.year)!==null&&y!==void 0?y:Xe);if(_.day||(_.day=1),!function(L,v,j){if(j<1||v<1||v>12)return!1;if(v===2){if(j>(L%4==0&&L%100!=0||L%400==0||L===1900?29:28))return!1}else if((v===4||v===6||v===9||v===11)&&j>30||(v===1||v===3||v===5||v===7||v===8||v===10||v===12)&&j>31)return!1;return!0}(A,_.month,_.day))return null;let M=-1/0;if(A<1900)return null;A<=1900&&_.month<=2?M=25568:A<1e4&&(M=25569);const N=Date.UTC(A,_.month-1,_.day)/864e5+M+(_.time||0);if(N>=0&&N<=2958465){const L=_._mon[0]==="0"||_.day[0]==="0"||_._mon.length===2&&_.day.length===2,v=_.path.replace(/[jdlDnmMFyYx-]/g,j=>j==="j"||j==="d"?L?"dd":"d":j==="D"?"ddd":j==="l"?"dddd":j==="n"||j==="m"?L?"mm":"m":j==="M"?"mmm":j==="F"?"mmmm":j==="y"?"yy":j==="x"?_.tf||"":j==="Y"?"yyyy":j);return m&&m.nativeDate?{v:Ye(N,m),z:v}:{v:N,z:v}}}return null}function Ge(E){const m=/^\s*([10]?\d|2[0-4])(?::([0-5]\d|\d))?(?::([0-5]\d|\d))?(\.\d{1,10})?(?:\s*([AP])M?)?\s*$/i.exec(E);if(m){const[,_,y,A,M,N]=m;if(M&&!A||!N&&!y&&!A)return null;let L=1*(_||0);if(N){if(L>=13)return null;N[0]!=="p"&&N[0]!=="P"||(L+=12)}return{v:(60*L*60+60*(1*(y||0))+1*(A||0)+1*(M||0))/86400,z:(_.length===2?"hh":"h")+":mm"+(A?":ss":"")+(N?" AM/PM":"")}}return null}function mt(E){return/^\s*true\s*$/i.test(E)?{v:!0}:/^\s*false\s*$/i.test(E)?{v:!1}:null}const ut={};function Gt(E,m){const{pattern:_,partitions:y,locale:A}=E,M=v=>{const j=Object.assign({},D(),m,v);return A&&(j.locale=A),j},N=(v,j)=>{const le=M(j);return function(H,ie,Ce){const Q=h(Ce.locale),T=ie[3]?ie[3]:Re;if(typeof H=="boolean"&&(H=H?"TRUE":"FALSE"),H==null)return"";if(typeof H!="number")return q(H,T,Ce,Q);if(!isFinite(H)){const de=Q||g;return isNaN(H)?de.nan:(H<0?de.negative:"")+de.infinity}const Y=se(H,ie);return Y?q(H,Y,Ce,Q):Ce.overflow}(Fe(v,le),y,le)};N.color=(v,j)=>function(le,H){if(typeof le!="number"||!isFinite(le))return(H[3]?H[3].color:Re.color)||be;const ie=se(le,H);return ie&&ie.color||be}(Fe(v,M(j)),y);const L=function(v){var j;let le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const[H,ie]=v,Ce=H.frac_max,Q={type:"general",isDate:O(v),isText:k(v),isPercent:qe(v),maxDecimals:H.general?9:Ce,scale:(j=H.scale)!==null&&j!==void 0?j:1,color:0,parentheses:0,grouped:H.grouping?1:0,_partitions:v},T=!Q.isDate&&!Q.isText&&!H.error&&H.tokens.some(Pe=>Pe.type==="string"&&(le?Pe.value===le:P.test(Pe.value)));let Y="G",de=Ce>=0?Math.min(15,Ce):"",Ie="",Ue="";if(ie&&ie.color&&(Ue="-",Q.color=1),H.parens&&(Ie="()",Q.parentheses=1),T)Y="C",Q.type="currency";else if(H.error)Q.type="error",Q.maxDecimals=0;else if(Q.isDate){let Pe=0,Be=0,pt="";H.tokens.forEach(ue=>{const et=ue.type;/^(b-)?year/.test(et)?(pt+="Y",Be++):et.startsWith("month")?(pt+="M",Be++):/^(week)?day/.test(et)?(pt+="D",Be++):et!=="hour"&&et!=="min"&&et!=="sec"&&et!=="am"||(pt+=et[0],Pe++)}),Q.type="date",Be&&Pe?Q.type="datetime":!Be&&Pe&&(Q.type="time");const Et=re.find(ue=>pt.startsWith(ue[0]));Y=Et?"D":"G",de=Et?Et[1]:""}else Q.isText?(Y="G",Q.type="text",de="",Q.maxDecimals=0):H.general?(Y="G",Q.type="general",de=""):H.fractions?(Y="G",Q.type="fraction",de=""):H.exponential?(Y="S",Q.type="scientific"):Q.isPercent?(Y="P",Q.type="percent"):H.grouping?(Y=",",Q.type="grouped"):(H.int_max||Ce)&&(Y="F",Q.type="number");return Q.code=Y+de+Ue+Ie,Q.level=J[Q.type],Object.freeze(Q)}(y,(m||{}).currency)||new SyntaxError;return N.info=L,N.dateInfo=function(v){const[j]=v;return{year:!!(2&j.date),month:!!(4&j.date),day:!!(8&j.date),hours:!!(16&j.date),minutes:!!(32&j.date),seconds:!!(64&j.date),clockType:j.clock===12?12:24}}(y),N.isPercent=()=>!!L.isPercent,N.isDate=()=>!!L.isDate,N.isText=()=>!!L.isText,N.pattern=_,E.error&&(N.error=E.error),N.options=M,N.locale=A||m&&m.locale||"",Object.freeze(N)}function ke(E,m){E||(E="General");let _=null;return ut[E]?_=ut[E]:(_=Object.assign({},D(),m).throws?te(E):function(y){try{return te(y)}catch(A){const M={tokens:[{type:"error"}],error:A.message};return{pattern:y,partitions:[M,M,M,M],error:A.message,locale:null}}}(E),_.error||(ut[E]=_)),Gt(_,m)}ke.isDate=E=>ke(E,{throws:!1}).isDate(),ke.isPercent=E=>ke(E,{throws:!1}).isPercent(),ke.isText=E=>ke(E,{throws:!1}).isText(),ke.getInfo=(E,m)=>ke(E,{...m,throws:!1}).info,ke.getDateInfo=(E,m)=>ke(E,{...m,throws:!1}).dateInfo,ke.dateToSerial=Fe,ke.dateFromSerial=Ye,ke.options=D,ke.dec2frac=C,ke.round=p,ke.codeToLocale=s,ke.parseLocale=l,ke.getLocale=h,ke.addLocale=(E,m)=>{const _=l(m);return delete ut[_.lang],delete ut[_.language],f(E,_)},ke.format=function(E,m,_){let y=arguments.length>3&&arguments[3]!==void 0&&arguments[3];const A=_&&typeof _=="object"?_:{locale:_,throws:!y};return ke(E,A)(Fe(m,A),A)},ke.is_date=ke.isDate,ke.parseNumber=bt,ke.parseDate=nt,ke.parseTime=Ge,ke.parseBool=mt,ke.parseValue=function(E,m){var _,y,A;return(_=(y=(A=bt(E))!==null&&A!==void 0?A:nt(E,m))!==null&&y!==void 0?y:Ge(E))!==null&&_!==void 0?_:mt(E)};var _t=ke;return r=r.default}()})})(cl);var M_=cl.exports,D_=M_;const L_=It(D_);function Zt(e){let n=0;const t=Object.keys(e);for(const r of t){const s=Number(r);n=Math.max(n,s)}return n+1}function Vs(e,n,t){const r=Zt(t),s=t;for(let i=r-1;i>=e;i--)s[i+1]=s[i];s[e]=n}function Gs(e,n,t){const r=Object.keys(t).reduce((s,i)=>Math.max(s,Number.parseInt(i)),0)+1;for(let s=e;s<r;s++)s<e+n?delete t[s]:t[s]!==void 0&&(t[s-n]=t[s],delete t[s])}function U_(e,n){const t=e,r=Object.keys(t),s=r.length,i=n,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]=t[u]}for(let h=0;h<a;h++,c++){const u=o[h];l[c]=i[u]}return l}function P_(e,n,t){const r=t;if(Zt(t)>0){const i={};let o=0;for(let a=e;a<=n;a++)r[a]&&(i[o]=r[a],o++);return i}return{}}function Ks(e,n,t,r){const s=e>t;if(!s&&e+n>t)throw new Error("Invalid move operation");s?k_(e,n,t,r):F_(e,n,t,r)}function k_(e,n,t,r){const s=r,i=[];for(let o=e;o<e+n;o++)i.push(s[o]);for(let o=e-1;o>=t;o--){const a=s[o];s[o+n]=a,a===void 0&&delete s[o+n]}i.forEach((o,a)=>{s[t+a]=o,o===void 0&&delete s[t+a]})}function F_(e,n,t,r){const s=r,i=[];for(let o=e;o<e+n;o++)i.push(s[o]);for(let o=e+n;o<t;o++){const a=s[o];s[o-n]=a,a===void 0&&delete s[o-n]}i.forEach((o,a)=>{s[t+a-n]=o,o===void 0&&delete s[t+a-n]})}class Pt{constructor(n={}){R(this,"_matrix");this._setOriginValue(n)}static MakeObjectMatrixSize(n){return new Pt({[n-1]:{}})}getMatrix(){return this._matrix}forEach(n){const t=this._matrix,r=Object.keys(t);for(const s of r){const i=Number(s),o=t[i];if(n(i,o)===!1)return this}return this}forRow(n){const t=this._matrix,r=Object.keys(t);for(const s of r){const i=Number(s),o=t[i];if(n(i,Object.keys(o).map(l=>Number(l)))===!1)return this}return this}forValue(n){const t=this._matrix;for(const r in t){const s=Number(r),i=t[s];if(i)for(const o in i){const a=Number(o),l=i[a];if(n(s,a,l)===!1)return this}}return this}swapRow(n,t){const r=this._matrix[n],s=this._matrix[t];this._matrix[n]=s,this._matrix[t]=r}getRow(n){return this._matrix[n]}getRowOrCreate(n){let t=this.getRow(n);return t==null&&(t={},this._matrix[n]=t),t}reset(){this._setOriginValue({})}hasValue(){const n=this._matrix,t=Object.keys(n);if(t.length===0)return!1;for(const r of t){const s=Number(r),i=n[s];if(Object.keys(i).length>0)return!0}return!1}getValue(n,t){var r,s;return(s=(r=this._matrix)==null?void 0:r[n])==null?void 0:s[t]}setValue(n,t,r){const s=this.getRowOrCreate(n);s[t]=r}deleteValue(n,t){var r,s;(s=(r=this._matrix)==null?void 0:r[n])==null||delete s[t]}realDeleteValue(n,t){var r,s,i;if((s=(r=this._matrix)==null?void 0:r[n])==null||delete s[t],this.getRow(n)){const o=this.getRow(n);if(o==null)return;Object.keys(o).length===0&&((i=this._matrix)==null||delete i[n])}}setRow(n,t){this._matrix[n]=t}moveRows(n,t,r){Ks(n,t,r,this._matrix)}moveColumns(n,t,r){this.forEach((s,i)=>{Ks(n,t,r,i)})}insertRows(n,t){for(let r=n;r<n+t;r++)Vs(r,{},this._matrix)}insertColumns(n,t){for(let r=n;r<n+t;r++)this.forEach((s,i)=>{i&&Vs(r,void 0,i)})}removeRows(n,t){Gs(n,t,this._matrix)}removeColumns(n,t){this.forEach((r,s)=>{s&&Gs(n,t,s)})}getFragment(n,t,r,s){const i=new Pt;let o=0;for(let a=n;a<=t;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(n,t,r,s){const i=new Pt;for(let o=n;o<=t;o++)for(let a=r;a<=s;a++){const l=this.getValue(o,a);l&&i.setValue(o,a,K.deepClone(l))}return i}getSizeOf(){return Object.keys(this._matrix).length}getLength(){return Zt(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=Zt(a)-1;s=l>s?l:s}}return{startRow:0,startColumn:0,endRow:r,endColumn:s}}toNativeArray(){const n=new Array;return this.forValue((t,r,s)=>{n.push(s)}),n}toArray(){const n=[];return this.forRow((t,r)=>{n[t]==null&&(n[t]=[]),r.forEach(s=>{n[t][s]=this.getValue(t,s)})}),n}toFullArray(){const n=this.getRange(),{endColumn:t,endRow:r}=n,s=[];for(let i=0;i<=r;i++){const o=new Array(t+1).fill(void 0);s.push(o)}return this.forValue((i,o,a)=>{s[i][o]=a}),s}toJSON(){return this._matrix}clone(){const n=JSON.stringify(this._matrix);return JSON.parse(n)}getData(){const n=JSON.stringify(this._matrix);return JSON.parse(n)}getArrayData(){let n=0,t=0,r=!1,s=!1;const i=new Pt;return this.forEach((o,a)=>{r||(r=!0,n=o),Object.keys(a).forEach(l=>{const c=Number(l);s?c<t&&(t=c):(s=!0,t=c);const h=this.getValue(o,c);i.setValue(o-n,c-t,h)})}),i.getData()}getStartEndScope(){let n=1/0,t=-1/0,r=1/0,s=-1/0;const i=Object.keys(this._matrix);i.length>0&&(n=+i[0],t=+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:n,endRow:t,startColumn:r,endColumn:s}}getDataRange(){let n=0,t=0,r=0,s=-1,i=!1,o=!1;return this.forEach((a,l)=>{if(i||(i=!0,n=a),l==null)return;const c=Zt(l)-1;c>r&&(r=c),Object.keys(l).forEach(h=>{const u=Number(h);o?u<t&&(t=u):(o=!0,t=u)}),a>s&&(s=a)}),{startRow:n,startColumn:t,endRow:s,endColumn:r}}getDiscreteRanges(){const n=[];return this.forEach((t,r)=>{Object.keys(r).forEach(s=>{const i=Number(s);let o=!1;for(const a of n)if(t>=a.startRow&&t<=a.endRow+1&&i>=a.startColumn&&i<=a.endColumn+1){a.endRow=Math.max(t,a.endRow),a.endColumn=Math.max(i,a.endColumn),o=!0;break}o||n.push({startRow:t,endRow:t,startColumn:i,endColumn:i})})}),n}merge(n){this.forValue((t,r)=>{const s=n.getValue(t,r);s!=null&&this.setValue(t,r,s)})}_setOriginValue(n={}){this._matrix=n}}const $_={sheetId:"",range:{startRow:-1,endRow:-1,startColumn:-1,endColumn:-1}},x_={startRow:-1,startColumn:-1,endRow:-1,endColumn:-1},H_={startRow:0,startColumn:0,endRow:0,endColumn:0},B_={row:0,column:0},ct={ff:"Arial",fs:11,it:Te.FALSE,bl:Te.FALSE,ul:{s:Te.FALSE},st:{s:Te.FALSE},ol:{s:Te.FALSE},tr:{a:0,v:Te.FALSE},td:Jn.UNSPECIFIED,cl:{rgb:"#000"},bg:{rgb:"#fff"},ht:Xt.UNSPECIFIED,vt:ln.UNSPECIFIED,tb:un.UNSPECIFIED,pd:{t:0,r:0,b:0,l:0},n:null},hl={id:"default_slide",title:"defaultSlide",pageSize:{width:300,height:300}},j_=[Cs,wo,vs];var dl=(e=>(e.ARRAY_CONVERTOR="ARRAY_CONVERTOR",e.MATRIX_CONVERTOR="MATRIX_CONVERTOR",e))(dl||{});function jr(e,n){const{textRuns:t=[]}=n;let r=0;for(const i of t){const{ts:o={},st:a,ed:l}=i;if(o[e]==null)return Te.FALSE;switch(e){case"bl":case"it":{if(o[e]===Te.FALSE)return Te.FALSE;break}case"ul":case"st":{if(o[e].s===Te.FALSE)return Te.FALSE;break}default:throw new Error(`unknown style key: ${e} in IStyleBase`)}r+=l-a}return n.dataStream.indexOf(`\r
7
+ `)===r?Te.TRUE:Te.FALSE}const pr=class pr{constructor(n,t,r){R(this,"_range");R(this,"_worksheet");this._deps=r,this._range=t,this._worksheet=n}static foreach(n,t){const{startRow:r,startColumn:s,endRow:i,endColumn:o}=n;for(let a=r;a<=i;a++)for(let l=s;l<=o;l++)t(a,l)}getRangeData(){return this._range}getValue(){return this.getValues()[0][0]}getValues(){const{startRow:n,endRow:t,startColumn:r,endColumn:s}=this._range,i=[];for(let o=n;o<=t;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:n,endRow:t,startColumn:r,endColumn:s}=this._range,i=this._worksheet.getCellMatrix(),o=new Pt;for(let a=n;a<=t;a++)for(let l=r;l<=s;l++)o.setValue(a,l,i.getValue(a,l)||null);return o}getMatrixObject(){const{startRow:n,endRow:t,startColumn:r,endColumn:s}=this._range,i=this._worksheet.getCellMatrix(),o=new Pt;for(let a=n;a<=t;a++)for(let l=r;l<=s;l++)o.setValue(a-n,l-r,i.getValue(a,l)||{});return o}getA1Notation(){const{startRow:n,endRow:t,startColumn:r,endColumn:s}=this._range;let i,o;return r<s?(i=K.numToWord(r+1)+(n+1),o=K.numToWord(s+1)+(t+1)):(i=K.numToWord(s+1)+(t+1),o=K.numToWord(r+1)+(n+1)),i===o?`${i}`:`${i}:${o}`}getBackground(){return this.getBackgrounds()[0][0]}getBackgrounds(){const n=this._deps.getStyles();return this.getValues().map(t=>t.map(r=>{var i;const s=n.getStyleByCell(r);return((i=s==null?void 0:s.bg)==null?void 0:i.rgb)||ct.bg.rgb}))}getCell(n,t){const{startRow:r,startColumn:s}=this._range,i={startRow:r+n,endRow:r+n,startColumn:s+t,endColumn:s+t};return new pr(this._worksheet,i,this._deps)}getColumn(){return this._range.startColumn}getObjectValue(n={}){return this.getObjectValues(n)[0][0]}getObjectValues(n={}){var a;const{startRow:t,endRow:r,startColumn:s,endColumn:i}=this._range,o=this._worksheet.getCellMatrix().getFragment(t,r,s,i).getData();if(n.isIncludeStyle){const l=this._deps.getStyles();for(let c=0;c<=r-t;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 n=this._deps.getStyles();return this.getValues().map(t=>t.map(r=>{var i;const s=n.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 t,r;const{p:n}=(t=this.getValue())!=null?t:{};return n&&Array.isArray((r=n.body)==null?void 0:r.textRuns)&&n.body.textRuns.length>0?jr("ul",n.body)===Te.TRUE?{s:Te.TRUE}:{s:Te.FALSE}:this.getUnderlines()[0][0]}getOverlines(){return this._getStyles("ol")}getOverline(){return this.getOverlines()[0][0]}getStrikeThrough(){var t,r;const{p:n}=(t=this.getValue())!=null?t:{};return n&&Array.isArray((r=n.body)==null?void 0:r.textRuns)&&n.body.textRuns.length>0?jr("st",n.body)===Te.TRUE?{s:Te.TRUE}:{s:Te.FALSE}:this.getStrikeThroughs()[0][0]}getStrikeThroughs(){return this._getStyles("st")}getFontSize(){var t,r;const n=((t=this.getValue())==null?void 0:t.p)||{};return n&&Array.isArray((r=n.body)==null?void 0:r.textRuns)&&n.body.textRuns.length>0?n.body.textRuns.some(s=>{var i;return((i=s==null?void 0:s.ts)==null?void 0:i.fs)!=null})?Math.max(...n.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 t,r;const{p:n}=(t=this.getValue())!=null?t:{};return n&&Array.isArray((r=n.body)==null?void 0:r.textRuns)&&n.body.textRuns.length>0?jr("it",n.body)===Te.TRUE?Mr.ITALIC:Mr.NORMAL:this._getFontStyles()[0][0]}_getFontStyles(){return this._getStyles("it")}getFontWeight(){var t,r;const{p:n}=(t=this.getValue())!=null?t:{};return n&&Array.isArray((r=n.body)==null?void 0:r.textRuns)&&n.body.textRuns.length>0?jr("bl",n.body)===Te.TRUE?Dr.BOLD:Dr.NORMAL:this._getFontWeights()[0][0]}_getFontWeights(){return this._getStyles("bl")}getGridId(){return this._worksheet.getSheetId()}getHeight(){const{_range:n,_worksheet:t}=this,{startRow:r,endRow:s}=n;let i=0;for(let o=0;o<=s-r;o++){const a=t.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:n,endColumn:t}=this._range;return t-n+1}getNumRows(){const{startRow:n,endRow:t}=this._range;return t-n+1}getRichTextValue(){return this.getRichTextValues()[0][0]}getRichTextValues(){return this.getValues().map(n=>n.map(t=>(t==null?void 0:t.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 n=this._deps.getStyles();return this.getValues().map(t=>t.map(r=>n.getStyleByCell(r)))}getVerticalAlignment(){return this.getVerticalAlignments()[0][0]}getVerticalAlignments(){return this._getStyles("vt")}getWidth(){const{_range:n,_worksheet:t}=this,{startColumn:r,endColumn:s}=n;let i=0;for(let o=0;o<=s-r;o++)i+=t.getColumnWidth(o);return i}getWrap(){return this.getWrapStrategy()===un.WRAP?Te.TRUE:Te.FALSE}getWrapStrategies(){return this._getStyles("tb")}getWrapStrategy(){return this.getWrapStrategies()[0][0]}forEach(n){pr.foreach(this._range,n)}_getStyles(n){const t=this._deps.getStyles();return this.getValues().map(r=>r.map(s=>{const i=t&&t.getStyleByCell(s);return i&&i[n]||ct[n]}))}};R(pr,"transformRange",(n,t)=>{const r=t.getMaxColumns()-1,s=t.getMaxRows()-1;return n.rangeType===we.ALL?{startColumn:0,startRow:0,endColumn:r,endRow:s}:n.rangeType===we.COLUMN?{startRow:0,endRow:s,startColumn:n.startColumn,endColumn:n.endColumn}:n.rangeType===we.ROW?{startColumn:0,endColumn:r,startRow:n.startRow,endRow:n.endRow}:{startColumn:n.startColumn,endColumn:Math.min(n.endColumn,r),startRow:n.startRow,endRow:Math.min(n.endRow,s)}});let yn=pr;function W_(e,n,t,r=!1){if(n===0&&t===0)return e;let s={...e};const i=s.startAbsoluteRefType||tt.NONE,o=s.endAbsoluteRefType||tt.NONE,a=s.rangeType||we.NORMAL;if(!r&&i===tt.ALL&&o===tt.ALL)return s;const l=fl(s.startRow,t,s.startColumn,n,a),c=fl(s.endRow,t,s.endColumn,n,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 fl(e,n,t,r,s){return s===we.NORMAL?{row:e+n,column:t+r}:s===we.ROW?{row:e+n,column:t}:s===we.COLUMN?{row:e,column:t+r}:{row:e,column:t}}function Xs(e){const n=new Set,t=new Set;for(const o of e)n.add(o.startColumn),n.add(o.endColumn+1),t.add(o.startRow),t.add(o.endRow+1);const r=Array.from(n).sort((o,a)=>o-a),s=Array.from(t).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 f of e){if(f.startRow>u)break;if(f.startRow<=h&&f.endRow>=u&&f.startColumn<=l&&f.endColumn>=c){i.push({startColumn:l,endColumn:c,startRow:h,endRow:u});break}}}return i}function Y_(e){e.sort((r,s)=>r.startRow-s.startRow||r.startColumn-s.startColumn);const n={};for(const r of e)n[r.startRow]||(n[r.startRow]=[]),n[r.startRow].push(r);const t=[];for(const r in n){const s=n[+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):(t.push(i),i=a)}t.push(i)}return t}function z_(e){e.sort((r,s)=>r.startColumn-s.startColumn||r.startRow-s.startRow);const n={};for(const r of e)n[r.startColumn]||(n[r.startColumn]=[]),n[r.startColumn].push(r);const t=[];for(const r in n){const s=n[+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):(t.push(i),i=a)}t.push(i)}return t}function V_(e){const n=Xs(e),t=Y_(n);return z_(t)}function G_(e,n){const t=[];return e.forEach(r=>{t.push(...qt.subtract(r,n))}),qt.mergeRanges(t)}function K_(e,n){const t=gl(e.startRow,e.endRow,n.startRow,n.endRow),r=gl(e.startColumn,e.endColumn,n.startColumn,n.endColumn);if(!t||!r)return null;const[s,i]=t,[o,a]=r,l=X_(e.rangeType,n.rangeType,s,i,o,a);return{startRow:s,endRow:i,startColumn:o,endColumn:a,rangeType:l}}function gl(e,n,t,r){const s=isNaN(e)?-1/0:e,i=isNaN(n)?1/0:n,o=isNaN(t)?-1/0:t,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 X_(e,n,t,r,s,i){const o=e!==void 0?e:ml(t,r,s,i),a=n!==void 0?n:ml(t,r,s,i);return o===we.ALL||a===we.ALL?o===a?o:o===we.ALL?a:o:o===a?o:(o===we.NORMAL||a===we.NORMAL,we.NORMAL)}function ml(e,n,t,r){const s=!isNaN(e)&&!isNaN(n),i=!isNaN(t)&&!isNaN(r);return s&&i?we.NORMAL:s?we.ROW:i?we.COLUMN:we.ALL}const Vt=class Vt{static clone(n){return n.rangeType!==void 0?{startRow:n.startRow,startColumn:n.startColumn,endRow:n.endRow,endColumn:n.endColumn,rangeType:n.rangeType}:{startRow:n.startRow,startColumn:n.startColumn,endRow:n.endRow,endColumn:n.endColumn}}static equals(n,t){return n==null||t==null?!1:n.endRow===t.endRow&&n.endColumn===t.endColumn&&n.startRow===t.startRow&&n.startColumn===t.startColumn&&(n.rangeType===t.rangeType||n.rangeType===void 0&&t.rangeType===we.NORMAL||t.rangeType===void 0&&n.rangeType===we.NORMAL)}static simpleRangesIntersect(n,t){const{startRow:r,endRow:s,startColumn:i,endColumn:o}=n,{startRow:a,endRow:l,startColumn:c,endColumn:h}=t,u=r<=l&&s>=a,f=i<=h&&o>=c;return u&&f}static intersects(n,t){if(n.rangeType===we.ROW&&t.rangeType===we.COLUMN||n.rangeType===we.COLUMN&&t.rangeType===we.ROW)return!0;if(n.rangeType===we.ROW&&t.rangeType===we.ROW)return n.startRow<=t.endRow&&n.endRow>=t.startRow;if(n.rangeType===we.COLUMN&&t.rangeType===we.COLUMN)return n.startColumn<=t.endColumn&&n.endColumn>=t.startColumn;const r=Math.floor(Number.MAX_SAFE_INTEGER/10),s=Number.isNaN(n.startRow)?0:n.startRow,i=Number.isNaN(n.endRow)?r:n.endRow,o=Number.isNaN(n.startColumn)?0:n.startColumn,a=Number.isNaN(n.endColumn)?r:n.endColumn,l=Number.isNaN(t.startRow)?0:t.startRow,c=Number.isNaN(t.endRow)?r:t.endRow,h=Number.isNaN(t.startColumn)?0:t.startColumn,u=Number.isNaN(t.endColumn)?r:t.endColumn,f=Math.abs(o+a-h-u),g=Math.abs(o-a)+Math.abs(h-u),p=Math.abs(s+i-l-c),C=Math.abs(s-i)+Math.abs(l-c);return f<=g&&p<=C}static getIntersects(n,t){const r=n.startRow,s=n.endRow,i=n.startColumn,o=n.endColumn,a=t.startRow,l=t.endRow,c=t.startColumn,h=t.endColumn;let u,f,g,p;if(a<=s)a>=r?f=a:f=r;else return null;if(l>=r)l>=s?p=s:p=l;else return null;if(c<=o)c>i?u=c:u=i;else return null;if(h>=i)h>=o?g=o:g=h;else return null;return{startRow:f,endRow:p,startColumn:u,endColumn:g,rangeType:we.NORMAL}}static contains(n,t){return n.startRow<=t.startRow&&n.endRow>=t.endRow&&n.startColumn<=t.startColumn&&n.endColumn>=t.endColumn}static realContain(n,t){return Vt.contains(n,t)&&(n.startRow<t.startRow||n.endRow>t.endRow||n.startColumn<t.startColumn||n.endColumn>t.endColumn)}static union(...n){return n.reduce((t,r)=>({startRow:Math.min(t.startRow,r.startRow),startColumn:Math.min(t.startColumn,r.startColumn),endRow:Math.max(t.endRow,r.endRow),endColumn:Math.max(t.endColumn,r.endColumn),rangeType:we.NORMAL}),n[0])}static realUnion(...n){const t=n.some(i=>i.rangeType===we.COLUMN),r=n.some(i=>i.rangeType===we.ROW),s=Vt.union(...n);return{startColumn:r?Number.NaN:s.startColumn,endColumn:r?Number.NaN:s.endColumn,startRow:t?Number.NaN:s.startRow,endRow:t?Number.NaN:s.endRow,rangeType:r?we.ROW:t?we.COLUMN:we.NORMAL}}static subtract(n,t){if(t.startRow>n.endRow||t.endRow<n.startRow||t.startColumn>n.endColumn||t.endColumn<n.startColumn)return[n];const r=[];t.startRow>=n.startRow&&r.push({startRow:n.startRow,startColumn:n.startColumn,endRow:t.startRow-1,endColumn:n.endColumn}),t.endRow<=n.endRow&&r.push({startRow:t.endRow+1,startColumn:n.startColumn,endRow:n.endRow,endColumn:n.endColumn});const s=Math.max(n.startRow,t.startRow),i=Math.min(n.endRow,t.endRow);return t.startColumn>=n.startColumn&&r.push({startRow:s,startColumn:n.startColumn,endRow:i,endColumn:t.startColumn-1}),t.endColumn<=n.endColumn&&r.push({startRow:s,startColumn:t.endColumn+1,endRow:i,endColumn:n.endColumn}),r.filter(a=>a.startRow<=a.endRow&&a.startColumn<=a.endColumn)}static mergeRanges(n){return V_(n)}static splitIntoGrid(n){return Xs(n)}static subtractMulti(n,t){if(!t.length)return n;let r=n;return t.forEach(s=>{r=G_(r,s)}),r}static hasIntersectionBetweenTwoRect(n,t){return!(n.left>t.right||n.right<t.left||n.top>t.bottom||n.bottom<t.top)}static getIntersectionBetweenTwoRect(n,t){const r=Math.max(n.left,t.left),s=Math.min(n.right,t.right),i=Math.max(n.top,t.top),o=Math.min(n.bottom,t.bottom);return s<=r||o<=i?null:{left:r,right:s,top:i,bottom:o,width:s-r,height:o-i}}static sort(n){return n.sort((t,r)=>t.startRow-r.startRow||t.startColumn-r.startColumn)}};R(Vt,"getRelativeRange",(n,t)=>({startRow:n.startRow-t.startRow,endRow:n.endRow-n.startRow,startColumn:n.startColumn-t.startColumn,endColumn:n.endColumn-n.startColumn})),R(Vt,"getPositionRange",(n,t,r)=>({...r||{},startRow:r&&[tt.ROW,tt.ALL].includes(r.startAbsoluteRefType||0)?r.startRow:n.startRow+t.startRow,endRow:r&&[tt.ROW,tt.ALL].includes(r.endAbsoluteRefType||0)?r.endRow:n.endRow+n.startRow+t.startRow,startColumn:r&&[tt.COLUMN,tt.ALL].includes(r.startAbsoluteRefType||0)?r.startColumn:n.startColumn+t.startColumn,endColumn:r&&[tt.COLUMN,tt.ALL].includes(r.endAbsoluteRefType||0)?r.endColumn:n.endColumn+n.startColumn+t.startColumn})),R(Vt,"moveHorizontal",(n,t=0,r=0)=>({...n,startColumn:n.startColumn+t,endColumn:n.endColumn+t+r})),R(Vt,"moveVertical",(n,t=0,r=0)=>({...n,startRow:n.startRow+t,endRow:n.endRow+t+r})),R(Vt,"moveOffset",(n,t,r)=>({...n,startRow:n.startRow+r,endRow:n.endRow+r,startColumn:n.startColumn+t,endColumn:n.endColumn+t}));let qt=Vt;function Q_(e,n){if(e.length===0||e[0].length===0)return null;const t=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++)t[a]=n(e[i][a])?t[a]+1:0;const o=J_(t);o.area>r&&(r=o.area,s={startColumn:o.start,startRow:i-o.height+1,endColumn:o.end,endRow:i})}return s}function J_(e){const n=[];let t=0,r={area:0,height:0,start:0,end:0},s=0;for(;s<e.length;)if(n.length===0||e[s]>=e[n[n.length-1]])n.push(s++);else{const i=e[n.pop()],o=n.length===0?s:s-n[n.length-1]-1;i*o>t&&(t=i*o,r={area:t,height:i,start:n.length===0?0:n[n.length-1]+1,end:s-1})}for(;n.length>0;){const i=e[n.pop()],o=n.length===0?s:s-n[n.length-1]-1;i*o>t&&(t=i*o,r={area:t,height:i,start:n.length===0?0:n[n.length-1]+1,end:s-1})}return r}function Z_(e,n){yn.foreach(n,(t,r)=>{e[t][r]=void 0})}function q_(e,n){const t=e.toFullArray(),r=[];for(;;){const s=Q_(t,n);if(!s)break;r.push(s),Z_(t,s)}return r}class ep{constructor(n,t){R(this,"_values",[]);R(this,"_keys",[]);R(this,"_keyMaps",new Map);this._values=n,this._keys=t,n.forEach(r=>{this._initKeyMap(r)})}_initKeyMap(n){this._keys.forEach(t=>{const r=n[t],s=this._keyMaps.get(t)||new Map;s.set(r,n),this._keyMaps.set(t,s)})}getValue(n,t){const r=t||this._keys;for(let s=0;s<r.length;s++){const i=this._keyMaps.get(r[s]);if(i!=null&&i.has(n))return i.get(n)}return null}hasValue(n){for(let t=0;t<this._keys.length;t++){const r=this._keyMaps.get(this._keys[t]);if(r!=null&&r.has(n))return!0}return!1}addValue(n){this._values.push(n),this._initKeyMap(n)}setValue(n,t,r){const s=this.getValue(n);s&&Object.keys(s).includes(t)&&(s[t]=r)}deleteValue(n,t){const r=this.getValue(n,t);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(n){var t;return[...((t=this._keyMaps.get(n))==null?void 0:t.keys())||[]]}clear(){this._values=[],this._keys=[],this._keyMaps.clear()}}function Qs(e,n,t,r){return{forEach(s){for(let i=e;i<=n;i++)for(let o=t;o<=r;o++)s(i,o)}}}function tp(e){if(e==null||e.length===0)return Number.NaN;const n=e.toLowerCase().split(""),t=n.length,r=o=>o.charCodeAt(0)-96;let s=0,i=0;for(let o=0;o<t;o++)i=r(n[o]),s+=i*26**(t-o-1);return s===0?Number.NaN:s-1}const Wr=65,_l=90,np=97;function rp(e){const n=_l-Wr+1;let t="";for(;e>=0;)t=String.fromCharCode(e%n+Wr)+t,e=Math.floor(e/n)-1;return t}function pl(e,n){let t="";for(;n>0;)t+=e,n--;return t}function sp(e,n=!1){const t=_l-Wr+1;let r=np;n&&(r=Wr);const s=String.fromCharCode(e%t+r),i=Math.floor(e/t)+1;return pl(s,i)}function ip(e,n){return e.zIndex>n.zIndex?1:e.zIndex===n.zIndex?0:-1}function op(e,n){return e.zIndex>n.zIndex?-1:e.zIndex===n.zIndex?0:1}function qn(e="index",n=1){return(t,r)=>t[e]>r[e]?n:t[e]===r[e]?0:-n}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||{}),kt=(e=>(e[e.Reader=0]="Reader",e[e.Editor=1]="Editor",e[e.Owner=2]="Owner",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(kt||{}),Js=(e=>(e[e.SomeCollaborator=0]="SomeCollaborator",e[e.AllCollaborator=1]="AllCollaborator",e[e.OneSelf=2]="OneSelf",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(Js||{});class Yr extends rt{}function ap(e=K.generateRandomId(6),n=Qn.EN_US,t=""){return{id:e,locale:n,title:t,body:{dataStream:`\r
8
+ `,textRuns:[],paragraphs:[{startIndex:0,paragraphStyle:{spaceAbove:{v:5},lineSpacing:1,spaceBelow:{v:0}}}],sectionBreaks:[{startIndex:1}]},documentStyle:{pageSize:{width:793.3333333333334,height:1122.6666666666667},marginTop:50,marginBottom:50,marginRight:40,marginLeft:40,renderConfig:{vertexAngle:0,centerAngle:0}},settings:{}}}var gt={},El={},Zs={};Object.defineProperty(Zs,"__esModule",{value:!0});function lp(e,n){if(Array.isArray(n))return!1;for(let t in e)if(!qs(e[t],n[t]))return!1;for(let t in n)if(e[t]===void 0)return!1;return!0}function up(e,n){if(!Array.isArray(n)||e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(!qs(e[t],n[t]))return!1;return!0}function qs(e,n){return e===n?!0:e===null||n===null||typeof e!="object"||typeof n!="object"?!1:Array.isArray(e)?up(e,n):lp(e,n)}Zs.default=qs;var ei={};Object.defineProperty(ei,"__esModule",{value:!0});function ti(e){if(e===null)return null;if(Array.isArray(e))return e.map(ti);if(typeof e=="object"){const n={};for(let t in e)n[t]=ti(e[t]);return n}else return e}ei.default=ti;var ni={};(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 n(h,u){if(!h)throw new Error(u)}const t=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 f in h){const g=f;u.write(g,h[g])}}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(){n(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):(n(this.idx>0),this.idx--,t(this.container[this.idx])&&this.idx--)}getPath(){const u=[];let f=this.container,g=this.parents.length-1,p=this.idx;for(;p>=0;)u.unshift(f[p]),p===0?(p=this.indexes[g*2],f=this.parents[g--]):p-=t(f[p-1])?2:1;return u}}class o extends i{get(){return this.container?this.container.slice(this.idx+1):null}getKey(){return n(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&&t(u=this.container[this.idx+1])?u:null}descendFirst(){let u=this.idx+1;if(!this.container||u>=this.container.length||t(this.container[u])&&u+1>=this.container.length)return!1;t(this.container[u])&&u++;const f=this.container[u];return Array.isArray(f)?(this.indexes.push(this.idx),this.parents.push(this.container),this.indexes.push(u),this.idx=0,this.container=f):this.idx=u,!0}nextSibling(){if(n(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,f=this.parents[this.parents.length-1];return u>=f.length?!1:(n(!isNaN(u)),this.indexes[this.indexes.length-1]=u,this.container=f[u],!0)}_init(u,f,g,p){this.container=u,this.idx=f,this.parents=g.slice(),this.indexes=p.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,f){const g=this.getComponent();g&&f(g,u);for(const p of this)u&&u.descend(p),this.traverse(u,f),u&&u.ascend()}eachPick(u,f){this.traverse(u,(g,p)=>{g.p!=null&&f(g.p,p)})}eachDrop(u,f){this.traverse(u,(g,p)=>{g.d!=null&&f(g.d,p)})}}e.ReadCursor=o;class a extends i{constructor(u=null){super(u),this.pendingDescent=[],this._op=u}flushDescent(){n(this.parents.length===this.indexes.length/2),this.container===null&&(this._op=this.container=[]);for(let u=0;u<this.pendingDescent.length;u++){const f=this.pendingDescent[u];let g=this.idx+1;if(g<this.container.length&&t(this.container[g])&&g++,n(g===this.container.length||!t(this.container[g])),g===this.container.length)this.container.push(f),this.idx=g;else if(this.container[g]===f)this.idx=g;else{if(!Array.isArray(this.container[g])){const p=this.container.splice(g,this.container.length-g);this.container.push(p),this.lcIdx>-1&&(this.lcIdx=g)}for(this.indexes.push(this.idx),this.parents.push(this.container),this.lcIdx!==-1&&(n(r(f,this.container[this.lcIdx][0])),g=this.lcIdx+1,this.lcIdx=-1);g<this.container.length&&r(f,this.container[g][0]);)g++;if(this.indexes.push(g),this.idx=0,g<this.container.length&&this.container[g][0]===f)this.container=this.container[g];else{const p=[f];this.container.splice(g,0,p),this.container=p}}}this.pendingDescent.length=0}reset(){this.lcIdx=-1}getComponent(){this.flushDescent();const u=this.idx+1;if(u<this.container.length&&t(this.container[u]))return this.container[u];{const f={};return this.container.splice(u,0,f),f}}write(u,f){const g=this.getComponent();n(g[u]==null||g[u]===f,"Internal consistency error: Overwritten component. File a bug"),g[u]=f}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,f=s){if(u===null)return;if(n(Array.isArray(u)),u===this._op)throw Error("Cannot merge into my own tree");const g=this.lcIdx,p=this.parents.length;let C=0;for(let I=0;I<u.length;I++){const S=u[I];typeof S=="string"||typeof S=="number"?(C++,this.descend(S)):Array.isArray(S)?this.mergeTree(S,f):typeof S=="object"&&f(S,this)}for(;C--;)this.ascend();this.lcIdx=this.parents.length===p?g:-1}at(u,f){this.descendPath(u),f(this);for(let g=0;g<u.length;g++)this.ascend();return this}writeAtPath(u,f,g){return this.at(u,()=>this.write(f,g)),this.reset(),this}writeMove(u,f,g=0){return this.writeAtPath(u,"p",g).writeAtPath(f,"d",g)}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,f){let g,p;p=g=h?h.descendFirst():!1;function C(I){let S;for(;p;){const D=S=h.getKey();if(I!=null){let U=!1;if(u&&typeof D=="number"&&(S=u(D,h.getComponent()),S<0&&(S=~S,U=!0)),r(S,I))return null;if(S===I&&!U)return h}f&&typeof S=="number"&&f(S,h.getComponent()),p=h.nextSibling()}return null}return C.end=()=>{g&&h.ascend()},C}e.advancer=l;function c(h,u,f){let g,p,C,I;for(g=p=h&&h.descendFirst(),C=I=u&&u.descendFirst();g||C;){let S=g?h.getKey():null,D=C?u.getKey():null;S!==null&&D!==null&&(r(D,S)?D=null:S!==D&&(S=null)),f(S==null?D:S,S!=null?h:null,D!=null?u:null),S!=null&&g&&(g=h.nextSibling()),D!=null&&C&&(C=u.nextSibling())}p&&h.ascend(),I&&u.ascend()}e.eachChildOf=c})(ni);var ri={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConflictType=void 0,function(n){n[n.RM_UNEXPECTED_CONTENT=1]="RM_UNEXPECTED_CONTENT",n[n.DROP_COLLISION=2]="DROP_COLLISION",n[n.BLACKHOLE=3]="BLACKHOLE"}(e.ConflictType||(e.ConflictType={}))})(ri);var si={},dn={},Cl;function ii(){return Cl||(Cl=1,Object.defineProperty(dn,"__esModule",{value:!0}),dn.uniToStrPos=dn.strPosToUni=void 0,dn.strPosToUni=(e,n=e.length)=>{let t=0,r=0;for(;r<n;r++){const s=e.charCodeAt(r);s>=55296&&s<=57343&&(t++,r++)}if(r!==n)throw Error("Invalid offset - splits unicode bytes");return r-t},dn.uniToStrPos=(e,n)=>{let t=0;for(;n>0;n--){const r=e.charCodeAt(t);t+=r>=55296&&r<=57343?2:1}return t}),dn}var oi={},vl;function ai(){return vl||(vl=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.uniSlice=e.dlen=e.eachOp=void 0;const n=ii(),t=w=>{if(!Array.isArray(w))throw Error("Op must be an array of components");let b=null;for(let P=0;P<w.length;P++){const W=w[P];switch(typeof W){case"object":if(typeof W.d!="number"&&typeof W.d!="string")throw Error("Delete must be number or string");if(e.dlen(W.d)<=0)throw Error("Deletes must not be empty");break;case"string":if(!(W.length>0))throw Error("Inserts cannot be empty");break;case"number":if(!(W>0))throw Error("Skip components must be >0");if(typeof b=="number")throw Error("Adjacent skip components should be combined");break}b=W}if(typeof b=="number")throw Error("Op has a trailing skip")};function r(w,b){let P=0,W=0;for(let he=0;he<w.length;he++){const ee=w[he];switch(b(ee,P,W),typeof ee){case"object":P+=e.dlen(ee.d);break;case"string":W+=n.strPosToUni(ee);break;case"number":P+=ee,W+=ee;break}}}e.eachOp=r;function s(w,b){const P=[],W=a(P);return r(w,(he,ee,ae)=>{W(b(he,ee,ae))}),u(P)}const i=w=>w,o=w=>s(w,i);e.dlen=w=>typeof w=="number"?w:n.strPosToUni(w);const a=w=>b=>{if(!(!b||b.d===0||b.d===""))if(w.length===0)w.push(b);else if(typeof b==typeof w[w.length-1])if(typeof b=="object"){const P=w[w.length-1];P.d=typeof P.d=="string"&&typeof b.d=="string"?P.d+b.d:e.dlen(P.d)+e.dlen(b.d)}else w[w.length-1]+=b;else w.push(b)},l=w=>typeof w=="number"?w:typeof w=="string"?n.strPosToUni(w):typeof w.d=="number"?w.d:n.strPosToUni(w.d);e.uniSlice=(w,b,P)=>{const W=n.uniToStrPos(w,b),he=P==null?1/0:n.uniToStrPos(w,P);return w.slice(W,he)};const c=(w,b,P)=>typeof w=="number"?P==null?w-b:Math.min(w,P)-b:e.uniSlice(w,b,P),h=w=>{let b=0,P=0;return{take:(ee,ae)=>{if(b===w.length)return ee===-1?null:ee;const Ae=w[b];let Ne;if(typeof Ae=="number")return ee===-1||Ae-P<=ee?(Ne=Ae-P,++b,P=0,Ne):(P+=ee,ee);if(typeof Ae=="string"){if(ee===-1||ae==="i"||n.strPosToUni(Ae.slice(P))<=ee)return Ne=Ae.slice(P),++b,P=0,Ne;{const te=P+n.uniToStrPos(Ae.slice(P),ee);return Ne=Ae.slice(P,te),P=te,Ne}}else{if(ee===-1||ae==="d"||e.dlen(Ae.d)-P<=ee)return Ne={d:c(Ae.d,P)},++b,P=0,Ne;{let te=c(Ae.d,P,P+ee);return P+=ee,{d:te}}}},peek:()=>w[b]}},u=w=>(w.length>0&&typeof w[w.length-1]=="number"&&w.pop(),w);function f(w,b,P){if(P!=="left"&&P!=="right")throw Error("side ("+P+") must be 'left' or 'right'");t(w),t(b);const W=[],he=a(W),{take:ee,peek:ae}=h(w);for(let Ne=0;Ne<b.length;Ne++){const te=b[Ne];let $,V;switch(typeof te){case"number":for($=te;$>0;)V=ee($,"i"),he(V),typeof V!="string"&&($-=l(V));break;case"string":P==="left"&&typeof ae()=="string"&&he(ee(-1)),he(n.strPosToUni(te));break;case"object":for($=e.dlen(te.d);$>0;)switch(V=ee($,"i"),typeof V){case"number":$-=V;break;case"string":he(V);break;case"object":$-=e.dlen(V.d)}break}}let Ae;for(;Ae=ee(-1);)he(Ae);return u(W)}function g(w,b){t(w),t(b);const P=[],W=a(P),{take:he}=h(w);for(let ae=0;ae<b.length;ae++){const Ae=b[ae];let Ne,te;switch(typeof Ae){case"number":for(Ne=Ae;Ne>0;)te=he(Ne,"d"),W(te),typeof te!="object"&&(Ne-=l(te));break;case"string":W(Ae);break;case"object":Ne=e.dlen(Ae.d);let $=0;for(;$<Ne;)switch(te=he(Ne-$,"d"),typeof te){case"number":W({d:c(Ae.d,$,$+te)}),$+=te;break;case"string":$+=n.strPosToUni(te);break;case"object":W(te)}break}}let ee;for(;ee=he(-1);)W(ee);return u(P)}const p=(w,b)=>{let P=0;for(let W=0;W<b.length&&w>P;W++){const he=b[W];switch(typeof he){case"number":{P+=he;break}case"string":const ee=n.strPosToUni(he);P+=ee,w+=ee;break;case"object":w-=Math.min(e.dlen(he.d),w-P);break}}return w},C=(w,b)=>typeof w=="number"?p(w,b):w.map(P=>p(P,b));function I(w,b,P){return s(w,(W,he)=>typeof W=="object"&&typeof W.d=="number"?{d:P.slice(b,he,he+W.d)}:W)}function S(w){return s(w,b=>{switch(typeof b){case"object":if(typeof b.d=="number")throw Error("Cannot invert text op: Deleted characters missing from operation. makeInvertible must be called first.");return b.d;case"string":return{d:b};case"number":return b}})}function D(w){return s(w,b=>typeof b=="object"&&typeof b.d=="string"?{d:n.strPosToUni(b.d)}:b)}function U(w){let b=!0;return r(w,P=>{typeof P=="object"&&typeof P.d=="number"&&(b=!1)}),b}function B(w){return{name:"text-unicode",uri:"http://sharejs.org/types/text-unicode",trim:u,normalize:o,checkOp:t,create(b=""){if(typeof b!="string")throw Error("Initial data must be a string");return w.create(b)},apply(b,P){t(P);const W=w.builder(b);for(let he=0;he<P.length;he++){const ee=P[he];switch(typeof ee){case"number":W.skip(ee);break;case"string":W.append(ee);break;case"object":W.del(e.dlen(ee.d));break}}return W.build()},transform:f,compose:g,transformPosition:p,transformSelection:C,isInvertible:U,makeInvertible(b,P){return I(b,P,w)},stripInvertible:D,invert:S,invertWithDoc(b,P){return S(I(b,P,w))},isNoop:b=>b.length===0}}e.default=B}(oi)),oi}var zr={},Rl;function cp(){if(Rl)return zr;Rl=1,Object.defineProperty(zr,"__esModule",{value:!0});const e=ai(),n=ii();function t(r,s){return{get:r,getLength(){return r().length},insert(i,o,a){const l=n.strPosToUni(r(),i);return s([l,o],a)},remove(i,o,a){const l=n.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 zr.default=t,t.provides={text:!0},zr}var Il;function hp(){return Il||(Il=1,function(e){var n=Je&&Je.__createBinding||(Object.create?function(f,g,p,C){C===void 0&&(C=p),Object.defineProperty(f,C,{enumerable:!0,get:function(){return g[p]}})}:function(f,g,p,C){C===void 0&&(C=p),f[C]=g[p]}),t=Je&&Je.__setModuleDefault||(Object.create?function(f,g){Object.defineProperty(f,"default",{enumerable:!0,value:g})}:function(f,g){f.default=g}),r=Je&&Je.__importStar||function(f){if(f&&f.__esModule)return f;var g={};if(f!=null)for(var p in f)Object.hasOwnProperty.call(f,p)&&n(g,f,p);return t(g,f),g},s=Je&&Je.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.type=e.remove=e.insert=void 0;const i=ii(),o=r(ai()),a=s(cp()),l={create(f){return f},toString(f){return f},builder(f){if(typeof f!="string")throw Error("Invalid document snapshot: "+f);const g=[];return{skip(p){let C=i.uniToStrPos(f,p);if(C>f.length)throw Error("The op is too long for this document");g.push(f.slice(0,C)),f=f.slice(C)},append(p){g.push(p)},del(p){f=f.slice(i.uniToStrPos(f,p))},build(){return g.join("")+f}}},slice:o.uniSlice},c=o.default(l),h=Object.assign(Object.assign({},c),{api:a.default});e.type=h,e.insert=(f,g)=>g.length===0?[]:f===0?[g]:[f,g],e.remove=(f,g)=>o.dlen(g)===0?[]:f===0?[{d:g}]:[f,{d:g}];var u=ai();Object.defineProperty(e,"makeType",{enumerable:!0,get:function(){return u.default}})}(si)),si}(function(e){var n=Je&&Je.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(e,"__esModule",{value:!0}),e.editOp=e.replaceOp=e.insertOp=e.moveOp=e.removeOp=e.type=void 0;const t=n(Zs),r=n(ei),s=ni,i=ri;function o(O,k){if(!O)throw new Error(k)}e.type={name:"json1",uri:"http://sharejs.org/types/JSONv1",readCursor:s.readCursor,writeCursor:s.writeCursor,create:O=>O,isNoop:O=>O==null,setDebug(O){},registerSubtype:S,checkValidOp:he,normalize:ee,apply:ae,transformPosition:Ae,compose:Ne,tryTransform:ve,transform:Me,makeInvertible:V,invert:te,invertWithDoc:pe,RM_UNEXPECTED_CONTENT:i.ConflictType.RM_UNEXPECTED_CONTENT,DROP_COLLISION:i.ConflictType.DROP_COLLISION,BLACKHOLE:i.ConflictType.BLACKHOLE,transformNoConflict:(O,k,J)=>qe(()=>!0,O,k,J),typeAllowingConflictsPred:O=>Object.assign(Object.assign({},e.type),{transform:(k,J,re)=>qe(O,k,J,re)})};const a=O=>O?O.getComponent():null;function l(O){return O&&typeof O=="object"&&!Array.isArray(O)}const c=O=>Array.isArray(O)?O.slice():O!==null&&typeof O=="object"?Object.assign({},O):O,h=O=>O&&(O.p!=null||O.r!==void 0),u=O=>O&&(O.d!=null||O.i!==void 0);function f(O,k){return o(O!=null),typeof k=="number"?(o(Array.isArray(O),"Invalid key - child is not an array"),(O=O.slice()).splice(k,1)):(o(l(O),"Invalid key - child is not an object"),delete(O=Object.assign({},O))[k]),O}function g(O,k,J){return typeof k=="number"?(o(O!=null,"Container is missing for key"),o(Array.isArray(O),"Cannot use numerical key for object container"),o(O.length>=k,"Cannot insert into out of bounds index"),O.splice(k,0,J)):(o(l(O),"Cannot insert into missing item"),o(O[k]===void 0,"Trying to overwrite value at key. Your op needs to remove it first"),O[k]=J),J}e.removeOp=(O,k=!0)=>s.writeCursor().writeAtPath(O,"r",k).get(),e.moveOp=(O,k)=>s.writeCursor().writeMove(O,k).get(),e.insertOp=(O,k)=>s.writeCursor().writeAtPath(O,"i",k).get(),e.replaceOp=(O,k,J)=>s.writeCursor().at(O,re=>{re.write("r",k),re.write("i",J)}).get(),e.editOp=(O,k,J,re=!1)=>s.writeCursor().at(O,X=>b(X,k,J,re)).get();const p=(O,k)=>O!=null&&(typeof k=="number"?Array.isArray(O):typeof O=="object"),C=(O,k)=>p(O,k)?O[k]:void 0,I={};function S(O){let k=O.type?O.type:O;k.name&&(I[k.name]=k),k.uri&&(I[k.uri]=k)}const D=O=>{const k=I[O];if(k)return k;throw Error("Missing type: "+O)};S(hp());const U=(O,k)=>O+k;S({name:"number",apply:U,compose:U,invert:O=>-O,transform:O=>O});const B=O=>O==null?null:O.et?D(O.et):O.es?I["text-unicode"]:O.ena!=null?I.number:null,w=O=>O.es?O.es:O.ena!=null?O.ena:O.e,b=(O,k,J,re=!1)=>{const[X,G]=typeof k=="string"?[D(k),k]:[k,k.name];!re&&X.isNoop&&X.isNoop(J)||(G==="number"?O.write("ena",J):G==="text-unicode"?O.write("es",J):(O.write("et",G),O.write("e",J)))};function P(O){o(typeof O=="number"),o(O>=0),o(O===(0|O))}function W(O){typeof O=="number"?P(O):o(typeof O=="string")}function he(O){if(O===null)return;const k=new Set,J=new Set,re=G=>{let me=!0,ge=!1;for(let F in G){const Z=G[F];if(me=!1,o(F==="p"||F==="r"||F==="d"||F==="i"||F==="e"||F==="es"||F==="ena"||F==="et","Invalid component item '"+F+"'"),F==="p")P(Z),o(!k.has(Z)),k.add(Z),o(G.r===void 0);else if(F==="d")P(Z),o(!J.has(Z)),J.add(Z),o(G.i===void 0);else if(F==="e"||F==="es"||F==="ena"){o(!ge),ge=!0;const q=B(G);o(q,"Missing type in edit"),q.checkValidOp&&q.checkValidOp(w(G))}}o(!me)},X=(G,me,ge)=>{if(!Array.isArray(G))throw Error("Op must be null or a list");if(G.length===0)throw Error("Empty descent");me||W(G[0]);let F=1,Z=0,q=0;for(let se=0;se<G.length;se++){const Re=G[se];if(o(Re!=null),Array.isArray(Re)){const be=X(Re,!1);if(Z){const x=typeof q,fe=typeof be;x===fe?o(q<be,"descent keys are not in order"):o(x==="number"&&fe==="string")}q=be,Z++,F=3}else typeof Re=="object"?(o(F===1,`Prev not scalar - instead ${F}`),re(Re),F=2):(o(F!==3),W(Re),o(s.isValidPathItem(Re),"Invalid path key"),F=1)}return o(Z!==1,"Operation makes multiple descents. Remove some []"),o(F===2||F===3),G[0]};X(O,!0),o(k.size===J.size,"Mismatched picks and drops in op");for(let G=0;G<k.size;G++)o(k.has(G)),o(J.has(G))}function ee(O){let k=0,J=[];const re=s.writeCursor();return re.mergeTree(O,(X,G)=>{const me=B(X);if(me){const F=w(X);b(G,me,me.normalize?me.normalize(F):F)}for(const F of["r","p","i","d"])if(X[F]!==void 0){const Z=F==="p"||F==="d"?(ge=X[F],J[ge]==null&&(J[ge]=k++),J[ge]):X[F];G.write(F,Z)}var ge}),re.get()}function ae(O,k){if(he(k),k===null)return O;const J=[];return function re(X,G){let me=X,ge=0,F={root:X},Z=0,q=F,se="root";function Re(){for(;Z<ge;Z++){let be=G[Z];typeof be!="object"&&(o(p(q,se)),q=q[se]=c(q[se]),se=be)}}for(;ge<G.length;ge++){const be=G[ge];if(Array.isArray(be)){const x=re(me,be);x!==me&&x!==void 0&&(Re(),me=q[se]=x)}else if(typeof be=="object"){be.d!=null?(Re(),me=g(q,se,J[be.d])):be.i!==void 0&&(Re(),me=g(q,se,be.i));const x=B(be);if(x)Re(),me=q[se]=x.apply(me,w(be));else if(be.e!==void 0)throw Error("Subtype "+be.et+" undefined")}else me=C(me,be)}return F.root}(O=function re(X,G){const me=[];let ge=0;for(;ge<G.length;ge++){const se=G[ge];if(Array.isArray(se))break;typeof se!="object"&&(me.push(X),X=C(X,se))}for(let se=G.length-1;se>=ge;se--)X=re(X,G[se]);for(--ge;ge>=0;ge--){const se=G[ge];if(typeof se!="object"){const Re=me.pop();X=X===C(Re,se)?Re:X===void 0?f(Re,se):(Z=se,q=X,(F=c(F=Re))[Z]=q,F)}else h(se)&&(o(X!==void 0,"Cannot pick up or remove undefined"),se.p!=null&&(J[se.p]=X),X=void 0)}var F,Z,q;return X}(O,k),k)}function Ae(O,k){O=O.slice(),he(k);const J=s.readCursor(k);let re,X,G=!1;const me=[];for(let F=0;;F++){const Z=O[F],q=J.getComponent();if(q&&(q.r!==void 0?G=!0:q.p!=null&&(G=!1,re=q.p,X=F)),F>=O.length)break;let se=0;const Re=s.advancer(J,void 0,(x,fe)=>{h(fe)&&se++});me.unshift(Re);const be=Re(Z);if(typeof Z=="number"&&(O[F]-=se),!be)break}if(me.forEach(F=>F.end()),G)return null;const ge=()=>{let F=0;if(re!=null){const Z=J.getPath();F=Z.length,O=Z.concat(O.slice(X))}for(;F<O.length;F++){const Z=O[F],q=a(J),se=B(q);if(se){const x=w(q);se.transformPosition&&(O[F]=se.transformPosition(O[F],x));break}let Re=0;const be=s.advancer(J,(x,fe)=>u(fe)?~(x-Re):x-Re,(x,fe)=>{u(fe)&&Re++})(Z);if(typeof Z=="number"&&(O[F]+=Re),!be)break}};return re!=null?J.eachDrop(null,F=>{F===re&&ge()}):ge(),O}function Ne(O,k){if(he(O),he(k),O==null)return k;if(k==null)return O;let J=0;const re=s.readCursor(O),X=s.readCursor(k),G=s.writeCursor(),me=[],ge=[],F=[],Z=[],q=[],se=[],Re=new Set;re.traverse(null,x=>{x.p!=null&&(F[x.p]=re.clone())}),X.traverse(null,x=>{x.d!=null&&(Z[x.d]=X.clone())});const be=s.writeCursor();return function x(fe,ze,He,Le,Xe,bt,Ve,nt){o(ze||He);const Ge=a(ze),mt=a(He),ut=!!mt&&mt.r!==void 0,Gt=!!Ge&&Ge.i!==void 0,ke=Ge?Ge.d:null,_t=mt?mt.p:null,E=(bt||ut)&&_t==null;if(_t!=null)Le=Z[_t],Ve=ge[_t]=new s.WriteCursor;else if(mt&&mt.r!==void 0)Le=null;else{const T=a(Le);T&&T.d!=null&&(Le=null)}const m=a(Le);if(ke!=null)if(fe=F[ke],nt=me[ke]=new s.WriteCursor,E)bt&&!ut&&nt.write("r",!0);else{const T=q[ke]=J++;Ve.write("d",T)}else if(Ge&&Ge.i!==void 0)fe=null;else{const T=a(fe);T&&T.p!=null&&(fe=null)}let _;Gt?(o(Xe===void 0),_=Ge.i):_=Xe;const y=(_t==null?!Gt||bt||ut:_===void 0)?null:Ve.getComponent();if(_t!=null){if(!(Xe!==void 0||Gt)){const T=ke!=null?q[ke]:J++;se[_t]=T,nt.write("p",T)}}else ut&&(Gt||Xe!==void 0||(mt.r,nt.write("r",mt.r)));const A=E?null:B(Ge),M=B(m);if((A||M)&&(A&&A.name,M&&M.name),A&&M){o(A===M);const T=w(Ge),Y=w(m),de=A.compose(T,Y);b(Ve,A,de),Re.add(m)}else A?b(Ve,A,w(Ge)):M&&(b(Ve,M,w(m)),Re.add(m));const N=typeof _=="object"&&_!=null;let L=!1,v=0,j=0,le=0,H=0,ie=0;const Ce=s.advancer(Le,(T,Y)=>u(Y)?H-T-1:T-H,(T,Y)=>{u(Y)&&H++}),Q=s.advancer(fe,(T,Y)=>h(Y)?v-T-1:T-v,(T,Y)=>{h(Y)&&v++});if(s.eachChildOf(ze,He,(T,Y,de)=>{let Ie,Ue,Pe=T,Be=T,pt=T;if(typeof T=="number"){let ye=T+le;Ue=Ce(ye),Be=ye+H;let z=T+j;Ie=Q(z),u(a(Ue))&&(Ie=null),Pe=z+v,pt=T+ie,o(Pe>=0,"p1PickKey is negative"),o(Be>=0,"p2DropKey is negative");const ht=u(a(Y)),xe=h(a(de));(ht||xe&&!E)&&ie--,ht&&j--,xe&&le--}else Ie=Q(T),Ue=Ce(T);nt.descend(Pe),Ve.descend(Be);const Et=N&&!u(a(Y))?_[pt]:void 0,ue=x(Ie,Y,de,Ue,Et,E,Ve,nt);var et,Ee,_e;N&&!E?Et!==ue&&(L||(_=Array.isArray(_)?_.slice():Object.assign({},_),L=!0),et=_,_e=ue,typeof(Ee=pt)=="number"?(o(Array.isArray(et)),o(Ee<et.length)):(o(!Array.isArray(et)),o(et[Ee]!==void 0)),_e===void 0?typeof Ee=="number"?et.splice(Ee,1):delete et[Ee]:et[Ee]=_e):o(ue===void 0),Ve.ascend(),nt.ascend()}),Q.end(),Ce.end(),y!=null)y.i=_;else if(!bt&&!ut&&_t==null)return _}(re,re.clone(),X,X.clone(),void 0,!1,G,be),G.reset(),G.mergeTree(be.get()),G.reset(),G.get(),me.map(x=>x.get()),ge.map(x=>x.get()),re.traverse(G,(x,fe)=>{const ze=x.p;if(ze!=null){const He=q[ze];He!=null&&fe.write("p",He);const Le=me[ze];Le&&Le.get(),Le&&fe.mergeTree(Le.get())}else x.r!==void 0&&fe.write("r",x.r)}),G.reset(),G.get(),X.traverse(G,(x,fe)=>{const ze=x.d;if(ze!=null){const Le=se[ze];Le!=null&&fe.write("d",Le);const Xe=ge[ze];Xe&&fe.mergeTree(Xe.get())}else x.i!==void 0&&fe.write("i",x.i);const He=B(x);He&&!Re.has(x)&&b(fe,He,w(x))}),G.get()}function te(O){if(O==null)return null;const k=new s.ReadCursor(O),J=new s.WriteCursor;let re;const X=[],G=[];return function me(ge,F,Z){const q=ge.getComponent();let se,Re=!1;if(q){q.p!=null&&(F.write("d",q.p),X[q.p]=ge.clone()),q.r!==void 0&&F.write("i",q.r),q.d!=null&&(F.write("p",q.d),Z=void 0),q.i!==void 0&&(Z=se=q.i);const x=B(q);x&&(Z===void 0?(re||(re=new Set),re.add(q)):(w(q),Z=x.apply(Z,w(q)),Re=!0))}let be=0;for(const x of ge){F.descend(x);const fe=typeof x=="number"?x-be:x,ze=C(Z,fe);u(ge.getComponent())&&be++;const He=me(ge,F,ze);if(Z!==void 0&&He!==void 0){if(Re||(Re=!0,Z=c(Z)),!p(Z,fe))throw Error("Cannot modify child - invalid operation");Z[fe]=He}F.ascend()}if(se===void 0)return Re?Z:void 0;F.write("r",Z)}(k,J,void 0),re&&(J.reset(),function me(ge,F,Z){const q=F.getComponent();if(q){const x=q.d;if(x!=null&&(ge=X[x],Z=G[x]=s.writeCursor()),re.has(q)){const fe=B(q);if(!fe.invert)throw Error(`Cannot invert subtype ${fe.name}`);b(Z,fe,fe.invert(w(q)))}}let se=0,Re=0;const be=s.advancer(ge,(x,fe)=>h(fe)?se-x-1:x-se,(x,fe)=>{h(fe)&&se++});for(const x of F)if(typeof x=="number"){const fe=x-Re,ze=be(fe),He=fe+se;Z.descend(He),me(ze,F,Z),u(F.getComponent())&&Re++,Z.ascend()}else Z.descend(x),me(be(x),F,Z),Z.ascend();be.end()}(k.clone(),k,J),G.length&&(J.reset(),k.traverse(J,(me,ge)=>{const F=me.p;if(F!=null){const Z=G[F];Z&&Z.get(),Z&&ge.mergeTree(Z.get())}}))),J.get()}const $=(O,k)=>O.some(J=>typeof J=="object"&&(Array.isArray(J)?$(J,k):k(J)));function V(O,k){if(O==null||!$(O,F=>{var Z;return F.r!==void 0||((Z=B(F))===null||Z===void 0?void 0:Z.makeInvertible)!=null}))return O;const J=new s.ReadCursor(O),re=new s.WriteCursor;let X=!1;const G=[],me=[],ge=(F,Z,q)=>{const se=F.getComponent();let Re=!1;if(se){se.d!=null&&Z.write("d",se.d),se.i!==void 0&&Z.write("i",se.i);const x=se.p;if(x!=null&&(G[x]=F.clone(),o(q!==void 0,"Operation picks up at an invalid key"),me[x]=q,Z.write("p",se.p)),se.r!==void 0&&q===void 0)throw Error("Invalid doc / op in makeInvertible: removed item missing from doc");const fe=B(se);fe&&(fe.makeInvertible?X=!0:b(Z,fe,w(se),!0))}let be=0;for(const x of F){Z.descend(x);const fe=typeof x=="number"?x-be:x,ze=C(q,fe),He=ge(F,Z,ze);ze!==He&&(Re||(Re=!0,q=c(q)),He===void 0?(q=f(q,fe),typeof x=="number"&&be++):q[fe]=He),Z.ascend()}return se&&(se.r!==void 0?(Z.write("r",r.default(q)),q=void 0):se.p!=null&&(q=void 0)),q};return ge(J,re,k),re.get(),X&&(re.reset(),function F(Z,q,se,Re,be){const x=q.getComponent();if(x){x.i!==void 0?(Re=x.i,be=!0):x.d!=null&&(Re=me[x.d],Z=G[x.d],be=!1,x.d);let Le=B(x);if(Le&&Le.makeInvertible){const Xe=w(x);b(se,Le,Le.makeInvertible(Xe,Re),!0)}}let fe=0,ze=0;const He=s.advancer(Z,(Le,Xe)=>h(Xe)?fe-Le-1:Le-fe,(Le,Xe)=>{h(Xe)&&fe++});for(const Le of q)if(typeof Le=="number"){const Xe=Le-ze,bt=He(Xe),Ve=Xe+fe,nt=C(Re,be?Xe:Ve);se.descend(Le),F(bt,q,se,nt,be),u(q.getComponent())&&ze++,se.ascend()}else{const Xe=C(Re,Le);se.descend(Le),F(He(Le),q,se,Xe,be),se.ascend()}He.end()}(J.clone(),J,re,k,!1)),re.get()}function pe(O,k){return te(V(O,k))}const ne=O=>{if(O==null)return null;const k=O.slice();for(let J=0;J<O.length;J++){const re=k[J];Array.isArray(re)&&(k[J]=ne(re))}return k};function ve(O,k,J){o(J==="left"||J==="right","Direction must be left or right");const re=J==="left"?0:1;if(k==null)return{ok:!0,result:O};he(O),he(k);let X=null;const G=[],me=[],ge=[],F=[],Z=[],q=[],se=[],Re=[],be=[],x=[],fe=[],ze=[],He=[],Le=[],Xe=[];let bt=0;const Ve=s.readCursor(O),nt=s.readCursor(k),Ge=s.writeCursor();if(function m(_,y=null,A){const M=a(y);M&&(M.r!==void 0?A=y.clone():M.p!=null&&(A=null,q[M.p]=_.clone()));const N=_.getComponent();let L;N&&(L=N.p)!=null&&(Z[L]=y?y.clone():null,ge[L]=_.clone(),A&&(x[L]=!0,be[L]=A),M&&M.p!=null&&(Le[L]=M.p));const v=s.advancer(y);for(const j of _)m(_,v(j),A);v.end()}(nt,Ve,null),function m(_,y,A,M,N){const L=A.getComponent();let v,j=!1;L&&((v=L.d)!=null?(F[v]=A.clone(),M!=null&&(Xe[M]==null&&(Xe[M]=[]),Xe[M].push(v)),_=Z[v]||null,y=ge[v]||null,x[v]?(N&&(fe[v]=!0),N=be[v]||null):!N||re!==1&&Le[v]!=null||X==null&&(X={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(N.getPath()),op2:e.moveOp(y.getPath(),A.getPath())}),j=!0):L.i!==void 0&&(_=y=null,j=!0,N&&X==null&&(X={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(N.getPath()),op2:e.insertOp(A.getPath(),L.i)})));const le=a(_);le&&(le.r!==void 0?N=_.clone():le.p!=null&&(le.p,M=le.p,N=null));const H=B(L);H&&N&&X==null&&(X={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(N.getPath()),op2:e.editOp(A.getPath(),H,w(L),!0)});let ie=0,Ce=0;const Q=s.advancer(y,(Y,de)=>h(de)?ie-Y-1:Y-ie,(Y,de)=>{h(de)&&ie++}),T=s.advancer(_);for(const Y of A)if(typeof Y=="number"){const de=Y-Ce,Ie=Q(de);Ce+=+m(T(de+ie),Ie,A,M,N)}else{const de=Q(Y);m(T(Y),de,A,M,N)}return Q.end(),T.end(),j}(Ve,nt,nt.clone(),null,null),F.map(m=>m&&m.get()),X)return{ok:!1,conflict:X};fe.map(m=>!!m);const mt=[];let ut=null;(function m(_,y,A,M,N){let L=!1;const v=a(y);if(h(v)){const Q=v.p;Q!=null?(A=F[Q],M=ze[Q]=s.writeCursor(),L=!0,N=null):(A=null,N=y.clone())}else u(a(A))&&(A=null);const j=_.getComponent();if(j){const Q=j.p;Q!=null?(N&&(Re[Q]=N),mt[Q]=N||re===1&&L?null:M.getComponent(),G[Q]=_.clone(),A&&(se[Q]=A.clone())):j.r!==void 0&&(N||M.write("r",!0),(N||L)&&(ut==null&&(ut=new Set),ut.add(j)))}let le=0,H=0;const ie=s.advancer(y,void 0,(Q,T)=>{h(T)&&le++}),Ce=s.advancer(A,(Q,T)=>u(T)?~(Q-H):Q-H,(Q,T)=>{u(T)&&H++});if(_)for(const Q of _)if(typeof Q=="string"){const T=ie(Q),Y=Ce(Q);M.descend(Q),m(_,T,Y,M,N),M.ascend()}else{const T=ie(Q),Y=Q-le,de=h(a(T))?null:Ce(Y),Ie=Y+H;o(Ie>=0),M.descend(Ie),m(_,T,de,M,N),M.ascend()}ie.end(),Ce.end()})(Ve,nt,nt.clone(),Ge,null),Ge.reset();let Gt=[];if(function m(_,y,A,M,N,L){o(y);const v=y.getComponent();let j=a(M),le=!1;const H=(Ee,_e,ye)=>Ee?e.moveOp(Ee.getPath(),_e.getPath()):e.insertOp(_e.getPath(),ye.i);if(u(v)){const Ee=v.d;Ee!=null&&(me[Ee]=y.clone());const _e=Ee!=null?mt[Ee]:null;let ye=!1;if(v.i!==void 0||Ee!=null&&_e){let z;j&&(j.i!==void 0||(z=j.d)!=null&&!x[z])&&(ye=z!=null?Ee!=null&&Ee===Le[z]:t.default(j.i,v.i),ye||z!=null&&re!==1&&Le[z]!=null||X==null&&(X={type:i.ConflictType.DROP_COLLISION,op1:H(Ee!=null?G[Ee]:null,y,v),op2:H(z!=null?ge[z]:null,M,j)})),ye||(L?X==null&&(X={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:H(Ee!=null?G[Ee]:null,y,v),op2:e.removeOp(L.getPath())}):(Ee!=null?(Gt[bt]=Ee,N.write("d",_e.p=bt++)):N.write("i",r.default(v.i)),le=!0))}else if(Ee!=null&&!_e){const z=Re[Ee];z&&(L=z.clone())}Ee!=null?(_=G[Ee],A=q[Ee],M=se[Ee]):v.i!==void 0&&(_=A=null,ye||(M=null))}else h(a(_))&&(_=A=M=null);const ie=a(_),Ce=a(A);if(h(Ce)){const Ee=Ce.p;Ce.r!==void 0&&(!ie||ie.r===void 0)||x[Ee]?(M=null,L=A.clone()):Ee!=null&&(M=F[Ee],re!==1&&Le[Ee]!=null||((N=He[Ee])||(N=He[Ee]=s.writeCursor()),N.reset(),L=null))}else!u(v)&&u(j)&&(M=null);j=M!=null?M.getComponent():null;const Q=B(v);if(Q){const Ee=w(v);if(L)X==null&&(X={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.editOp(y.getPath(),Q,Ee,!0),op2:e.removeOp(L.getPath())});else{const _e=B(j);let ye;if(_e){if(Q!==_e)throw Error("Transforming incompatible types");const z=w(j);ye=Q.transform(Ee,z,J)}else ye=r.default(Ee);b(N,Q,ye)}}let T=0,Y=0,de=0,Ie=0,Ue=0,Pe=0,Be=_!=null&&_.descendFirst(),pt=Be;const Et=s.advancer(A,void 0,(Ee,_e)=>{h(_e)&&de++});let ue=M!=null&&M.descendFirst(),et=ue;for(const Ee of y)if(typeof Ee=="number"){let _e;const ye=u(y.getComponent()),z=Ee-Y;{let rn;for(;Be&&typeof(rn=_.getKey())=="number";){rn+=T;const Mt=_.getComponent(),Pn=h(Mt);if(rn>z||rn===z&&(!Pn||re===0&&ye))break;if(Pn){T--;const _n=Mt.p;Le.includes(_n),Mt.d,a(He[Mt.d]),h(a(He[Mt.d])),(Mt.r===void 0||ut&&ut.has(Mt))&&(_n==null||!mt[_n]||re!==1&&Le.includes(_n))||Ue--}Be=_.nextSibling()}_e=Be&&rn===z?_:null}const ht=z-T;let xe=Et(ht);const xt=ht-de;let ns=null;{let rn,Mt;for(;ue&&typeof(rn=M.getKey())=="number";){Mt=rn-Ie;const Pn=M.getComponent(),_n=u(Pn);if(Mt>xt)break;if(Mt===xt){if(!_n){ns=M;break}{if(re===0&&ye){ns=M;break}const pn=xe&&h(xe.getComponent());if(re===0&&pn)break}}if(_n){const pn=Pn.d;Le[pn],Pn.i===void 0&&(x[pn]||Le[pn]!=null&&re!==1)?(x[pn]||Le[pn]!=null&&re===0)&&(Ie++,Pe--):Ie++}ue=M.nextSibling()}}const wc=xt+Ie+Ue+Pe;o(wc>=0,"trying to descend to a negative index"),N.descend(wc),ye&&(_e=xe=ns=null,Y++),m(_e,y,xe,ns,N,L)&&Pe++,N.ascend()}else{let _e;for(;Be&&(_e=_.getKey(),typeof _e!="string"||!(_e>Ee||_e===Ee));)Be=_.nextSibling();const ye=Be&&_e===Ee?_:null,z=Et(Ee);let ht;for(;ue&&(ht=M.getKey(),typeof ht!="string"||!(ht>Ee||ht===Ee));)ue=M.nextSibling();const xe=ue&&ht===Ee?M:null;N.descend(Ee),m(ye,y,z,xe,N,L),N.ascend()}return Et.end(),pt&&_.ascend(),et&&M.ascend(),le}(Ve,Ve.clone(),nt,nt.clone(),Ge,null),X)return{ok:!1,conflict:X};Ge.reset();const ke=(m,_,y)=>m.traverse(_,(A,M)=>{A.d!=null&&y(A.d,m,M)});(x.length||ze.length)&&(ke(nt,Ge,(m,_,y)=>{x[m]&&!fe[m]&&y.write("r",!0),ze[m]&&y.mergeTree(ze[m].get())}),Ge.reset());const _t=[],E=[];if((He.length||x.length)&&!X){const m=s.readCursor(ne(Ge.get()));if(ke(m,null,(_,y)=>{_t[_]=y.clone()}),He.forEach(_=>{_&&ke(s.readCursor(_.get()),null,(y,A)=>{_t[y]=A.clone()})}),function _(y,A,M,N,L,v){const j=a(A);if(j&&h(j))if(j.p!=null){const T=j.p;_t[T].getPath(),M=_t[T],N=E[T]=s.writeCursor()}else j.r!==void 0&&(M=null);else u(a(M))&&(M=null);const le=y.getComponent();if(le){let T;if((T=le.d)!=null){const Y=He[T];Y&&(Y.get(),N.mergeTree(Y.get()),M=s.readCursor(Y.get()))}}let H=0,ie=0;const Ce=s.advancer(A,void 0,(T,Y)=>{h(Y)&&H--}),Q=s.advancer(M,(T,Y)=>u(Y)?-(T-ie)-1:T-ie,(T,Y)=>{u(Y)&&ie++});for(const T of y)if(typeof T=="number"){const Y=Ce(T),de=T+H,Ie=Q(de),Ue=de+ie;N.descend(Ue),_(y,Y,Ie,N),N.ascend()}else N.descend(T),_(y,Ce(T),Q(T),N),N.ascend();Ce.end(),Q.end()}(nt,m,m.clone(),Ge),Ge.reset(),X)return{ok:!1,conflict:X};if(Ge.get(),E.length){const _=E.map(A=>A?A.get():null),y=s.readCursor(ne(Ge.get()));if(ke(y,Ge,(A,M,N)=>{const L=_[A];L&&(N.mergeTree(L),_[A]=null)}),_.find(A=>A)){const A=s.writeCursor(),M=s.writeCursor();let N=0,L=0;_.forEach(v=>{v!=null&&ke(s.readCursor(v),null,j=>{const le=Gt[j];A.writeMove(G[le].getPath(),me[le].getPath(),N++);const H=Xe[le];H&&H.forEach(ie=>{x[ie]||re!==1&&Le[ie]!=null||M.writeMove(ge[ie].getPath(),F[ie].getPath(),L++)})})}),X={type:i.ConflictType.BLACKHOLE,op1:A.get(),op2:M.get()}}}}return X?{ok:!1,conflict:X}:{ok:!0,result:Ge.get()}}const Oe=O=>{const k=new Error("Transform detected write conflict");throw k.conflict=O,k.type=k.name="writeConflict",k};function Me(O,k,J){const re=ve(O,k,J);if(re.ok)return re.result;Oe(re.conflict)}const Fe=O=>{const k=s.writeCursor();return s.readCursor(O).traverse(k,(J,re)=>{(u(J)||B(J))&&re.write("r",!0)}),k.get()},Ye=(O,k)=>{const{type:J,op1:re,op2:X}=O;switch(J){case i.ConflictType.DROP_COLLISION:return k==="left"?[null,Fe(X)]:[Fe(re),null];case i.ConflictType.RM_UNEXPECTED_CONTENT:let G=!1;return s.readCursor(re).traverse(null,me=>{me.r!==void 0&&(G=!0)}),G?[null,Fe(X)]:[Fe(re),null];case i.ConflictType.BLACKHOLE:return[Fe(re),Fe(X)];default:throw Error("Unrecognised conflict: "+J)}};function qe(O,k,J,re){let X=null;for(;;){const G=ve(k,J,re);if(G.ok)return Ne(X,G.result);{const{conflict:me}=G;O(me)||Oe(me);const[ge,F]=Ye(me,re);k=Ne(ee(k),ge),J=Ne(ee(J),F),X=Ne(X,F)}}}})(El),function(e){var n=Je&&Je.__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]}),t=Je&&Je.__exportStar||function(i,o){for(var a in i)a!=="default"&&!o.hasOwnProperty(a)&&n(o,i,a)};Object.defineProperty(e,"__esModule",{value:!0}),t(El,e);var r=ni;Object.defineProperty(e,"ReadCursor",{enumerable:!0,get:function(){return r.ReadCursor}}),Object.defineProperty(e,"WriteCursor",{enumerable:!0,get:function(){return r.WriteCursor}});var s=ri;Object.defineProperty(e,"ConflictType",{enumerable:!0,get:function(){return s.ConflictType}})}(gt);const dp=Ac({__proto__:null,default:It(gt)},[gt]);var oe=(e=>(e.RETAIN="r",e.INSERT="i",e.DELETE="d",e))(oe||{});function er(e,n=!1){const t=[];for(const r of e){const{st:s,ed:i,ts:o}=r;if(r.sId===void 0&&delete r.sId,s===i||!n&&K.isEmptyObject(o)&&r.sId==null)continue;if(t.length===0){t.push(r);continue}const a=t.pop();Qa(r,a)&&K.hasIntersectionBetweenTwoRanges(a.st,a.ed,r.st,r.ed)?t.push({...r,st:a.st,ed:i}):t.push(a,r)}return t}function Sl(e,n,t,r){var c;const{textRuns:s}=e;if(s==null)return;const i=[],o=s.length;let a=!1;const l=(c=n.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:f,ed:g}=u;if(g<=r)i.push(u);else if(r>f&&r<g){a=!0;const p={...u,ed:r};i.push(p),l.length&&i.push(...l);const C={...u,st:r+t,ed:g+t};i.push(C)}else u.st+=t,u.ed+=t,a||(a=!0,i.push(...l)),i.push(u)}a||(a=!0,i.push(...l)),e.textRuns=er(i)}function Ol(e,n,t,r){const{paragraphs:s}=e;if(s==null)return;const{paragraphs:i}=n,o=[];for(let l=0,c=s.length;l<c;l++){const h=s[l],{startIndex:u}=h;u>=r&&(h.startIndex+=t),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(qn("startIndex"))}}function yl(e,n,t,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+=t)}const i=n.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(qn("startIndex"))}}function wl(e,n,t,r){const{customBlocks: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+=t)}const i=n.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(qn("startIndex"))}}function bl(e,n,t,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+=t,l.endIndex+=t):h>r&&(l.endIndex+=t)}const i=n.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(qn("startIndex"))}}const Al="$",Tl=e=>e.split(Al)[0];function li(e){if(e.length<=1)return e;e.sort((s,i)=>s.startIndex-i.startIndex);const n=[];let t={...e[0]};t.rangeId=Tl(t.rangeId);for(let s=1;s<e.length;s++){const i=e[s];i.rangeId=Tl(i.rangeId),i.rangeId===t.rangeId&&ra(t.properties,i.properties)&&t.endIndex+1>=i.startIndex?t.endIndex=i.endIndex:(n.push(t),t={...i})}n.push(t);const r=Object.create(null);for(let s=0,i=n.length;s<i;s++){const o=n[s],a=o.rangeId;r[a]?(o.rangeId=`${a}${Al}${r[a]}`,r[a]=r[a]+1):r[a]=1}return n}function ui(e,n){const t=e.findIndex(s=>s.startIndex<n&&s.endIndex>=n),r=e[t];r&&e.splice(t,1,{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:r.startIndex,endIndex:n-1,properties:{...r.properties}},{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:n,endIndex:r.endIndex,properties:{...r.properties}})}function Nl(e){if(e.length<=1)return e;e.sort((r,s)=>r.startIndex-s.startIndex);const n=[];let t={...e[0]};for(let r=1;r<e.length;r++){const s=e[r];s.id===t.id&&t.endIndex+1>=s.startIndex?t.endIndex=s.endIndex:(n.push(t),t={...s})}return n.push(t),n}function ci(e,n){e.filter(r=>r.startIndex<n&&r.endIndex>=n).forEach(r=>{const s=e.indexOf(r);e.splice(s,1,{id:r.id,type:r.type,startIndex:r.startIndex,endIndex:n-1},{id:r.id,type:r.type,startIndex:n,endIndex:r.endIndex})})}function fp(e,n,t,r){e.customRanges||(e.customRanges=[]);const{customRanges:s}=e;ui(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=t,l.endIndex+=t)}const i=[];if(n.customRanges){for(let o=0,a=n.customRanges.length;o<a;o++){const l=n.customRanges[o];l.startIndex+=r,l.endIndex+=r,i.push(l)}s.push(...i)}e.customRanges=li(s)}function gp(e,n,t,r){e.customDecorations||(e.customDecorations=[]);const{customDecorations:s}=e;ci(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=t,l.endIndex+=t)}const i=[];if(n.customDecorations){for(let o=0,a=n.customDecorations.length;o<a;o++){const l=n.customDecorations[o];l.startIndex+=r,l.endIndex+=r,i.push(l)}s.push(...i)}e.customDecorations=Nl(s)}function Ml(e,n,t){const{textRuns:r}=e,s=t,i=t+n,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{st:u,ed:f}=h;if(s<=u&&i>=f){o.push({...h,st:u-s,ed:f-s});continue}else u<=s&&f>=i?(o.push({...h,st:s-s,ed:i-s}),h.ed-=n):s>=u&&s<f?(o.push({...h,st:s-s,ed:f-s}),h.ed=s):i>u&&i<=f?(o.push({...h,st:u-s,ed:i-s}),h.st=i-n,h.ed-=n):u>=i&&(h.st-=n,h.ed-=n);a.push(h)}e.textRuns=a}return o.length===0&&o.push({st:0,ed:n,ts:{}}),o}function Dl(e,n,t){const{paragraphs:r}=e,s=t,i=t+n,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-t});continue}else u>=i&&(h.startIndex-=n);a.push(h)}e.paragraphs=a}return o}function Ll(e,n,t){const{sectionBreaks:r}=e,s=t,i=t+n-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-t});continue}else u>i&&(h.startIndex-=n);a.push(h)}e.sectionBreaks=a}return o}function Ul(e,n,t){const{customBlocks:r}=e,s=t,i=t+n-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-t});continue}else u>i&&(h.startIndex-=n);a.push(h)}e.customBlocks=a}return o}function Pl(e,n,t){const{tables:r}=e,s=t,i=t+n-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u,endIndex:f}=h;if(s<=u&&i>=f){o.push({...h,startIndex:u-t,endIndex:f-t});continue}else if(u<=s&&f>=i){const g=Hr(u,f,s,i);if(g.length===0||(h.startIndex=g[0],h.endIndex=g[1],h.startIndex===h.endIndex))continue}else i<u&&(h.startIndex-=n,h.endIndex-=n);a.push(h)}e.tables=a}return o}function mp(e,n,t){const{customRanges:r}=e,s=t,i=t+n-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const h=r[l],{startIndex:u,endIndex:f}=h;if(u>=s&&f<=i){o.push(h);continue}else if(Math.max(s,u)<=Math.min(i,f)){const g=Hr(u,f,s,i);if(g.length===0)continue;h.startIndex=g[0],h.endIndex=g[1]}else i<u&&(h.startIndex-=n,h.endIndex-=n);a.push(h)}e.customRanges=li(a)}return o}function _p(e,n,t,r=!0){const{customDecorations:s}=e,i=t,o=t+n-1,a=[];if(s){const l=[];for(let c=0,h=s.length;c<h;c++){const u=s[c],{startIndex:f,endIndex:g}=u;if(f>=i&&g<=o){a.push(u);continue}else if(Math.max(i,f)<=Math.min(o,g)){const p=Hr(f,g,i,o);if(p.length===0)continue;u.startIndex=p[0],u.endIndex=p[1]}else o<f&&r&&(u.startIndex-=n,u.endIndex-=n);l.push(u)}e.customDecorations=l}return a}var kl=(e=>(e[e.character=0]="character",e[e.paragraph=1]="paragraph",e[e.table=2]="table",e[e.numbering=3]="numbering",e))(kl||{}),Fl=(e=>(e[e.TAB=0]="TAB",e[e.SPACE=1]="SPACE",e[e.NOTHING=2]="NOTHING",e))(Fl||{}),Se=(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))(Se||{}),tr=(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))(tr||{}),nr=(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))(nr||{}),fn=(e=>(e[e.COMMENT=0]="COMMENT",e[e.DELETED=9999]="DELETED",e))(fn||{}),$l=(e=>(e[e.DRAWING=0]="DRAWING",e[e.CUSTOM=1]="CUSTOM",e))($l||{}),xl=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRADITIONAL=1]="TRADITIONAL",e[e.MODERN=2]="MODERN",e))(xl||{}),Hl=(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))(Hl||{}),Bl=(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))(Bl||{}),jl=(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))(jl||{}),Wl=(e=>(e[e.NORMAL=0]="NORMAL",e[e.TBRL=1]="TBRL",e[e.LRTBV=2]="LRTBV",e))(Wl||{}),Yl=(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))(Yl||{}),zl=(e=>(e[e.BOTH_SIDES=0]="BOTH_SIDES",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.LARGEST=3]="LARGEST",e))(zl||{}),Vl=(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))(Vl||{}),Gl=(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))(Gl||{}),Kl=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(Kl||{}),Xl=(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))(Xl||{}),Ql=(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))(Ql||{}),Jl=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SPECIFIED=1]="SPECIFIED",e))(Jl||{}),Zl=(e=>(e[e.START=0]="START",e[e.CENTER=1]="CENTER",e[e.END=2]="END",e))(Zl||{}),ql=(e=>(e[e.AUTO_FIT=0]="AUTO_FIT",e[e.FIXED=1]="FIXED",e))(ql||{}),eu=(e=>(e[e.NONE=0]="NONE",e[e.WRAP=1]="WRAP",e))(eu||{}),tu=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(tu||{}),nu=(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))(nu||{}),wn=(e=>(e.NORMAL="normal",e.BOLD="bold",e.ITALIC="italic",e))(wn||{}),ru=(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))(ru||{}),su=(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))(su||{}),iu=(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))(iu||{}),ou=(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))(ou||{}),au=(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))(au||{}),lu=(e=>(e[e.compressPunctuation=0]="compressPunctuation",e[e.compressPunctuationAndJapaneseKana=1]="compressPunctuationAndJapaneseKana",e[e.doNotCompress=2]="doNotCompress",e))(lu||{}),uu=(e=>(e[e.PORTRAIT=0]="PORTRAIT",e[e.LANDSCAPE=1]="LANDSCAPE",e))(uu||{}),cu=(e=>(e[e.forward=0]="forward",e[e.backward=1]="backward",e[e.front=2]="front",e[e.back=3]="back",e))(cu||{}),hu=(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))(hu||{}),hi=(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))(hi||{}),du=(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))(du||{}),fu=(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))(fu||{}),gu=(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))(gu||{}),Ft=(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))(Ft||{});const Vr={"a)":{glyphFormat:"%1)",glyphType:Se.DECIMAL},"1.":{glyphFormat:"%1.",glyphType:Se.DECIMAL},"a.":{glyphFormat:"%1.",glyphType:Se.LOWER_LETTER},"A.":{glyphFormat:"%1.",glyphType:Se.UPPER_LETTER},"i.":{glyphFormat:"%1.",glyphType:Se.LOWER_ROMAN},"I.":{glyphFormat:"%1.",glyphType:Se.UPPER_LETTER}},bn=e=>[...e,...e,...e].map((n,t)=>({glyphFormat:` %${t+1}`,glyphSymbol:n,bulletAlignment:tr.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*t}}})),An=e=>e.map((n,t)=>({...n,bulletAlignment:tr.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*t}}})),mu=(e,n)=>new Array(9).fill(0).map((t,r)=>({glyphFormat:` %${r+1}`,glyphSymbol:e,bulletAlignment:tr.START,textStyle:{fs:16},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*r},textStyle:n}})),rr={BULLET_LIST:{listType:"BULLET_LIST",nestingLevel:bn(["●","○","■"])},BULLET_LIST_1:{listType:"BULLET_LIST",nestingLevel:bn(["❖","➢","■"])},BULLET_LIST_2:{listType:"BULLET_LIST",nestingLevel:bn(["✔","●","◆"])},BULLET_LIST_3:{listType:"BULLET_LIST",nestingLevel:bn(["■","◆","○"])},BULLET_LIST_4:{listType:"BULLET_LIST",nestingLevel:bn(["✧","○","■"])},BULLET_LIST_5:{listType:"BULLET_LIST",nestingLevel:bn(["➢","○","◆"])},ORDER_LIST:{listType:"ORDER_LIST",nestingLevel:An([{glyphFormat:"%1.",glyphType:Se.DECIMAL},{glyphFormat:"%2.",glyphType:Se.LOWER_LETTER},{glyphFormat:"%3.",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Se.DECIMAL},{glyphFormat:"%5.",glyphType:Se.LOWER_LETTER},{glyphFormat:"%6.",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Se.DECIMAL},{glyphFormat:"%8.",glyphType:Se.LOWER_LETTER},{glyphFormat:"%9.",glyphType:Se.LOWER_ROMAN}])},ORDER_LIST_1:{listType:"ORDER_LIST",nestingLevel:An([{glyphFormat:"%1)",glyphType:Se.DECIMAL},{glyphFormat:"%2)",glyphType:Se.LOWER_LETTER},{glyphFormat:"%3)",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%4)",glyphType:Se.DECIMAL},{glyphFormat:"%5)",glyphType:Se.LOWER_LETTER},{glyphFormat:"%6)",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%7)",glyphType:Se.DECIMAL},{glyphFormat:"%8)",glyphType:Se.LOWER_LETTER},{glyphFormat:"%9)",glyphType:Se.LOWER_ROMAN}])},ORDER_LIST_2:{listType:"ORDER_LIST",nestingLevel:An(["%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:Se.DECIMAL})))},ORDER_LIST_3:{listType:"ORDER_LIST",nestingLevel:An([{glyphFormat:"%1.",glyphType:Se.UPPER_LETTER},{glyphFormat:"%2.",glyphType:Se.LOWER_LETTER},{glyphFormat:"%3.",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Se.UPPER_LETTER},{glyphFormat:"%5.",glyphType:Se.LOWER_LETTER},{glyphFormat:"%6.",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Se.UPPER_LETTER},{glyphFormat:"%8.",glyphType:Se.LOWER_LETTER},{glyphFormat:"%9.",glyphType:Se.LOWER_ROMAN}])},ORDER_LIST_4:{listType:"ORDER_LIST",nestingLevel:An([{glyphFormat:"%1.",glyphType:Se.UPPER_LETTER},{glyphFormat:"%2.",glyphType:Se.DECIMAL},{glyphFormat:"%3.",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Se.UPPER_LETTER},{glyphFormat:"%5.",glyphType:Se.DECIMAL},{glyphFormat:"%6.",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Se.UPPER_LETTER},{glyphFormat:"%8.",glyphType:Se.DECIMAL},{glyphFormat:"%9.",glyphType:Se.LOWER_ROMAN}])},ORDER_LIST_5:{listType:"ORDER_LIST",nestingLevel:An([{glyphFormat:"%1.",glyphType:Se.DECIMAL_ZERO},{glyphFormat:"%2.",glyphType:Se.LOWER_LETTER},{glyphFormat:"%3.",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:Se.DECIMAL_ZERO},{glyphFormat:"%5.",glyphType:Se.LOWER_LETTER},{glyphFormat:"%6.",glyphType:Se.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:Se.DECIMAL_ZERO},{glyphFormat:"%8.",glyphType:Se.LOWER_LETTER},{glyphFormat:"%9.",glyphType:Se.LOWER_ROMAN}])},CHECK_LIST:{listType:"CHECK_LIST",nestingLevel:mu("☐")},CHECK_LIST_CHECKED:{listType:"CHECK_LIST_CHECKED",nestingLevel:mu("☑",{st:{s:Te.TRUE}})}},Gr=e=>{const{glyphFormat:n,glyphType:t}=e,r=K.deepClone(rr.ORDER_LIST);return r.nestingLevel[0].glyphFormat=n,r.nestingLevel[0].glyphType=t,r},pp={ORDER_LIST_QUICK_2:Gr(Vr["a)"]),ORDER_LIST_QUICK_3:Gr(Vr["a."]),ORDER_LIST_QUICK_4:Gr(Vr["i."]),ORDER_LIST_QUICK_6:Gr(Vr["I."])};Object.assign(rr,pp);const Ep={"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 Cp(e,n,t,r,s){const i=vp(e,n,t,r,s),o=Rp(e,n,t,r,s),a=Ip(e,n,t,r,s),l=Sp(e,n,t,r,s),c=Op(e,n,t,r,s),h=yp(e,n,t,r),u=wp(e,n,t,r,s);return{dataStream:"",textRuns:i,paragraphs:o,sectionBreaks:a,customBlocks:l,tables:c,customRanges:h,customDecorations:u}}function vp(e,n,t,r,s){const{textRuns:i}=e,{textRuns:o}=n;if(i==null||o==null)return;const a=Ml(e,t,r);if(s!==De.REPLACE){const l=_u(o,a,s);n.textRuns=l}return Sl(e,n,t,r),a}function _u(e,n,t){if(n.length===0)return e;e=K.deepClone(e),n=K.deepClone(n);const r=[],s=e.length,i=n.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:g,ed:p,ts:C}=e[o],{st:I,ed:S,ts:D,sId:U}=n[a];let B;if(t===De.COVER?B={...D,...C}:B={...C},p<I)c()||r.push(e[o]),o++;else if(S<g)c()||r.push(n[a]),a++;else{const w={st:Math.min(g,I),ed:Math.max(g,I),ts:g<I?{...C}:{...D},sId:g<I?void 0:U};w.ed>w.st&&r.push(w),r.push({st:Math.max(g,I),ed:Math.min(p,S),ts:B,sId:U}),p<S?(o++,n[a].st=p,n[a].st===n[a].ed&&a++):(a++,e[o].st=S,e[o].st===e[o].ed&&o++);const b={st:Math.min(p,S),ed:Math.max(p,S),ts:p<S?{...D}:{...C},sId:p<S?U:void 0};l=b.ed>b.st?b:null}}c();const h=r[r.length-1],u=e[s-1],f=n[i-1];return h&&h.ed!==Math.max(u.ed,f.ed)&&(u.ed>f.ed?r.push(u):r.push(f)),er(r)}function Rp(e,n,t,r,s){const{paragraphs:i}=e,{paragraphs:o}=n;if(i==null||o==null)return;const a=Dl(e,t,r);if(s!==De.REPLACE){const l=[];for(const c of o){const{startIndex:h,paragraphStyle:u,bullet:f}=c;let g=[];for(const p of a){const{startIndex:C,paragraphStyle:I,bullet:S}=p;let D,U;if(s===De.COVER?(D={...I,...u},U={listId:"",listType:Ft.BULLET_LIST,nestingLevel:0,textStyle:{},...S,...f}):(D={...u,...I},U={listId:"",listType:Ft.BULLET_LIST,nestingLevel:0,textStyle:{},...f,...S}),h===C){g.push({startIndex:h,paragraphStyle:D,bullet:U});break}}l.push(...g),g=[]}n.paragraphs=l}return Ol(e,n,t,r),a}function Ip(e,n,t,r,s){const{sectionBreaks:i}=e,{sectionBreaks:o}=n;if(i==null||o==null)return;const a=Ll(e,t,r);if(s!==De.REPLACE){const l=[];for(const c of o){const{startIndex:h}=c;let u=[];for(const f of a){const{startIndex:g}=f;if(h===g){s===De.COVER?u.push({...f,...c}):u.push({...c,...f});break}}l.push(...u),u=[]}n.sectionBreaks=l}return yl(e,n,t,r),a}function Sp(e,n,t,r,s){const{customBlocks:i}=e,{customBlocks:o}=n;if(i==null||o==null)return;const a=Ul(e,t,r);if(s!==De.REPLACE){const l=[];for(const c of o){const{startIndex:h}=c;let u=[];for(const f of a){const{startIndex:g}=f;if(h===g){s===De.COVER?u.push({...f,...c}):u.push({...c,...f});break}}l.push(...u),u=[]}n.customBlocks=l}return wl(e,n,t,r),a}function Op(e,n,t,r,s){const{tables:i}=e,{tables:o}=n;if(i==null||o==null)return;const a=Pl(e,t,r);if(s!==De.REPLACE){const l=[];for(const c of o){const{startIndex:h,endIndex:u}=c;let f=[];for(const g of a){const{startIndex:p,endIndex:C}=g;if(p>=h&&C<=u){s===De.COVER?f.push({...g,...c}):f.push({...c,...g});break}}l.push(...f),f=[]}n.tables=l}return bl(e,n,t,r),a}function yp(e,n,t,r,s){e.customRanges||(e.customRanges=[]),ui(e.customRanges,r),ui(e.customRanges,r+t);const i=r,o=r+t-1,{customRanges:a}=n,l=[],c=new Map;e.customRanges.forEach(u=>{const{startIndex:f,endIndex:g}=u;f>=i&&g<=o?c.set(u.rangeId,u):l.push(u)});const h=[];return a?(a.forEach(u=>{const{startIndex:f,endIndex:g}=u;l.push({...u,startIndex:f+r,endIndex:g+r})}),e.customRanges=li(l),h):[]}function wp(e,n,t,r,s){e.customDecorations||(e.customDecorations=[]),ci(e.customDecorations,r),ci(e.customDecorations,r+t);const i=[],{customDecorations:o}=e,{customDecorations:a=[]}=n;if(s===De.REPLACE){for(let l=0;l<o.length;l++){const c=o[l],{startIndex:h,endIndex:u}=c;h>=r&&u<=r+t-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=Nl(o),i}var di=(e=>(e[e.copy=0]="copy",e[e.cut=1]="cut",e))(di||{});function en(e,n,t,r=!0,s=1){const{dataStream:i,textRuns:o,paragraphs:a=[],customBlocks:l=[],tables:c=[],sectionBreaks:h=[]}=e,u={dataStream:i.slice(n,t)};if(o){const S=[];for(const D of o){const U=K.deepClone(D),{st:B,ed:w}=U;K.hasIntersectionBetweenTwoRanges(B,w,n,t)&&(n>=B&&n<=w?S.push({...U,st:n,ed:Math.min(t,w)}):t>=B&&t<=w?S.push({...U,st:Math.max(n,B),ed:t}):S.push(U))}u.textRuns=er(S.map(D=>{const{st:U,ed:B}=D;return{...D,st:U-n,ed:B-n}}))}else r&&(u.textRuns=[{st:0,ed:t-n,ts:{}}]);const f=[];for(const S of c){const D=K.deepClone(S),{startIndex:U,endIndex:B}=D;U>=n&&B<=t&&f.push({...D,startIndex:U-n,endIndex:B-n})}f.length&&(u.tables=f);const g=[];for(const S of a){const{startIndex:D}=S;D>=n&&D<t&&g.push(K.deepClone(S))}g.length&&(u.paragraphs=g.map(S=>({...S,startIndex:S.startIndex-n})));const p=[];for(const S of h){const{startIndex:D}=S;D>=n&&D<=t&&p.push(K.deepClone(S))}if(p.length&&(u.sectionBreaks=p.map(S=>({...S,startIndex:S.startIndex-n}))),s===1){const S=Eu(e,n,t);S?u.customDecorations=S:r&&(u.customDecorations=[])}const{customRanges:C}=pu(e,n,t);C?u.customRanges=C:r&&(u.customRanges=[]);const I=[];for(const S of l){const{startIndex:D}=S;D>=n&&D<=t&&I.push(K.deepClone(S))}return I.length&&(u.customBlocks=I.map(S=>({...S,startIndex:S.startIndex-n}))),u}function bp(e){const{dataStream:n,textRuns:t,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>n.length-1&&(l=Math.max(l,h.endIndex-n.length+1))});const c=`${n}`;return t&&(t[0]&&(t[0].st=t[0].st-a),t[t.length-1]&&(t[t.length-1].ed=t[t.length-1].ed+l)),t==null||t.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:t,paragraphs:r,customRanges:s,customDecorations:i,tables:o}}function pu(e,n,t){if(e.customRanges==null)return{};const{customRanges:r}=e;return{customRanges:r.filter(a=>Math.max(a.startIndex,n)<=Math.min(a.endIndex,t-1)).map(a=>({...a,startIndex:Math.max(a.startIndex,n),endIndex:Math.min(a.endIndex,t-1)})).map(a=>({...a,startIndex:a.startIndex-n,endIndex:a.endIndex-n})),leftOffset:0,rightOffset:0}}function Eu(e,n,t){if(e.customDecorations==null)return;const{customDecorations:r=[]}=e,s=[];return r.forEach(i=>{if(Math.max(i.startIndex,n)<=Math.min(i.endIndex,t-1)){const o=K.deepClone(i);s.push({...o,startIndex:Math.max(o.startIndex-n,0),endIndex:Math.min(o.endIndex,t-1)-n})}}),s}function Ap(e,n,t){return e==null||n==null?e!=null?e:n:_u(e,n,t)}function Tp(e,n,t){if(e==null||n==null)return e!=null?e:n;if(n.length===0||e.length===0)return e;if(n.length>1||e.length>1)throw new Error("Cannot cover multiple customRanges");return t===De.REPLACE?[{...e[0]}]:[{...n[0],...e[0]}]}function Np(e,n,t){return n.length===0||e.length===0||t===De.REPLACE?e:[...e,...n.filter(r=>!e.some(s=>r.id===s.id))]}function fi(e,n,t=De.COVER){if(n.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=[]}=n;r.textRuns=Ap(l,s,t),r.customRanges=Tp(h,o,t);const f=Np(u,a,t);f.length&&(r.customDecorations=f);const g=[];let p=0,C=0;for(;p<i.length&&C<c.length;){const I=i[p],S=c[C],{startIndex:D}=I,{startIndex:U}=S;D===U?(g.push(K.deepMerge(I,S)),p++,C++):D<U?(g.push(K.deepClone(I)),p++):(g.push(K.deepClone(S)),C++)}return p<i.length&&g.push(...i.slice(p)),C<c.length&&g.push(...c.slice(C)),g.length&&(r.paragraphs=g),r}function Mp(e){const{body:n}=e;if(n==null)return!0;const{textRuns:t,paragraphs:r,customRanges:s,customBlocks:i,customDecorations:o,tables:a}=n;return t==null&&r==null&&s==null&&i==null&&o==null&&a==null}class Tn{constructor(n){R(this,"_index",0);R(this,"_offset",0);this._actions=n}hasNext(){return this.peekLength()<Number.POSITIVE_INFINITY}next(n){n||(n=Number.POSITIVE_INFINITY);const t=this._actions[this._index];if(t){const r=this._offset,s=t.len;return n>=s-r?(n=s-r,this._index+=1,this._offset=0):this._offset+=n,t.t===oe.DELETE||t.t===oe.RETAIN&&t.body==null?K.deepClone({...t,len:n}):K.deepClone({...t,len:n,body:en(t.body,r,r+n,!1)})}else return{t:oe.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 n=this._actions[this._index];return n?n.t:oe.RETAIN}rest(){if(this.hasNext()){if(this._offset===0)return this._actions.slice(this._index);{const n=this._offset,t=this._index,r=this.next(),s=this._actions.slice(this._index);return this._offset=n,this._index=t,[r].concat(s)}}else return[]}}function Cu(e,n,t){const{dataStream:r}=e,s=t,i=t+n,o=Ml(e,n,t),a=Dl(e,n,t),l=Ll(e,n,t),c=Ul(e,n,t),h=Pl(e,n,t),u=mp(e,n,t),f=_p(e,n,t);let g="";return r&&(e.dataStream=ll(r,s,i),g=r.slice(s,i)),{dataStream:g,textRuns:o,paragraphs:a,sectionBreaks:l,customBlocks:c,tables:h,customRanges:u,customDecorations:f}}function vu(e,n,t,r){e.dataStream=al(e.dataStream,r,n.dataStream),Sl(e,n,t,r),Ol(e,n,t,r),yl(e,n,t,r),wl(e,n,t,r),bl(e,n,t,r),fp(e,n,t,r),gp(e,n,t,r)}function Dp(e,n,t,r,s=De.COVER){return Cp(e,n,t,r,s)}function Lp(e,n,t){return n<=0?{dataStream:""}:Cu(e,n,t)}function Up(e,n,t,r){t!==0&&vu(e,n,t,r)}function Pp(e,n){const t=new On;return t.reset(),n.forEach(r=>{const s=K.deepClone(r);switch(s.t){case oe.RETAIN:{const{coverType:i,body:o,len:a}=s;o!=null&&Dp(e,o,a,t.cursor,i),t.moveCursor(a);break}case oe.INSERT:{const{body:i,len:o}=s;Up(e,i,o,t.cursor),t.moveCursor(o);break}case oe.DELETE:{const{len:i}=s;Lp(e,i,t.cursor);break}default:throw new Error(`Unknown action type for action: ${s}.`)}}),e}function kp(e,n,t,r,s){if(e==null||n==null)return n;if(e.length===0||n.length===0)return[];n=K.deepClone(n),e=K.deepClone(e);const i=[],o=n.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:C,ed:I,ts:S}=n[l],{st:D,ed:U,ts:B,sId:w}=e[c];let b={};if(s===0)b={...S},t===De.COVER&&r===De.REPLACE&&B&&(b=Object.assign({},B,b));else if(b={...S},t===De.REPLACE){if(r===De.REPLACE)b={...B};else if(S&&B){const P=Object.keys(S);for(const W of P)B[W]&&delete b[W]}}else if(r===De.REPLACE){if(B){const P=Object.keys(B);for(const W of P)B[W]!==void 0&&(b[W]=B[W])}}else if(B){const P=Object.keys(B);for(const W of P)b[W]!==void 0&&delete b[W]}if(I<D)u()||i.push(n[l]),l++;else if(U<C)u()||i.push(e[c]),c++;else{const P={st:Math.min(C,D),ed:Math.max(C,D),ts:C<D?{...S}:{...B},sId:C<D?void 0:w};P.ed>P.st&&i.push(),i.push({st:Math.max(C,D),ed:Math.min(I,U),ts:b,sId:w}),I<U?(l++,e[c].st=I,e[c].st===e[c].ed&&c++):(c++,n[l].st=U,n[l].st===n[l].ed&&l++);const W={st:Math.min(I,U),ed:Math.max(I,U),ts:I<U?{...B}:{...S},sId:I<U?w:void 0};h=W.ed>W.st?W:null}}u();const f=i[i.length-1],g=n[o-1],p=e[a-1];return f.ed!==Math.max(g.ed,p.ed)&&(g.ed>p.ed?i.push(g):i.push(p)),er(i,!0)}function Fp(e,n,t,r,s){if(e==null||n==null)return n;if(e.length===0||n.length===0)return[];if(e.length>1||n.length>1)throw new Error("CustomRanges is only supported transform for length one now.");const i=e[0],o=n[0];if(t===De.REPLACE)return s===1?[K.deepClone(i)]:[K.deepClone(o)];if(r===De.REPLACE){const a=K.deepClone(o);return s===1&&Object.assign(a,K.deepClone(i)),[a]}else{const a=K.deepClone(o);return s===1&&Object.assign(a,K.deepClone(i)),[a]}}function Ru(e,n,t,r,s){const i={startIndex:n.startIndex};if(n.paragraphStyle&&(i.paragraphStyle=K.deepClone(n.paragraphStyle),e.paragraphStyle)){if(t===De.REPLACE)if(r===De.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===De.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 t===De.REPLACE&&r===De.REPLACE?i.bullet=s===1?K.deepClone(e.bullet):K.deepClone(n.bullet):e.bullet===void 0?i.bullet=K.deepClone(n.bullet):t===De.REPLACE||r===De.REPLACE?i.bullet=s===0&&n.bullet?K.deepClone(n.bullet):K.deepClone(e.bullet):s===0&&n.bullet!==void 0&&(i.bullet=K.deepClone(n.bullet)),i}function $p(e,n){if(e==null||n==null)return n;if(e.length===0||n.length===0)return K.deepClone(n);const t=[];for(const r of n){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,t.push({...r,type:fn.DELETED}));break}o||t.push(r)}return t}function xp(e,n,t=!1){const{body:r,coverType:s=De.COVER}=e,{body:i,coverType:o=De.COVER}=n;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:f}=r,{textRuns:g,paragraphs:p=[],customRanges:C,customDecorations:I}=i,S=kp(c,g,s,o,t?1:0);S&&(a.textRuns=S);const D=Fp(u,C,s,o,t?1:0);D&&(a.customRanges=D);const U=$p(f,I);U&&(a.customDecorations=U);const B=[];let w=0,b=0;for(;w<h.length&&b<p.length;){const P=h[w],W=p[b],{startIndex:he}=P,{startIndex:ee}=W;if(he===ee){let ae={startIndex:he};t?ae=Ru(P,W,s,o,1):ae=Ru(P,W,s,o,0),B.push(ae),w++,b++}else he<ee?w++:(B.push(K.deepClone(W)),b++)}return b<p.length&&B.push(...p.slice(b)),B.length&&(a.paragraphs=B),{coverType:l,body:a}}function Iu(e){return Object.keys(e).length===1}const Ln=class Ln{constructor(){R(this,"_actions",[])}static apply(n,t){return Pp(n,t)}static compose(n,t){const r=new Tn(n),s=new Tn(t),i=new Ln;for(;r.hasNext()||s.hasNext();)if(s.peekType()===oe.INSERT)i.push(s.next());else if(r.peekType()===oe.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===oe.INSERT&&l.t===oe.RETAIN)l.body==null?i.push(a):i.push({...a,body:fi(a.body,l.body,l.coverType)});else if(a.t===oe.RETAIN&&l.t===oe.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===De.REPLACE||l.coverType===De.REPLACE?De.REPLACE:De.COVER;i.push({...a,t:oe.RETAIN,coverType:c,body:fi(a.body,l.body,l.coverType)})}else i.push(a.body?a:l);else a.t===oe.RETAIN&&l.t===oe.DELETE?i.push(l):a.t===oe.INSERT&&(l.t,oe.DELETE)}return i.trimEndUselessRetainAction(),i.serialize()}static transform(n,t,r="right"){return this._transform(t,n,r==="left"?"right":"left")}static _transform(n,t,r="right"){const s=new Tn(n),i=new Tn(t),o=new Ln;for(;s.hasNext()||i.hasNext();)if(s.peekType()===oe.INSERT&&(r==="left"||i.peekType()!==oe.INSERT)){const a=s.next();o.retain(a.len)}else if(i.peekType()===oe.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===oe.DELETE)continue;if(c.t===oe.DELETE){o.push(c);continue}if(l.body==null||c.body==null)o.push(c);else{const{coverType:h,body:u}=xp(l,c,r==="left");o.push({...c,t:oe.RETAIN,coverType:h,body:u})}}return o.trimEndUselessRetainAction(),o.serialize()}static transformPosition(n,t,r=!1){const s=new Tn(n);let i=0;for(;s.hasNext()&&i<=t;){const o=s.peekLength(),a=s.peekType();if(s.next(),a===oe.DELETE){t-=Math.min(o,t-i);continue}else a===oe.INSERT&&(i<t||!r)&&(t+=o);i+=o}return t}static isNoop(n){return n.length===0}static invert(n){const t=[];for(const r of n)if(r.t===oe.INSERT)t.push({t:oe.DELETE,len:r.len,body:r.body});else if(r.t===oe.DELETE){if(r.body==null)throw new Error("Can not invert DELETE action without body property, makeInvertible must be called first.");t.push({t:oe.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.");t.push({t:oe.RETAIN,body:r.oldBody,oldBody:r.body,len:r.len,coverType:De.REPLACE})}else t.push(r);return t}static makeInvertible(n,t){const r=[];let s=0;for(const i of n){if(i.t===oe.DELETE&&(i.body==null||i.body&&i.body.dataStream.length!==i.len)){const o=en(t,s,s+i.len,!1);i.len=o.dataStream.length,i.body=o}if(i.t===oe.RETAIN&&i.body!=null){const o=en(t,s,s+i.len,!0);i.oldBody={...o,dataStream:""},i.len=o.dataStream.length}r.push(i),i.t!==oe.INSERT&&(s+=i.len)}return r}insert(n,t){const r={t:oe.INSERT,body:t,len:n};return this.push(r),this}retain(n,t,r){const s={t:oe.RETAIN,len:n};return t!=null&&(s.body=t),r!=null&&(s.coverType=r),this.push(s),this}delete(n){const t={t:oe.DELETE,len:n};return this.push(t),this}empty(){return this._actions=[],this}serialize(){return this._actions}push(...n){if(n.length>1){for(const i of n)this.push(i);return this}let t=this._actions.length,r=this._actions[t-1];const s=K.deepClone(n[0]);if(s.t===oe.RETAIN&&s.len===0&&s.body==null)return this;if(typeof r=="object"){if(r.t===oe.DELETE&&s.t===oe.DELETE)return r.len+=s.len,this;if(r.t===oe.DELETE&&s.t===oe.INSERT&&(t-=1,r=this._actions[t-1],r==null))return this._actions.unshift(s),this;if(r.t===oe.RETAIN&&s.t===oe.RETAIN&&r.body==null&&s.body==null)return r.len+=s.len,this;if(r.t===oe.INSERT&&Iu(r.body)&&s.t===oe.INSERT&&Iu(s.body))return r.len+=s.len,r.body.dataStream+=s.body.dataStream,this}return t===this._actions.length?this._actions.push(s):this._actions.splice(t,0,s),this}trimEndUselessRetainAction(){let n=this._actions[this._actions.length-1];for(;n&&n.t===oe.RETAIN&&Mp(n);)this._actions.pop(),n=this._actions[this._actions.length-1];return this}};R(Ln,"id","text-x"),R(Ln,"uri","https://github.com/dream-num/univer#text-x");let st=Ln;Object.defineProperty(st,"name",{value:"text-x"});const Un=class Un{static registerSubtype(n){var t;n==null||this._subTypes.has(n.name)&&((t=this._subTypes.get(n.name))==null?void 0:t.id)!==st.id||(this._subTypes.set(n.name,n),gt.type.registerSubtype(n))}static apply(n,t){if(!gt.type.isNoop(t))return gt.type.apply(n,t)}static compose(n,t){return gt.type.compose(n,t)}static transform(n,t,r){return gt.type.transform(n,t,r)}static transformPosition(n,t,r="right"){return n&&n.length===2&&n[0]==="body"&&n[1].et===st.name?st.transformPosition(n[1].e,t,r==="left"):t}static invertWithDoc(n,t){return gt.type.invertWithDoc(n,t)}static isNoop(n){return gt.type.isNoop(n)}static getInstance(){return this._instance==null&&(this._instance=new Un),this._instance}removeOp(n,t){return gt.removeOp(n,t)}moveOp(n,t){return gt.moveOp(n,t)}insertOp(n,t){return gt.insertOp(n,t)}replaceOp(n,t,r){return gt.replaceOp(n,t,r)}editOp(n,t=["body"]){return gt.editOp(t,st.name,n)}};R(Un,"uri","https://github.com/dream-num/univer#json-x"),R(Un,"_subTypes",new Map),R(Un,"_instance",null);let gn=Un;gn.registerSubtype(st);const gi={id:"default_doc",documentStyle:{}};class Hp extends Yr{constructor(t){var r;super();R(this,"type",$e.UNIVER_DOC);R(this,"_name$",new ce.BehaviorSubject(""));R(this,"name$",this._name$.asObservable());R(this,"snapshot");this.snapshot={...gi,...t},this._name$.next((r=this.snapshot.title)!=null?r:"No Title")}getUnitId(){throw new Error("Method not implemented.")}getRev(){var t;return(t=this.snapshot.rev)!=null?t:1}incrementRev(){this.snapshot.rev=this.getRev()+1}setRev(t){this.snapshot.rev=t}setName(t){this.snapshot.title=t,this._name$.next(t)}get drawings(){return this.snapshot.drawings}get documentStyle(){return this.snapshot.documentStyle}get lists(){return this.snapshot.lists}get zoomRatio(){var t;return((t=this.snapshot.settings)==null?void 0:t.zoomRatio)||1}resetDrawing(t,r){this.snapshot.drawings=t,this.snapshot.drawingsOrder=r}getBody(){return this.snapshot.body}getSnapshot(){return this.snapshot}getBulletPresetList(){var s;const t=(s=this.snapshot.lists)!=null?s:{};return{...rr,...t}}updateDocumentId(t){this.snapshot.id=t}updateDocumentRenderConfig(t){const{documentStyle:r}=this.snapshot;r.renderConfig==null?r.renderConfig=t:r.renderConfig={...r.renderConfig,...t}}updateDocumentStyle(t){this.snapshot.documentStyle==null?this.snapshot.documentStyle=t:this.snapshot.documentStyle={...this.snapshot.documentStyle,...t}}updateDocumentDataMargin(t){const{t:r,l:s,b:i,r:o}=t,{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(t,r){const{documentStyle:s}=this.snapshot;if(!s.pageSize){t=t!=null?t:Number.POSITIVE_INFINITY,r=r!=null?r:Number.POSITIVE_INFINITY,s.pageSize={width:t,height:r};return}t!==void 0&&(s.pageSize.width=t),r!==void 0&&(s.pageSize.height=r)}updateDrawing(t,r){const{drawings:s}=this,{width:i,height:o,left:a,top:l}=r,c=s==null?void 0:s[t];if(!c)return;const h=c.docTransform;h.size.width=i,h.size.height=o,h.positionH.posOffset=a,h.positionV.posOffset=l}setZoomRatio(t=1){this.snapshot.settings==null?this.snapshot.settings={zoomRatio:t}:this.snapshot.settings.zoomRatio=1}}class Yt extends Hp{constructor(t){var s,i;super(K.isEmptyObject(t)?ap():t);R(this,"_unitId");R(this,"headerModelMap",new Map);R(this,"footerModelMap",new Map);const r=6;this._unitId=(s=this.snapshot.id)!=null?s:K.generateRandomId(r),this._initializeHeaderFooterModel(),this._name$.next((i=this.snapshot.title)!=null?i:"")}dispose(){super.dispose(),this.headerModelMap.forEach(t=>{t.dispose()}),this.footerModelMap.forEach(t=>{t.dispose()}),this._name$.complete()}getDrawings(){return this.snapshot.drawings}getDrawingsOrder(){return this.snapshot.drawingsOrder}getCustomRanges(){var t;return(t=this.snapshot.body)==null?void 0:t.customRanges}getCustomDecorations(){var t;return(t=this.snapshot.body)==null?void 0:t.customDecorations}getSettings(){return this.snapshot.settings}reset(t){if(t.id&&t.id!==this._unitId)throw new Error("Cannot reset a document model with a different unit id!");this.snapshot={...gi,...t},this._initializeHeaderFooterModel()}getSelfOrHeaderFooterModel(t){if(t!=null){if(this.headerModelMap.has(t))return this.headerModelMap.get(t);if(this.footerModelMap.has(t))return this.footerModelMap.get(t)}return this}getUnitId(){return this._unitId}apply(t){if(!gn.isNoop(t))return this.snapshot=gn.apply(this.snapshot,t),t!=null&&t.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(t,r,s=di.copy){const i=this.getBody();if(i!=null)return en(i,t,r,!1,s)}_initializeHeaderFooterModel(){const{headers:t,footers:r}=this.getSnapshot();if(t)for(const s in t){const i=t[s];this.headerModelMap.set(s,new Yt(i)),this.headerModelMap.get(s).updateDocumentId(this.getUnitId())}if(r)for(const s in r){const i=r[s];this.footerModelMap.set(s,new Yt(i)),this.footerModelMap.get(s).updateDocumentId(this.getUnitId())}}updateDocumentId(t){super.updateDocumentId(t),this._unitId=t}}const Bp="0.5.0-beta.1";function jp(e="",n=Qn.ZH_CN,t=""){return{id:e,sheetOrder:[],name:t,appVersion:Bp,locale:n,styles:{},sheets:{},resources:[]}}class Su{constructor(n={}){R(this,"_styles");R(this,"_cacheMap",new Br(1e5));this._styles=n,this._generateCacheMap()}each(n){return Object.entries(this._styles).forEach(n),this}search(n,t){if(this._cacheMap.has(t))return this._cacheMap.get(t);const r=this._getExistingStyleId(n);return r||"-1"}get(n){return typeof n!="string"?n:(n=String(n),this._styles[n])}add(n,t){const r=K.generateRandomId(6);return this._styles[r]=n,this._cacheMap.set(t,r),r}setValue(n){if(n==null)return;const t=JSON.stringify(n),r=this.search(n,t);return r!=="-1"?r:this.add(n,t)}toJSON(){return this._styles}getStyleByCell(n){let t;n&&K.isObject(n.s)?t=n.s:t=(n==null?void 0:n.s)&&this.get(n.s);const r=n==null?void 0:n.interceptorStyle;return r?{...t,...r}:t}_generateCacheMap(){const{_styles:n,_cacheMap:t}=this;for(const r in n){const s=JSON.stringify(n[r]);t.set(s,r)}}_getExistingStyleId(n){const{_styles:t}=this;for(const r in t)if(K.diffValue(t[r],n))return r;return null}}function Wp(e){const{ranges:n,id:t,type:r}=e,s=new st;let i=0;for(let o=0;o<n.length;o++){const a=n[o],{startOffset:l,endOffset:c}=a;l>0&&s.push({t:oe.RETAIN,len:l-i}),s.push({t:oe.RETAIN,body:{dataStream:"",customDecorations:[{id:t,type:r,startIndex:0,endIndex:c-l-1}]},len:c-l}),i=c}return s}function Yp(e){var h,u,f;const{id:n,segmentId:t,documentDataModel:r}=e,s=r==null?void 0:r.getBody();if(!r||!s)return!1;const i=(f=(u=(h=r.getSelfOrHeaderFooterModel(t))==null?void 0:h.getBody())==null?void 0:u.customDecorations)==null?void 0:f.find(g=>g.id===n);if(!i)return!1;const o=new st,{startIndex:a,endIndex:l}=i,c=l-a+1;return o.push({t:oe.RETAIN,len:a}),o.push({t:oe.RETAIN,len:c,body:{dataStream:"",customDecorations:[{startIndex:0,endIndex:c-1,id:n,type:fn.DELETED}]}}),o}function Ou(e,n,t,r){return e<=t&&n>=t||e>=t&&e<=r}function zp(e,n){const t=[];for(let r=0,s=n.length;r<s;r++){const i=n[r];e.collapsed?i.startIndex<e.startOffset&&e.startOffset<=i.endIndex&&t.push(i):Ou(e.startOffset,e.endOffset-1,i.startIndex,i.endIndex)&&t.push(i)}return t}function Vp(e){return{...K.deepClone(e),rangeId:cn()}}function Gp(e,n){const t=[];let r=e[0];for(const s of n)s<e[0]||s>e[1]||(r<s&&t.push([r,s-1]),r=s+1);return r<=e[1]&&t.push([r,e[1]]),t}function yu(e,n,t,r){const s=[];for(let i=0,o=t.length;i<o;i++){const a=t[i];if((r===void 0||a.rangeType===r)&&Math.max(a.startIndex,e)<=Math.min(a.endIndex,n)&&s.push({...a}),a.startIndex>n)break}return s}function Kp(e,n){var i,o,a,l,c;const t=yu(e.startOffset,e.collapsed?e.startOffset:e.endOffset-1,(i=n.customRanges)!=null?i:[]),r=Math.min(e.startOffset,(a=(o=t[0])==null?void 0:o.startIndex)!=null?a:1/0),s=Math.max(e.endOffset,((c=(l=t[t.length-1])==null?void 0:l.endIndex)!=null?c:-1/0)+1);return{startOffset:r,endOffset:s,collapsed:r===s}}const Xp=e=>{var u,f,g;const{paragraphs:n,segmentId:t,document:r}=e;let s=e.listType;const i=(f=(u=r.getSelfOrHeaderFooterModel(t).getBody())==null?void 0:u.paragraphs)!=null?f:[],o=n.every(p=>{var C;return((C=p.bullet)==null?void 0:C.listType.indexOf(s))===0});let l=K.generateRandomId(6);if(n.length===1){const p=i.indexOf(n[0]),C=i[p-1],I=i[p+1];C&&C.bullet&&C.bullet.listType.indexOf(s)===0?(l=C.bullet.listId,s!==Ft.CHECK_LIST&&(s=C.bullet.listType)):I&&I.bullet&&I.bullet.listType.indexOf(s)===0&&(l=I.bullet.listId,s!==Ft.CHECK_LIST&&(s=I.bullet.listType))}const c=new On;c.reset();const h=new st;for(const p of n){const{startIndex:C,paragraphStyle:I={},bullet:S}=p;h.push({t:oe.RETAIN,len:C-c.cursor}),h.push({t:oe.RETAIN,len:1,body:{dataStream:"",paragraphs:[o?{paragraphStyle:I,startIndex:0}:{startIndex:0,paragraphStyle:{...I},bullet:{nestingLevel:(g=S==null?void 0:S.nestingLevel)!=null?g:0,textStyle:{fs:20},listType:s,listId:l}}]},coverType:De.REPLACE}),c.moveCursorTo(C+1)}return h},Qp=e=>{var u;const{paragraphIndex:n,segmentId:t,document:r}=e,s=(u=r.getSelfOrHeaderFooterModel(t).getBody())==null?void 0:u.paragraphs;if(s==null)return!1;const i=s.find(f=>f.startIndex===n);if(!(i!=null&&i.bullet)||i.bullet.listType.indexOf(Ft.CHECK_LIST)===-1)return!1;const o=new On;o.reset();const a=new st,{startIndex:l,paragraphStyle:c={}}=i,h=i.bullet.listType===Ft.CHECK_LIST?Ft.CHECK_LIST_CHECKED:Ft.CHECK_LIST;return a.push({t:oe.RETAIN,len:l-o.cursor}),a.push({t:oe.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...i,paragraphStyle:c,startIndex:0,bullet:{...i.bullet,listType:h}}]},coverType:De.REPLACE}),o.moveCursorTo(l+1),a},Jp=e=>{var h,u;const{paragraphs:n,listType:t,segmentId:r,document:s}=e;if(((h=s.getSelfOrHeaderFooterModel(r).getBody())==null?void 0:h.paragraphs)==null)return!1;const a=K.generateRandomId(6),l=new On;l.reset();const c=new st;for(const f of n){const{startIndex:g,paragraphStyle:p={},bullet:C}=f;c.push({t:oe.RETAIN,len:g-l.cursor}),c.push({t:oe.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:p,bullet:{nestingLevel:(u=C==null?void 0:C.nestingLevel)!=null?u:0,textStyle:(C==null?void 0:C.listType)===t?C.textStyle:{fs:20},listType:t,listId:a}}]},coverType:De.REPLACE}),l.moveCursorTo(g+1)}return c};function Zp(e,n){return n.some(t=>e.startIndex>t.startIndex&&e.startIndex<t.endIndex)}const qp=e=>{var h,u,f;const{paragraphs:n,segmentId:t,document:r,type:s}=e,i=new On;i.reset();const o=new st,a=(h=r.getSnapshot().lists)!=null?h:{},l=(f=(u=r.getBody())==null?void 0:u.tables)!=null?f:[],c={...rr,...a};for(const g of n){const{startIndex:p,paragraphStyle:C={},bullet:I}=g,S=Zp(g,l);if(o.push({t:oe.RETAIN,len:p-i.cursor}),I){const D=I.listType;let U=c[D].nestingLevel.length-1;S&&(U=Math.min(U,2)),o.push({t:oe.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:{...C},bullet:{...I,nestingLevel:Math.max(Math.min(I.nestingLevel+s,U),0)}}]},coverType:De.REPLACE})}else o.push({t:oe.RETAIN,len:1});i.moveCursorTo(p+1)}return o};var wu=(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))(wu||{}),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))(zt||{});function eE(e){return`${e}`}const tE=[zt.TABLE_START,zt.TABLE_ROW_START,zt.TABLE_CELL_START,zt.TABLE_CELL_END,zt.TABLE_ROW_END,zt.TABLE_END,zt.CUSTOM_BLOCK],bu=e=>{const n=e.endsWith(`\r
10
+ `)?e.slice(0,-2):e;return tE.reduce((t,r)=>t.replaceAll(r,""),n)},nE=e=>e?bu(e).replaceAll("\r","")==="":!0,rE=e=>{const n=e.replace(/\n/g,"\r"),t=[],r=[];let s=0,i="";const o=(l,c=!0)=>{const h=n.slice(s,l);if(K.isLegalUrl(h)){const u=cn(),f=`${h}`,g={startIndex:s,endIndex:s+f.length-1,rangeId:u,rangeType:nr.HYPERLINK,properties:{url:e}};r.push(g),i+=f,s=l+1,c&&(i+="\r",t.push({startIndex:l}))}else i+=n.slice(s,l+1),s=l+1,c&&t.push({startIndex:l})};let a=0;for(let l=0;l<n.length;l++)n[l]==="\r"&&(o(l),a=l);return a!==n.length-1&&o(n.length,!1),{dataStream:i,paragraphs:t,customRanges:r}};function sE(e,n){if(typeof n>"u")return{startOffset:e,endOffset:e,collapsed:!0};if(n<e)throw new Error(`Cannot make a doc selection when endOffset ${n} is less than startOffset ${e}.`);return{startOffset:e,endOffset:n,collapsed:e===n}}function iE(e){const{startOffset:n,endOffset:t,collapsed:r}=e,s=Math.min(n,t),i=Math.max(n,t);return{startOffset:s,endOffset:i,collapsed:r}}function oE(e,n,t,r){return Math.max(e,t)<=Math.min(n,r)}function aE(e,n){var f,g,p;const{rangeId:t,segmentId:r,documentDataModel:s,insert:i}=n,o=(g=(f=s.getSelfOrHeaderFooterModel(r).getBody())==null?void 0:f.customRanges)==null?void 0:g.find(C=>C.rangeId===t);if(!o)return!1;const{startIndex:a,endIndex:l}=o,c=new st,h=l-a+1;c.push({t:oe.RETAIN,len:a}),c.push({t:oe.RETAIN,len:h,body:{dataStream:"",customRanges:[]}}),i&&c.push({t:oe.INSERT,body:i,len:i.dataStream.length});const u=l+1+((p=i==null?void 0:i.dataStream.length)!=null?p:0);return c.selections=[{startOffset:u,endOffset:u,collapsed:!0}],c}function lE(e){var I,S;const{range:n,rangeId:t,rangeType:r,wholeEntity:s,properties:i,body:o}=e,a=Kp(n,o);if(!a||!o)return!1;const{startOffset:l,endOffset:c}=a,h=(I=o.customRanges)!=null?I:[];let u=0;const f=new st,g=(D,U,B)=>{var he,ee,ae,Ae;const w=yu(D,U,h,r),b=Math.min((ee=(he=w[0])==null?void 0:he.startIndex)!=null?ee:1/0,D),P=Math.max((Ae=(ae=w[w.length-1])==null?void 0:ae.endIndex)!=null?Ae:-1/0,U),W={rangeId:B?`${t}-${B}`:t,rangeType:r,startIndex:0,endIndex:P-b,wholeEntity:s,properties:{...i}};f.push({t:oe.RETAIN,len:b-u}),f.push({t:oe.RETAIN,len:P-b+1,body:{dataStream:"",customRanges:[W]},coverType:De.COVER}),u=P+1},p=((S=o.paragraphs)!=null?S:[]).filter(D=>D.startIndex<c&&D.startIndex>l);return Gp([l,c-1],p.map(D=>D.startIndex)).forEach(([D,U],B)=>g(D,U,B)),f.selections=[{startOffset:a.endOffset,endOffset:a.endOffset,collapsed:!0}],f}function uE(e,n,t=0,r=null,s=!0){e.sort((c,h)=>c.startOffset-h.startOffset);const i=[],{paragraphs:o=[]}=n,a=o==null?void 0:o.find(c=>c.startIndex>=e[0].startOffset&&c.startIndex<e[0].endOffset);let l=t;if(e.forEach(c=>{const{startOffset:h,endOffset:u}=c;h>l&&(i.push({t:oe.RETAIN,len:h-l}),l=h),l<u&&(i.push({t:oe.DELETE,len:u-l}),l=u)}),r&&i.push({t:oe.INSERT,body:r,len:r.dataStream.length}),a&&s){const c=o.find(h=>h.startIndex-t>=e[e.length-1].endOffset-1);c&&(c.startIndex>l&&(i.push({t:oe.RETAIN,len:c.startIndex-l}),l=c.startIndex),i.push({t:oe.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...c,startIndex:0,bullet:a==null?void 0:a.bullet}]},coverType:De.REPLACE}))}return i}const cE=e=>{var u;const{selection:n,body:t,doc:r}=e,s=n.segmentId,i=(u=r.getSelfOrHeaderFooterModel(s))==null?void 0:u.getBody();if(!i)return!1;const o=n.collapsed?null:en(i,n.startOffset,n.endOffset),a=yo(o?o.dataStream:"",t.dataStream);let l=0;const c=a.map(([f,g])=>{switch(f){case 0:{const p={t:oe.RETAIN,body:{...en(t,l,l+g.length,!1),dataStream:""},len:g.length};return l+=g.length,p}case 1:{const p={t:oe.INSERT,body:en(t,l,l+g.length),len:g.length};return l+=g.length,p}default:return{t:oe.DELETE,len:g.length}}}),h=new st;return h.push({t:oe.RETAIN,len:n.startOffset}),h.push(...c),h};class $t{}R($t,"customRange",{add:lE,delete:aE,copyCustomRange:Vp,getCustomRangesInterestsWithSelection:zp,isIntersecting:Ou}),R($t,"customDecoration",{add:Wp,delete:Yp}),R($t,"selection",{replace:cE,makeSelection:sE,normalizeSelection:iE,delete:uE}),R($t,"range",{isIntersects:oE}),R($t,"transform",{getPlainText:bu,fromPlainText:rE,isEmptyDocument:nE}),R($t,"paragraph",{bullet:{set:Jp,switch:Xp,toggleChecklist:Qp,changeNestLevel:qp}});const hE=(e,n)=>n.length===e.length&&!e.some(t=>n.some(r=>!qt.equals(r,t))),dE=(e,n)=>n.length===e.length&&e.every((t,r)=>{const s=n[r];return s.unitId===t.unitId&&s.sheetId===t.sheetId&&qt.equals(t.range,s.range)}),mi={t:0,b:2,l:2,r:2},fE=e=>({sbr:.6,sbo:e,spr:.6,spo:e}),Au=90;function Kr(e,n,t={}){const r=e.length,{textRotation:s,paddingData:i,horizontalAlign:o=Xt.UNSPECIFIED,verticalAlign:a=ln.UNSPECIFIED,wrapStrategy:l=un.UNSPECIFIED,cellValueType:c}=t,{t:h,r:u,b:f,l:g}=i||mi,{vertexAngle:p,centerAngle:C}=Du(s),I={id:"d",body:{dataStream:`${e}${bo}`,textRuns:[{ts:n,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:f,marginRight:u,marginLeft:g,renderConfig:{horizontalAlign:o,verticalAlign:a,centerAngle:C,vertexAngle:p,wrapStrategy:l,cellValueType:c}},drawings:{},drawingsOrder:[]};return new Yt(I)}function gE(e){if(!e)return{};const{tr:n,td:t,ht:r,vt:s,tb:i,pd:o}=e;return{textRotation:n,textDirection:t,horizontalAlign:r,verticalAlign:s,wrapStrategy:i,paddingData:o}}function Tu(e){if(!e)return{};const{ff:n,fs:t,it:r,bl:s,ul:i,st:o,ol:a,cl:l}=e,c={};return n&&(c.ff=n),t&&(c.fs=t),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 Nu(e,n,t){var i;const r=e.getBody();if((i=r.customRanges)!=null&&i.some(o=>o.rangeType===nr.HYPERLINK))return;const s=$t.customRange.add({range:{startOffset:0,endOffset:r.dataStream.length-1,collapsed:!1},rangeId:t,rangeType:nr.HYPERLINK,body:r,properties:{url:n,refId:t}});s&&st.apply(r,s.serialize())}const mE='"Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif';function Mu(e){const n=ct.ff,t=ct.fs;if(!e){const u=`${t}pt ${n}`;return{fontCache:u,fontString:u,fontSize:t,originFontSize:t,fontFamily:n}}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=t;e.fs&&(i=Math.ceil(e.fs));let o=n;if(e.ff){let u=e.ff;u=u.replace(/"/g,"").replace(/'/g,""),u.indexOf(" ")>-1&&(u=`"${u}"`),u==null&&(u=n),o=u}const{va:a}=e;let l=i;if(a===jt.SUBSCRIPT||a===jt.SUPERSCRIPT){const u=_E(o,l),{sbr:f,spr:g}=u;l*=a===jt.SUBSCRIPT?f:g}const c=`${r} ${s} ${l}pt ${o}`,h=`${c}, ${mE} `;return{fontCache:c,fontString:h,fontSize:l,originFontSize:i,fontFamily:o}}function _E(e,n){return fE(n)}function Du(e){const{a:n=0,v:t=Te.FALSE}=e||{a:0,v:Te.FALSE};let r=0,s=n;return t===Te.TRUE&&(r=Au,s=Au),{centerAngle:r,vertexAngle:s}}class pE{constructor(n,t){R(this,"_columnData",{});this._config=n,this._columnData=t}getColumnData(){return this._columnData}getColVisible(n){const{_columnData:t}=this,r=t[n];return r?r.hd!==Te.TRUE:!0}getColumnStyle(n){var t;return(t=this._columnData[n])==null?void 0:t.s}setColumnStyle(n,t){const r=this.getColumnOrCreate(n);r.s=t}getHiddenCols(n=0,t=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=n;o<=t;o++){const a=this.getColVisible(o);s&&a?(s=!1,r.push({rangeType:we.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:t,rangeType:we.COLUMN}),r}getVisibleCols(n=0,t=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=n;o<=t;o++){const a=this.getColVisible(o);s&&!a?(s=!1,r.push({rangeType:we.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:t,rangeType:we.COLUMN}),r}getColumnDatas(n,t){const r={};let s=0;for(let i=n;i<n+t;i++){const o=this.getColumnOrCreate(i);r[s]=o,s++}return r}getSize(){return Zt(this._columnData)}getColumnWidth(n){const{_columnData:t}=this,r=this._config;let s=0;return s=(t[n]||{hd:Te.FALSE,w:r.defaultColumnWidth}).w||r.defaultColumnWidth,s}getColumn(n){const t=this._columnData[n];if(t)return t}removeColumn(n){delete this._columnData[n]}getColumnOrCreate(n){const{_columnData:t}=this,r=t[n];if(r)return r;const s={};return this._columnData[n]=s,s}}class EE{constructor(n,t,r){R(this,"_rowData");this._config=n,this._viewModel=t,this._rowData=r}getRowData(){return this._rowData}getRowStyle(n){var t;return(t=this._rowData[n])==null?void 0:t.s}setRowStyle(n,t){const r=this.getRowOrCreate(n);r.s=t}getRowDatas(n,t){const r={};let s=0;for(let i=n;i<n+t;i++){const o=this.getRowOrCreate(i);r[s]=o,s++}return r}getRowHeight(n,t=1){const{_rowData:r}=this,s=this._config;let i=0;for(let o=0;o<t;o++){const a=r[o+n]||{hd:Te.FALSE,h:s.defaultRowHeight},{ia:l,ah:c,h=s.defaultRowHeight}=a;i+=(l==null||l===Te.TRUE)&&typeof c=="number"?c:h}return i}getRow(n){return this._rowData[n]}removeRow(n){delete this._rowData[n]}getRowOrCreate(n){const{_rowData:t}=this,r=t[n];if(r)return r;const s={};return t[n]=s,s}getHiddenRows(n=0,t=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=n;o<=t;o++){const a=this.getRowRawVisible(o);s&&a?(s=!1,r.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:we.ROW})):!s&&!a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:t,startColumn:0,endColumn:0,rangeType:we.ROW}),r}getVisibleRows(n=0,t=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=n;o<=t;o++){const a=this.getRowRawVisible(o);s&&!a?(s=!1,r.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:we.ROW})):!s&&a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:t,startColumn:0,endColumn:0,rangeType:we.ROW}),r}getRowRawVisible(n){const t=this.getRow(n);return t?t.hd!==Te.TRUE:!0}getSize(){return Zt(this._rowData)}}const CE="DEFAULT_WORKSHEET_ROW_COUNT",Lu=1e3,vE="DEFAULT_WORKSHEET_COLUMN_COUNT",Uu=20,RE="DEFAULT_WORKSHEET_ROW_HEIGHT",Pu=24,IE="DEFAULT_WORKSHEET_COLUMN_WIDTH",ku=88,SE="DEFAULT_WORKSHEET_ROW_TITLE_WIDTH",Fu=46,OE="DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT",$u=20;function xu(e){const n={name:"Sheet1",id:"sheet-01",tabColor:"",hidden:Te.FALSE,rowCount:Lu,columnCount:Uu,zoomRatio:1,freeze:{xSplit:0,ySplit:0,startRow:-1,startColumn:-1},scrollTop:0,scrollLeft:0,defaultColumnWidth:ku,defaultRowHeight:Pu,mergeData:[],cellData:{},rowData:{},columnData:{},showGridlines:Te.TRUE,rowHeader:{width:Fu,hidden:Te.FALSE},columnHeader:{height:$u,hidden:Te.FALSE},rightToLeft:Te.FALSE};return Object.keys(n).forEach(t=>{const r=t;typeof e[r]>"u"&&(e[r]=n[r])}),e}class yE extends rt{constructor(t){super();R(this,"_cellCache",new Map);R(this,"_rowCache",new Map);R(this,"_columnCache",new Map);R(this,"_hasRow",!1);R(this,"_hasColumn",!1);R(this,"_hasAll",!1);R(this,"_allIndex",-1);R(this,"_mergeData");R(this,"_rangeMap",new Br(5e4));R(this,"_skeletonCache",new Br(5e4));this._init(t.concat())}_init(t){this._mergeData=t,this._createCache(t)}_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(t){let r=0;for(const s of t){const{rangeType:i}=s;i===we.ROW?this._createRowCache(s,r):i===we.COLUMN?this._createColumnCache(s,r):i===we.ALL?this._createCellAllCache(r):this._createCellCache(s,r),r++}}rebuild(t){this._clearCache(),this._init(t.concat())}_createRowCache(t,r){const{startRow:s,endRow:i}=t;for(let o=s;o<=i;o++)this._rowCache.set(o,r),this._hasRow=!0}_createColumnCache(t,r){const{startColumn:s,endColumn:i}=t;for(let o=s;o<=i;o++)this._columnCache.set(o,r),this._hasColumn=!0}_createCellAllCache(t){this._hasAll=!0,this._allIndex=t}_createCellCache(t,r){for(let s=t.startRow;s<=t.endRow;s++){let i=this._cellCache.get(s);i==null&&(i=new Map,this._cellCache.set(s,i));for(let o=t.startColumn;o<=t.endColumn;o++)i.set(o,r)}}add(t){this._mergeData.push(t),this._clearCache(),this._createCache(this._mergeData)}remove(t,r){const s=this._getMergeDataIndex(t,r);s!==-1&&(this._mergeData.splice(s,1),this._clearCache(),this._createCache(this._mergeData))}getMergedCell(t,r){const s=this._getMergeDataIndex(t,r);return s!==-1?this._mergeData[s]:null}getMergeDataIndex(t,r){return this._getMergeDataIndex(t,r)}isRowContainsMergedCell(t){return this._hasAll||!K.isEmptyObject(this._columnCache)?!0:this._mergeData.some(r=>r.startRow<=t&&t<=r.endRow)}isColumnContainsMergedCell(t){return this._hasAll||!K.isEmptyObject(this._rowCache)?!0:this._mergeData.some(r=>r.startColumn<=t&&t<=r.endColumn)}getMergedCellRange(t,r,s,i){const o=[],a=`${t}-${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:t,endRow:s,startColumn:r,endColumn:i})&&(o.push({...h}),c.push(l)),l++;return this._rangeMap.set(a,c),o}getMergedCellRangeForSkeleton(t,r,s,i){const o=[],a=this._mergeData,l=`${t}-${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:f,startColumn:g,endColumn:p}=a[h];for(let C=t;C<=s;C++){let I=!1;for(let S=r;S<=i;S++)if(C>=u&&C<=f&&S>=g&&S<=p){o.push({startRow:u,endRow:f,startColumn:g,endColumn:p}),c.push(h),I=!0;break}if(I)break}}return this._skeletonCache.set(l,c),o}_getRangeFromCache(t){const r=this._rangeMap.get(t)||[],s=[];for(const i of r)s.push({...this._mergeData[i]});return s}_getSkeletonRangeFromCache(t){const r=this._skeletonCache.get(t)||[],s=[];for(const i of r)s.push({...this._mergeData[i]});return s}_getMergeDataIndex(t,r){var i;if(this._hasAll)return this._allIndex;if(this._hasRow){const o=this._rowCache.get(t);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(t))==null?void 0:i.get(r);return s!==void 0?s:-1}getMergeDataSnapshot(){return this._mergeData}dispose(){this._clearCache(),this._mergeData=[]}}class Hu extends rt{constructor(t){super();R(this,"_cellContentInterceptor",null);R(this,"_rowFilteredInterceptor",null);this.getRawCell=t}dispose(){super.dispose(),this._cellContentInterceptor=null,this._rowFilteredInterceptor=null}getCell(t,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(t,r,Sn.Value|Sn.Style):this.getRawCell(t,r)}getCellValueOnly(t,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(t,r,Sn.Value):this.getRawCell(t,r)}getCellStyleOnly(t,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(t,r,Sn.Style):this.getRawCell(t,r)}getRowFiltered(t){var r,s;return(s=(r=this._rowFilteredInterceptor)==null?void 0:r.getRowFiltered(t))!=null?s:!1}registerCellContentInterceptor(t){if(this._cellContentInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._cellContentInterceptor=t,Ze(()=>this._cellContentInterceptor=null)}registerRowFilteredInterceptor(t){if(this._rowFilteredInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._rowFilteredInterceptor=t,Ze(()=>this._rowFilteredInterceptor=null)}}const Bu={isDeepClone:!1,displayRawFormula:!1,ignoreTextRotation:!1};class sr{constructor(n,t,r){R(this,"_sheetId");R(this,"_snapshot");R(this,"_cellData");R(this,"_rowManager");R(this,"_columnManager");R(this,"_viewModel");R(this,"_spanModel");var a;this.unitId=n,this._styles=r,this._snapshot=xu(t);const{columnData:s,rowData:i,cellData:o}=this._snapshot;this._sheetId=(a=this._snapshot.id)!=null?a:K.generateRandomId(6),this._cellData=new Pt(o),this._viewModel=new Hu((l,c)=>this.getCellRaw(l,c)),this._rowManager=new EE(this._snapshot,this._viewModel,i),this._columnManager=new pE(this._snapshot,s),this._spanModel=new yE(this._snapshot.mergeData)}__interceptViewModel(n){n(this._viewModel)}getSnapshot(){return this._snapshot}setMergeData(n){this._snapshot.mergeData=n,this.getSpanModel().rebuild(n)}getSpanModel(){return this._spanModel}getColumnStyle(n,t=!1){return t?this._columnManager.getColumnStyle(n):this._styles.get(this._columnManager.getColumnStyle(n))}setColumnStyle(n,t){this._columnManager.setColumnStyle(n,t)}getRowStyle(n,t=!1){return t?this._rowManager.getRowStyle(n):this._styles.get(this._rowManager.getRowStyle(n))}setRowStyle(n,t){this._rowManager.setRowStyle(n,t)}mixinDefaultStyleToCellRaw(n,t,r,s){const i=this.getColumnStyle(t),o=this.getRowStyle(n),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?Hs(a,i,o,l):Hs(a,o,i,l);r||(r={}),r.s=c}}getDefaultCellStyle(){return this._snapshot.defaultStyle}getDefaultCellStyleInternal(){const n=this._snapshot.defaultStyle;return this._styles.get(n)}setDefaultCellStyle(n){this._snapshot.defaultStyle=n}getCellMatrix(){return this._cellData}getCellMatrixPrintRange(){const n=this.getCellMatrix(),t=this.getMergeData();let r=-1,s=-1,i=-1,o=-1,a=!1,l=!1;return n.forEach((c,h)=>{Object.keys(h).forEach(u=>{const f=+u,g=n.getValue(c,f),p=g!=null&&g.s?this._styles.get(g.s):null,C=(p==null?void 0:p.bd)&&(p.bd.b||p.bd.l||p.bd.r||p.bd.t||p.bd.bc_tr||p.bd.bl_tr||p.bd.ml_tr||p.bd.tl_bc||p.bd.tl_br||p.bd.tl_mr);(g&&(g.v||g.p)||p!=null&&p.bg||C)&&(a?r=Math.min(r,c):(r=c,a=!0),s=Math.max(s,c),l?i=Math.min(i,f):(l=!0,i=f),o=Math.max(o,f))})}),t.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:n}=this,t=K.deepClone(n);return new sr(this.unitId,t,this._styles)}getMergeData(){return this._spanModel.getMergeDataSnapshot()}getMergedCell(n,t){return this._spanModel.getMergedCell(n,t)}getMergedCellRange(n,t,r,s){return this._spanModel.getMergedCellRange(n,t,r,s)}isRowContainsMergedCell(n){return this._spanModel.isRowContainsMergedCell(n)}isColumnContainsMergedCell(n){return this._spanModel.isColumnContainsMergedCell(n)}getCellInfoInMergeData(n,t){const r=this.getMergedCell(n,t);let s=!1,i=!1,o=n,a=t,l=n,c=t;if(r){const{startRow:h,endRow:u,startColumn:f,endColumn:g}=r;n===h&&t===f?(o=u,a=g,l=h,c=f,i=!0):n>=h&&n<=u&&t>=f&&t<=g&&(o=u,a=g,l=h,c=f,s=!0)}return{actualRow:n,actualColumn:t,isMergedMainCell:i,isMerged:s,endRow:o,endColumn:a,startRow:l,startColumn:c}}getCell(n,t){return n<0||t<0?null:this._viewModel.getCell(n,t)}getCellValueOnly(n,t){return n<0||t<0?null:this._viewModel.getCellValueOnly(n,t)}getCellStyleOnly(n,t){return n<0||t<0?null:this._viewModel.getCellStyleOnly(n,t)}getCellRaw(n,t){return this.getCellMatrix().getValue(n,t)}getRowFiltered(n){return this._viewModel.getRowFiltered(n)}getMatrixWithMergedCells(n,t,r,s,i=!1){const o=this.getCellMatrix(),a=this._spanModel.getMergedCellRange(n,t,r,s),l=new Pt;return Qs(n,r,t,s).forEach((c,h)=>{const u=i?this.getCellRaw(c,h):this.getCell(c,h);u&&l.setValue(c,h,u)}),a.forEach(c=>{const{startColumn:h,startRow:u,endColumn:f,endRow:g}=c;Qs(u,g,h,f).forEach((p,C)=>{p===u&&C===h&&l.setValue(p,C,{...o.getValue(p,C),rowSpan:g-u+1,colSpan:f-h+1}),(p!==u||C!==h)&&l.realDeleteValue(p,C)})}),l}getRange(n,t,r,s){return typeof n=="object"?new yn(this,n,{getStyles:()=>this._styles}):new yn(this,{startRow:n,startColumn:t,endColumn:s||t,endRow:r||n},{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:n}=this,{columnCount:t}=n;return t}getMaxRows(){const{_snapshot:n}=this,{rowCount:t}=n;return t}getRowCount(){return this._snapshot.rowCount}setRowCount(n){this._snapshot.rowCount=n}getColumnCount(){return this._snapshot.columnCount}setColumnCount(n){this._snapshot.columnCount=n}isSheetHidden(){return this._snapshot.hidden}hasHiddenGridlines(){const{_snapshot:n}=this,{showGridlines:t}=n;return t===0}getTabColor(){const{_snapshot:n}=this,{tabColor:t}=n;return t}getColumnWidth(n){return this.getColumnManager().getColumnWidth(n)}getRowHeight(n){return this._viewModel.getRowFiltered(n)?0:this.getRowManager().getRowHeight(n)}isRowFiltered(n){return this._viewModel.getRowFiltered(n)}getRowVisible(n){return!this.isRowFiltered(n)&&this.getRowRawVisible(n)}getRowRawVisible(n){return this.getRowManager().getRowRawVisible(n)}getHiddenRows(n,t){const r=this.getMaxColumns()-1,s=this._rowManager.getHiddenRows(n,t);return s.forEach(i=>i.endColumn=r),s}getColVisible(n){return this._columnManager.getColVisible(n)}getHiddenCols(n,t){const r=this.getMaxRows()-1,s=this._columnManager.getHiddenCols(n,t);return s.forEach(i=>i.endRow=r),s}getVisibleRows(){const n=this.getRowCount();return this._rowManager.getVisibleRows(0,n-1)}getVisibleCols(){const n=this.getColumnCount();return this._columnManager.getVisibleCols(0,n-1)}isRightToLeft(){const{_snapshot:n}=this,{rightToLeft:t}=n;return t}getLastRowWithContent(){return this._cellData.getLength()-1}getLastColumnWithContent(){return this._cellData.getRange().endColumn}cellHasValue(n){return n&&(n.v!==void 0||n.f!==void 0||n.p!==void 0)}iterateByRow(n,t=!0){const{startRow:r,startColumn:s,endRow:i,endColumn:o}=n,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,f=a.getMergedCell(l,c);if(f){if(l!==f.startRow||c!==f.startColumn){c=f.endColumn+1;continue}if(u&&t){c=f.endColumn+1;continue}const p={row:l,col:c,value:h};return p.colSpan=f.endColumn-f.startColumn+1,p.rowSpan=f.endRow-f.startRow+1,c=f.endColumn+1,{done:!1,value:p}}if(u&&t)c+=1;else{const g={row:l,col:c,value:h};return c+=1,{done:!1,value:g}}}}}}}}iterateByColumn(n,t=!0,r=!0){const{startRow:s,startColumn:i,endRow:o,endColumn:a}=n,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 p=c!==u.startRow,C=p||h!==u.startColumn;if(r&&C||!r&&p){c=u.endRow+1;continue}const I=l.getCell(u.startRow,u.startColumn);if(!I&&t){c=u.endRow+1;continue}const D={row:c,col:u.startColumn,value:I};return D.colSpan=u.endColumn-u.startColumn+1,D.rowSpan=u.endRow-u.startRow+1,c=u.endRow+1,{done:!1,value:D}}const f=l.getCell(c,h);if(!f&&t)c+=1;else{const p={row:c,col:h,value:f};return c+=1,{done:!1,value:p}}}}}}}}_getCellDocumentModel(n,t=Bu){var C;const{isDeepClone:r,displayRawFormula:s,ignoreTextRotation:i}={...Bu,...t},o=this._styles.getStyleByCell(n);if(!n)return;let a,l="document";const c=gE(o),h=i?ct.tr:c.textRotation||ct.tr;let u=c.horizontalAlign||ct.ht;const f=c.verticalAlign||ct.vt,g=c.wrapStrategy||ct.tb,p=c.paddingData||mi;if(n.f&&s)a=Kr(n.f.toString(),{},{verticalAlign:f}),u=ct.ht;else if(n.p){const{centerAngle:I,vertexAngle:S}=Du(h);a=this._updateConfigAndGetDocumentModel(r?K.deepClone(n.p):n.p,u,p,{horizontalAlign:u,verticalAlign:f,centerAngle:I,vertexAngle:S,wrapStrategy:g})}else if(n.v!=null){const I=Tu(o);l=Mu(I).fontCache;let S=ju(n);n.t===Qt.FORCE_STRING&&s&&(S=`'${S}`),a=Kr(S,I,{...c,textRotation:h,cellValueType:n.t})}return a&&n.linkUrl&&n.linkId&&Nu(a,n.linkUrl,n.linkId),{documentModel:a,fontString:l,textRotation:h,wrapStrategy:g,verticalAlign:f,horizontalAlign:u,paddingData:p,fill:(C=o==null?void 0:o.bg)==null?void 0:C.rgb}}_updateConfigAndGetDocumentModel(n,t,r,s){var o,a,l,c,h;if(!s||!((o=n.body)!=null&&o.dataStream))return;n.documentStyle||(n.documentStyle={}),n.documentStyle.marginTop=(a=r.t)!=null?a:0,n.documentStyle.marginBottom=(l=r.b)!=null?l:2,n.documentStyle.marginLeft=(c=r.l)!=null?c:2,n.documentStyle.marginRight=(h=r.r)!=null?h:2,n.documentStyle.pageSize={width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},n.documentStyle.renderConfig=s;const i=n.body.paragraphs||[];for(const u of i)u.paragraphStyle||(u.paragraphStyle={}),u.paragraphStyle.horizontalAlign=t;return new Yt(n)}getBlankCellDocumentModel(n){const t=this._getCellDocumentModel(n,{ignoreTextRotation:!0}),r=this._styles.getStyleByCell(n),s=Tu(r);if(t!=null)return t.documentModel==null&&(t.documentModel=Kr("",s)),t;const i="";let o="document";const a=ct.tr,l=ct.ht,c=ct.vt,h=ct.tb,u=mi;return o=Mu({}).fontCache,{documentModel:Kr(i,s),fontString:o,textRotation:a,wrapStrategy:h,verticalAlign:c,horizontalAlign:l,paddingData:u}}getCellDocumentModelWithFormula(n){return this._getCellDocumentModel(n,{isDeepClone:!0,displayRawFormula:!0,ignoreTextRotation:!0})}}function ju(e){var r,s;if(!e)return"";const n=(s=(r=e.p)==null?void 0:r.body)==null?void 0:s.dataStream;if(n)return $t.transform.getPlainText(n);const t=e.v;return typeof t=="string"?e.t===Qt.BOOLEAN?t.toUpperCase():t.replace(/[\r\n]/g,""):typeof t=="number"?e.t===Qt.BOOLEAN?t?"TRUE":"FALSE":t.toString():typeof t=="boolean"?t?"TRUE":"FALSE":""}function wE(e){if(e===null)return"";if(e!=null&&e.p){const n=e==null?void 0:e.p.body;if(n==null)return"";const t=n.dataStream;return $t.transform.getPlainText(t)}return e==null?void 0:e.v}var bE=Object.defineProperty,AE=Object.getOwnPropertyDescriptor,TE=(e,n,t,r)=>{for(var s=r>1?void 0:r?AE(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&bE(n,t,s),s},NE=(e,n)=>(t,r)=>n(t,r,e);function ME(e,n){return`${e.getUnitId()}|${n.getSheetId()}`}d.Workbook=class extends Yr{constructor(t={},r){super();R(this,"type",$e.UNIVER_SHEET);R(this,"_sheetCreated$",new ce.Subject);R(this,"sheetCreated$",this._sheetCreated$.asObservable());R(this,"_sheetDisposed$",new ce.Subject);R(this,"sheetDisposed$",this._sheetDisposed$.asObservable());R(this,"_activeSheet$",new ce.BehaviorSubject(null));R(this,"activeSheet$",this._activeSheet$.asObservable());R(this,"_worksheets");R(this,"_styles");R(this,"_snapshot");R(this,"_unitId");R(this,"_count");R(this,"_name$");R(this,"name$");this._logService=r;const s=jp();K.isEmptyObject(t)?this._snapshot=s:this._snapshot=K.commonExtend(s,t);const{styles:i}=this._snapshot;(this._snapshot.id==null||this._snapshot.id.length===0)&&(this._snapshot.id=K.generateRandomId(6)),this._unitId=this._snapshot.id,this._styles=new Su(i),this._count=1,this._worksheets=new Map,this._name$=new ce.BehaviorSubject(t.name||""),this.name$=this._name$.asObservable(),this._parseWorksheetSnapshots()}get _activeSheet(){return this._activeSheet$.getValue()}get name(){return this._name$.getValue()}static isIRangeType(t){return typeof t=="string"||"startRow"in t||"row"in t}dispose(){super.dispose(),this._sheetCreated$.complete(),this._sheetDisposed$.complete(),this._activeSheet$.complete(),this._name$.complete()}save(){return K.deepClone(this._snapshot)}getSnapshot(){return this._snapshot}getName(){return this._snapshot.name}setName(t){this._name$.next(t),this._snapshot.name=t}getUnitId(){return this._unitId}getRev(){var t;return(t=this._snapshot.rev)!=null?t:1}incrementRev(){this._snapshot.rev=this.getRev()+1}setRev(t){this._snapshot.rev=t}addWorksheet(t,r,s){const{sheets:i,sheetOrder:o}=this._snapshot;if(i[t])return!1;i[t]=s,o.splice(r,0,t);const a=new sr(this._unitId,s,this._styles);return this._worksheets.set(t,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(t){const{sheetOrder:r}=this._snapshot;return r.findIndex(s=>s===t)}getActiveSheet(t){if(!this._activeSheet&&typeof t>"u")throw new Error(`[Workbook]: no active Worksheet on Workbook ${this._unitId}!`);return this._activeSheet}ensureActiveSheet(){const t=this._activeSheet;if(t)return t;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()!==Te.TRUE)return this.setActiveSheet(a),a}const s=this._worksheets.get(r[0]);return this.setActiveSheet(s),s}setActiveSheet(t){this._activeSheet$.next(t)}removeSheet(t){const r=this._worksheets.get(t);return r?(this._worksheets.delete(t),this._snapshot.sheetOrder.splice(this._snapshot.sheetOrder.indexOf(t),1),delete this._snapshot.sheets[t],this._sheetDisposed$.next(r),!0):!1}getActiveSheetIndex(){const{sheetOrder:t}=this._snapshot;return t.findIndex(r=>this._worksheets.get(r)===this._activeSheet)}getSheetSize(){return this._snapshot.sheetOrder.length}getSheets(){const{sheetOrder:t}=this._snapshot;return t.map(r=>this._worksheets.get(r))}getSheetsName(){const{sheetOrder:t}=this._snapshot,r=[];return t.forEach(s=>{const i=this._worksheets.get(s);i&&r.push(i.getName())}),r}getSheetIndex(t){const{sheetOrder:r}=this._snapshot;return r.findIndex(s=>t.getSheetId()===s)}getSheetBySheetName(t){const{sheetOrder:r}=this._snapshot,s=r.find(i=>this._worksheets.get(i).getName()===t);return this._worksheets.get(s)}getSheetBySheetId(t){return this._worksheets.get(t)}getSheetByIndex(t){const{sheetOrder:r}=this._snapshot;return this._worksheets.get(r[t])}getHiddenWorksheets(){return this.getSheets().filter(t=>t.getConfig().hidden===Te.TRUE).map(t=>t.getConfig().id)}getUnhiddenWorksheets(){return this.getSheets().filter(t=>t.getConfig().hidden!==Te.TRUE).map(t=>t.getConfig().id)}load(t){this._snapshot=t}checkSheetName(t){return this.getSheetsName().includes(t)}uniqueSheetName(t="Sheet1"){let r=t;for(;this.checkSheetName(r);)r=t+this._count,this._count++;return r}generateNewSheetName(t){let r=t+this._count;for(;this.checkSheetName(r);)r=t+this._count,this._count++;return r}_parseWorksheetSnapshots(){const{_snapshot:t,_worksheets:r}=this,{sheets:s,sheetOrder:i}=t;if(K.isEmptyObject(s)){const o=K.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 sr(this._unitId,a,this._styles);r.set(o,c),i.includes(o)||i.push(o)}this.ensureActiveSheet()}},d.Workbook=TE([NE(1,Tt)],d.Workbook);class _i extends Yr{constructor(t){var r;super();R(this,"type",$e.UNIVER_SLIDE);R(this,"_activePage$",new ce.BehaviorSubject(null));R(this,"activePage$",this._activePage$.asObservable());R(this,"_name$");R(this,"name$");R(this,"_snapshot");R(this,"_unitId");this._snapshot={...hl,...t},this._unitId=(r=this._snapshot.id)!=null?r:K.generateRandomId(6),this._name$=new ce.BehaviorSubject(this._snapshot.title),this.name$=this._name$.asObservable()}get _activePage(){var r,s;const t=this._activePage$.getValue();if(!t){const i=(r=this.getPageOrder())==null?void 0:r[0];return i?(s=this.getPages())==null?void 0:s[i]:null}return t}setName(t){var r;this._snapshot.title=t,this._name$.next(t),this._unitId=(r=this._snapshot.id)!=null?r:cn(6)}getRev(){return 0}incrementRev(){}setRev(t){}getSnapshot(){return this._snapshot}getUnitId(){return this._unitId}getPages(){var t;return(t=this._snapshot.body)==null?void 0:t.pages}getPageOrder(){var t;return(t=this._snapshot.body)==null?void 0:t.pageOrder}getPage(t){const r=this.getPages();return r==null?void 0:r[t]}getElementsByPage(t){var r;return(r=this.getPage(t))==null?void 0:r.pageElements}getElement(t,r){var s;return(s=this.getElementsByPage(t))==null?void 0:s[r]}getPageSize(){return this._snapshot.pageSize}getBlankPage(){const t=cn(6);return{id:t,pageType:hi.SLIDE,zIndex:10,title:t,description:"",pageBackgroundFill:{rgb:"rgb(255,255,255)"},pageElements:{}}}setActivePage(t){this._activePage$.next(t)}getActivePage(){return this._activePage}updatePage(t,r){this._snapshot.body&&(this._snapshot.body.pages[t]=r)}appendPage(t){var i;if(!this._snapshot.body)return;this._snapshot.body.pages[t.id]=t;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,t.id)}}const ir="FOCUSING_UNIT",Nn="FOCUSING_SHEET",or="FOCUSING_DOC",ar="FOCUSING_SLIDE",DE="FOCUSING_EDITOR_BUT_HIDDEN",Wu="EDITOR_ACTIVATED",LE="FOCUSING_EDITOR_INPUT_FORMULA",Yu="FOCUSING_FX_BAR_EDITOR",UE="FOCUSING_UNIVER_EDITOR",PE="FOCUSING_EDITOR_INPUT_FORMULA",kE="FOCUSING_PANEL_EDITOR",FE="FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE",$E="FOCUSING_COMMON_DRAWINGS",xE="FORMULA_EDITOR_ACTIVATED";var HE=Object.defineProperty,BE=Object.getOwnPropertyDescriptor,jE=(e,n,t,r)=>{for(var s=r>1?void 0:r?BE(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&HE(n,t,s),s},zu=(e,n)=>(t,r)=>n(t,r,e);const mn=St("univer.current");d.UniverInstanceService=class extends rt{constructor(t,r){super();R(this,"_unitsByType",new Map);R(this,"_createHandler");R(this,"_ctorByType",new Map);R(this,"_currentUnits",new Map);R(this,"_currentUnits$",new ce.BehaviorSubject(this._currentUnits));R(this,"currentUnits$",this._currentUnits$.asObservable());R(this,"_unitAdded$",new ce.Subject);R(this,"unitAdded$",this._unitAdded$.asObservable());R(this,"_unitDisposed$",new ce.Subject);R(this,"unitDisposed$",this._unitDisposed$.asObservable());R(this,"_focused$",new ce.BehaviorSubject(null));R(this,"focused$",this._focused$.asObservable());this._injector=t,this._contextService=r}dispose(){super.dispose(),this._focused$.complete()}__setCreateHandler(t){this._createHandler=t}createUnit(t,r,s){return this._createHandler(t,r,this._ctorByType.get(t),s)}registerCtorForType(t,r){return this._ctorByType.set(t,r),{dispose:()=>{this._ctorByType.delete(t)}}}getCurrentTypeOfUnit$(t){return this.currentUnits$.pipe(ce.map(r=>{var s;return(s=r.get(t))!=null?s:null}),ce.distinctUntilChanged())}getCurrentUnitForType(t){return this._currentUnits.get(t)}setCurrentUnitForType(t){const r=this._getUnitById(t);if(!r)throw new Error(`[UniverInstanceService]: no document with unitId ${t}!`);this._currentUnits.set(r[1],r[0]),this._currentUnits$.next(this._currentUnits)}getTypeOfUnitAdded$(t){return this._unitAdded$.pipe(ce.filter(r=>r.type===t))}__addUnit(t,r){var a;const s=t.type;this._unitsByType.has(s)||this._unitsByType.set(s,[]);const i=this._unitsByType.get(s),o=t.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(t),this._unitAdded$.next(t),((a=r==null?void 0:r.makeCurrent)==null||a)&&this.setCurrentUnitForType(t.getUnitId())}getTypeOfUnitDisposed$(t){return this.unitDisposed$.pipe(ce.filter(r=>r.type===t))}getUnit(t,r){var i;const s=(i=this._getUnitById(t))==null?void 0:i[0];return r&&(s==null?void 0:s.type)!==r?null:s}getCurrentUniverDocInstance(){return this.getCurrentUnitForType($e.UNIVER_DOC)}getUniverDocInstance(t){return this.getUnit(t,$e.UNIVER_DOC)}getUniverSheetInstance(t){return this.getUnit(t,$e.UNIVER_SHEET)}getAllUnitsForType(t){var r;return(r=this._unitsByType.get(t))!=null?r:[]}changeDoc(t,r){const s=this.getAllUnitsForType($e.UNIVER_DOC),i=s.find(o=>o.getUnitId()===t);if(i!=null){const o=s.indexOf(i);s.splice(o,1)}this.__addUnit(r)}get focused(){var r;const t=this._focused$.getValue();return t?(r=this._getUnitById(t))==null?void 0:r[0]:null}focusUnit(t){this._focused$.next(t),this.focused instanceof d.Workbook?(this._contextService.setContextValue(ir,!0),this._contextService.setContextValue(or,!1),this._contextService.setContextValue(Nn,!0),this._contextService.setContextValue(ar,!1),this.setCurrentUnitForType(t)):this.focused instanceof Yt?(this._contextService.setContextValue(ir,!0),this._contextService.setContextValue(or,!0),this._contextService.setContextValue(Nn,!1),this._contextService.setContextValue(ar,!1),this.setCurrentUnitForType(t)):this.focused instanceof _i?(this._contextService.setContextValue(ir,!0),this._contextService.setContextValue(or,!1),this._contextService.setContextValue(Nn,!1),this._contextService.setContextValue(ar,!0),this.setCurrentUnitForType(t)):(this._contextService.setContextValue(ir,!1),this._contextService.setContextValue(or,!1),this._contextService.setContextValue(Nn,!1),this._contextService.setContextValue(ar,!1))}getFocusedUnit(){return this.focused}getUnitType(t){const r=this._getUnitById(t);return r?r[1]:$e.UNRECOGNIZED}disposeUnit(t){const r=this._getUnitById(t);if(!r)return!1;const[s,i]=r,o=this._unitsByType.get(i),a=o.indexOf(s);return o.splice(a,1),this._tryRemoveCurrentUnitForType(t,i),this._tryBlurUnitOnRemoval(t),this._unitDisposed$.next(s),!0}_tryRemoveCurrentUnitForType(t,r){const s=this.getCurrentUnitForType(r);(s==null?void 0:s.getUnitId())===t&&(this._currentUnits.set(r,null),this._currentUnits$.next(this._currentUnits))}_tryBlurUnitOnRemoval(t){var r;((r=this.focused)==null?void 0:r.getUnitId())===t&&this._focused$.next(null)}_getUnitById(t){for(const[r,s]of this._unitsByType){const i=s.find(o=>o.getUnitId()===t);if(i)return[i,r]}}},d.UniverInstanceService=jE([zu(0,Ot(Dt)),zu(1,Gn)],d.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 WE={0:"Starting",1:"Ready",2:"Rendered",3:"Steady"};var YE=Object.defineProperty,zE=Object.getOwnPropertyDescriptor,VE=(e,n,t,r)=>{for(var s=r>1?void 0:r?zE(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&YE(n,t,s),s},GE=(e,n)=>(t,r)=>n(t,r,e);d.LifecycleService=class extends rt{constructor(t){super();R(this,"_lifecycle$",new ce.BehaviorSubject(We.Starting));R(this,"lifecycle$",this._lifecycle$.asObservable());R(this,"_lock",!1);this._logService=t,this._reportProgress(We.Starting)}get stage(){return this._lifecycle$.getValue()}set stage(t){if(this._lock)throw new Error("[LifecycleService]: cannot set new stage when related logic is all handled!");if(t<this.stage)throw new Error("[LifecycleService]: lifecycle stage cannot go backward!");t!==this.stage&&(this._lock=!0,this._reportProgress(t),this._lifecycle$.next(t),this._lock=!1)}dispose(){this._lifecycle$.complete(),super.dispose()}subscribeWithPrevious(){return ce.merge(Vu(this.stage),this._lifecycle$.pipe(ce.skip(1))).pipe(Ca(t=>t===We.Steady))}_reportProgress(t){this._logService.debug("[LifecycleService]",`lifecycle progressed to "${WE[t]}".`)}},d.LifecycleService=VE([GE(0,Tt)],d.LifecycleService);function Vu(e){switch(e){case We.Starting:return ce.of(We.Starting);case We.Ready:return ce.of(We.Starting,We.Ready);case We.Rendered:return ce.of(We.Starting,We.Ready,We.Rendered);default:return ce.of(We.Starting,We.Ready,We.Rendered,We.Steady)}}var KE=Object.defineProperty,XE=Object.getOwnPropertyDescriptor,QE=(e,n,t,r)=>{for(var s=r>1?void 0:r?XE(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&KE(n,t,s),s},pi=(e,n)=>(t,r)=>n(t,r,e);const tn=St("univer.undo-redo.service"),JE=20;class Gu{dispose(){}async dispatchToHandlers(){return!1}}const Ku="univer.command.redo",Xu="univer.command.undo",lr=new class extends Gu{constructor(){super(...arguments);R(this,"type",Kn.COMMAND);R(this,"id",Xu)}async handler(n){const t=n.get(tn),r=t.pitchTopUndoElement();if(!r)return!1;const s=n.get(Lt);return $s(r.undoMutations,s)?(t.popUndoToRedo(),!0):!1}},ur=new class extends Gu{constructor(){super(...arguments);R(this,"type",Kn.COMMAND);R(this,"id",Ku)}async handler(n){const t=n.get(tn),r=t.pitchTopRedoElement();if(!r)return!1;const s=n.get(Lt);return $s(r.redoMutations,s)?(t.popRedoToUndo(),!0):!1}};d.LocalUndoRedoService=class extends rt{constructor(t,r,s){super();R(this,"undoRedoStatus$");R(this,"_undoRedoStatus$",new ce.BehaviorSubject({undos:0,redos:0}));R(this,"_undoStacks",new Map);R(this,"_redoStacks",new Map);R(this,"_batchingStatus",new Map);this._univerInstanceService=t,this._commandService=r,this._contextService=s,this.undoRedoStatus$=this._undoRedoStatus$.asObservable(),this.disposeWithMe(this._commandService.registerCommand(lr)),this.disposeWithMe(this._commandService.registerCommand(ur)),this.disposeWithMe(Ze(()=>this._undoRedoStatus$.complete())),this.disposeWithMe(Ze(this._univerInstanceService.focused$.subscribe(()=>this._updateStatus())))}pushUndoRedo(t){const{unitID:r}=t,s=this._getRedoStack(r,!0),i=this._getUndoStack(r,!0);if(s.length=0,this._batchingStatus.has(t.unitID)){const a=this._batchingStatus.get(t.unitID),l=this._pitchUndoElement(t.unitID);a===0||!l?(o(t),this._batchingStatus.set(t.unitID,1)):this._tryBatchingElements(l,t)}else o(t);function o(a){i.push(a),i.length>JE&&i.splice(0,1)}this._updateStatus()}clearUndoRedo(t){const r=this._getRedoStack(t);r&&(r.length=0);const s=this._getUndoStack(t);s&&(s.length=0),this._updateStatus()}pitchTopUndoElement(){const t=this._getFocusedUnitId();return this._pitchUndoElement(t)}pitchTopRedoElement(){const t=this._getFocusedUnitId();return this._pitchRedoElement(t)}_pitchUndoElement(t){const r=this._getUndoStack(t);return r!=null&&r.length?r[r.length-1]:null}_pitchRedoElement(t){const r=this._getRedoStack(t);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(t){if(this._batchingStatus.has(t))throw new Error("[LocalUndoRedoService]: cannot batching undo redo twice at the same time!");return this._batchingStatus.set(t,0),Ze(()=>this._batchingStatus.delete(t))}_updateStatus(){var i,o;const t=this._getFocusedUnitId(),r=t&&((i=this._undoStacks.get(t))==null?void 0:i.length)||0,s=t&&((o=this._redoStacks.get(t))==null?void 0:o.length)||0;this._undoRedoStatus$.next({undos:r,redos:s})}_getUndoStack(t,r=!1){let s=this._undoStacks.get(t);return!s&&r&&(s=[],this._undoStacks.set(t,s)),s||null}_getRedoStack(t,r=!1){let s=this._redoStacks.get(t);return!s&&r&&(s=[],this._redoStacks.set(t,s)),s||null}_getUndoStackForFocused(){const t=this._getFocusedUnitId();if(!t)throw new Error("No focused univer instance!");return this._getUndoStack(t,!0)}_getRedoStackForFocused(){const t=this._getFocusedUnitId();if(!t)throw new Error("No focused univer instance!");return this._getRedoStack(t,!0)}_tryBatchingElements(t,r){t.redoMutations.push(...r.redoMutations),t.undoMutations.push(...r.undoMutations)}_getFocusedUnitId(){var o,a,l,c;let t="";const r=this._contextService.getContextValue(Nn),s=this._contextService.getContextValue(Yu),i=this._contextService.getContextValue(Wu);return r?s?t=vs:i?t=Cs:t=(a=(o=this._univerInstanceService.getFocusedUnit())==null?void 0:o.getUnitId())!=null?a:"":t=(c=(l=this._univerInstanceService.getFocusedUnit())==null?void 0:l.getUnitId())!=null?c:"",t}},d.LocalUndoRedoService=QE([pi(0,mn),pi(1,Lt),pi(2,Gn)],d.LocalUndoRedoService);const Xr=St("core.resource-manager.service"),Ei={[kt.Editor]:"Editor",[kt.Owner]:"Owner",[kt.Reader]:"Reader",[kt.UNRECOGNIZED]:"UNRECOGNIZED"},Qr=e=>e?{userID:`${Ei[e]}_${K.generateRandomId(8)}`,name:Ei[e],avatar:""}:{userID:"",name:"",avatar:"",anonymous:!0,canBindAnonymous:!1},ZE=(e,n)=>e.startsWith(Ei[n]);class Jr{constructor(){R(this,"_model",new Map);R(this,"_userChange$",new ce.Subject);R(this,"userChange$",this._userChange$.asObservable());R(this,"_currentUser$",new ce.BehaviorSubject(Qr()));R(this,"currentUser$",this._currentUser$.asObservable())}getCurrentUser(){return this._currentUser$.getValue()}setCurrentUser(n){this.addUser(n),this._currentUser$.next(n)}addUser(n){this._model.set(n.userID,n),this._userChange$.next({type:"add",user:n})}getUser(n,t){const r=this._model.get(n);if(r)return r;t&&t()}delete(n){const t=this.getUser(n);this._model.delete(n),t&&this._userChange$.next({type:"delete",user:t})}clear(){this._model.clear(),this._userChange$.next({type:"clear"})}list(){return Array.from(this._model.values())}}var qE=Object.defineProperty,e0=Object.getOwnPropertyDescriptor,t0=(e,n,t,r)=>{for(var s=r>1?void 0:r?e0(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&qE(n,t,s),s},Qu=(e,n)=>(t,r)=>n(t,r,e);d.AuthzIoLocalService=class{constructor(n,t){R(this,"_permissionMap",new Map([]));this._resourceManagerService=n,this._userManagerService=t,this._initSnapshot(),this._initDefaultUser()}_initDefaultUser(){const n=this._userManagerService.getCurrentUser();n&&n.userID||this._userManagerService.setCurrentUser(Qr(kt.Owner))}_getRole(n){const t=this._userManagerService.getCurrentUser();return t?ZE(t.userID,n):!1}_initSnapshot(){this._resourceManagerService.registerPluginResource({toJson:n=>{const t=[...this._permissionMap.keys()].reduce((r,s)=>{const i=this._permissionMap.get(s);return r[s]=i,r},{});return JSON.stringify(t)},parseJson:n=>JSON.parse(n),pluginName:"SHEET_AuthzIoMockService_PLUGIN",businesses:[$e.UNIVER_SHEET,$e.UNIVER_DOC,$e.UNIVER_SLIDE],onLoad:(n,t)=>{for(const r in t)this._permissionMap.set(r,t[r])},onUnLoad:()=>{this._permissionMap.clear()}})}async create(n){return cn(8)}async allowed(n){return Promise.resolve([])}async batchAllowed(n){return Promise.resolve([])}async list(n){const t=[];return n.objectIDs.forEach(r=>{const s=this._permissionMap.get(r);if(s){const i={objectID:r,unitID:n.unitID,objectType:s.objectType,name:s.name,shareOn:!1,shareRole:kt.Owner,shareScope:-1,scope:{read:Js.AllCollaborator,edit:Js.AllCollaborator},creator:Qr(kt.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:n.actions.map(o=>({action:o,allowed:this._getRole(kt.Owner)||this._getRole(kt.Editor)}))};t.push(i)}}),t}async listCollaborators(){return[]}async listRoles(){return{roles:[],actions:[]}}async deleteCollaborator(){}async update(n){}async updateCollaborator(){}async createCollaborator(){}async putCollaborators(n){}},d.AuthzIoLocalService=t0([Qu(0,Xr),Qu(1,Ot(Jr))],d.AuthzIoLocalService);const Ju=St("IAuthzIoIoService"),Zu=St("univer.config-service");class qu{constructor(){R(this,"_configChanged$",new ce.Subject);R(this,"configChanged$",this._configChanged$.asObservable());R(this,"_config",new Map)}dispose(){this._configChanged$.complete()}getConfig(n){return this._config.get(n)}setConfig(n,t,r){var o;const{merge:s=!1}=r||{};let i=(o=this._config.get(n))!=null?o:{};s?i=K.deepMerge(i,t):i=t,this._config.set(n,i),this._configChanged$.next({[n]:i})}deleteConfig(n){return this._config.delete(n)}subscribeConfigValue$(n){return new ce.Observable(t=>{Object.prototype.hasOwnProperty.call(this._config,n)&&t.next(this._config.get(n));const r=this.configChanged$.pipe(ce.filter(s=>Object.prototype.hasOwnProperty.call(s,n))).subscribe(s=>t.next(s[n]));return()=>r.unsubscribe()})}}class ec extends rt{constructor(){super(...arguments);R(this,"_error$",new ce.Subject);R(this,"error$",this._error$.asObservable())}dispose(){this._error$.complete()}emit(t){this._error$.next({errorKey:t})}}class cr extends rt{constructor(){super();R(this,"_currentLocale$",new ce.BehaviorSubject(Qn.ZH_CN));R(this,"currentLocale$",this._currentLocale$.asObservable());R(this,"_locales",null);R(this,"localeChanged$",new ce.Subject);R(this,"t",(t,...r)=>{if(!this._locales)throw new Error("[LocaleService]: Locale not initialized");const s=t.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 t});this.disposeWithMe(Ze(()=>this.localeChanged$.complete()))}get _currentLocale(){return this._currentLocale$.value}load(t){var r;this._locales=K.deepMerge((r=this._locales)!=null?r:{},t)}setLocale(t){this._currentLocale$.next(t),this.localeChanged$.next()}getLocales(){var t;return(t=this._locales)==null?void 0:t[this._currentLocale]}getCurrentLocale(){return this._currentLocale}resolveKeyPath(t,r){const s=r.shift();if(s&&t&&s in t){const i=t[s];return r.length>0&&(typeof i=="object"||Array.isArray(i))?this.resolveKeyPath(i,r):i}return null}}var Ci=(e=>(e.INIT="init",e.FETCHING="fetching",e.DONE="done",e))(Ci||{});const tc=St("univer.permission-service");class nc extends rt{constructor(){super(...arguments);R(this,"_permissionPointMap",new Map);R(this,"_permissionPointUpdate$",new ce.Subject);R(this,"permissionPointUpdate$",this._permissionPointUpdate$.asObservable());R(this,"_showComponents",!0)}setShowComponents(t){this._showComponents=t}getShowComponents(){return this._showComponents}deletePermissionPoint(t){const r=this._permissionPointMap.get(t);r&&(r.complete(),this._permissionPointMap.delete(t))}addPermissionPoint(t){const r=t instanceof ce.BehaviorSubject,s=r?t.getValue():t;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?t:new ce.BehaviorSubject(s)),this._permissionPointUpdate$.next(s),!0}updatePermissionPoint(t,r){const s=this._permissionPointMap.get(t);if(!s)return;const i=s.getValue();i.value=r,i.status=Ci.DONE,s.next(i),this._permissionPointUpdate$.next(i)}clearPermissionMap(){this._permissionPointMap.clear()}getPermissionPoint(t){const r=this._permissionPointMap.get(t);if(r)return r.getValue()}getPermissionPoint$(t){const r=this._permissionPointMap.get(t);if(r)return r}composePermission$(t){const r=t.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 ce.combineLatest(r).pipe(Ht.map(s=>s))}composePermission(t){return t.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 t=new Map;return this._permissionPointMap.forEach((r,s)=>{t.set(s,r)}),t}}const rc=Symbol("DependentOn");class vi extends rt{onStarting(){}onReady(){}onRendered(){}onSteady(){}getUniverInstanceType(){return this.constructor.type}getPluginName(){return this.constructor.pluginName}}R(vi,"pluginName"),R(vi,"type",$e.UNIVER_UNKNOWN);class n0{constructor(){R(this,"_plugins",[])}addPlugin(n){this._plugins.push(n)}removePlugins(){const n=this._plugins.slice();return this._plugins.length=0,n}forEachPlugin(n){this._plugins.forEach(n)}}class r0{constructor(){R(this,"_pluginsRegistered",[])}registerPlugin(n,t){this._pluginsRegistered.push({plugin:n,options:t})}getRegisterPlugins(){return this._pluginsRegistered.slice()}removePlugins(){this._pluginsRegistered=[]}}var s0=Object.defineProperty,i0=Object.getOwnPropertyDescriptor,sc=(e,n,t,r)=>{for(var s=r>1?void 0:r?i0(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&s0(n,t,s),s},Zr=(e,n)=>(t,r)=>n(t,r,e);const o0=4;function a0(...e){return function(n){n[rc]=e}}d.PluginService=class{constructor(n){R(this,"_pluginHolderForUniver");R(this,"_pluginHoldersForTypes",new Map);R(this,"_seenPlugins",new Set);R(this,"_flushTimer");this._injector=n,this._pluginHolderForUniver=this._injector.createInstance(qr,this._checkPluginSeen.bind(this),this._immediateInitPlugin.bind(this)),this._pluginHoldersForTypes.set($e.UNIVER_UNKNOWN,this._pluginHolderForUniver),this._pluginHolderForUniver.start()}dispose(){this._clearFlushTimer();for(const n of this._pluginHoldersForTypes.values())n.dispose();this._pluginHolderForUniver.dispose()}registerPlugin(n,t){this._assertPluginValid(n),this._scheduleInitPlugin();const{type:r}=n;r===$e.UNIVER_UNKNOWN?(this._pluginHolderForUniver.register(n,t),this._pluginHolderForUniver.flush()):this._ensurePluginHolderForType(r).register(n,t)}startPluginForType(n){this._ensurePluginHolderForType(n).start()}_ensurePluginHolderForType(n){if(!this._pluginHoldersForTypes.has(n)){const t=this._injector.createInstance(qr,this._checkPluginSeen.bind(this),this._immediateInitPlugin.bind(this));return this._pluginHoldersForTypes.set(n,t),t}return this._pluginHoldersForTypes.get(n)}_immediateInitPlugin(n){this._seenPlugins.add(n.pluginName),this._ensurePluginHolderForType(n.type).immediateInitPlugin(n)}_checkPluginSeen(n){return this._seenPlugins.has(n.pluginName)}_assertPluginValid(n){const{type:t,pluginName:r}=n;if(t===$e.UNRECOGNIZED)throw new Error(`[PluginService]: invalid plugin type for ${n.name}. Please assign a "type" to your plugin.`);if(!r)throw new Error(`[PluginService]: no plugin name for ${n.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(n.pluginName)}_scheduleInitPlugin(){this._flushTimer===void 0&&(this._flushTimer=setTimeout(()=>{this._pluginHolderForUniver.started||this._pluginHolderForUniver.start(),this._flushPlugins(),this._clearFlushTimer()},o0))}_clearFlushTimer(){this._flushTimer&&(clearTimeout(this._flushTimer),this._flushTimer=void 0)}_flushPlugins(){this._pluginHolderForUniver.flush();for(const[n,t]of this._pluginHoldersForTypes)t.started&&t.flush()}},d.PluginService=sc([Zr(0,Ot(Dt))],d.PluginService);let qr=class extends rt{constructor(n,t,r,s,i){super();R(this,"_started",!1);R(this,"_warnedAboutOnStartingDeprecation",!1);R(this,"_pluginRegistry",new r0);R(this,"_pluginStore",new n0);R(this,"_pluginsInBatches",[]);this._checkPluginRegistered=n,this._registerPlugin=t,this._logService=r,this._injector=s,this._lifecycleService=i,this.disposeWithMe(this._lifecycleService.lifecycle$.pipe(ce.skip(1)).subscribe(o=>{this._pluginsInBatches.forEach(a=>this._runStage(a,o))}))}get started(){return this._started}dispose(){super.dispose(),this._pluginStore.forEachPlugin(n=>n.dispose()),this._pluginStore.removePlugins(),this._pluginRegistry.removePlugins(),this._pluginsInBatches.length=0}register(n,t){this._pluginRegistry.registerPlugin(n,t)}immediateInitPlugin(n){const t=this._initPlugin(n,void 0);this._pluginsRunLifecycle([t])}start(){this._started||(this._started=!0,this.flush())}flush(){if(!this._started)return;const n=this._pluginRegistry.getRegisterPlugins().map(({plugin:t,options:r})=>this._initPlugin(t,r));n.length&&(this._pluginsRunLifecycle(n),this._pluginRegistry.removePlugins())}_initPlugin(n,t){const r=n[rc];if(r){const i=()=>{const o=r.find(a=>!this._checkPluginRegistered(a));return o?(this._logService.debug("[PluginService]",`Plugin "${n.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(n,t);return this._pluginStore.addPlugin(s),this._logService.debug("[PluginService]",`Plugin "${s.getPluginName()}" registered.`),s}_pluginsRunLifecycle(n){Vu(this._lifecycleService.stage).subscribe(t=>this._runStage(n,t)),this._pluginsInBatches.push(n)}_runStage(n,t){n.forEach(r=>{switch(t){case We.Starting:r.onStarting();break;case We.Ready:r.onReady();break;case We.Rendered:r.onRendered();break;case We.Steady:r.onSteady();break}})}};qr=sc([Zr(2,Tt),Zr(3,Ot(Dt)),Zr(4,Ot(d.LifecycleService))],qr);function ic(e,n){if(!n)return e;const t=[];for(const r of e){const s=n.find(([i])=>i===r[0]);if(s){if(s[1]===null)continue;t.push([r[0],s[1]])}else t.push(r)}return t}var l0=Object.defineProperty,u0=Object.getOwnPropertyDescriptor,c0=(e,n,t,r)=>{for(var s=r>1?void 0:r?u0(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&l0(n,t,s),s},oc=(e,n)=>(t,r)=>n(t,r,e);let Ri=class extends rt{constructor(e,n){super(),this._resourceManagerService=e,this._univerInstanceService=n,this._init()}_init(){const e=t=>{t.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===t.pluginName);if(o)try{const a=t.parseJson(o.data);t.onLoad(s.getUnitId(),a)}catch{console.error(`Load Document{${s.getUnitId()}} Resources{${t.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===t.pluginName);if(o)try{const a=t.parseJson(o.data);t.onLoad(s.getUnitId(),a)}catch{console.error(`Load Workbook{${s.getUnitId()}} Resources{${t.pluginName}} Data Error.`)}})}})};this._resourceManagerService.getAllResourceHooks().forEach(t=>e(t)),this.disposeWithMe(this._resourceManagerService.register$.subscribe(t=>e(t))),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$($e.UNIVER_SHEET).subscribe(t=>{this._resourceManagerService.loadResources(t.getUnitId(),t.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$($e.UNIVER_DOC).subscribe(t=>{const r=t.getUnitId();Ao(r)||this._resourceManagerService.loadResources(t.getUnitId(),t.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$($e.UNIVER_SHEET).subscribe(t=>{this._resourceManagerService.unloadResources(t.getUnitId())})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$($e.UNIVER_DOC).subscribe(t=>{this._resourceManagerService.unloadResources(t.getUnitId())}))}saveUnit(e){const n=this._univerInstanceService.getUnit(e);if(!n)return null;const t=this._resourceManagerService.getResources(e,n.type),r=K.deepClone(n.getSnapshot());return r.resources=t,r}};Ri=c0([oc(0,Ot(Xr)),oc(1,Ot(mn))],Ri);const Ii=St("resource-loader-service");class ac extends rt{constructor(){super(...arguments);R(this,"_resourceMap",new Map);R(this,"_register$",new ce.Subject);R(this,"register$",this._register$.asObservable())}getAllResourceHooks(){return[...this._resourceMap.values()]}getResources(t,r){return r?this.getResourcesByType(t,r):this.getAllResourceHooks().map(o=>{const a=o.toJson(t);return{name:o.pluginName,data:a}})}getResourcesByType(t,r){return this.getAllResourceHooks().filter(o=>o.businesses.includes(r)).map(o=>{const a=o.toJson(t);return{name:o.pluginName,data:a}})}registerPluginResource(t){const r=t.pluginName;if(this._resourceMap.has(r))throw new Error(`the pluginName is registered {${r}}`);return this._resourceMap.set(r,t),this._register$.next(t),Ze(()=>this._resourceMap.delete(r))}disposePluginResource(t){this._resourceMap.delete(t)}loadResources(t,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(t,a)}catch{console.error("LoadResources Error!")}})}unloadResources(t){this.getAllResourceHooks().forEach(r=>{r.onUnLoad(t)})}dispose(){this._register$.complete(),this._resourceMap.clear()}}class Si extends rt{constructor(){super();R(this,"_currentTheme");R(this,"_currentTheme$",new ce.BehaviorSubject({}));R(this,"currentTheme$",this._currentTheme$.asObservable());this.disposeWithMe(Ze(()=>this._currentTheme$.complete()))}getCurrentTheme(){if(!this._currentTheme)throw new Error("[ThemeService]: current theme is not set!");return this._currentTheme}setTheme(t){this._currentTheme=t,this._currentTheme$.next(t)}}class lc{constructor(n={},t){R(this,"_startedTypes",new Set);R(this,"_injector");const r=this._injector=h0(t,n==null?void 0:n.override),{theme:s,locale:i,locales:o,logLevel:a}=n;s&&this._injector.get(Si).setTheme(s),o&&this._injector.get(cr).load(o),i&&this._injector.get(cr).setLocale(i),a&&this._injector.get(Tt).setLogLevel(a),this._init(r)}get _univerInstanceService(){return this._injector.get(mn)}get _pluginService(){return this._injector.get(d.PluginService)}__getInjector(){return this._injector}dispose(){this._injector.dispose()}setLocale(n){this._injector.get(cr).setLocale(n)}createUnit(n,t){return this._univerInstanceService.createUnit(n,t)}createUniverSheet(n){return this._injector.get(Tt).warn("[Univer]: Univer.createUniverSheet is deprecated, use createUnit instead"),this._univerInstanceService.createUnit($e.UNIVER_SHEET,n)}createUniverDoc(n){return this._injector.get(Tt).warn("[Univer]: Univer.createUniverDoc is deprecated, use createUnit instead"),this._univerInstanceService.createUnit($e.UNIVER_DOC,n)}createUniverSlide(n){return this._injector.get(Tt).warn("[Univer]: Univer.createUniverSlide is deprecated, use createUnit instead"),this._univerInstanceService.createUnit($e.UNIVER_SLIDE,n)}_init(n){this._univerInstanceService.registerCtorForType($e.UNIVER_SHEET,d.Workbook),this._univerInstanceService.registerCtorForType($e.UNIVER_DOC,Yt),this._univerInstanceService.registerCtorForType($e.UNIVER_SLIDE,_i);const t=n.get(mn);t.__setCreateHandler((r,s,i,o)=>{if(!this._startedTypes.has(r)){this._pluginService.startPluginForType(r),this._startedTypes.add(r);const l=n.createInstance(i,s);return t.__addUnit(l,o),this._tryProgressToReady(),l}const a=n.createInstance(i,s);return t.__addUnit(a,o),a})}_tryProgressToReady(){this._injector.get(d.LifecycleService).stage<We.Ready&&(this._injector.get(d.LifecycleService).stage=We.Ready)}registerPlugin(n,t){this._pluginService.registerPlugin(n,t)}}function h0(e,n){const t=ic([[ec],[cr],[Si],[d.LifecycleService],[d.PluginService],[Jr],[mn,{useClass:d.UniverInstanceService}],[tc,{useClass:nc}],[Tt,{useClass:ma,lazy:!0}],[Lt,{useClass:d.CommandService}],[tn,{useClass:d.LocalUndoRedoService,lazy:!0}],[Zu,{useClass:qu}],[Gn,{useClass:fa}],[Xr,{useClass:ac,lazy:!0}],[Ii,{useClass:Ri,lazy:!0}],[Ju,{useClass:d.AuthzIoLocalService,lazy:!0}]],n),r=e?e.createChild(t):new Dt(t);return na(r,[[Jr],[Ii]]),r}var d0=Object.defineProperty,f0=Object.getOwnPropertyDescriptor,g0=(e,n,t,r)=>{for(var s=r>1?void 0:r?f0(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&d0(n,t,s),s},uc=(e,n)=>(t,r)=>n(t,r,e);d.FHooks=class extends zn{constructor(n,t){super(),this._injector=n,this._lifecycleService=t}onStarting(n){return Ze(this._lifecycleService.lifecycle$.pipe(ce.filter(t=>t===We.Starting)).subscribe(n))}onReady(n){return Ze(this._lifecycleService.lifecycle$.pipe(ce.filter(t=>t===We.Ready)).subscribe(n))}onRendered(n){return Ze(this._lifecycleService.lifecycle$.pipe(ce.filter(t=>t===We.Rendered)).subscribe(n))}onSteady(n){return Ze(this._lifecycleService.lifecycle$.pipe(ce.filter(t=>t===We.Steady)).subscribe(n))}onBeforeUndo(n){return this._injector.get(Lt).beforeCommandExecuted(r=>{if(r.id===lr.id){const i=this._injector.get(tn).pitchTopUndoElement();i&&n(i)}})}onUndo(n){return this._injector.get(Lt).onCommandExecuted(r=>{if(r.id===lr.id){const i=this._injector.get(tn).pitchTopUndoElement();i&&n(i)}})}onBeforeRedo(n){return this._injector.get(Lt).beforeCommandExecuted(r=>{if(r.id===ur.id){const i=this._injector.get(tn).pitchTopRedoElement();i&&n(i)}})}onRedo(n){return this._injector.get(Lt).onCommandExecuted(r=>{if(r.id===ur.id){const i=this._injector.get(tn).pitchTopRedoElement();i&&n(i)}})}},d.FHooks=g0([uc(0,Ot(Dt)),uc(1,Ot(d.LifecycleService))],d.FHooks);var m0=Object.defineProperty,_0=Object.getOwnPropertyDescriptor,p0=(e,n,t,r)=>{for(var s=r>1?void 0:r?_0(n,t):n,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(r?o(n,t,s):o(s))||s);return r&&s&&m0(n,t,s),s},Oi=(e,n)=>(t,r)=>n(t,r,e);d.FUniver=class extends zn{constructor(n,t,r){super(),this._injector=n,this._commandService=t,this._univerInstanceService=r}static newAPI(n){return(n instanceof lc?n.__getInjector():n).createInstance(d.FUniver)}disposeUnit(n){return this._univerInstanceService.disposeUnit(n)}getCurrentLifecycleStage(){return this._injector.get(d.LifecycleService).stage}undo(){return this._commandService.executeCommand(lr.id)}redo(){return this._commandService.executeCommand(ur.id)}onBeforeCommandExecute(n){return this._commandService.beforeCommandExecuted((t,r)=>{n(t,r)})}onCommandExecuted(n){return this._commandService.onCommandExecuted((t,r)=>{n(t,r)})}executeCommand(n,t,r){return this._commandService.executeCommand(n,t,r)}getHooks(){return this._injector.createInstance(d.FHooks)}},d.FUniver=p0([Oi(0,Ot(Dt)),Oi(1,Lt),Oi(2,mn)],d.FUniver);function cc(e){return/^-?\d+(\.\d+)?$/.test(e)}function E0(e){return cc(e)?Number(e)<=Number.MAX_SAFE_INTEGER:!1}class yi{constructor(){R(this,"_data",[])}static create(){return new yi}add(n){this._data.indexOf(n)>-1||this._data.push(n)}delete(n){const t=this._data.indexOf(n);this._data.splice(t,1)}getData(){return this._data}}class wi{constructor(){R(this,"_data",new Map)}static create(){return new wi}add(n,t){this._data.has(n)||this._data.set(n,t)}delete(n){this._data.delete(n)}getData(){return this._data}}function C0(e){const n=new MessageChannel;let t=!1;const r=()=>{t||e()};return n.port1.onmessage=r,n.port2.postMessage(null),()=>{t=!0,n.port1.close(),n.port2.close()}}function v0(e,n){return n.forEach(t=>e.add(t)),e}function R0(e,n,t,r){var c;if(n==="")return e;const s={id:"mock-id",body:e,documentStyle:{}},i=new Yt(s),o=n.length;let a;for(;(a=(r?i.getBody().dataStream:i.getBody().dataStream.toLowerCase()).indexOf(n))>=0;){const h=new st,u=gn.getInstance();if(a>0&&h.retain(a),t.length>0){const f=i.sliceBody(a,a+o),g={dataStream:t};if(Array.isArray(f==null?void 0:f.textRuns)&&f.textRuns.length&&(g.textRuns=[{...f.textRuns[0],st:0,ed:t.length}]),(c=f==null?void 0:f.customRanges)!=null&&c.length){const p=f.customRanges[0];g.customRanges=[{...p,startIndex:0,endIndex:t.length-1}]}h.insert(t.length,g)}h.delete(o),i.apply(u.editOp(h.serialize()))}const l=i.getBody();return i.dispose(),l}const I0="__default_document_sub_component_id20231101__";class hc{constructor(){R(this,"skipNextObservers",!1);R(this,"lastReturnValue");R(this,"isStopPropagation",!1)}stopPropagation(){this.isStopPropagation=!0}}class S0 extends ce.Subject{constructor(){super(...arguments);R(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(t){let r;typeof t=="function"?r={next:([i,o])=>t(i,o)}:r=t;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(t=>{var r;return(r=t.complete)==null?void 0:r.call(t)}),this._sortedObservers.length=0}emitEvent(t){var r;if(!this.closed){const s=new hc;s.lastReturnValue=t;for(const i of this._sortedObservers){const o=(r=i.next)==null?void 0:r.call(i,[t,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 O0(e){return new ce.Observable(n=>{const t=e.subscribeEvent(r=>{n.next(r)});return()=>t.unsubscribe()})}const y0=St("ILocalStorageService");function w0(e){return!(e.length===0||e.length>31||e.startsWith("'")||e.endsWith("'")||/[:\\\/\?\*\[\]]/.test(e))}function b0(e){return new Promise(n=>setTimeout(n,e))}const A0=["script","style","meta","comment","link"];var dc=(e=>(e[e.INFO=0]="INFO",e[e.STOP=1]="STOP",e[e.WARNING=2]="WARNING",e))(dc||{}),fc=(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))(fc||{}),gc=(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))(gc||{}),mc=(e=>(e[e.TEXT=0]="TEXT",e[e.ARROW=1]="ARROW",e[e.CUSTOM=2]="CUSTOM",e))(mc||{}),_c=(e=>(e.VALID="valid",e.INVALID="invalid",e.VALIDATING="validating",e))(_c||{}),pc=(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))(pc||{});const Ec=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],bi=1,hr=8;class Ai{static from(n){if(!(n instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[t,r]=new Uint8Array(n,0,2);if(t!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=r>>4;if(s!==bi)throw new Error(`Got v${s} data when expected v${bi}.`);const i=Ec[r&15];if(!i)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(n,2,1),[a]=new Uint32Array(n,4,1);return new Ai(a,o,i,n)}constructor(n,t=64,r=Float64Array,s){if(isNaN(n)||n<0)throw new Error(`Unpexpected numItems value: ${n}.`);this.numItems=+n,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=r,this.IndexArrayType=n<65536?Uint16Array:Uint32Array;const i=Ec.indexOf(this.ArrayType),o=n*2*this.ArrayType.BYTES_PER_ELEMENT,a=n*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,hr,n),this.coords=new this.ArrayType(this.data,hr+a+l,n*2),this._pos=n*2,this._finished=!0):(this.data=new ArrayBuffer(hr+o+a+l),this.ids=new this.IndexArrayType(this.data,hr,n),this.coords=new this.ArrayType(this.data,hr+a+l,n*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(bi<<4)+i]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=n)}add(n,t){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=n,this.coords[this._pos++]=t,r}finish(){const n=this._pos>>1;if(n!==this.numItems)throw new Error(`Added ${n} items when expected ${this.numItems}.`);return Ti(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(n,t,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,f=l.pop()||0;if(u-f<=a){for(let I=f;I<=u;I++){const S=o[2*I],D=o[2*I+1];S>=n&&S<=r&&D>=t&&D<=s&&c.push(i[I])}continue}const g=f+u>>1,p=o[2*g],C=o[2*g+1];p>=n&&p<=r&&C>=t&&C<=s&&c.push(i[g]),(h===0?n<=p:t<=C)&&(l.push(f),l.push(g-1),l.push(1-h)),(h===0?r>=p:s>=C)&&(l.push(g+1),l.push(u),l.push(1-h))}return c}within(n,t,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,f=a.pop()||0;if(u-f<=o){for(let I=f;I<=u;I++)vc(i[2*I],i[2*I+1],n,t)<=c&&l.push(s[I]);continue}const g=f+u>>1,p=i[2*g],C=i[2*g+1];vc(p,C,n,t)<=c&&l.push(s[g]),(h===0?n-r<=p:t-r<=C)&&(a.push(f),a.push(g-1),a.push(1-h)),(h===0?n+r>=p:t+r>=C)&&(a.push(g+1),a.push(u),a.push(1-h))}return l}}function Ti(e,n,t,r,s,i){if(s-r<=t)return;const o=r+s>>1;Cc(e,n,o,r,s,i),Ti(e,n,t,r,o-1,1-i),Ti(e,n,t,o+1,s,1-i)}function Cc(e,n,t,r,s,i){for(;s>r;){if(s-r>600){const c=s-r+1,h=t-r+1,u=Math.log(c),f=.5*Math.exp(2*u/3),g=.5*Math.sqrt(u*f*(c-f)/c)*(h-c/2<0?-1:1),p=Math.max(r,Math.floor(t-h*f/c+g)),C=Math.min(s,Math.floor(t+(c-h)*f/c+g));Cc(e,n,t,p,C,i)}const o=n[2*t+i];let a=r,l=s;for(dr(e,n,r,t),n[2*s+i]>o&&dr(e,n,r,s);a<l;){for(dr(e,n,a,l),a++,l--;n[2*a+i]<o;)a++;for(;n[2*l+i]>o;)l--}n[2*r+i]===o?dr(e,n,r,l):(l++,dr(e,n,l,s)),l<=t&&(r=l+1),t<=l&&(s=l-1)}}function dr(e,n,t,r){Ni(e,t,r),Ni(n,2*t,2*r),Ni(n,2*t+1,2*r+1)}function Ni(e,n,t){const r=e[n];e[n]=e[t],e[t]=r}function vc(e,n,t,r){const s=e-t,i=n-r;return s*s+i*i}function Rc(e,n,t=0,r=e.length-1,s=T0){for(;r>t;){if(r-t>600){const l=r-t+1,c=n-t+1,h=Math.log(l),u=.5*Math.exp(2*h/3),f=.5*Math.sqrt(h*u*(l-u)/l)*(c-l/2<0?-1:1),g=Math.max(t,Math.floor(n-c*u/l+f)),p=Math.min(r,Math.floor(n+(l-c)*u/l+f));Rc(e,n,g,p,s)}const i=e[n];let o=t,a=r;for(fr(e,t,n),s(e[r],i)>0&&fr(e,t,r);o<a;){for(fr(e,o,a),o++,a--;s(e[o],i)<0;)o++;for(;s(e[a],i)>0;)a--}s(e[t],i)===0?fr(e,t,a):(a++,fr(e,a,r)),a<=n&&(t=a+1),n<=a&&(r=a-1)}}function fr(e,n,t){const r=e[n];e[n]=e[t],e[t]=r}function T0(e,n){return e<n?-1:e>n?1:0}class Ic{constructor(n=9){this._maxEntries=Math.max(4,n),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(n){let t=this.data;const r=[];if(!ts(n,t))return r;const s=this.toBBox,i=[];for(;t;){for(let o=0;o<t.children.length;o++){const a=t.children[o],l=t.leaf?s(a):a;ts(n,l)&&(t.leaf?r.push(a):Di(n,l)?this._all(a,r):i.push(a))}t=i.pop()}return r}collides(n){let t=this.data;if(!ts(n,t))return!1;const r=[];for(;t;){for(let s=0;s<t.children.length;s++){const i=t.children[s],o=t.leaf?this.toBBox(i):i;if(ts(n,o)){if(t.leaf||Di(n,o))return!0;r.push(i)}}t=r.pop()}return!1}load(n){if(!(n&&n.length))return this;if(n.length<this._minEntries){for(let r=0;r<n.length;r++)this.insert(n[r]);return this}let t=this._build(n.slice(),0,n.length-1,0);if(!this.data.children.length)this.data=t;else if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){const r=this.data;this.data=t,t=r}this._insert(t,this.data.height-t.height-1,!0)}return this}insert(n){return n&&this._insert(n,this.data.height-1),this}clear(){return this.data=Dn([]),this}remove(n,t){if(!n)return this;let r=this.data;const s=this.toBBox(n),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=N0(n,r.children,t);if(h!==-1)return r.children.splice(h,1),i.push(r),this._condense(i),this}!c&&!r.leaf&&Di(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(n){return n}compareMinX(n,t){return n.minX-t.minX}compareMinY(n,t){return n.minY-t.minY}toJSON(){return this.data}fromJSON(n){return this.data=n,this}_all(n,t){const r=[];for(;n;)n.leaf?t.push(...n.children):r.push(...n.children),n=r.pop();return t}_build(n,t,r,s){const i=r-t+1;let o=this._maxEntries,a;if(i<=o)return a=Dn(n.slice(t,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=Dn([]),a.leaf=!1,a.height=s;const l=Math.ceil(i/o),c=l*Math.ceil(Math.sqrt(o));Sc(n,t,r,c,this.compareMinX);for(let h=t;h<=r;h+=c){const u=Math.min(h+c-1,r);Sc(n,h,u,l,this.compareMinY);for(let f=h;f<=u;f+=l){const g=Math.min(f+l-1,u);a.children.push(this._build(n,f,g,s-1))}}return Mn(a,this.toBBox),a}_chooseSubtree(n,t,r,s){for(;s.push(t),!(t.leaf||s.length-1===r);){let i=1/0,o=1/0,a;for(let l=0;l<t.children.length;l++){const c=t.children[l],h=Mi(c),u=L0(n,c)-h;u<o?(o=u,i=h<i?h:i,a=c):u===o&&h<i&&(i=h,a=c)}t=a||t.children[0]}return t}_insert(n,t,r){const s=r?n:this.toBBox(n),i=[],o=this._chooseSubtree(s,this.data,t,i);for(o.children.push(n),mr(o,s);t>=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(s,i,t)}_split(n,t){const r=n[t],s=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,s);const o=this._chooseSplitIndex(r,i,s),a=Dn(r.children.splice(o,r.children.length-o));a.height=r.height,a.leaf=r.leaf,Mn(r,this.toBBox),Mn(a,this.toBBox),t?n[t-1].children.push(a):this._splitRoot(r,a)}_splitRoot(n,t){this.data=Dn([n,t]),this.data.height=n.height+1,this.data.leaf=!1,Mn(this.data,this.toBBox)}_chooseSplitIndex(n,t,r){let s,i=1/0,o=1/0;for(let a=t;a<=r-t;a++){const l=gr(n,0,a,this.toBBox),c=gr(n,a,r,this.toBBox),h=U0(l,c),u=Mi(l)+Mi(c);h<i?(i=h,s=a,o=u<o?u:o):h===i&&u<o&&(o=u,s=a)}return s||r-t}_chooseSplitAxis(n,t,r){const s=n.leaf?this.compareMinX:M0,i=n.leaf?this.compareMinY:D0,o=this._allDistMargin(n,t,r,s),a=this._allDistMargin(n,t,r,i);o<a&&n.children.sort(s)}_allDistMargin(n,t,r,s){n.children.sort(s);const i=this.toBBox,o=gr(n,0,t,i),a=gr(n,r-t,r,i);let l=es(o)+es(a);for(let c=t;c<r-t;c++){const h=n.children[c];mr(o,n.leaf?i(h):h),l+=es(o)}for(let c=r-t-1;c>=t;c--){const h=n.children[c];mr(a,n.leaf?i(h):h),l+=es(a)}return l}_adjustParentBBoxes(n,t,r){for(let s=r;s>=0;s--)mr(t[s],n)}_condense(n){for(let t=n.length-1,r;t>=0;t--)n[t].children.length===0?t>0?(r=n[t-1].children,r.splice(r.indexOf(n[t]),1)):this.clear():Mn(n[t],this.toBBox)}}function N0(e,n,t){if(!t)return n.indexOf(e);for(let r=0;r<n.length;r++)if(t(e,n[r]))return r;return-1}function Mn(e,n){gr(e,0,e.children.length,n,e)}function gr(e,n,t,r,s){s||(s=Dn(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(let i=n;i<t;i++){const o=e.children[i];mr(s,e.leaf?r(o):o)}return s}function mr(e,n){return e.minX=Math.min(e.minX,n.minX),e.minY=Math.min(e.minY,n.minY),e.maxX=Math.max(e.maxX,n.maxX),e.maxY=Math.max(e.maxY,n.maxY),e}function M0(e,n){return e.minX-n.minX}function D0(e,n){return e.minY-n.minY}function Mi(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function es(e){return e.maxX-e.minX+(e.maxY-e.minY)}function L0(e,n){return(Math.max(n.maxX,e.maxX)-Math.min(n.minX,e.minX))*(Math.max(n.maxY,e.maxY)-Math.min(n.minY,e.minY))}function U0(e,n){const t=Math.max(e.minX,n.minX),r=Math.max(e.minY,n.minY),s=Math.min(e.maxX,n.maxX),i=Math.min(e.maxY,n.maxY);return Math.max(0,s-t)*Math.max(0,i-r)}function Di(e,n){return e.minX<=n.minX&&e.minY<=n.minY&&n.maxX<=e.maxX&&n.maxY<=e.maxY}function ts(e,n){return n.minX<=e.maxX&&n.minY<=e.maxY&&n.maxX>=e.minX&&n.maxY>=e.minY}function Dn(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Sc(e,n,t,r,s){const i=[n,t];for(;i.length;){if(t=i.pop(),n=i.pop(),t-n<=r)continue;const o=n+Math.ceil((t-n)/r/2)*r;Rc(e,o,n,t,s),i.push(n,o,o,t)}}class P0{constructor(n=!1){R(this,"_tree",new Map);R(this,"_oneCellCache",new Map);R(this,"_kdTree",new Map);this._enableOneCellCache=n}dispose(){this.clear()}getTree(n,t){return this._tree.has(n)||this._tree.set(n,new Map),this._tree.get(n).has(t)||this._tree.get(n).set(t,new Ic),this._tree.get(n).get(t)}_getOneCellCache(n,t,r,s){return this._oneCellCache.has(n)||this._oneCellCache.set(n,new Map),this._oneCellCache.get(n).has(t)||this._oneCellCache.get(n).set(t,new Map),this._oneCellCache.get(n).get(t).has(r)||this._oneCellCache.get(n).get(t).set(r,new Map),this._oneCellCache.get(n).get(t).get(r).has(s)||this._oneCellCache.get(n).get(t).get(r).set(s,new Set),this._oneCellCache.get(n).get(t).get(r).get(s)}_removeOneCellCache(n,t,r,s,i){const o=this._oneCellCache.get(n);if(!o)return;const a=o.get(t);if(!a)return;const l=a.get(r);if(!l)return;const c=l.get(s);c&&c.delete(i)}_removeCellCacheByRange(n){const{unitId:t,sheetId:r,range:s,id:i}=n,o=this._oneCellCache.get(t);if(!o)return;const a=o.get(r);if(!a)return;const{startRow:l,startColumn:c,endRow:h,endColumn:u}=s;for(let f=l;f<=h;f++){const g=a.get(f);if(g)for(let p=c;p<=u;p++){const C=g.get(p);C&&C.delete(i)}}}_insertOneCellCache(n,t,r,s,i){this._getOneCellCache(n,t,r,s).add(i)}_getRdTreeItems(n){const t=[];for(const[r,s]of n)for(const[i,o]of s)t.push({x:i,y:r,ids:o});return t}_searchByOneCellCache(n){var p;const{unitId:t,sheetId:r,range:s}=n,{startRow:i,startColumn:o,endRow:a,endColumn:l}=s,c=(p=this._kdTree.get(t))==null?void 0:p.get(r);if(!c)return[];const{tree:h,items:u}=c,f=h.range(o,i,l,a),g=[];for(const C of f){const I=u[C];g.push(...Array.from(I.ids))}return g}openKdTree(){var n;for(const[t,r]of this._oneCellCache){this._kdTree.has(t)||this._kdTree.set(t,new Map);for(const[s,i]of r){const o=this._getRdTreeItems(i),a=new Ai(o.length);(n=this._kdTree.get(t))==null||n.set(s,{tree:a,items:o});for(const l of o)a.add(l.x,l.y);a.finish()}}}closeKdTree(){var n;for(const[t,r]of this._oneCellCache)for(const[s,i]of r)(n=this._kdTree.get(t))==null||n.set(s,void 0)}insert(n){const{unitId:t,sheetId:r,range:s,id:i}=n;if(!t||t.length===0)return;let{startRow:o,endRow:a,startColumn:l,endColumn:c}=s;if(this._enableOneCellCache&&o===a&&l===c){this._insertOneCellCache(t,r,o,l,i);return}const h=this.getTree(t,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(n){for(const t of n)this.insert(t)}*searchGenerator(n){var a;const{unitId:t,sheetId:r,range:s}=n;if(this._enableOneCellCache){const l=this._searchByOneCellCache(n);for(const c of l)yield c}const i=(a=this._tree.get(t))==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(n,t){const r=new Set;for(const s of n)for(const i of this.searchGenerator(s))(t==null?void 0:t.has(i))!==!0&&r.add(i);return r}removeById(n,t){var r,s;t?((r=this._tree.get(n))==null||r.delete(t),(s=this._oneCellCache.get(n))==null||s.delete(t)):(this._tree.delete(n),this._oneCellCache.delete(n))}_removeRTreeItem(n){const{unitId:t,sheetId:r,range:s,id:i}=n,o=this.getTree(t,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(n){const{unitId:t,sheetId:r,range:s,id:i}=n,{startRow:o,startColumn:a,endRow:l,endColumn:c}=s;this._enableOneCellCache?o===l&&a===c?this._removeOneCellCache(t,r,s.startRow,s.startColumn,i):(this._removeCellCacheByRange(n),this._removeRTreeItem(n)):this._removeRTreeItem(n)}bulkRemove(n){for(const t of n)this.remove(t)}clear(){this._tree.clear(),this._oneCellCache.clear()}toJSON(){const n={};return this._tree.forEach((t,r)=>{n[r]={},t.forEach((s,i)=>{n[r][i]=s.toJSON()})}),n}fromJSON(n){this._tree.clear();for(const t in n){this._tree.set(t,new Map);for(const r in n[t]){const s=new Ic;s.fromJSON(n[t][r]),this._tree.get(t).set(r,s)}}}}Tc(),d.ABCToNumber=tp,d.AbsoluteRefType=tt,d.ActionIterator=Tn,d.AlignTypeH=ou,d.AlignTypeV=au,d.ArrangeTypeEnum=cu,d.ArrowsAndMarkersShapes=Pa,d.AsyncInterceptorManager=Vg,d.AutoFillSeries=Sa,d.BaselineOffset=jt,d.BasicShapes=Ua,d.BlockType=$l,d.BooleanNumber=Te,d.BorderStyleTypes=Ke,d.BorderType=Oa,d.BuildTextUtils=$t,d.BulletAlignment=tr,d.COLORS=js,d.CellValueType=Qt,d.Color=hn,d.ColorBuilder=Pr,d.ColorKit=Nt,d.ColorType=yt,d.ColumnSeparatorType=jl,d.CommandType=Kn,d.CommonHideTypes=ya,d.ConfigService=qu,d.ContextService=fa,d.CopyPasteType=wa,d.CustomCommandExecutionError=Ps,d.CustomDecorationType=fn,d.CustomRangeType=nr,d.DEFAULT_CELL=B_,d.DEFAULT_DOC=gi,d.DEFAULT_DOCUMENT_SUB_COMPONENT_ID=I0,d.DEFAULT_EMPTY_DOCUMENT_VALUE=bo,d.DEFAULT_RANGE=x_,d.DEFAULT_RANGE_ARRAY=$_,d.DEFAULT_SELECTION=H_,d.DEFAULT_SLIDE=hl,d.DEFAULT_STYLES=ct,d.DEFAULT_WORKSHEET_COLUMN_COUNT=Uu,d.DEFAULT_WORKSHEET_COLUMN_COUNT_KEY=vE,d.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT=$u,d.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY=OE,d.DEFAULT_WORKSHEET_COLUMN_WIDTH=ku,d.DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY=IE,d.DEFAULT_WORKSHEET_ROW_COUNT=Lu,d.DEFAULT_WORKSHEET_ROW_COUNT_KEY=CE,d.DEFAULT_WORKSHEET_ROW_HEIGHT=Pu,d.DEFAULT_WORKSHEET_ROW_HEIGHT_KEY=RE,d.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH=Fu,d.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY=SE,d.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY=vs,d.DOCS_NORMAL_EDITOR_UNIT_ID_KEY=Cs,d.DOCS_ZEN_EDITOR_UNIT_ID_KEY=wo,d.DOC_RANGE_TYPE=Ga,d.DashStyleType=Xl,d.DataStreamTreeNodeType=wu,d.DataStreamTreeTokenType=zt,d.DataValidationErrorStyle=dc,d.DataValidationImeMode=fc,d.DataValidationOperator=gc,d.DataValidationRenderMode=mc,d.DataValidationStatus=_c,d.DataValidationType=pc,d.DeleteDirection=ba,d.DependentOn=a0,d.DesktopLogService=ma,d.DeveloperMetadataVisibility=Aa,d.Dimension=Ta,d.Direction=Na,d.Disposable=rt,d.DisposableCollection=Fs,d.DocStyleType=kl,d.DocumentDataModel=Yt,d.DocumentFlavor=xl,d.DrawingTypeEnum=hu,d.EDITOR_ACTIVATED=Wu,d.EXTENSION_NAMES=dl,d.ErrorService=ec,d.EventState=hc,d.EventSubject=S0,d.FBase=zn,d.FOCUSING_COMMON_DRAWINGS=$E,d.FOCUSING_DOC=or,d.FOCUSING_EDITOR_BUT_HIDDEN=DE,d.FOCUSING_EDITOR_INPUT_FORMULA=LE,d.FOCUSING_EDITOR_STANDALONE=PE,d.FOCUSING_FX_BAR_EDITOR=Yu,d.FOCUSING_PANEL_EDITOR=kE,d.FOCUSING_SHEET=Nn,d.FOCUSING_SLIDE=ar,d.FOCUSING_UNIT=ir,d.FOCUSING_UNIVER_EDITOR=UE,d.FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE=FE,d.FORMULA_EDITOR_ACTIVATED=xE,d.FollowNumberWithType=Fl,d.FontItalic=Mr,d.FontStyleType=wn,d.FontWeight=Dr,d.FormatType=Ma,d.GlyphType=Se,d.GridType=Hl,d.HLSColor=Ya,d.HorizontalAlign=Xt,d.IAuthzIoService=Ju,d.ICommandService=Lt,d.IConfigService=Zu,d.IContextService=Gn,d.ILocalStorageService=y0,d.ILogService=Tt,d.IPermissionService=tc,d.IResourceLoaderService=Ii,d.IResourceManagerService=Xr,d.IS_ROW_STYLE_PRECEDE_COLUMN_STYLE=Qf,d.IUndoRedoService=tn,d.IUniverInstanceService=mn,d.Inject=Ot,d.Injector=Dt,d.InterceptorEffectEnum=Sn,d.InterceptorManager=Wg,d.InterpolationPointType=Da,d.JSON1=dp,d.JSONX=gn,d.LRUHelper=Zn,d.LRUMap=Br,d.LifecycleStages=We,d.LocaleService=cr,d.LocaleType=Qn,d.LogLevel=ga,d.MOVE_BUFFER_VALUE=Xn,d.Many=ko,d.MemoryCursor=On,d.NamedStyleType=Gl,d.NilCommand=pa,d.NumberUnitType=iu,d.ObjectMatrix=Pt,d.ObjectRelativeFromH=ru,d.ObjectRelativeFromV=su,d.Optional=Fo,d.OtherShapes=ka,d.PRESET_LIST_TYPE=rr,d.PageElementType=du,d.PageOrientType=uu,d.PageType=hi,d.ParagraphElementType=Yl,d.PermissionService=nc,d.PermissionStatus=Ci,d.Plugin=vi,d.PositionedObjectLayoutType=Vl,d.PresetListType=Ft,d.ProtectionType=La,d.QuickListType=gu,d.QuickListTypeMap=Ep,d.RANGE_DIRECTION=Va,d.RANGE_TYPE=we,d.RCDisposable=Zg,d.RGBA_PAREN=Tm,d.RGB_PAREN=Am,d.ROTATE_BUFFER_VALUE=Ia,d.RTree=P0,d.Range=yn,d.Rectangle=qt,d.RediConsumer=Zo,d.RediContext=Yn,d.RediError=at,d.RediProvider=Ls,d.RedoCommand=ur,d.RedoCommandId=Ku,d.RefAlias=ep,d.Registry=yi,d.RegistryAsMap=wi,d.RelativeDate=$a,d.RelativeSlideLink=fu,d.ResourceManagerService=ac,d.RgbColor=kr,d.RxDisposable=Jg,d.SHEET_EDITOR_UNITS=j_,d.SectionType=Bl,d.Self=Yo,d.SheetTypes=xa,d.SheetViewModel=Hu,d.SkipSelf=Wo,d.SliceBodyType=di,d.SlideDataModel=_i,d.SpacingRule=Kl,d.SpecialShapes=Fa,d.Styles=Su,d.THEME_COLORS=Wa,d.TabStopAlignment=Ql,d.TableAlignmentType=Zl,d.TableLayoutType=ql,d.TableRowHeightRule=tu,d.TableSizeType=Jl,d.TableTextWrapType=eu,d.TextDecoration=Ha,d.TextDirection=Jn,d.TextDirectionType=Wl,d.TextX=st,d.TextXActionType=oe,d.ThemeColor=Fr,d.ThemeColorType=ft,d.ThemeColors=Lr,d.ThemeService=Si,d.Tools=K,d.UndoCommand=lr,d.UndoCommandId=Xu,d.UnitModel=Yr,d.Univer=lc,d.UniverInstanceType=$e,d.UpdateDocsAttributeType=De,d.UserManagerService=Jr,d.VerticalAlign=ln,d.VerticalAlignmentType=nu,d.WithDependency=Ug,d.WithNew=zo,d.Worksheet=sr,d.WrapStrategy=un,d.WrapTextType=zl,d.addLinkToDocumentModel=Nu,d.afterInitApply=am,d.afterTime=om,d.awaitTime=b0,d.binSearchFirstGreaterThanTarget=Ra,d.binarySearchArray=lm,d.bufferDebounceTime=im,d.cellToRange=s_,d.characterSpacingControlType=lu,d.checkForSubstrings=i_,d.checkIfMove=hm,d.checkParagraphHasBullet=S_,d.checkParagraphHasIndent=O_,d.checkParagraphHasIndentByStyle=ol,d.codeToBlob=cm,d.composeBody=fi,d.composeInterceptors=sa,d.composeStyles=Hs,d.concatMatrixArray=U_,d.connectDependencies=Mg,d.connectInjector=Ng,d.convertBodyToHtml=bm,d.convertCellToRange=Ka,d.covertTextRunToHtml=Bs,d.createAsyncInterceptorKey=Yg,d.createDefaultUser=Qr,d.createIdentifier=St,d.createInterceptorKey=jg,d.createInternalEditorID=Jf,d.createRowColIter=Qs,d.dayjs=Wt,d.debounce=wf,d.dedupe=Yf,d.deepCompare=zs,d.deleteContent=ll,d.extractPureTextFromCell=ju,d.forwardRef=og,d.fromCallback=Ea,d.fromEventSubject=O0,d.fromObservable=Qg,d.generateRandomId=cn,d.get=nf,d.getArrayLength=Zt,d.getBodySlice=en,d.getBodySliceHtml=Ur,d.getBorderStyleType=t_,d.getCellInfoInMergeData=Km,d.getCellValueType=Ym,d.getColorStyle=Ut,d.getCustomDecorationSlice=Eu,d.getCustomRangeSlice=pu,d.getDocsUpdateBody=n_,d.getIntersectRange=K_,d.getOriginCellValue=wE,d.getReverseDirection=dm,d.getWorksheetUID=ME,d.groupBy=Gf,d.handleStyleToString=e_,d.hashAlgorithm=b_,d.horizontalLineSegmentsSubtraction=Hr,d.insertMatrixArray=Vs,d.insertTextToContent=al,d.isAsyncDependencyItem=ws,d.isAsyncHook=wr,d.isBlackColor=Bm,d.isBooleanString=Xf,d.isCellCoverable=Jm,d.isCellV=Vm,d.isClassDependencyItem=Ss,d.isCtor=Is,d.isDisposable=Ms,d.isEmptyCell=Xa,d.isFactoryDependencyItem=Os,d.isFormulaId=qm,d.isFormulaString=Zm,d.isICellData=Wm,d.isInternalEditorID=Ao,d.isNodeEnv=wm,d.isNullCell=zm,d.isNumeric=cc,d.isRangesEqual=hE,d.isRealNum=w_,d.isSafeNumeric=E0,d.isSameStyleTextRun=Qa,d.isUnitRangesEqual=dE,d.isValidRange=r_,d.isValueDependencyItem=ys,d.isWhiteColor=jm,d.makeArray=Kf,d.makeCellRangeToRangeData=Qm,d.makeCellToSelection=Xm,d.makeCustomRangeStream=eE,d.merge=Mf,d.mergeOverrideWithDependencies=ic,d.mergeSets=v0,d.mergeWith=Nf,d.mergeWorksheetSnapshotWithDefault=xu,d.mixinClass=Gg,d.moveMatrixArray=Ks,d.moveRangeByOffset=W_,d.nameCharacterCheck=w0,d.normalizeBody=bp,d.normalizeTextRuns=er,d.numberToABC=rp,d.numberToListABC=sp,d.numfmt=L_,d.queryObjectMatrix=q_,d.registerDependencies=Hg,d.remove=Bn,d.repeatStringNumTimes=pl,d.replaceInDocumentBody=R0,d.requestImmediateMacroTask=C0,d.rotate=Vf,d.searchArray=um,d.searchInOrderedArray=va,d.selectionToArray=Gm,d.sequence=oa,d.sequenceAsync=ia,d.sequenceExecute=$s,d.sequenceExecuteAsync=sm,d.set=Lf,d.setDependencies=Sg,d.shallowEqual=ra,d.skipParseTagNames=A0,d.sliceMatrixArray=P_,d.sortRules=ip,d.sortRulesByDesc=op,d.sortRulesFactory=qn,d.spliceArray=Gs,d.splitIntoGrid=Xs,d.takeAfter=Ca,d.textDiff=yo,d.throttle=Bg,d.toDisposable=Ze,d.touchDependencies=na,d.updateAttributeByDelete=Cu,d.updateAttributeByInsert=vu,d.useDependency=Ag,d.useDependencyContext=$g,d.useDependencyContextValue=xg,d.useDependencyValue=ea,d.useInjector=qo,d.useObservable=kg,d.useUpdateBinder=Fg,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});