@univerjs/core 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/lib/cjs/facade.js +1 -1
  2. package/lib/cjs/index.js +9 -8
  3. package/lib/es/facade.js +1 -1479
  4. package/lib/es/index.js +9 -20335
  5. package/lib/facade.js +1 -1479
  6. package/lib/index.js +9 -20335
  7. package/lib/types/common/async.d.ts +16 -1
  8. package/lib/types/common/di.d.ts +18 -2
  9. package/lib/types/common/interceptor.d.ts +16 -1
  10. package/lib/types/common/invert-color/invert-hsl.d.ts +16 -1
  11. package/lib/types/common/invert-color/invert-rgb.d.ts +16 -1
  12. package/lib/types/common/unit.d.ts +17 -2
  13. package/lib/types/docs/data-model/document-data-model.d.ts +24 -9
  14. package/lib/types/docs/data-model/empty-snapshot.d.ts +16 -1
  15. package/lib/types/docs/data-model/json-x/json-x.d.ts +19 -4
  16. package/lib/types/docs/data-model/preset-list-type.d.ts +16 -1
  17. package/lib/types/docs/data-model/replacement.d.ts +16 -1
  18. package/lib/types/docs/data-model/rich-text-builder.d.ts +21 -5
  19. package/lib/types/docs/data-model/text-x/action-iterator.d.ts +17 -1
  20. package/lib/types/docs/data-model/text-x/action-types.d.ts +17 -2
  21. package/lib/types/docs/data-model/text-x/apply-utils/common.d.ts +16 -1
  22. package/lib/types/docs/data-model/text-x/apply-utils/delete-apply.d.ts +16 -1
  23. package/lib/types/docs/data-model/text-x/apply-utils/insert-apply.d.ts +16 -1
  24. package/lib/types/docs/data-model/text-x/apply-utils/update-apply.d.ts +16 -1
  25. package/lib/types/docs/data-model/text-x/apply.d.ts +17 -2
  26. package/lib/types/docs/data-model/text-x/build-utils/custom-decoration.d.ts +17 -2
  27. package/lib/types/docs/data-model/text-x/build-utils/custom-range.d.ts +17 -2
  28. package/lib/types/docs/data-model/text-x/build-utils/drawings.d.ts +19 -4
  29. package/lib/types/docs/data-model/text-x/build-utils/index.d.ts +24 -9
  30. package/lib/types/docs/data-model/text-x/build-utils/paragraph.d.ts +18 -3
  31. package/lib/types/docs/data-model/text-x/build-utils/parse.d.ts +16 -1
  32. package/lib/types/docs/data-model/text-x/build-utils/selection.d.ts +17 -2
  33. package/lib/types/docs/data-model/text-x/build-utils/text-x-utils.d.ts +23 -7
  34. package/lib/types/docs/data-model/text-x/text-x.d.ts +18 -3
  35. package/lib/types/docs/data-model/text-x/transform-utils.d.ts +17 -2
  36. package/lib/types/docs/data-model/text-x/utils.d.ts +34 -19
  37. package/lib/types/docs/data-model/utils.d.ts +16 -1
  38. package/lib/types/facade/f-base.d.ts +17 -1
  39. package/lib/types/facade/f-blob.d.ts +17 -1
  40. package/lib/types/facade/f-doc.d.ts +17 -1
  41. package/lib/types/facade/f-enum.d.ts +15 -0
  42. package/lib/types/facade/f-event-registry.d.ts +19 -3
  43. package/lib/types/facade/f-event.d.ts +17 -2
  44. package/lib/types/facade/f-hooks.d.ts +17 -1
  45. package/lib/types/facade/f-univer.d.ts +20 -3
  46. package/lib/types/facade/f-usermanager.d.ts +17 -1
  47. package/lib/types/facade/f-util.d.ts +15 -0
  48. package/lib/types/observer/observable.d.ts +17 -1
  49. package/lib/types/services/authz-io/authz-io-local.service.d.ts +17 -2
  50. package/lib/types/services/authz-io/type.d.ts +18 -3
  51. package/lib/types/services/command/command.service.d.ts +20 -4
  52. package/lib/types/services/config/config.service.d.ts +18 -3
  53. package/lib/types/services/confirm/confirm.service.d.ts +17 -2
  54. package/lib/types/services/context/context.service.d.ts +16 -1
  55. package/lib/types/services/error/error.service.d.ts +16 -1
  56. package/lib/types/services/image-io/image-io.service.d.ts +18 -3
  57. package/lib/types/services/image-io/url-image.service.d.ts +17 -2
  58. package/lib/types/services/instance/instance.service.d.ts +22 -5
  59. package/lib/types/services/lifecycle/lifecycle.service.d.ts +16 -1
  60. package/lib/types/services/local-storage/local-storage.service.d.ts +1 -1
  61. package/lib/types/services/locale/locale.service.d.ts +17 -2
  62. package/lib/types/services/log/log.service.d.ts +16 -1
  63. package/lib/types/services/mention-io/mention-io-local.service.d.ts +16 -1
  64. package/lib/types/services/mention-io/type.d.ts +18 -3
  65. package/lib/types/services/permission/permission.service.d.ts +18 -2
  66. package/lib/types/services/permission/type.d.ts +20 -5
  67. package/lib/types/services/plugin/plugin-override.d.ts +16 -1
  68. package/lib/types/services/plugin/plugin.service.d.ts +18 -2
  69. package/lib/types/services/resource-loader/resource-loader.service.d.ts +17 -2
  70. package/lib/types/services/resource-loader/type.d.ts +17 -2
  71. package/lib/types/services/resource-manager/resource-manager.service.d.ts +19 -4
  72. package/lib/types/services/resource-manager/type.d.ts +19 -4
  73. package/lib/types/services/theme/theme.service.d.ts +16 -1
  74. package/lib/types/services/undoredo/undoredo.service.d.ts +22 -5
  75. package/lib/types/services/user-manager/const.d.ts +17 -1
  76. package/lib/types/services/user-manager/user-manager.service.d.ts +17 -2
  77. package/lib/types/shared/after-init-apply.d.ts +16 -1
  78. package/lib/types/shared/cache/image-cache.d.ts +16 -1
  79. package/lib/types/shared/check-if-move.d.ts +17 -2
  80. package/lib/types/shared/common.d.ts +22 -7
  81. package/lib/types/shared/compare.d.ts +16 -1
  82. package/lib/types/shared/dayjs.d.ts +16 -1
  83. package/lib/types/shared/doc-tool.d.ts +16 -1
  84. package/lib/types/shared/generate.d.ts +17 -2
  85. package/lib/types/shared/lifecycle.d.ts +18 -2
  86. package/lib/types/shared/lru/lru-map.d.ts +16 -1
  87. package/lib/types/shared/object-matrix-query.d.ts +16 -1
  88. package/lib/types/shared/object-matrix.d.ts +17 -2
  89. package/lib/types/shared/r-tree.d.ts +18 -2
  90. package/lib/types/shared/range.d.ts +17 -2
  91. package/lib/types/shared/rectangle.d.ts +17 -2
  92. package/lib/types/shared/rxjs.d.ts +18 -2
  93. package/lib/types/shared/tools.d.ts +17 -23
  94. package/lib/types/sheets/clone.d.ts +17 -2
  95. package/lib/types/sheets/column-manager.d.ts +19 -4
  96. package/lib/types/sheets/empty-snapshot.d.ts +16 -1
  97. package/lib/types/sheets/range.d.ts +23 -6
  98. package/lib/types/sheets/row-manager.d.ts +20 -5
  99. package/lib/types/sheets/sheet-skeleton.d.ts +21 -5
  100. package/lib/types/sheets/sheet-snapshot-utils.d.ts +16 -1
  101. package/lib/types/sheets/span-model.d.ts +16 -1
  102. package/lib/types/sheets/styles.d.ts +18 -3
  103. package/lib/types/sheets/typedef.d.ts +23 -7
  104. package/lib/types/sheets/util.d.ts +20 -4
  105. package/lib/types/sheets/workbook.d.ts +19 -4
  106. package/lib/types/sheets/worksheet.d.ts +25 -7
  107. package/lib/types/skeleton.d.ts +16 -1
  108. package/lib/types/slides/slide-model.d.ts +22 -6
  109. package/lib/types/types/const/const.d.ts +18 -2
  110. package/lib/types/types/const/page-size.d.ts +16 -1
  111. package/lib/types/types/interfaces/i-cell-custom-render.d.ts +20 -5
  112. package/lib/types/types/interfaces/i-cell-validation-data.d.ts +17 -2
  113. package/lib/types/types/interfaces/i-data-validation.d.ts +21 -6
  114. package/lib/types/types/interfaces/i-document-data-interceptor.d.ts +16 -1
  115. package/lib/types/types/interfaces/i-document-data.d.ts +20 -5
  116. package/lib/types/types/interfaces/i-drawing.d.ts +56 -3
  117. package/lib/types/types/interfaces/i-mention.d.ts +16 -1
  118. package/lib/types/types/interfaces/i-need-check-disposable.d.ts +16 -1
  119. package/lib/types/types/interfaces/i-placeholder.d.ts +16 -1
  120. package/lib/types/types/interfaces/i-shape-properties.d.ts +17 -2
  121. package/lib/types/types/interfaces/i-slide-data.d.ts +26 -11
  122. package/lib/types/types/interfaces/i-style-data.d.ts +19 -4
  123. package/lib/types/univer.d.ts +26 -10
  124. package/lib/umd/facade.js +1 -1
  125. package/lib/umd/index.js +9 -8
  126. package/package.json +9 -9
  127. package/lib/types/docs/data-model/text-x/build-utils/__test__/custom-range.spec.d.ts +0 -16
  128. package/lib/types/docs/data-model/text-x/build-utils/__test__/selection.spec.d.ts +0 -16
package/lib/umd/index.js CHANGED
@@ -1,8 +1,9 @@
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,Vr,Kr){"use strict";var DI=Object.defineProperty;var LI=(f,Ce,se)=>Ce in f?DI(f,Ce,{enumerable:!0,configurable:!0,writable:!0,value:se}):f[Ce]=se;var R=(f,Ce,se)=>LI(f,typeof Ce!="symbol"?Ce+"":Ce,se);var Sd,Od;function wd(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 Dt=typeof global<"u"?global:typeof self<"u"?self:window;function bd(){const t=new Map;let n=0;typeof Dt.requestIdleCallback!="function"&&(Dt.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 Dt.cancelIdleCallback!="function"&&(Dt.cancelIdleCallback=function(s){const i=t.get(s);i!==void 0&&(clearTimeout(i),t.delete(s))})}function yd(){typeof Dt.Array.prototype.findLastIndex!="function"&&(Dt.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 Dt.Array.prototype.findLast!="function"&&(Dt.Array.prototype.findLast=function(t,n){const r=this.findLastIndex(t,n);return r!==-1?this[r]:void 0})}function Ad(){typeof Dt.String.prototype.at!="function"&&(Dt.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 Td(){bd(),yd(),Ad()}function er(e,t){const n=e.indexOf(t);return n>-1?(e.splice(n,1),!0):!1}function Nd(e){const t=new Set,n=[];for(const r of e)t.has(r)||(t.add(r),n.push(r));return n}function Md(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 Dd(e,t){for(let n=e.length-1;n>-1;n--){const r=e[n];if(t(r,n))return r}return null}function Ld(e,t){if(e.length===0)return e;const n=t%e.length;return e.slice(n).concat(e.slice(0,n))}function Ud(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 Pd(e){return Array.isArray(e)?e:[e]}function Et(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Qs,ma;function kd(){if(ma)return Qs;ma=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(E,b){O||(O=!0,m(x,E,b))})}catch(E){O||(O=!0,m(x,E))}}else d._promiseTry(function(){return n()}).then(function(E){m(x,void 0,E)},function(E){m(x,E)})};d.domainReentrant&&process.domain&&(_=process.domain.bind(_));var C=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>=C)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)}},Qs=e,Qs}var ei,ga;function Fd(){return ga||(ga=1,ei=kd()),ei}var xd=Fd();const Hd=Et(xd),Bd=new Set(["true","false"]);function $d(e){return Bd.has(e.toLowerCase())}const vn="__INTERNAL_EDITOR__",ti=`${vn}DOCS_NORMAL`,ni=`${vn}DOCS_FORMULA_BAR`,_a=`${vn}ZEN_EDITOR`,pa=`${vn}COMMENT_EDITOR`,Ea=`\r
2
- `,Ca="isRowStylePrecedeColumnStyle",Ra=Symbol("AUTO_HEIGHT_FOR_MERGED_CELLS");function jd(e){return`${vn}${e}`}function Ia(e){return e.startsWith(vn)}function Wd(e){return e===pa}function Yd(e,t){t.forEach(n=>e.add(n))}function Sa(e,t){t.forEach(([n])=>{e.has(n)&&e.get(n)})}function Oa(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 Gr extends Error{constructor(t){super(t),this.name="CustomCommandExecutionError"}}class zd extends Gr{constructor(){super("Canceled by facade"),this.name="CanceledError"}}function Vd(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 wn=(e=>(e[e.Style=1]="Style",e[e.Value=2]="Value",e))(wn||{});function Kd(e){return`sheet_interceptor_${e}`}const va=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 Gd{constructor(t){R(this,"_interceptorsByName",new Map);R(this,"_interceptorPoints");this._interceptorPoints=t}fetchThroughInterceptors(t,n){const r=t;let s=this._interceptorsByName.get(r);return n&&(s=s.filter(n)),va(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)})),()=>er(this._interceptorsByName.get(r),n)}getInterceptPoints(){return this._interceptorPoints}dispose(){this._interceptorsByName.clear()}}function Xd(e){return`sheet_async_interceptor_${e}`}const qd=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 Jd{constructor(t){R(this,"_asyncInterceptorsByName",new Map);R(this,"_asyncInterceptorPoints");this._asyncInterceptorPoints=t}fetchThroughAsyncInterceptors(t,n){const r=t;let s=this._asyncInterceptorsByName.get(r);return n&&(s=s.filter(n)),qd(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)})),()=>er(this._asyncInterceptorsByName.get(r),n)}getInterceptPoints(){return this._asyncInterceptorPoints}dispose(){this._asyncInterceptorsByName.clear()}}function wa(e){return e.map(t=>t/255)}function ba(e){return e.map(t=>Math.round(t*255))}function Zd([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 Xr(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 ya(e,t){return(Math.max(e,t)+.05)/(Math.min(e,t)+.05)}function Qd(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 ri={r:1,g:1,b:1},si={r:0,g:0,b:0},ef=Xr(ri.r,ri.g,ri.b),tf=Xr(si.r,si.g,si.b);function nf(e){const t=Xr(e[0],e[1],e[2]),n=ya(ef,t),r=Zd(e);let s=1-r[2],i,o,a;do i=Qd(r[0],r[1],s),o=Xr(i[0],i[1],i[2]),a=ya(o,tf),s+=.01;while(s<=1&&s>=0&&Math.abs(a-n)<.01);return i}function rf(e){return ba(nf(wa(e)))}const Ct=[[.333,-.667,-.667,0,1],[-.667,.333,-.667,0,1],[-.667,-.667,.333,0,1],[0,0,0,1,0]];function sf(e){const t=e[0],n=e[1],r=e[2];let s=[Ct[0][0]*t+Ct[0][1]*n+Ct[0][2]*r+Ct[0][4],Ct[1][0]*t+Ct[1][1]*n+Ct[1][2]*r+Ct[1][4],Ct[2][0]*t+Ct[2][1]*n+Ct[2][2]*r+Ct[2][4]];return s=s.map(i=>i>1?1:i<0?0:i),s}function of(e){return ba(sf(wa(e)))}var Aa=typeof global=="object"&&global&&global.Object===Object&&global,af=typeof self=="object"&&self&&self.Object===Object&&self,an=Aa||af||Function("return this")(),bn=an.Symbol,Ta=Object.prototype,lf=Ta.hasOwnProperty,cf=Ta.toString,tr=bn?bn.toStringTag:void 0;function uf(e){var t=lf.call(e,tr),n=e[tr];try{e[tr]=void 0;var r=!0}catch{}var s=cf.call(e);return r&&(t?e[tr]=n:delete e[tr]),s}var hf=Object.prototype,df=hf.toString;function ff(e){return df.call(e)}var mf="[object Null]",gf="[object Undefined]",Na=bn?bn.toStringTag:void 0;function nr(e){return e==null?e===void 0?gf:mf:Na&&Na in Object(e)?uf(e):ff(e)}function yn(e){return e!=null&&typeof e=="object"}var _f="[object Symbol]";function qr(e){return typeof e=="symbol"||yn(e)&&nr(e)==_f}function pf(e,t){for(var n=-1,r=e==null?0:e.length,s=Array(r);++n<r;)s[n]=t(e[n],n,e);return s}var An=Array.isArray,Ma=bn?bn.prototype:void 0,Da=Ma?Ma.toString:void 0;function La(e){if(typeof e=="string")return e;if(An(e))return pf(e,La)+"";if(qr(e))return Da?Da.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var Ef=/\s/;function Cf(e){for(var t=e.length;t--&&Ef.test(e.charAt(t)););return t}var Rf=/^\s+/;function If(e){return e&&e.slice(0,Cf(e)+1).replace(Rf,"")}function Rt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Ua=NaN,Sf=/^[-+]0x[0-9a-f]+$/i,Of=/^0b[01]+$/i,vf=/^0o[0-7]+$/i,wf=parseInt;function Pa(e){if(typeof e=="number")return e;if(qr(e))return Ua;if(Rt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Rt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=If(e);var n=Of.test(e);return n||vf.test(e)?wf(e.slice(2),n?2:8):Sf.test(e)?Ua:+e}function ka(e){return e}var bf="[object AsyncFunction]",yf="[object Function]",Af="[object GeneratorFunction]",Tf="[object Proxy]";function ii(e){if(!Rt(e))return!1;var t=nr(e);return t==yf||t==Af||t==bf||t==Tf}var oi=an["__core-js_shared__"],Fa=(function(){var e=/[^.]+$/.exec(oi&&oi.keys&&oi.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function Nf(e){return!!Fa&&Fa in e}var Mf=Function.prototype,Df=Mf.toString;function Lf(e){if(e!=null){try{return Df.call(e)}catch{}try{return e+""}catch{}}return""}var Uf=/[\\^$.*+?()[\]{}|]/g,Pf=/^\[object .+?Constructor\]$/,kf=Function.prototype,Ff=Object.prototype,xf=kf.toString,Hf=Ff.hasOwnProperty,Bf=RegExp("^"+xf.call(Hf).replace(Uf,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $f(e){if(!Rt(e)||Nf(e))return!1;var t=ii(e)?Bf:Pf;return t.test(Lf(e))}function jf(e,t){return e==null?void 0:e[t]}function ai(e,t){var n=jf(e,t);return $f(n)?n:void 0}var xa=Object.create,Wf=(function(){function e(){}return function(t){if(!Rt(t))return{};if(xa)return xa(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})();function Yf(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 zf(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Vf=800,Kf=16,Gf=Date.now;function Xf(e){var t=0,n=0;return function(){var r=Gf(),s=Kf-(r-n);if(n=r,s>0){if(++t>=Vf)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function qf(e){return function(){return e}}var Jr=(function(){try{var e=ai(Object,"defineProperty");return e({},"",{}),e}catch{}})(),Jf=Jr?function(e,t){return Jr(e,"toString",{configurable:!0,enumerable:!1,value:qf(t),writable:!0})}:ka,Zf=Xf(Jf),Qf=9007199254740991,em=/^(?:0|[1-9]\d*)$/;function li(e,t){var n=typeof e;return t=t==null?Qf:t,!!t&&(n=="number"||n!="symbol"&&em.test(e))&&e>-1&&e%1==0&&e<t}function ci(e,t,n){t=="__proto__"&&Jr?Jr(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Zr(e,t){return e===t||e!==e&&t!==t}var tm=Object.prototype,nm=tm.hasOwnProperty;function Ha(e,t,n){var r=e[t];(!(nm.call(e,t)&&Zr(r,n))||n===void 0&&!(t in e))&&ci(e,t,n)}function rm(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?ci(n,a,l):Ha(n,a,l)}return n}var Ba=Math.max;function sm(e,t,n){return t=Ba(t===void 0?e.length-1:t,0),function(){for(var r=arguments,s=-1,i=Ba(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),Yf(e,this,a)}}function im(e,t){return Zf(sm(e,t,ka),e+"")}var om=9007199254740991;function $a(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=om}function ui(e){return e!=null&&$a(e.length)&&!ii(e)}function am(e,t,n){if(!Rt(n))return!1;var r=typeof t;return(r=="number"?ui(n)&&li(t,n.length):r=="string"&&t in n)?Zr(n[t],e):!1}function ja(e){return im(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&&am(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 lm=Object.prototype;function Wa(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||lm;return e===n}function cm(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var um="[object Arguments]";function Ya(e){return yn(e)&&nr(e)==um}var za=Object.prototype,hm=za.hasOwnProperty,dm=za.propertyIsEnumerable,hi=Ya((function(){return arguments})())?Ya:function(e){return yn(e)&&hm.call(e,"callee")&&!dm.call(e,"callee")};function fm(){return!1}var Va=typeof f=="object"&&f&&!f.nodeType&&f,Ka=Va&&typeof module=="object"&&module&&!module.nodeType&&module,mm=Ka&&Ka.exports===Va,Ga=mm?an.Buffer:void 0,gm=Ga?Ga.isBuffer:void 0,Xa=gm||fm,_m="[object Arguments]",pm="[object Array]",Em="[object Boolean]",Cm="[object Date]",Rm="[object Error]",Im="[object Function]",Sm="[object Map]",Om="[object Number]",vm="[object Object]",wm="[object RegExp]",bm="[object Set]",ym="[object String]",Am="[object WeakMap]",Tm="[object ArrayBuffer]",Nm="[object DataView]",Mm="[object Float32Array]",Dm="[object Float64Array]",Lm="[object Int8Array]",Um="[object Int16Array]",Pm="[object Int32Array]",km="[object Uint8Array]",Fm="[object Uint8ClampedArray]",xm="[object Uint16Array]",Hm="[object Uint32Array]",He={};He[Mm]=He[Dm]=He[Lm]=He[Um]=He[Pm]=He[km]=He[Fm]=He[xm]=He[Hm]=!0,He[_m]=He[pm]=He[Tm]=He[Em]=He[Nm]=He[Cm]=He[Rm]=He[Im]=He[Sm]=He[Om]=He[vm]=He[wm]=He[bm]=He[ym]=He[Am]=!1;function Bm(e){return yn(e)&&$a(e.length)&&!!He[nr(e)]}function $m(e){return function(t){return e(t)}}var qa=typeof f=="object"&&f&&!f.nodeType&&f,rr=qa&&typeof module=="object"&&module&&!module.nodeType&&module,jm=rr&&rr.exports===qa,di=jm&&Aa.process,Ja=(function(){try{var e=rr&&rr.require&&rr.require("util").types;return e||di&&di.binding&&di.binding("util")}catch{}})(),Za=Ja&&Ja.isTypedArray,Qa=Za?$m(Za):Bm;function Wm(e,t){var n=An(e),r=!n&&hi(e),s=!n&&!r&&Xa(e),i=!n&&!r&&!s&&Qa(e),o=n||r||s||i,a=o?cm(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")||li(c,l))||a.push(c);return a}function Ym(e,t){return function(n){return e(t(n))}}function zm(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Vm=Object.prototype,Km=Vm.hasOwnProperty;function Gm(e){if(!Rt(e))return zm(e);var t=Wa(e),n=[];for(var r in e)r=="constructor"&&(t||!Km.call(e,r))||n.push(r);return n}function el(e){return ui(e)?Wm(e):Gm(e)}var Xm=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qm=/^\w*$/;function Jm(e,t){if(An(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||qr(e)?!0:qm.test(e)||!Xm.test(e)||t!=null&&e in Object(t)}var sr=ai(Object,"create");function Zm(){this.__data__=sr?sr(null):{},this.size=0}function Qm(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var eg="__lodash_hash_undefined__",tg=Object.prototype,ng=tg.hasOwnProperty;function rg(e){var t=this.__data__;if(sr){var n=t[e];return n===eg?void 0:n}return ng.call(t,e)?t[e]:void 0}var sg=Object.prototype,ig=sg.hasOwnProperty;function og(e){var t=this.__data__;return sr?t[e]!==void 0:ig.call(t,e)}var ag="__lodash_hash_undefined__";function lg(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=sr&&t===void 0?ag:t,this}function ln(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ln.prototype.clear=Zm,ln.prototype.delete=Qm,ln.prototype.get=rg,ln.prototype.has=og,ln.prototype.set=lg;function cg(){this.__data__=[],this.size=0}function Qr(e,t){for(var n=e.length;n--;)if(Zr(e[n][0],t))return n;return-1}var ug=Array.prototype,hg=ug.splice;function dg(e){var t=this.__data__,n=Qr(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():hg.call(t,n,1),--this.size,!0}function fg(e){var t=this.__data__,n=Qr(t,e);return n<0?void 0:t[n][1]}function mg(e){return Qr(this.__data__,e)>-1}function gg(e,t){var n=this.__data__,r=Qr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Ht(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])}}Ht.prototype.clear=cg,Ht.prototype.delete=dg,Ht.prototype.get=fg,Ht.prototype.has=mg,Ht.prototype.set=gg;var tl=ai(an,"Map");function _g(){this.size=0,this.__data__={hash:new ln,map:new(tl||Ht),string:new ln}}function pg(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function es(e,t){var n=e.__data__;return pg(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Eg(e){var t=es(this,e).delete(e);return this.size-=t?1:0,t}function Cg(e){return es(this,e).get(e)}function Rg(e){return es(this,e).has(e)}function Ig(e,t){var n=es(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Gt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Gt.prototype.clear=_g,Gt.prototype.delete=Eg,Gt.prototype.get=Cg,Gt.prototype.has=Rg,Gt.prototype.set=Ig;var Sg="Expected a function";function fi(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Sg);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(fi.Cache||Gt),n}fi.Cache=Gt;var Og=500;function vg(e){var t=fi(e,function(r){return n.size===Og&&n.clear(),r}),n=t.cache;return t}var wg=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,bg=/\\(\\)?/g,yg=vg(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(wg,function(n,r,s,i){t.push(s?i.replace(bg,"$1"):r||n)}),t});function Ag(e){return e==null?"":La(e)}function nl(e,t){return An(e)?e:Jm(e,t)?[e]:yg(Ag(e))}function rl(e){if(typeof e=="string"||qr(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Tg(e,t){t=nl(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[rl(t[n++])];return n&&n==r?e:void 0}function sl(e,t,n){var r=e==null?void 0:Tg(e,t);return r===void 0?n:r}var il=Ym(Object.getPrototypeOf,Object),Ng="[object Object]",Mg=Function.prototype,Dg=Object.prototype,ol=Mg.toString,Lg=Dg.hasOwnProperty,Ug=ol.call(Object);function Pg(e){if(!yn(e)||nr(e)!=Ng)return!1;var t=il(e);if(t===null)return!0;var n=Lg.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&ol.call(n)==Ug}function kg(){this.__data__=new Ht,this.size=0}function Fg(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function xg(e){return this.__data__.get(e)}function Hg(e){return this.__data__.has(e)}var Bg=200;function $g(e,t){var n=this.__data__;if(n instanceof Ht){var r=n.__data__;if(!tl||r.length<Bg-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Gt(r)}return n.set(e,t),this.size=n.size,this}function Tn(e){var t=this.__data__=new Ht(e);this.size=t.size}Tn.prototype.clear=kg,Tn.prototype.delete=Fg,Tn.prototype.get=xg,Tn.prototype.has=Hg,Tn.prototype.set=$g;var al=typeof f=="object"&&f&&!f.nodeType&&f,ll=al&&typeof module=="object"&&module&&!module.nodeType&&module,jg=ll&&ll.exports===al,cl=jg?an.Buffer:void 0;cl&&cl.allocUnsafe;function Wg(e,t){return e.slice()}var ul=an.Uint8Array;function Yg(e){var t=new e.constructor(e.byteLength);return new ul(t).set(new ul(e)),t}function zg(e,t){var n=Yg(e.buffer);return new e.constructor(n,e.byteOffset,e.length)}function Vg(e){return typeof e.constructor=="function"&&!Wa(e)?Wf(il(e)):{}}function Kg(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 Gg=Kg(),mi=function(){return an.Date.now()},Xg="Expected a function",qg=Math.max,Jg=Math.min;function Zg(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(Xg);t=Pa(t)||0,Rt(n)&&(u=!!n.leading,h="maxWait"in n,i=h?qg(Pa(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d);function m(E){var b=r,T=s;return r=s=void 0,c=E,o=e.apply(T,b),o}function _(E){return c=E,a=setTimeout(y,t),u?m(E):o}function C(E){var b=E-l,T=E-c,B=t-b;return h?Jg(B,i-T):B}function I(E){var b=E-l,T=E-c;return l===void 0||b>=t||b<0||h&&T>=i}function y(){var E=mi();if(I(E))return H(E);a=setTimeout(y,C(E))}function H(E){return a=void 0,d&&r?m(E):(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(mi())}function O(){var E=mi(),b=I(E);if(r=arguments,s=this,l=E,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 gi(e,t,n){(n!==void 0&&!Zr(e[t],n)||n===void 0&&!(t in e))&&ci(e,t,n)}function Qg(e){return yn(e)&&ui(e)}function _i(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function e_(e){return rm(e,el(e))}function t_(e,t,n,r,s,i,o){var a=_i(e,n),l=_i(t,n),c=o.get(l);if(c){gi(e,n,c);return}var u=i?i(a,l,n+"",e,t,o):void 0,h=u===void 0;if(h){var d=An(l),m=!d&&Xa(l),_=!d&&!m&&Qa(l);u=l,d||m||_?An(a)?u=a:Qg(a)?u=zf(a):m?(h=!1,u=Wg(l)):_?(h=!1,u=zg(l)):u=[]:Pg(l)||hi(l)?(u=a,hi(a)?u=e_(a):(!Rt(a)||ii(a))&&(u=Vg(l))):h=!1}h&&(o.set(l,u),s(u,l,r,i,o),o.delete(l)),gi(e,n,u)}function pi(e,t,n,r,s){e!==t&&Gg(t,function(i,o){if(s||(s=new Tn),Rt(i))t_(e,t,o,n,pi,r,s);else{var a=r?r(_i(e,o),i,o+"",e,t,s):void 0;a===void 0&&(a=i),gi(e,o,a)}},el)}var n_=ja(function(e,t,n,r){pi(e,t,n,r)}),ts=ja(function(e,t,n){pi(e,t,n)});function r_(e,t,n,r){if(!Rt(e))return e;t=nl(t,e);for(var s=-1,i=t.length,o=i-1,a=e;a!=null&&++s<i;){var l=rl(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=Rt(u)?u:li(t[s+1])?[]:{})}Ha(a,l,c),a=a[l]}return e}function s_(e,t,n){return e==null?e:r_(e,t,n)}class cn{constructor(){R(this,"cursor",0)}reset(){return this.cursor=0,this}moveCursor(t){this.cursor+=t}moveCursorTo(t){this.cursor=t}}function i_(e,t){for(const n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}function hl(e){return/^-?\d+(\.\d+)?$/.test(e)}function o_(e){return hl(e)?Number(e)<=Number.MAX_SAFE_INTEGER:!1}function a_(e){return Number(e)>Number.MAX_SAFE_INTEGER||e.length>=18}class Ei{constructor(){R(this,"_data",[])}static create(){return new Ei}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 Ci{constructor(){R(this,"_data",new Map)}static create(){return new Ci}add(t,n){this._data.has(t)||this._data.set(t,n)}delete(t){this._data.delete(t)}getData(){return this._data}}function l_(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 dl(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 fl(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 c_(e,t){return t.forEach(n=>e.add(n)),e}function u_(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?u_(e)?{dispose:()=>e.unsubscribe()}:typeof e=="function"?{dispose:()=>{t||(t=!0,e())}}:e:Ye(()=>{})}class ns{constructor(){R(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 Ge{constructor(){R(this,"_disposed",!1);R(this,"_collection",new ns)}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 h_ extends Ge{constructor(){super(...arguments);R(this,"dispose$",new se.Subject)}dispose(){super.dispose(),this.dispose$.next(),this.dispose$.complete()}}class d_ extends Ge{constructor(n){super();R(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||{}),Ri=(e=>(e[e.SomeCollaborator=0]="SomeCollaborator",e[e.AllCollaborator=1]="AllCollaborator",e[e.OneSelf=2]="OneSelf",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED",e))(Ri||{});class rs extends Ge{}const ml=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"]),f_=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 m_(e){if(!Number.isNaN(+e))return!1;if(e.startsWith("http://localhost:3002")||e.startsWith("localhost:3002"))return!0;if(f_.test(e)){if(gl(e))return!0;try{const r=new URL(_l(e)).hostname.split(".").pop();if(r&&ml.has(r))return!0}catch{return!1}}return!1}function gl(e){return/^[a-zA-Z]+:\/\//.test(e)}function g_(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e)}function _l(e){return gl(e)?e:g_(e)?`mailto://${e}`:`https://${e}`}function __(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 p_="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let E_=e=>crypto.getRandomValues(new Uint8Array(e)),C_=(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}}},R_=(e,t=21)=>C_(e,t|0,E_),I_=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=p_[n[e]&63];return t};const Xt=["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 Ii(e,t){const n=Q.getValueType(e),r=Q.getValueType(t);return n!==r?!1:Q.isArray(e)?S_(e,t):Q.isObject(e)?O_(e,t):Q.isDate(e)?e.getTime()===t.getTime():Q.isRegExp(e)?e.toString()===t.toString():e===t}function S_(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(!Ii(s,i))return!1}return!0}function O_(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(!Ii(i,o))return!1}return!0}class Q{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>=Xt.length;)r/=Xt.length,r-=1,n+=Xt[r%Xt.length];const s=t%Xt.length;return n+=Xt[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+=Xt.length**i+Xt.length*s}return n+=t.charCodeAt(t.length-1)-65,n}static deleteBlank(t){return Q.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(Q.isArray(l)){const d=(u=a[c])!=null?u:[];a[c]=d,r(l,d);return}if(Q.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(Q.isObject(c)){const d=(u=a[l])!=null?u:{};a[l]=d,s(c,d);return}if(Q.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(Q.isArray(l)){const h=(c=t[a])!=null?c:[];t[a]=h,r(l,h);return}if(Q.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 Ii(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]=Q.deepClone(r)}),n}if(this.isObject(t)){const n={};return Object.keys(t).forEach(r=>{const s=t[r];n[r]=Q.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 m_(t)}static normalizeUrl(t){return _l(t)}static topLevelDomainCombiningString(){return[...ml].join("|")}static removeNull(t){return this.isObject(t)&&Object.keys(t).forEach(n=>{const r=t[n];r==null?delete t[n]:Q.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?R_(t,e)():I_(e)}function ir(...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 v_=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null;function w_(e){const n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\\\*/g,".*").replace(/\\\?/g,".");return new RegExp(`^${n}$`,"i")}var pl=(e=>(e[e.DEFAULT_SERIES=0]="DEFAULT_SERIES",e[e.ALTERNATE_SERIES=1]="ALTERNATE_SERIES",e))(pl||{}),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||{}),El=(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))(El||{}),Cl=(e=>(e[e.UNSUPPORTED=0]="UNSUPPORTED",e[e.RGB=1]="RGB",e[e.HEX=2]="HEX",e[e.THEME=3]="THEME",e))(Cl||{}),Rl=(e=>(e[e.ON=0]="ON",e[e.OFF=1]="OFF",e))(Rl||{}),Il=(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))(Il||{}),Sl=(e=>(e[e.LEFT=0]="LEFT",e[e.RIGHT=1]="RIGHT",e))(Sl||{}),Ol=(e=>(e[e.DOCUMENT=0]="DOCUMENT",e[e.PROJECT=1]="PROJECT",e))(Ol||{}),vl=(e=>(e[e.COLUMNS=0]="COLUMNS",e[e.ROWS=1]="ROWS",e))(vl||{}),wl=(e=>(e[e.UP=0]="UP",e[e.RIGHT=1]="RIGHT",e[e.DOWN=2]="DOWN",e[e.LEFT=3]="LEFT",e))(wl||{});function b_(e){switch(e){case 3:return 1;case 1:return 3;case 0:return 2;case 2:return 0}}var bl=(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))(bl||{}),or=(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.SK_SK="skSK",e))(or||{}),ss=(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))(ss||{}),yl=(e=>(e[e.RANGE=0]="RANGE",e[e.SHEET=1]="SHEET",e))(yl||{}),Al=(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))(Al||{}),Tl=(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))(Tl||{}),Nl=(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))(Nl||{}),Ml=(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))(Ml||{}),Dl=(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))(Dl||{}),Ll=(e=>(e[e.GRID=0]="GRID",e[e.KANBAN=1]="KANBAN",e[e.GANTT=2]="GANTT",e))(Ll||{}),ar=(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))(ar||{}),Ul=(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))(Ul||{}),vt=(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))(vt||{}),un=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TOP=1]="TOP",e[e.MIDDLE=2]="MIDDLE",e[e.BOTTOM=3]="BOTTOM",e))(un||{}),hn=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.OVERFLOW=1]="OVERFLOW",e[e.CLIP=2]="CLIP",e[e.WRAP=3]="WRAP",e))(hn||{}),is=(e=>(e[e.NORMAL=0]="NORMAL",e[e.ITALIC=1]="ITALIC",e))(is||{}),os=(e=>(e[e.NORMAL=0]="NORMAL",e[e.BOLD=1]="BOLD",e))(os||{}),dn=(e=>(e[e.NORMAL=1]="NORMAL",e[e.SUBSCRIPT=2]="SUBSCRIPT",e[e.SUPERSCRIPT=3]="SUPERSCRIPT",e))(dn||{}),ce=(e=>(e[e.FALSE=0]="FALSE",e[e.TRUE=1]="TRUE",e))(ce||{}),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||{}),as=(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))(as||{}),Pl=(e=>(e[e.character=0]="character",e[e.paragraph=1]="paragraph",e[e.table=2]="table",e[e.numbering=3]="numbering",e))(Pl||{}),kl=(e=>(e[e.TAB=0]="TAB",e[e.SPACE=1]="SPACE",e[e.NOTHING=2]="NOTHING",e))(kl||{}),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||{}),lr=(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))(lr||{}),Jt=(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))(Jt||{}),fn=(e=>(e[e.COMMENT=0]="COMMENT",e[e.DELETED=9999]="DELETED",e))(fn||{}),Fl=(e=>(e[e.DRAWING=0]="DRAWING",e[e.CUSTOM=1]="CUSTOM",e))(Fl||{}),Si=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRADITIONAL=1]="TRADITIONAL",e[e.MODERN=2]="MODERN",e))(Si||{}),xl=(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))(xl||{}),Hl=(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))(Hl||{}),Bl=(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))(Bl||{}),$l=(e=>(e[e.NORMAL=0]="NORMAL",e[e.TBRL=1]="TBRL",e[e.LRTBV=2]="LRTBV",e))($l||{}),jl=(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))(jl||{}),Wl=(e=>(e[e.BOTH_SIDES=0]="BOTH_SIDES",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.LARGEST=3]="LARGEST",e))(Wl||{}),Yl=(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))(Yl||{}),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||{}),zl=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(zl||{}),Vl=(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))(Vl||{}),Kl=(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))(Kl||{}),Gl=(e=>(e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SPECIFIED=1]="SPECIFIED",e))(Gl||{}),Xl=(e=>(e[e.START=0]="START",e[e.CENTER=1]="CENTER",e[e.END=2]="END",e))(Xl||{}),ql=(e=>(e[e.AUTO_FIT=0]="AUTO_FIT",e[e.FIXED=1]="FIXED",e))(ql||{}),Jl=(e=>(e[e.NONE=0]="NONE",e[e.WRAP=1]="WRAP",e))(Jl||{}),Zl=(e=>(e[e.AUTO=0]="AUTO",e[e.AT_LEAST=1]="AT_LEAST",e[e.EXACT=2]="EXACT",e))(Zl||{}),Ql=(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))(Ql||{}),Nn=(e=>(e.NORMAL="normal",e.BOLD="bold",e.ITALIC="italic",e))(Nn||{}),ec=(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))(ec||{}),tc=(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))(tc||{}),nc=(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))(nc||{}),rc=(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))(rc||{}),sc=(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))(sc||{}),ic=(e=>(e[e.compressPunctuation=0]="compressPunctuation",e[e.compressPunctuationAndJapaneseKana=1]="compressPunctuationAndJapaneseKana",e[e.doNotCompress=2]="doNotCompress",e))(ic||{}),oc=(e=>(e[e.PORTRAIT=0]="PORTRAIT",e[e.LANDSCAPE=1]="LANDSCAPE",e))(oc||{}),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 y_=["A3","A4","A5","B4","B5","Letter","Tabloid","Legal","Statement","Executive","Folio"];var ac=(e=>(e[e.forward=0]="forward",e[e.backward=1]="backward",e[e.front=2]="front",e[e.back=3]="back",e))(ac||{}),lc=(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))(lc||{}),Oi=(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))(Oi||{}),cc=(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))(cc||{}),uc=(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))(uc||{});function A_(e=nt(6),t=or.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:Si.TRADITIONAL,marginTop:50,marginBottom:50,marginRight:50,marginLeft:50,renderConfig:{zeroWidthParagraphBreak:ce.FALSE,vertexAngle:0,centerAngle:0,background:{rgb:"#ccc"}},autoHyphenation:ce.TRUE,doNotHyphenateCaps:ce.FALSE,consecutiveHyphenLimit:2,defaultHeaderId:"",defaultFooterId:"",evenPageHeaderId:"",evenPageFooterId:"",firstPageHeaderId:"",firstPageFooterId:"",evenAndOddHeaders:ce.FALSE,useFirstPageHeaderFooter:ce.FALSE,marginHeader:30,marginFooter:30},settings:{}}}var mn={},cr={},ls={},hc;function T_(){if(hc)return ls;hc=1,Object.defineProperty(ls,"__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 ls.default=n,ls}var cs={},dc;function N_(){if(dc)return cs;dc=1,Object.defineProperty(cs,"__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 cs.default=e,cs}var vi={},fc;function mc(){return fc||(fc=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 C=0;for(let I=0;I<h.length;I++){const y=h[I];typeof y=="string"||typeof y=="number"?(C++,this.descend(y)):Array.isArray(y)?this.mergeTree(y,d):typeof y=="object"&&d(y,this)}for(;C--;)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 C(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 C.end=()=>{m&&u.ascend()},C}e.advancer=l;function c(u,h,d){let m,_,C,I;for(m=_=u&&u.descendFirst(),C=I=h&&h.descendFirst();m||C;){let y=m?u.getKey():null,H=C?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&&C&&(C=h.nextSibling())}_&&u.ascend(),I&&h.ascend()}e.eachChildOf=c})(vi)),vi}var wi={},gc;function _c(){return gc||(gc=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={}))})(wi)),wi}var wt={},gn={},pc;function bi(){return pc||(pc=1,Object.defineProperty(gn,"__esModule",{value:!0}),gn.uniToStrPos=gn.strPosToUni=void 0,gn.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},gn.uniToStrPos=(e,t)=>{let n=0;for(;t>0;t--){const r=e.charCodeAt(n);n+=r>=55296&&r<=57343?2:1}return n}),gn}var yi={},Ec;function Ai(){return Ec||(Ec=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.uniSlice=e.dlen=e.eachOp=void 0;const t=bi(),n=O=>{if(!Array.isArray(O))throw Error("Op must be an array of components");let E=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 E=="number")throw Error("Adjacent skip components should be combined");break}E=T}if(typeof E=="number")throw Error("Op has a trailing skip")};function r(O,E){let b=0,T=0;for(let B=0;B<O.length;B++){const $=O[B];switch(E($,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,E){const b=[],T=a(b);return r(O,(B,$,g)=>{T(E(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=>E=>{if(!(!E||E.d===0||E.d===""))if(O.length===0)O.push(E);else if(typeof E==typeof O[O.length-1])if(typeof E=="object"){const b=O[O.length-1];b.d=typeof b.d=="string"&&typeof E.d=="string"?b.d+E.d:e.dlen(b.d)+e.dlen(E.d)}else O[O.length-1]+=E;else O.push(E)},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,E,b)=>{const T=t.uniToStrPos(O,E),B=b==null?1/0:t.uniToStrPos(O,b);return O.slice(T,B)};const c=(O,E,b)=>typeof O=="number"?b==null?O-E:Math.min(O,b)-E:e.uniSlice(O,E,b),u=O=>{let E=0,b=0;return{take:($,g)=>{if(E===O.length)return $===-1?null:$;const P=O[E];let v;if(typeof P=="number")return $===-1||P-b<=$?(v=P-b,++E,b=0,v):(b+=$,$);if(typeof P=="string"){if($===-1||g==="i"||t.strPosToUni(P.slice(b))<=$)return v=P.slice(b),++E,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)},++E,b=0,v;{let M=c(P.d,b,b+$);return b+=$,{d:M}}}},peek:()=>O[E]}},h=O=>(O.length>0&&typeof O[O.length-1]=="number"&&O.pop(),O);function d(O,E,b){if(b!=="left"&&b!=="right")throw Error("side ("+b+") must be 'left' or 'right'");n(O),n(E);const T=[],B=a(T),{take:$,peek:g}=u(O);for(let v=0;v<E.length;v++){const M=E[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,E){n(O),n(E);const b=[],T=a(b),{take:B}=u(O);for(let g=0;g<E.length;g++){const P=E[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,E)=>{let b=0;for(let T=0;T<E.length&&O>b;T++){const B=E[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},C=(O,E)=>typeof O=="number"?_(O,E):O.map(b=>_(b,E));function I(O,E,b){return s(O,(T,B)=>typeof T=="object"&&typeof T.d=="number"?{d:b.slice(E,B,B+T.d)}:T)}function y(O){return s(O,E=>{switch(typeof E){case"object":if(typeof E.d=="number")throw Error("Cannot invert text op: Deleted characters missing from operation. makeInvertible must be called first.");return E.d;case"string":return{d:E};case"number":return E}})}function H(O){return s(O,E=>typeof E=="object"&&typeof E.d=="string"?{d:t.strPosToUni(E.d)}:E)}function x(O){let E=!0;return r(O,b=>{typeof b=="object"&&typeof b.d=="number"&&(E=!1)}),E}function Y(O){return{name:"text-unicode",uri:"http://sharejs.org/types/text-unicode",trim:h,normalize:o,checkOp:n,create(E=""){if(typeof E!="string")throw Error("Initial data must be a string");return O.create(E)},apply(E,b){n(b);const T=O.builder(E);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:C,isInvertible:x,makeInvertible(E,b){return I(E,b,O)},stripInvertible:H,invert:y,invertWithDoc(E,b){return y(I(E,b,O))},isNoop:E=>E.length===0}}e.default=Y})(yi)),yi}var us={},Cc;function M_(){if(Cc)return us;Cc=1,Object.defineProperty(us,"__esModule",{value:!0});const e=Ai(),t=bi();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 us.default=n,n.provides={text:!0},us}var Rc;function D_(){return Rc||(Rc=1,(function(e){var t=wt&&wt.__createBinding||(Object.create?(function(d,m,_,C){C===void 0&&(C=_),Object.defineProperty(d,C,{enumerable:!0,get:function(){return m[_]}})}):(function(d,m,_,C){C===void 0&&(C=_),d[C]=m[_]})),n=wt&&wt.__setModuleDefault||(Object.create?(function(d,m){Object.defineProperty(d,"default",{enumerable:!0,value:m})}):function(d,m){d.default=m}),r=wt&&wt.__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=wt&&wt.__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=bi(),o=r(Ai()),a=s(M_()),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 C=i.uniToStrPos(d,_);if(C>d.length)throw Error("The op is too long for this document");m.push(d.slice(0,C)),d=d.slice(C)},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=Ai();Object.defineProperty(e,"makeType",{enumerable:!0,get:function(){return h.default}})})(wt)),wt}var Ic;function L_(){return Ic||(Ic=1,(function(e){var t=cr&&cr.__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(T_()),r=t(N_()),s=mc(),i=_c();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:Z,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,z)=>ue(()=>!0,S,U,z),typeAllowingConflictsPred:S=>Object.assign(Object.assign({},e.type),{transform:(U,z,V)=>ue(S,U,z,V)})};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,z){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,z)):(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]=z),z}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,z)=>s.writeCursor().at(S,V=>{V.write("r",U),V.write("i",z)}).get(),e.editOp=(S,U,z,V=!1)=>s.writeCursor().at(S,j=>E(j,U,z,V)).get();const _=(S,U)=>S!=null&&(typeof U=="number"?Array.isArray(S):typeof S=="object"),C=(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(D_());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,E=(S,U,z,V=!1)=>{const[j,W]=typeof U=="string"?[H(U),U]:[U,U.name];!V&&j.isNoop&&j.isNoop(z)||(W==="number"?S.write("ena",z):W==="text-unicode"?S.write("es",z):(S.write("et",W),S.write("e",z)))};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,z=new Set,V=W=>{let ee=!0,te=!1;for(let k in W){const G=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(G),o(!U.has(G)),U.add(G),o(W.r===void 0);else if(k==="d")b(G),o(!z.has(G)),z.add(G),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,G=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(G){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,G++,k=3}else typeof ge=="object"?(o(k===1,`Prev not scalar - instead ${k}`),V(ge),k=2):(o(k!==3),T(ge),o(s.isValidPathItem(ge),"Invalid path key"),k=1)}return o(G!==1,"Operation makes multiple descents. Remove some []"),o(k===2||k===3),W[0]};j(S,!0),o(U.size===z.size,"Mismatched picks and drops in op");for(let W=0;W<U.size;W++)o(U.has(W)),o(z.has(W))}function $(S){let U=0,z=[];const V=s.writeCursor();return V.mergeTree(S,(j,W)=>{const ee=Y(j);if(ee){const k=O(j);E(W,ee,ee.normalize?ee.normalize(k):k)}for(const k of["r","p","i","d"])if(j[k]!==void 0){const G=k==="p"||k==="d"?(te=j[k],z[te]==null&&(z[te]=U++),z[te]):j[k];W.write(k,G)}var te}),V.get()}function g(S,U){if(B(U),U===null)return S;const z=[];return(function V(j,W){let ee=j,te=0,k={root:j},G=0,q=k,re="root";function ge(){for(;G<te;G++){let Ee=W[G];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=V(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,z[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=C(ee,Ee)}return k.root})(S=(function V(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=C(j,re))}for(let re=W.length-1;re>=te;re--)j=V(j,W[re]);for(--te;te>=0;te--){const re=W[te];if(typeof re!="object"){const ge=ee.pop();j=j===C(ge,re)?ge:j===void 0?d(ge,re):(G=re,q=j,(k=c(k=ge))[G]=q,k)}else u(re)&&(o(j!==void 0,"Cannot pick up or remove undefined"),re.p!=null&&(z[re.p]=j),j=void 0)}var k,G,q;return j})(S,U),U)}function P(S,U){S=S.slice(),B(U);const z=s.readCursor(U);let V,j,W=!1;const ee=[];for(let k=0;;k++){const G=S[k],q=z.getComponent();if(q&&(q.r!==void 0?W=!0:q.p!=null&&(W=!1,V=q.p,j=k)),k>=S.length)break;let re=0;const ge=s.advancer(z,void 0,(X,de)=>{u(de)&&re++});ee.unshift(ge);const Ee=ge(G);if(typeof G=="number"&&(S[k]-=re),!Ee)break}if(ee.forEach(k=>k.end()),W)return null;const te=()=>{let k=0;if(V!=null){const G=z.getPath();k=G.length,S=G.concat(S.slice(j))}for(;k<S.length;k++){const G=S[k],q=a(z),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(z,(X,de)=>h(de)?~(X-ge):X-ge,(X,de)=>{h(de)&&ge++})(G);if(typeof G=="number"&&(S[k]+=ge),!Ee)break}};return V!=null?z.eachDrop(null,k=>{k===V&&te()}):te(),S}function v(S,U){if(B(S),B(U),S==null)return U;if(U==null)return S;let z=0;const V=s.readCursor(S),j=s.readCursor(U),W=s.writeCursor(),ee=[],te=[],k=[],G=[],q=[],re=[],ge=new Set;V.traverse(null,X=>{X.p!=null&&(k[X.p]=V.clone())}),j.traverse(null,X=>{X.d!=null&&(G[X.d]=j.clone())});const Ee=s.writeCursor();return(function X(de,xe,Le,ve,$e,Yt,st,et){o(xe||Le);const je=a(xe),St=a(Le),At=!!St&&St.r!==void 0,In=!!je&&je.i!==void 0,Ot=je?je.d:null,pt=St?St.p:null,zt=(Yt||At)&&pt==null;if(pt!=null)ve=G[pt],st=te[pt]=new s.WriteCursor;else if(St&&St.r!==void 0)ve=null;else{const oe=a(ve);oe&&oe.d!=null&&(ve=null)}const Te=a(ve);if(Ot!=null)if(de=k[Ot],et=ee[Ot]=new s.WriteCursor,zt)Yt&&!At&&et.write("r",!0);else{const oe=q[Ot]=z++;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 le;In?(o($e===void 0),le=je.i):le=$e;const Ie=(pt==null?!In||Yt||At:le===void 0)?null:st.getComponent();if(pt!=null){if(!($e!==void 0||In)){const oe=Ot!=null?q[Ot]:z++;re[pt]=oe,et.write("p",oe)}}else At&&(In||$e!==void 0||(St.r,et.write("r",St.r)));const he=zt?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);E(st,he,qe),ge.add(Te)}else he?E(st,he,O(je)):ie&&(E(st,ie,O(Te)),ge.add(Te));const me=typeof le=="object"&&le!=null;let Ae=!1,ye=0,Ne=0,Xe=0,Ke=0,We=0;const rt=s.advancer(ve,(oe,Oe)=>h(Oe)?Ke-oe-1:oe-Ke,(oe,Oe)=>{h(Oe)&&Ke++}),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,Vt,Sn=oe,Tt=oe,zr=oe;if(typeof oe=="number"){let tt=oe+Xe;Vt=rt(tt),Tt=tt+Ke;let ze=oe+Ne;ot=be(ze),h(a(Vt))&&(ot=null),Sn=ze+ye,zr=oe+We,o(Sn>=0,"p1PickKey is negative"),o(Tt>=0,"p2DropKey is negative");const Nt=h(a(Oe)),Kt=u(a(qe));(Nt||Kt&&!zt)&&We--,Nt&&Ne--,Kt&&Xe--}else ot=be(oe),Vt=rt(oe);et.descend(Sn),st.descend(Tt);const Zn=me&&!h(a(Oe))?le[zr]:void 0,Ft=X(ot,Oe,qe,Vt,Zn,zt,st,et);var xt,_e,Be;me&&!zt?Zn!==Ft&&(Ae||(le=Array.isArray(le)?le.slice():Object.assign({},le),Ae=!0),xt=le,Be=Ft,typeof(_e=zr)=="number"?(o(Array.isArray(xt)),o(_e<xt.length)):(o(!Array.isArray(xt)),o(xt[_e]!==void 0)),Be===void 0?typeof _e=="number"?xt.splice(_e,1):delete xt[_e]:xt[_e]=Be):o(Ft===void 0),st.ascend(),et.ascend()}),be.end(),rt.end(),Ie!=null)Ie.i=le;else if(!Yt&&!At&&pt==null)return le})(V,V.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()),V.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)&&E(de,Le,O(X))}),W.get()}function M(S){if(S==null)return null;const U=new s.ReadCursor(S),z=new s.WriteCursor;let V;const j=[],W=[];return(function ee(te,k,G){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),G=void 0),q.i!==void 0&&(G=re=q.i);const X=Y(q);X&&(G===void 0?(V||(V=new Set),V.add(q)):(O(q),G=X.apply(G,O(q)),ge=!0))}let Ee=0;for(const X of te){k.descend(X);const de=typeof X=="number"?X-Ee:X,xe=C(G,de);h(te.getComponent())&&Ee++;const Le=ee(te,k,xe);if(G!==void 0&&Le!==void 0){if(ge||(ge=!0,G=c(G)),!_(G,de))throw Error("Cannot modify child - invalid operation");G[de]=Le}k.ascend()}if(re===void 0)return ge?G:void 0;k.write("r",G)})(U,z,void 0),V&&(z.reset(),(function ee(te,k,G){const q=k.getComponent();if(q){const X=q.d;if(X!=null&&(te=j[X],G=W[X]=s.writeCursor()),V.has(q)){const de=Y(q);if(!de.invert)throw Error(`Cannot invert subtype ${de.name}`);E(G,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;G.descend(Le),ee(xe,k,G),h(k.getComponent())&&ge++,G.ascend()}else G.descend(X),ee(Ee(X),k,G),G.ascend();Ee.end()})(U.clone(),U,z),W.length&&(z.reset(),U.traverse(z,(ee,te)=>{const k=ee.p;if(k!=null){const G=W[k];G&&G.get(),G&&te.mergeTree(G.get())}}))),z.get()}const A=(S,U)=>S.some(z=>typeof z=="object"&&(Array.isArray(z)?A(z,U):U(z)));function w(S,U){if(S==null||!A(S,k=>{var G;return k.r!==void 0||((G=Y(k))===null||G===void 0?void 0:G.makeInvertible)!=null}))return S;const z=new s.ReadCursor(S),V=new s.WriteCursor;let j=!1;const W=[],ee=[],te=(k,G,q)=>{const re=k.getComponent();let ge=!1;if(re){re.d!=null&&G.write("d",re.d),re.i!==void 0&&G.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,G.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:E(G,de,O(re),!0))}let Ee=0;for(const X of k){G.descend(X);const de=typeof X=="number"?X-Ee:X,xe=C(q,de),Le=te(k,G,xe);xe!==Le&&(ge||(ge=!0,q=c(q)),Le===void 0?(q=d(q,de),typeof X=="number"&&Ee++):q[de]=Le),G.ascend()}return re&&(re.r!==void 0?(G.write("r",r.default(q)),q=void 0):re.p!=null&&(q=void 0)),q};return te(z,V,U),V.get(),j&&(V.reset(),(function k(G,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],G=W[X.d],Ee=!1,X.d);let ve=Y(X);if(ve&&ve.makeInvertible){const $e=O(X);E(re,ve,ve.makeInvertible($e,ge),!0)}}let de=0,xe=0;const Le=s.advancer(G,(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,Yt=Le($e),st=$e+de,et=C(ge,Ee?$e:st);re.descend(ve),k(Yt,q,re,et,Ee),h(q.getComponent())&&xe++,re.ascend()}else{const $e=C(ge,ve);re.descend(ve),k(Le(ve),q,re,$e,Ee),re.ascend()}Le.end()})(z.clone(),z,V,U,!1)),V.get()}function N(S,U){return M(w(S,U))}const D=S=>{if(S==null)return null;const U=S.slice();for(let z=0;z<S.length;z++){const V=U[z];Array.isArray(V)&&(U[z]=D(V))}return U};function L(S,U,z){o(z==="left"||z==="right","Direction must be left or right");const V=z==="left"?0:1;if(U==null)return{ok:!0,result:S};B(S),B(U);let j=null;const W=[],ee=[],te=[],k=[],G=[],q=[],re=[],ge=[],Ee=[],X=[],de=[],xe=[],Le=[],ve=[],$e=[];let Yt=0;const st=s.readCursor(S),et=s.readCursor(U),je=s.writeCursor();if((function Te(le,Ie=null,he){const ie=a(Ie);ie&&(ie.r!==void 0?he=Ie.clone():ie.p!=null&&(he=null,q[ie.p]=le.clone()));const me=le.getComponent();let Ae;me&&(Ae=me.p)!=null&&(G[Ae]=Ie?Ie.clone():null,te[Ae]=le.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 le)Te(le,ye(Ne),he);ye.end()})(et,st,null),(function Te(le,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],le=G[ye]||null,Ie=te[ye]||null,X[ye]?(me&&(de[ye]=!0),me=Ee[ye]||null):!me||V!==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&&(le=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(le);Xe&&(Xe.r!==void 0?me=le.clone():Xe.p!=null&&(Xe.p,ie=Xe.p,me=null));const Ke=Y(Ae);Ke&&me&&j==null&&(j={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(me.getPath()),op2:e.editOp(he.getPath(),Ke,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(le);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 St=[];let At=null;(function Te(le,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=le.getComponent();if(Ne){const be=Ne.p;be!=null?(me&&(ge[be]=me),St[be]=me||V===1&&Ae?null:ie.getComponent(),W[be]=le.clone(),he&&(re[be]=he.clone())):Ne.r!==void 0&&(me||ie.write("r",!0),(me||Ae)&&(At==null&&(At=new Set),At.add(Ne)))}let Xe=0,Ke=0;const We=s.advancer(Ie,void 0,(be,oe)=>{u(oe)&&Xe++}),rt=s.advancer(he,(be,oe)=>h(oe)?~(be-Ke):be-Ke,(be,oe)=>{h(oe)&&Ke++});if(le)for(const be of le)if(typeof be=="string"){const oe=We(be),Oe=rt(be);ie.descend(be),Te(le,oe,Oe,ie,me),ie.ascend()}else{const oe=We(be),Oe=be-Xe,qe=u(a(oe))?null:rt(Oe),ot=Oe+Ke;o(ot>=0),ie.descend(ot),Te(le,oe,qe,ie,me),ie.ascend()}We.end(),rt.end()})(st,et,et.clone(),je,null),je.reset();let In=[];if((function Te(le,Ie,he,ie,me,Ae){o(Ie);const ye=Ie.getComponent();let Ne=a(ie),Xe=!1;const Ke=(_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?St[_e]:null;let tt=!1;if(ye.i!==void 0||_e!=null&&Be){let ze;Ne&&(Ne.i!==void 0||(ze=Ne.d)!=null&&!X[ze])&&(tt=ze!=null?_e!=null&&_e===ve[ze]:n.default(Ne.i,ye.i),tt||ze!=null&&V!==1&&ve[ze]!=null||j==null&&(j={type:i.ConflictType.DROP_COLLISION,op1:Ke(_e!=null?W[_e]:null,Ie,ye),op2:Ke(ze!=null?te[ze]:null,ie,Ne)})),tt||(Ae?j==null&&(j={type:i.ConflictType.RM_UNEXPECTED_CONTENT,op1:Ke(_e!=null?W[_e]:null,Ie,ye),op2:e.removeOp(Ae.getPath())}):(_e!=null?(In[Yt]=_e,me.write("d",Be.p=Yt++)):me.write("i",r.default(ye.i)),Xe=!0))}else if(_e!=null&&!Be){const ze=ge[_e];ze&&(Ae=ze.clone())}_e!=null?(le=W[_e],he=q[_e],ie=re[_e]):ye.i!==void 0&&(le=he=null,tt||(ie=null))}else u(a(le))&&(le=he=ie=null);const We=a(le),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],V!==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 ze=O(Ne);tt=be.transform(_e,ze,z)}else tt=r.default(_e);E(me,be,tt)}}let oe=0,Oe=0,qe=0,ot=0,Vt=0,Sn=0,Tt=le!=null&&le.descendFirst(),zr=Tt;const Zn=s.advancer(he,void 0,(_e,Be)=>{u(Be)&&qe++});let Ft=ie!=null&&ie.descendFirst(),xt=Ft;for(const _e of Ie)if(typeof _e=="number"){let Be;const tt=h(Ie.getComponent()),ze=_e-Oe;{let sn;for(;Tt&&typeof(sn=le.getKey())=="number";){sn+=oe;const Mt=le.getComponent(),Qn=u(Mt);if(sn>ze||sn===ze&&(!Qn||V===0&&tt))break;if(Qn){oe--;const On=Mt.p;ve.includes(On),Mt.d,a(Le[Mt.d]),u(a(Le[Mt.d])),(Mt.r===void 0||At&&At.has(Mt))&&(On==null||!St[On]||V!==1&&ve.includes(On))||Vt--}Tt=le.nextSibling()}Be=Tt&&sn===ze?le:null}const Nt=ze-oe;let Kt=Zn(Nt);const fa=Nt-qe;let Zs=null;{let sn,Mt;for(;Ft&&typeof(sn=ie.getKey())=="number";){Mt=sn-ot;const Qn=ie.getComponent(),On=h(Qn);if(Mt>fa)break;if(Mt===fa){if(!On){Zs=ie;break}{if(V===0&&tt){Zs=ie;break}const on=Kt&&u(Kt.getComponent());if(V===0&&on)break}}if(On){const on=Qn.d;X[on],ve[on],Qn.i===void 0&&(X[on]||ve[on]!=null&&V!==1)?(X[on]||ve[on]!=null&&V===0)&&(ot++,Sn--):ot++}Ft=ie.nextSibling()}}const vd=fa+ot+Vt+Sn;o(vd>=0,"trying to descend to a negative index"),me.descend(vd),tt&&(Be=Kt=Zs=null,Oe++),Te(Be,Ie,Kt,Zs,me,Ae)&&Sn++,me.ascend()}else{let Be;for(;Tt&&(Be=le.getKey(),typeof Be!="string"||!(Be>_e||Be===_e));)Tt=le.nextSibling();const tt=Tt&&Be===_e?le:null,ze=Zn(_e);let Nt;for(;Ft&&(Nt=ie.getKey(),typeof Nt!="string"||!(Nt>_e||Nt===_e));)Ft=ie.nextSibling();const Kt=Ft&&Nt===_e?ie:null;me.descend(_e),Te(tt,Ie,ze,Kt,me,Ae),me.ascend()}return Zn.end(),zr&&le.ascend(),xt&&ie.ascend(),Xe})(st,st.clone(),et,et.clone(),je,null),j)return{ok:!1,conflict:j};je.reset();const Ot=(Te,le,Ie)=>Te.traverse(le,(he,ie)=>{he.d!=null&&Ie(he.d,Te,ie)});(X.length||xe.length)&&(Ot(et,je,(Te,le,Ie)=>{X[Te]&&!de[Te]&&Ie.write("r",!0),xe[Te]&&Ie.mergeTree(xe[Te].get())}),je.reset());const pt=[],zt=[];if((Le.length||X.length)&&!j){const Te=s.readCursor(D(je.get()));if(Ot(Te,null,(le,Ie)=>{pt[le]=Ie.clone()}),Le.forEach(le=>{le&&Ot(s.readCursor(le.get()),null,(Ie,he)=>{pt[Ie]=he.clone()})}),(function le(Ie,he,ie,me,Ae,ye){const Ne=a(he);if(Ne&&u(Ne))if(Ne.p!=null){const oe=Ne.p;pt[oe].getPath(),ie=pt[oe],me=zt[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 Ke=0,We=0;const rt=s.advancer(he,void 0,(oe,Oe)=>{u(Oe)&&Ke--}),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+Ke,ot=be(qe),Vt=qe+We;me.descend(Vt),le(Ie,Oe,ot,me),me.ascend()}else me.descend(oe),le(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(),zt.length){const le=zt.map(he=>he?he.get():null),Ie=s.readCursor(D(je.get()));if(Ot(Ie,je,(he,ie,me)=>{const Ae=le[he];Ae&&(me.mergeTree(Ae),le[he]=null)}),le.find(he=>he)){const he=s.writeCursor(),ie=s.writeCursor();let me=0,Ae=0;le.forEach(ye=>{ye!=null&&Ot(s.readCursor(ye),null,Ne=>{const Xe=In[Ne];he.writeMove(W[Xe].getPath(),ee[Xe].getPath(),me++);const Ke=$e[Xe];Ke&&Ke.forEach(We=>{X[We]||V!==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 Z(S,U,z){const V=L(S,U,z);if(V.ok)return V.result;F(V.conflict)}const K=S=>{const U=s.writeCursor();return s.readCursor(S).traverse(U,(z,V)=>{(h(z)||Y(z))&&V.write("r",!0)}),U.get()},ae=(S,U)=>{const{type:z,op1:V,op2:j}=S;switch(z){case i.ConflictType.DROP_COLLISION:return U==="left"?[null,K(j)]:[K(V),null];case i.ConflictType.RM_UNEXPECTED_CONTENT:let W=!1;return s.readCursor(V).traverse(null,ee=>{ee.r!==void 0&&(W=!0)}),W?[null,K(j)]:[K(V),null];case i.ConflictType.BLACKHOLE:return[K(V),K(j)];default:throw Error("Unrecognised conflict: "+z)}};function ue(S,U,z,V){let j=null;for(;;){const W=L(U,z,V);if(W.ok)return v(j,W.result);{const{conflict:ee}=W;S(ee)||F(ee);const[te,k]=ae(ee,V);U=v($(U),te),z=v($(z),k),j=v(j,k)}}}})(cr)),cr}var Sc;function U_(){return Sc||(Sc=1,(function(e){var t=mn&&mn.__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=mn&&mn.__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(L_(),e);var r=mc();Object.defineProperty(e,"ReadCursor",{enumerable:!0,get:function(){return r.ReadCursor}}),Object.defineProperty(e,"WriteCursor",{enumerable:!0,get:function(){return r.WriteCursor}});var s=_c();Object.defineProperty(e,"ConflictType",{enumerable:!0,get:function(){return s.ConflictType}})})(mn)),mn}var lt=U_();const P_=wd({__proto__:null,default:Et(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 ur=Ce.createIdentifier("univer.config-service");class Oc{constructor(){R(this,"_configChanged$",new se.Subject);R(this,"configChanged$",this._configChanged$.asObservable());R(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=ts(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 Mn=Ce.createIdentifier("univer.context-service");class vc extends Ge{constructor(){super(...arguments);R(this,"_contextChanged$",new se.Subject);R(this,"contextChanged$",this._contextChanged$.asObservable());R(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 wc=(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))(wc||{});const dt=Ce.createIdentifier("univer.log");class bc extends Ge{constructor(){super(...arguments);R(this,"_logLevel",3);R(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=k_(...r);this._deduction.has(s)||(this._deduction.add(s),this._log(n,...r))}}function k_(...e){return e.map(t=>JSON.stringify(t)).join("")}var F_=Object.getOwnPropertyDescriptor,x_=(e,t,n,r)=>{for(var s=r>1?void 0:r?F_(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},Ti=(e,t)=>(n,r)=>t(n,r,e);const hs="command.logExecution";var hr=(e=>(e[e.COMMAND=0]="COMMAND",e[e.OPERATION=1]="OPERATION",e[e.MUTATION=2]="MUTATION",e))(hr||{});const dr=Ce.createIdentifier("univer.core.command-service");class H_{constructor(){R(this,"_commands",new Map);R(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 yc={id:"nil",type:0,handler:()=>!0};f.CommandService=class extends Ge{constructor(n,r,s){super();R(this,"_commandRegistry");R(this,"_beforeCommandExecutionListeners",[]);R(this,"_commandExecutedListeners",[]);R(this,"_collabMutationListeners",[]);R(this,"_multiCommandDisposables",new Map);R(this,"_commandExecutingLevel",0);R(this,"_commandExecutionStack",[]);this._injector=n,this._logService=r,this._configService=s,this._commandRegistry=new H_,this.registerCommand(yc)}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 Gr)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=Dd(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 Gr)return!1;throw o}}_pushCommandExecutionStack(n){return this._commandExecutionStack.push(n),Ye(()=>er(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 B_(n.id);const o=new ns;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(hs)!==!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(hs)!==!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=x_([Ti(0,Ce.Inject(Ce.Injector)),Ti(1,dt),Ti(2,ur)],f.CommandService);class B_{constructor(t){R(this,"name");R(this,"multi",!0);R(this,"type",0);R(this,"priority",0);R(this,"_implementations",[]);R(this,"handler",async(t,n)=>{if(!this._implementations.length)return!1;const r=t.get(dt),s=t.get(Mn),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 ds(e,t,n){const r=e.map(s=>()=>t.syncExecuteCommand(s.id,s.params,n));return fl(r)}function $_(e,t,n){const r=e.map(s=>()=>t.executeCommand(s.id,s.params,n));return dl(r)}function Ac(e){return new se.Observable(t=>{const n=e((...r)=>t.next(r));return()=>n==null?void 0:n.dispose()})}function Ni(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 j_(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 W_(e){const t=new se.ReplaySubject(1);return setTimeout(()=>t.next(),e),t.pipe(se.take(1))}function Y_(e,t){const n=new se.BehaviorSubject(t);return e.subscribe(n),n}const z_=e=>new Promise(t=>{se.merge(Ac(e.onCommandExecuted.bind(e)).pipe(Vr.filter(([n])=>n.type===hr.MUTATION)),se.timer(300)).pipe(Vr.debounceTime(16),Vr.first()).subscribe(()=>{t()})});function Tc(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 V_(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 Nc(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 fr(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=Tc(e,t):r=Nc(e,t),n){const s=e[r];return e.indexOf(s)}return r}function K_(e){const t=new Blob([e],{type:"text/javascript"});return window.URL.createObjectURL(t)}const mr=2,Mc=1;function G_(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,C=s;return Math.abs(a-n)>mr||Math.abs(l-r)>mr||Math.abs(d-_)>mr||Math.abs(m-C)>mr||Math.abs(h-o)>Mc}const X_="rgb(",q_="rgba(",Mi={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 ft{constructor(t){R(this,"_color");R(this,"_rgbColor");R(this,"_isValid",!1);if(t==null){this._setNullColor();return}if(t instanceof ft){this._color={...t._color},this._rgbColor={...t._rgbColor};return}const n=Dc(t);if(n==null){this._setNullColor();return}this._color=n;const r=tp(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 ft(t).toRgb(),i=new ft(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 ft(l)}static getContrastRatio(t,n){const r=new ft(t).getLuminance(),s=new ft(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=[fs(Math.round(n).toString(16)),fs(Math.round(r).toString(16)),fs(Math.round(s).toString(16)),fs(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 ip(this.toRgb())}toHsl(){return sp(this.toRgb())}lighten(t=10){const n=this.toHsl();return n.l+=t,n.l=Math.min(Math.max(n.l,0),100),new ft(n)}darken(t=10){const n=this.toHsl();return n.l-=t,n.l=Math.min(Math.max(n.l,0),100),new ft(n)}setAlpha(t){return new ft({...this._rgbColor,a:t})}getLuminance(){let{r:t,g:n,b:r}=this.toRgb();return t=Di(t),n=Di(n),r=Di(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 fs=e=>e.length===1?`0${e}`:e,Di=e=>(e/=255,e<=.03928?e/12.92:((e+.055)/1.055)**2.4),Dc=e=>{if(ap(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(Mi[t]){const n=Mi[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 J_(t);if(t.startsWith("rgb"))return Z_(t);if(t.startsWith("hsl"))return Q_(t);if(t.startsWith("hsv"))return ep(t)},J_=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},Z_=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},Q_=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},ep=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},tp=e=>{const t=Dc(e);if(t!=null)return"r"in t?t:"l"in t?np(t):rp(t)},Li=(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),np=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=Li(c,l,t+1/3),i=Li(c,l,t),o=Li(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},rp=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},sp=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},ip=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},op=e=>e==null,ap=e=>!op(e)&&typeof e=="object";function lp(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 cp(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 Lc(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 up(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 hp(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 Uc(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 dp(e){return[e.startRow,e.startColumn,e.endRow,e.endColumn]}var Pc=(e=>(e.NONE="none",e.BACKWARD="backward",e.FORWARD="forward",e))(Pc||{}),kc=(e=>(e.RECT="RECT",e.TEXT="TEXT",e))(kc||{});function fp(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 Dn=(e=>(e.Raw="raw",e.Intercepted="intercepted",e.Both="both",e))(Dn||{});const Fc={[as.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"}},gr=2,_r=2**2,ms=2**3,pr=2**4,Er=2**5,Cr=2**6,Ui=2**7,Pi=2**8,ki=2**9,mp=0,gp=2958466,_p=-694324,pp=35830291,Ep=-1,xc=1,Ln=6,Fi="general",xi="hash",Un="zero",Hi="qmark",Bi="slash",Rr="group",gs="scale",$i="comma",ji="break",_s="text",Wi="plus",Yi="minus",ps="point",zi="space",Vi="percent",Es="digit",Ki="calendar",Ir="error",Gi="datetime",Xi="duration",qi="condition",Ji="dbnum",Zi="natnum",Qi="locale",eo="color",Hc="modifier",to="ampm",no="escaped",ro="string",so="skip",io="exp",oo="fill",ao="paren",Cs="char",Cp=["#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"],lo=["¤","$","£","¥","֏","؋","৳","฿","៛","₡","₦","₩","₪","₫","€","₭","₮","₱","₲","₴","₸","₹","₺","₼","₽","₾","₿"],co=new RegExp("["+lo.join("")+"]"),uo=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"}),Bc=/^([a-z\d]+)(?:[_-]([a-z\d]+))?(?:\.([a-z\d]+))?(?:@([a-z\d]+))?$/i,Pn={},p=(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),Rp={group:" ",decimal:".",positive:"+",negative:"-",percent:"%",exponent:"E",nan:"NaN",infinity:"∞",ampm:p("AM;PM"),mmmm6:p("Muharram;Safar;Rabiʻ I;Rabiʻ II;Jumada I;Jumada II;Rajab;Shaʻban;Ramadan;Shawwal;Dhuʻl-Qiʻdah;Dhuʻl-Hijjah"),mmm6:p("Muh.;Saf.;Rab. I;Rab. II;Jum. I;Jum. II;Raj.;Sha.;Ram.;Shaw.;Dhuʻl-Q.;Dhuʻl-H."),mmmm:p("January;February;March;April;May;June;July;August;September;October;November;December"),mmm:p("Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec"),dddd:p("Sunday;Monday;Tuesday;Wednesday;Thursday;Friday;Saturday"),ddd:p("Sun;Mon;Tue;Wed;Thu;Fri;Sat"),bool:p("TRUE;FALSE"),preferMDY:!1};function ho(e){const t=Bc.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 fo(e){if(typeof e=="number")return uo[e&65535]||null;const t=parseInt(e,16);return isFinite(t)&&uo[t&65535]?uo[t&65535]||null:Bc.test(e)?e:null}function kn(e){const t=fo(e);let n=null;if(t){const r=ho(t);n=Pn[r.lang]||Pn[r.language]||null}return n}function mo(e){return Object.assign({},Rp,e)}function ne(e,t){const n=typeof t=="object"?t:ho(t);return Pn[n.lang]=mo(e),n.language!==n.lang&&!Pn[n.language]&&(Pn[n.language]=mo(e)),Pn[n.lang]}const Zt=mo({group:",",preferMDY:!0});Zt.isDefault=!0,ne({group:",",ampm:p("上午;下午"),mmmm:p("一月;二月;三月;四月;五月;六月;七月;八月;九月;十月;十一月;十二月"),mmm:p("1月;2月;3月;4月;5月;6月;7月;8月;9月;10月;11月;12月"),dddd:p("~日;~一;~二;~三;~四;~五;~六","星期"),ddd:p("周日;周一;周二;周三;周四;周五;周六")},"zh_CN");const go={group:",",ampm:p("上午;下午"),mmmm:p("1月;2月;3月;4月;5月;6月;7月;8月;9月;10月;11月;12月"),mmm:p("1月;2月;3月;4月;5月;6月;7月;8月;9月;10月;11月;12月"),dddd:p("~日;~一;~二;~三;~四;~五;~六","星期"),ddd:p("周日;周一;周二;周三;周四;周五;周六")};ne({...go,nan:"非數值",dddd:p("~日;~一;~二;~三;~四;~五;~六","星期")},"zh_TW"),ne({...go,dddd:p("~日;~一;~二;~三;~四;~五;~六","星期")},"zh_HK"),ne({...go,ampm:p("午前;午後"),dddd:p("日~;月~;火~;水~;木~;金~;土~","曜日"),ddd:p("日;月;火;水;木;金;土")},"ja"),ne({group:",",ampm:p("오전;오후"),mmmm:p("1월;2월;3월;4월;5월;6월;7월;8월;9월;10월;11월;12월"),mmm:p("1월;2월;3월;4월;5월;6월;7월;8월;9월;10월;11월;12월"),dddd:p("일요일;월요일;화요일;수요일;목요일;금요일;토요일"),ddd:p("일;월;화;수;목;금;토")},"ko"),ne({group:",",ampm:p("ก่อนเที่ยง;หลังเที่ยง"),mmmm:p("มกร~;กุมภาพันธ์;มีน~;เมษายน;พฤษภ~;มิถุนายน;กรกฎ~;สิงห~;กันยายน;ตุล~;พฤศจิกายน;ธันว~","าคม"),mmm:p("ม.ค.;ก.พ.;มี.ค.;เม.ย.;พ.ค.;มิ.ย.;ก.ค.;ส.ค.;ก.ย.;ต.ค.;พ.ย.;ธ.ค."),dddd:p("วันอาทิตย์;วันจันทร์;วันอังคาร;วันพุธ;วันพฤหัสบดี;วันศุกร์;วันเสาร์"),ddd:p("อา.;จ.;อ.;พ.;พฤ.;ศ.;ส.")},"th"),ne(ke({decimal:",",ampm:p("dop.;odp."),mmmm:p("ledna;února;března;dubna;května;června;července;srpna;září;října;listopadu;prosince"),mmm:p("I;II;III;IV;V;VI;VII;VIII;IX;X;XI;XII"),dddd:p("neděle;pondělí;úterý;středa;čtvrtek;pátek;sobota"),bool:p("PRAVDA;NEPRAVDA")},-1,2),"cs"),ne(ke({group:".",decimal:",",mmmm:p("januar;februar;marts;april;maj;juni;juli;august;september;oktober;november;december"),dddd:p("søn~;man~;tirs~;ons~;tors~;fre~;lør~","dag"),bool:p("SAND;FALSK")},13,13),"da"),ne(ke({group:".",decimal:",",ampm:p("a.m.;p.m."),mmmm:p("januari;februari;maart;april;mei;juni;juli;augustus;september;oktober;november;december"),mmm:p("jan.;feb.;mrt.;apr.;mei;jun.;jul.;aug.;sep.;okt.;nov.;dec."),dddd:p("zondag;maandag;dinsdag;woensdag;donderdag;vrijdag;zaterdag"),bool:p("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:p("Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sept;Oct;Nov;Dec")},"en_IE"),ne(ke({decimal:",",nan:"epäluku",ampm:p("ap.;ip."),mmmm:p("tammi~;helmi~;maalis~;huhti~;touko~;kesä~;heinä~;elo~;syys~;loka~;marras~;joulu~","kuuta"),mmm:p("tammik.;helmik.;maalisk.;huhtik.;toukok.;kesäk.;heinäk.;elok.;syysk.;lokak.;marrask.;jouluk."),dddd:p("sunnun~;maanan~;tiis~;keskiviikkona;tors~;perjan~;lauan~","taina"),bool:p("TOSI;EPÄTOSI")},-1,2),"fi");const _o=ke({group:" ",decimal:",",mmmm:p("janvier;février;mars;avril;mai;juin;juillet;août;septembre;octobre;novembre;décembre"),mmm:p("janv.;févr.;mars;avr.;mai;juin;juil.;août;sept.;oct.;nov.;déc."),dddd:p("~manche;lun~;mar~;mercre~;jeu~;vendre~;same~","di"),bool:p("VRAI;FAUX")},-1,13);ne({..._o},"fr"),ne({..._o,mmm:p("janv.;févr.;mars;avr.;mai;juin;juill.;août;sept.;oct.;nov.;déc.")},"fr_CA"),ne({group:"'",decimal:".",..._o},"fr_CH");const $c=ke({mmmm:p("Januar;Februar;März;April;Mai;Juni;Juli;August;September;Oktober;November;Dezember"),mmm:p("Jan.;Feb.;März;Apr.;Mai;Juni;Juli;Aug.;Sept.;Okt.;Nov.;Dez."),dddd:p("Sonn~;Mon~;Diens~;Mittwoch;Donners~;Frei~;Sams~","tag"),bool:p("WAHR;FALSCH")},-1,12);ne({group:".",decimal:",",...$c},"de"),ne({group:"'",decimal:".",...$c},"de_CH"),ne(ke({group:".",decimal:",",ampm:p("π.μ.;μ.μ."),mmmm:p("Ιανουαρ~;Φεβρουαρ~;Μαρτ~;Απριλ~;Μαΐου;Ιουν~;Ιουλ~;Αυγούστου;Σεπτεμβρ~;Οκτωβρ~;Νοεμβρ~;Δεκεμβρ~","ίου"),mmm:p("Ιαν;Φεβ;Μαρ;Απρ;Μαΐ;Ιουν;Ιουλ;Αυγ;Σεπ;Οκτ;Νοε;Δεκ"),dddd:p("Κυριακή;Δευτέρα;Τρίτη;Τετάρτη;Πέμπτη;Παρασκευή;Σάββατο")},-1,3),"el"),ne({decimal:",",ampm:p("de.;du."),mmmm:p("január;február;március;április;május;június;július;augusztus;szeptember;október;november;december"),mmm:p("jan.;febr.;márc.;ápr.;máj.;jún.;júl.;aug.;szept.;okt.;nov.;dec."),dddd:p("vasárnap;hétfő;kedd;szerda;csütörtök;péntek;szombat"),ddd:p("V;H;K;Sze;Cs;P;Szo"),bool:p("IGAZ;HAMIS")},"hu"),ne(ke({group:".",decimal:",",ampm:p("f.h.;e.h."),mmmm:p("janúar;febrúar;mars;apríl;maí;júní;júlí;ágúst;september;október;nóvember;desember"),dddd:p("sunnu~;mánu~;þriðju~;miðviku~;fimmtu~;föstu~;laugar~","dagur")},13,13),"is"),ne(ke({group:".",decimal:",",mmmm:p("Januari;Februari;Maret;April;Mei;Juni;Juli;Agustus;September;Oktober;November;Desember"),dddd:p("Minggu;Senin;Selasa;Rabu;Kamis;Jumat;Sabtu")},3,3),"id");const jc=ke({mmmm:p("gennaio;febbraio;marzo;aprile;maggio;giugno;luglio;agosto;settembre;ottobre;novembre;dicembre"),dddd:p("domenica;lunedì;martedì;mercoledì;giovedì;venerdì;sabato"),bool:p("VERO;FALSO")},3,3);ne({group:".",decimal:",",...jc},"it"),ne({group:"'",decimal:".",...jc},"it_CH");const Wc={decimal:",",ampm:p("a.m.;p.m."),mmmm:p("januar;februar;mars;april;mai;juni;juli;august;september;oktober;november;desember"),mmm:p("jan.;feb.;mar.;apr.;mai;jun.;jul.;aug.;sep.;okt.;nov.;des."),dddd:p("søn~;man~;tirs~;ons~;tors~;fre~;lør~","dag"),bool:p("SANN;USANN")};ne(ke({...Wc},-1,13),"nb"),ne(ke({...Wc},-1,13),"no"),ne(ke({decimal:",",mmmm:p("stycznia;lutego;marca;kwietnia;maja;czerwca;lipca;sierpnia;września;października;listopada;grudnia"),dddd:p("niedziela;poniedziałek;wtorek;środa;czwartek;piątek;sobota"),ddd:p("niedz.;pon.;wt.;śr.;czw.;pt.;sob."),bool:p("PRAWDA;FAŁSZ")},3,-1),"pl");const Yc={group:".",decimal:",",mmmm:p("janeiro;fevereiro;março;abril;maio;junho;julho;agosto;setembro;outubro;novembro;dezembro"),dddd:p("domingo;segunda-feira;terça-feira;quarta-feira;quinta-feira;sexta-feira;sábado"),bool:p("VERDADEIRO;FALSO")};ne(ke(Yc,13,13),"pt"),ne(ke(Yc,13,13),"pt_BR"),ne({decimal:",",nan:"не число",mmmm:p("января;февраля;марта;апреля;мая;июня;июля;августа;сентября;октября;ноября;декабря"),mmm:p("янв.;февр.;мар.;апр.;мая;июн.;июл.;авг.;сент.;окт.;нояб.;дек."),dddd:p("воскресенье;понедельник;вторник;среда;четверг;пятница;суббота"),ddd:p("вс;пн;вт;ср;чт;пт;сб"),mmmm6:p("рамадан;шавваль;зуль-каада;зуль-хиджжа;мухаррам;раби-уль-авваль;раби-уль-ахир;джумад-уль-авваль;джумад-уль-ахир;раджаб;шаабан;рамадан"),mmm6:p("рам.;шав.;зуль-к.;зуль-х.;мух.;раб. I;раб. II;джум. I;джум. II;радж.;шааб.;рам."),bool:p("ИСТИНА;ЛОЖЬ")},"ru"),ne(ke({decimal:",",mmmm:p("januára;februára;marca;apríla;mája;júna;júla;augusta;septembra;októbra;novembra;decembra"),dddd:p("nedeľa;pondelok;utorok;streda;štvrtok;piatok;sobota")},3,2),"sk");const Lt={group:".",decimal:",",ampm:p("a. m.;p. m."),mmmm:p("enero;febrero;marzo;abril;mayo;junio;julio;agosto;septiem~;octu~;noviem~;diciem~","bre"),mmm:p("ene;feb;mar;abr;may;jun;jul;ago;sept;oct;nov;dic"),dddd:p("domingo;lunes;martes;miércoles;jueves;viernes;sábado"),ddd:p("dom;lun;mar;mié;jue;vie;sáb"),bool:p("VERDADERO;FALSO")},Ip=p("ene;feb;mar;abr;may;jun;jul;ago;sep;oct;nov;dic"),po=p("ene.;feb.;mar.;abr.;may.;jun.;jul.;ago.;sept.;oct.;nov.;dic.");ne({...Lt},"es"),ne({...Lt},"es_AR"),ne({...Lt},"es_BO"),ne({...Lt},"es_CL"),ne({...Lt},"es_CO"),ne({...Lt},"es_EC"),ne({...Lt,mmm:Ip,ampm:p("a.m.;p.m.")},"es_MX"),ne({...Lt,mmm:po},"es_PY"),ne({...Lt,mmm:po},"es_UY"),ne({...Lt,mmm:po,mmmm:p("enero;febrero;marzo;abril;mayo;junio;julio;agosto;setiembre;octubre;noviembre;diciembre")},"es_VE"),ne({decimal:",",ampm:p("fm;em"),mmmm:p("januari;februari;mars;april;maj;juni;juli;augusti;september;oktober;november;december"),mmm:p("jan.;feb.;mars;apr.;maj;juni;juli;aug.;sep.;okt.;nov.;dec."),dddd:p("sön~;mån~;tis~;ons~;tors~;fre~;lör~","dag"),ddd:p("sön;mån;tis;ons;tors;fre;lör")},"sv"),ne(ke({group:".",decimal:",",ampm:p("ÖÖ;ÖS"),mmmm:p("Ocak;Şubat;Mart;Nisan;Mayıs;Haziran;Temmuz;Ağustos;Eylül;Ekim;Kasım;Aralık"),mmm:p("Oca;Şub;Mar;Nis;May;Haz;Tem;Ağu;Eyl;Eki;Kas;Ara"),dddd:p("Pazar;Pazartesi;Salı;Çarşamba;Perşembe;Cuma;Cumartesi"),ddd:p("Paz;Pzt;Sal;Çar;Per;Cum;Cmt"),bool:p("DOĞRU;YANLIŞ")},3,-1),"tr"),ne({group:",",ampm:p("yb;yh"),mmmm:p("Ionawr;Chwefror;Mawrth;Ebrill;Mai;Mehefin;Gorffennaf;Awst;Medi;Hydref;Tachwedd;Rhagfyr"),mmm:p("Ion;Chwef;Maw;Ebr;Mai;Meh;Gorff;Awst;Medi;Hyd;Tach;Rhag"),dddd:p("Dydd Sul;Dydd Llun;Dydd Mawrth;Dydd Mercher;Dydd Iau;Dydd Gwener;Dydd Sadwrn"),ddd:p("Sul;Llun;Maw;Mer;Iau;Gwen;Sad")},"cy"),ne({group:".",decimal:",",mmmm:p("yanvar;fevral;mart;aprel;may;iyun;iyul;avqust;sentyabr;oktyabr;noyabr;dekabr"),mmm:p("yan;fev;mar;apr;may;iyn;iyl;avq;sen;okt;noy;dek"),dddd:p("bazar;bazar ertəsi;çərşənbə axşamı;çərşənbə;cümə axşamı;cümə;şənbə"),ddd:p("B.;B.e.;Ç.a.;Ç.;C.a.;C.;Ş.")},"az"),ne(ke({decimal:",",mmmm:p("студзеня;лютага;сакавіка;красавіка;мая;чэрвеня;ліпеня;жніўня;верасня;кастрычніка;лістапада;снежня"),dddd:p("нядзеля;панядзелак;аўторак;серада;чацвер;пятніца;субота"),ddd:p("нд;пн;аў;ср;чц;пт;сб")},3,-1),"be"),ne({decimal:",",ampm:p("пр.об.;сл.об."),mmmm:p("януари;февруари;март;април;май;юни;юли;август;септември;октомври;ноември;декември"),mmm:p("яну;фев;март;апр;май;юни;юли;авг;сеп;окт;ное;дек"),dddd:p("неделя;понеделник;вторник;сряда;четвъртък;петък;събота"),ddd:p("нд;пн;вт;ср;чт;пт;сб"),bool:p("ИСТИНА;ЛОЖЬ")},"bg"),ne({group:".",decimal:",",mmmm:p("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:p("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:p("diumenge;dilluns;dimarts;dimecres;dijous;divendres;dissabte"),ddd:p("dg.;dl.;dt.;dc.;dj.;dv.;ds."),ampm:p("a. m.;p. m.")},"ca"),ne(ke({group:",",decimal:".",mmmm:p("Enero;Pebrero;Marso;Abril;Mayo;Hunyo;Hulyo;Agosto;Setyembre;Oktubre;Nobyembre;Disyembre"),dddd:p("Linggo;Lunes;Martes;Miyerkules;Huwebes;Biyernes;Sabado")},3,3),"fil"),ne({group:",",decimal:".",mmmm:p("જાન્યુઆરી;ફેબ્રુઆરી;માર્ચ;એપ્રિલ;મે;જૂન;જુલાઈ;ઑગસ્ટ;સપ્ટેમ્બર;ઑક્ટોબર;નવેમ્બર;ડિસેમ્બર"),mmm:p("જાન્યુ;ફેબ્રુ;માર્ચ;એપ્રિલ;મે;જૂન;જુલાઈ;ઑગસ્ટ;સપ્ટે;ઑક્ટો;નવે;ડિસે"),dddd:p("રવિ~;સોમ~;મંગળ~;બુધ~;ગુરુ~;શુક્ર~;શનિ~","વાર"),ddd:p("રવિ;સોમ;મંગળ;બુધ;ગુરુ;શુક્ર;શનિ")},"gu"),ne({group:",",decimal:".",ampm:p("לפנה״צ;אחה״צ"),dddd:p("~ראשון;~שני;~שלישי;~רביעי;~חמישי;~שישי;~שבת","יום "),ddd:p("~א׳;~ב׳;~ג׳;~ד׳;~ה׳;~ו׳;שבת","יום "),mmmm:p("ינואר;פברואר;מרץ;אפריל;מאי;יוני;יולי;אוגוסט;ספטמבר;אוקטובר;נובמבר;דצמבר"),mmm:p("ינו׳;פבר׳;מרץ;אפר׳;מאי;יוני;יולי;אוג׳;ספט׳;אוק׳;נוב׳;דצמ׳"),mmmm6:p("רמדאן;שוואל;ד׳ו אל־קעדה;ד׳ו אל־חיג׳ה;מוחרם;רביע אל־אוול;רביע א־ת׳אני;ג׳ומאדא אל־אולא;ג׳ומאדא א־ת׳אניה;רג׳ב;שעבאן;רמדאן"),mmm6:p("רמדאן;שוואל;ד׳ו אל־קעדה;ד׳ו אל־חיג׳ה;מוחרם;רביע א׳;רביע ב׳;ג׳ומאדא א׳;ג׳ומאדא ב׳;רג׳ב;שעבאן;רמדאן")},"he"),ne(ke({group:".",decimal:",",mmmm:p("siječnja;veljače;ožujka;travnja;svibnja;lipnja;srpnja;kolovoza;rujna;listopada;studenoga;prosinca"),mmm:p("sij;velj;ožu;tra;svi;lip;srp;kol;ruj;lis;stu;pro"),dddd:p("nedjelja;ponedjeljak;utorak;srijeda;četvrtak;petak;subota")},-1,3),"hr"),ne({decimal:",",mmmm:p("հունվարի;փետրվարի;մարտի;ապրիլի;մայիսի;հունիսի;հուլիսի;օգոստոսի;սեպտեմբերի;հոկտեմբերի;նոյեմբերի;դեկտեմբերի"),mmm:p("հնվ;փտվ;մրտ;ապր;մյս;հնս;հլս;օգս;սեպ;հոկ;նոյ;դեկ"),dddd:p("կիրակի;երկուշաբթի;երեքշաբթի;չորեքշաբթի;հինգշաբթի;ուրբաթ;շաբաթ"),ddd:p("կիր;երկ;երք;չրք;հնգ;ուր;շբթ")},"hy"),ne(ke({decimal:",",mmmm:p("იანვარი;თებერვალი;მარტი;აპრილი;მაისი;ივნისი;ივლისი;აგვისტო;სექტემბერი;ოქტომბერი;ნოემბერი;დეკემბერი"),dddd:p("კვირა;ორშაბათი;სამშაბათი;ოთხშაბათი;ხუთშაბათი;პარასკევი;შაბათი")},3,3),"ka"),ne(ke({decimal:",",mmmm:p("қаңтар;ақпан;наурыз;сәуір;мамыр;маусым;шілде;тамыз;қыркүйек;қазан;қараша;желтоқсан"),dddd:p("жексенбі;дүйсенбі;сейсенбі;сәрсенбі;бейсенбі;жұма;сенбі"),ddd:p("жс;дс;сс;ср;бс;жм;сб")},13,-1),"kk"),ne({group:",",mmmm:p("ಜನವರಿ;ಫೆಬ್ರವರಿ;ಮಾರ್ಚ್;ಏಪ್ರಿಲ್;ಮೇ;ಜೂನ್;ಜುಲೈ;ಆಗಸ್ಟ್;ಸೆಪ್ಟೆಂಬರ್;ಅಕ್ಟೋಬರ್;ನವೆಂಬರ್;ಡಿಸೆಂಬರ್"),mmm:p("ಜನವರಿ;ಫೆಬ್ರವರಿ;ಮಾರ್ಚ್;ಏಪ್ರಿ;ಮೇ;ಜೂನ್;ಜುಲೈ;ಆಗಸ್ಟ್;ಸೆಪ್ಟೆಂ;ಅಕ್ಟೋ;ನವೆಂ;ಡಿಸೆಂ"),dddd:p("ಭಾನು~;ಸೋಮ~;ಮಂಗಳ~;ಬುಧ~;ಗುರು~;ಶುಕ್ರ~;ಶನಿ~","ವಾರ"),ddd:p("ಭಾನು;ಸೋಮ;ಮಂಗಳ;ಬುಧ;ಗುರು;ಶುಕ್ರ;ಶನಿ"),ampm:p("ಪೂರ್ವಾಹ್ನ;ಅಪರಾಹ್ನ")},"kn"),ne({decimal:",",mmmm:p("sausio;vasario;kovo;balandžio;gegužės;birželio;liepos;rugpjūčio;rugsėjo;spalio;lapkričio;gruodžio"),mmm:p("saus.;vas.;kov.;bal.;geg.;birž.;liep.;rugp.;rugs.;spal.;lapkr.;gruod."),dddd:p("sekmadienis;pirmadienis;antradienis;trečiadienis;ketvirtadienis;penktadienis;šeštadienis"),ddd:p("sk;pr;an;tr;kt;pn;št"),ampm:p("priešpiet;popiet")},"lt"),ne({decimal:",",mmmm:p("janvāris;februāris;marts;aprīlis;maijs;jūnijs;jūlijs;augusts;septembris;oktobris;novembris;decembris"),mmm:p("janv.;febr.;marts;apr.;maijs;jūn.;jūl.;aug.;sept.;okt.;nov.;dec."),dddd:p("svētdiena;pirmdiena;otrdiena;trešdiena;ceturtdiena;piektdiena;sestdiena"),ddd:p("svētd.;pirmd.;otrd.;trešd.;ceturtd.;piektd.;sestd."),ampm:p("priekšpusdienā;pēcpusdienā")},"lv"),ne({group:",",decimal:".",mmmm:p("ജനുവരി;ഫെബ്രുവരി;മാർച്ച്;ഏപ്രിൽ;മേയ്;ജൂൺ;ജൂലൈ;ഓഗസ്റ്റ്;സെപ്റ്റംബർ;ഒക്‌ടോബർ;നവംബർ;ഡിസംബർ"),mmm:p("ജനു;ഫെബ്രു;മാർ;ഏപ്രി;മേയ്;ജൂൺ;ജൂലൈ;ഓഗ;സെപ്റ്റം;ഒക്ടോ;നവം;ഡിസം"),dddd:p("ഞായറാഴ്‌ച;തിങ്കളാഴ്‌ച;ചൊവ്വാഴ്ച;ബുധനാഴ്‌ച;വ്യാഴാഴ്‌ച;വെള്ളിയാഴ്‌ച;ശനിയാഴ്‌ച"),ddd:p("ഞായർ;തിങ്കൾ;ചൊവ്വ;ബുധൻ;വ്യാഴം;വെള്ളി;ശനി")},"ml"),ne({group:",",decimal:".",mmmm:p("нэгдүгээ~;хоёрдугаа~;гуравдугаа~;дөрөвдүгээ~;тавдугаа~;зургаадугаа~;долоодугаа~;наймдугаа~;есдүгээ~;аравдугаа~;арван нэгдүгээ~;арван хоёрдугаа~","р сар"),mmm:p("1~;2~;3~;4~;5~;6~;7~;8~;9~;10~;11~;12~","-р сар"),dddd:p("ням;даваа;мягмар;лхагва;пүрэв;баасан;бямба"),ddd:p("Ня;Да;Мя;Лх;Пү;Ба;Бя"),ampm:p("ү.ө.;ү.х.")},"mn"),ne({group:",",decimal:".",mmmm:p("जानेवारी;फेब्रुवारी;मार्च;एप्रिल;मे;जून;जुलै;ऑगस्ट;सप्टेंबर;ऑक्टोबर;नोव्हेंबर;डिसेंबर"),mmm:p("जाने;फेब्रु;मार्च;एप्रि;मे;जून;जुलै;ऑग;सप्टें;ऑक्टो;नोव्हें;डिसें"),dddd:p("रविवार;सोमवार;मंगळवार;बुधवार;गुरुवार;शुक्रवार;शनिवार"),ddd:p("रवि;सोम;मंगळ;बुध;गुरु;शुक्र;शनि")},"mr"),ne(ke({group:",",decimal:".",mmmm:p("ဇန်နဝါရီ;ဖေဖော်ဝါရီ;မတ်;ဧပြီ;မေ;ဇွန်;ဇူလိုင်;ဩဂုတ်;စက်တင်ဘာ;အောက်တိုဘာ;နိုဝင်ဘာ;ဒီဇင်ဘာ"),mmm:p("ဇန်;ဖေ;မတ်;ဧ;မေ;ဇွန်;ဇူ;ဩ;စက်;အောက်;နို;ဒီ"),dddd:p("တနင်္ဂနွေ;တနင်္လာ;အင်္ဂါ;ဗုဒ္ဓဟူး;ကြာသပတေး;သောကြာ;စနေ"),ampm:p("နံနက်;ညနေ")},-1,0),"my"),ne({group:",",decimal:".",mmmm:p("ਜਨਵਰੀ;ਫ਼ਰਵਰੀ;ਮਾਰਚ;ਅਪ੍ਰੈਲ;ਮਈ;ਜੂਨ;ਜੁਲਾਈ;ਅਗਸਤ;ਸਤੰਬਰ;ਅਕਤੂਬਰ;ਨਵੰਬਰ;ਦਸੰਬਰ"),mmm:p("ਜਨ;ਫ਼ਰ;ਮਾਰਚ;ਅਪ੍ਰੈ;ਮਈ;ਜੂਨ;ਜੁਲਾ;ਅਗ;ਸਤੰ;ਅਕਤੂ;ਨਵੰ;ਦਸੰ"),dddd:p("ਐਤਵਾਰ;ਸੋਮਵਾਰ;ਮੰਗਲਵਾਰ;ਬੁੱਧਵਾਰ;ਵੀਰਵਾਰ;ਸ਼ੁੱਕਰਵਾਰ;ਸ਼ਨਿੱਚਰਵਾਰ"),ddd:p("ਐਤ;ਸੋਮ;ਮੰਗਲ;ਬੁੱਧ;ਵੀਰ;ਸ਼ੁੱਕਰ;ਸ਼ਨਿੱਚਰ"),ampm:p("ਪੂ.ਦੁ.;ਬਾ.ਦੁ.")},"pa"),ne({group:".",decimal:",",mmmm:p("ianuarie;februarie;martie;aprilie;mai;iunie;iulie;august;septem~;octom~;noiem~;decem~","brie"),mmm:p("ian.;feb.;mar.;apr.;mai;iun.;iul.;aug.;sept.;oct.;nov.;dec."),dddd:p("duminică;luni;marți;miercuri;joi;vineri;sâmbătă"),ddd:p("dum.;lun.;mar.;mie.;joi;vin.;sâm."),ampm:p("a.m.;p.m.")},"ro"),ne(ke({group:".",decimal:",",mmmm:p("januar;februar;marec;april;maj;junij;julij;avgust;september;oktober;november;december"),mmm:p("jan.;feb.;mar.;apr.;maj;jun.;jul.;avg.;sep.;okt.;nov.;dec."),dddd:p("nedelja;ponedeljek;torek;sreda;četrtek;petek;sobota"),ampm:p("dop.;pop.")},-1,13),"sl"),ne(ke({group:".",decimal:",",mmmm:p("јануар;фебруар;март;април;мај;јун;јул;август;септембар;октобар;новембар;децембар"),dddd:p("недеља;понедељак;уторак;среда;четвртак;петак;субота")},3,3),"sr"),ne({group:",",decimal:".",mmmm:p("ஜனவரி;பிப்ரவரி;மார்ச்;ஏப்ரல்;மே;ஜூன்;ஜூலை;ஆகஸ்ட்;செப்டம்பர்;அக்டோபர்;நவம்பர்;டிசம்பர்"),mmm:p("ஜன.;பிப்.;மார்.;ஏப்.;மே;ஜூன்;ஜூலை;ஆக.;செப்.;அக்.;நவ.;டிச."),dddd:p("ஞாயிறு;திங்கள்;செவ்வாய்;புதன்;வியாழன்;வெள்ளி;சனி"),ddd:p("ஞாயி.;திங்.;செவ்.;புத.;வியா.;வெள்.;சனி")},"ta"),ne({group:",",decimal:".",mmmm:p("జనవరి;ఫిబ్రవరి;మార్చి;ఏప్రిల్;మే;జూన్;జులై;ఆగస్టు;సెప్టెంబర్;అక్టోబర్;నవంబర్;డిసెంబర్"),mmm:p("జన;ఫిబ్ర;మార్చి;ఏప్రి;మే;జూన్;జులై;ఆగ;సెప్టెం;అక్టో;నవం;డిసెం"),dddd:p("ఆదివారం;సోమవారం;మంగళవారం;బుధవారం;గురువారం;శుక్రవారం;శనివారం"),ddd:p("ఆది;సోమ;మంగళ;బుధ;గురు;శుక్ర;శని")},"te"),ne({decimal:",",mmmm:p("січня;лютого;березня;квітня;травня;червня;липня;серпня;вересня;жовтня;листопада;грудня"),mmm:p("січ.;лют.;бер.;квіт.;трав.;черв.;лип.;серп.;вер.;жовт.;лист.;груд."),dddd:p("неділю;понеділок;вівторок;середу;четвер;пʼятницю;суботу"),ddd:p("нд;пн;вт;ср;чт;пт;сб"),ampm:p("дп;пп")},"uk"),ne({group:".",decimal:",",mmmm:p("~1;~2;~3;~4;~5;~6;~7;~8;~9;~10;~11;~12","tháng "),mmm:p("~1;~2;~3;~4;~5;~6;~7;~8;~9;~10;~11;~12","thg "),dddd:p("Chủ Nhật;Thứ Hai;Thứ Ba;Thứ Tư;Thứ Năm;Thứ Sáu;Thứ Bảy"),ddd:p("CN;Th 2;Th 3;Th 4;Th 5;Th 6;Th 7"),ampm:p("SA;CH")},"vi"),ne(ke({group:"٬",decimal:"٫",ampm:p("ص;م"),mmmm:p("يناير;فبراير;مارس;أبريل;مايو;يونيو;يوليو;أغسطس;سبتمبر;أكتوبر;نوفمبر;ديسمبر"),dddd:p("الأحد;الاثنين;الثلاثاء;الأربعاء;الخميس;الجمعة;السبت"),mmmm6:p("رمضان;شوال;ذو القعدة;ذو الحجة;محرم;ربيع الأول;ربيع الآخرة;جمادى الأولى;جمادى الآخرة;رجب;شعبان;رمضان")},0,0),"ar"),ne({group:",",decimal:".",mmmm:p("জানুয়ারী;ফেব্রুয়ারী;মার্চ;এপ্রিল;মে;জুন;জুলাই;আগস্ট;সেপ্টেম্বর;অক্টোবর;নভেম্বর;ডিসেম্বর"),mmm:p("জানু;ফেব;মার্চ;এপ্রি;মে;জুন;জুল;আগ;সেপ্টেঃ;অক্টোঃ;নভেঃ;ডিসেঃ"),dddd:p("রবিবার;সোমবার;মঙ্গলবার;বুধবার;বৃহস্পতিবার;শুক্রবার;শনিবার"),ddd:p("রবি;সোম;মঙ্গল;বুধ;বৃহস্পতি;শুক্র;শনি")},"bn"),ne({group:",",decimal:".",mmmm:p("जनवरी;फ़रवरी;मार्च;अप्रैल;मई;जून;जुलाई;अगस्त;सितंबर;अक्तूबर;नवंबर;दिसंबर"),mmm:p("जन॰;फ़र॰;मार्च;अप्रैल;मई;जून;जुल॰;अग॰;सित॰;अक्तू॰;नव॰;दिस॰"),dddd:p("रविवार;सोमवार;मंगलवार;बुधवार;गुरुवार;शुक्रवार;शनिवार"),ddd:p("रवि;सोम;मंगल;बुध;गुरु;शुक्र;शनि"),ampm:p("am;pm")},"hi");const zc={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 It(e,t=0){if(typeof e!="number")return e;if(e<0)return-It(-e,t);if(t){const n=10**t||1;return It(e*n,0)/n}return Math.round(e)}const Sp=1e-13;function Vc(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)>=Sp&&o!==Math.floor(o));d=[r*c,u]}return d}const mt=Math.floor;function Kc(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=mt(4*n/146097);n=n-mt((146097*r+3)/4);const s=mt(4e3*(n+1)/1461001);n=n-mt(1461*s/4)+31;const i=mt(80*n/2447),o=n-mt(2447*i/80);n=mt(i/11);const a=i+2-12*n;return[100*(r-49)+s+n|0,a|0,o|0]}function Op(e){return Kc(e+1462)}function vp(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=mt(r/10631);r=r-10631*s;const i=mt((r-n)/t);r=r-mt(i*t+n);const o=mt((r+28.5001)/29.5);return o===13?[30*s+i,12,30]:[30*s+i,o,r-mt(29.5001*o-29)]}function Gc(e,t=0,n=!0){const r=mt(e);return t===Ln?vp(r):t===Ep?Op(r):Kc(r,n)}const Rs=Math.floor,Eo=86400;function Co(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 wp(e,t){let n=e|0;const r=Eo*(e-n);let s=Rs(r);r-s>.9999&&(s+=1,s===Eo&&(s=0,n+=1));const i=s<0?Eo+s:s,[o,a,l]=Gc(e,0,t&&t.leap1900),c=Rs(i/60/60)%60,u=Rs(i/60)%60,h=Rs(i)%60;return[o,a,l,c,u,h]}const bp=["!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"],yp={j:"d",d:"d",D:"ddd",l:"dddd",n:"m",m:"m",M:"mmm",F:"mmmm",y:"yy",Y:"yyyy"},Ap={j:"dd",d:"dd",D:"ddd",l:"dddd",n:"mm",m:"mm",M:"mmm",F:"mmmm",y:"yy",Y:"yyyy"},Xc={},qc={};function gt(e,t,n=1){if(e){const r=e[0],s=e.slice(1);r==="!"?gt(s,t,4):r==="?"?gt(s,t,2):(t[r]=t[r]||{},gt(s,t[r],n))}else t.$=n}function Jc(e,t){gt(e,t),gt(e+" x",t),gt(e+" l",t),gt(e+" l x",t),gt("l "+e,t),gt("l "+e+" x",t),gt(e+" D",t),gt(e+" D x",t),gt("D "+e,t),gt("D "+e+" x",t)}bp.forEach(e=>{e[0]!=="?"&&Jc(e,Xc),e[0]!=="!"&&Jc(e,qc)});const Tp=new Date().getUTCFullYear(),Zc=".",Np=",",Ro=" ",Sr=" ",Or=" ",Is="'",Ss="٬",Mp={".":[Np,Sr,Or,Is,Ss],",":[Zc,Sr,Or,Is,Ss],"٫":[Zc,Sr,Or,Is,Ss]},Io=e=>e&&e.length===1&&e>="0"&&e<="9";function So(e,t={}){const n=kn(t.locale||"")||Zt,r=n.decimal,s=[...Mp[r]||[Is,Ss]];!s.includes(n.group)&&n.group!==Ro&&n.group!==r&&s.push(n.group);let i="",o="",a=1,l="",c=!1,u=!1,h=!1,d=!1,m=!1,_=null,C=!1,I=0;const y=[Ro,Sr,Or,"+","%","(","-"].concat(lo);for(;y.includes(e[I]);){const b=e[I];if(b==="-"){if(c||u)return null;c=!0,a=-1}else if(co.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||Io(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(Io(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(;Io(e[I]);)o+=e[I],I++;if(b===I)return null}const Y=[Ro,Sr,Or,"%","$",")"].concat(lo);for(;Y.includes(e[I]);){const b=e[I];if(co.test(b)){if(m)return null;m=!0,_=b,C=!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";C?l=b+_:l=_+b}else x&&(l=i.includes(".")?"#,##0.00":"#,##0");const E={v:O*a};return l&&(E.z=l),E}function Dp(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 Qc=(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]},Ut=(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=Ut(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=Ut(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=Ut(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=Ut(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]=Qc(e,r.mon,r.mp);u&&u[2]===l&&(a=Ut(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]=Qc(e,r.day,r.dp);u&&u[2]===l&&(a=Ut(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=Ut(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=Ut(e.slice(c[0].length),t[l],{...n,year:+c[0],path:s+l},r))}else if(l==="x"){const c=vs(e,{locale:r.locale});c&&(a=Ut("",t[l],{...n,time:c.v,tf:c.z,path:s+l},r))}else throw new Error(`Unknown date token "${l}"`);if(a&&Dp(n.year||1916,n.month||1,n.day?+n.day:1))return a}}},eu=e=>e.replace(/\s+/g," ").trim().replace(/’/,"'").replace(/\.$/,"").toLowerCase(),Os=(e,t)=>{const n=e.map((r,s)=>[eu(r),s+1,t]);return n.sort((r,s)=>s[0].length-r[0].length),n};function Oo(e,t={}){var i;const n=kn(t.locale||"")||Zt,r={mon:Os(n.mmmm,"F").concat(Os(n.mmm,"M")),mp:n.mmm[0].at(-1)===".",day:Os(n.dddd,"l").concat(Os(n.ddd,"D")),dp:n.ddd[0].at(-1)===".",locale:t.locale},s=Ut(eu(e),n.preferMDY?qc:Xc,{path:""},r);if(s){if(s.sep==="."&&s.path.length===3)return null;const o=+((i=s.year)!=null?i:Tp);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?Ap[h]:yp[h])||h);return{v:l,z:u}}}return null}const vo=e=>e.replace(/\s+/g,"").trim().replace(/\./g,"").toLowerCase();function vs(e,t={}){const n=kn(t.locale||"")||Zt,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=vo(e.slice(r[0].length));if(i===vo(n.ampm[0])||i==="a"||i==="am")s="a";else if(i===vo(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 tu(e,t={}){const n=kn(t.locale||"")||Zt,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 Lp(e,t){var n,r,s;return(s=(r=(n=So(e,t))!=null?n:Oo(e,t))!=null?r:vs(e,t))!=null?s:tu(e,t)}function _n(e,t,n){return t[n+"_max"]=e.length,t[n+"_min"]=e.replace(/#/g,"").length,t}function Ve(e,t){typeof e=="string"?t.push({type:"string",value:e}):t.push(e)}function nu(e,t){const n=e&&e.type;return n===xi||n===Un||n===Hi||n===Es&&t==="den"}function vr(e){var x,Y,O;const t=[],n={scale:1,percent:!1,text:!1,date:0,date_eval:!1,date_system:xc,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 E=e[l],b=E.type||Ir;if(u+=E.raw,b===Fi)n.general=!0,Ve(E,t);else if(nu(E,r)){const T=n[r+"_pattern"];nu(o,r)||(o==null?void 0:o.type)===Rr?(T.push((T.pop()||"")+E.value),s.num+=E.value):(T.push(E.value),s={type:r,num:E.value},Ve(s,t))}else if(b===ao)E.value==="("&&(n.parens=!0),Ve(E.value,t);else if(b===Es)Ve(E.value,t);else if(b===Bi)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",Ve({type:"div"},t)}else Ve(E.value,t);else if(b===$i)Ve(",",t);else if(b===gs)n.scale=.001**E.raw.length;else if(b===Rr){if(r==="int"&&(n.grouping=!0),r==="den")throw new SyntaxError("Cannot group denominator digits")}else if(b===zi)Ve(E,t);else if(b===ji){c=!0;break}else if(b===_s)n.text=!0,Ve(E,t);else if(b===Wi||b===Yi)Ve(E,t);else if(b===Xi){const T=E.value.toLowerCase(),B=T[0],$={type:"",size:0,date:1,pad:T.length};B==="h"?($.size=pr,$.type="hour-elap"):B==="m"?($.size=Er,$.type="min-elap"):($.size=Cr,$.type="sec-elap"),n.date=n.date|$.size,i.push($),Ve($,t)}else if(n.date&&b===ps&&((x=e[l+1])==null?void 0:x.type)===Un){let T=1;l++;let B="0";((Y=e[l+1])==null?void 0:Y.type)===Un&&(B+="0",T=2,l++),((O=e[l+1])==null?void 0:O.type)===Un&&(B+="0",T=3,l++),u+=B;const $=[Cr,Ui,Pi,ki][T];n.date=n.date|$,n.date_eval=!0,n.sec_decimals=Math.max(n.sec_decimals,T),Ve({type:"subsec",size:$,decimals:T,date:1},t)}else if(b===Ki)a||(E.value==="B2"||E.value==="b2"?n.date_system=Ln:n.date_system=xc);else if(b===Gi){const T={type:"",size:0,date:1},B=E.value.toLowerCase(),$=B[0];if(B==="y"||B==="yy")T.size=gr,T.type="year-short";else if($==="y"||$==="e")T.size=gr,T.type="year";else if(B==="b"||B==="bb")T.size=gr,T.type="b-year-short";else if($==="b")T.size=gr,T.type="b-year";else if(B==="d"||B==="dd")T.size=ms,T.type="day",T.pad=/dd/.test(B);else if(B==="ddd"||B==="aaa")T.size=ms,T.type="weekday-short";else if($==="d"||$==="a")T.size=ms,T.type="weekday";else if($==="h")T.size=pr,T.type="hour",T.pad=/hh/i.test(B);else if($==="m"){B.length===3?(T.size=_r,T.type="monthname-short"):B.length===5?(T.size=_r,T.type="monthname-single"):B.length>=4&&(T.size=_r,T.type="monthname");const g=i[i.length-1];!T.type&&g&&!g.used&&g.size&(pr|Cr)&&(g.used=!0,T.size=Er,T.type="min",T.pad=/mm/.test(B)),T.type||(T.size=_r,T.type="month",T.pad=/mm/.test(B),T.indeterminate=!0)}else if($==="s"){T.size=Cr,T.type="sec",T.pad=/ss/.test(B);const g=i[i.length-1];g&&g.size&Er?T.used=!0:g&&g.indeterminate&&(delete g.indeterminate,g.size=Er,g.type="min",T.used=!0)}n.date=n.date|T.size,n.date_eval=!0,i.push(T),Ve(T,t)}else if(b===to)n.clock=12,n.date=n.date|pr,n.date_eval=!0,E.short=E.value==="A/P",Ve(E,t);else if(b===ro||b===no||b===Cs)Ve(E.value,t);else if(b===qi)n.condition=[E.value[0],parseFloat(E.value[1])];else if(b===Qi){const T=E.value.split("-"),B=T.length<2?"":T.slice(1).join("-"),$=T[0];$&&Ve($,t);const g=fo(B);g&&(n.locale=g);const P=parseInt(B,16);isFinite(P)&&P&16711680&&(P>>16&255)===6&&(n.date_system=Ln),a=!0}else if(b===eo){let T,B=E.value.toLowerCase();(T=/^color\s*(\d+)$/i.exec(B))&&(B=parseInt(T[1],10)),n.color=B}else if(b===Vi)n.scale=100,n.percent=!0,Ve("%",t);else if(b===ps)Ve(E,t),n.date||(n.dec_fractions=!0,r="frac");else if(b===io)n.exponential=!0,n.exp_plus=E.value.includes("+"),r="man",Ve({type:"exp",plus:n.exp_plus},t);else if(b===so)Ve(E,t);else if(b===oo)Ve(E,t);else if(!(b===Ji||b===Zi))throw b===Ir?new SyntaxError(`Illegal character: ${u}`):new SyntaxError(`Unknown token ${b} in ${u}`);o=E}if(n.tokensUsed=l,n.pattern=u,/^((?:\[[^\]]+\])+)(;|$)/.test(n.pattern)&&!/^\[(?:h+|m+|s+)\]/.test(n.pattern)&&Ve({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("");_n(d,n,"int");let C=0;for(let E=0;E<d.length;E++){const b=d[d.length-1-E];/^[0-9?]/.test(b)&&(C=E+1)}n.int_min=C,_n(_,n,"frac"),_n(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,"?"),_n(I,n,"num"),_n(y,n,"den"),I=I.replace(/#$/g,"?")):(_n(I,n,"num"),_n(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 E=n.tokens.findIndex(b=>b.type==="point");n.tokens.splice(E,0,{type:"int",value:"#"}),n.integer=!0,n.int_pattern=["#"],n.int_p="#"}if(n.fractions)for(let E=0;E<t.length-1;E++){const b=t[E];if(b.type!=="string"&&b.type!=="space")continue;const T=t[E+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 Up(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 ru(e,t=0){const n=Math.floor(Math.log10(e));return t>1?Math.floor(n/t)*t:n}function su(e,t=1){return t<-300?parseFloat(e.toExponential().split("e")[0]):e*10**-t}const Pp={total:1,sign:0,period:0,int:1,frac:0};function kp(e,t=!0){const n=Math.abs(e);if(!n)return Pp;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(It(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 Fn=(e,t)=>e.replace(/\./,t.decimal),iu=(e,t,n)=>{const r=Math.abs(t);let s;return e===1?s=e:s=It(e,5),[Fn(s+"",n),n.exponent,t<0?n.negative:n.positive,r<10?"0":"",r]};function ou(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=ru(i),a=su(i,o);a===10&&(a=1,o++);const l=kp(i);if(o>=-4&&o<=-1){const c=i.toPrecision(10+o).replace(/\.?0+$/,"");e.push(Fn(c,r))}else if(o===10){const c=i.toFixed(10).slice(0,12).replace(/\.$/,"");e.push(Fn(c,r))}else if(Math.abs(o)<=9)if(l.total<=11){const c=It(i,9).toFixed(l.frac);e.push(Fn(c,r))}else o===9?e.push(Math.floor(i)):o>=0&&o<9?e.push(Fn(String(It(i,9-o)),r)):e.push(...iu(a,o,r));else l.total>=12?e.push(...iu(a,o,r)):e.push(Fn(It(i,9).toFixed(l.frac),r))}return e}function pn(e,t=!1){return e==="0"?"0":e==="?"?t?" ":" ":""}const wr=86400,Fp=(e,t,n)=>n?e<_p||t>=pp:e<mp||t>=gp;function au(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,C=0,I=0,y=0,H=0,x=0,Y=0;const O=r||Zt;if(!t.text&&isFinite(t.scale)&&t.scale!==1&&(e=Up(e*t.scale)),t.exponential){let N=Math.abs(e);N&&(u=ru(N,t.int_max)),e&&!t.integer&&u++,N=su(N,u),t.int_max===1&&It(N,t.frac_max)===10&&(N=1,u++),e=e<0?-N:N,s+=Math.abs(u)}if(t.integer){const N=Math.abs(It(e,t.fractions?1:t.frac_max));c+=N<1?"":Math.floor(N)}const E=(A=n.grouping[0])!=null?A:3,b=(w=n.grouping[1])!=null?w:E;t.dec_fractions&&(l=String(It(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+=It(N*t.denominator),o==="0"&&(o="",a="",B=T);else{const D=Vc(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=wr*(e-h);if(d=Math.floor(N),Y=N-d,Math.abs(Y)<1e-6?Y=0:Y>.9999&&(Y=0,d+=1,d===wr&&(d=0,h+=1)),Y){const D=t.date&ki||t.date&Pi||t.date&Ui;(D===ki&&Y>.9995||D===Pi&&Y>.995||D===Ui&&Y>.95||!D&&Y>=.5)&&(d++,Y=0)}if(h||t.date_system){const D=Gc(e,t.date_system,n.leap1900);m=D[0],_=D[1],C=D[2]}if(d){const D=d<0?wr+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&&Fp(e,h+d/wr,n.dateSpanLarge)){if(n.dateErrorThrows)throw new Error("Date out of bounds");if(n.dateErrorNumber){const D=e<0?[O.negative]:[];return ou(D,{},e,O).join("")}return n.overflow}}const $=pn("?",n.nbsp);u<0?i="-":t.exp_plus&&(i="+");const g=[],P=(N,D,L,F)=>{const Z=!F&&N.length>D.length?L.length+N.length-D.length:L.length;N.length<D.length&&(F+=N.length-D.length);for(let K=0;K<Z;K++)g.push(N[K+F]||pn(L[K],n.nbsp));return Z};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,Z=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")ou(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(pn("#",n.nbsp));else if(F==="int")if(t.int_pattern.length===1){const K=t.int_p,ae=Math.max(t.int_min,c.length);let ue="";for(let S=ae;S>0;S--){const U=c.charAt(c.length-S),z=U?"":K.charAt(K.length-S)||K[0];let V="";if(t.grouping){const j=S-1-E;j>=0&&!(j%b)&&(V=U||z==="0"?O.group:pn("?",n.nbsp))}ue+=(U||pn(z,n.nbsp))+V}g.push(ue)}else M.int+=P(c,t.int_p,L.num,M.int);else if(F==="frac"){const K=M.frac;for(let ae=0;ae<Z;ae++)g.push(l[ae+K]||pn(L.num[ae],n.nbsp));M.frac+=Z}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 K=M.den;for(let ae=0;ae<Z;ae++){let ue=a[ae+K];if(!ue){const S=L.num[ae];"123456789".includes(S)||v&&S==="0"?(v=!0,ue=n.nbsp?" ":" "):!v&&ae===Z-1&&S==="0"&&!a?ue="1":ue=pn(S,n.nbsp)}g.push(ue)}M.den+=Z}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 K=m%100;g.push(K<10?"0":"",K)}else if(F==="month")g.push(L.pad&&_<10?"0":"",_);else if(F==="monthname-single")t.date_system===Ln?g.push(O.mmmm6[_-1].charAt(0)):g.push(O.mmmm[_-1].charAt(0));else if(F==="monthname-short")t.date_system===Ln?g.push(O.mmm6[_-1]):g.push(O.mmm[_-1]);else if(F==="monthname")t.date_system===Ln?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&&C<10?"0":"",C);else if(F==="hour"){const K=y%t.clock||(t.clock<24?t.clock:0);g.push(L.pad&&K<10?"0":"",K)}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 K=Y.toFixed(t.sec_decimals);g.push(K.slice(2,2+L.decimals))}else if(F==="ampm"){const K=y<12?0:1;L.short&&!r?g.push("AP"[K]):g.push(O.ampm[K])}else if(F==="hour-elap"){e<0&&g.push(O.negative);const K=h*24+Math.floor(Math.abs(d)/3600);g.push(String(Math.abs(K)).padStart(L.pad,"0"))}else if(F==="min-elap"){e<0&&g.push(O.negative);const K=h*1440+Math.floor(Math.abs(d)/60);g.push(String(Math.abs(K)).padStart(L.pad,"0"))}else if(F==="sec-elap"){e<0&&g.push(O.negative);const K=h*wr+Math.abs(d);g.push(String(Math.abs(K)).padStart(L.pad,"0"))}else if(F==="b-year")g.push(m+543);else if(F==="b-year-short"){const K=(m+543)%100;g.push(K<10?"0":"",K)}}return g.join("")}const xp=vr([{type:_s,value:"@",raw:"@"}]);function lu(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 Hp(e,t,n){const r=t.partitions;let s=r[3],i=null;return(typeof e=="number"||typeof e=="bigint")&&isFinite(e)&&(s=lu(e,r)),s&&s.color&&(i=s.color),i&&typeof i=="number"&&n.indexColors&&(i=Cp[i-1]||"#000"),i}function Bp(e,t,n){const r=t.partitions,s=kn(t.locale||n.locale),i=r[3]?r[3]:xp;if(typeof e=="boolean"&&(e=(s||Zt).bool[e?0:1]),e==null)return"";const o=typeof e=="bigint";if(typeof e!="number"&&!o)return au(e,i,n,s);if(!o&&!isFinite(e)){const l=s||Zt;return isNaN(e)?l.nan:(e<0?l.negative:"")+l.infinity}const a=lu(e,r);return a?au(e,a,n,s):n.overflow}function cu(e){return!!(e[0]&&e[0].percent||e[1]&&e[1].percent||e[2]&&e[2].percent||e[3]&&e[3].percent)}function uu(e){return!!(e[0]&&e[0].date||e[1]&&e[1].date||e[2]&&e[2].date||e[3]&&e[3].date)}function hu(e){const[t,n,r,s]=e;return!!((!t||t.generated)&&(!n||n.generated)&&(!r||r.generated)&&s&&s.text&&!s.generated)}const $p={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},jp=[["DMY",1],["DM",2],["MY",3],["MDY",4],["MD",5],["hmsa",6],["hma",7],["hms",8],["hm",9]];function Wp(e,t=null){var h;const[n,r]=e,s=n.frac_max,i={type:"general",isDate:uu(e),isText:hu(e),isPercent:cu(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:co.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 C=jp.find(I=>_.startsWith(I[0]));a=C?"D":"G",l=C?C[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=$p[i.type],Object.freeze(i)}function Yp(e){const[t]=e;return{year:!!(t.date&gr),month:!!(t.date&_r),day:!!(t.date&ms),hours:!!(t.date&pr),minutes:!!(t.date&Er),seconds:!!(t.date&Cr),clockType:t.clock===12?12:24}}const zp=[[Fi,/^General/i,0],[xi,/^#/,0],[Un,/^0/,0],[Hi,/^\?/,0],[Bi,/^\//,0],[ji,/^;/,0],[_s,/^@/,0],[Wi,/^\+/,0],[Yi,/^-/,0],[ps,/^\./,0],[zi,/^ /,0],[Vi,/^%/,0],[Es,/^[1-9]/,0],[Ki,/^(?:B[12])/i,0],[Ir,/^B$/,0],[Gi,/^(?:[hH]+|[mM]+|[sS]+|[yY]+|[bB]+|[dD]+|[gG]+|[aA]{3,}|e+)/,0],[Xi,/^(?:\[(h+|m+|s+)\])/i,1],[qi,/^\[(<[=>]?|>=?|=)\s*(-?[.\d]+)\]/,[1,2]],[Ji,/^\[(DBNum[0-4]?\d)\]/i,1],[Zi,/^\[(NatNum[0-4]?\d)\]/i,1],[Qi,/^\[\$([^\]]+)\]/,1],[eo,/^\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*\d+)\]/i,1],[Hc,/^\[([^\]]+)\]/,1],[to,/^(?:AM\/PM|am\/pm|A\/P)/,0],[no,/^\\(.)/,1],[ro,/^"([^"]*?)"/,1],[so,/^_(\\.|.)/,1],[io,/^[Ee]([+-])/,1],[oo,/^\*(\\.|.)/,1],[ao,/^[()]/,0],[Ir,/^[EÈÉÊËèéêëĒēĔĕĖėĘęĚěȄȅȆȇȨȩNnÑñŃńŅņŇňǸǹ["*/\\_]/,0],[Cs,/^./,0]],Vp=63,Kp=35,Gp=48,Xp=57,wo=e=>{const t=(e||"\0").charCodeAt(0);return t===Vp||t===Kp||t>=Gp&&t<=Xp};function xn(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;wo(l)?(c=!0,u=!0):l==="."&&(u=!0);const h=o[2]||"";if(c&&(!h||h===";")&&(c=!1),u&&wo(h)&&(u=!1),c&&!u)n.push({type:Rr,value:",",raw:a});else if(!c&&u)n.push({type:gs,value:",",raw:a});else if(c&&u){const d={type:gs,value:",",raw:a};n.push(d),r.push(d)}else n.push({type:$i,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&&wo(a.raw)&&(r.forEach(l=>l.type=Rr),r.length=0)}if(!i){const a=s[0];i=1,n.push({type:Cs,value:a,raw:a})}t+=i}return n}const bo=e=>{const t=e.condition;t&&t[1]<0&&(t[0]==="<"||t[0]==="<="||t[0]==="=")||e.tokens.unshift({type:"minus",volatile:!0})},du=(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 qp(e){var h;const t=[];let n=!1,r,s=null,i=0,o=!1,a=0,l=0,c=xn(e);do{if(o=vr(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=fo(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]=vr(xn("General")),t[1].generated=!0),d<3){const m=t[0],_=t[1];if(bo(m),_.condition)bo(_);else{const C=m.condition;(C[0]==="="||C[1]>=0&&(C[0]===">"||C[0]===">="))&&_.tokens.unshift({type:"minus",volatile:!0})}}else t.forEach(bo)}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]=vr(xn("General")),t[0].generated=!0),t.length<2){const d={type:"minus",volatile:!0};t.push(du(t[0],d))}if(t.length<3&&t.push(du(t[0])),t.length<4)if(s)t.push(s);else{const d=vr(xn("@"));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 fu=Object.create({});function Qt(e,t=!1){e||(e="General");let n=fu[e];if(!n)try{n=qp(e),fu[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 Jp(e,t,n={}){var o;const r=Object.assign({},zc,n),s=Qt(e,r.throws),i=(o=Co(t,r))!=null?o:t;return Bp(i,s,r)}function Zp(e,t,n){var o;const r=Object.assign({},zc,n),s=Qt(e,r.throws),i=(o=Co(t,r))!=null?o:t;return Hp(i,s,r)}function Qp(e){const t=Qt(e,!1);return uu(t.partitions)}function eE(e){const t=Qt(e,!1);return cu(t.partitions)}function tE(e){const t=Qt(e,!1);return hu(t.partitions)}function nE(e){try{return Qt(e,!0),!0}catch{return!1}}function rE(e,t={}){const n=Qt(e,!1);return n.info||(n.info=Wp(n.partitions,t==null?void 0:t.currency)),n.info}function sE(e){const t=Qt(e,!1);return t.dateInfo||(t.dateInfo=Yp(t.partitions)),t.dateInfo}const Hn=Object.freeze({AMPM:to,BREAK:ji,CALENDAR:Ki,CHAR:Cs,COLOR:eo,COMMA:$i,CONDITION:qi,DATETIME:Gi,DBNUM:Ji,DIGIT:Es,DURATION:Xi,ERROR:Ir,ESCAPED:no,EXP:io,FILL:oo,GENERAL:Fi,GROUP:Rr,HASH:xi,LOCALE:Qi,MINUS:Yi,MODIFIER:Hc,NATNUM:Zi,PAREN:ao,PERCENT:Vi,PLUS:Wi,POINT:ps,QMARK:Hi,SCALE:gs,SKIP:so,SLASH:Bi,SPACE:zi,STRING:ro,TEXT:_s,ZERO:Un}),iE=Object.freeze(Object.defineProperty({__proto__:null,addLocale:ne,dateFromSerial:wp,dateToSerial:Co,dec2frac:Vc,format:Jp,formatColor:Zp,getFormatDateInfo:sE,getFormatInfo:rE,getLocale:kn,isDateFormat:Qp,isPercentFormat:eE,isTextFormat:tE,isValidFormat:nE,parseBool:tu,parseDate:Oo,parseLocale:ho,parseNumber:So,parseTime:vs,parseValue:Lp,round:It,tokenTypes:Hn,tokenize:xn},Symbol.toStringTag,{value:"Module"})),mu="@@@",gu="@",yo="General";function oE(e){return e===mu||e===gu}function aE(e){return e==null||e===yo}const lE=(e,t)=>{if(e&&!t||!e&&t)return!1;const n=i=>{const o=xn(i);let a="",l=!1,c=!1;for(const u of o){if(u.type===Hn.POINT){l=!0;continue}if(!(c&&u.type===Hn.MINUS)&&u.type!==Hn.SKIP){if(u.type===Hn.COLOR){c=!0;continue}else c=!1;l&&u.type===Hn.ZERO||(l=!1,l||(a+=u.value||""))}}return a},r=n(e),s=n(t);return r===s},cE=new Set(["m d"]),uE=new Set(["h:mm AM/PM","hh:mm AM/PM"]),hE=new Set(["$","¥","₽","₫","NT$","€","₩","﷼"]),_u=e=>{var r,s;const t=(s=(r=Oo(e))!=null?r:vs(e))!=null?s:So(e);if(!t)return null;const{z:n}=t;if(n){if(cE.has(n)||uE.has(n)&&!/\s(A|AM|P|PM)$/i.test(e))return null;if(n.includes("#,##0")){if(/[.,]$/.test(e))return null;const i=e.replace(new RegExp(`^[${[...hE].join("")}]+`),"").trim();if(i.includes(",")&&!/^-?\d{1,3}(,\d{3})*(\.\d+)?$/.test(i))return null}}return t};function dE(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 en(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}const pu=e=>e==null||typeof e=="object"&&Object.keys(e).length===0;function fE(e,t,n){const r=en(n),s=n;for(let i=r-1;i>=e;i--)pu(s[i])?delete s[i+1]:s[i+1]=s[i];pu(t)||(s[e]=t)}function Ao(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 mE(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 gE(e,t,n){const r=n;if(en(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 To(e,t,n,r){const s=e>n;if(!s&&e+t>n)throw new Error("Invalid move operation");s?_E(e,t,n,r):pE(e,t,n,r)}function _E(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 pE(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={}){R(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){To(t,n,r,this._matrix)}moveColumns(t,n,r){this.forEach((s,i)=>{To(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){Ao(t,n,this._matrix)}removeColumns(t,n){this.forEach((r,s)=>{s&&Ao(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,Q.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 en(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=en(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=en(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 Eu(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:C,endRow:I,endColumn:y,startY:H,endY:x,startX:Y,endX:O}=i;u=_,h=C,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 EE=Eu;function CE(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 Cu(e){var n;return!e||(((n=e==null?void 0:e.v)==null?void 0:n.toString())||"").length===0&&!e.p}function No(e){return Cu(e)&&(e==null?void 0:e.coverable)!==!1}function Pt(e){var t;if(e){if(e.rgb)return new ft(e.rgb).toHexString();if(e.th!=null){const n=(t=Fc[as.OFFICE])==null?void 0:t[e.th];if(n)return new ft(n).toRgbString()}}return null}function Ru(e){return Q.isString(e)&&e.substring(0,1)==="="&&e.length>1}function RE(e){return Q.isString(e)&&e.length>0}function IE(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: ${Pt(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: ${Pt(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: ${Pt(e.ol.cl)}; `),e.ol.t&&n.indexOf("text-decoration-style")===-1&&(n+=`text-decoration-style: ${e.ol.t} `))}],["bg",()=>{e.bg&&(n+=`background: ${Pt(e.bg)}; `)}],["bd",()=>{var o,a,l,c,u,h,d,m,_,C,I,y;(o=e.bd)!=null&&o.b&&(n+=`border-bottom: ${ws((a=e.bd)==null?void 0:a.b.s)} ${(l=Pt(e.bd.b.cl))!=null?l:""}; `),(c=e.bd)!=null&&c.t&&(n+=`border-top: ${ws((u=e.bd)==null?void 0:u.t.s)} ${(h=Pt(e.bd.t.cl))!=null?h:""}; `),(d=e.bd)!=null&&d.r&&(n+=`border-right: ${ws((m=e.bd)==null?void 0:m.r.s)} ${(_=Pt(e.bd.r.cl))!=null?_:""}; `),(C=e.bd)!=null&&C.l&&(n+=`border-left: ${ws((I=e.bd)==null?void 0:I.l.s)} ${(y=Pt(e.bd.l.cl))!=null?y:""}; `)}],["cl",()=>{e.cl&&(n+=`color: ${Pt(e.cl)}; `)}],["va",()=>{e.va===dn.SUBSCRIPT?n+="vertical-align: sub; ":e.va===dn.SUPERSCRIPT&&(n+="vertical-align: super; ")}],["td",()=>{e.td===ar.LEFT_TO_RIGHT?n+="direction: ltr; ":e.td===ar.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===vt.LEFT?n+="text-align: left; ":e.ht===vt.RIGHT?n+="text-align: right; ":e.ht===vt.CENTER?n+="text-align: center; ":e.ht===vt.JUSTIFIED&&(n+="text-align: justify; ")}],["vt",()=>{e.vt===un.BOTTOM?n+="vertical-align: bottom; ":e.vt===un.TOP?n+="vertical-align: top; ":e.vt===un.MIDDLE&&(n+="vertical-align: middle; ")}],["tb",()=>{e.tb===hn.CLIP?n+="white-space: nowrap; overflow-x: hidden; ":e.tb===hn.WRAP&&(n+="white-space: normal;")}],["pd",()=>{var u,h,d,m,_,C,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}; `),(C=e.pd)!=null&&C.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 ws(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 SE(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 OE(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 vE(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 wE(e,t){return{startRow:e,endRow:e,startColumn:t,endColumn:t}}function Mo(e){if(Ru(e))return{f:e,v:null,p:null};if(Uc(e)){if(typeof e=="string"){const t=_u(e);if(t&&t.z)return{v:t.v,p:null,f:null,s:{n:{pattern:t.z||yo}}}}return{v:e,p:null,f:null}}return Lc(e),e}function bE(e,t){const n=new ct,{startRow:r,startColumn:s,endRow:i,endColumn:o}=t;if(Q.isArray(e))for(let a=0;a<=i-r;a++)for(let l=0;l<=o-s;l++)n.setValue(a+r,l+s,Mo(e[a][l]));else new ct(e).forValue((l,c,u)=>{n.setValue(l,c,Mo(u))});return n.getMatrix()}function Do(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=>Do(e[n],t[n])):e===t:!1}function Iu(e,t){const n=e.ts||{},r=t.ts||{};return e.sId!==t.sId?!1:Do(n,r)}function yE(e,t){return t.some(n=>e.indexOf(n)>-1)}var bs={exports:{}},AE=bs.exports,Su;function TE(){return Su||(Su=1,(function(e,t){(function(n,r){e.exports=r()})(AE,(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",C="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",E={};E[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();E[L]&&(D=L),w&&(E[L]=w,D=L);var F=A.split("-");if(!D&&F.length>1)return M(F[0])}else{var Z=A.name;E[Z]=A,D=Z}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 Z=F[2]-1||0,K=(F[7]||"0").substring(0,3);return L?new Date(Date.UTC(F[1],Z,F[3]||1,F[4]||0,F[5]||0,F[6]||0,K)):new Date(F[1],Z,F[3]||1,F[4]||0,F[5]||0,F[6]||0,K)}}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()!==C},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),Z=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)},K=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)},ae=this.$W,ue=this.$M,S=this.$D,U="set"+(this.$u?"UTC":"");switch(F){case m:return L?Z(1,0):Z(31,11);case h:return L?Z(1,ue):Z(0,ue+1);case u:var z=this.$locale().weekStart||0,V=(ae<z?ae+7:ae)-z;return Z(L?S-V:S+(6-V),ue);case c:case _:return K(U+"Hours",0);case l:return K(U+"Minutes",1);case a:return K(U+"Seconds",2);case o:return K(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":""),Z=(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],K=L===c?this.$D+(N-this.$W):N;if(L===h||L===m){var ae=this.clone().set(_,1);ae.$d[Z](K),ae.init(),this.$d=ae.set(_,Math.min(this.$D,ae.daysInMonth())).$d}else Z&&this.$d[Z](K);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),Z=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 Z(1);if(F===u)return Z(7);var K=(D={},D[a]=r,D[l]=s,D[o]=n,D)[F]||1,ae=this.$d.getTime()+w*K;return g.w(ae,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||C;var L=w||"YYYY-MM-DDTHH:mm:ssZ",F=g.z(this),Z=this.$H,K=this.$m,ae=this.$M,ue=D.weekdays,S=D.months,U=D.meridiem,z=function(W,ee,te,k){return W&&(W[ee]||W(N,L))||te[ee].slice(0,k)},V=function(W){return g.s(Z%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 ae+1;case"MM":return g.s(ae+1,2,"0");case"MMM":return z(D.monthsShort,ae,S,3);case"MMMM":return z(S,ae);case"D":return N.$D;case"DD":return g.s(N.$D,2,"0");case"d":return String(N.$W);case"dd":return z(D.weekdaysMin,N.$W,ue,2);case"ddd":return z(D.weekdaysShort,N.$W,ue,3);case"dddd":return ue[N.$W];case"H":return String(Z);case"HH":return g.s(Z,2,"0");case"h":return V(1);case"hh":return V(2);case"a":return j(Z,K,!0);case"A":return j(Z,K,!1);case"m":return String(K);case"mm":return g.s(K,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,Z=g.p(N),K=$(w),ae=(K.utcOffset()-this.utcOffset())*r,ue=this-K,S=function(){return g.m(F,K)};switch(Z){case m:L=S()/12;break;case h:L=S();break;case d:L=S()/3;break;case u:L=(ue-ae)/6048e5;break;case c:L=(ue-ae)/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 E[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=E[O],$.Ls=E,$.p={},$}))})(bs)),bs.exports}var NE=TE();const Bt=Et(NE);var ys={exports:{}},ME=ys.exports,Ou;function DE(){return Ou||(Ou=1,(function(e,t){(function(n,r){e.exports=r()})(ME,(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)}}}))})(ys)),ys.exports}var LE=DE();const UE=Et(LE);var As={exports:{}},PE=As.exports,vu;function kE(){return vu||(vu=1,(function(e,t){(function(n,r){e.exports=r()})(PE,(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 C(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 E=x[O],b=_[E],T=b&&b[0],B=b&&b[1];x[O]=B?{regex:T,parser:B}:E.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 Z=L.hours;F?Z<12&&(L.hours+=12):Z===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 E=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 Z=C(D)(N),K=Z.year,ae=Z.month,ue=Z.day,S=Z.hours,U=Z.minutes,z=Z.seconds,V=Z.milliseconds,j=Z.zone,W=Z.week,ee=new Date,te=ue||(K||ae?1:ee.getDate()),k=K||ee.getFullYear(),G=0;K&&!ae||(G=ae>0?ae-1:ee.getMonth());var q,re=S||0,ge=U||0,Ee=z||0,X=V||0;return j?new Date(Date.UTC(k,G,te,re,ge,Ee,X+60*j.offset*1e3)):L?new Date(Date.UTC(k,G,te,re,ge,Ee,X)):(q=new Date(k,G,te,re,ge,Ee,X),W&&(q=F(q).week(W).toDate()),q)}catch{return new Date("")}})(E,B,b,H),this.init(),v&&v!==!0&&(this.$L=this.locale(v).$L),P&&E!=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)}}}))})(As)),As.exports}var FE=kE();const xE=Et(FE);var Ts={exports:{}},HE=Ts.exports,wu;function BE(){return wu||(wu=1,(function(e,t){(function(n,r){e.exports=r()})(HE,(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,_,C){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(!C)return x;var Y=I.weekStart;return x.map((function(O,E){return x[(E+(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(_,C,I){return C||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)}}}))})(Ts)),Ts.exports}var $E=BE();const jE=Et($E);var Ns={exports:{}},WE=Ns.exports,bu;function YE(){return bu||(bu=1,(function(e,t){(function(n,r){e.exports=r()})(WE,(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,_,C){var I=C&&C.toUpperCase();return _||d[C]||n[C]||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)}}}))})(Ns)),Ns.exports}var zE=YE();const VE=Et(zE);var Ms={exports:{}},KE=Ms.exports,yu;function GE(){return yu||(yu=1,(function(e,t){(function(n,r){e.exports=r()})(KE,(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(C){var I={date:C,utc:!0,args:arguments};return new o(I)},l.utc=function(C){var I=a(this.toDate(),{locale:this.$L,utc:!0});return C?I.add(this.utcOffset(),n):I},l.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var c=l.parse;l.parse=function(C){C.utc&&(this.$u=!0),this.$utils().u(C.$offset)||(this.$offset=C.$offset),c.call(this,C)};var u=l.init;l.init=function(){if(this.$u){var C=this.$d;this.$y=C.getUTCFullYear(),this.$M=C.getUTCMonth(),this.$D=C.getUTCDate(),this.$W=C.getUTCDay(),this.$H=C.getUTCHours(),this.$m=C.getUTCMinutes(),this.$s=C.getUTCSeconds(),this.$ms=C.getUTCMilliseconds()}else u.call(this)};var h=l.utcOffset;l.utcOffset=function(C,I){var y=this.$utils().u;if(y(C))return this.$u?0:y(this.$offset)?h.call(this):this.$offset;if(typeof C=="string"&&(C=(function(O){O===void 0&&(O="");var E=O.match(r);if(!E)return null;var b=(""+E[0]).match(s)||["-",0,0],T=b[0],B=60*+b[1]+ +b[2];return B===0?0:T==="+"?B:-B})(C),C===null))return this;var H=Math.abs(C)<=16?60*C:C;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(C){var I=C||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,I)},l.valueOf=function(){var C=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*C},l.isUTC=function(){return!!this.$u},l.toISOString=function(){return this.toDate().toISOString()},l.toString=function(){return this.toDate().toUTCString()};var m=l.toDate;l.toDate=function(C){return C==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():m.call(this)};var _=l.diff;l.diff=function(C,I,y){if(C&&this.$u===C.$u)return _.call(this,C,I,y);var H=this.local(),x=a(C).local();return _.call(H,x,I,y)}}}))})(Ms)),Ms.exports}var XE=GE();const qE=Et(XE);var Ds={exports:{}},JE=Ds.exports,Au;function ZE(){return Au||(Au=1,(function(e,t){(function(n,r){e.exports=r()})(JE,(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")}}}))})(Ds)),Ds.exports}var QE=ZE();const e0=Et(QE);var Ls={exports:{}},t0=Ls.exports,Tu;function n0(){return Tu||(Tu=1,(function(e,t){(function(n,r){e.exports=r()})(t0,(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)}}}))})(Ls)),Ls.exports}var r0=n0();const s0=Et(r0);var Us={exports:{}},i0=Us.exports,Nu;function o0(){return Nu||(Nu=1,(function(e,t){(function(n,r){e.exports=r()})(i0,(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}}}))})(Us)),Us.exports}var a0=o0();const l0=Et(a0);Bt.extend(xE),Bt.extend(UE),Bt.extend(e0),Bt.extend(jE),Bt.extend(s0),Bt.extend(l0),Bt.extend(qE),Bt.extend(VE);function Ps(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 c0(e){if(e==null)return!1;const t=e.bullet;return(t==null?void 0:t.listId)!=null}function u0(e){if(e==null)return!1;const t=e.paragraphStyle;return Mu(t)}function Mu(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 Du(e,t,n){return e.slice(0,t)+n+e.slice(t)}function Lu(e,t,n){return t>n?e:e.slice(0,t)+e.slice(n)}function h0(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 d0(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 f0(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 m0(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 g0(...e){let t;return e.length===1&&Array.isArray(e[0])?t=e[0]:t=e,ts({},...t)}const Ue=Symbol("newer"),Ze=Symbol("older");class _0{constructor(t){R(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 p0{constructor(t){R(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 E0{constructor(t){R(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}}}Od=Ue,Sd=Ze;class Uu{constructor(t,n){R(this,"key");R(this,"value");R(this,Od);R(this,Sd);this.key=t,this.value=n,this[Ue]=void 0,this[Ze]=void 0}toJSON(){return{key:this.key,value:this.value}}}class ks{constructor(...t){R(this,"_keymap");R(this,"size",0);R(this,"limit");R(this,"oldest");R(this,"newest");R(this,"_onShiftListeners",[]);if(br.hasLength(t,1)){if(br.isNumber(t[0])){const n=t[0];this._initialize(n,void 0);return}if(br.isIterable(t[0])){const n=t[0];this._initialize(0,n);return}return}if(br.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(()=>er(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 Uu(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 Uu(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 _0(this.oldest)}values(){return new p0(this.oldest)}entries(){return this[Symbol.iterator]()}[Symbol.iterator](){return new E0(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 br{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]"}}function C0(e){let t=0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(r<65||r>90)return-1;t=t*26+(r-64)}return t}const Lo=1048576,Uo=16384,R0={sheetId:"",range:{startRow:-1,endRow:-1,startColumn:-1,endColumn:-1}},I0={startRow:-1,startColumn:-1,endRow:-1,endColumn:-1},S0={startRow:0,startColumn:0,endRow:0,endColumn:0},O0={row:0,column:0},it={ff:"Arial",fs:11,it:ce.FALSE,bl:ce.FALSE,ul:{s:ce.FALSE},st:{s:ce.FALSE},ol:{s:ce.FALSE},tr:{a:0,v:ce.FALSE},td:ar.UNSPECIFIED,cl:{rgb:"#000000"},bg:{rgb:"#fff"},ht:vt.UNSPECIFIED,vt:un.UNSPECIFIED,tb:hn.UNSPECIFIED,pd:{t:0,r:0,b:0,l:0},n:null,bd:{b:null,l:null,r:null,t:null}},Pu={id:"default_slide",title:"defaultSlide",pageSize:{width:300,height:300}},v0=[ti,_a,ni],w0={[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},Bn=4,b0={[Je.HEADING_1]:{spaceAbove:{v:20},spaceBelow:{v:6+Bn}},[Je.HEADING_2]:{spaceAbove:{v:18},spaceBelow:{v:6+Bn}},[Je.HEADING_3]:{spaceAbove:{v:16},spaceBelow:{v:6+Bn}},[Je.HEADING_4]:{spaceAbove:{v:14},spaceBelow:{v:4+Bn}},[Je.HEADING_5]:{spaceAbove:{v:12},spaceBelow:{v:4+Bn}},[Je.NORMAL_TEXT]:{spaceAbove:{v:0},spaceBelow:{v:0}},[Je.TITLE]:{spaceAbove:{v:0},spaceBelow:{v:3+Bn}},[Je.SUBTITLE]:{spaceAbove:{v:0},spaceBelow:{v:16}},[Je.NAMED_STYLE_TYPE_UNSPECIFIED]:null},y0="univer-sheets-chart-print-chart",A0="univer-docs-drawing-printing";var ku=(e=>(e.ARRAY_CONVERTOR="ARRAY_CONVERTOR",e.MATRIX_CONVERTOR="MATRIX_CONVERTOR",e))(ku||{});const T0={[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 Fs(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 ce.FALSE;switch(e){case"bl":case"it":{if(o[e]===ce.FALSE)return ce.FALSE;break}case"ul":case"st":{if(o[e].s===ce.FALSE)return ce.FALSE;break}default:throw new Error(`unknown style key: ${e} in IStyleBase`)}r+=l-a}return t.dataStream.indexOf(`\r
4
- `)===r?ce.TRUE:ce.FALSE}const Yr=class Yr{constructor(t,n,r){R(this,"_range");R(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=Q.numToWord(r+1)+(t+1),o=Q.numToWord(s+1)+(n+1)):(i=Q.numToWord(s+1)+(n+1),o=Q.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 Yr(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?Fs("ul",t.body)===ce.TRUE?{s:ce.TRUE}:{s:ce.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?Fs("st",t.body)===ce.TRUE?{s:ce.TRUE}:{s:ce.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?Fs("it",t.body)===ce.TRUE?is.ITALIC:is.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?Fs("bl",t.body)===ce.TRUE?os.BOLD:os.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()===hn.WRAP?ce.TRUE:ce.FALSE}getWrapStrategies(){return this._getStyles("tb")}getWrapStrategy(){return this.getWrapStrategies()[0][0]}forEach(t){Yr.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]}))}};R(Yr,"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 $n=Yr;function Fu(e,t,n=0,r=e.length-1,s=N0){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));Fu(e,t,m,_,s)}const i=e[t];let o=n,a=r;for(yr(e,n,t),s(e[r],i)>0&&yr(e,n,r);o<a;){for(yr(e,o,a),o++,a--;s(e[o],i)<0;)o++;for(;s(e[a],i)>0;)a--}s(e[n],i)===0?yr(e,n,a):(a++,yr(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}}function yr(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function N0(e,t){return e<t?-1:e>t?1:0}class xs{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(!Bs(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;Bs(t,l)&&(n.leaf?r.push(a):ko(t,l)?this._all(a,r):i.push(a))}n=i.pop()}return r}collides(t){let n=this.data;if(!Bs(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(Bs(t,o)){if(n.leaf||ko(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=Wn([]),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=M0(t,r.children,n);if(u!==-1)return r.children.splice(u,1),i.push(r),this._condense(i),this}!c&&!r.leaf&&ko(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=Wn(t.slice(n,r+1)),jn(a,this.toBBox),a;s||(s=Math.ceil(Math.log(i)/Math.log(o)),o=Math.ceil(i/Math.pow(o,s-1))),a=Wn([]),a.leaf=!1,a.height=s;const l=Math.ceil(i/o),c=l*Math.ceil(Math.sqrt(o));xu(t,n,r,c,this.compareMinX);for(let u=n;u<=r;u+=c){const h=Math.min(u+c-1,r);xu(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 jn(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=Po(c),h=U0(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),Tr(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=Wn(r.children.splice(o,r.children.length-o));a.height=r.height,a.leaf=r.leaf,jn(r,this.toBBox),jn(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(r,a)}_splitRoot(t,n){this.data=Wn([t,n]),this.data.height=t.height+1,this.data.leaf=!1,jn(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=Ar(t,0,a,this.toBBox),c=Ar(t,a,r,this.toBBox),u=P0(l,c),h=Po(l)+Po(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:D0,i=t.leaf?this.compareMinY:L0,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=Ar(t,0,n,i),a=Ar(t,r-n,r,i);let l=Hs(o)+Hs(a);for(let c=n;c<r-n;c++){const u=t.children[c];Tr(o,t.leaf?i(u):u),l+=Hs(o)}for(let c=r-n-1;c>=n;c--){const u=t.children[c];Tr(a,t.leaf?i(u):u),l+=Hs(a)}return l}_adjustParentBBoxes(t,n,r){for(let s=r;s>=0;s--)Tr(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():jn(t[n],this.toBBox)}}function M0(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 jn(e,t){Ar(e,0,e.children.length,t,e)}function Ar(e,t,n,r,s){s||(s=Wn(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];Tr(s,e.leaf?r(o):o)}return s}function Tr(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 D0(e,t){return e.minX-t.minX}function L0(e,t){return e.minY-t.minY}function Po(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function Hs(e){return e.maxX-e.minX+(e.maxY-e.minY)}function U0(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 P0(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 ko(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function Bs(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function Wn(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function xu(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;Fu(e,o,t,n,s),i.push(t,o,o,n)}}function k0(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=Hu(s.startRow,n,s.startColumn,t,a),c=Hu(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 Hu(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 Fo(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 F0(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 x0(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 H0(e){const t=Fo(e),n=F0(t);return x0(n)}function B0(e,t){const n=[];return e.forEach(r=>{n.push(...$t.subtract(r,t))}),$t.mergeRanges(n)}function Bu(e,t){const n=$u(e.startRow,e.endRow,t.startRow,t.endRow),r=$u(e.startColumn,e.endColumn,t.startColumn,t.endColumn);if(!n||!r)return null;const[s,i]=n,[o,a]=r,l=$0(e.rangeType,t.rangeType,s,i,o,a);return{startRow:s,endRow:i,startColumn:o,endColumn:a,rangeType:l}}function $u(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 $0(e,t,n,r,s,i){const o=e!==void 0?e:ju(n,r,s,i),a=t!==void 0?t:ju(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 ju(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 Wt=class Wt{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=Number.isNaN(t.startRow)?0:t.startRow,s=Number.isNaN(t.endRow)?Lo-1:t.endRow,i=Number.isNaN(t.startColumn)?0:t.startColumn,o=Number.isNaN(t.endColumn)?Uo-1:t.endColumn,a=Number.isNaN(n.startRow)?0:n.startRow,l=Number.isNaN(n.endRow)?Lo-1:n.endRow,c=Number.isNaN(n.startColumn)?0:n.startColumn,u=Number.isNaN(n.endColumn)?Uo-1:n.endColumn,h=Math.abs(i+o-c-u),d=Math.abs(i-o)+Math.abs(c-u),m=Math.abs(r+s-a-l),_=Math.abs(r-s)+Math.abs(a-l);return h<=d&&m<=_}static doAnyRangesIntersect(t,n){const r=new xs;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 Wt.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=Wt.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 H0(t)}static splitIntoGrid(t){return Fo(t)}static subtractMulti(t,n){if(!n.length)return t;let r=t;return n.forEach(s=>{r=B0(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)}};R(Wt,"getRelativeRange",(t,n)=>({startRow:t.startRow-n.startRow,endRow:t.endRow-t.startRow,startColumn:t.startColumn-n.startColumn,endColumn:t.endColumn-t.startColumn})),R(Wt,"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})),R(Wt,"moveHorizontal",(t,n=0,r=0)=>({...t,startColumn:t.startColumn+n,endColumn:t.endColumn+n+r})),R(Wt,"moveVertical",(t,n=0,r=0)=>({...t,startRow:t.startRow+n,endRow:t.endRow+n+r})),R(Wt,"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 $t=Wt;function j0(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=W0(n);o.area>r&&(r=o.area,s={startColumn:o.start,startRow:i-o.height+1,endColumn:o.end,endRow:i})}return s}function W0(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 Y0(e,t){$n.foreach(t,(n,r)=>{e[n][r]=void 0})}function z0(e,t){const n=e.toFullArray(),r=[];for(;;){const s=j0(n,t);if(!s)break;r.push(s),Y0(n,s)}return r}class V0{constructor(t,n){R(this,"_values",[]);R(this,"_keys",[]);R(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 xo(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 K0(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 $s=65,Wu=90,G0=97;function X0(e){const t=Wu-$s+1;let n="";for(;e>=0;)n=String.fromCharCode(e%t+$s)+n,e=Math.floor(e/t)-1;return n}function Yu(e,t){let n="";for(;t>0;)n+=e,t--;return n}function q0(e,t=!1){const n=Wu-$s+1;let r=G0;t&&(r=$s);const s=String.fromCharCode(e%n+r),i=Math.floor(e/n)+1;return Yu(s,i)}function J0(e,t){return e.zIndex>t.zIndex?1:e.zIndex===t.zIndex?0:-1}function Z0(e,t){return e.zIndex>t.zIndex?-1:e.zIndex===t.zIndex?0:1}function Nr(e="index",t=1){return(n,r)=>n[e]>r[e]?t:n[e]===r[e]?0:-t}function Mr(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&&Q.isEmptyObject(o)&&r.sId==null)continue;if(n.length===0){n.push(r);continue}const a=n.pop();Iu(r,a)&&Q.hasIntersectionBetweenTwoRanges(a.st,a.ed,r.st,r.ed)?n.push({...r,st:a.st,ed:i}):n.push(a,r)}return n}function zu(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 C={...h,st:r+n,ed:m+n};i.push(C)}else h.st+=n,h.ed+=n,a||(a=!0,i.push(...l)),i.push(h)}a||(a=!0,i.push(...l)),e.textRuns=Mr(i)}function Vu(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(Nr("startIndex"))}}function Ku(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(Nr("startIndex"))}}function Gu(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(Nr("startIndex"))}s.length&&!e.customBlocks&&(e.customBlocks=s)}function Xu(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(Nr("startIndex"))}}const qu="$",Ju=e=>e.split(qu)[0];function Ho(e){if(e.length<=1)return e;e.sort((s,i)=>s.startIndex-i.startIndex);const t=[];let n={...e[0]};n.rangeId=Ju(n.rangeId);for(let s=1;s<e.length;s++){const i=e[s];i.rangeId=Ju(i.rangeId),i.rangeId===n.rangeId&&Oa(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}${qu}${r[a]}`,r[a]=r[a]+1):r[a]=1}return t}function Bo(e,t){const n=e.findIndex(s=>s.startIndex<t&&s.endIndex>=t),r=e[n];r&&e.splice(n,1,{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:r.startIndex,endIndex:t-1,properties:{...r.properties}},{rangeId:r.rangeId,rangeType:r.rangeType,startIndex:t,endIndex:r.endIndex,properties:{...r.properties}})}function Zu(e){if(e.length<=1)return e;e.sort((r,s)=>r.startIndex-s.startIndex);const t=[];let n={...e[0]};for(let r=1;r<e.length;r++){const s=e[r];s.id===n.id&&n.endIndex+1>=s.startIndex?n.endIndex=s.endIndex:(t.push(n),n={...s})}return t.push(n),t}function $o(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 Q0(e,t,n,r){e.customRanges||(e.customRanges=[]);const{customRanges:s}=e;Bo(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=Ho(s)}function eC(e,t,n,r){e.customDecorations||(e.customDecorations=[]);const{customDecorations:s}=e;$o(s,r);for(let o=0,a=s.length;o<a;o++){const l=s[o],{startIndex:c}=l;c>=r&&(l.startIndex+=n,l.endIndex+=n)}const i=[];if(t.customDecorations){for(let o=0,a=t.customDecorations.length;o<a;o++){const l=t.customDecorations[o];l.startIndex+=r,l.endIndex+=r,i.push(l)}s.push(...i)}e.customDecorations=Zu(s)}function Qu(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 eh(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 th(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 nh(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 rh(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=Ps(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 tC(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=Ps(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=Ho(a)}return o}function nC(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 _=Ps(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 sh=(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))(sh||{}),kt=(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))(kt||{});const js={"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}},Yn=e=>[...e,...e,...e].map((t,n)=>({glyphFormat:` %${n+1}`,glyphSymbol:t,bulletAlignment:lr.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*n}}})),zn=e=>e.map((t,n)=>({...t,bulletAlignment:lr.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*n}}})),ih=(e,t)=>new Array(9).fill(0).map((n,r)=>({glyphFormat:` %${r+1}`,glyphSymbol:e,bulletAlignment:lr.START,textStyle:{fs:16},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*r},textStyle:t}})),Dr={BULLET_LIST:{listType:"BULLET_LIST",nestingLevel:Yn(["●","○","■"])},BULLET_LIST_1:{listType:"BULLET_LIST",nestingLevel:Yn(["❖","➢","■"])},BULLET_LIST_2:{listType:"BULLET_LIST",nestingLevel:Yn(["✔","●","◆"])},BULLET_LIST_3:{listType:"BULLET_LIST",nestingLevel:Yn(["■","◆","○"])},BULLET_LIST_4:{listType:"BULLET_LIST",nestingLevel:Yn(["✧","○","■"])},BULLET_LIST_5:{listType:"BULLET_LIST",nestingLevel:Yn(["➢","○","◆"])},ORDER_LIST:{listType:"ORDER_LIST",nestingLevel:zn([{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:zn([{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:zn(["%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:zn([{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:zn([{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:zn([{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:ih("☐")},CHECK_LIST_CHECKED:{listType:"CHECK_LIST_CHECKED",nestingLevel:ih("☑",{st:{s:ce.TRUE}})}},Ws=e=>{const{glyphFormat:t,glyphType:n}=e,r=Q.deepClone(Dr.ORDER_LIST);return r.nestingLevel[0].glyphFormat=t,r.nestingLevel[0].glyphType=n,r},rC={ORDER_LIST_QUICK_2:Ws(js["a)"]),ORDER_LIST_QUICK_3:Ws(js["a."]),ORDER_LIST_QUICK_4:Ws(js["i."]),ORDER_LIST_QUICK_6:Ws(js["I."])};Object.assign(Dr,rC);const sC={"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 iC(e,t,n,r,s){const i=oC(e,t,n,r,s),o=aC(e,t,n,r,s),a=lC(e,t,n,r,s),l=cC(e,t,n,r,s),c=uC(e,t,n,r,s),u=hC(e,t,n,r),h=dC(e,t,n,r,s);return{dataStream:"",textRuns:i,paragraphs:o,sectionBreaks:a,customBlocks:l,tables:c,customRanges:u,customDecorations:h}}function oC(e,t,n,r,s){const{textRuns:i}=e,{textRuns:o}=t;if(i==null||o==null)return;const a=Qu(e,n,r);if(s!==Re.REPLACE){const l=oh(o,a,s);t.textRuns=l}return zu(e,t,n,r),a}function oh(e,t,n){if(t.length===0)return e;e=Q.deepClone(e),t=Q.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:C}=e[o],{st:I,ed:y,ts:H,sId:x}=t[a];let Y;if(n===Re.COVER?Y={...H,...C}:Y={...C},_<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?{...C}:{...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 E={st:Math.min(_,y),ed:Math.max(_,y),ts:_<y?{...H}:{...C},sId:_<y?x:void 0};l=E.ed>E.st?E: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)),Mr(r)}function aC(e,t,n,r,s){const{paragraphs:i}=e,{paragraphs:o}=t;if(i==null||o==null)return;const a=eh(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:C,paragraphStyle:I,bullet:y}=_;let H,x;if(s===Re.COVER?(H={...I,...h},x={listId:"",listType:kt.BULLET_LIST,nestingLevel:0,textStyle:{},...y,...d}):(H={...h,...I},x={listId:"",listType:kt.BULLET_LIST,nestingLevel:0,textStyle:{},...d,...y}),u===C){m.push({startIndex:u,paragraphStyle:H,bullet:x});break}}l.push(...m),m=[]}t.paragraphs=l}return Vu(e,t,n,r),a}function lC(e,t,n,r,s){const{sectionBreaks:i}=e,{sectionBreaks:o}=t;if(i==null||o==null)return;const a=th(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 Ku(e,t,n,r),a}function cC(e,t,n,r,s){const{customBlocks:i=[]}=e,{customBlocks:o}=t;if(i==null||o==null)return;const a=nh(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 Gu(e,t,n,r),i.length&&!e.customBlocks&&(e.customBlocks=i),a}function uC(e,t,n,r,s){const{tables:i}=e,{tables:o}=t;if(i==null||o==null)return;const a=rh(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:C}=m;if(_>=u&&C<=h){s===Re.COVER?d.push({...m,...c}):d.push({...c,...m});break}}l.push(...d),d=[]}t.tables=l}return Xu(e,t,n,r),a}function hC(e,t,n,r,s){e.customRanges||(e.customRanges=[]),Bo(e.customRanges,r),Bo(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=Ho(l),u):[]}function dC(e,t,n,r,s){e.customDecorations||(e.customDecorations=[]),$o(e.customDecorations,r),$o(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===fn.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=Zu(o),i}var jo=(e=>(e[e.copy=0]="copy",e[e.cut=1]="cut",e))(jo||{});function Ys(e,t,n,r=!0){const{textRuns:s}=e;if(s){const i=[];for(const o of s){const a=Q.deepClone(o),{st:l,ed:c}=a;Q.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 Mr(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 ah(e,t,n){const{tables:r=[]}=e,s=[];for(const i of r){const o=Q.deepClone(i),{startIndex:a,endIndex:l}=o;a>=t&&l<=n&&s.push({...o,startIndex:a-t,endIndex:l-t})}return s}function lh(e,t,n){const{paragraphs:r=[]}=e,s=[];for(const i of r){const{startIndex:o}=i;if(o>=t&&o<n){const a=Q.deepClone(i);s.push(a)}}if(s.length)return s.map(i=>({...i,startIndex:i.startIndex-t}))}function fC(e,t,n){const{sectionBreaks:r=[]}=e,s=[];for(const i of r){const{startIndex:o}=i;o>=t&&o<=n&&s.push(Q.deepClone(i))}if(s.length)return s.map(i=>({...i,startIndex:i.startIndex-t}))}function ch(e,t,n){const{customBlocks:r=[]}=e,s=[];for(const i of r){const{startIndex:o}=i;o>=t&&o<n&&s.push(Q.deepClone(i))}if(s.length)return s.map(i=>({...i,startIndex:i.startIndex-t}))}function bt(e,t,n,r=!0,s=1){const{dataStream:i}=e,o={dataStream:i.slice(t,n)};o.textRuns=Ys(e,t,n,r);const a=ah(e,t,n);if(a.length&&(o.tables=a),o.paragraphs=lh(e,t,n),s===1){const c=hh(e,t,n);c?o.customDecorations=c:r&&(o.customDecorations=[])}const{customRanges:l}=uh(e,t,n);return l?o.customRanges=l:r&&(o.customRanges=[]),o.customBlocks=ch(e,t,n),o}function mC(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 uh(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 hh(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=Q.deepClone(i);s.push({...o,startIndex:Math.max(o.startIndex-t,0),endIndex:Math.min(o.endIndex,n-1)-t})}}),s}function gC(e,t,n){return e==null||t==null?e!=null?e:t:oh(e,t,n)}function _C(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 pC(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 Wo(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=gC(l,s,n),r.customRanges=_C(u,o,n);const d=pC(h,a,n);d.length&&(r.customDecorations=d);const m=[];let _=0,C=0;for(;_<i.length&&C<c.length;){const I=i[_],y=c[C],{startIndex:H}=I,{startIndex:x}=y;H===x?(m.push(Q.deepMerge(I,y)),_++,C++):H<x?(m.push(Q.deepClone(I)),_++):(m.push(Q.deepClone(y)),C++)}return _<i.length&&m.push(...i.slice(_)),C<c.length&&m.push(...c.slice(C)),m.length&&(r.paragraphs=m),r}function EC(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 Vn{constructor(t){R(this,"_index",0);R(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?Q.deepClone({...n,len:t}):Q.deepClone({...n,len:t,body:bt(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 dh(e,t,n){const{dataStream:r}=e,s=n,i=n+t,o=Qu(e,t,n),a=eh(e,t,n),l=th(e,t,n),c=nh(e,t,n),u=rh(e,t,n),h=tC(e,t,n),d=nC(e,t,n);let m="";return r&&(e.dataStream=Lu(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 fh(e,t,n,r){e.dataStream=Du(e.dataStream,r,t.dataStream),zu(e,t,n,r),Vu(e,t,n,r),Ku(e,t,n,r),Gu(e,t,n,r),Xu(e,t,n,r),Q0(e,t,n,r),eC(e,t,n,r)}function CC(e,t,n,r,s=Re.COVER){return iC(e,t,n,r,s)}function RC(e,t,n){return t<=0?{dataStream:""}:dh(e,t,n)}function IC(e,t,n,r){n!==0&&fh(e,t,n,r)}function SC(e,t){const n=new cn;return n.reset(),t.forEach(r=>{const s=Q.deepClone(r);switch(s.t){case J.RETAIN:{const{coverType:i,body:o,len:a}=s;o!=null&&CC(e,o,a,n.cursor,i),n.moveCursor(a);break}case J.INSERT:{const{body:i,len:o}=s;IC(e,i,o,n.cursor),n.moveCursor(o);break}case J.DELETE:{const{len:i}=s;RC(e,i,n.cursor);break}default:throw new Error(`Unknown action type for action: ${s}.`)}}),e}function OC(e,t,n,r,s){if(e==null||t==null)return t;if(e.length===0||t.length===0)return[];t=Q.deepClone(t),e=Q.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:C,ed:I,ts:y}=t[l],{st:H,ed:x,ts:Y,sId:O}=e[c];let E={};if(s===0)E={...y},n===Re.COVER&&r===Re.REPLACE&&Y&&(E=Object.assign({},Y,E));else if(E={...y},n===Re.REPLACE){if(r===Re.REPLACE)E={...Y};else if(y&&Y){const b=Object.keys(y);for(const T of b)Y[T]&&delete E[T]}}else if(r===Re.REPLACE){if(Y){const b=Object.keys(Y);for(const T of b)Y[T]!==void 0&&(E[T]=Y[T])}}else if(Y){const b=Object.keys(Y);for(const T of b)E[T]!==void 0&&delete E[T]}if(I<H)h()||i.push(t[l]),l++;else if(x<C)h()||i.push(e[c]),c++;else{const b={st:Math.min(C,H),ed:Math.max(C,H),ts:C<H?{...y}:{...Y}};b.ed>b.st&&i.push(),i.push({st:Math.max(C,H),ed:Math.min(I,x),ts:E,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(_)),Mr(i,!0)}function vC(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?[Q.deepClone(i)]:[Q.deepClone(o)];if(r===Re.REPLACE){const a=Q.deepClone(o);return s===1&&Object.assign(a,Q.deepClone(i)),[a]}else{const a=Q.deepClone(o);return s===1&&Object.assign(a,Q.deepClone(i)),[a]}}function mh(e,t,n,r,s){const i={startIndex:t.startIndex};if(t.paragraphStyle&&(i.paragraphStyle=Q.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?Q.deepClone(e.bullet):Q.deepClone(t.bullet):e.bullet===void 0?i.bullet=Q.deepClone(t.bullet):n===Re.REPLACE||r===Re.REPLACE?i.bullet=s===0&&t.bullet?Q.deepClone(t.bullet):Q.deepClone(e.bullet):s===0&&t.bullet!==void 0&&(i.bullet=Q.deepClone(t.bullet)),i}function wC(e,t){if(e==null||t==null)return t;if(e.length===0||t.length===0)return Q.deepClone(t);const n=[];for(const r of t){const{id:s,type:i}=r;let o=!1;for(const a of e)if(a.id===s){(a.type===fn.DELETED||i===fn.DELETED)&&(o=!0,n.push({...r,type:fn.DELETED}));break}o||n.push(r)}return n}function bC(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:C,customDecorations:I}=i,y=OC(c,m,s,o,n?1:0);y&&(a.textRuns=y);const H=vC(h,C,s,o,n?1:0);H&&(a.customRanges=H);const x=wC(d,I);x&&(a.customDecorations=x);const Y=[];let O=0,E=0;for(;O<u.length&&E<_.length;){const b=u[O],T=_[E],{startIndex:B}=b,{startIndex:$}=T;if(B===$){let g={startIndex:B};n?g=mh(b,T,s,o,1):g=mh(b,T,s,o,0),Y.push(g),O++,E++}else B<$?O++:(Y.push(Q.deepClone(T)),E++)}return E<_.length&&Y.push(..._.slice(E)),Y.length&&(a.paragraphs=Y),{coverType:l,body:a}}function gh(e){return Object.keys(e).length===1}const qn=class qn{constructor(){R(this,"_actions",[])}static apply(t,n){return SC(t,n)}static compose(t,n){const r=new Vn(t),s=new Vn(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:Wo(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:Wo(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 Vn(t),i=new Vn(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}=bC(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 Vn(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=bt(n,s,s+i.len,!1);i.len=o.dataStream.length,i.body=o}if(i.t===J.RETAIN&&i.body!=null){const o=bt(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=Q.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&&gh(r.body)&&s.t===J.INSERT&&gh(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&&EC(t);)this._actions.pop(),t=this._actions[this._actions.length-1];return this}};R(qn,"id","text-x"),R(qn,"uri","https://github.com/dream-num/univer#text-x");let De=qn;Object.defineProperty(De,"name",{value:"text-x"});const Jn=class Jn{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 Jn),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)}};R(Jn,"uri","https://github.com/dream-num/univer#json-x"),R(Jn,"_subTypes",new Map),R(Jn,"_instance",null);let jt=Jn;jt.registerSubtype(De);var _h=(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))(_h||{}),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 yC(e){return`${e}`}const AC=[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 AC.reduce((n,r)=>n.replaceAll(r,""),t)},TC=e=>e?zs(e).replaceAll("\r","")==="":!0,NC=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(Q.isLegalUrl(u)){const h=nt(),d=`${u}`,m={startIndex:s,endIndex:s+d.length-1,rangeId:h,rangeType:Jt.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}},Yo={id:"default_doc",documentStyle:{}};class MC extends rs{constructor(n){var r;super();R(this,"type",we.UNIVER_DOC);R(this,"_name$",new se.BehaviorSubject(""));R(this,"name$",this._name$.asObservable());R(this,"snapshot");this.snapshot={...Yo,...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{...Dr,...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 yt extends MC{constructor(n){var s,i;super(Q.isEmptyObject(n)?A_():n);R(this,"_unitId");R(this,"headerModelMap",new Map);R(this,"footerModelMap",new Map);R(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={...Yo,...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(!jt.isNoop(n))return this.snapshot=jt.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=jo.copy){const i=this.getBody();if(i!=null)return bt(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 yt(i)),this.headerModelMap.get(s).updateDocumentId(this.getUnitId())}if(r)for(const s in r){const i=r[s];this.footerModelMap.set(s,new yt(i)),this.footerModelMap.get(s).updateDocumentId(this.getUnitId())}}updateDocumentId(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 DC(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 LC(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:fn.DELETED}]}}),o}function ph(e,t,n,r){return e<=n&&t>=n||e>=n&&e<=r}function UC(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):ph(e.startOffset,e.endOffset-1,i.startIndex,i.endIndex)&&n.push(i)}return n}function PC(e){return{...Q.deepClone(e),rangeId:nt()}}function kC(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 Eh(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 FC(e,t){var i,o,a,l,c;const n=Eh(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 zo,Ch;function xC(){if(Ch)return zo;Ch=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],Z=N[3],K=N[4],ae=r(D,F),ue=r(L,Z);return ae.concat([[n,K]],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 Z=v-M,K=Z%2!==0,ae=0,ue=0,S=0,U=0,z=0;z<A;z++){for(var V=-z+ae;V<=z-ue;V+=2){var j=w+V,W;V===-z||V!==z&&D[j-1]<D[j+1]?W=D[j+1]:W=D[j-1]+1;for(var ee=W-V;W<v&&ee<M&&g.charAt(W)===P.charAt(ee);)W++,ee++;if(D[j]=W,W>v)ue+=2;else if(ee>M)ae+=2;else if(K){var te=w+Z-V;if(te>=0&&te<N&&L[te]!==-1){var k=v-L[te];if(W>=k)return o(g,P,W,ee)}}}for(var G=-z+S;G<=z-U;G+=2){var te=w+G,k;G===-z||G!==z&&L[te-1]<L[te+1]?k=L[te+1]:k=L[te-1]+1;for(var q=k-G;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(!K){var j=w+Z-G;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 z=ue.substring(U,U+Math.floor(ue.length/4)),V=-1,j="",W,ee,te,k;(V=S.indexOf(z,V+1))!==-1;){var G=a(ue.substring(U),S.substring(V)),q=c(ue.substring(0,U),S.substring(0,V));j.length<q+G&&(j=S.substring(V-q,V)+S.substring(V,V+G),W=ue.substring(0,U-q),ee=ue.substring(U+G),te=S.substring(0,V-q),k=S.substring(V+G))}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,Z,K;g.length>P.length?(L=D[0],F=D[1],Z=D[2],K=D[3]):(Z=D[0],K=D[1],L=D[2],F=D[3]);var ae=D[4];return[L,F,Z,K,ae]}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 Z=g[w-1][1],K=g[w][1],ae=l(Z,K),ue=l(K,Z);ae>=ue?(ae>=Z.length/2||ae>=K.length/2)&&(g.splice(w,0,[n,K.substring(0,ae)]),g[w-1][1]=Z.substring(0,Z.length-ae),g[w+1][1]=K.substring(ae),w++):(ue>=Z.length/2||ue>=K.length/2)&&(g.splice(w,0,[n,Z.substring(0,ue)]),g[w-1][0]=t,g[w-1][1]=K.substring(0,K.length-ue),g[w+1][0]=e,g[w+1][1]=Z.substring(ue),w++),w++}w++}}var d=/[^a-zA-Z0-9]/,m=/\s/,_=/[\r\n]/,C=/\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),z=S.charAt(0),V=U.match(d),j=z.match(d),W=V&&U.match(m),ee=j&&z.match(m),te=W&&U.match(_),k=ee&&z.match(_),G=te&&ue.match(C),q=k&&S.match(I);return G||q?5:te||k?4:V&&!W&&ee?3:W||ee?2:V||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,Z=w,K=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 ae=P(M,A)+P(A,w);ae>=K&&(K=ae,L=M,F=A,Z=w)}g[v-1][1]!=L&&(L?g[v-1][1]=L:(g.splice(v-1,1),v--),g[v][1]=F,Z?g[v+1][1]=Z:(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&&E(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 Z=L-1;g[Z]&&g[Z][0]===t&&(A++,N=g[Z][1]+N,Z--),g[Z]&&g[Z][0]===e&&(M++,w=g[Z][1]+w,Z--),L=Z}}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 K=A+M;w.length===0&&N.length===0?(g.splice(v-K,K),v=v-K):w.length===0?(g.splice(v-K,K,[t,N]),v=v-K+1):N.length===0?(g.splice(v-K,K,[e,w]),v=v-K+1):(g.splice(v-K,K,[e,w],[t,N]),v=v-K+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 ae=!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),ae=!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),ae=!0)),v++;ae&&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 E(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 E(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),Z=A?A.index:null;e:{var K=D+N-w;if(Z!==null&&Z!==K||K<0||K>N)break e;var ae=P.slice(0,K),ue=P.slice(K);if(ue!==F)break e;var S=Math.min(D,K),U=L.slice(0,S),z=ae.slice(0,S);if(U!==z)break e;var V=L.slice(S),j=ae.slice(S);return T(U,V,j,F)}e:{if(Z!==null&&Z!==D)break e;var W=D,ae=P.slice(0,W),ue=P.slice(W);if(ae!==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 V=F.slice(0,F.length-ee),j=ue.slice(0,ue.length-ee);return T(L,V,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 z=P.slice(0,S),k=P.slice(N-ee);if(U!==z||te!==k)break e;var V=g.slice(S,w-ee),j=P.slice(S,N-ee);return T(U,V,j,te)}return null}function $(g,P,v,M){return r(g,P,v,M,!0)}return $.INSERT=t,$.DELETE=e,$.EQUAL=n,zo=$,zo}var HC=xC();const Vo=Et(HC);function BC(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 $C(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=FC(u,o);if(!h||!o)return!1;const{startOffset:d,endOffset:m}=h,_=(x=o.customRanges)!=null?x:[],C=(E,b,T)=>{var v,M,A,w;const B=Eh(E,b,_,r),$=Math.min((M=(v=B[0])==null?void 0:v.startIndex)!=null?M:1/0,E),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(E=>E.startIndex<m&&E.startIndex>d),y=((O=o.customBlocks)!=null?O:[]).filter(E=>E.startIndex<m&&E.startIndex>d);kC([d,m-1],[...I.map(E=>E.startIndex),...y.map(E=>E.startIndex)]).forEach(([E,b],T)=>C(E,b,T)),c=!0,l.selections=[{startOffset:h.endOffset,endOffset:h.endOffset,collapsed:!0}]}),c?l:!1}function Rh(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 jC(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:{...Q.deepClone(t),dataStream:""}}),s=a)}),r}const WC=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:bt(i,t.startOffset,t.endOffset),a=Vo(o?o.dataStream:"",n.dataStream);let l=0;const c=a.map(([d,m])=>{switch(d){case 0:{const _={t:J.RETAIN,body:{...bt(n,l,l+m.length,!1),dataStream:""},len:m.length};return l+=m.length,_}case 1:{const _={t:J.INSERT,body:bt(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 YC(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 zC=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:bt(o,t.startOffset,t.endOffset),l=Vo(a?a.dataStream:"",n.dataStream);let c=0;const u=l.map(([m,_])=>{switch(m){case 0:{const C=Ys(n,c,c+_.length,!1),I=Ys(a,c,c+_.length,!1),y={t:J.RETAIN,body:YC(C,I)?void 0:{textRuns:C==null?void 0:C.map(H=>{var x,Y,O,E,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=(E=H.ts)==null?void 0:E.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 C={t:J.INSERT,body:bt(n,c,c+_.length),len:_.length};return c+=_.length,C}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 VC(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 KC(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 GC=e=>{var C,I,y,H;const{selection:t,documentDataModel:n,drawings:r}=e,{collapsed:s,startOffset:i,segmentId:o}=t,a=new De,l=jt.getInstance(),c=[],u=n.getSelfOrHeaderFooterModel(o).getBody();if(!u)return!1;const h=(I=(C=n.getSnapshot().drawingsOrder)==null?void 0:C.length)!=null?I:0;let d=0;if(s)i>0&&a.push({t:J.RETAIN,len:i});else{const x=Rh([t],u,0,null,!1);a.push(...x);const Y=VC(u,[t]),O=(y=n.getDrawings())!=null?y:{},E=(H=n.getDrawingsOrder())!=null?H:[],b=Y.sort((T,B)=>E.indexOf(T)>E.indexOf(B)?-1:E.indexOf(T)<E.indexOf(B)?1:0);if(b.length>0)for(const T of b){const B=O[T],$=E.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=KC(n,o),_=l.editOp(a.serialize(),m);c.push(_);for(const x of r){const{drawingId:Y}=x,O=l.insertOp(["drawings",Y],x),E=l.insertOp(["drawingsOrder",h-d],Y);c.push(O),c.push(E)}return c.reduce((x,Y)=>jt.compose(x,Y),null)};function XC(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 qC(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 JC(e,t,n,r){return Math.max(e,n)<=Math.min(t,r)}function Ko(e,t,n,r){const{startOffset:s,endOffset:i}=e,o=r!=null?r:Xo(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 Go(e,t,n){const r=[],s=Xo(t,n);for(const i of e){const o=Ko(i,t,n,s);r.push(...o)}return r}const ZC=[ut.PARAGRAPH,ut.TABLE_START,ut.TABLE_END,ut.TABLE_ROW_START,ut.TABLE_CELL_START,ut.TABLE_CELL_END];function Xo(e,t){const n=[];for(let r=0;r<e.length;r++){const s=e[r],{startIndex:i}=s;let o=i-1;for(;!ZC.includes(t[o])&&o>=0;)o--;n.push({...s,paragraphStart:o+1,paragraphEnd:s.startIndex})}return n}const QC=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 C;return((C=_.bullet)==null?void 0:C.listType.indexOf(s))===0});let l=nt(6);if(t.length===1){const _=i.indexOf(t[0]),C=i[_-1],I=i[_+1];C&&C.bullet&&C.bullet.listType.indexOf(s)===0?(l=C.bullet.listId,s!==kt.CHECK_LIST&&(s=C.bullet.listType)):I&&I.bullet&&I.bullet.listType.indexOf(s)===0&&(l=I.bullet.listId,s!==kt.CHECK_LIST&&(s=I.bullet.listType))}const c=new cn;c.reset();const u=new De;for(const _ of t){const{startIndex:C,paragraphStyle:I={},bullet:y}=_;u.push({t:J.RETAIN,len:C-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(C+1)}return u},eR=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(kt.CHECK_LIST)===-1)return!1;const o=new cn;o.reset();const a=new De,{startIndex:l,paragraphStyle:c={}}=i,u=i.bullet.listType===kt.CHECK_LIST?kt.CHECK_LIST_CHECKED:kt.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},tR=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 cn;l.reset();const c=new De;for(const d of t){const{startIndex:m,paragraphStyle:_={},bullet:C}=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=C==null?void 0:C.nestingLevel)!=null?h:0,textStyle:(C==null?void 0:C.listType)===n?C.textStyle:{fs:20},listType:n,listId:a}}]},coverType:Re.REPLACE}),l.moveCursorTo(m+1)}return c};function nR(e,t){return t.some(n=>e.startIndex>n.startIndex&&e.startIndex<n.endIndex)}const rR=e=>{var c,u,h;const{paragraphs:t,document:n,type:r}=e,s=new cn;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={...Dr,...o};for(const d of t){const{startIndex:m,paragraphStyle:_={},bullet:C}=d,I=nR(d,a);if(i.push({t:J.RETAIN,len:m-s.cursor}),C){const y=C.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:{...C,nestingLevel:Math.max(Math.min(C.nestingLevel+r,H),0)}}]},coverType:Re.REPLACE})}else i.push({t:J.RETAIN,len:1});s.moveCursorTo(m+1)}return i},sR=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=Go(t,u,h),m=new cn;o&&m.moveCursorTo(o);const _=l!=null?l:new De;d.sort((Y,O)=>Y.startIndex-O.startIndex);const C=Math.max(0,d[0].paragraphStart-1);C>m.cursor&&(_.push({t:J.RETAIN,len:C-m.cursor}),m.moveCursorTo(C)),a&&_.push({t:J.DELETE,len:a});for(const Y of d){const{startIndex:O,paragraphStyle:E={}}=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:{...E,...s}}]},coverType:Re.REPLACE}),m.moveCursorTo(O+1)}return _};class Qe{}R(Qe,"customRange",{add:$C,delete:BC,copyCustomRange:PC,getCustomRangesInterestsWithSelection:UC,isIntersecting:ph}),R(Qe,"customDecoration",{add:DC,delete:LC}),R(Qe,"selection",{replace:WC,makeSelection:XC,normalizeSelection:qC,delete:Rh,replaceTextRuns:zC,retain:jC}),R(Qe,"range",{isIntersects:JC,getParagraphsInRange:Ko,getParagraphsInRanges:Go}),R(Qe,"transform",{getPlainText:zs,fromPlainText:NC,isEmptyDocument:TC}),R(Qe,"paragraph",{bullet:{set:tR,switch:QC,toggleChecklist:eR,changeNestLevel:rR},style:{set:sR},util:{transform:Xo,getParagraphsInRange:Ko,getParagraphsInRanges:Go}}),R(Qe,"drawing",{add:GC});function iR(e,t,n,r){var c;if(t==="")return e;const s={id:"mock-id",body:e,documentStyle:{}},i=new yt(s),o=t.length;let a;for(;(a=(r?i.getBody().dataStream:i.getBody().dataStream.toLowerCase()).indexOf(t))>=0;){const u=new De,h=jt.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 oR(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 Ih(e){var t;return e.body=oR((t=e.body)!=null?t:{dataStream:""}),e.drawingsOrder||(e.drawingsOrder=[]),e.drawings||(e.drawings={}),e.documentStyle||(e.documentStyle={}),e}class Lr{constructor(t={}){R(this,"_style");this._style=t}static create(t={}){return new Lr(t)}get fontFamily(){return this._style.ff}get fontSize(){return this._style.fs}get italic(){return this._style.it===ce.TRUE}get bold(){return this._style.bl===ce.TRUE}get underline(){return this._style.ul&&nn.create(this._style.ul)}get bottomBorderLine(){return this._style.bbl&&nn.create(this._style.bbl)}get strikethrough(){return this._style.st&&nn.create(this._style.st)}get overline(){return this._style.ol&&nn.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 tn.create(Q.deepClone(this._style))}getValue(){return{...this._style}}}class tn extends Lr{static create(t={}){return new tn(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 tn.create(Q.deepClone(this._style))}build(){return this.getValue()}}class nn{constructor(t={s:1}){R(this,"_decoration");this._decoration=t}static create(t={s:1}){return new nn(t)}get show(){return this._decoration.s===ce.TRUE}get followFontColor(){return this._decoration.c===ce.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 nn.create(Q.deepClone(this._decoration))}build(){return{...this._decoration}}}class Ur{constructor(t={}){R(this,"_style");this._style=t}static create(t={}){return new Ur(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===ce.TRUE}get keepNext(){return this._style.keepNext===ce.TRUE}get wordWrap(){return this._style.wordWrap===ce.TRUE}get widowControl(){return this._style.widowControl===ce.TRUE}get shading(){return this._style.shading}get suppressHyphenation(){return this._style.suppressHyphenation===ce.TRUE}copy(){return Pr.create(Q.deepClone(this._style))}getValue(){return this._style}}class Pr extends Ur{static create(t={}){return new Pr(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 Pr.create(Q.deepClone(this._style))}build(){return this.getValue()}}class rn{constructor(t){R(this,"_data");if(!t.body)throw new Error("Invalid document data, body is required");this._data=Ih(t)}static create(t){return new rn(t)}static createByBody(t){return new rn({body:t,id:"d",documentStyle:{}})}copy(){return En.create(Q.deepClone(this._data))}slice(t,n){const{body:r,...s}=this._data;return En.create({...Q.deepClone(s),body:bt(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 Ur.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?Lr.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===Jt.HYPERLINK))!=null?r:[]}getData(){return this._data}}class En extends rn{constructor(n){super(n);R(this,"_doc");this._doc=new yt(n)}static newEmptyData(){return Ih({id:"d",documentStyle:{},drawings:{},drawingsOrder:[],body:{dataStream:`\r
8
- `,customBlocks:[],customRanges:[],paragraphs:[{startIndex:0}],textRuns:[],tables:[],sectionBreaks:[]}})}static create(n){return new En(n!=null?n:En.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 tn?r.build():r:a=s instanceof tn?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 rn?n.getData():n:(s=Math.min(n,s),i=r instanceof rn?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 tn?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:Jt.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,rn.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=En.createByBody({dataStream:i,customRanges:[{rangeType:Jt.HYPERLINK,rangeId:nt(),properties:{url:o},startIndex:0,endIndex:i.length-1}]});return typeof n=="number"?this.insertRichText(n,a):this.insertRichText(a)}}const aR="__default_document_sub_component_id20231101__";class Sh{constructor(){R(this,"skipNextObservers",!1);R(this,"lastReturnValue");R(this,"isStopPropagation",!1)}stopPropagation(){this.isStopPropagation=!0}}class lR extends se.Subject{constructor(){super(...arguments);R(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 Sh;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 cR(e){return new se.Observable(t=>{const n=e.subscribeEvent(r=>{t.next(r)});return()=>n.unsubscribe()})}const Vs=Ce.createIdentifier("core.resource-manager.service"),qo={[Se.Editor]:"Editor",[Se.Owner]:"Owner",[Se.Reader]:"Reader",[Se.UNRECOGNIZED]:"UNRECOGNIZED"},Ks=e=>e?{userID:`${qo[e]}_${nt(8)}`,name:qo[e],avatar:""}:{userID:"",name:"",avatar:"",anonymous:!0,canBindAnonymous:!1},uR=(e,t)=>e.startsWith(qo[t]);class kr extends Ge{constructor(){super(...arguments);R(this,"_model",new Map);R(this,"_userChange$",new se.Subject);R(this,"userChange$",this._userChange$.asObservable());R(this,"_currentUser$",new se.BehaviorSubject(Ks()));R(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 hR=Object.getOwnPropertyDescriptor,dR=(e,t,n,r)=>{for(var s=r>1?void 0:r?hR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},Oh=(e,t)=>(n,r)=>t(n,r,e);f.AuthzIoLocalService=class{constructor(t,n){R(this,"_permissionMap",new Map([]));R(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(Ks(Se.Owner))}_getRole(t){const n=this._userManagerService.getCurrentUser();return n?uR(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:Ri.AllCollaborator,edit:Ri.AllCollaborator},creator:Ks(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=dR([Oh(0,Vs),Oh(1,Ce.Inject(kr))],f.AuthzIoLocalService);const vh=Ce.createIdentifier("IAuthzIoIoService"),fR=Ce.createIdentifier("univer.confirm-service");class mR{constructor(){R(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 Fr="FOCUSING_UNIT",Kn="FOCUSING_SHEET",xr="FOCUSING_DOC",Hr="FOCUSING_SLIDE",gR="FOCUSING_EDITOR_BUT_HIDDEN",wh="EDITOR_ACTIVATED",_R="FOCUSING_EDITOR_INPUT_FORMULA",bh="FOCUSING_FX_BAR_EDITOR",pR="FOCUSING_UNIVER_EDITOR",ER="FOCUSING_EDITOR_INPUT_FORMULA",CR="FOCUSING_COMMENT_EDITOR",RR="FOCUSING_PANEL_EDITOR",IR="FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE",SR="FOCUSING_COMMON_DRAWINGS",OR="FOCUSING_SHAPE_TEXT_EDITOR",vR="FORMULA_EDITOR_ACTIVATED";class yh extends Ge{constructor(){super(...arguments);R(this,"_error$",new se.Subject);R(this,"error$",this._error$.asObservable())}dispose(){this._error$.complete()}emit(n){this._error$.next({errorKey:n})}}var Gs=(e=>(e.URL="URL",e.UUID="UUID",e.BASE64="BASE64",e))(Gs||{}),Ah=(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))(Ah||{});const Jo=Ce.createIdentifier("core.image-io.service"),Zo=Ce.createIdentifier("core.url-image.service"),Qo={name:"@univerjs/core",version:"0.17.0"};function wR(e="",t=or.ZH_CN,n=""){return{id:e,sheetOrder:[],name:n,appVersion:Qo.version,locale:t,styles:{},sheets:{},resources:[]}}class Th{constructor(t={}){R(this,"_styles");R(this,"_cacheMap",new ks(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&&Q.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(Q.diffValue(n[r],t))return r;return null}}const bR=(e,t)=>t.length===e.length&&!e.some(n=>t.some(r=>!$t.equals(r,n))),yR=(e,t)=>t.length===e.length&&e.every((n,r)=>{const s=t[r];return s.unitId===n.unitId&&s.sheetId===n.sheetId&&$t.equals(n.range,s.range)}),ea={t:0,b:2,l:2,r:2},AR=e=>({sbr:.6,sbo:e,spr:.6,spo:e}),Nh=90;function Br(e,t,n={}){const r=e.length,{textRotation:s,paddingData:i,horizontalAlign:o=vt.UNSPECIFIED,verticalAlign:a=un.UNSPECIFIED,wrapStrategy:l=hn.UNSPECIFIED,cellValueType:c}=n,{t:u,r:h,b:d,l:m}=i||ea,{vertexAngle:_,centerAngle:C}=Ph(s),I={id:"d",body:{dataStream:`${e}${Ea}`,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:C,vertexAngle:_,wrapStrategy:l,cellValueType:c}},drawings:{},drawingsOrder:[]};return new yt(I)}function TR(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 Mh(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 Dh(e,t,n){var i;const r=e.getBody();if((i=r.customRanges)!=null&&i.some(o=>o.rangeType===Jt.HYPERLINK))return;const s=Qe.customRange.add({ranges:[{startOffset:0,endOffset:r.dataStream.length-1,collapsed:!1}],rangeId:n,rangeType:Jt.HYPERLINK,body:r,properties:{url:t,refId:n}});s&&De.apply(r,s.serialize())}function Lh(e){return e!=null}function NR(){return{p:null,s:null,v:null,t:null,f:null,si:null,ref:null,xf:null}}const MR='"Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif';function Uh(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=Nn.ITALIC;(e.it===0||e.it===void 0)&&(r=Nn.NORMAL);let s=Nn.BOLD;(e.bl===0||e.bl===void 0)&&(s=Nn.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===dn.SUBSCRIPT||a===dn.SUPERSCRIPT){const h=DR(o,l),{sbr:d,spr:m}=h;l*=a===dn.SUBSCRIPT?d:m}const c=`${r} ${s} ${l}pt ${o}`,u=`${c}, ${MR} `;return{fontCache:c,fontString:u,fontSize:l,originFontSize:i,fontFamily:o}}function DR(e,t){return AR(t)}function Ph(e){const{a:t=0,v:n=ce.FALSE}=e||{a:0,v:ce.FALSE};let r=0,s=t;return n===ce.TRUE&&(r=Nh,s=Nh),{centerAngle:r,vertexAngle:s}}function _t(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]=_t(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]=_t(e[o])}return n}function kh(e){if(e==null)return e;const t={};return e.p!==void 0&&(t.p=e.p===null?null:_t(e.p)),e.s!==void 0&&(e.s===null||typeof e.s=="string"?t.s=e.s:t.s=_t(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:_t(e.custom)),t}function LR(e){if(e==null)return e;const t={};return e.p!==void 0&&(t.p=e.p===null?null:_t(e.p)),e.s!==void 0&&(e.s===null||typeof e.s=="string"?t.s=e.s:t.s=_t(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:_t(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 Fh(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]=kh(_))}t[o]=l}return t}function xh(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=_t(a.s)),"custom"in a&&a.custom!==void 0&&(l.custom=a.custom===null?null:_t(a.custom)),t[o]=l}return t}function UR(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 Hh(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:UR(e.mergeData),cellData:Fh(e.cellData),rowData:xh(e.rowData),columnData:xh(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=_t(e.defaultStyle)),e.custom!==void 0&&(t.custom=e.custom===null?null:_t(e.custom)),t}class PR{constructor(t,n){R(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!==ce.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:ce.FALSE},s++}return r}getSize(){return en(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]}insertColumnsWithData(t,n,r){const s=n-t+1,i=Object.keys(this._columnData);for(let o=i.length-1;o>=0;o--){const a=Number(i[o]);a>=t&&(this._columnData[a+s]=this._columnData[a],delete this._columnData[a])}for(let o=t;o<=n;o++){const a=r==null?void 0:r[o-t];a!=null&&Object.keys(a).length>0&&(this._columnData[o]={...a})}}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 kR=2e3;class FR{constructor(t,n,r){R(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:ce.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:ce.FALSE,h:s.defaultRowHeight},{ia:l,ah:c,h:u=s.defaultRowHeight}=a;i+=(l==null||l===ce.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,kR);this._rowData[t]=r?{...r,h:s}:{h:s}}}getRow(t){return this._rowData[t]}insertRowsWithData(t,n,r){const s=n-t+1,i=Object.keys(this._rowData);for(let o=i.length-1;o>=0;o--){const a=Number(i[o]);a>=t&&(this._rowData[a+s]=this._rowData[a],delete this._rowData[a])}for(let o=t;o<=n;o++){const a=r==null?void 0:r[o-t];a!=null&&Object.keys(a).length>0&&(this._rowData[o]={...a})}}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!==ce.TRUE:!0}getSize(){return en(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 xR="DEFAULT_WORKSHEET_ROW_COUNT",Bh=1e3,HR="DEFAULT_WORKSHEET_COLUMN_COUNT",$h=20,BR="DEFAULT_WORKSHEET_ROW_HEIGHT",jh=24,$R="DEFAULT_WORKSHEET_COLUMN_WIDTH",Wh=88,jR="DEFAULT_WORKSHEET_ROW_TITLE_WIDTH",Yh=46,WR="DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT",zh=20;function Vh(e){const t={name:"Sheet1",id:"sheet-01",tabColor:"",hidden:ce.FALSE,rowCount:Bh,columnCount:$h,zoomRatio:1,freeze:{xSplit:0,ySplit:0,startRow:-1,startColumn:-1},scrollTop:0,scrollLeft:0,defaultColumnWidth:Wh,defaultRowHeight:jh,mergeData:[],cellData:{},rowData:{},columnData:{},showGridlines:ce.TRUE,rowHeader:{width:Yh,hidden:ce.FALSE},columnHeader:{height:zh,hidden:ce.FALSE},rightToLeft:ce.FALSE};return Object.keys(t).forEach(n=>{const r=n;typeof e[r]>"u"&&(e[r]=t[r])}),e}class YR extends Ge{constructor(n){super();R(this,"_cellCache",new Map);R(this,"_rowCache",new Map);R(this,"_columnCache",new Map);R(this,"_hasRow",!1);R(this,"_hasColumn",!1);R(this,"_hasAll",!1);R(this,"_allIndex",-1);R(this,"_mergeData");R(this,"_rangeMap",new ks(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||!Q.isEmptyObject(this._columnCache)?!0:this._mergeData.some(r=>r.startRow<=n&&n<=r.endRow)}isColumnContainsMergedCell(n){return this._hasAll||!Q.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||[])$t.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 Kh extends Ge{constructor(n){super();R(this,"_cellContentInterceptor",null);R(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,wn.Value|wn.Style,s,i):this.getRawCell(n,r)}getCellValueOnly(n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,wn.Value):this.getRawCell(n,r)}getCellStyleOnly(n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(n,r,wn.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 Gh={isDeepClone:!1,displayRawFormula:!1,ignoreTextRotation:!1};class $r{constructor(t,n,r){R(this,"_sheetId");R(this,"_snapshot");R(this,"_cellData");R(this,"_rowManager");R(this,"_columnManager");R(this,"_viewModel");R(this,"_spanModel");R(this,"_isRowStylePrecedeColumnStyle",!0);R(this,"_getCellHeight");var a;this.unitId=t,this._styles=r,this._snapshot=Vh(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 Kh((l,c)=>this.getCellRaw(l,c)),this._rowManager=new FR(this._snapshot,this._viewModel,i),this._columnManager=new PR(this._snapshot,s),this._spanModel=new YR(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)?ir(s,o,i,a==null?void 0:a.themeStyle,l):ir(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)?ir(i,a,o,r==null?void 0:r.themeStyle,l):ir(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,C=(_==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||C)&&(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=Hh(t);return new $r(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=Dn.Raw){const o=this.getCellMatrix(),a=this._spanModel.getMergedCellRange(t,n,r,s),l=new ct;return xo(t,r,n,s).forEach((c,u)=>{var d;let h;if(i===Dn.Raw)h=this.getCellRaw(c,u);else if(i===Dn.Intercepted)h=this.getCell(c,u);else if(i===Dn.Both){const m=this.getCellRaw(c,u);if(m){h={...m};const _=(d=this.getCell(c,u))==null?void 0:d.v;Lh(_)&&h&&(h.displayV=String(_))}}h&&l.setValue(c,u,h)}),a.forEach(c=>{const{startColumn:u,startRow:h,endColumn:d,endRow:m}=c;xo(h,m,u,d).forEach((_,C)=>{_===h&&C===u&&l.setValue(_,C,{...o.getValue(_,C),rowSpan:m-h+1,colSpan:d-u+1}),(_!==h||C!==u)&&l.realDeleteValue(_,C)})}),l}getRange(t,n,r,s){return typeof t=="object"?new $n(this,t,{getStyles:()=>this._styles}):new $n(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,C=_||u!==h.startColumn;if(r&&C||!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=Gh){var C;if(!t)return;const{isDeepClone:s,displayRawFormula:i,ignoreTextRotation:o}={...Gh,...r};let a,l="document";const c=TR(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||ea;if(t.f&&i)a=Br(t.f.toString(),{},{verticalAlign:d}),h=it.ht;else if(t.p){const{centerAngle:I,vertexAngle:y}=Ph(u);a=this._updateConfigAndGetDocumentModel(s?Q.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=Mh(n);l=Uh(I).fontCache;let y=Xh(t);t.t===qt.FORCE_STRING&&i&&(y=`'${y}`),a=Br(y,I,{...c,textRotation:u,cellValueType:t.t})}return a&&t.linkUrl&&t.linkId&&Dh(a,t.linkUrl,t.linkId),{documentModel:a,fontString:l,textRotation:u,wrapStrategy:m,verticalAlign:d,horizontalAlign:h,paddingData:_,fill:(C=n==null?void 0:n.bg)==null?void 0:C.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 yt(t)}getBlankCellDocumentModel(t,n,r){const s=this.getComposedCellStyleByCellData(n,r,t),i=Mh(s),o=this.getCellDocumentModel(t,s,{ignoreTextRotation:!0});if(o!=null)return o.documentModel==null&&(o.documentModel=Br("",i)),o;const a="";let l="document";const c=it.tr,u=it.ht,h=it.vt,d=it.tb,m=ea;return l=Uh({}).fontCache,{documentModel:Br(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 Xh(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 zR(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 VR=Object.getOwnPropertyDescriptor,KR=(e,t,n,r)=>{for(var s=r>1?void 0:r?VR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},GR=(e,t)=>(n,r)=>t(n,r,e);function XR(e,t){return`${e.getUnitId()}|${t.getSheetId()}`}f.Workbook=class extends rs{constructor(n={},r){super();R(this,"type",we.UNIVER_SHEET);R(this,"_sheetCreated$",new se.Subject);R(this,"sheetCreated$",this._sheetCreated$.asObservable());R(this,"_sheetDisposed$",new se.Subject);R(this,"sheetDisposed$",this._sheetDisposed$.asObservable());R(this,"_activeSheet$",new se.BehaviorSubject(null));R(this,"activeSheet$",this._activeSheet$.asObservable());R(this,"_worksheets");R(this,"_styles");R(this,"_snapshot");R(this,"_unitId");R(this,"_count");R(this,"_name$");R(this,"name$");this._logService=r;const s=wR();Q.isEmptyObject(n)?this._snapshot=s:this._snapshot=Q.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 Th(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 Q.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 $r(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()!==ce.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===ce.TRUE).map(n=>n.getConfig().id)}getUnhiddenWorksheets(){return this.getSheets().filter(n=>n.getConfig().hidden!==ce.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(Q.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 $r(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=KR([GR(1,dt)],f.Workbook);class ta extends rs{constructor(n){var r;super();R(this,"type",we.UNIVER_SLIDE);R(this,"_activePage$",new se.BehaviorSubject(null));R(this,"activePage$",this._activePage$.asObservable());R(this,"_name$");R(this,"name$");R(this,"_snapshot");R(this,"_unitId");this._snapshot={...Pu,...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:Oi.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 qR=Object.getOwnPropertyDescriptor,JR=(e,t,n,r)=>{for(var s=r>1?void 0:r?qR(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},na=(e,t)=>(n,r)=>t(n,r,e);const Gn=Ce.createIdentifier("univer.current");f.UniverInstanceService=class extends Ge{constructor(n,r,s){super();R(this,"_unitsByType",new Map);R(this,"_createHandler");R(this,"_ctorByType",new Map);R(this,"_currentUnits",new Map);R(this,"_currentUnits$",new se.BehaviorSubject(this._currentUnits));R(this,"currentUnits$",this._currentUnits$.asObservable());R(this,"_unitAdded$",new se.Subject);R(this,"unitAdded$",this._unitAdded$.asObservable());R(this,"_unitDisposed$",new se.Subject);R(this,"unitDisposed$",this._unitDisposed$.asObservable());R(this,"_focused$",new se.BehaviorSubject(null));R(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(Fr,!0),this._contextService.setContextValue(xr,!1),this._contextService.setContextValue(Kn,!0),this._contextService.setContextValue(Hr,!1),this.setCurrentUnitForType(n)):this.focused instanceof yt?(this._contextService.setContextValue(Fr,!0),this._contextService.setContextValue(xr,!0),this._contextService.setContextValue(Kn,!1),this._contextService.setContextValue(Hr,!1),this.setCurrentUnitForType(n)):this.focused instanceof ta?(this._contextService.setContextValue(Fr,!0),this._contextService.setContextValue(xr,!1),this._contextService.setContextValue(Kn,!1),this._contextService.setContextValue(Hr,!0),this.setCurrentUnitForType(n)):(this._contextService.setContextValue(Fr,!1),this._contextService.setContextValue(xr,!1),this._contextService.setContextValue(Kn,!1),this._contextService.setContextValue(Hr,!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=JR([na(0,Ce.Inject(Ce.Injector)),na(1,Mn),na(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 qh={0:"Starting",1:"Ready",2:"Rendered",3:"Steady"};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},eI=(e,t)=>(n,r)=>t(n,r,e);class Jh extends Error{constructor(t){super(`[LifecycleService]: lifecycle stage "${qh[t]}" will never be reached!`),this.name="LifecycleUnreachableError"}}f.LifecycleService=class extends Ge{constructor(n){super();R(this,"_lifecycle$",new se.BehaviorSubject(Fe.Starting));R(this,"lifecycle$",this._lifecycle$.asObservable());R(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),Ni(r=>r===n),se.map(()=>{}))).catch(r=>r.name==="EmptyError"?Promise.reject(new Jh(n)):Promise.reject(r))}subscribeWithPrevious(){return se.merge(Zh(this.stage),this._lifecycle$.pipe(se.skip(1))).pipe(Ni(n=>n===Fe.Steady))}_reportProgress(n){this._logService.debug("[LifecycleService]",`lifecycle progressed to "${qh[n]}".`)}},f.LifecycleService=QR([eI(0,dt)],f.LifecycleService);function Zh(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 tI=Ce.createIdentifier("ILocalStorageService");class Cn extends Ge{constructor(){super();R(this,"_currentLocale$",new se.BehaviorSubject(or.ZH_CN));R(this,"currentLocale$",this._currentLocale$.asObservable());R(this,"_locales",null);R(this,"localeChanged$",new se.Subject);R(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=ts((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 nI=Object.getOwnPropertyDescriptor,rI=(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},sI=(e,t)=>(n,r)=>t(n,r,e);f.MentionIOLocalService=class{constructor(t){this._userManagerService=t}async list(t){return{list:[{type:ss.PERSON,mentions:[{objectType:ss.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=rI([sI(0,Ce.Inject(kr))],f.MentionIOLocalService);const Qh=Ce.createIdentifier("univer.service.mention-io");var ra=(e=>(e.INIT="init",e.FETCHING="fetching",e.DONE="done",e))(ra||{});const ed=Ce.createIdentifier("univer.permission-service");class td extends Ge{constructor(){super(...arguments);R(this,"_permissionPointMap",new Map);R(this,"_permissionPointUpdate$",new se.Subject);R(this,"permissionPointUpdate$",this._permissionPointUpdate$.asObservable());R(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=ra.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(Vr.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 nd(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 iI=Object.getOwnPropertyDescriptor,oI=(e,t,n,r)=>{for(var s=r>1?void 0:r?iI(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},sa=(e,t)=>(n,r)=>t(n,r,e);const aI=4,rd=Symbol("DependentOn");class Rn extends Ge{onStarting(){}onReady(){}onRendered(){}onSteady(){}getUnitType(){return this.constructor.type}getPluginName(){return this.constructor.pluginName}}R(Rn,"pluginName"),R(Rn,"packageName",Qo.name),R(Rn,"version",Qo.version),R(Rn,"type",we.UNIVER_UNKNOWN);class lI{constructor(){R(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 cI(...e){return function(t){t[rd]=e}}f.PluginService=class{constructor(t,n,r){R(this,"_pluginRegistry",new Map);R(this,"_pluginStore",new lI);R(this,"_seenPlugins",new Set);R(this,"_loadedPlugins",new Set);R(this,"_loadedPluginTypes",new Set([we.UNIVER_UNKNOWN]));R(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,packageName:s,version:i}=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(i&&i!==Rn.version)throw new Error(`[PluginService]: package "${s!=null?s:"UNKNOWN"}" version mismatch. Plugin version is "${i}" but @univerjs/core version is "${Rn.version}". Please make sure all @univerjs packages use the same version.`);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)},aI))}_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[rd];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(Zh(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=oI([sa(0,Ce.Inject(Ce.Injector)),sa(1,Ce.Inject(f.LifecycleService)),sa(2,dt)],f.PluginService);const ia=Ce.createIdentifier("resource-loader-service");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},dI=(e,t)=>(n,r)=>t(n,r,e);f.ResourceManagerService=class extends Ge{constructor(n){super();R(this,"_resourceMap",new Map);R(this,"_register$",new se.Subject);R(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=hI([dI(0,dt)],f.ResourceManagerService);class Xs extends Ge{constructor(){super();R(this,"_darkMode$",new se.BehaviorSubject(!1));R(this,"darkMode$",this._darkMode$.asObservable());R(this,"_validColorCache",new Map);R(this,"_currentTheme",Kr.defaultTheme);R(this,"_currentTheme$",new se.BehaviorSubject(this._currentTheme));R(this,"currentTheme$",this._currentTheme$.asObservable());this.disposeWithMe(Ye(()=>{this._currentTheme=Kr.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 Kr.defaultTheme;else if(s.length===2){const[i,o]=s;r=i in Kr.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 sl(this._currentTheme,n)}}var fI=Object.getOwnPropertyDescriptor,mI=(e,t,n,r)=>{for(var s=r>1?void 0:r?fI(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},oa=(e,t)=>(n,r)=>t(n,r,e);const qs=Ce.createIdentifier("univer.undo-redo.service"),gI=20;class sd{dispose(){}async dispatchToHandlers(){return!1}}const id="univer.command.redo",od="univer.command.undo",ad=new class extends sd{constructor(){super(...arguments);R(this,"type",hr.COMMAND);R(this,"id",od)}handler(t){const n=t.get(qs),r=n.pitchTopUndoElement();if(!r)return!1;const s=t.get(dr);return ds(r.undoMutations,s)?(n.popUndoToRedo(),!0):!1}},ld=new class extends sd{constructor(){super(...arguments);R(this,"type",hr.COMMAND);R(this,"id",id)}handler(t){const n=t.get(qs),r=n.pitchTopRedoElement();if(!r)return!1;const s=t.get(dr);return ds(r.redoMutations,s)?(n.popRedoToUndo(),!0):!1}};f.LocalUndoRedoService=class extends Ge{constructor(n,r,s){super();R(this,"undoRedoStatus$");R(this,"_undoRedoStatus$",new se.BehaviorSubject({undos:0,redos:0}));R(this,"_undoStacks",new Map);R(this,"_redoStacks",new Map);R(this,"_batchingStatus",new Map);this._univerInstanceService=n,this._commandService=r,this._contextService=s,this.undoRedoStatus$=this._undoRedoStatus$.asObservable(),this.disposeWithMe(this._commandService.registerCommand(ad)),this.disposeWithMe(this._commandService.registerCommand(ld)),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>gI&&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(),ds(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(Kn),s=this._contextService.getContextValue(bh),i=this._contextService.getContextValue(wh);return r?s?n=ni:i?n=ti: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=mI([oa(0,Gn),oa(1,dr),oa(2,Mn)],f.LocalUndoRedoService);class cd{constructor(t,n=1e3){R(this,"_imageCacheMap");this._injector=t,this._imageCacheMap=new ks(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(Jo)?this._injector.get(Jo):null,c=this._injector.has(Zo)?this._injector.get(Zo):null;if(t===Gs.UUID)try{a.src=await(l==null?void 0:l.getImage(n))||""}catch(u){console.error(u)}else if(t===Gs.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 _I(e){return!(e.length===0||e.length>31||e.startsWith("'")||e.endsWith("'")||/[:\\\/\?\*\[\]]/.test(e))}function pI(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 ud=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],aa=1,jr=8;class la{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!==aa)throw new Error(`Got v${s} data when expected v${aa}.`);const i=ud[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 la(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=ud.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,jr,t),this.coords=new this.ArrayType(this.data,jr+a+l,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(jr+o+a+l),this.ids=new this.IndexArrayType(this.data,jr,t),this.coords=new this.ArrayType(this.data,jr+a+l,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(aa<<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 ca(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],C=o[2*m+1];_>=t&&_<=r&&C>=n&&C<=s&&c.push(i[m]),(u===0?t<=_:n<=C)&&(l.push(d),l.push(m-1),l.push(1-u)),(u===0?r>=_:s>=C)&&(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++)dd(i[2*I],i[2*I+1],t,n)<=c&&l.push(s[I]);continue}const m=d+h>>1,_=i[2*m],C=i[2*m+1];dd(_,C,t,n)<=c&&l.push(s[m]),(u===0?t-r<=_:n-r<=C)&&(a.push(d),a.push(m-1),a.push(1-u)),(u===0?t+r>=_:n+r>=C)&&(a.push(m+1),a.push(h),a.push(1-u))}return l}}function ca(e,t,n,r,s,i){if(s-r<=n)return;const o=r+s>>1;hd(e,t,o,r,s,i),ca(e,t,n,r,o-1,1-i),ca(e,t,n,o+1,s,1-i)}function hd(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)),C=Math.min(s,Math.floor(n+(c-u)*d/c+m));hd(e,t,n,_,C,i)}const o=t[2*n+i];let a=r,l=s;for(Wr(e,t,r,n),t[2*s+i]>o&&Wr(e,t,r,s);a<l;){for(Wr(e,t,a,l),a++,l--;t[2*a+i]<o;)a++;for(;t[2*l+i]>o;)l--}t[2*r+i]===o?Wr(e,t,r,l):(l++,Wr(e,t,l,s)),l<=n&&(r=l+1),n<=l&&(s=l-1)}}function Wr(e,t,n,r){ua(e,n,r),ua(t,2*n,2*r),ua(t,2*n+1,2*r+1)}function ua(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function dd(e,t,n,r){const s=e-n,i=t-r;return s*s+i*i}class EI{constructor(t=!1){R(this,"_tree",new Map);R(this,"_oneCellCache",new Map);R(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 xs),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 C=m.get(_);C&&C.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 C of d){const I=h[C];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 la(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 xs;s.fromJSON(t[n][r]),this._tree.get(n).set(r,s)}}}}function CI(e){return new Promise(t=>setTimeout(t,e))}function RI(e=1){return new Promise(t=>{let n=0;const r=()=>{n++,n>=e?t():requestAnimationFrame(r)};requestAnimationFrame(r)})}var II=Object.getOwnPropertyDescriptor,SI=(e,t,n,r)=>{for(var s=r>1?void 0:r?II(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.Skeleton=class extends Ge{constructor(n){super();R(this,"_fontLocale");R(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=SI([OI(0,Ce.Inject(Cn))],f.Skeleton);var vI=Object.getOwnPropertyDescriptor,wI=(e,t,n,r)=>{for(var s=r>1?void 0:r?vI(t,n):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=o(s)||s);return s},Js=(e,t)=>(n,r)=>t(n,r,e);f.SheetSkeleton=class extends f.Skeleton{constructor(n,r,s,i,o,a){super(s);R(this,"_worksheetData");R(this,"_renderRawFormula",!1);R(this,"_cellData");R(this,"_imageCacheMap");R(this,"_skipAutoHeightForMergedCells",!0);R(this,"_rowTotalHeight",0);R(this,"_columnTotalWidth",0);R(this,"_rowHeaderWidth",0);R(this,"_columnHeaderHeight",0);R(this,"_rowHeightAccumulation",[]);R(this,"_columnWidthAccumulation",[]);R(this,"_marginTop",0);R(this,"_marginLeft",0);R(this,"_scaleX");R(this,"_scaleY");R(this,"_scrollX");R(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 cd(this._injector),this.initConfig()}initConfig(){var n,r;this._skipAutoHeightForMergedCells=!((n=this._configService.getConfig(Ra))!=null&&n),this.worksheet.setIsRowStylePrecedeColumnStyle((r=this._configService.getConfig(Ca))!=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){Q.isDefine(n)&&(this._scrollX=n),Q.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===ce.TRUE)&&typeof d=="number"&&d>0?c=d:c=h,u.hd===ce.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===ce.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=vt.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(!No(h)&&u!==r||this.intersectMergeRange(n,u))return u===r?u:u+1>l?l:u+1;const{startX:d,endX:m}=Xn(n,u,this.rowHeightAccumulation,this.columnWidthAccumulation);if(o===vt.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(!No(u)&&c!==r||this.intersectMergeRange(n,c))return c===r?c:c-1<0?0:c-1;const{startX:h,endX:d}=Xn(n,c,this.rowHeightAccumulation,this.columnWidthAccumulation);if(o===vt.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!==ce.TRUE?this._dynamicallyUpdateRowHeaderWidth(l):0,this._columnHeaderHeight=c.hidden!==ce.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:C,endRow:I,endColumn:y}=l[m];if(u.getValue(_,C))continue;const H={startColumn:i,startRow:s,endColumn:a,endRow:o},x={startColumn:C,startRow:_,endColumn:y,endRow:I};Bu(H,x)&&(s=Math.min(s,_),i=Math.min(i,C),o=Math.max(o,I),a=Math.max(a,y),u.setValue(_,C,!0),c=!0,h++,d=x)}}return r&&h===1&&$t.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}=Xn(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}=Xn(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=md(n,r,s,this.columnHeaderHeightAndMarginTop);let a=fr(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=fd(n,r,s,this.rowHeaderWidthAndMarginLeft),{columnWidthAccumulation:a}=this;let l=fr(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=Xn(n,r,i,o,this.worksheet.getCellInfoInMergeData(n,r)),{isMerged:u,isMergedMainCell:h}=c;let{startY:d,endY:m,startX:_,endX:C,mergeInfo:I}=c,y=a,H=l;return s===!1&&(y=0,H=0),d+=H,m+=H,_+=y,C+=y,I.startY+=H,I.endY+=H,I.startX+=y,I.endX+=y,{actualRow:n,actualColumn:r,startX:_,startY:d,endX:C,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=fr(this.columnWidthAccumulation,n);let i=0;s===0?i=n:i=n-this._columnWidthAccumulation[s-1];const o=fr(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 yt(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=wI([Js(2,Ce.Inject(Cn)),Js(3,Mn),Js(4,ur),Js(5,Ce.Inject(Ce.Injector))],f.SheetSkeleton);function ha(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 bI(e,t,n,r){return ha(e,t,n,r)}function Xn(e,t,n,r,s){e=Q.clamp(e,0,n.length-1),t=Q.clamp(t,0,r.length-1);let{startY:i,endY:o,startX:a,endX:l}=ha(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 C={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];C={...C,startY:H,endY:x,startX:Y,endX:O}}else if(!c&&m!==-1&&_!==-1){const H=n[m]||n[I],x=r[_]||r[y];C={...C,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:C}}function fd(e,t,n,r){const{x:s}=n;return e/t+s-r}function md(e,t,n,r){const{y:s}=n;return e=e/t+s-r,e}const yI=["script","style","meta","comment","link"];var gd=(e=>(e[e.INFO=0]="INFO",e[e.STOP=1]="STOP",e[e.WARNING=2]="WARNING",e))(gd||{}),_d=(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))(_d||{}),pd=(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))(pd||{}),Ed=(e=>(e[e.TEXT=0]="TEXT",e[e.ARROW=1]="ARROW",e[e.CUSTOM=2]="CUSTOM",e))(Ed||{}),Cd=(e=>(e.VALID="valid",e.INVALID="invalid",e.VALIDATING="validating",e))(Cd||{}),Rd=(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))(Rd||{}),AI=Object.getOwnPropertyDescriptor,TI=(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},Id=(e,t)=>(n,r)=>t(n,r,e);let da=class extends Ge{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();Ia(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=Q.deepClone(t.getSnapshot());return r.resources=n,r}};da=TI([Id(0,Ce.Inject(Vs)),Id(1,Ce.Inject(Gn))],da);class NI{constructor(t={},n){R(this,"_startedTypes",new Set);R(this,"_injector");R(this,"_disposingCallbacks",new ns);const r=this._injector=MI(n,t==null?void 0:t.override),{theme:s,darkMode:i,locale:o,locales:a,logLevel:l,logCommandExecution:c}=t;s&&this._injector.get(Xs).setTheme(s),i&&this._injector.get(Xs).setDarkMode(i),a&&this._injector.get(Cn).load(a),o&&this._injector.get(Cn).setLocale(o),l&&this._injector.get(dt).setLogLevel(l),c!==void 0&&this._injector.get(ur).setConfig(hs,c),this._init(r)}get _univerInstanceService(){return this._injector.get(Gn)}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(Cn).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,yt),this._univerInstanceService.registerCtorForType(we.UNIVER_SLIDE,ta);const n=t.get(Gn);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 MI(e,t){const n=nd([[yh],[Cn],[Xs],[f.LifecycleService],[f.PluginService],[kr],[Gn,{useClass:f.UniverInstanceService}],[ed,{useClass:td}],[dt,{useClass:bc,lazy:!0}],[dr,{useClass:f.CommandService}],[qs,{useClass:f.LocalUndoRedoService,lazy:!0}],[ur,{useClass:Oc}],[Mn,{useClass:vc}],[Vs,{useClass:f.ResourceManagerService,lazy:!0}],[ia,{useClass:da,lazy:!0}],[vh,{useClass:f.AuthzIoLocalService}],[Qh,{useClass:f.MentionIOLocalService,lazy:!0}]],t),r=e?e.createChild(n):new Ce.Injector(n);return Sa(r,[[kr],[ia]]),r}Td(),f.ABCToNumber=K0,f.AUTO_HEIGHT_FOR_MERGED_CELLS=Ra,f.AbsoluteRefType=Me,f.ActionIterator=Vn,f.AlignTypeH=rc,f.AlignTypeV=sc,f.ArrangeTypeEnum=ac,f.ArrowsAndMarkersShapes=Tl,f.AsyncInterceptorManager=Jd,f.AsyncLock=Hd,f.AutoFillSeries=pl,f.BaselineOffset=dn,f.BasicShapes=Al,f.BlockType=Fl,f.BooleanNumber=ce,f.BorderStyleTypes=Pe,f.BorderType=El,f.BuildTextUtils=Qe,f.BulletAlignment=lr,f.COLORS=Mi,f.COMMAND_LOG_EXECUTION_CONFIG_KEY=hs,f.CanceledError=zd,f.CellModeEnum=Dn,f.CellValueType=qt,f.ColorKit=ft,f.ColorType=Cl,f.ColumnSeparatorType=Bl,f.CommandType=hr,f.CommonHideTypes=Rl,f.ConfigService=Oc,f.ContextService=vc,f.CopyPasteType=Il,f.CustomCommandExecutionError=Gr,f.CustomDecorationType=fn,f.CustomRangeType=Jt,f.DEFAULT_CELL=O0,f.DEFAULT_DOC=Yo,f.DEFAULT_DOCUMENT_SUB_COMPONENT_ID=aR,f.DEFAULT_EMPTY_DOCUMENT_VALUE=Ea,f.DEFAULT_NUMBER_FORMAT=yo,f.DEFAULT_RANGE=I0,f.DEFAULT_RANGE_ARRAY=R0,f.DEFAULT_SELECTION=S0,f.DEFAULT_SLIDE=Pu,f.DEFAULT_STYLES=it,f.DEFAULT_TEXT_FORMAT=mu,f.DEFAULT_TEXT_FORMAT_EXCEL=gu,f.DEFAULT_WORKSHEET_COLUMN_COUNT=$h,f.DEFAULT_WORKSHEET_COLUMN_COUNT_KEY=HR,f.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT=zh,f.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY=WR,f.DEFAULT_WORKSHEET_COLUMN_WIDTH=Wh,f.DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY=$R,f.DEFAULT_WORKSHEET_ROW_COUNT=Bh,f.DEFAULT_WORKSHEET_ROW_COUNT_KEY=xR,f.DEFAULT_WORKSHEET_ROW_HEIGHT=jh,f.DEFAULT_WORKSHEET_ROW_HEIGHT_KEY=BR,f.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH=Yh,f.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY=jR,f.DOCS_COMMENT_EDITOR_UNIT_ID_KEY=pa,f.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY=ni,f.DOCS_NORMAL_EDITOR_UNIT_ID_KEY=ti,f.DOCS_ZEN_EDITOR_UNIT_ID_KEY=_a,f.DOC_DRAWING_PRINTING_COMPONENT_KEY=A0,f.DOC_RANGE_TYPE=kc,f.DashStyleType=Vl,f.DataStreamTreeNodeType=_h,f.DataStreamTreeTokenType=ut,f.DataValidationErrorStyle=gd,f.DataValidationImeMode=_d,f.DataValidationOperator=pd,f.DataValidationRenderMode=Ed,f.DataValidationStatus=Cd,f.DataValidationType=Rd,f.DeleteDirection=Sl,f.DependentOn=cI,f.DesktopLogService=bc,f.DeveloperMetadataVisibility=Ol,f.Dimension=vl,f.Direction=wl,f.Disposable=Ge,f.DisposableCollection=ns,f.DocStyleType=Pl,f.DocumentDataModel=yt,f.DocumentFlavor=Si,f.DrawingTypeEnum=lc,f.EDITOR_ACTIVATED=wh,f.EXTENSION_NAMES=ku,f.ErrorService=yh,f.EventState=Sh,f.EventSubject=lR,f.FOCUSING_COMMENT_EDITOR=CR,f.FOCUSING_COMMON_DRAWINGS=SR,f.FOCUSING_DOC=xr,f.FOCUSING_EDITOR_BUT_HIDDEN=gR,f.FOCUSING_EDITOR_INPUT_FORMULA=_R,f.FOCUSING_EDITOR_STANDALONE=ER,f.FOCUSING_FX_BAR_EDITOR=bh,f.FOCUSING_PANEL_EDITOR=RR,f.FOCUSING_SHAPE_TEXT_EDITOR=OR,f.FOCUSING_SHEET=Kn,f.FOCUSING_SLIDE=Hr,f.FOCUSING_UNIT=Fr,f.FOCUSING_UNIVER_EDITOR=pR,f.FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE=IR,f.FORMULA_EDITOR_ACTIVATED=vR,f.FollowNumberWithType=kl,f.FontItalic=is,f.FontStyleType=Nn,f.FontWeight=os,f.GridType=xl,f.HorizontalAlign=vt,f.IAuthzIoService=vh,f.ICommandService=dr,f.IConfigService=ur,f.IConfirmService=fR,f.IContextService=Mn,f.IImageIoService=Jo,f.ILocalStorageService=tI,f.ILogService=dt,f.IMentionIOService=Qh,f.IPermissionService=ed,f.IResourceLoaderService=ia,f.IResourceManagerService=Vs,f.IS_ROW_STYLE_PRECEDE_COLUMN_STYLE=Ca,f.IURLImageService=Zo,f.IUndoRedoService=qs,f.IUniverInstanceService=Gn,f.ImageCacheMap=cd,f.ImageSourceType=Gs,f.ImageUploadStatusType=Ah,f.InterceptorEffectEnum=wn,f.InterceptorManager=Gd,f.InterpolationPointType=bl,f.JSON1=P_,f.JSONX=jt,f.LRUHelper=br,f.LRUMap=ks,f.LifecycleStages=Fe,f.LifecycleUnreachableError=Jh,f.ListGlyphType=fe,f.LocaleService=Cn,f.LocaleType=or,f.LogLevel=wc,f.MAX_COLUMN_COUNT=Uo,f.MAX_ROW_COUNT=Lo,f.MOVE_BUFFER_VALUE=mr,f.MemoryCursor=cn,f.MentionType=ss,f.NAMED_STYLE_MAP=w0,f.NAMED_STYLE_SPACE_MAP=b0,f.NamedStyleType=Je,f.NilCommand=yc,f.NumberUnitType=nc,f.ObjectMatrix=ct,f.ObjectRelativeFromH=ec,f.ObjectRelativeFromV=tc,f.OtherShapes=Nl,f.PAGE_SIZE=T0,f.PAPER_TYPES=y_,f.PRESET_LIST_TYPE=Dr,f.PRINT_CHART_COMPONENT_KEY=y0,f.PageElementType=cc,f.PageOrientType=oc,f.PageType=Oi,f.PaperType=ht,f.ParagraphElementType=jl,f.ParagraphStyleBuilder=Pr,f.ParagraphStyleValue=Ur,f.PermissionService=td,f.PermissionStatus=ra,f.Plugin=Rn,f.PositionedObjectLayoutType=Yl,f.PresetListType=kt,f.ProtectionType=yl,f.QuickListType=sh,f.QuickListTypeMap=sC,f.RANGE_DIRECTION=Pc,f.RANGE_TYPE=pe,f.RBush=xs,f.RCDisposable=d_,f.RGBA_PAREN=q_,f.RGB_PAREN=X_,f.ROTATE_BUFFER_VALUE=Mc,f.RTree=EI,f.Range=$n,f.Rectangle=$t,f.RedoCommand=ld,f.RedoCommandId=id,f.RefAlias=V0,f.Registry=Ei,f.RegistryAsMap=Ci,f.RelativeDate=Dl,f.RelativeSlideLink=uc,f.RichTextBuilder=En,f.RichTextValue=rn,f.RxDisposable=h_,f.SHEET_EDITOR_UNITS=v0,f.SectionType=Hl,f.SheetTypes=Ll,f.SheetViewModel=Kh,f.SliceBodyType=jo,f.SlideDataModel=ta,f.SpacingRule=zl,f.SpecialShapes=Ml,f.Styles=Th,f.THEME_COLORS=Fc,f.TabStopAlignment=Kl,f.TableAlignmentType=Xl,f.TableLayoutType=ql,f.TableRowHeightRule=Zl,f.TableSizeType=Gl,f.TableTextWrapType=Jl,f.TestConfirmService=mR,f.TextDecoration=Ul,f.TextDecorationBuilder=nn,f.TextDirection=ar,f.TextDirectionType=$l,f.TextStyleBuilder=tn,f.TextStyleValue=Lr,f.TextX=De,f.TextXActionType=J,f.ThemeColorType=at,f.ThemeColors=as,f.ThemeService=Xs,f.Tools=Q,f.UndoCommand=ad,f.UndoCommandId=od,f.UnitModel=rs,f.Univer=NI,f.UniverInstanceType=we,f.UpdateDocsAttributeType=Re,f.UserManagerService=kr,f.VerticalAlign=un,f.VerticalAlignmentType=Ql,f.Worksheet=$r,f.WrapStrategy=hn,f.WrapTextType=Wl,f.addLinkToDocumentModel=Dh,f.afterInitApply=z_,f.afterTime=W_,f.awaitTime=CI,f.binSearchFirstGreaterThanTarget=Nc,f.binarySearchArray=V_,f.bufferDebounceTime=j_,f.cellToRange=wE,f.characterSpacingControlType=ic,f.checkForSubstrings=yE,f.checkIfMove=G_,f.checkParagraphHasBullet=c0,f.checkParagraphHasIndent=u0,f.checkParagraphHasIndentByStyle=Mu,f.cloneCellData=kh,f.cloneCellDataMatrix=Fh,f.cloneCellDataWithSpanAndDisplay=LR,f.cloneValue=_t,f.cloneWorksheetData=Hh,f.codeToBlob=K_,f.columnLabelToNumber=C0,f.composeBody=Wo,f.composeInterceptors=va,f.composeStyles=ir,f.concatMatrixArray=mE,f.convertCellToRange=Eu,f.convertObservableToBehaviorSubject=Y_,f.covertCellValue=Mo,f.covertCellValues=bE,f.createAsyncInterceptorKey=Xd,f.createDefaultUser=Ks,f.createDocumentModelWithStyle=Br,f.createInterceptorKey=Kd,f.createInternalEditorID=jd,f.createREGEXFromWildChar=w_,f.createRowColIter=xo,f.customNameCharacterCheck=pI,f.dayjs=Bt,f.debounce=Zg,f.dedupe=Nd,f.dedupeBy=Md,f.deepCompare=Do,f.delayAnimationFrame=RI,f.deleteContent=Lu,f.extractPureTextFromCell=Xh,f.fromCallback=Ac,f.fromEventSubject=cR,f.generateIntervalsByPoints=f0,f.generateRandomId=nt,f.get=sl,f.getArrayLength=en,f.getBodySlice=bt,f.getBorderStyleType=SE,f.getCellCoordByIndexSimple=ha,f.getCellInfoInMergeData=fp,f.getCellPositionByIndexSimple=bI,f.getCellValueType=up,f.getCellWithCoordByIndexCore=Xn,f.getColorStyle=Pt,f.getCustomBlockSlice=ch,f.getCustomDecorationSlice=hh,f.getCustomRangeSlice=uh,f.getDocsUpdateBody=OE,f.getEmptyCell=NR,f.getIntersectRange=Bu,f.getNumfmtParseValueFilter=_u,f.getOriginCellValue=zR,f.getParagraphsSlice=lh,f.getPlainText=zs,f.getReverseDirection=b_,f.getSectionBreakSlice=fC,f.getTableSlice=ah,f.getTextRunSlice=Ys,f.getTransformOffsetX=fd,f.getTransformOffsetY=md,f.getWorksheetUID=XR,f.groupBy=Ud,f.handleStyleToString=IE,f.hashAlgorithm=d0,f.horizontalLineSegmentsSubtraction=Ps,f.insertMatrixArray=fE,f.insertTextToContent=Du,f.invertColorByHSL=rf,f.invertColorByMatrix=of,f.isBlackColor=lp,f.isBooleanString=$d,f.isCellCoverable=No,f.isCellV=Uc,f.isCommentEditorID=Wd,f.isDefaultFormat=aE,f.isEmptyCell=Cu,f.isFormulaId=RE,f.isFormulaString=Ru,f.isICellData=Lc,f.isInternalEditorID=Ia,f.isNodeEnv=v_,f.isNotNullOrUndefined=Lh,f.isNullCell=hp,f.isNumeric=hl,f.isPatternEqualWithoutDecimal=lE,f.isRangesEqual=bR,f.isRealNum=h0,f.isSafeNumeric=o_,f.isSameStyleTextRun=Iu,f.isTextFormat=oE,f.isUnitRangesEqual=yR,f.isValidRange=vE,f.isWhiteColor=cp,f.makeArray=Pd,f.makeCellRangeToRangeData=CE,f.makeCellToSelection=EE,f.makeCustomRangeStream=yC,f.mapObjectMatrix=dE,f.merge=ts,f.mergeIntervals=m0,f.mergeLocales=g0,f.mergeOverrideWithDependencies=nd,f.mergeSets=c_,f.mergeWith=n_,f.mergeWorksheetSnapshotWithDefault=Vh,f.mixinClass=i_,f.moveMatrixArray=To,f.moveRangeByOffset=k0,f.nameCharacterCheck=_I,f.normalizeBody=mC,f.normalizeTextRuns=Mr,f.numberToABC=X0,f.numberToListABC=q0,f.numfmt=iE,f.queryObjectMatrix=z0,f.registerDependencies=Yd,f.remove=er,f.repeatStringNumTimes=Yu,f.replaceInDocumentBody=iR,f.requestImmediateMacroTask=l_,f.resolveWithBasePath=__,f.rotate=Ld,f.searchArray=fr,f.searchInOrderedArray=Tc,f.selectionToArray=dp,f.sequence=fl,f.sequenceAsync=dl,f.sequenceExecute=ds,f.sequenceExecuteAsync=$_,f.set=s_,f.shallowEqual=Oa,f.skipParseTagNames=yI,f.sliceMatrixArray=gE,f.sortRules=J0,f.sortRulesByDesc=Z0,f.sortRulesFactory=Nr,f.spliceArray=Ao,f.splitIntoGrid=Fo,f.takeAfter=Ni,f.textDiff=Vo,f.throttle=Vd,f.toDisposable=Ye,f.touchDependencies=Sa,f.updateAttributeByDelete=dh,f.updateAttributeByInsert=fh,f.willLoseNumericPrecision=a_,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(e,t){typeof exports==`object`&&typeof module<`u`?t(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`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverCore={},e[`@wendellhu/redi`],e.rxjs,e.rxjs.operators,e.UniverThemes))})(this,function(e,t,n,r,i){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var a=Object.create,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,l=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,d=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),f=(e,t)=>{let n={};for(var r in e)o(n,r,{get:e[r],enumerable:!0});return t||o(n,Symbol.toStringTag,{value:`Module`}),n},p=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=c(t),a=0,l=i.length,d;a<l;a++)d=i[a],!u.call(e,d)&&d!==n&&o(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=s(t,d))||r.enumerable});return e},m=(e,t,n)=>(n=e==null?{}:a(l(e)),p(t||!e||!e.__esModule?o(n,`default`,{value:e,enumerable:!0}):n,e));let h=typeof global<`u`?global:typeof self<`u`?self:window;function g(){let e=new Map,t=0;typeof h.requestIdleCallback!=`function`&&(h.requestIdleCallback=function(n){let r=Date.now(),i=++t,a=setTimeout(function(){e.delete(i);let t=Math.max(0,50-(Date.now()-r));n({didTimeout:t===0,timeRemaining(){return t}})},1);return e.set(i,a),i}),typeof h.cancelIdleCallback!=`function`&&(h.cancelIdleCallback=function(t){let n=e.get(t);n!==void 0&&(clearTimeout(n),e.delete(t))})}function _(){typeof h.Array.prototype.findLastIndex!=`function`&&(h.Array.prototype.findLastIndex=function(e,t){if(this==null)throw TypeError(`Array.prototype.findLastIndex called on null or undefined`);if(typeof e!=`function`)throw TypeError(`callback must be a function`);let n=this.length>>>0;for(let r=n-1;r>=0;r--)if(r in this&&e.call(t,this[r],r,this))return r;return-1}),typeof h.Array.prototype.findLast!=`function`&&(h.Array.prototype.findLast=function(e,t){let n=this.findLastIndex(e,t);return n===-1?void 0:this[n]})}function v(){typeof h.String.prototype.at!=`function`&&(h.String.prototype.at=function(e){if(this==null)throw TypeError(`String.prototype.at called on null or undefined`);let t=this.length;if(e<0&&(e=t+e),!(e<0||e>=t))return this.charAt(e)})}function y(){g(),_(),v()}function b(e,t){let n=e.indexOf(t);return n>-1?(e.splice(n,1),!0):!1}function x(e){let t=new Set,n=[];for(let r of e)t.has(r)||(t.add(r),n.push(r));return n}function S(e,t){let n=new Set,r=[];for(let i of e){let e=t(i);n.has(e)||(n.add(e),r.push(i))}return r}function C(e,t){for(let n=e.length-1;n>-1;n--){let r=e[n];if(t(r,n))return r}return null}function w(e,t){if(e.length===0)return e;let n=t%e.length;return e.slice(n).concat(e.slice(0,n))}function T(e,t){let n=new Map;return e.forEach(e=>{let r=t(e),i=n.get(r);n.has(r)||(i=[],n.set(r,i)),i.push(e)}),n}function E(e){return Array.isArray(e)?e:[e]}var D=d(((e,t)=>{var n=function(e){if(e=e||{},this.Promise=e.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=e.domainReentrant||!1,this.domainReentrant){if(typeof process>`u`||process.domain===void 0)throw 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=e.timeout||n.DEFAULT_TIMEOUT,this.maxOccupationTime=e.maxOccupationTime||n.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=e.maxExecutionTime||n.DEFAULT_MAX_EXECUTION_TIME,e.maxPending===1/0||Number.isInteger(e.maxPending)&&e.maxPending>=0?this.maxPending=e.maxPending:this.maxPending=n.DEFAULT_MAX_PENDING};n.DEFAULT_TIMEOUT=0,n.DEFAULT_MAX_OCCUPATION_TIME=0,n.DEFAULT_MAX_EXECUTION_TIME=0,n.DEFAULT_MAX_PENDING=1e3,n.prototype.acquire=function(e,t,n,r){if(Array.isArray(e))return this._acquireBatch(e,t,n,r);if(typeof t!=`function`)throw Error(`You must pass a function to execute`);var i=null,a=null,o=null;typeof n!=`function`&&(r=n,n=null,o=new this.Promise(function(e,t){i=e,a=t})),r=r||{};var s=!1,c=null,l=null,u=null,d=this,f=function(t,r,c){l&&(clearTimeout(l),l=null),u&&(clearTimeout(u),u=null),t&&(d.queues[e]&&d.queues[e].length===0&&delete d.queues[e],d.domainReentrant&&delete d.domains[e]),s||(o?r?a(r):i(c):typeof n==`function`&&n(r,c),s=!0),t&&d.queues[e]&&d.queues[e].length>0&&d.queues[e].shift()()},p=function(n){if(s)return f(n);c&&(clearTimeout(c),c=null),d.domainReentrant&&n&&(d.domains[e]=process.domain);var i=r.maxExecutionTime||d.maxExecutionTime;if(i&&(u=setTimeout(function(){d.queues[e]&&f(n,Error(`Maximum execution time is exceeded `+e))},i)),t.length===1){var a=!1;try{t(function(e,t){a||(a=!0,f(n,e,t))})}catch(e){a||(a=!0,f(n,e))}}else d._promiseTry(function(){return t()}).then(function(e){f(n,void 0,e)},function(e){f(n,e)})};d.domainReentrant&&process.domain&&(p=process.domain.bind(p));var m=r.maxPending||d.maxPending;if(!d.queues[e])d.queues[e]=[],p(!0);else if(d.domainReentrant&&process.domain&&process.domain===d.domains[e])p(!1);else if(d.queues[e].length>=m)f(!1,Error(`Too many pending tasks in queue `+e));else{var h=function(){p(!0)};r.skipQueue?d.queues[e].unshift(h):d.queues[e].push(h);var g=r.timeout||d.timeout;g&&(c=setTimeout(function(){c=null,f(!1,Error(`async-lock timed out in queue `+e))},g))}var _=r.maxOccupationTime||d.maxOccupationTime;if(_&&(l=setTimeout(function(){d.queues[e]&&f(!1,Error(`Maximum occupation time is exceeded in queue `+e))},_)),o)return o},n.prototype._acquireBatch=function(e,t,n,r){typeof n!=`function`&&(r=n,n=null);var i=this,a=function(e,t){return function(n){i.acquire(e,t,n,r)}},o=e.reduceRight(function(e,t){return a(t,e)},t);if(typeof n==`function`)o(n);else return new this.Promise(function(e,t){o.length===1?o(function(n,r){n?t(n):e(r)}):e(o())})},n.prototype.isBusy=function(e){return e?!!this.queues[e]:Object.keys(this.queues).length>0},n.prototype._promiseTry=function(e){try{return this.Promise.resolve(e())}catch(e){return this.Promise.reject(e)}},t.exports=n})),O=m(d(((e,t)=>{t.exports=D()}))());let k=new Set([`true`,`false`]);function A(e){return k.has(e.toLowerCase())}let j=`__INTERNAL_EDITOR__`,M=`${j}DOCS_NORMAL`,N=`${j}DOCS_FORMULA_BAR`,ee=`${j}ZEN_EDITOR`,te=`${j}COMMENT_EDITOR`,ne=Symbol(`AUTO_HEIGHT_FOR_MERGED_CELLS`);function re(e){return`${j}${e}`}function ie(e){return e.startsWith(j)}function ae(e){return e===te}function oe(e,t){t.forEach(t=>e.add(t))}function se(e,t){t.forEach(([t])=>{e.has(t)&&e.get(t)})}function ce(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;let i=Object.prototype.hasOwnProperty.bind(t);for(let r=0;r<n.length;r++){let a=n[r];if(!i(a)||e[a]!==t[a])return!1}return!0}var le=class extends Error{constructor(e){super(e),this.name=`CustomCommandExecutionError`}},ue=class extends le{constructor(){super(`Canceled by facade`),this.name=`CanceledError`}};function de(e,t=16){let n=0,r=null;return function(...i){let a=Date.now();a-n<t?(r&&clearTimeout(r),r=setTimeout(()=>{n=a,e.apply(this,i)},t)):(n=a,e.apply(this,i))}}function fe(e){"@babel/helpers - typeof";return fe=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},fe(e)}function pe(e,t){if(fe(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(fe(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function me(e){var t=pe(e,`string`);return fe(t)==`symbol`?t:t+``}function P(e,t,n){return(t=me(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let he=function(e){return e[e.Style=1]=`Style`,e[e.Value=2]=`Value`,e}({});function ge(e){return`sheet_interceptor_${e}`}let _e=e=>function(t,n){let r=-1,i=t;for(let t=0;t<=e.length;t++){if(t<=r)throw Error(`[SheetInterceptorService]: next() called multiple times!`);if(r=t,t===e.length)return i;let a=e[t],o=!1;if(i=a.handler(i,n,e=>(o=!0,e)),!o)break}return i};var ve=class{constructor(e){P(this,`_interceptorsByName`,new Map),P(this,`_interceptorPoints`,void 0),this._interceptorPoints=e}fetchThroughInterceptors(e,t){let n=e,r=this._interceptorsByName.get(n);return t&&(r=r.filter(t)),_e(r||[])}intercept(e,t){let n=e;this._interceptorsByName.has(n)||this._interceptorsByName.set(n,[]);let r=this._interceptorsByName.get(n);return r.push(t),this._interceptorsByName.set(n,r.sort((e,t)=>{var n,r;return((n=t.priority)==null?0:n)-((r=e.priority)==null?0:r)})),()=>b(this._interceptorsByName.get(n),t)}getInterceptPoints(){return this._interceptorPoints}dispose(){this._interceptorsByName.clear()}};function ye(e){return`sheet_async_interceptor_${e}`}let be=e=>async function(t,n){let r=-1,i=t;for(let t=0;t<=e.length;t++){if(t<=r)throw Error(`[SheetInterceptorService]: next() called multiple times!`);if(r=t,t===e.length)return i;let a=e[t],o=!1;if(i=await a.handler(i,n,async e=>(o=!0,e)),!o)break}return i};var xe=class{constructor(e){P(this,`_asyncInterceptorsByName`,new Map),P(this,`_asyncInterceptorPoints`,void 0),this._asyncInterceptorPoints=e}fetchThroughAsyncInterceptors(e,t){let n=e,r=this._asyncInterceptorsByName.get(n);return t&&(r=r.filter(t)),be(r||[])}async interceptAsync(e,t){let n=e;this._asyncInterceptorsByName.has(n)||this._asyncInterceptorsByName.set(n,[]);let r=this._asyncInterceptorsByName.get(n);return r.push(t),this._asyncInterceptorsByName.set(n,r.sort((e,t)=>{var n,r;return((n=t.priority)==null?0:n)-((r=e.priority)==null?0:r)})),()=>b(this._asyncInterceptorsByName.get(n),t)}getInterceptPoints(){return this._asyncInterceptorPoints}dispose(){this._asyncInterceptorsByName.clear()}};function Se(e){return e.map(e=>e/255)}function Ce(e){return e.map(e=>Math.round(e*255))}function we([e,t,n]){let r=Math.max(e,t,n),i=Math.min(e,t,n),a=(r+i)/2,o=0,s=0;if(r!==i){let c=r-i;switch(s=a>.5?c/(2-r-i):c/(r+i),r){case e:o=(t-n)/c+(t<n?6:0);break;case t:o=(n-e)/c+2;break;case n:o=(e-t)/c+4;break}o/=6}return[o,s,a]}function Te(e,t,n){let r=[e,t,n].map(e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4);return .2126*r[0]+.7152*r[1]+.0722*r[2]}function Ee(e,t){return(Math.max(e,t)+.05)/(Math.min(e,t)+.05)}function De(e,t,n){let r,i,a;if(t===0)r=i=a=n;else{let o=(e,t,n)=>{let r=n;return r<0&&(r+=1),r>1&&--r,r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e},s=n<.5?n*(1+t):n+t-n*t,c=2*n-s;r=o(c,s,e+1/3),i=o(c,s,e),a=o(c,s,e-1/3)}return[r,i,a]}let Oe={r:1,g:1,b:1},ke={r:0,g:0,b:0},Ae=Te(Oe.r,Oe.g,Oe.b),je=Te(ke.r,ke.g,ke.b);function Me(e){let t=Ee(Ae,Te(e[0],e[1],e[2])),n=we(e),r=1-n[2],i,a,o;do i=De(n[0],n[1],r),a=Te(i[0],i[1],i[2]),o=Ee(a,je),r+=.01;while(r<=1&&r>=0&&Math.abs(o-t)<.01);return i}function Ne(e){return Ce(Me(Se(e)))}let Pe=[[.333,-.667,-.667,0,1],[-.667,.333,-.667,0,1],[-.667,-.667,.333,0,1],[0,0,0,1,0]];function Fe(e){let t=e[0],n=e[1],r=e[2],i=[Pe[0][0]*t+Pe[0][1]*n+Pe[0][2]*r+Pe[0][4],Pe[1][0]*t+Pe[1][1]*n+Pe[1][2]*r+Pe[1][4],Pe[2][0]*t+Pe[2][1]*n+Pe[2][2]*r+Pe[2][4]];return i=i.map(e=>e>1?1:e<0?0:e),i}function Ie(e){return Ce(Fe(Se(e)))}var Le=typeof global==`object`&&global&&global.Object===Object&&global,Re=typeof self==`object`&&self&&self.Object===Object&&self,ze=Le||Re||Function(`return this`)(),Be=ze.Symbol,Ve=Object.prototype,He=Ve.hasOwnProperty,Ue=Ve.toString,We=Be?Be.toStringTag:void 0;function Ge(e){var t=He.call(e,We),n=e[We];try{e[We]=void 0;var r=!0}catch{}var i=Ue.call(e);return r&&(t?e[We]=n:delete e[We]),i}var Ke=Object.prototype.toString;function qe(e){return Ke.call(e)}var Je=`[object Null]`,Ye=`[object Undefined]`,Xe=Be?Be.toStringTag:void 0;function Ze(e){return e==null?e===void 0?Ye:Je:Xe&&Xe in Object(e)?Ge(e):qe(e)}function Qe(e){return typeof e==`object`&&!!e}var $e=`[object Symbol]`;function et(e){return typeof e==`symbol`||Qe(e)&&Ze(e)==$e}function tt(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var nt=Array.isArray,rt=1/0,it=Be?Be.prototype:void 0,at=it?it.toString:void 0;function ot(e){if(typeof e==`string`)return e;if(nt(e))return tt(e,ot)+``;if(et(e))return at?at.call(e):``;var t=e+``;return t==`0`&&1/e==-rt?`-0`:t}var st=/\s/;function ct(e){for(var t=e.length;t--&&st.test(e.charAt(t)););return t}var lt=/^\s+/;function ut(e){return e&&e.slice(0,ct(e)+1).replace(lt,``)}function dt(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var ft=NaN,pt=/^[-+]0x[0-9a-f]+$/i,mt=/^0b[01]+$/i,ht=/^0o[0-7]+$/i,gt=parseInt;function _t(e){if(typeof e==`number`)return e;if(et(e))return ft;if(dt(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=dt(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=ut(e);var n=mt.test(e);return n||ht.test(e)?gt(e.slice(2),n?2:8):pt.test(e)?ft:+e}function vt(e){return e}var yt=`[object AsyncFunction]`,bt=`[object Function]`,xt=`[object GeneratorFunction]`,St=`[object Proxy]`;function Ct(e){if(!dt(e))return!1;var t=Ze(e);return t==bt||t==xt||t==yt||t==St}var wt=ze[`__core-js_shared__`],Tt=function(){var e=/[^.]+$/.exec(wt&&wt.keys&&wt.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function Et(e){return!!Tt&&Tt in e}var Dt=Function.prototype.toString;function Ot(e){if(e!=null){try{return Dt.call(e)}catch{}try{return e+``}catch{}}return``}var kt=/[\\^$.*+?()[\]{}|]/g,At=/^\[object .+?Constructor\]$/,jt=Function.prototype,Mt=Object.prototype,Nt=jt.toString,Pt=Mt.hasOwnProperty,Ft=RegExp(`^`+Nt.call(Pt).replace(kt,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function It(e){return!dt(e)||Et(e)?!1:(Ct(e)?Ft:At).test(Ot(e))}function Lt(e,t){return e==null?void 0:e[t]}function Rt(e,t){var n=Lt(e,t);return It(n)?n:void 0}var zt=Object.create,Bt=function(){function e(){}return function(t){if(!dt(t))return{};if(zt)return zt(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Vt(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 Ht(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Ut=800,Wt=16,Gt=Date.now;function Kt(e){var t=0,n=0;return function(){var r=Gt(),i=Wt-(r-n);if(n=r,i>0){if(++t>=Ut)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function qt(e){return function(){return e}}var Jt=function(){try{var e=Rt(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),Yt=Kt(Jt?function(e,t){return Jt(e,`toString`,{configurable:!0,enumerable:!1,value:qt(t),writable:!0})}:vt),Xt=9007199254740991,Zt=/^(?:0|[1-9]\d*)$/;function Qt(e,t){var n=typeof e;return t=t==null?Xt:t,!!t&&(n==`number`||n!=`symbol`&&Zt.test(e))&&e>-1&&e%1==0&&e<t}function $t(e,t,n){t==`__proto__`&&Jt?Jt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function en(e,t){return e===t||e!==e&&t!==t}var tn=Object.prototype.hasOwnProperty;function nn(e,t,n){var r=e[t];(!(tn.call(e,t)&&en(r,n))||n===void 0&&!(t in e))&&$t(e,t,n)}function rn(e,t,n,r){var i=!n;n||(n={});for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?$t(n,s,c):nn(n,s,c)}return n}var an=Math.max;function on(e,t,n){return t=an(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=an(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),Vt(e,this,s)}}function sn(e,t){return Yt(on(e,t,vt),e+``)}var cn=9007199254740991;function ln(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=cn}function un(e){return e!=null&&ln(e.length)&&!Ct(e)}function dn(e,t,n){if(!dt(n))return!1;var r=typeof t;return(r==`number`?un(n)&&Qt(t,n.length):r==`string`&&t in n)?en(n[t],e):!1}function fn(e){return sn(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&dn(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}var pn=Object.prototype;function mn(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||pn)}function hn(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var gn=`[object Arguments]`;function _n(e){return Qe(e)&&Ze(e)==gn}var vn=Object.prototype,yn=vn.hasOwnProperty,bn=vn.propertyIsEnumerable,xn=_n(function(){return arguments}())?_n:function(e){return Qe(e)&&yn.call(e,`callee`)&&!bn.call(e,`callee`)};function Sn(){return!1}var Cn=typeof e==`object`&&e&&!e.nodeType&&e,wn=Cn&&typeof module==`object`&&module&&!module.nodeType&&module,Tn=wn&&wn.exports===Cn?ze.Buffer:void 0,En=(Tn?Tn.isBuffer:void 0)||Sn,Dn=`[object Arguments]`,On=`[object Array]`,kn=`[object Boolean]`,An=`[object Date]`,jn=`[object Error]`,Mn=`[object Function]`,Nn=`[object Map]`,Pn=`[object Number]`,Fn=`[object Object]`,In=`[object RegExp]`,Ln=`[object Set]`,Rn=`[object String]`,zn=`[object WeakMap]`,Bn=`[object ArrayBuffer]`,Vn=`[object DataView]`,Hn=`[object Float32Array]`,Un=`[object Float64Array]`,Wn=`[object Int8Array]`,Gn=`[object Int16Array]`,Kn=`[object Int32Array]`,qn=`[object Uint8Array]`,Jn=`[object Uint8ClampedArray]`,Yn=`[object Uint16Array]`,Xn=`[object Uint32Array]`,F={};F[Hn]=F[Un]=F[Wn]=F[Gn]=F[Kn]=F[qn]=F[Jn]=F[Yn]=F[Xn]=!0,F[Dn]=F[On]=F[Bn]=F[kn]=F[Vn]=F[An]=F[jn]=F[Mn]=F[Nn]=F[Pn]=F[Fn]=F[In]=F[Ln]=F[Rn]=F[zn]=!1;function Zn(e){return Qe(e)&&ln(e.length)&&!!F[Ze(e)]}function Qn(e){return function(t){return e(t)}}var $n=typeof e==`object`&&e&&!e.nodeType&&e,er=$n&&typeof module==`object`&&module&&!module.nodeType&&module,tr=er&&er.exports===$n&&Le.process,nr=function(){try{return er&&er.require&&er.require(`util`).types||tr&&tr.binding&&tr.binding(`util`)}catch{}}(),rr=nr&&nr.isTypedArray,ir=rr?Qn(rr):Zn,ar=Object.prototype.hasOwnProperty;function or(e,t){var n=nt(e),r=!n&&xn(e),i=!n&&!r&&En(e),a=!n&&!r&&!i&&ir(e),o=n||r||i||a,s=o?hn(e.length,String):[],c=s.length;for(var l in e)(t||ar.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||Qt(l,c)))&&s.push(l);return s}function sr(e,t){return function(n){return e(t(n))}}function cr(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var lr=Object.prototype.hasOwnProperty;function ur(e){if(!dt(e))return cr(e);var t=mn(e),n=[];for(var r in e)r==`constructor`&&(t||!lr.call(e,r))||n.push(r);return n}function dr(e){return un(e)?or(e,!0):ur(e)}var fr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pr=/^\w*$/;function mr(e,t){if(nt(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||et(e)?!0:pr.test(e)||!fr.test(e)||t!=null&&e in Object(t)}var hr=Rt(Object,`create`);function gr(){this.__data__=hr?hr(null):{},this.size=0}function _r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var vr=`__lodash_hash_undefined__`,yr=Object.prototype.hasOwnProperty;function br(e){var t=this.__data__;if(hr){var n=t[e];return n===vr?void 0:n}return yr.call(t,e)?t[e]:void 0}var xr=Object.prototype.hasOwnProperty;function Sr(e){var t=this.__data__;return hr?t[e]!==void 0:xr.call(t,e)}var Cr=`__lodash_hash_undefined__`;function wr(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=hr&&t===void 0?Cr:t,this}function Tr(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])}}Tr.prototype.clear=gr,Tr.prototype.delete=_r,Tr.prototype.get=br,Tr.prototype.has=Sr,Tr.prototype.set=wr;function Er(){this.__data__=[],this.size=0}function Dr(e,t){for(var n=e.length;n--;)if(en(e[n][0],t))return n;return-1}var Or=Array.prototype.splice;function kr(e){var t=this.__data__,n=Dr(t,e);return n<0?!1:(n==t.length-1?t.pop():Or.call(t,n,1),--this.size,!0)}function Ar(e){var t=this.__data__,n=Dr(t,e);return n<0?void 0:t[n][1]}function jr(e){return Dr(this.__data__,e)>-1}function Mr(e,t){var n=this.__data__,r=Dr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Nr(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])}}Nr.prototype.clear=Er,Nr.prototype.delete=kr,Nr.prototype.get=Ar,Nr.prototype.has=jr,Nr.prototype.set=Mr;var Pr=Rt(ze,`Map`);function Fr(){this.size=0,this.__data__={hash:new Tr,map:new(Pr||Nr),string:new Tr}}function Ir(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function Lr(e,t){var n=e.__data__;return Ir(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function Rr(e){var t=Lr(this,e).delete(e);return this.size-=t?1:0,t}function zr(e){return Lr(this,e).get(e)}function Br(e){return Lr(this,e).has(e)}function Vr(e,t){var n=Lr(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Hr(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])}}Hr.prototype.clear=Fr,Hr.prototype.delete=Rr,Hr.prototype.get=zr,Hr.prototype.has=Br,Hr.prototype.set=Vr;var Ur=`Expected a function`;function Wr(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(Ur);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(Wr.Cache||Hr),n}Wr.Cache=Hr;var Gr=500;function Kr(e){var t=Wr(e,function(e){return n.size===Gr&&n.clear(),e}),n=t.cache;return t}var qr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Jr=/\\(\\)?/g,Yr=Kr(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(qr,function(e,n,r,i){t.push(r?i.replace(Jr,`$1`):n||e)}),t});function Xr(e){return e==null?``:ot(e)}function Zr(e,t){return nt(e)?e:mr(e,t)?[e]:Yr(Xr(e))}var Qr=1/0;function $r(e){if(typeof e==`string`||et(e))return e;var t=e+``;return t==`0`&&1/e==-Qr?`-0`:t}function ei(e,t){t=Zr(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[$r(t[n++])];return n&&n==r?e:void 0}function ti(e,t,n){var r=e==null?void 0:ei(e,t);return r===void 0?n:r}var ni=sr(Object.getPrototypeOf,Object),ri=`[object Object]`,ii=Function.prototype,ai=Object.prototype,oi=ii.toString,si=ai.hasOwnProperty,ci=oi.call(Object);function li(e){if(!Qe(e)||Ze(e)!=ri)return!1;var t=ni(e);if(t===null)return!0;var n=si.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&oi.call(n)==ci}function ui(){this.__data__=new Nr,this.size=0}function di(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function fi(e){return this.__data__.get(e)}function pi(e){return this.__data__.has(e)}var mi=200;function hi(e,t){var n=this.__data__;if(n instanceof Nr){var r=n.__data__;if(!Pr||r.length<mi-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Hr(r)}return n.set(e,t),this.size=n.size,this}function gi(e){this.size=(this.__data__=new Nr(e)).size}gi.prototype.clear=ui,gi.prototype.delete=di,gi.prototype.get=fi,gi.prototype.has=pi,gi.prototype.set=hi;var _i=typeof e==`object`&&e&&!e.nodeType&&e,vi=_i&&typeof module==`object`&&module&&!module.nodeType&&module,yi=vi&&vi.exports===_i?ze.Buffer:void 0,bi=yi?yi.allocUnsafe:void 0;function xi(e,t){if(t)return e.slice();var n=e.length,r=bi?bi(n):new e.constructor(n);return e.copy(r),r}var Si=ze.Uint8Array;function Ci(e){var t=new e.constructor(e.byteLength);return new Si(t).set(new Si(e)),t}function wi(e,t){var n=t?Ci(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ti(e){return typeof e.constructor==`function`&&!mn(e)?Bt(ni(e)):{}}function Ei(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}var Di=Ei(),Oi=function(){return ze.Date.now()},ki=`Expected a function`,Ai=Math.max,ji=Math.min;function Mi(e,t,n){var r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0;if(typeof e!=`function`)throw TypeError(ki);t=_t(t)||0,dt(n)&&(u=!!n.leading,d=`maxWait`in n,a=d?Ai(_t(n.maxWait)||0,t):a,f=`trailing`in n?!!n.trailing:f);function p(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function m(e){return l=e,s=setTimeout(_,t),u?p(e):o}function h(e){var n=e-c,r=e-l,i=t-n;return d?ji(i,a-r):i}function g(e){var n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function _(){var e=Oi();if(g(e))return v(e);s=setTimeout(_,h(e))}function v(e){return s=void 0,f&&r?p(e):(r=i=void 0,o)}function y(){s!==void 0&&clearTimeout(s),l=0,r=c=i=s=void 0}function b(){return s===void 0?o:v(Oi())}function x(){var e=Oi(),n=g(e);if(r=arguments,i=this,c=e,n){if(s===void 0)return m(c);if(d)return clearTimeout(s),s=setTimeout(_,t),p(c)}return s===void 0&&(s=setTimeout(_,t)),o}return x.cancel=y,x.flush=b,x}function Ni(e,t,n){(n!==void 0&&!en(e[t],n)||n===void 0&&!(t in e))&&$t(e,t,n)}function Pi(e){return Qe(e)&&un(e)}function Fi(e,t){if(!(t===`constructor`&&typeof e[t]==`function`)&&t!=`__proto__`)return e[t]}function Ii(e){return rn(e,dr(e))}function Li(e,t,n,r,i,a,o){var s=Fi(e,n),c=Fi(t,n),l=o.get(c);if(l){Ni(e,n,l);return}var u=a?a(s,c,n+``,e,t,o):void 0,d=u===void 0;if(d){var f=nt(c),p=!f&&En(c),m=!f&&!p&&ir(c);u=c,f||p||m?nt(s)?u=s:Pi(s)?u=Ht(s):p?(d=!1,u=xi(c,!0)):m?(d=!1,u=wi(c,!0)):u=[]:li(c)||xn(c)?(u=s,xn(s)?u=Ii(s):(!dt(s)||Ct(s))&&(u=Ti(c))):d=!1}d&&(o.set(c,u),i(u,c,r,a,o),o.delete(c)),Ni(e,n,u)}function Ri(e,t,n,r,i){e!==t&&Di(t,function(a,o){if(i||(i=new gi),dt(a))Li(e,t,o,n,Ri,r,i);else{var s=r?r(Fi(e,o),a,o+``,e,t,i):void 0;s===void 0&&(s=a),Ni(e,o,s)}},dr)}var zi=fn(function(e,t,n,r){Ri(e,t,n,r)}),Bi=fn(function(e,t,n){Ri(e,t,n)});function Vi(e,t,n,r){if(!dt(e))return e;t=Zr(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i<a;){var c=$r(t[i]),l=n;if(c===`__proto__`||c===`constructor`||c===`prototype`)return e;if(i!=o){var u=s[c];l=r?r(u,c,s):void 0,l===void 0&&(l=dt(u)?u:Qt(t[i+1])?[]:{})}nn(s,c,l),s=s[c]}return e}function Hi(e,t,n){return e==null?e:Vi(e,t,n)}var Ui=class{constructor(){P(this,`cursor`,0)}reset(){return this.cursor=0,this}moveCursor(e){this.cursor+=e}moveCursorTo(e){this.cursor=e}};function Wi(e,t){for(let n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}function Gi(e){return/^-?\d+(\.\d+)?$/.test(e)}function Ki(e){return Gi(e)?Number(e)<=2**53-1:!1}function qi(e){return Number(e)>2**53-1||e.length>=18}var Ji=class e{constructor(){P(this,`_data`,[])}static create(){return new e}add(e){this._data.indexOf(e)>-1||this._data.push(e)}delete(e){let t=this._data.indexOf(e);this._data.splice(t,1)}getData(){return this._data}},Yi=class e{constructor(){P(this,`_data`,new Map)}static create(){return new e}add(e,t){this._data.has(e)||this._data.set(e,t)}delete(e){this._data.delete(e)}getData(){return this._data}};function Xi(e){let t=new MessageChannel,n=!1,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 Zi(e){for(let[t,n]of e.entries())try{if(!await n())return{index:t,result:!1}}catch(e){return{index:t,result:!1,error:e}}return{result:!0,index:-1}}function Qi(e){for(let[t,n]of e.entries())try{if(!n())return{index:t,result:!1}}catch(e){return{index:t,result:!1,error:e}}return{result:!0,index:-1}}function $i(e,t){return t.forEach(t=>e.add(t)),e}function ea(e){return e instanceof n.Subscription||e instanceof n.Subject||e&&`closed`in e&&e.unsubscribe!==void 0}function ta(e){let t=!1;return e?ea(e)?{dispose:()=>e.unsubscribe()}:typeof e==`function`?{dispose:()=>{t||(t=!0,e())}}:e:ta(()=>{})}var na=class{constructor(){P(this,`_disposables`,new Set)}add(e){let t=ta(e);return this._disposables.add(t),{dispose:(e=!1)=>{e||t.dispose(),this._disposables.delete(t)}}}dispose(){this._disposables.forEach(e=>{e.dispose()}),this._disposables.clear()}},ra=class{constructor(){P(this,`_disposed`,!1),P(this,`_collection`,new na)}disposeWithMe(e){return this._collection.add(e)}ensureNotDisposed(){if(this._disposed)throw Error(`[Disposable]: object is disposed!`)}dispose(){this._disposed||(this._disposed=!0,this._collection.dispose())}},ia=class extends ra{constructor(...e){super(...e),P(this,`dispose$`,new n.Subject)}dispose(){super.dispose(),this.dispose$.next(),this.dispose$.complete()}},aa=class extends ra{constructor(e){super(),this._rootDisposable=e,P(this,`_ref`,0)}inc(){if(this._disposed)throw Error(`[RCDisposable]: should not ref to a disposed.`);this._ref+=1}dec(){--this._ref,this._ref===0&&(this._rootDisposable.dispose(),this.dispose())}},oa=(e=>(e[e.OpenOrReOpen=0]=`OpenOrReOpen`,e[e.Solved=1]=`Solved`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(oa||{}),sa=(e=>(e[e.Unknown=0]=`Unknown`,e[e.Add=1]=`Add`,e[e.Reply=2]=`Reply`,e[e.Edit=3]=`Edit`,e[e.Delete=4]=`Delete`,e[e.Solve=5]=`Solve`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(sa||{}),ca=(e=>(e[e.UNDEFINED=0]=`UNDEFINED`,e[e.OK=1]=`OK`,e[e.INTERNAL_ERROR=2]=`INTERNAL_ERROR`,e[e.PERMISSION_DENIED=3]=`PERMISSION_DENIED`,e[e.NOT_FOUND=4]=`NOT_FOUND`,e[e.UNAUTHENTICATED=5]=`UNAUTHENTICATED`,e[e.ALREADY_EXISTS=6]=`ALREADY_EXISTS`,e[e.INVALID_ARGUMENT=7]=`INVALID_ARGUMENT`,e[e.TOO_MANY_REQUESTS=8]=`TOO_MANY_REQUESTS`,e[e.COMPLETION_FINISHED=9]=`COMPLETION_FINISHED`,e[e.LOGIN_FAILED=10]=`LOGIN_FAILED`,e[e.MOBILE_VERIFY_CODE_MISMATCH=11]=`MOBILE_VERIFY_CODE_MISMATCH`,e[e.MOBILE_VERIFY_CODE_NOT_FOUND_OR_EXPIRED=12]=`MOBILE_VERIFY_CODE_NOT_FOUND_OR_EXPIRED`,e[e.EMAIL_VERIFY_CODE_MISMATCH=13]=`EMAIL_VERIFY_CODE_MISMATCH`,e[e.EMAIL_VERIFY_CODE_NOT_FOUND_OR_EXPIRED=14]=`EMAIL_VERIFY_CODE_NOT_FOUND_OR_EXPIRED`,e[e.AUTHORIZE_CODE_ILLEGAL=15]=`AUTHORIZE_CODE_ILLEGAL`,e[e.LOGIN_TOKEN_PROCESSING_FAILED=16]=`LOGIN_TOKEN_PROCESSING_FAILED`,e[e.CURRENT_STATUS_CANNOT_OPERATE=100]=`CURRENT_STATUS_CANNOT_OPERATE`,e[e.ERROR_AGAIN=101]=`ERROR_AGAIN`,e[e.USER_NOT_FOUND=201]=`USER_NOT_FOUND`,e[e.USER_IS_ANONYMOUS=202]=`USER_IS_ANONYMOUS`,e[e.CHANGESET_REVISION_CONFILICT=5001]=`CHANGESET_REVISION_CONFILICT`,e[e.SNAPSHOT_INVALID_SNAPSHOT=6001]=`SNAPSHOT_INVALID_SNAPSHOT`,e[e.SNAPSHOT_HAS_BEEN_REMOVED=6002]=`SNAPSHOT_HAS_BEEN_REMOVED`,e[e.ENSURE_SNAPSHOT_EXECUTION=6003]=`ENSURE_SNAPSHOT_EXECUTION`,e[e.APPLY_REJECT=7001]=`APPLY_REJECT`,e[e.APPLY_NON_SEQUENTIAL_REVISION=7002]=`APPLY_NON_SEQUENTIAL_REVISION`,e[e.APPLY_REVISION_CONFILICT=7003]=`APPLY_REVISION_CONFILICT`,e[e.APPLY_PERMISSION_DENIED=7004]=`APPLY_PERMISSION_DENIED`,e[e.APPLY_DUPLICATED=7005]=`APPLY_DUPLICATED`,e[e.CONNECTOR_DATA_TOO_LARGE=8001]=`CONNECTOR_DATA_TOO_LARGE`,e[e.LICENSE_MAX_UNITS_EXCEEDED=9001]=`LICENSE_MAX_UNITS_EXCEEDED`,e[e.LICENSE_MAX_MEMBERS_PER_UNIT_EXCEEDED=9002]=`LICENSE_MAX_MEMBERS_PER_UNIT_EXCEEDED`,e[e.LICENSE_IMPORT_SIZE_EXCEEDED=9003]=`LICENSE_IMPORT_SIZE_EXCEEDED`,e[e.LICENSE_EXPORT_SIZE_EXCEEDED=9004]=`LICENSE_EXPORT_SIZE_EXCEEDED`,e[e.LICENSE_DISTRO_REJECTED=9005]=`LICENSE_DISTRO_REJECTED`,e[e.YUUMI_UNABLE_LOAD_URL=10001]=`YUUMI_UNABLE_LOAD_URL`,e[e.YUUMI_URL_COL_OUT_OF_RANGE=10002]=`YUUMI_URL_COL_OUT_OF_RANGE`,e[e.YUUMI_RATE_OVER_LIMIT=10003]=`YUUMI_RATE_OVER_LIMIT`,e[e.YUUMI_SUBSCRIPTION_NOT_FOUND=10004]=`YUUMI_SUBSCRIPTION_NOT_FOUND`,e[e.YUUMI_NO_CUBOID_FOR_QUESTION=10010]=`YUUMI_NO_CUBOID_FOR_QUESTION`,e[e.YUUMI_ASYNCIO_CANCELLED=10011]=`YUUMI_ASYNCIO_CANCELLED`,e[e.YUUMI_TABLE_NOT_FOUND_IN_UNIT=10012]=`YUUMI_TABLE_NOT_FOUND_IN_UNIT`,e[e.YUUMI_ALL_TABLES_IS_INVALID=10013]=`YUUMI_ALL_TABLES_IS_INVALID`,e[e.YUUMI_PROMPT_MAX_TOKENS_EXCEEDED=10014]=`YUUMI_PROMPT_MAX_TOKENS_EXCEEDED`,e[e.YUUMI_AI_RUN_FAILED=10015]=`YUUMI_AI_RUN_FAILED`,e[e.YUUMI_CONNECTOR_URL_NOT_FOUND=10016]=`YUUMI_CONNECTOR_URL_NOT_FOUND`,e[e.PY_RUNTIME_SCRIPT_ERROR=11001]=`PY_RUNTIME_SCRIPT_ERROR`,e[e.INVITE_CODE_HAS_BEEN_UES=12001]=`INVITE_CODE_HAS_BEEN_UES`,e[e.INVALID_INVITE_CODE=12002]=`INVALID_INVITE_CODE`,e[e.INVITE_CODE_REQUIRED=12003]=`INVITE_CODE_REQUIRED`,e[e.USER_NOT_INVITED_CODE=12004]=`USER_NOT_INVITED_CODE`,e[e.INVITE_CODE_ALREADY_BOUND=12005]=`INVITE_CODE_ALREADY_BOUND`,e[e.WECHAT_HAS_BEEN_BOUND=13001]=`WECHAT_HAS_BEEN_BOUND`,e[e.MOBILE_HAS_BEEN_BOUND=13002]=`MOBILE_HAS_BEEN_BOUND`,e[e.EMAIL_HAS_BEEN_BOUND=13003]=`EMAIL_HAS_BEEN_BOUND`,e[e.ENTITLE_CAN_NOT_BUY_LOWER_OTP=14001]=`ENTITLE_CAN_NOT_BUY_LOWER_OTP`,e[e.ENTITLE_UPDOWN_GRADE_NOT_SUPPORT=14002]=`ENTITLE_UPDOWN_GRADE_NOT_SUPPORT`,e[e.ENTITLE_DUP_SUBSCRIPTION=14003]=`ENTITLE_DUP_SUBSCRIPTION`,e[e.PAYMENT_CHANNEL_NOT_SUPPORT=14004]=`PAYMENT_CHANNEL_NOT_SUPPORT`,e[e.ENTITLE_INVALID_COUPON_CODE=14005]=`ENTITLE_INVALID_COUPON_CODE`,e[e.ENTITLE_COUPON_EXPIRED=14006]=`ENTITLE_COUPON_EXPIRED`,e[e.ENTITLE_COUPON_USED_UP=14007]=`ENTITLE_COUPON_USED_UP`,e[e.ENTITLE_USE_COUPON_NOT_1ST_TRADE=14008]=`ENTITLE_USE_COUPON_NOT_1ST_TRADE`,e[e.ENTITLE_CHAT_LIMIT_EXCEED=14101]=`ENTITLE_CHAT_LIMIT_EXCEED`,e[e.ENTITLE_REPORT_LIMIT_EXCEED=14102]=`ENTITLE_REPORT_LIMIT_EXCEED`,e[e.ENTITLE_INSUFFICIENT_QUOTA=14103]=`ENTITLE_INSUFFICIENT_QUOTA`,e[e.ENTITLE_NEED_BILLING_ADDRESS=14301]=`ENTITLE_NEED_BILLING_ADDRESS`,e[e.REDEMPTION_INVALID_CODE=15001]=`REDEMPTION_INVALID_CODE`,e[e.REDEMPTION_CODE_INACTIVE=15002]=`REDEMPTION_CODE_INACTIVE`,e[e.REDEMPTION_CODE_FULLY_REDEEMED=15003]=`REDEMPTION_CODE_FULLY_REDEEMED`,e[e.REDEMPTION_CODE_NOT_STARTED=15004]=`REDEMPTION_CODE_NOT_STARTED`,e[e.REDEMPTION_USER_NOT_ELIGIBLE=15005]=`REDEMPTION_USER_NOT_ELIGIBLE`,e[e.REDEMPTION_USER_REDEEM_TIMES_EXCEED=15006]=`REDEMPTION_USER_REDEEM_TIMES_EXCEED`,e[e.REDEMPTION_CODE_HAS_BEEN_CREATED=15007]=`REDEMPTION_CODE_HAS_BEEN_CREATED`,e[e.DATA_SOURCE_TOO_LARGE=16001]=`DATA_SOURCE_TOO_LARGE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(ca||{}),I=(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))(I||{}),la=(e=>(e[e.UNDEFINED=0]=`UNDEFINED`,e[e.TEXT=1]=`TEXT`,e[e.URL=2]=`URL`,e[e.IMAGE=3]=`IMAGE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(la||{}),ua=(e=>(e[e.View=0]=`View`,e[e.Edit=1]=`Edit`,e[e.ManageCollaborator=2]=`ManageCollaborator`,e[e.Print=3]=`Print`,e[e.Duplicate=4]=`Duplicate`,e[e.Comment=5]=`Comment`,e[e.Copy=6]=`Copy`,e[e.Share=7]=`Share`,e[e.Export=8]=`Export`,e[e.MoveWorksheet=9]=`MoveWorksheet`,e[e.DeleteWorksheet=10]=`DeleteWorksheet`,e[e.HideWorksheet=11]=`HideWorksheet`,e[e.RenameWorksheet=12]=`RenameWorksheet`,e[e.CreateWorksheet=13]=`CreateWorksheet`,e[e.SetWorksheetStyle=14]=`SetWorksheetStyle`,e[e.EditWorksheetCell=15]=`EditWorksheetCell`,e[e.InsertHyperlink=16]=`InsertHyperlink`,e[e.Sort=17]=`Sort`,e[e.Filter=18]=`Filter`,e[e.PivotTable=19]=`PivotTable`,e[e.FloatImg=20]=`FloatImg`,e[e.History=21]=`History`,e[e.RwHgtClWdt=22]=`RwHgtClWdt`,e[e.ViemRwHgtClWdt=23]=`ViemRwHgtClWdt`,e[e.ViewFilter=24]=`ViewFilter`,e[e.MoveSheet=25]=`MoveSheet`,e[e.DeleteSheet=26]=`DeleteSheet`,e[e.HideSheet=27]=`HideSheet`,e[e.CopySheet=28]=`CopySheet`,e[e.RenameSheet=29]=`RenameSheet`,e[e.CreateSheet=30]=`CreateSheet`,e[e.SelectProtectedCells=31]=`SelectProtectedCells`,e[e.SelectUnProtectedCells=32]=`SelectUnProtectedCells`,e[e.SetCellStyle=33]=`SetCellStyle`,e[e.SetCellValue=34]=`SetCellValue`,e[e.SetRowStyle=35]=`SetRowStyle`,e[e.SetColumnStyle=36]=`SetColumnStyle`,e[e.InsertRow=37]=`InsertRow`,e[e.InsertColumn=38]=`InsertColumn`,e[e.DeleteRow=39]=`DeleteRow`,e[e.DeleteColumn=40]=`DeleteColumn`,e[e.EditExtraObject=41]=`EditExtraObject`,e[e.Delete=42]=`Delete`,e[e.RecoverHistory=43]=`RecoverHistory`,e[e.ViewHistory=44]=`ViewHistory`,e[e.CreatePermissionObject=45]=`CreatePermissionObject`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(ua||{}),L=(e=>(e[e.Reader=0]=`Reader`,e[e.Editor=1]=`Editor`,e[e.Owner=2]=`Owner`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(L||{}),da=(e=>(e[e.Unkonwn=0]=`Unkonwn`,e[e.Workbook=1]=`Workbook`,e[e.Worksheet=2]=`Worksheet`,e[e.SelectRange=3]=`SelectRange`,e[e.Document=4]=`Document`,e[e.Slide=5]=`Slide`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(da||{}),fa=(e=>(e[e.Private=0]=`Private`,e[e.Public=1]=`Public`,e[e.Organization=2]=`Organization`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(fa||{}),pa=(e=>(e[e.SomeCollaborator=0]=`SomeCollaborator`,e[e.AllCollaborator=1]=`AllCollaborator`,e[e.OneSelf=2]=`OneSelf`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(pa||{}),ma=(e=>(e[e.UNKNOWN=0]=`UNKNOWN`,e[e.STRING=1]=`STRING`,e[e.NUMBER=2]=`NUMBER`,e[e.BOOLEAN=3]=`BOOLEAN`,e[e.FORCE_STRING=4]=`FORCE_STRING`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(ma||{}),ha=(e=>(e[e.Unknown=0]=`Unknown`,e[e.Colla=1]=`Colla`,e[e.Import=2]=`Import`,e[e.Export=3]=`Export`,e[e.CreateUnit=4]=`CreateUnit`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(ha||{}),ga=(e=>(e[e.valueBetween=0]=`valueBetween`,e[e.valueEqual=1]=`valueEqual`,e[e.valueGreaterThan=2]=`valueGreaterThan`,e[e.valueGreaterThanOrEqual=3]=`valueGreaterThanOrEqual`,e[e.valueLessThan=4]=`valueLessThan`,e[e.valueLessThanOrEqual=5]=`valueLessThanOrEqual`,e[e.valueNotBetween=6]=`valueNotBetween`,e[e.valueNotEqual=7]=`valueNotEqual`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(ga||{}),_a=(e=>(e[e.DataFragmentationType_None=0]=`DataFragmentationType_None`,e[e.DataFragmentationType_Charts=1]=`DataFragmentationType_Charts`,e[e.DataFragmentationType_Unit=2]=`DataFragmentationType_Unit`,e[e.DataFragmentationType_WorkSheetRef=3]=`DataFragmentationType_WorkSheetRef`,e[e.DataFragmentationType_Code=4]=`DataFragmentationType_Code`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(_a||{}),va=(e=>(e[e.AnalyseTaskStatus_None=0]=`AnalyseTaskStatus_None`,e[e.AnalyseTaskStatus_Analysing=1]=`AnalyseTaskStatus_Analysing`,e[e.AnalyseTaskStatus_Failed=2]=`AnalyseTaskStatus_Failed`,e[e.AnalyseTaskStatus_Completed=3]=`AnalyseTaskStatus_Completed`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(va||{}),ya=(e=>(e[e.UNKNOWN_CMD=0]=`UNKNOWN_CMD`,e[e.HELLO=1]=`HELLO`,e[e.JOIN=2]=`JOIN`,e[e.LEAVE=3]=`LEAVE`,e[e.INGEST=4]=`INGEST`,e[e.HEARTBEAT=5]=`HEARTBEAT`,e[e.RECV=6]=`RECV`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(ya||{}),ba=(e=>(e[e.UNKNOWN_CODE=0]=`UNKNOWN_CODE`,e[e.OK=1]=`OK`,e[e.FAIL=2]=`FAIL`,e[e.JOIN_ROOM_FULL=1001]=`JOIN_ROOM_FULL`,e[e.JOIN_ROOM_NOT_EXISTS=1002]=`JOIN_ROOM_NOT_EXISTS`,e[e.JOIN_ROOM_PERMISSION_DENIED=1003]=`JOIN_ROOM_PERMISSION_DENIED`,e[e.GLOBAL_ROOMS_CNT_EXCEEDS=1004]=`GLOBAL_ROOMS_CNT_EXCEEDS`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(ba||{}),xa=(e=>(e[e.Completion_None=0]=`Completion_None`,e[e.Completion_Completed=1]=`Completion_Completed`,e[e.Completion_UserCancelled=2]=`Completion_UserCancelled`,e[e.Completion_SystemErr=3]=`Completion_SystemErr`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(xa||{}),Sa=(e=>(e[e.RoleType_None=0]=`RoleType_None`,e[e.RoleType_User=1]=`RoleType_User`,e[e.RoleType_Agent=2]=`RoleType_Agent`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(Sa||{}),Ca=(e=>(e[e.ContentBlockType_None=0]=`ContentBlockType_None`,e[e.ContentBlockType_Prompt=1]=`ContentBlockType_Prompt`,e[e.ContentBlockType_Thinking=2]=`ContentBlockType_Thinking`,e[e.ContentBlockType_Report=3]=`ContentBlockType_Report`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(Ca||{}),wa=(e=>(e[e.ContentType_None=0]=`ContentType_None`,e[e.ContentType_PlainText=1]=`ContentType_PlainText`,e[e.ContentType_Markdown=2]=`ContentType_Markdown`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(wa||{}),Ta=(e=>(e[e.AttachmentType_None=0]=`AttachmentType_None`,e[e.AttachmentType_Unit=1]=`AttachmentType_Unit`,e[e.AttachmentType_Recommendation=3]=`AttachmentType_Recommendation`,e[e.AttachmentType_DataSource=4]=`AttachmentType_DataSource`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(Ta||{}),Ea=(e=>(e[e.Reaction_NoReact=0]=`Reaction_NoReact`,e[e.Reaction_ThumbsUp=1]=`Reaction_ThumbsUp`,e[e.Reaction_ThumbsDown=2]=`Reaction_ThumbsDown`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(Ea||{}),Da=(e=>(e[e.ChatSSEBlockType_None=0]=`ChatSSEBlockType_None`,e[e.ChatSSEBlockType_EndOfStream=1]=`ChatSSEBlockType_EndOfStream`,e[e.ChatSSEBlockType_Reject=2]=`ChatSSEBlockType_Reject`,e[e.ChatSSEBlockType_ModConversation=3]=`ChatSSEBlockType_ModConversation`,e[e.ChatSSEBlockType_PromptAck=4]=`ChatSSEBlockType_PromptAck`,e[e.ChatSSEBlockType_ChatContent=5]=`ChatSSEBlockType_ChatContent`,e[e.ChatSSEBlockType_Attachment=6]=`ChatSSEBlockType_Attachment`,e[e.ChatSSEBlockType_RespMeta=7]=`ChatSSEBlockType_RespMeta`,e[e.ChatSSEBlockType_StreamErr=8]=`ChatSSEBlockType_StreamErr`,e[e.ChatSSEBlockType_ChatThinking=9]=`ChatSSEBlockType_ChatThinking`,e[e.ChatSSEBlockType_Fragmentation=10]=`ChatSSEBlockType_Fragmentation`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(Da||{}),Oa=(e=>(e[e.ChatSSEStatus_None=0]=`ChatSSEStatus_None`,e[e.ChatSSEStatus_Appending=1]=`ChatSSEStatus_Appending`,e[e.ChatSSEStatus_Success=2]=`ChatSSEStatus_Success`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(Oa||{}),ka=(e=>(e[e.UNDEFINED=0]=`UNDEFINED`,e[e.UNIT=1]=`UNIT`,e[e.JSON=2]=`JSON`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(ka||{}),Aa=(e=>(e[e.ImportScene_Unspecified=0]=`ImportScene_Unspecified`,e[e.ImportScene_General=1]=`ImportScene_General`,e[e.ImportScene_AIAnalyse=2]=`ImportScene_AIAnalyse`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(Aa||{}),ja=(e=>(e[e.Undefined=0]=`Undefined`,e[e.HttpImport=1]=`HttpImport`,e[e.HttpExport=2]=`HttpExport`,e[e.UnitEmbedded=3]=`UnitEmbedded`,e[e.UnitSnapshot=4]=`UnitSnapshot`,e[e.UserProfileImg=5]=`UserProfileImg`,e[e.ClipsheetFragments=6]=`ClipsheetFragments`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(ja||{}),Ma=(e=>(e[e.UNDEFINED_ENV=0]=`UNDEFINED_ENV`,e[e.NODE=1]=`NODE`,e[e.BROWSER=2]=`BROWSER`,e[e.PYTHON=3]=`PYTHON`,e[e.REQUIREMENTS_TXT=4]=`REQUIREMENTS_TXT`,e[e.WORKSPACE_ENV_VARS=5]=`WORKSPACE_ENV_VARS`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(Ma||{}),Na=(e=>(e[e.UNKNOWN=0]=`UNKNOWN`,e[e.ROOT=1]=`ROOT`,e[e.TRASH=2]=`TRASH`,e[e.DEBUG=3]=`DEBUG`,e[e.AI_STASH=4]=`AI_STASH`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e))(Na||{}),Pa=class extends ra{};let Fa=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`.split(`.`)),Ia=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 La(e){if(!Number.isNaN(+e))return!1;if(e.startsWith(`http://localhost:3002`)||e.startsWith(`localhost:3002`))return!0;if(Ia.test(e)){if(Ra(e))return!0;try{let t=new URL(Ba(e)).hostname.split(`.`).pop();if(t&&Fa.has(t))return!0}catch{return!1}}return!1}function Ra(e){return/^[a-zA-Z]+:\/\//.test(e)}function za(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e)}function Ba(e){return Ra(e)?e:za(e)?`mailto://${e}`:`https://${e}`}function Va(e,t){try{let n=new URL(t),r=n.pathname.endsWith(`/`)?n.pathname:`${n.pathname}/`,i=e.startsWith(`/`)?e.substring(1):e;return new URL(i,n.origin+r).toString()}catch(t){return console.error(`Error resolving URL with base URL:`,t),e}}let Ha=e=>crypto.getRandomValues(new Uint8Array(e)),Ua=(e,t,n)=>{let r=(2<<Math.log2(e.length-1))-1,i=-~(1.6*r*t/e.length);return(a=t)=>{let o=``;for(;;){let t=n(i),s=i|0;for(;s--;)if(o+=e[t[s]&r]||``,o.length>=a)return o}}},Wa=(e,t=21)=>Ua(e,t|0,Ha),Ga=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`[n[e]&63];return t};function Ka(e,t){return R.getValueType(e)===R.getValueType(t)?R.isArray(e)?qa(e,t):R.isObject(e)?Ja(e,t):R.isDate(e)?e.getTime()===t.getTime():R.isRegExp(e)?e.toString()===t.toString():e===t:!1}function qa(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++){let r=e[n],i=t[n];if(!Ka(r,i))return!1}return!0}function Ja(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i of n){if(!r.includes(i))return!1;let n=e[i],a=t[i];if(!Ka(n,a))return!1}return!0}var R=class e{static deleteNull(e){for(let t in e)(e[t]===null||e[t]===void 0)&&delete e[t];return e}static getSystemType(){let e=navigator.userAgent,t=navigator.platform===`Win32`||navigator.platform===`Windows`,n=navigator.platform===`Mac68K`||navigator.platform===`MacPPC`||navigator.platform===`Macintosh`||navigator.platform===`MacIntel`;if(n)return`Mac`;if(navigator.platform===`X11`&&!t&&!n)return`Unix`;if(String(navigator.platform).indexOf(`Linux`)>-1)return`Linux`;if(t){if(e.indexOf(`Windows NT 5.0`)>-1||e.indexOf(`Windows 2000`)>-1)return`Windows 2000`;if(e.indexOf(`Windows NT 5.1`)>-1||e.indexOf(`Windows XP`)>-1)return`Windows XP`;if(e.indexOf(`Windows NT 5.2`)>-1||e.indexOf(`Windows 2003`)>-1)return`Windows 2003`;if(e.indexOf(`Windows NT 6.0`)>-1||e.indexOf(`Windows Vista`)>-1)return`Windows Vista`;if(e.indexOf(`Windows NT 6.1`)>-1||e.indexOf(`Windows 7`)>-1)return`Windows 7`;if(e.indexOf(`Windows NT 10`)>-1||e.indexOf(`Windows 10`)>-1)return`Windows 10`;if(e.indexOf(`Windows NT 11`)>-1||e.indexOf(`Windows 11`)>-1)return`Windows 11`}return`Unknown system`}static getBrowserType(){let e=navigator.userAgent,t=e.indexOf(`Opera`)>-1,n=e.indexOf(`compatible`)>-1&&e.indexOf(`MSIE`)>-1&&!t,r=e.indexOf(`Trident`)>-1&&e.indexOf(`rv:11.0`)>-1,i=e.indexOf(`Edge`)>-1,a=e.indexOf(`Firefox`)>-1,o=e.indexOf(`Safari`)>-1&&e.indexOf(`Chrome`)===-1,s=e.indexOf(`Chrome`)>-1&&e.indexOf(`Safari`)>-1;if(n){RegExp(`MSIE (\\d+\\.\\d+);`).test(e);let t=Number.parseFloat(RegExp.$1);return t===7?`IE7`:t===8?`IE8`:t===9?`IE9`:t===10?`IE10`:`0`}return a?`FF`:t?`Opera`:o?`Safari`:s?`Chrome`:i?`Edge`:r?`IE11`:`Unknown browser`}static deepMerge(t,...n){n.forEach(e=>e&&a(e));function r(t,n){t.forEach((t,a)=>{if(e.isArray(t)){var o;let e=(o=n[a])==null?[]:o;n[a]=e,r(t,e);return}if(e.isObject(t)){var s;let e=(s=n[a])==null?{}:s;n[a]=e,i(t,e);return}n[a]=t})}function i(t,n){Object.keys(t).forEach(a=>{let o=t[a];if(e.isObject(o)){var s;let e=(s=n[a])==null?{}:s;n[a]=e,i(o,e);return}if(e.isArray(o)){var c;let e=(c=n[a])==null?[]:c;n[a]=e,r(o,e);return}n[a]=o})}function a(n){Object.keys(n).forEach(a=>{let o=n[a];if(e.isArray(o)){var s;let e=(s=t[a])==null?[]:s;t[a]=e,r(o,e);return}if(e.isObject(o)){var c;let e=(c=t[a])==null?{}:c;t[a]=e,i(o,e);return}t[a]=o})}return t}static diffValue(e,t){return Ka(e,t)}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)){let n=[];return t.forEach((t,r)=>{n[r]=e.deepClone(t)}),n}if(this.isObject(t)){let n={};return Object.keys(t).forEach(r=>{let i=t[r];n[r]=e.deepClone(i)}),Object.setPrototypeOf(n,Object.getPrototypeOf(t)),n}return t}static getValueType(e){return Object.prototype.toString.apply(e)}static isDefine(e){return e!=null}static isBlank(e){return this.isDefine(e)?this.isString(e)?e.trim()===``:!1:!0}static isPlainObject(e){return this.isDefine(e)?Object.getPrototypeOf(e)===Object.getPrototypeOf({}):!1}static isDate(e){return this.getValueType(e)===`[object Date]`}static isRegExp(e){return this.getValueType(e)===`[object RegExp]`}static isArray(e){return this.getValueType(e)===`[object Array]`}static isString(e){return this.getValueType(e)===`[object String]`}static isNumber(e){return this.getValueType(e)===`[object Number]`}static isStringNumber(e){return!isNaN(Number.parseFloat(e))&&isFinite(e)}static isObject(e){return this.getValueType(e)===`[object Object]`}static isEmptyObject(e){for(let t in e)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(e){return La(e)}static normalizeUrl(e){return Ba(e)}static topLevelDomainCombiningString(){return[...Fa].join(`|`)}static removeNull(t){return this.isObject(t)&&Object.keys(t).forEach(n=>{let r=t[n];r==null?delete t[n]:e.removeNull(r)}),t}static numToWord(e){let t=``;for(;e>0;){let n=e%26;n=n===0?n=26:n,t=String.fromCharCode(96+n)+t,e=(e-n)/26}return t.toLocaleUpperCase()}static ABCatNum(e){if(e==null||e.length===0)return NaN;let t=e.toLowerCase().split(``),n=t.length,r=0,i=0;for(let e=0;e<n;e++)i=t[e].charCodeAt(0)-96,r+=i*26**(n-e-1);return r===0?NaN:r-1}static chatAtABC(e){let t=``;for(;e>=0;)t=String.fromCharCode(e%26+97)+t,e=Math.floor(e/26)-1;return t.toUpperCase()}static commonExtend(e,t){let n={};for(let t in e)n[t]=e[t];for(let e in t)t[e]!=null&&(n[e]=t[e]);return n}static hasIntersectionBetweenTwoRanges(e,t,n,r){return t>=n&&r>=e}static isStartValidPosition(e){return/^[A-Za-zА-Яа-яЁё_]/.test(e)}static isValidParameter(e){let t=/[~!@#$%^&*()+=\-{}\[\]\|:;"'<>,?\/ ]+/.test(e),n=e.length<=255;return!t&&n}static clamp(e,t,n){return Math.max(t,Math.min(n,e))}static now(){return performance&&performance.now?performance.now():Date.now()}};function Ya(e=21,t){return t?Wa(t,e)():Ga(e)}function Xa(...e){let t={},n=e.length;for(let r=n-1;r>=0;r--){let n=e[r];if(n){let e=Object.keys(n);for(let r of e)t[r]===void 0&&(t[r]=n[r])}}return t}let Za=()=>typeof process<`u`&&process.versions!=null&&process.versions.node!=null;function Qa(e){let t=e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`).replace(/\\\*/g,`.*`).replace(/\\\?/g,`.`);return RegExp(`^${t}$`,`i`)}let $a=function(e){return e[e.DEFAULT_SERIES=0]=`DEFAULT_SERIES`,e[e.ALTERNATE_SERIES=1]=`ALTERNATE_SERIES`,e}({}),z=function(e){return 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}({}),eo=function(e){return 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}({}),to=function(e){return e[e.UNSUPPORTED=0]=`UNSUPPORTED`,e[e.RGB=1]=`RGB`,e[e.HEX=2]=`HEX`,e[e.THEME=3]=`THEME`,e}({}),no=function(e){return e[e.ON=0]=`ON`,e[e.OFF=1]=`OFF`,e}({}),ro=function(e){return 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}({}),io=function(e){return e[e.LEFT=0]=`LEFT`,e[e.RIGHT=1]=`RIGHT`,e}({}),ao=function(e){return e[e.DOCUMENT=0]=`DOCUMENT`,e[e.PROJECT=1]=`PROJECT`,e}({}),oo=function(e){return e[e.COLUMNS=0]=`COLUMNS`,e[e.ROWS=1]=`ROWS`,e}({}),so=function(e){return e[e.UP=0]=`UP`,e[e.RIGHT=1]=`RIGHT`,e[e.DOWN=2]=`DOWN`,e[e.LEFT=3]=`LEFT`,e}({});function co(e){switch(e){case so.LEFT:return so.RIGHT;case so.RIGHT:return so.LEFT;case so.UP:return so.DOWN;case so.DOWN:return so.UP}}let lo=function(e){return 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}({}),uo=function(e){return 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.SK_SK=`skSK`,e}({}),fo=function(e){return 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}({}),po=function(e){return e[e.RANGE=0]=`RANGE`,e[e.SHEET=1]=`SHEET`,e}({}),mo=function(e){return 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}({}),ho=function(e){return 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}({}),go=function(e){return 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}({}),_o=function(e){return 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}({}),vo=function(e){return 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}({}),yo=function(e){return e[e.GRID=0]=`GRID`,e[e.KANBAN=1]=`KANBAN`,e[e.GANTT=2]=`GANTT`,e}({}),bo=function(e){return e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.LEFT_TO_RIGHT=1]=`LEFT_TO_RIGHT`,e[e.RIGHT_TO_LEFT=2]=`RIGHT_TO_LEFT`,e}({}),xo=function(e){return 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}({}),So=function(e){return 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}({}),Co=function(e){return e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.TOP=1]=`TOP`,e[e.MIDDLE=2]=`MIDDLE`,e[e.BOTTOM=3]=`BOTTOM`,e}({}),wo=function(e){return e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.OVERFLOW=1]=`OVERFLOW`,e[e.CLIP=2]=`CLIP`,e[e.WRAP=3]=`WRAP`,e}({}),To=function(e){return e[e.NORMAL=0]=`NORMAL`,e[e.ITALIC=1]=`ITALIC`,e}({}),Eo=function(e){return e[e.NORMAL=0]=`NORMAL`,e[e.BOLD=1]=`BOLD`,e}({}),Do=function(e){return e[e.NORMAL=1]=`NORMAL`,e[e.SUBSCRIPT=2]=`SUBSCRIPT`,e[e.SUPERSCRIPT=3]=`SUPERSCRIPT`,e}({}),B=function(e){return e[e.FALSE=0]=`FALSE`,e[e.TRUE=1]=`TRUE`,e}({}),Oo=function(e){return e[e.STRING=1]=`STRING`,e[e.NUMBER=2]=`NUMBER`,e[e.BOOLEAN=3]=`BOOLEAN`,e[e.FORCE_STRING=4]=`FORCE_STRING`,e}({}),ko=function(e){return 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}({}),Ao=function(e){return 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}({}),jo=function(e){return e[e.character=0]=`character`,e[e.paragraph=1]=`paragraph`,e[e.table=2]=`table`,e[e.numbering=3]=`numbering`,e}({}),Mo=function(e){return e[e.TAB=0]=`TAB`,e[e.SPACE=1]=`SPACE`,e[e.NOTHING=2]=`NOTHING`,e}({}),V=function(e){return 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}({}),No=function(e){return 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}({}),Po=function(e){return 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}({}),Fo=function(e){return e[e.COMMENT=0]=`COMMENT`,e[e.DELETED=9999]=`DELETED`,e}({}),Io=function(e){return e[e.DRAWING=0]=`DRAWING`,e[e.CUSTOM=1]=`CUSTOM`,e}({}),Lo=function(e){return e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.TRADITIONAL=1]=`TRADITIONAL`,e[e.MODERN=2]=`MODERN`,e}({}),Ro=function(e){return 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}({}),zo=function(e){return 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}({}),Bo=function(e){return 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}({}),Vo=function(e){return e[e.NORMAL=0]=`NORMAL`,e[e.TBRL=1]=`TBRL`,e[e.LRTBV=2]=`LRTBV`,e}({}),Ho=function(e){return 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}({}),Uo=function(e){return e[e.BOTH_SIDES=0]=`BOTH_SIDES`,e[e.LEFT=1]=`LEFT`,e[e.RIGHT=2]=`RIGHT`,e[e.LARGEST=3]=`LARGEST`,e}({}),Wo=function(e){return 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}({}),Go=function(e){return 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}({}),Ko=function(e){return e[e.AUTO=0]=`AUTO`,e[e.AT_LEAST=1]=`AT_LEAST`,e[e.EXACT=2]=`EXACT`,e}({}),qo=function(e){return 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}({}),Jo=function(e){return 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}({}),Yo=function(e){return e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.SPECIFIED=1]=`SPECIFIED`,e}({}),Xo=function(e){return e[e.START=0]=`START`,e[e.CENTER=1]=`CENTER`,e[e.END=2]=`END`,e}({}),Zo=function(e){return e[e.AUTO_FIT=0]=`AUTO_FIT`,e[e.FIXED=1]=`FIXED`,e}({}),Qo=function(e){return e[e.NONE=0]=`NONE`,e[e.WRAP=1]=`WRAP`,e}({}),$o=function(e){return e[e.AUTO=0]=`AUTO`,e[e.AT_LEAST=1]=`AT_LEAST`,e[e.EXACT=2]=`EXACT`,e}({}),es=function(e){return 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}({}),ts=function(e){return e.NORMAL=`normal`,e.BOLD=`bold`,e.ITALIC=`italic`,e}({}),ns=function(e){return 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}({}),rs=function(e){return 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}({}),is=function(e){return 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}({}),as=function(e){return 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}({}),os=function(e){return 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}({}),ss=function(e){return e[e.compressPunctuation=0]=`compressPunctuation`,e[e.compressPunctuationAndJapaneseKana=1]=`compressPunctuationAndJapaneseKana`,e[e.doNotCompress=2]=`doNotCompress`,e}({}),cs=function(e){return e[e.PORTRAIT=0]=`PORTRAIT`,e[e.LANDSCAPE=1]=`LANDSCAPE`,e}({}),ls=function(e){return 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}({}),us=[ls.A3,ls.A4,ls.A5,ls.B4,ls.B5,ls.Letter,ls.Tabloid,ls.Legal,ls.Statement,ls.Executive,ls.Folio],ds=function(e){return e[e.forward=0]=`forward`,e[e.backward=1]=`backward`,e[e.front=2]=`front`,e[e.back=3]=`back`,e}({}),fs=function(e){return 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}({}),ps=function(e){return 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}({}),ms=function(e){return 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}({}),hs=function(e){return 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}({});function gs(e=Ya(6),t=uo.EN_US,n=``){return{id:e,locale:t,title:n,tableSource:{},drawings:{},drawingsOrder:[],headers:{},footers:{},body:{dataStream:`\r
2
+ `,textRuns:[],customBlocks:[],tables:[],paragraphs:[{startIndex:0,paragraphStyle:{spaceAbove:{v:5},lineSpacing:1,spaceBelow:{v:0}}}],sectionBreaks:[{startIndex:1}]},documentStyle:{pageSize:{width:595/.75,height:842/.75},documentFlavor:Lo.TRADITIONAL,marginTop:50,marginBottom:50,marginRight:50,marginLeft:50,renderConfig:{zeroWidthParagraphBreak:B.FALSE,vertexAngle:0,centerAngle:0,background:{rgb:`#ccc`}},autoHyphenation:B.TRUE,doNotHyphenateCaps:B.FALSE,consecutiveHyphenLimit:2,defaultHeaderId:``,defaultFooterId:``,evenPageHeaderId:``,evenPageFooterId:``,firstPageHeaderId:``,firstPageFooterId:``,evenAndOddHeaders:B.FALSE,useFirstPageHeaderFooter:B.FALSE,marginHeader:30,marginFooter:30},settings:{}}}var _s=d((e=>{Object.defineProperty(e,`__esModule`,{value:!0});function t(e,t){if(Array.isArray(t))return!1;for(let n in e)if(!r(e[n],t[n]))return!1;for(let n in t)if(e[n]===void 0)return!1;return!0}function n(e,t){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1;return!0}function r(e,r){return e===r?!0:e===null||r===null||typeof e!=`object`||typeof r!=`object`?!1:Array.isArray(e)?n(e,r):t(e,r)}e.default=r})),vs=d((e=>{Object.defineProperty(e,`__esModule`,{value:!0});function t(e){if(e===null)return null;if(Array.isArray(e))return e.map(t);if(typeof e==`object`){let n={};for(let r in e)n[r]=t(e[r]);return n}else return e}e.default=t})),ys=d((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(e,t){if(!e)throw Error(t)}let n=e=>typeof e==`object`&&!!e&&!Array.isArray(e),r=(e,t)=>typeof e==typeof t?e>t:typeof e==`string`&&typeof t==`number`;function i(e,t){for(let n in e){let r=n;t.write(r,e[r])}}e.isValidPathItem=e=>typeof e==`number`||typeof e==`string`&&e!==`__proto__`;var a=class{constructor(e=null){this.parents=[],this.indexes=[],this.lcIdx=-1,this.idx=-1,this.container=e}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(){let e=[],t=this.container,r=this.parents.length-1,i=this.idx;for(;i>=0;)e.unshift(t[i]),i===0?(i=this.indexes[r*2],t=this.parents[r--]):i-=n(t[i-1])?2:1;return e}},o=class e extends a{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 e;return this.container&&this.container.length>this.idx+1&&n(e=this.container[this.idx+1])?e:null}descendFirst(){let e=this.idx+1;if(!this.container||e>=this.container.length||n(this.container[e])&&e+1>=this.container.length)return!1;n(this.container[e])&&e++;let t=this.container[e];return Array.isArray(t)?(this.indexes.push(this.idx),this.parents.push(this.container),this.indexes.push(e),this.idx=0,this.container=t):this.idx=e,!0}nextSibling(){if(t(this.parents.length===this.indexes.length/2),this.idx>0||this.parents.length===0)return!1;let e=this.indexes[this.indexes.length-1]+1,n=this.parents[this.parents.length-1];return e>=n.length?!1:(t(!isNaN(e)),this.indexes[this.indexes.length-1]=e,this.container=n[e],!0)}_init(e,t,n,r){this.container=e,this.idx=t,this.parents=n.slice(),this.indexes=r.slice()}clone(){let t=new e;return t._init(this.container,this.idx,this.parents,this.indexes),t}*[Symbol.iterator](){if(this.descendFirst()){do yield this.getKey();while(this.nextSibling());this.ascend()}}traverse(e,t){let n=this.getComponent();n&&t(n,e);for(let n of this)e&&e.descend(n),this.traverse(e,t),e&&e.ascend()}eachPick(e,t){this.traverse(e,(e,n)=>{e.p!=null&&t(e.p,n)})}eachDrop(e,t){this.traverse(e,(e,n)=>{e.d!=null&&t(e.d,n)})}};e.ReadCursor=o;var s=class extends a{constructor(e=null){super(e),this.pendingDescent=[],this._op=e}flushDescent(){t(this.parents.length===this.indexes.length/2),this.container===null&&(this._op=this.container=[]);for(let e=0;e<this.pendingDescent.length;e++){let i=this.pendingDescent[e],a=this.idx+1;if(a<this.container.length&&n(this.container[a])&&a++,t(a===this.container.length||!n(this.container[a])),a===this.container.length)this.container.push(i),this.idx=a;else if(this.container[a]===i)this.idx=a;else{if(!Array.isArray(this.container[a])){let e=this.container.splice(a,this.container.length-a);this.container.push(e),this.lcIdx>-1&&(this.lcIdx=a)}for(this.indexes.push(this.idx),this.parents.push(this.container),this.lcIdx!==-1&&(t(r(i,this.container[this.lcIdx][0])),a=this.lcIdx+1,this.lcIdx=-1);a<this.container.length&&r(i,this.container[a][0]);)a++;if(this.indexes.push(a),this.idx=0,a<this.container.length&&this.container[a][0]===i)this.container=this.container[a];else{let e=[i];this.container.splice(a,0,e),this.container=e}}}this.pendingDescent.length=0}reset(){this.lcIdx=-1}getComponent(){this.flushDescent();let e=this.idx+1;if(e<this.container.length&&n(this.container[e]))return this.container[e];{let t={};return this.container.splice(e,0,t),t}}write(e,n){let r=this.getComponent();t(r[e]==null||r[e]===n,`Internal consistency error: Overwritten component. File a bug`),r[e]=n}get(){return this._op}descend(t){if(!e.isValidPathItem(t))throw Error(`Invalid JSON key`);this.pendingDescent.push(t)}descendPath(e){return this.pendingDescent.push(...e),this}ascend(){this.pendingDescent.length?this.pendingDescent.pop():super.ascend()}mergeTree(e,n=i){if(e===null)return;if(t(Array.isArray(e)),e===this._op)throw Error(`Cannot merge into my own tree`);let r=this.lcIdx,a=this.parents.length,o=0;for(let t=0;t<e.length;t++){let r=e[t];typeof r==`string`||typeof r==`number`?(o++,this.descend(r)):Array.isArray(r)?this.mergeTree(r,n):typeof r==`object`&&n(r,this)}for(;o--;)this.ascend();this.lcIdx=this.parents.length===a?r:-1}at(e,t){this.descendPath(e),t(this);for(let t=0;t<e.length;t++)this.ascend();return this}writeAtPath(e,t,n){return this.at(e,()=>this.write(t,n)),this.reset(),this}writeMove(e,t,n=0){return this.writeAtPath(e,`p`,n).writeAtPath(t,`d`,n)}getPath(){let e=super.getPath();return e.push(...this.pendingDescent),e}};e.WriteCursor=s,e.writeCursor=()=>new s,e.readCursor=e=>new o(e);function c(e,t,n){let i,a;a=i=e?e.descendFirst():!1;function o(i){let o;for(;a;){let s=o=e.getKey();if(i!=null){let n=!1;if(t&&typeof s==`number`&&(o=t(s,e.getComponent()),o<0&&(o=~o,n=!0)),r(o,i))return null;if(o===i&&!n)return e}n&&typeof o==`number`&&n(o,e.getComponent()),a=e.nextSibling()}return null}return o.end=()=>{i&&e.ascend()},o}e.advancer=c;function l(e,t,n){let i,a,o,s;for(i=a=e&&e.descendFirst(),o=s=t&&t.descendFirst();i||o;){let a=i?e.getKey():null,s=o?t.getKey():null;a!==null&&s!==null&&(r(s,a)?s=null:a!==s&&(a=null)),n(a==null?s:a,a==null?null:e,s==null?null:t),a!=null&&i&&(i=e.nextSibling()),s!=null&&o&&(o=t.nextSibling())}a&&e.ascend(),s&&t.ascend()}e.eachChildOf=l})),bs=d((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ConflictType=void 0,(function(e){e[e.RM_UNEXPECTED_CONTENT=1]=`RM_UNEXPECTED_CONTENT`,e[e.DROP_COLLISION=2]=`DROP_COLLISION`,e[e.BLACKHOLE=3]=`BLACKHOLE`})(e.ConflictType||(e.ConflictType={}))})),xs=d((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.uniToStrPos=e.strPosToUni=void 0,e.strPosToUni=(e,t=e.length)=>{let n=0,r=0;for(;r<t;r++){let t=e.charCodeAt(r);t>=55296&&t<=57343&&(n++,r++)}if(r!==t)throw Error(`Invalid offset - splits unicode bytes`);return r-n},e.uniToStrPos=(e,t)=>{let n=0;for(;t>0;t--){let t=e.charCodeAt(n);n+=t>=55296&&t<=57343?2:1}return n}})),Ss=d((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.uniSlice=e.dlen=e.eachOp=void 0;let t=xs(),n=t=>{if(!Array.isArray(t))throw Error(`Op must be an array of components`);let n=null;for(let r=0;r<t.length;r++){let i=t[r];switch(typeof i){case`object`:if(typeof i.d!=`number`&&typeof i.d!=`string`)throw Error(`Delete must be number or string`);if(e.dlen(i.d)<=0)throw Error(`Deletes must not be empty`);break;case`string`:if(!(i.length>0))throw Error(`Inserts cannot be empty`);break;case`number`:if(!(i>0))throw Error(`Skip components must be >0`);if(typeof n==`number`)throw Error(`Adjacent skip components should be combined`);break}n=i}if(typeof n==`number`)throw Error(`Op has a trailing skip`)};function r(n,r){let i=0,a=0;for(let o=0;o<n.length;o++){let s=n[o];switch(r(s,i,a),typeof s){case`object`:i+=e.dlen(s.d);break;case`string`:a+=t.strPosToUni(s);break;case`number`:i+=s,a+=s;break}}}e.eachOp=r;function i(e,t){let n=[],i=s(n);return r(e,(e,n,r)=>{i(t(e,n,r))}),d(n)}let a=e=>e,o=e=>i(e,a);e.dlen=e=>typeof e==`number`?e:t.strPosToUni(e);let s=t=>n=>{if(!(!n||n.d===0||n.d===``))if(t.length===0)t.push(n);else if(typeof n==typeof t[t.length-1])if(typeof n==`object`){let r=t[t.length-1];r.d=typeof r.d==`string`&&typeof n.d==`string`?r.d+n.d:e.dlen(r.d)+e.dlen(n.d)}else t[t.length-1]+=n;else t.push(n)},c=e=>typeof e==`number`?e:typeof e==`string`?t.strPosToUni(e):typeof e.d==`number`?e.d:t.strPosToUni(e.d);e.uniSlice=(e,n,r)=>{let i=t.uniToStrPos(e,n),a=r==null?1/0:t.uniToStrPos(e,r);return e.slice(i,a)};let l=(t,n,r)=>typeof t==`number`?r==null?t-n:Math.min(t,r)-n:e.uniSlice(t,n,r),u=n=>{let r=0,i=0;return{take:(a,o)=>{if(r===n.length)return a===-1?null:a;let s=n[r],c;if(typeof s==`number`)return a===-1||s-i<=a?(c=s-i,++r,i=0,c):(i+=a,a);if(typeof s==`string`){if(a===-1||o===`i`||t.strPosToUni(s.slice(i))<=a)return c=s.slice(i),++r,i=0,c;{let e=i+t.uniToStrPos(s.slice(i),a);return c=s.slice(i,e),i=e,c}}else if(a===-1||o===`d`||e.dlen(s.d)-i<=a)return c={d:l(s.d,i)},++r,i=0,c;else{let e=l(s.d,i,i+a);return i+=a,{d:e}}},peek:()=>n[r]}},d=e=>(e.length>0&&typeof e[e.length-1]==`number`&&e.pop(),e);function f(r,i,a){if(a!==`left`&&a!==`right`)throw Error(`side (`+a+`) must be 'left' or 'right'`);n(r),n(i);let o=[],l=s(o),{take:f,peek:p}=u(r);for(let n=0;n<i.length;n++){let r=i[n],o,s;switch(typeof r){case`number`:for(o=r;o>0;)s=f(o,`i`),l(s),typeof s!=`string`&&(o-=c(s));break;case`string`:a===`left`&&typeof p()==`string`&&l(f(-1)),l(t.strPosToUni(r));break;case`object`:for(o=e.dlen(r.d);o>0;)switch(s=f(o,`i`),typeof s){case`number`:o-=s;break;case`string`:l(s);break;case`object`:o-=e.dlen(s.d)}break}}let m;for(;m=f(-1);)l(m);return d(o)}function p(r,i){n(r),n(i);let a=[],o=s(a),{take:f}=u(r);for(let n=0;n<i.length;n++){let r=i[n],a,s;switch(typeof r){case`number`:for(a=r;a>0;)s=f(a,`d`),o(s),typeof s!=`object`&&(a-=c(s));break;case`string`:o(r);break;case`object`:a=e.dlen(r.d);let n=0;for(;n<a;)switch(s=f(a-n,`d`),typeof s){case`number`:o({d:l(r.d,n,n+s)}),n+=s;break;case`string`:n+=t.strPosToUni(s);break;case`object`:o(s)}break}}let p;for(;p=f(-1);)o(p);return d(a)}let m=(n,r)=>{let i=0;for(let a=0;a<r.length&&n>i;a++){let o=r[a];switch(typeof o){case`number`:i+=o;break;case`string`:let r=t.strPosToUni(o);i+=r,n+=r;break;case`object`:n-=Math.min(e.dlen(o.d),n-i);break}}return n},h=(e,t)=>typeof e==`number`?m(e,t):e.map(e=>m(e,t));function g(e,t,n){return i(e,(e,r)=>typeof e==`object`&&typeof e.d==`number`?{d:n.slice(t,r,r+e.d)}:e)}function _(e){return i(e,e=>{switch(typeof e){case`object`:if(typeof e.d==`number`)throw Error(`Cannot invert text op: Deleted characters missing from operation. makeInvertible must be called first.`);return e.d;case`string`:return{d:e};case`number`:return e}})}function v(e){return i(e,e=>typeof e==`object`&&typeof e.d==`string`?{d:t.strPosToUni(e.d)}:e)}function y(e){let t=!0;return r(e,e=>{typeof e==`object`&&typeof e.d==`number`&&(t=!1)}),t}function b(t){return{name:`text-unicode`,uri:`http://sharejs.org/types/text-unicode`,trim:d,normalize:o,checkOp:n,create(e=``){if(typeof e!=`string`)throw Error(`Initial data must be a string`);return t.create(e)},apply(r,i){n(i);let a=t.builder(r);for(let t=0;t<i.length;t++){let n=i[t];switch(typeof n){case`number`:a.skip(n);break;case`string`:a.append(n);break;case`object`:a.del(e.dlen(n.d));break}}return a.build()},transform:f,compose:p,transformPosition:m,transformSelection:h,isInvertible:y,makeInvertible(e,n){return g(e,n,t)},stripInvertible:v,invert:_,invertWithDoc(e,n){return _(g(e,n,t))},isNoop:e=>e.length===0}}e.default=b})),Cs=d((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Ss(),n=xs();function r(e,r){return{get:e,getLength(){return e().length},insert(t,i,a){return r([n.strPosToUni(e(),t),i],a)},remove(t,i,a){return r([n.strPosToUni(e(),t),{d:i}],a)},_onOp(e){t.eachOp(e,(e,n,r)=>{switch(typeof e){case`string`:this.onInsert&&this.onInsert(r,e);break;case`object`:let n=t.dlen(e.d);this.onRemove&&this.onRemove(r,n)}})},onInsert:null,onRemove:null}}e.default=r,r.provides={text:!0}})),ws=d((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)Object.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.type=e.remove=e.insert=void 0;let a=xs(),o=r(Ss()),s=i(Cs()),c={create(e){return e},toString(e){return e},builder(e){if(typeof e!=`string`)throw Error(`Invalid document snapshot: `+e);let t=[];return{skip(n){let r=a.uniToStrPos(e,n);if(r>e.length)throw Error(`The op is too long for this document`);t.push(e.slice(0,r)),e=e.slice(r)},append(e){t.push(e)},del(t){e=e.slice(a.uniToStrPos(e,t))},build(){return t.join(``)+e}}},slice:o.uniSlice},l=o.default(c);e.type=Object.assign(Object.assign({},l),{api:s.default}),e.insert=(e,t)=>t.length===0?[]:e===0?[t]:[e,t],e.remove=(e,t)=>o.dlen(t)===0?[]:e===0?[{d:t}]:[e,{d:t}];var u=Ss();Object.defineProperty(e,`makeType`,{enumerable:!0,get:function(){return u.default}})})),Ts=d((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.editOp=e.replaceOp=e.insertOp=e.moveOp=e.removeOp=e.type=void 0;let n=t(_s()),r=t(vs()),i=ys(),a=bs(),o=()=>{};function s(e,t){if(!e)throw Error(t)}let c=!1;e.type={name:`json1`,uri:`http://sharejs.org/types/JSONv1`,readCursor:i.readCursor,writeCursor:i.writeCursor,create:e=>e,isNoop:e=>e==null,setDebug(e){c=e,o.quiet=!e},registerSubtype:y,checkValidOp:D,normalize:O,apply:k,transformPosition:A,compose:j,tryTransform:re,transform:ae,makeInvertible:ee,invert:M,invertWithDoc:te,RM_UNEXPECTED_CONTENT:a.ConflictType.RM_UNEXPECTED_CONTENT,DROP_COLLISION:a.ConflictType.DROP_COLLISION,BLACKHOLE:a.ConflictType.BLACKHOLE,transformNoConflict:(e,t,n)=>ce(()=>!0,e,t,n),typeAllowingConflictsPred:t=>Object.assign(Object.assign({},e.type),{transform:(e,n,r)=>ce(t,e,n,r)})};let l=e=>e?e.getComponent():null;function u(e){return e&&typeof e==`object`&&!Array.isArray(e)}let d=e=>Array.isArray(e)?e.slice():typeof e==`object`&&e?Object.assign({},e):e,f=e=>e&&(e.p!=null||e.r!==void 0),p=e=>e&&(e.d!=null||e.i!==void 0);function m(e,t){return s(e!=null),typeof t==`number`?(s(Array.isArray(e),`Invalid key - child is not an array`),(e=e.slice()).splice(t,1)):(s(u(e),`Invalid key - child is not an object`),delete(e=Object.assign({},e))[t]),e}function h(e,t,n){return typeof t==`number`?(s(e!=null,`Container is missing for key`),s(Array.isArray(e),`Cannot use numerical key for object container`),s(e.length>=t,`Cannot insert into out of bounds index`),e.splice(t,0,n)):(s(u(e),`Cannot insert into missing item`),s(e[t]===void 0,`Trying to overwrite value at key. Your op needs to remove it first`),e[t]=n),n}e.removeOp=(e,t=!0)=>i.writeCursor().writeAtPath(e,`r`,t).get(),e.moveOp=(e,t)=>i.writeCursor().writeMove(e,t).get(),e.insertOp=(e,t)=>i.writeCursor().writeAtPath(e,`i`,t).get(),e.replaceOp=(e,t,n)=>i.writeCursor().at(e,e=>{e.write(`r`,t),e.write(`i`,n)}).get(),e.editOp=(e,t,n,r=!1)=>i.writeCursor().at(e,e=>w(e,t,n,r)).get();let g=(e,t)=>e!=null&&(typeof t==`number`?Array.isArray(e):typeof e==`object`),_=(e,t)=>g(e,t)?e[t]:void 0,v={};function y(e){let t=e.type?e.type:e;t.name&&(v[t.name]=t),t.uri&&(v[t.uri]=t)}let b=e=>{let t=v[e];if(t)return t;throw Error(`Missing type: `+e)};y(ws());let x=(e,t)=>e+t;y({name:`number`,apply:x,compose:x,invert:e=>-e,transform:e=>e});let S=e=>e==null?null:e.et?b(e.et):e.es?v[`text-unicode`]:e.ena==null?null:v.number,C=e=>e.es?e.es:e.ena==null?e.e:e.ena,w=(e,t,n,r=!1)=>{let[i,a]=typeof t==`string`?[b(t),t]:[t,t.name];!r&&i.isNoop&&i.isNoop(n)||(a===`number`?e.write(`ena`,n):a===`text-unicode`?e.write(`es`,n):(e.write(`et`,a),e.write(`e`,n)))};function T(e){s(typeof e==`number`),s(e>=0),s(e===(0|e))}function E(e){typeof e==`number`?T(e):s(typeof e==`string`)}function D(e){if(e===null)return;let t=new Set,n=new Set,r=e=>{let r=!0,i=!1;for(let a in e){let o=e[a];if(r=!1,s(a===`p`||a===`r`||a===`d`||a===`i`||a===`e`||a===`es`||a===`ena`||a===`et`,`Invalid component item '`+a+`'`),a===`p`)T(o),s(!t.has(o)),t.add(o),s(e.r===void 0);else if(a===`d`)T(o),s(!n.has(o)),n.add(o),s(e.i===void 0);else if(a===`e`||a===`es`||a===`ena`){s(!i),i=!0;let t=S(e);s(t,`Missing type in edit`),t.checkValidOp&&t.checkValidOp(C(e))}}s(!r)},a=(e,t,n)=>{if(!Array.isArray(e))throw Error(`Op must be null or a list`);if(e.length===0)throw Error(`Empty descent`);t||E(e[0]);let o=1,c=0,l=0;for(let t=0;t<e.length;t++){let u=e[t];if(s(u!=null),Array.isArray(u)){let e=a(u,!1,n);if(c){let t=typeof l,n=typeof e;t===n?s(l<e,`descent keys are not in order`):s(t===`number`&&n===`string`)}l=e,c++,o=3}else typeof u==`object`?(s(o===1,`Prev not scalar - instead ${o}`),r(u),o=2):(s(o!==3),E(u),s(i.isValidPathItem(u),`Invalid path key`),o=1)}return s(c!==1,`Operation makes multiple descents. Remove some []`),s(o===2||o===3),e[0]};a(e,!0,!1),s(t.size===n.size,`Mismatched picks and drops in op`);for(let e=0;e<t.size;e++)s(t.has(e)),s(n.has(e))}function O(e){let t=0,n=[],r=i.writeCursor();return r.mergeTree(e,(e,r)=>{let i=S(e);if(i){let t=C(e);w(r,i,i.normalize?i.normalize(t):t)}for(let i of[`r`,`p`,`i`,`d`])if(e[i]!==void 0){let o=i===`p`||i===`d`?(a=e[i],n[a]==null&&(n[a]=t++),n[a]):e[i];r.write(i,o)}var a}),r.get()}function k(e,t){if(o.quiet=!c,D(t),t===null)return e;let n=[];return function e(t,r){let i=t,a=0,o={root:t},c=0,l=o,u=`root`;function f(){for(;c<a;c++){let e=r[c];typeof e!=`object`&&(s(g(l,u)),l=l[u]=d(l[u]),u=e)}}for(;a<r.length;a++){let t=r[a];if(Array.isArray(t)){let n=e(i,t);n!==i&&n!==void 0&&(f(),i=l[u]=n)}else if(typeof t==`object`){t.d==null?t.i!==void 0&&(f(),i=h(l,u,t.i)):(f(),i=h(l,u,n[t.d]));let e=S(t);if(e)f(),i=l[u]=e.apply(i,C(t));else if(t.e!==void 0)throw Error(`Subtype `+t.et+` undefined`)}else i=_(i,t)}return o.root}(e=function e(t,r){let i=[],a=0;for(;a<r.length;a++){let e=r[a];if(Array.isArray(e))break;typeof e!=`object`&&(i.push(t),t=_(t,e))}for(let n=r.length-1;n>=a;n--)t=e(t,r[n]);for(--a;a>=0;a--){let e=r[a];if(typeof e!=`object`){let n=i.pop();t=t===_(n,e)?n:t===void 0?m(n,e):(c=e,l=t,(o=d(o=n))[c]=l,o)}else f(e)&&(s(t!==void 0,`Cannot pick up or remove undefined`),e.p!=null&&(n[e.p]=t),t=void 0)}var o,c,l;return t}(e,t),t)}function A(e,t){e=e.slice(),D(t);let n=i.readCursor(t),r,a,o=!1,s=[];for(let t=0;;t++){let c=e[t],l=n.getComponent();if(l&&(l.r===void 0?l.p!=null&&(o=!1,r=l.p,a=t):o=!0),t>=e.length)break;let u=0,d=i.advancer(n,void 0,(e,t)=>{f(t)&&u++});s.unshift(d);let p=d(c);if(typeof c==`number`&&(e[t]-=u),!p)break}if(s.forEach(e=>e.end()),o)return null;let c=()=>{let t=0;if(r!=null){let r=n.getPath();t=r.length,e=r.concat(e.slice(a))}for(;t<e.length;t++){let r=e[t],a=l(n),o=S(a);if(o){let n=C(a);o.transformPosition&&(e[t]=o.transformPosition(e[t],n));break}let s=0,c=i.advancer(n,(e,t)=>p(t)?~(e-s):e-s,(e,t)=>{p(t)&&s++})(r);if(typeof r==`number`&&(e[t]+=s),!c)break}};return r==null?c():n.eachDrop(null,e=>{e===r&&c()}),e}function j(e,t){if(D(e),D(t),e==null)return t;if(t==null)return e;let n=0,r=i.readCursor(e),a=i.readCursor(t),o=i.writeCursor(),c=[],u=[],d=[],m=[],h=[],g=[],_=new Set;r.traverse(null,e=>{e.p!=null&&(d[e.p]=r.clone())}),a.traverse(null,e=>{e.d!=null&&(m[e.d]=a.clone())});let v=i.writeCursor();return function e(t,r,a,o,v,y,b,x){s(r||a);let T=l(r),E=l(a),D=!!E&&E.r!==void 0,O=!!T&&T.i!==void 0,k=T?T.d:null,A=E?E.p:null,j=(y||D)&&A==null;if(A!=null)o=m[A],b=u[A]=new i.WriteCursor;else if(E&&E.r!==void 0)o=null;else{let e=l(o);e&&e.d!=null&&(o=null)}let M=l(o);if(k!=null)if(t=d[k],x=c[k]=new i.WriteCursor,j)y&&!D&&x.write(`r`,!0);else{let e=h[k]=n++;b.write(`d`,e)}else if(T&&T.i!==void 0)t=null;else{let e=l(t);e&&e.p!=null&&(t=null)}let N;O?(s(v===void 0),N=T.i):N=v;let ee=(A==null?!O||y||D:N===void 0)?null:b.getComponent();if(A!=null){if(!(v!==void 0||O)){let e=k==null?n++:h[k];g[A]=e,x.write(`p`,e)}}else D&&(O||v!==void 0||(E.r,x.write(`r`,E.r)));let te=j?null:S(T),ne=S(M);if((te||ne)&&(te&&te.name,ne&&ne.name),te&&ne){s(te===ne);let e=C(T),t=C(M),n=te.compose(e,t);w(b,te,n),_.add(M)}else te?w(b,te,C(T)):ne&&(w(b,ne,C(M)),_.add(M));let re=typeof N==`object`&&!!N,ie=!1,ae=0,oe=0,se=0,ce=0,le=0,ue=i.advancer(o,(e,t)=>p(t)?ce-e-1:e-ce,(e,t)=>{p(t)&&ce++}),de=i.advancer(t,(e,t)=>f(t)?ae-e-1:e-ae,(e,t)=>{f(t)&&ae++});if(i.eachChildOf(r,a,(t,n,r)=>{let i,a,o=t,c=t,u=t;if(typeof t==`number`){let e=t+se;a=ue(e),c=e+ce;let d=t+oe;i=de(d),p(l(a))&&(i=null),o=d+ae,u=t+le,s(o>=0,`p1PickKey is negative`),s(c>=0,`p2DropKey is negative`);let m=p(l(n)),h=f(l(r));(m||h&&!j)&&le--,m&&oe--,h&&se--}else i=de(t),a=ue(t);x.descend(o),b.descend(c);let d=re&&!p(l(n))?N[u]:void 0,m=e(i,n,r,a,d,j,b,x);var h,g,_;re&&!j?d!==m&&(ie||(N=Array.isArray(N)?N.slice():Object.assign({},N),ie=!0),h=N,_=m,typeof(g=u)==`number`?(s(Array.isArray(h)),s(g<h.length)):(s(!Array.isArray(h)),s(h[g]!==void 0)),_===void 0?typeof g==`number`?h.splice(g,1):delete h[g]:h[g]=_):s(m===void 0),b.ascend(),x.ascend()}),de.end(),ue.end(),ee!=null)ee.i=N;else if(!y&&!D&&A==null)return N}(r,r.clone(),a,a.clone(),void 0,!1,o,v),o.reset(),o.mergeTree(v.get()),o.reset(),o.get(),c.map(e=>e.get()),u.map(e=>e.get()),r.traverse(o,(e,t)=>{let n=e.p;if(n!=null){let e=h[n];e!=null&&t.write(`p`,e);let r=c[n];r&&r.get(),r&&t.mergeTree(r.get())}else e.r!==void 0&&t.write(`r`,e.r)}),o.reset(),o.get(),a.traverse(o,(e,t)=>{let n=e.d;if(n!=null){let e=g[n];e!=null&&t.write(`d`,e);let r=u[n];r&&t.mergeTree(r.get())}else e.i!==void 0&&t.write(`i`,e.i);let r=S(e);r&&!_.has(e)&&w(t,r,C(e))}),o.get()}function M(e){if(e==null)return null;let t=new i.ReadCursor(e),n=new i.WriteCursor,r,a=[],o=[];return function e(t,n,i){let o=t.getComponent(),s,c=!1;if(o){o.p!=null&&(n.write(`d`,o.p),a[o.p]=t.clone()),o.r!==void 0&&n.write(`i`,o.r),o.d!=null&&(n.write(`p`,o.d),i=void 0),o.i!==void 0&&(i=s=o.i);let e=S(o);e&&(i===void 0?(r||(r=new Set),r.add(o)):(C(o),i=e.apply(i,C(o)),c=!0))}let l=0;for(let r of t){n.descend(r);let a=typeof r==`number`?r-l:r,o=_(i,a);p(t.getComponent())&&l++;let s=e(t,n,o);if(i!==void 0&&s!==void 0){if(c||(c=!0,i=d(i)),!g(i,a))throw Error(`Cannot modify child - invalid operation`);i[a]=s}n.ascend()}if(s===void 0)return c?i:void 0;n.write(`r`,i)}(t,n,void 0),r&&(n.reset(),function e(t,n,s){let c=n.getComponent();if(c){let e=c.d;if(e!=null&&(t=a[e],s=o[e]=i.writeCursor()),r.has(c)){let e=S(c);if(!e.invert)throw Error(`Cannot invert subtype ${e.name}`);w(s,e,e.invert(C(c)))}}let l=0,u=0,d=i.advancer(t,(e,t)=>f(t)?l-e-1:e-l,(e,t)=>{f(t)&&l++});for(let t of n)if(typeof t==`number`){let r=t-u,i=d(r),a=r+l;s.descend(a),e(i,n,s),p(n.getComponent())&&u++,s.ascend()}else s.descend(t),e(d(t),n,s),s.ascend();d.end()}(t.clone(),t,n),o.length&&(n.reset(),t.traverse(n,(e,t)=>{let n=e.p;if(n!=null){let e=o[n];e&&e.get(),e&&t.mergeTree(e.get())}}))),n.get()}let N=(e,t)=>e.some(e=>typeof e==`object`&&(Array.isArray(e)?N(e,t):t(e)));function ee(e,t){if(e==null||!N(e,e=>{var t;return e.r!==void 0||((t=S(e))==null?void 0:t.makeInvertible)!=null}))return e;let n=new i.ReadCursor(e),a=new i.WriteCursor,o=!1,c=[],l=[],u=(e,t,n)=>{let i=e.getComponent(),a=!1;if(i){i.d!=null&&t.write(`d`,i.d),i.i!==void 0&&t.write(`i`,i.i);let r=i.p;if(r!=null&&(c[r]=e.clone(),s(n!==void 0,`Operation picks up at an invalid key`),l[r]=n,t.write(`p`,i.p)),i.r!==void 0&&n===void 0)throw Error(`Invalid doc / op in makeInvertible: removed item missing from doc`);let a=S(i);a&&(a.makeInvertible?o=!0:w(t,a,C(i),!0))}let f=0;for(let r of e){t.descend(r);let i=typeof r==`number`?r-f:r,o=_(n,i),s=u(e,t,o);o!==s&&(a||(a=!0,n=d(n)),s===void 0?(n=m(n,i),typeof r==`number`&&f++):n[i]=s),t.ascend()}return i&&(i.r===void 0?i.p!=null&&(n=void 0):(t.write(`r`,r.default(n)),n=void 0)),n};return u(n,a,t),a.get(),o&&(a.reset(),function e(t,n,r,a,o){let s=n.getComponent();if(s){s.i===void 0?s.d!=null&&(a=l[s.d],t=c[s.d],o=!1,s.d):(a=s.i,o=!0);let e=S(s);if(e&&e.makeInvertible){let t=C(s);w(r,e,e.makeInvertible(t,a),!0)}}let u=0,d=0,m=i.advancer(t,(e,t)=>f(t)?u-e-1:e-u,(e,t)=>{f(t)&&u++});for(let t of n)if(typeof t==`number`){let i=t-d,s=m(i),c=i+u,l=_(a,o?i:c);r.descend(t),e(s,n,r,l,o),p(n.getComponent())&&d++,r.ascend()}else{let i=_(a,t);r.descend(t),e(m(t),n,r,i,o),r.ascend()}m.end()}(n.clone(),n,a,t,!1)),a.get()}function te(e,t){return M(ee(e,t))}let ne=e=>{if(e==null)return null;let t=e.slice();for(let n=0;n<e.length;n++){let e=t[n];Array.isArray(e)&&(t[n]=ne(e))}return t};function re(t,u,d){s(d===`left`||d===`right`,`Direction must be left or right`);let m=d===`left`?0:1;if(o.quiet=!c,o.prefix=0,u==null)return{ok:!0,result:t};D(t),D(u);let h=null,g=[],_=[],v=[],y=[],b=[],x=[],T=[],E=[],O=[],k=[],A=[],j=[],M=[],N=[],ee=[],te=0,re=i.readCursor(t),ie=i.readCursor(u),ae=i.writeCursor();if(function e(t,n=null,r){let a=l(n);a&&(a.r===void 0?a.p!=null&&(r=null,x[a.p]=t.clone()):r=n.clone());let o=t.getComponent(),s;o&&(s=o.p)!=null&&(b[s]=n?n.clone():null,v[s]=t.clone(),r&&(k[s]=!0,O[s]=r),a&&a.p!=null&&(N[s]=a.p));let c=i.advancer(n);for(let n of t)e(t,c(n),r);c.end()}(ie,re,null),function t(n,r,o,s,c){let u=o.getComponent(),d,p=!1;u&&((d=u.d)==null?u.i!==void 0&&(n=r=null,p=!0,c&&h==null&&(h={type:a.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(c.getPath()),op2:e.insertOp(o.getPath(),u.i)})):(y[d]=o.clone(),s!=null&&(ee[s]==null&&(ee[s]=[]),ee[s].push(d)),k[d],n=b[d]||null,r=v[d]||null,k[d]?(c&&(A[d]=!0),c=O[d]||null):!c||m!==1&&N[d]!=null||h==null&&(h={type:a.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(c.getPath()),op2:e.moveOp(r.getPath(),o.getPath())}),p=!0));let g=l(n);g&&(g.r===void 0?g.p!=null&&(g.p,s=g.p,c=null):c=n.clone());let _=S(u);_&&c&&h==null&&(h={type:a.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.removeOp(c.getPath()),op2:e.editOp(o.getPath(),_,C(u),!0)});let x=0,w=0,T=i.advancer(r,(e,t)=>f(t)?x-e-1:e-x,(e,t)=>{f(t)&&x++}),E=i.advancer(n);for(let e of o)if(typeof e==`number`){let n=e-w,r=T(n);w+=+t(E(n+x),r,o,s,c)}else{let n=T(e);t(E(e),n,o,s,c)}return T.end(),E.end(),p}(re,ie,ie.clone(),null,null),y.map(e=>e&&e.get()),h)return{ok:!1,conflict:h};A.map(e=>!!e);let oe=[],se=null;(function e(t,n,r,a,o){let c=!1,u=l(n);if(f(u)){let e=u.p;e==null?(r=null,o=n.clone()):(r=y[e],a=j[e]=i.writeCursor(),c=!0,o=null)}else p(l(r))&&(r=null);let d=t.getComponent();if(d){let e=d.p;e==null?d.r!==void 0&&(o||a.write(`r`,!0),(o||c)&&(se==null&&(se=new Set),se.add(d))):(o&&(E[e]=o),oe[e]=o||m===1&&c?null:a.getComponent(),g[e]=t.clone(),r&&(T[e]=r.clone()))}let h=0,_=0,v=i.advancer(n,void 0,(e,t)=>{f(t)&&h++}),b=i.advancer(r,(e,t)=>p(t)?~(e-_):e-_,(e,t)=>{p(t)&&_++});if(t)for(let n of t)if(typeof n==`string`){let r=v(n),i=b(n);a.descend(n),e(t,r,i,a,o),a.ascend()}else{let r=v(n),i=n-h,c=f(l(r))?null:b(i),u=i+_;s(u>=0),a.descend(u),e(t,r,c,a,o),a.ascend()}v.end(),b.end()})(re,ie,ie.clone(),ae,null),ae.reset();let ce=[];if(function t(o,c,u,b,D,O){s(c);let A=c.getComponent(),j=l(b),ee=!1,ne=(t,n,r)=>t?e.moveOp(t.getPath(),n.getPath()):e.insertOp(n.getPath(),r.i);if(p(A)){let t=A.d;t!=null&&(_[t]=c.clone());let i=t==null?null:oe[t],s=!1;if(A.i!==void 0||t!=null&&i){let o;j&&(j.i!==void 0||(o=j.d)!=null&&!k[o])&&(s=o==null?n.default(j.i,A.i):t!=null&&t===N[o],s||o!=null&&m!==1&&N[o]!=null||h==null&&(h={type:a.ConflictType.DROP_COLLISION,op1:ne(t==null?null:g[t],c,A),op2:ne(o==null?null:v[o],b,j)})),s||(O?h==null&&(h={type:a.ConflictType.RM_UNEXPECTED_CONTENT,op1:ne(t==null?null:g[t],c,A),op2:e.removeOp(O.getPath())}):(t==null?D.write(`i`,r.default(A.i)):(ce[te]=t,D.write(`d`,i.p=te++)),ee=!0))}else if(t!=null&&!i){let e=E[t];e&&(O=e.clone())}t==null?A.i!==void 0&&(o=u=null,s||(b=null)):(o=g[t],u=x[t],b=T[t])}else f(l(o))&&(o=u=b=null);let re=l(o),ie=l(u);if(f(ie)){let e=ie.p;ie.r!==void 0&&(!re||re.r===void 0)||k[e]?(b=null,O=u.clone()):e!=null&&(b=y[e],m!==1&&N[e]!=null||((D=M[e])||(D=M[e]=i.writeCursor()),D.reset(),O=null))}else !p(A)&&p(j)&&(b=null);j=b==null?null:b.getComponent();let ae=S(A);if(ae){let t=C(A);if(O)h==null&&(h={type:a.ConflictType.RM_UNEXPECTED_CONTENT,op1:e.editOp(c.getPath(),ae,t,!0),op2:e.removeOp(O.getPath())});else{let e=S(j),n;if(e){if(ae!==e)throw Error(`Transforming incompatible types`);let r=C(j);n=ae.transform(t,r,d)}else n=r.default(t);w(D,ae,n)}}let le=0,ue=0,de=0,fe=0,pe=0,me=0,P=o!=null&&o.descendFirst(),he=P,ge=i.advancer(u,void 0,(e,t)=>{f(t)&&de++}),_e=b!=null&&b.descendFirst(),ve=_e;for(let e of c)if(typeof e==`number`){let n,r=p(c.getComponent()),i=e-ue;{let e;for(;P&&typeof(e=o.getKey())==`number`;){e+=le;let t=o.getComponent(),n=f(t);if(e>i||e===i&&(!n||m===0&&r))break;if(n){le--;let e=t.p;oe[e],N.includes(e),t.d,l(M[t.d]),f(l(M[t.d])),(t.r===void 0||se&&se.has(t))&&(e==null||!oe[e]||m!==1&&N.includes(e))||pe--}P=o.nextSibling()}n=P&&e===i?o:null}let a=i-le,u=ge(a),d=a-de,h=null;{let e,t;for(;_e&&typeof(e=b.getKey())==`number`;){t=e-fe;let n=b.getComponent(),i=p(n);if(t>d)break;if(t===d){if(!i){h=b;break}{if(m===0&&r){h=b;break}let e=u&&f(u.getComponent());if(m===0&&e)break}}if(i){let e=n.d;k[e],N[e],n.i===void 0&&(k[e]||N[e]!=null&&m!==1)?(k[e]||N[e]!=null&&m===0)&&(fe++,me--):fe++}_e=b.nextSibling()}}let g=d+fe+pe+me;s(g>=0,`trying to descend to a negative index`),D.descend(g),r&&(n=u=h=null,ue++),t(n,c,u,h,D,O)&&me++,D.ascend()}else{let n;for(;P&&(n=o.getKey(),typeof n!=`string`||!(n>e||n===e));)P=o.nextSibling();let r=P&&n===e?o:null,i=ge(e),a;for(;_e&&(a=b.getKey(),typeof a!=`string`||!(a>e||a===e));)_e=b.nextSibling();let s=_e&&a===e?b:null;D.descend(e),t(r,c,i,s,D,O),D.ascend()}return ge.end(),he&&o.ascend(),ve&&b.ascend(),ee}(re,re.clone(),ie,ie.clone(),ae,null),h)return{ok:!1,conflict:h};ae.reset();let le=(e,t,n)=>e.traverse(t,(t,r)=>{t.d!=null&&n(t.d,e,r)});(k.length||j.length)&&(le(ie,ae,(e,t,n)=>{k[e]&&!A[e]&&n.write(`r`,!0),j[e]&&n.mergeTree(j[e].get())}),ae.reset());let ue=[],de=[];if((M.length||k.length)&&!h){let e=i.readCursor(ne(ae.get()));if(le(e,null,(e,t)=>{ue[e]=t.clone()}),M.forEach(e=>{e&&le(i.readCursor(e.get()),null,(e,t)=>{ue[e]=t.clone()})}),function e(t,n,r,a,s,c){o.prefix++;let u=l(n);if(u&&f(u))if(u.p!=null){s=u;let e=u.p;ue[e].getPath(),r=ue[e],a=de[e]=i.writeCursor()}else u.r!==void 0&&(r=null,c=!0);else p(l(r))&&(r=null);let d=t.getComponent();if(d){let e;if((e=d.d)!=null){let t=M[e];t&&(t.get(),a.mergeTree(t.get()),r=i.readCursor(t.get()))}}let m=0,h=0,g=i.advancer(n,void 0,(e,t)=>{f(t)&&m--}),_=i.advancer(r,(e,t)=>p(t)?-(e-h)-1:e-h,(e,t)=>{p(t)&&h++});for(let n of t)if(typeof n==`number`){let r=g(n),i=n+m,o=_(i),l=i+h;a.descend(l),e(t,r,o,a,s,c),a.ascend()}else a.descend(n),e(t,g(n),_(n),a,s,c),a.ascend();g.end(),_.end()}(ie,e,e.clone(),ae,null,!1),ae.reset(),h)return{ok:!1,conflict:h};if(ae.get(),de.length){let e=de.map(e=>e?e.get():null);if(le(i.readCursor(ne(ae.get())),ae,(t,n,r)=>{let i=e[t];i&&(r.mergeTree(i),e[t]=null)}),e.find(e=>e)){let t=i.writeCursor(),n=i.writeCursor(),r=0,o=0;e.forEach(e=>{e!=null&&le(i.readCursor(e),null,e=>{let i=ce[e];t.writeMove(g[i].getPath(),_[i].getPath(),r++);let a=ee[i];a&&a.forEach(e=>{k[e]||m!==1&&N[e]!=null||n.writeMove(v[e].getPath(),y[e].getPath(),o++)})})}),h={type:a.ConflictType.BLACKHOLE,op1:t.get(),op2:n.get()}}}}return h?{ok:!1,conflict:h}:{ok:!0,result:ae.get()}}let ie=e=>{let t=Error(`Transform detected write conflict`);throw t.conflict=e,t.type=t.name=`writeConflict`,t};function ae(e,t,n){let r=re(e,t,n);if(r.ok)return r.result;ie(r.conflict)}let oe=e=>{let t=i.writeCursor();return i.readCursor(e).traverse(t,(e,t)=>{(p(e)||S(e))&&t.write(`r`,!0)}),t.get()},se=(e,t)=>{let{type:n,op1:r,op2:o}=e;switch(n){case a.ConflictType.DROP_COLLISION:return t===`left`?[null,oe(o)]:[oe(r),null];case a.ConflictType.RM_UNEXPECTED_CONTENT:let e=!1;return i.readCursor(r).traverse(null,t=>{t.r!==void 0&&(e=!0)}),e?[null,oe(o)]:[oe(r),null];case a.ConflictType.BLACKHOLE:return[oe(r),oe(o)];default:throw Error(`Unrecognised conflict: `+n)}};function ce(e,t,n,r){let i=null;for(;;){let a=re(t,n,r);if(a.ok)return j(i,a.result);{let{conflict:o}=a;e(o)||ie(o);let[s,c]=se(o,r);t=j(O(t),s),n=j(O(n),c),i=j(i,c)}}}})),Es=m(d((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!n.hasOwnProperty(r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(Ts(),e);var r=ys();Object.defineProperty(e,`ReadCursor`,{enumerable:!0,get:function(){return r.ReadCursor}}),Object.defineProperty(e,`WriteCursor`,{enumerable:!0,get:function(){return r.WriteCursor}});var i=bs();Object.defineProperty(e,`ConflictType`,{enumerable:!0,get:function(){return i.ConflictType}})}))());let H=function(e){return e[e.COVER=0]=`COVER`,e[e.REPLACE=1]=`REPLACE`,e}({}),U=function(e){return e.RETAIN=`r`,e.INSERT=`i`,e.DELETE=`d`,e}({}),Ds=(0,t.createIdentifier)(`univer.config-service`);var Os=class{constructor(){P(this,`_configChanged$`,new n.Subject),P(this,`configChanged$`,this._configChanged$.asObservable()),P(this,`_config`,new Map)}dispose(){this._config.clear(),this._configChanged$.complete()}getConfig(e){return this._config.get(e)}setConfig(e,t,n){var r;let{merge:i=!1}=n||{},a=(r=this._config.get(e))==null?{}:r;a=i?Bi(a,t):t,this._config.set(e,a),this._configChanged$.next({[e]:a})}deleteConfig(e){return this._config.delete(e)}subscribeConfigValue$(e){return new n.Observable(t=>{Object.prototype.hasOwnProperty.call(this._config,e)&&t.next(this._config.get(e));let r=this.configChanged$.pipe((0,n.filter)(t=>Object.prototype.hasOwnProperty.call(t,e))).subscribe(n=>t.next(n[e]));return()=>r.unsubscribe()})}};let ks=(0,t.createIdentifier)(`univer.context-service`);var As=class extends ra{constructor(...e){super(...e),P(this,`_contextChanged$`,new n.Subject),P(this,`contextChanged$`,this._contextChanged$.asObservable()),P(this,`_contextMap`,new Map)}dispose(){super.dispose(),this._contextChanged$.complete(),this._contextMap.clear()}getContextValue(e){var t;return(t=this._contextMap.get(e))==null?!1:t}setContextValue(e,t){this._contextMap.set(e,t),this._contextChanged$.next({[e]:t})}subscribeContextValue$(e){return new n.Observable(t=>{let r=this._contextChanged$.pipe((0,n.filter)(t=>t[e]!==void 0)).subscribe(n=>t.next(n[e]));return this._contextMap.has(e)&&t.next(this._contextMap.get(e)),()=>r.unsubscribe()})}};let js=function(e){return 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}({}),Ms=(0,t.createIdentifier)(`univer.log`);var Ns=class extends ra{constructor(...e){super(...e),P(this,`_logLevel`,js.INFO),P(this,`_deduction`,new Set)}dispose(){super.dispose(),this._logLevel=js.INFO,this._deduction.clear()}debug(...e){this._logLevel>=js.VERBOSE&&this._log(console.debug,...e)}log(...e){this._logLevel>=js.INFO&&this._log(console.log,...e)}warn(...e){this._logLevel>=js.WARN&&this._log(console.warn,...e)}error(...e){this._logLevel>=js.ERROR&&this._log(console.error,...e)}deprecate(...e){this._logLevel>=js.WARN&&this._logWithDeduplication(console.error,...e)}setLogLevel(e){this._logLevel=e}_log(e,...t){let n=t[0];/^\[(.*?)\]/g.test(n)?e(`\x1B[97;104m${n}\x1B[0m`,...t.slice(1)):e(...t)}_logWithDeduplication(e,...t){let n=Ps(...t);this._deduction.has(n)||(this._deduction.add(n),this._log(e,...t))}};function Ps(...e){return e.map(e=>JSON.stringify(e)).join(``)}function W(e,t){return function(n,r){t(n,r,e)}}function Fs(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let Is=`command.logExecution`,Ls=function(e){return e[e.COMMAND=0]=`COMMAND`,e[e.OPERATION=1]=`OPERATION`,e[e.MUTATION=2]=`MUTATION`,e}({}),Rs=(0,t.createIdentifier)(`univer.core.command-service`);var zs=class{constructor(){P(this,`_commands`,new Map),P(this,`_commandTypes`,new Map)}registerCommand(e){if(this._commands.has(e.id))throw Error(`[CommandRegistry]: command "${e.id}" has been registered before.`);return this._commands.set(e.id,e),this._commandTypes.set(e.id,e.type),ta(()=>{this.unregisterCommand(e.id)})}unregisterCommand(e){this._commands.delete(e),this._commandTypes.delete(e)}hasCommand(e){return this._commands.has(e)}getCommand(e){return this._commands.has(e)?[this._commands.get(e)]:null}getCommandType(e){return this._commandTypes.get(e)}};let Bs={id:`nil`,type:Ls.COMMAND,handler:()=>!0},Vs=class extends ra{constructor(e,t,n){super(),this._injector=e,this._logService=t,this._configService=n,P(this,`_commandRegistry`,void 0),P(this,`_beforeCommandExecutionListeners`,[]),P(this,`_commandExecutedListeners`,[]),P(this,`_collabMutationListeners`,[]),P(this,`_multiCommandDisposables`,new Map),P(this,`_commandExecutingLevel`,0),P(this,`_commandExecutionStack`,[]),this._commandRegistry=new zs,this.registerCommand(Bs)}dispose(){super.dispose(),this._commandExecutedListeners.length=0,this._beforeCommandExecutionListeners.length=0,this._collabMutationListeners.length=0}disposed(){return this._disposed}hasCommand(e){return this._commandRegistry.hasCommand(e)}registerCommand(e){return this._commandRegistry.registerCommand(e)}unregisterCommand(e){var t;this._commandRegistry.unregisterCommand(e),(t=this._multiCommandDisposables.get(e))==null||t.dispose()}registerMultipleCommand(e){return this._registerMultiCommand(e)}beforeCommandExecuted(e){if(this._beforeCommandExecutionListeners.indexOf(e)===-1)return this._beforeCommandExecutionListeners.push(e),ta(()=>{let t=this._beforeCommandExecutionListeners.indexOf(e);this._beforeCommandExecutionListeners.splice(t,1)});throw Error(`[CommandService]: could not add a listener twice.`)}onCommandExecuted(e){if(this._commandExecutedListeners.indexOf(e)===-1)return this._commandExecutedListeners.push(e),ta(()=>{let t=this._commandExecutedListeners.indexOf(e);this._commandExecutedListeners.splice(t,1)});throw Error(`[CommandService]: could not add a listener twice.`)}onMutationExecutedForCollab(e){if(this._collabMutationListeners.indexOf(e)===-1)return this._collabMutationListeners.push(e),ta(()=>{let t=this._collabMutationListeners.indexOf(e);this._collabMutationListeners.splice(t,1)});throw Error(`[CommandService]: could not add a collab mutation listener twice.`)}async executeCommand(e,t,n){try{let r=this._commandRegistry.getCommand(e);if(r){let[e]=r,i={id:e.id,type:e.type,params:t},a=this._pushCommandExecutionStack(i),o=n==null?{}:n;this._beforeCommandExecutionListeners.forEach(e=>e(i,o));let s=await this._execute(e,t,o);return o.syncOnly||this._commandExecutedListeners.forEach(e=>e(i,o)),e.type===Ls.MUTATION&&this._collabMutationListeners.forEach(e=>e(i,o)),a.dispose(),s}throw Error(`[CommandService]: command "${e}" is not registered.`)}catch(e){if(e instanceof le)return!1;throw e}}syncExecuteCommand(e,t,n){try{let i=this._commandRegistry.getCommand(e);if(i){let[e]=i,a={id:e.id,type:e.type,params:t};if(e.type===Ls.MUTATION){let e=C(this._commandExecutionStack,e=>e.type===Ls.COMMAND);if(e){var r;a.params=(r=a.params)==null?{}:r,a.params.trigger=e.id}}let o=this._pushCommandExecutionStack(a),s=n==null?{}:n;this._beforeCommandExecutionListeners.forEach(e=>e(a,s));let c=this._syncExecute(e,t,s);return s.syncOnly||this._commandExecutedListeners.forEach(e=>e(a,s)),e.type===Ls.MUTATION&&this._collabMutationListeners.forEach(e=>e(a,s)),o.dispose(),c}throw Error(`[CommandService]: command "${e}" is not registered.`)}catch(e){if(e instanceof le)return!1;throw e}}_pushCommandExecutionStack(e){return this._commandExecutionStack.push(e),ta(()=>b(this._commandExecutionStack,e))}_registerMultiCommand(e){let t=this._commandRegistry.getCommand(e.id),n;if(!t){n=new Hs(e.id);let t=new na;t.add(this._commandRegistry.registerCommand(n)),t.add(ta(()=>{this._multiCommandDisposables.delete(e.id)})),this._multiCommandDisposables.set(e.id,t)}else if(t[0].multi!==!0)throw Error(`Command has registered as a single command.`);else n=t[0];let r=n.registerImplementation(e);return ta(()=>{if(r.dispose(),!n.hasImplementations()){var t;(t=this._multiCommandDisposables.get(e.id))==null||t.dispose()}})}async _execute(e,t,n){if(n!=null&&n.syncOnly)return!0;this._configService.getConfig(`command.logExecution`)!==!1&&this._logService.debug(`[CommandService]`,`${`|-`.repeat(Math.max(this._commandExecutingLevel,0))}executing command "${e.id}"`),this._commandExecutingLevel++;let r;try{r=await this._injector.invoke(e.handler,t,n),this._commandExecutingLevel--}catch(e){throw r=!1,this._commandExecutingLevel=0,e}return r}_syncExecute(e,t,n){if(n!=null&&n.syncOnly)return!0;this._configService.getConfig(`command.logExecution`)!==!1&&this._logService.debug(`[CommandService]`,`${`|-`.repeat(Math.max(0,this._commandExecutingLevel))}executing command "${e.id}".`),this._commandExecutingLevel++;let r;try{if(r=this._injector.invoke(e.handler,t,n),r instanceof Promise)throw TypeError(`[CommandService]: Command handler should not return a promise.`);this._commandExecutingLevel--}catch(e){throw r=!1,this._commandExecutingLevel=0,e}return r}};Vs=Fs([W(0,(0,t.Inject)(t.Injector)),W(1,Ms),W(2,Ds)],Vs);var Hs=class{constructor(e){this.id=e,P(this,`name`,void 0),P(this,`multi`,!0),P(this,`type`,Ls.COMMAND),P(this,`priority`,0),P(this,`_implementations`,[]),P(this,`handler`,async(e,n)=>{if(!this._implementations.length)return!1;let r=e.get(Ms),i=e.get(ks),a=e.get(t.Injector);for(let e of this._implementations){let t=e.command.preconditions;if((!t||t&&t(i))&&(r.debug(`[MultiCommand]`,`executing implementation "${e.command.name}".`),await a.invoke(e.command.handler,n)))return!0}return!1}),this.name=e}registerImplementation(e){let t={command:e};return this._implementations.push(t),this._implementations.sort((e,t)=>t.command.priority-e.command.priority),ta(()=>{let e=this._implementations.indexOf(t);this._implementations.splice(e,1)})}hasImplementations(){return this._implementations.length>0}};function Us(e,t,n){return Qi(e.map(e=>()=>t.syncExecuteCommand(e.id,e.params,n)))}function Ws(e,t,n){return Zi(e.map(e=>()=>t.executeCommand(e.id,e.params,n)))}function Gs(e){return new n.Observable(t=>{let n=e((...e)=>t.next(e));return()=>n==null?void 0:n.dispose()})}function Ks(e){return function(t){return new n.Observable(n=>(t.subscribe({next:t=>{n.next(t),e(t)&&n.complete()},complete:()=>n.complete(),error:e=>n.error(e)}),()=>n.unsubscribe()))}}function qs(e=0){return t=>{let r=[];return t.pipe((0,n.tap)(e=>r.push(e)),(0,n.debounceTime)(e),(0,n.map)(()=>r),(0,n.tap)(()=>r=[]))}}function Js(e){let t=new n.ReplaySubject(1);return setTimeout(()=>t.next(),e),t.pipe((0,n.take)(1))}function Ys(e,t){let r=new n.BehaviorSubject(t);return e.subscribe(r),r}let Xs=e=>new Promise(t=>{(0,n.merge)(Gs(e.onCommandExecuted.bind(e)).pipe((0,r.filter)(([e])=>e.type===Ls.MUTATION)),(0,n.timer)(300)).pipe((0,r.debounceTime)(16),(0,r.first)()).subscribe(()=>{t()})});function Zs(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 Qs(e,t){let n=0,r=e.length-1;for(;n<=r;){let i=Math.floor((r+n)/2);if(t<e[i]&&(i===0||t>=e[i-1]))return i;if(t>=e[i])n=i+1;else if(t<e[i])r=i-1;else return-1}return-1}function $s(e,t){let n=0,r=e.length;for(;n<r;){let i=Math.floor((n+r)/2);e[i]<=t?n=i+1:r=i}return n<e.length?n:e.length-1}function ec(e,t,n=!1){let r=e.length-1;if(t<0||t<e[0])return 0;if(r=e.length<40||t<=e[20]||t>=e[r-20]?Zs(e,t):$s(e,t),n){let t=e[r];return e.indexOf(t)}return r}function tc(e){let t=new Blob([e],{type:`text/javascript`});return window.URL.createObjectURL(t)}function nc(e,t){if(t==null||e==null)return!0;let{left:n=0,top:r=0,height:i=0,width:a=0,angle:o=0}=t,{left:s=0,top:c=0,height:l=0,width:u=0,angle:d=0}=e,f=u,p=l,m=a,h=i;return Math.abs(s-n)>2||Math.abs(c-r)>2||Math.abs(f-m)>2||Math.abs(p-h)>2||Math.abs(d-o)>1}let rc={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]};var ic=class e{static mix(t,n,r){var i,a;r=Math.min(1,Math.max(0,r));let o=new e(t).toRgb(),s=new e(n).toRgb(),c=(i=o.a)==null?1:i,l=(a=s.a)==null?1:a;return new e({r:(s.r-o.r)*r+o.r,g:(s.g-o.g)*r+o.g,b:(s.b-o.b)*r+o.b,a:(l-c)*r+c})}static getContrastRatio(t,n){let r=new e(t).getLuminance(),i=new e(n).getLuminance();return(Math.max(r,i)+.05)/(Math.min(r,i)+.05)}constructor(t){if(P(this,`_color`,void 0),P(this,`_rgbColor`,void 0),P(this,`_isValid`,!1),t==null){this._setNullColor();return}if(t instanceof e){this._color={...t._color},this._rgbColor={...t._rgbColor};return}let n=sc(t);if(n==null){this._setNullColor();return}this._color=n;let r=fc(this._color);if(r==null){this._setNullColor();return}this._rgbColor=r,this._isValid=!0}get isValid(){return this._isValid}toRgb(){return this._rgbColor}toRgbString(){let{r:e,g:t,b:n,a:r=1}=this.toRgb(),i=r<1;return`rgb${i?`a`:``}(${e},${t},${n}${i?`,${r}`:``})`}toString(){return this.toRgbString()}toHexString(e){let{r:t,g:n,b:r,a:i=1}=this.toRgb(),a=i<1,o=[ac(Math.round(t).toString(16)),ac(Math.round(n).toString(16)),ac(Math.round(r).toString(16)),ac(Math.round(i*255).toString(16))];return e&&o[0][0]===o[0][1]&&o[1][0]===o[1][1]&&o[2][0]===o[2][1]&&o[3][0]===o[3][1]?a?`#${o[0][0]}${o[1][0]}${o[2][0]}${o[3][0]}`:`#${o[0][0]}${o[1][0]}${o[2][0]}`:a?`#${o[0]}${o[1]}${o[2]}${o[3]}`:`#${o[0]}${o[1]}${o[2]}`}toHsv(){return _c(this.toRgb())}toHsl(){return gc(this.toRgb())}lighten(t=10){let n=this.toHsl();return n.l+=t,n.l=Math.min(Math.max(n.l,0),100),new e(n)}darken(t=10){let n=this.toHsl();return n.l-=t,n.l=Math.min(Math.max(n.l,0),100),new e(n)}setAlpha(t){return new e({...this._rgbColor,a:t})}getLuminance(){let{r:e,g:t,b:n}=this.toRgb();return e=oc(e),t=oc(t),n=oc(n),Number((.2126*e+.7152*t+.0722*n).toFixed(3))}getBrightness(){let{r:e,g:t,b:n}=this.toRgb();return(e*299+t*587+n*114)/1e3}getAlpha(){var e;return(e=this._color.a)==null?1:e}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}}};let ac=e=>e.length===1?`0${e}`:e,oc=e=>(e/=255,e<=.03928?e/12.92:((e+.055)/1.055)**2.4),sc=e=>{if(yc(e)){if(`r`in e){let t={r:Math.round(e.r),g:Math.round(e.g),b:Math.round(e.b)};return e.a!==void 0&&(t.a=e.a),t}if(`l`in e){let t={h:Math.round(e.h),s:e.s,l:e.l};return e.a!==void 0&&(t.a=e.a),t}let t={h:Math.round(e.h),s:e.s,v:e.v};return e.a!==void 0&&(t.a=e.a),t}let t=e.trim().toLowerCase();if(rc[t]){let e=rc[t],n={r:Math.round(e[0]),g:Math.round(e[1]),b:Math.round(e[2])};return n.a=e[3]||1,n}if(t.startsWith(`#`))return cc(t);if(t.startsWith(`rgb`))return lc(t);if(t.startsWith(`hsl`))return uc(t);if(t.startsWith(`hsv`))return dc(t)},cc=e=>{let t=e.substring(1),n=RegExp(`.{1,${t.length>=6?2:1}}`,`g`),r=t.match(n);if(!r||r.length<3)throw Error(`The color '${e}' is illegal hex color`);r[0].length===1&&(r=r.map(e=>e+e));let i={r:Number.parseInt(r[0],16),g:Number.parseInt(r[1],16),b:Number.parseInt(r[2],16)};return r.length>3&&(i.a=Number.parseInt(r[3],16)/255),i},lc=e=>{let t=e.indexOf(`(`);if(t===-1)throw Error(`The color '${e}' is illegal rgb color`);let n=e.substring(t+1,e.length-1).split(`,`);if(n.length<3)throw Error(`The color '${e}' is illegal rgb color`);let 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},uc=e=>{let t=e.indexOf(`(`);if(t===-1)throw Error(`The color '${e}' is illegal hsl color`);let n=e.substring(t+1,e.length-1).split(`,`);if(n.length<3)throw Error(`The color '${e}' is illegal hsl color`);let 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},dc=e=>{let t=e.indexOf(`(`);if(t===-1)throw Error(`The color '${e}' is illegal hsv color`);let n=e.substring(t+1,e.length-1).split(`,`);if(n.length<3)throw Error(`The color '${e}' is illegal hsv color`);let 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},fc=e=>{let t=sc(e);if(t!=null)return`r`in t?t:`l`in t?mc(t):hc(t)},pc=(e,t,n)=>(n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),mc=e=>{let{h:t,s:n,l:r}=e;t/=360,n/=100,r/=100;let i=0,a=0,o=0;if(n===0)i=a=o=r;else{let e=r<.5?r*(1+n):r+n-r*n,s=2*r-e;i=pc(s,e,t+1/3),a=pc(s,e,t),o=pc(s,e,t-1/3)}let s={r:Math.round(i*255),g:Math.round(a*255),b:Math.round(o*255)};return e.a!==void 0&&(s.a=e.a),s},hc=e=>{let{h:t,s:n,v:r}=e;t=t/360*6,n/=100,r/=100;let i=Math.floor(t),a=t-i,o=r*(1-n),s=r*(1-a*n),c=r*(1-(1-a)*n),l=i%6,u=[r,s,o,o,c,r][l],d=[c,r,r,s,o,o][l],f=[o,o,c,r,r,s][l],p={r:u*255,g:d*255,b:f*255};return e.a!==void 0&&(p.a=e.a),p},gc=e=>{let{r:t,g:n,b:r}=e;t/=255,n/=255,r/=255;let i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2,s,c;if(i===a)s=c=0;else{let e=i-a;switch(c=o>.5?e/(2-i-a):e/(i+a),i){case t:s=(n-r)/e+(n<r?6:0);break;case n:s=(r-t)/e+2;break;default:s=(t-n)/e+4;break}s/=6}let l={h:Math.round(s*360),s:Math.round(c*100),l:Math.round(o*100)};return e.a!==void 0&&(l.a=e.a),l},_c=e=>{let{r:t,g:n,b:r}=e;t/=255,n/=255,r/=255;let i=Math.max(t,n,r),a=Math.min(t,n,r),o,s=i,c=i-a,l=i===0?0:c/i;if(i===a)o=0;else{switch(i){case t:o=(n-r)/c+(n<r?6:0);break;case n:o=(r-t)/c+2;break;default:o=(t-n)/c+4;break}o/=6}let u={h:Math.round(o*360),s:Math.round(l*100),v:Math.round(s*100)};return e.a!==void 0&&(u.a=e.a),u},vc=e=>e==null,yc=e=>!vc(e)&&typeof e==`object`;function bc(e){return!!(/^#(?:[0]{3}|[0]{6})\b/.test(e)||/^rgb\s*\(\s*0+\s*,\s*0+\s*,\s*0+\s*\)$/.test(e)||/^rgba\s*\(\s*0+\s*,\s*0+\s*,\s*0+\s*,\s*(1|1\.0*|0?\.\d+)\)$/.test(e)||/^hsl\s*\(\s*0*\s*,\s*0%*\s*,\s*0%*\s*\)$/.test(e)||/^hsla\s*\(\s*0*\s*,\s*0%*\s*,\s*0%*\s*,\s*(1|1\.0*|0?\.\d+)\)$/.test(e))}function xc(e){return!!(/^#(?:[Ff]{3}|[Ff]{6})\b/.test(e)||/^rgb\s*\(\s*255\s*,\s*255\s*,\s*255\s*\)$/.test(e)||/^rgba\s*\(\s*255\s*,\s*255\s*,\s*255\s*,\s*(1|1\.0*|0?\.\d+)\)$/.test(e)||/^hsl\s*\(\s*0*\s*,\s*0%*\s*,\s*100%*\s*\)$/.test(e)||/^hsla\s*\(\s*0*\s*,\s*0%*\s*,\s*100%*\s*,\s*(1|1\.0*|0?\.\d+)\)$/.test(e))}function Sc(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 Cc(e){if(e.t!==void 0)return e.t;if(typeof e.v==`string`)return Oo.STRING;if(typeof e.v==`number`)return Oo.NUMBER;if(typeof e.v==`boolean`)return Oo.BOOLEAN}function wc(e){if(e==null)return!0;let{v:t,f:n,si:r,p:i,custom:a}=e;return!(!(t==null||typeof t==`string`&&t.length===0)||n!=null&&n.length>0||r!=null&&r.length>0||i!=null||a!=null)}function Tc(e){return e!=null&&(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)}let G=function(e){return e[e.NORMAL=0]=`NORMAL`,e[e.ROW=1]=`ROW`,e[e.COLUMN=2]=`COLUMN`,e[e.ALL=3]=`ALL`,e}({}),K=function(e){return e[e.NONE=0]=`NONE`,e[e.ROW=1]=`ROW`,e[e.COLUMN=2]=`COLUMN`,e[e.ALL=3]=`ALL`,e}({});function Ec(e){return[e.startRow,e.startColumn,e.endRow,e.endColumn]}let Dc=function(e){return e.NONE=`none`,e.BACKWARD=`backward`,e.FORWARD=`forward`,e}({}),Oc=function(e){return e.RECT=`RECT`,e.TEXT=`TEXT`,e}({});function kc(e,t,n){let r=!1,i=!1,a=e,o=t,s=e,c=t;if(n==null)return{actualRow:e,actualColumn:t,isMergedMainCell:i,isMerged:r,endRow:a,endColumn:o,startRow:s,startColumn:c};for(let l=0;l<n.length;l++){let{startRow:u,endRow:d,startColumn:f,endColumn:p}=n[l];if(e===u&&t===f){a=d,o=p,s=u,c=f,i=!0;break}if(e>=u&&e<=d&&t>=f&&t<=p){a=d,o=p,s=u,c=f,r=!0;break}}return{actualRow:e,actualColumn:t,isMergedMainCell:i,isMerged:r,endRow:a,endColumn:o,startRow:s,startColumn:c}}let Ac=function(e){return e.Raw=`raw`,e.Intercepted=`intercepted`,e.Both=`both`,e}({}),jc={[Ao.OFFICE]:{[ko.ACCENT1]:`#4472C4`,[ko.ACCENT2]:`#ED7D31`,[ko.ACCENT3]:`#A5A5A5`,[ko.ACCENT4]:`#70AD47`,[ko.ACCENT5]:`#5B9BD5`,[ko.ACCENT6]:`#70AD47`,[ko.DARK1]:`#000000`,[ko.DARK2]:`#44546A`,[ko.LIGHT1]:`#FFFFFF`,[ko.LIGHT2]:`#E7E6E6`,[ko.HYPERLINK]:`#0563C1`,[ko.FOLLOWED_HYPERLINK]:`#954F72`}},Mc=`general`,Nc=`hash`,Pc=`zero`,Fc=`qmark`,Ic=`slash`,Lc=`group`,Rc=`scale`,zc=`comma`,Bc=`break`,Vc=`text`,Hc=`plus`,Uc=`minus`,Wc=`point`,Gc=`space`,Kc=`percent`,qc=`digit`,Jc=`calendar`,Yc=`error`,Xc=`datetime`,Zc=`duration`,Qc=`condition`,$c=`dbnum`,el=`natnum`,tl=`locale`,nl=`color`,rl=`modifier`,il=`ampm`,al=`escaped`,ol=`string`,sl=`skip`,cl=`fill`,ll=`paren`,ul=`char`,dl=`#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`.split(`.`),fl=`¤.$.£.¥.֏.؋.৳.฿.៛.₡.₦.₩.₪.₫.€.₭.₮.₱.₲.₴.₸.₹.₺.₼.₽.₾.₿`.split(`.`),pl=RegExp(`[`+fl.join(``)+`]`);var ml=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`});let hl=/^([a-z\d]+)(?:[_-]([a-z\d]+))?(?:\.([a-z\d]+))?(?:@([a-z\d]+))?$/i,gl={},q=(e,t=``)=>e.replace(/~/g,t).split(`;`),J=(e,t=0,n=0)=>(e.mmm||(e.mmm=t<1?e.mmmm.concat():e.mmmm.map(e=>{let n=e.slice(0,t%10);return n+(t<10||e===n?``:`.`)})),e.ddd||(e.ddd=n<1?e.dddd.concat():e.dddd.map(e=>{let t=e.slice(0,n%10);return t+(n<10||e===t?``:`.`)})),!e.mmm6&&e.mmmm6&&(e.mmm6=e.mmmm6),e),_l={group:`\xA0`,decimal:`.`,positive:`+`,negative:`-`,percent:`%`,exponent:`E`,nan:`NaN`,infinity:`∞`,ampm:q(`AM;PM`),mmmm6:q(`Muharram;Safar;Rabiʻ I;Rabiʻ II;Jumada I;Jumada II;Rajab;Shaʻban;Ramadan;Shawwal;Dhuʻl-Qiʻdah;Dhuʻl-Hijjah`),mmm6:q(`Muh.;Saf.;Rab. I;Rab. II;Jum. I;Jum. II;Raj.;Sha.;Ram.;Shaw.;Dhuʻl-Q.;Dhuʻl-H.`),mmmm:q(`January;February;March;April;May;June;July;August;September;October;November;December`),mmm:q(`Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec`),dddd:q(`Sunday;Monday;Tuesday;Wednesday;Thursday;Friday;Saturday`),ddd:q(`Sun;Mon;Tue;Wed;Thu;Fri;Sat`),bool:q(`TRUE;FALSE`),preferMDY:!1};function vl(e){let t=hl.exec(e);if(!t)throw SyntaxError(`Malformed locale: ${e}`);return{lang:t[1]+(t[2]?`_`+t[2]:``),language:t[1],territory:t[2]||``}}function yl(e){if(typeof e==`number`)return ml[e&65535]||null;let t=parseInt(e,16);return isFinite(t)&&ml[t&65535]?ml[t&65535]||null:hl.test(e)?e:null}function bl(e){let t=yl(e),n=null;if(t){let e=vl(t);n=gl[e.lang]||gl[e.language]||null}return n}function xl(e){return Object.assign({},_l,e)}function Y(e,t){let n=typeof t==`object`?t:vl(t);return gl[n.lang]=xl(e),n.language!==n.lang&&!gl[n.language]&&(gl[n.language]=xl(e)),gl[n.lang]}let Sl=xl({group:`,`,preferMDY:!0});Sl.isDefault=!0,Y({group:`,`,ampm:q(`上午;下午`),mmmm:q(`一月;二月;三月;四月;五月;六月;七月;八月;九月;十月;十一月;十二月`),mmm:q(`1月;2月;3月;4月;5月;6月;7月;8月;9月;10月;11月;12月`),dddd:q(`~日;~一;~二;~三;~四;~五;~六`,`星期`),ddd:q(`周日;周一;周二;周三;周四;周五;周六`)},`zh_CN`);let Cl={group:`,`,ampm:q(`上午;下午`),mmmm:q(`1月;2月;3月;4月;5月;6月;7月;8月;9月;10月;11月;12月`),mmm:q(`1月;2月;3月;4月;5月;6月;7月;8月;9月;10月;11月;12月`),dddd:q(`~日;~一;~二;~三;~四;~五;~六`,`星期`),ddd:q(`周日;周一;周二;周三;周四;周五;周六`)};Y({...Cl,nan:`非數值`,dddd:q(`~日;~一;~二;~三;~四;~五;~六`,`星期`)},`zh_TW`),Y({...Cl,dddd:q(`~日;~一;~二;~三;~四;~五;~六`,`星期`)},`zh_HK`),Y({...Cl,ampm:q(`午前;午後`),dddd:q(`日~;月~;火~;水~;木~;金~;土~`,`曜日`),ddd:q(`日;月;火;水;木;金;土`)},`ja`),Y({group:`,`,ampm:q(`오전;오후`),mmmm:q(`1월;2월;3월;4월;5월;6월;7월;8월;9월;10월;11월;12월`),mmm:q(`1월;2월;3월;4월;5월;6월;7월;8월;9월;10월;11월;12월`),dddd:q(`일요일;월요일;화요일;수요일;목요일;금요일;토요일`),ddd:q(`일;월;화;수;목;금;토`)},`ko`),Y({group:`,`,ampm:q(`ก่อนเที่ยง;หลังเที่ยง`),mmmm:q(`มกร~;กุมภาพันธ์;มีน~;เมษายน;พฤษภ~;มิถุนายน;กรกฎ~;สิงห~;กันยายน;ตุล~;พฤศจิกายน;ธันว~`,`าคม`),mmm:q(`ม.ค.;ก.พ.;มี.ค.;เม.ย.;พ.ค.;มิ.ย.;ก.ค.;ส.ค.;ก.ย.;ต.ค.;พ.ย.;ธ.ค.`),dddd:q(`วันอาทิตย์;วันจันทร์;วันอังคาร;วันพุธ;วันพฤหัสบดี;วันศุกร์;วันเสาร์`),ddd:q(`อา.;จ.;อ.;พ.;พฤ.;ศ.;ส.`)},`th`),Y(J({decimal:`,`,ampm:q(`dop.;odp.`),mmmm:q(`ledna;února;března;dubna;května;června;července;srpna;září;října;listopadu;prosince`),mmm:q(`I;II;III;IV;V;VI;VII;VIII;IX;X;XI;XII`),dddd:q(`neděle;pondělí;úterý;středa;čtvrtek;pátek;sobota`),bool:q(`PRAVDA;NEPRAVDA`)},-1,2),`cs`),Y(J({group:`.`,decimal:`,`,mmmm:q(`januar;februar;marts;april;maj;juni;juli;august;september;oktober;november;december`),dddd:q(`søn~;man~;tirs~;ons~;tors~;fre~;lør~`,`dag`),bool:q(`SAND;FALSK`)},13,13),`da`),Y(J({group:`.`,decimal:`,`,ampm:q(`a.m.;p.m.`),mmmm:q(`januari;februari;maart;april;mei;juni;juli;augustus;september;oktober;november;december`),mmm:q(`jan.;feb.;mrt.;apr.;mei;jun.;jul.;aug.;sep.;okt.;nov.;dec.`),dddd:q(`zondag;maandag;dinsdag;woensdag;donderdag;vrijdag;zaterdag`),bool:q(`WAAR;ONWAAR`)},-1,2),`nl`),Y({group:`,`,preferMDY:!0},`en`),Y({group:`,`,preferMDY:!0},`en_US`),Y({group:`,`},`en_AU`),Y({group:`,`},`en_CA`),Y({group:`,`},`en_GB`),Y({group:`,`,mmm:q(`Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sept;Oct;Nov;Dec`)},`en_IE`),Y(J({decimal:`,`,nan:`epäluku`,ampm:q(`ap.;ip.`),mmmm:q(`tammi~;helmi~;maalis~;huhti~;touko~;kesä~;heinä~;elo~;syys~;loka~;marras~;joulu~`,`kuuta`),mmm:q(`tammik.;helmik.;maalisk.;huhtik.;toukok.;kesäk.;heinäk.;elok.;syysk.;lokak.;marrask.;jouluk.`),dddd:q(`sunnun~;maanan~;tiis~;keskiviikkona;tors~;perjan~;lauan~`,`taina`),bool:q(`TOSI;EPÄTOSI`)},-1,2),`fi`);let wl=J({group:` `,decimal:`,`,mmmm:q(`janvier;février;mars;avril;mai;juin;juillet;août;septembre;octobre;novembre;décembre`),mmm:q(`janv.;févr.;mars;avr.;mai;juin;juil.;août;sept.;oct.;nov.;déc.`),dddd:q(`~manche;lun~;mar~;mercre~;jeu~;vendre~;same~`,`di`),bool:q(`VRAI;FAUX`)},-1,13);Y({...wl},`fr`),Y({...wl,mmm:q(`janv.;févr.;mars;avr.;mai;juin;juill.;août;sept.;oct.;nov.;déc.`)},`fr_CA`),Y({group:`'`,decimal:`.`,...wl},`fr_CH`);let Tl=J({mmmm:q(`Januar;Februar;März;April;Mai;Juni;Juli;August;September;Oktober;November;Dezember`),mmm:q(`Jan.;Feb.;März;Apr.;Mai;Juni;Juli;Aug.;Sept.;Okt.;Nov.;Dez.`),dddd:q(`Sonn~;Mon~;Diens~;Mittwoch;Donners~;Frei~;Sams~`,`tag`),bool:q(`WAHR;FALSCH`)},-1,12);Y({group:`.`,decimal:`,`,...Tl},`de`),Y({group:`'`,decimal:`.`,...Tl},`de_CH`),Y(J({group:`.`,decimal:`,`,ampm:q(`π.μ.;μ.μ.`),mmmm:q(`Ιανουαρ~;Φεβρουαρ~;Μαρτ~;Απριλ~;Μαΐου;Ιουν~;Ιουλ~;Αυγούστου;Σεπτεμβρ~;Οκτωβρ~;Νοεμβρ~;Δεκεμβρ~`,`ίου`),mmm:q(`Ιαν;Φεβ;Μαρ;Απρ;Μαΐ;Ιουν;Ιουλ;Αυγ;Σεπ;Οκτ;Νοε;Δεκ`),dddd:q(`Κυριακή;Δευτέρα;Τρίτη;Τετάρτη;Πέμπτη;Παρασκευή;Σάββατο`)},-1,3),`el`),Y({decimal:`,`,ampm:q(`de.;du.`),mmmm:q(`január;február;március;április;május;június;július;augusztus;szeptember;október;november;december`),mmm:q(`jan.;febr.;márc.;ápr.;máj.;jún.;júl.;aug.;szept.;okt.;nov.;dec.`),dddd:q(`vasárnap;hétfő;kedd;szerda;csütörtök;péntek;szombat`),ddd:q(`V;H;K;Sze;Cs;P;Szo`),bool:q(`IGAZ;HAMIS`)},`hu`),Y(J({group:`.`,decimal:`,`,ampm:q(`f.h.;e.h.`),mmmm:q(`janúar;febrúar;mars;apríl;maí;júní;júlí;ágúst;september;október;nóvember;desember`),dddd:q(`sunnu~;mánu~;þriðju~;miðviku~;fimmtu~;föstu~;laugar~`,`dagur`)},13,13),`is`),Y(J({group:`.`,decimal:`,`,mmmm:q(`Januari;Februari;Maret;April;Mei;Juni;Juli;Agustus;September;Oktober;November;Desember`),dddd:q(`Minggu;Senin;Selasa;Rabu;Kamis;Jumat;Sabtu`)},3,3),`id`);let El=J({mmmm:q(`gennaio;febbraio;marzo;aprile;maggio;giugno;luglio;agosto;settembre;ottobre;novembre;dicembre`),dddd:q(`domenica;lunedì;martedì;mercoledì;giovedì;venerdì;sabato`),bool:q(`VERO;FALSO`)},3,3);Y({group:`.`,decimal:`,`,...El},`it`),Y({group:`'`,decimal:`.`,...El},`it_CH`);let Dl={decimal:`,`,ampm:q(`a.m.;p.m.`),mmmm:q(`januar;februar;mars;april;mai;juni;juli;august;september;oktober;november;desember`),mmm:q(`jan.;feb.;mar.;apr.;mai;jun.;jul.;aug.;sep.;okt.;nov.;des.`),dddd:q(`søn~;man~;tirs~;ons~;tors~;fre~;lør~`,`dag`),bool:q(`SANN;USANN`)};Y(J({...Dl},-1,13),`nb`),Y(J({...Dl},-1,13),`no`),Y(J({decimal:`,`,mmmm:q(`stycznia;lutego;marca;kwietnia;maja;czerwca;lipca;sierpnia;września;października;listopada;grudnia`),dddd:q(`niedziela;poniedziałek;wtorek;środa;czwartek;piątek;sobota`),ddd:q(`niedz.;pon.;wt.;śr.;czw.;pt.;sob.`),bool:q(`PRAWDA;FAŁSZ`)},3,-1),`pl`);let Ol={group:`.`,decimal:`,`,mmmm:q(`janeiro;fevereiro;março;abril;maio;junho;julho;agosto;setembro;outubro;novembro;dezembro`),dddd:q(`domingo;segunda-feira;terça-feira;quarta-feira;quinta-feira;sexta-feira;sábado`),bool:q(`VERDADEIRO;FALSO`)};Y(J(Ol,13,13),`pt`),Y(J(Ol,13,13),`pt_BR`),Y({decimal:`,`,nan:`не\xA0число`,mmmm:q(`января;февраля;марта;апреля;мая;июня;июля;августа;сентября;октября;ноября;декабря`),mmm:q(`янв.;февр.;мар.;апр.;мая;июн.;июл.;авг.;сент.;окт.;нояб.;дек.`),dddd:q(`воскресенье;понедельник;вторник;среда;четверг;пятница;суббота`),ddd:q(`вс;пн;вт;ср;чт;пт;сб`),mmmm6:q(`рамадан;шавваль;зуль-каада;зуль-хиджжа;мухаррам;раби-уль-авваль;раби-уль-ахир;джумад-уль-авваль;джумад-уль-ахир;раджаб;шаабан;рамадан`),mmm6:q(`рам.;шав.;зуль-к.;зуль-х.;мух.;раб. I;раб. II;джум. I;джум. II;радж.;шааб.;рам.`),bool:q(`ИСТИНА;ЛОЖЬ`)},`ru`),Y(J({decimal:`,`,mmmm:q(`januára;februára;marca;apríla;mája;júna;júla;augusta;septembra;októbra;novembra;decembra`),dddd:q(`nedeľa;pondelok;utorok;streda;štvrtok;piatok;sobota`)},3,2),`sk`);let kl={group:`.`,decimal:`,`,ampm:q(`a.\xA0m.;p.\xA0m.`),mmmm:q(`enero;febrero;marzo;abril;mayo;junio;julio;agosto;septiem~;octu~;noviem~;diciem~`,`bre`),mmm:q(`ene;feb;mar;abr;may;jun;jul;ago;sept;oct;nov;dic`),dddd:q(`domingo;lunes;martes;miércoles;jueves;viernes;sábado`),ddd:q(`dom;lun;mar;mié;jue;vie;sáb`),bool:q(`VERDADERO;FALSO`)},Al=q(`ene;feb;mar;abr;may;jun;jul;ago;sep;oct;nov;dic`),jl=q(`ene.;feb.;mar.;abr.;may.;jun.;jul.;ago.;sept.;oct.;nov.;dic.`);Y({...kl},`es`),Y({...kl},`es_AR`),Y({...kl},`es_BO`),Y({...kl},`es_CL`),Y({...kl},`es_CO`),Y({...kl},`es_EC`),Y({...kl,mmm:Al,ampm:q(`a.m.;p.m.`)},`es_MX`),Y({...kl,mmm:jl},`es_PY`),Y({...kl,mmm:jl},`es_UY`),Y({...kl,mmm:jl,mmmm:q(`enero;febrero;marzo;abril;mayo;junio;julio;agosto;setiembre;octubre;noviembre;diciembre`)},`es_VE`),Y({decimal:`,`,ampm:q(`fm;em`),mmmm:q(`januari;februari;mars;april;maj;juni;juli;augusti;september;oktober;november;december`),mmm:q(`jan.;feb.;mars;apr.;maj;juni;juli;aug.;sep.;okt.;nov.;dec.`),dddd:q(`sön~;mån~;tis~;ons~;tors~;fre~;lör~`,`dag`),ddd:q(`sön;mån;tis;ons;tors;fre;lör`)},`sv`),Y(J({group:`.`,decimal:`,`,ampm:q(`ÖÖ;ÖS`),mmmm:q(`Ocak;Şubat;Mart;Nisan;Mayıs;Haziran;Temmuz;Ağustos;Eylül;Ekim;Kasım;Aralık`),mmm:q(`Oca;Şub;Mar;Nis;May;Haz;Tem;Ağu;Eyl;Eki;Kas;Ara`),dddd:q(`Pazar;Pazartesi;Salı;Çarşamba;Perşembe;Cuma;Cumartesi`),ddd:q(`Paz;Pzt;Sal;Çar;Per;Cum;Cmt`),bool:q(`DOĞRU;YANLIŞ`)},3,-1),`tr`),Y({group:`,`,ampm:q(`yb;yh`),mmmm:q(`Ionawr;Chwefror;Mawrth;Ebrill;Mai;Mehefin;Gorffennaf;Awst;Medi;Hydref;Tachwedd;Rhagfyr`),mmm:q(`Ion;Chwef;Maw;Ebr;Mai;Meh;Gorff;Awst;Medi;Hyd;Tach;Rhag`),dddd:q(`Dydd Sul;Dydd Llun;Dydd Mawrth;Dydd Mercher;Dydd Iau;Dydd Gwener;Dydd Sadwrn`),ddd:q(`Sul;Llun;Maw;Mer;Iau;Gwen;Sad`)},`cy`),Y({group:`.`,decimal:`,`,mmmm:q(`yanvar;fevral;mart;aprel;may;iyun;iyul;avqust;sentyabr;oktyabr;noyabr;dekabr`),mmm:q(`yan;fev;mar;apr;may;iyn;iyl;avq;sen;okt;noy;dek`),dddd:q(`bazar;bazar ertəsi;çərşənbə axşamı;çərşənbə;cümə axşamı;cümə;şənbə`),ddd:q(`B.;B.e.;Ç.a.;Ç.;C.a.;C.;Ş.`)},`az`),Y(J({decimal:`,`,mmmm:q(`студзеня;лютага;сакавіка;красавіка;мая;чэрвеня;ліпеня;жніўня;верасня;кастрычніка;лістапада;снежня`),dddd:q(`нядзеля;панядзелак;аўторак;серада;чацвер;пятніца;субота`),ddd:q(`нд;пн;аў;ср;чц;пт;сб`)},3,-1),`be`),Y({decimal:`,`,ampm:q(`пр.об.;сл.об.`),mmmm:q(`януари;февруари;март;април;май;юни;юли;август;септември;октомври;ноември;декември`),mmm:q(`яну;фев;март;апр;май;юни;юли;авг;сеп;окт;ное;дек`),dddd:q(`неделя;понеделник;вторник;сряда;четвъртък;петък;събота`),ddd:q(`нд;пн;вт;ср;чт;пт;сб`),bool:q(`ИСТИНА;ЛОЖЬ`)},`bg`),Y({group:`.`,decimal:`,`,mmmm:q(`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:q(`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:q(`diumenge;dilluns;dimarts;dimecres;dijous;divendres;dissabte`),ddd:q(`dg.;dl.;dt.;dc.;dj.;dv.;ds.`),ampm:q(`a.\xA0m.;p.\xA0m.`)},`ca`),Y(J({group:`,`,decimal:`.`,mmmm:q(`Enero;Pebrero;Marso;Abril;Mayo;Hunyo;Hulyo;Agosto;Setyembre;Oktubre;Nobyembre;Disyembre`),dddd:q(`Linggo;Lunes;Martes;Miyerkules;Huwebes;Biyernes;Sabado`)},3,3),`fil`),Y({group:`,`,decimal:`.`,mmmm:q(`જાન્યુઆરી;ફેબ્રુઆરી;માર્ચ;એપ્રિલ;મે;જૂન;જુલાઈ;ઑગસ્ટ;સપ્ટેમ્બર;ઑક્ટોબર;નવેમ્બર;ડિસેમ્બર`),mmm:q(`જાન્યુ;ફેબ્રુ;માર્ચ;એપ્રિલ;મે;જૂન;જુલાઈ;ઑગસ્ટ;સપ્ટે;ઑક્ટો;નવે;ડિસે`),dddd:q(`રવિ~;સોમ~;મંગળ~;બુધ~;ગુરુ~;શુક્ર~;શનિ~`,`વાર`),ddd:q(`રવિ;સોમ;મંગળ;બુધ;ગુરુ;શુક્ર;શનિ`)},`gu`),Y({group:`,`,decimal:`.`,ampm:q(`לפנה״צ;אחה״צ`),dddd:q(`~ראשון;~שני;~שלישי;~רביעי;~חמישי;~שישי;~שבת`,`יום `),ddd:q(`~א׳;~ב׳;~ג׳;~ד׳;~ה׳;~ו׳;שבת`,`יום `),mmmm:q(`ינואר;פברואר;מרץ;אפריל;מאי;יוני;יולי;אוגוסט;ספטמבר;אוקטובר;נובמבר;דצמבר`),mmm:q(`ינו׳;פבר׳;מרץ;אפר׳;מאי;יוני;יולי;אוג׳;ספט׳;אוק׳;נוב׳;דצמ׳`),mmmm6:q(`רמדאן;שוואל;ד׳ו אל־קעדה;ד׳ו אל־חיג׳ה;מוחרם;רביע אל־אוול;רביע א־ת׳אני;ג׳ומאדא אל־אולא;ג׳ומאדא א־ת׳אניה;רג׳ב;שעבאן;רמדאן`),mmm6:q(`רמדאן;שוואל;ד׳ו אל־קעדה;ד׳ו אל־חיג׳ה;מוחרם;רביע א׳;רביע ב׳;ג׳ומאדא א׳;ג׳ומאדא ב׳;רג׳ב;שעבאן;רמדאן`)},`he`),Y(J({group:`.`,decimal:`,`,mmmm:q(`siječnja;veljače;ožujka;travnja;svibnja;lipnja;srpnja;kolovoza;rujna;listopada;studenoga;prosinca`),mmm:q(`sij;velj;ožu;tra;svi;lip;srp;kol;ruj;lis;stu;pro`),dddd:q(`nedjelja;ponedjeljak;utorak;srijeda;četvrtak;petak;subota`)},-1,3),`hr`),Y({decimal:`,`,mmmm:q(`հունվարի;փետրվարի;մարտի;ապրիլի;մայիսի;հունիսի;հուլիսի;օգոստոսի;սեպտեմբերի;հոկտեմբերի;նոյեմբերի;դեկտեմբերի`),mmm:q(`հնվ;փտվ;մրտ;ապր;մյս;հնս;հլս;օգս;սեպ;հոկ;նոյ;դեկ`),dddd:q(`կիրակի;երկուշաբթի;երեքշաբթի;չորեքշաբթի;հինգշաբթի;ուրբաթ;շաբաթ`),ddd:q(`կիր;երկ;երք;չրք;հնգ;ուր;շբթ`)},`hy`),Y(J({decimal:`,`,mmmm:q(`იანვარი;თებერვალი;მარტი;აპრილი;მაისი;ივნისი;ივლისი;აგვისტო;სექტემბერი;ოქტომბერი;ნოემბერი;დეკემბერი`),dddd:q(`კვირა;ორშაბათი;სამშაბათი;ოთხშაბათი;ხუთშაბათი;პარასკევი;შაბათი`)},3,3),`ka`),Y(J({decimal:`,`,mmmm:q(`қаңтар;ақпан;наурыз;сәуір;мамыр;маусым;шілде;тамыз;қыркүйек;қазан;қараша;желтоқсан`),dddd:q(`жексенбі;дүйсенбі;сейсенбі;сәрсенбі;бейсенбі;жұма;сенбі`),ddd:q(`жс;дс;сс;ср;бс;жм;сб`)},13,-1),`kk`),Y({group:`,`,mmmm:q(`ಜನವರಿ;ಫೆಬ್ರವರಿ;ಮಾರ್ಚ್;ಏಪ್ರಿಲ್;ಮೇ;ಜೂನ್;ಜುಲೈ;ಆಗಸ್ಟ್;ಸೆಪ್ಟೆಂಬರ್;ಅಕ್ಟೋಬರ್;ನವೆಂಬರ್;ಡಿಸೆಂಬರ್`),mmm:q(`ಜನವರಿ;ಫೆಬ್ರವರಿ;ಮಾರ್ಚ್;ಏಪ್ರಿ;ಮೇ;ಜೂನ್;ಜುಲೈ;ಆಗಸ್ಟ್;ಸೆಪ್ಟೆಂ;ಅಕ್ಟೋ;ನವೆಂ;ಡಿಸೆಂ`),dddd:q(`ಭಾನು~;ಸೋಮ~;ಮಂಗಳ~;ಬುಧ~;ಗುರು~;ಶುಕ್ರ~;ಶನಿ~`,`ವಾರ`),ddd:q(`ಭಾನು;ಸೋಮ;ಮಂಗಳ;ಬುಧ;ಗುರು;ಶುಕ್ರ;ಶನಿ`),ampm:q(`ಪೂರ್ವಾಹ್ನ;ಅಪರಾಹ್ನ`)},`kn`),Y({decimal:`,`,mmmm:q(`sausio;vasario;kovo;balandžio;gegužės;birželio;liepos;rugpjūčio;rugsėjo;spalio;lapkričio;gruodžio`),mmm:q(`saus.;vas.;kov.;bal.;geg.;birž.;liep.;rugp.;rugs.;spal.;lapkr.;gruod.`),dddd:q(`sekmadienis;pirmadienis;antradienis;trečiadienis;ketvirtadienis;penktadienis;šeštadienis`),ddd:q(`sk;pr;an;tr;kt;pn;št`),ampm:q(`priešpiet;popiet`)},`lt`),Y({decimal:`,`,mmmm:q(`janvāris;februāris;marts;aprīlis;maijs;jūnijs;jūlijs;augusts;septembris;oktobris;novembris;decembris`),mmm:q(`janv.;febr.;marts;apr.;maijs;jūn.;jūl.;aug.;sept.;okt.;nov.;dec.`),dddd:q(`svētdiena;pirmdiena;otrdiena;trešdiena;ceturtdiena;piektdiena;sestdiena`),ddd:q(`svētd.;pirmd.;otrd.;trešd.;ceturtd.;piektd.;sestd.`),ampm:q(`priekšpusdienā;pēcpusdienā`)},`lv`),Y({group:`,`,decimal:`.`,mmmm:q(`ജനുവരി;ഫെബ്രുവരി;മാർച്ച്;ഏപ്രിൽ;മേയ്;ജൂൺ;ജൂലൈ;ഓഗസ്റ്റ്;സെപ്റ്റംബർ;ഒക്‌ടോബർ;നവംബർ;ഡിസംബർ`),mmm:q(`ജനു;ഫെബ്രു;മാർ;ഏപ്രി;മേയ്;ജൂൺ;ജൂലൈ;ഓഗ;സെപ്റ്റം;ഒക്ടോ;നവം;ഡിസം`),dddd:q(`ഞായറാഴ്‌ച;തിങ്കളാഴ്‌ച;ചൊവ്വാഴ്ച;ബുധനാഴ്‌ച;വ്യാഴാഴ്‌ച;വെള്ളിയാഴ്‌ച;ശനിയാഴ്‌ച`),ddd:q(`ഞായർ;തിങ്കൾ;ചൊവ്വ;ബുധൻ;വ്യാഴം;വെള്ളി;ശനി`)},`ml`),Y({group:`,`,decimal:`.`,mmmm:q(`нэгдүгээ~;хоёрдугаа~;гуравдугаа~;дөрөвдүгээ~;тавдугаа~;зургаадугаа~;долоодугаа~;наймдугаа~;есдүгээ~;аравдугаа~;арван нэгдүгээ~;арван хоёрдугаа~`,`р сар`),mmm:q(`1~;2~;3~;4~;5~;6~;7~;8~;9~;10~;11~;12~`,`-р сар`),dddd:q(`ням;даваа;мягмар;лхагва;пүрэв;баасан;бямба`),ddd:q(`Ня;Да;Мя;Лх;Пү;Ба;Бя`),ampm:q(`ү.ө.;ү.х.`)},`mn`),Y({group:`,`,decimal:`.`,mmmm:q(`जानेवारी;फेब्रुवारी;मार्च;एप्रिल;मे;जून;जुलै;ऑगस्ट;सप्टेंबर;ऑक्टोबर;नोव्हेंबर;डिसेंबर`),mmm:q(`जाने;फेब्रु;मार्च;एप्रि;मे;जून;जुलै;ऑग;सप्टें;ऑक्टो;नोव्हें;डिसें`),dddd:q(`रविवार;सोमवार;मंगळवार;बुधवार;गुरुवार;शुक्रवार;शनिवार`),ddd:q(`रवि;सोम;मंगळ;बुध;गुरु;शुक्र;शनि`)},`mr`),Y(J({group:`,`,decimal:`.`,mmmm:q(`ဇန်နဝါရီ;ဖေဖော်ဝါရီ;မတ်;ဧပြီ;မေ;ဇွန်;ဇူလိုင်;ဩဂုတ်;စက်တင်ဘာ;အောက်တိုဘာ;နိုဝင်ဘာ;ဒီဇင်ဘာ`),mmm:q(`ဇန်;ဖေ;မတ်;ဧ;မေ;ဇွန်;ဇူ;ဩ;စက်;အောက်;နို;ဒီ`),dddd:q(`တနင်္ဂနွေ;တနင်္လာ;အင်္ဂါ;ဗုဒ္ဓဟူး;ကြာသပတေး;သောကြာ;စနေ`),ampm:q(`နံနက်;ညနေ`)},-1,0),`my`),Y({group:`,`,decimal:`.`,mmmm:q(`ਜਨਵਰੀ;ਫ਼ਰਵਰੀ;ਮਾਰਚ;ਅਪ੍ਰੈਲ;ਮਈ;ਜੂਨ;ਜੁਲਾਈ;ਅਗਸਤ;ਸਤੰਬਰ;ਅਕਤੂਬਰ;ਨਵੰਬਰ;ਦਸੰਬਰ`),mmm:q(`ਜਨ;ਫ਼ਰ;ਮਾਰਚ;ਅਪ੍ਰੈ;ਮਈ;ਜੂਨ;ਜੁਲਾ;ਅਗ;ਸਤੰ;ਅਕਤੂ;ਨਵੰ;ਦਸੰ`),dddd:q(`ਐਤਵਾਰ;ਸੋਮਵਾਰ;ਮੰਗਲਵਾਰ;ਬੁੱਧਵਾਰ;ਵੀਰਵਾਰ;ਸ਼ੁੱਕਰਵਾਰ;ਸ਼ਨਿੱਚਰਵਾਰ`),ddd:q(`ਐਤ;ਸੋਮ;ਮੰਗਲ;ਬੁੱਧ;ਵੀਰ;ਸ਼ੁੱਕਰ;ਸ਼ਨਿੱਚਰ`),ampm:q(`ਪੂ.ਦੁ.;ਬਾ.ਦੁ.`)},`pa`),Y({group:`.`,decimal:`,`,mmmm:q(`ianuarie;februarie;martie;aprilie;mai;iunie;iulie;august;septem~;octom~;noiem~;decem~`,`brie`),mmm:q(`ian.;feb.;mar.;apr.;mai;iun.;iul.;aug.;sept.;oct.;nov.;dec.`),dddd:q(`duminică;luni;marți;miercuri;joi;vineri;sâmbătă`),ddd:q(`dum.;lun.;mar.;mie.;joi;vin.;sâm.`),ampm:q(`a.m.;p.m.`)},`ro`),Y(J({group:`.`,decimal:`,`,mmmm:q(`januar;februar;marec;april;maj;junij;julij;avgust;september;oktober;november;december`),mmm:q(`jan.;feb.;mar.;apr.;maj;jun.;jul.;avg.;sep.;okt.;nov.;dec.`),dddd:q(`nedelja;ponedeljek;torek;sreda;četrtek;petek;sobota`),ampm:q(`dop.;pop.`)},-1,13),`sl`),Y(J({group:`.`,decimal:`,`,mmmm:q(`јануар;фебруар;март;април;мај;јун;јул;август;септембар;октобар;новембар;децембар`),dddd:q(`недеља;понедељак;уторак;среда;четвртак;петак;субота`)},3,3),`sr`),Y({group:`,`,decimal:`.`,mmmm:q(`ஜனவரி;பிப்ரவரி;மார்ச்;ஏப்ரல்;மே;ஜூன்;ஜூலை;ஆகஸ்ட்;செப்டம்பர்;அக்டோபர்;நவம்பர்;டிசம்பர்`),mmm:q(`ஜன.;பிப்.;மார்.;ஏப்.;மே;ஜூன்;ஜூலை;ஆக.;செப்.;அக்.;நவ.;டிச.`),dddd:q(`ஞாயிறு;திங்கள்;செவ்வாய்;புதன்;வியாழன்;வெள்ளி;சனி`),ddd:q(`ஞாயி.;திங்.;செவ்.;புத.;வியா.;வெள்.;சனி`)},`ta`),Y({group:`,`,decimal:`.`,mmmm:q(`జనవరి;ఫిబ్రవరి;మార్చి;ఏప్రిల్;మే;జూన్;జులై;ఆగస్టు;సెప్టెంబర్;అక్టోబర్;నవంబర్;డిసెంబర్`),mmm:q(`జన;ఫిబ్ర;మార్చి;ఏప్రి;మే;జూన్;జులై;ఆగ;సెప్టెం;అక్టో;నవం;డిసెం`),dddd:q(`ఆదివారం;సోమవారం;మంగళవారం;బుధవారం;గురువారం;శుక్రవారం;శనివారం`),ddd:q(`ఆది;సోమ;మంగళ;బుధ;గురు;శుక్ర;శని`)},`te`),Y({decimal:`,`,mmmm:q(`січня;лютого;березня;квітня;травня;червня;липня;серпня;вересня;жовтня;листопада;грудня`),mmm:q(`січ.;лют.;бер.;квіт.;трав.;черв.;лип.;серп.;вер.;жовт.;лист.;груд.`),dddd:q(`неділю;понеділок;вівторок;середу;четвер;пʼятницю;суботу`),ddd:q(`нд;пн;вт;ср;чт;пт;сб`),ampm:q(`дп;пп`)},`uk`),Y({group:`.`,decimal:`,`,mmmm:q(`~1;~2;~3;~4;~5;~6;~7;~8;~9;~10;~11;~12`,`tháng `),mmm:q(`~1;~2;~3;~4;~5;~6;~7;~8;~9;~10;~11;~12`,`thg `),dddd:q(`Chủ Nhật;Thứ Hai;Thứ Ba;Thứ Tư;Thứ Năm;Thứ Sáu;Thứ Bảy`),ddd:q(`CN;Th 2;Th 3;Th 4;Th 5;Th 6;Th 7`),ampm:q(`SA;CH`)},`vi`),Y(J({group:`٬`,decimal:`٫`,ampm:q(`ص;م`),mmmm:q(`يناير;فبراير;مارس;أبريل;مايو;يونيو;يوليو;أغسطس;سبتمبر;أكتوبر;نوفمبر;ديسمبر`),dddd:q(`الأحد;الاثنين;الثلاثاء;الأربعاء;الخميس;الجمعة;السبت`),mmmm6:q(`رمضان;شوال;ذو القعدة;ذو الحجة;محرم;ربيع الأول;ربيع الآخرة;جمادى الأولى;جمادى الآخرة;رجب;شعبان;رمضان`)},0,0),`ar`),Y({group:`,`,decimal:`.`,mmmm:q(`জানুয়ারী;ফেব্রুয়ারী;মার্চ;এপ্রিল;মে;জুন;জুলাই;আগস্ট;সেপ্টেম্বর;অক্টোবর;নভেম্বর;ডিসেম্বর`),mmm:q(`জানু;ফেব;মার্চ;এপ্রি;মে;জুন;জুল;আগ;সেপ্টেঃ;অক্টোঃ;নভেঃ;ডিসেঃ`),dddd:q(`রবিবার;সোমবার;মঙ্গলবার;বুধবার;বৃহস্পতিবার;শুক্রবার;শনিবার`),ddd:q(`রবি;সোম;মঙ্গল;বুধ;বৃহস্পতি;শুক্র;শনি`)},`bn`),Y({group:`,`,decimal:`.`,mmmm:q(`जनवरी;फ़रवरी;मार्च;अप्रैल;मई;जून;जुलाई;अगस्त;सितंबर;अक्तूबर;नवंबर;दिसंबर`),mmm:q(`जन॰;फ़र॰;मार्च;अप्रैल;मई;जून;जुल॰;अग॰;सित॰;अक्तू॰;नव॰;दिस॰`),dddd:q(`रविवार;सोमवार;मंगलवार;बुधवार;गुरुवार;शुक्रवार;शनिवार`),ddd:q(`रवि;सोम;मंगल;बुध;गुरु;शुक्र;शनि`),ampm:q(`am;pm`)},`hi`);let Ml={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 Nl(e,t=0){if(typeof e!=`number`)return e;if(e<0)return-Nl(-e,t);if(t){let n=10**t||1;return Nl(e*n,0)/n}return Math.round(e)}function Pl(e,t=2,n=2){let r=e<0?-1:1,i=10**(t||2),a=10**(n||2),o=Math.abs(e),s=0,c=0,l=0,u=1,d,f;if(e=o,e%1==0)f=[e*r,1];else if(e<1e-19)f=[r,0x8ac7230489e80000];else if(e>0x8ac7230489e80000)f=[0x8ac7230489e80000*r,1];else{do if(o=1/(o-Math.floor(o)),d=u,u=u*Math.floor(o)+s,s=d,c=l,l=Math.floor(e*u+.5),l>=i||u>=a)return[r*c,s];while(Math.abs(e-l/u)>=1e-13&&o!==Math.floor(o));f=[r*l,u]}return f}let Fl=Math.floor;function Il(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,r=Fl(4*n/146097);n-=Fl((146097*r+3)/4);let i=Fl(4e3*(n+1)/1461001);n=n-Fl(1461*i/4)+31;let a=Fl(80*n/2447),o=n-Fl(2447*a/80);n=Fl(a/11);let s=a+2-12*n;return[100*(r-49)+i+n|0,s|0,o|0]}function Ll(e){return Il(e+1462)}function Rl(e){if(e===60)throw Error(`#VALUE!`);if(e<=1)return[1317,8,29];if(e<60)return[1317,e<32?9:10,1+(e-2)%30];let t=10631/30,n=8.01/60,r=e+466935,i=Fl(r/10631);r-=10631*i;let a=Fl((r-n)/t);r-=Fl(a*t+n);let o=Fl((r+28.5001)/29.5);return o===13?[30*i+a,12,30]:[30*i+a,o,r-Fl(29.5001*o-29)]}function zl(e,t=0,n=!0){let r=Fl(e);return t===6?Rl(r):t===-1?Ll(r):Il(r,n)}let Bl=Math.floor,Vl=86400;function Hl(e,t){let n=null;if(Array.isArray(e)){let[t,r,i,a,o,s]=e;n=Date.UTC(t,r==null?0:r-1,i==null?1:i,a||0,o||0,s||0)}else if(e instanceof Date&&(n=e*1,!t||!t.ignoreTimezone)){let t=new Date;t.setUTCFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t.setUTCHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n=t*1}if(n!=null&&isFinite(n)){let e=n/864e5;return e-(e<=-25509?-25568:-25569)}return null}function Ul(e,t){let n=e|0,r=Vl*(e-n),i=Bl(r);r-i>.9999&&(i+=1,i===Vl&&(i=0,n+=1));let a=i<0?Vl+i:i,[o,s,c]=zl(e,0,t&&t.leap1900);return[o,s,c,Bl(a/60/60)%60,Bl(a/60)%60,Bl(a)%60]}let Wl=`!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`.split(`.`),Gl={j:`d`,d:`d`,D:`ddd`,l:`dddd`,n:`m`,m:`m`,M:`mmm`,F:`mmmm`,y:`yy`,Y:`yyyy`},Kl={j:`dd`,d:`dd`,D:`ddd`,l:`dddd`,n:`mm`,m:`mm`,M:`mmm`,F:`mmmm`,y:`yy`,Y:`yyyy`},ql={},Jl={};function Yl(e,t,n=1){if(e){let r=e[0],i=e.slice(1);r===`!`?Yl(i,t,4):r===`?`?Yl(i,t,2):(t[r]=t[r]||{},Yl(i,t[r],n))}else t.$=n}function Xl(e,t){Yl(e,t),Yl(e+` x`,t),Yl(e+` l`,t),Yl(e+` l x`,t),Yl(`l `+e,t),Yl(`l `+e+` x`,t),Yl(e+` D`,t),Yl(e+` D x`,t),Yl(`D `+e,t),Yl(`D `+e+` x`,t)}Wl.forEach(e=>{e[0]!==`?`&&Xl(e,ql),e[0]!==`!`&&Xl(e,Jl)});let Zl=new Date().getUTCFullYear(),Ql={".":[`,`,`\xA0`,` `,`'`,`٬`],",":[`.`,`\xA0`,` `,`'`,`٬`],"٫":[`.`,`\xA0`,` `,`'`,`٬`]},$l=e=>e&&e.length===1&&e>=`0`&&e<=`9`;function eu(e,t={}){let n=bl(t.locale||``)||Sl,r=n.decimal,i=[...Ql[r]||[`'`,`٬`]];!i.includes(n.group)&&n.group!==` `&&n.group!==r&&i.push(n.group);let a=``,o=``,s=1,c=``,l=!1,u=!1,d=!1,f=!1,p=!1,m=null,h=!1,g=0,_=[` `,`\xA0`,` `,`+`,`%`,`(`,`-`].concat(fl);for(;_.includes(e[g]);){let t=e[g];if(t===`-`){if(l||u)return null;l=!0,s=-1}else if(pl.test(t)){if(p)return null;p=!0,m=t}else if(t===`(`){if(u||l)return null;u=!0,s=-1}else if(t===`%`){if(f)return null;f=!0}g++}let v=!1,y;if(e[g]===r||$l(e[g]))for(;g<e.length;){let t=e[g];if(!y&&i.includes(t))y=t;else if(!(y&&y===t))if(t===r){if(v)break;a+=`.`,v=!0}else if($l(t))a+=t;else break;g++}if(e[g]===`e`||e[g]===`E`){o+=e[g],g++,(e[g]===`+`||e[g]===`-`)&&(o+=e[g],g++);let t=g;for(;$l(e[g]);)o+=e[g],g++;if(t===g)return null}let b=[` `,`\xA0`,` `,`%`,`$`,`)`].concat(fl);for(;b.includes(e[g]);){let t=e[g];if(pl.test(t)){if(p)return null;p=!0,m=t,h=!0}else if(t===`)`){if(d||!u)return null;d=!0}else if(t===`%`){if(f)return null;f=!0}g++}if(g!==e.length)return null;let x=parseFloat(a+o);if(!isFinite(x))return null;if(o){if(f||p)return null;c=`0.00E+00`}else if(f){if(p)return null;c=a.includes(`.`)?`0.00%`:`0%`,x*=.01}else if(p){let e=a.includes(`.`)?`#,##0.00`:`#,##0`;c=h?e+m:m+e}else y&&(c=a.includes(`.`)?`#,##0.00`:`#,##0`);let S={v:x*s};return c&&(S.z=c),S}function tu(e,t,n){if(n<1||t<1||t>12)return!1;if(t===2){if(n>(e%4==0&&e%100!=0||e%400==0||e===1900?29:28))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}let nu=(e,t,n=!1)=>{for(let r of t)if(e.startsWith(r[0])){let t=r[0].length;return n&&(r[2]===`D`||r[2]===`M`)&&e[t]===`.`&&t++,[e.slice(0,t),r]}return[``,null]},ru=(e,t,n,r)=>{let i=n.path||``,a=Object.keys(t);for(let o=0;o<a.length;o++){let s,c=a[o];if(t[c]){if(c===`$`||c===`€`)e||(s=n);else if(c===`-`){let a=/^(\s*([./-]|,\s)\s*|\s+)/.exec(e);if(a){let o=a[1]===`-`||a[1]===`/`||a[1]===`.`?a[1]:` `;if(!n.sep||n.sep===o){let l=a[0].replace(/\s+/g,` `);s=ru(e.slice(a[0].length),t[c],{...n,sep:o,path:i+l},r)}}}else if(c===` `){let a=/^[,.]?\s+/.exec(e);if(a){let o=a[0].replace(/\s+/g,` `);s=ru(e.slice(a[0].length),t[c],{...n,path:i+o},r)}}else if(c===`j`||c===`d`){let a=/^(0?[1-9]|1\d|2\d|3[01])\b/.exec(e);a&&(s=ru(e.slice(a[0].length),t[c],{...n,day:a[0],path:i+c},r))}else if(c===`n`||c===`m`){let a=/^(0?[1-9]|1[012])\b/.exec(e);a&&(s=ru(e.slice(a[0].length),t[c],{...n,month:+a[0],_mon:a[0],path:i+c},r))}else if(c===`F`||c===`M`){let[a,o]=nu(e,r.mon,r.mp);o&&o[2]===c&&(s=ru(e.slice(a.length),t[c],{...n,month:o[1],_mon:a,path:i+c},r))}else if(c===`l`||c===`D`){let[a,o]=nu(e,r.day,r.dp);o&&o[2]===c&&(s=ru(e.slice(a.length),t[c],{...n,path:i+c},r))}else if(c===`y`){let a=/^\d\d\b/.exec(e);if(a){let o=+a[0]>=30?+a[0]+1900:+a[0]+2e3;s=ru(e.slice(a[0].length),t[c],{...n,year:o,path:i+c},r)}}else if(c===`Y`){let a=/^\d\d\d\d\b/.exec(e);a&&(s=ru(e.slice(a[0].length),t[c],{...n,year:+a[0],path:i+c},r))}else if(c===`x`){let a=cu(e,{locale:r.locale});a&&(s=ru(``,t[c],{...n,time:a.v,tf:a.z,path:i+c},r))}else throw Error(`Unknown date token "${c}"`);if(s&&tu(n.year||1916,n.month||1,n.day?+n.day:1))return s}}},iu=e=>e.replace(/\s+/g,` `).trim().replace(/’/,`'`).replace(/\.$/,``).toLowerCase(),au=(e,t)=>{let n=e.map((e,n)=>[iu(e),n+1,t]);return n.sort((e,t)=>t[0].length-e[0].length),n};function ou(e,t={}){let n=bl(t.locale||``)||Sl,r={mon:au(n.mmmm,`F`).concat(au(n.mmm,`M`)),mp:n.mmm[0].at(-1)===`.`,day:au(n.dddd,`l`).concat(au(n.ddd,`D`)),dp:n.ddd[0].at(-1)===`.`,locale:t.locale},i=ru(iu(e),n.preferMDY?Jl:ql,{path:``},r);if(i){var a;if(i.sep===`.`&&i.path.length===3)return null;let e=+((a=i.year)==null?Zl:a);i.day||(i.day=1);let t=-1/0;if(e<1900)return null;e<=1900&&i.month<=2?t=25568:e<1e4&&(t=25569);let n=Date.UTC(e,i.month-1,i.day)/864e5+t+(i.time||0);if(n>=0&&n<=2958465){let e=i._mon[0]===`0`||i.day[0]===`0`||i._mon.length===2&&i.day.length===2;return{v:n,z:i.path.replace(/[jdlDnmMFyYx]/g,t=>t===`x`?i.tf||``:(e?Kl[t]:Gl[t])||t)}}}return null}let su=e=>e.replace(/\s+/g,``).trim().replace(/\./g,``).toLowerCase();function cu(e,t={}){let n=bl(t.locale||``)||Sl,r=/^\s*([10]?\d|2[0-4])(?::([0-5]\d|\d))?(?::([0-5]\d|\d))?(\.\d{1,10})?(?=\s*[^\s\d]|$)/.exec(e),i=``;if(r){let t=su(e.slice(r[0].length));if(t===su(n.ampm[0])||t===`a`||t===`am`)i=`a`;else if(t===su(n.ampm[1])||t===`p`||t===`pm`)i=`p`;else if(t)return null}if(r){let[,e,t,n,a]=r;if(a&&!n||!i&&!t&&!n)return null;let o=(e||0)*1;if(i){if(o>=13)return null;i===`p`&&(o+=12)}let s=(t||0)*1,c=(n||0)*1,l=(a||0)*1;return{v:(o*60*60+s*60+c+l)/(3600*24),z:(e.length===2?`hh`:`h`)+`:mm`+(n?`:ss`:``)+(i?` AM/PM`:``)}}return null}function lu(e,t={}){let n=bl(t.locale||``)||Sl,r=e.trim().toLowerCase(),i=n.bool[0].toLowerCase();if(r===`true`||r===i)return{v:!0};let a=n.bool[1].toLowerCase();return r===`false`||r===a?{v:!1}:null}function uu(e,t){var n,r,i;return(n=(r=(i=eu(e,t))==null?ou(e,t):i)==null?cu(e,t):r)==null?lu(e,t):n}function du(e,t,n){return t[n+`_max`]=e.length,t[n+`_min`]=e.replace(/#/g,``).length,t}function fu(e,t){typeof e==`string`?t.push({type:`string`,value:e}):t.push(e)}function pu(e,t){let n=e&&e.type;return n===`hash`||n===`zero`||n===`qmark`||n===`digit`&&t===`den`}function mu(e){let t=[],n={scale:1,percent:!1,text:!1,date:0,date_eval:!1,date_system:1,sec_decimals:0,general:!1,clock:24,int_pattern:[],frac_pattern:[],man_pattern:[],den_pattern:[],num_pattern:[],tokens:t},r=`int`,i=null,a=[],o,s=!1,c=-1,l=!1,u=``,d=!1;for(;++c<e.length&&!l;){var f;let h=e[c],g=h.type||`error`;if(u+=h.raw,g===`general`)n.general=!0,fu(h,t);else if(pu(h,r)){let e=n[r+`_pattern`];pu(o,r)||(o==null?void 0:o.type)===`group`?(e.push((e.pop()||``)+h.value),i.num+=h.value):(e.push(h.value),i={type:r,num:h.value},fu(i,t))}else if(g===`paren`)h.value===`(`&&(n.parens=!0),fu(h.value,t);else if(g===`digit`)fu(h.value,t);else if(g===`slash`)if(d=!0,n[r+`_pattern`].length){if(!i)throw SyntaxError(`Format pattern is missing a numerator`);n.fractions=!0,n.num_pattern.push(n[r+`_pattern`].pop()),i.type=`num`,r=`den`,fu({type:`div`},t)}else fu(h.value,t);else if(g===`comma`)fu(`,`,t);else if(g===`scale`)n.scale=.001**h.raw.length;else if(g===`group`){if(r===`int`&&(n.grouping=!0),r===`den`)throw SyntaxError(`Cannot group denominator digits`)}else if(g===`space`)fu(h,t);else if(g===`break`){l=!0;break}else if(g===`text`)n.text=!0,fu(h,t);else if(g===`plus`||g===`minus`)fu(h,t);else if(g===`duration`){let e=h.value.toLowerCase(),r=e[0],i={type:``,size:0,date:1,pad:e.length};r===`h`?(i.size=16,i.type=`hour-elap`):r===`m`?(i.size=32,i.type=`min-elap`):(i.size=64,i.type=`sec-elap`),n.date|=i.size,a.push(i),fu(i,t)}else if(n.date&&g===`point`&&((f=e[c+1])==null?void 0:f.type)===`zero`){var p,m;let r=1;c++;let i=`0`;((p=e[c+1])==null?void 0:p.type)===`zero`&&(i+=`0`,r=2,c++),((m=e[c+1])==null?void 0:m.type)===`zero`&&(i+=`0`,r=3,c++),u+=i;let a=[64,128,256,512][r];n.date|=a,n.date_eval=!0,n.sec_decimals=Math.max(n.sec_decimals,r),fu({type:`subsec`,size:a,decimals:r,date:1},t)}else if(g===`calendar`)s||(h.value===`B2`||h.value===`b2`?n.date_system=6:n.date_system=1);else if(g===`datetime`){let e={type:``,size:0,date:1},r=h.value.toLowerCase(),i=r[0];if(r===`y`||r===`yy`)e.size=2,e.type=`year-short`;else if(i===`y`||i===`e`)e.size=2,e.type=`year`;else if(r===`b`||r===`bb`)e.size=2,e.type=`b-year-short`;else if(i===`b`)e.size=2,e.type=`b-year`;else if(r===`d`||r===`dd`)e.size=8,e.type=`day`,e.pad=/dd/.test(r);else if(r===`ddd`||r===`aaa`)e.size=8,e.type=`weekday-short`;else if(i===`d`||i===`a`)e.size=8,e.type=`weekday`;else if(i===`h`)e.size=16,e.type=`hour`,e.pad=/hh/i.test(r);else if(i===`m`){r.length===3?(e.size=4,e.type=`monthname-short`):r.length===5?(e.size=4,e.type=`monthname-single`):r.length>=4&&(e.size=4,e.type=`monthname`);let t=a[a.length-1];!e.type&&t&&!t.used&&t.size&80&&(t.used=!0,e.size=32,e.type=`min`,e.pad=/mm/.test(r)),e.type||(e.size=4,e.type=`month`,e.pad=/mm/.test(r),e.indeterminate=!0)}else if(i===`s`){e.size=64,e.type=`sec`,e.pad=/ss/.test(r);let t=a[a.length-1];t&&t.size&32?e.used=!0:t&&t.indeterminate&&(delete t.indeterminate,t.size=32,t.type=`min`,e.used=!0)}n.date|=e.size,n.date_eval=!0,a.push(e),fu(e,t)}else if(g===`ampm`)n.clock=12,n.date|=16,n.date_eval=!0,h.short=h.value===`A/P`,fu(h,t);else if(g===`string`||g===`escaped`||g===`char`)fu(h.value,t);else if(g===`condition`)n.condition=[h.value[0],parseFloat(h.value[1])];else if(g===`locale`){let e=h.value.split(`-`),r=e.length<2?``:e.slice(1).join(`-`),i=e[0];i&&fu(i,t);let a=yl(r);a&&(n.locale=a);let o=parseInt(r,16);isFinite(o)&&o&16711680&&(o>>16&255)==6&&(n.date_system=6),s=!0}else if(g===`color`){let e,t=h.value.toLowerCase();(e=/^color\s*(\d+)$/i.exec(t))&&(t=parseInt(e[1],10)),n.color=t}else if(g===`percent`)n.scale=100,n.percent=!0,fu(`%`,t);else if(g===`point`)fu(h,t),n.date||(n.dec_fractions=!0,r=`frac`);else if(g===`exp`)n.exponential=!0,n.exp_plus=h.value.includes(`+`),r=`man`,fu({type:`exp`,plus:n.exp_plus},t);else if(g===`skip`)fu(h,t);else if(g===`fill`)fu(h,t);else if(!(g===`dbnum`||g===`natnum`))throw g===`error`?SyntaxError(`Illegal character: ${u}`):SyntaxError(`Unknown token ${g} in ${u}`);o=h}if(n.tokensUsed=c,n.pattern=u,/^((?:\[[^\]]+\])+)(;|$)/.test(n.pattern)&&!/^\[(?:h+|m+|s+)\]/.test(n.pattern)&&fu({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||d&&!n.fractions&&!n.date||n.exponential&&(n.int_pattern.length||n.frac_pattern.length)*n.man_pattern.length===0)throw SyntaxError(`Invalid pattern: ${u}`);let h=n.int_pattern.join(``),g=n.man_pattern.join(``),_=n.frac_pattern.join(``);du(h,n,`int`);let v=0;for(let e=0;e<h.length;e++){let t=h[h.length-1-e];/^[0-9?]/.test(t)&&(v=e+1)}n.int_min=v,du(_,n,`frac`),du(g,n,`man`);let y=n.num_pattern.join(``),b=n.den_pattern[0]||``;if(b.includes(`?`)||y.includes(`?`)?(b=b.replace(/\d/g,`?`),b=b.replace(/#$/g,`?`),du(y,n,`num`),du(b,n,`den`),y=y.replace(/#$/g,`?`)):(du(y,n,`num`),du(b,n,`den`)),n.int_p=h,n.man_p=g,n.num_p=y,n.den_p=b,n.den_pattern.length&&(n.denominator=parseInt(n.den_pattern.join(``).replace(/\D/g,``),10)),n.integer=!!h.length,!n.integer&&!n.exponential&&_.length){let e=n.tokens.findIndex(e=>e.type===`point`);n.tokens.splice(e,0,{type:`int`,value:`#`}),n.integer=!0,n.int_pattern=[`#`],n.int_p=`#`}if(n.fractions)for(let e=0;e<t.length-1;e++){let n=t[e];if(n.type!==`string`&&n.type!==`space`)continue;let r=t[e+1].type;r===`num`?n.rule=`num+int`:r===`div`?n.rule=`num`:r===`den`&&(n.rule=`den`)}return n.grouping&&n.int_pattern.length>1&&(n.grouping=!1),n}function hu(e){if(e===0)return e;let 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 gu(e,t=0){let n=Math.floor(Math.log10(e));return t>1?Math.floor(n/t)*t:n}function _u(e,t=1){return t<-300?parseFloat(e.toExponential().split(`e`)[0]):e*10**-t}let vu={total:1,sign:0,period:0,int:1,frac:0};function yu(e,t=!0){let n=Math.abs(e);if(!n)return vu;let r=t&&e<0?1:0,i=Math.floor(n),a=Math.floor(Math.log10(n)+1),o=0,s=0;if(i!==n){o=1;let e=String(Nl(n*10**-a,15)),t=e.length,r=!0,i=0;for(;i<=e.length;){if(e[i]===`.`){t--;break}else e[i]===`0`&&r?t--:r=!1;i++}s=t-a,s<0&&(s=0,o=0)}return{total:r+Math.max(a,1)+o+s,digits:Math.max(a,0)+s,sign:r,period:o,int:Math.max(a,1),frac:s}}let bu=(e,t)=>e.replace(/\./,t.decimal),xu=(e,t,n)=>{let r=Math.abs(t),i;return i=e===1?e:Nl(e,5),[bu(i+``,n),n.exponent,t<0?n.negative:n.positive,r<10?`0`:``,r]};function Su(e,t,n,r){let i=n|0;if(typeof n==`string`)e.push(n);else if(n===i)e.push(Math.abs(i));else{let t=Math.abs(n),i=gu(t),a=_u(t,i);a===10&&(a=1,i++);let o=yu(t);if(i>=-4&&i<=-1){let n=t.toPrecision(10+i).replace(/\.?0+$/,``);e.push(bu(n,r))}else if(i===10){let n=t.toFixed(10).slice(0,12).replace(/\.$/,``);e.push(bu(n,r))}else if(Math.abs(i)<=9)if(o.total<=11){let n=Nl(t,9).toFixed(o.frac);e.push(bu(n,r))}else i===9?e.push(Math.floor(t)):i>=0&&i<9?e.push(bu(String(Nl(t,9-i)),r)):e.push(...xu(a,i,r));else o.total>=12?e.push(...xu(a,i,r)):e.push(bu(Nl(t,9).toFixed(o.frac),r))}return e}function Cu(e,t=!1){return e===`0`?`0`:e===`?`?t?`\xA0`:` `:``}let wu=86400,Tu=(e,t,n)=>n?e<-694324||t>=35830291:e<0||t>=2958466;function Eu(e,t,n,r){var i,a;let o=``,s=``,c=``,l=``,u=``,d=``,f=0,p=0;if(typeof e==`bigint`){if(e<=2**53-1&&e>=-(2**53-1))e=Number(e);else return n.bigintErrorNumber?String(e):n.overflow;p=e}else p=Math.trunc(e);let m=0,h=0,g=1,_=0,v=0,y=0,b=0,x=0,S=0,C=r||Sl;if(!t.text&&isFinite(t.scale)&&t.scale!==1&&(e=hu(e*t.scale)),t.exponential){let n=Math.abs(e);n&&(f=gu(n,t.int_max)),e&&!t.integer&&f++,n=_u(n,f),t.int_max===1&&Nl(n,t.frac_max)===10&&(n=1,f++),e=e<0?-n:n,o+=Math.abs(f)}if(t.integer){let n=Math.abs(Nl(e,t.fractions?1:t.frac_max));d+=n<1?``:Math.floor(n)}let w=(i=n.grouping[0])==null?3:i,T=(a=n.grouping[1])==null?w:a;t.dec_fractions&&(u=String(Nl(e,t.frac_max)).split(`.`)[1]||``);let E=!t.error&&(t.num_p.includes(`0`)||t.den_p.includes(`0`)),D=E;if(t.fractions){D=E||!!(e%1);let n=Math.abs(t.integer?e%1:e);if(n)if(D=!0,t.denominator&&isFinite(t.denominator))l+=t.denominator,c+=Nl(n*t.denominator),c===`0`&&(c=``,l=``,D=E);else{let e=Pl(n,1/0,t.den_max);c+=e[0],l+=e[1],t.integer&&c===`0`&&(c=``,l=``,D=E)}else !e&&!t.integer&&(D=!0,c=`0`,l=`1`);t.integer&&!D&&!Math.trunc(e)&&(d=`0`)}if(t.date){p=Math.trunc(e);let r=wu*(e-p);if(m=Math.floor(r),S=r-m,Math.abs(S)<1e-6?S=0:S>.9999&&(S=0,m+=1,m===wu&&(m=0,p+=1)),S){let e=t.date&512||t.date&256||t.date&128;(e===512&&S>.9995||e===256&&S>.995||e===128&&S>.95||!e&&S>=.5)&&(m++,S=0)}if(p||t.date_system){let r=zl(e,t.date_system,n.leap1900);h=r[0],g=r[1],_=r[2]}if(m){let e=m<0?wu+m:m;x=Math.floor(e)%60,b=Math.floor(e/60)%60,y=Math.floor(e/60/60)%60}if(v=(6+p)%7,t.date_eval&&Tu(e,p+m/wu,n.dateSpanLarge)){if(n.dateErrorThrows)throw Error(`Date out of bounds`);return n.dateErrorNumber?Su(e<0?[C.negative]:[],{},e,C).join(``):n.overflow}}let O=Cu(`?`,n.nbsp);f<0?s=`-`:t.exp_plus&&(s=`+`);let k=[],A=(e,t,r,i)=>{let a=!i&&e.length>t.length?r.length+e.length-t.length:r.length;e.length<t.length&&(i+=e.length-t.length);for(let t=0;t<a;t++)k.push(e[t+i]||Cu(r[t],n.nbsp));return a},j=!1,M={int:0,frac:0,man:0,num:0,den:0};for(let i=0,a=t.tokens.length;i<a;i++){let a=t.tokens[i],f=a.type,E=a.num?a.num.length:0;if(f===`string`)a.rule?a.rule===`num`?D?k.push(a.value.replace(/ /g,O)):(t.num_min>0||t.den_min>0)&&k.push(a.value.replace(/./g,O)):a.rule===`num+int`?D&&d?k.push(a.value.replace(/ /g,O)):t.den_min>0&&(d||t.num_min)&&k.push(a.value.replace(/./g,O)):a.rule===`den`&&(D?k.push(a.value.replace(/ /g,O)):(t.den_min>0||t.den_min>0)&&k.push(a.value.replace(/./g,O))):k.push(a.value.replace(/ /g,O));else if(f===`space`)a.rule===`num+int`?(D||t.num_min||t.den_min)&&(d||t.num_min)&&k.push(O):k.push(O);else if(f===`error`)k.push(n.invalid);else if(f===`point`)k.push(t.date?a.value:C.decimal);else if(f===`general`)Su(k,t,e,C);else if(f===`exp`)k.push(C.exponent);else if(f===`minus`)a.volatile&&t.date||a.volatile&&(e>=0||typeof e!=`number`)||(a.volatile&&!t.fractions&&(t.integer||t.dec_fractions)?(e<0&&d&&d!==`0`||u)&&k.push(C.negative):k.push(C.negative));else if(f===`plus`)k.push(C.positive);else if(f===`text`)k.push(e);else if(f===`fill`)n.fillChar&&k.push(n.fillChar,a.value);else if(f===`skip`)n.skipChar?k.push(n.skipChar,a.value):k.push(n.nbsp?`\xA0`:` `);else if(f===`div`)D?k.push(`/`):t.num_min>0||t.den_min>0?k.push(O):k.push(Cu(`#`,n.nbsp));else if(f===`int`)if(t.int_pattern.length===1){let e=t.int_p,r=Math.max(t.int_min,d.length),i=``;for(let a=r;a>0;a--){let r=d.charAt(d.length-a),o=r?``:e.charAt(e.length-a)||e[0],s=``;if(t.grouping){let e=a-1-w;e>=0&&!(e%T)&&(s=r||o===`0`?C.group:Cu(`?`,n.nbsp))}i+=(r||Cu(o,n.nbsp))+s}k.push(i)}else M.int+=A(d,t.int_p,a.num,M.int);else if(f===`frac`){let e=M.frac;for(let t=0;t<E;t++)k.push(u[t+e]||Cu(a.num[t],n.nbsp));M.frac+=E}else if(f===`man`)!M[f]&&!M.man&&k.push(s),M.man+=A(o,t.man_p,a.num,M.man);else if(f===`num`)M.num+=A(c,t.num_p,a.num,M.num);else if(f===`den`){let e=M.den;for(let t=0;t<E;t++){let r=l[t+e];if(!r){let e=a.num[t];`123456789`.includes(e)||j&&e===`0`?(j=!0,r=n.nbsp?`\xA0`:` `):r=!j&&t===E-1&&e===`0`&&!l?`1`:Cu(e,n.nbsp)}k.push(r)}M.den+=E}else if(f===`year`)h<0&&k.push(C.negative),k.push(String(Math.abs(h)).padStart(4,`0`));else if(f===`year-short`){let e=h%100;k.push(e<10?`0`:``,e)}else if(f===`month`)k.push(a.pad&&g<10?`0`:``,g);else if(f===`monthname-single`)t.date_system===6?k.push(C.mmmm6[g-1].charAt(0)):k.push(C.mmmm[g-1].charAt(0));else if(f===`monthname-short`)t.date_system===6?k.push(C.mmm6[g-1]):k.push(C.mmm[g-1]);else if(f===`monthname`)t.date_system===6?k.push(C.mmmm6[g-1]):k.push(C.mmmm[g-1]);else if(a.type===`weekday-short`)k.push(C.ddd[v]);else if(f===`weekday`)k.push(C.dddd[v]);else if(f===`day`)k.push(a.pad&&_<10?`0`:``,_);else if(f===`hour`){let e=y%t.clock||(t.clock<24?t.clock:0);k.push(a.pad&&e<10?`0`:``,e)}else if(f===`min`)k.push(a.pad&&b<10?`0`:``,b);else if(f===`sec`)k.push(a.pad&&x<10?`0`:``,x);else if(f===`subsec`){k.push(C.decimal);let e=S.toFixed(t.sec_decimals);k.push(e.slice(2,2+a.decimals))}else if(f===`ampm`){let e=y<12?0:1;a.short&&!r?k.push(`AP`[e]):k.push(C.ampm[e])}else if(f===`hour-elap`){e<0&&k.push(C.negative);let t=p*24+Math.floor(Math.abs(m)/3600);k.push(String(Math.abs(t)).padStart(a.pad,`0`))}else if(f===`min-elap`){e<0&&k.push(C.negative);let t=p*1440+Math.floor(Math.abs(m)/60);k.push(String(Math.abs(t)).padStart(a.pad,`0`))}else if(f===`sec-elap`){e<0&&k.push(C.negative);let t=p*wu+Math.abs(m);k.push(String(Math.abs(t)).padStart(a.pad,`0`))}else if(f===`b-year`)k.push(h+543);else if(f===`b-year-short`){let e=(h+543)%100;k.push(e<10?`0`:``,e)}}return k.join(``)}let Du=mu([{type:Vc,value:`@`,raw:`@`}]);function Ou(e,t){for(let n=0;n<3;n++){let r=t[n];if(r){let t;if(r.condition){let n=r.condition[0],i=r.condition[1];n===`=`?t=e===i:n===`>`?t=e>i:n===`<`?t=e<i:n===`>=`?t=e>=i:n===`<=`?t=e<=i:n===`<>`&&(t=e!==i)}else t=!0;if(t)return r}}}function ku(e,t,n){let r=t.partitions,i=r[3],a=null;return(typeof e==`number`||typeof e==`bigint`)&&isFinite(e)&&(i=Ou(e,r)),i&&i.color&&(a=i.color),a&&typeof a==`number`&&n.indexColors&&(a=dl[a-1]||`#000`),a}function Au(e,t,n){let r=t.partitions,i=bl(t.locale||n.locale),a=r[3]?r[3]:Du;if(typeof e==`boolean`&&(e=(i||Sl).bool[e?0:1]),e==null)return``;let o=typeof e==`bigint`;if(typeof e!=`number`&&!o)return Eu(e,a,n,i);if(!o&&!isFinite(e)){let t=i||Sl;return isNaN(e)?t.nan:(e<0?t.negative:``)+t.infinity}let s=Ou(e,r);return s?Eu(e,s,n,i):n.overflow}function ju(e){return!!(e[0]&&e[0].percent||e[1]&&e[1].percent||e[2]&&e[2].percent||e[3]&&e[3].percent)}function Mu(e){return!!(e[0]&&e[0].date||e[1]&&e[1].date||e[2]&&e[2].date||e[3]&&e[3].date)}function Nu(e){let[t,n,r,i]=e;return!!((!t||t.generated)&&(!n||n.generated)&&(!r||r.generated)&&i&&i.text&&!i.generated)}let Pu={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},Fu=[[`DMY`,1],[`DM`,2],[`MY`,3],[`MDY`,4],[`MD`,5],[`hmsa`,6],[`hma`,7],[`hms`,8],[`hm`,9]];function Iu(e,t=null){var n;let[r,i]=e,a=r.frac_max,o={type:`general`,isDate:Mu(e),isText:Nu(e),isPercent:ju(e),maxDecimals:r.general?9:a,scale:(n=r.scale)==null?1:n,color:0,parentheses:0,grouped:r.grouping?1:0},s=!o.isDate&&!o.isText&&!r.error&&r.tokens.some(e=>e.type===`string`&&(t?e.value===t:pl.test(e.value))),c=`G`,l=a>=0?Math.min(15,a):``,u=``,d=``;if(i&&i.color&&(d=`-`,o.color=1),r.parens&&(u=`()`,o.parentheses=1),s)c=`C`,o.type=`currency`;else if(r.error)o.type=`error`,o.maxDecimals=0;else if(o.isDate){let e=0,t=0,n=``;r.tokens.forEach(r=>{let i=r.type;/^(b-)?year/.test(i)?(n+=`Y`,t++):i.startsWith(`month`)?(n+=`M`,t++):/^(week)?day/.test(i)?(n+=`D`,t++):(i===`hour`||i===`min`||i===`sec`||i===`ampm`)&&(n+=i[0],e++)}),o.type=`date`,t&&e?o.type=`datetime`:!t&&e&&(o.type=`time`);let i=Fu.find(e=>n.startsWith(e[0]));c=i?`D`:`G`,l=i?i[1]:``}else o.isText?(c=`G`,o.type=`text`,l=``,o.maxDecimals=0):r.general?(c=`G`,o.type=`general`,l=``):r.fractions?(c=`G`,o.type=`fraction`,l=``):r.exponential?(c=`S`,o.type=`scientific`):o.isPercent?(c=`P`,o.type=`percent`):r.grouping?(c=`,`,o.type=`grouped`):(r.int_max||a)&&(c=`F`,o.type=`number`);return o.code=c+l+d+u,o.level=Pu[o.type],Object.freeze(o)}function Lu(e){let[t]=e;return{year:!!(t.date&2),month:!!(t.date&4),day:!!(t.date&8),hours:!!(t.date&16),minutes:!!(t.date&32),seconds:!!(t.date&64),clockType:t.clock===12?12:24}}let Ru=[[Mc,/^General/i,0],[Nc,/^#/,0],[Pc,/^0/,0],[Fc,/^\?/,0],[Ic,/^\//,0],[Bc,/^;/,0],[Vc,/^@/,0],[Hc,/^\+/,0],[Uc,/^-/,0],[Wc,/^\./,0],[Gc,/^ /,0],[Kc,/^%/,0],[qc,/^[1-9]/,0],[Jc,/^(?:B[12])/i,0],[Yc,/^B$/,0],[Xc,/^(?:[hH]+|[mM]+|[sS]+|[yY]+|[bB]+|[dD]+|[gG]+|[aA]{3,}|e+)/,0],[Zc,/^(?:\[(h+|m+|s+)\])/i,1],[Qc,/^\[(<[=>]?|>=?|=)\s*(-?[.\d]+)\]/,[1,2]],[$c,/^\[(DBNum[0-4]?\d)\]/i,1],[el,/^\[(NatNum[0-4]?\d)\]/i,1],[tl,/^\[\$([^\]]+)\]/,1],[nl,/^\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*\d+)\]/i,1],[rl,/^\[([^\]]+)\]/,1],[il,/^(?:AM\/PM|am\/pm|A\/P)/,0],[al,/^\\(.)/,1],[ol,/^"([^"]*?)"/,1],[sl,/^_(\\.|.)/,1],[`exp`,/^[Ee]([+-])/,1],[cl,/^\*(\\.|.)/,1],[ll,/^[()]/,0],[Yc,/^[EÈÉÊËèéêëĒēĔĕĖėĘęĚěȄȅȆȇȨȩNnÑñŃńŅņŇňǸǹ["*/\\_]/,0],[ul,/^./,0]],zu=e=>{let t=(e||`\0`).charCodeAt(0);return t===63||t===35||t>=48&&t<=57};function Bu(e){let t=0,n=[],r=[];for(;t<e.length;){let i=e.slice(t),a=0,o=/^(,+)(.)?/.exec(i);if(o){let i=o[1];a=i.length;let s=e[t-1]||``,c=!1,l=!1;zu(s)?(c=!0,l=!0):s===`.`&&(l=!0);let u=o[2]||``;if(c&&(!u||u===`;`)&&(c=!1),l&&zu(u)&&(l=!1),c&&!l)n.push({type:Lc,value:`,`,raw:i});else if(!c&&l)n.push({type:Rc,value:`,`,raw:i});else if(c&&l){let e={type:Rc,value:`,`,raw:i};n.push(e),r.push(e)}else n.push({type:zc,value:`,`,raw:i})}else{let e;for(let[t,r,o]of Ru){let s=r.exec(i);if(s){e={type:t,value:Array.isArray(o)?o.map(e=>s[e]):s[o||0],raw:s[0]},n.push(e),a=s[0].length;break}}r.length&&e.raw===`;`&&(r.length=0),r.length&&zu(e.raw)&&(r.forEach(e=>e.type=Lc),r.length=0)}if(!a){let e=i[0];a=1,n.push({type:ul,value:e,raw:e})}t+=a}return n}let Vu=e=>{let t=e.condition;t&&t[1]<0&&(t[0]===`<`||t[0]===`<=`||t[0]===`=`)||e.tokens.unshift({type:`minus`,volatile:!0})},Hu=(e,t=null)=>{let n={};for(let t in e)Array.isArray(e[t])?n[t]=[...e[t]]:n[t]=e[t];return t&&n.tokens.unshift(t),n.generated=!0,n};function Uu(e){let t=[],n=!1,r,i=null,a=0,o=!1,s=0,c=0,l=Bu(e);do{var u;if(o=mu(l),(o.date||o.general)&&(o.int_pattern.length||o.frac_pattern.length||o.scale!==1||o.text))throw Error(`Illegal format`);if(o.condition&&(c++,n=!0),o.text){if(i)throw Error(`Unexpected partition`);i=o}o.locale&&(r=yl(o.locale)),t.push(o),a=((u=l[o.tokensUsed])==null?void 0:u.type)===`break`?1:0,l=l.slice(o.tokensUsed+a),s++}while(a&&s<4&&c<3);if(a)throw Error(`Unexpected partition`);if(c>2)throw Error(`Unexpected condition`);let d=t[3];if(d&&(d.int_pattern.length||d.frac_pattern.length||d.date))throw Error(`Unexpected partition`);if(n){let e=t.length;if(e===1&&(t[1]=mu(Bu(`General`)),t[1].generated=!0),e<3){let e=t[0],n=t[1];if(Vu(e),n.condition)Vu(n);else{let t=e.condition;(t[0]===`=`||t[1]>=0&&(t[0]===`>`||t[0]===`>=`))&&n.tokens.unshift({type:`minus`,volatile:!0})}}else t.forEach(Vu)}else{if(t.length<4&&i)for(let e=0,n=t.length;e<n;e++)t[e]===i&&t.splice(e,1);if(t.length<1&&i&&(t[0]=mu(Bu(`General`)),t[0].generated=!0),t.length<2&&t.push(Hu(t[0],{type:`minus`,volatile:!0})),t.length<3&&t.push(Hu(t[0])),t.length<4)if(i)t.push(i);else{let e=mu(Bu(`@`));e.generated=!0,t.push(e)}t[0].condition=[`>`,0],t[1].condition=[`<`,0],t[2].condition=null}return{pattern:e,partitions:t,locale:r}}var Wu=f({addLocale:()=>Y,dateFromSerial:()=>Ul,dateToSerial:()=>Hl,dec2frac:()=>Pl,format:()=>qu,formatColor:()=>Ju,getFormatDateInfo:()=>ed,getFormatInfo:()=>$u,getLocale:()=>bl,isDateFormat:()=>Yu,isPercentFormat:()=>Xu,isTextFormat:()=>Zu,isValidFormat:()=>Qu,parseBool:()=>lu,parseDate:()=>ou,parseLocale:()=>vl,parseNumber:()=>eu,parseTime:()=>cu,parseValue:()=>uu,round:()=>Nl,tokenTypes:()=>td,tokenize:()=>Bu});let Gu=Object.create({});function Ku(e,t=!1){e||(e=`General`);let n=Gu[e];if(!n)try{n=Uu(e),Gu[e]=n}catch(r){if(t)throw r;let i={tokens:[{type:`error`}],error:r.message};n={pattern:e,partitions:[i,i,i,i],error:r.message,locale:null}}return n}function qu(e,t,n={}){var r;let i=Object.assign({},Ml,n),a=Ku(e,i.throws);return Au((r=Hl(t,i))==null?t:r,a,i)}function Ju(e,t,n){var r;let i=Object.assign({},Ml,n),a=Ku(e,i.throws);return ku((r=Hl(t,i))==null?t:r,a,i)}function Yu(e){return Mu(Ku(e,!1).partitions)}function Xu(e){return ju(Ku(e,!1).partitions)}function Zu(e){return Nu(Ku(e,!1).partitions)}function Qu(e){try{return Ku(e,!0),!0}catch{return!1}}function $u(e,t={}){let n=Ku(e,!1);return n.info||(n.info=Iu(n.partitions,t==null?void 0:t.currency)),n.info}function ed(e){let t=Ku(e,!1);return t.dateInfo||(t.dateInfo=Lu(t.partitions)),t.dateInfo}let td=Object.freeze({AMPM:il,BREAK:Bc,CALENDAR:Jc,CHAR:ul,COLOR:nl,COMMA:zc,CONDITION:Qc,DATETIME:Xc,DBNUM:$c,DIGIT:qc,DURATION:Zc,ERROR:Yc,ESCAPED:al,EXP:`exp`,FILL:cl,GENERAL:Mc,GROUP:Lc,HASH:Nc,LOCALE:tl,MINUS:Uc,MODIFIER:rl,NATNUM:el,PAREN:ll,PERCENT:Kc,PLUS:Hc,POINT:Wc,QMARK:Fc,SCALE:Rc,SKIP:sl,SLASH:Ic,SPACE:Gc,STRING:ol,TEXT:Vc,ZERO:Pc});function nd(e){return e===`@@@`||e===`@`}function rd(e){return e==null||e===`General`}let id=(e,t)=>{if(e&&!t||!e&&t)return!1;let n=e=>{let t=Bu(e),n=``,r=!1,i=!1;for(let e of t){if(e.type===td.POINT){r=!0;continue}if(!(i&&e.type===td.MINUS)&&e.type!==td.SKIP){if(e.type===td.COLOR){i=!0;continue}else i=!1;r&&e.type===td.ZERO||(r=!1,r||(n+=e.value||``))}}return n};return n(e)===n(t)},ad=new Set([`m d`]),od=new Set([`h:mm AM/PM`,`hh:mm AM/PM`]),sd=new Set([`$`,`¥`,`₽`,`₫`,`NT$`,`€`,`₩`,`﷼`]),cd=e=>{var t,n;let r=(t=(n=ou(e))==null?cu(e):n)==null?eu(e):t;if(!r)return null;let{z:i}=r;if(i){if(ad.has(i)||od.has(i)&&!/\s(A|AM|P|PM)$/i.test(e))return null;if(i.includes(`#,##0`)){if(/[.,]$/.test(e))return null;let t=e.replace(RegExp(`^[${[...sd].join(``)}]+`),``).trim();if(t.includes(`,`)&&!/^-?\d{1,3}(,\d{3})*(\.\d+)?$/.test(t))return null}}return r};function ld(e,t){let n={};for(let r in e){let i=Number(r),a=e[i];for(let e in a){let r=Number(e),o=a[r],s=t(i,r,o);s!==void 0&&(n[i]?n[i][r]=s:n[i]={[r]:s})}}return n}function ud(e){let t=0,n=Object.keys(e);for(let e of n){let n=Number(e);t=Math.max(t,n)}return t+1}let dd=e=>e==null||typeof e==`object`&&Object.keys(e).length===0;function fd(e,t,n){let r=ud(n),i=n;for(let t=r-1;t>=e;t--)dd(i[t])?delete i[t+1]:i[t+1]=i[t];dd(t)||(i[e]=t)}function pd(e,t,n){let r=Object.keys(n).reduce((e,t)=>Math.max(e,Number.parseInt(t)),0)+1;for(let i=e;i<r;i++)i<e+t?delete n[i]:n[i]!==void 0&&(n[i-t]=n[i],delete n[i])}function md(e,t){let n=e,r=Object.keys(n),i=r.length,a=t,o=Object.keys(a),s=o.length,c={},l=0;for(let e=0;e<i;e++,l++)c[l]=n[r[e]];for(let e=0;e<s;e++,l++)c[l]=a[o[e]];return c}function hd(e,t,n){let r=n;if(ud(n)>0){let n={},i=0;for(let a=e;a<=t;a++)r[a]&&(n[i]=r[a],i++);return n}return{}}function gd(e,t,n,r){let i=e>n;if(!i&&e+t>n)throw Error(`Invalid move operation`);i?_d(e,t,n,r):vd(e,t,n,r)}function _d(e,t,n,r){let i=r,a=[];for(let n=e;n<e+t;n++)a.push(i[n]);for(let r=e-1;r>=n;r--){let e=i[r];i[r+t]=e,e===void 0&&delete i[r+t]}a.forEach((e,t)=>{i[n+t]=e,e===void 0&&delete i[n+t]})}function vd(e,t,n,r){let i=r,a=[];for(let n=e;n<e+t;n++)a.push(i[n]);for(let r=e+t;r<n;r++){let e=i[r];i[r-t]=e,e===void 0&&delete i[r-t]}a.forEach((e,r)=>{i[n+r-t]=e,e===void 0&&delete i[n+r-t]})}var yd=class e{constructor(e={}){P(this,`_matrix`,void 0),this._setOriginValue(e)}static MakeObjectMatrixSize(t){return new e({[t-1]:{}})}getMatrix(){return this._matrix}forEach(e){let t=this._matrix,n=Object.keys(t);for(let r of n){let n=Number(r),i=t[n];if(e(n,i)===!1)return this}return this}forRow(e){let t=this._matrix,n=Object.keys(t);for(let r of n){let n=Number(r),i=t[n];if(e(n,Object.keys(i).map(e=>Number(e)))===!1)return this}return this}forValue(e){let t=this._matrix;for(let n in t){let r=Number(n),i=t[r];if(i)for(let t in i){let n=Number(t),a=i[n];if(e(r,n,a)===!1)return this}}return this}swapRow(e,t){let n=this._matrix[e],r=this._matrix[t];this._matrix[e]=r,this._matrix[t]=n}getRow(e){return this._matrix[e]}getRowOrCreate(e){let t=this.getRow(e);return t==null&&(t={},this._matrix[e]=t),t}reset(){this._setOriginValue({})}hasValue(){let e=this._matrix,t=Object.keys(e);if(t.length===0)return!1;for(let n of t){let t=e[Number(n)];if(Object.keys(t).length>0)return!0}return!1}getValue(e,t){var n;return(n=this._matrix)==null||(n=n[e])==null?void 0:n[t]}setValue(e,t,n){let r=this.getRowOrCreate(e);r[t]=n}deleteValue(e,t){var n;(n=this._matrix)==null||(n=n[e])==null||delete n[t]}realDeleteValue(e,t){var n;if((n=this._matrix)==null||(n=n[e])==null||delete n[t],this.getRow(e)){let t=this.getRow(e);if(t==null)return;if(Object.keys(t).length===0){var r;(r=this._matrix)==null||delete r[e]}}}setRow(e,t){this._matrix[e]=t}moveRows(e,t,n){gd(e,t,n,this._matrix)}moveColumns(e,t,n){this.forEach((r,i)=>{gd(e,t,n,i)})}insertRows(e,t){let n=Object.keys(this._matrix);for(let r=n.length-1;r>=0;r--){let i=Number(n[r]);if(i>=e){let e=this._matrix[i];delete this._matrix[i],this._matrix[i+t]=e}}}insertColumns(e,t){let n=Object.keys(this._matrix);for(let r=0;r<n.length;r++){let i=Number(n[r]),a=this._matrix[i],o=Object.keys(a);for(let n=o.length-1;n>=0;n--){let r=Number(o[n]);if(r>=e){let e=a[r];delete a[r],a[r+t]=e}}}}removeRows(e,t){pd(e,t,this._matrix)}removeColumns(e,t){this.forEach((n,r)=>{r&&pd(e,t,r)})}getFragment(t,n,r,i){let a=new e,o=0;for(let e=t;e<=n;e++){let t={},n=0;for(let a=r;a<=i;a++)t[n]=this.getValue(e,a),n++;a.setRow(o,t),o++}return a}getSlice(t,n,r,i){let a=new e;for(let e=t;e<=n;e++)for(let t=r;t<=i;t++){let n=this.getValue(e,t);n&&a.setValue(e,t,R.deepClone(n))}return a}getSliceDataAndCellCountByRows(t,n){let r=new e,i=0;for(let e=t;e<=n;e++){let t=this.getRow(e);t&&(r.setRow(e,t),i+=Object.keys(t).length)}return{sliceData:r,cellCount:i}}getSizeOf(){return Object.keys(this._matrix).length}getLength(){return ud(this._matrix)}getRange(){let e=this.getLength()-1,t=0,n=this.getLength();for(let e=0;e<n;e++){let n=this.getRow(e);if(n){let e=ud(n)-1;t=e>t?e:t}}return{startRow:0,startColumn:0,endRow:e,endColumn:t}}getRealRange(){let e=Object.keys(this._matrix),t=e.length,n=t>0?Number(e[0]):0,r=t>0?Number(e[t-1]):0,i=-1/0,a=0;for(let t of e){let e=this.getRow(Number(t));if(e){let t=Object.keys(e);if(t.length>0){let e=Number(t[0]),n=Number(t[t.length-1]);(i===-1/0||e<i)&&(i=e),n>a&&(a=n)}}}return i===-1/0&&(i=0),{startRow:n,endRow:r,startColumn:i,endColumn:a}}getRealRowRange(){let e=Object.keys(this._matrix),t=e.length;return{startRow:t>0?Number(e[0]):0,endRow:t>0?Number(e[t-1]):0}}toNativeArray(){let e=[];return this.forValue((t,n,r)=>{e.push(r)}),e}toArray(){let e=[];return this.forRow((t,n)=>{e[t]==null&&(e[t]=[]),n.forEach(n=>{e[t][n]=this.getValue(t,n)})}),e}toFullArray(){let{endColumn:e,endRow:t}=this.getRange(),n=[];for(let r=0;r<=t;r++){let t=Array(e+1).fill(void 0);n.push(t)}return this.forValue((e,t,r)=>{n[e][t]=r}),n}toJSON(){return this._matrix}clone(){let e=JSON.stringify(this._matrix);return JSON.parse(e)}getData(){let e=JSON.stringify(this._matrix);return JSON.parse(e)}getArrayData(){let t=0,n=0,r=!1,i=!1,a=new e;return this.forEach((e,o)=>{r||(r=!0,t=e),Object.keys(o).forEach(r=>{let o=Number(r);i?o<n&&(n=o):(i=!0,n=o);let s=this.getValue(e,o);a.setValue(e-t,o-n,s)})}),a.getData()}getStartEndScope(){let e=1/0,t=-1/0,n=1/0,r=-1/0,i=Object.keys(this._matrix);i.length>0&&(e=+i[0],t=+i[i.length-1]);for(let e of i){let t=Object.keys(this._matrix[e]);t.length>0&&(n=Math.min(n,+t[0]),r=Math.max(r,+t[t.length-1]))}return{startRow:e,endRow:t,startColumn:n,endColumn:r}}getDataRange(){let e=0,t=0,n=0,r=-1,i=!1,a=!1;return this.forEach((o,s)=>{if(i||(i=!0,e=o),s==null)return;let c=ud(s)-1;c>n&&(n=c),Object.keys(s).forEach(e=>{let n=Number(e);a?n<t&&(t=n):(a=!0,t=n)}),o>r&&(r=o)}),{startRow:e,startColumn:t,endRow:r,endColumn:n}}getDiscreteRanges(){let e=[];return this.forEach((t,n)=>{Object.keys(n).forEach(n=>{let r=Number(n),i=!1;for(let n of e)if(t>=n.startRow&&t<=n.endRow+1&&r>=n.startColumn&&r<=n.endColumn+1){n.endRow=Math.max(t,n.endRow),n.endColumn=Math.max(r,n.endColumn),i=!0;break}i||e.push({startRow:t,endRow:t,startColumn:r,endColumn:r})})}),e}merge(e){this.forValue((t,n)=>{let r=e.getValue(t,n);r!=null&&this.setValue(t,n,r)})}concatRows(e){let t=e.getMatrix();for(let e in t){let n=Number(e);this.setRow(n,t[n])}}_setOriginValue(e={}){this._matrix=e}};function bd(e){let{actualRow:t,actualColumn:n,isMerged:r,isMergedMainCell:i,mergeInfo:a}=e,{startY:o,endY:s,startX:c,endX:l}=e,u=t,d=n,f=t,p=n;if(r&&a){let{startRow:e,startColumn:t,endRow:n,endColumn:r,startY:i,endY:m,startX:h,endX:g}=a;u=e,d=t,f=n,p=r,o=i,s=m,c=h,l=g}return i&&(o=a.startY,s=a.endY,c=a.startX,l=a.endX,f=a.endRow,p=a.endColumn),{startRow:u,startColumn:d,endRow:f,endColumn:p,startY:o,endY:s,startX:c,endX:l}}let xd=bd;function Sd(e){if(!e)return;let{actualRow:t,actualColumn:n,isMerged:r,isMergedMainCell:i,startRow:a,startColumn:o,endRow:s,endColumn:c}=e,l=t,u=n,d=t,f=n;return(r||i)&&(l=a,u=o,d=s,f=c),{startRow:l,startColumn:u,endRow:d,endColumn:f}}function Cd(e){var t;return!e||((e==null||(t=e.v)==null?void 0:t.toString())||``).length===0&&!e.p}function wd(e){return Cd(e)&&(e==null?void 0:e.coverable)!==!1}function Td(e){if(e){if(e.rgb)return new ic(e.rgb).toHexString();if(e.th!=null){var t;let n=(t=jc[Ao.OFFICE])==null?void 0:t[e.th];if(n)return new ic(n).toRgbString()}}return null}function Ed(e){return R.isString(e)&&e.substring(0,1)===`=`&&e.length>1}function Dd(e){return R.isString(e)&&e.length>0}function Od(e,t=!1){let n=``,r=new Map([[`ff`,()=>{e.ff&&(n+=`font-family: ${e.ff}; `)}],[`fs`,()=>{if(e.fs){let t=e.fs;e.va&&(t/=2),n+=`font-size: ${t}pt; `}}],[`it`,()=>{e.it&&(n+=`font-style: italic; `)}],[`bl`,()=>{e.bl&&(n+=`font-weight: bold; `)}],[`ul`,()=>{var t;(t=e.ul)!=null&&t.s&&(n.indexOf(`text-decoration-line`)>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(e,t)=>`${t} underline`):n+=`text-decoration: underline; `,e.ul.cl&&n.indexOf(`text-decoration-color`)===-1&&(n+=`text-decoration-color: ${Td(e.ul.cl)}; `),e.ul.t&&n.indexOf(`text-decoration-style`)===-1&&(n+=`text-decoration-style: ${e.ul.t} `))}],[`st`,()=>{var t;(t=e.st)!=null&&t.s&&(n.indexOf(`text-decoration-line`)>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(e,t)=>`${t} line-through`):n+=`text-decoration-line: line-through; `,e.st.cl&&n.indexOf(`text-decoration-color`)===-1&&(n+=`text-decoration-color: ${Td(e.st.cl)}; `),e.st.t&&n.indexOf(`text-decoration-style`)===-1&&(n+=`text-decoration-style: ${e.st.t} `))}],[`ol`,()=>{var t;(t=e.ol)!=null&&t.s&&(n.indexOf(`text-decoration-line`)>-1?n=n.replace(/(text-decoration-line:\s*[^;]+)(?=;)/g,(e,t)=>`${t} overline`):n+=`text-decoration-line: overline; `,e.ol.cl&&n.indexOf(`text-decoration-color`)===-1&&(n+=`text-decoration-color: ${Td(e.ol.cl)}; `),e.ol.t&&n.indexOf(`text-decoration-style`)===-1&&(n+=`text-decoration-style: ${e.ol.t} `))}],[`bg`,()=>{e.bg&&(n+=`background: ${Td(e.bg)}; `)}],[`bd`,()=>{var t,r,i,a;if((t=e.bd)!=null&&t.b){var o,s;n+=`border-bottom: ${kd((o=e.bd)==null?void 0:o.b.s)} ${(s=Td(e.bd.b.cl))==null?``:s}; `}if((r=e.bd)!=null&&r.t){var c,l;n+=`border-top: ${kd((c=e.bd)==null?void 0:c.t.s)} ${(l=Td(e.bd.t.cl))==null?``:l}; `}if((i=e.bd)!=null&&i.r){var u,d;n+=`border-right: ${kd((u=e.bd)==null?void 0:u.r.s)} ${(d=Td(e.bd.r.cl))==null?``:d}; `}if((a=e.bd)!=null&&a.l){var f,p;n+=`border-left: ${kd((f=e.bd)==null?void 0:f.l.s)} ${(p=Td(e.bd.l.cl))==null?``:p}; `}}],[`cl`,()=>{e.cl&&(n+=`color: ${Td(e.cl)}; `)}],[`va`,()=>{e.va===Do.SUBSCRIPT?n+=`vertical-align: sub; `:e.va===Do.SUPERSCRIPT&&(n+=`vertical-align: super; `)}],[`td`,()=>{e.td===bo.LEFT_TO_RIGHT?n+=`direction: ltr; `:e.td===bo.RIGHT_TO_LEFT&&(n+=`direction: rtl; `)}],[`tr`,()=>{if(e.tr){var t,r,i;n+=`--data-rotate: (${(t=e.tr)==null?void 0:t.a}deg${(r=e.tr)!=null&&r.v?` ,${(i=e.tr)==null?void 0:i.v}`:``});`}}],[`ht`,()=>{e.ht===So.LEFT?n+=`text-align: left; `:e.ht===So.RIGHT?n+=`text-align: right; `:e.ht===So.CENTER?n+=`text-align: center; `:e.ht===So.JUSTIFIED&&(n+=`text-align: justify; `)}],[`vt`,()=>{e.vt===Co.BOTTOM?n+=`vertical-align: bottom; `:e.vt===Co.TOP?n+=`vertical-align: top; `:e.vt===Co.MIDDLE&&(n+=`vertical-align: middle; `)}],[`tb`,()=>{e.tb===wo.CLIP?n+=`white-space: nowrap; overflow-x: hidden; `:e.tb===wo.WRAP&&(n+=`white-space: normal;`)}],[`pd`,()=>{var t,r,i,a,o,s,c,l;let u=`${(t=e.pd)==null?void 0:t.b}pt`,d=`${(r=e.pd)==null?void 0:r.t}pt`,f=`${(i=e.pd)==null?void 0:i.l}pt`,p=`${(a=e.pd)==null?void 0:a.r}pt`;(o=e.pd)!=null&&o.b&&(n+=`padding-bottom: ${u}; `),(s=e.pd)!=null&&s.t&&(n+=`padding-top: ${d}; `),(c=e.pd)!=null&&c.l&&(n+=`padding-left: ${f}; `),(l=e.pd)!=null&&l.r&&(n+=`padding-right: ${p}; `)}]]),i=[`bd`,`tr`,`tb`];for(let n in e){var a;t&&i.includes(n)||(a=r.get(n))==null||a()}return n}function kd(e){let t=``;return e===z.NONE?t=`none`:e===z.THIN?t=`0.5pt solid`:e===z.HAIR?t=`0.5pt double`:e===z.DOTTED?t=`0.5pt dotted`:e===z.DASHED||e===z.DASH_DOT?t=`0.5pt dashed`:e===z.DASH_DOT_DOT?t=`0.5pt dotted`:e===z.DOUBLE?t=`0.5pt double`:e===z.MEDIUM?t=`1pt solid`:e===z.MEDIUM_DASHED||e===z.MEDIUM_DASH_DOT?t=`1pt dashed`:e===z.MEDIUM_DASH_DOT_DOT?t=`1pt dotted`:e===z.SLANT_DASH_DOT?t=`0.5pt dashed`:e===z.THICK&&(t=`1.5pt solid`),t}function Ad(e){let t=0;if(e=e.trim(),e===`none`)t=z.NONE;else if(e===`0.5pt solid`)t=z.THIN;else if(e===`0.5pt double`)t=z.HAIR;else if(e===`0.5pt dotted`)t=z.DOTTED;else if(e===`0.5pt dashed`)t=z.DASHED;else if(e===`1pt solid`)t=z.MEDIUM;else if(e===`1pt dashed`)t=z.MEDIUM_DASHED;else if(e===`1pt dotted`)t=z.MEDIUM_DASH_DOT_DOT;else if(e===`1.5pt solid`)t=z.THICK;else if(!e.includes(`none`))t=z.THIN;else return z.NONE;return t}function jd(e,t){let n=e.body;if(t){let{headers:r,footers:i}=e;r!=null&&r[t]?n=r[t].body:i!=null&&i[t]&&(n=i[t].body)}return n}function Md(e,t){let{startRow:n,endRow:r,startColumn:i,endColumn:a,rangeType:o}=e;if(n<0||i<0||r<0||a<0||!(Number.isNaN(n)&&Number.isNaN(r))&&o===G.COLUMN||!(Number.isNaN(i)&&Number.isNaN(a))&&o===G.ROW||o!==G.ROW&&o!==G.COLUMN&&(Number.isNaN(i)||Number.isNaN(n)||Number.isNaN(a)||Number.isNaN(r)))return!1;if(t){let e=t.getRowCount(),n=t.getColumnCount();if(r>=e||a>=n)return!1}return!0}function Nd(e,t){return{startRow:e,endRow:e,startColumn:t,endColumn:t}}function Pd(e){if(Ed(e))return{f:e,v:null,p:null};if(Tc(e)){if(typeof e==`string`){let t=cd(e);if(t&&t.z)return{v:t.v,p:null,f:null,s:{n:{pattern:t.z||`General`}}}}return{v:e,p:null,f:null}}return Sc(e),e}function Fd(e,t){let n=new yd,{startRow:r,startColumn:i,endRow:a,endColumn:o}=t;if(R.isArray(e))for(let t=0;t<=a-r;t++)for(let a=0;a<=o-i;a++)n.setValue(t+r,a+i,Pd(e[t][a]));else new yd(e).forValue((e,t,r)=>{n.setValue(e,t,Pd(r))});return n.getMatrix()}function Id(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?Object.keys(e).every(n=>Id(e[n],t[n])):!1:e===t:!1}function Ld(e,t){let n=e.ts||{},r=t.ts||{};return e.sId===t.sId?Id(n,r):!1}function Rd(e,t){return t.some(t=>e.indexOf(t)>-1)}var zd=d(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){"use strict";var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|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,g={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(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||(e(t,E,w),e.$i=!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),Bd=d(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_advancedFormat=r()})(e,(function(){"use strict";return function(e,t){var n=t.prototype,r=n.format;n.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return r.bind(this)(e);var i=this.$utils(),a=(e||`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(e){switch(e){case`Q`:return Math.ceil((t.$M+1)/3);case`Do`:return n.ordinal(t.$D);case`gggg`:return t.weekYear();case`GGGG`:return t.isoWeekYear();case`wo`:return n.ordinal(t.week(),`W`);case`w`:case`ww`:return i.s(t.week(),e===`w`?1:2,`0`);case`W`:case`WW`:return i.s(t.isoWeek(),e===`W`?1:2,`0`);case`k`:case`kk`:return i.s(String(t.$H===0?24:t.$H),e===`k`?1:2,`0`);case`X`:return Math.floor(t.$d.getTime()/1e3);case`x`:return t.$d.getTime();case`z`:return`[`+t.offsetName()+`]`;case`zzz`:return`[`+t.offsetName(`long`)+`]`;default:return e}}));return r.bind(this)(a)}}}))})),Vd=d(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_customParseFormat=r()})(e,(function(){"use strict";var e={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`},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},c=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e||e===`Z`)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return n===0?0:t[0]===`+`?-n:n}(e)}],u=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?`pm`:`PM`);return n},f={A:[a,function(e){this.afternoon=d(e,!1)}],a:[a,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*e}],SS:[r,function(e){this.milliseconds=10*e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,c(`seconds`)],ss:[i,c(`seconds`)],m:[i,c(`minutes`)],mm:[i,c(`minutes`)],H:[i,c(`hours`)],h:[i,c(`hours`)],HH:[i,c(`hours`)],hh:[i,c(`hours`)],D:[i,c(`day`)],DD:[r,c(`day`)],Do:[a,function(e){var t=o.ordinal;if(this.day=e.match(/\d+/)[0],t)for(var n=1;n<=31;n+=1)t(n).replace(/\[|\]/g,``)===e&&(this.day=n)}],w:[i,c(`week`)],ww:[r,c(`week`)],M:[i,c(`month`)],MM:[r,c(`month`)],MMM:[a,function(e){var t=u(`months`),n=(u(`monthsShort`)||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw Error();this.month=n%12||n}],MMMM:[a,function(e){var t=u(`months`).indexOf(e)+1;if(t<1)throw Error();this.month=t%12||t}],Y:[/[+-]?\d+/,c(`year`)],YY:[r,function(e){this.year=s(e)}],YYYY:[/\d{4}/,c(`year`)],Z:l,ZZ:l};function p(n){for(var r=n,i=o&&o.formats,a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var a=r&&r.toUpperCase();return n||i[r]||e[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=a.length,c=0;c<s;c+=1){var l=a[c],u=f[l],d=u&&u[0],p=u&&u[1];a[c]=p?{regex:d,parser:p}:l.replace(/^\[|\]$/g,``)}return function(e){for(var t={},n=0,r=0;n<s;n+=1){var i=a[n];if(typeof i==`string`)r+=i.length;else{var o=i.regex,c=i.parser,l=e.slice(r),u=o.exec(l)[0];c.call(t,u),e=e.replace(u,``)}}return function(e){var t=e.afternoon;if(t!==void 0){var n=e.hours;t?n<12&&(e.hours+=12):n===12&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,a=e.args;this.$u=r;var s=a[1];if(typeof s==`string`){var c=!0===a[2],l=!0===a[3],u=c||l,d=a[2];l&&(d=a[2]),o=this.$locale(),!c&&d&&(o=n.Ls[d]),this.$d=function(e,t,n,r){try{if([`x`,`X`].indexOf(t)>-1)return new Date((t===`X`?1e3:1)*e);var i=p(t)(e),a=i.year,o=i.month,s=i.day,c=i.hours,l=i.minutes,u=i.seconds,d=i.milliseconds,f=i.zone,m=i.week,h=new Date,g=s||(a||o?1:h.getDate()),_=a||h.getFullYear(),v=0;a&&!o||(v=o>0?o-1:h.getMonth());var y,b=c||0,x=l||0,S=u||0,C=d||0;return f?new Date(Date.UTC(_,v,g,b,x,S,C+60*f.offset*1e3)):n?new Date(Date.UTC(_,v,g,b,x,S,C)):(y=new Date(_,v,g,b,x,S,C),m&&(y=r(y).week(m).toDate()),y)}catch{return new Date(``)}}(t,s,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(s)&&(this.$d=new Date(``)),o={}}else if(s instanceof Array)for(var f=s.length,m=1;m<=f;m+=1){a[1]=s[m-1];var h=n.apply(this,a);if(h.isValid()){this.$d=h.$d,this.$L=h.$L,this.init();break}m===f&&(this.$d=new Date(``))}else i.call(this,e)}}}))})),Hd=d(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_localeData=r()})(e,(function(){"use strict";return function(e,t,n){var r=t.prototype,i=function(e){return e&&(e.indexOf?e:e.s)},a=function(e,t,n,r,a){var o=e.name?e:e.$locale(),s=i(o[t]),c=i(o[n]),l=s||c.map((function(e){return e.slice(0,r)}));if(!a)return l;var u=o.weekStart;return l.map((function(e,t){return l[(t+(u||0))%7]}))},o=function(){return n.Ls[n.locale()]},s=function(e,t){return e.formats[t]||function(e){return e.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}(e.formats[t.toUpperCase()])},c=function(){var e=this;return{months:function(t){return t?t.format(`MMMM`):a(e,`months`)},monthsShort:function(t){return t?t.format(`MMM`):a(e,`monthsShort`,`months`,3)},firstDayOfWeek:function(){return e.$locale().weekStart||0},weekdays:function(t){return t?t.format(`dddd`):a(e,`weekdays`)},weekdaysMin:function(t){return t?t.format(`dd`):a(e,`weekdaysMin`,`weekdays`,2)},weekdaysShort:function(t){return t?t.format(`ddd`):a(e,`weekdaysShort`,`weekdays`,3)},longDateFormat:function(t){return s(e.$locale(),t)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};r.localeData=function(){return c.bind(this)()},n.localeData=function(){var e=o();return{firstDayOfWeek:function(){return e.weekStart||0},weekdays:function(){return n.weekdays()},weekdaysShort:function(){return n.weekdaysShort()},weekdaysMin:function(){return n.weekdaysMin()},months:function(){return n.months()},monthsShort:function(){return n.monthsShort()},longDateFormat:function(t){return s(e,t)},meridiem:e.meridiem,ordinal:e.ordinal}},n.months=function(){return a(o(),`months`)},n.monthsShort=function(){return a(o(),`monthsShort`,`months`,3)},n.weekdays=function(e){return a(o(),`weekdays`,null,null,e)},n.weekdaysShort=function(e){return a(o(),`weekdaysShort`,`weekdays`,3,e)},n.weekdaysMin=function(e){return a(o(),`weekdaysMin`,`weekdays`,2,e)}}}))})),Ud=d(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_localizedFormat=r()})(e,(function(){"use strict";var e={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(t,n,r){var i=n.prototype,a=i.format;r.en.formats=e,i.format=function(t){t===void 0&&(t=`YYYY-MM-DDTHH:mm:ssZ`);var n=this.$locale().formats,r=function(t,n){return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,r,i){var a=i&&i.toUpperCase();return r||n[i]||e[i]||n[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))}(t,n===void 0?{}:n);return a.call(this,r)}}}))})),Wd=d(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_utc=r()})(e,(function(){"use strict";var e=`minute`,t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,i,a){var o=i.prototype;a.utc=function(e){return new i({date:e,utc:!0,args:arguments})},o.utc=function(t){var n=a(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},o.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var s=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var c=o.init;o.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else c.call(this)};var l=o.utcOffset;o.utcOffset=function(r,i){var a=this.$utils().u;if(a(r))return this.$u?0:a(this.$offset)?l.call(this):this.$offset;if(typeof r==`string`&&(r=function(e){e===void 0&&(e=``);var r=e.match(t);if(!r)return null;var i=(``+r[0]).match(n)||[`-`,0,0],a=i[0],o=60*i[1]+ +i[2];return o===0?0:a===`+`?o:-o}(r),r===null))return this;var o=Math.abs(r)<=16?60*r:r;if(o===0)return this.utc(i);var s=this.clone();if(i)return s.$offset=o,s.$u=!1,s;var c=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(s=this.local().add(o+c,e)).$offset=o,s.$x.$localOffset=c,s};var u=o.format;o.format=function(e){var t=e||(this.$u?`YYYY-MM-DDTHH:mm:ss[Z]`:``);return u.call(this,t)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var d=o.toDate;o.toDate=function(e){return e===`s`&&this.$offset?a(this.format(`YYYY-MM-DD HH:mm:ss:SSS`)).toDate():d.call(this)};var f=o.diff;o.diff=function(e,t,n){if(e&&this.$u===e.$u)return f.call(this,e,t,n);var r=this.local(),i=a(e).local();return f.call(r,i,t,n)}}}))})),Gd=d(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_weekday=r()})(e,(function(){"use strict";return function(e,t){t.prototype.weekday=function(e){var t=this.$locale().weekStart||0,n=this.$W,r=(n<t?n+7:n)-t;return this.$utils().u(e)?r:this.subtract(r,`day`).add(e,`day`)}}}))})),Kd=d(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_weekOfYear=r()})(e,(function(){"use strict";var e=`week`,t=`year`;return function(n,r,i){var a=r.prototype;a.week=function(n){if(n===void 0&&(n=null),n!==null)return this.add(7*(n-this.week()),`day`);var r=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var a=i(this).startOf(t).add(1,t).date(r),o=i(this).endOf(e);if(a.isBefore(o))return 1}var s=i(this).startOf(t).date(r).startOf(e).subtract(1,`millisecond`),c=this.diff(s,e,!0);return c<0?i(this).startOf(`week`).week():Math.ceil(c)},a.weeks=function(e){return e===void 0&&(e=null),this.week(e)}}}))})),qd=d(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_weekYear=r()})(e,(function(){"use strict";return function(e,t){t.prototype.weekYear=function(){var e=this.month(),t=this.week(),n=this.year();return t===1&&e===11?n+1:e===0&&t>=52?n-1:n}}}))})),Jd=m(zd()),Yd=m(Bd()),Xd=m(Vd()),Zd=m(Hd()),Qd=m(Ud()),$d=m(Wd()),ef=m(Gd()),tf=m(Kd()),nf=m(qd());Jd.default.extend(Xd.default),Jd.default.extend(Yd.default),Jd.default.extend(ef.default),Jd.default.extend(Zd.default),Jd.default.extend(tf.default),Jd.default.extend(nf.default),Jd.default.extend($d.default),Jd.default.extend(Qd.default);function rf(e,t,n,r){if(e>t)throw Error(`a1 should be less than a2`);if(n>r)throw Error(`b1 should be less than b2`);if(t<n||r<e)return[e,t];if(n<=e&&r>=t)return[];let i=r-n+1;return e<n&&t>r?[e,t-i]:n<=e&&r<t?[r+1-i,t-i]:n>e&&r>=t?[e,n-1]:[e,t]}function af(e){if(e==null)return!1;let t=e.bullet;return(t==null?void 0:t.listId)!=null}function of(e){if(e==null)return!1;let t=e.paragraphStyle;return sf(t)}function sf(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 cf(e,t,n){return e.slice(0,t)+n+e.slice(t)}function lf(e,t,n){return t>n?e:e.slice(0,t)+e.slice(n)}function uf(e){if(e==null||typeof e==`boolean`)return!1;if(typeof e==`number`)return!isNaN(e);if(typeof e==`string`){let t=e.trim();return t===``?!1:!isNaN(Number(t))}return!1}function df(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 ff(e){if(e.length===0)return[];let t=e.slice().sort((e,t)=>(Array.isArray(e)?e[0]:e)-(Array.isArray(t)?t[0]:t)),n=[],r=Array.isArray(t[0])?t[0][0]:t[0],i=r;for(let e=1;e<t.length;e++){let a=t[e],o,s;Array.isArray(a)?(o=a[0],s=a[1]):(o=a,s=a),o<=i+1?i=Math.max(i,s):(n.push([r,i]),r=o,i=s)}return n.push([r,i]),n}function pf(e){if(e.length===0)return[];let t=e.slice().sort((e,t)=>e[0]-t[0]),n=[],[r,i]=t[0];for(let e=1;e<t.length;e++){let[a,o]=t[e];a<=i+1?i=Math.max(i,o):(n.push([r,i]),r=a,i=o)}return n.push([r,i]),n}function mf(...e){let t;return t=e.length===1&&Array.isArray(e[0])?e[0]:e,Bi({},...t)}let hf,gf,_f,vf,X=Symbol(`newer`),yf=Symbol(`older`);hf=Symbol.iterator;var bf=class{constructor(e){P(this,`entry`,void 0),this.entry=e}[hf](){return this}next(){let e=this.entry;return e?(this.entry=e[X],{done:!1,value:e.key}):{done:!0,value:void 0}}};gf=Symbol.iterator;var xf=class{constructor(e){P(this,`entry`,void 0),this.entry=e}[gf](){return this}next(){let e=this.entry;return e?(this.entry=e[X],{done:!1,value:e.value}):{done:!0,value:void 0}}};_f=Symbol.iterator;var Sf=class{constructor(e){P(this,`entry`,void 0),this.entry=e}[_f](){return this}next(){let e=this.entry;return e?(this.entry=e[X],{done:!1,value:[e.key,e.value]}):{done:!0,value:void 0}}},Cf=class{constructor(e,t){P(this,`key`,void 0),P(this,`value`,void 0),P(this,X,void 0),P(this,yf,void 0),this.key=e,this.value=t,this[X]=void 0,this[yf]=void 0}toJSON(){return{key:this.key,value:this.value}}};vf=Symbol.iterator;var wf=class{onShift(e){if(this._onShiftListeners.indexOf(e)===-1)return this._onShiftListeners.push(e),ta(()=>b(this._onShiftListeners,e));throw Error(`[LRUMap]: the listener has been registered!`)}constructor(...e){if(P(this,`_keymap`,void 0),P(this,`size`,0),P(this,`limit`,void 0),P(this,`oldest`,void 0),P(this,`newest`,void 0),P(this,`_onShiftListeners`,[]),Tf.hasLength(e,1)){if(Tf.isNumber(e[0])){let t=e[0];this._initialize(t,void 0);return}if(Tf.isIterable(e[0])){let t=e[0];this._initialize(0,t);return}return}if(Tf.hasLength(e,2)){let t=e[0],n=e[1];this._initialize(t,n)}}_initialize(e,t){this.oldest=void 0,this.newest=void 0,this.size=0,this.limit=e,this._keymap=new Map,t&&(this.assign(t),e<1&&(this.limit=this.size))}_markEntryAsUsed(e){e!==this.newest&&(e[X]&&(e===this.oldest&&(this.oldest=e[X]),e[X][yf]=e[yf]),e[yf]&&(e[yf][X]=e[X]),e[X]=void 0,e[yf]=this.newest,this.newest&&(this.newest[X]=e),this.newest=e)}assign(e){let t,n=this.limit||Number.MAX_VALUE;this._keymap.clear();let r=e[Symbol.iterator]();for(let e=r.next();!e.done;e=r.next()){let r=new Cf(e.value[0],e.value[1]);if(this._keymap.set(r.key,r),t?(t[X]=r,r[yf]=t):this.oldest=r,t=r,n--===0)throw Error(`overflow`)}this.newest=t,this.size=this._keymap.size}set(e,t){let n=this._keymap.get(e);return n?(n.value=t,this._markEntryAsUsed(n),this):(this._keymap.set(e,n=new Cf(e,t)),this.newest?(this.newest[X]=n,n[yf]=this.newest):this.oldest=n,this.newest=n,++this.size,this.size>this.limit&&this.shift(),this)}shift(){let e=this.oldest;if(e)return this.oldest&&this.oldest[X]?(this.oldest=this.oldest[X],this.oldest[yf]=void 0):(this.oldest=void 0,this.newest=void 0),e[X]=e[yf]=void 0,this._keymap.delete(e.key),--this.size,this._onShiftListeners.forEach(t=>t(e)),[e.key,e.value]}get(e){let t=this._keymap.get(e);if(t)return this._markEntryAsUsed(t),t.value}has(e){return this._keymap.has(e)}find(e){let t=this._keymap.get(e);return t?t.value:void 0}delete(e){let t=this._keymap.get(e);if(t)return this._keymap.delete(t.key),t[X]&&t[yf]?(t[yf][X]=t[X],t[X][yf]=t[yf]):t[X]?(t[X][yf]=void 0,this.oldest=t[X]):t[yf]?(t[yf][X]=void 0,this.newest=t[yf]):this.oldest=this.newest=void 0,this.size--,t.value}clear(){this.oldest=void 0,this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new bf(this.oldest)}values(){return new xf(this.oldest)}entries(){return this[Symbol.iterator]()}[vf](){return new Sf(this.oldest)}forEach(e,t){typeof t!=`object`&&(t=this);let n=this.oldest;for(;n;)e.call(t,n.value,n.key,this),n=n[X]}toJSON(){let e=Array(this.size),t=0,n=this.oldest;for(;n;)e[t++]={key:n.key,value:n.value},n=n[X];return e}toString(){let e=``,t=this.oldest;for(;t;)e+=`${String(t.key)}:${t.value}`,t=t[X],t&&(e+=` < `);return e}},Tf=class{static hasLength(e,t){return e.length===t}static getValueType(e){return Object.prototype.toString.apply(e)}static isObject(e){return this.getValueType(e)===`[object Object]`}static isIterable(e){return e[Symbol.iterator]!=null}static isNumber(e){return this.getValueType(e)===`[object Number]`}};function Ef(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r<65||r>90)return-1;t=t*26+(r-64)}return t}let Df=1048576,Of=16384,kf={sheetId:``,range:{startRow:-1,endRow:-1,startColumn:-1,endColumn:-1}},Af={startRow:-1,startColumn:-1,endRow:-1,endColumn:-1},jf={startRow:0,startColumn:0,endRow:0,endColumn:0},Mf={row:0,column:0},Nf={ff:`Arial`,fs:11,it:B.FALSE,bl:B.FALSE,ul:{s:B.FALSE},st:{s:B.FALSE},ol:{s:B.FALSE},tr:{a:0,v:B.FALSE},td:bo.UNSPECIFIED,cl:{rgb:`#000000`},bg:{rgb:`#fff`},ht:So.UNSPECIFIED,vt:Co.UNSPECIFIED,tb:wo.UNSPECIFIED,pd:{t:0,r:0,b:0,l:0},n:null,bd:{b:null,l:null,r:null,t:null}},Pf={id:`default_slide`,title:`defaultSlide`,pageSize:{width:300,height:300}},Ff=[M,ee,N],If={[Go.HEADING_1]:{fs:20,bl:1},[Go.HEADING_2]:{fs:18,bl:1},[Go.HEADING_3]:{fs:16,bl:1},[Go.HEADING_4]:{fs:14,bl:1},[Go.HEADING_5]:{fs:12,bl:1},[Go.NORMAL_TEXT]:null,[Go.TITLE]:{fs:26,bl:1},[Go.SUBTITLE]:{fs:15,cl:{rgb:`#999999`}},[Go.NAMED_STYLE_TYPE_UNSPECIFIED]:null},Lf={[Go.HEADING_1]:{spaceAbove:{v:20},spaceBelow:{v:10}},[Go.HEADING_2]:{spaceAbove:{v:18},spaceBelow:{v:10}},[Go.HEADING_3]:{spaceAbove:{v:16},spaceBelow:{v:10}},[Go.HEADING_4]:{spaceAbove:{v:14},spaceBelow:{v:8}},[Go.HEADING_5]:{spaceAbove:{v:12},spaceBelow:{v:8}},[Go.NORMAL_TEXT]:{spaceAbove:{v:0},spaceBelow:{v:0}},[Go.TITLE]:{spaceAbove:{v:0},spaceBelow:{v:7}},[Go.SUBTITLE]:{spaceAbove:{v:0},spaceBelow:{v:16}},[Go.NAMED_STYLE_TYPE_UNSPECIFIED]:null},Rf=function(e){return e.ARRAY_CONVERTOR=`ARRAY_CONVERTOR`,e.MATRIX_CONVERTOR=`MATRIX_CONVERTOR`,e}({}),zf={[ls.A3]:{width:1123,height:1587},[ls.A4]:{width:794,height:1124},[ls.A5]:{width:559,height:794},[ls.B4]:{width:944,height:1344},[ls.B5]:{width:665,height:944},[ls.Executive]:{width:696,height:1008},[ls.Folio]:{width:816,height:1248},[ls.Legal]:{width:816,height:1344},[ls.Letter]:{width:816,height:1056},[ls.Statement]:{width:528,height:816},[ls.Tabloid]:{width:1056,height:1632}};function Bf(e,t){let{textRuns:n=[]}=t,r=0;for(let t of n){let{ts:n={},st:i,ed:a}=t;if(n[e]==null)return B.FALSE;switch(e){case`bl`:case`it`:if(n[e]===B.FALSE)return B.FALSE;break;case`ul`:case`st`:if(n[e].s===B.FALSE)return B.FALSE;break;default:throw Error(`unknown style key: ${e} in IStyleBase`)}r+=a-i}return t.dataStream.indexOf(`\r
3
+ `)===r?B.TRUE:B.FALSE}var Vf=class e{constructor(e,t,n){this._deps=n,P(this,`_range`,void 0),P(this,`_worksheet`,void 0),this._range=t,this._worksheet=e}static foreach(e,t){let{startRow:n,startColumn:r,endRow:i,endColumn:a}=e;for(let e=n;e<=i;e++)for(let n=r;n<=a;n++)t(e,n)}getRangeData(){return this._range}getValue(){return this.getValues()[0][0]}getValues(){let{startRow:e,endRow:t,startColumn:n,endColumn:r}=this._range,i=[];for(let a=e;a<=t;a++){let e=[];for(let t=n;t<=r;t++)e.push(this.getMatrix().getValue(a,t)||null);i.push(e)}return i}getMatrix(){let{startRow:e,endRow:t,startColumn:n,endColumn:r}=this._range,i=this._worksheet.getCellMatrix(),a=new yd;for(let o=e;o<=t;o++)for(let e=n;e<=r;e++)a.setValue(o,e,i.getValue(o,e)||null);return a}getMatrixObject(){let{startRow:e,endRow:t,startColumn:n,endColumn:r}=this._range,i=this._worksheet.getCellMatrix(),a=new yd;for(let o=e;o<=t;o++)for(let t=n;t<=r;t++)a.setValue(o-e,t-n,i.getValue(o,t)||{});return a}getA1Notation(){let{startRow:e,endRow:t,startColumn:n,endColumn:r}=this._range,i,a;return n<r?(i=R.numToWord(n+1)+(e+1),a=R.numToWord(r+1)+(t+1)):(i=R.numToWord(r+1)+(t+1),a=R.numToWord(n+1)+(e+1)),i===a?`${i}`:`${i}:${a}`}getBackground(){return this.getBackgrounds()[0][0]}getBackgrounds(){let e=this._deps.getStyles();return this.getValues().map(t=>t.map(t=>{var n;let r=e.getStyleByCell(t);return(r==null||(n=r.bg)==null?void 0:n.rgb)||Nf.bg.rgb}))}getCell(t,n){let{startRow:r,startColumn:i}=this._range,a={startRow:r+t,endRow:r+t,startColumn:i+n,endColumn:i+n};return new e(this._worksheet,a,this._deps)}getColumn(){return this._range.startColumn}getObjectValue(e={}){return this.getObjectValues(e)[0][0]}getObjectValues(e={}){let{startRow:t,endRow:n,startColumn:r,endColumn:i}=this._range,a=this._worksheet.getCellMatrix().getFragment(t,n,r,i).getData();if(e.isIncludeStyle){let e=this._deps.getStyles();for(let s=0;s<=n-t;s++)for(let t=0;t<=i-r;t++){var o;if(a==null||(a==null||(o=a[s])==null?void 0:o[t])==null)continue;let n=a[s][t].s;n&&(a[s][t].s=e.get(n))}}return a}getFontColor(){return this.getFontColors()[0][0]}getFontColors(){let e=this._deps.getStyles();return this.getValues().map(t=>t.map(t=>{var n;let r=e.getStyleByCell(t);return(r==null||(n=r.cl)==null?void 0:n.rgb)||Nf.cl.rgb}))}getFontFamilies(){return this._getStyles(`ff`)}getFontFamily(){return this.getFontFamilies()[0][0]}getUnderlines(){return this._getStyles(`ul`)}getUnderline(){var e,t;let{p:n}=(e=this.getValue())==null?{}:e;return n&&Array.isArray((t=n.body)==null?void 0:t.textRuns)&&n.body.textRuns.length>0?Bf(`ul`,n.body)===B.TRUE?{s:B.TRUE}:{s:B.FALSE}:this.getUnderlines()[0][0]}getOverlines(){return this._getStyles(`ol`)}getOverline(){return this.getOverlines()[0][0]}getStrikeThrough(){var e,t;let{p:n}=(e=this.getValue())==null?{}:e;return n&&Array.isArray((t=n.body)==null?void 0:t.textRuns)&&n.body.textRuns.length>0?Bf(`st`,n.body)===B.TRUE?{s:B.TRUE}:{s:B.FALSE}:this.getStrikeThroughs()[0][0]}getStrikeThroughs(){return this._getStyles(`st`)}getFontSize(){var e,t;let n=((e=this.getValue())==null?void 0:e.p)||{};return n&&Array.isArray((t=n.body)==null?void 0:t.textRuns)&&n.body.textRuns.length>0&&n.body.textRuns.some(e=>{var t;return(e==null||(t=e.ts)==null?void 0:t.fs)!=null})?Math.max(...n.body.textRuns.map(e=>{var t;return(e==null||(t=e.ts)==null?void 0:t.fs)||0})):this.getFontSizes()[0][0]}getFontSizes(){return this._getStyles(`fs`)}getBorder(){return this.getBorders()[0][0]}getBorders(){return this._getStyles(`bd`)}getFontStyle(){var e,t;let{p:n}=(e=this.getValue())==null?{}:e;return n&&Array.isArray((t=n.body)==null?void 0:t.textRuns)&&n.body.textRuns.length>0?Bf(`it`,n.body)===B.TRUE?To.ITALIC:To.NORMAL:this._getFontStyles()[0][0]}_getFontStyles(){return this._getStyles(`it`)}getFontWeight(){var e,t;let{p:n}=(e=this.getValue())==null?{}:e;return n&&Array.isArray((t=n.body)==null?void 0:t.textRuns)&&n.body.textRuns.length>0?Bf(`bl`,n.body)===B.TRUE?Eo.BOLD:Eo.NORMAL:this._getFontWeights()[0][0]}_getFontWeights(){return this._getStyles(`bl`)}getGridId(){return this._worksheet.getSheetId()}getHeight(){let{_range:e,_worksheet:t}=this,{startRow:n,endRow:r}=e,i=0;for(let e=0;e<=r-n;e++){let n=t.getRowHeight(e);i+=n}return i}getHorizontalAlignment(){return this.getHorizontalAlignments()[0][0]}getHorizontalAlignments(){return this._getStyles(`ht`)}getLastColumn(){return this._range.endColumn}getLastRow(){return this._range.endRow}getNumColumns(){let{startColumn:e,endColumn:t}=this._range;return t-e+1}getNumRows(){let{startRow:e,endRow:t}=this._range;return t-e+1}getRichTextValue(){return this.getRichTextValues()[0][0]}getRichTextValues(){return this.getValues().map(e=>e.map(e=>(e==null?void 0:e.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(){let e=this._deps.getStyles();return this.getValues().map(t=>t.map(t=>e.getStyleByCell(t)))}getVerticalAlignment(){return this.getVerticalAlignments()[0][0]}getVerticalAlignments(){return this._getStyles(`vt`)}getWidth(){let{_range:e,_worksheet:t}=this,{startColumn:n,endColumn:r}=e,i=0;for(let e=0;e<=r-n;e++)i+=t.getColumnWidth(e);return i}getWrap(){return this.getWrapStrategy()===wo.WRAP?B.TRUE:B.FALSE}getWrapStrategies(){return this._getStyles(`tb`)}getWrapStrategy(){return this.getWrapStrategies()[0][0]}forEach(t){e.foreach(this._range,t)}_getStyles(e){let t=this._deps.getStyles();return this.getValues().map(n=>n.map(n=>{let r=t&&t.getStyleByCell(n);return r&&r[e]||Nf[e]}))}};P(Vf,`transformRange`,(e,t)=>{let n=t.getMaxColumns()-1,r=t.getMaxRows()-1;return e.rangeType===G.ALL?{startColumn:0,startRow:0,endColumn:n,endRow:r}:e.rangeType===G.COLUMN?{startRow:0,endRow:r,startColumn:e.startColumn,endColumn:e.endColumn}:e.rangeType===G.ROW?{startColumn:0,endColumn:n,startRow:e.startRow,endRow:e.endRow}:{startColumn:e.startColumn,endColumn:Math.min(e.endColumn,n),startRow:e.startRow,endRow:Math.min(e.endRow,r)}});function Hf(e,t,n=0,r=e.length-1,i=Wf){for(;r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1);Hf(e,t,Math.max(n,Math.floor(t-o*c/a+l)),Math.min(r,Math.floor(t+(a-o)*c/a+l)),i)}let a=e[t],o=n,s=r;for(Uf(e,n,t),i(e[r],a)>0&&Uf(e,n,r);o<s;){for(Uf(e,o,s),o++,s--;i(e[o],a)<0;)o++;for(;i(e[s],a)>0;)s--}i(e[n],a)===0?Uf(e,n,s):(s++,Uf(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}}function Uf(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function Wf(e,t){return e<t?-1:e>t?1:0}var Gf=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data,n=[];if(!rp(e,t))return n;let r=this.toBBox,i=[];for(;t;){for(let a=0;a<t.children.length;a++){let o=t.children[a],s=t.leaf?r(o):o;rp(e,s)&&(t.leaf?n.push(o):np(e,s)?this._all(o,n):i.push(o))}t=i.pop()}return n}collides(e){let t=this.data;if(!rp(e,t))return!1;let n=[];for(;t;){for(let r=0;r<t.children.length;r++){let i=t.children[r],a=t.leaf?this.toBBox(i):i;if(rp(e,a)){if(t.leaf||np(e,a))return!0;n.push(i)}}t=n.pop()}return!1}load(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(let t=0;t<e.length;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(!this.data.children.length)this.data=t;else if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){let e=this.data;this.data=t,t=e}this._insert(t,this.data.height-t.height-1,!0)}return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=ip([]),this}remove(e,t){if(!e)return this;let n=this.data,r=this.toBBox(e),i=[],a=[],o,s,c;for(;n||i.length;){if(n||(n=i.pop(),s=i[i.length-1],o=a.pop(),c=!0),n.leaf){let r=Kf(e,n.children,t);if(r!==-1)return n.children.splice(r,1),i.push(n),this._condense(i),this}!c&&!n.leaf&&np(n,r)?(i.push(n),a.push(o),o=0,s=n,n=n.children[0]):s?(o++,n=s.children[o],c=!1):n=null}return this}toBBox(e){return e}compareMinX(e,t){return e.minX-t.minX}compareMinY(e,t){return e.minY-t.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){let n=[];for(;e;)e.leaf?t.push(...e.children):n.push(...e.children),e=n.pop();return t}_build(e,t,n,r){let i=n-t+1,a=this._maxEntries,o;if(i<=a)return o=ip(e.slice(t,n+1)),qf(o,this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/a**(r-1))),o=ip([]),o.leaf=!1,o.height=r;let s=Math.ceil(i/a),c=s*Math.ceil(Math.sqrt(a));ap(e,t,n,c,this.compareMinX);for(let i=t;i<=n;i+=c){let t=Math.min(i+c-1,n);ap(e,i,t,s,this.compareMinY);for(let n=i;n<=t;n+=s){let i=Math.min(n+s-1,t);o.children.push(this._build(e,n,i,r-1))}}return qf(o,this.toBBox),o}_chooseSubtree(e,t,n,r){for(;r.push(t),!(t.leaf||r.length-1===n);){let n=1/0,r=1/0,i;for(let a=0;a<t.children.length;a++){let o=t.children[a],s=Qf(o),c=ep(e,o)-s;c<r?(r=c,n=s<n?s:n,i=o):c===r&&s<n&&(n=s,i=o)}t=i||t.children[0]}return t}_insert(e,t,n){let r=n?e:this.toBBox(e),i=[],a=this._chooseSubtree(r,this.data,t,i);for(a.children.push(e),Yf(a,r);t>=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)}_split(e,t){let n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);let a=this._chooseSplitIndex(n,i,r),o=ip(n.children.splice(a,n.children.length-a));o.height=n.height,o.leaf=n.leaf,qf(n,this.toBBox),qf(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(n,o)}_splitRoot(e,t){this.data=ip([e,t]),this.data.height=e.height+1,this.data.leaf=!1,qf(this.data,this.toBBox)}_chooseSplitIndex(e,t,n){let r,i=1/0,a=1/0;for(let o=t;o<=n-t;o++){let t=Jf(e,0,o,this.toBBox),s=Jf(e,o,n,this.toBBox),c=tp(t,s),l=Qf(t)+Qf(s);c<i?(i=c,r=o,a=l<a?l:a):c===i&&l<a&&(a=l,r=o)}return r||n-t}_chooseSplitAxis(e,t,n){let r=e.leaf?this.compareMinX:Xf,i=e.leaf?this.compareMinY:Zf;this._allDistMargin(e,t,n,r)<this._allDistMargin(e,t,n,i)&&e.children.sort(r)}_allDistMargin(e,t,n,r){e.children.sort(r);let i=this.toBBox,a=Jf(e,0,t,i),o=Jf(e,n-t,n,i),s=$f(a)+$f(o);for(let r=t;r<n-t;r++){let t=e.children[r];Yf(a,e.leaf?i(t):t),s+=$f(a)}for(let r=n-t-1;r>=t;r--){let t=e.children[r];Yf(o,e.leaf?i(t):t),s+=$f(o)}return s}_adjustParentBBoxes(e,t,n){for(let r=n;r>=0;r--)Yf(t[r],e)}_condense(e){for(let t=e.length-1,n;t>=0;t--)e[t].children.length===0?t>0?(n=e[t-1].children,n.splice(n.indexOf(e[t]),1)):this.clear():qf(e[t],this.toBBox)}};function Kf(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 qf(e,t){Jf(e,0,e.children.length,t,e)}function Jf(e,t,n,r,i){i||(i=ip(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let a=t;a<n;a++){let t=e.children[a];Yf(i,e.leaf?r(t):t)}return i}function Yf(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 Xf(e,t){return e.minX-t.minX}function Zf(e,t){return e.minY-t.minY}function Qf(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function $f(e){return e.maxX-e.minX+(e.maxY-e.minY)}function ep(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 tp(e,t){let n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),a=Math.min(e.maxY,t.maxY);return Math.max(0,i-n)*Math.max(0,a-r)}function np(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function rp(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function ip(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function ap(e,t,n,r,i){let a=[t,n];for(;a.length;){if(n=a.pop(),t=a.pop(),n-t<=r)continue;let o=t+Math.ceil((n-t)/r/2)*r;Hf(e,o,t,n,i),a.push(t,o,o,n)}}function op(e,t,n,r=!1){if(t===0&&n===0)return e;let i={...e},a=i.startAbsoluteRefType||K.NONE,o=i.endAbsoluteRefType||K.NONE,s=i.rangeType||G.NORMAL;if(!r&&a===K.ALL&&o===K.ALL)return i;let c=sp(i.startRow,n,i.startColumn,t,s),l=sp(i.endRow,n,i.endColumn,t,s);return r||a===K.NONE&&o===K.NONE?i={...i,startRow:c.row,startColumn:c.column,endRow:l.row,endColumn:l.column}:(a===K.NONE?i={...i,startRow:c.row,startColumn:c.column}:a===K.COLUMN?i={...i,startRow:c.row}:a===K.ROW&&(i={...i,startColumn:c.column}),o===K.NONE?i={...i,endRow:l.row,endColumn:l.column}:o===K.COLUMN?i={...i,endRow:l.row}:o===K.ROW&&(i={...i,endColumn:l.column}),i)}function sp(e,t,n,r,i){return i===G.NORMAL?{row:e+t,column:n+r}:i===G.ROW?{row:e+t,column:n}:i===G.COLUMN?{row:e,column:n+r}:{row:e,column:n}}function cp(e){let t=new Set,n=new Set;for(let r of e)t.add(r.startColumn),t.add(r.endColumn+1),n.add(r.startRow),n.add(r.endRow+1);let r=Array.from(t).sort((e,t)=>e-t),i=Array.from(n).sort((e,t)=>e-t);e.sort((e,t)=>e.startRow-t.startRow||e.startColumn-t.startColumn);let a=[];for(let t=0;t<i.length-1;t++)for(let n=0;n<r.length-1;n++){let o=r[n],s=r[n+1]-1,c=i[t],l=i[t+1]-1;for(let t of e){if(t.startRow>l)break;if(t.startRow<=c&&t.endRow>=l&&t.startColumn<=o&&t.endColumn>=s){a.push({startColumn:o,endColumn:s,startRow:c,endRow:l});break}}}return a}function lp(e){e.sort((e,t)=>e.startRow-t.startRow||e.startColumn-t.startColumn);let t={};for(let n of e)t[n.startRow]||(t[n.startRow]=[]),t[n.startRow].push(n);let n=[];for(let e in t){let r=t[+e];r.sort((e,t)=>e.startColumn-t.startColumn);let i=r[0];for(let e=1;e<r.length;e++){let t=r[e];t.startColumn<=i.endColumn+1&&t.startRow===i.startRow&&t.endRow===i.endRow?i.endColumn=Math.max(i.endColumn,t.endColumn):(n.push(i),i=t)}n.push(i)}return n}function up(e){e.sort((e,t)=>e.startColumn-t.startColumn||e.startRow-t.startRow);let t={};for(let n of e)t[n.startColumn]||(t[n.startColumn]=[]),t[n.startColumn].push(n);let n=[];for(let e in t){let r=t[+e];r.sort((e,t)=>e.startRow-t.startRow);let i=r[0];for(let e=1;e<r.length;e++){let t=r[e];t.startRow<=i.endRow+1&&t.startColumn===i.startColumn&&t.endColumn===i.endColumn?i.endRow=Math.max(i.endRow,t.endRow):(n.push(i),i=t)}n.push(i)}return n}function dp(e){return up(lp(cp(e)))}function fp(e,t){let n=[];return e.forEach(e=>{n.push(..._p.subtract(e,t))}),_p.mergeRanges(n)}function pp(e,t){let n=mp(e.startRow,e.endRow,t.startRow,t.endRow),r=mp(e.startColumn,e.endColumn,t.startColumn,t.endColumn);if(!n||!r)return null;let[i,a]=n,[o,s]=r;return{startRow:i,endRow:a,startColumn:o,endColumn:s,rangeType:hp(e.rangeType,t.rangeType,i,a,o,s)}}function mp(e,t,n,r){let i=isNaN(e)?-1/0:e,a=isNaN(t)?1/0:t,o=isNaN(n)?-1/0:n,s=isNaN(r)?1/0:r,c=Math.max(i,o),l=Math.min(a,s);return c<=l?[c===-1/0?NaN:c,l===1/0?NaN:l]:null}function hp(e,t,n,r,i,a){let o=e===void 0?gp(n,r,i,a):e,s=t===void 0?gp(n,r,i,a):t;return o===G.ALL||s===G.ALL?o===s?o:o===G.ALL?s:o:o===s?o:(o===G.NORMAL||G.NORMAL,G.NORMAL)}function gp(e,t,n,r){let i=!isNaN(e)&&!isNaN(t),a=!isNaN(n)&&!isNaN(r);return i&&a?G.NORMAL:i?G.ROW:a?G.COLUMN:G.ALL}var _p=class e{static clone(e){return e.rangeType===void 0?{startRow:e.startRow,startColumn:e.startColumn,endRow:e.endRow,endColumn:e.endColumn}:{startRow:e.startRow,startColumn:e.startColumn,endRow:e.endRow,endColumn:e.endColumn,rangeType:e.rangeType}}static equals(e,t){return e==null||t==null?!1:e.endRow===t.endRow&&e.endColumn===t.endColumn&&e.startRow===t.startRow&&e.startColumn===t.startColumn&&(e.rangeType===t.rangeType||e.rangeType===void 0&&t.rangeType===G.NORMAL||t.rangeType===void 0&&e.rangeType===G.NORMAL)}static simpleRangesIntersect(e,t){let{startRow:n,endRow:r,startColumn:i,endColumn:a}=e,{startRow:o,endRow:s,startColumn:c,endColumn:l}=t;return n<=s&&r>=o&&i<=l&&a>=c}static intersects(e,t){if(e.rangeType===G.ROW&&t.rangeType===G.COLUMN||e.rangeType===G.COLUMN&&t.rangeType===G.ROW)return!0;if(e.rangeType===G.ROW&&t.rangeType===G.ROW)return e.startRow<=t.endRow&&e.endRow>=t.startRow;if(e.rangeType===G.COLUMN&&t.rangeType===G.COLUMN)return e.startColumn<=t.endColumn&&e.endColumn>=t.startColumn;let n=Number.isNaN(e.startRow)?0:e.startRow,r=Number.isNaN(e.endRow)?Df-1:e.endRow,i=Number.isNaN(e.startColumn)?0:e.startColumn,a=Number.isNaN(e.endColumn)?Of-1:e.endColumn,o=Number.isNaN(t.startRow)?0:t.startRow,s=Number.isNaN(t.endRow)?Df-1:t.endRow,c=Number.isNaN(t.startColumn)?0:t.startColumn,l=Number.isNaN(t.endColumn)?Of-1:t.endColumn,u=Math.abs(i+a-c-l),d=Math.abs(i-a)+Math.abs(c-l),f=Math.abs(n+r-o-s),p=Math.abs(n-r)+Math.abs(o-s);return u<=d&&f<=p}static doAnyRangesIntersect(e,t){let n=new Gf;return n.load(e.map(e=>({minX:e.startColumn,minY:e.startRow,maxX:e.endColumn,maxY:e.endRow}))),t.some(e=>n.search({minX:e.startColumn,minY:e.startRow,maxX:e.endColumn,maxY:e.endRow}).length>0)}static getIntersects(e,t){let n=e.startRow,r=e.endRow,i=e.startColumn,a=e.endColumn,o=t.startRow,s=t.endRow,c=t.startColumn,l=t.endColumn,u,d,f,p;if(o<=r)d=o>=n?o:n;else return null;if(s>=n)p=s>=r?r:s;else return null;if(c<=a)u=c>i?c:i;else return null;if(l>=i)f=l>=a?a:l;else return null;return{startRow:d,endRow:p,startColumn:u,endColumn:f,rangeType:G.NORMAL}}static contains(e,t){return e.startRow<=t.startRow&&e.endRow>=t.endRow&&e.startColumn<=t.startColumn&&e.endColumn>=t.endColumn}static realContain(t,n){return e.contains(t,n)&&(t.startRow<n.startRow||t.endRow>n.endRow||t.startColumn<n.startColumn||t.endColumn>n.endColumn)}static union(...e){return e.reduce((e,t)=>({startRow:Math.min(e.startRow,t.startRow),startColumn:Math.min(e.startColumn,t.startColumn),endRow:Math.max(e.endRow,t.endRow),endColumn:Math.max(e.endColumn,t.endColumn),rangeType:G.NORMAL}),e[0])}static realUnion(...t){let n=t.some(e=>e.rangeType===G.COLUMN),r=t.some(e=>e.rangeType===G.ROW),i=e.union(...t);return{startColumn:r?NaN:i.startColumn,endColumn:r?NaN:i.endColumn,startRow:n?NaN:i.startRow,endRow:n?NaN:i.endRow,rangeType:r?G.ROW:n?G.COLUMN:G.NORMAL}}static subtract(e,t){if(t.startRow>e.endRow||t.endRow<e.startRow||t.startColumn>e.endColumn||t.endColumn<e.startColumn)return[e];let n=[];t.startRow>=e.startRow&&n.push({startRow:e.startRow,startColumn:e.startColumn,endRow:t.startRow-1,endColumn:e.endColumn}),t.endRow<=e.endRow&&n.push({startRow:t.endRow+1,startColumn:e.startColumn,endRow:e.endRow,endColumn:e.endColumn});let r=Math.max(e.startRow,t.startRow),i=Math.min(e.endRow,t.endRow);return t.startColumn>=e.startColumn&&n.push({startRow:r,startColumn:e.startColumn,endRow:i,endColumn:t.startColumn-1}),t.endColumn<=e.endColumn&&n.push({startRow:r,startColumn:t.endColumn+1,endRow:i,endColumn:e.endColumn}),n.filter(e=>e.startRow<=e.endRow&&e.startColumn<=e.endColumn)}static mergeRanges(e){return dp(e)}static splitIntoGrid(e){return cp(e)}static subtractMulti(e,t){if(!t.length)return e;let n=e;return t.forEach(e=>{n=fp(n,e)}),n}static hasIntersectionBetweenTwoRect(e,t){return!(e.left>t.right||e.right<t.left||e.top>t.bottom||e.bottom<t.top)}static getIntersectionBetweenTwoRect(e,t){let n=Math.max(e.left,t.left),r=Math.min(e.right,t.right),i=Math.max(e.top,t.top),a=Math.min(e.bottom,t.bottom);return r<=n||a<=i?null:{left:n,right:r,top:i,bottom:a,width:r-n,height:a-i}}static sort(e){return e.sort((e,t)=>e.startRow-t.startRow||e.startColumn-t.startColumn)}};P(_p,`getRelativeRange`,(e,t)=>({startRow:e.startRow-t.startRow,endRow:e.endRow-e.startRow,startColumn:e.startColumn-t.startColumn,endColumn:e.endColumn-e.startColumn})),P(_p,`getPositionRange`,(e,t,n)=>({...n||{},startRow:n&&[K.ROW,K.ALL].includes(n.startAbsoluteRefType||0)?n.startRow:e.startRow+t.startRow,endRow:n&&[K.ROW,K.ALL].includes(n.endAbsoluteRefType||0)?n.endRow:e.endRow+e.startRow+t.startRow,startColumn:n&&[K.COLUMN,K.ALL].includes(n.startAbsoluteRefType||0)?n.startColumn:e.startColumn+t.startColumn,endColumn:n&&[K.COLUMN,K.ALL].includes(n.endAbsoluteRefType||0)?n.endColumn:e.endColumn+e.startColumn+t.startColumn})),P(_p,`moveHorizontal`,(e,t=0,n=0)=>({...e,startColumn:e.startColumn+t,endColumn:e.endColumn+t+n})),P(_p,`moveVertical`,(e,t=0,n=0)=>({...e,startRow:e.startRow+t,endRow:e.endRow+t+n})),P(_p,`moveOffset`,(e,t,n)=>{let r={...e};switch(e.startAbsoluteRefType){case K.ROW:r.startColumn+=t;break;case K.COLUMN:r.startRow+=n;break;case K.ALL:break;case K.NONE:default:r.startRow+=n,r.startColumn+=t;break}switch(e.endAbsoluteRefType){case K.ROW:r.endColumn+=t;break;case K.COLUMN:r.endRow+=n;break;case K.ALL:break;case K.NONE:default:r.endRow+=n,r.endColumn+=t;break}return r});function vp(e,t){if(e.length===0||e[0].length===0)return null;let n=Array(e[0].length).fill(0),r=0,i=null;for(let a=0;a<e.length;a++){for(let r=0;r<e[0].length;r++)n[r]=t(e[a][r])?n[r]+1:0;let o=yp(n);o.area>r&&(r=o.area,i={startColumn:o.start,startRow:a-o.height+1,endColumn:o.end,endRow:a})}return i}function yp(e){let t=[],n=0,r={area:0,height:0,start:0,end:0},i=0;for(;i<e.length;)if(t.length===0||e[i]>=e[t[t.length-1]])t.push(i++);else{let a=e[t.pop()],o=t.length===0?i:i-t[t.length-1]-1;a*o>n&&(n=a*o,r={area:n,height:a,start:t.length===0?0:t[t.length-1]+1,end:i-1})}for(;t.length>0;){let a=e[t.pop()],o=t.length===0?i:i-t[t.length-1]-1;a*o>n&&(n=a*o,r={area:n,height:a,start:t.length===0?0:t[t.length-1]+1,end:i-1})}return r}function bp(e,t){Vf.foreach(t,(t,n)=>{e[t][n]=void 0})}function xp(e,t){let n=e.toFullArray(),r=[];for(;;){let e=vp(n,t);if(!e)break;r.push(e),bp(n,e)}return r}var Sp=class{constructor(e,t){P(this,`_values`,[]),P(this,`_keys`,[]),P(this,`_keyMaps`,new Map),this._values=e,this._keys=t,e.forEach(e=>{this._initKeyMap(e)})}_initKeyMap(e){this._keys.forEach(t=>{let n=e[t],r=this._keyMaps.get(t)||new Map;r.set(n,e),this._keyMaps.set(t,r)})}getValue(e,t){let n=t||this._keys;for(let t=0;t<n.length;t++){let r=this._keyMaps.get(n[t]);if(r!=null&&r.has(e))return r.get(e)}return null}hasValue(e){for(let t=0;t<this._keys.length;t++){let n=this._keyMaps.get(this._keys[t]);if(n!=null&&n.has(e))return!0}return!1}addValue(e){this._values.push(e),this._initKeyMap(e)}setValue(e,t,n){let r=this.getValue(e);r&&Object.keys(r).includes(t)&&(r[t]=n)}deleteValue(e,t){let n=this.getValue(e,t);if(n){this._keys.forEach(e=>{let t=this._keyMaps.get(e),r=n[e];t==null||t.delete(r)});let e=this._values.findIndex(e=>e===n);this._values.splice(e,1)}}getValues(){return this._values}getKeyMap(e){var t;return[...((t=this._keyMaps.get(e))==null?void 0:t.keys())||[]]}clear(){this._values=[],this._keys=[],this._keyMaps.clear()}};function Cp(e,t,n,r){return{forEach(i){for(let a=e;a<=t;a++)for(let e=n;e<=r;e++)i(a,e)}}}function wp(e){if(e==null||e.length===0)return NaN;let t=e.toLowerCase().split(``),n=t.length,r=e=>e.charCodeAt(0)-96,i=0,a=0;for(let e=0;e<n;e++)a=r(t[e]),i+=a*26**(n-e-1);return i===0?NaN:i-1}function Tp(e){let t=``;for(;e>=0;)t=String.fromCharCode(e%26+65)+t,e=Math.floor(e/26)-1;return t}function Ep(e,t){let n=``;for(;t>0;)n+=e,t--;return n}function Dp(e,t=!1){let n=97;return t&&(n=65),Ep(String.fromCharCode(e%26+n),Math.floor(e/26)+1)}function Op(e,t){return e.zIndex>t.zIndex?1:e.zIndex===t.zIndex?0:-1}function kp(e,t){return e.zIndex>t.zIndex?-1:e.zIndex===t.zIndex?0:1}function Ap(e=`index`,t=1){return(n,r)=>n[e]>r[e]?t:n[e]===r[e]?0:-t}function jp(e,t=!1){let n=[];for(let r of e){let{st:e,ed:i,ts:a}=r;if(r.sId===void 0&&delete r.sId,e===i||!t&&R.isEmptyObject(a)&&r.sId==null)continue;if(n.length===0){n.push(r);continue}let o=n.pop();Ld(r,o)&&R.hasIntersectionBetweenTwoRanges(o.st,o.ed,r.st,r.ed)?n.push({...r,st:o.st,ed:i}):n.push(o,r)}return n}function Mp(e,t,n,r){var i;let{textRuns:a}=e;if(a==null)return;let o=[],s=a.length,c=!1,l=(i=t.textRuns)==null?[]:i;if(l.length)for(let e of l)e.st+=r,e.ed+=r;for(let e=0;e<s;e++){let t=a[e],{st:i,ed:s}=t;if(s<=r)o.push(t);else if(r>i&&r<s){c=!0;let e={...t,ed:r};o.push(e),l.length&&o.push(...l);let i={...t,st:r+n,ed:s+n};o.push(i)}else t.st+=n,t.ed+=n,c||(c=!0,o.push(...l)),o.push(t)}c||(c=!0,o.push(...l)),e.textRuns=jp(o)}function Np(e,t,n,r){let{paragraphs:i}=e;if(i==null)return;let{paragraphs:a}=t,o=[],s=-1;for(let e=0,t=i.length;e<t;e++){let t=i[e],{startIndex:a}=t;a>=r&&(t.startIndex+=n),s===-1&&a>=r&&(s=e),o.push(t.startIndex)}let c=-1;if(a){for(let e=0,t=a.length;e<t;e++){let t=a[e];t.startIndex+=r;let n=t.startIndex;c=o.indexOf(n)}c!==-1&&i.splice(c,1),i.push(...a),i.sort(Ap(`startIndex`))}}function Pp(e,t,n,r){let{sectionBreaks:i}=e;if(i==null)return;for(let e=0,t=i.length;e<t;e++){let t=i[e],{startIndex:a}=t;a>=r&&(t.startIndex+=n)}let a=t.sectionBreaks;if(a){for(let e=0,t=a.length;e<t;e++){let t=a[e];t.startIndex+=r}i.push(...a),i.sort(Ap(`startIndex`))}}function Fp(e,t,n,r){let{customBlocks:i=[]}=e;for(let e=0,t=i.length;e<t;e++){let t=i[e],{startIndex:a}=t;a>=r&&(t.startIndex+=n)}let a=t.customBlocks;if(a){for(let e=0,t=a.length;e<t;e++){let t=a[e];t.startIndex+=r}i.push(...a),i.sort(Ap(`startIndex`))}i.length&&!e.customBlocks&&(e.customBlocks=i)}function Ip(e,t,n,r){let{tables:i}=e;if(i==null)return;for(let e=0,t=i.length;e<t;e++){let t=i[e],{startIndex:a,endIndex:o}=t;a>r?(t.startIndex+=n,t.endIndex+=n):o>r&&(t.endIndex+=n)}let a=t.tables;if(a){for(let e=0,t=a.length;e<t;e++){let t=a[e];t.startIndex+=r,t.endIndex+=r}i.push(...a),i.sort(Ap(`startIndex`))}}let Lp=e=>e.split(`$`)[0];function Rp(e){if(e.length<=1)return e;e.sort((e,t)=>e.startIndex-t.startIndex);let t=[],n={...e[0]};n.rangeId=Lp(n.rangeId);for(let r=1;r<e.length;r++){let i=e[r];i.rangeId=Lp(i.rangeId),i.rangeId===n.rangeId&&ce(n.properties,i.properties)&&n.endIndex+1>=i.startIndex?n.endIndex=i.endIndex:(t.push(n),n={...i})}t.push(n);let r=Object.create(null);for(let e=0,n=t.length;e<n;e++){let n=t[e],i=n.rangeId;r[i]?(n.rangeId=`${i}\$${r[i]}`,r[i]=r[i]+1):r[i]=1}return t}function zp(e,t){let n=e.findIndex(e=>e.startIndex<t&&e.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 Bp(e){if(e.length<=1)return e;e.sort((e,t)=>e.startIndex-t.startIndex);let t=[],n={...e[0]};for(let r=1;r<e.length;r++){let i=e[r];i.id===n.id&&n.endIndex+1>=i.startIndex?n.endIndex=i.endIndex:(t.push(n),n={...i})}return t.push(n),t}function Vp(e,t){e.filter(e=>e.startIndex<t&&e.endIndex>=t).forEach(n=>{let r=e.indexOf(n);e.splice(r,1,{id:n.id,type:n.type,startIndex:n.startIndex,endIndex:t-1},{id:n.id,type:n.type,startIndex:t,endIndex:n.endIndex})})}function Hp(e,t,n,r){e.customRanges||(e.customRanges=[]);let{customRanges:i}=e;zp(i,r);for(let e=0,t=i.length;e<t;e++){let t=i[e],{startIndex:a}=t;a>=r&&(t.startIndex+=n,t.endIndex+=n)}let a=[];if(t.customRanges){for(let e=0,n=t.customRanges.length;e<n;e++){let n=t.customRanges[e];n.startIndex+=r,n.endIndex+=r,a.push(n)}i.push(...a)}e.customRanges=Rp(i)}function Up(e,t,n,r){e.customDecorations||(e.customDecorations=[]);let{customDecorations:i}=e;Vp(i,r);for(let e=0,t=i.length;e<t;e++){let t=i[e],{startIndex:a}=t;a>=r&&(t.startIndex+=n,t.endIndex+=n)}let a=[];if(t.customDecorations){for(let e=0,n=t.customDecorations.length;e<n;e++){let n=t.customDecorations[e];n.startIndex+=r,n.endIndex+=r,a.push(n)}i.push(...a)}e.customDecorations=Bp(i)}function Wp(e,t,n){let{textRuns:r}=e,i=n,a=n+t,o=[];if(r){let n=[];for(let e=0,s=r.length;e<s;e++){let s=r[e],{st:c,ed:l}=s;if(i<=c&&a>=l){o.push({...s,st:c-i,ed:l-i});continue}else c<=i&&l>=a?(o.push({...s,st:i-i,ed:a-i}),s.ed-=t):i>=c&&i<l?(o.push({...s,st:i-i,ed:l-i}),s.ed=i):a>c&&a<=l?(o.push({...s,st:c-i,ed:a-i}),s.st=a-t,s.ed-=t):c>=a&&(s.st-=t,s.ed-=t);n.push(s)}e.textRuns=n}return o.length===0&&o.push({st:0,ed:t,ts:{}}),o}function Gp(e,t,n){let{paragraphs:r}=e,i=n,a=n+t,o=[],s=null,c=!1;if(r){let l=[];for(let e=0,u=r.length;e<u;e++){let u=r[e],{startIndex:d}=u;if(d>=i&&d<a){o.push({...u,startIndex:d-n}),c=!0;continue}else d>=a&&(u.startIndex-=t);l.push(u),s==null&&c&&(s=u)}e.paragraphs=l}return o}function Kp(e,t,n){let{sectionBreaks:r}=e,i=n,a=n+t-1,o=[];if(r){let s=[];for(let e=0,c=r.length;e<c;e++){let c=r[e],{startIndex:l}=c;if(l>=i&&l<=a){o.push({...c,startIndex:l-n});continue}else l>a&&(c.startIndex-=t);s.push(c)}e.sectionBreaks=s}return o}function qp(e,t,n){let{customBlocks:r=[]}=e,i=n,a=n+t-1,o=[];if(r){let s=[];for(let e=0,c=r.length;e<c;e++){let c=r[e],{startIndex:l}=c;if(l>=i&&l<=a){o.push({...c,startIndex:l-n});continue}else l>a&&(c.startIndex-=t);s.push(c)}e.customBlocks=s}return r.length&&!e.customBlocks&&(e.customBlocks=r),o}function Jp(e,t,n){let{tables:r}=e,i=n,a=n+t-1,o=[];if(r){let s=[];for(let e=0,c=r.length;e<c;e++){let c=r[e],{startIndex:l,endIndex:u}=c;if(i<=l&&a>=u){o.push({...c,startIndex:l-n,endIndex:u-n});continue}else if(l<=i&&u>=a){let e=rf(l,u,i,a);if(e.length===0||(c.startIndex=e[0],c.endIndex=e[1],c.startIndex===c.endIndex))continue}else a<l&&(c.startIndex-=t,c.endIndex-=t);s.push(c)}e.tables=s}return o}function Yp(e,t,n){let{customRanges:r}=e,i=n,a=n+t-1,o=[];if(r){let n=[];for(let e=0,s=r.length;e<s;e++){let s=r[e],{startIndex:c,endIndex:l}=s;if(c>=i&&l<=a){o.push(s);continue}else if(Math.max(i,c)<=Math.min(a,l)){let e=rf(c,l,i,a);if(e.length===0)continue;s.startIndex=e[0],s.endIndex=e[1]}else a<c&&(s.startIndex-=t,s.endIndex-=t);n.push(s)}e.customRanges=Rp(n)}return o}function Xp(e,t,n,r=!0){let{customDecorations:i}=e,a=n,o=n+t-1,s=[];if(i){let n=[];for(let e=0,c=i.length;e<c;e++){let c=i[e],{startIndex:l,endIndex:u}=c;if(l>=a&&u<=o){s.push(c);continue}else if(Math.max(a,l)<=Math.min(o,u)){let e=rf(l,u,a,o);if(e.length===0)continue;c.startIndex=e[0],c.endIndex=e[1]}else o<l&&r&&(c.startIndex-=t,c.endIndex-=t);n.push(c)}e.customDecorations=n}return s}let Zp=function(e){return 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}({}),Z=function(e){return 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}({}),Qp={"a)":{glyphFormat:`%1)`,glyphType:V.DECIMAL},"1.":{glyphFormat:`%1.`,glyphType:V.DECIMAL},"a.":{glyphFormat:`%1.`,glyphType:V.LOWER_LETTER},"A.":{glyphFormat:`%1.`,glyphType:V.UPPER_LETTER},"i.":{glyphFormat:`%1.`,glyphType:V.LOWER_ROMAN},"I.":{glyphFormat:`%1.`,glyphType:V.UPPER_LETTER}},$p=e=>[...e,...e,...e].map((e,t)=>({glyphFormat:` %${t+1}`,glyphSymbol:e,bulletAlignment:No.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*t}}})),em=e=>e.map((e,t)=>({...e,bulletAlignment:No.START,textStyle:{fs:12},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*t}}})),tm=(e,t)=>Array(9).fill(0).map((n,r)=>({glyphFormat:` %${r+1}`,glyphSymbol:e,bulletAlignment:No.START,textStyle:{fs:16},startNumber:0,paragraphProperties:{hanging:{v:21},indentStart:{v:21*r},textStyle:t}})),nm={[Z.BULLET_LIST]:{listType:Z.BULLET_LIST,nestingLevel:$p([`●`,`○`,`■`])},[Z.BULLET_LIST_1]:{listType:Z.BULLET_LIST,nestingLevel:$p([`❖`,`➢`,`■`])},[Z.BULLET_LIST_2]:{listType:Z.BULLET_LIST,nestingLevel:$p([`✔`,`●`,`◆`])},[Z.BULLET_LIST_3]:{listType:Z.BULLET_LIST,nestingLevel:$p([`■`,`◆`,`○`])},[Z.BULLET_LIST_4]:{listType:Z.BULLET_LIST,nestingLevel:$p([`✧`,`○`,`■`])},[Z.BULLET_LIST_5]:{listType:Z.BULLET_LIST,nestingLevel:$p([`➢`,`○`,`◆`])},[Z.ORDER_LIST]:{listType:Z.ORDER_LIST,nestingLevel:em([{glyphFormat:`%1.`,glyphType:V.DECIMAL},{glyphFormat:`%2.`,glyphType:V.LOWER_LETTER},{glyphFormat:`%3.`,glyphType:V.LOWER_ROMAN},{glyphFormat:`%4.`,glyphType:V.DECIMAL},{glyphFormat:`%5.`,glyphType:V.LOWER_LETTER},{glyphFormat:`%6.`,glyphType:V.LOWER_ROMAN},{glyphFormat:`%7.`,glyphType:V.DECIMAL},{glyphFormat:`%8.`,glyphType:V.LOWER_LETTER},{glyphFormat:`%9.`,glyphType:V.LOWER_ROMAN}])},[Z.ORDER_LIST_1]:{listType:Z.ORDER_LIST,nestingLevel:em([{glyphFormat:`%1)`,glyphType:V.DECIMAL},{glyphFormat:`%2)`,glyphType:V.LOWER_LETTER},{glyphFormat:`%3)`,glyphType:V.LOWER_ROMAN},{glyphFormat:`%4)`,glyphType:V.DECIMAL},{glyphFormat:`%5)`,glyphType:V.LOWER_LETTER},{glyphFormat:`%6)`,glyphType:V.LOWER_ROMAN},{glyphFormat:`%7)`,glyphType:V.DECIMAL},{glyphFormat:`%8)`,glyphType:V.LOWER_LETTER},{glyphFormat:`%9)`,glyphType:V.LOWER_ROMAN}])},[Z.ORDER_LIST_2]:{listType:Z.ORDER_LIST,nestingLevel:em([`%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:V.DECIMAL})))},[Z.ORDER_LIST_3]:{listType:Z.ORDER_LIST,nestingLevel:em([{glyphFormat:`%1.`,glyphType:V.UPPER_LETTER},{glyphFormat:`%2.`,glyphType:V.LOWER_LETTER},{glyphFormat:`%3.`,glyphType:V.LOWER_ROMAN},{glyphFormat:`%4.`,glyphType:V.UPPER_LETTER},{glyphFormat:`%5.`,glyphType:V.LOWER_LETTER},{glyphFormat:`%6.`,glyphType:V.LOWER_ROMAN},{glyphFormat:`%7.`,glyphType:V.UPPER_LETTER},{glyphFormat:`%8.`,glyphType:V.LOWER_LETTER},{glyphFormat:`%9.`,glyphType:V.LOWER_ROMAN}])},[Z.ORDER_LIST_4]:{listType:Z.ORDER_LIST,nestingLevel:em([{glyphFormat:`%1.`,glyphType:V.UPPER_LETTER},{glyphFormat:`%2.`,glyphType:V.DECIMAL},{glyphFormat:`%3.`,glyphType:V.LOWER_ROMAN},{glyphFormat:`%4.`,glyphType:V.UPPER_LETTER},{glyphFormat:`%5.`,glyphType:V.DECIMAL},{glyphFormat:`%6.`,glyphType:V.LOWER_ROMAN},{glyphFormat:`%7.`,glyphType:V.UPPER_LETTER},{glyphFormat:`%8.`,glyphType:V.DECIMAL},{glyphFormat:`%9.`,glyphType:V.LOWER_ROMAN}])},[Z.ORDER_LIST_5]:{listType:Z.ORDER_LIST,nestingLevel:em([{glyphFormat:`%1.`,glyphType:V.DECIMAL_ZERO},{glyphFormat:`%2.`,glyphType:V.LOWER_LETTER},{glyphFormat:`%3.`,glyphType:V.LOWER_ROMAN},{glyphFormat:`%4.`,glyphType:V.DECIMAL_ZERO},{glyphFormat:`%5.`,glyphType:V.LOWER_LETTER},{glyphFormat:`%6.`,glyphType:V.LOWER_ROMAN},{glyphFormat:`%7.`,glyphType:V.DECIMAL_ZERO},{glyphFormat:`%8.`,glyphType:V.LOWER_LETTER},{glyphFormat:`%9.`,glyphType:V.LOWER_ROMAN}])},[Z.CHECK_LIST]:{listType:Z.CHECK_LIST,nestingLevel:tm(`☐`)},[Z.CHECK_LIST_CHECKED]:{listType:Z.CHECK_LIST_CHECKED,nestingLevel:tm(`☑`,{st:{s:B.TRUE}})}},rm=e=>{let{glyphFormat:t,glyphType:n}=e,r=R.deepClone(nm[Z.ORDER_LIST]);return r.nestingLevel[0].glyphFormat=t,r.nestingLevel[0].glyphType=n,r},im={[Z.ORDER_LIST_QUICK_2]:rm(Qp[Zp.ORDER_LIST_QUICK_2]),[Z.ORDER_LIST_QUICK_3]:rm(Qp[Zp.ORDER_LIST_QUICK_3]),[Z.ORDER_LIST_QUICK_4]:rm(Qp[Zp.ORDER_LIST_QUICK_4]),[Z.ORDER_LIST_QUICK_6]:rm(Qp[Zp.ORDER_LIST_QUICK_6])};Object.assign(nm,im);let am={[Zp.ORDER_LIST_QUICK_1]:Z.ORDER_LIST,[Zp.ORDER_LIST_QUICK_2]:Z.ORDER_LIST_QUICK_2,[Zp.ORDER_LIST_QUICK_3]:Z.ORDER_LIST_QUICK_3,[Zp.ORDER_LIST_QUICK_4]:Z.ORDER_LIST_QUICK_4,[Zp.ORDER_LIST_QUICK_5]:Z.ORDER_LIST_3,[Zp.ORDER_LIST_QUICK_6]:Z.ORDER_LIST_QUICK_6,[Zp.ORDER_LIST_QUICK_7]:Z.ORDER_LIST_5,[Zp.BULLET_LIST]:Z.BULLET_LIST};function om(e,t,n,r,i){return{dataStream:``,textRuns:sm(e,t,n,r,i),paragraphs:lm(e,t,n,r,i),sectionBreaks:um(e,t,n,r,i),customBlocks:dm(e,t,n,r,i),tables:fm(e,t,n,r,i),customRanges:pm(e,t,n,r,i),customDecorations:mm(e,t,n,r,i)}}function sm(e,t,n,r,i){let{textRuns:a}=e,{textRuns:o}=t;if(a==null||o==null)return;let s=Wp(e,n,r);return i!==H.REPLACE&&(t.textRuns=cm(o,s,i)),Mp(e,t,n,r),s}function cm(e,t,n){if(t.length===0)return e;e=R.deepClone(e),t=R.deepClone(t);let r=[],i=e.length,a=t.length,o=0,s=0,c=null;function l(){return c?(r.push(c),c=null,!0):!1}for(;o<i&&s<a;){let{st:i,ed:a,ts:u}=e[o],{st:d,ed:f,ts:p,sId:m}=t[s],h;if(h=n===H.COVER?{...p,...u}:{...u},a<d)l()||r.push(e[o]),o++;else if(f<i)l()||r.push(t[s]),s++;else{let n={st:Math.min(i,d),ed:Math.max(i,d),ts:i<d?{...u}:{...p},sId:i<d?void 0:m};n.ed>n.st&&r.push(n),r.push({st:Math.max(i,d),ed:Math.min(a,f),ts:h,sId:m}),a<f?(o++,t[s].st=a,t[s].st===t[s].ed&&s++):(s++,e[o].st=f,e[o].st===e[o].ed&&o++);let l={st:Math.min(a,f),ed:Math.max(a,f),ts:a<f?{...p}:{...u},sId:a<f?m:void 0};c=l.ed>l.st?l:null}}l();let u=r[r.length-1],d=e[i-1],f=t[a-1];return u&&u.ed!==Math.max(d.ed,f.ed)&&(d.ed>f.ed?r.push(d):r.push(f)),jp(r)}function lm(e,t,n,r,i){let{paragraphs:a}=e,{paragraphs:o}=t;if(a==null||o==null)return;let s=Gp(e,n,r);if(i!==H.REPLACE){let e=[];for(let t of o){let{startIndex:n,paragraphStyle:r,bullet:a}=t,o=[];for(let e of s){let{startIndex:t,paragraphStyle:s,bullet:c}=e,l,u;if(i===H.COVER?(l={...s,...r},u={listId:``,listType:Z.BULLET_LIST,nestingLevel:0,textStyle:{},...c,...a}):(l={...r,...s},u={listId:``,listType:Z.BULLET_LIST,nestingLevel:0,textStyle:{},...a,...c}),n===t){o.push({startIndex:n,paragraphStyle:l,bullet:u});break}}e.push(...o),o=[]}t.paragraphs=e}return Np(e,t,n,r),s}function um(e,t,n,r,i){let{sectionBreaks:a}=e,{sectionBreaks:o}=t;if(a==null||o==null)return;let s=Kp(e,n,r);if(i!==H.REPLACE){let e=[];for(let t of o){let{startIndex:n}=t,r=[];for(let e of s){let{startIndex:a}=e;if(n===a){i===H.COVER?r.push({...e,...t}):r.push({...t,...e});break}}e.push(...r),r=[]}t.sectionBreaks=e}return Pp(e,t,n,r),s}function dm(e,t,n,r,i){let{customBlocks:a=[]}=e,{customBlocks:o}=t;if(a==null||o==null)return;let s=qp(e,n,r);if(i!==H.REPLACE){let e=[];for(let t of o){let{startIndex:n}=t,r=[];for(let e of s){let{startIndex:a}=e;if(n===a){i===H.COVER?r.push({...e,...t}):r.push({...t,...e});break}}e.push(...r),r=[]}t.customBlocks=e}return Fp(e,t,n,r),a.length&&!e.customBlocks&&(e.customBlocks=a),s}function fm(e,t,n,r,i){let{tables:a}=e,{tables:o}=t;if(a==null||o==null)return;let s=Jp(e,n,r);if(i!==H.REPLACE){let e=[];for(let t of o){let{startIndex:n,endIndex:r}=t,a=[];for(let e of s){let{startIndex:o,endIndex:s}=e;if(o>=n&&s<=r){i===H.COVER?a.push({...e,...t}):a.push({...t,...e});break}}e.push(...a),a=[]}t.tables=e}return Ip(e,t,n,r),s}function pm(e,t,n,r,i){e.customRanges||(e.customRanges=[]),zp(e.customRanges,r),zp(e.customRanges,r+n);let a=r,o=r+n-1,{customRanges:s}=t,c=[],l=new Map;return e.customRanges.forEach(e=>{let{startIndex:t,endIndex:n}=e;t>=a&&n<=o?l.set(e.rangeId,e):c.push(e)}),s?(s.forEach(e=>{let{startIndex:t,endIndex:n}=e;c.push({...e,startIndex:t+r,endIndex:n+r})}),e.customRanges=Rp(c),[]):[]}function mm(e,t,n,r,i){e.customDecorations||(e.customDecorations=[]),Vp(e.customDecorations,r),Vp(e.customDecorations,r+n);let a=[],{customDecorations:o}=e,{customDecorations:s=[]}=t;if(i===H.REPLACE){for(let e=0;e<o.length;e++){let t=o[e],{startIndex:i,endIndex:s}=t;i>=r&&s<=r+n-1&&a.push(t)}s.forEach(e=>{let{startIndex:t,endIndex:n}=e;o.push({...e,startIndex:t+r,endIndex:n+r})})}else for(let e of s){let{id:t}=e;if(e.type===Fo.DELETED){let e=o.filter(e=>e.id===t);e.length&&a.push(...e)}else o.push({...e,startIndex:e.startIndex+r,endIndex:e.endIndex+r})}for(let e of a){let{id:t}=e,n=o.findIndex(e=>e.id===t);n!==-1&&o.splice(n,1)}return e.customDecorations=Bp(o),a}let hm=function(e){return e[e.copy=0]=`copy`,e[e.cut=1]=`cut`,e}({});function gm(e,t,n,r=!0){let{textRuns:i}=e;if(i){let e=[];for(let r of i){let i=R.deepClone(r),{st:a,ed:o}=i;R.hasIntersectionBetweenTwoRanges(a,o,t,n)&&(t>=a&&t<=o?e.push({...i,st:t,ed:Math.min(n,o)}):n>=a&&n<=o?e.push({...i,st:Math.max(t,a),ed:n}):e.push(i))}return jp(e.map(e=>{let{st:n,ed:r}=e;return{...e,st:n-t,ed:r-t}}))}else if(r)return[{st:0,ed:n-t,ts:{}}]}function _m(e,t,n){let{tables:r=[]}=e,i=[];for(let e of r){let r=R.deepClone(e),{startIndex:a,endIndex:o}=r;a>=t&&o<=n&&i.push({...r,startIndex:a-t,endIndex:o-t})}return i}function vm(e,t,n){let{paragraphs:r=[]}=e,i=[];for(let e of r){let{startIndex:r}=e;if(r>=t&&r<n){let t=R.deepClone(e);i.push(t)}}if(i.length)return i.map(e=>({...e,startIndex:e.startIndex-t}))}function ym(e,t,n){let{sectionBreaks:r=[]}=e,i=[];for(let e of r){let{startIndex:r}=e;r>=t&&r<=n&&i.push(R.deepClone(e))}if(i.length)return i.map(e=>({...e,startIndex:e.startIndex-t}))}function bm(e,t,n){let{customBlocks:r=[]}=e,i=[];for(let e of r){let{startIndex:r}=e;r>=t&&r<n&&i.push(R.deepClone(e))}if(i.length)return i.map(e=>({...e,startIndex:e.startIndex-t}))}function xm(e,t,n,r=!0,i=hm.cut){let{dataStream:a}=e,o={dataStream:a.slice(t,n)};o.textRuns=gm(e,t,n,r);let s=_m(e,t,n);if(s.length&&(o.tables=s),o.paragraphs=vm(e,t,n),i===hm.cut){let i=wm(e,t,n);i?o.customDecorations=i:r&&(o.customDecorations=[])}let{customRanges:c}=Cm(e,t,n);return c?o.customRanges=c:r&&(o.customRanges=[]),o.customBlocks=bm(e,t,n),o}function Sm(e){let{dataStream:t,textRuns:n,paragraphs:r,customRanges:i,customDecorations:a,tables:o}=e,s=0,c=0;i==null||i.forEach(e=>{e.startIndex<0&&(s=Math.max(s,-e.startIndex)),e.endIndex>t.length-1&&(c=Math.max(c,e.endIndex-t.length+1))});let l=`${t}`;return n&&(n[0]&&(n[0].st=n[0].st-s),n[n.length-1]&&(n[n.length-1].ed=n[n.length-1].ed+c)),n==null||n.forEach(e=>{e.st+=s,e.ed+=s}),r==null||r.forEach(e=>{e.startIndex+=s}),i==null||i.forEach(e=>{e.startIndex+=s,e.endIndex+=s}),a==null||a.forEach(e=>{e.startIndex+=s,e.endIndex+=c}),o==null||o.forEach(e=>{e.startIndex+=s,e.endIndex+=c}),{...e,dataStream:l,textRuns:n,paragraphs:r,customRanges:i,customDecorations:a,tables:o}}function Cm(e,t,n){if(e.customRanges==null)return{};let{customRanges:r}=e;return{customRanges:r.filter(e=>Math.max(e.startIndex,t)<=Math.min(e.endIndex,n-1)).map(e=>({...e,startIndex:Math.max(e.startIndex,t),endIndex:Math.min(e.endIndex,n-1)})).map(e=>({...e,startIndex:e.startIndex-t,endIndex:e.endIndex-t})),leftOffset:0,rightOffset:0}}function wm(e,t,n){if(e.customDecorations==null)return;let{customDecorations:r=[]}=e,i=[];return r.forEach(e=>{if(Math.max(e.startIndex,t)<=Math.min(e.endIndex,n-1)){let r=R.deepClone(e);i.push({...r,startIndex:Math.max(r.startIndex-t,0),endIndex:Math.min(r.endIndex,n-1)-t})}}),i}function Tm(e,t,n){return e==null||t==null?e==null?t:e:cm(e,t,n)}function Em(e,t,n){if(e==null||t==null)return e==null?t:e;if(t.length===0||e.length===0)return e;if(t.length>1||e.length>1)throw Error(`Cannot cover multiple customRanges`);return n===H.REPLACE?[{...e[0]}]:[{...t[0],...e[0]}]}function Dm(e,t,n){return t.length===0||e.length===0||n===H.REPLACE?e:[...e,...t.filter(t=>!e.some(e=>t.id===e.id))]}function Om(e,t,n=H.COVER){if(t.dataStream!==``)throw Error(`Cannot compose other body with non-empty dataStream`);let r={dataStream:e.dataStream},{textRuns:i,paragraphs:a=[],customRanges:o,customDecorations:s=[]}=e,{textRuns:c,paragraphs:l=[],customRanges:u,customDecorations:d=[]}=t;r.textRuns=Tm(c,i,n),r.customRanges=Em(u,o,n);let f=Dm(d,s,n);f.length&&(r.customDecorations=f);let p=[],m=0,h=0;for(;m<a.length&&h<l.length;){let e=a[m],t=l[h],{startIndex:n}=e,{startIndex:r}=t;n===r?(p.push(R.deepMerge(e,t)),m++,h++):n<r?(p.push(R.deepClone(e)),m++):(p.push(R.deepClone(t)),h++)}return m<a.length&&p.push(...a.slice(m)),h<l.length&&p.push(...l.slice(h)),p.length&&(r.paragraphs=p),r}function km(e){let{body:t}=e;if(t==null)return!0;let{textRuns:n,paragraphs:r,customRanges:i,customBlocks:a,customDecorations:o,tables:s}=t;return n==null&&r==null&&i==null&&a==null&&o==null&&s==null}var Am=class{constructor(e){this._actions=e,P(this,`_index`,0),P(this,`_offset`,0)}hasNext(){return this.peekLength()<1/0}next(e){e||(e=1/0);let t=this._actions[this._index];if(t){let n=this._offset,r=t.len;return e>=r-n?(e=r-n,this._index+=1,this._offset=0):this._offset+=e,t.t===U.DELETE||t.t===U.RETAIN&&t.body==null?R.deepClone({...t,len:e}):R.deepClone({...t,len:e,body:xm(t.body,n,n+e,!1)})}else return{t:U.RETAIN,len:1/0}}peek(){return this._actions[this._index]}peekLength(){return this._actions[this._index]?this._actions[this._index].len-this._offset:1/0}peekType(){let e=this._actions[this._index];return e?e.t:U.RETAIN}rest(){if(!this.hasNext())return[];if(this._offset===0)return this._actions.slice(this._index);{let e=this._offset,t=this._index,n=this.next(),r=this._actions.slice(this._index);return this._offset=e,this._index=t,[n].concat(r)}}};function jm(e,t,n){let{dataStream:r}=e,i=n,a=n+t,o=Wp(e,t,n),s=Gp(e,t,n),c=Kp(e,t,n),l=qp(e,t,n),u=Jp(e,t,n),d=Yp(e,t,n),f=Xp(e,t,n),p=``;return r&&(e.dataStream=lf(r,i,a),p=r.slice(i,a)),{dataStream:p,textRuns:o,paragraphs:s,sectionBreaks:c,customBlocks:l,tables:u,customRanges:d,customDecorations:f}}function Mm(e,t,n,r){e.dataStream=cf(e.dataStream,r,t.dataStream),Mp(e,t,n,r),Np(e,t,n,r),Pp(e,t,n,r),Fp(e,t,n,r),Ip(e,t,n,r),Hp(e,t,n,r),Up(e,t,n,r)}function Nm(e,t,n,r,i=H.COVER){return om(e,t,n,r,i)}function Pm(e,t,n){return t<=0?{dataStream:``}:jm(e,t,n)}function Fm(e,t,n,r){n!==0&&Mm(e,t,n,r)}function Im(e,t){let n=new Ui;return n.reset(),t.forEach(t=>{let r=R.deepClone(t);switch(r.t){case U.RETAIN:{let{coverType:t,body:i,len:a}=r;i!=null&&Nm(e,i,a,n.cursor,t),n.moveCursor(a);break}case U.INSERT:{let{body:t,len:i}=r;Fm(e,t,i,n.cursor),n.moveCursor(i);break}case U.DELETE:{let{len:t}=r;Pm(e,t,n.cursor);break}default:throw Error(`Unknown action type for action: ${r}.`)}}),e}var Lm=function(e){return e[e.COVER=0]=`COVER`,e[e.COVER_ONLY_NOT_EXISTED=1]=`COVER_ONLY_NOT_EXISTED`,e}(Lm||{});function Rm(e,t,n,r,i){if(e==null||t==null)return t;if(e.length===0||t.length===0)return[];t=R.deepClone(t),e=R.deepClone(e);let a=[],o=t.length,s=e.length,c=0,l=0,u=null;function d(){return u?(a.push(u),u=null,!0):!1}for(;c<o&&l<s;){let{st:o,ed:s,ts:f}=t[c],{st:p,ed:m,ts:h,sId:g}=e[l],_={};if(i===Lm.COVER)_={...f},n===H.COVER&&r===H.REPLACE&&h&&(_=Object.assign({},h,_));else if(_={...f},n===H.REPLACE){if(r===H.REPLACE)_={...h};else if(f&&h){let e=Object.keys(f);for(let t of e)h[t]&&delete _[t]}}else if(r===H.REPLACE){if(h){let e=Object.keys(h);for(let t of e)h[t]!==void 0&&(_[t]=h[t])}}else if(h){let e=Object.keys(h);for(let t of e)_[t]!==void 0&&delete _[t]}if(s<p)d()||a.push(t[c]),c++;else if(m<o)d()||a.push(e[l]),l++;else{let n={st:Math.min(o,p),ed:Math.max(o,p),ts:o<p?{...f}:{...h},sId:o<p?void 0:g};n.ed>n.st&&a.push(),a.push({st:Math.max(o,p),ed:Math.min(s,m),ts:_,sId:g}),s<m?(c++,e[l].st=s,e[l].st===e[l].ed&&l++):(l++,t[c].st=m,t[c].st===t[c].ed&&c++);let r={st:Math.min(s,m),ed:Math.max(s,m),ts:s<m?{...h}:{...f},sId:s<m?g:void 0};u=r.ed>r.st?r:null}}d();let f=a[a.length-1],p=t[o-1],m=e[s-1];return f.ed!==Math.max(p.ed,m.ed)&&(p.ed>m.ed?a.push(p):a.push(m)),jp(a,!0)}function zm(e,t,n,r,i){if(e==null||t==null)return t;if(e.length===0||t.length===0)return[];if(e.length>1||t.length>1)throw Error(`CustomRanges is only supported transform for length one now.`);let a=e[0],o=t[0];if(n===H.REPLACE)return i===Lm.COVER_ONLY_NOT_EXISTED?[R.deepClone(a)]:[R.deepClone(o)];if(r===H.REPLACE){let e=R.deepClone(o);return i===Lm.COVER_ONLY_NOT_EXISTED&&Object.assign(e,R.deepClone(a)),[e]}else{let e=R.deepClone(o);return i===Lm.COVER_ONLY_NOT_EXISTED&&Object.assign(e,R.deepClone(a)),[e]}}function Bm(e,t,n,r,i){let a={startIndex:t.startIndex};if(t.paragraphStyle&&(a.paragraphStyle=R.deepClone(t.paragraphStyle),e.paragraphStyle)){if(n===H.REPLACE)if(r===H.REPLACE)i===Lm.COVER_ONLY_NOT_EXISTED&&(a.paragraphStyle={...e.paragraphStyle});else if(i===Lm.COVER_ONLY_NOT_EXISTED){let t=Object.keys(e.paragraphStyle);for(let n of t)e.paragraphStyle[n]!==void 0&&(a.paragraphStyle[n]=e.paragraphStyle[n])}else{let t=Object.keys(e.paragraphStyle);for(let n of t)a.paragraphStyle[n]===void 0&&(a.paragraphStyle[n]=e.paragraphStyle[n])}else if(r===H.REPLACE)if(i===Lm.COVER_ONLY_NOT_EXISTED){let t=Object.keys(e.paragraphStyle);for(let n of t)e.paragraphStyle[n]!==void 0&&(a.paragraphStyle[n]=e.paragraphStyle[n])}else{let t=Object.keys(e.paragraphStyle);for(let n of t)a.paragraphStyle[n]===void 0&&(a.paragraphStyle[n]=e.paragraphStyle[n])}else if(i===Lm.COVER_ONLY_NOT_EXISTED){let t=Object.keys(e.paragraphStyle);for(let e of t)a.paragraphStyle[e]&&delete a.paragraphStyle[e]}}return n===H.REPLACE&&r===H.REPLACE?a.bullet=i===Lm.COVER_ONLY_NOT_EXISTED?R.deepClone(e.bullet):R.deepClone(t.bullet):e.bullet===void 0?a.bullet=R.deepClone(t.bullet):n===H.REPLACE||r===H.REPLACE?a.bullet=i===Lm.COVER&&t.bullet?R.deepClone(t.bullet):R.deepClone(e.bullet):i===Lm.COVER&&t.bullet!==void 0&&(a.bullet=R.deepClone(t.bullet)),a}function Vm(e,t){if(e==null||t==null)return t;if(e.length===0||t.length===0)return R.deepClone(t);let n=[];for(let r of t){let{id:t,type:i}=r,a=!1;for(let o of e)if(o.id===t){(o.type===Fo.DELETED||i===Fo.DELETED)&&(a=!0,n.push({...r,type:Fo.DELETED}));break}a||n.push(r)}return n}function Hm(e,t,n=!1){let{body:r,coverType:i=H.COVER}=e,{body:a,coverType:o=H.COVER}=t;if(r==null||r.dataStream!==``||a==null||a.dataStream!==``)throw Error(`Data stream is not supported in retain transform.`);let s={dataStream:``},c=o,{textRuns:l,paragraphs:u=[],customRanges:d,customDecorations:f}=r,{textRuns:p,paragraphs:m=[],customRanges:h,customDecorations:g}=a,_=Rm(l,p,i,o,n?Lm.COVER_ONLY_NOT_EXISTED:Lm.COVER);_&&(s.textRuns=_);let v=zm(d,h,i,o,n?Lm.COVER_ONLY_NOT_EXISTED:Lm.COVER);v&&(s.customRanges=v);let y=Vm(f,g);y&&(s.customDecorations=y);let b=[],x=0,S=0;for(;x<u.length&&S<m.length;){let e=u[x],t=m[S],{startIndex:r}=e,{startIndex:a}=t;if(r===a){let a={startIndex:r};a=n?Bm(e,t,i,o,Lm.COVER_ONLY_NOT_EXISTED):Bm(e,t,i,o,Lm.COVER),b.push(a),x++,S++}else r<a?x++:(b.push(R.deepClone(t)),S++)}return S<m.length&&b.push(...m.slice(S)),b.length&&(s.paragraphs=b),{coverType:c,body:s}}function Um(e){return Object.keys(e).length===1}var Q=class e{constructor(){P(this,`_actions`,[])}static apply(e,t){return Im(e,t)}static compose(t,n){let r=new Am(t),i=new Am(n),a=new e;for(;r.hasNext()||i.hasNext();)if(i.peekType()===U.INSERT)a.push(i.next());else if(r.peekType()===U.DELETE)a.push(r.next());else{let e=Math.min(r.peekLength(),i.peekLength()),t=r.next(e),n=i.next(e);if(t.t===U.INSERT&&n.t===U.RETAIN)n.body==null?a.push(t):a.push({...t,body:Om(t.body,n.body,n.coverType)});else if(t.t===U.RETAIN&&n.t===U.RETAIN)if(t.body==null&&n.body==null)a.push(t.len===1/0?n:t);else if(t.body&&n.body){let e=t.coverType===H.REPLACE||n.coverType===H.REPLACE?H.REPLACE:H.COVER;a.push({...t,t:U.RETAIN,coverType:e,body:Om(t.body,n.body,n.coverType)})}else a.push(t.body?t:n);else t.t===U.RETAIN&&n.t===U.DELETE?a.push(n):t.t===U.INSERT&&(n.t,U.DELETE)}return a.trimEndUselessRetainAction(),a.serialize()}static transform(e,t,n=`right`){return this._transform(t,e,n===`left`?`right`:`left`)}static _transform(t,n,r=`right`){let i=new Am(t),a=new Am(n),o=new e;for(;i.hasNext()||a.hasNext();)if(i.peekType()===U.INSERT&&(r===`left`||a.peekType()!==U.INSERT)){let e=i.next();o.retain(e.len)}else if(a.peekType()===U.INSERT)o.push(a.next());else{let e=Math.min(i.peekLength(),a.peekLength()),t=i.next(e),n=a.next(e);if(t.t===U.DELETE)continue;if(n.t===U.DELETE){o.push(n);continue}if(t.body==null||n.body==null)o.push(n);else{let{coverType:e,body:i}=Hm(t,n,r===`left`);o.push({...n,t:U.RETAIN,coverType:e,body:i})}}return o.trimEndUselessRetainAction(),o.serialize()}static transformPosition(e,t,n=!1){let r=new Am(e),i=0;for(;r.hasNext()&&i<=t;){let e=r.peekLength(),a=r.peekType();if(r.next(),a===U.DELETE){t-=Math.min(e,t-i);continue}else a===U.INSERT&&(i<t||!n)&&(t+=e);i+=e}return t}static isNoop(e){return e.length===0}static invert(e){let t=[];for(let n of e)if(n.t===U.INSERT)t.push({t:U.DELETE,len:n.len,body:n.body});else if(n.t===U.DELETE){if(n.body==null)throw Error(`Can not invert DELETE action without body property, makeInvertible must be called first.`);t.push({t:U.INSERT,body:n.body,len:n.len})}else if(n.body!=null){if(n.oldBody==null)throw Error(`Can not invert RETAIN action without oldBody property, makeInvertible must be called first.`);t.push({t:U.RETAIN,body:n.oldBody,oldBody:n.body,len:n.len,coverType:H.REPLACE})}else t.push(n);return t}static makeInvertible(e,t){let n=[],r=0;for(let i of e){if(i.t===U.DELETE&&(i.body==null||i.body&&i.body.dataStream.length!==i.len)){let e=xm(t,r,r+i.len,!1);i.len=e.dataStream.length,i.body=e}if(i.t===U.RETAIN&&i.body!=null){let e=xm(t,r,r+i.len,!0);i.oldBody={...e,dataStream:``},i.len=e.dataStream.length}n.push(i),i.t!==U.INSERT&&(r+=i.len)}return n}insert(e,t){let n={t:U.INSERT,body:t,len:e};return this.push(n),this}retain(e,t,n){let r={t:U.RETAIN,len:e};return t!=null&&(r.body=t),n!=null&&(r.coverType=n),this.push(r),this}delete(e){let t={t:U.DELETE,len:e};return this.push(t),this}empty(){return this._actions=[],this}serialize(){return this._actions}push(...e){if(e.length>1){for(let t of e)this.push(t);return this}let t=this._actions.length,n=this._actions[t-1],r=R.deepClone(e[0]);if(r.t===U.RETAIN&&r.len===0&&r.body==null)return this;if(typeof n==`object`){if(n.t===U.DELETE&&r.t===U.DELETE)return n.len+=r.len,this;if(n.t===U.DELETE&&r.t===U.INSERT&&(--t,n=this._actions[t-1],n==null))return this._actions.unshift(r),this;if(n.t===U.RETAIN&&r.t===U.RETAIN&&n.body==null&&r.body==null)return n.len+=r.len,this;if(n.t===U.INSERT&&Um(n.body)&&r.t===U.INSERT&&Um(r.body))return n.len+=r.len,n.body.dataStream+=r.body.dataStream,this}return t===this._actions.length?this._actions.push(r):this._actions.splice(t,0,r),this}trimEndUselessRetainAction(){let e=this._actions[this._actions.length-1];for(;e&&e.t===U.RETAIN&&km(e);)this._actions.pop(),e=this._actions[this._actions.length-1];return this}};P(Q,`id`,`text-x`),P(Q,`uri`,`https://github.com/dream-num/univer#text-x`),Object.defineProperty(Q,`name`,{value:`text-x`});var Wm=class e{static registerSubtype(e){var t;e==null||this._subTypes.has(e.name)&&((t=this._subTypes.get(e.name))==null?void 0:t.id)!==Q.id||(this._subTypes.set(e.name,e),Es.type.registerSubtype(e))}static apply(e,t){if(!Es.type.isNoop(t))return Es.type.apply(e,t)}static compose(e,t){return Es.type.compose(e,t)}static transform(e,t,n){return Es.type.transform(e,t,n)}static transformPosition(e,t,n=`right`){return e&&e.length===2&&e[0]===`body`&&e[1].et===Q.name?Q.transformPosition(e[1].e,t,n===`left`):t}static invertWithDoc(e,t){return Es.type.invertWithDoc(e,t)}static isNoop(e){return Es.type.isNoop(e)}static getInstance(){return this._instance==null&&(this._instance=new e),this._instance}removeOp(e,t){return Es.removeOp(e,t)}moveOp(e,t){return Es.moveOp(e,t)}insertOp(e,t){return Es.insertOp(e,t)}replaceOp(e,t,n){return Es.replaceOp(e,t,n)}editOp(e,t=[`body`]){return Es.editOp(t,Q.name,e)}};P(Wm,`uri`,`https://github.com/dream-num/univer#json-x`),P(Wm,`_subTypes`,new Map),P(Wm,`_instance`,null),Wm.registerSubtype(Q);let Gm=function(e){return 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}({}),Km=function(e){return e.PARAGRAPH=`\r`,e.SECTION_BREAK=`
4
+ `,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}({});function qm(e){return`${e}`}let Jm=[Km.TABLE_START,Km.TABLE_ROW_START,Km.TABLE_CELL_START,Km.TABLE_CELL_END,Km.TABLE_ROW_END,Km.TABLE_END],Ym=e=>{let t=e.endsWith(`\r
5
+ `)?e.slice(0,-2):e;return Jm.reduce((e,t)=>e.replaceAll(t,``),t)},Xm=e=>e?Ym(e).replaceAll(`\r`,``)===``:!0,Zm=e=>{let t=e.replace(/\n/g,`\r`),n=[],r=[],i=0,a=``,o=(o,s=!0)=>{let c=t.slice(i,o);if(R.isLegalUrl(c)){let t=Ya(),l=`${c}`,u={startIndex:i,endIndex:i+l.length-1,rangeId:t,rangeType:Po.HYPERLINK,properties:{url:e}};r.push(u),a+=l,i=o+1,s&&(a+=`\r`,n.push({startIndex:o}))}else a+=t.slice(i,o+1),i=o+1,s&&n.push({startIndex:o})},s=0;for(let e=0;e<t.length;e++)t[e]===`\r`&&(o(e),s=e);return(s!==t.length-1||t.length===1)&&o(t.length,!1),{dataStream:a,paragraphs:n,customRanges:r}},Qm={id:`default_doc`,documentStyle:{}};var $m=class extends Pa{getUnitId(){throw Error(`Method not implemented.`)}constructor(e){var t;super(),P(this,`type`,I.UNIVER_DOC),P(this,`_name$`,new n.BehaviorSubject(``)),P(this,`name$`,this._name$.asObservable()),P(this,`snapshot`,void 0),this.snapshot={...Qm,...e},this._name$.next((t=this.snapshot.title)==null?`No Title`:t)}getRev(){var e;return(e=this.snapshot.rev)==null?1:e}incrementRev(){this.snapshot.rev=this.getRev()+1}setRev(e){this.snapshot.rev=e}setName(e){this.snapshot.title=e,this._name$.next(e)}get drawings(){return this.snapshot.drawings}get documentStyle(){return this.snapshot.documentStyle}get lists(){return this.snapshot.lists}get zoomRatio(){var e;return((e=this.snapshot.settings)==null?void 0:e.zoomRatio)||1}resetDrawing(e,t){this.snapshot.drawings=e,this.snapshot.drawingsOrder=t}getBody(){return this.snapshot.body}getSnapshot(){return this.snapshot}getBulletPresetList(){var e;let t=(e=this.snapshot.lists)==null?{}:e;return{...nm,...t}}updateDocumentId(e){this.snapshot.id=e}updateDocumentRenderConfig(e){let{documentStyle:t}=this.snapshot;t.renderConfig==null?t.renderConfig=e:t.renderConfig={...t.renderConfig,...e}}getDocumentStyle(){return this.snapshot.documentStyle}updateDocumentStyle(e){this.snapshot.documentStyle==null?this.snapshot.documentStyle=e:this.snapshot.documentStyle={...this.snapshot.documentStyle,...e}}updateDocumentDataMargin(e){let{t,l:n,b:r,r:i}=e,{documentStyle:a}=this.snapshot;t!=null&&(a.marginTop=t),n!=null&&(a.marginLeft=n),r!=null&&(a.marginBottom=r),i!=null&&(a.marginRight=i)}updateDocumentDataPageSize(e,t){let{documentStyle:n}=this.snapshot;if(!n.pageSize){n.pageSize={width:e==null?1/0:e,height:t==null?1/0:t};return}e!==void 0&&(n.pageSize.width=e),t!==void 0&&(n.pageSize.height=t)}updateDrawing(e,t){let{drawings:n}=this,{width:r,height:i,left:a,top:o}=t,s=n==null?void 0:n[e];if(!s)return;let c=s.docTransform;c.size.width=r,c.size.height=i,c.positionH.posOffset=a,c.positionV.posOffset=o}setZoomRatio(e=1){this.snapshot.settings?this.snapshot.settings.zoomRatio=e:this.snapshot.settings={zoomRatio:e}}setDisabled(e){this.snapshot.disabled=e}getDisabled(){return this.snapshot.disabled}getTitle(){return this.snapshot.title}},eh=class e extends $m{constructor(e){var t,r;super(R.isEmptyObject(e)?gs():e),P(this,`_unitId`,void 0),P(this,`headerModelMap`,new Map),P(this,`footerModelMap`,new Map),P(this,`change$`,new n.BehaviorSubject(0)),this._unitId=(t=this.snapshot.id)==null?Ya(6):t,this._initializeHeaderFooterModel(),this._name$.next((r=this.snapshot.title)==null?``:r)}dispose(){super.dispose(),this.headerModelMap.forEach(e=>{e.dispose()}),this.footerModelMap.forEach(e=>{e.dispose()}),this._name$.complete()}getDrawings(){return this.snapshot.drawings}getDrawingsOrder(){return this.snapshot.drawingsOrder}getCustomRanges(){var e;return(e=this.snapshot.body)==null?void 0:e.customRanges}getCustomDecorations(){var e;return(e=this.snapshot.body)==null?void 0:e.customDecorations}getSettings(){return this.snapshot.settings}reset(e){if(e.id&&e.id!==this._unitId)throw Error(`Cannot reset a document model with a different unit id!`);this.snapshot={...Qm,...e},this._initializeHeaderFooterModel(),this.change$.next(this.change$.value+1)}getSelfOrHeaderFooterModel(e){if(e!=null){if(this.headerModelMap.has(e))return this.headerModelMap.get(e);if(this.footerModelMap.has(e))return this.footerModelMap.get(e)}return this}getUnitId(){return this._unitId}apply(e){if(!Wm.isNoop(e))return this.snapshot=Wm.apply(this.snapshot,e),e!=null&&e.some(e=>Array.isArray(e)&&((e==null?void 0:e[0])===`headers`||(e==null?void 0:e[0])===`footers`))&&(this.headerModelMap.clear(),this.footerModelMap.clear(),this._initializeHeaderFooterModel()),this.change$.next(this.change$.value+1),this.snapshot}sliceBody(e,t,n=hm.copy){let r=this.getBody();if(r!=null)return xm(r,e,t,!1,n)}_initializeHeaderFooterModel(){let{headers:t,footers:n}=this.getSnapshot();if(t)for(let n in t){let r=t[n];this.headerModelMap.set(n,new e(r)),this.headerModelMap.get(n).updateDocumentId(this.getUnitId())}if(n)for(let t in n){let r=n[t];this.footerModelMap.set(t,new e(r)),this.footerModelMap.get(t).updateDocumentId(this.getUnitId())}}updateDocumentId(e){super.updateDocumentId(e),this._unitId=e}getPlainText(){var e,t;return Ym((e=(t=this.getBody())==null?void 0:t.dataStream)==null?``:e)}};function th(e){let{ranges:t,id:n,type:r}=e,i=new Q,a=0;for(let e=0;e<t.length;e++){let{startOffset:o,endOffset:s}=t[e];o>0&&i.push({t:U.RETAIN,len:o-a}),i.push({t:U.RETAIN,body:{dataStream:``,customDecorations:[{id:n,type:r,startIndex:0,endIndex:s-o-1}]},len:s-o}),a=s}return i}function nh(e){var t;let{id:n,segmentId:r,documentDataModel:i}=e,a=i==null?void 0:i.getBody();if(!i||!a)return!1;let o=(t=i.getSelfOrHeaderFooterModel(r))==null||(t=t.getBody())==null||(t=t.customDecorations)==null?void 0:t.find(e=>e.id===n);if(!o)return!1;let s=new Q,{startIndex:c,endIndex:l}=o,u=l-c+1;return s.push({t:U.RETAIN,len:c}),s.push({t:U.RETAIN,len:u,body:{dataStream:``,customDecorations:[{startIndex:0,endIndex:u-1,id:n,type:Fo.DELETED}]}}),s}function rh(e,t,n,r){return e<=n&&t>=n||e>=n&&e<=r}function ih(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];e.collapsed?i.startIndex<e.startOffset&&e.startOffset<=i.endIndex&&n.push(i):rh(e.startOffset,e.endOffset-1,i.startIndex,i.endIndex)&&n.push(i)}return n}function ah(e){return{...R.deepClone(e),rangeId:Ya()}}function oh(e,t){let n=[],r=e[0];for(let i of t)i<e[0]||i>e[1]||(r<i&&n.push([r,i-1]),r=i+1);return r<=e[1]&&n.push([r,e[1]]),n}function sh(e,t,n,r){let i=[];for(let a=0,o=n.length;a<o;a++){let o=n[a];if((r===void 0||o.rangeType===r)&&Math.max(o.startIndex,e)<=Math.min(o.endIndex,t)&&i.push({...o}),o.startIndex>t)break}return i}function ch(e,t){var n,r,i,a,o;let s=sh(e.startOffset,e.collapsed?e.startOffset:e.endOffset-1,(n=t.customRanges)==null?[]:n),c=Math.min(e.startOffset,(r=(i=s[0])==null?void 0:i.startIndex)==null?1/0:r),l=Math.max(e.endOffset,((a=(o=s[s.length-1])==null?void 0:o.endIndex)==null?-1/0:a)+1);return{startOffset:c,endOffset:l,collapsed:c===l}}var lh=m(d(((e,t)=>{var n=-1,r=1,i=0;function a(e,t,n,r,a){if(e===t)return e?[[i,e]]:[];if(n!=null){var s=D(e,t,n);if(s)return s}var c=l(e,t),u=e.substring(0,c);e=e.substring(c),t=t.substring(c),c=d(e,t);var f=e.substring(e.length-c);e=e.substring(0,e.length-c),t=t.substring(0,t.length-c);var m=o(e,t);return u&&m.unshift([i,u]),f&&m.push([i,f]),b(m,a),r&&p(m),m}function o(e,t){var o;if(!e)return[[r,t]];if(!t)return[[n,e]];var c=e.length>t.length?e:t,l=e.length>t.length?t:e,u=c.indexOf(l);if(u!==-1)return o=[[r,c.substring(0,u)],[i,l],[r,c.substring(u+l.length)]],e.length>t.length&&(o[0][0]=o[2][0]=n),o;if(l.length===1)return[[n,e],[r,t]];var d=f(e,t);if(d){var p=d[0],m=d[1],h=d[2],g=d[3],_=d[4],v=a(p,h),y=a(m,g);return v.concat([[i,_]],y)}return s(e,t)}function s(e,t){for(var i=e.length,a=t.length,o=Math.ceil((i+a)/2),s=o,l=2*o,u=Array(l),d=Array(l),f=0;f<l;f++)u[f]=-1,d[f]=-1;u[s+1]=0,d[s+1]=0;for(var p=i-a,m=p%2!=0,h=0,g=0,_=0,v=0,y=0;y<o;y++){for(var b=-y+h;b<=y-g;b+=2){for(var x=s+b,S=b===-y||b!==y&&u[x-1]<u[x+1]?u[x+1]:u[x-1]+1,C=S-b;S<i&&C<a&&e.charAt(S)===t.charAt(C);)S++,C++;if(u[x]=S,S>i)g+=2;else if(C>a)h+=2;else if(m){var w=s+p-b;if(w>=0&&w<l&&d[w]!==-1){var T=i-d[w];if(S>=T)return c(e,t,S,C)}}}for(var E=-y+_;E<=y-v;E+=2){for(var w=s+E,T=E===-y||E!==y&&d[w-1]<d[w+1]?d[w+1]:d[w-1]+1,D=T-E;T<i&&D<a&&e.charAt(i-T-1)===t.charAt(a-D-1);)T++,D++;if(d[w]=T,T>i)v+=2;else if(D>a)_+=2;else if(!m){var x=s+p-E;if(x>=0&&x<l&&u[x]!==-1){var S=u[x],C=s+S-x;if(T=i-T,S>=T)return c(e,t,S,C)}}}}return[[n,e],[r,t]]}function c(e,t,n,r){var i=e.substring(0,n),o=t.substring(0,r),s=e.substring(n),c=t.substring(r),l=a(i,o),u=a(s,c);return l.concat(u)}function l(e,t){if(!e||!t||e.charAt(0)!==t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(a,i)==t.substring(a,i)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return x(e.charCodeAt(i-1))&&i--,i}function u(e,t){var n=e.length,r=t.length;if(n==0||r==0)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var i=Math.min(n,r);if(e==t)return i;for(var a=0,o=1;;){var s=e.substring(i-o),c=t.indexOf(s);if(c==-1)return a;o+=c,(c==0||e.substring(i-o)==t.substring(0,o))&&(a=o,o++)}}function d(e,t){if(!e||!t||e.slice(-1)!==t.slice(-1))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(e.length-i,e.length-a)==t.substring(t.length-i,t.length-a)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return S(e.charCodeAt(e.length-i))&&i--,i}function f(e,t){var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||r.length*2<n.length)return null;function i(e,t,n){for(var r=e.substring(n,n+Math.floor(e.length/4)),i=-1,a=``,o,s,c,u;(i=t.indexOf(r,i+1))!==-1;){var f=l(e.substring(n),t.substring(i)),p=d(e.substring(0,n),t.substring(0,i));a.length<p+f&&(a=t.substring(i-p,i)+t.substring(i,i+f),o=e.substring(0,n-p),s=e.substring(n+f),c=t.substring(0,i-p),u=t.substring(i+f))}return a.length*2>=e.length?[o,s,c,u,a]:null}var a=i(n,r,Math.ceil(n.length/4)),o=i(n,r,Math.ceil(n.length/2)),s;if(!a&&!o)return null;s=o?a&&a[4].length>o[4].length?a:o:a;var c,u,f,p;e.length>t.length?(c=s[0],u=s[1],f=s[2],p=s[3]):(f=s[0],p=s[1],c=s[2],u=s[3]);var m=s[4];return[c,u,f,p,m]}function p(e){for(var t=!1,a=[],o=0,s=null,c=0,l=0,d=0,f=0,p=0;c<e.length;)e[c][0]==i?(a[o++]=c,l=f,d=p,f=0,p=0,s=e[c][1]):(e[c][0]==r?f+=e[c][1].length:p+=e[c][1].length,s&&s.length<=Math.max(l,d)&&s.length<=Math.max(f,p)&&(e.splice(a[o-1],0,[n,s]),e[a[o-1]+1][0]=r,o--,o--,c=o>0?a[o-1]:-1,l=0,d=0,f=0,p=0,s=null,t=!0)),c++;for(t&&b(e),y(e),c=1;c<e.length;){if(e[c-1][0]==n&&e[c][0]==r){var m=e[c-1][1],h=e[c][1],g=u(m,h),_=u(h,m);g>=_?(g>=m.length/2||g>=h.length/2)&&(e.splice(c,0,[i,h.substring(0,g)]),e[c-1][1]=m.substring(0,m.length-g),e[c+1][1]=h.substring(g),c++):(_>=m.length/2||_>=h.length/2)&&(e.splice(c,0,[i,m.substring(0,_)]),e[c-1][0]=r,e[c-1][1]=h.substring(0,h.length-_),e[c+1][0]=n,e[c+1][1]=m.substring(_),c++),c++}c++}}var m=/[^a-zA-Z0-9]/,h=/\s/,g=/[\r\n]/,_=/\n\r?\n$/,v=/^\r?\n\r?\n/;function y(e){function t(e,t){if(!e||!t)return 6;var n=e.charAt(e.length-1),r=t.charAt(0),i=n.match(m),a=r.match(m),o=i&&n.match(h),s=a&&r.match(h),c=o&&n.match(g),l=s&&r.match(g),u=c&&e.match(_),d=l&&t.match(v);return u||d?5:c||l?4:i&&!o&&s?3:o||s?2:i||a?1:0}for(var n=1;n<e.length-1;){if(e[n-1][0]==i&&e[n+1][0]==i){var r=e[n-1][1],a=e[n][1],o=e[n+1][1],s=d(r,a);if(s){var c=a.substring(a.length-s);r=r.substring(0,r.length-s),a=c+a.substring(0,a.length-s),o=c+o}for(var l=r,u=a,f=o,p=t(r,a)+t(a,o);a.charAt(0)===o.charAt(0);){r+=a.charAt(0),a=a.substring(1)+o.charAt(0),o=o.substring(1);var y=t(r,a)+t(a,o);y>=p&&(p=y,l=r,u=a,f=o)}e[n-1][1]!=l&&(l?e[n-1][1]=l:(e.splice(n-1,1),n--),e[n][1]=u,f?e[n+1][1]=f:(e.splice(n+1,1),n--))}n++}}function b(e,t){e.push([i,``]);for(var a=0,o=0,s=0,c=``,u=``,f;a<e.length;){if(a<e.length-1&&!e[a][1]){e.splice(a,1);continue}switch(e[a][0]){case r:s++,u+=e[a][1],a++;break;case n:o++,c+=e[a][1],a++;break;case i:var p=a-s-o-1;if(t){if(p>=0&&w(e[p][1])){var m=e[p][1].slice(-1);if(e[p][1]=e[p][1].slice(0,-1),c=m+c,u=m+u,!e[p][1]){e.splice(p,1),a--;var h=p-1;e[h]&&e[h][0]===r&&(s++,u=e[h][1]+u,h--),e[h]&&e[h][0]===n&&(o++,c=e[h][1]+c,h--),p=h}}if(C(e[a][1])){var m=e[a][1].charAt(0);e[a][1]=e[a][1].slice(1),c+=m,u+=m}}if(a<e.length-1&&!e[a][1]){e.splice(a,1);break}if(c.length>0||u.length>0){c.length>0&&u.length>0&&(f=l(u,c),f!==0&&(p>=0?e[p][1]+=u.substring(0,f):(e.splice(0,0,[i,u.substring(0,f)]),a++),u=u.substring(f),c=c.substring(f)),f=d(u,c),f!==0&&(e[a][1]=u.substring(u.length-f)+e[a][1],u=u.substring(0,u.length-f),c=c.substring(0,c.length-f)));var g=s+o;c.length===0&&u.length===0?(e.splice(a-g,g),a-=g):c.length===0?(e.splice(a-g,g,[r,u]),a=a-g+1):u.length===0?(e.splice(a-g,g,[n,c]),a=a-g+1):(e.splice(a-g,g,[n,c],[r,u]),a=a-g+2)}a!==0&&e[a-1][0]===i?(e[a-1][1]+=e[a][1],e.splice(a,1)):a++,s=0,o=0,c=``,u=``;break}}e[e.length-1][1]===``&&e.pop();var _=!1;for(a=1;a<e.length-1;)e[a-1][0]===i&&e[a+1][0]===i&&(e[a][1].substring(e[a][1].length-e[a-1][1].length)===e[a-1][1]?(e[a][1]=e[a-1][1]+e[a][1].substring(0,e[a][1].length-e[a-1][1].length),e[a+1][1]=e[a-1][1]+e[a+1][1],e.splice(a-1,1),_=!0):e[a][1].substring(0,e[a+1][1].length)==e[a+1][1]&&(e[a-1][1]+=e[a+1][1],e[a][1]=e[a][1].substring(e[a+1][1].length)+e[a+1][1],e.splice(a+1,1),_=!0)),a++;_&&b(e,t)}function x(e){return e>=55296&&e<=56319}function S(e){return e>=56320&&e<=57343}function C(e){return S(e.charCodeAt(0))}function w(e){return x(e.charCodeAt(e.length-1))}function T(e){for(var t=[],n=0;n<e.length;n++)e[n][1].length>0&&t.push(e[n]);return t}function E(e,t,a,o){return w(e)||C(o)?null:T([[i,e],[n,t],[r,a],[i,o]])}function D(e,t,n){var r=typeof n==`number`?{index:n,length:0}:n.oldRange,i=typeof n==`number`?null:n.newRange,a=e.length,o=t.length;if(r.length===0&&(i===null||i.length===0)){var s=r.index,c=e.slice(0,s),l=e.slice(s),u=i?i.index:null;editBefore:{var d=s+o-a;if(u!==null&&u!==d||d<0||d>o)break editBefore;var f=t.slice(0,d),p=t.slice(d);if(p!==l)break editBefore;var m=Math.min(s,d),h=c.slice(0,m),g=f.slice(0,m);if(h!==g)break editBefore;var _=c.slice(m),v=f.slice(m);return E(h,_,v,l)}editAfter:{if(u!==null&&u!==s)break editAfter;var y=s,f=t.slice(0,y),p=t.slice(y);if(f!==c)break editAfter;var b=Math.min(a-y,o-y),x=l.slice(l.length-b),S=p.slice(p.length-b);if(x!==S)break editAfter;var _=l.slice(0,l.length-b),v=p.slice(0,p.length-b);return E(c,_,v,x)}}if(r.length>0&&i&&i.length===0)replaceRange:{var h=e.slice(0,r.index),x=e.slice(r.index+r.length),m=h.length,b=x.length;if(o<m+b)break replaceRange;var g=t.slice(0,m),S=t.slice(o-b);if(h!==g||x!==S)break replaceRange;var _=e.slice(m,a-b),v=t.slice(m,o-b);return E(h,_,v,x)}return null}function O(e,t,n,r){return a(e,t,n,r,!0)}O.INSERT=r,O.DELETE=n,O.EQUAL=i,t.exports=O}))());function uh(e){var t,n;let{rangeId:r,segmentId:i,documentDataModel:a,insert:o}=e,s=(t=a.getSelfOrHeaderFooterModel(i).getBody())==null||(t=t.customRanges)==null?void 0:t.find(e=>e.rangeId===r);if(!s)return!1;let{startIndex:c,endIndex:l}=s,u=new Q,d=l-c+1;u.push({t:U.RETAIN,len:c}),u.push({t:U.RETAIN,len:d,body:{dataStream:``,customRanges:[]}}),o&&u.push({t:U.INSERT,body:o,len:o.dataStream.length});let f=l+1+((n=o==null?void 0:o.dataStream.length)==null?0:n);return u.selections=[{startOffset:f,endOffset:f,collapsed:!0}],u}function dh(e){let{ranges:t,rangeId:n,rangeType:r,wholeEntity:i,properties:a,body:o}=e,s=0,c=new Q,l=!1;return t.forEach(e=>{var t,u,d;let f=ch(e,o);if(!f||!o)return!1;let{startOffset:p,endOffset:m}=f,h=(t=o.customRanges)==null?[]:t,g=(e,t,o)=>{var l,u,d,f;let p=sh(e,t,h,r),m=Math.min((l=(u=p[0])==null?void 0:u.startIndex)==null?1/0:l,e),g=Math.max((d=(f=p[p.length-1])==null?void 0:f.endIndex)==null?-1/0:d,t),_={rangeId:o?`${n}$${o}`:n,rangeType:r,startIndex:0,endIndex:g-m,wholeEntity:i,properties:{...a}};c.push({t:U.RETAIN,len:m-s}),c.push({t:U.RETAIN,len:g-m+1,body:{dataStream:``,customRanges:[_]},coverType:H.COVER}),s=g+1},_=((u=o.paragraphs)==null?[]:u).filter(e=>e.startIndex<m&&e.startIndex>p),v=((d=o.customBlocks)==null?[]:d).filter(e=>e.startIndex<m&&e.startIndex>p);oh([p,m-1],[..._.map(e=>e.startIndex),...v.map(e=>e.startIndex)]).forEach(([e,t],n)=>g(e,t,n)),l=!0,c.selections=[{startOffset:f.endOffset,endOffset:f.endOffset,collapsed:!0}]}),l?c:!1}function fh(e,t,n=0,r=null,i=!0){e.sort((e,t)=>e.startOffset-t.startOffset);let a=[],{paragraphs:o=[]}=t,s=o==null?void 0:o.find(t=>t.startIndex>=e[0].startOffset&&t.startIndex<e[0].endOffset),c=n;if(e.forEach(e=>{let{startOffset:t,endOffset:n}=e;t>c&&(a.push({t:U.RETAIN,len:t-c}),c=t),c<n&&(a.push({t:U.DELETE,len:n-c}),c=n)}),r&&a.push({t:U.INSERT,body:r,len:r.dataStream.length}),s&&i){let t=o.find(t=>t.startIndex-n>=e[e.length-1].endOffset-1);t&&(t.startIndex>c&&(a.push({t:U.RETAIN,len:t.startIndex-c}),c=t.startIndex),a.push({t:U.RETAIN,len:1,body:{dataStream:``,paragraphs:[{...t,startIndex:0,bullet:s==null?void 0:s.bullet}]},coverType:H.REPLACE}))}return a}function ph(e,t,n=0){let r=[],i=n;return e.forEach(e=>{let{startOffset:n,endOffset:a}=e;n>i&&(r.push({t:U.RETAIN,len:n-i}),i=n),a>i&&(r.push({t:U.RETAIN,len:a-i,body:{...R.deepClone(t),dataStream:``}}),i=a)}),r}let mh=e=>{var t;let{selection:n,body:r,doc:i}=e,a=n.segmentId,o=(t=i.getSelfOrHeaderFooterModel(a))==null?void 0:t.getBody();if(!o)return!1;let s=n.collapsed?null:xm(o,n.startOffset,n.endOffset),c=(0,lh.default)(s?s.dataStream:``,r.dataStream),l=0,u=c.map(([e,t])=>{switch(e){case 0:{let e={t:U.RETAIN,body:{...xm(r,l,l+t.length,!1),dataStream:``},len:t.length};return l+=t.length,e}case 1:{let e={t:U.INSERT,body:xm(r,l,l+t.length),len:t.length};return l+=t.length,e}default:return{t:U.DELETE,len:t.length}}}),d=new Q;return d.push({t:U.RETAIN,len:n.startOffset}),d.push(...u),d};function hh(e,t){return!!((e==null?void 0:e.length)===(t==null?void 0:t.length)&&e!=null&&e.every((e,n)=>JSON.stringify(e)===JSON.stringify(t==null?void 0:t[n])))}let gh=e=>{var t;let{selection:n,body:r,doc:i,themeService:a}=e,o=n.segmentId,s=(t=i.getSelfOrHeaderFooterModel(o))==null?void 0:t.getBody();if(!s)return!1;let c=n.collapsed?null:xm(s,n.startOffset,n.endOffset),l=(0,lh.default)(c?c.dataStream:``,r.dataStream),u=0,d=l.map(([e,t])=>{switch(e){case 0:{let e=gm(r,u,u+t.length,!1),n=gm(c,u,u+t.length,!1),i={t:U.RETAIN,body:hh(e,n)?void 0:{textRuns:e==null?void 0:e.map(e=>{var t,n,r,i;return{...e,ts:{...e.ts,cl:!((t=e.ts)==null||(t=t.cl)==null||(t=t.rgb)==null)&&t.includes(`.`)?{rgb:a.getColorFromTheme((n=(r=e.ts)==null||(r=r.cl)==null?void 0:r.rgb)==null?``:n)}:(i=e.ts)==null?void 0:i.cl}}}),dataStream:``},len:t.length};return u+=t.length,i}case 1:{let e={t:U.INSERT,body:xm(r,u,u+t.length),len:t.length};return u+=t.length,e}default:return{t:U.DELETE,len:t.length}}});if(d.every(e=>e.t===U.RETAIN&&!e.body))return!1;let f=new Q;return f.push({t:U.RETAIN,len:n.startOffset}),f.push(...d),f};function _h(e,t){let n=[],{customBlocks:r=[]}=e;for(let e of t){let{startOffset:t,endOffset:i}=e;if(!(t==null||i==null))for(let e of r){let{startIndex:r}=e;r>=t&&r<i&&n.push(e.blockId)}}return n}function vh(e,t=``){if(!t)return[`body`];let{headers:n,footers:r}=e.getSnapshot();if(n==null&&r==null)throw 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 Error(`Segment id not found in headers or footers`)}let yh=e=>{var t,n;let{selection:r,documentDataModel:i,drawings:a}=e,{collapsed:o,startOffset:s,segmentId:c}=r,l=new Q,u=Wm.getInstance(),d=[],f=i.getSelfOrHeaderFooterModel(c).getBody();if(!f)return!1;let p=(t=(n=i.getSnapshot().drawingsOrder)==null?void 0:n.length)==null?0:t,m=0;if(o)s>0&&l.push({t:U.RETAIN,len:s});else{var h,g;let e=fh([r],f,0,null,!1);l.push(...e);let t=_h(f,[r]),n=(h=i.getDrawings())==null?{}:h,a=(g=i.getDrawingsOrder())==null?[]:g,o=t.sort((e,t)=>a.indexOf(e)>a.indexOf(t)?-1:a.indexOf(e)<a.indexOf(t)?1:0);if(o.length>0)for(let e of o){let t=n[e],r=a.indexOf(e);if(t==null||r<0)continue;let i=u.removeOp([`drawings`,e],t),o=u.removeOp([`drawingsOrder`,r],e);d.push(i),d.push(o),m++}}l.push({t:U.INSERT,body:{dataStream:`\b`.repeat(a.length),customBlocks:a.map((e,t)=>({startIndex:t,blockId:e.drawingId}))},len:a.length});let _=vh(i,c),v=u.editOp(l.serialize(),_);d.push(v);for(let e of a){let{drawingId:t}=e,n=u.insertOp([`drawings`,t],e),r=u.insertOp([`drawingsOrder`,p-m],t);d.push(n),d.push(r)}return d.reduce((e,t)=>Wm.compose(e,t),null)};function bh(e,t){if(t===void 0)return{startOffset:e,endOffset:e,collapsed:!0};if(t<e)throw Error(`Cannot make a doc selection when endOffset ${t} is less than startOffset ${e}.`);return{startOffset:e,endOffset:t,collapsed:e===t}}function xh(e){let{startOffset:t,endOffset:n,collapsed:r}=e;return{startOffset:Math.min(t,n),endOffset:Math.max(t,n),collapsed:r}}function Sh(e,t,n,r){return Math.max(e,n)<=Math.min(t,r)}function Ch(e,t,n,r){let{startOffset:i,endOffset:a}=e,o=r==null?Eh(t,n):r,s=[],c=-1;for(let e=0;e<o.length;e++){let t=o[e],{startIndex:n}=t;(i>c&&i<=n||a>c&&a<=n||n>=i&&n<=a)&&s.push(t),c=n}return s}function wh(e,t,n){let r=[],i=Eh(t,n);for(let a of e){let e=Ch(a,t,n,i);r.push(...e)}return r}let Th=[Km.PARAGRAPH,Km.TABLE_START,Km.TABLE_END,Km.TABLE_ROW_START,Km.TABLE_CELL_START,Km.TABLE_CELL_END];function Eh(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r],{startIndex:a}=i,o=a-1;for(;!Th.includes(t[o])&&o>=0;)o--;n.push({...i,paragraphStart:o+1,paragraphEnd:i.startIndex})}return n}let Dh=e=>{var t,n;let{paragraphs:r,segmentId:i,document:a}=e,o=e.listType,s=(t=(n=a.getSelfOrHeaderFooterModel(i).getBody())==null?void 0:n.paragraphs)==null?[]:t,c=r.every(e=>{var t;return((t=e.bullet)==null?void 0:t.listType.indexOf(o))===0}),l=Ya(6);if(r.length===1){let e=s.indexOf(r[0]),t=s[e-1],n=s[e+1];t&&t.bullet&&t.bullet.listType.indexOf(o)===0?(l=t.bullet.listId,o!==Z.CHECK_LIST&&(o=t.bullet.listType)):n&&n.bullet&&n.bullet.listType.indexOf(o)===0&&(l=n.bullet.listId,o!==Z.CHECK_LIST&&(o=n.bullet.listType))}let u=new Ui;u.reset();let d=new Q;for(let e of r){var f;let{startIndex:t,paragraphStyle:n={},bullet:r}=e;d.push({t:U.RETAIN,len:t-u.cursor}),d.push({t:U.RETAIN,len:1,body:{dataStream:``,paragraphs:[c?{paragraphStyle:n,startIndex:0}:{startIndex:0,paragraphStyle:{...n},bullet:{nestingLevel:(f=r==null?void 0:r.nestingLevel)==null?0:f,textStyle:{fs:20},listType:o,listId:l}}]},coverType:H.REPLACE}),u.moveCursorTo(t+1)}return d},Oh=e=>{var t;let{paragraphIndex:n,segmentId:r,document:i}=e,a=(t=i.getSelfOrHeaderFooterModel(r).getBody())==null?void 0:t.paragraphs;if(a==null)return!1;let o=a.find(e=>e.startIndex===n);if(!(o!=null&&o.bullet)||o.bullet.listType.indexOf(Z.CHECK_LIST)===-1)return!1;let s=new Ui;s.reset();let c=new Q,{startIndex:l,paragraphStyle:u={}}=o,d=o.bullet.listType===Z.CHECK_LIST?Z.CHECK_LIST_CHECKED:Z.CHECK_LIST;return c.push({t:U.RETAIN,len:l-s.cursor}),c.push({t:U.RETAIN,len:1,body:{dataStream:``,paragraphs:[{...o,paragraphStyle:u,startIndex:0,bullet:{...o.bullet,listType:d}}]},coverType:H.REPLACE}),s.moveCursorTo(l+1),c},kh=e=>{var t;let{paragraphs:n,listType:r,segmentId:i,document:a}=e;if(((t=a.getSelfOrHeaderFooterModel(i).getBody())==null?void 0:t.paragraphs)==null)return!1;let o=Ya(6),s=new Ui;s.reset();let c=new Q;for(let e of n){var l;let{startIndex:t,paragraphStyle:n={},bullet:i}=e;c.push({t:U.RETAIN,len:t-s.cursor}),c.push({t:U.RETAIN,len:1,body:{dataStream:``,paragraphs:[{startIndex:0,paragraphStyle:n,bullet:{nestingLevel:(l=i==null?void 0:i.nestingLevel)==null?0:l,textStyle:(i==null?void 0:i.listType)===r?i.textStyle:{fs:20},listType:r,listId:o}}]},coverType:H.REPLACE}),s.moveCursorTo(t+1)}return c};function Ah(e,t){return t.some(t=>e.startIndex>t.startIndex&&e.startIndex<t.endIndex)}let jh=e=>{var t,n,r;let{paragraphs:i,document:a,type:o}=e,s=new Ui;s.reset();let c=new Q,l=(t=a.getSnapshot().lists)==null?{}:t,u=(n=(r=a.getBody())==null?void 0:r.tables)==null?[]:n,d={...nm,...l};for(let e of i){let{startIndex:t,paragraphStyle:n={},bullet:r}=e,i=Ah(e,u);if(c.push({t:U.RETAIN,len:t-s.cursor}),r){let e=d[r.listType].nestingLevel.length-1;i&&(e=Math.min(e,2)),c.push({t:U.RETAIN,len:1,body:{dataStream:``,paragraphs:[{startIndex:0,paragraphStyle:{...n},bullet:{...r,nestingLevel:Math.max(Math.min(r.nestingLevel+o,e),0)}}]},coverType:H.REPLACE})}else c.push({t:U.RETAIN,len:1});s.moveCursorTo(t+1)}return c},Mh=e=>{var t,n,r,i;let{textRanges:a,segmentId:o,document:s,style:c,paragraphTextRun:l,cursor:u,deleteLen:d,textX:f}=e,p=s.getSelfOrHeaderFooterModel(o),m=wh(a,(t=(n=p.getBody())==null?void 0:n.paragraphs)==null?[]:t,(r=(i=p.getBody())==null?void 0:i.dataStream)==null?``:r),h=new Ui;u&&h.moveCursorTo(u);let g=f==null?new Q:f;m.sort((e,t)=>e.startIndex-t.startIndex);let _=Math.max(0,m[0].paragraphStart-1);_>h.cursor&&(g.push({t:U.RETAIN,len:_-h.cursor}),h.moveCursorTo(_)),d&&g.push({t:U.DELETE,len:d});for(let e of m){let{startIndex:t,paragraphStyle:n={}}=e,r=t-h.cursor;g.push({t:U.RETAIN,len:r,...l?{body:{dataStream:``,textRuns:[{ts:l,st:0,ed:r}]},coverType:H.REPLACE}:null}),g.push({t:U.RETAIN,len:1,body:{dataStream:``,paragraphs:[{startIndex:0,paragraphStyle:{...n,...c}}]},coverType:H.REPLACE}),h.moveCursorTo(t+1)}return g};var Nh=class{};P(Nh,`customRange`,{add:dh,delete:uh,copyCustomRange:ah,getCustomRangesInterestsWithSelection:ih,isIntersecting:rh}),P(Nh,`customDecoration`,{add:th,delete:nh}),P(Nh,`selection`,{replace:mh,makeSelection:bh,normalizeSelection:xh,delete:fh,replaceTextRuns:gh,retain:ph}),P(Nh,`range`,{isIntersects:Sh,getParagraphsInRange:Ch,getParagraphsInRanges:wh}),P(Nh,`transform`,{getPlainText:Ym,fromPlainText:Zm,isEmptyDocument:Xm}),P(Nh,`paragraph`,{bullet:{set:kh,switch:Dh,toggleChecklist:Oh,changeNestLevel:jh},style:{set:Mh},util:{transform:Eh,getParagraphsInRange:Ch,getParagraphsInRanges:wh}}),P(Nh,`drawing`,{add:yh});function Ph(e,t,n,r){if(t===``)return e;let i=new eh({id:`mock-id`,body:e,documentStyle:{}}),a=t.length,o;for(;(o=(r?i.getBody().dataStream:i.getBody().dataStream.toLowerCase()).indexOf(t))>=0;){let e=new Q,t=Wm.getInstance();if(o>0&&e.retain(o),n.length>0){var s;let t=i.sliceBody(o,o+a),r={dataStream:n};Array.isArray(t==null?void 0:t.textRuns)&&t.textRuns.length&&(r.textRuns=[{...t.textRuns[0],st:0,ed:n.length}]),!(t==null||(s=t.customRanges)==null)&&s.length&&(r.customRanges=[{...t.customRanges[0],startIndex:0,endIndex:n.length-1}]),e.insert(n.length,r)}e.delete(a),i.apply(t.editOp(e.serialize()))}let c=i.getBody();return i.dispose(),c}function Fh(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 Ih(e){var t;return e.body=Fh((t=e.body)==null?{dataStream:``}:t),e.drawingsOrder||(e.drawingsOrder=[]),e.drawings||(e.drawings={}),e.documentStyle||(e.documentStyle={}),e}var Lh=class e{static create(t={}){return new e(t)}constructor(e={}){P(this,`_style`,void 0),this._style=e}get fontFamily(){return this._style.ff}get fontSize(){return this._style.fs}get italic(){return this._style.it===B.TRUE}get bold(){return this._style.bl===B.TRUE}get underline(){return this._style.ul&&zh.create(this._style.ul)}get bottomBorderLine(){return this._style.bbl&&zh.create(this._style.bbl)}get strikethrough(){return this._style.st&&zh.create(this._style.st)}get overline(){return this._style.ol&&zh.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 Rh.create(R.deepClone(this._style))}getValue(){return{...this._style}}},Rh=class e extends Lh{static create(t={}){return new e(t)}constructor(e={}){super(e)}setFontFamily(e){return this._style.ff=e,this}setFontSize(e){return this._style.fs=e,this}setItalic(e){return this._style.it=e?1:0,this}setBold(e){return this._style.bl=e?1:0,this}setUnderline(e){return this._style.ul=e.build(),this}setBottomBorderLine(e){return this._style.bbl=e.build(),this}setStrikethrough(e){return this._style.st=e.build(),this}setOverline(e){return this._style.ol=e.build(),this}setBackground(e){return this._style.bg=e,this}setBorder(e){return this._style.bd=e,this}setColor(e){return this._style.cl=e,this}setVerticalAlign(e){return this._style.va=e,this}copy(){return e.create(R.deepClone(this._style))}build(){return this.getValue()}},zh=class e{static create(t={s:1}){return new e(t)}constructor(e={s:1}){P(this,`_decoration`,void 0),this._decoration=e}get show(){return this._decoration.s===B.TRUE}get followFontColor(){return this._decoration.c===B.TRUE}get color(){return this._decoration.cl}get type(){return this._decoration.t}setShow(e){return this._decoration.s=e?1:0,this}setFollowFontColor(e){return this._decoration.c=e?1:0,this}setColor(e){return this._decoration.cl=e,this}setLineType(e){return this._decoration.t=e,this}copy(){return e.create(R.deepClone(this._decoration))}build(){return{...this._decoration}}},Bh=class e{static create(t={}){return new e(t)}constructor(e={}){P(this,`_style`,void 0),this._style=e}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===B.TRUE}get keepNext(){return this._style.keepNext===B.TRUE}get wordWrap(){return this._style.wordWrap===B.TRUE}get widowControl(){return this._style.widowControl===B.TRUE}get shading(){return this._style.shading}get suppressHyphenation(){return this._style.suppressHyphenation===B.TRUE}copy(){return Vh.create(R.deepClone(this._style))}getValue(){return this._style}},Vh=class e extends Bh{static create(t={}){return new e(t)}constructor(e={}){super(e)}setIndentFirstLine(e){return this._style.indentFirstLine=e,this}setHanging(e){return this._style.hanging=e,this}setIndentStart(e){return this._style.indentStart=e,this}setTabStops(e){return this._style.tabStops=e,this}setIndentEnd(e){return this._style.indentEnd=e,this}setTextStyle(e){return this._style.textStyle=e,this}setHeadingId(e){return this._style.headingId=e,this}setNamedStyleType(e){return this._style.namedStyleType=e,this}setHorizontalAlign(e){return this._style.horizontalAlign=e,this}setLineSpacing(e){return this._style.lineSpacing=e,this}setDirection(e){return this._style.direction=e,this}setSpacingRule(e){return this._style.spacingRule=e,this}setSnapToGrid(e){return this._style.snapToGrid=e?1:0,this}setSpaceAbove(e){return this._style.spaceAbove=e,this}setSpaceBelow(e){return this._style.spaceBelow=e,this}setBorderBetween(e){return this._style.borderBetween=e,this}setBorderTop(e){return this._style.borderTop=e,this}setBorderBottom(e){return this._style.borderBottom=e,this}setBorderLeft(e){return this._style.borderLeft=e,this}setBorderRight(e){return this._style.borderRight=e,this}setKeepLines(e){return this._style.keepLines=e?1:0,this}setKeepNext(e){return this._style.keepNext=e?1:0,this}setWordWrap(e){return this._style.wordWrap=e?1:0,this}setWidowControl(e){return this._style.widowControl=e?1:0,this}setShading(e){return this._style.shading=e,this}setSuppressHyphenation(e){return this._style.suppressHyphenation=e?1:0,this}copy(){return e.create(R.deepClone(this._style))}build(){return this.getValue()}},Hh=class e{static create(t){return new e(t)}static createByBody(t){return new e({body:t,id:`d`,documentStyle:{}})}constructor(e){if(P(this,`_data`,void 0),!e.body)throw Error(`Invalid document data, body is required`);this._data=Ih(e)}copy(){return Uh.create(R.deepClone(this._data))}slice(e,t){let{body:n,...r}=this._data;return Uh.create({...R.deepClone(r),body:xm(n,e,t)})}toPlainText(){var e,t;return Nh.transform.getPlainText((e=(t=this._data.body)==null?void 0:t.dataStream)==null?``:e).replaceAll(`\r`,`
6
+ `)}getParagraphStyle(){var e;return Bh.create((e=this._data.body)==null||(e=e.paragraphs)==null?void 0:e[0].paragraphStyle)}getParagraphBullet(){var e;return(e=this._data.body)==null||(e=e.paragraphs)==null?void 0:e[0].bullet}getParagraphs(){var e,t;let n=(e=(t=this._data.body)==null?void 0:t.paragraphs)==null?[]:e,r=0;return n.map(e=>{let t=this.slice(r,e.startIndex);return r=e.startIndex,t})}getTextRuns(){var e,t;return((e=(t=this._data.body)==null?void 0:t.textRuns)==null?[]:e).map(e=>({...e,ts:e.ts?Lh.create(e.ts):null}))}getLinks(){var e,t;return(e=(t=this._data.body)==null||(t=t.customRanges)==null?void 0:t.filter(e=>e.rangeType===Po.HYPERLINK))==null?[]:e}getData(){return this._data}},Uh=class e extends Hh{static newEmptyData(){return Ih({id:`d`,documentStyle:{},drawings:{},drawingsOrder:[],body:{dataStream:`\r
7
+ `,customBlocks:[],customRanges:[],paragraphs:[{startIndex:0}],textRuns:[],tables:[],sectionBreaks:[]}})}static create(t){return new e(t==null?e.newEmptyData():t)}constructor(e){super(e),P(this,`_doc`,void 0),this._doc=new eh(e)}insertText(e,t,n){var r,i;let a=((r=(i=this._data.body)==null?void 0:i.dataStream.length)==null?2:r)-2,o,s;if(typeof e==`string`?o=e:(a=Math.min(e,a),o=t),s=typeof t==`object`?t instanceof Rh?t.build():t:n instanceof Rh?n.build():n,!o)return this;let c={dataStream:o,textRuns:s?[{ts:s,st:a,ed:a+o.length}]:[]},l=Nh.selection.replace({doc:this._doc,selection:{startOffset:a,endOffset:a,collapsed:!0},body:c});if(!l)throw Error(`Insert text failed, please check.`);return Q.apply(this._doc.getBody(),l.serialize()),this}insertRichText(e,t){var n,r;let i=((n=(r=this._data.body)==null?void 0:r.dataStream.length)==null?2:n)-2,a;typeof e==`object`?a=e instanceof Hh?e.getData():e:(i=Math.min(e,i),a=t instanceof Hh?t.getData():t);let o=Nh.selection.replace({doc:this._doc,selection:{startOffset:i,endOffset:i,collapsed:!0},body:a.body});if(!o)throw Error(`Insert text failed, please check.`);return Q.apply(this._doc.getBody(),o.serialize()),this}delete(e,t){if(t!==void 0){if(!t)return this;let n=Nh.selection.delete([{startOffset:e,endOffset:e+t,collapsed:!0}],this._data.body);Q.apply(this._doc.getBody(),n)}return this}setStyle(e,t,n){let r={dataStream:``,textRuns:[{ts:n instanceof Rh?n.build():n,st:0,ed:t-e}]},i=Nh.selection.retain([{startOffset:e,endOffset:t,collapsed:!0}],r);return Q.apply(this._doc.getBody(),i),this}setLink(e,t,n){let r=Nh.customRange.add({rangeType:Po.HYPERLINK,rangeId:Ya(),properties:{url:n},ranges:[{startOffset:e,endOffset:t,collapsed:!1}],body:this._data.body});if(!r)throw Error(`Insert text failed, please check.`);return Q.apply(this._doc.getBody(),r.serialize()),this}cancelLink(e,t){if(typeof e==`string`){let t=Nh.customRange.delete({rangeId:e,documentDataModel:this._doc});if(!t)throw Error(`Insert text failed, please check.`);Q.apply(this._doc.getBody(),t.serialize())}else this.slice(e,t).getLinks().forEach(e=>{let t=Nh.customRange.delete({rangeId:e.rangeId,documentDataModel:this._doc});if(!t)throw Error(`Insert text failed, please check.`);Q.apply(this._doc.getBody(),t.serialize())});return this}updateLink(e,t){var n;let r=(n=this._data.body)==null||(n=n.customRanges)==null?void 0:n.find(t=>t.rangeId===e);if(!r)throw Error(`Link not found`);return r.properties.url=t,this}insertParagraph(e,t){let n,r;if(typeof e==`object`){var i,a;n={dataStream:`\r`,paragraphs:[{startIndex:0,paragraphStyle:e.build()}]},r=((i=(a=this._data.body)==null?void 0:a.dataStream.length)==null?2:i)-2}else r=e,n={dataStream:`\r`,paragraphs:[{startIndex:0,paragraphStyle:t==null?void 0:t.build()}]};return this.insertRichText(r,Hh.create({body:n,id:`d`,documentStyle:{}})),this}insertLink(t,n,r){let i=``,a=``;typeof t==`string`?(i=t,a=n):(i=n,a=r);let o=e.createByBody({dataStream:i,customRanges:[{rangeType:Po.HYPERLINK,rangeId:Ya(),properties:{url:a},startIndex:0,endIndex:i.length-1}]});return typeof t==`number`?this.insertRichText(t,o):this.insertRichText(o)}},Wh=class{constructor(){P(this,`skipNextObservers`,!1),P(this,`lastReturnValue`,void 0),P(this,`isStopPropagation`,!1)}stopPropagation(){this.isStopPropagation=!0}},Gh=class extends n.Subject{constructor(...e){super(...e),P(this,`_sortedObservers`,[])}unsubscribe(){super.unsubscribe(),this._sortedObservers.length=0}complete(){super.complete(),this._sortedObservers.length=0}subscribeEvent(e){let t;t=typeof e==`function`?{next:([t,n])=>e(t,n)}:e;let n=super.subscribe(t);return this._sortedObservers.push(t),this._sortedObservers.sort((e,t)=>{var n,r;return((n=e.priority)==null?0:n)-((r=t.priority)==null?0:r)}),n.add(()=>this._sortedObservers=this._sortedObservers.filter(e=>e!==t)),n}clearObservers(){this._sortedObservers.forEach(e=>{var t;return(t=e.complete)==null?void 0:t.call(e)}),this._sortedObservers.length=0}emitEvent(e){if(!this.closed){let n=new Wh;n.lastReturnValue=e;for(let r of this._sortedObservers){var t;if(n.lastReturnValue=(t=r.next)==null?void 0:t.call(r,[e,n]),n.skipNextObservers)return{handled:!0,lastReturnValue:n.lastReturnValue,stopPropagation:n.isStopPropagation}}return{handled:this._sortedObservers.length>0,lastReturnValue:n.lastReturnValue,stopPropagation:n.isStopPropagation}}throw Error(`[EventSubject]: cannot emit event on a closed subject.`)}};function Kh(e){return new n.Observable(t=>{let n=e.subscribeEvent(e=>{t.next(e)});return()=>n.unsubscribe()})}let qh=(0,t.createIdentifier)(`core.resource-manager.service`),Jh={[L.Editor]:`Editor`,[L.Owner]:`Owner`,[L.Reader]:`Reader`,[L.UNRECOGNIZED]:`UNRECOGNIZED`},Yh=e=>e?{userID:`${Jh[e]}_${Ya(8)}`,name:Jh[e],avatar:``}:{userID:``,name:``,avatar:``,anonymous:!0,canBindAnonymous:!1},Xh=(e,t)=>e.startsWith(Jh[t]);var Zh=class extends ra{constructor(...e){super(...e),P(this,`_model`,new Map),P(this,`_userChange$`,new n.Subject),P(this,`userChange$`,this._userChange$.asObservable()),P(this,`_currentUser$`,new n.BehaviorSubject(Yh())),P(this,`currentUser$`,this._currentUser$.asObservable())}dispose(){super.dispose(),this._model.clear(),this._userChange$.complete(),this._currentUser$.complete()}getCurrentUser(){return this._currentUser$.getValue()}setCurrentUser(e){this.addUser(e),this._currentUser$.next(e)}addUser(e){this._model.set(e.userID,e),this._userChange$.next({type:`add`,user:e})}getUser(e,t){let n=this._model.get(e);if(n)return n;t&&t()}delete(e){let t=this.getUser(e);this._model.delete(e),t&&this._userChange$.next({type:`delete`,user:t})}clear(){this._model.clear(),this._userChange$.next({type:`clear`})}list(){return Array.from(this._model.values())}};let Qh=class{constructor(e,t){this._resourceManagerService=e,this._userManagerService=t,P(this,`_permissionMap`,new Map([])),P(this,`_permissionOverrides`,new Map),this._initSnapshot(),this._initDefaultUser()}_initDefaultUser(){let e=this._userManagerService.getCurrentUser();e&&e.userID||this._userManagerService.setCurrentUser(Yh(L.Owner))}_getRole(e){let t=this._userManagerService.getCurrentUser();return t?Xh(t.userID,e):!1}_initSnapshot(){this._resourceManagerService.registerPluginResource({toJson:e=>{let t=[...this._permissionMap.keys()].reduce((e,t)=>(e[t]=this._permissionMap.get(t),e),{});return JSON.stringify(t)},parseJson:e=>JSON.parse(e),pluginName:`SHEET_AuthzIoMockService_PLUGIN`,businesses:[I.UNIVER_SHEET,I.UNIVER_DOC,I.UNIVER_SLIDE],onLoad:(e,t)=>{for(let e in t)this._permissionMap.set(e,t[e])},onUnLoad:()=>{this._permissionMap.clear()}})}async create(e){let t=Ya(8),{objectType:n,selectRangeObject:r,worksheetObject:i}=e,a=r||i,o={objectType:n,unitID:(a==null?void 0:a.unitID)||``,name:(a==null?void 0:a.name)||``,strategies:[{action:6,role:L.Owner},{action:16,role:L.Owner},{action:17,role:L.Owner},{action:18,role:L.Owner},{action:19,role:L.Owner},{action:33,role:L.Owner},{action:34,role:L.Owner},{action:35,role:L.Owner},{action:36,role:L.Owner},{action:37,role:L.Owner},{action:38,role:L.Owner},{action:39,role:L.Owner},{action:40,role:L.Owner}],selectRangeObject:r};return this._permissionMap.set(t,o),t}async allowed(e){let{objectID:t,actions:n}=e,r=this._permissionMap.get(t);return r?n.map(e=>{let n=`${t}:${e}`;if(this._permissionOverrides.has(n))return{action:e,allowed:this._permissionOverrides.get(n)};let i=r.strategies.find(t=>t.action===e);return i?{action:e,allowed:this._getRole(i.role)}:{action:e,allowed:this._getRole(L.Owner)||this._getRole(L.Editor)}}):n.map(e=>({action:e,allowed:this._getRole(L.Owner)||this._getRole(L.Editor)}))}async batchAllowed(e){let t=await Promise.all(e.map(e=>this.allowed(e)));return e.map((e,n)=>({unitID:e.unitID,objectID:e.objectID,actions:t[n]}))}async list(e){let t=[],n=[{action:6,role:L.Owner},{action:16,role:L.Owner},{action:17,role:L.Owner},{action:18,role:L.Owner},{action:19,role:L.Owner},{action:33,role:L.Owner},{action:34,role:L.Owner},{action:35,role:L.Owner},{action:36,role:L.Owner},{action:37,role:L.Owner},{action:38,role:L.Owner},{action:39,role:L.Owner},{action:40,role:L.Owner}];return e.objectIDs.forEach(r=>{let i=this._permissionMap.get(r),a=(i==null?void 0:i.strategies)||n,o={objectID:r,unitID:e.unitID,objectType:(i==null?void 0:i.objectType)||3,name:(i==null?void 0:i.name)||``,shareOn:!1,shareRole:L.Owner,shareScope:-1,scope:{read:pa.AllCollaborator,edit:pa.AllCollaborator},creator:Yh(L.Owner),strategies:a.map(e=>({action:e.action,role:e.role})),actions:e.actions.map(e=>{let t=`${r}:${e}`;if(this._permissionOverrides.has(t))return{action:e,allowed:this._permissionOverrides.get(t)};let n=a.find(t=>t.action===e);return n?{action:e,allowed:this._getRole(n.role)}:{action:e,allowed:this._getRole(L.Owner)||this._getRole(L.Editor)}})};t.push(o)}),t}async listCollaborators(){return[]}async listRoles(){return{roles:[],actions:[]}}async deleteCollaborator(){}async update(e){let{objectID:t,strategies:n}=e,r=this._permissionMap.get(t);r&&n&&(r.strategies=n.map(e=>({action:e.action,role:e.role})),this._permissionMap.set(t,r),n.forEach(e=>{e.role===L.Reader?this.setPermissionOverride(t,e.action,!1):(e.role===L.Owner||e.role===L.Editor)&&this.clearPermissionOverride(t,e.action)}))}setPermissionOverride(e,t,n){let r=`${e}:${t}`;this._permissionOverrides.set(r,n)}clearPermissionOverride(e,t){let n=`${e}:${t}`;this._permissionOverrides.delete(n)}clearAllOverrides(e){let t=[];this._permissionOverrides.forEach((n,r)=>{r.startsWith(`${e}:`)&&t.push(r)}),t.forEach(e=>this._permissionOverrides.delete(e))}async updateCollaborator(){}async createCollaborator(){}async putCollaborators(e){}};Qh=Fs([W(0,qh),W(1,(0,t.Inject)(Zh))],Qh);let $h=(0,t.createIdentifier)(`IAuthzIoIoService`),eg=(0,t.createIdentifier)(`univer.confirm-service`);var tg=class{constructor(){P(this,`confirmOptions$`,new n.Subject)}dispose(){this.confirmOptions$.complete()}open(e){throw Error(`This is not implemented in the test service!`)}confirm(e){return Promise.resolve(!0)}close(e){throw Error(`This is not implemented in the test service!`)}};let ng=`FOCUSING_UNIT`,rg=`FOCUSING_SHEET`,ig=`FOCUSING_DOC`,ag=`FOCUSING_SLIDE`,og=`EDITOR_ACTIVATED`,sg=`FOCUSING_FX_BAR_EDITOR`;var cg=class extends ra{constructor(...e){super(...e),P(this,`_error$`,new n.Subject),P(this,`error$`,this._error$.asObservable())}dispose(){this._error$.complete()}emit(e){this._error$.next({errorKey:e})}};let lg=function(e){return e.URL=`URL`,e.UUID=`UUID`,e.BASE64=`BASE64`,e}({}),ug=function(e){return e.SUCCUSS=`0`,e.ERROR_EXCEED_SIZE=`1`,e.ERROR_IMAGE_TYPE=`2`,e.ERROR_UPLOAD_COUNT_LIMIT=`3`,e.ERROR_IMAGE=`4`,e}({}),dg=(0,t.createIdentifier)(`core.image-io.service`),fg=(0,t.createIdentifier)(`core.url-image.service`);var pg=`@univerjs/core`,mg=`0.18.0`;function hg(e=``,t=uo.ZH_CN,n=``){return{id:e,sheetOrder:[],name:n,appVersion:mg,locale:t,styles:{},sheets:{},resources:[]}}var gg=class{constructor(e={}){P(this,`_styles`,void 0),P(this,`_cacheMap`,new wf(1e5)),this._styles=e,this._generateCacheMap()}each(e){return Object.entries(this._styles).forEach(e),this}search(e,t){return this._cacheMap.has(t)?this._cacheMap.get(t):this._getExistingStyleId(e)||`-1`}get(e){return typeof e==`string`?(e=String(e),this._styles[e]):e}add(e,t){let n=Ya(6);return this._styles[n]=e,this._cacheMap.set(t,n),n}setValue(e){if(e==null)return;let t=JSON.stringify(e),n=this.search(e,t);return n===`-1`?this.add(e,t):n}addCustomStyle(e,t){t!=null&&(this._styles[e]=t,this._cacheMap.set(JSON.stringify(t),e))}remove(e){let t=this._styles[e];t&&(delete this._styles[e],this._cacheMap.delete(JSON.stringify(t)))}toJSON(){return this._styles}getStyleByCell(e){let t;t=e&&R.isObject(e.s)?e.s:(e==null?void 0:e.s)&&this.get(e.s);let n=e==null?void 0:e.interceptorStyle;return n?{...t,...n}:t}_generateCacheMap(){let{_styles:e,_cacheMap:t}=this;for(let n in e){let r=JSON.stringify(e[n]);t.set(r,n)}}_getExistingStyleId(e){let{_styles:t}=this;for(let n in t)if(R.diffValue(t[n],e))return n;return null}};let _g=(e,t)=>t.length===e.length&&!e.some(e=>t.some(t=>!_p.equals(t,e))),vg=(e,t)=>t.length===e.length&&e.every((e,n)=>{let r=t[n];return r.unitId===e.unitId&&r.sheetId===e.sheetId&&_p.equals(e.range,r.range)}),yg={t:0,b:2,l:2,r:2},bg=e=>({sbr:.6,sbo:e,spr:.6,spo:e});function xg(e,t,n={}){let r=e.length,{textRotation:i,paddingData:a,horizontalAlign:o=So.UNSPECIFIED,verticalAlign:s=Co.UNSPECIFIED,wrapStrategy:c=wo.UNSPECIFIED,cellValueType:l}=n,{t:u,r:d,b:f,l:p}=a||yg,{vertexAngle:m,centerAngle:h}=kg(i);return new eh({id:`d`,body:{dataStream:`${e}\r
8
+ `,textRuns:[{ts:t,st:0,ed:r}],paragraphs:[{startIndex:r,paragraphStyle:{horizontalAlign:o}}],sectionBreaks:[{startIndex:r+1}]},documentStyle:{pageSize:{width:1/0,height:1/0},marginTop:u,marginBottom:f,marginRight:d,marginLeft:p,renderConfig:{horizontalAlign:o,verticalAlign:s,centerAngle:h,vertexAngle:m,wrapStrategy:c,cellValueType:l}},drawings:{},drawingsOrder:[]})}function Sg(e){if(!e)return{};let{tr:t,td:n,ht:r,vt:i,tb:a,pd:o}=e;return{textRotation:t,textDirection:n,horizontalAlign:r,verticalAlign:i,wrapStrategy:a,paddingData:o}}function Cg(e){if(!e)return{};let{ff:t,fs:n,it:r,bl:i,ul:a,st:o,ol:s,cl:c}=e,l={};return t&&(l.ff=t),n&&(l.fs=n),r&&(l.it=r),i&&(l.bl=i),a&&(l.ul=a),o&&(l.st=o),s&&(l.ol=s),c&&(l.cl=c),l}function wg(e,t,n){var r;let i=e.getBody();if((r=i.customRanges)!=null&&r.some(e=>e.rangeType===Po.HYPERLINK))return;let a=Nh.customRange.add({ranges:[{startOffset:0,endOffset:i.dataStream.length-1,collapsed:!1}],rangeId:n,rangeType:Po.HYPERLINK,body:i,properties:{url:t,refId:n}});a&&Q.apply(i,a.serialize())}function Tg(e){return e!=null}function Eg(){return{p:null,s:null,v:null,t:null,f:null,si:null,ref:null,xf:null}}function Dg(e){let t=Nf.ff,n=Nf.fs;if(!e){let e=`${n}pt ${t}`;return{fontCache:e,fontString:e,fontSize:n,originFontSize:n,fontFamily:t}}let r=ts.ITALIC;(e.it===0||e.it===void 0)&&(r=ts.NORMAL);let i=ts.BOLD;(e.bl===0||e.bl===void 0)&&(i=ts.NORMAL);let a=n;e.fs&&(a=Math.ceil(e.fs));let o=t;if(e.ff){let n=e.ff;n=n.replace(/"/g,``).replace(/'/g,``),n.indexOf(` `)>-1&&(n=`"${n}"`),n==null&&(n=t),o=n}let{va:s}=e,c=a;if(s===Do.SUBSCRIPT||s===Do.SUPERSCRIPT){let{sbr:e,spr:t}=Og(o,c);c*=s===Do.SUBSCRIPT?e:t}let l=`${r} ${i} ${c}pt ${o}`;return{fontCache:l,fontString:`${l}, "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif `,fontSize:c,originFontSize:a,fontFamily:o}}function Og(e,t){return bg(t)}function kg(e){let{a:t=0,v:n=B.FALSE}=e||{a:0,v:B.FALSE},r=0,i=t;return n===B.TRUE&&(r=90,i=90),{centerAngle:r,vertexAngle:i}}function Ag(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e)){let t=e.length,n=Array(t);for(let r=0;r<t;r++)n[r]=Ag(e[r]);return n}let t={},n=Object.keys(e);for(let r=0,i=n.length;r<i;r++){let i=n[r];t[i]=Ag(e[i])}return t}function jg(e){if(e==null)return e;let t={};return e.p!==void 0&&(t.p=e.p===null?null:Ag(e.p)),e.s!==void 0&&(e.s===null||typeof e.s==`string`?t.s=e.s:t.s=Ag(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:Ag(e.custom)),t}function Mg(e){if(e==null)return e;let t={};return e.p!==void 0&&(t.p=e.p===null?null:Ag(e.p)),e.s!==void 0&&(e.s===null||typeof e.s==`string`?t.s=e.s:t.s=Ag(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:Ag(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 Ng(e){let t={},n=Object.keys(e);for(let r=0,i=n.length;r<i;r++){let i=n[r],a=Number(i),o=e[a];if(o===void 0)continue;let s={},c=Object.keys(o);for(let e=0,t=c.length;e<t;e++){let t=c[e],n=Number(t),r=o[n];r!=null&&(s[n]=jg(r))}t[a]=s}return t}function Pg(e){let t={},n=Object.keys(e);for(let r=0,i=n.length;r<i;r++){let i=n[r],a=Number(i),o=e[a];if(o===void 0)continue;let s={};`h`in o&&o.h!==void 0&&(s.h=o.h),`ia`in o&&o.ia!==void 0&&(s.ia=o.ia),`ah`in o&&o.ah!==void 0&&(s.ah=o.ah),`hd`in o&&o.hd!==void 0&&(s.hd=o.hd),`w`in o&&o.w!==void 0&&(s.w=o.w),`s`in o&&o.s!==void 0&&(o.s===null||typeof o.s==`string`?s.s=o.s:s.s=Ag(o.s)),`custom`in o&&o.custom!==void 0&&(s.custom=o.custom===null?null:Ag(o.custom)),t[a]=s}return t}function Fg(e){let t=e.length,n=Array(t);for(let r=0;r<t;r++){let t=e[r];n[r]={startRow:t.startRow,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn,rangeType:t.rangeType,startAbsoluteRefType:t.startAbsoluteRefType,endAbsoluteRefType:t.endAbsoluteRefType}}return n}function Ig(e){let 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:Fg(e.mergeData),cellData:Ng(e.cellData),rowData:Pg(e.rowData),columnData:Pg(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=Ag(e.defaultStyle)),e.custom!==void 0&&(t.custom=e.custom===null?null:Ag(e.custom)),t}var Lg=class{constructor(e,t){this._config=e,P(this,`_columnData`,{}),this._columnData=t}getColumnData(){return this._columnData}getColVisible(e){let{_columnData:t}=this,n=t[e];return n?n.hd!==B.TRUE:!0}getColumnStyle(e){var t;return(t=this._columnData[e])==null?void 0:t.s}setColumnStyle(e,t){let n=this.getColumnOrCreate(e);n.s=t}getHiddenCols(e=0,t=this.getSize()-1){let n=[],r=!1,i=-1;for(let a=e;a<=t;a++){let e=this.getColVisible(a);r&&e?(r=!1,n.push({rangeType:G.COLUMN,startColumn:i,endColumn:a-1,startRow:0,endRow:0})):!r&&!e&&(r=!0,i=a)}return r&&n.push({startRow:0,endRow:0,startColumn:i,endColumn:t,rangeType:G.COLUMN}),n}getVisibleCols(e=0,t=this.getSize()-1){let n=[],r=!1,i=-1;for(let a=e;a<=t;a++){let e=this.getColVisible(a);r&&!e?(r=!1,n.push({rangeType:G.COLUMN,startColumn:i,endColumn:a-1,startRow:0,endRow:0})):!r&&e&&(r=!0,i=a)}return r&&n.push({startRow:0,endRow:0,startColumn:i,endColumn:t,rangeType:G.COLUMN}),n}getColumnDatas(e,t){let n={},r=0;for(let i=e;i<e+t;i++){let e=this.getColumn(i);n[r]=e==null?{w:this._config.defaultColumnWidth,hd:B.FALSE}:e,r++}return n}getSize(){return ud(this._columnData)}getColumnWidth(e){var t,n;return(t=(n=this._columnData[e])==null?void 0:n.w)==null?this._config.defaultColumnWidth:t}setColumnWidth(e,t){let n=this._columnData[e];t===this._config.defaultColumnWidth?n&&(delete n.w,Object.keys(n).length===0&&delete this._columnData[e]):this._columnData[e]=n?{...n,w:t}:{w:t}}getColumn(e){return this._columnData[e]}insertColumnsWithData(e,t,n){let r=t-e+1,i=Object.keys(this._columnData);for(let t=i.length-1;t>=0;t--){let n=Number(i[t]);n>=e&&(this._columnData[n+r]=this._columnData[n],delete this._columnData[n])}for(let r=e;r<=t;r++){let t=n==null?void 0:n[r-e];t!=null&&Object.keys(t).length>0&&(this._columnData[r]={...t})}}removeColumn(e){delete this._columnData[e]}getColumnOrCreate(e){let{_columnData:t}=this,n=t[e];if(n)return n;let r={};return this._columnData[e]=r,r}setCustomMetadata(e,t){let n=this.getColumn(e);n&&(n.custom=t)}getCustomMetadata(e){var t;return(t=this.getColumn(e))==null?void 0:t.custom}},Rg=class{constructor(e,t,n){this._config=e,this._viewModel=t,P(this,`_rowData`,void 0),this._rowData=n}getRowData(){return this._rowData}getRowStyle(e){var t;return(t=this._rowData[e])==null?void 0:t.s}setRowStyle(e,t){let n=this.getRowOrCreate(e);n.s=t}getRowDatas(e,t){let n={},r=0;for(let i=e;i<e+t;i++){let e=this.getRow(i);n[r]=e==null?{h:this._config.defaultRowHeight,hd:B.FALSE}:e,r++}return n}getRowHeight(e,t=1){let{_rowData:n}=this,r=this._config,i=0;for(let a=0;a<t;a++){let{ia:t,ah:o,h:s=r.defaultRowHeight}=n[a+e]||{hd:B.FALSE,h:r.defaultRowHeight};i+=(t==null||t===B.TRUE)&&typeof o==`number`?o:s}return i}setRowHeight(e,t){let n=this._rowData[e];if(t===this._config.defaultRowHeight)n&&(delete n.h,Object.keys(n).length===0&&delete this._rowData[e]);else{let r=Math.min(t,2e3);this._rowData[e]=n?{...n,h:r}:{h:r}}}getRow(e){return this._rowData[e]}insertRowsWithData(e,t,n){let r=t-e+1,i=Object.keys(this._rowData);for(let t=i.length-1;t>=0;t--){let n=Number(i[t]);n>=e&&(this._rowData[n+r]=this._rowData[n],delete this._rowData[n])}for(let r=e;r<=t;r++){let t=n==null?void 0:n[r-e];t!=null&&Object.keys(t).length>0&&(this._rowData[r]={...t})}}removeRow(e){delete this._rowData[e]}getRowOrCreate(e){let{_rowData:t}=this,n=t[e];if(n)return n;let r={};return t[e]=r,r}getHiddenRows(e=0,t=this.getSize()-1){let n=[],r=!1,i=-1;for(let a=e;a<=t;a++){let e=this.getRowRawVisible(a);r&&e?(r=!1,n.push({startRow:i,endRow:a-1,startColumn:0,endColumn:0,rangeType:G.ROW})):!r&&!e&&(r=!0,i=a)}return r&&n.push({startRow:i,endRow:t,startColumn:0,endColumn:0,rangeType:G.ROW}),n}getVisibleRows(e=0,t=this.getSize()-1){let n=[],r=!1,i=-1;for(let a=e;a<=t;a++){let e=this.getRowRawVisible(a);r&&!e?(r=!1,n.push({startRow:i,endRow:a-1,startColumn:0,endColumn:0,rangeType:G.ROW})):!r&&e&&(r=!0,i=a)}return r&&n.push({startRow:i,endRow:t,startColumn:0,endColumn:0,rangeType:G.ROW}),n}getRowRawVisible(e){let t=this.getRow(e);return t?t.hd!==B.TRUE:!0}getSize(){return ud(this._rowData)}setCustomMetadata(e,t){let n=this.getRow(e);n&&(n.custom=t)}getCustomMetadata(e){var t;return(t=this.getRow(e))==null?void 0:t.custom}};let zg=1e3;function Bg(e){let t={name:`Sheet1`,id:`sheet-01`,tabColor:``,hidden:B.FALSE,rowCount:zg,columnCount:20,zoomRatio:1,freeze:{xSplit:0,ySplit:0,startRow:-1,startColumn:-1},scrollTop:0,scrollLeft:0,defaultColumnWidth:88,defaultRowHeight:24,mergeData:[],cellData:{},rowData:{},columnData:{},showGridlines:B.TRUE,rowHeader:{width:46,hidden:B.FALSE},columnHeader:{height:20,hidden:B.FALSE},rightToLeft:B.FALSE};return Object.keys(t).forEach(n=>{let r=n;e[r]===void 0&&(e[r]=t[r])}),e}var Vg=class extends ra{constructor(e){super(),P(this,`_cellCache`,new Map),P(this,`_rowCache`,new Map),P(this,`_columnCache`,new Map),P(this,`_hasRow`,!1),P(this,`_hasColumn`,!1),P(this,`_hasAll`,!1),P(this,`_allIndex`,-1),P(this,`_mergeData`,void 0),P(this,`_rangeMap`,new wf(5e4)),this._init(e.concat())}_init(e){this._mergeData=e,this._createCache(e)}_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(e){let t=0;for(let n of e){let{rangeType:e}=n;e===G.ROW?this._createRowCache(n,t):e===G.COLUMN?this._createColumnCache(n,t):e===G.ALL?this._createCellAllCache(t):this._createCellCache(n,t),t++}}rebuild(e){this._clearCache(),this._init(e.concat())}_createRowCache(e,t){let{startRow:n,endRow:r}=e;for(let e=n;e<=r;e++)this._rowCache.set(e,t),this._hasRow=!0}_createColumnCache(e,t){let{startColumn:n,endColumn:r}=e;for(let e=n;e<=r;e++)this._columnCache.set(e,t),this._hasColumn=!0}_createCellAllCache(e){this._hasAll=!0,this._allIndex=e}_createCellCache(e,t){for(let n=e.startRow;n<=e.endRow;n++){let r=this._cellCache.get(n);r==null&&(r=new Map,this._cellCache.set(n,r));for(let n=e.startColumn;n<=e.endColumn;n++)r.set(n,t)}}add(e){this._mergeData.push(e),this._clearCache(),this._createCache(this._mergeData)}remove(e,t){let n=this._getMergeDataIndex(e,t);n!==-1&&(this._mergeData.splice(n,1),this._clearCache(),this._createCache(this._mergeData))}getMergedCell(e,t){let n=this._getMergeDataIndex(e,t);return n===-1?null:this._mergeData[n]}getMergeDataIndex(e,t){return this._getMergeDataIndex(e,t)}isRowContainsMergedCell(e){return this._hasAll||!R.isEmptyObject(this._columnCache)?!0:this._mergeData.some(t=>t.startRow<=e&&e<=t.endRow)}isColumnContainsMergedCell(e){return this._hasAll||!R.isEmptyObject(this._rowCache)?!0:this._mergeData.some(t=>t.startColumn<=e&&e<=t.endColumn)}getMergedCellRange(e,t,n,r){let i=[],a=`${e}-${t}-${n}-${r}`;if(this._rangeMap.has(a))return this._getRangeFromCache(a);let o=0,s=[];for(let a of this._mergeData||[])_p.intersects(a,{startRow:e,endRow:n,startColumn:t,endColumn:r})&&(i.push({...a}),s.push(o)),o++;return this._rangeMap.set(a,s),i}_getRangeFromCache(e){let t=this._rangeMap.get(e)||[],n=[];for(let e of t)n.push({...this._mergeData[e]});return n}_getMergeDataIndex(e,t){var n;if(this._hasAll)return this._allIndex;if(this._hasRow){let t=this._rowCache.get(e);if(t!==void 0)return t}if(this._hasColumn){let e=this._columnCache.get(t);if(e!==void 0)return e}let r=(n=this._cellCache.get(e))==null?void 0:n.get(t);return r===void 0?-1:r}getMergeDataSnapshot(){return this._mergeData}dispose(){this._clearCache(),this._mergeData=[]}},Hg=class extends ra{constructor(e){super(),this.getRawCell=e,P(this,`_cellContentInterceptor`,null),P(this,`_rowFilteredInterceptor`,null)}dispose(){super.dispose(),this._cellContentInterceptor=null,this._rowFilteredInterceptor=null}getCell(e,t,n,r){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(e,t,he.Value|he.Style,n,r):this.getRawCell(e,t)}getCellValueOnly(e,t){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(e,t,he.Value):this.getRawCell(e,t)}getCellStyleOnly(e,t){return this._cellContentInterceptor?this._cellContentInterceptor.getCell(e,t,he.Style):this.getRawCell(e,t)}getRowFiltered(e){var t,n;return(t=(n=this._rowFilteredInterceptor)==null?void 0:n.getRowFiltered(e))==null?!1:t}registerCellContentInterceptor(e){if(this._cellContentInterceptor)throw Error(`[SheetViewModel]: Interceptor already registered.`);return this._cellContentInterceptor=e,ta(()=>this._cellContentInterceptor=null)}registerRowFilteredInterceptor(e){if(this._rowFilteredInterceptor)throw Error(`[SheetViewModel]: Interceptor already registered.`);return this._rowFilteredInterceptor=e,ta(()=>this._rowFilteredInterceptor=null)}};let Ug={isDeepClone:!1,displayRawFormula:!1,ignoreTextRotation:!1};var Wg=class e{constructor(e,t,n){var r;this.unitId=e,this._styles=n,P(this,`_sheetId`,void 0),P(this,`_snapshot`,void 0),P(this,`_cellData`,void 0),P(this,`_rowManager`,void 0),P(this,`_columnManager`,void 0),P(this,`_viewModel`,void 0),P(this,`_spanModel`,void 0),P(this,`_isRowStylePrecedeColumnStyle`,!0),P(this,`_getCellHeight`,void 0),this._snapshot=Bg(t);let{columnData:i,rowData:a,cellData:o}=this._snapshot;this._sheetId=(r=this._snapshot.id)==null?Ya(6):r,this._cellData=new yd(o),this._viewModel=new Hg((e,t)=>this.getCellRaw(e,t)),this._rowManager=new Rg(this._snapshot,this._viewModel,a),this._columnManager=new Lg(this._snapshot,i),this._spanModel=new Vg(this._snapshot.mergeData)}__interceptViewModel(e){e(this._viewModel)}__registerGetCellHeight(e){return this._getCellHeight=e,ta(()=>{this._getCellHeight=null})}getSnapshot(){return this._snapshot}getCellHeight(e,t){return this._getCellHeight?this._getCellHeight(e,t):this._snapshot.defaultRowHeight}setMergeData(e){this._snapshot.mergeData=e,this.getSpanModel().rebuild(e)}getSpanModel(){return this._spanModel}setIsRowStylePrecedeColumnStyle(e){this._isRowStylePrecedeColumnStyle=e}getStyleDataByHash(e){return{...this._styles.get(e)}}setStyleData(e){return this._styles.setValue(e)}getColumnStyle(e,t=!1){return t?this._columnManager.getColumnStyle(e):this._styles.get(this._columnManager.getColumnStyle(e))}setColumnStyle(e,t){this._columnManager.setColumnStyle(e,t)}getRowStyle(e,t=!1){return t?this._rowManager.getRowStyle(e):this._styles.get(this._rowManager.getRowStyle(e))}setRowStyle(e,t){this._rowManager.setRowStyle(e,t)}getDefaultCellStyle(){return this._snapshot.defaultStyle}getDefaultCellStyleInternal(){let e=this._snapshot.defaultStyle;return this._styles.get(e)}setDefaultCellStyle(e){this._snapshot.defaultStyle=e}getCellStyle(e,t){let n=this.getCell(e,t);if(n){let e=n.s;return typeof e==`string`?this._styles.get(e):e}return null}getComposedCellStyle(e,t,n){let r=this.getDefaultCellStyleInternal(),i=this.getRowStyle(e),a=this.getColumnStyle(t),o=this.getCell(e,t),s=this._styles.getStyleByCell(o);return(n==null?this._isRowStylePrecedeColumnStyle:n)?Xa(r,a,i,o==null?void 0:o.themeStyle,s):Xa(r,i,a,o==null?void 0:o.themeStyle,s)}getComposedCellStyleByCellData(e,t,n,r){let i=this.getDefaultCellStyleInternal(),a=this.getRowStyle(e),o=this.getColumnStyle(t),s=this._styles.getStyleByCell(n);return(r==null?this._isRowStylePrecedeColumnStyle:r)?Xa(i,o,a,n==null?void 0:n.themeStyle,s):Xa(i,a,o,n==null?void 0:n.themeStyle,s)}getComposedCellStyleWithoutSelf(e,t,n,r){let i=n===void 0?this.getComposedCellStyle(e,t,r):this.getComposedCellStyleByCellData(e,t,n,r),a=this.getCellRaw(e,t);if(!a||!a.s)return i;let o=typeof a.s==`string`?this._styles.get(a.s):a.s;if(!o)return i;for(let e in o)e in i&&delete i[e];return i}getCellMatrix(){return this._cellData}getCellMatrixPrintRange(){let e=this.getCellMatrix(),t=this.getMergeData(),n=-1,r=-1,i=-1,a=-1,o=!1,s=!1;return e.forEach((t,c)=>{Object.keys(c).forEach(c=>{let l=+c,u=e.getValue(t,l),d=u!=null&&u.s?this._styles.get(u.s):null,f=(d==null?void 0:d.bd)&&(d.bd.b||d.bd.l||d.bd.r||d.bd.t||d.bd.bc_tr||d.bd.bl_tr||d.bd.ml_tr||d.bd.tl_bc||d.bd.tl_br||d.bd.tl_mr);(u&&(u.v!==null&&u.v!==void 0&&u.v!==``||u.p)||d!=null&&d.bg||f)&&(o?n=Math.min(n,t):(n=t,o=!0),r=Math.max(r,t),s?i=Math.min(i,l):(s=!0,i=l),a=Math.max(a,l))})}),t.forEach(e=>{o?n=Math.min(n,e.startRow):(n=e.startRow,o=!0),r=Math.max(r,e.endRow),s?i=Math.min(i,e.startColumn):(i=e.startColumn,o=!0),a=Math.max(a,e.endColumn)}),!o||!s?null:{startColumn:i,startRow:n,endColumn:a,endRow:r}}getRowManager(){return this._rowManager}getUnitId(){return this.unitId}getSheetId(){return this._sheetId}getColumnManager(){return this._columnManager}getName(){return this._snapshot.name}clone(){let{_snapshot:t}=this,n=Ig(t);return new e(this.unitId,n,this._styles)}getMergeData(){return this._spanModel.getMergeDataSnapshot()}getMergedCell(e,t){return this._spanModel.getMergedCell(e,t)}getMergedCellRange(e,t,n,r){return this._spanModel.getMergedCellRange(e,t,n,r)}isRowContainsMergedCell(e){return this._spanModel.isRowContainsMergedCell(e)}isColumnContainsMergedCell(e){return this._spanModel.isColumnContainsMergedCell(e)}getCellInfoInMergeData(e,t){let n=this.getMergedCell(e,t),r=!1,i=!1,a=e,o=t,s=e,c=t;if(n){let{startRow:l,endRow:u,startColumn:d,endColumn:f}=n;e===l&&t===d?(a=u,o=f,s=l,c=d,i=!0):e>=l&&e<=u&&t>=d&&t<=f&&(a=u,o=f,s=l,c=d,r=!0)}return{actualRow:e,actualColumn:t,isMergedMainCell:i,isMerged:r,endRow:a,endColumn:o,startRow:s,startColumn:c}}getCell(e,t){return e<0||t<0?null:this._viewModel.getCell(e,t)}getCellValueOnly(e,t){return e<0||t<0?null:this._viewModel.getCellValueOnly(e,t)}getCellStyleOnly(e,t){return e<0||t<0?null:this._viewModel.getCellStyleOnly(e,t)}getCellRaw(e,t){return this.getCellMatrix().getValue(e,t)}getCellWithFilteredInterceptors(e,t,n,r){return this._viewModel.getCell(e,t,n,r)}getRowFiltered(e){return this._viewModel.getRowFiltered(e)}getRangeFilterRows(e){let t=[];for(let n=e.startRow;n<=e.endRow;n++)this.getRowFiltered(n)&&t.push(n);return t}getMatrixWithMergedCells(e,t,n,r,i=Ac.Raw){let a=this.getCellMatrix(),o=this._spanModel.getMergedCellRange(e,t,n,r),s=new yd;return Cp(e,n,t,r).forEach((e,t)=>{let n;if(i===Ac.Raw)n=this.getCellRaw(e,t);else if(i===Ac.Intercepted)n=this.getCell(e,t);else if(i===Ac.Both){let i=this.getCellRaw(e,t);if(i){var r;n={...i};let a=(r=this.getCell(e,t))==null?void 0:r.v;Tg(a)&&n&&(n.displayV=String(a))}}n&&s.setValue(e,t,n)}),o.forEach(e=>{let{startColumn:t,startRow:n,endColumn:r,endRow:i}=e;Cp(n,i,t,r).forEach((e,o)=>{e===n&&o===t&&s.setValue(e,o,{...a.getValue(e,o),rowSpan:i-n+1,colSpan:r-t+1}),(e!==n||o!==t)&&s.realDeleteValue(e,o)})}),s}getRange(e,t,n,r){return typeof e==`object`?new Vf(this,e,{getStyles:()=>this._styles}):new Vf(this,{startRow:e,startColumn:t,endColumn:r||t,endRow:n||e},{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(){let{_snapshot:e}=this,{columnCount:t}=e;return t}getMaxRows(){let{_snapshot:e}=this,{rowCount:t}=e;return t}getRowCount(){return this._snapshot.rowCount}setRowCount(e){this._snapshot.rowCount=e}getColumnCount(){return this._snapshot.columnCount}setColumnCount(e){this._snapshot.columnCount=e}isSheetHidden(){return this._snapshot.hidden}hasHiddenGridlines(){let{_snapshot:e}=this,{showGridlines:t}=e;return t===0}getGridlinesColor(){return this.getConfig().gridlinesColor}getTabColor(){let{_snapshot:e}=this,{tabColor:t}=e;return t}getColumnWidth(e){return this.getColumnManager().getColumnWidth(e)}getRowHeight(e){return this._viewModel.getRowFiltered(e)?0:this.getRowManager().getRowHeight(e)}isRowFiltered(e){return this._viewModel.getRowFiltered(e)}getRowVisible(e){return!this.isRowFiltered(e)&&this.getRowRawVisible(e)}getRowRawVisible(e){return this.getRowManager().getRowRawVisible(e)}getHiddenRows(e,t){let n=this.getMaxColumns()-1,r=this._rowManager.getHiddenRows(e,t);return r.forEach(e=>e.endColumn=n),r}getColVisible(e){return this._columnManager.getColVisible(e)}getHiddenCols(e,t){let n=this.getMaxRows()-1,r=this._columnManager.getHiddenCols(e,t);return r.forEach(e=>e.endRow=n),r}getVisibleRows(){let e=this.getRowCount();return this._rowManager.getVisibleRows(0,e-1)}getVisibleCols(){let e=this.getColumnCount();return this._columnManager.getVisibleCols(0,e-1)}isRightToLeft(){let{_snapshot:e}=this,{rightToLeft:t}=e;return t}getLastRowWithContent(){return this._cellData.getRealRowRange().endRow}getLastColumnWithContent(){return this.getDataRealRange().endColumn}getDataRealRange(){return this._cellData.getRealRange()}getDataRangeScope(){return this._cellData.getStartEndScope()}cellHasValue(e){return e&&(e.v!==void 0||e.f!==void 0||e.p!==void 0)}iterateByRow(e,t=!0){let{startRow:n,startColumn:r,endRow:i,endColumn:a}=e,o=this;return{[Symbol.iterator]:()=>{let e=n,s=r;return{next(){for(;;){if(s>a&&(e+=1,s=r),e>i)return{done:!0,value:void 0};let n=o.getCell(e,s),c=!n,l=o.getMergedCell(e,s);if(l){if(e!==l.startRow||s!==l.startColumn){s=l.endColumn+1;continue}if(c&&t){s=l.endColumn+1;continue}let r={row:e,col:s,value:n};return r.colSpan=l.endColumn-l.startColumn+1,r.rowSpan=l.endRow-l.startRow+1,s=l.endColumn+1,{done:!1,value:r}}if(c&&t)s+=1;else{let t={row:e,col:s,value:n};return s+=1,{done:!1,value:t}}}}}}}}iterateByColumn(e,t=!0,n=!0){let{startRow:r,startColumn:i,endRow:a,endColumn:o}=e,s=this;return{[Symbol.iterator]:()=>{let e=r,c=i;return{next(){for(;;){if(e>a&&(c+=1,e=r),c>o)return{done:!0,value:void 0};let i=s.getMergedCell(e,c);if(i){let r=e!==i.startRow,a=r||c!==i.startColumn;if(n&&a||!n&&r){e=i.endRow+1;continue}let o=s.getCell(i.startRow,i.startColumn);if(!o&&t){e=i.endRow+1;continue}let l={row:e,col:i.startColumn,value:o};return l.colSpan=i.endColumn-i.startColumn+1,l.rowSpan=i.endRow-i.startRow+1,e=i.endRow+1,{done:!1,value:l}}let l=s.getCell(e,c);if(!l&&t)e+=1;else{let t={row:e,col:c,value:l};return e+=1,{done:!1,value:t}}}}}}}}getCellDocumentModel(e,t,n=Ug){var r;if(!e)return;let{isDeepClone:i,displayRawFormula:a,ignoreTextRotation:o}={...Ug,...n},s,c=`document`,l=Sg(t),u=o?Nf.tr:l.textRotation||Nf.tr,d=l.horizontalAlign||Nf.ht,f=l.verticalAlign||Nf.vt,p=l.wrapStrategy||Nf.tb,m=l.paddingData||yg;if(e.f&&a)s=xg(e.f.toString(),{},{verticalAlign:f}),d=Nf.ht;else if(e.p){let{centerAngle:t,vertexAngle:n}=kg(u);s=this._updateConfigAndGetDocumentModel(i?R.deepClone(e.p):e.p,d,m,{horizontalAlign:d,verticalAlign:f,centerAngle:t,vertexAngle:n,wrapStrategy:p,zeroWidthParagraphBreak:1})}else if(e.v!=null){let n=Cg(t);c=Dg(n).fontCache;let r=Gg(e);e.t===Oo.FORCE_STRING&&a&&(r=`'${r}`),s=xg(r,n,{...l,textRotation:u,cellValueType:e.t})}return s&&e.linkUrl&&e.linkId&&wg(s,e.linkUrl,e.linkId),{documentModel:s,fontString:c,textRotation:u,wrapStrategy:p,verticalAlign:f,horizontalAlign:d,paddingData:m,fill:t==null||(r=t.bg)==null?void 0:r.rgb}}_updateConfigAndGetDocumentModel(e,t,n,r){var i,a,o,s,c;if(!r||!((i=e.body)!=null&&i.dataStream))return;e.documentStyle||(e.documentStyle={}),e.documentStyle.marginTop=(a=n.t)==null?0:a,e.documentStyle.marginBottom=(o=n.b)==null?2:o,e.documentStyle.marginLeft=(s=n.l)==null?2:s,e.documentStyle.marginRight=(c=n.r)==null?2:c,e.documentStyle.pageSize={width:1/0,height:1/0},e.documentStyle.renderConfig={...e.documentStyle.renderConfig,...r};let l=e.body.paragraphs||[];for(let e of l)e.paragraphStyle||(e.paragraphStyle={}),e.paragraphStyle.horizontalAlign=t;return new eh(e)}getBlankCellDocumentModel(e,t,n){let r=this.getComposedCellStyleByCellData(t,n,e),i=Cg(r),a=this.getCellDocumentModel(e,r,{ignoreTextRotation:!0});if(a!=null)return a.documentModel==null&&(a.documentModel=xg(``,i)),a;let o=`document`,s=Nf.tr,c=Nf.ht,l=Nf.vt,u=Nf.tb,d=yg;return o=Dg({}).fontCache,{documentModel:xg(``,i),fontString:o,textRotation:s,wrapStrategy:u,verticalAlign:l,horizontalAlign:c,paddingData:d}}getCellDocumentModelWithFormula(e,t,n){let r=this.getComposedCellStyleByCellData(t,n,e);return this.getCellDocumentModel(e,r,{isDeepClone:!0,displayRawFormula:!0,ignoreTextRotation:!0})}getCustomMetadata(){return this._snapshot.custom}setCustomMetadata(e){this._snapshot.custom=e}};function Gg(e){var t;if(!e)return``;let n=(t=e.p)==null||(t=t.body)==null?void 0:t.dataStream;if(n)return Nh.transform.getPlainText(n);let r=e.v;return typeof r==`string`?e.t===Oo.BOOLEAN?r.toUpperCase():r.replace(/[\r\n]/g,``):typeof r==`number`?e.t===Oo.BOOLEAN?r?`TRUE`:`FALSE`:r.toString():typeof r==`boolean`?r?`TRUE`:`FALSE`:``}function Kg(e){if(e===null)return``;if(e!=null&&e.p){let t=e==null?void 0:e.p.body;if(t==null)return``;let n=t.dataStream;return Nh.transform.getPlainText(n)}return e==null?void 0:e.v}function qg(e,t){return`${e.getUnitId()}|${t.getSheetId()}`}let Jg=class extends Pa{get _activeSheet(){return this._activeSheet$.getValue()}get name(){return this._name$.getValue()}static isIRangeType(e){return typeof e==`string`||`startRow`in e||`row`in e}constructor(e={},t){super(),this._logService=t,P(this,`type`,I.UNIVER_SHEET),P(this,`_sheetCreated$`,new n.Subject),P(this,`sheetCreated$`,this._sheetCreated$.asObservable()),P(this,`_sheetDisposed$`,new n.Subject),P(this,`sheetDisposed$`,this._sheetDisposed$.asObservable()),P(this,`_activeSheet$`,new n.BehaviorSubject(null)),P(this,`activeSheet$`,this._activeSheet$.asObservable()),P(this,`_worksheets`,void 0),P(this,`_styles`,void 0),P(this,`_snapshot`,void 0),P(this,`_unitId`,void 0),P(this,`_count`,void 0),P(this,`_name$`,void 0),P(this,`name$`,void 0);let r=hg();R.isEmptyObject(e)?this._snapshot=r:this._snapshot=R.commonExtend(r,e);let{styles:i}=this._snapshot;(this._snapshot.id==null||this._snapshot.id.length===0)&&(this._snapshot.id=Ya(6)),this._unitId=this._snapshot.id,this._styles=new gg(i),this._count=1,this._worksheets=new Map,this._name$=new n.BehaviorSubject(e.name||``),this.name$=this._name$.asObservable(),this._parseWorksheetSnapshots()}dispose(){super.dispose(),this._sheetCreated$.complete(),this._sheetDisposed$.complete(),this._activeSheet$.complete(),this._name$.complete(),Array.from(this._worksheets.keys()).forEach(e=>{this._removeSheet(e)})}save(){return R.deepClone(this._snapshot)}getSnapshot(){return this._snapshot}getName(){return this._snapshot.name}setName(e){this._name$.next(e),this._snapshot.name=e}getUnitId(){return this._unitId}getRev(){var e;return(e=this._snapshot.rev)==null?1:e}incrementRev(){this._snapshot.rev=this.getRev()+1}setRev(e){this._snapshot.rev=e}addWorksheet(e,t,n){let{sheets:r,sheetOrder:i}=this._snapshot;if(r[e])return!1;r[e]=n,i.splice(t,0,e),this.ensureSheetOrderUnique();let a=new Wg(this._unitId,n,this._styles);return this._worksheets.set(e,a),this._sheetCreated$.next(a),!0}getSheetOrders(){return this._snapshot.sheetOrder}ensureSheetOrderUnique(){let e=new Set,t=[];for(let n of this._snapshot.sheetOrder)e.has(n)||(e.add(n),t.push(n));this._snapshot.sheetOrder=t,e.clear()}getWorksheets(){return this._worksheets}getActiveSpreadsheet(){return this}getStyles(){return this._styles}addStyles(e){Object.entries(e).forEach(([e,t])=>{this._styles.addCustomStyle(e,t)})}removeStyles(e){e.forEach(e=>{this._styles.remove(e)})}getConfig(){return this._snapshot}getIndexBySheetId(e){let{sheetOrder:t}=this._snapshot;return t.findIndex(t=>t===e)}getActiveSheet(e){if(!this._activeSheet&&e===void 0)throw Error(`[Workbook]: no active Worksheet on Workbook ${this._unitId}!`);return this._activeSheet}ensureActiveSheet(){let e=this._activeSheet;if(e)return e;let t=this._snapshot.sheetOrder;for(let e=0,n=t.length;e<n;e++){let n=this._worksheets.get(t[e]);if(n&&n.isSheetHidden()!==B.TRUE)return this.setActiveSheet(n),n}let n=this._worksheets.get(t[0]);return this.setActiveSheet(n),n}setActiveSheet(e){this._activeSheet$.next(e)}_removeSheet(e){let t=this._worksheets.get(e);return t?(this._worksheets.delete(e),this._snapshot.sheetOrder.splice(this._snapshot.sheetOrder.indexOf(e),1),this.ensureSheetOrderUnique(),this._sheetDisposed$.next(t),!0):!1}removeSheet(e){let t=this._removeSheet(e);return t&&delete this._snapshot.sheets[e],t}getActiveSheetIndex(){let{sheetOrder:e}=this._snapshot;return e.findIndex(e=>this._worksheets.get(e)===this._activeSheet)}getSheetSize(){return this._snapshot.sheetOrder.length}getSheets(){let{sheetOrder:e}=this._snapshot;return e.map(e=>this._worksheets.get(e))}getSheetsName(){let{sheetOrder:e}=this._snapshot,t=[];return e.forEach(e=>{let n=this._worksheets.get(e);n&&t.push(n.getName())}),t}getSheetIndex(e){let{sheetOrder:t}=this._snapshot;return t.findIndex(t=>e.getSheetId()===t)}getSheetBySheetName(e){let{sheetOrder:t}=this._snapshot,n=t.find(t=>this._worksheets.get(t).getName()===e);return this._worksheets.get(n)}getSheetBySheetId(e){return this._worksheets.get(e)}getSheetByIndex(e){let{sheetOrder:t}=this._snapshot;return this._worksheets.get(t[e])}getHiddenWorksheets(){return this.getSheets().filter(e=>e.getConfig().hidden===B.TRUE).map(e=>e.getConfig().id)}getUnhiddenWorksheets(){return this.getSheets().filter(e=>e.getConfig().hidden!==B.TRUE).map(e=>e.getConfig().id)}load(e){this._snapshot=e}checkSheetName(e){return this.getSheetsName().some(t=>t.toLowerCase()===e.toLowerCase())}uniqueSheetName(e=`Sheet1`){let t=e;for(;this.checkSheetName(t);)t=e+this._count,this._count++;return t}generateNewSheetName(e){let t=e+this._count;for(;this.checkSheetName(t);)t=e+this._count,this._count++;return t}_parseWorksheetSnapshots(){let{_snapshot:e,_worksheets:t}=this,{sheets:n,sheetOrder:r}=e;if(R.isEmptyObject(n)){let e=Ya();n[e]={id:e}}for(let e in n){let i=n[e],{name:a}=i;i.name=this.uniqueSheetName(a),i.name!==a&&this._logService.debug(`[Workbook]`,`The worksheet name ${a} is duplicated, we changed it to ${i.name}. Please fix the problem in your snapshot.`);let o=new Wg(this._unitId,i,this._styles);t.set(e,o),r.includes(e)||r.push(e)}this.ensureSheetOrderUnique(),this.ensureActiveSheet()}getCustomMetadata(){return this._snapshot.custom}setCustomMetadata(e){this._snapshot.custom=e}};Jg=Fs([W(1,Ms)],Jg);var Yg=class extends Pa{get _activePage(){let e=this._activePage$.getValue();if(!e){var t,n;let e=(t=this.getPageOrder())==null?void 0:t[0];return e?(n=this.getPages())==null?void 0:n[e]:null}return e}constructor(e){var t;super(),P(this,`type`,I.UNIVER_SLIDE),P(this,`_activePage$`,new n.BehaviorSubject(null)),P(this,`activePage$`,this._activePage$.asObservable()),P(this,`_name$`,void 0),P(this,`name$`,void 0),P(this,`_snapshot`,void 0),P(this,`_unitId`,void 0),this._snapshot={...Pf,...e},this._unitId=(t=this._snapshot.id)==null?Ya(6):t,this._name$=new n.BehaviorSubject(this._snapshot.title),this.name$=this._name$.asObservable()}setName(e){var t;this._snapshot.title=e,this._name$.next(e),this._unitId=(t=this._snapshot.id)==null?Ya(6):t}getRev(){return 0}incrementRev(){}setRev(e){}getSnapshot(){return this._snapshot}getUnitId(){return this._unitId}getPages(){var e;return(e=this._snapshot.body)==null?void 0:e.pages}getPageOrder(){var e;return(e=this._snapshot.body)==null?void 0:e.pageOrder}getPage(e){let t=this.getPages();return t==null?void 0:t[e]}getElementsByPage(e){var t;return(t=this.getPage(e))==null?void 0:t.pageElements}getElement(e,t){var n;return(n=this.getElementsByPage(e))==null?void 0:n[t]}getPageSize(){return this._snapshot.pageSize}getBlankPage(){let e=Ya(6);return{id:e,pageType:ps.SLIDE,zIndex:10,title:e,description:``,pageBackgroundFill:{rgb:`rgb(255,255,255)`},pageElements:{}}}setActivePage(e){this._activePage$.next(e)}getActivePage(){return this._activePage}updatePage(e,t){this._snapshot.body&&(this._snapshot.body.pages[e]=t)}appendPage(e){var t;if(!this._snapshot.body)return;this._snapshot.body.pages[e.id]=e;let n=this._activePage,r=this._snapshot.body.pageOrder.indexOf((t=n==null?void 0:n.id)==null?``:t);this._snapshot.body.pageOrder.splice(r+1,0,e.id)}};let Xg=(0,t.createIdentifier)(`univer.current`),Zg=class extends ra{constructor(e,t,r){super(),this._injector=e,this._contextService=t,this._logService=r,P(this,`_unitsByType`,new Map),P(this,`_createHandler`,void 0),P(this,`_ctorByType`,new Map),P(this,`_currentUnits`,new Map),P(this,`_currentUnits$`,new n.BehaviorSubject(this._currentUnits)),P(this,`currentUnits$`,this._currentUnits$.asObservable()),P(this,`_unitAdded$`,new n.Subject),P(this,`unitAdded$`,this._unitAdded$.asObservable()),P(this,`_unitDisposed$`,new n.Subject),P(this,`unitDisposed$`,this._unitDisposed$.asObservable()),P(this,`_focused$`,new n.BehaviorSubject(null)),P(this,`focused$`,this._focused$.asObservable())}dispose(){super.dispose(),this._focused$.complete(),this._currentUnits$.complete(),this._unitAdded$.complete(),this._currentUnits.forEach(e=>e==null?void 0:e.dispose()),this._currentUnits.clear(),this._unitsByType.clear()}__setCreateHandler(e){this._createHandler=e}createUnit(e,t,n){return this._createHandler(e,t,this._ctorByType.get(e),n)}registerCtorForType(e,t){return this._ctorByType.set(e,t),{dispose:()=>{this._ctorByType.delete(e)}}}getCurrentTypeOfUnit$(e){return this.currentUnits$.pipe((0,n.map)(t=>{var n;return(n=t.get(e))==null?null:n}),(0,n.distinctUntilChanged)())}getCurrentUnitForType(e){return this._currentUnits.get(e)}getCurrentUnitOfType(e){return this.getCurrentUnitForType(e)}setCurrentUnitForType(e){let t=this._getUnitById(e);if(!t)throw Error(`[UniverInstanceService]: no document with unitId ${e}!`);this._currentUnits.set(t[1],t[0]),this._currentUnits$.next(this._currentUnits)}getTypeOfUnitAdded$(e){return this._unitAdded$.pipe((0,n.filter)(t=>t.type===e))}__addUnit(e,t){var n;this._logService.debug(`[UniverInstanceService]: Adding unit with id ${e.getUnitId()}`);let r=e.type;this._unitsByType.has(r)||this._unitsByType.set(r,[]);let i=this._unitsByType.get(r),a=e.getUnitId();if(i.findIndex(e=>e.getUnitId()===a)!==-1)throw Error(`[UniverInstanceService]: cannot create a unit with the same unit id: ${a}.`);i.push(e),this._unitAdded$.next(e),((n=t==null?void 0:t.makeCurrent)==null||n)&&this.setCurrentUnitForType(e.getUnitId())}getTypeOfUnitDisposed$(e){return this.unitDisposed$.pipe((0,n.filter)(t=>t.type===e))}getUnit(e,t){var n;let r=(n=this._getUnitById(e))==null?void 0:n[0];return t&&(r==null?void 0:r.type)!==t?null:r}getCurrentUniverDocInstance(){return this.getCurrentUnitForType(I.UNIVER_DOC)}getUniverDocInstance(e){return this.getUnit(e,I.UNIVER_DOC)}getUniverSheetInstance(e){return this.getUnit(e,I.UNIVER_SHEET)}getAllUnitsForType(e){var t;return(t=this._unitsByType.get(e))==null?[]:t}changeDoc(e,t){let n=this.getAllUnitsForType(I.UNIVER_DOC),r=n.find(t=>t.getUnitId()===e);if(r!=null){let e=n.indexOf(r);n.splice(e,1)}this.__addUnit(t)}get focused(){var e;let t=this._focused$.getValue();return t?(e=this._getUnitById(t))==null?void 0:e[0]:null}focusUnit(e){this._focused$.next(e),this.focused instanceof Jg?(this._contextService.setContextValue(ng,!0),this._contextService.setContextValue(ig,!1),this._contextService.setContextValue(rg,!0),this._contextService.setContextValue(ag,!1),this.setCurrentUnitForType(e)):this.focused instanceof eh?(this._contextService.setContextValue(ng,!0),this._contextService.setContextValue(ig,!0),this._contextService.setContextValue(rg,!1),this._contextService.setContextValue(ag,!1),this.setCurrentUnitForType(e)):this.focused instanceof Yg?(this._contextService.setContextValue(ng,!0),this._contextService.setContextValue(ig,!1),this._contextService.setContextValue(rg,!1),this._contextService.setContextValue(ag,!0),this.setCurrentUnitForType(e)):(this._contextService.setContextValue(ng,!1),this._contextService.setContextValue(ig,!1),this._contextService.setContextValue(rg,!1),this._contextService.setContextValue(ag,!1))}getFocusedUnit(){return this.focused}getUnitType(e){let t=this._getUnitById(e);return t?t[1]:I.UNRECOGNIZED}disposeUnit(e){this._logService.debug(`[UniverInstanceService]: Disposing unit with id ${e}`);let t=this._getUnitById(e);if(!t)return this._logService.debug(`[UniverInstanceService]: No unit found with id ${e}`),!1;let[n,r]=t,i=this._unitsByType.get(r),a=i.indexOf(n);return i.splice(a,1),this._tryResetCurrentOnRemoval(e,r),this._tryResetFocusOnRemoval(e),this._unitDisposed$.next(n),n.dispose(),!0}_tryResetCurrentOnRemoval(e,t){let n=this.getCurrentUnitForType(t);(n==null?void 0:n.getUnitId())===e&&(this._currentUnits.set(t,null),this._currentUnits$.next(this._currentUnits))}_tryResetFocusOnRemoval(e){var t;((t=this.focused)==null?void 0:t.getUnitId())===e&&this._focused$.next(null)}_getUnitById(e){for(let[t,n]of this._unitsByType){let r=n.find(t=>t.getUnitId()===e);if(r)return[r,t]}}};Zg=Fs([W(0,(0,t.Inject)(t.Injector)),W(1,ks),W(2,(0,t.Inject)(Ms))],Zg);let $=function(e){return e[e.Starting=0]=`Starting`,e[e.Ready=1]=`Ready`,e[e.Rendered=2]=`Rendered`,e[e.Steady=3]=`Steady`,e}({}),Qg={[$.Starting]:`Starting`,[$.Ready]:`Ready`,[$.Rendered]:`Rendered`,[$.Steady]:`Steady`};var $g=class extends Error{constructor(e){super(`[LifecycleService]: lifecycle stage "${Qg[e]}" will never be reached!`),this.name=`LifecycleUnreachableError`}};let e_=class extends ra{constructor(e){super(),this._logService=e,P(this,`_lifecycle$`,new n.BehaviorSubject($.Starting)),P(this,`lifecycle$`,this._lifecycle$.asObservable()),P(this,`_lock`,!1),this._reportProgress($.Starting)}get stage(){return this._lifecycle$.getValue()}set stage(e){if(this._lock)throw Error(`[LifecycleService]: cannot set new stage when related logic is all handled!`);if(e<this.stage)throw Error(`[LifecycleService]: lifecycle stage cannot go backward!`);e!==this.stage&&(this._lock=!0,this._reportProgress(e),this._lifecycle$.next(e),this._lock=!1)}dispose(){this._lifecycle$.complete(),super.dispose()}onStage(e){return(0,n.firstValueFrom)(this.lifecycle$.pipe((0,n.filter)(t=>t>=e),Ks(t=>t===e),(0,n.map)(()=>void 0))).catch(t=>t.name===`EmptyError`?Promise.reject(new $g(e)):Promise.reject(t))}subscribeWithPrevious(){return(0,n.merge)(t_(this.stage),this._lifecycle$.pipe((0,n.skip)(1))).pipe(Ks(e=>e===$.Steady))}_reportProgress(e){this._logService.debug(`[LifecycleService]`,`lifecycle progressed to "${Qg[e]}".`)}};e_=Fs([W(0,Ms)],e_);function t_(e){switch(e){case $.Starting:return(0,n.of)($.Starting);case $.Ready:return(0,n.of)($.Starting,$.Ready);case $.Rendered:return(0,n.of)($.Starting,$.Ready,$.Rendered);default:return(0,n.of)($.Starting,$.Ready,$.Rendered,$.Steady)}}let n_=(0,t.createIdentifier)(`ILocalStorageService`);var r_=class extends ra{get _currentLocale(){return this._currentLocale$.value}constructor(){super(),P(this,`_currentLocale$`,new n.BehaviorSubject(uo.ZH_CN)),P(this,`currentLocale$`,this._currentLocale$.asObservable()),P(this,`_locales`,null),P(this,`localeChanged$`,new n.Subject),P(this,`t`,(e,...t)=>{if(!this._locales)throw Error(`[LocaleService]: Locale not initialized`);let n=e.split(`.`),r=this.resolveKeyPath(this._locales[this._currentLocale],n);if(typeof r==`string`){let e=r;return t.forEach((t,n)=>{e=e.replace(`{${n}}`,t)}),e}else return e}),this.disposeWithMe(ta(()=>{this._locales=null,this._currentLocale$.complete(),this.localeChanged$.complete()}))}load(e){var t;this._locales=Bi((t=this._locales)==null?{}:t,e)}setLocale(e){this._currentLocale$.next(e),this.localeChanged$.next()}getLocales(){var e;return(e=this._locales)==null?void 0:e[this._currentLocale]}getCurrentLocale(){return this._currentLocale}resolveKeyPath(e,t){let n=t.shift();if(n&&e&&n in e){let r=e[n];return t.length>0&&(typeof r==`object`||Array.isArray(r))?this.resolveKeyPath(r,t):r}return null}};let i_=class{constructor(e){this._userManagerService=e}async list(e){return{list:[{type:fo.PERSON,mentions:[{objectType:fo.PERSON,objectId:this._userManagerService.getCurrentUser().userID,label:this._userManagerService.getCurrentUser().name,metadata:{icon:this._userManagerService.getCurrentUser().avatar}}],metadata:{},title:`PEOPLE`}],page:e.page,size:e.size,total:1}}};i_=Fs([W(0,(0,t.Inject)(Zh))],i_);let a_=(0,t.createIdentifier)(`univer.service.mention-io`),o_=function(e){return e.INIT=`init`,e.FETCHING=`fetching`,e.DONE=`done`,e}({}),s_=(0,t.createIdentifier)(`univer.permission-service`);var c_=class extends ra{constructor(...e){super(...e),P(this,`_permissionPointMap`,new Map),P(this,`_permissionPointUpdate$`,new n.Subject),P(this,`permissionPointUpdate$`,this._permissionPointUpdate$.asObservable()),P(this,`_showComponents`,!0)}setShowComponents(e){this._showComponents=e}getShowComponents(){return this._showComponents}deletePermissionPoint(e){let t=this._permissionPointMap.get(e);t&&(t.complete(),this._permissionPointMap.delete(e))}addPermissionPoint(e){let t=e instanceof n.BehaviorSubject,r=t?e.getValue():e;return r.id?this._permissionPointMap.get(r.id)?(console.warn(`${r.id} PermissionPoint already exists`),!1):(this._permissionPointMap.set(r.id,t?e:new n.BehaviorSubject(r)),this._permissionPointUpdate$.next(r),!0):!1}updatePermissionPoint(e,t){let n=this._permissionPointMap.get(e);if(!n)return;let r=n.getValue();r.value=t,r.status=o_.DONE,n.next(r),this._permissionPointUpdate$.next(r)}clearPermissionMap(){this._permissionPointMap.clear()}getPermissionPoint(e){let t=this._permissionPointMap.get(e);if(t)return t.getValue()}getPermissionPoint$(e){let t=this._permissionPointMap.get(e);if(t)return t}composePermission$(e){return(0,n.combineLatest)(e.map(e=>{var t;let n=(t=this._permissionPointMap)==null?void 0:t.get(e);if(!n)throw Error(`[PermissionService]: ${e} permissionPoint does not exist!`);return n.asObservable()})).pipe((0,r.map)(e=>e))}composePermission(e){return e.map(e=>{var t;let n=(t=this._permissionPointMap)==null?void 0:t.get(e);if(!n)throw Error(`[PermissionService]: ${e} permissionPoint does not exist!`);return n.getValue()})}getAllPermissionPoint(){let e=new Map;return this._permissionPointMap.forEach((t,n)=>{e.set(n,t)}),e}};function l_(e,t){if(!t)return e;let n=[];for(let r of e){let e=t.find(([e])=>e===r[0]);if(e){if(e[1]===null)continue;n.push([r[0],e[1]])}else n.push(r)}return n}let u_=Symbol(`DependentOn`);var d_=class extends ra{onStarting(){}onReady(){}onRendered(){}onSteady(){}getUnitType(){return this.constructor.type}getPluginName(){return this.constructor.pluginName}};P(d_,`pluginName`,void 0),P(d_,`packageName`,pg),P(d_,`version`,mg),P(d_,`type`,I.UNIVER_UNKNOWN);var f_=class{constructor(){P(this,`_plugins`,[])}addPlugin(e){this._plugins.push(e)}removePlugins(){let e=this._plugins.slice();return this._plugins.length=0,e}forEachPlugin(e){this._plugins.forEach(e)}};function p_(...e){return function(t){t[u_]=e}}let m_=class{constructor(e,t,n){this._injector=e,this._lifecycleService=t,this._logService=n,P(this,`_pluginRegistry`,new Map),P(this,`_pluginStore`,new f_),P(this,`_seenPlugins`,new Set),P(this,`_loadedPlugins`,new Set),P(this,`_loadedPluginTypes`,new Set([I.UNIVER_UNKNOWN])),P(this,`_flushTimerByType`,new Map)}dispose(){this._pluginStore.removePlugins().forEach(e=>e.dispose()),this._flushTimerByType.forEach(e=>clearTimeout(e))}registerPlugin(e,t){this._assertPluginValid(e);let n={plugin:e,options:t};this._pluginRegistry.set(e.pluginName,n),this._logService.debug(`[PluginService]`,`Plugin "${e.pluginName}" registered.`);let{type:r}=e;this._loadedPluginTypes.has(r)&&(r===I.UNIVER_UNKNOWN?this._loadFromPlugins([n]):this._flushType(r))}startPluginsForType(e){this._loadedPluginTypes.has(e)||this._loadPluginsForType(e)}_loadPluginsForType(e){let t=Array.from(this._pluginRegistry.keys()),n=[];t.forEach(t=>{let r=this._pluginRegistry.get(t);r.plugin.type===e&&n.push(r)}),this._loadFromPlugins(n),this._loadedPluginTypes.add(e)}_assertPluginValid(e){let{type:t,pluginName:n,packageName:r,version:i}=e;if(t===I.UNRECOGNIZED)throw Error(`[PluginService]: invalid plugin type for ${e.name}. Please assign a "type" to your plugin.`);if(!n)throw Error(`[PluginService]: no plugin name for ${e.name}. Please assign a "pluginName" to your plugin.`);if(i&&i!==d_.version)throw Error(`[PluginService]: package "${r==null?`UNKNOWN`:r}" version mismatch. Plugin version is "${i}" but @univerjs/core version is "${d_.version}". Please make sure all @univerjs packages use the same version.`);if(this._seenPlugins.has(n))throw Error(`[PluginService]: duplicated plugin name for "${n}". Maybe a plugin that dependents on "${n} has already registered it. In that case please register "${n}" before the that plugin.`);this._seenPlugins.add(e.pluginName)}_flushType(e){this._flushTimerByType.get(e)===void 0&&this._flushTimerByType.set(e,setTimeout(()=>{this._loadPluginsForType(e),this._flushTimerByType.delete(e)},4))}_loadFromPlugins(e){let t=[],n=new Set,r=e=>{let{plugin:i}=e,{pluginName:a}=i;if(this._loadedPlugins.has(a)||n.has(a))return;n.add(a),this._pluginRegistry.delete(a);let o=i[u_];o&&o.forEach(e=>{let t=this._pluginRegistry.get(e.pluginName);if(t)r(t);else if(!this._seenPlugins.has(e.pluginName)&&!n.has(e.pluginName)){if(i.type===I.UNIVER_UNKNOWN&&e.type!==I.UNIVER_UNKNOWN)throw Error(`[PluginService]: cannot register a plugin with Univer type that depends on a plugin with other type. The dependent is ${i.pluginName} and the dependency is ${e.pluginName}.`);i.type!==e.type&&e.type!==I.UNIVER_UNKNOWN&&this._logService.debug(`[PluginService]`,`Plugin "${a}" depends on "${e.pluginName}" which has different type.`),this._logService.debug(`[PluginService]`,`Plugin "${a}" depends on "${e.pluginName}" which is not registered. Univer will automatically register it with default configuration.`),this._assertPluginValid(e),r({plugin:e,options:void 0})}}),t.push(e)};e.forEach(e=>r(e));let i=t.map(e=>this._initPlugin(e.plugin,e.options));this._pluginsRunLifecycle(i)}_pluginsRunLifecycle(e){let t=this._lifecycleService.stage;if(t_(t).subscribe(t=>this._runStage(e,t)),t!==$.Steady){let t=this._lifecycleService.lifecycle$.pipe((0,n.skip)(1)).subscribe(n=>{this._runStage(e,n),n===$.Steady&&t.unsubscribe()})}}_runStage(e,t){e.forEach(e=>{switch(t){case $.Starting:e.onStarting();break;case $.Ready:e.onReady();break;case $.Rendered:e.onRendered();break;case $.Steady:e.onSteady();break}})}_initPlugin(e,t){let n=this._injector.createInstance(e,t);return this._pluginStore.addPlugin(n),this._loadedPlugins.add(e.pluginName),this._logService.debug(`[PluginService]`,`Plugin "${n.getPluginName()}" loaded.`),n}};m_=Fs([W(0,(0,t.Inject)(t.Injector)),W(1,(0,t.Inject)(e_)),W(2,Ms)],m_);let h_=(0,t.createIdentifier)(`resource-loader-service`),g_=class extends ra{constructor(e){super(),this._logService=e,P(this,`_resourceMap`,new Map),P(this,`_register$`,new n.Subject),P(this,`register$`,this._register$.asObservable())}getAllResourceHooks(){return[...this._resourceMap.values()]}getResources(e,t){return t?this.getResourcesByType(e,t):this.getAllResourceHooks().map(t=>{let n=t.toJson(e);return{name:t.pluginName,data:n}})}getResourcesByType(e,t){return this.getAllResourceHooks().filter(e=>e.businesses.includes(t)).map(t=>{let n=t.toJson(e);return{name:t.pluginName,data:n}})}registerPluginResource(e){let t=e.pluginName;if(this._resourceMap.has(t))throw Error(`the pluginName is registered {${t}}`);return this._resourceMap.set(t,e),this._register$.next(e),ta(()=>this._resourceMap.delete(t))}disposePluginResource(e){this._resourceMap.delete(e)}loadResources(e,t){this.getAllResourceHooks().forEach(n=>{var r;let i=t==null||(r=t.find(e=>e.name===n.pluginName))==null?void 0:r.data;if(i)try{let t=n.parseJson(i);n.onLoad(e,t)}catch(e){this._logService.error(`[ResourceManagerService]`,`loadResources error`,e)}})}unloadResources(e,t){this.getAllResourceHooks().filter(e=>e.businesses.includes(t)).forEach(t=>{t.onUnLoad(e)})}dispose(){this._register$.complete(),this._resourceMap.clear()}};g_=Fs([W(0,Ms)],g_);var __=class extends ra{get darkMode(){return this._darkMode$.getValue()}constructor(){super(),P(this,`_darkMode$`,new n.BehaviorSubject(!1)),P(this,`darkMode$`,this._darkMode$.asObservable()),P(this,`_validColorCache`,new Map),P(this,`_currentTheme`,i.defaultTheme),P(this,`_currentTheme$`,new n.BehaviorSubject(this._currentTheme)),P(this,`currentTheme$`,this._currentTheme$.asObservable()),this.disposeWithMe(ta(()=>{this._currentTheme=i.defaultTheme,this._currentTheme$.complete(),this._darkMode$.complete()}))}isValidThemeColor(e){if(this._validColorCache.has(e))return this._validColorCache.get(e);let t=!1,n=e.split(`.`);if(n.length===1)t=e in i.defaultTheme;else if(n.length===2){let[e,r]=n;t=e in i.defaultTheme&&r in this._currentTheme[e]}return this._validColorCache.set(e,t),t}getCurrentTheme(){return this._currentTheme}setTheme(e){this._currentTheme=e,this._currentTheme$.next(e)}setDarkMode(e){this._darkMode$.next(e)}getColorFromTheme(e){return ti(this._currentTheme,e)}},v_=function(e){return e[e.WAITING=0]=`WAITING`,e[e.CREATED=1]=`CREATED`,e}(v_||{});let y_=(0,t.createIdentifier)(`univer.undo-redo.service`);var b_=class{dispose(){}async dispatchToHandlers(){return!1}};let x_=`univer.command.redo`,S_=`univer.command.undo`,C_=new class extends b_{constructor(...e){super(...e),P(this,`type`,Ls.COMMAND),P(this,`id`,S_)}handler(e){let t=e.get(y_),n=t.pitchTopUndoElement();if(!n)return!1;let r=e.get(Rs);return Us(n.undoMutations,r)?(t.popUndoToRedo(),!0):!1}},w_=new class extends b_{constructor(...e){super(...e),P(this,`type`,Ls.COMMAND),P(this,`id`,x_)}handler(e){let t=e.get(y_),n=t.pitchTopRedoElement();if(!n)return!1;let r=e.get(Rs);return Us(n.redoMutations,r)?(t.popRedoToUndo(),!0):!1}},T_=class extends ra{constructor(e,t,r){super(),this._univerInstanceService=e,this._commandService=t,this._contextService=r,P(this,`undoRedoStatus$`,void 0),P(this,`_undoRedoStatus$`,new n.BehaviorSubject({undos:0,redos:0})),P(this,`_undoStacks`,new Map),P(this,`_redoStacks`,new Map),P(this,`_batchingStatus`,new Map),this.undoRedoStatus$=this._undoRedoStatus$.asObservable(),this.disposeWithMe(this._commandService.registerCommand(C_)),this.disposeWithMe(this._commandService.registerCommand(w_)),this.disposeWithMe(ta(()=>this._undoRedoStatus$.complete())),this.disposeWithMe(ta(this._univerInstanceService.focused$.subscribe(()=>this._updateStatus())))}pushUndoRedo(e){let{unitID:t}=e,n=this._getRedoStack(t,!0),r=this._getUndoStack(t,!0);if(n.length=0,this._batchingStatus.has(e.unitID)){let t=this._batchingStatus.get(e.unitID),n=this._pitchUndoElement(e.unitID);t===v_.WAITING||!n?(i(e),this._batchingStatus.set(e.unitID,v_.CREATED)):this._tryBatchingElements(n,e)}else i(e);function i(e){r.push(e),r.length>20&&r.splice(0,1)}this._updateStatus()}clearUndoRedo(e){let t=this._getRedoStack(e);t&&(t.length=0);let n=this._getUndoStack(e);n&&(n.length=0),this._updateStatus()}pitchTopUndoElement(){let e=this._getFocusedUnitId();return this._pitchUndoElement(e)}pitchTopRedoElement(){let e=this._getFocusedUnitId();return this._pitchRedoElement(e)}_pitchUndoElement(e){let t=this._getUndoStack(e);return t!=null&&t.length?t[t.length-1]:null}_pitchRedoElement(e){let t=this._getRedoStack(e);return t!=null&&t.length?t[t.length-1]:null}popUndoToRedo(){let e=this._getUndoStackForFocused().pop();e&&(e.redoMutations.length>0&&this._getRedoStackForFocused().push(e),this._updateStatus())}popRedoToUndo(){let e=this._getRedoStackForFocused().pop();e&&(this._getUndoStackForFocused().push(e),this._updateStatus())}rollback(e,t){let n=t||this._getFocusedUnitId(),r=this._getUndoStack(n),i=r==null?void 0:r[(r==null?void 0:r.length)-1];i&&i.id===e&&(r.pop(),Us(i.undoMutations,this._commandService))}__tempBatchingUndoRedo(e){if(this._batchingStatus.has(e))throw Error(`[LocalUndoRedoService]: cannot batching undo redo twice at the same time!`);return this._batchingStatus.set(e,v_.WAITING),ta(()=>this._batchingStatus.delete(e))}_updateStatus(){var e,t;let n=this._getFocusedUnitId(),r=n&&((e=this._undoStacks.get(n))==null?void 0:e.length)||0,i=n&&((t=this._redoStacks.get(n))==null?void 0:t.length)||0;this._undoRedoStatus$.next({undos:r,redos:i})}_getUndoStack(e,t=!1){let n=this._undoStacks.get(e);return!n&&t&&(n=[],this._undoStacks.set(e,n)),n||null}_getRedoStack(e,t=!1){let n=this._redoStacks.get(e);return!n&&t&&(n=[],this._redoStacks.set(e,n)),n||null}_getUndoStackForFocused(){let e=this._getFocusedUnitId();if(!e)throw Error(`No focused univer instance!`);return this._getUndoStack(e,!0)}_getRedoStackForFocused(){let e=this._getFocusedUnitId();if(!e)throw Error(`No focused univer instance!`);return this._getRedoStack(e,!0)}_tryBatchingElements(e,t){e.redoMutations.push(...t.redoMutations),e.undoMutations.push(...t.undoMutations)}_getFocusedUnitId(){let e=``,t=this._contextService.getContextValue(rg),n=this._contextService.getContextValue(sg),r=this._contextService.getContextValue(og);if(t)if(n)e=N;else if(r)e=M;else{var i,a;e=(i=(a=this._univerInstanceService.getFocusedUnit())==null?void 0:a.getUnitId())==null?``:i}else{var o,s;e=(o=(s=this._univerInstanceService.getFocusedUnit())==null?void 0:s.getUnitId())==null?``:o}return e}};T_=Fs([W(0,Xg),W(1,Rs),W(2,ks)],T_);var E_=class{constructor(e,t=1e3){this._injector=e,P(this,`_imageCacheMap`,void 0),this._imageCacheMap=new wf(t)}_getImageCacheKey(e,t){return`${e}-${t}`}getImage(e,t,n,r){let i=this._getImageCacheKey(e,t);return this._imageCacheMap.get(i)||((async()=>{let a=new Image,o=this._injector.has(dg)?this._injector.get(dg):null,s=this._injector.has(fg)?this._injector.get(fg):null;if(e===lg.UUID)try{a.src=await(o==null?void 0:o.getImage(t))||``}catch(e){console.error(e)}else if(e===lg.URL)try{a.src=await(s==null?void 0:s.getImage(t))||t}catch{a.src=t}else a.src=t;a.onload=()=>{a.removeAttribute(`data-error`),n==null||n()},a.onerror=()=>{a.setAttribute(`data-error`,`true`),r==null||r()},this._imageCacheMap.set(i,a)})(),null)}};function D_(e){return!(e.length===0||e.length>31||e.startsWith(`'`)||e.endsWith(`'`)||/[:\\\/\?\*\[\]]/.test(e))}function O_(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))}let k_=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var A_=class e{static from(t){if(!(t instanceof ArrayBuffer))throw Error(`Data must be an instance of ArrayBuffer.`);let[n,r]=new Uint8Array(t,0,2);if(n!==219)throw Error(`Data does not appear to be in a KDBush format.`);let i=r>>4;if(i!==1)throw Error(`Got v${i} data when expected v1.`);let a=k_[r&15];if(!a)throw Error(`Unrecognized array type.`);let[o]=new Uint16Array(t,2,1),[s]=new Uint32Array(t,4,1);return new e(s,o,a,t)}constructor(e,t=64,n=Float64Array,r){if(isNaN(e)||e<0)throw Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let i=k_.indexOf(this.ArrayType),a=e*2*this.ArrayType.BYTES_PER_ELEMENT,o=e*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-o%8)%8;if(i<0)throw Error(`Unexpected typed array class: ${n}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+o+s,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(8+a+o+s),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+o+s,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+i]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){let n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=t,n}finish(){let e=this._pos>>1;if(e!==this.numItems)throw Error(`Added ${e} items when expected ${this.numItems}.`);return j_(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,n,r){if(!this._finished)throw Error(`Data not yet indexed - call index.finish().`);let{ids:i,coords:a,nodeSize:o}=this,s=[0,i.length-1,0],c=[];for(;s.length;){let l=s.pop()||0,u=s.pop()||0,d=s.pop()||0;if(u-d<=o){for(let o=d;o<=u;o++){let s=a[2*o],l=a[2*o+1];s>=e&&s<=n&&l>=t&&l<=r&&c.push(i[o])}continue}let f=d+u>>1,p=a[2*f],m=a[2*f+1];p>=e&&p<=n&&m>=t&&m<=r&&c.push(i[f]),(l===0?e<=p:t<=m)&&(s.push(d),s.push(f-1),s.push(1-l)),(l===0?n>=p:r>=m)&&(s.push(f+1),s.push(u),s.push(1-l))}return c}within(e,t,n){if(!this._finished)throw Error(`Data not yet indexed - call index.finish().`);let{ids:r,coords:i,nodeSize:a}=this,o=[0,r.length-1,0],s=[],c=n*n;for(;o.length;){let l=o.pop()||0,u=o.pop()||0,d=o.pop()||0;if(u-d<=a){for(let n=d;n<=u;n++)F_(i[2*n],i[2*n+1],e,t)<=c&&s.push(r[n]);continue}let f=d+u>>1,p=i[2*f],m=i[2*f+1];F_(p,m,e,t)<=c&&s.push(r[f]),(l===0?e-n<=p:t-n<=m)&&(o.push(d),o.push(f-1),o.push(1-l)),(l===0?e+n>=p:t+n>=m)&&(o.push(f+1),o.push(u),o.push(1-l))}return s}};function j_(e,t,n,r,i,a){if(i-r<=n)return;let o=r+i>>1;M_(e,t,o,r,i,a),j_(e,t,n,r,o-1,1-a),j_(e,t,n,o+1,i,1-a)}function M_(e,t,n,r,i,a){for(;i>r;){if(i-r>600){let o=i-r+1,s=n-r+1,c=Math.log(o),l=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*l*(o-l)/o)*(s-o/2<0?-1:1);M_(e,t,n,Math.max(r,Math.floor(n-s*l/o+u)),Math.min(i,Math.floor(n+(o-s)*l/o+u)),a)}let o=t[2*n+a],s=r,c=i;for(N_(e,t,r,n),t[2*i+a]>o&&N_(e,t,r,i);s<c;){for(N_(e,t,s,c),s++,c--;t[2*s+a]<o;)s++;for(;t[2*c+a]>o;)c--}t[2*r+a]===o?N_(e,t,r,c):(c++,N_(e,t,c,i)),c<=n&&(r=c+1),n<=c&&(i=c-1)}}function N_(e,t,n,r){P_(e,n,r),P_(t,2*n,2*r),P_(t,2*n+1,2*r+1)}function P_(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function F_(e,t,n,r){let i=e-n,a=t-r;return i*i+a*a}var I_=class{constructor(e=!1){this._enableOneCellCache=e,P(this,`_tree`,new Map),P(this,`_oneCellCache`,new Map),P(this,`_kdTree`,new Map)}dispose(){this.clear()}getTree(e,t){return this._tree.has(e)||this._tree.set(e,new Map),this._tree.get(e).has(t)||this._tree.get(e).set(t,new Gf),this._tree.get(e).get(t)}_getOneCellCache(e,t,n,r){return this._oneCellCache.has(e)||this._oneCellCache.set(e,new Map),this._oneCellCache.get(e).has(t)||this._oneCellCache.get(e).set(t,new Map),this._oneCellCache.get(e).get(t).has(n)||this._oneCellCache.get(e).get(t).set(n,new Map),this._oneCellCache.get(e).get(t).get(n).has(r)||this._oneCellCache.get(e).get(t).get(n).set(r,new Set),this._oneCellCache.get(e).get(t).get(n).get(r)}_removeOneCellCache(e,t,n,r,i){let a=this._oneCellCache.get(e);if(!a)return;let o=a.get(t);if(!o)return;let s=o.get(n);if(!s)return;let c=s.get(r);c&&c.delete(i)}_removeCellCacheByRange(e){let{unitId:t,sheetId:n,range:r,id:i}=e,a=this._oneCellCache.get(t);if(!a)return;let o=a.get(n);if(!o)return;let{startRow:s,startColumn:c,endRow:l,endColumn:u}=r;for(let e=s;e<=l;e++){let t=o.get(e);if(t)for(let e=c;e<=u;e++){let n=t.get(e);n&&n.delete(i)}}}_insertOneCellCache(e,t,n,r,i){this._getOneCellCache(e,t,n,r).add(i)}_getRdTreeItems(e){let t=[];for(let[n,r]of e)for(let[e,i]of r)t.push({x:e,y:n,ids:i});return t}_searchByOneCellCache(e){var t;let{unitId:n,sheetId:r,range:i}=e,{startRow:a,startColumn:o,endRow:s,endColumn:c}=i,l=(t=this._kdTree.get(n))==null?void 0:t.get(r);if(!l)return[];let{tree:u,items:d}=l,f=u.range(o,a,c,s),p=[];for(let e of f){let t=d[e];p.push(...Array.from(t.ids))}return p}openKdTree(){for(let[t,n]of this._oneCellCache){this._kdTree.has(t)||this._kdTree.set(t,new Map);for(let[r,i]of n){var e;let n=this._getRdTreeItems(i),a=new A_(n.length);(e=this._kdTree.get(t))==null||e.set(r,{tree:a,items:n});for(let e of n)a.add(e.x,e.y);a.finish()}}}closeKdTree(){for(let[t,n]of this._oneCellCache)for(let[r,i]of n){var e;(e=this._kdTree.get(t))==null||e.set(r,void 0)}}insert(e){let{unitId:t,sheetId:n,range:r,id:i}=e;if(!t||t.length===0)return;let{startRow:a,endRow:o,startColumn:s,endColumn:c}=r;if(this._enableOneCellCache&&a===o&&s===c){this._insertOneCellCache(t,n,a,s,i);return}let l=this.getTree(t,n);Number.isNaN(a)&&(a=0),Number.isNaN(s)&&(s=0),Number.isNaN(o)&&(o=1/0),Number.isNaN(c)&&(c=1/0),l.insert({minX:s,minY:a,maxX:c,maxY:o,id:i})}bulkInsert(e){for(let t of e)this.insert(t)}*searchGenerator(e){var t;let{unitId:n,sheetId:r,range:i}=e;if(this._enableOneCellCache){let t=this._searchByOneCellCache(e);for(let e of t)yield e}let a=(t=this._tree.get(n))==null?void 0:t.get(r);if(!a)return;let o=a.search({minX:i.startColumn,minY:i.startRow,maxX:i.endColumn,maxY:i.endRow});for(let e of o)yield e.id}bulkSearch(e,t){let n=new Set;for(let r of e)for(let e of this.searchGenerator(r))(t==null?void 0:t.has(e))!==!0&&n.add(e);return n}removeById(e,t){if(t){var n,r;(n=this._tree.get(e))==null||n.delete(t),(r=this._oneCellCache.get(e))==null||r.delete(t)}else this._tree.delete(e),this._oneCellCache.delete(e)}_removeRTreeItem(e){let{unitId:t,sheetId:n,range:r,id:i}=e,a=this.getTree(t,n),o=a.search({minX:r.startColumn,minY:r.startRow,maxX:r.endColumn,maxY:r.endRow});for(let e=0;e<o.length;e++)o[e].id===i&&a.remove(o[e])}remove(e){let{unitId:t,sheetId:n,range:r,id:i}=e,{startRow:a,startColumn:o,endRow:s,endColumn:c}=r;this._enableOneCellCache?a===s&&o===c?this._removeOneCellCache(t,n,r.startRow,r.startColumn,i):(this._removeCellCacheByRange(e),this._removeRTreeItem(e)):this._removeRTreeItem(e)}bulkRemove(e){for(let t of e)this.remove(t)}clear(){this._tree.clear(),this._oneCellCache.clear()}toJSON(){let e={};return this._tree.forEach((t,n)=>{e[n]={},t.forEach((t,r)=>{e[n][r]=t.toJSON()})}),e}fromJSON(e){this._tree.clear();for(let t in e){this._tree.set(t,new Map);for(let n in e[t]){let r=new Gf;r.fromJSON(e[t][n]),this._tree.get(t).set(n,r)}}}};function L_(e){return new Promise(t=>setTimeout(t,e))}function R_(e=1){return new Promise(t=>{let n=0,r=()=>{n++,n>=e?t():requestAnimationFrame(r)};requestAnimationFrame(r)})}let z_=class extends ra{constructor(e){super(),this._localeService=e,P(this,`_fontLocale`,void 0),P(this,`_dirty`,!0),this._localeInitial()}get dirty(){return this._dirty}getFontLocale(){return this._fontLocale}makeDirty(e){this._dirty=e}dispose(){super.dispose(),this._fontLocale=null}_localeInitial(){}};z_=Fs([W(0,(0,t.Inject)(r_))],z_);let B_=class extends z_{constructor(e,t,n,r,i,a){super(n),this.worksheet=e,this._styles=t,this._contextService=r,this._configService=i,this._injector=a,P(this,`_worksheetData`,void 0),P(this,`_renderRawFormula`,!1),P(this,`_cellData`,void 0),P(this,`_imageCacheMap`,void 0),P(this,`_skipAutoHeightForMergedCells`,!0),P(this,`_rowTotalHeight`,0),P(this,`_columnTotalWidth`,0),P(this,`_rowHeaderWidth`,0),P(this,`_columnHeaderHeight`,0),P(this,`_rowHeightAccumulation`,[]),P(this,`_columnWidthAccumulation`,[]),P(this,`_marginTop`,0),P(this,`_marginLeft`,0),P(this,`_scaleX`,void 0),P(this,`_scaleY`,void 0),P(this,`_scrollX`,void 0),P(this,`_scrollY`,void 0),this._worksheetData=this.worksheet.getConfig(),this._cellData=this.worksheet.getCellMatrix(),this._imageCacheMap=new E_(this._injector),this.initConfig()}initConfig(){var e,t;this._skipAutoHeightForMergedCells=!((e=this._configService.getConfig(ne))!=null&&e),this.worksheet.setIsRowStylePrecedeColumnStyle((t=this._configService.getConfig(`isRowStylePrecedeColumnStyle`))==null?!1:t)}resetCache(){}getWorksheetConfig(){return this._worksheetData}getLocation(){return[this.worksheet.getUnitId(),this.worksheet.getSheetId()]}set columnHeaderHeight(e){this._columnHeaderHeight=e,this._worksheetData.columnHeader.height=e}set rowHeaderWidth(e){this._rowHeaderWidth=e,this._worksheetData.rowHeader.width=e}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(e){this._marginLeft=e}setMarginTop(e){this._marginTop=e}setScale(e,t){this._updateLayout(),this._scaleX=e,this._scaleY=t||e,this._updateLayout()}setScroll(e,t){R.isDefine(e)&&(this._scrollX=e),R.isDefine(t)&&(this._scrollY=t)}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(e,t,n){let r=0,i=[],a=t;for(let t=0;t<e;t++){let e=n;if(this.worksheet.getRowFiltered(t))e=0;else if(a[t]!=null){let r=a[t];if(!r)continue;let{h:i=n,ah:o,ia:s}=r;e=(s==null||s===B.TRUE)&&typeof o==`number`&&o>0?o:i,r.hd===B.TRUE&&(e=0)}r+=e,i.push(r)}return{rowTotalHeight:r,rowHeightAccumulation:i}}_generateColumnMatrixCache(e,t,n){let r=0,i=[],a=t;for(let t=0;t<e;t++){let e=n;if(a[t]!=null){let n=a[t];if(!n)continue;n.w!=null&&(e=n.w),n.hd===B.TRUE&&(e=0)}r+=e,i.push(r)}return{columnTotalWidth:r,columnWidthAccumulation:i}}intersectMergeRange(e,t){return!!this.worksheet.getMergedCell(e,t)}_getOverflowBound(e,t,n,r,i=So.LEFT){let a=0;if(t>n){let o=this._columnWidthAccumulation.length-1;for(let s=t;s>=n;s--){let n=s;if(!wd(this.worksheet.getCell(e,n))&&n!==t||this.intersectMergeRange(e,n))return n===t?n:n+1>o?o:n+1;let{startX:c,endX:l}=U_(e,n,this.rowHeightAccumulation,this.columnWidthAccumulation);if(i===So.CENTER&&n===t?a+=(l-c)/2:a+=l-c,r<a)return n}return t}for(let o=t;o<=n;o++){let n=o;if(!wd(this.worksheet.getCell(e,n))&&n!==t||this.intersectMergeRange(e,n))return n===t?n:n-1<0?0:n-1;let{startX:s,endX:c}=U_(e,n,this.rowHeightAccumulation,this.columnWidthAccumulation);if(i===So.CENTER&&n===t?a+=(c-s)/2:a+=c-s,r<a)return n}return n}_updateLayout(){if(!this.dirty)return;let{rowData:e,columnData:t,defaultRowHeight:n,defaultColumnWidth:r,rowCount:i,columnCount:a,rowHeader:o,columnHeader:s}=this._worksheetData,{rowTotalHeight:c,rowHeightAccumulation:l}=this._generateRowMatrixCache(i,e,n),{columnTotalWidth:u,columnWidthAccumulation:d}=this._generateColumnMatrixCache(a,t,r);this._rowHeaderWidth=o.hidden===B.TRUE?0:this._dynamicallyUpdateRowHeaderWidth(o),this._columnHeaderHeight=s.hidden===B.TRUE?0:s.height,this._rowTotalHeight=c,this._rowHeightAccumulation=l,this._columnTotalWidth=u,this._columnWidthAccumulation=d,this.makeDirty(!1)}calculate(){return this.resetCache(),this._updateLayout(),this}resetRangeCache(e){}_dynamicallyUpdateRowHeaderWidth(e){let t=`${this.worksheet.getRowCount()}`.length*8;return Math.max(e.width,t)}_hasUnMergedCellInRow(e,t,n){if(!this.worksheet.getMergeData())return!1;for(let r=t;r<=n;r++){let{isMerged:t,isMergedMainCell:n}=this.worksheet.getCellInfoInMergeData(e,r);if(!t&&!n)return!0}return!1}expandRangeByMerge(e,t){let{startRow:n,startColumn:r,endRow:i,endColumn:a}=e,o=this._worksheetData.mergeData;if(!o)return{startRow:n,startColumn:r,endRow:i,endColumn:a};let s=!0,c=new yd,l=0,u=null;for(;s;){s=!1;for(let e=0;e<o.length;e++){let{startRow:t,startColumn:d,endRow:f,endColumn:p}=o[e];if(c.getValue(t,d))continue;let m={startColumn:r,startRow:n,endColumn:a,endRow:i},h={startColumn:d,startRow:t,endColumn:p,endRow:f};pp(m,h)&&(n=Math.min(n,t),r=Math.min(r,d),i=Math.max(i,f),a=Math.max(a,p),c.setValue(t,d,!0),s=!0,l++,u=h)}}return t&&l===1&&_p.contains(u,e)?{startRow:u.startRow,startColumn:u.startColumn,endRow:u.startRow,endColumn:u.startColumn}:{startRow:n,startColumn:r,endRow:i,endColumn:a}}getColumnCount(){return this._columnWidthAccumulation.length}getRowCount(){return this._rowHeightAccumulation.length}_getCellMergeInfo(e,t){return this.worksheet.getCellInfoInMergeData(e,t)}getNoMergeCellPositionByIndex(e,t,n=!0){return this.getNoMergeCellWithCoordByIndex(e,t,n)}getNoMergeCellWithCoordByIndex(e,t,n=!0){let{rowHeightAccumulation:r,columnWidthAccumulation:i,rowHeaderWidthAndMarginLeft:a,columnHeaderHeightAndMarginTop:o}=this,{startY:s,endY:c,startX:l,endX:u}=U_(e,t,r,i);return n&&(s+=o,c+=o,l+=a,u+=a),{startY:s,endY:c,startX:l,endX:u}}getNoMergeCellPositionByIndexWithNoHeader(e,t){let{rowHeightAccumulation:n,columnWidthAccumulation:r}=this,{startY:i,endY:a,startX:o,endX:s}=U_(e,t,n,r);return{startY:i,endY:a,startX:o,endX:s}}getRowIndexByOffsetY(e,t,n,r){let{rowHeightAccumulation:i}=this;e=G_(e,t,n,this.columnHeaderHeightAndMarginTop);let a=ec(i,e,r==null?void 0:r.firstMatch);if(r!=null&&r.closeFirst){var o;Math.abs(i[a]-e)<Math.abs(e-((o=i[a-1])==null?0:o))&&(a+=1)}return a}getColumnIndexByOffsetX(e,t,n,r){let i=W_(e,t,n,this.rowHeaderWidthAndMarginLeft),{columnWidthAccumulation:a}=this,o=ec(a,i,r==null?void 0:r.firstMatch);if(r!=null&&r.closeFirst){var s;Math.abs(a[o]-i)<Math.abs(i-((s=a[o-1])==null?0:s))&&(o+=1)}return o}getCellIndexByOffset(e,t,n,r,i,a){return{row:this.getRowIndexByOffsetY(t,r,i,a),column:this.getColumnIndexByOffsetX(e,n,i,a)}}getCellByOffset(e,t,n,r,i){var a;let o=(a=this)==null?void 0:a.getCellIndexByOffset(e,t,n,r,i,{firstMatch:!0});return o?this.worksheet.getCellInfoInMergeData(o.row,o.column):null}getCellWithCoordByIndex(e,t,n=!0){var r;let{rowHeightAccumulation:i,columnWidthAccumulation:a,rowHeaderWidthAndMarginLeft:o,columnHeaderHeightAndMarginTop:s}=this,c=U_(e,t,i,a,(r=this.worksheet)==null?void 0:r.getCellInfoInMergeData(e,t)),{isMerged:l,isMergedMainCell:u}=c,{startY:d,endY:f,startX:p,endX:m,mergeInfo:h}=c,g=o,_=s;return n===!1&&(g=0,_=0),d+=_,f+=_,p+=g,m+=g,h.startY+=_,h.endY+=_,h.startX+=g,h.endX+=g,{actualRow:e,actualColumn:t,startX:p,startY:d,endX:m,endY:f,isMerged:l,isMergedMainCell:u,mergeInfo:h}}getCellWithCoordByOffset(e,t,n,r,i,a){let{row:o,column:s}=this.getCellIndexByOffset(e,t,n,r,i,a);return this.getCellWithCoordByIndex(o,s)}getOffsetByColumn(e){let{columnWidthAccumulation:t,rowHeaderWidthAndMarginLeft:n}=this,r=t.length-1,i=t[e];return i==null?e<0?n:t[r]+n:i+n}getOffsetByRow(e){let{rowHeightAccumulation:t,columnHeaderHeightAndMarginTop:n}=this,r=t.length-1,i=t[e];return i==null?e<0?n:t[r]+n:i+n}getOffsetRelativeToRowCol(e,t){let n=ec(this.columnWidthAccumulation,e),r=0;r=n===0?e:e-this._columnWidthAccumulation[n-1];let i=ec(this.rowHeightAccumulation,t),a=0;return a=i===0?t:t-this._rowHeightAccumulation[i-1],{row:i,column:n,columnOffset:r,rowOffset:a}}_updateConfigAndGetDocumentModel(e,t,n,r){var i,a,o,s,c;if(!r||!((i=e.body)!=null&&i.dataStream))return;e.documentStyle||(e.documentStyle={}),e.documentStyle.marginTop=(a=n.t)==null?0:a,e.documentStyle.marginBottom=(o=n.b)==null?2:o,e.documentStyle.marginLeft=(s=n.l)==null?2:s,e.documentStyle.marginRight=(c=n.r)==null?2:c,e.documentStyle.pageSize={width:1/0,height:1/0},e.documentStyle.renderConfig={...e.documentStyle.renderConfig,...r};let l=e.body.paragraphs||[];for(let e of l)e.paragraphStyle||(e.paragraphStyle={}),e.paragraphStyle.horizontalAlign=t;return new eh(e)}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}};B_=Fs([W(2,(0,t.Inject)(r_)),W(3,ks),W(4,Ds),W(5,(0,t.Inject)(t.Injector))],B_);function V_(e,t,n,r){let i=e-1,a=t-1,o=n[i]||0,s=n[e];s==null&&(s=n[n.length-1]);let c=r[a]||0,l=r[t];return l==null&&(l=r[r.length-1]),{startY:o,endY:s,startX:c,endX:l}}function H_(e,t,n,r){return V_(e,t,n,r)}function U_(e,t,n,r,i){e=R.clamp(e,0,n.length-1),t=R.clamp(t,0,r.length-1);let{startY:a,endY:o,startX:s,endX:c}=V_(e,t,n,r);if(!i)return{startY:a,endY:o,startX:s,endX:c,isMerged:!1,isMergedMainCell:!1,actualRow:e,actualColumn:t,mergeInfo:{startY:a,endY:o,startX:s,endX:c,startRow:e,startColumn:t,endRow:e,endColumn:t}};let{isMerged:l,isMergedMainCell:u,startRow:d,startColumn:f,endRow:p,endColumn:m}=i,h={startRow:d,startColumn:f,endRow:p,endColumn:m,startY:a,endY:o,startX:s,endX:c},g=n.length-1,_=r.length-1;if(l&&d!==-1&&f!==-1){let e=n[d-1]||0,t=n[p]||n[g],i=r[f-1]||0,a=r[m]||r[_];h={...h,startY:e,endY:t,startX:i,endX:a}}else if(!l&&p!==-1&&m!==-1){let e=n[p]||n[g],t=r[m]||r[_];h={...h,startY:a,endY:e,startX:s,endX:t}}return{isMerged:l,isMergedMainCell:u,actualRow:e,actualColumn:t,startY:a,endY:o,startX:s,endX:c,mergeInfo:h}}function W_(e,t,n,r){let{x:i}=n;return e/t+i-r}function G_(e,t,n,r){let{y:i}=n;return e=e/t+i-r,e}let K_=[`script`,`style`,`meta`,`comment`,`link`],q_=function(e){return e[e.INFO=0]=`INFO`,e[e.STOP=1]=`STOP`,e[e.WARNING=2]=`WARNING`,e}({}),J_=function(e){return 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}({}),Y_=function(e){return 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}({}),X_=function(e){return e[e.TEXT=0]=`TEXT`,e[e.ARROW=1]=`ARROW`,e[e.CUSTOM=2]=`CUSTOM`,e}({}),Z_=function(e){return e.VALID=`valid`,e.INVALID=`invalid`,e.VALIDATING=`validating`,e}({}),Q_=function(e){return 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}({}),$_=class extends ra{constructor(e,t){super(),this._resourceManagerService=e,this._univerInstanceService=t,this._init()}_init(){let e=e=>{e.businesses.forEach(t=>{switch(t){case I.UNRECOGNIZED:case I.UNIVER_UNKNOWN:case I.UNIVER_SLIDE:case I.UNIVER_DOC:this._univerInstanceService.getAllUnitsForType(I.UNIVER_DOC).forEach(t=>{let n=(t.getSnapshot().resources||[]).find(t=>t.name===e.pluginName);if(n)try{let r=e.parseJson(n.data);e.onLoad(t.getUnitId(),r)}catch{console.error(`Load Document{${t.getUnitId()}} Resources{${e.pluginName}} Data Error.`)}});break;case I.UNIVER_SHEET:this._univerInstanceService.getAllUnitsForType(I.UNIVER_SHEET).forEach(t=>{let n=(t.getSnapshot().resources||[]).find(t=>t.name===e.pluginName);if(n)try{let r=e.parseJson(n.data);e.onLoad(t.getUnitId(),r)}catch{console.error(`Load Workbook{${t.getUnitId()}} Resources{${e.pluginName}} Data Error.`)}})}})};this._resourceManagerService.getAllResourceHooks().forEach(t=>e(t)),this.disposeWithMe(this._resourceManagerService.register$.subscribe(t=>e(t))),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(I.UNIVER_SHEET).subscribe(e=>{this._resourceManagerService.loadResources(e.getUnitId(),e.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(I.UNIVER_DOC).subscribe(e=>{ie(e.getUnitId())||this._resourceManagerService.loadResources(e.getUnitId(),e.getSnapshot().resources)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(I.UNIVER_SHEET).subscribe(e=>{this._resourceManagerService.unloadResources(e.getUnitId(),I.UNIVER_SHEET)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(I.UNIVER_DOC).subscribe(e=>{this._resourceManagerService.unloadResources(e.getUnitId(),I.UNIVER_DOC)}))}saveUnit(e){let t=this._univerInstanceService.getUnit(e);if(!t)return null;let n=this._resourceManagerService.getResources(e,t.type),r=R.deepClone(t.getSnapshot());return r.resources=n,r}};$_=Fs([W(0,(0,t.Inject)(qh)),W(1,(0,t.Inject)(Xg))],$_);var ev=class{get _univerInstanceService(){return this._injector.get(Xg)}get _pluginService(){return this._injector.get(m_)}constructor(e={},t){P(this,`_startedTypes`,new Set),P(this,`_injector`,void 0),P(this,`_disposingCallbacks`,new na);let n=this._injector=tv(t,e==null?void 0:e.override),{theme:r,darkMode:i,locale:a,locales:o,logLevel:s,logCommandExecution:c}=e;r&&this._injector.get(__).setTheme(r),i&&this._injector.get(__).setDarkMode(i),o&&this._injector.get(r_).load(o),a&&this._injector.get(r_).setLocale(a),s&&this._injector.get(Ms).setLogLevel(s),c!==void 0&&this._injector.get(Ds).setConfig(Is,c),this._init(n)}__getInjector(){return this._injector}onDispose(e){let t=this._disposingCallbacks.add(ta(e));return ta(()=>t.dispose(!0))}dispose(){this._disposingCallbacks.dispose(),this._injector.dispose()}setLocale(e){this._injector.get(r_).setLocale(e)}createUnit(e,t){return this._univerInstanceService.createUnit(e,t)}createUniverSheet(e){return this._injector.get(Ms).warn(`[Univer]`,`Univer.createUniverSheet is deprecated, use createUnit instead`),this._univerInstanceService.createUnit(I.UNIVER_SHEET,e)}createUniverDoc(e){return this._injector.get(Ms).warn(`[Univer]`,`Univer.createUniverDoc is deprecated, use createUnit instead`),this._univerInstanceService.createUnit(I.UNIVER_DOC,e)}createUniverSlide(e){return this._injector.get(Ms).warn(`[Univer]`,`Univer.createUniverSlide is deprecated, use createUnit instead`),this._univerInstanceService.createUnit(I.UNIVER_SLIDE,e)}_init(e){this._univerInstanceService.registerCtorForType(I.UNIVER_SHEET,Jg),this._univerInstanceService.registerCtorForType(I.UNIVER_DOC,eh),this._univerInstanceService.registerCtorForType(I.UNIVER_SLIDE,Yg);let t=e.get(Xg);t.__setCreateHandler((n,r,i,a)=>{if(!this._startedTypes.has(n)){this._pluginService.startPluginsForType(n),this._startedTypes.add(n);let o=e.createInstance(i,r);return t.__addUnit(o,a),this._tryProgressToReady(),o}let o=e.createInstance(i,r);return t.__addUnit(o,a),o})}_tryProgressToReady(){this._injector.get(e_).stage<$.Ready&&(this._injector.get(e_).stage=$.Ready)}registerPlugin(e,t){this._pluginService.registerPlugin(e,t)}registerPlugins(e){e.forEach(e=>{let[t,n]=e;this._pluginService.registerPlugin(t,n)})}};function tv(e,n){let r=l_([[cg],[r_],[__],[e_],[m_],[Zh],[Xg,{useClass:Zg}],[s_,{useClass:c_}],[Ms,{useClass:Ns,lazy:!0}],[Rs,{useClass:Vs}],[y_,{useClass:T_,lazy:!0}],[Ds,{useClass:Os}],[ks,{useClass:As}],[qh,{useClass:g_,lazy:!0}],[h_,{useClass:$_,lazy:!0}],[$h,{useClass:Qh}],[a_,{useClass:i_,lazy:!0}]],n),i=e?e.createChild(r):new t.Injector(r);return se(i,[[Zh],[h_]]),i}y(),e.ABCToNumber=wp,e.AUTO_HEIGHT_FOR_MERGED_CELLS=ne,e.AbsoluteRefType=K,e.ActionIterator=Am,e.AlignTypeH=as,e.AlignTypeV=os,e.ArrangeTypeEnum=ds,e.ArrowsAndMarkersShapes=ho,e.AsyncInterceptorManager=xe,e.AsyncLock=O.default,Object.defineProperty(e,`AuthzIoLocalService`,{enumerable:!0,get:function(){return Qh}}),e.AutoFillSeries=$a,e.BaselineOffset=Do,e.BasicShapes=mo,e.BlockType=Io,e.BooleanNumber=B,e.BorderStyleTypes=z,e.BorderType=eo,e.BuildTextUtils=Nh,e.BulletAlignment=No,e.COLORS=rc,e.COMMAND_LOG_EXECUTION_CONFIG_KEY=Is,e.CanceledError=ue,e.CellModeEnum=Ac,e.CellValueType=Oo,e.ColorKit=ic,e.ColorType=to,e.ColumnSeparatorType=Bo,Object.defineProperty(e,`CommandService`,{enumerable:!0,get:function(){return Vs}}),e.CommandType=Ls,e.CommonHideTypes=no,e.ConfigService=Os,e.ContextService=As,e.CopyPasteType=ro,e.CustomCommandExecutionError=le,e.CustomDecorationType=Fo,e.CustomRangeType=Po,e.DEFAULT_CELL=Mf,e.DEFAULT_DOC=Qm,e.DEFAULT_DOCUMENT_SUB_COMPONENT_ID=`__default_document_sub_component_id20231101__`,e.DEFAULT_EMPTY_DOCUMENT_VALUE=`\r
9
+ `,e.DEFAULT_NUMBER_FORMAT=`General`,e.DEFAULT_RANGE=Af,e.DEFAULT_RANGE_ARRAY=kf,e.DEFAULT_SELECTION=jf,e.DEFAULT_SLIDE=Pf,e.DEFAULT_STYLES=Nf,e.DEFAULT_TEXT_FORMAT=`@@@`,e.DEFAULT_TEXT_FORMAT_EXCEL=`@`,e.DEFAULT_WORKSHEET_COLUMN_COUNT=20,e.DEFAULT_WORKSHEET_COLUMN_COUNT_KEY=`DEFAULT_WORKSHEET_COLUMN_COUNT`,e.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT=20,e.DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY=`DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT`,e.DEFAULT_WORKSHEET_COLUMN_WIDTH=88,e.DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY=`DEFAULT_WORKSHEET_COLUMN_WIDTH`,e.DEFAULT_WORKSHEET_ROW_COUNT=zg,e.DEFAULT_WORKSHEET_ROW_COUNT_KEY=`DEFAULT_WORKSHEET_ROW_COUNT`,e.DEFAULT_WORKSHEET_ROW_HEIGHT=24,e.DEFAULT_WORKSHEET_ROW_HEIGHT_KEY=`DEFAULT_WORKSHEET_ROW_HEIGHT`,e.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH=46,e.DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY=`DEFAULT_WORKSHEET_ROW_TITLE_WIDTH`,e.DOCS_COMMENT_EDITOR_UNIT_ID_KEY=te,e.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY=N,e.DOCS_NORMAL_EDITOR_UNIT_ID_KEY=M,e.DOCS_ZEN_EDITOR_UNIT_ID_KEY=ee,e.DOC_DRAWING_PRINTING_COMPONENT_KEY=`univer-docs-drawing-printing`,e.DOC_RANGE_TYPE=Oc,e.DashStyleType=qo,e.DataStreamTreeNodeType=Gm,e.DataStreamTreeTokenType=Km,e.DataValidationErrorStyle=q_,e.DataValidationImeMode=J_,e.DataValidationOperator=Y_,e.DataValidationRenderMode=X_,e.DataValidationStatus=Z_,e.DataValidationType=Q_,e.DeleteDirection=io,e.DependentOn=p_,e.DesktopLogService=Ns,e.DeveloperMetadataVisibility=ao,e.Dimension=oo,e.Direction=so,e.Disposable=ra,e.DisposableCollection=na,e.DocStyleType=jo,e.DocumentDataModel=eh,e.DocumentFlavor=Lo,e.DrawingTypeEnum=fs,e.EDITOR_ACTIVATED=og,e.EXTENSION_NAMES=Rf,e.ErrorService=cg,e.EventState=Wh,e.EventSubject=Gh,e.FOCUSING_COMMENT_EDITOR=`FOCUSING_COMMENT_EDITOR`,e.FOCUSING_COMMON_DRAWINGS=`FOCUSING_COMMON_DRAWINGS`,e.FOCUSING_DOC=ig,e.FOCUSING_EDITOR_BUT_HIDDEN=`FOCUSING_EDITOR_BUT_HIDDEN`,e.FOCUSING_EDITOR_INPUT_FORMULA=`FOCUSING_EDITOR_INPUT_FORMULA`,e.FOCUSING_EDITOR_STANDALONE=`FOCUSING_EDITOR_INPUT_FORMULA`,e.FOCUSING_FX_BAR_EDITOR=sg,e.FOCUSING_PANEL_EDITOR=`FOCUSING_PANEL_EDITOR`,e.FOCUSING_SHAPE_TEXT_EDITOR=`FOCUSING_SHAPE_TEXT_EDITOR`,e.FOCUSING_SHEET=rg,e.FOCUSING_SLIDE=ag,e.FOCUSING_UNIT=ng,e.FOCUSING_UNIVER_EDITOR=`FOCUSING_UNIVER_EDITOR`,e.FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE=`FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE`,e.FORMULA_EDITOR_ACTIVATED=`FORMULA_EDITOR_ACTIVATED`,e.FollowNumberWithType=Mo,e.FontItalic=To,e.FontStyleType=ts,e.FontWeight=Eo,e.GridType=Ro,e.HorizontalAlign=So,e.IAuthzIoService=$h,e.ICommandService=Rs,e.IConfigService=Ds,e.IConfirmService=eg,e.IContextService=ks,e.IImageIoService=dg,e.ILocalStorageService=n_,e.ILogService=Ms,e.IMentionIOService=a_,e.IPermissionService=s_,e.IResourceLoaderService=h_,e.IResourceManagerService=qh,e.IS_ROW_STYLE_PRECEDE_COLUMN_STYLE=`isRowStylePrecedeColumnStyle`,e.IURLImageService=fg,e.IUndoRedoService=y_,e.IUniverInstanceService=Xg,e.ImageCacheMap=E_,e.ImageSourceType=lg,e.ImageUploadStatusType=ug,Object.defineProperty(e,`Inject`,{enumerable:!0,get:function(){return t.Inject}}),Object.defineProperty(e,`InjectSelf`,{enumerable:!0,get:function(){return t.InjectSelf}}),Object.defineProperty(e,`Injector`,{enumerable:!0,get:function(){return t.Injector}}),e.InterceptorEffectEnum=he,e.InterceptorManager=ve,e.InterpolationPointType=lo,Object.defineProperty(e,`JSON1`,{enumerable:!0,get:function(){return Es}}),e.JSONX=Wm,e.LRUHelper=Tf,e.LRUMap=wf,Object.defineProperty(e,`LifecycleService`,{enumerable:!0,get:function(){return e_}}),e.LifecycleStages=$,e.LifecycleUnreachableError=$g,e.ListGlyphType=V,Object.defineProperty(e,`LocalUndoRedoService`,{enumerable:!0,get:function(){return T_}}),e.LocaleService=r_,e.LocaleType=uo,e.LogLevel=js,Object.defineProperty(e,`LookUp`,{enumerable:!0,get:function(){return t.LookUp}}),e.MAX_COLUMN_COUNT=Of,e.MAX_ROW_COUNT=Df,e.MOVE_BUFFER_VALUE=2,Object.defineProperty(e,`Many`,{enumerable:!0,get:function(){return t.Many}}),e.MemoryCursor=Ui,Object.defineProperty(e,`MentionIOLocalService`,{enumerable:!0,get:function(){return i_}}),e.MentionType=fo,e.NAMED_STYLE_MAP=If,e.NAMED_STYLE_SPACE_MAP=Lf,e.NamedStyleType=Go,e.NilCommand=Bs,e.NumberUnitType=is,e.ObjectMatrix=yd,e.ObjectRelativeFromH=ns,e.ObjectRelativeFromV=rs,Object.defineProperty(e,`Optional`,{enumerable:!0,get:function(){return t.Optional}}),e.OtherShapes=go,e.PAGE_SIZE=zf,e.PAPER_TYPES=us,e.PRESET_LIST_TYPE=nm,e.PRINT_CHART_COMPONENT_KEY=`univer-sheets-chart-print-chart`,e.PageElementType=ms,e.PageOrientType=cs,e.PageType=ps,e.PaperType=ls,e.ParagraphElementType=Ho,e.ParagraphStyleBuilder=Vh,e.ParagraphStyleValue=Bh,e.PermissionService=c_,e.PermissionStatus=o_,e.Plugin=d_,Object.defineProperty(e,`PluginService`,{enumerable:!0,get:function(){return m_}}),e.PositionedObjectLayoutType=Wo,e.PresetListType=Z,e.ProtectionType=po,Object.defineProperty(e,`Quantity`,{enumerable:!0,get:function(){return t.Quantity}}),e.QuickListType=Zp,e.QuickListTypeMap=am,e.RANGE_DIRECTION=Dc,e.RANGE_TYPE=G,e.RBush=Gf,e.RCDisposable=aa,e.RGBA_PAREN=`rgba(`,e.RGB_PAREN=`rgb(`,e.ROTATE_BUFFER_VALUE=1,e.RTree=I_,e.Range=Vf,e.Rectangle=_p,Object.defineProperty(e,`RediError`,{enumerable:!0,get:function(){return t.RediError}}),e.RedoCommand=w_,e.RedoCommandId=x_,e.RefAlias=Sp,e.Registry=Ji,e.RegistryAsMap=Yi,e.RelativeDate=vo,e.RelativeSlideLink=hs,Object.defineProperty(e,`ResourceManagerService`,{enumerable:!0,get:function(){return g_}}),e.RichTextBuilder=Uh,e.RichTextValue=Hh,e.RxDisposable=ia,e.SHEET_EDITOR_UNITS=Ff,e.SectionType=zo,Object.defineProperty(e,`Self`,{enumerable:!0,get:function(){return t.Self}}),Object.defineProperty(e,`SheetSkeleton`,{enumerable:!0,get:function(){return B_}}),e.SheetTypes=yo,e.SheetViewModel=Hg,Object.defineProperty(e,`Skeleton`,{enumerable:!0,get:function(){return z_}}),Object.defineProperty(e,`SkipSelf`,{enumerable:!0,get:function(){return t.SkipSelf}}),e.SliceBodyType=hm,e.SlideDataModel=Yg,e.SpacingRule=Ko,e.SpecialShapes=_o,e.Styles=gg,e.THEME_COLORS=jc,e.TabStopAlignment=Jo,e.TableAlignmentType=Xo,e.TableLayoutType=Zo,e.TableRowHeightRule=$o,e.TableSizeType=Yo,e.TableTextWrapType=Qo,e.TestConfirmService=tg,e.TextDecoration=xo,e.TextDecorationBuilder=zh,e.TextDirection=bo,e.TextDirectionType=Vo,e.TextStyleBuilder=Rh,e.TextStyleValue=Lh,e.TextX=Q,e.TextXActionType=U,e.ThemeColorType=ko,e.ThemeColors=Ao,e.ThemeService=__,e.Tools=R,e.UndoCommand=C_,e.UndoCommandId=S_,e.UnitModel=Pa,e.Univer=ev,Object.defineProperty(e,`UniverInstanceService`,{enumerable:!0,get:function(){return Zg}}),e.UniverInstanceType=I,e.UpdateDocsAttributeType=H,e.UserManagerService=Zh,e.VerticalAlign=Co,e.VerticalAlignmentType=es,Object.defineProperty(e,`WithNew`,{enumerable:!0,get:function(){return t.WithNew}}),Object.defineProperty(e,`Workbook`,{enumerable:!0,get:function(){return Jg}}),e.Worksheet=Wg,e.WrapStrategy=wo,e.WrapTextType=Uo,e.addLinkToDocumentModel=wg,e.afterInitApply=Xs,e.afterTime=Js,e.awaitTime=L_,e.binSearchFirstGreaterThanTarget=$s,e.binarySearchArray=Qs,e.bufferDebounceTime=qs,e.cellToRange=Nd,e.characterSpacingControlType=ss,e.checkForSubstrings=Rd,e.checkIfMove=nc,e.checkParagraphHasBullet=af,e.checkParagraphHasIndent=of,e.checkParagraphHasIndentByStyle=sf,e.cloneCellData=jg,e.cloneCellDataMatrix=Ng,e.cloneCellDataWithSpanAndDisplay=Mg,e.cloneValue=Ag,e.cloneWorksheetData=Ig,e.codeToBlob=tc,e.columnLabelToNumber=Ef,e.composeBody=Om,e.composeInterceptors=_e,e.composeStyles=Xa,e.concatMatrixArray=md,e.convertCellToRange=bd,e.convertObservableToBehaviorSubject=Ys,e.covertCellValue=Pd,e.covertCellValues=Fd,e.createAsyncInterceptorKey=ye,e.createDefaultUser=Yh,e.createDocumentModelWithStyle=xg,Object.defineProperty(e,`createIdentifier`,{enumerable:!0,get:function(){return t.createIdentifier}}),e.createInterceptorKey=ge,e.createInternalEditorID=re,e.createREGEXFromWildChar=Qa,e.createRowColIter=Cp,e.customNameCharacterCheck=O_,e.dayjs=Jd.default,e.debounce=Mi,e.dedupe=x,e.dedupeBy=S,e.deepCompare=Id,e.delayAnimationFrame=R_,e.deleteContent=lf,e.extractPureTextFromCell=Gg,Object.defineProperty(e,`forwardRef`,{enumerable:!0,get:function(){return t.forwardRef}}),e.fromCallback=Gs,e.fromEventSubject=Kh,e.generateIntervalsByPoints=ff,e.generateRandomId=Ya,e.get=ti,e.getArrayLength=ud,e.getBodySlice=xm,e.getBorderStyleType=Ad,e.getCellCoordByIndexSimple=V_,e.getCellInfoInMergeData=kc,e.getCellPositionByIndexSimple=H_,e.getCellValueType=Cc,e.getCellWithCoordByIndexCore=U_,e.getColorStyle=Td,e.getCustomBlockSlice=bm,e.getCustomDecorationSlice=wm,e.getCustomRangeSlice=Cm,e.getDocsUpdateBody=jd,e.getEmptyCell=Eg,e.getIntersectRange=pp,e.getNumfmtParseValueFilter=cd,e.getOriginCellValue=Kg,e.getParagraphsSlice=vm,e.getPlainText=Ym,e.getReverseDirection=co,e.getSectionBreakSlice=ym,e.getTableSlice=_m,e.getTextRunSlice=gm,e.getTransformOffsetX=W_,e.getTransformOffsetY=G_,e.getWorksheetUID=qg,e.groupBy=T,e.handleStyleToString=Od,e.hashAlgorithm=df,e.horizontalLineSegmentsSubtraction=rf,e.insertMatrixArray=fd,e.insertTextToContent=cf,e.invertColorByHSL=Ne,e.invertColorByMatrix=Ie,Object.defineProperty(e,`isAsyncDependencyItem`,{enumerable:!0,get:function(){return t.isAsyncDependencyItem}}),Object.defineProperty(e,`isAsyncHook`,{enumerable:!0,get:function(){return t.isAsyncHook}}),e.isBlackColor=bc,e.isBooleanString=A,e.isCellCoverable=wd,e.isCellV=Tc,Object.defineProperty(e,`isClassDependencyItem`,{enumerable:!0,get:function(){return t.isClassDependencyItem}}),e.isCommentEditorID=ae,Object.defineProperty(e,`isCtor`,{enumerable:!0,get:function(){return t.isCtor}}),e.isDefaultFormat=rd,Object.defineProperty(e,`isDisposable`,{enumerable:!0,get:function(){return t.isDisposable}}),e.isEmptyCell=Cd,Object.defineProperty(e,`isFactoryDependencyItem`,{enumerable:!0,get:function(){return t.isFactoryDependencyItem}}),e.isFormulaId=Dd,e.isFormulaString=Ed,e.isICellData=Sc,e.isInternalEditorID=ie,e.isNodeEnv=Za,e.isNotNullOrUndefined=Tg,e.isNullCell=wc,e.isNumeric=Gi,e.isPatternEqualWithoutDecimal=id,e.isRangesEqual=_g,e.isRealNum=uf,e.isSafeNumeric=Ki,e.isSameStyleTextRun=Ld,e.isTextFormat=nd,e.isUnitRangesEqual=vg,e.isValidRange=Md,Object.defineProperty(e,`isValueDependencyItem`,{enumerable:!0,get:function(){return t.isValueDependencyItem}}),e.isWhiteColor=xc,e.makeArray=E,e.makeCellRangeToRangeData=Sd,e.makeCellToSelection=xd,e.makeCustomRangeStream=qm,e.mapObjectMatrix=ld,e.merge=Bi,e.mergeIntervals=pf,e.mergeLocales=mf,e.mergeOverrideWithDependencies=l_,e.mergeSets=$i,e.mergeWith=zi,e.mergeWorksheetSnapshotWithDefault=Bg,e.mixinClass=Wi,e.moveMatrixArray=gd,e.moveRangeByOffset=op,e.nameCharacterCheck=D_,e.normalizeBody=Sm,e.normalizeTextRuns=jp,e.numberToABC=Tp,e.numberToListABC=Dp,Object.defineProperty(e,`numfmt`,{enumerable:!0,get:function(){return Wu}}),e.queryObjectMatrix=xp,e.registerDependencies=oe,e.remove=b,e.repeatStringNumTimes=Ep,e.replaceInDocumentBody=Ph,e.requestImmediateMacroTask=Xi,e.resolveWithBasePath=Va,e.rotate=w,e.searchArray=ec,e.searchInOrderedArray=Zs,e.selectionToArray=Ec,e.sequence=Qi,e.sequenceAsync=Zi,e.sequenceExecute=Us,e.sequenceExecuteAsync=Ws,e.set=Hi,Object.defineProperty(e,`setDependencies`,{enumerable:!0,get:function(){return t.setDependencies}}),e.shallowEqual=ce,e.skipParseTagNames=K_,e.sliceMatrixArray=hd,e.sortRules=Op,e.sortRulesByDesc=kp,e.sortRulesFactory=Ap,e.spliceArray=pd,e.splitIntoGrid=cp,e.takeAfter=Ks,Object.defineProperty(e,`textDiff`,{enumerable:!0,get:function(){return lh.default}}),e.throttle=de,e.toDisposable=ta,e.touchDependencies=se,e.updateAttributeByDelete=jm,e.updateAttributeByInsert=Mm,e.willLoseNumericPrecision=qi});