@docx-editor.dev/core 2.34.0 → 2.35.0-canary.20261104032723.sha-43c2012

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 (95) hide show
  1. package/dist/automation.cjs +1 -1
  2. package/dist/automation.d.ts +8 -8
  3. package/dist/automation.js +1 -1
  4. package/dist/binding.cjs +1 -1
  5. package/dist/binding.d.ts +12 -12
  6. package/dist/binding.js +1 -1
  7. package/dist/{chrome-print-DY0xsXm_.d.ts → chrome-print-CK3v5NhC.d.ts} +11 -11
  8. package/dist/{chunk-ZJ74LCFI.cjs → chunk-4C7JUJDX.cjs} +1 -1
  9. package/dist/{chunk-NKZVMMHU.cjs → chunk-4NPNKO5U.cjs} +1 -1
  10. package/dist/chunk-6IYKYYWF.js +32 -0
  11. package/dist/{chunk-DYLB5U42.js → chunk-7ACXKFKO.js} +1 -1
  12. package/dist/{chunk-KCUXXO3Q.js → chunk-A5GMOQWD.js} +1 -1
  13. package/dist/{chunk-E5BKDHIP.cjs → chunk-AMOFXSEO.cjs} +1 -1
  14. package/dist/{chunk-V7CO55DO.cjs → chunk-CDAFCPT6.cjs} +2 -2
  15. package/dist/chunk-CU6QPXKD.js +2 -0
  16. package/dist/{chunk-AVCYP7OY.js → chunk-EBIMIIC3.js} +5 -5
  17. package/dist/chunk-ELR6HXOO.js +1 -0
  18. package/dist/chunk-EMITIPLN.js +4 -0
  19. package/dist/{chunk-IWXBRUPG.cjs → chunk-FBGZOGLU.cjs} +3 -3
  20. package/dist/{chunk-37IYWENL.cjs → chunk-GTICLPKS.cjs} +1 -1
  21. package/dist/{chunk-37RNWL45.js → chunk-I4WSXFY6.js} +2 -2
  22. package/dist/{chunk-VQOAC3VI.cjs → chunk-IGB66DIX.cjs} +20 -20
  23. package/dist/chunk-JQPTNBLT.js +236 -0
  24. package/dist/{chunk-5HUVQXET.cjs → chunk-JVWRILO3.cjs} +2 -2
  25. package/dist/{chunk-7FUORGCW.js → chunk-JZ4LO3ZZ.js} +1 -1
  26. package/dist/chunk-KOYEBRLV.js +1 -0
  27. package/dist/{chunk-DR6W23TB.cjs → chunk-KZZPOZOF.cjs} +1 -1
  28. package/dist/{chunk-VLQDQNSS.js → chunk-LZ64O473.js} +1 -1
  29. package/dist/chunk-NPWMZIPA.cjs +32 -0
  30. package/dist/chunk-NS2QCOAS.js +7 -0
  31. package/dist/chunk-O2PGRL5D.js +3 -0
  32. package/dist/{chunk-NEM774E3.cjs → chunk-Q4MUV5KX.cjs} +1 -1
  33. package/dist/chunk-TFJUIP4X.cjs +236 -0
  34. package/dist/{chunk-L74TCGVH.cjs → chunk-TZTKEPCC.cjs} +1 -1
  35. package/dist/chunk-V6FOPP2H.js +30 -0
  36. package/dist/chunk-XFEIUKOS.cjs +7 -0
  37. package/dist/{chunk-5KOLFKOB.cjs → chunk-ZF4N3N3L.cjs} +5 -5
  38. package/dist/collaboration/replication.cjs +1 -1
  39. package/dist/collaboration/replication.d.ts +11 -4
  40. package/dist/collaboration/replication.js +1 -1
  41. package/dist/collaboration.d.ts +2 -2
  42. package/dist/contracts/document.d.ts +2 -2
  43. package/dist/contracts/editor.d.ts +8 -8
  44. package/dist/contracts/modules.d.ts +10 -10
  45. package/dist/contracts/types.d.ts +3 -3
  46. package/dist/{custom-node-writes-DparEcZK.d.ts → custom-node-writes-BC3z8NwO.d.ts} +2 -2
  47. package/dist/{document-protection-DdWxihIN.d.ts → document-protection-8hXPdn5U.d.ts} +1 -1
  48. package/dist/{drawing-graphic-kind-CK0cMc7H.d.ts → drawing-graphic-kind-_5u2E4ee.d.ts} +2 -2
  49. package/dist/{drawing-preview-package-fFjXpOMS.d.ts → drawing-preview-package-JyAqL6OV.d.ts} +1 -1
  50. package/dist/{editor-DDCkWqfD.d.ts → editor-BGCdE3tB.d.ts} +4 -4
  51. package/dist/editor.cjs +1 -1
  52. package/dist/editor.d.ts +25 -25
  53. package/dist/editor.js +1 -1
  54. package/dist/export.cjs +2 -2
  55. package/dist/export.d.ts +6 -6
  56. package/dist/export.js +1 -1
  57. package/dist/index.cjs +1 -1
  58. package/dist/index.d.ts +17 -17
  59. package/dist/index.js +1 -1
  60. package/dist/{layout-shaping-Byj-TwsI.d.ts → layout-shaping-D2qNes9-.d.ts} +1 -1
  61. package/dist/layout.cjs +1 -1
  62. package/dist/layout.d.ts +34 -24
  63. package/dist/layout.js +1 -1
  64. package/dist/{note-properties-BiunaIQa.d.ts → note-properties-DGPzKUuA.d.ts} +1 -1
  65. package/dist/output.cjs +1 -1
  66. package/dist/output.d.ts +10 -10
  67. package/dist/output.js +1 -1
  68. package/dist/{protocol-Dn44dL4M.d.ts → protocol-0y3iaYj9.d.ts} +2 -2
  69. package/dist/{review-paragraph-order-BWMXAKuA.d.ts → review-paragraph-order-DeQp2_iu.d.ts} +1 -1
  70. package/dist/{revision-projection-DwFhgIR0.d.ts → revision-projection-CrAv-HP6.d.ts} +1 -1
  71. package/dist/{semantic-cell-selection-DhalxEBH.d.ts → semantic-cell-selection-CeG_qqDV.d.ts} +2 -2
  72. package/dist/{semantic-interaction-QeuzEtAk.d.ts → semantic-interaction-DcE_ZsiD.d.ts} +1 -1
  73. package/dist/{semantic-paint-BYDZbTiY.d.ts → semantic-paint-DfeN6UQF.d.ts} +4 -4
  74. package/dist/{semantic-record-queries-Bf5bgQL3.d.ts → semantic-record-queries-qwd9Ict6.d.ts} +1 -1
  75. package/dist/{semantic-records-CzZiWMY8.d.ts → semantic-records-thL1rcmG.d.ts} +12 -5
  76. package/dist/store.cjs +1 -1
  77. package/dist/store.d.ts +12 -12
  78. package/dist/store.js +1 -1
  79. package/dist/{tree-op-types-DKvJSH8T.d.ts → tree-op-types-CGlwCQXg.d.ts} +15 -2
  80. package/dist/{tree-package-store-Cl3BkWXF.d.ts → tree-package-store-D0_BOm-r.d.ts} +1 -1
  81. package/dist/{tree-session-contract-BL50pqs8.d.ts → tree-session-contract-DkThhHjy.d.ts} +4 -4
  82. package/dist/{unsupported-elements-Bra4QTOM.d.ts → unsupported-elements-qj0sXi2s.d.ts} +1 -1
  83. package/package.json +2 -2
  84. package/dist/chunk-5JP3QQF7.js +0 -7
  85. package/dist/chunk-6MF5PN2E.js +0 -236
  86. package/dist/chunk-77JT2AU7.js +0 -2
  87. package/dist/chunk-A5BTVPET.cjs +0 -236
  88. package/dist/chunk-AFXFH2T2.js +0 -3
  89. package/dist/chunk-BL2E4QRA.js +0 -1
  90. package/dist/chunk-DB7X4Y6O.js +0 -4
  91. package/dist/chunk-KYA4Y2YB.js +0 -1
  92. package/dist/chunk-NBSSQSKY.js +0 -30
  93. package/dist/chunk-TXIO5WYQ.cjs +0 -32
  94. package/dist/chunk-UKG2TXWH.cjs +0 -7
  95. package/dist/chunk-YWJSQA2O.js +0 -32
