@univerjs/core 0.15.2 → 0.15.3

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,8 +1,8 @@
1
- (function(f,Ce){typeof exports=="object"&&typeof module<"u"?Ce(exports,require("@wendellhu/redi"),require("rxjs"),require("rxjs/operators"),require("@univerjs/themes")):typeof define=="function"&&define.amd?define(["exports","@wendellhu/redi","rxjs","rxjs/operators","@univerjs/themes"],Ce):(f=typeof globalThis<"u"?globalThis:f||self,Ce(f.UniverCore={},f["@wendellhu/redi"],f.rxjs,f.rxjs.operators,f.UniverThemes))})(this,(function(f,Ce,se,qr,Jr){"use strict";var UI=Object.defineProperty;var PI=(f,Ce,se)=>Ce in f?UI(f,Ce,{enumerable:!0,configurable:!0,writable:!0,value:se}):f[Ce]=se;var E=(f,Ce,se)=>PI(f,typeof Ce!="symbol"?Ce+"":Ce,se);var Ad,Td;function Md(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const Ut=typeof global<"u"?global:typeof self<"u"?self:window;function Dd(){const t=new Map;let n=0;typeof Ut.requestIdleCallback!="function"&&(Ut.requestIdleCallback=function(s){const i=Date.now(),o=++n,a=setTimeout(function(){t.delete(o);const c=Math.max(0,50-(Date.now()-i));s({didTimeout:c===0,timeRemaining(){return c}})},1);return t.set(o,a),o}),typeof Ut.cancelIdleCallback!="function"&&(Ut.cancelIdleCallback=function(s){const i=t.get(s);i!==void 0&&(clearTimeout(i),t.delete(s))})}function Ld(){typeof Ut.Array.prototype.findLastIndex!="function"&&(Ut.Array.prototype.findLastIndex=function(t,n){if(this==null)throw new TypeError("Array.prototype.findLastIndex called on null or undefined");if(typeof t!="function")throw new TypeError("callback must be a function");const r=this.length>>>0;for(let s=r-1;s>=0;s--)if(s in this&&t.call(n,this[s],s,this))return s;return-1}),typeof Ut.Array.prototype.findLast!="function"&&(Ut.Array.prototype.findLast=function(t,n){const r=this.findLastIndex(t,n);return r!==-1?this[r]:void 0})}function Ud(){typeof Ut.String.prototype.at!="function"&&(Ut.String.prototype.at=function(t){if(this==null)throw new TypeError("String.prototype.at called on null or undefined");const n=this.length;if(t<0&&(t=n+t),!(t<0||t>=n))return this.charAt(t)})}function Pd(){Dd(),Ld(),Ud()}function rr(e,t){const n=e.indexOf(t);return n>-1?(e.splice(n,1),!0):!1}function kd(e){const t=new Set,n=[];for(const r of e)t.has(r)||(t.add(r),n.push(r));return n}function Fd(e,t){const n=new Set,r=[];for(const s of e){const i=t(s);n.has(i)||(n.add(i),r.push(s))}return r}function xd(e,t){for(let n=e.length-1;n>-1;n--){const r=e[n];if(t(r,n))return r}return null}function Hd(e,t){if(e.length===0)return e;const n=t%e.length;return e.slice(n).concat(e.slice(0,n))}function Bd(e,t){const n=new Map;return e.forEach(r=>{const s=t(r);let i=n.get(s);n.has(s)||(i=[],n.set(s,i)),i.push(r)}),n}function $d(e){return Array.isArray(e)?e:[e]}function pt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oi,Ra;function jd(){if(Ra)return oi;Ra=1;var e=function(t){if(t=t||{},this.Promise=t.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=t.domainReentrant||!1,this.domainReentrant){if(typeof process>"u"||typeof process.domain>"u")throw new Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=t.timeout||e.DEFAULT_TIMEOUT,this.maxOccupationTime=t.maxOccupationTime||e.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=t.maxExecutionTime||e.DEFAULT_MAX_EXECUTION_TIME,t.maxPending===1/0||Number.isInteger(t.maxPending)&&t.maxPending>=0?this.maxPending=t.maxPending:this.maxPending=e.DEFAULT_MAX_PENDING};return e.DEFAULT_TIMEOUT=0,e.DEFAULT_MAX_OCCUPATION_TIME=0,e.DEFAULT_MAX_EXECUTION_TIME=0,e.DEFAULT_MAX_PENDING=1e3,e.prototype.acquire=function(t,n,r,s){if(Array.isArray(t))return this._acquireBatch(t,n,r,s);if(typeof n!="function")throw new Error("You must pass a function to execute");var i=null,o=null,a=null;typeof r!="function"&&(s=r,r=null,a=new this.Promise(function(x,Y){i=x,o=Y})),s=s||{};var l=!1,c=null,u=null,h=null,d=this,m=function(x,Y,O){u&&(clearTimeout(u),u=null),h&&(clearTimeout(h),h=null),x&&(d.queues[t]&&d.queues[t].length===0&&delete d.queues[t],d.domainReentrant&&delete d.domains[t]),l||(a?Y?o(Y):i(O):typeof r=="function"&&r(Y,O),l=!0),x&&d.queues[t]&&d.queues[t].length>0&&d.queues[t].shift()()},_=function(x){if(l)return m(x);c&&(clearTimeout(c),c=null),d.domainReentrant&&x&&(d.domains[t]=process.domain);var Y=s.maxExecutionTime||d.maxExecutionTime;if(Y&&(h=setTimeout(function(){d.queues[t]&&m(x,new Error("Maximum execution time is exceeded "+t))},Y)),n.length===1){var O=!1;try{n(function(R,b){O||(O=!0,m(x,R,b))})}catch(R){O||(O=!0,m(x,R))}}else d._promiseTry(function(){return n()}).then(function(R){m(x,void 0,R)},function(R){m(x,R)})};d.domainReentrant&&process.domain&&(_=process.domain.bind(_));var p=s.maxPending||d.maxPending;if(!d.queues[t])d.queues[t]=[],_(!0);else if(d.domainReentrant&&process.domain&&process.domain===d.domains[t])_(!1);else if(d.queues[t].length>=p)m(!1,new Error("Too many pending tasks in queue "+t));else{var I=function(){_(!0)};s.skipQueue?d.queues[t].unshift(I):d.queues[t].push(I);var y=s.timeout||d.timeout;y&&(c=setTimeout(function(){c=null,m(!1,new Error("async-lock timed out in queue "+t))},y))}var H=s.maxOccupationTime||d.maxOccupationTime;if(H&&(u=setTimeout(function(){d.queues[t]&&m(!1,new Error("Maximum occupation time is exceeded in queue "+t))},H)),a)return a},e.prototype._acquireBatch=function(t,n,r,s){typeof r!="function"&&(s=r,r=null);var i=this,o=function(l,c){return function(u){i.acquire(l,c,u,s)}},a=t.reduceRight(function(l,c){return o(c,l)},n);if(typeof r=="function")a(r);else return new this.Promise(function(l,c){a.length===1?a(function(u,h){u?c(u):l(h)}):l(a())})},e.prototype.isBusy=function(t){return t?!!this.queues[t]:Object.keys(this.queues).length>0},e.prototype._promiseTry=function(t){try{return this.Promise.resolve(t())}catch(n){return this.Promise.reject(n)}},oi=e,oi}var ai,Ia;function Wd(){return Ia||(Ia=1,ai=jd()),ai}var Yd=Wd();const Vd=pt(Yd),zd=new Set(["true","false"]);function Gd(e){return zd.has(e.toLowerCase())}const yn="__INTERNAL_EDITOR__",li=`${yn}DOCS_NORMAL`,ci=`${yn}DOCS_FORMULA_BAR`,Sa=`${yn}ZEN_EDITOR`,Oa=`${yn}COMMENT_EDITOR`,wa=`\r
2
- `,va="isRowStylePrecedeColumnStyle",ba=Symbol("AUTO_HEIGHT_FOR_MERGED_CELLS");function Kd(e){return`${yn}${e}`}function ya(e){return e.startsWith(yn)}function Xd(e){return e===Oa}function qd(e,t){t.forEach(n=>e.add(n))}function Aa(e,t){t.forEach(([n])=>{e.has(n)&&e.get(n)})}function Ta(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const s=Object.prototype.hasOwnProperty.bind(t);for(let i=0;i<n.length;i++){const o=n[i];if(!s(o))return!1;const a=e[o],l=t[o];if(a!==l)return!1}return!0}class Zr extends Error{constructor(t){super(t),this.name="CustomCommandExecutionError"}}class Jd extends Zr{constructor(){super("Canceled by facade"),this.name="CanceledError"}}function Zd(e,t=16){let n=0,r=null;return function(...i){const o=Date.now();o-n<t?(r&&clearTimeout(r),r=setTimeout(()=>{n=o,e.apply(this,i)},t)):(n=o,e.apply(this,i))}}var An=(e=>(e[e.Style=1]="Style",e[e.Value=2]="Value",e))(An||{});function Qd(e){return`sheet_interceptor_${e}`}const Na=e=>function(t,n){let r=-1,s=t;for(let i=0;i<=e.length;i++){if(i<=r)throw new Error("[SheetInterceptorService]: next() called multiple times!");if(r=i,i===e.length)return s;const o=e[i];let a=!1;if(s=o.handler(s,n,l=>(a=!0,l)),!a)break}return s};class ef{constructor(t){E(this,"_interceptorsByName",new Map);E(this,"_interceptorPoints");this._interceptorPoints=t}fetchThroughInterceptors(t,n){const r=t;let s=this._interceptorsByName.get(r);return n&&(s=s.filter(n)),Na(s||[])}intercept(t,n){const r=t;this._interceptorsByName.has(r)||this._interceptorsByName.set(r,[]);const s=this._interceptorsByName.get(r);return s.push(n),this._interceptorsByName.set(r,s.sort((i,o)=>{var a,l;return((a=o.priority)!=null?a:0)-((l=i.priority)!=null?l:0)})),()=>rr(this._interceptorsByName.get(r),n)}getInterceptPoints(){return this._interceptorPoints}dispose(){this._interceptorsByName.clear()}}function tf(e){return`sheet_async_interceptor_${e}`}const nf=e=>async function(t,n){let r=-1,s=t;for(let i=0;i<=e.length;i++){if(i<=r)throw new Error("[SheetInterceptorService]: next() called multiple times!");if(r=i,i===e.length)return s;const o=e[i];let a=!1;if(s=await o.handler(s,n,async l=>(a=!0,l)),!a)break}return s};class rf{constructor(t){E(this,"_asyncInterceptorsByName",new Map);E(this,"_asyncInterceptorPoints");this._asyncInterceptorPoints=t}fetchThroughAsyncInterceptors(t,n){const r=t;let s=this._asyncInterceptorsByName.get(r);return n&&(s=s.filter(n)),nf(s||[])}async interceptAsync(t,n){const r=t;this._asyncInterceptorsByName.has(r)||this._asyncInterceptorsByName.set(r,[]);const s=this._asyncInterceptorsByName.get(r);return s.push(n),this._asyncInterceptorsByName.set(r,s.sort((i,o)=>{var a,l;return((a=o.priority)!=null?a:0)-((l=i.priority)!=null?l:0)})),()=>rr(this._asyncInterceptorsByName.get(r),n)}getInterceptPoints(){return this._asyncInterceptorPoints}dispose(){this._asyncInterceptorsByName.clear()}}function Ma(e){return e.map(t=>t/255)}function Da(e){return e.map(t=>Math.round(t*255))}function sf([e,t,n]){const r=Math.max(e,t,n),s=Math.min(e,t,n),i=(r+s)/2;let o=0,a=0;if(r!==s){const l=r-s;switch(a=i>.5?l/(2-r-s):l/(r+s),r){case e:o=(t-n)/l+(t<n?6:0);break;case t:o=(n-e)/l+2;break;case n:o=(e-t)/l+4;break}o/=6}return[o,a,i]}function Qr(e,t,n){const r=[e,t,n].map(s=>s<=.03928?s/12.92:((s+.055)/1.055)**2.4);return .2126*r[0]+.7152*r[1]+.0722*r[2]}function La(e,t){return(Math.max(e,t)+.05)/(Math.min(e,t)+.05)}function of(e,t,n){let r,s,i;if(t===0)r=s=i=n;else{const o=(c,u,h)=>{let d=h;return d<0&&(d+=1),d>1&&(d-=1),d<.16666666666666666?c+(u-c)*6*d:d<.5?u:d<.6666666666666666?c+(u-c)*(.6666666666666666-d)*6:c},a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;r=o(l,a,e+1/3),s=o(l,a,e),i=o(l,a,e-1/3)}return[r,s,i]}const ui={r:1,g:1,b:1},hi={r:0,g:0,b:0},af=Qr(ui.r,ui.g,ui.b),lf=Qr(hi.r,hi.g,hi.b);function cf(e){const t=Qr(e[0],e[1],e[2]),n=La(af,t),r=sf(e);let s=1-r[2],i,o,a;do i=of(r[0],r[1],s),o=Qr(i[0],i[1],i[2]),a=La(o,lf),s+=.01;while(s<=1&&s>=0&&Math.abs(a-n)<.01);return i}function uf(e){return Da(cf(Ma(e)))}const Et=[[.333,-.667,-.667,0,1],[-.667,.333,-.667,0,1],[-.667,-.667,.333,0,1],[0,0,0,1,0]];function hf(e){const t=e[0],n=e[1],r=e[2];let s=[Et[0][0]*t+Et[0][1]*n+Et[0][2]*r+Et[0][4],Et[1][0]*t+Et[1][1]*n+Et[1][2]*r+Et[1][4],Et[2][0]*t+Et[2][1]*n+Et[2][2]*r+Et[2][4]];return s=s.map(i=>i>1?1:i<0?0:i),s}function df(e){return Da(hf(Ma(e)))}var Ua=typeof global=="object"&&global&&global.Object===Object&&global,ff=typeof self=="object"&&self&&self.Object===Object&&self,hn=Ua||ff||Function("return this")(),Tn=hn.Symbol,Pa=Object.prototype,mf=Pa.hasOwnProperty,gf=Pa.toString,sr=Tn?Tn.toStringTag:void 0;function _f(e){var t=mf.call(e,sr),n=e[sr];try{e[sr]=void 0;var r=!0}catch{}var s=gf.call(e);return r&&(t?e[sr]=n:delete e[sr]),s}var pf=Object.prototype,Ef=pf.toString;function Cf(e){return Ef.call(e)}var Rf="[object Null]",If="[object Undefined]",ka=Tn?Tn.toStringTag:void 0;function ir(e){return e==null?e===void 0?If:Rf:ka&&ka in Object(e)?_f(e):Cf(e)}function Nn(e){return e!=null&&typeof e=="object"}var Sf="[object Symbol]";function es(e){return typeof e=="symbol"||Nn(e)&&ir(e)==Sf}function Of(e,t){for(var n=-1,r=e==null?0:e.length,s=Array(r);++n<r;)s[n]=t(e[n],n,e);return s}var Mn=Array.isArray,Fa=Tn?Tn.prototype:void 0,xa=Fa?Fa.toString:void 0;function Ha(e){if(typeof e=="string")return e;if(Mn(e))return Of(e,Ha)+"";if(es(e))return xa?xa.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var wf=/\s/;function vf(e){for(var t=e.length;t--&&wf.test(e.charAt(t)););return t}var bf=/^\s+/;function yf(e){return e&&e.slice(0,vf(e)+1).replace(bf,"")}function Ct(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Ba=NaN,Af=/^[-+]0x[0-9a-f]+$/i,Tf=/^0b[01]+$/i,Nf=/^0o[0-7]+$/i,Mf=parseInt;function $a(e){if(typeof e=="number")return e;if(es(e))return Ba;if(Ct(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ct(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=yf(e);var n=Tf.test(e);return n||Nf.test(e)?Mf(e.slice(2),n?2:8):Af.test(e)?Ba:+e}function ja(e){return e}var Df="[object AsyncFunction]",Lf="[object Function]",Uf="[object GeneratorFunction]",Pf="[object Proxy]";function di(e){if(!Ct(e))return!1;var t=ir(e);return t==Lf||t==Uf||t==Df||t==Pf}var fi=hn["__core-js_shared__"],Wa=(function(){var e=/[^.]+$/.exec(fi&&fi.keys&&fi.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function kf(e){return!!Wa&&Wa in e}var Ff=Function.prototype,xf=Ff.toString;function Hf(e){if(e!=null){try{return xf.call(e)}catch{}try{return e+""}catch{}}return""}var Bf=/[\\^$.*+?()[\]{}|]/g,$f=/^\[object .+?Constructor\]$/,jf=Function.prototype,Wf=Object.prototype,Yf=jf.toString,Vf=Wf.hasOwnProperty,zf=RegExp("^"+Yf.call(Vf).replace(Bf,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Gf(e){if(!Ct(e)||kf(e))return!1;var t=di(e)?zf:$f;return t.test(Hf(e))}function Kf(e,t){return e==null?void 0:e[t]}function mi(e,t){var n=Kf(e,t);return Gf(n)?n:void 0}var Ya=Object.create,Xf=(function(){function e(){}return function(t){if(!Ct(t))return{};if(Ya)return Ya(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})();function qf(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Jf(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Zf=800,Qf=16,em=Date.now;function tm(e){var t=0,n=0;return function(){var r=em(),s=Qf-(r-n);if(n=r,s>0){if(++t>=Zf)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function nm(e){return function(){return e}}var ts=(function(){try{var e=mi(Object,"defineProperty");return e({},"",{}),e}catch{}})(),rm=ts?function(e,t){return ts(e,"toString",{configurable:!0,enumerable:!1,value:nm(t),writable:!0})}:ja,sm=tm(rm),im=9007199254740991,om=/^(?:0|[1-9]\d*)$/;function gi(e,t){var n=typeof e;return t=t==null?im:t,!!t&&(n=="number"||n!="symbol"&&om.test(e))&&e>-1&&e%1==0&&e<t}function _i(e,t,n){t=="__proto__"&&ts?ts(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ns(e,t){return e===t||e!==e&&t!==t}var am=Object.prototype,lm=am.hasOwnProperty;function Va(e,t,n){var r=e[t];(!(lm.call(e,t)&&ns(r,n))||n===void 0&&!(t in e))&&_i(e,t,n)}function cm(e,t,n,r){var s=!n;n||(n={});for(var i=-1,o=t.length;++i<o;){var a=t[i],l=void 0;l===void 0&&(l=e[a]),s?_i(n,a,l):Va(n,a,l)}return n}var za=Math.max;function um(e,t,n){return t=za(t===void 0?e.length-1:t,0),function(){for(var r=arguments,s=-1,i=za(r.length-t,0),o=Array(i);++s<i;)o[s]=r[t+s];s=-1;for(var a=Array(t+1);++s<t;)a[s]=r[s];return a[t]=n(o),qf(e,this,a)}}function hm(e,t){return sm(um(e,t,ja),e+"")}var dm=9007199254740991;function Ga(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=dm}function pi(e){return e!=null&&Ga(e.length)&&!di(e)}function fm(e,t,n){if(!Ct(n))return!1;var r=typeof t;return(r=="number"?pi(n)&&gi(t,n.length):r=="string"&&t in n)?ns(n[t],e):!1}function Ka(e){return hm(function(t,n){var r=-1,s=n.length,i=s>1?n[s-1]:void 0,o=s>2?n[2]:void 0;for(i=e.length>3&&typeof i=="function"?(s--,i):void 0,o&&fm(n[0],n[1],o)&&(i=s<3?void 0:i,s=1),t=Object(t);++r<s;){var a=n[r];a&&e(t,a,r,i)}return t})}var mm=Object.prototype;function Xa(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||mm;return e===n}function gm(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var _m="[object Arguments]";function qa(e){return Nn(e)&&ir(e)==_m}var Ja=Object.prototype,pm=Ja.hasOwnProperty,Em=Ja.propertyIsEnumerable,Ei=qa((function(){return arguments})())?qa:function(e){return Nn(e)&&pm.call(e,"callee")&&!Em.call(e,"callee")};function Cm(){return!1}var Za=typeof f=="object"&&f&&!f.nodeType&&f,Qa=Za&&typeof module=="object"&&module&&!module.nodeType&&module,Rm=Qa&&Qa.exports===Za,el=Rm?hn.Buffer:void 0,Im=el?el.isBuffer:void 0,tl=Im||Cm,Sm="[object Arguments]",Om="[object Array]",wm="[object Boolean]",vm="[object Date]",bm="[object Error]",ym="[object Function]",Am="[object Map]",Tm="[object Number]",Nm="[object Object]",Mm="[object RegExp]",Dm="[object Set]",Lm="[object String]",Um="[object WeakMap]",Pm="[object ArrayBuffer]",km="[object DataView]",Fm="[object Float32Array]",xm="[object Float64Array]",Hm="[object Int8Array]",Bm="[object Int16Array]",$m="[object Int32Array]",jm="[object Uint8Array]",Wm="[object Uint8ClampedArray]",Ym="[object Uint16Array]",Vm="[object Uint32Array]",He={};He[Fm]=He[xm]=He[Hm]=He[Bm]=He[$m]=He[jm]=He[Wm]=He[Ym]=He[Vm]=!0,He[Sm]=He[Om]=He[Pm]=He[wm]=He[km]=He[vm]=He[bm]=He[ym]=He[Am]=He[Tm]=He[Nm]=He[Mm]=He[Dm]=He[Lm]=He[Um]=!1;function zm(e){return Nn(e)&&Ga(e.length)&&!!He[ir(e)]}function Gm(e){return function(t){return e(t)}}var nl=typeof f=="object"&&f&&!f.nodeType&&f,or=nl&&typeof module=="object"&&module&&!module.nodeType&&module,Km=or&&or.exports===nl,Ci=Km&&Ua.process,rl=(function(){try{var e=or&&or.require&&or.require("util").types;return e||Ci&&Ci.binding&&Ci.binding("util")}catch{}})(),sl=rl&&rl.isTypedArray,il=sl?Gm(sl):zm;function Xm(e,t){var n=Mn(e),r=!n&&Ei(e),s=!n&&!r&&tl(e),i=!n&&!r&&!s&&il(e),o=n||r||s||i,a=o?gm(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")||gi(c,l))||a.push(c);return a}function qm(e,t){return function(n){return e(t(n))}}function Jm(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Zm=Object.prototype,Qm=Zm.hasOwnProperty;function eg(e){if(!Ct(e))return Jm(e);var t=Xa(e),n=[];for(var r in e)r=="constructor"&&(t||!Qm.call(e,r))||n.push(r);return n}function ol(e){return pi(e)?Xm(e):eg(e)}var tg=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ng=/^\w*$/;function rg(e,t){if(Mn(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||es(e)?!0:ng.test(e)||!tg.test(e)||t!=null&&e in Object(t)}var ar=mi(Object,"create");function sg(){this.__data__=ar?ar(null):{},this.size=0}function ig(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var og="__lodash_hash_undefined__",ag=Object.prototype,lg=ag.hasOwnProperty;function cg(e){var t=this.__data__;if(ar){var n=t[e];return n===og?void 0:n}return lg.call(t,e)?t[e]:void 0}var ug=Object.prototype,hg=ug.hasOwnProperty;function dg(e){var t=this.__data__;return ar?t[e]!==void 0:hg.call(t,e)}var fg="__lodash_hash_undefined__";function mg(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ar&&t===void 0?fg:t,this}function dn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}dn.prototype.clear=sg,dn.prototype.delete=ig,dn.prototype.get=cg,dn.prototype.has=dg,dn.prototype.set=mg;function gg(){this.__data__=[],this.size=0}function rs(e,t){for(var n=e.length;n--;)if(ns(e[n][0],t))return n;return-1}var _g=Array.prototype,pg=_g.splice;function Eg(e){var t=this.__data__,n=rs(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():pg.call(t,n,1),--this.size,!0}function Cg(e){var t=this.__data__,n=rs(t,e);return n<0?void 0:t[n][1]}function Rg(e){return rs(this.__data__,e)>-1}function Ig(e,t){var n=this.__data__,r=rs(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function $t(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}$t.prototype.clear=gg,$t.prototype.delete=Eg,$t.prototype.get=Cg,$t.prototype.has=Rg,$t.prototype.set=Ig;var al=mi(hn,"Map");function Sg(){this.size=0,this.__data__={hash:new dn,map:new(al||$t),string:new dn}}function Og(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ss(e,t){var n=e.__data__;return Og(t)?n[typeof t=="string"?"string":"hash"]:n.map}function wg(e){var t=ss(this,e).delete(e);return this.size-=t?1:0,t}function vg(e){return ss(this,e).get(e)}function bg(e){return ss(this,e).has(e)}function yg(e,t){var n=ss(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Jt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Jt.prototype.clear=Sg,Jt.prototype.delete=wg,Jt.prototype.get=vg,Jt.prototype.has=bg,Jt.prototype.set=yg;var Ag="Expected a function";function Ri(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Ag);var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],i=n.cache;if(i.has(s))return i.get(s);var o=e.apply(this,r);return n.cache=i.set(s,o)||i,o};return n.cache=new(Ri.Cache||Jt),n}Ri.Cache=Jt;var Tg=500;function Ng(e){var t=Ri(e,function(r){return n.size===Tg&&n.clear(),r}),n=t.cache;return t}var Mg=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Dg=/\\(\\)?/g,Lg=Ng(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Mg,function(n,r,s,i){t.push(s?i.replace(Dg,"$1"):r||n)}),t});function Ug(e){return e==null?"":Ha(e)}function ll(e,t){return Mn(e)?e:rg(e,t)?[e]:Lg(Ug(e))}function cl(e){if(typeof e=="string"||es(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Pg(e,t){t=ll(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[cl(t[n++])];return n&&n==r?e:void 0}function ul(e,t,n){var r=e==null?void 0:Pg(e,t);return r===void 0?n:r}var hl=qm(Object.getPrototypeOf,Object),kg="[object Object]",Fg=Function.prototype,xg=Object.prototype,dl=Fg.toString,Hg=xg.hasOwnProperty,Bg=dl.call(Object);function $g(e){if(!Nn(e)||ir(e)!=kg)return!1;var t=hl(e);if(t===null)return!0;var n=Hg.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&dl.call(n)==Bg}function jg(){this.__data__=new $t,this.size=0}function Wg(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Yg(e){return this.__data__.get(e)}function Vg(e){return this.__data__.has(e)}var zg=200;function Gg(e,t){var n=this.__data__;if(n instanceof $t){var r=n.__data__;if(!al||r.length<zg-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Jt(r)}return n.set(e,t),this.size=n.size,this}function Dn(e){var t=this.__data__=new $t(e);this.size=t.size}Dn.prototype.clear=jg,Dn.prototype.delete=Wg,Dn.prototype.get=Yg,Dn.prototype.has=Vg,Dn.prototype.set=Gg;var fl=typeof f=="object"&&f&&!f.nodeType&&f,ml=fl&&typeof module=="object"&&module&&!module.nodeType&&module,Kg=ml&&ml.exports===fl,gl=Kg?hn.Buffer:void 0;gl&&gl.allocUnsafe;function Xg(e,t){return e.slice()}var _l=hn.Uint8Array;function qg(e){var t=new e.constructor(e.byteLength);return new _l(t).set(new _l(e)),t}function Jg(e,t){var n=qg(e.buffer);return new e.constructor(n,e.byteOffset,e.length)}function Zg(e){return typeof e.constructor=="function"&&!Xa(e)?Xf(hl(e)):{}}function Qg(e){return function(t,n,r){for(var s=-1,i=Object(t),o=r(t),a=o.length;a--;){var l=o[++s];if(n(i[l],l,i)===!1)break}return t}}var e_=Qg(),Ii=function(){return hn.Date.now()},t_="Expected a function",n_=Math.max,r_=Math.min;function s_(e,t,n){var r,s,i,o,a,l,c=0,u=!1,h=!1,d=!0;if(typeof e!="function")throw new TypeError(t_);t=$a(t)||0,Ct(n)&&(u=!!n.leading,h="maxWait"in n,i=h?n_($a(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d);function m(R){var b=r,T=s;return r=s=void 0,c=R,o=e.apply(T,b),o}function _(R){return c=R,a=setTimeout(y,t),u?m(R):o}function p(R){var b=R-l,T=R-c,B=t-b;return h?r_(B,i-T):B}function I(R){var b=R-l,T=R-c;return l===void 0||b>=t||b<0||h&&T>=i}function y(){var R=Ii();if(I(R))return H(R);a=setTimeout(y,p(R))}function H(R){return a=void 0,d&&r?m(R):(r=s=void 0,o)}function x(){a!==void 0&&clearTimeout(a),c=0,r=l=s=a=void 0}function Y(){return a===void 0?o:H(Ii())}function O(){var R=Ii(),b=I(R);if(r=arguments,s=this,l=R,b){if(a===void 0)return _(l);if(h)return clearTimeout(a),a=setTimeout(y,t),m(l)}return a===void 0&&(a=setTimeout(y,t)),o}return O.cancel=x,O.flush=Y,O}function Si(e,t,n){(n!==void 0&&!ns(e[t],n)||n===void 0&&!(t in e))&&_i(e,t,n)}function i_(e){return Nn(e)&&pi(e)}function Oi(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function o_(e){return cm(e,ol(e))}function a_(e,t,n,r,s,i,o){var a=Oi(e,n),l=Oi(t,n),c=o.get(l);if(c){Si(e,n,c);return}var u=i?i(a,l,n+"",e,t,o):void 0,h=u===void 0;if(h){var d=Mn(l),m=!d&&tl(l),_=!d&&!m&&il(l);u=l,d||m||_?Mn(a)?u=a:i_(a)?u=Jf(a):m?(h=!1,u=Xg(l)):_?(h=!1,u=Jg(l)):u=[]:$g(l)||Ei(l)?(u=a,Ei(a)?u=o_(a):(!Ct(a)||di(a))&&(u=Zg(l))):h=!1}h&&(o.set(l,u),s(u,l,r,i,o),o.delete(l)),Si(e,n,u)}function wi(e,t,n,r,s){e!==t&&e_(t,function(i,o){if(s||(s=new Dn),Ct(i))a_(e,t,o,n,wi,r,s);else{var a=r?r(Oi(e,o),i,o+"",e,t,s):void 0;a===void 0&&(a=i),Si(e,o,a)}},ol)}var l_=Ka(function(e,t,n,r){wi(e,t,n,r)}),is=Ka(function(e,t,n){wi(e,t,n)});function c_(e,t,n,r){if(!Ct(e))return e;t=ll(t,e);for(var s=-1,i=t.length,o=i-1,a=e;a!=null&&++s<i;){var l=cl(t[s]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(s!=o){var u=a[l];c=void 0,c===void 0&&(c=Ct(u)?u:gi(t[s+1])?[]:{})}Va(a,l,c),a=a[l]}return e}function u_(e,t,n){return e==null?e:c_(e,t,n)}class fn{constructor(){E(this,"cursor",0)}reset(){return this.cursor=0,this}moveCursor(t){this.cursor+=t}moveCursorTo(t){this.cursor=t}}function h_(e,t){for(const n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}function pl(e){return/^-?\d+(\.\d+)?$/.test(e)}function d_(e){return pl(e)?Number(e)<=Number.MAX_SAFE_INTEGER:!1}function f_(e){return Number(e)>Number.MAX_SAFE_INTEGER||e.length>=18}class vi{constructor(){E(this,"_data",[])}static create(){return new vi}add(t){this._data.indexOf(t)>-1||this._data.push(t)}delete(t){const n=this._data.indexOf(t);this._data.splice(n,1)}getData(){return this._data}}class bi{constructor(){E(this,"_data",new Map)}static create(){return new bi}add(t,n){this._data.has(t)||this._data.set(t,n)}delete(t){this._data.delete(t)}getData(){return this._data}}function m_(e){const t=new MessageChannel;let n=!1;const r=()=>{n||e()};return t.port1.onmessage=r,t.port2.postMessage(null),()=>{n=!0,t.port1.onmessage=null,t.port1.close(),t.port2.close()}}async function El(e){for(const[t,n]of e.entries())try{if(!await n())return{index:t,result:!1}}catch(r){return{index:t,result:!1,error:r}}return{result:!0,index:-1}}function Cl(e){for(const[t,n]of e.entries())try{if(!n())return{index:t,result:!1}}catch(r){return{index:t,result:!1,error:r}}return{result:!0,index:-1}}function g_(e,t){return t.forEach(n=>e.add(n)),e}function __(e){return e instanceof se.Subscription||e instanceof se.Subject||e&&"closed"in e&&typeof e.unsubscribe<"u"}function Ye(e){let t=!1;return e?__(e)?{dispose:()=>e.unsubscribe()}:typeof e=="function"?{dispose:()=>{t||(t=!0,e())}}:e:Ye(()=>{})}class os{constructor(){E(this,"_disposables",new Set)}add(t){const n=Ye(t);return this._disposables.add(n),{dispose:(r=!1)=>{r||n.dispose(),this._disposables.delete(n)}}}dispose(){this._disposables.forEach(t=>{t.dispose()}),this._disposables.clear()}}class Ke{constructor(){E(this,"_disposed",!1);E(this,"_collection",new os)}disposeWithMe(t){return this._collection.add(t)}ensureNotDisposed(){if(this._disposed)throw new Error("[Disposable]: object is disposed!")}dispose(){this._disposed||(this._disposed=!0,this._collection.dispose())}}class p_ extends Ke{constructor(){super(...arguments);E(this,"dispose$",new se.Subject)}dispose(){super.dispose(),this.dispose$.next(),this.dispose$.complete()}}class E_ extends Ke{constructor(n){super();E(this,"_ref",0);this._rootDisposable=n}inc(){if(this._disposed)throw new Error("[RCDisposable]: should not ref to a disposed.");this._ref+=1}dec(){this._ref-=1,this._ref===0&&(this._rootDisposable.dispose(),this.dispose())}}var ve=(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))(ve||{}),Se=(e=>(e[e.Reader=0]="Reader",e[e.Editor=1]="Editor",e[e.Owner=2]="Owner",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(Se||{}),yi=(e=>(e[e.SomeCollaborator=0]="SomeCollaborator",e[e.AllCollaborator=1]="AllCollaborator",e[e.OneSelf=2]="OneSelf",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(yi||{});class as extends Ke{}const Rl=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"]),C_=new RegExp("^(?:(?:(?:https?|ftp):)?\\/\\/)?(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u00a1-\\uffff][a-z0-9\\u00a1-\\uffff_-]{0,62})?[a-z0-9\\u00a1-\\uffff]\\.)+(?:[a-z\\u00a1-\\uffff]{2,}\\.?))(?::\\d{2,5})?(?:[/?#]\\S*)?$","i");function R_(e){if(!Number.isNaN(+e))return!1;if(e.startsWith("http://localhost:3002")||e.startsWith("localhost:3002"))return!0;if(C_.test(e)){if(Il(e))return!0;try{const r=new URL(Sl(e)).hostname.split(".").pop();if(r&&Rl.has(r))return!0}catch{return!1}}return!1}function Il(e){return/^[a-zA-Z]+:\/\//.test(e)}function I_(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e)}function Sl(e){return Il(e)?e:I_(e)?`mailto://${e}`:`https://${e}`}function S_(e,t){try{const n=new URL(t),r=n.pathname.endsWith("/")?n.pathname:`${n.pathname}/`,s=e.startsWith("/")?e.substring(1):e;return new URL(s,n.origin+r).toString()}catch(n){return console.error("Error resolving URL with base URL:",n),e}}const O_="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let w_=e=>crypto.getRandomValues(new Uint8Array(e)),v_=(e,t,n)=>{let r=(2<<Math.log2(e.length-1))-1,s=-~(1.6*r*t/e.length);return(i=t)=>{let o="";for(;;){let a=n(s),l=s|0;for(;l--;)if(o+=e[a[l]&r]||"",o.length>=i)return o}}},b_=(e,t=21)=>v_(e,t|0,w_),y_=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=O_[n[e]&63];return t};const Zt=["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 Ai(e,t){const n=Z.getValueType(e),r=Z.getValueType(t);return n!==r?!1:Z.isArray(e)?A_(e,t):Z.isObject(e)?T_(e,t):Z.isDate(e)?e.getTime()===t.getTime():Z.isRegExp(e)?e.toString()===t.toString():e===t}function A_(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++){const s=e[n],i=t[n];if(!Ai(s,i))return!1}return!0}function T_(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n){if(!r.includes(s))return!1;const i=e[s],o=t[s];if(!Ai(i,o))return!1}return!0}class Z{static deleteNull(t){for(const n in t)(t[n]===null||t[n]===void 0)&&delete t[n];return t}static stringAt(t){let n="",r=t;for(;r>=Zt.length;)r/=Zt.length,r-=1,n+=Zt[r%Zt.length];const s=t%Zt.length;return n+=Zt[s],n}static indexAt(t){let n=0;for(let r=0;r<t.length-1;r+=1){const s=t.charCodeAt(r)-65,i=t.length-1-r;n+=Zt.length**i+Zt.length*s}return n+=t.charCodeAt(t.length-1)-65,n}static deleteBlank(t){return Z.isString(t)?t.replace(/\s/g,""):t}static getSystemType(){const t=navigator.userAgent,n=navigator.platform==="Win32"||navigator.platform==="Windows",r=navigator.platform==="Mac68K"||navigator.platform==="MacPPC"||navigator.platform==="Macintosh"||navigator.platform==="MacIntel";if(r)return"Mac";if(navigator.platform==="X11"&&!n&&!r)return"Unix";if(String(navigator.platform).indexOf("Linux")>-1)return"Linux";if(n){if(t.indexOf("Windows NT 5.0")>-1||t.indexOf("Windows 2000")>-1)return"Windows 2000";if(t.indexOf("Windows NT 5.1")>-1||t.indexOf("Windows XP")>-1)return"Windows XP";if(t.indexOf("Windows NT 5.2")>-1||t.indexOf("Windows 2003")>-1)return"Windows 2003";if(t.indexOf("Windows NT 6.0")>-1||t.indexOf("Windows Vista")>-1)return"Windows Vista";if(t.indexOf("Windows NT 6.1")>-1||t.indexOf("Windows 7")>-1)return"Windows 7";if(t.indexOf("Windows NT 10")>-1||t.indexOf("Windows 10")>-1)return"Windows 10";if(t.indexOf("Windows NT 11")>-1||t.indexOf("Windows 11")>-1)return"Windows 11"}return"Unknown system"}static getBrowserType(){const t=navigator.userAgent,n=t.indexOf("Opera")>-1,r=t.indexOf("compatible")>-1&&t.indexOf("MSIE")>-1&&!n,s=t.indexOf("Trident")>-1&&t.indexOf("rv:11.0")>-1,i=t.indexOf("Edge")>-1,o=t.indexOf("Firefox")>-1,a=t.indexOf("Safari")>-1&&t.indexOf("Chrome")===-1,l=t.indexOf("Chrome")>-1&&t.indexOf("Safari")>-1;if(r){new RegExp("MSIE (\\d+\\.\\d+);").test(t);const u=Number.parseFloat(RegExp.$1);return u===7?"IE7":u===8?"IE8":u===9?"IE9":u===10?"IE10":"0"}return o?"FF":n?"Opera":a?"Safari":l?"Chrome":i?"Edge":s?"IE11":"Unknown browser"}static getClassName(t){return t.constructor.name}static deepMerge(t,...n){n.forEach(o=>o&&i(o));function r(o,a){o.forEach((l,c)=>{var u,h;if(Z.isArray(l)){const d=(u=a[c])!=null?u:[];a[c]=d,r(l,d);return}if(Z.isObject(l)){const d=(h=a[c])!=null?h:{};a[c]=d,s(l,d);return}a[c]=l})}function s(o,a){Object.keys(o).forEach(l=>{var u,h;const c=o[l];if(Z.isObject(c)){const d=(u=a[l])!=null?u:{};a[l]=d,s(c,d);return}if(Z.isArray(c)){const d=(h=a[l])!=null?h:[];a[l]=d,r(c,d);return}a[l]=c})}function i(o){Object.keys(o).forEach(a=>{var c,u;const l=o[a];if(Z.isArray(l)){const h=(c=t[a])!=null?c:[];t[a]=h,r(l,h);return}if(Z.isObject(l)){const h=(u=t[a])!=null?u:{};t[a]=h,s(l,h);return}t[a]=l})}return t}static numberFixed(t,n){return Number(Number(t).toFixed(n))}static diffValue(t,n){return Ai(t,n)}static deepClone(t){if(!this.isDefine(t))return t;if(this.isRegExp(t))return new RegExp(t);if(this.isDate(t))return new Date(t);if(this.isArray(t)){const n=[];return t.forEach((r,s)=>{n[s]=Z.deepClone(r)}),n}if(this.isObject(t)){const n={};return Object.keys(t).forEach(r=>{const s=t[r];n[r]=Z.deepClone(s)}),Object.setPrototypeOf(n,Object.getPrototypeOf(t)),n}return t}static getLanguage(){const t="en-US";return globalThis.navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||t}static getValueType(t){return Object.prototype.toString.apply(t)}static isDefine(t){return t!=null}static isBlank(t){return this.isDefine(t)?this.isString(t)?t.trim()==="":!1:!0}static isPlainObject(t){return this.isDefine(t)?Object.getPrototypeOf(t)===Object.getPrototypeOf({}):!1}static isDate(t){return this.getValueType(t)==="[object Date]"}static isRegExp(t){return this.getValueType(t)==="[object RegExp]"}static isArray(t){return this.getValueType(t)==="[object Array]"}static isString(t){return this.getValueType(t)==="[object String]"}static isNumber(t){return this.getValueType(t)==="[object Number]"}static isStringNumber(t){return!isNaN(Number.parseFloat(t))&&isFinite(t)}static isObject(t){return this.getValueType(t)==="[object Object]"}static isEmptyObject(t){for(const n in t)return!1;return!0}static isTablet(){return/ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(navigator.userAgent.toLowerCase())}static isIPhone(){return/iPhone/i.test(navigator.userAgent)}static isLegalUrl(t){return R_(t)}static normalizeUrl(t){return Sl(t)}static topLevelDomainCombiningString(){return[...Rl].join("|")}static removeNull(t){return this.isObject(t)&&Object.keys(t).forEach(n=>{const r=t[n];r==null?delete t[n]:Z.removeNull(r)}),t}static fillTwoDimensionalArray(t,n,r){return new Array(t).fill(r).map(s=>new Array(n).fill(r))}static numToWord(t){let n="";for(;t>0;){let r=t%26;r=r===0?r=26:r,n=String.fromCharCode(96+r)+n,t=(t-r)/26}return n.toLocaleUpperCase()}static ABCatNum(t){if(t==null||t.length===0)return Number.NaN;const n=t.toLowerCase().split(""),r=n.length;let s=0,i=0;for(let o=0;o<r;o++)i=n[o].charCodeAt(0)-96,s+=i*26**(r-o-1);return s===0?Number.NaN:s-1}static chatAtABC(t){let i="";for(;t>=0;)i=String.fromCharCode(t%26+97)+i,t=Math.floor(t/26)-1;return i.toUpperCase()}static commonExtend(t,n){const r={};for(const s in t)r[s]=t[s];for(const s in n)n[s]!=null&&(r[s]=n[s]);return r}static hasIntersectionBetweenTwoRanges(t,n,r,s){return n>=r&&s>=t}static isStartValidPosition(t){return/^[A-Za-zА-Яа-яЁё_]/.test(t)}static isValidParameter(t){const n=/[~!@#$%^&*()+=\-{}\[\]\|:;"'<>,?\/ ]+/.test(t),r=t.length<=255;return!n&&r}static clamp(t,n,r){return Math.max(n,Math.min(r,t))}static now(){return performance&&performance.now?performance.now():Date.now()}}function nt(e=21,t){return t?b_(t,e)():y_(e)}function lr(...e){const t={},n=e.length;for(let r=n-1;r>=0;r--){const s=e[r];if(s){const i=Object.keys(s);for(const o of i)t[o]===void 0&&(t[o]=s[o])}}return t}const N_=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null;function M_(e){const n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\\\*/g,".*").replace(/\\\?/g,".");return new RegExp(`^${n}$`,"i")}var Ol=(e=>(e[e.DEFAULT_SERIES=0]="DEFAULT_SERIES",e[e.ALTERNATE_SERIES=1]="ALTERNATE_SERIES",e))(Ol||{}),Pe=(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))(Pe||{}),wl=(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))(wl||{}),Rt=(e=>(e[e.UNSUPPORTED=0]="UNSUPPORTED",e[e.RGB=1]="RGB",e[e.HEX=2]="HEX",e[e.THEME=3]="THEME",e))(Rt||{}),vl=(e=>(e[e.ON=0]="ON",e[e.OFF=1]="OFF",e))(vl||{}),bl=(e=>(e[e.PASTE_NORMAL=0]="PASTE_NORMAL",e[e.PASTE_NO_BORDERS=1]="PASTE_NO_BORDERS",e[e.PASTE_FORMAT=2]="PASTE_FORMAT",e[e.PASTE_FORMULA=3]="PASTE_FORMULA",e[e.PASTE_DATA_VALIDATION=4]="PASTE_DATA_VALIDATION",e[e.PASTE_VALUES=5]="PASTE_VALUES",e[e.PASTE_CONDITIONAL_FORMATTING=6]="PASTE_CONDITIONAL_FORMATTING",e[e.PASTE_COLUMN_WIDTHS=7]="PASTE_COLUMN_WIDTHS",e))(bl||{}),yl=(e=>(e[e.LEFT=0]="LEFT",e[e.RIGHT=1]="RIGHT",e))(yl||{}),Al=(e=>(e[e.DOCUMENT=0]="DOCUMENT",e[e.PROJECT=1]="PROJECT",e))(Al||{}),Tl=(e=>(e[e.COLUMNS=0]="COLUMNS",e[e.ROWS=1]="ROWS",e))(Tl||{}),Nl=(e=>(e[e.UP=0]="UP",e[e.RIGHT=1]="RIGHT",e[e.DOWN=2]="DOWN",e[e.LEFT=3]="LEFT",e))(Nl||{});function D_(e){switch(e){case 3:return 1;case 1:return 3;case 0:return 2;case 2:return 0}}var Ml=(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))(Ml||{}),cr=(e=>(e.EN_US="enUS",e.FR_FR="frFR",e.ZH_CN="zhCN",e.RU_RU="ruRU",e.ZH_TW="zhTW",e.VI_VN="viVN",e.FA_IR="faIR",e.JA_JP="jaJP",e.KO_KR="koKR",e.ES_ES="esES",e.CA_ES="caES",e))(cr||{}),ls=(e=>(e[e.PERSON=0]="PERSON",e[e.FILE=1]="FILE",e[e.DATE=2]="DATE",e[e.LOCATION=3]="LOCATION",e[e.EVENT=4]="EVENT",e))(ls||{}),Dl=(e=>(e[e.RANGE=0]="RANGE",e[e.SHEET=1]="SHEET",e))(Dl||{}),Ll=(e=>(e.Line="line",e.LineInv="lineInv",e.Triangle="triangle",e.RtTriangle="rtTriangle",e.Rect="rect",e.Diamond="diamond",e.Parallelogram="parallelogram",e.Trapezoid="trapezoid",e.NonIsocelesTrapezoid="nonIsocelesTrapezoid",e.Pentagon="pentagon",e.Hexagon="hexagon",e.Heptagon="heptagon",e.Octagon="octagon",e.Decagon="decagon",e.Dodecagon="dodecagon",e.Star4="star4",e.Star5="star5",e.Star6="star6",e.Star7="star7",e.Star8="star8",e.Star10="star10",e.Star12="star12",e.Star16="star16",e.Star24="star24",e.Star32="star32",e.RoundRect="roundRect",e.Round1Rect="round1Rect",e.Round2SameRect="round2SameRect",e.Round2DiagRect="round2DiagRect",e.Ellipse="ellipse",e))(Ll||{}),Ul=(e=>(e.RightArrow="rightArrow",e.LeftArrow="leftArrow",e.UpArrow="upArrow",e.DownArrow="downArrow",e.LeftRightArrow="leftRightArrow",e.UpDownArrow="upDownArrow",e.QuadArrow="quadArrow",e.LeftRightUpArrow="leftRightUpArrow",e.BentArrow="bentArrow",e.UturnArrow="uturnArrow",e.CircularArrow="circularArrow",e.NotchedRightArrow="notchedRightArrow",e.HomePlate="homePlate",e.Chevron="chevron",e.LeftCircularArrow="leftCircularArrow",e.LeftRightCircularArrow="leftRightCircularArrow",e))(Ul||{}),Pl=(e=>(e.Plaque="plaque",e.Can="can",e.Cube="cube",e.Bevel="bevel",e.Donut="donut",e.NoSmoking="noSmoking",e.BlockArc="blockArc",e.FoldedCorner="foldedCorner",e))(Pl||{}),kl=(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))(kl||{}),Fl=(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))(Fl||{}),xl=(e=>(e[e.GRID=0]="GRID",e[e.KANBAN=1]="KANBAN",e[e.GANTT=2]="GANTT",e))(xl||{}),ur=(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))(ur||{}),Hl=(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))(Hl||{}),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||{}),mn=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TOP=1]="TOP",e[e.MIDDLE=2]="MIDDLE",e[e.BOTTOM=3]="BOTTOM",e))(mn||{}),gn=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.OVERFLOW=1]="OVERFLOW",e[e.CLIP=2]="CLIP",e[e.WRAP=3]="WRAP",e))(gn||{}),cs=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ITALIC=1]="ITALIC",e))(cs||{}),us=(e=>(e[e.NORMAL=0]="NORMAL",e[e.BOLD=1]="BOLD",e))(us||{}),jt=(e=>(e[e.NORMAL=1]="NORMAL",e[e.SUBSCRIPT=2]="SUBSCRIPT",e[e.SUPERSCRIPT=3]="SUPERSCRIPT",e))(jt||{}),ae=(e=>(e[e.FALSE=0]="FALSE",e[e.TRUE=1]="TRUE",e))(ae||{}),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||{}),at=(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))(at||{}),hs=(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))(hs||{}),Bl=(e=>(e[e.character=0]="character",e[e.paragraph=1]="paragraph",e[e.table=2]="table",e[e.numbering=3]="numbering",e))(Bl||{}),$l=(e=>(e[e.TAB=0]="TAB",e[e.SPACE=1]="SPACE",e[e.NOTHING=2]="NOTHING",e))($l||{}),fe=(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))(fe||{}),hr=(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))(hr||{}),en=(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))(en||{}),_n=(e=>(e[e.COMMENT=0]="COMMENT",e[e.DELETED=9999]="DELETED",e))(_n||{}),jl=(e=>(e[e.DRAWING=0]="DRAWING",e[e.CUSTOM=1]="CUSTOM",e))(jl||{}),Ti=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRADITIONAL=1]="TRADITIONAL",e[e.MODERN=2]="MODERN",e))(Ti||{}),Wl=(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))(Wl||{}),Yl=(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))(Yl||{}),Vl=(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))(Vl||{}),zl=(e=>(e[e.NORMAL=0]="NORMAL",e[e.TBRL=1]="TBRL",e[e.LRTBV=2]="LRTBV",e))(zl||{}),Gl=(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))(Gl||{}),Kl=(e=>(e[e.BOTH_SIDES=0]="BOTH_SIDES",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.LARGEST=3]="LARGEST",e))(Kl||{}),Xl=(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))(Xl||{}),Je=(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))(Je||{}),ql=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(ql||{}),Jl=(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))(Jl||{}),Zl=(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))(Zl||{}),Ql=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SPECIFIED=1]="SPECIFIED",e))(Ql||{}),ec=(e=>(e[e.START=0]="START",e[e.CENTER=1]="CENTER",e[e.END=2]="END",e))(ec||{}),tc=(e=>(e[e.AUTO_FIT=0]="AUTO_FIT",e[e.FIXED=1]="FIXED",e))(tc||{}),nc=(e=>(e[e.NONE=0]="NONE",e[e.WRAP=1]="WRAP",e))(nc||{}),rc=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(rc||{}),sc=(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))(sc||{}),Ln=(e=>(e.NORMAL="normal",e.BOLD="bold",e.ITALIC="italic",e))(Ln||{}),ic=(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))(ic||{}),oc=(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))(oc||{}),ac=(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))(ac||{}),lc=(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))(lc||{}),cc=(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))(cc||{}),uc=(e=>(e[e.compressPunctuation=0]="compressPunctuation",e[e.compressPunctuationAndJapaneseKana=1]="compressPunctuationAndJapaneseKana",e[e.doNotCompress=2]="doNotCompress",e))(uc||{}),hc=(e=>(e[e.PORTRAIT=0]="PORTRAIT",e[e.LANDSCAPE=1]="LANDSCAPE",e))(hc||{}),ht=(e=>(e.Letter="Letter",e.Tabloid="Tabloid",e.Legal="Legal",e.Statement="Statement",e.Executive="Executive",e.Folio="Folio",e.A3="A3",e.A4="A4",e.A5="A5",e.B4="B4",e.B5="B5",e))(ht||{});const L_=["A3","A4","A5","B4","B5","Letter","Tabloid","Legal","Statement","Executive","Folio"];var dc=(e=>(e[e.forward=0]="forward",e[e.backward=1]="backward",e[e.front=2]="front",e[e.back=3]="back",e))(dc||{}),fc=(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))(fc||{}),Ni=(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))(Ni||{}),mc=(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))(mc||{}),gc=(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))(gc||{});function U_(e=nt(6),t=cr.EN_US,n=""){return{id:e,locale:t,title:n,tableSource:{},drawings:{},drawingsOrder:[],headers:{},footers:{},body:{dataStream:`\r
3
- `,textRuns:[],customBlocks:[],tables:[],paragraphs:[{startIndex:0,paragraphStyle:{spaceAbove:{v:5},lineSpacing:1,spaceBelow:{v:0}}}],sectionBreaks:[{startIndex:1}]},documentStyle:{pageSize:{width:793.3333333333334,height:1122.6666666666667},documentFlavor:Ti.TRADITIONAL,marginTop:50,marginBottom:50,marginRight:50,marginLeft:50,renderConfig:{zeroWidthParagraphBreak:ae.FALSE,vertexAngle:0,centerAngle:0,background:{rgb:"#ccc"}},autoHyphenation:ae.TRUE,doNotHyphenateCaps:ae.FALSE,consecutiveHyphenLimit:2,defaultHeaderId:"",defaultFooterId:"",evenPageHeaderId:"",evenPageFooterId:"",firstPageHeaderId:"",firstPageFooterId:"",evenAndOddHeaders:ae.FALSE,useFirstPageHeaderFooter:ae.FALSE,marginHeader:30,marginFooter:30},settings:{}}}var pn={},dr={},ds={},_c;function P_(){if(_c)return ds;_c=1,Object.defineProperty(ds,"__esModule",{value:!0});function e(r,s){if(Array.isArray(s))return!1;for(let i in r)if(!n(r[i],s[i]))return!1;for(let i in s)if(r[i]===void 0)return!1;return!0}function t(r,s){if(!Array.isArray(s)||r.length!==s.length)return!1;for(let i=0;i<r.length;i++)if(!n(r[i],s[i]))return!1;return!0}function n(r,s){return r===s?!0:r===null||s===null||typeof r!="object"||typeof s!="object"?!1:Array.isArray(r)?t(r,s):e(r,s)}return ds.default=n,ds}var fs={},pc;function k_(){if(pc)return fs;pc=1,Object.defineProperty(fs,"__esModule",{value:!0});function e(t){if(t===null)return null;if(Array.isArray(t))return t.map(e);if(typeof t=="object"){const n={};for(let r in t)n[r]=e(t[r]);return n}else return t}return fs.default=e,fs}var Mi={},Ec;function Cc(){return Ec||(Ec=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.eachChildOf=e.advancer=e.readCursor=e.writeCursor=e.WriteCursor=e.ReadCursor=e.isValidPathItem=void 0;function t(u,h){if(!u)throw new Error(h)}const n=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 d in u){const m=d;h.write(m,u[m])}}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(){t(this.parents.length===this.indexes.length/2),this.idx===0?this.parents.length?(this.lcIdx=this.indexes.pop(),this.container=this.parents.pop(),this.idx=this.indexes.pop()):(this.lcIdx=0,this.idx=-1):(t(this.idx>0),this.idx--,n(this.container[this.idx])&&this.idx--)}getPath(){const h=[];let d=this.container,m=this.parents.length-1,_=this.idx;for(;_>=0;)h.unshift(d[_]),_===0?(_=this.indexes[m*2],d=this.parents[m--]):_-=n(d[_-1])?2:1;return h}}class o extends i{get(){return this.container?this.container.slice(this.idx+1):null}getKey(){return t(this.container!=null,"Invalid call to getKey before cursor descended"),this.container[this.idx]}getComponent(){let h;return this.container&&this.container.length>this.idx+1&&n(h=this.container[this.idx+1])?h:null}descendFirst(){let h=this.idx+1;if(!this.container||h>=this.container.length||n(this.container[h])&&h+1>=this.container.length)return!1;n(this.container[h])&&h++;const d=this.container[h];return Array.isArray(d)?(this.indexes.push(this.idx),this.parents.push(this.container),this.indexes.push(h),this.idx=0,this.container=d):this.idx=h,!0}nextSibling(){if(t(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,d=this.parents[this.parents.length-1];return h>=d.length?!1:(t(!isNaN(h)),this.indexes[this.indexes.length-1]=h,this.container=d[h],!0)}_init(h,d,m,_){this.container=h,this.idx=d,this.parents=m.slice(),this.indexes=_.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,d){const m=this.getComponent();m&&d(m,h);for(const _ of this)h&&h.descend(_),this.traverse(h,d),h&&h.ascend()}eachPick(h,d){this.traverse(h,(m,_)=>{m.p!=null&&d(m.p,_)})}eachDrop(h,d){this.traverse(h,(m,_)=>{m.d!=null&&d(m.d,_)})}}e.ReadCursor=o;class a extends i{constructor(h=null){super(h),this.pendingDescent=[],this._op=h}flushDescent(){t(this.parents.length===this.indexes.length/2),this.container===null&&(this._op=this.container=[]);for(let h=0;h<this.pendingDescent.length;h++){const d=this.pendingDescent[h];let m=this.idx+1;if(m<this.container.length&&n(this.container[m])&&m++,t(m===this.container.length||!n(this.container[m])),m===this.container.length)this.container.push(d),this.idx=m;else if(this.container[m]===d)this.idx=m;else{if(!Array.isArray(this.container[m])){const _=this.container.splice(m,this.container.length-m);this.container.push(_),this.lcIdx>-1&&(this.lcIdx=m)}for(this.indexes.push(this.idx),this.parents.push(this.container),this.lcIdx!==-1&&(t(r(d,this.container[this.lcIdx][0])),m=this.lcIdx+1,this.lcIdx=-1);m<this.container.length&&r(d,this.container[m][0]);)m++;if(this.indexes.push(m),this.idx=0,m<this.container.length&&this.container[m][0]===d)this.container=this.container[m];else{const _=[d];this.container.splice(m,0,_),this.container=_}}}this.pendingDescent.length=0}reset(){this.lcIdx=-1}getComponent(){this.flushDescent();const h=this.idx+1;if(h<this.container.length&&n(this.container[h]))return this.container[h];{const d={};return this.container.splice(h,0,d),d}}write(h,d){const m=this.getComponent();t(m[h]==null||m[h]===d,"Internal consistency error: Overwritten component. File a bug"),m[h]=d}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,d=s){if(h===null)return;if(t(Array.isArray(h)),h===this._op)throw Error("Cannot merge into my own tree");const m=this.lcIdx,_=this.parents.length;let p=0;for(let I=0;I<h.length;I++){const y=h[I];typeof y=="string"||typeof y=="number"?(p++,this.descend(y)):Array.isArray(y)?this.mergeTree(y,d):typeof y=="object"&&d(y,this)}for(;p--;)this.ascend();this.lcIdx=this.parents.length===_?m:-1}at(h,d){this.descendPath(h),d(this);for(let m=0;m<h.length;m++)this.ascend();return this}writeAtPath(h,d,m){return this.at(h,()=>this.write(d,m)),this.reset(),this}writeMove(h,d,m=0){return this.writeAtPath(h,"p",m).writeAtPath(d,"d",m)}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,d){let m,_;_=m=u?u.descendFirst():!1;function p(I){let y;for(;_;){const H=y=u.getKey();if(I!=null){let x=!1;if(h&&typeof H=="number"&&(y=h(H,u.getComponent()),y<0&&(y=~y,x=!0)),r(y,I))return null;if(y===I&&!x)return u}d&&typeof y=="number"&&d(y,u.getComponent()),_=u.nextSibling()}return null}return p.end=()=>{m&&u.ascend()},p}e.advancer=l;function c(u,h,d){let m,_,p,I;for(m=_=u&&u.descendFirst(),p=I=h&&h.descendFirst();m||p;){let y=m?u.getKey():null,H=p?h.getKey():null;y!==null&&H!==null&&(r(H,y)?H=null:y!==H&&(y=null)),d(y==null?H:y,y!=null?u:null,H!=null?h:null),y!=null&&m&&(m=u.nextSibling()),H!=null&&p&&(p=h.nextSibling())}_&&u.ascend(),I&&h.ascend()}e.eachChildOf=c})(Mi)),Mi}var Di={},Rc;function Ic(){return Rc||(Rc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConflictType=void 0,(function(t){t[t.RM_UNEXPECTED_CONTENT=1]="RM_UNEXPECTED_CONTENT",t[t.DROP_COLLISION=2]="DROP_COLLISION",t[t.BLACKHOLE=3]="BLACKHOLE"})(e.ConflictType||(e.ConflictType={}))})(Di)),Di}var yt={},En={},Sc;function Li(){return Sc||(Sc=1,Object.defineProperty(En,"__esModule",{value:!0}),En.uniToStrPos=En.strPosToUni=void 0,En.strPosToUni=(e,t=e.length)=>{let n=0,r=0;for(;r<t;r++){const s=e.charCodeAt(r);s>=55296&&s<=57343&&(n++,r++)}if(r!==t)throw Error("Invalid offset - splits unicode bytes");return r-n},En.uniToStrPos=(e,t)=>{let n=0;for(;t>0;t--){const r=e.charCodeAt(n);n+=r>=55296&&r<=57343?2:1}return n}),En}var Ui={},Oc;function Pi(){return Oc||(Oc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.uniSlice=e.dlen=e.eachOp=void 0;const t=Li(),n=O=>{if(!Array.isArray(O))throw Error("Op must be an array of components");let R=null;for(let b=0;b<O.length;b++){const T=O[b];switch(typeof T){case"object":if(typeof T.d!="number"&&typeof T.d!="string")throw Error("Delete must be number or string");if(e.dlen(T.d)<=0)throw Error("Deletes must not be empty");break;case"string":if(!(T.length>0))throw Error("Inserts cannot be empty");break;case"number":if(!(T>0))throw Error("Skip components must be >0");if(typeof R=="number")throw Error("Adjacent skip components should be combined");break}R=T}if(typeof R=="number")throw Error("Op has a trailing skip")};function r(O,R){let b=0,T=0;for(let B=0;B<O.length;B++){const $=O[B];switch(R($,b,T),typeof $){case"object":b+=e.dlen($.d);break;case"string":T+=t.strPosToUni($);break;case"number":b+=$,T+=$;break}}}e.eachOp=r;function s(O,R){const b=[],T=a(b);return r(O,(B,$,g)=>{T(R(B,$,g))}),h(b)}const i=O=>O,o=O=>s(O,i);e.dlen=O=>typeof O=="number"?O:t.strPosToUni(O);const a=O=>R=>{if(!(!R||R.d===0||R.d===""))if(O.length===0)O.push(R);else if(typeof R==typeof O[O.length-1])if(typeof R=="object"){const b=O[O.length-1];b.d=typeof b.d=="string"&&typeof R.d=="string"?b.d+R.d:e.dlen(b.d)+e.dlen(R.d)}else O[O.length-1]+=R;else O.push(R)},l=O=>typeof O=="number"?O:typeof O=="string"?t.strPosToUni(O):typeof O.d=="number"?O.d:t.strPosToUni(O.d);e.uniSlice=(O,R,b)=>{const T=t.uniToStrPos(O,R),B=b==null?1/0:t.uniToStrPos(O,b);return O.slice(T,B)};const c=(O,R,b)=>typeof O=="number"?b==null?O-R:Math.min(O,b)-R:e.uniSlice(O,R,b),u=O=>{let R=0,b=0;return{take:($,g)=>{if(R===O.length)return $===-1?null:$;const P=O[R];let w;if(typeof P=="number")return $===-1||P-b<=$?(w=P-b,++R,b=0,w):(b+=$,$);if(typeof P=="string"){if($===-1||g==="i"||t.strPosToUni(P.slice(b))<=$)return w=P.slice(b),++R,b=0,w;{const M=b+t.uniToStrPos(P.slice(b),$);return w=P.slice(b,M),b=M,w}}else{if($===-1||g==="d"||e.dlen(P.d)-b<=$)return w={d:c(P.d,b)},++R,b=0,w;{let M=c(P.d,b,b+$);return b+=$,{d:M}}}},peek:()=>O[R]}},h=O=>(O.length>0&&typeof O[O.length-1]=="number"&&O.pop(),O);function d(O,R,b){if(b!=="left"&&b!=="right")throw Error("side ("+b+") must be 'left' or 'right'");n(O),n(R);const T=[],B=a(T),{take:$,peek:g}=u(O);for(let w=0;w<R.length;w++){const M=R[w];let A,v;switch(typeof M){case"number":for(A=M;A>0;)v=$(A,"i"),B(v),typeof v!="string"&&(A-=l(v));break;case"string":b==="left"&&typeof g()=="string"&&B($(-1)),B(t.strPosToUni(M));break;case"object":for(A=e.dlen(M.d);A>0;)switch(v=$(A,"i"),typeof v){case"number":A-=v;break;case"string":B(v);break;case"object":A-=e.dlen(v.d)}break}}let P;for(;P=$(-1);)B(P);return h(T)}function m(O,R){n(O),n(R);const b=[],T=a(b),{take:B}=u(O);for(let g=0;g<R.length;g++){const P=R[g];let w,M;switch(typeof P){case"number":for(w=P;w>0;)M=B(w,"d"),T(M),typeof M!="object"&&(w-=l(M));break;case"string":T(P);break;case"object":w=e.dlen(P.d);let A=0;for(;A<w;)switch(M=B(w-A,"d"),typeof M){case"number":T({d:c(P.d,A,A+M)}),A+=M;break;case"string":A+=t.strPosToUni(M);break;case"object":T(M)}break}}let $;for(;$=B(-1);)T($);return h(b)}const _=(O,R)=>{let b=0;for(let T=0;T<R.length&&O>b;T++){const B=R[T];switch(typeof B){case"number":{b+=B;break}case"string":const $=t.strPosToUni(B);b+=$,O+=$;break;case"object":O-=Math.min(e.dlen(B.d),O-b);break}}return O},p=(O,R)=>typeof O=="number"?_(O,R):O.map(b=>_(b,R));function I(O,R,b){return s(O,(T,B)=>typeof T=="object"&&typeof T.d=="number"?{d:b.slice(R,B,B+T.d)}:T)}function y(O){return s(O,R=>{switch(typeof R){case"object":if(typeof R.d=="number")throw Error("Cannot invert text op: Deleted characters missing from operation. makeInvertible must be called first.");return R.d;case"string":return{d:R};case"number":return R}})}function H(O){return s(O,R=>typeof R=="object"&&typeof R.d=="string"?{d:t.strPosToUni(R.d)}:R)}function x(O){let R=!0;return r(O,b=>{typeof b=="object"&&typeof b.d=="number"&&(R=!1)}),R}function Y(O){return{name:"text-unicode",uri:"http://sharejs.org/types/text-unicode",trim:h,normalize:o,checkOp:n,create(R=""){if(typeof R!="string")throw Error("Initial data must be a string");return O.create(R)},apply(R,b){n(b);const T=O.builder(R);for(let B=0;B<b.length;B++){const $=b[B];switch(typeof $){case"number":T.skip($);break;case"string":T.append($);break;case"object":T.del(e.dlen($.d));break}}return T.build()},transform:d,compose:m,transformPosition:_,transformSelection:p,isInvertible:x,makeInvertible(R,b){return I(R,b,O)},stripInvertible:H,invert:y,invertWithDoc(R,b){return y(I(R,b,O))},isNoop:R=>R.length===0}}e.default=Y})(Ui)),Ui}var ms={},wc;function F_(){if(wc)return ms;wc=1,Object.defineProperty(ms,"__esModule",{value:!0});const e=Pi(),t=Li();function n(r,s){return{get:r,getLength(){return r().length},insert(i,o,a){const l=t.strPosToUni(r(),i);return s([l,o],a)},remove(i,o,a){const l=t.strPosToUni(r(),i);return s([l,{d:o}],a)},_onOp(i){e.eachOp(i,(o,a,l)=>{switch(typeof o){case"string":this.onInsert&&this.onInsert(l,o);break;case"object":const c=e.dlen(o.d);this.onRemove&&this.onRemove(l,c)}})},onInsert:null,onRemove:null}}return ms.default=n,n.provides={text:!0},ms}var vc;function x_(){return vc||(vc=1,(function(e){var t=yt&&yt.__createBinding||(Object.create?(function(d,m,_,p){p===void 0&&(p=_),Object.defineProperty(d,p,{enumerable:!0,get:function(){return m[_]}})}):(function(d,m,_,p){p===void 0&&(p=_),d[p]=m[_]})),n=yt&&yt.__setModuleDefault||(Object.create?(function(d,m){Object.defineProperty(d,"default",{enumerable:!0,value:m})}):function(d,m){d.default=m}),r=yt&&yt.__importStar||function(d){if(d&&d.__esModule)return d;var m={};if(d!=null)for(var _ in d)Object.hasOwnProperty.call(d,_)&&t(m,d,_);return n(m,d),m},s=yt&&yt.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.type=e.remove=e.insert=void 0;const i=Li(),o=r(Pi()),a=s(F_()),l={create(d){return d},toString(d){return d},builder(d){if(typeof d!="string")throw Error("Invalid document snapshot: "+d);const m=[];return{skip(_){let p=i.uniToStrPos(d,_);if(p>d.length)throw Error("The op is too long for this document");m.push(d.slice(0,p)),d=d.slice(p)},append(_){m.push(_)},del(_){d=d.slice(i.uniToStrPos(d,_))},build(){return m.join("")+d}}},slice:o.uniSlice},c=o.default(l),u=Object.assign(Object.assign({},c),{api:a.default});e.type=u,e.insert=(d,m)=>m.length===0?[]:d===0?[m]:[d,m],e.remove=(d,m)=>o.dlen(m)===0?[]:d===0?[{d:m}]:[d,{d:m}];var h=Pi();Object.defineProperty(e,"makeType",{enumerable:!0,get:function(){return h.default}})})(yt)),yt}var bc;function H_(){return bc||(bc=1,(function(e){var t=dr&&dr.__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 n=t(P_()),r=t(k_()),s=Cc(),i=Ic();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:y,checkValidOp:B,normalize:$,apply:g,transformPosition:P,compose:w,tryTransform:L,transform:Q,makeInvertible:v,invert:M,invertWithDoc:N,RM_UNEXPECTED_CONTENT:i.ConflictType.RM_UNEXPECTED_CONTENT,DROP_COLLISION:i.ConflictType.DROP_COLLISION,BLACKHOLE:i.ConflictType.BLACKHOLE,transformNoConflict:(S,U,V)=>ue(()=>!0,S,U,V),typeAllowingConflictsPred:S=>Object.assign(Object.assign({},e.type),{transform:(U,V,z)=>ue(S,U,V,z)})};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 d(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 m(S,U,V){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,V)):(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]=V),V}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,V)=>s.writeCursor().at(S,z=>{z.write("r",U),z.write("i",V)}).get(),e.editOp=(S,U,V,z=!1)=>s.writeCursor().at(S,j=>R(j,U,V,z)).get();const _=(S,U)=>S!=null&&(typeof U=="number"?Array.isArray(S):typeof S=="object"),p=(S,U)=>_(S,U)?S[U]:void 0,I={};function y(S){let U=S.type?S.type:S;U.name&&(I[U.name]=U),U.uri&&(I[U.uri]=U)}const H=S=>{const U=I[S];if(U)return U;throw Error("Missing type: "+S)};y(x_());const x=(S,U)=>S+U;y({name:"number",apply:x,compose:x,invert:S=>-S,transform:S=>S});const Y=S=>S==null?null:S.et?H(S.et):S.es?I["text-unicode"]:S.ena!=null?I.number:null,O=S=>S.es?S.es:S.ena!=null?S.ena:S.e,R=(S,U,V,z=!1)=>{const[j,W]=typeof U=="string"?[H(U),U]:[U,U.name];!z&&j.isNoop&&j.isNoop(V)||(W==="number"?S.write("ena",V):W==="text-unicode"?S.write("es",V):(S.write("et",W),S.write("e",V)))};function b(S){o(typeof S=="number"),o(S>=0),o(S===(0|S))}function T(S){typeof S=="number"?b(S):o(typeof S=="string")}function B(S){if(S===null)return;const U=new Set,V=new Set,z=W=>{let ee=!0,te=!1;for(let k in W){const K=W[k];if(ee=!1,o(k==="p"||k==="r"||k==="d"||k==="i"||k==="e"||k==="es"||k==="ena"||k==="et","Invalid component item '"+k+"'"),k==="p")b(K),o(!U.has(K)),U.add(K),o(W.r===void 0);else if(k==="d")b(K),o(!V.has(K)),V.add(K),o(W.i===void 0);else if(k==="e"||k==="es"||k==="ena"){o(!te),te=!0;const q=Y(W);o(q,"Missing type in edit"),q.checkValidOp&&q.checkValidOp(O(W))}}o(!ee)},j=(W,ee,te)=>{if(!Array.isArray(W))throw Error("Op must be null or a list");if(W.length===0)throw Error("Empty descent");ee||T(W[0]);let k=1,K=0,q=0;for(let re=0;re<W.length;re++){const ge=W[re];if(o(ge!=null),Array.isArray(ge)){const Ee=j(ge,!1);if(K){const X=typeof q,de=typeof Ee;X===de?o(q<Ee,"descent keys are not in order"):o(X==="number"&&de==="string")}q=Ee,K++,k=3}else typeof ge=="object"?(o(k===1,`Prev not scalar - instead ${k}`),z(ge),k=2):(o(k!==3),T(ge),o(s.isValidPathItem(ge),"Invalid path key"),k=1)}return o(K!==1,"Operation makes multiple descents. Remove some []"),o(k===2||k===3),W[0]};j(S,!0),o(U.size===V.size,"Mismatched picks and drops in op");for(let W=0;W<U.size;W++)o(U.has(W)),o(V.has(W))}function $(S){let U=0,V=[];const z=s.writeCursor();return z.mergeTree(S,(j,W)=>{const ee=Y(j);if(ee){const k=O(j);R(W,ee,ee.normalize?ee.normalize(k):k)}for(const k of["r","p","i","d"])if(j[k]!==void 0){const K=k==="p"||k==="d"?(te=j[k],V[te]==null&&(V[te]=U++),V[te]):j[k];W.write(k,K)}var te}),z.get()}function g(S,U){if(B(U),U===null)return S;const V=[];return(function z(j,W){let ee=j,te=0,k={root:j},K=0,q=k,re="root";function ge(){for(;K<te;K++){let Ee=W[K];typeof Ee!="object"&&(o(_(q,re)),q=q[re]=c(q[re]),re=Ee)}}for(;te<W.length;te++){const Ee=W[te];if(Array.isArray(Ee)){const X=z(ee,Ee);X!==ee&&X!==void 0&&(ge(),ee=q[re]=X)}else if(typeof Ee=="object"){Ee.d!=null?(ge(),ee=m(q,re,V[Ee.d])):Ee.i!==void 0&&(ge(),ee=m(q,re,Ee.i));const X=Y(Ee);if(X)ge(),ee=q[re]=X.apply(ee,O(Ee));else if(Ee.e!==void 0)throw Error("Subtype "+Ee.et+" undefined")}else ee=p(ee,Ee)}return k.root})(S=(function z(j,W){const ee=[];let te=0;for(;te<W.length;te++){const re=W[te];if(Array.isArray(re))break;typeof re!="object"&&(ee.push(j),j=p(j,re))}for(let re=W.length-1;re>=te;re--)j=z(j,W[re]);for(--te;te>=0;te--){const re=W[te];if(typeof re!="object"){const ge=ee.pop();j=j===p(ge,re)?ge:j===void 0?d(ge,re):(K=re,q=j,(k=c(k=ge))[K]=q,k)}else u(re)&&(o(j!==void 0,"Cannot pick up or remove undefined"),re.p!=null&&(V[re.p]=j),j=void 0)}var k,K,q;return j})(S,U),U)}function P(S,U){S=S.slice(),B(U);const V=s.readCursor(U);let z,j,W=!1;const ee=[];for(let k=0;;k++){const K=S[k],q=V.getComponent();if(q&&(q.r!==void 0?W=!0:q.p!=null&&(W=!1,z=q.p,j=k)),k>=S.length)break;let re=0;const ge=s.advancer(V,void 0,(X,de)=>{u(de)&&re++});ee.unshift(ge);const Ee=ge(K);if(typeof K=="number"&&(S[k]-=re),!Ee)break}if(ee.forEach(k=>k.end()),W)return null;const te=()=>{let k=0;if(z!=null){const K=V.getPath();k=K.length,S=K.concat(S.slice(j))}for(;k<S.length;k++){const K=S[k],q=a(V),re=Y(q);if(re){const X=O(q);re.transformPosition&&(S[k]=re.transformPosition(S[k],X));break}let ge=0;const Ee=s.advancer(V,(X,de)=>h(de)?~(X-ge):X-ge,(X,de)=>{h(de)&&ge++})(K);if(typeof K=="number"&&(S[k]+=ge),!Ee)break}};return z!=null?V.eachDrop(null,k=>{k===z&&te()}):te(),S}function w(S,U){if(B(S),B(U),S==null)return U;if(U==null)return S;let V=0;const z=s.readCursor(S),j=s.readCursor(U),W=s.writeCursor(),ee=[],te=[],k=[],K=[],q=[],re=[],ge=new Set;z.traverse(null,X=>{X.p!=null&&(k[X.p]=z.clone())}),j.traverse(null,X=>{X.d!=null&&(K[X.d]=j.clone())});const Ee=s.writeCursor();return(function X(de,xe,Le,we,$e,Gt,st,et){o(xe||Le);const je=a(xe),wt=a(Le),Nt=!!wt&&wt.r!==void 0,wn=!!je&&je.i!==void 0,vt=je?je.d:null,_t=wt?wt.p:null,Kt=(Gt||Nt)&&_t==null;if(_t!=null)we=K[_t],st=te[_t]=new s.WriteCursor;else if(wt&&wt.r!==void 0)we=null;else{const oe=a(we);oe&&oe.d!=null&&(we=null)}const Te=a(we);if(vt!=null)if(de=k[vt],et=ee[vt]=new s.WriteCursor,Kt)Gt&&!Nt&&et.write("r",!0);else{const oe=q[vt]=V++;st.write("d",oe)}else if(je&&je.i!==void 0)de=null;else{const oe=a(de);oe&&oe.p!=null&&(de=null)}let ce;wn?(o($e===void 0),ce=je.i):ce=$e;const Ie=(_t==null?!wn||Gt||Nt:ce===void 0)?null:st.getComponent();if(_t!=null){if(!($e!==void 0||wn)){const oe=vt!=null?q[vt]:V++;re[_t]=oe,et.write("p",oe)}}else Nt&&(wn||$e!==void 0||(wt.r,et.write("r",wt.r)));const he=Kt?null:Y(je),ie=Y(Te);if((he||ie)&&(he&&he.name,ie&&ie.name),he&&ie){o(he===ie);const oe=O(je),Oe=O(Te),qe=he.compose(oe,Oe);R(st,he,qe),ge.add(Te)}else he?R(st,he,O(je)):ie&&(R(st,ie,O(Te)),ge.add(Te));const me=typeof ce=="object"&&ce!=null;let Ae=!1,ye=0,Ne=0,Xe=0,Ge=0,We=0;const rt=s.advancer(we,(oe,Oe)=>h(Oe)?Ge-oe-1:oe-Ge,(oe,Oe)=>{h(Oe)&&Ge++}),be=s.advancer(de,(oe,Oe)=>u(Oe)?ye-oe-1:oe-ye,(oe,Oe)=>{u(Oe)&&ye++});if(s.eachChildOf(xe,Le,(oe,Oe,qe)=>{let ot,Xt,vn=oe,Mt=oe,Xr=oe;if(typeof oe=="number"){let tt=oe+Xe;Xt=rt(tt),Mt=tt+Ge;let Ve=oe+Ne;ot=be(Ve),h(a(Xt))&&(ot=null),vn=Ve+ye,Xr=oe+We,o(vn>=0,"p1PickKey is negative"),o(Mt>=0,"p2DropKey is negative");const Dt=h(a(Oe)),qt=u(a(qe));(Dt||qt&&!Kt)&&We--,Dt&&Ne--,qt&&Xe--}else ot=be(oe),Xt=rt(oe);et.descend(vn),st.descend(Mt);const tr=me&&!h(a(Oe))?ce[Xr]:void 0,Ht=X(ot,Oe,qe,Xt,tr,Kt,st,et);var Bt,_e,Be;me&&!Kt?tr!==Ht&&(Ae||(ce=Array.isArray(ce)?ce.slice():Object.assign({},ce),Ae=!0),Bt=ce,Be=Ht,typeof(_e=Xr)=="number"?(o(Array.isArray(Bt)),o(_e<Bt.length)):(o(!Array.isArray(Bt)),o(Bt[_e]!==void 0)),Be===void 0?typeof _e=="number"?Bt.splice(_e,1):delete Bt[_e]:Bt[_e]=Be):o(Ht===void 0),st.ascend(),et.ascend()}),be.end(),rt.end(),Ie!=null)Ie.i=ce;else if(!Gt&&!Nt&&_t==null)return ce})(z,z.clone(),j,j.clone(),void 0,!1,W,Ee),W.reset(),W.mergeTree(Ee.get()),W.reset(),W.get(),ee.map(X=>X.get()),te.map(X=>X.get()),z.traverse(W,(X,de)=>{const xe=X.p;if(xe!=null){const Le=q[xe];Le!=null&&de.write("p",Le);const we=ee[xe];we&&we.get(),we&&de.mergeTree(we.get())}else X.r!==void 0&&de.write("r",X.r)}),W.reset(),W.get(),j.traverse(W,(X,de)=>{const xe=X.d;if(xe!=null){const we=re[xe];we!=null&&de.write("d",we);const $e=te[xe];$e&&de.mergeTree($e.get())}else X.i!==void 0&&de.write("i",X.i);const Le=Y(X);Le&&!ge.has(X)&&R(de,Le,O(X))}),W.get()}function M(S){if(S==null)return null;const U=new s.ReadCursor(S),V=new s.WriteCursor;let z;const j=[],W=[];return(function ee(te,k,K){const q=te.getComponent();let re,ge=!1;if(q){q.p!=null&&(k.write("d",q.p),j[q.p]=te.clone()),q.r!==void 0&&k.write("i",q.r),q.d!=null&&(k.write("p",q.d),K=void 0),q.i!==void 0&&(K=re=q.i);const X=Y(q);X&&(K===void 0?(z||(z=new Set),z.add(q)):(O(q),K=X.apply(K,O(q)),ge=!0))}let Ee=0;for(const X of te){k.descend(X);const de=typeof X=="number"?X-Ee:X,xe=p(K,de);h(te.getComponent())&&Ee++;const Le=ee(te,k,xe);if(K!==void 0&&Le!==void 0){if(ge||(ge=!0,K=c(K)),!_(K,de))throw Error("Cannot modify child - invalid operation");K[de]=Le}k.ascend()}if(re===void 0)return ge?K:void 0;k.write("r",K)})(U,V,void 0),z&&(V.reset(),(function ee(te,k,K){const q=k.getComponent();if(q){const X=q.d;if(X!=null&&(te=j[X],K=W[X]=s.writeCursor()),z.has(q)){const de=Y(q);if(!de.invert)throw Error(`Cannot invert subtype ${de.name}`);R(K,de,de.invert(O(q)))}}let re=0,ge=0;const Ee=s.advancer(te,(X,de)=>u(de)?re-X-1:X-re,(X,de)=>{u(de)&&re++});for(const X of k)if(typeof X=="number"){const de=X-ge,xe=Ee(de),Le=de+re;K.descend(Le),ee(xe,k,K),h(k.getComponent())&&ge++,K.ascend()}else K.descend(X),ee(Ee(X),k,K),K.ascend();Ee.end()})(U.clone(),U,V),W.length&&(V.reset(),U.traverse(V,(ee,te)=>{const k=ee.p;if(k!=null){const K=W[k];K&&K.get(),K&&te.mergeTree(K.get())}}))),V.get()}const A=(S,U)=>S.some(V=>typeof V=="object"&&(Array.isArray(V)?A(V,U):U(V)));function v(S,U){if(S==null||!A(S,k=>{var K;return k.r!==void 0||((K=Y(k))===null||K===void 0?void 0:K.makeInvertible)!=null}))return S;const V=new s.ReadCursor(S),z=new s.WriteCursor;let j=!1;const W=[],ee=[],te=(k,K,q)=>{const re=k.getComponent();let ge=!1;if(re){re.d!=null&&K.write("d",re.d),re.i!==void 0&&K.write("i",re.i);const X=re.p;if(X!=null&&(W[X]=k.clone(),o(q!==void 0,"Operation picks up at an invalid key"),ee[X]=q,K.write("p",re.p)),re.r!==void 0&&q===void 0)throw Error("Invalid doc / op in makeInvertible: removed item missing from doc");const de=Y(re);de&&(de.makeInvertible?j=!0:R(K,de,O(re),!0))}let Ee=0;for(const X of k){K.descend(X);const de=typeof X=="number"?X-Ee:X,xe=p(q,de),Le=te(k,K,xe);xe!==Le&&(ge||(ge=!0,q=c(q)),Le===void 0?(q=d(q,de),typeof X=="number"&&Ee++):q[de]=Le),K.ascend()}return re&&(re.r!==void 0?(K.write("r",r.default(q)),q=void 0):re.p!=null&&(q=void 0)),q};return te(V,z,U),z.get(),j&&(z.reset(),(function k(K,q,re,ge,Ee){const X=q.getComponent();if(X){X.i!==void 0?(ge=X.i,Ee=!0):X.d!=null&&(ge=ee[X.d],K=W[X.d],Ee=!1,X.d);let we=Y(X);if(we&&we.makeInvertible){const $e=O(X);R(re,we,we.makeInvertible($e,ge),!0)}}let de=0,xe=0;const Le=s.advancer(K,(we,$e)=>u($e)?de-we-1:we-de,(we,$e)=>{u($e)&&de++});for(const we of q)if(typeof we=="number"){const $e=we-xe,Gt=Le($e),st=$e+de,et=p(ge,Ee?$e:st);re.descend(we),k(Gt,q,re,et,Ee),h(q.getComponent())&&xe++,re.ascend()}else{const $e=p(ge,we);re.descend(we),k(Le(we),q,re,$e,Ee),re.ascend()}Le.end()})(V.clone(),V,z,U,!1)),z.get()}function N(S,U){return M(v(S,U))}const D=S=>{if(S==null)return null;const U=S.slice();for(let V=0;V<S.length;V++){const z=U[V];Array.isArray(z)&&(U[V]=D(z))}return U};function L(S,U,V){o(V==="left"||V==="right","Direction must be left or right");const z=V==="left"?0:1;if(U==null)return{ok:!0,result:S};B(S),B(U);let j=null;const W=[],ee=[],te=[],k=[],K=[],q=[],re=[],ge=[],Ee=[],X=[],de=[],xe=[],Le=[],we=[],$e=[];let Gt=0;const st=s.readCursor(S),et=s.readCursor(U),je=s.writeCursor();if((function Te(ce,Ie=null,he){const ie=a(Ie);ie&&(ie.r!==void 0?he=Ie.clone():ie.p!=null&&(he=null,q[ie.p]=ce.clone()));const me=ce.getComponent();let Ae;me&&(Ae=me.p)!=null&&(K[Ae]=Ie?Ie.clone():null,te[Ae]=ce.clone(),he&&(X[Ae]=!0,Ee[Ae]=he),ie&&ie.p!=null&&(we[Ae]=ie.p));const ye=s.advancer(Ie);for(const Ne of ce)Te(ce,ye(Ne),he);ye.end()})(et,st,null),(function Te(ce,Ie,he,ie,me){const Ae=he.getComponent();let ye,Ne=!1;Ae&&((ye=Ae.d)!=null?(k[ye]=he.clone(),ie!=null&&($e[ie]==null&&($e[ie]=[]),$e[ie].push(ye)),X[ye],ce=K[ye]||null,Ie=te[ye]||null,X[ye]?(me&&(de[ye]=!0),me=Ee[ye]||null):!me||z!==1&&we[ye]!=null||j==null&&(j={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(me.getPath()),op2:e.moveOp(Ie.getPath(),he.getPath())}),Ne=!0):Ae.i!==void 0&&(ce=Ie=null,Ne=!0,me&&j==null&&(j={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(me.getPath()),op2:e.insertOp(he.getPath(),Ae.i)})));const Xe=a(ce);Xe&&(Xe.r!==void 0?me=ce.clone():Xe.p!=null&&(Xe.p,ie=Xe.p,me=null));const Ge=Y(Ae);Ge&&me&&j==null&&(j={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(me.getPath()),op2:e.editOp(he.getPath(),Ge,O(Ae),!0)});let We=0,rt=0;const be=s.advancer(Ie,(Oe,qe)=>u(qe)?We-Oe-1:Oe-We,(Oe,qe)=>{u(qe)&&We++}),oe=s.advancer(ce);for(const Oe of he)if(typeof Oe=="number"){const qe=Oe-rt,ot=be(qe);rt+=+Te(oe(qe+We),ot,he,ie,me)}else{const qe=be(Oe);Te(oe(Oe),qe,he,ie,me)}return be.end(),oe.end(),Ne})(st,et,et.clone(),null,null),k.map(Te=>Te&&Te.get()),j)return{ok:!1,conflict:j};de.map(Te=>!!Te);const wt=[];let Nt=null;(function Te(ce,Ie,he,ie,me){let Ae=!1;const ye=a(Ie);if(u(ye)){const be=ye.p;be!=null?(he=k[be],ie=xe[be]=s.writeCursor(),Ae=!0,me=null):(he=null,me=Ie.clone())}else h(a(he))&&(he=null);const Ne=ce.getComponent();if(Ne){const be=Ne.p;be!=null?(me&&(ge[be]=me),wt[be]=me||z===1&&Ae?null:ie.getComponent(),W[be]=ce.clone(),he&&(re[be]=he.clone())):Ne.r!==void 0&&(me||ie.write("r",!0),(me||Ae)&&(Nt==null&&(Nt=new Set),Nt.add(Ne)))}let Xe=0,Ge=0;const We=s.advancer(Ie,void 0,(be,oe)=>{u(oe)&&Xe++}),rt=s.advancer(he,(be,oe)=>h(oe)?~(be-Ge):be-Ge,(be,oe)=>{h(oe)&&Ge++});if(ce)for(const be of ce)if(typeof be=="string"){const oe=We(be),Oe=rt(be);ie.descend(be),Te(ce,oe,Oe,ie,me),ie.ascend()}else{const oe=We(be),Oe=be-Xe,qe=u(a(oe))?null:rt(Oe),ot=Oe+Ge;o(ot>=0),ie.descend(ot),Te(ce,oe,qe,ie,me),ie.ascend()}We.end(),rt.end()})(st,et,et.clone(),je,null),je.reset();let wn=[];if((function Te(ce,Ie,he,ie,me,Ae){o(Ie);const ye=Ie.getComponent();let Ne=a(ie),Xe=!1;const Ge=(_e,Be,tt)=>_e?e.moveOp(_e.getPath(),Be.getPath()):e.insertOp(Be.getPath(),tt.i);if(h(ye)){const _e=ye.d;_e!=null&&(ee[_e]=Ie.clone());const Be=_e!=null?wt[_e]:null;let tt=!1;if(ye.i!==void 0||_e!=null&&Be){let Ve;Ne&&(Ne.i!==void 0||(Ve=Ne.d)!=null&&!X[Ve])&&(tt=Ve!=null?_e!=null&&_e===we[Ve]:n.default(Ne.i,ye.i),tt||Ve!=null&&z!==1&&we[Ve]!=null||j==null&&(j={type:i.ConflictType.DROP_COLLISION,op1:Ge(_e!=null?W[_e]:null,Ie,ye),op2:Ge(Ve!=null?te[Ve]:null,ie,Ne)})),tt||(Ae?j==null&&(j={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:Ge(_e!=null?W[_e]:null,Ie,ye),op2:e.removeOp(Ae.getPath())}):(_e!=null?(wn[Gt]=_e,me.write("d",Be.p=Gt++)):me.write("i",r.default(ye.i)),Xe=!0))}else if(_e!=null&&!Be){const Ve=ge[_e];Ve&&(Ae=Ve.clone())}_e!=null?(ce=W[_e],he=q[_e],ie=re[_e]):ye.i!==void 0&&(ce=he=null,tt||(ie=null))}else u(a(ce))&&(ce=he=ie=null);const We=a(ce),rt=a(he);if(u(rt)){const _e=rt.p;rt.r!==void 0&&(!We||We.r===void 0)||X[_e]?(ie=null,Ae=he.clone()):_e!=null&&(ie=k[_e],z!==1&&we[_e]!=null||((me=Le[_e])||(me=Le[_e]=s.writeCursor()),me.reset(),Ae=null))}else!h(ye)&&h(Ne)&&(ie=null);Ne=ie!=null?ie.getComponent():null;const be=Y(ye);if(be){const _e=O(ye);if(Ae)j==null&&(j={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.editOp(Ie.getPath(),be,_e,!0),op2:e.removeOp(Ae.getPath())});else{const Be=Y(Ne);let tt;if(Be){if(be!==Be)throw Error("Transforming incompatible types");const Ve=O(Ne);tt=be.transform(_e,Ve,V)}else tt=r.default(_e);R(me,be,tt)}}let oe=0,Oe=0,qe=0,ot=0,Xt=0,vn=0,Mt=ce!=null&&ce.descendFirst(),Xr=Mt;const tr=s.advancer(he,void 0,(_e,Be)=>{u(Be)&&qe++});let Ht=ie!=null&&ie.descendFirst(),Bt=Ht;for(const _e of Ie)if(typeof _e=="number"){let Be;const tt=h(Ie.getComponent()),Ve=_e-Oe;{let cn;for(;Mt&&typeof(cn=ce.getKey())=="number";){cn+=oe;const Lt=ce.getComponent(),nr=u(Lt);if(cn>Ve||cn===Ve&&(!nr||z===0&&tt))break;if(nr){oe--;const bn=Lt.p;we.includes(bn),Lt.d,a(Le[Lt.d]),u(a(Le[Lt.d])),(Lt.r===void 0||Nt&&Nt.has(Lt))&&(bn==null||!wt[bn]||z!==1&&we.includes(bn))||Xt--}Mt=ce.nextSibling()}Be=Mt&&cn===Ve?ce:null}const Dt=Ve-oe;let qt=tr(Dt);const Ca=Dt-qe;let ii=null;{let cn,Lt;for(;Ht&&typeof(cn=ie.getKey())=="number";){Lt=cn-ot;const nr=ie.getComponent(),bn=h(nr);if(Lt>Ca)break;if(Lt===Ca){if(!bn){ii=ie;break}{if(z===0&&tt){ii=ie;break}const un=qt&&u(qt.getComponent());if(z===0&&un)break}}if(bn){const un=nr.d;X[un],we[un],nr.i===void 0&&(X[un]||we[un]!=null&&z!==1)?(X[un]||we[un]!=null&&z===0)&&(ot++,vn--):ot++}Ht=ie.nextSibling()}}const Nd=Ca+ot+Xt+vn;o(Nd>=0,"trying to descend to a negative index"),me.descend(Nd),tt&&(Be=qt=ii=null,Oe++),Te(Be,Ie,qt,ii,me,Ae)&&vn++,me.ascend()}else{let Be;for(;Mt&&(Be=ce.getKey(),typeof Be!="string"||!(Be>_e||Be===_e));)Mt=ce.nextSibling();const tt=Mt&&Be===_e?ce:null,Ve=tr(_e);let Dt;for(;Ht&&(Dt=ie.getKey(),typeof Dt!="string"||!(Dt>_e||Dt===_e));)Ht=ie.nextSibling();const qt=Ht&&Dt===_e?ie:null;me.descend(_e),Te(tt,Ie,Ve,qt,me,Ae),me.ascend()}return tr.end(),Xr&&ce.ascend(),Bt&&ie.ascend(),Xe})(st,st.clone(),et,et.clone(),je,null),j)return{ok:!1,conflict:j};je.reset();const vt=(Te,ce,Ie)=>Te.traverse(ce,(he,ie)=>{he.d!=null&&Ie(he.d,Te,ie)});(X.length||xe.length)&&(vt(et,je,(Te,ce,Ie)=>{X[Te]&&!de[Te]&&Ie.write("r",!0),xe[Te]&&Ie.mergeTree(xe[Te].get())}),je.reset());const _t=[],Kt=[];if((Le.length||X.length)&&!j){const Te=s.readCursor(D(je.get()));if(vt(Te,null,(ce,Ie)=>{_t[ce]=Ie.clone()}),Le.forEach(ce=>{ce&&vt(s.readCursor(ce.get()),null,(Ie,he)=>{_t[Ie]=he.clone()})}),(function ce(Ie,he,ie,me,Ae,ye){const Ne=a(he);if(Ne&&u(Ne))if(Ne.p!=null){const oe=Ne.p;_t[oe].getPath(),ie=_t[oe],me=Kt[oe]=s.writeCursor()}else Ne.r!==void 0&&(ie=null);else h(a(ie))&&(ie=null);const Xe=Ie.getComponent();if(Xe){let oe;if((oe=Xe.d)!=null){const Oe=Le[oe];Oe&&(Oe.get(),me.mergeTree(Oe.get()),ie=s.readCursor(Oe.get()))}}let Ge=0,We=0;const rt=s.advancer(he,void 0,(oe,Oe)=>{u(Oe)&&Ge--}),be=s.advancer(ie,(oe,Oe)=>h(Oe)?-(oe-We)-1:oe-We,(oe,Oe)=>{h(Oe)&&We++});for(const oe of Ie)if(typeof oe=="number"){const Oe=rt(oe),qe=oe+Ge,ot=be(qe),Xt=qe+We;me.descend(Xt),ce(Ie,Oe,ot,me),me.ascend()}else me.descend(oe),ce(Ie,rt(oe),be(oe),me),me.ascend();rt.end(),be.end()})(et,Te,Te.clone(),je),je.reset(),j)return{ok:!1,conflict:j};if(je.get(),Kt.length){const ce=Kt.map(he=>he?he.get():null),Ie=s.readCursor(D(je.get()));if(vt(Ie,je,(he,ie,me)=>{const Ae=ce[he];Ae&&(me.mergeTree(Ae),ce[he]=null)}),ce.find(he=>he)){const he=s.writeCursor(),ie=s.writeCursor();let me=0,Ae=0;ce.forEach(ye=>{ye!=null&&vt(s.readCursor(ye),null,Ne=>{const Xe=wn[Ne];he.writeMove(W[Xe].getPath(),ee[Xe].getPath(),me++);const Ge=$e[Xe];Ge&&Ge.forEach(We=>{X[We]||z!==1&&we[We]!=null||ie.writeMove(te[We].getPath(),k[We].getPath(),Ae++)})})}),j={type:i.ConflictType.BLACKHOLE,op1:he.get(),op2:ie.get()}}}}return j?{ok:!1,conflict:j}:{ok:!0,result:je.get()}}const F=S=>{const U=new Error("Transform detected write conflict");throw U.conflict=S,U.type=U.name="writeConflict",U};function Q(S,U,V){const z=L(S,U,V);if(z.ok)return z.result;F(z.conflict)}const G=S=>{const U=s.writeCursor();return s.readCursor(S).traverse(U,(V,z)=>{(h(V)||Y(V))&&z.write("r",!0)}),U.get()},le=(S,U)=>{const{type:V,op1:z,op2:j}=S;switch(V){case i.ConflictType.DROP_COLLISION:return U==="left"?[null,G(j)]:[G(z),null];case i.ConflictType.RM_UNEXPECTED_CONTENT:let W=!1;return s.readCursor(z).traverse(null,ee=>{ee.r!==void 0&&(W=!0)}),W?[null,G(j)]:[G(z),null];case i.ConflictType.BLACKHOLE:return[G(z),G(j)];default:throw Error("Unrecognised conflict: "+V)}};function ue(S,U,V,z){let j=null;for(;;){const W=L(U,V,z);if(W.ok)return w(j,W.result);{const{conflict:ee}=W;S(ee)||F(ee);const[te,k]=le(ee,z);U=w($(U),te),V=w($(V),k),j=w(j,k)}}}})(dr)),dr}var yc;function B_(){return yc||(yc=1,(function(e){var t=pn&&pn.__createBinding||(Object.create?(function(i,o,a,l){l===void 0&&(l=a),Object.defineProperty(i,l,{enumerable:!0,get:function(){return o[a]}})}):(function(i,o,a,l){l===void 0&&(l=a),i[l]=o[a]})),n=pn&&pn.__exportStar||function(i,o){for(var a in i)a!=="default"&&!o.hasOwnProperty(a)&&t(o,i,a)};Object.defineProperty(e,"__esModule",{value:!0}),n(H_(),e);var r=Cc();Object.defineProperty(e,"ReadCursor",{enumerable:!0,get:function(){return r.ReadCursor}}),Object.defineProperty(e,"WriteCursor",{enumerable:!0,get:function(){return r.WriteCursor}});var s=Ic();Object.defineProperty(e,"ConflictType",{enumerable:!0,get:function(){return s.ConflictType}})})(pn)),pn}var lt=B_();const $_=Md({__proto__:null,default:pt(lt)},[lt]);var Re=(e=>(e[e.COVER=0]="COVER",e[e.REPLACE=1]="REPLACE",e))(Re||{}),J=(e=>(e.RETAIN="r",e.INSERT="i",e.DELETE="d",e))(J||{});const fr=Ce.createIdentifier("univer.config-service");class Ac{constructor(){E(this,"_configChanged$",new se.Subject);E(this,"configChanged$",this._configChanged$.asObservable());E(this,"_config",new Map)}dispose(){this._config.clear(),this._configChanged$.complete()}getConfig(t){return this._config.get(t)}setConfig(t,n,r){var o;const{merge:s=!1}=r||{};let i=(o=this._config.get(t))!=null?o:{};s?i=is(i,n):i=n,this._config.set(t,i),this._configChanged$.next({[t]:i})}deleteConfig(t){return this._config.delete(t)}subscribeConfigValue$(t){return new se.Observable(n=>{Object.prototype.hasOwnProperty.call(this._config,t)&&n.next(this._config.get(t));const r=this.configChanged$.pipe(se.filter(s=>Object.prototype.hasOwnProperty.call(s,t))).subscribe(s=>n.next(s[t]));return()=>r.unsubscribe()})}}const Un=Ce.createIdentifier("univer.context-service");class Tc extends Ke{constructor(){super(...arguments);E(this,"_contextChanged$",new se.Subject);E(this,"contextChanged$",this._contextChanged$.asObservable());E(this,"_contextMap",new Map)}dispose(){super.dispose(),this._contextChanged$.complete(),this._contextMap.clear()}getContextValue(n){var r;return(r=this._contextMap.get(n))!=null?r:!1}setContextValue(n,r){this._contextMap.set(n,r),this._contextChanged$.next({[n]:r})}subscribeContextValue$(n){return new se.Observable(r=>{const s=this._contextChanged$.pipe(se.filter(i=>typeof i[n]<"u")).subscribe(i=>r.next(i[n]));return this._contextMap.has(n)&&r.next(this._contextMap.get(n)),()=>s.unsubscribe()})}}var Nc=(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))(Nc||{});const dt=Ce.createIdentifier("univer.log");class Mc extends Ke{constructor(){super(...arguments);E(this,"_logLevel",3);E(this,"_deduction",new Set)}dispose(){super.dispose(),this._logLevel=3,this._deduction.clear()}debug(...n){this._logLevel>=4&&this._log(console.debug,...n)}log(...n){this._logLevel>=3&&this._log(console.log,...n)}warn(...n){this._logLevel>=2&&this._log(console.warn,...n)}error(...n){this._logLevel>=1&&this._log(console.error,...n)}deprecate(...n){this._logLevel>=2&&this._logWithDeduplication(console.error,...n)}setLogLevel(n){this._logLevel=n}_log(n,...r){const s=r[0];/^\[(.*?)\]/g.test(s)?n(`\x1B[97;104m${s}\x1B[0m`,...r.slice(1)):n(...r)}_logWithDeduplication(n,...r){const s=j_(...r);this._deduction.has(s)||(this._deduction.add(s),this._log(n,...r))}}function j_(...e){return e.map(t=>JSON.stringify(t)).join("")}var W_=Object.getOwnPropertyDescriptor,Y_=(e,t,n,r)=>{for(var s=r>1?void 0:r?W_(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},ki=(e,t)=>(n,r)=>t(n,r,e);const gs="command.logExecution";var mr=(e=>(e[e.COMMAND=0]="COMMAND",e[e.OPERATION=1]="OPERATION",e[e.MUTATION=2]="MUTATION",e))(mr||{});const gr=Ce.createIdentifier("univer.core.command-service");class V_{constructor(){E(this,"_commands",new Map);E(this,"_commandTypes",new Map)}registerCommand(t){if(this._commands.has(t.id))throw new Error(`[CommandRegistry]: command "${t.id}" has been registered before.`);return this._commands.set(t.id,t),this._commandTypes.set(t.id,t.type),Ye(()=>{this.unregisterCommand(t.id)})}unregisterCommand(t){this._commands.delete(t),this._commandTypes.delete(t)}hasCommand(t){return this._commands.has(t)}getCommand(t){return this._commands.has(t)?[this._commands.get(t)]:null}getCommandType(t){return this._commandTypes.get(t)}}const Dc={id:"nil",type:0,handler:()=>!0};f.CommandService=class extends Ke{constructor(n,r,s){super();E(this,"_commandRegistry");E(this,"_beforeCommandExecutionListeners",[]);E(this,"_commandExecutedListeners",[]);E(this,"_collabMutationListeners",[]);E(this,"_multiCommandDisposables",new Map);E(this,"_commandExecutingLevel",0);E(this,"_commandExecutionStack",[]);this._injector=n,this._logService=r,this._configService=s,this._commandRegistry=new V_,this.registerCommand(Dc)}dispose(){super.dispose(),this._commandExecutedListeners.length=0,this._beforeCommandExecutionListeners.length=0,this._collabMutationListeners.length=0}hasCommand(n){return this._commandRegistry.hasCommand(n)}registerCommand(n){return this._commandRegistry.registerCommand(n)}unregisterCommand(n){var r;this._commandRegistry.unregisterCommand(n),(r=this._multiCommandDisposables.get(n))==null||r.dispose()}registerMultipleCommand(n){return this._registerMultiCommand(n)}beforeCommandExecuted(n){if(this._beforeCommandExecutionListeners.indexOf(n)===-1)return this._beforeCommandExecutionListeners.push(n),Ye(()=>{const r=this._beforeCommandExecutionListeners.indexOf(n);this._beforeCommandExecutionListeners.splice(r,1)});throw new Error("[CommandService]: could not add a listener twice.")}onCommandExecuted(n){if(this._commandExecutedListeners.indexOf(n)===-1)return this._commandExecutedListeners.push(n),Ye(()=>{const r=this._commandExecutedListeners.indexOf(n);this._commandExecutedListeners.splice(r,1)});throw new Error("[CommandService]: could not add a listener twice.")}onMutationExecutedForCollab(n){if(this._collabMutationListeners.indexOf(n)===-1)return this._collabMutationListeners.push(n),Ye(()=>{const r=this._collabMutationListeners.indexOf(n);this._collabMutationListeners.splice(r,1)});throw new Error("[CommandService]: could not add a collab mutation listener twice.")}async executeCommand(n,r,s){try{const i=this._commandRegistry.getCommand(n);if(i){const[o]=i,a={id:o.id,type:o.type,params:r},l=this._pushCommandExecutionStack(a),c=s!=null?s:{};this._beforeCommandExecutionListeners.forEach(h=>h(a,c));const u=await this._execute(o,r,c);return c.syncOnly?o.type===2&&this._collabMutationListeners.forEach(h=>h(a,c)):(this._commandExecutedListeners.forEach(h=>h(a,c)),o.type===2&&this._collabMutationListeners.forEach(h=>h(a,c))),l.dispose(),u}throw new Error(`[CommandService]: command "${n}" is not registered.`)}catch(i){if(i instanceof Zr)return!1;throw i}}syncExecuteCommand(n,r,s){var i;try{const o=this._commandRegistry.getCommand(n);if(o){const[a]=o,l={id:a.id,type:a.type,params:r};if(a.type===2){const d=xd(this._commandExecutionStack,m=>m.type===0);d&&(l.params=(i=l.params)!=null?i:{},l.params.trigger=d.id)}const c=this._pushCommandExecutionStack(l),u=s!=null?s:{};this._beforeCommandExecutionListeners.forEach(d=>d(l,u));const h=this._syncExecute(a,r,u);return u.syncOnly?a.type===2&&this._collabMutationListeners.forEach(d=>d(l,u)):(this._commandExecutedListeners.forEach(d=>d(l,u)),a.type===2&&this._collabMutationListeners.forEach(d=>d(l,u))),c.dispose(),h}throw new Error(`[CommandService]: command "${n}" is not registered.`)}catch(o){if(o instanceof Zr)return!1;throw o}}_pushCommandExecutionStack(n){return this._commandExecutionStack.push(n),Ye(()=>rr(this._commandExecutionStack,n))}_registerMultiCommand(n){const r=this._commandRegistry.getCommand(n.id);let s;if(r){if(r[0].multi!==!0)throw new Error("Command has registered as a single command.");s=r[0]}else{s=new z_(n.id);const o=new os;o.add(this._commandRegistry.registerCommand(s)),o.add(Ye(()=>{this._multiCommandDisposables.delete(n.id)})),this._multiCommandDisposables.set(n.id,o)}const i=s.registerImplementation(n);return Ye(()=>{var o;i.dispose(),s.hasImplementations()||(o=this._multiCommandDisposables.get(n.id))==null||o.dispose()})}async _execute(n,r,s){if(s!=null&&s.syncOnly)return!0;this._configService.getConfig(gs)!==!1&&this._logService.debug("[CommandService]",`${"|-".repeat(Math.max(this._commandExecutingLevel,0))}executing command "${n.id}"`),this._commandExecutingLevel++;let i;try{i=await this._injector.invoke(n.handler,r,s),this._commandExecutingLevel--}catch(o){throw i=!1,this._commandExecutingLevel=0,o}return i}_syncExecute(n,r,s){if(s!=null&&s.syncOnly)return!0;this._configService.getConfig(gs)!==!1&&this._logService.debug("[CommandService]",`${"|-".repeat(Math.max(0,this._commandExecutingLevel))}executing command "${n.id}".`),this._commandExecutingLevel++;let i;try{if(i=this._injector.invoke(n.handler,r,s),i instanceof Promise)throw new TypeError("[CommandService]: Command handler should not return a promise.");this._commandExecutingLevel--}catch(o){throw i=!1,this._commandExecutingLevel=0,o}return i}},f.CommandService=Y_([ki(0,Ce.Inject(Ce.Injector)),ki(1,dt),ki(2,fr)],f.CommandService);class z_{constructor(t){E(this,"name");E(this,"multi",!0);E(this,"type",0);E(this,"priority",0);E(this,"_implementations",[]);E(this,"handler",async(t,n)=>{if(!this._implementations.length)return!1;const r=t.get(dt),s=t.get(Un),i=t.get(Ce.Injector);for(const o of this._implementations){const a=o.command.preconditions;if((!a||a&&a(s))&&(r.debug("[MultiCommand]",`executing implementation "${o.command.name}".`),await i.invoke(o.command.handler,n)))return!0}return!1});this.id=t,this.name=t}registerImplementation(t){const n={command:t};return this._implementations.push(n),this._implementations.sort((r,s)=>s.command.priority-r.command.priority),Ye(()=>{const r=this._implementations.indexOf(n);this._implementations.splice(r,1)})}hasImplementations(){return this._implementations.length>0}}function _s(e,t,n){const r=e.map(s=>()=>t.syncExecuteCommand(s.id,s.params,n));return Cl(r)}function G_(e,t,n){const r=e.map(s=>()=>t.executeCommand(s.id,s.params,n));return El(r)}function Lc(e){return new se.Observable(t=>{const n=e((...r)=>t.next(r));return()=>n==null?void 0:n.dispose()})}function Fi(e){return function(n){return new se.Observable(r=>(n.subscribe({next:s=>{r.next(s),e(s)&&r.complete()},complete:()=>r.complete(),error:s=>r.error(s)}),()=>r.unsubscribe()))}}function K_(e=0){return t=>{let n=[];return t.pipe(se.tap(r=>n.push(r)),se.debounceTime(e),se.map(()=>n),se.tap(()=>n=[]))}}function X_(e){const t=new se.ReplaySubject(1);return setTimeout(()=>t.next(),e),t.pipe(se.take(1))}function q_(e,t){const n=new se.BehaviorSubject(t);return e.subscribe(n),n}const J_=e=>new Promise(t=>{se.merge(Lc(e.onCommandExecuted.bind(e)).pipe(qr.filter(([n])=>n.type===mr.MUTATION)),se.timer(300)).pipe(qr.debounceTime(16),qr.first()).subscribe(()=>{t()})});function Uc(e,t){let n=0,r=e.length-1;if(t<e[0])return 0;if(t>=e[e.length-1])return e.length-1;for(;n<=r;){if(e[n]===t){for(;n<e.length&&e[n]===t;)n++;return n}if(t>e[n]&&t<e[n+1])return n+1;if(e[r]===t){for(;r<e.length&&e[r]===t;)r++;return r}if(t>e[r-1]&&t<e[r])return r;n++,r--}return-1}function Z_(e,t){let n=0,r=e.length-1;for(;n<=r;){const s=Math.floor((r+n)/2);if(t<e[s]&&(s===0||t>=e[s-1]))return s;if(t>=e[s])n=s+1;else if(t<e[s])r=s-1;else return-1}return-1}function Pc(e,t){let n=0,r=e.length;for(;n<r;){const s=Math.floor((n+r)/2);e[s]<=t?n=s+1:r=s}return n<e.length?n:e.length-1}function _r(e,t,n=!1){let r=e.length-1;if(t<0||t<e[0])return 0;if(e.length<40||t<=e[20]||t>=e[r-20]?r=Uc(e,t):r=Pc(e,t),n){const s=e[r];return e.indexOf(s)}return r}function Q_(e){const t=new Blob([e],{type:"text/javascript"});return window.URL.createObjectURL(t)}const pr=2,kc=1;function ep(e,t){if(t==null||e==null)return!0;const{left:n=0,top:r=0,height:s=0,width:i=0,angle:o=0}=t,{left:a=0,top:l=0,height:c=0,width:u=0,angle:h=0}=e,d=u,m=c,_=i,p=s;return Math.abs(a-n)>pr||Math.abs(l-r)>pr||Math.abs(d-_)>pr||Math.abs(m-p)>pr||Math.abs(h-o)>kc}function ps(e,t,n){const{dataStream:r,textRuns:s=[]}=e;let i=t;const o=[];for(const a of s){const{st:l,ed:c}=a;Z.hasIntersectionBetweenTwoRanges(t,n,l,c)&&(l>i?(o.push(r.slice(i,l)),o.push(xi(r,{...a,ed:Math.min(c,n)}))):o.push(xi(r,{...a,st:i,ed:Math.min(c,n)}))),i=Math.max(t,Math.min(c,n))}return i!==n&&o.push(r.slice(i,n)),o.join("")}function tp(e,t=!0){var n;if(t&&((n=e.paragraphs)!=null&&n.length)){const{dataStream:r,paragraphs:s=[]}=e;let i="",o=-1;for(const a of s){const{startIndex:l,paragraphStyle:c={}}=a,{spaceAbove:u,spaceBelow:h,lineSpacing:d}=c,m=[];u!=null&&(typeof u=="number"?m.push(`margin-top: ${u}px`):m.push(`margin-top: ${u.v}px`)),h!=null&&(typeof h=="number"?m.push(`margin-bottom: ${h}px`):m.push(`margin-bottom: ${h.v}px`)),d!=null&&m.push(`line-height: ${d}`),l>o+1?i+=`<p class="UniverNormal" ${m.length?`style="${m.join("; ")};"`:""}>${ps(e,o+1,l)}</p>`:i+=`<p class="UniverNormal" ${m.length?`style="${m.join("; ")};"`:""}></p>`,o=l}return o!==r.length&&(i+=ps(e,o,r.length)),i}else return ps(e,0,e.dataStream.length)}function xi(e,t){const{st:n,ed:r,ts:s={}}=t,{ff:i,fs:o,it:a,bl:l,ul:c,st:u,ol:h,bg:d,cl:m,va:_}=s;let p=e.slice(n,r);const I=[];return a===ae.TRUE&&(p=`<i>${p}</i>`),_===jt.SUPERSCRIPT?p=`<sup>${p}</sup>`:_===jt.SUBSCRIPT&&(p=`<sub>${p}</sub>`),(c==null?void 0:c.s)===ae.TRUE&&(p=`<u>${p}</u>`),(u==null?void 0:u.s)===ae.TRUE&&(p=`<s>${p}</s>`),l===ae.TRUE&&(p=`<strong>${p}</strong>`),i&&I.push(`font-family: ${i}`),m&&I.push(`color: ${m.rgb}`),o&&I.push(`font-size: ${o}pt`),h&&I.push("text-decoration: overline"),d&&I.push(`background: ${d.rgb}`),I.length?`<span style="${I.join("; ")};">${p}</span>`:p}const Fc={[hs.OFFICE]:{[at.ACCENT1]:"#4472C4",[at.ACCENT2]:"#ED7D31",[at.ACCENT3]:"#A5A5A5",[at.ACCENT4]:"#70AD47",[at.ACCENT5]:"#5B9BD5",[at.ACCENT6]:"#70AD47",[at.DARK1]:"#000000",[at.DARK2]:"#44546A",[at.LIGHT1]:"#FFFFFF",[at.LIGHT2]:"#E7E6E6",[at.HYPERLINK]:"#0563C1",[at.FOLLOWED_HYPERLINK]:"#954F72"}};class Es{constructor(){E(this,"_themeValue",at.LIGHT1);E(this,"_themeColors");E(this,"_themeTint");E(this,"_rgbValue","");E(this,"_colorType");this._colorType=Rt.UNSUPPORTED,this._themeColors=hs.OFFICE,this._themeTint=0}asRgbColor(){return new Cs(this._rgbValue,this)}asThemeColor(){return new Rs(this._themeValue,this._themeTint,this._themeColors,this)}build(){switch(this._colorType){case Rt.THEME:return this.asThemeColor();case Rt.RGB:return this.asRgbColor();case Rt.UNSUPPORTED:throw new Error("unsupported color type")}}setRgbColor(t){return this._colorType=Rt.RGB,this._rgbValue=t,this}setThemeColors(t){this._colorType=Rt.THEME,this._themeColors=t}setThemeTint(t){this._colorType=Rt.THEME,this._themeTint=t}setThemeColor(t){return this._colorType=Rt.THEME,this._themeValue=t,this}getColorType(){return this._colorType}}class Cn{constructor(t){E(this,"_builder");this._builder=t}static rgbColorToHexValue(t){return`#${((1<<24)+(t.getRed()<<16)+(t.getGreen()<<8)+t.getBlue()).toString(16).slice(1)}`}static hexValueToRgbColor(t){t?t.indexOf("#")>-1&&(t=t.substring(1)):t="#000000";const n=+`0x${t[0]}${t[1]}`,r=+`0x${t[2]}${t[3]}`,s=+`0x${t[4]}${t[5]}`;return new Es().setRgbColor(`rgb(${n},${r},${s})`).asRgbColor()}static hexToRgbString(t){const n=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;t=t.replace(n,(i,o,a,l)=>o+o+a+a+l+l);const r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);let s=null;if(r){const i=Number.parseInt(r[1],16),o=Number.parseInt(r[2],16),a=Number.parseInt(r[3],16);s=`rgba(${i},${o},${a})`}return s}asRgbColor(){return this._builder.asRgbColor()}asThemeColor(){return this._builder.asThemeColor()}getColorType(){return this._builder.getColorType()}clone(){return new Cn(this._builder)}equals(t){return!1}}class xc{constructor(t){E(this,"_saturation",0);E(this,"_hue",0);E(this,"_lightness",0);E(this,"_alpha",0);const n=t.getRed()/255,r=t.getGreen()/255,s=t.getBlue()/255,i=t.getAlpha()/255,o=Math.min(n,Math.min(r,s)),a=Math.max(n,Math.max(r,s)),l=a-o;if(a===o){this._hue=0,this._saturation=0,this._lightness=a;return}this._lightness=(o+a)/2,this._lightness<.5?this._saturation=l/(a+o):this._saturation=l/(2-a-o),n===a&&(this._hue=(r-s)/l),r===a&&(this._hue=2+(s-n)/l),s===a&&(this._hue=4+(n-r)/l),this._hue*=60,this._hue<0&&(this._hue+=360),this._alpha=i}asRgbColor(){const t=new Es;if(this._saturation===0)return t.setRgbColor(`rgba(${this._lightness*255},${this._lightness*255},${this._lightness*255},${this._alpha*255})`),t.asRgbColor();let n;this._lightness<.5?n=this._lightness*(1+this._saturation):n=this._lightness+this._saturation-this._lightness*this._saturation;const r=2*this._lightness-n,s=this._hue/360,i=s+1/3,o=this.setColor(n,r,i),a=this.setColor(n,r,s),l=s-1/3,c=this.setColor(n,r,l);return t.setRgbColor(`rgba(${Math.round(o*255)},${Math.round(a*255)},${Math.round(c*255)},${this._alpha*255})`),t.asRgbColor()}getLightness(){return this._lightness}getHue(){return this._hue}getSaturation(){return this._saturation}getAlpha(){return this._alpha}setColor(t,n,r){r<0&&(r+=1),r>1&&(r-=1);let s;return 6*r<1?s=n+(t-n)*6*r:2*r<1?s=t:3*r<2?s=n+(t-n)*(2/3-r)*6:s=n,s}setLightness(t){this._lightness=t}}const Ot=class Ot extends Cn{constructor(n,r){super(r);E(this,"_cssString");E(this,"_red");E(this,"_green");E(this,"_blue");E(this,"_alpha");let s=n.match(Ot.RGBA_EXTRACT);if(s){const i=+s[1],o=+s[2],a=+s[3],l=+s[4];this._cssString=n,this._red=i,this._green=o,this._blue=a,this._alpha=l;return}if(s=n.match(Ot.RGB_EXTRACT),s){const i=+s[1],o=+s[2],a=+s[3];this._cssString=n,this._red=i,this._green=o,this._blue=a,this._alpha=1;return}throw new Error("Invalid rgba or rgb color")}asHexString(){return Cn.rgbColorToHexValue(this)}getRed(){let n=this._red+Ot.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getGreen(){let n=this._green+Ot.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getBlue(){let n=this._blue+Ot.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getAlpha(){return this._alpha}getColorType(){return Rt.RGB}clone(){return new Ot(this._cssString,this._builder)}asThemeColor(){throw new Error("rgb color not support to themeColor")}equals(n){return n instanceof Ot?n._red===this._red&&n._blue===this._blue&&n._green===this._green&&n._alpha===this._alpha:!1}getCssString(){return this._cssString}};E(Ot,"RGB_COLOR_AMT",0),E(Ot,"RGBA_EXTRACT",new RegExp("\\s*rgba\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d.\\d|\\d\\s*)\\)\\s*")),E(Ot,"RGB_EXTRACT",new RegExp("\\s*rgb\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*)\\)\\s*"));let Cs=Ot;const ln=class ln extends Cn{constructor(n,r,s,i){super(i);E(this,"_themeColorType");E(this,"_themeTint");E(this,"_themeColors");this._themeColorType=n,this._themeTint=r,this._themeColors=s}lumValue(n,r){if(n==null)return r;let s;return n<0?s=r*(1+n):s=r*(1-n)+(255-255*(1-n)),s}asRgbColor(){const n=Fc[this._themeColors];if(n==null)throw new Error("not find themeColors type");const r=n[this._themeColorType];if(r==null)throw new Error("not find themeColors value");let s;if(ln._cacheThemeColor.has(this._themeColors)){if(s=ln._cacheThemeColor.get(this._themeColors),s.has(this._themeColorType))return s.get(this._themeColorType)}else s=new Map,ln._cacheThemeColor.set(this._themeColors,s);const i=new xc(Cn.hexValueToRgbColor(r));i.setLightness(this.lumValue(this._themeTint,i.getLightness()*255)/255);const o=i.asRgbColor();return s.set(this._themeColorType,o),o}clone(){return new ln(this._themeColorType,this._themeTint,this._themeColors,this._builder)}equals(n){return n instanceof ln?n._themeColorType===this._themeColorType:!1}getColorType(){return Rt.THEME}getThemeColorType(){return this._themeColorType}};E(ln,"_cacheThemeColor",new Map);let Rs=ln;const np="rgb(",rp="rgba(",Hi={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],darkyellow:[139,128,0],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(t){E(this,"_color");E(this,"_rgbColor");E(this,"_isValid",!1);if(t==null){this._setNullColor();return}if(t instanceof It){this._color={...t._color},this._rgbColor={...t._rgbColor};return}const n=Hc(t);if(n==null){this._setNullColor();return}this._color=n;const r=lp(this._color);if(r==null){this._setNullColor();return}this._rgbColor=r,this._isValid=!0}static mix(t,n,r){var c,u;r=Math.min(1,Math.max(0,r));const s=new It(t).toRgb(),i=new It(n).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(t,n){const r=new It(t).getLuminance(),s=new It(n).getLuminance();return(Math.max(r,s)+.05)/(Math.min(r,s)+.05)}get isValid(){return this._isValid}toRgb(){return this._rgbColor}toRgbString(){const{r:t,g:n,b:r,a:s=1}=this.toRgb(),i=s<1;return`rgb${i?"a":""}(${t},${n},${r}${i?`,${s}`:""})`}toString(){return this.toRgbString()}toHexString(t){const{r:n,g:r,b:s,a:i=1}=this.toRgb(),o=i<1,a=[Is(Math.round(n).toString(16)),Is(Math.round(r).toString(16)),Is(Math.round(s).toString(16)),Is(Math.round(i*255).toString(16))];return t&&a[0][0]===a[0][1]&&a[1][0]===a[1][1]&&a[2][0]===a[2][1]&&a[3][0]===a[3][1]?o?`#${a[0][0]}${a[1][0]}${a[2][0]}${a[3][0]}`:`#${a[0][0]}${a[1][0]}${a[2][0]}`:o?`#${a[0]}${a[1]}${a[2]}${a[3]}`:`#${a[0]}${a[1]}${a[2]}`}toHsv(){return dp(this.toRgb())}toHsl(){return hp(this.toRgb())}lighten(t=10){const n=this.toHsl();return n.l+=t,n.l=Math.min(Math.max(n.l,0),100),new It(n)}darken(t=10){const n=this.toHsl();return n.l-=t,n.l=Math.min(Math.max(n.l,0),100),new It(n)}setAlpha(t){return new It({...this._rgbColor,a:t})}getLuminance(){let{r:t,g:n,b:r}=this.toRgb();return t=Bi(t),n=Bi(n),r=Bi(r),Number((.2126*t+.7152*n+.0722*r).toFixed(3))}getBrightness(){const{r:t,g:n,b:r}=this.toRgb();return(t*299+n*587+r*114)/1e3}getAlpha(){var t;return(t=this._color.a)!=null?t:1}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}_setNullColor(){this._isValid=!1,this._color={r:0,g:0,b:0,a:0},this._rgbColor={r:0,g:0,b:0,a:0}}}const Is=e=>e.length===1?`0${e}`:e,Bi=e=>(e/=255,e<=.03928?e/12.92:((e+.055)/1.055)**2.4),Hc=e=>{if(mp(e)){if("r"in e){const r={r:Math.round(e.r),g:Math.round(e.g),b:Math.round(e.b)};return e.a!==void 0&&(r.a=e.a),r}if("l"in e){const r={h:Math.round(e.h),s:e.s,l:e.l};return e.a!==void 0&&(r.a=e.a),r}const n={h:Math.round(e.h),s:e.s,v:e.v};return e.a!==void 0&&(n.a=e.a),n}const t=e.trim().toLowerCase();if(Hi[t]){const n=Hi[t],r={r:Math.round(n[0]),g:Math.round(n[1]),b:Math.round(n[2])};return r.a=n[3]||1,r}if(t.startsWith("#"))return sp(t);if(t.startsWith("rgb"))return ip(t);if(t.startsWith("hsl"))return op(t);if(t.startsWith("hsv"))return ap(t)},sp=e=>{const t=e.substring(1),n=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let r=t.match(n);if(!r||r.length<3)throw new Error(`The color '${e}' is illegal hex color`);r[0].length===1&&(r=r.map(i=>i+i));const s={r:Number.parseInt(r[0],16),g:Number.parseInt(r[1],16),b:Number.parseInt(r[2],16)};return r.length>3&&(s.a=Number.parseInt(r[3],16)/255),s},ip=e=>{const t=e.indexOf("(");if(t===-1)throw new Error(`The color '${e}' is illegal rgb color`);const n=e.substring(t+1,e.length-1).split(",");if(n.length<3)throw new Error(`The color '${e}' is illegal rgb color`);const r={r:Number.parseInt(n[0],10),g:Number.parseInt(n[1],10),b:Number.parseInt(n[2],10)};return n.length>3&&(r.a=Number.parseFloat(n[3])),r},op=e=>{const t=e.indexOf("(");if(t===-1)throw new Error(`The color '${e}' is illegal hsl color`);const n=e.substring(t+1,e.length-1).split(",");if(n.length<3)throw new Error(`The color '${e}' is illegal hsl color`);const r={h:Number.parseInt(n[0],10),s:Number.parseFloat(n[1]),l:Number.parseFloat(n[2])};return n.length>3&&(r.a=Number.parseFloat(n[3])),r},ap=e=>{const t=e.indexOf("(");if(t===-1)throw new Error(`The color '${e}' is illegal hsv color`);const n=e.substring(t+1,e.length-1).split(",");if(n.length<3)throw new Error(`The color '${e}' is illegal hsv color`);const r={h:Number.parseInt(n[0],10),s:Number.parseFloat(n[1]),v:Number.parseFloat(n[2])};return n.length>3&&(r.a=Number.parseFloat(n[3])),r},lp=e=>{const t=Hc(e);if(t!=null)return"r"in t?t:"l"in t?cp(t):up(t)},$i=(e,t,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),cp=e=>{let{h:t,s:n,l:r}=e;t/=360,n/=100,r/=100;let s=0,i=0,o=0;if(n===0)s=i=o=r;else{const l=r<.5?r*(1+n):r+n-r*n,c=2*r-l;s=$i(c,l,t+1/3),i=$i(c,l,t),o=$i(c,l,t-1/3)}const a={r:Math.round(s*255),g:Math.round(i*255),b:Math.round(o*255)};return e.a!==void 0&&(a.a=e.a),a},up=e=>{let{h:t,s:n,v:r}=e;t=t/360*6,n/=100,r/=100;const s=Math.floor(t),i=t-s,o=r*(1-n),a=r*(1-i*n),l=r*(1-(1-i)*n),c=s%6,u=[r,a,o,o,l,r][c],h=[l,r,r,a,o,o][c],d=[o,o,l,r,r,a][c],m={r:u*255,g:h*255,b:d*255};return e.a!==void 0&&(m.a=e.a),m},hp=e=>{let{r:t,g:n,b:r}=e;t/=255,n/=255,r/=255;const s=Math.max(t,n,r),i=Math.min(t,n,r),o=(s+i)/2;let a,l;if(s===i)a=l=0;else{const u=s-i;switch(l=o>.5?u/(2-s-i):u/(s+i),s){case t:a=(n-r)/u+(n<r?6:0);break;case n:a=(r-t)/u+2;break;default:a=(t-n)/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},dp=e=>{let{r:t,g:n,b:r}=e;t/=255,n/=255,r/=255;const s=Math.max(t,n,r),i=Math.min(t,n,r);let o;const a=s,l=s-i,c=s===0?0:l/s;if(s===i)o=0;else{switch(s){case t:o=(n-r)/l+(n<r?6:0);break;case n:o=(r-t)/l+2;break;default:o=(t-n)/l+4;break}o/=6}const 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},fp=e=>e==null,mp=e=>!fp(e)&&typeof e=="object";function gp(e){const t=/^#(?:[0]{3}|[0]{6})\b/,n=/^rgb\s*\(\s*0+\s*,\s*0+\s*,\s*0+\s*\)$/,r=/^rgba\s*\(\s*0+\s*,\s*0+\s*,\s*0+\s*,\s*(1|1\.0*|0?\.\d+)\)$/,s=/^hsl\s*\(\s*0*\s*,\s*0%*\s*,\s*0%*\s*\)$/,i=/^hsla\s*\(\s*0*\s*,\s*0%*\s*,\s*0%*\s*,\s*(1|1\.0*|0?\.\d+)\)$/;return!!(t.test(e)||n.test(e)||r.test(e)||s.test(e)||i.test(e))}function _p(e){const t=/^#(?:[Ff]{3}|[Ff]{6})\b/,n=/^rgb\s*\(\s*255\s*,\s*255\s*,\s*255\s*\)$/,r=/^rgba\s*\(\s*255\s*,\s*255\s*,\s*255\s*,\s*(1|1\.0*|0?\.\d+)\)$/,s=/^hsl\s*\(\s*0*\s*,\s*0%*\s*,\s*100%*\s*\)$/,i=/^hsla\s*\(\s*0*\s*,\s*0%*\s*,\s*100%*\s*,\s*(1|1\.0*|0?\.\d+)\)$/;return!!(t.test(e)||n.test(e)||r.test(e)||s.test(e)||i.test(e))}function Bc(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 pp(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 Ep(e){if(e==null)return!0;const{v:t,f:n,si:r,p:s,custom:i}=e;return!(!(t==null||typeof t=="string"&&t.length===0)||n!=null&&n.length>0||r!=null&&r.length>0||s!=null||i!=null)}function $c(e){return e!=null&&(typeof e=="string"||typeof e=="number"||typeof e=="boolean")}var pe=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ROW=1]="ROW",e[e.COLUMN=2]="COLUMN",e[e.ALL=3]="ALL",e))(pe||{}),Me=(e=>(e[e.NONE=0]="NONE",e[e.ROW=1]="ROW",e[e.COLUMN=2]="COLUMN",e[e.ALL=3]="ALL",e))(Me||{});function Cp(e){return[e.startRow,e.startColumn,e.endRow,e.endColumn]}var jc=(e=>(e.NONE="none",e.BACKWARD="backward",e.FORWARD="forward",e))(jc||{}),Wc=(e=>(e.RECT="RECT",e.TEXT="TEXT",e))(Wc||{});function Rp(e,t,n){let r=!1,s=!1,i=e,o=t,a=e,l=t;if(n==null)return{actualRow:e,actualColumn:t,isMergedMainCell:s,isMerged:r,endRow:i,endColumn:o,startRow:a,startColumn:l};for(let c=0;c<n.length;c++){const{startRow:u,endRow:h,startColumn:d,endColumn:m}=n[c];if(e===u&&t===d){i=h,o=m,a=u,l=d,s=!0;break}if(e>=u&&e<=h&&t>=d&&t<=m){i=h,o=m,a=u,l=d,r=!0;break}}return{actualRow:e,actualColumn:t,isMergedMainCell:s,isMerged:r,endRow:i,endColumn:o,startRow:a,startColumn:l}}var Pn=(e=>(e.Raw="raw",e.Intercepted="intercepted",e.Both="both",e))(Pn||{});const Er=2,Cr=2**2,Ss=2**3,Rr=2**4,Ir=2**5,Sr=2**6,ji=2**7,Wi=2**8,Yi=2**9,Ip=0,Sp=2958466,Op=-694324,wp=35830291,vp=-1,Yc=1,kn=6,Vi="general",zi="hash",Fn="zero",Gi="qmark",Ki="slash",Or="group",Os="scale",Xi="comma",qi="break",ws="text",Ji="plus",Zi="minus",vs="point",Qi="space",eo="percent",bs="digit",to="calendar",wr="error",no="datetime",ro="duration",so="condition",io="dbnum",oo="natnum",ao="locale",lo="color",Vc="modifier",co="ampm",uo="escaped",ho="string",fo="skip",mo="exp",go="fill",_o="paren",ys="char",bp=["#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"],po=["¤","$","£","¥","֏","؋","৳","฿","៛","₡","₦","₩","₪","₫","€","₭","₮","₱","₲","₴","₸","₹","₺","₼","₽","₾","₿"],Eo=new RegExp("["+po.join("")+"]"),Co=Object.freeze({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"}),zc=/^([a-z\d]+)(?:[_-]([a-z\d]+))?(?:\.([a-z\d]+))?(?:@([a-z\d]+))?$/i,xn={},C=(e,t="")=>e.replace(/~/g,t).split(";"),ke=(e,t=0,n=0)=>(e.mmm||(e.mmm=t<1?e.mmmm.concat():e.mmmm.map(r=>{const s=r.slice(0,t%10);return s+(t<10||r===s?"":".")})),e.ddd||(e.ddd=n<1?e.dddd.concat():e.dddd.map(r=>{const s=r.slice(0,n%10);return s+(n<10||r===s?"":".")})),!e.mmm6&&e.mmmm6&&(e.mmm6=e.mmmm6),e),yp={group:" ",decimal:".",positive:"+",negative:"-",percent:"%",exponent:"E",nan:"NaN",infinity:"∞",ampm:C("AM;PM"),mmmm6:C("Muharram;Safar;Rabiʻ I;Rabiʻ II;Jumada I;Jumada II;Rajab;Shaʻban;Ramadan;Shawwal;Dhuʻl-Qiʻdah;Dhuʻl-Hijjah"),mmm6:C("Muh.;Saf.;Rab. I;Rab. II;Jum. I;Jum. II;Raj.;Sha.;Ram.;Shaw.;Dhuʻl-Q.;Dhuʻl-H."),mmmm:C("January;February;March;April;May;June;July;August;September;October;November;December"),mmm:C("Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec"),dddd:C("Sunday;Monday;Tuesday;Wednesday;Thursday;Friday;Saturday"),ddd:C("Sun;Mon;Tue;Wed;Thu;Fri;Sat"),bool:C("TRUE;FALSE"),preferMDY:!1};function Ro(e){const t=zc.exec(e);if(!t)throw new SyntaxError(`Malformed locale: ${e}`);return{lang:t[1]+(t[2]?"_"+t[2]:""),language:t[1],territory:t[2]||""}}function Io(e){if(typeof e=="number")return Co[e&65535]||null;const t=parseInt(e,16);return isFinite(t)&&Co[t&65535]?Co[t&65535]||null:zc.test(e)?e:null}function Hn(e){const t=Io(e);let n=null;if(t){const r=Ro(t);n=xn[r.lang]||xn[r.language]||null}return n}function So(e){return Object.assign({},yp,e)}function ne(e,t){const n=typeof t=="object"?t:Ro(t);return xn[n.lang]=So(e),n.language!==n.lang&&!xn[n.language]&&(xn[n.language]=So(e)),xn[n.lang]}const tn=So({group:",",preferMDY:!0});tn.isDefault=!0,ne({group:",",ampm:C("上午;下午"),mmmm:C("一月;二月;三月;四月;五月;六月;七月;八月;九月;十月;十一月;十二月"),mmm:C("1月;2月;3月;4月;5月;6月;7月;8月;9月;10月;11月;12月"),dddd:C("~日;~一;~二;~三;~四;~五;~六","星期"),ddd:C("周日;周一;周二;周三;周四;周五;周六")},"zh_CN");const Oo={group:",",ampm:C("上午;下午"),mmmm:C("1月;2月;3月;4月;5月;6月;7月;8月;9月;10月;11月;12月"),mmm:C("1月;2月;3月;4月;5月;6月;7月;8月;9月;10月;11月;12月"),dddd:C("~日;~一;~二;~三;~四;~五;~六","星期"),ddd:C("周日;周一;周二;周三;周四;周五;周六")};ne({...Oo,nan:"非數值",dddd:C("~日;~一;~二;~三;~四;~五;~六","星期")},"zh_TW"),ne({...Oo,dddd:C("~日;~一;~二;~三;~四;~五;~六","星期")},"zh_HK"),ne({...Oo,ampm:C("午前;午後"),dddd:C("日~;月~;火~;水~;木~;金~;土~","曜日"),ddd:C("日;月;火;水;木;金;土")},"ja"),ne({group:",",ampm:C("오전;오후"),mmmm:C("1월;2월;3월;4월;5월;6월;7월;8월;9월;10월;11월;12월"),mmm:C("1월;2월;3월;4월;5월;6월;7월;8월;9월;10월;11월;12월"),dddd:C("일요일;월요일;화요일;수요일;목요일;금요일;토요일"),ddd:C("일;월;화;수;목;금;토")},"ko"),ne({group:",",ampm:C("ก่อนเที่ยง;หลังเที่ยง"),mmmm:C("มกร~;กุมภาพันธ์;มีน~;เมษายน;พฤษภ~;มิถุนายน;กรกฎ~;สิงห~;กันยายน;ตุล~;พฤศจิกายน;ธันว~","าคม"),mmm:C("ม.ค.;ก.พ.;มี.ค.;เม.ย.;พ.ค.;มิ.ย.;ก.ค.;ส.ค.;ก.ย.;ต.ค.;พ.ย.;ธ.ค."),dddd:C("วันอาทิตย์;วันจันทร์;วันอังคาร;วันพุธ;วันพฤหัสบดี;วันศุกร์;วันเสาร์"),ddd:C("อา.;จ.;อ.;พ.;พฤ.;ศ.;ส.")},"th"),ne(ke({decimal:",",ampm:C("dop.;odp."),mmmm:C("ledna;února;března;dubna;května;června;července;srpna;září;října;listopadu;prosince"),mmm:C("I;II;III;IV;V;VI;VII;VIII;IX;X;XI;XII"),dddd:C("neděle;pondělí;úterý;středa;čtvrtek;pátek;sobota"),bool:C("PRAVDA;NEPRAVDA")},-1,2),"cs"),ne(ke({group:".",decimal:",",mmmm:C("januar;februar;marts;april;maj;juni;juli;august;september;oktober;november;december"),dddd:C("søn~;man~;tirs~;ons~;tors~;fre~;lør~","dag"),bool:C("SAND;FALSK")},13,13),"da"),ne(ke({group:".",decimal:",",ampm:C("a.m.;p.m."),mmmm:C("januari;februari;maart;april;mei;juni;juli;augustus;september;oktober;november;december"),mmm:C("jan.;feb.;mrt.;apr.;mei;jun.;jul.;aug.;sep.;okt.;nov.;dec."),dddd:C("zondag;maandag;dinsdag;woensdag;donderdag;vrijdag;zaterdag"),bool:C("WAAR;ONWAAR")},-1,2),"nl"),ne({group:",",preferMDY:!0},"en"),ne({group:",",preferMDY:!0},"en_US"),ne({group:","},"en_AU"),ne({group:","},"en_CA"),ne({group:","},"en_GB"),ne({group:",",mmm:C("Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sept;Oct;Nov;Dec")},"en_IE"),ne(ke({decimal:",",nan:"epäluku",ampm:C("ap.;ip."),mmmm:C("tammi~;helmi~;maalis~;huhti~;touko~;kesä~;heinä~;elo~;syys~;loka~;marras~;joulu~","kuuta"),mmm:C("tammik.;helmik.;maalisk.;huhtik.;toukok.;kesäk.;heinäk.;elok.;syysk.;lokak.;marrask.;jouluk."),dddd:C("sunnun~;maanan~;tiis~;keskiviikkona;tors~;perjan~;lauan~","taina"),bool:C("TOSI;EPÄTOSI")},-1,2),"fi");const wo=ke({group:" ",decimal:",",mmmm:C("janvier;février;mars;avril;mai;juin;juillet;août;septembre;octobre;novembre;décembre"),mmm:C("janv.;févr.;mars;avr.;mai;juin;juil.;août;sept.;oct.;nov.;déc."),dddd:C("~manche;lun~;mar~;mercre~;jeu~;vendre~;same~","di"),bool:C("VRAI;FAUX")},-1,13);ne({...wo},"fr"),ne({...wo,mmm:C("janv.;févr.;mars;avr.;mai;juin;juill.;août;sept.;oct.;nov.;déc.")},"fr_CA"),ne({group:"'",decimal:".",...wo},"fr_CH");const Gc=ke({mmmm:C("Januar;Februar;März;April;Mai;Juni;Juli;August;September;Oktober;November;Dezember"),mmm:C("Jan.;Feb.;März;Apr.;Mai;Juni;Juli;Aug.;Sept.;Okt.;Nov.;Dez."),dddd:C("Sonn~;Mon~;Diens~;Mittwoch;Donners~;Frei~;Sams~","tag"),bool:C("WAHR;FALSCH")},-1,12);ne({group:".",decimal:",",...Gc},"de"),ne({group:"'",decimal:".",...Gc},"de_CH"),ne(ke({group:".",decimal:",",ampm:C("π.μ.;μ.μ."),mmmm:C("Ιανουαρ~;Φεβρουαρ~;Μαρτ~;Απριλ~;Μαΐου;Ιουν~;Ιουλ~;Αυγούστου;Σεπτεμβρ~;Οκτωβρ~;Νοεμβρ~;Δεκεμβρ~","ίου"),mmm:C("Ιαν;Φεβ;Μαρ;Απρ;Μαΐ;Ιουν;Ιουλ;Αυγ;Σεπ;Οκτ;Νοε;Δεκ"),dddd:C("Κυριακή;Δευτέρα;Τρίτη;Τετάρτη;Πέμπτη;Παρασκευή;Σάββατο")},-1,3),"el"),ne({decimal:",",ampm:C("de.;du."),mmmm:C("január;február;március;április;május;június;július;augusztus;szeptember;október;november;december"),mmm:C("jan.;febr.;márc.;ápr.;máj.;jún.;júl.;aug.;szept.;okt.;nov.;dec."),dddd:C("vasárnap;hétfő;kedd;szerda;csütörtök;péntek;szombat"),ddd:C("V;H;K;Sze;Cs;P;Szo"),bool:C("IGAZ;HAMIS")},"hu"),ne(ke({group:".",decimal:",",ampm:C("f.h.;e.h."),mmmm:C("janúar;febrúar;mars;apríl;maí;júní;júlí;ágúst;september;október;nóvember;desember"),dddd:C("sunnu~;mánu~;þriðju~;miðviku~;fimmtu~;föstu~;laugar~","dagur")},13,13),"is"),ne(ke({group:".",decimal:",",mmmm:C("Januari;Februari;Maret;April;Mei;Juni;Juli;Agustus;September;Oktober;November;Desember"),dddd:C("Minggu;Senin;Selasa;Rabu;Kamis;Jumat;Sabtu")},3,3),"id");const Kc=ke({mmmm:C("gennaio;febbraio;marzo;aprile;maggio;giugno;luglio;agosto;settembre;ottobre;novembre;dicembre"),dddd:C("domenica;lunedì;martedì;mercoledì;giovedì;venerdì;sabato"),bool:C("VERO;FALSO")},3,3);ne({group:".",decimal:",",...Kc},"it"),ne({group:"'",decimal:".",...Kc},"it_CH");const Xc={decimal:",",ampm:C("a.m.;p.m."),mmmm:C("januar;februar;mars;april;mai;juni;juli;august;september;oktober;november;desember"),mmm:C("jan.;feb.;mar.;apr.;mai;jun.;jul.;aug.;sep.;okt.;nov.;des."),dddd:C("søn~;man~;tirs~;ons~;tors~;fre~;lør~","dag"),bool:C("SANN;USANN")};ne(ke({...Xc},-1,13),"nb"),ne(ke({...Xc},-1,13),"no"),ne(ke({decimal:",",mmmm:C("stycznia;lutego;marca;kwietnia;maja;czerwca;lipca;sierpnia;września;października;listopada;grudnia"),dddd:C("niedziela;poniedziałek;wtorek;środa;czwartek;piątek;sobota"),ddd:C("niedz.;pon.;wt.;śr.;czw.;pt.;sob."),bool:C("PRAWDA;FAŁSZ")},3,-1),"pl");const qc={group:".",decimal:",",mmmm:C("janeiro;fevereiro;março;abril;maio;junho;julho;agosto;setembro;outubro;novembro;dezembro"),dddd:C("domingo;segunda-feira;terça-feira;quarta-feira;quinta-feira;sexta-feira;sábado"),bool:C("VERDADEIRO;FALSO")};ne(ke(qc,13,13),"pt"),ne(ke(qc,13,13),"pt_BR"),ne({decimal:",",nan:"не число",mmmm:C("января;февраля;марта;апреля;мая;июня;июля;августа;сентября;октября;ноября;декабря"),mmm:C("янв.;февр.;мар.;апр.;мая;июн.;июл.;авг.;сент.;окт.;нояб.;дек."),dddd:C("воскресенье;понедельник;вторник;среда;четверг;пятница;суббота"),ddd:C("вс;пн;вт;ср;чт;пт;сб"),mmmm6:C("рамадан;шавваль;зуль-каада;зуль-хиджжа;мухаррам;раби-уль-авваль;раби-уль-ахир;джумад-уль-авваль;джумад-уль-ахир;раджаб;шаабан;рамадан"),mmm6:C("рам.;шав.;зуль-к.;зуль-х.;мух.;раб. I;раб. II;джум. I;джум. II;радж.;шааб.;рам."),bool:C("ИСТИНА;ЛОЖЬ")},"ru"),ne(ke({decimal:",",mmmm:C("januára;februára;marca;apríla;mája;júna;júla;augusta;septembra;októbra;novembra;decembra"),dddd:C("nedeľa;pondelok;utorok;streda;štvrtok;piatok;sobota")},3,2),"sk");const Pt={group:".",decimal:",",ampm:C("a. m.;p. m."),mmmm:C("enero;febrero;marzo;abril;mayo;junio;julio;agosto;septiem~;octu~;noviem~;diciem~","bre"),mmm:C("ene;feb;mar;abr;may;jun;jul;ago;sept;oct;nov;dic"),dddd:C("domingo;lunes;martes;miércoles;jueves;viernes;sábado"),ddd:C("dom;lun;mar;mié;jue;vie;sáb"),bool:C("VERDADERO;FALSO")},Ap=C("ene;feb;mar;abr;may;jun;jul;ago;sep;oct;nov;dic"),vo=C("ene.;feb.;mar.;abr.;may.;jun.;jul.;ago.;sept.;oct.;nov.;dic.");ne({...Pt},"es"),ne({...Pt},"es_AR"),ne({...Pt},"es_BO"),ne({...Pt},"es_CL"),ne({...Pt},"es_CO"),ne({...Pt},"es_EC"),ne({...Pt,mmm:Ap,ampm:C("a.m.;p.m.")},"es_MX"),ne({...Pt,mmm:vo},"es_PY"),ne({...Pt,mmm:vo},"es_UY"),ne({...Pt,mmm:vo,mmmm:C("enero;febrero;marzo;abril;mayo;junio;julio;agosto;setiembre;octubre;noviembre;diciembre")},"es_VE"),ne({decimal:",",ampm:C("fm;em"),mmmm:C("januari;februari;mars;april;maj;juni;juli;augusti;september;oktober;november;december"),mmm:C("jan.;feb.;mars;apr.;maj;juni;juli;aug.;sep.;okt.;nov.;dec."),dddd:C("sön~;mån~;tis~;ons~;tors~;fre~;lör~","dag"),ddd:C("sön;mån;tis;ons;tors;fre;lör")},"sv"),ne(ke({group:".",decimal:",",ampm:C("ÖÖ;ÖS"),mmmm:C("Ocak;Şubat;Mart;Nisan;Mayıs;Haziran;Temmuz;Ağustos;Eylül;Ekim;Kasım;Aralık"),mmm:C("Oca;Şub;Mar;Nis;May;Haz;Tem;Ağu;Eyl;Eki;Kas;Ara"),dddd:C("Pazar;Pazartesi;Salı;Çarşamba;Perşembe;Cuma;Cumartesi"),ddd:C("Paz;Pzt;Sal;Çar;Per;Cum;Cmt"),bool:C("DOĞRU;YANLIŞ")},3,-1),"tr"),ne({group:",",ampm:C("yb;yh"),mmmm:C("Ionawr;Chwefror;Mawrth;Ebrill;Mai;Mehefin;Gorffennaf;Awst;Medi;Hydref;Tachwedd;Rhagfyr"),mmm:C("Ion;Chwef;Maw;Ebr;Mai;Meh;Gorff;Awst;Medi;Hyd;Tach;Rhag"),dddd:C("Dydd Sul;Dydd Llun;Dydd Mawrth;Dydd Mercher;Dydd Iau;Dydd Gwener;Dydd Sadwrn"),ddd:C("Sul;Llun;Maw;Mer;Iau;Gwen;Sad")},"cy"),ne({group:".",decimal:",",mmmm:C("yanvar;fevral;mart;aprel;may;iyun;iyul;avqust;sentyabr;oktyabr;noyabr;dekabr"),mmm:C("yan;fev;mar;apr;may;iyn;iyl;avq;sen;okt;noy;dek"),dddd:C("bazar;bazar ertəsi;çərşənbə axşamı;çərşənbə;cümə axşamı;cümə;şənbə"),ddd:C("B.;B.e.;Ç.a.;Ç.;C.a.;C.;Ş.")},"az"),ne(ke({decimal:",",mmmm:C("студзеня;лютага;сакавіка;красавіка;мая;чэрвеня;ліпеня;жніўня;верасня;кастрычніка;лістапада;снежня"),dddd:C("нядзеля;панядзелак;аўторак;серада;чацвер;пятніца;субота"),ddd:C("нд;пн;аў;ср;чц;пт;сб")},3,-1),"be"),ne({decimal:",",ampm:C("пр.об.;сл.об."),mmmm:C("януари;февруари;март;април;май;юни;юли;август;септември;октомври;ноември;декември"),mmm:C("яну;фев;март;апр;май;юни;юли;авг;сеп;окт;ное;дек"),dddd:C("неделя;понеделник;вторник;сряда;четвъртък;петък;събота"),ddd:C("нд;пн;вт;ср;чт;пт;сб"),bool:C("ИСТИНА;ЛОЖЬ")},"bg"),ne({group:".",decimal:",",mmmm:C("de gener;de febrer;de març;d’abril;de maig;de juny;de juliol;d’agost;de setembre;d’octubre;de novembre;de desembre"),mmm:C("de gen.;de febr.;de març;d’abr.;de maig;de juny;de jul.;d’ag.;de set.;d’oct.;de nov.;de des."),dddd:C("diumenge;dilluns;dimarts;dimecres;dijous;divendres;dissabte"),ddd:C("dg.;dl.;dt.;dc.;dj.;dv.;ds."),ampm:C("a. m.;p. m.")},"ca"),ne(ke({group:",",decimal:".",mmmm:C("Enero;Pebrero;Marso;Abril;Mayo;Hunyo;Hulyo;Agosto;Setyembre;Oktubre;Nobyembre;Disyembre"),dddd:C("Linggo;Lunes;Martes;Miyerkules;Huwebes;Biyernes;Sabado")},3,3),"fil"),ne({group:",",decimal:".",mmmm:C("જાન્યુઆરી;ફેબ્રુઆરી;માર્ચ;એપ્રિલ;મે;જૂન;જુલાઈ;ઑગસ્ટ;સપ્ટેમ્બર;ઑક્ટોબર;નવેમ્બર;ડિસેમ્બર"),mmm:C("જાન્યુ;ફેબ્રુ;માર્ચ;એપ્રિલ;મે;જૂન;જુલાઈ;ઑગસ્ટ;સપ્ટે;ઑક્ટો;નવે;ડિસે"),dddd:C("રવિ~;સોમ~;મંગળ~;બુધ~;ગુરુ~;શુક્ર~;શનિ~","વાર"),ddd:C("રવિ;સોમ;મંગળ;બુધ;ગુરુ;શુક્ર;શનિ")},"gu"),ne({group:",",decimal:".",ampm:C("לפנה״צ;אחה״צ"),dddd:C("~ראשון;~שני;~שלישי;~רביעי;~חמישי;~שישי;~שבת","יום "),ddd:C("~א׳;~ב׳;~ג׳;~ד׳;~ה׳;~ו׳;שבת","יום "),mmmm:C("ינואר;פברואר;מרץ;אפריל;מאי;יוני;יולי;אוגוסט;ספטמבר;אוקטובר;נובמבר;דצמבר"),mmm:C("ינו׳;פבר׳;מרץ;אפר׳;מאי;יוני;יולי;אוג׳;ספט׳;אוק׳;נוב׳;דצמ׳"),mmmm6:C("רמדאן;שוואל;ד׳ו אל־קעדה;ד׳ו אל־חיג׳ה;מוחרם;רביע אל־אוול;רביע א־ת׳אני;ג׳ומאדא אל־אולא;ג׳ומאדא א־ת׳אניה;רג׳ב;שעבאן;רמדאן"),mmm6:C("רמדאן;שוואל;ד׳ו אל־קעדה;ד׳ו אל־חיג׳ה;מוחרם;רביע א׳;רביע ב׳;ג׳ומאדא א׳;ג׳ומאדא ב׳;רג׳ב;שעבאן;רמדאן")},"he"),ne(ke({group:".",decimal:",",mmmm:C("siječnja;veljače;ožujka;travnja;svibnja;lipnja;srpnja;kolovoza;rujna;listopada;studenoga;prosinca"),mmm:C("sij;velj;ožu;tra;svi;lip;srp;kol;ruj;lis;stu;pro"),dddd:C("nedjelja;ponedjeljak;utorak;srijeda;četvrtak;petak;subota")},-1,3),"hr"),ne({decimal:",",mmmm:C("հունվարի;փետրվարի;մարտի;ապրիլի;մայիսի;հունիսի;հուլիսի;օգոստոսի;սեպտեմբերի;հոկտեմբերի;նոյեմբերի;դեկտեմբերի"),mmm:C("հնվ;փտվ;մրտ;ապր;մյս;հնս;հլս;օգս;սեպ;հոկ;նոյ;դեկ"),dddd:C("կիրակի;երկուշաբթի;երեքշաբթի;չորեքշաբթի;հինգշաբթի;ուրբաթ;շաբաթ"),ddd:C("կիր;երկ;երք;չրք;հնգ;ուր;շբթ")},"hy"),ne(ke({decimal:",",mmmm:C("იანვარი;თებერვალი;მარტი;აპრილი;მაისი;ივნისი;ივლისი;აგვისტო;სექტემბერი;ოქტომბერი;ნოემბერი;დეკემბერი"),dddd:C("კვირა;ორშაბათი;სამშაბათი;ოთხშაბათი;ხუთშაბათი;პარასკევი;შაბათი")},3,3),"ka"),ne(ke({decimal:",",mmmm:C("қаңтар;ақпан;наурыз;сәуір;мамыр;маусым;шілде;тамыз;қыркүйек;қазан;қараша;желтоқсан"),dddd:C("жексенбі;дүйсенбі;сейсенбі;сәрсенбі;бейсенбі;жұма;сенбі"),ddd:C("жс;дс;сс;ср;бс;жм;сб")},13,-1),"kk"),ne({group:",",mmmm:C("ಜನವರಿ;ಫೆಬ್ರವರಿ;ಮಾರ್ಚ್;ಏಪ್ರಿಲ್;ಮೇ;ಜೂನ್;ಜುಲೈ;ಆಗಸ್ಟ್;ಸೆಪ್ಟೆಂಬರ್;ಅಕ್ಟೋಬರ್;ನವೆಂಬರ್;ಡಿಸೆಂಬರ್"),mmm:C("ಜನವರಿ;ಫೆಬ್ರವರಿ;ಮಾರ್ಚ್;ಏಪ್ರಿ;ಮೇ;ಜೂನ್;ಜುಲೈ;ಆಗಸ್ಟ್;ಸೆಪ್ಟೆಂ;ಅಕ್ಟೋ;ನವೆಂ;ಡಿಸೆಂ"),dddd:C("ಭಾನು~;ಸೋಮ~;ಮಂಗಳ~;ಬುಧ~;ಗುರು~;ಶುಕ್ರ~;ಶನಿ~","ವಾರ"),ddd:C("ಭಾನು;ಸೋಮ;ಮಂಗಳ;ಬುಧ;ಗುರು;ಶುಕ್ರ;ಶನಿ"),ampm:C("ಪೂರ್ವಾಹ್ನ;ಅಪರಾಹ್ನ")},"kn"),ne({decimal:",",mmmm:C("sausio;vasario;kovo;balandžio;gegužės;birželio;liepos;rugpjūčio;rugsėjo;spalio;lapkričio;gruodžio"),mmm:C("saus.;vas.;kov.;bal.;geg.;birž.;liep.;rugp.;rugs.;spal.;lapkr.;gruod."),dddd:C("sekmadienis;pirmadienis;antradienis;trečiadienis;ketvirtadienis;penktadienis;šeštadienis"),ddd:C("sk;pr;an;tr;kt;pn;št"),ampm:C("priešpiet;popiet")},"lt"),ne({decimal:",",mmmm:C("janvāris;februāris;marts;aprīlis;maijs;jūnijs;jūlijs;augusts;septembris;oktobris;novembris;decembris"),mmm:C("janv.;febr.;marts;apr.;maijs;jūn.;jūl.;aug.;sept.;okt.;nov.;dec."),dddd:C("svētdiena;pirmdiena;otrdiena;trešdiena;ceturtdiena;piektdiena;sestdiena"),ddd:C("svētd.;pirmd.;otrd.;trešd.;ceturtd.;piektd.;sestd."),ampm:C("priekšpusdienā;pēcpusdienā")},"lv"),ne({group:",",decimal:".",mmmm:C("ജനുവരി;ഫെബ്രുവരി;മാർച്ച്;ഏപ്രിൽ;മേയ്;ജൂൺ;ജൂലൈ;ഓഗസ്റ്റ്;സെപ്റ്റംബർ;ഒക്‌ടോബർ;നവംബർ;ഡിസംബർ"),mmm:C("ജനു;ഫെബ്രു;മാർ;ഏപ്രി;മേയ്;ജൂൺ;ജൂലൈ;ഓഗ;സെപ്റ്റം;ഒക്ടോ;നവം;ഡിസം"),dddd:C("ഞായറാഴ്‌ച;തിങ്കളാഴ്‌ച;ചൊവ്വാഴ്ച;ബുധനാഴ്‌ച;വ്യാഴാഴ്‌ച;വെള്ളിയാഴ്‌ച;ശനിയാഴ്‌ച"),ddd:C("ഞായർ;തിങ്കൾ;ചൊവ്വ;ബുധൻ;വ്യാഴം;വെള്ളി;ശനി")},"ml"),ne({group:",",decimal:".",mmmm:C("нэгдүгээ~;хоёрдугаа~;гуравдугаа~;дөрөвдүгээ~;тавдугаа~;зургаадугаа~;долоодугаа~;наймдугаа~;есдүгээ~;аравдугаа~;арван нэгдүгээ~;арван хоёрдугаа~","р сар"),mmm:C("1~;2~;3~;4~;5~;6~;7~;8~;9~;10~;11~;12~","-р сар"),dddd:C("ням;даваа;мягмар;лхагва;пүрэв;баасан;бямба"),ddd:C("Ня;Да;Мя;Лх;Пү;Ба;Бя"),ampm:C("ү.ө.;ү.х.")},"mn"),ne({group:",",decimal:".",mmmm:C("जानेवारी;फेब्रुवारी;मार्च;एप्रिल;मे;जून;जुलै;ऑगस्ट;सप्टेंबर;ऑक्टोबर;नोव्हेंबर;डिसेंबर"),mmm:C("जाने;फेब्रु;मार्च;एप्रि;मे;जून;जुलै;ऑग;सप्टें;ऑक्टो;नोव्हें;डिसें"),dddd:C("रविवार;सोमवार;मंगळवार;बुधवार;गुरुवार;शुक्रवार;शनिवार"),ddd:C("रवि;सोम;मंगळ;बुध;गुरु;शुक्र;शनि")},"mr"),ne(ke({group:",",decimal:".",mmmm:C("ဇန်နဝါရီ;ဖေဖော်ဝါရီ;မတ်;ဧပြီ;မေ;ဇွန်;ဇူလိုင်;ဩဂုတ်;စက်တင်ဘာ;အောက်တိုဘာ;နိုဝင်ဘာ;ဒီဇင်ဘာ"),mmm:C("ဇန်;ဖေ;မတ်;ဧ;မေ;ဇွန်;ဇူ;ဩ;စက်;အောက်;နို;ဒီ"),dddd:C("တနင်္ဂနွေ;တနင်္လာ;အင်္ဂါ;ဗုဒ္ဓဟူး;ကြာသပတေး;သောကြာ;စနေ"),ampm:C("နံနက်;ညနေ")},-1,0),"my"),ne({group:",",decimal:".",mmmm:C("ਜਨਵਰੀ;ਫ਼ਰਵਰੀ;ਮਾਰਚ;ਅਪ੍ਰੈਲ;ਮਈ;ਜੂਨ;ਜੁਲਾਈ;ਅਗਸਤ;ਸਤੰਬਰ;ਅਕਤੂਬਰ;ਨਵੰਬਰ;ਦਸੰਬਰ"),mmm:C("ਜਨ;ਫ਼ਰ;ਮਾਰਚ;ਅਪ੍ਰੈ;ਮਈ;ਜੂਨ;ਜੁਲਾ;ਅਗ;ਸਤੰ;ਅਕਤੂ;ਨਵੰ;ਦਸੰ"),dddd:C("ਐਤਵਾਰ;ਸੋਮਵਾਰ;ਮੰਗਲਵਾਰ;ਬੁੱਧਵਾਰ;ਵੀਰਵਾਰ;ਸ਼ੁੱਕਰਵਾਰ;ਸ਼ਨਿੱਚਰਵਾਰ"),ddd:C("ਐਤ;ਸੋਮ;ਮੰਗਲ;ਬੁੱਧ;ਵੀਰ;ਸ਼ੁੱਕਰ;ਸ਼ਨਿੱਚਰ"),ampm:C("ਪੂ.ਦੁ.;ਬਾ.ਦੁ.")},"pa"),ne({group:".",decimal:",",mmmm:C("ianuarie;februarie;martie;aprilie;mai;iunie;iulie;august;septem~;octom~;noiem~;decem~","brie"),mmm:C("ian.;feb.;mar.;apr.;mai;iun.;iul.;aug.;sept.;oct.;nov.;dec."),dddd:C("duminică;luni;marți;miercuri;joi;vineri;sâmbătă"),ddd:C("dum.;lun.;mar.;mie.;joi;vin.;sâm."),ampm:C("a.m.;p.m.")},"ro"),ne(ke({group:".",decimal:",",mmmm:C("januar;februar;marec;april;maj;junij;julij;avgust;september;oktober;november;december"),mmm:C("jan.;feb.;mar.;apr.;maj;jun.;jul.;avg.;sep.;okt.;nov.;dec."),dddd:C("nedelja;ponedeljek;torek;sreda;četrtek;petek;sobota"),ampm:C("dop.;pop.")},-1,13),"sl"),ne(ke({group:".",decimal:",",mmmm:C("јануар;фебруар;март;април;мај;јун;јул;август;септембар;октобар;новембар;децембар"),dddd:C("недеља;понедељак;уторак;среда;четвртак;петак;субота")},3,3),"sr"),ne({group:",",decimal:".",mmmm:C("ஜனவரி;பிப்ரவரி;மார்ச்;ஏப்ரல்;மே;ஜூன்;ஜூலை;ஆகஸ்ட்;செப்டம்பர்;அக்டோபர்;நவம்பர்;டிசம்பர்"),mmm:C("ஜன.;பிப்.;மார்.;ஏப்.;மே;ஜூன்;ஜூலை;ஆக.;செப்.;அக்.;நவ.;டிச."),dddd:C("ஞாயிறு;திங்கள்;செவ்வாய்;புதன்;வியாழன்;வெள்ளி;சனி"),ddd:C("ஞாயி.;திங்.;செவ்.;புத.;வியா.;வெள்.;சனி")},"ta"),ne({group:",",decimal:".",mmmm:C("జనవరి;ఫిబ్రవరి;మార్చి;ఏప్రిల్;మే;జూన్;జులై;ఆగస్టు;సెప్టెంబర్;అక్టోబర్;నవంబర్;డిసెంబర్"),mmm:C("జన;ఫిబ్ర;మార్చి;ఏప్రి;మే;జూన్;జులై;ఆగ;సెప్టెం;అక్టో;నవం;డిసెం"),dddd:C("ఆదివారం;సోమవారం;మంగళవారం;బుధవారం;గురువారం;శుక్రవారం;శనివారం"),ddd:C("ఆది;సోమ;మంగళ;బుధ;గురు;శుక్ర;శని")},"te"),ne({decimal:",",mmmm:C("січня;лютого;березня;квітня;травня;червня;липня;серпня;вересня;жовтня;листопада;грудня"),mmm:C("січ.;лют.;бер.;квіт.;трав.;черв.;лип.;серп.;вер.;жовт.;лист.;груд."),dddd:C("неділю;понеділок;вівторок;середу;четвер;пʼятницю;суботу"),ddd:C("нд;пн;вт;ср;чт;пт;сб"),ampm:C("дп;пп")},"uk"),ne({group:".",decimal:",",mmmm:C("~1;~2;~3;~4;~5;~6;~7;~8;~9;~10;~11;~12","tháng "),mmm:C("~1;~2;~3;~4;~5;~6;~7;~8;~9;~10;~11;~12","thg "),dddd:C("Chủ Nhật;Thứ Hai;Thứ Ba;Thứ Tư;Thứ Năm;Thứ Sáu;Thứ Bảy"),ddd:C("CN;Th 2;Th 3;Th 4;Th 5;Th 6;Th 7"),ampm:C("SA;CH")},"vi"),ne(ke({group:"٬",decimal:"٫",ampm:C("ص;م"),mmmm:C("يناير;فبراير;مارس;أبريل;مايو;يونيو;يوليو;أغسطس;سبتمبر;أكتوبر;نوفمبر;ديسمبر"),dddd:C("الأحد;الاثنين;الثلاثاء;الأربعاء;الخميس;الجمعة;السبت"),mmmm6:C("رمضان;شوال;ذو القعدة;ذو الحجة;محرم;ربيع الأول;ربيع الآخرة;جمادى الأولى;جمادى الآخرة;رجب;شعبان;رمضان")},0,0),"ar"),ne({group:",",decimal:".",mmmm:C("জানুয়ারী;ফেব্রুয়ারী;মার্চ;এপ্রিল;মে;জুন;জুলাই;আগস্ট;সেপ্টেম্বর;অক্টোবর;নভেম্বর;ডিসেম্বর"),mmm:C("জানু;ফেব;মার্চ;এপ্রি;মে;জুন;জুল;আগ;সেপ্টেঃ;অক্টোঃ;নভেঃ;ডিসেঃ"),dddd:C("রবিবার;সোমবার;মঙ্গলবার;বুধবার;বৃহস্পতিবার;শুক্রবার;শনিবার"),ddd:C("রবি;সোম;মঙ্গল;বুধ;বৃহস্পতি;শুক্র;শনি")},"bn"),ne({group:",",decimal:".",mmmm:C("जनवरी;फ़रवरी;मार्च;अप्रैल;मई;जून;जुलाई;अगस्त;सितंबर;अक्तूबर;नवंबर;दिसंबर"),mmm:C("जन॰;फ़र॰;मार्च;अप्रैल;मई;जून;जुल॰;अग॰;सित॰;अक्तू॰;नव॰;दिस॰"),dddd:C("रविवार;सोमवार;मंगलवार;बुधवार;गुरुवार;शुक्रवार;शनिवार"),ddd:C("रवि;सोम;मंगल;बुध;गुरु;शुक्र;शनि"),ampm:C("am;pm")},"hi");const Jc={overflow:"######",dateErrorThrows:!1,dateErrorNumber:!0,bigintErrorNumber:!1,dateSpanLarge:!0,leap1900:!0,nbsp:!1,throws:!0,invalid:"######",locale:"",ignoreTimezone:!1,grouping:[3,3],indexColors:!0,skipChar:"",repeatChar:""};function St(e,t=0){if(typeof e!="number")return e;if(e<0)return-St(-e,t);if(t){const n=10**t||1;return St(e*n,0)/n}return Math.round(e)}const Tp=1e-13;function Zc(e,t=2,n=2){const r=e<0?-1:1,s=10**(t||2),i=10**(n||2);let o=Math.abs(e),a=0,l=0,c=0,u=1,h,d;if(e=o,e%1===0)d=[e*r,1];else if(e<1e-19)d=[r,1e19];else if(e>1e19)d=[1e19*r,1];else{do if(o=1/(o-Math.floor(o)),h=u,u=u*Math.floor(o)+a,a=h,l=c,c=Math.floor(e*u+.5),c>=s||u>=i)return[r*l,a];while(Math.abs(e-c/u)>=Tp&&o!==Math.floor(o));d=[r*c,u]}return d}const ft=Math.floor;function Qc(e,t=!0){if(t&&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 n=e+68569+2415019;const r=ft(4*n/146097);n=n-ft((146097*r+3)/4);const s=ft(4e3*(n+1)/1461001);n=n-ft(1461*s/4)+31;const i=ft(80*n/2447),o=n-ft(2447*i/80);n=ft(i/11);const a=i+2-12*n;return[100*(r-49)+s+n|0,a|0,o|0]}function Np(e){return Qc(e+1462)}function Mp(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 t=10631/30,n=8.01/60;let r=e+466935;const s=ft(r/10631);r=r-10631*s;const i=ft((r-n)/t);r=r-ft(i*t+n);const o=ft((r+28.5001)/29.5);return o===13?[30*s+i,12,30]:[30*s+i,o,r-ft(29.5001*o-29)]}function eu(e,t=0,n=!0){const r=ft(e);return t===kn?Mp(r):t===vp?Np(r):Qc(r,n)}const As=Math.floor,bo=86400;function yo(e,t){let n=null;if(Array.isArray(e)){const[r,s,i,o,a,l]=e;n=Date.UTC(r,s==null?0:s-1,i!=null?i:1,o||0,a||0,l||0)}else if(e instanceof Date&&(n=e*1,!t||!t.ignoreTimezone)){const r=new Date;r.setUTCFullYear(e.getFullYear(),e.getMonth(),e.getDate()),r.setUTCHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n=r*1}if(n!=null&&isFinite(n)){const r=n/864e5;return r-(r<=-25509?-25568:-25569)}return null}function Dp(e,t){let n=e|0;const r=bo*(e-n);let s=As(r);r-s>.9999&&(s+=1,s===bo&&(s=0,n+=1));const i=s<0?bo+s:s,[o,a,l]=eu(e,0,t&&t.leap1900),c=As(i/60/60)%60,u=As(i/60)%60,h=As(i)%60;return[o,a,l,c,u,h]}const Lp=["!d-m-y","!d-m-Y","!j-m-y","!j-m-Y","!d-n-y","!d-n-Y","!j-n-y","!j-n-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","d-M-y","d-M-Y","j-M-y","j-M-Y","M-d-y","M-d-Y","M-j-y","M-j-Y","d-F-y","d-F-Y","F-d-y","F-d-Y","F-j-y","F-j-Y","j-F-y","j-F-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"],Up={j:"d",d:"d",D:"ddd",l:"dddd",n:"m",m:"m",M:"mmm",F:"mmmm",y:"yy",Y:"yyyy"},Pp={j:"dd",d:"dd",D:"ddd",l:"dddd",n:"mm",m:"mm",M:"mmm",F:"mmmm",y:"yy",Y:"yyyy"},tu={},nu={};function mt(e,t,n=1){if(e){const r=e[0],s=e.slice(1);r==="!"?mt(s,t,4):r==="?"?mt(s,t,2):(t[r]=t[r]||{},mt(s,t[r],n))}else t.$=n}function ru(e,t){mt(e,t),mt(e+" x",t),mt(e+" l",t),mt(e+" l x",t),mt("l "+e,t),mt("l "+e+" x",t),mt(e+" D",t),mt(e+" D x",t),mt("D "+e,t),mt("D "+e+" x",t)}Lp.forEach(e=>{e[0]!=="?"&&ru(e,tu),e[0]!=="!"&&ru(e,nu)});const kp=new Date().getUTCFullYear(),su=".",Fp=",",Ao=" ",vr=" ",br=" ",Ts="'",Ns="٬",xp={".":[Fp,vr,br,Ts,Ns],",":[su,vr,br,Ts,Ns],"٫":[su,vr,br,Ts,Ns]},To=e=>e&&e.length===1&&e>="0"&&e<="9";function No(e,t={}){const n=Hn(t.locale||"")||tn,r=n.decimal,s=[...xp[r]||[Ts,Ns]];!s.includes(n.group)&&n.group!==Ao&&n.group!==r&&s.push(n.group);let i="",o="",a=1,l="",c=!1,u=!1,h=!1,d=!1,m=!1,_=null,p=!1,I=0;const y=[Ao,vr,br,"+","%","(","-"].concat(po);for(;y.includes(e[I]);){const b=e[I];if(b==="-"){if(c||u)return null;c=!0,a=-1}else if(Eo.test(b)){if(m)return null;m=!0,_=b}else if(b==="("){if(u||c)return null;u=!0,a=-1}else if(b==="%"){if(d)return null;d=!0}I++}let H=!1,x;if(e[I]===r||To(e[I]))for(;I<e.length;){const b=e[I];if(!x&&s.includes(b))x=b;else if(!(x&&x===b))if(b===r){if(H)break;i+=".",H=!0}else if(To(b))i+=b;else break;I++}if(e[I]==="e"||e[I]==="E"){o+=e[I],I++,(e[I]==="+"||e[I]==="-")&&(o+=e[I],I++);const b=I;for(;To(e[I]);)o+=e[I],I++;if(b===I)return null}const Y=[Ao,vr,br,"%","$",")"].concat(po);for(;Y.includes(e[I]);){const b=e[I];if(Eo.test(b)){if(m)return null;m=!0,_=b,p=!0}else if(b===")"){if(h||!u)return null;h=!0}else if(b==="%"){if(d)return null;d=!0}I++}if(I!==e.length)return null;let O=parseFloat(i+o);if(!isFinite(O))return null;if(o){if(d||m)return null;l="0.00E+00"}else if(d){if(m)return null;l=i.includes(".")?"0.00%":"0%",O*=.01}else if(m){const b=i.includes(".")?"#,##0.00":"#,##0";p?l=b+_:l=_+b}else x&&(l=i.includes(".")?"#,##0.00":"#,##0");const R={v:O*a};return l&&(R.z=l),R}function Hp(e,t,n){if(n<1||t<1||t>12)return!1;if(t===2){const s=e%4===0&&e%100!==0||e%400===0||e===1900?29:28;if(n>s)return!1}else if((t===4||t===6||t===9||t===11)&&n>30||(t===1||t===3||t===5||t===7||t===8||t===10||t===12)&&n>31)return!1;return!0}const iu=(e,t,n=!1)=>{for(const r of t)if(e.startsWith(r[0])){let s=r[0].length;return n&&(r[2]==="D"||r[2]==="M")&&e[s]==="."&&s++,[e.slice(0,s),r]}return["",null]},kt=(e,t,n,r)=>{const s=n.path||"",i=Object.keys(t);for(let o=0;o<i.length;o++){let a;const l=i[o];if(t[l]){if(l==="$"||l==="€")e||(a=n);else if(l==="-"){const c=/^(\s*([./-]|,\s)\s*|\s+)/.exec(e);if(c){const u=c[1]==="-"||c[1]==="/"||c[1]==="."?c[1]:" ";if(!n.sep||n.sep===u){const h=c[0].replace(/\s+/g," ");a=kt(e.slice(c[0].length),t[l],{...n,sep:u,path:s+h},r)}}}else if(l===" "){const c=/^[,.]?\s+/.exec(e);if(c){const u=c[0].replace(/\s+/g," ");a=kt(e.slice(c[0].length),t[l],{...n,path:s+u},r)}}else if(l==="j"||l==="d"){const c=/^(0?[1-9]|1\d|2\d|3[01])\b/.exec(e);c&&(a=kt(e.slice(c[0].length),t[l],{...n,day:c[0],path:s+l},r))}else if(l==="n"||l==="m"){const c=/^(0?[1-9]|1[012])\b/.exec(e);c&&(a=kt(e.slice(c[0].length),t[l],{...n,month:+c[0],_mon:c[0],path:s+l},r))}else if(l==="F"||l==="M"){const[c,u]=iu(e,r.mon,r.mp);u&&u[2]===l&&(a=kt(e.slice(c.length),t[l],{...n,month:u[1],_mon:c,path:s+l},r))}else if(l==="l"||l==="D"){const[c,u]=iu(e,r.day,r.dp);u&&u[2]===l&&(a=kt(e.slice(c.length),t[l],{...n,path:s+l},r))}else if(l==="y"){const c=/^\d\d\b/.exec(e);if(c){const u=+c[0]>=30?+c[0]+1900:+c[0]+2e3;a=kt(e.slice(c[0].length),t[l],{...n,year:u,path:s+l},r)}}else if(l==="Y"){const c=/^\d\d\d\d\b/.exec(e);c&&(a=kt(e.slice(c[0].length),t[l],{...n,year:+c[0],path:s+l},r))}else if(l==="x"){const c=Ds(e,{locale:r.locale});c&&(a=kt("",t[l],{...n,time:c.v,tf:c.z,path:s+l},r))}else throw new Error(`Unknown date token "${l}"`);if(a&&Hp(n.year||1916,n.month||1,n.day?+n.day:1))return a}}},ou=e=>e.replace(/\s+/g," ").trim().replace(/’/,"'").replace(/\.$/,"").toLowerCase(),Ms=(e,t)=>{const n=e.map((r,s)=>[ou(r),s+1,t]);return n.sort((r,s)=>s[0].length-r[0].length),n};function Mo(e,t={}){var i;const n=Hn(t.locale||"")||tn,r={mon:Ms(n.mmmm,"F").concat(Ms(n.mmm,"M")),mp:n.mmm[0].at(-1)===".",day:Ms(n.dddd,"l").concat(Ms(n.ddd,"D")),dp:n.ddd[0].at(-1)===".",locale:t.locale},s=kt(ou(e),n.preferMDY?nu:tu,{path:""},r);if(s){if(s.sep==="."&&s.path.length===3)return null;const o=+((i=s.year)!=null?i:kp);s.day||(s.day=1);let a=-1/0;if(o<1900)return null;o<=1900&&s.month<=2?a=25568:o<1e4&&(a=25569);const l=Date.UTC(o,s.month-1,s.day)/864e5+a+(s.time||0);if(l>=0&&l<=2958465){const c=s._mon[0]==="0"||s.day[0]==="0"||s._mon.length===2&&s.day.length===2,u=s.path.replace(/[jdlDnmMFyYx]/g,h=>h==="x"?s.tf||"":(c?Pp[h]:Up[h])||h);return{v:l,z:u}}}return null}const Do=e=>e.replace(/\s+/g,"").trim().replace(/\./g,"").toLowerCase();function Ds(e,t={}){const n=Hn(t.locale||"")||tn,r=/^\s*([10]?\d|2[0-4])(?::([0-5]\d|\d))?(?::([0-5]\d|\d))?(\.\d{1,10})?(?=\s*[^\s\d]|$)/.exec(e);let s="";if(r){const i=Do(e.slice(r[0].length));if(i===Do(n.ampm[0])||i==="a"||i==="am")s="a";else if(i===Do(n.ampm[1])||i==="p"||i==="pm")s="p";else if(i)return null}if(r){const[,i,o,a,l]=r;if(l&&!a||!s&&!o&&!a)return null;let c=+(i||0)*1;if(s){if(c>=13)return null;s==="p"&&(c+=12)}const u=+(o||0)*1,h=+(a||0)*1,d=+(l||0)*1;return{v:(c*60*60+u*60+h+d)/(3600*24),z:(i.length===2?"hh":"h")+":mm"+(a?":ss":"")+(s?" AM/PM":"")}}return null}function au(e,t={}){const n=Hn(t.locale||"")||tn,r=e.trim().toLowerCase(),s=n.bool[0].toLowerCase();if(r==="true"||r===s)return{v:!0};const i=n.bool[1].toLowerCase();return r==="false"||r===i?{v:!1}:null}function Bp(e,t){var n,r,s;return(s=(r=(n=No(e,t))!=null?n:Mo(e,t))!=null?r:Ds(e,t))!=null?s:au(e,t)}function Rn(e,t,n){return t[n+"_max"]=e.length,t[n+"_min"]=e.replace(/#/g,"").length,t}function ze(e,t){typeof e=="string"?t.push({type:"string",value:e}):t.push(e)}function lu(e,t){const n=e&&e.type;return n===zi||n===Fn||n===Gi||n===bs&&t==="den"}function yr(e){var x,Y,O;const t=[],n={scale:1,percent:!1,text:!1,date:0,date_eval:!1,date_system:Yc,sec_decimals:0,general:!1,clock:24,int_pattern:[],frac_pattern:[],man_pattern:[],den_pattern:[],num_pattern:[],tokens:t};let r="int",s=null;const i=[];let o,a=!1,l=-1,c=!1,u="",h=!1;for(;++l<e.length&&!c;){const R=e[l],b=R.type||wr;if(u+=R.raw,b===Vi)n.general=!0,ze(R,t);else if(lu(R,r)){const T=n[r+"_pattern"];lu(o,r)||(o==null?void 0:o.type)===Or?(T.push((T.pop()||"")+R.value),s.num+=R.value):(T.push(R.value),s={type:r,num:R.value},ze(s,t))}else if(b===_o)R.value==="("&&(n.parens=!0),ze(R.value,t);else if(b===bs)ze(R.value,t);else if(b===Ki)if(h=!0,n[r+"_pattern"].length){if(!s)throw new SyntaxError("Format pattern is missing a numerator");n.fractions=!0,n.num_pattern.push(n[r+"_pattern"].pop()),s.type="num",r="den",ze({type:"div"},t)}else ze(R.value,t);else if(b===Xi)ze(",",t);else if(b===Os)n.scale=.001**R.raw.length;else if(b===Or){if(r==="int"&&(n.grouping=!0),r==="den")throw new SyntaxError("Cannot group denominator digits")}else if(b===Qi)ze(R,t);else if(b===qi){c=!0;break}else if(b===ws)n.text=!0,ze(R,t);else if(b===Ji||b===Zi)ze(R,t);else if(b===ro){const T=R.value.toLowerCase(),B=T[0],$={type:"",size:0,date:1,pad:T.length};B==="h"?($.size=Rr,$.type="hour-elap"):B==="m"?($.size=Ir,$.type="min-elap"):($.size=Sr,$.type="sec-elap"),n.date=n.date|$.size,i.push($),ze($,t)}else if(n.date&&b===vs&&((x=e[l+1])==null?void 0:x.type)===Fn){let T=1;l++;let B="0";((Y=e[l+1])==null?void 0:Y.type)===Fn&&(B+="0",T=2,l++),((O=e[l+1])==null?void 0:O.type)===Fn&&(B+="0",T=3,l++),u+=B;const $=[Sr,ji,Wi,Yi][T];n.date=n.date|$,n.date_eval=!0,n.sec_decimals=Math.max(n.sec_decimals,T),ze({type:"subsec",size:$,decimals:T,date:1},t)}else if(b===to)a||(R.value==="B2"||R.value==="b2"?n.date_system=kn:n.date_system=Yc);else if(b===no){const T={type:"",size:0,date:1},B=R.value.toLowerCase(),$=B[0];if(B==="y"||B==="yy")T.size=Er,T.type="year-short";else if($==="y"||$==="e")T.size=Er,T.type="year";else if(B==="b"||B==="bb")T.size=Er,T.type="b-year-short";else if($==="b")T.size=Er,T.type="b-year";else if(B==="d"||B==="dd")T.size=Ss,T.type="day",T.pad=/dd/.test(B);else if(B==="ddd"||B==="aaa")T.size=Ss,T.type="weekday-short";else if($==="d"||$==="a")T.size=Ss,T.type="weekday";else if($==="h")T.size=Rr,T.type="hour",T.pad=/hh/i.test(B);else if($==="m"){B.length===3?(T.size=Cr,T.type="monthname-short"):B.length===5?(T.size=Cr,T.type="monthname-single"):B.length>=4&&(T.size=Cr,T.type="monthname");const g=i[i.length-1];!T.type&&g&&!g.used&&g.size&(Rr|Sr)&&(g.used=!0,T.size=Ir,T.type="min",T.pad=/mm/.test(B)),T.type||(T.size=Cr,T.type="month",T.pad=/mm/.test(B),T.indeterminate=!0)}else if($==="s"){T.size=Sr,T.type="sec",T.pad=/ss/.test(B);const g=i[i.length-1];g&&g.size&Ir?T.used=!0:g&&g.indeterminate&&(delete g.indeterminate,g.size=Ir,g.type="min",T.used=!0)}n.date=n.date|T.size,n.date_eval=!0,i.push(T),ze(T,t)}else if(b===co)n.clock=12,n.date=n.date|Rr,n.date_eval=!0,R.short=R.value==="A/P",ze(R,t);else if(b===ho||b===uo||b===ys)ze(R.value,t);else if(b===so)n.condition=[R.value[0],parseFloat(R.value[1])];else if(b===ao){const T=R.value.split("-"),B=T.length<2?"":T.slice(1).join("-"),$=T[0];$&&ze($,t);const g=Io(B);g&&(n.locale=g);const P=parseInt(B,16);isFinite(P)&&P&16711680&&(P>>16&255)===6&&(n.date_system=kn),a=!0}else if(b===lo){let T,B=R.value.toLowerCase();(T=/^color\s*(\d+)$/i.exec(B))&&(B=parseInt(T[1],10)),n.color=B}else if(b===eo)n.scale=100,n.percent=!0,ze("%",t);else if(b===vs)ze(R,t),n.date||(n.dec_fractions=!0,r="frac");else if(b===mo)n.exponential=!0,n.exp_plus=R.value.includes("+"),r="man",ze({type:"exp",plus:n.exp_plus},t);else if(b===fo)ze(R,t);else if(b===go)ze(R,t);else if(!(b===io||b===oo))throw b===wr?new SyntaxError(`Illegal character: ${u}`):new SyntaxError(`Unknown token ${b} in ${u}`);o=R}if(n.tokensUsed=l,n.pattern=u,/^((?:\[[^\]]+\])+)(;|$)/.test(n.pattern)&&!/^\[(?:h+|m+|s+)\]/.test(n.pattern)&&ze({type:"text"},t),n.fractions&&n.dec_fractions||n.grouping&&!n.int_pattern.length||n.fractions&&n.exponential||n.fractions&&n.den_pattern.length*n.num_pattern.length===0||h&&!n.fractions&&!n.date||n.exponential&&(n.int_pattern.length||n.frac_pattern.length)*n.man_pattern.length===0)throw new SyntaxError(`Invalid pattern: ${u}`);const d=n.int_pattern.join(""),m=n.man_pattern.join(""),_=n.frac_pattern.join("");Rn(d,n,"int");let p=0;for(let R=0;R<d.length;R++){const b=d[d.length-1-R];/^[0-9?]/.test(b)&&(p=R+1)}n.int_min=p,Rn(_,n,"frac"),Rn(m,n,"man");let I=n.num_pattern.join(""),y=n.den_pattern[0]||"";if(y.includes("?")||I.includes("?")?(y=y.replace(/\d/g,"?"),y=y.replace(/#$/g,"?"),Rn(I,n,"num"),Rn(y,n,"den"),I=I.replace(/#$/g,"?")):(Rn(I,n,"num"),Rn(y,n,"den")),n.int_p=d,n.man_p=m,n.num_p=I,n.den_p=y,n.den_pattern.length&&(n.denominator=parseInt(n.den_pattern.join("").replace(/\D/g,""),10)),n.integer=!!d.length,!n.integer&&!n.exponential&&_.length){const R=n.tokens.findIndex(b=>b.type==="point");n.tokens.splice(R,0,{type:"int",value:"#"}),n.integer=!0,n.int_pattern=["#"],n.int_p="#"}if(n.fractions)for(let R=0;R<t.length-1;R++){const b=t[R];if(b.type!=="string"&&b.type!=="space")continue;const T=t[R+1].type;T==="num"?b.rule="num+int":T==="div"?b.rule="num":T==="den"&&(b.rule="den")}return n.grouping&&n.int_pattern.length>1&&(n.grouping=!1),n}function $p(e){if(e===0)return e;const t=Math.ceil(Math.log10(e<0?-e:e)),n=10**(16-Math.floor(t));return isFinite(n)?Math.round(e*n)/n:0}function cu(e,t=0){const n=Math.floor(Math.log10(e));return t>1?Math.floor(n/t)*t:n}function uu(e,t=1){return t<-300?parseFloat(e.toExponential().split("e")[0]):e*10**-t}const jp={total:1,sign:0,period:0,int:1,frac:0};function Wp(e,t=!0){const n=Math.abs(e);if(!n)return jp;const r=t&&e<0?1:0,s=Math.floor(n),i=Math.floor(Math.log10(n)+1);let o=0,a=0;if(s!==n){o=1;const l=String(St(n*10**-i,15));let c=l.length,u=!0,h=0;for(;h<=l.length;){if(l[h]==="."){c--;break}else l[h]==="0"&&u?c--:u=!1;h++}a=c-i,a<0&&(a=0,o=0)}return{total:r+Math.max(i,1)+o+a,digits:Math.max(i,0)+a,sign:r,period:o,int:Math.max(i,1),frac:a}}const Bn=(e,t)=>e.replace(/\./,t.decimal),hu=(e,t,n)=>{const r=Math.abs(t);let s;return e===1?s=e:s=St(e,5),[Bn(s+"",n),n.exponent,t<0?n.negative:n.positive,r<10?"0":"",r]};function du(e,t,n,r){const s=n|0;if(typeof n=="string")e.push(n);else if(n===s)e.push(Math.abs(s));else{const i=Math.abs(n);let o=cu(i),a=uu(i,o);a===10&&(a=1,o++);const l=Wp(i);if(o>=-4&&o<=-1){const c=i.toPrecision(10+o).replace(/\.?0+$/,"");e.push(Bn(c,r))}else if(o===10){const c=i.toFixed(10).slice(0,12).replace(/\.$/,"");e.push(Bn(c,r))}else if(Math.abs(o)<=9)if(l.total<=11){const c=St(i,9).toFixed(l.frac);e.push(Bn(c,r))}else o===9?e.push(Math.floor(i)):o>=0&&o<9?e.push(Bn(String(St(i,9-o)),r)):e.push(...hu(a,o,r));else l.total>=12?e.push(...hu(a,o,r)):e.push(Bn(St(i,9).toFixed(l.frac),r))}return e}function In(e,t=!1){return e==="0"?"0":e==="?"?t?" ":" ":""}const Ar=86400,Yp=(e,t,n)=>n?e<Op||t>=wp:e<Ip||t>=Sp;function fu(e,t,n,r){var A,v;let s="",i="",o="",a="",l="",c="",u=0,h=0;if(typeof e=="bigint"){if(e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER)e=Number(e);else return n.bigintErrorNumber?String(e):n.overflow;h=e}else h=Math.trunc(e);let d=0,m=0,_=1,p=0,I=0,y=0,H=0,x=0,Y=0;const O=r||tn;if(!t.text&&isFinite(t.scale)&&t.scale!==1&&(e=$p(e*t.scale)),t.exponential){let N=Math.abs(e);N&&(u=cu(N,t.int_max)),e&&!t.integer&&u++,N=uu(N,u),t.int_max===1&&St(N,t.frac_max)===10&&(N=1,u++),e=e<0?-N:N,s+=Math.abs(u)}if(t.integer){const N=Math.abs(St(e,t.fractions?1:t.frac_max));c+=N<1?"":Math.floor(N)}const R=(A=n.grouping[0])!=null?A:3,b=(v=n.grouping[1])!=null?v:R;t.dec_fractions&&(l=String(St(e,t.frac_max)).split(".")[1]||"");const T=!t.error&&(t.num_p.includes("0")||t.den_p.includes("0"));let B=T;if(t.fractions){B=T||!!(e%1);const N=Math.abs(t.integer?e%1:e);if(N)if(B=!0,t.denominator&&isFinite(t.denominator))a+=t.denominator,o+=St(N*t.denominator),o==="0"&&(o="",a="",B=T);else{const D=Zc(N,1/0,t.den_max);o+=D[0],a+=D[1],t.integer&&o==="0"&&(o="",a="",B=T)}else!e&&!t.integer&&(B=!0,o="0",a="1");t.integer&&!B&&!Math.trunc(e)&&(c="0")}if(t.date){h=Math.trunc(e);const N=Ar*(e-h);if(d=Math.floor(N),Y=N-d,Math.abs(Y)<1e-6?Y=0:Y>.9999&&(Y=0,d+=1,d===Ar&&(d=0,h+=1)),Y){const D=t.date&Yi||t.date&Wi||t.date&ji;(D===Yi&&Y>.9995||D===Wi&&Y>.995||D===ji&&Y>.95||!D&&Y>=.5)&&(d++,Y=0)}if(h||t.date_system){const D=eu(e,t.date_system,n.leap1900);m=D[0],_=D[1],p=D[2]}if(d){const D=d<0?Ar+d:d;x=Math.floor(D)%60,H=Math.floor(D/60)%60,y=Math.floor(D/60/60)%60}if(I=(6+h)%7,t.date_eval&&Yp(e,h+d/Ar,n.dateSpanLarge)){if(n.dateErrorThrows)throw new Error("Date out of bounds");if(n.dateErrorNumber){const D=e<0?[O.negative]:[];return du(D,{},e,O).join("")}return n.overflow}}const $=In("?",n.nbsp);u<0?i="-":t.exp_plus&&(i="+");const g=[],P=(N,D,L,F)=>{const Q=!F&&N.length>D.length?L.length+N.length-D.length:L.length;N.length<D.length&&(F+=N.length-D.length);for(let G=0;G<Q;G++)g.push(N[G+F]||In(L[G],n.nbsp));return Q};let w=!1;const M={int:0,frac:0,man:0,num:0,den:0};for(let N=0,D=t.tokens.length;N<D;N++){const L=t.tokens[N],F=L.type,Q=L.num?L.num.length:0;if(F==="string")L.rule?L.rule==="num"?B?g.push(L.value.replace(/ /g,$)):(t.num_min>0||t.den_min>0)&&g.push(L.value.replace(/./g,$)):L.rule==="num+int"?B&&c?g.push(L.value.replace(/ /g,$)):t.den_min>0&&(c||t.num_min)&&g.push(L.value.replace(/./g,$)):L.rule==="den"&&(B?g.push(L.value.replace(/ /g,$)):(t.den_min>0||t.den_min>0)&&g.push(L.value.replace(/./g,$))):g.push(L.value.replace(/ /g,$));else if(F==="space")L.rule==="num+int"?(B||t.num_min||t.den_min)&&(c||t.num_min)&&g.push($):g.push($);else if(F==="error")g.push(n.invalid);else if(F==="point")g.push(t.date?L.value:O.decimal);else if(F==="general")du(g,t,e,O);else if(F==="exp")g.push(O.exponent);else if(F==="minus")L.volatile&&t.date||L.volatile&&(e>=0||typeof e!="number")||(L.volatile&&!t.fractions&&(t.integer||t.dec_fractions)?(e<0&&c&&c!=="0"||l)&&g.push(O.negative):g.push(O.negative));else if(F==="plus")g.push(O.positive);else if(F==="text")g.push(e);else if(F==="fill")n.fillChar&&g.push(n.fillChar,L.value);else if(F==="skip")n.skipChar?g.push(n.skipChar,L.value):g.push(n.nbsp?" ":" ");else if(F==="div")B?g.push("/"):t.num_min>0||t.den_min>0?g.push($):g.push(In("#",n.nbsp));else if(F==="int")if(t.int_pattern.length===1){const G=t.int_p,le=Math.max(t.int_min,c.length);let ue="";for(let S=le;S>0;S--){const U=c.charAt(c.length-S),V=U?"":G.charAt(G.length-S)||G[0];let z="";if(t.grouping){const j=S-1-R;j>=0&&!(j%b)&&(z=U||V==="0"?O.group:In("?",n.nbsp))}ue+=(U||In(V,n.nbsp))+z}g.push(ue)}else M.int+=P(c,t.int_p,L.num,M.int);else if(F==="frac"){const G=M.frac;for(let le=0;le<Q;le++)g.push(l[le+G]||In(L.num[le],n.nbsp));M.frac+=Q}else if(F==="man")!M[F]&&!M.man&&g.push(i),M.man+=P(s,t.man_p,L.num,M.man);else if(F==="num")M.num+=P(o,t.num_p,L.num,M.num);else if(F==="den"){const G=M.den;for(let le=0;le<Q;le++){let ue=a[le+G];if(!ue){const S=L.num[le];"123456789".includes(S)||w&&S==="0"?(w=!0,ue=n.nbsp?" ":" "):!w&&le===Q-1&&S==="0"&&!a?ue="1":ue=In(S,n.nbsp)}g.push(ue)}M.den+=Q}else if(F==="year")m<0&&g.push(O.negative),g.push(String(Math.abs(m)).padStart(4,"0"));else if(F==="year-short"){const G=m%100;g.push(G<10?"0":"",G)}else if(F==="month")g.push(L.pad&&_<10?"0":"",_);else if(F==="monthname-single")t.date_system===kn?g.push(O.mmmm6[_-1].charAt(0)):g.push(O.mmmm[_-1].charAt(0));else if(F==="monthname-short")t.date_system===kn?g.push(O.mmm6[_-1]):g.push(O.mmm[_-1]);else if(F==="monthname")t.date_system===kn?g.push(O.mmmm6[_-1]):g.push(O.mmmm[_-1]);else if(L.type==="weekday-short")g.push(O.ddd[I]);else if(F==="weekday")g.push(O.dddd[I]);else if(F==="day")g.push(L.pad&&p<10?"0":"",p);else if(F==="hour"){const G=y%t.clock||(t.clock<24?t.clock:0);g.push(L.pad&&G<10?"0":"",G)}else if(F==="min")g.push(L.pad&&H<10?"0":"",H);else if(F==="sec")g.push(L.pad&&x<10?"0":"",x);else if(F==="subsec"){g.push(O.decimal);const G=Y.toFixed(t.sec_decimals);g.push(G.slice(2,2+L.decimals))}else if(F==="ampm"){const G=y<12?0:1;L.short&&!r?g.push("AP"[G]):g.push(O.ampm[G])}else if(F==="hour-elap"){e<0&&g.push(O.negative);const G=h*24+Math.floor(Math.abs(d)/3600);g.push(String(Math.abs(G)).padStart(L.pad,"0"))}else if(F==="min-elap"){e<0&&g.push(O.negative);const G=h*1440+Math.floor(Math.abs(d)/60);g.push(String(Math.abs(G)).padStart(L.pad,"0"))}else if(F==="sec-elap"){e<0&&g.push(O.negative);const G=h*Ar+Math.abs(d);g.push(String(Math.abs(G)).padStart(L.pad,"0"))}else if(F==="b-year")g.push(m+543);else if(F==="b-year-short"){const G=(m+543)%100;g.push(G<10?"0":"",G)}}return g.join("")}const Vp=yr([{type:ws,value:"@",raw:"@"}]);function mu(e,t){for(let n=0;n<3;n++){const r=t[n];if(r){let s;if(r.condition){const i=r.condition[0],o=r.condition[1];i==="="?s=e===o:i===">"?s=e>o:i==="<"?s=e<o:i===">="?s=e>=o:i==="<="?s=e<=o:i==="<>"&&(s=e!==o)}else s=!0;if(s)return r}}}function zp(e,t,n){const r=t.partitions;let s=r[3],i=null;return(typeof e=="number"||typeof e=="bigint")&&isFinite(e)&&(s=mu(e,r)),s&&s.color&&(i=s.color),i&&typeof i=="number"&&n.indexColors&&(i=bp[i-1]||"#000"),i}function Gp(e,t,n){const r=t.partitions,s=Hn(t.locale||n.locale),i=r[3]?r[3]:Vp;if(typeof e=="boolean"&&(e=(s||tn).bool[e?0:1]),e==null)return"";const o=typeof e=="bigint";if(typeof e!="number"&&!o)return fu(e,i,n,s);if(!o&&!isFinite(e)){const l=s||tn;return isNaN(e)?l.nan:(e<0?l.negative:"")+l.infinity}const a=mu(e,r);return a?fu(e,a,n,s):n.overflow}function gu(e){return!!(e[0]&&e[0].percent||e[1]&&e[1].percent||e[2]&&e[2].percent||e[3]&&e[3].percent)}function _u(e){return!!(e[0]&&e[0].date||e[1]&&e[1].date||e[2]&&e[2].date||e[3]&&e[3].date)}function pu(e){const[t,n,r,s]=e;return!!((!t||t.generated)&&(!n||n.generated)&&(!r||r.generated)&&s&&s.text&&!s.generated)}const Kp={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},Xp=[["DMY",1],["DM",2],["MY",3],["MDY",4],["MD",5],["hmsa",6],["hma",7],["hms",8],["hm",9]];function qp(e,t=null){var h;const[n,r]=e,s=n.frac_max,i={type:"general",isDate:_u(e),isText:pu(e),isPercent:gu(e),maxDecimals:n.general?9:s,scale:(h=n.scale)!=null?h:1,color:0,parentheses:0,grouped:n.grouping?1:0},o=!i.isDate&&!i.isText&&!n.error&&n.tokens.some(d=>d.type==="string"&&(t?d.value===t:Eo.test(d.value)));let a="G",l=s>=0?Math.min(15,s):"",c="",u="";if(r&&r.color&&(u="-",i.color=1),n.parens&&(c="()",i.parentheses=1),o)a="C",i.type="currency";else if(n.error)i.type="error",i.maxDecimals=0;else if(i.isDate){let d=0,m=0,_="";n.tokens.forEach(I=>{const y=I.type;/^(b-)?year/.test(y)?(_+="Y",m++):y.startsWith("month")?(_+="M",m++):/^(week)?day/.test(y)?(_+="D",m++):(y==="hour"||y==="min"||y==="sec"||y==="ampm")&&(_+=y[0],d++)}),i.type="date",m&&d?i.type="datetime":!m&&d&&(i.type="time");const p=Xp.find(I=>_.startsWith(I[0]));a=p?"D":"G",l=p?p[1]:""}else i.isText?(a="G",i.type="text",l="",i.maxDecimals=0):n.general?(a="G",i.type="general",l=""):n.fractions?(a="G",i.type="fraction",l=""):n.exponential?(a="S",i.type="scientific"):i.isPercent?(a="P",i.type="percent"):n.grouping?(a=",",i.type="grouped"):(n.int_max||s)&&(a="F",i.type="number");return i.code=a+l+u+c,i.level=Kp[i.type],Object.freeze(i)}function Jp(e){const[t]=e;return{year:!!(t.date&Er),month:!!(t.date&Cr),day:!!(t.date&Ss),hours:!!(t.date&Rr),minutes:!!(t.date&Ir),seconds:!!(t.date&Sr),clockType:t.clock===12?12:24}}const Zp=[[Vi,/^General/i,0],[zi,/^#/,0],[Fn,/^0/,0],[Gi,/^\?/,0],[Ki,/^\//,0],[qi,/^;/,0],[ws,/^@/,0],[Ji,/^\+/,0],[Zi,/^-/,0],[vs,/^\./,0],[Qi,/^ /,0],[eo,/^%/,0],[bs,/^[1-9]/,0],[to,/^(?:B[12])/i,0],[wr,/^B$/,0],[no,/^(?:[hH]+|[mM]+|[sS]+|[yY]+|[bB]+|[dD]+|[gG]+|[aA]{3,}|e+)/,0],[ro,/^(?:\[(h+|m+|s+)\])/i,1],[so,/^\[(<[=>]?|>=?|=)\s*(-?[.\d]+)\]/,[1,2]],[io,/^\[(DBNum[0-4]?\d)\]/i,1],[oo,/^\[(NatNum[0-4]?\d)\]/i,1],[ao,/^\[\$([^\]]+)\]/,1],[lo,/^\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*\d+)\]/i,1],[Vc,/^\[([^\]]+)\]/,1],[co,/^(?:AM\/PM|am\/pm|A\/P)/,0],[uo,/^\\(.)/,1],[ho,/^"([^"]*?)"/,1],[fo,/^_(\\.|.)/,1],[mo,/^[Ee]([+-])/,1],[go,/^\*(\\.|.)/,1],[_o,/^[()]/,0],[wr,/^[EÈÉÊËèéêëĒēĔĕĖėĘęĚěȄȅȆȇȨȩNnÑñŃńŅņŇňǸǹ["*/\\_]/,0],[ys,/^./,0]],Qp=63,eE=35,tE=48,nE=57,Lo=e=>{const t=(e||"\0").charCodeAt(0);return t===Qp||t===eE||t>=tE&&t<=nE};function $n(e){let t=0;const n=[],r=[];for(;t<e.length;){const s=e.slice(t);let i=0;const o=/^(,+)(.)?/.exec(s);if(o){const a=o[1];i=a.length;const l=e[t-1]||"";let c=!1,u=!1;Lo(l)?(c=!0,u=!0):l==="."&&(u=!0);const h=o[2]||"";if(c&&(!h||h===";")&&(c=!1),u&&Lo(h)&&(u=!1),c&&!u)n.push({type:Or,value:",",raw:a});else if(!c&&u)n.push({type:Os,value:",",raw:a});else if(c&&u){const d={type:Os,value:",",raw:a};n.push(d),r.push(d)}else n.push({type:Xi,value:",",raw:a})}else{let a;for(const[l,c,u]of Zp){const h=c.exec(s);if(h){const d=Array.isArray(u)?u.map(m=>h[m]):h[u||0];a={type:l,value:d,raw:h[0]},n.push(a),i=h[0].length;break}}r.length&&a.raw===";"&&(r.length=0),r.length&&Lo(a.raw)&&(r.forEach(l=>l.type=Or),r.length=0)}if(!i){const a=s[0];i=1,n.push({type:ys,value:a,raw:a})}t+=i}return n}const Uo=e=>{const t=e.condition;t&&t[1]<0&&(t[0]==="<"||t[0]==="<="||t[0]==="=")||e.tokens.unshift({type:"minus",volatile:!0})},Eu=(e,t=null)=>{const n={};for(const r in e)Array.isArray(e[r])?n[r]=[...e[r]]:n[r]=e[r];return t&&n.tokens.unshift(t),n.generated=!0,n};function rE(e){var h;const t=[];let n=!1,r,s=null,i=0,o=!1,a=0,l=0,c=$n(e);do{if(o=yr(c),(o.date||o.general)&&(o.int_pattern.length||o.frac_pattern.length||o.scale!==1||o.text))throw new Error("Illegal format");if(o.condition&&(l++,n=!0),o.text){if(s)throw new Error("Unexpected partition");s=o}o.locale&&(r=Io(o.locale)),t.push(o),i=((h=c[o.tokensUsed])==null?void 0:h.type)==="break"?1:0,c=c.slice(o.tokensUsed+i),a++}while(i&&a<4&&l<3);if(i)throw new Error("Unexpected partition");if(l>2)throw new Error("Unexpected condition");const u=t[3];if(u&&(u.int_pattern.length||u.frac_pattern.length||u.date))throw new Error("Unexpected partition");if(n){const d=t.length;if(d===1&&(t[1]=yr($n("General")),t[1].generated=!0),d<3){const m=t[0],_=t[1];if(Uo(m),_.condition)Uo(_);else{const p=m.condition;(p[0]==="="||p[1]>=0&&(p[0]===">"||p[0]===">="))&&_.tokens.unshift({type:"minus",volatile:!0})}}else t.forEach(Uo)}else{if(t.length<4&&s)for(let d=0,m=t.length;d<m;d++)t[d]===s&&t.splice(d,1);if(t.length<1&&s&&(t[0]=yr($n("General")),t[0].generated=!0),t.length<2){const d={type:"minus",volatile:!0};t.push(Eu(t[0],d))}if(t.length<3&&t.push(Eu(t[0])),t.length<4)if(s)t.push(s);else{const d=yr($n("@"));d.generated=!0,t.push(d)}t[0].condition=[">",0],t[1].condition=["<",0],t[2].condition=null}return{pattern:e,partitions:t,locale:r}}const Cu=Object.create({});function nn(e,t=!1){e||(e="General");let n=Cu[e];if(!n)try{n=rE(e),Cu[e]=n}catch(r){if(t)throw r;const s={tokens:[{type:"error"}],error:r.message};n={pattern:e,partitions:[s,s,s,s],error:r.message,locale:null}}return n}function Ru(e,t,n={}){var o;const r=Object.assign({},Jc,n),s=nn(e,r.throws),i=(o=yo(t,r))!=null?o:t;return Gp(i,s,r)}function sE(e,t,n){var o;const r=Object.assign({},Jc,n),s=nn(e,r.throws),i=(o=yo(t,r))!=null?o:t;return zp(i,s,r)}function iE(e){const t=nn(e,!1);return _u(t.partitions)}function oE(e){const t=nn(e,!1);return gu(t.partitions)}function aE(e){const t=nn(e,!1);return pu(t.partitions)}function lE(e){try{return nn(e,!0),!0}catch{return!1}}function cE(e,t={}){const n=nn(e,!1);return n.info||(n.info=qp(n.partitions,t==null?void 0:t.currency)),n.info}function uE(e){const t=nn(e,!1);return t.dateInfo||(t.dateInfo=Jp(t.partitions)),t.dateInfo}const jn=Object.freeze({AMPM:co,BREAK:qi,CALENDAR:to,CHAR:ys,COLOR:lo,COMMA:Xi,CONDITION:so,DATETIME:no,DBNUM:io,DIGIT:bs,DURATION:ro,ERROR:wr,ESCAPED:uo,EXP:mo,FILL:go,GENERAL:Vi,GROUP:Or,HASH:zi,LOCALE:ao,MINUS:Zi,MODIFIER:Vc,NATNUM:oo,PAREN:_o,PERCENT:eo,PLUS:Ji,POINT:vs,QMARK:Gi,SCALE:Os,SKIP:fo,SLASH:Ki,SPACE:Qi,STRING:ho,TEXT:ws,ZERO:Fn}),hE=Object.freeze(Object.defineProperty({__proto__:null,addLocale:ne,dateFromSerial:Dp,dateToSerial:yo,dec2frac:Zc,format:Ru,formatColor:sE,getFormatDateInfo:uE,getFormatInfo:cE,getLocale:Hn,isDateFormat:iE,isPercentFormat:oE,isTextFormat:aE,isValidFormat:lE,parseBool:au,parseDate:Mo,parseLocale:Ro,parseNumber:No,parseTime:Ds,parseValue:Bp,round:St,tokenTypes:jn,tokenize:$n},Symbol.toStringTag,{value:"Module"})),Iu="@@@",Su="@",Po="General";function dE(e){return e===Iu||e===Su}function fE(e){return e==null||e===Po}const mE=(e,t)=>{if(e&&!t||!e&&t)return!1;const n=i=>{const o=$n(i);let a="",l=!1,c=!1;for(const u of o){if(u.type===jn.POINT){l=!0;continue}if(!(c&&u.type===jn.MINUS)&&u.type!==jn.SKIP){if(u.type===jn.COLOR){c=!0;continue}else c=!1;l&&u.type===jn.ZERO||(l=!1,l||(a+=u.value||""))}}return a},r=n(e),s=n(t);return r===s},gE=new Set(["m d"]),_E=new Set(["h:mm AM/PM","hh:mm AM/PM"]),Ou=e=>{var s,i;const t=(i=(s=Mo(e))!=null?s:Ds(e))!=null?i:No(e);if(!t)return null;const{v:n,z:r}=t;return r&&(gE.has(r)||_E.has(r)&&!/\s(A|AM|P|PM)$/i.test(e)||r.includes("#,##0")&&Ru(r,n)!==e)?null:t};function pE(e,t){const n={};for(const r in e){const s=Number(r),i=e[s];for(const o in i){const a=Number(o),l=i[a],c=t(s,a,l);c!==void 0&&(n[s]?n[s][a]=c:n[s]={[a]:c})}}return n}function rn(e){let t=0;const n=Object.keys(e);for(const r of n){const s=Number(r);t=Math.max(t,s)}return t+1}function EE(e,t,n){const r=rn(n),s=n;for(let i=r-1;i>=e;i--)s[i]===void 0?delete s[i+1]:s[i+1]=s[i];s[e]=t}function ko(e,t,n){const r=Object.keys(n).reduce((s,i)=>Math.max(s,Number.parseInt(i)),0)+1;for(let s=e;s<r;s++)s<e+t?delete n[s]:n[s]!==void 0&&(n[s-t]=n[s],delete n[s])}function CE(e,t){const n=e,r=Object.keys(n),s=r.length,i=t,o=Object.keys(i),a=o.length,l={};let c=0;for(let u=0;u<s;u++,c++){const h=r[u];l[c]=n[h]}for(let u=0;u<a;u++,c++){const h=o[u];l[c]=i[h]}return l}function RE(e,t,n){const r=n;if(rn(n)>0){const i={};let o=0;for(let a=e;a<=t;a++)r[a]&&(i[o]=r[a],o++);return i}return{}}function Fo(e,t,n,r){const s=e>n;if(!s&&e+t>n)throw new Error("Invalid move operation");s?IE(e,t,n,r):SE(e,t,n,r)}function IE(e,t,n,r){const s=r,i=[];for(let o=e;o<e+t;o++)i.push(s[o]);for(let o=e-1;o>=n;o--){const a=s[o];s[o+t]=a,a===void 0&&delete s[o+t]}i.forEach((o,a)=>{s[n+a]=o,o===void 0&&delete s[n+a]})}function SE(e,t,n,r){const s=r,i=[];for(let o=e;o<e+t;o++)i.push(s[o]);for(let o=e+t;o<n;o++){const a=s[o];s[o-t]=a,a===void 0&&delete s[o-t]}i.forEach((o,a)=>{s[n+a-t]=o,o===void 0&&delete s[n+a-t]})}class ct{constructor(t={}){E(this,"_matrix");this._setOriginValue(t)}static MakeObjectMatrixSize(t){return new ct({[t-1]:{}})}getMatrix(){return this._matrix}forEach(t){const n=this._matrix,r=Object.keys(n);for(const s of r){const i=Number(s),o=n[i];if(t(i,o)===!1)return this}return this}forRow(t){const n=this._matrix,r=Object.keys(n);for(const s of r){const i=Number(s),o=n[i];if(t(i,Object.keys(o).map(l=>Number(l)))===!1)return this}return this}forValue(t){const n=this._matrix;for(const r in n){const s=Number(r),i=n[s];if(i)for(const o in i){const a=Number(o),l=i[a];if(t(s,a,l)===!1)return this}}return this}swapRow(t,n){const r=this._matrix[t],s=this._matrix[n];this._matrix[t]=s,this._matrix[n]=r}getRow(t){return this._matrix[t]}getRowOrCreate(t){let n=this.getRow(t);return n==null&&(n={},this._matrix[t]=n),n}reset(){this._setOriginValue({})}hasValue(){const t=this._matrix,n=Object.keys(t);if(n.length===0)return!1;for(const r of n){const s=Number(r),i=t[s];if(Object.keys(i).length>0)return!0}return!1}getValue(t,n){var r,s;return(s=(r=this._matrix)==null?void 0:r[t])==null?void 0:s[n]}setValue(t,n,r){const s=this.getRowOrCreate(t);s[n]=r}deleteValue(t,n){var r,s;(s=(r=this._matrix)==null?void 0:r[t])==null||delete s[n]}realDeleteValue(t,n){var r,s,i;if((s=(r=this._matrix)==null?void 0:r[t])==null||delete s[n],this.getRow(t)){const o=this.getRow(t);if(o==null)return;Object.keys(o).length===0&&((i=this._matrix)==null||delete i[t])}}setRow(t,n){this._matrix[t]=n}moveRows(t,n,r){Fo(t,n,r,this._matrix)}moveColumns(t,n,r){this.forEach((s,i)=>{Fo(t,n,r,i)})}insertRows(t,n){const r=Object.keys(this._matrix);for(let s=r.length-1;s>=0;s--){const i=Number(r[s]);if(i>=t){const o=this._matrix[i];delete this._matrix[i],this._matrix[i+n]=o}}}insertColumns(t,n){const r=Object.keys(this._matrix);for(let s=0;s<r.length;s++){const i=Number(r[s]),o=this._matrix[i],a=Object.keys(o);for(let l=a.length-1;l>=0;l--){const c=Number(a[l]);if(c>=t){const u=o[c];delete o[c],o[c+n]=u}}}}removeRows(t,n){ko(t,n,this._matrix)}removeColumns(t,n){this.forEach((r,s)=>{s&&ko(t,n,s)})}getFragment(t,n,r,s){const i=new ct;let o=0;for(let a=t;a<=n;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(t,n,r,s){const i=new ct;for(let o=t;o<=n;o++)for(let a=r;a<=s;a++){const l=this.getValue(o,a);l&&i.setValue(o,a,Z.deepClone(l))}return i}getSliceDataAndCellCountByRows(t,n){const r=new ct;let s=0;for(let i=t;i<=n;i++){const o=this.getRow(i);o&&(r.setRow(i,o),s+=Object.keys(o).length)}return{sliceData:r,cellCount:s}}getSizeOf(){return Object.keys(this._matrix).length}getLength(){return rn(this._matrix)}getRange(){const r=this.getLength()-1;let s=0;const i=this.getLength();for(let o=0;o<i;o++){const a=this.getRow(o);if(a){const l=rn(a)-1;s=l>s?l:s}}return{startRow:0,startColumn:0,endRow:r,endColumn:s}}getRealRange(){const t=Object.keys(this._matrix),n=t.length,r=n>0?Number(t[0]):0,s=n>0?Number(t[n-1]):0;let i=-1/0,o=0;for(const a of t){const l=this.getRow(Number(a));if(l){const c=Object.keys(l);if(c.length>0){const u=Number(c[0]),h=Number(c[c.length-1]);(i===-1/0||u<i)&&(i=u),h>o&&(o=h)}}}return i===-1/0&&(i=0),{startRow:r,endRow:s,startColumn:i,endColumn:o}}getRealRowRange(){const t=Object.keys(this._matrix),n=t.length,r=n>0?Number(t[0]):0,s=n>0?Number(t[n-1]):0;return{startRow:r,endRow:s}}toNativeArray(){const t=new Array;return this.forValue((n,r,s)=>{t.push(s)}),t}toArray(){const t=[];return this.forRow((n,r)=>{t[n]==null&&(t[n]=[]),r.forEach(s=>{t[n][s]=this.getValue(n,s)})}),t}toFullArray(){const t=this.getRange(),{endColumn:n,endRow:r}=t,s=[];for(let i=0;i<=r;i++){const o=new Array(n+1).fill(void 0);s.push(o)}return this.forValue((i,o,a)=>{s[i][o]=a}),s}toJSON(){return this._matrix}clone(){const t=JSON.stringify(this._matrix);return JSON.parse(t)}getData(){const t=JSON.stringify(this._matrix);return JSON.parse(t)}getArrayData(){let t=0,n=0,r=!1,s=!1;const i=new ct;return this.forEach((o,a)=>{r||(r=!0,t=o),Object.keys(a).forEach(l=>{const c=Number(l);s?c<n&&(n=c):(s=!0,n=c);const u=this.getValue(o,c);i.setValue(o-t,c-n,u)})}),i.getData()}getStartEndScope(){let t=1/0,n=-1/0,r=1/0,s=-1/0;const i=Object.keys(this._matrix);i.length>0&&(t=+i[0],n=+i[i.length-1]);for(const o of i){const a=Object.keys(this._matrix[o]);a.length>0&&(r=Math.min(r,+a[0]),s=Math.max(s,+a[a.length-1]))}return{startRow:t,endRow:n,startColumn:r,endColumn:s}}getDataRange(){let t=0,n=0,r=0,s=-1,i=!1,o=!1;return this.forEach((a,l)=>{if(i||(i=!0,t=a),l==null)return;const c=rn(l)-1;c>r&&(r=c),Object.keys(l).forEach(u=>{const h=Number(u);o?h<n&&(n=h):(o=!0,n=h)}),a>s&&(s=a)}),{startRow:t,startColumn:n,endRow:s,endColumn:r}}getDiscreteRanges(){const t=[];return this.forEach((n,r)=>{Object.keys(r).forEach(s=>{const i=Number(s);let o=!1;for(const a of t)if(n>=a.startRow&&n<=a.endRow+1&&i>=a.startColumn&&i<=a.endColumn+1){a.endRow=Math.max(n,a.endRow),a.endColumn=Math.max(i,a.endColumn),o=!0;break}o||t.push({startRow:n,endRow:n,startColumn:i,endColumn:i})})}),t}merge(t){this.forValue((n,r)=>{const s=t.getValue(n,r);s!=null&&this.setValue(n,r,s)})}concatRows(t){const n=t.getMatrix();for(const r in n){const s=Number(r);this.setRow(s,n[s])}}_setOriginValue(t={}){this._matrix=t}}function wu(e){const{actualRow:t,actualColumn:n,isMerged:r,isMergedMainCell:s,mergeInfo:i}=e;let{startY:o,endY:a,startX:l,endX:c}=e,u=t,h=n,d=t,m=n;if(r&&i){const{startRow:_,startColumn:p,endRow:I,endColumn:y,startY:H,endY:x,startX:Y,endX:O}=i;u=_,h=p,d=I,m=y,o=H,a=x,l=Y,c=O}return s&&(o=i.startY,a=i.endY,l=i.startX,c=i.endX,d=i.endRow,m=i.endColumn),{startRow:u,startColumn:h,endRow:d,endColumn:m,startY:o,endY:a,startX:l,endX:c}}const OE=wu;function wE(e){if(!e)return;const{actualRow:t,actualColumn:n,isMerged:r,isMergedMainCell:s,startRow:i,startColumn:o,endRow:a,endColumn:l}=e;let c=t,u=n,h=t,d=n;return(r||s)&&(c=i,u=o,h=a,d=l),{startRow:c,startColumn:u,endRow:h,endColumn:d}}function vu(e){var n;return!e||(((n=e==null?void 0:e.v)==null?void 0:n.toString())||"").length===0&&!e.p}function xo(e){return vu(e)&&(e==null?void 0:e.coverable)!==!1}function Ft(e){if(e){if(e.rgb)return new It(e.rgb).toHexString();if(e.th)return new Es().setThemeColor(e.th).asThemeColor().asRgbColor().getCssString()}return null}function bu(e){return Z.isString(e)&&e.substring(0,1)==="="&&e.length>1}function vE(e){return Z.isString(e)&&e.length>0}function bE(e,t=!1){var i;let n="";const r=new Map([["ff",()=>{e.ff&&(n+=`font-family: ${e.ff}; `)}],["fs",()=>{if(e.fs){let o=e.fs;e.va&&(o/=2),n+=`font-size: ${o}pt; `}}],["it",()=>{e.it&&(n+="font-style: italic; ")}],["bl",()=>{e.bl&&(n+="font-weight: bold; ")}],["ul",()=>{var o;(o=e.ul)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} underline`):n+="text-decoration: underline; ",e.ul.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${Ft(e.ul.cl)}; `),e.ul.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.ul.t} `))}],["st",()=>{var o;(o=e.st)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} line-through`):n+="text-decoration-line: line-through; ",e.st.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${Ft(e.st.cl)}; `),e.st.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.st.t} `))}],["ol",()=>{var o;(o=e.ol)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} overline`):n+="text-decoration-line: overline; ",e.ol.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${Ft(e.ol.cl)}; `),e.ol.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.ol.t} `))}],["bg",()=>{e.bg&&(n+=`background: ${Ft(e.bg)}; `)}],["bd",()=>{var o,a,l,c,u,h,d,m,_,p,I,y;(o=e.bd)!=null&&o.b&&(n+=`border-bottom: ${Ls((a=e.bd)==null?void 0:a.b.s)} ${(l=Ft(e.bd.b.cl))!=null?l:""}; `),(c=e.bd)!=null&&c.t&&(n+=`border-top: ${Ls((u=e.bd)==null?void 0:u.t.s)} ${(h=Ft(e.bd.t.cl))!=null?h:""}; `),(d=e.bd)!=null&&d.r&&(n+=`border-right: ${Ls((m=e.bd)==null?void 0:m.r.s)} ${(_=Ft(e.bd.r.cl))!=null?_:""}; `),(p=e.bd)!=null&&p.l&&(n+=`border-left: ${Ls((I=e.bd)==null?void 0:I.l.s)} ${(y=Ft(e.bd.l.cl))!=null?y:""}; `)}],["cl",()=>{e.cl&&(n+=`color: ${Ft(e.cl)}; `)}],["va",()=>{e.va===jt.SUBSCRIPT?n+="vertical-align: sub; ":e.va===jt.SUPERSCRIPT&&(n+="vertical-align: super; ")}],["td",()=>{e.td===ur.LEFT_TO_RIGHT?n+="direction: ltr; ":e.td===ur.RIGHT_TO_LEFT&&(n+="direction: rtl; ")}],["tr",()=>{var o,a,l;e.tr&&(n+=`--data-rotate: (${(o=e.tr)==null?void 0:o.a}deg${(a=e.tr)!=null&&a.v?` ,${(l=e.tr)==null?void 0:l.v}`:""});`)}],["ht",()=>{e.ht===bt.LEFT?n+="text-align: left; ":e.ht===bt.RIGHT?n+="text-align: right; ":e.ht===bt.CENTER?n+="text-align: center; ":e.ht===bt.JUSTIFIED&&(n+="text-align: justify; ")}],["vt",()=>{e.vt===mn.BOTTOM?n+="vertical-align: bottom; ":e.vt===mn.TOP?n+="vertical-align: top; ":e.vt===mn.MIDDLE&&(n+="vertical-align: middle; ")}],["tb",()=>{e.tb===gn.CLIP?n+="white-space: nowrap; overflow-x: hidden; ":e.tb===gn.WRAP&&(n+="white-space: normal;")}],["pd",()=>{var u,h,d,m,_,p,I,y;const o=`${(u=e.pd)==null?void 0:u.b}pt`,a=`${(h=e.pd)==null?void 0:h.t}pt`,l=`${(d=e.pd)==null?void 0:d.l}pt`,c=`${(m=e.pd)==null?void 0:m.r}pt`;(_=e.pd)!=null&&_.b&&(n+=`padding-bottom: ${o}; `),(p=e.pd)!=null&&p.t&&(n+=`padding-top: ${a}; `),(I=e.pd)!=null&&I.l&&(n+=`padding-left: ${l}; `),(y=e.pd)!=null&&y.r&&(n+=`padding-right: ${c}; `)}]]),s=["bd","tr","tb"];for(const o in e)t&&s.includes(o)||(i=r.get(o))==null||i();return n}function Ls(e){let t="";return e===Pe.NONE?t="none":e===Pe.THIN?t="0.5pt solid":e===Pe.HAIR?t="0.5pt double":e===Pe.DOTTED?t="0.5pt dotted":e===Pe.DASHED||e===Pe.DASH_DOT?t="0.5pt dashed":e===Pe.DASH_DOT_DOT?t="0.5pt dotted":e===Pe.DOUBLE?t="0.5pt double":e===Pe.MEDIUM?t="1pt solid":e===Pe.MEDIUM_DASHED||e===Pe.MEDIUM_DASH_DOT?t="1pt dashed":e===Pe.MEDIUM_DASH_DOT_DOT?t="1pt dotted":e===Pe.SLANT_DASH_DOT?t="0.5pt dashed":e===Pe.THICK&&(t="1.5pt solid"),t}function yE(e){let t=0;if(e=e.trim(),e==="none")t=Pe.NONE;else if(e==="0.5pt solid")t=Pe.THIN;else if(e==="0.5pt double")t=Pe.HAIR;else if(e==="0.5pt dotted")t=Pe.DOTTED;else if(e==="0.5pt dashed")t=Pe.DASHED;else if(e==="1pt solid")t=Pe.MEDIUM;else if(e==="1pt dashed")t=Pe.MEDIUM_DASHED;else if(e==="1pt dotted")t=Pe.MEDIUM_DASH_DOT_DOT;else if(e==="1.5pt solid")t=Pe.THICK;else if(!e.includes("none"))t=Pe.THIN;else return Pe.NONE;return t}function AE(e,t){let n=e.body;if(t){const{headers:r,footers:s}=e;r!=null&&r[t]?n=r[t].body:s!=null&&s[t]&&(n=s[t].body)}return n}function TE(e,t){const{startRow:n,endRow:r,startColumn:s,endColumn:i,rangeType:o}=e;if(n<0||s<0||r<0||i<0||!(Number.isNaN(n)&&Number.isNaN(r))&&o===pe.COLUMN||!(Number.isNaN(s)&&Number.isNaN(i))&&o===pe.ROW||o!==pe.ROW&&o!==pe.COLUMN&&(Number.isNaN(s)||Number.isNaN(n)||Number.isNaN(i)||Number.isNaN(r)))return!1;if(t){const a=t.getRowCount(),l=t.getColumnCount();if(r>=a||i>=l)return!1}return!0}function NE(e,t){return{startRow:e,endRow:e,startColumn:t,endColumn:t}}function Ho(e){if(bu(e))return{f:e,v:null,p:null};if($c(e)){if(typeof e=="string"){const t=Ou(e);if(t&&t.z)return{v:t.v,p:null,f:null,s:{n:{pattern:t.z||Po}}}}return{v:e,p:null,f:null}}return Bc(e),e}function ME(e,t){const n=new ct,{startRow:r,startColumn:s,endRow:i,endColumn:o}=t;if(Z.isArray(e))for(let a=0;a<=i-r;a++)for(let l=0;l<=o-s;l++)n.setValue(a+r,l+s,Ho(e[a][l]));else new ct(e).forValue((l,c,u)=>{n.setValue(l,c,Ho(u))});return n.getMatrix()}function Bo(e,t){return Object.prototype.toString.call(e)===Object.prototype.toString.call(t)?Object.prototype.toString.call(e)==="[object Object]"||Object.prototype.toString.call(e)==="[object Array]"?Object.keys(e).length!==Object.keys(t).length?!1:Object.keys(e).every(n=>Bo(e[n],t[n])):e===t:!1}function yu(e,t){const n=e.ts||{},r=t.ts||{};return e.sId!==t.sId?!1:Bo(n,r)}function DE(e,t){return t.some(n=>e.indexOf(n)>-1)}var Us={exports:{}},LE=Us.exports,Au;function UE(){return Au||(Au=1,(function(e,t){(function(n,r){e.exports=r()})(LE,(function(){var n=1e3,r=6e4,s=36e5,i="millisecond",o="second",a="minute",l="hour",c="day",u="week",h="month",d="quarter",m="year",_="date",p="Invalid Date",I=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|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,H={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(M){var A=["th","st","nd","rd"],v=M%100;return"["+M+(A[(v-20)%10]||A[v]||A[0])+"]"}},x=function(M,A,v){var N=String(M);return!N||N.length>=A?M:""+Array(A+1-N.length).join(v)+M},Y={s:x,z:function(M){var A=-M.utcOffset(),v=Math.abs(A),N=Math.floor(v/60),D=v%60;return(A<=0?"+":"-")+x(N,2,"0")+":"+x(D,2,"0")},m:function M(A,v){if(A.date()<v.date())return-M(v,A);var N=12*(v.year()-A.year())+(v.month()-A.month()),D=A.clone().add(N,h),L=v-D<0,F=A.clone().add(N+(L?-1:1),h);return+(-(N+(v-D)/(L?D-F:F-D))||0)},a:function(M){return M<0?Math.ceil(M)||0:Math.floor(M)},p:function(M){return{M:h,y:m,w:u,d:c,D:_,h:l,m:a,s:o,ms:i,Q:d}[M]||String(M||"").toLowerCase().replace(/s$/,"")},u:function(M){return M===void 0}},O="en",R={};R[O]=H;var b="$isDayjsObject",T=function(M){return M instanceof P||!(!M||!M[b])},B=function M(A,v,N){var D;if(!A)return O;if(typeof A=="string"){var L=A.toLowerCase();R[L]&&(D=L),v&&(R[L]=v,D=L);var F=A.split("-");if(!D&&F.length>1)return M(F[0])}else{var Q=A.name;R[Q]=A,D=Q}return!N&&D&&(O=D),D||!N&&O},$=function(M,A){if(T(M))return M.clone();var v=typeof A=="object"?A:{};return v.date=M,v.args=arguments,new P(v)},g=Y;g.l=B,g.i=T,g.w=function(M,A){return $(M,{locale:A.$L,utc:A.$u,x:A.$x,$offset:A.$offset})};var P=(function(){function M(v){this.$L=B(v.locale,null,!0),this.parse(v),this.$x=this.$x||v.x||{},this[b]=!0}var A=M.prototype;return A.parse=function(v){this.$d=(function(N){var D=N.date,L=N.utc;if(D===null)return new Date(NaN);if(g.u(D))return new Date;if(D instanceof Date)return new Date(D);if(typeof D=="string"&&!/Z$/i.test(D)){var F=D.match(I);if(F){var Q=F[2]-1||0,G=(F[7]||"0").substring(0,3);return L?new Date(Date.UTC(F[1],Q,F[3]||1,F[4]||0,F[5]||0,F[6]||0,G)):new Date(F[1],Q,F[3]||1,F[4]||0,F[5]||0,F[6]||0,G)}}return new Date(D)})(v),this.init()},A.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()},A.$utils=function(){return g},A.isValid=function(){return this.$d.toString()!==p},A.isSame=function(v,N){var D=$(v);return this.startOf(N)<=D&&D<=this.endOf(N)},A.isAfter=function(v,N){return $(v)<this.startOf(N)},A.isBefore=function(v,N){return this.endOf(N)<$(v)},A.$g=function(v,N,D){return g.u(v)?this[N]:this.set(D,v)},A.unix=function(){return Math.floor(this.valueOf()/1e3)},A.valueOf=function(){return this.$d.getTime()},A.startOf=function(v,N){var D=this,L=!!g.u(N)||N,F=g.p(v),Q=function(j,W){var ee=g.w(D.$u?Date.UTC(D.$y,W,j):new Date(D.$y,W,j),D);return L?ee:ee.endOf(c)},G=function(j,W){return g.w(D.toDate()[j].apply(D.toDate("s"),(L?[0,0,0,0]:[23,59,59,999]).slice(W)),D)},le=this.$W,ue=this.$M,S=this.$D,U="set"+(this.$u?"UTC":"");switch(F){case m:return L?Q(1,0):Q(31,11);case h:return L?Q(1,ue):Q(0,ue+1);case u:var V=this.$locale().weekStart||0,z=(le<V?le+7:le)-V;return Q(L?S-z:S+(6-z),ue);case c:case _:return G(U+"Hours",0);case l:return G(U+"Minutes",1);case a:return G(U+"Seconds",2);case o:return G(U+"Milliseconds",3);default:return this.clone()}},A.endOf=function(v){return this.startOf(v,!1)},A.$set=function(v,N){var D,L=g.p(v),F="set"+(this.$u?"UTC":""),Q=(D={},D[c]=F+"Date",D[_]=F+"Date",D[h]=F+"Month",D[m]=F+"FullYear",D[l]=F+"Hours",D[a]=F+"Minutes",D[o]=F+"Seconds",D[i]=F+"Milliseconds",D)[L],G=L===c?this.$D+(N-this.$W):N;if(L===h||L===m){var le=this.clone().set(_,1);le.$d[Q](G),le.init(),this.$d=le.set(_,Math.min(this.$D,le.daysInMonth())).$d}else Q&&this.$d[Q](G);return this.init(),this},A.set=function(v,N){return this.clone().$set(v,N)},A.get=function(v){return this[g.p(v)]()},A.add=function(v,N){var D,L=this;v=Number(v);var F=g.p(N),Q=function(ue){var S=$(L);return g.w(S.date(S.date()+Math.round(ue*v)),L)};if(F===h)return this.set(h,this.$M+v);if(F===m)return this.set(m,this.$y+v);if(F===c)return Q(1);if(F===u)return Q(7);var G=(D={},D[a]=r,D[l]=s,D[o]=n,D)[F]||1,le=this.$d.getTime()+v*G;return g.w(le,this)},A.subtract=function(v,N){return this.add(-1*v,N)},A.format=function(v){var N=this,D=this.$locale();if(!this.isValid())return D.invalidDate||p;var L=v||"YYYY-MM-DDTHH:mm:ssZ",F=g.z(this),Q=this.$H,G=this.$m,le=this.$M,ue=D.weekdays,S=D.months,U=D.meridiem,V=function(W,ee,te,k){return W&&(W[ee]||W(N,L))||te[ee].slice(0,k)},z=function(W){return g.s(Q%12||12,W,"0")},j=U||function(W,ee,te){var k=W<12?"AM":"PM";return te?k.toLowerCase():k};return L.replace(y,(function(W,ee){return ee||(function(te){switch(te){case"YY":return String(N.$y).slice(-2);case"YYYY":return g.s(N.$y,4,"0");case"M":return le+1;case"MM":return g.s(le+1,2,"0");case"MMM":return V(D.monthsShort,le,S,3);case"MMMM":return V(S,le);case"D":return N.$D;case"DD":return g.s(N.$D,2,"0");case"d":return String(N.$W);case"dd":return V(D.weekdaysMin,N.$W,ue,2);case"ddd":return V(D.weekdaysShort,N.$W,ue,3);case"dddd":return ue[N.$W];case"H":return String(Q);case"HH":return g.s(Q,2,"0");case"h":return z(1);case"hh":return z(2);case"a":return j(Q,G,!0);case"A":return j(Q,G,!1);case"m":return String(G);case"mm":return g.s(G,2,"0");case"s":return String(N.$s);case"ss":return g.s(N.$s,2,"0");case"SSS":return g.s(N.$ms,3,"0");case"Z":return F}return null})(W)||F.replace(":","")}))},A.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},A.diff=function(v,N,D){var L,F=this,Q=g.p(N),G=$(v),le=(G.utcOffset()-this.utcOffset())*r,ue=this-G,S=function(){return g.m(F,G)};switch(Q){case m:L=S()/12;break;case h:L=S();break;case d:L=S()/3;break;case u:L=(ue-le)/6048e5;break;case c:L=(ue-le)/864e5;break;case l:L=ue/s;break;case a:L=ue/r;break;case o:L=ue/n;break;default:L=ue}return D?L:g.a(L)},A.daysInMonth=function(){return this.endOf(h).$D},A.$locale=function(){return R[this.$L]},A.locale=function(v,N){if(!v)return this.$L;var D=this.clone(),L=B(v,N,!0);return L&&(D.$L=L),D},A.clone=function(){return g.w(this.$d,this)},A.toDate=function(){return new Date(this.valueOf())},A.toJSON=function(){return this.isValid()?this.toISOString():null},A.toISOString=function(){return this.$d.toISOString()},A.toString=function(){return this.$d.toUTCString()},M})(),w=P.prototype;return $.prototype=w,[["$ms",i],["$s",o],["$m",a],["$H",l],["$W",c],["$M",h],["$y",m],["$D",_]].forEach((function(M){w[M[1]]=function(A){return this.$g(A,M[0],M[1])}})),$.extend=function(M,A){return M.$i||(M(A,P,$),M.$i=!0),$},$.locale=B,$.isDayjs=T,$.unix=function(M){return $(1e3*M)},$.en=R[O],$.Ls=R,$.p={},$}))})(Us)),Us.exports}var PE=UE();const Wt=pt(PE);var Ps={exports:{}},kE=Ps.exports,Tu;function FE(){return Tu||(Tu=1,(function(e,t){(function(n,r){e.exports=r()})(kE,(function(){return function(n,r){var s=r.prototype,i=s.format;s.format=function(o){var a=this,l=this.$locale();if(!this.isValid())return i.bind(this)(o);var c=this.$utils(),u=(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(h){switch(h){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(),h==="w"?1:2,"0");case"W":case"WW":return c.s(a.isoWeek(),h==="W"?1:2,"0");case"k":case"kk":return c.s(String(a.$H===0?24:a.$H),h==="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 h}}));return i.bind(this)(u)}}}))})(Ps)),Ps.exports}var xE=FE();const HE=pt(xE);var ks={exports:{}},BE=ks.exports,Nu;function $E(){return Nu||(Nu=1,(function(e,t){(function(n,r){e.exports=r()})(BE,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,s=/\d/,i=/\d\d/,o=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,l={},c=function(I){return(I=+I)+(I>68?1900:2e3)},u=function(I){return function(y){this[I]=+y}},h=[/[+-]\d\d:?(\d\d)?|Z/,function(I){(this.zone||(this.zone={})).offset=(function(y){if(!y||y==="Z")return 0;var H=y.match(/([+-]|\d\d)/g),x=60*H[1]+(+H[2]||0);return x===0?0:H[0]==="+"?-x:x})(I)}],d=function(I){var y=l[I];return y&&(y.indexOf?y:y.s.concat(y.f))},m=function(I,y){var H,x=l.meridiem;if(x){for(var Y=1;Y<=24;Y+=1)if(I.indexOf(x(Y,0,y))>-1){H=Y>12;break}}else H=I===(y?"pm":"PM");return H},_={A:[a,function(I){this.afternoon=m(I,!1)}],a:[a,function(I){this.afternoon=m(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,u("seconds")],ss:[o,u("seconds")],m:[o,u("minutes")],mm:[o,u("minutes")],H:[o,u("hours")],h:[o,u("hours")],HH:[o,u("hours")],hh:[o,u("hours")],D:[o,u("day")],DD:[i,u("day")],Do:[a,function(I){var y=l.ordinal,H=I.match(/\d+/);if(this.day=H[0],y)for(var x=1;x<=31;x+=1)y(x).replace(/\[|\]/g,"")===I&&(this.day=x)}],w:[o,u("week")],ww:[i,u("week")],M:[o,u("month")],MM:[i,u("month")],MMM:[a,function(I){var y=d("months"),H=(d("monthsShort")||y.map((function(x){return x.slice(0,3)}))).indexOf(I)+1;if(H<1)throw new Error;this.month=H%12||H}],MMMM:[a,function(I){var y=d("months").indexOf(I)+1;if(y<1)throw new Error;this.month=y%12||y}],Y:[/[+-]?\d+/,u("year")],YY:[i,function(I){this.year=c(I)}],YYYY:[/\d{4}/,u("year")],Z:h,ZZ:h};function p(I){var y,H;y=I,H=l&&l.formats;for(var x=(I=y.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function($,g,P){var w=P&&P.toUpperCase();return g||H[P]||n[P]||H[w].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(M,A,v){return A||v.slice(1)}))}))).match(r),Y=x.length,O=0;O<Y;O+=1){var R=x[O],b=_[R],T=b&&b[0],B=b&&b[1];x[O]=B?{regex:T,parser:B}:R.replace(/^\[|\]$/g,"")}return function($){for(var g={},P=0,w=0;P<Y;P+=1){var M=x[P];if(typeof M=="string")w+=M.length;else{var A=M.regex,v=M.parser,N=$.slice(w),D=A.exec(N)[0];v.call(g,D),$=$.replace(D,"")}}return(function(L){var F=L.afternoon;if(F!==void 0){var Q=L.hours;F?Q<12&&(L.hours+=12):Q===12&&(L.hours=0),delete L.afternoon}})(g),g}}return function(I,y,H){H.p.customParseFormat=!0,I&&I.parseTwoDigitYear&&(c=I.parseTwoDigitYear);var x=y.prototype,Y=x.parse;x.parse=function(O){var R=O.date,b=O.utc,T=O.args;this.$u=b;var B=T[1];if(typeof B=="string"){var $=T[2]===!0,g=T[3]===!0,P=$||g,w=T[2];g&&(w=T[2]),l=this.$locale(),!$&&w&&(l=H.Ls[w]),this.$d=(function(N,D,L,F){try{if(["x","X"].indexOf(D)>-1)return new Date((D==="X"?1e3:1)*N);var Q=p(D)(N),G=Q.year,le=Q.month,ue=Q.day,S=Q.hours,U=Q.minutes,V=Q.seconds,z=Q.milliseconds,j=Q.zone,W=Q.week,ee=new Date,te=ue||(G||le?1:ee.getDate()),k=G||ee.getFullYear(),K=0;G&&!le||(K=le>0?le-1:ee.getMonth());var q,re=S||0,ge=U||0,Ee=V||0,X=z||0;return j?new Date(Date.UTC(k,K,te,re,ge,Ee,X+60*j.offset*1e3)):L?new Date(Date.UTC(k,K,te,re,ge,Ee,X)):(q=new Date(k,K,te,re,ge,Ee,X),W&&(q=F(q).week(W).toDate()),q)}catch{return new Date("")}})(R,B,b,H),this.init(),w&&w!==!0&&(this.$L=this.locale(w).$L),P&&R!=this.format(B)&&(this.$d=new Date("")),l={}}else if(B instanceof Array)for(var M=B.length,A=1;A<=M;A+=1){T[1]=B[A-1];var v=H.apply(this,T);if(v.isValid()){this.$d=v.$d,this.$L=v.$L,this.init();break}A===M&&(this.$d=new Date(""))}else Y.call(this,O)}}}))})(ks)),ks.exports}var jE=$E();const WE=pt(jE);var Fs={exports:{}},YE=Fs.exports,Mu;function VE(){return Mu||(Mu=1,(function(e,t){(function(n,r){e.exports=r()})(YE,(function(){return function(n,r,s){var i=r.prototype,o=function(h){return h&&(h.indexOf?h:h.s)},a=function(h,d,m,_,p){var I=h.name?h:h.$locale(),y=o(I[d]),H=o(I[m]),x=y||H.map((function(O){return O.slice(0,_)}));if(!p)return x;var Y=I.weekStart;return x.map((function(O,R){return x[(R+(Y||0))%7]}))},l=function(){return s.Ls[s.locale()]},c=function(h,d){return h.formats[d]||(function(m){return m.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(_,p,I){return p||I.slice(1)}))})(h.formats[d.toUpperCase()])},u=function(){var h=this;return{months:function(d){return d?d.format("MMMM"):a(h,"months")},monthsShort:function(d){return d?d.format("MMM"):a(h,"monthsShort","months",3)},firstDayOfWeek:function(){return h.$locale().weekStart||0},weekdays:function(d){return d?d.format("dddd"):a(h,"weekdays")},weekdaysMin:function(d){return d?d.format("dd"):a(h,"weekdaysMin","weekdays",2)},weekdaysShort:function(d){return d?d.format("ddd"):a(h,"weekdaysShort","weekdays",3)},longDateFormat:function(d){return c(h.$locale(),d)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};i.localeData=function(){return u.bind(this)()},s.localeData=function(){var h=l();return{firstDayOfWeek:function(){return h.weekStart||0},weekdays:function(){return s.weekdays()},weekdaysShort:function(){return s.weekdaysShort()},weekdaysMin:function(){return s.weekdaysMin()},months:function(){return s.months()},monthsShort:function(){return s.monthsShort()},longDateFormat:function(d){return c(h,d)},meridiem:h.meridiem,ordinal:h.ordinal}},s.months=function(){return a(l(),"months")},s.monthsShort=function(){return a(l(),"monthsShort","months",3)},s.weekdays=function(h){return a(l(),"weekdays",null,null,h)},s.weekdaysShort=function(h){return a(l(),"weekdaysShort","weekdays",3,h)},s.weekdaysMin=function(h){return a(l(),"weekdaysMin","weekdays",2,h)}}}))})(Fs)),Fs.exports}var zE=VE();const GE=pt(zE);var xs={exports:{}},KE=xs.exports,Du;function XE(){return Du||(Du=1,(function(e,t){(function(n,r){e.exports=r()})(KE,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,s,i){var o=s.prototype,a=o.format;i.en.formats=n,o.format=function(l){l===void 0&&(l="YYYY-MM-DDTHH:mm:ssZ");var c=this.$locale().formats,u=(function(h,d){return h.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(m,_,p){var I=p&&p.toUpperCase();return _||d[p]||n[p]||d[I].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(y,H,x){return H||x.slice(1)}))}))})(l,c===void 0?{}:c);return a.call(this,u)}}}))})(xs)),xs.exports}var qE=XE();const JE=pt(qE);var Hs={exports:{}},ZE=Hs.exports,Lu;function QE(){return Lu||(Lu=1,(function(e,t){(function(n,r){e.exports=r()})(ZE,(function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(i,o,a){var l=o.prototype;a.utc=function(p){var I={date:p,utc:!0,args:arguments};return new o(I)},l.utc=function(p){var I=a(this.toDate(),{locale:this.$L,utc:!0});return p?I.add(this.utcOffset(),n):I},l.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var c=l.parse;l.parse=function(p){p.utc&&(this.$u=!0),this.$utils().u(p.$offset)||(this.$offset=p.$offset),c.call(this,p)};var u=l.init;l.init=function(){if(this.$u){var p=this.$d;this.$y=p.getUTCFullYear(),this.$M=p.getUTCMonth(),this.$D=p.getUTCDate(),this.$W=p.getUTCDay(),this.$H=p.getUTCHours(),this.$m=p.getUTCMinutes(),this.$s=p.getUTCSeconds(),this.$ms=p.getUTCMilliseconds()}else u.call(this)};var h=l.utcOffset;l.utcOffset=function(p,I){var y=this.$utils().u;if(y(p))return this.$u?0:y(this.$offset)?h.call(this):this.$offset;if(typeof p=="string"&&(p=(function(O){O===void 0&&(O="");var R=O.match(r);if(!R)return null;var b=(""+R[0]).match(s)||["-",0,0],T=b[0],B=60*+b[1]+ +b[2];return B===0?0:T==="+"?B:-B})(p),p===null))return this;var H=Math.abs(p)<=16?60*p:p;if(H===0)return this.utc(I);var x=this.clone();if(I)return x.$offset=H,x.$u=!1,x;var Y=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(x=this.local().add(H+Y,n)).$offset=H,x.$x.$localOffset=Y,x};var d=l.format;l.format=function(p){var I=p||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,I)},l.valueOf=function(){var p=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*p},l.isUTC=function(){return!!this.$u},l.toISOString=function(){return this.toDate().toISOString()},l.toString=function(){return this.toDate().toUTCString()};var m=l.toDate;l.toDate=function(p){return p==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():m.call(this)};var _=l.diff;l.diff=function(p,I,y){if(p&&this.$u===p.$u)return _.call(this,p,I,y);var H=this.local(),x=a(p).local();return _.call(H,x,I,y)}}}))})(Hs)),Hs.exports}var e0=QE();const t0=pt(e0);var Bs={exports:{}},n0=Bs.exports,Uu;function r0(){return Uu||(Uu=1,(function(e,t){(function(n,r){e.exports=r()})(n0,(function(){return function(n,r){r.prototype.weekday=function(s){var i=this.$locale().weekStart||0,o=this.$W,a=(o<i?o+7:o)-i;return this.$utils().u(s)?a:this.subtract(a,"day").add(s,"day")}}}))})(Bs)),Bs.exports}var s0=r0();const i0=pt(s0);var $s={exports:{}},o0=$s.exports,Pu;function a0(){return Pu||(Pu=1,(function(e,t){(function(n,r){e.exports=r()})(o0,(function(){var n="week",r="year";return function(s,i,o){var a=i.prototype;a.week=function(l){if(l===void 0&&(l=null),l!==null)return this.add(7*(l-this.week()),"day");var c=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var u=o(this).startOf(r).add(1,r).date(c),h=o(this).endOf(n);if(u.isBefore(h))return 1}var d=o(this).startOf(r).date(c).startOf(n).subtract(1,"millisecond"),m=this.diff(d,n,!0);return m<0?o(this).startOf("week").week():Math.ceil(m)},a.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}}))})($s)),$s.exports}var l0=a0();const c0=pt(l0);var js={exports:{}},u0=js.exports,ku;function h0(){return ku||(ku=1,(function(e,t){(function(n,r){e.exports=r()})(u0,(function(){return function(n,r){r.prototype.weekYear=function(){var s=this.month(),i=this.week(),o=this.year();return i===1&&s===11?o+1:s===0&&i>=52?o-1:o}}}))})(js)),js.exports}var d0=h0();const f0=pt(d0);Wt.extend(WE),Wt.extend(HE),Wt.extend(i0),Wt.extend(GE),Wt.extend(c0),Wt.extend(f0),Wt.extend(t0),Wt.extend(JE);function Ws(e,t,n,r){if(e>t)throw new Error("a1 should be less than a2");if(n>r)throw new Error("b1 should be less than b2");if(t<n||r<e)return[e,t];if(n<=e&&r>=t)return[];const s=r-n+1;return e<n&&t>r?[e,t-s]:n<=e&&r<t?[r+1-s,t-s]:n>e&&r>=t?[e,n-1]:[e,t]}function m0(e){if(e==null)return!1;const t=e.bullet;return(t==null?void 0:t.listId)!=null}function g0(e){if(e==null)return!1;const t=e.paragraphStyle;return Fu(t)}function Fu(e){var t;return!(e==null||(e.indentStart==null||e.indentStart.v===0)&&e.hanging==null||((t=e.hanging)==null?void 0:t.v)===0)}function xu(e,t,n){return e.slice(0,t)+n+e.slice(t)}function Hu(e,t,n){return t>n?e:e.slice(0,t)+e.slice(n)}function _0(e){if(e==null||typeof e=="boolean")return!1;if(typeof e=="number")return!isNaN(e);if(typeof e=="string"){const t=e.trim();return t===""?!1:!isNaN(Number(t))}return!1}function p0(e){let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+(t<<6)+(t<<16)-t;return t>>>0}function E0(...e){let t;return e.length===1&&Array.isArray(e[0])?t=e[0]:t=e,is({},...t)}const Ue=Symbol("newer"),Ze=Symbol("older");class C0{constructor(t){E(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Ue],{done:!1,value:t.key}):{done:!0,value:void 0}}}class R0{constructor(t){E(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Ue],{done:!1,value:t.value}):{done:!0,value:void 0}}}class I0{constructor(t){E(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Ue],{done:!1,value:[t.key,t.value]}):{done:!0,value:void 0}}}Td=Ue,Ad=Ze;class Bu{constructor(t,n){E(this,"key");E(this,"value");E(this,Td);E(this,Ad);this.key=t,this.value=n,this[Ue]=void 0,this[Ze]=void 0}toJSON(){return{key:this.key,value:this.value}}}class Tr{constructor(...t){E(this,"_keymap");E(this,"size",0);E(this,"limit");E(this,"oldest");E(this,"newest");E(this,"_onShiftListeners",[]);if(Nr.hasLength(t,1)){if(Nr.isNumber(t[0])){const n=t[0];this._initialize(n,void 0);return}if(Nr.isIterable(t[0])){const n=t[0];this._initialize(0,n);return}return}if(Nr.hasLength(t,2)){const n=t[0],r=t[1];this._initialize(n,r)}}onShift(t){if(this._onShiftListeners.indexOf(t)===-1)return this._onShiftListeners.push(t),Ye(()=>rr(this._onShiftListeners,t));throw new Error("[LRUMap]: the listener has been registered!")}_initialize(t,n){this.oldest=void 0,this.newest=void 0,this.size=0,this.limit=t,this._keymap=new Map,n&&(this.assign(n),t<1&&(this.limit=this.size))}_markEntryAsUsed(t){t!==this.newest&&(t[Ue]&&(t===this.oldest&&(this.oldest=t[Ue]),t[Ue][Ze]=t[Ze]),t[Ze]&&(t[Ze][Ue]=t[Ue]),t[Ue]=void 0,t[Ze]=this.newest,this.newest&&(this.newest[Ue]=t),this.newest=t)}assign(t){let n,r=this.limit||Number.MAX_VALUE;this._keymap.clear();const s=t[Symbol.iterator]();for(let i=s.next();!i.done;i=s.next()){const o=new Bu(i.value[0],i.value[1]);if(this._keymap.set(o.key,o),n?(n[Ue]=o,o[Ze]=n):this.oldest=o,n=o,r--===0)throw new Error("overflow")}this.newest=n,this.size=this._keymap.size}set(t,n){let r=this._keymap.get(t);return r?(r.value=n,this._markEntryAsUsed(r),this):(this._keymap.set(t,r=new Bu(t,n)),this.newest?(this.newest[Ue]=r,r[Ze]=this.newest):this.oldest=r,this.newest=r,++this.size,this.size>this.limit&&this.shift(),this)}shift(){const t=this.oldest;if(t)return this.oldest&&this.oldest[Ue]?(this.oldest=this.oldest[Ue],this.oldest[Ze]=void 0):(this.oldest=void 0,this.newest=void 0),t[Ue]=t[Ze]=void 0,this._keymap.delete(t.key),--this.size,this._onShiftListeners.forEach(n=>n(t)),[t.key,t.value]}get(t){const n=this._keymap.get(t);if(n)return this._markEntryAsUsed(n),n.value}has(t){return this._keymap.has(t)}find(t){const n=this._keymap.get(t);return n?n.value:void 0}delete(t){const n=this._keymap.get(t);if(n)return this._keymap.delete(n.key),n[Ue]&&n[Ze]?(n[Ze][Ue]=n[Ue],n[Ue][Ze]=n[Ze]):n[Ue]?(n[Ue][Ze]=void 0,this.oldest=n[Ue]):n[Ze]?(n[Ze][Ue]=void 0,this.newest=n[Ze]):this.oldest=this.newest=void 0,this.size--,n.value}clear(){this.oldest=void 0,this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new C0(this.oldest)}values(){return new R0(this.oldest)}entries(){return this[Symbol.iterator]()}[Symbol.iterator](){return new I0(this.oldest)}forEach(t,n){typeof n!="object"&&(n=this);let r=this.oldest;for(;r;)t.call(n,r.value,r.key,this),r=r[Ue]}toJSON(){const t=new Array(this.size);let n=0,r=this.oldest;for(;r;)t[n++]={key:r.key,value:r.value},r=r[Ue];return t}toString(){let t="",n=this.oldest;for(;n;)t+=`${String(n.key)}:${n.value}`,n=n[Ue],n&&(t+=" < ");return t}}class Nr{static hasLength(t,n){return t.length===n}static getValueType(t){return Object.prototype.toString.apply(t)}static isObject(t){return this.getValueType(t)==="[object Object]"}static isIterable(t){return t[Symbol.iterator]!=null}static isNumber(t){return this.getValueType(t)==="[object Number]"}}const S0={sheetId:"",range:{startRow:-1,endRow:-1,startColumn:-1,endColumn:-1}},O0={startRow:-1,startColumn:-1,endRow:-1,endColumn:-1},w0={startRow:0,startColumn:0,endRow:0,endColumn:0},v0={row:0,column:0},it={ff:"Arial",fs:11,it:ae.FALSE,bl:ae.FALSE,ul:{s:ae.FALSE},st:{s:ae.FALSE},ol:{s:ae.FALSE},tr:{a:0,v:ae.FALSE},td:ur.UNSPECIFIED,cl:{rgb:"#000000"},bg:{rgb:"#fff"},ht:bt.UNSPECIFIED,vt:mn.UNSPECIFIED,tb:gn.UNSPECIFIED,pd:{t:0,r:0,b:0,l:0},n:null,bd:{b:null,l:null,r:null,t:null}},$u={id:"default_slide",title:"defaultSlide",pageSize:{width:300,height:300}},b0=[li,Sa,ci],y0={[Je.HEADING_1]:{fs:20,bl:1},[Je.HEADING_2]:{fs:18,bl:1},[Je.HEADING_3]:{fs:16,bl:1},[Je.HEADING_4]:{fs:14,bl:1},[Je.HEADING_5]:{fs:12,bl:1},[Je.NORMAL_TEXT]:null,[Je.TITLE]:{fs:26,bl:1},[Je.SUBTITLE]:{fs:15,cl:{rgb:"#999999"}},[Je.NAMED_STYLE_TYPE_UNSPECIFIED]:null},Wn=4,A0={[Je.HEADING_1]:{spaceAbove:{v:20},spaceBelow:{v:6+Wn}},[Je.HEADING_2]:{spaceAbove:{v:18},spaceBelow:{v:6+Wn}},[Je.HEADING_3]:{spaceAbove:{v:16},spaceBelow:{v:6+Wn}},[Je.HEADING_4]:{spaceAbove:{v:14},spaceBelow:{v:4+Wn}},[Je.HEADING_5]:{spaceAbove:{v:12},spaceBelow:{v:4+Wn}},[Je.NORMAL_TEXT]:{spaceAbove:{v:0},spaceBelow:{v:0}},[Je.TITLE]:{spaceAbove:{v:0},spaceBelow:{v:3+Wn}},[Je.SUBTITLE]:{spaceAbove:{v:0},spaceBelow:{v:16}},[Je.NAMED_STYLE_TYPE_UNSPECIFIED]:null},T0="univer-sheets-chart-print-chart",N0="univer-docs-drawing-printing";var ju=(e=>(e.ARRAY_CONVERTOR="ARRAY_CONVERTOR",e.MATRIX_CONVERTOR="MATRIX_CONVERTOR",e))(ju||{});const M0={[ht.A3]:{width:1123,height:1587},[ht.A4]:{width:794,height:1124},[ht.A5]:{width:559,height:794},[ht.B4]:{width:944,height:1344},[ht.B5]:{width:665,height:944},[ht.Executive]:{width:696,height:1008},[ht.Folio]:{width:816,height:1248},[ht.Legal]:{width:816,height:1344},[ht.Letter]:{width:816,height:1056},[ht.Statement]:{width:528,height:816},[ht.Tabloid]:{width:1056,height:1632}};function Ys(e,t){const{textRuns:n=[]}=t;let r=0;for(const i of n){const{ts:o={},st:a,ed:l}=i;if(o[e]==null)return ae.FALSE;switch(e){case"bl":case"it":{if(o[e]===ae.FALSE)return ae.FALSE;break}case"ul":case"st":{if(o[e].s===ae.FALSE)return ae.FALSE;break}default:throw new Error(`unknown style key: ${e} in IStyleBase`)}r+=l-a}return t.dataStream.indexOf(`\r
4
- `)===r?ae.TRUE:ae.FALSE}const Kr=class Kr{constructor(t,n,r){E(this,"_range");E(this,"_worksheet");this._deps=r,this._range=n,this._worksheet=t}static foreach(t,n){const{startRow:r,startColumn:s,endRow:i,endColumn:o}=t;for(let a=r;a<=i;a++)for(let l=s;l<=o;l++)n(a,l)}getRangeData(){return this._range}getValue(){return this.getValues()[0][0]}getValues(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range,i=[];for(let o=t;o<=n;o++){const a=[];for(let l=r;l<=s;l++)a.push(this.getMatrix().getValue(o,l)||null);i.push(a)}return i}getMatrix(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range,i=this._worksheet.getCellMatrix(),o=new ct;for(let a=t;a<=n;a++)for(let l=r;l<=s;l++)o.setValue(a,l,i.getValue(a,l)||null);return o}getMatrixObject(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range,i=this._worksheet.getCellMatrix(),o=new ct;for(let a=t;a<=n;a++)for(let l=r;l<=s;l++)o.setValue(a-t,l-r,i.getValue(a,l)||{});return o}getA1Notation(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range;let i,o;return r<s?(i=Z.numToWord(r+1)+(t+1),o=Z.numToWord(s+1)+(n+1)):(i=Z.numToWord(s+1)+(n+1),o=Z.numToWord(r+1)+(t+1)),i===o?`${i}`:`${i}:${o}`}getBackground(){return this.getBackgrounds()[0][0]}getBackgrounds(){const t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>{var i;const s=t.getStyleByCell(r);return((i=s==null?void 0:s.bg)==null?void 0:i.rgb)||it.bg.rgb}))}getCell(t,n){const{startRow:r,startColumn:s}=this._range,i={startRow:r+t,endRow:r+t,startColumn:s+n,endColumn:s+n};return new Kr(this._worksheet,i,this._deps)}getColumn(){return this._range.startColumn}getObjectValue(t={}){return this.getObjectValues(t)[0][0]}getObjectValues(t={}){var a;const{startRow:n,endRow:r,startColumn:s,endColumn:i}=this._range,o=this._worksheet.getCellMatrix().getFragment(n,r,s,i).getData();if(t.isIncludeStyle){const l=this._deps.getStyles();for(let c=0;c<=r-n;c++)for(let 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 t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>{var i;const s=t.getStyleByCell(r);return((i=s==null?void 0:s.cl)==null?void 0:i.rgb)||it.cl.rgb}))}getFontFamilies(){return this._getStyles("ff")}getFontFamily(){return this.getFontFamilies()[0][0]}getUnderlines(){return this._getStyles("ul")}getUnderline(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Ys("ul",t.body)===ae.TRUE?{s:ae.TRUE}:{s:ae.FALSE}:this.getUnderlines()[0][0]}getOverlines(){return this._getStyles("ol")}getOverline(){return this.getOverlines()[0][0]}getStrikeThrough(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Ys("st",t.body)===ae.TRUE?{s:ae.TRUE}:{s:ae.FALSE}:this.getStrikeThroughs()[0][0]}getStrikeThroughs(){return this._getStyles("st")}getFontSize(){var n,r;const t=((n=this.getValue())==null?void 0:n.p)||{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?t.body.textRuns.some(s=>{var i;return((i=s==null?void 0:s.ts)==null?void 0:i.fs)!=null})?Math.max(...t.body.textRuns.map(s=>{var i;return((i=s==null?void 0:s.ts)==null?void 0:i.fs)||0})):this.getFontSizes()[0][0]:this.getFontSizes()[0][0]}getFontSizes(){return this._getStyles("fs")}getBorder(){return this.getBorders()[0][0]}getBorders(){return this._getStyles("bd")}getFontStyle(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Ys("it",t.body)===ae.TRUE?cs.ITALIC:cs.NORMAL:this._getFontStyles()[0][0]}_getFontStyles(){return this._getStyles("it")}getFontWeight(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Ys("bl",t.body)===ae.TRUE?us.BOLD:us.NORMAL:this._getFontWeights()[0][0]}_getFontWeights(){return this._getStyles("bl")}getGridId(){return this._worksheet.getSheetId()}getHeight(){const{_range:t,_worksheet:n}=this,{startRow:r,endRow:s}=t;let i=0;for(let o=0;o<=s-r;o++){const a=n.getRowHeight(o);i+=a}return i}getHorizontalAlignment(){return this.getHorizontalAlignments()[0][0]}getHorizontalAlignments(){return this._getStyles("ht")}getLastColumn(){return this._range.endColumn}getLastRow(){return this._range.endRow}getNumColumns(){const{startColumn:t,endColumn:n}=this._range;return n-t+1}getNumRows(){const{startRow:t,endRow:n}=this._range;return n-t+1}getRichTextValue(){return this.getRichTextValues()[0][0]}getRichTextValues(){return this.getValues().map(t=>t.map(n=>(n==null?void 0:n.p)||""))}getRowIndex(){return this._range.startRow}getSheet(){return this._worksheet}getTextDirection(){return this.getTextDirections()[0][0]}getTextDirections(){return this._getStyles("td")}getTextRotation(){return this.getTextRotations()[0][0]}getTextRotations(){return this._getStyles("tr")}getTextStyle(){return this.getTextStyles()[0][0]}getTextStyles(){const t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>t.getStyleByCell(r)))}getVerticalAlignment(){return this.getVerticalAlignments()[0][0]}getVerticalAlignments(){return this._getStyles("vt")}getWidth(){const{_range:t,_worksheet:n}=this,{startColumn:r,endColumn:s}=t;let i=0;for(let o=0;o<=s-r;o++)i+=n.getColumnWidth(o);return i}getWrap(){return this.getWrapStrategy()===gn.WRAP?ae.TRUE:ae.FALSE}getWrapStrategies(){return this._getStyles("tb")}getWrapStrategy(){return this.getWrapStrategies()[0][0]}forEach(t){Kr.foreach(this._range,t)}_getStyles(t){const n=this._deps.getStyles();return this.getValues().map(r=>r.map(s=>{const i=n&&n.getStyleByCell(s);return i&&i[t]||it[t]}))}};E(Kr,"transformRange",(t,n)=>{const r=n.getMaxColumns()-1,s=n.getMaxRows()-1;return t.rangeType===pe.ALL?{startColumn:0,startRow:0,endColumn:r,endRow:s}:t.rangeType===pe.COLUMN?{startRow:0,endRow:s,startColumn:t.startColumn,endColumn:t.endColumn}:t.rangeType===pe.ROW?{startColumn:0,endColumn:r,startRow:t.startRow,endRow:t.endRow}:{startColumn:t.startColumn,endColumn:Math.min(t.endColumn,r),startRow:t.startRow,endRow:Math.min(t.endRow,s)}});let Yn=Kr;function Wu(e,t,n=0,r=e.length-1,s=D0){for(;r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),h=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*h*(l-h)/l)*(c-l/2<0?-1:1),m=Math.max(n,Math.floor(t-c*h/l+d)),_=Math.min(r,Math.floor(t+(l-c)*h/l+d));Wu(e,t,m,_,s)}const i=e[t];let o=n,a=r;for(Mr(e,n,t),s(e[r],i)>0&&Mr(e,n,r);o<a;){for(Mr(e,o,a),o++,a--;s(e[o],i)<0;)o++;for(;s(e[a],i)>0;)a--}s(e[n],i)===0?Mr(e,n,a):(a++,Mr(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}}function Mr(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function D0(e,t){return e<t?-1:e>t?1:0}class Vs{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data;const r=[];if(!Gs(t,n))return r;const s=this.toBBox,i=[];for(;n;){for(let o=0;o<n.children.length;o++){const a=n.children[o],l=n.leaf?s(a):a;Gs(t,l)&&(n.leaf?r.push(a):jo(t,l)?this._all(a,r):i.push(a))}n=i.pop()}return r}collides(t){let n=this.data;if(!Gs(t,n))return!1;const r=[];for(;n;){for(let s=0;s<n.children.length;s++){const i=n.children[s],o=n.leaf?this.toBBox(i):i;if(Gs(t,o)){if(n.leaf||jo(t,o))return!0;r.push(i)}}n=r.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let r=0;r<t.length;r++)this.insert(t[r]);return this}let n=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){const r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=zn([]),this}remove(t,n){if(!t)return this;let r=this.data;const s=this.toBBox(t),i=[],o=[];let a,l,c;for(;r||i.length;){if(r||(r=i.pop(),l=i[i.length-1],a=o.pop(),c=!0),r.leaf){const u=L0(t,r.children,n);if(u!==-1)return r.children.splice(u,1),i.push(r),this._condense(i),this}!c&&!r.leaf&&jo(r,s)?(i.push(r),o.push(a),a=0,l=r,r=r.children[0]):l?(a++,r=l.children[a],c=!1):r=null}return this}toBBox(t){return t}compareMinX(t,n){return t.minX-n.minX}compareMinY(t,n){return t.minY-n.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,n){const r=[];for(;t;)t.leaf?n.push(...t.children):r.push(...t.children),t=r.pop();return n}_build(t,n,r,s){const i=r-n+1;let o=this._maxEntries,a;if(i<=o)return a=zn(t.slice(n,r+1)),Vn(a,this.toBBox),a;s||(s=Math.ceil(Math.log(i)/Math.log(o)),o=Math.ceil(i/Math.pow(o,s-1))),a=zn([]),a.leaf=!1,a.height=s;const l=Math.ceil(i/o),c=l*Math.ceil(Math.sqrt(o));Yu(t,n,r,c,this.compareMinX);for(let u=n;u<=r;u+=c){const h=Math.min(u+c-1,r);Yu(t,u,h,l,this.compareMinY);for(let d=u;d<=h;d+=l){const m=Math.min(d+l-1,h);a.children.push(this._build(t,d,m,s-1))}}return Vn(a,this.toBBox),a}_chooseSubtree(t,n,r,s){for(;s.push(n),!(n.leaf||s.length-1===r);){let i=1/0,o=1/0,a;for(let l=0;l<n.children.length;l++){const c=n.children[l],u=$o(c),h=k0(t,c)-u;h<o?(o=h,i=u<i?u:i,a=c):h===o&&u<i&&(i=u,a=c)}n=a||n.children[0]}return n}_insert(t,n,r){const s=r?t:this.toBBox(t),i=[],o=this._chooseSubtree(s,this.data,n,i);for(o.children.push(t),Lr(o,s);n>=0&&i[n].children.length>this._maxEntries;)this._split(i,n),n--;this._adjustParentBBoxes(s,i,n)}_split(t,n){const r=t[n],s=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,s);const o=this._chooseSplitIndex(r,i,s),a=zn(r.children.splice(o,r.children.length-o));a.height=r.height,a.leaf=r.leaf,Vn(r,this.toBBox),Vn(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(r,a)}_splitRoot(t,n){this.data=zn([t,n]),this.data.height=t.height+1,this.data.leaf=!1,Vn(this.data,this.toBBox)}_chooseSplitIndex(t,n,r){let s,i=1/0,o=1/0;for(let a=n;a<=r-n;a++){const l=Dr(t,0,a,this.toBBox),c=Dr(t,a,r,this.toBBox),u=F0(l,c),h=$o(l)+$o(c);u<i?(i=u,s=a,o=h<o?h:o):u===i&&h<o&&(o=h,s=a)}return s||r-n}_chooseSplitAxis(t,n,r){const s=t.leaf?this.compareMinX:U0,i=t.leaf?this.compareMinY:P0,o=this._allDistMargin(t,n,r,s),a=this._allDistMargin(t,n,r,i);o<a&&t.children.sort(s)}_allDistMargin(t,n,r,s){t.children.sort(s);const i=this.toBBox,o=Dr(t,0,n,i),a=Dr(t,r-n,r,i);let l=zs(o)+zs(a);for(let c=n;c<r-n;c++){const u=t.children[c];Lr(o,t.leaf?i(u):u),l+=zs(o)}for(let c=r-n-1;c>=n;c--){const u=t.children[c];Lr(a,t.leaf?i(u):u),l+=zs(a)}return l}_adjustParentBBoxes(t,n,r){for(let s=r;s>=0;s--)Lr(n[s],t)}_condense(t){for(let n=t.length-1,r;n>=0;n--)t[n].children.length===0?n>0?(r=t[n-1].children,r.splice(r.indexOf(t[n]),1)):this.clear():Vn(t[n],this.toBBox)}}function L0(e,t,n){if(!n)return t.indexOf(e);for(let r=0;r<t.length;r++)if(n(e,t[r]))return r;return-1}function Vn(e,t){Dr(e,0,e.children.length,t,e)}function Dr(e,t,n,r,s){s||(s=zn(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(let i=t;i<n;i++){const o=e.children[i];Lr(s,e.leaf?r(o):o)}return s}function Lr(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function U0(e,t){return e.minX-t.minX}function P0(e,t){return e.minY-t.minY}function $o(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function zs(e){return e.maxX-e.minX+(e.maxY-e.minY)}function k0(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function F0(e,t){const n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),s=Math.min(e.maxX,t.maxX),i=Math.min(e.maxY,t.maxY);return Math.max(0,s-n)*Math.max(0,i-r)}function jo(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function Gs(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function zn(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Yu(e,t,n,r,s){const i=[t,n];for(;i.length;){if(n=i.pop(),t=i.pop(),n-t<=r)continue;const o=t+Math.ceil((n-t)/r/2)*r;Wu(e,o,t,n,s),i.push(t,o,o,n)}}function x0(e,t,n,r=!1){if(t===0&&n===0)return e;let s={...e};const i=s.startAbsoluteRefType||Me.NONE,o=s.endAbsoluteRefType||Me.NONE,a=s.rangeType||pe.NORMAL;if(!r&&i===Me.ALL&&o===Me.ALL)return s;const l=Vu(s.startRow,n,s.startColumn,t,a),c=Vu(s.endRow,n,s.endColumn,t,a);return r||i===Me.NONE&&o===Me.NONE?s={...s,startRow:l.row,startColumn:l.column,endRow:c.row,endColumn:c.column}:(i===Me.NONE?s={...s,startRow:l.row,startColumn:l.column}:i===Me.COLUMN?s={...s,startRow:l.row}:i===Me.ROW&&(s={...s,startColumn:l.column}),o===Me.NONE?s={...s,endRow:c.row,endColumn:c.column}:o===Me.COLUMN?s={...s,endRow:c.row}:o===Me.ROW&&(s={...s,endColumn:c.column}),s)}function Vu(e,t,n,r,s){return s===pe.NORMAL?{row:e+t,column:n+r}:s===pe.ROW?{row:e+t,column:n}:s===pe.COLUMN?{row:e,column:n+r}:{row:e,column:n}}function Wo(e){const t=new Set,n=new Set;for(const o of e)t.add(o.startColumn),t.add(o.endColumn+1),n.add(o.startRow),n.add(o.endRow+1);const r=Array.from(t).sort((o,a)=>o-a),s=Array.from(n).sort((o,a)=>o-a);e.sort((o,a)=>o.startRow-a.startRow||o.startColumn-a.startColumn);const i=[];for(let o=0;o<s.length-1;o++)for(let a=0;a<r.length-1;a++){const l=r[a],c=r[a+1]-1,u=s[o],h=s[o+1]-1;for(const d of e){if(d.startRow>h)break;if(d.startRow<=u&&d.endRow>=h&&d.startColumn<=l&&d.endColumn>=c){i.push({startColumn:l,endColumn:c,startRow:u,endRow:h});break}}}return i}function H0(e){e.sort((r,s)=>r.startRow-s.startRow||r.startColumn-s.startColumn);const t={};for(const r of e)t[r.startRow]||(t[r.startRow]=[]),t[r.startRow].push(r);const n=[];for(const r in t){const s=t[+r];s.sort((o,a)=>o.startColumn-a.startColumn);let i=s[0];for(let o=1;o<s.length;o++){const a=s[o];a.startColumn<=i.endColumn+1&&a.startRow===i.startRow&&a.endRow===i.endRow?i.endColumn=Math.max(i.endColumn,a.endColumn):(n.push(i),i=a)}n.push(i)}return n}function B0(e){e.sort((r,s)=>r.startColumn-s.startColumn||r.startRow-s.startRow);const t={};for(const r of e)t[r.startColumn]||(t[r.startColumn]=[]),t[r.startColumn].push(r);const n=[];for(const r in t){const s=t[+r];s.sort((o,a)=>o.startRow-a.startRow);let i=s[0];for(let o=1;o<s.length;o++){const a=s[o];a.startRow<=i.endRow+1&&a.startColumn===i.startColumn&&a.endColumn===i.endColumn?i.endRow=Math.max(i.endRow,a.endRow):(n.push(i),i=a)}n.push(i)}return n}function $0(e){const t=Wo(e),n=H0(t);return B0(n)}function j0(e,t){const n=[];return e.forEach(r=>{n.push(...Yt.subtract(r,t))}),Yt.mergeRanges(n)}function zu(e,t){const n=Gu(e.startRow,e.endRow,t.startRow,t.endRow),r=Gu(e.startColumn,e.endColumn,t.startColumn,t.endColumn);if(!n||!r)return null;const[s,i]=n,[o,a]=r,l=W0(e.rangeType,t.rangeType,s,i,o,a);return{startRow:s,endRow:i,startColumn:o,endColumn:a,rangeType:l}}function Gu(e,t,n,r){const s=isNaN(e)?-1/0:e,i=isNaN(t)?1/0:t,o=isNaN(n)?-1/0:n,a=isNaN(r)?1/0:r,l=Math.max(s,o),c=Math.min(i,a);if(l<=c){const u=l===-1/0?Number.NaN:l,h=c===1/0?Number.NaN:c;return[u,h]}else return null}function W0(e,t,n,r,s,i){const o=e!==void 0?e:Ku(n,r,s,i),a=t!==void 0?t:Ku(n,r,s,i);return o===pe.ALL||a===pe.ALL?o===a?o:o===pe.ALL?a:o:o===a?o:(o===pe.NORMAL||a===pe.NORMAL,pe.NORMAL)}function Ku(e,t,n,r){const s=!isNaN(e)&&!isNaN(t),i=!isNaN(n)&&!isNaN(r);return s&&i?pe.NORMAL:s?pe.ROW:i?pe.COLUMN:pe.ALL}const zt=class zt{static clone(t){return t.rangeType!==void 0?{startRow:t.startRow,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn,rangeType:t.rangeType}:{startRow:t.startRow,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn}}static equals(t,n){return t==null||n==null?!1:t.endRow===n.endRow&&t.endColumn===n.endColumn&&t.startRow===n.startRow&&t.startColumn===n.startColumn&&(t.rangeType===n.rangeType||t.rangeType===void 0&&n.rangeType===pe.NORMAL||n.rangeType===void 0&&t.rangeType===pe.NORMAL)}static simpleRangesIntersect(t,n){const{startRow:r,endRow:s,startColumn:i,endColumn:o}=t,{startRow:a,endRow:l,startColumn:c,endColumn:u}=n,h=r<=l&&s>=a,d=i<=u&&o>=c;return h&&d}static intersects(t,n){if(t.rangeType===pe.ROW&&n.rangeType===pe.COLUMN||t.rangeType===pe.COLUMN&&n.rangeType===pe.ROW)return!0;if(t.rangeType===pe.ROW&&n.rangeType===pe.ROW)return t.startRow<=n.endRow&&t.endRow>=n.startRow;if(t.rangeType===pe.COLUMN&&n.rangeType===pe.COLUMN)return t.startColumn<=n.endColumn&&t.endColumn>=n.startColumn;const r=Math.floor(Number.MAX_SAFE_INTEGER/10),s=Number.isNaN(t.startRow)?0:t.startRow,i=Number.isNaN(t.endRow)?r:t.endRow,o=Number.isNaN(t.startColumn)?0:t.startColumn,a=Number.isNaN(t.endColumn)?r:t.endColumn,l=Number.isNaN(n.startRow)?0:n.startRow,c=Number.isNaN(n.endRow)?r:n.endRow,u=Number.isNaN(n.startColumn)?0:n.startColumn,h=Number.isNaN(n.endColumn)?r:n.endColumn,d=Math.abs(o+a-u-h),m=Math.abs(o-a)+Math.abs(u-h),_=Math.abs(s+i-l-c),p=Math.abs(s-i)+Math.abs(l-c);return d<=m&&_<=p}static doAnyRangesIntersect(t,n){const r=new Vs;return r.load(t.map(s=>({minX:s.startColumn,minY:s.startRow,maxX:s.endColumn,maxY:s.endRow}))),n.some(s=>r.search({minX:s.startColumn,minY:s.startRow,maxX:s.endColumn,maxY:s.endRow}).length>0)}static getIntersects(t,n){const r=t.startRow,s=t.endRow,i=t.startColumn,o=t.endColumn,a=n.startRow,l=n.endRow,c=n.startColumn,u=n.endColumn;let h,d,m,_;if(a<=s)a>=r?d=a:d=r;else return null;if(l>=r)l>=s?_=s:_=l;else return null;if(c<=o)c>i?h=c:h=i;else return null;if(u>=i)u>=o?m=o:m=u;else return null;return{startRow:d,endRow:_,startColumn:h,endColumn:m,rangeType:pe.NORMAL}}static contains(t,n){return t.startRow<=n.startRow&&t.endRow>=n.endRow&&t.startColumn<=n.startColumn&&t.endColumn>=n.endColumn}static realContain(t,n){return zt.contains(t,n)&&(t.startRow<n.startRow||t.endRow>n.endRow||t.startColumn<n.startColumn||t.endColumn>n.endColumn)}static union(...t){return t.reduce((n,r)=>({startRow:Math.min(n.startRow,r.startRow),startColumn:Math.min(n.startColumn,r.startColumn),endRow:Math.max(n.endRow,r.endRow),endColumn:Math.max(n.endColumn,r.endColumn),rangeType:pe.NORMAL}),t[0])}static realUnion(...t){const n=t.some(i=>i.rangeType===pe.COLUMN),r=t.some(i=>i.rangeType===pe.ROW),s=zt.union(...t);return{startColumn:r?Number.NaN:s.startColumn,endColumn:r?Number.NaN:s.endColumn,startRow:n?Number.NaN:s.startRow,endRow:n?Number.NaN:s.endRow,rangeType:r?pe.ROW:n?pe.COLUMN:pe.NORMAL}}static subtract(t,n){if(n.startRow>t.endRow||n.endRow<t.startRow||n.startColumn>t.endColumn||n.endColumn<t.startColumn)return[t];const r=[];n.startRow>=t.startRow&&r.push({startRow:t.startRow,startColumn:t.startColumn,endRow:n.startRow-1,endColumn:t.endColumn}),n.endRow<=t.endRow&&r.push({startRow:n.endRow+1,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn});const s=Math.max(t.startRow,n.startRow),i=Math.min(t.endRow,n.endRow);return n.startColumn>=t.startColumn&&r.push({startRow:s,startColumn:t.startColumn,endRow:i,endColumn:n.startColumn-1}),n.endColumn<=t.endColumn&&r.push({startRow:s,startColumn:n.endColumn+1,endRow:i,endColumn:t.endColumn}),r.filter(a=>a.startRow<=a.endRow&&a.startColumn<=a.endColumn)}static mergeRanges(t){return $0(t)}static splitIntoGrid(t){return Wo(t)}static subtractMulti(t,n){if(!n.length)return t;let r=t;return n.forEach(s=>{r=j0(r,s)}),r}static hasIntersectionBetweenTwoRect(t,n){return!(t.left>n.right||t.right<n.left||t.top>n.bottom||t.bottom<n.top)}static getIntersectionBetweenTwoRect(t,n){const r=Math.max(t.left,n.left),s=Math.min(t.right,n.right),i=Math.max(t.top,n.top),o=Math.min(t.bottom,n.bottom);return s<=r||o<=i?null:{left:r,right:s,top:i,bottom:o,width:s-r,height:o-i}}static sort(t){return t.sort((n,r)=>n.startRow-r.startRow||n.startColumn-r.startColumn)}};E(zt,"getRelativeRange",(t,n)=>({startRow:t.startRow-n.startRow,endRow:t.endRow-t.startRow,startColumn:t.startColumn-n.startColumn,endColumn:t.endColumn-t.startColumn})),E(zt,"getPositionRange",(t,n,r)=>({...r||{},startRow:r&&[Me.ROW,Me.ALL].includes(r.startAbsoluteRefType||0)?r.startRow:t.startRow+n.startRow,endRow:r&&[Me.ROW,Me.ALL].includes(r.endAbsoluteRefType||0)?r.endRow:t.endRow+t.startRow+n.startRow,startColumn:r&&[Me.COLUMN,Me.ALL].includes(r.startAbsoluteRefType||0)?r.startColumn:t.startColumn+n.startColumn,endColumn:r&&[Me.COLUMN,Me.ALL].includes(r.endAbsoluteRefType||0)?r.endColumn:t.endColumn+t.startColumn+n.startColumn})),E(zt,"moveHorizontal",(t,n=0,r=0)=>({...t,startColumn:t.startColumn+n,endColumn:t.endColumn+n+r})),E(zt,"moveVertical",(t,n=0,r=0)=>({...t,startRow:t.startRow+n,endRow:t.endRow+n+r})),E(zt,"moveOffset",(t,n,r)=>{const s={...t};switch(t.startAbsoluteRefType){case Me.ROW:s.startColumn+=n;break;case Me.COLUMN:s.startRow+=r;break;case Me.ALL:break;case Me.NONE:default:s.startRow+=r,s.startColumn+=n;break}switch(t.endAbsoluteRefType){case Me.ROW:s.endColumn+=n;break;case Me.COLUMN:s.endRow+=r;break;case Me.ALL:break;case Me.NONE:default:s.endRow+=r,s.endColumn+=n;break}return s});let Yt=zt;function Y0(e,t){if(e.length===0||e[0].length===0)return null;const n=new Array(e[0].length).fill(0);let r=0,s=null;for(let i=0;i<e.length;i++){for(let a=0;a<e[0].length;a++)n[a]=t(e[i][a])?n[a]+1:0;const o=V0(n);o.area>r&&(r=o.area,s={startColumn:o.start,startRow:i-o.height+1,endColumn:o.end,endRow:i})}return s}function V0(e){const t=[];let n=0,r={area:0,height:0,start:0,end:0},s=0;for(;s<e.length;)if(t.length===0||e[s]>=e[t[t.length-1]])t.push(s++);else{const i=e[t.pop()],o=t.length===0?s:s-t[t.length-1]-1;i*o>n&&(n=i*o,r={area:n,height:i,start:t.length===0?0:t[t.length-1]+1,end:s-1})}for(;t.length>0;){const i=e[t.pop()],o=t.length===0?s:s-t[t.length-1]-1;i*o>n&&(n=i*o,r={area:n,height:i,start:t.length===0?0:t[t.length-1]+1,end:s-1})}return r}function z0(e,t){Yn.foreach(t,(n,r)=>{e[n][r]=void 0})}function G0(e,t){const n=e.toFullArray(),r=[];for(;;){const s=Y0(n,t);if(!s)break;r.push(s),z0(n,s)}return r}class K0{constructor(t,n){E(this,"_values",[]);E(this,"_keys",[]);E(this,"_keyMaps",new Map);this._values=t,this._keys=n,t.forEach(r=>{this._initKeyMap(r)})}_initKeyMap(t){this._keys.forEach(n=>{const r=t[n],s=this._keyMaps.get(n)||new Map;s.set(r,t),this._keyMaps.set(n,s)})}getValue(t,n){const r=n||this._keys;for(let s=0;s<r.length;s++){const i=this._keyMaps.get(r[s]);if(i!=null&&i.has(t))return i.get(t)}return null}hasValue(t){for(let n=0;n<this._keys.length;n++){const r=this._keyMaps.get(this._keys[n]);if(r!=null&&r.has(t))return!0}return!1}addValue(t){this._values.push(t),this._initKeyMap(t)}setValue(t,n,r){const s=this.getValue(t);s&&Object.keys(s).includes(n)&&(s[n]=r)}deleteValue(t,n){const r=this.getValue(t,n);if(r){this._keys.forEach(i=>{const o=this._keyMaps.get(i),a=r[i];o==null||o.delete(a)});const s=this._values.findIndex(i=>i===r);this._values.splice(s,1)}}getValues(){return this._values}getKeyMap(t){var n;return[...((n=this._keyMaps.get(t))==null?void 0:n.keys())||[]]}clear(){this._values=[],this._keys=[],this._keyMaps.clear()}}function Yo(e,t,n,r){return{forEach(s){for(let i=e;i<=t;i++)for(let o=n;o<=r;o++)s(i,o)}}}function X0(e){if(e==null||e.length===0)return Number.NaN;const t=e.toLowerCase().split(""),n=t.length,r=o=>o.charCodeAt(0)-96;let s=0,i=0;for(let o=0;o<n;o++)i=r(t[o]),s+=i*26**(n-o-1);return s===0?Number.NaN:s-1}const Ks=65,Xu=90,q0=97;function J0(e){const t=Xu-Ks+1;let n="";for(;e>=0;)n=String.fromCharCode(e%t+Ks)+n,e=Math.floor(e/t)-1;return n}function qu(e,t){let n="";for(;t>0;)n+=e,t--;return n}function Z0(e,t=!1){const n=Xu-Ks+1;let r=q0;t&&(r=Ks);const s=String.fromCharCode(e%n+r),i=Math.floor(e/n)+1;return qu(s,i)}function Q0(e,t){return e.zIndex>t.zIndex?1:e.zIndex===t.zIndex?0:-1}function eC(e,t){return e.zIndex>t.zIndex?-1:e.zIndex===t.zIndex?0:1}function Ur(e="index",t=1){return(n,r)=>n[e]>r[e]?t:n[e]===r[e]?0:-t}function Pr(e,t=!1){const n=[];for(const r of e){const{st:s,ed:i,ts:o}=r;if(r.sId===void 0&&delete r.sId,s===i||!t&&Z.isEmptyObject(o)&&r.sId==null)continue;if(n.length===0){n.push(r);continue}const a=n.pop();yu(r,a)&&Z.hasIntersectionBetweenTwoRanges(a.st,a.ed,r.st,r.ed)?n.push({...r,st:a.st,ed:i}):n.push(a,r)}return n}function Ju(e,t,n,r){var c;const{textRuns:s}=e;if(s==null)return;const i=[],o=s.length;let a=!1;const l=(c=t.textRuns)!=null?c:[];if(l.length)for(const u of l)u.st+=r,u.ed+=r;for(let u=0;u<o;u++){const h=s[u],{st:d,ed:m}=h;if(m<=r)i.push(h);else if(r>d&&r<m){a=!0;const _={...h,ed:r};i.push(_),l.length&&i.push(...l);const p={...h,st:r+n,ed:m+n};i.push(p)}else h.st+=n,h.ed+=n,a||(a=!0,i.push(...l)),i.push(h)}a||(a=!0,i.push(...l)),e.textRuns=Pr(i)}function Zu(e,t,n,r){const{paragraphs:s}=e;if(s==null)return;const{paragraphs:i}=t,o=[];for(let l=0,c=s.length;l<c;l++){const u=s[l],{startIndex:h}=u;h>=r&&(u.startIndex+=n),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(Ur("startIndex"))}}function Qu(e,t,n,r){const{sectionBreaks:s}=e;if(s==null)return;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=n)}const i=t.sectionBreaks;if(i){for(let o=0,a=i.length;o<a;o++){const l=i[o];l.startIndex+=r}s.push(...i),s.sort(Ur("startIndex"))}}function eh(e,t,n,r){const{customBlocks:s=[]}=e;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=n)}const i=t.customBlocks;if(i){for(let o=0,a=i.length;o<a;o++){const l=i[o];l.startIndex+=r}s.push(...i),s.sort(Ur("startIndex"))}s.length&&!e.customBlocks&&(e.customBlocks=s)}function th(e,t,n,r){const{tables:s}=e;if(s==null)return;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c,endIndex:u}=l;c>r?(l.startIndex+=n,l.endIndex+=n):u>r&&(l.endIndex+=n)}const i=t.tables;if(i){for(let o=0,a=i.length;o<a;o++){const l=i[o];l.startIndex+=r,l.endIndex+=r}s.push(...i),s.sort(Ur("startIndex"))}}const nh="$",rh=e=>e.split(nh)[0];function Vo(e){if(e.length<=1)return e;e.sort((s,i)=>s.startIndex-i.startIndex);const t=[];let n={...e[0]};n.rangeId=rh(n.rangeId);for(let s=1;s<e.length;s++){const i=e[s];i.rangeId=rh(i.rangeId),i.rangeId===n.rangeId&&Ta(n.properties,i.properties)&&n.endIndex+1>=i.startIndex?n.endIndex=i.endIndex:(t.push(n),n={...i})}t.push(n);const r=Object.create(null);for(let s=0,i=t.length;s<i;s++){const o=t[s],a=o.rangeId;r[a]?(o.rangeId=`${a}${nh}${r[a]}`,r[a]=r[a]+1):r[a]=1}return t}function zo(e,t){const n=e.findIndex(s=>s.startIndex<t&&s.endIndex>=t),r=e[n];r&&e.splice(n,1,{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:r.startIndex,endIndex:t-1,properties:{...r.properties}},{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:t,endIndex:r.endIndex,properties:{...r.properties}})}function sh(e){if(e.length<=1)return e;e.sort((r,s)=>r.startIndex-s.startIndex);const t=[];let n={...e[0]};for(let r=1;r<e.length;r++){const s=e[r];s.id===n.id&&n.endIndex+1>=s.startIndex?n.endIndex=s.endIndex:(t.push(n),n={...s})}return t.push(n),t}function Go(e,t){e.filter(r=>r.startIndex<t&&r.endIndex>=t).forEach(r=>{const s=e.indexOf(r);e.splice(s,1,{id:r.id,type:r.type,startIndex:r.startIndex,endIndex:t-1},{id:r.id,type:r.type,startIndex:t,endIndex:r.endIndex})})}function tC(e,t,n,r){e.customRanges||(e.customRanges=[]);const{customRanges:s}=e;zo(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=n,l.endIndex+=n)}const i=[];if(t.customRanges){for(let o=0,a=t.customRanges.length;o<a;o++){const l=t.customRanges[o];l.startIndex+=r,l.endIndex+=r,i.push(l)}s.push(...i)}e.customRanges=Vo(s)}function nC(e,t,n,r){e.customDecorations||(e.customDecorations=[]);const{customDecorations:s}=e;Go(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=n,l.endIndex+=n)}const i=[];if(t.customDecorations){for(let o=0,a=t.customDecorations.length;o<a;o++){const l=t.customDecorations[o];l.startIndex+=r,l.endIndex+=r,i.push(l)}s.push(...i)}e.customDecorations=sh(s)}function ih(e,t,n){const{textRuns:r}=e,s=n,i=n+t,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{st:h,ed:d}=u;if(s<=h&&i>=d){o.push({...u,st:h-s,ed:d-s});continue}else h<=s&&d>=i?(o.push({...u,st:s-s,ed:i-s}),u.ed-=t):s>=h&&s<d?(o.push({...u,st:s-s,ed:d-s}),u.ed=s):i>h&&i<=d?(o.push({...u,st:h-s,ed:i-s}),u.st=i-t,u.ed-=t):h>=i&&(u.st-=t,u.ed-=t);a.push(u)}e.textRuns=a}return o.length===0&&o.push({st:0,ed:t,ts:{}}),o}function oh(e,t,n){const{paragraphs:r}=e,s=n,i=n+t,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{startIndex:h}=u;if(h>=s&&h<i){o.push({...u,startIndex:h-n});continue}else h>=i&&(u.startIndex-=t);a.push(u)}e.paragraphs=a}return o}function ah(e,t,n){const{sectionBreaks:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{startIndex:h}=u;if(h>=s&&h<=i){o.push({...u,startIndex:h-n});continue}else h>i&&(u.startIndex-=t);a.push(u)}e.sectionBreaks=a}return o}function lh(e,t,n){const{customBlocks:r=[]}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{startIndex:h}=u;if(h>=s&&h<=i){o.push({...u,startIndex:h-n});continue}else h>i&&(u.startIndex-=t);a.push(u)}e.customBlocks=a}return r.length&&!e.customBlocks&&(e.customBlocks=r),o}function ch(e,t,n){const{tables:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{startIndex:h,endIndex:d}=u;if(s<=h&&i>=d){o.push({...u,startIndex:h-n,endIndex:d-n});continue}else if(h<=s&&d>=i){const m=Ws(h,d,s,i);if(m.length===0||(u.startIndex=m[0],u.endIndex=m[1],u.startIndex===u.endIndex))continue}else i<h&&(u.startIndex-=t,u.endIndex-=t);a.push(u)}e.tables=a}return o}function rC(e,t,n){const{customRanges:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{startIndex:h,endIndex:d}=u;if(h>=s&&d<=i){o.push(u);continue}else if(Math.max(s,h)<=Math.min(i,d)){const m=Ws(h,d,s,i);if(m.length===0)continue;u.startIndex=m[0],u.endIndex=m[1]}else i<h&&(u.startIndex-=t,u.endIndex-=t);a.push(u)}e.customRanges=Vo(a)}return o}function sC(e,t,n,r=!0){const{customDecorations:s}=e,i=n,o=n+t-1,a=[];if(s){const l=[];for(let c=0,u=s.length;c<u;c++){const h=s[c],{startIndex:d,endIndex:m}=h;if(d>=i&&m<=o){a.push(h);continue}else if(Math.max(i,d)<=Math.min(o,m)){const _=Ws(d,m,i,o);if(_.length===0)continue;h.startIndex=_[0],h.endIndex=_[1]}else o<d&&r&&(h.startIndex-=t,h.endIndex-=t);l.push(h)}e.customDecorations=l}return a}var uh=(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.BULLET_LIST="*",e))(uh||{}),xt=(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))(xt||{});const Xs={"a)":{glyphFormat:"%1)",glyphType:fe.DECIMAL},"1.":{glyphType:fe.DECIMAL},"a.":{glyphFormat:"%1.",glyphType:fe.LOWER_LETTER},"A.":{glyphType:fe.UPPER_LETTER},"i.":{glyphFormat:"%1.",glyphType:fe.LOWER_ROMAN},"I.":{glyphFormat:"%1.",glyphType:fe.UPPER_LETTER}},Gn=e=>[...e,...e,...e].map((t,n)=>({glyphFormat:` %${n+1}`,glyphSymbol:t,bulletAlignment:hr.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*n}}})),Kn=e=>e.map((t,n)=>({...t,bulletAlignment:hr.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*n}}})),hh=(e,t)=>new Array(9).fill(0).map((n,r)=>({glyphFormat:` %${r+1}`,glyphSymbol:e,bulletAlignment:hr.START,textStyle:{fs:16},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*r},textStyle:t}})),kr={BULLET_LIST:{listType:"BULLET_LIST",nestingLevel:Gn(["●","○","■"])},BULLET_LIST_1:{listType:"BULLET_LIST",nestingLevel:Gn(["❖","➢","■"])},BULLET_LIST_2:{listType:"BULLET_LIST",nestingLevel:Gn(["✔","●","◆"])},BULLET_LIST_3:{listType:"BULLET_LIST",nestingLevel:Gn(["■","◆","○"])},BULLET_LIST_4:{listType:"BULLET_LIST",nestingLevel:Gn(["✧","○","■"])},BULLET_LIST_5:{listType:"BULLET_LIST",nestingLevel:Gn(["➢","○","◆"])},ORDER_LIST:{listType:"ORDER_LIST",nestingLevel:Kn([{glyphFormat:"%1.",glyphType:fe.DECIMAL},{glyphFormat:"%2.",glyphType:fe.LOWER_LETTER},{glyphFormat:"%3.",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:fe.DECIMAL},{glyphFormat:"%5.",glyphType:fe.LOWER_LETTER},{glyphFormat:"%6.",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:fe.DECIMAL},{glyphFormat:"%8.",glyphType:fe.LOWER_LETTER},{glyphFormat:"%9.",glyphType:fe.LOWER_ROMAN}])},ORDER_LIST_1:{listType:"ORDER_LIST",nestingLevel:Kn([{glyphFormat:"%1)",glyphType:fe.DECIMAL},{glyphFormat:"%2)",glyphType:fe.LOWER_LETTER},{glyphFormat:"%3)",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%4)",glyphType:fe.DECIMAL},{glyphFormat:"%5)",glyphType:fe.LOWER_LETTER},{glyphFormat:"%6)",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%7)",glyphType:fe.DECIMAL},{glyphFormat:"%8)",glyphType:fe.LOWER_LETTER},{glyphFormat:"%9)",glyphType:fe.LOWER_ROMAN}])},ORDER_LIST_2:{listType:"ORDER_LIST",nestingLevel:Kn(["%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:fe.DECIMAL})))},ORDER_LIST_3:{listType:"ORDER_LIST",nestingLevel:Kn([{glyphFormat:"%1.",glyphType:fe.UPPER_LETTER},{glyphFormat:"%2.",glyphType:fe.LOWER_LETTER},{glyphFormat:"%3.",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:fe.UPPER_LETTER},{glyphFormat:"%5.",glyphType:fe.LOWER_LETTER},{glyphFormat:"%6.",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:fe.UPPER_LETTER},{glyphFormat:"%8.",glyphType:fe.LOWER_LETTER},{glyphFormat:"%9.",glyphType:fe.LOWER_ROMAN}])},ORDER_LIST_4:{listType:"ORDER_LIST",nestingLevel:Kn([{glyphFormat:"%1.",glyphType:fe.UPPER_LETTER},{glyphFormat:"%2.",glyphType:fe.DECIMAL},{glyphFormat:"%3.",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:fe.UPPER_LETTER},{glyphFormat:"%5.",glyphType:fe.DECIMAL},{glyphFormat:"%6.",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:fe.UPPER_LETTER},{glyphFormat:"%8.",glyphType:fe.DECIMAL},{glyphFormat:"%9.",glyphType:fe.LOWER_ROMAN}])},ORDER_LIST_5:{listType:"ORDER_LIST",nestingLevel:Kn([{glyphFormat:"%1.",glyphType:fe.DECIMAL_ZERO},{glyphFormat:"%2.",glyphType:fe.LOWER_LETTER},{glyphFormat:"%3.",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:fe.DECIMAL_ZERO},{glyphFormat:"%5.",glyphType:fe.LOWER_LETTER},{glyphFormat:"%6.",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:fe.DECIMAL_ZERO},{glyphFormat:"%8.",glyphType:fe.LOWER_LETTER},{glyphFormat:"%9.",glyphType:fe.LOWER_ROMAN}])},CHECK_LIST:{listType:"CHECK_LIST",nestingLevel:hh("☐")},CHECK_LIST_CHECKED:{listType:"CHECK_LIST_CHECKED",nestingLevel:hh("☑",{st:{s:ae.TRUE}})}},qs=e=>{const{glyphFormat:t,glyphType:n}=e,r=Z.deepClone(kr.ORDER_LIST);return r.nestingLevel[0].glyphFormat=t,r.nestingLevel[0].glyphType=n,r},iC={ORDER_LIST_QUICK_2:qs(Xs["a)"]),ORDER_LIST_QUICK_3:qs(Xs["a."]),ORDER_LIST_QUICK_4:qs(Xs["i."]),ORDER_LIST_QUICK_6:qs(Xs["I."])};Object.assign(kr,iC);const oC={"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","*":"BULLET_LIST"};function aC(e,t,n,r,s){const i=lC(e,t,n,r,s),o=cC(e,t,n,r,s),a=uC(e,t,n,r,s),l=hC(e,t,n,r,s),c=dC(e,t,n,r,s),u=fC(e,t,n,r),h=mC(e,t,n,r,s);return{dataStream:"",textRuns:i,paragraphs:o,sectionBreaks:a,customBlocks:l,tables:c,customRanges:u,customDecorations:h}}function lC(e,t,n,r,s){const{textRuns:i}=e,{textRuns:o}=t;if(i==null||o==null)return;const a=ih(e,n,r);if(s!==Re.REPLACE){const l=dh(o,a,s);t.textRuns=l}return Ju(e,t,n,r),a}function dh(e,t,n){if(t.length===0)return e;e=Z.deepClone(e),t=Z.deepClone(t);const r=[],s=e.length,i=t.length;let o=0,a=0,l=null;function c(){return l?(r.push(l),l=null,!0):!1}for(;o<s&&a<i;){const{st:m,ed:_,ts:p}=e[o],{st:I,ed:y,ts:H,sId:x}=t[a];let Y;if(n===Re.COVER?Y={...H,...p}:Y={...p},_<I)c()||r.push(e[o]),o++;else if(y<m)c()||r.push(t[a]),a++;else{const O={st:Math.min(m,I),ed:Math.max(m,I),ts:m<I?{...p}:{...H},sId:m<I?void 0:x};O.ed>O.st&&r.push(O),r.push({st:Math.max(m,I),ed:Math.min(_,y),ts:Y,sId:x}),_<y?(o++,t[a].st=_,t[a].st===t[a].ed&&a++):(a++,e[o].st=y,e[o].st===e[o].ed&&o++);const R={st:Math.min(_,y),ed:Math.max(_,y),ts:_<y?{...H}:{...p},sId:_<y?x:void 0};l=R.ed>R.st?R:null}}c();const u=r[r.length-1],h=e[s-1],d=t[i-1];return u&&u.ed!==Math.max(h.ed,d.ed)&&(h.ed>d.ed?r.push(h):r.push(d)),Pr(r)}function cC(e,t,n,r,s){const{paragraphs:i}=e,{paragraphs:o}=t;if(i==null||o==null)return;const a=oh(e,n,r);if(s!==Re.REPLACE){const l=[];for(const c of o){const{startIndex:u,paragraphStyle:h,bullet:d}=c;let m=[];for(const _ of a){const{startIndex:p,paragraphStyle:I,bullet:y}=_;let H,x;if(s===Re.COVER?(H={...I,...h},x={listId:"",listType:xt.BULLET_LIST,nestingLevel:0,textStyle:{},...y,...d}):(H={...h,...I},x={listId:"",listType:xt.BULLET_LIST,nestingLevel:0,textStyle:{},...d,...y}),u===p){m.push({startIndex:u,paragraphStyle:H,bullet:x});break}}l.push(...m),m=[]}t.paragraphs=l}return Zu(e,t,n,r),a}function uC(e,t,n,r,s){const{sectionBreaks:i}=e,{sectionBreaks:o}=t;if(i==null||o==null)return;const a=ah(e,n,r);if(s!==Re.REPLACE){const l=[];for(const c of o){const{startIndex:u}=c;let h=[];for(const d of a){const{startIndex:m}=d;if(u===m){s===Re.COVER?h.push({...d,...c}):h.push({...c,...d});break}}l.push(...h),h=[]}t.sectionBreaks=l}return Qu(e,t,n,r),a}function hC(e,t,n,r,s){const{customBlocks:i=[]}=e,{customBlocks:o}=t;if(i==null||o==null)return;const a=lh(e,n,r);if(s!==Re.REPLACE){const l=[];for(const c of o){const{startIndex:u}=c;let h=[];for(const d of a){const{startIndex:m}=d;if(u===m){s===Re.COVER?h.push({...d,...c}):h.push({...c,...d});break}}l.push(...h),h=[]}t.customBlocks=l}return eh(e,t,n,r),i.length&&!e.customBlocks&&(e.customBlocks=i),a}function dC(e,t,n,r,s){const{tables:i}=e,{tables:o}=t;if(i==null||o==null)return;const a=ch(e,n,r);if(s!==Re.REPLACE){const l=[];for(const c of o){const{startIndex:u,endIndex:h}=c;let d=[];for(const m of a){const{startIndex:_,endIndex:p}=m;if(_>=u&&p<=h){s===Re.COVER?d.push({...m,...c}):d.push({...c,...m});break}}l.push(...d),d=[]}t.tables=l}return th(e,t,n,r),a}function fC(e,t,n,r,s){e.customRanges||(e.customRanges=[]),zo(e.customRanges,r),zo(e.customRanges,r+n);const i=r,o=r+n-1,{customRanges:a}=t,l=[],c=new Map;e.customRanges.forEach(h=>{const{startIndex:d,endIndex:m}=h;d>=i&&m<=o?c.set(h.rangeId,h):l.push(h)});const u=[];return a?(a.forEach(h=>{const{startIndex:d,endIndex:m}=h;l.push({...h,startIndex:d+r,endIndex:m+r})}),e.customRanges=Vo(l),u):[]}function mC(e,t,n,r,s){e.customDecorations||(e.customDecorations=[]),Go(e.customDecorations,r),Go(e.customDecorations,r+n);const i=[],{customDecorations:o}=e,{customDecorations:a=[]}=t;if(s===Re.REPLACE){for(let l=0;l<o.length;l++){const c=o[l],{startIndex:u,endIndex:h}=c;u>=r&&h<=r+n-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===_n.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=sh(o),i}var Ko=(e=>(e[e.copy=0]="copy",e[e.cut=1]="cut",e))(Ko||{});function Js(e,t,n,r=!0){const{textRuns:s}=e;if(s){const i=[];for(const o of s){const a=Z.deepClone(o),{st:l,ed:c}=a;Z.hasIntersectionBetweenTwoRanges(l,c,t,n)&&(t>=l&&t<=c?i.push({...a,st:t,ed:Math.min(n,c)}):n>=l&&n<=c?i.push({...a,st:Math.max(t,l),ed:n}):i.push(a))}return Pr(i.map(o=>{const{st:a,ed:l}=o;return{...o,st:a-t,ed:l-t}}))}else if(r)return[{st:0,ed:n-t,ts:{}}]}function fh(e,t,n){const{tables:r=[]}=e,s=[];for(const i of r){const o=Z.deepClone(i),{startIndex:a,endIndex:l}=o;a>=t&&l<=n&&s.push({...o,startIndex:a-t,endIndex:l-t})}return s}function mh(e,t,n){const{paragraphs:r=[]}=e,s=[];for(const i of r){const{startIndex:o}=i;if(o>=t&&o<n){const a=Z.deepClone(i);s.push(a)}}if(s.length)return s.map(i=>({...i,startIndex:i.startIndex-t}))}function gC(e,t,n){const{sectionBreaks:r=[]}=e,s=[];for(const i of r){const{startIndex:o}=i;o>=t&&o<=n&&s.push(Z.deepClone(i))}if(s.length)return s.map(i=>({...i,startIndex:i.startIndex-t}))}function gh(e,t,n){const{customBlocks:r=[]}=e,s=[];for(const i of r){const{startIndex:o}=i;o>=t&&o<n&&s.push(Z.deepClone(i))}if(s.length)return s.map(i=>({...i,startIndex:i.startIndex-t}))}function At(e,t,n,r=!0,s=1){const{dataStream:i}=e,o={dataStream:i.slice(t,n)};o.textRuns=Js(e,t,n,r);const a=fh(e,t,n);if(a.length&&(o.tables=a),o.paragraphs=mh(e,t,n),s===1){const c=ph(e,t,n);c?o.customDecorations=c:r&&(o.customDecorations=[])}const{customRanges:l}=_h(e,t,n);return l?o.customRanges=l:r&&(o.customRanges=[]),o.customBlocks=gh(e,t,n),o}function _C(e){const{dataStream:t,textRuns:n,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>t.length-1&&(l=Math.max(l,u.endIndex-t.length+1))});const c=`${t}`;return n&&(n[0]&&(n[0].st=n[0].st-a),n[n.length-1]&&(n[n.length-1].ed=n[n.length-1].ed+l)),n==null||n.forEach(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:n,paragraphs:r,customRanges:s,customDecorations:i,tables:o}}function _h(e,t,n){if(e.customRanges==null)return{};const{customRanges:r}=e;return{customRanges:r.filter(a=>Math.max(a.startIndex,t)<=Math.min(a.endIndex,n-1)).map(a=>({...a,startIndex:Math.max(a.startIndex,t),endIndex:Math.min(a.endIndex,n-1)})).map(a=>({...a,startIndex:a.startIndex-t,endIndex:a.endIndex-t})),leftOffset:0,rightOffset:0}}function ph(e,t,n){if(e.customDecorations==null)return;const{customDecorations:r=[]}=e,s=[];return r.forEach(i=>{if(Math.max(i.startIndex,t)<=Math.min(i.endIndex,n-1)){const o=Z.deepClone(i);s.push({...o,startIndex:Math.max(o.startIndex-t,0),endIndex:Math.min(o.endIndex,n-1)-t})}}),s}function pC(e,t,n){return e==null||t==null?e!=null?e:t:dh(e,t,n)}function EC(e,t,n){if(e==null||t==null)return e!=null?e:t;if(t.length===0||e.length===0)return e;if(t.length>1||e.length>1)throw new Error("Cannot cover multiple customRanges");return n===Re.REPLACE?[{...e[0]}]:[{...t[0],...e[0]}]}function CC(e,t,n){return t.length===0||e.length===0||n===Re.REPLACE?e:[...e,...t.filter(r=>!e.some(s=>r.id===s.id))]}function Xo(e,t,n=Re.COVER){if(t.dataStream!=="")throw new Error("Cannot compose other body with non-empty dataStream");const r={dataStream:e.dataStream},{textRuns:s,paragraphs:i=[],customRanges:o,customDecorations:a=[]}=e,{textRuns:l,paragraphs:c=[],customRanges:u,customDecorations:h=[]}=t;r.textRuns=pC(l,s,n),r.customRanges=EC(u,o,n);const d=CC(h,a,n);d.length&&(r.customDecorations=d);const m=[];let _=0,p=0;for(;_<i.length&&p<c.length;){const I=i[_],y=c[p],{startIndex:H}=I,{startIndex:x}=y;H===x?(m.push(Z.deepMerge(I,y)),_++,p++):H<x?(m.push(Z.deepClone(I)),_++):(m.push(Z.deepClone(y)),p++)}return _<i.length&&m.push(...i.slice(_)),p<c.length&&m.push(...c.slice(p)),m.length&&(r.paragraphs=m),r}function RC(e){const{body:t}=e;if(t==null)return!0;const{textRuns:n,paragraphs:r,customRanges:s,customBlocks:i,customDecorations:o,tables:a}=t;return n==null&&r==null&&s==null&&i==null&&o==null&&a==null}class Xn{constructor(t){E(this,"_index",0);E(this,"_offset",0);this._actions=t}hasNext(){return this.peekLength()<Number.POSITIVE_INFINITY}next(t){t||(t=Number.POSITIVE_INFINITY);const n=this._actions[this._index];if(n){const r=this._offset,s=n.len;return t>=s-r?(t=s-r,this._index+=1,this._offset=0):this._offset+=t,n.t===J.DELETE||n.t===J.RETAIN&&n.body==null?Z.deepClone({...n,len:t}):Z.deepClone({...n,len:t,body:At(n.body,r,r+t,!1)})}else return{t:J.RETAIN,len:Number.POSITIVE_INFINITY}}peek(){return this._actions[this._index]}peekLength(){return this._actions[this._index]?this._actions[this._index].len-this._offset:Number.POSITIVE_INFINITY}peekType(){const t=this._actions[this._index];return t?t.t:J.RETAIN}rest(){if(this.hasNext()){if(this._offset===0)return this._actions.slice(this._index);{const t=this._offset,n=this._index,r=this.next(),s=this._actions.slice(this._index);return this._offset=t,this._index=n,[r].concat(s)}}else return[]}}function Eh(e,t,n){const{dataStream:r}=e,s=n,i=n+t,o=ih(e,t,n),a=oh(e,t,n),l=ah(e,t,n),c=lh(e,t,n),u=ch(e,t,n),h=rC(e,t,n),d=sC(e,t,n);let m="";return r&&(e.dataStream=Hu(r,s,i),m=r.slice(s,i)),{dataStream:m,textRuns:o,paragraphs:a,sectionBreaks:l,customBlocks:c,tables:u,customRanges:h,customDecorations:d}}function Ch(e,t,n,r){e.dataStream=xu(e.dataStream,r,t.dataStream),Ju(e,t,n,r),Zu(e,t,n,r),Qu(e,t,n,r),eh(e,t,n,r),th(e,t,n,r),tC(e,t,n,r),nC(e,t,n,r)}function IC(e,t,n,r,s=Re.COVER){return aC(e,t,n,r,s)}function SC(e,t,n){return t<=0?{dataStream:""}:Eh(e,t,n)}function OC(e,t,n,r){n!==0&&Ch(e,t,n,r)}function wC(e,t){const n=new fn;return n.reset(),t.forEach(r=>{const s=Z.deepClone(r);switch(s.t){case J.RETAIN:{const{coverType:i,body:o,len:a}=s;o!=null&&IC(e,o,a,n.cursor,i),n.moveCursor(a);break}case J.INSERT:{const{body:i,len:o}=s;OC(e,i,o,n.cursor),n.moveCursor(o);break}case J.DELETE:{const{len:i}=s;SC(e,i,n.cursor);break}default:throw new Error(`Unknown action type for action: ${s}.`)}}),e}function vC(e,t,n,r,s){if(e==null||t==null)return t;if(e.length===0||t.length===0)return[];t=Z.deepClone(t),e=Z.deepClone(e);const i=[],o=t.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:p,ed:I,ts:y}=t[l],{st:H,ed:x,ts:Y,sId:O}=e[c];let R={};if(s===0)R={...y},n===Re.COVER&&r===Re.REPLACE&&Y&&(R=Object.assign({},Y,R));else if(R={...y},n===Re.REPLACE){if(r===Re.REPLACE)R={...Y};else if(y&&Y){const b=Object.keys(y);for(const T of b)Y[T]&&delete R[T]}}else if(r===Re.REPLACE){if(Y){const b=Object.keys(Y);for(const T of b)Y[T]!==void 0&&(R[T]=Y[T])}}else if(Y){const b=Object.keys(Y);for(const T of b)R[T]!==void 0&&delete R[T]}if(I<H)h()||i.push(t[l]),l++;else if(x<p)h()||i.push(e[c]),c++;else{const b={st:Math.min(p,H),ed:Math.max(p,H),ts:p<H?{...y}:{...Y}};b.ed>b.st&&i.push(),i.push({st:Math.max(p,H),ed:Math.min(I,x),ts:R,sId:O}),I<x?(l++,e[c].st=I,e[c].st===e[c].ed&&c++):(c++,t[l].st=x,t[l].st===t[l].ed&&l++);const T={st:Math.min(I,x),ed:Math.max(I,x),ts:I<x?{...Y}:{...y},sId:I<x?O:void 0};u=T.ed>T.st?T:null}}h();const d=i[i.length-1],m=t[o-1],_=e[a-1];return d.ed!==Math.max(m.ed,_.ed)&&(m.ed>_.ed?i.push(m):i.push(_)),Pr(i,!0)}function bC(e,t,n,r,s){if(e==null||t==null)return t;if(e.length===0||t.length===0)return[];if(e.length>1||t.length>1)throw new Error("CustomRanges is only supported transform for length one now.");const i=e[0],o=t[0];if(n===Re.REPLACE)return s===1?[Z.deepClone(i)]:[Z.deepClone(o)];if(r===Re.REPLACE){const a=Z.deepClone(o);return s===1&&Object.assign(a,Z.deepClone(i)),[a]}else{const a=Z.deepClone(o);return s===1&&Object.assign(a,Z.deepClone(i)),[a]}}function Rh(e,t,n,r,s){const i={startIndex:t.startIndex};if(t.paragraphStyle&&(i.paragraphStyle=Z.deepClone(t.paragraphStyle),e.paragraphStyle)){if(n===Re.REPLACE)if(r===Re.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===Re.REPLACE)if(s===1){const o=Object.keys(e.paragraphStyle);for(const a of o)e.paragraphStyle[a]!==void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else{const o=Object.keys(e.paragraphStyle);for(const a of o)i.paragraphStyle[a]===void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else if(s===1){const o=Object.keys(e.paragraphStyle);for(const a of o)i.paragraphStyle[a]&&delete i.paragraphStyle[a]}}return n===Re.REPLACE&&r===Re.REPLACE?i.bullet=s===1?Z.deepClone(e.bullet):Z.deepClone(t.bullet):e.bullet===void 0?i.bullet=Z.deepClone(t.bullet):n===Re.REPLACE||r===Re.REPLACE?i.bullet=s===0&&t.bullet?Z.deepClone(t.bullet):Z.deepClone(e.bullet):s===0&&t.bullet!==void 0&&(i.bullet=Z.deepClone(t.bullet)),i}function yC(e,t){if(e==null||t==null)return t;if(e.length===0||t.length===0)return Z.deepClone(t);const n=[];for(const r of t){const{id:s,type:i}=r;let o=!1;for(const a of e)if(a.id===s){(a.type===_n.DELETED||i===_n.DELETED)&&(o=!0,n.push({...r,type:_n.DELETED}));break}o||n.push(r)}return n}function AC(e,t,n=!1){const{body:r,coverType:s=Re.COVER}=e,{body:i,coverType:o=Re.COVER}=t;if(r==null||r.dataStream!==""||i==null||i.dataStream!=="")throw new Error("Data stream is not supported in retain transform.");const a={dataStream:""},l=o,{textRuns:c,paragraphs:u=[],customRanges:h,customDecorations:d}=r,{textRuns:m,paragraphs:_=[],customRanges:p,customDecorations:I}=i,y=vC(c,m,s,o,n?1:0);y&&(a.textRuns=y);const H=bC(h,p,s,o,n?1:0);H&&(a.customRanges=H);const x=yC(d,I);x&&(a.customDecorations=x);const Y=[];let O=0,R=0;for(;O<u.length&&R<_.length;){const b=u[O],T=_[R],{startIndex:B}=b,{startIndex:$}=T;if(B===$){let g={startIndex:B};n?g=Rh(b,T,s,o,1):g=Rh(b,T,s,o,0),Y.push(g),O++,R++}else B<$?O++:(Y.push(Z.deepClone(T)),R++)}return R<_.length&&Y.push(..._.slice(R)),Y.length&&(a.paragraphs=Y),{coverType:l,body:a}}function Ih(e){return Object.keys(e).length===1}const Qn=class Qn{constructor(){E(this,"_actions",[])}static apply(t,n){return wC(t,n)}static compose(t,n){const r=new Xn(t),s=new Xn(n),i=new Qn;for(;r.hasNext()||s.hasNext();)if(s.peekType()===J.INSERT)i.push(s.next());else if(r.peekType()===J.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===J.INSERT&&l.t===J.RETAIN)l.body==null?i.push(a):i.push({...a,body:Xo(a.body,l.body,l.coverType)});else if(a.t===J.RETAIN&&l.t===J.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===Re.REPLACE||l.coverType===Re.REPLACE?Re.REPLACE:Re.COVER;i.push({...a,t:J.RETAIN,coverType:c,body:Xo(a.body,l.body,l.coverType)})}else i.push(a.body?a:l);else a.t===J.RETAIN&&l.t===J.DELETE?i.push(l):a.t===J.INSERT&&(l.t,J.DELETE)}return i.trimEndUselessRetainAction(),i.serialize()}static transform(t,n,r="right"){return this._transform(n,t,r==="left"?"right":"left")}static _transform(t,n,r="right"){const s=new Xn(t),i=new Xn(n),o=new Qn;for(;s.hasNext()||i.hasNext();)if(s.peekType()===J.INSERT&&(r==="left"||i.peekType()!==J.INSERT)){const a=s.next();o.retain(a.len)}else if(i.peekType()===J.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===J.DELETE)continue;if(c.t===J.DELETE){o.push(c);continue}if(l.body==null||c.body==null)o.push(c);else{const{coverType:u,body:h}=AC(l,c,r==="left");o.push({...c,t:J.RETAIN,coverType:u,body:h})}}return o.trimEndUselessRetainAction(),o.serialize()}static transformPosition(t,n,r=!1){const s=new Xn(t);let i=0;for(;s.hasNext()&&i<=n;){const o=s.peekLength(),a=s.peekType();if(s.next(),a===J.DELETE){n-=Math.min(o,n-i);continue}else a===J.INSERT&&(i<n||!r)&&(n+=o);i+=o}return n}static isNoop(t){return t.length===0}static invert(t){const n=[];for(const r of t)if(r.t===J.INSERT)n.push({t:J.DELETE,len:r.len,body:r.body});else if(r.t===J.DELETE){if(r.body==null)throw new Error("Can not invert DELETE action without body property, makeInvertible must be called first.");n.push({t:J.INSERT,body:r.body,len:r.len})}else if(r.body!=null){if(r.oldBody==null)throw new Error("Can not invert RETAIN action without oldBody property, makeInvertible must be called first.");n.push({t:J.RETAIN,body:r.oldBody,oldBody:r.body,len:r.len,coverType:Re.REPLACE})}else n.push(r);return n}static makeInvertible(t,n){const r=[];let s=0;for(const i of t){if(i.t===J.DELETE&&(i.body==null||i.body&&i.body.dataStream.length!==i.len)){const o=At(n,s,s+i.len,!1);i.len=o.dataStream.length,i.body=o}if(i.t===J.RETAIN&&i.body!=null){const o=At(n,s,s+i.len,!0);i.oldBody={...o,dataStream:""},i.len=o.dataStream.length}r.push(i),i.t!==J.INSERT&&(s+=i.len)}return r}insert(t,n){const r={t:J.INSERT,body:n,len:t};return this.push(r),this}retain(t,n,r){const s={t:J.RETAIN,len:t};return n!=null&&(s.body=n),r!=null&&(s.coverType=r),this.push(s),this}delete(t){const n={t:J.DELETE,len:t};return this.push(n),this}empty(){return this._actions=[],this}serialize(){return this._actions}push(...t){if(t.length>1){for(const i of t)this.push(i);return this}let n=this._actions.length,r=this._actions[n-1];const s=Z.deepClone(t[0]);if(s.t===J.RETAIN&&s.len===0&&s.body==null)return this;if(typeof r=="object"){if(r.t===J.DELETE&&s.t===J.DELETE)return r.len+=s.len,this;if(r.t===J.DELETE&&s.t===J.INSERT&&(n-=1,r=this._actions[n-1],r==null))return this._actions.unshift(s),this;if(r.t===J.RETAIN&&s.t===J.RETAIN&&r.body==null&&s.body==null)return r.len+=s.len,this;if(r.t===J.INSERT&&Ih(r.body)&&s.t===J.INSERT&&Ih(s.body))return r.len+=s.len,r.body.dataStream+=s.body.dataStream,this}return n===this._actions.length?this._actions.push(s):this._actions.splice(n,0,s),this}trimEndUselessRetainAction(){let t=this._actions[this._actions.length-1];for(;t&&t.t===J.RETAIN&&RC(t);)this._actions.pop(),t=this._actions[this._actions.length-1];return this}};E(Qn,"id","text-x"),E(Qn,"uri","https://github.com/dream-num/univer#text-x");let De=Qn;Object.defineProperty(De,"name",{value:"text-x"});const er=class er{static registerSubtype(t){var n;t==null||this._subTypes.has(t.name)&&((n=this._subTypes.get(t.name))==null?void 0:n.id)!==De.id||(this._subTypes.set(t.name,t),lt.type.registerSubtype(t))}static apply(t,n){if(!lt.type.isNoop(n))return lt.type.apply(t,n)}static compose(t,n){return lt.type.compose(t,n)}static transform(t,n,r){return lt.type.transform(t,n,r)}static transformPosition(t,n,r="right"){return t&&t.length===2&&t[0]==="body"&&t[1].et===De.name?De.transformPosition(t[1].e,n,r==="left"):n}static invertWithDoc(t,n){return lt.type.invertWithDoc(t,n)}static isNoop(t){return lt.type.isNoop(t)}static getInstance(){return this._instance==null&&(this._instance=new er),this._instance}removeOp(t,n){return lt.removeOp(t,n)}moveOp(t,n){return lt.moveOp(t,n)}insertOp(t,n){return lt.insertOp(t,n)}replaceOp(t,n,r){return lt.replaceOp(t,n,r)}editOp(t,n=["body"]){return lt.editOp(n,De.name,t)}};E(er,"uri","https://github.com/dream-num/univer#json-x"),E(er,"_subTypes",new Map),E(er,"_instance",null);let Vt=er;Vt.registerSubtype(De);var Sh=(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))(Sh||{}),ut=(e=>(e.PARAGRAPH="\r",e.SECTION_BREAK=`
5
- `,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))(ut||{});function TC(e){return`${e}`}const NC=[ut.TABLE_START,ut.TABLE_ROW_START,ut.TABLE_CELL_START,ut.TABLE_CELL_END,ut.TABLE_ROW_END,ut.TABLE_END],Zs=e=>{const t=e.endsWith(`\r
6
- `)?e.slice(0,-2):e;return NC.reduce((n,r)=>n.replaceAll(r,""),t)},MC=e=>e?Zs(e).replaceAll("\r","")==="":!0,DC=e=>{const t=e.replace(/\n/g,"\r"),n=[],r=[];let s=0,i="";const o=(l,c=!0)=>{const u=t.slice(s,l);if(Z.isLegalUrl(u)){const h=nt(),d=`${u}`,m={startIndex:s,endIndex:s+d.length-1,rangeId:h,rangeType:en.HYPERLINK,properties:{url:e}};r.push(m),i+=d,s=l+1,c&&(i+="\r",n.push({startIndex:l}))}else i+=t.slice(s,l+1),s=l+1,c&&n.push({startIndex:l})};let a=0;for(let l=0;l<t.length;l++)t[l]==="\r"&&(o(l),a=l);return(a!==t.length-1||t.length===1)&&o(t.length,!1),{dataStream:i,paragraphs:n,customRanges:r}},qo={id:"default_doc",documentStyle:{}};class LC extends as{constructor(n){var r;super();E(this,"type",ve.UNIVER_DOC);E(this,"_name$",new se.BehaviorSubject(""));E(this,"name$",this._name$.asObservable());E(this,"snapshot");this.snapshot={...qo,...n},this._name$.next((r=this.snapshot.title)!=null?r:"No Title")}getUnitId(){throw new Error("Method not implemented.")}getRev(){var n;return(n=this.snapshot.rev)!=null?n:1}incrementRev(){this.snapshot.rev=this.getRev()+1}setRev(n){this.snapshot.rev=n}setName(n){this.snapshot.title=n,this._name$.next(n)}get drawings(){return this.snapshot.drawings}get documentStyle(){return this.snapshot.documentStyle}get lists(){return this.snapshot.lists}get zoomRatio(){var n;return((n=this.snapshot.settings)==null?void 0:n.zoomRatio)||1}resetDrawing(n,r){this.snapshot.drawings=n,this.snapshot.drawingsOrder=r}getBody(){return this.snapshot.body}getSnapshot(){return this.snapshot}getBulletPresetList(){var s;const n=(s=this.snapshot.lists)!=null?s:{};return{...kr,...n}}updateDocumentId(n){this.snapshot.id=n}updateDocumentRenderConfig(n){const{documentStyle:r}=this.snapshot;r.renderConfig==null?r.renderConfig=n:r.renderConfig={...r.renderConfig,...n}}getDocumentStyle(){return this.snapshot.documentStyle}updateDocumentStyle(n){this.snapshot.documentStyle==null?this.snapshot.documentStyle=n:this.snapshot.documentStyle={...this.snapshot.documentStyle,...n}}updateDocumentDataMargin(n){const{t:r,l:s,b:i,r:o}=n,{documentStyle:a}=this.snapshot;r!=null&&(a.marginTop=r),s!=null&&(a.marginLeft=s),i!=null&&(a.marginBottom=i),o!=null&&(a.marginRight=o)}updateDocumentDataPageSize(n,r){const{documentStyle:s}=this.snapshot;if(!s.pageSize){s.pageSize={width:n!=null?n:Number.POSITIVE_INFINITY,height:r!=null?r:Number.POSITIVE_INFINITY};return}n!==void 0&&(s.pageSize.width=n),r!==void 0&&(s.pageSize.height=r)}updateDrawing(n,r){const{drawings:s}=this,{width:i,height:o,left:a,top:l}=r,c=s==null?void 0:s[n];if(!c)return;const u=c.docTransform;u.size.width=i,u.size.height=o,u.positionH.posOffset=a,u.positionV.posOffset=l}setZoomRatio(n=1){this.snapshot.settings?this.snapshot.settings.zoomRatio=n:this.snapshot.settings={zoomRatio:n}}setDisabled(n){this.snapshot.disabled=n}getDisabled(){return this.snapshot.disabled}getTitle(){return this.snapshot.title}}class Tt extends LC{constructor(n){var s,i;super(Z.isEmptyObject(n)?U_():n);E(this,"_unitId");E(this,"headerModelMap",new Map);E(this,"footerModelMap",new Map);E(this,"change$",new se.BehaviorSubject(0));const r=6;this._unitId=(s=this.snapshot.id)!=null?s:nt(r),this._initializeHeaderFooterModel(),this._name$.next((i=this.snapshot.title)!=null?i:"")}dispose(){super.dispose(),this.headerModelMap.forEach(n=>{n.dispose()}),this.footerModelMap.forEach(n=>{n.dispose()}),this._name$.complete()}getDrawings(){return this.snapshot.drawings}getDrawingsOrder(){return this.snapshot.drawingsOrder}getCustomRanges(){var n;return(n=this.snapshot.body)==null?void 0:n.customRanges}getCustomDecorations(){var n;return(n=this.snapshot.body)==null?void 0:n.customDecorations}getSettings(){return this.snapshot.settings}reset(n){if(n.id&&n.id!==this._unitId)throw new Error("Cannot reset a document model with a different unit id!");this.snapshot={...qo,...n},this._initializeHeaderFooterModel(),this.change$.next(this.change$.value+1)}getSelfOrHeaderFooterModel(n){if(n!=null){if(this.headerModelMap.has(n))return this.headerModelMap.get(n);if(this.footerModelMap.has(n))return this.footerModelMap.get(n)}return this}getUnitId(){return this._unitId}apply(n){if(!Vt.isNoop(n))return this.snapshot=Vt.apply(this.snapshot,n),n!=null&&n.some(r=>Array.isArray(r)&&((r==null?void 0:r[0])==="headers"||(r==null?void 0:r[0])==="footers"))&&(this.headerModelMap.clear(),this.footerModelMap.clear(),this._initializeHeaderFooterModel()),this.change$.next(this.change$.value+1),this.snapshot}sliceBody(n,r,s=Ko.copy){const i=this.getBody();if(i!=null)return At(i,n,r,!1,s)}_initializeHeaderFooterModel(){const{headers:n,footers:r}=this.getSnapshot();if(n)for(const s in n){const i=n[s];this.headerModelMap.set(s,new Tt(i)),this.headerModelMap.get(s).updateDocumentId(this.getUnitId())}if(r)for(const s in r){const i=r[s];this.footerModelMap.set(s,new Tt(i)),this.footerModelMap.get(s).updateDocumentId(this.getUnitId())}}updateDocumentId(n){super.updateDocumentId(n),this._unitId=n}getPlainText(){var n,r;return Zs((r=(n=this.getBody())==null?void 0:n.dataStream)!=null?r:"")}}function UC(e){const{ranges:t,id:n,type:r}=e,s=new De;let i=0;for(let o=0;o<t.length;o++){const a=t[o],{startOffset:l,endOffset:c}=a;l>0&&s.push({t:J.RETAIN,len:l-i}),s.push({t:J.RETAIN,body:{dataStream:"",customDecorations:[{id:n,type:r,startIndex:0,endIndex:c-l-1}]},len:c-l}),i=c}return s}function PC(e){var u,h,d;const{id:t,segmentId:n,documentDataModel:r}=e,s=r==null?void 0:r.getBody();if(!r||!s)return!1;const i=(d=(h=(u=r.getSelfOrHeaderFooterModel(n))==null?void 0:u.getBody())==null?void 0:h.customDecorations)==null?void 0:d.find(m=>m.id===t);if(!i)return!1;const o=new De,{startIndex:a,endIndex:l}=i,c=l-a+1;return o.push({t:J.RETAIN,len:a}),o.push({t:J.RETAIN,len:c,body:{dataStream:"",customDecorations:[{startIndex:0,endIndex:c-1,id:t,type:_n.DELETED}]}}),o}function Oh(e,t,n,r){return e<=n&&t>=n||e>=n&&e<=r}function kC(e,t){const n=[];for(let r=0,s=t.length;r<s;r++){const i=t[r];e.collapsed?i.startIndex<e.startOffset&&e.startOffset<=i.endIndex&&n.push(i):Oh(e.startOffset,e.endOffset-1,i.startIndex,i.endIndex)&&n.push(i)}return n}function FC(e){return{...Z.deepClone(e),rangeId:nt()}}function xC(e,t){const n=[];let r=e[0];for(const s of t)s<e[0]||s>e[1]||(r<s&&n.push([r,s-1]),r=s+1);return r<=e[1]&&n.push([r,e[1]]),n}function wh(e,t,n,r){const s=[];for(let i=0,o=n.length;i<o;i++){const a=n[i];if((r===void 0||a.rangeType===r)&&Math.max(a.startIndex,e)<=Math.min(a.endIndex,t)&&s.push({...a}),a.startIndex>t)break}return s}function HC(e,t){var i,o,a,l,c;const n=wh(e.startOffset,e.collapsed?e.startOffset:e.endOffset-1,(i=t.customRanges)!=null?i:[]),r=Math.min(e.startOffset,(a=(o=n[0])==null?void 0:o.startIndex)!=null?a:1/0),s=Math.max(e.endOffset,((c=(l=n[n.length-1])==null?void 0:l.endIndex)!=null?c:-1/0)+1);return{startOffset:r,endOffset:s,collapsed:r===s}}var Jo,vh;function BC(){if(vh)return Jo;vh=1;var e=-1,t=1,n=0;function r(g,P,w,M,A){if(g===P)return g?[[n,g]]:[];if(w!=null){var v=B(g,P,w);if(v)return v}var N=a(g,P),D=g.substring(0,N);g=g.substring(N),P=P.substring(N),N=c(g,P);var L=g.substring(g.length-N);g=g.substring(0,g.length-N),P=P.substring(0,P.length-N);var F=s(g,P);return D&&F.unshift([n,D]),L&&F.push([n,L]),H(F,A),M&&h(F),F}function s(g,P){var w;if(!g)return[[t,P]];if(!P)return[[e,g]];var M=g.length>P.length?g:P,A=g.length>P.length?P:g,v=M.indexOf(A);if(v!==-1)return w=[[t,M.substring(0,v)],[n,A],[t,M.substring(v+A.length)]],g.length>P.length&&(w[0][0]=w[2][0]=e),w;if(A.length===1)return[[e,g],[t,P]];var N=u(g,P);if(N){var D=N[0],L=N[1],F=N[2],Q=N[3],G=N[4],le=r(D,F),ue=r(L,Q);return le.concat([[n,G]],ue)}return i(g,P)}function i(g,P){for(var w=g.length,M=P.length,A=Math.ceil((w+M)/2),v=A,N=2*A,D=new Array(N),L=new Array(N),F=0;F<N;F++)D[F]=-1,L[F]=-1;D[v+1]=0,L[v+1]=0;for(var Q=w-M,G=Q%2!==0,le=0,ue=0,S=0,U=0,V=0;V<A;V++){for(var z=-V+le;z<=V-ue;z+=2){var j=v+z,W;z===-V||z!==V&&D[j-1]<D[j+1]?W=D[j+1]:W=D[j-1]+1;for(var ee=W-z;W<w&&ee<M&&g.charAt(W)===P.charAt(ee);)W++,ee++;if(D[j]=W,W>w)ue+=2;else if(ee>M)le+=2;else if(G){var te=v+Q-z;if(te>=0&&te<N&&L[te]!==-1){var k=w-L[te];if(W>=k)return o(g,P,W,ee)}}}for(var K=-V+S;K<=V-U;K+=2){var te=v+K,k;K===-V||K!==V&&L[te-1]<L[te+1]?k=L[te+1]:k=L[te-1]+1;for(var q=k-K;k<w&&q<M&&g.charAt(w-k-1)===P.charAt(M-q-1);)k++,q++;if(L[te]=k,k>w)U+=2;else if(q>M)S+=2;else if(!G){var j=v+Q-K;if(j>=0&&j<N&&D[j]!==-1){var W=D[j],ee=v+W-j;if(k=w-k,W>=k)return o(g,P,W,ee)}}}}return[[e,g],[t,P]]}function o(g,P,w,M){var A=g.substring(0,w),v=P.substring(0,M),N=g.substring(w),D=P.substring(M),L=r(A,v),F=r(N,D);return L.concat(F)}function a(g,P){if(!g||!P||g.charAt(0)!==P.charAt(0))return 0;for(var w=0,M=Math.min(g.length,P.length),A=M,v=0;w<A;)g.substring(v,A)==P.substring(v,A)?(w=A,v=w):M=A,A=Math.floor((M-w)/2+w);return x(g.charCodeAt(A-1))&&A--,A}function l(g,P){var w=g.length,M=P.length;if(w==0||M==0)return 0;w>M?g=g.substring(w-M):w<M&&(P=P.substring(0,w));var A=Math.min(w,M);if(g==P)return A;for(var v=0,N=1;;){var D=g.substring(A-N),L=P.indexOf(D);if(L==-1)return v;N+=L,(L==0||g.substring(A-N)==P.substring(0,N))&&(v=N,N++)}}function c(g,P){if(!g||!P||g.slice(-1)!==P.slice(-1))return 0;for(var w=0,M=Math.min(g.length,P.length),A=M,v=0;w<A;)g.substring(g.length-A,g.length-v)==P.substring(P.length-A,P.length-v)?(w=A,v=w):M=A,A=Math.floor((M-w)/2+w);return Y(g.charCodeAt(g.length-A))&&A--,A}function u(g,P){var w=g.length>P.length?g:P,M=g.length>P.length?P:g;if(w.length<4||M.length*2<w.length)return null;function A(ue,S,U){for(var V=ue.substring(U,U+Math.floor(ue.length/4)),z=-1,j="",W,ee,te,k;(z=S.indexOf(V,z+1))!==-1;){var K=a(ue.substring(U),S.substring(z)),q=c(ue.substring(0,U),S.substring(0,z));j.length<q+K&&(j=S.substring(z-q,z)+S.substring(z,z+K),W=ue.substring(0,U-q),ee=ue.substring(U+K),te=S.substring(0,z-q),k=S.substring(z+K))}return j.length*2>=ue.length?[W,ee,te,k,j]:null}var v=A(w,M,Math.ceil(w.length/4)),N=A(w,M,Math.ceil(w.length/2)),D;if(!v&&!N)return null;N?v?D=v[4].length>N[4].length?v:N:D=N:D=v;var L,F,Q,G;g.length>P.length?(L=D[0],F=D[1],Q=D[2],G=D[3]):(Q=D[0],G=D[1],L=D[2],F=D[3]);var le=D[4];return[L,F,Q,G,le]}function h(g){for(var P=!1,w=[],M=0,A=null,v=0,N=0,D=0,L=0,F=0;v<g.length;)g[v][0]==n?(w[M++]=v,N=L,D=F,L=0,F=0,A=g[v][1]):(g[v][0]==t?L+=g[v][1].length:F+=g[v][1].length,A&&A.length<=Math.max(N,D)&&A.length<=Math.max(L,F)&&(g.splice(w[M-1],0,[e,A]),g[w[M-1]+1][0]=t,M--,M--,v=M>0?w[M-1]:-1,N=0,D=0,L=0,F=0,A=null,P=!0)),v++;for(P&&H(g),y(g),v=1;v<g.length;){if(g[v-1][0]==e&&g[v][0]==t){var Q=g[v-1][1],G=g[v][1],le=l(Q,G),ue=l(G,Q);le>=ue?(le>=Q.length/2||le>=G.length/2)&&(g.splice(v,0,[n,G.substring(0,le)]),g[v-1][1]=Q.substring(0,Q.length-le),g[v+1][1]=G.substring(le),v++):(ue>=Q.length/2||ue>=G.length/2)&&(g.splice(v,0,[n,Q.substring(0,ue)]),g[v-1][0]=t,g[v-1][1]=G.substring(0,G.length-ue),g[v+1][0]=e,g[v+1][1]=Q.substring(ue),v++),v++}v++}}var d=/[^a-zA-Z0-9]/,m=/\s/,_=/[\r\n]/,p=/\n\r?\n$/,I=/^\r?\n\r?\n/;function y(g){function P(ue,S){if(!ue||!S)return 6;var U=ue.charAt(ue.length-1),V=S.charAt(0),z=U.match(d),j=V.match(d),W=z&&U.match(m),ee=j&&V.match(m),te=W&&U.match(_),k=ee&&V.match(_),K=te&&ue.match(p),q=k&&S.match(I);return K||q?5:te||k?4:z&&!W&&ee?3:W||ee?2:z||j?1:0}for(var w=1;w<g.length-1;){if(g[w-1][0]==n&&g[w+1][0]==n){var M=g[w-1][1],A=g[w][1],v=g[w+1][1],N=c(M,A);if(N){var D=A.substring(A.length-N);M=M.substring(0,M.length-N),A=D+A.substring(0,A.length-N),v=D+v}for(var L=M,F=A,Q=v,G=P(M,A)+P(A,v);A.charAt(0)===v.charAt(0);){M+=A.charAt(0),A=A.substring(1)+v.charAt(0),v=v.substring(1);var le=P(M,A)+P(A,v);le>=G&&(G=le,L=M,F=A,Q=v)}g[w-1][1]!=L&&(L?g[w-1][1]=L:(g.splice(w-1,1),w--),g[w][1]=F,Q?g[w+1][1]=Q:(g.splice(w+1,1),w--))}w++}}function H(g,P){g.push([n,""]);for(var w=0,M=0,A=0,v="",N="",D;w<g.length;){if(w<g.length-1&&!g[w][1]){g.splice(w,1);continue}switch(g[w][0]){case t:A++,N+=g[w][1],w++;break;case e:M++,v+=g[w][1],w++;break;case n:var L=w-A-M-1;if(P){if(L>=0&&R(g[L][1])){var F=g[L][1].slice(-1);if(g[L][1]=g[L][1].slice(0,-1),v=F+v,N=F+N,!g[L][1]){g.splice(L,1),w--;var Q=L-1;g[Q]&&g[Q][0]===t&&(A++,N=g[Q][1]+N,Q--),g[Q]&&g[Q][0]===e&&(M++,v=g[Q][1]+v,Q--),L=Q}}if(O(g[w][1])){var F=g[w][1].charAt(0);g[w][1]=g[w][1].slice(1),v+=F,N+=F}}if(w<g.length-1&&!g[w][1]){g.splice(w,1);break}if(v.length>0||N.length>0){v.length>0&&N.length>0&&(D=a(N,v),D!==0&&(L>=0?g[L][1]+=N.substring(0,D):(g.splice(0,0,[n,N.substring(0,D)]),w++),N=N.substring(D),v=v.substring(D)),D=c(N,v),D!==0&&(g[w][1]=N.substring(N.length-D)+g[w][1],N=N.substring(0,N.length-D),v=v.substring(0,v.length-D)));var G=A+M;v.length===0&&N.length===0?(g.splice(w-G,G),w=w-G):v.length===0?(g.splice(w-G,G,[t,N]),w=w-G+1):N.length===0?(g.splice(w-G,G,[e,v]),w=w-G+1):(g.splice(w-G,G,[e,v],[t,N]),w=w-G+2)}w!==0&&g[w-1][0]===n?(g[w-1][1]+=g[w][1],g.splice(w,1)):w++,A=0,M=0,v="",N="";break}}g[g.length-1][1]===""&&g.pop();var le=!1;for(w=1;w<g.length-1;)g[w-1][0]===n&&g[w+1][0]===n&&(g[w][1].substring(g[w][1].length-g[w-1][1].length)===g[w-1][1]?(g[w][1]=g[w-1][1]+g[w][1].substring(0,g[w][1].length-g[w-1][1].length),g[w+1][1]=g[w-1][1]+g[w+1][1],g.splice(w-1,1),le=!0):g[w][1].substring(0,g[w+1][1].length)==g[w+1][1]&&(g[w-1][1]+=g[w+1][1],g[w][1]=g[w][1].substring(g[w+1][1].length)+g[w+1][1],g.splice(w+1,1),le=!0)),w++;le&&H(g,P)}function x(g){return g>=55296&&g<=56319}function Y(g){return g>=56320&&g<=57343}function O(g){return Y(g.charCodeAt(0))}function R(g){return x(g.charCodeAt(g.length-1))}function b(g){for(var P=[],w=0;w<g.length;w++)g[w][1].length>0&&P.push(g[w]);return P}function T(g,P,w,M){return R(g)||O(M)?null:b([[n,g],[e,P],[t,w],[n,M]])}function B(g,P,w){var M=typeof w=="number"?{index:w,length:0}:w.oldRange,A=typeof w=="number"?null:w.newRange,v=g.length,N=P.length;if(M.length===0&&(A===null||A.length===0)){var D=M.index,L=g.slice(0,D),F=g.slice(D),Q=A?A.index:null;e:{var G=D+N-v;if(Q!==null&&Q!==G||G<0||G>N)break e;var le=P.slice(0,G),ue=P.slice(G);if(ue!==F)break e;var S=Math.min(D,G),U=L.slice(0,S),V=le.slice(0,S);if(U!==V)break e;var z=L.slice(S),j=le.slice(S);return T(U,z,j,F)}e:{if(Q!==null&&Q!==D)break e;var W=D,le=P.slice(0,W),ue=P.slice(W);if(le!==L)break e;var ee=Math.min(v-W,N-W),te=F.slice(F.length-ee),k=ue.slice(ue.length-ee);if(te!==k)break e;var z=F.slice(0,F.length-ee),j=ue.slice(0,ue.length-ee);return T(L,z,j,te)}}if(M.length>0&&A&&A.length===0)e:{var U=g.slice(0,M.index),te=g.slice(M.index+M.length),S=U.length,ee=te.length;if(N<S+ee)break e;var V=P.slice(0,S),k=P.slice(N-ee);if(U!==V||te!==k)break e;var z=g.slice(S,v-ee),j=P.slice(S,N-ee);return T(U,z,j,te)}return null}function $(g,P,w,M){return r(g,P,w,M,!0)}return $.INSERT=t,$.DELETE=e,$.EQUAL=n,Jo=$,Jo}var $C=BC();const Zo=pt($C);function jC(e){var h,d,m;const{rangeId:t,segmentId:n,documentDataModel:r,insert:s}=e,i=(d=(h=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:h.customRanges)==null?void 0:d.find(_=>_.rangeId===t);if(!i)return!1;const{startIndex:o,endIndex:a}=i,l=new De,c=a-o+1;l.push({t:J.RETAIN,len:o}),l.push({t:J.RETAIN,len:c,body:{dataStream:"",customRanges:[]}}),s&&l.push({t:J.INSERT,body:s,len:s.dataStream.length});const u=a+1+((m=s==null?void 0:s.dataStream.length)!=null?m:0);return l.selections=[{startOffset:u,endOffset:u,collapsed:!0}],l}function WC(e){const{ranges:t,rangeId:n,rangeType:r,wholeEntity:s,properties:i,body:o}=e;let a=0;const l=new De;let c=!1;return t.forEach(u=>{var x,Y,O;const h=HC(u,o);if(!h||!o)return!1;const{startOffset:d,endOffset:m}=h,_=(x=o.customRanges)!=null?x:[],p=(R,b,T)=>{var w,M,A,v;const B=wh(R,b,_,r),$=Math.min((M=(w=B[0])==null?void 0:w.startIndex)!=null?M:1/0,R),g=Math.max((v=(A=B[B.length-1])==null?void 0:A.endIndex)!=null?v:-1/0,b),P={rangeId:T?`${n}$${T}`:n,rangeType:r,startIndex:0,endIndex:g-$,wholeEntity:s,properties:{...i}};l.push({t:J.RETAIN,len:$-a}),l.push({t:J.RETAIN,len:g-$+1,body:{dataStream:"",customRanges:[P]},coverType:Re.COVER}),a=g+1},I=((Y=o.paragraphs)!=null?Y:[]).filter(R=>R.startIndex<m&&R.startIndex>d),y=((O=o.customBlocks)!=null?O:[]).filter(R=>R.startIndex<m&&R.startIndex>d);xC([d,m-1],[...I.map(R=>R.startIndex),...y.map(R=>R.startIndex)]).forEach(([R,b],T)=>p(R,b,T)),c=!0,l.selections=[{startOffset:h.endOffset,endOffset:h.endOffset,collapsed:!0}]}),c?l:!1}function bh(e,t,n=0,r=null,s=!0){e.sort((c,u)=>c.startOffset-u.startOffset);const i=[],{paragraphs:o=[]}=t,a=o==null?void 0:o.find(c=>c.startIndex>=e[0].startOffset&&c.startIndex<e[0].endOffset);let l=n;if(e.forEach(c=>{const{startOffset:u,endOffset:h}=c;u>l&&(i.push({t:J.RETAIN,len:u-l}),l=u),l<h&&(i.push({t:J.DELETE,len:h-l}),l=h)}),r&&i.push({t:J.INSERT,body:r,len:r.dataStream.length}),a&&s){const c=o.find(u=>u.startIndex-n>=e[e.length-1].endOffset-1);c&&(c.startIndex>l&&(i.push({t:J.RETAIN,len:c.startIndex-l}),l=c.startIndex),i.push({t:J.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...c,startIndex:0,bullet:a==null?void 0:a.bullet}]},coverType:Re.REPLACE}))}return i}function YC(e,t,n=0){const r=[];let s=n;return e.forEach(i=>{const{startOffset:o,endOffset:a}=i;o>s&&(r.push({t:J.RETAIN,len:o-s}),s=o),a>s&&(r.push({t:J.RETAIN,len:a-s,body:{...Z.deepClone(t),dataStream:""}}),s=a)}),r}const VC=e=>{var h;const{selection:t,body:n,doc:r}=e,s=t.segmentId,i=(h=r.getSelfOrHeaderFooterModel(s))==null?void 0:h.getBody();if(!i)return!1;const o=t.collapsed?null:At(i,t.startOffset,t.endOffset),a=Zo(o?o.dataStream:"",n.dataStream);let l=0;const c=a.map(([d,m])=>{switch(d){case 0:{const _={t:J.RETAIN,body:{...At(n,l,l+m.length,!1),dataStream:""},len:m.length};return l+=m.length,_}case 1:{const _={t:J.INSERT,body:At(n,l,l+m.length),len:m.length};return l+=m.length,_}default:return{t:J.DELETE,len:m.length}}}),u=new De;return u.push({t:J.RETAIN,len:t.startOffset}),u.push(...c),u};function zC(e,t){return!!((e==null?void 0:e.length)===(t==null?void 0:t.length)&&(e!=null&&e.every((n,r)=>JSON.stringify(n)===JSON.stringify(t==null?void 0:t[r]))))}const GC=e=>{var d;const{selection:t,body:n,doc:r,themeService:s}=e,i=t.segmentId,o=(d=r.getSelfOrHeaderFooterModel(i))==null?void 0:d.getBody();if(!o)return!1;const a=t.collapsed?null:At(o,t.startOffset,t.endOffset),l=Zo(a?a.dataStream:"",n.dataStream);let c=0;const u=l.map(([m,_])=>{switch(m){case 0:{const p=Js(n,c,c+_.length,!1),I=Js(a,c,c+_.length,!1),y={t:J.RETAIN,body:zC(p,I)?void 0:{textRuns:p==null?void 0:p.map(H=>{var x,Y,O,R,b,T,B;return{...H,ts:{...H.ts,cl:(O=(Y=(x=H.ts)==null?void 0:x.cl)==null?void 0:Y.rgb)!=null&&O.includes(".")?{rgb:s.getColorFromTheme((T=(b=(R=H.ts)==null?void 0:R.cl)==null?void 0:b.rgb)!=null?T:"")}:(B=H.ts)==null?void 0:B.cl}}}),dataStream:""},len:_.length};return c+=_.length,y}case 1:{const p={t:J.INSERT,body:At(n,c,c+_.length),len:_.length};return c+=_.length,p}default:return{t:J.DELETE,len:_.length}}});if(u.every(m=>m.t===J.RETAIN&&!m.body))return!1;const h=new De;return h.push({t:J.RETAIN,len:t.startOffset}),h.push(...u),h};function KC(e,t){const n=[],{customBlocks:r=[]}=e;for(const s of t){const{startOffset:i,endOffset:o}=s;if(!(i==null||o==null))for(const a of r){const{startIndex:l}=a;l>=i&&l<o&&n.push(a.blockId)}}return n}function XC(e,t=""){if(!t)return["body"];const{headers:n,footers:r}=e.getSnapshot();if(n==null&&r==null)throw new Error("Document data model must have headers or footers when update by segment id");if((n==null?void 0:n[t])!=null)return["headers",t,"body"];if((r==null?void 0:r[t])!=null)return["footers",t,"body"];throw new Error("Segment id not found in headers or footers")}const qC=e=>{var p,I,y,H;const{selection:t,documentDataModel:n,drawings:r}=e,{collapsed:s,startOffset:i,segmentId:o}=t,a=new De,l=Vt.getInstance(),c=[],u=n.getSelfOrHeaderFooterModel(o).getBody();if(!u)return!1;const h=(I=(p=n.getSnapshot().drawingsOrder)==null?void 0:p.length)!=null?I:0;let d=0;if(s)i>0&&a.push({t:J.RETAIN,len:i});else{const x=bh([t],u,0,null,!1);a.push(...x);const Y=KC(u,[t]),O=(y=n.getDrawings())!=null?y:{},R=(H=n.getDrawingsOrder())!=null?H:[],b=Y.sort((T,B)=>R.indexOf(T)>R.indexOf(B)?-1:R.indexOf(T)<R.indexOf(B)?1:0);if(b.length>0)for(const T of b){const B=O[T],$=R.indexOf(T);if(B==null||$<0)continue;const g=l.removeOp(["drawings",T],B),P=l.removeOp(["drawingsOrder",$],T);c.push(g),c.push(P),d++}}a.push({t:J.INSERT,body:{dataStream:"\b".repeat(r.length),customBlocks:r.map((x,Y)=>({startIndex:Y,blockId:x.drawingId}))},len:r.length});const m=XC(n,o),_=l.editOp(a.serialize(),m);c.push(_);for(const x of r){const{drawingId:Y}=x,O=l.insertOp(["drawings",Y],x),R=l.insertOp(["drawingsOrder",h-d],Y);c.push(O),c.push(R)}return c.reduce((x,Y)=>Vt.compose(x,Y),null)};function JC(e,t){if(typeof t>"u")return{startOffset:e,endOffset:e,collapsed:!0};if(t<e)throw new Error(`Cannot make a doc selection when endOffset ${t} is less than startOffset ${e}.`);return{startOffset:e,endOffset:t,collapsed:e===t}}function ZC(e){const{startOffset:t,endOffset:n,collapsed:r}=e,s=Math.min(t,n),i=Math.max(t,n);return{startOffset:s,endOffset:i,collapsed:r}}function QC(e,t,n,r){return Math.max(e,n)<=Math.min(t,r)}function Qo(e,t,n,r){const{startOffset:s,endOffset:i}=e,o=r!=null?r:ta(t,n),a=[];let l=-1;for(let c=0;c<o.length;c++){const u=o[c],{startIndex:h}=u;(s>l&&s<=h||i>l&&i<=h||h>=s&&h<=i)&&a.push(u),l=h}return a}function ea(e,t,n){const r=[],s=ta(t,n);for(const i of e){const o=Qo(i,t,n,s);r.push(...o)}return r}const eR=[ut.PARAGRAPH,ut.TABLE_START,ut.TABLE_END,ut.TABLE_ROW_START,ut.TABLE_CELL_START,ut.TABLE_CELL_END];function ta(e,t){const n=[];for(let r=0;r<e.length;r++){const s=e[r],{startIndex:i}=s;let o=i-1;for(;!eR.includes(t[o])&&o>=0;)o--;n.push({...s,paragraphStart:o+1,paragraphEnd:s.startIndex})}return n}const tR=e=>{var h,d,m;const{paragraphs:t,segmentId:n,document:r}=e;let s=e.listType;const i=(d=(h=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:h.paragraphs)!=null?d:[],o=t.every(_=>{var p;return((p=_.bullet)==null?void 0:p.listType.indexOf(s))===0});let l=nt(6);if(t.length===1){const _=i.indexOf(t[0]),p=i[_-1],I=i[_+1];p&&p.bullet&&p.bullet.listType.indexOf(s)===0?(l=p.bullet.listId,s!==xt.CHECK_LIST&&(s=p.bullet.listType)):I&&I.bullet&&I.bullet.listType.indexOf(s)===0&&(l=I.bullet.listId,s!==xt.CHECK_LIST&&(s=I.bullet.listType))}const c=new fn;c.reset();const u=new De;for(const _ of t){const{startIndex:p,paragraphStyle:I={},bullet:y}=_;u.push({t:J.RETAIN,len:p-c.cursor}),u.push({t:J.RETAIN,len:1,body:{dataStream:"",paragraphs:[o?{paragraphStyle:I,startIndex:0}:{startIndex:0,paragraphStyle:{...I},bullet:{nestingLevel:(m=y==null?void 0:y.nestingLevel)!=null?m:0,textStyle:{fs:20},listType:s,listId:l}}]},coverType:Re.REPLACE}),c.moveCursorTo(p+1)}return u},nR=e=>{var h;const{paragraphIndex:t,segmentId:n,document:r}=e,s=(h=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:h.paragraphs;if(s==null)return!1;const i=s.find(d=>d.startIndex===t);if(!(i!=null&&i.bullet)||i.bullet.listType.indexOf(xt.CHECK_LIST)===-1)return!1;const o=new fn;o.reset();const a=new De,{startIndex:l,paragraphStyle:c={}}=i,u=i.bullet.listType===xt.CHECK_LIST?xt.CHECK_LIST_CHECKED:xt.CHECK_LIST;return a.push({t:J.RETAIN,len:l-o.cursor}),a.push({t:J.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...i,paragraphStyle:c,startIndex:0,bullet:{...i.bullet,listType:u}}]},coverType:Re.REPLACE}),o.moveCursorTo(l+1),a},rR=e=>{var u,h;const{paragraphs:t,listType:n,segmentId:r,document:s}=e;if(((u=s.getSelfOrHeaderFooterModel(r).getBody())==null?void 0:u.paragraphs)==null)return!1;const a=nt(6),l=new fn;l.reset();const c=new De;for(const d of t){const{startIndex:m,paragraphStyle:_={},bullet:p}=d;c.push({t:J.RETAIN,len:m-l.cursor}),c.push({t:J.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:_,bullet:{nestingLevel:(h=p==null?void 0:p.nestingLevel)!=null?h:0,textStyle:(p==null?void 0:p.listType)===n?p.textStyle:{fs:20},listType:n,listId:a}}]},coverType:Re.REPLACE}),l.moveCursorTo(m+1)}return c};function sR(e,t){return t.some(n=>e.startIndex>n.startIndex&&e.startIndex<n.endIndex)}const iR=e=>{var c,u,h;const{paragraphs:t,document:n,type:r}=e,s=new fn;s.reset();const i=new De,o=(c=n.getSnapshot().lists)!=null?c:{},a=(h=(u=n.getBody())==null?void 0:u.tables)!=null?h:[],l={...kr,...o};for(const d of t){const{startIndex:m,paragraphStyle:_={},bullet:p}=d,I=sR(d,a);if(i.push({t:J.RETAIN,len:m-s.cursor}),p){const y=p.listType;let H=l[y].nestingLevel.length-1;I&&(H=Math.min(H,2)),i.push({t:J.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:{..._},bullet:{...p,nestingLevel:Math.max(Math.min(p.nestingLevel+r,H),0)}}]},coverType:Re.REPLACE})}else i.push({t:J.RETAIN,len:1});s.moveCursorTo(m+1)}return i},oR=e=>{var I,y,H,x;const{textRanges:t,segmentId:n,document:r,style:s,paragraphTextRun:i,cursor:o,deleteLen:a,textX:l}=e,c=r.getSelfOrHeaderFooterModel(n),u=(y=(I=c.getBody())==null?void 0:I.paragraphs)!=null?y:[],h=(x=(H=c.getBody())==null?void 0:H.dataStream)!=null?x:"",d=ea(t,u,h),m=new fn;o&&m.moveCursorTo(o);const _=l!=null?l:new De;d.sort((Y,O)=>Y.startIndex-O.startIndex);const p=Math.max(0,d[0].paragraphStart-1);p>m.cursor&&(_.push({t:J.RETAIN,len:p-m.cursor}),m.moveCursorTo(p)),a&&_.push({t:J.DELETE,len:a});for(const Y of d){const{startIndex:O,paragraphStyle:R={}}=Y,b=O-m.cursor;_.push({t:J.RETAIN,len:b,...i?{body:{dataStream:"",textRuns:[{ts:i,st:0,ed:b}]},coverType:Re.REPLACE}:null}),_.push({t:J.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:{...R,...s}}]},coverType:Re.REPLACE}),m.moveCursorTo(O+1)}return _};class Qe{}E(Qe,"customRange",{add:WC,delete:jC,copyCustomRange:FC,getCustomRangesInterestsWithSelection:kC,isIntersecting:Oh}),E(Qe,"customDecoration",{add:UC,delete:PC}),E(Qe,"selection",{replace:VC,makeSelection:JC,normalizeSelection:ZC,delete:bh,replaceTextRuns:GC,retain:YC}),E(Qe,"range",{isIntersects:QC,getParagraphsInRange:Qo,getParagraphsInRanges:ea}),E(Qe,"transform",{getPlainText:Zs,fromPlainText:DC,isEmptyDocument:MC}),E(Qe,"paragraph",{bullet:{set:rR,switch:tR,toggleChecklist:nR,changeNestLevel:iR},style:{set:oR},util:{transform:ta,getParagraphsInRange:Qo,getParagraphsInRanges:ea}}),E(Qe,"drawing",{add:qC});function aR(e,t,n,r){var c;if(t==="")return e;const s={id:"mock-id",body:e,documentStyle:{}},i=new Tt(s),o=t.length;let a;for(;(a=(r?i.getBody().dataStream:i.getBody().dataStream.toLowerCase()).indexOf(t))>=0;){const u=new De,h=Vt.getInstance();if(a>0&&u.retain(a),n.length>0){const d=i.sliceBody(a,a+o),m={dataStream:n};if(Array.isArray(d==null?void 0:d.textRuns)&&d.textRuns.length&&(m.textRuns=[{...d.textRuns[0],st:0,ed:n.length}]),(c=d==null?void 0:d.customRanges)!=null&&c.length){const _=d.customRanges[0];m.customRanges=[{..._,startIndex:0,endIndex:n.length-1}]}u.insert(n.length,m)}u.delete(o),i.apply(h.editOp(u.serialize()))}const l=i.getBody();return i.dispose(),l}function lR(e){if(e.customRanges||(e.customRanges=[]),!e.paragraphs){e.paragraphs=[];for(let t=0;t<e.dataStream.length;t++)e.dataStream[t]==="\r"&&e.paragraphs.push({startIndex:t})}return e.customBlocks||(e.customBlocks=[]),e.textRuns||(e.textRuns=[]),e.customDecorations||(e.customDecorations=[]),e.sectionBreaks||(e.sectionBreaks=[]),e.tables||(e.tables=[]),e}function yh(e){var t;return e.body=lR((t=e.body)!=null?t:{dataStream:""}),e.drawingsOrder||(e.drawingsOrder=[]),e.drawings||(e.drawings={}),e.documentStyle||(e.documentStyle={}),e}class Fr{constructor(t={}){E(this,"_style");this._style=t}static create(t={}){return new Fr(t)}get fontFamily(){return this._style.ff}get fontSize(){return this._style.fs}get italic(){return this._style.it===ae.TRUE}get bold(){return this._style.bl===ae.TRUE}get underline(){return this._style.ul&&on.create(this._style.ul)}get bottomBorderLine(){return this._style.bbl&&on.create(this._style.bbl)}get strikethrough(){return this._style.st&&on.create(this._style.st)}get overline(){return this._style.ol&&on.create(this._style.ol)}get background(){return this._style.bg}get border(){return this._style.bd}get color(){return this._style.cl}get verticalAlign(){return this._style.va}get numberFormat(){return this._style.n}copy(){return sn.create(Z.deepClone(this._style))}getValue(){return{...this._style}}}class sn extends Fr{static create(t={}){return new sn(t)}constructor(t={}){super(t)}setFontFamily(t){return this._style.ff=t,this}setFontSize(t){return this._style.fs=t,this}setItalic(t){return this._style.it=t?1:0,this}setBold(t){return this._style.bl=t?1:0,this}setUnderline(t){return this._style.ul=t.build(),this}setBottomBorderLine(t){return this._style.bbl=t.build(),this}setStrikethrough(t){return this._style.st=t.build(),this}setOverline(t){return this._style.ol=t.build(),this}setBackground(t){return this._style.bg=t,this}setBorder(t){return this._style.bd=t,this}setColor(t){return this._style.cl=t,this}setVerticalAlign(t){return this._style.va=t,this}copy(){return sn.create(Z.deepClone(this._style))}build(){return this.getValue()}}class on{constructor(t={s:1}){E(this,"_decoration");this._decoration=t}static create(t={s:1}){return new on(t)}get show(){return this._decoration.s===ae.TRUE}get followFontColor(){return this._decoration.c===ae.TRUE}get color(){return this._decoration.cl}get type(){return this._decoration.t}setShow(t){return this._decoration.s=t?1:0,this}setFollowFontColor(t){return this._decoration.c=t?1:0,this}setColor(t){return this._decoration.cl=t,this}setLineType(t){return this._decoration.t=t,this}copy(){return on.create(Z.deepClone(this._decoration))}build(){return{...this._decoration}}}class xr{constructor(t={}){E(this,"_style");this._style=t}static create(t={}){return new xr(t)}get indentFirstLine(){return this._style.indentFirstLine}get hanging(){return this._style.hanging}get indentStart(){return this._style.indentStart}get tabStops(){return this._style.tabStops}get indentEnd(){return this._style.indentEnd}get textStyle(){return this._style.textStyle}get headingId(){return this._style.headingId}get namedStyleType(){return this._style.namedStyleType}get horizontalAlign(){return this._style.horizontalAlign}get lineSpacing(){return this._style.lineSpacing}get direction(){return this._style.direction}get spacingRule(){return this._style.spacingRule}get snapToGrid(){return this._style.snapToGrid}get spaceAbove(){return this._style.spaceAbove}get spaceBelow(){return this._style.spaceBelow}get borderBetween(){return this._style.borderBetween}get borderTop(){return this._style.borderTop}get borderBottom(){return this._style.borderBottom}get borderLeft(){return this._style.borderLeft}get borderRight(){return this._style.borderRight}get keepLines(){return this._style.keepLines===ae.TRUE}get keepNext(){return this._style.keepNext===ae.TRUE}get wordWrap(){return this._style.wordWrap===ae.TRUE}get widowControl(){return this._style.widowControl===ae.TRUE}get shading(){return this._style.shading}get suppressHyphenation(){return this._style.suppressHyphenation===ae.TRUE}copy(){return Hr.create(Z.deepClone(this._style))}getValue(){return this._style}}class Hr extends xr{static create(t={}){return new Hr(t)}constructor(t={}){super(t)}setIndentFirstLine(t){return this._style.indentFirstLine=t,this}setHanging(t){return this._style.hanging=t,this}setIndentStart(t){return this._style.indentStart=t,this}setTabStops(t){return this._style.tabStops=t,this}setIndentEnd(t){return this._style.indentEnd=t,this}setTextStyle(t){return this._style.textStyle=t,this}setHeadingId(t){return this._style.headingId=t,this}setNamedStyleType(t){return this._style.namedStyleType=t,this}setHorizontalAlign(t){return this._style.horizontalAlign=t,this}setLineSpacing(t){return this._style.lineSpacing=t,this}setDirection(t){return this._style.direction=t,this}setSpacingRule(t){return this._style.spacingRule=t,this}setSnapToGrid(t){return this._style.snapToGrid=t?1:0,this}setSpaceAbove(t){return this._style.spaceAbove=t,this}setSpaceBelow(t){return this._style.spaceBelow=t,this}setBorderBetween(t){return this._style.borderBetween=t,this}setBorderTop(t){return this._style.borderTop=t,this}setBorderBottom(t){return this._style.borderBottom=t,this}setBorderLeft(t){return this._style.borderLeft=t,this}setBorderRight(t){return this._style.borderRight=t,this}setKeepLines(t){return this._style.keepLines=t?1:0,this}setKeepNext(t){return this._style.keepNext=t?1:0,this}setWordWrap(t){return this._style.wordWrap=t?1:0,this}setWidowControl(t){return this._style.widowControl=t?1:0,this}setShading(t){return this._style.shading=t,this}setSuppressHyphenation(t){return this._style.suppressHyphenation=t?1:0,this}copy(){return Hr.create(Z.deepClone(this._style))}build(){return this.getValue()}}class an{constructor(t){E(this,"_data");if(!t.body)throw new Error("Invalid document data, body is required");this._data=yh(t)}static create(t){return new an(t)}static createByBody(t){return new an({body:t,id:"d",documentStyle:{}})}copy(){return Sn.create(Z.deepClone(this._data))}slice(t,n){const{body:r,...s}=this._data;return Sn.create({...Z.deepClone(s),body:At(r,t,n)})}toPlainText(){var t,n;return Qe.transform.getPlainText((n=(t=this._data.body)==null?void 0:t.dataStream)!=null?n:"").replaceAll("\r",`
7
- `)}getParagraphStyle(){var t,n;return xr.create((n=(t=this._data.body)==null?void 0:t.paragraphs)==null?void 0:n[0].paragraphStyle)}getParagraphBullet(){var t,n;return(n=(t=this._data.body)==null?void 0:t.paragraphs)==null?void 0:n[0].bullet}getParagraphs(){var r,s;const t=(s=(r=this._data.body)==null?void 0:r.paragraphs)!=null?s:[];let n=0;return t.map(i=>{const o=this.slice(n,i.startIndex);return n=i.startIndex,o})}getTextRuns(){var t,n;return((n=(t=this._data.body)==null?void 0:t.textRuns)!=null?n:[]).map(r=>({...r,ts:r.ts?Fr.create(r.ts):null}))}getLinks(){var t,n,r;return(r=(n=(t=this._data.body)==null?void 0:t.customRanges)==null?void 0:n.filter(s=>s.rangeType===en.HYPERLINK))!=null?r:[]}getData(){return this._data}}class Sn extends an{constructor(n){super(n);E(this,"_doc");this._doc=new Tt(n)}static newEmptyData(){return yh({id:"d",documentStyle:{},drawings:{},drawingsOrder:[],body:{dataStream:`\r
8
- `,customBlocks:[],customRanges:[],paragraphs:[{startIndex:0}],textRuns:[],tables:[],sectionBreaks:[]}})}static create(n){return new Sn(n!=null?n:Sn.newEmptyData())}insertText(n,r,s){var u,h;let i=((h=(u=this._data.body)==null?void 0:u.dataStream.length)!=null?h:2)-2,o,a;if(typeof n=="string"?o=n:(i=Math.min(n,i),o=r),typeof r=="object"?a=r instanceof sn?r.build():r:a=s instanceof sn?s.build():s,!o)return this;const l={dataStream:o,textRuns:a?[{ts:a,st:i,ed:i+o.length}]:[]},c=Qe.selection.replace({doc:this._doc,selection:{startOffset:i,endOffset:i,collapsed:!0},body:l});if(!c)throw new Error("Insert text failed, please check.");return De.apply(this._doc.getBody(),c.serialize()),this}insertRichText(n,r){var a,l;let s=((l=(a=this._data.body)==null?void 0:a.dataStream.length)!=null?l:2)-2,i;typeof n=="object"?i=n instanceof an?n.getData():n:(s=Math.min(n,s),i=r instanceof an?r.getData():r);const o=Qe.selection.replace({doc:this._doc,selection:{startOffset:s,endOffset:s,collapsed:!0},body:i.body});if(!o)throw new Error("Insert text failed, please check.");return De.apply(this._doc.getBody(),o.serialize()),this}delete(n,r){if(r!==void 0){if(!r)return this;const s=Qe.selection.delete([{startOffset:n,endOffset:n+r,collapsed:!0}],this._data.body);De.apply(this._doc.getBody(),s)}return this}setStyle(n,r,s){const i={dataStream:"",textRuns:[{ts:s instanceof sn?s.build():s,st:0,ed:r-n}]},o=Qe.selection.retain([{startOffset:n,endOffset:r,collapsed:!0}],i);return De.apply(this._doc.getBody(),o),this}setLink(n,r,s){const i=Qe.customRange.add({rangeType:en.HYPERLINK,rangeId:nt(),properties:{url:s},ranges:[{startOffset:n,endOffset:r,collapsed:!1}],body:this._data.body});if(!i)throw new Error("Insert text failed, please check.");return De.apply(this._doc.getBody(),i.serialize()),this}cancelLink(n,r){if(typeof n=="string"){const s=Qe.customRange.delete({rangeId:n,documentDataModel:this._doc});if(!s)throw new Error("Insert text failed, please check.");De.apply(this._doc.getBody(),s.serialize())}else this.slice(n,r).getLinks().forEach(i=>{const o=Qe.customRange.delete({rangeId:i.rangeId,documentDataModel:this._doc});if(!o)throw new Error("Insert text failed, please check.");De.apply(this._doc.getBody(),o.serialize())});return this}updateLink(n,r){var i,o;const s=(o=(i=this._data.body)==null?void 0:i.customRanges)==null?void 0:o.find(a=>a.rangeId===n);if(!s)throw new Error("Link not found");return s.properties.url=r,this}insertParagraph(n,r){var o,a;let s,i;return typeof n=="object"?(s={dataStream:"\r",paragraphs:[{startIndex:0,paragraphStyle:n.build()}]},i=((a=(o=this._data.body)==null?void 0:o.dataStream.length)!=null?a:2)-2):(i=n,s={dataStream:"\r",paragraphs:[{startIndex:0,paragraphStyle:r==null?void 0:r.build()}]}),this.insertRichText(i,an.create({body:s,id:"d",documentStyle:{}})),this}insertLink(n,r,s){let i="",o="";typeof n=="string"?(i=n,o=r):(i=r,o=s);const a=Sn.createByBody({dataStream:i,customRanges:[{rangeType:en.HYPERLINK,rangeId:nt(),properties:{url:o},startIndex:0,endIndex:i.length-1}]});return typeof n=="number"?this.insertRichText(n,a):this.insertRichText(a)}}const cR="__default_document_sub_component_id20231101__";class Ah{constructor(){E(this,"skipNextObservers",!1);E(this,"lastReturnValue");E(this,"isStopPropagation",!1)}stopPropagation(){this.isStopPropagation=!0}}class uR extends se.Subject{constructor(){super(...arguments);E(this,"_sortedObservers",[])}unsubscribe(){super.unsubscribe(),this._sortedObservers.length=0}complete(){super.complete(),this._sortedObservers.length=0}subscribeEvent(n){let r;typeof n=="function"?r={next:([i,o])=>n(i,o)}:r=n;const s=super.subscribe(r);return this._sortedObservers.push(r),this._sortedObservers.sort((i,o)=>{var a,l;return((a=i.priority)!=null?a:0)-((l=o.priority)!=null?l:0)}),s.add(()=>this._sortedObservers=this._sortedObservers.filter(i=>i!==r)),s}clearObservers(){this._sortedObservers.forEach(n=>{var r;return(r=n.complete)==null?void 0:r.call(n)}),this._sortedObservers.length=0}emitEvent(n){var r;if(!this.closed){const s=new Ah;s.lastReturnValue=n;for(const i of this._sortedObservers){const o=(r=i.next)==null?void 0:r.call(i,[n,s]);if(s.lastReturnValue=o,s.skipNextObservers)return{handled:!0,lastReturnValue:s.lastReturnValue,stopPropagation:s.isStopPropagation}}return{handled:this._sortedObservers.length>0,lastReturnValue:s.lastReturnValue,stopPropagation:s.isStopPropagation}}throw new Error("[EventSubject]: cannot emit event on a closed subject.")}}function hR(e){return new se.Observable(t=>{const n=e.subscribeEvent(r=>{t.next(r)});return()=>n.unsubscribe()})}const Qs=Ce.createIdentifier("core.resource-manager.service"),na={[Se.Editor]:"Editor",[Se.Owner]:"Owner",[Se.Reader]:"Reader",[Se.UNRECOGNIZED]:"UNRECOGNIZED"},ei=e=>e?{userID:`${na[e]}_${nt(8)}`,name:na[e],avatar:""}:{userID:"",name:"",avatar:"",anonymous:!0,canBindAnonymous:!1},dR=(e,t)=>e.startsWith(na[t]);class Br extends Ke{constructor(){super(...arguments);E(this,"_model",new Map);E(this,"_userChange$",new se.Subject);E(this,"userChange$",this._userChange$.asObservable());E(this,"_currentUser$",new se.BehaviorSubject(ei()));E(this,"currentUser$",this._currentUser$.asObservable())}dispose(){super.dispose(),this._model.clear(),this._userChange$.complete(),this._currentUser$.complete()}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,r){const s=this._model.get(n);if(s)return s;r&&r()}delete(n){const r=this.getUser(n);this._model.delete(n),r&&this._userChange$.next({type:"delete",user:r})}clear(){this._model.clear(),this._userChange$.next({type:"clear"})}list(){return Array.from(this._model.values())}}var fR=Object.getOwnPropertyDescriptor,mR=(e,t,n,r)=>{for(var s=r>1?void 0:r?fR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},Th=(e,t)=>(n,r)=>t(n,r,e);f.AuthzIoLocalService=class{constructor(t,n){E(this,"_permissionMap",new Map([]));E(this,"_permissionOverrides",new Map);this._resourceManagerService=t,this._userManagerService=n,this._initSnapshot(),this._initDefaultUser()}_initDefaultUser(){const t=this._userManagerService.getCurrentUser();t&&t.userID||this._userManagerService.setCurrentUser(ei(Se.Owner))}_getRole(t){const n=this._userManagerService.getCurrentUser();return n?dR(n.userID,t):!1}_initSnapshot(){this._resourceManagerService.registerPluginResource({toJson:t=>{const n=[...this._permissionMap.keys()].reduce((r,s)=>{const i=this._permissionMap.get(s);return r[s]=i,r},{});return JSON.stringify(n)},parseJson:t=>JSON.parse(t),pluginName:"SHEET_AuthzIoMockService_PLUGIN",businesses:[ve.UNIVER_SHEET,ve.UNIVER_DOC,ve.UNIVER_SLIDE],onLoad:(t,n)=>{for(const r in n)this._permissionMap.set(r,n[r])},onUnLoad:()=>{this._permissionMap.clear()}})}async create(t){const n=nt(8),{objectType:r,selectRangeObject:s,worksheetObject:i}=t,o=s||i,a={objectType:r,unitID:(o==null?void 0:o.unitID)||"",name:(o==null?void 0:o.name)||"",strategies:[{action:6,role:Se.Owner},{action:16,role:Se.Owner},{action:17,role:Se.Owner},{action:18,role:Se.Owner},{action:19,role:Se.Owner},{action:33,role:Se.Owner},{action:34,role:Se.Owner},{action:35,role:Se.Owner},{action:36,role:Se.Owner},{action:37,role:Se.Owner},{action:38,role:Se.Owner},{action:39,role:Se.Owner},{action:40,role:Se.Owner}],selectRangeObject:s};return this._permissionMap.set(n,a),n}async allowed(t){const{objectID:n,actions:r}=t,s=this._permissionMap.get(n);return s?r.map(o=>{const a=`${n}:${o}`;if(this._permissionOverrides.has(a))return{action:o,allowed:this._permissionOverrides.get(a)};const l=s.strategies.find(c=>c.action===o);return l?{action:o,allowed:this._getRole(l.role)}:{action:o,allowed:this._getRole(Se.Owner)||this._getRole(Se.Editor)}}):r.map(a=>({action:a,allowed:this._getRole(Se.Owner)||this._getRole(Se.Editor)}))}async batchAllowed(t){const n=await Promise.all(t.map(s=>this.allowed(s)));return t.map((s,i)=>({unitID:s.unitID,objectID:s.objectID,actions:n[i]}))}async list(t){const n=[],r=[{action:6,role:Se.Owner},{action:16,role:Se.Owner},{action:17,role:Se.Owner},{action:18,role:Se.Owner},{action:19,role:Se.Owner},{action:33,role:Se.Owner},{action:34,role:Se.Owner},{action:35,role:Se.Owner},{action:36,role:Se.Owner},{action:37,role:Se.Owner},{action:38,role:Se.Owner},{action:39,role:Se.Owner},{action:40,role:Se.Owner}];return t.objectIDs.forEach(s=>{const i=this._permissionMap.get(s),o=(i==null?void 0:i.strategies)||r,a={objectID:s,unitID:t.unitID,objectType:(i==null?void 0:i.objectType)||3,name:(i==null?void 0:i.name)||"",shareOn:!1,shareRole:Se.Owner,shareScope:-1,scope:{read:yi.AllCollaborator,edit:yi.AllCollaborator},creator:ei(Se.Owner),strategies:o.map(l=>({action:l.action,role:l.role})),actions:t.actions.map(l=>{const c=`${s}:${l}`;if(this._permissionOverrides.has(c))return{action:l,allowed:this._permissionOverrides.get(c)};const u=o.find(h=>h.action===l);if(!u){const h=this._getRole(Se.Owner)||this._getRole(Se.Editor);return{action:l,allowed:h}}return{action:l,allowed:this._getRole(u.role)}})};n.push(a)}),n}async listCollaborators(){return[]}async listRoles(){return{roles:[],actions:[]}}async deleteCollaborator(){}async update(t){const{objectID:n,strategies:r}=t,s=this._permissionMap.get(n);s&&r&&(s.strategies=r.map(i=>({action:i.action,role:i.role})),this._permissionMap.set(n,s),r.forEach(i=>{i.role===Se.Reader?this.setPermissionOverride(n,i.action,!1):(i.role===Se.Owner||i.role===Se.Editor)&&this.clearPermissionOverride(n,i.action)}))}setPermissionOverride(t,n,r){const s=`${t}:${n}`;this._permissionOverrides.set(s,r)}clearPermissionOverride(t,n){const r=`${t}:${n}`;this._permissionOverrides.delete(r)}clearAllOverrides(t){const n=[];this._permissionOverrides.forEach((r,s)=>{s.startsWith(`${t}:`)&&n.push(s)}),n.forEach(r=>this._permissionOverrides.delete(r))}async updateCollaborator(){}async createCollaborator(){}async putCollaborators(t){}},f.AuthzIoLocalService=mR([Th(0,Qs),Th(1,Ce.Inject(Br))],f.AuthzIoLocalService);const Nh=Ce.createIdentifier("IAuthzIoIoService"),gR=Ce.createIdentifier("univer.confirm-service");class _R{constructor(){E(this,"confirmOptions$",new se.Subject)}dispose(){this.confirmOptions$.complete()}open(t){throw new Error("This is not implemented in the test service!")}confirm(t){return Promise.resolve(!0)}close(t){throw new Error("This is not implemented in the test service!")}}const $r="FOCUSING_UNIT",qn="FOCUSING_SHEET",jr="FOCUSING_DOC",Wr="FOCUSING_SLIDE",pR="FOCUSING_EDITOR_BUT_HIDDEN",Mh="EDITOR_ACTIVATED",ER="FOCUSING_EDITOR_INPUT_FORMULA",Dh="FOCUSING_FX_BAR_EDITOR",CR="FOCUSING_UNIVER_EDITOR",RR="FOCUSING_EDITOR_INPUT_FORMULA",IR="FOCUSING_COMMENT_EDITOR",SR="FOCUSING_PANEL_EDITOR",OR="FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE",wR="FOCUSING_COMMON_DRAWINGS",vR="FORMULA_EDITOR_ACTIVATED";class Lh extends Ke{constructor(){super(...arguments);E(this,"_error$",new se.Subject);E(this,"error$",this._error$.asObservable())}dispose(){this._error$.complete()}emit(n){this._error$.next({errorKey:n})}}var ti=(e=>(e.URL="URL",e.UUID="UUID",e.BASE64="BASE64",e))(ti||{}),Uh=(e=>(e.SUCCUSS="0",e.ERROR_EXCEED_SIZE="1",e.ERROR_IMAGE_TYPE="2",e.ERROR_UPLOAD_COUNT_LIMIT="3",e.ERROR_IMAGE="4",e))(Uh||{});const ra=Ce.createIdentifier("core.image-io.service"),sa=Ce.createIdentifier("core.url-image.service"),bR={version:"0.15.2"};function yR(e="",t=cr.ZH_CN,n=""){return{id:e,sheetOrder:[],name:n,appVersion:bR.version,locale:t,styles:{},sheets:{},resources:[]}}class Ph{constructor(t={}){E(this,"_styles");E(this,"_cacheMap",new Tr(1e5));this._styles=t,this._generateCacheMap()}each(t){return Object.entries(this._styles).forEach(t),this}search(t,n){if(this._cacheMap.has(n))return this._cacheMap.get(n);const r=this._getExistingStyleId(t);return r||"-1"}get(t){return typeof t!="string"?t:(t=String(t),this._styles[t])}add(t,n){const r=nt(6);return this._styles[r]=t,this._cacheMap.set(n,r),r}setValue(t){if(t==null)return;const n=JSON.stringify(t),r=this.search(t,n);return r!=="-1"?r:this.add(t,n)}addCustomStyle(t,n){n!=null&&(this._styles[t]=n,this._cacheMap.set(JSON.stringify(n),t))}remove(t){const n=this._styles[t];n&&(delete this._styles[t],this._cacheMap.delete(JSON.stringify(n)))}toJSON(){return this._styles}getStyleByCell(t){let n;t&&Z.isObject(t.s)?n=t.s:n=(t==null?void 0:t.s)&&this.get(t.s);const r=t==null?void 0:t.interceptorStyle;return r?{...n,...r}:n}_generateCacheMap(){const{_styles:t,_cacheMap:n}=this;for(const r in t){const s=JSON.stringify(t[r]);n.set(s,r)}}_getExistingStyleId(t){const{_styles:n}=this;for(const r in n)if(Z.diffValue(n[r],t))return r;return null}}const AR=(e,t)=>t.length===e.length&&!e.some(n=>t.some(r=>!Yt.equals(r,n))),TR=(e,t)=>t.length===e.length&&e.every((n,r)=>{const s=t[r];return s.unitId===n.unitId&&s.sheetId===n.sheetId&&Yt.equals(n.range,s.range)}),ia={t:0,b:2,l:2,r:2},NR=e=>({sbr:.6,sbo:e,spr:.6,spo:e}),kh=90;function Yr(e,t,n={}){const r=e.length,{textRotation:s,paddingData:i,horizontalAlign:o=bt.UNSPECIFIED,verticalAlign:a=mn.UNSPECIFIED,wrapStrategy:l=gn.UNSPECIFIED,cellValueType:c}=n,{t:u,r:h,b:d,l:m}=i||ia,{vertexAngle:_,centerAngle:p}=$h(s),I={id:"d",body:{dataStream:`${e}${wa}`,textRuns:[{ts:t,st:0,ed:r}],paragraphs:[{startIndex:r,paragraphStyle:{horizontalAlign:o}}],sectionBreaks:[{startIndex:r+1}]},documentStyle:{pageSize:{width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},marginTop:u,marginBottom:d,marginRight:h,marginLeft:m,renderConfig:{horizontalAlign:o,verticalAlign:a,centerAngle:p,vertexAngle:_,wrapStrategy:l,cellValueType:c}},drawings:{},drawingsOrder:[]};return new Tt(I)}function MR(e){if(!e)return{};const{tr:t,td:n,ht:r,vt:s,tb:i,pd:o}=e;return{textRotation:t,textDirection:n,horizontalAlign:r,verticalAlign:s,wrapStrategy:i,paddingData:o}}function Fh(e){if(!e)return{};const{ff:t,fs:n,it:r,bl:s,ul:i,st:o,ol:a,cl:l,bg:c}=e,u={};return t&&(u.ff=t),n&&(u.fs=n),r&&(u.it=r),s&&(u.bl=s),i&&(u.ul=i),o&&(u.st=o),a&&(u.ol=a),l&&(u.cl=l),c&&(u.bg=c),u}function xh(e,t,n){var i;const r=e.getBody();if((i=r.customRanges)!=null&&i.some(o=>o.rangeType===en.HYPERLINK))return;const s=Qe.customRange.add({ranges:[{startOffset:0,endOffset:r.dataStream.length-1,collapsed:!1}],rangeId:n,rangeType:en.HYPERLINK,body:r,properties:{url:t,refId:n}});s&&De.apply(r,s.serialize())}function Hh(e){return e!=null}function DR(){return{p:null,s:null,v:null,t:null,f:null,si:null,ref:null,xf:null}}const LR='"Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif';function Bh(e){const t=it.ff,n=it.fs;if(!e){const h=`${n}pt ${t}`;return{fontCache:h,fontString:h,fontSize:n,originFontSize:n,fontFamily:t}}let r=Ln.ITALIC;(e.it===0||e.it===void 0)&&(r=Ln.NORMAL);let s=Ln.BOLD;(e.bl===0||e.bl===void 0)&&(s=Ln.NORMAL);let i=n;e.fs&&(i=Math.ceil(e.fs));let o=t;if(e.ff){let h=e.ff;h=h.replace(/"/g,"").replace(/'/g,""),h.indexOf(" ")>-1&&(h=`"${h}"`),h==null&&(h=t),o=h}const{va:a}=e;let l=i;if(a===jt.SUBSCRIPT||a===jt.SUPERSCRIPT){const h=UR(o,l),{sbr:d,spr:m}=h;l*=a===jt.SUBSCRIPT?d:m}const c=`${r} ${s} ${l}pt ${o}`,u=`${c}, ${LR} `;return{fontCache:c,fontString:u,fontSize:l,originFontSize:i,fontFamily:o}}function UR(e,t){return NR(t)}function $h(e){const{a:t=0,v:n=ae.FALSE}=e||{a:0,v:ae.FALSE};let r=0,s=t;return n===ae.TRUE&&(r=kh,s=kh),{centerAngle:r,vertexAngle:s}}function gt(e){if(e==null||typeof e!=="object")return e;if(Array.isArray(e)){const s=e.length,i=new Array(s);for(let o=0;o<s;o++)i[o]=gt(e[o]);return i}const n={},r=Object.keys(e);for(let s=0,i=r.length;s<i;s++){const o=r[s];n[o]=gt(e[o])}return n}function jh(e){if(e==null)return e;const t={};return e.p!==void 0&&(t.p=e.p===null?null:gt(e.p)),e.s!==void 0&&(e.s===null||typeof e.s=="string"?t.s=e.s:t.s=gt(e.s)),e.v!==void 0&&(t.v=e.v),e.t!==void 0&&(t.t=e.t),e.f!==void 0&&(t.f=e.f),e.ref!==void 0&&(t.ref=e.ref),e.xf!==void 0&&(t.xf=e.xf),e.si!==void 0&&(t.si=e.si),e.custom!==void 0&&(t.custom=e.custom===null?null:gt(e.custom)),t}function PR(e){if(e==null)return e;const t={};return e.p!==void 0&&(t.p=e.p===null?null:gt(e.p)),e.s!==void 0&&(e.s===null||typeof e.s=="string"?t.s=e.s:t.s=gt(e.s)),e.v!==void 0&&(t.v=e.v),e.t!==void 0&&(t.t=e.t),e.f!==void 0&&(t.f=e.f),e.ref!==void 0&&(t.ref=e.ref),e.xf!==void 0&&(t.xf=e.xf),e.si!==void 0&&(t.si=e.si),e.custom!==void 0&&(t.custom=e.custom===null?null:gt(e.custom)),e.rowSpan!==void 0&&(t.rowSpan=e.rowSpan),e.colSpan!==void 0&&(t.colSpan=e.colSpan),e.displayV!==void 0&&(t.displayV=e.displayV),t}function Wh(e){const t={},n=Object.keys(e);for(let r=0,s=n.length;r<s;r++){const i=n[r],o=Number(i),a=e[o];if(a===void 0)continue;const l={},c=Object.keys(a);for(let u=0,h=c.length;u<h;u++){const d=c[u],m=Number(d),_=a[m];_!=null&&(l[m]=jh(_))}t[o]=l}return t}function Yh(e){const t={},n=Object.keys(e);for(let r=0,s=n.length;r<s;r++){const i=n[r],o=Number(i),a=e[o];if(a===void 0)continue;const l={};"h"in a&&a.h!==void 0&&(l.h=a.h),"ia"in a&&a.ia!==void 0&&(l.ia=a.ia),"ah"in a&&a.ah!==void 0&&(l.ah=a.ah),"hd"in a&&a.hd!==void 0&&(l.hd=a.hd),"w"in a&&a.w!==void 0&&(l.w=a.w),"s"in a&&a.s!==void 0&&(a.s===null||typeof a.s=="string"?l.s=a.s:l.s=gt(a.s)),"custom"in a&&a.custom!==void 0&&(l.custom=a.custom===null?null:gt(a.custom)),t[o]=l}return t}function kR(e){const t=e.length,n=new Array(t);for(let r=0;r<t;r++){const s=e[r];n[r]={startRow:s.startRow,startColumn:s.startColumn,endRow:s.endRow,endColumn:s.endColumn,rangeType:s.rangeType,startAbsoluteRefType:s.startAbsoluteRefType,endAbsoluteRefType:s.endAbsoluteRefType}}return n}function Vh(e){const t={id:e.id,name:e.name,tabColor:e.tabColor,hidden:e.hidden,rowCount:e.rowCount,columnCount:e.columnCount,zoomRatio:e.zoomRatio,scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,defaultColumnWidth:e.defaultColumnWidth,defaultRowHeight:e.defaultRowHeight,showGridlines:e.showGridlines,rightToLeft:e.rightToLeft,freeze:{xSplit:e.freeze.xSplit,ySplit:e.freeze.ySplit,startRow:e.freeze.startRow,startColumn:e.freeze.startColumn},rowHeader:{width:e.rowHeader.width,hidden:e.rowHeader.hidden},columnHeader:{height:e.columnHeader.height,hidden:e.columnHeader.hidden},mergeData:kR(e.mergeData),cellData:Wh(e.cellData),rowData:Yh(e.rowData),columnData:Yh(e.columnData)};return e.gridlinesColor!==void 0&&(t.gridlinesColor=e.gridlinesColor),e.defaultStyle!==void 0&&(e.defaultStyle===null||typeof e.defaultStyle=="string"?t.defaultStyle=e.defaultStyle:t.defaultStyle=gt(e.defaultStyle)),e.custom!==void 0&&(t.custom=e.custom===null?null:gt(e.custom)),t}class FR{constructor(t,n){E(this,"_columnData",{});this._config=t,this._columnData=n}getColumnData(){return this._columnData}getColVisible(t){const{_columnData:n}=this,r=n[t];return r?r.hd!==ae.TRUE:!0}getColumnStyle(t){var n;return(n=this._columnData[t])==null?void 0:n.s}setColumnStyle(t,n){const r=this.getColumnOrCreate(t);r.s=n}getHiddenCols(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getColVisible(o);s&&a?(s=!1,r.push({rangeType:pe.COLUMN,startColumn:i,endColumn:o-1,startRow:0,endRow:0})):!s&&!a&&(s=!0,i=o)}return s&&r.push({startRow:0,endRow:0,startColumn:i,endColumn:n,rangeType:pe.COLUMN}),r}getVisibleCols(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getColVisible(o);s&&!a?(s=!1,r.push({rangeType:pe.COLUMN,startColumn:i,endColumn:o-1,startRow:0,endRow:0})):!s&&a&&(s=!0,i=o)}return s&&r.push({startRow:0,endRow:0,startColumn:i,endColumn:n,rangeType:pe.COLUMN}),r}getColumnDatas(t,n){const r={};let s=0;for(let i=t;i<t+n;i++){const o=this.getColumn(i);r[s]=o!=null?o:{w:this._config.defaultColumnWidth,hd:ae.FALSE},s++}return r}getSize(){return rn(this._columnData)}getColumnWidth(t){var n,r;return(r=(n=this._columnData[t])==null?void 0:n.w)!=null?r:this._config.defaultColumnWidth}setColumnWidth(t,n){const r=this._columnData[t];n===this._config.defaultColumnWidth?r&&(delete r.w,Object.keys(r).length===0&&delete this._columnData[t]):this._columnData[t]=r?{...r,w:n}:{w:n}}getColumn(t){return this._columnData[t]}removeColumn(t){delete this._columnData[t]}getColumnOrCreate(t){const{_columnData:n}=this,r=n[t];if(r)return r;const s={};return this._columnData[t]=s,s}setCustomMetadata(t,n){const r=this.getColumn(t);r&&(r.custom=n)}getCustomMetadata(t){var n;return(n=this.getColumn(t))==null?void 0:n.custom}}const xR=2e3;class HR{constructor(t,n,r){E(this,"_rowData");this._config=t,this._viewModel=n,this._rowData=r}getRowData(){return this._rowData}getRowStyle(t){var n;return(n=this._rowData[t])==null?void 0:n.s}setRowStyle(t,n){const r=this.getRowOrCreate(t);r.s=n}getRowDatas(t,n){const r={};let s=0;for(let i=t;i<t+n;i++){const o=this.getRow(i);r[s]=o!=null?o:{h:this._config.defaultRowHeight,hd:ae.FALSE},s++}return r}getRowHeight(t,n=1){const{_rowData:r}=this,s=this._config;let i=0;for(let o=0;o<n;o++){const a=r[o+t]||{hd:ae.FALSE,h:s.defaultRowHeight},{ia:l,ah:c,h:u=s.defaultRowHeight}=a;i+=(l==null||l===ae.TRUE)&&typeof c=="number"?c:u}return i}setRowHeight(t,n){const r=this._rowData[t];if(n===this._config.defaultRowHeight)r&&(delete r.h,Object.keys(r).length===0&&delete this._rowData[t]);else{const s=Math.min(n,xR);this._rowData[t]=r?{...r,h:s}:{h:s}}}getRow(t){return this._rowData[t]}removeRow(t){delete this._rowData[t]}getRowOrCreate(t){const{_rowData:n}=this,r=n[t];if(r)return r;const s={};return n[t]=s,s}getHiddenRows(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getRowRawVisible(o);s&&a?(s=!1,r.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:pe.ROW})):!s&&!a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:n,startColumn:0,endColumn:0,rangeType:pe.ROW}),r}getVisibleRows(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getRowRawVisible(o);s&&!a?(s=!1,r.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:pe.ROW})):!s&&a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:n,startColumn:0,endColumn:0,rangeType:pe.ROW}),r}getRowRawVisible(t){const n=this.getRow(t);return n?n.hd!==ae.TRUE:!0}getSize(){return rn(this._rowData)}setCustomMetadata(t,n){const r=this.getRow(t);r&&(r.custom=n)}getCustomMetadata(t){var n;return(n=this.getRow(t))==null?void 0:n.custom}}const BR="DEFAULT_WORKSHEET_ROW_COUNT",zh=1e3,$R="DEFAULT_WORKSHEET_COLUMN_COUNT",Gh=20,jR="DEFAULT_WORKSHEET_ROW_HEIGHT",Kh=24,WR="DEFAULT_WORKSHEET_COLUMN_WIDTH",Xh=88,YR="DEFAULT_WORKSHEET_ROW_TITLE_WIDTH",qh=46,VR="DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT",Jh=20;function Zh(e){const t={name:"Sheet1",id:"sheet-01",tabColor:"",hidden:ae.FALSE,rowCount:zh,columnCount:Gh,zoomRatio:1,freeze:{xSplit:0,ySplit:0,startRow:-1,startColumn:-1},scrollTop:0,scrollLeft:0,defaultColumnWidth:Xh,defaultRowHeight:Kh,mergeData:[],cellData:{},rowData:{},columnData:{},showGridlines:ae.TRUE,rowHeader:{width:qh,hidden:ae.FALSE},columnHeader:{height:Jh,hidden:ae.FALSE},rightToLeft:ae.FALSE};return Object.keys(t).forEach(n=>{const r=n;typeof e[r]>"u"&&(e[r]=t[r])}),e}class zR extends Ke{constructor(n){super();E(this,"_cellCache",new Map);E(this,"_rowCache",new Map);E(this,"_columnCache",new Map);E(this,"_hasRow",!1);E(this,"_hasColumn",!1);E(this,"_hasAll",!1);E(this,"_allIndex",-1);E(this,"_mergeData");E(this,"_rangeMap",new Tr(5e4));E(this,"_skeletonCache",new Tr(5e4));this._init(n.concat())}_init(n){this._mergeData=n,this._createCache(n)}_clearCache(){this._cellCache.clear(),this._rowCache.clear(),this._columnCache.clear(),this._hasAll=!1,this._allIndex=-1,this._rangeMap.clear(),this._skeletonCache.clear(),this._hasColumn=!1,this._hasRow=!1}_createCache(n){let r=0;for(const s of n){const{rangeType:i}=s;i===pe.ROW?this._createRowCache(s,r):i===pe.COLUMN?this._createColumnCache(s,r):i===pe.ALL?this._createCellAllCache(r):this._createCellCache(s,r),r++}}rebuild(n){this._clearCache(),this._init(n.concat())}_createRowCache(n,r){const{startRow:s,endRow:i}=n;for(let o=s;o<=i;o++)this._rowCache.set(o,r),this._hasRow=!0}_createColumnCache(n,r){const{startColumn:s,endColumn:i}=n;for(let o=s;o<=i;o++)this._columnCache.set(o,r),this._hasColumn=!0}_createCellAllCache(n){this._hasAll=!0,this._allIndex=n}_createCellCache(n,r){for(let s=n.startRow;s<=n.endRow;s++){let i=this._cellCache.get(s);i==null&&(i=new Map,this._cellCache.set(s,i));for(let o=n.startColumn;o<=n.endColumn;o++)i.set(o,r)}}add(n){this._mergeData.push(n),this._clearCache(),this._createCache(this._mergeData)}remove(n,r){const s=this._getMergeDataIndex(n,r);s!==-1&&(this._mergeData.splice(s,1),this._clearCache(),this._createCache(this._mergeData))}getMergedCell(n,r){const s=this._getMergeDataIndex(n,r);return s!==-1?this._mergeData[s]:null}getMergeDataIndex(n,r){return this._getMergeDataIndex(n,r)}isRowContainsMergedCell(n){return this._hasAll||!Z.isEmptyObject(this._columnCache)?!0:this._mergeData.some(r=>r.startRow<=n&&n<=r.endRow)}isColumnContainsMergedCell(n){return this._hasAll||!Z.isEmptyObject(this._rowCache)?!0:this._mergeData.some(r=>r.startColumn<=n&&n<=r.endColumn)}getMergedCellRange(n,r,s,i){const o=[],a=`${n}-${r}-${s}-${i}`;if(this._rangeMap.has(a))return this._getRangeFromCache(a);let l=0;const c=[];for(const u of this._mergeData||[])Yt.intersects(u,{startRow:n,endRow:s,startColumn:r,endColumn:i})&&(o.push({...u}),c.push(l)),l++;return this._rangeMap.set(a,c),o}getMergedCellRangeForSkeleton(n,r,s,i){const o=[],a=this._mergeData,l=`${n}-${r}-${s}-${i}`;if(this._skeletonCache.has(l))return this._getSkeletonRangeFromCache(l);const c=[];for(let u=0;u<a.length;u++){const{startRow:h,endRow:d,startColumn:m,endColumn:_}=a[u];for(let p=n;p<=s;p++){let I=!1;for(let y=r;y<=i;y++)if(p>=h&&p<=d&&y>=m&&y<=_){o.push({startRow:h,endRow:d,startColumn:m,endColumn:_}),c.push(u),I=!0;break}if(I)break}}return this._skeletonCache.set(l,c),o}_getRangeFromCache(n){const r=this._rangeMap.get(n)||[],s=[];for(const i of r)s.push({...this._mergeData[i]});return s}_getSkeletonRangeFromCache(n){const r=this._skeletonCache.get(n)||[],s=[];for(const i of r)s.push({...this._mergeData[i]});return s}_getMergeDataIndex(n,r){var i;if(this._hasAll)return this._allIndex;if(this._hasRow){const o=this._rowCache.get(n);if(o!==void 0)return o}if(this._hasColumn){const o=this._columnCache.get(r);if(o!==void 0)return o}const s=(i=this._cellCache.get(n))==null?void 0:i.get(r);return s!==void 0?s:-1}getMergeDataSnapshot(){return this._mergeData}dispose(){this._clearCache(),this._mergeData=[]}}class Qh extends Ke{constructor(n){super();E(this,"_cellContentInterceptor",null);E(this,"_rowFilteredInterceptor",null);this.getRawCell=n}dispose(){super.dispose(),this._cellContentInterceptor=null,this._rowFilteredInterceptor=null}getCell(n,r,s,i){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,An.Value|An.Style,s,i):this.getRawCell(n,r)}getCellValueOnly(n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,An.Value):this.getRawCell(n,r)}getCellStyleOnly(n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,An.Style):this.getRawCell(n,r)}getRowFiltered(n){var r,s;return(s=(r=this._rowFilteredInterceptor)==null?void 0:r.getRowFiltered(n))!=null?s:!1}registerCellContentInterceptor(n){if(this._cellContentInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._cellContentInterceptor=n,Ye(()=>this._cellContentInterceptor=null)}registerRowFilteredInterceptor(n){if(this._rowFilteredInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._rowFilteredInterceptor=n,Ye(()=>this._rowFilteredInterceptor=null)}}const ed={isDeepClone:!1,displayRawFormula:!1,ignoreTextRotation:!1};class Vr{constructor(t,n,r){E(this,"_sheetId");E(this,"_snapshot");E(this,"_cellData");E(this,"_rowManager");E(this,"_columnManager");E(this,"_viewModel");E(this,"_spanModel");E(this,"_isRowStylePrecedeColumnStyle",!0);E(this,"_getCellHeight");var a;this.unitId=t,this._styles=r,this._snapshot=Zh(n);const{columnData:s,rowData:i,cellData:o}=this._snapshot;this._sheetId=(a=this._snapshot.id)!=null?a:nt(6),this._cellData=new ct(o),this._viewModel=new Qh((l,c)=>this.getCellRaw(l,c)),this._rowManager=new HR(this._snapshot,this._viewModel,i),this._columnManager=new FR(this._snapshot,s),this._spanModel=new zR(this._snapshot.mergeData)}__interceptViewModel(t){t(this._viewModel)}__registerGetCellHeight(t){return this._getCellHeight=t,Ye(()=>{this._getCellHeight=null})}getSnapshot(){return this._snapshot}getCellHeight(t,n){return this._getCellHeight?this._getCellHeight(t,n):this._snapshot.defaultRowHeight}setMergeData(t){this._snapshot.mergeData=t,this.getSpanModel().rebuild(t)}getSpanModel(){return this._spanModel}setIsRowStylePrecedeColumnStyle(t){this._isRowStylePrecedeColumnStyle=t}getStyleDataByHash(t){return{...this._styles.get(t)}}setStyleData(t){return this._styles.setValue(t)}getColumnStyle(t,n=!1){return n?this._columnManager.getColumnStyle(t):this._styles.get(this._columnManager.getColumnStyle(t))}setColumnStyle(t,n){this._columnManager.setColumnStyle(t,n)}getRowStyle(t,n=!1){return n?this._rowManager.getRowStyle(t):this._styles.get(this._rowManager.getRowStyle(t))}setRowStyle(t,n){this._rowManager.setRowStyle(t,n)}getDefaultCellStyle(){return this._snapshot.defaultStyle}getDefaultCellStyleInternal(){const t=this._snapshot.defaultStyle;return this._styles.get(t)}setDefaultCellStyle(t){this._snapshot.defaultStyle=t}getCellStyle(t,n){const r=this.getCell(t,n);if(r){const s=r.s;return typeof s=="string"?this._styles.get(s):s}return null}getComposedCellStyle(t,n,r){const s=this.getDefaultCellStyleInternal(),i=this.getRowStyle(t),o=this.getColumnStyle(n),a=this.getCell(t,n),l=this._styles.getStyleByCell(a);return(r!=null?r:this._isRowStylePrecedeColumnStyle)?lr(s,o,i,a==null?void 0:a.themeStyle,l):lr(s,i,o,a==null?void 0:a.themeStyle,l)}getComposedCellStyleByCellData(t,n,r,s){const i=this.getDefaultCellStyleInternal(),o=this.getRowStyle(t),a=this.getColumnStyle(n),l=this._styles.getStyleByCell(r);return(s!=null?s:this._isRowStylePrecedeColumnStyle)?lr(i,a,o,r==null?void 0:r.themeStyle,l):lr(i,o,a,r==null?void 0:r.themeStyle,l)}getComposedCellStyleWithoutSelf(t,n,r,s){const i=r===void 0?this.getComposedCellStyle(t,n,s):this.getComposedCellStyleByCellData(t,n,r,s),o=this.getCellRaw(t,n);if(!o||!o.s)return i;const a=typeof o.s=="string"?this._styles.get(o.s):o.s;if(!a)return i;for(const l in a)l in i&&delete i[l];return i}getCellMatrix(){return this._cellData}getCellMatrixPrintRange(){const t=this.getCellMatrix(),n=this.getMergeData();let r=-1,s=-1,i=-1,o=-1,a=!1,l=!1;return t.forEach((c,u)=>{Object.keys(u).forEach(h=>{const d=+h,m=t.getValue(c,d),_=m!=null&&m.s?this._styles.get(m.s):null,p=(_==null?void 0:_.bd)&&(_.bd.b||_.bd.l||_.bd.r||_.bd.t||_.bd.bc_tr||_.bd.bl_tr||_.bd.ml_tr||_.bd.tl_bc||_.bd.tl_br||_.bd.tl_mr);(m&&(m.v!==null&&m.v!==void 0&&m.v!==""||m.p)||_!=null&&_.bg||p)&&(a?r=Math.min(r,c):(r=c,a=!0),s=Math.max(s,c),l?i=Math.min(i,d):(l=!0,i=d),o=Math.max(o,d))})}),n.forEach(c=>{a?r=Math.min(r,c.startRow):(r=c.startRow,a=!0),s=Math.max(s,c.endRow),l?i=Math.min(i,c.startColumn):(i=c.startColumn,a=!0),o=Math.max(o,c.endColumn)}),!a||!l?null:{startColumn:i,startRow:r,endColumn:o,endRow:s}}getRowManager(){return this._rowManager}getUnitId(){return this.unitId}getSheetId(){return this._sheetId}getColumnManager(){return this._columnManager}getName(){return this._snapshot.name}clone(){const{_snapshot:t}=this,n=Vh(t);return new Vr(this.unitId,n,this._styles)}getMergeData(){return this._spanModel.getMergeDataSnapshot()}getMergedCell(t,n){return this._spanModel.getMergedCell(t,n)}getMergedCellRange(t,n,r,s){return this._spanModel.getMergedCellRange(t,n,r,s)}isRowContainsMergedCell(t){return this._spanModel.isRowContainsMergedCell(t)}isColumnContainsMergedCell(t){return this._spanModel.isColumnContainsMergedCell(t)}getCellInfoInMergeData(t,n){const r=this.getMergedCell(t,n);let s=!1,i=!1,o=t,a=n,l=t,c=n;if(r){const{startRow:u,endRow:h,startColumn:d,endColumn:m}=r;t===u&&n===d?(o=h,a=m,l=u,c=d,i=!0):t>=u&&t<=h&&n>=d&&n<=m&&(o=h,a=m,l=u,c=d,s=!0)}return{actualRow:t,actualColumn:n,isMergedMainCell:i,isMerged:s,endRow:o,endColumn:a,startRow:l,startColumn:c}}getCell(t,n){return t<0||n<0?null:this._viewModel.getCell(t,n)}getCellValueOnly(t,n){return t<0||n<0?null:this._viewModel.getCellValueOnly(t,n)}getCellStyleOnly(t,n){return t<0||n<0?null:this._viewModel.getCellStyleOnly(t,n)}getCellRaw(t,n){return this.getCellMatrix().getValue(t,n)}getCellWithFilteredInterceptors(t,n,r,s){return this._viewModel.getCell(t,n,r,s)}getRowFiltered(t){return this._viewModel.getRowFiltered(t)}getRangeFilterRows(t){const n=[];for(let r=t.startRow;r<=t.endRow;r++)this.getRowFiltered(r)&&n.push(r);return n}getMatrixWithMergedCells(t,n,r,s,i=Pn.Raw){const o=this.getCellMatrix(),a=this._spanModel.getMergedCellRange(t,n,r,s),l=new ct;return Yo(t,r,n,s).forEach((c,u)=>{var d;let h;if(i===Pn.Raw)h=this.getCellRaw(c,u);else if(i===Pn.Intercepted)h=this.getCell(c,u);else if(i===Pn.Both){const m=this.getCellRaw(c,u);if(m){h={...m};const _=(d=this.getCell(c,u))==null?void 0:d.v;Hh(_)&&h&&(h.displayV=String(_))}}h&&l.setValue(c,u,h)}),a.forEach(c=>{const{startColumn:u,startRow:h,endColumn:d,endRow:m}=c;Yo(h,m,u,d).forEach((_,p)=>{_===h&&p===u&&l.setValue(_,p,{...o.getValue(_,p),rowSpan:m-h+1,colSpan:d-u+1}),(_!==h||p!==u)&&l.realDeleteValue(_,p)})}),l}getRange(t,n,r,s){return typeof t=="object"?new Yn(this,t,{getStyles:()=>this._styles}):new Yn(this,{startRow:t,startColumn:n,endColumn:s||n,endRow:r||t},{getStyles:()=>this._styles})}getScrollLeftTopFromSnapshot(){return{scrollLeft:this._snapshot.scrollLeft,scrollTop:this._snapshot.scrollTop}}getZoomRatio(){return this._snapshot.zoomRatio||1}getConfig(){return this._snapshot}getFreeze(){return this._snapshot.freeze}getMaxColumns(){const{_snapshot:t}=this,{columnCount:n}=t;return n}getMaxRows(){const{_snapshot:t}=this,{rowCount:n}=t;return n}getRowCount(){return this._snapshot.rowCount}setRowCount(t){this._snapshot.rowCount=t}getColumnCount(){return this._snapshot.columnCount}setColumnCount(t){this._snapshot.columnCount=t}isSheetHidden(){return this._snapshot.hidden}hasHiddenGridlines(){const{_snapshot:t}=this,{showGridlines:n}=t;return n===0}getGridlinesColor(){return this.getConfig().gridlinesColor}getTabColor(){const{_snapshot:t}=this,{tabColor:n}=t;return n}getColumnWidth(t){return this.getColumnManager().getColumnWidth(t)}getRowHeight(t){return this._viewModel.getRowFiltered(t)?0:this.getRowManager().getRowHeight(t)}isRowFiltered(t){return this._viewModel.getRowFiltered(t)}getRowVisible(t){return!this.isRowFiltered(t)&&this.getRowRawVisible(t)}getRowRawVisible(t){return this.getRowManager().getRowRawVisible(t)}getHiddenRows(t,n){const r=this.getMaxColumns()-1,s=this._rowManager.getHiddenRows(t,n);return s.forEach(i=>i.endColumn=r),s}getColVisible(t){return this._columnManager.getColVisible(t)}getHiddenCols(t,n){const r=this.getMaxRows()-1,s=this._columnManager.getHiddenCols(t,n);return s.forEach(i=>i.endRow=r),s}getVisibleRows(){const t=this.getRowCount();return this._rowManager.getVisibleRows(0,t-1)}getVisibleCols(){const t=this.getColumnCount();return this._columnManager.getVisibleCols(0,t-1)}isRightToLeft(){const{_snapshot:t}=this,{rightToLeft:n}=t;return n}getLastRowWithContent(){return this._cellData.getRealRowRange().endRow}getLastColumnWithContent(){return this.getDataRealRange().endColumn}getDataRealRange(){return this._cellData.getRealRange()}getDataRangeScope(){return this._cellData.getStartEndScope()}cellHasValue(t){return t&&(t.v!==void 0||t.f!==void 0||t.p!==void 0)}iterateByRow(t,n=!0){const{startRow:r,startColumn:s,endRow:i,endColumn:o}=t,a=this;return{[Symbol.iterator]:()=>{let l=r,c=s;return{next(){for(;;){if(c>o&&(l+=1,c=s),l>i)return{done:!0,value:void 0};const u=a.getCell(l,c),h=!u,d=a.getMergedCell(l,c);if(d){if(l!==d.startRow||c!==d.startColumn){c=d.endColumn+1;continue}if(h&&n){c=d.endColumn+1;continue}const _={row:l,col:c,value:u};return _.colSpan=d.endColumn-d.startColumn+1,_.rowSpan=d.endRow-d.startRow+1,c=d.endColumn+1,{done:!1,value:_}}if(h&&n)c+=1;else{const m={row:l,col:c,value:u};return c+=1,{done:!1,value:m}}}}}}}}iterateByColumn(t,n=!0,r=!0){const{startRow:s,startColumn:i,endRow:o,endColumn:a}=t,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 _=c!==h.startRow,p=_||u!==h.startColumn;if(r&&p||!r&&_){c=h.endRow+1;continue}const I=l.getCell(h.startRow,h.startColumn);if(!I&&n){c=h.endRow+1;continue}const H={row:c,col:h.startColumn,value:I};return H.colSpan=h.endColumn-h.startColumn+1,H.rowSpan=h.endRow-h.startRow+1,c=h.endRow+1,{done:!1,value:H}}const d=l.getCell(c,u);if(!d&&n)c+=1;else{const _={row:c,col:u,value:d};return c+=1,{done:!1,value:_}}}}}}}}getCellDocumentModel(t,n,r=ed){var p;if(!t)return;const{isDeepClone:s,displayRawFormula:i,ignoreTextRotation:o}={...ed,...r};let a,l="document";const c=MR(n),u=o?it.tr:c.textRotation||it.tr;let h=c.horizontalAlign||it.ht;const d=c.verticalAlign||it.vt,m=c.wrapStrategy||it.tb,_=c.paddingData||ia;if(t.f&&i)a=Yr(t.f.toString(),{},{verticalAlign:d}),h=it.ht;else if(t.p){const{centerAngle:I,vertexAngle:y}=$h(u);a=this._updateConfigAndGetDocumentModel(s?Z.deepClone(t.p):t.p,h,_,{horizontalAlign:h,verticalAlign:d,centerAngle:I,vertexAngle:y,wrapStrategy:m,zeroWidthParagraphBreak:1})}else if(t.v!=null){const I=Fh(n);l=Bh(I).fontCache;let y=td(t);t.t===Qt.FORCE_STRING&&i&&(y=`'${y}`),a=Yr(y,I,{...c,textRotation:u,cellValueType:t.t})}return a&&t.linkUrl&&t.linkId&&xh(a,t.linkUrl,t.linkId),{documentModel:a,fontString:l,textRotation:u,wrapStrategy:m,verticalAlign:d,horizontalAlign:h,paddingData:_,fill:(p=n==null?void 0:n.bg)==null?void 0:p.rgb}}_updateConfigAndGetDocumentModel(t,n,r,s){var o,a,l,c,u;if(!s||!((o=t.body)!=null&&o.dataStream))return;t.documentStyle||(t.documentStyle={}),t.documentStyle.marginTop=(a=r.t)!=null?a:0,t.documentStyle.marginBottom=(l=r.b)!=null?l:2,t.documentStyle.marginLeft=(c=r.l)!=null?c:2,t.documentStyle.marginRight=(u=r.r)!=null?u:2,t.documentStyle.pageSize={width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},t.documentStyle.renderConfig={...t.documentStyle.renderConfig,...s};const i=t.body.paragraphs||[];for(const h of i)h.paragraphStyle||(h.paragraphStyle={}),h.paragraphStyle.horizontalAlign=n;return new Tt(t)}getBlankCellDocumentModel(t,n,r){const s=this.getComposedCellStyleByCellData(n,r,t),i=Fh(s),o=this.getCellDocumentModel(t,s,{ignoreTextRotation:!0});if(o!=null)return o.documentModel==null&&(o.documentModel=Yr("",i)),o;const a="";let l="document";const c=it.tr,u=it.ht,h=it.vt,d=it.tb,m=ia;return l=Bh({}).fontCache,{documentModel:Yr(a,i),fontString:l,textRotation:c,wrapStrategy:d,verticalAlign:h,horizontalAlign:u,paddingData:m}}getCellDocumentModelWithFormula(t,n,r){const s=this.getComposedCellStyleByCellData(n,r,t);return this.getCellDocumentModel(t,s,{isDeepClone:!0,displayRawFormula:!0,ignoreTextRotation:!0})}getCustomMetadata(){return this._snapshot.custom}setCustomMetadata(t){this._snapshot.custom=t}}function td(e){var r,s;if(!e)return"";const t=(s=(r=e.p)==null?void 0:r.body)==null?void 0:s.dataStream;if(t)return Qe.transform.getPlainText(t);const n=e.v;return typeof n=="string"?e.t===Qt.BOOLEAN?n.toUpperCase():n.replace(/[\r\n]/g,""):typeof n=="number"?e.t===Qt.BOOLEAN?n?"TRUE":"FALSE":n.toString():typeof n=="boolean"?n?"TRUE":"FALSE":""}function GR(e){if(e===null)return"";if(e!=null&&e.p){const t=e==null?void 0:e.p.body;if(t==null)return"";const n=t.dataStream;return Qe.transform.getPlainText(n)}return e==null?void 0:e.v}var KR=Object.getOwnPropertyDescriptor,XR=(e,t,n,r)=>{for(var s=r>1?void 0:r?KR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},qR=(e,t)=>(n,r)=>t(n,r,e);function JR(e,t){return`${e.getUnitId()}|${t.getSheetId()}`}f.Workbook=class extends as{constructor(n={},r){super();E(this,"type",ve.UNIVER_SHEET);E(this,"_sheetCreated$",new se.Subject);E(this,"sheetCreated$",this._sheetCreated$.asObservable());E(this,"_sheetDisposed$",new se.Subject);E(this,"sheetDisposed$",this._sheetDisposed$.asObservable());E(this,"_activeSheet$",new se.BehaviorSubject(null));E(this,"activeSheet$",this._activeSheet$.asObservable());E(this,"_worksheets");E(this,"_styles");E(this,"_snapshot");E(this,"_unitId");E(this,"_count");E(this,"_name$");E(this,"name$");this._logService=r;const s=yR();Z.isEmptyObject(n)?this._snapshot=s:this._snapshot=Z.commonExtend(s,n);const{styles:i}=this._snapshot;(this._snapshot.id==null||this._snapshot.id.length===0)&&(this._snapshot.id=nt(6)),this._unitId=this._snapshot.id,this._styles=new Ph(i),this._count=1,this._worksheets=new Map,this._name$=new se.BehaviorSubject(n.name||""),this.name$=this._name$.asObservable(),this._parseWorksheetSnapshots()}get _activeSheet(){return this._activeSheet$.getValue()}get name(){return this._name$.getValue()}static isIRangeType(n){return typeof n=="string"||"startRow"in n||"row"in n}dispose(){super.dispose(),this._sheetCreated$.complete(),this._sheetDisposed$.complete(),this._activeSheet$.complete(),this._name$.complete(),Array.from(this._worksheets.keys()).forEach(r=>{this._removeSheet(r)})}save(){return Z.deepClone(this._snapshot)}getSnapshot(){return this._snapshot}getName(){return this._snapshot.name}setName(n){this._name$.next(n),this._snapshot.name=n}getUnitId(){return this._unitId}getRev(){var n;return(n=this._snapshot.rev)!=null?n:1}incrementRev(){this._snapshot.rev=this.getRev()+1}setRev(n){this._snapshot.rev=n}addWorksheet(n,r,s){const{sheets:i,sheetOrder:o}=this._snapshot;if(i[n])return!1;i[n]=s,o.splice(r,0,n),this.ensureSheetOrderUnique();const a=new Vr(this._unitId,s,this._styles);return this._worksheets.set(n,a),this._sheetCreated$.next(a),!0}getSheetOrders(){return this._snapshot.sheetOrder}ensureSheetOrderUnique(){const n=new Set,r=[];for(const s of this._snapshot.sheetOrder)n.has(s)||(n.add(s),r.push(s));this._snapshot.sheetOrder=r,n.clear()}getWorksheets(){return this._worksheets}getActiveSpreadsheet(){return this}getStyles(){return this._styles}addStyles(n){Object.entries(n).forEach(([r,s])=>{this._styles.addCustomStyle(r,s)})}removeStyles(n){n.forEach(r=>{this._styles.remove(r)})}getConfig(){return this._snapshot}getIndexBySheetId(n){const{sheetOrder:r}=this._snapshot;return r.findIndex(s=>s===n)}getActiveSheet(n){if(!this._activeSheet&&typeof n>"u")throw new Error(`[Workbook]: no active Worksheet on Workbook ${this._unitId}!`);return this._activeSheet}ensureActiveSheet(){const n=this._activeSheet;if(n)return n;const r=this._snapshot.sheetOrder;for(let i=0,o=r.length;i<o;i++){const a=this._worksheets.get(r[i]);if(a&&a.isSheetHidden()!==ae.TRUE)return this.setActiveSheet(a),a}const s=this._worksheets.get(r[0]);return this.setActiveSheet(s),s}setActiveSheet(n){this._activeSheet$.next(n)}_removeSheet(n){const r=this._worksheets.get(n);return r?(this._worksheets.delete(n),this._snapshot.sheetOrder.splice(this._snapshot.sheetOrder.indexOf(n),1),this.ensureSheetOrderUnique(),this._sheetDisposed$.next(r),!0):!1}removeSheet(n){const r=this._removeSheet(n);return r&&delete this._snapshot.sheets[n],r}getActiveSheetIndex(){const{sheetOrder:n}=this._snapshot;return n.findIndex(r=>this._worksheets.get(r)===this._activeSheet)}getSheetSize(){return this._snapshot.sheetOrder.length}getSheets(){const{sheetOrder:n}=this._snapshot;return n.map(r=>this._worksheets.get(r))}getSheetsName(){const{sheetOrder:n}=this._snapshot,r=[];return n.forEach(s=>{const i=this._worksheets.get(s);i&&r.push(i.getName())}),r}getSheetIndex(n){const{sheetOrder:r}=this._snapshot;return r.findIndex(s=>n.getSheetId()===s)}getSheetBySheetName(n){const{sheetOrder:r}=this._snapshot,s=r.find(i=>this._worksheets.get(i).getName()===n);return this._worksheets.get(s)}getSheetBySheetId(n){return this._worksheets.get(n)}getSheetByIndex(n){const{sheetOrder:r}=this._snapshot;return this._worksheets.get(r[n])}getHiddenWorksheets(){return this.getSheets().filter(n=>n.getConfig().hidden===ae.TRUE).map(n=>n.getConfig().id)}getUnhiddenWorksheets(){return this.getSheets().filter(n=>n.getConfig().hidden!==ae.TRUE).map(n=>n.getConfig().id)}load(n){this._snapshot=n}checkSheetName(n){return this.getSheetsName().some(s=>s.toLowerCase()===n.toLowerCase())}uniqueSheetName(n="Sheet1"){let r=n;for(;this.checkSheetName(r);)r=n+this._count,this._count++;return r}generateNewSheetName(n){let r=n+this._count;for(;this.checkSheetName(r);)r=n+this._count,this._count++;return r}_parseWorksheetSnapshots(){const{_snapshot:n,_worksheets:r}=this,{sheets:s,sheetOrder:i}=n;if(Z.isEmptyObject(s)){const o=nt();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 Vr(this._unitId,a,this._styles);r.set(o,c),i.includes(o)||i.push(o)}this.ensureSheetOrderUnique(),this.ensureActiveSheet()}getCustomMetadata(){return this._snapshot.custom}setCustomMetadata(n){this._snapshot.custom=n}},f.Workbook=XR([qR(1,dt)],f.Workbook);class oa extends as{constructor(n){var r;super();E(this,"type",ve.UNIVER_SLIDE);E(this,"_activePage$",new se.BehaviorSubject(null));E(this,"activePage$",this._activePage$.asObservable());E(this,"_name$");E(this,"name$");E(this,"_snapshot");E(this,"_unitId");this._snapshot={...$u,...n},this._unitId=(r=this._snapshot.id)!=null?r:nt(6),this._name$=new se.BehaviorSubject(this._snapshot.title),this.name$=this._name$.asObservable()}get _activePage(){var r,s;const n=this._activePage$.getValue();if(!n){const i=(r=this.getPageOrder())==null?void 0:r[0];return i?(s=this.getPages())==null?void 0:s[i]:null}return n}setName(n){var r;this._snapshot.title=n,this._name$.next(n),this._unitId=(r=this._snapshot.id)!=null?r:nt(6)}getRev(){return 0}incrementRev(){}setRev(n){}getSnapshot(){return this._snapshot}getUnitId(){return this._unitId}getPages(){var n;return(n=this._snapshot.body)==null?void 0:n.pages}getPageOrder(){var n;return(n=this._snapshot.body)==null?void 0:n.pageOrder}getPage(n){const r=this.getPages();return r==null?void 0:r[n]}getElementsByPage(n){var r;return(r=this.getPage(n))==null?void 0:r.pageElements}getElement(n,r){var s;return(s=this.getElementsByPage(n))==null?void 0:s[r]}getPageSize(){return this._snapshot.pageSize}getBlankPage(){const n=nt(6);return{id:n,pageType:Ni.SLIDE,zIndex:10,title:n,description:"",pageBackgroundFill:{rgb:"rgb(255,255,255)"},pageElements:{}}}setActivePage(n){this._activePage$.next(n)}getActivePage(){return this._activePage}updatePage(n,r){this._snapshot.body&&(this._snapshot.body.pages[n]=r)}appendPage(n){var i;if(!this._snapshot.body)return;this._snapshot.body.pages[n.id]=n;const r=this._activePage,s=this._snapshot.body.pageOrder.indexOf((i=r==null?void 0:r.id)!=null?i:"");this._snapshot.body.pageOrder.splice(s+1,0,n.id)}}var ZR=Object.getOwnPropertyDescriptor,QR=(e,t,n,r)=>{for(var s=r>1?void 0:r?ZR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},aa=(e,t)=>(n,r)=>t(n,r,e);const Jn=Ce.createIdentifier("univer.current");f.UniverInstanceService=class extends Ke{constructor(n,r,s){super();E(this,"_unitsByType",new Map);E(this,"_createHandler");E(this,"_ctorByType",new Map);E(this,"_currentUnits",new Map);E(this,"_currentUnits$",new se.BehaviorSubject(this._currentUnits));E(this,"currentUnits$",this._currentUnits$.asObservable());E(this,"_unitAdded$",new se.Subject);E(this,"unitAdded$",this._unitAdded$.asObservable());E(this,"_unitDisposed$",new se.Subject);E(this,"unitDisposed$",this._unitDisposed$.asObservable());E(this,"_focused$",new se.BehaviorSubject(null));E(this,"focused$",this._focused$.asObservable());this._injector=n,this._contextService=r,this._logService=s}dispose(){super.dispose(),this._focused$.complete(),this._currentUnits$.complete(),this._unitAdded$.complete(),this._currentUnits.forEach(n=>n==null?void 0:n.dispose()),this._currentUnits.clear(),this._unitsByType.clear()}__setCreateHandler(n){this._createHandler=n}createUnit(n,r,s){return this._createHandler(n,r,this._ctorByType.get(n),s)}registerCtorForType(n,r){return this._ctorByType.set(n,r),{dispose:()=>{this._ctorByType.delete(n)}}}getCurrentTypeOfUnit$(n){return this.currentUnits$.pipe(se.map(r=>{var s;return(s=r.get(n))!=null?s:null}),se.distinctUntilChanged())}getCurrentUnitForType(n){return this._currentUnits.get(n)}getCurrentUnitOfType(n){return this.getCurrentUnitForType(n)}setCurrentUnitForType(n){const r=this._getUnitById(n);if(!r)throw new Error(`[UniverInstanceService]: no document with unitId ${n}!`);this._currentUnits.set(r[1],r[0]),this._currentUnits$.next(this._currentUnits)}getTypeOfUnitAdded$(n){return this._unitAdded$.pipe(se.filter(r=>r.type===n))}__addUnit(n,r){var a;this._logService.debug(`[UniverInstanceService]: Adding unit with id ${n.getUnitId()}`);const s=n.type;this._unitsByType.has(s)||this._unitsByType.set(s,[]);const i=this._unitsByType.get(s),o=n.getUnitId();if(i.findIndex(l=>l.getUnitId()===o)!==-1)throw new Error(`[UniverInstanceService]: cannot create a unit with the same unit id: ${o}.`);i.push(n),this._unitAdded$.next(n),((a=r==null?void 0:r.makeCurrent)==null||a)&&this.setCurrentUnitForType(n.getUnitId())}getTypeOfUnitDisposed$(n){return this.unitDisposed$.pipe(se.filter(r=>r.type===n))}getUnit(n,r){var i;const s=(i=this._getUnitById(n))==null?void 0:i[0];return r&&(s==null?void 0:s.type)!==r?null:s}getCurrentUniverDocInstance(){return this.getCurrentUnitForType(ve.UNIVER_DOC)}getUniverDocInstance(n){return this.getUnit(n,ve.UNIVER_DOC)}getUniverSheetInstance(n){return this.getUnit(n,ve.UNIVER_SHEET)}getAllUnitsForType(n){var r;return(r=this._unitsByType.get(n))!=null?r:[]}changeDoc(n,r){const s=this.getAllUnitsForType(ve.UNIVER_DOC),i=s.find(o=>o.getUnitId()===n);if(i!=null){const o=s.indexOf(i);s.splice(o,1)}this.__addUnit(r)}get focused(){var r;const n=this._focused$.getValue();return n?(r=this._getUnitById(n))==null?void 0:r[0]:null}focusUnit(n){this._focused$.next(n),this.focused instanceof f.Workbook?(this._contextService.setContextValue($r,!0),this._contextService.setContextValue(jr,!1),this._contextService.setContextValue(qn,!0),this._contextService.setContextValue(Wr,!1),this.setCurrentUnitForType(n)):this.focused instanceof Tt?(this._contextService.setContextValue($r,!0),this._contextService.setContextValue(jr,!0),this._contextService.setContextValue(qn,!1),this._contextService.setContextValue(Wr,!1),this.setCurrentUnitForType(n)):this.focused instanceof oa?(this._contextService.setContextValue($r,!0),this._contextService.setContextValue(jr,!1),this._contextService.setContextValue(qn,!1),this._contextService.setContextValue(Wr,!0),this.setCurrentUnitForType(n)):(this._contextService.setContextValue($r,!1),this._contextService.setContextValue(jr,!1),this._contextService.setContextValue(qn,!1),this._contextService.setContextValue(Wr,!1))}getFocusedUnit(){return this.focused}getUnitType(n){const r=this._getUnitById(n);return r?r[1]:ve.UNRECOGNIZED}disposeUnit(n){this._logService.debug(`[UniverInstanceService]: Disposing unit with id ${n}`);const r=this._getUnitById(n);if(!r)return this._logService.debug(`[UniverInstanceService]: No unit found with id ${n}`),!1;const[s,i]=r,o=this._unitsByType.get(i),a=o.indexOf(s);return o.splice(a,1),this._tryResetCurrentOnRemoval(n,i),this._tryResetFocusOnRemoval(n),this._unitDisposed$.next(s),s.dispose(),!0}_tryResetCurrentOnRemoval(n,r){const s=this.getCurrentUnitForType(r);(s==null?void 0:s.getUnitId())===n&&(this._currentUnits.set(r,null),this._currentUnits$.next(this._currentUnits))}_tryResetFocusOnRemoval(n){var r;((r=this.focused)==null?void 0:r.getUnitId())===n&&this._focused$.next(null)}_getUnitById(n){for(const[r,s]of this._unitsByType){const i=s.find(o=>o.getUnitId()===n);if(i)return[i,r]}}},f.UniverInstanceService=QR([aa(0,Ce.Inject(Ce.Injector)),aa(1,Un),aa(2,Ce.Inject(dt))],f.UniverInstanceService);var Fe=(e=>(e[e.Starting=0]="Starting",e[e.Ready=1]="Ready",e[e.Rendered=2]="Rendered",e[e.Steady=3]="Steady",e))(Fe||{});const nd={0:"Starting",1:"Ready",2:"Rendered",3:"Steady"};var eI=Object.getOwnPropertyDescriptor,tI=(e,t,n,r)=>{for(var s=r>1?void 0:r?eI(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},nI=(e,t)=>(n,r)=>t(n,r,e);class rd extends Error{constructor(t){super(`[LifecycleService]: lifecycle stage "${nd[t]}" will never be reached!`),this.name="LifecycleUnreachableError"}}f.LifecycleService=class extends Ke{constructor(n){super();E(this,"_lifecycle$",new se.BehaviorSubject(Fe.Starting));E(this,"lifecycle$",this._lifecycle$.asObservable());E(this,"_lock",!1);this._logService=n,this._reportProgress(Fe.Starting)}get stage(){return this._lifecycle$.getValue()}set stage(n){if(this._lock)throw new Error("[LifecycleService]: cannot set new stage when related logic is all handled!");if(n<this.stage)throw new Error("[LifecycleService]: lifecycle stage cannot go backward!");n!==this.stage&&(this._lock=!0,this._reportProgress(n),this._lifecycle$.next(n),this._lock=!1)}dispose(){this._lifecycle$.complete(),super.dispose()}onStage(n){return se.firstValueFrom(this.lifecycle$.pipe(se.filter(r=>r>=n),Fi(r=>r===n),se.map(()=>{}))).catch(r=>r.name==="EmptyError"?Promise.reject(new rd(n)):Promise.reject(r))}subscribeWithPrevious(){return se.merge(sd(this.stage),this._lifecycle$.pipe(se.skip(1))).pipe(Fi(n=>n===Fe.Steady))}_reportProgress(n){this._logService.debug("[LifecycleService]",`lifecycle progressed to "${nd[n]}".`)}},f.LifecycleService=tI([nI(0,dt)],f.LifecycleService);function sd(e){switch(e){case Fe.Starting:return se.of(Fe.Starting);case Fe.Ready:return se.of(Fe.Starting,Fe.Ready);case Fe.Rendered:return se.of(Fe.Starting,Fe.Ready,Fe.Rendered);default:return se.of(Fe.Starting,Fe.Ready,Fe.Rendered,Fe.Steady)}}const rI=Ce.createIdentifier("ILocalStorageService");class On extends Ke{constructor(){super();E(this,"_currentLocale$",new se.BehaviorSubject(cr.ZH_CN));E(this,"currentLocale$",this._currentLocale$.asObservable());E(this,"_locales",null);E(this,"localeChanged$",new se.Subject);E(this,"t",(n,...r)=>{if(!this._locales)throw new Error("[LocaleService]: Locale not initialized");const s=n.split("."),i=this.resolveKeyPath(this._locales[this._currentLocale],s);if(typeof i=="string"){let o=i;return r.forEach((a,l)=>{o=o.replace(`{${l}}`,a)}),o}else return n});this.disposeWithMe(Ye(()=>{this._locales=null,this._currentLocale$.complete(),this.localeChanged$.complete()}))}get _currentLocale(){return this._currentLocale$.value}load(n){var r;this._locales=is((r=this._locales)!=null?r:{},n)}setLocale(n){this._currentLocale$.next(n),this.localeChanged$.next()}getLocales(){var n;return(n=this._locales)==null?void 0:n[this._currentLocale]}getCurrentLocale(){return this._currentLocale}resolveKeyPath(n,r){const s=r.shift();if(s&&n&&s in n){const i=n[s];return r.length>0&&(typeof i=="object"||Array.isArray(i))?this.resolveKeyPath(i,r):i}return null}}var sI=Object.getOwnPropertyDescriptor,iI=(e,t,n,r)=>{for(var s=r>1?void 0:r?sI(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},oI=(e,t)=>(n,r)=>t(n,r,e);f.MentionIOLocalService=class{constructor(t){this._userManagerService=t}async list(t){return{list:[{type:ls.PERSON,mentions:[{objectType:ls.PERSON,objectId:this._userManagerService.getCurrentUser().userID,label:this._userManagerService.getCurrentUser().name,metadata:{icon:this._userManagerService.getCurrentUser().avatar}}],metadata:{},title:"PEOPLE"}],page:t.page,size:t.size,total:1}}},f.MentionIOLocalService=iI([oI(0,Ce.Inject(Br))],f.MentionIOLocalService);const id=Ce.createIdentifier("univer.service.mention-io");var la=(e=>(e.INIT="init",e.FETCHING="fetching",e.DONE="done",e))(la||{});const od=Ce.createIdentifier("univer.permission-service");class ad extends Ke{constructor(){super(...arguments);E(this,"_permissionPointMap",new Map);E(this,"_permissionPointUpdate$",new se.Subject);E(this,"permissionPointUpdate$",this._permissionPointUpdate$.asObservable());E(this,"_showComponents",!0)}setShowComponents(n){this._showComponents=n}getShowComponents(){return this._showComponents}deletePermissionPoint(n){const r=this._permissionPointMap.get(n);r&&(r.complete(),this._permissionPointMap.delete(n))}addPermissionPoint(n){const r=n instanceof se.BehaviorSubject,s=r?n.getValue():n;return s.id?this._permissionPointMap.get(s.id)?(console.warn(`${s.id} PermissionPoint already exists`),!1):(this._permissionPointMap.set(s.id,r?n:new se.BehaviorSubject(s)),this._permissionPointUpdate$.next(s),!0):!1}updatePermissionPoint(n,r){const s=this._permissionPointMap.get(n);if(!s)return;const i=s.getValue();i.value=r,i.status=la.DONE,s.next(i),this._permissionPointUpdate$.next(i)}clearPermissionMap(){this._permissionPointMap.clear()}getPermissionPoint(n){const r=this._permissionPointMap.get(n);if(r)return r.getValue()}getPermissionPoint$(n){const r=this._permissionPointMap.get(n);if(r)return r}composePermission$(n){const r=n.map(s=>{var o;const i=(o=this._permissionPointMap)==null?void 0:o.get(s);if(!i)throw new Error(`[PermissionService]: ${s} permissionPoint does not exist!`);return i.asObservable()});return se.combineLatest(r).pipe(qr.map(s=>s))}composePermission(n){return n.map(s=>{var o;const i=(o=this._permissionPointMap)==null?void 0:o.get(s);if(!i)throw new Error(`[PermissionService]: ${s} permissionPoint does not exist!`);return i.getValue()})}getAllPermissionPoint(){const n=new Map;return this._permissionPointMap.forEach((r,s)=>{n.set(s,r)}),n}}function ld(e,t){if(!t)return e;const n=[];for(const r of e){const s=t.find(([i])=>i===r[0]);if(s){if(s[1]===null)continue;n.push([r[0],s[1]])}else n.push(r)}return n}var aI=Object.getOwnPropertyDescriptor,lI=(e,t,n,r)=>{for(var s=r>1?void 0:r?aI(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},ca=(e,t)=>(n,r)=>t(n,r,e);const cI=4,cd=Symbol("DependentOn");class ua extends Ke{onStarting(){}onReady(){}onRendered(){}onSteady(){}getUnitType(){return this.constructor.type}getPluginName(){return this.constructor.pluginName}}E(ua,"pluginName"),E(ua,"type",ve.UNIVER_UNKNOWN);class uI{constructor(){E(this,"_plugins",[])}addPlugin(t){this._plugins.push(t)}removePlugins(){const t=this._plugins.slice();return this._plugins.length=0,t}forEachPlugin(t){this._plugins.forEach(t)}}function hI(...e){return function(t){t[cd]=e}}f.PluginService=class{constructor(t,n,r){E(this,"_pluginRegistry",new Map);E(this,"_pluginStore",new uI);E(this,"_seenPlugins",new Set);E(this,"_loadedPlugins",new Set);E(this,"_loadedPluginTypes",new Set([ve.UNIVER_UNKNOWN]));E(this,"_flushTimerByType",new Map);this._injector=t,this._lifecycleService=n,this._logService=r}dispose(){this._pluginStore.removePlugins().forEach(t=>t.dispose()),this._flushTimerByType.forEach(t=>clearTimeout(t))}registerPlugin(t,n){this._assertPluginValid(t);const r={plugin:t,options:n};this._pluginRegistry.set(t.pluginName,r),this._logService.debug("[PluginService]",`Plugin "${t.pluginName}" registered.`);const{type:s}=t;this._loadedPluginTypes.has(s)&&(s===ve.UNIVER_UNKNOWN?this._loadFromPlugins([r]):this._flushType(s))}startPluginsForType(t){this._loadedPluginTypes.has(t)||this._loadPluginsForType(t)}_loadPluginsForType(t){const n=Array.from(this._pluginRegistry.keys()),r=[];n.forEach(s=>{const i=this._pluginRegistry.get(s);i.plugin.type===t&&r.push(i)}),this._loadFromPlugins(r),this._loadedPluginTypes.add(t)}_assertPluginValid(t){const{type:n,pluginName:r}=t;if(n===ve.UNRECOGNIZED)throw new Error(`[PluginService]: invalid plugin type for ${t.name}. Please assign a "type" to your plugin.`);if(!r)throw new Error(`[PluginService]: no plugin name for ${t.name}. Please assign a "pluginName" to your plugin.`);if(this._seenPlugins.has(r))throw new Error(`[PluginService]: duplicated plugin name for "${r}". Maybe a plugin that dependents on "${r} has already registered it. In that case please register "${r}" before the that plugin.`);this._seenPlugins.add(t.pluginName)}_flushType(t){this._flushTimerByType.get(t)===void 0&&this._flushTimerByType.set(t,setTimeout(()=>{this._loadPluginsForType(t),this._flushTimerByType.delete(t)},cI))}_loadFromPlugins(t){const n=[],r=new Set,s=o=>{const{plugin:a}=o,{pluginName:l}=a;if(this._loadedPlugins.has(l)||r.has(l))return;r.add(l),this._pluginRegistry.delete(l);const c=a[cd];c&&c.forEach(u=>{const h=this._pluginRegistry.get(u.pluginName);if(h)s(h);else if(!this._seenPlugins.has(u.pluginName)&&!r.has(u.pluginName)){if(a.type===ve.UNIVER_UNKNOWN&&u.type!==ve.UNIVER_UNKNOWN)throw new Error(`[PluginService]: cannot register a plugin with Univer type that depends on a plugin with other type. The dependent is ${a.pluginName} and the dependency is ${u.pluginName}.`);a.type!==u.type&&u.type!==ve.UNIVER_UNKNOWN&&this._logService.debug("[PluginService]",`Plugin "${l}" depends on "${u.pluginName}" which has different type.`),this._logService.debug("[PluginService]",`Plugin "${l}" depends on "${u.pluginName}" which is not registered. Univer will automatically register it with default configuration.`),this._assertPluginValid(u),s({plugin:u,options:void 0})}}),n.push(o)};t.forEach(o=>s(o));const i=n.map(o=>this._initPlugin(o.plugin,o.options));this._pluginsRunLifecycle(i)}_pluginsRunLifecycle(t){const n=this._lifecycleService.stage;if(sd(n).subscribe(r=>this._runStage(t,r)),n!==Fe.Steady){const r=this._lifecycleService.lifecycle$.pipe(se.skip(1)).subscribe(s=>{this._runStage(t,s),s===Fe.Steady&&r.unsubscribe()})}}_runStage(t,n){t.forEach(r=>{switch(n){case Fe.Starting:r.onStarting();break;case Fe.Ready:r.onReady();break;case Fe.Rendered:r.onRendered();break;case Fe.Steady:r.onSteady();break}})}_initPlugin(t,n){const r=this._injector.createInstance(t,n);return this._pluginStore.addPlugin(r),this._loadedPlugins.add(t.pluginName),this._logService.debug("[PluginService]",`Plugin "${r.getPluginName()}" loaded.`),r}},f.PluginService=lI([ca(0,Ce.Inject(Ce.Injector)),ca(1,Ce.Inject(f.LifecycleService)),ca(2,dt)],f.PluginService);const ha=Ce.createIdentifier("resource-loader-service");var dI=Object.getOwnPropertyDescriptor,fI=(e,t,n,r)=>{for(var s=r>1?void 0:r?dI(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},mI=(e,t)=>(n,r)=>t(n,r,e);f.ResourceManagerService=class extends Ke{constructor(n){super();E(this,"_resourceMap",new Map);E(this,"_register$",new se.Subject);E(this,"register$",this._register$.asObservable());this._logService=n}getAllResourceHooks(){return[...this._resourceMap.values()]}getResources(n,r){return r?this.getResourcesByType(n,r):this.getAllResourceHooks().map(o=>{const a=o.toJson(n);return{name:o.pluginName,data:a}})}getResourcesByType(n,r){return this.getAllResourceHooks().filter(o=>o.businesses.includes(r)).map(o=>{const a=o.toJson(n);return{name:o.pluginName,data:a}})}registerPluginResource(n){const r=n.pluginName;if(this._resourceMap.has(r))throw new Error(`the pluginName is registered {${r}}`);return this._resourceMap.set(r,n),this._register$.next(n),Ye(()=>this._resourceMap.delete(r))}disposePluginResource(n){this._resourceMap.delete(n)}loadResources(n,r){this.getAllResourceHooks().forEach(s=>{var o;const i=(o=r==null?void 0:r.find(a=>a.name===s.pluginName))==null?void 0:o.data;if(i)try{const a=s.parseJson(i);s.onLoad(n,a)}catch(a){this._logService.error("[ResourceManagerService]","loadResources error",a)}})}unloadResources(n,r){this.getAllResourceHooks().filter(s=>s.businesses.includes(r)).forEach(s=>{s.onUnLoad(n)})}dispose(){this._register$.complete(),this._resourceMap.clear()}},f.ResourceManagerService=fI([mI(0,dt)],f.ResourceManagerService);class ni extends Ke{constructor(){super();E(this,"_darkMode$",new se.BehaviorSubject(!1));E(this,"darkMode$",this._darkMode$.asObservable());E(this,"_validColorCache",new Map);E(this,"_currentTheme",Jr.defaultTheme);E(this,"_currentTheme$",new se.BehaviorSubject(this._currentTheme));E(this,"currentTheme$",this._currentTheme$.asObservable());this.disposeWithMe(Ye(()=>{this._currentTheme=Jr.defaultTheme,this._currentTheme$.complete(),this._darkMode$.complete()}))}get darkMode(){return this._darkMode$.getValue()}isValidThemeColor(n){if(this._validColorCache.has(n))return this._validColorCache.get(n);let r=!1;const s=n.split(".");if(s.length===1)r=n in Jr.defaultTheme;else if(s.length===2){const[i,o]=s;r=i in Jr.defaultTheme&&o in this._currentTheme[i]}return this._validColorCache.set(n,r),r}getCurrentTheme(){return this._currentTheme}setTheme(n){this._currentTheme=n,this._currentTheme$.next(n)}setDarkMode(n){this._darkMode$.next(n)}getColorFromTheme(n){return ul(this._currentTheme,n)}}var gI=Object.getOwnPropertyDescriptor,_I=(e,t,n,r)=>{for(var s=r>1?void 0:r?gI(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},da=(e,t)=>(n,r)=>t(n,r,e);const ri=Ce.createIdentifier("univer.undo-redo.service"),pI=20;class ud{dispose(){}async dispatchToHandlers(){return!1}}const hd="univer.command.redo",dd="univer.command.undo",fd=new class extends ud{constructor(){super(...arguments);E(this,"type",mr.COMMAND);E(this,"id",dd)}handler(t){const n=t.get(ri),r=n.pitchTopUndoElement();if(!r)return!1;const s=t.get(gr);return _s(r.undoMutations,s)?(n.popUndoToRedo(),!0):!1}},md=new class extends ud{constructor(){super(...arguments);E(this,"type",mr.COMMAND);E(this,"id",hd)}handler(t){const n=t.get(ri),r=n.pitchTopRedoElement();if(!r)return!1;const s=t.get(gr);return _s(r.redoMutations,s)?(n.popRedoToUndo(),!0):!1}};f.LocalUndoRedoService=class extends Ke{constructor(n,r,s){super();E(this,"undoRedoStatus$");E(this,"_undoRedoStatus$",new se.BehaviorSubject({undos:0,redos:0}));E(this,"_undoStacks",new Map);E(this,"_redoStacks",new Map);E(this,"_batchingStatus",new Map);this._univerInstanceService=n,this._commandService=r,this._contextService=s,this.undoRedoStatus$=this._undoRedoStatus$.asObservable(),this.disposeWithMe(this._commandService.registerCommand(fd)),this.disposeWithMe(this._commandService.registerCommand(md)),this.disposeWithMe(Ye(()=>this._undoRedoStatus$.complete())),this.disposeWithMe(Ye(this._univerInstanceService.focused$.subscribe(()=>this._updateStatus())))}pushUndoRedo(n){const{unitID:r}=n,s=this._getRedoStack(r,!0),i=this._getUndoStack(r,!0);if(s.length=0,this._batchingStatus.has(n.unitID)){const a=this._batchingStatus.get(n.unitID),l=this._pitchUndoElement(n.unitID);a===0||!l?(o(n),this._batchingStatus.set(n.unitID,1)):this._tryBatchingElements(l,n)}else o(n);function o(a){i.push(a),i.length>pI&&i.splice(0,1)}this._updateStatus()}clearUndoRedo(n){const r=this._getRedoStack(n);r&&(r.length=0);const s=this._getUndoStack(n);s&&(s.length=0),this._updateStatus()}pitchTopUndoElement(){const n=this._getFocusedUnitId();return this._pitchUndoElement(n)}pitchTopRedoElement(){const n=this._getFocusedUnitId();return this._pitchRedoElement(n)}_pitchUndoElement(n){const r=this._getUndoStack(n);return r!=null&&r.length?r[r.length-1]:null}_pitchRedoElement(n){const r=this._getRedoStack(n);return r!=null&&r.length?r[r.length-1]:null}popUndoToRedo(){const r=this._getUndoStackForFocused().pop();r&&(r.redoMutations.length>0&&this._getRedoStackForFocused().push(r),this._updateStatus())}popRedoToUndo(){const r=this._getRedoStackForFocused().pop();r&&(this._getUndoStackForFocused().push(r),this._updateStatus())}rollback(n,r){const s=r||this._getFocusedUnitId(),i=this._getUndoStack(s),o=i==null?void 0:i[(i==null?void 0:i.length)-1];o&&o.id===n&&(i.pop(),_s(o.undoMutations,this._commandService))}__tempBatchingUndoRedo(n){if(this._batchingStatus.has(n))throw new Error("[LocalUndoRedoService]: cannot batching undo redo twice at the same time!");return this._batchingStatus.set(n,0),Ye(()=>this._batchingStatus.delete(n))}_updateStatus(){var i,o;const n=this._getFocusedUnitId(),r=n&&((i=this._undoStacks.get(n))==null?void 0:i.length)||0,s=n&&((o=this._redoStacks.get(n))==null?void 0:o.length)||0;this._undoRedoStatus$.next({undos:r,redos:s})}_getUndoStack(n,r=!1){let s=this._undoStacks.get(n);return!s&&r&&(s=[],this._undoStacks.set(n,s)),s||null}_getRedoStack(n,r=!1){let s=this._redoStacks.get(n);return!s&&r&&(s=[],this._redoStacks.set(n,s)),s||null}_getUndoStackForFocused(){const n=this._getFocusedUnitId();if(!n)throw new Error("No focused univer instance!");return this._getUndoStack(n,!0)}_getRedoStackForFocused(){const n=this._getFocusedUnitId();if(!n)throw new Error("No focused univer instance!");return this._getRedoStack(n,!0)}_tryBatchingElements(n,r){n.redoMutations.push(...r.redoMutations),n.undoMutations.push(...r.undoMutations)}_getFocusedUnitId(){var o,a,l,c;let n="";const r=this._contextService.getContextValue(qn),s=this._contextService.getContextValue(Dh),i=this._contextService.getContextValue(Mh);return r?s?n=ci:i?n=li:n=(a=(o=this._univerInstanceService.getFocusedUnit())==null?void 0:o.getUnitId())!=null?a:"":n=(c=(l=this._univerInstanceService.getFocusedUnit())==null?void 0:l.getUnitId())!=null?c:"",n}},f.LocalUndoRedoService=_I([da(0,Jn),da(1,gr),da(2,Un)],f.LocalUndoRedoService);class gd{constructor(t,n=1e3){E(this,"_imageCacheMap");this._injector=t,this._imageCacheMap=new Tr(n)}_getImageCacheKey(t,n){return`${t}-${n}`}getImage(t,n,r,s){const i=this._getImageCacheKey(t,n),o=this._imageCacheMap.get(i);return o||((async()=>{const a=new Image,l=this._injector.has(ra)?this._injector.get(ra):null,c=this._injector.has(sa)?this._injector.get(sa):null;if(t===ti.UUID)try{a.src=await(l==null?void 0:l.getImage(n))||""}catch(u){console.error(u)}else if(t===ti.URL)try{const u=await(c==null?void 0:c.getImage(n));a.src=u||n}catch{a.src=n}else a.src=n;a.onload=()=>{a.removeAttribute("data-error"),r==null||r()},a.onerror=()=>{a.setAttribute("data-error","true"),s==null||s()},this._imageCacheMap.set(i,a)})(),null)}}function EI(e){return!(e.length===0||e.length>31||e.startsWith("'")||e.endsWith("'")||/[:\\\/\?\*\[\]]/.test(e))}function CI(e,t){return!(!e||e.length===0||e.length>255||t.has(e)||/[ :\\\/\?\*\[\]]/.test(e)||!/^[\p{L}_]/u.test(e)||/^\$?[A-Za-z]{1,3}\$?[0-9]+$/.test(e)||/^[rR]\d+[cC]\d+$/.test(e)||/^\d+$/.test(e))}const _d=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],fa=1,zr=8;class ma{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[n,r]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=r>>4;if(s!==fa)throw new Error(`Got v${s} data when expected v${fa}.`);const i=_d[r&15];if(!i)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new ma(a,o,i,t)}constructor(t,n=64,r=Float64Array,s){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=r,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const i=_d.indexOf(this.ArrayType),o=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-a%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${r}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,zr,t),this.coords=new this.ArrayType(this.data,zr+a+l,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(zr+o+a+l),this.ids=new this.IndexArrayType(this.data,zr,t),this.coords=new this.ArrayType(this.data,zr+a+l,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(fa<<4)+i]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=t,this.coords[this._pos++]=n,r}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return ga(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:o,nodeSize:a}=this,l=[0,i.length-1,0],c=[];for(;l.length;){const u=l.pop()||0,h=l.pop()||0,d=l.pop()||0;if(h-d<=a){for(let I=d;I<=h;I++){const y=o[2*I],H=o[2*I+1];y>=t&&y<=r&&H>=n&&H<=s&&c.push(i[I])}continue}const m=d+h>>1,_=o[2*m],p=o[2*m+1];_>=t&&_<=r&&p>=n&&p<=s&&c.push(i[m]),(u===0?t<=_:n<=p)&&(l.push(d),l.push(m-1),l.push(1-u)),(u===0?r>=_:s>=p)&&(l.push(m+1),l.push(h),l.push(1-u))}return c}within(t,n,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:i,nodeSize:o}=this,a=[0,s.length-1,0],l=[],c=r*r;for(;a.length;){const u=a.pop()||0,h=a.pop()||0,d=a.pop()||0;if(h-d<=o){for(let I=d;I<=h;I++)Ed(i[2*I],i[2*I+1],t,n)<=c&&l.push(s[I]);continue}const m=d+h>>1,_=i[2*m],p=i[2*m+1];Ed(_,p,t,n)<=c&&l.push(s[m]),(u===0?t-r<=_:n-r<=p)&&(a.push(d),a.push(m-1),a.push(1-u)),(u===0?t+r>=_:n+r>=p)&&(a.push(m+1),a.push(h),a.push(1-u))}return l}}function ga(e,t,n,r,s,i){if(s-r<=n)return;const o=r+s>>1;pd(e,t,o,r,s,i),ga(e,t,n,r,o-1,1-i),ga(e,t,n,o+1,s,1-i)}function pd(e,t,n,r,s,i){for(;s>r;){if(s-r>600){const c=s-r+1,u=n-r+1,h=Math.log(c),d=.5*Math.exp(2*h/3),m=.5*Math.sqrt(h*d*(c-d)/c)*(u-c/2<0?-1:1),_=Math.max(r,Math.floor(n-u*d/c+m)),p=Math.min(s,Math.floor(n+(c-u)*d/c+m));pd(e,t,n,_,p,i)}const o=t[2*n+i];let a=r,l=s;for(Gr(e,t,r,n),t[2*s+i]>o&&Gr(e,t,r,s);a<l;){for(Gr(e,t,a,l),a++,l--;t[2*a+i]<o;)a++;for(;t[2*l+i]>o;)l--}t[2*r+i]===o?Gr(e,t,r,l):(l++,Gr(e,t,l,s)),l<=n&&(r=l+1),n<=l&&(s=l-1)}}function Gr(e,t,n,r){_a(e,n,r),_a(t,2*n,2*r),_a(t,2*n+1,2*r+1)}function _a(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Ed(e,t,n,r){const s=e-n,i=t-r;return s*s+i*i}class RI{constructor(t=!1){E(this,"_tree",new Map);E(this,"_oneCellCache",new Map);E(this,"_kdTree",new Map);this._enableOneCellCache=t}dispose(){this.clear()}getTree(t,n){return this._tree.has(t)||this._tree.set(t,new Map),this._tree.get(t).has(n)||this._tree.get(t).set(n,new Vs),this._tree.get(t).get(n)}_getOneCellCache(t,n,r,s){return this._oneCellCache.has(t)||this._oneCellCache.set(t,new Map),this._oneCellCache.get(t).has(n)||this._oneCellCache.get(t).set(n,new Map),this._oneCellCache.get(t).get(n).has(r)||this._oneCellCache.get(t).get(n).set(r,new Map),this._oneCellCache.get(t).get(n).get(r).has(s)||this._oneCellCache.get(t).get(n).get(r).set(s,new Set),this._oneCellCache.get(t).get(n).get(r).get(s)}_removeOneCellCache(t,n,r,s,i){const o=this._oneCellCache.get(t);if(!o)return;const a=o.get(n);if(!a)return;const l=a.get(r);if(!l)return;const c=l.get(s);c&&c.delete(i)}_removeCellCacheByRange(t){const{unitId:n,sheetId:r,range:s,id:i}=t,o=this._oneCellCache.get(n);if(!o)return;const a=o.get(r);if(!a)return;const{startRow:l,startColumn:c,endRow:u,endColumn:h}=s;for(let d=l;d<=u;d++){const m=a.get(d);if(m)for(let _=c;_<=h;_++){const p=m.get(_);p&&p.delete(i)}}}_insertOneCellCache(t,n,r,s,i){this._getOneCellCache(t,n,r,s).add(i)}_getRdTreeItems(t){const n=[];for(const[r,s]of t)for(const[i,o]of s)n.push({x:i,y:r,ids:o});return n}_searchByOneCellCache(t){var _;const{unitId:n,sheetId:r,range:s}=t,{startRow:i,startColumn:o,endRow:a,endColumn:l}=s,c=(_=this._kdTree.get(n))==null?void 0:_.get(r);if(!c)return[];const{tree:u,items:h}=c,d=u.range(o,i,l,a),m=[];for(const p of d){const I=h[p];m.push(...Array.from(I.ids))}return m}openKdTree(){var t;for(const[n,r]of this._oneCellCache){this._kdTree.has(n)||this._kdTree.set(n,new Map);for(const[s,i]of r){const o=this._getRdTreeItems(i),a=new ma(o.length);(t=this._kdTree.get(n))==null||t.set(s,{tree:a,items:o});for(const l of o)a.add(l.x,l.y);a.finish()}}}closeKdTree(){var t;for(const[n,r]of this._oneCellCache)for(const[s,i]of r)(t=this._kdTree.get(n))==null||t.set(s,void 0)}insert(t){const{unitId:n,sheetId:r,range:s,id:i}=t;if(!n||n.length===0)return;let{startRow:o,endRow:a,startColumn:l,endColumn:c}=s;if(this._enableOneCellCache&&o===a&&l===c){this._insertOneCellCache(n,r,o,l,i);return}const u=this.getTree(n,r);Number.isNaN(o)&&(o=0),Number.isNaN(l)&&(l=0),Number.isNaN(a)&&(a=Number.POSITIVE_INFINITY),Number.isNaN(c)&&(c=Number.POSITIVE_INFINITY),u.insert({minX:l,minY:o,maxX:c,maxY:a,id:i})}bulkInsert(t){for(const n of t)this.insert(n)}*searchGenerator(t){var a;const{unitId:n,sheetId:r,range:s}=t;if(this._enableOneCellCache){const l=this._searchByOneCellCache(t);for(const c of l)yield c}const i=(a=this._tree.get(n))==null?void 0:a.get(r);if(!i)return;const o=i.search({minX:s.startColumn,minY:s.startRow,maxX:s.endColumn,maxY:s.endRow});for(const l of o)yield l.id}bulkSearch(t,n){const r=new Set;for(const s of t)for(const i of this.searchGenerator(s))(n==null?void 0:n.has(i))!==!0&&r.add(i);return r}removeById(t,n){var r,s;n?((r=this._tree.get(t))==null||r.delete(n),(s=this._oneCellCache.get(t))==null||s.delete(n)):(this._tree.delete(t),this._oneCellCache.delete(t))}_removeRTreeItem(t){const{unitId:n,sheetId:r,range:s,id:i}=t,o=this.getTree(n,r),a=o.search({minX:s.startColumn,minY:s.startRow,maxX:s.endColumn,maxY:s.endRow});for(let l=0;l<a.length;l++)a[l].id===i&&o.remove(a[l])}remove(t){const{unitId:n,sheetId:r,range:s,id:i}=t,{startRow:o,startColumn:a,endRow:l,endColumn:c}=s;this._enableOneCellCache?o===l&&a===c?this._removeOneCellCache(n,r,s.startRow,s.startColumn,i):(this._removeCellCacheByRange(t),this._removeRTreeItem(t)):this._removeRTreeItem(t)}bulkRemove(t){for(const n of t)this.remove(n)}clear(){this._tree.clear(),this._oneCellCache.clear()}toJSON(){const t={};return this._tree.forEach((n,r)=>{t[r]={},n.forEach((s,i)=>{t[r][i]=s.toJSON()})}),t}fromJSON(t){this._tree.clear();for(const n in t){this._tree.set(n,new Map);for(const r in t[n]){const s=new Vs;s.fromJSON(t[n][r]),this._tree.get(n).set(r,s)}}}}function II(e){return new Promise(t=>setTimeout(t,e))}function SI(e=1){return new Promise(t=>{let n=0;const r=()=>{n++,n>=e?t():requestAnimationFrame(r)};requestAnimationFrame(r)})}var OI=Object.getOwnPropertyDescriptor,wI=(e,t,n,r)=>{for(var s=r>1?void 0:r?OI(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},vI=(e,t)=>(n,r)=>t(n,r,e);f.Skeleton=class extends Ke{constructor(n){super();E(this,"_fontLocale");E(this,"_dirty",!0);this._localeService=n,this._localeInitial()}get dirty(){return this._dirty}getFontLocale(){return this._fontLocale}makeDirty(n){this._dirty=n}dispose(){super.dispose(),this._fontLocale=null}_localeInitial(){}},f.Skeleton=wI([vI(0,Ce.Inject(On))],f.Skeleton);var bI=Object.getOwnPropertyDescriptor,yI=(e,t,n,r)=>{for(var s=r>1?void 0:r?bI(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},si=(e,t)=>(n,r)=>t(n,r,e);f.SheetSkeleton=class extends f.Skeleton{constructor(n,r,s,i,o,a){super(s);E(this,"_worksheetData");E(this,"_renderRawFormula",!1);E(this,"_cellData");E(this,"_imageCacheMap");E(this,"_skipAutoHeightForMergedCells",!0);E(this,"_rowTotalHeight",0);E(this,"_columnTotalWidth",0);E(this,"_rowHeaderWidth",0);E(this,"_columnHeaderHeight",0);E(this,"_rowHeightAccumulation",[]);E(this,"_columnWidthAccumulation",[]);E(this,"_marginTop",0);E(this,"_marginLeft",0);E(this,"_scaleX");E(this,"_scaleY");E(this,"_scrollX");E(this,"_scrollY");this.worksheet=n,this._styles=r,this._contextService=i,this._configService=o,this._injector=a,this._worksheetData=this.worksheet.getConfig(),this._cellData=this.worksheet.getCellMatrix(),this._imageCacheMap=new gd(this._injector),this.initConfig()}initConfig(){var n,r;this._skipAutoHeightForMergedCells=!((n=this._configService.getConfig(ba))!=null&&n),this.worksheet.setIsRowStylePrecedeColumnStyle((r=this._configService.getConfig(va))!=null?r:!1)}resetCache(){}getWorksheetConfig(){return this._worksheetData}getLocation(){return[this.worksheet.getUnitId(),this.worksheet.getSheetId()]}set columnHeaderHeight(n){this._columnHeaderHeight=n,this._worksheetData.columnHeader.height=n}set rowHeaderWidth(n){this._rowHeaderWidth=n,this._worksheetData.rowHeader.width=n}get rowHeightAccumulation(){return this._rowHeightAccumulation}get rowTotalHeight(){return this._rowTotalHeight}get columnWidthAccumulation(){return this._columnWidthAccumulation}get columnTotalWidth(){return this._columnTotalWidth}get rowHeaderWidth(){return this._rowHeaderWidth}get columnHeaderHeight(){return this._columnHeaderHeight}setMarginLeft(n){this._marginLeft=n}setMarginTop(n){this._marginTop=n}setScale(n,r){this._updateLayout(),this._scaleX=n,this._scaleY=r||n,this._updateLayout()}setScroll(n,r){Z.isDefine(n)&&(this._scrollX=n),Z.isDefine(r)&&(this._scrollY=r)}get scrollX(){return this._scrollX}get scrollY(){return this._scrollY}get scaleX(){return this._scaleX}get scaleY(){return this._scaleY}get rowHeaderWidthAndMarginLeft(){return this.rowHeaderWidth+this._marginLeft}get columnHeaderHeightAndMarginTop(){return this.columnHeaderHeight+this._marginTop}get imageCacheMap(){return this._imageCacheMap}_generateRowMatrixCache(n,r,s){let i=0;const o=[],a=r;for(let l=0;l<n;l++){let c=s;if(this.worksheet.getRowFiltered(l))c=0;else if(a[l]!=null){const u=a[l];if(!u)continue;const{h=s,ah:d,ia:m}=u;(m==null||m===ae.TRUE)&&typeof d=="number"?c=d:c=h,u.hd===ae.TRUE&&(c=0)}i+=c,o.push(i)}return{rowTotalHeight:i,rowHeightAccumulation:o}}_generateColumnMatrixCache(n,r,s){let i=0;const o=[],a=r;for(let l=0;l<n;l++){let c=s;if(a[l]!=null){const u=a[l];if(!u)continue;u.w!=null&&(c=u.w),u.hd===ae.TRUE&&(c=0)}i+=c,o.push(i)}return{columnTotalWidth:i,columnWidthAccumulation:o}}intersectMergeRange(n,r){return!!this.worksheet.getMergedCell(n,r)}_getOverflowBound(n,r,s,i,o=bt.LEFT){let a=0;if(r>s){const l=this._columnWidthAccumulation.length-1;for(let c=r;c>=s;c--){const u=c,h=this.worksheet.getCell(n,u);if(!xo(h)&&u!==r||this.intersectMergeRange(n,u))return u===r?u:u+1>l?l:u+1;const{startX:d,endX:m}=Zn(n,u,this.rowHeightAccumulation,this.columnWidthAccumulation);if(o===bt.CENTER&&u===r?a+=(m-d)/2:a+=m-d,i<a)return u}return r}for(let l=r;l<=s;l++){const c=l,u=this.worksheet.getCell(n,c);if(!xo(u)&&c!==r||this.intersectMergeRange(n,c))return c===r?c:c-1<0?0:c-1;const{startX:h,endX:d}=Zn(n,c,this.rowHeightAccumulation,this.columnWidthAccumulation);if(o===bt.CENTER&&c===r?a+=(d-h)/2:a+=d-h,i<a)return c}return s}_updateLayout(){if(!this.dirty)return;const{rowData:n,columnData:r,defaultRowHeight:s,defaultColumnWidth:i,rowCount:o,columnCount:a,rowHeader:l,columnHeader:c}=this._worksheetData,{rowTotalHeight:u,rowHeightAccumulation:h}=this._generateRowMatrixCache(o,n,s),{columnTotalWidth:d,columnWidthAccumulation:m}=this._generateColumnMatrixCache(a,r,i);this._rowHeaderWidth=l.hidden!==ae.TRUE?this._dynamicallyUpdateRowHeaderWidth(l):0,this._columnHeaderHeight=c.hidden!==ae.TRUE?c.height:0,this._rowTotalHeight=u,this._rowHeightAccumulation=h,this._columnTotalWidth=d,this._columnWidthAccumulation=m,this.makeDirty(!1)}calculate(){return this.resetCache(),this._updateLayout(),this}resetRangeCache(n){}_dynamicallyUpdateRowHeaderWidth(n){const s=`${this.worksheet.getRowCount()}`.length*8;return Math.max(n.width,s)}_hasUnMergedCellInRow(n,r,s){if(!this.worksheet.getMergeData())return!1;for(let o=r;o<=s;o++){const{isMerged:a,isMergedMainCell:l}=this.worksheet.getCellInfoInMergeData(n,o);if(!a&&!l)return!0}return!1}expandRangeByMerge(n,r){let{startRow:s,startColumn:i,endRow:o,endColumn:a}=n;const l=this._worksheetData.mergeData;if(!l)return{startRow:s,startColumn:i,endRow:o,endColumn:a};let c=!0;const u=new ct;let h=0,d=null;for(;c;){c=!1;for(let m=0;m<l.length;m++){const{startRow:_,startColumn:p,endRow:I,endColumn:y}=l[m];if(u.getValue(_,p))continue;const H={startColumn:i,startRow:s,endColumn:a,endRow:o},x={startColumn:p,startRow:_,endColumn:y,endRow:I};zu(H,x)&&(s=Math.min(s,_),i=Math.min(i,p),o=Math.max(o,I),a=Math.max(a,y),u.setValue(_,p,!0),c=!0,h++,d=x)}}return r&&h===1&&Yt.contains(d,n)?{startRow:d.startRow,startColumn:d.startColumn,endRow:d.startRow,endColumn:d.startColumn}:{startRow:s,startColumn:i,endRow:o,endColumn:a}}getColumnCount(){return this._columnWidthAccumulation.length}getRowCount(){return this._rowHeightAccumulation.length}_getCellMergeInfo(n,r){return this.worksheet.getCellInfoInMergeData(n,r)}getNoMergeCellPositionByIndex(n,r,s=!0){return this.getNoMergeCellWithCoordByIndex(n,r,s)}getNoMergeCellWithCoordByIndex(n,r,s=!0){const{rowHeightAccumulation:i,columnWidthAccumulation:o,rowHeaderWidthAndMarginLeft:a,columnHeaderHeightAndMarginTop:l}=this;let{startY:c,endY:u,startX:h,endX:d}=Zn(n,r,i,o);return s&&(c+=l,u+=l,h+=a,d+=a),{startY:c,endY:u,startX:h,endX:d}}getNoMergeCellPositionByIndexWithNoHeader(n,r){const{rowHeightAccumulation:s,columnWidthAccumulation:i}=this,{startY:o,endY:a,startX:l,endX:c}=Zn(n,r,s,i);return{startY:o,endY:a,startX:l,endX:c}}getRowIndexByOffsetY(n,r,s,i){var l;const{rowHeightAccumulation:o}=this;n=Rd(n,r,s,this.columnHeaderHeightAndMarginTop);let a=_r(o,n,i==null?void 0:i.firstMatch);return i!=null&&i.closeFirst&&Math.abs(o[a]-n)<Math.abs(n-((l=o[a-1])!=null?l:0))&&(a=a+1),a}getColumnIndexByOffsetX(n,r,s,i){var c;const o=Cd(n,r,s,this.rowHeaderWidthAndMarginLeft),{columnWidthAccumulation:a}=this;let l=_r(a,o,i==null?void 0:i.firstMatch);return i!=null&&i.closeFirst&&Math.abs(a[l]-o)<Math.abs(o-((c=a[l-1])!=null?c:0))&&(l=l+1),l}getCellIndexByOffset(n,r,s,i,o,a){const l=this.getRowIndexByOffsetY(r,i,o,a),c=this.getColumnIndexByOffsetX(n,s,o,a);return{row:l,column:c}}getCellByOffset(n,r,s,i,o){const a=this==null?void 0:this.getCellIndexByOffset(n,r,s,i,o,{firstMatch:!0});return a?this.worksheet.getCellInfoInMergeData(a.row,a.column):null}getCellWithCoordByIndex(n,r,s=!0){const{rowHeightAccumulation:i,columnWidthAccumulation:o,rowHeaderWidthAndMarginLeft:a,columnHeaderHeightAndMarginTop:l}=this,c=Zn(n,r,i,o,this.worksheet.getCellInfoInMergeData(n,r)),{isMerged:u,isMergedMainCell:h}=c;let{startY:d,endY:m,startX:_,endX:p,mergeInfo:I}=c,y=a,H=l;return s===!1&&(y=0,H=0),d+=H,m+=H,_+=y,p+=y,I.startY+=H,I.endY+=H,I.startX+=y,I.endX+=y,{actualRow:n,actualColumn:r,startX:_,startY:d,endX:p,endY:m,isMerged:u,isMergedMainCell:h,mergeInfo:I}}getCellWithCoordByOffset(n,r,s,i,o,a){const{row:l,column:c}=this.getCellIndexByOffset(n,r,s,i,o,a);return this.getCellWithCoordByIndex(l,c)}getOffsetByColumn(n){const{columnWidthAccumulation:r,rowHeaderWidthAndMarginLeft:s}=this,i=r.length-1,o=r[n];return o!=null?o+s:n<0?s:r[i]+s}getOffsetByRow(n){const{rowHeightAccumulation:r,columnHeaderHeightAndMarginTop:s}=this,i=r.length-1,o=r[n];return o!=null?o+s:n<0?s:r[i]+s}getOffsetRelativeToRowCol(n,r){const s=_r(this.columnWidthAccumulation,n);let i=0;s===0?i=n:i=n-this._columnWidthAccumulation[s-1];const o=_r(this.rowHeightAccumulation,r);let a=0;return o===0?a=r:a=r-this._rowHeightAccumulation[o-1],{row:o,column:s,columnOffset:i,rowOffset:a}}_updateConfigAndGetDocumentModel(n,r,s,i){var a,l,c,u,h;if(!i||!((a=n.body)!=null&&a.dataStream))return;n.documentStyle||(n.documentStyle={}),n.documentStyle.marginTop=(l=s.t)!=null?l:0,n.documentStyle.marginBottom=(c=s.b)!=null?c:2,n.documentStyle.marginLeft=(u=s.l)!=null?u:2,n.documentStyle.marginRight=(h=s.r)!=null?h:2,n.documentStyle.pageSize={width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},n.documentStyle.renderConfig={...n.documentStyle.renderConfig,...i};const o=n.body.paragraphs||[];for(const d of o)d.paragraphStyle||(d.paragraphStyle={}),d.paragraphStyle.horizontalAlign=r;return new Tt(n)}dispose(){super.dispose(),this._rowHeightAccumulation=[],this._columnWidthAccumulation=[],this._rowTotalHeight=0,this._columnTotalWidth=0,this._rowHeaderWidth=0,this._columnHeaderHeight=0,this._worksheetData=null,this._cellData=null,this._styles=null,this.worksheet=null}},f.SheetSkeleton=yI([si(2,Ce.Inject(On)),si(3,Un),si(4,fr),si(5,Ce.Inject(Ce.Injector))],f.SheetSkeleton);function pa(e,t,n,r){const s=e-1,i=t-1,o=n[s]||0;let a=n[e];a==null&&(a=n[n.length-1]);const l=r[i]||0;let c=r[t];return c==null&&(c=r[r.length-1]),{startY:o,endY:a,startX:l,endX:c}}function AI(e,t,n,r){return pa(e,t,n,r)}function Zn(e,t,n,r,s){e=Z.clamp(e,0,n.length-1),t=Z.clamp(t,0,r.length-1);let{startY:i,endY:o,startX:a,endX:l}=pa(e,t,n,r);if(!s)return{startY:i,endY:o,startX:a,endX:l,isMerged:!1,isMergedMainCell:!1,actualRow:e,actualColumn:t,mergeInfo:{startY:i,endY:o,startX:a,endX:l,startRow:e,startColumn:t,endRow:e,endColumn:t}};const{isMerged:c,isMergedMainCell:u,startRow:h,startColumn:d,endRow:m,endColumn:_}=s;let p={startRow:h,startColumn:d,endRow:m,endColumn:_,startY:i,endY:o,startX:a,endX:l};const I=n.length-1,y=r.length-1;if(c&&h!==-1&&d!==-1){const H=n[h-1]||0,x=n[m]||n[I],Y=r[d-1]||0,O=r[_]||r[y];p={...p,startY:H,endY:x,startX:Y,endX:O}}else if(!c&&m!==-1&&_!==-1){const H=n[m]||n[I],x=r[_]||r[y];p={...p,startY:i,endY:H,startX:a,endX:x}}return{isMerged:c,isMergedMainCell:u,actualRow:e,actualColumn:t,startY:i,endY:o,startX:a,endX:l,mergeInfo:p}}function Cd(e,t,n,r){const{x:s}=n;return e/t+s-r}function Rd(e,t,n,r){const{y:s}=n;return e=e/t+s-r,e}const TI=["script","style","meta","comment","link"];var Id=(e=>(e[e.INFO=0]="INFO",e[e.STOP=1]="STOP",e[e.WARNING=2]="WARNING",e))(Id||{}),Sd=(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))(Sd||{}),Od=(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))(Od||{}),wd=(e=>(e[e.TEXT=0]="TEXT",e[e.ARROW=1]="ARROW",e[e.CUSTOM=2]="CUSTOM",e))(wd||{}),vd=(e=>(e.VALID="valid",e.INVALID="invalid",e.VALIDATING="validating",e))(vd||{}),bd=(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))(bd||{}),NI=Object.getOwnPropertyDescriptor,MI=(e,t,n,r)=>{for(var s=r>1?void 0:r?NI(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},yd=(e,t)=>(n,r)=>t(n,r,e);let Ea=class extends Ke{constructor(e,t){super(),this._resourceManagerService=e,this._univerInstanceService=t,this._init()}_init(){const e=n=>{n.businesses.forEach(r=>{switch(r){case ve.UNRECOGNIZED:case ve.UNIVER_UNKNOWN:case ve.UNIVER_SLIDE:case ve.UNIVER_DOC:{this._univerInstanceService.getAllUnitsForType(ve.UNIVER_DOC).forEach(s=>{const o=(s.getSnapshot().resources||[]).find(a=>a.name===n.pluginName);if(o)try{const a=n.parseJson(o.data);n.onLoad(s.getUnitId(),a)}catch{console.error(`Load Document{${s.getUnitId()}} Resources{${n.pluginName}} Data Error.`)}});break}case ve.UNIVER_SHEET:this._univerInstanceService.getAllUnitsForType(ve.UNIVER_SHEET).forEach(s=>{const o=(s.getSnapshot().resources||[]).find(a=>a.name===n.pluginName);if(o)try{const a=n.parseJson(o.data);n.onLoad(s.getUnitId(),a)}catch{console.error(`Load Workbook{${s.getUnitId()}} Resources{${n.pluginName}} Data Error.`)}})}})};this._resourceManagerService.getAllResourceHooks().forEach(n=>e(n)),this.disposeWithMe(this._resourceManagerService.register$.subscribe(n=>e(n))),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(ve.UNIVER_SHEET).subscribe(n=>{this._resourceManagerService.loadResources(n.getUnitId(),n.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(ve.UNIVER_DOC).subscribe(n=>{const r=n.getUnitId();ya(r)||this._resourceManagerService.loadResources(n.getUnitId(),n.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(ve.UNIVER_SHEET).subscribe(n=>{this._resourceManagerService.unloadResources(n.getUnitId(),ve.UNIVER_SHEET)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(ve.UNIVER_DOC).subscribe(n=>{this._resourceManagerService.unloadResources(n.getUnitId(),ve.UNIVER_DOC)}))}saveUnit(e){const t=this._univerInstanceService.getUnit(e);if(!t)return null;const n=this._resourceManagerService.getResources(e,t.type),r=Z.deepClone(t.getSnapshot());return r.resources=n,r}};Ea=MI([yd(0,Ce.Inject(Qs)),yd(1,Ce.Inject(Jn))],Ea);class DI{constructor(t={},n){E(this,"_startedTypes",new Set);E(this,"_injector");E(this,"_disposingCallbacks",new os);const r=this._injector=LI(n,t==null?void 0:t.override),{theme:s,darkMode:i,locale:o,locales:a,logLevel:l,logCommandExecution:c}=t;s&&this._injector.get(ni).setTheme(s),i&&this._injector.get(ni).setDarkMode(i),a&&this._injector.get(On).load(a),o&&this._injector.get(On).setLocale(o),l&&this._injector.get(dt).setLogLevel(l),c!==void 0&&this._injector.get(fr).setConfig(gs,c),this._init(r)}get _univerInstanceService(){return this._injector.get(Jn)}get _pluginService(){return this._injector.get(f.PluginService)}__getInjector(){return this._injector}onDispose(t){const n=this._disposingCallbacks.add(Ye(t));return Ye(()=>n.dispose(!0))}dispose(){this._disposingCallbacks.dispose(),this._injector.dispose()}setLocale(t){this._injector.get(On).setLocale(t)}createUnit(t,n){return this._univerInstanceService.createUnit(t,n)}createUniverSheet(t){return this._injector.get(dt).warn("[Univer]","Univer.createUniverSheet is deprecated, use createUnit instead"),this._univerInstanceService.createUnit(ve.UNIVER_SHEET,t)}createUniverDoc(t){return this._injector.get(dt).warn("[Univer]","Univer.createUniverDoc is deprecated, use createUnit instead"),this._univerInstanceService.createUnit(ve.UNIVER_DOC,t)}createUniverSlide(t){return this._injector.get(dt).warn("[Univer]","Univer.createUniverSlide is deprecated, use createUnit instead"),this._univerInstanceService.createUnit(ve.UNIVER_SLIDE,t)}_init(t){this._univerInstanceService.registerCtorForType(ve.UNIVER_SHEET,f.Workbook),this._univerInstanceService.registerCtorForType(ve.UNIVER_DOC,Tt),this._univerInstanceService.registerCtorForType(ve.UNIVER_SLIDE,oa);const n=t.get(Jn);n.__setCreateHandler((r,s,i,o)=>{if(!this._startedTypes.has(r)){this._pluginService.startPluginsForType(r),this._startedTypes.add(r);const l=t.createInstance(i,s);return n.__addUnit(l,o),this._tryProgressToReady(),l}const a=t.createInstance(i,s);return n.__addUnit(a,o),a})}_tryProgressToReady(){this._injector.get(f.LifecycleService).stage<Fe.Ready&&(this._injector.get(f.LifecycleService).stage=Fe.Ready)}registerPlugin(t,n){this._pluginService.registerPlugin(t,n)}registerPlugins(t){t.forEach(n=>{const[r,s]=n;this._pluginService.registerPlugin(r,s)})}}function LI(e,t){const n=ld([[Lh],[On],[ni],[f.LifecycleService],[f.PluginService],[Br],[Jn,{useClass:f.UniverInstanceService}],[od,{useClass:ad}],[dt,{useClass:Mc,lazy:!0}],[gr,{useClass:f.CommandService}],[ri,{useClass:f.LocalUndoRedoService,lazy:!0}],[fr,{useClass:Ac}],[Un,{useClass:Tc}],[Qs,{useClass:f.ResourceManagerService,lazy:!0}],[ha,{useClass:Ea,lazy:!0}],[Nh,{useClass:f.AuthzIoLocalService}],[id,{useClass:f.MentionIOLocalService,lazy:!0}]],t),r=e?e.createChild(n):new Ce.Injector(n);return Aa(r,[[Br],[ha]]),r}Pd(),f.ABCToNumber=X0,f.AUTO_HEIGHT_FOR_MERGED_CELLS=ba,f.AbsoluteRefType=Me,f.ActionIterator=Xn,f.AlignTypeH=lc,f.AlignTypeV=cc,f.ArrangeTypeEnum=dc,f.ArrowsAndMarkersShapes=Ul,f.AsyncInterceptorManager=rf,f.AsyncLock=Vd,f.AutoFillSeries=Ol,f.BaselineOffset=jt,f.BasicShapes=Ll,f.BlockType=jl,f.BooleanNumber=ae,f.BorderStyleTypes=Pe,f.BorderType=wl,f.BuildTextUtils=Qe,f.BulletAlignment=hr,f.COLORS=Hi,f.COMMAND_LOG_EXECUTION_CONFIG_KEY=gs,f.CanceledError=Jd,f.CellModeEnum=Pn,f.CellValueType=Qt,f.Color=Cn,f.ColorBuilder=Es,f.ColorKit=It,f.ColorType=Rt,f.ColumnSeparatorType=Vl,f.CommandType=mr,f.CommonHideTypes=vl,f.ConfigService=Ac,f.ContextService=Tc,f.CopyPasteType=bl,f.CustomCommandExecutionError=Zr,f.CustomDecorationType=_n,f.CustomRangeType=en,f.DEFAULT_CELL=v0,f.DEFAULT_DOC=qo,f.DEFAULT_DOCUMENT_SUB_COMPONENT_ID=cR,f.DEFAULT_EMPTY_DOCUMENT_VALUE=wa,f.DEFAULT_NUMBER_FORMAT=Po,f.DEFAULT_RANGE=O0,f.DEFAULT_RANGE_ARRAY=S0,f.DEFAULT_SELECTION=w0,f.DEFAULT_SLIDE=$u,f.DEFAULT_STYLES=it,f.DEFAULT_TEXT_FORMAT=Iu,f.DEFAULT_TEXT_FORMAT_EXCEL=Su,f.DEFAULT_WORKSHEET_COLUMN_COUNT=Gh,f.DEFAULT_WORKSHEET_COLUMN_COUNT_KEY=$R,f.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT=Jh,f.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY=VR,f.DEFAULT_WORKSHEET_COLUMN_WIDTH=Xh,f.DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY=WR,f.DEFAULT_WORKSHEET_ROW_COUNT=zh,f.DEFAULT_WORKSHEET_ROW_COUNT_KEY=BR,f.DEFAULT_WORKSHEET_ROW_HEIGHT=Kh,f.DEFAULT_WORKSHEET_ROW_HEIGHT_KEY=jR,f.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH=qh,f.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY=YR,f.DOCS_COMMENT_EDITOR_UNIT_ID_KEY=Oa,f.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY=ci,f.DOCS_NORMAL_EDITOR_UNIT_ID_KEY=li,f.DOCS_ZEN_EDITOR_UNIT_ID_KEY=Sa,f.DOC_DRAWING_PRINTING_COMPONENT_KEY=N0,f.DOC_RANGE_TYPE=Wc,f.DashStyleType=Jl,f.DataStreamTreeNodeType=Sh,f.DataStreamTreeTokenType=ut,f.DataValidationErrorStyle=Id,f.DataValidationImeMode=Sd,f.DataValidationOperator=Od,f.DataValidationRenderMode=wd,f.DataValidationStatus=vd,f.DataValidationType=bd,f.DeleteDirection=yl,f.DependentOn=hI,f.DesktopLogService=Mc,f.DeveloperMetadataVisibility=Al,f.Dimension=Tl,f.Direction=Nl,f.Disposable=Ke,f.DisposableCollection=os,f.DocStyleType=Bl,f.DocumentDataModel=Tt,f.DocumentFlavor=Ti,f.DrawingTypeEnum=fc,f.EDITOR_ACTIVATED=Mh,f.EXTENSION_NAMES=ju,f.ErrorService=Lh,f.EventState=Ah,f.EventSubject=uR,f.FOCUSING_COMMENT_EDITOR=IR,f.FOCUSING_COMMON_DRAWINGS=wR,f.FOCUSING_DOC=jr,f.FOCUSING_EDITOR_BUT_HIDDEN=pR,f.FOCUSING_EDITOR_INPUT_FORMULA=ER,f.FOCUSING_EDITOR_STANDALONE=RR,f.FOCUSING_FX_BAR_EDITOR=Dh,f.FOCUSING_PANEL_EDITOR=SR,f.FOCUSING_SHEET=qn,f.FOCUSING_SLIDE=Wr,f.FOCUSING_UNIT=$r,f.FOCUSING_UNIVER_EDITOR=CR,f.FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE=OR,f.FORMULA_EDITOR_ACTIVATED=vR,f.FollowNumberWithType=$l,f.FontItalic=cs,f.FontStyleType=Ln,f.FontWeight=us,f.GridType=Wl,f.HLSColor=xc,f.HorizontalAlign=bt,f.IAuthzIoService=Nh,f.ICommandService=gr,f.IConfigService=fr,f.IConfirmService=gR,f.IContextService=Un,f.IImageIoService=ra,f.ILocalStorageService=rI,f.ILogService=dt,f.IMentionIOService=id,f.IPermissionService=od,f.IResourceLoaderService=ha,f.IResourceManagerService=Qs,f.IS_ROW_STYLE_PRECEDE_COLUMN_STYLE=va,f.IURLImageService=sa,f.IUndoRedoService=ri,f.IUniverInstanceService=Jn,f.ImageCacheMap=gd,f.ImageSourceType=ti,f.ImageUploadStatusType=Uh,f.InterceptorEffectEnum=An,f.InterceptorManager=ef,f.InterpolationPointType=Ml,f.JSON1=$_,f.JSONX=Vt,f.LRUHelper=Nr,f.LRUMap=Tr,f.LifecycleStages=Fe,f.LifecycleUnreachableError=rd,f.ListGlyphType=fe,f.LocaleService=On,f.LocaleType=cr,f.LogLevel=Nc,f.MOVE_BUFFER_VALUE=pr,f.MemoryCursor=fn,f.MentionType=ls,f.NAMED_STYLE_MAP=y0,f.NAMED_STYLE_SPACE_MAP=A0,f.NamedStyleType=Je,f.NilCommand=Dc,f.NumberUnitType=ac,f.ObjectMatrix=ct,f.ObjectRelativeFromH=ic,f.ObjectRelativeFromV=oc,f.OtherShapes=Pl,f.PAGE_SIZE=M0,f.PAPER_TYPES=L_,f.PRESET_LIST_TYPE=kr,f.PRINT_CHART_COMPONENT_KEY=T0,f.PageElementType=mc,f.PageOrientType=hc,f.PageType=Ni,f.PaperType=ht,f.ParagraphElementType=Gl,f.ParagraphStyleBuilder=Hr,f.ParagraphStyleValue=xr,f.PermissionService=ad,f.PermissionStatus=la,f.Plugin=ua,f.PositionedObjectLayoutType=Xl,f.PresetListType=xt,f.ProtectionType=Dl,f.QuickListType=uh,f.QuickListTypeMap=oC,f.RANGE_DIRECTION=jc,f.RANGE_TYPE=pe,f.RBush=Vs,f.RCDisposable=E_,f.RGBA_PAREN=rp,f.RGB_PAREN=np,f.ROTATE_BUFFER_VALUE=kc,f.RTree=RI,f.Range=Yn,f.Rectangle=Yt,f.RedoCommand=md,f.RedoCommandId=hd,f.RefAlias=K0,f.Registry=vi,f.RegistryAsMap=bi,f.RelativeDate=Fl,f.RelativeSlideLink=gc,f.RgbColor=Cs,f.RichTextBuilder=Sn,f.RichTextValue=an,f.RxDisposable=p_,f.SHEET_EDITOR_UNITS=b0,f.SectionType=Yl,f.SheetTypes=xl,f.SheetViewModel=Qh,f.SliceBodyType=Ko,f.SlideDataModel=oa,f.SpacingRule=ql,f.SpecialShapes=kl,f.Styles=Ph,f.THEME_COLORS=Fc,f.TabStopAlignment=Zl,f.TableAlignmentType=ec,f.TableLayoutType=tc,f.TableRowHeightRule=rc,f.TableSizeType=Ql,f.TableTextWrapType=nc,f.TestConfirmService=_R,f.TextDecoration=Hl,f.TextDecorationBuilder=on,f.TextDirection=ur,f.TextDirectionType=zl,f.TextStyleBuilder=sn,f.TextStyleValue=Fr,f.TextX=De,f.TextXActionType=J,f.ThemeColor=Rs,f.ThemeColorType=at,f.ThemeColors=hs,f.ThemeService=ni,f.Tools=Z,f.UndoCommand=fd,f.UndoCommandId=dd,f.UnitModel=as,f.Univer=DI,f.UniverInstanceType=ve,f.UpdateDocsAttributeType=Re,f.UserManagerService=Br,f.VerticalAlign=mn,f.VerticalAlignmentType=sc,f.Worksheet=Vr,f.WrapStrategy=gn,f.WrapTextType=Kl,f.addLinkToDocumentModel=xh,f.afterInitApply=J_,f.afterTime=X_,f.awaitTime=II,f.binSearchFirstGreaterThanTarget=Pc,f.binarySearchArray=Z_,f.bufferDebounceTime=K_,f.cellToRange=NE,f.characterSpacingControlType=uc,f.checkForSubstrings=DE,f.checkIfMove=ep,f.checkParagraphHasBullet=m0,f.checkParagraphHasIndent=g0,f.checkParagraphHasIndentByStyle=Fu,f.cloneCellData=jh,f.cloneCellDataMatrix=Wh,f.cloneCellDataWithSpanAndDisplay=PR,f.cloneValue=gt,f.cloneWorksheetData=Vh,f.codeToBlob=Q_,f.composeBody=Xo,f.composeInterceptors=Na,f.composeStyles=lr,f.concatMatrixArray=CE,f.convertBodyToHtml=tp,f.convertCellToRange=wu,f.convertObservableToBehaviorSubject=q_,f.covertCellValue=Ho,f.covertCellValues=ME,f.covertTextRunToHtml=xi,f.createAsyncInterceptorKey=tf,f.createDefaultUser=ei,f.createDocumentModelWithStyle=Yr,f.createInterceptorKey=Qd,f.createInternalEditorID=Kd,f.createREGEXFromWildChar=M_,f.createRowColIter=Yo,f.customNameCharacterCheck=CI,f.dayjs=Wt,f.debounce=s_,f.dedupe=kd,f.dedupeBy=Fd,f.deepCompare=Bo,f.delayAnimationFrame=SI,f.deleteContent=Hu,f.extractPureTextFromCell=td,f.fromCallback=Lc,f.fromEventSubject=hR,f.generateRandomId=nt,f.get=ul,f.getArrayLength=rn,f.getBodySlice=At,f.getBodySliceHtml=ps,f.getBorderStyleType=yE,f.getCellCoordByIndexSimple=pa,f.getCellInfoInMergeData=Rp,f.getCellPositionByIndexSimple=AI,f.getCellValueType=pp,f.getCellWithCoordByIndexCore=Zn,f.getColorStyle=Ft,f.getCustomBlockSlice=gh,f.getCustomDecorationSlice=ph,f.getCustomRangeSlice=_h,f.getDocsUpdateBody=AE,f.getEmptyCell=DR,f.getIntersectRange=zu,f.getNumfmtParseValueFilter=Ou,f.getOriginCellValue=GR,f.getParagraphsSlice=mh,f.getPlainText=Zs,f.getReverseDirection=D_,f.getSectionBreakSlice=gC,f.getTableSlice=fh,f.getTextRunSlice=Js,f.getTransformOffsetX=Cd,f.getTransformOffsetY=Rd,f.getWorksheetUID=JR,f.groupBy=Bd,f.handleStyleToString=bE,f.hashAlgorithm=p0,f.horizontalLineSegmentsSubtraction=Ws,f.insertMatrixArray=EE,f.insertTextToContent=xu,f.invertColorByHSL=uf,f.invertColorByMatrix=df,f.isBlackColor=gp,f.isBooleanString=Gd,f.isCellCoverable=xo,f.isCellV=$c,f.isCommentEditorID=Xd,f.isDefaultFormat=fE,f.isEmptyCell=vu,f.isFormulaId=vE,f.isFormulaString=bu,f.isICellData=Bc,f.isInternalEditorID=ya,f.isNodeEnv=N_,f.isNotNullOrUndefined=Hh,f.isNullCell=Ep,f.isNumeric=pl,f.isPatternEqualWithoutDecimal=mE,f.isRangesEqual=AR,f.isRealNum=_0,f.isSafeNumeric=d_,f.isSameStyleTextRun=yu,f.isTextFormat=dE,f.isUnitRangesEqual=TR,f.isValidRange=TE,f.isWhiteColor=_p,f.makeArray=$d,f.makeCellRangeToRangeData=wE,f.makeCellToSelection=OE,f.makeCustomRangeStream=TC,f.mapObjectMatrix=pE,f.merge=is,f.mergeLocales=E0,f.mergeOverrideWithDependencies=ld,f.mergeSets=g_,f.mergeWith=l_,f.mergeWorksheetSnapshotWithDefault=Zh,f.mixinClass=h_,f.moveMatrixArray=Fo,f.moveRangeByOffset=x0,f.nameCharacterCheck=EI,f.normalizeBody=_C,f.normalizeTextRuns=Pr,f.numberToABC=J0,f.numberToListABC=Z0,f.numfmt=hE,f.queryObjectMatrix=G0,f.registerDependencies=qd,f.remove=rr,f.repeatStringNumTimes=qu,f.replaceInDocumentBody=aR,f.requestImmediateMacroTask=m_,f.resolveWithBasePath=S_,f.rotate=Hd,f.searchArray=_r,f.searchInOrderedArray=Uc,f.selectionToArray=Cp,f.sequence=Cl,f.sequenceAsync=El,f.sequenceExecute=_s,f.sequenceExecuteAsync=G_,f.set=u_,f.shallowEqual=Ta,f.skipParseTagNames=TI,f.sliceMatrixArray=RE,f.sortRules=Q0,f.sortRulesByDesc=eC,f.sortRulesFactory=Ur,f.spliceArray=ko,f.splitIntoGrid=Wo,f.takeAfter=Fi,f.textDiff=Zo,f.throttle=Zd,f.toDisposable=Ye,f.touchDependencies=Aa,f.updateAttributeByDelete=Eh,f.updateAttributeByInsert=Ch,f.willLoseNumericPrecision=f_,Object.keys(Ce).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(f,e)&&Object.defineProperty(f,e,{enumerable:!0,get:()=>Ce[e]})}),Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(f,Ce){typeof exports=="object"&&typeof module<"u"?Ce(exports,require("@wendellhu/redi"),require("rxjs"),require("rxjs/operators"),require("@univerjs/themes")):typeof define=="function"&&define.amd?define(["exports","@wendellhu/redi","rxjs","rxjs/operators","@univerjs/themes"],Ce):(f=typeof globalThis<"u"?globalThis:f||self,Ce(f.UniverCore={},f["@wendellhu/redi"],f.rxjs,f.rxjs.operators,f.UniverThemes))})(this,(function(f,Ce,se,Xr,qr){"use strict";var FI=Object.defineProperty;var xI=(f,Ce,se)=>Ce in f?FI(f,Ce,{enumerable:!0,configurable:!0,writable:!0,value:se}):f[Ce]=se;var E=(f,Ce,se)=>xI(f,typeof Ce!="symbol"?Ce+"":Ce,se);var Ad,Td;function Md(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const Ut=typeof global<"u"?global:typeof self<"u"?self:window;function Dd(){const t=new Map;let n=0;typeof Ut.requestIdleCallback!="function"&&(Ut.requestIdleCallback=function(s){const i=Date.now(),o=++n,a=setTimeout(function(){t.delete(o);const c=Math.max(0,50-(Date.now()-i));s({didTimeout:c===0,timeRemaining(){return c}})},1);return t.set(o,a),o}),typeof Ut.cancelIdleCallback!="function"&&(Ut.cancelIdleCallback=function(s){const i=t.get(s);i!==void 0&&(clearTimeout(i),t.delete(s))})}function Ld(){typeof Ut.Array.prototype.findLastIndex!="function"&&(Ut.Array.prototype.findLastIndex=function(t,n){if(this==null)throw new TypeError("Array.prototype.findLastIndex called on null or undefined");if(typeof t!="function")throw new TypeError("callback must be a function");const r=this.length>>>0;for(let s=r-1;s>=0;s--)if(s in this&&t.call(n,this[s],s,this))return s;return-1}),typeof Ut.Array.prototype.findLast!="function"&&(Ut.Array.prototype.findLast=function(t,n){const r=this.findLastIndex(t,n);return r!==-1?this[r]:void 0})}function Ud(){typeof Ut.String.prototype.at!="function"&&(Ut.String.prototype.at=function(t){if(this==null)throw new TypeError("String.prototype.at called on null or undefined");const n=this.length;if(t<0&&(t=n+t),!(t<0||t>=n))return this.charAt(t)})}function Pd(){Dd(),Ld(),Ud()}function rr(e,t){const n=e.indexOf(t);return n>-1?(e.splice(n,1),!0):!1}function kd(e){const t=new Set,n=[];for(const r of e)t.has(r)||(t.add(r),n.push(r));return n}function Fd(e,t){const n=new Set,r=[];for(const s of e){const i=t(s);n.has(i)||(n.add(i),r.push(s))}return r}function xd(e,t){for(let n=e.length-1;n>-1;n--){const r=e[n];if(t(r,n))return r}return null}function Hd(e,t){if(e.length===0)return e;const n=t%e.length;return e.slice(n).concat(e.slice(0,n))}function Bd(e,t){const n=new Map;return e.forEach(r=>{const s=t(r);let i=n.get(s);n.has(s)||(i=[],n.set(s,i)),i.push(r)}),n}function $d(e){return Array.isArray(e)?e:[e]}function pt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oi,Ra;function jd(){if(Ra)return oi;Ra=1;var e=function(t){if(t=t||{},this.Promise=t.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=t.domainReentrant||!1,this.domainReentrant){if(typeof process>"u"||typeof process.domain>"u")throw new Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=t.timeout||e.DEFAULT_TIMEOUT,this.maxOccupationTime=t.maxOccupationTime||e.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=t.maxExecutionTime||e.DEFAULT_MAX_EXECUTION_TIME,t.maxPending===1/0||Number.isInteger(t.maxPending)&&t.maxPending>=0?this.maxPending=t.maxPending:this.maxPending=e.DEFAULT_MAX_PENDING};return e.DEFAULT_TIMEOUT=0,e.DEFAULT_MAX_OCCUPATION_TIME=0,e.DEFAULT_MAX_EXECUTION_TIME=0,e.DEFAULT_MAX_PENDING=1e3,e.prototype.acquire=function(t,n,r,s){if(Array.isArray(t))return this._acquireBatch(t,n,r,s);if(typeof n!="function")throw new Error("You must pass a function to execute");var i=null,o=null,a=null;typeof r!="function"&&(s=r,r=null,a=new this.Promise(function(x,Y){i=x,o=Y})),s=s||{};var l=!1,c=null,u=null,h=null,d=this,m=function(x,Y,O){u&&(clearTimeout(u),u=null),h&&(clearTimeout(h),h=null),x&&(d.queues[t]&&d.queues[t].length===0&&delete d.queues[t],d.domainReentrant&&delete d.domains[t]),l||(a?Y?o(Y):i(O):typeof r=="function"&&r(Y,O),l=!0),x&&d.queues[t]&&d.queues[t].length>0&&d.queues[t].shift()()},_=function(x){if(l)return m(x);c&&(clearTimeout(c),c=null),d.domainReentrant&&x&&(d.domains[t]=process.domain);var Y=s.maxExecutionTime||d.maxExecutionTime;if(Y&&(h=setTimeout(function(){d.queues[t]&&m(x,new Error("Maximum execution time is exceeded "+t))},Y)),n.length===1){var O=!1;try{n(function(R,b){O||(O=!0,m(x,R,b))})}catch(R){O||(O=!0,m(x,R))}}else d._promiseTry(function(){return n()}).then(function(R){m(x,void 0,R)},function(R){m(x,R)})};d.domainReentrant&&process.domain&&(_=process.domain.bind(_));var p=s.maxPending||d.maxPending;if(!d.queues[t])d.queues[t]=[],_(!0);else if(d.domainReentrant&&process.domain&&process.domain===d.domains[t])_(!1);else if(d.queues[t].length>=p)m(!1,new Error("Too many pending tasks in queue "+t));else{var I=function(){_(!0)};s.skipQueue?d.queues[t].unshift(I):d.queues[t].push(I);var y=s.timeout||d.timeout;y&&(c=setTimeout(function(){c=null,m(!1,new Error("async-lock timed out in queue "+t))},y))}var H=s.maxOccupationTime||d.maxOccupationTime;if(H&&(u=setTimeout(function(){d.queues[t]&&m(!1,new Error("Maximum occupation time is exceeded in queue "+t))},H)),a)return a},e.prototype._acquireBatch=function(t,n,r,s){typeof r!="function"&&(s=r,r=null);var i=this,o=function(l,c){return function(u){i.acquire(l,c,u,s)}},a=t.reduceRight(function(l,c){return o(c,l)},n);if(typeof r=="function")a(r);else return new this.Promise(function(l,c){a.length===1?a(function(u,h){u?c(u):l(h)}):l(a())})},e.prototype.isBusy=function(t){return t?!!this.queues[t]:Object.keys(this.queues).length>0},e.prototype._promiseTry=function(t){try{return this.Promise.resolve(t())}catch(n){return this.Promise.reject(n)}},oi=e,oi}var ai,Ia;function Wd(){return Ia||(Ia=1,ai=jd()),ai}var Yd=Wd();const Vd=pt(Yd),zd=new Set(["true","false"]);function Gd(e){return zd.has(e.toLowerCase())}const yn="__INTERNAL_EDITOR__",li=`${yn}DOCS_NORMAL`,ci=`${yn}DOCS_FORMULA_BAR`,Sa=`${yn}ZEN_EDITOR`,Oa=`${yn}COMMENT_EDITOR`,va=`\r
2
+ `,wa="isRowStylePrecedeColumnStyle",ba=Symbol("AUTO_HEIGHT_FOR_MERGED_CELLS");function Kd(e){return`${yn}${e}`}function ya(e){return e.startsWith(yn)}function Xd(e){return e===Oa}function qd(e,t){t.forEach(n=>e.add(n))}function Aa(e,t){t.forEach(([n])=>{e.has(n)&&e.get(n)})}function Ta(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const s=Object.prototype.hasOwnProperty.bind(t);for(let i=0;i<n.length;i++){const o=n[i];if(!s(o))return!1;const a=e[o],l=t[o];if(a!==l)return!1}return!0}class Jr extends Error{constructor(t){super(t),this.name="CustomCommandExecutionError"}}class Jd extends Jr{constructor(){super("Canceled by facade"),this.name="CanceledError"}}function Zd(e,t=16){let n=0,r=null;return function(...i){const o=Date.now();o-n<t?(r&&clearTimeout(r),r=setTimeout(()=>{n=o,e.apply(this,i)},t)):(n=o,e.apply(this,i))}}var An=(e=>(e[e.Style=1]="Style",e[e.Value=2]="Value",e))(An||{});function Qd(e){return`sheet_interceptor_${e}`}const Na=e=>function(t,n){let r=-1,s=t;for(let i=0;i<=e.length;i++){if(i<=r)throw new Error("[SheetInterceptorService]: next() called multiple times!");if(r=i,i===e.length)return s;const o=e[i];let a=!1;if(s=o.handler(s,n,l=>(a=!0,l)),!a)break}return s};class ef{constructor(t){E(this,"_interceptorsByName",new Map);E(this,"_interceptorPoints");this._interceptorPoints=t}fetchThroughInterceptors(t,n){const r=t;let s=this._interceptorsByName.get(r);return n&&(s=s.filter(n)),Na(s||[])}intercept(t,n){const r=t;this._interceptorsByName.has(r)||this._interceptorsByName.set(r,[]);const s=this._interceptorsByName.get(r);return s.push(n),this._interceptorsByName.set(r,s.sort((i,o)=>{var a,l;return((a=o.priority)!=null?a:0)-((l=i.priority)!=null?l:0)})),()=>rr(this._interceptorsByName.get(r),n)}getInterceptPoints(){return this._interceptorPoints}dispose(){this._interceptorsByName.clear()}}function tf(e){return`sheet_async_interceptor_${e}`}const nf=e=>async function(t,n){let r=-1,s=t;for(let i=0;i<=e.length;i++){if(i<=r)throw new Error("[SheetInterceptorService]: next() called multiple times!");if(r=i,i===e.length)return s;const o=e[i];let a=!1;if(s=await o.handler(s,n,async l=>(a=!0,l)),!a)break}return s};class rf{constructor(t){E(this,"_asyncInterceptorsByName",new Map);E(this,"_asyncInterceptorPoints");this._asyncInterceptorPoints=t}fetchThroughAsyncInterceptors(t,n){const r=t;let s=this._asyncInterceptorsByName.get(r);return n&&(s=s.filter(n)),nf(s||[])}async interceptAsync(t,n){const r=t;this._asyncInterceptorsByName.has(r)||this._asyncInterceptorsByName.set(r,[]);const s=this._asyncInterceptorsByName.get(r);return s.push(n),this._asyncInterceptorsByName.set(r,s.sort((i,o)=>{var a,l;return((a=o.priority)!=null?a:0)-((l=i.priority)!=null?l:0)})),()=>rr(this._asyncInterceptorsByName.get(r),n)}getInterceptPoints(){return this._asyncInterceptorPoints}dispose(){this._asyncInterceptorsByName.clear()}}function Ma(e){return e.map(t=>t/255)}function Da(e){return e.map(t=>Math.round(t*255))}function sf([e,t,n]){const r=Math.max(e,t,n),s=Math.min(e,t,n),i=(r+s)/2;let o=0,a=0;if(r!==s){const l=r-s;switch(a=i>.5?l/(2-r-s):l/(r+s),r){case e:o=(t-n)/l+(t<n?6:0);break;case t:o=(n-e)/l+2;break;case n:o=(e-t)/l+4;break}o/=6}return[o,a,i]}function Zr(e,t,n){const r=[e,t,n].map(s=>s<=.03928?s/12.92:((s+.055)/1.055)**2.4);return .2126*r[0]+.7152*r[1]+.0722*r[2]}function La(e,t){return(Math.max(e,t)+.05)/(Math.min(e,t)+.05)}function of(e,t,n){let r,s,i;if(t===0)r=s=i=n;else{const o=(c,u,h)=>{let d=h;return d<0&&(d+=1),d>1&&(d-=1),d<.16666666666666666?c+(u-c)*6*d:d<.5?u:d<.6666666666666666?c+(u-c)*(.6666666666666666-d)*6:c},a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;r=o(l,a,e+1/3),s=o(l,a,e),i=o(l,a,e-1/3)}return[r,s,i]}const ui={r:1,g:1,b:1},hi={r:0,g:0,b:0},af=Zr(ui.r,ui.g,ui.b),lf=Zr(hi.r,hi.g,hi.b);function cf(e){const t=Zr(e[0],e[1],e[2]),n=La(af,t),r=sf(e);let s=1-r[2],i,o,a;do i=of(r[0],r[1],s),o=Zr(i[0],i[1],i[2]),a=La(o,lf),s+=.01;while(s<=1&&s>=0&&Math.abs(a-n)<.01);return i}function uf(e){return Da(cf(Ma(e)))}const Et=[[.333,-.667,-.667,0,1],[-.667,.333,-.667,0,1],[-.667,-.667,.333,0,1],[0,0,0,1,0]];function hf(e){const t=e[0],n=e[1],r=e[2];let s=[Et[0][0]*t+Et[0][1]*n+Et[0][2]*r+Et[0][4],Et[1][0]*t+Et[1][1]*n+Et[1][2]*r+Et[1][4],Et[2][0]*t+Et[2][1]*n+Et[2][2]*r+Et[2][4]];return s=s.map(i=>i>1?1:i<0?0:i),s}function df(e){return Da(hf(Ma(e)))}var Ua=typeof global=="object"&&global&&global.Object===Object&&global,ff=typeof self=="object"&&self&&self.Object===Object&&self,hn=Ua||ff||Function("return this")(),Tn=hn.Symbol,Pa=Object.prototype,mf=Pa.hasOwnProperty,gf=Pa.toString,sr=Tn?Tn.toStringTag:void 0;function _f(e){var t=mf.call(e,sr),n=e[sr];try{e[sr]=void 0;var r=!0}catch{}var s=gf.call(e);return r&&(t?e[sr]=n:delete e[sr]),s}var pf=Object.prototype,Ef=pf.toString;function Cf(e){return Ef.call(e)}var Rf="[object Null]",If="[object Undefined]",ka=Tn?Tn.toStringTag:void 0;function ir(e){return e==null?e===void 0?If:Rf:ka&&ka in Object(e)?_f(e):Cf(e)}function Nn(e){return e!=null&&typeof e=="object"}var Sf="[object Symbol]";function Qr(e){return typeof e=="symbol"||Nn(e)&&ir(e)==Sf}function Of(e,t){for(var n=-1,r=e==null?0:e.length,s=Array(r);++n<r;)s[n]=t(e[n],n,e);return s}var Mn=Array.isArray,Fa=Tn?Tn.prototype:void 0,xa=Fa?Fa.toString:void 0;function Ha(e){if(typeof e=="string")return e;if(Mn(e))return Of(e,Ha)+"";if(Qr(e))return xa?xa.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var vf=/\s/;function wf(e){for(var t=e.length;t--&&vf.test(e.charAt(t)););return t}var bf=/^\s+/;function yf(e){return e&&e.slice(0,wf(e)+1).replace(bf,"")}function Ct(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Ba=NaN,Af=/^[-+]0x[0-9a-f]+$/i,Tf=/^0b[01]+$/i,Nf=/^0o[0-7]+$/i,Mf=parseInt;function $a(e){if(typeof e=="number")return e;if(Qr(e))return Ba;if(Ct(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ct(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=yf(e);var n=Tf.test(e);return n||Nf.test(e)?Mf(e.slice(2),n?2:8):Af.test(e)?Ba:+e}function ja(e){return e}var Df="[object AsyncFunction]",Lf="[object Function]",Uf="[object GeneratorFunction]",Pf="[object Proxy]";function di(e){if(!Ct(e))return!1;var t=ir(e);return t==Lf||t==Uf||t==Df||t==Pf}var fi=hn["__core-js_shared__"],Wa=(function(){var e=/[^.]+$/.exec(fi&&fi.keys&&fi.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function kf(e){return!!Wa&&Wa in e}var Ff=Function.prototype,xf=Ff.toString;function Hf(e){if(e!=null){try{return xf.call(e)}catch{}try{return e+""}catch{}}return""}var Bf=/[\\^$.*+?()[\]{}|]/g,$f=/^\[object .+?Constructor\]$/,jf=Function.prototype,Wf=Object.prototype,Yf=jf.toString,Vf=Wf.hasOwnProperty,zf=RegExp("^"+Yf.call(Vf).replace(Bf,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Gf(e){if(!Ct(e)||kf(e))return!1;var t=di(e)?zf:$f;return t.test(Hf(e))}function Kf(e,t){return e==null?void 0:e[t]}function mi(e,t){var n=Kf(e,t);return Gf(n)?n:void 0}var Ya=Object.create,Xf=(function(){function e(){}return function(t){if(!Ct(t))return{};if(Ya)return Ya(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})();function qf(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Jf(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Zf=800,Qf=16,em=Date.now;function tm(e){var t=0,n=0;return function(){var r=em(),s=Qf-(r-n);if(n=r,s>0){if(++t>=Zf)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function nm(e){return function(){return e}}var es=(function(){try{var e=mi(Object,"defineProperty");return e({},"",{}),e}catch{}})(),rm=es?function(e,t){return es(e,"toString",{configurable:!0,enumerable:!1,value:nm(t),writable:!0})}:ja,sm=tm(rm),im=9007199254740991,om=/^(?:0|[1-9]\d*)$/;function gi(e,t){var n=typeof e;return t=t==null?im:t,!!t&&(n=="number"||n!="symbol"&&om.test(e))&&e>-1&&e%1==0&&e<t}function _i(e,t,n){t=="__proto__"&&es?es(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ts(e,t){return e===t||e!==e&&t!==t}var am=Object.prototype,lm=am.hasOwnProperty;function Va(e,t,n){var r=e[t];(!(lm.call(e,t)&&ts(r,n))||n===void 0&&!(t in e))&&_i(e,t,n)}function cm(e,t,n,r){var s=!n;n||(n={});for(var i=-1,o=t.length;++i<o;){var a=t[i],l=void 0;l===void 0&&(l=e[a]),s?_i(n,a,l):Va(n,a,l)}return n}var za=Math.max;function um(e,t,n){return t=za(t===void 0?e.length-1:t,0),function(){for(var r=arguments,s=-1,i=za(r.length-t,0),o=Array(i);++s<i;)o[s]=r[t+s];s=-1;for(var a=Array(t+1);++s<t;)a[s]=r[s];return a[t]=n(o),qf(e,this,a)}}function hm(e,t){return sm(um(e,t,ja),e+"")}var dm=9007199254740991;function Ga(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=dm}function pi(e){return e!=null&&Ga(e.length)&&!di(e)}function fm(e,t,n){if(!Ct(n))return!1;var r=typeof t;return(r=="number"?pi(n)&&gi(t,n.length):r=="string"&&t in n)?ts(n[t],e):!1}function Ka(e){return hm(function(t,n){var r=-1,s=n.length,i=s>1?n[s-1]:void 0,o=s>2?n[2]:void 0;for(i=e.length>3&&typeof i=="function"?(s--,i):void 0,o&&fm(n[0],n[1],o)&&(i=s<3?void 0:i,s=1),t=Object(t);++r<s;){var a=n[r];a&&e(t,a,r,i)}return t})}var mm=Object.prototype;function Xa(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||mm;return e===n}function gm(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var _m="[object Arguments]";function qa(e){return Nn(e)&&ir(e)==_m}var Ja=Object.prototype,pm=Ja.hasOwnProperty,Em=Ja.propertyIsEnumerable,Ei=qa((function(){return arguments})())?qa:function(e){return Nn(e)&&pm.call(e,"callee")&&!Em.call(e,"callee")};function Cm(){return!1}var Za=typeof f=="object"&&f&&!f.nodeType&&f,Qa=Za&&typeof module=="object"&&module&&!module.nodeType&&module,Rm=Qa&&Qa.exports===Za,el=Rm?hn.Buffer:void 0,Im=el?el.isBuffer:void 0,tl=Im||Cm,Sm="[object Arguments]",Om="[object Array]",vm="[object Boolean]",wm="[object Date]",bm="[object Error]",ym="[object Function]",Am="[object Map]",Tm="[object Number]",Nm="[object Object]",Mm="[object RegExp]",Dm="[object Set]",Lm="[object String]",Um="[object WeakMap]",Pm="[object ArrayBuffer]",km="[object DataView]",Fm="[object Float32Array]",xm="[object Float64Array]",Hm="[object Int8Array]",Bm="[object Int16Array]",$m="[object Int32Array]",jm="[object Uint8Array]",Wm="[object Uint8ClampedArray]",Ym="[object Uint16Array]",Vm="[object Uint32Array]",He={};He[Fm]=He[xm]=He[Hm]=He[Bm]=He[$m]=He[jm]=He[Wm]=He[Ym]=He[Vm]=!0,He[Sm]=He[Om]=He[Pm]=He[vm]=He[km]=He[wm]=He[bm]=He[ym]=He[Am]=He[Tm]=He[Nm]=He[Mm]=He[Dm]=He[Lm]=He[Um]=!1;function zm(e){return Nn(e)&&Ga(e.length)&&!!He[ir(e)]}function Gm(e){return function(t){return e(t)}}var nl=typeof f=="object"&&f&&!f.nodeType&&f,or=nl&&typeof module=="object"&&module&&!module.nodeType&&module,Km=or&&or.exports===nl,Ci=Km&&Ua.process,rl=(function(){try{var e=or&&or.require&&or.require("util").types;return e||Ci&&Ci.binding&&Ci.binding("util")}catch{}})(),sl=rl&&rl.isTypedArray,il=sl?Gm(sl):zm;function Xm(e,t){var n=Mn(e),r=!n&&Ei(e),s=!n&&!r&&tl(e),i=!n&&!r&&!s&&il(e),o=n||r||s||i,a=o?gm(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")||gi(c,l))||a.push(c);return a}function qm(e,t){return function(n){return e(t(n))}}function Jm(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Zm=Object.prototype,Qm=Zm.hasOwnProperty;function eg(e){if(!Ct(e))return Jm(e);var t=Xa(e),n=[];for(var r in e)r=="constructor"&&(t||!Qm.call(e,r))||n.push(r);return n}function ol(e){return pi(e)?Xm(e):eg(e)}var tg=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ng=/^\w*$/;function rg(e,t){if(Mn(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Qr(e)?!0:ng.test(e)||!tg.test(e)||t!=null&&e in Object(t)}var ar=mi(Object,"create");function sg(){this.__data__=ar?ar(null):{},this.size=0}function ig(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var og="__lodash_hash_undefined__",ag=Object.prototype,lg=ag.hasOwnProperty;function cg(e){var t=this.__data__;if(ar){var n=t[e];return n===og?void 0:n}return lg.call(t,e)?t[e]:void 0}var ug=Object.prototype,hg=ug.hasOwnProperty;function dg(e){var t=this.__data__;return ar?t[e]!==void 0:hg.call(t,e)}var fg="__lodash_hash_undefined__";function mg(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ar&&t===void 0?fg:t,this}function dn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}dn.prototype.clear=sg,dn.prototype.delete=ig,dn.prototype.get=cg,dn.prototype.has=dg,dn.prototype.set=mg;function gg(){this.__data__=[],this.size=0}function ns(e,t){for(var n=e.length;n--;)if(ts(e[n][0],t))return n;return-1}var _g=Array.prototype,pg=_g.splice;function Eg(e){var t=this.__data__,n=ns(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():pg.call(t,n,1),--this.size,!0}function Cg(e){var t=this.__data__,n=ns(t,e);return n<0?void 0:t[n][1]}function Rg(e){return ns(this.__data__,e)>-1}function Ig(e,t){var n=this.__data__,r=ns(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function $t(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}$t.prototype.clear=gg,$t.prototype.delete=Eg,$t.prototype.get=Cg,$t.prototype.has=Rg,$t.prototype.set=Ig;var al=mi(hn,"Map");function Sg(){this.size=0,this.__data__={hash:new dn,map:new(al||$t),string:new dn}}function Og(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function rs(e,t){var n=e.__data__;return Og(t)?n[typeof t=="string"?"string":"hash"]:n.map}function vg(e){var t=rs(this,e).delete(e);return this.size-=t?1:0,t}function wg(e){return rs(this,e).get(e)}function bg(e){return rs(this,e).has(e)}function yg(e,t){var n=rs(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Jt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Jt.prototype.clear=Sg,Jt.prototype.delete=vg,Jt.prototype.get=wg,Jt.prototype.has=bg,Jt.prototype.set=yg;var Ag="Expected a function";function Ri(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Ag);var n=function(){var r=arguments,s=t?t.apply(this,r):r[0],i=n.cache;if(i.has(s))return i.get(s);var o=e.apply(this,r);return n.cache=i.set(s,o)||i,o};return n.cache=new(Ri.Cache||Jt),n}Ri.Cache=Jt;var Tg=500;function Ng(e){var t=Ri(e,function(r){return n.size===Tg&&n.clear(),r}),n=t.cache;return t}var Mg=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Dg=/\\(\\)?/g,Lg=Ng(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Mg,function(n,r,s,i){t.push(s?i.replace(Dg,"$1"):r||n)}),t});function Ug(e){return e==null?"":Ha(e)}function ll(e,t){return Mn(e)?e:rg(e,t)?[e]:Lg(Ug(e))}function cl(e){if(typeof e=="string"||Qr(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Pg(e,t){t=ll(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[cl(t[n++])];return n&&n==r?e:void 0}function ul(e,t,n){var r=e==null?void 0:Pg(e,t);return r===void 0?n:r}var hl=qm(Object.getPrototypeOf,Object),kg="[object Object]",Fg=Function.prototype,xg=Object.prototype,dl=Fg.toString,Hg=xg.hasOwnProperty,Bg=dl.call(Object);function $g(e){if(!Nn(e)||ir(e)!=kg)return!1;var t=hl(e);if(t===null)return!0;var n=Hg.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&dl.call(n)==Bg}function jg(){this.__data__=new $t,this.size=0}function Wg(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Yg(e){return this.__data__.get(e)}function Vg(e){return this.__data__.has(e)}var zg=200;function Gg(e,t){var n=this.__data__;if(n instanceof $t){var r=n.__data__;if(!al||r.length<zg-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Jt(r)}return n.set(e,t),this.size=n.size,this}function Dn(e){var t=this.__data__=new $t(e);this.size=t.size}Dn.prototype.clear=jg,Dn.prototype.delete=Wg,Dn.prototype.get=Yg,Dn.prototype.has=Vg,Dn.prototype.set=Gg;var fl=typeof f=="object"&&f&&!f.nodeType&&f,ml=fl&&typeof module=="object"&&module&&!module.nodeType&&module,Kg=ml&&ml.exports===fl,gl=Kg?hn.Buffer:void 0;gl&&gl.allocUnsafe;function Xg(e,t){return e.slice()}var _l=hn.Uint8Array;function qg(e){var t=new e.constructor(e.byteLength);return new _l(t).set(new _l(e)),t}function Jg(e,t){var n=qg(e.buffer);return new e.constructor(n,e.byteOffset,e.length)}function Zg(e){return typeof e.constructor=="function"&&!Xa(e)?Xf(hl(e)):{}}function Qg(e){return function(t,n,r){for(var s=-1,i=Object(t),o=r(t),a=o.length;a--;){var l=o[++s];if(n(i[l],l,i)===!1)break}return t}}var e_=Qg(),Ii=function(){return hn.Date.now()},t_="Expected a function",n_=Math.max,r_=Math.min;function s_(e,t,n){var r,s,i,o,a,l,c=0,u=!1,h=!1,d=!0;if(typeof e!="function")throw new TypeError(t_);t=$a(t)||0,Ct(n)&&(u=!!n.leading,h="maxWait"in n,i=h?n_($a(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d);function m(R){var b=r,T=s;return r=s=void 0,c=R,o=e.apply(T,b),o}function _(R){return c=R,a=setTimeout(y,t),u?m(R):o}function p(R){var b=R-l,T=R-c,B=t-b;return h?r_(B,i-T):B}function I(R){var b=R-l,T=R-c;return l===void 0||b>=t||b<0||h&&T>=i}function y(){var R=Ii();if(I(R))return H(R);a=setTimeout(y,p(R))}function H(R){return a=void 0,d&&r?m(R):(r=s=void 0,o)}function x(){a!==void 0&&clearTimeout(a),c=0,r=l=s=a=void 0}function Y(){return a===void 0?o:H(Ii())}function O(){var R=Ii(),b=I(R);if(r=arguments,s=this,l=R,b){if(a===void 0)return _(l);if(h)return clearTimeout(a),a=setTimeout(y,t),m(l)}return a===void 0&&(a=setTimeout(y,t)),o}return O.cancel=x,O.flush=Y,O}function Si(e,t,n){(n!==void 0&&!ts(e[t],n)||n===void 0&&!(t in e))&&_i(e,t,n)}function i_(e){return Nn(e)&&pi(e)}function Oi(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function o_(e){return cm(e,ol(e))}function a_(e,t,n,r,s,i,o){var a=Oi(e,n),l=Oi(t,n),c=o.get(l);if(c){Si(e,n,c);return}var u=i?i(a,l,n+"",e,t,o):void 0,h=u===void 0;if(h){var d=Mn(l),m=!d&&tl(l),_=!d&&!m&&il(l);u=l,d||m||_?Mn(a)?u=a:i_(a)?u=Jf(a):m?(h=!1,u=Xg(l)):_?(h=!1,u=Jg(l)):u=[]:$g(l)||Ei(l)?(u=a,Ei(a)?u=o_(a):(!Ct(a)||di(a))&&(u=Zg(l))):h=!1}h&&(o.set(l,u),s(u,l,r,i,o),o.delete(l)),Si(e,n,u)}function vi(e,t,n,r,s){e!==t&&e_(t,function(i,o){if(s||(s=new Dn),Ct(i))a_(e,t,o,n,vi,r,s);else{var a=r?r(Oi(e,o),i,o+"",e,t,s):void 0;a===void 0&&(a=i),Si(e,o,a)}},ol)}var l_=Ka(function(e,t,n,r){vi(e,t,n,r)}),ss=Ka(function(e,t,n){vi(e,t,n)});function c_(e,t,n,r){if(!Ct(e))return e;t=ll(t,e);for(var s=-1,i=t.length,o=i-1,a=e;a!=null&&++s<i;){var l=cl(t[s]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(s!=o){var u=a[l];c=void 0,c===void 0&&(c=Ct(u)?u:gi(t[s+1])?[]:{})}Va(a,l,c),a=a[l]}return e}function u_(e,t,n){return e==null?e:c_(e,t,n)}class fn{constructor(){E(this,"cursor",0)}reset(){return this.cursor=0,this}moveCursor(t){this.cursor+=t}moveCursorTo(t){this.cursor=t}}function h_(e,t){for(const n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}function pl(e){return/^-?\d+(\.\d+)?$/.test(e)}function d_(e){return pl(e)?Number(e)<=Number.MAX_SAFE_INTEGER:!1}function f_(e){return Number(e)>Number.MAX_SAFE_INTEGER||e.length>=18}class wi{constructor(){E(this,"_data",[])}static create(){return new wi}add(t){this._data.indexOf(t)>-1||this._data.push(t)}delete(t){const n=this._data.indexOf(t);this._data.splice(n,1)}getData(){return this._data}}class bi{constructor(){E(this,"_data",new Map)}static create(){return new bi}add(t,n){this._data.has(t)||this._data.set(t,n)}delete(t){this._data.delete(t)}getData(){return this._data}}function m_(e){const t=new MessageChannel;let n=!1;const r=()=>{n||e()};return t.port1.onmessage=r,t.port2.postMessage(null),()=>{n=!0,t.port1.onmessage=null,t.port1.close(),t.port2.close()}}async function El(e){for(const[t,n]of e.entries())try{if(!await n())return{index:t,result:!1}}catch(r){return{index:t,result:!1,error:r}}return{result:!0,index:-1}}function Cl(e){for(const[t,n]of e.entries())try{if(!n())return{index:t,result:!1}}catch(r){return{index:t,result:!1,error:r}}return{result:!0,index:-1}}function g_(e,t){return t.forEach(n=>e.add(n)),e}function __(e){return e instanceof se.Subscription||e instanceof se.Subject||e&&"closed"in e&&typeof e.unsubscribe<"u"}function Ye(e){let t=!1;return e?__(e)?{dispose:()=>e.unsubscribe()}:typeof e=="function"?{dispose:()=>{t||(t=!0,e())}}:e:Ye(()=>{})}class is{constructor(){E(this,"_disposables",new Set)}add(t){const n=Ye(t);return this._disposables.add(n),{dispose:(r=!1)=>{r||n.dispose(),this._disposables.delete(n)}}}dispose(){this._disposables.forEach(t=>{t.dispose()}),this._disposables.clear()}}class Ke{constructor(){E(this,"_disposed",!1);E(this,"_collection",new is)}disposeWithMe(t){return this._collection.add(t)}ensureNotDisposed(){if(this._disposed)throw new Error("[Disposable]: object is disposed!")}dispose(){this._disposed||(this._disposed=!0,this._collection.dispose())}}class p_ extends Ke{constructor(){super(...arguments);E(this,"dispose$",new se.Subject)}dispose(){super.dispose(),this.dispose$.next(),this.dispose$.complete()}}class E_ extends Ke{constructor(n){super();E(this,"_ref",0);this._rootDisposable=n}inc(){if(this._disposed)throw new Error("[RCDisposable]: should not ref to a disposed.");this._ref+=1}dec(){this._ref-=1,this._ref===0&&(this._rootDisposable.dispose(),this.dispose())}}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||{}),Se=(e=>(e[e.Reader=0]="Reader",e[e.Editor=1]="Editor",e[e.Owner=2]="Owner",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(Se||{}),yi=(e=>(e[e.SomeCollaborator=0]="SomeCollaborator",e[e.AllCollaborator=1]="AllCollaborator",e[e.OneSelf=2]="OneSelf",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(yi||{});class os extends Ke{}const Rl=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"]),C_=new RegExp("^(?:(?:(?:https?|ftp):)?\\/\\/)?(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u00a1-\\uffff][a-z0-9\\u00a1-\\uffff_-]{0,62})?[a-z0-9\\u00a1-\\uffff]\\.)+(?:[a-z\\u00a1-\\uffff]{2,}\\.?))(?::\\d{2,5})?(?:[/?#]\\S*)?$","i");function R_(e){if(!Number.isNaN(+e))return!1;if(e.startsWith("http://localhost:3002")||e.startsWith("localhost:3002"))return!0;if(C_.test(e)){if(Il(e))return!0;try{const r=new URL(Sl(e)).hostname.split(".").pop();if(r&&Rl.has(r))return!0}catch{return!1}}return!1}function Il(e){return/^[a-zA-Z]+:\/\//.test(e)}function I_(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e)}function Sl(e){return Il(e)?e:I_(e)?`mailto://${e}`:`https://${e}`}function S_(e,t){try{const n=new URL(t),r=n.pathname.endsWith("/")?n.pathname:`${n.pathname}/`,s=e.startsWith("/")?e.substring(1):e;return new URL(s,n.origin+r).toString()}catch(n){return console.error("Error resolving URL with base URL:",n),e}}const O_="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let v_=e=>crypto.getRandomValues(new Uint8Array(e)),w_=(e,t,n)=>{let r=(2<<Math.log2(e.length-1))-1,s=-~(1.6*r*t/e.length);return(i=t)=>{let o="";for(;;){let a=n(s),l=s|0;for(;l--;)if(o+=e[a[l]&r]||"",o.length>=i)return o}}},b_=(e,t=21)=>w_(e,t|0,v_),y_=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=O_[n[e]&63];return t};const Zt=["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 Ai(e,t){const n=Z.getValueType(e),r=Z.getValueType(t);return n!==r?!1:Z.isArray(e)?A_(e,t):Z.isObject(e)?T_(e,t):Z.isDate(e)?e.getTime()===t.getTime():Z.isRegExp(e)?e.toString()===t.toString():e===t}function A_(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++){const s=e[n],i=t[n];if(!Ai(s,i))return!1}return!0}function T_(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n){if(!r.includes(s))return!1;const i=e[s],o=t[s];if(!Ai(i,o))return!1}return!0}class Z{static deleteNull(t){for(const n in t)(t[n]===null||t[n]===void 0)&&delete t[n];return t}static stringAt(t){let n="",r=t;for(;r>=Zt.length;)r/=Zt.length,r-=1,n+=Zt[r%Zt.length];const s=t%Zt.length;return n+=Zt[s],n}static indexAt(t){let n=0;for(let r=0;r<t.length-1;r+=1){const s=t.charCodeAt(r)-65,i=t.length-1-r;n+=Zt.length**i+Zt.length*s}return n+=t.charCodeAt(t.length-1)-65,n}static deleteBlank(t){return Z.isString(t)?t.replace(/\s/g,""):t}static getSystemType(){const t=navigator.userAgent,n=navigator.platform==="Win32"||navigator.platform==="Windows",r=navigator.platform==="Mac68K"||navigator.platform==="MacPPC"||navigator.platform==="Macintosh"||navigator.platform==="MacIntel";if(r)return"Mac";if(navigator.platform==="X11"&&!n&&!r)return"Unix";if(String(navigator.platform).indexOf("Linux")>-1)return"Linux";if(n){if(t.indexOf("Windows NT 5.0")>-1||t.indexOf("Windows 2000")>-1)return"Windows 2000";if(t.indexOf("Windows NT 5.1")>-1||t.indexOf("Windows XP")>-1)return"Windows XP";if(t.indexOf("Windows NT 5.2")>-1||t.indexOf("Windows 2003")>-1)return"Windows 2003";if(t.indexOf("Windows NT 6.0")>-1||t.indexOf("Windows Vista")>-1)return"Windows Vista";if(t.indexOf("Windows NT 6.1")>-1||t.indexOf("Windows 7")>-1)return"Windows 7";if(t.indexOf("Windows NT 10")>-1||t.indexOf("Windows 10")>-1)return"Windows 10";if(t.indexOf("Windows NT 11")>-1||t.indexOf("Windows 11")>-1)return"Windows 11"}return"Unknown system"}static getBrowserType(){const t=navigator.userAgent,n=t.indexOf("Opera")>-1,r=t.indexOf("compatible")>-1&&t.indexOf("MSIE")>-1&&!n,s=t.indexOf("Trident")>-1&&t.indexOf("rv:11.0")>-1,i=t.indexOf("Edge")>-1,o=t.indexOf("Firefox")>-1,a=t.indexOf("Safari")>-1&&t.indexOf("Chrome")===-1,l=t.indexOf("Chrome")>-1&&t.indexOf("Safari")>-1;if(r){new RegExp("MSIE (\\d+\\.\\d+);").test(t);const u=Number.parseFloat(RegExp.$1);return u===7?"IE7":u===8?"IE8":u===9?"IE9":u===10?"IE10":"0"}return o?"FF":n?"Opera":a?"Safari":l?"Chrome":i?"Edge":s?"IE11":"Unknown browser"}static getClassName(t){return t.constructor.name}static deepMerge(t,...n){n.forEach(o=>o&&i(o));function r(o,a){o.forEach((l,c)=>{var u,h;if(Z.isArray(l)){const d=(u=a[c])!=null?u:[];a[c]=d,r(l,d);return}if(Z.isObject(l)){const d=(h=a[c])!=null?h:{};a[c]=d,s(l,d);return}a[c]=l})}function s(o,a){Object.keys(o).forEach(l=>{var u,h;const c=o[l];if(Z.isObject(c)){const d=(u=a[l])!=null?u:{};a[l]=d,s(c,d);return}if(Z.isArray(c)){const d=(h=a[l])!=null?h:[];a[l]=d,r(c,d);return}a[l]=c})}function i(o){Object.keys(o).forEach(a=>{var c,u;const l=o[a];if(Z.isArray(l)){const h=(c=t[a])!=null?c:[];t[a]=h,r(l,h);return}if(Z.isObject(l)){const h=(u=t[a])!=null?u:{};t[a]=h,s(l,h);return}t[a]=l})}return t}static numberFixed(t,n){return Number(Number(t).toFixed(n))}static diffValue(t,n){return Ai(t,n)}static deepClone(t){if(!this.isDefine(t))return t;if(this.isRegExp(t))return new RegExp(t);if(this.isDate(t))return new Date(t);if(this.isArray(t)){const n=[];return t.forEach((r,s)=>{n[s]=Z.deepClone(r)}),n}if(this.isObject(t)){const n={};return Object.keys(t).forEach(r=>{const s=t[r];n[r]=Z.deepClone(s)}),Object.setPrototypeOf(n,Object.getPrototypeOf(t)),n}return t}static getLanguage(){const t="en-US";return globalThis.navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||t}static getValueType(t){return Object.prototype.toString.apply(t)}static isDefine(t){return t!=null}static isBlank(t){return this.isDefine(t)?this.isString(t)?t.trim()==="":!1:!0}static isPlainObject(t){return this.isDefine(t)?Object.getPrototypeOf(t)===Object.getPrototypeOf({}):!1}static isDate(t){return this.getValueType(t)==="[object Date]"}static isRegExp(t){return this.getValueType(t)==="[object RegExp]"}static isArray(t){return this.getValueType(t)==="[object Array]"}static isString(t){return this.getValueType(t)==="[object String]"}static isNumber(t){return this.getValueType(t)==="[object Number]"}static isStringNumber(t){return!isNaN(Number.parseFloat(t))&&isFinite(t)}static isObject(t){return this.getValueType(t)==="[object Object]"}static isEmptyObject(t){for(const n in t)return!1;return!0}static isTablet(){return/ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(navigator.userAgent.toLowerCase())}static isIPhone(){return/iPhone/i.test(navigator.userAgent)}static isLegalUrl(t){return R_(t)}static normalizeUrl(t){return Sl(t)}static topLevelDomainCombiningString(){return[...Rl].join("|")}static removeNull(t){return this.isObject(t)&&Object.keys(t).forEach(n=>{const r=t[n];r==null?delete t[n]:Z.removeNull(r)}),t}static fillTwoDimensionalArray(t,n,r){return new Array(t).fill(r).map(s=>new Array(n).fill(r))}static numToWord(t){let n="";for(;t>0;){let r=t%26;r=r===0?r=26:r,n=String.fromCharCode(96+r)+n,t=(t-r)/26}return n.toLocaleUpperCase()}static ABCatNum(t){if(t==null||t.length===0)return Number.NaN;const n=t.toLowerCase().split(""),r=n.length;let s=0,i=0;for(let o=0;o<r;o++)i=n[o].charCodeAt(0)-96,s+=i*26**(r-o-1);return s===0?Number.NaN:s-1}static chatAtABC(t){let i="";for(;t>=0;)i=String.fromCharCode(t%26+97)+i,t=Math.floor(t/26)-1;return i.toUpperCase()}static commonExtend(t,n){const r={};for(const s in t)r[s]=t[s];for(const s in n)n[s]!=null&&(r[s]=n[s]);return r}static hasIntersectionBetweenTwoRanges(t,n,r,s){return n>=r&&s>=t}static isStartValidPosition(t){return/^[A-Za-zА-Яа-яЁё_]/.test(t)}static isValidParameter(t){const n=/[~!@#$%^&*()+=\-{}\[\]\|:;"'<>,?\/ ]+/.test(t),r=t.length<=255;return!n&&r}static clamp(t,n,r){return Math.max(n,Math.min(r,t))}static now(){return performance&&performance.now?performance.now():Date.now()}}function nt(e=21,t){return t?b_(t,e)():y_(e)}function lr(...e){const t={},n=e.length;for(let r=n-1;r>=0;r--){const s=e[r];if(s){const i=Object.keys(s);for(const o of i)t[o]===void 0&&(t[o]=s[o])}}return t}const N_=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null;function M_(e){const n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\\\*/g,".*").replace(/\\\?/g,".");return new RegExp(`^${n}$`,"i")}var Ol=(e=>(e[e.DEFAULT_SERIES=0]="DEFAULT_SERIES",e[e.ALTERNATE_SERIES=1]="ALTERNATE_SERIES",e))(Ol||{}),Pe=(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))(Pe||{}),vl=(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))(vl||{}),Rt=(e=>(e[e.UNSUPPORTED=0]="UNSUPPORTED",e[e.RGB=1]="RGB",e[e.HEX=2]="HEX",e[e.THEME=3]="THEME",e))(Rt||{}),wl=(e=>(e[e.ON=0]="ON",e[e.OFF=1]="OFF",e))(wl||{}),bl=(e=>(e[e.PASTE_NORMAL=0]="PASTE_NORMAL",e[e.PASTE_NO_BORDERS=1]="PASTE_NO_BORDERS",e[e.PASTE_FORMAT=2]="PASTE_FORMAT",e[e.PASTE_FORMULA=3]="PASTE_FORMULA",e[e.PASTE_DATA_VALIDATION=4]="PASTE_DATA_VALIDATION",e[e.PASTE_VALUES=5]="PASTE_VALUES",e[e.PASTE_CONDITIONAL_FORMATTING=6]="PASTE_CONDITIONAL_FORMATTING",e[e.PASTE_COLUMN_WIDTHS=7]="PASTE_COLUMN_WIDTHS",e))(bl||{}),yl=(e=>(e[e.LEFT=0]="LEFT",e[e.RIGHT=1]="RIGHT",e))(yl||{}),Al=(e=>(e[e.DOCUMENT=0]="DOCUMENT",e[e.PROJECT=1]="PROJECT",e))(Al||{}),Tl=(e=>(e[e.COLUMNS=0]="COLUMNS",e[e.ROWS=1]="ROWS",e))(Tl||{}),Nl=(e=>(e[e.UP=0]="UP",e[e.RIGHT=1]="RIGHT",e[e.DOWN=2]="DOWN",e[e.LEFT=3]="LEFT",e))(Nl||{});function D_(e){switch(e){case 3:return 1;case 1:return 3;case 0:return 2;case 2:return 0}}var Ml=(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))(Ml||{}),cr=(e=>(e.EN_US="enUS",e.FR_FR="frFR",e.ZH_CN="zhCN",e.RU_RU="ruRU",e.ZH_TW="zhTW",e.VI_VN="viVN",e.FA_IR="faIR",e.JA_JP="jaJP",e.KO_KR="koKR",e.ES_ES="esES",e.CA_ES="caES",e))(cr||{}),as=(e=>(e[e.PERSON=0]="PERSON",e[e.FILE=1]="FILE",e[e.DATE=2]="DATE",e[e.LOCATION=3]="LOCATION",e[e.EVENT=4]="EVENT",e))(as||{}),Dl=(e=>(e[e.RANGE=0]="RANGE",e[e.SHEET=1]="SHEET",e))(Dl||{}),Ll=(e=>(e.Line="line",e.LineInv="lineInv",e.Triangle="triangle",e.RtTriangle="rtTriangle",e.Rect="rect",e.Diamond="diamond",e.Parallelogram="parallelogram",e.Trapezoid="trapezoid",e.NonIsocelesTrapezoid="nonIsocelesTrapezoid",e.Pentagon="pentagon",e.Hexagon="hexagon",e.Heptagon="heptagon",e.Octagon="octagon",e.Decagon="decagon",e.Dodecagon="dodecagon",e.Star4="star4",e.Star5="star5",e.Star6="star6",e.Star7="star7",e.Star8="star8",e.Star10="star10",e.Star12="star12",e.Star16="star16",e.Star24="star24",e.Star32="star32",e.RoundRect="roundRect",e.Round1Rect="round1Rect",e.Round2SameRect="round2SameRect",e.Round2DiagRect="round2DiagRect",e.Ellipse="ellipse",e))(Ll||{}),Ul=(e=>(e.RightArrow="rightArrow",e.LeftArrow="leftArrow",e.UpArrow="upArrow",e.DownArrow="downArrow",e.LeftRightArrow="leftRightArrow",e.UpDownArrow="upDownArrow",e.QuadArrow="quadArrow",e.LeftRightUpArrow="leftRightUpArrow",e.BentArrow="bentArrow",e.UturnArrow="uturnArrow",e.CircularArrow="circularArrow",e.NotchedRightArrow="notchedRightArrow",e.HomePlate="homePlate",e.Chevron="chevron",e.LeftCircularArrow="leftCircularArrow",e.LeftRightCircularArrow="leftRightCircularArrow",e))(Ul||{}),Pl=(e=>(e.Plaque="plaque",e.Can="can",e.Cube="cube",e.Bevel="bevel",e.Donut="donut",e.NoSmoking="noSmoking",e.BlockArc="blockArc",e.FoldedCorner="foldedCorner",e))(Pl||{}),kl=(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))(kl||{}),Fl=(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))(Fl||{}),xl=(e=>(e[e.GRID=0]="GRID",e[e.KANBAN=1]="KANBAN",e[e.GANTT=2]="GANTT",e))(xl||{}),ur=(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))(ur||{}),Hl=(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))(Hl||{}),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||{}),mn=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TOP=1]="TOP",e[e.MIDDLE=2]="MIDDLE",e[e.BOTTOM=3]="BOTTOM",e))(mn||{}),gn=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.OVERFLOW=1]="OVERFLOW",e[e.CLIP=2]="CLIP",e[e.WRAP=3]="WRAP",e))(gn||{}),ls=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ITALIC=1]="ITALIC",e))(ls||{}),cs=(e=>(e[e.NORMAL=0]="NORMAL",e[e.BOLD=1]="BOLD",e))(cs||{}),jt=(e=>(e[e.NORMAL=1]="NORMAL",e[e.SUBSCRIPT=2]="SUBSCRIPT",e[e.SUPERSCRIPT=3]="SUPERSCRIPT",e))(jt||{}),ae=(e=>(e[e.FALSE=0]="FALSE",e[e.TRUE=1]="TRUE",e))(ae||{}),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||{}),at=(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))(at||{}),us=(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))(us||{}),Bl=(e=>(e[e.character=0]="character",e[e.paragraph=1]="paragraph",e[e.table=2]="table",e[e.numbering=3]="numbering",e))(Bl||{}),$l=(e=>(e[e.TAB=0]="TAB",e[e.SPACE=1]="SPACE",e[e.NOTHING=2]="NOTHING",e))($l||{}),fe=(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))(fe||{}),hr=(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))(hr||{}),en=(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))(en||{}),_n=(e=>(e[e.COMMENT=0]="COMMENT",e[e.DELETED=9999]="DELETED",e))(_n||{}),jl=(e=>(e[e.DRAWING=0]="DRAWING",e[e.CUSTOM=1]="CUSTOM",e))(jl||{}),Ti=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRADITIONAL=1]="TRADITIONAL",e[e.MODERN=2]="MODERN",e))(Ti||{}),Wl=(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))(Wl||{}),Yl=(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))(Yl||{}),Vl=(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))(Vl||{}),zl=(e=>(e[e.NORMAL=0]="NORMAL",e[e.TBRL=1]="TBRL",e[e.LRTBV=2]="LRTBV",e))(zl||{}),Gl=(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))(Gl||{}),Kl=(e=>(e[e.BOTH_SIDES=0]="BOTH_SIDES",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.LARGEST=3]="LARGEST",e))(Kl||{}),Xl=(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))(Xl||{}),Je=(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))(Je||{}),ql=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(ql||{}),Jl=(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))(Jl||{}),Zl=(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))(Zl||{}),Ql=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SPECIFIED=1]="SPECIFIED",e))(Ql||{}),ec=(e=>(e[e.START=0]="START",e[e.CENTER=1]="CENTER",e[e.END=2]="END",e))(ec||{}),tc=(e=>(e[e.AUTO_FIT=0]="AUTO_FIT",e[e.FIXED=1]="FIXED",e))(tc||{}),nc=(e=>(e[e.NONE=0]="NONE",e[e.WRAP=1]="WRAP",e))(nc||{}),rc=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(rc||{}),sc=(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))(sc||{}),Ln=(e=>(e.NORMAL="normal",e.BOLD="bold",e.ITALIC="italic",e))(Ln||{}),ic=(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))(ic||{}),oc=(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))(oc||{}),ac=(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))(ac||{}),lc=(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))(lc||{}),cc=(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))(cc||{}),uc=(e=>(e[e.compressPunctuation=0]="compressPunctuation",e[e.compressPunctuationAndJapaneseKana=1]="compressPunctuationAndJapaneseKana",e[e.doNotCompress=2]="doNotCompress",e))(uc||{}),hc=(e=>(e[e.PORTRAIT=0]="PORTRAIT",e[e.LANDSCAPE=1]="LANDSCAPE",e))(hc||{}),ht=(e=>(e.Letter="Letter",e.Tabloid="Tabloid",e.Legal="Legal",e.Statement="Statement",e.Executive="Executive",e.Folio="Folio",e.A3="A3",e.A4="A4",e.A5="A5",e.B4="B4",e.B5="B5",e))(ht||{});const L_=["A3","A4","A5","B4","B5","Letter","Tabloid","Legal","Statement","Executive","Folio"];var dc=(e=>(e[e.forward=0]="forward",e[e.backward=1]="backward",e[e.front=2]="front",e[e.back=3]="back",e))(dc||{}),fc=(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))(fc||{}),Ni=(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))(Ni||{}),mc=(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))(mc||{}),gc=(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))(gc||{});function U_(e=nt(6),t=cr.EN_US,n=""){return{id:e,locale:t,title:n,tableSource:{},drawings:{},drawingsOrder:[],headers:{},footers:{},body:{dataStream:`\r
3
+ `,textRuns:[],customBlocks:[],tables:[],paragraphs:[{startIndex:0,paragraphStyle:{spaceAbove:{v:5},lineSpacing:1,spaceBelow:{v:0}}}],sectionBreaks:[{startIndex:1}]},documentStyle:{pageSize:{width:793.3333333333334,height:1122.6666666666667},documentFlavor:Ti.TRADITIONAL,marginTop:50,marginBottom:50,marginRight:50,marginLeft:50,renderConfig:{zeroWidthParagraphBreak:ae.FALSE,vertexAngle:0,centerAngle:0,background:{rgb:"#ccc"}},autoHyphenation:ae.TRUE,doNotHyphenateCaps:ae.FALSE,consecutiveHyphenLimit:2,defaultHeaderId:"",defaultFooterId:"",evenPageHeaderId:"",evenPageFooterId:"",firstPageHeaderId:"",firstPageFooterId:"",evenAndOddHeaders:ae.FALSE,useFirstPageHeaderFooter:ae.FALSE,marginHeader:30,marginFooter:30},settings:{}}}var pn={},dr={},hs={},_c;function P_(){if(_c)return hs;_c=1,Object.defineProperty(hs,"__esModule",{value:!0});function e(r,s){if(Array.isArray(s))return!1;for(let i in r)if(!n(r[i],s[i]))return!1;for(let i in s)if(r[i]===void 0)return!1;return!0}function t(r,s){if(!Array.isArray(s)||r.length!==s.length)return!1;for(let i=0;i<r.length;i++)if(!n(r[i],s[i]))return!1;return!0}function n(r,s){return r===s?!0:r===null||s===null||typeof r!="object"||typeof s!="object"?!1:Array.isArray(r)?t(r,s):e(r,s)}return hs.default=n,hs}var ds={},pc;function k_(){if(pc)return ds;pc=1,Object.defineProperty(ds,"__esModule",{value:!0});function e(t){if(t===null)return null;if(Array.isArray(t))return t.map(e);if(typeof t=="object"){const n={};for(let r in t)n[r]=e(t[r]);return n}else return t}return ds.default=e,ds}var Mi={},Ec;function Cc(){return Ec||(Ec=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.eachChildOf=e.advancer=e.readCursor=e.writeCursor=e.WriteCursor=e.ReadCursor=e.isValidPathItem=void 0;function t(u,h){if(!u)throw new Error(h)}const n=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 d in u){const m=d;h.write(m,u[m])}}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(){t(this.parents.length===this.indexes.length/2),this.idx===0?this.parents.length?(this.lcIdx=this.indexes.pop(),this.container=this.parents.pop(),this.idx=this.indexes.pop()):(this.lcIdx=0,this.idx=-1):(t(this.idx>0),this.idx--,n(this.container[this.idx])&&this.idx--)}getPath(){const h=[];let d=this.container,m=this.parents.length-1,_=this.idx;for(;_>=0;)h.unshift(d[_]),_===0?(_=this.indexes[m*2],d=this.parents[m--]):_-=n(d[_-1])?2:1;return h}}class o extends i{get(){return this.container?this.container.slice(this.idx+1):null}getKey(){return t(this.container!=null,"Invalid call to getKey before cursor descended"),this.container[this.idx]}getComponent(){let h;return this.container&&this.container.length>this.idx+1&&n(h=this.container[this.idx+1])?h:null}descendFirst(){let h=this.idx+1;if(!this.container||h>=this.container.length||n(this.container[h])&&h+1>=this.container.length)return!1;n(this.container[h])&&h++;const d=this.container[h];return Array.isArray(d)?(this.indexes.push(this.idx),this.parents.push(this.container),this.indexes.push(h),this.idx=0,this.container=d):this.idx=h,!0}nextSibling(){if(t(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,d=this.parents[this.parents.length-1];return h>=d.length?!1:(t(!isNaN(h)),this.indexes[this.indexes.length-1]=h,this.container=d[h],!0)}_init(h,d,m,_){this.container=h,this.idx=d,this.parents=m.slice(),this.indexes=_.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,d){const m=this.getComponent();m&&d(m,h);for(const _ of this)h&&h.descend(_),this.traverse(h,d),h&&h.ascend()}eachPick(h,d){this.traverse(h,(m,_)=>{m.p!=null&&d(m.p,_)})}eachDrop(h,d){this.traverse(h,(m,_)=>{m.d!=null&&d(m.d,_)})}}e.ReadCursor=o;class a extends i{constructor(h=null){super(h),this.pendingDescent=[],this._op=h}flushDescent(){t(this.parents.length===this.indexes.length/2),this.container===null&&(this._op=this.container=[]);for(let h=0;h<this.pendingDescent.length;h++){const d=this.pendingDescent[h];let m=this.idx+1;if(m<this.container.length&&n(this.container[m])&&m++,t(m===this.container.length||!n(this.container[m])),m===this.container.length)this.container.push(d),this.idx=m;else if(this.container[m]===d)this.idx=m;else{if(!Array.isArray(this.container[m])){const _=this.container.splice(m,this.container.length-m);this.container.push(_),this.lcIdx>-1&&(this.lcIdx=m)}for(this.indexes.push(this.idx),this.parents.push(this.container),this.lcIdx!==-1&&(t(r(d,this.container[this.lcIdx][0])),m=this.lcIdx+1,this.lcIdx=-1);m<this.container.length&&r(d,this.container[m][0]);)m++;if(this.indexes.push(m),this.idx=0,m<this.container.length&&this.container[m][0]===d)this.container=this.container[m];else{const _=[d];this.container.splice(m,0,_),this.container=_}}}this.pendingDescent.length=0}reset(){this.lcIdx=-1}getComponent(){this.flushDescent();const h=this.idx+1;if(h<this.container.length&&n(this.container[h]))return this.container[h];{const d={};return this.container.splice(h,0,d),d}}write(h,d){const m=this.getComponent();t(m[h]==null||m[h]===d,"Internal consistency error: Overwritten component. File a bug"),m[h]=d}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,d=s){if(h===null)return;if(t(Array.isArray(h)),h===this._op)throw Error("Cannot merge into my own tree");const m=this.lcIdx,_=this.parents.length;let p=0;for(let I=0;I<h.length;I++){const y=h[I];typeof y=="string"||typeof y=="number"?(p++,this.descend(y)):Array.isArray(y)?this.mergeTree(y,d):typeof y=="object"&&d(y,this)}for(;p--;)this.ascend();this.lcIdx=this.parents.length===_?m:-1}at(h,d){this.descendPath(h),d(this);for(let m=0;m<h.length;m++)this.ascend();return this}writeAtPath(h,d,m){return this.at(h,()=>this.write(d,m)),this.reset(),this}writeMove(h,d,m=0){return this.writeAtPath(h,"p",m).writeAtPath(d,"d",m)}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,d){let m,_;_=m=u?u.descendFirst():!1;function p(I){let y;for(;_;){const H=y=u.getKey();if(I!=null){let x=!1;if(h&&typeof H=="number"&&(y=h(H,u.getComponent()),y<0&&(y=~y,x=!0)),r(y,I))return null;if(y===I&&!x)return u}d&&typeof y=="number"&&d(y,u.getComponent()),_=u.nextSibling()}return null}return p.end=()=>{m&&u.ascend()},p}e.advancer=l;function c(u,h,d){let m,_,p,I;for(m=_=u&&u.descendFirst(),p=I=h&&h.descendFirst();m||p;){let y=m?u.getKey():null,H=p?h.getKey():null;y!==null&&H!==null&&(r(H,y)?H=null:y!==H&&(y=null)),d(y==null?H:y,y!=null?u:null,H!=null?h:null),y!=null&&m&&(m=u.nextSibling()),H!=null&&p&&(p=h.nextSibling())}_&&u.ascend(),I&&h.ascend()}e.eachChildOf=c})(Mi)),Mi}var Di={},Rc;function Ic(){return Rc||(Rc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConflictType=void 0,(function(t){t[t.RM_UNEXPECTED_CONTENT=1]="RM_UNEXPECTED_CONTENT",t[t.DROP_COLLISION=2]="DROP_COLLISION",t[t.BLACKHOLE=3]="BLACKHOLE"})(e.ConflictType||(e.ConflictType={}))})(Di)),Di}var yt={},En={},Sc;function Li(){return Sc||(Sc=1,Object.defineProperty(En,"__esModule",{value:!0}),En.uniToStrPos=En.strPosToUni=void 0,En.strPosToUni=(e,t=e.length)=>{let n=0,r=0;for(;r<t;r++){const s=e.charCodeAt(r);s>=55296&&s<=57343&&(n++,r++)}if(r!==t)throw Error("Invalid offset - splits unicode bytes");return r-n},En.uniToStrPos=(e,t)=>{let n=0;for(;t>0;t--){const r=e.charCodeAt(n);n+=r>=55296&&r<=57343?2:1}return n}),En}var Ui={},Oc;function Pi(){return Oc||(Oc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.uniSlice=e.dlen=e.eachOp=void 0;const t=Li(),n=O=>{if(!Array.isArray(O))throw Error("Op must be an array of components");let R=null;for(let b=0;b<O.length;b++){const T=O[b];switch(typeof T){case"object":if(typeof T.d!="number"&&typeof T.d!="string")throw Error("Delete must be number or string");if(e.dlen(T.d)<=0)throw Error("Deletes must not be empty");break;case"string":if(!(T.length>0))throw Error("Inserts cannot be empty");break;case"number":if(!(T>0))throw Error("Skip components must be >0");if(typeof R=="number")throw Error("Adjacent skip components should be combined");break}R=T}if(typeof R=="number")throw Error("Op has a trailing skip")};function r(O,R){let b=0,T=0;for(let B=0;B<O.length;B++){const $=O[B];switch(R($,b,T),typeof $){case"object":b+=e.dlen($.d);break;case"string":T+=t.strPosToUni($);break;case"number":b+=$,T+=$;break}}}e.eachOp=r;function s(O,R){const b=[],T=a(b);return r(O,(B,$,g)=>{T(R(B,$,g))}),h(b)}const i=O=>O,o=O=>s(O,i);e.dlen=O=>typeof O=="number"?O:t.strPosToUni(O);const a=O=>R=>{if(!(!R||R.d===0||R.d===""))if(O.length===0)O.push(R);else if(typeof R==typeof O[O.length-1])if(typeof R=="object"){const b=O[O.length-1];b.d=typeof b.d=="string"&&typeof R.d=="string"?b.d+R.d:e.dlen(b.d)+e.dlen(R.d)}else O[O.length-1]+=R;else O.push(R)},l=O=>typeof O=="number"?O:typeof O=="string"?t.strPosToUni(O):typeof O.d=="number"?O.d:t.strPosToUni(O.d);e.uniSlice=(O,R,b)=>{const T=t.uniToStrPos(O,R),B=b==null?1/0:t.uniToStrPos(O,b);return O.slice(T,B)};const c=(O,R,b)=>typeof O=="number"?b==null?O-R:Math.min(O,b)-R:e.uniSlice(O,R,b),u=O=>{let R=0,b=0;return{take:($,g)=>{if(R===O.length)return $===-1?null:$;const P=O[R];let v;if(typeof P=="number")return $===-1||P-b<=$?(v=P-b,++R,b=0,v):(b+=$,$);if(typeof P=="string"){if($===-1||g==="i"||t.strPosToUni(P.slice(b))<=$)return v=P.slice(b),++R,b=0,v;{const M=b+t.uniToStrPos(P.slice(b),$);return v=P.slice(b,M),b=M,v}}else{if($===-1||g==="d"||e.dlen(P.d)-b<=$)return v={d:c(P.d,b)},++R,b=0,v;{let M=c(P.d,b,b+$);return b+=$,{d:M}}}},peek:()=>O[R]}},h=O=>(O.length>0&&typeof O[O.length-1]=="number"&&O.pop(),O);function d(O,R,b){if(b!=="left"&&b!=="right")throw Error("side ("+b+") must be 'left' or 'right'");n(O),n(R);const T=[],B=a(T),{take:$,peek:g}=u(O);for(let v=0;v<R.length;v++){const M=R[v];let A,w;switch(typeof M){case"number":for(A=M;A>0;)w=$(A,"i"),B(w),typeof w!="string"&&(A-=l(w));break;case"string":b==="left"&&typeof g()=="string"&&B($(-1)),B(t.strPosToUni(M));break;case"object":for(A=e.dlen(M.d);A>0;)switch(w=$(A,"i"),typeof w){case"number":A-=w;break;case"string":B(w);break;case"object":A-=e.dlen(w.d)}break}}let P;for(;P=$(-1);)B(P);return h(T)}function m(O,R){n(O),n(R);const b=[],T=a(b),{take:B}=u(O);for(let g=0;g<R.length;g++){const P=R[g];let v,M;switch(typeof P){case"number":for(v=P;v>0;)M=B(v,"d"),T(M),typeof M!="object"&&(v-=l(M));break;case"string":T(P);break;case"object":v=e.dlen(P.d);let A=0;for(;A<v;)switch(M=B(v-A,"d"),typeof M){case"number":T({d:c(P.d,A,A+M)}),A+=M;break;case"string":A+=t.strPosToUni(M);break;case"object":T(M)}break}}let $;for(;$=B(-1);)T($);return h(b)}const _=(O,R)=>{let b=0;for(let T=0;T<R.length&&O>b;T++){const B=R[T];switch(typeof B){case"number":{b+=B;break}case"string":const $=t.strPosToUni(B);b+=$,O+=$;break;case"object":O-=Math.min(e.dlen(B.d),O-b);break}}return O},p=(O,R)=>typeof O=="number"?_(O,R):O.map(b=>_(b,R));function I(O,R,b){return s(O,(T,B)=>typeof T=="object"&&typeof T.d=="number"?{d:b.slice(R,B,B+T.d)}:T)}function y(O){return s(O,R=>{switch(typeof R){case"object":if(typeof R.d=="number")throw Error("Cannot invert text op: Deleted characters missing from operation. makeInvertible must be called first.");return R.d;case"string":return{d:R};case"number":return R}})}function H(O){return s(O,R=>typeof R=="object"&&typeof R.d=="string"?{d:t.strPosToUni(R.d)}:R)}function x(O){let R=!0;return r(O,b=>{typeof b=="object"&&typeof b.d=="number"&&(R=!1)}),R}function Y(O){return{name:"text-unicode",uri:"http://sharejs.org/types/text-unicode",trim:h,normalize:o,checkOp:n,create(R=""){if(typeof R!="string")throw Error("Initial data must be a string");return O.create(R)},apply(R,b){n(b);const T=O.builder(R);for(let B=0;B<b.length;B++){const $=b[B];switch(typeof $){case"number":T.skip($);break;case"string":T.append($);break;case"object":T.del(e.dlen($.d));break}}return T.build()},transform:d,compose:m,transformPosition:_,transformSelection:p,isInvertible:x,makeInvertible(R,b){return I(R,b,O)},stripInvertible:H,invert:y,invertWithDoc(R,b){return y(I(R,b,O))},isNoop:R=>R.length===0}}e.default=Y})(Ui)),Ui}var fs={},vc;function F_(){if(vc)return fs;vc=1,Object.defineProperty(fs,"__esModule",{value:!0});const e=Pi(),t=Li();function n(r,s){return{get:r,getLength(){return r().length},insert(i,o,a){const l=t.strPosToUni(r(),i);return s([l,o],a)},remove(i,o,a){const l=t.strPosToUni(r(),i);return s([l,{d:o}],a)},_onOp(i){e.eachOp(i,(o,a,l)=>{switch(typeof o){case"string":this.onInsert&&this.onInsert(l,o);break;case"object":const c=e.dlen(o.d);this.onRemove&&this.onRemove(l,c)}})},onInsert:null,onRemove:null}}return fs.default=n,n.provides={text:!0},fs}var wc;function x_(){return wc||(wc=1,(function(e){var t=yt&&yt.__createBinding||(Object.create?(function(d,m,_,p){p===void 0&&(p=_),Object.defineProperty(d,p,{enumerable:!0,get:function(){return m[_]}})}):(function(d,m,_,p){p===void 0&&(p=_),d[p]=m[_]})),n=yt&&yt.__setModuleDefault||(Object.create?(function(d,m){Object.defineProperty(d,"default",{enumerable:!0,value:m})}):function(d,m){d.default=m}),r=yt&&yt.__importStar||function(d){if(d&&d.__esModule)return d;var m={};if(d!=null)for(var _ in d)Object.hasOwnProperty.call(d,_)&&t(m,d,_);return n(m,d),m},s=yt&&yt.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.type=e.remove=e.insert=void 0;const i=Li(),o=r(Pi()),a=s(F_()),l={create(d){return d},toString(d){return d},builder(d){if(typeof d!="string")throw Error("Invalid document snapshot: "+d);const m=[];return{skip(_){let p=i.uniToStrPos(d,_);if(p>d.length)throw Error("The op is too long for this document");m.push(d.slice(0,p)),d=d.slice(p)},append(_){m.push(_)},del(_){d=d.slice(i.uniToStrPos(d,_))},build(){return m.join("")+d}}},slice:o.uniSlice},c=o.default(l),u=Object.assign(Object.assign({},c),{api:a.default});e.type=u,e.insert=(d,m)=>m.length===0?[]:d===0?[m]:[d,m],e.remove=(d,m)=>o.dlen(m)===0?[]:d===0?[{d:m}]:[d,{d:m}];var h=Pi();Object.defineProperty(e,"makeType",{enumerable:!0,get:function(){return h.default}})})(yt)),yt}var bc;function H_(){return bc||(bc=1,(function(e){var t=dr&&dr.__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 n=t(P_()),r=t(k_()),s=Cc(),i=Ic();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:y,checkValidOp:B,normalize:$,apply:g,transformPosition:P,compose:v,tryTransform:L,transform:Q,makeInvertible:w,invert:M,invertWithDoc:N,RM_UNEXPECTED_CONTENT:i.ConflictType.RM_UNEXPECTED_CONTENT,DROP_COLLISION:i.ConflictType.DROP_COLLISION,BLACKHOLE:i.ConflictType.BLACKHOLE,transformNoConflict:(S,U,V)=>ue(()=>!0,S,U,V),typeAllowingConflictsPred:S=>Object.assign(Object.assign({},e.type),{transform:(U,V,z)=>ue(S,U,V,z)})};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 d(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 m(S,U,V){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,V)):(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]=V),V}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,V)=>s.writeCursor().at(S,z=>{z.write("r",U),z.write("i",V)}).get(),e.editOp=(S,U,V,z=!1)=>s.writeCursor().at(S,j=>R(j,U,V,z)).get();const _=(S,U)=>S!=null&&(typeof U=="number"?Array.isArray(S):typeof S=="object"),p=(S,U)=>_(S,U)?S[U]:void 0,I={};function y(S){let U=S.type?S.type:S;U.name&&(I[U.name]=U),U.uri&&(I[U.uri]=U)}const H=S=>{const U=I[S];if(U)return U;throw Error("Missing type: "+S)};y(x_());const x=(S,U)=>S+U;y({name:"number",apply:x,compose:x,invert:S=>-S,transform:S=>S});const Y=S=>S==null?null:S.et?H(S.et):S.es?I["text-unicode"]:S.ena!=null?I.number:null,O=S=>S.es?S.es:S.ena!=null?S.ena:S.e,R=(S,U,V,z=!1)=>{const[j,W]=typeof U=="string"?[H(U),U]:[U,U.name];!z&&j.isNoop&&j.isNoop(V)||(W==="number"?S.write("ena",V):W==="text-unicode"?S.write("es",V):(S.write("et",W),S.write("e",V)))};function b(S){o(typeof S=="number"),o(S>=0),o(S===(0|S))}function T(S){typeof S=="number"?b(S):o(typeof S=="string")}function B(S){if(S===null)return;const U=new Set,V=new Set,z=W=>{let ee=!0,te=!1;for(let k in W){const K=W[k];if(ee=!1,o(k==="p"||k==="r"||k==="d"||k==="i"||k==="e"||k==="es"||k==="ena"||k==="et","Invalid component item '"+k+"'"),k==="p")b(K),o(!U.has(K)),U.add(K),o(W.r===void 0);else if(k==="d")b(K),o(!V.has(K)),V.add(K),o(W.i===void 0);else if(k==="e"||k==="es"||k==="ena"){o(!te),te=!0;const q=Y(W);o(q,"Missing type in edit"),q.checkValidOp&&q.checkValidOp(O(W))}}o(!ee)},j=(W,ee,te)=>{if(!Array.isArray(W))throw Error("Op must be null or a list");if(W.length===0)throw Error("Empty descent");ee||T(W[0]);let k=1,K=0,q=0;for(let re=0;re<W.length;re++){const ge=W[re];if(o(ge!=null),Array.isArray(ge)){const Ee=j(ge,!1);if(K){const X=typeof q,de=typeof Ee;X===de?o(q<Ee,"descent keys are not in order"):o(X==="number"&&de==="string")}q=Ee,K++,k=3}else typeof ge=="object"?(o(k===1,`Prev not scalar - instead ${k}`),z(ge),k=2):(o(k!==3),T(ge),o(s.isValidPathItem(ge),"Invalid path key"),k=1)}return o(K!==1,"Operation makes multiple descents. Remove some []"),o(k===2||k===3),W[0]};j(S,!0),o(U.size===V.size,"Mismatched picks and drops in op");for(let W=0;W<U.size;W++)o(U.has(W)),o(V.has(W))}function $(S){let U=0,V=[];const z=s.writeCursor();return z.mergeTree(S,(j,W)=>{const ee=Y(j);if(ee){const k=O(j);R(W,ee,ee.normalize?ee.normalize(k):k)}for(const k of["r","p","i","d"])if(j[k]!==void 0){const K=k==="p"||k==="d"?(te=j[k],V[te]==null&&(V[te]=U++),V[te]):j[k];W.write(k,K)}var te}),z.get()}function g(S,U){if(B(U),U===null)return S;const V=[];return(function z(j,W){let ee=j,te=0,k={root:j},K=0,q=k,re="root";function ge(){for(;K<te;K++){let Ee=W[K];typeof Ee!="object"&&(o(_(q,re)),q=q[re]=c(q[re]),re=Ee)}}for(;te<W.length;te++){const Ee=W[te];if(Array.isArray(Ee)){const X=z(ee,Ee);X!==ee&&X!==void 0&&(ge(),ee=q[re]=X)}else if(typeof Ee=="object"){Ee.d!=null?(ge(),ee=m(q,re,V[Ee.d])):Ee.i!==void 0&&(ge(),ee=m(q,re,Ee.i));const X=Y(Ee);if(X)ge(),ee=q[re]=X.apply(ee,O(Ee));else if(Ee.e!==void 0)throw Error("Subtype "+Ee.et+" undefined")}else ee=p(ee,Ee)}return k.root})(S=(function z(j,W){const ee=[];let te=0;for(;te<W.length;te++){const re=W[te];if(Array.isArray(re))break;typeof re!="object"&&(ee.push(j),j=p(j,re))}for(let re=W.length-1;re>=te;re--)j=z(j,W[re]);for(--te;te>=0;te--){const re=W[te];if(typeof re!="object"){const ge=ee.pop();j=j===p(ge,re)?ge:j===void 0?d(ge,re):(K=re,q=j,(k=c(k=ge))[K]=q,k)}else u(re)&&(o(j!==void 0,"Cannot pick up or remove undefined"),re.p!=null&&(V[re.p]=j),j=void 0)}var k,K,q;return j})(S,U),U)}function P(S,U){S=S.slice(),B(U);const V=s.readCursor(U);let z,j,W=!1;const ee=[];for(let k=0;;k++){const K=S[k],q=V.getComponent();if(q&&(q.r!==void 0?W=!0:q.p!=null&&(W=!1,z=q.p,j=k)),k>=S.length)break;let re=0;const ge=s.advancer(V,void 0,(X,de)=>{u(de)&&re++});ee.unshift(ge);const Ee=ge(K);if(typeof K=="number"&&(S[k]-=re),!Ee)break}if(ee.forEach(k=>k.end()),W)return null;const te=()=>{let k=0;if(z!=null){const K=V.getPath();k=K.length,S=K.concat(S.slice(j))}for(;k<S.length;k++){const K=S[k],q=a(V),re=Y(q);if(re){const X=O(q);re.transformPosition&&(S[k]=re.transformPosition(S[k],X));break}let ge=0;const Ee=s.advancer(V,(X,de)=>h(de)?~(X-ge):X-ge,(X,de)=>{h(de)&&ge++})(K);if(typeof K=="number"&&(S[k]+=ge),!Ee)break}};return z!=null?V.eachDrop(null,k=>{k===z&&te()}):te(),S}function v(S,U){if(B(S),B(U),S==null)return U;if(U==null)return S;let V=0;const z=s.readCursor(S),j=s.readCursor(U),W=s.writeCursor(),ee=[],te=[],k=[],K=[],q=[],re=[],ge=new Set;z.traverse(null,X=>{X.p!=null&&(k[X.p]=z.clone())}),j.traverse(null,X=>{X.d!=null&&(K[X.d]=j.clone())});const Ee=s.writeCursor();return(function X(de,xe,Le,ve,$e,Gt,st,et){o(xe||Le);const je=a(xe),vt=a(Le),Nt=!!vt&&vt.r!==void 0,vn=!!je&&je.i!==void 0,wt=je?je.d:null,_t=vt?vt.p:null,Kt=(Gt||Nt)&&_t==null;if(_t!=null)ve=K[_t],st=te[_t]=new s.WriteCursor;else if(vt&&vt.r!==void 0)ve=null;else{const oe=a(ve);oe&&oe.d!=null&&(ve=null)}const Te=a(ve);if(wt!=null)if(de=k[wt],et=ee[wt]=new s.WriteCursor,Kt)Gt&&!Nt&&et.write("r",!0);else{const oe=q[wt]=V++;st.write("d",oe)}else if(je&&je.i!==void 0)de=null;else{const oe=a(de);oe&&oe.p!=null&&(de=null)}let ce;vn?(o($e===void 0),ce=je.i):ce=$e;const Ie=(_t==null?!vn||Gt||Nt:ce===void 0)?null:st.getComponent();if(_t!=null){if(!($e!==void 0||vn)){const oe=wt!=null?q[wt]:V++;re[_t]=oe,et.write("p",oe)}}else Nt&&(vn||$e!==void 0||(vt.r,et.write("r",vt.r)));const he=Kt?null:Y(je),ie=Y(Te);if((he||ie)&&(he&&he.name,ie&&ie.name),he&&ie){o(he===ie);const oe=O(je),Oe=O(Te),qe=he.compose(oe,Oe);R(st,he,qe),ge.add(Te)}else he?R(st,he,O(je)):ie&&(R(st,ie,O(Te)),ge.add(Te));const me=typeof ce=="object"&&ce!=null;let Ae=!1,ye=0,Ne=0,Xe=0,Ge=0,We=0;const rt=s.advancer(ve,(oe,Oe)=>h(Oe)?Ge-oe-1:oe-Ge,(oe,Oe)=>{h(Oe)&&Ge++}),be=s.advancer(de,(oe,Oe)=>u(Oe)?ye-oe-1:oe-ye,(oe,Oe)=>{u(Oe)&&ye++});if(s.eachChildOf(xe,Le,(oe,Oe,qe)=>{let ot,Xt,wn=oe,Mt=oe,Kr=oe;if(typeof oe=="number"){let tt=oe+Xe;Xt=rt(tt),Mt=tt+Ge;let Ve=oe+Ne;ot=be(Ve),h(a(Xt))&&(ot=null),wn=Ve+ye,Kr=oe+We,o(wn>=0,"p1PickKey is negative"),o(Mt>=0,"p2DropKey is negative");const Dt=h(a(Oe)),qt=u(a(qe));(Dt||qt&&!Kt)&&We--,Dt&&Ne--,qt&&Xe--}else ot=be(oe),Xt=rt(oe);et.descend(wn),st.descend(Mt);const tr=me&&!h(a(Oe))?ce[Kr]:void 0,Ht=X(ot,Oe,qe,Xt,tr,Kt,st,et);var Bt,_e,Be;me&&!Kt?tr!==Ht&&(Ae||(ce=Array.isArray(ce)?ce.slice():Object.assign({},ce),Ae=!0),Bt=ce,Be=Ht,typeof(_e=Kr)=="number"?(o(Array.isArray(Bt)),o(_e<Bt.length)):(o(!Array.isArray(Bt)),o(Bt[_e]!==void 0)),Be===void 0?typeof _e=="number"?Bt.splice(_e,1):delete Bt[_e]:Bt[_e]=Be):o(Ht===void 0),st.ascend(),et.ascend()}),be.end(),rt.end(),Ie!=null)Ie.i=ce;else if(!Gt&&!Nt&&_t==null)return ce})(z,z.clone(),j,j.clone(),void 0,!1,W,Ee),W.reset(),W.mergeTree(Ee.get()),W.reset(),W.get(),ee.map(X=>X.get()),te.map(X=>X.get()),z.traverse(W,(X,de)=>{const xe=X.p;if(xe!=null){const Le=q[xe];Le!=null&&de.write("p",Le);const ve=ee[xe];ve&&ve.get(),ve&&de.mergeTree(ve.get())}else X.r!==void 0&&de.write("r",X.r)}),W.reset(),W.get(),j.traverse(W,(X,de)=>{const xe=X.d;if(xe!=null){const ve=re[xe];ve!=null&&de.write("d",ve);const $e=te[xe];$e&&de.mergeTree($e.get())}else X.i!==void 0&&de.write("i",X.i);const Le=Y(X);Le&&!ge.has(X)&&R(de,Le,O(X))}),W.get()}function M(S){if(S==null)return null;const U=new s.ReadCursor(S),V=new s.WriteCursor;let z;const j=[],W=[];return(function ee(te,k,K){const q=te.getComponent();let re,ge=!1;if(q){q.p!=null&&(k.write("d",q.p),j[q.p]=te.clone()),q.r!==void 0&&k.write("i",q.r),q.d!=null&&(k.write("p",q.d),K=void 0),q.i!==void 0&&(K=re=q.i);const X=Y(q);X&&(K===void 0?(z||(z=new Set),z.add(q)):(O(q),K=X.apply(K,O(q)),ge=!0))}let Ee=0;for(const X of te){k.descend(X);const de=typeof X=="number"?X-Ee:X,xe=p(K,de);h(te.getComponent())&&Ee++;const Le=ee(te,k,xe);if(K!==void 0&&Le!==void 0){if(ge||(ge=!0,K=c(K)),!_(K,de))throw Error("Cannot modify child - invalid operation");K[de]=Le}k.ascend()}if(re===void 0)return ge?K:void 0;k.write("r",K)})(U,V,void 0),z&&(V.reset(),(function ee(te,k,K){const q=k.getComponent();if(q){const X=q.d;if(X!=null&&(te=j[X],K=W[X]=s.writeCursor()),z.has(q)){const de=Y(q);if(!de.invert)throw Error(`Cannot invert subtype ${de.name}`);R(K,de,de.invert(O(q)))}}let re=0,ge=0;const Ee=s.advancer(te,(X,de)=>u(de)?re-X-1:X-re,(X,de)=>{u(de)&&re++});for(const X of k)if(typeof X=="number"){const de=X-ge,xe=Ee(de),Le=de+re;K.descend(Le),ee(xe,k,K),h(k.getComponent())&&ge++,K.ascend()}else K.descend(X),ee(Ee(X),k,K),K.ascend();Ee.end()})(U.clone(),U,V),W.length&&(V.reset(),U.traverse(V,(ee,te)=>{const k=ee.p;if(k!=null){const K=W[k];K&&K.get(),K&&te.mergeTree(K.get())}}))),V.get()}const A=(S,U)=>S.some(V=>typeof V=="object"&&(Array.isArray(V)?A(V,U):U(V)));function w(S,U){if(S==null||!A(S,k=>{var K;return k.r!==void 0||((K=Y(k))===null||K===void 0?void 0:K.makeInvertible)!=null}))return S;const V=new s.ReadCursor(S),z=new s.WriteCursor;let j=!1;const W=[],ee=[],te=(k,K,q)=>{const re=k.getComponent();let ge=!1;if(re){re.d!=null&&K.write("d",re.d),re.i!==void 0&&K.write("i",re.i);const X=re.p;if(X!=null&&(W[X]=k.clone(),o(q!==void 0,"Operation picks up at an invalid key"),ee[X]=q,K.write("p",re.p)),re.r!==void 0&&q===void 0)throw Error("Invalid doc / op in makeInvertible: removed item missing from doc");const de=Y(re);de&&(de.makeInvertible?j=!0:R(K,de,O(re),!0))}let Ee=0;for(const X of k){K.descend(X);const de=typeof X=="number"?X-Ee:X,xe=p(q,de),Le=te(k,K,xe);xe!==Le&&(ge||(ge=!0,q=c(q)),Le===void 0?(q=d(q,de),typeof X=="number"&&Ee++):q[de]=Le),K.ascend()}return re&&(re.r!==void 0?(K.write("r",r.default(q)),q=void 0):re.p!=null&&(q=void 0)),q};return te(V,z,U),z.get(),j&&(z.reset(),(function k(K,q,re,ge,Ee){const X=q.getComponent();if(X){X.i!==void 0?(ge=X.i,Ee=!0):X.d!=null&&(ge=ee[X.d],K=W[X.d],Ee=!1,X.d);let ve=Y(X);if(ve&&ve.makeInvertible){const $e=O(X);R(re,ve,ve.makeInvertible($e,ge),!0)}}let de=0,xe=0;const Le=s.advancer(K,(ve,$e)=>u($e)?de-ve-1:ve-de,(ve,$e)=>{u($e)&&de++});for(const ve of q)if(typeof ve=="number"){const $e=ve-xe,Gt=Le($e),st=$e+de,et=p(ge,Ee?$e:st);re.descend(ve),k(Gt,q,re,et,Ee),h(q.getComponent())&&xe++,re.ascend()}else{const $e=p(ge,ve);re.descend(ve),k(Le(ve),q,re,$e,Ee),re.ascend()}Le.end()})(V.clone(),V,z,U,!1)),z.get()}function N(S,U){return M(w(S,U))}const D=S=>{if(S==null)return null;const U=S.slice();for(let V=0;V<S.length;V++){const z=U[V];Array.isArray(z)&&(U[V]=D(z))}return U};function L(S,U,V){o(V==="left"||V==="right","Direction must be left or right");const z=V==="left"?0:1;if(U==null)return{ok:!0,result:S};B(S),B(U);let j=null;const W=[],ee=[],te=[],k=[],K=[],q=[],re=[],ge=[],Ee=[],X=[],de=[],xe=[],Le=[],ve=[],$e=[];let Gt=0;const st=s.readCursor(S),et=s.readCursor(U),je=s.writeCursor();if((function Te(ce,Ie=null,he){const ie=a(Ie);ie&&(ie.r!==void 0?he=Ie.clone():ie.p!=null&&(he=null,q[ie.p]=ce.clone()));const me=ce.getComponent();let Ae;me&&(Ae=me.p)!=null&&(K[Ae]=Ie?Ie.clone():null,te[Ae]=ce.clone(),he&&(X[Ae]=!0,Ee[Ae]=he),ie&&ie.p!=null&&(ve[Ae]=ie.p));const ye=s.advancer(Ie);for(const Ne of ce)Te(ce,ye(Ne),he);ye.end()})(et,st,null),(function Te(ce,Ie,he,ie,me){const Ae=he.getComponent();let ye,Ne=!1;Ae&&((ye=Ae.d)!=null?(k[ye]=he.clone(),ie!=null&&($e[ie]==null&&($e[ie]=[]),$e[ie].push(ye)),X[ye],ce=K[ye]||null,Ie=te[ye]||null,X[ye]?(me&&(de[ye]=!0),me=Ee[ye]||null):!me||z!==1&&ve[ye]!=null||j==null&&(j={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(me.getPath()),op2:e.moveOp(Ie.getPath(),he.getPath())}),Ne=!0):Ae.i!==void 0&&(ce=Ie=null,Ne=!0,me&&j==null&&(j={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(me.getPath()),op2:e.insertOp(he.getPath(),Ae.i)})));const Xe=a(ce);Xe&&(Xe.r!==void 0?me=ce.clone():Xe.p!=null&&(Xe.p,ie=Xe.p,me=null));const Ge=Y(Ae);Ge&&me&&j==null&&(j={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(me.getPath()),op2:e.editOp(he.getPath(),Ge,O(Ae),!0)});let We=0,rt=0;const be=s.advancer(Ie,(Oe,qe)=>u(qe)?We-Oe-1:Oe-We,(Oe,qe)=>{u(qe)&&We++}),oe=s.advancer(ce);for(const Oe of he)if(typeof Oe=="number"){const qe=Oe-rt,ot=be(qe);rt+=+Te(oe(qe+We),ot,he,ie,me)}else{const qe=be(Oe);Te(oe(Oe),qe,he,ie,me)}return be.end(),oe.end(),Ne})(st,et,et.clone(),null,null),k.map(Te=>Te&&Te.get()),j)return{ok:!1,conflict:j};de.map(Te=>!!Te);const vt=[];let Nt=null;(function Te(ce,Ie,he,ie,me){let Ae=!1;const ye=a(Ie);if(u(ye)){const be=ye.p;be!=null?(he=k[be],ie=xe[be]=s.writeCursor(),Ae=!0,me=null):(he=null,me=Ie.clone())}else h(a(he))&&(he=null);const Ne=ce.getComponent();if(Ne){const be=Ne.p;be!=null?(me&&(ge[be]=me),vt[be]=me||z===1&&Ae?null:ie.getComponent(),W[be]=ce.clone(),he&&(re[be]=he.clone())):Ne.r!==void 0&&(me||ie.write("r",!0),(me||Ae)&&(Nt==null&&(Nt=new Set),Nt.add(Ne)))}let Xe=0,Ge=0;const We=s.advancer(Ie,void 0,(be,oe)=>{u(oe)&&Xe++}),rt=s.advancer(he,(be,oe)=>h(oe)?~(be-Ge):be-Ge,(be,oe)=>{h(oe)&&Ge++});if(ce)for(const be of ce)if(typeof be=="string"){const oe=We(be),Oe=rt(be);ie.descend(be),Te(ce,oe,Oe,ie,me),ie.ascend()}else{const oe=We(be),Oe=be-Xe,qe=u(a(oe))?null:rt(Oe),ot=Oe+Ge;o(ot>=0),ie.descend(ot),Te(ce,oe,qe,ie,me),ie.ascend()}We.end(),rt.end()})(st,et,et.clone(),je,null),je.reset();let vn=[];if((function Te(ce,Ie,he,ie,me,Ae){o(Ie);const ye=Ie.getComponent();let Ne=a(ie),Xe=!1;const Ge=(_e,Be,tt)=>_e?e.moveOp(_e.getPath(),Be.getPath()):e.insertOp(Be.getPath(),tt.i);if(h(ye)){const _e=ye.d;_e!=null&&(ee[_e]=Ie.clone());const Be=_e!=null?vt[_e]:null;let tt=!1;if(ye.i!==void 0||_e!=null&&Be){let Ve;Ne&&(Ne.i!==void 0||(Ve=Ne.d)!=null&&!X[Ve])&&(tt=Ve!=null?_e!=null&&_e===ve[Ve]:n.default(Ne.i,ye.i),tt||Ve!=null&&z!==1&&ve[Ve]!=null||j==null&&(j={type:i.ConflictType.DROP_COLLISION,op1:Ge(_e!=null?W[_e]:null,Ie,ye),op2:Ge(Ve!=null?te[Ve]:null,ie,Ne)})),tt||(Ae?j==null&&(j={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:Ge(_e!=null?W[_e]:null,Ie,ye),op2:e.removeOp(Ae.getPath())}):(_e!=null?(vn[Gt]=_e,me.write("d",Be.p=Gt++)):me.write("i",r.default(ye.i)),Xe=!0))}else if(_e!=null&&!Be){const Ve=ge[_e];Ve&&(Ae=Ve.clone())}_e!=null?(ce=W[_e],he=q[_e],ie=re[_e]):ye.i!==void 0&&(ce=he=null,tt||(ie=null))}else u(a(ce))&&(ce=he=ie=null);const We=a(ce),rt=a(he);if(u(rt)){const _e=rt.p;rt.r!==void 0&&(!We||We.r===void 0)||X[_e]?(ie=null,Ae=he.clone()):_e!=null&&(ie=k[_e],z!==1&&ve[_e]!=null||((me=Le[_e])||(me=Le[_e]=s.writeCursor()),me.reset(),Ae=null))}else!h(ye)&&h(Ne)&&(ie=null);Ne=ie!=null?ie.getComponent():null;const be=Y(ye);if(be){const _e=O(ye);if(Ae)j==null&&(j={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.editOp(Ie.getPath(),be,_e,!0),op2:e.removeOp(Ae.getPath())});else{const Be=Y(Ne);let tt;if(Be){if(be!==Be)throw Error("Transforming incompatible types");const Ve=O(Ne);tt=be.transform(_e,Ve,V)}else tt=r.default(_e);R(me,be,tt)}}let oe=0,Oe=0,qe=0,ot=0,Xt=0,wn=0,Mt=ce!=null&&ce.descendFirst(),Kr=Mt;const tr=s.advancer(he,void 0,(_e,Be)=>{u(Be)&&qe++});let Ht=ie!=null&&ie.descendFirst(),Bt=Ht;for(const _e of Ie)if(typeof _e=="number"){let Be;const tt=h(Ie.getComponent()),Ve=_e-Oe;{let cn;for(;Mt&&typeof(cn=ce.getKey())=="number";){cn+=oe;const Lt=ce.getComponent(),nr=u(Lt);if(cn>Ve||cn===Ve&&(!nr||z===0&&tt))break;if(nr){oe--;const bn=Lt.p;ve.includes(bn),Lt.d,a(Le[Lt.d]),u(a(Le[Lt.d])),(Lt.r===void 0||Nt&&Nt.has(Lt))&&(bn==null||!vt[bn]||z!==1&&ve.includes(bn))||Xt--}Mt=ce.nextSibling()}Be=Mt&&cn===Ve?ce:null}const Dt=Ve-oe;let qt=tr(Dt);const Ca=Dt-qe;let ii=null;{let cn,Lt;for(;Ht&&typeof(cn=ie.getKey())=="number";){Lt=cn-ot;const nr=ie.getComponent(),bn=h(nr);if(Lt>Ca)break;if(Lt===Ca){if(!bn){ii=ie;break}{if(z===0&&tt){ii=ie;break}const un=qt&&u(qt.getComponent());if(z===0&&un)break}}if(bn){const un=nr.d;X[un],ve[un],nr.i===void 0&&(X[un]||ve[un]!=null&&z!==1)?(X[un]||ve[un]!=null&&z===0)&&(ot++,wn--):ot++}Ht=ie.nextSibling()}}const Nd=Ca+ot+Xt+wn;o(Nd>=0,"trying to descend to a negative index"),me.descend(Nd),tt&&(Be=qt=ii=null,Oe++),Te(Be,Ie,qt,ii,me,Ae)&&wn++,me.ascend()}else{let Be;for(;Mt&&(Be=ce.getKey(),typeof Be!="string"||!(Be>_e||Be===_e));)Mt=ce.nextSibling();const tt=Mt&&Be===_e?ce:null,Ve=tr(_e);let Dt;for(;Ht&&(Dt=ie.getKey(),typeof Dt!="string"||!(Dt>_e||Dt===_e));)Ht=ie.nextSibling();const qt=Ht&&Dt===_e?ie:null;me.descend(_e),Te(tt,Ie,Ve,qt,me,Ae),me.ascend()}return tr.end(),Kr&&ce.ascend(),Bt&&ie.ascend(),Xe})(st,st.clone(),et,et.clone(),je,null),j)return{ok:!1,conflict:j};je.reset();const wt=(Te,ce,Ie)=>Te.traverse(ce,(he,ie)=>{he.d!=null&&Ie(he.d,Te,ie)});(X.length||xe.length)&&(wt(et,je,(Te,ce,Ie)=>{X[Te]&&!de[Te]&&Ie.write("r",!0),xe[Te]&&Ie.mergeTree(xe[Te].get())}),je.reset());const _t=[],Kt=[];if((Le.length||X.length)&&!j){const Te=s.readCursor(D(je.get()));if(wt(Te,null,(ce,Ie)=>{_t[ce]=Ie.clone()}),Le.forEach(ce=>{ce&&wt(s.readCursor(ce.get()),null,(Ie,he)=>{_t[Ie]=he.clone()})}),(function ce(Ie,he,ie,me,Ae,ye){const Ne=a(he);if(Ne&&u(Ne))if(Ne.p!=null){const oe=Ne.p;_t[oe].getPath(),ie=_t[oe],me=Kt[oe]=s.writeCursor()}else Ne.r!==void 0&&(ie=null);else h(a(ie))&&(ie=null);const Xe=Ie.getComponent();if(Xe){let oe;if((oe=Xe.d)!=null){const Oe=Le[oe];Oe&&(Oe.get(),me.mergeTree(Oe.get()),ie=s.readCursor(Oe.get()))}}let Ge=0,We=0;const rt=s.advancer(he,void 0,(oe,Oe)=>{u(Oe)&&Ge--}),be=s.advancer(ie,(oe,Oe)=>h(Oe)?-(oe-We)-1:oe-We,(oe,Oe)=>{h(Oe)&&We++});for(const oe of Ie)if(typeof oe=="number"){const Oe=rt(oe),qe=oe+Ge,ot=be(qe),Xt=qe+We;me.descend(Xt),ce(Ie,Oe,ot,me),me.ascend()}else me.descend(oe),ce(Ie,rt(oe),be(oe),me),me.ascend();rt.end(),be.end()})(et,Te,Te.clone(),je),je.reset(),j)return{ok:!1,conflict:j};if(je.get(),Kt.length){const ce=Kt.map(he=>he?he.get():null),Ie=s.readCursor(D(je.get()));if(wt(Ie,je,(he,ie,me)=>{const Ae=ce[he];Ae&&(me.mergeTree(Ae),ce[he]=null)}),ce.find(he=>he)){const he=s.writeCursor(),ie=s.writeCursor();let me=0,Ae=0;ce.forEach(ye=>{ye!=null&&wt(s.readCursor(ye),null,Ne=>{const Xe=vn[Ne];he.writeMove(W[Xe].getPath(),ee[Xe].getPath(),me++);const Ge=$e[Xe];Ge&&Ge.forEach(We=>{X[We]||z!==1&&ve[We]!=null||ie.writeMove(te[We].getPath(),k[We].getPath(),Ae++)})})}),j={type:i.ConflictType.BLACKHOLE,op1:he.get(),op2:ie.get()}}}}return j?{ok:!1,conflict:j}:{ok:!0,result:je.get()}}const F=S=>{const U=new Error("Transform detected write conflict");throw U.conflict=S,U.type=U.name="writeConflict",U};function Q(S,U,V){const z=L(S,U,V);if(z.ok)return z.result;F(z.conflict)}const G=S=>{const U=s.writeCursor();return s.readCursor(S).traverse(U,(V,z)=>{(h(V)||Y(V))&&z.write("r",!0)}),U.get()},le=(S,U)=>{const{type:V,op1:z,op2:j}=S;switch(V){case i.ConflictType.DROP_COLLISION:return U==="left"?[null,G(j)]:[G(z),null];case i.ConflictType.RM_UNEXPECTED_CONTENT:let W=!1;return s.readCursor(z).traverse(null,ee=>{ee.r!==void 0&&(W=!0)}),W?[null,G(j)]:[G(z),null];case i.ConflictType.BLACKHOLE:return[G(z),G(j)];default:throw Error("Unrecognised conflict: "+V)}};function ue(S,U,V,z){let j=null;for(;;){const W=L(U,V,z);if(W.ok)return v(j,W.result);{const{conflict:ee}=W;S(ee)||F(ee);const[te,k]=le(ee,z);U=v($(U),te),V=v($(V),k),j=v(j,k)}}}})(dr)),dr}var yc;function B_(){return yc||(yc=1,(function(e){var t=pn&&pn.__createBinding||(Object.create?(function(i,o,a,l){l===void 0&&(l=a),Object.defineProperty(i,l,{enumerable:!0,get:function(){return o[a]}})}):(function(i,o,a,l){l===void 0&&(l=a),i[l]=o[a]})),n=pn&&pn.__exportStar||function(i,o){for(var a in i)a!=="default"&&!o.hasOwnProperty(a)&&t(o,i,a)};Object.defineProperty(e,"__esModule",{value:!0}),n(H_(),e);var r=Cc();Object.defineProperty(e,"ReadCursor",{enumerable:!0,get:function(){return r.ReadCursor}}),Object.defineProperty(e,"WriteCursor",{enumerable:!0,get:function(){return r.WriteCursor}});var s=Ic();Object.defineProperty(e,"ConflictType",{enumerable:!0,get:function(){return s.ConflictType}})})(pn)),pn}var lt=B_();const $_=Md({__proto__:null,default:pt(lt)},[lt]);var Re=(e=>(e[e.COVER=0]="COVER",e[e.REPLACE=1]="REPLACE",e))(Re||{}),J=(e=>(e.RETAIN="r",e.INSERT="i",e.DELETE="d",e))(J||{});const fr=Ce.createIdentifier("univer.config-service");class Ac{constructor(){E(this,"_configChanged$",new se.Subject);E(this,"configChanged$",this._configChanged$.asObservable());E(this,"_config",new Map)}dispose(){this._config.clear(),this._configChanged$.complete()}getConfig(t){return this._config.get(t)}setConfig(t,n,r){var o;const{merge:s=!1}=r||{};let i=(o=this._config.get(t))!=null?o:{};s?i=ss(i,n):i=n,this._config.set(t,i),this._configChanged$.next({[t]:i})}deleteConfig(t){return this._config.delete(t)}subscribeConfigValue$(t){return new se.Observable(n=>{Object.prototype.hasOwnProperty.call(this._config,t)&&n.next(this._config.get(t));const r=this.configChanged$.pipe(se.filter(s=>Object.prototype.hasOwnProperty.call(s,t))).subscribe(s=>n.next(s[t]));return()=>r.unsubscribe()})}}const Un=Ce.createIdentifier("univer.context-service");class Tc extends Ke{constructor(){super(...arguments);E(this,"_contextChanged$",new se.Subject);E(this,"contextChanged$",this._contextChanged$.asObservable());E(this,"_contextMap",new Map)}dispose(){super.dispose(),this._contextChanged$.complete(),this._contextMap.clear()}getContextValue(n){var r;return(r=this._contextMap.get(n))!=null?r:!1}setContextValue(n,r){this._contextMap.set(n,r),this._contextChanged$.next({[n]:r})}subscribeContextValue$(n){return new se.Observable(r=>{const s=this._contextChanged$.pipe(se.filter(i=>typeof i[n]<"u")).subscribe(i=>r.next(i[n]));return this._contextMap.has(n)&&r.next(this._contextMap.get(n)),()=>s.unsubscribe()})}}var Nc=(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))(Nc||{});const dt=Ce.createIdentifier("univer.log");class Mc extends Ke{constructor(){super(...arguments);E(this,"_logLevel",3);E(this,"_deduction",new Set)}dispose(){super.dispose(),this._logLevel=3,this._deduction.clear()}debug(...n){this._logLevel>=4&&this._log(console.debug,...n)}log(...n){this._logLevel>=3&&this._log(console.log,...n)}warn(...n){this._logLevel>=2&&this._log(console.warn,...n)}error(...n){this._logLevel>=1&&this._log(console.error,...n)}deprecate(...n){this._logLevel>=2&&this._logWithDeduplication(console.error,...n)}setLogLevel(n){this._logLevel=n}_log(n,...r){const s=r[0];/^\[(.*?)\]/g.test(s)?n(`\x1B[97;104m${s}\x1B[0m`,...r.slice(1)):n(...r)}_logWithDeduplication(n,...r){const s=j_(...r);this._deduction.has(s)||(this._deduction.add(s),this._log(n,...r))}}function j_(...e){return e.map(t=>JSON.stringify(t)).join("")}var W_=Object.getOwnPropertyDescriptor,Y_=(e,t,n,r)=>{for(var s=r>1?void 0:r?W_(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},ki=(e,t)=>(n,r)=>t(n,r,e);const ms="command.logExecution";var mr=(e=>(e[e.COMMAND=0]="COMMAND",e[e.OPERATION=1]="OPERATION",e[e.MUTATION=2]="MUTATION",e))(mr||{});const gr=Ce.createIdentifier("univer.core.command-service");class V_{constructor(){E(this,"_commands",new Map);E(this,"_commandTypes",new Map)}registerCommand(t){if(this._commands.has(t.id))throw new Error(`[CommandRegistry]: command "${t.id}" has been registered before.`);return this._commands.set(t.id,t),this._commandTypes.set(t.id,t.type),Ye(()=>{this.unregisterCommand(t.id)})}unregisterCommand(t){this._commands.delete(t),this._commandTypes.delete(t)}hasCommand(t){return this._commands.has(t)}getCommand(t){return this._commands.has(t)?[this._commands.get(t)]:null}getCommandType(t){return this._commandTypes.get(t)}}const Dc={id:"nil",type:0,handler:()=>!0};f.CommandService=class extends Ke{constructor(n,r,s){super();E(this,"_commandRegistry");E(this,"_beforeCommandExecutionListeners",[]);E(this,"_commandExecutedListeners",[]);E(this,"_collabMutationListeners",[]);E(this,"_multiCommandDisposables",new Map);E(this,"_commandExecutingLevel",0);E(this,"_commandExecutionStack",[]);this._injector=n,this._logService=r,this._configService=s,this._commandRegistry=new V_,this.registerCommand(Dc)}dispose(){super.dispose(),this._commandExecutedListeners.length=0,this._beforeCommandExecutionListeners.length=0,this._collabMutationListeners.length=0}disposed(){return this._disposed}hasCommand(n){return this._commandRegistry.hasCommand(n)}registerCommand(n){return this._commandRegistry.registerCommand(n)}unregisterCommand(n){var r;this._commandRegistry.unregisterCommand(n),(r=this._multiCommandDisposables.get(n))==null||r.dispose()}registerMultipleCommand(n){return this._registerMultiCommand(n)}beforeCommandExecuted(n){if(this._beforeCommandExecutionListeners.indexOf(n)===-1)return this._beforeCommandExecutionListeners.push(n),Ye(()=>{const r=this._beforeCommandExecutionListeners.indexOf(n);this._beforeCommandExecutionListeners.splice(r,1)});throw new Error("[CommandService]: could not add a listener twice.")}onCommandExecuted(n){if(this._commandExecutedListeners.indexOf(n)===-1)return this._commandExecutedListeners.push(n),Ye(()=>{const r=this._commandExecutedListeners.indexOf(n);this._commandExecutedListeners.splice(r,1)});throw new Error("[CommandService]: could not add a listener twice.")}onMutationExecutedForCollab(n){if(this._collabMutationListeners.indexOf(n)===-1)return this._collabMutationListeners.push(n),Ye(()=>{const r=this._collabMutationListeners.indexOf(n);this._collabMutationListeners.splice(r,1)});throw new Error("[CommandService]: could not add a collab mutation listener twice.")}async executeCommand(n,r,s){try{const i=this._commandRegistry.getCommand(n);if(i){const[o]=i,a={id:o.id,type:o.type,params:r},l=this._pushCommandExecutionStack(a),c=s!=null?s:{};this._beforeCommandExecutionListeners.forEach(h=>h(a,c));const u=await this._execute(o,r,c);return c.syncOnly?o.type===2&&this._collabMutationListeners.forEach(h=>h(a,c)):(this._commandExecutedListeners.forEach(h=>h(a,c)),o.type===2&&this._collabMutationListeners.forEach(h=>h(a,c))),l.dispose(),u}throw new Error(`[CommandService]: command "${n}" is not registered.`)}catch(i){if(i instanceof Jr)return!1;throw i}}syncExecuteCommand(n,r,s){var i;try{const o=this._commandRegistry.getCommand(n);if(o){const[a]=o,l={id:a.id,type:a.type,params:r};if(a.type===2){const d=xd(this._commandExecutionStack,m=>m.type===0);d&&(l.params=(i=l.params)!=null?i:{},l.params.trigger=d.id)}const c=this._pushCommandExecutionStack(l),u=s!=null?s:{};this._beforeCommandExecutionListeners.forEach(d=>d(l,u));const h=this._syncExecute(a,r,u);return u.syncOnly?a.type===2&&this._collabMutationListeners.forEach(d=>d(l,u)):(this._commandExecutedListeners.forEach(d=>d(l,u)),a.type===2&&this._collabMutationListeners.forEach(d=>d(l,u))),c.dispose(),h}throw new Error(`[CommandService]: command "${n}" is not registered.`)}catch(o){if(o instanceof Jr)return!1;throw o}}_pushCommandExecutionStack(n){return this._commandExecutionStack.push(n),Ye(()=>rr(this._commandExecutionStack,n))}_registerMultiCommand(n){const r=this._commandRegistry.getCommand(n.id);let s;if(r){if(r[0].multi!==!0)throw new Error("Command has registered as a single command.");s=r[0]}else{s=new z_(n.id);const o=new is;o.add(this._commandRegistry.registerCommand(s)),o.add(Ye(()=>{this._multiCommandDisposables.delete(n.id)})),this._multiCommandDisposables.set(n.id,o)}const i=s.registerImplementation(n);return Ye(()=>{var o;i.dispose(),s.hasImplementations()||(o=this._multiCommandDisposables.get(n.id))==null||o.dispose()})}async _execute(n,r,s){if(s!=null&&s.syncOnly)return!0;this._configService.getConfig(ms)!==!1&&this._logService.debug("[CommandService]",`${"|-".repeat(Math.max(this._commandExecutingLevel,0))}executing command "${n.id}"`),this._commandExecutingLevel++;let i;try{i=await this._injector.invoke(n.handler,r,s),this._commandExecutingLevel--}catch(o){throw i=!1,this._commandExecutingLevel=0,o}return i}_syncExecute(n,r,s){if(s!=null&&s.syncOnly)return!0;this._configService.getConfig(ms)!==!1&&this._logService.debug("[CommandService]",`${"|-".repeat(Math.max(0,this._commandExecutingLevel))}executing command "${n.id}".`),this._commandExecutingLevel++;let i;try{if(i=this._injector.invoke(n.handler,r,s),i instanceof Promise)throw new TypeError("[CommandService]: Command handler should not return a promise.");this._commandExecutingLevel--}catch(o){throw i=!1,this._commandExecutingLevel=0,o}return i}},f.CommandService=Y_([ki(0,Ce.Inject(Ce.Injector)),ki(1,dt),ki(2,fr)],f.CommandService);class z_{constructor(t){E(this,"name");E(this,"multi",!0);E(this,"type",0);E(this,"priority",0);E(this,"_implementations",[]);E(this,"handler",async(t,n)=>{if(!this._implementations.length)return!1;const r=t.get(dt),s=t.get(Un),i=t.get(Ce.Injector);for(const o of this._implementations){const a=o.command.preconditions;if((!a||a&&a(s))&&(r.debug("[MultiCommand]",`executing implementation "${o.command.name}".`),await i.invoke(o.command.handler,n)))return!0}return!1});this.id=t,this.name=t}registerImplementation(t){const n={command:t};return this._implementations.push(n),this._implementations.sort((r,s)=>s.command.priority-r.command.priority),Ye(()=>{const r=this._implementations.indexOf(n);this._implementations.splice(r,1)})}hasImplementations(){return this._implementations.length>0}}function gs(e,t,n){const r=e.map(s=>()=>t.syncExecuteCommand(s.id,s.params,n));return Cl(r)}function G_(e,t,n){const r=e.map(s=>()=>t.executeCommand(s.id,s.params,n));return El(r)}function Lc(e){return new se.Observable(t=>{const n=e((...r)=>t.next(r));return()=>n==null?void 0:n.dispose()})}function Fi(e){return function(n){return new se.Observable(r=>(n.subscribe({next:s=>{r.next(s),e(s)&&r.complete()},complete:()=>r.complete(),error:s=>r.error(s)}),()=>r.unsubscribe()))}}function K_(e=0){return t=>{let n=[];return t.pipe(se.tap(r=>n.push(r)),se.debounceTime(e),se.map(()=>n),se.tap(()=>n=[]))}}function X_(e){const t=new se.ReplaySubject(1);return setTimeout(()=>t.next(),e),t.pipe(se.take(1))}function q_(e,t){const n=new se.BehaviorSubject(t);return e.subscribe(n),n}const J_=e=>new Promise(t=>{se.merge(Lc(e.onCommandExecuted.bind(e)).pipe(Xr.filter(([n])=>n.type===mr.MUTATION)),se.timer(300)).pipe(Xr.debounceTime(16),Xr.first()).subscribe(()=>{t()})});function Uc(e,t){let n=0,r=e.length-1;if(t<e[0])return 0;if(t>=e[e.length-1])return e.length-1;for(;n<=r;){if(e[n]===t){for(;n<e.length&&e[n]===t;)n++;return n}if(t>e[n]&&t<e[n+1])return n+1;if(e[r]===t){for(;r<e.length&&e[r]===t;)r++;return r}if(t>e[r-1]&&t<e[r])return r;n++,r--}return-1}function Z_(e,t){let n=0,r=e.length-1;for(;n<=r;){const s=Math.floor((r+n)/2);if(t<e[s]&&(s===0||t>=e[s-1]))return s;if(t>=e[s])n=s+1;else if(t<e[s])r=s-1;else return-1}return-1}function Pc(e,t){let n=0,r=e.length;for(;n<r;){const s=Math.floor((n+r)/2);e[s]<=t?n=s+1:r=s}return n<e.length?n:e.length-1}function _r(e,t,n=!1){let r=e.length-1;if(t<0||t<e[0])return 0;if(e.length<40||t<=e[20]||t>=e[r-20]?r=Uc(e,t):r=Pc(e,t),n){const s=e[r];return e.indexOf(s)}return r}function Q_(e){const t=new Blob([e],{type:"text/javascript"});return window.URL.createObjectURL(t)}const pr=2,kc=1;function ep(e,t){if(t==null||e==null)return!0;const{left:n=0,top:r=0,height:s=0,width:i=0,angle:o=0}=t,{left:a=0,top:l=0,height:c=0,width:u=0,angle:h=0}=e,d=u,m=c,_=i,p=s;return Math.abs(a-n)>pr||Math.abs(l-r)>pr||Math.abs(d-_)>pr||Math.abs(m-p)>pr||Math.abs(h-o)>kc}function _s(e,t,n){const{dataStream:r,textRuns:s=[]}=e;let i=t;const o=[];for(const a of s){const{st:l,ed:c}=a;Z.hasIntersectionBetweenTwoRanges(t,n,l,c)&&(l>i?(o.push(r.slice(i,l)),o.push(xi(r,{...a,ed:Math.min(c,n)}))):o.push(xi(r,{...a,st:i,ed:Math.min(c,n)}))),i=Math.max(t,Math.min(c,n))}return i!==n&&o.push(r.slice(i,n)),o.join("")}function tp(e,t=!0){var n;if(t&&((n=e.paragraphs)!=null&&n.length)){const{dataStream:r,paragraphs:s=[]}=e;let i="",o=-1;for(const a of s){const{startIndex:l,paragraphStyle:c={}}=a,{spaceAbove:u,spaceBelow:h,lineSpacing:d}=c,m=[];u!=null&&(typeof u=="number"?m.push(`margin-top: ${u}px`):m.push(`margin-top: ${u.v}px`)),h!=null&&(typeof h=="number"?m.push(`margin-bottom: ${h}px`):m.push(`margin-bottom: ${h.v}px`)),d!=null&&m.push(`line-height: ${d}`),l>o+1?i+=`<p class="UniverNormal" ${m.length?`style="${m.join("; ")};"`:""}>${_s(e,o+1,l)}</p>`:i+=`<p class="UniverNormal" ${m.length?`style="${m.join("; ")};"`:""}></p>`,o=l}return o!==r.length&&(i+=_s(e,o,r.length)),i}else return _s(e,0,e.dataStream.length)}function xi(e,t){const{st:n,ed:r,ts:s={}}=t,{ff:i,fs:o,it:a,bl:l,ul:c,st:u,ol:h,bg:d,cl:m,va:_}=s;let p=e.slice(n,r);const I=[];return a===ae.TRUE&&(p=`<i>${p}</i>`),_===jt.SUPERSCRIPT?p=`<sup>${p}</sup>`:_===jt.SUBSCRIPT&&(p=`<sub>${p}</sub>`),(c==null?void 0:c.s)===ae.TRUE&&(p=`<u>${p}</u>`),(u==null?void 0:u.s)===ae.TRUE&&(p=`<s>${p}</s>`),l===ae.TRUE&&(p=`<strong>${p}</strong>`),i&&I.push(`font-family: ${i}`),m&&I.push(`color: ${m.rgb}`),o&&I.push(`font-size: ${o}pt`),h&&I.push("text-decoration: overline"),d&&I.push(`background: ${d.rgb}`),I.length?`<span style="${I.join("; ")};">${p}</span>`:p}const Fc={[us.OFFICE]:{[at.ACCENT1]:"#4472C4",[at.ACCENT2]:"#ED7D31",[at.ACCENT3]:"#A5A5A5",[at.ACCENT4]:"#70AD47",[at.ACCENT5]:"#5B9BD5",[at.ACCENT6]:"#70AD47",[at.DARK1]:"#000000",[at.DARK2]:"#44546A",[at.LIGHT1]:"#FFFFFF",[at.LIGHT2]:"#E7E6E6",[at.HYPERLINK]:"#0563C1",[at.FOLLOWED_HYPERLINK]:"#954F72"}};class ps{constructor(){E(this,"_themeValue",at.LIGHT1);E(this,"_themeColors");E(this,"_themeTint");E(this,"_rgbValue","");E(this,"_colorType");this._colorType=Rt.UNSUPPORTED,this._themeColors=us.OFFICE,this._themeTint=0}asRgbColor(){return new Es(this._rgbValue,this)}asThemeColor(){return new Cs(this._themeValue,this._themeTint,this._themeColors,this)}build(){switch(this._colorType){case Rt.THEME:return this.asThemeColor();case Rt.RGB:return this.asRgbColor();case Rt.UNSUPPORTED:throw new Error("unsupported color type")}}setRgbColor(t){return this._colorType=Rt.RGB,this._rgbValue=t,this}setThemeColors(t){this._colorType=Rt.THEME,this._themeColors=t}setThemeTint(t){this._colorType=Rt.THEME,this._themeTint=t}setThemeColor(t){return this._colorType=Rt.THEME,this._themeValue=t,this}getColorType(){return this._colorType}}class Cn{constructor(t){E(this,"_builder");this._builder=t}static rgbColorToHexValue(t){return`#${((1<<24)+(t.getRed()<<16)+(t.getGreen()<<8)+t.getBlue()).toString(16).slice(1)}`}static hexValueToRgbColor(t){t?t.indexOf("#")>-1&&(t=t.substring(1)):t="#000000";const n=+`0x${t[0]}${t[1]}`,r=+`0x${t[2]}${t[3]}`,s=+`0x${t[4]}${t[5]}`;return new ps().setRgbColor(`rgb(${n},${r},${s})`).asRgbColor()}static hexToRgbString(t){const n=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;t=t.replace(n,(i,o,a,l)=>o+o+a+a+l+l);const r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);let s=null;if(r){const i=Number.parseInt(r[1],16),o=Number.parseInt(r[2],16),a=Number.parseInt(r[3],16);s=`rgba(${i},${o},${a})`}return s}asRgbColor(){return this._builder.asRgbColor()}asThemeColor(){return this._builder.asThemeColor()}getColorType(){return this._builder.getColorType()}clone(){return new Cn(this._builder)}equals(t){return!1}}class xc{constructor(t){E(this,"_saturation",0);E(this,"_hue",0);E(this,"_lightness",0);E(this,"_alpha",0);const n=t.getRed()/255,r=t.getGreen()/255,s=t.getBlue()/255,i=t.getAlpha()/255,o=Math.min(n,Math.min(r,s)),a=Math.max(n,Math.max(r,s)),l=a-o;if(a===o){this._hue=0,this._saturation=0,this._lightness=a;return}this._lightness=(o+a)/2,this._lightness<.5?this._saturation=l/(a+o):this._saturation=l/(2-a-o),n===a&&(this._hue=(r-s)/l),r===a&&(this._hue=2+(s-n)/l),s===a&&(this._hue=4+(n-r)/l),this._hue*=60,this._hue<0&&(this._hue+=360),this._alpha=i}asRgbColor(){const t=new ps;if(this._saturation===0)return t.setRgbColor(`rgba(${this._lightness*255},${this._lightness*255},${this._lightness*255},${this._alpha*255})`),t.asRgbColor();let n;this._lightness<.5?n=this._lightness*(1+this._saturation):n=this._lightness+this._saturation-this._lightness*this._saturation;const r=2*this._lightness-n,s=this._hue/360,i=s+1/3,o=this.setColor(n,r,i),a=this.setColor(n,r,s),l=s-1/3,c=this.setColor(n,r,l);return t.setRgbColor(`rgba(${Math.round(o*255)},${Math.round(a*255)},${Math.round(c*255)},${this._alpha*255})`),t.asRgbColor()}getLightness(){return this._lightness}getHue(){return this._hue}getSaturation(){return this._saturation}getAlpha(){return this._alpha}setColor(t,n,r){r<0&&(r+=1),r>1&&(r-=1);let s;return 6*r<1?s=n+(t-n)*6*r:2*r<1?s=t:3*r<2?s=n+(t-n)*(2/3-r)*6:s=n,s}setLightness(t){this._lightness=t}}const Ot=class Ot extends Cn{constructor(n,r){super(r);E(this,"_cssString");E(this,"_red");E(this,"_green");E(this,"_blue");E(this,"_alpha");let s=n.match(Ot.RGBA_EXTRACT);if(s){const i=+s[1],o=+s[2],a=+s[3],l=+s[4];this._cssString=n,this._red=i,this._green=o,this._blue=a,this._alpha=l;return}if(s=n.match(Ot.RGB_EXTRACT),s){const i=+s[1],o=+s[2],a=+s[3];this._cssString=n,this._red=i,this._green=o,this._blue=a,this._alpha=1;return}throw new Error("Invalid rgba or rgb color")}asHexString(){return Cn.rgbColorToHexValue(this)}getRed(){let n=this._red+Ot.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getGreen(){let n=this._green+Ot.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getBlue(){let n=this._blue+Ot.RGB_COLOR_AMT;return n>255?n=255:n<0&&(n=0),n}getAlpha(){return this._alpha}getColorType(){return Rt.RGB}clone(){return new Ot(this._cssString,this._builder)}asThemeColor(){throw new Error("rgb color not support to themeColor")}equals(n){return n instanceof Ot?n._red===this._red&&n._blue===this._blue&&n._green===this._green&&n._alpha===this._alpha:!1}getCssString(){return this._cssString}};E(Ot,"RGB_COLOR_AMT",0),E(Ot,"RGBA_EXTRACT",new RegExp("\\s*rgba\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d.\\d|\\d\\s*)\\)\\s*")),E(Ot,"RGB_EXTRACT",new RegExp("\\s*rgb\\s*\\((\\s*\\d+\\s*),(\\s*\\d+\\s*),(\\s*\\d+\\s*)\\)\\s*"));let Es=Ot;const ln=class ln extends Cn{constructor(n,r,s,i){super(i);E(this,"_themeColorType");E(this,"_themeTint");E(this,"_themeColors");this._themeColorType=n,this._themeTint=r,this._themeColors=s}lumValue(n,r){if(n==null)return r;let s;return n<0?s=r*(1+n):s=r*(1-n)+(255-255*(1-n)),s}asRgbColor(){const n=Fc[this._themeColors];if(n==null)throw new Error("not find themeColors type");const r=n[this._themeColorType];if(r==null)throw new Error("not find themeColors value");let s;if(ln._cacheThemeColor.has(this._themeColors)){if(s=ln._cacheThemeColor.get(this._themeColors),s.has(this._themeColorType))return s.get(this._themeColorType)}else s=new Map,ln._cacheThemeColor.set(this._themeColors,s);const i=new xc(Cn.hexValueToRgbColor(r));i.setLightness(this.lumValue(this._themeTint,i.getLightness()*255)/255);const o=i.asRgbColor();return s.set(this._themeColorType,o),o}clone(){return new ln(this._themeColorType,this._themeTint,this._themeColors,this._builder)}equals(n){return n instanceof ln?n._themeColorType===this._themeColorType:!1}getColorType(){return Rt.THEME}getThemeColorType(){return this._themeColorType}};E(ln,"_cacheThemeColor",new Map);let Cs=ln;const np="rgb(",rp="rgba(",Hi={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],darkyellow:[139,128,0],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(t){E(this,"_color");E(this,"_rgbColor");E(this,"_isValid",!1);if(t==null){this._setNullColor();return}if(t instanceof It){this._color={...t._color},this._rgbColor={...t._rgbColor};return}const n=Hc(t);if(n==null){this._setNullColor();return}this._color=n;const r=lp(this._color);if(r==null){this._setNullColor();return}this._rgbColor=r,this._isValid=!0}static mix(t,n,r){var c,u;r=Math.min(1,Math.max(0,r));const s=new It(t).toRgb(),i=new It(n).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(t,n){const r=new It(t).getLuminance(),s=new It(n).getLuminance();return(Math.max(r,s)+.05)/(Math.min(r,s)+.05)}get isValid(){return this._isValid}toRgb(){return this._rgbColor}toRgbString(){const{r:t,g:n,b:r,a:s=1}=this.toRgb(),i=s<1;return`rgb${i?"a":""}(${t},${n},${r}${i?`,${s}`:""})`}toString(){return this.toRgbString()}toHexString(t){const{r:n,g:r,b:s,a:i=1}=this.toRgb(),o=i<1,a=[Rs(Math.round(n).toString(16)),Rs(Math.round(r).toString(16)),Rs(Math.round(s).toString(16)),Rs(Math.round(i*255).toString(16))];return t&&a[0][0]===a[0][1]&&a[1][0]===a[1][1]&&a[2][0]===a[2][1]&&a[3][0]===a[3][1]?o?`#${a[0][0]}${a[1][0]}${a[2][0]}${a[3][0]}`:`#${a[0][0]}${a[1][0]}${a[2][0]}`:o?`#${a[0]}${a[1]}${a[2]}${a[3]}`:`#${a[0]}${a[1]}${a[2]}`}toHsv(){return dp(this.toRgb())}toHsl(){return hp(this.toRgb())}lighten(t=10){const n=this.toHsl();return n.l+=t,n.l=Math.min(Math.max(n.l,0),100),new It(n)}darken(t=10){const n=this.toHsl();return n.l-=t,n.l=Math.min(Math.max(n.l,0),100),new It(n)}setAlpha(t){return new It({...this._rgbColor,a:t})}getLuminance(){let{r:t,g:n,b:r}=this.toRgb();return t=Bi(t),n=Bi(n),r=Bi(r),Number((.2126*t+.7152*n+.0722*r).toFixed(3))}getBrightness(){const{r:t,g:n,b:r}=this.toRgb();return(t*299+n*587+r*114)/1e3}getAlpha(){var t;return(t=this._color.a)!=null?t:1}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}_setNullColor(){this._isValid=!1,this._color={r:0,g:0,b:0,a:0},this._rgbColor={r:0,g:0,b:0,a:0}}}const Rs=e=>e.length===1?`0${e}`:e,Bi=e=>(e/=255,e<=.03928?e/12.92:((e+.055)/1.055)**2.4),Hc=e=>{if(mp(e)){if("r"in e){const r={r:Math.round(e.r),g:Math.round(e.g),b:Math.round(e.b)};return e.a!==void 0&&(r.a=e.a),r}if("l"in e){const r={h:Math.round(e.h),s:e.s,l:e.l};return e.a!==void 0&&(r.a=e.a),r}const n={h:Math.round(e.h),s:e.s,v:e.v};return e.a!==void 0&&(n.a=e.a),n}const t=e.trim().toLowerCase();if(Hi[t]){const n=Hi[t],r={r:Math.round(n[0]),g:Math.round(n[1]),b:Math.round(n[2])};return r.a=n[3]||1,r}if(t.startsWith("#"))return sp(t);if(t.startsWith("rgb"))return ip(t);if(t.startsWith("hsl"))return op(t);if(t.startsWith("hsv"))return ap(t)},sp=e=>{const t=e.substring(1),n=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let r=t.match(n);if(!r||r.length<3)throw new Error(`The color '${e}' is illegal hex color`);r[0].length===1&&(r=r.map(i=>i+i));const s={r:Number.parseInt(r[0],16),g:Number.parseInt(r[1],16),b:Number.parseInt(r[2],16)};return r.length>3&&(s.a=Number.parseInt(r[3],16)/255),s},ip=e=>{const t=e.indexOf("(");if(t===-1)throw new Error(`The color '${e}' is illegal rgb color`);const n=e.substring(t+1,e.length-1).split(",");if(n.length<3)throw new Error(`The color '${e}' is illegal rgb color`);const r={r:Number.parseInt(n[0],10),g:Number.parseInt(n[1],10),b:Number.parseInt(n[2],10)};return n.length>3&&(r.a=Number.parseFloat(n[3])),r},op=e=>{const t=e.indexOf("(");if(t===-1)throw new Error(`The color '${e}' is illegal hsl color`);const n=e.substring(t+1,e.length-1).split(",");if(n.length<3)throw new Error(`The color '${e}' is illegal hsl color`);const r={h:Number.parseInt(n[0],10),s:Number.parseFloat(n[1]),l:Number.parseFloat(n[2])};return n.length>3&&(r.a=Number.parseFloat(n[3])),r},ap=e=>{const t=e.indexOf("(");if(t===-1)throw new Error(`The color '${e}' is illegal hsv color`);const n=e.substring(t+1,e.length-1).split(",");if(n.length<3)throw new Error(`The color '${e}' is illegal hsv color`);const r={h:Number.parseInt(n[0],10),s:Number.parseFloat(n[1]),v:Number.parseFloat(n[2])};return n.length>3&&(r.a=Number.parseFloat(n[3])),r},lp=e=>{const t=Hc(e);if(t!=null)return"r"in t?t:"l"in t?cp(t):up(t)},$i=(e,t,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),cp=e=>{let{h:t,s:n,l:r}=e;t/=360,n/=100,r/=100;let s=0,i=0,o=0;if(n===0)s=i=o=r;else{const l=r<.5?r*(1+n):r+n-r*n,c=2*r-l;s=$i(c,l,t+1/3),i=$i(c,l,t),o=$i(c,l,t-1/3)}const a={r:Math.round(s*255),g:Math.round(i*255),b:Math.round(o*255)};return e.a!==void 0&&(a.a=e.a),a},up=e=>{let{h:t,s:n,v:r}=e;t=t/360*6,n/=100,r/=100;const s=Math.floor(t),i=t-s,o=r*(1-n),a=r*(1-i*n),l=r*(1-(1-i)*n),c=s%6,u=[r,a,o,o,l,r][c],h=[l,r,r,a,o,o][c],d=[o,o,l,r,r,a][c],m={r:u*255,g:h*255,b:d*255};return e.a!==void 0&&(m.a=e.a),m},hp=e=>{let{r:t,g:n,b:r}=e;t/=255,n/=255,r/=255;const s=Math.max(t,n,r),i=Math.min(t,n,r),o=(s+i)/2;let a,l;if(s===i)a=l=0;else{const u=s-i;switch(l=o>.5?u/(2-s-i):u/(s+i),s){case t:a=(n-r)/u+(n<r?6:0);break;case n:a=(r-t)/u+2;break;default:a=(t-n)/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},dp=e=>{let{r:t,g:n,b:r}=e;t/=255,n/=255,r/=255;const s=Math.max(t,n,r),i=Math.min(t,n,r);let o;const a=s,l=s-i,c=s===0?0:l/s;if(s===i)o=0;else{switch(s){case t:o=(n-r)/l+(n<r?6:0);break;case n:o=(r-t)/l+2;break;default:o=(t-n)/l+4;break}o/=6}const 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},fp=e=>e==null,mp=e=>!fp(e)&&typeof e=="object";function gp(e){const t=/^#(?:[0]{3}|[0]{6})\b/,n=/^rgb\s*\(\s*0+\s*,\s*0+\s*,\s*0+\s*\)$/,r=/^rgba\s*\(\s*0+\s*,\s*0+\s*,\s*0+\s*,\s*(1|1\.0*|0?\.\d+)\)$/,s=/^hsl\s*\(\s*0*\s*,\s*0%*\s*,\s*0%*\s*\)$/,i=/^hsla\s*\(\s*0*\s*,\s*0%*\s*,\s*0%*\s*,\s*(1|1\.0*|0?\.\d+)\)$/;return!!(t.test(e)||n.test(e)||r.test(e)||s.test(e)||i.test(e))}function _p(e){const t=/^#(?:[Ff]{3}|[Ff]{6})\b/,n=/^rgb\s*\(\s*255\s*,\s*255\s*,\s*255\s*\)$/,r=/^rgba\s*\(\s*255\s*,\s*255\s*,\s*255\s*,\s*(1|1\.0*|0?\.\d+)\)$/,s=/^hsl\s*\(\s*0*\s*,\s*0%*\s*,\s*100%*\s*\)$/,i=/^hsla\s*\(\s*0*\s*,\s*0%*\s*,\s*100%*\s*,\s*(1|1\.0*|0?\.\d+)\)$/;return!!(t.test(e)||n.test(e)||r.test(e)||s.test(e)||i.test(e))}function Bc(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 pp(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 Ep(e){if(e==null)return!0;const{v:t,f:n,si:r,p:s,custom:i}=e;return!(!(t==null||typeof t=="string"&&t.length===0)||n!=null&&n.length>0||r!=null&&r.length>0||s!=null||i!=null)}function $c(e){return e!=null&&(typeof e=="string"||typeof e=="number"||typeof e=="boolean")}var pe=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ROW=1]="ROW",e[e.COLUMN=2]="COLUMN",e[e.ALL=3]="ALL",e))(pe||{}),Me=(e=>(e[e.NONE=0]="NONE",e[e.ROW=1]="ROW",e[e.COLUMN=2]="COLUMN",e[e.ALL=3]="ALL",e))(Me||{});function Cp(e){return[e.startRow,e.startColumn,e.endRow,e.endColumn]}var jc=(e=>(e.NONE="none",e.BACKWARD="backward",e.FORWARD="forward",e))(jc||{}),Wc=(e=>(e.RECT="RECT",e.TEXT="TEXT",e))(Wc||{});function Rp(e,t,n){let r=!1,s=!1,i=e,o=t,a=e,l=t;if(n==null)return{actualRow:e,actualColumn:t,isMergedMainCell:s,isMerged:r,endRow:i,endColumn:o,startRow:a,startColumn:l};for(let c=0;c<n.length;c++){const{startRow:u,endRow:h,startColumn:d,endColumn:m}=n[c];if(e===u&&t===d){i=h,o=m,a=u,l=d,s=!0;break}if(e>=u&&e<=h&&t>=d&&t<=m){i=h,o=m,a=u,l=d,r=!0;break}}return{actualRow:e,actualColumn:t,isMergedMainCell:s,isMerged:r,endRow:i,endColumn:o,startRow:a,startColumn:l}}var Pn=(e=>(e.Raw="raw",e.Intercepted="intercepted",e.Both="both",e))(Pn||{});const Er=2,Cr=2**2,Is=2**3,Rr=2**4,Ir=2**5,Sr=2**6,ji=2**7,Wi=2**8,Yi=2**9,Ip=0,Sp=2958466,Op=-694324,vp=35830291,wp=-1,Yc=1,kn=6,Vi="general",zi="hash",Fn="zero",Gi="qmark",Ki="slash",Or="group",Ss="scale",Xi="comma",qi="break",Os="text",Ji="plus",Zi="minus",vs="point",Qi="space",eo="percent",ws="digit",to="calendar",vr="error",no="datetime",ro="duration",so="condition",io="dbnum",oo="natnum",ao="locale",lo="color",Vc="modifier",co="ampm",uo="escaped",ho="string",fo="skip",mo="exp",go="fill",_o="paren",bs="char",bp=["#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"],po=["¤","$","£","¥","֏","؋","৳","฿","៛","₡","₦","₩","₪","₫","€","₭","₮","₱","₲","₴","₸","₹","₺","₼","₽","₾","₿"],Eo=new RegExp("["+po.join("")+"]"),Co=Object.freeze({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"}),zc=/^([a-z\d]+)(?:[_-]([a-z\d]+))?(?:\.([a-z\d]+))?(?:@([a-z\d]+))?$/i,xn={},C=(e,t="")=>e.replace(/~/g,t).split(";"),ke=(e,t=0,n=0)=>(e.mmm||(e.mmm=t<1?e.mmmm.concat():e.mmmm.map(r=>{const s=r.slice(0,t%10);return s+(t<10||r===s?"":".")})),e.ddd||(e.ddd=n<1?e.dddd.concat():e.dddd.map(r=>{const s=r.slice(0,n%10);return s+(n<10||r===s?"":".")})),!e.mmm6&&e.mmmm6&&(e.mmm6=e.mmmm6),e),yp={group:" ",decimal:".",positive:"+",negative:"-",percent:"%",exponent:"E",nan:"NaN",infinity:"∞",ampm:C("AM;PM"),mmmm6:C("Muharram;Safar;Rabiʻ I;Rabiʻ II;Jumada I;Jumada II;Rajab;Shaʻban;Ramadan;Shawwal;Dhuʻl-Qiʻdah;Dhuʻl-Hijjah"),mmm6:C("Muh.;Saf.;Rab. I;Rab. II;Jum. I;Jum. II;Raj.;Sha.;Ram.;Shaw.;Dhuʻl-Q.;Dhuʻl-H."),mmmm:C("January;February;March;April;May;June;July;August;September;October;November;December"),mmm:C("Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec"),dddd:C("Sunday;Monday;Tuesday;Wednesday;Thursday;Friday;Saturday"),ddd:C("Sun;Mon;Tue;Wed;Thu;Fri;Sat"),bool:C("TRUE;FALSE"),preferMDY:!1};function Ro(e){const t=zc.exec(e);if(!t)throw new SyntaxError(`Malformed locale: ${e}`);return{lang:t[1]+(t[2]?"_"+t[2]:""),language:t[1],territory:t[2]||""}}function Io(e){if(typeof e=="number")return Co[e&65535]||null;const t=parseInt(e,16);return isFinite(t)&&Co[t&65535]?Co[t&65535]||null:zc.test(e)?e:null}function Hn(e){const t=Io(e);let n=null;if(t){const r=Ro(t);n=xn[r.lang]||xn[r.language]||null}return n}function So(e){return Object.assign({},yp,e)}function ne(e,t){const n=typeof t=="object"?t:Ro(t);return xn[n.lang]=So(e),n.language!==n.lang&&!xn[n.language]&&(xn[n.language]=So(e)),xn[n.lang]}const tn=So({group:",",preferMDY:!0});tn.isDefault=!0,ne({group:",",ampm:C("上午;下午"),mmmm:C("一月;二月;三月;四月;五月;六月;七月;八月;九月;十月;十一月;十二月"),mmm:C("1月;2月;3月;4月;5月;6月;7月;8月;9月;10月;11月;12月"),dddd:C("~日;~一;~二;~三;~四;~五;~六","星期"),ddd:C("周日;周一;周二;周三;周四;周五;周六")},"zh_CN");const Oo={group:",",ampm:C("上午;下午"),mmmm:C("1月;2月;3月;4月;5月;6月;7月;8月;9月;10月;11月;12月"),mmm:C("1月;2月;3月;4月;5月;6月;7月;8月;9月;10月;11月;12月"),dddd:C("~日;~一;~二;~三;~四;~五;~六","星期"),ddd:C("周日;周一;周二;周三;周四;周五;周六")};ne({...Oo,nan:"非數值",dddd:C("~日;~一;~二;~三;~四;~五;~六","星期")},"zh_TW"),ne({...Oo,dddd:C("~日;~一;~二;~三;~四;~五;~六","星期")},"zh_HK"),ne({...Oo,ampm:C("午前;午後"),dddd:C("日~;月~;火~;水~;木~;金~;土~","曜日"),ddd:C("日;月;火;水;木;金;土")},"ja"),ne({group:",",ampm:C("오전;오후"),mmmm:C("1월;2월;3월;4월;5월;6월;7월;8월;9월;10월;11월;12월"),mmm:C("1월;2월;3월;4월;5월;6월;7월;8월;9월;10월;11월;12월"),dddd:C("일요일;월요일;화요일;수요일;목요일;금요일;토요일"),ddd:C("일;월;화;수;목;금;토")},"ko"),ne({group:",",ampm:C("ก่อนเที่ยง;หลังเที่ยง"),mmmm:C("มกร~;กุมภาพันธ์;มีน~;เมษายน;พฤษภ~;มิถุนายน;กรกฎ~;สิงห~;กันยายน;ตุล~;พฤศจิกายน;ธันว~","าคม"),mmm:C("ม.ค.;ก.พ.;มี.ค.;เม.ย.;พ.ค.;มิ.ย.;ก.ค.;ส.ค.;ก.ย.;ต.ค.;พ.ย.;ธ.ค."),dddd:C("วันอาทิตย์;วันจันทร์;วันอังคาร;วันพุธ;วันพฤหัสบดี;วันศุกร์;วันเสาร์"),ddd:C("อา.;จ.;อ.;พ.;พฤ.;ศ.;ส.")},"th"),ne(ke({decimal:",",ampm:C("dop.;odp."),mmmm:C("ledna;února;března;dubna;května;června;července;srpna;září;října;listopadu;prosince"),mmm:C("I;II;III;IV;V;VI;VII;VIII;IX;X;XI;XII"),dddd:C("neděle;pondělí;úterý;středa;čtvrtek;pátek;sobota"),bool:C("PRAVDA;NEPRAVDA")},-1,2),"cs"),ne(ke({group:".",decimal:",",mmmm:C("januar;februar;marts;april;maj;juni;juli;august;september;oktober;november;december"),dddd:C("søn~;man~;tirs~;ons~;tors~;fre~;lør~","dag"),bool:C("SAND;FALSK")},13,13),"da"),ne(ke({group:".",decimal:",",ampm:C("a.m.;p.m."),mmmm:C("januari;februari;maart;april;mei;juni;juli;augustus;september;oktober;november;december"),mmm:C("jan.;feb.;mrt.;apr.;mei;jun.;jul.;aug.;sep.;okt.;nov.;dec."),dddd:C("zondag;maandag;dinsdag;woensdag;donderdag;vrijdag;zaterdag"),bool:C("WAAR;ONWAAR")},-1,2),"nl"),ne({group:",",preferMDY:!0},"en"),ne({group:",",preferMDY:!0},"en_US"),ne({group:","},"en_AU"),ne({group:","},"en_CA"),ne({group:","},"en_GB"),ne({group:",",mmm:C("Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sept;Oct;Nov;Dec")},"en_IE"),ne(ke({decimal:",",nan:"epäluku",ampm:C("ap.;ip."),mmmm:C("tammi~;helmi~;maalis~;huhti~;touko~;kesä~;heinä~;elo~;syys~;loka~;marras~;joulu~","kuuta"),mmm:C("tammik.;helmik.;maalisk.;huhtik.;toukok.;kesäk.;heinäk.;elok.;syysk.;lokak.;marrask.;jouluk."),dddd:C("sunnun~;maanan~;tiis~;keskiviikkona;tors~;perjan~;lauan~","taina"),bool:C("TOSI;EPÄTOSI")},-1,2),"fi");const vo=ke({group:" ",decimal:",",mmmm:C("janvier;février;mars;avril;mai;juin;juillet;août;septembre;octobre;novembre;décembre"),mmm:C("janv.;févr.;mars;avr.;mai;juin;juil.;août;sept.;oct.;nov.;déc."),dddd:C("~manche;lun~;mar~;mercre~;jeu~;vendre~;same~","di"),bool:C("VRAI;FAUX")},-1,13);ne({...vo},"fr"),ne({...vo,mmm:C("janv.;févr.;mars;avr.;mai;juin;juill.;août;sept.;oct.;nov.;déc.")},"fr_CA"),ne({group:"'",decimal:".",...vo},"fr_CH");const Gc=ke({mmmm:C("Januar;Februar;März;April;Mai;Juni;Juli;August;September;Oktober;November;Dezember"),mmm:C("Jan.;Feb.;März;Apr.;Mai;Juni;Juli;Aug.;Sept.;Okt.;Nov.;Dez."),dddd:C("Sonn~;Mon~;Diens~;Mittwoch;Donners~;Frei~;Sams~","tag"),bool:C("WAHR;FALSCH")},-1,12);ne({group:".",decimal:",",...Gc},"de"),ne({group:"'",decimal:".",...Gc},"de_CH"),ne(ke({group:".",decimal:",",ampm:C("π.μ.;μ.μ."),mmmm:C("Ιανουαρ~;Φεβρουαρ~;Μαρτ~;Απριλ~;Μαΐου;Ιουν~;Ιουλ~;Αυγούστου;Σεπτεμβρ~;Οκτωβρ~;Νοεμβρ~;Δεκεμβρ~","ίου"),mmm:C("Ιαν;Φεβ;Μαρ;Απρ;Μαΐ;Ιουν;Ιουλ;Αυγ;Σεπ;Οκτ;Νοε;Δεκ"),dddd:C("Κυριακή;Δευτέρα;Τρίτη;Τετάρτη;Πέμπτη;Παρασκευή;Σάββατο")},-1,3),"el"),ne({decimal:",",ampm:C("de.;du."),mmmm:C("január;február;március;április;május;június;július;augusztus;szeptember;október;november;december"),mmm:C("jan.;febr.;márc.;ápr.;máj.;jún.;júl.;aug.;szept.;okt.;nov.;dec."),dddd:C("vasárnap;hétfő;kedd;szerda;csütörtök;péntek;szombat"),ddd:C("V;H;K;Sze;Cs;P;Szo"),bool:C("IGAZ;HAMIS")},"hu"),ne(ke({group:".",decimal:",",ampm:C("f.h.;e.h."),mmmm:C("janúar;febrúar;mars;apríl;maí;júní;júlí;ágúst;september;október;nóvember;desember"),dddd:C("sunnu~;mánu~;þriðju~;miðviku~;fimmtu~;föstu~;laugar~","dagur")},13,13),"is"),ne(ke({group:".",decimal:",",mmmm:C("Januari;Februari;Maret;April;Mei;Juni;Juli;Agustus;September;Oktober;November;Desember"),dddd:C("Minggu;Senin;Selasa;Rabu;Kamis;Jumat;Sabtu")},3,3),"id");const Kc=ke({mmmm:C("gennaio;febbraio;marzo;aprile;maggio;giugno;luglio;agosto;settembre;ottobre;novembre;dicembre"),dddd:C("domenica;lunedì;martedì;mercoledì;giovedì;venerdì;sabato"),bool:C("VERO;FALSO")},3,3);ne({group:".",decimal:",",...Kc},"it"),ne({group:"'",decimal:".",...Kc},"it_CH");const Xc={decimal:",",ampm:C("a.m.;p.m."),mmmm:C("januar;februar;mars;april;mai;juni;juli;august;september;oktober;november;desember"),mmm:C("jan.;feb.;mar.;apr.;mai;jun.;jul.;aug.;sep.;okt.;nov.;des."),dddd:C("søn~;man~;tirs~;ons~;tors~;fre~;lør~","dag"),bool:C("SANN;USANN")};ne(ke({...Xc},-1,13),"nb"),ne(ke({...Xc},-1,13),"no"),ne(ke({decimal:",",mmmm:C("stycznia;lutego;marca;kwietnia;maja;czerwca;lipca;sierpnia;września;października;listopada;grudnia"),dddd:C("niedziela;poniedziałek;wtorek;środa;czwartek;piątek;sobota"),ddd:C("niedz.;pon.;wt.;śr.;czw.;pt.;sob."),bool:C("PRAWDA;FAŁSZ")},3,-1),"pl");const qc={group:".",decimal:",",mmmm:C("janeiro;fevereiro;março;abril;maio;junho;julho;agosto;setembro;outubro;novembro;dezembro"),dddd:C("domingo;segunda-feira;terça-feira;quarta-feira;quinta-feira;sexta-feira;sábado"),bool:C("VERDADEIRO;FALSO")};ne(ke(qc,13,13),"pt"),ne(ke(qc,13,13),"pt_BR"),ne({decimal:",",nan:"не число",mmmm:C("января;февраля;марта;апреля;мая;июня;июля;августа;сентября;октября;ноября;декабря"),mmm:C("янв.;февр.;мар.;апр.;мая;июн.;июл.;авг.;сент.;окт.;нояб.;дек."),dddd:C("воскресенье;понедельник;вторник;среда;четверг;пятница;суббота"),ddd:C("вс;пн;вт;ср;чт;пт;сб"),mmmm6:C("рамадан;шавваль;зуль-каада;зуль-хиджжа;мухаррам;раби-уль-авваль;раби-уль-ахир;джумад-уль-авваль;джумад-уль-ахир;раджаб;шаабан;рамадан"),mmm6:C("рам.;шав.;зуль-к.;зуль-х.;мух.;раб. I;раб. II;джум. I;джум. II;радж.;шааб.;рам."),bool:C("ИСТИНА;ЛОЖЬ")},"ru"),ne(ke({decimal:",",mmmm:C("januára;februára;marca;apríla;mája;júna;júla;augusta;septembra;októbra;novembra;decembra"),dddd:C("nedeľa;pondelok;utorok;streda;štvrtok;piatok;sobota")},3,2),"sk");const Pt={group:".",decimal:",",ampm:C("a. m.;p. m."),mmmm:C("enero;febrero;marzo;abril;mayo;junio;julio;agosto;septiem~;octu~;noviem~;diciem~","bre"),mmm:C("ene;feb;mar;abr;may;jun;jul;ago;sept;oct;nov;dic"),dddd:C("domingo;lunes;martes;miércoles;jueves;viernes;sábado"),ddd:C("dom;lun;mar;mié;jue;vie;sáb"),bool:C("VERDADERO;FALSO")},Ap=C("ene;feb;mar;abr;may;jun;jul;ago;sep;oct;nov;dic"),wo=C("ene.;feb.;mar.;abr.;may.;jun.;jul.;ago.;sept.;oct.;nov.;dic.");ne({...Pt},"es"),ne({...Pt},"es_AR"),ne({...Pt},"es_BO"),ne({...Pt},"es_CL"),ne({...Pt},"es_CO"),ne({...Pt},"es_EC"),ne({...Pt,mmm:Ap,ampm:C("a.m.;p.m.")},"es_MX"),ne({...Pt,mmm:wo},"es_PY"),ne({...Pt,mmm:wo},"es_UY"),ne({...Pt,mmm:wo,mmmm:C("enero;febrero;marzo;abril;mayo;junio;julio;agosto;setiembre;octubre;noviembre;diciembre")},"es_VE"),ne({decimal:",",ampm:C("fm;em"),mmmm:C("januari;februari;mars;april;maj;juni;juli;augusti;september;oktober;november;december"),mmm:C("jan.;feb.;mars;apr.;maj;juni;juli;aug.;sep.;okt.;nov.;dec."),dddd:C("sön~;mån~;tis~;ons~;tors~;fre~;lör~","dag"),ddd:C("sön;mån;tis;ons;tors;fre;lör")},"sv"),ne(ke({group:".",decimal:",",ampm:C("ÖÖ;ÖS"),mmmm:C("Ocak;Şubat;Mart;Nisan;Mayıs;Haziran;Temmuz;Ağustos;Eylül;Ekim;Kasım;Aralık"),mmm:C("Oca;Şub;Mar;Nis;May;Haz;Tem;Ağu;Eyl;Eki;Kas;Ara"),dddd:C("Pazar;Pazartesi;Salı;Çarşamba;Perşembe;Cuma;Cumartesi"),ddd:C("Paz;Pzt;Sal;Çar;Per;Cum;Cmt"),bool:C("DOĞRU;YANLIŞ")},3,-1),"tr"),ne({group:",",ampm:C("yb;yh"),mmmm:C("Ionawr;Chwefror;Mawrth;Ebrill;Mai;Mehefin;Gorffennaf;Awst;Medi;Hydref;Tachwedd;Rhagfyr"),mmm:C("Ion;Chwef;Maw;Ebr;Mai;Meh;Gorff;Awst;Medi;Hyd;Tach;Rhag"),dddd:C("Dydd Sul;Dydd Llun;Dydd Mawrth;Dydd Mercher;Dydd Iau;Dydd Gwener;Dydd Sadwrn"),ddd:C("Sul;Llun;Maw;Mer;Iau;Gwen;Sad")},"cy"),ne({group:".",decimal:",",mmmm:C("yanvar;fevral;mart;aprel;may;iyun;iyul;avqust;sentyabr;oktyabr;noyabr;dekabr"),mmm:C("yan;fev;mar;apr;may;iyn;iyl;avq;sen;okt;noy;dek"),dddd:C("bazar;bazar ertəsi;çərşənbə axşamı;çərşənbə;cümə axşamı;cümə;şənbə"),ddd:C("B.;B.e.;Ç.a.;Ç.;C.a.;C.;Ş.")},"az"),ne(ke({decimal:",",mmmm:C("студзеня;лютага;сакавіка;красавіка;мая;чэрвеня;ліпеня;жніўня;верасня;кастрычніка;лістапада;снежня"),dddd:C("нядзеля;панядзелак;аўторак;серада;чацвер;пятніца;субота"),ddd:C("нд;пн;аў;ср;чц;пт;сб")},3,-1),"be"),ne({decimal:",",ampm:C("пр.об.;сл.об."),mmmm:C("януари;февруари;март;април;май;юни;юли;август;септември;октомври;ноември;декември"),mmm:C("яну;фев;март;апр;май;юни;юли;авг;сеп;окт;ное;дек"),dddd:C("неделя;понеделник;вторник;сряда;четвъртък;петък;събота"),ddd:C("нд;пн;вт;ср;чт;пт;сб"),bool:C("ИСТИНА;ЛОЖЬ")},"bg"),ne({group:".",decimal:",",mmmm:C("de gener;de febrer;de març;d’abril;de maig;de juny;de juliol;d’agost;de setembre;d’octubre;de novembre;de desembre"),mmm:C("de gen.;de febr.;de març;d’abr.;de maig;de juny;de jul.;d’ag.;de set.;d’oct.;de nov.;de des."),dddd:C("diumenge;dilluns;dimarts;dimecres;dijous;divendres;dissabte"),ddd:C("dg.;dl.;dt.;dc.;dj.;dv.;ds."),ampm:C("a. m.;p. m.")},"ca"),ne(ke({group:",",decimal:".",mmmm:C("Enero;Pebrero;Marso;Abril;Mayo;Hunyo;Hulyo;Agosto;Setyembre;Oktubre;Nobyembre;Disyembre"),dddd:C("Linggo;Lunes;Martes;Miyerkules;Huwebes;Biyernes;Sabado")},3,3),"fil"),ne({group:",",decimal:".",mmmm:C("જાન્યુઆરી;ફેબ્રુઆરી;માર્ચ;એપ્રિલ;મે;જૂન;જુલાઈ;ઑગસ્ટ;સપ્ટેમ્બર;ઑક્ટોબર;નવેમ્બર;ડિસેમ્બર"),mmm:C("જાન્યુ;ફેબ્રુ;માર્ચ;એપ્રિલ;મે;જૂન;જુલાઈ;ઑગસ્ટ;સપ્ટે;ઑક્ટો;નવે;ડિસે"),dddd:C("રવિ~;સોમ~;મંગળ~;બુધ~;ગુરુ~;શુક્ર~;શનિ~","વાર"),ddd:C("રવિ;સોમ;મંગળ;બુધ;ગુરુ;શુક્ર;શનિ")},"gu"),ne({group:",",decimal:".",ampm:C("לפנה״צ;אחה״צ"),dddd:C("~ראשון;~שני;~שלישי;~רביעי;~חמישי;~שישי;~שבת","יום "),ddd:C("~א׳;~ב׳;~ג׳;~ד׳;~ה׳;~ו׳;שבת","יום "),mmmm:C("ינואר;פברואר;מרץ;אפריל;מאי;יוני;יולי;אוגוסט;ספטמבר;אוקטובר;נובמבר;דצמבר"),mmm:C("ינו׳;פבר׳;מרץ;אפר׳;מאי;יוני;יולי;אוג׳;ספט׳;אוק׳;נוב׳;דצמ׳"),mmmm6:C("רמדאן;שוואל;ד׳ו אל־קעדה;ד׳ו אל־חיג׳ה;מוחרם;רביע אל־אוול;רביע א־ת׳אני;ג׳ומאדא אל־אולא;ג׳ומאדא א־ת׳אניה;רג׳ב;שעבאן;רמדאן"),mmm6:C("רמדאן;שוואל;ד׳ו אל־קעדה;ד׳ו אל־חיג׳ה;מוחרם;רביע א׳;רביע ב׳;ג׳ומאדא א׳;ג׳ומאדא ב׳;רג׳ב;שעבאן;רמדאן")},"he"),ne(ke({group:".",decimal:",",mmmm:C("siječnja;veljače;ožujka;travnja;svibnja;lipnja;srpnja;kolovoza;rujna;listopada;studenoga;prosinca"),mmm:C("sij;velj;ožu;tra;svi;lip;srp;kol;ruj;lis;stu;pro"),dddd:C("nedjelja;ponedjeljak;utorak;srijeda;četvrtak;petak;subota")},-1,3),"hr"),ne({decimal:",",mmmm:C("հունվարի;փետրվարի;մարտի;ապրիլի;մայիսի;հունիսի;հուլիսի;օգոստոսի;սեպտեմբերի;հոկտեմբերի;նոյեմբերի;դեկտեմբերի"),mmm:C("հնվ;փտվ;մրտ;ապր;մյս;հնս;հլս;օգս;սեպ;հոկ;նոյ;դեկ"),dddd:C("կիրակի;երկուշաբթի;երեքշաբթի;չորեքշաբթի;հինգշաբթի;ուրբաթ;շաբաթ"),ddd:C("կիր;երկ;երք;չրք;հնգ;ուր;շբթ")},"hy"),ne(ke({decimal:",",mmmm:C("იანვარი;თებერვალი;მარტი;აპრილი;მაისი;ივნისი;ივლისი;აგვისტო;სექტემბერი;ოქტომბერი;ნოემბერი;დეკემბერი"),dddd:C("კვირა;ორშაბათი;სამშაბათი;ოთხშაბათი;ხუთშაბათი;პარასკევი;შაბათი")},3,3),"ka"),ne(ke({decimal:",",mmmm:C("қаңтар;ақпан;наурыз;сәуір;мамыр;маусым;шілде;тамыз;қыркүйек;қазан;қараша;желтоқсан"),dddd:C("жексенбі;дүйсенбі;сейсенбі;сәрсенбі;бейсенбі;жұма;сенбі"),ddd:C("жс;дс;сс;ср;бс;жм;сб")},13,-1),"kk"),ne({group:",",mmmm:C("ಜನವರಿ;ಫೆಬ್ರವರಿ;ಮಾರ್ಚ್;ಏಪ್ರಿಲ್;ಮೇ;ಜೂನ್;ಜುಲೈ;ಆಗಸ್ಟ್;ಸೆಪ್ಟೆಂಬರ್;ಅಕ್ಟೋಬರ್;ನವೆಂಬರ್;ಡಿಸೆಂಬರ್"),mmm:C("ಜನವರಿ;ಫೆಬ್ರವರಿ;ಮಾರ್ಚ್;ಏಪ್ರಿ;ಮೇ;ಜೂನ್;ಜುಲೈ;ಆಗಸ್ಟ್;ಸೆಪ್ಟೆಂ;ಅಕ್ಟೋ;ನವೆಂ;ಡಿಸೆಂ"),dddd:C("ಭಾನು~;ಸೋಮ~;ಮಂಗಳ~;ಬುಧ~;ಗುರು~;ಶುಕ್ರ~;ಶನಿ~","ವಾರ"),ddd:C("ಭಾನು;ಸೋಮ;ಮಂಗಳ;ಬುಧ;ಗುರು;ಶುಕ್ರ;ಶನಿ"),ampm:C("ಪೂರ್ವಾಹ್ನ;ಅಪರಾಹ್ನ")},"kn"),ne({decimal:",",mmmm:C("sausio;vasario;kovo;balandžio;gegužės;birželio;liepos;rugpjūčio;rugsėjo;spalio;lapkričio;gruodžio"),mmm:C("saus.;vas.;kov.;bal.;geg.;birž.;liep.;rugp.;rugs.;spal.;lapkr.;gruod."),dddd:C("sekmadienis;pirmadienis;antradienis;trečiadienis;ketvirtadienis;penktadienis;šeštadienis"),ddd:C("sk;pr;an;tr;kt;pn;št"),ampm:C("priešpiet;popiet")},"lt"),ne({decimal:",",mmmm:C("janvāris;februāris;marts;aprīlis;maijs;jūnijs;jūlijs;augusts;septembris;oktobris;novembris;decembris"),mmm:C("janv.;febr.;marts;apr.;maijs;jūn.;jūl.;aug.;sept.;okt.;nov.;dec."),dddd:C("svētdiena;pirmdiena;otrdiena;trešdiena;ceturtdiena;piektdiena;sestdiena"),ddd:C("svētd.;pirmd.;otrd.;trešd.;ceturtd.;piektd.;sestd."),ampm:C("priekšpusdienā;pēcpusdienā")},"lv"),ne({group:",",decimal:".",mmmm:C("ജനുവരി;ഫെബ്രുവരി;മാർച്ച്;ഏപ്രിൽ;മേയ്;ജൂൺ;ജൂലൈ;ഓഗസ്റ്റ്;സെപ്റ്റംബർ;ഒക്‌ടോബർ;നവംബർ;ഡിസംബർ"),mmm:C("ജനു;ഫെബ്രു;മാർ;ഏപ്രി;മേയ്;ജൂൺ;ജൂലൈ;ഓഗ;സെപ്റ്റം;ഒക്ടോ;നവം;ഡിസം"),dddd:C("ഞായറാഴ്‌ച;തിങ്കളാഴ്‌ച;ചൊവ്വാഴ്ച;ബുധനാഴ്‌ച;വ്യാഴാഴ്‌ച;വെള്ളിയാഴ്‌ച;ശനിയാഴ്‌ച"),ddd:C("ഞായർ;തിങ്കൾ;ചൊവ്വ;ബുധൻ;വ്യാഴം;വെള്ളി;ശനി")},"ml"),ne({group:",",decimal:".",mmmm:C("нэгдүгээ~;хоёрдугаа~;гуравдугаа~;дөрөвдүгээ~;тавдугаа~;зургаадугаа~;долоодугаа~;наймдугаа~;есдүгээ~;аравдугаа~;арван нэгдүгээ~;арван хоёрдугаа~","р сар"),mmm:C("1~;2~;3~;4~;5~;6~;7~;8~;9~;10~;11~;12~","-р сар"),dddd:C("ням;даваа;мягмар;лхагва;пүрэв;баасан;бямба"),ddd:C("Ня;Да;Мя;Лх;Пү;Ба;Бя"),ampm:C("ү.ө.;ү.х.")},"mn"),ne({group:",",decimal:".",mmmm:C("जानेवारी;फेब्रुवारी;मार्च;एप्रिल;मे;जून;जुलै;ऑगस्ट;सप्टेंबर;ऑक्टोबर;नोव्हेंबर;डिसेंबर"),mmm:C("जाने;फेब्रु;मार्च;एप्रि;मे;जून;जुलै;ऑग;सप्टें;ऑक्टो;नोव्हें;डिसें"),dddd:C("रविवार;सोमवार;मंगळवार;बुधवार;गुरुवार;शुक्रवार;शनिवार"),ddd:C("रवि;सोम;मंगळ;बुध;गुरु;शुक्र;शनि")},"mr"),ne(ke({group:",",decimal:".",mmmm:C("ဇန်နဝါရီ;ဖေဖော်ဝါရီ;မတ်;ဧပြီ;မေ;ဇွန်;ဇူလိုင်;ဩဂုတ်;စက်တင်ဘာ;အောက်တိုဘာ;နိုဝင်ဘာ;ဒီဇင်ဘာ"),mmm:C("ဇန်;ဖေ;မတ်;ဧ;မေ;ဇွန်;ဇူ;ဩ;စက်;အောက်;နို;ဒီ"),dddd:C("တနင်္ဂနွေ;တနင်္လာ;အင်္ဂါ;ဗုဒ္ဓဟူး;ကြာသပတေး;သောကြာ;စနေ"),ampm:C("နံနက်;ညနေ")},-1,0),"my"),ne({group:",",decimal:".",mmmm:C("ਜਨਵਰੀ;ਫ਼ਰਵਰੀ;ਮਾਰਚ;ਅਪ੍ਰੈਲ;ਮਈ;ਜੂਨ;ਜੁਲਾਈ;ਅਗਸਤ;ਸਤੰਬਰ;ਅਕਤੂਬਰ;ਨਵੰਬਰ;ਦਸੰਬਰ"),mmm:C("ਜਨ;ਫ਼ਰ;ਮਾਰਚ;ਅਪ੍ਰੈ;ਮਈ;ਜੂਨ;ਜੁਲਾ;ਅਗ;ਸਤੰ;ਅਕਤੂ;ਨਵੰ;ਦਸੰ"),dddd:C("ਐਤਵਾਰ;ਸੋਮਵਾਰ;ਮੰਗਲਵਾਰ;ਬੁੱਧਵਾਰ;ਵੀਰਵਾਰ;ਸ਼ੁੱਕਰਵਾਰ;ਸ਼ਨਿੱਚਰਵਾਰ"),ddd:C("ਐਤ;ਸੋਮ;ਮੰਗਲ;ਬੁੱਧ;ਵੀਰ;ਸ਼ੁੱਕਰ;ਸ਼ਨਿੱਚਰ"),ampm:C("ਪੂ.ਦੁ.;ਬਾ.ਦੁ.")},"pa"),ne({group:".",decimal:",",mmmm:C("ianuarie;februarie;martie;aprilie;mai;iunie;iulie;august;septem~;octom~;noiem~;decem~","brie"),mmm:C("ian.;feb.;mar.;apr.;mai;iun.;iul.;aug.;sept.;oct.;nov.;dec."),dddd:C("duminică;luni;marți;miercuri;joi;vineri;sâmbătă"),ddd:C("dum.;lun.;mar.;mie.;joi;vin.;sâm."),ampm:C("a.m.;p.m.")},"ro"),ne(ke({group:".",decimal:",",mmmm:C("januar;februar;marec;april;maj;junij;julij;avgust;september;oktober;november;december"),mmm:C("jan.;feb.;mar.;apr.;maj;jun.;jul.;avg.;sep.;okt.;nov.;dec."),dddd:C("nedelja;ponedeljek;torek;sreda;četrtek;petek;sobota"),ampm:C("dop.;pop.")},-1,13),"sl"),ne(ke({group:".",decimal:",",mmmm:C("јануар;фебруар;март;април;мај;јун;јул;август;септембар;октобар;новембар;децембар"),dddd:C("недеља;понедељак;уторак;среда;четвртак;петак;субота")},3,3),"sr"),ne({group:",",decimal:".",mmmm:C("ஜனவரி;பிப்ரவரி;மார்ச்;ஏப்ரல்;மே;ஜூன்;ஜூலை;ஆகஸ்ட்;செப்டம்பர்;அக்டோபர்;நவம்பர்;டிசம்பர்"),mmm:C("ஜன.;பிப்.;மார்.;ஏப்.;மே;ஜூன்;ஜூலை;ஆக.;செப்.;அக்.;நவ.;டிச."),dddd:C("ஞாயிறு;திங்கள்;செவ்வாய்;புதன்;வியாழன்;வெள்ளி;சனி"),ddd:C("ஞாயி.;திங்.;செவ்.;புத.;வியா.;வெள்.;சனி")},"ta"),ne({group:",",decimal:".",mmmm:C("జనవరి;ఫిబ్రవరి;మార్చి;ఏప్రిల్;మే;జూన్;జులై;ఆగస్టు;సెప్టెంబర్;అక్టోబర్;నవంబర్;డిసెంబర్"),mmm:C("జన;ఫిబ్ర;మార్చి;ఏప్రి;మే;జూన్;జులై;ఆగ;సెప్టెం;అక్టో;నవం;డిసెం"),dddd:C("ఆదివారం;సోమవారం;మంగళవారం;బుధవారం;గురువారం;శుక్రవారం;శనివారం"),ddd:C("ఆది;సోమ;మంగళ;బుధ;గురు;శుక్ర;శని")},"te"),ne({decimal:",",mmmm:C("січня;лютого;березня;квітня;травня;червня;липня;серпня;вересня;жовтня;листопада;грудня"),mmm:C("січ.;лют.;бер.;квіт.;трав.;черв.;лип.;серп.;вер.;жовт.;лист.;груд."),dddd:C("неділю;понеділок;вівторок;середу;четвер;пʼятницю;суботу"),ddd:C("нд;пн;вт;ср;чт;пт;сб"),ampm:C("дп;пп")},"uk"),ne({group:".",decimal:",",mmmm:C("~1;~2;~3;~4;~5;~6;~7;~8;~9;~10;~11;~12","tháng "),mmm:C("~1;~2;~3;~4;~5;~6;~7;~8;~9;~10;~11;~12","thg "),dddd:C("Chủ Nhật;Thứ Hai;Thứ Ba;Thứ Tư;Thứ Năm;Thứ Sáu;Thứ Bảy"),ddd:C("CN;Th 2;Th 3;Th 4;Th 5;Th 6;Th 7"),ampm:C("SA;CH")},"vi"),ne(ke({group:"٬",decimal:"٫",ampm:C("ص;م"),mmmm:C("يناير;فبراير;مارس;أبريل;مايو;يونيو;يوليو;أغسطس;سبتمبر;أكتوبر;نوفمبر;ديسمبر"),dddd:C("الأحد;الاثنين;الثلاثاء;الأربعاء;الخميس;الجمعة;السبت"),mmmm6:C("رمضان;شوال;ذو القعدة;ذو الحجة;محرم;ربيع الأول;ربيع الآخرة;جمادى الأولى;جمادى الآخرة;رجب;شعبان;رمضان")},0,0),"ar"),ne({group:",",decimal:".",mmmm:C("জানুয়ারী;ফেব্রুয়ারী;মার্চ;এপ্রিল;মে;জুন;জুলাই;আগস্ট;সেপ্টেম্বর;অক্টোবর;নভেম্বর;ডিসেম্বর"),mmm:C("জানু;ফেব;মার্চ;এপ্রি;মে;জুন;জুল;আগ;সেপ্টেঃ;অক্টোঃ;নভেঃ;ডিসেঃ"),dddd:C("রবিবার;সোমবার;মঙ্গলবার;বুধবার;বৃহস্পতিবার;শুক্রবার;শনিবার"),ddd:C("রবি;সোম;মঙ্গল;বুধ;বৃহস্পতি;শুক্র;শনি")},"bn"),ne({group:",",decimal:".",mmmm:C("जनवरी;फ़रवरी;मार्च;अप्रैल;मई;जून;जुलाई;अगस्त;सितंबर;अक्तूबर;नवंबर;दिसंबर"),mmm:C("जन॰;फ़र॰;मार्च;अप्रैल;मई;जून;जुल॰;अग॰;सित॰;अक्तू॰;नव॰;दिस॰"),dddd:C("रविवार;सोमवार;मंगलवार;बुधवार;गुरुवार;शुक्रवार;शनिवार"),ddd:C("रवि;सोम;मंगल;बुध;गुरु;शुक्र;शनि"),ampm:C("am;pm")},"hi");const Jc={overflow:"######",dateErrorThrows:!1,dateErrorNumber:!0,bigintErrorNumber:!1,dateSpanLarge:!0,leap1900:!0,nbsp:!1,throws:!0,invalid:"######",locale:"",ignoreTimezone:!1,grouping:[3,3],indexColors:!0,skipChar:"",repeatChar:""};function St(e,t=0){if(typeof e!="number")return e;if(e<0)return-St(-e,t);if(t){const n=10**t||1;return St(e*n,0)/n}return Math.round(e)}const Tp=1e-13;function Zc(e,t=2,n=2){const r=e<0?-1:1,s=10**(t||2),i=10**(n||2);let o=Math.abs(e),a=0,l=0,c=0,u=1,h,d;if(e=o,e%1===0)d=[e*r,1];else if(e<1e-19)d=[r,1e19];else if(e>1e19)d=[1e19*r,1];else{do if(o=1/(o-Math.floor(o)),h=u,u=u*Math.floor(o)+a,a=h,l=c,c=Math.floor(e*u+.5),c>=s||u>=i)return[r*l,a];while(Math.abs(e-c/u)>=Tp&&o!==Math.floor(o));d=[r*c,u]}return d}const ft=Math.floor;function Qc(e,t=!0){if(t&&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 n=e+68569+2415019;const r=ft(4*n/146097);n=n-ft((146097*r+3)/4);const s=ft(4e3*(n+1)/1461001);n=n-ft(1461*s/4)+31;const i=ft(80*n/2447),o=n-ft(2447*i/80);n=ft(i/11);const a=i+2-12*n;return[100*(r-49)+s+n|0,a|0,o|0]}function Np(e){return Qc(e+1462)}function Mp(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 t=10631/30,n=8.01/60;let r=e+466935;const s=ft(r/10631);r=r-10631*s;const i=ft((r-n)/t);r=r-ft(i*t+n);const o=ft((r+28.5001)/29.5);return o===13?[30*s+i,12,30]:[30*s+i,o,r-ft(29.5001*o-29)]}function eu(e,t=0,n=!0){const r=ft(e);return t===kn?Mp(r):t===wp?Np(r):Qc(r,n)}const ys=Math.floor,bo=86400;function yo(e,t){let n=null;if(Array.isArray(e)){const[r,s,i,o,a,l]=e;n=Date.UTC(r,s==null?0:s-1,i!=null?i:1,o||0,a||0,l||0)}else if(e instanceof Date&&(n=e*1,!t||!t.ignoreTimezone)){const r=new Date;r.setUTCFullYear(e.getFullYear(),e.getMonth(),e.getDate()),r.setUTCHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n=r*1}if(n!=null&&isFinite(n)){const r=n/864e5;return r-(r<=-25509?-25568:-25569)}return null}function Dp(e,t){let n=e|0;const r=bo*(e-n);let s=ys(r);r-s>.9999&&(s+=1,s===bo&&(s=0,n+=1));const i=s<0?bo+s:s,[o,a,l]=eu(e,0,t&&t.leap1900),c=ys(i/60/60)%60,u=ys(i/60)%60,h=ys(i)%60;return[o,a,l,c,u,h]}const Lp=["!d-m-y","!d-m-Y","!j-m-y","!j-m-Y","!d-n-y","!d-n-Y","!j-n-y","!j-n-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","d-M-y","d-M-Y","j-M-y","j-M-Y","M-d-y","M-d-Y","M-j-y","M-j-Y","d-F-y","d-F-Y","F-d-y","F-d-Y","F-j-y","F-j-Y","j-F-y","j-F-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"],Up={j:"d",d:"d",D:"ddd",l:"dddd",n:"m",m:"m",M:"mmm",F:"mmmm",y:"yy",Y:"yyyy"},Pp={j:"dd",d:"dd",D:"ddd",l:"dddd",n:"mm",m:"mm",M:"mmm",F:"mmmm",y:"yy",Y:"yyyy"},tu={},nu={};function mt(e,t,n=1){if(e){const r=e[0],s=e.slice(1);r==="!"?mt(s,t,4):r==="?"?mt(s,t,2):(t[r]=t[r]||{},mt(s,t[r],n))}else t.$=n}function ru(e,t){mt(e,t),mt(e+" x",t),mt(e+" l",t),mt(e+" l x",t),mt("l "+e,t),mt("l "+e+" x",t),mt(e+" D",t),mt(e+" D x",t),mt("D "+e,t),mt("D "+e+" x",t)}Lp.forEach(e=>{e[0]!=="?"&&ru(e,tu),e[0]!=="!"&&ru(e,nu)});const kp=new Date().getUTCFullYear(),su=".",Fp=",",Ao=" ",wr=" ",br=" ",As="'",Ts="٬",xp={".":[Fp,wr,br,As,Ts],",":[su,wr,br,As,Ts],"٫":[su,wr,br,As,Ts]},To=e=>e&&e.length===1&&e>="0"&&e<="9";function No(e,t={}){const n=Hn(t.locale||"")||tn,r=n.decimal,s=[...xp[r]||[As,Ts]];!s.includes(n.group)&&n.group!==Ao&&n.group!==r&&s.push(n.group);let i="",o="",a=1,l="",c=!1,u=!1,h=!1,d=!1,m=!1,_=null,p=!1,I=0;const y=[Ao,wr,br,"+","%","(","-"].concat(po);for(;y.includes(e[I]);){const b=e[I];if(b==="-"){if(c||u)return null;c=!0,a=-1}else if(Eo.test(b)){if(m)return null;m=!0,_=b}else if(b==="("){if(u||c)return null;u=!0,a=-1}else if(b==="%"){if(d)return null;d=!0}I++}let H=!1,x;if(e[I]===r||To(e[I]))for(;I<e.length;){const b=e[I];if(!x&&s.includes(b))x=b;else if(!(x&&x===b))if(b===r){if(H)break;i+=".",H=!0}else if(To(b))i+=b;else break;I++}if(e[I]==="e"||e[I]==="E"){o+=e[I],I++,(e[I]==="+"||e[I]==="-")&&(o+=e[I],I++);const b=I;for(;To(e[I]);)o+=e[I],I++;if(b===I)return null}const Y=[Ao,wr,br,"%","$",")"].concat(po);for(;Y.includes(e[I]);){const b=e[I];if(Eo.test(b)){if(m)return null;m=!0,_=b,p=!0}else if(b===")"){if(h||!u)return null;h=!0}else if(b==="%"){if(d)return null;d=!0}I++}if(I!==e.length)return null;let O=parseFloat(i+o);if(!isFinite(O))return null;if(o){if(d||m)return null;l="0.00E+00"}else if(d){if(m)return null;l=i.includes(".")?"0.00%":"0%",O*=.01}else if(m){const b=i.includes(".")?"#,##0.00":"#,##0";p?l=b+_:l=_+b}else x&&(l=i.includes(".")?"#,##0.00":"#,##0");const R={v:O*a};return l&&(R.z=l),R}function Hp(e,t,n){if(n<1||t<1||t>12)return!1;if(t===2){const s=e%4===0&&e%100!==0||e%400===0||e===1900?29:28;if(n>s)return!1}else if((t===4||t===6||t===9||t===11)&&n>30||(t===1||t===3||t===5||t===7||t===8||t===10||t===12)&&n>31)return!1;return!0}const iu=(e,t,n=!1)=>{for(const r of t)if(e.startsWith(r[0])){let s=r[0].length;return n&&(r[2]==="D"||r[2]==="M")&&e[s]==="."&&s++,[e.slice(0,s),r]}return["",null]},kt=(e,t,n,r)=>{const s=n.path||"",i=Object.keys(t);for(let o=0;o<i.length;o++){let a;const l=i[o];if(t[l]){if(l==="$"||l==="€")e||(a=n);else if(l==="-"){const c=/^(\s*([./-]|,\s)\s*|\s+)/.exec(e);if(c){const u=c[1]==="-"||c[1]==="/"||c[1]==="."?c[1]:" ";if(!n.sep||n.sep===u){const h=c[0].replace(/\s+/g," ");a=kt(e.slice(c[0].length),t[l],{...n,sep:u,path:s+h},r)}}}else if(l===" "){const c=/^[,.]?\s+/.exec(e);if(c){const u=c[0].replace(/\s+/g," ");a=kt(e.slice(c[0].length),t[l],{...n,path:s+u},r)}}else if(l==="j"||l==="d"){const c=/^(0?[1-9]|1\d|2\d|3[01])\b/.exec(e);c&&(a=kt(e.slice(c[0].length),t[l],{...n,day:c[0],path:s+l},r))}else if(l==="n"||l==="m"){const c=/^(0?[1-9]|1[012])\b/.exec(e);c&&(a=kt(e.slice(c[0].length),t[l],{...n,month:+c[0],_mon:c[0],path:s+l},r))}else if(l==="F"||l==="M"){const[c,u]=iu(e,r.mon,r.mp);u&&u[2]===l&&(a=kt(e.slice(c.length),t[l],{...n,month:u[1],_mon:c,path:s+l},r))}else if(l==="l"||l==="D"){const[c,u]=iu(e,r.day,r.dp);u&&u[2]===l&&(a=kt(e.slice(c.length),t[l],{...n,path:s+l},r))}else if(l==="y"){const c=/^\d\d\b/.exec(e);if(c){const u=+c[0]>=30?+c[0]+1900:+c[0]+2e3;a=kt(e.slice(c[0].length),t[l],{...n,year:u,path:s+l},r)}}else if(l==="Y"){const c=/^\d\d\d\d\b/.exec(e);c&&(a=kt(e.slice(c[0].length),t[l],{...n,year:+c[0],path:s+l},r))}else if(l==="x"){const c=Ms(e,{locale:r.locale});c&&(a=kt("",t[l],{...n,time:c.v,tf:c.z,path:s+l},r))}else throw new Error(`Unknown date token "${l}"`);if(a&&Hp(n.year||1916,n.month||1,n.day?+n.day:1))return a}}},ou=e=>e.replace(/\s+/g," ").trim().replace(/’/,"'").replace(/\.$/,"").toLowerCase(),Ns=(e,t)=>{const n=e.map((r,s)=>[ou(r),s+1,t]);return n.sort((r,s)=>s[0].length-r[0].length),n};function Mo(e,t={}){var i;const n=Hn(t.locale||"")||tn,r={mon:Ns(n.mmmm,"F").concat(Ns(n.mmm,"M")),mp:n.mmm[0].at(-1)===".",day:Ns(n.dddd,"l").concat(Ns(n.ddd,"D")),dp:n.ddd[0].at(-1)===".",locale:t.locale},s=kt(ou(e),n.preferMDY?nu:tu,{path:""},r);if(s){if(s.sep==="."&&s.path.length===3)return null;const o=+((i=s.year)!=null?i:kp);s.day||(s.day=1);let a=-1/0;if(o<1900)return null;o<=1900&&s.month<=2?a=25568:o<1e4&&(a=25569);const l=Date.UTC(o,s.month-1,s.day)/864e5+a+(s.time||0);if(l>=0&&l<=2958465){const c=s._mon[0]==="0"||s.day[0]==="0"||s._mon.length===2&&s.day.length===2,u=s.path.replace(/[jdlDnmMFyYx]/g,h=>h==="x"?s.tf||"":(c?Pp[h]:Up[h])||h);return{v:l,z:u}}}return null}const Do=e=>e.replace(/\s+/g,"").trim().replace(/\./g,"").toLowerCase();function Ms(e,t={}){const n=Hn(t.locale||"")||tn,r=/^\s*([10]?\d|2[0-4])(?::([0-5]\d|\d))?(?::([0-5]\d|\d))?(\.\d{1,10})?(?=\s*[^\s\d]|$)/.exec(e);let s="";if(r){const i=Do(e.slice(r[0].length));if(i===Do(n.ampm[0])||i==="a"||i==="am")s="a";else if(i===Do(n.ampm[1])||i==="p"||i==="pm")s="p";else if(i)return null}if(r){const[,i,o,a,l]=r;if(l&&!a||!s&&!o&&!a)return null;let c=+(i||0)*1;if(s){if(c>=13)return null;s==="p"&&(c+=12)}const u=+(o||0)*1,h=+(a||0)*1,d=+(l||0)*1;return{v:(c*60*60+u*60+h+d)/(3600*24),z:(i.length===2?"hh":"h")+":mm"+(a?":ss":"")+(s?" AM/PM":"")}}return null}function au(e,t={}){const n=Hn(t.locale||"")||tn,r=e.trim().toLowerCase(),s=n.bool[0].toLowerCase();if(r==="true"||r===s)return{v:!0};const i=n.bool[1].toLowerCase();return r==="false"||r===i?{v:!1}:null}function Bp(e,t){var n,r,s;return(s=(r=(n=No(e,t))!=null?n:Mo(e,t))!=null?r:Ms(e,t))!=null?s:au(e,t)}function Rn(e,t,n){return t[n+"_max"]=e.length,t[n+"_min"]=e.replace(/#/g,"").length,t}function ze(e,t){typeof e=="string"?t.push({type:"string",value:e}):t.push(e)}function lu(e,t){const n=e&&e.type;return n===zi||n===Fn||n===Gi||n===ws&&t==="den"}function yr(e){var x,Y,O;const t=[],n={scale:1,percent:!1,text:!1,date:0,date_eval:!1,date_system:Yc,sec_decimals:0,general:!1,clock:24,int_pattern:[],frac_pattern:[],man_pattern:[],den_pattern:[],num_pattern:[],tokens:t};let r="int",s=null;const i=[];let o,a=!1,l=-1,c=!1,u="",h=!1;for(;++l<e.length&&!c;){const R=e[l],b=R.type||vr;if(u+=R.raw,b===Vi)n.general=!0,ze(R,t);else if(lu(R,r)){const T=n[r+"_pattern"];lu(o,r)||(o==null?void 0:o.type)===Or?(T.push((T.pop()||"")+R.value),s.num+=R.value):(T.push(R.value),s={type:r,num:R.value},ze(s,t))}else if(b===_o)R.value==="("&&(n.parens=!0),ze(R.value,t);else if(b===ws)ze(R.value,t);else if(b===Ki)if(h=!0,n[r+"_pattern"].length){if(!s)throw new SyntaxError("Format pattern is missing a numerator");n.fractions=!0,n.num_pattern.push(n[r+"_pattern"].pop()),s.type="num",r="den",ze({type:"div"},t)}else ze(R.value,t);else if(b===Xi)ze(",",t);else if(b===Ss)n.scale=.001**R.raw.length;else if(b===Or){if(r==="int"&&(n.grouping=!0),r==="den")throw new SyntaxError("Cannot group denominator digits")}else if(b===Qi)ze(R,t);else if(b===qi){c=!0;break}else if(b===Os)n.text=!0,ze(R,t);else if(b===Ji||b===Zi)ze(R,t);else if(b===ro){const T=R.value.toLowerCase(),B=T[0],$={type:"",size:0,date:1,pad:T.length};B==="h"?($.size=Rr,$.type="hour-elap"):B==="m"?($.size=Ir,$.type="min-elap"):($.size=Sr,$.type="sec-elap"),n.date=n.date|$.size,i.push($),ze($,t)}else if(n.date&&b===vs&&((x=e[l+1])==null?void 0:x.type)===Fn){let T=1;l++;let B="0";((Y=e[l+1])==null?void 0:Y.type)===Fn&&(B+="0",T=2,l++),((O=e[l+1])==null?void 0:O.type)===Fn&&(B+="0",T=3,l++),u+=B;const $=[Sr,ji,Wi,Yi][T];n.date=n.date|$,n.date_eval=!0,n.sec_decimals=Math.max(n.sec_decimals,T),ze({type:"subsec",size:$,decimals:T,date:1},t)}else if(b===to)a||(R.value==="B2"||R.value==="b2"?n.date_system=kn:n.date_system=Yc);else if(b===no){const T={type:"",size:0,date:1},B=R.value.toLowerCase(),$=B[0];if(B==="y"||B==="yy")T.size=Er,T.type="year-short";else if($==="y"||$==="e")T.size=Er,T.type="year";else if(B==="b"||B==="bb")T.size=Er,T.type="b-year-short";else if($==="b")T.size=Er,T.type="b-year";else if(B==="d"||B==="dd")T.size=Is,T.type="day",T.pad=/dd/.test(B);else if(B==="ddd"||B==="aaa")T.size=Is,T.type="weekday-short";else if($==="d"||$==="a")T.size=Is,T.type="weekday";else if($==="h")T.size=Rr,T.type="hour",T.pad=/hh/i.test(B);else if($==="m"){B.length===3?(T.size=Cr,T.type="monthname-short"):B.length===5?(T.size=Cr,T.type="monthname-single"):B.length>=4&&(T.size=Cr,T.type="monthname");const g=i[i.length-1];!T.type&&g&&!g.used&&g.size&(Rr|Sr)&&(g.used=!0,T.size=Ir,T.type="min",T.pad=/mm/.test(B)),T.type||(T.size=Cr,T.type="month",T.pad=/mm/.test(B),T.indeterminate=!0)}else if($==="s"){T.size=Sr,T.type="sec",T.pad=/ss/.test(B);const g=i[i.length-1];g&&g.size&Ir?T.used=!0:g&&g.indeterminate&&(delete g.indeterminate,g.size=Ir,g.type="min",T.used=!0)}n.date=n.date|T.size,n.date_eval=!0,i.push(T),ze(T,t)}else if(b===co)n.clock=12,n.date=n.date|Rr,n.date_eval=!0,R.short=R.value==="A/P",ze(R,t);else if(b===ho||b===uo||b===bs)ze(R.value,t);else if(b===so)n.condition=[R.value[0],parseFloat(R.value[1])];else if(b===ao){const T=R.value.split("-"),B=T.length<2?"":T.slice(1).join("-"),$=T[0];$&&ze($,t);const g=Io(B);g&&(n.locale=g);const P=parseInt(B,16);isFinite(P)&&P&16711680&&(P>>16&255)===6&&(n.date_system=kn),a=!0}else if(b===lo){let T,B=R.value.toLowerCase();(T=/^color\s*(\d+)$/i.exec(B))&&(B=parseInt(T[1],10)),n.color=B}else if(b===eo)n.scale=100,n.percent=!0,ze("%",t);else if(b===vs)ze(R,t),n.date||(n.dec_fractions=!0,r="frac");else if(b===mo)n.exponential=!0,n.exp_plus=R.value.includes("+"),r="man",ze({type:"exp",plus:n.exp_plus},t);else if(b===fo)ze(R,t);else if(b===go)ze(R,t);else if(!(b===io||b===oo))throw b===vr?new SyntaxError(`Illegal character: ${u}`):new SyntaxError(`Unknown token ${b} in ${u}`);o=R}if(n.tokensUsed=l,n.pattern=u,/^((?:\[[^\]]+\])+)(;|$)/.test(n.pattern)&&!/^\[(?:h+|m+|s+)\]/.test(n.pattern)&&ze({type:"text"},t),n.fractions&&n.dec_fractions||n.grouping&&!n.int_pattern.length||n.fractions&&n.exponential||n.fractions&&n.den_pattern.length*n.num_pattern.length===0||h&&!n.fractions&&!n.date||n.exponential&&(n.int_pattern.length||n.frac_pattern.length)*n.man_pattern.length===0)throw new SyntaxError(`Invalid pattern: ${u}`);const d=n.int_pattern.join(""),m=n.man_pattern.join(""),_=n.frac_pattern.join("");Rn(d,n,"int");let p=0;for(let R=0;R<d.length;R++){const b=d[d.length-1-R];/^[0-9?]/.test(b)&&(p=R+1)}n.int_min=p,Rn(_,n,"frac"),Rn(m,n,"man");let I=n.num_pattern.join(""),y=n.den_pattern[0]||"";if(y.includes("?")||I.includes("?")?(y=y.replace(/\d/g,"?"),y=y.replace(/#$/g,"?"),Rn(I,n,"num"),Rn(y,n,"den"),I=I.replace(/#$/g,"?")):(Rn(I,n,"num"),Rn(y,n,"den")),n.int_p=d,n.man_p=m,n.num_p=I,n.den_p=y,n.den_pattern.length&&(n.denominator=parseInt(n.den_pattern.join("").replace(/\D/g,""),10)),n.integer=!!d.length,!n.integer&&!n.exponential&&_.length){const R=n.tokens.findIndex(b=>b.type==="point");n.tokens.splice(R,0,{type:"int",value:"#"}),n.integer=!0,n.int_pattern=["#"],n.int_p="#"}if(n.fractions)for(let R=0;R<t.length-1;R++){const b=t[R];if(b.type!=="string"&&b.type!=="space")continue;const T=t[R+1].type;T==="num"?b.rule="num+int":T==="div"?b.rule="num":T==="den"&&(b.rule="den")}return n.grouping&&n.int_pattern.length>1&&(n.grouping=!1),n}function $p(e){if(e===0)return e;const t=Math.ceil(Math.log10(e<0?-e:e)),n=10**(16-Math.floor(t));return isFinite(n)?Math.round(e*n)/n:0}function cu(e,t=0){const n=Math.floor(Math.log10(e));return t>1?Math.floor(n/t)*t:n}function uu(e,t=1){return t<-300?parseFloat(e.toExponential().split("e")[0]):e*10**-t}const jp={total:1,sign:0,period:0,int:1,frac:0};function Wp(e,t=!0){const n=Math.abs(e);if(!n)return jp;const r=t&&e<0?1:0,s=Math.floor(n),i=Math.floor(Math.log10(n)+1);let o=0,a=0;if(s!==n){o=1;const l=String(St(n*10**-i,15));let c=l.length,u=!0,h=0;for(;h<=l.length;){if(l[h]==="."){c--;break}else l[h]==="0"&&u?c--:u=!1;h++}a=c-i,a<0&&(a=0,o=0)}return{total:r+Math.max(i,1)+o+a,digits:Math.max(i,0)+a,sign:r,period:o,int:Math.max(i,1),frac:a}}const Bn=(e,t)=>e.replace(/\./,t.decimal),hu=(e,t,n)=>{const r=Math.abs(t);let s;return e===1?s=e:s=St(e,5),[Bn(s+"",n),n.exponent,t<0?n.negative:n.positive,r<10?"0":"",r]};function du(e,t,n,r){const s=n|0;if(typeof n=="string")e.push(n);else if(n===s)e.push(Math.abs(s));else{const i=Math.abs(n);let o=cu(i),a=uu(i,o);a===10&&(a=1,o++);const l=Wp(i);if(o>=-4&&o<=-1){const c=i.toPrecision(10+o).replace(/\.?0+$/,"");e.push(Bn(c,r))}else if(o===10){const c=i.toFixed(10).slice(0,12).replace(/\.$/,"");e.push(Bn(c,r))}else if(Math.abs(o)<=9)if(l.total<=11){const c=St(i,9).toFixed(l.frac);e.push(Bn(c,r))}else o===9?e.push(Math.floor(i)):o>=0&&o<9?e.push(Bn(String(St(i,9-o)),r)):e.push(...hu(a,o,r));else l.total>=12?e.push(...hu(a,o,r)):e.push(Bn(St(i,9).toFixed(l.frac),r))}return e}function In(e,t=!1){return e==="0"?"0":e==="?"?t?" ":" ":""}const Ar=86400,Yp=(e,t,n)=>n?e<Op||t>=vp:e<Ip||t>=Sp;function fu(e,t,n,r){var A,w;let s="",i="",o="",a="",l="",c="",u=0,h=0;if(typeof e=="bigint"){if(e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER)e=Number(e);else return n.bigintErrorNumber?String(e):n.overflow;h=e}else h=Math.trunc(e);let d=0,m=0,_=1,p=0,I=0,y=0,H=0,x=0,Y=0;const O=r||tn;if(!t.text&&isFinite(t.scale)&&t.scale!==1&&(e=$p(e*t.scale)),t.exponential){let N=Math.abs(e);N&&(u=cu(N,t.int_max)),e&&!t.integer&&u++,N=uu(N,u),t.int_max===1&&St(N,t.frac_max)===10&&(N=1,u++),e=e<0?-N:N,s+=Math.abs(u)}if(t.integer){const N=Math.abs(St(e,t.fractions?1:t.frac_max));c+=N<1?"":Math.floor(N)}const R=(A=n.grouping[0])!=null?A:3,b=(w=n.grouping[1])!=null?w:R;t.dec_fractions&&(l=String(St(e,t.frac_max)).split(".")[1]||"");const T=!t.error&&(t.num_p.includes("0")||t.den_p.includes("0"));let B=T;if(t.fractions){B=T||!!(e%1);const N=Math.abs(t.integer?e%1:e);if(N)if(B=!0,t.denominator&&isFinite(t.denominator))a+=t.denominator,o+=St(N*t.denominator),o==="0"&&(o="",a="",B=T);else{const D=Zc(N,1/0,t.den_max);o+=D[0],a+=D[1],t.integer&&o==="0"&&(o="",a="",B=T)}else!e&&!t.integer&&(B=!0,o="0",a="1");t.integer&&!B&&!Math.trunc(e)&&(c="0")}if(t.date){h=Math.trunc(e);const N=Ar*(e-h);if(d=Math.floor(N),Y=N-d,Math.abs(Y)<1e-6?Y=0:Y>.9999&&(Y=0,d+=1,d===Ar&&(d=0,h+=1)),Y){const D=t.date&Yi||t.date&Wi||t.date&ji;(D===Yi&&Y>.9995||D===Wi&&Y>.995||D===ji&&Y>.95||!D&&Y>=.5)&&(d++,Y=0)}if(h||t.date_system){const D=eu(e,t.date_system,n.leap1900);m=D[0],_=D[1],p=D[2]}if(d){const D=d<0?Ar+d:d;x=Math.floor(D)%60,H=Math.floor(D/60)%60,y=Math.floor(D/60/60)%60}if(I=(6+h)%7,t.date_eval&&Yp(e,h+d/Ar,n.dateSpanLarge)){if(n.dateErrorThrows)throw new Error("Date out of bounds");if(n.dateErrorNumber){const D=e<0?[O.negative]:[];return du(D,{},e,O).join("")}return n.overflow}}const $=In("?",n.nbsp);u<0?i="-":t.exp_plus&&(i="+");const g=[],P=(N,D,L,F)=>{const Q=!F&&N.length>D.length?L.length+N.length-D.length:L.length;N.length<D.length&&(F+=N.length-D.length);for(let G=0;G<Q;G++)g.push(N[G+F]||In(L[G],n.nbsp));return Q};let v=!1;const M={int:0,frac:0,man:0,num:0,den:0};for(let N=0,D=t.tokens.length;N<D;N++){const L=t.tokens[N],F=L.type,Q=L.num?L.num.length:0;if(F==="string")L.rule?L.rule==="num"?B?g.push(L.value.replace(/ /g,$)):(t.num_min>0||t.den_min>0)&&g.push(L.value.replace(/./g,$)):L.rule==="num+int"?B&&c?g.push(L.value.replace(/ /g,$)):t.den_min>0&&(c||t.num_min)&&g.push(L.value.replace(/./g,$)):L.rule==="den"&&(B?g.push(L.value.replace(/ /g,$)):(t.den_min>0||t.den_min>0)&&g.push(L.value.replace(/./g,$))):g.push(L.value.replace(/ /g,$));else if(F==="space")L.rule==="num+int"?(B||t.num_min||t.den_min)&&(c||t.num_min)&&g.push($):g.push($);else if(F==="error")g.push(n.invalid);else if(F==="point")g.push(t.date?L.value:O.decimal);else if(F==="general")du(g,t,e,O);else if(F==="exp")g.push(O.exponent);else if(F==="minus")L.volatile&&t.date||L.volatile&&(e>=0||typeof e!="number")||(L.volatile&&!t.fractions&&(t.integer||t.dec_fractions)?(e<0&&c&&c!=="0"||l)&&g.push(O.negative):g.push(O.negative));else if(F==="plus")g.push(O.positive);else if(F==="text")g.push(e);else if(F==="fill")n.fillChar&&g.push(n.fillChar,L.value);else if(F==="skip")n.skipChar?g.push(n.skipChar,L.value):g.push(n.nbsp?" ":" ");else if(F==="div")B?g.push("/"):t.num_min>0||t.den_min>0?g.push($):g.push(In("#",n.nbsp));else if(F==="int")if(t.int_pattern.length===1){const G=t.int_p,le=Math.max(t.int_min,c.length);let ue="";for(let S=le;S>0;S--){const U=c.charAt(c.length-S),V=U?"":G.charAt(G.length-S)||G[0];let z="";if(t.grouping){const j=S-1-R;j>=0&&!(j%b)&&(z=U||V==="0"?O.group:In("?",n.nbsp))}ue+=(U||In(V,n.nbsp))+z}g.push(ue)}else M.int+=P(c,t.int_p,L.num,M.int);else if(F==="frac"){const G=M.frac;for(let le=0;le<Q;le++)g.push(l[le+G]||In(L.num[le],n.nbsp));M.frac+=Q}else if(F==="man")!M[F]&&!M.man&&g.push(i),M.man+=P(s,t.man_p,L.num,M.man);else if(F==="num")M.num+=P(o,t.num_p,L.num,M.num);else if(F==="den"){const G=M.den;for(let le=0;le<Q;le++){let ue=a[le+G];if(!ue){const S=L.num[le];"123456789".includes(S)||v&&S==="0"?(v=!0,ue=n.nbsp?" ":" "):!v&&le===Q-1&&S==="0"&&!a?ue="1":ue=In(S,n.nbsp)}g.push(ue)}M.den+=Q}else if(F==="year")m<0&&g.push(O.negative),g.push(String(Math.abs(m)).padStart(4,"0"));else if(F==="year-short"){const G=m%100;g.push(G<10?"0":"",G)}else if(F==="month")g.push(L.pad&&_<10?"0":"",_);else if(F==="monthname-single")t.date_system===kn?g.push(O.mmmm6[_-1].charAt(0)):g.push(O.mmmm[_-1].charAt(0));else if(F==="monthname-short")t.date_system===kn?g.push(O.mmm6[_-1]):g.push(O.mmm[_-1]);else if(F==="monthname")t.date_system===kn?g.push(O.mmmm6[_-1]):g.push(O.mmmm[_-1]);else if(L.type==="weekday-short")g.push(O.ddd[I]);else if(F==="weekday")g.push(O.dddd[I]);else if(F==="day")g.push(L.pad&&p<10?"0":"",p);else if(F==="hour"){const G=y%t.clock||(t.clock<24?t.clock:0);g.push(L.pad&&G<10?"0":"",G)}else if(F==="min")g.push(L.pad&&H<10?"0":"",H);else if(F==="sec")g.push(L.pad&&x<10?"0":"",x);else if(F==="subsec"){g.push(O.decimal);const G=Y.toFixed(t.sec_decimals);g.push(G.slice(2,2+L.decimals))}else if(F==="ampm"){const G=y<12?0:1;L.short&&!r?g.push("AP"[G]):g.push(O.ampm[G])}else if(F==="hour-elap"){e<0&&g.push(O.negative);const G=h*24+Math.floor(Math.abs(d)/3600);g.push(String(Math.abs(G)).padStart(L.pad,"0"))}else if(F==="min-elap"){e<0&&g.push(O.negative);const G=h*1440+Math.floor(Math.abs(d)/60);g.push(String(Math.abs(G)).padStart(L.pad,"0"))}else if(F==="sec-elap"){e<0&&g.push(O.negative);const G=h*Ar+Math.abs(d);g.push(String(Math.abs(G)).padStart(L.pad,"0"))}else if(F==="b-year")g.push(m+543);else if(F==="b-year-short"){const G=(m+543)%100;g.push(G<10?"0":"",G)}}return g.join("")}const Vp=yr([{type:Os,value:"@",raw:"@"}]);function mu(e,t){for(let n=0;n<3;n++){const r=t[n];if(r){let s;if(r.condition){const i=r.condition[0],o=r.condition[1];i==="="?s=e===o:i===">"?s=e>o:i==="<"?s=e<o:i===">="?s=e>=o:i==="<="?s=e<=o:i==="<>"&&(s=e!==o)}else s=!0;if(s)return r}}}function zp(e,t,n){const r=t.partitions;let s=r[3],i=null;return(typeof e=="number"||typeof e=="bigint")&&isFinite(e)&&(s=mu(e,r)),s&&s.color&&(i=s.color),i&&typeof i=="number"&&n.indexColors&&(i=bp[i-1]||"#000"),i}function Gp(e,t,n){const r=t.partitions,s=Hn(t.locale||n.locale),i=r[3]?r[3]:Vp;if(typeof e=="boolean"&&(e=(s||tn).bool[e?0:1]),e==null)return"";const o=typeof e=="bigint";if(typeof e!="number"&&!o)return fu(e,i,n,s);if(!o&&!isFinite(e)){const l=s||tn;return isNaN(e)?l.nan:(e<0?l.negative:"")+l.infinity}const a=mu(e,r);return a?fu(e,a,n,s):n.overflow}function gu(e){return!!(e[0]&&e[0].percent||e[1]&&e[1].percent||e[2]&&e[2].percent||e[3]&&e[3].percent)}function _u(e){return!!(e[0]&&e[0].date||e[1]&&e[1].date||e[2]&&e[2].date||e[3]&&e[3].date)}function pu(e){const[t,n,r,s]=e;return!!((!t||t.generated)&&(!n||n.generated)&&(!r||r.generated)&&s&&s.text&&!s.generated)}const Kp={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},Xp=[["DMY",1],["DM",2],["MY",3],["MDY",4],["MD",5],["hmsa",6],["hma",7],["hms",8],["hm",9]];function qp(e,t=null){var h;const[n,r]=e,s=n.frac_max,i={type:"general",isDate:_u(e),isText:pu(e),isPercent:gu(e),maxDecimals:n.general?9:s,scale:(h=n.scale)!=null?h:1,color:0,parentheses:0,grouped:n.grouping?1:0},o=!i.isDate&&!i.isText&&!n.error&&n.tokens.some(d=>d.type==="string"&&(t?d.value===t:Eo.test(d.value)));let a="G",l=s>=0?Math.min(15,s):"",c="",u="";if(r&&r.color&&(u="-",i.color=1),n.parens&&(c="()",i.parentheses=1),o)a="C",i.type="currency";else if(n.error)i.type="error",i.maxDecimals=0;else if(i.isDate){let d=0,m=0,_="";n.tokens.forEach(I=>{const y=I.type;/^(b-)?year/.test(y)?(_+="Y",m++):y.startsWith("month")?(_+="M",m++):/^(week)?day/.test(y)?(_+="D",m++):(y==="hour"||y==="min"||y==="sec"||y==="ampm")&&(_+=y[0],d++)}),i.type="date",m&&d?i.type="datetime":!m&&d&&(i.type="time");const p=Xp.find(I=>_.startsWith(I[0]));a=p?"D":"G",l=p?p[1]:""}else i.isText?(a="G",i.type="text",l="",i.maxDecimals=0):n.general?(a="G",i.type="general",l=""):n.fractions?(a="G",i.type="fraction",l=""):n.exponential?(a="S",i.type="scientific"):i.isPercent?(a="P",i.type="percent"):n.grouping?(a=",",i.type="grouped"):(n.int_max||s)&&(a="F",i.type="number");return i.code=a+l+u+c,i.level=Kp[i.type],Object.freeze(i)}function Jp(e){const[t]=e;return{year:!!(t.date&Er),month:!!(t.date&Cr),day:!!(t.date&Is),hours:!!(t.date&Rr),minutes:!!(t.date&Ir),seconds:!!(t.date&Sr),clockType:t.clock===12?12:24}}const Zp=[[Vi,/^General/i,0],[zi,/^#/,0],[Fn,/^0/,0],[Gi,/^\?/,0],[Ki,/^\//,0],[qi,/^;/,0],[Os,/^@/,0],[Ji,/^\+/,0],[Zi,/^-/,0],[vs,/^\./,0],[Qi,/^ /,0],[eo,/^%/,0],[ws,/^[1-9]/,0],[to,/^(?:B[12])/i,0],[vr,/^B$/,0],[no,/^(?:[hH]+|[mM]+|[sS]+|[yY]+|[bB]+|[dD]+|[gG]+|[aA]{3,}|e+)/,0],[ro,/^(?:\[(h+|m+|s+)\])/i,1],[so,/^\[(<[=>]?|>=?|=)\s*(-?[.\d]+)\]/,[1,2]],[io,/^\[(DBNum[0-4]?\d)\]/i,1],[oo,/^\[(NatNum[0-4]?\d)\]/i,1],[ao,/^\[\$([^\]]+)\]/,1],[lo,/^\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*\d+)\]/i,1],[Vc,/^\[([^\]]+)\]/,1],[co,/^(?:AM\/PM|am\/pm|A\/P)/,0],[uo,/^\\(.)/,1],[ho,/^"([^"]*?)"/,1],[fo,/^_(\\.|.)/,1],[mo,/^[Ee]([+-])/,1],[go,/^\*(\\.|.)/,1],[_o,/^[()]/,0],[vr,/^[EÈÉÊËèéêëĒēĔĕĖėĘęĚěȄȅȆȇȨȩNnÑñŃńŅņŇňǸǹ["*/\\_]/,0],[bs,/^./,0]],Qp=63,eE=35,tE=48,nE=57,Lo=e=>{const t=(e||"\0").charCodeAt(0);return t===Qp||t===eE||t>=tE&&t<=nE};function $n(e){let t=0;const n=[],r=[];for(;t<e.length;){const s=e.slice(t);let i=0;const o=/^(,+)(.)?/.exec(s);if(o){const a=o[1];i=a.length;const l=e[t-1]||"";let c=!1,u=!1;Lo(l)?(c=!0,u=!0):l==="."&&(u=!0);const h=o[2]||"";if(c&&(!h||h===";")&&(c=!1),u&&Lo(h)&&(u=!1),c&&!u)n.push({type:Or,value:",",raw:a});else if(!c&&u)n.push({type:Ss,value:",",raw:a});else if(c&&u){const d={type:Ss,value:",",raw:a};n.push(d),r.push(d)}else n.push({type:Xi,value:",",raw:a})}else{let a;for(const[l,c,u]of Zp){const h=c.exec(s);if(h){const d=Array.isArray(u)?u.map(m=>h[m]):h[u||0];a={type:l,value:d,raw:h[0]},n.push(a),i=h[0].length;break}}r.length&&a.raw===";"&&(r.length=0),r.length&&Lo(a.raw)&&(r.forEach(l=>l.type=Or),r.length=0)}if(!i){const a=s[0];i=1,n.push({type:bs,value:a,raw:a})}t+=i}return n}const Uo=e=>{const t=e.condition;t&&t[1]<0&&(t[0]==="<"||t[0]==="<="||t[0]==="=")||e.tokens.unshift({type:"minus",volatile:!0})},Eu=(e,t=null)=>{const n={};for(const r in e)Array.isArray(e[r])?n[r]=[...e[r]]:n[r]=e[r];return t&&n.tokens.unshift(t),n.generated=!0,n};function rE(e){var h;const t=[];let n=!1,r,s=null,i=0,o=!1,a=0,l=0,c=$n(e);do{if(o=yr(c),(o.date||o.general)&&(o.int_pattern.length||o.frac_pattern.length||o.scale!==1||o.text))throw new Error("Illegal format");if(o.condition&&(l++,n=!0),o.text){if(s)throw new Error("Unexpected partition");s=o}o.locale&&(r=Io(o.locale)),t.push(o),i=((h=c[o.tokensUsed])==null?void 0:h.type)==="break"?1:0,c=c.slice(o.tokensUsed+i),a++}while(i&&a<4&&l<3);if(i)throw new Error("Unexpected partition");if(l>2)throw new Error("Unexpected condition");const u=t[3];if(u&&(u.int_pattern.length||u.frac_pattern.length||u.date))throw new Error("Unexpected partition");if(n){const d=t.length;if(d===1&&(t[1]=yr($n("General")),t[1].generated=!0),d<3){const m=t[0],_=t[1];if(Uo(m),_.condition)Uo(_);else{const p=m.condition;(p[0]==="="||p[1]>=0&&(p[0]===">"||p[0]===">="))&&_.tokens.unshift({type:"minus",volatile:!0})}}else t.forEach(Uo)}else{if(t.length<4&&s)for(let d=0,m=t.length;d<m;d++)t[d]===s&&t.splice(d,1);if(t.length<1&&s&&(t[0]=yr($n("General")),t[0].generated=!0),t.length<2){const d={type:"minus",volatile:!0};t.push(Eu(t[0],d))}if(t.length<3&&t.push(Eu(t[0])),t.length<4)if(s)t.push(s);else{const d=yr($n("@"));d.generated=!0,t.push(d)}t[0].condition=[">",0],t[1].condition=["<",0],t[2].condition=null}return{pattern:e,partitions:t,locale:r}}const Cu=Object.create({});function nn(e,t=!1){e||(e="General");let n=Cu[e];if(!n)try{n=rE(e),Cu[e]=n}catch(r){if(t)throw r;const s={tokens:[{type:"error"}],error:r.message};n={pattern:e,partitions:[s,s,s,s],error:r.message,locale:null}}return n}function Ru(e,t,n={}){var o;const r=Object.assign({},Jc,n),s=nn(e,r.throws),i=(o=yo(t,r))!=null?o:t;return Gp(i,s,r)}function sE(e,t,n){var o;const r=Object.assign({},Jc,n),s=nn(e,r.throws),i=(o=yo(t,r))!=null?o:t;return zp(i,s,r)}function iE(e){const t=nn(e,!1);return _u(t.partitions)}function oE(e){const t=nn(e,!1);return gu(t.partitions)}function aE(e){const t=nn(e,!1);return pu(t.partitions)}function lE(e){try{return nn(e,!0),!0}catch{return!1}}function cE(e,t={}){const n=nn(e,!1);return n.info||(n.info=qp(n.partitions,t==null?void 0:t.currency)),n.info}function uE(e){const t=nn(e,!1);return t.dateInfo||(t.dateInfo=Jp(t.partitions)),t.dateInfo}const jn=Object.freeze({AMPM:co,BREAK:qi,CALENDAR:to,CHAR:bs,COLOR:lo,COMMA:Xi,CONDITION:so,DATETIME:no,DBNUM:io,DIGIT:ws,DURATION:ro,ERROR:vr,ESCAPED:uo,EXP:mo,FILL:go,GENERAL:Vi,GROUP:Or,HASH:zi,LOCALE:ao,MINUS:Zi,MODIFIER:Vc,NATNUM:oo,PAREN:_o,PERCENT:eo,PLUS:Ji,POINT:vs,QMARK:Gi,SCALE:Ss,SKIP:fo,SLASH:Ki,SPACE:Qi,STRING:ho,TEXT:Os,ZERO:Fn}),hE=Object.freeze(Object.defineProperty({__proto__:null,addLocale:ne,dateFromSerial:Dp,dateToSerial:yo,dec2frac:Zc,format:Ru,formatColor:sE,getFormatDateInfo:uE,getFormatInfo:cE,getLocale:Hn,isDateFormat:iE,isPercentFormat:oE,isTextFormat:aE,isValidFormat:lE,parseBool:au,parseDate:Mo,parseLocale:Ro,parseNumber:No,parseTime:Ms,parseValue:Bp,round:St,tokenTypes:jn,tokenize:$n},Symbol.toStringTag,{value:"Module"})),Iu="@@@",Su="@",Po="General";function dE(e){return e===Iu||e===Su}function fE(e){return e==null||e===Po}const mE=(e,t)=>{if(e&&!t||!e&&t)return!1;const n=i=>{const o=$n(i);let a="",l=!1,c=!1;for(const u of o){if(u.type===jn.POINT){l=!0;continue}if(!(c&&u.type===jn.MINUS)&&u.type!==jn.SKIP){if(u.type===jn.COLOR){c=!0;continue}else c=!1;l&&u.type===jn.ZERO||(l=!1,l||(a+=u.value||""))}}return a},r=n(e),s=n(t);return r===s},gE=new Set(["m d"]),_E=new Set(["h:mm AM/PM","hh:mm AM/PM"]),Ou=e=>{var s,i;const t=(i=(s=Mo(e))!=null?s:Ms(e))!=null?i:No(e);if(!t)return null;const{v:n,z:r}=t;return r&&(gE.has(r)||_E.has(r)&&!/\s(A|AM|P|PM)$/i.test(e)||r.includes("#,##0")&&Ru(r,n)!==e)?null:t};function pE(e,t){const n={};for(const r in e){const s=Number(r),i=e[s];for(const o in i){const a=Number(o),l=i[a],c=t(s,a,l);c!==void 0&&(n[s]?n[s][a]=c:n[s]={[a]:c})}}return n}function rn(e){let t=0;const n=Object.keys(e);for(const r of n){const s=Number(r);t=Math.max(t,s)}return t+1}function EE(e,t,n){const r=rn(n),s=n;for(let i=r-1;i>=e;i--)s[i]===void 0?delete s[i+1]:s[i+1]=s[i];s[e]=t}function ko(e,t,n){const r=Object.keys(n).reduce((s,i)=>Math.max(s,Number.parseInt(i)),0)+1;for(let s=e;s<r;s++)s<e+t?delete n[s]:n[s]!==void 0&&(n[s-t]=n[s],delete n[s])}function CE(e,t){const n=e,r=Object.keys(n),s=r.length,i=t,o=Object.keys(i),a=o.length,l={};let c=0;for(let u=0;u<s;u++,c++){const h=r[u];l[c]=n[h]}for(let u=0;u<a;u++,c++){const h=o[u];l[c]=i[h]}return l}function RE(e,t,n){const r=n;if(rn(n)>0){const i={};let o=0;for(let a=e;a<=t;a++)r[a]&&(i[o]=r[a],o++);return i}return{}}function Fo(e,t,n,r){const s=e>n;if(!s&&e+t>n)throw new Error("Invalid move operation");s?IE(e,t,n,r):SE(e,t,n,r)}function IE(e,t,n,r){const s=r,i=[];for(let o=e;o<e+t;o++)i.push(s[o]);for(let o=e-1;o>=n;o--){const a=s[o];s[o+t]=a,a===void 0&&delete s[o+t]}i.forEach((o,a)=>{s[n+a]=o,o===void 0&&delete s[n+a]})}function SE(e,t,n,r){const s=r,i=[];for(let o=e;o<e+t;o++)i.push(s[o]);for(let o=e+t;o<n;o++){const a=s[o];s[o-t]=a,a===void 0&&delete s[o-t]}i.forEach((o,a)=>{s[n+a-t]=o,o===void 0&&delete s[n+a-t]})}class ct{constructor(t={}){E(this,"_matrix");this._setOriginValue(t)}static MakeObjectMatrixSize(t){return new ct({[t-1]:{}})}getMatrix(){return this._matrix}forEach(t){const n=this._matrix,r=Object.keys(n);for(const s of r){const i=Number(s),o=n[i];if(t(i,o)===!1)return this}return this}forRow(t){const n=this._matrix,r=Object.keys(n);for(const s of r){const i=Number(s),o=n[i];if(t(i,Object.keys(o).map(l=>Number(l)))===!1)return this}return this}forValue(t){const n=this._matrix;for(const r in n){const s=Number(r),i=n[s];if(i)for(const o in i){const a=Number(o),l=i[a];if(t(s,a,l)===!1)return this}}return this}swapRow(t,n){const r=this._matrix[t],s=this._matrix[n];this._matrix[t]=s,this._matrix[n]=r}getRow(t){return this._matrix[t]}getRowOrCreate(t){let n=this.getRow(t);return n==null&&(n={},this._matrix[t]=n),n}reset(){this._setOriginValue({})}hasValue(){const t=this._matrix,n=Object.keys(t);if(n.length===0)return!1;for(const r of n){const s=Number(r),i=t[s];if(Object.keys(i).length>0)return!0}return!1}getValue(t,n){var r,s;return(s=(r=this._matrix)==null?void 0:r[t])==null?void 0:s[n]}setValue(t,n,r){const s=this.getRowOrCreate(t);s[n]=r}deleteValue(t,n){var r,s;(s=(r=this._matrix)==null?void 0:r[t])==null||delete s[n]}realDeleteValue(t,n){var r,s,i;if((s=(r=this._matrix)==null?void 0:r[t])==null||delete s[n],this.getRow(t)){const o=this.getRow(t);if(o==null)return;Object.keys(o).length===0&&((i=this._matrix)==null||delete i[t])}}setRow(t,n){this._matrix[t]=n}moveRows(t,n,r){Fo(t,n,r,this._matrix)}moveColumns(t,n,r){this.forEach((s,i)=>{Fo(t,n,r,i)})}insertRows(t,n){const r=Object.keys(this._matrix);for(let s=r.length-1;s>=0;s--){const i=Number(r[s]);if(i>=t){const o=this._matrix[i];delete this._matrix[i],this._matrix[i+n]=o}}}insertColumns(t,n){const r=Object.keys(this._matrix);for(let s=0;s<r.length;s++){const i=Number(r[s]),o=this._matrix[i],a=Object.keys(o);for(let l=a.length-1;l>=0;l--){const c=Number(a[l]);if(c>=t){const u=o[c];delete o[c],o[c+n]=u}}}}removeRows(t,n){ko(t,n,this._matrix)}removeColumns(t,n){this.forEach((r,s)=>{s&&ko(t,n,s)})}getFragment(t,n,r,s){const i=new ct;let o=0;for(let a=t;a<=n;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(t,n,r,s){const i=new ct;for(let o=t;o<=n;o++)for(let a=r;a<=s;a++){const l=this.getValue(o,a);l&&i.setValue(o,a,Z.deepClone(l))}return i}getSliceDataAndCellCountByRows(t,n){const r=new ct;let s=0;for(let i=t;i<=n;i++){const o=this.getRow(i);o&&(r.setRow(i,o),s+=Object.keys(o).length)}return{sliceData:r,cellCount:s}}getSizeOf(){return Object.keys(this._matrix).length}getLength(){return rn(this._matrix)}getRange(){const r=this.getLength()-1;let s=0;const i=this.getLength();for(let o=0;o<i;o++){const a=this.getRow(o);if(a){const l=rn(a)-1;s=l>s?l:s}}return{startRow:0,startColumn:0,endRow:r,endColumn:s}}getRealRange(){const t=Object.keys(this._matrix),n=t.length,r=n>0?Number(t[0]):0,s=n>0?Number(t[n-1]):0;let i=-1/0,o=0;for(const a of t){const l=this.getRow(Number(a));if(l){const c=Object.keys(l);if(c.length>0){const u=Number(c[0]),h=Number(c[c.length-1]);(i===-1/0||u<i)&&(i=u),h>o&&(o=h)}}}return i===-1/0&&(i=0),{startRow:r,endRow:s,startColumn:i,endColumn:o}}getRealRowRange(){const t=Object.keys(this._matrix),n=t.length,r=n>0?Number(t[0]):0,s=n>0?Number(t[n-1]):0;return{startRow:r,endRow:s}}toNativeArray(){const t=new Array;return this.forValue((n,r,s)=>{t.push(s)}),t}toArray(){const t=[];return this.forRow((n,r)=>{t[n]==null&&(t[n]=[]),r.forEach(s=>{t[n][s]=this.getValue(n,s)})}),t}toFullArray(){const t=this.getRange(),{endColumn:n,endRow:r}=t,s=[];for(let i=0;i<=r;i++){const o=new Array(n+1).fill(void 0);s.push(o)}return this.forValue((i,o,a)=>{s[i][o]=a}),s}toJSON(){return this._matrix}clone(){const t=JSON.stringify(this._matrix);return JSON.parse(t)}getData(){const t=JSON.stringify(this._matrix);return JSON.parse(t)}getArrayData(){let t=0,n=0,r=!1,s=!1;const i=new ct;return this.forEach((o,a)=>{r||(r=!0,t=o),Object.keys(a).forEach(l=>{const c=Number(l);s?c<n&&(n=c):(s=!0,n=c);const u=this.getValue(o,c);i.setValue(o-t,c-n,u)})}),i.getData()}getStartEndScope(){let t=1/0,n=-1/0,r=1/0,s=-1/0;const i=Object.keys(this._matrix);i.length>0&&(t=+i[0],n=+i[i.length-1]);for(const o of i){const a=Object.keys(this._matrix[o]);a.length>0&&(r=Math.min(r,+a[0]),s=Math.max(s,+a[a.length-1]))}return{startRow:t,endRow:n,startColumn:r,endColumn:s}}getDataRange(){let t=0,n=0,r=0,s=-1,i=!1,o=!1;return this.forEach((a,l)=>{if(i||(i=!0,t=a),l==null)return;const c=rn(l)-1;c>r&&(r=c),Object.keys(l).forEach(u=>{const h=Number(u);o?h<n&&(n=h):(o=!0,n=h)}),a>s&&(s=a)}),{startRow:t,startColumn:n,endRow:s,endColumn:r}}getDiscreteRanges(){const t=[];return this.forEach((n,r)=>{Object.keys(r).forEach(s=>{const i=Number(s);let o=!1;for(const a of t)if(n>=a.startRow&&n<=a.endRow+1&&i>=a.startColumn&&i<=a.endColumn+1){a.endRow=Math.max(n,a.endRow),a.endColumn=Math.max(i,a.endColumn),o=!0;break}o||t.push({startRow:n,endRow:n,startColumn:i,endColumn:i})})}),t}merge(t){this.forValue((n,r)=>{const s=t.getValue(n,r);s!=null&&this.setValue(n,r,s)})}concatRows(t){const n=t.getMatrix();for(const r in n){const s=Number(r);this.setRow(s,n[s])}}_setOriginValue(t={}){this._matrix=t}}function vu(e){const{actualRow:t,actualColumn:n,isMerged:r,isMergedMainCell:s,mergeInfo:i}=e;let{startY:o,endY:a,startX:l,endX:c}=e,u=t,h=n,d=t,m=n;if(r&&i){const{startRow:_,startColumn:p,endRow:I,endColumn:y,startY:H,endY:x,startX:Y,endX:O}=i;u=_,h=p,d=I,m=y,o=H,a=x,l=Y,c=O}return s&&(o=i.startY,a=i.endY,l=i.startX,c=i.endX,d=i.endRow,m=i.endColumn),{startRow:u,startColumn:h,endRow:d,endColumn:m,startY:o,endY:a,startX:l,endX:c}}const OE=vu;function vE(e){if(!e)return;const{actualRow:t,actualColumn:n,isMerged:r,isMergedMainCell:s,startRow:i,startColumn:o,endRow:a,endColumn:l}=e;let c=t,u=n,h=t,d=n;return(r||s)&&(c=i,u=o,h=a,d=l),{startRow:c,startColumn:u,endRow:h,endColumn:d}}function wu(e){var n;return!e||(((n=e==null?void 0:e.v)==null?void 0:n.toString())||"").length===0&&!e.p}function xo(e){return wu(e)&&(e==null?void 0:e.coverable)!==!1}function Ft(e){if(e){if(e.rgb)return new It(e.rgb).toHexString();if(e.th)return new ps().setThemeColor(e.th).asThemeColor().asRgbColor().getCssString()}return null}function bu(e){return Z.isString(e)&&e.substring(0,1)==="="&&e.length>1}function wE(e){return Z.isString(e)&&e.length>0}function bE(e,t=!1){var i;let n="";const r=new Map([["ff",()=>{e.ff&&(n+=`font-family: ${e.ff}; `)}],["fs",()=>{if(e.fs){let o=e.fs;e.va&&(o/=2),n+=`font-size: ${o}pt; `}}],["it",()=>{e.it&&(n+="font-style: italic; ")}],["bl",()=>{e.bl&&(n+="font-weight: bold; ")}],["ul",()=>{var o;(o=e.ul)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} underline`):n+="text-decoration: underline; ",e.ul.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${Ft(e.ul.cl)}; `),e.ul.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.ul.t} `))}],["st",()=>{var o;(o=e.st)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} line-through`):n+="text-decoration-line: line-through; ",e.st.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${Ft(e.st.cl)}; `),e.st.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.st.t} `))}],["ol",()=>{var o;(o=e.ol)!=null&&o.s&&(n.indexOf("text-decoration-line")>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(a,l)=>`${l} overline`):n+="text-decoration-line: overline; ",e.ol.cl&&n.indexOf("text-decoration-color")===-1&&(n+=`text-decoration-color: ${Ft(e.ol.cl)}; `),e.ol.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.ol.t} `))}],["bg",()=>{e.bg&&(n+=`background: ${Ft(e.bg)}; `)}],["bd",()=>{var o,a,l,c,u,h,d,m,_,p,I,y;(o=e.bd)!=null&&o.b&&(n+=`border-bottom: ${Ds((a=e.bd)==null?void 0:a.b.s)} ${(l=Ft(e.bd.b.cl))!=null?l:""}; `),(c=e.bd)!=null&&c.t&&(n+=`border-top: ${Ds((u=e.bd)==null?void 0:u.t.s)} ${(h=Ft(e.bd.t.cl))!=null?h:""}; `),(d=e.bd)!=null&&d.r&&(n+=`border-right: ${Ds((m=e.bd)==null?void 0:m.r.s)} ${(_=Ft(e.bd.r.cl))!=null?_:""}; `),(p=e.bd)!=null&&p.l&&(n+=`border-left: ${Ds((I=e.bd)==null?void 0:I.l.s)} ${(y=Ft(e.bd.l.cl))!=null?y:""}; `)}],["cl",()=>{e.cl&&(n+=`color: ${Ft(e.cl)}; `)}],["va",()=>{e.va===jt.SUBSCRIPT?n+="vertical-align: sub; ":e.va===jt.SUPERSCRIPT&&(n+="vertical-align: super; ")}],["td",()=>{e.td===ur.LEFT_TO_RIGHT?n+="direction: ltr; ":e.td===ur.RIGHT_TO_LEFT&&(n+="direction: rtl; ")}],["tr",()=>{var o,a,l;e.tr&&(n+=`--data-rotate: (${(o=e.tr)==null?void 0:o.a}deg${(a=e.tr)!=null&&a.v?` ,${(l=e.tr)==null?void 0:l.v}`:""});`)}],["ht",()=>{e.ht===bt.LEFT?n+="text-align: left; ":e.ht===bt.RIGHT?n+="text-align: right; ":e.ht===bt.CENTER?n+="text-align: center; ":e.ht===bt.JUSTIFIED&&(n+="text-align: justify; ")}],["vt",()=>{e.vt===mn.BOTTOM?n+="vertical-align: bottom; ":e.vt===mn.TOP?n+="vertical-align: top; ":e.vt===mn.MIDDLE&&(n+="vertical-align: middle; ")}],["tb",()=>{e.tb===gn.CLIP?n+="white-space: nowrap; overflow-x: hidden; ":e.tb===gn.WRAP&&(n+="white-space: normal;")}],["pd",()=>{var u,h,d,m,_,p,I,y;const o=`${(u=e.pd)==null?void 0:u.b}pt`,a=`${(h=e.pd)==null?void 0:h.t}pt`,l=`${(d=e.pd)==null?void 0:d.l}pt`,c=`${(m=e.pd)==null?void 0:m.r}pt`;(_=e.pd)!=null&&_.b&&(n+=`padding-bottom: ${o}; `),(p=e.pd)!=null&&p.t&&(n+=`padding-top: ${a}; `),(I=e.pd)!=null&&I.l&&(n+=`padding-left: ${l}; `),(y=e.pd)!=null&&y.r&&(n+=`padding-right: ${c}; `)}]]),s=["bd","tr","tb"];for(const o in e)t&&s.includes(o)||(i=r.get(o))==null||i();return n}function Ds(e){let t="";return e===Pe.NONE?t="none":e===Pe.THIN?t="0.5pt solid":e===Pe.HAIR?t="0.5pt double":e===Pe.DOTTED?t="0.5pt dotted":e===Pe.DASHED||e===Pe.DASH_DOT?t="0.5pt dashed":e===Pe.DASH_DOT_DOT?t="0.5pt dotted":e===Pe.DOUBLE?t="0.5pt double":e===Pe.MEDIUM?t="1pt solid":e===Pe.MEDIUM_DASHED||e===Pe.MEDIUM_DASH_DOT?t="1pt dashed":e===Pe.MEDIUM_DASH_DOT_DOT?t="1pt dotted":e===Pe.SLANT_DASH_DOT?t="0.5pt dashed":e===Pe.THICK&&(t="1.5pt solid"),t}function yE(e){let t=0;if(e=e.trim(),e==="none")t=Pe.NONE;else if(e==="0.5pt solid")t=Pe.THIN;else if(e==="0.5pt double")t=Pe.HAIR;else if(e==="0.5pt dotted")t=Pe.DOTTED;else if(e==="0.5pt dashed")t=Pe.DASHED;else if(e==="1pt solid")t=Pe.MEDIUM;else if(e==="1pt dashed")t=Pe.MEDIUM_DASHED;else if(e==="1pt dotted")t=Pe.MEDIUM_DASH_DOT_DOT;else if(e==="1.5pt solid")t=Pe.THICK;else if(!e.includes("none"))t=Pe.THIN;else return Pe.NONE;return t}function AE(e,t){let n=e.body;if(t){const{headers:r,footers:s}=e;r!=null&&r[t]?n=r[t].body:s!=null&&s[t]&&(n=s[t].body)}return n}function TE(e,t){const{startRow:n,endRow:r,startColumn:s,endColumn:i,rangeType:o}=e;if(n<0||s<0||r<0||i<0||!(Number.isNaN(n)&&Number.isNaN(r))&&o===pe.COLUMN||!(Number.isNaN(s)&&Number.isNaN(i))&&o===pe.ROW||o!==pe.ROW&&o!==pe.COLUMN&&(Number.isNaN(s)||Number.isNaN(n)||Number.isNaN(i)||Number.isNaN(r)))return!1;if(t){const a=t.getRowCount(),l=t.getColumnCount();if(r>=a||i>=l)return!1}return!0}function NE(e,t){return{startRow:e,endRow:e,startColumn:t,endColumn:t}}function Ho(e){if(bu(e))return{f:e,v:null,p:null};if($c(e)){if(typeof e=="string"){const t=Ou(e);if(t&&t.z)return{v:t.v,p:null,f:null,s:{n:{pattern:t.z||Po}}}}return{v:e,p:null,f:null}}return Bc(e),e}function ME(e,t){const n=new ct,{startRow:r,startColumn:s,endRow:i,endColumn:o}=t;if(Z.isArray(e))for(let a=0;a<=i-r;a++)for(let l=0;l<=o-s;l++)n.setValue(a+r,l+s,Ho(e[a][l]));else new ct(e).forValue((l,c,u)=>{n.setValue(l,c,Ho(u))});return n.getMatrix()}function Bo(e,t){return Object.prototype.toString.call(e)===Object.prototype.toString.call(t)?Object.prototype.toString.call(e)==="[object Object]"||Object.prototype.toString.call(e)==="[object Array]"?Object.keys(e).length!==Object.keys(t).length?!1:Object.keys(e).every(n=>Bo(e[n],t[n])):e===t:!1}function yu(e,t){const n=e.ts||{},r=t.ts||{};return e.sId!==t.sId?!1:Bo(n,r)}function DE(e,t){return t.some(n=>e.indexOf(n)>-1)}var Ls={exports:{}},LE=Ls.exports,Au;function UE(){return Au||(Au=1,(function(e,t){(function(n,r){e.exports=r()})(LE,(function(){var n=1e3,r=6e4,s=36e5,i="millisecond",o="second",a="minute",l="hour",c="day",u="week",h="month",d="quarter",m="year",_="date",p="Invalid Date",I=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|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,H={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(M){var A=["th","st","nd","rd"],w=M%100;return"["+M+(A[(w-20)%10]||A[w]||A[0])+"]"}},x=function(M,A,w){var N=String(M);return!N||N.length>=A?M:""+Array(A+1-N.length).join(w)+M},Y={s:x,z:function(M){var A=-M.utcOffset(),w=Math.abs(A),N=Math.floor(w/60),D=w%60;return(A<=0?"+":"-")+x(N,2,"0")+":"+x(D,2,"0")},m:function M(A,w){if(A.date()<w.date())return-M(w,A);var N=12*(w.year()-A.year())+(w.month()-A.month()),D=A.clone().add(N,h),L=w-D<0,F=A.clone().add(N+(L?-1:1),h);return+(-(N+(w-D)/(L?D-F:F-D))||0)},a:function(M){return M<0?Math.ceil(M)||0:Math.floor(M)},p:function(M){return{M:h,y:m,w:u,d:c,D:_,h:l,m:a,s:o,ms:i,Q:d}[M]||String(M||"").toLowerCase().replace(/s$/,"")},u:function(M){return M===void 0}},O="en",R={};R[O]=H;var b="$isDayjsObject",T=function(M){return M instanceof P||!(!M||!M[b])},B=function M(A,w,N){var D;if(!A)return O;if(typeof A=="string"){var L=A.toLowerCase();R[L]&&(D=L),w&&(R[L]=w,D=L);var F=A.split("-");if(!D&&F.length>1)return M(F[0])}else{var Q=A.name;R[Q]=A,D=Q}return!N&&D&&(O=D),D||!N&&O},$=function(M,A){if(T(M))return M.clone();var w=typeof A=="object"?A:{};return w.date=M,w.args=arguments,new P(w)},g=Y;g.l=B,g.i=T,g.w=function(M,A){return $(M,{locale:A.$L,utc:A.$u,x:A.$x,$offset:A.$offset})};var P=(function(){function M(w){this.$L=B(w.locale,null,!0),this.parse(w),this.$x=this.$x||w.x||{},this[b]=!0}var A=M.prototype;return A.parse=function(w){this.$d=(function(N){var D=N.date,L=N.utc;if(D===null)return new Date(NaN);if(g.u(D))return new Date;if(D instanceof Date)return new Date(D);if(typeof D=="string"&&!/Z$/i.test(D)){var F=D.match(I);if(F){var Q=F[2]-1||0,G=(F[7]||"0").substring(0,3);return L?new Date(Date.UTC(F[1],Q,F[3]||1,F[4]||0,F[5]||0,F[6]||0,G)):new Date(F[1],Q,F[3]||1,F[4]||0,F[5]||0,F[6]||0,G)}}return new Date(D)})(w),this.init()},A.init=function(){var w=this.$d;this.$y=w.getFullYear(),this.$M=w.getMonth(),this.$D=w.getDate(),this.$W=w.getDay(),this.$H=w.getHours(),this.$m=w.getMinutes(),this.$s=w.getSeconds(),this.$ms=w.getMilliseconds()},A.$utils=function(){return g},A.isValid=function(){return this.$d.toString()!==p},A.isSame=function(w,N){var D=$(w);return this.startOf(N)<=D&&D<=this.endOf(N)},A.isAfter=function(w,N){return $(w)<this.startOf(N)},A.isBefore=function(w,N){return this.endOf(N)<$(w)},A.$g=function(w,N,D){return g.u(w)?this[N]:this.set(D,w)},A.unix=function(){return Math.floor(this.valueOf()/1e3)},A.valueOf=function(){return this.$d.getTime()},A.startOf=function(w,N){var D=this,L=!!g.u(N)||N,F=g.p(w),Q=function(j,W){var ee=g.w(D.$u?Date.UTC(D.$y,W,j):new Date(D.$y,W,j),D);return L?ee:ee.endOf(c)},G=function(j,W){return g.w(D.toDate()[j].apply(D.toDate("s"),(L?[0,0,0,0]:[23,59,59,999]).slice(W)),D)},le=this.$W,ue=this.$M,S=this.$D,U="set"+(this.$u?"UTC":"");switch(F){case m:return L?Q(1,0):Q(31,11);case h:return L?Q(1,ue):Q(0,ue+1);case u:var V=this.$locale().weekStart||0,z=(le<V?le+7:le)-V;return Q(L?S-z:S+(6-z),ue);case c:case _:return G(U+"Hours",0);case l:return G(U+"Minutes",1);case a:return G(U+"Seconds",2);case o:return G(U+"Milliseconds",3);default:return this.clone()}},A.endOf=function(w){return this.startOf(w,!1)},A.$set=function(w,N){var D,L=g.p(w),F="set"+(this.$u?"UTC":""),Q=(D={},D[c]=F+"Date",D[_]=F+"Date",D[h]=F+"Month",D[m]=F+"FullYear",D[l]=F+"Hours",D[a]=F+"Minutes",D[o]=F+"Seconds",D[i]=F+"Milliseconds",D)[L],G=L===c?this.$D+(N-this.$W):N;if(L===h||L===m){var le=this.clone().set(_,1);le.$d[Q](G),le.init(),this.$d=le.set(_,Math.min(this.$D,le.daysInMonth())).$d}else Q&&this.$d[Q](G);return this.init(),this},A.set=function(w,N){return this.clone().$set(w,N)},A.get=function(w){return this[g.p(w)]()},A.add=function(w,N){var D,L=this;w=Number(w);var F=g.p(N),Q=function(ue){var S=$(L);return g.w(S.date(S.date()+Math.round(ue*w)),L)};if(F===h)return this.set(h,this.$M+w);if(F===m)return this.set(m,this.$y+w);if(F===c)return Q(1);if(F===u)return Q(7);var G=(D={},D[a]=r,D[l]=s,D[o]=n,D)[F]||1,le=this.$d.getTime()+w*G;return g.w(le,this)},A.subtract=function(w,N){return this.add(-1*w,N)},A.format=function(w){var N=this,D=this.$locale();if(!this.isValid())return D.invalidDate||p;var L=w||"YYYY-MM-DDTHH:mm:ssZ",F=g.z(this),Q=this.$H,G=this.$m,le=this.$M,ue=D.weekdays,S=D.months,U=D.meridiem,V=function(W,ee,te,k){return W&&(W[ee]||W(N,L))||te[ee].slice(0,k)},z=function(W){return g.s(Q%12||12,W,"0")},j=U||function(W,ee,te){var k=W<12?"AM":"PM";return te?k.toLowerCase():k};return L.replace(y,(function(W,ee){return ee||(function(te){switch(te){case"YY":return String(N.$y).slice(-2);case"YYYY":return g.s(N.$y,4,"0");case"M":return le+1;case"MM":return g.s(le+1,2,"0");case"MMM":return V(D.monthsShort,le,S,3);case"MMMM":return V(S,le);case"D":return N.$D;case"DD":return g.s(N.$D,2,"0");case"d":return String(N.$W);case"dd":return V(D.weekdaysMin,N.$W,ue,2);case"ddd":return V(D.weekdaysShort,N.$W,ue,3);case"dddd":return ue[N.$W];case"H":return String(Q);case"HH":return g.s(Q,2,"0");case"h":return z(1);case"hh":return z(2);case"a":return j(Q,G,!0);case"A":return j(Q,G,!1);case"m":return String(G);case"mm":return g.s(G,2,"0");case"s":return String(N.$s);case"ss":return g.s(N.$s,2,"0");case"SSS":return g.s(N.$ms,3,"0");case"Z":return F}return null})(W)||F.replace(":","")}))},A.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},A.diff=function(w,N,D){var L,F=this,Q=g.p(N),G=$(w),le=(G.utcOffset()-this.utcOffset())*r,ue=this-G,S=function(){return g.m(F,G)};switch(Q){case m:L=S()/12;break;case h:L=S();break;case d:L=S()/3;break;case u:L=(ue-le)/6048e5;break;case c:L=(ue-le)/864e5;break;case l:L=ue/s;break;case a:L=ue/r;break;case o:L=ue/n;break;default:L=ue}return D?L:g.a(L)},A.daysInMonth=function(){return this.endOf(h).$D},A.$locale=function(){return R[this.$L]},A.locale=function(w,N){if(!w)return this.$L;var D=this.clone(),L=B(w,N,!0);return L&&(D.$L=L),D},A.clone=function(){return g.w(this.$d,this)},A.toDate=function(){return new Date(this.valueOf())},A.toJSON=function(){return this.isValid()?this.toISOString():null},A.toISOString=function(){return this.$d.toISOString()},A.toString=function(){return this.$d.toUTCString()},M})(),v=P.prototype;return $.prototype=v,[["$ms",i],["$s",o],["$m",a],["$H",l],["$W",c],["$M",h],["$y",m],["$D",_]].forEach((function(M){v[M[1]]=function(A){return this.$g(A,M[0],M[1])}})),$.extend=function(M,A){return M.$i||(M(A,P,$),M.$i=!0),$},$.locale=B,$.isDayjs=T,$.unix=function(M){return $(1e3*M)},$.en=R[O],$.Ls=R,$.p={},$}))})(Ls)),Ls.exports}var PE=UE();const Wt=pt(PE);var Us={exports:{}},kE=Us.exports,Tu;function FE(){return Tu||(Tu=1,(function(e,t){(function(n,r){e.exports=r()})(kE,(function(){return function(n,r){var s=r.prototype,i=s.format;s.format=function(o){var a=this,l=this.$locale();if(!this.isValid())return i.bind(this)(o);var c=this.$utils(),u=(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(h){switch(h){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(),h==="w"?1:2,"0");case"W":case"WW":return c.s(a.isoWeek(),h==="W"?1:2,"0");case"k":case"kk":return c.s(String(a.$H===0?24:a.$H),h==="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 h}}));return i.bind(this)(u)}}}))})(Us)),Us.exports}var xE=FE();const HE=pt(xE);var Ps={exports:{}},BE=Ps.exports,Nu;function $E(){return Nu||(Nu=1,(function(e,t){(function(n,r){e.exports=r()})(BE,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,s=/\d/,i=/\d\d/,o=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,l={},c=function(I){return(I=+I)+(I>68?1900:2e3)},u=function(I){return function(y){this[I]=+y}},h=[/[+-]\d\d:?(\d\d)?|Z/,function(I){(this.zone||(this.zone={})).offset=(function(y){if(!y||y==="Z")return 0;var H=y.match(/([+-]|\d\d)/g),x=60*H[1]+(+H[2]||0);return x===0?0:H[0]==="+"?-x:x})(I)}],d=function(I){var y=l[I];return y&&(y.indexOf?y:y.s.concat(y.f))},m=function(I,y){var H,x=l.meridiem;if(x){for(var Y=1;Y<=24;Y+=1)if(I.indexOf(x(Y,0,y))>-1){H=Y>12;break}}else H=I===(y?"pm":"PM");return H},_={A:[a,function(I){this.afternoon=m(I,!1)}],a:[a,function(I){this.afternoon=m(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,u("seconds")],ss:[o,u("seconds")],m:[o,u("minutes")],mm:[o,u("minutes")],H:[o,u("hours")],h:[o,u("hours")],HH:[o,u("hours")],hh:[o,u("hours")],D:[o,u("day")],DD:[i,u("day")],Do:[a,function(I){var y=l.ordinal,H=I.match(/\d+/);if(this.day=H[0],y)for(var x=1;x<=31;x+=1)y(x).replace(/\[|\]/g,"")===I&&(this.day=x)}],w:[o,u("week")],ww:[i,u("week")],M:[o,u("month")],MM:[i,u("month")],MMM:[a,function(I){var y=d("months"),H=(d("monthsShort")||y.map((function(x){return x.slice(0,3)}))).indexOf(I)+1;if(H<1)throw new Error;this.month=H%12||H}],MMMM:[a,function(I){var y=d("months").indexOf(I)+1;if(y<1)throw new Error;this.month=y%12||y}],Y:[/[+-]?\d+/,u("year")],YY:[i,function(I){this.year=c(I)}],YYYY:[/\d{4}/,u("year")],Z:h,ZZ:h};function p(I){var y,H;y=I,H=l&&l.formats;for(var x=(I=y.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function($,g,P){var v=P&&P.toUpperCase();return g||H[P]||n[P]||H[v].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(M,A,w){return A||w.slice(1)}))}))).match(r),Y=x.length,O=0;O<Y;O+=1){var R=x[O],b=_[R],T=b&&b[0],B=b&&b[1];x[O]=B?{regex:T,parser:B}:R.replace(/^\[|\]$/g,"")}return function($){for(var g={},P=0,v=0;P<Y;P+=1){var M=x[P];if(typeof M=="string")v+=M.length;else{var A=M.regex,w=M.parser,N=$.slice(v),D=A.exec(N)[0];w.call(g,D),$=$.replace(D,"")}}return(function(L){var F=L.afternoon;if(F!==void 0){var Q=L.hours;F?Q<12&&(L.hours+=12):Q===12&&(L.hours=0),delete L.afternoon}})(g),g}}return function(I,y,H){H.p.customParseFormat=!0,I&&I.parseTwoDigitYear&&(c=I.parseTwoDigitYear);var x=y.prototype,Y=x.parse;x.parse=function(O){var R=O.date,b=O.utc,T=O.args;this.$u=b;var B=T[1];if(typeof B=="string"){var $=T[2]===!0,g=T[3]===!0,P=$||g,v=T[2];g&&(v=T[2]),l=this.$locale(),!$&&v&&(l=H.Ls[v]),this.$d=(function(N,D,L,F){try{if(["x","X"].indexOf(D)>-1)return new Date((D==="X"?1e3:1)*N);var Q=p(D)(N),G=Q.year,le=Q.month,ue=Q.day,S=Q.hours,U=Q.minutes,V=Q.seconds,z=Q.milliseconds,j=Q.zone,W=Q.week,ee=new Date,te=ue||(G||le?1:ee.getDate()),k=G||ee.getFullYear(),K=0;G&&!le||(K=le>0?le-1:ee.getMonth());var q,re=S||0,ge=U||0,Ee=V||0,X=z||0;return j?new Date(Date.UTC(k,K,te,re,ge,Ee,X+60*j.offset*1e3)):L?new Date(Date.UTC(k,K,te,re,ge,Ee,X)):(q=new Date(k,K,te,re,ge,Ee,X),W&&(q=F(q).week(W).toDate()),q)}catch{return new Date("")}})(R,B,b,H),this.init(),v&&v!==!0&&(this.$L=this.locale(v).$L),P&&R!=this.format(B)&&(this.$d=new Date("")),l={}}else if(B instanceof Array)for(var M=B.length,A=1;A<=M;A+=1){T[1]=B[A-1];var w=H.apply(this,T);if(w.isValid()){this.$d=w.$d,this.$L=w.$L,this.init();break}A===M&&(this.$d=new Date(""))}else Y.call(this,O)}}}))})(Ps)),Ps.exports}var jE=$E();const WE=pt(jE);var ks={exports:{}},YE=ks.exports,Mu;function VE(){return Mu||(Mu=1,(function(e,t){(function(n,r){e.exports=r()})(YE,(function(){return function(n,r,s){var i=r.prototype,o=function(h){return h&&(h.indexOf?h:h.s)},a=function(h,d,m,_,p){var I=h.name?h:h.$locale(),y=o(I[d]),H=o(I[m]),x=y||H.map((function(O){return O.slice(0,_)}));if(!p)return x;var Y=I.weekStart;return x.map((function(O,R){return x[(R+(Y||0))%7]}))},l=function(){return s.Ls[s.locale()]},c=function(h,d){return h.formats[d]||(function(m){return m.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(_,p,I){return p||I.slice(1)}))})(h.formats[d.toUpperCase()])},u=function(){var h=this;return{months:function(d){return d?d.format("MMMM"):a(h,"months")},monthsShort:function(d){return d?d.format("MMM"):a(h,"monthsShort","months",3)},firstDayOfWeek:function(){return h.$locale().weekStart||0},weekdays:function(d){return d?d.format("dddd"):a(h,"weekdays")},weekdaysMin:function(d){return d?d.format("dd"):a(h,"weekdaysMin","weekdays",2)},weekdaysShort:function(d){return d?d.format("ddd"):a(h,"weekdaysShort","weekdays",3)},longDateFormat:function(d){return c(h.$locale(),d)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};i.localeData=function(){return u.bind(this)()},s.localeData=function(){var h=l();return{firstDayOfWeek:function(){return h.weekStart||0},weekdays:function(){return s.weekdays()},weekdaysShort:function(){return s.weekdaysShort()},weekdaysMin:function(){return s.weekdaysMin()},months:function(){return s.months()},monthsShort:function(){return s.monthsShort()},longDateFormat:function(d){return c(h,d)},meridiem:h.meridiem,ordinal:h.ordinal}},s.months=function(){return a(l(),"months")},s.monthsShort=function(){return a(l(),"monthsShort","months",3)},s.weekdays=function(h){return a(l(),"weekdays",null,null,h)},s.weekdaysShort=function(h){return a(l(),"weekdaysShort","weekdays",3,h)},s.weekdaysMin=function(h){return a(l(),"weekdaysMin","weekdays",2,h)}}}))})(ks)),ks.exports}var zE=VE();const GE=pt(zE);var Fs={exports:{}},KE=Fs.exports,Du;function XE(){return Du||(Du=1,(function(e,t){(function(n,r){e.exports=r()})(KE,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,s,i){var o=s.prototype,a=o.format;i.en.formats=n,o.format=function(l){l===void 0&&(l="YYYY-MM-DDTHH:mm:ssZ");var c=this.$locale().formats,u=(function(h,d){return h.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(m,_,p){var I=p&&p.toUpperCase();return _||d[p]||n[p]||d[I].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(y,H,x){return H||x.slice(1)}))}))})(l,c===void 0?{}:c);return a.call(this,u)}}}))})(Fs)),Fs.exports}var qE=XE();const JE=pt(qE);var xs={exports:{}},ZE=xs.exports,Lu;function QE(){return Lu||(Lu=1,(function(e,t){(function(n,r){e.exports=r()})(ZE,(function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(i,o,a){var l=o.prototype;a.utc=function(p){var I={date:p,utc:!0,args:arguments};return new o(I)},l.utc=function(p){var I=a(this.toDate(),{locale:this.$L,utc:!0});return p?I.add(this.utcOffset(),n):I},l.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var c=l.parse;l.parse=function(p){p.utc&&(this.$u=!0),this.$utils().u(p.$offset)||(this.$offset=p.$offset),c.call(this,p)};var u=l.init;l.init=function(){if(this.$u){var p=this.$d;this.$y=p.getUTCFullYear(),this.$M=p.getUTCMonth(),this.$D=p.getUTCDate(),this.$W=p.getUTCDay(),this.$H=p.getUTCHours(),this.$m=p.getUTCMinutes(),this.$s=p.getUTCSeconds(),this.$ms=p.getUTCMilliseconds()}else u.call(this)};var h=l.utcOffset;l.utcOffset=function(p,I){var y=this.$utils().u;if(y(p))return this.$u?0:y(this.$offset)?h.call(this):this.$offset;if(typeof p=="string"&&(p=(function(O){O===void 0&&(O="");var R=O.match(r);if(!R)return null;var b=(""+R[0]).match(s)||["-",0,0],T=b[0],B=60*+b[1]+ +b[2];return B===0?0:T==="+"?B:-B})(p),p===null))return this;var H=Math.abs(p)<=16?60*p:p;if(H===0)return this.utc(I);var x=this.clone();if(I)return x.$offset=H,x.$u=!1,x;var Y=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(x=this.local().add(H+Y,n)).$offset=H,x.$x.$localOffset=Y,x};var d=l.format;l.format=function(p){var I=p||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,I)},l.valueOf=function(){var p=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*p},l.isUTC=function(){return!!this.$u},l.toISOString=function(){return this.toDate().toISOString()},l.toString=function(){return this.toDate().toUTCString()};var m=l.toDate;l.toDate=function(p){return p==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():m.call(this)};var _=l.diff;l.diff=function(p,I,y){if(p&&this.$u===p.$u)return _.call(this,p,I,y);var H=this.local(),x=a(p).local();return _.call(H,x,I,y)}}}))})(xs)),xs.exports}var e0=QE();const t0=pt(e0);var Hs={exports:{}},n0=Hs.exports,Uu;function r0(){return Uu||(Uu=1,(function(e,t){(function(n,r){e.exports=r()})(n0,(function(){return function(n,r){r.prototype.weekday=function(s){var i=this.$locale().weekStart||0,o=this.$W,a=(o<i?o+7:o)-i;return this.$utils().u(s)?a:this.subtract(a,"day").add(s,"day")}}}))})(Hs)),Hs.exports}var s0=r0();const i0=pt(s0);var Bs={exports:{}},o0=Bs.exports,Pu;function a0(){return Pu||(Pu=1,(function(e,t){(function(n,r){e.exports=r()})(o0,(function(){var n="week",r="year";return function(s,i,o){var a=i.prototype;a.week=function(l){if(l===void 0&&(l=null),l!==null)return this.add(7*(l-this.week()),"day");var c=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var u=o(this).startOf(r).add(1,r).date(c),h=o(this).endOf(n);if(u.isBefore(h))return 1}var d=o(this).startOf(r).date(c).startOf(n).subtract(1,"millisecond"),m=this.diff(d,n,!0);return m<0?o(this).startOf("week").week():Math.ceil(m)},a.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}}))})(Bs)),Bs.exports}var l0=a0();const c0=pt(l0);var $s={exports:{}},u0=$s.exports,ku;function h0(){return ku||(ku=1,(function(e,t){(function(n,r){e.exports=r()})(u0,(function(){return function(n,r){r.prototype.weekYear=function(){var s=this.month(),i=this.week(),o=this.year();return i===1&&s===11?o+1:s===0&&i>=52?o-1:o}}}))})($s)),$s.exports}var d0=h0();const f0=pt(d0);Wt.extend(WE),Wt.extend(HE),Wt.extend(i0),Wt.extend(GE),Wt.extend(c0),Wt.extend(f0),Wt.extend(t0),Wt.extend(JE);function js(e,t,n,r){if(e>t)throw new Error("a1 should be less than a2");if(n>r)throw new Error("b1 should be less than b2");if(t<n||r<e)return[e,t];if(n<=e&&r>=t)return[];const s=r-n+1;return e<n&&t>r?[e,t-s]:n<=e&&r<t?[r+1-s,t-s]:n>e&&r>=t?[e,n-1]:[e,t]}function m0(e){if(e==null)return!1;const t=e.bullet;return(t==null?void 0:t.listId)!=null}function g0(e){if(e==null)return!1;const t=e.paragraphStyle;return Fu(t)}function Fu(e){var t;return!(e==null||(e.indentStart==null||e.indentStart.v===0)&&e.hanging==null||((t=e.hanging)==null?void 0:t.v)===0)}function xu(e,t,n){return e.slice(0,t)+n+e.slice(t)}function Hu(e,t,n){return t>n?e:e.slice(0,t)+e.slice(n)}function _0(e){if(e==null||typeof e=="boolean")return!1;if(typeof e=="number")return!isNaN(e);if(typeof e=="string"){const t=e.trim();return t===""?!1:!isNaN(Number(t))}return!1}function p0(e){let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+(t<<6)+(t<<16)-t;return t>>>0}function E0(e){if(e.length===0)return[];const t=e.slice().sort((i,o)=>(Array.isArray(i)?i[0]:i)-(Array.isArray(o)?o[0]:o)),n=[];let r=Array.isArray(t[0])?t[0][0]:t[0],s=r;for(let i=1;i<t.length;i++){const o=t[i];let a,l;Array.isArray(o)?(a=o[0],l=o[1]):(a=o,l=o),a<=s+1?s=Math.max(s,l):(n.push([r,s]),r=a,s=l)}return n.push([r,s]),n}function C0(e){if(e.length===0)return[];const t=e.slice().sort((i,o)=>i[0]-o[0]),n=[];let[r,s]=t[0];for(let i=1;i<t.length;i++){const[o,a]=t[i];o<=s+1?s=Math.max(s,a):(n.push([r,s]),r=o,s=a)}return n.push([r,s]),n}function R0(...e){let t;return e.length===1&&Array.isArray(e[0])?t=e[0]:t=e,ss({},...t)}const Ue=Symbol("newer"),Ze=Symbol("older");class I0{constructor(t){E(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Ue],{done:!1,value:t.key}):{done:!0,value:void 0}}}class S0{constructor(t){E(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Ue],{done:!1,value:t.value}):{done:!0,value:void 0}}}class O0{constructor(t){E(this,"entry");this.entry=t}[Symbol.iterator](){return this}next(){const t=this.entry;return t?(this.entry=t[Ue],{done:!1,value:[t.key,t.value]}):{done:!0,value:void 0}}}Td=Ue,Ad=Ze;class Bu{constructor(t,n){E(this,"key");E(this,"value");E(this,Td);E(this,Ad);this.key=t,this.value=n,this[Ue]=void 0,this[Ze]=void 0}toJSON(){return{key:this.key,value:this.value}}}class Ws{constructor(...t){E(this,"_keymap");E(this,"size",0);E(this,"limit");E(this,"oldest");E(this,"newest");E(this,"_onShiftListeners",[]);if(Tr.hasLength(t,1)){if(Tr.isNumber(t[0])){const n=t[0];this._initialize(n,void 0);return}if(Tr.isIterable(t[0])){const n=t[0];this._initialize(0,n);return}return}if(Tr.hasLength(t,2)){const n=t[0],r=t[1];this._initialize(n,r)}}onShift(t){if(this._onShiftListeners.indexOf(t)===-1)return this._onShiftListeners.push(t),Ye(()=>rr(this._onShiftListeners,t));throw new Error("[LRUMap]: the listener has been registered!")}_initialize(t,n){this.oldest=void 0,this.newest=void 0,this.size=0,this.limit=t,this._keymap=new Map,n&&(this.assign(n),t<1&&(this.limit=this.size))}_markEntryAsUsed(t){t!==this.newest&&(t[Ue]&&(t===this.oldest&&(this.oldest=t[Ue]),t[Ue][Ze]=t[Ze]),t[Ze]&&(t[Ze][Ue]=t[Ue]),t[Ue]=void 0,t[Ze]=this.newest,this.newest&&(this.newest[Ue]=t),this.newest=t)}assign(t){let n,r=this.limit||Number.MAX_VALUE;this._keymap.clear();const s=t[Symbol.iterator]();for(let i=s.next();!i.done;i=s.next()){const o=new Bu(i.value[0],i.value[1]);if(this._keymap.set(o.key,o),n?(n[Ue]=o,o[Ze]=n):this.oldest=o,n=o,r--===0)throw new Error("overflow")}this.newest=n,this.size=this._keymap.size}set(t,n){let r=this._keymap.get(t);return r?(r.value=n,this._markEntryAsUsed(r),this):(this._keymap.set(t,r=new Bu(t,n)),this.newest?(this.newest[Ue]=r,r[Ze]=this.newest):this.oldest=r,this.newest=r,++this.size,this.size>this.limit&&this.shift(),this)}shift(){const t=this.oldest;if(t)return this.oldest&&this.oldest[Ue]?(this.oldest=this.oldest[Ue],this.oldest[Ze]=void 0):(this.oldest=void 0,this.newest=void 0),t[Ue]=t[Ze]=void 0,this._keymap.delete(t.key),--this.size,this._onShiftListeners.forEach(n=>n(t)),[t.key,t.value]}get(t){const n=this._keymap.get(t);if(n)return this._markEntryAsUsed(n),n.value}has(t){return this._keymap.has(t)}find(t){const n=this._keymap.get(t);return n?n.value:void 0}delete(t){const n=this._keymap.get(t);if(n)return this._keymap.delete(n.key),n[Ue]&&n[Ze]?(n[Ze][Ue]=n[Ue],n[Ue][Ze]=n[Ze]):n[Ue]?(n[Ue][Ze]=void 0,this.oldest=n[Ue]):n[Ze]?(n[Ze][Ue]=void 0,this.newest=n[Ze]):this.oldest=this.newest=void 0,this.size--,n.value}clear(){this.oldest=void 0,this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new I0(this.oldest)}values(){return new S0(this.oldest)}entries(){return this[Symbol.iterator]()}[Symbol.iterator](){return new O0(this.oldest)}forEach(t,n){typeof n!="object"&&(n=this);let r=this.oldest;for(;r;)t.call(n,r.value,r.key,this),r=r[Ue]}toJSON(){const t=new Array(this.size);let n=0,r=this.oldest;for(;r;)t[n++]={key:r.key,value:r.value},r=r[Ue];return t}toString(){let t="",n=this.oldest;for(;n;)t+=`${String(n.key)}:${n.value}`,n=n[Ue],n&&(t+=" < ");return t}}class Tr{static hasLength(t,n){return t.length===n}static getValueType(t){return Object.prototype.toString.apply(t)}static isObject(t){return this.getValueType(t)==="[object Object]"}static isIterable(t){return t[Symbol.iterator]!=null}static isNumber(t){return this.getValueType(t)==="[object Number]"}}const v0={sheetId:"",range:{startRow:-1,endRow:-1,startColumn:-1,endColumn:-1}},w0={startRow:-1,startColumn:-1,endRow:-1,endColumn:-1},b0={startRow:0,startColumn:0,endRow:0,endColumn:0},y0={row:0,column:0},it={ff:"Arial",fs:11,it:ae.FALSE,bl:ae.FALSE,ul:{s:ae.FALSE},st:{s:ae.FALSE},ol:{s:ae.FALSE},tr:{a:0,v:ae.FALSE},td:ur.UNSPECIFIED,cl:{rgb:"#000000"},bg:{rgb:"#fff"},ht:bt.UNSPECIFIED,vt:mn.UNSPECIFIED,tb:gn.UNSPECIFIED,pd:{t:0,r:0,b:0,l:0},n:null,bd:{b:null,l:null,r:null,t:null}},$u={id:"default_slide",title:"defaultSlide",pageSize:{width:300,height:300}},A0=[li,Sa,ci],T0={[Je.HEADING_1]:{fs:20,bl:1},[Je.HEADING_2]:{fs:18,bl:1},[Je.HEADING_3]:{fs:16,bl:1},[Je.HEADING_4]:{fs:14,bl:1},[Je.HEADING_5]:{fs:12,bl:1},[Je.NORMAL_TEXT]:null,[Je.TITLE]:{fs:26,bl:1},[Je.SUBTITLE]:{fs:15,cl:{rgb:"#999999"}},[Je.NAMED_STYLE_TYPE_UNSPECIFIED]:null},Wn=4,N0={[Je.HEADING_1]:{spaceAbove:{v:20},spaceBelow:{v:6+Wn}},[Je.HEADING_2]:{spaceAbove:{v:18},spaceBelow:{v:6+Wn}},[Je.HEADING_3]:{spaceAbove:{v:16},spaceBelow:{v:6+Wn}},[Je.HEADING_4]:{spaceAbove:{v:14},spaceBelow:{v:4+Wn}},[Je.HEADING_5]:{spaceAbove:{v:12},spaceBelow:{v:4+Wn}},[Je.NORMAL_TEXT]:{spaceAbove:{v:0},spaceBelow:{v:0}},[Je.TITLE]:{spaceAbove:{v:0},spaceBelow:{v:3+Wn}},[Je.SUBTITLE]:{spaceAbove:{v:0},spaceBelow:{v:16}},[Je.NAMED_STYLE_TYPE_UNSPECIFIED]:null},M0="univer-sheets-chart-print-chart",D0="univer-docs-drawing-printing";var ju=(e=>(e.ARRAY_CONVERTOR="ARRAY_CONVERTOR",e.MATRIX_CONVERTOR="MATRIX_CONVERTOR",e))(ju||{});const L0={[ht.A3]:{width:1123,height:1587},[ht.A4]:{width:794,height:1124},[ht.A5]:{width:559,height:794},[ht.B4]:{width:944,height:1344},[ht.B5]:{width:665,height:944},[ht.Executive]:{width:696,height:1008},[ht.Folio]:{width:816,height:1248},[ht.Legal]:{width:816,height:1344},[ht.Letter]:{width:816,height:1056},[ht.Statement]:{width:528,height:816},[ht.Tabloid]:{width:1056,height:1632}};function Ys(e,t){const{textRuns:n=[]}=t;let r=0;for(const i of n){const{ts:o={},st:a,ed:l}=i;if(o[e]==null)return ae.FALSE;switch(e){case"bl":case"it":{if(o[e]===ae.FALSE)return ae.FALSE;break}case"ul":case"st":{if(o[e].s===ae.FALSE)return ae.FALSE;break}default:throw new Error(`unknown style key: ${e} in IStyleBase`)}r+=l-a}return t.dataStream.indexOf(`\r
4
+ `)===r?ae.TRUE:ae.FALSE}const Gr=class Gr{constructor(t,n,r){E(this,"_range");E(this,"_worksheet");this._deps=r,this._range=n,this._worksheet=t}static foreach(t,n){const{startRow:r,startColumn:s,endRow:i,endColumn:o}=t;for(let a=r;a<=i;a++)for(let l=s;l<=o;l++)n(a,l)}getRangeData(){return this._range}getValue(){return this.getValues()[0][0]}getValues(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range,i=[];for(let o=t;o<=n;o++){const a=[];for(let l=r;l<=s;l++)a.push(this.getMatrix().getValue(o,l)||null);i.push(a)}return i}getMatrix(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range,i=this._worksheet.getCellMatrix(),o=new ct;for(let a=t;a<=n;a++)for(let l=r;l<=s;l++)o.setValue(a,l,i.getValue(a,l)||null);return o}getMatrixObject(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range,i=this._worksheet.getCellMatrix(),o=new ct;for(let a=t;a<=n;a++)for(let l=r;l<=s;l++)o.setValue(a-t,l-r,i.getValue(a,l)||{});return o}getA1Notation(){const{startRow:t,endRow:n,startColumn:r,endColumn:s}=this._range;let i,o;return r<s?(i=Z.numToWord(r+1)+(t+1),o=Z.numToWord(s+1)+(n+1)):(i=Z.numToWord(s+1)+(n+1),o=Z.numToWord(r+1)+(t+1)),i===o?`${i}`:`${i}:${o}`}getBackground(){return this.getBackgrounds()[0][0]}getBackgrounds(){const t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>{var i;const s=t.getStyleByCell(r);return((i=s==null?void 0:s.bg)==null?void 0:i.rgb)||it.bg.rgb}))}getCell(t,n){const{startRow:r,startColumn:s}=this._range,i={startRow:r+t,endRow:r+t,startColumn:s+n,endColumn:s+n};return new Gr(this._worksheet,i,this._deps)}getColumn(){return this._range.startColumn}getObjectValue(t={}){return this.getObjectValues(t)[0][0]}getObjectValues(t={}){var a;const{startRow:n,endRow:r,startColumn:s,endColumn:i}=this._range,o=this._worksheet.getCellMatrix().getFragment(n,r,s,i).getData();if(t.isIncludeStyle){const l=this._deps.getStyles();for(let c=0;c<=r-n;c++)for(let 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 t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>{var i;const s=t.getStyleByCell(r);return((i=s==null?void 0:s.cl)==null?void 0:i.rgb)||it.cl.rgb}))}getFontFamilies(){return this._getStyles("ff")}getFontFamily(){return this.getFontFamilies()[0][0]}getUnderlines(){return this._getStyles("ul")}getUnderline(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Ys("ul",t.body)===ae.TRUE?{s:ae.TRUE}:{s:ae.FALSE}:this.getUnderlines()[0][0]}getOverlines(){return this._getStyles("ol")}getOverline(){return this.getOverlines()[0][0]}getStrikeThrough(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Ys("st",t.body)===ae.TRUE?{s:ae.TRUE}:{s:ae.FALSE}:this.getStrikeThroughs()[0][0]}getStrikeThroughs(){return this._getStyles("st")}getFontSize(){var n,r;const t=((n=this.getValue())==null?void 0:n.p)||{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?t.body.textRuns.some(s=>{var i;return((i=s==null?void 0:s.ts)==null?void 0:i.fs)!=null})?Math.max(...t.body.textRuns.map(s=>{var i;return((i=s==null?void 0:s.ts)==null?void 0:i.fs)||0})):this.getFontSizes()[0][0]:this.getFontSizes()[0][0]}getFontSizes(){return this._getStyles("fs")}getBorder(){return this.getBorders()[0][0]}getBorders(){return this._getStyles("bd")}getFontStyle(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Ys("it",t.body)===ae.TRUE?ls.ITALIC:ls.NORMAL:this._getFontStyles()[0][0]}_getFontStyles(){return this._getStyles("it")}getFontWeight(){var n,r;const{p:t}=(n=this.getValue())!=null?n:{};return t&&Array.isArray((r=t.body)==null?void 0:r.textRuns)&&t.body.textRuns.length>0?Ys("bl",t.body)===ae.TRUE?cs.BOLD:cs.NORMAL:this._getFontWeights()[0][0]}_getFontWeights(){return this._getStyles("bl")}getGridId(){return this._worksheet.getSheetId()}getHeight(){const{_range:t,_worksheet:n}=this,{startRow:r,endRow:s}=t;let i=0;for(let o=0;o<=s-r;o++){const a=n.getRowHeight(o);i+=a}return i}getHorizontalAlignment(){return this.getHorizontalAlignments()[0][0]}getHorizontalAlignments(){return this._getStyles("ht")}getLastColumn(){return this._range.endColumn}getLastRow(){return this._range.endRow}getNumColumns(){const{startColumn:t,endColumn:n}=this._range;return n-t+1}getNumRows(){const{startRow:t,endRow:n}=this._range;return n-t+1}getRichTextValue(){return this.getRichTextValues()[0][0]}getRichTextValues(){return this.getValues().map(t=>t.map(n=>(n==null?void 0:n.p)||""))}getRowIndex(){return this._range.startRow}getSheet(){return this._worksheet}getTextDirection(){return this.getTextDirections()[0][0]}getTextDirections(){return this._getStyles("td")}getTextRotation(){return this.getTextRotations()[0][0]}getTextRotations(){return this._getStyles("tr")}getTextStyle(){return this.getTextStyles()[0][0]}getTextStyles(){const t=this._deps.getStyles();return this.getValues().map(n=>n.map(r=>t.getStyleByCell(r)))}getVerticalAlignment(){return this.getVerticalAlignments()[0][0]}getVerticalAlignments(){return this._getStyles("vt")}getWidth(){const{_range:t,_worksheet:n}=this,{startColumn:r,endColumn:s}=t;let i=0;for(let o=0;o<=s-r;o++)i+=n.getColumnWidth(o);return i}getWrap(){return this.getWrapStrategy()===gn.WRAP?ae.TRUE:ae.FALSE}getWrapStrategies(){return this._getStyles("tb")}getWrapStrategy(){return this.getWrapStrategies()[0][0]}forEach(t){Gr.foreach(this._range,t)}_getStyles(t){const n=this._deps.getStyles();return this.getValues().map(r=>r.map(s=>{const i=n&&n.getStyleByCell(s);return i&&i[t]||it[t]}))}};E(Gr,"transformRange",(t,n)=>{const r=n.getMaxColumns()-1,s=n.getMaxRows()-1;return t.rangeType===pe.ALL?{startColumn:0,startRow:0,endColumn:r,endRow:s}:t.rangeType===pe.COLUMN?{startRow:0,endRow:s,startColumn:t.startColumn,endColumn:t.endColumn}:t.rangeType===pe.ROW?{startColumn:0,endColumn:r,startRow:t.startRow,endRow:t.endRow}:{startColumn:t.startColumn,endColumn:Math.min(t.endColumn,r),startRow:t.startRow,endRow:Math.min(t.endRow,s)}});let Yn=Gr;function Wu(e,t,n=0,r=e.length-1,s=U0){for(;r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),h=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*h*(l-h)/l)*(c-l/2<0?-1:1),m=Math.max(n,Math.floor(t-c*h/l+d)),_=Math.min(r,Math.floor(t+(l-c)*h/l+d));Wu(e,t,m,_,s)}const i=e[t];let o=n,a=r;for(Nr(e,n,t),s(e[r],i)>0&&Nr(e,n,r);o<a;){for(Nr(e,o,a),o++,a--;s(e[o],i)<0;)o++;for(;s(e[a],i)>0;)a--}s(e[n],i)===0?Nr(e,n,a):(a++,Nr(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}}function Nr(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function U0(e,t){return e<t?-1:e>t?1:0}class Vs{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data;const r=[];if(!Gs(t,n))return r;const s=this.toBBox,i=[];for(;n;){for(let o=0;o<n.children.length;o++){const a=n.children[o],l=n.leaf?s(a):a;Gs(t,l)&&(n.leaf?r.push(a):jo(t,l)?this._all(a,r):i.push(a))}n=i.pop()}return r}collides(t){let n=this.data;if(!Gs(t,n))return!1;const r=[];for(;n;){for(let s=0;s<n.children.length;s++){const i=n.children[s],o=n.leaf?this.toBBox(i):i;if(Gs(t,o)){if(n.leaf||jo(t,o))return!0;r.push(i)}}n=r.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let r=0;r<t.length;r++)this.insert(t[r]);return this}let n=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){const r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=zn([]),this}remove(t,n){if(!t)return this;let r=this.data;const s=this.toBBox(t),i=[],o=[];let a,l,c;for(;r||i.length;){if(r||(r=i.pop(),l=i[i.length-1],a=o.pop(),c=!0),r.leaf){const u=P0(t,r.children,n);if(u!==-1)return r.children.splice(u,1),i.push(r),this._condense(i),this}!c&&!r.leaf&&jo(r,s)?(i.push(r),o.push(a),a=0,l=r,r=r.children[0]):l?(a++,r=l.children[a],c=!1):r=null}return this}toBBox(t){return t}compareMinX(t,n){return t.minX-n.minX}compareMinY(t,n){return t.minY-n.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,n){const r=[];for(;t;)t.leaf?n.push(...t.children):r.push(...t.children),t=r.pop();return n}_build(t,n,r,s){const i=r-n+1;let o=this._maxEntries,a;if(i<=o)return a=zn(t.slice(n,r+1)),Vn(a,this.toBBox),a;s||(s=Math.ceil(Math.log(i)/Math.log(o)),o=Math.ceil(i/Math.pow(o,s-1))),a=zn([]),a.leaf=!1,a.height=s;const l=Math.ceil(i/o),c=l*Math.ceil(Math.sqrt(o));Yu(t,n,r,c,this.compareMinX);for(let u=n;u<=r;u+=c){const h=Math.min(u+c-1,r);Yu(t,u,h,l,this.compareMinY);for(let d=u;d<=h;d+=l){const m=Math.min(d+l-1,h);a.children.push(this._build(t,d,m,s-1))}}return Vn(a,this.toBBox),a}_chooseSubtree(t,n,r,s){for(;s.push(n),!(n.leaf||s.length-1===r);){let i=1/0,o=1/0,a;for(let l=0;l<n.children.length;l++){const c=n.children[l],u=$o(c),h=x0(t,c)-u;h<o?(o=h,i=u<i?u:i,a=c):h===o&&u<i&&(i=u,a=c)}n=a||n.children[0]}return n}_insert(t,n,r){const s=r?t:this.toBBox(t),i=[],o=this._chooseSubtree(s,this.data,n,i);for(o.children.push(t),Dr(o,s);n>=0&&i[n].children.length>this._maxEntries;)this._split(i,n),n--;this._adjustParentBBoxes(s,i,n)}_split(t,n){const r=t[n],s=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,s);const o=this._chooseSplitIndex(r,i,s),a=zn(r.children.splice(o,r.children.length-o));a.height=r.height,a.leaf=r.leaf,Vn(r,this.toBBox),Vn(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(r,a)}_splitRoot(t,n){this.data=zn([t,n]),this.data.height=t.height+1,this.data.leaf=!1,Vn(this.data,this.toBBox)}_chooseSplitIndex(t,n,r){let s,i=1/0,o=1/0;for(let a=n;a<=r-n;a++){const l=Mr(t,0,a,this.toBBox),c=Mr(t,a,r,this.toBBox),u=H0(l,c),h=$o(l)+$o(c);u<i?(i=u,s=a,o=h<o?h:o):u===i&&h<o&&(o=h,s=a)}return s||r-n}_chooseSplitAxis(t,n,r){const s=t.leaf?this.compareMinX:k0,i=t.leaf?this.compareMinY:F0,o=this._allDistMargin(t,n,r,s),a=this._allDistMargin(t,n,r,i);o<a&&t.children.sort(s)}_allDistMargin(t,n,r,s){t.children.sort(s);const i=this.toBBox,o=Mr(t,0,n,i),a=Mr(t,r-n,r,i);let l=zs(o)+zs(a);for(let c=n;c<r-n;c++){const u=t.children[c];Dr(o,t.leaf?i(u):u),l+=zs(o)}for(let c=r-n-1;c>=n;c--){const u=t.children[c];Dr(a,t.leaf?i(u):u),l+=zs(a)}return l}_adjustParentBBoxes(t,n,r){for(let s=r;s>=0;s--)Dr(n[s],t)}_condense(t){for(let n=t.length-1,r;n>=0;n--)t[n].children.length===0?n>0?(r=t[n-1].children,r.splice(r.indexOf(t[n]),1)):this.clear():Vn(t[n],this.toBBox)}}function P0(e,t,n){if(!n)return t.indexOf(e);for(let r=0;r<t.length;r++)if(n(e,t[r]))return r;return-1}function Vn(e,t){Mr(e,0,e.children.length,t,e)}function Mr(e,t,n,r,s){s||(s=zn(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(let i=t;i<n;i++){const o=e.children[i];Dr(s,e.leaf?r(o):o)}return s}function Dr(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function k0(e,t){return e.minX-t.minX}function F0(e,t){return e.minY-t.minY}function $o(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function zs(e){return e.maxX-e.minX+(e.maxY-e.minY)}function x0(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function H0(e,t){const n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),s=Math.min(e.maxX,t.maxX),i=Math.min(e.maxY,t.maxY);return Math.max(0,s-n)*Math.max(0,i-r)}function jo(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function Gs(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function zn(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Yu(e,t,n,r,s){const i=[t,n];for(;i.length;){if(n=i.pop(),t=i.pop(),n-t<=r)continue;const o=t+Math.ceil((n-t)/r/2)*r;Wu(e,o,t,n,s),i.push(t,o,o,n)}}function B0(e,t,n,r=!1){if(t===0&&n===0)return e;let s={...e};const i=s.startAbsoluteRefType||Me.NONE,o=s.endAbsoluteRefType||Me.NONE,a=s.rangeType||pe.NORMAL;if(!r&&i===Me.ALL&&o===Me.ALL)return s;const l=Vu(s.startRow,n,s.startColumn,t,a),c=Vu(s.endRow,n,s.endColumn,t,a);return r||i===Me.NONE&&o===Me.NONE?s={...s,startRow:l.row,startColumn:l.column,endRow:c.row,endColumn:c.column}:(i===Me.NONE?s={...s,startRow:l.row,startColumn:l.column}:i===Me.COLUMN?s={...s,startRow:l.row}:i===Me.ROW&&(s={...s,startColumn:l.column}),o===Me.NONE?s={...s,endRow:c.row,endColumn:c.column}:o===Me.COLUMN?s={...s,endRow:c.row}:o===Me.ROW&&(s={...s,endColumn:c.column}),s)}function Vu(e,t,n,r,s){return s===pe.NORMAL?{row:e+t,column:n+r}:s===pe.ROW?{row:e+t,column:n}:s===pe.COLUMN?{row:e,column:n+r}:{row:e,column:n}}function Wo(e){const t=new Set,n=new Set;for(const o of e)t.add(o.startColumn),t.add(o.endColumn+1),n.add(o.startRow),n.add(o.endRow+1);const r=Array.from(t).sort((o,a)=>o-a),s=Array.from(n).sort((o,a)=>o-a);e.sort((o,a)=>o.startRow-a.startRow||o.startColumn-a.startColumn);const i=[];for(let o=0;o<s.length-1;o++)for(let a=0;a<r.length-1;a++){const l=r[a],c=r[a+1]-1,u=s[o],h=s[o+1]-1;for(const d of e){if(d.startRow>h)break;if(d.startRow<=u&&d.endRow>=h&&d.startColumn<=l&&d.endColumn>=c){i.push({startColumn:l,endColumn:c,startRow:u,endRow:h});break}}}return i}function $0(e){e.sort((r,s)=>r.startRow-s.startRow||r.startColumn-s.startColumn);const t={};for(const r of e)t[r.startRow]||(t[r.startRow]=[]),t[r.startRow].push(r);const n=[];for(const r in t){const s=t[+r];s.sort((o,a)=>o.startColumn-a.startColumn);let i=s[0];for(let o=1;o<s.length;o++){const a=s[o];a.startColumn<=i.endColumn+1&&a.startRow===i.startRow&&a.endRow===i.endRow?i.endColumn=Math.max(i.endColumn,a.endColumn):(n.push(i),i=a)}n.push(i)}return n}function j0(e){e.sort((r,s)=>r.startColumn-s.startColumn||r.startRow-s.startRow);const t={};for(const r of e)t[r.startColumn]||(t[r.startColumn]=[]),t[r.startColumn].push(r);const n=[];for(const r in t){const s=t[+r];s.sort((o,a)=>o.startRow-a.startRow);let i=s[0];for(let o=1;o<s.length;o++){const a=s[o];a.startRow<=i.endRow+1&&a.startColumn===i.startColumn&&a.endColumn===i.endColumn?i.endRow=Math.max(i.endRow,a.endRow):(n.push(i),i=a)}n.push(i)}return n}function W0(e){const t=Wo(e),n=$0(t);return j0(n)}function Y0(e,t){const n=[];return e.forEach(r=>{n.push(...Yt.subtract(r,t))}),Yt.mergeRanges(n)}function zu(e,t){const n=Gu(e.startRow,e.endRow,t.startRow,t.endRow),r=Gu(e.startColumn,e.endColumn,t.startColumn,t.endColumn);if(!n||!r)return null;const[s,i]=n,[o,a]=r,l=V0(e.rangeType,t.rangeType,s,i,o,a);return{startRow:s,endRow:i,startColumn:o,endColumn:a,rangeType:l}}function Gu(e,t,n,r){const s=isNaN(e)?-1/0:e,i=isNaN(t)?1/0:t,o=isNaN(n)?-1/0:n,a=isNaN(r)?1/0:r,l=Math.max(s,o),c=Math.min(i,a);if(l<=c){const u=l===-1/0?Number.NaN:l,h=c===1/0?Number.NaN:c;return[u,h]}else return null}function V0(e,t,n,r,s,i){const o=e!==void 0?e:Ku(n,r,s,i),a=t!==void 0?t:Ku(n,r,s,i);return o===pe.ALL||a===pe.ALL?o===a?o:o===pe.ALL?a:o:o===a?o:(o===pe.NORMAL||a===pe.NORMAL,pe.NORMAL)}function Ku(e,t,n,r){const s=!isNaN(e)&&!isNaN(t),i=!isNaN(n)&&!isNaN(r);return s&&i?pe.NORMAL:s?pe.ROW:i?pe.COLUMN:pe.ALL}const zt=class zt{static clone(t){return t.rangeType!==void 0?{startRow:t.startRow,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn,rangeType:t.rangeType}:{startRow:t.startRow,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn}}static equals(t,n){return t==null||n==null?!1:t.endRow===n.endRow&&t.endColumn===n.endColumn&&t.startRow===n.startRow&&t.startColumn===n.startColumn&&(t.rangeType===n.rangeType||t.rangeType===void 0&&n.rangeType===pe.NORMAL||n.rangeType===void 0&&t.rangeType===pe.NORMAL)}static simpleRangesIntersect(t,n){const{startRow:r,endRow:s,startColumn:i,endColumn:o}=t,{startRow:a,endRow:l,startColumn:c,endColumn:u}=n,h=r<=l&&s>=a,d=i<=u&&o>=c;return h&&d}static intersects(t,n){if(t.rangeType===pe.ROW&&n.rangeType===pe.COLUMN||t.rangeType===pe.COLUMN&&n.rangeType===pe.ROW)return!0;if(t.rangeType===pe.ROW&&n.rangeType===pe.ROW)return t.startRow<=n.endRow&&t.endRow>=n.startRow;if(t.rangeType===pe.COLUMN&&n.rangeType===pe.COLUMN)return t.startColumn<=n.endColumn&&t.endColumn>=n.startColumn;const r=Math.floor(Number.MAX_SAFE_INTEGER/10),s=Number.isNaN(t.startRow)?0:t.startRow,i=Number.isNaN(t.endRow)?r:t.endRow,o=Number.isNaN(t.startColumn)?0:t.startColumn,a=Number.isNaN(t.endColumn)?r:t.endColumn,l=Number.isNaN(n.startRow)?0:n.startRow,c=Number.isNaN(n.endRow)?r:n.endRow,u=Number.isNaN(n.startColumn)?0:n.startColumn,h=Number.isNaN(n.endColumn)?r:n.endColumn,d=Math.abs(o+a-u-h),m=Math.abs(o-a)+Math.abs(u-h),_=Math.abs(s+i-l-c),p=Math.abs(s-i)+Math.abs(l-c);return d<=m&&_<=p}static doAnyRangesIntersect(t,n){const r=new Vs;return r.load(t.map(s=>({minX:s.startColumn,minY:s.startRow,maxX:s.endColumn,maxY:s.endRow}))),n.some(s=>r.search({minX:s.startColumn,minY:s.startRow,maxX:s.endColumn,maxY:s.endRow}).length>0)}static getIntersects(t,n){const r=t.startRow,s=t.endRow,i=t.startColumn,o=t.endColumn,a=n.startRow,l=n.endRow,c=n.startColumn,u=n.endColumn;let h,d,m,_;if(a<=s)a>=r?d=a:d=r;else return null;if(l>=r)l>=s?_=s:_=l;else return null;if(c<=o)c>i?h=c:h=i;else return null;if(u>=i)u>=o?m=o:m=u;else return null;return{startRow:d,endRow:_,startColumn:h,endColumn:m,rangeType:pe.NORMAL}}static contains(t,n){return t.startRow<=n.startRow&&t.endRow>=n.endRow&&t.startColumn<=n.startColumn&&t.endColumn>=n.endColumn}static realContain(t,n){return zt.contains(t,n)&&(t.startRow<n.startRow||t.endRow>n.endRow||t.startColumn<n.startColumn||t.endColumn>n.endColumn)}static union(...t){return t.reduce((n,r)=>({startRow:Math.min(n.startRow,r.startRow),startColumn:Math.min(n.startColumn,r.startColumn),endRow:Math.max(n.endRow,r.endRow),endColumn:Math.max(n.endColumn,r.endColumn),rangeType:pe.NORMAL}),t[0])}static realUnion(...t){const n=t.some(i=>i.rangeType===pe.COLUMN),r=t.some(i=>i.rangeType===pe.ROW),s=zt.union(...t);return{startColumn:r?Number.NaN:s.startColumn,endColumn:r?Number.NaN:s.endColumn,startRow:n?Number.NaN:s.startRow,endRow:n?Number.NaN:s.endRow,rangeType:r?pe.ROW:n?pe.COLUMN:pe.NORMAL}}static subtract(t,n){if(n.startRow>t.endRow||n.endRow<t.startRow||n.startColumn>t.endColumn||n.endColumn<t.startColumn)return[t];const r=[];n.startRow>=t.startRow&&r.push({startRow:t.startRow,startColumn:t.startColumn,endRow:n.startRow-1,endColumn:t.endColumn}),n.endRow<=t.endRow&&r.push({startRow:n.endRow+1,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn});const s=Math.max(t.startRow,n.startRow),i=Math.min(t.endRow,n.endRow);return n.startColumn>=t.startColumn&&r.push({startRow:s,startColumn:t.startColumn,endRow:i,endColumn:n.startColumn-1}),n.endColumn<=t.endColumn&&r.push({startRow:s,startColumn:n.endColumn+1,endRow:i,endColumn:t.endColumn}),r.filter(a=>a.startRow<=a.endRow&&a.startColumn<=a.endColumn)}static mergeRanges(t){return W0(t)}static splitIntoGrid(t){return Wo(t)}static subtractMulti(t,n){if(!n.length)return t;let r=t;return n.forEach(s=>{r=Y0(r,s)}),r}static hasIntersectionBetweenTwoRect(t,n){return!(t.left>n.right||t.right<n.left||t.top>n.bottom||t.bottom<n.top)}static getIntersectionBetweenTwoRect(t,n){const r=Math.max(t.left,n.left),s=Math.min(t.right,n.right),i=Math.max(t.top,n.top),o=Math.min(t.bottom,n.bottom);return s<=r||o<=i?null:{left:r,right:s,top:i,bottom:o,width:s-r,height:o-i}}static sort(t){return t.sort((n,r)=>n.startRow-r.startRow||n.startColumn-r.startColumn)}};E(zt,"getRelativeRange",(t,n)=>({startRow:t.startRow-n.startRow,endRow:t.endRow-t.startRow,startColumn:t.startColumn-n.startColumn,endColumn:t.endColumn-t.startColumn})),E(zt,"getPositionRange",(t,n,r)=>({...r||{},startRow:r&&[Me.ROW,Me.ALL].includes(r.startAbsoluteRefType||0)?r.startRow:t.startRow+n.startRow,endRow:r&&[Me.ROW,Me.ALL].includes(r.endAbsoluteRefType||0)?r.endRow:t.endRow+t.startRow+n.startRow,startColumn:r&&[Me.COLUMN,Me.ALL].includes(r.startAbsoluteRefType||0)?r.startColumn:t.startColumn+n.startColumn,endColumn:r&&[Me.COLUMN,Me.ALL].includes(r.endAbsoluteRefType||0)?r.endColumn:t.endColumn+t.startColumn+n.startColumn})),E(zt,"moveHorizontal",(t,n=0,r=0)=>({...t,startColumn:t.startColumn+n,endColumn:t.endColumn+n+r})),E(zt,"moveVertical",(t,n=0,r=0)=>({...t,startRow:t.startRow+n,endRow:t.endRow+n+r})),E(zt,"moveOffset",(t,n,r)=>{const s={...t};switch(t.startAbsoluteRefType){case Me.ROW:s.startColumn+=n;break;case Me.COLUMN:s.startRow+=r;break;case Me.ALL:break;case Me.NONE:default:s.startRow+=r,s.startColumn+=n;break}switch(t.endAbsoluteRefType){case Me.ROW:s.endColumn+=n;break;case Me.COLUMN:s.endRow+=r;break;case Me.ALL:break;case Me.NONE:default:s.endRow+=r,s.endColumn+=n;break}return s});let Yt=zt;function z0(e,t){if(e.length===0||e[0].length===0)return null;const n=new Array(e[0].length).fill(0);let r=0,s=null;for(let i=0;i<e.length;i++){for(let a=0;a<e[0].length;a++)n[a]=t(e[i][a])?n[a]+1:0;const o=G0(n);o.area>r&&(r=o.area,s={startColumn:o.start,startRow:i-o.height+1,endColumn:o.end,endRow:i})}return s}function G0(e){const t=[];let n=0,r={area:0,height:0,start:0,end:0},s=0;for(;s<e.length;)if(t.length===0||e[s]>=e[t[t.length-1]])t.push(s++);else{const i=e[t.pop()],o=t.length===0?s:s-t[t.length-1]-1;i*o>n&&(n=i*o,r={area:n,height:i,start:t.length===0?0:t[t.length-1]+1,end:s-1})}for(;t.length>0;){const i=e[t.pop()],o=t.length===0?s:s-t[t.length-1]-1;i*o>n&&(n=i*o,r={area:n,height:i,start:t.length===0?0:t[t.length-1]+1,end:s-1})}return r}function K0(e,t){Yn.foreach(t,(n,r)=>{e[n][r]=void 0})}function X0(e,t){const n=e.toFullArray(),r=[];for(;;){const s=z0(n,t);if(!s)break;r.push(s),K0(n,s)}return r}class q0{constructor(t,n){E(this,"_values",[]);E(this,"_keys",[]);E(this,"_keyMaps",new Map);this._values=t,this._keys=n,t.forEach(r=>{this._initKeyMap(r)})}_initKeyMap(t){this._keys.forEach(n=>{const r=t[n],s=this._keyMaps.get(n)||new Map;s.set(r,t),this._keyMaps.set(n,s)})}getValue(t,n){const r=n||this._keys;for(let s=0;s<r.length;s++){const i=this._keyMaps.get(r[s]);if(i!=null&&i.has(t))return i.get(t)}return null}hasValue(t){for(let n=0;n<this._keys.length;n++){const r=this._keyMaps.get(this._keys[n]);if(r!=null&&r.has(t))return!0}return!1}addValue(t){this._values.push(t),this._initKeyMap(t)}setValue(t,n,r){const s=this.getValue(t);s&&Object.keys(s).includes(n)&&(s[n]=r)}deleteValue(t,n){const r=this.getValue(t,n);if(r){this._keys.forEach(i=>{const o=this._keyMaps.get(i),a=r[i];o==null||o.delete(a)});const s=this._values.findIndex(i=>i===r);this._values.splice(s,1)}}getValues(){return this._values}getKeyMap(t){var n;return[...((n=this._keyMaps.get(t))==null?void 0:n.keys())||[]]}clear(){this._values=[],this._keys=[],this._keyMaps.clear()}}function Yo(e,t,n,r){return{forEach(s){for(let i=e;i<=t;i++)for(let o=n;o<=r;o++)s(i,o)}}}function J0(e){if(e==null||e.length===0)return Number.NaN;const t=e.toLowerCase().split(""),n=t.length,r=o=>o.charCodeAt(0)-96;let s=0,i=0;for(let o=0;o<n;o++)i=r(t[o]),s+=i*26**(n-o-1);return s===0?Number.NaN:s-1}const Ks=65,Xu=90,Z0=97;function Q0(e){const t=Xu-Ks+1;let n="";for(;e>=0;)n=String.fromCharCode(e%t+Ks)+n,e=Math.floor(e/t)-1;return n}function qu(e,t){let n="";for(;t>0;)n+=e,t--;return n}function eC(e,t=!1){const n=Xu-Ks+1;let r=Z0;t&&(r=Ks);const s=String.fromCharCode(e%n+r),i=Math.floor(e/n)+1;return qu(s,i)}function tC(e,t){return e.zIndex>t.zIndex?1:e.zIndex===t.zIndex?0:-1}function nC(e,t){return e.zIndex>t.zIndex?-1:e.zIndex===t.zIndex?0:1}function Lr(e="index",t=1){return(n,r)=>n[e]>r[e]?t:n[e]===r[e]?0:-t}function Ur(e,t=!1){const n=[];for(const r of e){const{st:s,ed:i,ts:o}=r;if(r.sId===void 0&&delete r.sId,s===i||!t&&Z.isEmptyObject(o)&&r.sId==null)continue;if(n.length===0){n.push(r);continue}const a=n.pop();yu(r,a)&&Z.hasIntersectionBetweenTwoRanges(a.st,a.ed,r.st,r.ed)?n.push({...r,st:a.st,ed:i}):n.push(a,r)}return n}function Ju(e,t,n,r){var c;const{textRuns:s}=e;if(s==null)return;const i=[],o=s.length;let a=!1;const l=(c=t.textRuns)!=null?c:[];if(l.length)for(const u of l)u.st+=r,u.ed+=r;for(let u=0;u<o;u++){const h=s[u],{st:d,ed:m}=h;if(m<=r)i.push(h);else if(r>d&&r<m){a=!0;const _={...h,ed:r};i.push(_),l.length&&i.push(...l);const p={...h,st:r+n,ed:m+n};i.push(p)}else h.st+=n,h.ed+=n,a||(a=!0,i.push(...l)),i.push(h)}a||(a=!0,i.push(...l)),e.textRuns=Ur(i)}function Zu(e,t,n,r){const{paragraphs:s}=e;if(s==null)return;const{paragraphs:i}=t,o=[];for(let l=0,c=s.length;l<c;l++){const u=s[l],{startIndex:h}=u;h>=r&&(u.startIndex+=n),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(Lr("startIndex"))}}function Qu(e,t,n,r){const{sectionBreaks:s}=e;if(s==null)return;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=n)}const i=t.sectionBreaks;if(i){for(let o=0,a=i.length;o<a;o++){const l=i[o];l.startIndex+=r}s.push(...i),s.sort(Lr("startIndex"))}}function eh(e,t,n,r){const{customBlocks:s=[]}=e;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=n)}const i=t.customBlocks;if(i){for(let o=0,a=i.length;o<a;o++){const l=i[o];l.startIndex+=r}s.push(...i),s.sort(Lr("startIndex"))}s.length&&!e.customBlocks&&(e.customBlocks=s)}function th(e,t,n,r){const{tables:s}=e;if(s==null)return;for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c,endIndex:u}=l;c>r?(l.startIndex+=n,l.endIndex+=n):u>r&&(l.endIndex+=n)}const i=t.tables;if(i){for(let o=0,a=i.length;o<a;o++){const l=i[o];l.startIndex+=r,l.endIndex+=r}s.push(...i),s.sort(Lr("startIndex"))}}const nh="$",rh=e=>e.split(nh)[0];function Vo(e){if(e.length<=1)return e;e.sort((s,i)=>s.startIndex-i.startIndex);const t=[];let n={...e[0]};n.rangeId=rh(n.rangeId);for(let s=1;s<e.length;s++){const i=e[s];i.rangeId=rh(i.rangeId),i.rangeId===n.rangeId&&Ta(n.properties,i.properties)&&n.endIndex+1>=i.startIndex?n.endIndex=i.endIndex:(t.push(n),n={...i})}t.push(n);const r=Object.create(null);for(let s=0,i=t.length;s<i;s++){const o=t[s],a=o.rangeId;r[a]?(o.rangeId=`${a}${nh}${r[a]}`,r[a]=r[a]+1):r[a]=1}return t}function zo(e,t){const n=e.findIndex(s=>s.startIndex<t&&s.endIndex>=t),r=e[n];r&&e.splice(n,1,{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:r.startIndex,endIndex:t-1,properties:{...r.properties}},{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:t,endIndex:r.endIndex,properties:{...r.properties}})}function sh(e){if(e.length<=1)return e;e.sort((r,s)=>r.startIndex-s.startIndex);const t=[];let n={...e[0]};for(let r=1;r<e.length;r++){const s=e[r];s.id===n.id&&n.endIndex+1>=s.startIndex?n.endIndex=s.endIndex:(t.push(n),n={...s})}return t.push(n),t}function Go(e,t){e.filter(r=>r.startIndex<t&&r.endIndex>=t).forEach(r=>{const s=e.indexOf(r);e.splice(s,1,{id:r.id,type:r.type,startIndex:r.startIndex,endIndex:t-1},{id:r.id,type:r.type,startIndex:t,endIndex:r.endIndex})})}function rC(e,t,n,r){e.customRanges||(e.customRanges=[]);const{customRanges:s}=e;zo(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=n,l.endIndex+=n)}const i=[];if(t.customRanges){for(let o=0,a=t.customRanges.length;o<a;o++){const l=t.customRanges[o];l.startIndex+=r,l.endIndex+=r,i.push(l)}s.push(...i)}e.customRanges=Vo(s)}function sC(e,t,n,r){e.customDecorations||(e.customDecorations=[]);const{customDecorations:s}=e;Go(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=n,l.endIndex+=n)}const i=[];if(t.customDecorations){for(let o=0,a=t.customDecorations.length;o<a;o++){const l=t.customDecorations[o];l.startIndex+=r,l.endIndex+=r,i.push(l)}s.push(...i)}e.customDecorations=sh(s)}function ih(e,t,n){const{textRuns:r}=e,s=n,i=n+t,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{st:h,ed:d}=u;if(s<=h&&i>=d){o.push({...u,st:h-s,ed:d-s});continue}else h<=s&&d>=i?(o.push({...u,st:s-s,ed:i-s}),u.ed-=t):s>=h&&s<d?(o.push({...u,st:s-s,ed:d-s}),u.ed=s):i>h&&i<=d?(o.push({...u,st:h-s,ed:i-s}),u.st=i-t,u.ed-=t):h>=i&&(u.st-=t,u.ed-=t);a.push(u)}e.textRuns=a}return o.length===0&&o.push({st:0,ed:t,ts:{}}),o}function oh(e,t,n){const{paragraphs:r}=e,s=n,i=n+t,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{startIndex:h}=u;if(h>=s&&h<i){o.push({...u,startIndex:h-n});continue}else h>=i&&(u.startIndex-=t);a.push(u)}e.paragraphs=a}return o}function ah(e,t,n){const{sectionBreaks:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{startIndex:h}=u;if(h>=s&&h<=i){o.push({...u,startIndex:h-n});continue}else h>i&&(u.startIndex-=t);a.push(u)}e.sectionBreaks=a}return o}function lh(e,t,n){const{customBlocks:r=[]}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{startIndex:h}=u;if(h>=s&&h<=i){o.push({...u,startIndex:h-n});continue}else h>i&&(u.startIndex-=t);a.push(u)}e.customBlocks=a}return r.length&&!e.customBlocks&&(e.customBlocks=r),o}function ch(e,t,n){const{tables:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{startIndex:h,endIndex:d}=u;if(s<=h&&i>=d){o.push({...u,startIndex:h-n,endIndex:d-n});continue}else if(h<=s&&d>=i){const m=js(h,d,s,i);if(m.length===0||(u.startIndex=m[0],u.endIndex=m[1],u.startIndex===u.endIndex))continue}else i<h&&(u.startIndex-=t,u.endIndex-=t);a.push(u)}e.tables=a}return o}function iC(e,t,n){const{customRanges:r}=e,s=n,i=n+t-1,o=[];if(r){const a=[];for(let l=0,c=r.length;l<c;l++){const u=r[l],{startIndex:h,endIndex:d}=u;if(h>=s&&d<=i){o.push(u);continue}else if(Math.max(s,h)<=Math.min(i,d)){const m=js(h,d,s,i);if(m.length===0)continue;u.startIndex=m[0],u.endIndex=m[1]}else i<h&&(u.startIndex-=t,u.endIndex-=t);a.push(u)}e.customRanges=Vo(a)}return o}function oC(e,t,n,r=!0){const{customDecorations:s}=e,i=n,o=n+t-1,a=[];if(s){const l=[];for(let c=0,u=s.length;c<u;c++){const h=s[c],{startIndex:d,endIndex:m}=h;if(d>=i&&m<=o){a.push(h);continue}else if(Math.max(i,d)<=Math.min(o,m)){const _=js(d,m,i,o);if(_.length===0)continue;h.startIndex=_[0],h.endIndex=_[1]}else o<d&&r&&(h.startIndex-=t,h.endIndex-=t);l.push(h)}e.customDecorations=l}return a}var uh=(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.BULLET_LIST="*",e))(uh||{}),xt=(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))(xt||{});const Xs={"a)":{glyphFormat:"%1)",glyphType:fe.DECIMAL},"1.":{glyphType:fe.DECIMAL},"a.":{glyphFormat:"%1.",glyphType:fe.LOWER_LETTER},"A.":{glyphType:fe.UPPER_LETTER},"i.":{glyphFormat:"%1.",glyphType:fe.LOWER_ROMAN},"I.":{glyphFormat:"%1.",glyphType:fe.UPPER_LETTER}},Gn=e=>[...e,...e,...e].map((t,n)=>({glyphFormat:` %${n+1}`,glyphSymbol:t,bulletAlignment:hr.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*n}}})),Kn=e=>e.map((t,n)=>({...t,bulletAlignment:hr.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*n}}})),hh=(e,t)=>new Array(9).fill(0).map((n,r)=>({glyphFormat:` %${r+1}`,glyphSymbol:e,bulletAlignment:hr.START,textStyle:{fs:16},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*r},textStyle:t}})),Pr={BULLET_LIST:{listType:"BULLET_LIST",nestingLevel:Gn(["●","○","■"])},BULLET_LIST_1:{listType:"BULLET_LIST",nestingLevel:Gn(["❖","➢","■"])},BULLET_LIST_2:{listType:"BULLET_LIST",nestingLevel:Gn(["✔","●","◆"])},BULLET_LIST_3:{listType:"BULLET_LIST",nestingLevel:Gn(["■","◆","○"])},BULLET_LIST_4:{listType:"BULLET_LIST",nestingLevel:Gn(["✧","○","■"])},BULLET_LIST_5:{listType:"BULLET_LIST",nestingLevel:Gn(["➢","○","◆"])},ORDER_LIST:{listType:"ORDER_LIST",nestingLevel:Kn([{glyphFormat:"%1.",glyphType:fe.DECIMAL},{glyphFormat:"%2.",glyphType:fe.LOWER_LETTER},{glyphFormat:"%3.",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:fe.DECIMAL},{glyphFormat:"%5.",glyphType:fe.LOWER_LETTER},{glyphFormat:"%6.",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:fe.DECIMAL},{glyphFormat:"%8.",glyphType:fe.LOWER_LETTER},{glyphFormat:"%9.",glyphType:fe.LOWER_ROMAN}])},ORDER_LIST_1:{listType:"ORDER_LIST",nestingLevel:Kn([{glyphFormat:"%1)",glyphType:fe.DECIMAL},{glyphFormat:"%2)",glyphType:fe.LOWER_LETTER},{glyphFormat:"%3)",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%4)",glyphType:fe.DECIMAL},{glyphFormat:"%5)",glyphType:fe.LOWER_LETTER},{glyphFormat:"%6)",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%7)",glyphType:fe.DECIMAL},{glyphFormat:"%8)",glyphType:fe.LOWER_LETTER},{glyphFormat:"%9)",glyphType:fe.LOWER_ROMAN}])},ORDER_LIST_2:{listType:"ORDER_LIST",nestingLevel:Kn(["%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:fe.DECIMAL})))},ORDER_LIST_3:{listType:"ORDER_LIST",nestingLevel:Kn([{glyphFormat:"%1.",glyphType:fe.UPPER_LETTER},{glyphFormat:"%2.",glyphType:fe.LOWER_LETTER},{glyphFormat:"%3.",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:fe.UPPER_LETTER},{glyphFormat:"%5.",glyphType:fe.LOWER_LETTER},{glyphFormat:"%6.",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:fe.UPPER_LETTER},{glyphFormat:"%8.",glyphType:fe.LOWER_LETTER},{glyphFormat:"%9.",glyphType:fe.LOWER_ROMAN}])},ORDER_LIST_4:{listType:"ORDER_LIST",nestingLevel:Kn([{glyphFormat:"%1.",glyphType:fe.UPPER_LETTER},{glyphFormat:"%2.",glyphType:fe.DECIMAL},{glyphFormat:"%3.",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:fe.UPPER_LETTER},{glyphFormat:"%5.",glyphType:fe.DECIMAL},{glyphFormat:"%6.",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:fe.UPPER_LETTER},{glyphFormat:"%8.",glyphType:fe.DECIMAL},{glyphFormat:"%9.",glyphType:fe.LOWER_ROMAN}])},ORDER_LIST_5:{listType:"ORDER_LIST",nestingLevel:Kn([{glyphFormat:"%1.",glyphType:fe.DECIMAL_ZERO},{glyphFormat:"%2.",glyphType:fe.LOWER_LETTER},{glyphFormat:"%3.",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%4.",glyphType:fe.DECIMAL_ZERO},{glyphFormat:"%5.",glyphType:fe.LOWER_LETTER},{glyphFormat:"%6.",glyphType:fe.LOWER_ROMAN},{glyphFormat:"%7.",glyphType:fe.DECIMAL_ZERO},{glyphFormat:"%8.",glyphType:fe.LOWER_LETTER},{glyphFormat:"%9.",glyphType:fe.LOWER_ROMAN}])},CHECK_LIST:{listType:"CHECK_LIST",nestingLevel:hh("☐")},CHECK_LIST_CHECKED:{listType:"CHECK_LIST_CHECKED",nestingLevel:hh("☑",{st:{s:ae.TRUE}})}},qs=e=>{const{glyphFormat:t,glyphType:n}=e,r=Z.deepClone(Pr.ORDER_LIST);return r.nestingLevel[0].glyphFormat=t,r.nestingLevel[0].glyphType=n,r},aC={ORDER_LIST_QUICK_2:qs(Xs["a)"]),ORDER_LIST_QUICK_3:qs(Xs["a."]),ORDER_LIST_QUICK_4:qs(Xs["i."]),ORDER_LIST_QUICK_6:qs(Xs["I."])};Object.assign(Pr,aC);const lC={"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","*":"BULLET_LIST"};function cC(e,t,n,r,s){const i=uC(e,t,n,r,s),o=hC(e,t,n,r,s),a=dC(e,t,n,r,s),l=fC(e,t,n,r,s),c=mC(e,t,n,r,s),u=gC(e,t,n,r),h=_C(e,t,n,r,s);return{dataStream:"",textRuns:i,paragraphs:o,sectionBreaks:a,customBlocks:l,tables:c,customRanges:u,customDecorations:h}}function uC(e,t,n,r,s){const{textRuns:i}=e,{textRuns:o}=t;if(i==null||o==null)return;const a=ih(e,n,r);if(s!==Re.REPLACE){const l=dh(o,a,s);t.textRuns=l}return Ju(e,t,n,r),a}function dh(e,t,n){if(t.length===0)return e;e=Z.deepClone(e),t=Z.deepClone(t);const r=[],s=e.length,i=t.length;let o=0,a=0,l=null;function c(){return l?(r.push(l),l=null,!0):!1}for(;o<s&&a<i;){const{st:m,ed:_,ts:p}=e[o],{st:I,ed:y,ts:H,sId:x}=t[a];let Y;if(n===Re.COVER?Y={...H,...p}:Y={...p},_<I)c()||r.push(e[o]),o++;else if(y<m)c()||r.push(t[a]),a++;else{const O={st:Math.min(m,I),ed:Math.max(m,I),ts:m<I?{...p}:{...H},sId:m<I?void 0:x};O.ed>O.st&&r.push(O),r.push({st:Math.max(m,I),ed:Math.min(_,y),ts:Y,sId:x}),_<y?(o++,t[a].st=_,t[a].st===t[a].ed&&a++):(a++,e[o].st=y,e[o].st===e[o].ed&&o++);const R={st:Math.min(_,y),ed:Math.max(_,y),ts:_<y?{...H}:{...p},sId:_<y?x:void 0};l=R.ed>R.st?R:null}}c();const u=r[r.length-1],h=e[s-1],d=t[i-1];return u&&u.ed!==Math.max(h.ed,d.ed)&&(h.ed>d.ed?r.push(h):r.push(d)),Ur(r)}function hC(e,t,n,r,s){const{paragraphs:i}=e,{paragraphs:o}=t;if(i==null||o==null)return;const a=oh(e,n,r);if(s!==Re.REPLACE){const l=[];for(const c of o){const{startIndex:u,paragraphStyle:h,bullet:d}=c;let m=[];for(const _ of a){const{startIndex:p,paragraphStyle:I,bullet:y}=_;let H,x;if(s===Re.COVER?(H={...I,...h},x={listId:"",listType:xt.BULLET_LIST,nestingLevel:0,textStyle:{},...y,...d}):(H={...h,...I},x={listId:"",listType:xt.BULLET_LIST,nestingLevel:0,textStyle:{},...d,...y}),u===p){m.push({startIndex:u,paragraphStyle:H,bullet:x});break}}l.push(...m),m=[]}t.paragraphs=l}return Zu(e,t,n,r),a}function dC(e,t,n,r,s){const{sectionBreaks:i}=e,{sectionBreaks:o}=t;if(i==null||o==null)return;const a=ah(e,n,r);if(s!==Re.REPLACE){const l=[];for(const c of o){const{startIndex:u}=c;let h=[];for(const d of a){const{startIndex:m}=d;if(u===m){s===Re.COVER?h.push({...d,...c}):h.push({...c,...d});break}}l.push(...h),h=[]}t.sectionBreaks=l}return Qu(e,t,n,r),a}function fC(e,t,n,r,s){const{customBlocks:i=[]}=e,{customBlocks:o}=t;if(i==null||o==null)return;const a=lh(e,n,r);if(s!==Re.REPLACE){const l=[];for(const c of o){const{startIndex:u}=c;let h=[];for(const d of a){const{startIndex:m}=d;if(u===m){s===Re.COVER?h.push({...d,...c}):h.push({...c,...d});break}}l.push(...h),h=[]}t.customBlocks=l}return eh(e,t,n,r),i.length&&!e.customBlocks&&(e.customBlocks=i),a}function mC(e,t,n,r,s){const{tables:i}=e,{tables:o}=t;if(i==null||o==null)return;const a=ch(e,n,r);if(s!==Re.REPLACE){const l=[];for(const c of o){const{startIndex:u,endIndex:h}=c;let d=[];for(const m of a){const{startIndex:_,endIndex:p}=m;if(_>=u&&p<=h){s===Re.COVER?d.push({...m,...c}):d.push({...c,...m});break}}l.push(...d),d=[]}t.tables=l}return th(e,t,n,r),a}function gC(e,t,n,r,s){e.customRanges||(e.customRanges=[]),zo(e.customRanges,r),zo(e.customRanges,r+n);const i=r,o=r+n-1,{customRanges:a}=t,l=[],c=new Map;e.customRanges.forEach(h=>{const{startIndex:d,endIndex:m}=h;d>=i&&m<=o?c.set(h.rangeId,h):l.push(h)});const u=[];return a?(a.forEach(h=>{const{startIndex:d,endIndex:m}=h;l.push({...h,startIndex:d+r,endIndex:m+r})}),e.customRanges=Vo(l),u):[]}function _C(e,t,n,r,s){e.customDecorations||(e.customDecorations=[]),Go(e.customDecorations,r),Go(e.customDecorations,r+n);const i=[],{customDecorations:o}=e,{customDecorations:a=[]}=t;if(s===Re.REPLACE){for(let l=0;l<o.length;l++){const c=o[l],{startIndex:u,endIndex:h}=c;u>=r&&h<=r+n-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===_n.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=sh(o),i}var Ko=(e=>(e[e.copy=0]="copy",e[e.cut=1]="cut",e))(Ko||{});function Js(e,t,n,r=!0){const{textRuns:s}=e;if(s){const i=[];for(const o of s){const a=Z.deepClone(o),{st:l,ed:c}=a;Z.hasIntersectionBetweenTwoRanges(l,c,t,n)&&(t>=l&&t<=c?i.push({...a,st:t,ed:Math.min(n,c)}):n>=l&&n<=c?i.push({...a,st:Math.max(t,l),ed:n}):i.push(a))}return Ur(i.map(o=>{const{st:a,ed:l}=o;return{...o,st:a-t,ed:l-t}}))}else if(r)return[{st:0,ed:n-t,ts:{}}]}function fh(e,t,n){const{tables:r=[]}=e,s=[];for(const i of r){const o=Z.deepClone(i),{startIndex:a,endIndex:l}=o;a>=t&&l<=n&&s.push({...o,startIndex:a-t,endIndex:l-t})}return s}function mh(e,t,n){const{paragraphs:r=[]}=e,s=[];for(const i of r){const{startIndex:o}=i;if(o>=t&&o<n){const a=Z.deepClone(i);s.push(a)}}if(s.length)return s.map(i=>({...i,startIndex:i.startIndex-t}))}function pC(e,t,n){const{sectionBreaks:r=[]}=e,s=[];for(const i of r){const{startIndex:o}=i;o>=t&&o<=n&&s.push(Z.deepClone(i))}if(s.length)return s.map(i=>({...i,startIndex:i.startIndex-t}))}function gh(e,t,n){const{customBlocks:r=[]}=e,s=[];for(const i of r){const{startIndex:o}=i;o>=t&&o<n&&s.push(Z.deepClone(i))}if(s.length)return s.map(i=>({...i,startIndex:i.startIndex-t}))}function At(e,t,n,r=!0,s=1){const{dataStream:i}=e,o={dataStream:i.slice(t,n)};o.textRuns=Js(e,t,n,r);const a=fh(e,t,n);if(a.length&&(o.tables=a),o.paragraphs=mh(e,t,n),s===1){const c=ph(e,t,n);c?o.customDecorations=c:r&&(o.customDecorations=[])}const{customRanges:l}=_h(e,t,n);return l?o.customRanges=l:r&&(o.customRanges=[]),o.customBlocks=gh(e,t,n),o}function EC(e){const{dataStream:t,textRuns:n,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>t.length-1&&(l=Math.max(l,u.endIndex-t.length+1))});const c=`${t}`;return n&&(n[0]&&(n[0].st=n[0].st-a),n[n.length-1]&&(n[n.length-1].ed=n[n.length-1].ed+l)),n==null||n.forEach(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:n,paragraphs:r,customRanges:s,customDecorations:i,tables:o}}function _h(e,t,n){if(e.customRanges==null)return{};const{customRanges:r}=e;return{customRanges:r.filter(a=>Math.max(a.startIndex,t)<=Math.min(a.endIndex,n-1)).map(a=>({...a,startIndex:Math.max(a.startIndex,t),endIndex:Math.min(a.endIndex,n-1)})).map(a=>({...a,startIndex:a.startIndex-t,endIndex:a.endIndex-t})),leftOffset:0,rightOffset:0}}function ph(e,t,n){if(e.customDecorations==null)return;const{customDecorations:r=[]}=e,s=[];return r.forEach(i=>{if(Math.max(i.startIndex,t)<=Math.min(i.endIndex,n-1)){const o=Z.deepClone(i);s.push({...o,startIndex:Math.max(o.startIndex-t,0),endIndex:Math.min(o.endIndex,n-1)-t})}}),s}function CC(e,t,n){return e==null||t==null?e!=null?e:t:dh(e,t,n)}function RC(e,t,n){if(e==null||t==null)return e!=null?e:t;if(t.length===0||e.length===0)return e;if(t.length>1||e.length>1)throw new Error("Cannot cover multiple customRanges");return n===Re.REPLACE?[{...e[0]}]:[{...t[0],...e[0]}]}function IC(e,t,n){return t.length===0||e.length===0||n===Re.REPLACE?e:[...e,...t.filter(r=>!e.some(s=>r.id===s.id))]}function Xo(e,t,n=Re.COVER){if(t.dataStream!=="")throw new Error("Cannot compose other body with non-empty dataStream");const r={dataStream:e.dataStream},{textRuns:s,paragraphs:i=[],customRanges:o,customDecorations:a=[]}=e,{textRuns:l,paragraphs:c=[],customRanges:u,customDecorations:h=[]}=t;r.textRuns=CC(l,s,n),r.customRanges=RC(u,o,n);const d=IC(h,a,n);d.length&&(r.customDecorations=d);const m=[];let _=0,p=0;for(;_<i.length&&p<c.length;){const I=i[_],y=c[p],{startIndex:H}=I,{startIndex:x}=y;H===x?(m.push(Z.deepMerge(I,y)),_++,p++):H<x?(m.push(Z.deepClone(I)),_++):(m.push(Z.deepClone(y)),p++)}return _<i.length&&m.push(...i.slice(_)),p<c.length&&m.push(...c.slice(p)),m.length&&(r.paragraphs=m),r}function SC(e){const{body:t}=e;if(t==null)return!0;const{textRuns:n,paragraphs:r,customRanges:s,customBlocks:i,customDecorations:o,tables:a}=t;return n==null&&r==null&&s==null&&i==null&&o==null&&a==null}class Xn{constructor(t){E(this,"_index",0);E(this,"_offset",0);this._actions=t}hasNext(){return this.peekLength()<Number.POSITIVE_INFINITY}next(t){t||(t=Number.POSITIVE_INFINITY);const n=this._actions[this._index];if(n){const r=this._offset,s=n.len;return t>=s-r?(t=s-r,this._index+=1,this._offset=0):this._offset+=t,n.t===J.DELETE||n.t===J.RETAIN&&n.body==null?Z.deepClone({...n,len:t}):Z.deepClone({...n,len:t,body:At(n.body,r,r+t,!1)})}else return{t:J.RETAIN,len:Number.POSITIVE_INFINITY}}peek(){return this._actions[this._index]}peekLength(){return this._actions[this._index]?this._actions[this._index].len-this._offset:Number.POSITIVE_INFINITY}peekType(){const t=this._actions[this._index];return t?t.t:J.RETAIN}rest(){if(this.hasNext()){if(this._offset===0)return this._actions.slice(this._index);{const t=this._offset,n=this._index,r=this.next(),s=this._actions.slice(this._index);return this._offset=t,this._index=n,[r].concat(s)}}else return[]}}function Eh(e,t,n){const{dataStream:r}=e,s=n,i=n+t,o=ih(e,t,n),a=oh(e,t,n),l=ah(e,t,n),c=lh(e,t,n),u=ch(e,t,n),h=iC(e,t,n),d=oC(e,t,n);let m="";return r&&(e.dataStream=Hu(r,s,i),m=r.slice(s,i)),{dataStream:m,textRuns:o,paragraphs:a,sectionBreaks:l,customBlocks:c,tables:u,customRanges:h,customDecorations:d}}function Ch(e,t,n,r){e.dataStream=xu(e.dataStream,r,t.dataStream),Ju(e,t,n,r),Zu(e,t,n,r),Qu(e,t,n,r),eh(e,t,n,r),th(e,t,n,r),rC(e,t,n,r),sC(e,t,n,r)}function OC(e,t,n,r,s=Re.COVER){return cC(e,t,n,r,s)}function vC(e,t,n){return t<=0?{dataStream:""}:Eh(e,t,n)}function wC(e,t,n,r){n!==0&&Ch(e,t,n,r)}function bC(e,t){const n=new fn;return n.reset(),t.forEach(r=>{const s=Z.deepClone(r);switch(s.t){case J.RETAIN:{const{coverType:i,body:o,len:a}=s;o!=null&&OC(e,o,a,n.cursor,i),n.moveCursor(a);break}case J.INSERT:{const{body:i,len:o}=s;wC(e,i,o,n.cursor),n.moveCursor(o);break}case J.DELETE:{const{len:i}=s;vC(e,i,n.cursor);break}default:throw new Error(`Unknown action type for action: ${s}.`)}}),e}function yC(e,t,n,r,s){if(e==null||t==null)return t;if(e.length===0||t.length===0)return[];t=Z.deepClone(t),e=Z.deepClone(e);const i=[],o=t.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:p,ed:I,ts:y}=t[l],{st:H,ed:x,ts:Y,sId:O}=e[c];let R={};if(s===0)R={...y},n===Re.COVER&&r===Re.REPLACE&&Y&&(R=Object.assign({},Y,R));else if(R={...y},n===Re.REPLACE){if(r===Re.REPLACE)R={...Y};else if(y&&Y){const b=Object.keys(y);for(const T of b)Y[T]&&delete R[T]}}else if(r===Re.REPLACE){if(Y){const b=Object.keys(Y);for(const T of b)Y[T]!==void 0&&(R[T]=Y[T])}}else if(Y){const b=Object.keys(Y);for(const T of b)R[T]!==void 0&&delete R[T]}if(I<H)h()||i.push(t[l]),l++;else if(x<p)h()||i.push(e[c]),c++;else{const b={st:Math.min(p,H),ed:Math.max(p,H),ts:p<H?{...y}:{...Y}};b.ed>b.st&&i.push(),i.push({st:Math.max(p,H),ed:Math.min(I,x),ts:R,sId:O}),I<x?(l++,e[c].st=I,e[c].st===e[c].ed&&c++):(c++,t[l].st=x,t[l].st===t[l].ed&&l++);const T={st:Math.min(I,x),ed:Math.max(I,x),ts:I<x?{...Y}:{...y},sId:I<x?O:void 0};u=T.ed>T.st?T:null}}h();const d=i[i.length-1],m=t[o-1],_=e[a-1];return d.ed!==Math.max(m.ed,_.ed)&&(m.ed>_.ed?i.push(m):i.push(_)),Ur(i,!0)}function AC(e,t,n,r,s){if(e==null||t==null)return t;if(e.length===0||t.length===0)return[];if(e.length>1||t.length>1)throw new Error("CustomRanges is only supported transform for length one now.");const i=e[0],o=t[0];if(n===Re.REPLACE)return s===1?[Z.deepClone(i)]:[Z.deepClone(o)];if(r===Re.REPLACE){const a=Z.deepClone(o);return s===1&&Object.assign(a,Z.deepClone(i)),[a]}else{const a=Z.deepClone(o);return s===1&&Object.assign(a,Z.deepClone(i)),[a]}}function Rh(e,t,n,r,s){const i={startIndex:t.startIndex};if(t.paragraphStyle&&(i.paragraphStyle=Z.deepClone(t.paragraphStyle),e.paragraphStyle)){if(n===Re.REPLACE)if(r===Re.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===Re.REPLACE)if(s===1){const o=Object.keys(e.paragraphStyle);for(const a of o)e.paragraphStyle[a]!==void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else{const o=Object.keys(e.paragraphStyle);for(const a of o)i.paragraphStyle[a]===void 0&&(i.paragraphStyle[a]=e.paragraphStyle[a])}else if(s===1){const o=Object.keys(e.paragraphStyle);for(const a of o)i.paragraphStyle[a]&&delete i.paragraphStyle[a]}}return n===Re.REPLACE&&r===Re.REPLACE?i.bullet=s===1?Z.deepClone(e.bullet):Z.deepClone(t.bullet):e.bullet===void 0?i.bullet=Z.deepClone(t.bullet):n===Re.REPLACE||r===Re.REPLACE?i.bullet=s===0&&t.bullet?Z.deepClone(t.bullet):Z.deepClone(e.bullet):s===0&&t.bullet!==void 0&&(i.bullet=Z.deepClone(t.bullet)),i}function TC(e,t){if(e==null||t==null)return t;if(e.length===0||t.length===0)return Z.deepClone(t);const n=[];for(const r of t){const{id:s,type:i}=r;let o=!1;for(const a of e)if(a.id===s){(a.type===_n.DELETED||i===_n.DELETED)&&(o=!0,n.push({...r,type:_n.DELETED}));break}o||n.push(r)}return n}function NC(e,t,n=!1){const{body:r,coverType:s=Re.COVER}=e,{body:i,coverType:o=Re.COVER}=t;if(r==null||r.dataStream!==""||i==null||i.dataStream!=="")throw new Error("Data stream is not supported in retain transform.");const a={dataStream:""},l=o,{textRuns:c,paragraphs:u=[],customRanges:h,customDecorations:d}=r,{textRuns:m,paragraphs:_=[],customRanges:p,customDecorations:I}=i,y=yC(c,m,s,o,n?1:0);y&&(a.textRuns=y);const H=AC(h,p,s,o,n?1:0);H&&(a.customRanges=H);const x=TC(d,I);x&&(a.customDecorations=x);const Y=[];let O=0,R=0;for(;O<u.length&&R<_.length;){const b=u[O],T=_[R],{startIndex:B}=b,{startIndex:$}=T;if(B===$){let g={startIndex:B};n?g=Rh(b,T,s,o,1):g=Rh(b,T,s,o,0),Y.push(g),O++,R++}else B<$?O++:(Y.push(Z.deepClone(T)),R++)}return R<_.length&&Y.push(..._.slice(R)),Y.length&&(a.paragraphs=Y),{coverType:l,body:a}}function Ih(e){return Object.keys(e).length===1}const Qn=class Qn{constructor(){E(this,"_actions",[])}static apply(t,n){return bC(t,n)}static compose(t,n){const r=new Xn(t),s=new Xn(n),i=new Qn;for(;r.hasNext()||s.hasNext();)if(s.peekType()===J.INSERT)i.push(s.next());else if(r.peekType()===J.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===J.INSERT&&l.t===J.RETAIN)l.body==null?i.push(a):i.push({...a,body:Xo(a.body,l.body,l.coverType)});else if(a.t===J.RETAIN&&l.t===J.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===Re.REPLACE||l.coverType===Re.REPLACE?Re.REPLACE:Re.COVER;i.push({...a,t:J.RETAIN,coverType:c,body:Xo(a.body,l.body,l.coverType)})}else i.push(a.body?a:l);else a.t===J.RETAIN&&l.t===J.DELETE?i.push(l):a.t===J.INSERT&&(l.t,J.DELETE)}return i.trimEndUselessRetainAction(),i.serialize()}static transform(t,n,r="right"){return this._transform(n,t,r==="left"?"right":"left")}static _transform(t,n,r="right"){const s=new Xn(t),i=new Xn(n),o=new Qn;for(;s.hasNext()||i.hasNext();)if(s.peekType()===J.INSERT&&(r==="left"||i.peekType()!==J.INSERT)){const a=s.next();o.retain(a.len)}else if(i.peekType()===J.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===J.DELETE)continue;if(c.t===J.DELETE){o.push(c);continue}if(l.body==null||c.body==null)o.push(c);else{const{coverType:u,body:h}=NC(l,c,r==="left");o.push({...c,t:J.RETAIN,coverType:u,body:h})}}return o.trimEndUselessRetainAction(),o.serialize()}static transformPosition(t,n,r=!1){const s=new Xn(t);let i=0;for(;s.hasNext()&&i<=n;){const o=s.peekLength(),a=s.peekType();if(s.next(),a===J.DELETE){n-=Math.min(o,n-i);continue}else a===J.INSERT&&(i<n||!r)&&(n+=o);i+=o}return n}static isNoop(t){return t.length===0}static invert(t){const n=[];for(const r of t)if(r.t===J.INSERT)n.push({t:J.DELETE,len:r.len,body:r.body});else if(r.t===J.DELETE){if(r.body==null)throw new Error("Can not invert DELETE action without body property, makeInvertible must be called first.");n.push({t:J.INSERT,body:r.body,len:r.len})}else if(r.body!=null){if(r.oldBody==null)throw new Error("Can not invert RETAIN action without oldBody property, makeInvertible must be called first.");n.push({t:J.RETAIN,body:r.oldBody,oldBody:r.body,len:r.len,coverType:Re.REPLACE})}else n.push(r);return n}static makeInvertible(t,n){const r=[];let s=0;for(const i of t){if(i.t===J.DELETE&&(i.body==null||i.body&&i.body.dataStream.length!==i.len)){const o=At(n,s,s+i.len,!1);i.len=o.dataStream.length,i.body=o}if(i.t===J.RETAIN&&i.body!=null){const o=At(n,s,s+i.len,!0);i.oldBody={...o,dataStream:""},i.len=o.dataStream.length}r.push(i),i.t!==J.INSERT&&(s+=i.len)}return r}insert(t,n){const r={t:J.INSERT,body:n,len:t};return this.push(r),this}retain(t,n,r){const s={t:J.RETAIN,len:t};return n!=null&&(s.body=n),r!=null&&(s.coverType=r),this.push(s),this}delete(t){const n={t:J.DELETE,len:t};return this.push(n),this}empty(){return this._actions=[],this}serialize(){return this._actions}push(...t){if(t.length>1){for(const i of t)this.push(i);return this}let n=this._actions.length,r=this._actions[n-1];const s=Z.deepClone(t[0]);if(s.t===J.RETAIN&&s.len===0&&s.body==null)return this;if(typeof r=="object"){if(r.t===J.DELETE&&s.t===J.DELETE)return r.len+=s.len,this;if(r.t===J.DELETE&&s.t===J.INSERT&&(n-=1,r=this._actions[n-1],r==null))return this._actions.unshift(s),this;if(r.t===J.RETAIN&&s.t===J.RETAIN&&r.body==null&&s.body==null)return r.len+=s.len,this;if(r.t===J.INSERT&&Ih(r.body)&&s.t===J.INSERT&&Ih(s.body))return r.len+=s.len,r.body.dataStream+=s.body.dataStream,this}return n===this._actions.length?this._actions.push(s):this._actions.splice(n,0,s),this}trimEndUselessRetainAction(){let t=this._actions[this._actions.length-1];for(;t&&t.t===J.RETAIN&&SC(t);)this._actions.pop(),t=this._actions[this._actions.length-1];return this}};E(Qn,"id","text-x"),E(Qn,"uri","https://github.com/dream-num/univer#text-x");let De=Qn;Object.defineProperty(De,"name",{value:"text-x"});const er=class er{static registerSubtype(t){var n;t==null||this._subTypes.has(t.name)&&((n=this._subTypes.get(t.name))==null?void 0:n.id)!==De.id||(this._subTypes.set(t.name,t),lt.type.registerSubtype(t))}static apply(t,n){if(!lt.type.isNoop(n))return lt.type.apply(t,n)}static compose(t,n){return lt.type.compose(t,n)}static transform(t,n,r){return lt.type.transform(t,n,r)}static transformPosition(t,n,r="right"){return t&&t.length===2&&t[0]==="body"&&t[1].et===De.name?De.transformPosition(t[1].e,n,r==="left"):n}static invertWithDoc(t,n){return lt.type.invertWithDoc(t,n)}static isNoop(t){return lt.type.isNoop(t)}static getInstance(){return this._instance==null&&(this._instance=new er),this._instance}removeOp(t,n){return lt.removeOp(t,n)}moveOp(t,n){return lt.moveOp(t,n)}insertOp(t,n){return lt.insertOp(t,n)}replaceOp(t,n,r){return lt.replaceOp(t,n,r)}editOp(t,n=["body"]){return lt.editOp(n,De.name,t)}};E(er,"uri","https://github.com/dream-num/univer#json-x"),E(er,"_subTypes",new Map),E(er,"_instance",null);let Vt=er;Vt.registerSubtype(De);var Sh=(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))(Sh||{}),ut=(e=>(e.PARAGRAPH="\r",e.SECTION_BREAK=`
5
+ `,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))(ut||{});function MC(e){return`${e}`}const DC=[ut.TABLE_START,ut.TABLE_ROW_START,ut.TABLE_CELL_START,ut.TABLE_CELL_END,ut.TABLE_ROW_END,ut.TABLE_END],Zs=e=>{const t=e.endsWith(`\r
6
+ `)?e.slice(0,-2):e;return DC.reduce((n,r)=>n.replaceAll(r,""),t)},LC=e=>e?Zs(e).replaceAll("\r","")==="":!0,UC=e=>{const t=e.replace(/\n/g,"\r"),n=[],r=[];let s=0,i="";const o=(l,c=!0)=>{const u=t.slice(s,l);if(Z.isLegalUrl(u)){const h=nt(),d=`${u}`,m={startIndex:s,endIndex:s+d.length-1,rangeId:h,rangeType:en.HYPERLINK,properties:{url:e}};r.push(m),i+=d,s=l+1,c&&(i+="\r",n.push({startIndex:l}))}else i+=t.slice(s,l+1),s=l+1,c&&n.push({startIndex:l})};let a=0;for(let l=0;l<t.length;l++)t[l]==="\r"&&(o(l),a=l);return(a!==t.length-1||t.length===1)&&o(t.length,!1),{dataStream:i,paragraphs:n,customRanges:r}},qo={id:"default_doc",documentStyle:{}};class PC extends os{constructor(n){var r;super();E(this,"type",we.UNIVER_DOC);E(this,"_name$",new se.BehaviorSubject(""));E(this,"name$",this._name$.asObservable());E(this,"snapshot");this.snapshot={...qo,...n},this._name$.next((r=this.snapshot.title)!=null?r:"No Title")}getUnitId(){throw new Error("Method not implemented.")}getRev(){var n;return(n=this.snapshot.rev)!=null?n:1}incrementRev(){this.snapshot.rev=this.getRev()+1}setRev(n){this.snapshot.rev=n}setName(n){this.snapshot.title=n,this._name$.next(n)}get drawings(){return this.snapshot.drawings}get documentStyle(){return this.snapshot.documentStyle}get lists(){return this.snapshot.lists}get zoomRatio(){var n;return((n=this.snapshot.settings)==null?void 0:n.zoomRatio)||1}resetDrawing(n,r){this.snapshot.drawings=n,this.snapshot.drawingsOrder=r}getBody(){return this.snapshot.body}getSnapshot(){return this.snapshot}getBulletPresetList(){var s;const n=(s=this.snapshot.lists)!=null?s:{};return{...Pr,...n}}updateDocumentId(n){this.snapshot.id=n}updateDocumentRenderConfig(n){const{documentStyle:r}=this.snapshot;r.renderConfig==null?r.renderConfig=n:r.renderConfig={...r.renderConfig,...n}}getDocumentStyle(){return this.snapshot.documentStyle}updateDocumentStyle(n){this.snapshot.documentStyle==null?this.snapshot.documentStyle=n:this.snapshot.documentStyle={...this.snapshot.documentStyle,...n}}updateDocumentDataMargin(n){const{t:r,l:s,b:i,r:o}=n,{documentStyle:a}=this.snapshot;r!=null&&(a.marginTop=r),s!=null&&(a.marginLeft=s),i!=null&&(a.marginBottom=i),o!=null&&(a.marginRight=o)}updateDocumentDataPageSize(n,r){const{documentStyle:s}=this.snapshot;if(!s.pageSize){s.pageSize={width:n!=null?n:Number.POSITIVE_INFINITY,height:r!=null?r:Number.POSITIVE_INFINITY};return}n!==void 0&&(s.pageSize.width=n),r!==void 0&&(s.pageSize.height=r)}updateDrawing(n,r){const{drawings:s}=this,{width:i,height:o,left:a,top:l}=r,c=s==null?void 0:s[n];if(!c)return;const u=c.docTransform;u.size.width=i,u.size.height=o,u.positionH.posOffset=a,u.positionV.posOffset=l}setZoomRatio(n=1){this.snapshot.settings?this.snapshot.settings.zoomRatio=n:this.snapshot.settings={zoomRatio:n}}setDisabled(n){this.snapshot.disabled=n}getDisabled(){return this.snapshot.disabled}getTitle(){return this.snapshot.title}}class Tt extends PC{constructor(n){var s,i;super(Z.isEmptyObject(n)?U_():n);E(this,"_unitId");E(this,"headerModelMap",new Map);E(this,"footerModelMap",new Map);E(this,"change$",new se.BehaviorSubject(0));const r=6;this._unitId=(s=this.snapshot.id)!=null?s:nt(r),this._initializeHeaderFooterModel(),this._name$.next((i=this.snapshot.title)!=null?i:"")}dispose(){super.dispose(),this.headerModelMap.forEach(n=>{n.dispose()}),this.footerModelMap.forEach(n=>{n.dispose()}),this._name$.complete()}getDrawings(){return this.snapshot.drawings}getDrawingsOrder(){return this.snapshot.drawingsOrder}getCustomRanges(){var n;return(n=this.snapshot.body)==null?void 0:n.customRanges}getCustomDecorations(){var n;return(n=this.snapshot.body)==null?void 0:n.customDecorations}getSettings(){return this.snapshot.settings}reset(n){if(n.id&&n.id!==this._unitId)throw new Error("Cannot reset a document model with a different unit id!");this.snapshot={...qo,...n},this._initializeHeaderFooterModel(),this.change$.next(this.change$.value+1)}getSelfOrHeaderFooterModel(n){if(n!=null){if(this.headerModelMap.has(n))return this.headerModelMap.get(n);if(this.footerModelMap.has(n))return this.footerModelMap.get(n)}return this}getUnitId(){return this._unitId}apply(n){if(!Vt.isNoop(n))return this.snapshot=Vt.apply(this.snapshot,n),n!=null&&n.some(r=>Array.isArray(r)&&((r==null?void 0:r[0])==="headers"||(r==null?void 0:r[0])==="footers"))&&(this.headerModelMap.clear(),this.footerModelMap.clear(),this._initializeHeaderFooterModel()),this.change$.next(this.change$.value+1),this.snapshot}sliceBody(n,r,s=Ko.copy){const i=this.getBody();if(i!=null)return At(i,n,r,!1,s)}_initializeHeaderFooterModel(){const{headers:n,footers:r}=this.getSnapshot();if(n)for(const s in n){const i=n[s];this.headerModelMap.set(s,new Tt(i)),this.headerModelMap.get(s).updateDocumentId(this.getUnitId())}if(r)for(const s in r){const i=r[s];this.footerModelMap.set(s,new Tt(i)),this.footerModelMap.get(s).updateDocumentId(this.getUnitId())}}updateDocumentId(n){super.updateDocumentId(n),this._unitId=n}getPlainText(){var n,r;return Zs((r=(n=this.getBody())==null?void 0:n.dataStream)!=null?r:"")}}function kC(e){const{ranges:t,id:n,type:r}=e,s=new De;let i=0;for(let o=0;o<t.length;o++){const a=t[o],{startOffset:l,endOffset:c}=a;l>0&&s.push({t:J.RETAIN,len:l-i}),s.push({t:J.RETAIN,body:{dataStream:"",customDecorations:[{id:n,type:r,startIndex:0,endIndex:c-l-1}]},len:c-l}),i=c}return s}function FC(e){var u,h,d;const{id:t,segmentId:n,documentDataModel:r}=e,s=r==null?void 0:r.getBody();if(!r||!s)return!1;const i=(d=(h=(u=r.getSelfOrHeaderFooterModel(n))==null?void 0:u.getBody())==null?void 0:h.customDecorations)==null?void 0:d.find(m=>m.id===t);if(!i)return!1;const o=new De,{startIndex:a,endIndex:l}=i,c=l-a+1;return o.push({t:J.RETAIN,len:a}),o.push({t:J.RETAIN,len:c,body:{dataStream:"",customDecorations:[{startIndex:0,endIndex:c-1,id:t,type:_n.DELETED}]}}),o}function Oh(e,t,n,r){return e<=n&&t>=n||e>=n&&e<=r}function xC(e,t){const n=[];for(let r=0,s=t.length;r<s;r++){const i=t[r];e.collapsed?i.startIndex<e.startOffset&&e.startOffset<=i.endIndex&&n.push(i):Oh(e.startOffset,e.endOffset-1,i.startIndex,i.endIndex)&&n.push(i)}return n}function HC(e){return{...Z.deepClone(e),rangeId:nt()}}function BC(e,t){const n=[];let r=e[0];for(const s of t)s<e[0]||s>e[1]||(r<s&&n.push([r,s-1]),r=s+1);return r<=e[1]&&n.push([r,e[1]]),n}function vh(e,t,n,r){const s=[];for(let i=0,o=n.length;i<o;i++){const a=n[i];if((r===void 0||a.rangeType===r)&&Math.max(a.startIndex,e)<=Math.min(a.endIndex,t)&&s.push({...a}),a.startIndex>t)break}return s}function $C(e,t){var i,o,a,l,c;const n=vh(e.startOffset,e.collapsed?e.startOffset:e.endOffset-1,(i=t.customRanges)!=null?i:[]),r=Math.min(e.startOffset,(a=(o=n[0])==null?void 0:o.startIndex)!=null?a:1/0),s=Math.max(e.endOffset,((c=(l=n[n.length-1])==null?void 0:l.endIndex)!=null?c:-1/0)+1);return{startOffset:r,endOffset:s,collapsed:r===s}}var Jo,wh;function jC(){if(wh)return Jo;wh=1;var e=-1,t=1,n=0;function r(g,P,v,M,A){if(g===P)return g?[[n,g]]:[];if(v!=null){var w=B(g,P,v);if(w)return w}var N=a(g,P),D=g.substring(0,N);g=g.substring(N),P=P.substring(N),N=c(g,P);var L=g.substring(g.length-N);g=g.substring(0,g.length-N),P=P.substring(0,P.length-N);var F=s(g,P);return D&&F.unshift([n,D]),L&&F.push([n,L]),H(F,A),M&&h(F),F}function s(g,P){var v;if(!g)return[[t,P]];if(!P)return[[e,g]];var M=g.length>P.length?g:P,A=g.length>P.length?P:g,w=M.indexOf(A);if(w!==-1)return v=[[t,M.substring(0,w)],[n,A],[t,M.substring(w+A.length)]],g.length>P.length&&(v[0][0]=v[2][0]=e),v;if(A.length===1)return[[e,g],[t,P]];var N=u(g,P);if(N){var D=N[0],L=N[1],F=N[2],Q=N[3],G=N[4],le=r(D,F),ue=r(L,Q);return le.concat([[n,G]],ue)}return i(g,P)}function i(g,P){for(var v=g.length,M=P.length,A=Math.ceil((v+M)/2),w=A,N=2*A,D=new Array(N),L=new Array(N),F=0;F<N;F++)D[F]=-1,L[F]=-1;D[w+1]=0,L[w+1]=0;for(var Q=v-M,G=Q%2!==0,le=0,ue=0,S=0,U=0,V=0;V<A;V++){for(var z=-V+le;z<=V-ue;z+=2){var j=w+z,W;z===-V||z!==V&&D[j-1]<D[j+1]?W=D[j+1]:W=D[j-1]+1;for(var ee=W-z;W<v&&ee<M&&g.charAt(W)===P.charAt(ee);)W++,ee++;if(D[j]=W,W>v)ue+=2;else if(ee>M)le+=2;else if(G){var te=w+Q-z;if(te>=0&&te<N&&L[te]!==-1){var k=v-L[te];if(W>=k)return o(g,P,W,ee)}}}for(var K=-V+S;K<=V-U;K+=2){var te=w+K,k;K===-V||K!==V&&L[te-1]<L[te+1]?k=L[te+1]:k=L[te-1]+1;for(var q=k-K;k<v&&q<M&&g.charAt(v-k-1)===P.charAt(M-q-1);)k++,q++;if(L[te]=k,k>v)U+=2;else if(q>M)S+=2;else if(!G){var j=w+Q-K;if(j>=0&&j<N&&D[j]!==-1){var W=D[j],ee=w+W-j;if(k=v-k,W>=k)return o(g,P,W,ee)}}}}return[[e,g],[t,P]]}function o(g,P,v,M){var A=g.substring(0,v),w=P.substring(0,M),N=g.substring(v),D=P.substring(M),L=r(A,w),F=r(N,D);return L.concat(F)}function a(g,P){if(!g||!P||g.charAt(0)!==P.charAt(0))return 0;for(var v=0,M=Math.min(g.length,P.length),A=M,w=0;v<A;)g.substring(w,A)==P.substring(w,A)?(v=A,w=v):M=A,A=Math.floor((M-v)/2+v);return x(g.charCodeAt(A-1))&&A--,A}function l(g,P){var v=g.length,M=P.length;if(v==0||M==0)return 0;v>M?g=g.substring(v-M):v<M&&(P=P.substring(0,v));var A=Math.min(v,M);if(g==P)return A;for(var w=0,N=1;;){var D=g.substring(A-N),L=P.indexOf(D);if(L==-1)return w;N+=L,(L==0||g.substring(A-N)==P.substring(0,N))&&(w=N,N++)}}function c(g,P){if(!g||!P||g.slice(-1)!==P.slice(-1))return 0;for(var v=0,M=Math.min(g.length,P.length),A=M,w=0;v<A;)g.substring(g.length-A,g.length-w)==P.substring(P.length-A,P.length-w)?(v=A,w=v):M=A,A=Math.floor((M-v)/2+v);return Y(g.charCodeAt(g.length-A))&&A--,A}function u(g,P){var v=g.length>P.length?g:P,M=g.length>P.length?P:g;if(v.length<4||M.length*2<v.length)return null;function A(ue,S,U){for(var V=ue.substring(U,U+Math.floor(ue.length/4)),z=-1,j="",W,ee,te,k;(z=S.indexOf(V,z+1))!==-1;){var K=a(ue.substring(U),S.substring(z)),q=c(ue.substring(0,U),S.substring(0,z));j.length<q+K&&(j=S.substring(z-q,z)+S.substring(z,z+K),W=ue.substring(0,U-q),ee=ue.substring(U+K),te=S.substring(0,z-q),k=S.substring(z+K))}return j.length*2>=ue.length?[W,ee,te,k,j]:null}var w=A(v,M,Math.ceil(v.length/4)),N=A(v,M,Math.ceil(v.length/2)),D;if(!w&&!N)return null;N?w?D=w[4].length>N[4].length?w:N:D=N:D=w;var L,F,Q,G;g.length>P.length?(L=D[0],F=D[1],Q=D[2],G=D[3]):(Q=D[0],G=D[1],L=D[2],F=D[3]);var le=D[4];return[L,F,Q,G,le]}function h(g){for(var P=!1,v=[],M=0,A=null,w=0,N=0,D=0,L=0,F=0;w<g.length;)g[w][0]==n?(v[M++]=w,N=L,D=F,L=0,F=0,A=g[w][1]):(g[w][0]==t?L+=g[w][1].length:F+=g[w][1].length,A&&A.length<=Math.max(N,D)&&A.length<=Math.max(L,F)&&(g.splice(v[M-1],0,[e,A]),g[v[M-1]+1][0]=t,M--,M--,w=M>0?v[M-1]:-1,N=0,D=0,L=0,F=0,A=null,P=!0)),w++;for(P&&H(g),y(g),w=1;w<g.length;){if(g[w-1][0]==e&&g[w][0]==t){var Q=g[w-1][1],G=g[w][1],le=l(Q,G),ue=l(G,Q);le>=ue?(le>=Q.length/2||le>=G.length/2)&&(g.splice(w,0,[n,G.substring(0,le)]),g[w-1][1]=Q.substring(0,Q.length-le),g[w+1][1]=G.substring(le),w++):(ue>=Q.length/2||ue>=G.length/2)&&(g.splice(w,0,[n,Q.substring(0,ue)]),g[w-1][0]=t,g[w-1][1]=G.substring(0,G.length-ue),g[w+1][0]=e,g[w+1][1]=Q.substring(ue),w++),w++}w++}}var d=/[^a-zA-Z0-9]/,m=/\s/,_=/[\r\n]/,p=/\n\r?\n$/,I=/^\r?\n\r?\n/;function y(g){function P(ue,S){if(!ue||!S)return 6;var U=ue.charAt(ue.length-1),V=S.charAt(0),z=U.match(d),j=V.match(d),W=z&&U.match(m),ee=j&&V.match(m),te=W&&U.match(_),k=ee&&V.match(_),K=te&&ue.match(p),q=k&&S.match(I);return K||q?5:te||k?4:z&&!W&&ee?3:W||ee?2:z||j?1:0}for(var v=1;v<g.length-1;){if(g[v-1][0]==n&&g[v+1][0]==n){var M=g[v-1][1],A=g[v][1],w=g[v+1][1],N=c(M,A);if(N){var D=A.substring(A.length-N);M=M.substring(0,M.length-N),A=D+A.substring(0,A.length-N),w=D+w}for(var L=M,F=A,Q=w,G=P(M,A)+P(A,w);A.charAt(0)===w.charAt(0);){M+=A.charAt(0),A=A.substring(1)+w.charAt(0),w=w.substring(1);var le=P(M,A)+P(A,w);le>=G&&(G=le,L=M,F=A,Q=w)}g[v-1][1]!=L&&(L?g[v-1][1]=L:(g.splice(v-1,1),v--),g[v][1]=F,Q?g[v+1][1]=Q:(g.splice(v+1,1),v--))}v++}}function H(g,P){g.push([n,""]);for(var v=0,M=0,A=0,w="",N="",D;v<g.length;){if(v<g.length-1&&!g[v][1]){g.splice(v,1);continue}switch(g[v][0]){case t:A++,N+=g[v][1],v++;break;case e:M++,w+=g[v][1],v++;break;case n:var L=v-A-M-1;if(P){if(L>=0&&R(g[L][1])){var F=g[L][1].slice(-1);if(g[L][1]=g[L][1].slice(0,-1),w=F+w,N=F+N,!g[L][1]){g.splice(L,1),v--;var Q=L-1;g[Q]&&g[Q][0]===t&&(A++,N=g[Q][1]+N,Q--),g[Q]&&g[Q][0]===e&&(M++,w=g[Q][1]+w,Q--),L=Q}}if(O(g[v][1])){var F=g[v][1].charAt(0);g[v][1]=g[v][1].slice(1),w+=F,N+=F}}if(v<g.length-1&&!g[v][1]){g.splice(v,1);break}if(w.length>0||N.length>0){w.length>0&&N.length>0&&(D=a(N,w),D!==0&&(L>=0?g[L][1]+=N.substring(0,D):(g.splice(0,0,[n,N.substring(0,D)]),v++),N=N.substring(D),w=w.substring(D)),D=c(N,w),D!==0&&(g[v][1]=N.substring(N.length-D)+g[v][1],N=N.substring(0,N.length-D),w=w.substring(0,w.length-D)));var G=A+M;w.length===0&&N.length===0?(g.splice(v-G,G),v=v-G):w.length===0?(g.splice(v-G,G,[t,N]),v=v-G+1):N.length===0?(g.splice(v-G,G,[e,w]),v=v-G+1):(g.splice(v-G,G,[e,w],[t,N]),v=v-G+2)}v!==0&&g[v-1][0]===n?(g[v-1][1]+=g[v][1],g.splice(v,1)):v++,A=0,M=0,w="",N="";break}}g[g.length-1][1]===""&&g.pop();var le=!1;for(v=1;v<g.length-1;)g[v-1][0]===n&&g[v+1][0]===n&&(g[v][1].substring(g[v][1].length-g[v-1][1].length)===g[v-1][1]?(g[v][1]=g[v-1][1]+g[v][1].substring(0,g[v][1].length-g[v-1][1].length),g[v+1][1]=g[v-1][1]+g[v+1][1],g.splice(v-1,1),le=!0):g[v][1].substring(0,g[v+1][1].length)==g[v+1][1]&&(g[v-1][1]+=g[v+1][1],g[v][1]=g[v][1].substring(g[v+1][1].length)+g[v+1][1],g.splice(v+1,1),le=!0)),v++;le&&H(g,P)}function x(g){return g>=55296&&g<=56319}function Y(g){return g>=56320&&g<=57343}function O(g){return Y(g.charCodeAt(0))}function R(g){return x(g.charCodeAt(g.length-1))}function b(g){for(var P=[],v=0;v<g.length;v++)g[v][1].length>0&&P.push(g[v]);return P}function T(g,P,v,M){return R(g)||O(M)?null:b([[n,g],[e,P],[t,v],[n,M]])}function B(g,P,v){var M=typeof v=="number"?{index:v,length:0}:v.oldRange,A=typeof v=="number"?null:v.newRange,w=g.length,N=P.length;if(M.length===0&&(A===null||A.length===0)){var D=M.index,L=g.slice(0,D),F=g.slice(D),Q=A?A.index:null;e:{var G=D+N-w;if(Q!==null&&Q!==G||G<0||G>N)break e;var le=P.slice(0,G),ue=P.slice(G);if(ue!==F)break e;var S=Math.min(D,G),U=L.slice(0,S),V=le.slice(0,S);if(U!==V)break e;var z=L.slice(S),j=le.slice(S);return T(U,z,j,F)}e:{if(Q!==null&&Q!==D)break e;var W=D,le=P.slice(0,W),ue=P.slice(W);if(le!==L)break e;var ee=Math.min(w-W,N-W),te=F.slice(F.length-ee),k=ue.slice(ue.length-ee);if(te!==k)break e;var z=F.slice(0,F.length-ee),j=ue.slice(0,ue.length-ee);return T(L,z,j,te)}}if(M.length>0&&A&&A.length===0)e:{var U=g.slice(0,M.index),te=g.slice(M.index+M.length),S=U.length,ee=te.length;if(N<S+ee)break e;var V=P.slice(0,S),k=P.slice(N-ee);if(U!==V||te!==k)break e;var z=g.slice(S,w-ee),j=P.slice(S,N-ee);return T(U,z,j,te)}return null}function $(g,P,v,M){return r(g,P,v,M,!0)}return $.INSERT=t,$.DELETE=e,$.EQUAL=n,Jo=$,Jo}var WC=jC();const Zo=pt(WC);function YC(e){var h,d,m;const{rangeId:t,segmentId:n,documentDataModel:r,insert:s}=e,i=(d=(h=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:h.customRanges)==null?void 0:d.find(_=>_.rangeId===t);if(!i)return!1;const{startIndex:o,endIndex:a}=i,l=new De,c=a-o+1;l.push({t:J.RETAIN,len:o}),l.push({t:J.RETAIN,len:c,body:{dataStream:"",customRanges:[]}}),s&&l.push({t:J.INSERT,body:s,len:s.dataStream.length});const u=a+1+((m=s==null?void 0:s.dataStream.length)!=null?m:0);return l.selections=[{startOffset:u,endOffset:u,collapsed:!0}],l}function VC(e){const{ranges:t,rangeId:n,rangeType:r,wholeEntity:s,properties:i,body:o}=e;let a=0;const l=new De;let c=!1;return t.forEach(u=>{var x,Y,O;const h=$C(u,o);if(!h||!o)return!1;const{startOffset:d,endOffset:m}=h,_=(x=o.customRanges)!=null?x:[],p=(R,b,T)=>{var v,M,A,w;const B=vh(R,b,_,r),$=Math.min((M=(v=B[0])==null?void 0:v.startIndex)!=null?M:1/0,R),g=Math.max((w=(A=B[B.length-1])==null?void 0:A.endIndex)!=null?w:-1/0,b),P={rangeId:T?`${n}$${T}`:n,rangeType:r,startIndex:0,endIndex:g-$,wholeEntity:s,properties:{...i}};l.push({t:J.RETAIN,len:$-a}),l.push({t:J.RETAIN,len:g-$+1,body:{dataStream:"",customRanges:[P]},coverType:Re.COVER}),a=g+1},I=((Y=o.paragraphs)!=null?Y:[]).filter(R=>R.startIndex<m&&R.startIndex>d),y=((O=o.customBlocks)!=null?O:[]).filter(R=>R.startIndex<m&&R.startIndex>d);BC([d,m-1],[...I.map(R=>R.startIndex),...y.map(R=>R.startIndex)]).forEach(([R,b],T)=>p(R,b,T)),c=!0,l.selections=[{startOffset:h.endOffset,endOffset:h.endOffset,collapsed:!0}]}),c?l:!1}function bh(e,t,n=0,r=null,s=!0){e.sort((c,u)=>c.startOffset-u.startOffset);const i=[],{paragraphs:o=[]}=t,a=o==null?void 0:o.find(c=>c.startIndex>=e[0].startOffset&&c.startIndex<e[0].endOffset);let l=n;if(e.forEach(c=>{const{startOffset:u,endOffset:h}=c;u>l&&(i.push({t:J.RETAIN,len:u-l}),l=u),l<h&&(i.push({t:J.DELETE,len:h-l}),l=h)}),r&&i.push({t:J.INSERT,body:r,len:r.dataStream.length}),a&&s){const c=o.find(u=>u.startIndex-n>=e[e.length-1].endOffset-1);c&&(c.startIndex>l&&(i.push({t:J.RETAIN,len:c.startIndex-l}),l=c.startIndex),i.push({t:J.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...c,startIndex:0,bullet:a==null?void 0:a.bullet}]},coverType:Re.REPLACE}))}return i}function zC(e,t,n=0){const r=[];let s=n;return e.forEach(i=>{const{startOffset:o,endOffset:a}=i;o>s&&(r.push({t:J.RETAIN,len:o-s}),s=o),a>s&&(r.push({t:J.RETAIN,len:a-s,body:{...Z.deepClone(t),dataStream:""}}),s=a)}),r}const GC=e=>{var h;const{selection:t,body:n,doc:r}=e,s=t.segmentId,i=(h=r.getSelfOrHeaderFooterModel(s))==null?void 0:h.getBody();if(!i)return!1;const o=t.collapsed?null:At(i,t.startOffset,t.endOffset),a=Zo(o?o.dataStream:"",n.dataStream);let l=0;const c=a.map(([d,m])=>{switch(d){case 0:{const _={t:J.RETAIN,body:{...At(n,l,l+m.length,!1),dataStream:""},len:m.length};return l+=m.length,_}case 1:{const _={t:J.INSERT,body:At(n,l,l+m.length),len:m.length};return l+=m.length,_}default:return{t:J.DELETE,len:m.length}}}),u=new De;return u.push({t:J.RETAIN,len:t.startOffset}),u.push(...c),u};function KC(e,t){return!!((e==null?void 0:e.length)===(t==null?void 0:t.length)&&(e!=null&&e.every((n,r)=>JSON.stringify(n)===JSON.stringify(t==null?void 0:t[r]))))}const XC=e=>{var d;const{selection:t,body:n,doc:r,themeService:s}=e,i=t.segmentId,o=(d=r.getSelfOrHeaderFooterModel(i))==null?void 0:d.getBody();if(!o)return!1;const a=t.collapsed?null:At(o,t.startOffset,t.endOffset),l=Zo(a?a.dataStream:"",n.dataStream);let c=0;const u=l.map(([m,_])=>{switch(m){case 0:{const p=Js(n,c,c+_.length,!1),I=Js(a,c,c+_.length,!1),y={t:J.RETAIN,body:KC(p,I)?void 0:{textRuns:p==null?void 0:p.map(H=>{var x,Y,O,R,b,T,B;return{...H,ts:{...H.ts,cl:(O=(Y=(x=H.ts)==null?void 0:x.cl)==null?void 0:Y.rgb)!=null&&O.includes(".")?{rgb:s.getColorFromTheme((T=(b=(R=H.ts)==null?void 0:R.cl)==null?void 0:b.rgb)!=null?T:"")}:(B=H.ts)==null?void 0:B.cl}}}),dataStream:""},len:_.length};return c+=_.length,y}case 1:{const p={t:J.INSERT,body:At(n,c,c+_.length),len:_.length};return c+=_.length,p}default:return{t:J.DELETE,len:_.length}}});if(u.every(m=>m.t===J.RETAIN&&!m.body))return!1;const h=new De;return h.push({t:J.RETAIN,len:t.startOffset}),h.push(...u),h};function qC(e,t){const n=[],{customBlocks:r=[]}=e;for(const s of t){const{startOffset:i,endOffset:o}=s;if(!(i==null||o==null))for(const a of r){const{startIndex:l}=a;l>=i&&l<o&&n.push(a.blockId)}}return n}function JC(e,t=""){if(!t)return["body"];const{headers:n,footers:r}=e.getSnapshot();if(n==null&&r==null)throw new Error("Document data model must have headers or footers when update by segment id");if((n==null?void 0:n[t])!=null)return["headers",t,"body"];if((r==null?void 0:r[t])!=null)return["footers",t,"body"];throw new Error("Segment id not found in headers or footers")}const ZC=e=>{var p,I,y,H;const{selection:t,documentDataModel:n,drawings:r}=e,{collapsed:s,startOffset:i,segmentId:o}=t,a=new De,l=Vt.getInstance(),c=[],u=n.getSelfOrHeaderFooterModel(o).getBody();if(!u)return!1;const h=(I=(p=n.getSnapshot().drawingsOrder)==null?void 0:p.length)!=null?I:0;let d=0;if(s)i>0&&a.push({t:J.RETAIN,len:i});else{const x=bh([t],u,0,null,!1);a.push(...x);const Y=qC(u,[t]),O=(y=n.getDrawings())!=null?y:{},R=(H=n.getDrawingsOrder())!=null?H:[],b=Y.sort((T,B)=>R.indexOf(T)>R.indexOf(B)?-1:R.indexOf(T)<R.indexOf(B)?1:0);if(b.length>0)for(const T of b){const B=O[T],$=R.indexOf(T);if(B==null||$<0)continue;const g=l.removeOp(["drawings",T],B),P=l.removeOp(["drawingsOrder",$],T);c.push(g),c.push(P),d++}}a.push({t:J.INSERT,body:{dataStream:"\b".repeat(r.length),customBlocks:r.map((x,Y)=>({startIndex:Y,blockId:x.drawingId}))},len:r.length});const m=JC(n,o),_=l.editOp(a.serialize(),m);c.push(_);for(const x of r){const{drawingId:Y}=x,O=l.insertOp(["drawings",Y],x),R=l.insertOp(["drawingsOrder",h-d],Y);c.push(O),c.push(R)}return c.reduce((x,Y)=>Vt.compose(x,Y),null)};function QC(e,t){if(typeof t>"u")return{startOffset:e,endOffset:e,collapsed:!0};if(t<e)throw new Error(`Cannot make a doc selection when endOffset ${t} is less than startOffset ${e}.`);return{startOffset:e,endOffset:t,collapsed:e===t}}function eR(e){const{startOffset:t,endOffset:n,collapsed:r}=e,s=Math.min(t,n),i=Math.max(t,n);return{startOffset:s,endOffset:i,collapsed:r}}function tR(e,t,n,r){return Math.max(e,n)<=Math.min(t,r)}function Qo(e,t,n,r){const{startOffset:s,endOffset:i}=e,o=r!=null?r:ta(t,n),a=[];let l=-1;for(let c=0;c<o.length;c++){const u=o[c],{startIndex:h}=u;(s>l&&s<=h||i>l&&i<=h||h>=s&&h<=i)&&a.push(u),l=h}return a}function ea(e,t,n){const r=[],s=ta(t,n);for(const i of e){const o=Qo(i,t,n,s);r.push(...o)}return r}const nR=[ut.PARAGRAPH,ut.TABLE_START,ut.TABLE_END,ut.TABLE_ROW_START,ut.TABLE_CELL_START,ut.TABLE_CELL_END];function ta(e,t){const n=[];for(let r=0;r<e.length;r++){const s=e[r],{startIndex:i}=s;let o=i-1;for(;!nR.includes(t[o])&&o>=0;)o--;n.push({...s,paragraphStart:o+1,paragraphEnd:s.startIndex})}return n}const rR=e=>{var h,d,m;const{paragraphs:t,segmentId:n,document:r}=e;let s=e.listType;const i=(d=(h=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:h.paragraphs)!=null?d:[],o=t.every(_=>{var p;return((p=_.bullet)==null?void 0:p.listType.indexOf(s))===0});let l=nt(6);if(t.length===1){const _=i.indexOf(t[0]),p=i[_-1],I=i[_+1];p&&p.bullet&&p.bullet.listType.indexOf(s)===0?(l=p.bullet.listId,s!==xt.CHECK_LIST&&(s=p.bullet.listType)):I&&I.bullet&&I.bullet.listType.indexOf(s)===0&&(l=I.bullet.listId,s!==xt.CHECK_LIST&&(s=I.bullet.listType))}const c=new fn;c.reset();const u=new De;for(const _ of t){const{startIndex:p,paragraphStyle:I={},bullet:y}=_;u.push({t:J.RETAIN,len:p-c.cursor}),u.push({t:J.RETAIN,len:1,body:{dataStream:"",paragraphs:[o?{paragraphStyle:I,startIndex:0}:{startIndex:0,paragraphStyle:{...I},bullet:{nestingLevel:(m=y==null?void 0:y.nestingLevel)!=null?m:0,textStyle:{fs:20},listType:s,listId:l}}]},coverType:Re.REPLACE}),c.moveCursorTo(p+1)}return u},sR=e=>{var h;const{paragraphIndex:t,segmentId:n,document:r}=e,s=(h=r.getSelfOrHeaderFooterModel(n).getBody())==null?void 0:h.paragraphs;if(s==null)return!1;const i=s.find(d=>d.startIndex===t);if(!(i!=null&&i.bullet)||i.bullet.listType.indexOf(xt.CHECK_LIST)===-1)return!1;const o=new fn;o.reset();const a=new De,{startIndex:l,paragraphStyle:c={}}=i,u=i.bullet.listType===xt.CHECK_LIST?xt.CHECK_LIST_CHECKED:xt.CHECK_LIST;return a.push({t:J.RETAIN,len:l-o.cursor}),a.push({t:J.RETAIN,len:1,body:{dataStream:"",paragraphs:[{...i,paragraphStyle:c,startIndex:0,bullet:{...i.bullet,listType:u}}]},coverType:Re.REPLACE}),o.moveCursorTo(l+1),a},iR=e=>{var u,h;const{paragraphs:t,listType:n,segmentId:r,document:s}=e;if(((u=s.getSelfOrHeaderFooterModel(r).getBody())==null?void 0:u.paragraphs)==null)return!1;const a=nt(6),l=new fn;l.reset();const c=new De;for(const d of t){const{startIndex:m,paragraphStyle:_={},bullet:p}=d;c.push({t:J.RETAIN,len:m-l.cursor}),c.push({t:J.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:_,bullet:{nestingLevel:(h=p==null?void 0:p.nestingLevel)!=null?h:0,textStyle:(p==null?void 0:p.listType)===n?p.textStyle:{fs:20},listType:n,listId:a}}]},coverType:Re.REPLACE}),l.moveCursorTo(m+1)}return c};function oR(e,t){return t.some(n=>e.startIndex>n.startIndex&&e.startIndex<n.endIndex)}const aR=e=>{var c,u,h;const{paragraphs:t,document:n,type:r}=e,s=new fn;s.reset();const i=new De,o=(c=n.getSnapshot().lists)!=null?c:{},a=(h=(u=n.getBody())==null?void 0:u.tables)!=null?h:[],l={...Pr,...o};for(const d of t){const{startIndex:m,paragraphStyle:_={},bullet:p}=d,I=oR(d,a);if(i.push({t:J.RETAIN,len:m-s.cursor}),p){const y=p.listType;let H=l[y].nestingLevel.length-1;I&&(H=Math.min(H,2)),i.push({t:J.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:{..._},bullet:{...p,nestingLevel:Math.max(Math.min(p.nestingLevel+r,H),0)}}]},coverType:Re.REPLACE})}else i.push({t:J.RETAIN,len:1});s.moveCursorTo(m+1)}return i},lR=e=>{var I,y,H,x;const{textRanges:t,segmentId:n,document:r,style:s,paragraphTextRun:i,cursor:o,deleteLen:a,textX:l}=e,c=r.getSelfOrHeaderFooterModel(n),u=(y=(I=c.getBody())==null?void 0:I.paragraphs)!=null?y:[],h=(x=(H=c.getBody())==null?void 0:H.dataStream)!=null?x:"",d=ea(t,u,h),m=new fn;o&&m.moveCursorTo(o);const _=l!=null?l:new De;d.sort((Y,O)=>Y.startIndex-O.startIndex);const p=Math.max(0,d[0].paragraphStart-1);p>m.cursor&&(_.push({t:J.RETAIN,len:p-m.cursor}),m.moveCursorTo(p)),a&&_.push({t:J.DELETE,len:a});for(const Y of d){const{startIndex:O,paragraphStyle:R={}}=Y,b=O-m.cursor;_.push({t:J.RETAIN,len:b,...i?{body:{dataStream:"",textRuns:[{ts:i,st:0,ed:b}]},coverType:Re.REPLACE}:null}),_.push({t:J.RETAIN,len:1,body:{dataStream:"",paragraphs:[{startIndex:0,paragraphStyle:{...R,...s}}]},coverType:Re.REPLACE}),m.moveCursorTo(O+1)}return _};class Qe{}E(Qe,"customRange",{add:VC,delete:YC,copyCustomRange:HC,getCustomRangesInterestsWithSelection:xC,isIntersecting:Oh}),E(Qe,"customDecoration",{add:kC,delete:FC}),E(Qe,"selection",{replace:GC,makeSelection:QC,normalizeSelection:eR,delete:bh,replaceTextRuns:XC,retain:zC}),E(Qe,"range",{isIntersects:tR,getParagraphsInRange:Qo,getParagraphsInRanges:ea}),E(Qe,"transform",{getPlainText:Zs,fromPlainText:UC,isEmptyDocument:LC}),E(Qe,"paragraph",{bullet:{set:iR,switch:rR,toggleChecklist:sR,changeNestLevel:aR},style:{set:lR},util:{transform:ta,getParagraphsInRange:Qo,getParagraphsInRanges:ea}}),E(Qe,"drawing",{add:ZC});function cR(e,t,n,r){var c;if(t==="")return e;const s={id:"mock-id",body:e,documentStyle:{}},i=new Tt(s),o=t.length;let a;for(;(a=(r?i.getBody().dataStream:i.getBody().dataStream.toLowerCase()).indexOf(t))>=0;){const u=new De,h=Vt.getInstance();if(a>0&&u.retain(a),n.length>0){const d=i.sliceBody(a,a+o),m={dataStream:n};if(Array.isArray(d==null?void 0:d.textRuns)&&d.textRuns.length&&(m.textRuns=[{...d.textRuns[0],st:0,ed:n.length}]),(c=d==null?void 0:d.customRanges)!=null&&c.length){const _=d.customRanges[0];m.customRanges=[{..._,startIndex:0,endIndex:n.length-1}]}u.insert(n.length,m)}u.delete(o),i.apply(h.editOp(u.serialize()))}const l=i.getBody();return i.dispose(),l}function uR(e){if(e.customRanges||(e.customRanges=[]),!e.paragraphs){e.paragraphs=[];for(let t=0;t<e.dataStream.length;t++)e.dataStream[t]==="\r"&&e.paragraphs.push({startIndex:t})}return e.customBlocks||(e.customBlocks=[]),e.textRuns||(e.textRuns=[]),e.customDecorations||(e.customDecorations=[]),e.sectionBreaks||(e.sectionBreaks=[]),e.tables||(e.tables=[]),e}function yh(e){var t;return e.body=uR((t=e.body)!=null?t:{dataStream:""}),e.drawingsOrder||(e.drawingsOrder=[]),e.drawings||(e.drawings={}),e.documentStyle||(e.documentStyle={}),e}class kr{constructor(t={}){E(this,"_style");this._style=t}static create(t={}){return new kr(t)}get fontFamily(){return this._style.ff}get fontSize(){return this._style.fs}get italic(){return this._style.it===ae.TRUE}get bold(){return this._style.bl===ae.TRUE}get underline(){return this._style.ul&&on.create(this._style.ul)}get bottomBorderLine(){return this._style.bbl&&on.create(this._style.bbl)}get strikethrough(){return this._style.st&&on.create(this._style.st)}get overline(){return this._style.ol&&on.create(this._style.ol)}get background(){return this._style.bg}get border(){return this._style.bd}get color(){return this._style.cl}get verticalAlign(){return this._style.va}get numberFormat(){return this._style.n}copy(){return sn.create(Z.deepClone(this._style))}getValue(){return{...this._style}}}class sn extends kr{static create(t={}){return new sn(t)}constructor(t={}){super(t)}setFontFamily(t){return this._style.ff=t,this}setFontSize(t){return this._style.fs=t,this}setItalic(t){return this._style.it=t?1:0,this}setBold(t){return this._style.bl=t?1:0,this}setUnderline(t){return this._style.ul=t.build(),this}setBottomBorderLine(t){return this._style.bbl=t.build(),this}setStrikethrough(t){return this._style.st=t.build(),this}setOverline(t){return this._style.ol=t.build(),this}setBackground(t){return this._style.bg=t,this}setBorder(t){return this._style.bd=t,this}setColor(t){return this._style.cl=t,this}setVerticalAlign(t){return this._style.va=t,this}copy(){return sn.create(Z.deepClone(this._style))}build(){return this.getValue()}}class on{constructor(t={s:1}){E(this,"_decoration");this._decoration=t}static create(t={s:1}){return new on(t)}get show(){return this._decoration.s===ae.TRUE}get followFontColor(){return this._decoration.c===ae.TRUE}get color(){return this._decoration.cl}get type(){return this._decoration.t}setShow(t){return this._decoration.s=t?1:0,this}setFollowFontColor(t){return this._decoration.c=t?1:0,this}setColor(t){return this._decoration.cl=t,this}setLineType(t){return this._decoration.t=t,this}copy(){return on.create(Z.deepClone(this._decoration))}build(){return{...this._decoration}}}class Fr{constructor(t={}){E(this,"_style");this._style=t}static create(t={}){return new Fr(t)}get indentFirstLine(){return this._style.indentFirstLine}get hanging(){return this._style.hanging}get indentStart(){return this._style.indentStart}get tabStops(){return this._style.tabStops}get indentEnd(){return this._style.indentEnd}get textStyle(){return this._style.textStyle}get headingId(){return this._style.headingId}get namedStyleType(){return this._style.namedStyleType}get horizontalAlign(){return this._style.horizontalAlign}get lineSpacing(){return this._style.lineSpacing}get direction(){return this._style.direction}get spacingRule(){return this._style.spacingRule}get snapToGrid(){return this._style.snapToGrid}get spaceAbove(){return this._style.spaceAbove}get spaceBelow(){return this._style.spaceBelow}get borderBetween(){return this._style.borderBetween}get borderTop(){return this._style.borderTop}get borderBottom(){return this._style.borderBottom}get borderLeft(){return this._style.borderLeft}get borderRight(){return this._style.borderRight}get keepLines(){return this._style.keepLines===ae.TRUE}get keepNext(){return this._style.keepNext===ae.TRUE}get wordWrap(){return this._style.wordWrap===ae.TRUE}get widowControl(){return this._style.widowControl===ae.TRUE}get shading(){return this._style.shading}get suppressHyphenation(){return this._style.suppressHyphenation===ae.TRUE}copy(){return xr.create(Z.deepClone(this._style))}getValue(){return this._style}}class xr extends Fr{static create(t={}){return new xr(t)}constructor(t={}){super(t)}setIndentFirstLine(t){return this._style.indentFirstLine=t,this}setHanging(t){return this._style.hanging=t,this}setIndentStart(t){return this._style.indentStart=t,this}setTabStops(t){return this._style.tabStops=t,this}setIndentEnd(t){return this._style.indentEnd=t,this}setTextStyle(t){return this._style.textStyle=t,this}setHeadingId(t){return this._style.headingId=t,this}setNamedStyleType(t){return this._style.namedStyleType=t,this}setHorizontalAlign(t){return this._style.horizontalAlign=t,this}setLineSpacing(t){return this._style.lineSpacing=t,this}setDirection(t){return this._style.direction=t,this}setSpacingRule(t){return this._style.spacingRule=t,this}setSnapToGrid(t){return this._style.snapToGrid=t?1:0,this}setSpaceAbove(t){return this._style.spaceAbove=t,this}setSpaceBelow(t){return this._style.spaceBelow=t,this}setBorderBetween(t){return this._style.borderBetween=t,this}setBorderTop(t){return this._style.borderTop=t,this}setBorderBottom(t){return this._style.borderBottom=t,this}setBorderLeft(t){return this._style.borderLeft=t,this}setBorderRight(t){return this._style.borderRight=t,this}setKeepLines(t){return this._style.keepLines=t?1:0,this}setKeepNext(t){return this._style.keepNext=t?1:0,this}setWordWrap(t){return this._style.wordWrap=t?1:0,this}setWidowControl(t){return this._style.widowControl=t?1:0,this}setShading(t){return this._style.shading=t,this}setSuppressHyphenation(t){return this._style.suppressHyphenation=t?1:0,this}copy(){return xr.create(Z.deepClone(this._style))}build(){return this.getValue()}}class an{constructor(t){E(this,"_data");if(!t.body)throw new Error("Invalid document data, body is required");this._data=yh(t)}static create(t){return new an(t)}static createByBody(t){return new an({body:t,id:"d",documentStyle:{}})}copy(){return Sn.create(Z.deepClone(this._data))}slice(t,n){const{body:r,...s}=this._data;return Sn.create({...Z.deepClone(s),body:At(r,t,n)})}toPlainText(){var t,n;return Qe.transform.getPlainText((n=(t=this._data.body)==null?void 0:t.dataStream)!=null?n:"").replaceAll("\r",`
7
+ `)}getParagraphStyle(){var t,n;return Fr.create((n=(t=this._data.body)==null?void 0:t.paragraphs)==null?void 0:n[0].paragraphStyle)}getParagraphBullet(){var t,n;return(n=(t=this._data.body)==null?void 0:t.paragraphs)==null?void 0:n[0].bullet}getParagraphs(){var r,s;const t=(s=(r=this._data.body)==null?void 0:r.paragraphs)!=null?s:[];let n=0;return t.map(i=>{const o=this.slice(n,i.startIndex);return n=i.startIndex,o})}getTextRuns(){var t,n;return((n=(t=this._data.body)==null?void 0:t.textRuns)!=null?n:[]).map(r=>({...r,ts:r.ts?kr.create(r.ts):null}))}getLinks(){var t,n,r;return(r=(n=(t=this._data.body)==null?void 0:t.customRanges)==null?void 0:n.filter(s=>s.rangeType===en.HYPERLINK))!=null?r:[]}getData(){return this._data}}class Sn extends an{constructor(n){super(n);E(this,"_doc");this._doc=new Tt(n)}static newEmptyData(){return yh({id:"d",documentStyle:{},drawings:{},drawingsOrder:[],body:{dataStream:`\r
8
+ `,customBlocks:[],customRanges:[],paragraphs:[{startIndex:0}],textRuns:[],tables:[],sectionBreaks:[]}})}static create(n){return new Sn(n!=null?n:Sn.newEmptyData())}insertText(n,r,s){var u,h;let i=((h=(u=this._data.body)==null?void 0:u.dataStream.length)!=null?h:2)-2,o,a;if(typeof n=="string"?o=n:(i=Math.min(n,i),o=r),typeof r=="object"?a=r instanceof sn?r.build():r:a=s instanceof sn?s.build():s,!o)return this;const l={dataStream:o,textRuns:a?[{ts:a,st:i,ed:i+o.length}]:[]},c=Qe.selection.replace({doc:this._doc,selection:{startOffset:i,endOffset:i,collapsed:!0},body:l});if(!c)throw new Error("Insert text failed, please check.");return De.apply(this._doc.getBody(),c.serialize()),this}insertRichText(n,r){var a,l;let s=((l=(a=this._data.body)==null?void 0:a.dataStream.length)!=null?l:2)-2,i;typeof n=="object"?i=n instanceof an?n.getData():n:(s=Math.min(n,s),i=r instanceof an?r.getData():r);const o=Qe.selection.replace({doc:this._doc,selection:{startOffset:s,endOffset:s,collapsed:!0},body:i.body});if(!o)throw new Error("Insert text failed, please check.");return De.apply(this._doc.getBody(),o.serialize()),this}delete(n,r){if(r!==void 0){if(!r)return this;const s=Qe.selection.delete([{startOffset:n,endOffset:n+r,collapsed:!0}],this._data.body);De.apply(this._doc.getBody(),s)}return this}setStyle(n,r,s){const i={dataStream:"",textRuns:[{ts:s instanceof sn?s.build():s,st:0,ed:r-n}]},o=Qe.selection.retain([{startOffset:n,endOffset:r,collapsed:!0}],i);return De.apply(this._doc.getBody(),o),this}setLink(n,r,s){const i=Qe.customRange.add({rangeType:en.HYPERLINK,rangeId:nt(),properties:{url:s},ranges:[{startOffset:n,endOffset:r,collapsed:!1}],body:this._data.body});if(!i)throw new Error("Insert text failed, please check.");return De.apply(this._doc.getBody(),i.serialize()),this}cancelLink(n,r){if(typeof n=="string"){const s=Qe.customRange.delete({rangeId:n,documentDataModel:this._doc});if(!s)throw new Error("Insert text failed, please check.");De.apply(this._doc.getBody(),s.serialize())}else this.slice(n,r).getLinks().forEach(i=>{const o=Qe.customRange.delete({rangeId:i.rangeId,documentDataModel:this._doc});if(!o)throw new Error("Insert text failed, please check.");De.apply(this._doc.getBody(),o.serialize())});return this}updateLink(n,r){var i,o;const s=(o=(i=this._data.body)==null?void 0:i.customRanges)==null?void 0:o.find(a=>a.rangeId===n);if(!s)throw new Error("Link not found");return s.properties.url=r,this}insertParagraph(n,r){var o,a;let s,i;return typeof n=="object"?(s={dataStream:"\r",paragraphs:[{startIndex:0,paragraphStyle:n.build()}]},i=((a=(o=this._data.body)==null?void 0:o.dataStream.length)!=null?a:2)-2):(i=n,s={dataStream:"\r",paragraphs:[{startIndex:0,paragraphStyle:r==null?void 0:r.build()}]}),this.insertRichText(i,an.create({body:s,id:"d",documentStyle:{}})),this}insertLink(n,r,s){let i="",o="";typeof n=="string"?(i=n,o=r):(i=r,o=s);const a=Sn.createByBody({dataStream:i,customRanges:[{rangeType:en.HYPERLINK,rangeId:nt(),properties:{url:o},startIndex:0,endIndex:i.length-1}]});return typeof n=="number"?this.insertRichText(n,a):this.insertRichText(a)}}const hR="__default_document_sub_component_id20231101__";class Ah{constructor(){E(this,"skipNextObservers",!1);E(this,"lastReturnValue");E(this,"isStopPropagation",!1)}stopPropagation(){this.isStopPropagation=!0}}class dR extends se.Subject{constructor(){super(...arguments);E(this,"_sortedObservers",[])}unsubscribe(){super.unsubscribe(),this._sortedObservers.length=0}complete(){super.complete(),this._sortedObservers.length=0}subscribeEvent(n){let r;typeof n=="function"?r={next:([i,o])=>n(i,o)}:r=n;const s=super.subscribe(r);return this._sortedObservers.push(r),this._sortedObservers.sort((i,o)=>{var a,l;return((a=i.priority)!=null?a:0)-((l=o.priority)!=null?l:0)}),s.add(()=>this._sortedObservers=this._sortedObservers.filter(i=>i!==r)),s}clearObservers(){this._sortedObservers.forEach(n=>{var r;return(r=n.complete)==null?void 0:r.call(n)}),this._sortedObservers.length=0}emitEvent(n){var r;if(!this.closed){const s=new Ah;s.lastReturnValue=n;for(const i of this._sortedObservers){const o=(r=i.next)==null?void 0:r.call(i,[n,s]);if(s.lastReturnValue=o,s.skipNextObservers)return{handled:!0,lastReturnValue:s.lastReturnValue,stopPropagation:s.isStopPropagation}}return{handled:this._sortedObservers.length>0,lastReturnValue:s.lastReturnValue,stopPropagation:s.isStopPropagation}}throw new Error("[EventSubject]: cannot emit event on a closed subject.")}}function fR(e){return new se.Observable(t=>{const n=e.subscribeEvent(r=>{t.next(r)});return()=>n.unsubscribe()})}const Qs=Ce.createIdentifier("core.resource-manager.service"),na={[Se.Editor]:"Editor",[Se.Owner]:"Owner",[Se.Reader]:"Reader",[Se.UNRECOGNIZED]:"UNRECOGNIZED"},ei=e=>e?{userID:`${na[e]}_${nt(8)}`,name:na[e],avatar:""}:{userID:"",name:"",avatar:"",anonymous:!0,canBindAnonymous:!1},mR=(e,t)=>e.startsWith(na[t]);class Hr extends Ke{constructor(){super(...arguments);E(this,"_model",new Map);E(this,"_userChange$",new se.Subject);E(this,"userChange$",this._userChange$.asObservable());E(this,"_currentUser$",new se.BehaviorSubject(ei()));E(this,"currentUser$",this._currentUser$.asObservable())}dispose(){super.dispose(),this._model.clear(),this._userChange$.complete(),this._currentUser$.complete()}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,r){const s=this._model.get(n);if(s)return s;r&&r()}delete(n){const r=this.getUser(n);this._model.delete(n),r&&this._userChange$.next({type:"delete",user:r})}clear(){this._model.clear(),this._userChange$.next({type:"clear"})}list(){return Array.from(this._model.values())}}var gR=Object.getOwnPropertyDescriptor,_R=(e,t,n,r)=>{for(var s=r>1?void 0:r?gR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},Th=(e,t)=>(n,r)=>t(n,r,e);f.AuthzIoLocalService=class{constructor(t,n){E(this,"_permissionMap",new Map([]));E(this,"_permissionOverrides",new Map);this._resourceManagerService=t,this._userManagerService=n,this._initSnapshot(),this._initDefaultUser()}_initDefaultUser(){const t=this._userManagerService.getCurrentUser();t&&t.userID||this._userManagerService.setCurrentUser(ei(Se.Owner))}_getRole(t){const n=this._userManagerService.getCurrentUser();return n?mR(n.userID,t):!1}_initSnapshot(){this._resourceManagerService.registerPluginResource({toJson:t=>{const n=[...this._permissionMap.keys()].reduce((r,s)=>{const i=this._permissionMap.get(s);return r[s]=i,r},{});return JSON.stringify(n)},parseJson:t=>JSON.parse(t),pluginName:"SHEET_AuthzIoMockService_PLUGIN",businesses:[we.UNIVER_SHEET,we.UNIVER_DOC,we.UNIVER_SLIDE],onLoad:(t,n)=>{for(const r in n)this._permissionMap.set(r,n[r])},onUnLoad:()=>{this._permissionMap.clear()}})}async create(t){const n=nt(8),{objectType:r,selectRangeObject:s,worksheetObject:i}=t,o=s||i,a={objectType:r,unitID:(o==null?void 0:o.unitID)||"",name:(o==null?void 0:o.name)||"",strategies:[{action:6,role:Se.Owner},{action:16,role:Se.Owner},{action:17,role:Se.Owner},{action:18,role:Se.Owner},{action:19,role:Se.Owner},{action:33,role:Se.Owner},{action:34,role:Se.Owner},{action:35,role:Se.Owner},{action:36,role:Se.Owner},{action:37,role:Se.Owner},{action:38,role:Se.Owner},{action:39,role:Se.Owner},{action:40,role:Se.Owner}],selectRangeObject:s};return this._permissionMap.set(n,a),n}async allowed(t){const{objectID:n,actions:r}=t,s=this._permissionMap.get(n);return s?r.map(o=>{const a=`${n}:${o}`;if(this._permissionOverrides.has(a))return{action:o,allowed:this._permissionOverrides.get(a)};const l=s.strategies.find(c=>c.action===o);return l?{action:o,allowed:this._getRole(l.role)}:{action:o,allowed:this._getRole(Se.Owner)||this._getRole(Se.Editor)}}):r.map(a=>({action:a,allowed:this._getRole(Se.Owner)||this._getRole(Se.Editor)}))}async batchAllowed(t){const n=await Promise.all(t.map(s=>this.allowed(s)));return t.map((s,i)=>({unitID:s.unitID,objectID:s.objectID,actions:n[i]}))}async list(t){const n=[],r=[{action:6,role:Se.Owner},{action:16,role:Se.Owner},{action:17,role:Se.Owner},{action:18,role:Se.Owner},{action:19,role:Se.Owner},{action:33,role:Se.Owner},{action:34,role:Se.Owner},{action:35,role:Se.Owner},{action:36,role:Se.Owner},{action:37,role:Se.Owner},{action:38,role:Se.Owner},{action:39,role:Se.Owner},{action:40,role:Se.Owner}];return t.objectIDs.forEach(s=>{const i=this._permissionMap.get(s),o=(i==null?void 0:i.strategies)||r,a={objectID:s,unitID:t.unitID,objectType:(i==null?void 0:i.objectType)||3,name:(i==null?void 0:i.name)||"",shareOn:!1,shareRole:Se.Owner,shareScope:-1,scope:{read:yi.AllCollaborator,edit:yi.AllCollaborator},creator:ei(Se.Owner),strategies:o.map(l=>({action:l.action,role:l.role})),actions:t.actions.map(l=>{const c=`${s}:${l}`;if(this._permissionOverrides.has(c))return{action:l,allowed:this._permissionOverrides.get(c)};const u=o.find(h=>h.action===l);if(!u){const h=this._getRole(Se.Owner)||this._getRole(Se.Editor);return{action:l,allowed:h}}return{action:l,allowed:this._getRole(u.role)}})};n.push(a)}),n}async listCollaborators(){return[]}async listRoles(){return{roles:[],actions:[]}}async deleteCollaborator(){}async update(t){const{objectID:n,strategies:r}=t,s=this._permissionMap.get(n);s&&r&&(s.strategies=r.map(i=>({action:i.action,role:i.role})),this._permissionMap.set(n,s),r.forEach(i=>{i.role===Se.Reader?this.setPermissionOverride(n,i.action,!1):(i.role===Se.Owner||i.role===Se.Editor)&&this.clearPermissionOverride(n,i.action)}))}setPermissionOverride(t,n,r){const s=`${t}:${n}`;this._permissionOverrides.set(s,r)}clearPermissionOverride(t,n){const r=`${t}:${n}`;this._permissionOverrides.delete(r)}clearAllOverrides(t){const n=[];this._permissionOverrides.forEach((r,s)=>{s.startsWith(`${t}:`)&&n.push(s)}),n.forEach(r=>this._permissionOverrides.delete(r))}async updateCollaborator(){}async createCollaborator(){}async putCollaborators(t){}},f.AuthzIoLocalService=_R([Th(0,Qs),Th(1,Ce.Inject(Hr))],f.AuthzIoLocalService);const Nh=Ce.createIdentifier("IAuthzIoIoService"),pR=Ce.createIdentifier("univer.confirm-service");class ER{constructor(){E(this,"confirmOptions$",new se.Subject)}dispose(){this.confirmOptions$.complete()}open(t){throw new Error("This is not implemented in the test service!")}confirm(t){return Promise.resolve(!0)}close(t){throw new Error("This is not implemented in the test service!")}}const Br="FOCUSING_UNIT",qn="FOCUSING_SHEET",$r="FOCUSING_DOC",jr="FOCUSING_SLIDE",CR="FOCUSING_EDITOR_BUT_HIDDEN",Mh="EDITOR_ACTIVATED",RR="FOCUSING_EDITOR_INPUT_FORMULA",Dh="FOCUSING_FX_BAR_EDITOR",IR="FOCUSING_UNIVER_EDITOR",SR="FOCUSING_EDITOR_INPUT_FORMULA",OR="FOCUSING_COMMENT_EDITOR",vR="FOCUSING_PANEL_EDITOR",wR="FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE",bR="FOCUSING_COMMON_DRAWINGS",yR="FOCUSING_SHAPE_TEXT_EDITOR",AR="FORMULA_EDITOR_ACTIVATED";class Lh extends Ke{constructor(){super(...arguments);E(this,"_error$",new se.Subject);E(this,"error$",this._error$.asObservable())}dispose(){this._error$.complete()}emit(n){this._error$.next({errorKey:n})}}var ti=(e=>(e.URL="URL",e.UUID="UUID",e.BASE64="BASE64",e))(ti||{}),Uh=(e=>(e.SUCCUSS="0",e.ERROR_EXCEED_SIZE="1",e.ERROR_IMAGE_TYPE="2",e.ERROR_UPLOAD_COUNT_LIMIT="3",e.ERROR_IMAGE="4",e))(Uh||{});const ra=Ce.createIdentifier("core.image-io.service"),sa=Ce.createIdentifier("core.url-image.service"),TR={version:"0.15.3"};function NR(e="",t=cr.ZH_CN,n=""){return{id:e,sheetOrder:[],name:n,appVersion:TR.version,locale:t,styles:{},sheets:{},resources:[]}}class Ph{constructor(t={}){E(this,"_styles");E(this,"_cacheMap",new Ws(1e5));this._styles=t,this._generateCacheMap()}each(t){return Object.entries(this._styles).forEach(t),this}search(t,n){if(this._cacheMap.has(n))return this._cacheMap.get(n);const r=this._getExistingStyleId(t);return r||"-1"}get(t){return typeof t!="string"?t:(t=String(t),this._styles[t])}add(t,n){const r=nt(6);return this._styles[r]=t,this._cacheMap.set(n,r),r}setValue(t){if(t==null)return;const n=JSON.stringify(t),r=this.search(t,n);return r!=="-1"?r:this.add(t,n)}addCustomStyle(t,n){n!=null&&(this._styles[t]=n,this._cacheMap.set(JSON.stringify(n),t))}remove(t){const n=this._styles[t];n&&(delete this._styles[t],this._cacheMap.delete(JSON.stringify(n)))}toJSON(){return this._styles}getStyleByCell(t){let n;t&&Z.isObject(t.s)?n=t.s:n=(t==null?void 0:t.s)&&this.get(t.s);const r=t==null?void 0:t.interceptorStyle;return r?{...n,...r}:n}_generateCacheMap(){const{_styles:t,_cacheMap:n}=this;for(const r in t){const s=JSON.stringify(t[r]);n.set(s,r)}}_getExistingStyleId(t){const{_styles:n}=this;for(const r in n)if(Z.diffValue(n[r],t))return r;return null}}const MR=(e,t)=>t.length===e.length&&!e.some(n=>t.some(r=>!Yt.equals(r,n))),DR=(e,t)=>t.length===e.length&&e.every((n,r)=>{const s=t[r];return s.unitId===n.unitId&&s.sheetId===n.sheetId&&Yt.equals(n.range,s.range)}),ia={t:0,b:2,l:2,r:2},LR=e=>({sbr:.6,sbo:e,spr:.6,spo:e}),kh=90;function Wr(e,t,n={}){const r=e.length,{textRotation:s,paddingData:i,horizontalAlign:o=bt.UNSPECIFIED,verticalAlign:a=mn.UNSPECIFIED,wrapStrategy:l=gn.UNSPECIFIED,cellValueType:c}=n,{t:u,r:h,b:d,l:m}=i||ia,{vertexAngle:_,centerAngle:p}=$h(s),I={id:"d",body:{dataStream:`${e}${va}`,textRuns:[{ts:t,st:0,ed:r}],paragraphs:[{startIndex:r,paragraphStyle:{horizontalAlign:o}}],sectionBreaks:[{startIndex:r+1}]},documentStyle:{pageSize:{width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},marginTop:u,marginBottom:d,marginRight:h,marginLeft:m,renderConfig:{horizontalAlign:o,verticalAlign:a,centerAngle:p,vertexAngle:_,wrapStrategy:l,cellValueType:c}},drawings:{},drawingsOrder:[]};return new Tt(I)}function UR(e){if(!e)return{};const{tr:t,td:n,ht:r,vt:s,tb:i,pd:o}=e;return{textRotation:t,textDirection:n,horizontalAlign:r,verticalAlign:s,wrapStrategy:i,paddingData:o}}function Fh(e){if(!e)return{};const{ff:t,fs:n,it:r,bl:s,ul:i,st:o,ol:a,cl:l}=e,c={};return t&&(c.ff=t),n&&(c.fs=n),r&&(c.it=r),s&&(c.bl=s),i&&(c.ul=i),o&&(c.st=o),a&&(c.ol=a),l&&(c.cl=l),c}function xh(e,t,n){var i;const r=e.getBody();if((i=r.customRanges)!=null&&i.some(o=>o.rangeType===en.HYPERLINK))return;const s=Qe.customRange.add({ranges:[{startOffset:0,endOffset:r.dataStream.length-1,collapsed:!1}],rangeId:n,rangeType:en.HYPERLINK,body:r,properties:{url:t,refId:n}});s&&De.apply(r,s.serialize())}function Hh(e){return e!=null}function PR(){return{p:null,s:null,v:null,t:null,f:null,si:null,ref:null,xf:null}}const kR='"Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif';function Bh(e){const t=it.ff,n=it.fs;if(!e){const h=`${n}pt ${t}`;return{fontCache:h,fontString:h,fontSize:n,originFontSize:n,fontFamily:t}}let r=Ln.ITALIC;(e.it===0||e.it===void 0)&&(r=Ln.NORMAL);let s=Ln.BOLD;(e.bl===0||e.bl===void 0)&&(s=Ln.NORMAL);let i=n;e.fs&&(i=Math.ceil(e.fs));let o=t;if(e.ff){let h=e.ff;h=h.replace(/"/g,"").replace(/'/g,""),h.indexOf(" ")>-1&&(h=`"${h}"`),h==null&&(h=t),o=h}const{va:a}=e;let l=i;if(a===jt.SUBSCRIPT||a===jt.SUPERSCRIPT){const h=FR(o,l),{sbr:d,spr:m}=h;l*=a===jt.SUBSCRIPT?d:m}const c=`${r} ${s} ${l}pt ${o}`,u=`${c}, ${kR} `;return{fontCache:c,fontString:u,fontSize:l,originFontSize:i,fontFamily:o}}function FR(e,t){return LR(t)}function $h(e){const{a:t=0,v:n=ae.FALSE}=e||{a:0,v:ae.FALSE};let r=0,s=t;return n===ae.TRUE&&(r=kh,s=kh),{centerAngle:r,vertexAngle:s}}function gt(e){if(e==null||typeof e!=="object")return e;if(Array.isArray(e)){const s=e.length,i=new Array(s);for(let o=0;o<s;o++)i[o]=gt(e[o]);return i}const n={},r=Object.keys(e);for(let s=0,i=r.length;s<i;s++){const o=r[s];n[o]=gt(e[o])}return n}function jh(e){if(e==null)return e;const t={};return e.p!==void 0&&(t.p=e.p===null?null:gt(e.p)),e.s!==void 0&&(e.s===null||typeof e.s=="string"?t.s=e.s:t.s=gt(e.s)),e.v!==void 0&&(t.v=e.v),e.t!==void 0&&(t.t=e.t),e.f!==void 0&&(t.f=e.f),e.ref!==void 0&&(t.ref=e.ref),e.xf!==void 0&&(t.xf=e.xf),e.si!==void 0&&(t.si=e.si),e.custom!==void 0&&(t.custom=e.custom===null?null:gt(e.custom)),t}function xR(e){if(e==null)return e;const t={};return e.p!==void 0&&(t.p=e.p===null?null:gt(e.p)),e.s!==void 0&&(e.s===null||typeof e.s=="string"?t.s=e.s:t.s=gt(e.s)),e.v!==void 0&&(t.v=e.v),e.t!==void 0&&(t.t=e.t),e.f!==void 0&&(t.f=e.f),e.ref!==void 0&&(t.ref=e.ref),e.xf!==void 0&&(t.xf=e.xf),e.si!==void 0&&(t.si=e.si),e.custom!==void 0&&(t.custom=e.custom===null?null:gt(e.custom)),e.rowSpan!==void 0&&(t.rowSpan=e.rowSpan),e.colSpan!==void 0&&(t.colSpan=e.colSpan),e.displayV!==void 0&&(t.displayV=e.displayV),t}function Wh(e){const t={},n=Object.keys(e);for(let r=0,s=n.length;r<s;r++){const i=n[r],o=Number(i),a=e[o];if(a===void 0)continue;const l={},c=Object.keys(a);for(let u=0,h=c.length;u<h;u++){const d=c[u],m=Number(d),_=a[m];_!=null&&(l[m]=jh(_))}t[o]=l}return t}function Yh(e){const t={},n=Object.keys(e);for(let r=0,s=n.length;r<s;r++){const i=n[r],o=Number(i),a=e[o];if(a===void 0)continue;const l={};"h"in a&&a.h!==void 0&&(l.h=a.h),"ia"in a&&a.ia!==void 0&&(l.ia=a.ia),"ah"in a&&a.ah!==void 0&&(l.ah=a.ah),"hd"in a&&a.hd!==void 0&&(l.hd=a.hd),"w"in a&&a.w!==void 0&&(l.w=a.w),"s"in a&&a.s!==void 0&&(a.s===null||typeof a.s=="string"?l.s=a.s:l.s=gt(a.s)),"custom"in a&&a.custom!==void 0&&(l.custom=a.custom===null?null:gt(a.custom)),t[o]=l}return t}function HR(e){const t=e.length,n=new Array(t);for(let r=0;r<t;r++){const s=e[r];n[r]={startRow:s.startRow,startColumn:s.startColumn,endRow:s.endRow,endColumn:s.endColumn,rangeType:s.rangeType,startAbsoluteRefType:s.startAbsoluteRefType,endAbsoluteRefType:s.endAbsoluteRefType}}return n}function Vh(e){const t={id:e.id,name:e.name,tabColor:e.tabColor,hidden:e.hidden,rowCount:e.rowCount,columnCount:e.columnCount,zoomRatio:e.zoomRatio,scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,defaultColumnWidth:e.defaultColumnWidth,defaultRowHeight:e.defaultRowHeight,showGridlines:e.showGridlines,rightToLeft:e.rightToLeft,freeze:{xSplit:e.freeze.xSplit,ySplit:e.freeze.ySplit,startRow:e.freeze.startRow,startColumn:e.freeze.startColumn},rowHeader:{width:e.rowHeader.width,hidden:e.rowHeader.hidden},columnHeader:{height:e.columnHeader.height,hidden:e.columnHeader.hidden},mergeData:HR(e.mergeData),cellData:Wh(e.cellData),rowData:Yh(e.rowData),columnData:Yh(e.columnData)};return e.gridlinesColor!==void 0&&(t.gridlinesColor=e.gridlinesColor),e.defaultStyle!==void 0&&(e.defaultStyle===null||typeof e.defaultStyle=="string"?t.defaultStyle=e.defaultStyle:t.defaultStyle=gt(e.defaultStyle)),e.custom!==void 0&&(t.custom=e.custom===null?null:gt(e.custom)),t}class BR{constructor(t,n){E(this,"_columnData",{});this._config=t,this._columnData=n}getColumnData(){return this._columnData}getColVisible(t){const{_columnData:n}=this,r=n[t];return r?r.hd!==ae.TRUE:!0}getColumnStyle(t){var n;return(n=this._columnData[t])==null?void 0:n.s}setColumnStyle(t,n){const r=this.getColumnOrCreate(t);r.s=n}getHiddenCols(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getColVisible(o);s&&a?(s=!1,r.push({rangeType:pe.COLUMN,startColumn:i,endColumn:o-1,startRow:0,endRow:0})):!s&&!a&&(s=!0,i=o)}return s&&r.push({startRow:0,endRow:0,startColumn:i,endColumn:n,rangeType:pe.COLUMN}),r}getVisibleCols(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getColVisible(o);s&&!a?(s=!1,r.push({rangeType:pe.COLUMN,startColumn:i,endColumn:o-1,startRow:0,endRow:0})):!s&&a&&(s=!0,i=o)}return s&&r.push({startRow:0,endRow:0,startColumn:i,endColumn:n,rangeType:pe.COLUMN}),r}getColumnDatas(t,n){const r={};let s=0;for(let i=t;i<t+n;i++){const o=this.getColumn(i);r[s]=o!=null?o:{w:this._config.defaultColumnWidth,hd:ae.FALSE},s++}return r}getSize(){return rn(this._columnData)}getColumnWidth(t){var n,r;return(r=(n=this._columnData[t])==null?void 0:n.w)!=null?r:this._config.defaultColumnWidth}setColumnWidth(t,n){const r=this._columnData[t];n===this._config.defaultColumnWidth?r&&(delete r.w,Object.keys(r).length===0&&delete this._columnData[t]):this._columnData[t]=r?{...r,w:n}:{w:n}}getColumn(t){return this._columnData[t]}removeColumn(t){delete this._columnData[t]}getColumnOrCreate(t){const{_columnData:n}=this,r=n[t];if(r)return r;const s={};return this._columnData[t]=s,s}setCustomMetadata(t,n){const r=this.getColumn(t);r&&(r.custom=n)}getCustomMetadata(t){var n;return(n=this.getColumn(t))==null?void 0:n.custom}}const $R=2e3;class jR{constructor(t,n,r){E(this,"_rowData");this._config=t,this._viewModel=n,this._rowData=r}getRowData(){return this._rowData}getRowStyle(t){var n;return(n=this._rowData[t])==null?void 0:n.s}setRowStyle(t,n){const r=this.getRowOrCreate(t);r.s=n}getRowDatas(t,n){const r={};let s=0;for(let i=t;i<t+n;i++){const o=this.getRow(i);r[s]=o!=null?o:{h:this._config.defaultRowHeight,hd:ae.FALSE},s++}return r}getRowHeight(t,n=1){const{_rowData:r}=this,s=this._config;let i=0;for(let o=0;o<n;o++){const a=r[o+t]||{hd:ae.FALSE,h:s.defaultRowHeight},{ia:l,ah:c,h:u=s.defaultRowHeight}=a;i+=(l==null||l===ae.TRUE)&&typeof c=="number"?c:u}return i}setRowHeight(t,n){const r=this._rowData[t];if(n===this._config.defaultRowHeight)r&&(delete r.h,Object.keys(r).length===0&&delete this._rowData[t]);else{const s=Math.min(n,$R);this._rowData[t]=r?{...r,h:s}:{h:s}}}getRow(t){return this._rowData[t]}removeRow(t){delete this._rowData[t]}getRowOrCreate(t){const{_rowData:n}=this,r=n[t];if(r)return r;const s={};return n[t]=s,s}getHiddenRows(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getRowRawVisible(o);s&&a?(s=!1,r.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:pe.ROW})):!s&&!a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:n,startColumn:0,endColumn:0,rangeType:pe.ROW}),r}getVisibleRows(t=0,n=this.getSize()-1){const r=[];let s=!1,i=-1;for(let o=t;o<=n;o++){const a=this.getRowRawVisible(o);s&&!a?(s=!1,r.push({startRow:i,endRow:o-1,startColumn:0,endColumn:0,rangeType:pe.ROW})):!s&&a&&(s=!0,i=o)}return s&&r.push({startRow:i,endRow:n,startColumn:0,endColumn:0,rangeType:pe.ROW}),r}getRowRawVisible(t){const n=this.getRow(t);return n?n.hd!==ae.TRUE:!0}getSize(){return rn(this._rowData)}setCustomMetadata(t,n){const r=this.getRow(t);r&&(r.custom=n)}getCustomMetadata(t){var n;return(n=this.getRow(t))==null?void 0:n.custom}}const WR="DEFAULT_WORKSHEET_ROW_COUNT",zh=1e3,YR="DEFAULT_WORKSHEET_COLUMN_COUNT",Gh=20,VR="DEFAULT_WORKSHEET_ROW_HEIGHT",Kh=24,zR="DEFAULT_WORKSHEET_COLUMN_WIDTH",Xh=88,GR="DEFAULT_WORKSHEET_ROW_TITLE_WIDTH",qh=46,KR="DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT",Jh=20;function Zh(e){const t={name:"Sheet1",id:"sheet-01",tabColor:"",hidden:ae.FALSE,rowCount:zh,columnCount:Gh,zoomRatio:1,freeze:{xSplit:0,ySplit:0,startRow:-1,startColumn:-1},scrollTop:0,scrollLeft:0,defaultColumnWidth:Xh,defaultRowHeight:Kh,mergeData:[],cellData:{},rowData:{},columnData:{},showGridlines:ae.TRUE,rowHeader:{width:qh,hidden:ae.FALSE},columnHeader:{height:Jh,hidden:ae.FALSE},rightToLeft:ae.FALSE};return Object.keys(t).forEach(n=>{const r=n;typeof e[r]>"u"&&(e[r]=t[r])}),e}class XR extends Ke{constructor(n){super();E(this,"_cellCache",new Map);E(this,"_rowCache",new Map);E(this,"_columnCache",new Map);E(this,"_hasRow",!1);E(this,"_hasColumn",!1);E(this,"_hasAll",!1);E(this,"_allIndex",-1);E(this,"_mergeData");E(this,"_rangeMap",new Ws(5e4));this._init(n.concat())}_init(n){this._mergeData=n,this._createCache(n)}_clearCache(){this._cellCache.clear(),this._rowCache.clear(),this._columnCache.clear(),this._hasAll=!1,this._allIndex=-1,this._rangeMap.clear(),this._hasColumn=!1,this._hasRow=!1}_createCache(n){let r=0;for(const s of n){const{rangeType:i}=s;i===pe.ROW?this._createRowCache(s,r):i===pe.COLUMN?this._createColumnCache(s,r):i===pe.ALL?this._createCellAllCache(r):this._createCellCache(s,r),r++}}rebuild(n){this._clearCache(),this._init(n.concat())}_createRowCache(n,r){const{startRow:s,endRow:i}=n;for(let o=s;o<=i;o++)this._rowCache.set(o,r),this._hasRow=!0}_createColumnCache(n,r){const{startColumn:s,endColumn:i}=n;for(let o=s;o<=i;o++)this._columnCache.set(o,r),this._hasColumn=!0}_createCellAllCache(n){this._hasAll=!0,this._allIndex=n}_createCellCache(n,r){for(let s=n.startRow;s<=n.endRow;s++){let i=this._cellCache.get(s);i==null&&(i=new Map,this._cellCache.set(s,i));for(let o=n.startColumn;o<=n.endColumn;o++)i.set(o,r)}}add(n){this._mergeData.push(n),this._clearCache(),this._createCache(this._mergeData)}remove(n,r){const s=this._getMergeDataIndex(n,r);s!==-1&&(this._mergeData.splice(s,1),this._clearCache(),this._createCache(this._mergeData))}getMergedCell(n,r){const s=this._getMergeDataIndex(n,r);return s!==-1?this._mergeData[s]:null}getMergeDataIndex(n,r){return this._getMergeDataIndex(n,r)}isRowContainsMergedCell(n){return this._hasAll||!Z.isEmptyObject(this._columnCache)?!0:this._mergeData.some(r=>r.startRow<=n&&n<=r.endRow)}isColumnContainsMergedCell(n){return this._hasAll||!Z.isEmptyObject(this._rowCache)?!0:this._mergeData.some(r=>r.startColumn<=n&&n<=r.endColumn)}getMergedCellRange(n,r,s,i){const o=[],a=`${n}-${r}-${s}-${i}`;if(this._rangeMap.has(a))return this._getRangeFromCache(a);let l=0;const c=[];for(const u of this._mergeData||[])Yt.intersects(u,{startRow:n,endRow:s,startColumn:r,endColumn:i})&&(o.push({...u}),c.push(l)),l++;return this._rangeMap.set(a,c),o}_getRangeFromCache(n){const r=this._rangeMap.get(n)||[],s=[];for(const i of r)s.push({...this._mergeData[i]});return s}_getMergeDataIndex(n,r){var i;if(this._hasAll)return this._allIndex;if(this._hasRow){const o=this._rowCache.get(n);if(o!==void 0)return o}if(this._hasColumn){const o=this._columnCache.get(r);if(o!==void 0)return o}const s=(i=this._cellCache.get(n))==null?void 0:i.get(r);return s!==void 0?s:-1}getMergeDataSnapshot(){return this._mergeData}dispose(){this._clearCache(),this._mergeData=[]}}class Qh extends Ke{constructor(n){super();E(this,"_cellContentInterceptor",null);E(this,"_rowFilteredInterceptor",null);this.getRawCell=n}dispose(){super.dispose(),this._cellContentInterceptor=null,this._rowFilteredInterceptor=null}getCell(n,r,s,i){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,An.Value|An.Style,s,i):this.getRawCell(n,r)}getCellValueOnly(n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,An.Value):this.getRawCell(n,r)}getCellStyleOnly(n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,An.Style):this.getRawCell(n,r)}getRowFiltered(n){var r,s;return(s=(r=this._rowFilteredInterceptor)==null?void 0:r.getRowFiltered(n))!=null?s:!1}registerCellContentInterceptor(n){if(this._cellContentInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._cellContentInterceptor=n,Ye(()=>this._cellContentInterceptor=null)}registerRowFilteredInterceptor(n){if(this._rowFilteredInterceptor)throw new Error("[SheetViewModel]: Interceptor already registered.");return this._rowFilteredInterceptor=n,Ye(()=>this._rowFilteredInterceptor=null)}}const ed={isDeepClone:!1,displayRawFormula:!1,ignoreTextRotation:!1};class Yr{constructor(t,n,r){E(this,"_sheetId");E(this,"_snapshot");E(this,"_cellData");E(this,"_rowManager");E(this,"_columnManager");E(this,"_viewModel");E(this,"_spanModel");E(this,"_isRowStylePrecedeColumnStyle",!0);E(this,"_getCellHeight");var a;this.unitId=t,this._styles=r,this._snapshot=Zh(n);const{columnData:s,rowData:i,cellData:o}=this._snapshot;this._sheetId=(a=this._snapshot.id)!=null?a:nt(6),this._cellData=new ct(o),this._viewModel=new Qh((l,c)=>this.getCellRaw(l,c)),this._rowManager=new jR(this._snapshot,this._viewModel,i),this._columnManager=new BR(this._snapshot,s),this._spanModel=new XR(this._snapshot.mergeData)}__interceptViewModel(t){t(this._viewModel)}__registerGetCellHeight(t){return this._getCellHeight=t,Ye(()=>{this._getCellHeight=null})}getSnapshot(){return this._snapshot}getCellHeight(t,n){return this._getCellHeight?this._getCellHeight(t,n):this._snapshot.defaultRowHeight}setMergeData(t){this._snapshot.mergeData=t,this.getSpanModel().rebuild(t)}getSpanModel(){return this._spanModel}setIsRowStylePrecedeColumnStyle(t){this._isRowStylePrecedeColumnStyle=t}getStyleDataByHash(t){return{...this._styles.get(t)}}setStyleData(t){return this._styles.setValue(t)}getColumnStyle(t,n=!1){return n?this._columnManager.getColumnStyle(t):this._styles.get(this._columnManager.getColumnStyle(t))}setColumnStyle(t,n){this._columnManager.setColumnStyle(t,n)}getRowStyle(t,n=!1){return n?this._rowManager.getRowStyle(t):this._styles.get(this._rowManager.getRowStyle(t))}setRowStyle(t,n){this._rowManager.setRowStyle(t,n)}getDefaultCellStyle(){return this._snapshot.defaultStyle}getDefaultCellStyleInternal(){const t=this._snapshot.defaultStyle;return this._styles.get(t)}setDefaultCellStyle(t){this._snapshot.defaultStyle=t}getCellStyle(t,n){const r=this.getCell(t,n);if(r){const s=r.s;return typeof s=="string"?this._styles.get(s):s}return null}getComposedCellStyle(t,n,r){const s=this.getDefaultCellStyleInternal(),i=this.getRowStyle(t),o=this.getColumnStyle(n),a=this.getCell(t,n),l=this._styles.getStyleByCell(a);return(r!=null?r:this._isRowStylePrecedeColumnStyle)?lr(s,o,i,a==null?void 0:a.themeStyle,l):lr(s,i,o,a==null?void 0:a.themeStyle,l)}getComposedCellStyleByCellData(t,n,r,s){const i=this.getDefaultCellStyleInternal(),o=this.getRowStyle(t),a=this.getColumnStyle(n),l=this._styles.getStyleByCell(r);return(s!=null?s:this._isRowStylePrecedeColumnStyle)?lr(i,a,o,r==null?void 0:r.themeStyle,l):lr(i,o,a,r==null?void 0:r.themeStyle,l)}getComposedCellStyleWithoutSelf(t,n,r,s){const i=r===void 0?this.getComposedCellStyle(t,n,s):this.getComposedCellStyleByCellData(t,n,r,s),o=this.getCellRaw(t,n);if(!o||!o.s)return i;const a=typeof o.s=="string"?this._styles.get(o.s):o.s;if(!a)return i;for(const l in a)l in i&&delete i[l];return i}getCellMatrix(){return this._cellData}getCellMatrixPrintRange(){const t=this.getCellMatrix(),n=this.getMergeData();let r=-1,s=-1,i=-1,o=-1,a=!1,l=!1;return t.forEach((c,u)=>{Object.keys(u).forEach(h=>{const d=+h,m=t.getValue(c,d),_=m!=null&&m.s?this._styles.get(m.s):null,p=(_==null?void 0:_.bd)&&(_.bd.b||_.bd.l||_.bd.r||_.bd.t||_.bd.bc_tr||_.bd.bl_tr||_.bd.ml_tr||_.bd.tl_bc||_.bd.tl_br||_.bd.tl_mr);(m&&(m.v!==null&&m.v!==void 0&&m.v!==""||m.p)||_!=null&&_.bg||p)&&(a?r=Math.min(r,c):(r=c,a=!0),s=Math.max(s,c),l?i=Math.min(i,d):(l=!0,i=d),o=Math.max(o,d))})}),n.forEach(c=>{a?r=Math.min(r,c.startRow):(r=c.startRow,a=!0),s=Math.max(s,c.endRow),l?i=Math.min(i,c.startColumn):(i=c.startColumn,a=!0),o=Math.max(o,c.endColumn)}),!a||!l?null:{startColumn:i,startRow:r,endColumn:o,endRow:s}}getRowManager(){return this._rowManager}getUnitId(){return this.unitId}getSheetId(){return this._sheetId}getColumnManager(){return this._columnManager}getName(){return this._snapshot.name}clone(){const{_snapshot:t}=this,n=Vh(t);return new Yr(this.unitId,n,this._styles)}getMergeData(){return this._spanModel.getMergeDataSnapshot()}getMergedCell(t,n){return this._spanModel.getMergedCell(t,n)}getMergedCellRange(t,n,r,s){return this._spanModel.getMergedCellRange(t,n,r,s)}isRowContainsMergedCell(t){return this._spanModel.isRowContainsMergedCell(t)}isColumnContainsMergedCell(t){return this._spanModel.isColumnContainsMergedCell(t)}getCellInfoInMergeData(t,n){const r=this.getMergedCell(t,n);let s=!1,i=!1,o=t,a=n,l=t,c=n;if(r){const{startRow:u,endRow:h,startColumn:d,endColumn:m}=r;t===u&&n===d?(o=h,a=m,l=u,c=d,i=!0):t>=u&&t<=h&&n>=d&&n<=m&&(o=h,a=m,l=u,c=d,s=!0)}return{actualRow:t,actualColumn:n,isMergedMainCell:i,isMerged:s,endRow:o,endColumn:a,startRow:l,startColumn:c}}getCell(t,n){return t<0||n<0?null:this._viewModel.getCell(t,n)}getCellValueOnly(t,n){return t<0||n<0?null:this._viewModel.getCellValueOnly(t,n)}getCellStyleOnly(t,n){return t<0||n<0?null:this._viewModel.getCellStyleOnly(t,n)}getCellRaw(t,n){return this.getCellMatrix().getValue(t,n)}getCellWithFilteredInterceptors(t,n,r,s){return this._viewModel.getCell(t,n,r,s)}getRowFiltered(t){return this._viewModel.getRowFiltered(t)}getRangeFilterRows(t){const n=[];for(let r=t.startRow;r<=t.endRow;r++)this.getRowFiltered(r)&&n.push(r);return n}getMatrixWithMergedCells(t,n,r,s,i=Pn.Raw){const o=this.getCellMatrix(),a=this._spanModel.getMergedCellRange(t,n,r,s),l=new ct;return Yo(t,r,n,s).forEach((c,u)=>{var d;let h;if(i===Pn.Raw)h=this.getCellRaw(c,u);else if(i===Pn.Intercepted)h=this.getCell(c,u);else if(i===Pn.Both){const m=this.getCellRaw(c,u);if(m){h={...m};const _=(d=this.getCell(c,u))==null?void 0:d.v;Hh(_)&&h&&(h.displayV=String(_))}}h&&l.setValue(c,u,h)}),a.forEach(c=>{const{startColumn:u,startRow:h,endColumn:d,endRow:m}=c;Yo(h,m,u,d).forEach((_,p)=>{_===h&&p===u&&l.setValue(_,p,{...o.getValue(_,p),rowSpan:m-h+1,colSpan:d-u+1}),(_!==h||p!==u)&&l.realDeleteValue(_,p)})}),l}getRange(t,n,r,s){return typeof t=="object"?new Yn(this,t,{getStyles:()=>this._styles}):new Yn(this,{startRow:t,startColumn:n,endColumn:s||n,endRow:r||t},{getStyles:()=>this._styles})}getScrollLeftTopFromSnapshot(){return{scrollLeft:this._snapshot.scrollLeft,scrollTop:this._snapshot.scrollTop}}getZoomRatio(){return this._snapshot.zoomRatio||1}getConfig(){return this._snapshot}getFreeze(){return this._snapshot.freeze}getMaxColumns(){const{_snapshot:t}=this,{columnCount:n}=t;return n}getMaxRows(){const{_snapshot:t}=this,{rowCount:n}=t;return n}getRowCount(){return this._snapshot.rowCount}setRowCount(t){this._snapshot.rowCount=t}getColumnCount(){return this._snapshot.columnCount}setColumnCount(t){this._snapshot.columnCount=t}isSheetHidden(){return this._snapshot.hidden}hasHiddenGridlines(){const{_snapshot:t}=this,{showGridlines:n}=t;return n===0}getGridlinesColor(){return this.getConfig().gridlinesColor}getTabColor(){const{_snapshot:t}=this,{tabColor:n}=t;return n}getColumnWidth(t){return this.getColumnManager().getColumnWidth(t)}getRowHeight(t){return this._viewModel.getRowFiltered(t)?0:this.getRowManager().getRowHeight(t)}isRowFiltered(t){return this._viewModel.getRowFiltered(t)}getRowVisible(t){return!this.isRowFiltered(t)&&this.getRowRawVisible(t)}getRowRawVisible(t){return this.getRowManager().getRowRawVisible(t)}getHiddenRows(t,n){const r=this.getMaxColumns()-1,s=this._rowManager.getHiddenRows(t,n);return s.forEach(i=>i.endColumn=r),s}getColVisible(t){return this._columnManager.getColVisible(t)}getHiddenCols(t,n){const r=this.getMaxRows()-1,s=this._columnManager.getHiddenCols(t,n);return s.forEach(i=>i.endRow=r),s}getVisibleRows(){const t=this.getRowCount();return this._rowManager.getVisibleRows(0,t-1)}getVisibleCols(){const t=this.getColumnCount();return this._columnManager.getVisibleCols(0,t-1)}isRightToLeft(){const{_snapshot:t}=this,{rightToLeft:n}=t;return n}getLastRowWithContent(){return this._cellData.getRealRowRange().endRow}getLastColumnWithContent(){return this.getDataRealRange().endColumn}getDataRealRange(){return this._cellData.getRealRange()}getDataRangeScope(){return this._cellData.getStartEndScope()}cellHasValue(t){return t&&(t.v!==void 0||t.f!==void 0||t.p!==void 0)}iterateByRow(t,n=!0){const{startRow:r,startColumn:s,endRow:i,endColumn:o}=t,a=this;return{[Symbol.iterator]:()=>{let l=r,c=s;return{next(){for(;;){if(c>o&&(l+=1,c=s),l>i)return{done:!0,value:void 0};const u=a.getCell(l,c),h=!u,d=a.getMergedCell(l,c);if(d){if(l!==d.startRow||c!==d.startColumn){c=d.endColumn+1;continue}if(h&&n){c=d.endColumn+1;continue}const _={row:l,col:c,value:u};return _.colSpan=d.endColumn-d.startColumn+1,_.rowSpan=d.endRow-d.startRow+1,c=d.endColumn+1,{done:!1,value:_}}if(h&&n)c+=1;else{const m={row:l,col:c,value:u};return c+=1,{done:!1,value:m}}}}}}}}iterateByColumn(t,n=!0,r=!0){const{startRow:s,startColumn:i,endRow:o,endColumn:a}=t,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 _=c!==h.startRow,p=_||u!==h.startColumn;if(r&&p||!r&&_){c=h.endRow+1;continue}const I=l.getCell(h.startRow,h.startColumn);if(!I&&n){c=h.endRow+1;continue}const H={row:c,col:h.startColumn,value:I};return H.colSpan=h.endColumn-h.startColumn+1,H.rowSpan=h.endRow-h.startRow+1,c=h.endRow+1,{done:!1,value:H}}const d=l.getCell(c,u);if(!d&&n)c+=1;else{const _={row:c,col:u,value:d};return c+=1,{done:!1,value:_}}}}}}}}getCellDocumentModel(t,n,r=ed){var p;if(!t)return;const{isDeepClone:s,displayRawFormula:i,ignoreTextRotation:o}={...ed,...r};let a,l="document";const c=UR(n),u=o?it.tr:c.textRotation||it.tr;let h=c.horizontalAlign||it.ht;const d=c.verticalAlign||it.vt,m=c.wrapStrategy||it.tb,_=c.paddingData||ia;if(t.f&&i)a=Wr(t.f.toString(),{},{verticalAlign:d}),h=it.ht;else if(t.p){const{centerAngle:I,vertexAngle:y}=$h(u);a=this._updateConfigAndGetDocumentModel(s?Z.deepClone(t.p):t.p,h,_,{horizontalAlign:h,verticalAlign:d,centerAngle:I,vertexAngle:y,wrapStrategy:m,zeroWidthParagraphBreak:1})}else if(t.v!=null){const I=Fh(n);l=Bh(I).fontCache;let y=td(t);t.t===Qt.FORCE_STRING&&i&&(y=`'${y}`),a=Wr(y,I,{...c,textRotation:u,cellValueType:t.t})}return a&&t.linkUrl&&t.linkId&&xh(a,t.linkUrl,t.linkId),{documentModel:a,fontString:l,textRotation:u,wrapStrategy:m,verticalAlign:d,horizontalAlign:h,paddingData:_,fill:(p=n==null?void 0:n.bg)==null?void 0:p.rgb}}_updateConfigAndGetDocumentModel(t,n,r,s){var o,a,l,c,u;if(!s||!((o=t.body)!=null&&o.dataStream))return;t.documentStyle||(t.documentStyle={}),t.documentStyle.marginTop=(a=r.t)!=null?a:0,t.documentStyle.marginBottom=(l=r.b)!=null?l:2,t.documentStyle.marginLeft=(c=r.l)!=null?c:2,t.documentStyle.marginRight=(u=r.r)!=null?u:2,t.documentStyle.pageSize={width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},t.documentStyle.renderConfig={...t.documentStyle.renderConfig,...s};const i=t.body.paragraphs||[];for(const h of i)h.paragraphStyle||(h.paragraphStyle={}),h.paragraphStyle.horizontalAlign=n;return new Tt(t)}getBlankCellDocumentModel(t,n,r){const s=this.getComposedCellStyleByCellData(n,r,t),i=Fh(s),o=this.getCellDocumentModel(t,s,{ignoreTextRotation:!0});if(o!=null)return o.documentModel==null&&(o.documentModel=Wr("",i)),o;const a="";let l="document";const c=it.tr,u=it.ht,h=it.vt,d=it.tb,m=ia;return l=Bh({}).fontCache,{documentModel:Wr(a,i),fontString:l,textRotation:c,wrapStrategy:d,verticalAlign:h,horizontalAlign:u,paddingData:m}}getCellDocumentModelWithFormula(t,n,r){const s=this.getComposedCellStyleByCellData(n,r,t);return this.getCellDocumentModel(t,s,{isDeepClone:!0,displayRawFormula:!0,ignoreTextRotation:!0})}getCustomMetadata(){return this._snapshot.custom}setCustomMetadata(t){this._snapshot.custom=t}}function td(e){var r,s;if(!e)return"";const t=(s=(r=e.p)==null?void 0:r.body)==null?void 0:s.dataStream;if(t)return Qe.transform.getPlainText(t);const n=e.v;return typeof n=="string"?e.t===Qt.BOOLEAN?n.toUpperCase():n.replace(/[\r\n]/g,""):typeof n=="number"?e.t===Qt.BOOLEAN?n?"TRUE":"FALSE":n.toString():typeof n=="boolean"?n?"TRUE":"FALSE":""}function qR(e){if(e===null)return"";if(e!=null&&e.p){const t=e==null?void 0:e.p.body;if(t==null)return"";const n=t.dataStream;return Qe.transform.getPlainText(n)}return e==null?void 0:e.v}var JR=Object.getOwnPropertyDescriptor,ZR=(e,t,n,r)=>{for(var s=r>1?void 0:r?JR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},QR=(e,t)=>(n,r)=>t(n,r,e);function eI(e,t){return`${e.getUnitId()}|${t.getSheetId()}`}f.Workbook=class extends os{constructor(n={},r){super();E(this,"type",we.UNIVER_SHEET);E(this,"_sheetCreated$",new se.Subject);E(this,"sheetCreated$",this._sheetCreated$.asObservable());E(this,"_sheetDisposed$",new se.Subject);E(this,"sheetDisposed$",this._sheetDisposed$.asObservable());E(this,"_activeSheet$",new se.BehaviorSubject(null));E(this,"activeSheet$",this._activeSheet$.asObservable());E(this,"_worksheets");E(this,"_styles");E(this,"_snapshot");E(this,"_unitId");E(this,"_count");E(this,"_name$");E(this,"name$");this._logService=r;const s=NR();Z.isEmptyObject(n)?this._snapshot=s:this._snapshot=Z.commonExtend(s,n);const{styles:i}=this._snapshot;(this._snapshot.id==null||this._snapshot.id.length===0)&&(this._snapshot.id=nt(6)),this._unitId=this._snapshot.id,this._styles=new Ph(i),this._count=1,this._worksheets=new Map,this._name$=new se.BehaviorSubject(n.name||""),this.name$=this._name$.asObservable(),this._parseWorksheetSnapshots()}get _activeSheet(){return this._activeSheet$.getValue()}get name(){return this._name$.getValue()}static isIRangeType(n){return typeof n=="string"||"startRow"in n||"row"in n}dispose(){super.dispose(),this._sheetCreated$.complete(),this._sheetDisposed$.complete(),this._activeSheet$.complete(),this._name$.complete(),Array.from(this._worksheets.keys()).forEach(r=>{this._removeSheet(r)})}save(){return Z.deepClone(this._snapshot)}getSnapshot(){return this._snapshot}getName(){return this._snapshot.name}setName(n){this._name$.next(n),this._snapshot.name=n}getUnitId(){return this._unitId}getRev(){var n;return(n=this._snapshot.rev)!=null?n:1}incrementRev(){this._snapshot.rev=this.getRev()+1}setRev(n){this._snapshot.rev=n}addWorksheet(n,r,s){const{sheets:i,sheetOrder:o}=this._snapshot;if(i[n])return!1;i[n]=s,o.splice(r,0,n),this.ensureSheetOrderUnique();const a=new Yr(this._unitId,s,this._styles);return this._worksheets.set(n,a),this._sheetCreated$.next(a),!0}getSheetOrders(){return this._snapshot.sheetOrder}ensureSheetOrderUnique(){const n=new Set,r=[];for(const s of this._snapshot.sheetOrder)n.has(s)||(n.add(s),r.push(s));this._snapshot.sheetOrder=r,n.clear()}getWorksheets(){return this._worksheets}getActiveSpreadsheet(){return this}getStyles(){return this._styles}addStyles(n){Object.entries(n).forEach(([r,s])=>{this._styles.addCustomStyle(r,s)})}removeStyles(n){n.forEach(r=>{this._styles.remove(r)})}getConfig(){return this._snapshot}getIndexBySheetId(n){const{sheetOrder:r}=this._snapshot;return r.findIndex(s=>s===n)}getActiveSheet(n){if(!this._activeSheet&&typeof n>"u")throw new Error(`[Workbook]: no active Worksheet on Workbook ${this._unitId}!`);return this._activeSheet}ensureActiveSheet(){const n=this._activeSheet;if(n)return n;const r=this._snapshot.sheetOrder;for(let i=0,o=r.length;i<o;i++){const a=this._worksheets.get(r[i]);if(a&&a.isSheetHidden()!==ae.TRUE)return this.setActiveSheet(a),a}const s=this._worksheets.get(r[0]);return this.setActiveSheet(s),s}setActiveSheet(n){this._activeSheet$.next(n)}_removeSheet(n){const r=this._worksheets.get(n);return r?(this._worksheets.delete(n),this._snapshot.sheetOrder.splice(this._snapshot.sheetOrder.indexOf(n),1),this.ensureSheetOrderUnique(),this._sheetDisposed$.next(r),!0):!1}removeSheet(n){const r=this._removeSheet(n);return r&&delete this._snapshot.sheets[n],r}getActiveSheetIndex(){const{sheetOrder:n}=this._snapshot;return n.findIndex(r=>this._worksheets.get(r)===this._activeSheet)}getSheetSize(){return this._snapshot.sheetOrder.length}getSheets(){const{sheetOrder:n}=this._snapshot;return n.map(r=>this._worksheets.get(r))}getSheetsName(){const{sheetOrder:n}=this._snapshot,r=[];return n.forEach(s=>{const i=this._worksheets.get(s);i&&r.push(i.getName())}),r}getSheetIndex(n){const{sheetOrder:r}=this._snapshot;return r.findIndex(s=>n.getSheetId()===s)}getSheetBySheetName(n){const{sheetOrder:r}=this._snapshot,s=r.find(i=>this._worksheets.get(i).getName()===n);return this._worksheets.get(s)}getSheetBySheetId(n){return this._worksheets.get(n)}getSheetByIndex(n){const{sheetOrder:r}=this._snapshot;return this._worksheets.get(r[n])}getHiddenWorksheets(){return this.getSheets().filter(n=>n.getConfig().hidden===ae.TRUE).map(n=>n.getConfig().id)}getUnhiddenWorksheets(){return this.getSheets().filter(n=>n.getConfig().hidden!==ae.TRUE).map(n=>n.getConfig().id)}load(n){this._snapshot=n}checkSheetName(n){return this.getSheetsName().some(s=>s.toLowerCase()===n.toLowerCase())}uniqueSheetName(n="Sheet1"){let r=n;for(;this.checkSheetName(r);)r=n+this._count,this._count++;return r}generateNewSheetName(n){let r=n+this._count;for(;this.checkSheetName(r);)r=n+this._count,this._count++;return r}_parseWorksheetSnapshots(){const{_snapshot:n,_worksheets:r}=this,{sheets:s,sheetOrder:i}=n;if(Z.isEmptyObject(s)){const o=nt();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 Yr(this._unitId,a,this._styles);r.set(o,c),i.includes(o)||i.push(o)}this.ensureSheetOrderUnique(),this.ensureActiveSheet()}getCustomMetadata(){return this._snapshot.custom}setCustomMetadata(n){this._snapshot.custom=n}},f.Workbook=ZR([QR(1,dt)],f.Workbook);class oa extends os{constructor(n){var r;super();E(this,"type",we.UNIVER_SLIDE);E(this,"_activePage$",new se.BehaviorSubject(null));E(this,"activePage$",this._activePage$.asObservable());E(this,"_name$");E(this,"name$");E(this,"_snapshot");E(this,"_unitId");this._snapshot={...$u,...n},this._unitId=(r=this._snapshot.id)!=null?r:nt(6),this._name$=new se.BehaviorSubject(this._snapshot.title),this.name$=this._name$.asObservable()}get _activePage(){var r,s;const n=this._activePage$.getValue();if(!n){const i=(r=this.getPageOrder())==null?void 0:r[0];return i?(s=this.getPages())==null?void 0:s[i]:null}return n}setName(n){var r;this._snapshot.title=n,this._name$.next(n),this._unitId=(r=this._snapshot.id)!=null?r:nt(6)}getRev(){return 0}incrementRev(){}setRev(n){}getSnapshot(){return this._snapshot}getUnitId(){return this._unitId}getPages(){var n;return(n=this._snapshot.body)==null?void 0:n.pages}getPageOrder(){var n;return(n=this._snapshot.body)==null?void 0:n.pageOrder}getPage(n){const r=this.getPages();return r==null?void 0:r[n]}getElementsByPage(n){var r;return(r=this.getPage(n))==null?void 0:r.pageElements}getElement(n,r){var s;return(s=this.getElementsByPage(n))==null?void 0:s[r]}getPageSize(){return this._snapshot.pageSize}getBlankPage(){const n=nt(6);return{id:n,pageType:Ni.SLIDE,zIndex:10,title:n,description:"",pageBackgroundFill:{rgb:"rgb(255,255,255)"},pageElements:{}}}setActivePage(n){this._activePage$.next(n)}getActivePage(){return this._activePage}updatePage(n,r){this._snapshot.body&&(this._snapshot.body.pages[n]=r)}appendPage(n){var i;if(!this._snapshot.body)return;this._snapshot.body.pages[n.id]=n;const r=this._activePage,s=this._snapshot.body.pageOrder.indexOf((i=r==null?void 0:r.id)!=null?i:"");this._snapshot.body.pageOrder.splice(s+1,0,n.id)}}var tI=Object.getOwnPropertyDescriptor,nI=(e,t,n,r)=>{for(var s=r>1?void 0:r?tI(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},aa=(e,t)=>(n,r)=>t(n,r,e);const Jn=Ce.createIdentifier("univer.current");f.UniverInstanceService=class extends Ke{constructor(n,r,s){super();E(this,"_unitsByType",new Map);E(this,"_createHandler");E(this,"_ctorByType",new Map);E(this,"_currentUnits",new Map);E(this,"_currentUnits$",new se.BehaviorSubject(this._currentUnits));E(this,"currentUnits$",this._currentUnits$.asObservable());E(this,"_unitAdded$",new se.Subject);E(this,"unitAdded$",this._unitAdded$.asObservable());E(this,"_unitDisposed$",new se.Subject);E(this,"unitDisposed$",this._unitDisposed$.asObservable());E(this,"_focused$",new se.BehaviorSubject(null));E(this,"focused$",this._focused$.asObservable());this._injector=n,this._contextService=r,this._logService=s}dispose(){super.dispose(),this._focused$.complete(),this._currentUnits$.complete(),this._unitAdded$.complete(),this._currentUnits.forEach(n=>n==null?void 0:n.dispose()),this._currentUnits.clear(),this._unitsByType.clear()}__setCreateHandler(n){this._createHandler=n}createUnit(n,r,s){return this._createHandler(n,r,this._ctorByType.get(n),s)}registerCtorForType(n,r){return this._ctorByType.set(n,r),{dispose:()=>{this._ctorByType.delete(n)}}}getCurrentTypeOfUnit$(n){return this.currentUnits$.pipe(se.map(r=>{var s;return(s=r.get(n))!=null?s:null}),se.distinctUntilChanged())}getCurrentUnitForType(n){return this._currentUnits.get(n)}getCurrentUnitOfType(n){return this.getCurrentUnitForType(n)}setCurrentUnitForType(n){const r=this._getUnitById(n);if(!r)throw new Error(`[UniverInstanceService]: no document with unitId ${n}!`);this._currentUnits.set(r[1],r[0]),this._currentUnits$.next(this._currentUnits)}getTypeOfUnitAdded$(n){return this._unitAdded$.pipe(se.filter(r=>r.type===n))}__addUnit(n,r){var a;this._logService.debug(`[UniverInstanceService]: Adding unit with id ${n.getUnitId()}`);const s=n.type;this._unitsByType.has(s)||this._unitsByType.set(s,[]);const i=this._unitsByType.get(s),o=n.getUnitId();if(i.findIndex(l=>l.getUnitId()===o)!==-1)throw new Error(`[UniverInstanceService]: cannot create a unit with the same unit id: ${o}.`);i.push(n),this._unitAdded$.next(n),((a=r==null?void 0:r.makeCurrent)==null||a)&&this.setCurrentUnitForType(n.getUnitId())}getTypeOfUnitDisposed$(n){return this.unitDisposed$.pipe(se.filter(r=>r.type===n))}getUnit(n,r){var i;const s=(i=this._getUnitById(n))==null?void 0:i[0];return r&&(s==null?void 0:s.type)!==r?null:s}getCurrentUniverDocInstance(){return this.getCurrentUnitForType(we.UNIVER_DOC)}getUniverDocInstance(n){return this.getUnit(n,we.UNIVER_DOC)}getUniverSheetInstance(n){return this.getUnit(n,we.UNIVER_SHEET)}getAllUnitsForType(n){var r;return(r=this._unitsByType.get(n))!=null?r:[]}changeDoc(n,r){const s=this.getAllUnitsForType(we.UNIVER_DOC),i=s.find(o=>o.getUnitId()===n);if(i!=null){const o=s.indexOf(i);s.splice(o,1)}this.__addUnit(r)}get focused(){var r;const n=this._focused$.getValue();return n?(r=this._getUnitById(n))==null?void 0:r[0]:null}focusUnit(n){this._focused$.next(n),this.focused instanceof f.Workbook?(this._contextService.setContextValue(Br,!0),this._contextService.setContextValue($r,!1),this._contextService.setContextValue(qn,!0),this._contextService.setContextValue(jr,!1),this.setCurrentUnitForType(n)):this.focused instanceof Tt?(this._contextService.setContextValue(Br,!0),this._contextService.setContextValue($r,!0),this._contextService.setContextValue(qn,!1),this._contextService.setContextValue(jr,!1),this.setCurrentUnitForType(n)):this.focused instanceof oa?(this._contextService.setContextValue(Br,!0),this._contextService.setContextValue($r,!1),this._contextService.setContextValue(qn,!1),this._contextService.setContextValue(jr,!0),this.setCurrentUnitForType(n)):(this._contextService.setContextValue(Br,!1),this._contextService.setContextValue($r,!1),this._contextService.setContextValue(qn,!1),this._contextService.setContextValue(jr,!1))}getFocusedUnit(){return this.focused}getUnitType(n){const r=this._getUnitById(n);return r?r[1]:we.UNRECOGNIZED}disposeUnit(n){this._logService.debug(`[UniverInstanceService]: Disposing unit with id ${n}`);const r=this._getUnitById(n);if(!r)return this._logService.debug(`[UniverInstanceService]: No unit found with id ${n}`),!1;const[s,i]=r,o=this._unitsByType.get(i),a=o.indexOf(s);return o.splice(a,1),this._tryResetCurrentOnRemoval(n,i),this._tryResetFocusOnRemoval(n),this._unitDisposed$.next(s),s.dispose(),!0}_tryResetCurrentOnRemoval(n,r){const s=this.getCurrentUnitForType(r);(s==null?void 0:s.getUnitId())===n&&(this._currentUnits.set(r,null),this._currentUnits$.next(this._currentUnits))}_tryResetFocusOnRemoval(n){var r;((r=this.focused)==null?void 0:r.getUnitId())===n&&this._focused$.next(null)}_getUnitById(n){for(const[r,s]of this._unitsByType){const i=s.find(o=>o.getUnitId()===n);if(i)return[i,r]}}},f.UniverInstanceService=nI([aa(0,Ce.Inject(Ce.Injector)),aa(1,Un),aa(2,Ce.Inject(dt))],f.UniverInstanceService);var Fe=(e=>(e[e.Starting=0]="Starting",e[e.Ready=1]="Ready",e[e.Rendered=2]="Rendered",e[e.Steady=3]="Steady",e))(Fe||{});const nd={0:"Starting",1:"Ready",2:"Rendered",3:"Steady"};var rI=Object.getOwnPropertyDescriptor,sI=(e,t,n,r)=>{for(var s=r>1?void 0:r?rI(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},iI=(e,t)=>(n,r)=>t(n,r,e);class rd extends Error{constructor(t){super(`[LifecycleService]: lifecycle stage "${nd[t]}" will never be reached!`),this.name="LifecycleUnreachableError"}}f.LifecycleService=class extends Ke{constructor(n){super();E(this,"_lifecycle$",new se.BehaviorSubject(Fe.Starting));E(this,"lifecycle$",this._lifecycle$.asObservable());E(this,"_lock",!1);this._logService=n,this._reportProgress(Fe.Starting)}get stage(){return this._lifecycle$.getValue()}set stage(n){if(this._lock)throw new Error("[LifecycleService]: cannot set new stage when related logic is all handled!");if(n<this.stage)throw new Error("[LifecycleService]: lifecycle stage cannot go backward!");n!==this.stage&&(this._lock=!0,this._reportProgress(n),this._lifecycle$.next(n),this._lock=!1)}dispose(){this._lifecycle$.complete(),super.dispose()}onStage(n){return se.firstValueFrom(this.lifecycle$.pipe(se.filter(r=>r>=n),Fi(r=>r===n),se.map(()=>{}))).catch(r=>r.name==="EmptyError"?Promise.reject(new rd(n)):Promise.reject(r))}subscribeWithPrevious(){return se.merge(sd(this.stage),this._lifecycle$.pipe(se.skip(1))).pipe(Fi(n=>n===Fe.Steady))}_reportProgress(n){this._logService.debug("[LifecycleService]",`lifecycle progressed to "${nd[n]}".`)}},f.LifecycleService=sI([iI(0,dt)],f.LifecycleService);function sd(e){switch(e){case Fe.Starting:return se.of(Fe.Starting);case Fe.Ready:return se.of(Fe.Starting,Fe.Ready);case Fe.Rendered:return se.of(Fe.Starting,Fe.Ready,Fe.Rendered);default:return se.of(Fe.Starting,Fe.Ready,Fe.Rendered,Fe.Steady)}}const oI=Ce.createIdentifier("ILocalStorageService");class On extends Ke{constructor(){super();E(this,"_currentLocale$",new se.BehaviorSubject(cr.ZH_CN));E(this,"currentLocale$",this._currentLocale$.asObservable());E(this,"_locales",null);E(this,"localeChanged$",new se.Subject);E(this,"t",(n,...r)=>{if(!this._locales)throw new Error("[LocaleService]: Locale not initialized");const s=n.split("."),i=this.resolveKeyPath(this._locales[this._currentLocale],s);if(typeof i=="string"){let o=i;return r.forEach((a,l)=>{o=o.replace(`{${l}}`,a)}),o}else return n});this.disposeWithMe(Ye(()=>{this._locales=null,this._currentLocale$.complete(),this.localeChanged$.complete()}))}get _currentLocale(){return this._currentLocale$.value}load(n){var r;this._locales=ss((r=this._locales)!=null?r:{},n)}setLocale(n){this._currentLocale$.next(n),this.localeChanged$.next()}getLocales(){var n;return(n=this._locales)==null?void 0:n[this._currentLocale]}getCurrentLocale(){return this._currentLocale}resolveKeyPath(n,r){const s=r.shift();if(s&&n&&s in n){const i=n[s];return r.length>0&&(typeof i=="object"||Array.isArray(i))?this.resolveKeyPath(i,r):i}return null}}var aI=Object.getOwnPropertyDescriptor,lI=(e,t,n,r)=>{for(var s=r>1?void 0:r?aI(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},cI=(e,t)=>(n,r)=>t(n,r,e);f.MentionIOLocalService=class{constructor(t){this._userManagerService=t}async list(t){return{list:[{type:as.PERSON,mentions:[{objectType:as.PERSON,objectId:this._userManagerService.getCurrentUser().userID,label:this._userManagerService.getCurrentUser().name,metadata:{icon:this._userManagerService.getCurrentUser().avatar}}],metadata:{},title:"PEOPLE"}],page:t.page,size:t.size,total:1}}},f.MentionIOLocalService=lI([cI(0,Ce.Inject(Hr))],f.MentionIOLocalService);const id=Ce.createIdentifier("univer.service.mention-io");var la=(e=>(e.INIT="init",e.FETCHING="fetching",e.DONE="done",e))(la||{});const od=Ce.createIdentifier("univer.permission-service");class ad extends Ke{constructor(){super(...arguments);E(this,"_permissionPointMap",new Map);E(this,"_permissionPointUpdate$",new se.Subject);E(this,"permissionPointUpdate$",this._permissionPointUpdate$.asObservable());E(this,"_showComponents",!0)}setShowComponents(n){this._showComponents=n}getShowComponents(){return this._showComponents}deletePermissionPoint(n){const r=this._permissionPointMap.get(n);r&&(r.complete(),this._permissionPointMap.delete(n))}addPermissionPoint(n){const r=n instanceof se.BehaviorSubject,s=r?n.getValue():n;return s.id?this._permissionPointMap.get(s.id)?(console.warn(`${s.id} PermissionPoint already exists`),!1):(this._permissionPointMap.set(s.id,r?n:new se.BehaviorSubject(s)),this._permissionPointUpdate$.next(s),!0):!1}updatePermissionPoint(n,r){const s=this._permissionPointMap.get(n);if(!s)return;const i=s.getValue();i.value=r,i.status=la.DONE,s.next(i),this._permissionPointUpdate$.next(i)}clearPermissionMap(){this._permissionPointMap.clear()}getPermissionPoint(n){const r=this._permissionPointMap.get(n);if(r)return r.getValue()}getPermissionPoint$(n){const r=this._permissionPointMap.get(n);if(r)return r}composePermission$(n){const r=n.map(s=>{var o;const i=(o=this._permissionPointMap)==null?void 0:o.get(s);if(!i)throw new Error(`[PermissionService]: ${s} permissionPoint does not exist!`);return i.asObservable()});return se.combineLatest(r).pipe(Xr.map(s=>s))}composePermission(n){return n.map(s=>{var o;const i=(o=this._permissionPointMap)==null?void 0:o.get(s);if(!i)throw new Error(`[PermissionService]: ${s} permissionPoint does not exist!`);return i.getValue()})}getAllPermissionPoint(){const n=new Map;return this._permissionPointMap.forEach((r,s)=>{n.set(s,r)}),n}}function ld(e,t){if(!t)return e;const n=[];for(const r of e){const s=t.find(([i])=>i===r[0]);if(s){if(s[1]===null)continue;n.push([r[0],s[1]])}else n.push(r)}return n}var uI=Object.getOwnPropertyDescriptor,hI=(e,t,n,r)=>{for(var s=r>1?void 0:r?uI(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},ca=(e,t)=>(n,r)=>t(n,r,e);const dI=4,cd=Symbol("DependentOn");class ua extends Ke{onStarting(){}onReady(){}onRendered(){}onSteady(){}getUnitType(){return this.constructor.type}getPluginName(){return this.constructor.pluginName}}E(ua,"pluginName"),E(ua,"type",we.UNIVER_UNKNOWN);class fI{constructor(){E(this,"_plugins",[])}addPlugin(t){this._plugins.push(t)}removePlugins(){const t=this._plugins.slice();return this._plugins.length=0,t}forEachPlugin(t){this._plugins.forEach(t)}}function mI(...e){return function(t){t[cd]=e}}f.PluginService=class{constructor(t,n,r){E(this,"_pluginRegistry",new Map);E(this,"_pluginStore",new fI);E(this,"_seenPlugins",new Set);E(this,"_loadedPlugins",new Set);E(this,"_loadedPluginTypes",new Set([we.UNIVER_UNKNOWN]));E(this,"_flushTimerByType",new Map);this._injector=t,this._lifecycleService=n,this._logService=r}dispose(){this._pluginStore.removePlugins().forEach(t=>t.dispose()),this._flushTimerByType.forEach(t=>clearTimeout(t))}registerPlugin(t,n){this._assertPluginValid(t);const r={plugin:t,options:n};this._pluginRegistry.set(t.pluginName,r),this._logService.debug("[PluginService]",`Plugin "${t.pluginName}" registered.`);const{type:s}=t;this._loadedPluginTypes.has(s)&&(s===we.UNIVER_UNKNOWN?this._loadFromPlugins([r]):this._flushType(s))}startPluginsForType(t){this._loadedPluginTypes.has(t)||this._loadPluginsForType(t)}_loadPluginsForType(t){const n=Array.from(this._pluginRegistry.keys()),r=[];n.forEach(s=>{const i=this._pluginRegistry.get(s);i.plugin.type===t&&r.push(i)}),this._loadFromPlugins(r),this._loadedPluginTypes.add(t)}_assertPluginValid(t){const{type:n,pluginName:r}=t;if(n===we.UNRECOGNIZED)throw new Error(`[PluginService]: invalid plugin type for ${t.name}. Please assign a "type" to your plugin.`);if(!r)throw new Error(`[PluginService]: no plugin name for ${t.name}. Please assign a "pluginName" to your plugin.`);if(this._seenPlugins.has(r))throw new Error(`[PluginService]: duplicated plugin name for "${r}". Maybe a plugin that dependents on "${r} has already registered it. In that case please register "${r}" before the that plugin.`);this._seenPlugins.add(t.pluginName)}_flushType(t){this._flushTimerByType.get(t)===void 0&&this._flushTimerByType.set(t,setTimeout(()=>{this._loadPluginsForType(t),this._flushTimerByType.delete(t)},dI))}_loadFromPlugins(t){const n=[],r=new Set,s=o=>{const{plugin:a}=o,{pluginName:l}=a;if(this._loadedPlugins.has(l)||r.has(l))return;r.add(l),this._pluginRegistry.delete(l);const c=a[cd];c&&c.forEach(u=>{const h=this._pluginRegistry.get(u.pluginName);if(h)s(h);else if(!this._seenPlugins.has(u.pluginName)&&!r.has(u.pluginName)){if(a.type===we.UNIVER_UNKNOWN&&u.type!==we.UNIVER_UNKNOWN)throw new Error(`[PluginService]: cannot register a plugin with Univer type that depends on a plugin with other type. The dependent is ${a.pluginName} and the dependency is ${u.pluginName}.`);a.type!==u.type&&u.type!==we.UNIVER_UNKNOWN&&this._logService.debug("[PluginService]",`Plugin "${l}" depends on "${u.pluginName}" which has different type.`),this._logService.debug("[PluginService]",`Plugin "${l}" depends on "${u.pluginName}" which is not registered. Univer will automatically register it with default configuration.`),this._assertPluginValid(u),s({plugin:u,options:void 0})}}),n.push(o)};t.forEach(o=>s(o));const i=n.map(o=>this._initPlugin(o.plugin,o.options));this._pluginsRunLifecycle(i)}_pluginsRunLifecycle(t){const n=this._lifecycleService.stage;if(sd(n).subscribe(r=>this._runStage(t,r)),n!==Fe.Steady){const r=this._lifecycleService.lifecycle$.pipe(se.skip(1)).subscribe(s=>{this._runStage(t,s),s===Fe.Steady&&r.unsubscribe()})}}_runStage(t,n){t.forEach(r=>{switch(n){case Fe.Starting:r.onStarting();break;case Fe.Ready:r.onReady();break;case Fe.Rendered:r.onRendered();break;case Fe.Steady:r.onSteady();break}})}_initPlugin(t,n){const r=this._injector.createInstance(t,n);return this._pluginStore.addPlugin(r),this._loadedPlugins.add(t.pluginName),this._logService.debug("[PluginService]",`Plugin "${r.getPluginName()}" loaded.`),r}},f.PluginService=hI([ca(0,Ce.Inject(Ce.Injector)),ca(1,Ce.Inject(f.LifecycleService)),ca(2,dt)],f.PluginService);const ha=Ce.createIdentifier("resource-loader-service");var gI=Object.getOwnPropertyDescriptor,_I=(e,t,n,r)=>{for(var s=r>1?void 0:r?gI(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},pI=(e,t)=>(n,r)=>t(n,r,e);f.ResourceManagerService=class extends Ke{constructor(n){super();E(this,"_resourceMap",new Map);E(this,"_register$",new se.Subject);E(this,"register$",this._register$.asObservable());this._logService=n}getAllResourceHooks(){return[...this._resourceMap.values()]}getResources(n,r){return r?this.getResourcesByType(n,r):this.getAllResourceHooks().map(o=>{const a=o.toJson(n);return{name:o.pluginName,data:a}})}getResourcesByType(n,r){return this.getAllResourceHooks().filter(o=>o.businesses.includes(r)).map(o=>{const a=o.toJson(n);return{name:o.pluginName,data:a}})}registerPluginResource(n){const r=n.pluginName;if(this._resourceMap.has(r))throw new Error(`the pluginName is registered {${r}}`);return this._resourceMap.set(r,n),this._register$.next(n),Ye(()=>this._resourceMap.delete(r))}disposePluginResource(n){this._resourceMap.delete(n)}loadResources(n,r){this.getAllResourceHooks().forEach(s=>{var o;const i=(o=r==null?void 0:r.find(a=>a.name===s.pluginName))==null?void 0:o.data;if(i)try{const a=s.parseJson(i);s.onLoad(n,a)}catch(a){this._logService.error("[ResourceManagerService]","loadResources error",a)}})}unloadResources(n,r){this.getAllResourceHooks().filter(s=>s.businesses.includes(r)).forEach(s=>{s.onUnLoad(n)})}dispose(){this._register$.complete(),this._resourceMap.clear()}},f.ResourceManagerService=_I([pI(0,dt)],f.ResourceManagerService);class ni extends Ke{constructor(){super();E(this,"_darkMode$",new se.BehaviorSubject(!1));E(this,"darkMode$",this._darkMode$.asObservable());E(this,"_validColorCache",new Map);E(this,"_currentTheme",qr.defaultTheme);E(this,"_currentTheme$",new se.BehaviorSubject(this._currentTheme));E(this,"currentTheme$",this._currentTheme$.asObservable());this.disposeWithMe(Ye(()=>{this._currentTheme=qr.defaultTheme,this._currentTheme$.complete(),this._darkMode$.complete()}))}get darkMode(){return this._darkMode$.getValue()}isValidThemeColor(n){if(this._validColorCache.has(n))return this._validColorCache.get(n);let r=!1;const s=n.split(".");if(s.length===1)r=n in qr.defaultTheme;else if(s.length===2){const[i,o]=s;r=i in qr.defaultTheme&&o in this._currentTheme[i]}return this._validColorCache.set(n,r),r}getCurrentTheme(){return this._currentTheme}setTheme(n){this._currentTheme=n,this._currentTheme$.next(n)}setDarkMode(n){this._darkMode$.next(n)}getColorFromTheme(n){return ul(this._currentTheme,n)}}var EI=Object.getOwnPropertyDescriptor,CI=(e,t,n,r)=>{for(var s=r>1?void 0:r?EI(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},da=(e,t)=>(n,r)=>t(n,r,e);const ri=Ce.createIdentifier("univer.undo-redo.service"),RI=20;class ud{dispose(){}async dispatchToHandlers(){return!1}}const hd="univer.command.redo",dd="univer.command.undo",fd=new class extends ud{constructor(){super(...arguments);E(this,"type",mr.COMMAND);E(this,"id",dd)}handler(t){const n=t.get(ri),r=n.pitchTopUndoElement();if(!r)return!1;const s=t.get(gr);return gs(r.undoMutations,s)?(n.popUndoToRedo(),!0):!1}},md=new class extends ud{constructor(){super(...arguments);E(this,"type",mr.COMMAND);E(this,"id",hd)}handler(t){const n=t.get(ri),r=n.pitchTopRedoElement();if(!r)return!1;const s=t.get(gr);return gs(r.redoMutations,s)?(n.popRedoToUndo(),!0):!1}};f.LocalUndoRedoService=class extends Ke{constructor(n,r,s){super();E(this,"undoRedoStatus$");E(this,"_undoRedoStatus$",new se.BehaviorSubject({undos:0,redos:0}));E(this,"_undoStacks",new Map);E(this,"_redoStacks",new Map);E(this,"_batchingStatus",new Map);this._univerInstanceService=n,this._commandService=r,this._contextService=s,this.undoRedoStatus$=this._undoRedoStatus$.asObservable(),this.disposeWithMe(this._commandService.registerCommand(fd)),this.disposeWithMe(this._commandService.registerCommand(md)),this.disposeWithMe(Ye(()=>this._undoRedoStatus$.complete())),this.disposeWithMe(Ye(this._univerInstanceService.focused$.subscribe(()=>this._updateStatus())))}pushUndoRedo(n){const{unitID:r}=n,s=this._getRedoStack(r,!0),i=this._getUndoStack(r,!0);if(s.length=0,this._batchingStatus.has(n.unitID)){const a=this._batchingStatus.get(n.unitID),l=this._pitchUndoElement(n.unitID);a===0||!l?(o(n),this._batchingStatus.set(n.unitID,1)):this._tryBatchingElements(l,n)}else o(n);function o(a){i.push(a),i.length>RI&&i.splice(0,1)}this._updateStatus()}clearUndoRedo(n){const r=this._getRedoStack(n);r&&(r.length=0);const s=this._getUndoStack(n);s&&(s.length=0),this._updateStatus()}pitchTopUndoElement(){const n=this._getFocusedUnitId();return this._pitchUndoElement(n)}pitchTopRedoElement(){const n=this._getFocusedUnitId();return this._pitchRedoElement(n)}_pitchUndoElement(n){const r=this._getUndoStack(n);return r!=null&&r.length?r[r.length-1]:null}_pitchRedoElement(n){const r=this._getRedoStack(n);return r!=null&&r.length?r[r.length-1]:null}popUndoToRedo(){const r=this._getUndoStackForFocused().pop();r&&(r.redoMutations.length>0&&this._getRedoStackForFocused().push(r),this._updateStatus())}popRedoToUndo(){const r=this._getRedoStackForFocused().pop();r&&(this._getUndoStackForFocused().push(r),this._updateStatus())}rollback(n,r){const s=r||this._getFocusedUnitId(),i=this._getUndoStack(s),o=i==null?void 0:i[(i==null?void 0:i.length)-1];o&&o.id===n&&(i.pop(),gs(o.undoMutations,this._commandService))}__tempBatchingUndoRedo(n){if(this._batchingStatus.has(n))throw new Error("[LocalUndoRedoService]: cannot batching undo redo twice at the same time!");return this._batchingStatus.set(n,0),Ye(()=>this._batchingStatus.delete(n))}_updateStatus(){var i,o;const n=this._getFocusedUnitId(),r=n&&((i=this._undoStacks.get(n))==null?void 0:i.length)||0,s=n&&((o=this._redoStacks.get(n))==null?void 0:o.length)||0;this._undoRedoStatus$.next({undos:r,redos:s})}_getUndoStack(n,r=!1){let s=this._undoStacks.get(n);return!s&&r&&(s=[],this._undoStacks.set(n,s)),s||null}_getRedoStack(n,r=!1){let s=this._redoStacks.get(n);return!s&&r&&(s=[],this._redoStacks.set(n,s)),s||null}_getUndoStackForFocused(){const n=this._getFocusedUnitId();if(!n)throw new Error("No focused univer instance!");return this._getUndoStack(n,!0)}_getRedoStackForFocused(){const n=this._getFocusedUnitId();if(!n)throw new Error("No focused univer instance!");return this._getRedoStack(n,!0)}_tryBatchingElements(n,r){n.redoMutations.push(...r.redoMutations),n.undoMutations.push(...r.undoMutations)}_getFocusedUnitId(){var o,a,l,c;let n="";const r=this._contextService.getContextValue(qn),s=this._contextService.getContextValue(Dh),i=this._contextService.getContextValue(Mh);return r?s?n=ci:i?n=li:n=(a=(o=this._univerInstanceService.getFocusedUnit())==null?void 0:o.getUnitId())!=null?a:"":n=(c=(l=this._univerInstanceService.getFocusedUnit())==null?void 0:l.getUnitId())!=null?c:"",n}},f.LocalUndoRedoService=CI([da(0,Jn),da(1,gr),da(2,Un)],f.LocalUndoRedoService);class gd{constructor(t,n=1e3){E(this,"_imageCacheMap");this._injector=t,this._imageCacheMap=new Ws(n)}_getImageCacheKey(t,n){return`${t}-${n}`}getImage(t,n,r,s){const i=this._getImageCacheKey(t,n),o=this._imageCacheMap.get(i);return o||((async()=>{const a=new Image,l=this._injector.has(ra)?this._injector.get(ra):null,c=this._injector.has(sa)?this._injector.get(sa):null;if(t===ti.UUID)try{a.src=await(l==null?void 0:l.getImage(n))||""}catch(u){console.error(u)}else if(t===ti.URL)try{const u=await(c==null?void 0:c.getImage(n));a.src=u||n}catch{a.src=n}else a.src=n;a.onload=()=>{a.removeAttribute("data-error"),r==null||r()},a.onerror=()=>{a.setAttribute("data-error","true"),s==null||s()},this._imageCacheMap.set(i,a)})(),null)}}function II(e){return!(e.length===0||e.length>31||e.startsWith("'")||e.endsWith("'")||/[:\\\/\?\*\[\]]/.test(e))}function SI(e,t){return!(!e||e.length===0||e.length>255||t.has(e)||/[ :\\\/\?\*\[\]]/.test(e)||!/^[\p{L}_]/u.test(e)||/^\$?[A-Za-z]{1,3}\$?[0-9]+$/.test(e)||/^[rR]\d+[cC]\d+$/.test(e)||/^\d+$/.test(e))}const _d=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],fa=1,Vr=8;class ma{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[n,r]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");const s=r>>4;if(s!==fa)throw new Error(`Got v${s} data when expected v${fa}.`);const i=_d[r&15];if(!i)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new ma(a,o,i,t)}constructor(t,n=64,r=Float64Array,s){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=r,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const i=_d.indexOf(this.ArrayType),o=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-a%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${r}.`);s&&s instanceof ArrayBuffer?(this.data=s,this.ids=new this.IndexArrayType(this.data,Vr,t),this.coords=new this.ArrayType(this.data,Vr+a+l,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(Vr+o+a+l),this.ids=new this.IndexArrayType(this.data,Vr,t),this.coords=new this.ArrayType(this.data,Vr+a+l,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(fa<<4)+i]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=t,this.coords[this._pos++]=n,r}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return ga(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,r,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:o,nodeSize:a}=this,l=[0,i.length-1,0],c=[];for(;l.length;){const u=l.pop()||0,h=l.pop()||0,d=l.pop()||0;if(h-d<=a){for(let I=d;I<=h;I++){const y=o[2*I],H=o[2*I+1];y>=t&&y<=r&&H>=n&&H<=s&&c.push(i[I])}continue}const m=d+h>>1,_=o[2*m],p=o[2*m+1];_>=t&&_<=r&&p>=n&&p<=s&&c.push(i[m]),(u===0?t<=_:n<=p)&&(l.push(d),l.push(m-1),l.push(1-u)),(u===0?r>=_:s>=p)&&(l.push(m+1),l.push(h),l.push(1-u))}return c}within(t,n,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:s,coords:i,nodeSize:o}=this,a=[0,s.length-1,0],l=[],c=r*r;for(;a.length;){const u=a.pop()||0,h=a.pop()||0,d=a.pop()||0;if(h-d<=o){for(let I=d;I<=h;I++)Ed(i[2*I],i[2*I+1],t,n)<=c&&l.push(s[I]);continue}const m=d+h>>1,_=i[2*m],p=i[2*m+1];Ed(_,p,t,n)<=c&&l.push(s[m]),(u===0?t-r<=_:n-r<=p)&&(a.push(d),a.push(m-1),a.push(1-u)),(u===0?t+r>=_:n+r>=p)&&(a.push(m+1),a.push(h),a.push(1-u))}return l}}function ga(e,t,n,r,s,i){if(s-r<=n)return;const o=r+s>>1;pd(e,t,o,r,s,i),ga(e,t,n,r,o-1,1-i),ga(e,t,n,o+1,s,1-i)}function pd(e,t,n,r,s,i){for(;s>r;){if(s-r>600){const c=s-r+1,u=n-r+1,h=Math.log(c),d=.5*Math.exp(2*h/3),m=.5*Math.sqrt(h*d*(c-d)/c)*(u-c/2<0?-1:1),_=Math.max(r,Math.floor(n-u*d/c+m)),p=Math.min(s,Math.floor(n+(c-u)*d/c+m));pd(e,t,n,_,p,i)}const o=t[2*n+i];let a=r,l=s;for(zr(e,t,r,n),t[2*s+i]>o&&zr(e,t,r,s);a<l;){for(zr(e,t,a,l),a++,l--;t[2*a+i]<o;)a++;for(;t[2*l+i]>o;)l--}t[2*r+i]===o?zr(e,t,r,l):(l++,zr(e,t,l,s)),l<=n&&(r=l+1),n<=l&&(s=l-1)}}function zr(e,t,n,r){_a(e,n,r),_a(t,2*n,2*r),_a(t,2*n+1,2*r+1)}function _a(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Ed(e,t,n,r){const s=e-n,i=t-r;return s*s+i*i}class OI{constructor(t=!1){E(this,"_tree",new Map);E(this,"_oneCellCache",new Map);E(this,"_kdTree",new Map);this._enableOneCellCache=t}dispose(){this.clear()}getTree(t,n){return this._tree.has(t)||this._tree.set(t,new Map),this._tree.get(t).has(n)||this._tree.get(t).set(n,new Vs),this._tree.get(t).get(n)}_getOneCellCache(t,n,r,s){return this._oneCellCache.has(t)||this._oneCellCache.set(t,new Map),this._oneCellCache.get(t).has(n)||this._oneCellCache.get(t).set(n,new Map),this._oneCellCache.get(t).get(n).has(r)||this._oneCellCache.get(t).get(n).set(r,new Map),this._oneCellCache.get(t).get(n).get(r).has(s)||this._oneCellCache.get(t).get(n).get(r).set(s,new Set),this._oneCellCache.get(t).get(n).get(r).get(s)}_removeOneCellCache(t,n,r,s,i){const o=this._oneCellCache.get(t);if(!o)return;const a=o.get(n);if(!a)return;const l=a.get(r);if(!l)return;const c=l.get(s);c&&c.delete(i)}_removeCellCacheByRange(t){const{unitId:n,sheetId:r,range:s,id:i}=t,o=this._oneCellCache.get(n);if(!o)return;const a=o.get(r);if(!a)return;const{startRow:l,startColumn:c,endRow:u,endColumn:h}=s;for(let d=l;d<=u;d++){const m=a.get(d);if(m)for(let _=c;_<=h;_++){const p=m.get(_);p&&p.delete(i)}}}_insertOneCellCache(t,n,r,s,i){this._getOneCellCache(t,n,r,s).add(i)}_getRdTreeItems(t){const n=[];for(const[r,s]of t)for(const[i,o]of s)n.push({x:i,y:r,ids:o});return n}_searchByOneCellCache(t){var _;const{unitId:n,sheetId:r,range:s}=t,{startRow:i,startColumn:o,endRow:a,endColumn:l}=s,c=(_=this._kdTree.get(n))==null?void 0:_.get(r);if(!c)return[];const{tree:u,items:h}=c,d=u.range(o,i,l,a),m=[];for(const p of d){const I=h[p];m.push(...Array.from(I.ids))}return m}openKdTree(){var t;for(const[n,r]of this._oneCellCache){this._kdTree.has(n)||this._kdTree.set(n,new Map);for(const[s,i]of r){const o=this._getRdTreeItems(i),a=new ma(o.length);(t=this._kdTree.get(n))==null||t.set(s,{tree:a,items:o});for(const l of o)a.add(l.x,l.y);a.finish()}}}closeKdTree(){var t;for(const[n,r]of this._oneCellCache)for(const[s,i]of r)(t=this._kdTree.get(n))==null||t.set(s,void 0)}insert(t){const{unitId:n,sheetId:r,range:s,id:i}=t;if(!n||n.length===0)return;let{startRow:o,endRow:a,startColumn:l,endColumn:c}=s;if(this._enableOneCellCache&&o===a&&l===c){this._insertOneCellCache(n,r,o,l,i);return}const u=this.getTree(n,r);Number.isNaN(o)&&(o=0),Number.isNaN(l)&&(l=0),Number.isNaN(a)&&(a=Number.POSITIVE_INFINITY),Number.isNaN(c)&&(c=Number.POSITIVE_INFINITY),u.insert({minX:l,minY:o,maxX:c,maxY:a,id:i})}bulkInsert(t){for(const n of t)this.insert(n)}*searchGenerator(t){var a;const{unitId:n,sheetId:r,range:s}=t;if(this._enableOneCellCache){const l=this._searchByOneCellCache(t);for(const c of l)yield c}const i=(a=this._tree.get(n))==null?void 0:a.get(r);if(!i)return;const o=i.search({minX:s.startColumn,minY:s.startRow,maxX:s.endColumn,maxY:s.endRow});for(const l of o)yield l.id}bulkSearch(t,n){const r=new Set;for(const s of t)for(const i of this.searchGenerator(s))(n==null?void 0:n.has(i))!==!0&&r.add(i);return r}removeById(t,n){var r,s;n?((r=this._tree.get(t))==null||r.delete(n),(s=this._oneCellCache.get(t))==null||s.delete(n)):(this._tree.delete(t),this._oneCellCache.delete(t))}_removeRTreeItem(t){const{unitId:n,sheetId:r,range:s,id:i}=t,o=this.getTree(n,r),a=o.search({minX:s.startColumn,minY:s.startRow,maxX:s.endColumn,maxY:s.endRow});for(let l=0;l<a.length;l++)a[l].id===i&&o.remove(a[l])}remove(t){const{unitId:n,sheetId:r,range:s,id:i}=t,{startRow:o,startColumn:a,endRow:l,endColumn:c}=s;this._enableOneCellCache?o===l&&a===c?this._removeOneCellCache(n,r,s.startRow,s.startColumn,i):(this._removeCellCacheByRange(t),this._removeRTreeItem(t)):this._removeRTreeItem(t)}bulkRemove(t){for(const n of t)this.remove(n)}clear(){this._tree.clear(),this._oneCellCache.clear()}toJSON(){const t={};return this._tree.forEach((n,r)=>{t[r]={},n.forEach((s,i)=>{t[r][i]=s.toJSON()})}),t}fromJSON(t){this._tree.clear();for(const n in t){this._tree.set(n,new Map);for(const r in t[n]){const s=new Vs;s.fromJSON(t[n][r]),this._tree.get(n).set(r,s)}}}}function vI(e){return new Promise(t=>setTimeout(t,e))}function wI(e=1){return new Promise(t=>{let n=0;const r=()=>{n++,n>=e?t():requestAnimationFrame(r)};requestAnimationFrame(r)})}var bI=Object.getOwnPropertyDescriptor,yI=(e,t,n,r)=>{for(var s=r>1?void 0:r?bI(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},AI=(e,t)=>(n,r)=>t(n,r,e);f.Skeleton=class extends Ke{constructor(n){super();E(this,"_fontLocale");E(this,"_dirty",!0);this._localeService=n,this._localeInitial()}get dirty(){return this._dirty}getFontLocale(){return this._fontLocale}makeDirty(n){this._dirty=n}dispose(){super.dispose(),this._fontLocale=null}_localeInitial(){}},f.Skeleton=yI([AI(0,Ce.Inject(On))],f.Skeleton);var TI=Object.getOwnPropertyDescriptor,NI=(e,t,n,r)=>{for(var s=r>1?void 0:r?TI(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},si=(e,t)=>(n,r)=>t(n,r,e);f.SheetSkeleton=class extends f.Skeleton{constructor(n,r,s,i,o,a){super(s);E(this,"_worksheetData");E(this,"_renderRawFormula",!1);E(this,"_cellData");E(this,"_imageCacheMap");E(this,"_skipAutoHeightForMergedCells",!0);E(this,"_rowTotalHeight",0);E(this,"_columnTotalWidth",0);E(this,"_rowHeaderWidth",0);E(this,"_columnHeaderHeight",0);E(this,"_rowHeightAccumulation",[]);E(this,"_columnWidthAccumulation",[]);E(this,"_marginTop",0);E(this,"_marginLeft",0);E(this,"_scaleX");E(this,"_scaleY");E(this,"_scrollX");E(this,"_scrollY");this.worksheet=n,this._styles=r,this._contextService=i,this._configService=o,this._injector=a,this._worksheetData=this.worksheet.getConfig(),this._cellData=this.worksheet.getCellMatrix(),this._imageCacheMap=new gd(this._injector),this.initConfig()}initConfig(){var n,r;this._skipAutoHeightForMergedCells=!((n=this._configService.getConfig(ba))!=null&&n),this.worksheet.setIsRowStylePrecedeColumnStyle((r=this._configService.getConfig(wa))!=null?r:!1)}resetCache(){}getWorksheetConfig(){return this._worksheetData}getLocation(){return[this.worksheet.getUnitId(),this.worksheet.getSheetId()]}set columnHeaderHeight(n){this._columnHeaderHeight=n,this._worksheetData.columnHeader.height=n}set rowHeaderWidth(n){this._rowHeaderWidth=n,this._worksheetData.rowHeader.width=n}get rowHeightAccumulation(){return this._rowHeightAccumulation}get rowTotalHeight(){return this._rowTotalHeight}get columnWidthAccumulation(){return this._columnWidthAccumulation}get columnTotalWidth(){return this._columnTotalWidth}get rowHeaderWidth(){return this._rowHeaderWidth}get columnHeaderHeight(){return this._columnHeaderHeight}setMarginLeft(n){this._marginLeft=n}setMarginTop(n){this._marginTop=n}setScale(n,r){this._updateLayout(),this._scaleX=n,this._scaleY=r||n,this._updateLayout()}setScroll(n,r){Z.isDefine(n)&&(this._scrollX=n),Z.isDefine(r)&&(this._scrollY=r)}get scrollX(){return this._scrollX}get scrollY(){return this._scrollY}get scaleX(){return this._scaleX}get scaleY(){return this._scaleY}get rowHeaderWidthAndMarginLeft(){return this.rowHeaderWidth+this._marginLeft}get columnHeaderHeightAndMarginTop(){return this.columnHeaderHeight+this._marginTop}get imageCacheMap(){return this._imageCacheMap}_generateRowMatrixCache(n,r,s){let i=0;const o=[],a=r;for(let l=0;l<n;l++){let c=s;if(this.worksheet.getRowFiltered(l))c=0;else if(a[l]!=null){const u=a[l];if(!u)continue;const{h=s,ah:d,ia:m}=u;(m==null||m===ae.TRUE)&&typeof d=="number"?c=d:c=h,u.hd===ae.TRUE&&(c=0)}i+=c,o.push(i)}return{rowTotalHeight:i,rowHeightAccumulation:o}}_generateColumnMatrixCache(n,r,s){let i=0;const o=[],a=r;for(let l=0;l<n;l++){let c=s;if(a[l]!=null){const u=a[l];if(!u)continue;u.w!=null&&(c=u.w),u.hd===ae.TRUE&&(c=0)}i+=c,o.push(i)}return{columnTotalWidth:i,columnWidthAccumulation:o}}intersectMergeRange(n,r){return!!this.worksheet.getMergedCell(n,r)}_getOverflowBound(n,r,s,i,o=bt.LEFT){let a=0;if(r>s){const l=this._columnWidthAccumulation.length-1;for(let c=r;c>=s;c--){const u=c,h=this.worksheet.getCell(n,u);if(!xo(h)&&u!==r||this.intersectMergeRange(n,u))return u===r?u:u+1>l?l:u+1;const{startX:d,endX:m}=Zn(n,u,this.rowHeightAccumulation,this.columnWidthAccumulation);if(o===bt.CENTER&&u===r?a+=(m-d)/2:a+=m-d,i<a)return u}return r}for(let l=r;l<=s;l++){const c=l,u=this.worksheet.getCell(n,c);if(!xo(u)&&c!==r||this.intersectMergeRange(n,c))return c===r?c:c-1<0?0:c-1;const{startX:h,endX:d}=Zn(n,c,this.rowHeightAccumulation,this.columnWidthAccumulation);if(o===bt.CENTER&&c===r?a+=(d-h)/2:a+=d-h,i<a)return c}return s}_updateLayout(){if(!this.dirty)return;const{rowData:n,columnData:r,defaultRowHeight:s,defaultColumnWidth:i,rowCount:o,columnCount:a,rowHeader:l,columnHeader:c}=this._worksheetData,{rowTotalHeight:u,rowHeightAccumulation:h}=this._generateRowMatrixCache(o,n,s),{columnTotalWidth:d,columnWidthAccumulation:m}=this._generateColumnMatrixCache(a,r,i);this._rowHeaderWidth=l.hidden!==ae.TRUE?this._dynamicallyUpdateRowHeaderWidth(l):0,this._columnHeaderHeight=c.hidden!==ae.TRUE?c.height:0,this._rowTotalHeight=u,this._rowHeightAccumulation=h,this._columnTotalWidth=d,this._columnWidthAccumulation=m,this.makeDirty(!1)}calculate(){return this.resetCache(),this._updateLayout(),this}resetRangeCache(n){}_dynamicallyUpdateRowHeaderWidth(n){const s=`${this.worksheet.getRowCount()}`.length*8;return Math.max(n.width,s)}_hasUnMergedCellInRow(n,r,s){if(!this.worksheet.getMergeData())return!1;for(let o=r;o<=s;o++){const{isMerged:a,isMergedMainCell:l}=this.worksheet.getCellInfoInMergeData(n,o);if(!a&&!l)return!0}return!1}expandRangeByMerge(n,r){let{startRow:s,startColumn:i,endRow:o,endColumn:a}=n;const l=this._worksheetData.mergeData;if(!l)return{startRow:s,startColumn:i,endRow:o,endColumn:a};let c=!0;const u=new ct;let h=0,d=null;for(;c;){c=!1;for(let m=0;m<l.length;m++){const{startRow:_,startColumn:p,endRow:I,endColumn:y}=l[m];if(u.getValue(_,p))continue;const H={startColumn:i,startRow:s,endColumn:a,endRow:o},x={startColumn:p,startRow:_,endColumn:y,endRow:I};zu(H,x)&&(s=Math.min(s,_),i=Math.min(i,p),o=Math.max(o,I),a=Math.max(a,y),u.setValue(_,p,!0),c=!0,h++,d=x)}}return r&&h===1&&Yt.contains(d,n)?{startRow:d.startRow,startColumn:d.startColumn,endRow:d.startRow,endColumn:d.startColumn}:{startRow:s,startColumn:i,endRow:o,endColumn:a}}getColumnCount(){return this._columnWidthAccumulation.length}getRowCount(){return this._rowHeightAccumulation.length}_getCellMergeInfo(n,r){return this.worksheet.getCellInfoInMergeData(n,r)}getNoMergeCellPositionByIndex(n,r,s=!0){return this.getNoMergeCellWithCoordByIndex(n,r,s)}getNoMergeCellWithCoordByIndex(n,r,s=!0){const{rowHeightAccumulation:i,columnWidthAccumulation:o,rowHeaderWidthAndMarginLeft:a,columnHeaderHeightAndMarginTop:l}=this;let{startY:c,endY:u,startX:h,endX:d}=Zn(n,r,i,o);return s&&(c+=l,u+=l,h+=a,d+=a),{startY:c,endY:u,startX:h,endX:d}}getNoMergeCellPositionByIndexWithNoHeader(n,r){const{rowHeightAccumulation:s,columnWidthAccumulation:i}=this,{startY:o,endY:a,startX:l,endX:c}=Zn(n,r,s,i);return{startY:o,endY:a,startX:l,endX:c}}getRowIndexByOffsetY(n,r,s,i){var l;const{rowHeightAccumulation:o}=this;n=Rd(n,r,s,this.columnHeaderHeightAndMarginTop);let a=_r(o,n,i==null?void 0:i.firstMatch);return i!=null&&i.closeFirst&&Math.abs(o[a]-n)<Math.abs(n-((l=o[a-1])!=null?l:0))&&(a=a+1),a}getColumnIndexByOffsetX(n,r,s,i){var c;const o=Cd(n,r,s,this.rowHeaderWidthAndMarginLeft),{columnWidthAccumulation:a}=this;let l=_r(a,o,i==null?void 0:i.firstMatch);return i!=null&&i.closeFirst&&Math.abs(a[l]-o)<Math.abs(o-((c=a[l-1])!=null?c:0))&&(l=l+1),l}getCellIndexByOffset(n,r,s,i,o,a){const l=this.getRowIndexByOffsetY(r,i,o,a),c=this.getColumnIndexByOffsetX(n,s,o,a);return{row:l,column:c}}getCellByOffset(n,r,s,i,o){const a=this==null?void 0:this.getCellIndexByOffset(n,r,s,i,o,{firstMatch:!0});return a?this.worksheet.getCellInfoInMergeData(a.row,a.column):null}getCellWithCoordByIndex(n,r,s=!0){const{rowHeightAccumulation:i,columnWidthAccumulation:o,rowHeaderWidthAndMarginLeft:a,columnHeaderHeightAndMarginTop:l}=this,c=Zn(n,r,i,o,this.worksheet.getCellInfoInMergeData(n,r)),{isMerged:u,isMergedMainCell:h}=c;let{startY:d,endY:m,startX:_,endX:p,mergeInfo:I}=c,y=a,H=l;return s===!1&&(y=0,H=0),d+=H,m+=H,_+=y,p+=y,I.startY+=H,I.endY+=H,I.startX+=y,I.endX+=y,{actualRow:n,actualColumn:r,startX:_,startY:d,endX:p,endY:m,isMerged:u,isMergedMainCell:h,mergeInfo:I}}getCellWithCoordByOffset(n,r,s,i,o,a){const{row:l,column:c}=this.getCellIndexByOffset(n,r,s,i,o,a);return this.getCellWithCoordByIndex(l,c)}getOffsetByColumn(n){const{columnWidthAccumulation:r,rowHeaderWidthAndMarginLeft:s}=this,i=r.length-1,o=r[n];return o!=null?o+s:n<0?s:r[i]+s}getOffsetByRow(n){const{rowHeightAccumulation:r,columnHeaderHeightAndMarginTop:s}=this,i=r.length-1,o=r[n];return o!=null?o+s:n<0?s:r[i]+s}getOffsetRelativeToRowCol(n,r){const s=_r(this.columnWidthAccumulation,n);let i=0;s===0?i=n:i=n-this._columnWidthAccumulation[s-1];const o=_r(this.rowHeightAccumulation,r);let a=0;return o===0?a=r:a=r-this._rowHeightAccumulation[o-1],{row:o,column:s,columnOffset:i,rowOffset:a}}_updateConfigAndGetDocumentModel(n,r,s,i){var a,l,c,u,h;if(!i||!((a=n.body)!=null&&a.dataStream))return;n.documentStyle||(n.documentStyle={}),n.documentStyle.marginTop=(l=s.t)!=null?l:0,n.documentStyle.marginBottom=(c=s.b)!=null?c:2,n.documentStyle.marginLeft=(u=s.l)!=null?u:2,n.documentStyle.marginRight=(h=s.r)!=null?h:2,n.documentStyle.pageSize={width:Number.POSITIVE_INFINITY,height:Number.POSITIVE_INFINITY},n.documentStyle.renderConfig={...n.documentStyle.renderConfig,...i};const o=n.body.paragraphs||[];for(const d of o)d.paragraphStyle||(d.paragraphStyle={}),d.paragraphStyle.horizontalAlign=r;return new Tt(n)}dispose(){super.dispose(),this._rowHeightAccumulation=[],this._columnWidthAccumulation=[],this._rowTotalHeight=0,this._columnTotalWidth=0,this._rowHeaderWidth=0,this._columnHeaderHeight=0,this._worksheetData=null,this._cellData=null,this._styles=null,this.worksheet=null}},f.SheetSkeleton=NI([si(2,Ce.Inject(On)),si(3,Un),si(4,fr),si(5,Ce.Inject(Ce.Injector))],f.SheetSkeleton);function pa(e,t,n,r){const s=e-1,i=t-1,o=n[s]||0;let a=n[e];a==null&&(a=n[n.length-1]);const l=r[i]||0;let c=r[t];return c==null&&(c=r[r.length-1]),{startY:o,endY:a,startX:l,endX:c}}function MI(e,t,n,r){return pa(e,t,n,r)}function Zn(e,t,n,r,s){e=Z.clamp(e,0,n.length-1),t=Z.clamp(t,0,r.length-1);let{startY:i,endY:o,startX:a,endX:l}=pa(e,t,n,r);if(!s)return{startY:i,endY:o,startX:a,endX:l,isMerged:!1,isMergedMainCell:!1,actualRow:e,actualColumn:t,mergeInfo:{startY:i,endY:o,startX:a,endX:l,startRow:e,startColumn:t,endRow:e,endColumn:t}};const{isMerged:c,isMergedMainCell:u,startRow:h,startColumn:d,endRow:m,endColumn:_}=s;let p={startRow:h,startColumn:d,endRow:m,endColumn:_,startY:i,endY:o,startX:a,endX:l};const I=n.length-1,y=r.length-1;if(c&&h!==-1&&d!==-1){const H=n[h-1]||0,x=n[m]||n[I],Y=r[d-1]||0,O=r[_]||r[y];p={...p,startY:H,endY:x,startX:Y,endX:O}}else if(!c&&m!==-1&&_!==-1){const H=n[m]||n[I],x=r[_]||r[y];p={...p,startY:i,endY:H,startX:a,endX:x}}return{isMerged:c,isMergedMainCell:u,actualRow:e,actualColumn:t,startY:i,endY:o,startX:a,endX:l,mergeInfo:p}}function Cd(e,t,n,r){const{x:s}=n;return e/t+s-r}function Rd(e,t,n,r){const{y:s}=n;return e=e/t+s-r,e}const DI=["script","style","meta","comment","link"];var Id=(e=>(e[e.INFO=0]="INFO",e[e.STOP=1]="STOP",e[e.WARNING=2]="WARNING",e))(Id||{}),Sd=(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))(Sd||{}),Od=(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))(Od||{}),vd=(e=>(e[e.TEXT=0]="TEXT",e[e.ARROW=1]="ARROW",e[e.CUSTOM=2]="CUSTOM",e))(vd||{}),wd=(e=>(e.VALID="valid",e.INVALID="invalid",e.VALIDATING="validating",e))(wd||{}),bd=(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))(bd||{}),LI=Object.getOwnPropertyDescriptor,UI=(e,t,n,r)=>{for(var s=r>1?void 0:r?LI(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},yd=(e,t)=>(n,r)=>t(n,r,e);let Ea=class extends Ke{constructor(e,t){super(),this._resourceManagerService=e,this._univerInstanceService=t,this._init()}_init(){const e=n=>{n.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===n.pluginName);if(o)try{const a=n.parseJson(o.data);n.onLoad(s.getUnitId(),a)}catch{console.error(`Load Document{${s.getUnitId()}} Resources{${n.pluginName}} Data Error.`)}});break}case we.UNIVER_SHEET:this._univerInstanceService.getAllUnitsForType(we.UNIVER_SHEET).forEach(s=>{const o=(s.getSnapshot().resources||[]).find(a=>a.name===n.pluginName);if(o)try{const a=n.parseJson(o.data);n.onLoad(s.getUnitId(),a)}catch{console.error(`Load Workbook{${s.getUnitId()}} Resources{${n.pluginName}} Data Error.`)}})}})};this._resourceManagerService.getAllResourceHooks().forEach(n=>e(n)),this.disposeWithMe(this._resourceManagerService.register$.subscribe(n=>e(n))),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(we.UNIVER_SHEET).subscribe(n=>{this._resourceManagerService.loadResources(n.getUnitId(),n.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(we.UNIVER_DOC).subscribe(n=>{const r=n.getUnitId();ya(r)||this._resourceManagerService.loadResources(n.getUnitId(),n.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(we.UNIVER_SHEET).subscribe(n=>{this._resourceManagerService.unloadResources(n.getUnitId(),we.UNIVER_SHEET)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(we.UNIVER_DOC).subscribe(n=>{this._resourceManagerService.unloadResources(n.getUnitId(),we.UNIVER_DOC)}))}saveUnit(e){const t=this._univerInstanceService.getUnit(e);if(!t)return null;const n=this._resourceManagerService.getResources(e,t.type),r=Z.deepClone(t.getSnapshot());return r.resources=n,r}};Ea=UI([yd(0,Ce.Inject(Qs)),yd(1,Ce.Inject(Jn))],Ea);class PI{constructor(t={},n){E(this,"_startedTypes",new Set);E(this,"_injector");E(this,"_disposingCallbacks",new is);const r=this._injector=kI(n,t==null?void 0:t.override),{theme:s,darkMode:i,locale:o,locales:a,logLevel:l,logCommandExecution:c}=t;s&&this._injector.get(ni).setTheme(s),i&&this._injector.get(ni).setDarkMode(i),a&&this._injector.get(On).load(a),o&&this._injector.get(On).setLocale(o),l&&this._injector.get(dt).setLogLevel(l),c!==void 0&&this._injector.get(fr).setConfig(ms,c),this._init(r)}get _univerInstanceService(){return this._injector.get(Jn)}get _pluginService(){return this._injector.get(f.PluginService)}__getInjector(){return this._injector}onDispose(t){const n=this._disposingCallbacks.add(Ye(t));return Ye(()=>n.dispose(!0))}dispose(){this._disposingCallbacks.dispose(),this._injector.dispose()}setLocale(t){this._injector.get(On).setLocale(t)}createUnit(t,n){return this._univerInstanceService.createUnit(t,n)}createUniverSheet(t){return this._injector.get(dt).warn("[Univer]","Univer.createUniverSheet is deprecated, use createUnit instead"),this._univerInstanceService.createUnit(we.UNIVER_SHEET,t)}createUniverDoc(t){return this._injector.get(dt).warn("[Univer]","Univer.createUniverDoc is deprecated, use createUnit instead"),this._univerInstanceService.createUnit(we.UNIVER_DOC,t)}createUniverSlide(t){return this._injector.get(dt).warn("[Univer]","Univer.createUniverSlide is deprecated, use createUnit instead"),this._univerInstanceService.createUnit(we.UNIVER_SLIDE,t)}_init(t){this._univerInstanceService.registerCtorForType(we.UNIVER_SHEET,f.Workbook),this._univerInstanceService.registerCtorForType(we.UNIVER_DOC,Tt),this._univerInstanceService.registerCtorForType(we.UNIVER_SLIDE,oa);const n=t.get(Jn);n.__setCreateHandler((r,s,i,o)=>{if(!this._startedTypes.has(r)){this._pluginService.startPluginsForType(r),this._startedTypes.add(r);const l=t.createInstance(i,s);return n.__addUnit(l,o),this._tryProgressToReady(),l}const a=t.createInstance(i,s);return n.__addUnit(a,o),a})}_tryProgressToReady(){this._injector.get(f.LifecycleService).stage<Fe.Ready&&(this._injector.get(f.LifecycleService).stage=Fe.Ready)}registerPlugin(t,n){this._pluginService.registerPlugin(t,n)}registerPlugins(t){t.forEach(n=>{const[r,s]=n;this._pluginService.registerPlugin(r,s)})}}function kI(e,t){const n=ld([[Lh],[On],[ni],[f.LifecycleService],[f.PluginService],[Hr],[Jn,{useClass:f.UniverInstanceService}],[od,{useClass:ad}],[dt,{useClass:Mc,lazy:!0}],[gr,{useClass:f.CommandService}],[ri,{useClass:f.LocalUndoRedoService,lazy:!0}],[fr,{useClass:Ac}],[Un,{useClass:Tc}],[Qs,{useClass:f.ResourceManagerService,lazy:!0}],[ha,{useClass:Ea,lazy:!0}],[Nh,{useClass:f.AuthzIoLocalService}],[id,{useClass:f.MentionIOLocalService,lazy:!0}]],t),r=e?e.createChild(n):new Ce.Injector(n);return Aa(r,[[Hr],[ha]]),r}Pd(),f.ABCToNumber=J0,f.AUTO_HEIGHT_FOR_MERGED_CELLS=ba,f.AbsoluteRefType=Me,f.ActionIterator=Xn,f.AlignTypeH=lc,f.AlignTypeV=cc,f.ArrangeTypeEnum=dc,f.ArrowsAndMarkersShapes=Ul,f.AsyncInterceptorManager=rf,f.AsyncLock=Vd,f.AutoFillSeries=Ol,f.BaselineOffset=jt,f.BasicShapes=Ll,f.BlockType=jl,f.BooleanNumber=ae,f.BorderStyleTypes=Pe,f.BorderType=vl,f.BuildTextUtils=Qe,f.BulletAlignment=hr,f.COLORS=Hi,f.COMMAND_LOG_EXECUTION_CONFIG_KEY=ms,f.CanceledError=Jd,f.CellModeEnum=Pn,f.CellValueType=Qt,f.Color=Cn,f.ColorBuilder=ps,f.ColorKit=It,f.ColorType=Rt,f.ColumnSeparatorType=Vl,f.CommandType=mr,f.CommonHideTypes=wl,f.ConfigService=Ac,f.ContextService=Tc,f.CopyPasteType=bl,f.CustomCommandExecutionError=Jr,f.CustomDecorationType=_n,f.CustomRangeType=en,f.DEFAULT_CELL=y0,f.DEFAULT_DOC=qo,f.DEFAULT_DOCUMENT_SUB_COMPONENT_ID=hR,f.DEFAULT_EMPTY_DOCUMENT_VALUE=va,f.DEFAULT_NUMBER_FORMAT=Po,f.DEFAULT_RANGE=w0,f.DEFAULT_RANGE_ARRAY=v0,f.DEFAULT_SELECTION=b0,f.DEFAULT_SLIDE=$u,f.DEFAULT_STYLES=it,f.DEFAULT_TEXT_FORMAT=Iu,f.DEFAULT_TEXT_FORMAT_EXCEL=Su,f.DEFAULT_WORKSHEET_COLUMN_COUNT=Gh,f.DEFAULT_WORKSHEET_COLUMN_COUNT_KEY=YR,f.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT=Jh,f.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY=KR,f.DEFAULT_WORKSHEET_COLUMN_WIDTH=Xh,f.DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY=zR,f.DEFAULT_WORKSHEET_ROW_COUNT=zh,f.DEFAULT_WORKSHEET_ROW_COUNT_KEY=WR,f.DEFAULT_WORKSHEET_ROW_HEIGHT=Kh,f.DEFAULT_WORKSHEET_ROW_HEIGHT_KEY=VR,f.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH=qh,f.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY=GR,f.DOCS_COMMENT_EDITOR_UNIT_ID_KEY=Oa,f.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY=ci,f.DOCS_NORMAL_EDITOR_UNIT_ID_KEY=li,f.DOCS_ZEN_EDITOR_UNIT_ID_KEY=Sa,f.DOC_DRAWING_PRINTING_COMPONENT_KEY=D0,f.DOC_RANGE_TYPE=Wc,f.DashStyleType=Jl,f.DataStreamTreeNodeType=Sh,f.DataStreamTreeTokenType=ut,f.DataValidationErrorStyle=Id,f.DataValidationImeMode=Sd,f.DataValidationOperator=Od,f.DataValidationRenderMode=vd,f.DataValidationStatus=wd,f.DataValidationType=bd,f.DeleteDirection=yl,f.DependentOn=mI,f.DesktopLogService=Mc,f.DeveloperMetadataVisibility=Al,f.Dimension=Tl,f.Direction=Nl,f.Disposable=Ke,f.DisposableCollection=is,f.DocStyleType=Bl,f.DocumentDataModel=Tt,f.DocumentFlavor=Ti,f.DrawingTypeEnum=fc,f.EDITOR_ACTIVATED=Mh,f.EXTENSION_NAMES=ju,f.ErrorService=Lh,f.EventState=Ah,f.EventSubject=dR,f.FOCUSING_COMMENT_EDITOR=OR,f.FOCUSING_COMMON_DRAWINGS=bR,f.FOCUSING_DOC=$r,f.FOCUSING_EDITOR_BUT_HIDDEN=CR,f.FOCUSING_EDITOR_INPUT_FORMULA=RR,f.FOCUSING_EDITOR_STANDALONE=SR,f.FOCUSING_FX_BAR_EDITOR=Dh,f.FOCUSING_PANEL_EDITOR=vR,f.FOCUSING_SHAPE_TEXT_EDITOR=yR,f.FOCUSING_SHEET=qn,f.FOCUSING_SLIDE=jr,f.FOCUSING_UNIT=Br,f.FOCUSING_UNIVER_EDITOR=IR,f.FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE=wR,f.FORMULA_EDITOR_ACTIVATED=AR,f.FollowNumberWithType=$l,f.FontItalic=ls,f.FontStyleType=Ln,f.FontWeight=cs,f.GridType=Wl,f.HLSColor=xc,f.HorizontalAlign=bt,f.IAuthzIoService=Nh,f.ICommandService=gr,f.IConfigService=fr,f.IConfirmService=pR,f.IContextService=Un,f.IImageIoService=ra,f.ILocalStorageService=oI,f.ILogService=dt,f.IMentionIOService=id,f.IPermissionService=od,f.IResourceLoaderService=ha,f.IResourceManagerService=Qs,f.IS_ROW_STYLE_PRECEDE_COLUMN_STYLE=wa,f.IURLImageService=sa,f.IUndoRedoService=ri,f.IUniverInstanceService=Jn,f.ImageCacheMap=gd,f.ImageSourceType=ti,f.ImageUploadStatusType=Uh,f.InterceptorEffectEnum=An,f.InterceptorManager=ef,f.InterpolationPointType=Ml,f.JSON1=$_,f.JSONX=Vt,f.LRUHelper=Tr,f.LRUMap=Ws,f.LifecycleStages=Fe,f.LifecycleUnreachableError=rd,f.ListGlyphType=fe,f.LocaleService=On,f.LocaleType=cr,f.LogLevel=Nc,f.MOVE_BUFFER_VALUE=pr,f.MemoryCursor=fn,f.MentionType=as,f.NAMED_STYLE_MAP=T0,f.NAMED_STYLE_SPACE_MAP=N0,f.NamedStyleType=Je,f.NilCommand=Dc,f.NumberUnitType=ac,f.ObjectMatrix=ct,f.ObjectRelativeFromH=ic,f.ObjectRelativeFromV=oc,f.OtherShapes=Pl,f.PAGE_SIZE=L0,f.PAPER_TYPES=L_,f.PRESET_LIST_TYPE=Pr,f.PRINT_CHART_COMPONENT_KEY=M0,f.PageElementType=mc,f.PageOrientType=hc,f.PageType=Ni,f.PaperType=ht,f.ParagraphElementType=Gl,f.ParagraphStyleBuilder=xr,f.ParagraphStyleValue=Fr,f.PermissionService=ad,f.PermissionStatus=la,f.Plugin=ua,f.PositionedObjectLayoutType=Xl,f.PresetListType=xt,f.ProtectionType=Dl,f.QuickListType=uh,f.QuickListTypeMap=lC,f.RANGE_DIRECTION=jc,f.RANGE_TYPE=pe,f.RBush=Vs,f.RCDisposable=E_,f.RGBA_PAREN=rp,f.RGB_PAREN=np,f.ROTATE_BUFFER_VALUE=kc,f.RTree=OI,f.Range=Yn,f.Rectangle=Yt,f.RedoCommand=md,f.RedoCommandId=hd,f.RefAlias=q0,f.Registry=wi,f.RegistryAsMap=bi,f.RelativeDate=Fl,f.RelativeSlideLink=gc,f.RgbColor=Es,f.RichTextBuilder=Sn,f.RichTextValue=an,f.RxDisposable=p_,f.SHEET_EDITOR_UNITS=A0,f.SectionType=Yl,f.SheetTypes=xl,f.SheetViewModel=Qh,f.SliceBodyType=Ko,f.SlideDataModel=oa,f.SpacingRule=ql,f.SpecialShapes=kl,f.Styles=Ph,f.THEME_COLORS=Fc,f.TabStopAlignment=Zl,f.TableAlignmentType=ec,f.TableLayoutType=tc,f.TableRowHeightRule=rc,f.TableSizeType=Ql,f.TableTextWrapType=nc,f.TestConfirmService=ER,f.TextDecoration=Hl,f.TextDecorationBuilder=on,f.TextDirection=ur,f.TextDirectionType=zl,f.TextStyleBuilder=sn,f.TextStyleValue=kr,f.TextX=De,f.TextXActionType=J,f.ThemeColor=Cs,f.ThemeColorType=at,f.ThemeColors=us,f.ThemeService=ni,f.Tools=Z,f.UndoCommand=fd,f.UndoCommandId=dd,f.UnitModel=os,f.Univer=PI,f.UniverInstanceType=we,f.UpdateDocsAttributeType=Re,f.UserManagerService=Hr,f.VerticalAlign=mn,f.VerticalAlignmentType=sc,f.Worksheet=Yr,f.WrapStrategy=gn,f.WrapTextType=Kl,f.addLinkToDocumentModel=xh,f.afterInitApply=J_,f.afterTime=X_,f.awaitTime=vI,f.binSearchFirstGreaterThanTarget=Pc,f.binarySearchArray=Z_,f.bufferDebounceTime=K_,f.cellToRange=NE,f.characterSpacingControlType=uc,f.checkForSubstrings=DE,f.checkIfMove=ep,f.checkParagraphHasBullet=m0,f.checkParagraphHasIndent=g0,f.checkParagraphHasIndentByStyle=Fu,f.cloneCellData=jh,f.cloneCellDataMatrix=Wh,f.cloneCellDataWithSpanAndDisplay=xR,f.cloneValue=gt,f.cloneWorksheetData=Vh,f.codeToBlob=Q_,f.composeBody=Xo,f.composeInterceptors=Na,f.composeStyles=lr,f.concatMatrixArray=CE,f.convertBodyToHtml=tp,f.convertCellToRange=vu,f.convertObservableToBehaviorSubject=q_,f.covertCellValue=Ho,f.covertCellValues=ME,f.covertTextRunToHtml=xi,f.createAsyncInterceptorKey=tf,f.createDefaultUser=ei,f.createDocumentModelWithStyle=Wr,f.createInterceptorKey=Qd,f.createInternalEditorID=Kd,f.createREGEXFromWildChar=M_,f.createRowColIter=Yo,f.customNameCharacterCheck=SI,f.dayjs=Wt,f.debounce=s_,f.dedupe=kd,f.dedupeBy=Fd,f.deepCompare=Bo,f.delayAnimationFrame=wI,f.deleteContent=Hu,f.extractPureTextFromCell=td,f.fromCallback=Lc,f.fromEventSubject=fR,f.generateIntervalsByPoints=E0,f.generateRandomId=nt,f.get=ul,f.getArrayLength=rn,f.getBodySlice=At,f.getBodySliceHtml=_s,f.getBorderStyleType=yE,f.getCellCoordByIndexSimple=pa,f.getCellInfoInMergeData=Rp,f.getCellPositionByIndexSimple=MI,f.getCellValueType=pp,f.getCellWithCoordByIndexCore=Zn,f.getColorStyle=Ft,f.getCustomBlockSlice=gh,f.getCustomDecorationSlice=ph,f.getCustomRangeSlice=_h,f.getDocsUpdateBody=AE,f.getEmptyCell=PR,f.getIntersectRange=zu,f.getNumfmtParseValueFilter=Ou,f.getOriginCellValue=qR,f.getParagraphsSlice=mh,f.getPlainText=Zs,f.getReverseDirection=D_,f.getSectionBreakSlice=pC,f.getTableSlice=fh,f.getTextRunSlice=Js,f.getTransformOffsetX=Cd,f.getTransformOffsetY=Rd,f.getWorksheetUID=eI,f.groupBy=Bd,f.handleStyleToString=bE,f.hashAlgorithm=p0,f.horizontalLineSegmentsSubtraction=js,f.insertMatrixArray=EE,f.insertTextToContent=xu,f.invertColorByHSL=uf,f.invertColorByMatrix=df,f.isBlackColor=gp,f.isBooleanString=Gd,f.isCellCoverable=xo,f.isCellV=$c,f.isCommentEditorID=Xd,f.isDefaultFormat=fE,f.isEmptyCell=wu,f.isFormulaId=wE,f.isFormulaString=bu,f.isICellData=Bc,f.isInternalEditorID=ya,f.isNodeEnv=N_,f.isNotNullOrUndefined=Hh,f.isNullCell=Ep,f.isNumeric=pl,f.isPatternEqualWithoutDecimal=mE,f.isRangesEqual=MR,f.isRealNum=_0,f.isSafeNumeric=d_,f.isSameStyleTextRun=yu,f.isTextFormat=dE,f.isUnitRangesEqual=DR,f.isValidRange=TE,f.isWhiteColor=_p,f.makeArray=$d,f.makeCellRangeToRangeData=vE,f.makeCellToSelection=OE,f.makeCustomRangeStream=MC,f.mapObjectMatrix=pE,f.merge=ss,f.mergeIntervals=C0,f.mergeLocales=R0,f.mergeOverrideWithDependencies=ld,f.mergeSets=g_,f.mergeWith=l_,f.mergeWorksheetSnapshotWithDefault=Zh,f.mixinClass=h_,f.moveMatrixArray=Fo,f.moveRangeByOffset=B0,f.nameCharacterCheck=II,f.normalizeBody=EC,f.normalizeTextRuns=Ur,f.numberToABC=Q0,f.numberToListABC=eC,f.numfmt=hE,f.queryObjectMatrix=X0,f.registerDependencies=qd,f.remove=rr,f.repeatStringNumTimes=qu,f.replaceInDocumentBody=cR,f.requestImmediateMacroTask=m_,f.resolveWithBasePath=S_,f.rotate=Hd,f.searchArray=_r,f.searchInOrderedArray=Uc,f.selectionToArray=Cp,f.sequence=Cl,f.sequenceAsync=El,f.sequenceExecute=gs,f.sequenceExecuteAsync=G_,f.set=u_,f.shallowEqual=Ta,f.skipParseTagNames=DI,f.sliceMatrixArray=RE,f.sortRules=tC,f.sortRulesByDesc=nC,f.sortRulesFactory=Lr,f.spliceArray=ko,f.splitIntoGrid=Wo,f.takeAfter=Fi,f.textDiff=Zo,f.throttle=Zd,f.toDisposable=Ye,f.touchDependencies=Aa,f.updateAttributeByDelete=Eh,f.updateAttributeByInsert=Ch,f.willLoseNumericPrecision=f_,Object.keys(Ce).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(f,e)&&Object.defineProperty(f,e,{enumerable:!0,get:()=>Ce[e]})}),Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})}));