@docx-editor.dev/core 2.19.0 → 2.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/automation.cjs +1 -1
  2. package/dist/automation.js +1 -1
  3. package/dist/binding.cjs +1 -1
  4. package/dist/binding.js +1 -1
  5. package/dist/{chunk-4DB7ZFQN.js → chunk-2QU7QTM7.js} +1 -1
  6. package/dist/{chunk-PBM6WERF.cjs → chunk-3JKOZBQ3.cjs} +1 -1
  7. package/dist/{chunk-ZMM5RNM6.js → chunk-3SU7UWCR.js} +1 -1
  8. package/dist/{chunk-ZKQX2PNF.cjs → chunk-5BI4SIHO.cjs} +1 -1
  9. package/dist/chunk-6ESSCMXL.js +2 -0
  10. package/dist/{chunk-GUPITGJQ.cjs → chunk-6W4DIR4X.cjs} +1 -1
  11. package/dist/{chunk-CG7CP632.cjs → chunk-76F73CY6.cjs} +1 -1
  12. package/dist/{chunk-KDYD5TAW.cjs → chunk-7VO6BLKV.cjs} +1 -1
  13. package/dist/{chunk-MSIFK7TJ.js → chunk-AKQRKR2H.js} +1 -1
  14. package/dist/chunk-BJQDNKEX.js +5 -0
  15. package/dist/{chunk-OODFC5R2.js → chunk-BUNY5MRX.js} +1 -1
  16. package/dist/chunk-FBWBSHC4.cjs +11 -0
  17. package/dist/{chunk-SUEX3CL7.cjs → chunk-GWW5FOLJ.cjs} +5 -5
  18. package/dist/chunk-IA7WTZHI.js +11 -0
  19. package/dist/chunk-IXGUCLER.js +20 -0
  20. package/dist/{chunk-NJONXJJY.cjs → chunk-JWHXOJEU.cjs} +2 -2
  21. package/dist/chunk-NDPLQG4Y.cjs +18 -0
  22. package/dist/{chunk-YVYEJBLL.cjs → chunk-NIVIC7PA.cjs} +1 -1
  23. package/dist/chunk-NLGUL6QL.js +3 -0
  24. package/dist/chunk-OWUSDS3L.cjs +20 -0
  25. package/dist/{chunk-FZ2BIMCY.cjs → chunk-RDKPMNN6.cjs} +1 -1
  26. package/dist/{chunk-2ZEU42EA.js → chunk-TSDGKNV7.js} +1 -1
  27. package/dist/chunk-TUCDPXBD.js +18 -0
  28. package/dist/{chunk-THCGTV53.js → chunk-UOE4WKL7.js} +1 -1
  29. package/dist/{chunk-MDP5SNK4.cjs → chunk-VSCPFHTD.cjs} +2 -2
  30. package/dist/{chunk-DQS4KZUX.js → chunk-ZUGTEKLM.js} +2 -2
  31. package/dist/collaboration/replication.cjs +1 -1
  32. package/dist/collaboration/replication.js +1 -1
  33. package/dist/editor.cjs +1 -1
  34. package/dist/editor.js +1 -1
  35. package/dist/export.cjs +2 -2
  36. package/dist/export.js +1 -1
  37. package/dist/index.cjs +1 -1
  38. package/dist/index.js +1 -1
  39. package/dist/layout.cjs +1 -1
  40. package/dist/layout.js +1 -1
  41. package/dist/output.cjs +1 -1
  42. package/dist/output.js +1 -1
  43. package/dist/store.cjs +1 -1
  44. package/dist/store.js +1 -1
  45. package/package.json +2 -2
  46. package/dist/chunk-4KMSEFIG.js +0 -3
  47. package/dist/chunk-72BDQFHY.js +0 -18
  48. package/dist/chunk-77DD4EBC.cjs +0 -11
  49. package/dist/chunk-BEOPUDAB.js +0 -5
  50. package/dist/chunk-CJCFEXTA.js +0 -11
  51. package/dist/chunk-LQ6XWTKQ.cjs +0 -18
  52. package/dist/chunk-MRPPCGCX.cjs +0 -20
  53. package/dist/chunk-P6VGDI57.js +0 -2
  54. package/dist/chunk-QBMAXYN7.js +0 -20