@@ -1,2 +0,0 @@
1
- import {Q,R,T,S}from'./chunk-AFXFH2T2.js';import {h,a,b,e,c,f,re as re$1,Nc,Qc,Sc,Tc,Rc,ie as ie$1,Oc,Pc,nd,kf,Md,Lf,Kf,d,F,xd,ma,Bc,lf,kd,of}from'./chunk-YWJSQA2O.js';import {b as b$1}from'./chunk-BL2E4QRA.js';import {a as a$1,c as c$1,b as b$2}from'./chunk-VLQDQNSS.js';import {qe,Ee,Bb,Aa,pa,Ba,gd,ge as ge$1,f as f$1,va,oa,a as a$2,N}from'./chunk-6MF5PN2E.js';var St=/^[\p{L}\p{N}\p{M} \-.+_,;]{1,64}$/u;function Y(e){let t=new Map;for(let n of e)if(Array.isArray(n)){for(let o of n.slice(0,2048)){if(typeof o!="string"||!St.test(o))continue;let r=o.toLowerCase();if(t.has(r)||t.set(r,o),t.size===2048)break}if(t.size===2048)break}return Object.freeze([...t.values()])}function mn(e){let t=e&&"failures"in e?e.failures:void 0;return e==null||(e.sources?.length??0)===0&&(e.substitutions?.length??0)===0&&(t===void 0||Array.isArray(t)&&t.length===0)?void 0:e}var nt=64,ce=Object.freeze({family:"Calibri",sizeHalfPoints:22}),gn=ce;function ee(e,...t){let n=[e,...t],o=[],r=new Set;for(let l of n)for(let u of l.sources??[]){let c=h(u.request);r.has(c)||(r.add(c),o.push(u));}let i=[],s=new Set;for(let l of n)for(let u of l.substitutions??[]){let c=h(u.from);r.has(c)||s.has(c)||(s.add(c),i.push(u));}let a$1=Y(n.map(l=>l.supportedFamilies));return Object.freeze({...a$1.length?{supportedFamilies:a$1}:{},epoch:e.epoch??0,maxFontBytes:e.maxFontBytes??a,sources:Object.freeze(o),...i.length>0?{substitutions:Object.freeze(i)}:{},defaultFont:e.defaultFont??ce,...e.language!==void 0?{language:e.language}:{}})}var Ot=/^[\p{L}\p{N}\p{M} \-.+_,;]{1,64}$/u;function te(e){let t=e?.defaultFont?.family;return t!==void 0&&Ot.test(t)?t:ce.family}function G(e){let t="deferred"in e?e.deferred:void 0;if(t===void 0)return {now:e};let{deferred:n,...o}=e;if(typeof t?.then!="function")return {now:o};let r=Promise.resolve(t);return r.catch(()=>{}),{now:o,later:r}}var rt=new WeakSet;function At(e){return e&&rt.add(e),e}function it(e,t){if(!t)return e;let n=e?fe(e):void 0,o=t.deferred?{deferred:t.deferred}:{},r=rt.has(t),i=r?t.supportedFamilies??[]:[...t.supportedFamilies??[],...n?.supportedFamilies??[]];return {...n,sources:r?t.sources??[]:[...t.sources??[],...n?.sources??[]],substitutions:r?t.substitutions??[]:[...t.substitutions??[],...n?.substitutions??[]],supportedFamilies:i.length>0?[...new Set(i)]:void 0,...o}}function Rt(e){return !!e&&((e.sources?.length??0)>0||(e.substitutions?.length??0)>0||e.deferred!==void 0)}function st(e){let t=e&&"failures"in e?e.failures:void 0;return Array.isArray(t)?t.slice(0,256):[]}function at(e,t){return t?t.aborted?Promise.reject(t.reason):new Promise((n,o)=>{let r=()=>o(t.reason);t.addEventListener("abort",r,{once:true}),Promise.resolve(e).then(i=>{t.removeEventListener("abort",r),n(i);},i=>{t.removeEventListener("abort",r),o(i);});}):Promise.resolve(e)}async function lt(e,t,n){let o="failures"in e?e.failures:void 0,r=s=>o===void 0?s:{...s,failures:o},i=e;for(let s=0;s<ot;s+=1){let{now:a,later:l}=G(i);if(!l)return r(a);let u;try{u=await at(l,n);}catch(c){if(n?.aborted)throw n.reason;return t(c),r(a)}for(let c of st(u))t(c);i=it(a,u)??a;}return t(new RangeError(`Font loading stopped after ${ot} deferred steps`)),r(G(i).now)}var ot=256;function fe(e){if(!("failures"in e))return e;let{failures:t,...n}=e;return n}async function de(e,t,n,o){let r=t.flatMap((a,l)=>a?[a.then(u=>({originIndex:l,ok:true,value:u??void 0}),u=>({originIndex:l,ok:false,cause:u}))]:[]);if(r.length===0)return;let i=await at(Promise.race(r),n).catch(()=>{});if(!i||n?.aborted)return;if(i.ok)for(let a of st(i.value))o.report(i.originIndex,a);else o.report(i.originIndex,i.cause);if(!i.ok||!Rt(i.value)){let a=t.map((l,u)=>u===i.originIndex?void 0:l);return de(e,a,n,o)}let s=[];for(let a=0;a<Math.max(e.length,t.length);a+=1){let l=e[a],u=t[a];s.push(a===i.originIndex?it(l,i.value):u?{...l??{sources:[]},deferred:u}:l);}try{return At(await o.compose(s))}catch(a){n?.aborted||o.report(i.originIndex,a);return}}var kt="docx-editor.dev/font-resolver",ft=Symbol.for("docx-editor.dev/font-resolver");function En(e){let t={value:true,enumerable:false,configurable:true};try{Object.defineProperty(e,ft,t),Object.defineProperty(e,kt,t);}catch(n){throw new TypeError("defineFontResolver cannot mark a frozen or sealed function; mark it before freezing, or wrap it in a fresh function and mark that.",{cause:n})}return e}function Cn(e){return typeof e=="function"&&e[ft]===true}var ge=class extends RangeError{constructor(n,o,r){super(`Font source ${n.family} (${o} bytes) exceeds the shaping byte ceiling (${r} bytes)`);this.request=n;}request},pe=class extends AggregateError{causes;constructor(t){let n=Object.freeze(t.slice(0,b*2));super(n,`Font origin rejected all ${n.length} face and substitution candidates`),this.causes=n;}},ne=e=>`${e.family.trim().toLowerCase()} ${e.weight} ${e.style}`;function Tt(e,t,n){let o=new Map(e.map(r=>[ne(r),r]));for(let[r,i]of t)o.set(r,i);for(let r of n)o.has(ne(r.to))&&o.set(ne(r.from),r.from);return [...o.values()]}async function Sn(e,t,n={}){return ye(e,t,n)}async function On(e,t,n={}){return ye(e,t,n)}async function ye(e,t,n){let o=n.maxExecutionFontBytes??a;if(!Number.isSafeInteger(o)||o<=0||o>a)throw new RangeError("Font execution byte ceiling is outside the supported range");let r=e.map(Mt),i,s=[],a$1=[],l=new Map,u=new Set,c=0,f=[],d=new Set,b$1=[],v=t.resolvedFaces??[],T=t.defaultFamily,S=[],P=[],g=new Set(n.placeholderOrigins??[]),E;for(let F=0;F<e.length;F+=1){dt(t.signal);let k=e[F],X=Tt(v,l,f),q,B;try{let w=r[F],p;if(w){let m=await ct(w,t.signal);if(!m.ok)throw m.cause;p=m.value;}else if(typeof k=="function"){let m=await ct(Promise.resolve(k(Lt(t,T,X,c))).then(_=>({ok:!0,value:_}),_=>({ok:!1,cause:_})),t.signal);if(!m.ok)throw m.cause;p=m.value;}else p=k;if(p==null)continue;if(typeof p=="function"){K(n,k,F,new TypeError("A font origin answered with a function; pass the resolver itself rather than a function returning one"));continue}if(n.awaitDeferred){let m=G(p);m.later&&ut(m.now,m.now)&&g.add(F),p=await lt(p,_=>K(n,k,F,_),t.signal);}else {let m=G(p);p=m.now,B=m.later;}let C="failures"in p?p.failures:void 0,O=[];if(Array.isArray(C)){let m=Math.min(C.length,b);for(let _=0;_<m;_++)O.push(C[_]);C.length>m&&O.push(new Error("Additional font-origin failures were omitted"));}else C!==void 0&&O.push(C);let A;try{A=vt(p,u,c,d,i?"maxFontBytes"in i&&i.maxFontBytes!==void 0?i.maxFontBytes:a:void 0,n.reserveOwnedBytes,n.instrumentation,o);}catch(m){for(let _ of new Set(O))K(n,k,F,_);throw m}q=A;for(let m of new Set([...A.dropped,...O]))K(n,k,F,m);let x=A.fragment;x.supportedFamilies&&s.push(x.supportedFamilies),b$1.push(...O);let U=(x.sources??[]).map(m=>(h(m.request),[ne(m.request),m.request])),W=[...x.substitutions??[]];B!==void 0&&ut(x,p)&&g.add(F);let $=g.has(F);!i&&!$&&"defaultFont"in x&&(T=te(x)),!i&&!$&&(i=x),$&&(E??=x);let z=new Set(A.sourceKeys);if(z.size>0){f=f.filter(m=>!z.has(h(m.from)));for(let m of z)d.delete(m);}a$1.push(...x.sources??[]);for(let m of A.sourceKeys)u.add(m);c+=A.ownedBytes;for(let[m,_]of U)l.set(m,_);for(let m of W)f.push(m),d.add(h(m.from));S[F]=fe(x),B&&(P[F]=B);}catch(w){if(q?.releaseOwnedBytes?.(),t.signal?.aborted)throw t.signal.reason??w;if(w instanceof oe)throw w.cause;if(K(n,k,F,w),B){let p=new Error("Font origin skipped, so its background faces were not loaded");K(n,k,F,p);}continue}}let y=P.some(Boolean)?de(S,P,t.signal,{compose:F=>ye(F,t,{...n,placeholderOrigins:g}),report:(F,k)=>K(n,e[F],F,k)}):void 0;if(i??=E,!i)return y?{sources:[],deferred:y}:void 0;let{epoch:M,...R}=ee({...i,supportedFamilies:Y(s),sources:a$1,substitutions:f}),D=y?{...R,deferred:y}:R;return b$1.length===0?D:{...D,failures:Object.freeze(b$1)}}function ut(e,t){return (e.sources?.length??0)===0&&(e.substitutions?.length??0)===0&&!("defaultFont"in t)&&!("maxFontBytes"in t)}var oe=class extends Error{constructor(n){super("Unable to reserve owned font bytes");this.cause=n;this.name="FontOwnershipReservationError";}cause},re=class extends RangeError{};async function ct(e,t){if(!t)return e;dt(t);let n,o=new Promise((i,s)=>{n=s;}),r=()=>n?.(t.reason);t.addEventListener("abort",r,{once:true});try{return await Promise.race([e,o])}finally{t.removeEventListener("abort",r);}}function Mt(e){if(e===null||typeof e!="object")return;let t;try{t=e.then;}catch(n){return Promise.resolve({ok:false,cause:n})}if(typeof t=="function")return Promise.resolve(e).then(n=>({ok:true,value:n}),n=>({ok:false,cause:n}))}function vt(e$1,t,n,o,r,i,s,a$1=a){let l=e$1.sources??[],u=e$1.substitutions??[],c$1="maxFontBytes"in e$1?e$1.maxFontBytes:void 0,f$1="defaultFont"in e$1?e$1.defaultFont:void 0,d="epoch"in e$1?e$1.epoch:void 0,b$1="language"in e$1?e$1.language:void 0;if(!Array.isArray(l)||!Array.isArray(u))throw new TypeError("Font origin sources and substitutions must be arrays");let v=l.length,T=u.length;if(v>b)throw new RangeError(`Font source count must not exceed ${b}`);if(T>b)throw new RangeError(`Font substitution count must not exceed ${b}`);let S=c$1??a;if(!Number.isSafeInteger(S)||S<=0||S>a)throw new RangeError(`Font byte ceiling must be a positive safe integer no greater than ${a}`);let P=Math.min(r??S,a$1),g=0,E=[],y=new Set,M=[],R=[];for(let w=0;w<v;w+=1){let p=l[w];try{let C=me(p.request),O=h(C);if(t.has(O)||y.has(O))continue;let A=p.availability,x=p.faceIndex,U=p.hash,W=p.id;if(A!==void 0&&A!=="available"&&A!=="forbidden")throw new TypeError("Font source availability must be available or forbidden");if(!Number.isSafeInteger(x)||x<0)throw new RangeError("Font face index must be a non-negative safe integer");if(typeof U!="string"||U.length===0)throw new TypeError("Font source hash must be a non-empty string");let $;if(A!=="forbidden"){if(typeof W!="string"||W.length===0)throw new TypeError("Font source id must be a non-empty string");$=p.bytes;let z=e($);if(z>P)throw z<=(r??S)?new ge(C,z,a$1):new RangeError(`Font source ${C.family} (${z} bytes) exceeds the effective base byte ceiling (${P} bytes)`);if(t.has(O)||y.has(O))continue;if(n+g+z>c)throw new RangeError(`Font sources exceed the aggregate byte ceiling of ${c}`);g+=z;}else $=new Uint8Array(0);if(t.has(O)||y.has(O))continue;if(t.size+y.size>=b)throw new re(`Font source count must not exceed ${b}`);y.add(O),E.push(O),M.push(Object.freeze({request:C,id:W,bytes:$,hash:U,faceIndex:x,...A?{availability:A}:{}}));}catch(C){if(C instanceof re)throw C;R.push(C);}}let D=new Set,F=[];for(let w=0;w<T;w+=1){let p=u[w];try{let C=me(p.from),O=me(p.to);h(C),h(O);let A=p.lineMetrics,x=A?Object.freeze({heightEm:A.heightEm,baselineEm:A.baselineEm}):void 0;if(x&&(!Number.isFinite(x.heightEm)||!Number.isFinite(x.baselineEm)||x.heightEm<=0||x.heightEm>4||x.baselineEm<0||x.baselineEm>x.heightEm))throw new RangeError("Font substitution line metrics must fit within a bounded em box");let U=h(C);if(t.has(U)||y.has(U)||o.has(U)||D.has(U))continue;D.add(U),F.push(Object.freeze({from:C,to:O,...x?{lineMetrics:x}:{}}));}catch(C){R.push(C);}}if((v>0||T>0)&&M.length===0&&F.length===0&&R.length>0)throw R.length===1?R[0]:new pe(R);let k=o.size;for(let w of y)o.has(w)&&(k-=1);if(k+D.size>b)throw new RangeError(`Font substitution count must not exceed ${b}`);let X;if(f$1!==void 0){let w=f$1.family,p=f$1.sizeHalfPoints;if(h({family:w,weight:400,style:"normal"}),!Number.isSafeInteger(p)||p<=0)throw new RangeError("Default font size must be a positive safe integer in half-points");X=Object.freeze({family:w,sizeHalfPoints:p});}if(d!==void 0&&(!Number.isSafeInteger(d)||d<0))throw new RangeError("Font configuration epoch must be a non-negative safe integer");if(b$1!==void 0&&typeof b$1!="string")throw new TypeError("Font shaping language must be a string");let q;if(g>0&&i)try{q=i(g);}catch(w){throw new oe(w)}let B;try{B=M.map(w=>f(w,s));}catch(w){throw q?.(),w}return {fragment:Object.freeze({supportedFamilies:Y([e$1.supportedFamilies]),sources:Object.freeze(B),substitutions:Object.freeze(F),...d!==void 0?{epoch:d}:{},...c$1!==void 0?{maxFontBytes:c$1}:{},...X?{defaultFont:X}:{},...b$1!==void 0?{language:b$1}:{}}),sourceKeys:Object.freeze(E),ownedBytes:g,dropped:Object.freeze(R),releaseOwnedBytes:q}}function _t(e){return !Number.isSafeInteger(e)||e<=0?0:e>c?c:e}function Lt(e,t,n,o){let{committedSourceBytes:r,...i}=e,s=_t(o);return {...i,defaultFamily:t,...n.length>0?{resolvedFaces:n}:{},...s>0?{committedSourceBytes:s}:{}}}function me(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}function dt(e){if(e?.aborted)throw e.reason??new DOMException("Font resolution was aborted","AbortError")}function K(e,t,n,o){let r;try{typeof t=="function"&&t.name.length>0&&(r=t.name);}catch{}try{o instanceof Error&&o.stack;}catch{}let i=Object.freeze({originIndex:n,...r!==void 0?{originName:r}:{},cause:o});if(e.onOriginFailure)try{let a=e.onOriginFailure(i);Promise.resolve(a).catch(l=>{console.warn("[fonts] font-origin diagnostic callback failed",l);});return}catch(a){console.warn("[fonts] font-origin diagnostic callback failed",a);}let s="";try{o instanceof Error&&o.message.length>0&&(s=`: ${o.message}`);}catch{}console.warn(`[fonts] a font origin failed and was skipped${s}`,o);}function Nt(e,t,n){let o="";for(let r=t;r+1<t+n&&r+1<e.length;r+=2){let i=e[r]|e[r+1]<<8;if(i===0)break;o+=String.fromCharCode(i);}return o}function Pt(e,t,n){let o="";for(let r=t;r<t+n&&r<e.length&&e[r]!==0;r++)o+=String.fromCharCode(e[r]);return o}function It(e,t){let n=new DataView(e.buffer,e.byteOffset,e.byteLength);if(e.length<8||n.getUint32(0,true)!==1)return;let o=0;for(let r=0;r<1e5&&o+8<=e.length;r++){let i=n.getUint32(o,true),s=n.getUint32(o+4,true);if(s<8||s%4!==0||o+s>e.length||(i===82&&s>=104&&t(Nt(e,o+40,64)),i===14))return;o+=s;}}function Dt(e,t){let n=new DataView(e.buffer,e.byteOffset,e.byteLength),o=e.length>=22&&n.getUint32(0,true)===2596720087?22:0;if(!(o+18>e.length||n.getUint16(o+2,true)!==9)){o+=18;for(let i=0;i<1e5&&o+6<=e.length;i++){let s=n.getUint32(o,true),a=n.getUint16(o+4,true);if(s<3||o+s*2>e.length||(a===763&&s*2>=25&&t(Pt(e,o+6+18,Math.min(32,s*2-6-18))),a===0))return;o+=s*2;}}}function mt(e,t){let n=new Map,o=i=>{if(i.trim().toLowerCase()==="system")return;let s=t(i.trim());if(s===null||n.size>=16)return;let a=s.toLowerCase();n.has(a)||n.set(a,s);},r=0;for(let[i,s]of e.partBytes){let a=i.toLowerCase();if(!a.startsWith("/word/")||a.startsWith("/word/glossary/"))continue;let l=a.endsWith(".emf"),u=a.endsWith(".wmf");if(!(!l&&!u)){if(++r>64||n.size>=16)break;l?It(s,o):Dt(s,o);}}return [...n.values()]}var Bt=2e5,pt=32,Ut=new Set(["latin","ea","cs"]);function zt(e,t){let n=/^\+(mn|mj)-(lt|ea|cs)$/.exec(e);if(!n)return;let o=n[1]==="mj";return n[2]==="ea"?o?t.majorEastAsia:t.minorEastAsia:n[2]==="cs"?o?t.majorBidi:t.minorBidi:o?t.major:t.minor}var gt=new WeakMap;function qt(e){let t=gt.get(e);if(t)return t;let n=[],o=new Set,r=[e],i=0;for(;r.length>0&&++i<=Bt&&n.length<pt;){let s=r.pop();if(s.namespaceUri===va&&Ut.has(s.localName)){let a=oa(s.attributes,"typeface");a&&!o.has(a)&&(o.add(a),n.push(a));continue}for(let a=s.children.length-1;a>=0;a-=1){let l=s.children[a];l.kind!=="textValue"&&r.push(l);}}return gt.set(e,n),n}function Nn(e,t={}){let n=new Map,o=r=>{let i=r?b$1(r):null;if(i===null||n.size>=pt)return;let s=i.toLowerCase();n.has(s)||n.set(s,i);};for(let r of e.parts.values()){let i=r.root;if(!(i.namespaceUri!==qe&&i.namespaceUri!==Ee)){o(t.minor);for(let s of qt(i))s.startsWith("+")?o(zt(s,t)):o(s);}}for(let r of mt(e,b$1))o(r);return [...n.values()]}var jt=256,Xt=Object.freeze([]);function ie(e){let t=new WeakMap;return (n,o)=>{let r=new Set;for(let i of n){let s=[{node:i,context:o,next:0}],a=l=>{s.pop();let u=s.at(-1)?.found??r;for(let c of l)u.add(c);};for(;s.length;){let l=s[s.length-1],u=t.get(l.node);if(u?.key===l.context.key){a(u.families);continue}if(!l.children){let d=e(l.node,l.context);l.children=d.children,l.found=new Set(d.families);}let c=l.children[l.next++];if(c){s.push({...c,next:0});continue}let f=l.found.size===0?Xt:[...l.found];f.length<=jt&&Bb(l.node)?t.set(l.node,{key:l.context.key,families:f}):t.delete(l.node),a(f);}}return [...r]}}function se(e,t){return e.children.flatMap(n=>n.kind==="textValue"?[]:[{node:n,context:t}])}var yt=new WeakMap,$t=4096;function Ft(e,t){let n=`${e.baseKey}|${e.depth+1}|${JSON.stringify(t)}`,o=yt.get(e);o||yt.set(e,o=new Map);let r=o.get(n);if(r)return r;let i={...e,depth:e.depth+1,cellStyle:t,key:n};return o.size<$t&&o.set(n,i),i}function Vt(e,t){let{styles:n,theme:o,supplementalFamilies:r,depth:i}=t;if(e.kind==="table"){let l=re$1(e,468,i,n),u=[];for(let c of l?.rows??[])for(let f of c.cells){let d=Ft(t,f.styleFormatting);for(let b of f.blocks)u.push({node:b,context:d});}return {children:u.reverse()}}let s=new Set;if(e.kind==="paragraph"){let l=e.children.find(c=>c.kind==="paragraphProperties"),u=lf(n,l,t.cellStyle).runProperties;for(let c of kd(e,u,void 0,(f,d)=>of(f,d,n),void 0,void 0,"all-markup",void 0,void 0,o)){if(!c.text||c.fontSlot!=="eastAsia"&&!r.has(c.style.fontFamily??""))continue;let f=b$1((c.fontSlot==="eastAsia"?c.style.fontFamilyEastAsia:c.style.fontFamily)??void 0);f&&s.add(f);}}let a=e.localName==="txbxContent"?{...t,cellStyle:void 0,key:`${t.baseKey}|${i}|undefined`}:t;return {families:[...s],children:se(e,a).reverse()}}function Ht(){let e=ie(Vt),t,n,o=(i,s)=>{if(!t||n!==i||t.theme!==s){let a=kf(i,s);n=i,t={key:`${a.cacheToken}|0|undefined`,baseKey:a.cacheToken,styles:a,theme:s,depth:0,supplementalFamilies:new Set([...Object.values(s.majorSupplemental??{}),...Object.values(s.minorSupplemental??{})])};}return t};return Object.assign((i,s,a)=>e([...i].reverse(),o(s,a)),{warmTableRows(i,s,a,l,u){let c=o(l,u),f=re$1(i,468,c.depth,c.styles)?.rows??[];for(let d of f.slice(s,a))for(let b of d.cells)e(b.blocks,Ft(c,b.styleFormatting));return f.length}})}function Xn(e,t,n){return Ht()(e,t,n)}function Fe(e,t){return e.attributes.find(n=>n.localName===t)?.value}var Kt=ie((e,t)=>{let n=[];if(e.namespaceUri===pa){if(e.localName==="fldSimple"){let o=ie$1(Fe(e,"instr")??"")?.font;o&&n.push(o);}if(e.localName==="p")for(let o of Wt(e))n.push(o);}return {families:n,children:se(e,t)}});function to(e){let t=new Map;for(let n of Kt(e,{key:""})){let o=b$1(n);o!==null&&!t.has(o.toLowerCase())&&t.set(o.toLowerCase(),o);}return [...t.values()]}function Wt(e){let t=[],n=Nc(),o=[];for(let r=e.children.length-1;r>=0;r-=1){let i=e.children[r];i.kind!=="textValue"&&o.push({node:i,containerDepth:0});}for(;o.length>0;){let{node:r,containerDepth:i}=o.pop();if(i>=Aa||r.namespaceUri===pa&&r.localName==="p")continue;if(r.namespaceUri===pa&&r.localName==="fldChar"){let a=Fe(r,"fldCharType");a==="begin"?Qc(n):a==="separate"?(n.nesting===1&&ht(n,t),Sc(n)):a==="end"&&(n.nesting===1&&ht(n,t),Tc(n));continue}if(r.namespaceUri===pa&&(r.localName==="instrText"||r.localName==="delInstrText")){Rc(n,Yt(r),r.localName==="delInstrText");continue}if(r.namespaceUri===pa&&r.localName==="fldSimple"){let a=ie$1(Fe(r,"instr")??"");a?.font&&t.push(a.font);}let s=Ba(r,i);for(let a=r.children.length-1;a>=0;a-=1){let l=r.children[a];l.kind!=="textValue"&&o.push({node:l,containerDepth:s});}}return Oc(n),t}function ht(e,t){let n=Pc(e);if(n.overflow)return;let o=ie$1(n.instruction);o?.font&&t.push(o.font);}function Yt(e){let t="",n=[...e.children].reverse();for(;n.length>0&&t.length<=256;){let o=n.pop();if(o.kind==="textValue")t+=o.value;else for(let r=o.children.length-1;r>=0;r-=1)n.push(o.children[r]);}return t}var Gt=()=>true,Jt=/[ᄀ-ᇿ⺀-鿿ꥠ-꥿가-퟿豈-﫿︰-﹏＀-￯]/u;function no(e,t,n,o){if(!t)return [];let r=nd(t),i=kf(n,o),s=new Map;for(let a of e)for(let l of Qt(a)){let u=gd(l.children),c=f=>{if(f)for(let d of f.values()){let b=d.markerText===void 0||Jt.test(d.markerText);for(let v of [d.markerStyle.fontFamily,b?d.markerStyle.fontFamilyEastAsia:null]){let T=b$1(v??void 0);if(T===null)continue;let S=T.toLowerCase();s.has(S)||s.set(S,T);}}};c(Md(u,r,i,Gt));for(let f of u){let d=Lf(f);for(let b of d.contents)c(Kf(b,r,i));}}return [...s.values()].sort((a,l)=>a.localeCompare(l))}function Qt(e){if(e.localName==="document"){for(let t of e.children)if(t.kind!=="textValue"&&t.localName==="body")return [t];return []}if(e.localName==="footnotes"||e.localName==="endnotes"){let t=[];for(let n of e.children)n.kind!=="textValue"&&(n.localName==="footnote"||n.localName==="endnote")&&t.push(n);return t}return [e]}var Zt="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",wt=256,en=31;function J(e,t){return e.kind!=="textValue"&&e.localName===t&&e.namespaceUri===pa}function ae(e,t){return e.attributes.find(n=>n.localName===t&&n.namespaceUri===pa)?.value}function xt(e){let t=(e.relationships.get(e.mainDocumentPart)??[]).find(i=>i.type===Zt),n=t?N(t):void 0,r=((n?.mode==="Internal"&&n.target.ok?e.parts.get(n.target.partName):void 0)??e.parts.get("/word/fontTable.xml"))?.root;return r&&J(r,"fonts")?r:void 0}function bt(e,t){let n=e.children.find(o=>J(o,t));return n&&n.kind!=="textValue"?ae(n,"val"):void 0}function Et(e){let t=xt(e),n=new Map;if(!t)return n;let o=0;for(let r of t.children){if(!J(r,"font"))continue;if(++o>wt)break;let i=c$1(ae(r,"name"));if(!i)continue;let s=R(bt(r,"family"),bt(r,"pitch")),a=i.trim().toLowerCase();s&&!n.has(a)&&n.set(a,s);}return n}function Ct(e){let t=xt(e),n=new Map;if(!t)return n;let o=0;for(let r of t.children){if(!J(r,"font"))continue;if(++o>wt)break;let i=c$1(ae(r,"name"));if(!i)continue;let s=r.children.find(c=>J(c,"altName")),a=s&&s.kind!=="textValue"?ae(s,"val"):void 0,l=a!==void 0&&a.length<=en?a$1(a):null,u=i.trim().toLowerCase();l&&!n.has(u)&&n.set(u,l);}return n}function Co(e,t,n,o=[]){let r=new Set,i=new Set((o??[]).map(a=>a.from.family.trim().toLowerCase())),s=new Map;for(let a of e.substitutions??[]){let l=a.from.family.trim().toLowerCase();s.has(l)||s.set(l,a.to.family.trim().toLowerCase());}for(let a of e.substitutions??[]){let l=a.from.family.trim().toLowerCase(),u=a.to.family.trim().toLowerCase(),c=[t.alternates.get(l),t.fallbacks.get(l)].some(f=>{let d=f?.trim().toLowerCase();return d!==void 0&&d!==l&&(d===u||s.get(d)===u)});u!==l&&!i.has(l)&&c&&!(n.resolve(a.from)instanceof d)&&r.add(a.from.family.toLowerCase());}return r}function tn(e,t){return e.attributes.find(n=>n.localName===t&&n.namespaceUri===pa)?.value}var nn=new Set(["document","hdr","ftr","footnotes","endnotes","comments","styles","numbering","glossaryDocument"]),on=new Set(["t","delText","instrText","delInstrText"]),rn=2e6;function sn(e,t){let n=e.stylesRoot(),o=e.documentThemeFonts(),r=[...F(n),...n?xd(n).run:[]],i=ma(r,o),s=a$1(i.fontFamily??void 0)??t,a=a$1(Bc([{text:"\xE9",props:r,style:i,start:0,end:1}],o)[0]?.style.fontFamily??void 0)??s,l=a$1(i.fontFamilyEastAsia??void 0),u=a$1(i.complexLane?.fontFamily??void 0)??o.minorBidi??t,c=Et(e.currentPackage()),f=g=>c.get(g.trim().toLowerCase())??S(g),d=(g,E)=>{let y=f(g);if(!y)return E;let M=f(E);return M===void 0||M===y?E:T[y]},b=new Map,v=new Map,T$1=0;for(let g of e.currentPackage().parts.values()){if(g.root.namespaceUri!==pa||!nn.has(g.root.localName))continue;let E=[g.root];for(;E.length>0&&T$1<rn;){T$1++;let y=E.pop();if(y.kind!=="textValue"){if(y.namespaceUri===pa){if(on.has(y.localName))continue;if(y.localName==="rFonts"){for(let[M,R]of [["ascii",s],["hAnsi",a],["eastAsia",l],["cs",u]]){let D=a$1(b$2(tn(y,M))??void 0);if(!D||!R)continue;let F=D.trim().toLowerCase(),k=b.get(F)??new Set,X=M==="ascii"||M==="hAnsi",q=X?d(D,R):R;if(k.add(q),b.set(F,k),X&&f(D)){let B=v.get(F)??new Set;B.add(q),v.set(F,B);}}continue}}for(let M of y.children)E.push(M);}}}for(let g of a$2)b.delete(g);let S$1=new Map,P=[];for(let[g,E]of b){let y=v.get(g);E.size===1?S$1.set(g,[...E][0]):y?.size===1?S$1.set(g,[...y][0]):P.push(g);}return {fallbacks:S$1,ambiguousFamilies:P,defaults:new Map([...b].map(([g,E])=>[g,[...E]]))}}function an(e,t,n=[],o="Calibri"){let r=Ct(e.currentPackage()),i=sn(e,o),s=t.flatMap(u=>{let c=r.get(u.trim().toLowerCase());return c?[c]:[]}),a=new Map,l=t.flatMap(u=>i.defaults.get(u.trim().toLowerCase())??[]).filter(u=>u.trim().toLowerCase()!==o.trim().toLowerCase());for(let u of [...t,...s,...n,...l]){let c=a$1(u);if(c&&!a.has(c.trim().toLowerCase())&&a.set(c.trim().toLowerCase(),c),a.size===nt)break}return {families:[...a.values()],alternates:r,fallbacks:i.fallbacks,ambiguousFamilies:i.ambiguousFamilies}}function So(e,t,n){let o=te(n),r=an(e,t,[],o);return {plan:r,request:{families:r.families,defaultFamily:o}}}function Oo(e,t,n=t.fallbacks){let o=new Map(e.sources.map(u=>[h(u.request),u.request])),r=[],i=new Set((e.substitutions??[]).map(u=>h(u.from))),s=new Map((e.substitutions??[]).map(u=>[h(u.from),u])),a=u=>{let c=o.get(h(u));if(c)return {to:c};let f=s.get(h(u)),d=f&&o.get(h(f.to));if(!(!f||!d))return f.lineMetrics?{to:d,lineMetrics:f.lineMetrics}:{to:d}},l=Math.max(0,b-i.size);for(let u of t.families){let c=u.trim().toLowerCase(),f=t.alternates.get(c),d=n.get(c),b=ge$1(u);for(let v of [400,700])for(let T of ["normal","italic"]){let S={family:u,weight:v,style:T};if(o.has(h(S)))continue;let P=s.has(h(S));for(let g of P?[b,f]:[b,f,d]){if(!g||g.trim().toLowerCase()===c)continue;let E={family:g,weight:v,style:T},y=o.get(h(E)),M=P?y?{to:y}:void 0:a(E);if(!M)continue;if(!i.has(h(S))){if(l===0)break;l--;}let R=Q(u)?.em;r.push({from:S,...M,...R?{lineMetrics:R}:{}});break}}}return ee({...e,substitutions:[...r,...e.substitutions??[]]})}function Ao(e,t,n){let o=new Set((e.substitutions??[]).map(i=>h(i.from))),r=new Set;for(let i of t.substitutions??[]){if(o.has(h(i.from)))continue;let s=i.from.family.trim().toLowerCase(),a=i.to.family.trim().toLowerCase();[n.alternates.get(s),n.fallbacks.get(s)].some(u=>u?.trim().toLowerCase()===a)||r.add(s);}return r}function Ro(e,t){let n=new Map;for(let[o,r]of e)t(o)||n.set(o,r);return n}var ln={regular:{weight:400,style:"normal"},bold:{weight:700,style:"normal"},italic:{weight:400,style:"italic"},boldItalic:{weight:700,style:"italic"}};function Mo(e,t){let n=[],o=[],r=0;for(let i of e){let s=i.bytes.byteLength;if(!Number.isSafeInteger(s)||s>t||s>a||s>c-r){o.push(i);continue}r+=s,n.push(i);}return {sources:n,dropped:o}}function vo(e,t,n){let o=t.reduce((i,s)=>i+s.bytes.byteLength,0),r=new Set(t.filter(i=>i.request.family.trim().length>0).map(i=>h(i.request)));return un(e,{maxFontBytes:n,aggregateBudget:Math.max(0,c-o),shadowedRequests:r})}function un(e,t){let n=[],o=[],r=t.aggregateBudget,i=new Set;for(let s of e){let a=ln[s.style],l=Object.freeze({family:s.family,weight:a.weight,style:a.style});if(s.family.trim().length===0){o.push({request:l,partName:s.partName,reason:"malformed"});continue}let u=h(l);if(!(t.shadowedRequests?.has(u)||i.has(u))){if(i.add(u),s.bytes.byteLength>t.maxFontBytes||s.bytes.byteLength>r){o.push({request:l,partName:s.partName,reason:"overLimit"});continue}r-=s.bytes.byteLength,n.push({request:l,id:`embedded:${s.partName}#${s.style}`,bytes:s.bytes,hash:f$1(s.bytes),faceIndex:0});}}return {sources:n,dropped:o}}
2
- export{Wt as A,no as B,Co as C,an as D,So as E,Oo as F,Ao as G,Ro as H,Mo as I,vo as J,un as K,Y as a,mn as b,nt as c,ce as d,gn as e,ee as f,te as g,G as h,it as i,Rt as j,st as k,fe as l,kt as m,ft as n,En as o,Cn as p,ge as q,pe as r,Sn as s,On as t,Nn as u,ie as v,se as w,Ht as x,Xn as y,to as z};