@evotecit/officeimo 0.1.21 → 0.1.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -8
- package/bundles/officeimo-canopyx-adapter.js +56 -36
- package/bundles/officeimo-canopyx-adapter.min.js +1 -1
- package/bundles/officeimo-canopyx-adapter.min.mjs +1 -1
- package/bundles/officeimo-canopyx-adapter.mjs +42 -22
- package/bundles/officeimo-canopyx.js +420 -177
- package/bundles/officeimo-canopyx.min.js +1 -1
- package/bundles/officeimo-canopyx.min.mjs +1 -1
- package/bundles/officeimo-canopyx.mjs +346 -103
- package/bundles/officeimo-chartforgex-adapter.js +1924 -0
- package/bundles/officeimo-chartforgex-adapter.min.js +2 -0
- package/bundles/officeimo-chartforgex-adapter.min.mjs +2 -0
- package/bundles/officeimo-chartforgex-adapter.mjs +1910 -0
- package/bundles/officeimo-chartforgex.js +13594 -0
- package/bundles/officeimo-chartforgex.min.js +2 -0
- package/bundles/officeimo-chartforgex.min.mjs +2 -0
- package/bundles/officeimo-chartforgex.mjs +13487 -0
- package/bundles/officeimo-csv.js +12 -7
- package/bundles/officeimo-csv.min.js +1 -1
- package/bundles/officeimo-csv.min.mjs +1 -1
- package/bundles/officeimo-csv.mjs +8 -3
- package/bundles/officeimo-datatables-adapter.js +11 -11
- package/bundles/officeimo-datatables-adapter.min.js +1 -1
- package/bundles/officeimo-datatables-adapter.min.mjs +1 -1
- package/bundles/officeimo-datatables-adapter.mjs +7 -7
- package/bundles/officeimo-datatables.js +375 -152
- package/bundles/officeimo-datatables.min.js +1 -1
- package/bundles/officeimo-datatables.min.mjs +1 -1
- package/bundles/officeimo-datatables.mjs +311 -88
- package/bundles/officeimo-execution.js +14 -9
- package/bundles/officeimo-execution.min.js +1 -1
- package/bundles/officeimo-execution.min.mjs +1 -1
- package/bundles/officeimo-execution.mjs +8 -3
- package/bundles/officeimo-pdf.js +286 -120
- package/bundles/officeimo-pdf.min.js +1 -1
- package/bundles/officeimo-pdf.min.mjs +1 -1
- package/bundles/officeimo-pdf.mjs +244 -78
- package/bundles/officeimo-xlsx.js +93 -31
- package/bundles/officeimo-xlsx.min.js +1 -1
- package/bundles/officeimo-xlsx.min.mjs +1 -1
- package/bundles/officeimo-xlsx.mjs +75 -13
- package/bundles/officeimo.js +373 -150
- package/bundles/officeimo.min.js +1 -1
- package/bundles/officeimo.min.mjs +1 -1
- package/bundles/officeimo.mjs +312 -89
- package/dist/core/progress.js +7 -2
- package/dist/index.d.ts +1 -1
- package/dist/integrations/canopyx/index.js +9 -2
- package/dist/integrations/canopyx/source.js +26 -13
- package/dist/integrations/chartforgex/capture.d.ts +31 -0
- package/dist/integrations/chartforgex/capture.js +103 -0
- package/dist/integrations/chartforgex/index.d.ts +13 -0
- package/dist/integrations/chartforgex/index.js +88 -0
- package/dist/integrations/chartforgex/svg-drawing.d.ts +5 -0
- package/dist/integrations/chartforgex/svg-drawing.js +775 -0
- package/dist/integrations/chartforgex/svg-geometry.d.ts +23 -0
- package/dist/integrations/chartforgex/svg-geometry.js +304 -0
- package/dist/integrations/chartforgex/svg-image.d.ts +9 -0
- package/dist/integrations/chartforgex/svg-image.js +46 -0
- package/dist/integrations/chartforgex/svg-markup.d.ts +10 -0
- package/dist/integrations/chartforgex/svg-markup.js +124 -0
- package/dist/integrations/chartforgex/svg-paint.d.ts +16 -0
- package/dist/integrations/chartforgex/svg-paint.js +146 -0
- package/dist/integrations/chartforgex/types.d.ts +77 -0
- package/dist/integrations/chartforgex/types.js +1 -0
- package/dist/integrations/chartforgex/winansi.d.ts +4 -0
- package/dist/integrations/chartforgex/winansi.js +48 -0
- package/dist/integrations/chartforgex/workbook.d.ts +12 -0
- package/dist/integrations/chartforgex/workbook.js +137 -0
- package/dist/pdf/document-drawings.d.ts +1 -1
- package/dist/pdf/document-drawings.js +91 -17
- package/dist/pdf/document-images.d.ts +7 -1
- package/dist/pdf/document-images.js +59 -24
- package/dist/pdf/document-types.d.ts +3 -1
- package/dist/pdf/document.d.ts +2 -2
- package/dist/pdf/document.js +3 -1
- package/dist/pdf/drawing-types.d.ts +37 -10
- package/dist/pdf/font-resources.d.ts +1 -1
- package/dist/pdf/font-resources.js +6 -3
- package/dist/pdf/index.d.ts +1 -1
- package/dist/pdf/pages.js +15 -0
- package/dist/pdf/png.d.ts +11 -2
- package/dist/pdf/png.js +50 -23
- package/dist/pdf/session.js +3 -2
- package/dist/pdf/settings.d.ts +2 -2
- package/dist/pdf/settings.js +7 -3
- package/dist/xlsx/options.js +1 -1
- package/dist/xlsx/types.d.ts +8 -0
- package/dist/xlsx/workbook.js +6 -0
- package/dist/xlsx/worksheet.d.ts +13 -1
- package/dist/xlsx/worksheet.js +60 -9
- package/package.json +9 -2
package/bundles/officeimo.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by OfficeIMO.JavaScript/scripts/bundles.mjs from tsc output. MIT.
|
|
2
|
-
(function(vt){"use strict";const st=vt.OfficeIMO||(vt.OfficeIMO={}),mt=Symbol.for("@evotecit/officeimo/modules"),B=st[mt]||new Map;st[mt]||Object.defineProperty(st,mt,{value:B});const ue=B.get("d5c945064d81fdd257960f48c421125e106e5f270427d170bb05587dd96a44ea")??(()=>{const S=Symbol.for("@evotecit/officeimo/OfficeIMOError"),R=Symbol.for("@evotecit/officeimo/NotSupportedError");class v extends Error{code;static[Symbol.hasInstance](p){return this!==v?Function.prototype[Symbol.hasInstance].call(this,p):!!p&&typeof p=="object"&&p[S]===!0}constructor(p,g,x){super(g,x),this.code=p,Object.defineProperty(this,S,{value:!0}),this.name="OfficeIMOError"}}class C extends v{feature;static[Symbol.hasInstance](p){return this!==C?Function.prototype[Symbol.hasInstance].call(this,p):!!p&&typeof p=="object"&&p[R]===!0}constructor(p){super("NOT_SUPPORTED",p+" is not supported yet."),this.feature=p,Object.defineProperty(this,R,{value:!0}),this.name="NotSupportedError"}}const k=Object.freeze({OfficeIMOError:v,NotSupportedError:C});return B.set("d5c945064d81fdd257960f48c421125e106e5f270427d170bb05587dd96a44ea",k),k})(),be=B.get("87c24efeaa0f1579c19afeeb4918caeb4f8f65a88d24a246e2cfd712b37dbac3")??(()=>{function S(o){if(o?.aborted)throw o.reason}function R(o,c){return c?new Promise((i,r)=>{const n=()=>c.removeEventListener("abort",e),e=()=>{n(),r(c.reason)};c.addEventListener("abort",e,{once:!0}),Promise.resolve(o).then(t=>{n(),i(t)},t=>{n(),r(t)}),c.aborted&&e()}):Promise.resolve(o)}async function*v(o,c){S(c);const i=o?.[Symbol.asyncIterator]?.()??o?.[Symbol.iterator]?.();if(!i)throw new TypeError("Rows must be a synchronous or asynchronous iterable.");let r=!1,n=!1;try{for(;;){S(c);const e=await R(Promise.resolve(i.next()),c);if(S(c),e.done){r=!0;return}yield e.value}}catch(e){throw n=!0,e}finally{if(!r&&i.return)try{const e=i.return();c?.aborted||n?Promise.resolve(e).catch(()=>{}):await R(Promise.resolve(e),c)}catch(e){if(!c?.aborted&&!n)throw e}}}const C=new WeakMap;function k(o){let c=!1;const i=()=>{if(c)throw new TypeError("A row source can be consumed only once.");c=!0},r={[Symbol.asyncIterator](){return i(),n()}};async function*n(){for await(const e of v(o))yield*e}return C.set(r,(e,t)=>(i(),p(o,e,l=>p(l,e,t)))),r}function b(...o){const c={async*[Symbol.asyncIterator](){for(const i of o)yield*i}};return C.set(c,async(i,r)=>{for(const n of o)await p(n,i,r)}),c}async function p(o,c,i){S(c);const r=C.get(o);if(r)return r(c,i);const n=o?.[Symbol.asyncIterator]?.()??o?.[Symbol.iterator]?.();if(!n)throw new TypeError("Rows must be a synchronous or asynchronous iterable.");let e=!1;try{for(;;){S(c);let t=n.next();const l=t;typeof l?.then=="function"&&(t=await R(l,c)),S(c);const d=t;if(d.done){e=!0;return}let u=d.value;typeof u?.then=="function"&&(u=await R(u,c)),S(c);const h=i(u);h!==void 0&&await R(h,c)}}finally{if(!e&&n.return)try{Promise.resolve(n.return()).catch(()=>{})}catch{}}}let g;const x=32;function m(){g=performance.now()+x}function f(){const o=performance.now();return g??=o+x,o>=g}function a(){const o=globalThis.scheduler;return typeof o?.postTask=="function"?o.postTask(()=>{g=performance.now()+x},{priority:"user-visible"}):new Promise(c=>{setTimeout(function(){g=performance.now()+x,c()},0)})}const s=Object.freeze({checkAbort:S,withAbort:R,inputRows:v,rowsFromBatches:k,concatRows:b,consumeRows:p,beginTask:m,taskYieldDue:f,pause:a});return B.set("87c24efeaa0f1579c19afeeb4918caeb4f8f65a88d24a246e2cfd712b37dbac3",s),s})(),Oe=B.get("5337d1e3bd5ae0c1d10a476fcd31540d20337ccf7aa93c7e9e26c2b1a7dab92b")??(()=>{const{checkAbort:S,consumeRows:R,withAbort:v,pause:C,taskYieldDue:k}=be,{OfficeIMOError:b}=ue;async function p(a,s){if(a&&typeof a.getWriter=="function"){const o=a.getWriter();try{return await s({write:c=>o.write(new Uint8Array(c))})}finally{o.releaseLock()}}if(!a||typeof a.write!="function")throw new TypeError("Destination must be a ByteSink or WritableStream.");return s(a)}class g{parts=[];state="open";result;write(s){if(this.state!=="open")throw new b("INVALID_STATE","Byte sink is closed.");this.parts.push(new Uint8Array(s))}toBlob(s="application/octet-stream"){if(this.state==="discarded")throw new b("INVALID_STATE","Byte sink was discarded.");return this.state="closed",this.result||(this.result=new Blob(this.parts,{type:s}),this.parts=[]),this.result.type===s?this.result:new Blob([this.result],{type:s})}takeChunks(){if(this.state!=="open")throw new b("INVALID_STATE","Byte sink is closed.");const s=this.parts;return this.parts=[],this.state="discarded",s}discard(){this.parts=[],this.result=void 0,this.state="discarded"}}class x{sink;signal;chunkSize;text="";encoder=new TextEncoder;constructor(s,o,c=32768){if(this.sink=s,this.signal=o,this.chunkSize=c,!Number.isInteger(c)||c<2)throw new RangeError("Text chunk size must be at least 2.")}append(s){return S(this.signal),this.text+=s,this.text.length>=this.chunkSize||k()}async flush(s=!1){for(S(this.signal);this.text.length;){let o=Math.min(this.text.length,this.chunkSize);if(/[\ud800-\udbff]/.test(this.text[o-1])&&(o<this.text.length||!s)&&o--,!o)break;const c=this.encoder.encode(this.text.slice(0,o));this.text=this.text.slice(o),await v(Promise.resolve(this.sink.write(c)),this.signal),k()&&await C(),S(this.signal)}}async write(s){this.append(s)&&await this.flush()}async close(){await this.flush(!0)}}async function m(a,s,o){await R(a instanceof Uint8Array?[a]:a,o,c=>{if(!(c instanceof Uint8Array))throw new TypeError("Byte sources must yield Uint8Array chunks.");const i=s.write(c);return k()?Promise.resolve(i).then(()=>(S(o),C())):i})}const f=Object.freeze({withDestination:p,BlobByteSink:g,ChunkedTextSink:x,writeBytes:m});return B.set("5337d1e3bd5ae0c1d10a476fcd31540d20337ccf7aa93c7e9e26c2b1a7dab92b",f),f})(),Le=B.get("501f5fccaecb27d9e514b74cf64893649e50616692250593d120ca315b510c04")??(()=>{function S(v){if(v===null||typeof v!="object")return!1;try{return!(v instanceof Date)&&!(Symbol.toStringTag in v)&&Object.prototype.toString.call(v)!=="[object Date]"?!1:(Date.prototype.getTime.call(v),!0)}catch{return!1}}const R=Object.freeze({isDate:S});return B.set("501f5fccaecb27d9e514b74cf64893649e50616692250593d120ca315b510c04",R),R})(),it=B.get("d363b84eac65064b2e372063af61a4e9e5c576501693c862628297c812ba7832")??(()=>{function S(v){if(!v||typeof v!="object")throw new TypeError("Hyperlinks require an absolute HTTP, HTTPS or mailto target without whitespace or controls.");const{target:C,tooltip:k}=v;if(typeof C!="string"||!/^(?:https?:\/\/|mailto:)/i.test(C)||/[\u0000-\u0020\u007f]/.test(C))throw new TypeError("Hyperlinks require an absolute HTTP, HTTPS or mailto target without whitespace or controls.");const b=new URL(C);if((b.protocol==="http:"||b.protocol==="https:")&&(!b.hostname||b.username||b.password))throw new TypeError("Hyperlink HTTP targets need a host and must not contain credentials.");if(k!==void 0&&typeof k!="string")throw new TypeError("Hyperlink tooltip must be text.");return Object.freeze({target:b.href,...k===void 0?{}:{tooltip:k}})}const R=Object.freeze({copyExportLink:S});return B.set("d363b84eac65064b2e372063af61a4e9e5c576501693c862628297c812ba7832",R),R})(),Se=B.get("732224f6995c2478cf33a6ed01f3e3d3dcccb159a731d6db9280104bd5040fc5")??(()=>{const{isDate:S}=Le,{copyExportLink:R}=it,v=Symbol.for("@evotecit/officeimo/ExportCell");function C(x){if(!x||typeof x!="object"||Array.isArray(x))throw new TypeError("Cell presentation must be an object.");const m={};for(const f of["background","color","numberFormat","bold","italic","wrapText","alignment"]){const a=x[f];if(a!==void 0){if(["bold","italic","wrapText"].includes(f)){if(typeof a!="boolean")throw new TypeError("Cell presentation "+f+" must be boolean.")}else if(typeof a!="string")throw new TypeError("Cell presentation "+f+" must be text.");if(f==="alignment"&&!["left","center","right","fill","justify","distributed"].includes(a))throw new TypeError("Invalid cell presentation alignment.");m[f]=a}}return Object.freeze(m)}class k{value;static[Symbol.hasInstance](m){return!!m&&typeof m=="object"&&m[v]===!0}text;presentation;link;constructor(m,f={}){this.value=m;const{text:a,presentation:s,link:o}=f;if(a!==void 0&&typeof a!="string")throw new TypeError("Display text must be a string.");b(m),this.text=a,this.presentation=s===void 0?void 0:C(s),this.link=o===void 0?void 0:R(o),Object.defineProperty(this,v,{value:!0}),Object.freeze(this)}}function b(x){const m=typeof x;if(!(x==null||m==="string"||m==="number"||m==="boolean"||S(x)))throw typeof x.then=="function"&&Promise.resolve(x).catch(()=>{}),new TypeError("Export values and formatter results must be synchronous strings, numbers, booleans, Dates or null.")}function p(x){x!==null&&typeof x=="object"&&x instanceof k||b(x)}const g=Object.freeze({copyCellPresentation:C,ExportCell:k,assertScalar:b,assertExportValue:p});return B.set("732224f6995c2478cf33a6ed01f3e3d3dcccb159a731d6db9280104bd5040fc5",g),g})(),ke=B.get("50b3c10b690ceff693c8c5f809195ba6845b20e60f408e791a750d2ecbd5c669")??(()=>{function S(v,C){const k={...v};for(const b of C){if(Object.hasOwn(k,b))continue;const p=v[b];p!==void 0&&(k[b]=p)}return k}const R=Object.freeze({captureFields:S});return B.set("50b3c10b690ceff693c8c5f809195ba6845b20e60f408e791a750d2ecbd5c669",R),R})(),ot=B.get("42faf379960e5674a6fdfa8c8fca0bb68bbd74587231248d2524d7004def3671")??(()=>{const{OfficeIMOError:S}=ue,{captureFields:R}=ke;class v{cells=0;text=0;reservedCells=0;reservedText=0;limits;constructor(p={}){if(!p||typeof p!="object"||Array.isArray(p))throw new TypeError("Export limits must be an object.");const g=R(p,["maxRows","maxCells","maxTextCharacters","maxOutputBytes"]);for(const[x,m]of Object.entries(g))if(m!==void 0&&(!Number.isSafeInteger(m)||m<0))throw new RangeError(x+" must be a nonnegative safe integer.");this.limits=Object.freeze(g)}check(p,g){const x=this.limits[p];if(x!==void 0&&g>x)throw new S("RESOURCE_LIMIT",p+" exceeded ("+g+" > "+x+").")}row(p){this.check("maxRows",p)}reserve(p,g){this.check("maxCells",this.cells+this.reservedCells+p),this.check("maxTextCharacters",this.text+this.reservedText+g),this.reservedCells+=p,this.reservedText+=g}release(p,g){this.reservedCells-=p,this.reservedText-=g}cell(p,g){if(g!==void 0&&this.release(1,g),this.limits.maxCells===void 0&&this.limits.maxTextCharacters===void 0)return;this.check("maxCells",this.cells+this.reservedCells+1);const x=typeof p=="string"?p.length:0;this.check("maxTextCharacters",this.text+this.reservedText+x),this.cells++,this.text+=x}}function C(b,p){let g=0;return{write(x){return p.check("maxOutputBytes",g+x.length),g+=x.length,b.write(x)}}}const k=Object.freeze({ExportBudget:v,boundedSink:C});return B.set("42faf379960e5674a6fdfa8c8fca0bb68bbd74587231248d2524d7004def3671",k),k})(),Ue=B.get("0391fe35ea7d02b25804ab4d0e7543136d6bb615f368f268c74aa135f23aa6bc")??(()=>{const{assertExportValue:S}=Se,{checkAbort:R}=be,{isDate:v}=Le,{captureFields:C}=ke;function k(x,m,f,a=S){const s=x.some(o=>o.value);return(o,c=0)=>{if(Array.isArray(o)&&!s){const i=o.length;if(i>x.length)throw new RangeError("Row has more values than declared columns.");const r=new Array(i);for(let n=0;n<i;n++){const e=o[n];a(e),r[n]=e}return r}if(!o||typeof o!="object"||v(o))throw new TypeError("A row must be an array or object.");if(Array.isArray(o)&&o.length>x.length&&!x.every(i=>i.value))throw new RangeError("Project every column explicitly when selecting from a wider array row.");return x.map((i,r)=>{if(i.value){R(f);const t={rowIndex:c,columnIndex:r,column:i,...m?{sheetName:m.sheetName,worksheetRow:m.firstDataRow+c}:{}},l=i.value(o,t);return a(l),R(f),l}if(Array.isArray(o)){const t=o[r];return a(t),t}const n=i.key??i.header,e=Object.prototype.hasOwnProperty.call(o,n)?o[n]:void 0;return a(e),e})}}const b=["header","key","value","width","type","format","wrapText","alignment","rowHeader","groups","style","valueFormatter"];function p(x,m=!1){if(!Array.isArray(x))throw new TypeError("Declare the columns in export order.");return x.map(f=>{if(!f||typeof f!="object"&&typeof f!="function")throw new TypeError("Each column needs a string header and an optional string key.");const a=C(f,b);if(!m&&a.style!==void 0)throw new TypeError("Workbook-local column styles require the advanced Workbook API; use portable ExportCell presentation.");if(typeof a.header!="string"||a.key!==void 0&&typeof a.key!="string")throw new TypeError("Each column needs a string header and an optional string key.");if(a.value!==void 0&&typeof a.value!="function")throw new TypeError("Column value getters must be functions.");if(a.rowHeader!==void 0&&typeof a.rowHeader!="boolean")throw new TypeError("Column rowHeader must be boolean.");if(a.groups!==void 0){if(!Array.isArray(a.groups))throw new TypeError("Column groups must be an array of strings.");const s=Array.from(a.groups);if(s.some(o=>typeof o!="string"))throw new TypeError("Column groups must be an array of strings.");return{...a,groups:Object.freeze(s)}}return a})}const g=Object.freeze({createRowProjector:k,columnOptionFields:b,copyColumns:p});return B.set("0391fe35ea7d02b25804ab4d0e7543136d6bb615f368f268c74aa135f23aa6bc",g),g})(),gt=B.get("c9fde2c438e186da56f740105fcd41c265fdfdd855a4f1b811d556a02387479b")??(()=>{class S{operation;count=0;sum=0;mean=0;min=1/0;max=-1/0;constructor(k){this.operation=k}accept(k){if(!(!this.operation||typeof k!="number"||!Number.isFinite(k)))if(this.count++,this.operation==="sum"){if(this.sum+=k,!Number.isFinite(this.sum))throw new RangeError("Numeric total exceeds finite number range.")}else if(this.operation==="average"){const b=k-this.mean;this.mean=this.count===1?k:Number.isFinite(b)?this.mean+b/this.count:this.mean*((this.count-1)/this.count)+k/this.count}else this.operation==="min"?this.min=Math.min(this.min,k):this.operation==="max"&&(this.max=Math.max(this.max,k))}value(){return this.operation==="count"?this.count:this.operation==="sum"?this.sum:this.count?this.operation==="average"?this.mean:this.operation==="min"?this.min:this.max:null}}function R(C,k={}){const b=C.map(p=>p.key??p.header);for(const[p,g]of Object.entries(k)){if(b.filter(x=>x===p).length!==1)throw new TypeError("Totals need an unambiguous declared column key: "+p);if(!["sum","count","average","min","max"].includes(g))throw new TypeError("Invalid total operation.")}return b.map(p=>new S(Object.prototype.hasOwnProperty.call(k,p)?k[p]:void 0))}const v=Object.freeze({NumericAggregate:S,createTotals:R});return B.set("c9fde2c438e186da56f740105fcd41c265fdfdd855a4f1b811d556a02387479b",v),v})(),at=B.get("e95bb0e3f342d1379b67a3d541fa808e06361da8460169a6aec152ee7deb69b2")??(()=>{const{ExportCell:S,assertExportValue:R}=Se,{isDate:v}=Le;function C(b){if(R(b),v(b))return new Date(Date.prototype.getTime.call(b));if(b instanceof S){const{value:p,text:g,presentation:x,link:m}=b;return new S(v(p)?new Date(Date.prototype.getTime.call(p)):p,{...g===void 0?{}:{text:g},...x===void 0?{}:{presentation:x},...m===void 0?{}:{link:m}})}return b}const k=Object.freeze({copyExportValue:C});return B.set("e95bb0e3f342d1379b67a3d541fa808e06361da8460169a6aec152ee7deb69b2",k),k})(),Me=B.get("046b305cdccf817d847addb75a778131622de23f2840830bbe1c0c26053a68c0")??(()=>{const{ExportCell:S,assertScalar:R}=Se,{isDate:v}=Le,{checkAbort:C,inputRows:k,pause:b,taskYieldDue:p}=be,{ExportBudget:g}=ot,{OfficeIMOError:x}=ue,{copyColumns:m,createRowProjector:f}=Ue,{createTotals:a}=gt,{copyExportValue:s}=at,o=new WeakMap;function c(E){if(!E||typeof E!="object"||!o.has(E))throw new TypeError("Create grouped report sources with createGroupedReport.")}function i(E,P){return c(E),{async*[Symbol.asyncIterator](){const I=r(E,P);try{yield*I.events}finally{I.dispose()}}}}function r(E,P){c(E);const I=o.get(E),A=n(I.signal,P);return{signal:A.signal,events:I.events(A.signal),dispose:A.dispose}}function n(E,P){if(!E||!P||E===P)return{signal:E??P,dispose(){}};const I=new AbortController,A=()=>I.abort(E.reason),F=()=>I.abort(P.reason);return E.addEventListener("abort",A,{once:!0}),P.addEventListener("abort",F,{once:!0}),E.aborted?A():P.aborted&&F(),{signal:I.signal,dispose(){E.removeEventListener("abort",A),P.removeEventListener("abort",F)}}}function e(E,P,I){const A=E??P;if(!Number.isSafeInteger(A)||A<0)throw new RangeError(I+" must be a nonnegative safe integer.");return A}function t(E){return E instanceof S?E.value:E}function l(E){if(E==null)return{key:null,id:"null",text:""};if(v(E)){const I=Date.prototype.getTime.call(E);if(!Number.isFinite(I))throw new TypeError("A group key date must be valid.");return{key:new Date(I),id:"date:"+I,text:new Date(I).toISOString()}}if(typeof E=="number"&&!Number.isFinite(E))throw new TypeError("A numeric group key must be finite.");const P=String(E);return{key:E,id:typeof E+":"+P,text:P}}function d(E){return v(E)?new Date(Date.prototype.getTime.call(E)):E}function u(E){return Object.freeze(E.map(P=>P.operation===void 0?null:P.value()))}function h(E,P,I){const A=typeof E=="string"?[E]:Array.isArray(E)?Array.from(E):void 0;if(!A||A.length<1||A.length>4)throw new TypeError("groupBy must declare between one and four grouping levels.");if(I!==void 0&&typeof I!="function")throw new TypeError("groupLabel must be a synchronous function.");if(I&&A.length!==1)throw new TypeError("groupLabel is only available for one grouping level; use descriptor labels for a hierarchy.");const F=new Set;return Object.freeze(A.map(N=>{if(typeof N!="string"&&(!N||typeof N!="object"||Array.isArray(N)))throw new TypeError("A grouping level must name a stable column key or provide a descriptor.");const{key:U,value:M,label:Q}=typeof N=="string"?{key:N,value:void 0,label:void 0}:N;if(typeof U!="string"||!U.length||F.has(U))throw new TypeError("Grouping levels need unique, nonempty stable keys.");if(F.add(U),M!==void 0&&typeof M!="function")throw new TypeError("Grouping value getters must be synchronous functions.");if(Q!==void 0&&typeof Q!="function")throw new TypeError("Grouping labels must be synchronous functions.");if(Q&&I)throw new TypeError("Specify either groupLabel or the grouping descriptor label.");const V=P.indexOf(U);if(V>=0&&M!==void 0)throw new TypeError("A declared grouping column reuses its projected value; do not provide another value getter.");if(V<0&&M===void 0)throw new TypeError("groupBy must name a declared stable column key; hidden grouping fields need an explicit value getter.");return Object.freeze({key:U,column:V,value:M,label:Q??I})}))}function w(E){return Object.freeze(E.map(({group:P})=>Object.freeze({...P,key:d(P.key)})))}function y(E,P,I){if(!E)return I;const A=E(d(P));if(typeof A?.then=="function"&&Promise.resolve(A).catch(()=>{}),typeof A!="string")throw new TypeError("Grouping labels must return synchronous text.");return A}function T(E,P){if(!P||typeof P!="object")throw new TypeError("Grouped report options are required.");const{columns:I,groupBy:A,totals:F,groupLabel:N,maxGroups:U,maxGroupKeyCharacters:M,signal:Q,limits:V}=P;if(V!==void 0&&(!V||typeof V!="object"||Array.isArray(V)))throw new TypeError("Grouped source limits must be an object.");if(V!==void 0&&"maxOutputBytes"in V)throw new TypeError("Set maxOutputBytes on the format writer, not the grouped source.");if(!Array.isArray(I)||!I.length)throw new TypeError("A grouped report needs declared columns.");const z=m(I),L=z.map(ne=>ne.key);if(L.some(ne=>typeof ne!="string"||ne.length===0)||new Set(L).size!==L.length)throw new TypeError("Grouped report columns need unique, nonempty stable keys.");const G=h(A,L,N),W=Object.freeze({...F}),K=a(z,W);for(let ne=0;ne<z.length;ne++)if(K[ne].operation!==void 0&&z[ne].type!=="number")throw new TypeError("Grouped numeric totals require a column declared with type:number.");const X=e(U,1e3,"maxGroups"),Z=e(M,1e6,"maxGroupKeyCharacters"),se=new g(V),D=Object.freeze(z.map(ne=>{const{value:he,...ye}=ne;return Object.freeze(ye)}));for(const ne of z){se.cell(ne.header);for(const he of ne.groups??[])se.reserve(0,he.length);Object.freeze(ne)}let q=!1;const J=ne=>Object.freeze({[Symbol.asyncIterator](){if(q)throw new TypeError("A grouped report source can be consumed only once.");return q=!0,le(ne)}}),re=J(Q);async function*le(ne){const he=f(z,void 0,ne),ye=new Set,j=[];let H=0,_=0,$=0;for await(const ie of k(E,ne)){const ce=Array.isArray(ie)?Array.from(ie):ie,ae=he(ce,_),fe=[];for(let Y=0;Y<z.length;Y++)fe.push(s(ae[Y])??null);C(ne);const we=G.map((Y,te)=>{C(ne);const de=Y.column>=0?t(fe[Y.column]):Y.value(ce,Object.freeze({rowIndex:_,level:te,key:Y.key}));return R(de),C(ne),l(de)});se.row(_+1);for(let Y=0;Y<fe.length;Y++){const te=fe[Y],de=t(te);if(K[Y].operation!==void 0&&de!=null&&(typeof de!="number"||!Number.isFinite(de)))throw new TypeError("Grouped numeric metrics must resolve to finite numbers or null.");se.cell(de),te instanceof S&&te.text!==void 0&&se.reserve(0,te.text.length)}let pe=0;for(;pe<j.length&&j[pe].id===we[pe].id;)pe++;const ee=[];for(let Y=pe;Y<G.length;Y++){const te=we[Y],ge=((ee.at(-1)??j[Y-1])?.group.groupIndex??-1)+":"+te.id;if(ye.has(ge))throw new TypeError("Grouped rows must be contiguous; a closed group key occurred again within the same parent.");if($===X)throw new x("RESOURCE_LIMIT","maxGroups exceeded.");const me=y(G[Y].label,te.key,te.text);C(ne);const ve=H+ge.length+me.length;if(!Number.isSafeInteger(ve)||ve>Z)throw new x("RESOURCE_LIMIT","maxGroupKeyCharacters exceeded.");se.reserve(0,me.length),ee.push({id:te.id,group:Object.freeze({groupIndex:$,key:te.key,label:me,level:Y}),rows:0,aggregates:a(z,W)}),H=ve,ye.add(ge),$++}for(;j.length>pe;){C(ne);const Y=w(j),te=j.pop();yield Object.freeze({kind:"groupEnd",...Y.at(-1),path:Y,rows:te.rows,totals:u(te.aggregates)})}for(const Y of ee){C(ne),j.push(Y);const te=w(j);yield Object.freeze({kind:"groupStart",...te.at(-1),path:te})}for(let Y=0;Y<fe.length;Y++){const te=t(fe[Y]);for(const de of j)de.aggregates[Y].accept(te);K[Y].accept(te)}for(const Y of j)Y.rows++;C(ne),yield Object.freeze({kind:"row",values:Object.freeze(fe),rowIndex:_,groupIndex:j.at(-1).group.groupIndex,path:w(j)}),_++,p()&&(await b(),C(ne))}for(C(ne);j.length;){C(ne);const ie=w(j),ce=j.pop();yield Object.freeze({kind:"groupEnd",...ie.at(-1),path:ie,rows:ce.rows,totals:u(ce.aggregates)})}C(ne),yield Object.freeze({kind:"complete",rows:_,groups:$,totals:u(K)})}const oe=Object.freeze({columns:D,groupBy:Object.freeze(G.map(ne=>ne.key)),totals:W,events:re});return o.set(oe,{signal:Q,events:J}),oe}const O=Object.freeze({assertGroupedReportSource:c,groupedReportEvents:i,groupedReportOperation:r,createGroupedReport:T});return B.set("046b305cdccf817d847addb75a778131622de23f2840830bbe1c0c26053a68c0",O),O})(),Ne=B.get("81b3d47c02b7d8443b79e02b3cfb52032d6b73d9a3fb592b777ebe028ad0ef00")??(()=>{const{OfficeIMOError:S}=ue;function R(){let k=!1;if(typeof CompressionStream=="function")try{new CompressionStream("deflate-raw"),k=!0}catch{}return{blob:typeof Blob=="function",streams:typeof WritableStream=="function",deflateRaw:k,download:typeof document<"u"&&typeof URL.createObjectURL=="function"}}function v(k,b){if(!(k instanceof Blob)||typeof b!="string"||!b)throw new TypeError("A Blob and file name are required.");if(typeof document>"u"||typeof URL.createObjectURL!="function")throw new S("PLATFORM_UNAVAILABLE","saveBlob requires a browser document and object URLs.");const p=URL.createObjectURL(k),g=document.createElement("a");try{g.href=p,g.download=b,document.body.append(g),g.click()}finally{g.remove(),setTimeout(()=>URL.revokeObjectURL(p),3e4)}}const C=Object.freeze({OfficeIMOError:ue.OfficeIMOError,NotSupportedError:ue.NotSupportedError,BlobByteSink:Oe.BlobByteSink,ChunkedTextSink:Oe.ChunkedTextSink,writeBytes:Oe.writeBytes,ExportCell:Se.ExportCell,createGroupedReport:Me.createGroupedReport,checkAbort:be.checkAbort,withAbort:be.withAbort,inputRows:be.inputRows,pause:be.pause,detectFeatures:R,saveBlob:v});return B.set("81b3d47c02b7d8443b79e02b3cfb52032d6b73d9a3fb592b777ebe028ad0ef00",C),C})(),wt=B.get("790c15edc51b308be3e7d8222630d407f8c79c31ab21ba0b9f92c00f44ab4021")??(()=>{const S=new Uint32Array(256).map((C,k)=>{let b=k;for(let p=0;p<8;p++)b=b&1?3988292384^b>>>1:b>>>1;return b>>>0});class R{crc=4294967295;update(k){let b=this.crc;for(let p=0;p<k.length;p++)b=S[(b^k[p])&255]^b>>>8;this.crc=b}get value(){return(this.crc^4294967295)>>>0}}const v=Object.freeze({Crc32:R});return B.set("790c15edc51b308be3e7d8222630d407f8c79c31ab21ba0b9f92c00f44ab4021",v),v})(),bt=B.get("597d152d20a2a28ee5cd6d4243a79a71ce8b83769a77441bfc944aadc0a6efbd")??(()=>{const{checkAbort:S,withAbort:R}=be,{OfficeIMOError:v}=ue,{Crc32:C}=wt,k=4294967295;function b(x){if(!Number.isSafeInteger(x)||x<0||x>=k)throw new v("ZIP64_REQUIRED","Classic ZIP entries and archives must stay below 4 GiB; ZIP64 is not supported yet.");return x}class p{sink;signal;method;writer;reader;drain;crc=new C;size=0;compressedSize=0;failed=!1;failure;closed=!1;cleaned=!1;lifetime=new AbortController;abort=()=>{this.fail(this.signal?.reason)};constructor(m,f,a){if(this.sink=f,this.signal=a,m!=="auto"&&m!=="store")throw new RangeError("compression must be auto or store.");S(a);let s;if(m==="auto"&&typeof CompressionStream=="function")try{s=new CompressionStream("deflate-raw")}catch(o){if(!(o instanceof TypeError))throw o}this.method=s?8:0,this.writer=s?.writable.getWriter(),this.reader=s?.readable.getReader(),a?.addEventListener("abort",this.abort,{once:!0}),this.drain=this.reader?this.consume(this.reader):Promise.resolve()}async consume(m){try{for(;;){const{value:f,done:a}=await R(m.read(),this.lifetime.signal);if(a)return;S(this.signal),this.compressedSize=b(this.compressedSize+f.length),await R(Promise.resolve(this.sink.write(f)),this.lifetime.signal)}}catch(f){this.fail(f)}}fail(m){this.failed||(this.failed=!0,this.failure=m,this.lifetime.abort(m),this.cleaned||(this.writer?.abort(m).catch(()=>{}),this.reader?.cancel(m).catch(()=>{})))}async write(m){if(S(this.signal),this.failed)throw this.failure;if(this.closed)throw new v("INVALID_STATE","ZIP entry is closed.");if(!(m instanceof Uint8Array))throw new TypeError("ZIP chunks must be Uint8Array.");this.size=b(this.size+m.length),this.crc.update(m),this.writer?await R(this.writer.write(new Uint8Array(m)),this.lifetime.signal):(await R(Promise.resolve(this.sink.write(m)),this.lifetime.signal),this.compressedSize=this.size)}async close(){try{if(S(this.signal),this.failed)throw this.failure;if(this.closed)throw new v("INVALID_STATE","ZIP entry is closed.");if(this.closed=!0,this.writer&&await R(this.writer.close(),this.lifetime.signal),await this.drain,this.failed)throw this.failure;return S(this.signal),{crc:this.crc.value,size:this.size,compressedSize:this.compressedSize,method:this.method}}finally{this.cleanup()}}async discard(m){this.fail(m),await this.drain,this.closed=!0,this.cleanup()}cleanup(){this.cleaned||(this.cleaned=!0,this.signal?.removeEventListener("abort",this.abort),this.writer?.releaseLock(),this.reader?.releaseLock())}}const g=Object.freeze({Crc32:wt.Crc32,zipLimit:k,zipSize:b,EntryWriter:p});return B.set("597d152d20a2a28ee5cd6d4243a79a71ce8b83769a77441bfc944aadc0a6efbd",g),g})(),Ot=B.get("699a019e0c3f317a62bf3a6e59b76b6cf1645908b0f1b1f157c18f4d4f368dfb")??(()=>{const{EntryWriter:S,zipSize:R}=bt,{checkAbort:v,withAbort:C,pause:k,taskYieldDue:b}=be,{OfficeIMOError:p}=ue,{BlobByteSink:g,writeBytes:x}=Oe,{captureFields:m}=ke,f=new TextEncoder;function a(i){if(typeof i!="string"||!i||/[\u0000-\u001f\\]/.test(i)||i.startsWith("/")||/^[A-Za-z]:/.test(i)||i.split("/").some(r=>!r||r==="."||r===".."))throw new TypeError("ZIP entry names must be relative paths without empty, dot or parent segments.");for(let r=0;r<i.length;r++){const n=i.charCodeAt(r);if(n>=55296&&n<=56319){const e=i.charCodeAt(++r);if(!(e>=56320&&e<=57343))throw new TypeError("ZIP entry names must contain well-formed Unicode.")}else if(n>=56320&&n<=57343)throw new TypeError("ZIP entry names must contain well-formed Unicode.")}if(f.encode(i).length>65535)throw new RangeError("ZIP entry name exceeds 65,535 UTF-8 bytes.");return i}function s(i,r,n=new Uint8Array){const e=new Uint8Array(r+n.length),t=new DataView(e.buffer);return t.setUint32(0,i,!0),e.set(n,r),{bytes:e,data:t}}class o{sink;owned;names=new Set;central=[];offset=0;active;state="open";options;lifetime=new AbortController;disposal;constructor(r,n={}){const e=m(n,["compression","signal","maxOutputBytes"]),{compression:t,maxOutputBytes:l}=e;if(l!==void 0&&(!Number.isSafeInteger(l)||l<0))throw new RangeError("maxOutputBytes must be a nonnegative safe integer.");if(t!==void 0&&t!=="auto"&&t!=="store")throw new RangeError("compression must be auto or store.");this.options=Object.freeze(e),this.owned=r?void 0:new g,this.sink=r??this.owned}async acceptance(r){const n=this.options.signal,e=()=>this.lifetime.abort(n?.reason);n?.addEventListener("abort",e,{once:!0});try{return v(n),v(this.lifetime.signal),await C(Promise.resolve(r()),this.lifetime.signal)}finally{n?.removeEventListener("abort",e)}}async emit(r){if(this.options.maxOutputBytes!==void 0&&this.offset+r.length>this.options.maxOutputBytes)throw new p("RESOURCE_LIMIT","maxOutputBytes exceeded.");this.offset=R(this.offset+r.length),await this.acceptance(()=>this.sink.write(r))}reserve(r){if(v(this.options.signal),this.state!=="open")throw new p("INVALID_STATE","ZIP writer is busy, failed or finalized.");if(a(r),this.names.has(r))throw new TypeError("Duplicate ZIP entry: "+r);if(this.names.size>=65534)throw new p("ZIP64_REQUIRED","ZIP64 is required for 65,535 entries.");return this.names.add(r),this.state="writing",f.encode(r)}local(r,n,e){const t=s(67324752,30,r);return t.data.setUint16(4,20,!0),t.data.setUint16(6,e?2056:2048,!0),t.data.setUint16(8,n.method,!0),t.data.setUint16(12,33,!0),t.data.setUint16(26,r.length,!0),t.bytes}record(r,n,e,t){const l=s(33639248,46,r);l.data.setUint16(4,20,!0),l.data.setUint16(6,20,!0),l.data.setUint16(8,t?2056:2048,!0),l.data.setUint16(10,n.method,!0),l.data.setUint16(14,33,!0),l.data.setUint32(16,n.crc,!0),l.data.setUint32(20,n.compressedSize,!0),l.data.setUint32(24,n.size,!0),l.data.setUint16(28,r.length,!0),l.data.setUint32(42,e,!0),this.central.push(l.bytes)}async openEntry(r){const n=this.reserve(r),e=this.offset;let t;try{t=new S(this.options.compression??"auto",{write:y=>this.emit(y)},this.options.signal),await this.emit(this.local(n,t,!0));const l=t;let d=!1,u=!1,h;const w=async y=>{u=!0,this.state="failed",this.lifetime.abort(y),await l.discard(y),this.owned?.discard(),this.active=void 0};return this.active={write:async y=>{if(d||u||this.state!=="writing")throw new p("INVALID_STATE","Await the current ZIP entry operation.");d=!0;try{await l.write(y)}catch(T){throw await w(T),T}finally{d=!1}},close:()=>{if(h)return h;if(d||u||this.state!=="writing")throw new p("INVALID_STATE","ZIP entry is busy or closed.");return u=!0,h=(async()=>{try{const y=await l.close(),T=s(134695760,16);return T.data.setUint32(4,y.crc,!0),T.data.setUint32(8,y.compressedSize,!0),T.data.setUint32(12,y.size,!0),await this.emit(T.bytes),this.record(n,y,e,!0),this.state="open",this.active=void 0,y}catch(y){throw await w(y),y}})(),h},discard:w}}catch(l){throw this.state="failed",await t?.discard(l),this.owned?.discard(),l}}async add(r,n){const e=await this.openEntry(r);try{typeof n=="function"?await this.acceptance(()=>n(e)):await this.acceptance(()=>x(n,e,this.lifetime.signal)),await e.close()}catch(t){throw await e.discard(t),t}}get bytesWritten(){return this.offset}discard(r){return this.state="failed",this.lifetime.abort(r),this.disposal??=(async()=>{await this.active?.discard(r),this.owned?.discard()})()}async addPrepared(r,n){const e=this.reserve(r),t=this.offset;try{const l=this.local(e,n,!1),d=new DataView(l.buffer);d.setUint32(14,n.crc,!0),d.setUint32(18,n.compressedSize,!0),d.setUint32(22,n.size,!0),await this.emit(l);for(const u of n.chunks)v(this.options.signal),await this.emit(u);this.record(e,n,t,!1),this.state="open"}catch(l){throw this.state="failed",this.owned?.discard(),l}}async finish(){if(v(this.options.signal),this.state!=="open")throw new p("INVALID_STATE","ZIP writer is busy, failed or finalized.");this.state="writing";const r=this.offset;try{for(let e=0;e<this.central.length;e++)await this.emit(this.central[e]),e%256===255&&b()&&await k();const n=s(101010256,22);n.data.setUint16(8,this.central.length,!0),n.data.setUint16(10,this.central.length,!0),n.data.setUint32(12,this.offset-r,!0),n.data.setUint32(16,r,!0),await this.emit(n.bytes),v(this.options.signal),this.state="finished"}catch(n){throw this.state="failed",this.owned?.discard(),n}}async toBlob(r="application/zip"){if(!this.owned)throw new p("INVALID_STATE","This ZIP uses a caller-owned sink; use finish().");return this.state!=="finished"&&await this.finish(),this.owned.toBlob(r)}}const c=Object.freeze({Crc32:bt.Crc32,validateEntryName:a,ZipWriter:o});return B.set("699a019e0c3f317a62bf3a6e59b76b6cf1645908b0f1b1f157c18f4d4f368dfb",c),c})(),Re=B.get("227236fd7adc9472e188831b8f16fdc69338c4d779f2b69a8abbd8dbfa95b585")??(()=>{const{OfficeIMOError:S}=ue,{ChunkedTextSink:R}=Oe,v='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>',C={"&":"&","<":"<",">":">",'"':""","'":"'","\r":" ","\n":" "," ":"	"};function k(f,a="strip"){if(a!=="strip"&&a!=="reject")throw new TypeError("Invalid XML character policy.");const s=String(f),o=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\ud800-\udfff\ufffe\uffff]/gu;if(a==="reject"&&o.test(s))throw new S("INVALID_XML","Text contains XML 1.0-invalid characters.");return s.replace(o,"")}function b(f,a="strip"){return k(f,a).replace(/[&<>"'\r\n\t]/g,s=>C[s])}function p(f,a="strip"){const s={"\r":"_x000D_","\n":"_x000A_"," ":"_x0009_"},o=k(f,a).replace(/_(?=x[0-9a-f]{4}_)|[\r\n\t]/gi,c=>c==="_"?"_x005F_":s[c]);return b(o,a)}function g(f){if(typeof f!="string"||!/^[A-Za-z_][A-Za-z0-9_.-]*(?::[A-Za-z_][A-Za-z0-9_.-]*)?$/.test(f))throw new S("INVALID_XML","Invalid XML name: "+f);return f}class x{policy;sink;stack=[];roots=0;closed=!1;constructor(a,s="strip",o){this.policy=s,k("",s),this.sink=new R(a,o),this.sink.append(v)}async startElement(a,s={}){this.open(),g(a);const o="<"+a+Object.entries(s).map(([c,i])=>" "+g(c)+'="'+b(i,this.policy)+'"').join("")+">";if(!this.stack.length&&this.roots++)throw new S("INVALID_XML","XML must have one root element.");this.stack.push(a),await this.sink.write(o)}async text(a){if(this.open(),!this.stack.length)throw new S("INVALID_XML","Text needs an open element.");await this.sink.write(b(a,this.policy))}async endElement(){this.open();const a=this.stack.pop();if(!a)throw new S("INVALID_XML","No open XML element.");await this.sink.write("</"+a+">")}async close(){if(this.open(),this.stack.length||this.roots!==1)throw new S("INVALID_XML","XML document is incomplete.");await this.sink.close(),this.closed=!0}open(){if(this.closed)throw new S("INVALID_STATE","XML writer is closed.")}}const m=Object.freeze({xmlDeclaration:v,cleanXml:k,escapeXml:b,escapeOoxmlAttribute:p,validateXmlName:g,XmlWriter:x});return B.set("227236fd7adc9472e188831b8f16fdc69338c4d779f2b69a8abbd8dbfa95b585",m),m})(),ct=B.get("8ece66b561682170c879991995105163f4c484c8355d5e451fc6f52a9fbc3f82")??(()=>{const{OfficeIMOError:S}=ue;function R(b){const p=()=>new S("INVALID_PART_URI","Invalid OPC part URI: "+b);if(typeof b!="string"||!b.startsWith("/")||/[^A-Za-z0-9\-._~!$&'()*+,;=:@%/]/.test(b)||b.split("/").slice(1).some(g=>!g||g.endsWith(".")||/^\.+$/.test(g))||/%(?![\da-f]{2})/i.test(b))throw p();for(const g of b.matchAll(/%([\da-f]{2})/gi)){const x=String.fromCharCode(parseInt(g[1],16));if(/[A-Za-z0-9_.~\-/\\]/.test(x))throw p()}try{decodeURIComponent(b)}catch{throw p()}return b.replace(/%[\da-f]{2}/gi,g=>g.toUpperCase())}function v(b){if(b==="/")return"/_rels/.rels";const p=R(b),g=p.lastIndexOf("/");return p.slice(0,g+1)+"_rels/"+p.slice(g+1)+".rels"}function C(b,p){const g=R(p).slice(1).split("/"),x=b==="/"?[]:R(b).slice(1).split("/").slice(0,-1);for(;x.length&&x[0]===g[0];)x.shift(),g.shift();const m="../".repeat(x.length)+g.join("/");return m.split("/",1)[0].includes(":")?"./"+m:m}const k=Object.freeze({partUri:R,relationshipPartUri:v,relativePartTarget:C});return B.set("8ece66b561682170c879991995105163f4c484c8355d5e451fc6f52a9fbc3f82",k),k})(),yt=B.get("56b2057461a668e8c90abd1fbf4f13ff93efd9854e590c82a195799f0f842c2a")??(()=>{const{escapeXml:S,xmlDeclaration:R}=Re,{isDate:v}=Le;function C(p={},g="strip"){const x=p.created??new Date,m=p.modified??x;if(!v(x)||!v(m)||!Number.isFinite(x.getTime())||!Number.isFinite(m.getTime()))throw new TypeError("Invalid workbook property date.");return R+'<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:creator>'+S(p.creator??"",g)+"</dc:creator><dc:title>"+S(p.title??"",g)+"</dc:title>"+(p.subject===void 0?"":"<dc:subject>"+S(p.subject,g)+"</dc:subject>")+(p.description===void 0?"":"<dc:description>"+S(p.description,g)+"</dc:description>")+'<dcterms:created xsi:type="dcterms:W3CDTF">'+x.toISOString()+'</dcterms:created><dcterms:modified xsi:type="dcterms:W3CDTF">'+m.toISOString()+"</dcterms:modified></cp:coreProperties>"}function k(p={},g="strip"){return R+'<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"><Application>'+S(p.application??"OfficeIMO",g)+"</Application><Company>"+S(p.company??"",g)+"</Company></Properties>"}const b=Object.freeze({corePropertiesXml:C,appPropertiesXml:k});return B.set("56b2057461a668e8c90abd1fbf4f13ff93efd9854e590c82a195799f0f842c2a",b),b})(),$e=B.get("945379594834125fea38bc00f02ef077409dd15f6ed67279e63e89afe0bb944b")??(()=>{const{partUri:S,relationshipPartUri:R,relativePartTarget:v}=ct,{corePropertiesXml:C,appPropertiesXml:k}=yt,{ZipWriter:b}=Ot,{ChunkedTextSink:p}=Oe,{OfficeIMOError:g}=ue,{escapeXml:x,xmlDeclaration:m}=Re,{checkAbort:f,pause:a,taskYieldDue:s}=be,{captureFields:o}=ke,c="http://schemas.openxmlformats.org/package/2006/relationships",i="http://schemas.openxmlformats.org/officeDocument/2006/relationships",r="http://schemas.openxmlformats.org/package/2006/content-types",n={officeDocument:i+"/officeDocument",worksheet:i+"/worksheet",styles:i+"/styles",theme:i+"/theme",customXml:i+"/customXml",coreProperties:c+"/metadata/core-properties",appProperties:i+"/extended-properties"};function e(u){if(typeof u!="string"||!/^[\w!#$&^.+-]+\/[\w!#$&^.+-]+$/.test(u))throw new TypeError("Invalid content type.");return u}class t{defaults=new Map([["rels","application/vnd.openxmlformats-package.relationships+xml"],["xml","application/xml"]]);overrides=new Map;addDefault(h,w){if(!/^[A-Za-z0-9]+$/.test(h))throw new TypeError("Invalid part extension.");const y=h.toLowerCase(),T=this.defaults.get(y);if(T!==void 0&&T!==w)throw new TypeError("Conflicting default content type.");this.defaults.set(y,e(w))}addOverride(h,w){if(h=S(h),this.overrides.has(h.toLowerCase()))throw new TypeError("Duplicate content-type override.");this.overrides.set(h.toLowerCase(),{uri:h,type:e(w)})}toXml(){return m+'<Types xmlns="'+r+'">'+[...this.defaults].map(([h,w])=>'<Default Extension="'+x(h)+'" ContentType="'+x(w)+'"/>').join("")+[...this.overrides.values()].map(({uri:h,type:w})=>'<Override PartName="'+x(h)+'" ContentType="'+x(w)+'"/>').join("")+"</Types>"}}class l{types=new t;parts=new Map;directories=new Set;relationships=new Map;state="open";result;zip;options;constructor(h={}){this.options=Object.freeze(o(h,["compression","signal","maxOutputBytes","invalidCharacterPolicy","sink"])),this.zip=new b(this.options.sink,this.options)}open(){if(this.state!=="open")throw new g("INVALID_STATE","OPC package is finalized.")}reserve(h,w){if(this.open(),typeof h=="string"&&h.length>65536)throw new g("RESOURCE_LIMIT","OPC part name exceeds the ZIP entry-name limit.");h=S(h);let y=0;for(let E=0;E<h.length;E++)if(h[E]==="/"&&++y>64)throw new g("RESOURCE_LIMIT","OPC part name exceeds the directory-depth limit.");if(/\/_rels(?:\/|$)/i.test(h)||h.toLowerCase()==="/[content_types].xml")throw new TypeError("Package metadata part names are reserved.");const T=h.toLowerCase();if(this.parts.has(T))throw new TypeError("Duplicate OPC part: "+h);if(this.directories.has(T))throw new TypeError("OPC part-name prefix collision: "+h+" is an ancestor of an existing part.");const O=[];for(let E=T.lastIndexOf("/");E>0;E=T.lastIndexOf("/",E-1)){const P=T.slice(0,E);if(this.parts.has(P))throw new TypeError("OPC part-name prefix collision: "+h+" descends from "+this.parts.get(P).uri);O.push(P)}this.types.addOverride(h,w);for(const E of O)this.directories.add(E);return h}addPart(h){const{uri:w,contentType:y,data:T}=h,O=T instanceof Uint8Array?new Uint8Array(T):T,E=this.reserve(w,y);this.parts.set(E.toLowerCase(),{uri:E,contentType:y,data:O})}addPrepared(h,w,y){h=this.reserve(h,w),this.parts.set(h.toLowerCase(),{uri:h,prepared:y})}async openPart(h,w){if(!this.options.sink)throw new g("INVALID_STATE","openPart requires a caller-owned package sink.");h=this.reserve(h,w),this.parts.set(h.toLowerCase(),{uri:h,written:!0});try{return await this.zip.openEntry(h.slice(1))}catch(y){throw await this.discard(y),y}}addRelationship(h,w){f(this.options.signal),this.open(),h=h==="/"?h:S(h);const{id:y,type:T,target:O,external:E}=w;if(this.open(),!/^[A-Za-z_][A-Za-z0-9_.-]*$/.test(y))throw new TypeError("Relationship id must be an XML ID.");if(!/^[A-Za-z][A-Za-z0-9+.-]*:[^\s<>"']+$/.test(T))throw new TypeError("Relationship type must be an absolute URI.");const P=E?O:S(O);if(E&&(!P||/[\u0000-\u0020]/.test(P)))throw new TypeError("Invalid external relationship target.");const I=h.toLowerCase(),A=this.relationships.get(I)??new Map;if(A.has(y))throw new TypeError("Duplicate relationship id: "+y);A.set(y,{id:y,type:T,target:P,...E===void 0?{}:{external:E}}),this.relationships.set(I,A)}setProperties(h={},w={}){const y=C(h,this.options.invalidCharacterPolicy),T=k(w,this.options.invalidCharacterPolicy);this.addPart({uri:"/docProps/core.xml",contentType:"application/vnd.openxmlformats-package.core-properties+xml",data:y}),this.addPart({uri:"/docProps/app.xml",contentType:"application/vnd.openxmlformats-officedocument.extended-properties+xml",data:T}),this.addRelationship("/",{id:"core",type:n.coreProperties,target:"/docProps/core.xml"}),this.addRelationship("/",{id:"app",type:n.appProperties,target:"/docProps/app.xml"})}source(h){return typeof h=="string"?async w=>{const y=new p(w,this.options.signal);await y.write(h),await y.close()}:h instanceof Blob?(async function*(){for(let w=0;w<h.size;w+=65536){let y;try{y=await h.slice(w,w+65536).arrayBuffer()}catch(T){throw T?.name!=="NotReadableError"?T:new g("PLATFORM_UNAVAILABLE","This environment cannot read Blob part data. Supply text or byte chunks; read Blobs before sending data to a worker.",{cause:T})}yield new Uint8Array(y)}})():h}finish(){return this.result?this.result:(this.open(),this.state="finalizing",this.result=(async()=>{const h=this.zip;try{for(const[w,y]of this.relationships){if(w!=="/"&&!this.parts.has(w))throw new TypeError("Missing relationship source part: "+w);let T=0;for(const O of y.values()){if(f(this.options.signal),!O.external&&!this.parts.has(O.target.toLowerCase()))throw new TypeError("Missing relationship target: "+O.target);(++T&255)===0&&s()&&(await a(),f(this.options.signal))}}for(const w of this.parts.values())"written"in w||("prepared"in w?await h.addPrepared(w.uri.slice(1),w.prepared):await h.add(w.uri.slice(1),this.source(w.data)));for(const[w,y]of this.relationships){const T=w==="/"?"/":this.parts.get(w).uri;await h.add(R(T).slice(1),async O=>{const E=new p(O,this.options.signal);await E.write(m+'<Relationships xmlns="'+c+'">');for(const P of y.values()){const I='<Relationship Id="'+x(P.id)+'" Type="'+x(P.type)+'" Target="'+x(P.external?P.target:v(T,P.target))+'"'+(P.external?' TargetMode="External"':"")+"/>";E.append(I)&&await E.flush()}await E.write("</Relationships>"),await E.close()})}return await h.add("[Content_Types].xml",this.source(this.types.toXml())),await h.finish(),this.state="complete",h.bytesWritten}catch(w){throw await this.discard(w),w}finally{this.parts.clear(),this.directories.clear(),this.relationships.clear()}})(),this.result)}async toBlob(h="application/zip"){if(this.options.sink)throw new g("INVALID_STATE","This package uses a caller-owned sink; use finish().");return await this.finish(),this.zip.toBlob(h)}async discard(h){this.state="failed",this.parts.clear(),this.directories.clear(),this.relationships.clear(),await this.zip.discard(h)}}const d=Object.freeze({partUri:ct.partUri,relationshipPartUri:ct.relationshipPartUri,relativePartTarget:ct.relativePartTarget,corePropertiesXml:yt.corePropertiesXml,appPropertiesXml:yt.appPropertiesXml,relationshipsNamespace:c,officeRelationshipsNamespace:i,contentTypesNamespace:r,relationshipTypes:n,ContentTypes:t,OpcPackage:l});return B.set("945379594834125fea38bc00f02ef077409dd15f6ed67279e63e89afe0bb944b",d),d})(),Ke=B.get("6cfd3e806439f6301003a2d1699a74fdfa574d935550ab62b97b528728eaee1f")??(()=>{function S(v,C){if(!v)return;const k=v(C);if(k&&typeof k.then=="function")throw Promise.resolve(k).catch(()=>{}),new TypeError("onProgress must be synchronous.")}const R=Object.freeze({notifyProgress:S});return B.set("6cfd3e806439f6301003a2d1699a74fdfa574d935550ab62b97b528728eaee1f",R),R})(),lt=B.get("204def412284dfb11df9aececd57c8c0455db2927ebdb483dd255e7b29f6f359")??(()=>{function S(v){if(typeof v!="string"||!/^#?(?:[0-9a-f]{6}|[0-9a-f]{8})$/i.test(v))throw new TypeError("Color must be RGB or ARGB hex.");const C=v.replace(/^#/,"").toUpperCase();return C.length===6?"FF"+C:C}const R=Object.freeze({colorArgb:S});return B.set("204def412284dfb11df9aececd57c8c0455db2927ebdb483dd255e7b29f6f359",R),R})(),dt=B.get("6ae88f25e1c09d00fbb828917498569f883fae88ec25d37caebaf8a2b802b148")??(()=>{const{OfficeIMOError:S}=ue,{cleanXml:R,escapeOoxmlAttribute:v}=Re,{colorArgb:C}=lt;function k(m,f,a){if(!m||typeof m!="object"||Array.isArray(m))throw new TypeError(a+" must be an object.");if(typeof m.then=="function")throw Promise.resolve(m).catch(()=>{}),new TypeError(a+" must be synchronous.");for(const s of Object.keys(m))if(!f.includes(s))throw new TypeError("Unsupported "+a+" property: "+s)}function b(m,f){if(m!==void 0&&typeof m!="boolean")throw new TypeError(f+" must be boolean.")}class p{policy;maximum;numberFormat;definitions=new Map;constructor(f,a,s){this.policy=f,this.maximum=a,this.numberFormat=s}keys(f){const a=f.map(o=>g(o,this.policy,()=>164)),s=new Set(a.filter(o=>!this.definitions.has(o)));if(this.definitions.size+s.size>this.maximum)throw new S("RESOURCE_LIMIT","maxDifferentialStyles exceeded.");return a}check(f){this.keys(f)}add(f){const a=this.keys(f);for(let s=0;s<f.length;s++)this.definitions.has(a[s])||this.definitions.set(a[s],{id:this.definitions.size,xml:g(f[s],this.policy,this.numberFormat)});return a.map(s=>this.definitions.get(s).id)}toXml(){return this.definitions.size?'<dxfs count="'+this.definitions.size+'">'+[...this.definitions.values()].map(f=>"<dxf>"+f.xml+"</dxf>").join("")+"</dxfs>":""}}function g(m,f,a){k(m,["font","fill","border","numberFormat"],"conditional style");let s="";if(m.font!==void 0){k(m.font,["bold","italic","underline","strike","color"],"conditional font");let o="";for(const[c,i]of[["bold","b"],["italic","i"],["strike","strike"]])b(m.font[c],c),m.font[c]!==void 0&&(o+="<"+i+' val="'+(m.font[c]?1:0)+'"/>');b(m.font.underline,"underline"),m.font.underline!==void 0&&(o+='<u val="'+(m.font.underline?"single":"none")+'"/>'),m.font.color!==void 0&&(o+='<color rgb="'+C(m.font.color)+'"/>'),o&&(s+="<font>"+o+"</font>")}if(m.numberFormat!==void 0){const o=m.numberFormat;if(typeof o!="string"||!o||o.length>255||!R(o,f))throw new TypeError("Conditional number format requires 1 through 255 XML-valid characters.");s+='<numFmt numFmtId="'+a(o)+'" formatCode="'+v(o,f)+'"/>'}if(m.fill!==void 0){k(m.fill,["color"],"conditional fill");const o=C(m.fill.color);s+='<fill><patternFill patternType="solid"><fgColor rgb="'+o+'"/><bgColor rgb="'+o+'"/></patternFill></fill>'}if(m.border!==void 0){k(m.border,["left","right","top","bottom"],"conditional border");let o="";for(const c of["left","right","top","bottom"]){const i=m.border[c];if(i!==void 0){if(k(i,["style","color"],"conditional border edge"),!["thin","medium","dashed","dotted","thick","double","hair","dashDot","dashDotDot","slantDashDot","mediumDashed","mediumDashDot","mediumDashDotDot"].includes(i.style))throw new TypeError("Invalid conditional border style.");o+="<"+c+' style="'+i.style+'">'+(i.color!==void 0?'<color rgb="'+C(i.color)+'"/>':"")+"</"+c+">"}}o&&(s+="<border>"+o+"</border>")}if(!s)throw new TypeError("A conditional style must change at least one property.");return s}const x=Object.freeze({fields:k,optionalBoolean:b,DifferentialStyles:p,differentialXml:g});return B.set("6ae88f25e1c09d00fbb828917498569f883fae88ec25d37caebaf8a2b802b148",x),x})(),Ge=B.get("8d96d0024443ac9aeaea70e9324b53aacef098c2385d4e6a89a76d184e28556a")??(()=>{const{escapeOoxmlAttribute:S,cleanXml:R,xmlDeclaration:v}=Re,{OfficeIMOError:C}=ue,{colorArgb:k}=lt,{DifferentialStyles:b}=dt,p="http://schemas.openxmlformats.org/spreadsheetml/2006/main",g=["thin","medium","dashed","dotted","thick","double","hair","dashDot","dashDotDot","slantDashDot","mediumDashed","mediumDashDot","mediumDashDotDot"];function x(r){if(!r||typeof r!="object")throw new TypeError("A border must be an object of edges.");const n={};for(const e of["left","right","top","bottom"]){const t=r[e];if(t){const{style:l,color:d}=t;if(!g.includes(l))throw new TypeError("Invalid border style.");n[e]={style:l,...d?{color:k(d)}:{}}}}return n}const m={General:"General",Integer:"0",Decimal:"0.00",Percent:"0.00%",Date:"yyyy-mm-dd",DateTime:"yyyy-mm-dd hh:mm:ss"};function f(r,n,e){if(!Number.isInteger(r)||r<0||r>=n)throw new RangeError("Unknown "+e+" index.");return r}function a(r,n,e,t){const l=JSON.stringify(e),d=n.get(l);if(d!==void 0)return d;if(r.length>=t)throw new C("RESOURCE_LIMIT","Style component limit exceeded.");const u=r.length;return r.push(e),n.set(l,u),u}function s(r){if(!r||typeof r!="object"||Array.isArray(r))throw new TypeError("A style patch must be a CellStyle object.");if(typeof r.then=="function")throw Promise.resolve(r).catch(()=>{}),new TypeError("Style patches must be synchronous CellStyle objects.")}function o(r){return s(r),Object.freeze({...r,...typeof r.font=="object"?{font:Object.freeze({...r.font})}:{},...typeof r.fill=="object"?{fill:Object.freeze({...r.fill})}:{},...typeof r.border=="object"?{border:Object.freeze(Object.fromEntries(Object.entries(r.border).map(([n,e])=>[n,Object.freeze({...e})])))}:{}})}class c{policy;maximum;differential;fonts=[{name:"Calibri",size:11,bold:!1,italic:!1,underline:!1,strike:!1,color:""}];fills=[{pattern:"none",color:""},{pattern:"gray125",color:""}];borders=[{}];formats=new Map;styles=[];indexes=new Map;fontIndexes=new Map(this.fonts.map((n,e)=>[JSON.stringify(n),e]));fillIndexes=new Map(this.fills.map((n,e)=>[JSON.stringify(n),e]));borderIndexes=new Map(this.borders.map((n,e)=>[JSON.stringify(n),e]));constructor(n="strip",e=64e3,t=1e3){if(this.policy=n,this.maximum=e,!Number.isSafeInteger(e)||e<1||e>64e3)throw new RangeError("maxStyles must be from 1 through 64,000.");if(!Number.isSafeInteger(t)||t<0)throw new RangeError("maxDifferentialStyles must be a nonnegative safe integer.");this.differential=new b(n,t,l=>this.addNumberFormat(l)),R("",n),this.add()}checkDifferentials(n){const e=new Set(n.flatMap(t=>t.numberFormat===void 0?[]:[R(t.numberFormat,this.policy)]).filter(t=>t!=="General"&&!this.formats.has(t)));if(this.formats.size+e.size>65372)throw new RangeError("Too many number formats.");this.differential.check(n)}addDifferentials(n){return this.checkDifferentials(n),this.differential.add(n)}addFont(n){const{name:e,size:t,bold:l,italic:d,underline:u,strike:h,color:w}=n;if(e!==void 0&&typeof e!="string")throw new TypeError("Font name must be a string.");const y=R(e??"Calibri",this.policy),T=t??11;if(typeof y!="string"||!y||y.length>31)throw new TypeError("Font name must contain 1 through 31 characters.");if(!Number.isFinite(T)||T<=0||T>409)throw new RangeError("Font size must be positive and at most 409.");return a(this.fonts,this.fontIndexes,{name:y,size:T,bold:!!l,italic:!!d,underline:!!u,strike:!!h,color:w?k(w):""},this.maximum)}addFill(n){const{color:e}=n,t=n.pattern??(e?"solid":"none");if(!["none","gray125","solid"].includes(t)||t==="solid"&&!e||t!=="solid"&&e)throw new TypeError("A solid fill requires a color; none and gray125 have no color.");return a(this.fills,this.fillIndexes,{pattern:t,color:e?k(e):""},this.maximum+1)}addBorder(n){return a(this.borders,this.borderIndexes,x(n),this.maximum)}addNumberFormat(n){if(typeof n!="string"||!n||n.length>255)throw new TypeError("Number format must contain 1 through 255 characters.");if(n=R(n,this.policy),!n)throw new TypeError("Number format must contain XML-valid characters.");if(n==="General")return 0;let e=this.formats.get(n);if(e===void 0){if(this.formats.size>=65372)throw new RangeError("Too many number formats.");e=this.formats.size+164,this.formats.set(n,e)}return e}add(n={}){const e=typeof n.font=="number"?f(n.font,this.fonts.length,"font"):n.font?this.addFont(n.font):0,t=typeof n.fill=="number"?f(n.fill,this.fills.length,"fill"):n.fill?this.addFill(n.fill):0,l=typeof n.border=="number"?f(n.border,this.borders.length,"border"):n.border?this.addBorder(n.border):0;let d=0;if(typeof n.numberFormat=="string")d=this.addNumberFormat(n.numberFormat);else if(n.numberFormat!==void 0&&(d=n.numberFormat,!Number.isInteger(d)||d<0||d>163&&![...this.formats.values()].includes(d)))throw new RangeError("Unknown number format index.");if(n.alignment!==void 0&&!["left","center","right","fill","justify","distributed"].includes(n.alignment))throw new TypeError("Invalid horizontal alignment.");if(n.verticalAlignment!==void 0&&!["top","center","bottom","justify","distributed"].includes(n.verticalAlignment))throw new TypeError("Invalid vertical alignment.");const u={font:e,fill:t,border:l,numberFormat:d,wrapText:!!n.wrapText,alignment:n.alignment??"",verticalAlignment:n.verticalAlignment??""},h=JSON.stringify(u),w=this.indexes.get(h);if(w!==void 0)return w;if(this.styles.length>=this.maximum)throw new C("RESOURCE_LIMIT","Workbook exceeds its cell style limit.");const y=this.styles.length;return this.styles.push(u),this.indexes.set(h,y),y}validateStyle(n){return f(n,this.styles.length,"cell style")}compose(n,e){s(e);const t=this.styles[this.validateStyle(n)];return this.add({font:t.font,fill:t.fill,border:t.border,numberFormat:t.numberFormat,wrapText:t.wrapText,...t.alignment?{alignment:t.alignment}:{},...t.verticalAlignment?{verticalAlignment:t.verticalAlignment}:{},...e,...typeof e.font=="object"?{font:{...this.fonts[t.font],...e.font}}:{},...typeof e.border=="object"?{border:{...this.borders[t.border],...e.border}}:{}})}dateHeader(n,e){return this.compose(n,{numberFormat:this.styles[this.validateStyle(e)].numberFormat})}forColumn(n,e=!1,t,l=!1,d){const u=!e&&n.style!==void 0?this.styles[this.validateStyle(n.style)]:void 0,h=n.format!==void 0?n.format||m.General:u?.numberFormat||(n.type==="date"||l?m.DateTime:m.General);return this.add({...u?{font:u.font,fill:u.fill,border:u.border}:{},numberFormat:h,wrapText:n.wrapText??u?.wrapText??!1,...n.alignment?{alignment:n.alignment}:u?.alignment?{alignment:u.alignment}:{},...u?.verticalAlignment?{verticalAlignment:u.verticalAlignment}:{},...e?{font:{bold:!0}}:{},...t?{fill:{color:t}}:{},...d?{border:d}:{}})}toXml(){const n=t=>"<font>"+(t.bold?"<b/>":"")+(t.italic?"<i/>":"")+(t.underline?"<u/>":"")+(t.strike?"<strike/>":"")+'<sz val="'+t.size+'"/>'+(t.color?'<color rgb="'+t.color+'"/>':"")+'<name val="'+S(t.name,this.policy)+'"/></font>',e=t=>"<border>"+["left","right","top","bottom"].map(l=>{const d=t[l];return d?"<"+l+' style="'+d.style+'">'+(d.color?'<color rgb="'+d.color+'"/>':"")+"</"+l+">":"<"+l+"/>"}).join("")+"<diagonal/></border>";return v+'<styleSheet xmlns="'+p+'"><numFmts count="'+this.formats.size+'">'+[...this.formats].map(([t,l])=>'<numFmt numFmtId="'+l+'" formatCode="'+S(t,this.policy)+'"/>').join("")+'</numFmts><fonts count="'+this.fonts.length+'">'+this.fonts.map(n).join("")+'</fonts><fills count="'+this.fills.length+'">'+this.fills.map(t=>'<fill><patternFill patternType="'+t.pattern+'">'+(t.color?'<fgColor rgb="'+t.color+'"/><bgColor indexed="64"/>':"")+"</patternFill></fill>").join("")+'</fills><borders count="'+this.borders.length+'">'+this.borders.map(e).join("")+'</borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="'+this.styles.length+'">'+this.styles.map(t=>{const l=t.wrapText||t.alignment||t.verticalAlignment?"<alignment"+(t.wrapText?' wrapText="1"':"")+(t.alignment?' horizontal="'+t.alignment+'"':"")+(t.verticalAlignment?' vertical="'+t.verticalAlignment+'"':"")+"/>":"";return'<xf numFmtId="'+t.numberFormat+'" fontId="'+t.font+'" fillId="'+t.fill+'" borderId="'+t.border+'" xfId="0"'+(t.numberFormat?' applyNumberFormat="1"':"")+(t.font?' applyFont="1"':"")+(t.fill?' applyFill="1"':"")+(t.border?' applyBorder="1"':"")+(l?' applyAlignment="1"':"")+">"+l+"</xf>"}).join("")+'</cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>'+this.differential.toXml()+"</styleSheet>"}}const i=Object.freeze({colorArgb:lt.colorArgb,spreadsheetNamespace:p,normalizeBorder:x,NumberFormats:m,validateStylePatch:s,copyStylePatch:o,StyleRegistry:c});return B.set("8d96d0024443ac9aeaea70e9324b53aacef098c2385d4e6a89a76d184e28556a",i),i})(),Je=B.get("f1de2157d2aefa347a314940eb7f89c16545e11f69923920e605409433742f93")??(()=>{const{NotSupportedError:S}=ue,{cleanXml:R,escapeXml:v}=Re,C=new WeakSet,k=new WeakSet;function b(a){let s=!1;const o=/[\p{L}_\\][\p{L}\p{N}\p{M}_.\\]*/uy;for(let c=0;c<a.length;c++){const i=a[c];if(i==='"'){for(;++c<a.length;)if(a[c]==='"'){if(a[c+1]!=='"')break;c++}}else if(i==="'"){let r="";for(;++c<a.length;){if(a[c]==="'"){if(a[c+1]!=="'")break;c++}r+=a[c]}if(a.slice(c+1).trimStart().startsWith("!")&&/[\[\]]/.test(r))throw new S("external-workbook formulas")}else if(i==="["){let r=1;for(;++c<a.length&&r;){if(a[c]==="'"){c++;continue}a[c]==="["?r++:a[c]==="]"&&r--}if(/^[A-Za-z0-9_.]*!/.test(a.slice(c)))throw new S("external-workbook formulas");c--}else{if(i==="|")throw new S("DDE formulas");{o.lastIndex=c;const r=o.exec(a);r&&(["SUBTOTAL","AGGREGATE","_XLFN.AGGREGATE"].includes(r[0].toUpperCase())&&/^\s*\(/.test(a.slice(o.lastIndex))&&(s=!0),c=o.lastIndex-1)}}}return s}function p(a){if(typeof a!="string")throw new TypeError("Formula text must be a string.");const s=a.trim().replace(/^=/,"");if(!s.trim()||s.length>8192)throw new RangeError("Formulas require 1 through 8,192 characters.");return R(s,"reject"),{text:s,subtotal:b(s)}}class g{cachedValue;style;static[Symbol.hasInstance](s){return s!==null&&typeof s=="object"&&C.has(s)}formula;constructor(s,o,c){this.cachedValue=o,this.style=c;const i=p(s);if(this.formula=i.text,o!==null&&(typeof o!="number"||!Number.isFinite(o)))throw new TypeError("Formula caches must be finite numbers or null for a blank result.");if(c!==void 0&&(!Number.isSafeInteger(c)||c<0))throw new RangeError("Formula style indexes must be nonnegative safe integers.");C.add(this),i.subtotal&&k.add(this),Object.freeze(this)}}function x(a){return k.has(a)}function m(a){if(!(a instanceof g))throw new TypeError("Formula cells must be created with FormulaCell.");return"<f>"+v(a.formula,"reject")+"</f><v>"+(a.cachedValue??"")+"</v>"}const f=Object.freeze({FormulaCell:g,isSubtotalFormula:x,formulaXml:m});return B.set("f1de2157d2aefa347a314940eb7f89c16545e11f69923920e605409433742f93",f),f})(),Fe=B.get("e88a83ca79cd099fc2de29689554c913c7d04b17018098f81c43044064fcdfb8")??(()=>{const{cleanXml:S,escapeXml:R}=Re,{assertExportValue:v,assertScalar:C}=Se,{FormulaCell:k}=Je,{copyExportValue:b}=at;class p{value;style;constructor(e,t){this.value=e,this.style=t}}function g(n){n instanceof k||(n instanceof p?C(n.value):v(n))}function x(n){return n instanceof k?n:n instanceof p?Object.freeze(new p(b(n.value),n.style)):b(n)}function m(n,e="strip"){const t=S(n,e);if(t.length>32767)throw new RangeError("Excel cell text exceeds 32,767 UTF-16 code units.");return t}function f(n,e){const t=m(n,e),l=d=>'<t xml:space="preserve">'+R(d,e)+"</t>";return/_x[0-9a-f]{4}_/i.test(t)?t.split(/(?<=_)(?=x[0-9a-f]{4}_)/gi).map(d=>"<r>"+l(d)+"</r>").join(""):l(t)}function a(n){if(!Number.isInteger(n)||n<1||n>16384)throw new RangeError("Column index must be from 1 through 16,384.");let e="";for(;n;)n--,e=String.fromCharCode(65+n%26)+e,n=Math.floor(n/26);return e}function s(n,e){return n.slice(0,e).replace(/[\ud800-\udbff]$/,"")}function o(n){let e=0,t=n.length;const l=d=>d==="'"||/\s/u.test(d);for(;e<t&&l(n[e]);)e++;for(;t>e&&l(n[t-1]);)t--;return n.slice(e,t)}function c(n,e,t,l=!0){if(typeof n!="string")throw new TypeError("Sheet name must be a string.");let d=o(S(n,t).replace(/[\[\]:*?/\\]/g,"_"));d=o(s(d,31)),d||(d="Sheet"),d.toLowerCase()==="history"&&(d+="_");let u=d,h=2;for(;e.has(u.toLowerCase());){const w=" ("+h+++")";u=s(d,31-w.length)+w}return l&&e.add(u.toLowerCase()),u}function i(n,e){if(!Number.isFinite(n.getTime()))return null;const t=e==="utc",l=t?n.getUTCFullYear():n.getFullYear();if(l<1900||l>9999)throw new RangeError("Excel dates must be in years 1900 through 9999.");const d=new Date(0);d.setUTCFullYear(l,t?n.getUTCMonth():n.getMonth(),t?n.getUTCDate():n.getDate()),d.setUTCHours(t?n.getUTCHours():n.getHours(),t?n.getUTCMinutes():n.getMinutes(),t?n.getUTCSeconds():n.getSeconds(),t?n.getUTCMilliseconds():n.getMilliseconds());const u=d.getTime();return(u-Date.UTC(1899,11,31))/864e5+(u>=Date.UTC(1900,2,1)?1:0)}const r=Object.freeze({Cell:p,assertXlsxValue:g,copyValue:x,cellText:m,inlineText:f,columnName:a,sheetName:c,excelDate:i});return B.set("e88a83ca79cd099fc2de29689554c913c7d04b17018098f81c43044064fcdfb8",r),r})(),It=B.get("e92456dbf0c50db97c8b6cf9a09365489ca3a882b4d506ad4dd841805b1146d1")??(()=>{const{captureFields:S}=ke;function R(b,p){if(b===void 0)return;if(!Array.isArray(b)||b.length>p)throw new TypeError("Column outlines must be bounded, non-overlapping ranges.");let g=0;return Object.freeze(b.map(x=>{if(!x||typeof x!="object")throw new TypeError("Column outlines require range metadata.");return S(x,["firstColumn","columnCount","level","hidden","collapsed"])}).sort((x,m)=>x.firstColumn-m.firstColumn).map(x=>{const{firstColumn:m,columnCount:f,level:a=0,hidden:s,collapsed:o}=x;if(!Number.isSafeInteger(m)||m<g||!Number.isSafeInteger(f)||f<1||m+f>p)throw new RangeError("Column outline ranges must be disjoint and within the declared columns.");if(!Number.isInteger(a)||a<0||a>7)throw new RangeError("Column outline level must be from zero through seven.");for(const c of[s,o])if(c!==void 0&&typeof c!="boolean")throw new TypeError("Column outline flags must be booleans.");return g=m+f,Object.freeze({firstColumn:m,columnCount:f,level:a,...s===void 0?{}:{hidden:s},...o===void 0?{}:{collapsed:o}})}))}function v(b){for(const p of[b.outlineSummaryBelow,b.outlineSummaryRight])if(p!==void 0&&typeof p!="boolean")throw new TypeError("Outline summary positions must be booleans.")}function C(b){const p=new Map;for(const g of b??[])for(let x=g.firstColumn;x<g.firstColumn+g.columnCount;x++)p.set(x,g);return p}const k=Object.freeze({captureColumnOutlines:R,validateOutlinePositions:v,columnOutlineMap:C});return B.set("e92456dbf0c50db97c8b6cf9a09365489ca3a882b4d506ad4dd841805b1146d1",k),k})(),Ye=B.get("d56b24243cff6f3552a2f7b45521af4491494375ec76117e9ac1ebb047ce02da")??(()=>{const{assertExportValue:S}=Se,{copyExportValue:R}=at;function v(b,p){if(!Array.isArray(b)||!b.length||b.length>16)throw new RangeError("Spanned headings/footers need from 1 through 16 rows.");const g=b.map(x=>{if(!Array.isArray(x)||x.length!==p)throw new TypeError("Spanned rows must have the declared column count.");return Object.freeze(x.map(m=>{if(m===null)return null;if(!m||typeof m!="object")throw new TypeError("Uncovered heading/footer cells need an anchor value.");const{value:f,columnSpan:a,rowSpan:s}=m;return Object.freeze({value:R(f),...a===void 0?{}:{columnSpan:a},...s===void 0?{}:{rowSpan:s}})}))});return C(g,p),Object.freeze(g)}function C(b,p){if(!Array.isArray(b)||!b.length||b.length>16)throw new RangeError("Spanned headings/footers need from 1 through 16 rows.");const g=Array.from({length:b.length},()=>new Uint8Array(p));return b.map((x,m)=>{if(!Array.isArray(x)||x.length!==p)throw new TypeError("Spanned rows must have the declared column count.");const f=[];for(let a=0;a<p;a++){const s=x[a];if(g[m][a]){if(s!==null)throw new TypeError("Covered heading/footer cells must be null.");continue}if(!s||typeof s!="object")throw new TypeError("Uncovered heading/footer cells need an anchor value.");const o=s.columnSpan??1,c=s.rowSpan??1;if(!Number.isInteger(o)||!Number.isInteger(c)||o<1||c<1||a+o>p||m+c>b.length)throw new RangeError("Heading/footer spans must stay inside the declared matrix.");const i=s.value;S(i);for(let r=m;r<m+c;r++)for(let n=a;n<a+o;n++){if(g[r][n])throw new TypeError("Heading/footer spans overlap.");if((r!==m||n!==a)&&b[r]?.[n]!==null)throw new TypeError("Covered heading/footer cells must be null.");g[r][n]=1}f.push(Object.freeze({first:a,span:o,rowSpan:c,value:i}))}return Object.freeze(f)})}const k=Object.freeze({captureTableSpans:v,tableSpans:C});return B.set("d56b24243cff6f3552a2f7b45521af4491494375ec76117e9ac1ebb047ce02da",k),k})(),jt=B.get("aaf6808e1812a251687fd513480fe845b5677ffa493bccf519409807fe4d250c")??(()=>{const{ChunkedTextSink:S}=Oe,{escapeXml:R,xmlDeclaration:v}=Re,{officeRelationshipsNamespace:C}=$e,{columnName:k}=Fe,b="http://schemas.openxmlformats.org/drawingml/2006/chart",p="application/vnd.openxmlformats-officedocument.drawingml.chart+xml";function g(i,r,n){const e=' cx="'+Math.round(i.width*9525)+'" cy="'+Math.round(i.height*9525)+'"';return"<xdr:oneCellAnchor><xdr:from><xdr:col>"+(i.column-1)+"</xdr:col><xdr:colOff>0</xdr:colOff><xdr:row>"+(i.row-1)+"</xdr:row><xdr:rowOff>0</xdr:rowOff></xdr:from><xdr:ext"+e+'/><xdr:graphicFrame macro=""><xdr:nvGraphicFramePr><xdr:cNvPr id="'+r+'" name="Chart '+i.id+'" descr="'+R(i.description??i.title??"",n)+'"/><xdr:cNvGraphicFramePr/></xdr:nvGraphicFramePr><xdr:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/></xdr:xfrm><a:graphic><a:graphicData uri="'+b+'"><c:chart xmlns:c="'+b+'" r:id="chart'+i.id+'"/></a:graphicData></a:graphic></xdr:graphicFrame><xdr:clientData/></xdr:oneCellAnchor>'}function x(i,r){return'<c:title><c:tx><c:rich><a:bodyPr/><a:lstStyle/><a:p><a:pPr><a:defRPr/></a:pPr><a:r><a:t xml:space="preserve">'+R(i,r)+'</a:t></a:r></a:p></c:rich></c:tx><c:overlay val="0"/></c:title>'}function*m(i,r,n,e){yield"<c:"+i+"Ref><c:f>"+R(r,e)+"</c:f><c:"+i+"Cache>",i==="num"&&(yield"<c:formatCode>General</c:formatCode>"),yield'<c:ptCount val="'+n.length+'"/>';for(let t=0;t<n.length;t++)yield'<c:pt idx="'+t+'"><c:v xml:space="preserve">'+R(String(n[t]),e)+"</c:v></c:pt>";yield"</c:"+i+"Cache></c:"+i+"Ref>"}function f(i,r){const n=i.dataLabels;if(!n)return"";const e={center:"ctr",insideEnd:"inEnd",outsideEnd:"outEnd",bestFit:"bestFit",above:"t",below:"b",left:"l",right:"r"};return"<c:dLbls>"+(n.numberFormat===void 0?"":'<c:numFmt formatCode="'+R(n.numberFormat,r)+'" sourceLinked="0"/>')+(n.position===void 0?"":'<c:dLblPos val="'+e[n.position]+'"/>')+'<c:showLegendKey val="0"/><c:showVal val="'+(n.showValue===!1?0:1)+'"/><c:showCatName val="'+(n.showCategoryName?1:0)+'"/><c:showSerName val="'+(n.showSeriesName?1:0)+'"/><c:showPercent val="'+(n.showPercent?1:0)+'"/><c:showBubbleSize val="0"/></c:dLbls>'}function a(i,r){const n=i.type==="barClustered",e=i.valueAxis,t='<c:scaling><c:orientation val="minMax"/>'+(e?.maximum===void 0?"":'<c:max val="'+e.maximum+'"/>')+(e?.minimum===void 0?"":'<c:min val="'+e.minimum+'"/>')+"</c:scaling>",l='<c:majorTickMark val="none"/><c:minorTickMark val="none"/><c:tickLblPos val="nextTo"/>';return'<c:catAx><c:axId val="1"/><c:scaling><c:orientation val="minMax"/></c:scaling><c:delete val="0"/><c:axPos val="'+(n?"l":"b")+'"/>'+(i.categoryAxis?.title?x(i.categoryAxis.title,r):"")+'<c:numFmt formatCode="General" sourceLinked="1"/>'+l+'<c:crossAx val="2"/><c:crosses val="autoZero"/><c:auto val="1"/><c:lblAlgn val="ctr"/><c:lblOffset val="100"/><c:noMultiLvlLbl val="0"/></c:catAx><c:valAx><c:axId val="2"/>'+t+'<c:delete val="0"/><c:axPos val="'+(n?"b":"l")+'"/><c:majorGridlines/>'+(e?.title?x(e.title,r):"")+'<c:numFmt formatCode="'+R(e?.numberFormat??"General",r)+'" sourceLinked="'+(e?.numberFormat===void 0?1:0)+'"/>'+l+'<c:crossAx val="1"/><c:crosses val="autoZero"/><c:crossBetween val="between"/></c:valAx>'}function*s(i,r){const n=i.type==="pie",e=i.type==="line",t=n?"pieChart":e?"lineChart":"barChart",l="'"+i.dataSheetName.replace(/'/g,"''")+"'!",d=i.data.categories.length+1;yield v+'<c:chartSpace xmlns:c="'+b+'" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="'+C+'"><c:date1904 val="0"/>'+(i.language===void 0?"":'<c:lang val="'+R(i.language,r)+'"/>')+"<c:chart>",i.title&&(yield x(i.title,r)),yield'<c:autoTitleDeleted val="'+(i.title?0:1)+'"/><c:plotArea><c:layout/><c:'+t+">",n||(yield e?'<c:grouping val="standard"/>':'<c:barDir val="'+(i.type==="barClustered"?"bar":"col")+'"/><c:grouping val="clustered"/>'),yield'<c:varyColors val="'+(n?1:0)+'"/>';for(let u=0;u<i.data.series.length;u++){const h=i.data.series[u],w="$"+k(u+2);yield'<c:ser><c:idx val="'+u+'"/><c:order val="'+u+'"/><c:tx>';const y=i.binding?i.binding.references.names[u]:l+w+"$1";y===void 0?yield"<c:v>"+R(h.name,r)+"</c:v>":yield*m("str",y,[h.name],r),yield"</c:tx>",h.color&&(yield"<c:spPr>"+(e?'<a:ln w="25400">':"")+'<a:solidFill><a:srgbClr val="'+h.color+'"/></a:solidFill>'+(e?"</a:ln>":"")+"</c:spPr>"),!e&&!n&&(yield'<c:invertIfNegative val="0"/>'),yield"<c:cat>",yield*m("str",i.binding?.references.categories??l+"$A$2:$A$"+d,i.data.categories,r),yield"</c:cat><c:val>",yield*m("num",i.binding?.references.values[u]??l+w+"$2:"+w+"$"+d,h.values,r),yield"</c:val>"+(e?'<c:smooth val="0"/>':"")+"</c:ser>"}yield f(i,r),!n&&!e&&(yield'<c:gapWidth val="150"/><c:overlap val="0"/>'),n||(yield'<c:axId val="1"/><c:axId val="2"/>'),yield"</c:"+t+">",n||(yield a(i,r)),yield"</c:plotArea>",i.legend!==!1&&(yield'<c:legend><c:legendPos val="'+{right:"r",bottom:"b",left:"l",top:"t"}[i.legend??"right"]+'"/><c:layout/><c:overlay val="0"/></c:legend>'),yield'<c:plotVisOnly val="'+(i.binding?1:0)+'"/><c:dispBlanksAs val="gap"/><c:showDLblsOverMax val="0"/></c:chart></c:chartSpace>'}async function o(i,r,n,e){const t=new S(r,e);for(const l of s(i,n))t.append(l)&&await t.flush();await t.close()}const c=Object.freeze({chartNamespace:b,chartContentType:p,chartAnchorXml:g,writeChartXml:o});return B.set("aaf6808e1812a251687fd513480fe845b5677ffa493bccf519409807fe4d250c",c),c})(),Qe=B.get("d599dca57105b9cc787ba2498051ed0193cbdb1e5f23116e35bc77cd67a233f1")??(()=>{const{cleanXml:S,escapeXml:R,escapeOoxmlAttribute:v,xmlDeclaration:C}=Re,{copyExportLink:k}=it,{officeRelationshipsNamespace:b}=$e,{chartAnchorXml:p}=jt,{captureFields:g}=ke;function x(r,n){if(r=g(r,["row","column","width","height","description"]),!Number.isInteger(r.row)||r.row<1||r.row>1048576||!Number.isInteger(r.column)||r.column<1||r.column>16384)throw new RangeError("Drawing anchors must be one-based worksheet rows and columns.");for(const e of[r.width,r.height])if(!Number.isFinite(e)||e<=0||e>1e5)throw new RangeError("Drawing display dimensions must be positive and at most 100,000 pixels.");if(r.description!==void 0&&typeof r.description!="string")throw new TypeError("Drawing description must be a string.");return Object.freeze({row:r.row,column:r.column,width:r.width,height:r.height,...r.description===void 0?{}:{description:S(r.description,n)}})}function m(r){const n=typeof r=="string"&&/^([A-Z]{1,3})([1-9][0-9]{0,6})$/.exec(r);if(!n)throw new TypeError("Use a single uppercase A1 cell reference.");const e=Number(n[2]);let t=0;for(const l of n[1])t=t*26+l.charCodeAt(0)-64;if(t>16384||e>1048576)throw new RangeError("Cell reference exceeds Excel's worksheet bounds.");return{row:e,column:t}}function f(r,n){r=g(r,["cell","target","tooltip"]),m(r.cell);const e=k(r);return Object.freeze({cell:r.cell,target:e.target,...e.tooltip===void 0?{}:{tooltip:S(e.tooltip,n)}})}function a(r,n,e){if(r=g(r,["data","row","column","width","height","description"]),r.data instanceof Uint8Array&&e?.(r.data.length),!(r.data instanceof Uint8Array)||r.data.length<33||![137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82].every((l,d)=>r.data[d]===l))throw new TypeError("Images require PNG bytes with a valid signature and IHDR header.");const t=new DataView(r.data.buffer,r.data.byteOffset,r.data.byteLength);if(!t.getUint32(16)||!t.getUint32(20))throw new RangeError("PNG dimensions must be positive.");return Object.freeze({...x(r,n),data:new Uint8Array(r.data)})}function s(r,n,e=[]){return"<hyperlinks>"+r.map((t,l)=>'<hyperlink ref="'+t.cell+'" r:id="link'+(l+1)+'"'+(t.tooltip===void 0?"":' tooltip="'+v(t.tooltip,n)+'"')+"/>").join("")+e.map(t=>'<hyperlink ref="'+t.cell+'" location="'+v(t.location,n)+'"/>').join("")+"</hyperlinks>"}function o(r,n,e=[]){const t="http://schemas.openxmlformats.org/drawingml/2006/";return C+'<xdr:wsDr xmlns:xdr="'+t+'spreadsheetDrawing" xmlns:a="'+t+'main" xmlns:r="'+b+'">'+r.map((l,d)=>{const u=' cx="'+Math.round(l.width*9525)+'" cy="'+Math.round(l.height*9525)+'"';return"<xdr:oneCellAnchor><xdr:from><xdr:col>"+(l.column-1)+"</xdr:col><xdr:colOff>0</xdr:colOff><xdr:row>"+(l.row-1)+"</xdr:row><xdr:rowOff>0</xdr:rowOff></xdr:from><xdr:ext"+u+'/><xdr:pic><xdr:nvPicPr><xdr:cNvPr id="'+(d+1)+'" name="Image '+(d+1)+'" descr="'+R(l.description??"",n)+'"/><xdr:cNvPicPr/></xdr:nvPicPr><xdr:blipFill><a:blip r:embed="image'+(d+1)+'"/><a:stretch><a:fillRect/></a:stretch></xdr:blipFill><xdr:spPr><a:xfrm><a:off x="0" y="0"/><a:ext'+u+'/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></xdr:spPr></xdr:pic><xdr:clientData/></xdr:oneCellAnchor>'}).join("")+e.map((l,d)=>p(l,r.length+d+1,n)).join("")+"</xdr:wsDr>"}const i=Object.freeze({copyDrawingAnchor:x,cellPosition:m,copyHyperlink:f,copyImage:a,hyperlinksXml:s,drawingXml:o,drawingContentType:"application/vnd.openxmlformats-officedocument.drawing+xml"});return B.set("d599dca57105b9cc787ba2498051ed0193cbdb1e5f23116e35bc77cd67a233f1",i),i})(),Wt=B.get("39155eb25a58694b2caf100529b6c13dbe91f583741807b46232a2a567e19ecb")??(()=>{const{OfficeIMOError:S}=ue,{cellPosition:R}=Qe;function v(p){if(!p.length)return;const g=[...p].sort((c,i)=>c.top-i.top),x=g[Math.floor(g.length/2)].top,m=[],f=[],a=[];for(const c of g)(c.bottom<x?f:c.top>x?a:m).push(c);const s=v(f),o=v(a);return{middle:x,starts:m,ends:[...m].sort((c,i)=>i.bottom-c.bottom),...s?{before:s}:{},...o?{after:o}:{}}}function C(p,g,x){if(p){for(const m of g<=p.middle?p.starts:p.ends){if(g<=p.middle?m.top>g:m.bottom<g)break;x.push(m)}C(g<p.middle?p.before:g>p.middle?p.after:void 0,g,x)}}class k{references;index;currentRow=-1;current=[];lastRow;constructor(g,x,m){if(g.length>m)throw new S("RESOURCE_LIMIT","maxMergedRanges exceeded.");if(!g.length){this.references=Object.freeze([]),this.lastRow=0,this.index=void 0;return}const f=g.map(i=>{if(typeof i!="string"||i.split(":").length!==2)throw new TypeError("Merged ranges require uppercase A1:B2 references.");const[r,n]=i.split(":"),e=R(r),t=R(n);if(t.row<e.row||t.column<e.column||t.row===e.row&&t.column===e.column)throw new RangeError("Merged ranges require ordered distinct cells.");if(t.column>x)throw new RangeError("Merged ranges must stay within declared columns.");return{ref:i,top:e.row,bottom:t.row,left:e.column,right:t.column}}),a=f.flatMap(i=>[{row:i.top,delta:1,region:i},{row:i.bottom+1,delta:-1,region:i}]).sort((i,r)=>i.row-r.row||i.delta-r.delta),s=new Int32Array(65536),o=new Int32Array(65536);function c(i,r,n,e,t,l){if(e<=r&&n<=t){s[i]=s[i]+l,o[i]=o[i]+l;return}const d=r+n>>>1;e<=d&&c(i*2,r,d,e,t,l),t>d&&c(i*2+1,d+1,n,e,t,l),s[i]=o[i]+Math.max(s[i*2],s[i*2+1])}for(const i of a)if(c(1,1,16384,i.region.left,i.region.right,i.delta),s[1]>1)throw new TypeError("Merged ranges must not overlap: "+i.region.ref);this.references=Object.freeze(f.map(i=>i.ref)),this.lastRow=f.reduce((i,r)=>Math.max(i,r.bottom),0),this.index=v(f)}covered(g,x){if(!this.index||x>this.lastRow)return!1;this.currentRow!==x&&(this.current=[],C(this.index,x,this.current),this.current.sort((a,s)=>a.left-s.left),this.currentRow=x);let m=0,f=this.current.length-1;for(;m<=f;){const a=m+f>>>1,s=this.current[a];if(g<s.left)f=a-1;else if(g>s.right)m=a+1;else return x!==s.top||g!==s.left}return!1}validateRows(g){if(this.lastRow>g)throw new RangeError("Merged ranges must stay within exported rows.")}}const b=Object.freeze({MergeRegions:k});return B.set("39155eb25a58694b2caf100529b6c13dbe91f583741807b46232a2a567e19ecb",b),b})(),Gt=B.get("2a51a034ac74f5a0656731f46740bb80adee48101e7a4b51253d9399df11d238")??(()=>{const{ExportCell:S}=Se,{tableSpans:R}=Ye,{copyValue:v,columnName:C}=Fe;class k{values;ranges;constructor(g,x){const m=R(g,x),f=[];this.values=m.map((a,s)=>{const o=Array(x).fill(void 0);for(const c of a)o[c.first]=v(c.value),(c.span>1||c.rowSpan>1)&&f.push({first:c.first+1,last:c.first+c.span,top:s+1,bottom:s+c.rowSpan});return Object.freeze(o)}),this.ranges=f}get mergeCount(){return this.ranges.length}merges(g){return this.ranges.map(x=>C(x.first)+(x.top+g)+":"+C(x.last)+(x.bottom+g))}matchesLeaf(g){const x=this.values.length;return!this.ranges.some(m=>m.bottom===x)&&this.values[x-1].every((m,f)=>(m instanceof S?m.value:m)===g[f])}}const b=Object.freeze({StructuredRows:k});return B.set("2a51a034ac74f5a0656731f46740bb80adee48101e7a4b51253d9399df11d238",b),b})(),Ft=B.get("b732883d8635c0adf27cef2a3900f08374d02c9ce1b005d02af6853c8be627cc")??(()=>{const{ExportCell:S}=Se,{isDate:R}=Le,{Cell:v,cellText:C,columnName:k}=Fe,{FormulaCell:b}=Je,{escapeOoxmlAttribute:p}=Re,{MergeRegions:g}=Wt,{OfficeIMOError:x}=ue,{createTotals:m}=gt,{StructuredRows:f}=Gt;class a{value;formula;operation;constructor(e,t,l){this.value=e,this.formula=t,this.operation=l}}class s{columns;options;headings;merges;headerRows;firstHeaderRow;regions;widths;sampleRows;structuredFooter;footerRows;mergeCount;aggregates;constructor(e,t,l,d=1e4,u=1e5){this.columns=e,this.options=t;const h=t.title===void 0?0:1;if(t.title!==void 0){if(!e.length)throw new TypeError("Report titles require declared columns.");if(typeof t.title.text!="string")throw new TypeError("Report title text must be a string.");if(C(t.title.text,l),t.title.height!==void 0&&(!Number.isFinite(t.title.height)||t.title.height<=0||t.title.height>409))throw new RangeError("Title height must be positive and at most 409 points.")}const w=Math.max(0,...e.map(I=>I.groups?.length??0));if(t.headerRows===void 0){if(w>16)throw new RangeError("Grouped headings support at most 16 levels.");if(w&&t.includeHeader===!1)throw new TypeError("Grouped headings require leaf headers.")}const y=[],T=[];if(h&&e.length>1&&T.push("A1:"+k(e.length)+"1"),t.headerRows!==void 0&&t.includeHeader!==!1){const I=new f(t.headerRows,e.length);if((t.table||t.autoFilter)&&!I.matchesLeaf(e.map(A=>A.header)))throw new TypeError("Native tables and autofilters require an unmerged final heading row matching the declared leaf headers.");y.push(...I.values),T.push(...I.merges(h))}else if(t.includeHeader!==!1){for(let I=0;I<w;I++){const A=e.map(F=>F.groups?.[I]??"");for(const F of A)C(F,l);for(let F=0;F<e.length;){let N=F;const U=JSON.stringify(e[F].groups?.slice(0,I+1));for(;N+1<e.length&&A[F]&&JSON.stringify(e[N+1].groups?.slice(0,I+1))===U;)N++;if(N>F){T.push(k(F+1)+(I+1+h)+":"+k(N+1)+(I+1+h));for(let M=F+1;M<=N;M++)A[M]=""}F=N+1}y.push(A)}e.length&&y.push(e.map(I=>I.header))}if(this.headerRows=h+y.length,this.firstHeaderRow=e.length&&t.includeHeader!==!1?h+1:0,t.mergedCells!==void 0&&!Array.isArray(t.mergedCells))throw new TypeError("Merged ranges must be an array.");if(t.footer?.rows!==void 0&&(t.footer.values!==void 0||t.footer.totals!==void 0))throw new TypeError("Structured footer rows cannot accompany footer values or totals.");if(this.structuredFooter=t.footer?.rows===void 0?void 0:new f(t.footer.rows,e.length),this.footerRows=this.structuredFooter?.values.length??(t.footer?1:0),this.mergeCount=T.length+(t.mergedCells?.length??0)+(this.structuredFooter?.mergeCount??0),this.mergeCount>d)throw new x("RESOURCE_LIMIT","maxMergedRanges exceeded.");if(this.regions=new g([...T,...t.mergedCells??[]],e.length,d),t.table){for(const I of t.mergedCells??[])if(Number(I.split(":")[1].match(/\d+$/)[0])>=this.headerRows)throw new TypeError("Merged ranges cannot intersect a native table.")}this.headings=y,this.merges=this.regions.references;const O=t.autoSize;if(this.sampleRows=O?O.sampleRows??Math.min(100,Math.floor(u/Math.max(1,e.length))):0,!Number.isInteger(this.sampleRows)||this.sampleRows<0||this.sampleRows>1048576)throw new RangeError("Width sampling must use from 0 through 1,048,576 rows within its buffer budgets.");const E=O?.minWidth??8,P=O?.maxWidth??60;if(!Number.isFinite(E)||!Number.isFinite(P)||E<0||E>P||P>255)throw new RangeError("Width bounds must satisfy 0 <= minWidth <= maxWidth <= 255.");if(this.widths=e.map(I=>I.width??(O?Math.max(E,Math.min(P,I.header.length+2)):void 0)),t.footer?.values&&t.footer.values.length>e.length)throw new RangeError("Footer has more values than declared columns.");this.aggregates=m(e,t.footer?.totals),t.print&&c(t.print,l)}finalRegions(e,t){return this.structuredFooter?new g([...this.merges,...this.structuredFooter.merges(this.headerRows+e)],this.columns.length,t):this.regions}sample(e){const t=this.options.autoSize?.minWidth??8,l=this.options.autoSize?.maxWidth??60;e.forEach((d,u)=>{if(!this.columns[u]||this.columns[u].width!==void 0)return;const h=d instanceof b?d.cachedValue:d instanceof S?d.text??d.value:d instanceof v?d.value:d,w=R(h)?Number.isFinite(h.getTime())?h.toISOString():"":h==null?"":String(h),y=Math.max(0,...w.slice(0,Math.ceil(l*4)).split(/\r?\n/).map(T=>[...T].length));this.widths[u]=Math.max(this.widths[u]??t,Math.min(l,y+2))})}accept(e,t){this.aggregates[e].accept(t)}footer(e){return this.columns.map((t,l)=>{const d=this.aggregates[l],u=d.operation;if(!u)return this.options.footer?.values?.[l];const h=d.value();return new a(h,o(u,k(l+1),this.headerRows,e),u)})}}function o(n,e,t,l){const d={sum:109,count:102,average:101,min:105,max:104}[n],u=["average","min","max"].includes(n),h=e+(t+1)+":"+e+(t+l),w="SUBTOTAL("+d+","+h+")";return l?u?"IF(SUBTOTAL(102,"+h+')=0,"",'+w+")":w:u?'""':"0"}function c(n,e){if(n.paper!==void 0&&!["A4","Letter"].includes(n.paper))throw new TypeError("Print paper must be A4 or Letter.");if(n.orientation!==void 0&&!["portrait","landscape"].includes(n.orientation))throw new TypeError("Invalid print orientation.");for(const t of[n.fitToWidth,n.fitToHeight])if(t!==void 0&&(!Number.isInteger(t)||t<0||t>32767))throw new RangeError("Print fit dimensions must be integers from 0 through 32,767.");for(const t of Object.values(n.margins??{}))if(!Number.isFinite(t)||t<0||t>10)throw new RangeError("Print margins must be from 0 through 10 inches.");for(const t of[n.header,n.footer])if(t!==void 0){if(typeof t!="string"||t.length>250)throw new TypeError("Print header/footer must be strings of at most 250 UTF-16 units.");if(C(t,e),("&C"+t.replace(/&/g,"&&")).length>255)throw new RangeError("Encoded print header/footer exceeds Excel's 255-character limit.")}}function i(n,e){if(!n)return"";const t={left:.25,right:.25,top:.5,bottom:.5,header:.2,footer:.2,...n.margins};return"<pageMargins"+Object.entries(t).map(([l,d])=>" "+l+'="'+d+'"').join("")+'/><pageSetup paperSize="'+(n.paper==="Letter"?1:9)+'" orientation="'+(n.orientation??"landscape")+'" fitToWidth="'+(n.fitToWidth??1)+'" fitToHeight="'+(n.fitToHeight??0)+'"/>'+(n.header!==void 0||n.footer!==void 0?"<headerFooter>"+(n.header===void 0?"":"<oddHeader>"+p("&C"+n.header.replace(/&/g,"&&"),e)+"</oddHeader>")+(n.footer===void 0?"":"<oddFooter>"+p("&C"+n.footer.replace(/&/g,"&&"),e)+"</oddFooter>")+"</headerFooter>":"")}const r=Object.freeze({ComputedTotal:a,ReportLayout:s,totalFormula:o,printXml:i});return B.set("b732883d8635c0adf27cef2a3900f08374d02c9ce1b005d02af6853c8be627cc",r),r})(),et=B.get("09d589ff8f82302ce4c17411c7b811a87fb034e61e4b3013b7f8b18853a90449")??(()=>{const{columnName:S}=Fe;function R(b,p,g="Data"){if(typeof p=="string"){const x=b.flatMap((m,f)=>m.key===p?[f+1]:[]);if(x.length!==1)throw new TypeError(g+" column keys must identify exactly one declared column.");return x[0]}if(!Number.isInteger(p)||p<1||p>b.length)throw new RangeError(g+" column numbers must be one-based and within declared columns.");return p}function v(b,p,g,x){if(!Number.isSafeInteger(g)||g<1||!Number.isSafeInteger(x)||x<1||g+x-1>1048576)throw new RangeError("A data range must fit within Excel's worksheet rows.");const m=S(p);return"'"+b.replace(/'/g,"''")+"'!$"+m+"$"+g+":$"+m+"$"+(g+x-1)}function C(b,p,g){return v(b,p,g,1).split(":")[0]}const k=Object.freeze({resolveDataColumn:R,qualifiedColumnRange:v,qualifiedCell:C});return B.set("09d589ff8f82302ce4c17411c7b811a87fb034e61e4b3013b7f8b18853a90449",k),k})(),ht=B.get("55a9bd1fb59ea19bf98a03859769a119fdc71a44075e560937e7184720e53514")??(()=>{const{OfficeIMOError:S}=ue,{columnName:R}=Fe,v=new WeakMap;function C(x,m){v.set(x,m)}function k(x){return v.get(x)}function b(x,m,f){const a=v.get(x);if(a===void 0)return f;const s=m+f;let o=0;for(const c of a){if(c.firstRow>s)break;o+=Math.min(c.lastRow,s)-c.firstRow+1}return o}function p(x,m,f,a,s){if(s===void 0)return a?R(x)+(f+1)+":"+R(m)+(f+a):void 0;const o=R(x),c=R(m);let i="",r=f;for(const n of s){if(!Number.isSafeInteger(n.firstRow)||!Number.isSafeInteger(n.lastRow)||n.firstRow<=r||n.lastRow<n.firstRow||n.lastRow>f+a)throw new RangeError("Detail editing ranges must be ordered within serialized worksheet rows.");const e=o+n.firstRow+":"+c+n.lastRow;if(i.length+(i?1:0)+e.length>32767)throw new S("RESOURCE_LIMIT","Detail editing references exceed 32,767 UTF-16 characters; split the worksheet.");i+=(i?" ":"")+e,r=n.lastRow}return i||void 0}const g=Object.freeze({retainDataRowRanges:C,dataRowRanges:k,dataRowCount:b,dataRowReference:p});return B.set("55a9bd1fb59ea19bf98a03859769a119fdc71a44075e560937e7184720e53514",g),g})(),Vt=B.get("a1b616256344317787b0b102f35d062009d6a2e9c873b9f106c99c095c92ace3")??(()=>{const{cleanXml:S,escapeXml:R,escapeOoxmlAttribute:v}=Re,{cellPosition:C}=Qe,{colorArgb:k}=lt,{fields:b,optionalBoolean:p,differentialXml:g}=dt,{resolveDataColumn:x}=et,{dataRowReference:m}=ht;function f(t,l){if(typeof t=="string"){const h=t.split(":");if(h.length>2)throw new TypeError("Conditional ranges require one uppercase A1 cell or rectangle.");const w=C(h[0]),y=C(h[1]??h[0]);if(y.row<w.row||y.column<w.column||y.column>l.length)throw new RangeError("Conditional ranges require ordered cells within declared columns.");return{first:w.column,last:y.column,reference:t,bottom:y.row}}b(t,["column","through"],"conditional data range");const d=x(l,t.column,"Conditional"),u=t.through===void 0?d:x(l,t.through,"Conditional");if(u<d)throw new RangeError("Conditional data ranges require ordered columns.");return{first:d,last:u}}function a(t){if(typeof t!="number"||!Number.isFinite(t))throw new TypeError("Conditional values must be finite numbers.");return String(t)}function s(t,l){if(typeof t!="string")return a(t);if(l!=="equal"&&l!=="notEqual")throw new TypeError("Text conditional comparisons support only equal and notEqual.");if(t.length>8190)throw new RangeError("Conditional comparison formulas must fit 8,192 characters including quotes.");S(t,"reject");const d='"'+t.replace(/"/g,'""')+'"';if(d.length>8192)throw new RangeError("Conditional comparison formulas must fit 8,192 characters including quotes.");return d}function o(t){if(typeof t!="string")throw new TypeError("Conditional formulas must be strings.");const l=t.trim().replace(/^=/,"");if(!l.trim()||l.length>8192)throw new RangeError("Conditional formulas require 1 through 8,192 characters.");return S(l,"reject"),l}function c(t,l){if(b(t,t.type==="min"||t.type==="max"?["type"]:["type","value"],"conditional threshold"),t.type==="min"||t.type==="max"){if(t.type!==(l==="first"?"min":l==="last"?"max":""))throw new TypeError("Use min only at the start and max only at the end of a scale.");return'<cfvo type="'+t.type+'"/>'}if(t.type==="formula")return'<cfvo type="formula" val="'+v(o(t.value),"reject")+'"/>';if(!["number","percent","percentile"].includes(t.type))throw new TypeError("Unsupported conditional threshold type.");if(!("value"in t))throw new TypeError("A numeric threshold requires a value.");const d=a(t.value);if(t.type!=="number"&&(t.value<0||t.value>100))throw new RangeError("Conditional percent/percentile thresholds must be from 0 through 100.");return'<cfvo type="'+(t.type==="number"?"num":t.type)+'" val="'+d+'"/>'}function i(t){for(let l=1;l<t.length;l++){const d=t[l-1],u=t[l];if("value"in d&&"value"in u&&d.type===u.type&&typeof d.value=="number"&&typeof u.value=="number"&&d.value>u.value)throw new RangeError("Conditional thresholds of the same numeric type must be ordered.")}}function r(t,l,d){if(t===void 0)return[];if(!Array.isArray(t))throw new TypeError("conditionalFormats must be an array.");return t.map(u=>{const h=["type","range"],w=["style","stopIfTrue"];b(u,[...h,...u?.type==="cellIs"?[...w,"operator","value","values"]:u?.type==="expression"?[...w,"formula"]:u?.type==="colorScale"?["stops"]:u?.type==="dataBar"?["color","minimum","maximum","showValue"]:[]],"conditional rule");const y=f(u.range,l);let T="",O="",E;if(u.type==="cellIs"||u.type==="expression")if(p(u.stopIfTrue,"stopIfTrue"),g(u.style,d,()=>164),E={...u.style,...u.style.font?{font:{...u.style.font}}:{},...u.style.fill?{fill:{...u.style.fill}}:{},...u.style.border?{border:Object.fromEntries(Object.entries(u.style.border).filter(([,P])=>P!==void 0).map(([P,I])=>[P,{...I}]))}:{}},u.stopIfTrue!==void 0&&(T+=' stopIfTrue="'+(u.stopIfTrue?1:0)+'"'),u.type==="expression")O="<formula>"+R(o(u.formula),"reject")+"</formula>";else{const P=u.operator==="between"||u.operator==="notBetween";if(!["equal","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","between","notBetween"].includes(u.operator))throw new TypeError("Unsupported conditional comparison operator.");if(P){if("value"in u||!Array.isArray(u.values)||u.values.length!==2)throw new TypeError("between/notBetween require exactly two values.");if(O=u.values.map(I=>"<formula>"+a(I)+"</formula>").join(""),u.values[0]>u.values[1])throw new RangeError("Conditional comparison bounds must be ordered.")}else{if("values"in u||!("value"in u))throw new TypeError("A conditional comparison requires one value.");O="<formula>"+R(s(u.value,u.operator),"reject")+"</formula>"}T+=' operator="'+u.operator+'"'}else if(u.type==="colorScale"){if(!Array.isArray(u.stops)||u.stops.length!==2&&u.stops.length!==3)throw new TypeError("Color scales require two or three stops.");const P=[],I=[];O="<colorScale>"+u.stops.map((A,F)=>(b(A,["threshold","color"],"color stop"),P.push(k(A.color)),I.push(A.threshold),c(A.threshold,F===0?"first":F===u.stops.length-1?"last":"middle"))).join("")+P.map(A=>'<color rgb="'+A+'"/>').join("")+"</colorScale>",i(I)}else if(u.type==="dataBar"){p(u.showValue,"showValue");const P=u.minimum===void 0?{type:"min"}:u.minimum,I=u.maximum===void 0?{type:"max"}:u.maximum;O='<dataBar showValue="'+(u.showValue===!1?0:1)+'">'+c(P,"first")+c(I,"last")+'<color rgb="'+k(u.color)+'"/></dataBar>',i([P,I])}else throw new TypeError("Unsupported conditional rule type.");return{target:y,type:u.type,attributes:T,body:O,...E?{style:E}:{}}})}class n{rules;constructor(l,d){const u=d.addDifferentials(l.flatMap(w=>w.style?[w.style]:[]));let h=0;this.rules=l.map((w,y)=>({target:w.target,xml:'<cfRule type="'+w.type+'" priority="'+(y+1)+'"'+(w.style?' dxfId="'+u[h++]+'"':"")+w.attributes+">"+w.body+"</cfRule>"}))}get count(){return this.rules.length}*xml(l,d,u,h){for(const w of this.rules){if(w.target.bottom!==void 0&&w.target.bottom>u)throw new RangeError("Conditional ranges must stay within exported rows.");const y=w.target.reference??m(w.target.first,w.target.last,l,d,h);y&&(yield'<conditionalFormatting sqref="'+y+'">'+w.xml+"</conditionalFormatting>")}}}const e=Object.freeze({prepareConditionalFormats:r,ConditionalFormats:n});return B.set("a1b616256344317787b0b102f35d062009d6a2e9c873b9f106c99c095c92ace3",e),e})(),Xt=B.get("13fa96d976e4dec7343dd3a392829567f1fcb574324a98f5a5d3a61c9a0dc27d")??(()=>{const{OfficeIMOError:S}=ue,{checkAbort:R}=be,{cleanXml:v,escapeOoxmlAttribute:C,escapeXml:k}=Re,{fields:b,optionalBoolean:p}=dt,{resolveDataColumn:g}=et,{dataRowReference:x}=ht;function m(o,c,i){if(o!==void 0){if(typeof o!="string")throw new TypeError(i+" must be text.");if(o.length>c)throw new RangeError(i+" exceeds "+c+" UTF-16 units.");return v(o,"reject")}}function f(o,c,i=1e3,r=1e6,n){if(R(n),o===void 0)return Object.freeze({rules:Object.freeze([]),count:0,textCharacters:0});if(!Array.isArray(o))throw new TypeError("dataValidation must be an array.");const e=o.length;if(e>i)throw new S("RESOURCE_LIMIT","maxDataValidations exceeded.");const t=[],l=new Set;let d=0;const u=h=>{if(d+h>r)throw new S("RESOURCE_LIMIT","maxValidationTextCharacters exceeded.");d+=h};for(let h=0;h<e;h++){R(n);const w=o[h];b(w,["type","column","items","allowBlank","showErrorMessage","errorStyle","errorTitle","errorMessage"],"data validation");const{type:y,column:T,items:O,allowBlank:E,showErrorMessage:P,errorStyle:I,errorTitle:A,errorMessage:F}=w;if(y!=="list")throw new TypeError("Only inline-list data validation is supported.");const N=g(c,T,"Validation");if(l.has(N))throw new TypeError("A data column cannot have multiple validation rules.");if(l.add(N),p(E,"allowBlank"),p(P,"showErrorMessage"),I!==void 0&&!["stop","warning","information"].includes(I))throw new TypeError("Unsupported validation error style.");if(!Array.isArray(O))throw new TypeError("Inline validation lists require a nonempty string array.");const U=O.length;if(!U)throw new TypeError("Inline validation lists require a nonempty string array.");if(U>254)throw new RangeError("Inline validation lists must fit 255 UTF-16 units including quotes and separators.");let M='"';for(let L=0;L<U;L++){R(n);const G=O[L];if(typeof G!="string")throw new TypeError("Inline validation choices must be strings.");if(G.length>253||G.includes(","))throw new RangeError("Inline validation choices cannot contain commas and must fit the 255-character list source.");v(G,"reject");const W=G.replace(/"/g,'""');if(M.length+(L?1:0)+W.length+1>255)throw new RangeError("Inline validation lists must fit 255 UTF-16 units including quotes and separators.");M+=(L?",":"")+W}M+='"';const Q=m(A,32,"Validation error title"),V=m(F,255,"Validation error message");u(M.length+(Q?.length??0)+(V?.length??0));const z=' type="list" allowBlank="'+(E===!1?0:1)+'" showErrorMessage="'+(P===!1?0:1)+'" errorStyle="'+(I??"stop")+'"'+(Q===void 0?"":' errorTitle="'+C(Q,"reject")+'"')+(V===void 0?"":' error="'+C(V,"reject")+'"');t.push(Object.freeze({column:N,attributes:z,formula:M}))}return R(n),Object.freeze({rules:Object.freeze(t),count:e,textCharacters:d})}function*a(o,c,i,r){if(!(!o.count||!i||r?.length===0)){yield'<dataValidations count="'+o.count+'">';for(const n of o.rules){const e=x(n.column,n.column,c,i,r);yield"<dataValidation"+n.attributes+' sqref="'+e+'"><formula1>'+k(n.formula,"reject")+"</formula1></dataValidation>"}yield"</dataValidations>"}}const s=Object.freeze({prepareDataValidations:f,dataValidationsXml:a});return B.set("13fa96d976e4dec7343dd3a392829567f1fcb574324a98f5a5d3a61c9a0dc27d",s),s})(),At=B.get("151a5a04c5f57081eb7df9705d62fc75f098c719c8fc832c59ef3ab0c4305b6a")??(()=>{const{checkAbort:S,consumeRows:R,inputRows:v,pause:C,taskYieldDue:k}=be,{ChunkedTextSink:b,BlobByteSink:p}=Oe,{OfficeIMOError:g}=ue,{notifyProgress:x}=Ke,{copyColumns:m,createRowProjector:f}=Ue,{EntryWriter:a}=bt,{xmlDeclaration:s}=Re,{officeRelationshipsNamespace:o}=$e,{Cell:c,cellText:i,columnName:r,inlineText:n,excelDate:e,copyValue:t}=Fe,{spreadsheetNamespace:l,colorArgb:d,validateStylePatch:u,copyStylePatch:h}=Ge,{copyHyperlink:w,copyImage:y,hyperlinksXml:T,cellPosition:O}=Qe,{ExportCell:E,assertScalar:P}=Se,{ReportLayout:I,ComputedTotal:A,printXml:F}=Ft,{cleanXml:N}=Re,{ConditionalFormats:U,prepareConditionalFormats:M}=Vt,{isDate:Q}=Le,{FormulaCell:V,formulaXml:z,isSubtotalFormula:L}=Je,{prepareDataValidations:G,dataValidationsXml:W}=Xt,{qualifiedCell:K,qualifiedColumnRange:X,resolveDataColumn:Z}=et,{dataRowRanges:se,dataRowCount:D}=ht,{captureColumnOutlines:q,columnOutlineMap:J,validateOutlinePositions:re}=It,le=65530;function oe(ye){if(ye>le)throw new RangeError("Excel supports at most 65,530 hyperlinks per worksheet; split the sheet.")}class ne{book;table;preserved;chartData;validations;columns;project;name;declared;options;entry;completion;prepared;buffer;output=new p;started=!1;busy=!1;failed=!1;error;count=0;headerRows;layout;completedRegions;titleStyle;pending=[];pendingCharacters=0;reservedLayout=!1;internalLinks=[];links=[];linkedCells=new Set;pictures=[];nativeCharts=[];conditional;completed=!1;chartSources=[];constructor(j,H,_,$,ie=!1,ce=[],ae=!1,fe={rules:[],count:0,textCharacters:0}){this.book=j,this.table=$,this.preserved=ie,this.chartData=ae,this.validations=fe,this.columns=m(_.columns??[],!0).map(pe=>Object.freeze(pe));const we=_.alternatingRowStyle;this.options={..._,..._.autoSize?{autoSize:{..._.autoSize}}:{},..._.mergedCells?{mergedCells:[..._.mergedCells]}:{},..._.title?{title:{..._.title,..._.title.style?{style:h(_.title.style)}:{}}}:{},..._.print?{print:{..._.print,..._.print.margins?{margins:{..._.print.margins}}:{}}}:{},..._.footer?{footer:{..._.footer,..._.footer.values?{values:_.footer.values.map(t)}:{},..._.footer.totals?{totals:{..._.footer.totals}}:{},..._.footer.style?{style:h(_.footer.style)}:{}}}:{},...we?{alternatingRowStyle:h(we)}:{}},this.layout=new I(this.columns,this.options,j.settings.invalidCharacterPolicy,j.settings.limits?.maxMergedRanges??1e4,j.settings.limits?.maxBufferedCells??1e5),this.titleStyle=_.title?j.styles.compose(j.styles.compose(0,{font:{bold:!0,size:18}}),this.options.title.style??{}):0,this.headerRows=this.layout.headerRows;for(const pe of _.hyperlinks??[]){const ee=w(pe,j.settings.invalidCharacterPolicy);this.links.push(ee),this.linkedCells.add(ee.cell)}j.checkLinks(this.links.length),this.declared=this.columns.map((pe,ee)=>({column:pe,letter:r(ee+1),style:j.styles.forColumn(pe),dateStyle:j.styles.forColumn(pe,!1,void 0,!0),headerStyle:this.headerRows?_.headerStyle??j.styles.forColumn({header:pe.header,...(_.headerWrap??pe.wrapText)===void 0?{}:{wrapText:_.headerWrap??pe.wrapText},...pe.alignment===void 0?{}:{alignment:pe.alignment}},_.boldHeader!==!1,_.headerFill,!1,_.headerBorder):0})),this.conditional=new U(ce,j.styles),j.retainLink(this.links.length),this.name=typeof H=="function"?H():H,this.project=f(this.columns,{sheetName:this.name,firstDataRow:this.headerRows+1},j.settings.signal,j.valueValidator)}static create(j,H,_,$,ie=!1,ce,ae){return new ne(j,H,_,$,ie,ce,!1,ae)}static createChartData(j,H){return new ne(j,H.dataSheetName,{columns:[{header:"Category"},...H.data.series.map(_=>({header:_.name,type:"number"}))]},void 0,!1,[],!0)}static validate(j,H){const _=m(H.columns??[],!0),$=G(H.dataValidation,_,j.availableDataValidations,j.availableValidationTextCharacters,j.settings.signal);j.checkConditionalFormats(H.conditionalFormats?.length??0);const ie=M(H.conditionalFormats,_,j.settings.invalidCharacterPolicy);j.styles.checkDifferentials(ie.flatMap(ae=>ae.style?[ae.style]:[]));const ce=new I(_,H,j.settings.invalidCharacterPolicy,j.settings.limits?.maxMergedRanges??1e4,j.settings.limits?.maxBufferedCells??1e5);if(j.checkMerges(ce.mergeCount),H.title?.style&&u(H.title.style),H.title&&j.styles.compose(j.styles.compose(0,{font:{bold:!0,size:18}}),H.title.style??{}),H.footer?.style&&j.styles.compose(0,H.footer.style),H.hyperlinks!==void 0){if(!Array.isArray(H.hyperlinks))throw new TypeError("Hyperlinks must be an array.");oe(H.hyperlinks.length);const ae=new Set;for(const fe of H.hyperlinks){const we=w(fe,j.settings.invalidCharacterPolicy),pe=O(we.cell);if(ce.regions.covered(pe.column,pe.row))throw new TypeError("Hyperlinks cannot address a covered merged cell.");if(ae.has(we.cell))throw new TypeError("Duplicate hyperlink cell: "+we.cell);ae.add(we.cell)}}if(_.length>16384)throw new RangeError("Excel supports at most 16,384 columns.");if(H.includeHeader===!1&&(H.freezeHeader||H.autoFilter))throw new TypeError("A frozen header or autofilter requires a header row.");if(H.headerFill!==void 0&&d(H.headerFill),H.headerWrap!==void 0&&typeof H.headerWrap!="boolean")throw new TypeError("headerWrap must be boolean.");H.headerStyle!==void 0&&j.styles.validateStyle(H.headerStyle),H.alternatingRowStyle!==void 0&&j.styles.compose(0,H.alternatingRowStyle);for(const ae of[H.rowStyle,H.cellStyle,H.rowOutline])if(ae!==void 0&&typeof ae!="function")throw new TypeError("Row and style callbacks must be functions.");if(H.maxOutlineLevel!==void 0&&(!Number.isInteger(H.maxOutlineLevel)||H.maxOutlineLevel<0||H.maxOutlineLevel>7))throw new RangeError("Maximum outline level must be an integer from zero through seven.");if(re(H),q(H.columnOutlines,_.length),H.rowOutline&&H.maxOutlineLevel===void 0)throw new TypeError("A row outline callback requires maxOutlineLevel before streamed rows are written.");if(!H.rowOutline&&H.maxOutlineLevel!==void 0)throw new TypeError("maxOutlineLevel requires a row outline callback.");for(const ae of[H.rowHeight,H.headerHeight])if(ae!==void 0&&(!Number.isFinite(ae)||ae<=0||ae>409))throw new RangeError("Row height must be positive and at most 409 points.");if(H.freezeColumns!==void 0&&(!Number.isInteger(H.freezeColumns)||H.freezeColumns<0||H.freezeColumns>_.length||H.freezeColumns>=16384))throw new RangeError("Frozen columns must be within the declared columns and leave a valid scrollable column.");if(H.table&&H.includeHeader===!1)throw new TypeError("Excel tables require a header row.");if(H.defaultColumnWidth!==void 0&&(!Number.isFinite(H.defaultColumnWidth)||H.defaultColumnWidth<0||H.defaultColumnWidth>255))throw new RangeError("Default column width must be from 0 through 255 characters.");for(const ae of _){if(ae.width!==void 0&&(!Number.isFinite(ae.width)||ae.width<0||ae.width>255))throw new RangeError("Column width must be from 0 through 255 characters.");if(ae.type!==void 0&&!["string","number","boolean","date"].includes(ae.type)&&!j.writerFor(ae.type))throw new TypeError("Invalid column type: "+ae.type);if(ae.alignment!==void 0&&!["left","center","right","fill","justify","distributed"].includes(ae.alignment))throw new TypeError("Invalid horizontal alignment.");if(i(ae.header,j.settings.invalidCharacterPolicy),ae.style!==void 0&&j.styles.validateStyle(ae.style),ae.format!==void 0&&(typeof ae.format!="string"||ae.format.length>255))throw new TypeError("Column format must be a string of at most 255 characters.")}return{conditional:ie,validations:$}}cell(j,H,_,$=!1,ie,ce,ae,fe=!1,we=!1,pe=!0){const ee=this.declared[H],Y=j instanceof A?j:void 0;Y&&(j=Y.value);let te=j instanceof V?j:void 0;te&&(j=te.cachedValue);let de=j instanceof E?j.presentation:void 0,ge=j instanceof E?j.link:void 0;j instanceof E&&(j=j.value);const me=te?.style??(j instanceof c?j.style:void 0),ve=(this.completedRegions??this.layout.regions).covered(H+1,_),ze=j instanceof c?j.value:j,Ce=ve&&(ze==null||ze==="");if(!$&&!fe&&ee.column.type&&!Ce){const Pe=this.book.writerFor(ee.column.type);if(Pe){if(te)throw new TypeError("An explicit FormulaCell cannot also pass through a custom cell value writer; return it from the writer instead.");j=Pe(j instanceof c?j.value:j,{column:ee.column,rowIndex:_-this.headerRows-1,worksheetRow:_,columnIndex:H,sheetName:this.name})}}j instanceof V&&(te=j,j=te.cachedValue),j instanceof E&&(de=j.presentation,ge=j.link,j=j.value);const Ee=te?.style??(j instanceof c?j.style??me:me);if(j instanceof c&&(j=j.value),P(j),ve){if(ge)throw new TypeError("Hyperlinks cannot address a covered merged cell.");if(te||Y||j!=null&&j!=="")throw new TypeError("A merged range would hide the value at "+ee.letter+_+"; covered cells must be empty.");j=void 0}const xe=Q(j)?"date":typeof j;if(!$&&!fe&&j!=null&&ee.column.type&&!this.book.writerFor(ee.column.type)&&ee.column.type!==xe)throw new TypeError("Cell "+ee.letter+_+" does not match column type "+ee.column.type+".");let Te=Ee===void 0?$?ee.headerStyle:Y?.operation==="count"?0:xe==="date"?ee.dateStyle:ee.style:this.book.styles.validateStyle(Ee);if($&&xe==="date"&&Ee===void 0&&this.options.headerStyle===void 0&&(Te=this.book.styles.dateHeader(Te,ee.dateStyle)),we&&(Te=this.titleStyle),!$&&!fe){if(Ee===void 0){const We=Te,Be=ae?.get(We);Be!==void 0?Te=Be:((_-this.headerRows)%2===0&&this.options.alternatingRowStyle&&(Te=this.book.styles.compose(Te,this.options.alternatingRowStyle)),ie!==void 0&&(Te=this.book.styles.compose(Te,ie)),ae?.set(We,Te))}const Pe=ce&&this.options.cellStyle?.({...ce,value:j,column:ee.column,columnIndex:H});Pe!==void 0&&(Te=this.book.styles.compose(Te,Pe))}fe&&this.options.footer?.style&&Ee===void 0&&(Te=this.book.styles.compose(Te,this.options.footer.style)),de&&Ee===void 0&&(Te=this.book.styles.compose(Te,{...de.background===void 0?{}:{fill:{color:de.background}},...de.color===void 0&&de.bold===void 0&&de.italic===void 0?{}:{font:{...de.color===void 0?{}:{color:de.color},...de.bold===void 0?{}:{bold:de.bold},...de.italic===void 0?{}:{italic:de.italic}}},...de.wrapText===void 0?{}:{wrapText:de.wrapText},...de.alignment===void 0?{}:{alignment:de.alignment},...de.numberFormat===void 0?{}:{numberFormat:de.numberFormat}}));const Ze=typeof j=="string"?j.length:0;let De=this.preserved||$||fe?Ze:void 0;if(xe==="string"&&Ze>32767&&N(j,this.book.settings.invalidCharacterPolicy).length>32767){const Pe=ee.letter+_;if(ge||this.linkedCells.has(Pe))throw new TypeError("A text-preservation cell cannot also have an external hyperlink.");oe(this.links.length+this.internalLinks.length+1),this.book.checkLinks(1),De!==void 0&&(this.book.budget.release(1,De),De=void 0);const We=this.book.preserveText(this.name,Pe,j);this.book.retainLink(),this.internalLinks.push({cell:Pe,location:We.location}),this.linkedCells.add(Pe),j=We.preview}if(ge&&this.appendHyperlink({cell:ee.letter+_,...ge}),xe==="date"&&(j=e(j,this.book.settings.dateMode)),!$&&!fe&&pe&&(!te||!L(te))&&this.layout.accept(H,j),!$&&!fe&&this.chartSources.length)for(const Pe of this.chartSources)Pe.observe(_-this.headerRows-1,H+1,j);const Ie='<c r="'+ee.letter+_+'" s="'+Te+'"';if(te&&this.book.retainFormula(te.formula.length),this.book.budget.cell(te?te.formula:j,De),te)return Ie+(j===null?' t="str"':"")+">"+z(te)+"</c>";if(Y)return Ie+(j===null?' t="str"':"")+"><f>"+Y.formula.replace(/"/g,""")+"</f><v>"+(j??"")+"</v></c>";if(j==null||xe==="number"&&!Number.isFinite(j)||j==null)return Ie+"/>";if(xe==="string")return Ie+' t="inlineStr"><is>'+n(j,this.book.settings.invalidCharacterPolicy)+"</is></c>";if(xe==="boolean")return Ie+' t="b"><v>'+(j?1:0)+"</v></c>";if(xe!=="number"&&xe!=="date")throw new TypeError("Excel cells must be strings, numbers, booleans, Dates or null.");return Ie+"><v>"+j+"</v></c>"}*rowXml(j,H,_,$=!1,ie=!1){const ce=ie?this.options.title?.height??28:_?this.options.headerHeight:this.options.rowHeight,ae=!_&&!$&&(this.options.rowStyle||this.options.cellStyle||this.options.rowOutline)?Object.freeze({rowIndex:H-this.headerRows-1,worksheetRow:H,sheetName:this.name,values:Object.freeze(this.columns.map((ee,Y)=>j[Y]instanceof V?j[Y].cachedValue:j[Y]instanceof c||j[Y]instanceof E?j[Y].value:j[Y]))}):void 0,fe=ae&&this.options.rowStyle?.(ae);fe!==void 0&&u(fe);const we=this.outline(ae),pe=!_&&(fe||this.options.alternatingRowStyle)?new Map:void 0;yield'<row r="'+H+'"'+(ce===void 0?"":' ht="'+ce+'" customHeight="1"')+(we?.level?' outlineLevel="'+we.level+'"':"")+(we?.hidden?' hidden="1"':"")+(we?.collapsed?' collapsed="1"':"")+">";for(let ee=0;ee<this.columns.length;ee++)yield this.cell(j[ee],ee,H,_,fe,ae,pe,$,ie,we?.hidden!==!0);yield"</row>"}outline(j){if(!j||!this.options.rowOutline)return;const H=this.options.rowOutline(j);if(H===void 0)return;if(H===null||typeof H!="object"||Array.isArray(H))throw new TypeError("Row outline callbacks must return metadata or undefined.");if(typeof H.then=="function")throw Promise.resolve(H).catch(()=>{}),new TypeError("Row outline callbacks must return synchronous metadata.");const{level:_,hidden:$,collapsed:ie}=H,ce=_??0;if(!Number.isInteger(ce)||ce<0||ce>this.options.maxOutlineLevel)throw new RangeError("Row outline level exceeds the declared maximum.");for(const ae of[$,ie])if(ae!==void 0&&typeof ae!="boolean")throw new TypeError("Row outline flags must be booleans.");return Object.freeze({level:ce,...$===void 0?{}:{hidden:$},...ie===void 0?{}:{collapsed:ie}})}writeRow(j,H,_,$=!1,ie=!1){const ce=this.rowXml(j,H,_,$,ie),ae=()=>{for(;;){const fe=ce.next();if(fe.done)return;if(this.buffer.append(fe.value))return this.buffer.flush().then(ae)}};return ae()}async sampleRow(j){if((this.pending.length+1)*this.columns.length>(this.book.settings.limits?.maxBufferedCells??1e5))throw new g("RESOURCE_LIMIT","Width sampling cell limit exceeded; reduce sampleRows or raise its bounded limit.");const H=[];let _=0;for(const $ of this.rowXml(j,this.count+this.headerRows+1,!1)){if(!this.started&&this.pendingCharacters+$.length>(this.book.settings.limits?.maxBufferedCharacters??1e6)){if(this.options.autoSize?.sampleRows!==void 0)throw new g("RESOURCE_LIMIT","Width sampling text limit exceeded; reduce sampleRows or raise its bounded limit.");this.layout.sample(j),await this.start();for(const ie of H)this.buffer.append(ie)&&await this.buffer.flush();H.length=0}this.started?this.buffer.append($)&&await this.buffer.flush():(this.pendingCharacters+=$.length,H.push($)),!this.started&&(++_&127)===0&&k()&&(await C(),S(this.book.settings.signal))}this.started||(this.layout.sample(j),this.pending.push(H))}reserveLayout(){if(!this.reservedLayout){if(!this.preserved){let j=0;if(this.options.title&&(j+=this.options.title.text.length),this.layout.firstHeaderRow)for(const H of this.layout.headings)for(const _ of H){const $=_ instanceof E||_ instanceof c?_.value:_;typeof $=="string"&&(j+=$.length)}if(this.layout.structuredFooter)for(const H of this.layout.structuredFooter.values)for(const _ of H){const $=_ instanceof E?_.value:_;typeof $=="string"&&(j+=$.length)}else if(this.options.footer)for(let H=0;H<this.columns.length;H++){const _=this.columns[H],$=this.options.footer.totals;if($&&Object.prototype.hasOwnProperty.call($,_.key??_.header))continue;const ie=this.options.footer.values?.[H],ce=ie instanceof E||ie instanceof c?ie.value:ie;typeof ce=="string"&&(j+=ce.length)}this.book.budget.reserve(this.columns.length*(this.headerRows+this.layout.footerRows),j)}this.reservedLayout=!0}}async start(){if(this.started)return;this.reserveLayout(),this.started=!0,this.entry=this.book.settings.sink?await this.book.openSheet(this):new a(this.book.settings.compression,{write:ee=>{this.book.retainBufferedBytes(ee.length),this.output.write(ee)}},this.book.settings.signal);const j=this.buffer=new b(this.entry,this.book.settings.signal),H=this.options,_=H.freezeColumns??0,$=H.freezeHeader?this.headerRows:0,ie=_&&$?"bottomRight":_?"topRight":"bottomLeft",ce=r(_+1)+($+1),ae=J(H.columnOutlines),fe=!!H.rowOutline||ae.size>0,we=Math.max(0,...Array.from(ae.values(),ee=>ee.level??0));await j.write(s+'<worksheet xmlns="'+l+'" xmlns:r="'+o+'">'+(H.print||fe?"<sheetPr>"+(fe?'<outlinePr summaryBelow="'+(H.outlineSummaryBelow===!1?"0":"1")+'"'+(H.outlineSummaryRight===void 0?"":' summaryRight="'+(H.outlineSummaryRight?"1":"0")+'"')+' showOutlineSymbols="1"/>':"")+(H.print?'<pageSetUpPr fitToPage="1"/>':"")+"</sheetPr>":"")+'<sheetViews><sheetView workbookViewId="0">'+(_||$?"<pane"+(_?' xSplit="'+_+'"':"")+($?' ySplit="'+$+'"':"")+' topLeftCell="'+ce+'" activePane="'+ie+'" state="frozen"/><selection pane="'+ie+'" activeCell="'+ce+'" sqref="'+ce+'"/>':"")+"</sheetView></sheetViews>"+(fe?'<sheetFormatPr defaultRowHeight="15"'+(H.rowOutline?' outlineLevelRow="'+H.maxOutlineLevel+'"':"")+(ae.size?' outlineLevelCol="'+we+'"':"")+"/>":""));const pe=H.defaultColumnWidth??(this.table?20:void 0);if(this.columns.some((ee,Y)=>this.layout.widths[Y]!==void 0||pe!==void 0||ae.has(Y))){await j.write("<cols>");for(let ee=0;ee<this.columns.length;ee++){const Y=this.layout.widths[ee]??pe,te=ae.get(ee);(Y!==void 0||te)&&await j.write('<col min="'+(ee+1)+'" max="'+(ee+1)+'"'+(Y===void 0?"":' width="'+Y+'" customWidth="1"')+(te?.level?' outlineLevel="'+te.level+'"':"")+(te?.hidden?' hidden="1"':"")+(te?.collapsed?' collapsed="1"':"")+"/>")}await j.write("</cols>")}if(await j.write("<sheetData>"),H.title&&await this.writeRow(this.columns.map((ee,Y)=>Y?"":H.title.text),1,!0,!1,!0),this.layout.firstHeaderRow)for(let ee=0;ee<this.layout.headings.length;ee++)await this.writeRow(this.layout.headings[ee],ee+this.layout.firstHeaderRow,!0);for(const ee of this.pending)for(const Y of ee)j.append(Y)&&await j.flush();this.pending=[],this.pendingCharacters=0}async addRows(j){if(this.book.assertOpen(),this.completion)throw new g("INVALID_STATE","Worksheet is closed.");if(this.busy)throw new g("INVALID_STATE","Await the current addRows call before writing more rows to this sheet.");if(this.failed)throw this.error;this.busy=!0;try{this.reserveLayout(),this.layout.sampleRows||await this.start();let H=performance.now();const _=()=>{performance.now()-H>=50&&(this.progress(),H=performance.now())},$=()=>{if(this.count++,!this.started&&this.pending.length>=this.layout.sampleRows)return this.start().then(_);if(!this.started&&k())return C().then(()=>{S(this.book.settings.signal),_()});_()};await R(j,this.book.settings.signal,ie=>{if(this.count+this.headerRows+this.layout.footerRows>=1048576)throw new RangeError("Excel supports at most 1,048,576 rows including headers and footers; split the sheet.");if(this.book.budget.row(this.count+1),!this.columns.length)throw new RangeError("Declare columns before adding rows.");const ce=this.project(ie,this.count),ae=this.started?this.writeRow(ce,this.count+this.headerRows+1,!1):this.sampleRow(ce);return ae?ae.then($):$()}),this.buffer&&await this.buffer.flush(),this.progress(),S(this.book.settings.signal)}catch(H){throw this.failed=!0,this.error=H,await this.book.discard(H),H}finally{this.busy=!1}}progress(){!this.preserved&&!this.chartData&&x(this.book.settings.onProgress,{phase:"rows",rows:this.book.rowCount,sheetRows:this.reportRowCount,sheetName:this.name})}get rowCount(){return this.count}dataRange(j){if(this.failed)throw this.error;if(!this.completed)throw new g("INVALID_STATE","Close the worksheet before resolving its data range.");const H=Z(this.columns,j),_=se(this);if(_!==void 0){if(_.length>1)throw new g("INVALID_STATE","Grouped details are discontiguous; use the grouped result's detailRanges for explicit formula references.");const $=_[0];return $?X(this.name,H,$.firstRow,$.lastRow-$.firstRow+1):void 0}return this.count?X(this.name,H,this.headerRows+1,this.count):void 0}get chartBindingMetadata(){const j=this.layout.headings.at(-1);return{name:this.name,columns:this.columns,headerRows:this.headerRows,rows:this.count,closed:this.completed||!!this.completion,headerReferences:this.columns.map((H,_)=>{const $=j?.[_],ie=$ instanceof E?$.value:$;return this.layout.firstHeaderRow&&ie===H.header&&!this.layout.regions.covered(_+1,this.headerRows)?K(this.name,_+1,this.headerRows):void 0})}}retainChartBinding(j){this.chartSources.push(j)}get reportRowCount(){return this.preserved||this.chartData?0:D(this,this.headerRows,this.count)}get hidden(){return this.chartData}addChart(j){if(this.book.assertOpen(),this.completion)throw new g("INVALID_STATE","Worksheet is closed.");if(this.failed)throw this.error;this.nativeCharts.push(this.book.registerChart(j))}get charts(){return this.nativeCharts}releaseCharts(){this.nativeCharts.length=0}addImage(j){if(this.book.assertOpen(),this.completion)throw new g("INVALID_STATE","Worksheet is closed.");if(this.failed)throw this.error;const H=y(j,this.book.settings.invalidCharacterPolicy,_=>this.book.checkImage(_));this.book.retainImage(H.data.length),this.pictures.push(H)}addHyperlink(j){if(this.book.assertOpen(),this.completion)throw new g("INVALID_STATE","Worksheet is closed.");if(this.failed)throw this.error;this.appendHyperlink(j)}appendHyperlink(j){const H=w(j,this.book.settings.invalidCharacterPolicy),_=O(H.cell);if(this.layout.regions.covered(_.column,_.row))throw new TypeError("Hyperlinks cannot address a covered merged cell.");if(this.linkedCells.has(H.cell))throw new TypeError("Duplicate hyperlink cell: "+H.cell);oe(this.links.length+this.internalLinks.length+1),this.book.retainLink(),this.links.push(H),this.linkedCells.add(H.cell)}get hyperlinks(){return this.links}get images(){return this.pictures}get tableDefinition(){return this.count?this.table:void 0}get isBusy(){return this.busy}get headerRowCount(){return this.headerRows}get firstHeaderRow(){return this.layout.firstHeaderRow}get mergeCount(){return this.layout.mergeCount}get conditionalFormatCount(){return this.conditional.count}get dataValidations(){return this.validations}get totalRows(){return Math.max(1,this.headerRows+this.count+this.layout.footerRows)}get lastColumn(){return r(Math.max(1,this.columns.length))}get printSettings(){return this.options.print}get footerSettings(){return this.layout.structuredFooter?void 0:this.options.footer}async close(){if(this.book.assertOpen(),this.busy)throw new g("INVALID_STATE","Await addRows before closing the worksheet.");try{await this.finish()}catch(j){throw await this.book.discard(j),j}}finish(j){if(this.completion)return this.completion;if(this.failed)throw this.error;return this.completion=(async()=>{try{const H=this.completedRegions=this.layout.finalRegions(this.count,this.book.settings.limits?.maxMergedRanges??1e4);H.validateRows(this.totalRows);for(const ie of this.chartSources)ie.finish();this.chartSources.length=0;for(const ie of this.links){const ce=O(ie.cell);if(ce.column>this.columns.length||ce.row>this.totalRows)throw new RangeError("Hyperlinks must address cells within the exported rows and columns.");if(H.covered(ce.column,ce.row))throw new TypeError("Hyperlinks cannot address a covered merged cell.")}if(await this.start(),j)for await(const ie of v(j,this.book.settings.signal))this.book.budget.row(this.count+1),await this.writeRow(this.project(ie,this.count),this.headerRows+this.count+1,!1),this.count++;if(this.layout.structuredFooter)for(let ie=0;ie<this.layout.footerRows;ie++)await this.writeRow(this.layout.structuredFooter.values[ie],this.headerRows+this.count+ie+1,!1,!0);else this.options.footer&&await this.writeRow(this.layout.footer(this.count),this.headerRows+this.count+1,!1,!0);await this.buffer.write("</sheetData>"),this.options.autoFilter&&this.headerRows&&!this.tableDefinition&&await this.buffer.write('<autoFilter ref="A'+this.headerRows+":"+r(this.columns.length)+(this.count+this.headerRows)+'"/>'),H.references.length&&await this.buffer.write('<mergeCells count="'+H.references.length+'">'+H.references.map(ie=>'<mergeCell ref="'+ie+'"/>').join("")+"</mergeCells>");const _=se(this);for(const ie of this.conditional.xml(this.headerRows,this.count,this.totalRows,_))await this.buffer.write(ie);for(const ie of W(this.validations,this.headerRows,this.count,_))await this.buffer.write(ie);(this.links.length||this.internalLinks.length)&&await this.buffer.write(T(this.links,this.book.settings.invalidCharacterPolicy,this.internalLinks)),await this.buffer.write(F(this.options.print,this.book.settings.invalidCharacterPolicy)),(this.pictures.length||this.nativeCharts.length)&&await this.buffer.write('<drawing r:id="drawing"/>'),this.tableDefinition&&await this.buffer.write('<tableParts count="1"><tablePart r:id="table"/></tableParts>'),await this.buffer.write("</worksheet>"),await this.buffer.close();const $=await this.entry.close();!this.book.settings.sink&&!this.failed&&(this.prepared={...$,chunks:this.output.takeChunks()}),this.completed=!0}catch(H){throw await this.discard(H),H}})()}takePrepared(){const j=this.prepared;return this.prepared=void 0,j}async discard(j){this.failed=!0,this.error=j,this.pending=[],this.pendingCharacters=0,this.prepared=void 0,this.buffer=void 0,this.nativeCharts.length=0,this.chartSources.length=0,this.output.discard(),await this.entry?.discard(j)}}const he=Object.freeze({Worksheet:ne});return B.set("151a5a04c5f57081eb7df9705d62fc75f098c719c8fc832c59ef3ab0c4305b6a",he),he})(),qt=B.get("c84eae41cd3066f5463d88a1f467117b37dd9e9c9ccd8c0f8a106aa41631fea0")??(()=>{const{escapeOoxmlAttribute:S,escapeXml:R,xmlDeclaration:v}=Re,{cellText:C,columnName:k}=Fe,{spreadsheetNamespace:b}=Ge,{ExportCell:p}=Se,{Cell:g}=Fe,{totalFormula:x}=Ft;function m(s,o,c,i){const r=o.name??"Table"+s;if(typeof r!="string"||r.length>255||!/^[A-Za-z_][A-Za-z0-9_.]*$/.test(r)||/^(?:[A-Za-z]{1,3}[1-9][0-9]*|R[1-9][0-9]*C[1-9][0-9]*|R|C)$/i.test(r))throw new TypeError("Table names must be ASCII identifiers, at most 255 characters, and cannot be cell references.");const n=o.style??"TableStyleMedium2",e=/^TableStyle(Light|Medium|Dark)([1-9][0-9]?)$/.exec(n);if(!e||Number(e[2])>({Light:21,Medium:28,Dark:11}[e[1]]??0))throw new TypeError("Unknown built-in Excel table style.");const t=c.map(l=>C(l.header,i));if(!t.length||t.some(l=>!l.trim()||l.length>255)||new Set(t.map(l=>l.toLowerCase())).size!==t.length)throw new TypeError("Excel tables require nonblank, unique headers of at most 255 characters.");return Object.freeze({id:s,name:r,headers:Object.freeze(t),keys:Object.freeze(c.map(l=>l.key??l.header)),options:Object.freeze({...o,style:n})})}function f(s,o,c,i=1,r){const n="A"+i+":"+k(s.headers.length)+(o+i),e="A"+i+":"+k(s.headers.length)+(o+i+(r?1:0)),t=s.options,l=S(s.name,c);return v+'<table xmlns="'+b+'" id="'+s.id+'" name="'+l+'" displayName="'+l+'" ref="'+e+'"'+(r?' totalsRowCount="1"':' totalsRowShown="0"')+'><autoFilter ref="'+n+'"/><tableColumns count="'+s.headers.length+'">'+s.headers.map((d,u)=>{const h=s.keys[u],w=r?.totals&&Object.prototype.hasOwnProperty.call(r.totals,h)?r.totals[h]:void 0,y=r?.values?.[u],T=y instanceof g||y instanceof p?y.value:y,O=w&&["average","min","max"].includes(w),E=w?' totalsRowFunction="'+(O?"custom":w==="count"?"countNums":w)+'"':typeof T=="string"?' totalsRowLabel="'+S(T,c)+'"':"";return'<tableColumn id="'+(u+1)+'" name="'+S(d,c)+'"'+E+(O?"><totalsRowFormula>"+R(x(w,k(u+1),i,o),c)+"</totalsRowFormula></tableColumn>":"/>")}).join("")+'</tableColumns><tableStyleInfo name="'+t.style+'" showFirstColumn="'+(t.firstColumn?1:0)+'" showLastColumn="'+(t.lastColumn?1:0)+'" showRowStripes="'+(t.bandedRows!==!1?1:0)+'" showColumnStripes="'+(t.bandedColumns?1:0)+'"/></table>'}const a=Object.freeze({defineTable:m,tableXml:f});return B.set("c84eae41cd3066f5463d88a1f467117b37dd9e9c9ccd8c0f8a106aa41631fea0",a),a})(),Zt=B.get("0c395783b9d7cc62dd39a21adeb698ad4a61e2c89f7b1fc8712e2eb2ccfe9d92")??(()=>{const{OfficeIMOError:S}=ue,{cleanXml:R}=Re;class v{sheetName;maximum;policy;reserve;entries=[];characters=0;rows=0;constructor(g,x,m,f){this.sheetName=g,this.maximum=x,this.policy=m,this.reserve=f}add(g,x,m){const f=R(m,this.policy);if(this.characters+f.length>this.maximum)throw new S("RESOURCE_LIMIT","maxOverflowCharacters exceeded; use CSV or raise the bounded preservation limit.");let a=0;for(const c of k(f))a++;if(this.rows+a>1048575)throw new S("RESOURCE_LIMIT","Text overflow exceeds the worksheet row limit.");this.reserve(a*5,f.length+a*(g.length+x.length),this.rows+a);const s=this.rows+2;this.entries.push({sheet:g,cell:x,text:f,first:s,parts:a}),this.rows+=a,this.characters+=f.length;const o="\n[Full text: "+this.sheetName+"!D"+s+"; "+a+" parts]";return{preview:C(f,32767-o.length)+o,location:"'"+this.sheetName.replace(/'/g,"''")+"'!D"+s}}*values(){for(const g of this.entries){let x=0;for(const m of k(g.text))yield[g.sheet,g.cell,++x,m,g.parts]}}clear(){this.entries=[],this.characters=0,this.rows=0}}function C(p,g){let x=Math.min(g,p.length);return x<p.length&&/[\ud800-\udbff]/.test(p[x-1]??"")&&x--,p.slice(0,x)}function*k(p){let g=0;for(;g<p.length;){const x=C(p.slice(g,g+32768),32767);g+=x.length,yield x}}const b=Object.freeze({TextOverflow:v,clipText:C});return B.set("0c395783b9d7cc62dd39a21adeb698ad4a61e2c89f7b1fc8712e2eb2ccfe9d92",b),b})(),tt=B.get("8f13b484030aa6b921e616d803614fd061f718241692003633375fab4c36045e")??(()=>{const{captureFields:S}=ke,R=["signal","onProgress","limits","sink","dateMode","compression","invalidCharacterPolicy","appProperties","cellValueWriters","oversizedText","creator","title","subject","description","created","modified"],v=["columns","includeHeader","headerRows","freezeHeader","autoFilter","boldHeader","headerFill","headerBorder","headerWrap","headerStyle","alternatingRowStyle","rowStyle","cellStyle","rowOutline","maxOutlineLevel","outlineSummaryBelow","outlineSummaryRight","columnOutlines","rowHeight","headerHeight","defaultColumnWidth","freezeColumns","table","autoSize","footer","print","title","mergedCells","hyperlinks","conditionalFormats","dataValidation"],C=["maxRows","maxCells","maxTextCharacters","maxOutputBytes","maxStyles","maxSheets","maxOverflowCharacters","maxHyperlinks","maxImageBytes","maxBufferedCells","maxBufferedCharacters","maxMergedRanges","maxConditionalFormats","maxDifferentialStyles","maxCharts","maxChartPoints","maxChartTextCharacters","maxFormulaCharacters","maxDataValidations","maxValidationTextCharacters"];function k(g){return S(g,C)}function b(g){const x=S(g,R);return{...x,...x.limits===void 0?{}:{limits:k(x.limits)}}}const p=Object.freeze({workbookOptionFields:R,sheetOptionFields:v,workbookLimitFields:C,captureWorkbookLimits:k,captureWorkbookOptions:b});return B.set("8f13b484030aa6b921e616d803614fd061f718241692003633375fab4c36045e",p),p})(),$t=B.get("35db01801a6b2e3e0c5acd7493e56f04b5b41b1d57afa8be28b8358378ad6494")??(()=>{const{checkAbort:S}=be,{NotSupportedError:R,OfficeIMOError:v}=ue,{cleanXml:C}=Re,{captureFields:k}=ke;function b(f,a,s){if(!f||typeof f!="object"||Array.isArray(f))throw new TypeError(s+" must be an object.");for(const o of Object.keys(f))if(!a.includes(o))throw new R(s+"."+o);return k(f,a)}function p(f){if(typeof f=="string"?!f.length:typeof f!="number"||!Number.isInteger(f)||f<1||f>16384)throw new TypeError("Chart columns require a declared key or a one-based column number.")}function g(f){const a=b(f,["kind","sheet","firstRow","rowCount","categoryColumn","series"],"chart.data");if(a.kind!=="range")throw new TypeError("A chart range must declare kind: range.");if(!a.sheet||typeof a.sheet!="object"||Array.isArray(a.sheet))throw new TypeError("A chart range needs its owning worksheet.");const s=a.firstRow===void 0?0:a.firstRow,o=a.rowCount;if(!Number.isSafeInteger(s)||s<0||!Number.isSafeInteger(o)||o<1||s+o>1048576)throw new RangeError("Chart data rows must form a nonempty finite Excel range.");if(p(a.categoryColumn),!Array.isArray(a.series)||a.series.length<1||a.series.length>255)throw new RangeError("A chart needs from 1 through 255 series.");const c=a.series.map(i=>{const r=b(i,["column","name","color"],"chart.data.series");if(p(r.column),r.name!==void 0&&typeof r.name!="string")throw new TypeError("Chart series name must be a string.");if(r.color!==void 0&&(typeof r.color!="string"||!/^#?[0-9a-fA-F]{6}$/.test(r.color)))throw new TypeError("Chart colors must be opaque six-digit RGB hex values.");return Object.freeze(r)});return Object.freeze({kind:"range",sheet:a.sheet,firstRow:s,rowCount:o,categoryColumn:a.categoryColumn,series:Object.freeze(c)})}function x(f,a,s,o,c="columnClustered"){S(o);const i=f.rowCount,r=f.firstRow??0,n=i*f.series.length,e=a.categoryColumn;if(n>s.availablePoints)throw new v("RESOURCE_LIMIT","maxChartPoints exceeded.");if(a.source!==f.sheet||!Number.isInteger(a.headerRows)||a.headerRows<0||a.headerRows+r+i>1048576||a.seriesColumns.length!==f.series.length||a.seriesNames.length!==f.series.length||a.valueFormulas.length!==f.series.length||a.nameFormulas.length!==f.series.length)throw new TypeError("Resolved chart range does not match its declared columns and data rows.");for(const A of[a.categoryColumn,...a.seriesColumns])if(!Number.isInteger(A)||A<1||A>16384)throw new RangeError("Resolved chart columns must be one-based Excel columns.");if(a.seriesColumns.includes(e))throw new TypeError("Chart category and numeric series must use different columns.");let t=0;const l=f.series.map((A,F)=>{const N=A.name??a.seriesNames[F];if(typeof N!="string"||N.length>32767)throw new TypeError("Chart series names must fit Excel text cells.");if(t+=N.length,t>s.availableText)throw new v("RESOURCE_LIMIT","maxChartTextCharacters exceeded.");return C(N,s.policy)}),d=f.series.map(A=>A.color?.replace(/^#/,"").toUpperCase()),u=new Array(i),h=f.series.map(()=>new Array(i)),w=f.series.map(()=>0),y=f.series.map(()=>!1);let T=0,O;const E=()=>{if(S(o),!O){if(T!==i||w.some(A=>A!==i))throw new TypeError("Chart range did not receive every declared data row and numeric value.");if(c==="pie"&&!y[0])throw new RangeError("A pie chart needs at least one positive value.");O=Object.freeze({categories:Object.freeze(u),series:Object.freeze(h.map((A,F)=>Object.freeze({name:l[F],values:Object.freeze(A),...d[F]===void 0?{}:{color:d[F]}})))})}},P=Object.freeze({get categories(){return E(),O.categories},get series(){return E(),O.series}}),I=new Map;return a.seriesColumns.forEach((A,F)=>{const N=I.get(A)??[];N.push(F),I.set(A,N)}),Object.freeze({source:a.source,points:n,textCharacters:t,data:P,references:Object.freeze({categories:a.categoryFormula,values:Object.freeze([...a.valueFormulas]),names:Object.freeze(a.nameFormulas.map((A,F)=>f.series[F].name===void 0?A:void 0))}),observe(A,F,N){S(o);const U=A-r;if(!(U<0||U>=i)){if(O)throw new v("INVALID_STATE","Chart cache is already finalized.");if(F===e){if(typeof N!="string"||N.length>32767)throw new TypeError("Chart category cells must contain strings of at most 32,767 UTF-16 units.");if(u[U]!==void 0)throw new v("INVALID_STATE","A chart category cell was observed more than once.");s.retainText(N.length),u[U]=C(N,s.policy),T++}for(const M of I.get(F)??[]){if(typeof N!="number"||!Number.isFinite(N))throw new TypeError("Chart series cells require finite numbers or numeric formula caches.");if(c==="pie"&&N<0)throw new RangeError("Pie charts require nonnegative values.");if(h[M][U]!==void 0)throw new v("INVALID_STATE","A chart value cell was observed more than once.");h[M][U]=N,w[M]=w[M]+1,N>0&&(y[M]=!0)}}},finish:E})}const m=Object.freeze({captureChartRange:g,prepareChartBinding:x});return B.set("35db01801a6b2e3e0c5acd7493e56f04b5b41b1d57afa8be28b8358378ad6494",m),m})(),Kt=B.get("24f1417c3c320a8a41137c28f70b72091256c63010be0c88b684dce85f54950c")??(()=>{const{checkAbort:S}=be,{NotSupportedError:R,OfficeIMOError:v}=ue,{cleanXml:C}=Re,{copyDrawingAnchor:k}=Qe,{captureFields:b}=ke,{captureChartRange:p,prepareChartBinding:g}=$t;function x(s,o,c){if(!s||typeof s!="object"||Array.isArray(s))throw new TypeError(c+" must be an object.");for(const i of Object.keys(s))if(!o.includes(i))throw new R(c+"."+i)}function m(s,o,c){return x(s,o,c),b(s,o)}function f(s,o,c,i,r,n){if(S(r),s=m(s,["type","data","row","column","width","height","description","title","language","legend","dataLabels","categoryAxis","valueAxis"],"chart"),!["columnClustered","barClustered","line","pie"].includes(s.type))throw new R("chart type "+s.type);const e=s.type,t=m(s.data,["kind","sheet","firstRow","rowCount","categoryColumn","categories","series"],"chart.data"),l=t.kind==="range"?p(t):void 0;l||x(t,["categories","series"],"chart.data");const d=l?void 0:t.categories,u=l?.series??t.series;if(!l&&!Array.isArray(d))throw new TypeError("Chart categories must be a nonempty array of strings.");if(!Array.isArray(u))throw new RangeError("A chart needs from 1 through 255 series.");const h=l?.rowCount??d.length,w=u.length;if(!h)throw new TypeError("Chart categories must be a nonempty array of strings.");if(!w||w>255)throw new RangeError("A chart needs from 1 through 255 series.");if(!l&&h>1048575)throw new RangeError("Chart data must fit Excel's rows including its header.");if(e==="pie"&&w!==1)throw new TypeError("A pie chart supports exactly one series.");const y=h*w;if(y>c)throw new v("RESOURCE_LIMIT","maxChartPoints exceeded.");let T=0;const O=(W,K)=>{if(typeof W!="string")throw new TypeError(K+" must be a string.");if(W.length>32767)throw new RangeError(K+" exceeds 32,767 UTF-16 units.");if(T+=W.length,T>i)throw new v("RESOURCE_LIMIT","maxChartTextCharacters exceeded.");return C(W,o)},E=(W,K)=>W===void 0?void 0:O(W,K),P=E(s.title,"Chart title"),I=E(s.description,"Chart description"),A=E(s.language,"Chart language");let F;if(A!==void 0)try{if(F=Intl.getCanonicalLocales(A)[0],!F)throw new RangeError}catch{throw new TypeError("Chart language must be a language tag such as pl or pl-PL.")}const N=k({row:s.row,column:s.column,width:s.width,height:s.height,...I===void 0?{}:{description:I}},o);if(s.legend!==void 0&&s.legend!==!1&&!["right","bottom","left","top"].includes(s.legend))throw new TypeError("Unsupported chart legend position.");let U;if(s.dataLabels!==void 0){const W=m(s.dataLabels,["showValue","showCategoryName","showSeriesName","showPercent","position","numberFormat"],"chart.dataLabels");for(const Z of["showValue","showCategoryName","showSeriesName","showPercent"])if(W[Z]!==void 0&&typeof W[Z]!="boolean")throw new TypeError("Chart label flags must be booleans.");if(W.showPercent&&e!=="pie")throw new TypeError("Percent data labels require a pie chart.");const K=e==="pie"?["center","insideEnd","outsideEnd","bestFit"]:e==="line"?["center","above","below","left","right"]:["center","insideEnd","outsideEnd"];if(W.position!==void 0&&!K.includes(W.position))throw new TypeError("Data label position is unsupported for this chart type.");const X=E(W.numberFormat,"Data label number format");if(X!==void 0&&!X.trim())throw new TypeError("Data label number format cannot be blank.");U=Object.freeze({...W,...X===void 0?{}:{numberFormat:X}})}if(e==="pie"&&(s.categoryAxis!==void 0||s.valueAxis!==void 0))throw new TypeError("Pie charts have no axes.");let M,Q;if(s.categoryAxis!==void 0){const W=E(m(s.categoryAxis,["title"],"chart.categoryAxis").title,"Category axis title");M=Object.freeze(W===void 0?{}:{title:W})}if(s.valueAxis!==void 0){const W=m(s.valueAxis,["title","minimum","maximum","numberFormat"],"chart.valueAxis");for(const Z of[W.minimum,W.maximum])if(Z!==void 0&&!Number.isFinite(Z))throw new TypeError("Chart axis bounds must be finite numbers.");if(W.minimum!==void 0&&W.maximum!==void 0&&W.minimum>=W.maximum)throw new RangeError("Chart axis minimum must be below its maximum.");const K=E(W.title,"Value axis title"),X=E(W.numberFormat,"Value axis number format");if(X!==void 0&&!X.trim())throw new TypeError("Value axis number format cannot be blank.");Q=Object.freeze({...W,...K===void 0?{}:{title:K},...X===void 0?{}:{numberFormat:X}})}const V={...N,type:e,...F===void 0?{}:{language:F},...P===void 0?{}:{title:P},...I===void 0?{}:{description:I},...s.legend===void 0?{}:{legend:s.legend},...U===void 0?{}:{dataLabels:U},...M===void 0?{}:{categoryAxis:M},...Q===void 0?{}:{valueAxis:Q}};if(l){if(!n)throw new TypeError("A chart range must belong to the current workbook.");const{descriptor:W,retainText:K}=n(l),X=g(l,W,{availablePoints:c,availableText:i-T,retainText:K,policy:o},r,e);return Object.freeze({...V,data:X.data,binding:X,points:y,textCharacters:T+X.textCharacters})}const z=d,L=[],G=[];for(let W=0;W<h;W++)(W&255)===0&&S(r),L.push(O(z[W],"Chart category"));for(let W=0;W<w;W++){const K=u[W],X=m(K,["name","values","color"],"chart.series"),Z=O(X.name,"Chart series name"),se=X.values,D=X.color;if(!Array.isArray(se)||se.length!==h)throw new TypeError("Chart series values must match the category count.");if(D!==void 0&&(typeof D!="string"||!/^#?[0-9a-fA-F]{6}$/.test(D)))throw new TypeError("Chart colors must be opaque six-digit RGB hex values.");let q=!1;const J=[];for(let re=0;re<h;re++){(re&255)===0&&S(r);const le=se[re];if(typeof le!="number"||!Number.isFinite(le))throw new TypeError("Chart values must be finite numbers.");if(e==="pie"&&le<0)throw new RangeError("Pie charts require nonnegative values.");le>0&&(q=!0),J.push(le)}if(e==="pie"&&!q)throw new RangeError("A pie chart needs at least one positive value.");G.push(Object.freeze({name:Z,values:Object.freeze(J),...D===void 0?{}:{color:D.replace(/^#/,"").toUpperCase()}}))}return Object.freeze({...V,data:Object.freeze({categories:Object.freeze(L),series:Object.freeze(G)}),points:y,textCharacters:T})}const a=Object.freeze({prepareChart:f});return B.set("24f1417c3c320a8a41137c28f70b72091256c63010be0c88b684dce85f54950c",a),a})(),xt=B.get("fe4b78533e92385c8af50681c6a1273e1f9ec6f4f9ae8342684c06e904cfb8e0")??(()=>{const{beginTask:S,checkAbort:R,pause:v,taskYieldDue:C}=be,{OfficeIMOError:k}=ue,{notifyProgress:b}=Ke,{ChunkedTextSink:p}=Oe,{ExportBudget:g}=ot,{OpcPackage:x,officeRelationshipsNamespace:m,relationshipTypes:f,corePropertiesXml:a}=$e,{escapeOoxmlAttribute:s,cleanXml:o,xmlDeclaration:c}=Re,{StyleRegistry:i,spreadsheetNamespace:r,normalizeBorder:n}=Ge,{sheetName:e,assertXlsxValue:t,copyValue:l}=Fe,{copyColumns:d}=Ue,{captureFields:u}=ke,{captureColumnOutlines:h}=It,{captureTableSpans:w}=Ye,{assertExportValue:y}=Se,{Worksheet:T}=At,{defineTable:O,tableXml:E}=qt,{copyHyperlink:P,drawingXml:I,drawingContentType:A}=Qe,{TextOverflow:F}=Zt,{captureWorkbookOptions:N,sheetOptionFields:U}=tt,{prepareChart:M}=Kt,{qualifiedColumnRange:Q,resolveDataColumn:V}=et,{chartContentType:z,writeChartXml:L}=jt,G="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",W=se=>"application/vnd.openxmlformats-officedocument.spreadsheetml."+se+"+xml";function K(se,D){const q=u(se,U),J=d(q.columns??[],!0),re=q.footer&&u(q.footer,["rows","values","totals","style"]),le=q.print&&u(q.print,["paper","orientation","fitToWidth","fitToHeight","repeatHeaders","margins","header","footer"]);return{...q,columns:J,...q.columnOutlines===void 0?{}:{columnOutlines:h(q.columnOutlines,J.length)},...q.headerRows===void 0?{}:{headerRows:w(q.headerRows,J.length)},...q.headerBorder===void 0?{}:{headerBorder:n(q.headerBorder)},...re?{footer:{...re,...re.rows===void 0?{}:{rows:w(re.rows,J.length)},...re.values===void 0?{}:{values:re.values.map(l)}}}:{},...q.table?{table:u(q.table,["name","style","bandedRows","bandedColumns","firstColumn","lastColumn"])}:{},...q.autoSize?{autoSize:u(q.autoSize,["sampleRows","minWidth","maxWidth"])}:{},...q.title?{title:u(q.title,["text","style","height"])}:{},...le?{print:{...le,...le.margins===void 0?{}:{margins:u(le.margins,["left","right","top","bottom","header","footer"])}}}:{},...q.hyperlinks?{hyperlinks:q.hyperlinks.map(oe=>P(oe,D))}:{}}}class X{portableValues=!1;static forTable(D){const q=new X(D);return q.portableValues=!0,q}get valueValidator(){return this.portableValues?y:t}styles;names=new Set;sheets=[];tableNames=new Set;tableCount=0;writers;package;state="open";result;completion;activeSheet;failure;overflow;links=0;imageBytes=0;bufferedBytes=0;mergedRanges=0;conditionalFormats=0;dataValidationCount=0;validationTextCharacters=0;formulaCharacters=0;hasAuthoredFormulas=!1;nativeCharts=[];chartSourceSheets=0;chartPoints=0;chartTextCharacters=0;registering=!1;registration(D){if(this.assertOpen(),this.registering)throw new k("INVALID_STATE","Workbook registrations cannot be reentered from input getters.");this.registering=!0;try{return D()}finally{this.registering=!1}}budget;settings;constructor(D={}){D=N(D);const q=D.dateMode??"local",J=D.compression??"auto",re=D.invalidCharacterPolicy??"strip";if(q!=="local"&&q!=="utc")throw new RangeError("dateMode must be local or utc.");if(J!=="auto"&&J!=="store")throw new RangeError("compression must be auto or store.");if(D.oversizedText!==void 0&&!["reject","preserve"].includes(D.oversizedText))throw new RangeError("oversizedText must be reject or preserve.");if(o("",re),a(D,re),this.budget=new g(D.limits),this.styles=new i(re,D.limits?.maxStyles,D.limits?.maxDifferentialStyles),D.sink!==void 0&&typeof D.sink.write!="function")throw new TypeError("sink must be a ByteSink.");this.settings=Object.freeze({...D,...D.limits?{limits:Object.freeze({...D.limits})}:{},dateMode:q,compression:J,invalidCharacterPolicy:re}),this.writers=Object.freeze({...D.cellValueWriters});for(const le of Object.values(this.writers))if(typeof le!="function")throw new TypeError("Cell value writers must be functions.");S(),this.package=new x({compression:J,invalidCharacterPolicy:re,...D.signal?{signal:D.signal}:{},...D.sink?{sink:D.sink}:{},...D.limits?.maxOutputBytes===void 0?{}:{maxOutputBytes:D.limits.maxOutputBytes}}),this.package.setProperties(D,D.appProperties),this.addXmlPart("/xl/workbook.xml",W("sheet.main"),()=>this.workbookXml()),this.addXmlPart("/xl/styles.xml",W("styles"),()=>this.styles.toXml())}addXmlPart(D,q,J){this.package.addPart({uri:D,contentType:q,data:async re=>{const le=new p(re,this.settings.signal);await le.write(J()),await le.close()}})}workbookXml(){return c+'<workbook xmlns="'+r+'" xmlns:r="'+m+'"><workbookPr date1904="0"/><bookViews><workbookView/></bookViews><sheets>'+this.sheets.map((D,q)=>'<sheet name="'+s(D.name,this.settings.invalidCharacterPolicy)+'" sheetId="'+(q+1)+'"'+(D.hidden?' state="hidden"':"")+' r:id="rId'+(q+1)+'"/>').join("")+"</sheets>"+(this.sheets.some(D=>D.printSettings)?"<definedNames>"+this.sheets.map((D,q)=>{const J="'"+D.name.replace(/'/g,"''")+"'!";return D.printSettings?'<definedName name="_xlnm.Print_Area" localSheetId="'+q+'">'+s(J+"$A$1:$"+D.lastColumn+"$"+D.totalRows,this.settings.invalidCharacterPolicy)+"</definedName>"+(D.printSettings.repeatHeaders&&D.firstHeaderRow?'<definedName name="_xlnm.Print_Titles" localSheetId="'+q+'">'+s(J+"$"+D.firstHeaderRow+":$"+D.headerRowCount,this.settings.invalidCharacterPolicy)+"</definedName>":""):""}).join("")+"</definedNames>":"")+(this.hasAuthoredFormulas?'<calcPr calcMode="auto" fullCalcOnLoad="1" forceFullCalc="1"/>':"")+"</workbook>"}assertOpen(){try{R(this.settings.signal)}catch(D){throw this.discard(D).catch(()=>{}),D}if(this.state==="failed")throw this.failure;if(this.state!=="open")throw new k("INVALID_STATE","Workbook is already finalized.")}writerFor(D){return Object.prototype.hasOwnProperty.call(this.writers,D)?this.writers[D]:void 0}preserveText(D,q,J){if(this.settings.oversizedText!=="preserve")throw new RangeError("Excel cell text exceeds 32,767 UTF-16 code units.");return this.overflow||(this.checkSheetLimit(this.sheets.length+this.chartSourceSheets+1),this.budget.reserve(5,22),this.overflow=new F(e("Text overflow",this.names,this.settings.invalidCharacterPolicy),this.settings.limits?.maxOverflowCharacters??4e6,this.settings.invalidCharacterPolicy,(re,le,oe)=>{this.budget.row(oe),this.budget.reserve(re,le)})),this.overflow.add(D,q,J)}checkSheetLimit(D){if(D>65526)throw new RangeError("Workbook has too many sheets.");if(this.settings.limits?.maxSheets!==void 0&&D>this.settings.limits.maxSheets)throw new k("RESOURCE_LIMIT","maxSheets exceeded.")}checkLinks(D){if(this.settings.limits?.maxHyperlinks!==void 0&&this.links+D>this.settings.limits.maxHyperlinks)throw new k("RESOURCE_LIMIT","maxHyperlinks exceeded.")}retainLink(D=1){this.checkLinks(D),this.links+=D}checkImage(D){if(this.settings.limits?.maxImageBytes!==void 0&&this.imageBytes+D>this.settings.limits.maxImageBytes)throw new k("RESOURCE_LIMIT","maxImageBytes exceeded.")}retainImage(D){this.checkImage(D),this.imageBytes+=D}retainBufferedBytes(D){this.budget.check("maxOutputBytes",this.bufferedBytes+D),this.bufferedBytes+=D}checkMerges(D){if(this.mergedRanges+D>(this.settings.limits?.maxMergedRanges??1e4))throw new k("RESOURCE_LIMIT","maxMergedRanges exceeded.")}checkConditionalFormats(D){if(this.conditionalFormats+D>(this.settings.limits?.maxConditionalFormats??1e3))throw new k("RESOURCE_LIMIT","maxConditionalFormats exceeded.")}get availableDataValidations(){return(this.settings.limits?.maxDataValidations??1e3)-this.dataValidationCount}get availableValidationTextCharacters(){return(this.settings.limits?.maxValidationTextCharacters??1e6)-this.validationTextCharacters}retainFormula(D){if(this.formulaCharacters+D>(this.settings.limits?.maxFormulaCharacters??1e6))throw new k("RESOURCE_LIMIT","maxFormulaCharacters exceeded.");this.formulaCharacters+=D,this.hasAuthoredFormulas=!0}checkChartText(D){if(this.chartTextCharacters+D>(this.settings.limits?.maxChartTextCharacters??1e6))throw new k("RESOURCE_LIMIT","maxChartTextCharacters exceeded.")}retainChartText(D){this.checkChartText(D),this.chartTextCharacters+=D}resolveChartBinding(D){const q=D.sheet;if(!this.sheets.includes(q)||q.hidden)throw new TypeError("Bound charts require a visible worksheet in the same workbook.");const J=q.chartBindingMetadata,re=D.firstRow??0;if(q.isBusy||J.closed||re<J.rows)throw new k("INVALID_STATE","Register a chart before its first selected data row is written, while the source worksheet is idle.");const le=V(J.columns,D.categoryColumn,"Chart"),oe=D.series.map(he=>V(J.columns,he.column,"Chart")),ne=J.headerRows+re+1;return{descriptor:{source:q,sheetName:J.name,headerRows:J.headerRows,categoryColumn:le,seriesColumns:oe,seriesNames:oe.map(he=>J.columns[he-1].header),categoryFormula:Q(J.name,le,ne,D.rowCount),valueFormulas:oe.map(he=>Q(J.name,he,ne,D.rowCount)),nameFormulas:oe.map((he,ye)=>D.series[ye].name===void 0?J.headerReferences[he-1]:void 0)},retainText:he=>this.retainChartText(he)}}registerChart(D){return this.registration(()=>{if(this.nativeCharts.length>=(this.settings.limits?.maxCharts??100))throw new k("RESOURCE_LIMIT","maxCharts exceeded.");const q=M(D,this.settings.invalidCharacterPolicy,(this.settings.limits?.maxChartPoints??1e5)-this.chartPoints,(this.settings.limits?.maxChartTextCharacters??1e6)-this.chartTextCharacters,this.settings.signal,re=>this.resolveChartBinding(re));this.assertOpen(),this.checkChartText(q.textCharacters),this.checkSheetLimit(this.sheets.length+this.chartSourceSheets+(q.binding?0:1)+(this.overflow?1:0));const J=Object.freeze({...q,id:this.nativeCharts.length+1,dataSheetName:q.binding?q.binding.source.name:e("Chart data "+(this.nativeCharts.length+1),this.names,this.settings.invalidCharacterPolicy)});return this.nativeCharts.push(J),this.chartPoints+=q.points,this.chartTextCharacters+=q.textCharacters,q.binding?q.binding.source.retainChartBinding(q.binding):this.chartSourceSheets++,J})}async openSheet(D){if(this.activeSheet&&this.activeSheet!==D){if(this.activeSheet.isBusy)throw new k("INVALID_STATE","Await the active streamed worksheet before starting another.");await this.activeSheet.finish()}return this.activeSheet=D,this.package.openPart("/xl/worksheets/sheet"+(this.sheets.indexOf(D)+1)+".xml",W("worksheet"))}async discard(D){this.state="failed",this.failure=D,await Promise.allSettled(this.sheets.map(q=>q.discard(D))),await this.package.discard(D),this.overflow?.clear(),this.nativeCharts.length=0}get worksheets(){return Object.freeze([...this.sheets])}get rowCount(){return this.sheets.reduce((D,q)=>D+q.reportRowCount,0)}addWorksheet(D,q={}){return this.registration(()=>{this.checkSheetLimit(this.sheets.length+this.chartSourceSheets+1+(this.overflow?1:0));const J=K(q,this.settings.invalidCharacterPolicy),re=T.validate(this,J);let le=J.table;if(le&&le.name===void 0){let he=this.tableCount+1;for(;this.tableNames.has(("Table"+he).toLowerCase());)he++;le={...le,name:"Table"+he}}const oe=le?O(this.tableCount+1,le,J.columns??[],this.settings.invalidCharacterPolicy):void 0;if(oe&&this.tableNames.has(oe.name.toLowerCase()))throw new TypeError("Duplicate Excel table name: "+oe.name);e(D,this.names,this.settings.invalidCharacterPolicy,!1);const ne=T.create(this,()=>e(D,this.names,this.settings.invalidCharacterPolicy,!1),J,oe,!1,re.conditional,re.validations);return this.assertOpen(),this.checkSheetLimit(this.sheets.length+this.chartSourceSheets+1+(this.overflow?1:0)),this.names.add(ne.name.toLowerCase()),this.mergedRanges+=ne.mergeCount,this.conditionalFormats+=ne.conditionalFormatCount,this.dataValidationCount+=ne.dataValidations.count,this.validationTextCharacters+=ne.dataValidations.textCharacters,oe&&(this.tableNames.add(oe.name.toLowerCase()),this.tableCount++),this.sheets.push(ne),ne})}addPart(D){this.assertOpen();const{uri:q,contentType:J,data:re,relationship:le}=D,oe=le&&{id:le.id,type:le.type,source:le.source};if(this.assertOpen(),this.package.addPart({uri:q,contentType:J,data:re}),oe){const{source:ne,id:he,type:ye}=oe;this.package.addRelationship(ne??"/xl/workbook.xml",{id:he,type:ye,target:q})}}finish(){try{R(this.settings.signal)}catch(D){return this.discard(D).then(()=>{throw D})}if(this.completion)return this.completion;if(this.state==="failed")return Promise.reject(this.failure);if(this.assertOpen(),this.sheets.some(D=>D.isBusy))throw new k("INVALID_STATE","Await addRows before finalizing the workbook.");return this.sheets.length||this.addWorksheet("Sheet1"),this.state="finalizing",this.completion=(async()=>{try{const D=this.rowCount;for(let J=0;J<this.sheets.length;J++){const re=this.sheets[J],le="/xl/worksheets/sheet"+(J+1)+".xml";await re.finish();const oe=re.takePrepared();oe&&this.package.addPrepared(le,W("worksheet"),oe);const ne=re.tableDefinition;if(ne){const he="/xl/tables/table"+ne.id+".xml";this.addXmlPart(he,W("table"),()=>E(ne,re.rowCount,this.settings.invalidCharacterPolicy,re.headerRowCount,re.footerSettings)),this.package.addRelationship(le,{id:"table",type:m+"/table",target:he})}for(let he=0;he<re.hyperlinks.length;he++)R(this.settings.signal),this.package.addRelationship(le,{id:"link"+(he+1),type:m+"/hyperlink",target:re.hyperlinks[he].target,external:!0}),(he&255)===255&&C()&&(await v(),R(this.settings.signal));if(re.images.length||re.charts.length){const he="/xl/drawings/drawing"+(J+1)+".xml";this.addXmlPart(he,A,()=>I(re.images,this.settings.invalidCharacterPolicy,re.charts)),this.package.addRelationship(le,{id:"drawing",type:m+"/drawing",target:he});for(let ye=0;ye<re.images.length;ye++){R(this.settings.signal);const j="/xl/media/sheet"+(J+1)+"-image"+(ye+1)+".png";this.package.addPart({uri:j,contentType:"image/png",data:re.images[ye].data}),this.package.addRelationship(he,{id:"image"+(ye+1),type:m+"/image",target:j}),(ye&255)===255&&C()&&(await v(),R(this.settings.signal))}for(const ye of re.charts){R(this.settings.signal);const j="/xl/charts/chart"+ye.id+".xml";this.package.addPart({uri:j,contentType:z,data:H=>L(ye,H,this.settings.invalidCharacterPolicy,this.settings.signal)}),this.package.addRelationship(he,{id:"chart"+ye.id,type:m+"/chart",target:j})}}}if(this.overflow){const J=T.create(this,this.overflow.sheetName,{columns:[{header:"Sheet"},{header:"Cell"},{header:"Part"},{header:"Text",width:80,wrapText:!0},{header:"Parts"}],freezeHeader:!0},void 0,!0);this.sheets.push(J),await J.finish(this.overflow.values());const re=J.takePrepared();re&&this.package.addPrepared("/xl/worksheets/sheet"+this.sheets.length+".xml",W("worksheet"),re),this.overflow.clear()}for(const J of this.nativeCharts){if(R(this.settings.signal),J.binding)continue;const re=T.createChartData(this,J);this.sheets.push(re);function*le(){for(let ne=0;ne<J.data.categories.length;ne++)yield[J.data.categories[ne],...J.data.series.map(he=>he.values[ne])]}await re.finish(le());const oe=re.takePrepared();oe&&this.package.addPrepared("/xl/worksheets/sheet"+this.sheets.length+".xml",W("worksheet"),oe)}this.package.addRelationship("/",{id:"workbook",type:f.officeDocument,target:"/xl/workbook.xml"});for(let J=0;J<this.sheets.length;J++)R(this.settings.signal),this.package.addRelationship("/xl/workbook.xml",{id:"rId"+(J+1),type:f.worksheet,target:"/xl/worksheets/sheet"+(J+1)+".xml"}),(J&255)===255&&C()&&(await v(),R(this.settings.signal));this.package.addRelationship("/xl/workbook.xml",{id:"styles",type:f.styles,target:"/xl/styles.xml"});const q=await this.package.finish();for(const J of this.sheets)J.releaseCharts();return this.nativeCharts.length=0,b(this.settings.onProgress,{phase:"complete",rows:D,bytes:q}),R(this.settings.signal),this.state="complete",{rows:D,sheets:this.sheets.length,bytes:q}}catch(D){throw await this.discard(D),D}})(),this.completion}toBlob(){try{R(this.settings.signal)}catch(D){return this.discard(D).then(()=>{throw D})}if(this.settings.sink)throw new k("INVALID_STATE","This workbook uses a caller-owned sink; use finish().");if(!this.result){const D=this.finish();this.result=D.then(()=>this.package.toBlob(G))}return this.result}}const Z=Object.freeze({Workbook:X});return B.set("fe4b78533e92385c8af50681c6a1273e1f9ec6f4f9ae8342684c06e904cfb8e0",Z),Z})(),Dt=B.get("62ff1bcbf8ca07e8ab92cd1f6afbd54049346193e18160ab0afec48e03950bba")??(()=>{const{ExportCell:S,assertScalar:R}=Se,{captureWorkbookOptions:v,sheetOptionFields:C}=tt,{captureFields:k}=ke;function b(f){for(const a of["font","fill","border","numberFormat"])if(typeof f?.[a]=="number")throw new TypeError("Workbook-local style indexes require the advanced Workbook API; use style definitions.");return f}function p(f){return f instanceof S||R(f),f}function g(f={}){if(f=k(f,C),f.headerStyle!==void 0)throw new TypeError("Workbook-local header styles require the advanced Workbook API; use boldHeader, headerFill, headerBorder and headerWrap.");b(f.alternatingRowStyle),b(f.title?.style),b(f.footer?.style),f.footer?.values?.forEach(p);const a=f.rowStyle,s=f.cellStyle;for(const o of[a,s])if(o!==void 0&&typeof o!="function")throw new TypeError("Style callbacks must be functions.");return{...f,...a?{rowStyle:o=>b(a(o))}:{},...s?{cellStyle:o=>b(s(o))}:{}}}function x(f={}){f=v(f);const a=f.cellValueWriters;if(!a)return f;const s=Object.create(null);for(const[o,c]of Object.entries(a)){if(typeof c!="function")throw new TypeError("Cell value writers must be functions.");s[o]=(i,r)=>p(c(i,r))}return{...f,cellValueWriters:s}}const m=Object.freeze({portableSheet:g,portableWorkbook:x});return B.set("62ff1bcbf8ca07e8ab92cd1f6afbd54049346193e18160ab0afec48e03950bba",m),m})(),zt=B.get("05d6afb9e04ef4bfee413c0cee45f432de701dd04c8673077e711f82ed4a3471")??(()=>{const{withDestination:S}=Oe,{copyColumns:R}=Ue,{Workbook:v}=xt,{portableSheet:C,portableWorkbook:k}=Dt,{captureFields:b}=ke,{sheetOptionFields:p,workbookOptionFields:g}=tt;function x(o){o=b(o,[...g,"columns","sheet"]);const c=R(o.columns),i=o.sheet&&b(o.sheet,[...p,"name"]);return{...k(o),columns:c,sheet:{...C(i),...i?.name===void 0?{}:{name:i.name}}}}function m(o,c){const{name:i="Data",...r}=c.sheet??{};return o.addWorksheet(i,{boldHeader:!0,autoFilter:r.includeHeader!==!1,autoSize:{minWidth:6,maxWidth:54},...r,columns:c.columns})}async function f(o,c){const i=x(c),{columns:r,sheet:n,...e}=i,t=v.forTable(e);try{return await m(t,i).addRows(o),await t.toBlob()}catch(l){throw await t.discard(l),l}}async function a(o,c,i){const r=x(i);return S(c,async n=>{const{columns:e,sheet:t,...l}=r,d=v.forTable({...l,sink:n});try{const u=m(d,r),h=r.columns.length;await u.addRows(o);const w=await d.finish();return{rows:w.rows,columns:h,bytes:w.bytes}}catch(u){throw await d.discard(u),u}})}const s=Object.freeze({writeXlsx:f,writeXlsxTo:a});return B.set("05d6afb9e04ef4bfee413c0cee45f432de701dd04c8673077e711f82ed4a3471",s),s})(),Jt=B.get("8df3d4472935cf1e82313946c2473abf41dd8c539922d3283439958b72548576")??(()=>{const{assertGroupedReportSource:S}=Me,{captureFields:R}=ke,{OfficeIMOError:v}=ue,{fields:C}=dt,{sheetOptionFields:k}=tt,{portableSheet:b}=Dt,{resolveDataColumn:p}=et,{copyStylePatch:g}=Ge,x=["labelColumn","subtotalLabel","grandTotalLabel","includeGrandTotal","collapseGroups","sheet","groupStyle","subtotalStyle","grandTotalStyle","conditionalFormats","dataValidation"],m=["columns","headerRows","footer","table","mergedCells","hyperlinks","conditionalFormats","dataValidation","rowStyle","cellStyle","rowOutline","maxOutlineLevel"];function f(i,r){return p(i.columns,r,"Grouped detail")+1}function a(i,r,n){if(r!==void 0){if(!Array.isArray(r))throw new TypeError("conditionalFormats must be an array.");if(r.length>n)throw new v("RESOURCE_LIMIT","maxConditionalFormats exceeded.");return r.map(e=>{const t=R(e,["type","range","style","stopIfTrue","operator","value","values","formula","stops","color","minimum","maximum","showValue"]),l=t.range;if(typeof l=="string")throw new TypeError("Grouped conditional formats require detail-column selectors rather than A1 or generated-row ranges.");C(l,["column","through"],"grouped conditional range");const d=R(l,["column","through"]);return{...t,range:{column:f(i,d.column),...d.through===void 0?{}:{through:f(i,d.through)}}}})}}function s(i,r,n){if(r!==void 0){if(!Array.isArray(r))throw new TypeError("dataValidation must be an array.");if(r.length>n)throw new v("RESOURCE_LIMIT","maxDataValidations exceeded.");return r.map(e=>{const t=R(e,["type","column","items","allowBlank","showErrorMessage","errorStyle","errorTitle","errorMessage"]);return{...t,column:f(i,t.column)}})}}function o(i,r,n=1e3,e=1e3){if(S(i),!r||typeof r!="object")throw new TypeError("Grouped XLSX options require host-authored labels.");const t=R(r,x),l=R(t.sheet??{},[...k,"name"]);if(!t.labelColumn||typeof t.labelColumn!="object")throw new TypeError("Grouped XLSX needs a leading label column.");const d=R(t.labelColumn,["header","width","wrapText","alignment"]);if(typeof d.header!="string")throw new TypeError("The leading label column needs a string header.");for(const w of[t.subtotalLabel,t.grandTotalLabel])if(typeof w!="function")throw new TypeError("Grouped summary labels must be functions.");for(const w of[t.includeGrandTotal,t.collapseGroups])if(w!==void 0&&typeof w!="boolean")throw new TypeError("Grouped XLSX flags must be booleans.");for(const w of m)if(l[w]!==void 0)throw new TypeError("Grouped XLSX owns worksheet "+w+".");if(l.autoFilter!==void 0&&l.autoFilter!==!1)throw new TypeError("Grouped summary rows cannot use a native table or autofilter.");for(const w of[t.groupStyle,t.subtotalStyle,t.grandTotalStyle])w!==void 0&&b({alternatingRowStyle:w});for(const w of i.columns)if(Object.prototype.hasOwnProperty.call(i.totals,w.key)&&w.type!=="number")throw new TypeError("Editable grouped totals require explicitly numeric columns.");const u=a(i,t.conditionalFormats,n),h=s(i,t.dataValidation,e);return{...t,labelColumn:d,sheet:b(l),...u===void 0?{}:{conditionalFormats:u},...h===void 0?{}:{dataValidation:h},...t.groupStyle?{groupStyle:g(t.groupStyle)}:{},...t.subtotalStyle?{subtotalStyle:g(t.subtotalStyle)}:{},...t.grandTotalStyle?{grandTotalStyle:g(t.grandTotalStyle)}:{}}}const c=Object.freeze({groupedOptionFields:x,prepareGroupedSheet:o});return B.set("8df3d4472935cf1e82313946c2473abf41dd8c539922d3283439958b72548576",c),c})(),Ve=B.get("26f5f707c4feb95052da5c9787df79bf6a94178780b276c4f74677ce0f96e87a")??(()=>{const{groupedReportOperation:S}=Me,{checkAbort:R,withAbort:v}=be,{withDestination:C}=Oe,{captureFields:k}=ke,{Workbook:b}=xt,{FormulaCell:p}=Je,{columnName:g}=Fe,{captureWorkbookLimits:x,workbookOptionFields:m}=tt,{retainDataRowRanges:f}=ht,{groupedOptionFields:a,prepareGroupedSheet:s}=Jt,o={average:1,count:2,max:4,min:5,sum:9};function c(h){if(typeof h?.then=="function"&&Promise.resolve(h).catch(()=>{}),typeof h!="string")throw new TypeError("Grouped summary labels must return strings.");return h}function i(h,w,y,T,O){const E=w+y+":"+w+T,P="SUBTOTAL("+o[h]+","+E+")";return new p(h==="average"||h==="min"||h==="max"?"IF(SUBTOTAL(2,"+E+')=0,"",'+P+")":P,O,h==="count"?0:void 0)}async function r(h,w,y,T,O){R(T.signal);const{labelColumn:E,subtotalLabel:P,grandTotalLabel:I,includeGrandTotal:A,collapseGroups:F,sheet:N,groupStyle:U,subtotalStyle:M,grandTotalStyle:Q,conditionalFormats:V,dataValidation:z}=y;let L=0,G;const W=[],K=[],X=[];let Z=0,se=0,D,q;const{name:J="Data",...re}=N??{},le=[{...E,type:"string"},...w.columns],oe={groupStart:U??{font:{bold:!0}},groupEnd:M??{font:{bold:!0}},complete:Q??{font:{bold:!0}}},ne=h.addWorksheet(J,{boldHeader:!0,autoSize:{minWidth:6,maxWidth:54},...re,columns:le,...V===void 0?{}:{conditionalFormats:V},...z===void 0?{}:{dataValidation:z},maxOutlineLevel:w.groupBy.length,rowStyle:()=>G&&G.kind!=="row"?oe[G.kind]:void 0,rowOutline:()=>{if(!G||G.kind==="complete")return;const j=G.kind==="row"?G.path.length:G.level;return{level:j,hidden:!!F&&j>0,collapsed:!!F&&G.kind==="groupEnd"}}});f(ne,X);const he=w.columns.map(j=>Object.prototype.hasOwnProperty.call(w.totals,j.key)?w.totals[j.key]:void 0);async function*ye(){for await(const j of T.events){G=j;const H=ne.rowCount+ne.headerRowCount+1;if(j.kind==="groupStart"){const _={groupIndex:j.groupIndex,level:j.level,key:j.key,label:j.label,path:j.path,rows:0,totals:Object.freeze([]),startRow:H,firstDetailRow:0,lastDetailRow:0,summaryRow:0};W.push(_),K.push(_),yield[j.label,...w.columns.map(()=>null)]}else if(j.kind==="row"){L++,O?.(L),Z||=H,se=H;const _=X.at(-1);_&&_.lastRow+1===H?_.lastRow=H:X.push({firstRow:H,lastRow:H});for(const $ of K)$.firstDetailRow||=H,$.lastDetailRow=H;yield[null,...j.values]}else if(j.kind==="groupEnd"){const _=K.pop();_.summaryRow=H,_.rows=j.rows,_.totals=j.totals,yield[c(P(j)),...he.map(($,ie)=>$?i($,g(ie+2),_.firstDetailRow,_.lastDetailRow,j.totals[ie]):null)]}else q=Object.freeze({rows:j.rows,groups:j.groups,totals:j.totals}),A!==!1&&(D=H,yield[c(I(j)),...he.map((_,$)=>_?Z?i(_,g($+2),Z,se,j.totals[$]):j.totals[$]:null)])}}try{return R(T.signal),await v(ne.addRows(ye()),T.signal),await v(ne.close(),T.signal),Object.freeze({worksheet:ne,rows:L,columns:le.length,detailRanges:Object.freeze(X.map(j=>Object.freeze({...j}))),groups:Object.freeze(W.map(j=>Object.freeze({...j}))),grandSummary:q,...D===void 0?{}:{grandTotalRow:D}})}catch(j){throw await h.discard(j),j}}async function n(h,w,y){const T=s(w,y,h.settings.limits?.maxConditionalFormats??1e3,h.availableDataValidations),O=S(w,h.settings.signal);try{return await r(h,w,T,O)}finally{O.dispose()}}function e(h,w){if(!w||typeof w!="object")throw new TypeError("Grouped XLSX options require host-authored labels.");const y=k(w,[...m,...a]);if(y.sink!==void 0||y.cellValueWriters!==void 0)throw new TypeError("Grouped XLSX owns its destination and uses already resolved source values.");const T=y.limits===void 0?void 0:x(y.limits);return{...y,...T===void 0?{}:{limits:T},...s(h,y,T?.maxConditionalFormats??1e3,T?.maxDataValidations??1e3)}}async function t(h,w,y){const{labelColumn:T,subtotalLabel:O,grandTotalLabel:E,includeGrandTotal:P,collapseGroups:I,sheet:A,groupStyle:F,subtotalStyle:N,grandTotalStyle:U,conditionalFormats:M,dataValidation:Q,onProgress:V,...z}=w,L=S(h,z.signal);let G=0,W;const K=V?X=>V({...X,rows:G,...X.sheetRows===void 0?{}:{sheetRows:G}}):void 0;try{W=new b({...z,...L.signal?{signal:L.signal}:{},...K?{onProgress:K}:{},...y?{sink:y}:{}});const X=await r(W,h,w,L,se=>{G=se});if(y){const se=await W.finish();return{result:{rows:G,columns:X.columns,bytes:se.bytes}}}const Z=await W.toBlob();return{blob:Z,result:{rows:G,columns:X.columns,bytes:Z.size}}}catch(X){throw await W?.discard(X),X}finally{L.dispose()}}async function l(h,w){return(await t(h,e(h,w))).blob}async function d(h,w,y){const T=e(h,y);return C(w,async O=>(await t(h,T,O)).result)}const u=Object.freeze({addGroupedXlsx:n,writeGroupedXlsx:l,writeGroupedXlsxTo:d});return B.set("26f5f707c4feb95052da5c9787df79bf6a94178780b276c4f74677ce0f96e87a",u),u})(),_e=B.get("e5310c591178a3de9292f150e2e6f1477b94b895ef0c90840c72adef00f75974")??(()=>{const S=Object.freeze({Workbook:xt.Workbook,writeXlsx:zt.writeXlsx,writeXlsxTo:zt.writeXlsxTo,writeGroupedXlsx:Ve.writeGroupedXlsx,writeGroupedXlsxTo:Ve.writeGroupedXlsxTo,addGroupedXlsx:Ve.addGroupedXlsx,createGroupedReport:Me.createGroupedReport,Worksheet:At.Worksheet,Cell:Fe.Cell,FormulaCell:Je.FormulaCell,StyleRegistry:Ge.StyleRegistry,NumberFormats:Ge.NumberFormats,saveBlob:Ne.saveBlob,ExportCell:Se.ExportCell});return B.set("e5310c591178a3de9292f150e2e6f1477b94b895ef0c90840c72adef00f75974",S),S})(),Yt=B.get("2f5c0823847e9209017d01b2a753f36056df2a9988fae1f3a1bd5fd186545220")??(()=>{const{captureTableSpans:S,tableSpans:R}=Ye;function v(k,b,p){const g=R(S(k,b),b),x=g.map(()=>Array(b).fill(""));for(let m=0;m<g.length;m++)for(const f of g[m]){if((f.span>1||f.rowSpan>1)&&p===void 0)throw new TypeError("CSV spanned headings/footers require an explicit spanMode: repeat or anchors.");const a=f.value;for(let s=m;s<m+(p==="repeat"?f.rowSpan:1);s++)for(let o=f.first;o<f.first+(p==="repeat"?f.span:1);o++)x[s][o]=a}return x}const C=Object.freeze({csvStructuredRows:v});return B.set("2f5c0823847e9209017d01b2a753f36056df2a9988fae1f3a1bd5fd186545220",C),C})(),Tt=B.get("9b33d9107e62ba8299c576072de40d24a261464f118de4ace64f23154fc78307")??(()=>{const S=Object.freeze({true:"True",false:"False"});function R(C){if(C===void 0)return S;if(!C||typeof C!="object")throw new TypeError("booleanText must contain true and false strings.");const k=C.true,b=C.false;if(typeof k!="string"||typeof b!="string")throw new TypeError("booleanText must contain true and false strings.");return Object.freeze({true:k,false:b})}const v=Object.freeze({defaultBooleanText:S,captureBooleanText:R});return B.set("9b33d9107e62ba8299c576072de40d24a261464f118de4ace64f23154fc78307",v),v})(),Qt=B.get("f0627ba89e5c8fcb376ebe3ce72dcc8d68c34952981f8703e36b8bb1a9894208")??(()=>{const{captureFields:S}=ke;function R(C){if(!C||typeof C!="object")throw new TypeError("CSV options are required.");return S(C,["columns","signal","limits","onProgress","valueMode","delimiter","lineEnding","bom","includeHeader","headerRows","footer","spanMode","formulaInjectionProtection","quote","nullValue","booleanText"])}const v=Object.freeze({captureCsvOptions:R});return B.set("f0627ba89e5c8fcb376ebe3ce72dcc8d68c34952981f8703e36b8bb1a9894208",v),v})(),Et=B.get("b48bcab805d4c75294dd8d8e8dc57f96d9db3f5af31a8f0ddc6562f010f566e4")??(()=>{const{beginTask:S,checkAbort:R,consumeRows:v,taskYieldDue:C,withAbort:k}=be,{BlobByteSink:b,ChunkedTextSink:p,withDestination:g}=Oe,{ExportBudget:x,boundedSink:m}=ot,{ExportCell:f}=Se,{isDate:a}=Le,{notifyProgress:s}=Ke,{copyColumns:o,createRowProjector:c}=Ue,{csvStructuredRows:i}=Yt,{captureBooleanText:r}=Tt,{captureCsvOptions:n}=Qt;function e(h,w,y,T,O){const E=typeof h;let P;if(h==null)P="";else if(E==="string")P=h;else{if(E==="number")return P=Number.isFinite(h)?String(h):"",T==="all"?'"'+P+'"':P;if(E==="boolean")P=O[h?"true":"false"];else if(a(h))P=Number.isFinite(h.getTime())?h.toISOString():"";else throw typeof h.then=="function"&&Promise.resolve(h).catch(()=>{}),new TypeError("CSV cells and formatter results must be synchronous strings, numbers, booleans, Dates or null.")}return y&&(E==="string"||E==="boolean")&&P.charCodeAt(0)<=64&&/^ *[=+\-@\t\r\n]/.test(P)&&(P="'"+P),T==="all"||T==="strings"&&E==="string"||P.includes(w)||/["\r\n]/.test(P)?'"'+(P.includes('"')?P.replace(/"/g,'""'):P)+'"':P}async function t(h,w,y){const T=n(y);return g(w,O=>l(h,O,T))}async function l(h,w,y){S();const T=o(y.columns).map(Z=>Object.freeze(Z)),O=y.delimiter??",",E=y.lineEnding??"\r\n",P=y.quote??"minimal",I=r(y.booleanText);if(![",",";"," "].includes(O))throw new RangeError("Delimiter must be comma, semicolon or tab.");if(!["\r\n","\n","\r"].includes(E))throw new RangeError("Invalid line ending.");if(!["minimal","all","strings"].includes(P))throw new RangeError("Quoting must be minimal, all or strings.");if(y.valueMode!==void 0&&!["raw","display"].includes(y.valueMode))throw new RangeError("valueMode must be raw or display.");if(y.nullValue!==void 0&&typeof y.nullValue!="string")throw new TypeError("nullValue must be a string.");if(y.spanMode!==void 0&&y.spanMode!=="repeat"&&y.spanMode!=="anchors")throw new TypeError("CSV spanMode must be repeat or anchors.");const A=y.includeHeader===!1?[]:y.headerRows===void 0?T.length?[T.map(Z=>Z.header)]:[]:i(y.headerRows,T.length,y.spanMode),F=y.footer===void 0?[]:i(y.footer.rows,T.length,y.spanMode);for(const Z of T)if(Z.valueFormatter!==void 0&&typeof Z.valueFormatter!="function")throw new TypeError("CSV value formatters must be functions.");const N=new x(y.limits);let U=0;const M=w;w=m({async write(Z){await M.write(Z),U+=Z.byteLength}},N);const Q=c(T,void 0,y.signal),V=T.some(Z=>Z.valueFormatter),z=y.signal,L=y.formulaInjectionProtection!==!1,G=new p(w,z);R(z),y.bom&&await k(Promise.resolve(w.write(new Uint8Array([239,187,191]))),z);let W=0;const K=Z=>Z!==null&&typeof Z=="object"&&Z instanceof f?y.valueMode==="display"&&Z.text!==void 0?Z.text:Z.value:Z;function X(Z,se=!1,D=0,q){!se&&V&&D===0&&(q=Object.freeze(T.map((re,le)=>K(Z[le]))));let J="";for(let re=D;re<T.length;re++){R(z);const le=T[re],oe=K(Z[re]);let ne=!se&&le.valueFormatter?le.valueFormatter(oe,{rowIndex:W,columnIndex:re,column:le,values:q}):oe;if(ne==null&&y.nullValue!==void 0&&(ne=y.nullValue),N.cell(typeof ne=="boolean"?I[ne?"true":"false"]:ne),R(z),J+=(re?O:"")+e(ne,O,L,P,I),J.length>=G.chunkSize||(re&127)===127&&C()){if(G.append(J))return G.flush().then(()=>X(Z,se,re+1,q));J=""}}if(G.append(J+E))return G.flush().then(()=>{s(y.onProgress,{phase:"rows",rows:W+(se?0:1)})})}for(const Z of A)await X(Z,!0);await v(h,z,Z=>{N.row(W+1);const se=X(Q(Z,W));if(se)return se.then(()=>{W++});W++});for(const Z of F)await X(Z,!0);return await G.close(),s(y.onProgress,{phase:"complete",rows:W,bytes:U}),R(z),{rows:W,columns:T.length,bytes:U}}async function d(h,w){const y=n(w),T=new b;try{let O=0;await l(h,T,{...y,onProgress:P=>{P.phase==="complete"?O=P.rows:s(y.onProgress,P)}});const E=T.toBlob("text/csv;charset=utf-8");return s(y.onProgress,{phase:"complete",rows:O,bytes:E.size}),R(y.signal),E}catch(O){throw T.discard(),O}}const u=Object.freeze({saveBlob:Ne.saveBlob,ExportCell:Se.ExportCell,writeCsvTo:t,writeCsv:d});return B.set("b48bcab805d4c75294dd8d8e8dc57f96d9db3f5af31a8f0ddc6562f010f566e4",u),u})(),Xe=B.get("49927994ccf68595c9211828bccb16a874fa149bda2ea904d369d9943e93bc58")??(()=>{const{captureFields:S}=ke;function R(b,p,g=14400){if(!Number.isFinite(b)||b<=0||b>g)throw new RangeError(p+" must be positive and at most "+g+".");return b}function v(b){if(typeof b!="string"||!/^#?[0-9a-f]{6}$/i.test(b))throw new TypeError("PDF colors must be six-digit RGB hex strings.");const p=b.replace(/^#/,"");return[0,2,4].map(g=>String(Math.round(parseInt(p.slice(g,g+2),16)/255*1e4)/1e4)).join(" ")}function C(b={}){if(!b||typeof b!="object")throw new TypeError("PDF presentation must be an object.");const p=S(b,["background","color","numberFormat","bold","italic","wrapText","alignment"]);p.background!==void 0&&v(p.background),p.color!==void 0&&v(p.color);for(const g of["bold","italic","wrapText"])if(p[g]!==void 0&&typeof p[g]!="boolean")throw new TypeError("PDF presentation "+g+" must be boolean.");if(p.alignment!==void 0&&!["left","center","right"].includes(p.alignment))throw new TypeError("PDF table alignment supports left, center and right.");return Object.freeze(p)}const k=Object.freeze({positive:R,color:v,presentation:C});return B.set("49927994ccf68595c9211828bccb16a874fa149bda2ea904d369d9943e93bc58",k),k})(),kt=B.get("278e6adc6a5d4491e688589ef165bd1aa9cc74f557da6f9d6bdf53ecc0c6df47")??(()=>{const{OfficeIMOError:S}=ue,{positive:R,presentation:v}=Xe,C=["fontSize","presentation","keepTogether","keepWithNext","spaceBefore","spaceAfter"],k=["bold","italic","color","alignment"];function b(m){if(m&&typeof m.then=="function")throw Promise.resolve(m).catch(()=>{}),new TypeError("PDF paragraph styles must be synchronous objects.");if(!m||typeof m!="object"||Array.isArray(m)||Object.keys(m).some(r=>!C.includes(r)))throw new TypeError("PDF paragraph styles support fontSize, presentation, keepTogether, keepWithNext, spaceBefore and spaceAfter.");const{fontSize:f,presentation:a,keepTogether:s,keepWithNext:o,spaceBefore:c,spaceAfter:i}=m;f!==void 0&&R(f,"Paragraph font size",144);for(const[r,n]of[["keepTogether",s],["keepWithNext",o]])if(n!==void 0&&typeof n!="boolean")throw new TypeError("Paragraph "+r+" must be boolean.");for(const r of[c,i])if(r!==void 0&&(!Number.isFinite(r)||r<0||r>14400))throw new RangeError("Paragraph spacing must be from zero through 14,400 points.");if(a!==void 0&&(!a||typeof a!="object"||Array.isArray(a)||Object.keys(a).some(r=>!k.includes(r))))throw new TypeError("PDF paragraph presentation supports bold, italic, color and alignment.");return Object.freeze({...f===void 0?{}:{fontSize:f},...a===void 0?{}:{presentation:v(a)},...s===void 0?{}:{keepTogether:s},...o===void 0?{}:{keepWithNext:o},...c===void 0?{}:{spaceBefore:c},...i===void 0?{}:{spaceAfter:i}})}function p(m,f){if(!Number.isSafeInteger(f)||f<0)throw new RangeError("maxParagraphStyles must be a nonnegative safe integer.");const a=Object.create(null);if(m===void 0)return Object.freeze(a);if(m&&typeof m.then=="function")throw Promise.resolve(m).catch(()=>{}),new TypeError("paragraphStyles must be a synchronous record.");if(!m||typeof m!="object"||Array.isArray(m))throw new TypeError("paragraphStyles must be a record of named paragraph styles.");const s=Object.keys(m);if(s.length>f)throw new S("RESOURCE_LIMIT","maxParagraphStyles exceeded.");for(const o of s){if(!o.trim())throw new TypeError("Paragraph style names must be nonempty text.");a[o]=b(m[o])}return Object.freeze(a)}function g(m,f,a){let s={};if(m!==void 0){if(typeof m!="string"||!Object.prototype.hasOwnProperty.call(a,m))throw new TypeError("Unknown PDF paragraph style: "+String(m));s=a[m]}const o=b(f);return Object.freeze({...s,...o,...s.presentation||o.presentation?{presentation:Object.freeze({...s.presentation,...o.presentation})}:{}})}const x=Object.freeze({captureParagraphStyle:b,captureParagraphStyles:p,resolveParagraphStyle:g});return B.set("278e6adc6a5d4491e688589ef165bd1aa9cc74f557da6f9d6bdf53ecc0c6df47",x),x})(),je=B.get("4a089607f7cbe50e13d4382d1cc4e5f6ce32c5773bbec2df84178710f54d9a38")??(()=>{const{OfficeIMOError:S}=ue,{ExportBudget:R}=ot,{copyColumns:v}=Ue,{captureTableSpans:C}=Ye,{copyExportValue:k}=at,{captureFields:b}=ke,{captureParagraphStyles:p}=kt,{captureBooleanText:g}=Tt,{positive:x,color:m,presentation:f}=Xe,a={A3:{width:841.89,height:1190.551},A4:{width:595.276,height:841.89},A5:{width:419.528,height:595.276},LETTER:{width:612,height:792},LEGAL:{width:612,height:1008},TABLOID:{width:792,height:1224}},s=["columns","signal","onProgress","limits","textShaper","textDirection","pageSize","orientation","margins","fonts","tagged","fontSize","title","messageTop","messageBottom","includeHeader","headerRows","footer","headerPresentation","footerPresentation","alternateRowColor","padding","columnWidths","wideTable","pageHeader","pageFooter","pageNumbers","pageNumberLabels","booleanText","formatValue","formatRuns","compression","paragraphStyles"],o=["maxRows","maxCells","maxTextCharacters","maxOutputBytes","maxPages","maxColumns","maxTableBands","maxTableWindowRows","maxCellCharacters","maxTextRuns","maxGroupBlocks","maxRowLines","maxFontBytes","maxPageBytes","maxHyperlinks","maxImageBytes","maxImagePixels","maxImageWorkingBytes","maxVectorCommands","maxDrawingElements","maxStructureElements","maxMarkedContentReferences","maxSections","maxBookmarks","maxListItems","maxParagraphStyles"];function c(d){if(!d||typeof d!="object"||Array.isArray(d))throw new TypeError("PDF options must be an object.");const u=b(d,s),h=u.wideTable;return{...u,...h===void 0?{}:{wideTable:n(h)}}}function i(d){if(!d||typeof d!="object"||Array.isArray(d))throw new TypeError("PDF limits must be an object.");const u=b(d,o);for(const[h,w]of Object.entries(u))if(w!==void 0&&(!Number.isSafeInteger(w)||w<0))throw new RangeError(h+" must be a nonnegative safe integer.");return Object.freeze(u)}function r(d,u){if(!d||typeof d!="object"||Array.isArray(d))throw new TypeError("PDF footer must be an object.");const{values:h,totals:w,rows:y}=d;if(h!==void 0&&!Array.isArray(h))throw new TypeError("PDF footer values must be an array.");return Object.freeze({...h===void 0?{}:{values:Object.freeze(h.map(k))},...w===void 0?{}:{totals:Object.freeze({...w})},...y===void 0?{}:{rows:C(y,u)}})}function n(d){if(d===void 0||d==="fit"||d==="reject")return d;if(!d||typeof d!="object"||Array.isArray(d)||Object.keys(d).some(T=>!["mode","minimumColumnWidth","repeatColumns"].includes(T)))throw new TypeError("wideTable must be fit, reject or a bands policy.");const{mode:u,minimumColumnWidth:h,repeatColumns:w}=d;if(u!=="bands")throw new TypeError("wideTable.mode must be bands.");if(h!==void 0&&x(h,"Minimum PDF column width"),w!==void 0&&!Array.isArray(w))throw new TypeError("repeatColumns must be an array.");const y=w===void 0?[]:[...w];if(y.some(T=>typeof T=="number"?!Number.isSafeInteger(T)||T<0:typeof T!="string"||!T.length))throw new RangeError("repeatColumns must contain nonnegative indices or nonempty stable keys.");if(y.every(T=>typeof T=="number")&&y.some((T,O)=>O>0&&T<=y[O-1]))throw new RangeError("Numeric repeatColumns must contain sorted unique nonnegative indices.");return Object.freeze({mode:u,...h===void 0?{}:{minimumColumnWidth:h},repeatColumns:Object.freeze(y)})}function e(d,u){if(typeof d!="object")return Object.freeze([]);const h=new Set;for(const w of d.repeatColumns??[]){let y;if(typeof w=="number")y=w;else if(y=u.findIndex(T=>T.key===w),y<0||u.some((T,O)=>O!==y&&T.key===w))throw new TypeError("repeatColumns requires an unambiguous selected column key: "+w);if(y>=u.length)throw new RangeError("repeatColumns index exceeds the declared columns.");if(h.has(y))throw new TypeError("repeatColumns selects the same column more than once.");h.add(y)}return Object.freeze([...h].sort((w,y)=>w-y))}function t(d,u=!1){const h={...c(d)};if(h.booleanText=g(h.booleanText),h.limits!==void 0&&(h.limits=i(h.limits)),h.pageSize&&typeof h.pageSize=="object"&&(h.pageSize=Object.freeze(b(h.pageSize,["width","height"]))),h.margins&&typeof h.margins=="object"&&(h.margins=Object.freeze(b(h.margins,["top","right","bottom","left"]))),h.pageNumberLabels!==void 0){const L=h.pageNumberLabels;if(!L||typeof L!="object"||Array.isArray(L))throw new TypeError("pageNumberLabels must provide literal text.");const{prefix:G="Page ",separator:W=" of ",suffix:K=""}=L;if([G,W,K].some(X=>typeof X!="string"))throw new TypeError("Page-number labels must be text.");h.pageNumberLabels=Object.freeze({prefix:G,separator:W,suffix:K})}const w=h.textShaper,y=w?.shapeLine;if(w!==void 0&&(!w||typeof y!="function"))throw new TypeError("textShaper must provide shapeLine.");if(h.textDirection!==void 0&&!["auto","ltr","rtl"].includes(h.textDirection))throw new TypeError("textDirection must be auto, ltr or rtl.");const T=u?[]:v(h.columns).map(L=>Object.freeze(L));if(u&&(h.includeHeader=!1),!T.length&&!u)throw new TypeError("PDF tables need at least one declared column.");const O=h.fonts===void 0?void 0:b(h.fonts,["regular","bold","italic","boldItalic"]),E={...h,columns:T,...w?{textShaper:Object.freeze({shapeLine:y.bind(w)})}:{},...h.tagged?{tagged:Object.freeze(b(h.tagged,["language"]))}:{},...h.headerRows?{headerRows:C(h.headerRows,T.length)}:{},...O?{fonts:Object.freeze(O)}:{},...h.columnWidths?{columnWidths:Object.freeze([...h.columnWidths])}:{},...h.footer===void 0?{}:{footer:r(h.footer,T.length)},headerPresentation:Object.freeze({background:"e7edf5",bold:!0,...f(h.headerPresentation)}),footerPresentation:Object.freeze({background:"eef2f6",bold:!0,...f(h.footerPresentation)})},P=new R(E.limits),I={maxPages:1e4,maxColumns:1024,maxTableBands:64,maxTableWindowRows:256,maxCellCharacters:1e6,maxTextRuns:1e4,maxGroupBlocks:256,maxRowLines:1e5,maxFontBytes:16*1024*1024,maxPageBytes:8*1024*1024,maxHyperlinks:1e5,maxImageBytes:32*1024*1024,maxImagePixels:16*1024*1024,maxVectorCommands:1e5,maxDrawingElements:1e5,maxStructureElements:1e6,maxMarkedContentReferences:2e6,maxListItems:1e5,maxParagraphStyles:256,maxSections:1e3,maxBookmarks:1e4};for(const L of Object.keys(I)){const G=E.limits?.[L];G!==void 0&&(I[L]=G)}const A=p(E.paragraphStyles,I.maxParagraphStyles);if(T.length>I.maxColumns)throw new S("RESOURCE_LIMIT","maxColumns exceeded.");const F=typeof E.pageSize=="string"||E.pageSize===void 0?a[E.pageSize??"A4"]:E.pageSize;if(!F)throw new TypeError("Unsupported PDF page size.");if(x(F.width,"Page width"),x(F.height,"Page height"),E.orientation!==void 0&&!["portrait","landscape"].includes(E.orientation))throw new TypeError("Invalid PDF orientation.");const N=E.orientation==="landscape",U={width:N?Math.max(F.width,F.height):Math.min(F.width,F.height),height:N?Math.min(F.width,F.height):Math.max(F.width,F.height)},M={top:36,right:36,bottom:36,left:36,...typeof E.margins=="number"?{top:E.margins,right:E.margins,bottom:E.margins,left:E.margins}:E.margins};for(const L of Object.values(M))if(!Number.isFinite(L)||L<0)throw new RangeError("PDF margins must be finite and nonnegative.");if(M.left+M.right>=U.width||M.top+M.bottom>=U.height)throw new RangeError("PDF margins leave no content area.");const Q=x(E.fontSize??9,"Font size",144),V=E.padding??4;if(!Number.isFinite(V)||V<0||V>72)throw new RangeError("PDF padding must be from 0 through 72 points.");for(const L of["title","messageTop","messageBottom"])if(E[L]!==void 0&&typeof E[L]!="string")throw new TypeError(L+" must be text.");for(const L of["pageHeader","pageFooter"])if(E[L]!==void 0&&typeof E[L]!="string"&&typeof E[L]!="function")throw new TypeError(L+" must be text or a synchronous callback.");for(const L of["formatValue","formatRuns"])if(E[L]!==void 0&&typeof E[L]!="function")throw new TypeError(L+" must be a synchronous function.");for(const L of["compression","includeHeader","pageNumbers"])if(E[L]!==void 0&&typeof E[L]!="boolean")throw new TypeError(L+" must be boolean.");if(E.alternateRowColor!==void 0&&m(E.alternateRowColor),E.footer?.values&&E.footer.values.length>T.length)throw new RangeError("Footer has more values than declared columns.");if(E.footer?.rows&&(E.footer.values!==void 0||E.footer.totals!==void 0))throw new TypeError("Structured footer rows cannot be combined with values/totals.");if(E.headerRows&&E.includeHeader===!1)throw new TypeError("headerRows requires includeHeader.");if(E.tagged!==void 0){if(!E.tagged||typeof E.tagged!="object"||typeof E.tagged.language!="string"||E.tagged.language.length>63)throw new TypeError("tagged.language must be a language tag such as en or en-US.");try{if(Intl.getCanonicalLocales(E.tagged.language).length!==1)throw new RangeError}catch{throw new TypeError("tagged.language must be a language tag such as en or en-US.")}}const z=E.limits?.maxImageWorkingBytes;return{options:{...E,paragraphStyles:A},paragraphStyles:A,page:U,margins:M,fontSize:Q,padding:V,repeatedColumns:u?Object.freeze([]):e(E.wideTable,T),limits:{...I,...z===void 0?{}:{maxImageWorkingBytes:z}},budget:P}}const l=Object.freeze({positive:Xe.positive,color:Xe.color,presentation:Xe.presentation,pdfOptionFields:s,pdfLimitFields:o,capturePdfOptions:c,capturePdfLimits:i,captureWideTable:n,settings:t});return B.set("4a089607f7cbe50e13d4382d1cc4e5f6ce32c5773bbec2df84178710f54d9a38",l),l})(),er=B.get("e3d39f39aebcbaf063fd8221df0d9cb5902ad2545a9d9e474bb59d47f15e2c01")??(()=>{function R(k,b,p,g){if(!Number.isSafeInteger(p)||p<0||p>=2**(g*8))throw new RangeError("Invalid PDF cross-reference field.");for(let x=g-1;x>=0;x--)k[b+x]=p%256,p=Math.floor(p/256)}function*v(k,b){if(k.length!==b.length)throw new Error("PDF cross-reference locations must align.");const p=Math.floor(32768/11);for(let g=0;g<k.length;g+=p){const x=Math.min(p,k.length-g),m=new Uint8Array(x*11);for(let f=0;f<x;f++){const a=g+f,s=f*11,o=k[a],c=b.at(a);if(o===void 0)throw new Error("PDF contains unwritten objects.");m[s]=a===0?0:c===void 0?1:2,R(m,s+1,o,8),R(m,s+9,a===0?65535:c??0,2)}yield m}}const C=Object.freeze({pdfXrefEntryBytes:11,pdfXrefChunks:v});return B.set("e3d39f39aebcbaf063fd8221df0d9cb5902ad2545a9d9e474bb59d47f15e2c01",C),C})(),Ae=B.get("e716b8b1da464094622f5f671518493c78e63ff22a029d61544d2d193b63ce8f")??(()=>{const{checkAbort:S,withAbort:R,pause:v,taskYieldDue:C}=be,{OfficeIMOError:k}=ue,{pdfXrefChunks:b,pdfXrefEntryBytes:p}=er,g=256,x=32768,m=4096;class f{count;chunks=[];constructor(r){this.count=r}get length(){return this.count}reserve(){this.count++}set(r,n){const e=this.chunks[Math.floor(r/m)]??=new Uint16Array(m);e[r%m]=n+1}at(r){const n=this.chunks[Math.floor(r/m)]?.[r%m]??0;return n?n-1:void 0}}function a(i){if(!Number.isFinite(i)||Math.abs(i)>1e9)throw new RangeError("PDF coordinates and metrics must be finite and bounded.");return String(Math.round(i*1e3)/1e3)}function s(i){let r="";for(let n=0;n<i.length;n++){const e=i.charCodeAt(n);if(e>=55296&&e<=56319&&!(i.charCodeAt(n+1)>=56320&&i.charCodeAt(n+1)<=57343)||e>=56320&&e<=57343&&!(i.charCodeAt(n-1)>=55296&&i.charCodeAt(n-1)<=56319))throw new TypeError("PDF text contains an unpaired UTF-16 surrogate.");r+=e.toString(16).padStart(4,"0")}return r}class o{sink;signal;maxBytes;compressObjects;offsets=[0];compactIndices;compactBatch;compactArena;compactUnavailable=!1;encoder=new TextEncoder;buffer=new Uint8Array(32768);buffered=0;bytes=0;constructor(r,n,e=Number.MAX_SAFE_INTEGER,t=!1){this.sink=r,this.signal=n,this.maxBytes=e,this.compressObjects=t}reserve(){return this.offsets.push(void 0),this.compactIndices?.reserve(),this.offsets.length-1}async raw(r){if(S(this.signal),!Number.isSafeInteger(this.bytes+r.length)||this.bytes+r.length>this.maxBytes)throw new k("RESOURCE_LIMIT","maxOutputBytes exceeded.");this.bytes+=r.length;for(let n=0;n<r.length;){const e=Math.min(this.buffer.length-this.buffered,r.length-n);this.buffer.set(r.subarray(n,n+e),this.buffered),n+=e,this.buffered+=e,this.buffered===this.buffer.length&&await this.flushBytes()}}async text(r){await this.raw(this.encoder.encode(r))}async flush(){await this.flushCompact(),await this.flushBytes()}async flushBytes(){if(this.buffered){const r=this.buffer.subarray(0,this.buffered);await R(Promise.resolve(this.sink.write(r)),this.signal),this.buffered=0}C()&&await v(),S(this.signal)}tryCompactObject(r,n){S(this.signal),this.validateObject(r);const e=this.compactBatch;if(!e||!this.compressObjects||this.compactUnavailable||typeof CompressionStream!="function"||n.length>x||e.ids.length+1>=g)return!1;const t=String(r).length+String(e.bodyBytes).length+2,l=this.encodeCompactBody(n,e.bodyBytes,x-e.indexBytes-t-e.bodyBytes-2);return l===void 0?!1:(this.storeCompactBody(e,r,l),!0)}async compactObject(r,n){if(S(this.signal),this.validateObject(r),!this.compressObjects||this.compactUnavailable||n.length>x)return this.object(r,n);if(typeof CompressionStream!="function"){if(this.compactIndices)throw new Error("PDF object compression became unavailable.");return this.compactUnavailable=!0,this.object(r,n)}const e=String(r).length+4;let t=this.compactBatch;const l=String(r).length+String(t?.bodyBytes??0).length+2;let d=t&&t.ids.length<g?this.encodeCompactBody(n,t.bodyBytes,x-t.indexBytes-l-t.bodyBytes-2):void 0;if(t&&d===void 0&&(await this.flushCompact(),t=void 0,S(this.signal)),!t){if(d=this.encodeCompactBody(n,0,x-e-1),d===void 0)return this.object(r,n);let u;if(!this.compactIndices)try{u=new CompressionStream("deflate")}catch{return this.compactUnavailable=!0,this.object(r,n)}t={id:this.reserve(),compressor:u,ids:[],bodyOffsets:[],bodyBytes:0,indexBytes:1},this.compactIndices??=new f(this.offsets.length),this.compactBatch=t}this.storeCompactBody(t,r,d),t.ids.length===g&&await this.flushCompact()}storeCompactBody(r,n,e){this.offsets[n]=r.id,this.compactIndices.set(n,r.ids.length),r.indexBytes+=String(n).length+String(r.bodyBytes).length+2,r.ids.push(n),r.bodyOffsets.push(r.bodyBytes),this.compactArena[r.bodyBytes+e]=10,r.bodyBytes+=e+1}encodeCompactBody(r,n,e){if(e<0)return;const t=(this.compactArena??=new Uint8Array(x)).subarray(n,n+e);if(typeof this.encoder.encodeInto=="function"){const d=this.encoder.encodeInto(r,t);return d.read===r.length?d.written:void 0}const l=this.encoder.encode(r);if(!(l.length>e))return t.set(l),l.length}async flushCompact(){const r=this.compactBatch;if(!r)return;this.compactBatch=void 0;let n="";for(let d=0;d<r.ids.length;d++)n+=r.ids[d]+" "+r.bodyOffsets[d]+" ";const e=this.encoder.encode(n+"\n"),t=r.ids.length,l=this.compactArena.subarray(0,r.bodyBytes);r.ids.length=0,r.bodyOffsets.length=0,r.compressor?await this.compressedStream(r.id,l,"/Type /ObjStm /N "+t+" /First "+e.length,r.compressor,e):(this.start(r.id),await this.text(r.id+" 0 obj\n<< /Length "+(e.length+l.length)+" /Type /ObjStm /N "+t+" /First "+e.length+" >>\nstream\n"),await this.raw(e),await this.raw(l),await this.text("\nendstream\nendobj\n"))}async object(r,n){if(this.start(r),typeof n=="string"){await this.text(r+" 0 obj\n"+n+"\nendobj\n");return}let e=r+" 0 obj\n";for(const t of n)for(let l=0;l<t.length;){const d=Math.min(t.length,l+32768-e.length);if(e+=t.slice(l,d),l=d,e.length===32768){const u=e.charCodeAt(e.length-1),h=u>=55296&&u<=56319?e.length-1:e.length;await this.text(e.slice(0,h)),e=e.slice(h)}}await this.text(e+"\nendobj\n")}validateObject(r){if(!Number.isSafeInteger(r)||r<=0||r>=this.offsets.length||this.offsets[r]!==void 0)throw new Error("Invalid PDF object state.")}start(r){this.validateObject(r),this.offsets[r]=this.bytes}async stream(r,n,e="",t=!0,l=!1){const d=typeof n=="string"?this.encoder.encode(n):n;let u;if(t&&typeof CompressionStream=="function"&&d.length)try{u=new CompressionStream("deflate")}catch{}if(!u){this.start(r),await this.text(r+" 0 obj\n<< /Length "+d.length+" "+e+" >>\nstream\n"),await this.raw(d),await this.text("\nendstream\nendobj\n");return}const h=typeof n=="string"||l?d:new Uint8Array(d);await this.compressedStream(r,h,e,u)}async compressedStream(r,n,e,t,l){const u=new ReadableStream({start(T){l&&T.enqueue(l),T.enqueue(n),T.close()}}).pipeThrough(t).getReader(),h=this.reserve();let w=0,y=!1;try{for(this.start(r),await this.text(r+" 0 obj\n<< /Length "+h+" 0 R /Filter /FlateDecode "+e+" >>\nstream\n");;){const T=await R(u.read(),this.signal);if(T.done){y=!0;break}w+=T.value.length,await this.raw(T.value)}await this.text("\nendstream\nendobj\n"),await this.object(h,String(w))}finally{y||u.cancel(this.signal?.reason).catch(()=>{}),u.releaseLock()}}async finish(r,n){await this.flushCompact();for(let t=1;t<this.offsets.length;t++)if(this.offsets[t]===void 0)throw new Error("PDF contains unwritten objects.");if(this.bytes>9999999999)throw new k("RESOURCE_LIMIT","PDF exceeds classic cross-reference offset capacity.");if(this.compactIndices)return this.finishCompact(r,n);const e=this.bytes;await this.text("xref\n0 "+this.offsets.length+"\n0000000000 65535 f \n");for(let t=1;t<this.offsets.length;t++)await this.text(String(this.offsets[t]).padStart(10,"0")+" 00000 n \n");await this.text("trailer\n<< /Size "+this.offsets.length+" /Root "+r+" 0 R /Info "+n+" 0 R >>\nstartxref\n"+e+"\n%%EOF\n"),await this.flush()}async finishCompact(r,n){const e=this.reserve(),t=this.bytes,l=this.offsets.length*p;if(!Number.isSafeInteger(l))throw new k("RESOURCE_LIMIT","PDF cross-reference stream is too large.");this.start(e),await this.text(e+" 0 obj\n<< /Type /XRef /Size "+this.offsets.length+" /W [1 8 2] /Root "+r+" 0 R /Info "+n+" 0 R /Length "+l+" >>\nstream\n");for(const d of b(this.offsets,this.compactIndices))await this.raw(d);await this.text("\nendstream\nendobj\nstartxref\n"+t+"\n%%EOF\n"),await this.flushBytes()}}const c=Object.freeze({pdfNumber:a,unicodeHex:s,PdfObjects:o});return B.set("e716b8b1da464094622f5f671518493c78e63ff22a029d61544d2d193b63ce8f",c),c})(),Bt=B.get("1e169e6ecdeceff319b5da4bf01f4c653c1a3d9e8ad696b141bf8ac52d9f446c")??(()=>{class S{bytes;view;constructor(b){this.bytes=b,this.view=new DataView(b.buffer,b.byteOffset,b.byteLength)}range(b,p){if(!Number.isSafeInteger(b)||!Number.isSafeInteger(p)||b<0||p<0||b+p>this.bytes.length)throw new TypeError("Truncated or invalid TrueType table.")}u16(b){return this.range(b,2),this.view.getUint16(b)}i16(b){return this.range(b,2),this.view.getInt16(b)}u32(b){return this.range(b,4),this.view.getUint32(b)}tag(b){return this.range(b,4),String.fromCharCode(...this.bytes.subarray(b,b+4))}}function R(k){let b=0;for(let p=0;p<k.length;p+=4)b=b+((k[p]??0)*16777216+((k[p+1]??0)<<16)+((k[p+2]??0)<<8)+(k[p+3]??0))>>>0;return b}const C=Object.freeze({FontReader:S,checksum:R,align4:k=>Math.ceil(k/4)*4});return B.set("1e169e6ecdeceff319b5da4bf01f4c653c1a3d9e8ad696b141bf8ac52d9f446c",C),C})(),tr=B.get("ecf6c6ab2f9c5f747338d0d59d9f2cae0b006d9d2a210bcb1545db1f046eb80c")??(()=>{const{align4:S}=Bt,{checkAbort:R,pause:v,taskYieldDue:C}=be;function k(s,o,c){const i=p(s,o,c);for(;;){const r=i.next();if(r.done)return r.value}}async function b(s,o,c,i){R(i);const r=p(s,o,c);for(;;){const n=r.next();if(n.done)return R(i),n.value;C()&&await v(),R(i)}}function*p(s,o,c){const i=new Set([0,...o]),r=s.table("glyf"),n=[...i],e=new Map;let t=0;for(let z=0;z<n.length;z++){(++t&1023)===0&&(yield);const L=n[z];if(!Number.isInteger(L)||L<0||L>=s.glyphCount)throw new TypeError("Invalid subset glyph.");const G=s.offsets[L],W=s.offsets[L+1];if(G===W)continue;if(W-G<10)throw new TypeError("Truncated TrueType glyph header.");if(s.i16(r.offset+G)>=0)continue;let K=r.offset+G+10,X;const Z=[];e.set(L,Z);const se=r.offset+W;do{if(K+4>se)throw new TypeError("Truncated TrueType composite.");X=s.u16(K);const D=s.u16(K+2);if(D>=s.glyphCount)throw new TypeError("Invalid TrueType composite dependency.");if(Z.push(D),(++t&1023)===0&&(yield),i.has(D)||(i.add(D),n.push(D)),K+=4+(X&1?4:2)+(X&8?2:X&64?4:X&128?8:0),K>se)throw new TypeError("Truncated TrueType composite transform.")}while(X&32);if(X&256&&(K+2>se||K+2+s.u16(K)>se))throw new TypeError("Truncated composite instructions.")}const l=new Set,d=new Set;function*u(z,L){if((++t&1023)===0&&(yield),d.has(z))throw new TypeError("Cyclic TrueType composite dependency.");if(L>64)throw new TypeError("TrueType composite nesting exceeds 64 levels.");if(!l.has(z)){d.add(z);for(const G of e.get(z)??[])yield*u(G,L+1);d.delete(z),l.add(z)}}for(const z of i)yield*u(z,0);const h=new Uint32Array(s.glyphCount+1);let w=0;for(let z=0;z<s.glyphCount;z++)h[z]=w,i.has(z)&&(w+=S(s.offsets[z+1]-s.offsets[z])),(z&1023)===1023&&(yield);h[s.glyphCount]=w;const y=new Uint8Array(w);for(const z of i)yield*m(s.bytes.subarray(r.offset+s.offsets[z],r.offset+s.offsets[z+1]),y,h[z]),(++t&1023)===0&&(yield);const T=new Uint8Array(h.length*4),O=new DataView(T.buffer);for(let z=0;z<h.length;z++)O.setUint32(z*4,h[z]),(z&1023)===1023&&(yield);const E=new Set(["OS/2","cmap","cvt ","fpgm","gasp","glyf","head","hhea","hmtx","loca","maxp","name","post","prep"]),P=yield*x(c),I=yield*g(s,i),A=[];for(const[z,L]of[...s.tables].filter(([G])=>E.has(G)).sort(([G],[W])=>G<W?-1:1)){const G=z==="glyf"?y:z==="loca"?T:z==="cmap"?P:z==="hmtx"?I:void 0,W=G??new Uint8Array(L.length);if(G||(yield*m(s.bytes.subarray(L.offset,L.offset+L.length),W)),z==="head"){const K=new DataView(W.buffer);K.setUint32(8,0),K.setInt16(50,1)}A.push({tag:z,bytes:W})}const F=12+A.length*16+A.reduce((z,L)=>z+S(L.bytes.length),0),N=new Uint8Array(F),U=new DataView(N.buffer);U.setUint32(0,65536),U.setUint16(4,A.length);const M=2**Math.floor(Math.log2(A.length));U.setUint16(6,M*16),U.setUint16(8,Math.log2(M)),U.setUint16(10,A.length*16-M*16);let Q=12+A.length*16,V=0;for(let z=0;z<A.length;z++){const L=A[z],G=12+z*16;for(let W=0;W<4;W++)N[G+W]=L.tag.charCodeAt(W);U.setUint32(G+4,yield*f(L.bytes)),U.setUint32(G+8,Q),U.setUint32(G+12,L.bytes.length),yield*m(L.bytes,N,Q),L.tag==="head"&&(V=Q),Q+=S(L.bytes.length)}return U.setUint32(V+8,2981146554-(yield*f(N))>>>0),N}function*g(s,o){let c=0;const i=s.u16(s.table("hhea").offset+34),r=s.table("hmtx"),n=new Uint8Array(i*4+(s.glyphCount-i)*2);for(const e of o){(++c&1023)===0&&(yield);const t=e<i?e*4:i*4+(e-i)*2,l=e<i?4:2;if(n.set(s.bytes.subarray(r.offset+t,r.offset+t+l),t),e>=i){const d=(i-1)*4;n.set(s.bytes.subarray(r.offset+d,r.offset+d+2),d)}}return n}function*x(s){let o=0;const c=[...s].sort(([e],[t])=>e-t),i=[];for(const[e,t]of c){(++o&1023)===0&&(yield);const l=i.at(-1);l&&e===l.last+1&&t===l.glyph+e-l.first?l.last=e:i.push({first:e,last:e,glyph:t})}const r=new Uint8Array(28+i.length*12),n=new DataView(r.buffer);n.setUint16(2,1),n.setUint16(4,3),n.setUint16(6,10),n.setUint32(8,12),n.setUint16(12,12),n.setUint32(16,r.length-12),n.setUint32(24,i.length);for(let e=0;e<i.length;e++){const t=i[e],l=28+e*12;n.setUint32(l,t.first),n.setUint32(l+4,t.last),n.setUint32(l+8,t.glyph),(e&1023)===1023&&(yield)}return r}function*m(s,o,c=0){for(let i=0;i<s.length;i+=65536)o.set(s.subarray(i,Math.min(s.length,i+65536)),c+i),yield}function*f(s){let o=0;for(let c=0;c<s.length;c+=4)o=o+((s[c]??0)*16777216+((s[c+1]??0)<<16)+((s[c+2]??0)<<8)+(s[c+3]??0))>>>0,(c&65535)===65532&&(yield);return o}const a=Object.freeze({subsetTrueType:k,subsetTrueTypeCooperatively:b});return B.set("ecf6c6ab2f9c5f747338d0d59d9f2cae0b006d9d2a210bcb1545db1f046eb80c",a),a})(),rr=B.get("2e1fa1582af797386e2e2914c0a27237309b1692a3cc2be688f46590eb74480d")??(()=>{const{NotSupportedError:S}=ue,{FontReader:R}=Bt,{subsetTrueType:v,subsetTrueTypeCooperatively:C}=tr,{checkAbort:k,pause:b,taskYieldDue:p}=be;class g extends R{tables;glyphCount;units;ascent;descent;bbox;widths;offsets;canSubset;cmaps;constructor(a,s){super(a);const o=x(this);let c=s;if(!c)for(;;){const i=o.next();if(i.done){c=i.value;break}}this.tables=c.tables,this.glyphCount=c.glyphCount,this.units=c.units,this.ascent=c.ascent,this.descent=c.descent,this.bbox=c.bbox,this.widths=c.widths,this.offsets=c.offsets,this.canSubset=c.canSubset,this.cmaps=c.cmaps}static async create(a,s){k(s);const o=x(new R(a));for(;;){const c=o.next();if(c.done)return k(s),new g(a,c.value);p()&&await b(),k(s)}}table(a,s=0){const o=this.tables.get(a);if(!o||o.length<s)throw new TypeError("Missing or truncated TrueType table: "+a);return o}glyph(a){for(const s of this.cmaps){const o=s.offset,c=this.u16(o);let i=0;if(c===12){let r=0,n=this.u32(o+12)-1;for(;r<=n;){const e=r+n>>>1,t=o+16+e*12,l=this.u32(t),d=this.u32(t+4);if(a<l)n=e-1;else if(a>d)r=e+1;else{i=this.u32(t+8)+a-l;break}}}else if(a<=65535){const r=this.u16(o+6)/2;let n=0,e=r-1;for(;n<e;){const l=n+e>>>1;a>this.u16(o+14+l*2)?n=l+1:e=l}const t=this.u16(o+16+r*2+n*2);if(a>=t&&a<=this.u16(o+14+n*2)){const l=this.i16(o+16+r*4+n*2),d=o+16+r*6+n*2,u=this.u16(d);if(!u)i=a+l&65535;else{const h=d+u+(a-t)*2;if(h+2>o+s.length)throw new TypeError("cmap glyph array exceeds its table.");i=this.u16(h),i&&(i=i+l&65535)}}}if(i>=this.glyphCount)throw new TypeError("cmap references an invalid glyph.");if(i)return i}return 0}subset(a,s){return this.canSubset?v(this,a,s):this.bytes}async subsetCooperatively(a,s,o){return k(o),this.canSubset?C(this,a,s,o):this.bytes}}function*x(f){const a=new Map,s=(z,L=0)=>{const G=a.get(z);if(!G||G.length<L)throw new TypeError("Missing or truncated TrueType table: "+z);return G};if(f.u32(0)!==65536)throw new S("PDF fonts require a static TrueType .ttf with glyf outlines; collections, CFF and WOFF are unsupported.");const o=f.u16(4);if(!o||o>256)throw new TypeError("Invalid TrueType table count.");f.range(12,o*16);for(let z=0;z<o;z++){const L=12+z*16,G=f.tag(L),W=f.u32(L+8),K=f.u32(L+12);if(f.range(W,K),a.has(G))throw new TypeError("Duplicate TrueType table: "+G);a.set(G,{offset:W,length:K})}if(a.has("fvar"))throw new S("Instantiate a variable font as a static TrueType font before PDF export.");const c=s("head",54),i=s("maxp",6),r=s("hhea",36),n=s("OS/2",10);if(f.u32(c.offset+12)!==1594834165)throw new TypeError("Invalid TrueType head magic.");const e=f.u16(i.offset+4),t=f.u16(c.offset+18);if(!e||t<16||t>16384)throw new TypeError("Invalid TrueType metrics.");const l=f.u16(n.offset+8);if(l&514)throw new S("The font's embedding permissions prohibit outline embedding.");const d=!(l&256),u=1e3/t,h=f.i16(r.offset+4)*u,w=f.i16(r.offset+6)*u,y=[36,38,40,42].map(z=>f.i16(c.offset+z)*u),T=f.u16(r.offset+34);if(!T||T>e)throw new TypeError("Invalid TrueType horizontal metric count.");const O=s("hmtx",T*4+(e-T)*2),E=[];for(let z=0;z<e;z++)E.push(f.u16(O.offset+Math.min(z,T-1)*4)*u),(z&1023)===1023&&(yield);const P=f.i16(c.offset+50);if(P!==0&&P!==1)throw new TypeError("Unsupported TrueType loca index.");const I=s("loca",(e+1)*(P?4:2)),A=s("glyf"),F=[];for(let z=0;z<=e;z++)F.push(P?f.u32(I.offset+z*4):f.u16(I.offset+z*2)*2),(z&1023)===1023&&(yield);for(let z=0;z<=e;z++)if(F[z]>A.length||z&&F[z]<F[z-1])throw new TypeError("Invalid TrueType glyph offsets.");const N=s("cmap",4),U=[],M=new Set,Q=f.u16(N.offset+2);if(4+Q*8>N.length)throw new TypeError("Invalid TrueType cmap directory.");for(let z=0;z<Q;z++){const L=N.offset+4+z*8,G=f.u16(L),W=f.u16(L+2),K=f.u32(L+4);if(G!==0&&!(G===3&&(W===1||W===10)))continue;if(K+4>N.length)throw new TypeError("Invalid cmap subtable offset.");const X=N.offset+K,Z=f.u16(X);if(Z!==4&&Z!==12||M.has(X))continue;if(Z===12&&K+16>N.length)throw new TypeError("Truncated cmap format 12.");const se=Z===12?f.u32(X+4):f.u16(X+2);if(se<16||K+se>N.length)throw new TypeError("Invalid cmap length.");if(Z===12){const D=f.u32(X+12);if(16+D*12>se)throw new TypeError("Invalid cmap groups.");let q=-1;for(let J=0;J<D;J++){const re=X+16+J*12,le=f.u32(re),oe=f.u32(re+4),ne=f.u32(re+8);if(le<=q||le>oe||oe>1114111||ne+oe-le>=e)throw new TypeError("Invalid cmap scalar/glyph group.");q=oe,(J&1023)===1023&&(yield)}}else{const D=f.u16(X+6)/2;if(!Number.isInteger(D)||!D||16+D*8>se)throw new TypeError("Invalid cmap segments.");let q=-1;for(let J=0;J<D;J++){const re=f.u16(X+14+J*2),le=f.u16(X+16+D*2+J*2);if(re<=q||le>re)throw new TypeError("Invalid cmap segment ordering.");q=re,(J&1023)===1023&&(yield)}}M.add(X),U.push({offset:X,length:se})}const V=U.sort((z,L)=>f.u16(L.offset)-f.u16(z.offset));if(!U.length)throw new S("TrueType font needs a Unicode cmap format 4 or 12.");return{tables:a,glyphCount:e,units:t,ascent:h,descent:w,bbox:y,widths:E,offsets:F,canSubset:d,cmaps:V}}const m=Object.freeze({TrueTypeFont:g});return B.set("2e1fa1582af797386e2e2914c0a27237309b1692a3cc2be688f46590eb74480d",m),m})(),rt=B.get("d9c1509dff0538488752433e47cd0927ece5f93c559ad0e32dc56602dfd44596")??(()=>{const{TrueTypeFont:S}=rr,{beginTask:R,checkAbort:v}=be,C=new WeakMap,k=Symbol.for("@evotecit/officeimo/PdfFont");function b(x){let m=C.get(x);if(!m){if(!(x instanceof p)||typeof x.toBytes!="function")throw new TypeError("Invalid PdfFont instance.");const f=new p(x.toBytes());m=C.get(f),C.set(x,m)}return m}class p{static[Symbol.hasInstance](m){return!!m&&typeof m=="object"&&m[k]===!0}brand=!0;constructor(m){if(!(m instanceof Uint8Array))throw new TypeError("PdfFont requires TrueType bytes as a Uint8Array.");if(m.length>64*1024*1024)throw new RangeError("A TrueType font must not exceed 64 MiB.");C.set(this,new S(m.slice())),this.brand,Object.defineProperty(this,k,{value:!0}),Object.freeze(this)}static async create(m,f={}){if(v(f.signal),!(m instanceof Uint8Array))throw new TypeError("PdfFont requires TrueType bytes as a Uint8Array.");const a=f.maxBytes??16*1024*1024;if(!Number.isSafeInteger(a)||a<0||a>64*1024*1024)throw new RangeError("Font preparation maxBytes must be a nonnegative safe integer at most 64 MiB.");if(m.length>a)throw new RangeError("TrueType font exceeds the preparation byte limit.");R();const s=await S.create(new Uint8Array(m),f.signal);v(f.signal);const o=Object.create(p.prototype);return C.set(o,s),Object.defineProperty(o,"brand",{value:!0}),Object.defineProperty(o,k,{value:!0}),Object.freeze(o),o}toBytes(){return b(this).bytes.slice()}}const g=Object.freeze({fontProgram:b,PdfFont:p});return B.set("d9c1509dff0538488752433e47cd0927ece5f93c559ad0e32dc56602dfd44596",g),g})(),nr=B.get("1ed4965a6e2963a91190baa8a58ada8ce0edde8fe653bcb6609002e872af0d61")??(()=>{const R=Object.freeze({helveticaWidths:new Map([[32,[278,278]],[33,[278,333]],[34,[355,474]],[35,[556,556]],[36,[556,556]],[37,[889,889]],[38,[667,722]],[39,[191,238]],[40,[333,333]],[41,[333,333]],[42,[389,389]],[43,[584,584]],[44,[278,278]],[45,[333,333]],[46,[278,278]],[47,[278,278]],[48,[556,556]],[49,[556,556]],[50,[556,556]],[51,[556,556]],[52,[556,556]],[53,[556,556]],[54,[556,556]],[55,[556,556]],[56,[556,556]],[57,[556,556]],[58,[278,333]],[59,[278,333]],[60,[584,584]],[61,[584,584]],[62,[584,584]],[63,[556,611]],[64,[1015,975]],[65,[667,722]],[66,[667,722]],[67,[722,722]],[68,[722,722]],[69,[667,667]],[70,[611,611]],[71,[778,778]],[72,[722,722]],[73,[278,278]],[74,[500,556]],[75,[667,722]],[76,[556,611]],[77,[833,833]],[78,[722,722]],[79,[778,778]],[80,[667,667]],[81,[778,778]],[82,[722,722]],[83,[667,667]],[84,[611,611]],[85,[722,722]],[86,[667,667]],[87,[944,944]],[88,[667,667]],[89,[667,667]],[90,[611,611]],[91,[278,333]],[92,[278,278]],[93,[278,333]],[94,[469,584]],[95,[556,556]],[96,[333,333]],[97,[556,556]],[98,[556,611]],[99,[500,556]],[100,[556,611]],[101,[556,556]],[102,[278,333]],[103,[556,611]],[104,[556,611]],[105,[222,278]],[106,[222,278]],[107,[500,556]],[108,[222,278]],[109,[833,889]],[110,[556,611]],[111,[556,611]],[112,[556,611]],[113,[556,611]],[114,[333,389]],[115,[500,556]],[116,[278,333]],[117,[556,611]],[118,[500,556]],[119,[722,778]],[120,[500,556]],[121,[500,556]],[122,[500,500]],[123,[334,389]],[124,[260,280]],[125,[334,389]],[126,[584,584]],[161,[333,333]],[162,[556,556]],[163,[556,556]],[164,[556,556]],[165,[556,556]],[166,[260,280]],[167,[556,556]],[168,[333,333]],[169,[737,737]],[170,[370,370]],[171,[556,556]],[172,[584,584]],[174,[737,737]],[175,[333,333]],[176,[400,400]],[177,[584,584]],[178,[333,333]],[179,[333,333]],[180,[333,333]],[181,[556,611]],[182,[537,556]],[183,[278,278]],[184,[333,333]],[185,[333,333]],[186,[365,365]],[187,[556,556]],[188,[834,834]],[189,[834,834]],[190,[834,834]],[191,[611,611]],[192,[667,722]],[193,[667,722]],[194,[667,722]],[195,[667,722]],[196,[667,722]],[197,[667,722]],[198,[1e3,1e3]],[199,[722,722]],[200,[667,667]],[201,[667,667]],[202,[667,667]],[203,[667,667]],[204,[278,278]],[205,[278,278]],[206,[278,278]],[207,[278,278]],[208,[722,722]],[209,[722,722]],[210,[778,778]],[211,[778,778]],[212,[778,778]],[213,[778,778]],[214,[778,778]],[215,[584,584]],[216,[778,778]],[217,[722,722]],[218,[722,722]],[219,[722,722]],[220,[722,722]],[221,[667,667]],[222,[667,667]],[223,[611,611]],[224,[556,556]],[225,[556,556]],[226,[556,556]],[227,[556,556]],[228,[556,556]],[229,[556,556]],[230,[889,889]],[231,[500,556]],[232,[556,556]],[233,[556,556]],[234,[556,556]],[235,[556,556]],[236,[278,278]],[237,[278,278]],[238,[278,278]],[239,[278,278]],[240,[556,611]],[241,[556,611]],[242,[556,611]],[243,[556,611]],[244,[556,611]],[245,[556,611]],[246,[556,611]],[247,[584,584]],[248,[611,611]],[249,[556,611]],[250,[556,611]],[251,[556,611]],[252,[556,611]],[253,[500,556]],[254,[556,611]],[255,[500,556]],[256,[667,722]],[257,[556,556]],[258,[667,722]],[259,[556,556]],[260,[667,722]],[261,[556,556]],[262,[722,722]],[263,[500,556]],[268,[722,722]],[269,[500,556]],[270,[722,722]],[271,[643,743]],[272,[722,722]],[273,[556,611]],[274,[667,667]],[275,[556,556]],[278,[667,667]],[279,[556,556]],[280,[667,667]],[281,[556,556]],[282,[667,667]],[283,[556,556]],[286,[778,778]],[287,[556,611]],[290,[778,778]],[291,[556,611]],[298,[278,278]],[299,[278,278]],[302,[278,278]],[303,[222,278]],[304,[278,278]],[305,[278,278]],[310,[667,722]],[311,[500,556]],[313,[556,611]],[314,[222,278]],[315,[556,611]],[316,[222,278]],[317,[556,611]],[318,[299,400]],[321,[556,611]],[322,[222,278]],[323,[722,722]],[324,[556,611]],[325,[722,722]],[326,[556,611]],[327,[722,722]],[328,[556,611]],[332,[778,778]],[333,[556,611]],[336,[778,778]],[337,[556,611]],[338,[1e3,1e3]],[339,[944,944]],[340,[722,722]],[341,[333,389]],[342,[722,722]],[343,[333,389]],[344,[722,722]],[345,[333,389]],[346,[667,667]],[347,[500,556]],[350,[667,667]],[351,[500,556]],[352,[667,667]],[353,[500,556]],[354,[611,611]],[355,[278,333]],[356,[611,611]],[357,[317,389]],[362,[722,722]],[363,[556,611]],[366,[722,722]],[367,[556,611]],[368,[722,722]],[369,[556,611]],[370,[722,722]],[371,[556,611]],[376,[667,667]],[377,[611,611]],[378,[500,500]],[379,[611,611]],[380,[500,500]],[381,[611,611]],[382,[500,500]],[402,[556,556]],[536,[667,667]],[537,[500,556]],[710,[333,333]],[711,[333,333]],[728,[333,333]],[729,[333,333]],[730,[333,333]],[731,[333,333]],[732,[333,333]],[733,[333,333]],[8211,[556,556]],[8212,[1e3,1e3]],[8216,[222,278]],[8217,[222,278]],[8218,[222,278]],[8220,[333,500]],[8221,[333,500]],[8222,[333,500]],[8224,[556,556]],[8225,[556,556]],[8226,[350,350]],[8230,[1e3,1e3]],[8240,[1e3,1e3]],[8249,[333,333]],[8250,[333,333]],[8260,[167,167]],[8364,[556,556]],[8482,[1e3,1e3]],[8706,[476,494]],[8710,[612,612]],[8721,[600,600]],[8722,[584,584]],[8730,[453,549]],[8800,[549,549]],[8804,[549,549]],[8805,[549,549]],[9674,[471,494]],[64257,[500,611]],[64258,[500,611]]])});return B.set("1ed4965a6e2963a91190baa8a58ada8ce0edde8fe653bcb6609002e872af0d61",R),R})(),Lt=B.get("59911f0fe023545e9e97521b268551078bdc4c5f303e446a13b7d52f905e8070")??(()=>{const{OfficeIMOError:S}=ue,{PdfFont:R,fontProgram:v}=rt,{helveticaWidths:C}=nr,k=new Map([8364,0,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,0,381,0,0,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,0,382,376].map((f,a)=>[f,a+128]));function b(f){return f>=32&&f<=126||f>=160&&f<=255?f:f?k.get(f):void 0}function p(f,a,s){if(f>=55296&&f<=57343)return{supported:!1,code:"unpaired-surrogate",message:"PDF text contains an unpaired UTF-16 surrogate."};if(f<32||f>=127&&f<160)return{supported:!1,code:"unsupported-control",message:"PDF text contains an unsupported control character."};const o=String.fromCodePoint(f);if(/[\p{Mark}\p{Format}]/u.test(o)||!/[\p{Script=Latin}\p{Script=Greek}\p{Script=Cyrillic}\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Common}]/u.test(o)||f>=4352&&f<=4607||f>=127995&&f<=127999)return{supported:!1,code:"unsupported-layout",message:"This PDF table writer supports Unicode scalar layout; complex shaping, combining sequences and bidirectional text require a shaping-capable writer."};if(!a){if(b(f)===void 0)return{supported:!1,code:"embedded-font-required",message:"Text U+"+f.toString(16).toUpperCase()+" needs an embedded Unicode TrueType font; supply fonts.regular."};const i=C.get(f===160?32:f===173?45:f);return i?{supported:!0,width:i[s?1:0]}:{supported:!1,code:"missing-glyph",message:"Standard font has no metric for this character."}}let c=a.glyph(f);if(!c&&f===8239){const i=a.glyph(8201);i&&a.offsets[i]===a.offsets[i+1]&&(c=i)}return c?{supported:!0,glyph:c,width:a.widths[c]}:{supported:!1,code:"missing-glyph",message:"The supplied font has no glyph for U+"+f.toString(16).toUpperCase()+"."}}function g(f,a){if(!f)return;if(!(f.regular instanceof R))throw new TypeError("fonts.regular must be a PdfFont.");const s=new Set;for(const[o,c]of Object.entries(f)){if(!["regular","bold","italic","boldItalic"].includes(o)||!(c instanceof R))throw new TypeError("Invalid PDF font family.");s.add(c)}if(a!==void 0&&[...s].reduce((o,c)=>o+v(c).bytes.length,0)>a)throw new S("RESOURCE_LIMIT","maxFontBytes exceeded.")}function x(f,a,s){const o=f&&(a&&s?f.boldItalic:a?f.bold:s?f.italic:f.regular),c=o??f?.regular;return{font:c,syntheticBold:!!c&&a&&!o,syntheticItalic:!!c&&s&&!o}}const m=Object.freeze({standardCode:b,resolveScalar:p,validateFonts:g,selectFont:x});return B.set("59911f0fe023545e9e97521b268551078bdc4c5f303e446a13b7d52f905e8070",m),m})(),sr=B.get("4d4736e6b8e2aaecc6f6c1b124b7e6bc0a5e141dcc725edf0ad4847d87fca1b3")??(()=>{const{NotSupportedError:S,OfficeIMOError:R}=ue,{fontProgram:v}=rt,{resolveScalar:C,selectFont:k,standardCode:b,validateFonts:p}=Lt,{pdfNumber:g,unicodeHex:x}=Ae,{checkAbort:m,pause:f,taskYieldDue:a}=be,s=Object.freeze(Array.from({length:256},(n,e)=>e.toString(16).padStart(2,"0")));function o(n){return s[n>>>8]+s[n&255]}class c{index;bold;italic;font;shared;signal;name;object;program;syntheticBold;syntheticItalic;mappings=new Map;standardWidths=new Map;constructor(e,t,l,d,u,h,w,y,T){this.index=e,this.bold=t,this.italic=l,this.font=d,this.shared=y,this.signal=T,this.name=y?.name??"F"+e,this.object=y?.object??u.reserve(),this.program=d?v(d):void 0,this.syntheticBold=h,this.syntheticItalic=w}width(e){if(this.shared)return this.shared.width(e);if(this.program){const u=this.mappings.get(e);if(u)return u.width}else{const u=this.standardWidths.get(e);if(u!==void 0)return u}const t=C(e,this.program,this.bold);if(!t.supported)throw t.code==="unpaired-surrogate"?new TypeError(t.message):new S(t.message);if(!this.program)return this.standardWidths.set(e,t.width),t.width;if(this.mappings.size>=65535)throw new R("RESOURCE_LIMIT","A PDF font supports at most 65,535 distinct Unicode scalars.");const l=this.mappings.size+1,d={cid:l,hex:o(l),glyph:t.glyph,width:t.width,text:String.fromCodePoint(e)};return this.mappings.set(e,d),d.width}lineHeight(e){return Math.max(1.3,this.program?(this.program.ascent-this.program.descent)/1e3+.1:1.3)*e}encode(e){if(this.shared)return this.shared.encode(e);let t="";for(const l of e){const d=l.codePointAt(0);if(this.program){let u=this.mappings.get(d);u||(this.width(d),u=this.mappings.get(d)),t+=u.hex}else this.standardWidths.has(d)||this.width(d),t+=s[b(d)]}return"<"+t+">"}encodeGlyph(e,t){if(this.shared)return this.shared.encodeGlyph(e,t);if(!this.program||!Number.isSafeInteger(e)||e<=0||e>=this.program.glyphCount)throw new TypeError("Invalid shaped TrueType glyph.");const l=e+":"+t;let d=this.mappings.get(l);if(!d){if(this.mappings.size>=65535)throw new R("RESOURCE_LIMIT","A PDF font supports at most 65,535 distinct CID mappings.");const u=this.mappings.size+1;d={cid:u,hex:o(u),glyph:e,width:this.program.widths[e],text:t},this.mappings.set(l,d)}return"<"+d.hex+">"}async write(e,t){if(m(this.signal),!this.program){const M="Helvetica"+(this.bold&&this.italic?"-BoldOblique":this.bold?"-Bold":this.italic?"-Oblique":"");await e.object(this.object,"<< /Type /Font /Subtype /Type1 /BaseFont /"+M+" /Encoding /WinAnsiEncoding >>");return}const l=this.program,d=[...this.mappings],u=new Set(d.map(([,M])=>M.glyph)),h=(l.canSubset?"OIMOAA+":"")+"OfficeIMOFont"+this.index,w=e.reserve(),y=e.reserve(),T=e.reserve(),O=e.reserve(),E=e.reserve(),P=new Map;for(const[M,Q]of d)if(typeof M=="number")P.set(M,Q.glyph);else for(const V of Q.text){const z=V.codePointAt(0),L=l.glyph(z);L&&(P.set(z,L),u.add(L))}const I=await l.subsetCooperatively(u,P,this.signal);await e.stream(w,I,"/Length1 "+I.length,t,!0),await e.object(y,"<< /Type /FontDescriptor /FontName /"+h+" /Flags 32 /FontBBox ["+l.bbox.map(g).join(" ")+"] /ItalicAngle 0 /Ascent "+g(l.ascent)+" /Descent "+g(l.descent)+" /CapHeight "+g(l.ascent)+" /StemV 80 /FontFile2 "+w+" 0 R >>");const A=new Uint8Array((d.length+1)*2),F=new DataView(A.buffer);for(let M=0;M<d.length;M++){const Q=d[M][1];F.setUint16(Q.cid*2,Q.glyph),(M&1023)===1023&&(a()&&await f(),m(this.signal))}await e.stream(O,A,"",t,!0),await e.object(T,"<< /Type /Font /Subtype /CIDFontType2 /BaseFont /"+h+" /CIDSystemInfo << /Registry (Adobe) /Ordering (Identity) /Supplement 0 >> /FontDescriptor "+y+" 0 R /CIDToGIDMap "+O+" 0 R"+(d.length?" /W [1 ["+d.map(([,M])=>g(M.width)).join(" ")+"]]":"")+" >>");let N="/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo << /Registry (Adobe) /Ordering (UCS) /Supplement 0 >> def\n/CMapName /OfficeIMOUnicode def\n/CMapType 2 def\n1 begincodespacerange\n<0000> <FFFF>\nendcodespacerange\n";const U=d.filter(([,M])=>M.text.length);for(let M=0;M<U.length;M+=100){const Q=U.slice(M,M+100);N+=Q.length+" beginbfchar\n";for(const[,V]of Q)N+="<"+V.hex+"> <"+x(V.text)+">\n";N+="endbfchar\n",a()&&await f(),m(this.signal)}N+="endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n",await e.stream(E,N,"",t),await e.object(this.object,"<< /Type /Font /Subtype /Type0 /BaseFont /"+h+" /Encoding /Identity-H /DescendantFonts ["+T+" 0 R] /ToUnicode "+E+" 0 R >>")}}class i{objects;fonts;maxBytes;signal;resources=[];selections=new Map;programs=new Map;explicitSelections=new Map;registered=new Set;fontBytes=0;constructor(e,t,l=16*1024*1024,d){this.objects=e,this.fonts=t,this.maxBytes=l,this.signal=d,p(t,l);for(const u of Object.values(t??{}))this.registerFont(u)}registerFont(e){if(this.registered.has(e))return;const t=v(e).bytes.length;if(this.fontBytes+t>this.maxBytes)throw new R("RESOURCE_LIMIT","maxFontBytes exceeded.");this.fontBytes+=t,this.registered.add(e)}select(e=!1,t=!1,l){l&&this.registerFont(l);let d=this.selections;if(l){const P=this.explicitSelections.get(l);d=P??new Map,P||this.explicitSelections.set(l,d)}const u=(e?2:0)|(t?1:0),h=d.get(u);if(h)return h;const{font:w,syntheticBold:y,syntheticItalic:T}=l?{font:l,syntheticBold:e,syntheticItalic:t}:k(this.fonts,e,t),O=w?this.programs.get(w):void 0,E=new c(this.resources.length+1,e,t,w,this.objects,y,T,O,this.signal);return O||(this.resources.push(E),w&&this.programs.set(w,E)),d.set(u,E),E}dictionary(){return"<< "+this.resources.map(e=>"/"+e.name+" "+e.object+" 0 R").join(" ")+" >>"}}const r=Object.freeze({PdfFontResource:c,PdfFontResources:i});return B.set("4d4736e6b8e2aaecc6f6c1b124b7e6bc0a5e141dcc725edf0ad4847d87fca1b3",r),r})(),nt=B.get("253db2c0eab1f298fda61fb40a5ddaacbf6ad12a7408ee3d8c12d27f88e7ca27")??(()=>{const{OfficeIMOError:S}=ue,{ExportCell:R,assertExportValue:v}=Se,{checkAbort:C,pause:k,taskYieldDue:b}=be,{isDate:p}=Le,{defaultBooleanText:g}=Tt;function x(i,r){return r.limits.maxTextCharacters===void 0?i:i.replace(/[\t\r\n]/g,n=>n===" "?" ":"")}function m(i,r){if(typeof i=="string")return i;throw i&&typeof i.then=="function"&&Promise.resolve(i).catch(()=>{}),new TypeError(r+" must return a synchronous string.")}function f(i,r,n){if(v(i),i instanceof R&&i.text!==void 0)return i.text;const e=i instanceof R?i.value:i;return r.formatValue?m(r.formatValue(e,n),"formatValue"):e==null?"":p(e)?Number.isFinite(e.getTime())?e.toISOString():"":typeof e=="number"&&!Number.isFinite(e)?"":typeof e=="boolean"?(r.booleanText??g)[e?"true":"false"]:String(e)}function a(i,r,n,e,t,l,d=!0){const u=o(i,r,n,e,t,l,d);for(;;){const h=u.next();if(h.done)return h.value}}async function s(i,r,n,e,t,l,d=!0,u){C(u);const h=o(i,r,n,e,t,l,d);for(;;){const w=h.next();if(w.done)return w.value;b()&&await k(),C(u)}}function*o(i,r,n,e,t,l,d){if(i.length>t)throw new S("RESOURCE_LIMIT","maxCellCharacters exceeded.");const u=[];let h=0;function w(y,T){if(u.length>=l)throw new S("RESOURCE_LIMIT","maxRowLines exceeded.");u.push({text:y.join(""),width:T})}for(const y of i.replace(/\r\n?/g,"\n").replace(/\t/g," ").split("\n")){let T=[],O=[],E=0,P=-1;for(const I of y){(++h&4095)===0&&(yield);const A=r.width(I.codePointAt(0))*n/1e3;if(A>e+.001)throw new RangeError("PDF column is too narrow for a glyph. Increase page/column width or reduce padding/font size.");if(E+A>e+.001){if(!d)throw new RangeError("Unwrapped PDF cell exceeds its column width.");const F=P>=0?P+1:T.length,N=O.slice(0,F).reduce((U,M)=>U+M,0);w(T.slice(0,F),N),T=T.slice(F),O=O.slice(F),E=O.reduce((U,M)=>U+M,0),P=-1;for(let U=0;U<T.length;U++)T[U]===" "&&(P=U);E+A>e+.001&&(w(T,E),T=[],O=[],E=0,P=-1)}T.push(I),O.push(A),E+=A,I===" "&&(P=T.length-1)}w(T,E),(++h&4095)===0&&(yield)}return u}const c=Object.freeze({pdfBudgetText:x,synchronousText:m,displayText:f,wrapText:a,wrapTextCooperatively:s});return B.set("253db2c0eab1f298fda61fb40a5ddaacbf6ad12a7408ee3d8c12d27f88e7ca27",c),c})(),ir=B.get("8be3fb029e08d100ce8ffcf50916d5ba7f7bc00d62156cc33815fd58554a9ed6")??(()=>{const{NotSupportedError:S,OfficeIMOError:R}=ue,{checkAbort:v,pause:C,taskYieldDue:k,withAbort:b}=be,p=(a,s)=>s===0||s===a.length||!(a.charCodeAt(s)>=56320&&a.charCodeAt(s)<=57343&&a.charCodeAt(s-1)>=55296&&a.charCodeAt(s-1)<=56319);function g(a,s){const o=[{text:"",owners:[]}];let c=0,i=a.runs[0]?.text.length??0;for(let r=0;r<a.text.length;){for(;r>=i&&c<a.runs.length-1;)i+=a.runs[++c].text.length;const n=a.text.codePointAt(r),e=String.fromCodePoint(n);if(r+=e.length,n>=55296&&n<=57343)throw new TypeError("PDF text contains an unpaired UTF-16 surrogate.");if(r>i&&c<a.runs.length-1)throw new S("A shaped presentation boundary cannot split a UTF-16 scalar.");if(e==="\n"||e==="\r"){if(e==="\r"&&a.text[r]==="\n"&&r++,o.length>=s)throw new R("RESOURCE_LIMIT","maxRowLines exceeded.");o.push({text:"",owners:[]});continue}if(n<32&&n!==9||n>=127&&n<160)throw new S("PDF text contains an unsupported control character.");const t=e===" "?" ":e,l=o.at(-1);if(l.text.length+t.length>4096)throw new R("RESOURCE_LIMIT","Shaped PDF text supports at most 4,096 UTF-16 units per physical paragraph.");l.text+=t;for(let d=0;d<t.length;d++)l.owners.push(c)}return o}function x(a,s,o,c,i,r){if(!Array.isArray(a)||a.length>32768)throw new TypeError("Invalid shaped run array.");let n=0,e=0;const t=new Uint8Array(c-o),l=new Map,d=new Map,u=[];for(const y of a){if(!y||!Array.isArray(y.glyphs)||!i.some(O=>O.font===y.font))throw new TypeError("Shaping must use an exact registered PdfFont identity.");if(n+=y.glyphs.length,n>32768)throw new R("RESOURCE_LIMIT","Shaped PDF text exceeded 32,768 glyphs.");const T=[];for(const O of y.glyphs){const{id:E,clusterStart:P,clusterEnd:I,xAdvance:A,yAdvance:F,xOffset:N,yOffset:U}=O??{},M=i[s.owners[P]??-1];if(!M||M.font!==y.font||!M.program||!Number.isSafeInteger(E)||E<=0||E>=M.program.glyphCount)throw new TypeError("Shaping returned an invalid glyph or font identity.");if(!Number.isSafeInteger(P)||!Number.isSafeInteger(I)||P<o||I<=P||I>c||!p(s.text,P)||!p(s.text,I))throw new TypeError("Shaping returned an invalid UTF-16 cluster range.");if(![A,F,N,U].every(z=>Number.isFinite(z)&&Math.abs(z)<=1e5)||A<0||F!==0)throw new TypeError("Shaping requires finite bounded horizontal glyph metrics.");const Q=r.runs[s.owners[P]];for(let z=P;z<I;z++){const L=r.runs[s.owners[z]];if(i[s.owners[z]].font!==y.font||Q.style.bold!==L.style.bold||Q.style.italic!==L.style.italic||Q.style.color!==L.style.color||Q.link!==L.link)throw new S("A PDF presentation, font or link boundary cannot split an indivisible shaped cluster.");t[z-o]=1}const V=l.get(P);if(V!==void 0&&V!==I)throw new TypeError("Inconsistent shaped cluster ranges.");l.set(P,I),d.set(P,(d.get(P)??0)+A),e+=A,T.push(Object.freeze({id:E,clusterStart:P,clusterEnd:I,xAdvance:A,yAdvance:F,xOffset:N,yOffset:U}))}u.push(Object.freeze({font:y.font,glyphs:Object.freeze(T)}))}if(t.some(y=>!y))throw new TypeError("Shaping omitted logical source text.");const h=[...l].sort((y,T)=>y[0]-T[0]);let w=o;for(const[y,T]of h){if(y!==w)throw new TypeError("Shaped clusters overlap or leave a logical gap.");w=T}return{runs:u,boundaries:h.map(([,y])=>y),advances:d,width:e}}async function m(a,s,o,c,i,r){const n=a.runs.map(h=>s.select(h.style.bold,h.style.italic,h.font)),e=s.select();if(n.some((h,w)=>!h.font&&a.runs[w].text.length))throw new S("Shaped PDF text requires explicit embedded TrueType fonts.");const t=[],l=i.options.textShaper,d=i.options.signal,u=(h,w,y,T)=>{if(t.length>=i.limits.maxRowLines)throw new R("RESOURCE_LIMIT","maxRowLines exceeded.");const O=[];let E=e.lineHeight(o),P=(e.program?.ascent??800)*o/1e3;const I=new Set;let A=-1,F,N=[],U=0;const M=()=>{if(A<0||!F)return;const V=a.runs[A],L=N.filter(G=>G.logicalText).sort((G,W)=>G.clusterStart-W.clusterStart).map(G=>G.logicalText).join("");O.push({text:L,actualText:L,logicalStart:Math.min(...N.map(G=>G.clusterStart)),width:U*o/1e3,font:F,glyphs:N,...V.style.color===void 0?{}:{color:V.style.color},...V.link?{link:V.link}:{}}),N=[],U=0};for(const V of T?.runs??[])for(const z of V.glyphs){const L=h.owners[z.clusterStart],G=n[L];(A!==L||F!==G)&&(M(),A=L,F=G);const W=I.has(z.clusterStart)?"":h.text.slice(z.clusterStart,z.clusterEnd);I.add(z.clusterStart),N.push({...z,logicalText:W}),U+=z.xAdvance,E=Math.max(E,G.lineHeight(o)),P=Math.max(P,G.program.ascent*o/1e3)}M();const Q=h.text.slice(w,y);t.push({text:Q,actualText:Q,segments:O,width:(T?.width??0)*o/1e3,lineHeight:E,ascent:P})};for(const h of g(a,i.limits.maxRowLines)){if(v(d),!h.text){u(h,0,0);continue}const w=[];for(let I=0;I<h.text.length;){const A=h.owners[I];let F=I+1;for(;F<h.text.length&&h.owners[F]===A;)F++;w.push(Object.freeze({start:I,end:F,font:n[A].font})),I=F}Object.freeze(w);let y=0;const T=async(I,A)=>{if(++y>16385)throw new R("RESOURCE_LIMIT","Shaped line fitting exceeded its bounded work limit.");k()&&await C(),v(d);const F=await b(Promise.resolve(l.shapeLine(Object.freeze({text:h.text,start:I,end:A,runs:w,direction:i.options.textDirection??"auto",...d?{signal:d}:{}}))),d);return v(d),x(F,h,I,A,n,a)},O=await T(0,h.text.length),E=O.boundaries;if(!r){if(O.width*o/1e3>c+.001)throw new RangeError("Unwrapped PDF cell exceeds its column width.");u(h,0,h.text.length,O);continue}let P=0;for(;P<E.length;){const I=P?E[P-1]:0;let A=P,F=0,N=-1;for(;A<E.length;){const M=A?E[A-1]:0,Q=O.advances.get(M)*o/1e3;if(F+Q>c+.001&&A>P||(F+=Q,h.text[E[A]-1]===" "&&(N=A+1),A++,F>c+.001))break}A<E.length&&N>P&&(A=N);let U=I===0&&A===E.length?O:await T(I,E[A-1]);if(U.width*o/1e3>c+.001){let M=P+1,Q=A-1,V,z=0;for(;M<=Q;){const L=Math.floor((M+Q)/2),G=await T(I,E[L-1]);G.width*o/1e3<=c+.001?(V=G,z=L,M=L+1):Q=L-1}if(!V)throw new RangeError("PDF column is too narrow for an indivisible shaped cluster.");U=V,A=z}u(h,I,E[A-1],U),P=A}}return t}const f=Object.freeze({wrapShapedPdfText:m});return B.set("8be3fb029e08d100ce8ffcf50916d5ba7f7bc00d62156cc33815fd58554a9ed6",f),f})(),ft=B.get("0a1c79b51ac9a164b86197239117df6497f45ca2892b423b1ec77a663ccc1c47")??(()=>{const{NotSupportedError:S,OfficeIMOError:R}=ue,{copyExportLink:v}=it,{checkAbort:C,pause:k,taskYieldDue:b}=be,{presentation:p,color:g}=je,{wrapShapedPdfText:x}=ir,{PdfFont:m}=rt,{pdfBudgetText:f}=nt;function a(c,i,r,n,e=!0,t=!0){if(typeof c=="string"){if(c.length>r.limits.maxCellCharacters)throw new R("RESOURCE_LIMIT","maxCellCharacters exceeded.");return t&&(c.length||e)&&r.budget.reserve(1,f(c,r.budget).length),Object.freeze({text:c,runs:Object.freeze([Object.freeze({text:c,style:i})])})}const l=c;if(!Array.isArray(l))throw l&&typeof l.then=="function"&&Promise.resolve(l).catch(()=>{}),new TypeError("PDF text must be a string or a synchronous array of text runs.");if(l.length>r.limits.maxTextRuns)throw new R("RESOURCE_LIMIT","maxTextRuns exceeded.");let d=0,u=0;const h=[];for(const w of l){if(!w||typeof w!="object"||Object.keys(w).some(F=>!["text","bold","italic","color","link","font"].includes(F)))throw new TypeError("PDF text runs support text, bold, italic, color, link and font.");const{text:y,bold:T,italic:O,color:E,link:P,font:I}=w;if(typeof y!="string")throw new TypeError("PDF run text must be a string.");if(I!==void 0){if(!(I instanceof m))throw new TypeError("A PDF run font must be a PdfFont.");n.registerFont(I)}if(d+=y.length,d>r.limits.maxCellCharacters)throw new R("RESOURCE_LIMIT","maxCellCharacters exceeded.");t&&(u+=f(y,r.budget).length);const A=p({...i,...T===void 0?{}:{bold:T},...O===void 0?{}:{italic:O},...E===void 0?{}:{color:E}});if(r.options.tagged&&P!==void 0&&y.length&&!y.trim())throw new TypeError("Tagged PDF inline links require nonempty displayed text.");h.push(Object.freeze({text:y,style:A,...I===void 0?{}:{font:I},...P===void 0?{}:{link:v(P)}}))}return t&&(d||e)&&r.budget.reserve(1,u),Object.freeze({text:h.map(w=>w.text).join(""),runs:Object.freeze(h)})}async function s(c,i,r,n,e,t=!0){if(e.options.textShaper)return x(c,i,r,n,e,t);const{signal:l}=e.options,{text:d,runs:u}=c;C(l);const h=u.length===1?u[0]:void 0,w=h&&i.select(h.style.bold,h.style.italic,h.font),y=w?void 0:u.map(L=>i.select(L.style.bold,L.style.italic,L.font)),T=i.select();if(h&&d.length>0&&d.length<4096){const L=h,G=w;let W=0,K=!0;for(let X=0;X<d.length;){const Z=d.codePointAt(X);if(Z===9||Z===10||Z===13){K=!1;break}const se=G.width(Z)*r/1e3;if(se>n+.001||W+se>n+.001){K=!1;break}W+=se,X+=Z>65535?2:1}if(K){if(e.limits.maxRowLines<1)throw new R("RESOURCE_LIMIT","maxRowLines exceeded.");return[{text:d,width:W,segments:[{text:d,width:W,font:G,...L.style.color===void 0?{}:{color:L.style.color},...L.link?{link:L.link}:{}}],lineHeight:G.lineHeight(r),ascent:Math.max(0,(G.program?.ascent??800)*r/1e3)}]}}const O=y??[w],E=[];let P=[],I=[],A=[],F=0,N=-1,U=0,M=u[0]?.text.length??0,Q=0;const V=L=>{if(E.length>=e.limits.maxRowLines)throw new R("RESOURCE_LIMIT","maxRowLines exceeded.");const G=[];let W=0,K=0,X=0;for(let Z=0;Z<L;){const se=A[Z],D=u[se],q=O[se];let J=Z+1;for(;J<L&&A[J]===se;)J++;const re=I.slice(Z,J).reduce((le,oe)=>le+oe,0);G.push({text:P.slice(Z,J).join(""),width:re,font:q,...D.style.color===void 0?{}:{color:D.style.color},...D.link?{link:D.link}:{}}),W+=re,K=Math.max(K,q.lineHeight(r)),X=Math.max(X,(q.program?.ascent??800)*r/1e3),Z=J}if(!G.length){const Z=O[0]??T;G.push({text:"",width:0,font:Z,...u[0]?.style.color===void 0?{}:{color:u[0].style.color}}),K=Z.lineHeight(r),X=(Z.program?.ascent??800)*r/1e3}E.push({text:P.slice(0,L).join(""),width:W,segments:G,lineHeight:K,ascent:X}),P=P.slice(L),I=I.slice(L),A=A.slice(L),F=I.reduce((Z,se)=>Z+se,0),N=-1;for(let Z=0;Z<P.length;Z++)P[Z]===" "&&(N=Z)},z=(L,G)=>{const W=O[G].width(L.codePointAt(0))*r/1e3;if(W>n+.001)throw new RangeError("PDF column is too narrow for a glyph. Increase page/column width or reduce padding/font size.");if(F+W>n+.001){if(!t)throw new RangeError("Unwrapped PDF cell exceeds its column width.");V(N>=0?N+1:P.length),F+W>n+.001&&V(P.length)}P.push(L),I.push(W),A.push(G),F+=W,L===" "&&(N=P.length-1)};for(let L=0;L<d.length;){for(;L>=M&&U<u.length-1;)M+=u[++U].text.length;const G=U,W=d.codePointAt(L),K=String.fromCodePoint(W);if(L+K.length>M&&U<u.length-1){let X=U+1;for(;!u[X].text.length;)X++;const Z=u[G],se=u[X],D=O[G],q=O[X];if(!(D.font===q.font&&(D.font?D.syntheticBold===q.syntheticBold&&D.syntheticItalic===q.syntheticItalic:D.bold===q.bold&&D.italic===q.italic))||g(Z.style.color??"111827")!==g(se.style.color??"111827")||Z.link?.target!==se.link?.target||Z.link?.tooltip!==se.link?.tooltip)throw new S("A PDF presentation boundary cannot split a UTF-16 scalar.")}if(L+=K.length,K==="\r"||K==="\n")K==="\r"&&d[L]==="\n"&&L++,V(P.length);else if(K===" ")for(let X=0;X<4;X++)z(" ",G);else z(K,G);(++Q&4095)===0&&(b()&&await k(),C(l))}return V(P.length),E}const o=Object.freeze({capturePdfText:a,wrapPdfText:s});return B.set("0a1c79b51ac9a164b86197239117df6497f45ca2892b423b1ec77a663ccc1c47",o),o})(),or=B.get("2f40af05ba09102fe440c1d46385b64cecdd233371771796c9ae4e8d523f2cea")??(()=>{const{OfficeIMOError:S}=ue,{wrapPdfText:R}=ft;function v(p,g){if(typeof g.options.wideTable!="object")return;const m=g.page.width-g.margins.left-g.margins.right,f=g.repeatedColumns,a=new Set(f),s=p.map((n,e)=>e).filter(n=>!a.has(n)),o=f.reduce((n,e)=>n+p[e],0);if(o>m+.001)throw new RangeError("Repeated PDF columns exceed the printable width.");const c=[];let i=[...f],r=o;for(const n of s){const e=p[n];if(o+e>m+.001)throw new RangeError("A PDF column and its repeated identifiers cannot fit a band.");r+e>m+.001&&(c.push(i),i=[...f],r=o),i.push(n),r+=e}if(i.length&&c.push(i),c.length>g.limits.maxTableBands)throw new S("RESOURCE_LIMIT","maxTableBands exceeded.");if(g.limits.maxTableWindowRows<1)throw new S("RESOURCE_LIMIT","maxTableWindowRows must allow at least one row fragment.");return Object.freeze(c.map(n=>{let e=g.margins.left;const t=n.map(l=>{const d=e;return e+=p[l],d});return Object.freeze({columns:Object.freeze(n),lefts:Object.freeze(t)})}))}async function C(p,g,x,m,f){const a=[];for(const s of p){const o=[];for(const c of s.cells){if(c.span===1){const i=g.columns.indexOf(c.first);i>=0&&o.push({...c,source:c.source??c,first:i});continue}for(let i=0;i<g.columns.length;){const r=g.columns[i];if(r<c.first||r>=c.first+c.span){i++;continue}let n=i+1;for(;n<g.columns.length&&g.columns[n]===g.columns[n-1]+1&&g.columns[n]<c.first+c.span;)n++;const e=g.columns.slice(i,n).reduce((l,d)=>l+x[d],0),t=await R(c.captured,f,m.fontSize,e-m.padding*2,m,c.style.wrapText!==!1);o.push({...c,source:c.source??c,first:i,span:n-i,width:e,lines:t,lineHeight:t.reduce((l,d)=>Math.max(l,d.lineHeight),c.font.lineHeight(m.fontSize))}),i=n}}o.sort((c,i)=>c.first-i.first),a.push({...s,source:s.source??s,cells:o})}return a}function k(p,g){if(!p.length||!p[0].length)return p;const x=p[0].length,m=Array.from({length:x},(f,a)=>Math.max(...p.map(s=>Math.max(g.padding*2+s[a].lineHeight,...s[a].cells.filter(o=>(o.rowSpan??1)===1).map(o=>o.lines.length*o.lineHeight+g.padding*2)))));for(const f of p)for(const[a,s]of f.entries())for(const o of s.cells){const c=o.rowSpan??1,i=m.slice(a,a+c).reduce((n,e)=>n+e,0),r=o.lines.length*o.lineHeight+g.padding*2;if(r>i)for(let n=a;n<a+c;n++)m[n]+=(r-i)/c}return p.map(f=>f.map((a,s)=>({...a,structured:!0,height:m[s],cells:a.cells.map(o=>({...o,height:m.slice(s,s+(o.rowSpan??1)).reduce((c,i)=>c+i,0)}))})))}const b=Object.freeze({planTableBands:v,projectBandRows:C,alignBandBlocks:k});return B.set("2f40af05ba09102fe440c1d46385b64cecdd233371771796c9ae4e8d523f2cea",b),b})(),Ct=B.get("ad81357e627d3100e1068a8ce521aa1c1cd65de5c6c6ab36f807a3e5da50d874")??(()=>{const{ExportCell:S}=Se,{copyExportLink:R}=it,{tableSpans:v}=Ye,{createTotals:C}=gt,{presentation:k,positive:b}=je,{displayText:p,pdfBudgetText:g}=nt,{capturePdfText:x,wrapPdfText:m}=ft,{planTableBands:f,projectBandRows:a,alignBandBlocks:s}=or;class o{settings;fonts;bands;widths;lefts;lineHeight;headings;totals;repeatedColumns;structuredBandRows=new WeakMap;dataPresentations=[];constructor(r,n){this.settings=r,this.fonts=n;const{options:e,padding:t,fontSize:l,page:d,margins:u}=r,h=e.columns,w=d.width-u.left-u.right;this.repeatedColumns=new Set(r.repeatedColumns);let y;if(e.columnWidths&&e.columnWidths.length!==h.length)throw new RangeError("columnWidths must declare one point width per column.");const T=typeof e.wideTable=="object"?e.wideTable.minimumColumnWidth??72:0,O=h.map((F,N)=>b(e.columnWidths?.[N]??Math.max(T,F.width===void 0?w/h.length:b(F.width,"Column width",255)*(y??=n.select().width(48)*l/1e3)+t*2),"PDF column width")),E=O.reduce((F,N)=>F+N,0);if(E>w+.001&&e.wideTable==="reject")throw new RangeError("Table widths exceed the printable page width.");this.bands=f(O,r),this.widths=!this.bands&&E>w?O.map(F=>F*w/E):O;let P=u.left;if(this.lefts=this.widths.map(F=>{const N=P;return P+=F,N}),this.widths.some(F=>F<=t*2))throw new RangeError("Page is too narrow for this many columns and the requested padding.");this.lineHeight=n.select().lineHeight(l);const I=h.reduce((F,N)=>Math.max(F,N.groups?.length??0),0);if(I>16)throw new RangeError("Grouped headings support at most 16 levels.");if(I&&e.includeHeader===!1)throw new TypeError("Grouped headings require leaf headings.");const A=[];if(e.includeHeader!==!1){for(let F=0;F<I;F++){const N=[];for(let U=0;U<h.length;){let M=U;const Q=h[U].groups?.[F]??"",V=JSON.stringify(h[U].groups?.slice(0,F+1));for(;Q&&M+1<h.length&&JSON.stringify(h[M+1].groups?.slice(0,F+1))===V;)M++;N.push({first:U,span:M-U+1,text:Q}),U=M+1}A.push(N)}A.push(h.map((F,N)=>({first:N,span:1,text:F.header})))}this.headings=A,this.totals=C(h,e.footer?.totals)}async cell(r,n,e,t,l,d=!1){const{options:u,padding:h,fontSize:w,budget:y}=this.settings,T=u.columns[n],O=r instanceof S?r.presentation:void 0,E=r instanceof S&&r.link?R(r.link):void 0,P=d&&t%2&&u.alternateRowColor?u.alternateRowColor:void 0,I=n*2+(P?1:0),A=d&&O===void 0;let F=A?this.dataPresentations[I]:void 0;if(!F){const W=d?P?{background:P}:{}:l;F=k({...T.alignment===void 0?{}:{alignment:T.alignment},...T.wrapText===void 0?{}:{wrapText:T.wrapText},...W,...O}),A&&(this.dataPresentations[I]=F)}const N=this.fonts.select(F.bold,F.italic),U=e===1?this.widths[n]:this.widths.slice(n,n+e).reduce((W,K)=>W+K,0),M={rowIndex:t,columnIndex:n,column:T},Q=r instanceof S?r.value:r;let V;if(u.formatRuns&&t>=0&&!(r instanceof S&&r.text!==void 0)){const W=u.formatRuns(Q,M);if(!Array.isArray(W))throw W&&typeof W.then=="function"&&Promise.resolve(W).catch(()=>{}),new TypeError("formatRuns must return a synchronous array of PDF text runs.");V=W}else V=p(r,u,M);const z=x(V,F,this.settings,this.fonts);if(u.tagged&&E&&!z.text.trim())throw new TypeError("Tagged PDF cell links require nonempty displayed text.");if(E&&z.runs.some(W=>W.link))throw new TypeError("A PDF cell link cannot be combined with inline run links.");const L=g(z.text,y);this.bands?y.release(1,L.length):y.cell(L,L.length);const G=await m(z,this.fonts,w,U-h*2,this.settings,F.wrapText!==!1);return{first:n,span:e,width:U,font:N,style:F,lineHeight:G.reduce((W,K)=>Math.max(W,K.lineHeight),N.lineHeight(w)),...E?{link:E}:{},...this.bands?{captured:z}:{},lines:G}}row(r){let n=1,e=this.lineHeight;for(let t=0;t<r.length;t++){const l=r[t];n=Math.max(n,l.lines.length),e=Math.max(e,l.lineHeight)}return{cells:r,lines:n,lineHeight:e,height:n*e+this.settings.padding*2}}async headers(){if(this.settings.options.headerRows)return this.block(this.settings.options.headerRows,this.settings.options.headerPresentation??{});const{formatValue:r,...n}=this.settings.options,e=[];for(const t of this.headings){const l=[];for(const d of t)l.push(await this.cell(new S(d.text,{text:d.text}),d.first,d.span,-1,n.headerPresentation??{}));e.push(this.row(l))}return e}async block(r,n){const e=v(r,this.settings.options.columns.length),{formatValue:t,...l}=this.settings.options,d=[];for(const h of e){const w=[];for(const y of h){const T=y.value instanceof S?y.value:new S(y.value),O=new S(T.value,{text:p(T,l,{rowIndex:-1,columnIndex:y.first,column:l.columns[y.first]}),...T.presentation?{presentation:T.presentation}:{},...T.link?{link:T.link}:{}});w.push({...await this.cell(O,y.first,y.span,-1,n),rowSpan:y.rowSpan})}d.push(w)}const u=d.map(h=>Math.max(this.lineHeight+this.settings.padding*2,...h.filter(w=>w.rowSpan===1).map(w=>w.lines.length*w.lineHeight+this.settings.padding*2)));return d.forEach((h,w)=>h.forEach(y=>{const T=u.slice(w,w+y.rowSpan).reduce((E,P)=>E+P,0),O=y.lines.length*y.lineHeight+this.settings.padding*2;if(O>T)for(let E=w;E<w+y.rowSpan;E++)u[E]+=(O-T)/y.rowSpan})),d.map((h,w)=>({cells:h.map(y=>({...y,height:u.slice(w,w+y.rowSpan).reduce((T,O)=>T+O,0)})),lines:Math.max(1,Math.ceil((u[w]-this.settings.padding*2)/this.lineHeight)),lineHeight:this.lineHeight,height:u[w],structured:!0}))}minimumRowLines(r){let n=1;if(this.bands)for(const e of r.cells)this.repeatedColumns.has(e.first)&&(n=Math.max(n,e.lines.length));return n}minimumRowHeight(r){return this.minimumRowLines(r)*r.lineHeight+this.settings.padding*2}repeatedColumn(r){return this.repeatedColumns.has(r)}async blockHeight(r){return(this.bands?(await this.bandRows(r,!0))[0]:r).reduce((e,t)=>e+t.height,0)}async bandRows(r,n=!1){if(!this.bands)throw new Error("Horizontal bands were not planned.");if(!n)return this.projectBandRows(r,!1);let e=this.structuredBandRows.get(r);return e||(e=this.projectBandRows(r,!0),this.structuredBandRows.set(r,e)),e}async projectBandRows(r,n){const e=[],t=new Set;for(const l of this.bands){const d=await a(r,l,this.widths,this.settings,this.fonts);e.push(d.map(u=>({...u,cells:u.cells.map(h=>{const w=h.source,y=t.has(w);return t.add(w),y?{...h,semanticArtifact:!0}:h})})))}return n?s(e,this.settings):e}async data(r,n,e=!1){const{options:t}=this.settings,l=[];for(let d=0;d<t.columns.length;d++){const u=r[d],h=u instanceof S?u.value:u;e||this.totals[d].accept(h);const w=await this.cell(u,d,1,n,e?t.footerPresentation??{}:void 0,!e);l.push(!e&&t.columns[d].rowHeader?{...w,rowHeader:!0}:w)}return this.row(l)}async footer(r){if(!this.settings.options.footer)return;if(this.settings.options.footer.rows)return this.block(this.settings.options.footer.rows,this.settings.options.footerPresentation??{});const n=this.totals.map((e,t)=>e.operation?e.value():this.settings.options.footer?.values?.[t]);return[await this.data(n,r,!0)]}}const c=Object.freeze({PdfTableLayout:o});return B.set("ad81357e627d3100e1068a8ce521aa1c1cd65de5c6c6ab36f807a3e5da50d874",c),c})(),ar=B.get("9ea74d93c18250e809a7be745444b886bcd5ec924a78e6ab004d649789db1f72")??(()=>{const{OfficeIMOError:S}=ue,{checkAbort:R}=be;class v{layout;headings;painter;caption;continuation;entries=[];height=0;count=0;firstWindow=!0;firstCapacity;painted=!1;constructor(b,p,g,x,m){this.layout=b,this.headings=p,this.painter=g,this.caption=x,this.continuation=m,this.firstCapacity=g.firstCapacity}get capacity(){return this.firstWindow?this.firstCapacity:this.painter.continuationCapacity}async accept(b){if(this.entries.length&&(this.height+b.height>this.capacity+.001||this.count+b.count>this.layout.settings.limits.maxTableWindowRows)&&await this.flush(),this.firstWindow&&!this.entries.length&&b.height>this.capacity+.001&&b.height<=this.painter.firstFullCapacity+.001&&(await this.painter.moveFirstToFreshPage(),this.firstCapacity=this.painter.firstFullCapacity),b.height>this.capacity+.001)throw new RangeError("PDF band window cannot fit the requested table fragment.");this.entries.push(b),this.height+=b.height,this.count+=b.count,this.count>=this.layout.settings.limits.maxTableWindowRows&&await this.flush()}async row(b,p=!1){const{padding:g,fontSize:x,options:m}=this.layout.settings,f=this.layout.minimumRowLines(b),a=f*b.lineHeight+g*2;if(a>this.painter.firstFullCapacity+.001||a>this.painter.continuationCapacity+.001)throw new RangeError("Repeated PDF identifiers must fit intact below the first and continued band headings/context.");this.entries.length&&b.height<=this.painter.continuationCapacity+.001&&b.height>this.capacity-this.height+.001&&await this.flush(),!p&&this.firstWindow&&!this.entries.length&&b.height>this.capacity+.001&&b.height<=this.painter.firstFullCapacity+.001&&(await this.painter.moveFirstToFreshPage(),this.firstCapacity=this.painter.firstFullCapacity),await this.painter.prepareRow?.(b);let s=0;for(;s<b.lines;){if(R(m.signal),this.entries.length&&this.capacity-this.height+.001<a&&await this.flush(),this.firstWindow&&!this.entries.length&&this.capacity+.001<a&&(await this.painter.moveFirstToFreshPage(),this.firstCapacity=this.painter.firstFullCapacity),this.capacity-this.height+.001<a)throw new RangeError("PDF band window cannot fit its complete repeated identifiers.");const o=Math.min(b.lines-s,Math.floor((this.capacity-this.height-g*2+.001)/b.lineHeight));if(o<1)throw new RangeError("PDF page cannot fit a table line below horizontal band headings.");const c=Math.max(o,f),i=c*b.lineHeight+g*2,r=await this.layout.bandRows([b]),n=[],e=r.map((t,l)=>{let d=!1;const u=t[0].cells.map(y=>{const T=this.layout.bands[l].columns[y.first],O=this.layout.repeatedColumn(T),E=y.span===1&&(y.source?.span??1)===1&&(y.rowSpan??1)===1&&y.height===void 0&&s===0&&(O||o>=y.lines.length),P=O||E?y.lines:y.lines.slice(s,s+o);if(!O&&(P.length>0||y.link!==void 0)&&(d=!0),E)return y;const{height:I,...A}=y;return{...A,lines:P,lineHeight:P.reduce((F,N)=>Math.max(F,N.lineHeight),y.font.lineHeight(x)),...s>0&&O?{semanticArtifact:!0}:{}}}),h=Math.max(1,...u.map(y=>y.lines.length)),w=Math.max(this.layout.lineHeight,...u.filter(y=>y.lines.length>0).map(y=>y.lineHeight));return n.push(s>0&&!d),[{...t[0],cells:u,lines:h,lineHeight:w,height:h*w+g*2}]});await this.accept({rows:e,height:i,count:1,completed:s+o>=b.lines?[b]:[],exhaustedBands:n}),s+=o,s<b.lines&&await this.flush()}}async block(b){const p=await this.layout.bandRows(b,!0),g=p[0].reduce((x,m)=>x+m.height,0);if(b.length>this.layout.settings.limits.maxTableWindowRows)throw new S("RESOURCE_LIMIT","A structured PDF block exceeds maxTableWindowRows.");for(const x of b)await this.painter.prepareRow?.(x);await this.accept({rows:p,height:g,count:b.length,completed:b,exhaustedBands:p.map(()=>!1)})}async keptRows(b,p=!1){const g=b.reduce((m,f)=>m+f.height,0),x=g<=this.painter.continuationCapacity+.001;this.entries.length&&x&&g>this.capacity-this.height+.001&&await this.flush();for(const[m,f]of b.entries())await this.row(f,!x&&m===0&&p)}async flush(b=!1){if(!(!this.entries.length&&(!b||this.painted||!this.headings.some(p=>p.length)))){for(let p=0;p<this.layout.bands.length;p++)R(this.layout.settings.options.signal),!(!this.firstWindow&&this.entries.length>0&&this.entries.every(g=>g.exhaustedBands[p]))&&await this.painter.paint(p,this.headings[p],this.entries.flatMap(g=>g.rows[p]),this.firstWindow?this.caption:this.continuation,this.firstWindow,p===0);for(const p of this.entries)for(const g of p.completed)await this.painter.completeRow?.(g);this.entries=[],this.height=0,this.count=0,this.firstWindow=!1,this.painted=!0}}}const C=Object.freeze({PdfTableBandFlow:v});return B.set("9ea74d93c18250e809a7be745444b886bcd5ec924a78e6ab004d649789db1f72",C),C})(),cr=B.get("9deed79565a5da5009f7a01579df8d6a3f019b78eb7b17d831c7964840e9a6bf")??(()=>{class S{structure;table;headers;cells=new WeakMap;rows=new WeakMap;columnHeaders=[];ordinaryAttributes=[];headerCount=0;headersPrepared=!1;constructor(C,k,b){this.structure=C,this.table=k,this.headers=b}async prepareHeaders(){if(!this.headersPrepared){for(let C=0;C<this.headers.length;C++){const k=this.headers[C],b=this.structure.element("TR",this.table);this.rows.set(k,b);for(const p of k.cells){const g=p.lines.some(f=>f.text.trim().length>0),x=this.associations(p,C),m=this.structure.element(g?"TH":"TD",b,this.attributes(p,x,g?"Column":void 0));if(this.cells.set(p,m),g){const f={row:C,order:this.headerCount++,identifier:await this.structure.identifier(m)};for(let a=p.first;a<p.first+p.span;a++)(this.columnHeaders[a]??=[]).push(f)}}}this.headersPrepared=!0}}async completeHeaders(){for(const C of this.headers)await this.completeRow(C)}async prepareRow(C,k="data",b=this.table,p){if(this.rows.get(C)!==void 0)return C.cells.map(a=>this.cells.get(a));const x=this.structure.element("TR",b);this.rows.set(C,x);const m=C.cells.map((a,s)=>{const o=p===void 0?a.rowHeader===!0:s===p,c=this.structure.element(o?"TH":"TD",x);return this.cells.set(a,c),c});let f;for(let a=0;a<m.length;a++)(p===void 0?C.cells[a].rowHeader===!0:a===p)&&(f??=[]).push(await this.structure.identifier(m[a]));for(let a=0;a<C.cells.length;a++){const s=C.cells[a];if(!f&&s.span===1&&(s.rowSpan??1)===1){const i=this.ordinaryAttributes[s.first]??=await this.structure.attributeReference(this.attributeDictionary(s,this.associations(s)));this.structure.setAttributes(m[a],i);continue}const o=this.associations(s),c=p===void 0?s.rowHeader===!0:a===p;!c&&f&&o.push(...f),this.structure.setAttributes(m[a],this.attributes(s,o,c?"Row":void 0))}return m}owner(C){return this.cells.get(C)}async completeRow(C){await this.structure.complete(this.rows.get(C))}async finish(){await this.completeHeaders(),await this.structure.complete(this.table)}associations(C,k=Number.POSITIVE_INFINITY){if(C.span===1)return(this.columnHeaders[C.first]??[]).filter(p=>p.row<k).map(p=>p.identifier);const b=new Set;for(let p=C.first;p<C.first+C.span;p++)for(const g of this.columnHeaders[p]??[])g.row<k&&b.add(g);return[...b].sort((p,g)=>p.order-g.order).map(p=>p.identifier)}attributes(C,k,b){return" /A "+this.attributeDictionary(C,k,b)}attributeDictionary(C,k,b){return"<< /O /Table"+(b===void 0?"":" /Scope /"+b)+(C.span>1?" /ColSpan "+C.span:"")+((C.rowSpan??1)>1?" /RowSpan "+C.rowSpan:"")+(k.length?" /Headers ["+k.map(p=>"("+p+")").join(" ")+"]":"")+" >>"}}const R=Object.freeze({PdfTableStructure:S});return B.set("9deed79565a5da5009f7a01579df8d6a3f019b78eb7b17d831c7964840e9a6bf",R),R})(),lr=B.get("09c712096a1028af340e275d5a273e870546413797e71ed709657ad0482ea170")??(()=>{const{OfficeIMOError:S}=ue,{pdfNumber:R,unicodeHex:v}=Ae,C=new TextEncoder;function k(p,g,x,m,f,a,s,o){const c="<< /Type /Annot /Subtype /Link /F 4 /Border [0 0 0] /Rect ["+[g,x,g+m,x+f].map(R).join(" ")+"]"+(s===void 0?"":" /StructParent "+s)+(o===void 0?"":" /P "+o+" 0 R")+" /A << /S /URI /URI <",i="> >>"+(p.tooltip===void 0?"":" /Contents <feff")+" >>",r=c.length+i.length+(p.tooltip===void 0?0:p.tooltip.length*4+1),n=()=>{throw new S("RESOURCE_LIMIT","maxPageBytes exceeded.")};r+p.target.length*2>a&&n();let e=0;for(let l=0;l<p.target.length;l++){const d=p.target.charCodeAt(l);d<128?e++:d<2048?e+=2:d>=55296&&d<=56319&&l+1<p.target.length&&p.target.charCodeAt(l+1)>=56320&&p.target.charCodeAt(l+1)<=57343?(e+=4,l++):e+=3,r+e*2>a&&n()}let t="";for(const l of C.encode(p.target))t+=l.toString(16).padStart(2,"0");return c+t+"> >>"+(p.tooltip===void 0?"":" /Contents <feff"+v(p.tooltip)+">")+" >>"}const b=Object.freeze({linkAnnotation:k});return B.set("09c712096a1028af340e275d5a273e870546413797e71ed709657ad0482ea170",b),b})(),St=B.get("c68d18d668366fb9b96d1b53c79dc6305f84cb83c05e4942fcf1cdf96ed1a73f")??(()=>{const{OfficeIMOError:S}=ue,{unicodeHex:R}=Ae,{captureFields:v}=ke;function C(p,g){if(p===void 0)return;if(!p||typeof p!="object")throw new TypeError("PDF bookmark must provide a title and optional level.");const{title:x,level:m=1}=p;if(typeof x!="string"||!x.trim())throw new TypeError("PDF bookmark title must be nonempty text.");if(x.length>g.limits.maxCellCharacters)throw new S("RESOURCE_LIMIT","maxCellCharacters exceeded by bookmark title.");if(!Number.isInteger(m)||m<1||m>6)throw new TypeError("PDF bookmark level must be an integer from 1 through 6.");return R(x),Object.freeze({title:x,level:m})}function k(p,g){if(!p||p.kind!=="section")throw new TypeError("PDF section boundary required.");if(Object.keys(p).some(l=>!["kind","title","level","includeHeading","bookmark","headingStyle","pageSize","orientation","margins","pageHeader","pageFooter","pageNumbers"].includes(l)))throw new TypeError("PDF sections support title, heading/bookmark controls, page geometry and decorations only.");const{title:x,level:m,includeHeading:f=!0,bookmark:a=!0,headingStyle:s,pageSize:o,orientation:c,margins:i,pageHeader:r,pageFooter:n,pageNumbers:e}=p,t=C({title:x,...m===void 0?{}:{level:m}},g);for(const[l,d]of[["includeHeading",f],["bookmark",a],["pageNumbers",e]])if(d!==void 0&&typeof d!="boolean")throw new TypeError("PDF section "+l+" must be boolean.");if(s!==void 0&&(typeof s!="string"||!s.trim()))throw new TypeError("PDF section headingStyle must be nonempty text.");return Object.freeze({kind:"section",title:t.title,level:t.level,includeHeading:f,bookmark:a,...s===void 0?{}:{headingStyle:s},...o===void 0?{}:{pageSize:typeof o=="object"?Object.freeze(v(o,["width","height"])):o},...c===void 0?{}:{orientation:c},...i===void 0?{}:{margins:typeof i=="object"?Object.freeze(v(i,["top","right","bottom","left"])):i},...r===void 0?{}:{pageHeader:r},...n===void 0?{}:{pageFooter:n},...e===void 0?{}:{pageNumbers:e}})}const b=Object.freeze({captureBookmark:C,captureSection:k});return B.set("c68d18d668366fb9b96d1b53c79dc6305f84cb83c05e4942fcf1cdf96ed1a73f",b),b})(),dr=B.get("a66257a32f03d958aa57be4de9da7f80b708cebca26b5cc6404de0ee11bfe052")??(()=>{const{settings:S}=je;function R(C,k){const{pageSize:b,orientation:p,margins:g,pageHeader:x,pageFooter:m,pageNumbers:f}=k,a={...C.options,...b===void 0?{}:{pageSize:b},...p===void 0?{}:{orientation:p},...g===void 0?{}:{margins:g},...x===void 0?{}:{pageHeader:x},...m===void 0?{}:{pageFooter:m},...f===void 0?{}:{pageNumbers:f}},s=S(a,!0);return{...C,page:s.page,margins:s.margins,options:a}}const v=Object.freeze({sectionSettings:R});return B.set("a66257a32f03d958aa57be4de9da7f80b708cebca26b5cc6404de0ee11bfe052",v),v})(),hr=B.get("3ed7114181be5a3066742336da574fef7f2fc04ee6dfc5e64211f3bedad4cab9")??(()=>{const{OfficeIMOError:S}=ue,{checkAbort:R}=be,{pdfNumber:v}=Ae,{color:C}=je,{PdfTableBandFlow:k}=ar,{PdfTableStructure:b}=cr,{wrapText:p,wrapTextCooperatively:g,synchronousText:x,pdfBudgetText:m}=nt,{linkAnnotation:f}=lr,{unicodeHex:a}=Ae,{captureSection:s,captureBookmark:o}=St,{sectionSettings:c}=dr;class i{objects;baseSettings;fonts;parent;resources;layout;structure;outlines;references=[];current=0;commands="";commandParts=[];commandBytes=0;annotations=[];hyperlinks=0;y=0;dataTop=0;continuationTop=0;totalPages;numberSettings;activeSettings;pendingPage;bodyAdded=!1;sectionCount=0;sectionPages=0;sectionTitle;pendingBookmarks=[];pageNumberWidth=0;colors=new Map;textFont;textSize=0;textColor="";textPrefix="";rectangleLefts;rectangleColumns=[];externalObjects=new Map;bandFlow;bandCellBudget=!1;tableElement;tableStructure;activeHeadings;paintedHeaderCells=new WeakSet;paintedHeaderBudgetCells=new WeakSet;summaryRows=new WeakSet;groups=[];continuationCaption;tableCaptionOwner;continuationCaptionPaints=0;constructor(e,t,l,d,u,h,w,y){this.objects=e,this.baseSettings=t,this.fonts=l,this.parent=d,this.resources=u,this.layout=h,this.structure=w,this.outlines=y,this.activeSettings=t}measurePageNumbers(){const e=this.settings,t=this.fonts.select(),l=e.limits.maxPages,u=Math.max(...Array.from({length:Math.min(10,l)},(y,T)=>t.width(l<10?49+T:48+T)))*String(l).length*e.fontSize/1e3,h=e.options.pageNumberLabels;return p((h?.prefix??"Page ")+(h?.separator??" of ")+(h?.suffix??""),t,e.fontSize,Number.MAX_SAFE_INTEGER,e.limits.maxCellCharacters,1,!1)[0].width+u*2+2}get settings(){return this.activeSettings}async ensureStarted(){this.current||await this.start(!1)}async beginSection(e){const t=s(e,this.baseSettings),l=c(this.baseSettings,t);if(++this.sectionCount>this.baseSettings.limits.maxSections)throw new S("RESOURCE_LIMIT","maxSections exceeded.");return this.current&&(this.bodyAdded?await this.finishPage():(this.pendingPage=this.current,this.current=0)),this.activeSettings=l,this.sectionPages=0,this.sectionTitle=t.title,await this.structure?.beginSection(),t}addBookmark(e){const t=o(e,this.settings);if((this.outlines?.count??0)+this.pendingBookmarks.length>=this.settings.limits.maxBookmarks)throw new S("RESOURCE_LIMIT","maxBookmarks exceeded.");this.settings.budget.cell(t.title),this.current?this.outlines?.add(t,this.current,this.y):this.pendingBookmarks.push(t)}add(e){this.retainPageBytes(e.length),this.commands+=e}retainPageBytes(e){if(this.commandBytes+=e,this.commandBytes>this.settings.limits.maxPageBytes)throw new S("RESOURCE_LIMIT","maxPageBytes exceeded.")}rgb(e){let t=this.colors.get(e);return t||(t=C(e),this.colors.size<1024&&this.colors.set(e,t)),t}artifact(e,t="Layout"){return this.structure?"/Artifact << /Type /"+t+" >> BDC\n"+e+"EMC\n":e}text(e,t,l,d,u,h="111827",w){const y=v;if(t!==this.textFont||l!==this.textSize||h!==this.textColor){const O=t.syntheticItalic?.213:0,E=this.rgb(h);this.textPrefix="q "+E+" rg "+E+" RG\nBT /"+t.name+" "+y(l)+" Tf "+(t.syntheticBold?y(l*.025)+" w 2 Tr ":"0 Tr ")+"1 0 "+y(O)+" 1 ",this.textFont=t,this.textSize=l,this.textColor=h}const T=this.textPrefix+y(d)+" "+y(u)+" Tm "+t.encode(e)+" Tj ET Q\n";this.add(this.structure&&w!==void 0?this.structure.mark(w)+T+"EMC\n":this.artifact(T,"Pagination"))}link(e,t,l,d,u,h){if(d<=0)return;if(++this.hyperlinks>this.settings.limits.maxHyperlinks)throw new S("RESOURCE_LIMIT","maxHyperlinks exceeded.");const w=this.objects.reserve(),y=this.structure&&h!==void 0?this.structure.annotation(h,w):void 0,T=f(e,t,l,d,u,this.settings.limits.maxPageBytes-this.commandBytes,y,this.structure?this.current:void 0);this.retainPageBytes(T.length),this.annotations.push({id:w,body:T})}inline(e,t,l,d,u,h=u){const w=!this.structure&&e.actualText!==void 0&&e.actualText.length>0;w&&this.add("/Span << /ActualText <FEFF"+a(e.actualText)+"> >> BDC\n");let y;if(e.actualText!==void 0&&this.structure&&u!==void 0){y=new Map;for(const T of[...e.segments].sort((O,E)=>(O.logicalStart??0)-(E.logicalStart??0))){const O=T.link?this.structure.link(u,T.link):u;y.set(T,{owner:O,mark:this.structure.mark(O,T.actualText)})}}for(const T of e.segments){const O=y?.get(T),E=O?.owner??(T.link&&this.structure&&u!==void 0?this.structure.link(u,T.link):u);if(T.glyphs){const P=T.font,I=v,A=P.syntheticItalic?.213:0,F=this.rgb(T.color??"111827");let N=l,U="q "+F+" rg "+F+" RG\nBT /"+P.name+" "+I(t)+" Tf "+(P.syntheticBold?I(t*.025)+" w 2 Tr ":"0 Tr ");for(const M of T.glyphs)U+="1 0 "+I(A)+" 1 "+I(N+(M.xOffset+A*M.yOffset)*t/1e3)+" "+I(d+M.yOffset*t/1e3)+" Tm "+P.encodeGlyph(M.id,M.logicalText)+" Tj\n",N+=M.xAdvance*t/1e3;U+="ET Q\n",this.add(this.structure&&E!==void 0?(O?.mark??this.structure.mark(E,T.actualText))+U+"EMC\n":this.artifact(U,"Pagination"))}else this.text(T.text,T.font,t,l,d,T.color,E);if(T.link){const P=(T.font.program?.ascent??800)*t/1e3,I=(T.font.program?.descent??-200)*t/1e3,A=E??(this.structure&&h!==void 0?this.structure.link(h,T.link):void 0);this.link(T.link,l,d+I,T.width,P-I,A)}l+=T.width}w&&this.add("EMC\n")}decorationText(e){return e===void 0?"":(R(this.settings.options.signal),x(typeof e=="function"?e(Object.freeze({pageNumber:this.references.length,sectionNumber:this.sectionCount||1,sectionPageNumber:this.sectionPages,...this.sectionTitle===void 0?{}:{sectionTitle:this.sectionTitle}})):e,"Page header/footer"))}decoration(e,t,l,d){if(!e)return;this.settings.budget.cell(m(e,this.settings.budget));const u=this.fonts.select(),h=p(e,u,this.settings.fontSize,d,this.settings.limits.maxCellCharacters,1,!1);this.text(h[0].text,u,this.settings.fontSize,t,l)}async start(e=!0,t){if(this.pendingPage===void 0&&this.references.length>=this.settings.limits.maxPages)throw new S("RESOURCE_LIMIT","maxPages exceeded.");const{page:l,margins:d,options:u,fontSize:h}=this.settings,w=this.fonts.select().lineHeight(h);if(this.pendingPage!==void 0?(this.current=this.pendingPage,this.pendingPage=void 0):(this.current=this.objects.reserve(),this.references.push(this.current)),this.commands="",this.commandParts=[],this.annotations=[],this.commandBytes=0,this.bodyAdded=!1,this.sectionPages++,u.pageNumbers!==!1&&(this.totalPages??=this.objects.reserve(),this.numberSettings??=this.settings,this.pageNumberWidth||(this.pageNumberWidth=this.measurePageNumbers()),this.pageNumberWidth>l.width-d.left-d.right))throw new RangeError("Page is too narrow for page numbers at the declared maxPages and font size.");this.structure?.beginPage(this.current),this.y=l.height-d.top;const y=this.decorationText(u.pageHeader),T=this.decorationText(u.pageFooter);if(y&&d.top<w+4)throw new RangeError("Top margin is too small for a page header.");if((T||u.pageNumbers!==!1)&&d.bottom<w+4)throw new RangeError("Bottom margin is too small for page decorations.");const O=this.fonts.select(),E=((O.program?.ascent??800)+(O.program?.descent??-200))*h/2e3;this.decoration(y,d.left,l.height-d.top/2-E,l.width-d.left-d.right);const P=l.width-d.left-d.right-(u.pageNumbers!==!1?this.pageNumberWidth+this.settings.padding*2:0);if(P<=0&&T)throw new RangeError("Page is too narrow for both footer text and page numbers.");if(this.decoration(T,d.left,d.bottom/2-E,P),u.pageNumbers!==!1){const N=u.pageNumberLabels,U=N?.suffix??"",M=l.width-d.right-this.pageNumberWidth+1,Q=d.bottom/2-E,V=(N?.prefix??"Page ")+this.references.length+(N?.separator??" of "),z=p(V,O,h,this.pageNumberWidth,this.settings.limits.maxCellCharacters,1,!1)[0];this.settings.budget.cell(V+U),this.text(V,O,h,M,Q),this.add(this.artifact("q 1 0 0 1 "+v(M+z.width)+" "+v(Q)+" cm /TotalPages Do Q\n","Pagination"))}for(const N of this.pendingBookmarks.splice(0))this.outlines?.add(N,this.current,this.y);this.references.length===1&&(u.title&&await this.paragraph(u.title,{bold:!0},h*1.5,!1,1),u.messageTop&&await this.paragraph(u.messageTop,{},h,!1));const I=t??(e&&this.layout?this.activeHeadings??=await this.layout.headers():[]),A=I.reduce((N,U)=>N+U.height,0),F=e&&this.layout?this.continuationCaption:void 0;if(F?.lines.length&&(this.continuationCaptionPaints++===0&&(this.tableCaptionOwner=this.captionAnnotations(F,this.tableCaptionOwner)),await this.paragraphs([F],A+w+this.settings.padding*2,!0,{artifact:!0,...this.tableCaptionOwner===void 0?{}:{annotationParent:this.tableCaptionOwner}})),this.continuationTop=l.height-d.top-A-(F?.height??0),this.y-A-w-this.settings.padding*2<d.bottom)throw new RangeError("PDF title and repeated headings leave no room for a data line.");e&&this.layout&&this.structure&&this.tableElement===void 0&&(this.tableElement=this.structure.element("Table",this.groupParent),this.tableStructure=new b(this.structure,this.tableElement,I),await this.tableStructure.prepareHeaders()),await this.drawHeadings(I),this.dataTop=this.y}async drawHeadings(e){for(const t of e){for(const u of t.cells)!this.bandCellBudget&&this.paintedHeaderBudgetCells.has(u.source??u)&&this.settings.budget.cell(this.settings.budget.limits.maxTextCharacters===void 0?"":u.lines.map(h=>h.text).join(""));const l=this.tableStructure?t.cells.map(u=>this.tableStructure.owner(u.source??u)):void 0,d=t.cells.map(u=>this.paintedHeaderCells.has(u.source??u));this.draw(t,0,t.lines,l,d);for(const u of t.cells)this.paintedHeaderCells.add(u.source??u),this.paintedHeaderBudgetCells.add(u.source??u)}}async rowElements(e){const t=e.source??e;return this.tableStructure?.prepareRow(t,"data",this.tableElement,this.summaryRows.has(t)?0:void 0)}draw(e,t,l,d,u=[]){if(!this.layout)throw new Error("A table layout is required before drawing rows.");this.bodyAdded=!0;const{padding:h,fontSize:w}=this.settings,y=v,T=l*e.lineHeight+h*2,O=this.layout.lefts;this.rectangleLefts!==O&&(this.rectangleLefts=O,this.rectangleColumns=[]);let E,P="",I="";for(const[A,F]of e.cells.entries()){this.bandCellBudget&&this.settings.budget.cell(this.settings.budget.limits.maxTextCharacters===void 0?"":(F.height===void 0?F.lines.slice(t,t+l):F.lines).map(G=>G.text).join(""));const N=O[F.first],U=F.height??T;U!==E&&(P=y(this.y-U),I=y(U),E=U);let M=this.rectangleColumns[F.first];(!M||M.x!==N||M.width!==F.width)&&(M={x:N,width:F.width,left:y(N),widthText:y(F.width)},this.rectangleColumns[F.first]=M);const Q=M.left+" "+P+" "+M.widthText+" "+I;F.style.background&&this.add(this.artifact("q "+this.rgb(F.style.background)+" rg "+Q+" re f Q\n")),this.add(this.artifact("q 0.82 0.85 0.89 RG 0.4 w "+Q+" re S Q\n"));const V=d?.[A],z=F.semanticArtifact||u[A],L=F.link&&this.structure&&V!==void 0?this.structure.link(V,F.link):V;for(let G=t;G<Math.min(F.lines.length,F.height?F.lines.length:t+l);G++){const W=F.lines[G],K=F.style.alignment==="right"?F.width-h-W.width:F.style.alignment==="center"?(F.width-W.width)/2:h;this.inline(W,w,N+K,this.y-h-W.ascent-(G-t)*(e.structured?F.lineHeight:e.lineHeight),z?void 0:L,L)}F.link&&this.link(F.link,N,this.y-U,F.width,U,L)}this.y-=e.structured?e.height:T,this.sealCommands()}async block(e){if(this.bandFlow)return this.bandFlow.block(e);const t=e.reduce((d,u)=>d+u.height,0),l=this.settings.margins.bottom;if(t>this.y-l&&(await this.finishPage(),await this.start()),t>this.dataTop-l)throw new RangeError("A structured footer must fit on one page below the repeated headings.");for(const d of e){const u=await this.rowElements(d);this.draw(d,0,d.lines,u),await this.tableStructure?.completeRow(d.source??d)}}async row(e,t=!1){if(this.bandFlow)return this.bandFlow.row(e,t);const l=await this.rowElements(e),{margins:d,padding:u}=this.settings,h=this.continuationTop-d.bottom;!t&&e.height<=h+.001&&e.height>this.y-d.bottom+.001&&(await this.finishPage(),await this.start());let w=0;for(;w<e.lines;){let y=Math.min(e.lines-w,Math.floor((this.y-d.bottom-u*2+.001)/e.lineHeight));if(y<=0&&(await this.finishPage(),await this.start(),y=Math.min(e.lines-w,Math.floor((this.y-d.bottom-u*2+.001)/e.lineHeight))),y<=0)throw new RangeError("PDF page cannot fit a table line.");this.draw(e,w,y,l),w+=y,w<e.lines&&(await this.finishPage(),await this.start())}await this.tableStructure?.completeRow(e.source??e)}async keptRows(e,t=!1){if(this.bandFlow)return this.bandFlow.keptRows(e,t);const l=e.reduce((h,w)=>h+w.height,0),d=this.settings.margins.bottom,u=l<=this.continuationTop-d+.001;u&&l>this.y-d+.001&&(await this.finishPage(),await this.start());for(const[h,w]of e.entries())await this.row(w,!u&&h===0&&t)}async paragraph(e,t={},l=this.settings.fontSize,d=!0,u){await this.ensureStarted();const{margins:h,page:w,limits:y}=this.settings,T=this.fonts.select(t.bold,t.italic),O=T.lineHeight(l);this.settings.budget.cell(m(e,this.settings.budget));const E=await g(e,T,l,w.width-h.left-h.right,y.maxCellCharacters,y.maxRowLines,!0,this.settings.options.signal);if(O>w.height-h.top-h.bottom)throw new RangeError("PDF page cannot fit a paragraph line at the selected font metrics.");if(!d&&this.y-E.length*O-8<h.bottom)throw new RangeError("PDF title/message exceeds the first page's content area.");const P=this.structure?.element(u?"H"+u:"P");for(const I of E){this.y-O<h.bottom&&(await this.finishPage(),await this.start(!1));const A=t.alignment==="right"?w.width-h.right-I.width:t.alignment==="center"?h.left+(w.width-h.left-h.right-I.width)/2:h.left;this.bodyAdded=!0,this.text(I.text,T,l,A,this.y-(T.program?.ascent??800)*l/1e3,t.color,P),this.y-=O}this.y-=8,await this.structure?.complete(P)}async reserveSpace(e,t="Kept PDF content"){await this.ensureStarted();const{page:l,margins:d}=this.settings,u=l.height-d.top-d.bottom;if(e>u+.001)throw new RangeError(t+" exceeds a fresh page's content area.");e>this.y-d.bottom+.001&&await this.pageBreak()}async paragraphs(e,t=0,l=!1,d={}){const u=e.filter(w=>w.lines.length>0);if(!u.length)return;await this.ensureStarted();const h=new Array(u.length).fill(0);for(let w=u.length-1;w>=0;w--){const y=u[w],T=u[w+1];h[w]=y.keepWithNext?T?T.keepTogether||T.keepWithNext?T.height+h[w+1]:T.firstHeight:t:0}l&&u.length&&await this.reserveSpace(u.reduce((w,y)=>w+y.height,0)+h.at(-1),"Kept PDF paragraph group");for(const[w,y]of u.entries()){y.budgetOnPaint&&this.settings.budget.cell(m(y.text.text,this.settings.budget)),(y.keepTogether||y.keepWithNext)&&await this.reserveSpace(y.height+h[w],"Kept PDF paragraph chain");const{margins:T,page:O}=this.settings;if(y.firstHeight>O.height-T.top-T.bottom+.001)throw new RangeError("PDF page cannot fit a paragraph line and its leading spacing.");this.y-y.firstHeight<T.bottom&&await this.pageBreak(),this.y-=y.spaceBefore,y.bookmark&&this.addBookmark(y.bookmark);const E=d.artifact?void 0:d.owner??this.structure?.element(d.role??(y.headingLevel?"H"+y.headingLevel:"P"),d.parent??this.groupParent);let P=!0;for(const I of y.lines){if(I.lineHeight>O.height-T.top-T.bottom+.001)throw new RangeError("PDF page cannot fit a paragraph line at the selected font metrics.");this.y-I.lineHeight<T.bottom&&await this.pageBreak();const A=T.left+(d.indent??0),F=O.width-T.right-A,N=y.style.alignment==="right"?O.width-T.right-I.width:y.style.alignment==="center"?A+(F-I.width)/2:A;P&&d.marker&&this.inline(d.marker.line,y.size,A-d.marker.gap-d.marker.line.width,this.y-I.ascent,d.marker.owner),this.bodyAdded=!0,this.inline(I,y.size,N,this.y-I.ascent,E,d.annotationParent??E),this.y-=I.lineHeight,P=!1}this.y-=y.spaceAfter,d.keepOpen||await this.structure?.complete(E)}}get groupParent(){return this.groups.at(-1)?.element}async beginGroup(e,t,l){if(e!==this.groups.length)throw new Error("PDF analytical groups must open in hierarchical order.");await this.ensureStarted();const d=this.structure?.element("Sect",this.groupParent);this.groups.push({level:e,headingLevel:t.headingLevel??e+2,element:d}),await this.paragraphs([t],l,!0,{role:"H"+(t.headingLevel??e+2),...d===void 0?{}:{parent:d}})}async endGroup(e){const t=this.groups.at(-1);if(!t||t.level!==e)throw new Error("PDF analytical groups must close in hierarchical order.");await this.structure?.complete(t.element),this.outlines?.closeGroup(t.headingLevel),this.groups.pop()}summary(e){this.summaryRows.add(e)}async beginTable(e,t,l=e.lineHeight+this.settings.padding*2,d,u,h=!1,w=!1,y=!1){if(e.bands)return this.beginBands(e,t,l,d,u,w,y);await this.ensureStarted(),this.layout=e,this.paintedHeaderCells=new WeakSet,this.continuationCaption=u,this.continuationCaptionPaints=0,this.tableCaptionOwner=void 0,this.tableElement=this.structure?.element("Table",this.groupParent);const T=t??await e.headers();this.activeHeadings=T;const O=h&&this.bodyAdded&&!this.structure?[]:T,E=O.reduce((P,I)=>P+I.height,0);if(d&&!(w&&y)&&(await this.reserveSpace(d.height+E+l,"Kept PDF table caption and first data fragment"),this.tableCaptionOwner=w?this.captionAnnotations(d):d.lines.length?this.structure?.element("Caption",this.tableElement):void 0,await this.paragraphs([d],E+l,!0,w?{artifact:!0,...this.tableCaptionOwner===void 0?{}:{annotationParent:this.tableCaptionOwner}}:{role:"Caption",keepOpen:!0,...this.tableCaptionOwner===void 0?{}:{owner:this.tableCaptionOwner}})),this.structure&&(this.tableStructure=new b(this.structure,this.tableElement,T),await this.tableStructure.prepareHeaders()),this.y-E-l<this.settings.margins.bottom){await this.finishPage(),await this.start(!0,T);return}this.continuationTop=this.settings.page.height-this.settings.margins.top-T.reduce((P,I)=>P+I.height,0)-(u?.height??0),await this.drawHeadings(O),this.dataTop=this.y}async beginBands(e,t,l,d,u,h,w){await this.ensureStarted();const y=t??await e.headers(),T=await e.bandRows(y,!0),O=T[0].reduce((z,L)=>z+L.height,0),{page:E,margins:P,padding:I}=this.settings,A=E.height-P.top-P.bottom-O-(d?.height??0),F=l<=A+.001?l:e.lineHeight+I*2,N=E.height-P.top-P.bottom-O-(u?.height??0);if(N+.001<e.lineHeight+I*2)throw new RangeError("PDF band headings and continuation context leave no room for a data line.");let U=h&&w;this.y-P.bottom-O-(U?0:d?.height??0)+.001<F&&(await this.pageBreak(),U=!1);const M=this.y-P.bottom-O-(U?0:d?.height??0);if(M+.001<F)throw new RangeError("PDF band caption and headings leave no room for a data line.");let Q=0;this.tableElement=this.structure?.element("Table",this.groupParent),this.paintedHeaderCells=new WeakSet;let V=this.structure&&d?.lines.length?h?this.captionAnnotations(d):this.structure.element("Caption",this.tableElement):void 0;this.structure&&(this.tableStructure=new b(this.structure,this.tableElement,y)),this.layout=void 0,this.continuationCaption=void 0,this.activeHeadings=void 0,this.bandFlow=new k(e,T,{firstCapacity:M,firstFullCapacity:A,continuationCapacity:N,prepareRow:async z=>{await this.tableStructure?.prepareHeaders(),await this.rowElements(z)},completeRow:async z=>{await this.tableStructure?.completeRow(z.source??z)},moveFirstToFreshPage:async()=>{await this.pageBreak(),U=!1},paint:async(z,L,G,W,K,X)=>{K&&X||await this.pageBreak();const Z=e.bands[z];this.layout={lefts:Z.lefts,lineHeight:e.lineHeight,headers:async()=>L},this.bandCellBudget=!0;try{if(W?.lines.length&&!(K&&X&&U)){!K&&Q++===0&&(V=this.captionAnnotations(W,V));const se=V;await this.paragraphs([W],O+F,!0,K&&X&&!h?{role:"Caption",keepOpen:!0,...V===void 0?{}:{owner:V}}:{artifact:!0,...se===void 0?{}:{annotationParent:se}})}await this.tableStructure?.prepareHeaders(),await this.drawHeadings(L),this.dataTop=this.y;for(const se of G){R(this.settings.options.signal);const D=this.tableStructure?se.cells.map(q=>this.tableStructure.owner(q.source??q)):void 0;this.draw(se,0,se.lines,D)}}finally{this.bandCellBudget=!1}}},d,u)}async endTable(){this.bandFlow&&(await this.bandFlow.flush(!0),this.bandFlow=void 0),await this.tableStructure?.finish(),this.layout=void 0,this.tableElement=void 0,this.tableStructure=void 0,this.activeHeadings=void 0,this.continuationCaption=void 0,this.tableCaptionOwner=void 0,this.continuationCaptionPaints=0,this.y-=8}captionAnnotations(e,t){if(!this.structure||!e.text.runs.some(d=>d.link&&d.text.trim()))return t;const l=t??this.structure.element("Caption",this.tableElement);for(const d of e.text.runs)d.link&&d.text.trim()&&this.structure.link(l,d.link,d.text);return l}async pageBreak(){await this.ensureStarted(),await this.finishPage(),await this.start(!1)}registerXObject(e,t){this.externalObjects.set(e,t)}graphicHeight(e,t){const{page:l,margins:d}=this.settings;return t*Math.min(1,(l.width-d.left-d.right)/e,(l.height-d.top-d.bottom)/t)}async graphic(e,t,l,d,u,h){await this.ensureStarted();const{page:w,margins:y}=this.settings,T=w.width-y.left-y.right,O=Math.min(1,T/e,(w.height-y.top-y.bottom)/t);e*=O,t*=O;const E=this.structure&&u!==void 0?this.structure.element("Figure",void 0," /Alt <feff"+a(u)+">"):void 0;if(h){if(u===void 0)throw new TypeError("A captioned PDF graphic requires alternativeText and cannot be decorative.");await this.reserveSpace(h.height+t,"Kept PDF graphic and caption"),await this.paragraphs([h],t,!0,{role:"Caption",...E===void 0?{}:{parent:E}})}this.y-t<y.bottom&&await this.pageBreak();const P=l==="right"?w.width-y.right-e:l==="center"?y.left+(T-e)/2:y.left,I=d(P,this.y-t,e,t);this.bodyAdded=!0,this.add(this.structure&&E!==void 0?this.structure.mark(E)+I+"EMC\n":this.artifact(I)),this.y-=t+8,await this.structure?.complete(E)}async listItem(e,t){if(await this.ensureStarted(),this.structure&&t===void 0)throw new Error("A tagged list item requires a logical list owner.");const l=this.structure?.element("LI",t),d=l===void 0?void 0:this.structure.element("Lbl",l),u=l===void 0?void 0:this.structure.element("LBody",l);await this.paragraphs([e.paragraph],0,!1,{...u===void 0?{}:{parent:u},role:"P",indent:e.indent,marker:{line:e.marker,gap:e.markerGap,...d===void 0?{}:{owner:d}}}),await this.structure?.complete(l)}sealCommands(){this.commands&&(this.commandParts.push(this.commands),this.commands="")}takeCommands(){this.sealCommands();const e=this.commandParts.join("");return this.commandParts=[],e}async finishPage(){const e=this.objects.reserve(),{page:t,options:l}=this.settings;await this.objects.stream(e,this.takeCommands(),"",l.compression!==!1);const d=[];for(const u of this.annotations)d.push(u.id),await this.objects.object(u.id,u.body);await this.objects.object(this.current,"<< /Type /Page /Parent "+this.parent+" 0 R /MediaBox [0 0 "+v(t.width)+" "+v(t.height)+"] /Resources "+this.resources+" 0 R /Contents "+e+" 0 R"+(this.structure?.pageDictionary??"")+(d.length?" /Annots ["+d.map(u=>u+" 0 R").join(" ")+"]":"")+" >>"),this.structure&&await this.structure.finishPage(),this.annotations=[],this.commandBytes=0,this.current=0,await this.objects.flushBytes()}async finish(){if(this.bandFlow&&(await this.bandFlow.flush(!0),this.bandFlow=void 0),await this.ensureStarted(),await this.tableStructure?.finish(),await this.finishPage(),this.totalPages){const e=this.fonts.select(),t=String(this.references.length),l=t+(this.numberSettings.options.pageNumberLabels?.suffix??""),d=this.numberSettings.fontSize;this.settings.budget.cell(t);const u="BT /"+e.name+" "+v(d)+" Tf 1 0 0 1 0 0 Tm "+e.encode(l)+" Tj ET\n",h=p(l,e,d,this.numberSettings.page.width,this.settings.limits.maxCellCharacters,1,!1)[0].width,w=(e.program?.bbox[1]??-250)*d/1e3-1,y=(e.program?.bbox[3]??1e3)*d/1e3+1;await this.objects.stream(this.totalPages,u,"/Type /XObject /Subtype /Form /BBox [-1 "+v(w)+" "+v(h+1)+" "+v(y)+"] /Resources << /Font "+this.fonts.dictionary()+" >>",this.settings.options.compression!==!1)}}xobjects(){const e=[...this.externalObjects].map(([t,l])=>"/"+t+" "+l+" 0 R");return this.totalPages&&e.push("/TotalPages "+this.totalPages+" 0 R"),e.length?" /XObject << "+e.join(" ")+" >>":""}}const r=Object.freeze({PdfPages:i});return B.set("3ed7114181be5a3066742336da574fef7f2fc04ee6dfc5e64211f3bedad4cab9",r),r})(),fr=B.get("7a58e8ccb5164de51db14e39ca9695af6487c354df909509f0ae6bfac8ae3887")??(()=>{class S{objects;root;entries=[];levels=[];lastKey=-1;constructor(C,k){this.objects=C,this.root=k}async append(C,k){if(C<=this.lastKey)throw new Error("PDF ParentTree keys must be appended in increasing order.");this.lastKey=C,this.entries.push({key:C,value:k}),this.entries.length===64&&await this.leaf()}async leaf(){if(!this.entries.length)return;const C=this.objects.reserve(),k=this.entries[0].key,b=this.entries.at(-1).key,p="<< /Limits ["+k+" "+b+"] /Nums ["+this.entries.map(g=>g.key+" "+g.value+" 0 R").join(" ")+"] >>";this.entries.length=0,await this.objects.object(C,p),await this.node({id:C,first:k,last:b},0)}async node(C,k){const b=this.levels[k]??=[];if(b.push(C),b.length===64){const p=await this.branch(b);b.length=0,await this.node(p,k+1)}}async branch(C){const k=this.objects.reserve(),b=C[0].first,p=C.at(-1).last;return await this.objects.object(k,"<< /Limits ["+b+" "+p+"] /Kids ["+C.map(g=>g.id+" 0 R").join(" ")+"] >>"),{id:k,first:b,last:p}}async finish(){await this.leaf();for(let k=0;k<this.levels.length-1;k++){const b=this.levels[k];if(b.length){const p=await this.branch(b);b.length=0,await this.node(p,k+1)}}const C=this.levels.at(-1)??[];await this.objects.object(this.root,C.length?"<< /Kids ["+C.map(k=>k.id+" 0 R").join(" ")+"] >>":"<< /Nums [] >>")}}const R=Object.freeze({PdfParentTree:S});return B.set("7a58e8ccb5164de51db14e39ca9695af6487c354df909509f0ae6bfac8ae3887",R),R})(),Mt=B.get("1c1828a3d6dfc2edda674566203e7aa8e97c984114b7928df13cb373859977d0")??(()=>{const{OfficeIMOError:S}=ue,{checkAbort:R}=be,{unicodeHex:v}=Ae,{PdfParentTree:C}=fr;function k(a){return typeof a=="number"?a<0?-a-1+" ":a+" 0 R ":a+" "}function b(a){return"<< /Type /StructElem /S /"+a.role+" /P "+a.parent+" 0 R"+(a.markedPage===void 0?"":" /Pg "+a.markedPage+" 0 R")+(a.identifier===void 0?"":" /ID ("+a.identifier+")")+" /K ["}function p(a,s){const o=32768-s.length-a.attributes.length-4;if(o<0)return;let c="";for(const i of a.children){const r=k(i);if(c.length+r.length>o)return;c+=r}return s+c+"]"+a.attributes+" >>"}class g{objects;root;entries=[];levels=[];lastKey="";constructor(s,o){this.objects=s,this.root=o}async append(s,o){if(s<=this.lastKey)throw new Error("PDF structure IDs must be appended in increasing order.");this.lastKey=s,this.entries.push({key:s,value:o}),this.entries.length===64&&await this.leaf()}async leaf(){if(!this.entries.length)return;const s=this.objects.reserve(),o=this.entries[0].key,c=this.entries.at(-1).key,i="<< /Limits [("+o+") ("+c+")] /Names ["+this.entries.map(r=>"("+r.key+") "+r.value+" 0 R").join(" ")+"] >>";this.entries.length=0,await this.objects.object(s,i),await this.node({id:s,first:o,last:c},0)}async node(s,o){const c=this.levels[o]??=[];if(c.push(s),c.length===64){const i=await this.branch(c);c.length=0,await this.node(i,o+1)}}async branch(s){const o=this.objects.reserve(),c=s[0].first,i=s.at(-1).last;return await this.objects.object(o,"<< /Limits [("+c+") ("+i+")] /Kids ["+s.map(r=>r.id+" 0 R").join(" ")+"] >>"),{id:o,first:c,last:i}}async finish(){await this.leaf();for(let o=0;o<this.levels.length-1;o++){const c=this.levels[o];if(c.length){const i=await this.branch(c);c.length=0,await this.node(i,o+1)}}const s=this.levels.at(-1)??[];await this.objects.object(this.root,s.length?"<< /Kids ["+s.map(o=>o.id+" 0 R").join(" ")+"] >>":"<< /Names [] >>")}}class x{objects;settings;root;document;parentTree;elements=new Map;parentTreeWriter;annotations=[];links=new WeakMap;identifiers;pageParents=[];pageId=0;pageKey=0;nextParentKey=0;references=0;allocated=0;section;constructor(s,o){this.objects=s,this.settings=o,this.root=s.reserve(),this.parentTree=s.reserve(),this.parentTreeWriter=new C(s,this.parentTree),this.document=this.element("Document",this.root)}element(s,o=this.section??this.document,c=""){if(R(this.settings.options.signal),++this.allocated>this.settings.limits.maxStructureElements)throw new S("RESOURCE_LIMIT","maxStructureElements exceeded.");const i=this.objects.reserve(),r={id:i,parent:o,role:s,children:[],attributes:c};this.elements.set(i,r);const n=this.elements.get(o);return s==="Caption"&&n?.role==="Table"?n.children.unshift(i):n?.children.push(i),i}setAttributes(s,o){const c=this.elements.get(s);if(!c)throw new Error("PDF structure attributes require an open logical owner.");c.attributes=o}async attributeReference(s){R(this.settings.options.signal);const o=this.objects.reserve();return await this.objects.object(o,s)," /A "+o+" 0 R"}async beginSection(){await this.complete(this.section),this.section=this.element("Sect",this.document)}async identifier(s){R(this.settings.options.signal);const o=this.elements.get(s);if(!o)throw new Error("PDF structure IDs require an open logical owner.");if(o.identifier!==void 0)return o.identifier;const c="e"+String(s).padStart(16,"0");return this.identifiers??=new g(this.objects,this.objects.reserve()),await this.identifiers.append(c,s),o.identifier=c,c}beginPage(s){this.pageId=s,this.pageParents=[],this.pageKey=this.nextParentKey++}link(s,o,c){let i=this.links.get(o);i||(i=new Map,this.links.set(o,i));const r=i.get(s);if(r!==void 0)return r;const n=this.element("Link",s,c===void 0?"":" /Alt <feff"+v(c)+">");i.set(s,n);const e=this.elements.get(s);return(e.linkIdentities??=[]).push(o),n}annotation(s,o){R(this.settings.options.signal);const c=this.elements.get(s);if(!c||c.role!=="Link")throw new Error("Tagged link annotations require a logical Link owner.");const i=this.nextParentKey++;return c.children.push("<< /Type /OBJR /Obj "+o+" 0 R /Pg "+this.pageId+" 0 R >>"),this.annotations.push({key:i,owner:s}),i}mark(s,o){if(++this.references>this.settings.limits.maxMarkedContentReferences)throw new S("RESOURCE_LIMIT","maxMarkedContentReferences exceeded.");const c=this.elements.get(s);if(!c)throw new Error("Marked content requires an open logical owner.");const i=this.pageParents.length;return this.pageParents.push(s),c.markedPage??=this.pageId,c.children.push(c.markedPage===this.pageId?-(i+1):"<< /Type /MCR /Pg "+this.pageId+" 0 R /MCID "+i+" >>"),"/"+c.role+" << /MCID "+i+(o===void 0?"":" /ActualText <FEFF"+v(o)+">")+" >> BDC\n"}get pageDictionary(){return" /StructParents "+this.pageKey+" /Tabs /S"}get catalogDictionary(){return" /MarkInfo << /Marked true >> /Lang <feff"+v(this.settings.options.tagged.language)+"> /StructTreeRoot "+this.root+" 0 R"}async finishPage(){const s=this.objects.reserve();await this.objects.object(s,"["+this.pageParents.map(o=>o+" 0 R").join(" ")+"]"),await this.parentTreeWriter.append(this.pageKey,s);for(const o of this.annotations)await this.parentTreeWriter.append(o.key,o.owner);this.annotations.length=0,this.pageParents=[]}async complete(s){if(s===void 0)return;const o=this.elements.get(s);if(!o)return;for(const r of o.children)typeof r=="number"&&r>0&&!this.completeBuffered(r)&&await this.complete(r);R(this.settings.options.signal);const c=b(o),i=p(o,c);i!==void 0?this.objects.tryCompactObject(s,i)||await this.objects.compactObject(s,i):await this.objects.object(s,this.body(o,c)),this.releaseElement(o)}completeBuffered(s){const o=this.elements.get(s);if(!o)return!0;for(const i of o.children)if(typeof i=="number"&&i>0&&!this.completeBuffered(i))return!1;R(this.settings.options.signal);const c=p(o,b(o));return c===void 0||!this.objects.tryCompactObject(s,c)?!1:(this.releaseElement(o),!0)}releaseElement(s){if(s.linkIdentities)for(const o of s.linkIdentities){const c=this.links.get(o);c?.delete(s.id),c?.size||this.links.delete(o)}this.elements.delete(s.id)}*body(s,o){yield o;for(const c of s.children)yield k(c);yield"]"+s.attributes+" >>"}async completeRow(s){s?.length&&await this.complete(this.elements.get(s[0])?.parent)}async finish(){await this.complete(this.document),await this.parentTreeWriter.finish(),await this.identifiers?.finish(),await this.objects.object(this.root,"<< /Type /StructTreeRoot /K ["+this.document+" 0 R] /ParentTree "+this.parentTree+" 0 R /ParentTreeNextKey "+this.nextParentKey+(this.identifiers?" /IDTree "+this.identifiers.root+" 0 R":"")+" >>")}}function m(a,s){const o=a.decorative,c=a.alternativeText;if(o!==void 0&&typeof o!="boolean")throw new TypeError("Graphic decorative must be boolean.");if(c!==void 0){if(typeof c!="string"||!c.trim())throw new TypeError("Graphic alternativeText must be nonempty text.");if(c.length>s.limits.maxCellCharacters)throw new S("RESOURCE_LIMIT","maxCellCharacters exceeded by graphic alternativeText.");if(v(c),o)throw new TypeError("A decorative graphic cannot also have alternativeText.")}if(s.options.tagged&&c===void 0&&o!==!0)throw new TypeError("Tagged PDF graphics require alternativeText or decorative:true.");return s.options.tagged&&c!==void 0&&s.budget.cell(c),c}const f=Object.freeze({PdfStructure:x,graphicAlternative:m});return B.set("1c1828a3d6dfc2edda674566203e7aa8e97c984114b7928df13cb373859977d0",f),f})(),ur=B.get("52c78ca6833cee7e5a96b657e2c00172d550176daf2c95e742692f8416977bea")??(()=>{const{OfficeIMOError:S}=ue,{checkAbort:R}=be,{pdfNumber:v,unicodeHex:C}=Ae;class k{objects;settings;root;items=[];top=[];stack=[];constructor(g,x){this.objects=g,this.settings=x}add(g,x,m){if(R(this.settings.options.signal),this.items.length>=this.settings.limits.maxBookmarks)throw new S("RESOURCE_LIMIT","maxBookmarks exceeded.");this.root??=this.objects.reserve();const f=g.level??1;for(;this.stack.length&&this.stack.at(-1).level>=f;)this.stack.pop();const a=this.stack.at(-1),s=a?.children??this.top,o=s.at(-1),c={id:this.objects.reserve(),title:g.title,page:x,y:m,level:f,parent:a?.id??this.root,children:[],previous:o?.id,next:void 0};o&&(o.next=c.id),s.push(c),this.items.push(c),this.stack.push(c)}get count(){return this.items.length}closeGroup(g){for(;this.stack.length&&this.stack.at(-1).level>=g;)this.stack.pop()}get catalogDictionary(){return this.root===void 0?"":" /Outlines "+this.root+" 0 R"}async finish(){if(this.root===void 0)return;const g=new Map;for(const x of[...this.items].reverse())g.set(x.id,x.children.reduce((m,f)=>m+1+g.get(f.id),0));for(const x of this.items)R(this.settings.options.signal),await this.objects.object(x.id,"<< /Title <feff"+C(x.title)+"> /Parent "+x.parent+" 0 R"+(x.previous===void 0?"":" /Prev "+x.previous+" 0 R")+(x.next===void 0?"":" /Next "+x.next+" 0 R")+(x.children.length?" /First "+x.children[0].id+" 0 R /Last "+x.children.at(-1).id+" 0 R /Count "+g.get(x.id):"")+" /Dest ["+x.page+" 0 R /XYZ null "+v(x.y)+" null] >>");await this.objects.object(this.root,"<< /Type /Outlines /First "+this.top[0].id+" 0 R /Last "+this.top.at(-1).id+" 0 R /Count "+this.items.length+" >>")}}const b=Object.freeze({PdfOutlines:k});return B.set("52c78ca6833cee7e5a96b657e2c00172d550176daf2c95e742692f8416977bea",b),b})(),Nt=B.get("afdad27eb363e8de0c3bd69ebf358860eb76f5c6fb29f43a87635807cb7fc273")??(()=>{const{PdfObjects:S,unicodeHex:R}=Ae,{PdfFontResources:v}=sr,{PdfTableLayout:C}=Ct,{PdfPages:k}=hr,{PdfStructure:b}=Mt,{PdfOutlines:p}=ur;class g{settings;objects;fonts;pages;layout;structure;outlines;root;parent;resources;info;constructor(f,a,s=!1){this.settings=a,this.objects=new S(f,a.options.signal,a.budget.limits.maxOutputBytes,a.options.compression!==!1),this.root=this.objects.reserve(),this.parent=this.objects.reserve(),this.resources=this.objects.reserve(),this.info=this.objects.reserve(),this.structure=a.options.tagged?new b(this.objects,a):void 0,this.outlines=new p(this.objects,a),this.fonts=new v(this.objects,a.options.fonts,a.limits.maxFontBytes,a.options.signal),this.layout=s?new C(a,this.fonts):void 0,this.pages=new k(this.objects,a,this.fonts,this.parent,this.resources,this.layout,this.structure,this.outlines)}async start(){await this.objects.text("%PDF-1.7\n"),await this.objects.raw(Uint8Array.of(37,226,227,207,211,10)),this.layout?.bands?await this.pages.beginTable(this.layout):this.layout&&await this.pages.start(!0)}async finish(){const{options:f}=this.settings,{objects:a,fonts:s,pages:o}=this;await o.finish();for(const c of s.resources)await c.write(a,f.compression!==!1);await a.object(this.resources,"<< /Font "+s.dictionary()+o.xobjects()+" >>"),await a.object(this.parent,"<< /Type /Pages /Count "+o.references.length+" /Kids ["+o.references.map(c=>c+" 0 R").join(" ")+"] >>"),this.structure&&await this.structure.finish(),await this.outlines.finish(),await a.object(this.root,"<< /Type /Catalog /Pages "+this.parent+" 0 R"+(this.structure?.catalogDictionary??"")+this.outlines.catalogDictionary+" >>"),await a.object(this.info,"<< /Producer (OfficeIMO.js)"+(f.title===void 0?"":" /Title <feff"+R(f.title)+">")+" >>"),await a.finish(this.root,this.info)}}const x=Object.freeze({PdfWriteSession:g});return B.set("afdad27eb363e8de0c3bd69ebf358860eb76f5c6fb29f43a87635807cb7fc273",x),x})(),_t=B.get("45cf9fd6b6293c1a83bc8554e1bcb5cf119f44701fbad7849f39a712cab5074b")??(()=>{const{BlobByteSink:S,withDestination:R}=Oe,{beginTask:v,checkAbort:C,consumeRows:k,pause:b,taskYieldDue:p}=be,{notifyProgress:g}=Ke,{createRowProjector:x}=Ue,{settings:m}=je,{PdfWriteSession:f}=Nt;async function a(c,i){const r=new S;try{return await s(c,r,i),r.toBlob("application/pdf")}catch(n){throw r.discard(),n}}async function s(c,i,r){const n=m(r),{options:e,budget:t}=n;return v(),C(e.signal),R(i,async l=>{const d=new f(l,n,!0),{objects:u,pages:h}=d,w=d.layout,y=x(e.columns,void 0,e.signal);let T=0;await d.start();const O=()=>{if(T++,T%256===0&&(g(e.onProgress,{phase:"rows",rows:T,bytes:u.bytes}),p()))return b().then(()=>{C(e.signal)});C(e.signal)};await k(c,e.signal,async P=>{t.row(T+1);const I=y(P,T);return h.row(await w.data(I,T)).then(O)});const E=await w.footer(T);return E&&(e.footer?.rows?await h.block(E):await h.row(E[0])),w.bands&&await h.endTable(),e.messageBottom&&await h.paragraph(e.messageBottom),await d.finish(),g(e.onProgress,{phase:"complete",rows:T,bytes:u.bytes}),C(e.signal),{rows:T,columns:e.columns.length,bytes:u.bytes}})}const o=Object.freeze({writePdf:a,writePdfTo:s});return B.set("45cf9fd6b6293c1a83bc8554e1bcb5cf119f44701fbad7849f39a712cab5074b",o),o})(),pr=B.get("749d1ec5422c0087787f525ef42e3b8d3a94d2b70eb5e42d2e3723a870777ad6")??(()=>{const{NotSupportedError:S,OfficeIMOError:R}=ue,{checkAbort:v,pause:C,taskYieldDue:k,withAbort:b}=be,{Crc32:p}=wt,g=[137,80,78,71,13,10,26,10],x=new Set(["PLTE","tRNS","iCCP","sRGB","gAMA","cHRM","cICP","mDCV","cLLI","sBIT","eXIf","acTL","fcTL","fdAT"]);async function m(r,n,e,t){v(e);const l=o(r,n),d=l.width*l.height,u=r.length+d*l.components+(l.components===4?l.width*8:0);if(t!==void 0&&u>t)throw new R("RESOURCE_LIMIT","maxImageWorkingBytes exceeded by PNG source, image planes and scanlines.");const h=new Uint8Array(r),w=await s(h,l,e);v(e);let y;try{if(typeof DecompressionStream!="function")throw new TypeError("Missing DecompressionStream");y=new DecompressionStream("deflate")}catch(K){throw new R("PLATFORM_UNAVAILABLE",'PNG intake requires native DecompressionStream("deflate").',{cause:K})}const{width:T,height:O,components:E}=w,P=T*E,I=(P+1)*O;if(!Number.isSafeInteger(I)||I>2147483647)throw new R("RESOURCE_LIMIT","PNG filtered data exceeds the supported decoded byte length.");const A=new Uint8Array(T*O*3),F=E===4?new Uint8Array(d):void 0;let N=E===4?new Uint8Array(P):void 0,U=E===4?new Uint8Array(P):void 0;const M=f(h,w,e).pipeThrough(y).getReader();let Q=0,V=0,z=0,L=0,G=0,W=0;try{for(;;){const K=await b(M.read(),e).catch(X=>{throw v(e),new TypeError("Invalid PNG zlib image data.",{cause:X})});if(v(e),K.done)break;if(K.value.length>I-Q)throw new TypeError("PNG inflated bytes exceed the exact IHDR scanline length.");for(let X=0;X<K.value.length;X++){const Z=K.value[X];if(G===0){if(W=Z,W>4)throw new TypeError("Invalid PNG scanline filter.")}else{const se=G-1;let D=Z;if(W!==0){const q=G>E?U?U[se-E]:A[V-E]:0,J=N?N[se]:V>=P?A[V-P]:0,re=G>E?N?N[se-E]:V>=P?A[V-P-E]:0:0;D=Z+(W===1?q:W===2?J:W===3?Math.floor((q+J)/2):c(q,J,re))&255}U?U[se]=D:A[V]=D,V++}if(G===P){if(G=0,U&&F){for(let D=0;D<P;D+=4)A[z++]=U[D],A[z++]=U[D+1],A[z++]=U[D+2],F[L++]=U[D+3],(D&16383)===16380&&(k()&&await C(),v(e));const se=U;U=N,N=se}}else G++;(X&16383)===16383&&(k()&&await C(),v(e))}Q+=K.value.length,k()&&await C(),v(e)}if(Q!==I)throw new TypeError("PNG inflated bytes must match the exact IHDR scanline length.");return await a(h,w,I,e),{width:T,height:O,components:3,data:A,...F?{alpha:F}:{}}}catch(K){throw M.cancel(K).catch(()=>{}),K}finally{M.releaseLock()}}function f(r,n,e,t=!1){const l=new DataView(r.buffer,r.byteOffset,r.byteLength);let d=n.firstData,u=d+8,h=u+l.getUint32(d);return new ReadableStream({pull(w){for(v(e);u===h;){if(d=h+4,d===n.dataEnd){w.close();return}u=d+8,h=u+l.getUint32(d)}if(t&&u===n.lastDataByte){w.enqueue(Uint8Array.of(r[u++]^1));return}const y=Math.min(h,u+4096,t&&u<n.lastDataByte?n.lastDataByte:h);w.enqueue(r.subarray(u,y)),u=y}},{highWaterMark:0})}async function a(r,n,e,t){const l=f(r,n,t,!0).pipeThrough(new DecompressionStream("deflate")).getReader();let d=!1,u=0;try{for(;;){let h;try{h=await b(l.read(),t)}catch{v(t),d=!0;break}if(v(t),h.done)break;if(u+=h.value.length,u>e)throw new TypeError("Invalid PNG zlib image data.");k()&&await C(),v(t)}if(!d)throw new TypeError("Invalid PNG zlib image data: trailing bytes after the checksum.")}finally{l.cancel().catch(()=>{}),l.releaseLock()}}async function s(r,n,e){const t=new DataView(r.buffer,r.byteOffset,r.byteLength);let l=0,d=0,u=-1,h=!1;for(let w=8;w<r.length;){if(v(e),w+12>r.length)throw new TypeError("Truncated PNG chunk.");const y=t.getUint32(w),T=w+12+y;if(y>2147483647||T>r.length)throw new TypeError("Truncated or oversized PNG chunk.");const O=String.fromCharCode(...r.subarray(w+4,w+8));if(!/^[A-Za-z]{2}[A-Z][A-Za-z]$/.test(O))throw new TypeError("Invalid PNG chunk type.");const E=new p;for(let P=w+4;P<T-4;P+=65536)E.update(r.subarray(P,Math.min(T-4,P+65536))),k()&&await C(),v(e);if(E.value!==t.getUint32(T-4))throw new TypeError("PNG chunk CRC mismatch: "+O+".");if(w===8&&O!=="IHDR")throw new TypeError("PNG IHDR must be the first chunk.");if(O==="IHDR"){if(w!==8||y!==13)throw new TypeError("PNG requires one 13-byte IHDR first.")}else if(O==="IDAT"){if(h)throw new TypeError("PNG IDAT chunks must be consecutive.");l||=w,d=T,y&&(u=T-5)}else{if(l&&(h=!0),O==="IEND"){if(y!==0||!l||T!==r.length)throw new TypeError("PNG requires a final empty IEND after IDAT.");return{...n,firstData:l,dataEnd:d,lastDataByte:u}}if(x.has(O))throw new S("PNG chunk "+O+"; normalize color, orientation, transparency or animation first");if((r[w+4]&32)===0)throw new S("Required PNG chunk "+O)}w=T}throw new TypeError("PNG requires a complete final IEND chunk.")}function o(r,n){if(r.length<33||g.some((u,h)=>r[h]!==u))throw new TypeError("Invalid PNG signature or truncated IHDR.");const e=new DataView(r.buffer,r.byteOffset,r.byteLength);if(e.getUint32(8)!==13||String.fromCharCode(...r.subarray(12,16))!=="IHDR")throw new TypeError("PNG requires one 13-byte IHDR first.");const t=e.getUint32(16),l=e.getUint32(20);if(!t||!l||t>2147483647||l>2147483647)throw new TypeError("Invalid PNG dimensions.");if(!Number.isSafeInteger(t*l)||t*l>n)throw new R("RESOURCE_LIMIT","PNG dimensions exceed maxImagePixels.");if(r[24]!==8||![2,6].includes(r[25]))throw new S("PNG intake requires 8-bit RGB or RGBA pixels");if(r[26]!==0||r[27]!==0)throw new S("PNG compression or filter method");if(r[28]!==0)throw new S("Interlaced PNG intake");const d=r[25]===6?4:3;if(!Number.isSafeInteger((t*d+1)*l)||(t*d+1)*l>2147483647)throw new R("RESOURCE_LIMIT","PNG filtered data exceeds the supported decoded byte length.");return{width:t,height:l,components:d}}function c(r,n,e){const t=r+n-e,l=Math.abs(t-r),d=Math.abs(t-n),u=Math.abs(t-e);return l<=d&&l<=u?r:d<=u?n:e}const i=Object.freeze({pngPixels:m});return B.set("749d1ec5422c0087787f525ef42e3b8d3a94d2b70eb5e42d2e3723a870777ad6",i),i})(),mr=B.get("7dca2d9ca5c43893abdaf86df5b1bcb1f3de3d5d33532d082fdfe04711999d21")??(()=>{const{NotSupportedError:S,OfficeIMOError:R}=ue,{checkAbort:v,pause:C,taskYieldDue:k}=be,{pngPixels:b}=pr;class p{objects;settings;images=new Map;bytes=0;constructor(f,a){this.objects=f,this.settings=a}async prepare(f){const a=this.images.get(f);if(a)return a;const{limits:s,options:o}=this.settings;if(!f||typeof f!="object")throw new TypeError("PDF images require a byte array.");const c=f.data,i=f.format;if(!(c instanceof Uint8Array))throw new TypeError("PDF images require a byte array.");const r=c.length;if(this.bytes+r>s.maxImageBytes)throw new R("RESOURCE_LIMIT","maxImageBytes exceeded.");let n,e,t,l,d;const u=s.maxImageWorkingBytes;if(i==="png")({width:n,height:e,components:t,data:l,alpha:d}=await b(c,s.maxImagePixels,o.signal,u));else if(i==="jpeg")({width:n,height:e,components:t}=g(c));else if(i==="rgb"||i==="rgba")({width:n,height:e}=f),t=i==="rgba"?4:3;else throw new S("PDF images support unprofiled PNG/JPEG or decoded RGB/RGBA pixels.");if(!Number.isSafeInteger(n)||!Number.isSafeInteger(e)||n<1||e<1||!Number.isSafeInteger(n*e)||n*e>s.maxImagePixels)throw new R("RESOURCE_LIMIT","Image dimensions must be positive integers within maxImagePixels.");if((i==="rgb"||i==="rgba")&&r!==n*e*t)throw new RangeError("Raw image bytes must match width × height × channels exactly.");if(i!=="png"&&u!==void 0&&r+(t===4?n*e:0)>u)throw new R("RESOURCE_LIMIT","maxImageWorkingBytes exceeded by image snapshot and alpha plane.");v(o.signal);const h=this.objects.reserve(),w="Image"+(this.images.size+1);this.bytes+=r;const y=l??new Uint8Array(c);let T=y,O=d,E;if(t===4){T=y.subarray(0,n*e*3),O=new Uint8Array(n*e);for(let A=0;A<O.length;A++)T[A*3]=y[A*4],T[A*3+1]=y[A*4+1],T[A*3+2]=y[A*4+2],O[A]=y[A*4+3],(A&16383)===16383&&(k()&&await C(),v(o.signal))}O&&(E=this.objects.reserve(),await this.objects.stream(E,O,"/Type /XObject /Subtype /Image /Width "+n+" /Height "+e+" /ColorSpace /DeviceGray /BitsPerComponent 8",o.compression!==!1,!0));const P="/Type /XObject /Subtype /Image /Width "+n+" /Height "+e+" /ColorSpace /"+(t===1?"DeviceGray":"DeviceRGB")+" /BitsPerComponent 8"+(E?" /SMask "+E+" 0 R":"")+(i==="jpeg"?" /Filter /DCTDecode":"");await this.objects.stream(h,T,P,i==="jpeg"?!1:o.compression!==!1,!0);const I={name:w,id:h,width:n,height:e};return this.images.set(f,I),I}}function g(m){if(m.length<4||m[0]!==255||m[1]!==216||m[m.length-2]!==255||m[m.length-1]!==217)throw new TypeError("JPEG images need complete SOI/EOI markers.");let f;for(let a=2;a<m.length;){if(m[a++]!==255)throw new TypeError("Invalid JPEG marker.");for(;m[a]===255;)a++;const s=m[a++];if(s===218){if(!f)throw new TypeError("JPEG scan precedes its frame header.");return f}if(s===217)break;if(a+2>m.length)throw new TypeError("Truncated JPEG segment.");const o=m[a]*256+m[a+1],c=a+o;if(o<2||c>m.length)throw new TypeError("Truncated JPEG segment.");if(s===226&&o>=14&&String.fromCharCode(...m.subarray(a+2,a+14))==="ICC_PROFILE\0")throw new S("Normalize ICC-profiled JPEG colors before PDF embedding.");if(s===225&&o>=8&&String.fromCharCode(...m.subarray(a+2,a+8))==="Exif\0\0")throw new S("Normalize JPEG EXIF orientation before PDF embedding.");if(s>=192&&s<=207&&![196,200,204].includes(s)){if(![192,193,194].includes(s)||o<8||m[a+2]!==8)throw new S("PDF JPEG images require 8-bit baseline, sequential or progressive frames.");const i=m[a+7];if(![1,3].includes(i)||o!==8+i*3)throw new S("PDF JPEG images require grayscale or RGB components; CMYK is unsupported.");if(i===3){const r=[m[a+8],m[a+11],m[a+14]].join(",");if(r!=="1,2,3"&&r!=="82,71,66")throw new S("Unsupported JPEG component color layout.")}if(f)throw new S("Multiple JPEG frame headers are unsupported.");f={width:m[a+5]*256+m[a+6],height:m[a+3]*256+m[a+4],components:i}}a=c}throw new TypeError("JPEG image has no complete frame and scan.")}const x=Object.freeze({PdfDocumentImages:p});return B.set("7dca2d9ca5c43893abdaf86df5b1bcb1f3de3d5d33532d082fdfe04711999d21",x),x})(),gr=B.get("3290c84fdf80725af802f497d947bc088aa8d93d9db0a33f6f829f9153aa6fd6")??(()=>{const{OfficeIMOError:S}=ue,{checkAbort:R,pause:v,taskYieldDue:C}=be,{color:k,positive:b}=je,{pdfNumber:p}=Ae;async function g(m,f,a){const s=b(m.width,"Vector width"),o=b(m.height,"Vector height"),c=m.commands;if(!Array.isArray(c))throw new TypeError("Vector commands must be an array.");if(a+c.length>f.limits.maxVectorCommands)throw new S("RESOURCE_LIMIT","maxVectorCommands exceeded.");const i=c.map(T=>{if(!T||typeof T!="object")throw new TypeError("Invalid vector command.");const O=T.op;if(O==="move"||O==="line")return{op:O,x:T.x,y:T.y};if(O==="cubic")return{op:O,x1:T.x1,y1:T.y1,x2:T.x2,y2:T.y2,x:T.x,y:T.y};if(O==="close")return{op:O};throw new TypeError("Unsupported vector command.")}),r=m.fill,n=m.stroke,e=r===void 0?void 0:k(r),t=n===void 0?void 0:k(n);if(e===void 0&&t===void 0)throw new TypeError("A vector path requires fill or stroke.");const l=b(m.strokeWidth??1,"Vector stroke width",144),d=m.fillRule;if(d!==void 0&&!["nonzero","evenodd"].includes(d))throw new TypeError("Invalid vector fill rule.");const u=[];let h=0,w=!1;const y=(T,O)=>{if(!Number.isFinite(T)||T<0||T>O)throw new RangeError("Vector coordinates must stay inside their declared bounds.");return p(T)};for(let T=0;T<i.length;T++){const O=i[T];let E;if(!O||typeof O!="object")throw new TypeError("Invalid vector command.");if(O.op==="move"||O.op==="line"){if(O.op==="line"&&!w)throw new TypeError("A vector subpath must begin with move.");E=y(O.x,s)+" "+y(O.y,o)+(O.op==="move"?" m\n":" l\n"),w=!0}else if(O.op==="cubic"){if(!w)throw new TypeError("A vector subpath must begin with move.");E=[y(O.x1,s),y(O.y1,o),y(O.x2,s),y(O.y2,o),y(O.x,s),y(O.y,o)].join(" ")+" c\n"}else if(O.op==="close"){if(!w)throw new TypeError("Cannot close an empty vector path.");E="h\n"}else throw new TypeError("Unsupported vector command.");if(h+=E.length,h>f.limits.maxPageBytes-256)throw new S("RESOURCE_LIMIT","maxPageBytes exceeded by vector commands.");u.push(E),(T&1023)===1023&&(C()&&await v(),R(f.options.signal))}if(!w)throw new TypeError("A vector path needs at least one command.");return{width:s,height:o,count:i.length,content:(e===void 0?"":e+" rg\n")+(t===void 0?"":t+" RG\n"+p(l)+" w\n")+u.join("")+(e!==void 0&&t!==void 0?"B":e!==void 0?"f":"S")+(e!==void 0&&d==="evenodd"?"*":"")+"\n"}}const x=Object.freeze({vectorCommands:g});return B.set("3290c84fdf80725af802f497d947bc088aa8d93d9db0a33f6f829f9153aa6fd6",x),x})(),wr=B.get("da9ad00f94b9ae28e2e3de796928ff0c4eab1d73382b1441e7d779fad4278ef7")??(()=>{const{NotSupportedError:S,OfficeIMOError:R}=ue,{checkAbort:v,pause:C,taskYieldDue:k}=be,{color:b,positive:p}=je,{pdfNumber:g}=Ae;function x(r,n,e){if(!r||typeof r!="object"||Array.isArray(r)||Reflect.ownKeys(r).some(t=>typeof t!="string"||!n.includes(t)))throw new TypeError("Unsupported "+e+" properties.");return r}function m(r){x(r,["kind","drawing","alignment","alternativeText","decorative","caption"],"drawing block")}function f(r){if(typeof r!="number"||!Number.isFinite(r)||Math.abs(r)>1e6)throw new RangeError("Drawing coordinates must be finite and within -1,000,000 through 1,000,000 points.");return r}function a(r){const n=x(r,["x","y","width","height"],"drawing clip");return{x:f(n.x),y:f(n.y),width:p(n.width,"Drawing clip width",1e6),height:p(n.height,"Drawing clip height",1e6)}}async function s(r){k()&&await C(),v(r.options.signal)}function o(r,n,e){v(n.options.signal);const t=x(r,["version","width","height","elements"],"drawing");if(t.version!==1)throw new S("Only portable drawing version 1 is supported.");const l=p(t.width,"Drawing width"),d=p(t.height,"Drawing height");let u=e.commands,h=e.elements;const w=new Set;function y(P){x(P,["kind","commands","fill","stroke","strokeWidth","fillRule","lineCap","lineJoin"],"drawing path");const I=P.commands;if(!Array.isArray(I))throw new TypeError("Drawing path commands must be an array.");if(u+I.length>n.limits.maxVectorCommands)throw new R("RESOURCE_LIMIT","maxVectorCommands exceeded.");v(n.options.signal);const A=I.slice(),F=[];let N=!1;u+=A.length;const U=P.fill,M=P.stroke,Q=U===void 0?void 0:b(U),V=M===void 0?void 0:b(M);if(Q===void 0&&V===void 0)throw new TypeError("A drawing path requires fill or stroke.");const z=p(P.strokeWidth??1,"Drawing stroke width"),L=P.fillRule,G=P.lineCap,W=P.lineJoin;if(L!==void 0&&!["nonzero","evenodd"].includes(L))throw new TypeError("Invalid drawing fillRule.");if(G!==void 0&&!["butt","round","square"].includes(G))throw new TypeError("Invalid drawing lineCap.");if(W!==void 0&&!["miter","round","bevel"].includes(W))throw new TypeError("Invalid drawing lineJoin.");for(let K=0;K<A.length;K++){const X=A[K];if(!X||typeof X!="object")throw new TypeError("Invalid drawing path command.");const Z=X.op;if(Z==="move"||Z==="line"){if(x(X,["op","x","y"],"drawing path command"),Z==="line"&&!N)throw new TypeError("A drawing subpath must begin with move.");F.push({op:Z,x:f(X.x),y:f(X.y)}),N=!0}else if(Z==="cubic"){if(x(X,["op","x1","y1","x2","y2","x","y"],"drawing path command"),!N)throw new TypeError("A drawing subpath must begin with move.");F.push({op:"cubic",x1:f(X.x1),y1:f(X.y1),x2:f(X.x2),y2:f(X.y2),x:f(X.x),y:f(X.y)})}else if(Z==="close"){if(x(X,["op"],"drawing path command"),!N)throw new TypeError("Cannot close an empty drawing path.");F.push({op:"close"})}else throw new TypeError("Unsupported drawing path command.");(K&1023)===1023&&v(n.options.signal)}if(!N)throw new TypeError("A drawing path needs at least one command.");return{kind:"path",commands:F,style:(Q===void 0?"":Q+" rg\n")+(V===void 0?"":V+" RG\n"+g(z)+" w\n")+String(["butt","round","square"].indexOf(G??"butt"))+" J\n"+String(["miter","round","bevel"].indexOf(W??"miter"))+" j\n10 M\n",paint:(Q!==void 0&&V!==void 0?"B":Q!==void 0?"f":"S")+(Q!==void 0&&L==="evenodd"?"*":"")+"\n"}}function T(P){x(P,["kind","text","x","y","font","fontSize","color"],"drawing text");const I=P.text,A=P.font;if(typeof I!="string")throw new TypeError("Drawing text must be a string.");if(I.length>n.limits.maxCellCharacters)throw new R("RESOURCE_LIMIT","maxCellCharacters exceeded.");if(/[\r\n\u2028\u2029]/.test(I))throw new S("Drawing text must be a single baseline without line breaks.");if(!["regular","bold","italic","boldItalic"].includes(A))throw new TypeError("Invalid drawing font slot.");const F=f(P.x),N=f(P.y),U=p(P.fontSize,"Drawing font size"),M=b(P.color);return n.budget.cell(I),{kind:"text",text:I,x:F,y:N,size:U,color:M,font:A}}function O(P,I){if(!Array.isArray(P))throw new TypeError("Drawing elements must be an array.");if(I>32&&P.length)throw new RangeError("Drawing groups support at most 32 element levels.");if(h+P.length>n.limits.maxDrawingElements)throw new R("RESOURCE_LIMIT","maxDrawingElements exceeded.");v(n.options.signal);const A=P.slice(),F=[];for(let N=0;N<A.length;N++){if(++h>n.limits.maxDrawingElements)throw new R("RESOURCE_LIMIT","maxDrawingElements exceeded.");const U=A[N];if(!U||typeof U!="object")throw new TypeError("Invalid drawing element.");if(w.has(U))throw new TypeError("Drawing groups cannot contain cycles.");const M=U.kind;if(M==="path")F.push(y(U));else if(M==="text")F.push(T(U));else if(M==="group"){x(U,["kind","clip","elements"],"drawing group");const Q=U.clip,V=Q===void 0?void 0:a(Q);w.add(U),F.push({kind:"group",...V?{clip:V}:{},children:O(U.elements,I+1)}),w.delete(U)}else throw new TypeError("Unsupported drawing element kind.");(N&255)===255&&v(n.options.signal)}return F}const E=O(t.elements,1);return v(n.options.signal),{width:l,height:d,plan:E,commands:u-e.commands,elements:h-e.elements}}async function c(r,n,e,t){const l=o(r,n,t),d=new Map;function u(N){const U=d.get(N);if(U)return U;const M=e.select(N==="bold"||N==="boldItalic",N==="italic"||N==="boldItalic");if(!M.program||M.syntheticBold||M.syntheticItalic)throw new S("Drawing text without an exact embedded font face at fonts."+N);return d.set(N,M),M}let h=0,w=0;async function y(N){for(let U=0;U<N.length;U++){const M=N[U];if(M.kind==="group")await y(M.children);else if(M.kind==="text"){const Q=u(M.font);for(const V of M.text)Q.width(V.codePointAt(0)),(++h&1023)===0&&await s(n)}(++w&255)===0&&await s(n)}}await y(l.plan);const T=[];let O=0;function E(N){if(O+=N.length,O>n.limits.maxPageBytes-256)throw new R("RESOURCE_LIMIT","maxPageBytes exceeded by drawing content.");T.push(N)}let P=0,I=0,A=0;async function F(N){for(let U=0;U<N.length;U++){const M=N[U];if(E("q\n"),M.kind==="group")M.clip&&E([M.clip.x,M.clip.y,M.clip.width,M.clip.height].map(g).join(" ")+" re W n\n"),await F(M.children);else if(M.kind==="path"){E(M.style);for(let Q=0;Q<M.commands.length;Q++){const V=M.commands[Q];E(V.op==="move"||V.op==="line"?g(V.x)+" "+g(V.y)+(V.op==="move"?" m\n":" l\n"):V.op==="cubic"?[V.x1,V.y1,V.x2,V.y2,V.x,V.y].map(g).join(" ")+" c\n":"h\n"),(++I&1023)===0&&await s(n)}E(M.paint)}else{const Q=u(M.font);E(M.color+" rg\nBT /"+Q.name+" "+g(M.size)+" Tf 0 Tr 1 0 0 -1 "+g(M.x)+" "+g(M.y)+" Tm <");let V="";for(const z of M.text)V+=z,(++P&1023)===0&&(E(Q.encode(V).slice(1,-1)),V="",await s(n));V&&E(Q.encode(V).slice(1,-1)),E("> Tj ET\n")}E("Q\n"),(++A&255)===0&&await s(n)}}return await F(l.plan),v(n.options.signal),{width:l.width,height:l.height,content:T.join(""),commands:l.commands,elements:l.elements}}const i=Object.freeze({checkDrawingBlock:m,prepareDrawing:c});return B.set("da9ad00f94b9ae28e2e3de796928ff0c4eab1d73382b1441e7d779fad4278ef7",i),i})(),Rt=B.get("5e4503b77b357ee6d9fad1f52690085b0f0b140cd3b550b63c5100ed95a92f88")??(()=>{const{OfficeIMOError:S}=ue,{capturePdfText:R,wrapPdfText:v}=ft,{positive:C}=je,{resolveParagraphStyle:k}=kt,{captureBookmark:b}=St,{captureFields:p}=ke,{pdfBudgetText:g}=nt;function x(c,i,r,n=!1){if(!c||c.kind!=="paragraph")throw new TypeError("PDF paragraph groups accept paragraph blocks only.");const{text:e,headingLevel:t,presentation:l,fontSize:d,keepTogether:u,keepWithNext:h,spaceBefore:w,spaceAfter:y,style:T,bookmark:O}=c;if(t!==void 0&&(!Number.isInteger(t)||t<1||t>6))throw new TypeError("Paragraph headingLevel must be an integer from 1 through 6.");const E=k(T,{...d===void 0?{}:{fontSize:d},...l===void 0?{}:{presentation:l},...u===void 0?{}:{keepTogether:u},...h===void 0?{}:{keepWithNext:h},...w===void 0?{}:{spaceBefore:w},...y===void 0?{}:{spaceAfter:y}},i.paragraphStyles),P=E.presentation??Object.freeze({}),I=C(E.fontSize??i.fontSize,"Paragraph font size",144),A=b(O,i);return Object.freeze({text:R(e,P,i,r,!1,!n),style:P,size:I,...n?{budgetOnPaint:!0}:{},...t===void 0?{}:{headingLevel:t},...A===void 0?{}:{bookmark:A},keepTogether:E.keepTogether??!1,keepWithNext:E.keepWithNext??!1,spaceBefore:E.spaceBefore??0,spaceAfter:E.spaceAfter??8})}function m(c,i,r){if(!c||typeof c!="object"||Array.isArray(c)||Object.keys(c).some(n=>!["text","style","fontSize","presentation","spaceBefore","spaceAfter"].includes(n)))throw new TypeError("PDF captions support text, style, fontSize, presentation, spaceBefore and spaceAfter.");return x({...p(c,["text","style","fontSize","presentation","spaceBefore","spaceAfter"]),kind:"paragraph",keepTogether:!0,keepWithNext:!0},i,r,!0)}async function f(c,i,r,n=i.page.width-i.margins.left-i.margins.right){if(!c.text.text)return{...c,lines:[],height:0,firstHeight:0};if(!c.budgetOnPaint){const t=g(c.text.text,i.budget);i.budget.cell(t,t.length)}const e=await v(c.text,r,c.size,C(n,"Paragraph width"),i);return{...c,lines:e,height:c.spaceBefore+e.reduce((t,l)=>t+l.lineHeight,0)+c.spaceAfter,firstHeight:c.spaceBefore+e[0].lineHeight}}function a(c,i){if(c.length>i.limits.maxGroupBlocks)throw new S("RESOURCE_LIMIT","maxGroupBlocks exceeded.");let r=0,n=0;for(const e of c){if(r+=e.text.text.length,n+=e.text.runs.length,r>i.limits.maxCellCharacters)throw new S("RESOURCE_LIMIT","maxCellCharacters exceeded by a paragraph group or keep chain.");if(n>i.limits.maxTextRuns)throw new S("RESOURCE_LIMIT","maxTextRuns exceeded by a paragraph group or keep chain.")}}function s(c){const i=c.filter(n=>n.lines.length>0);let r=0;for(let n=i.length-1;n>=0;n--){const e=i[n];r=e.keepWithNext?e.height+r:e.keepTogether?e.height:e.firstHeight}return r}const o=Object.freeze({captureParagraph:x,captureCaption:m,prepareParagraph:f,checkParagraphBuffer:a,paragraphStartHeight:s});return B.set("5e4503b77b357ee6d9fad1f52690085b0f0b140cd3b550b63c5100ed95a92f88",o),o})(),br=B.get("1d57c429705ae0cbc14d98dcfef4c8a6c2df06f391c8f58e99cacb02f2d1cbc7")??(()=>{const{capturePdfText:S,wrapPdfText:R}=ft,{captureParagraph:v,prepareParagraph:C}=Rt,{resolveParagraphStyle:k}=kt;function b(x,m){const{items:f,ordered:a=!1,start:s,itemStyle:o,indent:c,markerGap:i}=x,r=s===void 0?1:s;if(typeof a!="boolean")throw new TypeError("PDF list ordered must be boolean.");if(!Number.isSafeInteger(r)||r<1)throw new RangeError("PDF list start must be a positive safe integer.");if(!a&&s!==void 0)throw new TypeError("PDF list start requires ordered:true.");for(const[n,e]of[["indent",c],["markerGap",i]])if(e!==void 0&&(!Number.isFinite(e)||e<0||e>14400))throw new RangeError("PDF list "+n+" must be from zero through 14,400 points.");if(k(o,{},m.paragraphStyles).keepWithNext)throw new TypeError("PDF list item styles cannot use keepWithNext.");return Object.freeze({items:f,ordered:a,start:r,...o===void 0?{}:{itemStyle:o},...c===void 0?{}:{indent:c},...i===void 0?{}:{markerGap:i}})}async function p(x,m,f,a,s){if(!x||typeof x!="object"||Array.isArray(x)||Object.keys(x).some(O=>!["text","style","keepTogether"].includes(O)))throw new TypeError("PDF list items support text, style and keepTogether.");if(!Number.isSafeInteger(m)||m<0||!Number.isSafeInteger(f.start+m))throw new RangeError("PDF list numbering must remain within positive safe integers.");const{text:o,style:c=f.itemStyle,keepTogether:i}=x,r=v({kind:"paragraph",text:o,...c===void 0?{}:{style:c},...i===void 0?{}:{keepTogether:i}},a,s);if(r.keepWithNext)throw new TypeError("PDF list item styles cannot use keepWithNext.");if(!r.text.text.trim().length)throw new TypeError("PDF list items require nonempty text.");const n=f.ordered?String(f.start+m)+".":"•",e=S(n,r.style,a,s);a.budget.cell(n,n.length);const t=a.page.width-a.margins.left-a.margins.right,l=(await R(e,s,r.size,t,a,!1))[0],d=f.markerGap??r.size/2,u=f.indent??Math.max(r.size*2,l.width+d);if(l.width+d>u+.001)throw new RangeError("PDF list indent cannot fit its marker and gap.");if(u>=t)throw new RangeError("PDF list indent leaves no body text area.");const h=await C(r,a,s,t-u),w=h.lines[0],y=Math.max(w.lineHeight,l.lineHeight),T=Math.max(w.ascent,l.ascent);return{marker:l,indent:u,markerGap:d,paragraph:{...h,lines:[{...w,lineHeight:y,ascent:T},...h.lines.slice(1)],height:h.height+y-w.lineHeight,firstHeight:h.spaceBefore+y}}}const g=Object.freeze({captureListOptions:b,prepareListItem:p});return B.set("1d57c429705ae0cbc14d98dcfef4c8a6c2df06f391c8f58e99cacb02f2d1cbc7",g),g})(),Pt=B.get("d04686d2c067355dfd215333b83eb5f79f96e9e4be49f942e050f21ac0795343")??(()=>{const{assertGroupedReportSource:S}=Me,{captureFields:R}=ke,{captureWideTable:v}=je,{presentation:C}=Xe,k=["labelColumn","subtotalLabel","grandTotalLabel","includeGrandTotal","continuationLabel","groupHeadingLevel"],b=["includeHeader","headerPresentation","footerPresentation","alternateRowColor","columnWidths","wideTable","formatValue","formatRuns",...k];function p(m,f){return S(m),Object.freeze({kind:"groupedTable",report:m,options:g(f)})}function g(m){if(!m||typeof m!="object"||Array.isArray(m)||Object.keys(m).some(t=>!b.includes(t)))throw new TypeError("Grouped PDF table options support table presentation and labels; document settings belong on writePdfDocument.");const f=R(m,b),{labelColumn:a,subtotalLabel:s,grandTotalLabel:o,includeGrandTotal:c,continuationLabel:i,groupHeadingLevel:r}=f;if(!a||typeof a!="object")throw new TypeError("Grouped PDF needs a leading labelColumn.");const{header:n,width:e}=a;if(typeof n!="string")throw new TypeError("The grouped label column header must be text.");for(const[t,l]of[["subtotalLabel",s],["grandTotalLabel",o]])if(typeof l!="function")throw new TypeError(t+" must be a synchronous text callback.");if(i!==void 0&&typeof i!="function")throw new TypeError("continuationLabel must be a synchronous text callback.");if(c!==void 0&&typeof c!="boolean")throw new TypeError("includeGrandTotal must be boolean.");if(r!==void 0&&(!Number.isInteger(r)||r<1||r>6))throw new TypeError("groupHeadingLevel must be an integer from 1 through 6.");return Object.freeze({...f,...f.wideTable===void 0?{}:{wideTable:v(f.wideTable)},labelColumn:Object.freeze({header:n,...e===void 0?{}:{width:e}}),...f.columnWidths===void 0?{}:{columnWidths:Object.freeze([...f.columnWidths])},...f.headerPresentation===void 0?{}:{headerPresentation:C(f.headerPresentation)},...f.footerPresentation===void 0?{}:{footerPresentation:C(f.footerPresentation)}})}const x=Object.freeze({groupedPdfLabelFields:k,groupedPdfTableFields:b,pdfGroupedTable:p,captureGroupedPdfTableOptions:g});return B.set("d04686d2c067355dfd215333b83eb5f79f96e9e4be49f942e050f21ac0795343",x),x})(),yr=B.get("289fa3a052c7fbab2a3ca0fb91fb9974db709d24b7d850f1175810258f0409a0")??(()=>{const{assertGroupedReportSource:S,groupedReportOperation:R}=Me,{consumeRows:v}=be,{ExportCell:C}=Se,{captureGroupedPdfTableOptions:k}=Pt,{settings:b}=je,{PdfTableLayout:p}=Ct,{captureCaption:g,captureParagraph:x,prepareParagraph:m}=Rt,{synchronousText:f}=nt;async function a(o,c){const{report:i}=o,{pages:r,fonts:n,prepared:e,controller:t}=c;S(i);const l=e.options.tagged!==void 0,d=k(o.options),{labelColumn:u,subtotalLabel:h,grandTotalLabel:w,includeGrandTotal:y=!0,continuationLabel:T,groupHeadingLevel:O=2,...E}=d,P=Object.freeze([Object.freeze({...u}),...i.columns]);let I=-1;const A=V=>({rowIndex:I,columnIndex:V.columnIndex-1,column:i.columns[V.columnIndex-1]}),F=b({...r.settings.options,...E,columns:P,includeHeader:E.includeHeader??!0,...E.formatValue===void 0?{}:{formatValue:(V,z)=>E.formatValue(V,A(z))},...E.formatRuns===void 0?{}:{formatRuns:(V,z)=>E.formatRuns(V,A(z))}}),N={...F,budget:e.budget},U=new p(N,n);c.acceptColumns(P.length);const M=R(i,t.signal),Q=()=>t.abort(M.signal?.reason);M.signal?.addEventListener("abort",Q,{once:!0}),M.signal?.aborted&&Q();try{const V=await U.headers(),z=await U.blockHeight(V);let L=[],G=!1,W=!1,K=!1,X=0;const Z=new WeakMap;let se;const D=[],q=i.columns.flatMap((_,$)=>Object.hasOwn(i.totals,_.key)?[$]:[]),J=(_,$,ie)=>Object.freeze([new C(_,{text:_,presentation:F.options.footerPresentation}),...(ie?ie.map(ce=>$[ce]):$).map(ce=>new C(ce,{presentation:F.options.footerPresentation}))]),re=new Map,le=_=>{const $=re.get(_);if($)return $;const ie=[0,...q.map(Y=>Y+1)],ce=ie.map(Y=>{const te=P[Y];if(!_)return te;const{groups:de,...ge}=te;return ge}),ae=Y=>{const te=ie[Y.columnIndex];return{...Y,columnIndex:te,column:P[te]}},fe=ie.flatMap((Y,te)=>Y===0||F.repeatedColumns.includes(Y)?[te]:[]),we=F.options.wideTable,pe={...N,repeatedColumns:Object.freeze(fe),options:{...F.options,columns:ce,...F.options.columnWidths===void 0?{}:{columnWidths:ie.map(Y=>F.options.columnWidths[Y])},...typeof we!="object"?{}:{wideTable:{...we,repeatColumns:fe}},...F.options.formatValue===void 0?{}:{formatValue:(Y,te)=>F.options.formatValue(Y,ae(te))},...F.options.formatRuns===void 0?{}:{formatRuns:(Y,te)=>F.options.formatRuns(Y,ae(te))}}},ee=new p(pe,n);return re.set(_,ee),ee},oe=async()=>{const _=await m(g({text:L.map(ie=>ie.label).join("\n"),presentation:{bold:!0},spaceAfter:4},r.settings,n),r.settings,n),$=await m(g({text:L.map(ie=>{if(T===void 0)return ie.label;const ce=l?Z.get(ie):void 0;if(ce!==void 0)return ce;const ae=f(T(ie),"continuationLabel");return l&&Z.set(ie,ae),ae}).join("\n"),presentation:{bold:!0},spaceAfter:4},r.settings,n),r.settings,n);return{caption:_,continuation:$}},ne=async()=>{if(se)if(G||await ye(se),D.length&&!K)await r.keptRows([se,...D],W);else if(D.length){await r.row(se,W);for(const _ of D)await r.row(_)}else await r.row(se,W);else for(const _ of D)await r.row(_);se=void 0,D.length=0,W=!1,K=!1},he=async()=>{!G&&!se||(await ne(),await r.endTable(),G=!1)},ye=async _=>{const{caption:$,continuation:ie}=await oe(),ce=_.height+D.reduce((de,ge)=>de+ge.height,0),ae=F.page.height-F.margins.top-F.margins.bottom-z-Math.max($?.height??0,ie.height);K=D.length>0&&ce>ae+.001;const fe=D.length>0&&!K?ce:U.minimumRowHeight(_),we=[];if(l)for(const de of L.slice(X))we.push(await m(x({kind:"paragraph",text:de.label.trim()?de.label:"",headingLevel:O+de.level,presentation:{bold:!0},keepTogether:!0,keepWithNext:!0,spaceAfter:4,...de.label.trim()?{bookmark:{title:de.label,level:O+de.level}}:{}},r.settings,n),r.settings,n));const pe=we.reduce((de,ge)=>de+ge.height,0),ee=l&&X>0?await m(g({text:L.slice(0,X).map(de=>de.label).join("\n"),presentation:{bold:!0},spaceAfter:4},r.settings,n),r.settings,n):void 0,Y=l?(ee?.height??0)+pe:$.height;await c.flushParagraphs(Y+z+fe),ee&&await r.paragraphs([ee],pe+z+fe,!0,{artifact:!0});let te=pe+(l?0:$.height)+z+fe;for(const de of we)te-=de.height,await r.beginGroup(X++,de,te);await r.beginTable(U,V,fe,$,ie,!1,l,l),G=!0,W=($?.lines.length??0)>0||we.some(de=>de.lines.length>0)},j=async(_,$,ie)=>{if($===i.groupBy.length-1){r.summary(_),D.push(_),await he(),await r.endGroup($),X=$,L=L.slice(0,$);return}await he();const{caption:ce,continuation:ae}=await oe(),fe=le(!1),we=await fe.headers(),pe=await fe.data(ie,0,!0),ee=fe.minimumRowHeight(pe);await c.flushParagraphs(ce.height+await fe.blockHeight(we)+ee),await r.beginTable(fe,we,ee,ce,ae,!1,!0),r.summary(pe),await r.row(pe,ce.lines.length>0||we.length>0),await r.endTable(),await r.endGroup($),X=$,L=L.slice(0,$)},H=async _=>{if(await he(),!y&&_.rows!==0)return;const $=_.rows===0?U:le(!0),ie=_.rows===0?V:await $.headers();I=-1;let ce;if(y&&(c.acceptRow(!1),ce=await $.data(J(f(w(_),"grandTotalLabel"),_.totals,_.rows===0?void 0:q),0,!0)),!ie.length&&!ce)return;const ae=ce?$.minimumRowHeight(ce):0;await c.flushParagraphs(await $.blockHeight(ie)+ae),await r.beginTable($,ie,ae),ce&&(l&&r.summary(ce),await r.row(ce)),await r.endTable()};await v(M.events,M.signal,async _=>{switch(_.kind){case"groupStart":if(await he(),l&&O+_.level>6)throw new RangeError("groupHeadingLevel and the opened group depth exceed heading level 6.");L=Object.freeze([...L.slice(0,_.level),_]);break;case"row":{se&&await ne(),I=_.rowIndex,c.acceptRow(!0),se=await U.data([new C("",{text:""}),..._.values],_.rowIndex);break}case"groupEnd":{I=-1,c.acceptRow(!1);const $=l&&_.level!==i.groupBy.length-1,ie=J(f(h(_),"subtotalLabel"),_.totals,$?q:void 0),ce=$?void 0:await U.data(ie,0,!0);l?await j(ce,_.level,ie):D.push(ce);break}case"complete":await H(_);break}})}finally{M.signal?.removeEventListener("abort",Q),M.dispose()}}const s=Object.freeze({renderGroupedPdfTable:a});return B.set("289fa3a052c7fbab2a3ca0fb91fb9974db709d24b7d850f1175810258f0409a0",s),s})(),ut=B.get("9051bf9fc3168e24b53b16c123a42816198456846003fb49191c03a18cdab904")??(()=>{const{BlobByteSink:S,withDestination:R}=Oe,{OfficeIMOError:v}=ue,{beginTask:C,checkAbort:k,consumeRows:b,pause:p,taskYieldDue:g}=be,{notifyProgress:x}=Ke,{copyColumns:m,createRowProjector:f}=Ue,{captureFields:a}=ke,{settings:s,captureWideTable:o}=je,{pdfNumber:c}=Ae,{PdfTableLayout:i}=Ct,{PdfWriteSession:r}=Nt,{PdfDocumentImages:n}=mr,{vectorCommands:e}=gr,{graphicAlternative:t}=Mt,{checkDrawingBlock:l,prepareDrawing:d}=wr,{captureParagraph:u,captureCaption:h,prepareParagraph:w,checkParagraphBuffer:y,paragraphStartHeight:T}=Rt,{captureListOptions:O,prepareListItem:E}=br,{captureSection:P}=St,{renderGroupedPdfTable:I}=yr,A=["columns","includeHeader","headerRows","footer","headerPresentation","footerPresentation","alternateRowColor","columnWidths","wideTable","formatValue","formatRuns"];function F(z,L){const G=Q(L);return Object.freeze({kind:"table",rows:z,options:Object.freeze({...G,columns:Object.freeze(m(G.columns))})})}async function N(z,L={}){const G=new S;try{return await U(z,G,L),G.toBlob("application/pdf")}catch(W){throw G.discard(),W}}async function U(z,L,G={}){const W=s(G,!0),K=new AbortController,X=W.options.signal,Z=()=>K.abort(X?.reason);X?.addEventListener("abort",Z,{once:!0}),X?.aborted&&Z();const se={...W,options:{...W.options,signal:K.signal}},{options:D,budget:q}=se;try{return C(),k(D.signal),await R(L,async J=>{const re=new r(J,se),{objects:le,pages:oe,fonts:ne}=re,he=new n(le,se);let ye=0,j=0,H=0,_=0,$=0,ie=0,ce=[];const ae=async(ee=0)=>{const Y=[];for(const te of ce)Y.push(await w(te,oe.settings,ne));ce=[],await oe.paragraphs(Y,ee)},fe=async ee=>{const Y=u(ee,oe.settings,ne);Y.text.text&&(ce.length||Y.keepWithNext?(ce.push(Y),y(ce,oe.settings),Y.keepWithNext||await ae()):await oe.paragraphs([await w(Y,oe.settings,ne)]))},we=async ee=>ee===void 0?void 0:w(ee,oe.settings,ne),pe=ee=>ee===void 0?void 0:h(ee,oe.settings,ne);return await re.start(),await b(z,D.signal,async ee=>{if(!ee||typeof ee!="object")throw new TypeError("PDF document blocks must be objects.");switch(ee.kind){case"section":{const Y=P(ee,se);await ae();const te=await oe.beginSection(Y);te.includeHeading?await fe({kind:"paragraph",text:te.title,headingLevel:te.level,...te.headingStyle===void 0?{fontSize:oe.settings.fontSize*1.5,presentation:{bold:!0}}:{style:te.headingStyle},keepTogether:!0,keepWithNext:!0,...te.bookmark?{bookmark:{title:te.title,level:te.level}}:{}}):te.bookmark&&oe.addBookmark({title:te.title,level:te.level});break}case"paragraph":await fe(ee);break;case"list":{const Y=O(ee,oe.settings);let te=0,de;await b(Y.items,D.signal,async ge=>{if(++ie>se.limits.maxListItems)throw new v("RESOURCE_LIMIT","maxListItems exceeded.");const me=await E(ge,te++,Y,oe.settings,ne);te===1&&(await ae(me.paragraph.keepTogether?me.paragraph.height:me.paragraph.firstHeight),de=re.structure?.element("L")),await oe.listItem(me,de),g()&&await p(),k(D.signal)}),await re.structure?.complete(de);break}case"group":{const Y=ee.blocks,te=ee.keepTogether;if(!Array.isArray(Y))throw new TypeError("PDF paragraph group blocks must be an array.");if(te!==void 0&&typeof te!="boolean")throw new TypeError("PDF paragraph group keepTogether must be boolean.");if(Y.length>se.limits.maxGroupBlocks)throw new v("RESOURCE_LIMIT","maxGroupBlocks exceeded.");const de=[];for(const me of Y)de.push(u(me,oe.settings,ne)),y(de,se);if(de.filter(me=>me.text.text).at(-1)?.keepWithNext)throw new TypeError("The last paragraph in a group cannot keepWithNext beyond the group's boundary.");const ge=[];for(const me of de)ge.push(await w(me,oe.settings,ne));if(!ge.some(me=>me.lines.length>0))break;await ae(te!==!1?ge.reduce((me,ve)=>me+ve.height,0):T(ge)),await oe.paragraphs(ge,0,te!==!1);break}case"pageBreak":await ae(),await oe.pageBreak();break;case"groupedTable":await I(ee,{prepared:se,pages:oe,fonts:ne,controller:K,flushParagraphs:ae,acceptColumns:Y=>{H=Math.max(H,Y)},acceptRow:Y=>{q.row(++j),Y&&++ye%256===0&&x(D.onProgress,{phase:"rows",rows:ye,bytes:le.bytes})}});break;case"table":{const{options:Y,rows:te,caption:de,continuationCaption:ge}=ee,me=Q(Y),ve=pe(de),ze=pe(ge),Ce=s({...oe.settings.options,...me,columns:me?.columns,includeHeader:me?.includeHeader??!0}),Ee=new i({...Ce,budget:q},ne),xe=await we(ve),Te=await we(ze),Ze=f(Ce.options.columns,void 0,D.signal);let De=0,Ie=!1;H=Math.max(H,Ce.options.columns.length);const Pe=await Ee.headers(),We=await Ee.blockHeight(Pe);await b(te,D.signal,async pt=>{q.row(++j);const Ut=await Ee.data(Ze(pt,De),De),kr=!Ie&&(ce.length>0||!!xe?.lines.length);if(!Ie){const Ht=Ee.minimumRowHeight(Ut);await ae((xe?.height??0)+We+Ht),await oe.beginTable(Ee,Pe,Ht,xe,Te),Ie=!0}await oe.row(Ut,kr),De++,ye++,ye%256===0&&x(D.onProgress,{phase:"rows",rows:ye,bytes:le.bytes}),g()&&await p(),k(D.signal)});const Be=await Ee.footer(De),Er=!Ie&&(ce.length>0||!!xe?.lines.length);if(!Ie){if(!Pe.length&&!Be?.length)break;const pt=Be?.length?Ce.options.footer?.rows?await Ee.blockHeight(Be):Ee.minimumRowHeight(Be[0]):0;await ae((xe?.height??0)+We+pt),await oe.beginTable(Ee,Pe,pt,xe,Te)}Be&&(Ce.options.footer?.rows?await oe.block(Be):await oe.row(Be[0],Er)),await oe.endTable();break}case"image":{const{width:Y,height:te,image:de,caption:ge}=ee,me=pe(ge),ve=t(ee,oe.settings),ze=M(ee.alignment);if(me&&ve===void 0)throw new TypeError("A captioned PDF graphic requires alternativeText and cannot be decorative.");const Ce=await he.prepare(de),Ee=await we(me),xe=Y??(te===void 0?Ce.width*.75:te*Ce.width/Ce.height),Te=te??xe*Ce.height/Ce.width;if(!Number.isFinite(xe)||xe<=0||!Number.isFinite(Te)||Te<=0)throw new RangeError("Image display dimensions must be finite and positive.");await ae((Ee?.height??0)+oe.graphicHeight(xe,Te)),oe.registerXObject(Ce.name,Ce.id),await oe.graphic(xe,Te,ze,(Ze,De,Ie,Pe)=>"q "+[Ie,0,0,Pe,Ze,De].map(c).join(" ")+" cm /"+Ce.name+" Do Q\n",ve,Ee);break}case"vector":{const Y=pe(ee.caption),te=t(ee,oe.settings),de=M(ee.alignment);if(Y&&te===void 0)throw new TypeError("A captioned PDF graphic requires alternativeText and cannot be decorative.");const ge=await e(ee,oe.settings,_),me=await we(Y);_+=ge.count,await ae((me?.height??0)+oe.graphicHeight(ge.width,ge.height)),await oe.graphic(ge.width,ge.height,de,(ve,ze,Ce,Ee)=>"q "+[Ce/ge.width,0,0,-Ee/ge.height,ve,ze+Ee].map(c).join(" ")+" cm 0 0 "+c(ge.width)+" "+c(ge.height)+" re W n\n"+ge.content+"Q\n",te,me);break}case"drawing":{l(ee);const Y=ee.drawing,te=pe(ee.caption),de=t(ee,oe.settings),ge=M(ee.alignment);if(te&&de===void 0)throw new TypeError("A captioned PDF graphic requires alternativeText and cannot be decorative.");const me=await d(Y,oe.settings,ne,{commands:_,elements:$}),ve=await we(te);_+=me.commands,$+=me.elements,await ae((ve?.height??0)+oe.graphicHeight(me.width,me.height)),await oe.graphic(me.width,me.height,ge,(ze,Ce,Ee,xe)=>"q "+[Ee/me.width,0,0,-xe/me.height,ze,Ce+xe].map(c).join(" ")+" cm 0 0 "+c(me.width)+" "+c(me.height)+" re W n\n"+me.content+"Q\n",de,ve);break}default:throw new TypeError("Unsupported PDF document block.")}g()&&await p(),k(D.signal)}),await ae(),D.messageBottom&&await oe.paragraph(D.messageBottom),await re.finish(),x(D.onProgress,{phase:"complete",rows:ye,bytes:le.bytes}),k(D.signal),{rows:ye,columns:H,bytes:le.bytes}})}finally{X?.removeEventListener("abort",Z)}}function M(z){if(z!==void 0&&!["left","center","right"].includes(z))throw new TypeError("Invalid graphic alignment.");return z??"left"}function Q(z){if(!z||typeof z!="object"||Object.keys(z).some(G=>!A.includes(G)))throw new TypeError("Table options support columns, headings, footers, widths and presentation; document settings belong on writePdfDocument.");const L=a(z,A);return{...L,...L.wideTable===void 0?{}:{wideTable:o(L.wideTable)}}}const V=Object.freeze({pdfTable:F,writePdfDocument:N,writePdfDocumentTo:U});return B.set("9051bf9fc3168e24b53b16c123a42816198456846003fb49191c03a18cdab904",V),V})(),qe=B.get("abe76e52ffeed11ab42477c83ddde1d1d7de28b803096436b5b23cb153af58ba")??(()=>{const{assertGroupedReportSource:S}=Me,{BlobByteSink:R}=Oe,{writePdfDocumentTo:v}=ut,{pdfOptionFields:C}=je,{captureFields:k}=ke,{pdfGroupedTable:b,groupedPdfLabelFields:p,groupedPdfTableFields:g}=Pt,x=[...C,...p];async function m(s,o){const c=new R;try{return await f(s,c,o),c.toBlob("application/pdf")}catch(i){throw c.discard(),i}}async function f(s,o,c){if(S(s),!c||typeof c!="object")throw new TypeError("Grouped PDF options are required.");const i=k(c,x),r=Object.fromEntries(g.filter(e=>Object.hasOwn(i,e)).map(e=>[e,i[e]])),n={...i};for(const e of g)delete n[e];return delete n.columns,delete n.headerRows,delete n.footer,v([b(s,r)],o,n)}const a=Object.freeze({pdfGroupedTable:Pt.pdfGroupedTable,writeGroupedPdf:m,writeGroupedPdfTo:f});return B.set("abe76e52ffeed11ab42477c83ddde1d1d7de28b803096436b5b23cb153af58ba",a),a})(),xr=B.get("3d777096288d1be55a05a80bc015d4674212e587703f25a7e7cf99a8065feb86")??(()=>{const{fontProgram:S}=rt,{resolveScalar:R,selectFont:v,validateFonts:C}=Lt;function k(p,g={}){if(typeof p!="string")throw new TypeError("PDF preflight text must be a string.");if(!g||typeof g!="object")throw new TypeError("PDF preflight options must be an object.");for(const s of["bold","italic"])if(g[s]!==void 0&&typeof g[s]!="boolean")throw new TypeError("PDF preflight "+s+" must be boolean.");C(g.fonts);const x=g.bold??!1,{font:m}=v(g.fonts,x,g.italic??!1),f=m?S(m):void 0,a=new Set;for(let s=0;s<p.length;){const o=p.codePointAt(s),c=o===9?32:o;if(o!==10&&o!==13&&!a.has(c)){const i=R(c,f,x);if(!i.supported)return{...i,index:s,...i.code==="unpaired-surrogate"?{}:{scalar:o}};a.add(c)}s+=o>65535?2:1}return{supported:!0}}const b=Object.freeze({preflightPdfText:k});return B.set("3d777096288d1be55a05a80bc015d4674212e587703f25a7e7cf99a8065feb86",b),b})(),He=B.get("027aafa08408056b10d7d717d63d1f7c0ee20ecfc68213aa66feacc75ec525fe")??(()=>{const S=Object.freeze({writePdf:_t.writePdf,writePdfTo:_t.writePdfTo,writeGroupedPdf:qe.writeGroupedPdf,writeGroupedPdfTo:qe.writeGroupedPdfTo,pdfGroupedTable:qe.pdfGroupedTable,createGroupedReport:Me.createGroupedReport,writePdfDocument:ut.writePdfDocument,writePdfDocumentTo:ut.writePdfDocumentTo,pdfTable:ut.pdfTable,PdfFont:rt.PdfFont,preflightPdfText:xr.preflightPdfText,ExportCell:Se.ExportCell,saveBlob:Ne.saveBlob});return B.set("027aafa08408056b10d7d717d63d1f7c0ee20ecfc68213aa66feacc75ec525fe",S),S})(),Tr=B.get("110c4a3e9a69d6b2bb50ac123a355f60aaa1d1e37e572c919bc19f4f4ec2782e")??(()=>{const S=Object.freeze({core:Ne,zip:Ot,xml:Re,opc:$e,xlsx:_e,csv:Et,pdf:He,Workbook:_e.Workbook,Worksheet:_e.Worksheet,Cell:_e.Cell,FormulaCell:_e.FormulaCell,StyleRegistry:_e.StyleRegistry,NumberFormats:_e.NumberFormats,writeXlsx:_e.writeXlsx,writeXlsxTo:_e.writeXlsxTo,writeCsv:Et.writeCsv,writeCsvTo:Et.writeCsvTo,createGroupedReport:Me.createGroupedReport,writeGroupedXlsx:Ve.writeGroupedXlsx,writeGroupedXlsxTo:Ve.writeGroupedXlsxTo,addGroupedXlsx:Ve.addGroupedXlsx,writeGroupedPdf:qe.writeGroupedPdf,writeGroupedPdfTo:qe.writeGroupedPdfTo,pdfGroupedTable:qe.pdfGroupedTable,writePdf:He.writePdf,writePdfTo:He.writePdfTo,writePdfDocument:He.writePdfDocument,writePdfDocumentTo:He.writePdfDocumentTo,pdfTable:He.pdfTable,PdfFont:He.PdfFont,preflightPdfText:He.preflightPdfText,OfficeIMOError:Ne.OfficeIMOError,NotSupportedError:Ne.NotSupportedError,detectFeatures:Ne.detectFeatures,saveBlob:Ne.saveBlob,ExportCell:Ne.ExportCell});return B.set("110c4a3e9a69d6b2bb50ac123a355f60aaa1d1e37e572c919bc19f4f4ec2782e",S),S})();Object.assign(st,Tr)})(globalThis);
|
|
2
|
+
(function(Ot){"use strict";const it=Ot.OfficeIMO||(Ot.OfficeIMO={}),gt=Symbol.for("@evotecit/officeimo/modules"),N=it[gt]||new Map;it[gt]||Object.defineProperty(it,gt,{value:N});const pe=N.get("d5c945064d81fdd257960f48c421125e106e5f270427d170bb05587dd96a44ea")??(()=>{const S=Symbol.for("@evotecit/officeimo/OfficeIMOError"),R=Symbol.for("@evotecit/officeimo/NotSupportedError");class O extends Error{code;static[Symbol.hasInstance](m){return this!==O?Function.prototype[Symbol.hasInstance].call(this,m):!!m&&typeof m=="object"&&m[S]===!0}constructor(m,b,x){super(b,x),this.code=m,Object.defineProperty(this,S,{value:!0}),this.name="OfficeIMOError"}}class C extends O{feature;static[Symbol.hasInstance](m){return this!==C?Function.prototype[Symbol.hasInstance].call(this,m):!!m&&typeof m=="object"&&m[R]===!0}constructor(m){super("NOT_SUPPORTED",m+" is not supported yet."),this.feature=m,Object.defineProperty(this,R,{value:!0}),this.name="NotSupportedError"}}const k=Object.freeze({OfficeIMOError:O,NotSupportedError:C});return N.set("d5c945064d81fdd257960f48c421125e106e5f270427d170bb05587dd96a44ea",k),k})(),be=N.get("87c24efeaa0f1579c19afeeb4918caeb4f8f65a88d24a246e2cfd712b37dbac3")??(()=>{function S(c){if(c?.aborted)throw c.reason}function R(c,o){return o?new Promise((s,r)=>{const n=()=>o.removeEventListener("abort",e),e=()=>{n(),r(o.reason)};o.addEventListener("abort",e,{once:!0}),Promise.resolve(c).then(t=>{n(),s(t)},t=>{n(),r(t)}),o.aborted&&e()}):Promise.resolve(c)}async function*O(c,o){S(o);const s=c?.[Symbol.asyncIterator]?.()??c?.[Symbol.iterator]?.();if(!s)throw new TypeError("Rows must be a synchronous or asynchronous iterable.");let r=!1,n=!1;try{for(;;){S(o);const e=await R(Promise.resolve(s.next()),o);if(S(o),e.done){r=!0;return}yield e.value}}catch(e){throw n=!0,e}finally{if(!r&&s.return)try{const e=s.return();o?.aborted||n?Promise.resolve(e).catch(()=>{}):await R(Promise.resolve(e),o)}catch(e){if(!o?.aborted&&!n)throw e}}}const C=new WeakMap;function k(c){let o=!1;const s=()=>{if(o)throw new TypeError("A row source can be consumed only once.");o=!0},r={[Symbol.asyncIterator](){return s(),n()}};async function*n(){for await(const e of O(c))yield*e}return C.set(r,(e,t)=>(s(),m(c,e,l=>m(l,e,t)))),r}function y(...c){const o={async*[Symbol.asyncIterator](){for(const s of c)yield*s}};return C.set(o,async(s,r)=>{for(const n of c)await m(n,s,r)}),o}async function m(c,o,s){S(o);const r=C.get(c);if(r)return r(o,s);const n=c?.[Symbol.asyncIterator]?.()??c?.[Symbol.iterator]?.();if(!n)throw new TypeError("Rows must be a synchronous or asynchronous iterable.");let e=!1;try{for(;;){S(o);let t=n.next();const l=t;typeof l?.then=="function"&&(t=await R(l,o)),S(o);const d=t;if(d.done){e=!0;return}let f=d.value;typeof f?.then=="function"&&(f=await R(f,o)),S(o);const h=s(f);h!==void 0&&await R(h,o)}}finally{if(!e&&n.return)try{Promise.resolve(n.return()).catch(()=>{})}catch{}}}let b;const x=32;function w(){b=performance.now()+x}function u(){const c=performance.now();return b??=c+x,c>=b}function a(){const c=globalThis.scheduler;return typeof c?.postTask=="function"?c.postTask(()=>{b=performance.now()+x},{priority:"user-visible"}):new Promise(o=>{setTimeout(function(){b=performance.now()+x,o()},0)})}const i=Object.freeze({checkAbort:S,withAbort:R,inputRows:O,rowsFromBatches:k,concatRows:y,consumeRows:m,beginTask:w,taskYieldDue:u,pause:a});return N.set("87c24efeaa0f1579c19afeeb4918caeb4f8f65a88d24a246e2cfd712b37dbac3",i),i})(),Oe=N.get("5337d1e3bd5ae0c1d10a476fcd31540d20337ccf7aa93c7e9e26c2b1a7dab92b")??(()=>{const{checkAbort:S,consumeRows:R,withAbort:O,pause:C,taskYieldDue:k}=be,{OfficeIMOError:y}=pe;async function m(a,i){if(a&&typeof a.getWriter=="function"){const c=a.getWriter();try{return await i({write:o=>c.write(new Uint8Array(o))})}finally{c.releaseLock()}}if(!a||typeof a.write!="function")throw new TypeError("Destination must be a ByteSink or WritableStream.");return i(a)}class b{parts=[];state="open";result;write(i){if(this.state!=="open")throw new y("INVALID_STATE","Byte sink is closed.");this.parts.push(new Uint8Array(i))}toBlob(i="application/octet-stream"){if(this.state==="discarded")throw new y("INVALID_STATE","Byte sink was discarded.");return this.state="closed",this.result||(this.result=new Blob(this.parts,{type:i}),this.parts=[]),this.result.type===i?this.result:new Blob([this.result],{type:i})}takeChunks(){if(this.state!=="open")throw new y("INVALID_STATE","Byte sink is closed.");const i=this.parts;return this.parts=[],this.state="discarded",i}discard(){this.parts=[],this.result=void 0,this.state="discarded"}}class x{sink;signal;chunkSize;text="";encoder=new TextEncoder;constructor(i,c,o=32768){if(this.sink=i,this.signal=c,this.chunkSize=o,!Number.isInteger(o)||o<2)throw new RangeError("Text chunk size must be at least 2.")}append(i){return S(this.signal),this.text+=i,this.text.length>=this.chunkSize||k()}async flush(i=!1){for(S(this.signal);this.text.length;){let c=Math.min(this.text.length,this.chunkSize);if(/[\ud800-\udbff]/.test(this.text[c-1])&&(c<this.text.length||!i)&&c--,!c)break;const o=this.encoder.encode(this.text.slice(0,c));this.text=this.text.slice(c),await O(Promise.resolve(this.sink.write(o)),this.signal),k()&&await C(),S(this.signal)}}async write(i){this.append(i)&&await this.flush()}async close(){await this.flush(!0)}}async function w(a,i,c){await R(a instanceof Uint8Array?[a]:a,c,o=>{if(!(o instanceof Uint8Array))throw new TypeError("Byte sources must yield Uint8Array chunks.");const s=i.write(o);return k()?Promise.resolve(s).then(()=>(S(c),C())):s})}const u=Object.freeze({withDestination:m,BlobByteSink:b,ChunkedTextSink:x,writeBytes:w});return N.set("5337d1e3bd5ae0c1d10a476fcd31540d20337ccf7aa93c7e9e26c2b1a7dab92b",u),u})(),Me=N.get("501f5fccaecb27d9e514b74cf64893649e50616692250593d120ca315b510c04")??(()=>{function S(O){if(O===null||typeof O!="object")return!1;try{return!(O instanceof Date)&&!(Symbol.toStringTag in O)&&Object.prototype.toString.call(O)!=="[object Date]"?!1:(Date.prototype.getTime.call(O),!0)}catch{return!1}}const R=Object.freeze({isDate:S});return N.set("501f5fccaecb27d9e514b74cf64893649e50616692250593d120ca315b510c04",R),R})(),st=N.get("d363b84eac65064b2e372063af61a4e9e5c576501693c862628297c812ba7832")??(()=>{function S(O){if(!O||typeof O!="object")throw new TypeError("Hyperlinks require an absolute HTTP, HTTPS or mailto target without whitespace or controls.");const{target:C,tooltip:k}=O;if(typeof C!="string"||!/^(?:https?:\/\/|mailto:)/i.test(C)||/[\u0000-\u0020\u007f]/.test(C))throw new TypeError("Hyperlinks require an absolute HTTP, HTTPS or mailto target without whitespace or controls.");const y=new URL(C);if((y.protocol==="http:"||y.protocol==="https:")&&(!y.hostname||y.username||y.password))throw new TypeError("Hyperlink HTTP targets need a host and must not contain credentials.");if(k!==void 0&&typeof k!="string")throw new TypeError("Hyperlink tooltip must be text.");return Object.freeze({target:y.href,...k===void 0?{}:{tooltip:k}})}const R=Object.freeze({copyExportLink:S});return N.set("d363b84eac65064b2e372063af61a4e9e5c576501693c862628297c812ba7832",R),R})(),Ce=N.get("732224f6995c2478cf33a6ed01f3e3d3dcccb159a731d6db9280104bd5040fc5")??(()=>{const{isDate:S}=Me,{copyExportLink:R}=st,O=Symbol.for("@evotecit/officeimo/ExportCell");function C(x){if(!x||typeof x!="object"||Array.isArray(x))throw new TypeError("Cell presentation must be an object.");const w={};for(const u of["background","color","numberFormat","bold","italic","wrapText","alignment"]){const a=x[u];if(a!==void 0){if(["bold","italic","wrapText"].includes(u)){if(typeof a!="boolean")throw new TypeError("Cell presentation "+u+" must be boolean.")}else if(typeof a!="string")throw new TypeError("Cell presentation "+u+" must be text.");if(u==="alignment"&&!["left","center","right","fill","justify","distributed"].includes(a))throw new TypeError("Invalid cell presentation alignment.");w[u]=a}}return Object.freeze(w)}class k{value;static[Symbol.hasInstance](w){return!!w&&typeof w=="object"&&w[O]===!0}text;presentation;link;constructor(w,u={}){this.value=w;const{text:a,presentation:i,link:c}=u;if(a!==void 0&&typeof a!="string")throw new TypeError("Display text must be a string.");y(w),this.text=a,this.presentation=i===void 0?void 0:C(i),this.link=c===void 0?void 0:R(c),Object.defineProperty(this,O,{value:!0}),Object.freeze(this)}}function y(x){const w=typeof x;if(!(x==null||w==="string"||w==="number"||w==="boolean"||S(x)))throw typeof x.then=="function"&&Promise.resolve(x).catch(()=>{}),new TypeError("Export values and formatter results must be synchronous strings, numbers, booleans, Dates or null.")}function m(x){x!==null&&typeof x=="object"&&x instanceof k||y(x)}const b=Object.freeze({copyCellPresentation:C,ExportCell:k,assertScalar:y,assertExportValue:m});return N.set("732224f6995c2478cf33a6ed01f3e3d3dcccb159a731d6db9280104bd5040fc5",b),b})(),Te=N.get("50b3c10b690ceff693c8c5f809195ba6845b20e60f408e791a750d2ecbd5c669")??(()=>{function S(O,C){const k={...O};for(const y of C){if(Object.hasOwn(k,y))continue;const m=O[y];m!==void 0&&(k[y]=m)}return k}const R=Object.freeze({captureFields:S});return N.set("50b3c10b690ceff693c8c5f809195ba6845b20e60f408e791a750d2ecbd5c669",R),R})(),ot=N.get("42faf379960e5674a6fdfa8c8fca0bb68bbd74587231248d2524d7004def3671")??(()=>{const{OfficeIMOError:S}=pe,{captureFields:R}=Te;class O{cells=0;text=0;reservedCells=0;reservedText=0;limits;constructor(m={}){if(!m||typeof m!="object"||Array.isArray(m))throw new TypeError("Export limits must be an object.");const b=R(m,["maxRows","maxCells","maxTextCharacters","maxOutputBytes"]);for(const[x,w]of Object.entries(b))if(w!==void 0&&(!Number.isSafeInteger(w)||w<0))throw new RangeError(x+" must be a nonnegative safe integer.");this.limits=Object.freeze(b)}check(m,b){const x=this.limits[m];if(x!==void 0&&b>x)throw new S("RESOURCE_LIMIT",m+" exceeded ("+b+" > "+x+").")}row(m){this.check("maxRows",m)}reserve(m,b){this.check("maxCells",this.cells+this.reservedCells+m),this.check("maxTextCharacters",this.text+this.reservedText+b),this.reservedCells+=m,this.reservedText+=b}release(m,b){this.reservedCells-=m,this.reservedText-=b}cell(m,b){if(b!==void 0&&this.release(1,b),this.limits.maxCells===void 0&&this.limits.maxTextCharacters===void 0)return;this.check("maxCells",this.cells+this.reservedCells+1);const x=typeof m=="string"?m.length:0;this.check("maxTextCharacters",this.text+this.reservedText+x),this.cells++,this.text+=x}}function C(y,m){let b=0;return{write(x){return m.check("maxOutputBytes",b+x.length),b+=x.length,y.write(x)}}}const k=Object.freeze({ExportBudget:O,boundedSink:C});return N.set("42faf379960e5674a6fdfa8c8fca0bb68bbd74587231248d2524d7004def3671",k),k})(),Ge=N.get("0391fe35ea7d02b25804ab4d0e7543136d6bb615f368f268c74aa135f23aa6bc")??(()=>{const{assertExportValue:S}=Ce,{checkAbort:R}=be,{isDate:O}=Me,{captureFields:C}=Te;function k(x,w,u,a=S){const i=x.some(c=>c.value);return(c,o=0)=>{if(Array.isArray(c)&&!i){const s=c.length;if(s>x.length)throw new RangeError("Row has more values than declared columns.");const r=new Array(s);for(let n=0;n<s;n++){const e=c[n];a(e),r[n]=e}return r}if(!c||typeof c!="object"||O(c))throw new TypeError("A row must be an array or object.");if(Array.isArray(c)&&c.length>x.length&&!x.every(s=>s.value))throw new RangeError("Project every column explicitly when selecting from a wider array row.");return x.map((s,r)=>{if(s.value){R(u);const t={rowIndex:o,columnIndex:r,column:s,...w?{sheetName:w.sheetName,worksheetRow:w.firstDataRow+o}:{}},l=s.value(c,t);return a(l),R(u),l}if(Array.isArray(c)){const t=c[r];return a(t),t}const n=s.key??s.header,e=Object.prototype.hasOwnProperty.call(c,n)?c[n]:void 0;return a(e),e})}}const y=["header","key","value","width","type","format","wrapText","alignment","rowHeader","groups","style","valueFormatter"];function m(x,w=!1){if(!Array.isArray(x))throw new TypeError("Declare the columns in export order.");return x.map(u=>{if(!u||typeof u!="object"&&typeof u!="function")throw new TypeError("Each column needs a string header and an optional string key.");const a=C(u,y);if(!w&&a.style!==void 0)throw new TypeError("Workbook-local column styles require the advanced Workbook API; use portable ExportCell presentation.");if(typeof a.header!="string"||a.key!==void 0&&typeof a.key!="string")throw new TypeError("Each column needs a string header and an optional string key.");if(a.value!==void 0&&typeof a.value!="function")throw new TypeError("Column value getters must be functions.");if(a.rowHeader!==void 0&&typeof a.rowHeader!="boolean")throw new TypeError("Column rowHeader must be boolean.");if(a.groups!==void 0){if(!Array.isArray(a.groups))throw new TypeError("Column groups must be an array of strings.");const i=Array.from(a.groups);if(i.some(c=>typeof c!="string"))throw new TypeError("Column groups must be an array of strings.");return{...a,groups:Object.freeze(i)}}return a})}const b=Object.freeze({createRowProjector:k,columnOptionFields:y,copyColumns:m});return N.set("0391fe35ea7d02b25804ab4d0e7543136d6bb615f368f268c74aa135f23aa6bc",b),b})(),wt=N.get("c9fde2c438e186da56f740105fcd41c265fdfdd855a4f1b811d556a02387479b")??(()=>{class S{operation;count=0;sum=0;mean=0;min=1/0;max=-1/0;constructor(k){this.operation=k}accept(k){if(!(!this.operation||typeof k!="number"||!Number.isFinite(k)))if(this.count++,this.operation==="sum"){if(this.sum+=k,!Number.isFinite(this.sum))throw new RangeError("Numeric total exceeds finite number range.")}else if(this.operation==="average"){const y=k-this.mean;this.mean=this.count===1?k:Number.isFinite(y)?this.mean+y/this.count:this.mean*((this.count-1)/this.count)+k/this.count}else this.operation==="min"?this.min=Math.min(this.min,k):this.operation==="max"&&(this.max=Math.max(this.max,k))}value(){return this.operation==="count"?this.count:this.operation==="sum"?this.sum:this.count?this.operation==="average"?this.mean:this.operation==="min"?this.min:this.max:null}}function R(C,k={}){const y=C.map(m=>m.key??m.header);for(const[m,b]of Object.entries(k)){if(y.filter(x=>x===m).length!==1)throw new TypeError("Totals need an unambiguous declared column key: "+m);if(!["sum","count","average","min","max"].includes(b))throw new TypeError("Invalid total operation.")}return y.map(m=>new S(Object.prototype.hasOwnProperty.call(k,m)?k[m]:void 0))}const O=Object.freeze({NumericAggregate:S,createTotals:R});return N.set("c9fde2c438e186da56f740105fcd41c265fdfdd855a4f1b811d556a02387479b",O),O})(),at=N.get("e95bb0e3f342d1379b67a3d541fa808e06361da8460169a6aec152ee7deb69b2")??(()=>{const{ExportCell:S,assertExportValue:R}=Ce,{isDate:O}=Me;function C(y){if(R(y),O(y))return new Date(Date.prototype.getTime.call(y));if(y instanceof S){const{value:m,text:b,presentation:x,link:w}=y;return new S(O(m)?new Date(Date.prototype.getTime.call(m)):m,{...b===void 0?{}:{text:b},...x===void 0?{}:{presentation:x},...w===void 0?{}:{link:w}})}return y}const k=Object.freeze({copyExportValue:C});return N.set("e95bb0e3f342d1379b67a3d541fa808e06361da8460169a6aec152ee7deb69b2",k),k})(),Ne=N.get("046b305cdccf817d847addb75a778131622de23f2840830bbe1c0c26053a68c0")??(()=>{const{ExportCell:S,assertScalar:R}=Ce,{isDate:O}=Me,{checkAbort:C,inputRows:k,pause:y,taskYieldDue:m}=be,{ExportBudget:b}=ot,{OfficeIMOError:x}=pe,{copyColumns:w,createRowProjector:u}=Ge,{createTotals:a}=wt,{copyExportValue:i}=at,c=new WeakMap;function o(E){if(!E||typeof E!="object"||!c.has(E))throw new TypeError("Create grouped report sources with createGroupedReport.")}function s(E,I){return o(E),{async*[Symbol.asyncIterator](){const P=r(E,I);try{yield*P.events}finally{P.dispose()}}}}function r(E,I){o(E);const P=c.get(E),B=n(P.signal,I);return{signal:B.signal,events:P.events(B.signal),dispose:B.dispose}}function n(E,I){if(!E||!I||E===I)return{signal:E??I,dispose(){}};const P=new AbortController,B=()=>P.abort(E.reason),L=()=>P.abort(I.reason);return E.addEventListener("abort",B,{once:!0}),I.addEventListener("abort",L,{once:!0}),E.aborted?B():I.aborted&&L(),{signal:P.signal,dispose(){E.removeEventListener("abort",B),I.removeEventListener("abort",L)}}}function e(E,I,P){const B=E??I;if(!Number.isSafeInteger(B)||B<0)throw new RangeError(P+" must be a nonnegative safe integer.");return B}function t(E){return E instanceof S?E.value:E}function l(E){if(E==null)return{key:null,id:"null",text:""};if(O(E)){const P=Date.prototype.getTime.call(E);if(!Number.isFinite(P))throw new TypeError("A group key date must be valid.");return{key:new Date(P),id:"date:"+P,text:new Date(P).toISOString()}}if(typeof E=="number"&&!Number.isFinite(E))throw new TypeError("A numeric group key must be finite.");const I=String(E);return{key:E,id:typeof E+":"+I,text:I}}function d(E){return O(E)?new Date(Date.prototype.getTime.call(E)):E}function f(E){return Object.freeze(E.map(I=>I.operation===void 0?null:I.value()))}function h(E,I,P){const B=typeof E=="string"?[E]:Array.isArray(E)?Array.from(E):void 0;if(!B||B.length<1||B.length>4)throw new TypeError("groupBy must declare between one and four grouping levels.");if(P!==void 0&&typeof P!="function")throw new TypeError("groupLabel must be a synchronous function.");if(P&&B.length!==1)throw new TypeError("groupLabel is only available for one grouping level; use descriptor labels for a hierarchy.");const L=new Set;return Object.freeze(B.map(H=>{if(typeof H!="string"&&(!H||typeof H!="object"||Array.isArray(H)))throw new TypeError("A grouping level must name a stable column key or provide a descriptor.");const{key:W,value:U,label:J}=typeof H=="string"?{key:H,value:void 0,label:void 0}:H;if(typeof W!="string"||!W.length||L.has(W))throw new TypeError("Grouping levels need unique, nonempty stable keys.");if(L.add(W),U!==void 0&&typeof U!="function")throw new TypeError("Grouping value getters must be synchronous functions.");if(J!==void 0&&typeof J!="function")throw new TypeError("Grouping labels must be synchronous functions.");if(J&&P)throw new TypeError("Specify either groupLabel or the grouping descriptor label.");const Z=I.indexOf(W);if(Z>=0&&U!==void 0)throw new TypeError("A declared grouping column reuses its projected value; do not provide another value getter.");if(Z<0&&U===void 0)throw new TypeError("groupBy must name a declared stable column key; hidden grouping fields need an explicit value getter.");return Object.freeze({key:W,column:Z,value:U,label:J??P})}))}function g(E){return Object.freeze(E.map(({group:I})=>Object.freeze({...I,key:d(I.key)})))}function p(E,I,P){if(!E)return P;const B=E(d(I));if(typeof B?.then=="function"&&Promise.resolve(B).catch(()=>{}),typeof B!="string")throw new TypeError("Grouping labels must return synchronous text.");return B}function T(E,I){if(!I||typeof I!="object")throw new TypeError("Grouped report options are required.");const{columns:P,groupBy:B,totals:L,groupLabel:H,maxGroups:W,maxGroupKeyCharacters:U,signal:J,limits:Z}=I;if(Z!==void 0&&(!Z||typeof Z!="object"||Array.isArray(Z)))throw new TypeError("Grouped source limits must be an object.");if(Z!==void 0&&"maxOutputBytes"in Z)throw new TypeError("Set maxOutputBytes on the format writer, not the grouped source.");if(!Array.isArray(P)||!P.length)throw new TypeError("A grouped report needs declared columns.");const j=w(P),_=j.map(re=>re.key);if(_.some(re=>typeof re!="string"||re.length===0)||new Set(_).size!==_.length)throw new TypeError("Grouped report columns need unique, nonempty stable keys.");const A=h(B,_,H),F=Object.freeze({...L}),V=a(j,F);for(let re=0;re<j.length;re++)if(V[re].operation!==void 0&&j[re].type!=="number")throw new TypeError("Grouped numeric totals require a column declared with type:number.");const q=e(W,1e3,"maxGroups"),$=e(U,1e6,"maxGroupKeyCharacters"),Q=new b(Z),z=Object.freeze(j.map(re=>{const{value:ue,...ye}=re;return Object.freeze(ye)}));for(const re of j){Q.cell(re.header);for(const ue of re.groups??[])Q.reserve(0,ue.length);Object.freeze(re)}let K=!1;const Y=re=>Object.freeze({[Symbol.asyncIterator](){if(K)throw new TypeError("A grouped report source can be consumed only once.");return K=!0,ae(re)}}),ie=Y(J);async function*ae(re){const ue=u(j,void 0,re),ye=new Set,he=[];let M=0,D=0,G=0;for await(const te of k(E,re)){const oe=Array.isArray(te)?Array.from(te):te,ce=ue(oe,D),se=[];for(let X=0;X<j.length;X++)se.push(i(ce[X])??null);C(re);const ge=A.map((X,ne)=>{C(re);const le=X.column>=0?t(se[X.column]):X.value(oe,Object.freeze({rowIndex:D,level:ne,key:X.key}));return R(le),C(re),l(le)});Q.row(D+1);for(let X=0;X<se.length;X++){const ne=se[X],le=t(ne);if(V[X].operation!==void 0&&le!=null&&(typeof le!="number"||!Number.isFinite(le)))throw new TypeError("Grouped numeric metrics must resolve to finite numbers or null.");Q.cell(le),ne instanceof S&&ne.text!==void 0&&Q.reserve(0,ne.text.length)}let we=0;for(;we<he.length&&he[we].id===ge[we].id;)we++;const de=[];for(let X=we;X<A.length;X++){const ne=ge[X],fe=((de.at(-1)??he[X-1])?.group.groupIndex??-1)+":"+ne.id;if(ye.has(fe))throw new TypeError("Grouped rows must be contiguous; a closed group key occurred again within the same parent.");if(G===q)throw new x("RESOURCE_LIMIT","maxGroups exceeded.");const me=p(A[X].label,ne.key,ne.text);C(re);const ve=M+fe.length+me.length;if(!Number.isSafeInteger(ve)||ve>$)throw new x("RESOURCE_LIMIT","maxGroupKeyCharacters exceeded.");Q.reserve(0,me.length),de.push({id:ne.id,group:Object.freeze({groupIndex:G,key:ne.key,label:me,level:X}),rows:0,aggregates:a(j,F)}),M=ve,ye.add(fe),G++}for(;he.length>we;){C(re);const X=g(he),ne=he.pop();yield Object.freeze({kind:"groupEnd",...X.at(-1),path:X,rows:ne.rows,totals:f(ne.aggregates)})}for(const X of de){C(re),he.push(X);const ne=g(he);yield Object.freeze({kind:"groupStart",...ne.at(-1),path:ne})}for(let X=0;X<se.length;X++){const ne=t(se[X]);for(const le of he)le.aggregates[X].accept(ne);V[X].accept(ne)}for(const X of he)X.rows++;C(re),yield Object.freeze({kind:"row",values:Object.freeze(se),rowIndex:D,groupIndex:he.at(-1).group.groupIndex,path:g(he)}),D++,m()&&(await y(),C(re))}for(C(re);he.length;){C(re);const te=g(he),oe=he.pop();yield Object.freeze({kind:"groupEnd",...te.at(-1),path:te,rows:oe.rows,totals:f(oe.aggregates)})}C(re),yield Object.freeze({kind:"complete",rows:D,groups:G,totals:f(V)})}const ee=Object.freeze({columns:z,groupBy:Object.freeze(A.map(re=>re.key)),totals:F,events:ie});return c.set(ee,{signal:J,events:Y}),ee}const v=Object.freeze({assertGroupedReportSource:o,groupedReportEvents:s,groupedReportOperation:r,createGroupedReport:T});return N.set("046b305cdccf817d847addb75a778131622de23f2840830bbe1c0c26053a68c0",v),v})(),_e=N.get("81b3d47c02b7d8443b79e02b3cfb52032d6b73d9a3fb592b777ebe028ad0ef00")??(()=>{const{OfficeIMOError:S}=pe;function R(){let k=!1;if(typeof CompressionStream=="function")try{new CompressionStream("deflate-raw"),k=!0}catch{}return{blob:typeof Blob=="function",streams:typeof WritableStream=="function",deflateRaw:k,download:typeof document<"u"&&typeof URL.createObjectURL=="function"}}function O(k,y){if(!(k instanceof Blob)||typeof y!="string"||!y)throw new TypeError("A Blob and file name are required.");if(typeof document>"u"||typeof URL.createObjectURL!="function")throw new S("PLATFORM_UNAVAILABLE","saveBlob requires a browser document and object URLs.");const m=URL.createObjectURL(k),b=document.createElement("a");try{b.href=m,b.download=y,document.body.append(b),b.click()}finally{b.remove(),setTimeout(()=>URL.revokeObjectURL(m),3e4)}}const C=Object.freeze({OfficeIMOError:pe.OfficeIMOError,NotSupportedError:pe.NotSupportedError,BlobByteSink:Oe.BlobByteSink,ChunkedTextSink:Oe.ChunkedTextSink,writeBytes:Oe.writeBytes,ExportCell:Ce.ExportCell,createGroupedReport:Ne.createGroupedReport,checkAbort:be.checkAbort,withAbort:be.withAbort,inputRows:be.inputRows,pause:be.pause,detectFeatures:R,saveBlob:O});return N.set("81b3d47c02b7d8443b79e02b3cfb52032d6b73d9a3fb592b777ebe028ad0ef00",C),C})(),bt=N.get("790c15edc51b308be3e7d8222630d407f8c79c31ab21ba0b9f92c00f44ab4021")??(()=>{const S=new Uint32Array(256).map((C,k)=>{let y=k;for(let m=0;m<8;m++)y=y&1?3988292384^y>>>1:y>>>1;return y>>>0});class R{crc=4294967295;update(k){let y=this.crc;for(let m=0;m<k.length;m++)y=S[(y^k[m])&255]^y>>>8;this.crc=y}get value(){return(this.crc^4294967295)>>>0}}const O=Object.freeze({Crc32:R});return N.set("790c15edc51b308be3e7d8222630d407f8c79c31ab21ba0b9f92c00f44ab4021",O),O})(),yt=N.get("597d152d20a2a28ee5cd6d4243a79a71ce8b83769a77441bfc944aadc0a6efbd")??(()=>{const{checkAbort:S,withAbort:R}=be,{OfficeIMOError:O}=pe,{Crc32:C}=bt,k=4294967295;function y(x){if(!Number.isSafeInteger(x)||x<0||x>=k)throw new O("ZIP64_REQUIRED","Classic ZIP entries and archives must stay below 4 GiB; ZIP64 is not supported yet.");return x}class m{sink;signal;method;writer;reader;drain;crc=new C;size=0;compressedSize=0;failed=!1;failure;closed=!1;cleaned=!1;lifetime=new AbortController;abort=()=>{this.fail(this.signal?.reason)};constructor(w,u,a){if(this.sink=u,this.signal=a,w!=="auto"&&w!=="store")throw new RangeError("compression must be auto or store.");S(a);let i;if(w==="auto"&&typeof CompressionStream=="function")try{i=new CompressionStream("deflate-raw")}catch(c){if(!(c instanceof TypeError))throw c}this.method=i?8:0,this.writer=i?.writable.getWriter(),this.reader=i?.readable.getReader(),a?.addEventListener("abort",this.abort,{once:!0}),this.drain=this.reader?this.consume(this.reader):Promise.resolve()}async consume(w){try{for(;;){const{value:u,done:a}=await R(w.read(),this.lifetime.signal);if(a)return;S(this.signal),this.compressedSize=y(this.compressedSize+u.length),await R(Promise.resolve(this.sink.write(u)),this.lifetime.signal)}}catch(u){this.fail(u)}}fail(w){this.failed||(this.failed=!0,this.failure=w,this.lifetime.abort(w),this.cleaned||(this.writer?.abort(w).catch(()=>{}),this.reader?.cancel(w).catch(()=>{})))}async write(w){if(S(this.signal),this.failed)throw this.failure;if(this.closed)throw new O("INVALID_STATE","ZIP entry is closed.");if(!(w instanceof Uint8Array))throw new TypeError("ZIP chunks must be Uint8Array.");this.size=y(this.size+w.length),this.crc.update(w),this.writer?await R(this.writer.write(new Uint8Array(w)),this.lifetime.signal):(await R(Promise.resolve(this.sink.write(w)),this.lifetime.signal),this.compressedSize=this.size)}async close(){try{if(S(this.signal),this.failed)throw this.failure;if(this.closed)throw new O("INVALID_STATE","ZIP entry is closed.");if(this.closed=!0,this.writer&&await R(this.writer.close(),this.lifetime.signal),await this.drain,this.failed)throw this.failure;return S(this.signal),{crc:this.crc.value,size:this.size,compressedSize:this.compressedSize,method:this.method}}finally{this.cleanup()}}async discard(w){this.fail(w),await this.drain,this.closed=!0,this.cleanup()}cleanup(){this.cleaned||(this.cleaned=!0,this.signal?.removeEventListener("abort",this.abort),this.writer?.releaseLock(),this.reader?.releaseLock())}}const b=Object.freeze({Crc32:bt.Crc32,zipLimit:k,zipSize:y,EntryWriter:m});return N.set("597d152d20a2a28ee5cd6d4243a79a71ce8b83769a77441bfc944aadc0a6efbd",b),b})(),It=N.get("699a019e0c3f317a62bf3a6e59b76b6cf1645908b0f1b1f157c18f4d4f368dfb")??(()=>{const{EntryWriter:S,zipSize:R}=yt,{checkAbort:O,withAbort:C,pause:k,taskYieldDue:y}=be,{OfficeIMOError:m}=pe,{BlobByteSink:b,writeBytes:x}=Oe,{captureFields:w}=Te,u=new TextEncoder;function a(s){if(typeof s!="string"||!s||/[\u0000-\u001f\\]/.test(s)||s.startsWith("/")||/^[A-Za-z]:/.test(s)||s.split("/").some(r=>!r||r==="."||r===".."))throw new TypeError("ZIP entry names must be relative paths without empty, dot or parent segments.");for(let r=0;r<s.length;r++){const n=s.charCodeAt(r);if(n>=55296&&n<=56319){const e=s.charCodeAt(++r);if(!(e>=56320&&e<=57343))throw new TypeError("ZIP entry names must contain well-formed Unicode.")}else if(n>=56320&&n<=57343)throw new TypeError("ZIP entry names must contain well-formed Unicode.")}if(u.encode(s).length>65535)throw new RangeError("ZIP entry name exceeds 65,535 UTF-8 bytes.");return s}function i(s,r,n=new Uint8Array){const e=new Uint8Array(r+n.length),t=new DataView(e.buffer);return t.setUint32(0,s,!0),e.set(n,r),{bytes:e,data:t}}class c{sink;owned;names=new Set;central=[];offset=0;active;state="open";options;lifetime=new AbortController;disposal;constructor(r,n={}){const e=w(n,["compression","signal","maxOutputBytes"]),{compression:t,maxOutputBytes:l}=e;if(l!==void 0&&(!Number.isSafeInteger(l)||l<0))throw new RangeError("maxOutputBytes must be a nonnegative safe integer.");if(t!==void 0&&t!=="auto"&&t!=="store")throw new RangeError("compression must be auto or store.");this.options=Object.freeze(e),this.owned=r?void 0:new b,this.sink=r??this.owned}async acceptance(r){const n=this.options.signal,e=()=>this.lifetime.abort(n?.reason);n?.addEventListener("abort",e,{once:!0});try{return O(n),O(this.lifetime.signal),await C(Promise.resolve(r()),this.lifetime.signal)}finally{n?.removeEventListener("abort",e)}}async emit(r){if(this.options.maxOutputBytes!==void 0&&this.offset+r.length>this.options.maxOutputBytes)throw new m("RESOURCE_LIMIT","maxOutputBytes exceeded.");this.offset=R(this.offset+r.length),await this.acceptance(()=>this.sink.write(r))}reserve(r){if(O(this.options.signal),this.state!=="open")throw new m("INVALID_STATE","ZIP writer is busy, failed or finalized.");if(a(r),this.names.has(r))throw new TypeError("Duplicate ZIP entry: "+r);if(this.names.size>=65534)throw new m("ZIP64_REQUIRED","ZIP64 is required for 65,535 entries.");return this.names.add(r),this.state="writing",u.encode(r)}local(r,n,e){const t=i(67324752,30,r);return t.data.setUint16(4,20,!0),t.data.setUint16(6,e?2056:2048,!0),t.data.setUint16(8,n.method,!0),t.data.setUint16(12,33,!0),t.data.setUint16(26,r.length,!0),t.bytes}record(r,n,e,t){const l=i(33639248,46,r);l.data.setUint16(4,20,!0),l.data.setUint16(6,20,!0),l.data.setUint16(8,t?2056:2048,!0),l.data.setUint16(10,n.method,!0),l.data.setUint16(14,33,!0),l.data.setUint32(16,n.crc,!0),l.data.setUint32(20,n.compressedSize,!0),l.data.setUint32(24,n.size,!0),l.data.setUint16(28,r.length,!0),l.data.setUint32(42,e,!0),this.central.push(l.bytes)}async openEntry(r){const n=this.reserve(r),e=this.offset;let t;try{t=new S(this.options.compression??"auto",{write:p=>this.emit(p)},this.options.signal),await this.emit(this.local(n,t,!0));const l=t;let d=!1,f=!1,h;const g=async p=>{f=!0,this.state="failed",this.lifetime.abort(p),await l.discard(p),this.owned?.discard(),this.active=void 0};return this.active={write:async p=>{if(d||f||this.state!=="writing")throw new m("INVALID_STATE","Await the current ZIP entry operation.");d=!0;try{await l.write(p)}catch(T){throw await g(T),T}finally{d=!1}},close:()=>{if(h)return h;if(d||f||this.state!=="writing")throw new m("INVALID_STATE","ZIP entry is busy or closed.");return f=!0,h=(async()=>{try{const p=await l.close(),T=i(134695760,16);return T.data.setUint32(4,p.crc,!0),T.data.setUint32(8,p.compressedSize,!0),T.data.setUint32(12,p.size,!0),await this.emit(T.bytes),this.record(n,p,e,!0),this.state="open",this.active=void 0,p}catch(p){throw await g(p),p}})(),h},discard:g}}catch(l){throw this.state="failed",await t?.discard(l),this.owned?.discard(),l}}async add(r,n){const e=await this.openEntry(r);try{typeof n=="function"?await this.acceptance(()=>n(e)):await this.acceptance(()=>x(n,e,this.lifetime.signal)),await e.close()}catch(t){throw await e.discard(t),t}}get bytesWritten(){return this.offset}discard(r){return this.state="failed",this.lifetime.abort(r),this.disposal??=(async()=>{await this.active?.discard(r),this.owned?.discard()})()}async addPrepared(r,n){const e=this.reserve(r),t=this.offset;try{const l=this.local(e,n,!1),d=new DataView(l.buffer);d.setUint32(14,n.crc,!0),d.setUint32(18,n.compressedSize,!0),d.setUint32(22,n.size,!0),await this.emit(l);for(const f of n.chunks)O(this.options.signal),await this.emit(f);this.record(e,n,t,!1),this.state="open"}catch(l){throw this.state="failed",this.owned?.discard(),l}}async finish(){if(O(this.options.signal),this.state!=="open")throw new m("INVALID_STATE","ZIP writer is busy, failed or finalized.");this.state="writing";const r=this.offset;try{for(let e=0;e<this.central.length;e++)await this.emit(this.central[e]),e%256===255&&y()&&await k();const n=i(101010256,22);n.data.setUint16(8,this.central.length,!0),n.data.setUint16(10,this.central.length,!0),n.data.setUint32(12,this.offset-r,!0),n.data.setUint32(16,r,!0),await this.emit(n.bytes),O(this.options.signal),this.state="finished"}catch(n){throw this.state="failed",this.owned?.discard(),n}}async toBlob(r="application/zip"){if(!this.owned)throw new m("INVALID_STATE","This ZIP uses a caller-owned sink; use finish().");return this.state!=="finished"&&await this.finish(),this.owned.toBlob(r)}}const o=Object.freeze({Crc32:yt.Crc32,validateEntryName:a,ZipWriter:c});return N.set("699a019e0c3f317a62bf3a6e59b76b6cf1645908b0f1b1f157c18f4d4f368dfb",o),o})(),Se=N.get("227236fd7adc9472e188831b8f16fdc69338c4d779f2b69a8abbd8dbfa95b585")??(()=>{const{OfficeIMOError:S}=pe,{ChunkedTextSink:R}=Oe,O='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>',C={"&":"&","<":"<",">":">",'"':""","'":"'","\r":" ","\n":" "," ":"	"};function k(u,a="strip"){if(a!=="strip"&&a!=="reject")throw new TypeError("Invalid XML character policy.");const i=String(u),c=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\ud800-\udfff\ufffe\uffff]/gu;if(a==="reject"&&c.test(i))throw new S("INVALID_XML","Text contains XML 1.0-invalid characters.");return i.replace(c,"")}function y(u,a="strip"){return k(u,a).replace(/[&<>"'\r\n\t]/g,i=>C[i])}function m(u,a="strip"){const i={"\r":"_x000D_","\n":"_x000A_"," ":"_x0009_"},c=k(u,a).replace(/_(?=x[0-9a-f]{4}_)|[\r\n\t]/gi,o=>o==="_"?"_x005F_":i[o]);return y(c,a)}function b(u){if(typeof u!="string"||!/^[A-Za-z_][A-Za-z0-9_.-]*(?::[A-Za-z_][A-Za-z0-9_.-]*)?$/.test(u))throw new S("INVALID_XML","Invalid XML name: "+u);return u}class x{policy;sink;stack=[];roots=0;closed=!1;constructor(a,i="strip",c){this.policy=i,k("",i),this.sink=new R(a,c),this.sink.append(O)}async startElement(a,i={}){this.open(),b(a);const c="<"+a+Object.entries(i).map(([o,s])=>" "+b(o)+'="'+y(s,this.policy)+'"').join("")+">";if(!this.stack.length&&this.roots++)throw new S("INVALID_XML","XML must have one root element.");this.stack.push(a),await this.sink.write(c)}async text(a){if(this.open(),!this.stack.length)throw new S("INVALID_XML","Text needs an open element.");await this.sink.write(y(a,this.policy))}async endElement(){this.open();const a=this.stack.pop();if(!a)throw new S("INVALID_XML","No open XML element.");await this.sink.write("</"+a+">")}async close(){if(this.open(),this.stack.length||this.roots!==1)throw new S("INVALID_XML","XML document is incomplete.");await this.sink.close(),this.closed=!0}open(){if(this.closed)throw new S("INVALID_STATE","XML writer is closed.")}}const w=Object.freeze({xmlDeclaration:O,cleanXml:k,escapeXml:y,escapeOoxmlAttribute:m,validateXmlName:b,XmlWriter:x});return N.set("227236fd7adc9472e188831b8f16fdc69338c4d779f2b69a8abbd8dbfa95b585",w),w})(),ct=N.get("8ece66b561682170c879991995105163f4c484c8355d5e451fc6f52a9fbc3f82")??(()=>{const{OfficeIMOError:S}=pe;function R(y){const m=()=>new S("INVALID_PART_URI","Invalid OPC part URI: "+y);if(typeof y!="string"||!y.startsWith("/")||/[^A-Za-z0-9\-._~!$&'()*+,;=:@%/]/.test(y)||y.split("/").slice(1).some(b=>!b||b.endsWith(".")||/^\.+$/.test(b))||/%(?![\da-f]{2})/i.test(y))throw m();for(const b of y.matchAll(/%([\da-f]{2})/gi)){const x=String.fromCharCode(parseInt(b[1],16));if(/[A-Za-z0-9_.~\-/\\]/.test(x))throw m()}try{decodeURIComponent(y)}catch{throw m()}return y.replace(/%[\da-f]{2}/gi,b=>b.toUpperCase())}function O(y){if(y==="/")return"/_rels/.rels";const m=R(y),b=m.lastIndexOf("/");return m.slice(0,b+1)+"_rels/"+m.slice(b+1)+".rels"}function C(y,m){const b=R(m).slice(1).split("/"),x=y==="/"?[]:R(y).slice(1).split("/").slice(0,-1);for(;x.length&&x[0]===b[0];)x.shift(),b.shift();const w="../".repeat(x.length)+b.join("/");return w.split("/",1)[0].includes(":")?"./"+w:w}const k=Object.freeze({partUri:R,relationshipPartUri:O,relativePartTarget:C});return N.set("8ece66b561682170c879991995105163f4c484c8355d5e451fc6f52a9fbc3f82",k),k})(),xt=N.get("56b2057461a668e8c90abd1fbf4f13ff93efd9854e590c82a195799f0f842c2a")??(()=>{const{escapeXml:S,xmlDeclaration:R}=Se,{isDate:O}=Me;function C(m={},b="strip"){const x=m.created??new Date,w=m.modified??x;if(!O(x)||!O(w)||!Number.isFinite(x.getTime())||!Number.isFinite(w.getTime()))throw new TypeError("Invalid workbook property date.");return R+'<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:creator>'+S(m.creator??"",b)+"</dc:creator><dc:title>"+S(m.title??"",b)+"</dc:title>"+(m.subject===void 0?"":"<dc:subject>"+S(m.subject,b)+"</dc:subject>")+(m.description===void 0?"":"<dc:description>"+S(m.description,b)+"</dc:description>")+'<dcterms:created xsi:type="dcterms:W3CDTF">'+x.toISOString()+'</dcterms:created><dcterms:modified xsi:type="dcterms:W3CDTF">'+w.toISOString()+"</dcterms:modified></cp:coreProperties>"}function k(m={},b="strip"){return R+'<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"><Application>'+S(m.application??"OfficeIMO",b)+"</Application><Company>"+S(m.company??"",b)+"</Company></Properties>"}const y=Object.freeze({corePropertiesXml:C,appPropertiesXml:k});return N.set("56b2057461a668e8c90abd1fbf4f13ff93efd9854e590c82a195799f0f842c2a",y),y})(),$e=N.get("945379594834125fea38bc00f02ef077409dd15f6ed67279e63e89afe0bb944b")??(()=>{const{partUri:S,relationshipPartUri:R,relativePartTarget:O}=ct,{corePropertiesXml:C,appPropertiesXml:k}=xt,{ZipWriter:y}=It,{ChunkedTextSink:m}=Oe,{OfficeIMOError:b}=pe,{escapeXml:x,xmlDeclaration:w}=Se,{checkAbort:u,pause:a,taskYieldDue:i}=be,{captureFields:c}=Te,o="http://schemas.openxmlformats.org/package/2006/relationships",s="http://schemas.openxmlformats.org/officeDocument/2006/relationships",r="http://schemas.openxmlformats.org/package/2006/content-types",n={officeDocument:s+"/officeDocument",worksheet:s+"/worksheet",styles:s+"/styles",theme:s+"/theme",customXml:s+"/customXml",coreProperties:o+"/metadata/core-properties",appProperties:s+"/extended-properties"};function e(f){if(typeof f!="string"||!/^[\w!#$&^.+-]+\/[\w!#$&^.+-]+$/.test(f))throw new TypeError("Invalid content type.");return f}class t{defaults=new Map([["rels","application/vnd.openxmlformats-package.relationships+xml"],["xml","application/xml"]]);overrides=new Map;addDefault(h,g){if(!/^[A-Za-z0-9]+$/.test(h))throw new TypeError("Invalid part extension.");const p=h.toLowerCase(),T=this.defaults.get(p);if(T!==void 0&&T!==g)throw new TypeError("Conflicting default content type.");this.defaults.set(p,e(g))}addOverride(h,g){if(h=S(h),this.overrides.has(h.toLowerCase()))throw new TypeError("Duplicate content-type override.");this.overrides.set(h.toLowerCase(),{uri:h,type:e(g)})}toXml(){return w+'<Types xmlns="'+r+'">'+[...this.defaults].map(([h,g])=>'<Default Extension="'+x(h)+'" ContentType="'+x(g)+'"/>').join("")+[...this.overrides.values()].map(({uri:h,type:g})=>'<Override PartName="'+x(h)+'" ContentType="'+x(g)+'"/>').join("")+"</Types>"}}class l{types=new t;parts=new Map;directories=new Set;relationships=new Map;state="open";result;zip;options;constructor(h={}){this.options=Object.freeze(c(h,["compression","signal","maxOutputBytes","invalidCharacterPolicy","sink"])),this.zip=new y(this.options.sink,this.options)}open(){if(this.state!=="open")throw new b("INVALID_STATE","OPC package is finalized.")}reserve(h,g){if(this.open(),typeof h=="string"&&h.length>65536)throw new b("RESOURCE_LIMIT","OPC part name exceeds the ZIP entry-name limit.");h=S(h);let p=0;for(let E=0;E<h.length;E++)if(h[E]==="/"&&++p>64)throw new b("RESOURCE_LIMIT","OPC part name exceeds the directory-depth limit.");if(/\/_rels(?:\/|$)/i.test(h)||h.toLowerCase()==="/[content_types].xml")throw new TypeError("Package metadata part names are reserved.");const T=h.toLowerCase();if(this.parts.has(T))throw new TypeError("Duplicate OPC part: "+h);if(this.directories.has(T))throw new TypeError("OPC part-name prefix collision: "+h+" is an ancestor of an existing part.");const v=[];for(let E=T.lastIndexOf("/");E>0;E=T.lastIndexOf("/",E-1)){const I=T.slice(0,E);if(this.parts.has(I))throw new TypeError("OPC part-name prefix collision: "+h+" descends from "+this.parts.get(I).uri);v.push(I)}this.types.addOverride(h,g);for(const E of v)this.directories.add(E);return h}addPart(h){const{uri:g,contentType:p,data:T}=h,v=T instanceof Uint8Array?new Uint8Array(T):T,E=this.reserve(g,p);this.parts.set(E.toLowerCase(),{uri:E,contentType:p,data:v})}addPrepared(h,g,p){h=this.reserve(h,g),this.parts.set(h.toLowerCase(),{uri:h,prepared:p})}async openPart(h,g){if(!this.options.sink)throw new b("INVALID_STATE","openPart requires a caller-owned package sink.");h=this.reserve(h,g),this.parts.set(h.toLowerCase(),{uri:h,written:!0});try{return await this.zip.openEntry(h.slice(1))}catch(p){throw await this.discard(p),p}}addRelationship(h,g){u(this.options.signal),this.open(),h=h==="/"?h:S(h);const{id:p,type:T,target:v,external:E}=g;if(this.open(),!/^[A-Za-z_][A-Za-z0-9_.-]*$/.test(p))throw new TypeError("Relationship id must be an XML ID.");if(!/^[A-Za-z][A-Za-z0-9+.-]*:[^\s<>"']+$/.test(T))throw new TypeError("Relationship type must be an absolute URI.");const I=E?v:S(v);if(E&&(!I||/[\u0000-\u0020]/.test(I)))throw new TypeError("Invalid external relationship target.");const P=h.toLowerCase(),B=this.relationships.get(P)??new Map;if(B.has(p))throw new TypeError("Duplicate relationship id: "+p);B.set(p,{id:p,type:T,target:I,...E===void 0?{}:{external:E}}),this.relationships.set(P,B)}setProperties(h={},g={}){const p=C(h,this.options.invalidCharacterPolicy),T=k(g,this.options.invalidCharacterPolicy);this.addPart({uri:"/docProps/core.xml",contentType:"application/vnd.openxmlformats-package.core-properties+xml",data:p}),this.addPart({uri:"/docProps/app.xml",contentType:"application/vnd.openxmlformats-officedocument.extended-properties+xml",data:T}),this.addRelationship("/",{id:"core",type:n.coreProperties,target:"/docProps/core.xml"}),this.addRelationship("/",{id:"app",type:n.appProperties,target:"/docProps/app.xml"})}source(h){return typeof h=="string"?async g=>{const p=new m(g,this.options.signal);await p.write(h),await p.close()}:h instanceof Blob?(async function*(){for(let g=0;g<h.size;g+=65536){let p;try{p=await h.slice(g,g+65536).arrayBuffer()}catch(T){throw T?.name!=="NotReadableError"?T:new b("PLATFORM_UNAVAILABLE","This environment cannot read Blob part data. Supply text or byte chunks; read Blobs before sending data to a worker.",{cause:T})}yield new Uint8Array(p)}})():h}finish(){return this.result?this.result:(this.open(),this.state="finalizing",this.result=(async()=>{const h=this.zip;try{for(const[g,p]of this.relationships){if(g!=="/"&&!this.parts.has(g))throw new TypeError("Missing relationship source part: "+g);let T=0;for(const v of p.values()){if(u(this.options.signal),!v.external&&!this.parts.has(v.target.toLowerCase()))throw new TypeError("Missing relationship target: "+v.target);(++T&255)===0&&i()&&(await a(),u(this.options.signal))}}for(const g of this.parts.values())"written"in g||("prepared"in g?await h.addPrepared(g.uri.slice(1),g.prepared):await h.add(g.uri.slice(1),this.source(g.data)));for(const[g,p]of this.relationships){const T=g==="/"?"/":this.parts.get(g).uri;await h.add(R(T).slice(1),async v=>{const E=new m(v,this.options.signal);await E.write(w+'<Relationships xmlns="'+o+'">');for(const I of p.values()){const P='<Relationship Id="'+x(I.id)+'" Type="'+x(I.type)+'" Target="'+x(I.external?I.target:O(T,I.target))+'"'+(I.external?' TargetMode="External"':"")+"/>";E.append(P)&&await E.flush()}await E.write("</Relationships>"),await E.close()})}return await h.add("[Content_Types].xml",this.source(this.types.toXml())),await h.finish(),this.state="complete",h.bytesWritten}catch(g){throw await this.discard(g),g}finally{this.parts.clear(),this.directories.clear(),this.relationships.clear()}})(),this.result)}async toBlob(h="application/zip"){if(this.options.sink)throw new b("INVALID_STATE","This package uses a caller-owned sink; use finish().");return await this.finish(),this.zip.toBlob(h)}async discard(h){this.state="failed",this.parts.clear(),this.directories.clear(),this.relationships.clear(),await this.zip.discard(h)}}const d=Object.freeze({partUri:ct.partUri,relationshipPartUri:ct.relationshipPartUri,relativePartTarget:ct.relativePartTarget,corePropertiesXml:xt.corePropertiesXml,appPropertiesXml:xt.appPropertiesXml,relationshipsNamespace:o,officeRelationshipsNamespace:s,contentTypesNamespace:r,relationshipTypes:n,ContentTypes:t,OpcPackage:l});return N.set("945379594834125fea38bc00f02ef077409dd15f6ed67279e63e89afe0bb944b",d),d})(),Ke=N.get("4eea31c4336d3c43bc743739843a3ef31803d8f0ed553f5645ee9de2554eb244")??(()=>{function S(C,k){R("onProgress",C,k)}function R(C,k,y){if(!k)return;const m=k(y);if(m&&typeof m.then=="function")throw Promise.resolve(m).catch(()=>{}),new TypeError(C+" must be synchronous.")}const O=Object.freeze({notifyProgress:S,notifySynchronously:R});return N.set("4eea31c4336d3c43bc743739843a3ef31803d8f0ed553f5645ee9de2554eb244",O),O})(),lt=N.get("204def412284dfb11df9aececd57c8c0455db2927ebdb483dd255e7b29f6f359")??(()=>{function S(O){if(typeof O!="string"||!/^#?(?:[0-9a-f]{6}|[0-9a-f]{8})$/i.test(O))throw new TypeError("Color must be RGB or ARGB hex.");const C=O.replace(/^#/,"").toUpperCase();return C.length===6?"FF"+C:C}const R=Object.freeze({colorArgb:S});return N.set("204def412284dfb11df9aececd57c8c0455db2927ebdb483dd255e7b29f6f359",R),R})(),dt=N.get("6ae88f25e1c09d00fbb828917498569f883fae88ec25d37caebaf8a2b802b148")??(()=>{const{OfficeIMOError:S}=pe,{cleanXml:R,escapeOoxmlAttribute:O}=Se,{colorArgb:C}=lt;function k(w,u,a){if(!w||typeof w!="object"||Array.isArray(w))throw new TypeError(a+" must be an object.");if(typeof w.then=="function")throw Promise.resolve(w).catch(()=>{}),new TypeError(a+" must be synchronous.");for(const i of Object.keys(w))if(!u.includes(i))throw new TypeError("Unsupported "+a+" property: "+i)}function y(w,u){if(w!==void 0&&typeof w!="boolean")throw new TypeError(u+" must be boolean.")}class m{policy;maximum;numberFormat;definitions=new Map;constructor(u,a,i){this.policy=u,this.maximum=a,this.numberFormat=i}keys(u){const a=u.map(c=>b(c,this.policy,()=>164)),i=new Set(a.filter(c=>!this.definitions.has(c)));if(this.definitions.size+i.size>this.maximum)throw new S("RESOURCE_LIMIT","maxDifferentialStyles exceeded.");return a}check(u){this.keys(u)}add(u){const a=this.keys(u);for(let i=0;i<u.length;i++)this.definitions.has(a[i])||this.definitions.set(a[i],{id:this.definitions.size,xml:b(u[i],this.policy,this.numberFormat)});return a.map(i=>this.definitions.get(i).id)}toXml(){return this.definitions.size?'<dxfs count="'+this.definitions.size+'">'+[...this.definitions.values()].map(u=>"<dxf>"+u.xml+"</dxf>").join("")+"</dxfs>":""}}function b(w,u,a){k(w,["font","fill","border","numberFormat"],"conditional style");let i="";if(w.font!==void 0){k(w.font,["bold","italic","underline","strike","color"],"conditional font");let c="";for(const[o,s]of[["bold","b"],["italic","i"],["strike","strike"]])y(w.font[o],o),w.font[o]!==void 0&&(c+="<"+s+' val="'+(w.font[o]?1:0)+'"/>');y(w.font.underline,"underline"),w.font.underline!==void 0&&(c+='<u val="'+(w.font.underline?"single":"none")+'"/>'),w.font.color!==void 0&&(c+='<color rgb="'+C(w.font.color)+'"/>'),c&&(i+="<font>"+c+"</font>")}if(w.numberFormat!==void 0){const c=w.numberFormat;if(typeof c!="string"||!c||c.length>255||!R(c,u))throw new TypeError("Conditional number format requires 1 through 255 XML-valid characters.");i+='<numFmt numFmtId="'+a(c)+'" formatCode="'+O(c,u)+'"/>'}if(w.fill!==void 0){k(w.fill,["color"],"conditional fill");const c=C(w.fill.color);i+='<fill><patternFill patternType="solid"><fgColor rgb="'+c+'"/><bgColor rgb="'+c+'"/></patternFill></fill>'}if(w.border!==void 0){k(w.border,["left","right","top","bottom"],"conditional border");let c="";for(const o of["left","right","top","bottom"]){const s=w.border[o];if(s!==void 0){if(k(s,["style","color"],"conditional border edge"),!["thin","medium","dashed","dotted","thick","double","hair","dashDot","dashDotDot","slantDashDot","mediumDashed","mediumDashDot","mediumDashDotDot"].includes(s.style))throw new TypeError("Invalid conditional border style.");c+="<"+o+' style="'+s.style+'">'+(s.color!==void 0?'<color rgb="'+C(s.color)+'"/>':"")+"</"+o+">"}}c&&(i+="<border>"+c+"</border>")}if(!i)throw new TypeError("A conditional style must change at least one property.");return i}const x=Object.freeze({fields:k,optionalBoolean:y,DifferentialStyles:m,differentialXml:b});return N.set("6ae88f25e1c09d00fbb828917498569f883fae88ec25d37caebaf8a2b802b148",x),x})(),Ve=N.get("8d96d0024443ac9aeaea70e9324b53aacef098c2385d4e6a89a76d184e28556a")??(()=>{const{escapeOoxmlAttribute:S,cleanXml:R,xmlDeclaration:O}=Se,{OfficeIMOError:C}=pe,{colorArgb:k}=lt,{DifferentialStyles:y}=dt,m="http://schemas.openxmlformats.org/spreadsheetml/2006/main",b=["thin","medium","dashed","dotted","thick","double","hair","dashDot","dashDotDot","slantDashDot","mediumDashed","mediumDashDot","mediumDashDotDot"];function x(r){if(!r||typeof r!="object")throw new TypeError("A border must be an object of edges.");const n={};for(const e of["left","right","top","bottom"]){const t=r[e];if(t){const{style:l,color:d}=t;if(!b.includes(l))throw new TypeError("Invalid border style.");n[e]={style:l,...d?{color:k(d)}:{}}}}return n}const w={General:"General",Integer:"0",Decimal:"0.00",Percent:"0.00%",Date:"yyyy-mm-dd",DateTime:"yyyy-mm-dd hh:mm:ss"};function u(r,n,e){if(!Number.isInteger(r)||r<0||r>=n)throw new RangeError("Unknown "+e+" index.");return r}function a(r,n,e,t){const l=JSON.stringify(e),d=n.get(l);if(d!==void 0)return d;if(r.length>=t)throw new C("RESOURCE_LIMIT","Style component limit exceeded.");const f=r.length;return r.push(e),n.set(l,f),f}function i(r){if(!r||typeof r!="object"||Array.isArray(r))throw new TypeError("A style patch must be a CellStyle object.");if(typeof r.then=="function")throw Promise.resolve(r).catch(()=>{}),new TypeError("Style patches must be synchronous CellStyle objects.")}function c(r){return i(r),Object.freeze({...r,...typeof r.font=="object"?{font:Object.freeze({...r.font})}:{},...typeof r.fill=="object"?{fill:Object.freeze({...r.fill})}:{},...typeof r.border=="object"?{border:Object.freeze(Object.fromEntries(Object.entries(r.border).map(([n,e])=>[n,Object.freeze({...e})])))}:{}})}class o{policy;maximum;differential;fonts=[{name:"Calibri",size:11,bold:!1,italic:!1,underline:!1,strike:!1,color:""}];fills=[{pattern:"none",color:""},{pattern:"gray125",color:""}];borders=[{}];formats=new Map;styles=[];indexes=new Map;fontIndexes=new Map(this.fonts.map((n,e)=>[JSON.stringify(n),e]));fillIndexes=new Map(this.fills.map((n,e)=>[JSON.stringify(n),e]));borderIndexes=new Map(this.borders.map((n,e)=>[JSON.stringify(n),e]));constructor(n="strip",e=64e3,t=1e3){if(this.policy=n,this.maximum=e,!Number.isSafeInteger(e)||e<1||e>64e3)throw new RangeError("maxStyles must be from 1 through 64,000.");if(!Number.isSafeInteger(t)||t<0)throw new RangeError("maxDifferentialStyles must be a nonnegative safe integer.");this.differential=new y(n,t,l=>this.addNumberFormat(l)),R("",n),this.add()}checkDifferentials(n){const e=new Set(n.flatMap(t=>t.numberFormat===void 0?[]:[R(t.numberFormat,this.policy)]).filter(t=>t!=="General"&&!this.formats.has(t)));if(this.formats.size+e.size>65372)throw new RangeError("Too many number formats.");this.differential.check(n)}addDifferentials(n){return this.checkDifferentials(n),this.differential.add(n)}addFont(n){const{name:e,size:t,bold:l,italic:d,underline:f,strike:h,color:g}=n;if(e!==void 0&&typeof e!="string")throw new TypeError("Font name must be a string.");const p=R(e??"Calibri",this.policy),T=t??11;if(typeof p!="string"||!p||p.length>31)throw new TypeError("Font name must contain 1 through 31 characters.");if(!Number.isFinite(T)||T<=0||T>409)throw new RangeError("Font size must be positive and at most 409.");return a(this.fonts,this.fontIndexes,{name:p,size:T,bold:!!l,italic:!!d,underline:!!f,strike:!!h,color:g?k(g):""},this.maximum)}addFill(n){const{color:e}=n,t=n.pattern??(e?"solid":"none");if(!["none","gray125","solid"].includes(t)||t==="solid"&&!e||t!=="solid"&&e)throw new TypeError("A solid fill requires a color; none and gray125 have no color.");return a(this.fills,this.fillIndexes,{pattern:t,color:e?k(e):""},this.maximum+1)}addBorder(n){return a(this.borders,this.borderIndexes,x(n),this.maximum)}addNumberFormat(n){if(typeof n!="string"||!n||n.length>255)throw new TypeError("Number format must contain 1 through 255 characters.");if(n=R(n,this.policy),!n)throw new TypeError("Number format must contain XML-valid characters.");if(n==="General")return 0;let e=this.formats.get(n);if(e===void 0){if(this.formats.size>=65372)throw new RangeError("Too many number formats.");e=this.formats.size+164,this.formats.set(n,e)}return e}add(n={}){const e=typeof n.font=="number"?u(n.font,this.fonts.length,"font"):n.font?this.addFont(n.font):0,t=typeof n.fill=="number"?u(n.fill,this.fills.length,"fill"):n.fill?this.addFill(n.fill):0,l=typeof n.border=="number"?u(n.border,this.borders.length,"border"):n.border?this.addBorder(n.border):0;let d=0;if(typeof n.numberFormat=="string")d=this.addNumberFormat(n.numberFormat);else if(n.numberFormat!==void 0&&(d=n.numberFormat,!Number.isInteger(d)||d<0||d>163&&![...this.formats.values()].includes(d)))throw new RangeError("Unknown number format index.");if(n.alignment!==void 0&&!["left","center","right","fill","justify","distributed"].includes(n.alignment))throw new TypeError("Invalid horizontal alignment.");if(n.verticalAlignment!==void 0&&!["top","center","bottom","justify","distributed"].includes(n.verticalAlignment))throw new TypeError("Invalid vertical alignment.");const f={font:e,fill:t,border:l,numberFormat:d,wrapText:!!n.wrapText,alignment:n.alignment??"",verticalAlignment:n.verticalAlignment??""},h=JSON.stringify(f),g=this.indexes.get(h);if(g!==void 0)return g;if(this.styles.length>=this.maximum)throw new C("RESOURCE_LIMIT","Workbook exceeds its cell style limit.");const p=this.styles.length;return this.styles.push(f),this.indexes.set(h,p),p}validateStyle(n){return u(n,this.styles.length,"cell style")}compose(n,e){i(e);const t=this.styles[this.validateStyle(n)];return this.add({font:t.font,fill:t.fill,border:t.border,numberFormat:t.numberFormat,wrapText:t.wrapText,...t.alignment?{alignment:t.alignment}:{},...t.verticalAlignment?{verticalAlignment:t.verticalAlignment}:{},...e,...typeof e.font=="object"?{font:{...this.fonts[t.font],...e.font}}:{},...typeof e.border=="object"?{border:{...this.borders[t.border],...e.border}}:{}})}dateHeader(n,e){return this.compose(n,{numberFormat:this.styles[this.validateStyle(e)].numberFormat})}forColumn(n,e=!1,t,l=!1,d){const f=!e&&n.style!==void 0?this.styles[this.validateStyle(n.style)]:void 0,h=n.format!==void 0?n.format||w.General:f?.numberFormat||(n.type==="date"||l?w.DateTime:w.General);return this.add({...f?{font:f.font,fill:f.fill,border:f.border}:{},numberFormat:h,wrapText:n.wrapText??f?.wrapText??!1,...n.alignment?{alignment:n.alignment}:f?.alignment?{alignment:f.alignment}:{},...f?.verticalAlignment?{verticalAlignment:f.verticalAlignment}:{},...e?{font:{bold:!0}}:{},...t?{fill:{color:t}}:{},...d?{border:d}:{}})}toXml(){const n=t=>"<font>"+(t.bold?"<b/>":"")+(t.italic?"<i/>":"")+(t.underline?"<u/>":"")+(t.strike?"<strike/>":"")+'<sz val="'+t.size+'"/>'+(t.color?'<color rgb="'+t.color+'"/>':"")+'<name val="'+S(t.name,this.policy)+'"/></font>',e=t=>"<border>"+["left","right","top","bottom"].map(l=>{const d=t[l];return d?"<"+l+' style="'+d.style+'">'+(d.color?'<color rgb="'+d.color+'"/>':"")+"</"+l+">":"<"+l+"/>"}).join("")+"<diagonal/></border>";return O+'<styleSheet xmlns="'+m+'"><numFmts count="'+this.formats.size+'">'+[...this.formats].map(([t,l])=>'<numFmt numFmtId="'+l+'" formatCode="'+S(t,this.policy)+'"/>').join("")+'</numFmts><fonts count="'+this.fonts.length+'">'+this.fonts.map(n).join("")+'</fonts><fills count="'+this.fills.length+'">'+this.fills.map(t=>'<fill><patternFill patternType="'+t.pattern+'">'+(t.color?'<fgColor rgb="'+t.color+'"/><bgColor indexed="64"/>':"")+"</patternFill></fill>").join("")+'</fills><borders count="'+this.borders.length+'">'+this.borders.map(e).join("")+'</borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="'+this.styles.length+'">'+this.styles.map(t=>{const l=t.wrapText||t.alignment||t.verticalAlignment?"<alignment"+(t.wrapText?' wrapText="1"':"")+(t.alignment?' horizontal="'+t.alignment+'"':"")+(t.verticalAlignment?' vertical="'+t.verticalAlignment+'"':"")+"/>":"";return'<xf numFmtId="'+t.numberFormat+'" fontId="'+t.font+'" fillId="'+t.fill+'" borderId="'+t.border+'" xfId="0"'+(t.numberFormat?' applyNumberFormat="1"':"")+(t.font?' applyFont="1"':"")+(t.fill?' applyFill="1"':"")+(t.border?' applyBorder="1"':"")+(l?' applyAlignment="1"':"")+">"+l+"</xf>"}).join("")+'</cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>'+this.differential.toXml()+"</styleSheet>"}}const s=Object.freeze({colorArgb:lt.colorArgb,spreadsheetNamespace:m,normalizeBorder:x,NumberFormats:w,validateStylePatch:i,copyStylePatch:c,StyleRegistry:o});return N.set("8d96d0024443ac9aeaea70e9324b53aacef098c2385d4e6a89a76d184e28556a",s),s})(),Je=N.get("f1de2157d2aefa347a314940eb7f89c16545e11f69923920e605409433742f93")??(()=>{const{NotSupportedError:S}=pe,{cleanXml:R,escapeXml:O}=Se,C=new WeakSet,k=new WeakSet;function y(a){let i=!1;const c=/[\p{L}_\\][\p{L}\p{N}\p{M}_.\\]*/uy;for(let o=0;o<a.length;o++){const s=a[o];if(s==='"'){for(;++o<a.length;)if(a[o]==='"'){if(a[o+1]!=='"')break;o++}}else if(s==="'"){let r="";for(;++o<a.length;){if(a[o]==="'"){if(a[o+1]!=="'")break;o++}r+=a[o]}if(a.slice(o+1).trimStart().startsWith("!")&&/[\[\]]/.test(r))throw new S("external-workbook formulas")}else if(s==="["){let r=1;for(;++o<a.length&&r;){if(a[o]==="'"){o++;continue}a[o]==="["?r++:a[o]==="]"&&r--}if(/^[A-Za-z0-9_.]*!/.test(a.slice(o)))throw new S("external-workbook formulas");o--}else{if(s==="|")throw new S("DDE formulas");{c.lastIndex=o;const r=c.exec(a);r&&(["SUBTOTAL","AGGREGATE","_XLFN.AGGREGATE"].includes(r[0].toUpperCase())&&/^\s*\(/.test(a.slice(c.lastIndex))&&(i=!0),o=c.lastIndex-1)}}}return i}function m(a){if(typeof a!="string")throw new TypeError("Formula text must be a string.");const i=a.trim().replace(/^=/,"");if(!i.trim()||i.length>8192)throw new RangeError("Formulas require 1 through 8,192 characters.");return R(i,"reject"),{text:i,subtotal:y(i)}}class b{cachedValue;style;static[Symbol.hasInstance](i){return i!==null&&typeof i=="object"&&C.has(i)}formula;constructor(i,c,o){this.cachedValue=c,this.style=o;const s=m(i);if(this.formula=s.text,c!==null&&(typeof c!="number"||!Number.isFinite(c)))throw new TypeError("Formula caches must be finite numbers or null for a blank result.");if(o!==void 0&&(!Number.isSafeInteger(o)||o<0))throw new RangeError("Formula style indexes must be nonnegative safe integers.");C.add(this),s.subtotal&&k.add(this),Object.freeze(this)}}function x(a){return k.has(a)}function w(a){if(!(a instanceof b))throw new TypeError("Formula cells must be created with FormulaCell.");return"<f>"+O(a.formula,"reject")+"</f><v>"+(a.cachedValue??"")+"</v>"}const u=Object.freeze({FormulaCell:b,isSubtotalFormula:x,formulaXml:w});return N.set("f1de2157d2aefa347a314940eb7f89c16545e11f69923920e605409433742f93",u),u})(),ze=N.get("e88a83ca79cd099fc2de29689554c913c7d04b17018098f81c43044064fcdfb8")??(()=>{const{cleanXml:S,escapeXml:R}=Se,{assertExportValue:O,assertScalar:C}=Ce,{FormulaCell:k}=Je,{copyExportValue:y}=at;class m{value;style;constructor(e,t){this.value=e,this.style=t}}function b(n){n instanceof k||(n instanceof m?C(n.value):O(n))}function x(n){return n instanceof k?n:n instanceof m?Object.freeze(new m(y(n.value),n.style)):y(n)}function w(n,e="strip"){const t=S(n,e);if(t.length>32767)throw new RangeError("Excel cell text exceeds 32,767 UTF-16 code units.");return t}function u(n,e){const t=w(n,e),l=d=>'<t xml:space="preserve">'+R(d,e)+"</t>";return/_x[0-9a-f]{4}_/i.test(t)?t.split(/(?<=_)(?=x[0-9a-f]{4}_)/gi).map(d=>"<r>"+l(d)+"</r>").join(""):l(t)}function a(n){if(!Number.isInteger(n)||n<1||n>16384)throw new RangeError("Column index must be from 1 through 16,384.");let e="";for(;n;)n--,e=String.fromCharCode(65+n%26)+e,n=Math.floor(n/26);return e}function i(n,e){return n.slice(0,e).replace(/[\ud800-\udbff]$/,"")}function c(n){let e=0,t=n.length;const l=d=>d==="'"||/\s/u.test(d);for(;e<t&&l(n[e]);)e++;for(;t>e&&l(n[t-1]);)t--;return n.slice(e,t)}function o(n,e,t,l=!0){if(typeof n!="string")throw new TypeError("Sheet name must be a string.");let d=c(S(n,t).replace(/[\[\]:*?/\\]/g,"_"));d=c(i(d,31)),d||(d="Sheet"),d.toLowerCase()==="history"&&(d+="_");let f=d,h=2;for(;e.has(f.toLowerCase());){const g=" ("+h+++")";f=i(d,31-g.length)+g}return l&&e.add(f.toLowerCase()),f}function s(n,e){if(!Number.isFinite(n.getTime()))return null;const t=e==="utc",l=t?n.getUTCFullYear():n.getFullYear();if(l<1900||l>9999)throw new RangeError("Excel dates must be in years 1900 through 9999.");const d=new Date(0);d.setUTCFullYear(l,t?n.getUTCMonth():n.getMonth(),t?n.getUTCDate():n.getDate()),d.setUTCHours(t?n.getUTCHours():n.getHours(),t?n.getUTCMinutes():n.getMinutes(),t?n.getUTCSeconds():n.getSeconds(),t?n.getUTCMilliseconds():n.getMilliseconds());const f=d.getTime();return(f-Date.UTC(1899,11,31))/864e5+(f>=Date.UTC(1900,2,1)?1:0)}const r=Object.freeze({Cell:m,assertXlsxValue:b,copyValue:x,cellText:w,inlineText:u,columnName:a,sheetName:o,excelDate:s});return N.set("e88a83ca79cd099fc2de29689554c913c7d04b17018098f81c43044064fcdfb8",r),r})(),jt=N.get("e92456dbf0c50db97c8b6cf9a09365489ca3a882b4d506ad4dd841805b1146d1")??(()=>{const{captureFields:S}=Te;function R(y,m){if(y===void 0)return;if(!Array.isArray(y)||y.length>m)throw new TypeError("Column outlines must be bounded, non-overlapping ranges.");let b=0;return Object.freeze(y.map(x=>{if(!x||typeof x!="object")throw new TypeError("Column outlines require range metadata.");return S(x,["firstColumn","columnCount","level","hidden","collapsed"])}).sort((x,w)=>x.firstColumn-w.firstColumn).map(x=>{const{firstColumn:w,columnCount:u,level:a=0,hidden:i,collapsed:c}=x;if(!Number.isSafeInteger(w)||w<b||!Number.isSafeInteger(u)||u<1||w+u>m)throw new RangeError("Column outline ranges must be disjoint and within the declared columns.");if(!Number.isInteger(a)||a<0||a>7)throw new RangeError("Column outline level must be from zero through seven.");for(const o of[i,c])if(o!==void 0&&typeof o!="boolean")throw new TypeError("Column outline flags must be booleans.");return b=w+u,Object.freeze({firstColumn:w,columnCount:u,level:a,...i===void 0?{}:{hidden:i},...c===void 0?{}:{collapsed:c}})}))}function O(y){for(const m of[y.outlineSummaryBelow,y.outlineSummaryRight])if(m!==void 0&&typeof m!="boolean")throw new TypeError("Outline summary positions must be booleans.")}function C(y){const m=new Map;for(const b of y??[])for(let x=b.firstColumn;x<b.firstColumn+b.columnCount;x++)m.set(x,b);return m}const k=Object.freeze({captureColumnOutlines:R,validateOutlinePositions:O,columnOutlineMap:C});return N.set("e92456dbf0c50db97c8b6cf9a09365489ca3a882b4d506ad4dd841805b1146d1",k),k})(),Ye=N.get("d56b24243cff6f3552a2f7b45521af4491494375ec76117e9ac1ebb047ce02da")??(()=>{const{assertExportValue:S}=Ce,{copyExportValue:R}=at;function O(y,m){if(!Array.isArray(y)||!y.length||y.length>16)throw new RangeError("Spanned headings/footers need from 1 through 16 rows.");const b=y.map(x=>{if(!Array.isArray(x)||x.length!==m)throw new TypeError("Spanned rows must have the declared column count.");return Object.freeze(x.map(w=>{if(w===null)return null;if(!w||typeof w!="object")throw new TypeError("Uncovered heading/footer cells need an anchor value.");const{value:u,columnSpan:a,rowSpan:i}=w;return Object.freeze({value:R(u),...a===void 0?{}:{columnSpan:a},...i===void 0?{}:{rowSpan:i}})}))});return C(b,m),Object.freeze(b)}function C(y,m){if(!Array.isArray(y)||!y.length||y.length>16)throw new RangeError("Spanned headings/footers need from 1 through 16 rows.");const b=Array.from({length:y.length},()=>new Uint8Array(m));return y.map((x,w)=>{if(!Array.isArray(x)||x.length!==m)throw new TypeError("Spanned rows must have the declared column count.");const u=[];for(let a=0;a<m;a++){const i=x[a];if(b[w][a]){if(i!==null)throw new TypeError("Covered heading/footer cells must be null.");continue}if(!i||typeof i!="object")throw new TypeError("Uncovered heading/footer cells need an anchor value.");const c=i.columnSpan??1,o=i.rowSpan??1;if(!Number.isInteger(c)||!Number.isInteger(o)||c<1||o<1||a+c>m||w+o>y.length)throw new RangeError("Heading/footer spans must stay inside the declared matrix.");const s=i.value;S(s);for(let r=w;r<w+o;r++)for(let n=a;n<a+c;n++){if(b[r][n])throw new TypeError("Heading/footer spans overlap.");if((r!==w||n!==a)&&y[r]?.[n]!==null)throw new TypeError("Covered heading/footer cells must be null.");b[r][n]=1}u.push(Object.freeze({first:a,span:c,rowSpan:o,value:s}))}return Object.freeze(u)})}const k=Object.freeze({captureTableSpans:O,tableSpans:C});return N.set("d56b24243cff6f3552a2f7b45521af4491494375ec76117e9ac1ebb047ce02da",k),k})(),Ft=N.get("aaf6808e1812a251687fd513480fe845b5677ffa493bccf519409807fe4d250c")??(()=>{const{ChunkedTextSink:S}=Oe,{escapeXml:R,xmlDeclaration:O}=Se,{officeRelationshipsNamespace:C}=$e,{columnName:k}=ze,y="http://schemas.openxmlformats.org/drawingml/2006/chart",m="application/vnd.openxmlformats-officedocument.drawingml.chart+xml";function b(s,r,n){const e=' cx="'+Math.round(s.width*9525)+'" cy="'+Math.round(s.height*9525)+'"';return"<xdr:oneCellAnchor><xdr:from><xdr:col>"+(s.column-1)+"</xdr:col><xdr:colOff>0</xdr:colOff><xdr:row>"+(s.row-1)+"</xdr:row><xdr:rowOff>0</xdr:rowOff></xdr:from><xdr:ext"+e+'/><xdr:graphicFrame macro=""><xdr:nvGraphicFramePr><xdr:cNvPr id="'+r+'" name="Chart '+s.id+'" descr="'+R(s.description??s.title??"",n)+'"/><xdr:cNvGraphicFramePr/></xdr:nvGraphicFramePr><xdr:xfrm><a:off x="0" y="0"/><a:ext cx="0" cy="0"/></xdr:xfrm><a:graphic><a:graphicData uri="'+y+'"><c:chart xmlns:c="'+y+'" r:id="chart'+s.id+'"/></a:graphicData></a:graphic></xdr:graphicFrame><xdr:clientData/></xdr:oneCellAnchor>'}function x(s,r){return'<c:title><c:tx><c:rich><a:bodyPr/><a:lstStyle/><a:p><a:pPr><a:defRPr/></a:pPr><a:r><a:t xml:space="preserve">'+R(s,r)+'</a:t></a:r></a:p></c:rich></c:tx><c:overlay val="0"/></c:title>'}function*w(s,r,n,e){yield"<c:"+s+"Ref><c:f>"+R(r,e)+"</c:f><c:"+s+"Cache>",s==="num"&&(yield"<c:formatCode>General</c:formatCode>"),yield'<c:ptCount val="'+n.length+'"/>';for(let t=0;t<n.length;t++)yield'<c:pt idx="'+t+'"><c:v xml:space="preserve">'+R(String(n[t]),e)+"</c:v></c:pt>";yield"</c:"+s+"Cache></c:"+s+"Ref>"}function u(s,r){const n=s.dataLabels;if(!n)return"";const e={center:"ctr",insideEnd:"inEnd",outsideEnd:"outEnd",bestFit:"bestFit",above:"t",below:"b",left:"l",right:"r"};return"<c:dLbls>"+(n.numberFormat===void 0?"":'<c:numFmt formatCode="'+R(n.numberFormat,r)+'" sourceLinked="0"/>')+(n.position===void 0?"":'<c:dLblPos val="'+e[n.position]+'"/>')+'<c:showLegendKey val="0"/><c:showVal val="'+(n.showValue===!1?0:1)+'"/><c:showCatName val="'+(n.showCategoryName?1:0)+'"/><c:showSerName val="'+(n.showSeriesName?1:0)+'"/><c:showPercent val="'+(n.showPercent?1:0)+'"/><c:showBubbleSize val="0"/></c:dLbls>'}function a(s,r){const n=s.type==="barClustered",e=s.valueAxis,t='<c:scaling><c:orientation val="minMax"/>'+(e?.maximum===void 0?"":'<c:max val="'+e.maximum+'"/>')+(e?.minimum===void 0?"":'<c:min val="'+e.minimum+'"/>')+"</c:scaling>",l='<c:majorTickMark val="none"/><c:minorTickMark val="none"/><c:tickLblPos val="nextTo"/>';return'<c:catAx><c:axId val="1"/><c:scaling><c:orientation val="minMax"/></c:scaling><c:delete val="0"/><c:axPos val="'+(n?"l":"b")+'"/>'+(s.categoryAxis?.title?x(s.categoryAxis.title,r):"")+'<c:numFmt formatCode="General" sourceLinked="1"/>'+l+'<c:crossAx val="2"/><c:crosses val="autoZero"/><c:auto val="1"/><c:lblAlgn val="ctr"/><c:lblOffset val="100"/><c:noMultiLvlLbl val="0"/></c:catAx><c:valAx><c:axId val="2"/>'+t+'<c:delete val="0"/><c:axPos val="'+(n?"b":"l")+'"/><c:majorGridlines/>'+(e?.title?x(e.title,r):"")+'<c:numFmt formatCode="'+R(e?.numberFormat??"General",r)+'" sourceLinked="'+(e?.numberFormat===void 0?1:0)+'"/>'+l+'<c:crossAx val="1"/><c:crosses val="autoZero"/><c:crossBetween val="between"/></c:valAx>'}function*i(s,r){const n=s.type==="pie",e=s.type==="line",t=n?"pieChart":e?"lineChart":"barChart",l="'"+s.dataSheetName.replace(/'/g,"''")+"'!",d=s.data.categories.length+1;yield O+'<c:chartSpace xmlns:c="'+y+'" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="'+C+'"><c:date1904 val="0"/>'+(s.language===void 0?"":'<c:lang val="'+R(s.language,r)+'"/>')+"<c:chart>",s.title&&(yield x(s.title,r)),yield'<c:autoTitleDeleted val="'+(s.title?0:1)+'"/><c:plotArea><c:layout/><c:'+t+">",n||(yield e?'<c:grouping val="standard"/>':'<c:barDir val="'+(s.type==="barClustered"?"bar":"col")+'"/><c:grouping val="clustered"/>'),yield'<c:varyColors val="'+(n?1:0)+'"/>';for(let f=0;f<s.data.series.length;f++){const h=s.data.series[f],g="$"+k(f+2);yield'<c:ser><c:idx val="'+f+'"/><c:order val="'+f+'"/><c:tx>';const p=s.binding?s.binding.references.names[f]:l+g+"$1";p===void 0?yield"<c:v>"+R(h.name,r)+"</c:v>":yield*w("str",p,[h.name],r),yield"</c:tx>",h.color&&(yield"<c:spPr>"+(e?'<a:ln w="25400">':"")+'<a:solidFill><a:srgbClr val="'+h.color+'"/></a:solidFill>'+(e?"</a:ln>":"")+"</c:spPr>"),!e&&!n&&(yield'<c:invertIfNegative val="0"/>'),yield"<c:cat>",yield*w("str",s.binding?.references.categories??l+"$A$2:$A$"+d,s.data.categories,r),yield"</c:cat><c:val>",yield*w("num",s.binding?.references.values[f]??l+g+"$2:"+g+"$"+d,h.values,r),yield"</c:val>"+(e?'<c:smooth val="0"/>':"")+"</c:ser>"}yield u(s,r),!n&&!e&&(yield'<c:gapWidth val="150"/><c:overlap val="0"/>'),n||(yield'<c:axId val="1"/><c:axId val="2"/>'),yield"</c:"+t+">",n||(yield a(s,r)),yield"</c:plotArea>",s.legend!==!1&&(yield'<c:legend><c:legendPos val="'+{right:"r",bottom:"b",left:"l",top:"t"}[s.legend??"right"]+'"/><c:layout/><c:overlay val="0"/></c:legend>'),yield'<c:plotVisOnly val="'+(s.binding?1:0)+'"/><c:dispBlanksAs val="gap"/><c:showDLblsOverMax val="0"/></c:chart></c:chartSpace>'}async function c(s,r,n,e){const t=new S(r,e);for(const l of i(s,n))t.append(l)&&await t.flush();await t.close()}const o=Object.freeze({chartNamespace:y,chartContentType:m,chartAnchorXml:b,writeChartXml:c});return N.set("aaf6808e1812a251687fd513480fe845b5677ffa493bccf519409807fe4d250c",o),o})(),Qe=N.get("d599dca57105b9cc787ba2498051ed0193cbdb1e5f23116e35bc77cd67a233f1")??(()=>{const{cleanXml:S,escapeXml:R,escapeOoxmlAttribute:O,xmlDeclaration:C}=Se,{copyExportLink:k}=st,{officeRelationshipsNamespace:y}=$e,{chartAnchorXml:m}=Ft,{captureFields:b}=Te;function x(r,n){if(r=b(r,["row","column","width","height","description"]),!Number.isInteger(r.row)||r.row<1||r.row>1048576||!Number.isInteger(r.column)||r.column<1||r.column>16384)throw new RangeError("Drawing anchors must be one-based worksheet rows and columns.");for(const e of[r.width,r.height])if(!Number.isFinite(e)||e<=0||e>1e5)throw new RangeError("Drawing display dimensions must be positive and at most 100,000 pixels.");if(r.description!==void 0&&typeof r.description!="string")throw new TypeError("Drawing description must be a string.");return Object.freeze({row:r.row,column:r.column,width:r.width,height:r.height,...r.description===void 0?{}:{description:S(r.description,n)}})}function w(r){const n=typeof r=="string"&&/^([A-Z]{1,3})([1-9][0-9]{0,6})$/.exec(r);if(!n)throw new TypeError("Use a single uppercase A1 cell reference.");const e=Number(n[2]);let t=0;for(const l of n[1])t=t*26+l.charCodeAt(0)-64;if(t>16384||e>1048576)throw new RangeError("Cell reference exceeds Excel's worksheet bounds.");return{row:e,column:t}}function u(r,n){r=b(r,["cell","target","tooltip"]),w(r.cell);const e=k(r);return Object.freeze({cell:r.cell,target:e.target,...e.tooltip===void 0?{}:{tooltip:S(e.tooltip,n)}})}function a(r,n,e){if(r=b(r,["data","row","column","width","height","description"]),r.data instanceof Uint8Array&&e?.(r.data.length),!(r.data instanceof Uint8Array)||r.data.length<33||![137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82].every((l,d)=>r.data[d]===l))throw new TypeError("Images require PNG bytes with a valid signature and IHDR header.");const t=new DataView(r.data.buffer,r.data.byteOffset,r.data.byteLength);if(!t.getUint32(16)||!t.getUint32(20))throw new RangeError("PNG dimensions must be positive.");return Object.freeze({...x(r,n),data:new Uint8Array(r.data)})}function i(r,n,e=[]){return"<hyperlinks>"+r.map((t,l)=>'<hyperlink ref="'+t.cell+'" r:id="link'+(l+1)+'"'+(t.tooltip===void 0?"":' tooltip="'+O(t.tooltip,n)+'"')+"/>").join("")+e.map(t=>'<hyperlink ref="'+t.cell+'" location="'+O(t.location,n)+'"/>').join("")+"</hyperlinks>"}function c(r,n,e=[]){const t="http://schemas.openxmlformats.org/drawingml/2006/";return C+'<xdr:wsDr xmlns:xdr="'+t+'spreadsheetDrawing" xmlns:a="'+t+'main" xmlns:r="'+y+'">'+r.map((l,d)=>{const f=' cx="'+Math.round(l.width*9525)+'" cy="'+Math.round(l.height*9525)+'"';return"<xdr:oneCellAnchor><xdr:from><xdr:col>"+(l.column-1)+"</xdr:col><xdr:colOff>0</xdr:colOff><xdr:row>"+(l.row-1)+"</xdr:row><xdr:rowOff>0</xdr:rowOff></xdr:from><xdr:ext"+f+'/><xdr:pic><xdr:nvPicPr><xdr:cNvPr id="'+(d+1)+'" name="Image '+(d+1)+'" descr="'+R(l.description??"",n)+'"/><xdr:cNvPicPr/></xdr:nvPicPr><xdr:blipFill><a:blip r:embed="image'+(d+1)+'"/><a:stretch><a:fillRect/></a:stretch></xdr:blipFill><xdr:spPr><a:xfrm><a:off x="0" y="0"/><a:ext'+f+'/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></xdr:spPr></xdr:pic><xdr:clientData/></xdr:oneCellAnchor>'}).join("")+e.map((l,d)=>m(l,r.length+d+1,n)).join("")+"</xdr:wsDr>"}const s=Object.freeze({copyDrawingAnchor:x,cellPosition:w,copyHyperlink:u,copyImage:a,hyperlinksXml:i,drawingXml:c,drawingContentType:"application/vnd.openxmlformats-officedocument.drawing+xml"});return N.set("d599dca57105b9cc787ba2498051ed0193cbdb1e5f23116e35bc77cd67a233f1",s),s})(),Wt=N.get("39155eb25a58694b2caf100529b6c13dbe91f583741807b46232a2a567e19ecb")??(()=>{const{OfficeIMOError:S}=pe,{cellPosition:R}=Qe;function O(m){if(!m.length)return;const b=[...m].sort((o,s)=>o.top-s.top),x=b[Math.floor(b.length/2)].top,w=[],u=[],a=[];for(const o of b)(o.bottom<x?u:o.top>x?a:w).push(o);const i=O(u),c=O(a);return{middle:x,starts:w,ends:[...w].sort((o,s)=>s.bottom-o.bottom),...i?{before:i}:{},...c?{after:c}:{}}}function C(m,b,x){if(m){for(const w of b<=m.middle?m.starts:m.ends){if(b<=m.middle?w.top>b:w.bottom<b)break;x.push(w)}C(b<m.middle?m.before:b>m.middle?m.after:void 0,b,x)}}class k{references;index;currentRow=-1;current=[];lastRow;constructor(b,x,w){if(b.length>w)throw new S("RESOURCE_LIMIT","maxMergedRanges exceeded.");if(!b.length){this.references=Object.freeze([]),this.lastRow=0,this.index=void 0;return}const u=b.map(s=>{if(typeof s!="string"||s.split(":").length!==2)throw new TypeError("Merged ranges require uppercase A1:B2 references.");const[r,n]=s.split(":"),e=R(r),t=R(n);if(t.row<e.row||t.column<e.column||t.row===e.row&&t.column===e.column)throw new RangeError("Merged ranges require ordered distinct cells.");if(t.column>x)throw new RangeError("Merged ranges must stay within declared columns.");return{ref:s,top:e.row,bottom:t.row,left:e.column,right:t.column}}),a=u.flatMap(s=>[{row:s.top,delta:1,region:s},{row:s.bottom+1,delta:-1,region:s}]).sort((s,r)=>s.row-r.row||s.delta-r.delta),i=new Int32Array(65536),c=new Int32Array(65536);function o(s,r,n,e,t,l){if(e<=r&&n<=t){i[s]=i[s]+l,c[s]=c[s]+l;return}const d=r+n>>>1;e<=d&&o(s*2,r,d,e,t,l),t>d&&o(s*2+1,d+1,n,e,t,l),i[s]=c[s]+Math.max(i[s*2],i[s*2+1])}for(const s of a)if(o(1,1,16384,s.region.left,s.region.right,s.delta),i[1]>1)throw new TypeError("Merged ranges must not overlap: "+s.region.ref);this.references=Object.freeze(u.map(s=>s.ref)),this.lastRow=u.reduce((s,r)=>Math.max(s,r.bottom),0),this.index=O(u)}covered(b,x){if(!this.index||x>this.lastRow)return!1;this.currentRow!==x&&(this.current=[],C(this.index,x,this.current),this.current.sort((a,i)=>a.left-i.left),this.currentRow=x);let w=0,u=this.current.length-1;for(;w<=u;){const a=w+u>>>1,i=this.current[a];if(b<i.left)u=a-1;else if(b>i.right)w=a+1;else return x!==i.top||b!==i.left}return!1}validateRows(b){if(this.lastRow>b)throw new RangeError("Merged ranges must stay within exported rows.")}}const y=Object.freeze({MergeRegions:k});return N.set("39155eb25a58694b2caf100529b6c13dbe91f583741807b46232a2a567e19ecb",y),y})(),Vt=N.get("2a51a034ac74f5a0656731f46740bb80adee48101e7a4b51253d9399df11d238")??(()=>{const{ExportCell:S}=Ce,{tableSpans:R}=Ye,{copyValue:O,columnName:C}=ze;class k{values;ranges;constructor(b,x){const w=R(b,x),u=[];this.values=w.map((a,i)=>{const c=Array(x).fill(void 0);for(const o of a)c[o.first]=O(o.value),(o.span>1||o.rowSpan>1)&&u.push({first:o.first+1,last:o.first+o.span,top:i+1,bottom:i+o.rowSpan});return Object.freeze(c)}),this.ranges=u}get mergeCount(){return this.ranges.length}merges(b){return this.ranges.map(x=>C(x.first)+(x.top+b)+":"+C(x.last)+(x.bottom+b))}matchesLeaf(b){const x=this.values.length;return!this.ranges.some(w=>w.bottom===x)&&this.values[x-1].every((w,u)=>(w instanceof S?w.value:w)===b[u])}}const y=Object.freeze({StructuredRows:k});return N.set("2a51a034ac74f5a0656731f46740bb80adee48101e7a4b51253d9399df11d238",y),y})(),At=N.get("b732883d8635c0adf27cef2a3900f08374d02c9ce1b005d02af6853c8be627cc")??(()=>{const{ExportCell:S}=Ce,{isDate:R}=Me,{Cell:O,cellText:C,columnName:k}=ze,{FormulaCell:y}=Je,{escapeOoxmlAttribute:m}=Se,{MergeRegions:b}=Wt,{OfficeIMOError:x}=pe,{createTotals:w}=wt,{StructuredRows:u}=Vt;class a{value;formula;operation;constructor(e,t,l){this.value=e,this.formula=t,this.operation=l}}class i{columns;options;headings;merges;headerRows;firstHeaderRow;regions;widths;sampleRows;structuredFooter;footerRows;mergeCount;aggregates;constructor(e,t,l,d=1e4,f=1e5){this.columns=e,this.options=t;const h=t.title===void 0?0:1;if(t.title!==void 0){if(!e.length)throw new TypeError("Report titles require declared columns.");if(typeof t.title.text!="string")throw new TypeError("Report title text must be a string.");if(C(t.title.text,l),t.title.height!==void 0&&(!Number.isFinite(t.title.height)||t.title.height<=0||t.title.height>409))throw new RangeError("Title height must be positive and at most 409 points.")}const g=Math.max(0,...e.map(P=>P.groups?.length??0));if(t.headerRows===void 0){if(g>16)throw new RangeError("Grouped headings support at most 16 levels.");if(g&&t.includeHeader===!1)throw new TypeError("Grouped headings require leaf headers.")}const p=[],T=[];if(h&&e.length>1&&T.push("A1:"+k(e.length)+"1"),t.headerRows!==void 0&&t.includeHeader!==!1){const P=new u(t.headerRows,e.length);if((t.table||t.autoFilter)&&!P.matchesLeaf(e.map(B=>B.header)))throw new TypeError("Native tables and autofilters require an unmerged final heading row matching the declared leaf headers.");p.push(...P.values),T.push(...P.merges(h))}else if(t.includeHeader!==!1){for(let P=0;P<g;P++){const B=e.map(L=>L.groups?.[P]??"");for(const L of B)C(L,l);for(let L=0;L<e.length;){let H=L;const W=JSON.stringify(e[L].groups?.slice(0,P+1));for(;H+1<e.length&&B[L]&&JSON.stringify(e[H+1].groups?.slice(0,P+1))===W;)H++;if(H>L){T.push(k(L+1)+(P+1+h)+":"+k(H+1)+(P+1+h));for(let U=L+1;U<=H;U++)B[U]=""}L=H+1}p.push(B)}e.length&&p.push(e.map(P=>P.header))}if(this.headerRows=h+p.length,this.firstHeaderRow=e.length&&t.includeHeader!==!1?h+1:0,t.mergedCells!==void 0&&!Array.isArray(t.mergedCells))throw new TypeError("Merged ranges must be an array.");if(t.footer?.rows!==void 0&&(t.footer.values!==void 0||t.footer.totals!==void 0))throw new TypeError("Structured footer rows cannot accompany footer values or totals.");if(this.structuredFooter=t.footer?.rows===void 0?void 0:new u(t.footer.rows,e.length),this.footerRows=this.structuredFooter?.values.length??(t.footer?1:0),this.mergeCount=T.length+(t.mergedCells?.length??0)+(this.structuredFooter?.mergeCount??0),this.mergeCount>d)throw new x("RESOURCE_LIMIT","maxMergedRanges exceeded.");if(this.regions=new b([...T,...t.mergedCells??[]],e.length,d),t.table){for(const P of t.mergedCells??[])if(Number(P.split(":")[1].match(/\d+$/)[0])>=this.headerRows)throw new TypeError("Merged ranges cannot intersect a native table.")}this.headings=p,this.merges=this.regions.references;const v=t.autoSize;if(this.sampleRows=v?v.sampleRows??Math.min(100,Math.floor(f/Math.max(1,e.length))):0,!Number.isInteger(this.sampleRows)||this.sampleRows<0||this.sampleRows>1048576)throw new RangeError("Width sampling must use from 0 through 1,048,576 rows within its buffer budgets.");const E=v?.minWidth??8,I=v?.maxWidth??60;if(!Number.isFinite(E)||!Number.isFinite(I)||E<0||E>I||I>255)throw new RangeError("Width bounds must satisfy 0 <= minWidth <= maxWidth <= 255.");if(this.widths=e.map(P=>P.width??(v?Math.max(E,Math.min(I,P.header.length+2)):void 0)),t.footer?.values&&t.footer.values.length>e.length)throw new RangeError("Footer has more values than declared columns.");this.aggregates=w(e,t.footer?.totals),t.print&&o(t.print,l)}finalRegions(e,t){return this.structuredFooter?new b([...this.merges,...this.structuredFooter.merges(this.headerRows+e)],this.columns.length,t):this.regions}sample(e){const t=this.options.autoSize?.minWidth??8,l=this.options.autoSize?.maxWidth??60;e.forEach((d,f)=>{if(!this.columns[f]||this.columns[f].width!==void 0)return;const h=d instanceof y?d.cachedValue:d instanceof S?d.text??d.value:d instanceof O?d.value:d,g=R(h)?Number.isFinite(h.getTime())?h.toISOString():"":h==null?"":String(h),p=Math.max(0,...g.slice(0,Math.ceil(l*4)).split(/\r?\n/).map(T=>[...T].length));this.widths[f]=Math.max(this.widths[f]??t,Math.min(l,p+2))})}accept(e,t){this.aggregates[e].accept(t)}footer(e){return this.columns.map((t,l)=>{const d=this.aggregates[l],f=d.operation;if(!f)return this.options.footer?.values?.[l];const h=d.value();return new a(h,c(f,k(l+1),this.headerRows,e),f)})}}function c(n,e,t,l){const d={sum:109,count:102,average:101,min:105,max:104}[n],f=["average","min","max"].includes(n),h=e+(t+1)+":"+e+(t+l),g="SUBTOTAL("+d+","+h+")";return l?f?"IF(SUBTOTAL(102,"+h+')=0,"",'+g+")":g:f?'""':"0"}function o(n,e){if(n.paper!==void 0&&!["A4","Letter"].includes(n.paper))throw new TypeError("Print paper must be A4 or Letter.");if(n.orientation!==void 0&&!["portrait","landscape"].includes(n.orientation))throw new TypeError("Invalid print orientation.");for(const t of[n.fitToWidth,n.fitToHeight])if(t!==void 0&&(!Number.isInteger(t)||t<0||t>32767))throw new RangeError("Print fit dimensions must be integers from 0 through 32,767.");for(const t of Object.values(n.margins??{}))if(!Number.isFinite(t)||t<0||t>10)throw new RangeError("Print margins must be from 0 through 10 inches.");for(const t of[n.header,n.footer])if(t!==void 0){if(typeof t!="string"||t.length>250)throw new TypeError("Print header/footer must be strings of at most 250 UTF-16 units.");if(C(t,e),("&C"+t.replace(/&/g,"&&")).length>255)throw new RangeError("Encoded print header/footer exceeds Excel's 255-character limit.")}}function s(n,e){if(!n)return"";const t={left:.25,right:.25,top:.5,bottom:.5,header:.2,footer:.2,...n.margins};return"<pageMargins"+Object.entries(t).map(([l,d])=>" "+l+'="'+d+'"').join("")+'/><pageSetup paperSize="'+(n.paper==="Letter"?1:9)+'" orientation="'+(n.orientation??"landscape")+'" fitToWidth="'+(n.fitToWidth??1)+'" fitToHeight="'+(n.fitToHeight??0)+'"/>'+(n.header!==void 0||n.footer!==void 0?"<headerFooter>"+(n.header===void 0?"":"<oddHeader>"+m("&C"+n.header.replace(/&/g,"&&"),e)+"</oddHeader>")+(n.footer===void 0?"":"<oddFooter>"+m("&C"+n.footer.replace(/&/g,"&&"),e)+"</oddFooter>")+"</headerFooter>":"")}const r=Object.freeze({ComputedTotal:a,ReportLayout:i,totalFormula:c,printXml:s});return N.set("b732883d8635c0adf27cef2a3900f08374d02c9ce1b005d02af6853c8be627cc",r),r})(),et=N.get("09d589ff8f82302ce4c17411c7b811a87fb034e61e4b3013b7f8b18853a90449")??(()=>{const{columnName:S}=ze;function R(y,m,b="Data"){if(typeof m=="string"){const x=y.flatMap((w,u)=>w.key===m?[u+1]:[]);if(x.length!==1)throw new TypeError(b+" column keys must identify exactly one declared column.");return x[0]}if(!Number.isInteger(m)||m<1||m>y.length)throw new RangeError(b+" column numbers must be one-based and within declared columns.");return m}function O(y,m,b,x){if(!Number.isSafeInteger(b)||b<1||!Number.isSafeInteger(x)||x<1||b+x-1>1048576)throw new RangeError("A data range must fit within Excel's worksheet rows.");const w=S(m);return"'"+y.replace(/'/g,"''")+"'!$"+w+"$"+b+":$"+w+"$"+(b+x-1)}function C(y,m,b){return O(y,m,b,1).split(":")[0]}const k=Object.freeze({resolveDataColumn:R,qualifiedColumnRange:O,qualifiedCell:C});return N.set("09d589ff8f82302ce4c17411c7b811a87fb034e61e4b3013b7f8b18853a90449",k),k})(),ht=N.get("55a9bd1fb59ea19bf98a03859769a119fdc71a44075e560937e7184720e53514")??(()=>{const{OfficeIMOError:S}=pe,{columnName:R}=ze,O=new WeakMap;function C(x,w){O.set(x,w)}function k(x){return O.get(x)}function y(x,w,u){const a=O.get(x);if(a===void 0)return u;const i=w+u;let c=0;for(const o of a){if(o.firstRow>i)break;c+=Math.min(o.lastRow,i)-o.firstRow+1}return c}function m(x,w,u,a,i){if(i===void 0)return a?R(x)+(u+1)+":"+R(w)+(u+a):void 0;const c=R(x),o=R(w);let s="",r=u;for(const n of i){if(!Number.isSafeInteger(n.firstRow)||!Number.isSafeInteger(n.lastRow)||n.firstRow<=r||n.lastRow<n.firstRow||n.lastRow>u+a)throw new RangeError("Detail editing ranges must be ordered within serialized worksheet rows.");const e=c+n.firstRow+":"+o+n.lastRow;if(s.length+(s?1:0)+e.length>32767)throw new S("RESOURCE_LIMIT","Detail editing references exceed 32,767 UTF-16 characters; split the worksheet.");s+=(s?" ":"")+e,r=n.lastRow}return s||void 0}const b=Object.freeze({retainDataRowRanges:C,dataRowRanges:k,dataRowCount:y,dataRowReference:m});return N.set("55a9bd1fb59ea19bf98a03859769a119fdc71a44075e560937e7184720e53514",b),b})(),Xt=N.get("a1b616256344317787b0b102f35d062009d6a2e9c873b9f106c99c095c92ace3")??(()=>{const{cleanXml:S,escapeXml:R,escapeOoxmlAttribute:O}=Se,{cellPosition:C}=Qe,{colorArgb:k}=lt,{fields:y,optionalBoolean:m,differentialXml:b}=dt,{resolveDataColumn:x}=et,{dataRowReference:w}=ht;function u(t,l){if(typeof t=="string"){const h=t.split(":");if(h.length>2)throw new TypeError("Conditional ranges require one uppercase A1 cell or rectangle.");const g=C(h[0]),p=C(h[1]??h[0]);if(p.row<g.row||p.column<g.column||p.column>l.length)throw new RangeError("Conditional ranges require ordered cells within declared columns.");return{first:g.column,last:p.column,reference:t,bottom:p.row}}y(t,["column","through"],"conditional data range");const d=x(l,t.column,"Conditional"),f=t.through===void 0?d:x(l,t.through,"Conditional");if(f<d)throw new RangeError("Conditional data ranges require ordered columns.");return{first:d,last:f}}function a(t){if(typeof t!="number"||!Number.isFinite(t))throw new TypeError("Conditional values must be finite numbers.");return String(t)}function i(t,l){if(typeof t!="string")return a(t);if(l!=="equal"&&l!=="notEqual")throw new TypeError("Text conditional comparisons support only equal and notEqual.");if(t.length>8190)throw new RangeError("Conditional comparison formulas must fit 8,192 characters including quotes.");S(t,"reject");const d='"'+t.replace(/"/g,'""')+'"';if(d.length>8192)throw new RangeError("Conditional comparison formulas must fit 8,192 characters including quotes.");return d}function c(t){if(typeof t!="string")throw new TypeError("Conditional formulas must be strings.");const l=t.trim().replace(/^=/,"");if(!l.trim()||l.length>8192)throw new RangeError("Conditional formulas require 1 through 8,192 characters.");return S(l,"reject"),l}function o(t,l){if(y(t,t.type==="min"||t.type==="max"?["type"]:["type","value"],"conditional threshold"),t.type==="min"||t.type==="max"){if(t.type!==(l==="first"?"min":l==="last"?"max":""))throw new TypeError("Use min only at the start and max only at the end of a scale.");return'<cfvo type="'+t.type+'"/>'}if(t.type==="formula")return'<cfvo type="formula" val="'+O(c(t.value),"reject")+'"/>';if(!["number","percent","percentile"].includes(t.type))throw new TypeError("Unsupported conditional threshold type.");if(!("value"in t))throw new TypeError("A numeric threshold requires a value.");const d=a(t.value);if(t.type!=="number"&&(t.value<0||t.value>100))throw new RangeError("Conditional percent/percentile thresholds must be from 0 through 100.");return'<cfvo type="'+(t.type==="number"?"num":t.type)+'" val="'+d+'"/>'}function s(t){for(let l=1;l<t.length;l++){const d=t[l-1],f=t[l];if("value"in d&&"value"in f&&d.type===f.type&&typeof d.value=="number"&&typeof f.value=="number"&&d.value>f.value)throw new RangeError("Conditional thresholds of the same numeric type must be ordered.")}}function r(t,l,d){if(t===void 0)return[];if(!Array.isArray(t))throw new TypeError("conditionalFormats must be an array.");return t.map(f=>{const h=["type","range"],g=["style","stopIfTrue"];y(f,[...h,...f?.type==="cellIs"?[...g,"operator","value","values"]:f?.type==="expression"?[...g,"formula"]:f?.type==="colorScale"?["stops"]:f?.type==="dataBar"?["color","minimum","maximum","showValue"]:[]],"conditional rule");const p=u(f.range,l);let T="",v="",E;if(f.type==="cellIs"||f.type==="expression")if(m(f.stopIfTrue,"stopIfTrue"),b(f.style,d,()=>164),E={...f.style,...f.style.font?{font:{...f.style.font}}:{},...f.style.fill?{fill:{...f.style.fill}}:{},...f.style.border?{border:Object.fromEntries(Object.entries(f.style.border).filter(([,I])=>I!==void 0).map(([I,P])=>[I,{...P}]))}:{}},f.stopIfTrue!==void 0&&(T+=' stopIfTrue="'+(f.stopIfTrue?1:0)+'"'),f.type==="expression")v="<formula>"+R(c(f.formula),"reject")+"</formula>";else{const I=f.operator==="between"||f.operator==="notBetween";if(!["equal","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","between","notBetween"].includes(f.operator))throw new TypeError("Unsupported conditional comparison operator.");if(I){if("value"in f||!Array.isArray(f.values)||f.values.length!==2)throw new TypeError("between/notBetween require exactly two values.");if(v=f.values.map(P=>"<formula>"+a(P)+"</formula>").join(""),f.values[0]>f.values[1])throw new RangeError("Conditional comparison bounds must be ordered.")}else{if("values"in f||!("value"in f))throw new TypeError("A conditional comparison requires one value.");v="<formula>"+R(i(f.value,f.operator),"reject")+"</formula>"}T+=' operator="'+f.operator+'"'}else if(f.type==="colorScale"){if(!Array.isArray(f.stops)||f.stops.length!==2&&f.stops.length!==3)throw new TypeError("Color scales require two or three stops.");const I=[],P=[];v="<colorScale>"+f.stops.map((B,L)=>(y(B,["threshold","color"],"color stop"),I.push(k(B.color)),P.push(B.threshold),o(B.threshold,L===0?"first":L===f.stops.length-1?"last":"middle"))).join("")+I.map(B=>'<color rgb="'+B+'"/>').join("")+"</colorScale>",s(P)}else if(f.type==="dataBar"){m(f.showValue,"showValue");const I=f.minimum===void 0?{type:"min"}:f.minimum,P=f.maximum===void 0?{type:"max"}:f.maximum;v='<dataBar showValue="'+(f.showValue===!1?0:1)+'">'+o(I,"first")+o(P,"last")+'<color rgb="'+k(f.color)+'"/></dataBar>',s([I,P])}else throw new TypeError("Unsupported conditional rule type.");return{target:p,type:f.type,attributes:T,body:v,...E?{style:E}:{}}})}class n{rules;constructor(l,d){const f=d.addDifferentials(l.flatMap(g=>g.style?[g.style]:[]));let h=0;this.rules=l.map((g,p)=>({target:g.target,xml:'<cfRule type="'+g.type+'" priority="'+(p+1)+'"'+(g.style?' dxfId="'+f[h++]+'"':"")+g.attributes+">"+g.body+"</cfRule>"}))}get count(){return this.rules.length}*xml(l,d,f,h){for(const g of this.rules){if(g.target.bottom!==void 0&&g.target.bottom>f)throw new RangeError("Conditional ranges must stay within exported rows.");const p=g.target.reference??w(g.target.first,g.target.last,l,d,h);p&&(yield'<conditionalFormatting sqref="'+p+'">'+g.xml+"</conditionalFormatting>")}}}const e=Object.freeze({prepareConditionalFormats:r,ConditionalFormats:n});return N.set("a1b616256344317787b0b102f35d062009d6a2e9c873b9f106c99c095c92ace3",e),e})(),qt=N.get("13fa96d976e4dec7343dd3a392829567f1fcb574324a98f5a5d3a61c9a0dc27d")??(()=>{const{OfficeIMOError:S}=pe,{checkAbort:R}=be,{cleanXml:O,escapeOoxmlAttribute:C,escapeXml:k}=Se,{fields:y,optionalBoolean:m}=dt,{resolveDataColumn:b}=et,{dataRowReference:x}=ht;function w(c,o,s){if(c!==void 0){if(typeof c!="string")throw new TypeError(s+" must be text.");if(c.length>o)throw new RangeError(s+" exceeds "+o+" UTF-16 units.");return O(c,"reject")}}function u(c,o,s=1e3,r=1e6,n){if(R(n),c===void 0)return Object.freeze({rules:Object.freeze([]),count:0,textCharacters:0});if(!Array.isArray(c))throw new TypeError("dataValidation must be an array.");const e=c.length;if(e>s)throw new S("RESOURCE_LIMIT","maxDataValidations exceeded.");const t=[],l=new Set;let d=0;const f=h=>{if(d+h>r)throw new S("RESOURCE_LIMIT","maxValidationTextCharacters exceeded.");d+=h};for(let h=0;h<e;h++){R(n);const g=c[h];y(g,["type","column","items","allowBlank","showErrorMessage","errorStyle","errorTitle","errorMessage"],"data validation");const{type:p,column:T,items:v,allowBlank:E,showErrorMessage:I,errorStyle:P,errorTitle:B,errorMessage:L}=g;if(p!=="list")throw new TypeError("Only inline-list data validation is supported.");const H=b(o,T,"Validation");if(l.has(H))throw new TypeError("A data column cannot have multiple validation rules.");if(l.add(H),m(E,"allowBlank"),m(I,"showErrorMessage"),P!==void 0&&!["stop","warning","information"].includes(P))throw new TypeError("Unsupported validation error style.");if(!Array.isArray(v))throw new TypeError("Inline validation lists require a nonempty string array.");const W=v.length;if(!W)throw new TypeError("Inline validation lists require a nonempty string array.");if(W>254)throw new RangeError("Inline validation lists must fit 255 UTF-16 units including quotes and separators.");let U='"';for(let _=0;_<W;_++){R(n);const A=v[_];if(typeof A!="string")throw new TypeError("Inline validation choices must be strings.");if(A.length>253||A.includes(","))throw new RangeError("Inline validation choices cannot contain commas and must fit the 255-character list source.");O(A,"reject");const F=A.replace(/"/g,'""');if(U.length+(_?1:0)+F.length+1>255)throw new RangeError("Inline validation lists must fit 255 UTF-16 units including quotes and separators.");U+=(_?",":"")+F}U+='"';const J=w(B,32,"Validation error title"),Z=w(L,255,"Validation error message");f(U.length+(J?.length??0)+(Z?.length??0));const j=' type="list" allowBlank="'+(E===!1?0:1)+'" showErrorMessage="'+(I===!1?0:1)+'" errorStyle="'+(P??"stop")+'"'+(J===void 0?"":' errorTitle="'+C(J,"reject")+'"')+(Z===void 0?"":' error="'+C(Z,"reject")+'"');t.push(Object.freeze({column:H,attributes:j,formula:U}))}return R(n),Object.freeze({rules:Object.freeze(t),count:e,textCharacters:d})}function*a(c,o,s,r){if(!(!c.count||!s||r?.length===0)){yield'<dataValidations count="'+c.count+'">';for(const n of c.rules){const e=x(n.column,n.column,o,s,r);yield"<dataValidation"+n.attributes+' sqref="'+e+'"><formula1>'+k(n.formula,"reject")+"</formula1></dataValidation>"}yield"</dataValidations>"}}const i=Object.freeze({prepareDataValidations:u,dataValidationsXml:a});return N.set("13fa96d976e4dec7343dd3a392829567f1fcb574324a98f5a5d3a61c9a0dc27d",i),i})(),Dt=N.get("d5957683aa1945575924c89c63b427878e6e6e47ef5c229dc524b1879d146499")??(()=>{const{checkAbort:S,consumeRows:R,inputRows:O,pause:C,taskYieldDue:k}=be,{ChunkedTextSink:y,BlobByteSink:m}=Oe,{OfficeIMOError:b}=pe,{notifyProgress:x,notifySynchronously:w}=Ke,{copyColumns:u,createRowProjector:a}=Ge,{EntryWriter:i}=yt,{xmlDeclaration:c}=Se,{officeRelationshipsNamespace:o}=$e,{Cell:s,cellText:r,columnName:n,inlineText:e,excelDate:t,copyValue:l}=ze,{spreadsheetNamespace:d,colorArgb:f,validateStylePatch:h,copyStylePatch:g}=Ve,{copyHyperlink:p,copyImage:T,hyperlinksXml:v,cellPosition:E}=Qe,{ExportCell:I,assertScalar:P}=Ce,{ReportLayout:B,ComputedTotal:L,printXml:H}=At,{cleanXml:W}=Se,{ConditionalFormats:U,prepareConditionalFormats:J}=Xt,{isDate:Z}=Me,{FormulaCell:j,formulaXml:_,isSubtotalFormula:A}=Je,{prepareDataValidations:F,dataValidationsXml:V}=qt,{qualifiedCell:q,qualifiedColumnRange:$,resolveDataColumn:Q}=et,{dataRowRanges:z,dataRowCount:K}=ht,{captureColumnOutlines:Y,columnOutlineMap:ie,validateOutlinePositions:ae}=jt,ee=65530;function re(he){if(he>ee)throw new RangeError("Excel supports at most 65,530 hyperlinks per worksheet; split the sheet.")}class ue{book;table;preserved;chartData;validations;columns;project;name;declared;options;entry;completion;prepared;buffer;output=new m;started=!1;busy=!1;failed=!1;error;count=0;headerRows;layout;completedRegions;titleStyle;pending=[];pendingCharacters=0;reservedLayout=!1;internalLinks=[];links=[];evictedLinks=0;linkedCells=new Set;droppable=[];droppableLinks=new WeakSet;droppedLinks=0;pictures=[];nativeCharts=[];conditional;completed=!1;chartSources=[];constructor(M,D,G,te,oe=!1,ce=[],se=!1,ge={rules:[],count:0,textCharacters:0}){this.book=M,this.table=te,this.preserved=oe,this.chartData=se,this.validations=ge,this.columns=u(G.columns??[],!0).map(de=>Object.freeze(de));const we=G.alternatingRowStyle;this.options={...G,...G.autoSize?{autoSize:{...G.autoSize}}:{},...G.mergedCells?{mergedCells:[...G.mergedCells]}:{},...G.title?{title:{...G.title,...G.title.style?{style:g(G.title.style)}:{}}}:{},...G.print?{print:{...G.print,...G.print.margins?{margins:{...G.print.margins}}:{}}}:{},...G.footer?{footer:{...G.footer,...G.footer.values?{values:G.footer.values.map(l)}:{},...G.footer.totals?{totals:{...G.footer.totals}}:{},...G.footer.style?{style:g(G.footer.style)}:{}}}:{},...we?{alternatingRowStyle:g(we)}:{}},this.layout=new B(this.columns,this.options,M.settings.invalidCharacterPolicy,M.settings.limits?.maxMergedRanges??1e4,M.settings.limits?.maxBufferedCells??1e5),this.titleStyle=G.title?M.styles.compose(M.styles.compose(0,{font:{bold:!0,size:18}}),this.options.title.style??{}):0,this.headerRows=this.layout.headerRows;for(const de of G.hyperlinks??[]){const X=p(de,M.settings.invalidCharacterPolicy);this.links.push(X),this.linkedCells.add(X.cell)}M.checkLinks(this.links.length),this.declared=this.columns.map((de,X)=>({column:de,letter:n(X+1),style:M.styles.forColumn(de),dateStyle:M.styles.forColumn(de,!1,void 0,!0),headerStyle:this.headerRows?G.headerStyle??M.styles.forColumn({header:de.header,...(G.headerWrap??de.wrapText)===void 0?{}:{wrapText:G.headerWrap??de.wrapText},...de.alignment===void 0?{}:{alignment:de.alignment}},G.boldHeader!==!1,G.headerFill,!1,G.headerBorder):0})),this.conditional=new U(ce,M.styles),M.retainLink(this.links.length),this.name=typeof D=="function"?D():D,this.project=a(this.columns,{sheetName:this.name,firstDataRow:this.headerRows+1},M.settings.signal,M.valueValidator)}static create(M,D,G,te,oe=!1,ce,se){return new ue(M,D,G,te,oe,ce,!1,se)}static createChartData(M,D){return new ue(M,D.dataSheetName,{columns:[{header:"Category"},...D.data.series.map(G=>({header:G.name,type:"number"}))]},void 0,!1,[],!0)}static validate(M,D){const G=u(D.columns??[],!0),te=F(D.dataValidation,G,M.availableDataValidations,M.availableValidationTextCharacters,M.settings.signal);M.checkConditionalFormats(D.conditionalFormats?.length??0);const oe=J(D.conditionalFormats,G,M.settings.invalidCharacterPolicy);M.styles.checkDifferentials(oe.flatMap(se=>se.style?[se.style]:[]));const ce=new B(G,D,M.settings.invalidCharacterPolicy,M.settings.limits?.maxMergedRanges??1e4,M.settings.limits?.maxBufferedCells??1e5);if(M.checkMerges(ce.mergeCount),D.title?.style&&h(D.title.style),D.title&&M.styles.compose(M.styles.compose(0,{font:{bold:!0,size:18}}),D.title.style??{}),D.footer?.style&&M.styles.compose(0,D.footer.style),D.hyperlinks!==void 0){if(!Array.isArray(D.hyperlinks))throw new TypeError("Hyperlinks must be an array.");re(D.hyperlinks.length);const se=new Set;for(const ge of D.hyperlinks){const we=p(ge,M.settings.invalidCharacterPolicy),de=E(we.cell);if(ce.regions.covered(de.column,de.row))throw new TypeError("Hyperlinks cannot address a covered merged cell.");if(se.has(we.cell))throw new TypeError("Duplicate hyperlink cell: "+we.cell);se.add(we.cell)}}if(G.length>16384)throw new RangeError("Excel supports at most 16,384 columns.");if(D.includeHeader===!1&&(D.freezeHeader||D.autoFilter))throw new TypeError("A frozen header or autofilter requires a header row.");if(D.headerFill!==void 0&&f(D.headerFill),D.headerWrap!==void 0&&typeof D.headerWrap!="boolean")throw new TypeError("headerWrap must be boolean.");D.headerStyle!==void 0&&M.styles.validateStyle(D.headerStyle),D.alternatingRowStyle!==void 0&&M.styles.compose(0,D.alternatingRowStyle);for(const se of[D.rowStyle,D.cellStyle,D.rowOutline])if(se!==void 0&&typeof se!="function")throw new TypeError("Row and style callbacks must be functions.");if(D.maxOutlineLevel!==void 0&&(!Number.isInteger(D.maxOutlineLevel)||D.maxOutlineLevel<0||D.maxOutlineLevel>7))throw new RangeError("Maximum outline level must be an integer from zero through seven.");if(ae(D),Y(D.columnOutlines,G.length),D.rowOutline&&D.maxOutlineLevel===void 0)throw new TypeError("A row outline callback requires maxOutlineLevel before streamed rows are written.");if(!D.rowOutline&&D.maxOutlineLevel!==void 0)throw new TypeError("maxOutlineLevel requires a row outline callback.");for(const se of[D.rowHeight,D.headerHeight])if(se!==void 0&&(!Number.isFinite(se)||se<=0||se>409))throw new RangeError("Row height must be positive and at most 409 points.");if(D.freezeColumns!==void 0&&(!Number.isInteger(D.freezeColumns)||D.freezeColumns<0||D.freezeColumns>G.length||D.freezeColumns>=16384))throw new RangeError("Frozen columns must be within the declared columns and leave a valid scrollable column.");if(D.table&&D.includeHeader===!1)throw new TypeError("Excel tables require a header row.");if(D.defaultColumnWidth!==void 0&&(!Number.isFinite(D.defaultColumnWidth)||D.defaultColumnWidth<0||D.defaultColumnWidth>255))throw new RangeError("Default column width must be from 0 through 255 characters.");for(const se of G){if(se.width!==void 0&&(!Number.isFinite(se.width)||se.width<0||se.width>255))throw new RangeError("Column width must be from 0 through 255 characters.");if(se.type!==void 0&&!["string","number","boolean","date"].includes(se.type)&&!M.writerFor(se.type))throw new TypeError("Invalid column type: "+se.type);if(se.alignment!==void 0&&!["left","center","right","fill","justify","distributed"].includes(se.alignment))throw new TypeError("Invalid horizontal alignment.");if(r(se.header,M.settings.invalidCharacterPolicy),se.style!==void 0&&M.styles.validateStyle(se.style),se.format!==void 0&&(typeof se.format!="string"||se.format.length>255))throw new TypeError("Column format must be a string of at most 255 characters.")}return{conditional:oe,validations:te}}cell(M,D,G,te=!1,oe,ce,se,ge=!1,we=!1,de=!0){const X=this.declared[D],ne=M instanceof L?M:void 0;ne&&(M=ne.value);let le=M instanceof j?M:void 0;le&&(M=le.cachedValue);let fe=M instanceof I?M.presentation:void 0,me=M instanceof I?M.link:void 0;M instanceof I&&(M=M.value);const ve=le?.style??(M instanceof s?M.style:void 0),je=(this.completedRegions??this.layout.regions).covered(D+1,G),xe=M instanceof s?M.value:M,Re=je&&(xe==null||xe==="");if(!te&&!ge&&X.column.type&&!Re){const Ie=this.book.writerFor(X.column.type);if(Ie){if(le)throw new TypeError("An explicit FormulaCell cannot also pass through a custom cell value writer; return it from the writer instead.");M=Ie(M instanceof s?M.value:M,{column:X.column,rowIndex:G-this.headerRows-1,worksheetRow:G,columnIndex:D,sheetName:this.name})}}M instanceof j&&(le=M,M=le.cachedValue),M instanceof I&&(fe=M.presentation,me=M.link,M=M.value);const ke=le?.style??(M instanceof s?M.style??ve:ve);if(M instanceof s&&(M=M.value),P(M),je){if(me)throw new TypeError("Hyperlinks cannot address a covered merged cell.");if(le||ne||M!=null&&M!=="")throw new TypeError("A merged range would hide the value at "+X.letter+G+"; covered cells must be empty.");M=void 0}const Pe=Z(M)?"date":typeof M;if(!te&&!ge&&M!=null&&X.column.type&&!this.book.writerFor(X.column.type)&&X.column.type!==Pe)throw new TypeError("Cell "+X.letter+G+" does not match column type "+X.column.type+".");let Ee=ke===void 0?te?X.headerStyle:ne?.operation==="count"?0:Pe==="date"?X.dateStyle:X.style:this.book.styles.validateStyle(ke);if(te&&Pe==="date"&&ke===void 0&&this.options.headerStyle===void 0&&(Ee=this.book.styles.dateHeader(Ee,X.dateStyle)),we&&(Ee=this.titleStyle),!te&&!ge){if(ke===void 0){const Ae=Ee,pt=se?.get(Ae);pt!==void 0?Ee=pt:((G-this.headerRows)%2===0&&this.options.alternatingRowStyle&&(Ee=this.book.styles.compose(Ee,this.options.alternatingRowStyle)),oe!==void 0&&(Ee=this.book.styles.compose(Ee,oe)),se?.set(Ae,Ee))}const Ie=ce&&this.options.cellStyle?.({...ce,value:M,column:X.column,columnIndex:D});Ie!==void 0&&(Ee=this.book.styles.compose(Ee,Ie))}ge&&this.options.footer?.style&&ke===void 0&&(Ee=this.book.styles.compose(Ee,this.options.footer.style)),fe&&ke===void 0&&(Ee=this.book.styles.compose(Ee,{...fe.background===void 0?{}:{fill:{color:fe.background}},...fe.color===void 0&&fe.bold===void 0&&fe.italic===void 0?{}:{font:{...fe.color===void 0?{}:{color:fe.color},...fe.bold===void 0?{}:{bold:fe.bold},...fe.italic===void 0?{}:{italic:fe.italic}}},...fe.wrapText===void 0?{}:{wrapText:fe.wrapText},...fe.alignment===void 0?{}:{alignment:fe.alignment},...fe.numberFormat===void 0?{}:{numberFormat:fe.numberFormat}}));const He=typeof M=="string"?M.length:0;let Le=this.preserved||te||ge?He:void 0;if(Pe==="string"&&He>32767&&W(M,this.book.settings.invalidCharacterPolicy).length>32767){const Ie=X.letter+G;if(me||this.linkedCells.has(Ie))throw new TypeError("A text-preservation cell cannot also have an external hyperlink.");this.makeLinkRoom(),re(this.linkCount+1),this.book.checkLinks(1),Le!==void 0&&(this.book.budget.release(1,Le),Le=void 0);const Ae=this.book.preserveText(this.name,Ie,M);this.book.retainLink(),this.internalLinks.push({cell:Ie,location:Ae.location}),this.linkedCells.add(Ie),M=Ae.preview}if(me&&this.appendHyperlink({cell:X.letter+G,...me},!te&&!ge&&!we&&this.book.settings.hyperlinkOverflow==="drop"),Pe==="date"&&(M=t(M,this.book.settings.dateMode)),!te&&!ge&&de&&(!le||!A(le))&&this.layout.accept(D,M),!te&&!ge&&this.chartSources.length)for(const Ie of this.chartSources)Ie.observe(G-this.headerRows-1,D+1,M);const Fe='<c r="'+X.letter+G+'" s="'+Ee+'"';if(le&&this.book.retainFormula(le.formula.length),this.book.budget.cell(le?le.formula:M,Le),le)return Fe+(M===null?' t="str"':"")+">"+_(le)+"</c>";if(ne)return Fe+(M===null?' t="str"':"")+"><f>"+ne.formula.replace(/"/g,""")+"</f><v>"+(M??"")+"</v></c>";if(M==null||Pe==="number"&&!Number.isFinite(M)||M==null)return Fe+"/>";if(Pe==="string")return Fe+' t="inlineStr"><is>'+e(M,this.book.settings.invalidCharacterPolicy)+"</is></c>";if(Pe==="boolean")return Fe+' t="b"><v>'+(M?1:0)+"</v></c>";if(Pe!=="number"&&Pe!=="date")throw new TypeError("Excel cells must be strings, numbers, booleans, Dates or null.");return Fe+"><v>"+M+"</v></c>"}*rowXml(M,D,G,te=!1,oe=!1){const ce=oe?this.options.title?.height??28:G?this.options.headerHeight:this.options.rowHeight,se=!G&&!te&&(this.options.rowStyle||this.options.cellStyle||this.options.rowOutline)?Object.freeze({rowIndex:D-this.headerRows-1,worksheetRow:D,sheetName:this.name,values:Object.freeze(this.columns.map((X,ne)=>M[ne]instanceof j?M[ne].cachedValue:M[ne]instanceof s||M[ne]instanceof I?M[ne].value:M[ne]))}):void 0,ge=se&&this.options.rowStyle?.(se);ge!==void 0&&h(ge);const we=this.outline(se),de=!G&&(ge||this.options.alternatingRowStyle)?new Map:void 0;yield'<row r="'+D+'"'+(ce===void 0?"":' ht="'+ce+'" customHeight="1"')+(we?.level?' outlineLevel="'+we.level+'"':"")+(we?.hidden?' hidden="1"':"")+(we?.collapsed?' collapsed="1"':"")+">";for(let X=0;X<this.columns.length;X++)yield this.cell(M[X],X,D,G,ge,se,de,te,oe,we?.hidden!==!0);yield"</row>"}outline(M){if(!M||!this.options.rowOutline)return;const D=this.options.rowOutline(M);if(D===void 0)return;if(D===null||typeof D!="object"||Array.isArray(D))throw new TypeError("Row outline callbacks must return metadata or undefined.");if(typeof D.then=="function")throw Promise.resolve(D).catch(()=>{}),new TypeError("Row outline callbacks must return synchronous metadata.");const{level:G,hidden:te,collapsed:oe}=D,ce=G??0;if(!Number.isInteger(ce)||ce<0||ce>this.options.maxOutlineLevel)throw new RangeError("Row outline level exceeds the declared maximum.");for(const se of[te,oe])if(se!==void 0&&typeof se!="boolean")throw new TypeError("Row outline flags must be booleans.");return Object.freeze({level:ce,...te===void 0?{}:{hidden:te},...oe===void 0?{}:{collapsed:oe}})}writeRow(M,D,G,te=!1,oe=!1){const ce=this.rowXml(M,D,G,te,oe),se=()=>{for(;;){const ge=ce.next();if(ge.done)return;if(this.buffer.append(ge.value))return this.buffer.flush().then(se)}};return se()}async sampleRow(M){if((this.pending.length+1)*this.columns.length>(this.book.settings.limits?.maxBufferedCells??1e5))throw new b("RESOURCE_LIMIT","Width sampling cell limit exceeded; reduce sampleRows or raise its bounded limit.");const D=[];let G=0;for(const te of this.rowXml(M,this.count+this.headerRows+1,!1)){if(!this.started&&this.pendingCharacters+te.length>(this.book.settings.limits?.maxBufferedCharacters??1e6)){if(this.options.autoSize?.sampleRows!==void 0)throw new b("RESOURCE_LIMIT","Width sampling text limit exceeded; reduce sampleRows or raise its bounded limit.");this.layout.sample(M),await this.start();for(const oe of D)this.buffer.append(oe)&&await this.buffer.flush();D.length=0}this.started?this.buffer.append(te)&&await this.buffer.flush():(this.pendingCharacters+=te.length,D.push(te)),!this.started&&(++G&127)===0&&k()&&(await C(),S(this.book.settings.signal))}this.started||(this.layout.sample(M),this.pending.push(D))}reserveLayout(){if(!this.reservedLayout){if(!this.preserved){let M=0;if(this.options.title&&(M+=this.options.title.text.length),this.layout.firstHeaderRow)for(const D of this.layout.headings)for(const G of D){const te=G instanceof I||G instanceof s?G.value:G;typeof te=="string"&&(M+=te.length)}if(this.layout.structuredFooter)for(const D of this.layout.structuredFooter.values)for(const G of D){const te=G instanceof I?G.value:G;typeof te=="string"&&(M+=te.length)}else if(this.options.footer)for(let D=0;D<this.columns.length;D++){const G=this.columns[D],te=this.options.footer.totals;if(te&&Object.prototype.hasOwnProperty.call(te,G.key??G.header))continue;const oe=this.options.footer.values?.[D],ce=oe instanceof I||oe instanceof s?oe.value:oe;typeof ce=="string"&&(M+=ce.length)}this.book.budget.reserve(this.columns.length*(this.headerRows+this.layout.footerRows),M)}this.reservedLayout=!0}}async start(){if(this.started)return;this.reserveLayout(),this.started=!0,this.entry=this.book.settings.sink?await this.book.openSheet(this):new i(this.book.settings.compression,{write:X=>{this.book.retainBufferedBytes(X.length),this.output.write(X)}},this.book.settings.signal);const M=this.buffer=new y(this.entry,this.book.settings.signal),D=this.options,G=D.freezeColumns??0,te=D.freezeHeader?this.headerRows:0,oe=G&&te?"bottomRight":G?"topRight":"bottomLeft",ce=n(G+1)+(te+1),se=ie(D.columnOutlines),ge=!!D.rowOutline||se.size>0,we=Math.max(0,...Array.from(se.values(),X=>X.level??0));await M.write(c+'<worksheet xmlns="'+d+'" xmlns:r="'+o+'">'+(D.print||ge?"<sheetPr>"+(ge?'<outlinePr summaryBelow="'+(D.outlineSummaryBelow===!1?"0":"1")+'"'+(D.outlineSummaryRight===void 0?"":' summaryRight="'+(D.outlineSummaryRight?"1":"0")+'"')+' showOutlineSymbols="1"/>':"")+(D.print?'<pageSetUpPr fitToPage="1"/>':"")+"</sheetPr>":"")+'<sheetViews><sheetView workbookViewId="0">'+(G||te?"<pane"+(G?' xSplit="'+G+'"':"")+(te?' ySplit="'+te+'"':"")+' topLeftCell="'+ce+'" activePane="'+oe+'" state="frozen"/><selection pane="'+oe+'" activeCell="'+ce+'" sqref="'+ce+'"/>':"")+"</sheetView></sheetViews>"+(ge?'<sheetFormatPr defaultRowHeight="15"'+(D.rowOutline?' outlineLevelRow="'+D.maxOutlineLevel+'"':"")+(se.size?' outlineLevelCol="'+we+'"':"")+"/>":""));const de=D.defaultColumnWidth??(this.table?20:void 0);if(this.columns.some((X,ne)=>this.layout.widths[ne]!==void 0||de!==void 0||se.has(ne))){await M.write("<cols>");for(let X=0;X<this.columns.length;X++){const ne=this.layout.widths[X]??de,le=se.get(X);(ne!==void 0||le)&&await M.write('<col min="'+(X+1)+'" max="'+(X+1)+'"'+(ne===void 0?"":' width="'+ne+'" customWidth="1"')+(le?.level?' outlineLevel="'+le.level+'"':"")+(le?.hidden?' hidden="1"':"")+(le?.collapsed?' collapsed="1"':"")+"/>")}await M.write("</cols>")}if(await M.write("<sheetData>"),D.title&&await this.writeRow(this.columns.map((X,ne)=>ne?"":D.title.text),1,!0,!1,!0),this.layout.firstHeaderRow)for(let X=0;X<this.layout.headings.length;X++)await this.writeRow(this.layout.headings[X],X+this.layout.firstHeaderRow,!0);for(const X of this.pending)for(const ne of X)M.append(ne)&&await M.flush();this.pending=[],this.pendingCharacters=0}async addRows(M){if(this.book.assertOpen(),this.completion)throw new b("INVALID_STATE","Worksheet is closed.");if(this.busy)throw new b("INVALID_STATE","Await the current addRows call before writing more rows to this sheet.");if(this.failed)throw this.error;this.busy=!0;try{this.reserveLayout(),this.layout.sampleRows||await this.start();let D=performance.now();const G=()=>{performance.now()-D>=50&&(this.progress(),D=performance.now())},te=()=>{if(this.count++,!this.started&&this.pending.length>=this.layout.sampleRows)return this.start().then(G);if(!this.started&&k())return C().then(()=>{S(this.book.settings.signal),G()});G()};await R(M,this.book.settings.signal,oe=>{if(this.count+this.headerRows+this.layout.footerRows>=1048576)throw new RangeError("Excel supports at most 1,048,576 rows including headers and footers; split the sheet.");if(this.book.budget.row(this.count+1),!this.columns.length)throw new RangeError("Declare columns before adding rows.");const ce=this.project(oe,this.count),se=this.started?this.writeRow(ce,this.count+this.headerRows+1,!1):this.sampleRow(ce);return se?se.then(te):te()}),this.buffer&&await this.buffer.flush(),this.progress(),S(this.book.settings.signal)}catch(D){throw this.failed=!0,this.error=D,await this.book.discard(D),D}finally{this.busy=!1}}progress(){!this.preserved&&!this.chartData&&x(this.book.settings.onProgress,{phase:"rows",rows:this.book.rowCount,sheetRows:this.reportRowCount,sheetName:this.name})}get rowCount(){return this.count}dataRange(M){if(this.failed)throw this.error;if(!this.completed)throw new b("INVALID_STATE","Close the worksheet before resolving its data range.");const D=Q(this.columns,M),G=z(this);if(G!==void 0){if(G.length>1)throw new b("INVALID_STATE","Grouped details are discontiguous; use the grouped result's detailRanges for explicit formula references.");const te=G[0];return te?$(this.name,D,te.firstRow,te.lastRow-te.firstRow+1):void 0}return this.count?$(this.name,D,this.headerRows+1,this.count):void 0}get chartBindingMetadata(){const M=this.layout.headings.at(-1);return{name:this.name,columns:this.columns,headerRows:this.headerRows,rows:this.count,closed:this.completed||!!this.completion,headerReferences:this.columns.map((D,G)=>{const te=M?.[G],oe=te instanceof I?te.value:te;return this.layout.firstHeaderRow&&oe===D.header&&!this.layout.regions.covered(G+1,this.headerRows)?q(this.name,G+1,this.headerRows):void 0})}}retainChartBinding(M){this.chartSources.push(M)}get reportRowCount(){return this.preserved||this.chartData?0:K(this,this.headerRows,this.count)}get hidden(){return this.chartData}addChart(M){if(this.book.assertOpen(),this.completion)throw new b("INVALID_STATE","Worksheet is closed.");if(this.failed)throw this.error;this.nativeCharts.push(this.book.registerChart(M))}get charts(){return this.nativeCharts}releaseCharts(){this.nativeCharts.length=0}addImage(M){if(this.book.assertOpen(),this.completion)throw new b("INVALID_STATE","Worksheet is closed.");if(this.failed)throw this.error;const D=T(M,this.book.settings.invalidCharacterPolicy,G=>this.book.checkImage(G));this.book.retainImage(D.data.length),this.pictures.push(D)}addHyperlink(M){if(this.book.assertOpen(),this.completion)throw new b("INVALID_STATE","Worksheet is closed.");if(this.failed)throw this.error;this.appendHyperlink(M)}appendHyperlink(M,D=!1){const G=p(M,this.book.settings.invalidCharacterPolicy),te=E(G.cell);if(this.layout.regions.covered(te.column,te.row))throw new TypeError("Hyperlinks cannot address a covered merged cell.");if(this.linkedCells.has(G.cell))throw new TypeError("Duplicate hyperlink cell: "+G.cell);if(D&&this.linkCount>=ee){this.droppedLinks++;return}D||this.makeLinkRoom(),re(this.linkCount+1),this.book.retainLink(),D&&(this.droppable.push(this.links.length),this.droppableLinks.add(G)),this.links.push(G),this.linkedCells.add(G.cell)}get linkCount(){return this.links.length-this.evictedLinks+this.internalLinks.length}makeLinkRoom(){if(this.linkCount<ee||!this.droppable.length)return;const M=this.droppable.pop(),D=this.links[M];this.links[M]=void 0,this.evictedLinks++,this.linkedCells.delete(D.cell),this.book.releaseLink(),this.droppedLinks++}compactLinks(){if(this.evictedLinks){const M=[],D=[];for(const G of this.links)G&&(this.droppableLinks.has(G)&&D.push(M.length),M.push(G));this.links=M,this.droppable=D,this.evictedLinks=0}return this.links}get hyperlinks(){return this.compactLinks()}get images(){return this.pictures}get tableDefinition(){return this.count?this.table:void 0}get isBusy(){return this.busy}get headerRowCount(){return this.headerRows}get firstHeaderRow(){return this.layout.firstHeaderRow}get mergeCount(){return this.layout.mergeCount}get conditionalFormatCount(){return this.conditional.count}get dataValidations(){return this.validations}get totalRows(){return Math.max(1,this.headerRows+this.count+this.layout.footerRows)}get lastColumn(){return n(Math.max(1,this.columns.length))}get printSettings(){return this.options.print}get footerSettings(){return this.layout.structuredFooter?void 0:this.options.footer}async close(){if(this.book.assertOpen(),this.busy)throw new b("INVALID_STATE","Await addRows before closing the worksheet.");try{await this.finish()}catch(M){throw await this.book.discard(M),M}}finish(M){if(this.completion)return this.completion;if(this.failed)throw this.error;return this.completion=(async()=>{try{const D=this.completedRegions=this.layout.finalRegions(this.count,this.book.settings.limits?.maxMergedRanges??1e4);D.validateRows(this.totalRows);for(const ce of this.chartSources)ce.finish();this.chartSources.length=0;for(const ce of this.compactLinks()){const se=E(ce.cell);if(se.column>this.columns.length||se.row>this.totalRows)throw new RangeError("Hyperlinks must address cells within the exported rows and columns.");if(D.covered(se.column,se.row))throw new TypeError("Hyperlinks cannot address a covered merged cell.")}if(await this.start(),M)for await(const ce of O(M,this.book.settings.signal))this.book.budget.row(this.count+1),await this.writeRow(this.project(ce,this.count),this.headerRows+this.count+1,!1),this.count++;if(this.layout.structuredFooter)for(let ce=0;ce<this.layout.footerRows;ce++)await this.writeRow(this.layout.structuredFooter.values[ce],this.headerRows+this.count+ce+1,!1,!0);else this.options.footer&&await this.writeRow(this.layout.footer(this.count),this.headerRows+this.count+1,!1,!0);await this.buffer.write("</sheetData>"),this.options.autoFilter&&this.headerRows&&!this.tableDefinition&&await this.buffer.write('<autoFilter ref="A'+this.headerRows+":"+n(this.columns.length)+(this.count+this.headerRows)+'"/>'),D.references.length&&await this.buffer.write('<mergeCells count="'+D.references.length+'">'+D.references.map(ce=>'<mergeCell ref="'+ce+'"/>').join("")+"</mergeCells>");const G=z(this);for(const ce of this.conditional.xml(this.headerRows,this.count,this.totalRows,G))await this.buffer.write(ce);for(const ce of V(this.validations,this.headerRows,this.count,G))await this.buffer.write(ce);this.droppedLinks&&w("onHyperlinkOverflow",this.book.settings.onHyperlinkOverflow,Object.freeze({sheetName:this.name,dropped:this.droppedLinks}));const te=this.compactLinks();(te.length||this.internalLinks.length)&&await this.buffer.write(v(te,this.book.settings.invalidCharacterPolicy,this.internalLinks)),await this.buffer.write(H(this.options.print,this.book.settings.invalidCharacterPolicy)),(this.pictures.length||this.nativeCharts.length)&&await this.buffer.write('<drawing r:id="drawing"/>'),this.tableDefinition&&await this.buffer.write('<tableParts count="1"><tablePart r:id="table"/></tableParts>'),await this.buffer.write("</worksheet>"),await this.buffer.close();const oe=await this.entry.close();!this.book.settings.sink&&!this.failed&&(this.prepared={...oe,chunks:this.output.takeChunks()}),this.completed=!0}catch(D){throw await this.discard(D),D}})()}takePrepared(){const M=this.prepared;return this.prepared=void 0,M}async discard(M){this.failed=!0,this.error=M,this.pending=[],this.pendingCharacters=0,this.prepared=void 0,this.buffer=void 0,this.nativeCharts.length=0,this.chartSources.length=0,this.output.discard(),await this.entry?.discard(M)}}const ye=Object.freeze({Worksheet:ue});return N.set("d5957683aa1945575924c89c63b427878e6e6e47ef5c229dc524b1879d146499",ye),ye})(),Zt=N.get("c84eae41cd3066f5463d88a1f467117b37dd9e9c9ccd8c0f8a106aa41631fea0")??(()=>{const{escapeOoxmlAttribute:S,escapeXml:R,xmlDeclaration:O}=Se,{cellText:C,columnName:k}=ze,{spreadsheetNamespace:y}=Ve,{ExportCell:m}=Ce,{Cell:b}=ze,{totalFormula:x}=At;function w(i,c,o,s){const r=c.name??"Table"+i;if(typeof r!="string"||r.length>255||!/^[A-Za-z_][A-Za-z0-9_.]*$/.test(r)||/^(?:[A-Za-z]{1,3}[1-9][0-9]*|R[1-9][0-9]*C[1-9][0-9]*|R|C)$/i.test(r))throw new TypeError("Table names must be ASCII identifiers, at most 255 characters, and cannot be cell references.");const n=c.style??"TableStyleMedium2",e=/^TableStyle(Light|Medium|Dark)([1-9][0-9]?)$/.exec(n);if(!e||Number(e[2])>({Light:21,Medium:28,Dark:11}[e[1]]??0))throw new TypeError("Unknown built-in Excel table style.");const t=o.map(l=>C(l.header,s));if(!t.length||t.some(l=>!l.trim()||l.length>255)||new Set(t.map(l=>l.toLowerCase())).size!==t.length)throw new TypeError("Excel tables require nonblank, unique headers of at most 255 characters.");return Object.freeze({id:i,name:r,headers:Object.freeze(t),keys:Object.freeze(o.map(l=>l.key??l.header)),options:Object.freeze({...c,style:n})})}function u(i,c,o,s=1,r){const n="A"+s+":"+k(i.headers.length)+(c+s),e="A"+s+":"+k(i.headers.length)+(c+s+(r?1:0)),t=i.options,l=S(i.name,o);return O+'<table xmlns="'+y+'" id="'+i.id+'" name="'+l+'" displayName="'+l+'" ref="'+e+'"'+(r?' totalsRowCount="1"':' totalsRowShown="0"')+'><autoFilter ref="'+n+'"/><tableColumns count="'+i.headers.length+'">'+i.headers.map((d,f)=>{const h=i.keys[f],g=r?.totals&&Object.prototype.hasOwnProperty.call(r.totals,h)?r.totals[h]:void 0,p=r?.values?.[f],T=p instanceof b||p instanceof m?p.value:p,v=g&&["average","min","max"].includes(g),E=g?' totalsRowFunction="'+(v?"custom":g==="count"?"countNums":g)+'"':typeof T=="string"?' totalsRowLabel="'+S(T,o)+'"':"";return'<tableColumn id="'+(f+1)+'" name="'+S(d,o)+'"'+E+(v?"><totalsRowFormula>"+R(x(g,k(f+1),s,c),o)+"</totalsRowFormula></tableColumn>":"/>")}).join("")+'</tableColumns><tableStyleInfo name="'+t.style+'" showFirstColumn="'+(t.firstColumn?1:0)+'" showLastColumn="'+(t.lastColumn?1:0)+'" showRowStripes="'+(t.bandedRows!==!1?1:0)+'" showColumnStripes="'+(t.bandedColumns?1:0)+'"/></table>'}const a=Object.freeze({defineTable:w,tableXml:u});return N.set("c84eae41cd3066f5463d88a1f467117b37dd9e9c9ccd8c0f8a106aa41631fea0",a),a})(),$t=N.get("0c395783b9d7cc62dd39a21adeb698ad4a61e2c89f7b1fc8712e2eb2ccfe9d92")??(()=>{const{OfficeIMOError:S}=pe,{cleanXml:R}=Se;class O{sheetName;maximum;policy;reserve;entries=[];characters=0;rows=0;constructor(b,x,w,u){this.sheetName=b,this.maximum=x,this.policy=w,this.reserve=u}add(b,x,w){const u=R(w,this.policy);if(this.characters+u.length>this.maximum)throw new S("RESOURCE_LIMIT","maxOverflowCharacters exceeded; use CSV or raise the bounded preservation limit.");let a=0;for(const o of k(u))a++;if(this.rows+a>1048575)throw new S("RESOURCE_LIMIT","Text overflow exceeds the worksheet row limit.");this.reserve(a*5,u.length+a*(b.length+x.length),this.rows+a);const i=this.rows+2;this.entries.push({sheet:b,cell:x,text:u,first:i,parts:a}),this.rows+=a,this.characters+=u.length;const c="\n[Full text: "+this.sheetName+"!D"+i+"; "+a+" parts]";return{preview:C(u,32767-c.length)+c,location:"'"+this.sheetName.replace(/'/g,"''")+"'!D"+i}}*values(){for(const b of this.entries){let x=0;for(const w of k(b.text))yield[b.sheet,b.cell,++x,w,b.parts]}}clear(){this.entries=[],this.characters=0,this.rows=0}}function C(m,b){let x=Math.min(b,m.length);return x<m.length&&/[\ud800-\udbff]/.test(m[x-1]??"")&&x--,m.slice(0,x)}function*k(m){let b=0;for(;b<m.length;){const x=C(m.slice(b,b+32768),32767);b+=x.length,yield x}}const y=Object.freeze({TextOverflow:O,clipText:C});return N.set("0c395783b9d7cc62dd39a21adeb698ad4a61e2c89f7b1fc8712e2eb2ccfe9d92",y),y})(),tt=N.get("fd70ccda89f27c6b874c8840ac944b3ec723dbdef3dfe7600f7bdb81f4660c96")??(()=>{const{captureFields:S}=Te,R=["signal","onProgress","limits","sink","dateMode","compression","invalidCharacterPolicy","appProperties","cellValueWriters","oversizedText","hyperlinkOverflow","onHyperlinkOverflow","creator","title","subject","description","created","modified"],O=["columns","includeHeader","headerRows","freezeHeader","autoFilter","boldHeader","headerFill","headerBorder","headerWrap","headerStyle","alternatingRowStyle","rowStyle","cellStyle","rowOutline","maxOutlineLevel","outlineSummaryBelow","outlineSummaryRight","columnOutlines","rowHeight","headerHeight","defaultColumnWidth","freezeColumns","table","autoSize","footer","print","title","mergedCells","hyperlinks","conditionalFormats","dataValidation"],C=["maxRows","maxCells","maxTextCharacters","maxOutputBytes","maxStyles","maxSheets","maxOverflowCharacters","maxHyperlinks","maxImageBytes","maxBufferedCells","maxBufferedCharacters","maxMergedRanges","maxConditionalFormats","maxDifferentialStyles","maxCharts","maxChartPoints","maxChartTextCharacters","maxFormulaCharacters","maxDataValidations","maxValidationTextCharacters"];function k(b){return S(b,C)}function y(b){const x=S(b,R);return{...x,...x.limits===void 0?{}:{limits:k(x.limits)}}}const m=Object.freeze({workbookOptionFields:R,sheetOptionFields:O,workbookLimitFields:C,captureWorkbookLimits:k,captureWorkbookOptions:y});return N.set("fd70ccda89f27c6b874c8840ac944b3ec723dbdef3dfe7600f7bdb81f4660c96",m),m})(),Kt=N.get("35db01801a6b2e3e0c5acd7493e56f04b5b41b1d57afa8be28b8358378ad6494")??(()=>{const{checkAbort:S}=be,{NotSupportedError:R,OfficeIMOError:O}=pe,{cleanXml:C}=Se,{captureFields:k}=Te;function y(u,a,i){if(!u||typeof u!="object"||Array.isArray(u))throw new TypeError(i+" must be an object.");for(const c of Object.keys(u))if(!a.includes(c))throw new R(i+"."+c);return k(u,a)}function m(u){if(typeof u=="string"?!u.length:typeof u!="number"||!Number.isInteger(u)||u<1||u>16384)throw new TypeError("Chart columns require a declared key or a one-based column number.")}function b(u){const a=y(u,["kind","sheet","firstRow","rowCount","categoryColumn","series"],"chart.data");if(a.kind!=="range")throw new TypeError("A chart range must declare kind: range.");if(!a.sheet||typeof a.sheet!="object"||Array.isArray(a.sheet))throw new TypeError("A chart range needs its owning worksheet.");const i=a.firstRow===void 0?0:a.firstRow,c=a.rowCount;if(!Number.isSafeInteger(i)||i<0||!Number.isSafeInteger(c)||c<1||i+c>1048576)throw new RangeError("Chart data rows must form a nonempty finite Excel range.");if(m(a.categoryColumn),!Array.isArray(a.series)||a.series.length<1||a.series.length>255)throw new RangeError("A chart needs from 1 through 255 series.");const o=a.series.map(s=>{const r=y(s,["column","name","color"],"chart.data.series");if(m(r.column),r.name!==void 0&&typeof r.name!="string")throw new TypeError("Chart series name must be a string.");if(r.color!==void 0&&(typeof r.color!="string"||!/^#?[0-9a-fA-F]{6}$/.test(r.color)))throw new TypeError("Chart colors must be opaque six-digit RGB hex values.");return Object.freeze(r)});return Object.freeze({kind:"range",sheet:a.sheet,firstRow:i,rowCount:c,categoryColumn:a.categoryColumn,series:Object.freeze(o)})}function x(u,a,i,c,o="columnClustered"){S(c);const s=u.rowCount,r=u.firstRow??0,n=s*u.series.length,e=a.categoryColumn;if(n>i.availablePoints)throw new O("RESOURCE_LIMIT","maxChartPoints exceeded.");if(a.source!==u.sheet||!Number.isInteger(a.headerRows)||a.headerRows<0||a.headerRows+r+s>1048576||a.seriesColumns.length!==u.series.length||a.seriesNames.length!==u.series.length||a.valueFormulas.length!==u.series.length||a.nameFormulas.length!==u.series.length)throw new TypeError("Resolved chart range does not match its declared columns and data rows.");for(const B of[a.categoryColumn,...a.seriesColumns])if(!Number.isInteger(B)||B<1||B>16384)throw new RangeError("Resolved chart columns must be one-based Excel columns.");if(a.seriesColumns.includes(e))throw new TypeError("Chart category and numeric series must use different columns.");let t=0;const l=u.series.map((B,L)=>{const H=B.name??a.seriesNames[L];if(typeof H!="string"||H.length>32767)throw new TypeError("Chart series names must fit Excel text cells.");if(t+=H.length,t>i.availableText)throw new O("RESOURCE_LIMIT","maxChartTextCharacters exceeded.");return C(H,i.policy)}),d=u.series.map(B=>B.color?.replace(/^#/,"").toUpperCase()),f=new Array(s),h=u.series.map(()=>new Array(s)),g=u.series.map(()=>0),p=u.series.map(()=>!1);let T=0,v;const E=()=>{if(S(c),!v){if(T!==s||g.some(B=>B!==s))throw new TypeError("Chart range did not receive every declared data row and numeric value.");if(o==="pie"&&!p[0])throw new RangeError("A pie chart needs at least one positive value.");v=Object.freeze({categories:Object.freeze(f),series:Object.freeze(h.map((B,L)=>Object.freeze({name:l[L],values:Object.freeze(B),...d[L]===void 0?{}:{color:d[L]}})))})}},I=Object.freeze({get categories(){return E(),v.categories},get series(){return E(),v.series}}),P=new Map;return a.seriesColumns.forEach((B,L)=>{const H=P.get(B)??[];H.push(L),P.set(B,H)}),Object.freeze({source:a.source,points:n,textCharacters:t,data:I,references:Object.freeze({categories:a.categoryFormula,values:Object.freeze([...a.valueFormulas]),names:Object.freeze(a.nameFormulas.map((B,L)=>u.series[L].name===void 0?B:void 0))}),observe(B,L,H){S(c);const W=B-r;if(!(W<0||W>=s)){if(v)throw new O("INVALID_STATE","Chart cache is already finalized.");if(L===e){if(typeof H!="string"||H.length>32767)throw new TypeError("Chart category cells must contain strings of at most 32,767 UTF-16 units.");if(f[W]!==void 0)throw new O("INVALID_STATE","A chart category cell was observed more than once.");i.retainText(H.length),f[W]=C(H,i.policy),T++}for(const U of P.get(L)??[]){if(typeof H!="number"||!Number.isFinite(H))throw new TypeError("Chart series cells require finite numbers or numeric formula caches.");if(o==="pie"&&H<0)throw new RangeError("Pie charts require nonnegative values.");if(h[U][W]!==void 0)throw new O("INVALID_STATE","A chart value cell was observed more than once.");h[U][W]=H,g[U]=g[U]+1,H>0&&(p[U]=!0)}}},finish:E})}const w=Object.freeze({captureChartRange:b,prepareChartBinding:x});return N.set("35db01801a6b2e3e0c5acd7493e56f04b5b41b1d57afa8be28b8358378ad6494",w),w})(),Jt=N.get("24f1417c3c320a8a41137c28f70b72091256c63010be0c88b684dce85f54950c")??(()=>{const{checkAbort:S}=be,{NotSupportedError:R,OfficeIMOError:O}=pe,{cleanXml:C}=Se,{copyDrawingAnchor:k}=Qe,{captureFields:y}=Te,{captureChartRange:m,prepareChartBinding:b}=Kt;function x(i,c,o){if(!i||typeof i!="object"||Array.isArray(i))throw new TypeError(o+" must be an object.");for(const s of Object.keys(i))if(!c.includes(s))throw new R(o+"."+s)}function w(i,c,o){return x(i,c,o),y(i,c)}function u(i,c,o,s,r,n){if(S(r),i=w(i,["type","data","row","column","width","height","description","title","language","legend","dataLabels","categoryAxis","valueAxis"],"chart"),!["columnClustered","barClustered","line","pie"].includes(i.type))throw new R("chart type "+i.type);const e=i.type,t=w(i.data,["kind","sheet","firstRow","rowCount","categoryColumn","categories","series"],"chart.data"),l=t.kind==="range"?m(t):void 0;l||x(t,["categories","series"],"chart.data");const d=l?void 0:t.categories,f=l?.series??t.series;if(!l&&!Array.isArray(d))throw new TypeError("Chart categories must be a nonempty array of strings.");if(!Array.isArray(f))throw new RangeError("A chart needs from 1 through 255 series.");const h=l?.rowCount??d.length,g=f.length;if(!h)throw new TypeError("Chart categories must be a nonempty array of strings.");if(!g||g>255)throw new RangeError("A chart needs from 1 through 255 series.");if(!l&&h>1048575)throw new RangeError("Chart data must fit Excel's rows including its header.");if(e==="pie"&&g!==1)throw new TypeError("A pie chart supports exactly one series.");const p=h*g;if(p>o)throw new O("RESOURCE_LIMIT","maxChartPoints exceeded.");let T=0;const v=(F,V)=>{if(typeof F!="string")throw new TypeError(V+" must be a string.");if(F.length>32767)throw new RangeError(V+" exceeds 32,767 UTF-16 units.");if(T+=F.length,T>s)throw new O("RESOURCE_LIMIT","maxChartTextCharacters exceeded.");return C(F,c)},E=(F,V)=>F===void 0?void 0:v(F,V),I=E(i.title,"Chart title"),P=E(i.description,"Chart description"),B=E(i.language,"Chart language");let L;if(B!==void 0)try{if(L=Intl.getCanonicalLocales(B)[0],!L)throw new RangeError}catch{throw new TypeError("Chart language must be a language tag such as pl or pl-PL.")}const H=k({row:i.row,column:i.column,width:i.width,height:i.height,...P===void 0?{}:{description:P}},c);if(i.legend!==void 0&&i.legend!==!1&&!["right","bottom","left","top"].includes(i.legend))throw new TypeError("Unsupported chart legend position.");let W;if(i.dataLabels!==void 0){const F=w(i.dataLabels,["showValue","showCategoryName","showSeriesName","showPercent","position","numberFormat"],"chart.dataLabels");for(const $ of["showValue","showCategoryName","showSeriesName","showPercent"])if(F[$]!==void 0&&typeof F[$]!="boolean")throw new TypeError("Chart label flags must be booleans.");if(F.showPercent&&e!=="pie")throw new TypeError("Percent data labels require a pie chart.");const V=e==="pie"?["center","insideEnd","outsideEnd","bestFit"]:e==="line"?["center","above","below","left","right"]:["center","insideEnd","outsideEnd"];if(F.position!==void 0&&!V.includes(F.position))throw new TypeError("Data label position is unsupported for this chart type.");const q=E(F.numberFormat,"Data label number format");if(q!==void 0&&!q.trim())throw new TypeError("Data label number format cannot be blank.");W=Object.freeze({...F,...q===void 0?{}:{numberFormat:q}})}if(e==="pie"&&(i.categoryAxis!==void 0||i.valueAxis!==void 0))throw new TypeError("Pie charts have no axes.");let U,J;if(i.categoryAxis!==void 0){const F=E(w(i.categoryAxis,["title"],"chart.categoryAxis").title,"Category axis title");U=Object.freeze(F===void 0?{}:{title:F})}if(i.valueAxis!==void 0){const F=w(i.valueAxis,["title","minimum","maximum","numberFormat"],"chart.valueAxis");for(const $ of[F.minimum,F.maximum])if($!==void 0&&!Number.isFinite($))throw new TypeError("Chart axis bounds must be finite numbers.");if(F.minimum!==void 0&&F.maximum!==void 0&&F.minimum>=F.maximum)throw new RangeError("Chart axis minimum must be below its maximum.");const V=E(F.title,"Value axis title"),q=E(F.numberFormat,"Value axis number format");if(q!==void 0&&!q.trim())throw new TypeError("Value axis number format cannot be blank.");J=Object.freeze({...F,...V===void 0?{}:{title:V},...q===void 0?{}:{numberFormat:q}})}const Z={...H,type:e,...L===void 0?{}:{language:L},...I===void 0?{}:{title:I},...P===void 0?{}:{description:P},...i.legend===void 0?{}:{legend:i.legend},...W===void 0?{}:{dataLabels:W},...U===void 0?{}:{categoryAxis:U},...J===void 0?{}:{valueAxis:J}};if(l){if(!n)throw new TypeError("A chart range must belong to the current workbook.");const{descriptor:F,retainText:V}=n(l),q=b(l,F,{availablePoints:o,availableText:s-T,retainText:V,policy:c},r,e);return Object.freeze({...Z,data:q.data,binding:q,points:p,textCharacters:T+q.textCharacters})}const j=d,_=[],A=[];for(let F=0;F<h;F++)(F&255)===0&&S(r),_.push(v(j[F],"Chart category"));for(let F=0;F<g;F++){const V=f[F],q=w(V,["name","values","color"],"chart.series"),$=v(q.name,"Chart series name"),Q=q.values,z=q.color;if(!Array.isArray(Q)||Q.length!==h)throw new TypeError("Chart series values must match the category count.");if(z!==void 0&&(typeof z!="string"||!/^#?[0-9a-fA-F]{6}$/.test(z)))throw new TypeError("Chart colors must be opaque six-digit RGB hex values.");let K=!1;const Y=[];for(let ie=0;ie<h;ie++){(ie&255)===0&&S(r);const ae=Q[ie];if(typeof ae!="number"||!Number.isFinite(ae))throw new TypeError("Chart values must be finite numbers.");if(e==="pie"&&ae<0)throw new RangeError("Pie charts require nonnegative values.");ae>0&&(K=!0),Y.push(ae)}if(e==="pie"&&!K)throw new RangeError("A pie chart needs at least one positive value.");A.push(Object.freeze({name:$,values:Object.freeze(Y),...z===void 0?{}:{color:z.replace(/^#/,"").toUpperCase()}}))}return Object.freeze({...Z,data:Object.freeze({categories:Object.freeze(_),series:Object.freeze(A)}),points:p,textCharacters:T})}const a=Object.freeze({prepareChart:u});return N.set("24f1417c3c320a8a41137c28f70b72091256c63010be0c88b684dce85f54950c",a),a})(),Tt=N.get("a34a46ed9564c388d5f3ca087c70819f8aa897e469ca50f8547233c264a8e8af")??(()=>{const{beginTask:S,checkAbort:R,pause:O,taskYieldDue:C}=be,{OfficeIMOError:k}=pe,{notifyProgress:y}=Ke,{ChunkedTextSink:m}=Oe,{ExportBudget:b}=ot,{OpcPackage:x,officeRelationshipsNamespace:w,relationshipTypes:u,corePropertiesXml:a}=$e,{escapeOoxmlAttribute:i,cleanXml:c,xmlDeclaration:o}=Se,{StyleRegistry:s,spreadsheetNamespace:r,normalizeBorder:n}=Ve,{sheetName:e,assertXlsxValue:t,copyValue:l}=ze,{copyColumns:d}=Ge,{captureFields:f}=Te,{captureColumnOutlines:h}=jt,{captureTableSpans:g}=Ye,{assertExportValue:p}=Ce,{Worksheet:T}=Dt,{defineTable:v,tableXml:E}=Zt,{copyHyperlink:I,drawingXml:P,drawingContentType:B}=Qe,{TextOverflow:L}=$t,{captureWorkbookOptions:H,sheetOptionFields:W}=tt,{prepareChart:U}=Jt,{qualifiedColumnRange:J,resolveDataColumn:Z}=et,{chartContentType:j,writeChartXml:_}=Ft,A="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",F=Q=>"application/vnd.openxmlformats-officedocument.spreadsheetml."+Q+"+xml";function V(Q,z){const K=f(Q,W),Y=d(K.columns??[],!0),ie=K.footer&&f(K.footer,["rows","values","totals","style"]),ae=K.print&&f(K.print,["paper","orientation","fitToWidth","fitToHeight","repeatHeaders","margins","header","footer"]);return{...K,columns:Y,...K.columnOutlines===void 0?{}:{columnOutlines:h(K.columnOutlines,Y.length)},...K.headerRows===void 0?{}:{headerRows:g(K.headerRows,Y.length)},...K.headerBorder===void 0?{}:{headerBorder:n(K.headerBorder)},...ie?{footer:{...ie,...ie.rows===void 0?{}:{rows:g(ie.rows,Y.length)},...ie.values===void 0?{}:{values:ie.values.map(l)}}}:{},...K.table?{table:f(K.table,["name","style","bandedRows","bandedColumns","firstColumn","lastColumn"])}:{},...K.autoSize?{autoSize:f(K.autoSize,["sampleRows","minWidth","maxWidth"])}:{},...K.title?{title:f(K.title,["text","style","height"])}:{},...ae?{print:{...ae,...ae.margins===void 0?{}:{margins:f(ae.margins,["left","right","top","bottom","header","footer"])}}}:{},...K.hyperlinks?{hyperlinks:K.hyperlinks.map(ee=>I(ee,z))}:{}}}class q{portableValues=!1;static forTable(z){const K=new q(z);return K.portableValues=!0,K}get valueValidator(){return this.portableValues?p:t}styles;names=new Set;sheets=[];tableNames=new Set;tableCount=0;writers;package;state="open";result;completion;activeSheet;failure;overflow;links=0;imageBytes=0;bufferedBytes=0;mergedRanges=0;conditionalFormats=0;dataValidationCount=0;validationTextCharacters=0;formulaCharacters=0;hasAuthoredFormulas=!1;nativeCharts=[];chartSourceSheets=0;chartPoints=0;chartTextCharacters=0;registering=!1;registration(z){if(this.assertOpen(),this.registering)throw new k("INVALID_STATE","Workbook registrations cannot be reentered from input getters.");this.registering=!0;try{return z()}finally{this.registering=!1}}budget;settings;constructor(z={}){z=H(z);const K=z.dateMode??"local",Y=z.compression??"auto",ie=z.invalidCharacterPolicy??"strip";if(K!=="local"&&K!=="utc")throw new RangeError("dateMode must be local or utc.");if(Y!=="auto"&&Y!=="store")throw new RangeError("compression must be auto or store.");if(z.oversizedText!==void 0&&!["reject","preserve"].includes(z.oversizedText))throw new RangeError("oversizedText must be reject or preserve.");if(z.hyperlinkOverflow!==void 0&&!["reject","drop"].includes(z.hyperlinkOverflow))throw new RangeError("hyperlinkOverflow must be reject or drop.");if(z.onHyperlinkOverflow!==void 0&&typeof z.onHyperlinkOverflow!="function")throw new TypeError("onHyperlinkOverflow must be a function.");if(c("",ie),a(z,ie),this.budget=new b(z.limits),this.styles=new s(ie,z.limits?.maxStyles,z.limits?.maxDifferentialStyles),z.sink!==void 0&&typeof z.sink.write!="function")throw new TypeError("sink must be a ByteSink.");this.settings=Object.freeze({...z,...z.limits?{limits:Object.freeze({...z.limits})}:{},dateMode:K,compression:Y,invalidCharacterPolicy:ie}),this.writers=Object.freeze({...z.cellValueWriters});for(const ae of Object.values(this.writers))if(typeof ae!="function")throw new TypeError("Cell value writers must be functions.");S(),this.package=new x({compression:Y,invalidCharacterPolicy:ie,...z.signal?{signal:z.signal}:{},...z.sink?{sink:z.sink}:{},...z.limits?.maxOutputBytes===void 0?{}:{maxOutputBytes:z.limits.maxOutputBytes}}),this.package.setProperties(z,z.appProperties),this.addXmlPart("/xl/workbook.xml",F("sheet.main"),()=>this.workbookXml()),this.addXmlPart("/xl/styles.xml",F("styles"),()=>this.styles.toXml())}addXmlPart(z,K,Y){this.package.addPart({uri:z,contentType:K,data:async ie=>{const ae=new m(ie,this.settings.signal);await ae.write(Y()),await ae.close()}})}workbookXml(){return o+'<workbook xmlns="'+r+'" xmlns:r="'+w+'"><workbookPr date1904="0"/><bookViews><workbookView/></bookViews><sheets>'+this.sheets.map((z,K)=>'<sheet name="'+i(z.name,this.settings.invalidCharacterPolicy)+'" sheetId="'+(K+1)+'"'+(z.hidden?' state="hidden"':"")+' r:id="rId'+(K+1)+'"/>').join("")+"</sheets>"+(this.sheets.some(z=>z.printSettings)?"<definedNames>"+this.sheets.map((z,K)=>{const Y="'"+z.name.replace(/'/g,"''")+"'!";return z.printSettings?'<definedName name="_xlnm.Print_Area" localSheetId="'+K+'">'+i(Y+"$A$1:$"+z.lastColumn+"$"+z.totalRows,this.settings.invalidCharacterPolicy)+"</definedName>"+(z.printSettings.repeatHeaders&&z.firstHeaderRow?'<definedName name="_xlnm.Print_Titles" localSheetId="'+K+'">'+i(Y+"$"+z.firstHeaderRow+":$"+z.headerRowCount,this.settings.invalidCharacterPolicy)+"</definedName>":""):""}).join("")+"</definedNames>":"")+(this.hasAuthoredFormulas?'<calcPr calcMode="auto" fullCalcOnLoad="1" forceFullCalc="1"/>':"")+"</workbook>"}assertOpen(){try{R(this.settings.signal)}catch(z){throw this.discard(z).catch(()=>{}),z}if(this.state==="failed")throw this.failure;if(this.state!=="open")throw new k("INVALID_STATE","Workbook is already finalized.")}writerFor(z){return Object.prototype.hasOwnProperty.call(this.writers,z)?this.writers[z]:void 0}preserveText(z,K,Y){if(this.settings.oversizedText!=="preserve")throw new RangeError("Excel cell text exceeds 32,767 UTF-16 code units.");return this.overflow||(this.checkSheetLimit(this.sheets.length+this.chartSourceSheets+1),this.budget.reserve(5,22),this.overflow=new L(e("Text overflow",this.names,this.settings.invalidCharacterPolicy),this.settings.limits?.maxOverflowCharacters??4e6,this.settings.invalidCharacterPolicy,(ie,ae,ee)=>{this.budget.row(ee),this.budget.reserve(ie,ae)})),this.overflow.add(z,K,Y)}checkSheetLimit(z){if(z>65526)throw new RangeError("Workbook has too many sheets.");if(this.settings.limits?.maxSheets!==void 0&&z>this.settings.limits.maxSheets)throw new k("RESOURCE_LIMIT","maxSheets exceeded.")}checkLinks(z){if(this.settings.limits?.maxHyperlinks!==void 0&&this.links+z>this.settings.limits.maxHyperlinks)throw new k("RESOURCE_LIMIT","maxHyperlinks exceeded.")}retainLink(z=1){this.checkLinks(z),this.links+=z}releaseLink(){this.links--}checkImage(z){if(this.settings.limits?.maxImageBytes!==void 0&&this.imageBytes+z>this.settings.limits.maxImageBytes)throw new k("RESOURCE_LIMIT","maxImageBytes exceeded.")}retainImage(z){this.checkImage(z),this.imageBytes+=z}retainBufferedBytes(z){this.budget.check("maxOutputBytes",this.bufferedBytes+z),this.bufferedBytes+=z}checkMerges(z){if(this.mergedRanges+z>(this.settings.limits?.maxMergedRanges??1e4))throw new k("RESOURCE_LIMIT","maxMergedRanges exceeded.")}checkConditionalFormats(z){if(this.conditionalFormats+z>(this.settings.limits?.maxConditionalFormats??1e3))throw new k("RESOURCE_LIMIT","maxConditionalFormats exceeded.")}get availableDataValidations(){return(this.settings.limits?.maxDataValidations??1e3)-this.dataValidationCount}get availableValidationTextCharacters(){return(this.settings.limits?.maxValidationTextCharacters??1e6)-this.validationTextCharacters}retainFormula(z){if(this.formulaCharacters+z>(this.settings.limits?.maxFormulaCharacters??1e6))throw new k("RESOURCE_LIMIT","maxFormulaCharacters exceeded.");this.formulaCharacters+=z,this.hasAuthoredFormulas=!0}checkChartText(z){if(this.chartTextCharacters+z>(this.settings.limits?.maxChartTextCharacters??1e6))throw new k("RESOURCE_LIMIT","maxChartTextCharacters exceeded.")}retainChartText(z){this.checkChartText(z),this.chartTextCharacters+=z}resolveChartBinding(z){const K=z.sheet;if(!this.sheets.includes(K)||K.hidden)throw new TypeError("Bound charts require a visible worksheet in the same workbook.");const Y=K.chartBindingMetadata,ie=z.firstRow??0;if(K.isBusy||Y.closed||ie<Y.rows)throw new k("INVALID_STATE","Register a chart before its first selected data row is written, while the source worksheet is idle.");const ae=Z(Y.columns,z.categoryColumn,"Chart"),ee=z.series.map(ue=>Z(Y.columns,ue.column,"Chart")),re=Y.headerRows+ie+1;return{descriptor:{source:K,sheetName:Y.name,headerRows:Y.headerRows,categoryColumn:ae,seriesColumns:ee,seriesNames:ee.map(ue=>Y.columns[ue-1].header),categoryFormula:J(Y.name,ae,re,z.rowCount),valueFormulas:ee.map(ue=>J(Y.name,ue,re,z.rowCount)),nameFormulas:ee.map((ue,ye)=>z.series[ye].name===void 0?Y.headerReferences[ue-1]:void 0)},retainText:ue=>this.retainChartText(ue)}}registerChart(z){return this.registration(()=>{if(this.nativeCharts.length>=(this.settings.limits?.maxCharts??100))throw new k("RESOURCE_LIMIT","maxCharts exceeded.");const K=U(z,this.settings.invalidCharacterPolicy,(this.settings.limits?.maxChartPoints??1e5)-this.chartPoints,(this.settings.limits?.maxChartTextCharacters??1e6)-this.chartTextCharacters,this.settings.signal,ie=>this.resolveChartBinding(ie));this.assertOpen(),this.checkChartText(K.textCharacters),this.checkSheetLimit(this.sheets.length+this.chartSourceSheets+(K.binding?0:1)+(this.overflow?1:0));const Y=Object.freeze({...K,id:this.nativeCharts.length+1,dataSheetName:K.binding?K.binding.source.name:e("Chart data "+(this.nativeCharts.length+1),this.names,this.settings.invalidCharacterPolicy)});return this.nativeCharts.push(Y),this.chartPoints+=K.points,this.chartTextCharacters+=K.textCharacters,K.binding?K.binding.source.retainChartBinding(K.binding):this.chartSourceSheets++,Y})}async openSheet(z){if(this.activeSheet&&this.activeSheet!==z){if(this.activeSheet.isBusy)throw new k("INVALID_STATE","Await the active streamed worksheet before starting another.");await this.activeSheet.finish()}return this.activeSheet=z,this.package.openPart("/xl/worksheets/sheet"+(this.sheets.indexOf(z)+1)+".xml",F("worksheet"))}async discard(z){this.state="failed",this.failure=z,await Promise.allSettled(this.sheets.map(K=>K.discard(z))),await this.package.discard(z),this.overflow?.clear(),this.nativeCharts.length=0}get worksheets(){return Object.freeze([...this.sheets])}get rowCount(){return this.sheets.reduce((z,K)=>z+K.reportRowCount,0)}addWorksheet(z,K={}){return this.registration(()=>{this.checkSheetLimit(this.sheets.length+this.chartSourceSheets+1+(this.overflow?1:0));const Y=V(K,this.settings.invalidCharacterPolicy),ie=T.validate(this,Y);let ae=Y.table;if(ae&&ae.name===void 0){let ue=this.tableCount+1;for(;this.tableNames.has(("Table"+ue).toLowerCase());)ue++;ae={...ae,name:"Table"+ue}}const ee=ae?v(this.tableCount+1,ae,Y.columns??[],this.settings.invalidCharacterPolicy):void 0;if(ee&&this.tableNames.has(ee.name.toLowerCase()))throw new TypeError("Duplicate Excel table name: "+ee.name);e(z,this.names,this.settings.invalidCharacterPolicy,!1);const re=T.create(this,()=>e(z,this.names,this.settings.invalidCharacterPolicy,!1),Y,ee,!1,ie.conditional,ie.validations);return this.assertOpen(),this.checkSheetLimit(this.sheets.length+this.chartSourceSheets+1+(this.overflow?1:0)),this.names.add(re.name.toLowerCase()),this.mergedRanges+=re.mergeCount,this.conditionalFormats+=re.conditionalFormatCount,this.dataValidationCount+=re.dataValidations.count,this.validationTextCharacters+=re.dataValidations.textCharacters,ee&&(this.tableNames.add(ee.name.toLowerCase()),this.tableCount++),this.sheets.push(re),re})}addPart(z){this.assertOpen();const{uri:K,contentType:Y,data:ie,relationship:ae}=z,ee=ae&&{id:ae.id,type:ae.type,source:ae.source};if(this.assertOpen(),this.package.addPart({uri:K,contentType:Y,data:ie}),ee){const{source:re,id:ue,type:ye}=ee;this.package.addRelationship(re??"/xl/workbook.xml",{id:ue,type:ye,target:K})}}finish(){try{R(this.settings.signal)}catch(z){return this.discard(z).then(()=>{throw z})}if(this.completion)return this.completion;if(this.state==="failed")return Promise.reject(this.failure);if(this.assertOpen(),this.sheets.some(z=>z.isBusy))throw new k("INVALID_STATE","Await addRows before finalizing the workbook.");return this.sheets.length||this.addWorksheet("Sheet1"),this.state="finalizing",this.completion=(async()=>{try{const z=this.rowCount;for(let Y=0;Y<this.sheets.length;Y++){const ie=this.sheets[Y],ae="/xl/worksheets/sheet"+(Y+1)+".xml";await ie.finish();const ee=ie.takePrepared();ee&&this.package.addPrepared(ae,F("worksheet"),ee);const re=ie.tableDefinition;if(re){const ue="/xl/tables/table"+re.id+".xml";this.addXmlPart(ue,F("table"),()=>E(re,ie.rowCount,this.settings.invalidCharacterPolicy,ie.headerRowCount,ie.footerSettings)),this.package.addRelationship(ae,{id:"table",type:w+"/table",target:ue})}for(let ue=0;ue<ie.hyperlinks.length;ue++)R(this.settings.signal),this.package.addRelationship(ae,{id:"link"+(ue+1),type:w+"/hyperlink",target:ie.hyperlinks[ue].target,external:!0}),(ue&255)===255&&C()&&(await O(),R(this.settings.signal));if(ie.images.length||ie.charts.length){const ue="/xl/drawings/drawing"+(Y+1)+".xml";this.addXmlPart(ue,B,()=>P(ie.images,this.settings.invalidCharacterPolicy,ie.charts)),this.package.addRelationship(ae,{id:"drawing",type:w+"/drawing",target:ue});for(let ye=0;ye<ie.images.length;ye++){R(this.settings.signal);const he="/xl/media/sheet"+(Y+1)+"-image"+(ye+1)+".png";this.package.addPart({uri:he,contentType:"image/png",data:ie.images[ye].data}),this.package.addRelationship(ue,{id:"image"+(ye+1),type:w+"/image",target:he}),(ye&255)===255&&C()&&(await O(),R(this.settings.signal))}for(const ye of ie.charts){R(this.settings.signal);const he="/xl/charts/chart"+ye.id+".xml";this.package.addPart({uri:he,contentType:j,data:M=>_(ye,M,this.settings.invalidCharacterPolicy,this.settings.signal)}),this.package.addRelationship(ue,{id:"chart"+ye.id,type:w+"/chart",target:he})}}}if(this.overflow){const Y=T.create(this,this.overflow.sheetName,{columns:[{header:"Sheet"},{header:"Cell"},{header:"Part"},{header:"Text",width:80,wrapText:!0},{header:"Parts"}],freezeHeader:!0},void 0,!0);this.sheets.push(Y),await Y.finish(this.overflow.values());const ie=Y.takePrepared();ie&&this.package.addPrepared("/xl/worksheets/sheet"+this.sheets.length+".xml",F("worksheet"),ie),this.overflow.clear()}for(const Y of this.nativeCharts){if(R(this.settings.signal),Y.binding)continue;const ie=T.createChartData(this,Y);this.sheets.push(ie);function*ae(){for(let re=0;re<Y.data.categories.length;re++)yield[Y.data.categories[re],...Y.data.series.map(ue=>ue.values[re])]}await ie.finish(ae());const ee=ie.takePrepared();ee&&this.package.addPrepared("/xl/worksheets/sheet"+this.sheets.length+".xml",F("worksheet"),ee)}this.package.addRelationship("/",{id:"workbook",type:u.officeDocument,target:"/xl/workbook.xml"});for(let Y=0;Y<this.sheets.length;Y++)R(this.settings.signal),this.package.addRelationship("/xl/workbook.xml",{id:"rId"+(Y+1),type:u.worksheet,target:"/xl/worksheets/sheet"+(Y+1)+".xml"}),(Y&255)===255&&C()&&(await O(),R(this.settings.signal));this.package.addRelationship("/xl/workbook.xml",{id:"styles",type:u.styles,target:"/xl/styles.xml"});const K=await this.package.finish();for(const Y of this.sheets)Y.releaseCharts();return this.nativeCharts.length=0,y(this.settings.onProgress,{phase:"complete",rows:z,bytes:K}),R(this.settings.signal),this.state="complete",{rows:z,sheets:this.sheets.length,bytes:K}}catch(z){throw await this.discard(z),z}})(),this.completion}toBlob(){try{R(this.settings.signal)}catch(z){return this.discard(z).then(()=>{throw z})}if(this.settings.sink)throw new k("INVALID_STATE","This workbook uses a caller-owned sink; use finish().");if(!this.result){const z=this.finish();this.result=z.then(()=>this.package.toBlob(A))}return this.result}}const $=Object.freeze({Workbook:q});return N.set("a34a46ed9564c388d5f3ca087c70819f8aa897e469ca50f8547233c264a8e8af",$),$})(),Lt=N.get("d6884428c3e4d15a691ecf2523372a03b32de22a890edfbfc9961f2dc92711c2")??(()=>{const{ExportCell:S,assertScalar:R}=Ce,{captureWorkbookOptions:O,sheetOptionFields:C}=tt,{captureFields:k}=Te;function y(u){for(const a of["font","fill","border","numberFormat"])if(typeof u?.[a]=="number")throw new TypeError("Workbook-local style indexes require the advanced Workbook API; use style definitions.");return u}function m(u){return u instanceof S||R(u),u}function b(u={}){if(u=k(u,C),u.headerStyle!==void 0)throw new TypeError("Workbook-local header styles require the advanced Workbook API; use boldHeader, headerFill, headerBorder and headerWrap.");y(u.alternatingRowStyle),y(u.title?.style),y(u.footer?.style),u.footer?.values?.forEach(m);const a=u.rowStyle,i=u.cellStyle;for(const c of[a,i])if(c!==void 0&&typeof c!="function")throw new TypeError("Style callbacks must be functions.");return{...u,...a?{rowStyle:c=>y(a(c))}:{},...i?{cellStyle:c=>y(i(c))}:{}}}function x(u={}){u=O(u);const a=u.cellValueWriters;if(!a)return u;const i=Object.create(null);for(const[c,o]of Object.entries(a)){if(typeof o!="function")throw new TypeError("Cell value writers must be functions.");i[c]=(s,r)=>m(o(s,r))}return{...u,cellValueWriters:i}}const w=Object.freeze({portableSheet:b,portableWorkbook:x});return N.set("d6884428c3e4d15a691ecf2523372a03b32de22a890edfbfc9961f2dc92711c2",w),w})(),zt=N.get("b9b1793c41e466048fe823422088a6fcc1fd8393c67293df3f0cd83a5d5ec7e1")??(()=>{const{withDestination:S}=Oe,{copyColumns:R}=Ge,{Workbook:O}=Tt,{portableSheet:C,portableWorkbook:k}=Lt,{captureFields:y}=Te,{sheetOptionFields:m,workbookOptionFields:b}=tt;function x(c){c=y(c,[...b,"columns","sheet"]);const o=R(c.columns),s=c.sheet&&y(c.sheet,[...m,"name"]);return{...k(c),columns:o,sheet:{...C(s),...s?.name===void 0?{}:{name:s.name}}}}function w(c,o){const{name:s="Data",...r}=o.sheet??{};return c.addWorksheet(s,{boldHeader:!0,autoFilter:r.includeHeader!==!1,autoSize:{minWidth:6,maxWidth:54},...r,columns:o.columns})}async function u(c,o){const s=x(o),{columns:r,sheet:n,...e}=s,t=O.forTable(e);try{return await w(t,s).addRows(c),await t.toBlob()}catch(l){throw await t.discard(l),l}}async function a(c,o,s){const r=x(s);return S(o,async n=>{const{columns:e,sheet:t,...l}=r,d=O.forTable({...l,sink:n});try{const f=w(d,r),h=r.columns.length;await f.addRows(c);const g=await d.finish();return{rows:g.rows,columns:h,bytes:g.bytes}}catch(f){throw await d.discard(f),f}})}const i=Object.freeze({writeXlsx:u,writeXlsxTo:a});return N.set("b9b1793c41e466048fe823422088a6fcc1fd8393c67293df3f0cd83a5d5ec7e1",i),i})(),Yt=N.get("ba0e1f29c8de5d46b966b7b097260529e42b80f662e92a7f9e8add22df747a50")??(()=>{const{assertGroupedReportSource:S}=Ne,{captureFields:R}=Te,{OfficeIMOError:O}=pe,{fields:C}=dt,{sheetOptionFields:k}=tt,{portableSheet:y}=Lt,{resolveDataColumn:m}=et,{copyStylePatch:b}=Ve,x=["labelColumn","subtotalLabel","grandTotalLabel","includeGrandTotal","collapseGroups","sheet","groupStyle","subtotalStyle","grandTotalStyle","conditionalFormats","dataValidation"],w=["columns","headerRows","footer","table","mergedCells","hyperlinks","conditionalFormats","dataValidation","rowStyle","cellStyle","rowOutline","maxOutlineLevel"];function u(s,r){return m(s.columns,r,"Grouped detail")+1}function a(s,r,n){if(r!==void 0){if(!Array.isArray(r))throw new TypeError("conditionalFormats must be an array.");if(r.length>n)throw new O("RESOURCE_LIMIT","maxConditionalFormats exceeded.");return r.map(e=>{const t=R(e,["type","range","style","stopIfTrue","operator","value","values","formula","stops","color","minimum","maximum","showValue"]),l=t.range;if(typeof l=="string")throw new TypeError("Grouped conditional formats require detail-column selectors rather than A1 or generated-row ranges.");C(l,["column","through"],"grouped conditional range");const d=R(l,["column","through"]);return{...t,range:{column:u(s,d.column),...d.through===void 0?{}:{through:u(s,d.through)}}}})}}function i(s,r,n){if(r!==void 0){if(!Array.isArray(r))throw new TypeError("dataValidation must be an array.");if(r.length>n)throw new O("RESOURCE_LIMIT","maxDataValidations exceeded.");return r.map(e=>{const t=R(e,["type","column","items","allowBlank","showErrorMessage","errorStyle","errorTitle","errorMessage"]);return{...t,column:u(s,t.column)}})}}function c(s,r,n=1e3,e=1e3){if(S(s),!r||typeof r!="object")throw new TypeError("Grouped XLSX options require host-authored labels.");const t=R(r,x),l=R(t.sheet??{},[...k,"name"]);if(!t.labelColumn||typeof t.labelColumn!="object")throw new TypeError("Grouped XLSX needs a leading label column.");const d=R(t.labelColumn,["header","width","wrapText","alignment"]);if(typeof d.header!="string")throw new TypeError("The leading label column needs a string header.");for(const g of[t.subtotalLabel,t.grandTotalLabel])if(typeof g!="function")throw new TypeError("Grouped summary labels must be functions.");for(const g of[t.includeGrandTotal,t.collapseGroups])if(g!==void 0&&typeof g!="boolean")throw new TypeError("Grouped XLSX flags must be booleans.");for(const g of w)if(l[g]!==void 0)throw new TypeError("Grouped XLSX owns worksheet "+g+".");if(l.autoFilter!==void 0&&l.autoFilter!==!1)throw new TypeError("Grouped summary rows cannot use a native table or autofilter.");for(const g of[t.groupStyle,t.subtotalStyle,t.grandTotalStyle])g!==void 0&&y({alternatingRowStyle:g});for(const g of s.columns)if(Object.prototype.hasOwnProperty.call(s.totals,g.key)&&g.type!=="number")throw new TypeError("Editable grouped totals require explicitly numeric columns.");const f=a(s,t.conditionalFormats,n),h=i(s,t.dataValidation,e);return{...t,labelColumn:d,sheet:y(l),...f===void 0?{}:{conditionalFormats:f},...h===void 0?{}:{dataValidation:h},...t.groupStyle?{groupStyle:b(t.groupStyle)}:{},...t.subtotalStyle?{subtotalStyle:b(t.subtotalStyle)}:{},...t.grandTotalStyle?{grandTotalStyle:b(t.grandTotalStyle)}:{}}}const o=Object.freeze({groupedOptionFields:x,prepareGroupedSheet:c});return N.set("ba0e1f29c8de5d46b966b7b097260529e42b80f662e92a7f9e8add22df747a50",o),o})(),Xe=N.get("d7cfa6a7b1be9758925a4ccb860a80a33eb0de2c88c80cc55e438213595f2b71")??(()=>{const{groupedReportOperation:S}=Ne,{checkAbort:R,withAbort:O}=be,{withDestination:C}=Oe,{captureFields:k}=Te,{Workbook:y}=Tt,{FormulaCell:m}=Je,{columnName:b}=ze,{captureWorkbookLimits:x,workbookOptionFields:w}=tt,{retainDataRowRanges:u}=ht,{groupedOptionFields:a,prepareGroupedSheet:i}=Yt,c={average:1,count:2,max:4,min:5,sum:9};function o(h){if(typeof h?.then=="function"&&Promise.resolve(h).catch(()=>{}),typeof h!="string")throw new TypeError("Grouped summary labels must return strings.");return h}function s(h,g,p,T,v){const E=g+p+":"+g+T,I="SUBTOTAL("+c[h]+","+E+")";return new m(h==="average"||h==="min"||h==="max"?"IF(SUBTOTAL(2,"+E+')=0,"",'+I+")":I,v,h==="count"?0:void 0)}async function r(h,g,p,T,v){R(T.signal);const{labelColumn:E,subtotalLabel:I,grandTotalLabel:P,includeGrandTotal:B,collapseGroups:L,sheet:H,groupStyle:W,subtotalStyle:U,grandTotalStyle:J,conditionalFormats:Z,dataValidation:j}=p;let _=0,A;const F=[],V=[],q=[];let $=0,Q=0,z,K;const{name:Y="Data",...ie}=H??{},ae=[{...E,type:"string"},...g.columns],ee={groupStart:W??{font:{bold:!0}},groupEnd:U??{font:{bold:!0}},complete:J??{font:{bold:!0}}},re=h.addWorksheet(Y,{boldHeader:!0,autoSize:{minWidth:6,maxWidth:54},...ie,columns:ae,...Z===void 0?{}:{conditionalFormats:Z},...j===void 0?{}:{dataValidation:j},maxOutlineLevel:g.groupBy.length,rowStyle:()=>A&&A.kind!=="row"?ee[A.kind]:void 0,rowOutline:()=>{if(!A||A.kind==="complete")return;const he=A.kind==="row"?A.path.length:A.level;return{level:he,hidden:!!L&&he>0,collapsed:!!L&&A.kind==="groupEnd"}}});u(re,q);const ue=g.columns.map(he=>Object.prototype.hasOwnProperty.call(g.totals,he.key)?g.totals[he.key]:void 0);async function*ye(){for await(const he of T.events){A=he;const M=re.rowCount+re.headerRowCount+1;if(he.kind==="groupStart"){const D={groupIndex:he.groupIndex,level:he.level,key:he.key,label:he.label,path:he.path,rows:0,totals:Object.freeze([]),startRow:M,firstDetailRow:0,lastDetailRow:0,summaryRow:0};F.push(D),V.push(D),yield[he.label,...g.columns.map(()=>null)]}else if(he.kind==="row"){_++,v?.(_),$||=M,Q=M;const D=q.at(-1);D&&D.lastRow+1===M?D.lastRow=M:q.push({firstRow:M,lastRow:M});for(const G of V)G.firstDetailRow||=M,G.lastDetailRow=M;yield[null,...he.values]}else if(he.kind==="groupEnd"){const D=V.pop();D.summaryRow=M,D.rows=he.rows,D.totals=he.totals,yield[o(I(he)),...ue.map((G,te)=>G?s(G,b(te+2),D.firstDetailRow,D.lastDetailRow,he.totals[te]):null)]}else K=Object.freeze({rows:he.rows,groups:he.groups,totals:he.totals}),B!==!1&&(z=M,yield[o(P(he)),...ue.map((D,G)=>D?$?s(D,b(G+2),$,Q,he.totals[G]):he.totals[G]:null)])}}try{return R(T.signal),await O(re.addRows(ye()),T.signal),await O(re.close(),T.signal),Object.freeze({worksheet:re,rows:_,columns:ae.length,detailRanges:Object.freeze(q.map(he=>Object.freeze({...he}))),groups:Object.freeze(F.map(he=>Object.freeze({...he}))),grandSummary:K,...z===void 0?{}:{grandTotalRow:z}})}catch(he){throw await h.discard(he),he}}async function n(h,g,p){const T=i(g,p,h.settings.limits?.maxConditionalFormats??1e3,h.availableDataValidations),v=S(g,h.settings.signal);try{return await r(h,g,T,v)}finally{v.dispose()}}function e(h,g){if(!g||typeof g!="object")throw new TypeError("Grouped XLSX options require host-authored labels.");const p=k(g,[...w,...a]);if(p.sink!==void 0||p.cellValueWriters!==void 0)throw new TypeError("Grouped XLSX owns its destination and uses already resolved source values.");const T=p.limits===void 0?void 0:x(p.limits);return{...p,...T===void 0?{}:{limits:T},...i(h,p,T?.maxConditionalFormats??1e3,T?.maxDataValidations??1e3)}}async function t(h,g,p){const{labelColumn:T,subtotalLabel:v,grandTotalLabel:E,includeGrandTotal:I,collapseGroups:P,sheet:B,groupStyle:L,subtotalStyle:H,grandTotalStyle:W,conditionalFormats:U,dataValidation:J,onProgress:Z,...j}=g,_=S(h,j.signal);let A=0,F;const V=Z?q=>Z({...q,rows:A,...q.sheetRows===void 0?{}:{sheetRows:A}}):void 0;try{F=new y({...j,..._.signal?{signal:_.signal}:{},...V?{onProgress:V}:{},...p?{sink:p}:{}});const q=await r(F,h,g,_,Q=>{A=Q});if(p){const Q=await F.finish();return{result:{rows:A,columns:q.columns,bytes:Q.bytes}}}const $=await F.toBlob();return{blob:$,result:{rows:A,columns:q.columns,bytes:$.size}}}catch(q){throw await F?.discard(q),q}finally{_.dispose()}}async function l(h,g){return(await t(h,e(h,g))).blob}async function d(h,g,p){const T=e(h,p);return C(g,async v=>(await t(h,T,v)).result)}const f=Object.freeze({addGroupedXlsx:n,writeGroupedXlsx:l,writeGroupedXlsxTo:d});return N.set("d7cfa6a7b1be9758925a4ccb860a80a33eb0de2c88c80cc55e438213595f2b71",f),f})(),Ue=N.get("edf1bf5cb6d749de0e6823397df6610a6c1cc88768898c1b4d7083ee96ef6759")??(()=>{const S=Object.freeze({Workbook:Tt.Workbook,writeXlsx:zt.writeXlsx,writeXlsxTo:zt.writeXlsxTo,writeGroupedXlsx:Xe.writeGroupedXlsx,writeGroupedXlsxTo:Xe.writeGroupedXlsxTo,addGroupedXlsx:Xe.addGroupedXlsx,createGroupedReport:Ne.createGroupedReport,Worksheet:Dt.Worksheet,Cell:ze.Cell,FormulaCell:Je.FormulaCell,StyleRegistry:Ve.StyleRegistry,NumberFormats:Ve.NumberFormats,saveBlob:_e.saveBlob,ExportCell:Ce.ExportCell});return N.set("edf1bf5cb6d749de0e6823397df6610a6c1cc88768898c1b4d7083ee96ef6759",S),S})(),Qt=N.get("2f5c0823847e9209017d01b2a753f36056df2a9988fae1f3a1bd5fd186545220")??(()=>{const{captureTableSpans:S,tableSpans:R}=Ye;function O(k,y,m){const b=R(S(k,y),y),x=b.map(()=>Array(y).fill(""));for(let w=0;w<b.length;w++)for(const u of b[w]){if((u.span>1||u.rowSpan>1)&&m===void 0)throw new TypeError("CSV spanned headings/footers require an explicit spanMode: repeat or anchors.");const a=u.value;for(let i=w;i<w+(m==="repeat"?u.rowSpan:1);i++)for(let c=u.first;c<u.first+(m==="repeat"?u.span:1);c++)x[i][c]=a}return x}const C=Object.freeze({csvStructuredRows:O});return N.set("2f5c0823847e9209017d01b2a753f36056df2a9988fae1f3a1bd5fd186545220",C),C})(),kt=N.get("9b33d9107e62ba8299c576072de40d24a261464f118de4ace64f23154fc78307")??(()=>{const S=Object.freeze({true:"True",false:"False"});function R(C){if(C===void 0)return S;if(!C||typeof C!="object")throw new TypeError("booleanText must contain true and false strings.");const k=C.true,y=C.false;if(typeof k!="string"||typeof y!="string")throw new TypeError("booleanText must contain true and false strings.");return Object.freeze({true:k,false:y})}const O=Object.freeze({defaultBooleanText:S,captureBooleanText:R});return N.set("9b33d9107e62ba8299c576072de40d24a261464f118de4ace64f23154fc78307",O),O})(),er=N.get("f0627ba89e5c8fcb376ebe3ce72dcc8d68c34952981f8703e36b8bb1a9894208")??(()=>{const{captureFields:S}=Te;function R(C){if(!C||typeof C!="object")throw new TypeError("CSV options are required.");return S(C,["columns","signal","limits","onProgress","valueMode","delimiter","lineEnding","bom","includeHeader","headerRows","footer","spanMode","formulaInjectionProtection","quote","nullValue","booleanText"])}const O=Object.freeze({captureCsvOptions:R});return N.set("f0627ba89e5c8fcb376ebe3ce72dcc8d68c34952981f8703e36b8bb1a9894208",O),O})(),Et=N.get("406ac6c93ee68eae70c6f52a1e6f4c56b84f43cae12576040c766dcc5598a580")??(()=>{const{beginTask:S,checkAbort:R,consumeRows:O,taskYieldDue:C,withAbort:k}=be,{BlobByteSink:y,ChunkedTextSink:m,withDestination:b}=Oe,{ExportBudget:x,boundedSink:w}=ot,{ExportCell:u}=Ce,{isDate:a}=Me,{notifyProgress:i}=Ke,{copyColumns:c,createRowProjector:o}=Ge,{csvStructuredRows:s}=Qt,{captureBooleanText:r}=kt,{captureCsvOptions:n}=er;function e(h,g,p,T,v){const E=typeof h;let I;if(h==null)I="";else if(E==="string")I=h;else{if(E==="number")return I=Number.isFinite(h)?String(h):"",T==="all"?'"'+I+'"':I;if(E==="boolean")I=v[h?"true":"false"];else if(a(h))I=Number.isFinite(h.getTime())?h.toISOString():"";else throw typeof h.then=="function"&&Promise.resolve(h).catch(()=>{}),new TypeError("CSV cells and formatter results must be synchronous strings, numbers, booleans, Dates or null.")}return p&&(E==="string"||E==="boolean")&&I.charCodeAt(0)<=64&&/^ *[=+\-@\t\r\n]/.test(I)&&(I="'"+I),T==="all"||T==="strings"&&E==="string"||I.includes(g)||/["\r\n]/.test(I)?'"'+(I.includes('"')?I.replace(/"/g,'""'):I)+'"':I}async function t(h,g,p){const T=n(p);return b(g,v=>l(h,v,T))}async function l(h,g,p){S();const T=c(p.columns).map($=>Object.freeze($)),v=p.delimiter??",",E=p.lineEnding??"\r\n",I=p.quote??"minimal",P=r(p.booleanText);if(![",",";"," "].includes(v))throw new RangeError("Delimiter must be comma, semicolon or tab.");if(!["\r\n","\n","\r"].includes(E))throw new RangeError("Invalid line ending.");if(!["minimal","all","strings"].includes(I))throw new RangeError("Quoting must be minimal, all or strings.");if(p.valueMode!==void 0&&!["raw","display"].includes(p.valueMode))throw new RangeError("valueMode must be raw or display.");if(p.nullValue!==void 0&&typeof p.nullValue!="string")throw new TypeError("nullValue must be a string.");if(p.spanMode!==void 0&&p.spanMode!=="repeat"&&p.spanMode!=="anchors")throw new TypeError("CSV spanMode must be repeat or anchors.");const B=p.includeHeader===!1?[]:p.headerRows===void 0?T.length?[T.map($=>$.header)]:[]:s(p.headerRows,T.length,p.spanMode),L=p.footer===void 0?[]:s(p.footer.rows,T.length,p.spanMode);for(const $ of T)if($.valueFormatter!==void 0&&typeof $.valueFormatter!="function")throw new TypeError("CSV value formatters must be functions.");const H=new x(p.limits);let W=0;const U=g;g=w({async write($){await U.write($),W+=$.byteLength}},H);const J=o(T,void 0,p.signal),Z=T.some($=>$.valueFormatter),j=p.signal,_=p.formulaInjectionProtection!==!1,A=new m(g,j);R(j),p.bom&&await k(Promise.resolve(g.write(new Uint8Array([239,187,191]))),j);let F=0;const V=$=>$!==null&&typeof $=="object"&&$ instanceof u?p.valueMode==="display"&&$.text!==void 0?$.text:$.value:$;function q($,Q=!1,z=0,K){!Q&&Z&&z===0&&(K=Object.freeze(T.map((ie,ae)=>V($[ae]))));let Y="";for(let ie=z;ie<T.length;ie++){R(j);const ae=T[ie],ee=V($[ie]);let re=!Q&&ae.valueFormatter?ae.valueFormatter(ee,{rowIndex:F,columnIndex:ie,column:ae,values:K}):ee;if(re==null&&p.nullValue!==void 0&&(re=p.nullValue),H.cell(typeof re=="boolean"?P[re?"true":"false"]:re),R(j),Y+=(ie?v:"")+e(re,v,_,I,P),Y.length>=A.chunkSize||(ie&127)===127&&C()){if(A.append(Y))return A.flush().then(()=>q($,Q,ie+1,K));Y=""}}if(A.append(Y+E))return A.flush().then(()=>{i(p.onProgress,{phase:"rows",rows:F+(Q?0:1)})})}for(const $ of B)await q($,!0);await O(h,j,$=>{H.row(F+1);const Q=q(J($,F));if(Q)return Q.then(()=>{F++});F++});for(const $ of L)await q($,!0);return await A.close(),i(p.onProgress,{phase:"complete",rows:F,bytes:W}),R(j),{rows:F,columns:T.length,bytes:W}}async function d(h,g){const p=n(g),T=new y;try{let v=0;await l(h,T,{...p,onProgress:I=>{I.phase==="complete"?v=I.rows:i(p.onProgress,I)}});const E=T.toBlob("text/csv;charset=utf-8");return i(p.onProgress,{phase:"complete",rows:v,bytes:E.size}),R(p.signal),E}catch(v){throw T.discard(),v}}const f=Object.freeze({saveBlob:_e.saveBlob,ExportCell:Ce.ExportCell,writeCsvTo:t,writeCsv:d});return N.set("406ac6c93ee68eae70c6f52a1e6f4c56b84f43cae12576040c766dcc5598a580",f),f})(),qe=N.get("49927994ccf68595c9211828bccb16a874fa149bda2ea904d369d9943e93bc58")??(()=>{const{captureFields:S}=Te;function R(y,m,b=14400){if(!Number.isFinite(y)||y<=0||y>b)throw new RangeError(m+" must be positive and at most "+b+".");return y}function O(y){if(typeof y!="string"||!/^#?[0-9a-f]{6}$/i.test(y))throw new TypeError("PDF colors must be six-digit RGB hex strings.");const m=y.replace(/^#/,"");return[0,2,4].map(b=>String(Math.round(parseInt(m.slice(b,b+2),16)/255*1e4)/1e4)).join(" ")}function C(y={}){if(!y||typeof y!="object")throw new TypeError("PDF presentation must be an object.");const m=S(y,["background","color","numberFormat","bold","italic","wrapText","alignment"]);m.background!==void 0&&O(m.background),m.color!==void 0&&O(m.color);for(const b of["bold","italic","wrapText"])if(m[b]!==void 0&&typeof m[b]!="boolean")throw new TypeError("PDF presentation "+b+" must be boolean.");if(m.alignment!==void 0&&!["left","center","right"].includes(m.alignment))throw new TypeError("PDF table alignment supports left, center and right.");return Object.freeze(m)}const k=Object.freeze({positive:R,color:O,presentation:C});return N.set("49927994ccf68595c9211828bccb16a874fa149bda2ea904d369d9943e93bc58",k),k})(),Ct=N.get("278e6adc6a5d4491e688589ef165bd1aa9cc74f557da6f9d6bdf53ecc0c6df47")??(()=>{const{OfficeIMOError:S}=pe,{positive:R,presentation:O}=qe,C=["fontSize","presentation","keepTogether","keepWithNext","spaceBefore","spaceAfter"],k=["bold","italic","color","alignment"];function y(w){if(w&&typeof w.then=="function")throw Promise.resolve(w).catch(()=>{}),new TypeError("PDF paragraph styles must be synchronous objects.");if(!w||typeof w!="object"||Array.isArray(w)||Object.keys(w).some(r=>!C.includes(r)))throw new TypeError("PDF paragraph styles support fontSize, presentation, keepTogether, keepWithNext, spaceBefore and spaceAfter.");const{fontSize:u,presentation:a,keepTogether:i,keepWithNext:c,spaceBefore:o,spaceAfter:s}=w;u!==void 0&&R(u,"Paragraph font size",144);for(const[r,n]of[["keepTogether",i],["keepWithNext",c]])if(n!==void 0&&typeof n!="boolean")throw new TypeError("Paragraph "+r+" must be boolean.");for(const r of[o,s])if(r!==void 0&&(!Number.isFinite(r)||r<0||r>14400))throw new RangeError("Paragraph spacing must be from zero through 14,400 points.");if(a!==void 0&&(!a||typeof a!="object"||Array.isArray(a)||Object.keys(a).some(r=>!k.includes(r))))throw new TypeError("PDF paragraph presentation supports bold, italic, color and alignment.");return Object.freeze({...u===void 0?{}:{fontSize:u},...a===void 0?{}:{presentation:O(a)},...i===void 0?{}:{keepTogether:i},...c===void 0?{}:{keepWithNext:c},...o===void 0?{}:{spaceBefore:o},...s===void 0?{}:{spaceAfter:s}})}function m(w,u){if(!Number.isSafeInteger(u)||u<0)throw new RangeError("maxParagraphStyles must be a nonnegative safe integer.");const a=Object.create(null);if(w===void 0)return Object.freeze(a);if(w&&typeof w.then=="function")throw Promise.resolve(w).catch(()=>{}),new TypeError("paragraphStyles must be a synchronous record.");if(!w||typeof w!="object"||Array.isArray(w))throw new TypeError("paragraphStyles must be a record of named paragraph styles.");const i=Object.keys(w);if(i.length>u)throw new S("RESOURCE_LIMIT","maxParagraphStyles exceeded.");for(const c of i){if(!c.trim())throw new TypeError("Paragraph style names must be nonempty text.");a[c]=y(w[c])}return Object.freeze(a)}function b(w,u,a){let i={};if(w!==void 0){if(typeof w!="string"||!Object.prototype.hasOwnProperty.call(a,w))throw new TypeError("Unknown PDF paragraph style: "+String(w));i=a[w]}const c=y(u);return Object.freeze({...i,...c,...i.presentation||c.presentation?{presentation:Object.freeze({...i.presentation,...c.presentation})}:{}})}const x=Object.freeze({captureParagraphStyle:y,captureParagraphStyles:m,resolveParagraphStyle:b});return N.set("278e6adc6a5d4491e688589ef165bd1aa9cc74f557da6f9d6bdf53ecc0c6df47",x),x})(),De=N.get("6c92204b587bb12cfa85c60eb1fd921804dfa51304538c7be3353e2927551b02")??(()=>{const{OfficeIMOError:S}=pe,{ExportBudget:R}=ot,{copyColumns:O}=Ge,{captureTableSpans:C}=Ye,{copyExportValue:k}=at,{captureFields:y}=Te,{captureParagraphStyles:m}=Ct,{captureBooleanText:b}=kt,{positive:x,color:w,presentation:u}=qe,a={A3:{width:841.89,height:1190.551},A4:{width:595.276,height:841.89},A5:{width:419.528,height:595.276},LETTER:{width:612,height:792},LEGAL:{width:612,height:1008},TABLOID:{width:792,height:1224}},i=["columns","signal","onProgress","limits","textShaper","textDirection","pageSize","orientation","margins","fonts","tagged","fontSize","title","metadataTitle","messageTop","messageBottom","includeHeader","headerRows","footer","headerPresentation","footerPresentation","alternateRowColor","padding","columnWidths","wideTable","pageHeader","pageFooter","pageNumbers","pageNumberLabels","booleanText","formatValue","formatRuns","compression","paragraphStyles"],c=["maxRows","maxCells","maxTextCharacters","maxOutputBytes","maxPages","maxColumns","maxTableBands","maxTableWindowRows","maxCellCharacters","maxTextRuns","maxGroupBlocks","maxRowLines","maxFontBytes","maxPageBytes","maxHyperlinks","maxImageBytes","maxImagePixels","maxImageWorkingBytes","maxVectorCommands","maxDrawingElements","maxStructureElements","maxMarkedContentReferences","maxSections","maxBookmarks","maxListItems","maxParagraphStyles"],o=Object.freeze({maxVectorCommands:1e5,maxDrawingElements:1e5}),s=32;function r(h){if(!h||typeof h!="object"||Array.isArray(h))throw new TypeError("PDF options must be an object.");const g=y(h,i),p=g.wideTable;return{...g,...p===void 0?{}:{wideTable:t(p)}}}function n(h){if(!h||typeof h!="object"||Array.isArray(h))throw new TypeError("PDF limits must be an object.");const g=y(h,c);for(const[p,T]of Object.entries(g))if(T!==void 0&&(!Number.isSafeInteger(T)||T<0))throw new RangeError(p+" must be a nonnegative safe integer.");return Object.freeze(g)}function e(h,g){if(!h||typeof h!="object"||Array.isArray(h))throw new TypeError("PDF footer must be an object.");const{values:p,totals:T,rows:v}=h;if(p!==void 0&&!Array.isArray(p))throw new TypeError("PDF footer values must be an array.");return Object.freeze({...p===void 0?{}:{values:Object.freeze(p.map(k))},...T===void 0?{}:{totals:Object.freeze({...T})},...v===void 0?{}:{rows:C(v,g)}})}function t(h){if(h===void 0||h==="fit"||h==="reject")return h;if(!h||typeof h!="object"||Array.isArray(h)||Object.keys(h).some(E=>!["mode","minimumColumnWidth","repeatColumns"].includes(E)))throw new TypeError("wideTable must be fit, reject or a bands policy.");const{mode:g,minimumColumnWidth:p,repeatColumns:T}=h;if(g!=="bands")throw new TypeError("wideTable.mode must be bands.");if(p!==void 0&&x(p,"Minimum PDF column width"),T!==void 0&&!Array.isArray(T))throw new TypeError("repeatColumns must be an array.");const v=T===void 0?[]:[...T];if(v.some(E=>typeof E=="number"?!Number.isSafeInteger(E)||E<0:typeof E!="string"||!E.length))throw new RangeError("repeatColumns must contain nonnegative indices or nonempty stable keys.");if(v.every(E=>typeof E=="number")&&v.some((E,I)=>I>0&&E<=v[I-1]))throw new RangeError("Numeric repeatColumns must contain sorted unique nonnegative indices.");return Object.freeze({mode:g,...p===void 0?{}:{minimumColumnWidth:p},repeatColumns:Object.freeze(v)})}function l(h,g){if(typeof h!="object")return Object.freeze([]);const p=new Set;for(const T of h.repeatColumns??[]){let v;if(typeof T=="number")v=T;else if(v=g.findIndex(E=>E.key===T),v<0||g.some((E,I)=>I!==v&&E.key===T))throw new TypeError("repeatColumns requires an unambiguous selected column key: "+T);if(v>=g.length)throw new RangeError("repeatColumns index exceeds the declared columns.");if(p.has(v))throw new TypeError("repeatColumns selects the same column more than once.");p.add(v)}return Object.freeze([...p].sort((T,v)=>T-v))}function d(h,g=!1){const p={...r(h)};if(p.booleanText=b(p.booleanText),p.limits!==void 0&&(p.limits=n(p.limits)),p.pageSize&&typeof p.pageSize=="object"&&(p.pageSize=Object.freeze(y(p.pageSize,["width","height"]))),p.margins&&typeof p.margins=="object"&&(p.margins=Object.freeze(y(p.margins,["top","right","bottom","left"]))),p.pageNumberLabels!==void 0){const F=p.pageNumberLabels;if(!F||typeof F!="object"||Array.isArray(F))throw new TypeError("pageNumberLabels must provide literal text.");const{prefix:V="Page ",separator:q=" of ",suffix:$=""}=F;if([V,q,$].some(Q=>typeof Q!="string"))throw new TypeError("Page-number labels must be text.");p.pageNumberLabels=Object.freeze({prefix:V,separator:q,suffix:$})}const T=p.textShaper,v=T?.shapeLine;if(T!==void 0&&(!T||typeof v!="function"))throw new TypeError("textShaper must provide shapeLine.");if(p.textDirection!==void 0&&!["auto","ltr","rtl"].includes(p.textDirection))throw new TypeError("textDirection must be auto, ltr or rtl.");const E=g?[]:O(p.columns).map(F=>Object.freeze(F));if(g&&(p.includeHeader=!1),!E.length&&!g)throw new TypeError("PDF tables need at least one declared column.");const I=p.fonts===void 0?void 0:y(p.fonts,["regular","bold","italic","boldItalic"]),P={...p,columns:E,...T?{textShaper:Object.freeze({shapeLine:v.bind(T)})}:{},...p.tagged?{tagged:Object.freeze(y(p.tagged,["language"]))}:{},...p.headerRows?{headerRows:C(p.headerRows,E.length)}:{},...I?{fonts:Object.freeze(I)}:{},...p.columnWidths?{columnWidths:Object.freeze([...p.columnWidths])}:{},...p.footer===void 0?{}:{footer:e(p.footer,E.length)},headerPresentation:Object.freeze({background:"e7edf5",bold:!0,...u(p.headerPresentation)}),footerPresentation:Object.freeze({background:"eef2f6",bold:!0,...u(p.footerPresentation)})},B=new R(P.limits),L={maxPages:1e4,maxColumns:1024,maxTableBands:64,maxTableWindowRows:256,maxCellCharacters:1e6,maxTextRuns:1e4,maxGroupBlocks:256,maxRowLines:1e5,maxFontBytes:16*1024*1024,maxPageBytes:8*1024*1024,maxHyperlinks:1e5,maxImageBytes:32*1024*1024,maxImagePixels:16*1024*1024,...o,maxStructureElements:1e6,maxMarkedContentReferences:2e6,maxListItems:1e5,maxParagraphStyles:256,maxSections:1e3,maxBookmarks:1e4};for(const F of Object.keys(L)){const V=P.limits?.[F];V!==void 0&&(L[F]=V)}const H=m(P.paragraphStyles,L.maxParagraphStyles);if(E.length>L.maxColumns)throw new S("RESOURCE_LIMIT","maxColumns exceeded.");const W=typeof P.pageSize=="string"||P.pageSize===void 0?a[P.pageSize??"A4"]:P.pageSize;if(!W)throw new TypeError("Unsupported PDF page size.");if(x(W.width,"Page width"),x(W.height,"Page height"),P.orientation!==void 0&&!["portrait","landscape"].includes(P.orientation))throw new TypeError("Invalid PDF orientation.");const U=P.orientation==="landscape",J={width:U?Math.max(W.width,W.height):Math.min(W.width,W.height),height:U?Math.min(W.width,W.height):Math.max(W.width,W.height)},Z={top:36,right:36,bottom:36,left:36,...typeof P.margins=="number"?{top:P.margins,right:P.margins,bottom:P.margins,left:P.margins}:P.margins};for(const F of Object.values(Z))if(!Number.isFinite(F)||F<0)throw new RangeError("PDF margins must be finite and nonnegative.");if(Z.left+Z.right>=J.width||Z.top+Z.bottom>=J.height)throw new RangeError("PDF margins leave no content area.");const j=x(P.fontSize??9,"Font size",144),_=P.padding??4;if(!Number.isFinite(_)||_<0||_>72)throw new RangeError("PDF padding must be from 0 through 72 points.");for(const F of["title","metadataTitle","messageTop","messageBottom"])if(P[F]!==void 0&&typeof P[F]!="string")throw new TypeError(F+" must be text.");for(const F of["pageHeader","pageFooter"])if(P[F]!==void 0&&typeof P[F]!="string"&&typeof P[F]!="function")throw new TypeError(F+" must be text or a synchronous callback.");for(const F of["formatValue","formatRuns"])if(P[F]!==void 0&&typeof P[F]!="function")throw new TypeError(F+" must be a synchronous function.");for(const F of["compression","includeHeader","pageNumbers"])if(P[F]!==void 0&&typeof P[F]!="boolean")throw new TypeError(F+" must be boolean.");if(P.alternateRowColor!==void 0&&w(P.alternateRowColor),P.footer?.values&&P.footer.values.length>E.length)throw new RangeError("Footer has more values than declared columns.");if(P.footer?.rows&&(P.footer.values!==void 0||P.footer.totals!==void 0))throw new TypeError("Structured footer rows cannot be combined with values/totals.");if(P.headerRows&&P.includeHeader===!1)throw new TypeError("headerRows requires includeHeader.");if(P.tagged!==void 0){if(!P.tagged||typeof P.tagged!="object"||typeof P.tagged.language!="string"||P.tagged.language.length>63)throw new TypeError("tagged.language must be a language tag such as en or en-US.");try{if(Intl.getCanonicalLocales(P.tagged.language).length!==1)throw new RangeError}catch{throw new TypeError("tagged.language must be a language tag such as en or en-US.")}}const A=P.limits?.maxImageWorkingBytes;return{options:{...P,paragraphStyles:H},paragraphStyles:H,page:J,margins:Z,fontSize:j,padding:_,repeatedColumns:g?Object.freeze([]):l(P.wideTable,E),limits:{...L,...A===void 0?{}:{maxImageWorkingBytes:A}},budget:B}}const f=Object.freeze({positive:qe.positive,color:qe.color,presentation:qe.presentation,pdfOptionFields:i,pdfLimitFields:c,pdfDrawingLimits:o,pdfDrawingMaxDepth:s,capturePdfOptions:r,capturePdfLimits:n,captureWideTable:t,settings:d});return N.set("6c92204b587bb12cfa85c60eb1fd921804dfa51304538c7be3353e2927551b02",f),f})(),tr=N.get("e3d39f39aebcbaf063fd8221df0d9cb5902ad2545a9d9e474bb59d47f15e2c01")??(()=>{function R(k,y,m,b){if(!Number.isSafeInteger(m)||m<0||m>=2**(b*8))throw new RangeError("Invalid PDF cross-reference field.");for(let x=b-1;x>=0;x--)k[y+x]=m%256,m=Math.floor(m/256)}function*O(k,y){if(k.length!==y.length)throw new Error("PDF cross-reference locations must align.");const m=Math.floor(32768/11);for(let b=0;b<k.length;b+=m){const x=Math.min(m,k.length-b),w=new Uint8Array(x*11);for(let u=0;u<x;u++){const a=b+u,i=u*11,c=k[a],o=y.at(a);if(c===void 0)throw new Error("PDF contains unwritten objects.");w[i]=a===0?0:o===void 0?1:2,R(w,i+1,c,8),R(w,i+9,a===0?65535:o??0,2)}yield w}}const C=Object.freeze({pdfXrefEntryBytes:11,pdfXrefChunks:O});return N.set("e3d39f39aebcbaf063fd8221df0d9cb5902ad2545a9d9e474bb59d47f15e2c01",C),C})(),Be=N.get("e716b8b1da464094622f5f671518493c78e63ff22a029d61544d2d193b63ce8f")??(()=>{const{checkAbort:S,withAbort:R,pause:O,taskYieldDue:C}=be,{OfficeIMOError:k}=pe,{pdfXrefChunks:y,pdfXrefEntryBytes:m}=tr,b=256,x=32768,w=4096;class u{count;chunks=[];constructor(r){this.count=r}get length(){return this.count}reserve(){this.count++}set(r,n){const e=this.chunks[Math.floor(r/w)]??=new Uint16Array(w);e[r%w]=n+1}at(r){const n=this.chunks[Math.floor(r/w)]?.[r%w]??0;return n?n-1:void 0}}function a(s){if(!Number.isFinite(s)||Math.abs(s)>1e9)throw new RangeError("PDF coordinates and metrics must be finite and bounded.");return String(Math.round(s*1e3)/1e3)}function i(s){let r="";for(let n=0;n<s.length;n++){const e=s.charCodeAt(n);if(e>=55296&&e<=56319&&!(s.charCodeAt(n+1)>=56320&&s.charCodeAt(n+1)<=57343)||e>=56320&&e<=57343&&!(s.charCodeAt(n-1)>=55296&&s.charCodeAt(n-1)<=56319))throw new TypeError("PDF text contains an unpaired UTF-16 surrogate.");r+=e.toString(16).padStart(4,"0")}return r}class c{sink;signal;maxBytes;compressObjects;offsets=[0];compactIndices;compactBatch;compactArena;compactUnavailable=!1;encoder=new TextEncoder;buffer=new Uint8Array(32768);buffered=0;bytes=0;constructor(r,n,e=Number.MAX_SAFE_INTEGER,t=!1){this.sink=r,this.signal=n,this.maxBytes=e,this.compressObjects=t}reserve(){return this.offsets.push(void 0),this.compactIndices?.reserve(),this.offsets.length-1}async raw(r){if(S(this.signal),!Number.isSafeInteger(this.bytes+r.length)||this.bytes+r.length>this.maxBytes)throw new k("RESOURCE_LIMIT","maxOutputBytes exceeded.");this.bytes+=r.length;for(let n=0;n<r.length;){const e=Math.min(this.buffer.length-this.buffered,r.length-n);this.buffer.set(r.subarray(n,n+e),this.buffered),n+=e,this.buffered+=e,this.buffered===this.buffer.length&&await this.flushBytes()}}async text(r){await this.raw(this.encoder.encode(r))}async flush(){await this.flushCompact(),await this.flushBytes()}async flushBytes(){if(this.buffered){const r=this.buffer.subarray(0,this.buffered);await R(Promise.resolve(this.sink.write(r)),this.signal),this.buffered=0}C()&&await O(),S(this.signal)}tryCompactObject(r,n){S(this.signal),this.validateObject(r);const e=this.compactBatch;if(!e||!this.compressObjects||this.compactUnavailable||typeof CompressionStream!="function"||n.length>x||e.ids.length+1>=b)return!1;const t=String(r).length+String(e.bodyBytes).length+2,l=this.encodeCompactBody(n,e.bodyBytes,x-e.indexBytes-t-e.bodyBytes-2);return l===void 0?!1:(this.storeCompactBody(e,r,l),!0)}async compactObject(r,n){if(S(this.signal),this.validateObject(r),!this.compressObjects||this.compactUnavailable||n.length>x)return this.object(r,n);if(typeof CompressionStream!="function"){if(this.compactIndices)throw new Error("PDF object compression became unavailable.");return this.compactUnavailable=!0,this.object(r,n)}const e=String(r).length+4;let t=this.compactBatch;const l=String(r).length+String(t?.bodyBytes??0).length+2;let d=t&&t.ids.length<b?this.encodeCompactBody(n,t.bodyBytes,x-t.indexBytes-l-t.bodyBytes-2):void 0;if(t&&d===void 0&&(await this.flushCompact(),t=void 0,S(this.signal)),!t){if(d=this.encodeCompactBody(n,0,x-e-1),d===void 0)return this.object(r,n);let f;if(!this.compactIndices)try{f=new CompressionStream("deflate")}catch{return this.compactUnavailable=!0,this.object(r,n)}t={id:this.reserve(),compressor:f,ids:[],bodyOffsets:[],bodyBytes:0,indexBytes:1},this.compactIndices??=new u(this.offsets.length),this.compactBatch=t}this.storeCompactBody(t,r,d),t.ids.length===b&&await this.flushCompact()}storeCompactBody(r,n,e){this.offsets[n]=r.id,this.compactIndices.set(n,r.ids.length),r.indexBytes+=String(n).length+String(r.bodyBytes).length+2,r.ids.push(n),r.bodyOffsets.push(r.bodyBytes),this.compactArena[r.bodyBytes+e]=10,r.bodyBytes+=e+1}encodeCompactBody(r,n,e){if(e<0)return;const t=(this.compactArena??=new Uint8Array(x)).subarray(n,n+e);if(typeof this.encoder.encodeInto=="function"){const d=this.encoder.encodeInto(r,t);return d.read===r.length?d.written:void 0}const l=this.encoder.encode(r);if(!(l.length>e))return t.set(l),l.length}async flushCompact(){const r=this.compactBatch;if(!r)return;this.compactBatch=void 0;let n="";for(let d=0;d<r.ids.length;d++)n+=r.ids[d]+" "+r.bodyOffsets[d]+" ";const e=this.encoder.encode(n+"\n"),t=r.ids.length,l=this.compactArena.subarray(0,r.bodyBytes);r.ids.length=0,r.bodyOffsets.length=0,r.compressor?await this.compressedStream(r.id,l,"/Type /ObjStm /N "+t+" /First "+e.length,r.compressor,e):(this.start(r.id),await this.text(r.id+" 0 obj\n<< /Length "+(e.length+l.length)+" /Type /ObjStm /N "+t+" /First "+e.length+" >>\nstream\n"),await this.raw(e),await this.raw(l),await this.text("\nendstream\nendobj\n"))}async object(r,n){if(this.start(r),typeof n=="string"){await this.text(r+" 0 obj\n"+n+"\nendobj\n");return}let e=r+" 0 obj\n";for(const t of n)for(let l=0;l<t.length;){const d=Math.min(t.length,l+32768-e.length);if(e+=t.slice(l,d),l=d,e.length===32768){const f=e.charCodeAt(e.length-1),h=f>=55296&&f<=56319?e.length-1:e.length;await this.text(e.slice(0,h)),e=e.slice(h)}}await this.text(e+"\nendobj\n")}validateObject(r){if(!Number.isSafeInteger(r)||r<=0||r>=this.offsets.length||this.offsets[r]!==void 0)throw new Error("Invalid PDF object state.")}start(r){this.validateObject(r),this.offsets[r]=this.bytes}async stream(r,n,e="",t=!0,l=!1){const d=typeof n=="string"?this.encoder.encode(n):n;let f;if(t&&typeof CompressionStream=="function"&&d.length)try{f=new CompressionStream("deflate")}catch{}if(!f){this.start(r),await this.text(r+" 0 obj\n<< /Length "+d.length+" "+e+" >>\nstream\n"),await this.raw(d),await this.text("\nendstream\nendobj\n");return}const h=typeof n=="string"||l?d:new Uint8Array(d);await this.compressedStream(r,h,e,f)}async compressedStream(r,n,e,t,l){const f=new ReadableStream({start(T){l&&T.enqueue(l),T.enqueue(n),T.close()}}).pipeThrough(t).getReader(),h=this.reserve();let g=0,p=!1;try{for(this.start(r),await this.text(r+" 0 obj\n<< /Length "+h+" 0 R /Filter /FlateDecode "+e+" >>\nstream\n");;){const T=await R(f.read(),this.signal);if(T.done){p=!0;break}g+=T.value.length,await this.raw(T.value)}await this.text("\nendstream\nendobj\n"),await this.object(h,String(g))}finally{p||f.cancel(this.signal?.reason).catch(()=>{}),f.releaseLock()}}async finish(r,n){await this.flushCompact();for(let t=1;t<this.offsets.length;t++)if(this.offsets[t]===void 0)throw new Error("PDF contains unwritten objects.");if(this.bytes>9999999999)throw new k("RESOURCE_LIMIT","PDF exceeds classic cross-reference offset capacity.");if(this.compactIndices)return this.finishCompact(r,n);const e=this.bytes;await this.text("xref\n0 "+this.offsets.length+"\n0000000000 65535 f \n");for(let t=1;t<this.offsets.length;t++)await this.text(String(this.offsets[t]).padStart(10,"0")+" 00000 n \n");await this.text("trailer\n<< /Size "+this.offsets.length+" /Root "+r+" 0 R /Info "+n+" 0 R >>\nstartxref\n"+e+"\n%%EOF\n"),await this.flush()}async finishCompact(r,n){const e=this.reserve(),t=this.bytes,l=this.offsets.length*m;if(!Number.isSafeInteger(l))throw new k("RESOURCE_LIMIT","PDF cross-reference stream is too large.");this.start(e),await this.text(e+" 0 obj\n<< /Type /XRef /Size "+this.offsets.length+" /W [1 8 2] /Root "+r+" 0 R /Info "+n+" 0 R /Length "+l+" >>\nstream\n");for(const d of y(this.offsets,this.compactIndices))await this.raw(d);await this.text("\nendstream\nendobj\nstartxref\n"+t+"\n%%EOF\n"),await this.flushBytes()}}const o=Object.freeze({pdfNumber:a,unicodeHex:i,PdfObjects:c});return N.set("e716b8b1da464094622f5f671518493c78e63ff22a029d61544d2d193b63ce8f",o),o})(),Bt=N.get("1e169e6ecdeceff319b5da4bf01f4c653c1a3d9e8ad696b141bf8ac52d9f446c")??(()=>{class S{bytes;view;constructor(y){this.bytes=y,this.view=new DataView(y.buffer,y.byteOffset,y.byteLength)}range(y,m){if(!Number.isSafeInteger(y)||!Number.isSafeInteger(m)||y<0||m<0||y+m>this.bytes.length)throw new TypeError("Truncated or invalid TrueType table.")}u16(y){return this.range(y,2),this.view.getUint16(y)}i16(y){return this.range(y,2),this.view.getInt16(y)}u32(y){return this.range(y,4),this.view.getUint32(y)}tag(y){return this.range(y,4),String.fromCharCode(...this.bytes.subarray(y,y+4))}}function R(k){let y=0;for(let m=0;m<k.length;m+=4)y=y+((k[m]??0)*16777216+((k[m+1]??0)<<16)+((k[m+2]??0)<<8)+(k[m+3]??0))>>>0;return y}const C=Object.freeze({FontReader:S,checksum:R,align4:k=>Math.ceil(k/4)*4});return N.set("1e169e6ecdeceff319b5da4bf01f4c653c1a3d9e8ad696b141bf8ac52d9f446c",C),C})(),rr=N.get("ecf6c6ab2f9c5f747338d0d59d9f2cae0b006d9d2a210bcb1545db1f046eb80c")??(()=>{const{align4:S}=Bt,{checkAbort:R,pause:O,taskYieldDue:C}=be;function k(i,c,o){const s=m(i,c,o);for(;;){const r=s.next();if(r.done)return r.value}}async function y(i,c,o,s){R(s);const r=m(i,c,o);for(;;){const n=r.next();if(n.done)return R(s),n.value;C()&&await O(),R(s)}}function*m(i,c,o){const s=new Set([0,...c]),r=i.table("glyf"),n=[...s],e=new Map;let t=0;for(let j=0;j<n.length;j++){(++t&1023)===0&&(yield);const _=n[j];if(!Number.isInteger(_)||_<0||_>=i.glyphCount)throw new TypeError("Invalid subset glyph.");const A=i.offsets[_],F=i.offsets[_+1];if(A===F)continue;if(F-A<10)throw new TypeError("Truncated TrueType glyph header.");if(i.i16(r.offset+A)>=0)continue;let V=r.offset+A+10,q;const $=[];e.set(_,$);const Q=r.offset+F;do{if(V+4>Q)throw new TypeError("Truncated TrueType composite.");q=i.u16(V);const z=i.u16(V+2);if(z>=i.glyphCount)throw new TypeError("Invalid TrueType composite dependency.");if($.push(z),(++t&1023)===0&&(yield),s.has(z)||(s.add(z),n.push(z)),V+=4+(q&1?4:2)+(q&8?2:q&64?4:q&128?8:0),V>Q)throw new TypeError("Truncated TrueType composite transform.")}while(q&32);if(q&256&&(V+2>Q||V+2+i.u16(V)>Q))throw new TypeError("Truncated composite instructions.")}const l=new Set,d=new Set;function*f(j,_){if((++t&1023)===0&&(yield),d.has(j))throw new TypeError("Cyclic TrueType composite dependency.");if(_>64)throw new TypeError("TrueType composite nesting exceeds 64 levels.");if(!l.has(j)){d.add(j);for(const A of e.get(j)??[])yield*f(A,_+1);d.delete(j),l.add(j)}}for(const j of s)yield*f(j,0);const h=new Uint32Array(i.glyphCount+1);let g=0;for(let j=0;j<i.glyphCount;j++)h[j]=g,s.has(j)&&(g+=S(i.offsets[j+1]-i.offsets[j])),(j&1023)===1023&&(yield);h[i.glyphCount]=g;const p=new Uint8Array(g);for(const j of s)yield*w(i.bytes.subarray(r.offset+i.offsets[j],r.offset+i.offsets[j+1]),p,h[j]),(++t&1023)===0&&(yield);const T=new Uint8Array(h.length*4),v=new DataView(T.buffer);for(let j=0;j<h.length;j++)v.setUint32(j*4,h[j]),(j&1023)===1023&&(yield);const E=new Set(["OS/2","cmap","cvt ","fpgm","gasp","glyf","head","hhea","hmtx","loca","maxp","name","post","prep"]),I=yield*x(o),P=yield*b(i,s),B=[];for(const[j,_]of[...i.tables].filter(([A])=>E.has(A)).sort(([A],[F])=>A<F?-1:1)){const A=j==="glyf"?p:j==="loca"?T:j==="cmap"?I:j==="hmtx"?P:void 0,F=A??new Uint8Array(_.length);if(A||(yield*w(i.bytes.subarray(_.offset,_.offset+_.length),F)),j==="head"){const V=new DataView(F.buffer);V.setUint32(8,0),V.setInt16(50,1)}B.push({tag:j,bytes:F})}const L=12+B.length*16+B.reduce((j,_)=>j+S(_.bytes.length),0),H=new Uint8Array(L),W=new DataView(H.buffer);W.setUint32(0,65536),W.setUint16(4,B.length);const U=2**Math.floor(Math.log2(B.length));W.setUint16(6,U*16),W.setUint16(8,Math.log2(U)),W.setUint16(10,B.length*16-U*16);let J=12+B.length*16,Z=0;for(let j=0;j<B.length;j++){const _=B[j],A=12+j*16;for(let F=0;F<4;F++)H[A+F]=_.tag.charCodeAt(F);W.setUint32(A+4,yield*u(_.bytes)),W.setUint32(A+8,J),W.setUint32(A+12,_.bytes.length),yield*w(_.bytes,H,J),_.tag==="head"&&(Z=J),J+=S(_.bytes.length)}return W.setUint32(Z+8,2981146554-(yield*u(H))>>>0),H}function*b(i,c){let o=0;const s=i.u16(i.table("hhea").offset+34),r=i.table("hmtx"),n=new Uint8Array(s*4+(i.glyphCount-s)*2);for(const e of c){(++o&1023)===0&&(yield);const t=e<s?e*4:s*4+(e-s)*2,l=e<s?4:2;if(n.set(i.bytes.subarray(r.offset+t,r.offset+t+l),t),e>=s){const d=(s-1)*4;n.set(i.bytes.subarray(r.offset+d,r.offset+d+2),d)}}return n}function*x(i){let c=0;const o=[...i].sort(([e],[t])=>e-t),s=[];for(const[e,t]of o){(++c&1023)===0&&(yield);const l=s.at(-1);l&&e===l.last+1&&t===l.glyph+e-l.first?l.last=e:s.push({first:e,last:e,glyph:t})}const r=new Uint8Array(28+s.length*12),n=new DataView(r.buffer);n.setUint16(2,1),n.setUint16(4,3),n.setUint16(6,10),n.setUint32(8,12),n.setUint16(12,12),n.setUint32(16,r.length-12),n.setUint32(24,s.length);for(let e=0;e<s.length;e++){const t=s[e],l=28+e*12;n.setUint32(l,t.first),n.setUint32(l+4,t.last),n.setUint32(l+8,t.glyph),(e&1023)===1023&&(yield)}return r}function*w(i,c,o=0){for(let s=0;s<i.length;s+=65536)c.set(i.subarray(s,Math.min(i.length,s+65536)),o+s),yield}function*u(i){let c=0;for(let o=0;o<i.length;o+=4)c=c+((i[o]??0)*16777216+((i[o+1]??0)<<16)+((i[o+2]??0)<<8)+(i[o+3]??0))>>>0,(o&65535)===65532&&(yield);return c}const a=Object.freeze({subsetTrueType:k,subsetTrueTypeCooperatively:y});return N.set("ecf6c6ab2f9c5f747338d0d59d9f2cae0b006d9d2a210bcb1545db1f046eb80c",a),a})(),nr=N.get("2e1fa1582af797386e2e2914c0a27237309b1692a3cc2be688f46590eb74480d")??(()=>{const{NotSupportedError:S}=pe,{FontReader:R}=Bt,{subsetTrueType:O,subsetTrueTypeCooperatively:C}=rr,{checkAbort:k,pause:y,taskYieldDue:m}=be;class b extends R{tables;glyphCount;units;ascent;descent;bbox;widths;offsets;canSubset;cmaps;constructor(a,i){super(a);const c=x(this);let o=i;if(!o)for(;;){const s=c.next();if(s.done){o=s.value;break}}this.tables=o.tables,this.glyphCount=o.glyphCount,this.units=o.units,this.ascent=o.ascent,this.descent=o.descent,this.bbox=o.bbox,this.widths=o.widths,this.offsets=o.offsets,this.canSubset=o.canSubset,this.cmaps=o.cmaps}static async create(a,i){k(i);const c=x(new R(a));for(;;){const o=c.next();if(o.done)return k(i),new b(a,o.value);m()&&await y(),k(i)}}table(a,i=0){const c=this.tables.get(a);if(!c||c.length<i)throw new TypeError("Missing or truncated TrueType table: "+a);return c}glyph(a){for(const i of this.cmaps){const c=i.offset,o=this.u16(c);let s=0;if(o===12){let r=0,n=this.u32(c+12)-1;for(;r<=n;){const e=r+n>>>1,t=c+16+e*12,l=this.u32(t),d=this.u32(t+4);if(a<l)n=e-1;else if(a>d)r=e+1;else{s=this.u32(t+8)+a-l;break}}}else if(a<=65535){const r=this.u16(c+6)/2;let n=0,e=r-1;for(;n<e;){const l=n+e>>>1;a>this.u16(c+14+l*2)?n=l+1:e=l}const t=this.u16(c+16+r*2+n*2);if(a>=t&&a<=this.u16(c+14+n*2)){const l=this.i16(c+16+r*4+n*2),d=c+16+r*6+n*2,f=this.u16(d);if(!f)s=a+l&65535;else{const h=d+f+(a-t)*2;if(h+2>c+i.length)throw new TypeError("cmap glyph array exceeds its table.");s=this.u16(h),s&&(s=s+l&65535)}}}if(s>=this.glyphCount)throw new TypeError("cmap references an invalid glyph.");if(s)return s}return 0}subset(a,i){return this.canSubset?O(this,a,i):this.bytes}async subsetCooperatively(a,i,c){return k(c),this.canSubset?C(this,a,i,c):this.bytes}}function*x(u){const a=new Map,i=(j,_=0)=>{const A=a.get(j);if(!A||A.length<_)throw new TypeError("Missing or truncated TrueType table: "+j);return A};if(u.u32(0)!==65536)throw new S("PDF fonts require a static TrueType .ttf with glyf outlines; collections, CFF and WOFF are unsupported.");const c=u.u16(4);if(!c||c>256)throw new TypeError("Invalid TrueType table count.");u.range(12,c*16);for(let j=0;j<c;j++){const _=12+j*16,A=u.tag(_),F=u.u32(_+8),V=u.u32(_+12);if(u.range(F,V),a.has(A))throw new TypeError("Duplicate TrueType table: "+A);a.set(A,{offset:F,length:V})}if(a.has("fvar"))throw new S("Instantiate a variable font as a static TrueType font before PDF export.");const o=i("head",54),s=i("maxp",6),r=i("hhea",36),n=i("OS/2",10);if(u.u32(o.offset+12)!==1594834165)throw new TypeError("Invalid TrueType head magic.");const e=u.u16(s.offset+4),t=u.u16(o.offset+18);if(!e||t<16||t>16384)throw new TypeError("Invalid TrueType metrics.");const l=u.u16(n.offset+8);if(l&514)throw new S("The font's embedding permissions prohibit outline embedding.");const d=!(l&256),f=1e3/t,h=u.i16(r.offset+4)*f,g=u.i16(r.offset+6)*f,p=[36,38,40,42].map(j=>u.i16(o.offset+j)*f),T=u.u16(r.offset+34);if(!T||T>e)throw new TypeError("Invalid TrueType horizontal metric count.");const v=i("hmtx",T*4+(e-T)*2),E=[];for(let j=0;j<e;j++)E.push(u.u16(v.offset+Math.min(j,T-1)*4)*f),(j&1023)===1023&&(yield);const I=u.i16(o.offset+50);if(I!==0&&I!==1)throw new TypeError("Unsupported TrueType loca index.");const P=i("loca",(e+1)*(I?4:2)),B=i("glyf"),L=[];for(let j=0;j<=e;j++)L.push(I?u.u32(P.offset+j*4):u.u16(P.offset+j*2)*2),(j&1023)===1023&&(yield);for(let j=0;j<=e;j++)if(L[j]>B.length||j&&L[j]<L[j-1])throw new TypeError("Invalid TrueType glyph offsets.");const H=i("cmap",4),W=[],U=new Set,J=u.u16(H.offset+2);if(4+J*8>H.length)throw new TypeError("Invalid TrueType cmap directory.");for(let j=0;j<J;j++){const _=H.offset+4+j*8,A=u.u16(_),F=u.u16(_+2),V=u.u32(_+4);if(A!==0&&!(A===3&&(F===1||F===10)))continue;if(V+4>H.length)throw new TypeError("Invalid cmap subtable offset.");const q=H.offset+V,$=u.u16(q);if($!==4&&$!==12||U.has(q))continue;if($===12&&V+16>H.length)throw new TypeError("Truncated cmap format 12.");const Q=$===12?u.u32(q+4):u.u16(q+2);if(Q<16||V+Q>H.length)throw new TypeError("Invalid cmap length.");if($===12){const z=u.u32(q+12);if(16+z*12>Q)throw new TypeError("Invalid cmap groups.");let K=-1;for(let Y=0;Y<z;Y++){const ie=q+16+Y*12,ae=u.u32(ie),ee=u.u32(ie+4),re=u.u32(ie+8);if(ae<=K||ae>ee||ee>1114111||re+ee-ae>=e)throw new TypeError("Invalid cmap scalar/glyph group.");K=ee,(Y&1023)===1023&&(yield)}}else{const z=u.u16(q+6)/2;if(!Number.isInteger(z)||!z||16+z*8>Q)throw new TypeError("Invalid cmap segments.");let K=-1;for(let Y=0;Y<z;Y++){const ie=u.u16(q+14+Y*2),ae=u.u16(q+16+z*2+Y*2);if(ie<=K||ae>ie)throw new TypeError("Invalid cmap segment ordering.");K=ie,(Y&1023)===1023&&(yield)}}U.add(q),W.push({offset:q,length:Q})}const Z=W.sort((j,_)=>u.u16(_.offset)-u.u16(j.offset));if(!W.length)throw new S("TrueType font needs a Unicode cmap format 4 or 12.");return{tables:a,glyphCount:e,units:t,ascent:h,descent:g,bbox:p,widths:E,offsets:L,canSubset:d,cmaps:Z}}const w=Object.freeze({TrueTypeFont:b});return N.set("2e1fa1582af797386e2e2914c0a27237309b1692a3cc2be688f46590eb74480d",w),w})(),rt=N.get("d9c1509dff0538488752433e47cd0927ece5f93c559ad0e32dc56602dfd44596")??(()=>{const{TrueTypeFont:S}=nr,{beginTask:R,checkAbort:O}=be,C=new WeakMap,k=Symbol.for("@evotecit/officeimo/PdfFont");function y(x){let w=C.get(x);if(!w){if(!(x instanceof m)||typeof x.toBytes!="function")throw new TypeError("Invalid PdfFont instance.");const u=new m(x.toBytes());w=C.get(u),C.set(x,w)}return w}class m{static[Symbol.hasInstance](w){return!!w&&typeof w=="object"&&w[k]===!0}brand=!0;constructor(w){if(!(w instanceof Uint8Array))throw new TypeError("PdfFont requires TrueType bytes as a Uint8Array.");if(w.length>64*1024*1024)throw new RangeError("A TrueType font must not exceed 64 MiB.");C.set(this,new S(w.slice())),this.brand,Object.defineProperty(this,k,{value:!0}),Object.freeze(this)}static async create(w,u={}){if(O(u.signal),!(w instanceof Uint8Array))throw new TypeError("PdfFont requires TrueType bytes as a Uint8Array.");const a=u.maxBytes??16*1024*1024;if(!Number.isSafeInteger(a)||a<0||a>64*1024*1024)throw new RangeError("Font preparation maxBytes must be a nonnegative safe integer at most 64 MiB.");if(w.length>a)throw new RangeError("TrueType font exceeds the preparation byte limit.");R();const i=await S.create(new Uint8Array(w),u.signal);O(u.signal);const c=Object.create(m.prototype);return C.set(c,i),Object.defineProperty(c,"brand",{value:!0}),Object.defineProperty(c,k,{value:!0}),Object.freeze(c),c}toBytes(){return y(this).bytes.slice()}}const b=Object.freeze({fontProgram:y,PdfFont:m});return N.set("d9c1509dff0538488752433e47cd0927ece5f93c559ad0e32dc56602dfd44596",b),b})(),ir=N.get("1ed4965a6e2963a91190baa8a58ada8ce0edde8fe653bcb6609002e872af0d61")??(()=>{const R=Object.freeze({helveticaWidths:new Map([[32,[278,278]],[33,[278,333]],[34,[355,474]],[35,[556,556]],[36,[556,556]],[37,[889,889]],[38,[667,722]],[39,[191,238]],[40,[333,333]],[41,[333,333]],[42,[389,389]],[43,[584,584]],[44,[278,278]],[45,[333,333]],[46,[278,278]],[47,[278,278]],[48,[556,556]],[49,[556,556]],[50,[556,556]],[51,[556,556]],[52,[556,556]],[53,[556,556]],[54,[556,556]],[55,[556,556]],[56,[556,556]],[57,[556,556]],[58,[278,333]],[59,[278,333]],[60,[584,584]],[61,[584,584]],[62,[584,584]],[63,[556,611]],[64,[1015,975]],[65,[667,722]],[66,[667,722]],[67,[722,722]],[68,[722,722]],[69,[667,667]],[70,[611,611]],[71,[778,778]],[72,[722,722]],[73,[278,278]],[74,[500,556]],[75,[667,722]],[76,[556,611]],[77,[833,833]],[78,[722,722]],[79,[778,778]],[80,[667,667]],[81,[778,778]],[82,[722,722]],[83,[667,667]],[84,[611,611]],[85,[722,722]],[86,[667,667]],[87,[944,944]],[88,[667,667]],[89,[667,667]],[90,[611,611]],[91,[278,333]],[92,[278,278]],[93,[278,333]],[94,[469,584]],[95,[556,556]],[96,[333,333]],[97,[556,556]],[98,[556,611]],[99,[500,556]],[100,[556,611]],[101,[556,556]],[102,[278,333]],[103,[556,611]],[104,[556,611]],[105,[222,278]],[106,[222,278]],[107,[500,556]],[108,[222,278]],[109,[833,889]],[110,[556,611]],[111,[556,611]],[112,[556,611]],[113,[556,611]],[114,[333,389]],[115,[500,556]],[116,[278,333]],[117,[556,611]],[118,[500,556]],[119,[722,778]],[120,[500,556]],[121,[500,556]],[122,[500,500]],[123,[334,389]],[124,[260,280]],[125,[334,389]],[126,[584,584]],[161,[333,333]],[162,[556,556]],[163,[556,556]],[164,[556,556]],[165,[556,556]],[166,[260,280]],[167,[556,556]],[168,[333,333]],[169,[737,737]],[170,[370,370]],[171,[556,556]],[172,[584,584]],[174,[737,737]],[175,[333,333]],[176,[400,400]],[177,[584,584]],[178,[333,333]],[179,[333,333]],[180,[333,333]],[181,[556,611]],[182,[537,556]],[183,[278,278]],[184,[333,333]],[185,[333,333]],[186,[365,365]],[187,[556,556]],[188,[834,834]],[189,[834,834]],[190,[834,834]],[191,[611,611]],[192,[667,722]],[193,[667,722]],[194,[667,722]],[195,[667,722]],[196,[667,722]],[197,[667,722]],[198,[1e3,1e3]],[199,[722,722]],[200,[667,667]],[201,[667,667]],[202,[667,667]],[203,[667,667]],[204,[278,278]],[205,[278,278]],[206,[278,278]],[207,[278,278]],[208,[722,722]],[209,[722,722]],[210,[778,778]],[211,[778,778]],[212,[778,778]],[213,[778,778]],[214,[778,778]],[215,[584,584]],[216,[778,778]],[217,[722,722]],[218,[722,722]],[219,[722,722]],[220,[722,722]],[221,[667,667]],[222,[667,667]],[223,[611,611]],[224,[556,556]],[225,[556,556]],[226,[556,556]],[227,[556,556]],[228,[556,556]],[229,[556,556]],[230,[889,889]],[231,[500,556]],[232,[556,556]],[233,[556,556]],[234,[556,556]],[235,[556,556]],[236,[278,278]],[237,[278,278]],[238,[278,278]],[239,[278,278]],[240,[556,611]],[241,[556,611]],[242,[556,611]],[243,[556,611]],[244,[556,611]],[245,[556,611]],[246,[556,611]],[247,[584,584]],[248,[611,611]],[249,[556,611]],[250,[556,611]],[251,[556,611]],[252,[556,611]],[253,[500,556]],[254,[556,611]],[255,[500,556]],[256,[667,722]],[257,[556,556]],[258,[667,722]],[259,[556,556]],[260,[667,722]],[261,[556,556]],[262,[722,722]],[263,[500,556]],[268,[722,722]],[269,[500,556]],[270,[722,722]],[271,[643,743]],[272,[722,722]],[273,[556,611]],[274,[667,667]],[275,[556,556]],[278,[667,667]],[279,[556,556]],[280,[667,667]],[281,[556,556]],[282,[667,667]],[283,[556,556]],[286,[778,778]],[287,[556,611]],[290,[778,778]],[291,[556,611]],[298,[278,278]],[299,[278,278]],[302,[278,278]],[303,[222,278]],[304,[278,278]],[305,[278,278]],[310,[667,722]],[311,[500,556]],[313,[556,611]],[314,[222,278]],[315,[556,611]],[316,[222,278]],[317,[556,611]],[318,[299,400]],[321,[556,611]],[322,[222,278]],[323,[722,722]],[324,[556,611]],[325,[722,722]],[326,[556,611]],[327,[722,722]],[328,[556,611]],[332,[778,778]],[333,[556,611]],[336,[778,778]],[337,[556,611]],[338,[1e3,1e3]],[339,[944,944]],[340,[722,722]],[341,[333,389]],[342,[722,722]],[343,[333,389]],[344,[722,722]],[345,[333,389]],[346,[667,667]],[347,[500,556]],[350,[667,667]],[351,[500,556]],[352,[667,667]],[353,[500,556]],[354,[611,611]],[355,[278,333]],[356,[611,611]],[357,[317,389]],[362,[722,722]],[363,[556,611]],[366,[722,722]],[367,[556,611]],[368,[722,722]],[369,[556,611]],[370,[722,722]],[371,[556,611]],[376,[667,667]],[377,[611,611]],[378,[500,500]],[379,[611,611]],[380,[500,500]],[381,[611,611]],[382,[500,500]],[402,[556,556]],[536,[667,667]],[537,[500,556]],[710,[333,333]],[711,[333,333]],[728,[333,333]],[729,[333,333]],[730,[333,333]],[731,[333,333]],[732,[333,333]],[733,[333,333]],[8211,[556,556]],[8212,[1e3,1e3]],[8216,[222,278]],[8217,[222,278]],[8218,[222,278]],[8220,[333,500]],[8221,[333,500]],[8222,[333,500]],[8224,[556,556]],[8225,[556,556]],[8226,[350,350]],[8230,[1e3,1e3]],[8240,[1e3,1e3]],[8249,[333,333]],[8250,[333,333]],[8260,[167,167]],[8364,[556,556]],[8482,[1e3,1e3]],[8706,[476,494]],[8710,[612,612]],[8721,[600,600]],[8722,[584,584]],[8730,[453,549]],[8800,[549,549]],[8804,[549,549]],[8805,[549,549]],[9674,[471,494]],[64257,[500,611]],[64258,[500,611]]])});return N.set("1ed4965a6e2963a91190baa8a58ada8ce0edde8fe653bcb6609002e872af0d61",R),R})(),Mt=N.get("59911f0fe023545e9e97521b268551078bdc4c5f303e446a13b7d52f905e8070")??(()=>{const{OfficeIMOError:S}=pe,{PdfFont:R,fontProgram:O}=rt,{helveticaWidths:C}=ir,k=new Map([8364,0,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,0,381,0,0,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,0,382,376].map((u,a)=>[u,a+128]));function y(u){return u>=32&&u<=126||u>=160&&u<=255?u:u?k.get(u):void 0}function m(u,a,i){if(u>=55296&&u<=57343)return{supported:!1,code:"unpaired-surrogate",message:"PDF text contains an unpaired UTF-16 surrogate."};if(u<32||u>=127&&u<160)return{supported:!1,code:"unsupported-control",message:"PDF text contains an unsupported control character."};const c=String.fromCodePoint(u);if(/[\p{Mark}\p{Format}]/u.test(c)||!/[\p{Script=Latin}\p{Script=Greek}\p{Script=Cyrillic}\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Common}]/u.test(c)||u>=4352&&u<=4607||u>=127995&&u<=127999)return{supported:!1,code:"unsupported-layout",message:"This PDF table writer supports Unicode scalar layout; complex shaping, combining sequences and bidirectional text require a shaping-capable writer."};if(!a){if(y(u)===void 0)return{supported:!1,code:"embedded-font-required",message:"Text U+"+u.toString(16).toUpperCase()+" needs an embedded Unicode TrueType font; supply fonts.regular."};const s=C.get(u===160?32:u===173?45:u);return s?{supported:!0,width:s[i?1:0]}:{supported:!1,code:"missing-glyph",message:"Standard font has no metric for this character."}}let o=a.glyph(u);if(!o&&u===8239){const s=a.glyph(8201);s&&a.offsets[s]===a.offsets[s+1]&&(o=s)}return o?{supported:!0,glyph:o,width:a.widths[o]}:{supported:!1,code:"missing-glyph",message:"The supplied font has no glyph for U+"+u.toString(16).toUpperCase()+"."}}function b(u,a){if(!u)return;if(!(u.regular instanceof R))throw new TypeError("fonts.regular must be a PdfFont.");const i=new Set;for(const[c,o]of Object.entries(u)){if(!["regular","bold","italic","boldItalic"].includes(c)||!(o instanceof R))throw new TypeError("Invalid PDF font family.");i.add(o)}if(a!==void 0&&[...i].reduce((c,o)=>c+O(o).bytes.length,0)>a)throw new S("RESOURCE_LIMIT","maxFontBytes exceeded.")}function x(u,a,i){const c=u&&(a&&i?u.boldItalic:a?u.bold:i?u.italic:u.regular),o=c??u?.regular;return{font:o,syntheticBold:!!o&&a&&!c,syntheticItalic:!!o&&i&&!c}}const w=Object.freeze({standardCode:y,resolveScalar:m,validateFonts:b,selectFont:x});return N.set("59911f0fe023545e9e97521b268551078bdc4c5f303e446a13b7d52f905e8070",w),w})(),sr=N.get("7825c87ba92a9992baf6b5c8a5e146948268985c31584ef9c8bf395359942e4f")??(()=>{const{NotSupportedError:S,OfficeIMOError:R}=pe,{fontProgram:O}=rt,{resolveScalar:C,selectFont:k,standardCode:y,validateFonts:m}=Mt,{pdfNumber:b,unicodeHex:x}=Be,{checkAbort:w,pause:u,taskYieldDue:a}=be,i=Object.freeze(Array.from({length:256},(n,e)=>e.toString(16).padStart(2,"0")));function c(n){return i[n>>>8]+i[n&255]}class o{index;bold;italic;font;shared;signal;name;object;program;syntheticBold;syntheticItalic;mappings=new Map;standardWidths=new Map;constructor(e,t,l,d,f,h,g,p,T){this.index=e,this.bold=t,this.italic=l,this.font=d,this.shared=p,this.signal=T,this.name=p?.name??"F"+e,this.object=p?.object??f.reserve(),this.program=d?O(d):void 0,this.syntheticBold=h,this.syntheticItalic=g}width(e){if(this.shared)return this.shared.width(e);if(this.program){const f=this.mappings.get(e);if(f)return f.width}else{const f=this.standardWidths.get(e);if(f!==void 0)return f}const t=C(e,this.program,this.bold);if(!t.supported)throw t.code==="unpaired-surrogate"?new TypeError(t.message):new S(t.message);if(!this.program)return this.standardWidths.set(e,t.width),t.width;if(this.mappings.size>=65535)throw new R("RESOURCE_LIMIT","A PDF font supports at most 65,535 distinct Unicode scalars.");const l=this.mappings.size+1,d={cid:l,hex:c(l),glyph:t.glyph,width:t.width,text:String.fromCodePoint(e)};return this.mappings.set(e,d),d.width}lineHeight(e){return Math.max(1.3,this.program?(this.program.ascent-this.program.descent)/1e3+.1:1.3)*e}encode(e){if(this.shared)return this.shared.encode(e);let t="";for(const l of e){const d=l.codePointAt(0);if(this.program){let f=this.mappings.get(d);f||(this.width(d),f=this.mappings.get(d)),t+=f.hex}else this.standardWidths.has(d)||this.width(d),t+=i[y(d)]}return"<"+t+">"}encodeGlyph(e,t){if(this.shared)return this.shared.encodeGlyph(e,t);if(!this.program||!Number.isSafeInteger(e)||e<=0||e>=this.program.glyphCount)throw new TypeError("Invalid shaped TrueType glyph.");const l=e+":"+t;let d=this.mappings.get(l);if(!d){if(this.mappings.size>=65535)throw new R("RESOURCE_LIMIT","A PDF font supports at most 65,535 distinct CID mappings.");const f=this.mappings.size+1;d={cid:f,hex:c(f),glyph:e,width:this.program.widths[e],text:t},this.mappings.set(l,d)}return"<"+d.hex+">"}async write(e,t){if(w(this.signal),!this.program){const U="Helvetica"+(this.bold&&this.italic?"-BoldOblique":this.bold?"-Bold":this.italic?"-Oblique":"");await e.object(this.object,"<< /Type /Font /Subtype /Type1 /BaseFont /"+U+" /Encoding /WinAnsiEncoding >>");return}const l=this.program,d=[...this.mappings],f=new Set(d.map(([,U])=>U.glyph)),h=(l.canSubset?"OIMOAA+":"")+"OfficeIMOFont"+this.index,g=e.reserve(),p=e.reserve(),T=e.reserve(),v=e.reserve(),E=e.reserve(),I=new Map;for(const[U,J]of d)if(typeof U=="number")I.set(U,J.glyph);else for(const Z of J.text){const j=Z.codePointAt(0),_=l.glyph(j);_&&(I.set(j,_),f.add(_))}const P=await l.subsetCooperatively(f,I,this.signal);await e.stream(g,P,"/Length1 "+P.length,t,!0),await e.object(p,"<< /Type /FontDescriptor /FontName /"+h+" /Flags 32 /FontBBox ["+l.bbox.map(b).join(" ")+"] /ItalicAngle 0 /Ascent "+b(l.ascent)+" /Descent "+b(l.descent)+" /CapHeight "+b(l.ascent)+" /StemV 80 /FontFile2 "+g+" 0 R >>");const B=new Uint8Array((d.length+1)*2),L=new DataView(B.buffer);for(let U=0;U<d.length;U++){const J=d[U][1];L.setUint16(J.cid*2,J.glyph),(U&1023)===1023&&(a()&&await u(),w(this.signal))}await e.stream(v,B,"",t,!0),await e.object(T,"<< /Type /Font /Subtype /CIDFontType2 /BaseFont /"+h+" /CIDSystemInfo << /Registry (Adobe) /Ordering (Identity) /Supplement 0 >> /FontDescriptor "+p+" 0 R /CIDToGIDMap "+v+" 0 R"+(d.length?" /W [1 ["+d.map(([,U])=>b(U.width)).join(" ")+"]]":"")+" >>");let H="/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo << /Registry (Adobe) /Ordering (UCS) /Supplement 0 >> def\n/CMapName /OfficeIMOUnicode def\n/CMapType 2 def\n1 begincodespacerange\n<0000> <FFFF>\nendcodespacerange\n";const W=d.filter(([,U])=>U.text.length);for(let U=0;U<W.length;U+=100){const J=W.slice(U,U+100);H+=J.length+" beginbfchar\n";for(const[,Z]of J)H+="<"+Z.hex+"> <"+x(Z.text)+">\n";H+="endbfchar\n",a()&&await u(),w(this.signal)}H+="endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n",await e.stream(E,H,"",t),await e.object(this.object,"<< /Type /Font /Subtype /Type0 /BaseFont /"+h+" /Encoding /Identity-H /DescendantFonts ["+T+" 0 R] /ToUnicode "+E+" 0 R >>")}}class s{objects;fonts;maxBytes;signal;resources=[];selections=new Map;programs=new Map;explicitSelections=new Map;registered=new Set;fontBytes=0;constructor(e,t,l=16*1024*1024,d){this.objects=e,this.fonts=t,this.maxBytes=l,this.signal=d,m(t,l);for(const f of Object.values(t??{}))this.registerFont(f)}registerFont(e){if(this.registered.has(e))return;const t=O(e).bytes.length;if(this.fontBytes+t>this.maxBytes)throw new R("RESOURCE_LIMIT","maxFontBytes exceeded.");this.fontBytes+=t,this.registered.add(e)}select(e=!1,t=!1,l,d=!1){l&&this.registerFont(l);let f=this.selections;if(l){const B=this.explicitSelections.get(l);f=B??new Map,B||this.explicitSelections.set(l,f)}const h=d&&!l&&this.fonts!==void 0&&this.fonts[e?t?"boldItalic":"bold":t?"italic":"regular"]===void 0,g=(e?2:0)|(t?1:0)|(h?4:0),p=f.get(g);if(p)return p;const{font:T,syntheticBold:v,syntheticItalic:E}=l?{font:l,syntheticBold:e,syntheticItalic:t}:k(h?void 0:this.fonts,e,t),I=T?this.programs.get(T):void 0,P=new o(this.resources.length+1,e,t,T,this.objects,v,E,I,this.signal);return I||(this.resources.push(P),T&&this.programs.set(T,P)),f.set(g,P),P}dictionary(){return"<< "+this.resources.map(e=>"/"+e.name+" "+e.object+" 0 R").join(" ")+" >>"}}const r=Object.freeze({PdfFontResource:o,PdfFontResources:s});return N.set("7825c87ba92a9992baf6b5c8a5e146948268985c31584ef9c8bf395359942e4f",r),r})(),nt=N.get("253db2c0eab1f298fda61fb40a5ddaacbf6ad12a7408ee3d8c12d27f88e7ca27")??(()=>{const{OfficeIMOError:S}=pe,{ExportCell:R,assertExportValue:O}=Ce,{checkAbort:C,pause:k,taskYieldDue:y}=be,{isDate:m}=Me,{defaultBooleanText:b}=kt;function x(s,r){return r.limits.maxTextCharacters===void 0?s:s.replace(/[\t\r\n]/g,n=>n===" "?" ":"")}function w(s,r){if(typeof s=="string")return s;throw s&&typeof s.then=="function"&&Promise.resolve(s).catch(()=>{}),new TypeError(r+" must return a synchronous string.")}function u(s,r,n){if(O(s),s instanceof R&&s.text!==void 0)return s.text;const e=s instanceof R?s.value:s;return r.formatValue?w(r.formatValue(e,n),"formatValue"):e==null?"":m(e)?Number.isFinite(e.getTime())?e.toISOString():"":typeof e=="number"&&!Number.isFinite(e)?"":typeof e=="boolean"?(r.booleanText??b)[e?"true":"false"]:String(e)}function a(s,r,n,e,t,l,d=!0){const f=c(s,r,n,e,t,l,d);for(;;){const h=f.next();if(h.done)return h.value}}async function i(s,r,n,e,t,l,d=!0,f){C(f);const h=c(s,r,n,e,t,l,d);for(;;){const g=h.next();if(g.done)return g.value;y()&&await k(),C(f)}}function*c(s,r,n,e,t,l,d){if(s.length>t)throw new S("RESOURCE_LIMIT","maxCellCharacters exceeded.");const f=[];let h=0;function g(p,T){if(f.length>=l)throw new S("RESOURCE_LIMIT","maxRowLines exceeded.");f.push({text:p.join(""),width:T})}for(const p of s.replace(/\r\n?/g,"\n").replace(/\t/g," ").split("\n")){let T=[],v=[],E=0,I=-1;for(const P of p){(++h&4095)===0&&(yield);const B=r.width(P.codePointAt(0))*n/1e3;if(B>e+.001)throw new RangeError("PDF column is too narrow for a glyph. Increase page/column width or reduce padding/font size.");if(E+B>e+.001){if(!d)throw new RangeError("Unwrapped PDF cell exceeds its column width.");const L=I>=0?I+1:T.length,H=v.slice(0,L).reduce((W,U)=>W+U,0);g(T.slice(0,L),H),T=T.slice(L),v=v.slice(L),E=v.reduce((W,U)=>W+U,0),I=-1;for(let W=0;W<T.length;W++)T[W]===" "&&(I=W);E+B>e+.001&&(g(T,E),T=[],v=[],E=0,I=-1)}T.push(P),v.push(B),E+=B,P===" "&&(I=T.length-1)}g(T,E),(++h&4095)===0&&(yield)}return f}const o=Object.freeze({pdfBudgetText:x,synchronousText:w,displayText:u,wrapText:a,wrapTextCooperatively:i});return N.set("253db2c0eab1f298fda61fb40a5ddaacbf6ad12a7408ee3d8c12d27f88e7ca27",o),o})(),or=N.get("8be3fb029e08d100ce8ffcf50916d5ba7f7bc00d62156cc33815fd58554a9ed6")??(()=>{const{NotSupportedError:S,OfficeIMOError:R}=pe,{checkAbort:O,pause:C,taskYieldDue:k,withAbort:y}=be,m=(a,i)=>i===0||i===a.length||!(a.charCodeAt(i)>=56320&&a.charCodeAt(i)<=57343&&a.charCodeAt(i-1)>=55296&&a.charCodeAt(i-1)<=56319);function b(a,i){const c=[{text:"",owners:[]}];let o=0,s=a.runs[0]?.text.length??0;for(let r=0;r<a.text.length;){for(;r>=s&&o<a.runs.length-1;)s+=a.runs[++o].text.length;const n=a.text.codePointAt(r),e=String.fromCodePoint(n);if(r+=e.length,n>=55296&&n<=57343)throw new TypeError("PDF text contains an unpaired UTF-16 surrogate.");if(r>s&&o<a.runs.length-1)throw new S("A shaped presentation boundary cannot split a UTF-16 scalar.");if(e==="\n"||e==="\r"){if(e==="\r"&&a.text[r]==="\n"&&r++,c.length>=i)throw new R("RESOURCE_LIMIT","maxRowLines exceeded.");c.push({text:"",owners:[]});continue}if(n<32&&n!==9||n>=127&&n<160)throw new S("PDF text contains an unsupported control character.");const t=e===" "?" ":e,l=c.at(-1);if(l.text.length+t.length>4096)throw new R("RESOURCE_LIMIT","Shaped PDF text supports at most 4,096 UTF-16 units per physical paragraph.");l.text+=t;for(let d=0;d<t.length;d++)l.owners.push(o)}return c}function x(a,i,c,o,s,r){if(!Array.isArray(a)||a.length>32768)throw new TypeError("Invalid shaped run array.");let n=0,e=0;const t=new Uint8Array(o-c),l=new Map,d=new Map,f=[];for(const p of a){if(!p||!Array.isArray(p.glyphs)||!s.some(v=>v.font===p.font))throw new TypeError("Shaping must use an exact registered PdfFont identity.");if(n+=p.glyphs.length,n>32768)throw new R("RESOURCE_LIMIT","Shaped PDF text exceeded 32,768 glyphs.");const T=[];for(const v of p.glyphs){const{id:E,clusterStart:I,clusterEnd:P,xAdvance:B,yAdvance:L,xOffset:H,yOffset:W}=v??{},U=s[i.owners[I]??-1];if(!U||U.font!==p.font||!U.program||!Number.isSafeInteger(E)||E<=0||E>=U.program.glyphCount)throw new TypeError("Shaping returned an invalid glyph or font identity.");if(!Number.isSafeInteger(I)||!Number.isSafeInteger(P)||I<c||P<=I||P>o||!m(i.text,I)||!m(i.text,P))throw new TypeError("Shaping returned an invalid UTF-16 cluster range.");if(![B,L,H,W].every(j=>Number.isFinite(j)&&Math.abs(j)<=1e5)||B<0||L!==0)throw new TypeError("Shaping requires finite bounded horizontal glyph metrics.");const J=r.runs[i.owners[I]];for(let j=I;j<P;j++){const _=r.runs[i.owners[j]];if(s[i.owners[j]].font!==p.font||J.style.bold!==_.style.bold||J.style.italic!==_.style.italic||J.style.color!==_.style.color||J.link!==_.link)throw new S("A PDF presentation, font or link boundary cannot split an indivisible shaped cluster.");t[j-c]=1}const Z=l.get(I);if(Z!==void 0&&Z!==P)throw new TypeError("Inconsistent shaped cluster ranges.");l.set(I,P),d.set(I,(d.get(I)??0)+B),e+=B,T.push(Object.freeze({id:E,clusterStart:I,clusterEnd:P,xAdvance:B,yAdvance:L,xOffset:H,yOffset:W}))}f.push(Object.freeze({font:p.font,glyphs:Object.freeze(T)}))}if(t.some(p=>!p))throw new TypeError("Shaping omitted logical source text.");const h=[...l].sort((p,T)=>p[0]-T[0]);let g=c;for(const[p,T]of h){if(p!==g)throw new TypeError("Shaped clusters overlap or leave a logical gap.");g=T}return{runs:f,boundaries:h.map(([,p])=>p),advances:d,width:e}}async function w(a,i,c,o,s,r){const n=a.runs.map(h=>i.select(h.style.bold,h.style.italic,h.font)),e=i.select();if(n.some((h,g)=>!h.font&&a.runs[g].text.length))throw new S("Shaped PDF text requires explicit embedded TrueType fonts.");const t=[],l=s.options.textShaper,d=s.options.signal,f=(h,g,p,T)=>{if(t.length>=s.limits.maxRowLines)throw new R("RESOURCE_LIMIT","maxRowLines exceeded.");const v=[];let E=e.lineHeight(c),I=(e.program?.ascent??800)*c/1e3;const P=new Set;let B=-1,L,H=[],W=0;const U=()=>{if(B<0||!L)return;const Z=a.runs[B],_=H.filter(A=>A.logicalText).sort((A,F)=>A.clusterStart-F.clusterStart).map(A=>A.logicalText).join("");v.push({text:_,actualText:_,logicalStart:Math.min(...H.map(A=>A.clusterStart)),width:W*c/1e3,font:L,glyphs:H,...Z.style.color===void 0?{}:{color:Z.style.color},...Z.link?{link:Z.link}:{}}),H=[],W=0};for(const Z of T?.runs??[])for(const j of Z.glyphs){const _=h.owners[j.clusterStart],A=n[_];(B!==_||L!==A)&&(U(),B=_,L=A);const F=P.has(j.clusterStart)?"":h.text.slice(j.clusterStart,j.clusterEnd);P.add(j.clusterStart),H.push({...j,logicalText:F}),W+=j.xAdvance,E=Math.max(E,A.lineHeight(c)),I=Math.max(I,A.program.ascent*c/1e3)}U();const J=h.text.slice(g,p);t.push({text:J,actualText:J,segments:v,width:(T?.width??0)*c/1e3,lineHeight:E,ascent:I})};for(const h of b(a,s.limits.maxRowLines)){if(O(d),!h.text){f(h,0,0);continue}const g=[];for(let P=0;P<h.text.length;){const B=h.owners[P];let L=P+1;for(;L<h.text.length&&h.owners[L]===B;)L++;g.push(Object.freeze({start:P,end:L,font:n[B].font})),P=L}Object.freeze(g);let p=0;const T=async(P,B)=>{if(++p>16385)throw new R("RESOURCE_LIMIT","Shaped line fitting exceeded its bounded work limit.");k()&&await C(),O(d);const L=await y(Promise.resolve(l.shapeLine(Object.freeze({text:h.text,start:P,end:B,runs:g,direction:s.options.textDirection??"auto",...d?{signal:d}:{}}))),d);return O(d),x(L,h,P,B,n,a)},v=await T(0,h.text.length),E=v.boundaries;if(!r){if(v.width*c/1e3>o+.001)throw new RangeError("Unwrapped PDF cell exceeds its column width.");f(h,0,h.text.length,v);continue}let I=0;for(;I<E.length;){const P=I?E[I-1]:0;let B=I,L=0,H=-1;for(;B<E.length;){const U=B?E[B-1]:0,J=v.advances.get(U)*c/1e3;if(L+J>o+.001&&B>I||(L+=J,h.text[E[B]-1]===" "&&(H=B+1),B++,L>o+.001))break}B<E.length&&H>I&&(B=H);let W=P===0&&B===E.length?v:await T(P,E[B-1]);if(W.width*c/1e3>o+.001){let U=I+1,J=B-1,Z,j=0;for(;U<=J;){const _=Math.floor((U+J)/2),A=await T(P,E[_-1]);A.width*c/1e3<=o+.001?(Z=A,j=_,U=_+1):J=_-1}if(!Z)throw new RangeError("PDF column is too narrow for an indivisible shaped cluster.");W=Z,B=j}f(h,P,E[B-1],W),I=B}}return t}const u=Object.freeze({wrapShapedPdfText:w});return N.set("8be3fb029e08d100ce8ffcf50916d5ba7f7bc00d62156cc33815fd58554a9ed6",u),u})(),ft=N.get("abbfad7ffb3c318822659c9fbde9126630ce2c137dc2e2b88402148424255e2d")??(()=>{const{NotSupportedError:S,OfficeIMOError:R}=pe,{copyExportLink:O}=st,{checkAbort:C,pause:k,taskYieldDue:y}=be,{presentation:m,color:b}=De,{wrapShapedPdfText:x}=or,{PdfFont:w}=rt,{pdfBudgetText:u}=nt;function a(o,s,r,n,e=!0,t=!0){if(typeof o=="string"){if(o.length>r.limits.maxCellCharacters)throw new R("RESOURCE_LIMIT","maxCellCharacters exceeded.");return t&&(o.length||e)&&r.budget.reserve(1,u(o,r.budget).length),Object.freeze({text:o,runs:Object.freeze([Object.freeze({text:o,style:s})])})}const l=o;if(!Array.isArray(l))throw l&&typeof l.then=="function"&&Promise.resolve(l).catch(()=>{}),new TypeError("PDF text must be a string or a synchronous array of text runs.");if(l.length>r.limits.maxTextRuns)throw new R("RESOURCE_LIMIT","maxTextRuns exceeded.");let d=0,f=0;const h=[];for(const g of l){if(!g||typeof g!="object"||Object.keys(g).some(L=>!["text","bold","italic","color","link","font"].includes(L)))throw new TypeError("PDF text runs support text, bold, italic, color, link and font.");const{text:p,bold:T,italic:v,color:E,link:I,font:P}=g;if(typeof p!="string")throw new TypeError("PDF run text must be a string.");if(P!==void 0){if(!(P instanceof w))throw new TypeError("A PDF run font must be a PdfFont.");n.registerFont(P)}if(d+=p.length,d>r.limits.maxCellCharacters)throw new R("RESOURCE_LIMIT","maxCellCharacters exceeded.");t&&(f+=u(p,r.budget).length);const B=m({...s,...T===void 0?{}:{bold:T},...v===void 0?{}:{italic:v},...E===void 0?{}:{color:E}});if(r.options.tagged&&I!==void 0&&p.length&&!p.trim())throw new TypeError("Tagged PDF inline links require nonempty displayed text.");h.push(Object.freeze({text:p,style:B,...P===void 0?{}:{font:P},...I===void 0?{}:{link:O(I)}}))}return t&&(d||e)&&r.budget.reserve(1,f),Object.freeze({text:h.map(g=>g.text).join(""),runs:Object.freeze(h)})}async function i(o,s,r,n,e,t=!0){if(e.options.textShaper)return x(o,s,r,n,e,t);const{signal:l}=e.options,{text:d,runs:f}=o;C(l);const h=f.length===1?f[0]:void 0,g=h&&s.select(h.style.bold,h.style.italic,h.font),p=g?void 0:f.map(_=>s.select(_.style.bold,_.style.italic,_.font)),T=s.select();if(h&&d.length>0&&d.length<4096){const _=h,A=g;let F=0,V=!0;for(let q=0;q<d.length;){const $=d.codePointAt(q);if($===9||$===10||$===13){V=!1;break}const Q=A.width($)*r/1e3;if(Q>n+.001||F+Q>n+.001){V=!1;break}F+=Q,q+=$>65535?2:1}if(V){if(e.limits.maxRowLines<1)throw new R("RESOURCE_LIMIT","maxRowLines exceeded.");return[{text:d,width:F,segments:[{text:d,width:F,font:A,..._.style.color===void 0?{}:{color:_.style.color},..._.link?{link:_.link}:{}}],lineHeight:A.lineHeight(r),ascent:Math.max(0,(A.program?.ascent??800)*r/1e3)}]}}const v=p??[g],E=[];let I=[],P=[],B=[],L=0,H=-1,W=0,U=f[0]?.text.length??0,J=0;const Z=_=>{if(E.length>=e.limits.maxRowLines)throw new R("RESOURCE_LIMIT","maxRowLines exceeded.");const A=[];let F=0,V=0,q=0;for(let $=0;$<_;){const Q=B[$],z=f[Q],K=v[Q];let Y=$+1;for(;Y<_&&B[Y]===Q;)Y++;const ie=P.slice($,Y).reduce((ae,ee)=>ae+ee,0);A.push({text:I.slice($,Y).join(""),width:ie,font:K,...z.style.color===void 0?{}:{color:z.style.color},...z.link?{link:z.link}:{}}),F+=ie,V=Math.max(V,K.lineHeight(r)),q=Math.max(q,(K.program?.ascent??800)*r/1e3),$=Y}if(!A.length){const $=v[0]??T;A.push({text:"",width:0,font:$,...f[0]?.style.color===void 0?{}:{color:f[0].style.color}}),V=$.lineHeight(r),q=($.program?.ascent??800)*r/1e3}E.push({text:I.slice(0,_).join(""),width:F,segments:A,lineHeight:V,ascent:q}),I=I.slice(_),P=P.slice(_),B=B.slice(_),L=P.reduce(($,Q)=>$+Q,0),H=-1;for(let $=0;$<I.length;$++)I[$]===" "&&(H=$)},j=(_,A)=>{const F=v[A].width(_.codePointAt(0))*r/1e3;if(F>n+.001)throw new RangeError("PDF column is too narrow for a glyph. Increase page/column width or reduce padding/font size.");if(L+F>n+.001){if(!t)throw new RangeError("Unwrapped PDF cell exceeds its column width.");Z(H>=0?H+1:I.length),L+F>n+.001&&Z(I.length)}I.push(_),P.push(F),B.push(A),L+=F,_===" "&&(H=I.length-1)};for(let _=0;_<d.length;){for(;_>=U&&W<f.length-1;)U+=f[++W].text.length;const A=W,F=d.codePointAt(_),V=String.fromCodePoint(F);if(_+V.length>U&&W<f.length-1){let q=W+1;for(;!f[q].text.length;)q++;const $=f[A],Q=f[q],z=v[A],K=v[q];if(!(z.font===K.font&&(z.font?z.syntheticBold===K.syntheticBold&&z.syntheticItalic===K.syntheticItalic:z.bold===K.bold&&z.italic===K.italic))||b($.style.color??"111827")!==b(Q.style.color??"111827")||$.link?.target!==Q.link?.target||$.link?.tooltip!==Q.link?.tooltip)throw new S("A PDF presentation boundary cannot split a UTF-16 scalar.")}if(_+=V.length,V==="\r"||V==="\n")V==="\r"&&d[_]==="\n"&&_++,Z(I.length);else if(V===" ")for(let q=0;q<4;q++)j(" ",A);else j(V,A);(++J&4095)===0&&(y()&&await k(),C(l))}return Z(I.length),E}const c=Object.freeze({capturePdfText:a,wrapPdfText:i});return N.set("abbfad7ffb3c318822659c9fbde9126630ce2c137dc2e2b88402148424255e2d",c),c})(),ar=N.get("04b189837f06067364240b6731efdf86d61d81fd0848fac3666f25c5f27817b8")??(()=>{const{OfficeIMOError:S}=pe,{wrapPdfText:R}=ft;function O(m,b){if(typeof b.options.wideTable!="object")return;const w=b.page.width-b.margins.left-b.margins.right,u=b.repeatedColumns,a=new Set(u),i=m.map((n,e)=>e).filter(n=>!a.has(n)),c=u.reduce((n,e)=>n+m[e],0);if(c>w+.001)throw new RangeError("Repeated PDF columns exceed the printable width.");const o=[];let s=[...u],r=c;for(const n of i){const e=m[n];if(c+e>w+.001)throw new RangeError("A PDF column and its repeated identifiers cannot fit a band.");r+e>w+.001&&(o.push(s),s=[...u],r=c),s.push(n),r+=e}if(s.length&&o.push(s),o.length>b.limits.maxTableBands)throw new S("RESOURCE_LIMIT","maxTableBands exceeded.");if(b.limits.maxTableWindowRows<1)throw new S("RESOURCE_LIMIT","maxTableWindowRows must allow at least one row fragment.");return Object.freeze(o.map(n=>{let e=b.margins.left;const t=n.map(l=>{const d=e;return e+=m[l],d});return Object.freeze({columns:Object.freeze(n),lefts:Object.freeze(t)})}))}async function C(m,b,x,w,u){const a=[];for(const i of m){const c=[];for(const o of i.cells){if(o.span===1){const s=b.columns.indexOf(o.first);s>=0&&c.push({...o,source:o.source??o,first:s});continue}for(let s=0;s<b.columns.length;){const r=b.columns[s];if(r<o.first||r>=o.first+o.span){s++;continue}let n=s+1;for(;n<b.columns.length&&b.columns[n]===b.columns[n-1]+1&&b.columns[n]<o.first+o.span;)n++;const e=b.columns.slice(s,n).reduce((l,d)=>l+x[d],0),t=await R(o.captured,u,w.fontSize,e-w.padding*2,w,o.style.wrapText!==!1);c.push({...o,source:o.source??o,first:s,span:n-s,width:e,lines:t,lineHeight:t.reduce((l,d)=>Math.max(l,d.lineHeight),o.font.lineHeight(w.fontSize))}),s=n}}c.sort((o,s)=>o.first-s.first),a.push({...i,source:i.source??i,cells:c})}return a}function k(m,b){if(!m.length||!m[0].length)return m;const x=m[0].length,w=Array.from({length:x},(u,a)=>Math.max(...m.map(i=>Math.max(b.padding*2+i[a].lineHeight,...i[a].cells.filter(c=>(c.rowSpan??1)===1).map(c=>c.lines.length*c.lineHeight+b.padding*2)))));for(const u of m)for(const[a,i]of u.entries())for(const c of i.cells){const o=c.rowSpan??1,s=w.slice(a,a+o).reduce((n,e)=>n+e,0),r=c.lines.length*c.lineHeight+b.padding*2;if(r>s)for(let n=a;n<a+o;n++)w[n]+=(r-s)/o}return m.map(u=>u.map((a,i)=>({...a,structured:!0,height:w[i],cells:a.cells.map(c=>({...c,height:w.slice(i,i+(c.rowSpan??1)).reduce((o,s)=>o+s,0)}))})))}const y=Object.freeze({planTableBands:O,projectBandRows:C,alignBandBlocks:k});return N.set("04b189837f06067364240b6731efdf86d61d81fd0848fac3666f25c5f27817b8",y),y})(),St=N.get("6fd77694f46f8c87510a82e8a58a3c424099d6172bfb1942f92d048b39169945")??(()=>{const{ExportCell:S}=Ce,{copyExportLink:R}=st,{tableSpans:O}=Ye,{createTotals:C}=wt,{presentation:k,positive:y}=De,{displayText:m,pdfBudgetText:b}=nt,{capturePdfText:x,wrapPdfText:w}=ft,{planTableBands:u,projectBandRows:a,alignBandBlocks:i}=ar;class c{settings;fonts;bands;widths;lefts;lineHeight;headings;totals;repeatedColumns;structuredBandRows=new WeakMap;dataPresentations=[];constructor(r,n){this.settings=r,this.fonts=n;const{options:e,padding:t,fontSize:l,page:d,margins:f}=r,h=e.columns,g=d.width-f.left-f.right;this.repeatedColumns=new Set(r.repeatedColumns);let p;if(e.columnWidths&&e.columnWidths.length!==h.length)throw new RangeError("columnWidths must declare one point width per column.");const T=typeof e.wideTable=="object"?e.wideTable.minimumColumnWidth??72:0,v=h.map((L,H)=>y(e.columnWidths?.[H]??Math.max(T,L.width===void 0?g/h.length:y(L.width,"Column width",255)*(p??=n.select().width(48)*l/1e3)+t*2),"PDF column width")),E=v.reduce((L,H)=>L+H,0);if(E>g+.001&&e.wideTable==="reject")throw new RangeError("Table widths exceed the printable page width.");this.bands=u(v,r),this.widths=!this.bands&&E>g?v.map(L=>L*g/E):v;let I=f.left;if(this.lefts=this.widths.map(L=>{const H=I;return I+=L,H}),this.widths.some(L=>L<=t*2))throw new RangeError("Page is too narrow for this many columns and the requested padding.");this.lineHeight=n.select().lineHeight(l);const P=h.reduce((L,H)=>Math.max(L,H.groups?.length??0),0);if(P>16)throw new RangeError("Grouped headings support at most 16 levels.");if(P&&e.includeHeader===!1)throw new TypeError("Grouped headings require leaf headings.");const B=[];if(e.includeHeader!==!1){for(let L=0;L<P;L++){const H=[];for(let W=0;W<h.length;){let U=W;const J=h[W].groups?.[L]??"",Z=JSON.stringify(h[W].groups?.slice(0,L+1));for(;J&&U+1<h.length&&JSON.stringify(h[U+1].groups?.slice(0,L+1))===Z;)U++;H.push({first:W,span:U-W+1,text:J}),W=U+1}B.push(H)}B.push(h.map((L,H)=>({first:H,span:1,text:L.header})))}this.headings=B,this.totals=C(h,e.footer?.totals)}async cell(r,n,e,t,l,d=!1){const{options:f,padding:h,fontSize:g,budget:p}=this.settings,T=f.columns[n],v=r instanceof S?r.presentation:void 0,E=r instanceof S&&r.link?R(r.link):void 0,I=d&&t%2&&f.alternateRowColor?f.alternateRowColor:void 0,P=n*2+(I?1:0),B=d&&v===void 0;let L=B?this.dataPresentations[P]:void 0;if(!L){const F=d?I?{background:I}:{}:l;L=k({...T.alignment===void 0?{}:{alignment:T.alignment},...T.wrapText===void 0?{}:{wrapText:T.wrapText},...F,...v}),B&&(this.dataPresentations[P]=L)}const H=this.fonts.select(L.bold,L.italic),W=e===1?this.widths[n]:this.widths.slice(n,n+e).reduce((F,V)=>F+V,0),U={rowIndex:t,columnIndex:n,column:T},J=r instanceof S?r.value:r;let Z;if(f.formatRuns&&t>=0&&!(r instanceof S&&r.text!==void 0)){const F=f.formatRuns(J,U);if(!Array.isArray(F))throw F&&typeof F.then=="function"&&Promise.resolve(F).catch(()=>{}),new TypeError("formatRuns must return a synchronous array of PDF text runs.");Z=F}else Z=m(r,f,U);const j=x(Z,L,this.settings,this.fonts);if(f.tagged&&E&&!j.text.trim())throw new TypeError("Tagged PDF cell links require nonempty displayed text.");if(E&&j.runs.some(F=>F.link))throw new TypeError("A PDF cell link cannot be combined with inline run links.");const _=b(j.text,p);this.bands?p.release(1,_.length):p.cell(_,_.length);const A=await w(j,this.fonts,g,W-h*2,this.settings,L.wrapText!==!1);return{first:n,span:e,width:W,font:H,style:L,lineHeight:A.reduce((F,V)=>Math.max(F,V.lineHeight),H.lineHeight(g)),...E?{link:E}:{},...this.bands?{captured:j}:{},lines:A}}row(r){let n=1,e=this.lineHeight;for(let t=0;t<r.length;t++){const l=r[t];n=Math.max(n,l.lines.length),e=Math.max(e,l.lineHeight)}return{cells:r,lines:n,lineHeight:e,height:n*e+this.settings.padding*2}}async headers(){if(this.settings.options.headerRows)return this.block(this.settings.options.headerRows,this.settings.options.headerPresentation??{});const{formatValue:r,...n}=this.settings.options,e=[];for(const t of this.headings){const l=[];for(const d of t)l.push(await this.cell(new S(d.text,{text:d.text}),d.first,d.span,-1,n.headerPresentation??{}));e.push(this.row(l))}return e}async block(r,n){const e=O(r,this.settings.options.columns.length),{formatValue:t,...l}=this.settings.options,d=[];for(const h of e){const g=[];for(const p of h){const T=p.value instanceof S?p.value:new S(p.value),v=new S(T.value,{text:m(T,l,{rowIndex:-1,columnIndex:p.first,column:l.columns[p.first]}),...T.presentation?{presentation:T.presentation}:{},...T.link?{link:T.link}:{}});g.push({...await this.cell(v,p.first,p.span,-1,n),rowSpan:p.rowSpan})}d.push(g)}const f=d.map(h=>Math.max(this.lineHeight+this.settings.padding*2,...h.filter(g=>g.rowSpan===1).map(g=>g.lines.length*g.lineHeight+this.settings.padding*2)));return d.forEach((h,g)=>h.forEach(p=>{const T=f.slice(g,g+p.rowSpan).reduce((E,I)=>E+I,0),v=p.lines.length*p.lineHeight+this.settings.padding*2;if(v>T)for(let E=g;E<g+p.rowSpan;E++)f[E]+=(v-T)/p.rowSpan})),d.map((h,g)=>({cells:h.map(p=>({...p,height:f.slice(g,g+p.rowSpan).reduce((T,v)=>T+v,0)})),lines:Math.max(1,Math.ceil((f[g]-this.settings.padding*2)/this.lineHeight)),lineHeight:this.lineHeight,height:f[g],structured:!0}))}minimumRowLines(r){let n=1;if(this.bands)for(const e of r.cells)this.repeatedColumns.has(e.first)&&(n=Math.max(n,e.lines.length));return n}minimumRowHeight(r){return this.minimumRowLines(r)*r.lineHeight+this.settings.padding*2}repeatedColumn(r){return this.repeatedColumns.has(r)}async blockHeight(r){return(this.bands?(await this.bandRows(r,!0))[0]:r).reduce((e,t)=>e+t.height,0)}async bandRows(r,n=!1){if(!this.bands)throw new Error("Horizontal bands were not planned.");if(!n)return this.projectBandRows(r,!1);let e=this.structuredBandRows.get(r);return e||(e=this.projectBandRows(r,!0),this.structuredBandRows.set(r,e)),e}async projectBandRows(r,n){const e=[],t=new Set;for(const l of this.bands){const d=await a(r,l,this.widths,this.settings,this.fonts);e.push(d.map(f=>({...f,cells:f.cells.map(h=>{const g=h.source,p=t.has(g);return t.add(g),p?{...h,semanticArtifact:!0}:h})})))}return n?i(e,this.settings):e}async data(r,n,e=!1){const{options:t}=this.settings,l=[];for(let d=0;d<t.columns.length;d++){const f=r[d],h=f instanceof S?f.value:f;e||this.totals[d].accept(h);const g=await this.cell(f,d,1,n,e?t.footerPresentation??{}:void 0,!e);l.push(!e&&t.columns[d].rowHeader?{...g,rowHeader:!0}:g)}return this.row(l)}async footer(r){if(!this.settings.options.footer)return;if(this.settings.options.footer.rows)return this.block(this.settings.options.footer.rows,this.settings.options.footerPresentation??{});const n=this.totals.map((e,t)=>e.operation?e.value():this.settings.options.footer?.values?.[t]);return[await this.data(n,r,!0)]}}const o=Object.freeze({PdfTableLayout:c});return N.set("6fd77694f46f8c87510a82e8a58a3c424099d6172bfb1942f92d048b39169945",o),o})(),cr=N.get("9ea74d93c18250e809a7be745444b886bcd5ec924a78e6ab004d649789db1f72")??(()=>{const{OfficeIMOError:S}=pe,{checkAbort:R}=be;class O{layout;headings;painter;caption;continuation;entries=[];height=0;count=0;firstWindow=!0;firstCapacity;painted=!1;constructor(y,m,b,x,w){this.layout=y,this.headings=m,this.painter=b,this.caption=x,this.continuation=w,this.firstCapacity=b.firstCapacity}get capacity(){return this.firstWindow?this.firstCapacity:this.painter.continuationCapacity}async accept(y){if(this.entries.length&&(this.height+y.height>this.capacity+.001||this.count+y.count>this.layout.settings.limits.maxTableWindowRows)&&await this.flush(),this.firstWindow&&!this.entries.length&&y.height>this.capacity+.001&&y.height<=this.painter.firstFullCapacity+.001&&(await this.painter.moveFirstToFreshPage(),this.firstCapacity=this.painter.firstFullCapacity),y.height>this.capacity+.001)throw new RangeError("PDF band window cannot fit the requested table fragment.");this.entries.push(y),this.height+=y.height,this.count+=y.count,this.count>=this.layout.settings.limits.maxTableWindowRows&&await this.flush()}async row(y,m=!1){const{padding:b,fontSize:x,options:w}=this.layout.settings,u=this.layout.minimumRowLines(y),a=u*y.lineHeight+b*2;if(a>this.painter.firstFullCapacity+.001||a>this.painter.continuationCapacity+.001)throw new RangeError("Repeated PDF identifiers must fit intact below the first and continued band headings/context.");this.entries.length&&y.height<=this.painter.continuationCapacity+.001&&y.height>this.capacity-this.height+.001&&await this.flush(),!m&&this.firstWindow&&!this.entries.length&&y.height>this.capacity+.001&&y.height<=this.painter.firstFullCapacity+.001&&(await this.painter.moveFirstToFreshPage(),this.firstCapacity=this.painter.firstFullCapacity),await this.painter.prepareRow?.(y);let i=0;for(;i<y.lines;){if(R(w.signal),this.entries.length&&this.capacity-this.height+.001<a&&await this.flush(),this.firstWindow&&!this.entries.length&&this.capacity+.001<a&&(await this.painter.moveFirstToFreshPage(),this.firstCapacity=this.painter.firstFullCapacity),this.capacity-this.height+.001<a)throw new RangeError("PDF band window cannot fit its complete repeated identifiers.");const c=Math.min(y.lines-i,Math.floor((this.capacity-this.height-b*2+.001)/y.lineHeight));if(c<1)throw new RangeError("PDF page cannot fit a table line below horizontal band headings.");const o=Math.max(c,u),s=o*y.lineHeight+b*2,r=await this.layout.bandRows([y]),n=[],e=r.map((t,l)=>{let d=!1;const f=t[0].cells.map(p=>{const T=this.layout.bands[l].columns[p.first],v=this.layout.repeatedColumn(T),E=p.span===1&&(p.source?.span??1)===1&&(p.rowSpan??1)===1&&p.height===void 0&&i===0&&(v||c>=p.lines.length),I=v||E?p.lines:p.lines.slice(i,i+c);if(!v&&(I.length>0||p.link!==void 0)&&(d=!0),E)return p;const{height:P,...B}=p;return{...B,lines:I,lineHeight:I.reduce((L,H)=>Math.max(L,H.lineHeight),p.font.lineHeight(x)),...i>0&&v?{semanticArtifact:!0}:{}}}),h=Math.max(1,...f.map(p=>p.lines.length)),g=Math.max(this.layout.lineHeight,...f.filter(p=>p.lines.length>0).map(p=>p.lineHeight));return n.push(i>0&&!d),[{...t[0],cells:f,lines:h,lineHeight:g,height:h*g+b*2}]});await this.accept({rows:e,height:s,count:1,completed:i+c>=y.lines?[y]:[],exhaustedBands:n}),i+=c,i<y.lines&&await this.flush()}}async block(y){const m=await this.layout.bandRows(y,!0),b=m[0].reduce((x,w)=>x+w.height,0);if(y.length>this.layout.settings.limits.maxTableWindowRows)throw new S("RESOURCE_LIMIT","A structured PDF block exceeds maxTableWindowRows.");for(const x of y)await this.painter.prepareRow?.(x);await this.accept({rows:m,height:b,count:y.length,completed:y,exhaustedBands:m.map(()=>!1)})}async keptRows(y,m=!1){const b=y.reduce((w,u)=>w+u.height,0),x=b<=this.painter.continuationCapacity+.001;this.entries.length&&x&&b>this.capacity-this.height+.001&&await this.flush();for(const[w,u]of y.entries())await this.row(u,!x&&w===0&&m)}async flush(y=!1){if(!(!this.entries.length&&(!y||this.painted||!this.headings.some(m=>m.length)))){for(let m=0;m<this.layout.bands.length;m++)R(this.layout.settings.options.signal),!(!this.firstWindow&&this.entries.length>0&&this.entries.every(b=>b.exhaustedBands[m]))&&await this.painter.paint(m,this.headings[m],this.entries.flatMap(b=>b.rows[m]),this.firstWindow?this.caption:this.continuation,this.firstWindow,m===0);for(const m of this.entries)for(const b of m.completed)await this.painter.completeRow?.(b);this.entries=[],this.height=0,this.count=0,this.firstWindow=!1,this.painted=!0}}}const C=Object.freeze({PdfTableBandFlow:O});return N.set("9ea74d93c18250e809a7be745444b886bcd5ec924a78e6ab004d649789db1f72",C),C})(),lr=N.get("9deed79565a5da5009f7a01579df8d6a3f019b78eb7b17d831c7964840e9a6bf")??(()=>{class S{structure;table;headers;cells=new WeakMap;rows=new WeakMap;columnHeaders=[];ordinaryAttributes=[];headerCount=0;headersPrepared=!1;constructor(C,k,y){this.structure=C,this.table=k,this.headers=y}async prepareHeaders(){if(!this.headersPrepared){for(let C=0;C<this.headers.length;C++){const k=this.headers[C],y=this.structure.element("TR",this.table);this.rows.set(k,y);for(const m of k.cells){const b=m.lines.some(u=>u.text.trim().length>0),x=this.associations(m,C),w=this.structure.element(b?"TH":"TD",y,this.attributes(m,x,b?"Column":void 0));if(this.cells.set(m,w),b){const u={row:C,order:this.headerCount++,identifier:await this.structure.identifier(w)};for(let a=m.first;a<m.first+m.span;a++)(this.columnHeaders[a]??=[]).push(u)}}}this.headersPrepared=!0}}async completeHeaders(){for(const C of this.headers)await this.completeRow(C)}async prepareRow(C,k="data",y=this.table,m){if(this.rows.get(C)!==void 0)return C.cells.map(a=>this.cells.get(a));const x=this.structure.element("TR",y);this.rows.set(C,x);const w=C.cells.map((a,i)=>{const c=m===void 0?a.rowHeader===!0:i===m,o=this.structure.element(c?"TH":"TD",x);return this.cells.set(a,o),o});let u;for(let a=0;a<w.length;a++)(m===void 0?C.cells[a].rowHeader===!0:a===m)&&(u??=[]).push(await this.structure.identifier(w[a]));for(let a=0;a<C.cells.length;a++){const i=C.cells[a];if(!u&&i.span===1&&(i.rowSpan??1)===1){const s=this.ordinaryAttributes[i.first]??=await this.structure.attributeReference(this.attributeDictionary(i,this.associations(i)));this.structure.setAttributes(w[a],s);continue}const c=this.associations(i),o=m===void 0?i.rowHeader===!0:a===m;!o&&u&&c.push(...u),this.structure.setAttributes(w[a],this.attributes(i,c,o?"Row":void 0))}return w}owner(C){return this.cells.get(C)}async completeRow(C){await this.structure.complete(this.rows.get(C))}async finish(){await this.completeHeaders(),await this.structure.complete(this.table)}associations(C,k=Number.POSITIVE_INFINITY){if(C.span===1)return(this.columnHeaders[C.first]??[]).filter(m=>m.row<k).map(m=>m.identifier);const y=new Set;for(let m=C.first;m<C.first+C.span;m++)for(const b of this.columnHeaders[m]??[])b.row<k&&y.add(b);return[...y].sort((m,b)=>m.order-b.order).map(m=>m.identifier)}attributes(C,k,y){return" /A "+this.attributeDictionary(C,k,y)}attributeDictionary(C,k,y){return"<< /O /Table"+(y===void 0?"":" /Scope /"+y)+(C.span>1?" /ColSpan "+C.span:"")+((C.rowSpan??1)>1?" /RowSpan "+C.rowSpan:"")+(k.length?" /Headers ["+k.map(m=>"("+m+")").join(" ")+"]":"")+" >>"}}const R=Object.freeze({PdfTableStructure:S});return N.set("9deed79565a5da5009f7a01579df8d6a3f019b78eb7b17d831c7964840e9a6bf",R),R})(),dr=N.get("09c712096a1028af340e275d5a273e870546413797e71ed709657ad0482ea170")??(()=>{const{OfficeIMOError:S}=pe,{pdfNumber:R,unicodeHex:O}=Be,C=new TextEncoder;function k(m,b,x,w,u,a,i,c){const o="<< /Type /Annot /Subtype /Link /F 4 /Border [0 0 0] /Rect ["+[b,x,b+w,x+u].map(R).join(" ")+"]"+(i===void 0?"":" /StructParent "+i)+(c===void 0?"":" /P "+c+" 0 R")+" /A << /S /URI /URI <",s="> >>"+(m.tooltip===void 0?"":" /Contents <feff")+" >>",r=o.length+s.length+(m.tooltip===void 0?0:m.tooltip.length*4+1),n=()=>{throw new S("RESOURCE_LIMIT","maxPageBytes exceeded.")};r+m.target.length*2>a&&n();let e=0;for(let l=0;l<m.target.length;l++){const d=m.target.charCodeAt(l);d<128?e++:d<2048?e+=2:d>=55296&&d<=56319&&l+1<m.target.length&&m.target.charCodeAt(l+1)>=56320&&m.target.charCodeAt(l+1)<=57343?(e+=4,l++):e+=3,r+e*2>a&&n()}let t="";for(const l of C.encode(m.target))t+=l.toString(16).padStart(2,"0");return o+t+"> >>"+(m.tooltip===void 0?"":" /Contents <feff"+O(m.tooltip)+">")+" >>"}const y=Object.freeze({linkAnnotation:k});return N.set("09c712096a1028af340e275d5a273e870546413797e71ed709657ad0482ea170",y),y})(),Rt=N.get("c68d18d668366fb9b96d1b53c79dc6305f84cb83c05e4942fcf1cdf96ed1a73f")??(()=>{const{OfficeIMOError:S}=pe,{unicodeHex:R}=Be,{captureFields:O}=Te;function C(m,b){if(m===void 0)return;if(!m||typeof m!="object")throw new TypeError("PDF bookmark must provide a title and optional level.");const{title:x,level:w=1}=m;if(typeof x!="string"||!x.trim())throw new TypeError("PDF bookmark title must be nonempty text.");if(x.length>b.limits.maxCellCharacters)throw new S("RESOURCE_LIMIT","maxCellCharacters exceeded by bookmark title.");if(!Number.isInteger(w)||w<1||w>6)throw new TypeError("PDF bookmark level must be an integer from 1 through 6.");return R(x),Object.freeze({title:x,level:w})}function k(m,b){if(!m||m.kind!=="section")throw new TypeError("PDF section boundary required.");if(Object.keys(m).some(l=>!["kind","title","level","includeHeading","bookmark","headingStyle","pageSize","orientation","margins","pageHeader","pageFooter","pageNumbers"].includes(l)))throw new TypeError("PDF sections support title, heading/bookmark controls, page geometry and decorations only.");const{title:x,level:w,includeHeading:u=!0,bookmark:a=!0,headingStyle:i,pageSize:c,orientation:o,margins:s,pageHeader:r,pageFooter:n,pageNumbers:e}=m,t=C({title:x,...w===void 0?{}:{level:w}},b);for(const[l,d]of[["includeHeading",u],["bookmark",a],["pageNumbers",e]])if(d!==void 0&&typeof d!="boolean")throw new TypeError("PDF section "+l+" must be boolean.");if(i!==void 0&&(typeof i!="string"||!i.trim()))throw new TypeError("PDF section headingStyle must be nonempty text.");return Object.freeze({kind:"section",title:t.title,level:t.level,includeHeading:u,bookmark:a,...i===void 0?{}:{headingStyle:i},...c===void 0?{}:{pageSize:typeof c=="object"?Object.freeze(O(c,["width","height"])):c},...o===void 0?{}:{orientation:o},...s===void 0?{}:{margins:typeof s=="object"?Object.freeze(O(s,["top","right","bottom","left"])):s},...r===void 0?{}:{pageHeader:r},...n===void 0?{}:{pageFooter:n},...e===void 0?{}:{pageNumbers:e}})}const y=Object.freeze({captureBookmark:C,captureSection:k});return N.set("c68d18d668366fb9b96d1b53c79dc6305f84cb83c05e4942fcf1cdf96ed1a73f",y),y})(),hr=N.get("8fc594bfca7312071f0f128ad25fb929d023d176323e66e389cddd27032a4d15")??(()=>{const{settings:S}=De;function R(C,k){const{pageSize:y,orientation:m,margins:b,pageHeader:x,pageFooter:w,pageNumbers:u}=k,a={...C.options,...y===void 0?{}:{pageSize:y},...m===void 0?{}:{orientation:m},...b===void 0?{}:{margins:b},...x===void 0?{}:{pageHeader:x},...w===void 0?{}:{pageFooter:w},...u===void 0?{}:{pageNumbers:u}},i=S(a,!0);return{...C,page:i.page,margins:i.margins,options:a}}const O=Object.freeze({sectionSettings:R});return N.set("8fc594bfca7312071f0f128ad25fb929d023d176323e66e389cddd27032a4d15",O),O})(),fr=N.get("c16c0303d9d4be12ab9e0bab7cfdac73b252ed233c9689e3e0141cc8115aa941")??(()=>{const{OfficeIMOError:S}=pe,{checkAbort:R}=be,{pdfNumber:O}=Be,{color:C}=De,{PdfTableBandFlow:k}=cr,{PdfTableStructure:y}=lr,{wrapText:m,wrapTextCooperatively:b,synchronousText:x,pdfBudgetText:w}=nt,{linkAnnotation:u}=dr,{unicodeHex:a}=Be,{captureSection:i,captureBookmark:c}=Rt,{sectionSettings:o}=hr;class s{objects;baseSettings;fonts;parent;resources;layout;structure;outlines;references=[];current=0;commands="";commandParts=[];commandBytes=0;annotations=[];hyperlinks=0;y=0;dataTop=0;continuationTop=0;totalPages;numberSettings;activeSettings;pendingPage;bodyAdded=!1;sectionCount=0;sectionPages=0;sectionTitle;pendingBookmarks=[];pageNumberWidth=0;colors=new Map;textFont;textSize=0;textColor="";textPrefix="";rectangleLefts;rectangleColumns=[];externalObjects=new Map;opacityStates=new Map;bandFlow;bandCellBudget=!1;tableElement;tableStructure;activeHeadings;paintedHeaderCells=new WeakSet;paintedHeaderBudgetCells=new WeakSet;summaryRows=new WeakSet;groups=[];continuationCaption;tableCaptionOwner;continuationCaptionPaints=0;constructor(e,t,l,d,f,h,g,p){this.objects=e,this.baseSettings=t,this.fonts=l,this.parent=d,this.resources=f,this.layout=h,this.structure=g,this.outlines=p,this.activeSettings=t}measurePageNumbers(){const e=this.settings,t=this.fonts.select(),l=e.limits.maxPages,f=Math.max(...Array.from({length:Math.min(10,l)},(p,T)=>t.width(l<10?49+T:48+T)))*String(l).length*e.fontSize/1e3,h=e.options.pageNumberLabels;return m((h?.prefix??"Page ")+(h?.separator??" of ")+(h?.suffix??""),t,e.fontSize,Number.MAX_SAFE_INTEGER,e.limits.maxCellCharacters,1,!1)[0].width+f*2+2}get settings(){return this.activeSettings}async ensureStarted(){this.current||await this.start(!1)}async beginSection(e){const t=i(e,this.baseSettings),l=o(this.baseSettings,t);if(++this.sectionCount>this.baseSettings.limits.maxSections)throw new S("RESOURCE_LIMIT","maxSections exceeded.");return this.current&&(this.bodyAdded?await this.finishPage():(this.pendingPage=this.current,this.current=0)),this.activeSettings=l,this.sectionPages=0,this.sectionTitle=t.title,await this.structure?.beginSection(),t}addBookmark(e){const t=c(e,this.settings);if((this.outlines?.count??0)+this.pendingBookmarks.length>=this.settings.limits.maxBookmarks)throw new S("RESOURCE_LIMIT","maxBookmarks exceeded.");this.settings.budget.cell(t.title),this.current?this.outlines?.add(t,this.current,this.y):this.pendingBookmarks.push(t)}add(e){this.retainPageBytes(e.length),this.commands+=e}retainPageBytes(e){if(this.commandBytes+=e,this.commandBytes>this.settings.limits.maxPageBytes)throw new S("RESOURCE_LIMIT","maxPageBytes exceeded.")}rgb(e){let t=this.colors.get(e);return t||(t=C(e),this.colors.size<1024&&this.colors.set(e,t)),t}artifact(e,t="Layout"){return this.structure?"/Artifact << /Type /"+t+" >> BDC\n"+e+"EMC\n":e}text(e,t,l,d,f,h="111827",g){const p=O;if(t!==this.textFont||l!==this.textSize||h!==this.textColor){const v=t.syntheticItalic?.213:0,E=this.rgb(h);this.textPrefix="q "+E+" rg "+E+" RG\nBT /"+t.name+" "+p(l)+" Tf "+(t.syntheticBold?p(l*.025)+" w 2 Tr ":"0 Tr ")+"1 0 "+p(v)+" 1 ",this.textFont=t,this.textSize=l,this.textColor=h}const T=this.textPrefix+p(d)+" "+p(f)+" Tm "+t.encode(e)+" Tj ET Q\n";this.add(this.structure&&g!==void 0?this.structure.mark(g)+T+"EMC\n":this.artifact(T,"Pagination"))}link(e,t,l,d,f,h){if(d<=0)return;if(++this.hyperlinks>this.settings.limits.maxHyperlinks)throw new S("RESOURCE_LIMIT","maxHyperlinks exceeded.");const g=this.objects.reserve(),p=this.structure&&h!==void 0?this.structure.annotation(h,g):void 0,T=u(e,t,l,d,f,this.settings.limits.maxPageBytes-this.commandBytes,p,this.structure?this.current:void 0);this.retainPageBytes(T.length),this.annotations.push({id:g,body:T})}inline(e,t,l,d,f,h=f){const g=!this.structure&&e.actualText!==void 0&&e.actualText.length>0;g&&this.add("/Span << /ActualText <FEFF"+a(e.actualText)+"> >> BDC\n");let p;if(e.actualText!==void 0&&this.structure&&f!==void 0){p=new Map;for(const T of[...e.segments].sort((v,E)=>(v.logicalStart??0)-(E.logicalStart??0))){const v=T.link?this.structure.link(f,T.link):f;p.set(T,{owner:v,mark:this.structure.mark(v,T.actualText)})}}for(const T of e.segments){const v=p?.get(T),E=v?.owner??(T.link&&this.structure&&f!==void 0?this.structure.link(f,T.link):f);if(T.glyphs){const I=T.font,P=O,B=I.syntheticItalic?.213:0,L=this.rgb(T.color??"111827");let H=l,W="q "+L+" rg "+L+" RG\nBT /"+I.name+" "+P(t)+" Tf "+(I.syntheticBold?P(t*.025)+" w 2 Tr ":"0 Tr ");for(const U of T.glyphs)W+="1 0 "+P(B)+" 1 "+P(H+(U.xOffset+B*U.yOffset)*t/1e3)+" "+P(d+U.yOffset*t/1e3)+" Tm "+I.encodeGlyph(U.id,U.logicalText)+" Tj\n",H+=U.xAdvance*t/1e3;W+="ET Q\n",this.add(this.structure&&E!==void 0?(v?.mark??this.structure.mark(E,T.actualText))+W+"EMC\n":this.artifact(W,"Pagination"))}else this.text(T.text,T.font,t,l,d,T.color,E);if(T.link){const I=(T.font.program?.ascent??800)*t/1e3,P=(T.font.program?.descent??-200)*t/1e3,B=E??(this.structure&&h!==void 0?this.structure.link(h,T.link):void 0);this.link(T.link,l,d+P,T.width,I-P,B)}l+=T.width}g&&this.add("EMC\n")}decorationText(e){return e===void 0?"":(R(this.settings.options.signal),x(typeof e=="function"?e(Object.freeze({pageNumber:this.references.length,sectionNumber:this.sectionCount||1,sectionPageNumber:this.sectionPages,...this.sectionTitle===void 0?{}:{sectionTitle:this.sectionTitle}})):e,"Page header/footer"))}decoration(e,t,l,d){if(!e)return;this.settings.budget.cell(w(e,this.settings.budget));const f=this.fonts.select(),h=m(e,f,this.settings.fontSize,d,this.settings.limits.maxCellCharacters,1,!1);this.text(h[0].text,f,this.settings.fontSize,t,l)}async start(e=!0,t){if(this.pendingPage===void 0&&this.references.length>=this.settings.limits.maxPages)throw new S("RESOURCE_LIMIT","maxPages exceeded.");const{page:l,margins:d,options:f,fontSize:h}=this.settings,g=this.fonts.select().lineHeight(h);if(this.pendingPage!==void 0?(this.current=this.pendingPage,this.pendingPage=void 0):(this.current=this.objects.reserve(),this.references.push(this.current)),this.commands="",this.commandParts=[],this.annotations=[],this.commandBytes=0,this.bodyAdded=!1,this.sectionPages++,f.pageNumbers!==!1&&(this.totalPages??=this.objects.reserve(),this.numberSettings??=this.settings,this.pageNumberWidth||(this.pageNumberWidth=this.measurePageNumbers()),this.pageNumberWidth>l.width-d.left-d.right))throw new RangeError("Page is too narrow for page numbers at the declared maxPages and font size.");this.structure?.beginPage(this.current),this.y=l.height-d.top;const p=this.decorationText(f.pageHeader),T=this.decorationText(f.pageFooter);if(p&&d.top<g+4)throw new RangeError("Top margin is too small for a page header.");if((T||f.pageNumbers!==!1)&&d.bottom<g+4)throw new RangeError("Bottom margin is too small for page decorations.");const v=this.fonts.select(),E=((v.program?.ascent??800)+(v.program?.descent??-200))*h/2e3;this.decoration(p,d.left,l.height-d.top/2-E,l.width-d.left-d.right);const I=l.width-d.left-d.right-(f.pageNumbers!==!1?this.pageNumberWidth+this.settings.padding*2:0);if(I<=0&&T)throw new RangeError("Page is too narrow for both footer text and page numbers.");if(this.decoration(T,d.left,d.bottom/2-E,I),f.pageNumbers!==!1){const H=f.pageNumberLabels,W=H?.suffix??"",U=l.width-d.right-this.pageNumberWidth+1,J=d.bottom/2-E,Z=(H?.prefix??"Page ")+this.references.length+(H?.separator??" of "),j=m(Z,v,h,this.pageNumberWidth,this.settings.limits.maxCellCharacters,1,!1)[0];this.settings.budget.cell(Z+W),this.text(Z,v,h,U,J),this.add(this.artifact("q 1 0 0 1 "+O(U+j.width)+" "+O(J)+" cm /TotalPages Do Q\n","Pagination"))}for(const H of this.pendingBookmarks.splice(0))this.outlines?.add(H,this.current,this.y);this.references.length===1&&(f.title&&await this.paragraph(f.title,{bold:!0},h*1.5,!1,1),f.messageTop&&await this.paragraph(f.messageTop,{},h,!1));const P=t??(e&&this.layout?this.activeHeadings??=await this.layout.headers():[]),B=P.reduce((H,W)=>H+W.height,0),L=e&&this.layout?this.continuationCaption:void 0;if(L?.lines.length&&(this.continuationCaptionPaints++===0&&(this.tableCaptionOwner=this.captionAnnotations(L,this.tableCaptionOwner)),await this.paragraphs([L],B+g+this.settings.padding*2,!0,{artifact:!0,...this.tableCaptionOwner===void 0?{}:{annotationParent:this.tableCaptionOwner}})),this.continuationTop=l.height-d.top-B-(L?.height??0),this.y-B-g-this.settings.padding*2<d.bottom)throw new RangeError("PDF title and repeated headings leave no room for a data line.");e&&this.layout&&this.structure&&this.tableElement===void 0&&(this.tableElement=this.structure.element("Table",this.groupParent),this.tableStructure=new y(this.structure,this.tableElement,P),await this.tableStructure.prepareHeaders()),await this.drawHeadings(P),this.dataTop=this.y}async drawHeadings(e){for(const t of e){for(const f of t.cells)!this.bandCellBudget&&this.paintedHeaderBudgetCells.has(f.source??f)&&this.settings.budget.cell(this.settings.budget.limits.maxTextCharacters===void 0?"":f.lines.map(h=>h.text).join(""));const l=this.tableStructure?t.cells.map(f=>this.tableStructure.owner(f.source??f)):void 0,d=t.cells.map(f=>this.paintedHeaderCells.has(f.source??f));this.draw(t,0,t.lines,l,d);for(const f of t.cells)this.paintedHeaderCells.add(f.source??f),this.paintedHeaderBudgetCells.add(f.source??f)}}async rowElements(e){const t=e.source??e;return this.tableStructure?.prepareRow(t,"data",this.tableElement,this.summaryRows.has(t)?0:void 0)}draw(e,t,l,d,f=[]){if(!this.layout)throw new Error("A table layout is required before drawing rows.");this.bodyAdded=!0;const{padding:h,fontSize:g}=this.settings,p=O,T=l*e.lineHeight+h*2,v=this.layout.lefts;this.rectangleLefts!==v&&(this.rectangleLefts=v,this.rectangleColumns=[]);let E,I="",P="";for(const[B,L]of e.cells.entries()){this.bandCellBudget&&this.settings.budget.cell(this.settings.budget.limits.maxTextCharacters===void 0?"":(L.height===void 0?L.lines.slice(t,t+l):L.lines).map(A=>A.text).join(""));const H=v[L.first],W=L.height??T;W!==E&&(I=p(this.y-W),P=p(W),E=W);let U=this.rectangleColumns[L.first];(!U||U.x!==H||U.width!==L.width)&&(U={x:H,width:L.width,left:p(H),widthText:p(L.width)},this.rectangleColumns[L.first]=U);const J=U.left+" "+I+" "+U.widthText+" "+P;L.style.background&&this.add(this.artifact("q "+this.rgb(L.style.background)+" rg "+J+" re f Q\n")),this.add(this.artifact("q 0.82 0.85 0.89 RG 0.4 w "+J+" re S Q\n"));const Z=d?.[B],j=L.semanticArtifact||f[B],_=L.link&&this.structure&&Z!==void 0?this.structure.link(Z,L.link):Z;for(let A=t;A<Math.min(L.lines.length,L.height?L.lines.length:t+l);A++){const F=L.lines[A],V=L.style.alignment==="right"?L.width-h-F.width:L.style.alignment==="center"?(L.width-F.width)/2:h;this.inline(F,g,H+V,this.y-h-F.ascent-(A-t)*(e.structured?L.lineHeight:e.lineHeight),j?void 0:_,_)}L.link&&this.link(L.link,H,this.y-W,L.width,W,_)}this.y-=e.structured?e.height:T,this.sealCommands()}async block(e){if(this.bandFlow)return this.bandFlow.block(e);const t=e.reduce((d,f)=>d+f.height,0),l=this.settings.margins.bottom;if(t>this.y-l&&(await this.finishPage(),await this.start()),t>this.dataTop-l)throw new RangeError("A structured footer must fit on one page below the repeated headings.");for(const d of e){const f=await this.rowElements(d);this.draw(d,0,d.lines,f),await this.tableStructure?.completeRow(d.source??d)}}async row(e,t=!1){if(this.bandFlow)return this.bandFlow.row(e,t);const l=await this.rowElements(e),{margins:d,padding:f}=this.settings,h=this.continuationTop-d.bottom;!t&&e.height<=h+.001&&e.height>this.y-d.bottom+.001&&(await this.finishPage(),await this.start());let g=0;for(;g<e.lines;){let p=Math.min(e.lines-g,Math.floor((this.y-d.bottom-f*2+.001)/e.lineHeight));if(p<=0&&(await this.finishPage(),await this.start(),p=Math.min(e.lines-g,Math.floor((this.y-d.bottom-f*2+.001)/e.lineHeight))),p<=0)throw new RangeError("PDF page cannot fit a table line.");this.draw(e,g,p,l),g+=p,g<e.lines&&(await this.finishPage(),await this.start())}await this.tableStructure?.completeRow(e.source??e)}async keptRows(e,t=!1){if(this.bandFlow)return this.bandFlow.keptRows(e,t);const l=e.reduce((h,g)=>h+g.height,0),d=this.settings.margins.bottom,f=l<=this.continuationTop-d+.001;f&&l>this.y-d+.001&&(await this.finishPage(),await this.start());for(const[h,g]of e.entries())await this.row(g,!f&&h===0&&t)}async paragraph(e,t={},l=this.settings.fontSize,d=!0,f){await this.ensureStarted();const{margins:h,page:g,limits:p}=this.settings,T=this.fonts.select(t.bold,t.italic),v=T.lineHeight(l);this.settings.budget.cell(w(e,this.settings.budget));const E=await b(e,T,l,g.width-h.left-h.right,p.maxCellCharacters,p.maxRowLines,!0,this.settings.options.signal);if(v>g.height-h.top-h.bottom)throw new RangeError("PDF page cannot fit a paragraph line at the selected font metrics.");if(!d&&this.y-E.length*v-8<h.bottom)throw new RangeError("PDF title/message exceeds the first page's content area.");const I=this.structure?.element(f?"H"+f:"P");for(const P of E){this.y-v<h.bottom&&(await this.finishPage(),await this.start(!1));const B=t.alignment==="right"?g.width-h.right-P.width:t.alignment==="center"?h.left+(g.width-h.left-h.right-P.width)/2:h.left;this.bodyAdded=!0,this.text(P.text,T,l,B,this.y-(T.program?.ascent??800)*l/1e3,t.color,I),this.y-=v}this.y-=8,await this.structure?.complete(I)}async reserveSpace(e,t="Kept PDF content"){await this.ensureStarted();const{page:l,margins:d}=this.settings,f=l.height-d.top-d.bottom;if(e>f+.001)throw new RangeError(t+" exceeds a fresh page's content area.");e>this.y-d.bottom+.001&&await this.pageBreak()}async paragraphs(e,t=0,l=!1,d={}){const f=e.filter(g=>g.lines.length>0);if(!f.length)return;await this.ensureStarted();const h=new Array(f.length).fill(0);for(let g=f.length-1;g>=0;g--){const p=f[g],T=f[g+1];h[g]=p.keepWithNext?T?T.keepTogether||T.keepWithNext?T.height+h[g+1]:T.firstHeight:t:0}l&&f.length&&await this.reserveSpace(f.reduce((g,p)=>g+p.height,0)+h.at(-1),"Kept PDF paragraph group");for(const[g,p]of f.entries()){p.budgetOnPaint&&this.settings.budget.cell(w(p.text.text,this.settings.budget)),(p.keepTogether||p.keepWithNext)&&await this.reserveSpace(p.height+h[g],"Kept PDF paragraph chain");const{margins:T,page:v}=this.settings;if(p.firstHeight>v.height-T.top-T.bottom+.001)throw new RangeError("PDF page cannot fit a paragraph line and its leading spacing.");this.y-p.firstHeight<T.bottom&&await this.pageBreak(),this.y-=p.spaceBefore,p.bookmark&&this.addBookmark(p.bookmark);const E=d.artifact?void 0:d.owner??this.structure?.element(d.role??(p.headingLevel?"H"+p.headingLevel:"P"),d.parent??this.groupParent);let I=!0;for(const P of p.lines){if(P.lineHeight>v.height-T.top-T.bottom+.001)throw new RangeError("PDF page cannot fit a paragraph line at the selected font metrics.");this.y-P.lineHeight<T.bottom&&await this.pageBreak();const B=T.left+(d.indent??0),L=v.width-T.right-B,H=p.style.alignment==="right"?v.width-T.right-P.width:p.style.alignment==="center"?B+(L-P.width)/2:B;I&&d.marker&&this.inline(d.marker.line,p.size,B-d.marker.gap-d.marker.line.width,this.y-P.ascent,d.marker.owner),this.bodyAdded=!0,this.inline(P,p.size,H,this.y-P.ascent,E,d.annotationParent??E),this.y-=P.lineHeight,I=!1}this.y-=p.spaceAfter,d.keepOpen||await this.structure?.complete(E)}}get groupParent(){return this.groups.at(-1)?.element}async beginGroup(e,t,l){if(e!==this.groups.length)throw new Error("PDF analytical groups must open in hierarchical order.");await this.ensureStarted();const d=this.structure?.element("Sect",this.groupParent);this.groups.push({level:e,headingLevel:t.headingLevel??e+2,element:d}),await this.paragraphs([t],l,!0,{role:"H"+(t.headingLevel??e+2),...d===void 0?{}:{parent:d}})}async endGroup(e){const t=this.groups.at(-1);if(!t||t.level!==e)throw new Error("PDF analytical groups must close in hierarchical order.");await this.structure?.complete(t.element),this.outlines?.closeGroup(t.headingLevel),this.groups.pop()}summary(e){this.summaryRows.add(e)}async beginTable(e,t,l=e.lineHeight+this.settings.padding*2,d,f,h=!1,g=!1,p=!1){if(e.bands)return this.beginBands(e,t,l,d,f,g,p);await this.ensureStarted(),this.layout=e,this.paintedHeaderCells=new WeakSet,this.continuationCaption=f,this.continuationCaptionPaints=0,this.tableCaptionOwner=void 0,this.tableElement=this.structure?.element("Table",this.groupParent);const T=t??await e.headers();this.activeHeadings=T;const v=h&&this.bodyAdded&&!this.structure?[]:T,E=v.reduce((I,P)=>I+P.height,0);if(d&&!(g&&p)&&(await this.reserveSpace(d.height+E+l,"Kept PDF table caption and first data fragment"),this.tableCaptionOwner=g?this.captionAnnotations(d):d.lines.length?this.structure?.element("Caption",this.tableElement):void 0,await this.paragraphs([d],E+l,!0,g?{artifact:!0,...this.tableCaptionOwner===void 0?{}:{annotationParent:this.tableCaptionOwner}}:{role:"Caption",keepOpen:!0,...this.tableCaptionOwner===void 0?{}:{owner:this.tableCaptionOwner}})),this.structure&&(this.tableStructure=new y(this.structure,this.tableElement,T),await this.tableStructure.prepareHeaders()),this.y-E-l<this.settings.margins.bottom){await this.finishPage(),await this.start(!0,T);return}this.continuationTop=this.settings.page.height-this.settings.margins.top-T.reduce((I,P)=>I+P.height,0)-(f?.height??0),await this.drawHeadings(v),this.dataTop=this.y}async beginBands(e,t,l,d,f,h,g){await this.ensureStarted();const p=t??await e.headers(),T=await e.bandRows(p,!0),v=T[0].reduce((j,_)=>j+_.height,0),{page:E,margins:I,padding:P}=this.settings,B=E.height-I.top-I.bottom-v-(d?.height??0),L=l<=B+.001?l:e.lineHeight+P*2,H=E.height-I.top-I.bottom-v-(f?.height??0);if(H+.001<e.lineHeight+P*2)throw new RangeError("PDF band headings and continuation context leave no room for a data line.");let W=h&&g;this.y-I.bottom-v-(W?0:d?.height??0)+.001<L&&(await this.pageBreak(),W=!1);const U=this.y-I.bottom-v-(W?0:d?.height??0);if(U+.001<L)throw new RangeError("PDF band caption and headings leave no room for a data line.");let J=0;this.tableElement=this.structure?.element("Table",this.groupParent),this.paintedHeaderCells=new WeakSet;let Z=this.structure&&d?.lines.length?h?this.captionAnnotations(d):this.structure.element("Caption",this.tableElement):void 0;this.structure&&(this.tableStructure=new y(this.structure,this.tableElement,p)),this.layout=void 0,this.continuationCaption=void 0,this.activeHeadings=void 0,this.bandFlow=new k(e,T,{firstCapacity:U,firstFullCapacity:B,continuationCapacity:H,prepareRow:async j=>{await this.tableStructure?.prepareHeaders(),await this.rowElements(j)},completeRow:async j=>{await this.tableStructure?.completeRow(j.source??j)},moveFirstToFreshPage:async()=>{await this.pageBreak(),W=!1},paint:async(j,_,A,F,V,q)=>{V&&q||await this.pageBreak();const $=e.bands[j];this.layout={lefts:$.lefts,lineHeight:e.lineHeight,headers:async()=>_},this.bandCellBudget=!0;try{if(F?.lines.length&&!(V&&q&&W)){!V&&J++===0&&(Z=this.captionAnnotations(F,Z));const Q=Z;await this.paragraphs([F],v+L,!0,V&&q&&!h?{role:"Caption",keepOpen:!0,...Z===void 0?{}:{owner:Z}}:{artifact:!0,...Q===void 0?{}:{annotationParent:Q}})}await this.tableStructure?.prepareHeaders(),await this.drawHeadings(_),this.dataTop=this.y;for(const Q of A){R(this.settings.options.signal);const z=this.tableStructure?Q.cells.map(K=>this.tableStructure.owner(K.source??K)):void 0;this.draw(Q,0,Q.lines,z)}}finally{this.bandCellBudget=!1}}},d,f)}async endTable(){this.bandFlow&&(await this.bandFlow.flush(!0),this.bandFlow=void 0),await this.tableStructure?.finish(),this.layout=void 0,this.tableElement=void 0,this.tableStructure=void 0,this.activeHeadings=void 0,this.continuationCaption=void 0,this.tableCaptionOwner=void 0,this.continuationCaptionPaints=0,this.y-=8}captionAnnotations(e,t){if(!this.structure||!e.text.runs.some(d=>d.link&&d.text.trim()))return t;const l=t??this.structure.element("Caption",this.tableElement);for(const d of e.text.runs)d.link&&d.text.trim()&&this.structure.link(l,d.link,d.text);return l}async pageBreak(){await this.ensureStarted(),await this.finishPage(),await this.start(!1)}registerXObject(e,t){this.externalObjects.set(e,t)}opacityState(e){const t=O(e);let l=this.opacityStates.get(t);return l||(l="GA"+(this.opacityStates.size+1),this.opacityStates.set(t,l)),l}graphicsStates(){const e=[...this.opacityStates].map(([t,l])=>"/"+l+" << /ca "+t+" /CA "+t+" >>");return e.length?" /ExtGState << "+e.join(" ")+" >>":""}graphicHeight(e,t){const{page:l,margins:d}=this.settings;return t*Math.min(1,(l.width-d.left-d.right)/e,(l.height-d.top-d.bottom)/t)}async graphic(e,t,l,d,f,h){await this.ensureStarted();const{page:g,margins:p}=this.settings,T=g.width-p.left-p.right,v=Math.min(1,T/e,(g.height-p.top-p.bottom)/t);e*=v,t*=v;const E=this.structure&&f!==void 0?this.structure.element("Figure",void 0," /Alt <feff"+a(f)+">"):void 0;if(h){if(f===void 0)throw new TypeError("A captioned PDF graphic requires alternativeText and cannot be decorative.");await this.reserveSpace(h.height+t,"Kept PDF graphic and caption"),await this.paragraphs([h],t,!0,{role:"Caption",...E===void 0?{}:{parent:E}})}this.y-t<p.bottom&&await this.pageBreak();const I=l==="right"?g.width-p.right-e:l==="center"?p.left+(T-e)/2:p.left,P=d(I,this.y-t,e,t);this.bodyAdded=!0,this.add(this.structure&&E!==void 0?this.structure.mark(E)+P+"EMC\n":this.artifact(P)),this.y-=t+8,await this.structure?.complete(E)}async listItem(e,t){if(await this.ensureStarted(),this.structure&&t===void 0)throw new Error("A tagged list item requires a logical list owner.");const l=this.structure?.element("LI",t),d=l===void 0?void 0:this.structure.element("Lbl",l),f=l===void 0?void 0:this.structure.element("LBody",l);await this.paragraphs([e.paragraph],0,!1,{...f===void 0?{}:{parent:f},role:"P",indent:e.indent,marker:{line:e.marker,gap:e.markerGap,...d===void 0?{}:{owner:d}}}),await this.structure?.complete(l)}sealCommands(){this.commands&&(this.commandParts.push(this.commands),this.commands="")}takeCommands(){this.sealCommands();const e=this.commandParts.join("");return this.commandParts=[],e}async finishPage(){const e=this.objects.reserve(),{page:t,options:l}=this.settings;await this.objects.stream(e,this.takeCommands(),"",l.compression!==!1);const d=[];for(const f of this.annotations)d.push(f.id),await this.objects.object(f.id,f.body);await this.objects.object(this.current,"<< /Type /Page /Parent "+this.parent+" 0 R /MediaBox [0 0 "+O(t.width)+" "+O(t.height)+"] /Resources "+this.resources+" 0 R /Contents "+e+" 0 R"+(this.structure?.pageDictionary??"")+(d.length?" /Annots ["+d.map(f=>f+" 0 R").join(" ")+"]":"")+" >>"),this.structure&&await this.structure.finishPage(),this.annotations=[],this.commandBytes=0,this.current=0,await this.objects.flushBytes()}async finish(){if(this.bandFlow&&(await this.bandFlow.flush(!0),this.bandFlow=void 0),await this.ensureStarted(),await this.tableStructure?.finish(),await this.finishPage(),this.totalPages){const e=this.fonts.select(),t=String(this.references.length),l=t+(this.numberSettings.options.pageNumberLabels?.suffix??""),d=this.numberSettings.fontSize;this.settings.budget.cell(t);const f="BT /"+e.name+" "+O(d)+" Tf 1 0 0 1 0 0 Tm "+e.encode(l)+" Tj ET\n",h=m(l,e,d,this.numberSettings.page.width,this.settings.limits.maxCellCharacters,1,!1)[0].width,g=(e.program?.bbox[1]??-250)*d/1e3-1,p=(e.program?.bbox[3]??1e3)*d/1e3+1;await this.objects.stream(this.totalPages,f,"/Type /XObject /Subtype /Form /BBox [-1 "+O(g)+" "+O(h+1)+" "+O(p)+"] /Resources << /Font "+this.fonts.dictionary()+" >>",this.settings.options.compression!==!1)}}xobjects(){const e=[...this.externalObjects].map(([t,l])=>"/"+t+" "+l+" 0 R");return this.totalPages&&e.push("/TotalPages "+this.totalPages+" 0 R"),e.length?" /XObject << "+e.join(" ")+" >>":""}}const r=Object.freeze({PdfPages:s});return N.set("c16c0303d9d4be12ab9e0bab7cfdac73b252ed233c9689e3e0141cc8115aa941",r),r})(),ur=N.get("7a58e8ccb5164de51db14e39ca9695af6487c354df909509f0ae6bfac8ae3887")??(()=>{class S{objects;root;entries=[];levels=[];lastKey=-1;constructor(C,k){this.objects=C,this.root=k}async append(C,k){if(C<=this.lastKey)throw new Error("PDF ParentTree keys must be appended in increasing order.");this.lastKey=C,this.entries.push({key:C,value:k}),this.entries.length===64&&await this.leaf()}async leaf(){if(!this.entries.length)return;const C=this.objects.reserve(),k=this.entries[0].key,y=this.entries.at(-1).key,m="<< /Limits ["+k+" "+y+"] /Nums ["+this.entries.map(b=>b.key+" "+b.value+" 0 R").join(" ")+"] >>";this.entries.length=0,await this.objects.object(C,m),await this.node({id:C,first:k,last:y},0)}async node(C,k){const y=this.levels[k]??=[];if(y.push(C),y.length===64){const m=await this.branch(y);y.length=0,await this.node(m,k+1)}}async branch(C){const k=this.objects.reserve(),y=C[0].first,m=C.at(-1).last;return await this.objects.object(k,"<< /Limits ["+y+" "+m+"] /Kids ["+C.map(b=>b.id+" 0 R").join(" ")+"] >>"),{id:k,first:y,last:m}}async finish(){await this.leaf();for(let k=0;k<this.levels.length-1;k++){const y=this.levels[k];if(y.length){const m=await this.branch(y);y.length=0,await this.node(m,k+1)}}const C=this.levels.at(-1)??[];await this.objects.object(this.root,C.length?"<< /Kids ["+C.map(k=>k.id+" 0 R").join(" ")+"] >>":"<< /Nums [] >>")}}const R=Object.freeze({PdfParentTree:S});return N.set("7a58e8ccb5164de51db14e39ca9695af6487c354df909509f0ae6bfac8ae3887",R),R})(),Nt=N.get("1c1828a3d6dfc2edda674566203e7aa8e97c984114b7928df13cb373859977d0")??(()=>{const{OfficeIMOError:S}=pe,{checkAbort:R}=be,{unicodeHex:O}=Be,{PdfParentTree:C}=ur;function k(a){return typeof a=="number"?a<0?-a-1+" ":a+" 0 R ":a+" "}function y(a){return"<< /Type /StructElem /S /"+a.role+" /P "+a.parent+" 0 R"+(a.markedPage===void 0?"":" /Pg "+a.markedPage+" 0 R")+(a.identifier===void 0?"":" /ID ("+a.identifier+")")+" /K ["}function m(a,i){const c=32768-i.length-a.attributes.length-4;if(c<0)return;let o="";for(const s of a.children){const r=k(s);if(o.length+r.length>c)return;o+=r}return i+o+"]"+a.attributes+" >>"}class b{objects;root;entries=[];levels=[];lastKey="";constructor(i,c){this.objects=i,this.root=c}async append(i,c){if(i<=this.lastKey)throw new Error("PDF structure IDs must be appended in increasing order.");this.lastKey=i,this.entries.push({key:i,value:c}),this.entries.length===64&&await this.leaf()}async leaf(){if(!this.entries.length)return;const i=this.objects.reserve(),c=this.entries[0].key,o=this.entries.at(-1).key,s="<< /Limits [("+c+") ("+o+")] /Names ["+this.entries.map(r=>"("+r.key+") "+r.value+" 0 R").join(" ")+"] >>";this.entries.length=0,await this.objects.object(i,s),await this.node({id:i,first:c,last:o},0)}async node(i,c){const o=this.levels[c]??=[];if(o.push(i),o.length===64){const s=await this.branch(o);o.length=0,await this.node(s,c+1)}}async branch(i){const c=this.objects.reserve(),o=i[0].first,s=i.at(-1).last;return await this.objects.object(c,"<< /Limits [("+o+") ("+s+")] /Kids ["+i.map(r=>r.id+" 0 R").join(" ")+"] >>"),{id:c,first:o,last:s}}async finish(){await this.leaf();for(let c=0;c<this.levels.length-1;c++){const o=this.levels[c];if(o.length){const s=await this.branch(o);o.length=0,await this.node(s,c+1)}}const i=this.levels.at(-1)??[];await this.objects.object(this.root,i.length?"<< /Kids ["+i.map(c=>c.id+" 0 R").join(" ")+"] >>":"<< /Names [] >>")}}class x{objects;settings;root;document;parentTree;elements=new Map;parentTreeWriter;annotations=[];links=new WeakMap;identifiers;pageParents=[];pageId=0;pageKey=0;nextParentKey=0;references=0;allocated=0;section;constructor(i,c){this.objects=i,this.settings=c,this.root=i.reserve(),this.parentTree=i.reserve(),this.parentTreeWriter=new C(i,this.parentTree),this.document=this.element("Document",this.root)}element(i,c=this.section??this.document,o=""){if(R(this.settings.options.signal),++this.allocated>this.settings.limits.maxStructureElements)throw new S("RESOURCE_LIMIT","maxStructureElements exceeded.");const s=this.objects.reserve(),r={id:s,parent:c,role:i,children:[],attributes:o};this.elements.set(s,r);const n=this.elements.get(c);return i==="Caption"&&n?.role==="Table"?n.children.unshift(s):n?.children.push(s),s}setAttributes(i,c){const o=this.elements.get(i);if(!o)throw new Error("PDF structure attributes require an open logical owner.");o.attributes=c}async attributeReference(i){R(this.settings.options.signal);const c=this.objects.reserve();return await this.objects.object(c,i)," /A "+c+" 0 R"}async beginSection(){await this.complete(this.section),this.section=this.element("Sect",this.document)}async identifier(i){R(this.settings.options.signal);const c=this.elements.get(i);if(!c)throw new Error("PDF structure IDs require an open logical owner.");if(c.identifier!==void 0)return c.identifier;const o="e"+String(i).padStart(16,"0");return this.identifiers??=new b(this.objects,this.objects.reserve()),await this.identifiers.append(o,i),c.identifier=o,o}beginPage(i){this.pageId=i,this.pageParents=[],this.pageKey=this.nextParentKey++}link(i,c,o){let s=this.links.get(c);s||(s=new Map,this.links.set(c,s));const r=s.get(i);if(r!==void 0)return r;const n=this.element("Link",i,o===void 0?"":" /Alt <feff"+O(o)+">");s.set(i,n);const e=this.elements.get(i);return(e.linkIdentities??=[]).push(c),n}annotation(i,c){R(this.settings.options.signal);const o=this.elements.get(i);if(!o||o.role!=="Link")throw new Error("Tagged link annotations require a logical Link owner.");const s=this.nextParentKey++;return o.children.push("<< /Type /OBJR /Obj "+c+" 0 R /Pg "+this.pageId+" 0 R >>"),this.annotations.push({key:s,owner:i}),s}mark(i,c){if(++this.references>this.settings.limits.maxMarkedContentReferences)throw new S("RESOURCE_LIMIT","maxMarkedContentReferences exceeded.");const o=this.elements.get(i);if(!o)throw new Error("Marked content requires an open logical owner.");const s=this.pageParents.length;return this.pageParents.push(i),o.markedPage??=this.pageId,o.children.push(o.markedPage===this.pageId?-(s+1):"<< /Type /MCR /Pg "+this.pageId+" 0 R /MCID "+s+" >>"),"/"+o.role+" << /MCID "+s+(c===void 0?"":" /ActualText <FEFF"+O(c)+">")+" >> BDC\n"}get pageDictionary(){return" /StructParents "+this.pageKey+" /Tabs /S"}get catalogDictionary(){return" /MarkInfo << /Marked true >> /Lang <feff"+O(this.settings.options.tagged.language)+"> /StructTreeRoot "+this.root+" 0 R"}async finishPage(){const i=this.objects.reserve();await this.objects.object(i,"["+this.pageParents.map(c=>c+" 0 R").join(" ")+"]"),await this.parentTreeWriter.append(this.pageKey,i);for(const c of this.annotations)await this.parentTreeWriter.append(c.key,c.owner);this.annotations.length=0,this.pageParents=[]}async complete(i){if(i===void 0)return;const c=this.elements.get(i);if(!c)return;for(const r of c.children)typeof r=="number"&&r>0&&!this.completeBuffered(r)&&await this.complete(r);R(this.settings.options.signal);const o=y(c),s=m(c,o);s!==void 0?this.objects.tryCompactObject(i,s)||await this.objects.compactObject(i,s):await this.objects.object(i,this.body(c,o)),this.releaseElement(c)}completeBuffered(i){const c=this.elements.get(i);if(!c)return!0;for(const s of c.children)if(typeof s=="number"&&s>0&&!this.completeBuffered(s))return!1;R(this.settings.options.signal);const o=m(c,y(c));return o===void 0||!this.objects.tryCompactObject(i,o)?!1:(this.releaseElement(c),!0)}releaseElement(i){if(i.linkIdentities)for(const c of i.linkIdentities){const o=this.links.get(c);o?.delete(i.id),o?.size||this.links.delete(c)}this.elements.delete(i.id)}*body(i,c){yield c;for(const o of i.children)yield k(o);yield"]"+i.attributes+" >>"}async completeRow(i){i?.length&&await this.complete(this.elements.get(i[0])?.parent)}async finish(){await this.complete(this.document),await this.parentTreeWriter.finish(),await this.identifiers?.finish(),await this.objects.object(this.root,"<< /Type /StructTreeRoot /K ["+this.document+" 0 R] /ParentTree "+this.parentTree+" 0 R /ParentTreeNextKey "+this.nextParentKey+(this.identifiers?" /IDTree "+this.identifiers.root+" 0 R":"")+" >>")}}function w(a,i){const c=a.decorative,o=a.alternativeText;if(c!==void 0&&typeof c!="boolean")throw new TypeError("Graphic decorative must be boolean.");if(o!==void 0){if(typeof o!="string"||!o.trim())throw new TypeError("Graphic alternativeText must be nonempty text.");if(o.length>i.limits.maxCellCharacters)throw new S("RESOURCE_LIMIT","maxCellCharacters exceeded by graphic alternativeText.");if(O(o),c)throw new TypeError("A decorative graphic cannot also have alternativeText.")}if(i.options.tagged&&o===void 0&&c!==!0)throw new TypeError("Tagged PDF graphics require alternativeText or decorative:true.");return i.options.tagged&&o!==void 0&&i.budget.cell(o),o}const u=Object.freeze({PdfStructure:x,graphicAlternative:w});return N.set("1c1828a3d6dfc2edda674566203e7aa8e97c984114b7928df13cb373859977d0",u),u})(),pr=N.get("52c78ca6833cee7e5a96b657e2c00172d550176daf2c95e742692f8416977bea")??(()=>{const{OfficeIMOError:S}=pe,{checkAbort:R}=be,{pdfNumber:O,unicodeHex:C}=Be;class k{objects;settings;root;items=[];top=[];stack=[];constructor(b,x){this.objects=b,this.settings=x}add(b,x,w){if(R(this.settings.options.signal),this.items.length>=this.settings.limits.maxBookmarks)throw new S("RESOURCE_LIMIT","maxBookmarks exceeded.");this.root??=this.objects.reserve();const u=b.level??1;for(;this.stack.length&&this.stack.at(-1).level>=u;)this.stack.pop();const a=this.stack.at(-1),i=a?.children??this.top,c=i.at(-1),o={id:this.objects.reserve(),title:b.title,page:x,y:w,level:u,parent:a?.id??this.root,children:[],previous:c?.id,next:void 0};c&&(c.next=o.id),i.push(o),this.items.push(o),this.stack.push(o)}get count(){return this.items.length}closeGroup(b){for(;this.stack.length&&this.stack.at(-1).level>=b;)this.stack.pop()}get catalogDictionary(){return this.root===void 0?"":" /Outlines "+this.root+" 0 R"}async finish(){if(this.root===void 0)return;const b=new Map;for(const x of[...this.items].reverse())b.set(x.id,x.children.reduce((w,u)=>w+1+b.get(u.id),0));for(const x of this.items)R(this.settings.options.signal),await this.objects.object(x.id,"<< /Title <feff"+C(x.title)+"> /Parent "+x.parent+" 0 R"+(x.previous===void 0?"":" /Prev "+x.previous+" 0 R")+(x.next===void 0?"":" /Next "+x.next+" 0 R")+(x.children.length?" /First "+x.children[0].id+" 0 R /Last "+x.children.at(-1).id+" 0 R /Count "+b.get(x.id):"")+" /Dest ["+x.page+" 0 R /XYZ null "+O(x.y)+" null] >>");await this.objects.object(this.root,"<< /Type /Outlines /First "+this.top[0].id+" 0 R /Last "+this.top.at(-1).id+" 0 R /Count "+this.items.length+" >>")}}const y=Object.freeze({PdfOutlines:k});return N.set("52c78ca6833cee7e5a96b657e2c00172d550176daf2c95e742692f8416977bea",y),y})(),_t=N.get("3de6cb5a744388b84e9e2295a2e580e70ab993d44bbb4c94da5f98daba11c350")??(()=>{const{PdfObjects:S,unicodeHex:R}=Be,{PdfFontResources:O}=sr,{PdfTableLayout:C}=St,{PdfPages:k}=fr,{PdfStructure:y}=Nt,{PdfOutlines:m}=pr;class b{settings;objects;fonts;pages;layout;structure;outlines;root;parent;resources;info;constructor(u,a,i=!1){this.settings=a,this.objects=new S(u,a.options.signal,a.budget.limits.maxOutputBytes,a.options.compression!==!1),this.root=this.objects.reserve(),this.parent=this.objects.reserve(),this.resources=this.objects.reserve(),this.info=this.objects.reserve(),this.structure=a.options.tagged?new y(this.objects,a):void 0,this.outlines=new m(this.objects,a),this.fonts=new O(this.objects,a.options.fonts,a.limits.maxFontBytes,a.options.signal),this.layout=i?new C(a,this.fonts):void 0,this.pages=new k(this.objects,a,this.fonts,this.parent,this.resources,this.layout,this.structure,this.outlines)}async start(){await this.objects.text("%PDF-1.7\n"),await this.objects.raw(Uint8Array.of(37,226,227,207,211,10)),this.layout?.bands?await this.pages.beginTable(this.layout):this.layout&&await this.pages.start(!0)}async finish(){const{options:u}=this.settings,{objects:a,fonts:i,pages:c}=this;await c.finish();for(const s of i.resources)await s.write(a,u.compression!==!1);await a.object(this.resources,"<< /Font "+i.dictionary()+c.xobjects()+c.graphicsStates()+" >>"),await a.object(this.parent,"<< /Type /Pages /Count "+c.references.length+" /Kids ["+c.references.map(s=>s+" 0 R").join(" ")+"] >>"),this.structure&&await this.structure.finish(),await this.outlines.finish(),await a.object(this.root,"<< /Type /Catalog /Pages "+this.parent+" 0 R"+(this.structure?.catalogDictionary??"")+this.outlines.catalogDictionary+" >>");const o=u.metadataTitle??u.title;await a.object(this.info,"<< /Producer (OfficeIMO.js)"+(o===void 0?"":" /Title <feff"+R(o)+">")+" >>"),await a.finish(this.root,this.info)}}const x=Object.freeze({PdfWriteSession:b});return N.set("3de6cb5a744388b84e9e2295a2e580e70ab993d44bbb4c94da5f98daba11c350",x),x})(),Ut=N.get("01ffda1779a340d72e953fd6e02429f341c89fcab28eb0fce4dc8beb65a5fd43")??(()=>{const{BlobByteSink:S,withDestination:R}=Oe,{beginTask:O,checkAbort:C,consumeRows:k,pause:y,taskYieldDue:m}=be,{notifyProgress:b}=Ke,{createRowProjector:x}=Ge,{settings:w}=De,{PdfWriteSession:u}=_t;async function a(o,s){const r=new S;try{return await i(o,r,s),r.toBlob("application/pdf")}catch(n){throw r.discard(),n}}async function i(o,s,r){const n=w(r),{options:e,budget:t}=n;return O(),C(e.signal),R(s,async l=>{const d=new u(l,n,!0),{objects:f,pages:h}=d,g=d.layout,p=x(e.columns,void 0,e.signal);let T=0;await d.start();const v=()=>{if(T++,T%256===0&&(b(e.onProgress,{phase:"rows",rows:T,bytes:f.bytes}),m()))return y().then(()=>{C(e.signal)});C(e.signal)};await k(o,e.signal,async I=>{t.row(T+1);const P=p(I,T);return h.row(await g.data(P,T)).then(v)});const E=await g.footer(T);return E&&(e.footer?.rows?await h.block(E):await h.row(E[0])),g.bands&&await h.endTable(),e.messageBottom&&await h.paragraph(e.messageBottom),await d.finish(),b(e.onProgress,{phase:"complete",rows:T,bytes:f.bytes}),C(e.signal),{rows:T,columns:e.columns.length,bytes:f.bytes}})}const c=Object.freeze({writePdf:a,writePdfTo:i});return N.set("01ffda1779a340d72e953fd6e02429f341c89fcab28eb0fce4dc8beb65a5fd43",c),c})(),mr=N.get("6b0244b5ec6d550c705b4e4cbb47997331f1ecd99e2bf8a06f7c646eebbffbf8")??(()=>{const{NotSupportedError:S,OfficeIMOError:R}=pe,{checkAbort:O,pause:C,taskYieldDue:k,withAbort:y}=be,{Crc32:m}=bt,b=[137,80,78,71,13,10,26,10],x=new Set(["PLTE","tRNS","iCCP","sRGB","gAMA","cHRM","cICP","mDCV","cLLI","sBIT","eXIf","acTL","fcTL","fdAT"]);async function w(t,l,d){O(d);const f=l.width*l.height,h=await s(t,l,d);O(d);let g;try{if(typeof DecompressionStream!="function")throw new TypeError("Missing DecompressionStream");g=new DecompressionStream("deflate")}catch(F){throw new R("PLATFORM_UNAVAILABLE",'PNG intake requires native DecompressionStream("deflate").',{cause:F})}const{width:p,height:T,components:v}=h,E=p*v,I=(E+1)*T,P=new Uint8Array(p*T*3),B=v===4?new Uint8Array(f):void 0;let L=v===4?new Uint8Array(E):void 0,H=v===4?new Uint8Array(E):void 0;const W=u(t,h,d).pipeThrough(g).getReader();let U=0,J=0,Z=0,j=0,_=0,A=0;try{for(;;){const F=await y(W.read(),d).catch(V=>{throw O(d),new TypeError("Invalid PNG zlib image data.",{cause:V})});if(O(d),F.done)break;if(F.value.length>I-U)throw new TypeError("PNG inflated bytes exceed the exact IHDR scanline length.");for(let V=0;V<F.value.length;V++){const q=F.value[V];if(_===0){if(A=q,A>4)throw new TypeError("Invalid PNG scanline filter.")}else{const $=_-1;let Q=q;if(A!==0){const z=_>v?H?H[$-v]:P[J-v]:0,K=L?L[$]:J>=E?P[J-E]:0,Y=_>v?L?L[$-v]:J>=E?P[J-E-v]:0:0;Q=q+(A===1?z:A===2?K:A===3?Math.floor((z+K)/2):n(z,K,Y))&255}H?H[$]=Q:P[J]=Q,J++}if(_===E){if(_=0,H&&B){for(let Q=0;Q<E;Q+=4)P[Z++]=H[Q],P[Z++]=H[Q+1],P[Z++]=H[Q+2],B[j++]=H[Q+3],(Q&16383)===16380&&(k()&&await C(),O(d));const $=H;H=L,L=$}}else _++;(V&16383)===16383&&(k()&&await C(),O(d))}U+=F.value.length,k()&&await C(),O(d)}if(U!==I)throw new TypeError("PNG inflated bytes must match the exact IHDR scanline length.");return await a(t,h,I,d),{width:p,height:T,components:3,data:P,...B?{alpha:B}:{}}}catch(F){throw W.cancel(F).catch(()=>{}),F}finally{W.releaseLock()}}function u(t,l,d,f=!1){const h=new DataView(t.buffer,t.byteOffset,t.byteLength);let g=l.firstData,p=g+8,T=p+h.getUint32(g);return new ReadableStream({pull(v){for(O(d);p===T;){if(g=T+4,g===l.dataEnd){v.close();return}p=g+8,T=p+h.getUint32(g)}if(f&&p===l.lastDataByte){v.enqueue(Uint8Array.of(t[p++]^1));return}const E=Math.min(T,p+4096,f&&p<l.lastDataByte?l.lastDataByte:T);v.enqueue(t.subarray(p,E)),p=E}},{highWaterMark:0})}async function a(t,l,d,f){const h=u(t,l,f,!0).pipeThrough(new DecompressionStream("deflate")).getReader();let g=!1,p=0;try{for(;;){let T;try{T=await y(h.read(),f)}catch{O(f),g=!0;break}if(O(f),T.done)break;if(p+=T.value.length,p>d)throw new TypeError("Invalid PNG zlib image data.");k()&&await C(),O(f)}if(!g)throw new TypeError("Invalid PNG zlib image data: trailing bytes after the checksum.")}finally{h.cancel().catch(()=>{}),h.releaseLock()}}function i(t,l,d){if(d+12>t.length)throw new TypeError("Truncated PNG chunk.");const f=l.getUint32(d),h=d+12+f;if(f>2147483647||h>t.length)throw new TypeError("Truncated or oversized PNG chunk.");const g=String.fromCharCode(...t.subarray(d+4,d+8));if(!/^[A-Za-z]{2}[A-Z][A-Za-z]$/.test(g))throw new TypeError("Invalid PNG chunk type.");return{length:f,end:h,type:g}}function c(t){if(x.has(t))throw new S("PNG chunk "+t+"; normalize color, orientation, transparency or animation first");if(t.charCodeAt(0)<97)throw new S("Required PNG chunk "+t)}function o(t){const l=r(t,1/0),d=new DataView(t.buffer,t.byteOffset,t.byteLength);let f=!1,h=!1;for(let g=33;g<t.length;){const{length:p,end:T,type:v}=i(t,d,g);if(v==="IEND"){if(p===0&&f&&T===t.length)return l;break}if(v==="IDAT"){if(h)throw new TypeError("PNG IDAT chunks must be consecutive.");f=!0}else c(v),h||=f;g=T}throw new TypeError("PNG requires a final empty IEND after IDAT.")}async function s(t,l,d){const f=new DataView(t.buffer,t.byteOffset,t.byteLength);let h=0,g=0,p=-1,T=!1;for(let v=8;v<t.length;){O(d);const{length:E,end:I,type:P}=i(t,f,v),B=new m;for(let L=v+4;L<I-4;L+=65536)B.update(t.subarray(L,Math.min(I-4,L+65536))),k()&&await C(),O(d);if(B.value!==f.getUint32(I-4))throw new TypeError("PNG chunk CRC mismatch: "+P+".");if(v===8&&P!=="IHDR")throw new TypeError("PNG IHDR must be the first chunk.");if(P==="IHDR"){if(v!==8||E!==13)throw new TypeError("PNG requires one 13-byte IHDR first.")}else if(P==="IDAT"){if(T)throw new TypeError("PNG IDAT chunks must be consecutive.");h||=v,g=I,E&&(p=I-5)}else{if(h&&(T=!0),P==="IEND"){if(E!==0||!h||I!==t.length)throw new TypeError("PNG requires a final empty IEND after IDAT.");return{...l,firstData:h,dataEnd:g,lastDataByte:p}}c(P)}v=I}throw new TypeError("PNG requires a complete final IEND chunk.")}function r(t,l,d){if(t.length<33||b.some((v,E)=>t[E]!==v))throw new TypeError("Invalid PNG signature or truncated IHDR.");const f=new DataView(t.buffer,t.byteOffset,t.byteLength);if(f.getUint32(8)!==13||String.fromCharCode(...t.subarray(12,16))!=="IHDR")throw new TypeError("PNG requires one 13-byte IHDR first.");const h=f.getUint32(16),g=f.getUint32(20);if(!h||!g||h>2147483647||g>2147483647)throw new TypeError("Invalid PNG dimensions.");if(!Number.isSafeInteger(h*g)||h*g>l)throw new R("RESOURCE_LIMIT","PNG dimensions exceed maxImagePixels.");if(t[24]!==8||![2,6].includes(t[25]))throw new S("PNG intake requires 8-bit RGB or RGBA pixels");if(t[26]!==0||t[27]!==0)throw new S("PNG compression or filter method");if(t[28]!==0)throw new S("Interlaced PNG intake");const p=t[25]===6?4:3;if(!Number.isSafeInteger((h*p+1)*g)||(h*p+1)*g>2147483647)throw new R("RESOURCE_LIMIT","PNG filtered data exceeds the supported decoded byte length.");const T=t.length+h*g*p+(p===4?h*8:0);if(d!==void 0&&T>d)throw new R("RESOURCE_LIMIT","maxImageWorkingBytes exceeded by PNG source, image planes and scanlines.");return{width:h,height:g,components:p}}function n(t,l,d){const f=t+l-d,h=Math.abs(f-t),g=Math.abs(f-l),p=Math.abs(f-d);return h<=g&&h<=p?t:g<=p?l:d}const e=Object.freeze({pngPixels:w,pngEmbeddableSize:o,pngShape:r});return N.set("6b0244b5ec6d550c705b4e4cbb47997331f1ecd99e2bf8a06f7c646eebbffbf8",e),e})(),gr=N.get("32ca4982f963f400829c2e364b7d3479f36d91740dafb32d600f29b5cac487ec")??(()=>{const{NotSupportedError:S,OfficeIMOError:R}=pe,{checkAbort:O,pause:C,taskYieldDue:k}=be,{pngPixels:y,pngShape:m}=mr;class b{objects;settings;images=new Map;snapshots=new WeakMap;bytes=0;pendingBytes=0;constructor(a,i){this.objects=a,this.settings=i}snapshot(a){if(this.images.has(a)||this.snapshots.has(a))return;const i=this.capture(a);this.snapshots.set(a,i),this.pendingBytes+=i.data.length}capture(a){const{limits:i,options:c}=this.settings;if(O(c.signal),!a||typeof a!="object")throw new TypeError("PDF images require a byte array.");const o=a.format,s=o==="rgb"||o==="rgba"?a:void 0,r=s?.width,n=s?.height,e=a.data;if(!(e instanceof Uint8Array))throw new TypeError("PDF images require a byte array.");const t=e.length;if(this.bytes+this.pendingBytes+t>i.maxImageBytes)throw new R("RESOURCE_LIMIT","maxImageBytes exceeded.");const l=i.maxImageWorkingBytes;if(o==="png"){const p=m(e,i.maxImagePixels,l);return{format:o,shape:p,data:new Uint8Array(e)}}let d;if(o==="jpeg")d=x(e);else if(o==="rgb"||o==="rgba")d={width:r,height:n,components:o==="rgba"?4:3};else throw new S("PDF images support unprofiled PNG/JPEG or decoded RGB/RGBA pixels.");const{width:f,height:h,components:g}=d;if(!Number.isSafeInteger(f)||!Number.isSafeInteger(h)||f<1||h<1||!Number.isSafeInteger(f*h)||f*h>i.maxImagePixels)throw new R("RESOURCE_LIMIT","Image dimensions must be positive integers within maxImagePixels.");if(o!=="jpeg"&&t!==f*h*g)throw new RangeError("Raw image bytes must match width × height × channels exactly.");if(l!==void 0&&t+(g===4?f*h:0)>l)throw new R("RESOURCE_LIMIT","maxImageWorkingBytes exceeded by image snapshot and alpha plane.");return{format:o,shape:d,data:new Uint8Array(e)}}async prepare(a){const i=this.images.get(a);if(i)return i;const{options:c}=this.settings,o=this.snapshots.get(a),s=o??this.capture(a);o&&(this.snapshots.delete(a),this.pendingBytes-=s.data.length),this.bytes+=s.data.length;const{format:r}=s,n=r==="png"?await y(s.data,s.shape,c.signal):void 0,{width:e,height:t,components:l}=n??s.shape;O(c.signal);const d=this.objects.reserve(),f="Image"+(this.images.size+1),h=n?.data??s.data,g=n?.alpha;let p=h,T=g,v;if(l===4){p=h.subarray(0,e*t*3),T=new Uint8Array(e*t);for(let B=0;B<T.length;B++)p[B*3]=h[B*4],p[B*3+1]=h[B*4+1],p[B*3+2]=h[B*4+2],T[B]=h[B*4+3],(B&16383)===16383&&(k()&&await C(),O(c.signal))}T&&(v=this.objects.reserve(),await this.objects.stream(v,T,"/Type /XObject /Subtype /Image /Width "+e+" /Height "+t+" /ColorSpace /DeviceGray /BitsPerComponent 8",c.compression!==!1,!0));const E=r==="jpeg"?" /Filter /DCTDecode"+(s.shape.colorTransform===0?" /DecodeParms << /ColorTransform 0 >>":""):"",I="/Type /XObject /Subtype /Image /Width "+e+" /Height "+t+" /ColorSpace /"+(l===1?"DeviceGray":"DeviceRGB")+" /BitsPerComponent 8"+(v?" /SMask "+v+" 0 R":"")+E;await this.objects.stream(d,p,I,r==="jpeg"?!1:c.compression!==!1,!0);const P={name:f,id:d,width:e,height:t};return this.images.set(a,P),P}}function x(u){if(u.length<4||u[0]!==255||u[1]!==216||u[u.length-2]!==255||u[u.length-1]!==217)throw new TypeError("JPEG images need complete SOI/EOI markers.");let a,i=!1,c=!1;for(let o=2;o<u.length;){if(u[o++]!==255)throw new TypeError("Invalid JPEG marker.");for(;u[o]===255;)o++;const s=u[o++];if(s===218){if(!a)throw new TypeError("JPEG scan precedes its frame header.");return i&&!c?{...a,colorTransform:0}:a}if(s===217)break;if(o+2>u.length)throw new TypeError("Truncated JPEG segment.");const r=u[o]*256+u[o+1],n=o+r;if(r<2||n>u.length)throw new TypeError("Truncated JPEG segment.");if(s===238&&r>=14&&String.fromCharCode(...u.subarray(o+2,o+7))==="Adobe"&&(c=!0),s===226&&r>=14&&String.fromCharCode(...u.subarray(o+2,o+14))==="ICC_PROFILE\0")throw new S("Normalize ICC-profiled JPEG colors before PDF embedding.");if(s===225&&r>=8&&String.fromCharCode(...u.subarray(o+2,o+8))==="Exif\0\0")throw new S("Normalize JPEG EXIF orientation before PDF embedding.");if(s>=192&&s<=207&&![196,200,204].includes(s)){if(![192,193,194].includes(s)||r<8||u[o+2]!==8)throw new S("PDF JPEG images require 8-bit baseline, sequential or progressive frames.");const e=u[o+7];if(![1,3].includes(e)||r!==8+e*3)throw new S("PDF JPEG images require grayscale or RGB components; CMYK is unsupported.");if(e===3){const t=[u[o+8],u[o+11],u[o+14]].join(",");if(i=t==="82,71,66",t!=="1,2,3"&&!i)throw new S("Unsupported JPEG component color layout.")}if(a)throw new S("Multiple JPEG frame headers are unsupported.");a={width:u[o+5]*256+u[o+6],height:u[o+3]*256+u[o+4],components:e}}o=n}throw new TypeError("JPEG image has no complete frame and scan.")}const w=Object.freeze({PdfDocumentImages:b,jpegSize:x});return N.set("32ca4982f963f400829c2e364b7d3479f36d91740dafb32d600f29b5cac487ec",w),w})(),wr=N.get("9ba2dfd6f5c8ef9b1a51427ddee0d0971b139afdd49a175bf6525812ca7d87c8")??(()=>{const{OfficeIMOError:S}=pe,{checkAbort:R,pause:O,taskYieldDue:C}=be,{color:k,positive:y}=De,{pdfNumber:m}=Be;async function b(w,u,a){const i=y(w.width,"Vector width"),c=y(w.height,"Vector height"),o=w.commands;if(!Array.isArray(o))throw new TypeError("Vector commands must be an array.");if(a+o.length>u.limits.maxVectorCommands)throw new S("RESOURCE_LIMIT","maxVectorCommands exceeded.");const s=o.map(T=>{if(!T||typeof T!="object")throw new TypeError("Invalid vector command.");const v=T.op;if(v==="move"||v==="line")return{op:v,x:T.x,y:T.y};if(v==="cubic")return{op:v,x1:T.x1,y1:T.y1,x2:T.x2,y2:T.y2,x:T.x,y:T.y};if(v==="close")return{op:v};throw new TypeError("Unsupported vector command.")}),r=w.fill,n=w.stroke,e=r===void 0?void 0:k(r),t=n===void 0?void 0:k(n);if(e===void 0&&t===void 0)throw new TypeError("A vector path requires fill or stroke.");const l=y(w.strokeWidth??1,"Vector stroke width",144),d=w.fillRule;if(d!==void 0&&!["nonzero","evenodd"].includes(d))throw new TypeError("Invalid vector fill rule.");const f=[];let h=0,g=!1;const p=(T,v)=>{if(!Number.isFinite(T)||T<0||T>v)throw new RangeError("Vector coordinates must stay inside their declared bounds.");return m(T)};for(let T=0;T<s.length;T++){const v=s[T];let E;if(!v||typeof v!="object")throw new TypeError("Invalid vector command.");if(v.op==="move"||v.op==="line"){if(v.op==="line"&&!g)throw new TypeError("A vector subpath must begin with move.");E=p(v.x,i)+" "+p(v.y,c)+(v.op==="move"?" m\n":" l\n"),g=!0}else if(v.op==="cubic"){if(!g)throw new TypeError("A vector subpath must begin with move.");E=[p(v.x1,i),p(v.y1,c),p(v.x2,i),p(v.y2,c),p(v.x,i),p(v.y,c)].join(" ")+" c\n"}else if(v.op==="close"){if(!g)throw new TypeError("Cannot close an empty vector path.");E="h\n"}else throw new TypeError("Unsupported vector command.");if(h+=E.length,h>u.limits.maxPageBytes-256)throw new S("RESOURCE_LIMIT","maxPageBytes exceeded by vector commands.");f.push(E),(T&1023)===1023&&(C()&&await O(),R(u.options.signal))}if(!g)throw new TypeError("A vector path needs at least one command.");return{width:i,height:c,count:s.length,content:(e===void 0?"":e+" rg\n")+(t===void 0?"":t+" RG\n"+m(l)+" w\n")+f.join("")+(e!==void 0&&t!==void 0?"B":e!==void 0?"f":"S")+(e!==void 0&&d==="evenodd"?"*":"")+"\n"}}const x=Object.freeze({vectorCommands:b});return N.set("9ba2dfd6f5c8ef9b1a51427ddee0d0971b139afdd49a175bf6525812ca7d87c8",x),x})(),br=N.get("da0657c49ac1393409d051be5e5dd70d2a0dc5221d363b422d7da31e9b940ea2")??(()=>{const{NotSupportedError:S,OfficeIMOError:R}=pe,{checkAbort:O,pause:C,taskYieldDue:k}=be,{color:y,pdfDrawingMaxDepth:m,positive:b}=De,{pdfNumber:x}=Be;function w(e,t,l){if(!e||typeof e!="object"||Array.isArray(e)||Reflect.ownKeys(e).some(d=>typeof d!="string"||!t.includes(d)))throw new TypeError("Unsupported "+l+" properties.");return e}function u(e){w(e,["kind","drawing","alignment","alternativeText","decorative","caption"],"drawing block")}function a(e){if(typeof e!="number"||!Number.isFinite(e)||Math.abs(e)>1e6)throw new RangeError("Drawing coordinates must be finite and within -1,000,000 through 1,000,000 points.");return e}function i(e){const t=w(e,["x","y","width","height"],"drawing clip");return{x:a(t.x),y:a(t.y),width:b(t.width,"Drawing clip width",1e6),height:b(t.height,"Drawing clip height",1e6)}}function c(e,t){if(e===void 0){if(t!==void 0)throw new TypeError("Drawing dashOffset requires dash.");return""}if(!Array.isArray(e)||!e.length||e.length>16)throw new TypeError("Drawing dash must list 1 through 16 nonnegative lengths with at least one positive length.");const l=Array.from(e,f=>{if(typeof f!="number"||!Number.isFinite(f)||f<0||f>14400)throw new TypeError("Drawing dash lengths must be from 0 through 14,400 points.");return x(f)});if(l.every(f=>f==="0"))throw new TypeError("Drawing dash needs a positive length after PDF rounding.");let d=a(t??0);if(d<0){const f=l.reduce((h,g)=>h+Math.round(Number(g)*1e3),0)*(l.length%2?2:1);d=(Math.round(d*1e3)%f+f)%f/1e3}return"["+l.join(" ")+"] "+x(d)+" d\n"}async function o(e){k()&&await C(),O(e.options.signal)}function s(e,t,l,d){O(t.options.signal);const f=w(e,["version","width","height","elements","standardFonts"],"drawing"),h=f.standardFonts;if(h!==void 0&&typeof h!="boolean")throw new TypeError("Drawing standardFonts must be boolean.");const g=f.version;if(g!==1&&g!==2)throw new S("Only portable drawing versions 1 and 2 are supported.");const p=b(f.width,"Drawing width"),T=b(f.height,"Drawing height");let v=l.commands,E=l.elements;const I=new Set;function P(U){w(U,["kind","commands","fill","stroke","strokeWidth","fillRule","lineCap","lineJoin","miterLimit","dash","dashOffset"],"drawing path");const J=U.commands;if(!Array.isArray(J))throw new TypeError("Drawing path commands must be an array.");if(v+J.length>t.limits.maxVectorCommands)throw new R("RESOURCE_LIMIT","maxVectorCommands exceeded.");O(t.options.signal);const Z=J.slice(),j=[];let _=!1;v+=Z.length;const A=U.fill,F=U.stroke,V=A===void 0?void 0:y(A),q=F===void 0?void 0:y(F);if(V===void 0&&q===void 0)throw new TypeError("A drawing path requires fill or stroke.");const $=b(U.strokeWidth??1,"Drawing stroke width"),Q=U.fillRule,z=U.lineCap,K=U.lineJoin;if(Q!==void 0&&!["nonzero","evenodd"].includes(Q))throw new TypeError("Invalid drawing fillRule.");if(z!==void 0&&!["butt","round","square"].includes(z))throw new TypeError("Invalid drawing lineCap.");if(K!==void 0&&!["miter","round","bevel"].includes(K))throw new TypeError("Invalid drawing lineJoin.");const Y=b(U.miterLimit??10,"Drawing miter limit",1e6);if(Y<1)throw new RangeError("Drawing miter limit must be at least 1.");const ie=c(U.dash,U.dashOffset);for(let ae=0;ae<Z.length;ae++){const ee=Z[ae];if(!ee||typeof ee!="object")throw new TypeError("Invalid drawing path command.");const re=ee.op;if(re==="move"||re==="line"){if(w(ee,["op","x","y"],"drawing path command"),re==="line"&&!_)throw new TypeError("A drawing subpath must begin with move.");j.push({op:re,x:a(ee.x),y:a(ee.y)}),_=!0}else if(re==="cubic"){if(w(ee,["op","x1","y1","x2","y2","x","y"],"drawing path command"),!_)throw new TypeError("A drawing subpath must begin with move.");j.push({op:"cubic",x1:a(ee.x1),y1:a(ee.y1),x2:a(ee.x2),y2:a(ee.y2),x:a(ee.x),y:a(ee.y)})}else if(re==="close"){if(w(ee,["op"],"drawing path command"),!_)throw new TypeError("Cannot close an empty drawing path.");j.push({op:"close"})}else throw new TypeError("Unsupported drawing path command.");(ae&1023)===1023&&O(t.options.signal)}if(!_)throw new TypeError("A drawing path needs at least one command.");return{kind:"path",commands:j,style:(V===void 0?"":V+" rg\n")+(q===void 0?"":q+" RG\n"+x($)+" w\n")+String(["butt","round","square"].indexOf(z??"butt"))+" J\n"+String(["miter","round","bevel"].indexOf(K??"miter"))+" j\n"+x(Y)+" M\n"+ie,paint:(V!==void 0&&q!==void 0?"B":V!==void 0?"f":"S")+(V!==void 0&&Q==="evenodd"?"*":"")+"\n"}}function B(U){w(U,["kind","text","x","y","font","fontSize","color","anchor","rotation"],"drawing text");const J=U.text,Z=U.font;if(typeof J!="string")throw new TypeError("Drawing text must be a string.");if(J.length>t.limits.maxCellCharacters)throw new R("RESOURCE_LIMIT","maxCellCharacters exceeded.");if(/[\r\n\u2028\u2029]/.test(J))throw new S("Drawing text must be a single baseline without line breaks.");if(!["regular","bold","italic","boldItalic"].includes(Z))throw new TypeError("Invalid drawing font slot.");const j=a(U.x),_=a(U.y),A=b(U.fontSize,"Drawing font size"),F=y(U.color),V=U.anchor,q=U.rotation??0;if(V!==void 0&&!["start","middle","end"].includes(V))throw new TypeError("Invalid drawing text anchor.");if(typeof q!="number"||!Number.isFinite(q)||Math.abs(q)>360)throw new RangeError("Drawing text rotation must be finite degrees within -360 through 360.");t.budget.cell(J);const $=q%90===0?(q/90%4+4)%4:-1,Q=q*Math.PI/180,z=$<0?Math.cos(Q):[1,0,-1,0][$],K=$<0?Math.sin(Q):[0,1,0,-1][$];return{kind:"text",text:J,x:j,y:_,size:A,color:F,font:Z,anchor:V==="middle"?.5:V==="end"?1:0,cos:z,sin:K}}function L(U){w(U,["kind","image","x","y","width","height","opacity"],"drawing image");const J=a(U.x),Z=a(U.y),j=U.opacity,_=j===void 0?1:j,A=b(U.width,"Drawing image width",1e6),F=b(U.height,"Drawing image height",1e6);if(typeof _!="number"||!(_>=0&&_<=1))throw new RangeError("Drawing image opacity must be from 0 through 1.");const V=U.image;return d.snapshot(V),{kind:"image",image:V,x:J,y:Z,width:A,height:F,opacity:_}}function H(U,J){if(!Array.isArray(U))throw new TypeError("Drawing elements must be an array.");if(J>m&&U.length)throw new RangeError("Drawing groups support at most "+m+" element levels.");if(E+U.length>t.limits.maxDrawingElements)throw new R("RESOURCE_LIMIT","maxDrawingElements exceeded.");O(t.options.signal);const Z=U.slice(),j=[];for(let _=0;_<Z.length;_++){if(++E>t.limits.maxDrawingElements)throw new R("RESOURCE_LIMIT","maxDrawingElements exceeded.");const A=Z[_];if(!A||typeof A!="object")throw new TypeError("Invalid drawing element.");if(I.has(A))throw new TypeError("Drawing groups cannot contain cycles.");const F=A.kind;if(F==="path")j.push(P(A));else if(F==="text")j.push(B(A));else if(F==="image"&&g===2)j.push(L(A));else if(F==="group"){w(A,["kind","clip","elements"],"drawing group");const V=A.clip,q=V===void 0?void 0:i(V);I.add(A),j.push({kind:"group",...q?{clip:q}:{},children:H(A.elements,J+1)}),I.delete(A)}else throw new TypeError("Unsupported drawing element kind.");(_&255)===255&&O(t.options.signal)}return j}const W=H(f.elements,1);return O(t.options.signal),{width:p,height:T,plan:W,commands:v-l.commands,elements:E-l.elements,standardFonts:h===!0}}async function r(e,t,l,d,f){const{images:h}=f,g=s(e,t,d,h),p=new Map;function T(j){const _=p.get(j);if(_)return _;const A=l.select(j==="bold"||j==="boldItalic",j==="italic"||j==="boldItalic",void 0,g.standardFonts);if(A.syntheticBold||A.syntheticItalic||!A.program&&!g.standardFonts)throw new S("Drawing text without an exact embedded font face at fonts."+j);return p.set(j,A),A}let v=0,E=0;const I=new Map;async function P(j){for(let _=0;_<j.length;_++){const A=j[_];if(A.kind==="group")await P(A.children);else if(A.kind==="image"&&!I.has(A.image)){const F=await h.prepare(A.image);f.registerImage(F.name,F.id),I.set(A.image,F.name)}else if(A.kind==="text"){const F=T(A.font);for(const V of A.text)F.width(V.codePointAt(0)),(++v&1023)===0&&await o(t)}(++E&255)===0&&await o(t)}}await P(g.plan);const B=[];let L=0;function H(j){if(L+=j.length,L>t.limits.maxPageBytes-256)throw new R("RESOURCE_LIMIT","maxPageBytes exceeded by drawing content.");B.push(j)}let W=0,U=0,J=0;async function Z(j){for(let _=0;_<j.length;_++){const A=j[_];if(H("q\n"),A.kind==="group")A.clip&&H([A.clip.x,A.clip.y,A.clip.width,A.clip.height].map(x).join(" ")+" re W n\n"),await Z(A.children);else if(A.kind==="path"){H(A.style);for(let F=0;F<A.commands.length;F++){const V=A.commands[F];H(V.op==="move"||V.op==="line"?x(V.x)+" "+x(V.y)+(V.op==="move"?" m\n":" l\n"):V.op==="cubic"?[V.x1,V.y1,V.x2,V.y2,V.x,V.y].map(x).join(" ")+" c\n":"h\n"),(++U&1023)===0&&await o(t)}H(A.paint)}else if(A.kind==="image")A.opacity<1&&H("/"+f.opacity(A.opacity)+" gs\n"),H([A.width,0,0,-A.height,A.x,A.y+A.height].map(x).join(" ")+" cm /"+I.get(A.image)+" Do\n");else{const F=T(A.font);let V=0;if(A.anchor){for(const $ of A.text)V+=F.width($.codePointAt(0));V*=A.size/1e3*A.anchor}H(A.color+" rg\nBT /"+F.name+" "+x(A.size)+" Tf 0 Tr "+[A.cos,A.sin,A.sin,-A.cos,A.x-V*A.cos,A.y-V*A.sin].map(x).join(" ")+" Tm <");let q="";for(const $ of A.text)q+=$,(++W&1023)===0&&(H(F.encode(q).slice(1,-1)),q="",await o(t));q&&H(F.encode(q).slice(1,-1)),H("> Tj ET\n")}H("Q\n"),(++J&255)===0&&await o(t)}}return await Z(g.plan),O(t.options.signal),{width:g.width,height:g.height,content:B.join(""),commands:g.commands,elements:g.elements}}const n=Object.freeze({checkDrawingBlock:u,prepareDrawing:r});return N.set("da0657c49ac1393409d051be5e5dd70d2a0dc5221d363b422d7da31e9b940ea2",n),n})(),vt=N.get("37923737a6bcae4c342ab023bd3cb01ddeaced28543718aad078b51b54d8f31d")??(()=>{const{OfficeIMOError:S}=pe,{capturePdfText:R,wrapPdfText:O}=ft,{positive:C}=De,{resolveParagraphStyle:k}=Ct,{captureBookmark:y}=Rt,{captureFields:m}=Te,{pdfBudgetText:b}=nt;function x(o,s,r,n=!1){if(!o||o.kind!=="paragraph")throw new TypeError("PDF paragraph groups accept paragraph blocks only.");const{text:e,headingLevel:t,presentation:l,fontSize:d,keepTogether:f,keepWithNext:h,spaceBefore:g,spaceAfter:p,style:T,bookmark:v}=o;if(t!==void 0&&(!Number.isInteger(t)||t<1||t>6))throw new TypeError("Paragraph headingLevel must be an integer from 1 through 6.");const E=k(T,{...d===void 0?{}:{fontSize:d},...l===void 0?{}:{presentation:l},...f===void 0?{}:{keepTogether:f},...h===void 0?{}:{keepWithNext:h},...g===void 0?{}:{spaceBefore:g},...p===void 0?{}:{spaceAfter:p}},s.paragraphStyles),I=E.presentation??Object.freeze({}),P=C(E.fontSize??s.fontSize,"Paragraph font size",144),B=y(v,s);return Object.freeze({text:R(e,I,s,r,!1,!n),style:I,size:P,...n?{budgetOnPaint:!0}:{},...t===void 0?{}:{headingLevel:t},...B===void 0?{}:{bookmark:B},keepTogether:E.keepTogether??!1,keepWithNext:E.keepWithNext??!1,spaceBefore:E.spaceBefore??0,spaceAfter:E.spaceAfter??8})}function w(o,s,r){if(!o||typeof o!="object"||Array.isArray(o)||Object.keys(o).some(n=>!["text","style","fontSize","presentation","spaceBefore","spaceAfter"].includes(n)))throw new TypeError("PDF captions support text, style, fontSize, presentation, spaceBefore and spaceAfter.");return x({...m(o,["text","style","fontSize","presentation","spaceBefore","spaceAfter"]),kind:"paragraph",keepTogether:!0,keepWithNext:!0},s,r,!0)}async function u(o,s,r,n=s.page.width-s.margins.left-s.margins.right){if(!o.text.text)return{...o,lines:[],height:0,firstHeight:0};if(!o.budgetOnPaint){const t=b(o.text.text,s.budget);s.budget.cell(t,t.length)}const e=await O(o.text,r,o.size,C(n,"Paragraph width"),s);return{...o,lines:e,height:o.spaceBefore+e.reduce((t,l)=>t+l.lineHeight,0)+o.spaceAfter,firstHeight:o.spaceBefore+e[0].lineHeight}}function a(o,s){if(o.length>s.limits.maxGroupBlocks)throw new S("RESOURCE_LIMIT","maxGroupBlocks exceeded.");let r=0,n=0;for(const e of o){if(r+=e.text.text.length,n+=e.text.runs.length,r>s.limits.maxCellCharacters)throw new S("RESOURCE_LIMIT","maxCellCharacters exceeded by a paragraph group or keep chain.");if(n>s.limits.maxTextRuns)throw new S("RESOURCE_LIMIT","maxTextRuns exceeded by a paragraph group or keep chain.")}}function i(o){const s=o.filter(n=>n.lines.length>0);let r=0;for(let n=s.length-1;n>=0;n--){const e=s[n];r=e.keepWithNext?e.height+r:e.keepTogether?e.height:e.firstHeight}return r}const c=Object.freeze({captureParagraph:x,captureCaption:w,prepareParagraph:u,checkParagraphBuffer:a,paragraphStartHeight:i});return N.set("37923737a6bcae4c342ab023bd3cb01ddeaced28543718aad078b51b54d8f31d",c),c})(),yr=N.get("964206f2e7c45a34e414d4d690243bf90eb4cf99793e13d1cda834de3d386773")??(()=>{const{capturePdfText:S,wrapPdfText:R}=ft,{captureParagraph:O,prepareParagraph:C}=vt,{resolveParagraphStyle:k}=Ct;function y(x,w){const{items:u,ordered:a=!1,start:i,itemStyle:c,indent:o,markerGap:s}=x,r=i===void 0?1:i;if(typeof a!="boolean")throw new TypeError("PDF list ordered must be boolean.");if(!Number.isSafeInteger(r)||r<1)throw new RangeError("PDF list start must be a positive safe integer.");if(!a&&i!==void 0)throw new TypeError("PDF list start requires ordered:true.");for(const[n,e]of[["indent",o],["markerGap",s]])if(e!==void 0&&(!Number.isFinite(e)||e<0||e>14400))throw new RangeError("PDF list "+n+" must be from zero through 14,400 points.");if(k(c,{},w.paragraphStyles).keepWithNext)throw new TypeError("PDF list item styles cannot use keepWithNext.");return Object.freeze({items:u,ordered:a,start:r,...c===void 0?{}:{itemStyle:c},...o===void 0?{}:{indent:o},...s===void 0?{}:{markerGap:s}})}async function m(x,w,u,a,i){if(!x||typeof x!="object"||Array.isArray(x)||Object.keys(x).some(v=>!["text","style","keepTogether"].includes(v)))throw new TypeError("PDF list items support text, style and keepTogether.");if(!Number.isSafeInteger(w)||w<0||!Number.isSafeInteger(u.start+w))throw new RangeError("PDF list numbering must remain within positive safe integers.");const{text:c,style:o=u.itemStyle,keepTogether:s}=x,r=O({kind:"paragraph",text:c,...o===void 0?{}:{style:o},...s===void 0?{}:{keepTogether:s}},a,i);if(r.keepWithNext)throw new TypeError("PDF list item styles cannot use keepWithNext.");if(!r.text.text.trim().length)throw new TypeError("PDF list items require nonempty text.");const n=u.ordered?String(u.start+w)+".":"•",e=S(n,r.style,a,i);a.budget.cell(n,n.length);const t=a.page.width-a.margins.left-a.margins.right,l=(await R(e,i,r.size,t,a,!1))[0],d=u.markerGap??r.size/2,f=u.indent??Math.max(r.size*2,l.width+d);if(l.width+d>f+.001)throw new RangeError("PDF list indent cannot fit its marker and gap.");if(f>=t)throw new RangeError("PDF list indent leaves no body text area.");const h=await C(r,a,i,t-f),g=h.lines[0],p=Math.max(g.lineHeight,l.lineHeight),T=Math.max(g.ascent,l.ascent);return{marker:l,indent:f,markerGap:d,paragraph:{...h,lines:[{...g,lineHeight:p,ascent:T},...h.lines.slice(1)],height:h.height+p-g.lineHeight,firstHeight:h.spaceBefore+p}}}const b=Object.freeze({captureListOptions:y,prepareListItem:m});return N.set("964206f2e7c45a34e414d4d690243bf90eb4cf99793e13d1cda834de3d386773",b),b})(),Pt=N.get("f254a333f483757dc21be9d40dbd3ca51013d32a3c646b564270e3902226a590")??(()=>{const{assertGroupedReportSource:S}=Ne,{captureFields:R}=Te,{captureWideTable:O}=De,{presentation:C}=qe,k=["labelColumn","subtotalLabel","grandTotalLabel","includeGrandTotal","continuationLabel","groupHeadingLevel"],y=["includeHeader","headerPresentation","footerPresentation","alternateRowColor","columnWidths","wideTable","formatValue","formatRuns",...k];function m(w,u){return S(w),Object.freeze({kind:"groupedTable",report:w,options:b(u)})}function b(w){if(!w||typeof w!="object"||Array.isArray(w)||Object.keys(w).some(t=>!y.includes(t)))throw new TypeError("Grouped PDF table options support table presentation and labels; document settings belong on writePdfDocument.");const u=R(w,y),{labelColumn:a,subtotalLabel:i,grandTotalLabel:c,includeGrandTotal:o,continuationLabel:s,groupHeadingLevel:r}=u;if(!a||typeof a!="object")throw new TypeError("Grouped PDF needs a leading labelColumn.");const{header:n,width:e}=a;if(typeof n!="string")throw new TypeError("The grouped label column header must be text.");for(const[t,l]of[["subtotalLabel",i],["grandTotalLabel",c]])if(typeof l!="function")throw new TypeError(t+" must be a synchronous text callback.");if(s!==void 0&&typeof s!="function")throw new TypeError("continuationLabel must be a synchronous text callback.");if(o!==void 0&&typeof o!="boolean")throw new TypeError("includeGrandTotal must be boolean.");if(r!==void 0&&(!Number.isInteger(r)||r<1||r>6))throw new TypeError("groupHeadingLevel must be an integer from 1 through 6.");return Object.freeze({...u,...u.wideTable===void 0?{}:{wideTable:O(u.wideTable)},labelColumn:Object.freeze({header:n,...e===void 0?{}:{width:e}}),...u.columnWidths===void 0?{}:{columnWidths:Object.freeze([...u.columnWidths])},...u.headerPresentation===void 0?{}:{headerPresentation:C(u.headerPresentation)},...u.footerPresentation===void 0?{}:{footerPresentation:C(u.footerPresentation)}})}const x=Object.freeze({groupedPdfLabelFields:k,groupedPdfTableFields:y,pdfGroupedTable:m,captureGroupedPdfTableOptions:b});return N.set("f254a333f483757dc21be9d40dbd3ca51013d32a3c646b564270e3902226a590",x),x})(),xr=N.get("a3ebee86ff33369e9ebc8b994d71bad32497a55433a313c426676277cb660d2f")??(()=>{const{assertGroupedReportSource:S,groupedReportOperation:R}=Ne,{consumeRows:O}=be,{ExportCell:C}=Ce,{captureGroupedPdfTableOptions:k}=Pt,{settings:y}=De,{PdfTableLayout:m}=St,{captureCaption:b,captureParagraph:x,prepareParagraph:w}=vt,{synchronousText:u}=nt;async function a(c,o){const{report:s}=c,{pages:r,fonts:n,prepared:e,controller:t}=o;S(s);const l=e.options.tagged!==void 0,d=k(c.options),{labelColumn:f,subtotalLabel:h,grandTotalLabel:g,includeGrandTotal:p=!0,continuationLabel:T,groupHeadingLevel:v=2,...E}=d,I=Object.freeze([Object.freeze({...f}),...s.columns]);let P=-1;const B=Z=>({rowIndex:P,columnIndex:Z.columnIndex-1,column:s.columns[Z.columnIndex-1]}),L=y({...r.settings.options,...E,columns:I,includeHeader:E.includeHeader??!0,...E.formatValue===void 0?{}:{formatValue:(Z,j)=>E.formatValue(Z,B(j))},...E.formatRuns===void 0?{}:{formatRuns:(Z,j)=>E.formatRuns(Z,B(j))}}),H={...L,budget:e.budget},W=new m(H,n);o.acceptColumns(I.length);const U=R(s,t.signal),J=()=>t.abort(U.signal?.reason);U.signal?.addEventListener("abort",J,{once:!0}),U.signal?.aborted&&J();try{const Z=await W.headers(),j=await W.blockHeight(Z);let _=[],A=!1,F=!1,V=!1,q=0;const $=new WeakMap;let Q;const z=[],K=s.columns.flatMap((D,G)=>Object.hasOwn(s.totals,D.key)?[G]:[]),Y=(D,G,te)=>Object.freeze([new C(D,{text:D,presentation:L.options.footerPresentation}),...(te?te.map(oe=>G[oe]):G).map(oe=>new C(oe,{presentation:L.options.footerPresentation}))]),ie=new Map,ae=D=>{const G=ie.get(D);if(G)return G;const te=[0,...K.map(X=>X+1)],oe=te.map(X=>{const ne=I[X];if(!D)return ne;const{groups:le,...fe}=ne;return fe}),ce=X=>{const ne=te[X.columnIndex];return{...X,columnIndex:ne,column:I[ne]}},se=te.flatMap((X,ne)=>X===0||L.repeatedColumns.includes(X)?[ne]:[]),ge=L.options.wideTable,we={...H,repeatedColumns:Object.freeze(se),options:{...L.options,columns:oe,...L.options.columnWidths===void 0?{}:{columnWidths:te.map(X=>L.options.columnWidths[X])},...typeof ge!="object"?{}:{wideTable:{...ge,repeatColumns:se}},...L.options.formatValue===void 0?{}:{formatValue:(X,ne)=>L.options.formatValue(X,ce(ne))},...L.options.formatRuns===void 0?{}:{formatRuns:(X,ne)=>L.options.formatRuns(X,ce(ne))}}},de=new m(we,n);return ie.set(D,de),de},ee=async()=>{const D=await w(b({text:_.map(te=>te.label).join("\n"),presentation:{bold:!0},spaceAfter:4},r.settings,n),r.settings,n),G=await w(b({text:_.map(te=>{if(T===void 0)return te.label;const oe=l?$.get(te):void 0;if(oe!==void 0)return oe;const ce=u(T(te),"continuationLabel");return l&&$.set(te,ce),ce}).join("\n"),presentation:{bold:!0},spaceAfter:4},r.settings,n),r.settings,n);return{caption:D,continuation:G}},re=async()=>{if(Q)if(A||await ye(Q),z.length&&!V)await r.keptRows([Q,...z],F);else if(z.length){await r.row(Q,F);for(const D of z)await r.row(D)}else await r.row(Q,F);else for(const D of z)await r.row(D);Q=void 0,z.length=0,F=!1,V=!1},ue=async()=>{!A&&!Q||(await re(),await r.endTable(),A=!1)},ye=async D=>{const{caption:G,continuation:te}=await ee(),oe=D.height+z.reduce((le,fe)=>le+fe.height,0),ce=L.page.height-L.margins.top-L.margins.bottom-j-Math.max(G?.height??0,te.height);V=z.length>0&&oe>ce+.001;const se=z.length>0&&!V?oe:W.minimumRowHeight(D),ge=[];if(l)for(const le of _.slice(q))ge.push(await w(x({kind:"paragraph",text:le.label.trim()?le.label:"",headingLevel:v+le.level,presentation:{bold:!0},keepTogether:!0,keepWithNext:!0,spaceAfter:4,...le.label.trim()?{bookmark:{title:le.label,level:v+le.level}}:{}},r.settings,n),r.settings,n));const we=ge.reduce((le,fe)=>le+fe.height,0),de=l&&q>0?await w(b({text:_.slice(0,q).map(le=>le.label).join("\n"),presentation:{bold:!0},spaceAfter:4},r.settings,n),r.settings,n):void 0,X=l?(de?.height??0)+we:G.height;await o.flushParagraphs(X+j+se),de&&await r.paragraphs([de],we+j+se,!0,{artifact:!0});let ne=we+(l?0:G.height)+j+se;for(const le of ge)ne-=le.height,await r.beginGroup(q++,le,ne);await r.beginTable(W,Z,se,G,te,!1,l,l),A=!0,F=(G?.lines.length??0)>0||ge.some(le=>le.lines.length>0)},he=async(D,G,te)=>{if(G===s.groupBy.length-1){r.summary(D),z.push(D),await ue(),await r.endGroup(G),q=G,_=_.slice(0,G);return}await ue();const{caption:oe,continuation:ce}=await ee(),se=ae(!1),ge=await se.headers(),we=await se.data(te,0,!0),de=se.minimumRowHeight(we);await o.flushParagraphs(oe.height+await se.blockHeight(ge)+de),await r.beginTable(se,ge,de,oe,ce,!1,!0),r.summary(we),await r.row(we,oe.lines.length>0||ge.length>0),await r.endTable(),await r.endGroup(G),q=G,_=_.slice(0,G)},M=async D=>{if(await ue(),!p&&D.rows!==0)return;const G=D.rows===0?W:ae(!0),te=D.rows===0?Z:await G.headers();P=-1;let oe;if(p&&(o.acceptRow(!1),oe=await G.data(Y(u(g(D),"grandTotalLabel"),D.totals,D.rows===0?void 0:K),0,!0)),!te.length&&!oe)return;const ce=oe?G.minimumRowHeight(oe):0;await o.flushParagraphs(await G.blockHeight(te)+ce),await r.beginTable(G,te,ce),oe&&(l&&r.summary(oe),await r.row(oe)),await r.endTable()};await O(U.events,U.signal,async D=>{switch(D.kind){case"groupStart":if(await ue(),l&&v+D.level>6)throw new RangeError("groupHeadingLevel and the opened group depth exceed heading level 6.");_=Object.freeze([..._.slice(0,D.level),D]);break;case"row":{Q&&await re(),P=D.rowIndex,o.acceptRow(!0),Q=await W.data([new C("",{text:""}),...D.values],D.rowIndex);break}case"groupEnd":{P=-1,o.acceptRow(!1);const G=l&&D.level!==s.groupBy.length-1,te=Y(u(h(D),"subtotalLabel"),D.totals,G?K:void 0),oe=G?void 0:await W.data(te,0,!0);l?await he(oe,D.level,te):z.push(oe);break}case"complete":await M(D);break}})}finally{U.signal?.removeEventListener("abort",J),U.dispose()}}const i=Object.freeze({renderGroupedPdfTable:a});return N.set("a3ebee86ff33369e9ebc8b994d71bad32497a55433a313c426676277cb660d2f",i),i})(),ut=N.get("e7fe5a5c6b675c6217db5f5a72d8883609e8417ee3c6f3c2184d375463f93231")??(()=>{const{BlobByteSink:S,withDestination:R}=Oe,{OfficeIMOError:O}=pe,{beginTask:C,checkAbort:k,consumeRows:y,pause:m,taskYieldDue:b}=be,{notifyProgress:x}=Ke,{copyColumns:w,createRowProjector:u}=Ge,{captureFields:a}=Te,{settings:i,captureWideTable:c}=De,{pdfNumber:o}=Be,{PdfTableLayout:s}=St,{PdfWriteSession:r}=_t,{PdfDocumentImages:n}=gr,{vectorCommands:e}=wr,{graphicAlternative:t}=Nt,{checkDrawingBlock:l,prepareDrawing:d}=br,{captureParagraph:f,captureCaption:h,prepareParagraph:g,checkParagraphBuffer:p,paragraphStartHeight:T}=vt,{captureListOptions:v,prepareListItem:E}=yr,{captureSection:I}=Rt,{renderGroupedPdfTable:P}=xr,B=["columns","includeHeader","headerRows","footer","headerPresentation","footerPresentation","alternateRowColor","columnWidths","wideTable","formatValue","formatRuns"];function L(j,_){const A=J(_);return Object.freeze({kind:"table",rows:j,options:Object.freeze({...A,columns:Object.freeze(w(A.columns))})})}async function H(j,_={}){const A=new S;try{return await W(j,A,_),A.toBlob("application/pdf")}catch(F){throw A.discard(),F}}async function W(j,_,A={}){const F=i(A,!0),V=new AbortController,q=F.options.signal,$=()=>V.abort(q?.reason);q?.addEventListener("abort",$,{once:!0}),q?.aborted&&$();const Q={...F,options:{...F.options,signal:V.signal}},{options:z,budget:K}=Q;try{return C(),k(z.signal),await R(_,async Y=>{const ie=new r(Y,Q),{objects:ae,pages:ee,fonts:re}=ie,ue=new n(ae,Q);let ye=0,he=0,M=0,D=0,G=0,te=0,oe=[];const ce=async(de=0)=>{const X=[];for(const ne of oe)X.push(await g(ne,ee.settings,re));oe=[],await ee.paragraphs(X,de)},se=async de=>{const X=f(de,ee.settings,re);X.text.text&&(oe.length||X.keepWithNext?(oe.push(X),p(oe,ee.settings),X.keepWithNext||await ce()):await ee.paragraphs([await g(X,ee.settings,re)]))},ge=async de=>de===void 0?void 0:g(de,ee.settings,re),we=de=>de===void 0?void 0:h(de,ee.settings,re);return await ie.start(),await y(j,z.signal,async de=>{if(!de||typeof de!="object")throw new TypeError("PDF document blocks must be objects.");switch(de.kind){case"section":{const X=I(de,Q);await ce();const ne=await ee.beginSection(X);ne.includeHeading?await se({kind:"paragraph",text:ne.title,headingLevel:ne.level,...ne.headingStyle===void 0?{fontSize:ee.settings.fontSize*1.5,presentation:{bold:!0}}:{style:ne.headingStyle},keepTogether:!0,keepWithNext:!0,...ne.bookmark?{bookmark:{title:ne.title,level:ne.level}}:{}}):ne.bookmark&&ee.addBookmark({title:ne.title,level:ne.level});break}case"paragraph":await se(de);break;case"list":{const X=v(de,ee.settings);let ne=0,le;await y(X.items,z.signal,async fe=>{if(++te>Q.limits.maxListItems)throw new O("RESOURCE_LIMIT","maxListItems exceeded.");const me=await E(fe,ne++,X,ee.settings,re);ne===1&&(await ce(me.paragraph.keepTogether?me.paragraph.height:me.paragraph.firstHeight),le=ie.structure?.element("L")),await ee.listItem(me,le),b()&&await m(),k(z.signal)}),await ie.structure?.complete(le);break}case"group":{const X=de.blocks,ne=de.keepTogether;if(!Array.isArray(X))throw new TypeError("PDF paragraph group blocks must be an array.");if(ne!==void 0&&typeof ne!="boolean")throw new TypeError("PDF paragraph group keepTogether must be boolean.");if(X.length>Q.limits.maxGroupBlocks)throw new O("RESOURCE_LIMIT","maxGroupBlocks exceeded.");const le=[];for(const me of X)le.push(f(me,ee.settings,re)),p(le,Q);if(le.filter(me=>me.text.text).at(-1)?.keepWithNext)throw new TypeError("The last paragraph in a group cannot keepWithNext beyond the group's boundary.");const fe=[];for(const me of le)fe.push(await g(me,ee.settings,re));if(!fe.some(me=>me.lines.length>0))break;await ce(ne!==!1?fe.reduce((me,ve)=>me+ve.height,0):T(fe)),await ee.paragraphs(fe,0,ne!==!1);break}case"pageBreak":await ce(),await ee.pageBreak();break;case"groupedTable":await P(de,{prepared:Q,pages:ee,fonts:re,controller:V,flushParagraphs:ce,acceptColumns:X=>{M=Math.max(M,X)},acceptRow:X=>{K.row(++he),X&&++ye%256===0&&x(z.onProgress,{phase:"rows",rows:ye,bytes:ae.bytes})}});break;case"table":{const{options:X,rows:ne,caption:le,continuationCaption:fe}=de,me=J(X),ve=we(le),je=we(fe),xe=i({...ee.settings.options,...me,columns:me?.columns,includeHeader:me?.includeHeader??!0}),Re=new s({...xe,budget:K},re),ke=await ge(ve),Pe=await ge(je),Ee=u(xe.options.columns,void 0,z.signal);let He=0,Le=!1;M=Math.max(M,xe.options.columns.length);const Fe=await Re.headers(),Ie=await Re.blockHeight(Fe);await y(ne,z.signal,async mt=>{K.row(++he);const Ht=await Re.data(Ee(mt,He),He),Er=!Le&&(oe.length>0||!!ke?.lines.length);if(!Le){const Gt=Re.minimumRowHeight(Ht);await ce((ke?.height??0)+Ie+Gt),await ee.beginTable(Re,Fe,Gt,ke,Pe),Le=!0}await ee.row(Ht,Er),He++,ye++,ye%256===0&&x(z.onProgress,{phase:"rows",rows:ye,bytes:ae.bytes}),b()&&await m(),k(z.signal)});const Ae=await Re.footer(He),pt=!Le&&(oe.length>0||!!ke?.lines.length);if(!Le){if(!Fe.length&&!Ae?.length)break;const mt=Ae?.length?xe.options.footer?.rows?await Re.blockHeight(Ae):Re.minimumRowHeight(Ae[0]):0;await ce((ke?.height??0)+Ie+mt),await ee.beginTable(Re,Fe,mt,ke,Pe)}Ae&&(xe.options.footer?.rows?await ee.block(Ae):await ee.row(Ae[0],pt)),await ee.endTable();break}case"image":{const{width:X,height:ne,image:le,caption:fe}=de,me=we(fe),ve=t(de,ee.settings),je=U(de.alignment);if(me&&ve===void 0)throw new TypeError("A captioned PDF graphic requires alternativeText and cannot be decorative.");const xe=await ue.prepare(le),Re=await ge(me),ke=X??(ne===void 0?xe.width*.75:ne*xe.width/xe.height),Pe=ne??ke*xe.height/xe.width;if(!Number.isFinite(ke)||ke<=0||!Number.isFinite(Pe)||Pe<=0)throw new RangeError("Image display dimensions must be finite and positive.");await ce((Re?.height??0)+ee.graphicHeight(ke,Pe)),ee.registerXObject(xe.name,xe.id),await ee.graphic(ke,Pe,je,(Ee,He,Le,Fe)=>"q "+[Le,0,0,Fe,Ee,He].map(o).join(" ")+" cm /"+xe.name+" Do Q\n",ve,Re);break}case"vector":{const X=we(de.caption),ne=t(de,ee.settings),le=U(de.alignment);if(X&&ne===void 0)throw new TypeError("A captioned PDF graphic requires alternativeText and cannot be decorative.");const fe=await e(de,ee.settings,D),me=await ge(X);D+=fe.count,await ce((me?.height??0)+ee.graphicHeight(fe.width,fe.height)),await ee.graphic(fe.width,fe.height,le,(ve,je,xe,Re)=>"q "+[xe/fe.width,0,0,-Re/fe.height,ve,je+Re].map(o).join(" ")+" cm 0 0 "+o(fe.width)+" "+o(fe.height)+" re W n\n"+fe.content+"Q\n",ne,me);break}case"drawing":{l(de);const X=de.drawing,ne=we(de.caption),le=t(de,ee.settings),fe=U(de.alignment);if(ne&&le===void 0)throw new TypeError("A captioned PDF graphic requires alternativeText and cannot be decorative.");const me=await d(X,ee.settings,re,{commands:D,elements:G},{images:ue,registerImage:(je,xe)=>ee.registerXObject(je,xe),opacity:je=>ee.opacityState(je)}),ve=await ge(ne);D+=me.commands,G+=me.elements,await ce((ve?.height??0)+ee.graphicHeight(me.width,me.height)),await ee.graphic(me.width,me.height,fe,(je,xe,Re,ke)=>"q "+[Re/me.width,0,0,-ke/me.height,je,xe+ke].map(o).join(" ")+" cm 0 0 "+o(me.width)+" "+o(me.height)+" re W n\n"+me.content+"Q\n",le,ve);break}default:throw new TypeError("Unsupported PDF document block.")}b()&&await m(),k(z.signal)}),await ce(),z.messageBottom&&await ee.paragraph(z.messageBottom),await ie.finish(),x(z.onProgress,{phase:"complete",rows:ye,bytes:ae.bytes}),k(z.signal),{rows:ye,columns:M,bytes:ae.bytes}})}finally{q?.removeEventListener("abort",$)}}function U(j){if(j!==void 0&&!["left","center","right"].includes(j))throw new TypeError("Invalid graphic alignment.");return j??"left"}function J(j){if(!j||typeof j!="object"||Object.keys(j).some(A=>!B.includes(A)))throw new TypeError("Table options support columns, headings, footers, widths and presentation; document settings belong on writePdfDocument.");const _=a(j,B);return{..._,..._.wideTable===void 0?{}:{wideTable:c(_.wideTable)}}}const Z=Object.freeze({pdfTable:L,writePdfDocument:H,writePdfDocumentTo:W});return N.set("e7fe5a5c6b675c6217db5f5a72d8883609e8417ee3c6f3c2184d375463f93231",Z),Z})(),Ze=N.get("37e4a768d57818c4335fd3d61b9b7aae633cde303e7634579655a6a3de4a86ce")??(()=>{const{assertGroupedReportSource:S}=Ne,{BlobByteSink:R}=Oe,{writePdfDocumentTo:O}=ut,{pdfOptionFields:C}=De,{captureFields:k}=Te,{pdfGroupedTable:y,groupedPdfLabelFields:m,groupedPdfTableFields:b}=Pt,x=[...C,...m];async function w(i,c){const o=new R;try{return await u(i,o,c),o.toBlob("application/pdf")}catch(s){throw o.discard(),s}}async function u(i,c,o){if(S(i),!o||typeof o!="object")throw new TypeError("Grouped PDF options are required.");const s=k(o,x),r=Object.fromEntries(b.filter(e=>Object.hasOwn(s,e)).map(e=>[e,s[e]])),n={...s};for(const e of b)delete n[e];return delete n.columns,delete n.headerRows,delete n.footer,O([y(i,r)],c,n)}const a=Object.freeze({pdfGroupedTable:Pt.pdfGroupedTable,writeGroupedPdf:w,writeGroupedPdfTo:u});return N.set("37e4a768d57818c4335fd3d61b9b7aae633cde303e7634579655a6a3de4a86ce",a),a})(),Tr=N.get("3d777096288d1be55a05a80bc015d4674212e587703f25a7e7cf99a8065feb86")??(()=>{const{fontProgram:S}=rt,{resolveScalar:R,selectFont:O,validateFonts:C}=Mt;function k(m,b={}){if(typeof m!="string")throw new TypeError("PDF preflight text must be a string.");if(!b||typeof b!="object")throw new TypeError("PDF preflight options must be an object.");for(const i of["bold","italic"])if(b[i]!==void 0&&typeof b[i]!="boolean")throw new TypeError("PDF preflight "+i+" must be boolean.");C(b.fonts);const x=b.bold??!1,{font:w}=O(b.fonts,x,b.italic??!1),u=w?S(w):void 0,a=new Set;for(let i=0;i<m.length;){const c=m.codePointAt(i),o=c===9?32:c;if(c!==10&&c!==13&&!a.has(o)){const s=R(o,u,x);if(!s.supported)return{...s,index:i,...s.code==="unpaired-surrogate"?{}:{scalar:c}};a.add(o)}i+=c>65535?2:1}return{supported:!0}}const y=Object.freeze({preflightPdfText:k});return N.set("3d777096288d1be55a05a80bc015d4674212e587703f25a7e7cf99a8065feb86",y),y})(),We=N.get("344fd55ffe1a37b32a8eb6a2bdaa14dff90e0fee0f37282457f9e4c3b7bce1ca")??(()=>{const S=Object.freeze({writePdf:Ut.writePdf,writePdfTo:Ut.writePdfTo,writeGroupedPdf:Ze.writeGroupedPdf,writeGroupedPdfTo:Ze.writeGroupedPdfTo,pdfGroupedTable:Ze.pdfGroupedTable,createGroupedReport:Ne.createGroupedReport,writePdfDocument:ut.writePdfDocument,writePdfDocumentTo:ut.writePdfDocumentTo,pdfTable:ut.pdfTable,PdfFont:rt.PdfFont,preflightPdfText:Tr.preflightPdfText,ExportCell:Ce.ExportCell,saveBlob:_e.saveBlob});return N.set("344fd55ffe1a37b32a8eb6a2bdaa14dff90e0fee0f37282457f9e4c3b7bce1ca",S),S})(),kr=N.get("9bbfb2fef7625be5b610e82b6ee2d1cd50af97c40c82ef07531ae92c803e47c1")??(()=>{const S=Object.freeze({core:_e,zip:It,xml:Se,opc:$e,xlsx:Ue,csv:Et,pdf:We,Workbook:Ue.Workbook,Worksheet:Ue.Worksheet,Cell:Ue.Cell,FormulaCell:Ue.FormulaCell,StyleRegistry:Ue.StyleRegistry,NumberFormats:Ue.NumberFormats,writeXlsx:Ue.writeXlsx,writeXlsxTo:Ue.writeXlsxTo,writeCsv:Et.writeCsv,writeCsvTo:Et.writeCsvTo,createGroupedReport:Ne.createGroupedReport,writeGroupedXlsx:Xe.writeGroupedXlsx,writeGroupedXlsxTo:Xe.writeGroupedXlsxTo,addGroupedXlsx:Xe.addGroupedXlsx,writeGroupedPdf:Ze.writeGroupedPdf,writeGroupedPdfTo:Ze.writeGroupedPdfTo,pdfGroupedTable:Ze.pdfGroupedTable,writePdf:We.writePdf,writePdfTo:We.writePdfTo,writePdfDocument:We.writePdfDocument,writePdfDocumentTo:We.writePdfDocumentTo,pdfTable:We.pdfTable,PdfFont:We.PdfFont,preflightPdfText:We.preflightPdfText,OfficeIMOError:_e.OfficeIMOError,NotSupportedError:_e.NotSupportedError,detectFeatures:_e.detectFeatures,saveBlob:_e.saveBlob,ExportCell:_e.ExportCell});return N.set("9bbfb2fef7625be5b610e82b6ee2d1cd50af97c40c82ef07531ae92c803e47c1",S),S})();Object.assign(it,kr)})(globalThis);
|