@docx-editor.dev/core 2.17.0 → 2.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/THIRD_PARTY_NOTICES.md +2 -2
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +35 -8
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +9 -11
- package/dist/binding.js +1 -1
- package/dist/chunk-2ZEU42EA.js +2 -0
- package/dist/chunk-4DB7ZFQN.js +1 -0
- package/dist/chunk-4KMSEFIG.js +3 -0
- package/dist/chunk-72BDQFHY.js +18 -0
- package/dist/chunk-77DD4EBC.cjs +11 -0
- package/dist/chunk-BEOPUDAB.js +5 -0
- package/dist/chunk-CG7CP632.cjs +1 -0
- package/dist/chunk-CJCFEXTA.js +11 -0
- package/dist/chunk-DQS4KZUX.js +4 -0
- package/dist/chunk-FZ2BIMCY.cjs +2 -0
- package/dist/chunk-GUPITGJQ.cjs +2 -0
- package/dist/chunk-KDYD5TAW.cjs +1 -0
- package/dist/chunk-LQ6XWTKQ.cjs +18 -0
- package/dist/chunk-MDP5SNK4.cjs +3 -0
- package/dist/chunk-MRPPCGCX.cjs +20 -0
- package/dist/chunk-MSIFK7TJ.js +1 -0
- package/dist/chunk-NJONXJJY.cjs +4 -0
- package/dist/chunk-OODFC5R2.js +1 -0
- package/dist/chunk-P6VGDI57.js +2 -0
- package/dist/{chunk-UIB2MDE3.cjs → chunk-PBM6WERF.cjs} +1 -1
- package/dist/chunk-QBMAXYN7.js +20 -0
- package/dist/chunk-SUEX3CL7.cjs +5 -0
- package/dist/{chunk-UXAWPVH6.js → chunk-THCGTV53.js} +1 -1
- package/dist/{chunk-NO7U62I2.cjs → chunk-YVYEJBLL.cjs} +1 -1
- package/dist/chunk-ZKQX2PNF.cjs +1 -0
- package/dist/{chunk-XXLS6O6B.js → chunk-ZMM5RNM6.js} +1 -1
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +2 -4
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.cjs +1 -1
- package/dist/collaboration.d.ts +4 -6
- package/dist/collaboration.js +1 -1
- package/dist/contracts/editor.d.ts +9 -8
- package/dist/contracts/modules.d.ts +7 -9
- package/dist/{custom-node-writes-ClTkWM7s.d.ts → custom-node-writes-BqIv94ei.d.ts} +14 -2
- package/dist/document-protection-BL5zp8cU.d.ts +19 -0
- package/dist/{editor-BlerWPyk.d.ts → editor-WXbTSXx1.d.ts} +14 -7
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +1 -1
- package/dist/editor.d.ts +271 -30
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +15 -12
- package/dist/export.js +2 -2
- package/dist/{failure-BnGjoXf0.d.ts → failure-DNNmwsgD.d.ts} +1 -1
- package/dist/{font-resolver-DtADJcLL.d.ts → font-resolver-BSrKnTeR.d.ts} +5 -3
- package/dist/harfbuzz.wasm +0 -0
- package/dist/{headless-document-view-BDSeMGoK.d.ts → headless-document-view-C4ttQJ5H.d.ts} +11 -3
- package/dist/{index-D51bUVBE.d.ts → index-C3As-Xxp.d.ts} +133 -19
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +18 -19
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-rTElghj2.d.ts → layout-shaping-Dqu3JW3p.d.ts} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +23 -20
- package/dist/layout.js +1 -1
- package/dist/{note-properties-D5_fXW9K.d.ts → note-properties-RjYgbmXe.d.ts} +2 -2
- package/dist/{omml-equation-C9AJfWy5.d.ts → omml-equation-hcP9AUFX.d.ts} +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +16 -6
- package/dist/output.js +1 -1
- package/dist/{protocol-K-Djpjjw.d.ts → protocol-OdRd17KZ.d.ts} +172 -7
- package/dist/{review-items-CiliAz8H.d.ts → review-items-CJz-kAW8.d.ts} +2 -2
- package/dist/{review-paragraph-order-BlSnyg9a.d.ts → review-paragraph-order--jLHXIcd.d.ts} +3 -3
- package/dist/{revision-projection-JiDclAFU.d.ts → revision-projection-BIHO_qvw.d.ts} +1 -1
- package/dist/{semantic-cell-selection-C-VsxNee.d.ts → semantic-cell-selection-lCYAVCCF.d.ts} +6 -24
- package/dist/{semantic-interaction-2vPh96Ey.d.ts → semantic-interaction-0vQXcMZk.d.ts} +2 -19
- package/dist/{semantic-paint-BEjYcsPK.d.ts → semantic-paint-BSan4pBk.d.ts} +10 -2
- package/dist/{semantic-records-Bc-MGXbM.d.ts → semantic-records-ZcYuB4-H.d.ts} +59 -13
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +49 -42
- package/dist/store.js +1 -1
- package/dist/{tree-op-types-C71G7rIv.d.ts → tree-op-types-DbdM7fJV.d.ts} +84 -4
- package/dist/{tree-package-fragment-DRJkmfTW.d.ts → tree-package-fragment-1pdDnhZ_.d.ts} +491 -23
- package/dist/{tree-session-contract-Cp5W25RC.d.ts → tree-session-contract-Cgn6fQ-M.d.ts} +34 -9
- package/package.json +4 -4
- package/dist/chunk-27YEILW4.cjs +0 -20
- package/dist/chunk-4RDCLCLB.js +0 -2
- package/dist/chunk-7QG5FJ4X.js +0 -1
- package/dist/chunk-BML3CNUT.js +0 -2
- package/dist/chunk-CHRMIA3I.js +0 -20
- package/dist/chunk-FRRMJK2G.js +0 -5
- package/dist/chunk-G5GLQ4SX.cjs +0 -1
- package/dist/chunk-JP253KIZ.cjs +0 -2
- package/dist/chunk-JROG4U3Z.cjs +0 -21
- package/dist/chunk-MBXGQN6J.js +0 -1
- package/dist/chunk-MDMM3XVQ.js +0 -11
- package/dist/chunk-NPZX5O23.cjs +0 -2
- package/dist/chunk-OISZDVXT.cjs +0 -5
- package/dist/chunk-PRNYSOQL.cjs +0 -1
- package/dist/chunk-RXPOTTQQ.js +0 -21
- package/dist/chunk-T7JERNXT.cjs +0 -2
- package/dist/chunk-TDMGSCCL.cjs +0 -1
- package/dist/chunk-VYQTZIYH.js +0 -1
- package/dist/chunk-W7GY2IJC.js +0 -2
- package/dist/chunk-ZFBNCHRP.cjs +0 -11
- package/dist/hf-references-kSSFMq9X.d.ts +0 -70
- package/dist/tree-store-BRfhZceK.d.ts +0 -416
- /package/dist/{dist-OSUJGKTK.js → dist-PKZR6RSH.js} +0 -0
package/README.md
CHANGED
|
@@ -88,7 +88,7 @@ const bytes = new Uint8Array(await readFile('contract.docx'));
|
|
|
88
88
|
const opened = await openFontBackedDocumentForExport(bytes, {
|
|
89
89
|
// First wins: put caller-supplied licensed fonts first, bundled metric substitutes next,
|
|
90
90
|
// and an optional network resolver last.
|
|
91
|
-
fonts: [callerFonts, packagedFonts(
|
|
91
|
+
fonts: [callerFonts, packagedFonts(), optionalNetworkFonts],
|
|
92
92
|
fontPolicy: 'strict',
|
|
93
93
|
onFontResolution: (report) => auditLogger.info(report),
|
|
94
94
|
});
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -23,11 +23,11 @@ so they cannot appear below. Their licenses travel with the package in
|
|
|
23
23
|
|
|
24
24
|
## Bundled packages
|
|
25
25
|
|
|
26
|
-
- harfbuzzjs 1.6.
|
|
26
|
+
- harfbuzzjs 1.6.1 — MIT (https://harfbuzz.github.io/harfbuzzjs)
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
30
|
-
## harfbuzzjs 1.6.
|
|
30
|
+
## harfbuzzjs 1.6.1
|
|
31
31
|
|
|
32
32
|
License: MIT
|
|
33
33
|
|
package/dist/automation.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkGUPITGJQ_cjs=require('./chunk-GUPITGJQ.cjs');require('./chunk-ZKQX2PNF.cjs'),require('./chunk-LQ6XWTKQ.cjs'),require('./chunk-YVYEJBLL.cjs'),require('./chunk-FGBADUSK.cjs');var chunkMDP5SNK4_cjs=require('./chunk-MDP5SNK4.cjs'),chunkPBM6WERF_cjs=require('./chunk-PBM6WERF.cjs'),chunk77DD4EBC_cjs=require('./chunk-77DD4EBC.cjs');var D=Object.freeze({document:true,save:true,events:true,selection:false,scrolling:false,layout:false}),_=Object.freeze({kind:"body"});function V(o,t={}){let m=chunk77DD4EBC_cjs.dc(o,t.limits??{});if(!m.ok)return {ok:false,reason:m.reason,...m.limit===void 0?{}:{limit:m.limit},...m.detail?{detail:m.detail}:{}};let p=m.package.parts.get(m.package.mainDocumentPart);if(!p)return {ok:false,reason:"no-main-document-part",detail:m.package.mainDocumentPart};let u=new chunkMDP5SNK4_cjs.O(m.package,chunk77DD4EBC_cjs.Kb(p)),g=t.collaborationModel?.session,c=()=>{},n=K(u,g,()=>c());if(t.pagination){let i,l=-1,e=t.pagination;n.prepare=async f=>{if(!f.operations.some(s=>s.op==="updateFieldResult"))return;i=void 0;let a=u.packageRevision,d=await e(chunkMDP5SNK4_cjs._a(u));u.packageRevision===a&&(i=d,l=a);},n.fieldPageContext=(f,a,d)=>{if(u.packageRevision!==l)return null;let s=chunkGUPITGJQ_cjs.e(u.currentPackage()).story(f);return s?chunkGUPITGJQ_cjs.b(i,s.part,a,d):null};}let r=chunkGUPITGJQ_cjs.k({port:n,capabilities:D});return g&&(c=g.attach(chunkPBM6WERF_cjs.b(u,{documentId:g.documentId}))),{ok:true,host:r}}function Y(o,t,m){let p=o.partFor(m);return p?chunk77DD4EBC_cjs.Ba(o,()=>{let u=chunk77DD4EBC_cjs.qf(o.currentPackage(),t,p.name);return u?(o.replacePackageShell(u.pkg),u.relationshipId):null},u=>u!==null):null}function K(o,t,m=()=>{}){let p=true,u=0,g=()=>t?(u+=1,{origin:t.identity.role==="agent"?chunk77DD4EBC_cjs.b.mutationAgent:chunk77DD4EBC_cjs.b.mutationHuman,actorId:t.identity.actorId,operationId:`${t.identity.actorId}:${t.sessionId}:automation:${u}`,recordsHistory:false}):{},c=n=>(t?.flushPendingJournals(),n);return {localChangeTracking:true,revision:()=>o.packageRevision,currentPackage:()=>p?o.currentPackage():null,apply(n,r=_,i=[]){if(!p)return {ok:false,reason:"disposed"};let l=n(d=>chunk77DD4EBC_cjs.Mb(t?.identity.actorId,()=>Y(o,d,r)));if(l===null)return {ok:false,reason:"unsupported-target"};let e=t?.gateOperations(l,r);if(e)return {ok:false,reason:e};let f=t?o.partFor(r)?.name:void 0,a=o.transact(r,d=>{for(let s of i)d.applyPackage(s);for(let s of l)d.apply(s);f&&d.applyPackage(s=>chunkPBM6WERF_cjs.a(s,f,l));},g());return a.ok?c({ok:true,changed:a.change!==null}):{ok:false,reason:a.detail?`${a.reason}: ${a.detail}`:a.reason}},applyLifecycle(n){if(!p)return {ok:false,reason:"disposed"};let r=t?.gateOperations([n],_);if(r)return {ok:false,reason:r};let i=chunk77DD4EBC_cjs.Mb(t?.identity.actorId,()=>o.applyLifecycleOp(n));return i.ok?c({ok:true,changed:i.change!==null}):{ok:false,reason:i.detail?`${i.reason}: ${i.detail}`:i.reason}},applyCommentWrites(n,r){if(!p)return {ok:false,reason:"disposed"};if(n.length===0)return {ok:true,changed:false};let i=t?.gateOperations([],r);if(i)return {ok:false,reason:i};let l=o.resolveStory(r);if(!l.ok)return {ok:false,reason:l.reason};if(l.store.graftPackage(()=>o.currentPackage()),n.every(a=>a.kind==="delete")){let a=n.find(s=>s.kind==="delete"),d=chunk77DD4EBC_cjs.Mb(t?.identity.actorId,()=>chunkMDP5SNK4_cjs.$(o,n.flatMap(s=>s.kind==="delete"?[{commentId:s.commentId,...s.parentCommentId===void 0?{}:{parentCommentId:s.parentCommentId}}]:[]),r,a?.kind==="delete"?a.noteId:void 0));return d?c({ok:true,changed:d}):{ok:false,reason:"comment-delete-refused"}}if(n.length!==1)return {ok:false,reason:"mixed-comment-writes"};let e=n[0];if(e.kind==="create"||e.kind==="reply"){let a=chunk77DD4EBC_cjs.Mb(t?.identity.actorId,()=>chunkMDP5SNK4_cjs.Z(o,{anchor:e.anchor,author:e.author,text:e.text,...e.date===void 0?{}:{date:e.date},...e.kind==="reply"?{replyToCommentId:e.parentCommentId}:{}},r));return a.ok?c({ok:true,changed:true,..."commentId"in a?{commentId:a.commentId}:{}}):{ok:false,reason:a.reason}}if(e.kind!=="resolve")return {ok:false,reason:"unsupported-comment-write"};let f=chunk77DD4EBC_cjs.Mb(t?.identity.actorId,()=>chunkMDP5SNK4_cjs._(o,e.commentId,e.resolved));return f.ok?c({ok:true,changed:true}):{ok:false,reason:f.reason}},applyCustomNodeWrite(n,r){if(!p)return {ok:false,reason:"disposed"};let i=t?.gateOperations([],r);if(i)return {ok:false,reason:i};let l=o.resolveStory(r);if(!l.ok)return {ok:false,reason:l.reason};let e=chunk77DD4EBC_cjs.Mb(t?.identity.actorId,()=>chunkMDP5SNK4_cjs.ha(o,n,r));return e.ok?c({ok:true,changed:e.change!==null}):{ok:false,reason:e.detail?`${e.reason}: ${e.detail}`:e.reason}},save:()=>p?chunk77DD4EBC_cjs.ec(o.currentPackage()):null,subscribe:n=>o.subscribe(()=>n()),dispose(){m(),p=false;}}}Object.defineProperty(exports,"AUTOMATION_COMMAND_OPERATIONS",{enumerable:true,get:function(){return chunkGUPITGJQ_cjs.g}});Object.defineProperty(exports,"AUTOMATION_QUERY_OPERATIONS",{enumerable:true,get:function(){return chunkGUPITGJQ_cjs.f}});Object.defineProperty(exports,"AUTOMATION_SOLITARY_OPERATIONS",{enumerable:true,get:function(){return chunkGUPITGJQ_cjs.h}});Object.defineProperty(exports,"HEADER_FOOTER_VARIANTS",{enumerable:true,get:function(){return chunkGUPITGJQ_cjs.d}});Object.defineProperty(exports,"createAutomationPaginationProvider",{enumerable:true,get:function(){return chunkGUPITGJQ_cjs.c}});Object.defineProperty(exports,"isAutomationCommand",{enumerable:true,get:function(){return chunkGUPITGJQ_cjs.j}});Object.defineProperty(exports,"isSolitaryAutomationCommand",{enumerable:true,get:function(){return chunkGUPITGJQ_cjs.i}});Object.defineProperty(exports,"paginationSnapshotOf",{enumerable:true,get:function(){return chunkGUPITGJQ_cjs.a}});exports.SERVER_AUTOMATION_CAPABILITIES=D;exports.createServerAutomationHost=V;
|
package/dist/automation.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { A as AutomationCapabilities, a as AutomationHost } from './protocol-
|
|
2
|
-
export { b as AUTOMATION_COMMAND_OPERATIONS, c as AUTOMATION_QUERY_OPERATIONS, d as AUTOMATION_SOLITARY_OPERATIONS, e as AutomationAlignment, f as AutomationBatchRequest, g as AutomationBatchResponse, h as AutomationChangeEvent, i as AutomationContentControlLock, j as AutomationContentControlRangeLocation, k as AutomationContentControlScope, l as AutomationContentControlSubtype, m as AutomationContentControlValue, n as AutomationError, o as AutomationErrorCode, p as AutomationFontRead, q as AutomationFontWrite, r as AutomationHandle, s as AutomationHandleRef, t as AutomationObjectKind, u as AutomationOperation, v as AutomationOperationKind, w as AutomationOperationResult, x as AutomationPageOrientation, y as AutomationPageSetupRead, z as AutomationPageSetupWrite, B as AutomationParagraphFormatRead, C as AutomationParagraphFormatWrite, D as AutomationParagraphRef, E as AutomationPoint, F as AutomationSaveResult, G as AutomationSearchOptions, H as AutomationSelectionMode, I as AutomationSpan, J as AutomationSpanRef, K as AutomationTextProjection, L as AutomationUnsubscribe, M as AutomationValue, N as isAutomationCommand, O as isSolitaryAutomationCommand } from './protocol-
|
|
3
|
-
import { H as HeaderFooterVariant } from './
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { A as AutomationCapabilities, a as AutomationHost } from './protocol-OdRd17KZ.js';
|
|
2
|
+
export { b as AUTOMATION_COMMAND_OPERATIONS, c as AUTOMATION_QUERY_OPERATIONS, d as AUTOMATION_SOLITARY_OPERATIONS, e as AutomationAlignment, f as AutomationBatchRequest, g as AutomationBatchResponse, h as AutomationChangeEvent, i as AutomationContentControlLock, j as AutomationContentControlRangeLocation, k as AutomationContentControlScope, l as AutomationContentControlSubtype, m as AutomationContentControlValue, n as AutomationError, o as AutomationErrorCode, p as AutomationFontRead, q as AutomationFontWrite, r as AutomationHandle, s as AutomationHandleRef, t as AutomationObjectKind, u as AutomationOperation, v as AutomationOperationKind, w as AutomationOperationResult, x as AutomationPageOrientation, y as AutomationPageSetupRead, z as AutomationPageSetupWrite, B as AutomationParagraphFormatRead, C as AutomationParagraphFormatWrite, D as AutomationParagraphRef, E as AutomationPoint, F as AutomationSaveResult, G as AutomationSearchOptions, H as AutomationSelectionMode, I as AutomationSpan, J as AutomationSpanRef, K as AutomationTextProjection, L as AutomationUnsubscribe, M as AutomationValue, N as isAutomationCommand, O as isSolitaryAutomationCommand } from './protocol-OdRd17KZ.js';
|
|
3
|
+
import { H as HeaderFooterVariant, N as NoteKind } from './tree-package-fragment-1pdDnhZ_.js';
|
|
4
|
+
import { T as TextMeasurer, S as SemanticLayout } from './semantic-records-ZcYuB4-H.js';
|
|
5
|
+
import { H as HeadlessDocumentView } from './headless-document-view-C4ttQJ5H.js';
|
|
6
|
+
import { f as OoxmlPackageLimits, g as OoxmlPackageRejection } from './tree-op-types-DbdM7fJV.js';
|
|
6
7
|
import { CollaborationModuleContribution } from './collaboration.js';
|
|
8
|
+
import './revision-projection-BIHO_qvw.js';
|
|
9
|
+
import './omml-equation-hcP9AUFX.js';
|
|
7
10
|
import './contracts/types.js';
|
|
8
|
-
import './tree-package-fragment-DRJkmfTW.js';
|
|
9
11
|
import './collaboration/replication.js';
|
|
10
|
-
import './failure-
|
|
12
|
+
import './failure-DNNmwsgD.js';
|
|
11
13
|
|
|
12
14
|
/** The variants a section can declare furniture for. */
|
|
13
15
|
declare const HEADER_FOOTER_VARIANTS: readonly HeaderFooterVariant[];
|
|
@@ -32,6 +34,29 @@ type AutomationStoryId = {
|
|
|
32
34
|
readonly noteId: number;
|
|
33
35
|
};
|
|
34
36
|
|
|
37
|
+
/** Measured page positions used by field updates; no guessed page counts. @public */
|
|
38
|
+
interface AutomationPaginationSnapshot {
|
|
39
|
+
readonly pageCount: number;
|
|
40
|
+
readonly ranges: readonly {
|
|
41
|
+
readonly paragraphId: string;
|
|
42
|
+
readonly start: number;
|
|
43
|
+
readonly end: number;
|
|
44
|
+
readonly pageNumber: number;
|
|
45
|
+
readonly pageNumberText: string;
|
|
46
|
+
}[];
|
|
47
|
+
}
|
|
48
|
+
/** A host settles fonts/images and paginates the supplied canonical view. @public */
|
|
49
|
+
type AutomationPaginationProvider = (view: HeadlessDocumentView) => Promise<AutomationPaginationSnapshot>;
|
|
50
|
+
/** Convert actual semantic pages into field-update positions. @public */
|
|
51
|
+
declare function paginationSnapshotOf(layout: SemanticLayout): AutomationPaginationSnapshot;
|
|
52
|
+
/** Explicit measurement inputs for headless field calculation. @public */
|
|
53
|
+
interface AutomationPaginationOptions {
|
|
54
|
+
readonly measurer: TextMeasurer;
|
|
55
|
+
readonly producer?: string;
|
|
56
|
+
}
|
|
57
|
+
/** Create a DOM-free pagination provider using the engine's measured export layout. @public */
|
|
58
|
+
declare function createAutomationPaginationProvider(options: AutomationPaginationOptions): AutomationPaginationProvider;
|
|
59
|
+
|
|
35
60
|
/** What a headless host can do. It paints nothing, so it claims nothing about painting. */
|
|
36
61
|
declare const SERVER_AUTOMATION_CAPABILITIES: AutomationCapabilities;
|
|
37
62
|
/**
|
|
@@ -60,6 +85,8 @@ type ServerAutomationHostResult = {
|
|
|
60
85
|
* @public
|
|
61
86
|
*/
|
|
62
87
|
interface ServerAutomationHostOptions {
|
|
88
|
+
/** Optional real pagination for PAGE/NUMPAGES updates. */
|
|
89
|
+
readonly pagination?: AutomationPaginationProvider;
|
|
63
90
|
/**
|
|
64
91
|
* Budgets for the bounded reader — archive size, part count, and XML elements.
|
|
65
92
|
*
|
|
@@ -82,4 +109,4 @@ interface ServerAutomationHostOptions {
|
|
|
82
109
|
*/
|
|
83
110
|
declare function createServerAutomationHost(bytes: Uint8Array, options?: ServerAutomationHostOptions): ServerAutomationHostResult;
|
|
84
111
|
|
|
85
|
-
export { AutomationCapabilities, AutomationHost, type AutomationStoryId, HEADER_FOOTER_VARIANTS, SERVER_AUTOMATION_CAPABILITIES, type ServerAutomationHostOptions, type ServerAutomationHostRejection, type ServerAutomationHostResult, createServerAutomationHost };
|
|
112
|
+
export { AutomationCapabilities, AutomationHost, type AutomationPaginationOptions, type AutomationPaginationProvider, type AutomationPaginationSnapshot, type AutomationStoryId, HEADER_FOOTER_VARIANTS, SERVER_AUTOMATION_CAPABILITIES, type ServerAutomationHostOptions, type ServerAutomationHostRejection, type ServerAutomationHostResult, createAutomationPaginationProvider, createServerAutomationHost, paginationSnapshotOf };
|
package/dist/automation.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {k,e,b as b$1}from'./chunk-P6VGDI57.js';export{g as AUTOMATION_COMMAND_OPERATIONS,f as AUTOMATION_QUERY_OPERATIONS,h as AUTOMATION_SOLITARY_OPERATIONS,d as HEADER_FOOTER_VARIANTS,c as createAutomationPaginationProvider,j as isAutomationCommand,i as isSolitaryAutomationCommand,a as paginationSnapshotOf}from'./chunk-P6VGDI57.js';import'./chunk-MSIFK7TJ.js';import'./chunk-72BDQFHY.js';import'./chunk-THCGTV53.js';import'./chunk-VP7SDFCM.js';import {O,_a,ha,$,Z,_ as _$1}from'./chunk-4KMSEFIG.js';import {b,a}from'./chunk-ZMM5RNM6.js';import {dc,Kb,ec,Mb,Ba,qf,b as b$2}from'./chunk-CJCFEXTA.js';var D=Object.freeze({document:true,save:true,events:true,selection:false,scrolling:false,layout:false}),_=Object.freeze({kind:"body"});function V(o,t={}){let m=dc(o,t.limits??{});if(!m.ok)return {ok:false,reason:m.reason,...m.limit===void 0?{}:{limit:m.limit},...m.detail?{detail:m.detail}:{}};let p=m.package.parts.get(m.package.mainDocumentPart);if(!p)return {ok:false,reason:"no-main-document-part",detail:m.package.mainDocumentPart};let u=new O(m.package,Kb(p)),g=t.collaborationModel?.session,c=()=>{},n=K(u,g,()=>c());if(t.pagination){let i,l=-1,e$1=t.pagination;n.prepare=async f=>{if(!f.operations.some(s=>s.op==="updateFieldResult"))return;i=void 0;let a=u.packageRevision,d=await e$1(_a(u));u.packageRevision===a&&(i=d,l=a);},n.fieldPageContext=(f,a,d)=>{if(u.packageRevision!==l)return null;let s=e(u.currentPackage()).story(f);return s?b$1(i,s.part,a,d):null};}let r=k({port:n,capabilities:D});return g&&(c=g.attach(b(u,{documentId:g.documentId}))),{ok:true,host:r}}function Y(o,t,m){let p=o.partFor(m);return p?Ba(o,()=>{let u=qf(o.currentPackage(),t,p.name);return u?(o.replacePackageShell(u.pkg),u.relationshipId):null},u=>u!==null):null}function K(o,t,m=()=>{}){let p=true,u=0,g=()=>t?(u+=1,{origin:t.identity.role==="agent"?b$2.mutationAgent:b$2.mutationHuman,actorId:t.identity.actorId,operationId:`${t.identity.actorId}:${t.sessionId}:automation:${u}`,recordsHistory:false}):{},c=n=>(t?.flushPendingJournals(),n);return {localChangeTracking:true,revision:()=>o.packageRevision,currentPackage:()=>p?o.currentPackage():null,apply(n,r=_,i=[]){if(!p)return {ok:false,reason:"disposed"};let l=n(d=>Mb(t?.identity.actorId,()=>Y(o,d,r)));if(l===null)return {ok:false,reason:"unsupported-target"};let e=t?.gateOperations(l,r);if(e)return {ok:false,reason:e};let f=t?o.partFor(r)?.name:void 0,a$1=o.transact(r,d=>{for(let s of i)d.applyPackage(s);for(let s of l)d.apply(s);f&&d.applyPackage(s=>a(s,f,l));},g());return a$1.ok?c({ok:true,changed:a$1.change!==null}):{ok:false,reason:a$1.detail?`${a$1.reason}: ${a$1.detail}`:a$1.reason}},applyLifecycle(n){if(!p)return {ok:false,reason:"disposed"};let r=t?.gateOperations([n],_);if(r)return {ok:false,reason:r};let i=Mb(t?.identity.actorId,()=>o.applyLifecycleOp(n));return i.ok?c({ok:true,changed:i.change!==null}):{ok:false,reason:i.detail?`${i.reason}: ${i.detail}`:i.reason}},applyCommentWrites(n,r){if(!p)return {ok:false,reason:"disposed"};if(n.length===0)return {ok:true,changed:false};let i=t?.gateOperations([],r);if(i)return {ok:false,reason:i};let l=o.resolveStory(r);if(!l.ok)return {ok:false,reason:l.reason};if(l.store.graftPackage(()=>o.currentPackage()),n.every(a=>a.kind==="delete")){let a=n.find(s=>s.kind==="delete"),d=Mb(t?.identity.actorId,()=>$(o,n.flatMap(s=>s.kind==="delete"?[{commentId:s.commentId,...s.parentCommentId===void 0?{}:{parentCommentId:s.parentCommentId}}]:[]),r,a?.kind==="delete"?a.noteId:void 0));return d?c({ok:true,changed:d}):{ok:false,reason:"comment-delete-refused"}}if(n.length!==1)return {ok:false,reason:"mixed-comment-writes"};let e=n[0];if(e.kind==="create"||e.kind==="reply"){let a=Mb(t?.identity.actorId,()=>Z(o,{anchor:e.anchor,author:e.author,text:e.text,...e.date===void 0?{}:{date:e.date},...e.kind==="reply"?{replyToCommentId:e.parentCommentId}:{}},r));return a.ok?c({ok:true,changed:true,..."commentId"in a?{commentId:a.commentId}:{}}):{ok:false,reason:a.reason}}if(e.kind!=="resolve")return {ok:false,reason:"unsupported-comment-write"};let f=Mb(t?.identity.actorId,()=>_$1(o,e.commentId,e.resolved));return f.ok?c({ok:true,changed:true}):{ok:false,reason:f.reason}},applyCustomNodeWrite(n,r){if(!p)return {ok:false,reason:"disposed"};let i=t?.gateOperations([],r);if(i)return {ok:false,reason:i};let l=o.resolveStory(r);if(!l.ok)return {ok:false,reason:l.reason};let e=Mb(t?.identity.actorId,()=>ha(o,n,r));return e.ok?c({ok:true,changed:e.change!==null}):{ok:false,reason:e.detail?`${e.reason}: ${e.detail}`:e.reason}},save:()=>p?ec(o.currentPackage()):null,subscribe:n=>o.subscribe(()=>n()),dispose(){m(),p=false;}}}export{D as SERVER_AUTOMATION_CAPABILITIES,V as createServerAutomationHost};
|
package/dist/binding.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkSUEX3CL7_cjs=require('./chunk-SUEX3CL7.cjs');require('./chunk-CG7CP632.cjs'),require('./chunk-YVYEJBLL.cjs'),require('./chunk-FGBADUSK.cjs'),require('./chunk-MDP5SNK4.cjs'),require('./chunk-PBM6WERF.cjs'),require('./chunk-77DD4EBC.cjs');Object.defineProperty(exports,"PROJECTION_ORIGIN",{enumerable:true,get:function(){return chunkSUEX3CL7_cjs.k}});Object.defineProperty(exports,"bodyParagraphs",{enumerable:true,get:function(){return chunkSUEX3CL7_cjs.c}});Object.defineProperty(exports,"docToTreeOps",{enumerable:true,get:function(){return chunkSUEX3CL7_cjs.f}});Object.defineProperty(exports,"mountTreeSurface",{enumerable:true,get:function(){return chunkSUEX3CL7_cjs.l}});Object.defineProperty(exports,"openTreeSession",{enumerable:true,get:function(){return chunkSUEX3CL7_cjs.j}});Object.defineProperty(exports,"partHasNode",{enumerable:true,get:function(){return chunkSUEX3CL7_cjs.g}});Object.defineProperty(exports,"reconcileDoc",{enumerable:true,get:function(){return chunkSUEX3CL7_cjs.h}});Object.defineProperty(exports,"runPropsOf",{enumerable:true,get:function(){return chunkSUEX3CL7_cjs.b}});Object.defineProperty(exports,"treeSchema",{enumerable:true,get:function(){return chunkSUEX3CL7_cjs.a}});Object.defineProperty(exports,"treeToDoc",{enumerable:true,get:function(){return chunkSUEX3CL7_cjs.e}});
|
package/dist/binding.d.ts
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import { Node, Schema } from 'prosemirror-model';
|
|
2
|
-
import {
|
|
3
|
-
import { T as TreeDocxSessionView, a as TreeApplyResult } from './tree-session-contract-
|
|
4
|
-
export { D as DocumentStyleEntry, M as MapResult, b as TreeApplyOptions, c as TreeBindingRejection, d as bodyParagraphs, e as docToTreeOps, p as partHasNode, r as reconcileDoc, t as treeToDoc } from './tree-session-contract-
|
|
2
|
+
import { h as OoxmlProperty, g as OoxmlPackageRejection } from './tree-op-types-DbdM7fJV.js';
|
|
3
|
+
import { T as TreeDocxSessionView, a as TreeApplyResult } from './tree-session-contract-Cgn6fQ-M.js';
|
|
4
|
+
export { D as DocumentStyleEntry, M as MapResult, b as TreeApplyOptions, c as TreeBindingRejection, d as bodyParagraphs, e as docToTreeOps, p as partHasNode, r as reconcileDoc, t as treeToDoc } from './tree-session-contract-Cgn6fQ-M.js';
|
|
5
5
|
import { ReviewModuleContribution } from './contracts/modules.js';
|
|
6
|
-
export { S as StoryScope, a as StoryTargetRejection } from './tree-package-fragment-
|
|
6
|
+
export { S as StoryScope, a as StoryTargetRejection } from './tree-package-fragment-1pdDnhZ_.js';
|
|
7
7
|
import { EditorView } from 'prosemirror-view';
|
|
8
8
|
import './contracts/types.js';
|
|
9
|
-
import './
|
|
10
|
-
import './
|
|
11
|
-
import './
|
|
12
|
-
import './headless-document-view-BDSeMGoK.js';
|
|
13
|
-
import './review-items-CiliAz8H.js';
|
|
9
|
+
import './custom-node-writes-BqIv94ei.js';
|
|
10
|
+
import './headless-document-view-C4ttQJ5H.js';
|
|
11
|
+
import './review-items-CJz-kAW8.js';
|
|
14
12
|
import './collaboration/replication.js';
|
|
15
13
|
import './editor-scope-DZJT4ukT.js';
|
|
16
14
|
import './collaboration.js';
|
|
17
|
-
import './failure-
|
|
18
|
-
import './revision-projection-
|
|
15
|
+
import './failure-DNNmwsgD.js';
|
|
16
|
+
import './revision-projection-BIHO_qvw.js';
|
|
19
17
|
|
|
20
18
|
/** Attributes carried by a projected paragraph. */
|
|
21
19
|
interface ParagraphAttrs {
|
package/dist/binding.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{k as PROJECTION_ORIGIN,c as bodyParagraphs,f as docToTreeOps,l as mountTreeSurface,j as openTreeSession,g as partHasNode,h as reconcileDoc,b as runPropsOf,a as treeSchema,e as treeToDoc}from'./chunk-
|
|
1
|
+
export{k as PROJECTION_ORIGIN,c as bodyParagraphs,f as docToTreeOps,l as mountTreeSurface,j as openTreeSession,g as partHasNode,h as reconcileDoc,b as runPropsOf,a as treeSchema,e as treeToDoc}from'./chunk-BEOPUDAB.js';import'./chunk-4DB7ZFQN.js';import'./chunk-THCGTV53.js';import'./chunk-VP7SDFCM.js';import'./chunk-4KMSEFIG.js';import'./chunk-ZMM5RNM6.js';import'./chunk-CJCFEXTA.js';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {$}from'./chunk-DQS4KZUX.js';import {C as C$1,La,E,Da,Ua,Aa,Ba,Q,A as A$1,zb,m,z as z$1,F as F$1,H,yb}from'./chunk-72BDQFHY.js';var L=8,Le={color:"painted",background:"painted",activeBackground:"painted",spanClassName:"painted",avatarUrl:"card-only"},$e=Object.keys(Le),kt=$e.filter(t=>Le[t]==="painted"),At=new Set(["http","https","data","blob"]),Pt=/^([a-zA-Z][a-zA-Z0-9+.-]*):/;function Et(t){let e=t.replace(/[\u0000-\u0020\u007f]/g,"");if(e.length===0)return;let n=Pt.exec(e);if(n)return !At.has(n[1].toLowerCase())||/^data:/i.test(e)&&!/^data:image\/(?!svg)/i.test(e)?void 0:e;let r=i=>e[i]==="/"||e[i]==="\\";return r(0)&&r(1)?void 0:e}function Lt(t){if(typeof t=="string")return t.length>0?{color:t}:null;if(t===null||typeof t!="object")return null;let e={},n=Object.prototype.hasOwnProperty;for(let r of $e){if(!n.call(t,r))continue;let i=t[r];if(!(typeof i!="string"||i.length===0)){if(r==="avatarUrl"){let o=Et(i);o!==void 0&&(e.avatarUrl=o);continue}e[r]=i;}}return Object.keys(e).length>0?e:null}function W(t){return `var(--doc-review-author-${t%L})`}function Me(t){let e=new Map;if(t===void 0||t==="kind"||t==="author")return e;for(let[n,r]of Object.entries(t.authors)){let i=Lt(r);i&&e.set(n,i);}return e}function Yn(t,e){let n=Me(e);return [...t].map(([r,i])=>{let o=n.get(r);return {author:r,slot:i,color:o?.color??W(i),...o?{style:o}:{}}})}var $t=128;function G(t,e,n=$t){let r=e.length<n?e.length:n,i=t;for(let o=0;o<r;o+=1)i=Math.imul(i^e.charCodeAt(o),16777619);return Math.imul(i^e.length,16777619)}function Mt(t,e,n){let r=G(2166136261,n);for(let i of t.keys())r=G(r,i);for(let[i,o]of e){r=G(r,i);for(let a of kt)r=G(r,o[a]??"",1/0);}return `${t.size}.${e.size}.${(r>>>0).toString(36)}`}function Te(t){return t===null?"kind":t.key}var ee=new WeakMap;function De(t,e,n){if(t==="kind")return null;let r=ee.get(e);if(r&&r.option===t&&r.authorSlots===n)return r.context;let i=Me(t),o=t===void 0||t==="author"?"author":t.others??"author";if(i.size===0&&o==="kind")return ee.set(e,{option:t,authorSlots:n,context:null}),null;let a=n??Dt(e),s=new Map;for(let[d,c]of i){if(!c.spanClassName)continue;let y=c.spanClassName.split(/\s+/).filter(p=>p.length>0);y.length>0&&s.set(d,y);}let l={authorSlots:a,styles:i,classTokens:s,others:o,key:Mt(a,i,o)};return ee.set(e,{option:t,authorSlots:n,context:l}),l}var Pe=new WeakMap;function Tt(t){let e=Pe.get(t);if(e)return e;let n=[],r=new Set,i=o=>{o===""||r.has(o)||(r.add(o),n.push(o));};for(let o of C$1(t)){for(let s of o.lines)for(let l of s.spans){let d=l.revisions;if(d!==void 0)for(let c=0;c<d.length;c+=1)i(d[c].author);for(let c of l.props){if(c.localName!=="rPrChange"&&c.localName!=="pPrChange")continue;let y=c.attributes?.author;i(y??"");break}}for(let s of o.lines){let l=s.drawings;if(l!==void 0)for(let d=0;d<l.length;d+=1){let c=l[d].revisions;if(c!==void 0)for(let y=0;y<c.length;y+=1)i(c[y].author);}}let a=o.markRevisions;if(a)for(let s=0;s<a.length;s+=1)i(a[s].author);}return Pe.set(t,n),n}var Ee=new WeakMap;function Dt(t){let e=Ee.get(t);if(e)return e;let n=new Map,r=i=>{for(let o of Tt(i))n.has(o)||n.set(o,n.size);};for(let i of t.pages){r(i.fragments),i.header&&r(i.header.fragments),i.footer&&r(i.footer.fragments);for(let o of [i.footnotes,i.endnotes])if(o){o.separator&&r(o.separator.fragments);for(let a of o.notes)r(a.fragments);}for(let o of [i.anchoredDrawings,i.header?.anchoredDrawings,i.footer?.anchoredDrawings])if(o)for(let a of o){let s=a.revisions;if(s!==void 0)for(let l=0;l<s.length;l+=1){let d=s[l].author;d!==""&&!n.has(d)&&n.set(d,n.size);}a.textboxStory&&r(a.textboxStory.fragments);}}return Ee.set(t,n),n}function Ht(t,e){let n=null;for(let r of e)r===""||t.has(r)||(n===null&&(n=new Map(t)),n.has(r)||n.set(r,n.size));return n??t}function Zn(){let t=new Map,e=0;return {resolve(n,r){let i=Ht(n,r);for(let o of i.keys())t.has(o)||(t.set(o,e),e+=1);return new Map([...i.keys()].map(o=>[o,t.get(o)]).sort((o,a)=>o[1]-a[1]))}}}function C(t,e,n){if(t===void 0||t.length===0)return null;let r=t[t.length-1],i=t.some(s=>s.kind==="delete"||s.kind==="moveFrom"),o=r.kind,a=o==="delete"||o==="moveFrom"?"line-through":o==="insert"||o==="moveTo"?"underline":null;return {attribution:r,line:i&&a==="underline"?"line-through":a,decorationStyle:o==="moveFrom"||o==="moveTo"?"double":"solid",color:i?"var(--doc-revision-deletion)":"var(--doc-revision-insertion)",authorColor:n?.get(r.author)?.color??W(e?.get(r.author)??0),deleted:i}}function te(t,e=false){let n=t.spans.find(i=>i.style.shaping)?.style.shaping?.baseLevel,r=n===void 0?e:n===1;return t.spans.length?{x:r?t.spans.reduce((i,o)=>Math.min(i,o.box.x),1/0):t.spans.reduce((i,o)=>Math.max(i,o.box.x+o.box.width),-1/0),rtl:r}:{x:t.contentX,rtl:r}}function ne(t,e,n,r){t.style.left=`${(e.x-n)*r}px`,t.style.marginLeft=`${(e.rtl?-2:2)*r}px`,e.rtl&&(t.style.transform="translateX(-100%)");}function He(t,e,n,r,i=false){let o=t.createElement("span"),a=e.spans[e.spans.length-1];o.className="docx-line-break-mark",o.dataset.docxMarker="",o.setAttribute("aria-hidden","true"),o.contentEditable="false",o.textContent="\u21B5",o.style.position="absolute",o.style.pointerEvents="none",o.style.userSelect="none",ne(o,te(e,i),e.contentX,n),o.style.top=`${e.leading*n}px`,o.style.fontSize=`${(a?.style.fontSizePt??e.box.height)*n}px`,o.style.lineHeight=`${Math.max(0,e.box.height-e.leading-(e.trailingSpacing??0))*n}px`,o.style.color="var(--doc-revision-format)";let s=C(a?.revisions,r?.authorSlots,r?.styles);if(s){let{attribution:l}=s,d=r?.styles.get(l.author),c=r&&(d?.color!==void 0||r.others==="author");if(o.style.color=c?s.authorColor:s.color,o.dataset.revisionKind=l.kind,o.dataset.revisionId=l.id,o.dataset.reviewAuthor=l.author,r){o.dataset.reviewAuthorSlot=String((r.authorSlots.get(l.author)??0)%L);for(let y of r.classTokens.get(l.author)??[])o.classList.add(y);}s.line&&(o.style.textDecorationLine=s.line,o.style.textDecorationStyle=s.decorationStyle,o.style.textDecorationColor=o.style.color);}return o}function Ie(t,e,n,r){let i=Aa(e);if(!i){let d=t.createElement("span");return d.className="docx-paragraph-mark",d.setAttribute("aria-hidden","true"),d.contentEditable="false",d.textContent="\xB6",d.style.position="absolute",d.style.pointerEvents="none",d.style.marginLeft=`${2*n}px`,d.style.color="var(--doc-revision-format)",d}let o=t.createElement("span");o.className=`docx-paragraph-mark docx-revision-pmark docx-revision-pmark-${i.kind}`,o.setAttribute("aria-hidden","true"),o.contentEditable="false",o.dataset.revisionKind=i.kind,o.dataset.revisionId=i.id,i.author!==""&&(o.dataset.reviewAuthor=i.author),o.dataset.revisionIds=e.map(d=>d.id).join(" "),o.dataset.revisionKinds=e.map(d=>d.kind).join(" "),o.textContent="\xB6",o.style.position="absolute",o.style.pointerEvents="none",o.style.marginLeft=`${2*n}px`;let a=Ba(i),s=r?.styles.get(i.author),l=r?(r.authorSlots.get(i.author)??0)%L:0;if(r){o.dataset.reviewAuthorSlot=String(l);let d=r.classTokens.get(i.author);if(d)for(let c=0;c<d.length;c+=1)o.classList.add(d[c]);}return o.style.color=s?.color??(r?.others==="author"?W(l):a?"var(--doc-revision-deletion)":"var(--doc-revision-insertion)"),a&&(o.style.textDecorationLine="line-through"),o}function oe(t,e,n=false){let r=n?null:Da(e.props.filter(o=>o.localName==="pPrChange")),i=r??e.markFormatRevision;i&&(It(t,i,r?"pPrChange":"rPrChange"),t.dataset.paragraphId=e.paragraphId,t.dataset.reviewStart=String(e.range.start),t.dataset.reviewEnd=String(e.range.end));}function It(t,e,n){t.dataset.revisionKind="format",t.dataset.revisionId=e.id,t.dataset.formattingKind=n,e.author&&(t.dataset.reviewAuthor=e.author),e.date!==void 0&&(t.dataset.revisionDate=e.date);}function Ce(t,e,n,r,i,o){for(let a of [n.footnotes,n.endnotes])a&&e.append(Ct(t,n,a,r,i,o));}function Ct(t,e,n,r,i,o){let a=t.createElement("div");if(a.className="docx-notes",a.dataset.docxNotes=n.kind,a.dataset.docxNotesPlacement=n.placement,a.style.position="absolute",a.style.left=`${(n.box.x-e.box.x)*r.scale}px`,a.style.top=`${(n.box.y-e.box.y)*r.scale}px`,a.style.width=`${n.box.width*r.scale}px`,a.style.height=`${n.box.height*r.scale}px`,n.separator){let s=t.createElement("div");s.className="docx-note-separator",s.dataset.docxNoteSeparator=n.separator.kind,s.setAttribute("contenteditable","false"),s.setAttribute("aria-hidden","true"),s.style.position="absolute",s.style.left=`${(n.separator.box.x-n.box.x)*r.scale}px`,s.style.top=`${(n.separator.box.y-n.box.y)*r.scale}px`,s.style.width=`${n.separator.box.width*r.scale}px`,s.style.height=`${Math.max(n.separator.box.height,.75)*r.scale}px`;let l=n.separator.ruleStyle;if(l||n.separator.synthetic||n.separator.fragments.length===0)Ft(s,t,l??"single",r.scale);else for(let d of n.separator.fragments)s.append(d.kind==="table"?o(t,d,r):i(t,d,r));a.append(s);}for(let s of n.notes){let l=t.createElement("div");l.className="docx-note",l.dataset.docxNote=s.noteKind,l.dataset.docxNoteId=String(s.noteId),l.dataset.docxNoteScope=s.scopeId,s.mark!==null&&(l.dataset.docxNoteMark=s.mark),s.continuation&&(l.dataset.docxNoteContinuation=""),l.setAttribute("role","doc-footnote"),l.style.position="absolute",l.style.left=`${(s.box.x-n.box.x)*r.scale}px`,l.style.top=`${(s.box.y-n.box.y)*r.scale}px`,l.style.width=`${s.box.width*r.scale}px`,l.style.height=`${s.box.height*r.scale}px`;for(let d of s.fragments)l.append(d.kind==="table"?o(t,d,r):i(t,d,r));a.append(l);}return a}function Ft(t,e,n,r){t.dataset.docxNoteRule=n;let i=Math.max(1,r*.75);if(n==="single"){t.style.borderTop=`${i}px solid currentColor`,t.style.opacity="0.85";return}t.style.opacity="0.85";let o=Math.max(1,r*1.25);for(let a of [0,i+o]){let s=e.createElement("div");s.setAttribute("aria-hidden","true"),s.style.position="absolute",s.style.left="0",s.style.right="0",s.style.top=`${a}px`,s.style.height="0",s.style.borderTop=`${i}px solid currentColor`,t.append(s);}}function V(t,e,n){return !!n.activeHeaderFooterRId&&!!t.rId&&n.activeHeaderFooterRId===t.rId&&(n.activeHeaderFooterPageIndex===void 0||n.activeHeaderFooterPageIndex===e)}function re(t,e,n){return n?t.kind==="footer"?Math.max(t.box.height,e.box.y+e.box.height-t.box.y):Math.max(t.box.height,e.contentBox.y-t.box.y):t.box.height}function Fe(t,e){for(let{record:n,element:r,materialized:i}of t){if(!i)continue;let o=r.querySelector(":scope > .docx-page-content");o&&(e.activeHeaderFooterRId?o.setAttribute("contenteditable","false"):o.removeAttribute("contenteditable"));for(let a of r.querySelectorAll(":scope > .docx-hf:not(.docx-hf--placeholder)")){let s=Bt(n,a);if(!s)continue;let l=V(s,n.index,e);Nt(a,n,s,l,e.scale);}for(let a of r.querySelectorAll(":scope > [data-docx-hf-front]")){let s=Be(n,a.dataset.docxHfFront);Ne(a,!!s&&V(s,n.index,e));}}}function Bt(t,e){return Be(t,e.dataset.docxHf)}function Be(t,e){if(e==="header")return t.header;if(e==="footer")return t.footer}function Nt(t,e,n,r,i){r?(t.dataset.docxHfActive="",t.setAttribute("contenteditable","true")):(delete t.dataset.docxHfActive,t.setAttribute("contenteditable","false")),t.style.height=`${re(n,e,r)*i}px`,Ne(t,r);}function Ne(t,e){let n=t.querySelectorAll(t instanceof Element&&t.classList.contains("docx-drawing-layer")?":scope > *":":scope > .docx-drawing-layer > *");for(let r of n){r.style.pointerEvents=e?"auto":"none";for(let i of r.querySelectorAll(".docx-drawing"))i.style.pointerEvents=e?"auto":"none";}}var Ot=0;function Oe(t,e,n,r){if(r===void 0||!Number.isFinite(r)||r<0||r>1)return;let i="http://www.w3.org/2000/svg",o=(y,p)=>{let h=t.createElementNS(i,y);for(let[u,g]of Object.entries(p))h.setAttribute(u,g);return h},a=`docx-bilevel-${++Ot}`,s=o("svg",{width:"0",height:"0","aria-hidden":"true"});s.style.position="absolute",s.style.pointerEvents="none";let l=o("filter",{id:a,"color-interpolation-filters":"sRGB"});l.append(o("feColorMatrix",{type:"saturate",values:"0"}));let d=o("feComponentTransfer",{}),c=Array.from({length:256},(y,p)=>p/255>=r?1:0).join(" ");for(let y of ["R","G","B"])d.append(o(`feFunc${y}`,{type:"discrete",tableValues:c}));l.append(d),s.append(l),e.append(s),n.style.filter=`${n.style.filter} url(#${a})`.trim();}function Ke(t){return Math.max(-1,Math.min(1,t))}function Kt(t,e){if(!Number.isFinite(t)||!Number.isFinite(e))return null;let n=Ke(t/100),r=Ke(e/100);if(n===0&&r===0)return null;let i=r>=0?Math.min(1e3,1/(1-r)):Math.max(0,1+r),o=.5-n/2,a=o+n-i*o;return Object.freeze({slope:i,intercept:a})}function q(t){if(!Number.isFinite(t))return "0";let e=Math.round(t*1e6)/1e6;return String(Object.is(e,-0)?0:e)}function zt(t){let{slope:e,intercept:n}=t;if(n>=0){let i=e+2*n;return i<=0?"brightness(0)":`contrast(${q(e/i)}) brightness(${q(i)})`}let r=1-2*n;return `brightness(${q(e/r)}) contrast(${q(r)})`}function ie(t){let e=[];t.grayscale&&e.push("grayscale(1)");let n=Kt(t.brightness,t.contrast);return n&&e.push(zt(n)),e.length>0?e.join(" "):void 0}var _t=new Map([["image/svg+xml","SVG"],["image/tiff","TIFF"],["image/x-emf","EMF"],["image/x-wmf","WMF"]]),Ut="Unknown",X=new WeakMap,se=new WeakMap,jt=256;function Ue(t,e){let n=X.get(t);if(n)return n;let r=new Map,i=new Map;return n=Object.freeze({urlForReady(o,a){let s=r.get(o.resourceKey);if(s)return s;let l;try{l=e.create(o,a);}catch(d){if(d instanceof Error&&d.message.startsWith("PaintImageUrlSource:"))return null;throw d}return r.set(o.resourceKey,l),l},imageFor(o,a,s){let l=i.get(o);if(l&&l.resourceKey===a)return l.element;let d=s.createElement("img");return i.size<jt&&i.set(o,{element:d,resourceKey:a,...l?.readyElement?{readyElement:l.readyElement}:{}}),d},imageForPending(o){return i.get(o)?.element??null},readyElementFor(o){return i.get(o)?.readyElement??null},rememberReadyElement(o,a){let s=i.get(o);s&&i.set(o,{...s,readyElement:a});},reconcile(o,a){for(let[s,l]of r)o.has(s)||(e.revoke(l),r.delete(s));for(let[s,l]of i)a.has(s)||(l.element.removeAttribute("src"),i.delete(s));},revokeAll(){for(let o of r.values())e.revoke(o);r.clear();for(let o of i.values())o.element.removeAttribute("src");i.clear();}}),X.set(t,n),n}function le(t,e){return `${e.paintInstance??""}|${t.drawingNodeId}`}function fo(t){X.get(t)?.revokeAll(),X.delete(t);}function A(t){return Number.isFinite(t)?String(t):"0"}function je(t,e){if(t.length<3||e.width<=0||e.height<=0)return null;let n=[];for(let r of t){if(!Number.isFinite(r.x)||!Number.isFinite(r.y))return null;let i=(r.x-e.x)/e.width*100,o=(r.y-e.y)/e.height*100;n.push(`${A(i)}% ${A(o)}%`);}return `polygon(${n.join(", ")})`}function Ge(t){let e=t.geometry.contentBounds;return yb({transform:t.transform,contentWidth:e.width,contentHeight:e.height})}function We(t,e){let{crop:n}=t,r=Math.max(0,Math.min(1,n.left)),i=Math.max(0,Math.min(1,n.top)),o=Math.max(0,Math.min(1,n.right)),a=Math.max(0,Math.min(1,n.bottom)),s=Math.max(1e-4,1-r-o),l=Math.max(1e-4,1-i-a);return Object.freeze({width:`${A(1/s*100)}%`,height:`${A(1/l*100)}%`,left:`${A(-r/s*100)}%`,top:`${A(-i/l*100)}%`})}function Gt(t,e){let{resource:n}=t;switch(n.kind){case "external":return e.externalResource;case "missing":return e.missingResource;case "pending":return e.pendingResource;case "unrenderable":switch(n.reason){case "unsupported-format":return e.unsupportedFormat(_t.get(n.mime)??Ut);case "non-picture-graphic":return e.nonPictureGraphic(t.placeholderGraphicKind??"graphic");case "signature-mismatch":return e.contentMismatch;case "decode-failed":return e.decodeFailed;case "resource-limit":return e.resourceLimit;default:return e.invalidResource}default:return e.invalidResource}}function I(t,e,n){let{accessibility:r}=e;r.hidden||(t.setAttribute("role",n?"link":"img"),r.label?t.setAttribute("aria-label",r.label):n||t.setAttribute("aria-hidden","true"));}function z(t,e,n,r){let i=r?.x??0,o=r?.y??0;t.style.position="absolute",t.style.left=`${(e.x-i)*n}px`,t.style.top=`${(e.y-o)*n}px`,t.style.width=`${e.width*n}px`,t.style.height=`${e.height*n}px`,t.style.boxSizing="border-box",t.style.overflow="hidden",t.style.pointerEvents="auto";}function Wt(t,e,n,r,i){let o=t.paintBounds,a=t.geometry.contentBounds,s=We(t);return [r,n.scale,i?.x??0,i?.y??0,o.x,o.y,o.width,o.height,a.x,a.y,a.width,a.height,je(t.geometry.clipPolygon??[],o)??"",ie(t.effects)??"",t.effects.bilevel??"",Ge(t)??"",s.width,s.height,s.left,s.top,n.inertLinks?"":t.hyperlinkHref??"",t.accessibility.label??""].join("|")}function K(t,e,n,r){let i=t.createElement("div");i.className="docx-drawing docx-drawing-placeholder",i.dataset.drawingNodeId=e.drawingNodeId,z(i,e.paintBounds,n.scale,r);let o=t.createElement("div");o.className="docx-drawing-placeholder-card";let a=t.createElement("span");return a.className="docx-drawing-placeholder-label",a.textContent=Gt(e,n.strings),o.append(a),i.append(o),e.hyperlinkHref&&!n.inertLinks?(i.dataset.docxDrawingLink=e.drawingNodeId,i.dataset.docxDrawingLinkKind="external",i.dataset.docxDrawingLinkHref=e.hyperlinkHref,i.setAttribute("tabindex","-1"),I(i,e,true)):I(i,e,false),i}function Vt(t,e,n,r,i,o){let a=e.resource;if(a.kind!=="ready")return K(t,e,n,o);let s=le(e,n),l=i?.readyElementFor?.(s)??t.createElement("div"),d=Wt(e,a,n,r,o);if(se.get(l)===d)return l;l.className="docx-drawing docx-drawing-ready",l.style.cssText="",l.dataset.drawingNodeId=e.drawingNodeId,delete l.dataset.docxDrawingLink,delete l.dataset.docxDrawingLinkKind,delete l.dataset.docxDrawingLinkHref,l.removeAttribute("aria-hidden"),l.removeAttribute("aria-label"),l.removeAttribute("role"),l.removeAttribute("tabindex"),z(l,e.paintBounds,n.scale,o);let c=je(e.geometry.clipPolygon??[],e.paintBounds);c&&(l.style.clipPath=c);let y=t.createElement("div");y.className="docx-drawing-image-frame",y.style.position="absolute";let p=e.geometry.contentBounds,h=e.paintBounds;y.style.left=`${(p.x-h.x)*n.scale}px`,y.style.top=`${(p.y-h.y)*n.scale}px`,y.style.width=`${p.width*n.scale}px`,y.style.height=`${p.height*n.scale}px`;let u=ie(e.effects);u&&(y.style.filter=u);let g=t.createElement("div");g.className="docx-drawing-transform-stage",g.style.position="relative",g.style.width="100%",g.style.height="100%";let R=Ge(e);R&&(g.style.transform=R,g.style.transformOrigin="0 0");let k=t.createElement("div");k.className="docx-drawing-crop-viewport",k.style.position="relative",k.style.width="100%",k.style.height="100%",k.style.overflow="hidden";let b=i?.imageFor?.(s,a.resourceKey,t)??t.createElement("img");b.className="docx-drawing-image",b.setAttribute("draggable","false"),b.getAttribute("src")!==r&&b.setAttribute("src",r),b.setAttribute("alt","");let E=We(e);return b.style.position="absolute",b.style.width=E.width,b.style.height=E.height,b.style.left=E.left,b.style.top=E.top,b.style.maxWidth="none",b.style.maxHeight="none",k.append(b),g.append(k),y.append(g),l.replaceChildren(y),Oe(t,l,y,e.effects.bilevel),e.hyperlinkHref&&!n.inertLinks?(l.dataset.docxDrawingLink=e.drawingNodeId,l.dataset.docxDrawingLinkKind="external",l.dataset.docxDrawingLinkHref=e.hyperlinkHref,l.setAttribute("tabindex","-1"),I(l,e,true)):I(l,e,false),i?.rememberReadyElement?.(s,l),se.set(l,d),l}var ae="http://www.w3.org/2000/svg";function qt(t,e,n,r){let i=e.vectorShape,o=t.createElement("div");o.className="docx-drawing docx-drawing-shape",o.dataset.drawingNodeId=e.drawingNodeId,z(o,e.paintBounds,n.scale,r);let a=e.geometry.contentBounds,s=e.paintBounds,l=t.createElement("div");l.className="docx-drawing-image-frame",l.style.position="absolute",l.style.left=`${(a.x-s.x)*n.scale}px`,l.style.top=`${(a.y-s.y)*n.scale}px`,l.style.width=`${a.width*n.scale}px`,l.style.height=`${a.height*n.scale}px`;let d=t.createElementNS(ae,"svg");d.setAttribute("viewBox",`0 0 ${A(Math.max(1,i.extentEmu.cx))} ${A(Math.max(1,i.extentEmu.cy))}`),d.setAttribute("preserveAspectRatio","none"),d.setAttribute("width","100%"),d.setAttribute("height","100%"),d.style.display="block",d.style.overflow="visible";for(let c of i.components){let y=t.createElementNS(ae,"path"),p=c.subpathsEmu.map((h,u)=>`M${h.map(g=>`${A(g.x)} ${A(g.y)}`).join("L")}${c.subpathsClosed?.[u]===false?"":"Z"}`).join("");if(y.setAttribute("d",p),y.setAttribute("fill",c.fillHex!==null?`#${c.fillHex}`:"none"),y.setAttribute("fill-rule","evenodd"),c.fillAlpha<1&&y.setAttribute("fill-opacity",A(Math.max(0,c.fillAlpha))),c.strokeHex!==null&&(y.setAttribute("stroke",`#${c.strokeHex}`),y.setAttribute("stroke-width",A(Math.max(1,c.strokeWidthEmu))),c.strokeAlpha<1&&y.setAttribute("stroke-opacity",A(Math.max(0,c.strokeAlpha)))),d.append(y),c.strokeHex!==null)for(let h of c.arrowheadsEmu??[]){let u=t.createElementNS(ae,"path");u.setAttribute("d",`M${h.map(g=>`${A(g.x)} ${A(g.y)}`).join("L")}Z`),u.setAttribute("fill",`#${c.strokeHex}`),u.setAttribute("fill-opacity",A(Math.max(0,Math.min(1,c.strokeAlpha)))),u.setAttribute("data-docx-line-end","triangle"),d.append(u);}}return l.append(d),o.append(l),e.hyperlinkHref&&!n.inertLinks?(o.dataset.docxDrawingLink=e.drawingNodeId,o.dataset.docxDrawingLinkKind="external",o.dataset.docxDrawingLinkHref=e.hyperlinkHref,o.setAttribute("tabindex","-1"),I(o,e,true)):I(o,e,false),o}function Xt(t,e,n,r,i){let o=r.scale,a=t.createElement("div");a.className="docx-drawing docx-drawing-textbox",a.dataset.drawingNodeId=e.drawingNodeId,a.setAttribute("contenteditable","false"),z(a,e.paintBounds,r.scale,i),a.style.overflow="hidden";let s=(e.x-e.paintBounds.x)*o,l=(e.y-e.paintBounds.y)*o;if(n.fillHex!==null||n.strokeHex!==null){let c=t.createElement("div");c.className="docx-drawing-textbox-box",c.style.position="absolute",c.style.left=`${s}px`,c.style.top=`${l}px`,c.style.width=`${e.width*o}px`,c.style.height=`${e.height*o}px`,c.style.boxSizing="border-box",n.fillHex!==null&&(c.style.backgroundColor=`#${n.fillHex}`),n.strokeHex!==null&&(c.style.border=`${Math.max(n.strokeWidthPt*o,.5)}px solid #${n.strokeHex}`),a.append(c);}let d=t.createElement("div");d.className="docx-drawing-textbox-content",d.style.position="absolute",d.style.left=`${s+n.contentOffset.x*o}px`,d.style.top=`${l+n.contentOffset.y*o}px`,d.style.width=`${n.contentWidth*o}px`,d.style.height=`${Math.max(0,n.contentHeight)*o}px`,d.style.overflow="hidden";for(let c of n.fragments)d.append(r.paintStoryFragment(t,c));for(let c of d.querySelectorAll("[data-paragraph-id]"))delete c.dataset.paragraphId;return a.append(d),I(a,e,false),a}function Yt(t,e,n){let r=n.revisionStyles,i=C(e.revisions,r?.authorSlots,r?.styles);if(!i){if(t.dataset.revisionKind===void 0)return;t.classList.remove("docx-drawing--revision","docx-drawing--revision-insertion","docx-drawing--revision-deletion"),delete t.dataset.revisionKind,delete t.dataset.revisionId,delete t.dataset.reviewAuthor,delete t.dataset.revisionDate,delete t.dataset.reviewAuthorSlot,t.style.outlineColor="";return}let{attribution:o}=i;t.classList.add("docx-drawing--revision",i.deleted?"docx-drawing--revision-deletion":"docx-drawing--revision-insertion"),t.classList.remove(i.deleted?"docx-drawing--revision-insertion":"docx-drawing--revision-deletion"),t.dataset.revisionKind=o.kind,t.dataset.revisionId=o.id,o.author!==""?t.dataset.reviewAuthor=o.author:delete t.dataset.reviewAuthor,o.date!==void 0?t.dataset.revisionDate=o.date:delete t.dataset.revisionDate;let a=r?.styles.get(o.author),s=r!==void 0&&(a?.color!==void 0||r.others==="author");r?t.dataset.reviewAuthorSlot=String((r.authorSlots.get(o.author)??0)%L):delete t.dataset.reviewAuthorSlot,t.style.outlineColor=s?i.authorColor:"";}function Ve(t,e,n,r,i){let o=Zt(t,e,n,r,i);return o&&Yt(o,e,n),o}function Zt(t,e,n,r,i){if(e.accessibility.hidden||e.paintBounds.width<=0||e.paintBounds.height<=0)return null;if(e.kind==="anchoredDrawing"&&e.textboxStory!==void 0&&n.paintStoryFragment!==void 0)return Xt(t,e,e.textboxStory,n,i);if(e.vectorShape&&e.vectorShape.subpathsEmu.length>0)return qt(t,e,n,i);let{resource:o}=e;if(o.kind==="ready"){if(!n.imageUrlPort||!r)return K(t,e,n,i);let a=r.urlForReady(o.validatedHandle,o.mime);return a?Vt(t,e,n,a,r,i):K(t,e,n,i)}if(o.kind==="pending"){let a=r?.readyElementFor?.(le(e,n))??r?.imageForPending?.(le(e,n))?.closest(".docx-drawing-ready");return a?(se.delete(a),a.dataset.drawingNodeId=e.drawingNodeId,z(a,e.paintBounds,n.scale,i),a):K(t,e,n,i)}return K(t,e,n,i)}function qe(t,e,n,r,i){let o=[];for(let a of e.drawings??[]){let s=Ve(t,a,n,r,i);s&&o.push(s);}return Object.freeze(o)}function Xe(t,e,n,r,i,o){let a=[];for(let s of e){if(zb(s)!==n)continue;let l=Ve(t,s,r,i,o);l&&(l.dataset.drawingLayer=n,a.push(l));}return Object.freeze(a)}function Jt(t,e){F$1(t,({host:n})=>H(n,e));}var ze=new WeakMap;function Qt(t){let e=ze.get(t);if(e)return e;let n=[],r=[];Jt(t,o=>{o.resource.kind==="ready"&&n.push(o.resource.resourceKey),r.push(`p${t.index}|${o.drawingNodeId}`);});let i=Object.freeze({resourceKeys:Object.freeze(n),elementKeys:Object.freeze(r)});return ze.set(t,i),i}var _e=new WeakMap;function Ye(t){let e=_e.get(t);if(e)return e;let n=new Set,r=new Set;for(let o of t.pages){let a=Qt(o);for(let s of a.resourceKeys)n.add(s);for(let s of a.elementKeys)r.add(s);}let i=Object.freeze({resourceKeys:n,elementKeys:r});return _e.set(t,i),i}function Ze(t){return Ye(t).resourceKeys}function Je(t){return Ye(t).elementKeys}function Qe(t){return [t.missingResource,t.externalResource,t.invalidResource,t.contentMismatch,t.decodeFailed,t.resourceLimit,t.pendingResource,t.unsupportedFormat("probe"),t.nonPictureGraphic("probe")].join("\0")}var de=Object.freeze({unsupportedFormat:t=>`Unsupported image format (${t})`,nonPictureGraphic:t=>`Unsupported graphic (${t})`,missingResource:"Image missing",externalResource:"External image not loaded",invalidResource:"Invalid image",contentMismatch:"Image content does not match its type",decodeFailed:"Image could not be decoded",resourceLimit:"Image exceeds size limits",pendingResource:"Loading image"});function go(t){return Object.freeze({unsupportedFormat:e=>t("image.unsupportedFormat",{format:e}),nonPictureGraphic:e=>t("image.nonPictureGraphic",{kind:e}),missingResource:t("image.missingResource"),externalResource:t("image.externalResource"),invalidResource:t("image.invalidResource"),contentMismatch:t("image.contentMismatch"),decodeFailed:t("image.decodeFailed"),resourceLimit:t("image.resourceLimit"),pendingResource:t("image.pendingResource")})}function en(t,e,n){t.style.position="absolute",t.style.left=`${e.x*n}px`,t.style.top=`${e.y*n}px`,t.style.width=`${e.width*n}px`,t.style.height=`${e.height*n}px`;}function et(t,e,n,r){let i=t.createElement("span");return i.className=e,i.setAttribute("aria-hidden","true"),i.style.position="absolute",i.style.display="block",i.style.left=`${n.x*r}px`,i.style.top=`${n.y*r}px`,i.style.width=`${n.width*r}px`,i.style.height=`${n.height*r}px`,i.style.backgroundColor="currentColor",i.style.pointerEvents="none",i}function P(t,e,n,r,i=0,o=0,a=[]){let s=i+n.box.x,l=o+n.box.y,d=[...a,n.kind];switch(n.kind){case "text":case "fallback":{let c=t.createElement("span");c.className=["docx-equation-node",...d.map(y=>`docx-equation-${y}`)].join(" "),en(c,{x:s,y:l,width:n.box.width,height:n.box.height},r),c.textContent=n.text,c.style.display="block",c.style.fontSize=`${n.fontSizePt*r}px`,c.style.lineHeight=`${n.box.height*r}px`,c.style.whiteSpace="pre",e.append(c);break}case "row":for(let c of n.items)P(t,e,c,r,s,l,d);break;case "fraction":P(t,e,n.numerator,r,s,l,d),e.append(et(t,"docx-equation-fraction-bar",{...n.bar,x:s+n.bar.x,y:l+n.bar.y},r)),P(t,e,n.denominator,r,s,l,d);break;case "radical":P(t,e,n.sign,r,s,l,d),n.degree&&P(t,e,n.degree,r,s,l,d),e.append(et(t,"docx-equation-radical-bar",{...n.bar,x:s+n.bar.x,y:l+n.bar.y},r)),P(t,e,n.radicand,r,s,l,d);break;case "script":P(t,e,n.base,r,s,l,d),n.subscript&&P(t,e,n.subscript,r,s,l,d),n.superscript&&P(t,e,n.superscript,r,s,l,d);break;case "nary":P(t,e,n.operator,r,s,l,d),n.lowerLimit&&P(t,e,n.lowerLimit,r,s,l,d),n.upperLimit&&P(t,e,n.upperLimit,r,s,l,d),P(t,e,n.body,r,s,l,d);break}}function tt(t,e,n,r){let i=n.geometry;e.className="layout-run docx-equation",e.dataset.docxEquation=n.sourceNodeId,e.setAttribute("contenteditable","false"),e.setAttribute("role","math"),n.fallbackText&&e.setAttribute("aria-label",n.fallbackText),e.style.position="relative",e.style.display="inline-block",e.style.width=`${i.box.width*r}px`,e.style.height=`${i.box.height*r}px`,e.style.lineHeight="0",e.style.pointerEvents="auto",e.style.userSelect="none",e.style.verticalAlign=`${-(i.box.height-i.baseline)*r}px`;let o=t.createDocumentFragment();P(t,o,i,r),e.append(o);}function nt(t,e,n,r){if(n.glyphOffsetPt!==void 0){let s=n.style.horizontalScalePercent/100,l=n.box.width*r;e.style.width=`${l/s}px`,s!==1&&(e.style.marginRight=`${l-l/s}px`);let d=t.createElement("span");if(d.dataset.docxGlyphOffset="",s!==1&&(d.style.letterSpacing=`${n.style.characterSpacingPt*r/s}px`),n.glyphOffsetPt){d.dataset.docxShiftedInk="",d.style.setProperty("forced-color-adjust","preserve-parent-color"),d.style.setProperty("-webkit-text-fill-color","transparent");let c=`${n.glyphOffsetPt*r/s}px`;d.style.setProperty("--docx-glyph-ink-offset",c),e.style.color&&e.style.color!=="inherit"&&d.style.setProperty("--docx-glyph-ink-color",e.style.color),d.style.textShadow=`${c} 0 currentColor`;}return e.append(d),d}let i=n.lineEndWhitespace===true;(n.style.horizontalScalePercent!==100||n.text===" "||i)&&(e.style.width=`${n.box.width*r}px`);let o=n.style.shaping!==void 0&&n.style.horizontalScalePercent!==100;if(!i&&!o||(i&&(e.style.clipPath="inset(-1em 0)"),n.style.horizontalScalePercent===100))return e;let a=t.createElement("span");if(a.dataset.docxClippedFill="",a.style.display="inline-block",a.style.transform=e.style.transform,a.style.transformOrigin=e.style.transformOrigin,o){let s=n.style.horizontalScalePercent/100;a.style.width=`${n.box.width*r/s}px`,a.style.letterSpacing=`${n.style.characterSpacingPt*r/s}px`,n.style.shaping?.wordSpacingPt&&(a.style.wordSpacing=`${n.style.shaping.wordSpacingPt*r/s}px`),a.style.direction=n.style.shaping?.direction??"ltr",a.style.transformOrigin=a.style.direction==="rtl"?"right":"left";}return a.style.textDecorationLine=e.style.textDecorationLine,a.style.textDecorationStyle=e.style.textDecorationStyle,a.style.textDecorationColor=e.style.textDecorationColor,a.style.textDecorationThickness=e.style.textDecorationThickness,e.style.removeProperty("transform"),e.style.removeProperty("transform-origin"),e.style.removeProperty("text-decoration-line"),e.style.removeProperty("text-decoration-style"),e.style.removeProperty("text-decoration-color"),e.style.removeProperty("text-decoration-thickness"),e.append(a),a}function ot(t,e,n){let r=e.textOutline;if(!r||!Number.isFinite(n)||n<=0||!Number.isFinite(r.widthPt)||r.widthPt<=0||r.widthPt>1584||!/^[0-9a-f]{6}$/i.test(r.color))return;let i=r.widthPt*n;Number.isFinite(i)&&(t.setProperty("-webkit-text-stroke-width",`${i}px`),t.setProperty("-webkit-text-stroke-color",`#${r.color}`));}var tn=/^[0-9A-Fa-f]{6}$/;function nn(t){switch(t){case "dashed":return "dashed";case "dotted":return "dotted";case "double":case "triple":return "solid";default:return "solid"}}function rt(t){return t&&tn.test(t)?t:"000000"}function ce(t,e){let n=t.createElement("div");return n.className=e,n.setAttribute("aria-hidden","true"),n.setAttribute("contenteditable","false"),n.style.position="absolute",n.style.left="0",n.style.top="0",n.style.right="0",n.style.bottom="0",n.style.overflow="visible",n.style.pointerEvents="none",n.style.boxSizing="border-box",n}function Y(t,e,n,r){if(!n)return;let i=`#${rt(n.color)}`,o=`${Math.max(0,n.widthPt*r)}px`;if(t.style[`border${e}Width`]=o,t.style[`border${e}Color`]=i,n.style==="double"||n.style==="triple"){t.style[`border${e}Style`]="none";return}t.style[`border${e}Style`]=nn(n.style);}function ye(t,e,n,r,i){let o=t.createElement("div");o.className=i,o.dataset.edge=n.side,o.dataset.stroke=n.role,o.style.position="absolute",o.style.left=`${n.x*r}px`,o.style.top=`${n.y*r}px`,o.style.width=`${n.width*r}px`,o.style.height=`${n.height*r}px`,o.style.pointerEvents="none",o.style.backgroundColor=`#${rt(n.color)}`,n.cssStyle!=="solid"&&(o.dataset.cssStyle=n.cssStyle),e.append(o);}function on(t){let e=new Set;for(let n of t)e.add(`${n.side}\0${n.role}`);return e}function rn(t,e,n,r){let i=on(n),o=p=>i.has(`${p}\0middle`),a=ce(t,"docx-table-border-double"),s=ce(t,"docx-table-border-triple"),l=ce(t,"docx-table-border-edge"),d=false,c=false,y=false;for(let p of n){if(p.role==="edge"){y=true,ye(t,l,p,r,"docx-table-border-edge-stroke");continue}if(o(p.side)){c=true,ye(t,s,p,r,"docx-table-border-triple-stroke");continue}(p.role==="outer"||p.role==="inner")&&(d=true,ye(t,a,p,r,"docx-table-border-double-stroke"));}d&&e.append(a),c&&e.append(s),y&&e.append(l);}function it(t,e,n,r){Y(e,"Top",n?.top,r),Y(e,"Right",n?.right,r),Y(e,"Bottom",n?.bottom,r),Y(e,"Left",n?.left,r),n?.strokes&&n.strokes.length>0&&rn(t,e,n.strokes,r);}function at(t,e,n,r){if(e.textDirection!=="btLr")return r;let i=t.createElement("div");return i.className="docx-table-cell-content-btlr",i.style.position="absolute",i.style.left="0",i.style.top="0",i.style.width=`${e.box.height*n}px`,i.style.height=`${e.box.width*n}px`,i.style.transformOrigin="0 0",i.style.transform=`translateY(${e.box.height*n}px) rotate(-90deg)`,r.append(i),i}var ue="when-selected",st=new WeakMap,lt=0;function an(t){let e=st.get(t);return e||(lt+=1,e=`alias${lt}`,st.set(t,e)),e}function xt(t){return {...t,drawingStrings:t.drawingStrings??de,urlRegistry:t.urlRegistry??null}}function sn(t){let e={...t,inertLinks:true};return Object.freeze({scale:t.scale,strings:t.drawingStrings,...t.imageUrlPort?{imageUrlPort:t.imageUrlPort}:{},...t.inertLinks?{inertLinks:true}:{},...t.paintInstance?{paintInstance:t.paintInstance}:{},...t.revisionStyles?{revisionStyles:t.revisionStyles}:{},paintStoryFragment:(n,r)=>r.kind==="table"?B(n,r,e):F(n,r,e)})}function bt(t){return Object.freeze({ctx:sn(t),urlRegistry:t.urlRegistry})}function dt(t,e,n,r,i,o){J(t,e,E(n),r,i,o);}function J(t,e,n,r,i,o,a=true,s){if(n.length===0)return;let l=bt(r),d=t.createElement("div");d.className=o==="behind"?"docx-drawing-layer docx-drawing-layer-behind":"docx-drawing-layer docx-drawing-layer-front",d.style.position="absolute",d.style.inset="0",d.style.pointerEvents="none",s&&(d.dataset.docxHfFront=s);for(let c of Xe(t,n,o,l.ctx,l.urlRegistry,i)){if(c.style.pointerEvents=a?"auto":"none",!a)for(let y of c.querySelectorAll(".docx-drawing"))y.style.pointerEvents="none";d.append(c);}d.childElementCount>0&&e.append(d);}function mt(t){return t.horizontalFrame==="page"||t.verticalFrame==="page"}function vt(t,e,n){let r=e.paintBounds,i=A$1(e,t.box,n),o=i.x-e.x,a=i.y-e.y,s=l=>Object.freeze({x:l.x+o,y:l.y+a,width:l.width,height:l.height});return Object.freeze({...e,x:e.x+o,y:e.y+a,paintBounds:s(r),hitBounds:s(e.hitBounds),geometry:Object.freeze({...e.geometry,contentBounds:s(e.geometry.contentBounds),paintBounds:s(e.geometry.paintBounds),...e.geometry.clipPolygon?{clipPolygon:Object.freeze(e.geometry.clipPolygon.map(l=>Object.freeze({x:l.x+o,y:l.y+a})))}:{}})})}function ln(t,e,n,r,i,o){let a=r.map(l=>vt(n,l,o)),s=t.createElement("div");s.className="docx-hf-behind-layer",s.dataset.docxHfBehind=n.kind,s.setAttribute("contenteditable","false"),s.style.position="absolute",s.style.inset="0",s.style.overflow="hidden",s.style.pointerEvents="none",J(t,s,a,i,o,"behind",false),s.childElementCount>0&&e.append(s);}function dn(t,e,n,r,i,o,a,s=false){let l=r.filter(mt).map(d=>vt(n,d,o));J(t,e,l,i,o,a,s,n.kind);}var N=/^[0-9A-Fa-f]{6}$/,ct=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u,cn=new Map(Object.entries({single:"solid",words:"solid",thick:"solid",double:"double",dotted:"dotted",dottedHeavy:"dotted",dash:"dashed",dashedHeavy:"dashed",dashLong:"dashed",dashLongHeavy:"dashed",dotDash:"dashed",dashDotHeavy:"dashed",dotDotDash:"dashed",dashDotDotHeavy:"dashed",wave:"wavy",wavyHeavy:"wavy",wavyDouble:"wavy"})),yn=new Map(Object.entries({black:"#000000",blue:"#0000ff",cyan:"#00ffff",darkBlue:"#000080",darkCyan:"#008080",darkGray:"#808080",darkGreen:"#008000",darkMagenta:"#800080",darkRed:"#800000",darkYellow:"#808000",green:"#00ff00",lightGray:"#c0c0c0",magenta:"#ff00ff",red:"#ff0000",yellow:"#ffff00",white:"#ffffff"}));function un(t){return t.doubleStrike?"double":t.strike?"single":"none"}function pn(t){return t==="thick"||t.endsWith("Heavy")}function St(t){if(!t.underline)return null;let e=t.underline.color&&N.test(t.underline.color)?t.underline.color:null;return {cssStyle:cn.get(t.underline.variant)??"solid",color:e,heavy:pn(t.underline.variant)}}function wt(t,e,n,r){t.textDecorationLine=e,t.textDecorationStyle=n,r.color&&(t.textDecorationColor=`#${r.color}`),r.heavy&&(t.textDecorationThickness=`max(${2*r.scale}px, 0.12em)`);}function yt(t,e,n){e!=="none"&&wt(t,"line-through",e==="double"?"double":"solid",{scale:n});}function ut(t,e,n){wt(t,"underline",e.cssStyle,{color:e.color,heavy:e.heavy,scale:n});}function hn(t,e,n){let r=e.color?`#${e.color}`:"currentColor";t.borderBottomWidth=`${(e.heavy?2:1)*n}px`,t.borderBottomStyle=e.cssStyle==="wavy"?"solid":e.cssStyle,t.borderBottomColor=r;}function Z(t,e,n){let r=t.style,i=n.scale;ot(r,e,i);let o=e.verticalAlign==="baseline"?1:.75;r.fontSize=`${e.fontSizePt*o*i}px`,e.bold&&(r.fontWeight="bold"),e.italic&&(r.fontStyle="italic");let a=e.fontFamily&&ct.test(e.fontFamily)?e.fontFamily:n.defaultFontFamily&&ct.test(n.defaultFontFamily)?n.defaultFontFamily:null;if(a){let d=n.fontAlias?.(a);r.fontFamily=d?`"${d}", "${a}", ${$}`:`"${a}", ${$}`;}e.color&&N.test(e.color)&&(r.color=`#${e.color}`);let s=e.highlight?yn.get(e.highlight):void 0;s?(r.backgroundColor=s,t.dataset.highlight=e.highlight??""):e.shading&&N.test(e.shading)&&(r.backgroundColor=`#${e.shading}`),e.caps&&(r.textTransform="uppercase"),e.smallCaps&&(r.fontVariant="small-caps");let l=m(e);l!==0&&(r.position="relative",r.top=`${-l*i}px`),e.characterSpacingPt!==0&&(r.letterSpacing=`${e.characterSpacingPt*i}px`),e.horizontalScalePercent!==100&&(r.transformOrigin="left",r.transform=`scaleX(${e.horizontalScalePercent/100})`);}function Rt(t,e,n,r,i){let o=n===" "?null:St(r),a=un(r),s=e;if(o&&a!=="none"){let l=t.createElement("span");l.dataset.docxDeco="underline",ut(l.style,o,i);let d=t.createElement("span");d.dataset.docxDeco="strike",yt(d.style,a,i),l.append(d),e.append(l),s=d;}else o?ut(e.style,o,i):a!=="none"&&yt(e.style,a,i);s.textContent=n;}function D(t,e,n,r){let i=t.createElement(e);return i.style.position="absolute",i.style.left=`${n.x*r}px`,i.style.top=`${n.y*r}px`,i.style.width=`${n.width*r}px`,i.style.height=`${n.height*r}px`,i}function fn(t,e,n){let r=e.fieldAtom;!r||(t.dataset.fieldAtom=r.formField?"form":"field",!(r.formField?n.shadeFormFields!==false:(n.fieldShading??ue)!=="never"))||(t.classList.add("docx-field-atom"),(r.formField||(n.fieldShading??ue)==="always")&&t.classList.add("docx-field-atom--shaded"));}function pt(t,e,n){let r=Da(e.props),i=n.revisionStyles,o=C(e.revisions,i?.authorSlots,i?.styles);if(!(!o&&!r)){if(o){let{attribution:a}=o;t.classList.add("docx-revision",`docx-revision-${a.kind}`),t.dataset.revisionKind=a.kind,t.dataset.revisionId=a.id,a.author!==""&&(t.dataset.reviewAuthor=a.author),a.date!==void 0&&(t.dataset.revisionDate=a.date);let s=i?.styles.get(a.author);if(i){t.dataset.reviewAuthorSlot=String((i.authorSlots.get(a.author)??0)%L);let c=i.classTokens.get(a.author);if(c)for(let y=0;y<c.length;y+=1)t.classList.add(c[y]);}let d=i!==void 0&&(s?.color!==void 0||i.others==="author")?o.authorColor:o.color;t.style.color=d,t.style.backgroundColor=s?.background??(o.deleted?"var(--doc-revision-deletion-wash)":"var(--doc-revision-insertion-wash)"),o.line&&(t.style.textDecorationLine=o.line,a.kind==="insert"&&o.line==="underline"?(t.style.textDecorationStyle="var(--doc-revision-insertion-decoration-style)",t.style.textDecorationThickness="var(--doc-revision-insertion-decoration-thickness)",t.style.textUnderlineOffset="var(--doc-revision-insertion-underline-offset)"):t.style.textDecorationStyle=o.decorationStyle,t.style.textDecorationColor=d);return}if(t.classList.add("docx-revision","docx-revision-format"),t.dataset.revisionKind="format",t.dataset.formattingKind="rPrChange",t.dataset.revisionId=r.id,r.author!==""&&(t.dataset.reviewAuthor=r.author),r.date!==void 0&&(t.dataset.revisionDate=r.date),i){let a=i.styles.get(r.author);t.dataset.reviewAuthorSlot=String((i.authorSlots.get(r.author)??0)%L);let s=i.classTokens.get(r.author);if(s)for(let l=0;l<s.length;l+=1)t.classList.add(s[l]);a?.color!==void 0&&(t.style.color=a.color),a?.background!==void 0&&(t.style.backgroundColor=a.background);}}}function gn(t,e,n){let r=[],i=e.lines[e.lines.length-1];for(let a of e.lines){let s=[...a.spans.flatMap(p=>p.revisions??[]),...(a.drawings??[]).flatMap(p=>p.revisions??[]),...a.anchorRevisions??[],...a===i?e.markRevisions??[]:[]];if(s.length===0)continue;let l=s.some(p=>p.kind==="delete"||p.kind==="moveFrom"),d=a.box.y-e.box.y,c=d+a.box.height,y=r[r.length-1];if(y&&y.deleted===l&&d<=y.bottom+.5){y.bottom=Math.max(y.bottom,c);continue}r.push({top:d,bottom:c,deleted:l});}if(r.length===0)return null;let o=t.createElement("div");o.className="docx-change-bars",o.setAttribute("aria-hidden","true"),o.style.position="absolute",o.style.inset="0",o.style.pointerEvents="none";for(let a of r){let s=t.createElement("div");s.className=`docx-change-bar docx-change-bar-${a.deleted?"deletion":"insertion"}`,s.style.position="absolute",s.style.top=`${a.top*n}px`,s.style.height=`${(a.bottom-a.top)*n}px`,s.style.left=`${(-e.box.x-xn)*n}px`,s.style.width=`${bn*n}px`,s.style.pointerEvents="none",s.style.backgroundColor=a.deleted?"var(--doc-revision-deletion)":"var(--doc-revision-insertion)",o.append(s);}return o}var xn=7.5,bn=1.5;function mn(t,e,n,r,i){let o=t.createElement("span"),a=z$1(e.style,e.fontSlot);if(e.equation)return o.dataset.paragraphId=e.range.paragraphId,o.dataset.start=String(e.range.start),o.dataset.end=String(e.range.end),Z(o,a,n),tt(t,o,e.equation,n.scale),pt(o,e,n),o;o.className="layout-run layout-run-text",o.style.display="inline-block",o.style.verticalAlign="baseline",o.style.boxSizing="border-box",o.style.height=`${r*n.scale}px`,o.style.paddingTop=`${i*n.scale}px`,o.style.lineHeight=`${(r-i)*n.scale}px`,e.range.end>e.range.start?(o.dataset.paragraphId=e.range.paragraphId,o.dataset.start=String(e.range.start),o.dataset.end=String(e.range.end)):(o.setAttribute("aria-hidden","true"),o.contentEditable="false"),Z(o,a,n),fn(o,e,n),pt(o,e,n);let s=nt(t,o,e,n.scale);if(e.text===" "){o.style.overflow="hidden",o.style.verticalAlign="top";let l=St(e.style);l&&e.tabLeader!=="underscore"&&(o.dataset.docxTabUnderline="",hn(o.style,l,n.scale));}return Rt(t,s,e.text,e.style,n.scale),e.projected&&(o.dataset.docxField="",o.setAttribute("contenteditable","false"),e.noteNav?(o.style.userSelect="none",e.noteNav.direction==="to-note"?(o.dataset.docxNoteRef="",o.dataset.docxNoteScope=e.noteNav.scopeId,e.text.length>0&&o.setAttribute("aria-description",e.text)):(o.dataset.docxNoteMarkBack="",o.dataset.docxNoteScope=e.noteNav.scopeId)):(o.style.pointerEvents="none",o.style.userSelect="none")),o}function ht(t,e,n){let r=t.createElement("a");return r.className="docx-hyperlink",r.dataset.docxLink=e.id,r.dataset.docxLinkKind=e.kind,r.setAttribute("tabindex","-1"),!n.inertLinks&&e.href&&(r.setAttribute("href",e.href),e.kind==="external"&&r.setAttribute("rel","noopener noreferrer")),e.tooltip&&r.setAttribute("title",e.tooltip),r.style.display="inline-block",r.style.verticalAlign="baseline",r.style.textDecoration="none",r.style.color="inherit",r}function vn(t,e,n,r=false){let i=n.scale,o=t.createElement("div");o.className="docx-line layout-line",o.dataset.lineId=e.id,o.dataset.paragraphId=e.range.paragraphId,o.style.position="absolute",o.style.top=`${e.box.y*i}px`,o.style.left=`${e.contentX*i}px`,o.style.height=`${e.box.height*i}px`,o.style.fontSize="0",o.style.whiteSpace="pre",o.style.overflow="visible";let a=e.leading??0,s=Math.min(Math.max(a,...e.spans.map(f=>f.box.height+a),e.spans.length===0?e.box.height-(e.trailingSpacing??0):0),e.box.height),l=Math.max(0,e.box.height-s);o.style.boxSizing="border-box",o.style.paddingBottom=`${l*i}px`,o.style.lineHeight=`${(e.box.height-l)*i}px`;let d=null,c=null,y=null,p=new Map;for(let[f,x]of Q(e).entries())p.set(x.paragraphId,f);let h=f=>p.get(f)??0,u=[...e.drawings??[]].sort((f,x)=>h(f.paragraphId)-h(x.paragraphId)||f.start-x.start),g=0,R=(f,x)=>{for(;g<u.length&&(h(u[g].paragraphId)<h(f)||h(u[g].paragraphId)===h(f)&&u[g].start<x);){let m=u[g],v=Math.max(0,m.advanceEnd-m.advanceStart),S=t.createElement("span");S.className="docx-inline-drawing-advance",S.dataset.docxMarker="",S.setAttribute("contenteditable","false"),S.setAttribute("aria-hidden","true"),S.style.display="inline-block",S.style.width=`${v*i}px`,S.style.height=`${m.baselineOffset*i}px`,S.style.lineHeight="0",S.style.pointerEvents="none",S.style.verticalAlign="baseline",o.append(S),g+=1,d=null,c=null;}},k=f=>{let x=f.wrapAdvanceBefore??0;if(x<=.001)return;let m=t.createElement("span");m.className="docx-wrap-advance",m.dataset.docxMarker="",m.setAttribute("contenteditable","false"),m.setAttribute("aria-hidden","true"),m.style.display="inline-block",m.style.width=`${x*i}px`,m.style.height="0",m.style.lineHeight="0",m.style.pointerEvents="none",m.style.verticalAlign="baseline",o.append(m),d=null,c=null;},b=e.spans.some(f=>f.style.shaping!==void 0),E=0,$=0,H=false;for(let[f,x]of e.spans.entries()){R(x.range.paragraphId,x.range.start),b||k(x);let m=Math.min(x.box.height+a,e.box.height),v=mn(t,x,n,m,a);b&&(v.style.position="relative",v.style.left=`${(x.box.x-e.contentX-E)*i}px`,v.style.width||(v.style.width=`${x.box.width*i}px`),v.style.direction=x.style.shaping?.direction??"ltr",v.style.unicodeBidi="isolate",x.style.shaping?.wordSpacingPt&&(v.style.wordSpacing=`${x.style.shaping.wordSpacingPt*i}px`),E+=x.box.width),$>0&&!H&&(v.style.marginLeft=`${$*i}px`);let S=e.spans[f+1],O=b?0:Sn(e,f+1,h);H=O>0&&S!==void 0&&Rn(x,S),H&&(v.style.wordSpacing=`${O*i}px`),$=O;let T=x.link;if(!T){d=null,c=null,y=null,o.append(v);continue}if(x.fieldAtom){d!==null&&c===T.id&&y===x.range.start||(d=ht(t,T,n),c=T.id,y=x.range.start,o.append(d)),d.append(v);continue}(!d||c!==T.id||y!==null)&&(d=ht(t,T,n),c=T.id,y=null,o.append(d)),d.append(v);}if(R(Q(e)[Q(e).length-1]?.paragraphId??e.range.paragraphId,Number.POSITIVE_INFINITY),e.spans.length===0){let f=t.createElement("br");f.style.lineHeight=`${e.box.height*i}px`,o.append(f);}let M=Object.freeze({x:e.contentX,y:e.box.y,width:e.box.width,height:e.box.height});n.showParagraphMarks&&e.manualBreakAfter&&o.append(He(t,e,i,n.revisionStyles,r));let w=bt(xt(n));if(e.drawings&&e.drawings.length>0)for(let f of qe(t,e,w.ctx,w.urlRegistry,M))o.append(f);return o}function Sn(t,e,n){if(e<=0||e>=t.spans.length)return 0;let r=t.spans[e-1],i=t.spans[e],o=n(r.range.paragraphId),a=n(i.range.paragraphId);if(t.drawings?.some(d=>{let c=n(d.paragraphId),y=c>o||c===o&&d.start>=r.range.start,p=c<a||c===a&&d.start<i.range.start;return y&&p}))return 0;let l=i.box.x-(r.box.x+r.box.width)-(i.wrapAdvanceBefore??0);return l>.001?l:0}var wn=/[\t\n\r \u00A0\u1361\u{10100}-\u{10102}\u{1039F}\u{1091F}]/u;function Rn(t,e){return !t.text.endsWith(" ")||t.style.horizontalScalePercent!==100||!kn(t,e)||(e.wrapAdvanceBefore??0)>.001?false:!wn.test(t.text.slice(0,-1))}function kn(t,e){return !t.link&&!e.link?true:!t.link||!e.link||t.link.id!==e.link.id||!!t.fieldAtom!=!!e.fieldAtom?false:!t.fieldAtom||t.range.start===e.range.start}function F(t,e,n){let r=n.scale,i=D(t,"div",e.box,r);i.className="docx-paragraph-fragment layout-paragraph",e.clipToBox&&(i.style.overflow="hidden"),i.dataset.paragraphId=e.paragraphId,i.dataset.fragmentIndex=String(e.fragmentIndex),oe(i,e),n.readOnlyParagraphIds?.has(e.paragraphId)&&(i.classList.add("docx-generated-region"),i.dataset.docxReadOnly="",i.setAttribute("contenteditable","false"),i.setAttribute("aria-readonly","true")),n.emptyTocPlaceholderIds?.has(e.paragraphId)&&(i.classList.add("docx-toc-empty-placeholder"),i.dataset.docxTocEmpty=""),e.shading&&N.test(e.shading)&&e.shadingBox&&i.append(Ln(t,e,r)),e.marker&&i.append(An(t,e,n));for(let a of e.lines)for(let s of a.spans){if(!s.tabLeader)continue;let l=En(t,e,a,s,n);l&&i.append(l);}let o=gn(t,e,r);if(o&&i.append(o),n.showParagraphMarks&&e.paragraphEnd||e.markRevisions&&e.markRevisions.length>0){let a=Ie(t,e.markRevisions??[],r,n.revisionStyles),s=e.lines[e.lines.length-1];s&&(a.style.top=`${(s.box.y-e.box.y)*r}px`,ne(a,te(s,La(e.props)),e.box.x,r),i.append(a));}for(let a of e.lines){let s=vn(t,a,n,La(e.props));e.markFormatRevision&&a===e.lines[e.lines.length-1]&&oe(s,e,true),s.style.top=`${(a.box.y-e.box.y)*r}px`,s.style.left=`${(a.contentX-e.box.x)*r}px`,i.append(s);}if(e.borders)for(let a of e.borders)i.append(ft(t,e,a,r));else e.bottomBorder&&i.append(ft(t,e,{side:"bottom",edge:e.bottomBorder.edge,box:e.bottomBorder.box},r));return i}function An(t,e,n){let r=e.marker,i=n.scale,o=e.lines[0]?.leading??0,a=D(t,"span",r.box,i);a.className="docx-list-marker",a.dataset.docxMarker="",a.setAttribute("contenteditable","false"),a.setAttribute("aria-hidden","true"),a.style.left=`${(r.box.x-e.box.x)*i}px`,a.style.top=`${(r.box.y-e.box.y)*i}px`,a.style.display="block",a.style.overflow="visible",a.style.whiteSpace="pre";let s=e.lines[0],l=s?Math.max(o,...s.spans.map(p=>p.box.height+o),s.spans.length===0?s.box.height-(s.trailingSpacing??0):0):r.box.height,d=Math.min(l,r.box.height),c=Math.max(0,r.box.height-d);a.style.fontSize="0",a.style.boxSizing="border-box",a.style.paddingBottom=`${c*i}px`,a.style.lineHeight=`${d*i}px`;let y=t.createElement("span");return y.style.display="inline-block",y.style.verticalAlign="baseline",y.style.boxSizing="border-box",y.style.height=`${d*i}px`,y.style.paddingTop=`${o*i}px`,y.style.lineHeight=`${(d-o)*i}px`,Z(y,r.style,n),Rt(t,y,r.text,r.style,i),a.append(y),a}var Pn=512;function En(t,e,n,r,i){let o=r.tabLeader?Ua.get(r.tabLeader):void 0;if(!o||r.box.width<=0)return null;let a=i.scale,s=t.createElement("div");s.className="docx-tab-leader",s.dataset.docxTabLeader="",s.setAttribute("contenteditable","false"),s.setAttribute("aria-hidden","true"),s.style.position="absolute",r.tabLeader==="underscore"&&(s.style.zIndex="1"),s.style.left=`${(r.box.x-e.box.x)*a}px`,s.style.top=`${(n.box.y-e.box.y)*a}px`,s.style.width=`${r.box.width*a}px`,s.style.height=`${n.box.height*a}px`,s.style.overflow="hidden",s.style.whiteSpace="pre",s.style.pointerEvents="none",s.style.userSelect="none";let l=n.leading??0,d=Math.min(r.box.height+l,n.box.height),c=Math.max(0,n.box.height-d);s.style.fontSize="0",s.style.boxSizing="border-box",s.style.paddingBottom=`${c*a}px`,s.style.lineHeight=`${(n.box.height-c)*a}px`;let y=t.createElement("span");y.style.display="inline-block",y.style.verticalAlign="baseline",Z(y,r.style,i),y.style.boxSizing="border-box",y.style.height=`${d*a}px`,y.style.paddingTop=`${l*a}px`,y.style.lineHeight=`${(d-l)*a}px`,r.tabLeader==="heavy"&&(y.style.fontWeight="bold");let p=r.tabLeaderAdvancePt&&r.tabLeaderAdvancePt>0?r.tabLeaderAdvancePt:Math.max(.5,r.style.fontSizePt*.2),h=Math.min(Pn,Math.max(1,Math.floor(r.box.width/p)+2));return y.textContent=o.repeat(h),y.style.letterSpacing="0",s.append(y),s}function Ln(t,e,n){let r=e.shadingBox,i=D(t,"div",r,n);return i.className="docx-paragraph-shading",i.setAttribute("aria-hidden","true"),i.style.left=`${(r.x-e.box.x)*n}px`,i.style.top=`${(r.y-e.box.y)*n}px`,i.style.backgroundColor=`#${e.shading}`,i}function ft(t,e,n,r){let i=D(t,"div",n.box,r);i.className=`docx-paragraph-border docx-paragraph-border-${n.side}`,i.setAttribute("aria-hidden","true");let o=(n.box.x-e.box.x)*r,a=(n.box.y-e.box.y)*r,s=n.side==="left"||n.side==="right"||n.side==="bar",l=(s?n.box.width:n.box.height)*r,c=$n(n.edge.val)?l:Math.max(1,l);i.style.left=`${n.side==="right"?o-(c-l):o}px`,i.style.top=`${n.side==="bottom"?a-(c-l):a}px`,s?i.style.width=`${c}px`:i.style.height=`${c}px`;let y=n.edge.color&&N.test(n.edge.color)?n.edge.color:"000000";return i.style.backgroundColor=`#${y}`,Mn(i,n.edge.val,y,s,c,r),i}function $n(t){return t==="double"||t==="triple"||t==="doubleWave"||t.startsWith("thinThick")||t.startsWith("thickThin")}function Mn(t,e,n,r,i,o){switch(e){case "dashed":case "dashSmallGap":case "dotDash":case "dotDotDash":case "dashDotStroked":{let a=Math.max(4,4*o);t.style.backgroundImage=`linear-gradient(to ${r?"bottom":"right"}, #${n} 60%, transparent 60%)`,t.style.backgroundSize=r?`100% ${a}px`:`${a}px 100%`;return}case "dotted":{let a=Math.max(3,3*o);t.style.backgroundImage=`linear-gradient(to ${r?"bottom":"right"}, #${n} 35%, transparent 35%)`,t.style.backgroundSize=r?`100% ${a}px`:`${a}px 100%`;return}case "double":case "doubleWave":case "triple":case "thinThickSmallGap":case "thickThinSmallGap":case "thinThickThinSmallGap":case "thinThickMediumGap":case "thickThinMediumGap":case "thinThickThinMediumGap":case "thinThickLargeGap":case "thickThinLargeGap":case "thinThickThinLargeGap":{let a=Math.max(1,i/3);t.style.backgroundColor="transparent",r?(t.style.borderLeft=`${a}px solid #${n}`,t.style.borderRight=`${a}px solid #${n}`):(t.style.borderTop=`${a}px solid #${n}`,t.style.borderBottom=`${a}px solid #${n}`),t.style.boxSizing="border-box";return}case "threeDEmboss":case "ridge":{t.style.backgroundColor="transparent";let a=r?"borderLeft":"borderTop";t.style[a]=`${Math.max(1,i)}px ridge #${n}`,r?t.style.width="0px":t.style.height="0px";return}case "threeDEngrave":case "groove":{t.style.backgroundColor="transparent";let a=r?"borderLeft":"borderTop";t.style[a]=`${Math.max(1,i)}px groove #${n}`,r?t.style.width="0px":t.style.height="0px";return}case "inset":{t.style.backgroundColor="transparent";let a=r?"borderLeft":"borderTop";t.style[a]=`${Math.max(1,i)}px inset #${n}`,r?t.style.width="0px":t.style.height="0px";return}case "outset":{t.style.backgroundColor="transparent";let a=r?"borderLeft":"borderTop";t.style[a]=`${Math.max(1,i)}px outset #${n}`,r?t.style.width="0px":t.style.height="0px";return}default:return}}function Tn(t,e,n,r){let i=r.scale,o=D(t,"div",e.box,i);if(o.className="docx-table-cell",o.style.left=`${(e.box.x-n.x)*i}px`,o.style.top=`${(e.box.y-n.y)*i}px`,o.style.boxSizing="border-box",o.style.overflow="visible",o.dataset.cellId=e.id,o.dataset.gridColumn=String(e.gridColumn),o.dataset.gridSpan=String(e.gridSpan),e.rowSpan&&e.rowSpan>1&&(o.dataset.rowSpan=String(e.rowSpan)),e.paintInert||e.vMergeContinue)return o.dataset.vMergeContinue="true",o.style.border="none",o.style.backgroundColor="transparent",o;o.style.border="none",it(t,o,e.borders,i),e.shading&&N.test(e.shading)&&(o.style.backgroundColor=`#${e.shading}`);let a=at(t,e,i,o);for(let s of e.blocks){let l=s.kind==="table"?B(t,s,r):F(t,s,r);l.style.left=`${(s.box.x-e.box.x)*i}px`,l.style.top=`${(s.box.y-e.box.y)*i}px`,a.append(l);}return o}function B(t,e,n){let r=n.scale,i=D(t,"div",e.box,r);i.className="docx-table-fragment layout-table",i.dataset.tableId=e.tableId,i.dataset.fragmentIndex=String(e.fragmentIndex),i.style.overflow="visible";for(let o of e.rows){let a=D(t,"div",o.box,r);a.className="docx-table-row",o.revisionKind&&(a.classList.add("docx-table-row--revision",o.revisionKind==="insert"?"layout-revision-ins":"layout-revision-del"),a.dataset.revisionKind=o.revisionKind,o.revisionId!==void 0&&(a.dataset.revisionId=o.revisionId),o.revisionAuthor!==void 0&&(a.dataset.reviewAuthor=o.revisionAuthor),o.revisionDate!==void 0&&(a.dataset.revisionDate=o.revisionDate)),a.dataset.rowId=o.id,o.isHeaderRepeat&&(a.dataset.headerRepeat="true"),a.style.left=`${(o.box.x-e.box.x)*r}px`,a.style.top=`${(o.box.y-e.box.y)*r}px`,a.style.overflow="visible";for(let s of o.cells)a.append(Tn(t,s,o.box,n));i.append(a);}return i}function Dn(t,e,n,r,i){let o={...n,paintInstance:`p${e.index}`},a=D(t,"div",e.box,o.scale);if(a.className="docx-page",a.style.fontFamily=$,a.dataset.pageIndex=String(e.index),o.ariaHidden&&(a.setAttribute("aria-hidden","true"),a.setAttribute("role","presentation")),a.dataset.materialized=String(r),!r)return a;let s=Object.freeze({x:e.box.x,y:e.box.y,width:e.box.width,height:e.box.height}),l=Object.freeze({x:-(e.contentBox.x-e.box.x),y:-(e.contentBox.y-e.box.y),width:e.box.width,height:e.box.height});dt(t,a,e,o,l,"behind");for(let y of [e.header,e.footer])y?.anchoredDrawings?.length&&ln(t,a,y,y.anchoredDrawings,o,{x:e.box.x,y:e.box.y,width:e.box.width,height:e.box.height});let d=t.createElement("div");d.className="docx-page-content",d.style.position="absolute",d.style.left=`${(e.contentBox.x-e.box.x)*o.scale}px`,d.style.top=`${(e.contentBox.y-e.box.y)*o.scale}px`,d.style.width=`${e.contentBox.width*o.scale}px`,d.style.height=`${e.contentBox.height*o.scale}px`,o.activeHeaderFooterRId&&d.setAttribute("contenteditable","false");for(let y of e.columnSeparators??[]){let p=t.createElement("div");p.className="docx-column-separator",p.setAttribute("contenteditable","false"),p.style.position="absolute",p.style.left=`${y.x*o.scale}px`,p.style.top=`${y.y*o.scale}px`,p.style.width=`${y.width*o.scale}px`,p.style.height=`${y.height*o.scale}px`,p.style.backgroundColor="currentColor",p.style.pointerEvents="none",d.append(p);}let c=i?new Map:null;for(let y of e.fragments){let p=y.kind==="table"?B(t,y,o):F(t,y,o);c?.set(y,p),d.append(p);}i&&c&&(i.content=d,i.blocks=c),a.append(d),dt(t,a,e,o,l,"inFront"),Ce(t,a,e,o,F,B);for(let y of ["header","footer"]){if(e[y])continue;let p=t.createElement("div");p.className="docx-hf docx-hf--placeholder",p.dataset.docxHf=y,p.setAttribute("contenteditable","false");let h=y==="header"?e.contentBox.y-e.box.y:e.box.y+e.box.height-(e.contentBox.y+e.contentBox.height),u=Math.min(h,Hn);if(u<=0)continue;let g=Math.max(0,Math.min(In,h-u)),R=y==="header"?g:e.box.height-g-u;p.style.position="absolute",p.style.left=`${(e.contentBox.x-e.box.x)*o.scale}px`,p.style.top=`${R*o.scale}px`,p.style.width=`${e.contentBox.width*o.scale}px`,p.style.height=`${u*o.scale}px`,a.append(p);}for(let y of [e.header,e.footer]){if(!y)continue;let p=y.anchoredDrawings??[],h=V(y,e.index,o),u=t.createElement("div");u.className="docx-hf",u.dataset.docxHf=y.kind,y.rId&&(u.dataset.docxRId=y.rId),h?(u.dataset.docxHfActive="",u.setAttribute("contenteditable","true")):u.setAttribute("contenteditable","false"),u.style.position="absolute",u.style.left=`${(y.box.x-e.box.x)*o.scale}px`,u.style.top=`${(y.box.y-e.box.y)*o.scale}px`,u.style.width=`${y.box.width*o.scale}px`;let g=re(y,e,h);u.style.height=`${g*o.scale}px`,u.style.overflow="visible";let R=(e.box.x-y.box.x)*o.scale,k=(e.box.y-y.box.y)*o.scale,b=R+e.box.width*o.scale,E=k+e.box.height*o.scale;u.style.clipPath=`polygon(${R}px ${k}px, ${b}px ${k}px, ${b}px ${E}px, ${R}px ${E}px)`;let $=Object.freeze({x:0,y:0,width:y.box.width,height:y.box.height}),H=p.filter(f=>!mt(f)),M={...o,inertLinks:true};for(let f of y.fragments)u.append(f.kind==="table"?B(t,f,M):F(t,f,M));J(t,u,H,xt(o),$,"inFront",h),a.append(u);let w=t.createElement("div");w.className="docx-hf-edit-hint",w.dataset.docxHfHint=y.kind,w.setAttribute("contenteditable","false"),w.style.position="absolute",w.style.left=u.style.left,w.style.width=u.style.width,w.style.top=y.kind==="header"?`${(y.box.y+y.box.height-e.box.y)*o.scale}px`:`${(y.box.y-e.box.y)*o.scale}px`,y.kind==="footer"&&(w.style.transform="translateY(-100%)"),a.append(w),dn(t,a,y,p,o,s,"inFront",h);}return Bn(t,a,e,o),a}var Hn=30,In=36,Cn=16,Fn=new Set(["dropdown","comboBox","date","checkbox"]);function Bn(t,e,n,r){let i=r.contentControlChrome,o=i?.suppressedIds,a=(n.contentControls??[]).filter(p=>o?.has(p.id)!==true),s=[...a,...(i?.additionalBoundaries??[]).filter(p=>o?.has(p.id)!==true&&!a.some(h=>h.id===p.id))];if(s.length===0)return;let l=i?.showAll===true,d=i?.activeIds,c=i?.hoverIds,y=i?.tocControlIds;for(let p of s){let h=y?.has(p.id)===true,u=!h&&d?.has(p.id)===true,g=c?.has(p.id)===true;e.append(Nn(t,n,p,r.scale,u,g,l||u||h&&g,i?.checkedIds?.has(p.id),h,i?.readOnly===true));}}function Nn(t,e,n,r,i,o,a,s,l,d){let c=t.createElement("div");c.className="docx-content-control-chrome",c.dataset.docxContentControl=n.id,c.dataset.docxMarker="",c.dataset.controlType=n.controlType,c.dataset.lock=n.effectiveLock,n.bound&&(c.dataset.bound=""),n.placeholder&&(c.dataset.placeholder=""),l&&(c.dataset.docxToc=""),d&&(c.dataset.readOnly=""),i&&(c.dataset.active=""),o&&(c.dataset.hover=""),a&&(c.dataset.boundaryVisible=""),c.setAttribute("contenteditable","false"),c.setAttribute("role","group"),n.alias&&(c.dataset.alias=n.alias),n.tag&&(c.dataset.tag=n.tag),n.alias&&c.setAttribute("aria-label",n.alias),c.style.position="absolute",c.style.inset="0",c.style.pointerEvents="none",c.style.zIndex="2";let y=e.contentBox.x-e.box.x,p=e.contentBox.y-e.box.y;for(let u of n.fragments){if(u.pageIndex!==e.index)continue;let g=t.createElement("div");g.className="docx-content-control-boundary",g.dataset.docxMarker="",g.setAttribute("contenteditable","false"),g.setAttribute("aria-hidden","true"),g.style.position="absolute",g.style.left=`${(y+u.box.x)*r}px`,g.style.top=`${(p+u.box.y)*r}px`,g.style.width=`${Math.max(u.box.width,1)*r}px`,g.style.height=`${Math.max(u.box.height,1)*r}px`,g.style.pointerEvents="none",c.append(g);}let h=n.fragments.find(u=>u.pageIndex===e.index);if(h&&n.alias){let u=t.createElement("div");u.className="docx-content-control-label",u.dataset.docxMarker="",u.setAttribute("contenteditable","false"),u.setAttribute("aria-hidden","true"),u.textContent=n.alias,u.style.position="absolute",u.style.left=`${(y+h.box.x)*r}px`,u.style.top=`${Math.max(0,(p+h.box.y)*r-Cn)}px`,u.style.pointerEvents="none",c.append(u);}if(h&&Fn.has(n.controlType)){let u=t.createElement("button");u.type="button",u.className="docx-content-control-widget",u.dataset.docxMarker="",u.dataset.docxCcWidget=n.controlType,u.dataset.docxCcId=n.id,u.setAttribute("contenteditable","false"),u.setAttribute("tabindex","-1"),n.controlType==="checkbox"?u.setAttribute("role","checkbox"):n.controlType==="dropdown"||n.controlType==="comboBox"?u.setAttribute("role","listbox"):n.controlType==="date"&&u.setAttribute("role","button"),n.alias&&(u.dataset.name=n.alias),n.alias&&u.setAttribute("aria-label",n.alias),n.controlType==="checkbox"&&(u.setAttribute("data-checked",s?"true":"false"),u.setAttribute("aria-checked",s?"true":"false"));let g=n.effectiveLock==="contentLocked"||n.effectiveLock==="sdtContentLocked";(d||g||n.bound)&&(u.disabled=true,u.dataset.disabledReason=d?"readOnly":n.bound?"bound":"locked",u.setAttribute("aria-disabled","true")),u.style.position="absolute",u.style.left=`${(y+h.box.x+h.box.width)*r-18}px`,u.style.top=`${(p+h.box.y)*r}px`,u.style.width="16px",u.style.height="16px",u.style.pointerEvents="auto",u.style.padding="0",u.style.margin="0",u.style.cursor=u.disabled?"not-allowed":"pointer",c.append(u);}return c}var pe=new WeakMap;function _o(t){pe.delete(t);}function On(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Kn(t,e){let n=Object.keys(t);if(n.length!==Object.keys(e).length)return false;for(let r of n){let i=t[r],o=e[r];if(i!==o)return false}return true}function zn(t,e){if(t.length!==e.length)return false;for(let n=0;n<t.length;n+=1)if(t[n]!==e[n])return false;return true}function _n(t,e){if(t===e)return false;let n=new Set([...Object.keys(t),...Object.keys(e)]);for(let r of n){if(r==="fragments")continue;let i=t[r],o=e[r];if(i!==o&&!(Array.isArray(i)&&Array.isArray(o)&&zn(i,o))&&!(typeof i=="object"&&typeof o=="object"&&i!==null&&o!==null&&!Array.isArray(i)&&!Array.isArray(o)&&Kn(i,o)))return false}return true}var gt="docx-column-separator";function Un(t,e,n,r){let i=e.content,o=e.blocks;if(!i||!o||i.parentElement!==e.element)return null;let a={...r,paintInstance:`p${n.index}`},s=new Map,l=[];for(let p of n.fragments){let h=o.get(p)??(p.kind==="table"?B(t,p,a):F(t,p,a));s.set(p,h),l.push(h);}let d=new Set(l),c=i.firstChild;for(;c;){let p=c.nextSibling,h=c;!d.has(h)&&h.classList?.contains(gt)!==true&&c.remove(),c=p;}let y=i.firstChild;for(;y&&y.classList?.contains(gt);)y=y.nextSibling;for(let p of l){if(p===y){y=y.nextSibling;continue}i.insertBefore(p,y);}return {record:n,materialized:true,element:e.element,content:i,blocks:s}}function jn(t,e,n,r){let i=t.element;return !t.materialized&&On(t.record.box,e.box)&&i.style.left===`${e.box.x*n}px`&&i.style.top===`${e.box.y*n}px`&&i.style.width===`${e.box.width*n}px`&&i.style.height===`${e.box.height*n}px`&&i.getAttribute("aria-hidden")===(r?"true":null)}function Gn(t,e,n={}){Wn(t,e,n);}function Wn(t,e,n,r){t.classList.toggle("docx-show-paragraph-marks",n.showParagraphMarks??false);let i=n.contentControlChrome,o=i?`${i.showAll===true?"1":"0"}:${i.activeIds?[...i.activeIds].sort().join(","):""}:${i.checkedIds?[...i.checkedIds].sort().join(","):""}:${i.tocControlIds?[...i.tocControlIds].sort().join(","):""}:${i.suppressedIds?[...i.suppressedIds].sort().join(","):""}:${i.readOnly===true?"ro":""}`:"",a=n.drawingStrings??de,s=n.imageUrlPort!==void 0?Ue(t,n.imageUrlPort):null,l=i?.additionalBoundaries?i.additionalBoundaries.flatMap(f=>f.fragments.map(x=>`${f.id}:${x.pageIndex}:${x.box.x}:${x.box.y}:${x.box.width}:${x.box.height}`)).sort().join(","):"",d=n.readOnlyParagraphIds?[...n.readOnlyParagraphIds].sort().join(","):"",c=n.emptyTocPlaceholderIds?[...n.emptyTocPlaceholderIds].sort().join(","):"",y=i?.tocControlIds?[...i.tocControlIds].sort().join(","):"",p=De(n.revisionStyles,e,r),h={scale:n.scale??96/72,ariaHidden:n.ariaHidden??true,drawingStrings:a,urlRegistry:s,...n.fontAlias?{fontAlias:n.fontAlias}:{},...n.readOnlyParagraphIds?{readOnlyParagraphIds:n.readOnlyParagraphIds}:{},...n.emptyTocPlaceholderIds?{emptyTocPlaceholderIds:n.emptyTocPlaceholderIds}:{},...n.defaultFontFamily?{defaultFontFamily:n.defaultFontFamily}:{},...n.fieldShading?{fieldShading:n.fieldShading}:{},showParagraphMarks:n.showParagraphMarks??false,...n.shadeFormFields!==void 0?{shadeFormFields:n.shadeFormFields}:{},...p?{revisionStyles:p}:{},...n.imageUrlPort?{imageUrlPort:n.imageUrlPort}:{},...n.activeHeaderFooterRId?{activeHeaderFooterRId:n.activeHeaderFooterRId}:{},...n.activeHeaderFooterPageIndex!==void 0?{activeHeaderFooterPageIndex:n.activeHeaderFooterPageIndex}:{},...i?{contentControlChrome:i}:{}},u=t.ownerDocument,g=`${h.scale}|${h.ariaHidden}|${h.fontAlias?an(h.fontAlias):""}|${h.defaultFontFamily??""}|cc:${o}:${l}|toc:${y}|ro:${d}|tocEmpty:${c}|${n.imageUrlPort?"url":""}|${Qe(a)}|rev:${Te(p)}|marks:${n.showParagraphMarks??false}`,R=pe.get(t),k=R?.parameters===g,b=k?new Map(R.pages.map(f=>[f.record,f])):null,E=R?new Map(R.pages.map(f=>[f.record.index,f])):null,$=e.pages.map(f=>{let x=n.materialize?.has(f.index)??true,m=b?.get(f);if(m&&m.materialized===x)return m;let v=E?.get(f.index);if(!x&&v&&jn(v,f,h.scale,h.ariaHidden))return {record:f,materialized:false,element:v.element};if(k&&x&&v?.materialized&&_n(v.record,f)){let T=Un(u,v,f,h);if(T)return T}let S={},O=Dn(u,f,h,x,S);return {record:f,materialized:x,element:O,...S.content?{content:S.content}:{},...S.blocks?{blocks:S.blocks}:{}}});pe.set(t,{parameters:g,pages:$}),t.dataset.revision=String(e.revision),s&&s.reconcile(Ze(e),Je(e));let H=new Set($.map(f=>f.element)),M=t.firstChild;for(;M;){let f=M.nextSibling;H.has(M)||M.remove(),M=f;}let w=t.firstChild;for(let f of $){if(f.element===w){w=w.nextSibling;continue}t.insertBefore(f.element,w);}Fe($,h);}function Vn(t,e,n,r){let i=t.ownerDocument,o=r.scale,a=[];for(let s of n){let l=e.pages[s.pageIndex];if(!l)continue;let d=i.createElement("div");d.className=s.className??r.className??"docx-cell-selection-rect",d.style.position="absolute";let c=r.pageOffsetX?.get(s.pageIndex)??0;d.style.left=`${(l.contentBox.x+s.x+c)*o}px`,d.style.top=`${(l.contentBox.y+s.y)*o}px`,d.style.width=`${s.width*o}px`,d.style.height=`${s.height*o}px`,s.reviewAuthor&&(d.dataset.reviewAuthor=s.reviewAuthor.author,d.dataset.reviewAuthorSlot=String(s.reviewAuthor.slot%L),d.style.setProperty("--doc-review-author-current",s.reviewAuthor.color)),s.activeBackground!==void 0&&(d.style.backgroundColor=s.activeBackground,d.style.boxShadow="none"),a.push(d);}t.replaceChildren(...a);}
|
|
2
|
+
export{W as a,Me as b,Yn as c,Dt as d,Zn as e,fo as f,Qe as g,de as h,go as i,ue as j,yn as k,_o as l,Gn as m,Wn as n,Vn as o};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b}from'./chunk-4KMSEFIG.js';import {da}from'./chunk-CJCFEXTA.js';var z=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u,J=128,Q=/[\u0000-\u001F\u007F-\u009F]/,G=16,nn=2,en=3276;function V(e){return e.kind!=="textValue"}function P(e,n){for(let t of e.children)if(V(t)&&t.localName===n)return t}function O(e,n){return e.attributes.find(t=>t.localName===n)?.value}function D(e){return e===void 0||e.length===0||e.length>J||Q.test(e)?null:e}function v(e,n){let t=b(O(e,"asciiTheme"),n)??b(O(e,"hAnsiTheme"),n);if(t!==null)return t;let l=O(e,"ascii")??O(e,"hAnsi");return l===void 0?null:z.test(l)?l:null}function C(e,n){let t=b(O(e,"eastAsiaTheme"),n);if(t!==null)return t;let l=O(e,"eastAsia");return l===void 0?null:z.test(l)?l:null}function tn(e){return e!==void 0&&z.test(e)?e:null}function On(e){return tn(e)}function ln(e){return e!==void 0&&["ascii","hAnsi","asciiTheme","hAnsiTheme"].some(n=>!!O(e,n))}function Y(e,n){if(!e)return {fontFamily:null,fontSizeHalfPoints:null,hasLatinFontReference:false};let t=P(e,"rFonts"),l=P(e,"sz"),i=l?O(l,"val"):void 0,r=i!==void 0&&/^\d{1,4}$/.test(i)?Number(i):null;return {fontFamily:t?v(t,n):null,hasLatinFontReference:ln(t),fontSizeHalfPoints:r!==null&&r>=nn&&r<=en?r:null}}function Sn(e,n){let t=new Map,l={fontFamily:null,fontSizeHalfPoints:null,hasLatinFontReference:false};if(e){let a=P(e,"docDefaults"),s=a?P(a,"rPrDefault"):void 0;l=Y(s?P(s,"rPr"):void 0,n);for(let u of e.children){if(!V(u)||u.localName!=="style")continue;let o=D(O(u,"styleId"));if(o===null||t.has(o))continue;let f=P(u,"basedOn");t.set(o,{basedOn:D(f?O(f,"val"):void 0),own:Y(P(u,"rPr"),n)});}}let i=new Map,r=a=>{let s=a??"",u=i.get(s);if(u)return u;let o=null,f=null,m=l.hasLatinFontReference,b=new Set,y=a;for(let I=0;y!==null&&I<G&&!b.has(y);I+=1){b.add(y);let E=t.get(y);if(!E)break;o??=E.own.fontFamily,m||=E.own.hasLatinFontReference,f??=E.own.fontSizeHalfPoints,y=E.basedOn;}let g={hasLatinFontReference:m,fontFamily:o??l.fontFamily,fontSizeHalfPoints:f??l.fontSizeHalfPoints};return i.set(s,g),g};return (a,s)=>{let u=r(a),o=s?.find(b=>b.localName==="rFonts"),f=o?b(o.attributes?.asciiTheme,n)??b(o.attributes?.hAnsiTheme,n):null,m=["ascii","hAnsi","asciiTheme","hAnsiTheme"].some(b=>!!o?.attributes?.[b]);return {fontFamily:f??u.fontFamily??(!u.hasLatinFontReference&&!m?n.minor:null),fontSizeHalfPoints:u.fontSizeHalfPoints}}}var an=16,on=16,rn=32,sn=4096;function x(e){return e.kind!=="textValue"}function c(e,n){for(let t of e.children)if(x(t)&&t.localName===n)return t}function M(e,n){return e.attributes.find(t=>t.localName===n)?.value}function un(e){return e==="1"||e==="true"||e==="on"}function H(){return {families:new Map,styleIds:new Set,anyText:false,bareParagraph:false,bareRun:false,bareTable:false}}function _(e,n){for(let[t,l]of n.families)e.families.has(t)||e.families.set(t,l);for(let t of n.styleIds)e.styleIds.add(t);e.anyText||=n.anyText,e.bareParagraph||=n.bareParagraph,e.bareRun||=n.bareRun,e.bareTable||=n.bareTable;}function T(e,n){if(n===null)return;let t=n.toLowerCase();e.has(t)||e.set(t,n);}var fn=new Set(["tab","noBreakHyphen","softHyphen","footnoteRef","endnoteRef","footnoteReference","endnoteReference"]),dn=128;function cn(e){for(let n of e.attributes)if(n.localName==="font"&&!(n.namespaceUri!==da&&n.namespaceUri!==""))return n.value.length>0&&n.value.length<=dn;return false}function $(e,n){if(n?.has(e.id))return true;for(let t of e.children)if(!(!x(t)||t.namespaceUri!==da)){if(fn.has(t.localName))return true;if(t.localName==="sym"){if(!cn(t))return true;continue}if(!(t.localName!=="t"&&t.localName!=="delText")){for(let l of t.children)if(!x(l)&&l.value.length>0)return true}}return false}function mn(e){for(let n of e.children)if(!(!x(n)||n.namespaceUri!==da)&&!(n.localName!=="t"&&n.localName!=="delText")){for(let t of n.children)if(!x(t))for(let l of t.value){let i=l.codePointAt(0);if(i>=4352&&i<=4607||i>=11904&&i<=40959||i>=43360&&i<=43391||i>=44032&&i<=55295||i>=63744&&i<=64255||i>=65072&&i<=65103||i>=65280&&i<=65519||i>=131072&&i<=262143)return true}}return false}function K(e,n){let t=[e];for(;t.length>0;){let l=t.pop();if(x(l)){if(n?.has(l.id))return true;if(l.localName==="r"&&l.namespaceUri===da){if($(l,n))return true;continue}for(let i of l.children)t.push(i);}}return false}function yn(e,n,t,l){if(!$(e,l))return;n.anyText=true;let i=c(e,"rPr"),r=i?c(i,"rFonts"):void 0;r&&(T(n.families,v(r,t)),mn(e)&&T(n.families,C(r,t)));let a=i?c(i,"rStyle"):void 0,s=D(a?M(a,"val"):void 0);s!==null?n.styleIds.add(s):n.bareRun=true;}function gn(e,n,t){if(!t)return;n.anyText=true;let l=e.localName==="tbl",i=c(e,l?"tblPr":"pPr"),r=i?c(i,l?"tblStyle":"pStyle"):void 0,a=D(r?M(r,"val"):void 0);a!==null?n.styleIds.add(a):l?n.bareTable=true:n.bareParagraph=true;}function X(e){return (e.localName==="p"||e.localName==="tbl")&&e.namespaceUri===da}function U(e,n,t,l,i){e.namespaceUri===da&&(i?.has(e.id)&&e.localName==="fldSimple"&&(n.anyText=true,n.bareRun=true),e.localName==="r"?yn(e,n,t,i):X(e)&&gn(e,n,l));}var W=new WeakMap;function q(e,n,t){let l=W.get(e);if(l&&l.major===n.major&&l.minor===n.minor&&l.majorEastAsia===n.majorEastAsia&&l.minorEastAsia===n.minorEastAsia&&l.majorBidi===n.majorBidi&&l.minorBidi===n.minorBidi)return l.summary;let i=H();if(e.children.length>=on&&t<rn){for(let r of e.children)x(r)&&_(i,q(r,n,t+1));U(e,i,n,i.anyText);}else {let r=[e];for(;r.length>0;){let a=r.pop();if(!x(a))continue;let s=X(a)&&K(a);U(a,i,n,s);for(let u=a.children.length-1;u>=0;u-=1)r.push(a.children[u]);}}return W.set(e,{major:n.major,minor:n.minor,majorEastAsia:n.majorEastAsia,minorEastAsia:n.minorEastAsia,majorBidi:n.majorBidi,minorBidi:n.minorBidi,summary:i}),i}var xn={docDefaultFamilies:[],defaultParagraph:null,defaultCharacter:null,defaultTable:null,chainFamilies:()=>[]},Z=new WeakMap;function w(e,n){let t=c(e,"rPr"),l=t?c(t,"rFonts"):void 0;return l?v(l,n):null}function k(e,n){let t=c(e,"rPr"),l=t?c(t,"rFonts"):void 0;return l?C(l,n):null}function hn(e,n){let t=new Map,l=null,i=null,r=null,a=null,s=null,u=c(e,"docDefaults"),o=u?c(u,"rPrDefault"):void 0;o&&(l=w(o,n),i=k(o,n));let f=o?c(o,"rPr"):void 0,m=f?c(f,"rFonts"):void 0;m&&["ascii","hAnsi","asciiTheme","hAnsiTheme"].some(d=>!!M(m,d))||(l??=n.minor);let y=0;for(let d of e.children){if(!x(d)||d.localName!=="style")continue;if(y>=sn)break;y+=1;let h=D(M(d,"styleId"));if(h===null)continue;let S=c(d,"basedOn"),F=[];for(let p of d.children){if(!x(p)||p.localName!=="tblStylePr")continue;let L=w(p,n);L!==null&&F.push(L);let R=k(p,n);R!==null&&F.push(R);}t.set(h,{basedOn:D(S?M(S,"val"):void 0),family:w(d,n),eastAsiaFamily:k(d,n),conditionalFamilies:F});let A=un(M(d,"default")),j=M(d,"type");j==="paragraph"?A?r=h:r===h&&(r=null):j==="character"?A?a=h:a===h&&(a=null):j==="table"&&(A?s=h:s===h&&(s=null));}let g=new Map,I=d=>{if(d===null)return [];let h=g.get(d);if(h)return h;let S=[],F=null,A=null,j=new Set,p=d;for(let L=0;p!==null&&L<an&&!j.has(p);L+=1){j.add(p);let R=t.get(p);if(!R)break;F??=R.family,A??=R.eastAsiaFamily,S.push(...R.conditionalFamilies),p=R.basedOn;}return F!==null&&S.unshift(F),A!==null&&S.unshift(A),g.set(d,S),S};return {docDefaultFamilies:[l,i].filter(d=>d!==null),defaultParagraph:r,defaultCharacter:a,defaultTable:s,chainFamilies:I}}function bn(e,n){if(!e)return {...xn,docDefaultFamilies:n.minor?[n.minor]:[]};let t=Z.get(e);if(t&&t.major===n.major&&t.minor===n.minor&&t.majorEastAsia===n.majorEastAsia&&t.minorEastAsia===n.minorEastAsia&&t.majorBidi===n.majorBidi&&t.minorBidi===n.minorBidi)return t.index;let l=hn(e,n);return Z.set(e,{major:n.major,minor:n.minor,majorEastAsia:n.majorEastAsia,minorEastAsia:n.minorEastAsia,majorBidi:n.majorBidi,minorBidi:n.minorBidi,index:l}),l}function En(e,n,t,l){let i=H(),r=new Map;for(let o of e){let f=H();for(let m of o.children){if(!x(m))continue;if(!l||l.size===0){_(f,q(m,t,0));continue}let b=H(),y=[m];for(;y.length>0;){let g=y.pop();if(!x(g))continue;let I=X(g)&&K(g,l);U(g,b,t,I,l);for(let E=g.children.length-1;E>=0;E-=1)y.push(g.children[E]);}_(f,b);}_(i,f);for(let m of f.families.values())T(r,m);}let a=bn(n,t),s=new Map;for(let o of i.styleIds)for(let f of a.chainFamilies(o))T(s,f);if(i.bareParagraph)for(let o of a.chainFamilies(a.defaultParagraph))T(s,o);if(i.bareRun)for(let o of a.chainFamilies(a.defaultCharacter))T(s,o);if(i.bareTable)for(let o of a.chainFamilies(a.defaultTable))T(s,o);if(i.anyText)for(let o of a.docDefaultFamilies)T(s,o);for(let o of r.keys())s.delete(o);let u=[...s.values()].sort((o,f)=>o<f?-1:o>f?1:0);return Object.freeze({direct:Object.freeze([...r.values()]),inherited:Object.freeze(u)})}function An(e,n,t){let l=En(e,n,t),i=[...l.direct,...l.inherited];return i.sort((r,a)=>r<a?-1:r>a?1:0),i}export{tn as a,On as b,Sn as c,En as d,An as e};
|