@@ -1,4 +1,4 @@
1
- import {f,c,d,e}from'./chunk-RIYSCEFQ.js';import {r,v,W as W$1,G as G$1,b,qa,oa as oa$1,Pb,gc,ua as ua$1,Oc,Nc as Nc$1,T,je,B as B$1,Pc,J as J$1,Q as Q$1,Ja,Rb,ic,fc,ta as ta$1,pa as pa$1,C,a as a$1,A}from'./chunk-72BDQFHY.js';import {Ha}from'./chunk-4KMSEFIG.js';import {a,gh,Kc,Ic,Nc,Jc,Nf,jh,ih,hh,wc,Gc}from'./chunk-CJCFEXTA.js';var Jn=Symbol("validated-resolved-font"),Qn=4,ee=64*1024*1024,D=256,V=128*1024*1024,j=class extends Error{name="FontResolutionError";request;code;limit;actual;diagnostic;expectedHash;actualHash;constructor(t,n,r={}){super(`Font resolution failed (${t}) for ${W(n)}`),this.code=t,this.request=K(n),this.limit=r.limit,this.actual=r.actual,this.diagnostic=r.diagnostic,this.expectedHash=r.expectedHash,this.actualHash=r.actualHash;}},jt=e=>{if(e.family.trim().length===0)throw new TypeError("Font family must not be empty");if(!Number.isInteger(e.weight)||e.weight<1||e.weight>1e3)throw new RangeError("Font weight must be an integer from 1 through 1000");if(e.style!=="normal"&&e.style!=="italic")throw new TypeError("Font style must be normal or italic")},K=e=>(jt(e),Object.freeze({family:e.family,weight:e.weight,style:e.style})),Ke=e=>{let t={family:e.family,weight:e.weight,style:e.style};return K(t)},Gt=Symbol("prepared-font-resource"),Xe=new WeakMap,er=new Uint8Array(0),Vt=Object.getPrototypeOf(Uint8Array.prototype),tr=Object.getOwnPropertyDescriptor(Vt,"length").get,nr=Object.getOwnPropertyDescriptor(Vt,"byteLength").get;function te(e){if(!ArrayBuffer.isView(e))throw new TypeError("Font bytes must be a genuine byte array");let t,n;try{t=tr.call(e),n=nr.call(e);}catch{throw new TypeError("Font bytes must be a genuine byte array")}if(t!==n)throw new TypeError("Font bytes must use one-byte elements");return n}function Wt(e){let t=new Uint8Array(te(e));return Uint8Array.prototype.set.call(t,e),t}function Kt(e,t){let n=K(e.request);if(e.availability==="forbidden"){let s=Object.freeze({...e,request:n,actualHash:null,[Gt]:true});return Xe.set(s,null),s}let r=Wt(e.bytes);t?.onOwnedByteCopy?.(),t?.onHash?.();let o=a(r),a$1=Object.freeze({...e,request:n,bytes:r,actualHash:o,[Gt]:true});return Xe.set(a$1,o),a$1}function ne(e){return Xe.get(e)}var Xt=e=>{if(!Number.isFinite(e.heightEm)||!Number.isFinite(e.baselineEm)||e.heightEm<=0||e.heightEm>Qn||e.baselineEm<0||e.baselineEm>e.heightEm)throw new RangeError("Font substitution line metrics must fit within a bounded em box");return Object.freeze({heightEm:e.heightEm,baselineEm:e.baselineEm})},W=e=>(jt(e),JSON.stringify([e.family.trim().toLowerCase(),e.weight,e.style])),qe=class{[Jn]=true;id;identity;request;family;byteLength;hash;faceIndex;substitution;constructor(t,n){if(t.id.length===0)throw new TypeError("Resolved font id must not be empty");if(!Number.isInteger(t.faceIndex)||t.faceIndex<0)throw new RangeError("Font face index must be a non-negative integer");this.id=t.id,this.request=K(t.request),this.family=this.request.family,this.hash=t.hash,this.faceIndex=t.faceIndex,this.identity=`${this.hash}#${this.faceIndex}`,this.byteLength=t.byteLength,this.substitution=null,n&&(this.substitution=Object.freeze({requested:K(n.requested),resolved:K(n.resolved),...n.lineMetrics?{lineMetrics:Xt(n.lineMetrics)}:{}})),Object.freeze(this);}get bytes(){return Ee(this).slice()}},qt=new WeakSet,Yt=new WeakMap,$t=new WeakMap,Zt=(e,t,n,r)=>{let o=new qe(e,r);return Yt.set(o,t),$t.set(o,n),qt.add(o),o},Ee=e=>{re(e);let t=Yt.get(e);if(!t)throw new TypeError("Resolved font has no owned byte capability");return t},Ce=e=>{re(e);let t=$t.get(e);if(!t)throw new TypeError("Resolved font has no admitted table metadata");return t},re=e=>{if(typeof e!="object"||e===null||!qt.has(e))throw new TypeError("Shaping requires a validated resolved font")},Jt=(e,t)=>e[t]<<8|e[t+1],Q=(e,t)=>e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0,Ut=(e,t)=>{if(t>e.byteLength-12)return {valid:false,diagnostic:"truncated sfnt header"};let n=String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3]);if(!(e[t]===0&&e[t+1]===1&&e[t+2]===0&&e[t+3]===0)&&n!=="OTTO"&&n!=="true"&&n!=="typ1")return {valid:false,diagnostic:"unsupported sfnt signature"};let o=Jt(e,t+4),a=t+12+o*16;if(!Number.isSafeInteger(a)||a>e.byteLength)return {valid:false,diagnostic:"truncated sfnt table directory"};for(let s=0;s<o;s+=1){let l=t+12+s*16,i=Q(e,l+8),d=Q(e,l+12);if(i>e.byteLength||d>e.byteLength-i)return {valid:false,diagnostic:"sfnt table range exceeds font bytes"}}return {valid:true}},rr=(e,t)=>{let r=String.fromCharCode(e[0],e[1],e[2],e[3])==="ttcf"?Q(e,12+t*4):0,o=Jt(e,r+4),a=new Set;for(let s=0;s<o;s+=1){let l=r+12+s*16;a.add(String.fromCharCode(e[l],e[l+1],e[l+2],e[l+3]));}return Object.freeze(a)},we=(e,t)=>{if(!Number.isSafeInteger(t)||t<0)return {valid:false,diagnostic:"invalid font face index"};if(e.byteLength<12)return {valid:false,diagnostic:"truncated sfnt header"};if(String.fromCharCode(e[0],e[1],e[2],e[3])!=="ttcf")return t!==0?{valid:false,diagnostic:"standalone sfnt has only face index zero"}:Ut(e,0);let r=Q(e,4);if(r!==65536&&r!==131072)return {valid:false,diagnostic:"unsupported TTC version"};let o=Q(e,8),a=12+o*4;if(o===0||!Number.isSafeInteger(a)||a>e.byteLength||t>=o)return {valid:false,diagnostic:"invalid TTC face directory"};let s=Q(e,12+t*4);return s<a?{valid:false,diagnostic:"invalid TTC face offset"}:Ut(e,s)},or=(e,t,n,r)=>{if(e.availability==="forbidden")return {kind:"forbidden"};let o=te(e.bytes);if(o>t)return {kind:"overLimit",actual:o};let a$1=ne(e),s=a$1===void 0?Wt(e.bytes):e.bytes;a$1===void 0&&r?.onOwnedByteCopy?.(),a$1===void 0&&r?.onHash?.();let l=a$1??a(s);if(e.hash!==l)return {kind:"hashMismatch",expectedHash:e.hash,actualHash:l};let i=we(s,e.faceIndex);if(!i.valid)return {kind:"malformed",diagnostic:i.diagnostic};r?.onTableScan?.();let d=rr(s,e.faceIndex);try{let y=n(s,e.faceIndex);if(!y.valid)return {kind:"malformed",diagnostic:y.diagnostic}}catch(y){return {kind:"malformed",diagnostic:y instanceof Error?y.message:"font validator threw"}}let c={kind:"resolved",font:Zt({...e,byteLength:s.byteLength},s,d)};return r?.onAdmission?.(),c},Ye=e=>{let t=e.epoch,n=e.maxFontBytes,r=e.validateFont,o=e.instrumentation,a=e.resources,s=e.substitutions;if(!Number.isSafeInteger(t)||t<0)throw new RangeError("Font resource epoch must be a non-negative safe integer");if(!Number.isSafeInteger(n)||n<=0||n>ee)throw new RangeError(`Font byte ceiling must be a positive safe integer no greater than ${ee}`);if(typeof r!="function")throw new TypeError("Font snapshot requires a validator");let l=a.length,i=s?.length??0;if(l>D)throw new RangeError(`Font source count must not exceed ${D}`);if(i>D)throw new RangeError(`Font substitution count must not exceed ${D}`);let d=0,c=[];for(let m=0;m<l;m+=1){let u=a[m];if(ne(u)!==void 0){let v=u.availability==="forbidden"?0:te(u.bytes);if(v>V-d)throw new RangeError(`Aggregate font bytes must not exceed ${V}`);d+=v,c.push(u);continue}let g=Ke(u.request),f=u.id,E=u.hash,F=u.faceIndex,T=u.availability,h=T==="forbidden"?er:u.bytes,p=T==="forbidden"?0:te(h);if(p>V-d)throw new RangeError(`Aggregate font bytes must not exceed ${V}`);d+=p,c.push(Object.freeze({request:g,id:f,bytes:h,hash:E,faceIndex:F,...T?{availability:T}:{}}));}let y=[];if(s)for(let m=0;m<i;m+=1){let u=s[m],g=Ke(u.from),f=Ke(u.to),E=u.lineMetrics;y.push(Object.freeze({from:g,to:f,...E?{lineMetrics:Object.freeze({heightEm:E.heightEm,baselineEm:E.baselineEm})}:{}}));}let S=new Map;for(let m of c){let u=W(m.request);S.has(u)||S.set(u,or(m,n,r,o));}let b=new Map;for(let m of y){let u=W(m.from);b.has(u)||b.set(u,Object.freeze({to:K(m.to),...m.lineMetrics?{lineMetrics:Xt(m.lineMetrics)}:{}}));}return Object.freeze({epoch:t,resolve:m=>{let u=K(m),g=W(u),f=b.get(g),E=f?.to??u,F=S.get(W(E));return F?F.kind==="forbidden"?new j("forbidden",u):F.kind==="overLimit"?new j("overLimit",u,{limit:n,actual:F.actual}):F.kind==="malformed"?new j("malformed",u,{diagnostic:F.diagnostic}):F.kind==="hashMismatch"?new j("hashMismatch",u,{expectedHash:F.expectedHash,actualHash:F.actualHash}):f?Zt({request:F.font.request,id:F.font.id,hash:F.font.hash,faceIndex:F.font.faceIndex,byteLength:F.font.byteLength},Ee(F.font),Ce(F.font),{requested:u,resolved:f.to,...f.lineMetrics?{lineMetrics:f.lineMetrics}:{}}):F.font:new j("missing",u)}})};var M=e=>{if(!Number.isSafeInteger(e))throw new RangeError("Fixed-point value must be a safe integer");return e},Oe=(e,t)=>{if(e.trim().length===0||/[\u0000-\u001f\u007f]/.test(e))throw new TypeError(`${t} must be non-blank and contain no control characters`)},ar=(e,t)=>{if(!/^[\x20-\x7e]{4}$/.test(e))throw new TypeError(`${t} must be a four-byte ASCII tag`)},Qt=(e,t,n)=>{let r=Object.entries(e).sort(([a],[s])=>a<s?-1:a>s?1:0),o=Object.create(null);for(let[a,s]of r){if(ar(a,`${t} key`),!Number.isFinite(s)||n&&(!Number.isSafeInteger(s)||s<0))throw new RangeError(`${t} value must be ${n?"a non-negative safe integer":"finite"}`);if(n&&s>4294967295)throw new RangeError(`${t} value must fit an unsigned 32-bit integer`);o[a]=s;}return Object.freeze(o)},$e=e=>Object.freeze({family:e.family,weight:e.weight,style:e.style}),ir=e=>e?Object.freeze({requested:$e(e.requested),resolved:$e(e.resolved),...e.lineMetrics?{lineMetrics:Object.freeze({...e.lineMetrics})}:{}}):void 0,en=new WeakSet,Je=e=>{if(re(e),!en.has(e)){if(e.identity!==`${e.hash}#${e.faceIndex}`)throw new TypeError("Resolved font identity does not match hash and face index");if(!Number.isSafeInteger(e.byteLength)||e.byteLength<0)throw new TypeError("Resolved font byte length is invalid");en.add(e);}},Ze=e=>(Je(e),e),Te=e=>(Je(e),Object.freeze({identity:e.identity,id:e.id,family:e.family,request:$e(e.request),hash:e.hash,faceIndex:e.faceIndex,byteLength:e.byteLength,substitution:ir(e.substitution)??null})),Y=e=>{if(Oe(e.shapingLibrary.name,"shaping library name"),Oe(e.shapingLibrary.version,"shaping library version"),Oe(e.unicodeDataVersion,"Unicode data version"),!/^\d+(?:\.\d+){0,3}(?:[-+][0-9A-Za-z.-]+)?$/.test(e.shapingLibrary.version))throw new TypeError("shaping library version must be a numeric version");if(!/^\d+(?:\.\d+){1,2}$/.test(e.unicodeDataVersion))throw new TypeError("Unicode data version must be a dotted numeric version");if(!/^[A-Z][a-z]{3}$/.test(e.script))throw new TypeError("script must be a four-letter ISO 15924 code");if(Oe(e.language,"language"),!/^(?:und|[A-Za-z]{2,8})(?:-[A-Za-z0-9]{1,8})*$/.test(e.language))throw new TypeError("language must be a BCP 47 language tag");if(e.direction!=="ltr"&&e.direction!=="rtl")throw new TypeError("direction must be ltr or rtl");if(!["none","NFC","NFD","NFKC","NFKD"].includes(e.normalization))throw new TypeError("invalid normalization policy");if(!["halfAwayFromZero","halfToEven","towardZero"].includes(e.roundingMode))throw new TypeError("invalid fixed-point rounding mode");if(!Number.isSafeInteger(e.fixedPointScale)||e.fixedPointScale<=0)throw new RangeError("fixed-point scale must be a positive safe integer");let t=Ze(e.font),n=e.fallbackOrder.map(Ze),r=new Set;for(let o of n){let a=JSON.stringify(Te(o));if(r.has(a))throw new TypeError("fallback order contains a duplicate font");r.add(a);}return Object.freeze({font:t,variationAxes:Qt(e.variationAxes,"variation axis",false),shapingLibrary:Object.freeze({name:e.shapingLibrary.name,version:e.shapingLibrary.version}),unicodeDataVersion:e.unicodeDataVersion,normalization:e.normalization,script:e.script,language:e.language,direction:e.direction,features:Qt(e.features,"OpenType feature",true),fallbackOrder:Object.freeze([...n]),fixedPointScale:e.fixedPointScale,roundingMode:e.roundingMode})},nn=e=>{let t=Y(e);return Object.freeze({font:Te(t.font),variationAxes:Object.freeze(Object.entries(t.variationAxes).map(n=>Object.freeze(n))),shapingLibrary:Object.freeze({name:t.shapingLibrary.name,version:t.shapingLibrary.version}),unicodeDataVersion:t.unicodeDataVersion,normalization:t.normalization,script:t.script,language:t.language,direction:t.direction,features:Object.freeze(Object.entries(t.features).map(n=>Object.freeze(n))),fallbackOrder:Object.freeze(t.fallbackOrder.map(Te)),fixedPointScale:t.fixedPointScale,roundingMode:t.roundingMode})},Qe=e=>JSON.stringify(nn(e)),q=(e,t)=>{if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`${t} must be a non-negative safe integer`)},B=e=>{try{return M(e)}catch{throw new RangeError("Shaped run contains a non-integer fixed-point value")}},tn=new WeakMap,Ie=e=>{let t=tn.get(e);if(t)return t;Je(e);let n=JSON.stringify({identity:e.identity,id:e.id,family:e.family,request:e.request,hash:e.hash,faceIndex:e.faceIndex,byteLength:e.byteLength,substitution:e.substitution??null});return tn.set(e,n),n},Le=(e,t)=>{let n=Y(t);if(e.direction!=="ltr"&&e.direction!=="rtl")throw new TypeError("Shaped run direction must be ltr or rtl");if(e.direction!==n.direction)throw new TypeError("Shaped run direction does not match shaping environment");if(q(e.bidiLevel,"bidi level"),(e.bidiLevel&1)===1!=(e.direction==="rtl"))throw new TypeError("Shaped run direction does not match bidi level parity");let r=new Map,o=e.glyphs.map(i=>{q(i.id,"glyph id"),q(i.cluster,"glyph cluster");let d=r.get(i.outline);if(!d){if(!Number.isSafeInteger(i.outline.unitsPerEm)||i.outline.unitsPerEm<=0)throw new RangeError("Glyph outline units per em must be a positive safe integer");d=Object.isFrozen(i.outline)?i.outline:Object.freeze({path:i.outline.path,unitsPerEm:i.outline.unitsPerEm}),r.set(i.outline,d);}return Object.freeze({id:i.id,cluster:i.cluster,originX:B(i.originX),originY:B(i.originY),advanceX:B(i.advanceX),advanceY:B(i.advanceY),offsetX:B(i.offsetX),offsetY:B(i.offsetY),outline:d})}),a=e.fontSpans.map(i=>{if(q(i.glyphStart,"font span start"),q(i.glyphEnd,"font span end"),i.glyphEnd<=i.glyphStart||i.glyphEnd>o.length)throw new RangeError("Font span glyph range is invalid");i.fallbackIndex!==null&&q(i.fallbackIndex,"fallback index");let d=Ze(i.font);if(i.fallbackIndex===null){if(Ie(d)!==Ie(n.font))throw new TypeError("Shaped primary font does not match shaping environment")}else {let c=n.fallbackOrder[i.fallbackIndex];if(!c)throw new RangeError("Shaped fallback index is outside fallback order");if(Ie(d)!==Ie(c))throw new TypeError("Shaped fallback font does not match shaping environment provenance")}return Object.freeze({...i,font:d})});for(let i=0;i<a.length;i+=1){let d=i===0?0:a[i-1].glyphEnd;if(a[i].glyphStart!==d)throw new RangeError("Font spans must cover glyphs contiguously")}if(o.length===0&&a.length!==0||o.length>0&&a.at(-1)?.glyphEnd!==o.length)throw new RangeError("Font spans must cover every glyph exactly once");let s=e.clusters.map(i=>{for(let[c,y]of [["cluster text start",i.textStart],["cluster text end",i.textEnd],["cluster glyph start",i.glyphStart],["cluster glyph end",i.glyphEnd],["cluster font span",i.fontSpan]])q(y,c);if(i.textEnd<=i.textStart||i.textEnd>e.text.length||i.glyphEnd<=i.glyphStart||i.glyphEnd>o.length)throw new RangeError("Shaped cluster range is invalid");let d=a[i.fontSpan];if(!d||i.glyphStart<d.glyphStart||i.glyphEnd>d.glyphEnd)throw new RangeError("Shaped cluster does not belong to its declared font span");return Object.freeze({...i,advance:B(i.advance),caretEdges:Object.freeze(i.caretEdges.map(B))})}),l=Object.freeze({ascent:B(e.metrics.ascent),descent:B(e.metrics.descent),lineGap:B(e.metrics.lineGap)});return Object.freeze({text:e.text,direction:e.direction,bidiLevel:e.bidiLevel,glyphs:Object.freeze(o),clusters:Object.freeze(s),fontSpans:Object.freeze(a),metrics:l})},sr=(e,t)=>{let n=Le(e,t);return Object.freeze({text:n.text,direction:n.direction,script:t.script,language:t.language,bidiLevel:n.bidiLevel,glyphs:n.glyphs,clusters:n.clusters,fontSpans:Object.freeze(n.fontSpans.map(r=>Object.freeze({glyphStart:r.glyphStart,glyphEnd:r.glyphEnd,fallbackIndex:r.fallbackIndex,font:Te(r.font)}))),metrics:n.metrics})};var $=Object.freeze({name:"HarfBuzz",version:"14.4.0"}),ce=null,le=null;function tt(){return ce?Promise.resolve():le||(le=import('./dist-PKZR6RSH.js').then(e=>{let t=e.versionString();if(t!==$.version)throw new w("shapingLibraryMismatch",{diagnostic:f($.version,t)});ce=e;}).catch(e$1=>{throw le=null,e$1 instanceof w?e$1:c(e$1)?new w("unsupportedRuntime",{diagnostic:d(e$1),cause:e$1}):new w("wasmUnavailable",{diagnostic:e(e$1),cause:e$1})}),le)}function lr(){return ce!==null}function dr(){if(!ce)throw new w("notInitialized",{diagnostic:"Call initializeHarfBuzz() before creating a text shaper"});return ce}var w=class extends Error{name="HarfBuzzShapingError";code;limit;actual;diagnostic;constructor(t,n={}){super(`HarfBuzz shaping failed (${t})`,{cause:n.cause}),this.code=t,this.limit=n.limit,this.actual=n.actual,this.diagnostic=n.diagnostic;}},cr=16*1024*1024,ur=1e6,pr=1e6,yr=1e6,fr=4,hr=512,mr=1024*1024,gr=16*1024*1024,br=32*1024*1024,Sr=64*1024*1024,xr=64*1024*1024,Rr=1e6,Fr=1e6,vr=1e6,Er=64,Cr=4096,wr=4*1024*1024,Or=64*1024*1024,Ir=64*1024*1024,Tr=256*1024*1024,Lr=new Set(["COLR","CPAL","CBDT","CBLC","sbix","SVG "]),rn=["cmap","head","hhea","hmtx","maxp"],Ar=(e,t)=>e[t]<<8|e[t+1],Br=(e,t)=>e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0,Pr=(e,t)=>String.fromCharCode(e[0],e[1],e[2],e[3])==="ttcf"?Br(e,12+t*4):0,_r=(e,t)=>{let n=Pr(e,t),r=Ar(e,n+4),o=new Set;for(let a=0;a<r;a+=1){let s=n+12+a*16;o.add(String.fromCharCode(e[s],e[s+1],e[s+2],e[s+3]));}return o},Mr=e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),zr=(e,t)=>{let n=we(e,t);if(!n.valid)return n;let r=_r(e,t);for(let o of rn)if(!r.has(o))return {valid:false,diagnostic:`missing required ${o} table`};return {valid:true}},nt=zr,z=(e,t,n)=>{if(!Number.isSafeInteger(e)||e<=0||e>n)throw new RangeError(`${t} must be a positive safe integer no greater than ${n}`);return e},Nr=(e,t,n)=>{let r=e<0n,o=r?-e:e,a=o/t,s=o%t;if(n!=="towardZero"){let d=s*2n;(d>t||d===t&&(n==="halfAwayFromZero"||n==="halfToEven"&&a%2n!==0n))&&(a+=1n);}let l=r?-a:a,i=Number(l);if(!Number.isSafeInteger(i))throw new RangeError("Shaped fixed-point value exceeds the safe integer range");return i},on=(e,t,n,r)=>{if(!Number.isSafeInteger(e))throw new RangeError("font units must be a safe integer");if(!Number.isSafeInteger(t)||t<=0)throw new RangeError("fixed-point denominator must be a positive safe integer");if(!Number.isSafeInteger(n)||n<0)throw new RangeError("fixed-point numerator must be a non-negative safe integer");return M(Nr(BigInt(e)*BigInt(n),BigInt(t),r))},kr=(e,t,n,r)=>{if(!Number.isSafeInteger(t)||t<=0)throw new RangeError("font size must be a positive integer number of half points");if(t>Math.floor(Number.MAX_SAFE_INTEGER/n))throw new RangeError("font size and fixed-point scale product exceeds the safe integer range");let o=t*n,a=e*2;return s=>on(s,a,o,r)},Dr=(e,t)=>{if(t.length===0)return [];let n=[...new Set(t.map(s=>s.cluster))].sort((s,l)=>s-l),r=new Map;for(let s=0;s<n.length;s+=1)r.set(n[s],n[s+1]??e.length);let o=[],a=0;for(;a<t.length;){let s=t[a].cluster,l=a+1;for(;l<t.length&&t[l].cluster===s;)l+=1;let i=t.slice(a,l).reduce((c,y)=>c+y.advanceX,0),d=M(i);o.push({textStart:s,textEnd:r.get(s),glyphStart:a,glyphEnd:l,advance:d,caretEdges:Object.freeze([M(0),d]),fontSpan:0}),a=l;}return o},N=64,H=8,Z=8,Hr=32,an=N+2*H,Gr=N+H+Z,Ur=N+H+Z,jr=N+H+Z,sn=N+8*H,ln=N+8*Z+H,Vr=N+6*Z+H,Wr=N+3*Z+2*H,Kr=N+3*Z,ue=e=>N+e.length*Uint16Array.BYTES_PER_ELEMENT,rt=e=>jr+ue(e),de=e=>Hr+e*H,Xr=(e,t)=>an+ue(e)+Gr+rt(t),qr=e=>sn+ue(e)+de(e.length)+e.length*ln,Yr=e=>{let t=new Set(e.glyphs.map(n=>n.outline));return sn+ue(e.text)+de(e.glyphs.length)+e.glyphs.length*ln+de(e.clusters.length)+e.clusters.length*Vr+e.clusters.reduce((n,r)=>n+de(r.caretEdges.length),0)+de(e.fontSpans.length)+e.fontSpans.length*Wr+Kr+[...t].reduce((n,r)=>n+rt(r.path),0)},$r=(e,t)=>an+ue(e)+Ur+t,et=class{#t;#c;#u;#p;#y;#g;#b;#f;#h;#s;#m;#l;#e;#o=new Map;#a=new Map;#n=new Map;#i=0;#r=0;#d;constructor(t,n){this.#t=t,this.#c=z(n.maxFontBytes??cr,"maximum font bytes",xr),this.#u=z(n.maxInputUtf16??ur,"maximum input UTF-16 code units",Rr),this.#p=z(n.maxCodepoints??pr,"maximum input code points",Fr),this.#y=z(n.maxGlyphs??yr,"maximum shaped glyphs",vr),this.#g=z(n.maxCachedFaces??fr,"maximum cached faces",Er),this.#b=z(n.maxCachedShapes??hr,"maximum cached shape results",Cr),this.#f=z(n.maxOutlineBytes??mr,"maximum outline bytes",wr),this.#h=z(n.maxCachedOutlineBytes??gr,"maximum cached outline bytes",Or),this.#s=z(n.maxShapedRunBytes??br,"maximum shaped run bytes",Ir),this.#m=z(n.maxCachedShapeBytes??Sr,"maximum cached shape bytes",Tr),this.#l=n.instrumentation?.onFaceCacheEvent,this.#e=n.instrumentation,this.#d=new this.#t.Buffer;}dispose(){this.#o.clear(),this.#a.clear(),this.#n.clear(),this.#i=0,this.#r=0,this.#e?.onOutlineCacheEvent?.(Object.freeze({kind:"cleared",retainedBytes:0})),this.#e?.onShapeCacheEvent?.(Object.freeze({kind:"cleared",retainedBytes:0})),this.#d=void 0;}#x(t,n){let r=this.#o.get(t.identity);if(r)return this.#o.delete(t.identity),this.#o.set(t.identity,r),this.#l?.(Object.freeze({kind:"hit",identity:t.identity})),r;let o=Ce(t);for(let c of rn)if(!o.has(c))throw new w("malformedFont",{diagnostic:`missing required ${c} table`});this.#e?.onByteCopy?.();let a=new this.#t.Blob(Mr(n)),s=new this.#t.Face(a,t.faceIndex),l=new this.#t.Font(s),i=l.hExtents();if(!Number.isSafeInteger(s.upem)||s.upem<=0||!Number.isSafeInteger(i.ascender)||!Number.isSafeInteger(i.descender)||!Number.isSafeInteger(i.lineGap))throw new w("malformedFont",{diagnostic:"invalid font units or horizontal metrics"});if(l.setScale(s.upem,s.upem),this.#o.size>=this.#g){let c=this.#o.keys().next().value;c!==void 0&&(this.#o.delete(c),this.#l?.(Object.freeze({kind:"evicted",identity:c})));}let d={identity:t.identity,blob:a,face:s,font:l,unitsPerEm:s.upem};return this.#o.set(t.identity,d),this.#l?.(Object.freeze({kind:"created",identity:t.identity})),d}#R(t,n,r){let o=JSON.stringify([t.identity,t.unitsPerEm,r,n]),a=this.#a.get(o);if(a)return this.#a.delete(o),this.#a.set(o,a),this.#e?.onOutlineCacheEvent?.(Object.freeze({kind:"hit",retainedBytes:this.#i})),a.outline;this.#e?.onOutlinePathCall?.();let s=t.font.glyphToPath(n),l=rt(s);if(l>this.#f)throw new w("outlineOverLimit",{limit:this.#f,actual:l});let i=Object.freeze({path:s,unitsPerEm:t.unitsPerEm}),d=Xr(o,s);if(d>this.#h)return this.#e?.onOutlineCacheEvent?.(Object.freeze({kind:"skipped",retainedBytes:this.#i})),i;for(;this.#i+d>this.#h;){let c=this.#a.keys().next().value;if(c===void 0)break;let y=this.#a.get(c);this.#a.delete(c),this.#i-=y.bytes,this.#e?.onOutlineCacheEvent?.(Object.freeze({kind:"evicted",retainedBytes:this.#i}));}return this.#a.set(o,{outline:i,bytes:d}),this.#i+=d,this.#e?.onOutlineCacheEvent?.(Object.freeze({kind:"created",retainedBytes:this.#i})),i}#S(t){if(t.length>this.#u)throw new w("textOverLimit",{limit:this.#u,actual:t.length});let n=0;for(let r=0;r<t.length;){let o=t.codePointAt(r);if(r+=o>65535?2:1,n+=1,n>this.#p)throw new w("codepointsOverLimit",{limit:this.#p,actual:n})}}shape(t){if(!this.#d)throw new w("disposed");if(re(t.environment.font),t.environment.font.byteLength>this.#c)throw new w("fontOverLimit",{limit:this.#c,actual:t.environment.font.byteLength});this.#S(t.text);let n=qr(t.text);if(n>this.#s)throw new w("shapedRunOverLimit",{limit:this.#s,actual:n});let r=Y(t.environment),o=JSON.stringify([t.text,t.fontSizeHalfPoints,t.bidiLevel,Qe(r)]),a=this.#n.get(o);if(a)return this.#n.delete(o),this.#n.set(o,a),this.#e?.onShapeCacheEvent?.(Object.freeze({kind:"hit",retainedBytes:this.#r})),a.run;if(this.#e?.onShapeCacheEvent?.(Object.freeze({kind:"miss",retainedBytes:this.#r})),r.shapingLibrary.name!==$.name||r.shapingLibrary.version!==$.version)throw new w("shapingLibraryMismatch");if(r.normalization!=="none")throw new w("unsupportedNormalization");if(!Number.isSafeInteger(t.bidiLevel)||t.bidiLevel<0||(t.bidiLevel&1)===1!=(r.direction==="rtl"))throw new w("invalidBidiLevel");if(Object.keys(r.variationAxes).length>0)throw new w("unsupportedVariationAxes");if(r.fallbackOrder.length>0)throw new w("unsupportedFallback");let s=Ee(r.font),l=Ce(r.font);if([...Lr].some(d=>l.has(d)))throw new w("unsupportedColorFont");let i=t.text;this.#S(i);try{let d=this.#x(r.font,s),{face:c,font:y}=d,S=this.#d;S.reset(),S.addText(i),S.setDirection(r.direction==="rtl"?this.#t.Direction.RTL:this.#t.Direction.LTR),S.setScript(r.script),S.setLanguage(r.language),S.setClusterLevel(this.#t.ClusterLevel.MONOTONE_CHARACTERS);let b=Object.entries(r.features).map(([R,C])=>new this.#t.Feature(R,C));this.#e?.onShapeCall?.(),this.#t.shape(y,S,b);let x=S.getGlyphInfosAndPositions();if(x.length>this.#y)throw new w("glyphOverLimit",{limit:this.#y,actual:x.length});let m=kr(c.upem,t.fontSizeHalfPoints,r.fixedPointScale,r.roundingMode),u=M(0),g=M(0),f=new Map,E=JSON.stringify(Object.entries(r.variationAxes).sort(([R],[C])=>R.localeCompare(C))),F=x.map(R=>{let C=m(R.xAdvance??0),O=m(R.yAdvance??0),I={id:R.codepoint,cluster:R.cluster,originX:u,originY:g,advanceX:C,advanceY:O,offsetX:m(R.xOffset??0),offsetY:m(R.yOffset??0),outline:f.get(R.codepoint)??(()=>{let L=this.#R(d,R.codepoint,E);return f.set(R.codepoint,L),L})()};return u=M(u+C),g=M(g+O),I}),T=y.hExtents(),h=Le({text:i,direction:r.direction,bidiLevel:t.bidiLevel,glyphs:F,clusters:Dr(i,F),fontSpans:F.length===0?[]:[{glyphStart:0,glyphEnd:F.length,font:r.font,fallbackIndex:null}],metrics:{ascent:m(T.ascender),descent:m(-T.descender),lineGap:m(T.lineGap)}},r),p=Yr(h);if(p>this.#s)throw new w("shapedRunOverLimit",{limit:this.#s,actual:p});let v=$r(o,p);if(v>this.#m)return this.#e?.onShapeCacheEvent?.(Object.freeze({kind:"skipped",retainedBytes:this.#r})),h;for(;this.#n.size>=this.#b||this.#r+v>this.#m;){let R=this.#n.keys().next().value;if(R===void 0)break;let C=this.#n.get(R);this.#n.delete(R),this.#r-=C.bytes,this.#e?.onShapeCacheEvent?.(Object.freeze({kind:"evicted",retainedBytes:this.#r}));}return this.#n.set(o,{run:h,bytes:v}),this.#r+=v,this.#e?.onShapeCacheEvent?.(Object.freeze({kind:"stored",retainedBytes:this.#r})),h}catch(d){throw d instanceof w?d:new w("malformedFont",{diagnostic:d instanceof Error?d.message:"HarfBuzz shaping failed"})}}},ot=(e={})=>new et(dr(),e);var dn=Object.freeze({maxFontBytes:16*1024*1024,maxInputUtf16:1e6,maxCodepoints:1e6,maxGlyphs:1e6,maxCachedFaces:4,maxCachedShapes:512,maxOutlineBytes:1024*1024,maxCachedOutlineBytes:16*1024*1024,maxShapedRunBytes:32*1024*1024,maxCachedShapeBytes:64*1024*1024});function cn(e){let t={maxFontBytes:e.maxFontBytes,maxInputUtf16:e.maxInputUtf16,maxCodepoints:e.maxCodepoints,maxGlyphs:e.maxGlyphs,maxOutlineBytes:e.maxOutlineBytes,maxShapedRunBytes:e.maxShapedRunBytes},n=["docx-editor-layout-harfbuzz-execution-policy",1,Object.entries(t).sort(([r],[o])=>r<o?-1:r>o?1:0).map(([r,o])=>Object.freeze([r,o]))];return `layout-shaper-policy:sha256:${a(new TextEncoder().encode(JSON.stringify(n)))}`}var Zr=Object.freeze({}),un=D,Jr="16.0.0",Qr="none",eo=1e3,to="halfToEven",fn="cluster-edges-only",no="Latn",ro=new Uint8Array(0);var G=class extends Error{code="overLimit";constructor(t){super(t),this.name="LayoutShapingConfigurationError";}};function oo(e,t){let n=e.epoch,r=e.maxFontBytes,o=e.sources,a=e.substitutions,s=e.defaultFont,l=e.language;if(!Number.isSafeInteger(r)||r<=0||r>ee)throw new G(`Font byte ceiling must not exceed the engine hard maximum of ${ee}`);let i=o.length,d=a?.length??0;if(i===0||i>D)throw new G(`Font source count must be between 1 and ${D}`);if(d>un)throw new G(`Font substitution count must not exceed ${un}`);let c=0,y=[];for(let x=0;x<i;x+=1){let m=o[x],u=m.request,g=m.availability,f=m.id,E=m.hash,F=m.faceIndex,T=g==="forbidden",h=T?ro:m.bytes;if(!T){if(typeof f!="string"||f.length===0)throw new TypeError("Resolved font id must not be empty");let p;try{p=te(h);}catch{throw new G(`Font source ${f} must provide genuine bytes`)}if(p>r)throw new G(`Font source ${f} exceeds the per-font byte ceiling`);if(c+=p,c>V)throw new G(`Font sources exceed the aggregate byte ceiling of ${V}`)}y.push(t&&ne(m)!==void 0?m:Object.freeze({request:Object.freeze({family:u.family,weight:u.weight,style:u.style}),id:f,bytes:h,hash:E,faceIndex:F,...g?{availability:g}:{}}));}let S;if(a){S=[];for(let x=0;x<d;x+=1){let m=a[x],u=m.from,g=m.to,f=m.lineMetrics;S.push(Object.freeze({from:Object.freeze({family:u.family,weight:u.weight,style:u.style}),to:Object.freeze({family:g.family,weight:g.weight,style:g.style}),...f?{lineMetrics:Object.freeze({heightEm:f.heightEm,baselineEm:f.baselineEm})}:{}}));}}let b={epoch:n,maxFontBytes:r,sources:Object.freeze(y),substitutions:S?Object.freeze(S):void 0,defaultFont:Object.freeze({family:s.family,sizeHalfPoints:s.sizeHalfPoints}),language:l};return Object.freeze(b)}function pn(e,t){let n=e.map((o,a)=>({value:o,index:a,key:W(t(o))})),r=new Set;for(let o of n){if(r.has(o.key))return e;r.add(o.key);}return n.sort((o,a)=>o.key<a.key?-1:o.key>a.key?1:o.index-a.index).map(({value:o})=>o)}function ao(e,t){let n={family:e.family},r={sizeHalfPoints:e.sizeHalfPoints};return {...n,...t?r:{}}}function yn(e,t){let n=i=>({family:i.family,weight:i.weight,style:i.style}),r=t?e.sources:pn(e.sources,i=>i.request),o=e.substitutions??[],a=t?o:pn(o,i=>i.from),s={sources:r.map(i=>{let d=i.availability??"available",c={request:n(i.request),availability:d};if(d==="forbidden")return {...c,...t?{id:i.id,faceIndex:i.faceIndex,declaredHash:i.hash}:{}};let y=ne(i);if(y==null)throw new TypeError("Font configuration identity requires prepared source bytes");return {...c,...t?{id:i.id}:{},faceIndex:i.faceIndex,declaredHash:i.hash,actualHash:y,byteLength:i.bytes.byteLength}}),substitutions:a.map(i=>({from:n(i.from),to:n(i.to),lineMetrics:i.lineMetrics?{heightEm:i.lineMetrics.heightEm,baselineEm:i.lineMetrics.baselineEm}:null})),defaultFont:ao(e.defaultFont,t),language:e.language||"en"},l={epoch:e.epoch,maxFontBytes:e.maxFontBytes};return {version:1,...t?l:{},...s}}var io=Symbol("prepared-layout-font-configuration"),Ae=new WeakMap;function so(e){return Ae.has(e)}function lo(e){let t=Ae.get(e);if(!t)throw new TypeError("Invalid prepared layout font configuration");return t.configuration}function La(e){let t=Ae.get(e);if(!t)throw new TypeError("Invalid prepared layout font configuration");return t.sharedShapingFingerprint}function at(e,t){return hn(e,t,false)}function Aa(e,t){return hn(e,t,true)}function hn(e,t,n){let r=oo(e,n),o=Object.freeze({epoch:r.epoch,maxFontBytes:r.maxFontBytes,sources:Object.freeze(r.sources.map(y=>n&&ne(y)!==void 0?y:Kt(y,{onOwnedByteCopy:t?.onFontByteCopy,onHash:t?.onFontHash}))),substitutions:r.substitutions,defaultFont:r.defaultFont,language:r.language}),a$1=new TextEncoder,s=yn(o,true),l=a$1.encode(JSON.stringify(s)),i=yn(o,false),d=a$1.encode(JSON.stringify(i)),c=Object.freeze({[io]:true,fingerprint:`font-config:${a(l)}`});return Ae.set(c,{configuration:o,sharedShapingFingerprint:`shared-font-config:${a(d)}`}),c}function co(e){return at(e).fingerprint}function uo(e,t){let n=new TextEncoder().encode(JSON.stringify({version:1,environment:e,executionPolicy:cn(t),ligatureCaretPolicy:fn,fallback:a$1}));return `shaping:${a(n)}`}async function mn(e,t,n,r){let a=so(e)?e:at(e,t),s=lo(a),{epoch:l,maxFontBytes:i,sources:d,substitutions:c,defaultFont:y}=s,S=s.language||"en",b=a.fingerprint,x=Ye({epoch:l,maxFontBytes:i,resources:d,substitutions:c,validateFont:nt,instrumentation:{onOwnedByteCopy:t?.onFontByteCopy,onHash:t?.onFontHash,onAdmission:t?.onFontAdmission}});await tt();let m=Object.freeze({script:no,variationAxes:Object.freeze({}),shapingLibrary:$,unicodeDataVersion:Jr,normalization:Qr,language:S,features:Zr,fixedPointScale:eo,roundingMode:to});return Object.freeze({fonts:x,shaper:n??ot(r),defaultFont:y,environment:m,ligatureCaretPolicy:fn,operation:Object.freeze({resourceEpoch:x.epoch,configEpoch:l,extensionFingerprint:b,shapingHash:uo(m,r),producerVersion:1})})}async function po(e,t){return mn(e,t,void 0,dn)}async function Ba(e,t,n,r){return mn(e,r,t,n)}function yo(e){e.shaper.dispose?.();}function it(e){let t=new Set([0,e.text.length]);for(let r$1 of r(e.text))t.add(r$1.utf16From),t.add(r$1.utf16To);let n=new Set([0,e.text.length]);for(let r of e.clusters)n.add(r.textStart),n.add(r.textEnd);return [...t].filter(r=>n.has(r)).sort((r,o)=>r-o)}function Be(e,t){return it(e).includes(t)}function fo(e,t){return Be(e,t)}function ho(e,t,n){return n>=t&&Be(e,t)&&Be(e,n)}function mo(e){let t=r(e.text);return it(e).map(n=>n===e.text.length?t.length:t.findIndex(r=>r.utf16From===n))}var lt="und";function xn(){return typeof Intl.Segmenter=="function"}function go(){let e=Intl.Segmenter;if(typeof e!="function")throw new Error(`Intl.Segmenter is required for word segmentation (locale: ${lt})`);return e}function Rn(){let e=new(go())(lt,{granularity:"word"});return {segment(t){let n=[];for(let r of e.segment(t)){let o=r.index,a=o+r.segment.length;n.push({utf16From:o,utf16To:a,wordLike:r.isWordLike===true});}return n}}}var bo=/^[\p{L}\p{N}']$/u,So=/^\s$/u;function gn(e){return bo.test(e)}function bn(e){return So.test(e)}function st(e,t,n,r){let o=e[t],a=e[n-1];return {utf16From:o.utf16From,utf16To:a.utf16To,wordLike:r}}function Fn(e){let t=r(e);if(t.length===0)return [];let n=[],r$1=0;for(;r$1<t.length;){let o=t[r$1];if(bn(o.text)){let a=r$1+1;for(;a<t.length&&bn(t[a].text);)a+=1;n.push(st(t,r$1,a,false)),r$1=a;continue}if(gn(o.text)){let a=r$1+1;for(;a<t.length&&gn(t[a].text);)a+=1;n.push(st(t,r$1,a,true)),r$1=a;continue}n.push(st(t,r$1,r$1+1,false)),r$1+=1;}return n}function vn(){return {segment:Fn}}function En(e={}){let t=e.isIntlAvailable??xn,n=e.createIntlBoundary??Rn,r=e.createFallbackBoundary??vn;if(!t())return r();try{return n()}catch{return r()}}var Sn;function Cn(){return Sn??=En(),Sn}function xo(e,t=Cn()){return t.segment(e)}function Ro(e,t){return t.map(n=>({graphemeFrom:v(e,n.utf16From),graphemeTo:v(e,n.utf16To),wordLike:n.wordLike}))}var wn={resourceEpoch:"resource-scoped",configEpoch:"coarse-gate",extensionFingerprint:"coarse-gate",shapingHash:"coarse-gate",producerVersion:"coarse-gate"},ut=Object.keys(wn),On=ut.filter(e=>wn[e]==="coarse-gate"),Pe=(e,t)=>{if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`${t} must be a non-negative safe integer`)},oe=(e,t)=>{if(e.trim().length===0)throw new TypeError(`${t} must not be blank`)},Fo={resourceEpoch:Pe,configEpoch:Pe,extensionFingerprint:oe,shapingHash:oe,producerVersion:Pe},vo=(e,t)=>{Fo[t](e[t],t);},ae=e=>{for(let t of ut)vo(e,t);return Object.freeze({resourceEpoch:e.resourceEpoch,configEpoch:e.configEpoch,extensionFingerprint:e.extensionFingerprint,shapingHash:e.shapingHash,producerVersion:e.producerVersion})},Eo=(e,t)=>{let n=ae(e),r=ae(t),o=ut.filter(a=>n[a]!==r[a]);return o.length===0?Object.freeze({status:"current"}):Object.freeze({status:"restart",changed:Object.freeze(o)})},dt=e=>{let t=e.map(({key:n,fingerprint:r})=>(oe(n,"resource dependency key"),oe(r,"resource dependency fingerprint"),Object.freeze({key:n,fingerprint:r}))).sort((n,r)=>n.key<r.key?-1:n.key>r.key?1:0);for(let n=1;n<t.length;n+=1)if(t[n-1].key===t[n].key)throw new TypeError(`Duplicate resource dependency: ${t[n].key}`);return Object.freeze(t)},Co=e=>(Pe(e.revision,"revision"),oe(e.dependencyFingerprint,"dependencyFingerprint"),oe(e.inputFingerprint,"inputFingerprint"),Object.freeze({revision:e.revision,dependencyFingerprint:e.dependencyFingerprint,inputFingerprint:e.inputFingerprint,resourceDependencies:dt(e.resourceDependencies),...ae(e)})),wo=(e,t)=>{let n=dt(e),r=dt(t),o=Math.max(n.length,r.length);for(let a=0;a<o;a+=1){let s=n[a],l=r[a];if(s?.key!==l?.key||s?.fingerprint!==l?.fingerprint)return {hit:false,reason:"resource-changed",resourceKey:s?.key??l.key}}return null};function Oo(e,t){if(e.dependencyFingerprint!==t.dependencyFingerprint)return {hit:false,reason:"dependency-changed"};if(e.inputFingerprint!==t.inputFingerprint)return {hit:false,reason:"input-changed"};let n=wo(e.resourceDependencies,t.resourceDependencies);if(n)return n;for(let r of On)if(e[r]!==t[r])return {hit:false,reason:"epoch-changed",epoch:r};return null}var ct=class{entries=new Map;get(t,n){let r=this.entries.get(t);if(!r)return {hit:false,reason:"absent"};let o=Oo(r.provenance,n);return o||{hit:true,value:r.value,provenance:r.provenance}}set(t,n,r){this.entries.set(t,{value:n,provenance:Co(r)});}evictEpoch(t){let n=ae(t),r=0;for(let[o,a]of this.entries){let s=a.provenance;On.some(l=>s[l]!==n[l])&&(this.entries.delete(o),r+=1);}return r}evictResources(t,n){let r=ae(t),o=this.evictEpoch(r);for(let[a,s]of this.entries)s.provenance.resourceDependencies.some(i=>n.get(i.key)!==i.fingerprint)&&(this.entries.delete(a),o+=1);return o}get size(){return this.entries.size}};function In(e){return e.projected===true?null:e.range}function To(e,t,n){let{page:r,story:o,host:a,noteScopeId:s,noteAreaKind:l}=e,i=o==="header"||o==="footer"?d=>A(d,e.origin,{x:r.box.x,y:r.box.y}):void 0;J$1(a,(d,c)=>{let{textboxDepth:y,textboxOwner:S,textboxPath:b,storyOrigin:x}=c,m=y===0?o:"textbox";for(let u of d.lines){let g=[...Q$1(u)].sort((f,E)=>(t.get(f.paragraphId)??Number.MAX_SAFE_INTEGER)-(t.get(E.paragraphId)??Number.MAX_SAFE_INTEGER));for(let f of g)for(let E of f.spans)n({page:r,story:m,rootStory:o,root:e,storyOrigin:x,absoluteBox:Object.freeze({x:x.x+E.box.x,y:x.y+E.box.y,width:E.box.width,height:E.box.height}),noteScopeId:s,noteAreaKind:l,textboxDepth:y,textboxOwner:S,textboxPath:b,paragraph:d,paragraphId:f.paragraphId,line:u,span:E,sourceRange:In(E)});}},e.origin,i);}function Lo(e,t){let n=new Map(W$1(e).map((r,o)=>[r,o]));G$1(e,r=>To(r,n,t));}var Bn="Calibri, Carlito, Helvetica, Arial, sans-serif",Xa=new Map([["calibri","Carlito"]]),Ao=65536,Bo=256;function Tn(e,t){return e===void 0?Math.max(1,Math.floor(t)):Number.isFinite(e)&&e>0?Math.max(1,Math.floor(e)):1}function Ln(e){let t=new Map,n=0;return {get(r){let o=t.get(r);if(o!==void 0)return t.delete(r),t.set(r,o),o},set(r,o){for(t.has(r)&&t.delete(r),t.set(r,o);t.size>e;){let a=t.keys().next();if(a.done)break;t.delete(a.value),n+=1;}},get size(){return t.size},get evictions(){return n}}}var An=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u;function Pn(e=null){return e!=null&&typeof e.measureText=="function"}function _n(e={}){let t=e.scale??1;if(!(t>0)||!Number.isFinite(t))return null;let n=e.fallbackFamily??Bn,r$1=e.context??null;if(!Pn(r$1))return null;let o=r$1,a=Ln(Tn(e.maxWidthEntries,Ao)),s=Ln(Tn(e.maxMetricsEntries,Bo)),l=e.fontAlias,i=c=>{let y=c.fontFamily&&An.test(c.fontFamily)?c.fontFamily:null,S=y?l?.(y):void 0,b=S&&An.test(S)?S:null,x=y?b?`"${b}", "${y}", ${n}`:`"${y}", ${n}`:n,m=c.bold?"bold":"normal",u=c.italic?"italic":"normal",g=c.smallCaps?"small-caps":"normal",f=c.fontSizePt*(c.verticalAlign==="baseline"?1:.75)*t;return `${u} ${g} ${m} ${f}px ${x}`},d=(c,y,S)=>c/t*(S.horizontalScalePercent/100)+y.length*S.characterSpacingPt;return {measure(c,y){if(c.length===0)return 0;let S=i(y),b=`${S}\0${c}`,x=a.get(b);if(x!==void 0)return d(x,c,y);o.font=S;let m=o.measureText(c).width;return a.set(b,m),d(m,c,y)},inkBounds(c,y){if(!c||c.length>2||y.shaping?.direction==="rtl"||r(c).length!==1)return;o.font=i(y);let S=o.textAlign,b=o.direction,x;try{S!==void 0&&(o.textAlign="left"),b!==void 0&&(o.direction="ltr"),x=o.measureText(c);}finally{S!==void 0&&(o.textAlign=S),b!==void 0&&(o.direction=b);}let m=x.actualBoundingBoxLeft,u=x.actualBoundingBoxRight;if(m===void 0||u===void 0||!Number.isFinite(m)||!Number.isFinite(u))return;let g=y.horizontalScalePercent/(100*t);return {left:-m*g,right:u*g}},lineMetrics(c){let y=c.fontSizePt*(c.verticalAlign==="baseline"?1:.75),S=i(c),b=s.get(S);if(b)return b;let x=y*1.15,m=y*.8;o.font=S;let u=o.measureText("Hxg"),g=u.fontBoundingBoxAscent,f=u.fontBoundingBoxDescent;if(typeof g=="number"&&Number.isFinite(g)&&g>0&&(m=g/t,typeof f=="number"&&Number.isFinite(f)&&f>=0)){let F=(g+f)/t;F>0&&(x=Math.max(F,x));}x>0||(x=y*1.15);let E={height:x,baseline:m};return s.set(S,E),E}}}function Po(e=1,t={}){let n=_n({...t,scale:t.scale??e});return n?{measurer:n,producer:t.fontAlias?"canvas-measurer+embedded":"canvas-measurer"}:{measurer:b(),producer:"fixed-measurer"}}function _o(e){let t;return n=>{t===void 0&&(t=qa(e.pages)?.hosts??null);let r=t?.get(n);return r?oa$1(r.pageNumber,r.format):null}}function Mn(e,t){let n=Ja(e,t.displayMode??ua$1),r=Rb({numberingIndex:t.numberingIndex,styleCascade:t.styleCascade},n).listItems,o=t.package?{footnotesPart:Nf(t.package,"footnote"),endnotesPart:Nf(t.package,"endnote")}:void 0,a=ic(n,r,o,t.package?fc(t.package,e,n):void 0,t.displayMode??ua$1);return {blocks:n,notes:o,context:a}}function zn(e,t,n,r,o){for(let a of t){if(r.length>=gh)return;if(n.tokenForParagraph(a.id)!==""&&jh(e,a.id)===null)for(let s of ih(a)){if(r.length>=gh)return;if(!s.rewritable)continue;let l=ta$1(s.instruction);if(l===null)continue;let i=n.liveValueOf(s.fieldNodeId,l);if(i===null&&o&&n.pageRefProjectionOf){let d=n.pageRefProjectionOf(s.fieldNodeId,l);if(d){let c=o(d.targetParagraphId);c!==null&&c.length>0&&pa$1(d.calibration,d.cached,c,Number.NaN)&&(i=c);}}i===null||i===s.cachedText||i.length>hh||i.includes(`
2
- `)||i.includes("\r")||r.push({paragraphId:a.id,fieldNodeId:s.fieldNodeId,text:i});}}}function Mo(e,t){let{blocks:n,context:r}=Mn(e,t);if(r===null)return null;let o=[];return zn(e,Pb(n),r,o,t.pageRefPageNumberOf),o.length===0?null:{op:"refreshFieldResults",updates:o}}function ri(e,t){let{notes:n,context:r}=Mn(e,t);if(r===null||n===void 0)return [];let o=[],a=[{noteKind:"footnote",notesPart:n.footnotesPart},{noteKind:"endnote",notesPart:n.endnotesPart}];for(let{noteKind:s,notesPart:l}of a){if(!l)continue;let i=[];for(let d of gc(l,t.displayMode??ua$1)){if(i.length>=gh)break;zn(l,Pb(d),r,i);}i.length>0&&o.push({noteKind:s,op:{op:"refreshFieldResults",updates:i}});}return o}function zo(e){return e.box}function Nn(e,t){if(e.kind==="paragraph"){t.add(e.paragraphId);return}for(let n of e.rows)for(let r of n.cells)for(let o of r.blocks)Nn(o,t);}function No(e){let t=new Map,n=(o,a,s)=>{if(!(o.kind==="textValue"||s>wc*4)){for(let l of o.children)if(l.kind!=="textValue"){if(l.kind==="paragraph"){for(let i of r)t.get(i)?.push(l.id);n(l,l.id,s+1);continue}if(l.kind==="contentControl"){t.set(l.id,[]),r.push(l.id);let i=Gc(l);i&&n(i,a,s+1),r.pop();let d=t.get(l.id);d&&d.length===0&&a!==null&&d.push(a);continue}n(l,a,s+1);}}},r=[];return n(e,null,0),t}function ko(e,t){let n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return {x:n,y:r,width:Math.max(e.x+e.width,t.x+t.width)-n,height:Math.max(e.y+e.height,t.y+t.height)-r}}function Do(e,t){let n=Kc(e.root);if(n.length===0)return Ho;let r=new Map;t.pages.forEach((s,l)=>{(d=>{for(let c of d){let y=new Set;Nn(c,y);for(let S of y){let b=r.get(S)??[];b.push({pageIndex:l,box:zo(c)}),r.set(S,b);}}})(s.fragments);});let o=No(e.root),a=[];for(let s of n){let l=Ic(s.node),i=[...s.ancestors.map(S=>Ic(S).lock),l.lock],d=o.get(s.node.id)??[],c=new Map;for(let S of d)for(let b of r.get(S)??[]){let x=c.get(b.pageIndex);c.set(b.pageIndex,x?ko(x,b.box):b.box);}let y=[...c.entries()].sort((S,b)=>S[0]-b[0]).map(([S,b])=>({pageIndex:S,...b}));a.push({controlId:s.node.id,type:l.type,level:Jc(s.node),depth:s.depth,lock:l.lock,effectiveLock:Nc(i),showingPlaceholder:l.showingPlaceholder,temporary:l.temporary,...l.tag===void 0?{}:{tag:l.tag},...l.alias===void 0?{}:{alias:l.alias},...l.id===void 0?{}:{id:l.id},...l.dataBinding===void 0?{}:{dataBinding:l.dataBinding},paragraphIds:d,fragments:y});}return a}var Ho=Object.freeze([]);function Dn(e,t,n){let r=e.lines?.find(o=>{let a=o.spans;if(!a)return n<o.range.end;let s=a.filter(l=>l.range.paragraphId===t);return s.length===a.length?n<o.range.end:s.length>0&&n<s[s.length-1].range.end});return r?r.box.y:e.fragmentY}function Zo(e,t){let n=new Map;for(let r of e.pages)for(let[o,a]of Jo(r,t))n.has(o)||n.set(o,a);return n}var kn=new WeakMap;function Jo(e,t){let n=kn.get(t);n||(n=new WeakMap,kn.set(t,n));let r=n.get(e);if(r)return r;let o=new Map;for(let a of t(e)){let s=new Set([a.paragraphId]);for(let l of a.lines??[])for(let i of l.spans??[])s.add(i.range.paragraphId);for(let l of s)o.has(l)||o.set(l,{pageIndex:e.index,contentY:e.contentBox.y,fragmentY:a.box.y,...a.lines?{lines:a.lines}:{}});}return n.set(e,o),o}function Qo(e,t){let n=Ha(e);if(!n)return null;let r=t.get(n.start.paragraphId);return r?{pageIndex:r.pageIndex,y:r.contentY+Dn(r,n.start.paragraphId,n.start.offset)}:null}var pt=new WeakMap;function ea(e){let t=pt.get(e);if(t!==void 0)return t??void 0;let n=e.path;if(!n.startsWith("M")||n.length>1e6||/[^MLQCZ0-9eE+.,\s-]/u.test(n))return;let r=1/0,o=-1/0,a=n.matchAll(/([MLQCZ])([^MLQCZ]*)/gu);for(let l of a){let i=l[1]==="Z"?0:l[1]==="C"?6:l[1]==="Q"?4:2,d=l[2].trim().split(/[\s,]+/u).filter(Boolean).map(Number);if(d.length!==i||d.some(c=>!Number.isFinite(c))){pt.set(e,null);return}for(let c=0;c<d.length;c+=2)r=Math.min(r,d[c]),o=Math.max(o,d[c]);}let s=Number.isFinite(r)&&Number.isFinite(o)?{left:r,right:o}:void 0;return pt.set(e,s??null),s}function Hn(e,t,n,r){if(e.clusters.length!==1||e.glyphs.length===0)return;let o=1/0,a=-1/0;for(let l of e.glyphs){if(l.id===0)return;let i=ea(l.outline),d=l.outline.unitsPerEm;if(!i||!(d>0))return;let c=(l.originX+l.offsetX)/n;o=Math.min(o,c+i.left*t/d),a=Math.max(a,c+i.right*t/d);}let s={left:o*r,right:a*r};return Number.isFinite(s.left)&&Number.isFinite(s.right)?s:void 0}var ta="abcdefghijklmnopqrstuvwxyz";function pe(e){let t=Math.round(e.fontSizePt*2);return Math.max(1,t)}function J(e,t,n,r,o){return e.shape({text:o,fontSizeHalfPoints:pe(r),bidiLevel:r.shaping?.direction==="rtl"?1:0,environment:Y({...t,font:n,direction:r.shaping?.direction??"ltr",script:r.shaping?.script==="Zyyy"?t.script:r.shaping?.script??t.script,features:r.smallCaps?{...t.features,smcp:1}:t.features,fallbackOrder:[]})})}function _e(e,t,n,r,o){let a=o.get(n);if(a!==void 0)return a;let s=true;try{for(let l of ta){let i=J(e,t,n,{...r,smallCaps:!0},l),d=J(e,t,n,{...r,smallCaps:!1},l);if(!(i.glyphs.length!==d.glyphs.length||i.glyphs.some((y,S)=>y.id!==d.glyphs[S]?.id))){s=!1;break}}}catch{s=false;}return o.set(n,s),s}var na=.5,ra=4,Gn=4096,ye=e=>e.verticalAlign==="baseline"?1:.75;function Un(e){let t="environment"in e?e.environment:void 0,n="environment"in e?void 0:e,{shaper:r$1,resolveFont:o,fallback:a}=e,s=t??{shapingLibrary:n.shapingLibrary,unicodeDataVersion:n.unicodeDataVersion,script:n?.script??"Latn",fixedPointScale:n?.fixedPointScale??1e3,normalization:n?.normalization??"none",features:n?.features??{},roundingMode:n?.roundingMode??"halfToEven",language:n?.language??"en",variationAxes:{}},l=new WeakMap,i=new WeakMap,d=new WeakMap,c=new WeakMap,y=new WeakMap,S=new Array(Gn),b=0,x=(h,p,v)=>{let R=S[b];R&&R.cache.delete(R.text),h.set(p,v),S[b]={cache:h,text:p},b=(b+1)%Gn;},m=h=>{let p=c.get(h);if(p!==void 0)return p;let v=o(h);return c.set(h,v),v},u=(h,p,v)=>{let R=v?i:l,C=R.get(h);C||(C=new Map,R.set(h,C));let O=C.get(p);return O||(O=new Map,C.set(p,O)),O},g=new WeakMap,f=h=>{if(!h.shaping?.wordSpacingPt)return h;let p=g.get(h);return p||(p={...h,shaping:{...h.shaping,wordSpacingPt:void 0}},g.set(h,p)),p},E=(h,p)=>p.shaping?.wordSpacingPt?Pc(h)*p.shaping.wordSpacingPt:0,F=(h,p)=>a.measure(h,f(p))+E(h,p),T=(h,p)=>{let v=Math.max(0,a.measure(h,f(p))),R=a.caretAdvances?.(h,f(p))??Nc$1(h,v);if(!R||R.length!==h.length+1)return Nc$1(h,F(h,p));let C=Math.max(0,F(h,p)),O=0,I=0;return R.map((L,A)=>{if(A===0)return 0;h[A-1]===" "&&I++;let k=L+I*(p.shaping?.wordSpacingPt??0);return O=Math.max(O,Math.min(C,Number.isFinite(k)?k:O)),A===h.length?C:O})};return {measure(h,p){if(h.length===0)return 0;let v=m(p);if(!v)return F(h,p);let R=u(v,pe(p),p.smallCaps),C=p.shaping?`1:${JSON.stringify([p.shaping.script,p.shaping.direction,h])}`:`0:${h}`,O=R.get(C);if(O===void 0){let I=0;try{if(p.smallCaps&&!_e(r$1,s,v,p,y))return F(h,p);let L=J(r$1,s,v,p,h);if(L.glyphs.some(A=>A.id===0))return F(h,p);for(let A of L.glyphs)I+=A.advanceX;}catch{return F(h,p)}O=I/s.fixedPointScale,x(R,C,O);}return O*ye(p)*(p.horizontalScalePercent/100)+h.length*p.characterSpacingPt+E(h,p)},inkBounds(h,p){if(!h||h.length>2||p.shaping?.direction==="rtl"||r(h).length!==1)return;let v=m(p);if(!v)return a.inkBounds?.(h,p);try{if(p.smallCaps&&!_e(r$1,s,v,p,y))return a.inkBounds?.(h,p);let R=J(r$1,s,v,p,h);return Hn(R,pe(p)/2,s.fixedPointScale,ye(p)*p.horizontalScalePercent/100)}catch{return}},caretAdvances(h,p){let v=m(p);if(!v)return T(h,p);try{if(p.smallCaps&&!_e(r$1,s,v,p,y))return T(h,p);let R=J(r$1,s,v,p,h);return R.glyphs.some(C=>C.id===0)?T(h,p):Oc(h,R,ye(p)*(p.horizontalScalePercent/100)/s.fixedPointScale,p.characterSpacingPt,p.shaping?.wordSpacingPt??0)??Nc$1(h,R.glyphs.reduce((C,O)=>C+O.advanceX,0)*ye(p)*(p.horizontalScalePercent/100)/s.fixedPointScale+h.length*p.characterSpacingPt+E(h,p))}catch{return T(h,p)}},lineMetrics(h){let p=m(h);if(!p)return a.lineMetrics(h);let v=ye(h),R=d.get(p);R||(R=new Map,d.set(p,R));let C=pe(h),O=R.get(C);if(O)return v===1?O:{height:O.height*v,baseline:O.baseline*v};let I,L=true,A=p.substitution?.lineMetrics;if(A){let k=C/2;I={height:A.heightEm*k,baseline:A.baselineEm*k};}else try{let k=J(r$1,s,p,h," "),ft=k.metrics.ascent/s.fixedPointScale,Yn=k.metrics.descent/s.fixedPointScale,$n=C/2,ze=ft+Yn,ht=$n*ra,mt=ze>ht?ht/ze:1,gt=ze*mt,Zn=Math.min(Math.max(0,k.metrics.lineGap/s.fixedPointScale),gt*na),bt=gt+Zn;bt>0?I={height:bt,baseline:ft*mt}:(I=a.lineMetrics(h),L=!1);}catch{I=a.lineMetrics(h),L=false;}return L?(R.set(C,I),v===1?I:{height:I.height*v,baseline:I.baseline*v}):I}}}function oa(e,t){return Un({...t,shaper:e.shaper,environment:e.environment})}function aa(e){let{layout:t,viewport:n}=e,r=new Set;if(!n){for(let i of t.pages)r.add(i.index);return r}let o=Math.max(0,Math.trunc(e.overscanPages??1)),a=n.top+n.height,s=-1,l=-1;for(let i of t.pages){let d=i.box.y;d+i.box.height>=n.top&&d<=a&&(s===-1&&(s=i.index),l=i.index);}if(s===-1){let i=ia(t,n.top);i!==null&&(s=i,l=i);}if(s!==-1){let i=Math.max(0,s-o),d=Math.min(t.pages.length-1,l+o);for(let c=i;c<=d;c+=1)r.add(c);}for(let i of e.pinnedPages??[])i>=0&&i<t.pages.length&&r.add(i);return r}function ia(e,t){let n=null,r=Number.POSITIVE_INFINITY;for(let o of e.pages){let a=t<o.box.y?o.box.y-t:t>o.box.y+o.box.height?t-(o.box.y+o.box.height):0;a<r&&(r=a,n=o.index);}return n}var jn=["text-local","paragraph-local","flow-structural","global"];function Vn(e,t){return jn.indexOf(t)>jn.indexOf(e)?t:e}function sa(e){return {impact:"text-local",paragraphIds:new Set,created:new Set,deleted:new Set,dependencyKeys:new Set,structural:false,revision:e}}function la(e){let{run:t,currentRevision:n,publish:r,schedule:o}=e,a=null,s=null,l=null,i=0,d=0;function c(u){let g=e.runCooperatively;if(!g)return t(u);let f=g(u);l=f;try{for(;;){let E=f.step();if(E)return E;if(n()!==u.revision)return f.cancel(),d+=1,null;if(l!==f)return null}}finally{l===f&&(l=null);}}function y(u){let g=b(n());g.impact=Vn(g.impact,u.impact),g.structural=g.structural||u.structural;for(let f of u.paragraphIds)g.paragraphIds.add(f);for(let f of u.created)g.created.add(f);for(let f of u.deleted)g.deleted.add(f);for(let f of u.dependencyKeys)g.dependencyKeys.add(f);}let S=u=>({impact:u.impact,paragraphIds:u.paragraphIds,created:u.created,deleted:u.deleted,dependencyKeys:u.dependencyKeys,structural:u.structural,revision:u.revision});function b(u){return a||(a=sa(u)),a.revision=Math.max(a.revision,u),a}function x(){!o||s||(s=o(()=>{s=null,m();}));}function m(){s&&(s(),s=null),l&&(l.cancel(),l=null,d+=1);let u=a;if(!u)return false;a=null;let g=S(u),f=c(g);return !f||f.revision!==n()?(i+=1,y(g),x(),false):(r(f,g),true)}return {notify(u){let g=b(n());g.impact=Vn(g.impact,u.impact);for(let f of u.dirty)g.paragraphIds.add(f);for(let f of u.created)g.created.add(f),g.paragraphIds.add(f);for(let f of u.deleted)g.deleted.add(f),g.paragraphIds.add(f);for(let f of u.dependencyKeys)g.dependencyKeys.add(f);for(let f of u.splitJoin)g.structural=true,"split"in f?(g.paragraphIds.add(f.split.from),g.paragraphIds.add(f.split.tail)):(g.paragraphIds.add(f.join.kept),g.paragraphIds.add(f.join.removed));(u.impact==="flow-structural"||u.impact==="global")&&(g.structural=true),x();},invalidateAll(u,g){let f=b(u);f.impact="flow-structural",f.structural=true,g&&f.dependencyKeys.add(g),x();},flush:m,pending:()=>a?S(a):null,cancel(){s?.(),s=null,l?.cancel(),l=null,a=null;},get staleDiscards(){return i},get cancelledRuns(){return d}}}var Wn=new WeakMap;function U(e){let t=Wn.get(e);if(t)return t;let n=new Map,r=new Map,o=new Map,a=new Map,s=(i,d,c,y)=>{for(let S of i){if(S.kind==="paragraph")continue;let b=S.tableId;a.set(b,Math.max(a.get(b)??0,(S.columnEdges?.length??1)-1));let x=o.get(b);x||(x=new Map,o.set(b,x),n.set(b,[]),r.set(b,new Map));for(let m of S.rows){let u=x.get(m.id);u===void 0&&(u=x.size,x.set(m.id,u),r.get(b).set(u,m.cells));for(let g of m.cells)n.get(b).push({pageIndex:d,tableId:b,row:m,cell:g,rowIndex:u,isHeaderRepeat:m.isHeaderRepeat,offsetX:c,offsetY:y}),s(g.blocks,d,c,y);}}};for(let i of e.pages){s(i.fragments,i.index,0,0);for(let d of [i.header,i.footer])d&&s(d.fragments,i.index,d.box.x-i.contentBox.x,d.box.y-i.contentBox.y);for(let d of [i.footnotes,i.endnotes])if(d)for(let c of d.notes)s(c.fragments,i.index,c.box.x-i.contentBox.x,c.box.y-i.contentBox.y);}let l=new Map;for(let[i,d]of n)l.set(i,{placed:d,rows:r.get(i)??new Map,columnCount:a.get(i)??0});return Wn.set(e,l),l}function Xn(e){let t=e.columnCount;for(let n of e.rows.values())for(let r of n)t=Math.max(t,X(r).to+1);return t}var X=e=>({from:e.gridColumn,to:e.gridColumn+Math.max(1,e.gridSpan)-1});function da(e,t,n){if(t.tableId!==n.tableId)return null;let r=U(e).get(t.tableId);if(!r)return null;let o=Math.min(t.rowIndex,n.rowIndex),a=Math.max(t.rowIndex,n.rowIndex),s=Math.min(X(t).from,X(n).from),l=Math.max(X(t).to,X(n).to),i=b=>{let{from:x,to:m}=X(b);return m>=s&&x<=l},d=b=>(r.rows.get(b)??[]).some(x=>x.vMergeContinue&&i(x)),c=r.rows.size+Xn(r)+2;for(let b=0;!(b>c);b+=1){let x=false;for(let[m,u]of r.rows)if(!(m<o||m>a))for(let g of u){if(!i(g))continue;let{from:f,to:E}=X(g);f<s&&(s=f,x=true),E>l&&(l=E,x=true);}for(;o>0&&d(o);)o-=1,x=true;for(;d(a+1);)a+=1,x=true;if(!x)break}let y=[],S=new Set;for(let b of r.placed){if(b.isHeaderRepeat||b.rowIndex<o||b.rowIndex>a)continue;let{from:x,to:m}=X(b.cell);m<s||x>l||S.has(b.cell.id)||(S.add(b.cell.id),y.push(b.cell.id));}return y.length===0?null:{kind:"cells",tableId:t.tableId,cellIds:y,rows:{from:o,to:a},columns:{from:s,to:l},text:ca(e,t.tableId,y)}}function wi(e,t){return qn(e,t,true)}function Me(e,t){return qn(e,t,false)}function qn(e,t,n){let r=new Set(t),o=[],a=new Set;for(let s of U(e).values())for(let l of s.placed)if(!(l.isHeaderRepeat||!r.has(l.cell.id)))for(let i of l.cell.blocks)n&&i.kind!=="paragraph"||ie(i,o,a);return o}function ie(e,t,n){if(e.kind==="paragraph"){for(let r of T(e))n.has(r)||(n.add(r),t.push(r));return}for(let r of e.rows)if(!r.isHeaderRepeat)for(let o of r.cells)for(let a of o.blocks)ie(a,t,n);}function ca(e,t,n){let r=Me(e,n),o=r[0],a=r[r.length-1];return !o||!a?ua(e,t):{anchor:{paragraphId:o,offset:0},head:{paragraphId:a,offset:je(e,a).length}}}function ua(e,t){let n=U(e).get(t);for(let o of n?.placed??[]){if(o.isHeaderRepeat)continue;let a=[];for(let l of o.cell.blocks)ie(l,a,new Set);let s=a[0];if(s){let l={paragraphId:s,offset:0};return {anchor:l,head:l}}}for(let o of e.pages)for(let a of B$1(o)){let s={paragraphId:a.paragraphId,offset:0};return {anchor:s,head:s}}let r={paragraphId:"",offset:0};return {anchor:r,head:r}}function pa(e){let t=[...B$1(e)];for(let n of [e.header,e.footer])n&&t.push(...C(n.fragments));for(let n of [e.footnotes,e.endnotes])if(n)for(let r of n.notes)t.push(...C(r.fragments));return t}function ya(e,t){let n=new Set(Me(e,t)),r=[],o=new Set;for(let a of e.pages)for(let s of pa(a))if(n.has(s.paragraphId))for(let l of s.lines)for(let i of l.spans){let d=`${i.range.paragraphId}:${i.range.start}:${i.range.end}`;o.has(d)||(o.add(d),r.push(i));}return r}function fa(e,t){let n=new Set(t),r=[];for(let o of U(e).values())for(let a of o.placed)n.has(a.cell.id)&&r.push({pageIndex:a.pageIndex,x:a.cell.box.x+a.offsetX,y:a.cell.box.y+a.offsetY,width:a.cell.box.width,height:a.cell.box.height});return r}function ha(e,t){let n=U(e).get(t.tableId);if(!n)return "";let r=new Set(t.cellIds),o=n.placed.some(l=>l.cell.logicalGridColumn!==void 0),a=new Map,s=new Set;for(let l of n.placed){if(l.isHeaderRepeat||!r.has(l.cell.id)||s.has(l.cell.id))continue;s.add(l.cell.id);let i=Me(e,[l.cell.id]).map(y=>je(e,y)).join(`
1
+ import {f,c,d,e}from'./chunk-RIYSCEFQ.js';import {r,v,W as W$1,G as G$1,b,qa,oa as oa$1,Pb,gc,ua as ua$1,Oc,Nc as Nc$1,T,ke,B as B$1,Pc,J as J$1,Q as Q$1,Ja,Rb,ic,fc,ta as ta$1,pa as pa$1,C,a as a$1,A}from'./chunk-TUCDPXBD.js';import {Ha}from'./chunk-NLGUL6QL.js';import {a,hh,Kc,Ic,Nc,Jc,Of,kh,jh,ih,wc,Gc}from'./chunk-IA7WTZHI.js';var Jn=Symbol("validated-resolved-font"),Qn=4,ee=64*1024*1024,D=256,V=128*1024*1024,j=class extends Error{name="FontResolutionError";request;code;limit;actual;diagnostic;expectedHash;actualHash;constructor(t,n,r={}){super(`Font resolution failed (${t}) for ${W(n)}`),this.code=t,this.request=K(n),this.limit=r.limit,this.actual=r.actual,this.diagnostic=r.diagnostic,this.expectedHash=r.expectedHash,this.actualHash=r.actualHash;}},jt=e=>{if(e.family.trim().length===0)throw new TypeError("Font family must not be empty");if(!Number.isInteger(e.weight)||e.weight<1||e.weight>1e3)throw new RangeError("Font weight must be an integer from 1 through 1000");if(e.style!=="normal"&&e.style!=="italic")throw new TypeError("Font style must be normal or italic")},K=e=>(jt(e),Object.freeze({family:e.family,weight:e.weight,style:e.style})),Ke=e=>{let t={family:e.family,weight:e.weight,style:e.style};return K(t)},Gt=Symbol("prepared-font-resource"),Xe=new WeakMap,er=new Uint8Array(0),Vt=Object.getPrototypeOf(Uint8Array.prototype),tr=Object.getOwnPropertyDescriptor(Vt,"length").get,nr=Object.getOwnPropertyDescriptor(Vt,"byteLength").get;function te(e){if(!ArrayBuffer.isView(e))throw new TypeError("Font bytes must be a genuine byte array");let t,n;try{t=tr.call(e),n=nr.call(e);}catch{throw new TypeError("Font bytes must be a genuine byte array")}if(t!==n)throw new TypeError("Font bytes must use one-byte elements");return n}function Wt(e){let t=new Uint8Array(te(e));return Uint8Array.prototype.set.call(t,e),t}function Kt(e,t){let n=K(e.request);if(e.availability==="forbidden"){let s=Object.freeze({...e,request:n,actualHash:null,[Gt]:true});return Xe.set(s,null),s}let r=Wt(e.bytes);t?.onOwnedByteCopy?.(),t?.onHash?.();let o=a(r),a$1=Object.freeze({...e,request:n,bytes:r,actualHash:o,[Gt]:true});return Xe.set(a$1,o),a$1}function ne(e){return Xe.get(e)}var Xt=e=>{if(!Number.isFinite(e.heightEm)||!Number.isFinite(e.baselineEm)||e.heightEm<=0||e.heightEm>Qn||e.baselineEm<0||e.baselineEm>e.heightEm)throw new RangeError("Font substitution line metrics must fit within a bounded em box");return Object.freeze({heightEm:e.heightEm,baselineEm:e.baselineEm})},W=e=>(jt(e),JSON.stringify([e.family.trim().toLowerCase(),e.weight,e.style])),qe=class{[Jn]=true;id;identity;request;family;byteLength;hash;faceIndex;substitution;constructor(t,n){if(t.id.length===0)throw new TypeError("Resolved font id must not be empty");if(!Number.isInteger(t.faceIndex)||t.faceIndex<0)throw new RangeError("Font face index must be a non-negative integer");this.id=t.id,this.request=K(t.request),this.family=this.request.family,this.hash=t.hash,this.faceIndex=t.faceIndex,this.identity=`${this.hash}#${this.faceIndex}`,this.byteLength=t.byteLength,this.substitution=null,n&&(this.substitution=Object.freeze({requested:K(n.requested),resolved:K(n.resolved),...n.lineMetrics?{lineMetrics:Xt(n.lineMetrics)}:{}})),Object.freeze(this);}get bytes(){return Ee(this).slice()}},qt=new WeakSet,Yt=new WeakMap,$t=new WeakMap,Zt=(e,t,n,r)=>{let o=new qe(e,r);return Yt.set(o,t),$t.set(o,n),qt.add(o),o},Ee=e=>{re(e);let t=Yt.get(e);if(!t)throw new TypeError("Resolved font has no owned byte capability");return t},Ce=e=>{re(e);let t=$t.get(e);if(!t)throw new TypeError("Resolved font has no admitted table metadata");return t},re=e=>{if(typeof e!="object"||e===null||!qt.has(e))throw new TypeError("Shaping requires a validated resolved font")},Jt=(e,t)=>e[t]<<8|e[t+1],Q=(e,t)=>e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0,Ut=(e,t)=>{if(t>e.byteLength-12)return {valid:false,diagnostic:"truncated sfnt header"};let n=String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3]);if(!(e[t]===0&&e[t+1]===1&&e[t+2]===0&&e[t+3]===0)&&n!=="OTTO"&&n!=="true"&&n!=="typ1")return {valid:false,diagnostic:"unsupported sfnt signature"};let o=Jt(e,t+4),a=t+12+o*16;if(!Number.isSafeInteger(a)||a>e.byteLength)return {valid:false,diagnostic:"truncated sfnt table directory"};for(let s=0;s<o;s+=1){let l=t+12+s*16,i=Q(e,l+8),d=Q(e,l+12);if(i>e.byteLength||d>e.byteLength-i)return {valid:false,diagnostic:"sfnt table range exceeds font bytes"}}return {valid:true}},rr=(e,t)=>{let r=String.fromCharCode(e[0],e[1],e[2],e[3])==="ttcf"?Q(e,12+t*4):0,o=Jt(e,r+4),a=new Set;for(let s=0;s<o;s+=1){let l=r+12+s*16;a.add(String.fromCharCode(e[l],e[l+1],e[l+2],e[l+3]));}return Object.freeze(a)},we=(e,t)=>{if(!Number.isSafeInteger(t)||t<0)return {valid:false,diagnostic:"invalid font face index"};if(e.byteLength<12)return {valid:false,diagnostic:"truncated sfnt header"};if(String.fromCharCode(e[0],e[1],e[2],e[3])!=="ttcf")return t!==0?{valid:false,diagnostic:"standalone sfnt has only face index zero"}:Ut(e,0);let r=Q(e,4);if(r!==65536&&r!==131072)return {valid:false,diagnostic:"unsupported TTC version"};let o=Q(e,8),a=12+o*4;if(o===0||!Number.isSafeInteger(a)||a>e.byteLength||t>=o)return {valid:false,diagnostic:"invalid TTC face directory"};let s=Q(e,12+t*4);return s<a?{valid:false,diagnostic:"invalid TTC face offset"}:Ut(e,s)},or=(e,t,n,r)=>{if(e.availability==="forbidden")return {kind:"forbidden"};let o=te(e.bytes);if(o>t)return {kind:"overLimit",actual:o};let a$1=ne(e),s=a$1===void 0?Wt(e.bytes):e.bytes;a$1===void 0&&r?.onOwnedByteCopy?.(),a$1===void 0&&r?.onHash?.();let l=a$1??a(s);if(e.hash!==l)return {kind:"hashMismatch",expectedHash:e.hash,actualHash:l};let i=we(s,e.faceIndex);if(!i.valid)return {kind:"malformed",diagnostic:i.diagnostic};r?.onTableScan?.();let d=rr(s,e.faceIndex);try{let y=n(s,e.faceIndex);if(!y.valid)return {kind:"malformed",diagnostic:y.diagnostic}}catch(y){return {kind:"malformed",diagnostic:y instanceof Error?y.message:"font validator threw"}}let c={kind:"resolved",font:Zt({...e,byteLength:s.byteLength},s,d)};return r?.onAdmission?.(),c},Ye=e=>{let t=e.epoch,n=e.maxFontBytes,r=e.validateFont,o=e.instrumentation,a=e.resources,s=e.substitutions;if(!Number.isSafeInteger(t)||t<0)throw new RangeError("Font resource epoch must be a non-negative safe integer");if(!Number.isSafeInteger(n)||n<=0||n>ee)throw new RangeError(`Font byte ceiling must be a positive safe integer no greater than ${ee}`);if(typeof r!="function")throw new TypeError("Font snapshot requires a validator");let l=a.length,i=s?.length??0;if(l>D)throw new RangeError(`Font source count must not exceed ${D}`);if(i>D)throw new RangeError(`Font substitution count must not exceed ${D}`);let d=0,c=[];for(let m=0;m<l;m+=1){let u=a[m];if(ne(u)!==void 0){let v=u.availability==="forbidden"?0:te(u.bytes);if(v>V-d)throw new RangeError(`Aggregate font bytes must not exceed ${V}`);d+=v,c.push(u);continue}let g=Ke(u.request),f=u.id,E=u.hash,F=u.faceIndex,T=u.availability,h=T==="forbidden"?er:u.bytes,p=T==="forbidden"?0:te(h);if(p>V-d)throw new RangeError(`Aggregate font bytes must not exceed ${V}`);d+=p,c.push(Object.freeze({request:g,id:f,bytes:h,hash:E,faceIndex:F,...T?{availability:T}:{}}));}let y=[];if(s)for(let m=0;m<i;m+=1){let u=s[m],g=Ke(u.from),f=Ke(u.to),E=u.lineMetrics;y.push(Object.freeze({from:g,to:f,...E?{lineMetrics:Object.freeze({heightEm:E.heightEm,baselineEm:E.baselineEm})}:{}}));}let S=new Map;for(let m of c){let u=W(m.request);S.has(u)||S.set(u,or(m,n,r,o));}let b=new Map;for(let m of y){let u=W(m.from);b.has(u)||b.set(u,Object.freeze({to:K(m.to),...m.lineMetrics?{lineMetrics:Xt(m.lineMetrics)}:{}}));}return Object.freeze({epoch:t,resolve:m=>{let u=K(m),g=W(u),f=b.get(g),E=f?.to??u,F=S.get(W(E));return F?F.kind==="forbidden"?new j("forbidden",u):F.kind==="overLimit"?new j("overLimit",u,{limit:n,actual:F.actual}):F.kind==="malformed"?new j("malformed",u,{diagnostic:F.diagnostic}):F.kind==="hashMismatch"?new j("hashMismatch",u,{expectedHash:F.expectedHash,actualHash:F.actualHash}):f?Zt({request:F.font.request,id:F.font.id,hash:F.font.hash,faceIndex:F.font.faceIndex,byteLength:F.font.byteLength},Ee(F.font),Ce(F.font),{requested:u,resolved:f.to,...f.lineMetrics?{lineMetrics:f.lineMetrics}:{}}):F.font:new j("missing",u)}})};var M=e=>{if(!Number.isSafeInteger(e))throw new RangeError("Fixed-point value must be a safe integer");return e},Oe=(e,t)=>{if(e.trim().length===0||/[\u0000-\u001f\u007f]/.test(e))throw new TypeError(`${t} must be non-blank and contain no control characters`)},ar=(e,t)=>{if(!/^[\x20-\x7e]{4}$/.test(e))throw new TypeError(`${t} must be a four-byte ASCII tag`)},Qt=(e,t,n)=>{let r=Object.entries(e).sort(([a],[s])=>a<s?-1:a>s?1:0),o=Object.create(null);for(let[a,s]of r){if(ar(a,`${t} key`),!Number.isFinite(s)||n&&(!Number.isSafeInteger(s)||s<0))throw new RangeError(`${t} value must be ${n?"a non-negative safe integer":"finite"}`);if(n&&s>4294967295)throw new RangeError(`${t} value must fit an unsigned 32-bit integer`);o[a]=s;}return Object.freeze(o)},$e=e=>Object.freeze({family:e.family,weight:e.weight,style:e.style}),ir=e=>e?Object.freeze({requested:$e(e.requested),resolved:$e(e.resolved),...e.lineMetrics?{lineMetrics:Object.freeze({...e.lineMetrics})}:{}}):void 0,en=new WeakSet,Je=e=>{if(re(e),!en.has(e)){if(e.identity!==`${e.hash}#${e.faceIndex}`)throw new TypeError("Resolved font identity does not match hash and face index");if(!Number.isSafeInteger(e.byteLength)||e.byteLength<0)throw new TypeError("Resolved font byte length is invalid");en.add(e);}},Ze=e=>(Je(e),e),Te=e=>(Je(e),Object.freeze({identity:e.identity,id:e.id,family:e.family,request:$e(e.request),hash:e.hash,faceIndex:e.faceIndex,byteLength:e.byteLength,substitution:ir(e.substitution)??null})),Y=e=>{if(Oe(e.shapingLibrary.name,"shaping library name"),Oe(e.shapingLibrary.version,"shaping library version"),Oe(e.unicodeDataVersion,"Unicode data version"),!/^\d+(?:\.\d+){0,3}(?:[-+][0-9A-Za-z.-]+)?$/.test(e.shapingLibrary.version))throw new TypeError("shaping library version must be a numeric version");if(!/^\d+(?:\.\d+){1,2}$/.test(e.unicodeDataVersion))throw new TypeError("Unicode data version must be a dotted numeric version");if(!/^[A-Z][a-z]{3}$/.test(e.script))throw new TypeError("script must be a four-letter ISO 15924 code");if(Oe(e.language,"language"),!/^(?:und|[A-Za-z]{2,8})(?:-[A-Za-z0-9]{1,8})*$/.test(e.language))throw new TypeError("language must be a BCP 47 language tag");if(e.direction!=="ltr"&&e.direction!=="rtl")throw new TypeError("direction must be ltr or rtl");if(!["none","NFC","NFD","NFKC","NFKD"].includes(e.normalization))throw new TypeError("invalid normalization policy");if(!["halfAwayFromZero","halfToEven","towardZero"].includes(e.roundingMode))throw new TypeError("invalid fixed-point rounding mode");if(!Number.isSafeInteger(e.fixedPointScale)||e.fixedPointScale<=0)throw new RangeError("fixed-point scale must be a positive safe integer");let t=Ze(e.font),n=e.fallbackOrder.map(Ze),r=new Set;for(let o of n){let a=JSON.stringify(Te(o));if(r.has(a))throw new TypeError("fallback order contains a duplicate font");r.add(a);}return Object.freeze({font:t,variationAxes:Qt(e.variationAxes,"variation axis",false),shapingLibrary:Object.freeze({name:e.shapingLibrary.name,version:e.shapingLibrary.version}),unicodeDataVersion:e.unicodeDataVersion,normalization:e.normalization,script:e.script,language:e.language,direction:e.direction,features:Qt(e.features,"OpenType feature",true),fallbackOrder:Object.freeze([...n]),fixedPointScale:e.fixedPointScale,roundingMode:e.roundingMode})},nn=e=>{let t=Y(e);return Object.freeze({font:Te(t.font),variationAxes:Object.freeze(Object.entries(t.variationAxes).map(n=>Object.freeze(n))),shapingLibrary:Object.freeze({name:t.shapingLibrary.name,version:t.shapingLibrary.version}),unicodeDataVersion:t.unicodeDataVersion,normalization:t.normalization,script:t.script,language:t.language,direction:t.direction,features:Object.freeze(Object.entries(t.features).map(n=>Object.freeze(n))),fallbackOrder:Object.freeze(t.fallbackOrder.map(Te)),fixedPointScale:t.fixedPointScale,roundingMode:t.roundingMode})},Qe=e=>JSON.stringify(nn(e)),q=(e,t)=>{if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`${t} must be a non-negative safe integer`)},B=e=>{try{return M(e)}catch{throw new RangeError("Shaped run contains a non-integer fixed-point value")}},tn=new WeakMap,Ie=e=>{let t=tn.get(e);if(t)return t;Je(e);let n=JSON.stringify({identity:e.identity,id:e.id,family:e.family,request:e.request,hash:e.hash,faceIndex:e.faceIndex,byteLength:e.byteLength,substitution:e.substitution??null});return tn.set(e,n),n},Le=(e,t)=>{let n=Y(t);if(e.direction!=="ltr"&&e.direction!=="rtl")throw new TypeError("Shaped run direction must be ltr or rtl");if(e.direction!==n.direction)throw new TypeError("Shaped run direction does not match shaping environment");if(q(e.bidiLevel,"bidi level"),(e.bidiLevel&1)===1!=(e.direction==="rtl"))throw new TypeError("Shaped run direction does not match bidi level parity");let r=new Map,o=e.glyphs.map(i=>{q(i.id,"glyph id"),q(i.cluster,"glyph cluster");let d=r.get(i.outline);if(!d){if(!Number.isSafeInteger(i.outline.unitsPerEm)||i.outline.unitsPerEm<=0)throw new RangeError("Glyph outline units per em must be a positive safe integer");d=Object.isFrozen(i.outline)?i.outline:Object.freeze({path:i.outline.path,unitsPerEm:i.outline.unitsPerEm}),r.set(i.outline,d);}return Object.freeze({id:i.id,cluster:i.cluster,originX:B(i.originX),originY:B(i.originY),advanceX:B(i.advanceX),advanceY:B(i.advanceY),offsetX:B(i.offsetX),offsetY:B(i.offsetY),outline:d})}),a=e.fontSpans.map(i=>{if(q(i.glyphStart,"font span start"),q(i.glyphEnd,"font span end"),i.glyphEnd<=i.glyphStart||i.glyphEnd>o.length)throw new RangeError("Font span glyph range is invalid");i.fallbackIndex!==null&&q(i.fallbackIndex,"fallback index");let d=Ze(i.font);if(i.fallbackIndex===null){if(Ie(d)!==Ie(n.font))throw new TypeError("Shaped primary font does not match shaping environment")}else {let c=n.fallbackOrder[i.fallbackIndex];if(!c)throw new RangeError("Shaped fallback index is outside fallback order");if(Ie(d)!==Ie(c))throw new TypeError("Shaped fallback font does not match shaping environment provenance")}return Object.freeze({...i,font:d})});for(let i=0;i<a.length;i+=1){let d=i===0?0:a[i-1].glyphEnd;if(a[i].glyphStart!==d)throw new RangeError("Font spans must cover glyphs contiguously")}if(o.length===0&&a.length!==0||o.length>0&&a.at(-1)?.glyphEnd!==o.length)throw new RangeError("Font spans must cover every glyph exactly once");let s=e.clusters.map(i=>{for(let[c,y]of [["cluster text start",i.textStart],["cluster text end",i.textEnd],["cluster glyph start",i.glyphStart],["cluster glyph end",i.glyphEnd],["cluster font span",i.fontSpan]])q(y,c);if(i.textEnd<=i.textStart||i.textEnd>e.text.length||i.glyphEnd<=i.glyphStart||i.glyphEnd>o.length)throw new RangeError("Shaped cluster range is invalid");let d=a[i.fontSpan];if(!d||i.glyphStart<d.glyphStart||i.glyphEnd>d.glyphEnd)throw new RangeError("Shaped cluster does not belong to its declared font span");return Object.freeze({...i,advance:B(i.advance),caretEdges:Object.freeze(i.caretEdges.map(B))})}),l=Object.freeze({ascent:B(e.metrics.ascent),descent:B(e.metrics.descent),lineGap:B(e.metrics.lineGap)});return Object.freeze({text:e.text,direction:e.direction,bidiLevel:e.bidiLevel,glyphs:Object.freeze(o),clusters:Object.freeze(s),fontSpans:Object.freeze(a),metrics:l})},sr=(e,t)=>{let n=Le(e,t);return Object.freeze({text:n.text,direction:n.direction,script:t.script,language:t.language,bidiLevel:n.bidiLevel,glyphs:n.glyphs,clusters:n.clusters,fontSpans:Object.freeze(n.fontSpans.map(r=>Object.freeze({glyphStart:r.glyphStart,glyphEnd:r.glyphEnd,fallbackIndex:r.fallbackIndex,font:Te(r.font)}))),metrics:n.metrics})};var $=Object.freeze({name:"HarfBuzz",version:"14.4.0"}),ce=null,le=null;function tt(){return ce?Promise.resolve():le||(le=import('./dist-PKZR6RSH.js').then(e=>{let t=e.versionString();if(t!==$.version)throw new w("shapingLibraryMismatch",{diagnostic:f($.version,t)});ce=e;}).catch(e$1=>{throw le=null,e$1 instanceof w?e$1:c(e$1)?new w("unsupportedRuntime",{diagnostic:d(e$1),cause:e$1}):new w("wasmUnavailable",{diagnostic:e(e$1),cause:e$1})}),le)}function lr(){return ce!==null}function dr(){if(!ce)throw new w("notInitialized",{diagnostic:"Call initializeHarfBuzz() before creating a text shaper"});return ce}var w=class extends Error{name="HarfBuzzShapingError";code;limit;actual;diagnostic;constructor(t,n={}){super(`HarfBuzz shaping failed (${t})`,{cause:n.cause}),this.code=t,this.limit=n.limit,this.actual=n.actual,this.diagnostic=n.diagnostic;}},cr=16*1024*1024,ur=1e6,pr=1e6,yr=1e6,fr=4,hr=512,mr=1024*1024,gr=16*1024*1024,br=32*1024*1024,Sr=64*1024*1024,xr=64*1024*1024,Rr=1e6,Fr=1e6,vr=1e6,Er=64,Cr=4096,wr=4*1024*1024,Or=64*1024*1024,Ir=64*1024*1024,Tr=256*1024*1024,Lr=new Set(["COLR","CPAL","CBDT","CBLC","sbix","SVG "]),rn=["cmap","head","hhea","hmtx","maxp"],Ar=(e,t)=>e[t]<<8|e[t+1],Br=(e,t)=>e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0,Pr=(e,t)=>String.fromCharCode(e[0],e[1],e[2],e[3])==="ttcf"?Br(e,12+t*4):0,_r=(e,t)=>{let n=Pr(e,t),r=Ar(e,n+4),o=new Set;for(let a=0;a<r;a+=1){let s=n+12+a*16;o.add(String.fromCharCode(e[s],e[s+1],e[s+2],e[s+3]));}return o},Mr=e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),zr=(e,t)=>{let n=we(e,t);if(!n.valid)return n;let r=_r(e,t);for(let o of rn)if(!r.has(o))return {valid:false,diagnostic:`missing required ${o} table`};return {valid:true}},nt=zr,z=(e,t,n)=>{if(!Number.isSafeInteger(e)||e<=0||e>n)throw new RangeError(`${t} must be a positive safe integer no greater than ${n}`);return e},Nr=(e,t,n)=>{let r=e<0n,o=r?-e:e,a=o/t,s=o%t;if(n!=="towardZero"){let d=s*2n;(d>t||d===t&&(n==="halfAwayFromZero"||n==="halfToEven"&&a%2n!==0n))&&(a+=1n);}let l=r?-a:a,i=Number(l);if(!Number.isSafeInteger(i))throw new RangeError("Shaped fixed-point value exceeds the safe integer range");return i},on=(e,t,n,r)=>{if(!Number.isSafeInteger(e))throw new RangeError("font units must be a safe integer");if(!Number.isSafeInteger(t)||t<=0)throw new RangeError("fixed-point denominator must be a positive safe integer");if(!Number.isSafeInteger(n)||n<0)throw new RangeError("fixed-point numerator must be a non-negative safe integer");return M(Nr(BigInt(e)*BigInt(n),BigInt(t),r))},kr=(e,t,n,r)=>{if(!Number.isSafeInteger(t)||t<=0)throw new RangeError("font size must be a positive integer number of half points");if(t>Math.floor(Number.MAX_SAFE_INTEGER/n))throw new RangeError("font size and fixed-point scale product exceeds the safe integer range");let o=t*n,a=e*2;return s=>on(s,a,o,r)},Dr=(e,t)=>{if(t.length===0)return [];let n=[...new Set(t.map(s=>s.cluster))].sort((s,l)=>s-l),r=new Map;for(let s=0;s<n.length;s+=1)r.set(n[s],n[s+1]??e.length);let o=[],a=0;for(;a<t.length;){let s=t[a].cluster,l=a+1;for(;l<t.length&&t[l].cluster===s;)l+=1;let i=t.slice(a,l).reduce((c,y)=>c+y.advanceX,0),d=M(i);o.push({textStart:s,textEnd:r.get(s),glyphStart:a,glyphEnd:l,advance:d,caretEdges:Object.freeze([M(0),d]),fontSpan:0}),a=l;}return o},N=64,H=8,Z=8,Hr=32,an=N+2*H,Gr=N+H+Z,Ur=N+H+Z,jr=N+H+Z,sn=N+8*H,ln=N+8*Z+H,Vr=N+6*Z+H,Wr=N+3*Z+2*H,Kr=N+3*Z,ue=e=>N+e.length*Uint16Array.BYTES_PER_ELEMENT,rt=e=>jr+ue(e),de=e=>Hr+e*H,Xr=(e,t)=>an+ue(e)+Gr+rt(t),qr=e=>sn+ue(e)+de(e.length)+e.length*ln,Yr=e=>{let t=new Set(e.glyphs.map(n=>n.outline));return sn+ue(e.text)+de(e.glyphs.length)+e.glyphs.length*ln+de(e.clusters.length)+e.clusters.length*Vr+e.clusters.reduce((n,r)=>n+de(r.caretEdges.length),0)+de(e.fontSpans.length)+e.fontSpans.length*Wr+Kr+[...t].reduce((n,r)=>n+rt(r.path),0)},$r=(e,t)=>an+ue(e)+Ur+t,et=class{#t;#c;#u;#p;#y;#g;#b;#f;#h;#s;#m;#l;#e;#o=new Map;#a=new Map;#n=new Map;#i=0;#r=0;#d;constructor(t,n){this.#t=t,this.#c=z(n.maxFontBytes??cr,"maximum font bytes",xr),this.#u=z(n.maxInputUtf16??ur,"maximum input UTF-16 code units",Rr),this.#p=z(n.maxCodepoints??pr,"maximum input code points",Fr),this.#y=z(n.maxGlyphs??yr,"maximum shaped glyphs",vr),this.#g=z(n.maxCachedFaces??fr,"maximum cached faces",Er),this.#b=z(n.maxCachedShapes??hr,"maximum cached shape results",Cr),this.#f=z(n.maxOutlineBytes??mr,"maximum outline bytes",wr),this.#h=z(n.maxCachedOutlineBytes??gr,"maximum cached outline bytes",Or),this.#s=z(n.maxShapedRunBytes??br,"maximum shaped run bytes",Ir),this.#m=z(n.maxCachedShapeBytes??Sr,"maximum cached shape bytes",Tr),this.#l=n.instrumentation?.onFaceCacheEvent,this.#e=n.instrumentation,this.#d=new this.#t.Buffer;}dispose(){this.#o.clear(),this.#a.clear(),this.#n.clear(),this.#i=0,this.#r=0,this.#e?.onOutlineCacheEvent?.(Object.freeze({kind:"cleared",retainedBytes:0})),this.#e?.onShapeCacheEvent?.(Object.freeze({kind:"cleared",retainedBytes:0})),this.#d=void 0;}#x(t,n){let r=this.#o.get(t.identity);if(r)return this.#o.delete(t.identity),this.#o.set(t.identity,r),this.#l?.(Object.freeze({kind:"hit",identity:t.identity})),r;let o=Ce(t);for(let c of rn)if(!o.has(c))throw new w("malformedFont",{diagnostic:`missing required ${c} table`});this.#e?.onByteCopy?.();let a=new this.#t.Blob(Mr(n)),s=new this.#t.Face(a,t.faceIndex),l=new this.#t.Font(s),i=l.hExtents();if(!Number.isSafeInteger(s.upem)||s.upem<=0||!Number.isSafeInteger(i.ascender)||!Number.isSafeInteger(i.descender)||!Number.isSafeInteger(i.lineGap))throw new w("malformedFont",{diagnostic:"invalid font units or horizontal metrics"});if(l.setScale(s.upem,s.upem),this.#o.size>=this.#g){let c=this.#o.keys().next().value;c!==void 0&&(this.#o.delete(c),this.#l?.(Object.freeze({kind:"evicted",identity:c})));}let d={identity:t.identity,blob:a,face:s,font:l,unitsPerEm:s.upem};return this.#o.set(t.identity,d),this.#l?.(Object.freeze({kind:"created",identity:t.identity})),d}#R(t,n,r){let o=JSON.stringify([t.identity,t.unitsPerEm,r,n]),a=this.#a.get(o);if(a)return this.#a.delete(o),this.#a.set(o,a),this.#e?.onOutlineCacheEvent?.(Object.freeze({kind:"hit",retainedBytes:this.#i})),a.outline;this.#e?.onOutlinePathCall?.();let s=t.font.glyphToPath(n),l=rt(s);if(l>this.#f)throw new w("outlineOverLimit",{limit:this.#f,actual:l});let i=Object.freeze({path:s,unitsPerEm:t.unitsPerEm}),d=Xr(o,s);if(d>this.#h)return this.#e?.onOutlineCacheEvent?.(Object.freeze({kind:"skipped",retainedBytes:this.#i})),i;for(;this.#i+d>this.#h;){let c=this.#a.keys().next().value;if(c===void 0)break;let y=this.#a.get(c);this.#a.delete(c),this.#i-=y.bytes,this.#e?.onOutlineCacheEvent?.(Object.freeze({kind:"evicted",retainedBytes:this.#i}));}return this.#a.set(o,{outline:i,bytes:d}),this.#i+=d,this.#e?.onOutlineCacheEvent?.(Object.freeze({kind:"created",retainedBytes:this.#i})),i}#S(t){if(t.length>this.#u)throw new w("textOverLimit",{limit:this.#u,actual:t.length});let n=0;for(let r=0;r<t.length;){let o=t.codePointAt(r);if(r+=o>65535?2:1,n+=1,n>this.#p)throw new w("codepointsOverLimit",{limit:this.#p,actual:n})}}shape(t){if(!this.#d)throw new w("disposed");if(re(t.environment.font),t.environment.font.byteLength>this.#c)throw new w("fontOverLimit",{limit:this.#c,actual:t.environment.font.byteLength});this.#S(t.text);let n=qr(t.text);if(n>this.#s)throw new w("shapedRunOverLimit",{limit:this.#s,actual:n});let r=Y(t.environment),o=JSON.stringify([t.text,t.fontSizeHalfPoints,t.bidiLevel,Qe(r)]),a=this.#n.get(o);if(a)return this.#n.delete(o),this.#n.set(o,a),this.#e?.onShapeCacheEvent?.(Object.freeze({kind:"hit",retainedBytes:this.#r})),a.run;if(this.#e?.onShapeCacheEvent?.(Object.freeze({kind:"miss",retainedBytes:this.#r})),r.shapingLibrary.name!==$.name||r.shapingLibrary.version!==$.version)throw new w("shapingLibraryMismatch");if(r.normalization!=="none")throw new w("unsupportedNormalization");if(!Number.isSafeInteger(t.bidiLevel)||t.bidiLevel<0||(t.bidiLevel&1)===1!=(r.direction==="rtl"))throw new w("invalidBidiLevel");if(Object.keys(r.variationAxes).length>0)throw new w("unsupportedVariationAxes");if(r.fallbackOrder.length>0)throw new w("unsupportedFallback");let s=Ee(r.font),l=Ce(r.font);if([...Lr].some(d=>l.has(d)))throw new w("unsupportedColorFont");let i=t.text;this.#S(i);try{let d=this.#x(r.font,s),{face:c,font:y}=d,S=this.#d;S.reset(),S.addText(i),S.setDirection(r.direction==="rtl"?this.#t.Direction.RTL:this.#t.Direction.LTR),S.setScript(r.script),S.setLanguage(r.language),S.setClusterLevel(this.#t.ClusterLevel.MONOTONE_CHARACTERS);let b=Object.entries(r.features).map(([R,C])=>new this.#t.Feature(R,C));this.#e?.onShapeCall?.(),this.#t.shape(y,S,b);let x=S.getGlyphInfosAndPositions();if(x.length>this.#y)throw new w("glyphOverLimit",{limit:this.#y,actual:x.length});let m=kr(c.upem,t.fontSizeHalfPoints,r.fixedPointScale,r.roundingMode),u=M(0),g=M(0),f=new Map,E=JSON.stringify(Object.entries(r.variationAxes).sort(([R],[C])=>R.localeCompare(C))),F=x.map(R=>{let C=m(R.xAdvance??0),O=m(R.yAdvance??0),I={id:R.codepoint,cluster:R.cluster,originX:u,originY:g,advanceX:C,advanceY:O,offsetX:m(R.xOffset??0),offsetY:m(R.yOffset??0),outline:f.get(R.codepoint)??(()=>{let L=this.#R(d,R.codepoint,E);return f.set(R.codepoint,L),L})()};return u=M(u+C),g=M(g+O),I}),T=y.hExtents(),h=Le({text:i,direction:r.direction,bidiLevel:t.bidiLevel,glyphs:F,clusters:Dr(i,F),fontSpans:F.length===0?[]:[{glyphStart:0,glyphEnd:F.length,font:r.font,fallbackIndex:null}],metrics:{ascent:m(T.ascender),descent:m(-T.descender),lineGap:m(T.lineGap)}},r),p=Yr(h);if(p>this.#s)throw new w("shapedRunOverLimit",{limit:this.#s,actual:p});let v=$r(o,p);if(v>this.#m)return this.#e?.onShapeCacheEvent?.(Object.freeze({kind:"skipped",retainedBytes:this.#r})),h;for(;this.#n.size>=this.#b||this.#r+v>this.#m;){let R=this.#n.keys().next().value;if(R===void 0)break;let C=this.#n.get(R);this.#n.delete(R),this.#r-=C.bytes,this.#e?.onShapeCacheEvent?.(Object.freeze({kind:"evicted",retainedBytes:this.#r}));}return this.#n.set(o,{run:h,bytes:v}),this.#r+=v,this.#e?.onShapeCacheEvent?.(Object.freeze({kind:"stored",retainedBytes:this.#r})),h}catch(d){throw d instanceof w?d:new w("malformedFont",{diagnostic:d instanceof Error?d.message:"HarfBuzz shaping failed"})}}},ot=(e={})=>new et(dr(),e);var dn=Object.freeze({maxFontBytes:16*1024*1024,maxInputUtf16:1e6,maxCodepoints:1e6,maxGlyphs:1e6,maxCachedFaces:4,maxCachedShapes:512,maxOutlineBytes:1024*1024,maxCachedOutlineBytes:16*1024*1024,maxShapedRunBytes:32*1024*1024,maxCachedShapeBytes:64*1024*1024});function cn(e){let t={maxFontBytes:e.maxFontBytes,maxInputUtf16:e.maxInputUtf16,maxCodepoints:e.maxCodepoints,maxGlyphs:e.maxGlyphs,maxOutlineBytes:e.maxOutlineBytes,maxShapedRunBytes:e.maxShapedRunBytes},n=["docx-editor-layout-harfbuzz-execution-policy",1,Object.entries(t).sort(([r],[o])=>r<o?-1:r>o?1:0).map(([r,o])=>Object.freeze([r,o]))];return `layout-shaper-policy:sha256:${a(new TextEncoder().encode(JSON.stringify(n)))}`}var Zr=Object.freeze({}),un=D,Jr="16.0.0",Qr="none",eo=1e3,to="halfToEven",fn="cluster-edges-only",no="Latn",ro=new Uint8Array(0);var G=class extends Error{code="overLimit";constructor(t){super(t),this.name="LayoutShapingConfigurationError";}};function oo(e,t){let n=e.epoch,r=e.maxFontBytes,o=e.sources,a=e.substitutions,s=e.defaultFont,l=e.language;if(!Number.isSafeInteger(r)||r<=0||r>ee)throw new G(`Font byte ceiling must not exceed the engine hard maximum of ${ee}`);let i=o.length,d=a?.length??0;if(i===0||i>D)throw new G(`Font source count must be between 1 and ${D}`);if(d>un)throw new G(`Font substitution count must not exceed ${un}`);let c=0,y=[];for(let x=0;x<i;x+=1){let m=o[x],u=m.request,g=m.availability,f=m.id,E=m.hash,F=m.faceIndex,T=g==="forbidden",h=T?ro:m.bytes;if(!T){if(typeof f!="string"||f.length===0)throw new TypeError("Resolved font id must not be empty");let p;try{p=te(h);}catch{throw new G(`Font source ${f} must provide genuine bytes`)}if(p>r)throw new G(`Font source ${f} exceeds the per-font byte ceiling`);if(c+=p,c>V)throw new G(`Font sources exceed the aggregate byte ceiling of ${V}`)}y.push(t&&ne(m)!==void 0?m:Object.freeze({request:Object.freeze({family:u.family,weight:u.weight,style:u.style}),id:f,bytes:h,hash:E,faceIndex:F,...g?{availability:g}:{}}));}let S;if(a){S=[];for(let x=0;x<d;x+=1){let m=a[x],u=m.from,g=m.to,f=m.lineMetrics;S.push(Object.freeze({from:Object.freeze({family:u.family,weight:u.weight,style:u.style}),to:Object.freeze({family:g.family,weight:g.weight,style:g.style}),...f?{lineMetrics:Object.freeze({heightEm:f.heightEm,baselineEm:f.baselineEm})}:{}}));}}let b={epoch:n,maxFontBytes:r,sources:Object.freeze(y),substitutions:S?Object.freeze(S):void 0,defaultFont:Object.freeze({family:s.family,sizeHalfPoints:s.sizeHalfPoints}),language:l};return Object.freeze(b)}function pn(e,t){let n=e.map((o,a)=>({value:o,index:a,key:W(t(o))})),r=new Set;for(let o of n){if(r.has(o.key))return e;r.add(o.key);}return n.sort((o,a)=>o.key<a.key?-1:o.key>a.key?1:o.index-a.index).map(({value:o})=>o)}function ao(e,t){let n={family:e.family},r={sizeHalfPoints:e.sizeHalfPoints};return {...n,...t?r:{}}}function yn(e,t){let n=i=>({family:i.family,weight:i.weight,style:i.style}),r=t?e.sources:pn(e.sources,i=>i.request),o=e.substitutions??[],a=t?o:pn(o,i=>i.from),s={sources:r.map(i=>{let d=i.availability??"available",c={request:n(i.request),availability:d};if(d==="forbidden")return {...c,...t?{id:i.id,faceIndex:i.faceIndex,declaredHash:i.hash}:{}};let y=ne(i);if(y==null)throw new TypeError("Font configuration identity requires prepared source bytes");return {...c,...t?{id:i.id}:{},faceIndex:i.faceIndex,declaredHash:i.hash,actualHash:y,byteLength:i.bytes.byteLength}}),substitutions:a.map(i=>({from:n(i.from),to:n(i.to),lineMetrics:i.lineMetrics?{heightEm:i.lineMetrics.heightEm,baselineEm:i.lineMetrics.baselineEm}:null})),defaultFont:ao(e.defaultFont,t),language:e.language||"en"},l={epoch:e.epoch,maxFontBytes:e.maxFontBytes};return {version:1,...t?l:{},...s}}var io=Symbol("prepared-layout-font-configuration"),Ae=new WeakMap;function so(e){return Ae.has(e)}function lo(e){let t=Ae.get(e);if(!t)throw new TypeError("Invalid prepared layout font configuration");return t.configuration}function La(e){let t=Ae.get(e);if(!t)throw new TypeError("Invalid prepared layout font configuration");return t.sharedShapingFingerprint}function at(e,t){return hn(e,t,false)}function Aa(e,t){return hn(e,t,true)}function hn(e,t,n){let r=oo(e,n),o=Object.freeze({epoch:r.epoch,maxFontBytes:r.maxFontBytes,sources:Object.freeze(r.sources.map(y=>n&&ne(y)!==void 0?y:Kt(y,{onOwnedByteCopy:t?.onFontByteCopy,onHash:t?.onFontHash}))),substitutions:r.substitutions,defaultFont:r.defaultFont,language:r.language}),a$1=new TextEncoder,s=yn(o,true),l=a$1.encode(JSON.stringify(s)),i=yn(o,false),d=a$1.encode(JSON.stringify(i)),c=Object.freeze({[io]:true,fingerprint:`font-config:${a(l)}`});return Ae.set(c,{configuration:o,sharedShapingFingerprint:`shared-font-config:${a(d)}`}),c}function co(e){return at(e).fingerprint}function uo(e,t){let n=new TextEncoder().encode(JSON.stringify({version:1,environment:e,executionPolicy:cn(t),ligatureCaretPolicy:fn,fallback:a$1}));return `shaping:${a(n)}`}async function mn(e,t,n,r){let a=so(e)?e:at(e,t),s=lo(a),{epoch:l,maxFontBytes:i,sources:d,substitutions:c,defaultFont:y}=s,S=s.language||"en",b=a.fingerprint,x=Ye({epoch:l,maxFontBytes:i,resources:d,substitutions:c,validateFont:nt,instrumentation:{onOwnedByteCopy:t?.onFontByteCopy,onHash:t?.onFontHash,onAdmission:t?.onFontAdmission}});await tt();let m=Object.freeze({script:no,variationAxes:Object.freeze({}),shapingLibrary:$,unicodeDataVersion:Jr,normalization:Qr,language:S,features:Zr,fixedPointScale:eo,roundingMode:to});return Object.freeze({fonts:x,shaper:n??ot(r),defaultFont:y,environment:m,ligatureCaretPolicy:fn,operation:Object.freeze({resourceEpoch:x.epoch,configEpoch:l,extensionFingerprint:b,shapingHash:uo(m,r),producerVersion:1})})}async function po(e,t){return mn(e,t,void 0,dn)}async function Ba(e,t,n,r){return mn(e,r,t,n)}function yo(e){e.shaper.dispose?.();}function it(e){let t=new Set([0,e.text.length]);for(let r$1 of r(e.text))t.add(r$1.utf16From),t.add(r$1.utf16To);let n=new Set([0,e.text.length]);for(let r of e.clusters)n.add(r.textStart),n.add(r.textEnd);return [...t].filter(r=>n.has(r)).sort((r,o)=>r-o)}function Be(e,t){return it(e).includes(t)}function fo(e,t){return Be(e,t)}function ho(e,t,n){return n>=t&&Be(e,t)&&Be(e,n)}function mo(e){let t=r(e.text);return it(e).map(n=>n===e.text.length?t.length:t.findIndex(r=>r.utf16From===n))}var lt="und";function xn(){return typeof Intl.Segmenter=="function"}function go(){let e=Intl.Segmenter;if(typeof e!="function")throw new Error(`Intl.Segmenter is required for word segmentation (locale: ${lt})`);return e}function Rn(){let e=new(go())(lt,{granularity:"word"});return {segment(t){let n=[];for(let r of e.segment(t)){let o=r.index,a=o+r.segment.length;n.push({utf16From:o,utf16To:a,wordLike:r.isWordLike===true});}return n}}}var bo=/^[\p{L}\p{N}']$/u,So=/^\s$/u;function gn(e){return bo.test(e)}function bn(e){return So.test(e)}function st(e,t,n,r){let o=e[t],a=e[n-1];return {utf16From:o.utf16From,utf16To:a.utf16To,wordLike:r}}function Fn(e){let t=r(e);if(t.length===0)return [];let n=[],r$1=0;for(;r$1<t.length;){let o=t[r$1];if(bn(o.text)){let a=r$1+1;for(;a<t.length&&bn(t[a].text);)a+=1;n.push(st(t,r$1,a,false)),r$1=a;continue}if(gn(o.text)){let a=r$1+1;for(;a<t.length&&gn(t[a].text);)a+=1;n.push(st(t,r$1,a,true)),r$1=a;continue}n.push(st(t,r$1,r$1+1,false)),r$1+=1;}return n}function vn(){return {segment:Fn}}function En(e={}){let t=e.isIntlAvailable??xn,n=e.createIntlBoundary??Rn,r=e.createFallbackBoundary??vn;if(!t())return r();try{return n()}catch{return r()}}var Sn;function Cn(){return Sn??=En(),Sn}function xo(e,t=Cn()){return t.segment(e)}function Ro(e,t){return t.map(n=>({graphemeFrom:v(e,n.utf16From),graphemeTo:v(e,n.utf16To),wordLike:n.wordLike}))}var wn={resourceEpoch:"resource-scoped",configEpoch:"coarse-gate",extensionFingerprint:"coarse-gate",shapingHash:"coarse-gate",producerVersion:"coarse-gate"},ut=Object.keys(wn),On=ut.filter(e=>wn[e]==="coarse-gate"),Pe=(e,t)=>{if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`${t} must be a non-negative safe integer`)},oe=(e,t)=>{if(e.trim().length===0)throw new TypeError(`${t} must not be blank`)},Fo={resourceEpoch:Pe,configEpoch:Pe,extensionFingerprint:oe,shapingHash:oe,producerVersion:Pe},vo=(e,t)=>{Fo[t](e[t],t);},ae=e=>{for(let t of ut)vo(e,t);return Object.freeze({resourceEpoch:e.resourceEpoch,configEpoch:e.configEpoch,extensionFingerprint:e.extensionFingerprint,shapingHash:e.shapingHash,producerVersion:e.producerVersion})},Eo=(e,t)=>{let n=ae(e),r=ae(t),o=ut.filter(a=>n[a]!==r[a]);return o.length===0?Object.freeze({status:"current"}):Object.freeze({status:"restart",changed:Object.freeze(o)})},dt=e=>{let t=e.map(({key:n,fingerprint:r})=>(oe(n,"resource dependency key"),oe(r,"resource dependency fingerprint"),Object.freeze({key:n,fingerprint:r}))).sort((n,r)=>n.key<r.key?-1:n.key>r.key?1:0);for(let n=1;n<t.length;n+=1)if(t[n-1].key===t[n].key)throw new TypeError(`Duplicate resource dependency: ${t[n].key}`);return Object.freeze(t)},Co=e=>(Pe(e.revision,"revision"),oe(e.dependencyFingerprint,"dependencyFingerprint"),oe(e.inputFingerprint,"inputFingerprint"),Object.freeze({revision:e.revision,dependencyFingerprint:e.dependencyFingerprint,inputFingerprint:e.inputFingerprint,resourceDependencies:dt(e.resourceDependencies),...ae(e)})),wo=(e,t)=>{let n=dt(e),r=dt(t),o=Math.max(n.length,r.length);for(let a=0;a<o;a+=1){let s=n[a],l=r[a];if(s?.key!==l?.key||s?.fingerprint!==l?.fingerprint)return {hit:false,reason:"resource-changed",resourceKey:s?.key??l.key}}return null};function Oo(e,t){if(e.dependencyFingerprint!==t.dependencyFingerprint)return {hit:false,reason:"dependency-changed"};if(e.inputFingerprint!==t.inputFingerprint)return {hit:false,reason:"input-changed"};let n=wo(e.resourceDependencies,t.resourceDependencies);if(n)return n;for(let r of On)if(e[r]!==t[r])return {hit:false,reason:"epoch-changed",epoch:r};return null}var ct=class{entries=new Map;get(t,n){let r=this.entries.get(t);if(!r)return {hit:false,reason:"absent"};let o=Oo(r.provenance,n);return o||{hit:true,value:r.value,provenance:r.provenance}}set(t,n,r){this.entries.set(t,{value:n,provenance:Co(r)});}evictEpoch(t){let n=ae(t),r=0;for(let[o,a]of this.entries){let s=a.provenance;On.some(l=>s[l]!==n[l])&&(this.entries.delete(o),r+=1);}return r}evictResources(t,n){let r=ae(t),o=this.evictEpoch(r);for(let[a,s]of this.entries)s.provenance.resourceDependencies.some(i=>n.get(i.key)!==i.fingerprint)&&(this.entries.delete(a),o+=1);return o}get size(){return this.entries.size}};function In(e){return e.projected===true?null:e.range}function To(e,t,n){let{page:r,story:o,host:a,noteScopeId:s,noteAreaKind:l}=e,i=o==="header"||o==="footer"?d=>A(d,e.origin,{x:r.box.x,y:r.box.y}):void 0;J$1(a,(d,c)=>{let{textboxDepth:y,textboxOwner:S,textboxPath:b,storyOrigin:x}=c,m=y===0?o:"textbox";for(let u of d.lines){let g=[...Q$1(u)].sort((f,E)=>(t.get(f.paragraphId)??Number.MAX_SAFE_INTEGER)-(t.get(E.paragraphId)??Number.MAX_SAFE_INTEGER));for(let f of g)for(let E of f.spans)n({page:r,story:m,rootStory:o,root:e,storyOrigin:x,absoluteBox:Object.freeze({x:x.x+E.box.x,y:x.y+E.box.y,width:E.box.width,height:E.box.height}),noteScopeId:s,noteAreaKind:l,textboxDepth:y,textboxOwner:S,textboxPath:b,paragraph:d,paragraphId:f.paragraphId,line:u,span:E,sourceRange:In(E)});}},e.origin,i);}function Lo(e,t){let n=new Map(W$1(e).map((r,o)=>[r,o]));G$1(e,r=>To(r,n,t));}var Bn="Calibri, Carlito, Helvetica, Arial, sans-serif",Xa=new Map([["calibri","Carlito"]]),Ao=65536,Bo=256;function Tn(e,t){return e===void 0?Math.max(1,Math.floor(t)):Number.isFinite(e)&&e>0?Math.max(1,Math.floor(e)):1}function Ln(e){let t=new Map,n=0;return {get(r){let o=t.get(r);if(o!==void 0)return t.delete(r),t.set(r,o),o},set(r,o){for(t.has(r)&&t.delete(r),t.set(r,o);t.size>e;){let a=t.keys().next();if(a.done)break;t.delete(a.value),n+=1;}},get size(){return t.size},get evictions(){return n}}}var An=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u;function Pn(e=null){return e!=null&&typeof e.measureText=="function"}function _n(e={}){let t=e.scale??1;if(!(t>0)||!Number.isFinite(t))return null;let n=e.fallbackFamily??Bn,r$1=e.context??null;if(!Pn(r$1))return null;let o=r$1,a=Ln(Tn(e.maxWidthEntries,Ao)),s=Ln(Tn(e.maxMetricsEntries,Bo)),l=e.fontAlias,i=c=>{let y=c.fontFamily&&An.test(c.fontFamily)?c.fontFamily:null,S=y?l?.(y):void 0,b=S&&An.test(S)?S:null,x=y?b?`"${b}", "${y}", ${n}`:`"${y}", ${n}`:n,m=c.bold?"bold":"normal",u=c.italic?"italic":"normal",g=c.smallCaps?"small-caps":"normal",f=c.fontSizePt*(c.verticalAlign==="baseline"?1:.75)*t;return `${u} ${g} ${m} ${f}px ${x}`},d=(c,y,S)=>c/t*(S.horizontalScalePercent/100)+y.length*S.characterSpacingPt;return {measure(c,y){if(c.length===0)return 0;let S=i(y),b=`${S}\0${c}`,x=a.get(b);if(x!==void 0)return d(x,c,y);o.font=S;let m=o.measureText(c).width;return a.set(b,m),d(m,c,y)},inkBounds(c,y){if(!c||c.length>2||y.shaping?.direction==="rtl"||r(c).length!==1)return;o.font=i(y);let S=o.textAlign,b=o.direction,x;try{S!==void 0&&(o.textAlign="left"),b!==void 0&&(o.direction="ltr"),x=o.measureText(c);}finally{S!==void 0&&(o.textAlign=S),b!==void 0&&(o.direction=b);}let m=x.actualBoundingBoxLeft,u=x.actualBoundingBoxRight;if(m===void 0||u===void 0||!Number.isFinite(m)||!Number.isFinite(u))return;let g=y.horizontalScalePercent/(100*t);return {left:-m*g,right:u*g}},lineMetrics(c){let y=c.fontSizePt*(c.verticalAlign==="baseline"?1:.75),S=i(c),b=s.get(S);if(b)return b;let x=y*1.15,m=y*.8;o.font=S;let u=o.measureText("Hxg"),g=u.fontBoundingBoxAscent,f=u.fontBoundingBoxDescent;if(typeof g=="number"&&Number.isFinite(g)&&g>0&&(m=g/t,typeof f=="number"&&Number.isFinite(f)&&f>=0)){let F=(g+f)/t;F>0&&(x=Math.max(F,x));}x>0||(x=y*1.15);let E={height:x,baseline:m};return s.set(S,E),E}}}function Po(e=1,t={}){let n=_n({...t,scale:t.scale??e});return n?{measurer:n,producer:t.fontAlias?"canvas-measurer+embedded":"canvas-measurer"}:{measurer:b(),producer:"fixed-measurer"}}function _o(e){let t;return n=>{t===void 0&&(t=qa(e.pages)?.hosts??null);let r=t?.get(n);return r?oa$1(r.pageNumber,r.format):null}}function Mn(e,t){let n=Ja(e,t.displayMode??ua$1),r=Rb({numberingIndex:t.numberingIndex,styleCascade:t.styleCascade},n).listItems,o=t.package?{footnotesPart:Of(t.package,"footnote"),endnotesPart:Of(t.package,"endnote")}:void 0,a=ic(n,r,o,t.package?fc(t.package,e,n):void 0,t.displayMode??ua$1);return {blocks:n,notes:o,context:a}}function zn(e,t,n,r,o){for(let a of t){if(r.length>=hh)return;if(n.tokenForParagraph(a.id)!==""&&kh(e,a.id)===null)for(let s of jh(a)){if(r.length>=hh)return;if(!s.rewritable)continue;let l=ta$1(s.instruction);if(l===null)continue;let i=n.liveValueOf(s.fieldNodeId,l);if(i===null&&o&&n.pageRefProjectionOf){let d=n.pageRefProjectionOf(s.fieldNodeId,l);if(d){let c=o(d.targetParagraphId);c!==null&&c.length>0&&pa$1(d.calibration,d.cached,c,Number.NaN)&&(i=c);}}i===null||i===s.cachedText||i.length>ih||i.includes(`
2
+ `)||i.includes("\r")||r.push({paragraphId:a.id,fieldNodeId:s.fieldNodeId,text:i});}}}function Mo(e,t){let{blocks:n,context:r}=Mn(e,t);if(r===null)return null;let o=[];return zn(e,Pb(n),r,o,t.pageRefPageNumberOf),o.length===0?null:{op:"refreshFieldResults",updates:o}}function ri(e,t){let{notes:n,context:r}=Mn(e,t);if(r===null||n===void 0)return [];let o=[],a=[{noteKind:"footnote",notesPart:n.footnotesPart},{noteKind:"endnote",notesPart:n.endnotesPart}];for(let{noteKind:s,notesPart:l}of a){if(!l)continue;let i=[];for(let d of gc(l,t.displayMode??ua$1)){if(i.length>=hh)break;zn(l,Pb(d),r,i);}i.length>0&&o.push({noteKind:s,op:{op:"refreshFieldResults",updates:i}});}return o}function zo(e){return e.box}function Nn(e,t){if(e.kind==="paragraph"){t.add(e.paragraphId);return}for(let n of e.rows)for(let r of n.cells)for(let o of r.blocks)Nn(o,t);}function No(e){let t=new Map,n=(o,a,s)=>{if(!(o.kind==="textValue"||s>wc*4)){for(let l of o.children)if(l.kind!=="textValue"){if(l.kind==="paragraph"){for(let i of r)t.get(i)?.push(l.id);n(l,l.id,s+1);continue}if(l.kind==="contentControl"){t.set(l.id,[]),r.push(l.id);let i=Gc(l);i&&n(i,a,s+1),r.pop();let d=t.get(l.id);d&&d.length===0&&a!==null&&d.push(a);continue}n(l,a,s+1);}}},r=[];return n(e,null,0),t}function ko(e,t){let n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return {x:n,y:r,width:Math.max(e.x+e.width,t.x+t.width)-n,height:Math.max(e.y+e.height,t.y+t.height)-r}}function Do(e,t){let n=Kc(e.root);if(n.length===0)return Ho;let r=new Map;t.pages.forEach((s,l)=>{(d=>{for(let c of d){let y=new Set;Nn(c,y);for(let S of y){let b=r.get(S)??[];b.push({pageIndex:l,box:zo(c)}),r.set(S,b);}}})(s.fragments);});let o=No(e.root),a=[];for(let s of n){let l=Ic(s.node),i=[...s.ancestors.map(S=>Ic(S).lock),l.lock],d=o.get(s.node.id)??[],c=new Map;for(let S of d)for(let b of r.get(S)??[]){let x=c.get(b.pageIndex);c.set(b.pageIndex,x?ko(x,b.box):b.box);}let y=[...c.entries()].sort((S,b)=>S[0]-b[0]).map(([S,b])=>({pageIndex:S,...b}));a.push({controlId:s.node.id,type:l.type,level:Jc(s.node),depth:s.depth,lock:l.lock,effectiveLock:Nc(i),showingPlaceholder:l.showingPlaceholder,temporary:l.temporary,...l.tag===void 0?{}:{tag:l.tag},...l.alias===void 0?{}:{alias:l.alias},...l.id===void 0?{}:{id:l.id},...l.dataBinding===void 0?{}:{dataBinding:l.dataBinding},paragraphIds:d,fragments:y});}return a}var Ho=Object.freeze([]);function Dn(e,t,n){let r=e.lines?.find(o=>{let a=o.spans;if(!a)return n<o.range.end;let s=a.filter(l=>l.range.paragraphId===t);return s.length===a.length?n<o.range.end:s.length>0&&n<s[s.length-1].range.end});return r?r.box.y:e.fragmentY}function Zo(e,t){let n=new Map;for(let r of e.pages)for(let[o,a]of Jo(r,t))n.has(o)||n.set(o,a);return n}var kn=new WeakMap;function Jo(e,t){let n=kn.get(t);n||(n=new WeakMap,kn.set(t,n));let r=n.get(e);if(r)return r;let o=new Map;for(let a of t(e)){let s=new Set([a.paragraphId]);for(let l of a.lines??[])for(let i of l.spans??[])s.add(i.range.paragraphId);for(let l of s)o.has(l)||o.set(l,{pageIndex:e.index,contentY:e.contentBox.y,fragmentY:a.box.y,...a.lines?{lines:a.lines}:{}});}return n.set(e,o),o}function Qo(e,t){let n=Ha(e);if(!n)return null;let r=t.get(n.start.paragraphId);return r?{pageIndex:r.pageIndex,y:r.contentY+Dn(r,n.start.paragraphId,n.start.offset)}:null}var pt=new WeakMap;function ea(e){let t=pt.get(e);if(t!==void 0)return t??void 0;let n=e.path;if(!n.startsWith("M")||n.length>1e6||/[^MLQCZ0-9eE+.,\s-]/u.test(n))return;let r=1/0,o=-1/0,a=n.matchAll(/([MLQCZ])([^MLQCZ]*)/gu);for(let l of a){let i=l[1]==="Z"?0:l[1]==="C"?6:l[1]==="Q"?4:2,d=l[2].trim().split(/[\s,]+/u).filter(Boolean).map(Number);if(d.length!==i||d.some(c=>!Number.isFinite(c))){pt.set(e,null);return}for(let c=0;c<d.length;c+=2)r=Math.min(r,d[c]),o=Math.max(o,d[c]);}let s=Number.isFinite(r)&&Number.isFinite(o)?{left:r,right:o}:void 0;return pt.set(e,s??null),s}function Hn(e,t,n,r){if(e.clusters.length!==1||e.glyphs.length===0)return;let o=1/0,a=-1/0;for(let l of e.glyphs){if(l.id===0)return;let i=ea(l.outline),d=l.outline.unitsPerEm;if(!i||!(d>0))return;let c=(l.originX+l.offsetX)/n;o=Math.min(o,c+i.left*t/d),a=Math.max(a,c+i.right*t/d);}let s={left:o*r,right:a*r};return Number.isFinite(s.left)&&Number.isFinite(s.right)?s:void 0}var ta="abcdefghijklmnopqrstuvwxyz";function pe(e){let t=Math.round(e.fontSizePt*2);return Math.max(1,t)}function J(e,t,n,r,o){return e.shape({text:o,fontSizeHalfPoints:pe(r),bidiLevel:r.shaping?.direction==="rtl"?1:0,environment:Y({...t,font:n,direction:r.shaping?.direction??"ltr",script:r.shaping?.script==="Zyyy"?t.script:r.shaping?.script??t.script,features:r.smallCaps?{...t.features,smcp:1}:t.features,fallbackOrder:[]})})}function _e(e,t,n,r,o){let a=o.get(n);if(a!==void 0)return a;let s=true;try{for(let l of ta){let i=J(e,t,n,{...r,smallCaps:!0},l),d=J(e,t,n,{...r,smallCaps:!1},l);if(!(i.glyphs.length!==d.glyphs.length||i.glyphs.some((y,S)=>y.id!==d.glyphs[S]?.id))){s=!1;break}}}catch{s=false;}return o.set(n,s),s}var na=.5,ra=4,Gn=4096,ye=e=>e.verticalAlign==="baseline"?1:.75;function Un(e){let t="environment"in e?e.environment:void 0,n="environment"in e?void 0:e,{shaper:r$1,resolveFont:o,fallback:a}=e,s=t??{shapingLibrary:n.shapingLibrary,unicodeDataVersion:n.unicodeDataVersion,script:n?.script??"Latn",fixedPointScale:n?.fixedPointScale??1e3,normalization:n?.normalization??"none",features:n?.features??{},roundingMode:n?.roundingMode??"halfToEven",language:n?.language??"en",variationAxes:{}},l=new WeakMap,i=new WeakMap,d=new WeakMap,c=new WeakMap,y=new WeakMap,S=new Array(Gn),b=0,x=(h,p,v)=>{let R=S[b];R&&R.cache.delete(R.text),h.set(p,v),S[b]={cache:h,text:p},b=(b+1)%Gn;},m=h=>{let p=c.get(h);if(p!==void 0)return p;let v=o(h);return c.set(h,v),v},u=(h,p,v)=>{let R=v?i:l,C=R.get(h);C||(C=new Map,R.set(h,C));let O=C.get(p);return O||(O=new Map,C.set(p,O)),O},g=new WeakMap,f=h=>{if(!h.shaping?.wordSpacingPt)return h;let p=g.get(h);return p||(p={...h,shaping:{...h.shaping,wordSpacingPt:void 0}},g.set(h,p)),p},E=(h,p)=>p.shaping?.wordSpacingPt?Pc(h)*p.shaping.wordSpacingPt:0,F=(h,p)=>a.measure(h,f(p))+E(h,p),T=(h,p)=>{let v=Math.max(0,a.measure(h,f(p))),R=a.caretAdvances?.(h,f(p))??Nc$1(h,v);if(!R||R.length!==h.length+1)return Nc$1(h,F(h,p));let C=Math.max(0,F(h,p)),O=0,I=0;return R.map((L,A)=>{if(A===0)return 0;h[A-1]===" "&&I++;let k=L+I*(p.shaping?.wordSpacingPt??0);return O=Math.max(O,Math.min(C,Number.isFinite(k)?k:O)),A===h.length?C:O})};return {measure(h,p){if(h.length===0)return 0;let v=m(p);if(!v)return F(h,p);let R=u(v,pe(p),p.smallCaps),C=p.shaping?`1:${JSON.stringify([p.shaping.script,p.shaping.direction,h])}`:`0:${h}`,O=R.get(C);if(O===void 0){let I=0;try{if(p.smallCaps&&!_e(r$1,s,v,p,y))return F(h,p);let L=J(r$1,s,v,p,h);if(L.glyphs.some(A=>A.id===0))return F(h,p);for(let A of L.glyphs)I+=A.advanceX;}catch{return F(h,p)}O=I/s.fixedPointScale,x(R,C,O);}return O*ye(p)*(p.horizontalScalePercent/100)+h.length*p.characterSpacingPt+E(h,p)},inkBounds(h,p){if(!h||h.length>2||p.shaping?.direction==="rtl"||r(h).length!==1)return;let v=m(p);if(!v)return a.inkBounds?.(h,p);try{if(p.smallCaps&&!_e(r$1,s,v,p,y))return a.inkBounds?.(h,p);let R=J(r$1,s,v,p,h);return Hn(R,pe(p)/2,s.fixedPointScale,ye(p)*p.horizontalScalePercent/100)}catch{return}},caretAdvances(h,p){let v=m(p);if(!v)return T(h,p);try{if(p.smallCaps&&!_e(r$1,s,v,p,y))return T(h,p);let R=J(r$1,s,v,p,h);return R.glyphs.some(C=>C.id===0)?T(h,p):Oc(h,R,ye(p)*(p.horizontalScalePercent/100)/s.fixedPointScale,p.characterSpacingPt,p.shaping?.wordSpacingPt??0)??Nc$1(h,R.glyphs.reduce((C,O)=>C+O.advanceX,0)*ye(p)*(p.horizontalScalePercent/100)/s.fixedPointScale+h.length*p.characterSpacingPt+E(h,p))}catch{return T(h,p)}},lineMetrics(h){let p=m(h);if(!p)return a.lineMetrics(h);let v=ye(h),R=d.get(p);R||(R=new Map,d.set(p,R));let C=pe(h),O=R.get(C);if(O)return v===1?O:{height:O.height*v,baseline:O.baseline*v};let I,L=true,A=p.substitution?.lineMetrics;if(A){let k=C/2;I={height:A.heightEm*k,baseline:A.baselineEm*k};}else try{let k=J(r$1,s,p,h," "),ft=k.metrics.ascent/s.fixedPointScale,Yn=k.metrics.descent/s.fixedPointScale,$n=C/2,ze=ft+Yn,ht=$n*ra,mt=ze>ht?ht/ze:1,gt=ze*mt,Zn=Math.min(Math.max(0,k.metrics.lineGap/s.fixedPointScale),gt*na),bt=gt+Zn;bt>0?I={height:bt,baseline:ft*mt}:(I=a.lineMetrics(h),L=!1);}catch{I=a.lineMetrics(h),L=false;}return L?(R.set(C,I),v===1?I:{height:I.height*v,baseline:I.baseline*v}):I}}}function oa(e,t){return Un({...t,shaper:e.shaper,environment:e.environment})}function aa(e){let{layout:t,viewport:n}=e,r=new Set;if(!n){for(let i of t.pages)r.add(i.index);return r}let o=Math.max(0,Math.trunc(e.overscanPages??1)),a=n.top+n.height,s=-1,l=-1;for(let i of t.pages){let d=i.box.y;d+i.box.height>=n.top&&d<=a&&(s===-1&&(s=i.index),l=i.index);}if(s===-1){let i=ia(t,n.top);i!==null&&(s=i,l=i);}if(s!==-1){let i=Math.max(0,s-o),d=Math.min(t.pages.length-1,l+o);for(let c=i;c<=d;c+=1)r.add(c);}for(let i of e.pinnedPages??[])i>=0&&i<t.pages.length&&r.add(i);return r}function ia(e,t){let n=null,r=Number.POSITIVE_INFINITY;for(let o of e.pages){let a=t<o.box.y?o.box.y-t:t>o.box.y+o.box.height?t-(o.box.y+o.box.height):0;a<r&&(r=a,n=o.index);}return n}var jn=["text-local","paragraph-local","flow-structural","global"];function Vn(e,t){return jn.indexOf(t)>jn.indexOf(e)?t:e}function sa(e){return {impact:"text-local",paragraphIds:new Set,created:new Set,deleted:new Set,dependencyKeys:new Set,structural:false,revision:e}}function la(e){let{run:t,currentRevision:n,publish:r,schedule:o}=e,a=null,s=null,l=null,i=0,d=0;function c(u){let g=e.runCooperatively;if(!g)return t(u);let f=g(u);l=f;try{for(;;){let E=f.step();if(E)return E;if(n()!==u.revision)return f.cancel(),d+=1,null;if(l!==f)return null}}finally{l===f&&(l=null);}}function y(u){let g=b(n());g.impact=Vn(g.impact,u.impact),g.structural=g.structural||u.structural;for(let f of u.paragraphIds)g.paragraphIds.add(f);for(let f of u.created)g.created.add(f);for(let f of u.deleted)g.deleted.add(f);for(let f of u.dependencyKeys)g.dependencyKeys.add(f);}let S=u=>({impact:u.impact,paragraphIds:u.paragraphIds,created:u.created,deleted:u.deleted,dependencyKeys:u.dependencyKeys,structural:u.structural,revision:u.revision});function b(u){return a||(a=sa(u)),a.revision=Math.max(a.revision,u),a}function x(){!o||s||(s=o(()=>{s=null,m();}));}function m(){s&&(s(),s=null),l&&(l.cancel(),l=null,d+=1);let u=a;if(!u)return false;a=null;let g=S(u),f=c(g);return !f||f.revision!==n()?(i+=1,y(g),x(),false):(r(f,g),true)}return {notify(u){let g=b(n());g.impact=Vn(g.impact,u.impact);for(let f of u.dirty)g.paragraphIds.add(f);for(let f of u.created)g.created.add(f),g.paragraphIds.add(f);for(let f of u.deleted)g.deleted.add(f),g.paragraphIds.add(f);for(let f of u.dependencyKeys)g.dependencyKeys.add(f);for(let f of u.splitJoin)g.structural=true,"split"in f?(g.paragraphIds.add(f.split.from),g.paragraphIds.add(f.split.tail)):(g.paragraphIds.add(f.join.kept),g.paragraphIds.add(f.join.removed));(u.impact==="flow-structural"||u.impact==="global")&&(g.structural=true),x();},invalidateAll(u,g){let f=b(u);f.impact="flow-structural",f.structural=true,g&&f.dependencyKeys.add(g),x();},flush:m,pending:()=>a?S(a):null,cancel(){s?.(),s=null,l?.cancel(),l=null,a=null;},get staleDiscards(){return i},get cancelledRuns(){return d}}}var Wn=new WeakMap;function U(e){let t=Wn.get(e);if(t)return t;let n=new Map,r=new Map,o=new Map,a=new Map,s=(i,d,c,y)=>{for(let S of i){if(S.kind==="paragraph")continue;let b=S.tableId;a.set(b,Math.max(a.get(b)??0,(S.columnEdges?.length??1)-1));let x=o.get(b);x||(x=new Map,o.set(b,x),n.set(b,[]),r.set(b,new Map));for(let m of S.rows){let u=x.get(m.id);u===void 0&&(u=x.size,x.set(m.id,u),r.get(b).set(u,m.cells));for(let g of m.cells)n.get(b).push({pageIndex:d,tableId:b,row:m,cell:g,rowIndex:u,isHeaderRepeat:m.isHeaderRepeat,offsetX:c,offsetY:y}),s(g.blocks,d,c,y);}}};for(let i of e.pages){s(i.fragments,i.index,0,0);for(let d of [i.header,i.footer])d&&s(d.fragments,i.index,d.box.x-i.contentBox.x,d.box.y-i.contentBox.y);for(let d of [i.footnotes,i.endnotes])if(d)for(let c of d.notes)s(c.fragments,i.index,c.box.x-i.contentBox.x,c.box.y-i.contentBox.y);}let l=new Map;for(let[i,d]of n)l.set(i,{placed:d,rows:r.get(i)??new Map,columnCount:a.get(i)??0});return Wn.set(e,l),l}function Xn(e){let t=e.columnCount;for(let n of e.rows.values())for(let r of n)t=Math.max(t,X(r).to+1);return t}var X=e=>({from:e.gridColumn,to:e.gridColumn+Math.max(1,e.gridSpan)-1});function da(e,t,n){if(t.tableId!==n.tableId)return null;let r=U(e).get(t.tableId);if(!r)return null;let o=Math.min(t.rowIndex,n.rowIndex),a=Math.max(t.rowIndex,n.rowIndex),s=Math.min(X(t).from,X(n).from),l=Math.max(X(t).to,X(n).to),i=b=>{let{from:x,to:m}=X(b);return m>=s&&x<=l},d=b=>(r.rows.get(b)??[]).some(x=>x.vMergeContinue&&i(x)),c=r.rows.size+Xn(r)+2;for(let b=0;!(b>c);b+=1){let x=false;for(let[m,u]of r.rows)if(!(m<o||m>a))for(let g of u){if(!i(g))continue;let{from:f,to:E}=X(g);f<s&&(s=f,x=true),E>l&&(l=E,x=true);}for(;o>0&&d(o);)o-=1,x=true;for(;d(a+1);)a+=1,x=true;if(!x)break}let y=[],S=new Set;for(let b of r.placed){if(b.isHeaderRepeat||b.rowIndex<o||b.rowIndex>a)continue;let{from:x,to:m}=X(b.cell);m<s||x>l||S.has(b.cell.id)||(S.add(b.cell.id),y.push(b.cell.id));}return y.length===0?null:{kind:"cells",tableId:t.tableId,cellIds:y,rows:{from:o,to:a},columns:{from:s,to:l},text:ca(e,t.tableId,y)}}function wi(e,t){return qn(e,t,true)}function Me(e,t){return qn(e,t,false)}function qn(e,t,n){let r=new Set(t),o=[],a=new Set;for(let s of U(e).values())for(let l of s.placed)if(!(l.isHeaderRepeat||!r.has(l.cell.id)))for(let i of l.cell.blocks)n&&i.kind!=="paragraph"||ie(i,o,a);return o}function ie(e,t,n){if(e.kind==="paragraph"){for(let r of T(e))n.has(r)||(n.add(r),t.push(r));return}for(let r of e.rows)if(!r.isHeaderRepeat)for(let o of r.cells)for(let a of o.blocks)ie(a,t,n);}function ca(e,t,n){let r=Me(e,n),o=r[0],a=r[r.length-1];return !o||!a?ua(e,t):{anchor:{paragraphId:o,offset:0},head:{paragraphId:a,offset:ke(e,a).length}}}function ua(e,t){let n=U(e).get(t);for(let o of n?.placed??[]){if(o.isHeaderRepeat)continue;let a=[];for(let l of o.cell.blocks)ie(l,a,new Set);let s=a[0];if(s){let l={paragraphId:s,offset:0};return {anchor:l,head:l}}}for(let o of e.pages)for(let a of B$1(o)){let s={paragraphId:a.paragraphId,offset:0};return {anchor:s,head:s}}let r={paragraphId:"",offset:0};return {anchor:r,head:r}}function pa(e){let t=[...B$1(e)];for(let n of [e.header,e.footer])n&&t.push(...C(n.fragments));for(let n of [e.footnotes,e.endnotes])if(n)for(let r of n.notes)t.push(...C(r.fragments));return t}function ya(e,t){let n=new Set(Me(e,t)),r=[],o=new Set;for(let a of e.pages)for(let s of pa(a))if(n.has(s.paragraphId))for(let l of s.lines)for(let i of l.spans){let d=`${i.range.paragraphId}:${i.range.start}:${i.range.end}`;o.has(d)||(o.add(d),r.push(i));}return r}function fa(e,t){let n=new Set(t),r=[];for(let o of U(e).values())for(let a of o.placed)n.has(a.cell.id)&&r.push({pageIndex:a.pageIndex,x:a.cell.box.x+a.offsetX,y:a.cell.box.y+a.offsetY,width:a.cell.box.width,height:a.cell.box.height});return r}function ha(e,t){let n=U(e).get(t.tableId);if(!n)return "";let r=new Set(t.cellIds),o=n.placed.some(l=>l.cell.logicalGridColumn!==void 0),a=new Map,s=new Set;for(let l of n.placed){if(l.isHeaderRepeat||!r.has(l.cell.id)||s.has(l.cell.id))continue;s.add(l.cell.id);let i=Me(e,[l.cell.id]).map(y=>ke(e,y)).join(`
3
3
  `),d=a.get(l.rowIndex),c=l.cell.gridColumn+(o?Math.max(1,l.cell.gridSpan)-1:0);d?d.set(c,i):a.set(l.rowIndex,new Map([[c,i]]));}return [...a.keys()].sort((l,i)=>l-i).map(l=>{let i=a.get(l),d=[];for(let c=0;c<=t.columns.to-t.columns.from;c+=1){let y=o?t.columns.to-c:t.columns.from+c;d.push(i.get(y)??"");}return d.join(" ")}).join(`
4
4
  `)}function yt(e,t){let n=null,r=-1;for(let[o,a]of U(e))for(let s of a.placed){if(s.isHeaderRepeat)continue;let l=[];for(let d of s.cell.blocks)ie(d,l,new Set);if(!l.includes(t))continue;let i=o.length;i<=r||(r=i,n={tableId:o,rows:a.rows.size,columns:Xn(a),rowIndex:s.rowIndex,columnIndex:s.cell.logicalGridColumn??s.cell.gridColumn});}return n}function Oi(e,t,n){if(n){let a=yt(e,t);if(!a||a.tableId!==n.tableId)return null;let s=n.cellIds[0];if(!s)return null;let l=U(e).get(n.tableId);if(!l)return null;for(let i of l.placed)if(i.cell.id===s)return {tableId:n.tableId,rowId:i.row.id,cellId:s,cellIds:n.cellIds,gridColumnIndex:i.cell.logicalGridColumn??i.cell.gridColumn,isHeaderRepeat:i.isHeaderRepeat};return null}let r=yt(e,t);if(!r)return null;let o=U(e).get(r.tableId);if(!o)return null;for(let a of o.placed){if(a.isHeaderRepeat)continue;let s=[];for(let l of a.cell.blocks)ie(l,s,new Set);if(s.includes(t))return {tableId:r.tableId,rowId:a.row.id,cellId:a.cell.id,cellIds:[a.cell.id],gridColumnIndex:a.cell.logicalGridColumn??a.cell.gridColumn,isHeaderRepeat:a.row.isHeaderRepeat}}return null}var Kn=new WeakMap;function Ii(e,t){let n=Kn.get(e);if(n)return n.get(t)??null;let r=new Map;for(let[o,a]of U(e))for(let s of a.placed){if(s.isHeaderRepeat)continue;let l=[];for(let d of s.cell.blocks)ie(d,l,new Set);let i={tableId:o,rowId:s.row.id,cellId:s.cell.id,rowIndex:s.rowIndex,gridColumn:s.cell.gridColumn,gridSpan:s.cell.gridSpan};for(let d of l){let c=r.get(d);c&&c.tableId.length>=o.length||r.set(d,i);}}return Kn.set(e,r),r.get(t)??null}export{Bn as $,lo as A,La as B,at as C,Aa as D,co as E,po as F,Ba as G,yo as H,it as I,Be as J,fo as K,ho as L,mo as M,lt as N,xn as O,Rn as P,Fn as Q,vn as R,En as S,Cn as T,xo as U,Ro as V,ae as W,Eo as X,ct as Y,In as Z,Lo as _,ee as a,Xa as aa,D as b,Pn as ba,V as c,_n as ca,j as d,Po as da,te as e,_o as ea,Kt as f,Mo as fa,W as g,ri as ga,Ee as h,Do as ha,we as i,Dn as ia,Ye as j,Zo as ja,M as k,Qo as ka,Y as l,J as la,nn as m,_e as ma,Qe as n,Un as na,Le as o,oa,sr as p,aa as pa,$ as q,la as qa,tt as r,da as ra,lr as s,wi as sa,w as t,Me as ta,nt as u,ya as ua,on as v,fa as va,ot as w,ha as wa,dn as x,yt as xa,G as y,Oi as ya,so as z,Ii as za};
@@ -1 +1 @@
1
- 'use strict';var chunkPBM6WERF_cjs=require('../chunk-PBM6WERF.cjs');require('../chunk-77DD4EBC.cjs');Object.defineProperty(exports,"createCollaborationDocumentPort",{enumerable:true,get:function(){return chunkPBM6WERF_cjs.b}});
1
+ 'use strict';var chunk3JKOZBQ3_cjs=require('../chunk-3JKOZBQ3.cjs');require('../chunk-FBWBSHC4.cjs');Object.defineProperty(exports,"createCollaborationDocumentPort",{enumerable:true,get:function(){return chunk3JKOZBQ3_cjs.b}});
@@ -1 +1 @@
1
- export{b as createCollaborationDocumentPort}from'../chunk-ZMM5RNM6.js';import'../chunk-CJCFEXTA.js';
1
+ export{b as createCollaborationDocumentPort}from'../chunk-3SU7UWCR.js';import'../chunk-IA7WTZHI.js';
package/dist/editor.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';var chunkMRPPCGCX_cjs=require('./chunk-MRPPCGCX.cjs'),chunkZKWRCLT2_cjs=require('./chunk-ZKWRCLT2.cjs');require('./chunk-FZ2BIMCY.cjs');var chunkKDYD5TAW_cjs=require('./chunk-KDYD5TAW.cjs'),chunkNJONXJJY_cjs=require('./chunk-NJONXJJY.cjs');require('./chunk-GUPITGJQ.cjs'),require('./chunk-ZKQX2PNF.cjs'),require('./chunk-LQ6XWTKQ.cjs'),require('./chunk-SUEX3CL7.cjs'),require('./chunk-CG7CP632.cjs'),require('./chunk-YVYEJBLL.cjs'),require('./chunk-FGBADUSK.cjs'),require('./chunk-MDP5SNK4.cjs'),require('./chunk-BTQKU64Q.cjs'),require('./chunk-PBM6WERF.cjs');var chunk77DD4EBC_cjs=require('./chunk-77DD4EBC.cjs');require('./chunk-OHJQ7GPZ.cjs');Object.defineProperty(exports,"AUTO_ZOOM_MODE",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Ia}});Object.defineProperty(exports,"BROWSER_AUTOMATION_CAPABILITIES",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Na}});Object.defineProperty(exports,"CHROME_GROUPS",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.va}});Object.defineProperty(exports,"CHROME_MENUS",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.za}});Object.defineProperty(exports,"CHROME_UNAVAILABLE_KEY",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Ca}});Object.defineProperty(exports,"DEFAULT_TABLE_CHROME_DRAFT",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.X}});Object.defineProperty(exports,"EMU_PER_POINT",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.P}});Object.defineProperty(exports,"FIT_WIDTH_ZOOM_MODE",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Ja}});Object.defineProperty(exports,"IMAGE_OVERLAY_NUDGE_PT",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.N}});Object.defineProperty(exports,"IMAGE_OVERLAY_NUDGE_SHIFT_PT",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.O}});Object.defineProperty(exports,"LOADING_SNAPSHOT",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.c}});Object.defineProperty(exports,"NO_MIXED_FIELDS",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.db}});Object.defineProperty(exports,"PX_PER_CM",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.l}});Object.defineProperty(exports,"PX_PER_INCH",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.k}});Object.defineProperty(exports,"SNAP_TWIPS_CM",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.r}});Object.defineProperty(exports,"SNAP_TWIPS_INCH",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.q}});Object.defineProperty(exports,"TABLE_BORDER_STYLE_OPTIONS",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.ba}});Object.defineProperty(exports,"TABLE_BORDER_TARGET_OPTIONS",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.aa}});Object.defineProperty(exports,"TABLE_BORDER_WIDTH_OPTIONS",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.ca}});Object.defineProperty(exports,"TABLE_CHROME_SLOT_IDS",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Y}});Object.defineProperty(exports,"TAB_ALIGNMENT_LABELS",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.$a}});Object.defineProperty(exports,"TWIPS_PER_CM",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.p}});Object.defineProperty(exports,"TWIPS_PER_INCH",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.o}});Object.defineProperty(exports,"ZOOM_MAX",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Ha}});Object.defineProperty(exports,"ZOOM_MIN",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Ga}});Object.defineProperty(exports,"applyTableChromePick",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.da}});Object.defineProperty(exports,"applyThemeShade",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.x}});Object.defineProperty(exports,"applyThemeTint",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.w}});Object.defineProperty(exports,"blankDocumentBytes",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.d}});Object.defineProperty(exports,"canExecuteImageCommand",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.L}});Object.defineProperty(exports,"captureImageMutationPreconditions",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.K}});Object.defineProperty(exports,"changedFields",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.gb}});Object.defineProperty(exports,"chromeControlCount",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Ba}});Object.defineProperty(exports,"chromeMenuSlots",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Aa}});Object.defineProperty(exports,"chromeProbeForSlot",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.ha}});Object.defineProperty(exports,"chromeSlotId",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.wa}});Object.defineProperty(exports,"chromeSlotIsToggle",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.na}});Object.defineProperty(exports,"clipboardDropLandsText",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.f}});Object.defineProperty(exports,"clipboardPasteLandsContent",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.e}});Object.defineProperty(exports,"commandForSlot",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.ia}});Object.defineProperty(exports,"commandForSlotValue",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.ka}});Object.defineProperty(exports,"commandForTableChromeSlotValue",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.ja}});Object.defineProperty(exports,"computeImageResizeResult",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Va}});Object.defineProperty(exports,"computeMovedImagePosition",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.U}});Object.defineProperty(exports,"computeResizedImageExtentEmu",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.T}});Object.defineProperty(exports,"createBrowserAutomationHost",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Oa}});Object.defineProperty(exports,"createDocxEditor",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Ma}});Object.defineProperty(exports,"createFontSource",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.i}});Object.defineProperty(exports,"createImageOverlayScrollPort",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Wa}});Object.defineProperty(exports,"createLayoutShaping",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.b}});Object.defineProperty(exports,"cropPercentFromCropPermille",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.H}});Object.defineProperty(exports,"cropPercentFromPermille",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.F}});Object.defineProperty(exports,"cropPercentFromSourceCrop",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.C}});Object.defineProperty(exports,"cropPermilleFromCropPercent",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.G}});Object.defineProperty(exports,"cropPermilleFromPercent",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.E}});Object.defineProperty(exports,"cssPixelsToLayoutPoints",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Ra}});Object.defineProperty(exports,"customFonts",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.j}});Object.defineProperty(exports,"defaultChromeGroups",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.xa}});Object.defineProperty(exports,"defaultTableLabel",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Z}});Object.defineProperty(exports,"dragIndent",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.u}});Object.defineProperty(exports,"editorCommandKey",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.ua}});Object.defineProperty(exports,"emuToOverlayPoints",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.S}});Object.defineProperty(exports,"equationAtPosition",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Ea}});Object.defineProperty(exports,"executeImageCommand",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.M}});Object.defineProperty(exports,"finalizeImageOverlayInteraction",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Xa}});Object.defineProperty(exports,"formatInches",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Za}});Object.defineProperty(exports,"formattingBarChromeGroups",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.ya}});Object.defineProperty(exports,"generateRulerTicks",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.m}});Object.defineProperty(exports,"handlePosition",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.s}});Object.defineProperty(exports,"inchesToTwips",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs._a}});Object.defineProperty(exports,"isStaleImageInteractionCommit",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.V}});Object.defineProperty(exports,"isTableChromeSlot",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs._}});Object.defineProperty(exports,"layoutPointsToCssPixels",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Qa}});Object.defineProperty(exports,"loadFonts",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.h}});Object.defineProperty(exports,"lowerColorValueForBorder",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.z}});Object.defineProperty(exports,"lowerColorValueForFill",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.A}});Object.defineProperty(exports,"mixedFieldsOf",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.eb}});Object.defineProperty(exports,"mountPaginatedSurface",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Fa}});Object.defineProperty(exports,"overlayFrameToSheetCssPixels",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Sa}});Object.defineProperty(exports,"overlayHostOrigin",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Ta}});Object.defineProperty(exports,"partOfNodeId",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.g}});Object.defineProperty(exports,"pointsToEmu",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.R}});Object.defineProperty(exports,"probeTableChromeCommand",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.ea}});Object.defineProperty(exports,"resizePreservesAspect",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Ua}});Object.defineProperty(exports,"resolveColorValueToCss",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.B}});Object.defineProperty(exports,"resolveThemeColorHex",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.y}});Object.defineProperty(exports,"resolveZoomMode",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Ka}});Object.defineProperty(exports,"rulerPageBox",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.n}});Object.defineProperty(exports,"runSave",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.ra}});Object.defineProperty(exports,"runTableChromeCommand",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.pa}});Object.defineProperty(exports,"runTableCommand",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.ta}});Object.defineProperty(exports,"runToolbarCommand",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.qa}});Object.defineProperty(exports,"sameTabStops",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.fb}});Object.defineProperty(exports,"sameZoomMode",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.La}});Object.defineProperty(exports,"seedFields",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.cb}});Object.defineProperty(exports,"selectedDrawingOverlayTargetOf",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Q}});Object.defineProperty(exports,"selectedImageStateOf",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.J}});Object.defineProperty(exports,"signedFirstLineOf",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.bb}});Object.defineProperty(exports,"snapTwips",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.t}});Object.defineProperty(exports,"sourceCropFromCropPercent",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.D}});Object.defineProperty(exports,"specialOf",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.ab}});Object.defineProperty(exports,"surfaceExtent",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Da}});Object.defineProperty(exports,"surfacePaintScale",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Pa}});Object.defineProperty(exports,"tableChromeIconPaths",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.ga}});Object.defineProperty(exports,"tableChromeLabelKeyForTarget",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.fa}});Object.defineProperty(exports,"tableChromeToolbarState",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.la}});Object.defineProperty(exports,"tableChromeVisible",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.$}});Object.defineProperty(exports,"tableCommandState",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.W}});Object.defineProperty(exports,"tableCommandToolbarState",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.sa}});Object.defineProperty(exports,"toEditorFontError",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.a}});Object.defineProperty(exports,"toolbarCommandState",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.ma}});Object.defineProperty(exports,"toolbarCommandStates",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.oa}});Object.defineProperty(exports,"trapTabWithin",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.ib}});Object.defineProperty(exports,"twipsToInches",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.Ya}});Object.defineProperty(exports,"validateImageCropPercent",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.I}});Object.defineProperty(exports,"validateThemeModifier",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.v}});Object.defineProperty(exports,"withTabStop",{enumerable:true,get:function(){return chunkMRPPCGCX_cjs.hb}});Object.defineProperty(exports,"resolveEditorModules",{enumerable:true,get:function(){return chunkZKWRCLT2_cjs.a}});Object.defineProperty(exports,"FONT_RESOLVER_BRAND",{enumerable:true,get:function(){return chunkKDYD5TAW_cjs.h}});Object.defineProperty(exports,"FONT_RESOLVER_MARK_KEY",{enumerable:true,get:function(){return chunkKDYD5TAW_cjs.g}});Object.defineProperty(exports,"MAX_RESOLVER_FAMILIES",{enumerable:true,get:function(){return chunkKDYD5TAW_cjs.c}});Object.defineProperty(exports,"WORD_DEFAULT_FONT",{enumerable:true,get:function(){return chunkKDYD5TAW_cjs.d}});Object.defineProperty(exports,"composeFontConfiguration",{enumerable:true,get:function(){return chunkKDYD5TAW_cjs.e}});Object.defineProperty(exports,"composeFontOrigins",{enumerable:true,get:function(){return chunkKDYD5TAW_cjs.k}});Object.defineProperty(exports,"defineFontResolver",{enumerable:true,get:function(){return chunkKDYD5TAW_cjs.i}});Object.defineProperty(exports,"isFontResolver",{enumerable:true,get:function(){return chunkKDYD5TAW_cjs.j}});Object.defineProperty(exports,"disposeLayoutShaping",{enumerable:true,get:function(){return chunkNJONXJJY_cjs.I}});Object.defineProperty(exports,"DEFAULT_IMAGE_RESOURCE_LIMITS",{enumerable:true,get:function(){return chunk77DD4EBC_cjs.m}});Object.defineProperty(exports,"DRAWING_REL_FROM_H",{enumerable:true,get:function(){return chunk77DD4EBC_cjs.Sh}});Object.defineProperty(exports,"DRAWING_REL_FROM_V",{enumerable:true,get:function(){return chunk77DD4EBC_cjs.Th}});Object.defineProperty(exports,"IMAGE_WRAP_TARGETS",{enumerable:true,get:function(){return chunk77DD4EBC_cjs.cb}});Object.defineProperty(exports,"TEXT_FORM_FORMATS",{enumerable:true,get:function(){return chunk77DD4EBC_cjs.ah}});Object.defineProperty(exports,"positionInputFromPropertiesCommand",{enumerable:true,get:function(){return chunk77DD4EBC_cjs.Vh}});Object.defineProperty(exports,"propertiesCommandHasPositionFields",{enumerable:true,get:function(){return chunk77DD4EBC_cjs.Uh}});Object.defineProperty(exports,"resolveImageResourceLimits",{enumerable:true,get:function(){return chunk77DD4EBC_cjs.n}});Object.defineProperty(exports,"resolveSvgIntrinsicSize",{enumerable:true,get:function(){return chunk77DD4EBC_cjs.xb}});Object.defineProperty(exports,"sniffImageMime",{enumerable:true,get:function(){return chunk77DD4EBC_cjs.tb}});Object.defineProperty(exports,"validateDrawingPositionInput",{enumerable:true,get:function(){return chunk77DD4EBC_cjs.Rh}});Object.defineProperty(exports,"validateRasterHeader",{enumerable:true,get:function(){return chunk77DD4EBC_cjs.yb}});Object.defineProperty(exports,"validateSetImagePositionCommand",{enumerable:true,get:function(){return chunk77DD4EBC_cjs.Wh}});
1
+ 'use strict';var chunkOWUSDS3L_cjs=require('./chunk-OWUSDS3L.cjs'),chunkZKWRCLT2_cjs=require('./chunk-ZKWRCLT2.cjs');require('./chunk-RDKPMNN6.cjs');var chunk7VO6BLKV_cjs=require('./chunk-7VO6BLKV.cjs'),chunkJWHXOJEU_cjs=require('./chunk-JWHXOJEU.cjs');require('./chunk-6W4DIR4X.cjs'),require('./chunk-5BI4SIHO.cjs'),require('./chunk-NDPLQG4Y.cjs'),require('./chunk-GWW5FOLJ.cjs'),require('./chunk-76F73CY6.cjs'),require('./chunk-NIVIC7PA.cjs'),require('./chunk-FGBADUSK.cjs'),require('./chunk-VSCPFHTD.cjs'),require('./chunk-BTQKU64Q.cjs'),require('./chunk-3JKOZBQ3.cjs');var chunkFBWBSHC4_cjs=require('./chunk-FBWBSHC4.cjs');require('./chunk-OHJQ7GPZ.cjs');Object.defineProperty(exports,"AUTO_ZOOM_MODE",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Ia}});Object.defineProperty(exports,"BROWSER_AUTOMATION_CAPABILITIES",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Na}});Object.defineProperty(exports,"CHROME_GROUPS",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.va}});Object.defineProperty(exports,"CHROME_MENUS",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.za}});Object.defineProperty(exports,"CHROME_UNAVAILABLE_KEY",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Ca}});Object.defineProperty(exports,"DEFAULT_TABLE_CHROME_DRAFT",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.X}});Object.defineProperty(exports,"EMU_PER_POINT",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.P}});Object.defineProperty(exports,"FIT_WIDTH_ZOOM_MODE",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Ja}});Object.defineProperty(exports,"IMAGE_OVERLAY_NUDGE_PT",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.N}});Object.defineProperty(exports,"IMAGE_OVERLAY_NUDGE_SHIFT_PT",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.O}});Object.defineProperty(exports,"LOADING_SNAPSHOT",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.c}});Object.defineProperty(exports,"NO_MIXED_FIELDS",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.db}});Object.defineProperty(exports,"PX_PER_CM",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.l}});Object.defineProperty(exports,"PX_PER_INCH",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.k}});Object.defineProperty(exports,"SNAP_TWIPS_CM",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.r}});Object.defineProperty(exports,"SNAP_TWIPS_INCH",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.q}});Object.defineProperty(exports,"TABLE_BORDER_STYLE_OPTIONS",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.ba}});Object.defineProperty(exports,"TABLE_BORDER_TARGET_OPTIONS",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.aa}});Object.defineProperty(exports,"TABLE_BORDER_WIDTH_OPTIONS",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.ca}});Object.defineProperty(exports,"TABLE_CHROME_SLOT_IDS",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Y}});Object.defineProperty(exports,"TAB_ALIGNMENT_LABELS",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.$a}});Object.defineProperty(exports,"TWIPS_PER_CM",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.p}});Object.defineProperty(exports,"TWIPS_PER_INCH",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.o}});Object.defineProperty(exports,"ZOOM_MAX",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Ha}});Object.defineProperty(exports,"ZOOM_MIN",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Ga}});Object.defineProperty(exports,"applyTableChromePick",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.da}});Object.defineProperty(exports,"applyThemeShade",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.x}});Object.defineProperty(exports,"applyThemeTint",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.w}});Object.defineProperty(exports,"blankDocumentBytes",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.d}});Object.defineProperty(exports,"canExecuteImageCommand",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.L}});Object.defineProperty(exports,"captureImageMutationPreconditions",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.K}});Object.defineProperty(exports,"changedFields",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.gb}});Object.defineProperty(exports,"chromeControlCount",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Ba}});Object.defineProperty(exports,"chromeMenuSlots",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Aa}});Object.defineProperty(exports,"chromeProbeForSlot",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.ha}});Object.defineProperty(exports,"chromeSlotId",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.wa}});Object.defineProperty(exports,"chromeSlotIsToggle",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.na}});Object.defineProperty(exports,"clipboardDropLandsText",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.f}});Object.defineProperty(exports,"clipboardPasteLandsContent",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.e}});Object.defineProperty(exports,"commandForSlot",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.ia}});Object.defineProperty(exports,"commandForSlotValue",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.ka}});Object.defineProperty(exports,"commandForTableChromeSlotValue",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.ja}});Object.defineProperty(exports,"computeImageResizeResult",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Va}});Object.defineProperty(exports,"computeMovedImagePosition",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.U}});Object.defineProperty(exports,"computeResizedImageExtentEmu",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.T}});Object.defineProperty(exports,"createBrowserAutomationHost",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Oa}});Object.defineProperty(exports,"createDocxEditor",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Ma}});Object.defineProperty(exports,"createFontSource",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.i}});Object.defineProperty(exports,"createImageOverlayScrollPort",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Wa}});Object.defineProperty(exports,"createLayoutShaping",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.b}});Object.defineProperty(exports,"cropPercentFromCropPermille",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.H}});Object.defineProperty(exports,"cropPercentFromPermille",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.F}});Object.defineProperty(exports,"cropPercentFromSourceCrop",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.C}});Object.defineProperty(exports,"cropPermilleFromCropPercent",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.G}});Object.defineProperty(exports,"cropPermilleFromPercent",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.E}});Object.defineProperty(exports,"cssPixelsToLayoutPoints",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Ra}});Object.defineProperty(exports,"customFonts",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.j}});Object.defineProperty(exports,"defaultChromeGroups",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.xa}});Object.defineProperty(exports,"defaultTableLabel",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Z}});Object.defineProperty(exports,"dragIndent",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.u}});Object.defineProperty(exports,"editorCommandKey",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.ua}});Object.defineProperty(exports,"emuToOverlayPoints",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.S}});Object.defineProperty(exports,"equationAtPosition",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Ea}});Object.defineProperty(exports,"executeImageCommand",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.M}});Object.defineProperty(exports,"finalizeImageOverlayInteraction",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Xa}});Object.defineProperty(exports,"formatInches",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Za}});Object.defineProperty(exports,"formattingBarChromeGroups",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.ya}});Object.defineProperty(exports,"generateRulerTicks",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.m}});Object.defineProperty(exports,"handlePosition",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.s}});Object.defineProperty(exports,"inchesToTwips",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs._a}});Object.defineProperty(exports,"isStaleImageInteractionCommit",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.V}});Object.defineProperty(exports,"isTableChromeSlot",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs._}});Object.defineProperty(exports,"layoutPointsToCssPixels",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Qa}});Object.defineProperty(exports,"loadFonts",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.h}});Object.defineProperty(exports,"lowerColorValueForBorder",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.z}});Object.defineProperty(exports,"lowerColorValueForFill",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.A}});Object.defineProperty(exports,"mixedFieldsOf",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.eb}});Object.defineProperty(exports,"mountPaginatedSurface",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Fa}});Object.defineProperty(exports,"overlayFrameToSheetCssPixels",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Sa}});Object.defineProperty(exports,"overlayHostOrigin",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Ta}});Object.defineProperty(exports,"partOfNodeId",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.g}});Object.defineProperty(exports,"pointsToEmu",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.R}});Object.defineProperty(exports,"probeTableChromeCommand",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.ea}});Object.defineProperty(exports,"resizePreservesAspect",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Ua}});Object.defineProperty(exports,"resolveColorValueToCss",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.B}});Object.defineProperty(exports,"resolveThemeColorHex",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.y}});Object.defineProperty(exports,"resolveZoomMode",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Ka}});Object.defineProperty(exports,"rulerPageBox",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.n}});Object.defineProperty(exports,"runSave",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.ra}});Object.defineProperty(exports,"runTableChromeCommand",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.pa}});Object.defineProperty(exports,"runTableCommand",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.ta}});Object.defineProperty(exports,"runToolbarCommand",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.qa}});Object.defineProperty(exports,"sameTabStops",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.fb}});Object.defineProperty(exports,"sameZoomMode",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.La}});Object.defineProperty(exports,"seedFields",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.cb}});Object.defineProperty(exports,"selectedDrawingOverlayTargetOf",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Q}});Object.defineProperty(exports,"selectedImageStateOf",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.J}});Object.defineProperty(exports,"signedFirstLineOf",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.bb}});Object.defineProperty(exports,"snapTwips",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.t}});Object.defineProperty(exports,"sourceCropFromCropPercent",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.D}});Object.defineProperty(exports,"specialOf",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.ab}});Object.defineProperty(exports,"surfaceExtent",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Da}});Object.defineProperty(exports,"surfacePaintScale",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Pa}});Object.defineProperty(exports,"tableChromeIconPaths",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.ga}});Object.defineProperty(exports,"tableChromeLabelKeyForTarget",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.fa}});Object.defineProperty(exports,"tableChromeToolbarState",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.la}});Object.defineProperty(exports,"tableChromeVisible",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.$}});Object.defineProperty(exports,"tableCommandState",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.W}});Object.defineProperty(exports,"tableCommandToolbarState",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.sa}});Object.defineProperty(exports,"toEditorFontError",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.a}});Object.defineProperty(exports,"toolbarCommandState",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.ma}});Object.defineProperty(exports,"toolbarCommandStates",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.oa}});Object.defineProperty(exports,"trapTabWithin",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.ib}});Object.defineProperty(exports,"twipsToInches",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.Ya}});Object.defineProperty(exports,"validateImageCropPercent",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.I}});Object.defineProperty(exports,"validateThemeModifier",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.v}});Object.defineProperty(exports,"withTabStop",{enumerable:true,get:function(){return chunkOWUSDS3L_cjs.hb}});Object.defineProperty(exports,"resolveEditorModules",{enumerable:true,get:function(){return chunkZKWRCLT2_cjs.a}});Object.defineProperty(exports,"FONT_RESOLVER_BRAND",{enumerable:true,get:function(){return chunk7VO6BLKV_cjs.h}});Object.defineProperty(exports,"FONT_RESOLVER_MARK_KEY",{enumerable:true,get:function(){return chunk7VO6BLKV_cjs.g}});Object.defineProperty(exports,"MAX_RESOLVER_FAMILIES",{enumerable:true,get:function(){return chunk7VO6BLKV_cjs.c}});Object.defineProperty(exports,"WORD_DEFAULT_FONT",{enumerable:true,get:function(){return chunk7VO6BLKV_cjs.d}});Object.defineProperty(exports,"composeFontConfiguration",{enumerable:true,get:function(){return chunk7VO6BLKV_cjs.e}});Object.defineProperty(exports,"composeFontOrigins",{enumerable:true,get:function(){return chunk7VO6BLKV_cjs.k}});Object.defineProperty(exports,"defineFontResolver",{enumerable:true,get:function(){return chunk7VO6BLKV_cjs.i}});Object.defineProperty(exports,"isFontResolver",{enumerable:true,get:function(){return chunk7VO6BLKV_cjs.j}});Object.defineProperty(exports,"disposeLayoutShaping",{enumerable:true,get:function(){return chunkJWHXOJEU_cjs.I}});Object.defineProperty(exports,"DEFAULT_IMAGE_RESOURCE_LIMITS",{enumerable:true,get:function(){return chunkFBWBSHC4_cjs.m}});Object.defineProperty(exports,"DRAWING_REL_FROM_H",{enumerable:true,get:function(){return chunkFBWBSHC4_cjs.Th}});Object.defineProperty(exports,"DRAWING_REL_FROM_V",{enumerable:true,get:function(){return chunkFBWBSHC4_cjs.Uh}});Object.defineProperty(exports,"IMAGE_WRAP_TARGETS",{enumerable:true,get:function(){return chunkFBWBSHC4_cjs.cb}});Object.defineProperty(exports,"TEXT_FORM_FORMATS",{enumerable:true,get:function(){return chunkFBWBSHC4_cjs.bh}});Object.defineProperty(exports,"positionInputFromPropertiesCommand",{enumerable:true,get:function(){return chunkFBWBSHC4_cjs.Wh}});Object.defineProperty(exports,"propertiesCommandHasPositionFields",{enumerable:true,get:function(){return chunkFBWBSHC4_cjs.Vh}});Object.defineProperty(exports,"resolveImageResourceLimits",{enumerable:true,get:function(){return chunkFBWBSHC4_cjs.n}});Object.defineProperty(exports,"resolveSvgIntrinsicSize",{enumerable:true,get:function(){return chunkFBWBSHC4_cjs.xb}});Object.defineProperty(exports,"sniffImageMime",{enumerable:true,get:function(){return chunkFBWBSHC4_cjs.tb}});Object.defineProperty(exports,"validateDrawingPositionInput",{enumerable:true,get:function(){return chunkFBWBSHC4_cjs.Sh}});Object.defineProperty(exports,"validateRasterHeader",{enumerable:true,get:function(){return chunkFBWBSHC4_cjs.yb}});Object.defineProperty(exports,"validateSetImagePositionCommand",{enumerable:true,get:function(){return chunkFBWBSHC4_cjs.Xh}});
package/dist/editor.js CHANGED
@@ -1 +1 @@
1
- export{Ia as AUTO_ZOOM_MODE,Na as BROWSER_AUTOMATION_CAPABILITIES,va as CHROME_GROUPS,za as CHROME_MENUS,Ca as CHROME_UNAVAILABLE_KEY,X as DEFAULT_TABLE_CHROME_DRAFT,P as EMU_PER_POINT,Ja as FIT_WIDTH_ZOOM_MODE,N as IMAGE_OVERLAY_NUDGE_PT,O as IMAGE_OVERLAY_NUDGE_SHIFT_PT,c as LOADING_SNAPSHOT,db as NO_MIXED_FIELDS,l as PX_PER_CM,k as PX_PER_INCH,r as SNAP_TWIPS_CM,q as SNAP_TWIPS_INCH,ba as TABLE_BORDER_STYLE_OPTIONS,aa as TABLE_BORDER_TARGET_OPTIONS,ca as TABLE_BORDER_WIDTH_OPTIONS,Y as TABLE_CHROME_SLOT_IDS,$a as TAB_ALIGNMENT_LABELS,p as TWIPS_PER_CM,o as TWIPS_PER_INCH,Ha as ZOOM_MAX,Ga as ZOOM_MIN,da as applyTableChromePick,x as applyThemeShade,w as applyThemeTint,d as blankDocumentBytes,L as canExecuteImageCommand,K as captureImageMutationPreconditions,gb as changedFields,Ba as chromeControlCount,Aa as chromeMenuSlots,ha as chromeProbeForSlot,wa as chromeSlotId,na as chromeSlotIsToggle,f as clipboardDropLandsText,e as clipboardPasteLandsContent,ia as commandForSlot,ka as commandForSlotValue,ja as commandForTableChromeSlotValue,Va as computeImageResizeResult,U as computeMovedImagePosition,T as computeResizedImageExtentEmu,Oa as createBrowserAutomationHost,Ma as createDocxEditor,i as createFontSource,Wa as createImageOverlayScrollPort,b as createLayoutShaping,H as cropPercentFromCropPermille,F as cropPercentFromPermille,C as cropPercentFromSourceCrop,G as cropPermilleFromCropPercent,E as cropPermilleFromPercent,Ra as cssPixelsToLayoutPoints,j as customFonts,xa as defaultChromeGroups,Z as defaultTableLabel,u as dragIndent,ua as editorCommandKey,S as emuToOverlayPoints,Ea as equationAtPosition,M as executeImageCommand,Xa as finalizeImageOverlayInteraction,Za as formatInches,ya as formattingBarChromeGroups,m as generateRulerTicks,s as handlePosition,_a as inchesToTwips,V as isStaleImageInteractionCommit,_ as isTableChromeSlot,Qa as layoutPointsToCssPixels,h as loadFonts,z as lowerColorValueForBorder,A as lowerColorValueForFill,eb as mixedFieldsOf,Fa as mountPaginatedSurface,Sa as overlayFrameToSheetCssPixels,Ta as overlayHostOrigin,g as partOfNodeId,R as pointsToEmu,ea as probeTableChromeCommand,Ua as resizePreservesAspect,B as resolveColorValueToCss,y as resolveThemeColorHex,Ka as resolveZoomMode,n as rulerPageBox,ra as runSave,pa as runTableChromeCommand,ta as runTableCommand,qa as runToolbarCommand,fb as sameTabStops,La as sameZoomMode,cb as seedFields,Q as selectedDrawingOverlayTargetOf,J as selectedImageStateOf,bb as signedFirstLineOf,t as snapTwips,D as sourceCropFromCropPercent,ab as specialOf,Da as surfaceExtent,Pa as surfacePaintScale,ga as tableChromeIconPaths,fa as tableChromeLabelKeyForTarget,la as tableChromeToolbarState,$ as tableChromeVisible,W as tableCommandState,sa as tableCommandToolbarState,a as toEditorFontError,ma as toolbarCommandState,oa as toolbarCommandStates,ib as trapTabWithin,Ya as twipsToInches,I as validateImageCropPercent,v as validateThemeModifier,hb as withTabStop}from'./chunk-QBMAXYN7.js';export{a as resolveEditorModules}from'./chunk-D5EHDHYV.js';import'./chunk-2ZEU42EA.js';export{h as FONT_RESOLVER_BRAND,g as FONT_RESOLVER_MARK_KEY,c as MAX_RESOLVER_FAMILIES,d as WORD_DEFAULT_FONT,e as composeFontConfiguration,k as composeFontOrigins,i as defineFontResolver,j as isFontResolver}from'./chunk-OODFC5R2.js';export{H as disposeLayoutShaping}from'./chunk-DQS4KZUX.js';import'./chunk-RIYSCEFQ.js';import'./chunk-P6VGDI57.js';import'./chunk-MSIFK7TJ.js';import'./chunk-72BDQFHY.js';import'./chunk-BEOPUDAB.js';import'./chunk-4DB7ZFQN.js';import'./chunk-THCGTV53.js';import'./chunk-VP7SDFCM.js';import'./chunk-4KMSEFIG.js';import'./chunk-6JIJOZDW.js';import'./chunk-ZMM5RNM6.js';export{m as DEFAULT_IMAGE_RESOURCE_LIMITS,Sh as DRAWING_REL_FROM_H,Th as DRAWING_REL_FROM_V,cb as IMAGE_WRAP_TARGETS,ah as TEXT_FORM_FORMATS,Vh as positionInputFromPropertiesCommand,Uh as propertiesCommandHasPositionFields,n as resolveImageResourceLimits,xb as resolveSvgIntrinsicSize,tb as sniffImageMime,Rh as validateDrawingPositionInput,yb as validateRasterHeader,Wh as validateSetImagePositionCommand}from'./chunk-CJCFEXTA.js';import'./chunk-GOEBQ26R.js';
1
+ export{Ia as AUTO_ZOOM_MODE,Na as BROWSER_AUTOMATION_CAPABILITIES,va as CHROME_GROUPS,za as CHROME_MENUS,Ca as CHROME_UNAVAILABLE_KEY,X as DEFAULT_TABLE_CHROME_DRAFT,P as EMU_PER_POINT,Ja as FIT_WIDTH_ZOOM_MODE,N as IMAGE_OVERLAY_NUDGE_PT,O as IMAGE_OVERLAY_NUDGE_SHIFT_PT,c as LOADING_SNAPSHOT,db as NO_MIXED_FIELDS,l as PX_PER_CM,k as PX_PER_INCH,r as SNAP_TWIPS_CM,q as SNAP_TWIPS_INCH,ba as TABLE_BORDER_STYLE_OPTIONS,aa as TABLE_BORDER_TARGET_OPTIONS,ca as TABLE_BORDER_WIDTH_OPTIONS,Y as TABLE_CHROME_SLOT_IDS,$a as TAB_ALIGNMENT_LABELS,p as TWIPS_PER_CM,o as TWIPS_PER_INCH,Ha as ZOOM_MAX,Ga as ZOOM_MIN,da as applyTableChromePick,x as applyThemeShade,w as applyThemeTint,d as blankDocumentBytes,L as canExecuteImageCommand,K as captureImageMutationPreconditions,gb as changedFields,Ba as chromeControlCount,Aa as chromeMenuSlots,ha as chromeProbeForSlot,wa as chromeSlotId,na as chromeSlotIsToggle,f as clipboardDropLandsText,e as clipboardPasteLandsContent,ia as commandForSlot,ka as commandForSlotValue,ja as commandForTableChromeSlotValue,Va as computeImageResizeResult,U as computeMovedImagePosition,T as computeResizedImageExtentEmu,Oa as createBrowserAutomationHost,Ma as createDocxEditor,i as createFontSource,Wa as createImageOverlayScrollPort,b as createLayoutShaping,H as cropPercentFromCropPermille,F as cropPercentFromPermille,C as cropPercentFromSourceCrop,G as cropPermilleFromCropPercent,E as cropPermilleFromPercent,Ra as cssPixelsToLayoutPoints,j as customFonts,xa as defaultChromeGroups,Z as defaultTableLabel,u as dragIndent,ua as editorCommandKey,S as emuToOverlayPoints,Ea as equationAtPosition,M as executeImageCommand,Xa as finalizeImageOverlayInteraction,Za as formatInches,ya as formattingBarChromeGroups,m as generateRulerTicks,s as handlePosition,_a as inchesToTwips,V as isStaleImageInteractionCommit,_ as isTableChromeSlot,Qa as layoutPointsToCssPixels,h as loadFonts,z as lowerColorValueForBorder,A as lowerColorValueForFill,eb as mixedFieldsOf,Fa as mountPaginatedSurface,Sa as overlayFrameToSheetCssPixels,Ta as overlayHostOrigin,g as partOfNodeId,R as pointsToEmu,ea as probeTableChromeCommand,Ua as resizePreservesAspect,B as resolveColorValueToCss,y as resolveThemeColorHex,Ka as resolveZoomMode,n as rulerPageBox,ra as runSave,pa as runTableChromeCommand,ta as runTableCommand,qa as runToolbarCommand,fb as sameTabStops,La as sameZoomMode,cb as seedFields,Q as selectedDrawingOverlayTargetOf,J as selectedImageStateOf,bb as signedFirstLineOf,t as snapTwips,D as sourceCropFromCropPercent,ab as specialOf,Da as surfaceExtent,Pa as surfacePaintScale,ga as tableChromeIconPaths,fa as tableChromeLabelKeyForTarget,la as tableChromeToolbarState,$ as tableChromeVisible,W as tableCommandState,sa as tableCommandToolbarState,a as toEditorFontError,ma as toolbarCommandState,oa as toolbarCommandStates,ib as trapTabWithin,Ya as twipsToInches,I as validateImageCropPercent,v as validateThemeModifier,hb as withTabStop}from'./chunk-IXGUCLER.js';export{a as resolveEditorModules}from'./chunk-D5EHDHYV.js';import'./chunk-TSDGKNV7.js';export{h as FONT_RESOLVER_BRAND,g as FONT_RESOLVER_MARK_KEY,c as MAX_RESOLVER_FAMILIES,d as WORD_DEFAULT_FONT,e as composeFontConfiguration,k as composeFontOrigins,i as defineFontResolver,j as isFontResolver}from'./chunk-BUNY5MRX.js';export{H as disposeLayoutShaping}from'./chunk-ZUGTEKLM.js';import'./chunk-RIYSCEFQ.js';import'./chunk-6ESSCMXL.js';import'./chunk-AKQRKR2H.js';import'./chunk-TUCDPXBD.js';import'./chunk-BJQDNKEX.js';import'./chunk-2QU7QTM7.js';import'./chunk-UOE4WKL7.js';import'./chunk-VP7SDFCM.js';import'./chunk-NLGUL6QL.js';import'./chunk-6JIJOZDW.js';import'./chunk-3SU7UWCR.js';export{m as DEFAULT_IMAGE_RESOURCE_LIMITS,Th as DRAWING_REL_FROM_H,Uh as DRAWING_REL_FROM_V,cb as IMAGE_WRAP_TARGETS,bh as TEXT_FORM_FORMATS,Wh as positionInputFromPropertiesCommand,Vh as propertiesCommandHasPositionFields,n as resolveImageResourceLimits,xb as resolveSvgIntrinsicSize,tb as sniffImageMime,Sh as validateDrawingPositionInput,yb as validateRasterHeader,Xh as validateSetImagePositionCommand}from'./chunk-IA7WTZHI.js';import'./chunk-GOEBQ26R.js';
package/dist/export.cjs CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkKDYD5TAW_cjs=require('./chunk-KDYD5TAW.cjs'),chunkNJONXJJY_cjs=require('./chunk-NJONXJJY.cjs'),chunkZKQX2PNF_cjs=require('./chunk-ZKQX2PNF.cjs'),chunkLQ6XWTKQ_cjs=require('./chunk-LQ6XWTKQ.cjs'),chunkCG7CP632_cjs=require('./chunk-CG7CP632.cjs');require('./chunk-FGBADUSK.cjs');var chunkMDP5SNK4_cjs=require('./chunk-MDP5SNK4.cjs'),chunk77DD4EBC_cjs=require('./chunk-77DD4EBC.cjs');var B=chunkNJONXJJY_cjs.b;function q(e){return typeof e.admittedFontFace=="function"}var yt=Object.freeze([{weight:400,style:"normal"},{weight:700,style:"normal"},{weight:400,style:"italic"},{weight:700,style:"italic"}]);function P(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}function j(e){let o=e.substitution;return Object.freeze({id:e.id,identity:e.identity,family:e.family,request:P(e.request),byteLength:e.byteLength,hash:e.hash,faceIndex:e.faceIndex,substitution:o?Object.freeze({requested:P(o.requested),resolved:P(o.resolved),...o.lineMetrics?{lineMetrics:Object.freeze({...o.lineMetrics})}:{}}):null})}function ht(e){return Object.freeze({...j(e),bytes:chunkNJONXJJY_cjs.h(e)})}function Ft(e,o){if(!e)return null;try{let t=e(o);return !t||t instanceof chunkNJONXJJY_cjs.d?null:ht(t)}catch{return null}}function Ge(e){return o=>{if(e.status()!=="active")throw e.unavailable();return Ft(e.resolve(),o)}}function xt(e){return Object.freeze(e.slice(0,B).map(o=>Object.freeze({request:P(o.request),partName:o.partName,reason:o.reason})))}function z(e,o,t,n,r=[]){let i=new Map;for(let l of [...e,o]){let u=l.toLowerCase();i.has(u)||i.set(u,l);}let a=[...i.values()].map(l=>{let u=[];for(let c of yt){let s=n?.({family:l,...c});!s||s instanceof chunkNJONXJJY_cjs.d||u.push(Object.freeze({...c,sourceFamily:s.family,via:s.substitution?"substitution":"direct",identity:s.identity,id:s.id,hash:s.hash,faceIndex:s.faceIndex,substitution:s.substitution}));}return Object.freeze({family:l,coverage:u.length===4?"complete":u.length>0?"partial":"none",faces:Object.freeze(u)})});return Object.freeze({requestedFamilies:Object.freeze([...e]),defaultFamily:o,families:Object.freeze(a),originFailures:Object.freeze([...t]),droppedEmbeddedFonts:xt(r)})}function V(e,o){if(o.onFontResolution){try{let t=o.onFontResolution(e);Promise.resolve(t).catch(n=>{console.warn("[fonts] font-resolution diagnostics callback failed",n);});}catch(t){console.warn("[fonts] font-resolution diagnostics callback failed",t);}return}for(let t of e.originFailures)console.warn("[fonts] a document export font origin failed and was skipped",t);for(let t of e.droppedEmbeddedFonts??[])console.warn("[fonts] a document embedded font face was dropped during export",t);}function H(e,o){if(o.fontPolicy!=="strict"||e.originFailures.length===0&&e.families.every(n=>n.coverage==="complete"))return;let t=e.families.filter(n=>n.coverage!=="complete").map(n=>n.family).join(", ");throw new chunkZKQX2PNF_cjs.d("layoutFailed",`Strict font policy refused export${t?`; incomplete families: ${t}`:"; a font origin failed"}`)}function N(){return new Map}function G(e,o,t,n){if(t.trim().length===0)return null;let r={family:t,weight:n.bold?700:400,style:n.italic?"italic":"normal"},i=chunkNJONXJJY_cjs.g(r),a=o.get(i);if(!a){try{a=e.fonts.resolve(r);}catch{return null}o.set(i,a);}return a instanceof chunkNJONXJJY_cjs.d?null:a}function Xe(e,o,t){let n=t.fontFamily??e.defaultFont.family;return G(e,o,n,t)}function X(e){return typeof e.shapeLaidOutText=="function"}function W(e){let o=N(),t=new WeakMap;return n=>{let r=chunkLQ6XWTKQ_cjs.z(n.style,n.fontSlot),i=chunkLQ6XWTKQ_cjs.j(n.text,r);if(i.length===0)return null;let a=r.fontFamily??e.defaultFont.family,l=G(e,o,a,r);if(!l)return null;try{if(r.smallCaps&&!chunkNJONXJJY_cjs.na(e.shaper,e.environment,l,r,t))return null;let u=chunkNJONXJJY_cjs.ma(e.shaper,e.environment,l,r,i);return Object.freeze({run:u,font:j(l),fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function We(e){return o=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(o)??null}}var A=new Map,I=new WeakMap,$=0,T,Y=32,$e=chunkNJONXJJY_cjs.c;function Ye(){if(T)return T;let e=(async()=>(await chunkNJONXJJY_cjs.s(),chunkNJONXJJY_cjs.x(chunkNJONXJJY_cjs.y)))();return T=e,e.catch(()=>{T===e&&(T=void 0);}),e}function Ke(e){let o=N();return chunkNJONXJJY_cjs.pa(e,{resolveFont(t){return Xe(e,o,t)},fallback:chunkLQ6XWTKQ_cjs.b()})}async function Ze(e,o){if(!chunkNJONXJJY_cjs.A(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let t=await Ye(),n=await chunkNJONXJJY_cjs.H(e,t,chunkNJONXJJY_cjs.y,o);return Object.freeze({createMeasurer:()=>Ke(n),resolveFont:r=>n.fonts.resolve(r),shapeLaidOutText:W(n),producer:["node-export-session",e.fingerprint,n.operation.shapingHash,`producer:${n.operation.producerVersion}`,`fallback:${chunkLQ6XWTKQ_cjs.a}`].join("|"),extensionFingerprint:e.fingerprint})}function gt(e,o){if(!chunkNJONXJJY_cjs.A(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let t=I.get(e);if(t)return t;let n=chunkNJONXJJY_cjs.C(e),r=A.get(n);if(!r){if(A.size>=Y)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${Y} process-wide configurations`));r=(async()=>{let u=chunkNJONXJJY_cjs.B(e).sources.reduce((s,p)=>s+(p.availability==="forbidden"?0:p.bytes.byteLength),0);if($+u>$e)throw new RangeError(`Shared exporter shaping font bytes are limited to ${$e} process-wide`);$+=u;let c;try{let s=await Ye();c=await chunkNJONXJJY_cjs.H(e,s,chunkNJONXJJY_cjs.y,o);}catch(s){throw $-=u,s}return Object.freeze({createMeasurer:()=>Ke(c),shapeLaidOutText:W(c),shapingHash:c.operation.shapingHash,producerVersion:c.operation.producerVersion})})(),A.set(n,r),r.catch(()=>{A.get(n)===r&&A.delete(n);});}let i=e.fingerprint,a=r.then(l=>Object.freeze({createMeasurer:l.createMeasurer,shapeLaidOutText:l.shapeLaidOutText,producer:["node-export",i,l.shapingHash,`producer:${l.producerVersion}`,`fallback:${chunkLQ6XWTKQ_cjs.a}`].join("|"),extensionFingerprint:i}));return I.set(e,a),a.catch(()=>{I.get(e)===a&&I.delete(e);}),a}var Et="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function bt(e){let o=e.currentPackage(),t=(o.relationships.get(o.mainDocumentPart)??[]).find(r=>r.type===Et),n;if(t){let r=chunk77DD4EBC_cjs.E(t);r.mode==="Internal"&&r.target.ok&&(n=o.parts.get(r.target.partName));}return n??=o.parts.get("/word/fontTable.xml"),chunk77DD4EBC_cjs.Sd(o,n)}function Qe(e,o){let t=bt(e);if(t.length!==0)return chunkKDYD5TAW_cjs.i(n=>{let r=new Set((n.resolvedFaces??[]).map(a=>chunkNJONXJJY_cjs.g(a))),i=chunkKDYD5TAW_cjs.o(t,{maxFontBytes:chunkNJONXJJY_cjs.a,aggregateBudget:Rt(n),shadowedRequests:r});if(o)for(let a of i.dropped){if(o.dropped.length>=B)break;o.dropped.push(a);}return {sources:i.sources}})}function Rt(e){let o=e.committedSourceBytes;return o===void 0||!Number.isSafeInteger(o)||o<=0?chunkNJONXJJY_cjs.c:Math.max(0,chunkNJONXJJY_cjs.c-o)}function Ot(e){return q(e)&&X(e)}var R=0,Je=Symbol("font-resolution-timeout");function St(e){let o=0,t=false;return e?.(R),{reserve:r=>{if(t)throw new Error("Document font-byte lease is already released");if(R+r>chunkNJONXJJY_cjs.c)throw new chunkZKQX2PNF_cjs.d("layoutFailed",`Active document export font bytes are limited to ${chunkNJONXJJY_cjs.c}; requested ${r} bytes with ${R} bytes already active`);R+=r,o+=r,e?.(R);let i=false;return ()=>{i||t||(i=true,R-=r,o-=r,e?.(R));}},release:()=>{t||(t=true,R-=o,o=0,e?.(R));}}}function Z(e,o){return e.attributes.find(t=>t.localName===o)?.value}function wt(e,o){return e.attributes.find(t=>t.localName===o&&(t.namespaceUri===chunk77DD4EBC_cjs.da||t.namespaceUri===""))?.value}async function vt(e,o){if(o.reuseAcrossRevisions===true)throw new TypeError("reuseAcrossRevisions requires a live view or caller-supplied measurer; document-aware byte sessions are immutable");if(o.signal?.aborted)return {ok:false,reason:"aborted"};let t=chunkMDP5SNK4_cjs.Za(e);if(!t.ok)return t;let{fonts:n,fontResolutionTimeoutMs:r,fontPolicy:i,onFontResolution:a,...l}=o,u=Array.isArray(n)?n:[n],c,s;try{s=await At(t.view,u,{signal:o.signal,timeoutMs:r??o.resourceTimeoutMs,fontPolicy:i,onFontResolution:y=>(c=y,a?.(y))});}catch(y){if(y instanceof chunkZKQX2PNF_cjs.d&&y.code==="aborted")return {ok:false,reason:"aborted"};throw y}if(!c)throw s?.dispose(),new chunkZKQX2PNF_cjs.d("layoutFailed","Document font resolution completed without publishing its evidence");let p;try{p=chunkZKQX2PNF_cjs.e(t.view,{...l,reuseAcrossRevisions:!1,...s?{measurer:s.createMeasurer(),producer:o.producer??s.producer}:o.producer?{producer:o.producer}:{}});}catch(y){throw s?.dispose(),y}if(!p.ok)return s?.dispose(),p;let d=p.session,m=s,f="active",x=()=>f==="aborted"?new chunkZKQX2PNF_cjs.d("aborted","Export resource settlement was aborted"):new chunkZKQX2PNF_cjs.d("disposed","Export session has been disposed"),F=y=>{if(f==="active"){f=y,o.signal?.removeEventListener("abort",h);try{d.dispose();}finally{m?.dispose(),m=void 0;}}},h=()=>F("aborted");return o.signal?.addEventListener("abort",h,{once:true}),o.signal?.aborted&&h(),{ok:true,session:Object.freeze({fontResolution:c,layout:()=>f==="active"?d.layout():Promise.reject(x()),layoutFor:y=>f==="active"?d.layoutFor(y):Promise.reject(x()),validatedImageBytes:y=>f==="active"?d.validatedImageBytes(y):null,admittedFontFace:Ge({status:()=>f,unavailable:x,resolve:()=>m?.resolveFont}),shapeLaidOutText:We({status:()=>f,unavailable:x,shaping:()=>m}),dispose:()=>F("disposed")})}}async function At(e,o,t={}){let n=Tt(t.timeoutMs),r=new AbortController,i=()=>r.abort(t.signal?.reason);t.signal?.addEventListener("abort",i,{once:true}),t.signal?.aborted&&i();let a=setTimeout(()=>r.abort(Je),n);try{K(r.signal);let l=(async()=>{let u=St(t.onActiveFontBytesChange),c=!1;try{let s=Dt(e).slice(0,chunkKDYD5TAW_cjs.c),p=[],d={dropped:[]},m=Qe(e,d),f=m?[...o,m]:o,x=await chunkKDYD5TAW_cjs.l(f,{families:s,defaultFamily:chunkKDYD5TAW_cjs.d.family,signal:r.signal},{onOriginFailure:E=>p.push(E),reserveOwnedBytes:u.reserve});K(r.signal);let F=chunkKDYD5TAW_cjs.e(x??{});if(F.sources.length===0){let E=z(s,F.defaultFont.family,p,void 0,d.dropped);V(E,t),H(E,t);return}let h=await Ze(chunkNJONXJJY_cjs.E(F));K(r.signal);let y=z(s,F.defaultFont.family,p,h.resolveFont,d.dropped);return V(y,t),H(y,t),c=!0,Object.freeze({...h,dispose:u.release})}finally{c||u.release();}})();return await Promise.race([l,Lt(r.signal)])}finally{clearTimeout(a),t.signal?.removeEventListener("abort",i);}}function Tt(e){if(e===void 0)return 6e4;if(!Number.isFinite(e)||e<=0)throw new RangeError("timeoutMs must be a positive finite number");return Math.max(1,e)}function Lt(e){return new Promise((o,t)=>{let n=()=>{t(et(e));};e.aborted?n():e.addEventListener("abort",n,{once:true});})}function et(e){let o=e.reason===Je;return new chunkZKQX2PNF_cjs.d(o?"timedOut":"aborted",o?"Font resolution timed out":"Font resolution was aborted",o?void 0:{cause:e.reason})}function K(e){if(e.aborted)throw et(e)}function Dt(e){let o=[e.part().root],t=[],n=[],r=new Set([e.part().name]),i=(s,p)=>{!p||r.has(p.name)||(r.add(p.name),s.push(p.root));};for(let s of e.headerFooterPartsBySection()){for(let p of s.headers.values())i(t,p);for(let p of s.footers.values())i(t,p);}for(let s of ["footnote","endnote"])n.push(...Pt(e,s));let a=e.documentThemeFonts(),l={...a,major:a.major,minor:a.minor,majorEastAsia:a.majorEastAsia??null,minorEastAsia:a.minorEastAsia??null},u=new Map,c=(s,p)=>{let d=chunkCG7CP632_cjs.d(s,e.stylesRoot(),l,It(s,p)),m=chunkKDYD5TAW_cjs.v(s,e.numberingRoot(),e.stylesRoot(),l);for(let f of [...d.direct,...Ut(s),...m,...chunkKDYD5TAW_cjs.s(s,e.stylesRoot(),l),...d.inherited]){let x=f.toLowerCase();u.has(x)||u.set(x,f);}};return c(o,"body"),c(t,"furniture"),c(n,"note"),[...u.values()]}function Pt(e,o){let t=chunk77DD4EBC_cjs.Nf(e.currentPackage(),o);if(!t)return [];let n=new Set(chunk77DD4EBC_cjs.Of(e.part()).filter(i=>i.noteKind===o).map(i=>i.noteId)),r=[];for(let i of t.root.children){if(i.kind==="textValue")continue;let a=chunk77DD4EBC_cjs.id(i),l=chunk77DD4EBC_cjs.hd(i);(a==="separator"||a==="continuationSeparator"||l!==null&&n.has(l))&&r.push(i);}return r}var Nt="http://schemas.openxmlformats.org/officeDocument/2006/math";function It(e,o){let t=new Set;for(let n of e){let r=[],i=[{node:n,context:o}];for(;i.length>0;){let{node:a,context:l}=i.pop();a.namespaceUri===chunk77DD4EBC_cjs.da&&a.localName==="p"&&r.push({paragraph:a,context:l});let u=a.namespaceUri===chunk77DD4EBC_cjs.da&&a.localName==="txbxContent"&&(l==="body"||l==="note")?"detached":l;for(let c=a.children.length-1;c>=0;c-=1){let s=a.children[c];s.kind!=="textValue"&&i.push({node:s,context:u});}}for(let a of r)_t(a.paragraph,t,a.context);}return t}function _t(e,o,t){let n=chunkLQ6XWTKQ_cjs.X(),r=null,i=null,a="",l=false,u=false,c=false,s=0,p=[];for(let d=e.children.length-1;d>=0;d-=1){let m=e.children[d];m.kind!=="textValue"&&p.push({node:m,runId:null,visibility:S,containerDepth:0});}for(;p.length>0;){let{node:d,runId:m,visibility:f,containerDepth:x}=p.pop();if(x>=chunk77DD4EBC_cjs.la||d.namespaceUri===chunk77DD4EBC_cjs.da&&d.localName==="p")continue;let F=d.namespaceUri===chunk77DD4EBC_cjs.da&&d.localName==="r"?d.id:m;if(d.namespaceUri===chunk77DD4EBC_cjs.da&&d.localName==="fldSimple"){let h=Z(d,"instr")??"";chunkLQ6XWTKQ_cjs.lc(h,{allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&kt(d)!==S&&o.add(d.id);}if(d.namespaceUri===chunk77DD4EBC_cjs.da&&d.localName==="fldChar"){let h=Z(d,"fldCharType");if(h==="begin")chunkLQ6XWTKQ_cjs._(n),n.nesting===1&&(r=F,i=null,a="",l=false,u=false,c=chunk77DD4EBC_cjs.ke(d),s=0);else if(h==="separate"){let y=n.nesting===1;if(chunkLQ6XWTKQ_cjs.aa(n),y){let E=chunkLQ6XWTKQ_cjs.Z(n);a=E.instruction,l=E.overflow||n.nestingOverflow,i=F,u=true;}}else if(h==="end"){if(n.nesting===1){if(n.phase==="instruction"){let E=chunkLQ6XWTKQ_cjs.Z(n);a=E.instruction,l=E.overflow||n.nestingOverflow;}if(!l&&chunkLQ6XWTKQ_cjs.kc(a,{hasSeparate:u,hasLegacyFormData:c,allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&s!==S){let E=i??r;E&&o.add(E);}}chunkLQ6XWTKQ_cjs.ba(n);}continue}if(d.namespaceUri===chunk77DD4EBC_cjs.da&&(d.localName==="instrText"||d.localName==="delInstrText")){chunkLQ6XWTKQ_cjs.$(n,it(d),d.localName==="delInstrText");continue}n.nesting>0&&chunkLQ6XWTKQ_cjs.ca(n)&&d.namespaceUri===chunk77DD4EBC_cjs.da&&tt(d)&&(s|=f);for(let h=d.children.length-1;h>=0;h-=1){let y=d.children[h];y.kind!=="textValue"&&p.push({node:y,runId:F,visibility:f&rt(d),containerDepth:chunk77DD4EBC_cjs.ma(d,x)});}}chunkLQ6XWTKQ_cjs.Y(n);}function tt(e){return e.localName==="t"||e.localName==="delText"?it(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var Q=1,ot=2,nt=4,S=Q|ot|nt;function kt(e){let o=[];for(let n of e.children)n.kind!=="textValue"&&o.push({node:n,visibility:S});let t=0;for(;o.length>0;){let{node:n,visibility:r}=o.pop();if(!(n.namespaceUri===chunk77DD4EBC_cjs.da&&n.localName==="p")){if(n.namespaceUri===chunk77DD4EBC_cjs.da&&tt(n)&&(t|=r,t===S))return t;for(let i of n.children)i.kind!=="textValue"&&o.push({node:i,visibility:r&rt(n)});}}return t}function rt(e){return e.namespaceUri!==chunk77DD4EBC_cjs.da?S:e.localName==="ins"||e.localName==="moveTo"?Q|ot:e.localName==="del"||e.localName==="moveFrom"?Q|nt:S}function Ut(e){let o=new Map,t=n=>{let r=chunkCG7CP632_cjs.a(n??void 0);if(r===null)return;let i=r.toLowerCase();o.has(i)||o.set(i,r);};for(let n of e){let r=[n];for(;r.length>0;){let i=r.pop();if(i.namespaceUri===Nt&&t(chunkLQ6XWTKQ_cjs.Ab),i.namespaceUri===chunk77DD4EBC_cjs.da&&i.localName==="sym"&&t(chunkCG7CP632_cjs.b(wt(i,"font"))),i.namespaceUri===chunk77DD4EBC_cjs.da&&i.localName==="fldSimple"){let a=Z(i,"instr");t(chunkLQ6XWTKQ_cjs.jc(a??"")?.font??null);}if(i.namespaceUri===chunk77DD4EBC_cjs.da&&i.localName==="p")for(let a of chunkKDYD5TAW_cjs.u(i))t(a);for(let a=i.children.length-1;a>=0;a-=1){let l=i.children[a];l.kind!=="textValue"&&r.push(l);}}}return [...o.values()]}function it(e){let o="",t=[...e.children].reverse();for(;t.length>0&&o.length<=256;){let n=t.pop();if(n.kind==="textValue")o+=n.value;else for(let r=n.children.length-1;r>=0;r-=1)t.push(n.children[r]);}return o}var lt="FILE_TOO_LARGE",at=8;function Mt(e){return typeof e=="object"&&e!==null}function dt(e){if(!(!Mt(e)||typeof e.code!="string"))return e.code}function ut(e){return e===""||e.toLowerCase()==="localhost"}function Ct(e){try{let o=decodeURIComponent(e);return o.includes("\0")?null:o}catch{return null}}function ct(e){let o=Ct(e);if(o===null)return null;let t=[];for(let n of o.split(/[/\\]/))if(!(n===""||n===".")){if(n===".."){if(t.length===0)return null;t.pop();continue}t.push(n);}return `/${t.join("/")}`}function pt(e){let o=ct(e);return o===null?null:o.endsWith("/")?o:`${o}/`}function Bt(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function qt(e){let o;try{o=typeof e=="string"?new URL(e):new URL("href"in e?e.href:String(e));}catch{throw new TypeError("trustedRoot must be an absolute file: URL")}if(o.protocol!=="file:")throw new TypeError("trustedRoot must use the file: protocol");if(o.username!==""||o.password!=="")throw new TypeError("trustedRoot must not include credentials");if(!ut(o.host))throw new TypeError("trustedRoot must be a local file: URL");let t=pt(o.pathname);if(t===null||Bt(t))throw new TypeError("trustedRoot must be a directory inside the filesystem");let n=new URL("file:///");return n.pathname=t,n}function jt(e){if(typeof e=="string")return [e];if(typeof e=="object"&&e!==null&&"href"in e)return [e];if(Array.isArray(e))return e;throw new TypeError("trustedRoot must be an absolute file: URL")}function zt(e){let o=jt(e);if(o.length===0)throw new TypeError("trustedRoot must name at least one directory");if(o.length>at)throw new TypeError(`trustedRoot must not exceed ${at} directories`);return o.map(qt)}function Vt(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>chunkNJONXJJY_cjs.a)throw new TypeError(`maxBytes must not exceed ${chunkNJONXJJY_cjs.a}`);return e}function Ht(e,o){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!ut(e.host))return null;let t=ct(e.pathname);if(t===null)return null;for(let n of o){let r=pt(n.pathname);if(r===null||!t.startsWith(r)||t.length<=r.length)continue;let i=new URL("file:///");return i.pathname=t,i}return null}function Gt(e){return typeof e=="string"?new URL(e):"href"in e&&typeof e.href=="string"?new URL(e.href):new URL("url"in e?e.url:String(e))}function Xt(e,o,t){let n=t.relative(t.resolve(e),t.resolve(o));return n!==""&&!n.startsWith("..")&&!t.isAbsolute(n)}function st(e,o,t){return e.some(n=>Xt(n,o,t))}async function Wt(e,o){let t=[];for(let n of e)try{t.push(await o(n));}catch(r){if(dt(r)==="ENOENT")continue;throw r}return t}function $t(e){return async(o,{signal:t,maxBytes:n})=>{if(t?.aborted)throw t.reason;let[{open:r,realpath:i},{constants:a},{fileURLToPath:l},u]=await Promise.all([import('fs/promises'),import('fs'),import('url'),import('path')]),c=e.map(f=>u.resolve(l(f.href))),s=u.resolve(l(typeof o=="string"?o:o.href));if(!st(c,s,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let p=typeof a.O_NOFOLLOW=="number"?a.O_RDONLY|a.O_NOFOLLOW:"r",d=await r(s,p),m=()=>{d.close();};t?.addEventListener("abort",m,{once:true});try{if(t?.aborted)throw t.reason;let f=await i(s);if(!st(await Wt(c,i),f,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let x=(await d.stat()).size;if(!Number.isSafeInteger(x)||x<0||x>n)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:lt});let F=new Uint8Array(x),h=0;for(;h<F.byteLength;){if(t?.aborted)throw t.reason;let{bytesRead:y}=await d.read(F,h,F.byteLength-h,h);if(y===0)break;h+=y;}if(t?.aborted)throw t.reason;return h===F.byteLength?F:F.slice(0,h)}catch(f){throw t?.aborted?t.reason:f}finally{t?.removeEventListener("abort",m),await d.close().catch(()=>{});}}}function Yt(e){if(e===null||typeof e!="object")throw new TypeError("createPackagedFileFetch requires trustedRoot and maxBytes");if(e.trustedRoot===void 0||e.maxBytes===void 0)throw new TypeError("createPackagedFileFetch requires trustedRoot and maxBytes");let o=zt(e.trustedRoot),t=Vt(e.maxBytes),n=e.read??$t(o),r=e.networkFetch??fetch;return(async(i,a)=>{let l=a?.signal;if(l?.aborted)throw l.reason;let u=Gt(i);if(u.protocol!=="file:")return r(u,a);let c=Ht(u,o);if(!c)return new Response(null,{status:404});let s=l?new AbortController:void 0,p=()=>s?.abort(l?.reason);l?.addEventListener("abort",p,{once:true});let d;try{if(d=await n(c,{maxBytes:t,...s?{signal:s.signal}:{}}),l?.aborted)throw l.reason;if(d.byteLength>t)return new Response(null,{status:413})}catch(m){if(l?.aborted)throw l.reason;if(s?.signal.aborted)throw s.signal.reason??m;if(m instanceof DOMException&&m.name==="AbortError"||m instanceof Error&&m.name==="AbortError")throw m;let f=dt(m);if(f===lt)return new Response(null,{status:413});if(f==="ENOENT"||f==="ENOTDIR"||f==="ELOOP")return new Response(null,{status:404});throw m}finally{l?.removeEventListener("abort",p);}return new Response(d,{status:200})})}
2
- Object.defineProperty(exports,"ExportResourceError",{enumerable:true,get:function(){return chunkZKQX2PNF_cjs.d}});Object.defineProperty(exports,"createNodeImageDecodePort",{enumerable:true,get:function(){return chunkZKQX2PNF_cjs.c}});Object.defineProperty(exports,"exportDestinationNamed",{enumerable:true,get:function(){return chunkZKQX2PNF_cjs.b}});Object.defineProperty(exports,"openDocumentForExport",{enumerable:true,get:function(){return chunkZKQX2PNF_cjs.e}});exports.MAX_SHARED_EXPORT_SHAPING_CONFIGURATIONS=Y;exports.acquireSharedExportShaping=gt;exports.createPackagedFileFetch=Yt;exports.hasExportAdmittedFont=q;exports.hasExportLaidOutText=X;exports.hasFontBackedExportCapabilities=Ot;exports.openFontBackedDocumentForExport=vt;
1
+ 'use strict';var chunk7VO6BLKV_cjs=require('./chunk-7VO6BLKV.cjs'),chunkJWHXOJEU_cjs=require('./chunk-JWHXOJEU.cjs'),chunk5BI4SIHO_cjs=require('./chunk-5BI4SIHO.cjs'),chunkNDPLQG4Y_cjs=require('./chunk-NDPLQG4Y.cjs'),chunk76F73CY6_cjs=require('./chunk-76F73CY6.cjs');require('./chunk-FGBADUSK.cjs');var chunkVSCPFHTD_cjs=require('./chunk-VSCPFHTD.cjs'),chunkFBWBSHC4_cjs=require('./chunk-FBWBSHC4.cjs');var B=chunkJWHXOJEU_cjs.b;function q(e){return typeof e.admittedFontFace=="function"}var yt=Object.freeze([{weight:400,style:"normal"},{weight:700,style:"normal"},{weight:400,style:"italic"},{weight:700,style:"italic"}]);function P(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}function j(e){let o=e.substitution;return Object.freeze({id:e.id,identity:e.identity,family:e.family,request:P(e.request),byteLength:e.byteLength,hash:e.hash,faceIndex:e.faceIndex,substitution:o?Object.freeze({requested:P(o.requested),resolved:P(o.resolved),...o.lineMetrics?{lineMetrics:Object.freeze({...o.lineMetrics})}:{}}):null})}function ht(e){return Object.freeze({...j(e),bytes:chunkJWHXOJEU_cjs.h(e)})}function Ft(e,o){if(!e)return null;try{let t=e(o);return !t||t instanceof chunkJWHXOJEU_cjs.d?null:ht(t)}catch{return null}}function Ge(e){return o=>{if(e.status()!=="active")throw e.unavailable();return Ft(e.resolve(),o)}}function xt(e){return Object.freeze(e.slice(0,B).map(o=>Object.freeze({request:P(o.request),partName:o.partName,reason:o.reason})))}function z(e,o,t,n,r=[]){let i=new Map;for(let l of [...e,o]){let u=l.toLowerCase();i.has(u)||i.set(u,l);}let a=[...i.values()].map(l=>{let u=[];for(let c of yt){let s=n?.({family:l,...c});!s||s instanceof chunkJWHXOJEU_cjs.d||u.push(Object.freeze({...c,sourceFamily:s.family,via:s.substitution?"substitution":"direct",identity:s.identity,id:s.id,hash:s.hash,faceIndex:s.faceIndex,substitution:s.substitution}));}return Object.freeze({family:l,coverage:u.length===4?"complete":u.length>0?"partial":"none",faces:Object.freeze(u)})});return Object.freeze({requestedFamilies:Object.freeze([...e]),defaultFamily:o,families:Object.freeze(a),originFailures:Object.freeze([...t]),droppedEmbeddedFonts:xt(r)})}function V(e,o){if(o.onFontResolution){try{let t=o.onFontResolution(e);Promise.resolve(t).catch(n=>{console.warn("[fonts] font-resolution diagnostics callback failed",n);});}catch(t){console.warn("[fonts] font-resolution diagnostics callback failed",t);}return}for(let t of e.originFailures)console.warn("[fonts] a document export font origin failed and was skipped",t);for(let t of e.droppedEmbeddedFonts??[])console.warn("[fonts] a document embedded font face was dropped during export",t);}function H(e,o){if(o.fontPolicy!=="strict"||e.originFailures.length===0&&e.families.every(n=>n.coverage==="complete"))return;let t=e.families.filter(n=>n.coverage!=="complete").map(n=>n.family).join(", ");throw new chunk5BI4SIHO_cjs.d("layoutFailed",`Strict font policy refused export${t?`; incomplete families: ${t}`:"; a font origin failed"}`)}function N(){return new Map}function G(e,o,t,n){if(t.trim().length===0)return null;let r={family:t,weight:n.bold?700:400,style:n.italic?"italic":"normal"},i=chunkJWHXOJEU_cjs.g(r),a=o.get(i);if(!a){try{a=e.fonts.resolve(r);}catch{return null}o.set(i,a);}return a instanceof chunkJWHXOJEU_cjs.d?null:a}function Xe(e,o,t){let n=t.fontFamily??e.defaultFont.family;return G(e,o,n,t)}function X(e){return typeof e.shapeLaidOutText=="function"}function W(e){let o=N(),t=new WeakMap;return n=>{let r=chunkNDPLQG4Y_cjs.z(n.style,n.fontSlot),i=chunkNDPLQG4Y_cjs.j(n.text,r);if(i.length===0)return null;let a=r.fontFamily??e.defaultFont.family,l=G(e,o,a,r);if(!l)return null;try{if(r.smallCaps&&!chunkJWHXOJEU_cjs.na(e.shaper,e.environment,l,r,t))return null;let u=chunkJWHXOJEU_cjs.ma(e.shaper,e.environment,l,r,i);return Object.freeze({run:u,font:j(l),fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function We(e){return o=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(o)??null}}var A=new Map,I=new WeakMap,$=0,T,Y=32,$e=chunkJWHXOJEU_cjs.c;function Ye(){if(T)return T;let e=(async()=>(await chunkJWHXOJEU_cjs.s(),chunkJWHXOJEU_cjs.x(chunkJWHXOJEU_cjs.y)))();return T=e,e.catch(()=>{T===e&&(T=void 0);}),e}function Ke(e){let o=N();return chunkJWHXOJEU_cjs.pa(e,{resolveFont(t){return Xe(e,o,t)},fallback:chunkNDPLQG4Y_cjs.b()})}async function Ze(e,o){if(!chunkJWHXOJEU_cjs.A(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let t=await Ye(),n=await chunkJWHXOJEU_cjs.H(e,t,chunkJWHXOJEU_cjs.y,o);return Object.freeze({createMeasurer:()=>Ke(n),resolveFont:r=>n.fonts.resolve(r),shapeLaidOutText:W(n),producer:["node-export-session",e.fingerprint,n.operation.shapingHash,`producer:${n.operation.producerVersion}`,`fallback:${chunkNDPLQG4Y_cjs.a}`].join("|"),extensionFingerprint:e.fingerprint})}function gt(e,o){if(!chunkJWHXOJEU_cjs.A(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let t=I.get(e);if(t)return t;let n=chunkJWHXOJEU_cjs.C(e),r=A.get(n);if(!r){if(A.size>=Y)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${Y} process-wide configurations`));r=(async()=>{let u=chunkJWHXOJEU_cjs.B(e).sources.reduce((s,p)=>s+(p.availability==="forbidden"?0:p.bytes.byteLength),0);if($+u>$e)throw new RangeError(`Shared exporter shaping font bytes are limited to ${$e} process-wide`);$+=u;let c;try{let s=await Ye();c=await chunkJWHXOJEU_cjs.H(e,s,chunkJWHXOJEU_cjs.y,o);}catch(s){throw $-=u,s}return Object.freeze({createMeasurer:()=>Ke(c),shapeLaidOutText:W(c),shapingHash:c.operation.shapingHash,producerVersion:c.operation.producerVersion})})(),A.set(n,r),r.catch(()=>{A.get(n)===r&&A.delete(n);});}let i=e.fingerprint,a=r.then(l=>Object.freeze({createMeasurer:l.createMeasurer,shapeLaidOutText:l.shapeLaidOutText,producer:["node-export",i,l.shapingHash,`producer:${l.producerVersion}`,`fallback:${chunkNDPLQG4Y_cjs.a}`].join("|"),extensionFingerprint:i}));return I.set(e,a),a.catch(()=>{I.get(e)===a&&I.delete(e);}),a}var Et="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function bt(e){let o=e.currentPackage(),t=(o.relationships.get(o.mainDocumentPart)??[]).find(r=>r.type===Et),n;if(t){let r=chunkFBWBSHC4_cjs.E(t);r.mode==="Internal"&&r.target.ok&&(n=o.parts.get(r.target.partName));}return n??=o.parts.get("/word/fontTable.xml"),chunkFBWBSHC4_cjs.Sd(o,n)}function Qe(e,o){let t=bt(e);if(t.length!==0)return chunk7VO6BLKV_cjs.i(n=>{let r=new Set((n.resolvedFaces??[]).map(a=>chunkJWHXOJEU_cjs.g(a))),i=chunk7VO6BLKV_cjs.o(t,{maxFontBytes:chunkJWHXOJEU_cjs.a,aggregateBudget:Rt(n),shadowedRequests:r});if(o)for(let a of i.dropped){if(o.dropped.length>=B)break;o.dropped.push(a);}return {sources:i.sources}})}function Rt(e){let o=e.committedSourceBytes;return o===void 0||!Number.isSafeInteger(o)||o<=0?chunkJWHXOJEU_cjs.c:Math.max(0,chunkJWHXOJEU_cjs.c-o)}function Ot(e){return q(e)&&X(e)}var R=0,Je=Symbol("font-resolution-timeout");function St(e){let o=0,t=false;return e?.(R),{reserve:r=>{if(t)throw new Error("Document font-byte lease is already released");if(R+r>chunkJWHXOJEU_cjs.c)throw new chunk5BI4SIHO_cjs.d("layoutFailed",`Active document export font bytes are limited to ${chunkJWHXOJEU_cjs.c}; requested ${r} bytes with ${R} bytes already active`);R+=r,o+=r,e?.(R);let i=false;return ()=>{i||t||(i=true,R-=r,o-=r,e?.(R));}},release:()=>{t||(t=true,R-=o,o=0,e?.(R));}}}function Z(e,o){return e.attributes.find(t=>t.localName===o)?.value}function wt(e,o){return e.attributes.find(t=>t.localName===o&&(t.namespaceUri===chunkFBWBSHC4_cjs.da||t.namespaceUri===""))?.value}async function vt(e,o){if(o.reuseAcrossRevisions===true)throw new TypeError("reuseAcrossRevisions requires a live view or caller-supplied measurer; document-aware byte sessions are immutable");if(o.signal?.aborted)return {ok:false,reason:"aborted"};let t=chunkVSCPFHTD_cjs.Za(e);if(!t.ok)return t;let{fonts:n,fontResolutionTimeoutMs:r,fontPolicy:i,onFontResolution:a,...l}=o,u=Array.isArray(n)?n:[n],c,s;try{s=await At(t.view,u,{signal:o.signal,timeoutMs:r??o.resourceTimeoutMs,fontPolicy:i,onFontResolution:y=>(c=y,a?.(y))});}catch(y){if(y instanceof chunk5BI4SIHO_cjs.d&&y.code==="aborted")return {ok:false,reason:"aborted"};throw y}if(!c)throw s?.dispose(),new chunk5BI4SIHO_cjs.d("layoutFailed","Document font resolution completed without publishing its evidence");let p;try{p=chunk5BI4SIHO_cjs.e(t.view,{...l,reuseAcrossRevisions:!1,...s?{measurer:s.createMeasurer(),producer:o.producer??s.producer}:o.producer?{producer:o.producer}:{}});}catch(y){throw s?.dispose(),y}if(!p.ok)return s?.dispose(),p;let d=p.session,m=s,f="active",x=()=>f==="aborted"?new chunk5BI4SIHO_cjs.d("aborted","Export resource settlement was aborted"):new chunk5BI4SIHO_cjs.d("disposed","Export session has been disposed"),F=y=>{if(f==="active"){f=y,o.signal?.removeEventListener("abort",h);try{d.dispose();}finally{m?.dispose(),m=void 0;}}},h=()=>F("aborted");return o.signal?.addEventListener("abort",h,{once:true}),o.signal?.aborted&&h(),{ok:true,session:Object.freeze({fontResolution:c,layout:()=>f==="active"?d.layout():Promise.reject(x()),layoutFor:y=>f==="active"?d.layoutFor(y):Promise.reject(x()),validatedImageBytes:y=>f==="active"?d.validatedImageBytes(y):null,admittedFontFace:Ge({status:()=>f,unavailable:x,resolve:()=>m?.resolveFont}),shapeLaidOutText:We({status:()=>f,unavailable:x,shaping:()=>m}),dispose:()=>F("disposed")})}}async function At(e,o,t={}){let n=Tt(t.timeoutMs),r=new AbortController,i=()=>r.abort(t.signal?.reason);t.signal?.addEventListener("abort",i,{once:true}),t.signal?.aborted&&i();let a=setTimeout(()=>r.abort(Je),n);try{K(r.signal);let l=(async()=>{let u=St(t.onActiveFontBytesChange),c=!1;try{let s=Dt(e).slice(0,chunk7VO6BLKV_cjs.c),p=[],d={dropped:[]},m=Qe(e,d),f=m?[...o,m]:o,x=await chunk7VO6BLKV_cjs.l(f,{families:s,defaultFamily:chunk7VO6BLKV_cjs.d.family,signal:r.signal},{onOriginFailure:E=>p.push(E),reserveOwnedBytes:u.reserve});K(r.signal);let F=chunk7VO6BLKV_cjs.e(x??{});if(F.sources.length===0){let E=z(s,F.defaultFont.family,p,void 0,d.dropped);V(E,t),H(E,t);return}let h=await Ze(chunkJWHXOJEU_cjs.E(F));K(r.signal);let y=z(s,F.defaultFont.family,p,h.resolveFont,d.dropped);return V(y,t),H(y,t),c=!0,Object.freeze({...h,dispose:u.release})}finally{c||u.release();}})();return await Promise.race([l,Lt(r.signal)])}finally{clearTimeout(a),t.signal?.removeEventListener("abort",i);}}function Tt(e){if(e===void 0)return 6e4;if(!Number.isFinite(e)||e<=0)throw new RangeError("timeoutMs must be a positive finite number");return Math.max(1,e)}function Lt(e){return new Promise((o,t)=>{let n=()=>{t(et(e));};e.aborted?n():e.addEventListener("abort",n,{once:true});})}function et(e){let o=e.reason===Je;return new chunk5BI4SIHO_cjs.d(o?"timedOut":"aborted",o?"Font resolution timed out":"Font resolution was aborted",o?void 0:{cause:e.reason})}function K(e){if(e.aborted)throw et(e)}function Dt(e){let o=[e.part().root],t=[],n=[],r=new Set([e.part().name]),i=(s,p)=>{!p||r.has(p.name)||(r.add(p.name),s.push(p.root));};for(let s of e.headerFooterPartsBySection()){for(let p of s.headers.values())i(t,p);for(let p of s.footers.values())i(t,p);}for(let s of ["footnote","endnote"])n.push(...Pt(e,s));let a=e.documentThemeFonts(),l={...a,major:a.major,minor:a.minor,majorEastAsia:a.majorEastAsia??null,minorEastAsia:a.minorEastAsia??null},u=new Map,c=(s,p)=>{let d=chunk76F73CY6_cjs.d(s,e.stylesRoot(),l,It(s,p)),m=chunk7VO6BLKV_cjs.v(s,e.numberingRoot(),e.stylesRoot(),l);for(let f of [...d.direct,...Ut(s),...m,...chunk7VO6BLKV_cjs.s(s,e.stylesRoot(),l),...d.inherited]){let x=f.toLowerCase();u.has(x)||u.set(x,f);}};return c(o,"body"),c(t,"furniture"),c(n,"note"),[...u.values()]}function Pt(e,o){let t=chunkFBWBSHC4_cjs.Of(e.currentPackage(),o);if(!t)return [];let n=new Set(chunkFBWBSHC4_cjs.Pf(e.part()).filter(i=>i.noteKind===o).map(i=>i.noteId)),r=[];for(let i of t.root.children){if(i.kind==="textValue")continue;let a=chunkFBWBSHC4_cjs.id(i),l=chunkFBWBSHC4_cjs.hd(i);(a==="separator"||a==="continuationSeparator"||l!==null&&n.has(l))&&r.push(i);}return r}var Nt="http://schemas.openxmlformats.org/officeDocument/2006/math";function It(e,o){let t=new Set;for(let n of e){let r=[],i=[{node:n,context:o}];for(;i.length>0;){let{node:a,context:l}=i.pop();a.namespaceUri===chunkFBWBSHC4_cjs.da&&a.localName==="p"&&r.push({paragraph:a,context:l});let u=a.namespaceUri===chunkFBWBSHC4_cjs.da&&a.localName==="txbxContent"&&(l==="body"||l==="note")?"detached":l;for(let c=a.children.length-1;c>=0;c-=1){let s=a.children[c];s.kind!=="textValue"&&i.push({node:s,context:u});}}for(let a of r)_t(a.paragraph,t,a.context);}return t}function _t(e,o,t){let n=chunkNDPLQG4Y_cjs.X(),r=null,i=null,a="",l=false,u=false,c=false,s=0,p=[];for(let d=e.children.length-1;d>=0;d-=1){let m=e.children[d];m.kind!=="textValue"&&p.push({node:m,runId:null,visibility:S,containerDepth:0});}for(;p.length>0;){let{node:d,runId:m,visibility:f,containerDepth:x}=p.pop();if(x>=chunkFBWBSHC4_cjs.la||d.namespaceUri===chunkFBWBSHC4_cjs.da&&d.localName==="p")continue;let F=d.namespaceUri===chunkFBWBSHC4_cjs.da&&d.localName==="r"?d.id:m;if(d.namespaceUri===chunkFBWBSHC4_cjs.da&&d.localName==="fldSimple"){let h=Z(d,"instr")??"";chunkNDPLQG4Y_cjs.lc(h,{allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&kt(d)!==S&&o.add(d.id);}if(d.namespaceUri===chunkFBWBSHC4_cjs.da&&d.localName==="fldChar"){let h=Z(d,"fldCharType");if(h==="begin")chunkNDPLQG4Y_cjs._(n),n.nesting===1&&(r=F,i=null,a="",l=false,u=false,c=chunkFBWBSHC4_cjs.ke(d),s=0);else if(h==="separate"){let y=n.nesting===1;if(chunkNDPLQG4Y_cjs.aa(n),y){let E=chunkNDPLQG4Y_cjs.Z(n);a=E.instruction,l=E.overflow||n.nestingOverflow,i=F,u=true;}}else if(h==="end"){if(n.nesting===1){if(n.phase==="instruction"){let E=chunkNDPLQG4Y_cjs.Z(n);a=E.instruction,l=E.overflow||n.nestingOverflow;}if(!l&&chunkNDPLQG4Y_cjs.kc(a,{hasSeparate:u,hasLegacyFormData:c,allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&s!==S){let E=i??r;E&&o.add(E);}}chunkNDPLQG4Y_cjs.ba(n);}continue}if(d.namespaceUri===chunkFBWBSHC4_cjs.da&&(d.localName==="instrText"||d.localName==="delInstrText")){chunkNDPLQG4Y_cjs.$(n,it(d),d.localName==="delInstrText");continue}n.nesting>0&&chunkNDPLQG4Y_cjs.ca(n)&&d.namespaceUri===chunkFBWBSHC4_cjs.da&&tt(d)&&(s|=f);for(let h=d.children.length-1;h>=0;h-=1){let y=d.children[h];y.kind!=="textValue"&&p.push({node:y,runId:F,visibility:f&rt(d),containerDepth:chunkFBWBSHC4_cjs.ma(d,x)});}}chunkNDPLQG4Y_cjs.Y(n);}function tt(e){return e.localName==="t"||e.localName==="delText"?it(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var Q=1,ot=2,nt=4,S=Q|ot|nt;function kt(e){let o=[];for(let n of e.children)n.kind!=="textValue"&&o.push({node:n,visibility:S});let t=0;for(;o.length>0;){let{node:n,visibility:r}=o.pop();if(!(n.namespaceUri===chunkFBWBSHC4_cjs.da&&n.localName==="p")){if(n.namespaceUri===chunkFBWBSHC4_cjs.da&&tt(n)&&(t|=r,t===S))return t;for(let i of n.children)i.kind!=="textValue"&&o.push({node:i,visibility:r&rt(n)});}}return t}function rt(e){return e.namespaceUri!==chunkFBWBSHC4_cjs.da?S:e.localName==="ins"||e.localName==="moveTo"?Q|ot:e.localName==="del"||e.localName==="moveFrom"?Q|nt:S}function Ut(e){let o=new Map,t=n=>{let r=chunk76F73CY6_cjs.a(n??void 0);if(r===null)return;let i=r.toLowerCase();o.has(i)||o.set(i,r);};for(let n of e){let r=[n];for(;r.length>0;){let i=r.pop();if(i.namespaceUri===Nt&&t(chunkNDPLQG4Y_cjs.Ab),i.namespaceUri===chunkFBWBSHC4_cjs.da&&i.localName==="sym"&&t(chunk76F73CY6_cjs.b(wt(i,"font"))),i.namespaceUri===chunkFBWBSHC4_cjs.da&&i.localName==="fldSimple"){let a=Z(i,"instr");t(chunkNDPLQG4Y_cjs.jc(a??"")?.font??null);}if(i.namespaceUri===chunkFBWBSHC4_cjs.da&&i.localName==="p")for(let a of chunk7VO6BLKV_cjs.u(i))t(a);for(let a=i.children.length-1;a>=0;a-=1){let l=i.children[a];l.kind!=="textValue"&&r.push(l);}}}return [...o.values()]}function it(e){let o="",t=[...e.children].reverse();for(;t.length>0&&o.length<=256;){let n=t.pop();if(n.kind==="textValue")o+=n.value;else for(let r=n.children.length-1;r>=0;r-=1)t.push(n.children[r]);}return o}var lt="FILE_TOO_LARGE",at=8;function Mt(e){return typeof e=="object"&&e!==null}function dt(e){if(!(!Mt(e)||typeof e.code!="string"))return e.code}function ut(e){return e===""||e.toLowerCase()==="localhost"}function Ct(e){try{let o=decodeURIComponent(e);return o.includes("\0")?null:o}catch{return null}}function ct(e){let o=Ct(e);if(o===null)return null;let t=[];for(let n of o.split(/[/\\]/))if(!(n===""||n===".")){if(n===".."){if(t.length===0)return null;t.pop();continue}t.push(n);}return `/${t.join("/")}`}function pt(e){let o=ct(e);return o===null?null:o.endsWith("/")?o:`${o}/`}function Bt(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function qt(e){let o;try{o=typeof e=="string"?new URL(e):new URL("href"in e?e.href:String(e));}catch{throw new TypeError("trustedRoot must be an absolute file: URL")}if(o.protocol!=="file:")throw new TypeError("trustedRoot must use the file: protocol");if(o.username!==""||o.password!=="")throw new TypeError("trustedRoot must not include credentials");if(!ut(o.host))throw new TypeError("trustedRoot must be a local file: URL");let t=pt(o.pathname);if(t===null||Bt(t))throw new TypeError("trustedRoot must be a directory inside the filesystem");let n=new URL("file:///");return n.pathname=t,n}function jt(e){if(typeof e=="string")return [e];if(typeof e=="object"&&e!==null&&"href"in e)return [e];if(Array.isArray(e))return e;throw new TypeError("trustedRoot must be an absolute file: URL")}function zt(e){let o=jt(e);if(o.length===0)throw new TypeError("trustedRoot must name at least one directory");if(o.length>at)throw new TypeError(`trustedRoot must not exceed ${at} directories`);return o.map(qt)}function Vt(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>chunkJWHXOJEU_cjs.a)throw new TypeError(`maxBytes must not exceed ${chunkJWHXOJEU_cjs.a}`);return e}function Ht(e,o){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!ut(e.host))return null;let t=ct(e.pathname);if(t===null)return null;for(let n of o){let r=pt(n.pathname);if(r===null||!t.startsWith(r)||t.length<=r.length)continue;let i=new URL("file:///");return i.pathname=t,i}return null}function Gt(e){return typeof e=="string"?new URL(e):"href"in e&&typeof e.href=="string"?new URL(e.href):new URL("url"in e?e.url:String(e))}function Xt(e,o,t){let n=t.relative(t.resolve(e),t.resolve(o));return n!==""&&!n.startsWith("..")&&!t.isAbsolute(n)}function st(e,o,t){return e.some(n=>Xt(n,o,t))}async function Wt(e,o){let t=[];for(let n of e)try{t.push(await o(n));}catch(r){if(dt(r)==="ENOENT")continue;throw r}return t}function $t(e){return async(o,{signal:t,maxBytes:n})=>{if(t?.aborted)throw t.reason;let[{open:r,realpath:i},{constants:a},{fileURLToPath:l},u]=await Promise.all([import('fs/promises'),import('fs'),import('url'),import('path')]),c=e.map(f=>u.resolve(l(f.href))),s=u.resolve(l(typeof o=="string"?o:o.href));if(!st(c,s,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let p=typeof a.O_NOFOLLOW=="number"?a.O_RDONLY|a.O_NOFOLLOW:"r",d=await r(s,p),m=()=>{d.close();};t?.addEventListener("abort",m,{once:true});try{if(t?.aborted)throw t.reason;let f=await i(s);if(!st(await Wt(c,i),f,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let x=(await d.stat()).size;if(!Number.isSafeInteger(x)||x<0||x>n)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:lt});let F=new Uint8Array(x),h=0;for(;h<F.byteLength;){if(t?.aborted)throw t.reason;let{bytesRead:y}=await d.read(F,h,F.byteLength-h,h);if(y===0)break;h+=y;}if(t?.aborted)throw t.reason;return h===F.byteLength?F:F.slice(0,h)}catch(f){throw t?.aborted?t.reason:f}finally{t?.removeEventListener("abort",m),await d.close().catch(()=>{});}}}function Yt(e){if(e===null||typeof e!="object")throw new TypeError("createPackagedFileFetch requires trustedRoot and maxBytes");if(e.trustedRoot===void 0||e.maxBytes===void 0)throw new TypeError("createPackagedFileFetch requires trustedRoot and maxBytes");let o=zt(e.trustedRoot),t=Vt(e.maxBytes),n=e.read??$t(o),r=e.networkFetch??fetch;return(async(i,a)=>{let l=a?.signal;if(l?.aborted)throw l.reason;let u=Gt(i);if(u.protocol!=="file:")return r(u,a);let c=Ht(u,o);if(!c)return new Response(null,{status:404});let s=l?new AbortController:void 0,p=()=>s?.abort(l?.reason);l?.addEventListener("abort",p,{once:true});let d;try{if(d=await n(c,{maxBytes:t,...s?{signal:s.signal}:{}}),l?.aborted)throw l.reason;if(d.byteLength>t)return new Response(null,{status:413})}catch(m){if(l?.aborted)throw l.reason;if(s?.signal.aborted)throw s.signal.reason??m;if(m instanceof DOMException&&m.name==="AbortError"||m instanceof Error&&m.name==="AbortError")throw m;let f=dt(m);if(f===lt)return new Response(null,{status:413});if(f==="ENOENT"||f==="ENOTDIR"||f==="ELOOP")return new Response(null,{status:404});throw m}finally{l?.removeEventListener("abort",p);}return new Response(d,{status:200})})}
2
+ Object.defineProperty(exports,"ExportResourceError",{enumerable:true,get:function(){return chunk5BI4SIHO_cjs.d}});Object.defineProperty(exports,"createNodeImageDecodePort",{enumerable:true,get:function(){return chunk5BI4SIHO_cjs.c}});Object.defineProperty(exports,"exportDestinationNamed",{enumerable:true,get:function(){return chunk5BI4SIHO_cjs.b}});Object.defineProperty(exports,"openDocumentForExport",{enumerable:true,get:function(){return chunk5BI4SIHO_cjs.e}});exports.MAX_SHARED_EXPORT_SHAPING_CONFIGURATIONS=Y;exports.acquireSharedExportShaping=gt;exports.createPackagedFileFetch=Yt;exports.hasExportAdmittedFont=q;exports.hasExportLaidOutText=X;exports.hasFontBackedExportCapabilities=Ot;exports.openFontBackedDocumentForExport=vt;