@docx-editor.dev/core 2.1.3 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -5
- package/dist/automation.cjs +1 -1
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.js +1 -1
- package/dist/{chunk-TBBXCC7D.js → chunk-2QPRJAHK.js} +3 -3
- package/dist/chunk-3JENXX7Q.cjs +2 -0
- package/dist/chunk-5WEA7SIG.cjs +12 -0
- package/dist/chunk-73X5I53C.cjs +2 -0
- package/dist/chunk-7D2CP2J7.js +2 -0
- package/dist/{chunk-O2WQY7IT.cjs → chunk-C3YJR64Q.cjs} +5 -5
- package/dist/chunk-EWRKYYUA.js +12 -0
- package/dist/{chunk-PC76F2HR.cjs → chunk-GLHPDILJ.cjs} +1 -1
- package/dist/{chunk-REZUWYB7.js → chunk-GRGRIDHF.js} +1 -1
- package/dist/{chunk-HBL3NNH5.cjs → chunk-MIUELYVA.cjs} +1 -1
- package/dist/chunk-PD4BVZW5.js +12 -0
- package/dist/chunk-PEIEVTWR.js +2 -0
- package/dist/chunk-QIFQTG57.cjs +10 -0
- package/dist/chunk-RFO2O56I.js +10 -0
- package/dist/chunk-SAUKKJWZ.cjs +12 -0
- package/dist/chunk-WKZR6YPE.js +1 -0
- package/dist/contracts/editor.cjs +1 -1
- package/dist/contracts/editor.d.cts +3 -3
- package/dist/contracts/editor.d.ts +3 -3
- package/dist/contracts/editor.js +1 -1
- package/dist/contracts/interaction.d.cts +4 -4
- package/dist/contracts/interaction.d.ts +4 -4
- package/dist/{editor-BGBZn9c9.d.cts → editor-25RmHnxu.d.cts} +64 -2
- package/dist/{editor-DQRRxKMG.d.ts → editor-C8oaTHr3.d.ts} +64 -2
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +86 -11
- package/dist/editor.d.cts +52 -12
- package/dist/editor.d.ts +52 -12
- package/dist/editor.js +1 -1
- package/dist/{index-BzqHsd4Y.d.ts → index-BWiuzoVN.d.ts} +33 -6
- package/dist/{index-DptRpcqa.d.cts → index-Beyo2mTa.d.cts} +33 -6
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.cts +97 -63
- package/dist/layout.d.ts +97 -63
- package/dist/layout.js +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.cts +4 -101
- package/dist/output.d.ts +4 -101
- package/dist/output.js +1 -1
- package/dist/{review-reads-CsoXSvUg.d.ts → review-reads-CMAqdMnE.d.ts} +1 -1
- package/dist/{review-reads-qW0jvdF1.d.cts → review-reads-D3r3tnoo.d.cts} +1 -1
- package/dist/{semantic-cell-selection-DwLB71fF.d.cts → semantic-cell-selection-CI3loBKq.d.cts} +2 -2
- package/dist/{semantic-cell-selection-D_8RbPII.d.ts → semantic-cell-selection-Cx8P64j2.d.ts} +2 -2
- package/dist/{semantic-interaction-DqcEonqD.d.cts → semantic-interaction-B4HrJFQ2.d.cts} +1 -1
- package/dist/{semantic-interaction-CXH2wFqi.d.ts → semantic-interaction-unGpRNCk.d.ts} +1 -1
- package/dist/semantic-paint-BBNaqr1s.d.ts +133 -0
- package/dist/semantic-paint-DdGGra4m.d.cts +133 -0
- package/dist/{semantic-records-zTC0_1zi.d.ts → semantic-records-BC4bIKKL.d.ts} +28 -32
- package/dist/{semantic-records-COVFW5aS.d.cts → semantic-records-DC6V1U3T.d.cts} +28 -32
- package/dist/{shaped-measurer-CZXL-a6v.d.ts → shaped-measurer-ChSWkuAT.d.ts} +1 -1
- package/dist/{shaped-measurer-AFnFxoot.d.cts → shaped-measurer-SIqZp-Ty.d.cts} +1 -1
- package/dist/store.cjs +1 -1
- package/dist/store.d.cts +36 -15
- package/dist/store.d.ts +36 -15
- package/dist/store.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-2DTQDAN7.js +0 -2
- package/dist/chunk-3HEU7MHP.js +0 -12
- package/dist/chunk-3JKQE4QJ.cjs +0 -2
- package/dist/chunk-6WIIHJFY.js +0 -1
- package/dist/chunk-BZK64YU3.cjs +0 -10
- package/dist/chunk-EDLUMMQN.cjs +0 -12
- package/dist/chunk-JQFDLZXQ.cjs +0 -2
- package/dist/chunk-QRAUDDVY.js +0 -2
- package/dist/chunk-STCITBJK.js +0 -12
- package/dist/chunk-TSXT537P.cjs +0 -12
- package/dist/chunk-Y7TA7TPF.js +0 -10
- package/dist/semantic-paint-drawings-B5Wk2so5.d.ts +0 -21
- package/dist/semantic-paint-drawings-x8g44lD_.d.cts +0 -21
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {t,u,G,w as w$1,B as B$1,A,z,xc,Cc,Ea,Ca,Ha,Aa,o,ca,oe,me,Fa,Ja,ke,Ga,yb,af,We as We$1,Se,Oe,Eb,Ra,ba,Jc,la,q as q$1,ua,wa,Yb,jc,Jb,Lb,va,ka,pa,oa}from'./chunk-RFO2O56I.js';import {strFromU8,strToU8}from'fflate';var $t=["extension","capability","command","query","schema","dependencyKey","runtimePort","result","origin"],At=/^[a-z0-9]+(?:-[a-z0-9]+)*(?:\.[a-z0-9]+(?:-[a-z0-9]+)*)+$/,Dt=/^@[a-z0-9.-]+\/[a-z0-9.-]+(?:#[a-z0-9]+(?:[/._-][a-z0-9]+)*)?$/;function rt(e){return At.test(e)||Dt.test(e)}function Y(e,t){if(!rt(e))throw new Error(`invalid ${t??"registry"} id ${JSON.stringify(e)}: must be reverse-domain (dev.docx-editor.core.x) or package-owned (@scope/pkg#kind/name)`)}var Ft=/^(\d+)\.(\d+)\.(\d+)$/;function k(e){let t=Ft.exec(e);if(!t)throw new Error(`invalid semantic version: ${JSON.stringify(e)}`);return {major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3])}}function J(e,t){return e.major!==t.major?e.major<t.major?-1:1:e.minor!==t.minor?e.minor<t.minor?-1:1:e.patch!==t.patch?e.patch<t.patch?-1:1:0}function q(e,t){let r=k(e),n=t.trim();if(n==="*")return true;if(n.startsWith("^")){let o=k(n.slice(1));return J(r,o)<0?false:o.major>0?r.major===o.major:o.minor>0?r.major===0&&r.minor===o.minor:r.major===0&&r.minor===0}if(n.includes(" ")){let o=n.split(/\s+/);if(o.length!==2)throw new Error(`unsupported version range: ${JSON.stringify(t)}`);let s=true;for(let a of o){let i=a.startsWith(">=")?">=":a.startsWith("<")?"<":null;if(!i)throw new Error(`unsupported version range: ${JSON.stringify(t)}`);let d=k(a.slice(i.length)),l=J(r,d);i===">="?s=s&&l>=0:s=s&&l<0;}return s}return J(r,k(n))===0}var h=class extends Error{constructor(r,n,o=[]){super(n);this.code=r;this.responsible=o;this.name="RegistryError";}code;responsible},_e=(e,t)=>`${e}:${t}`;function Lt(e,t={}){let r=new Map;for(let l of e){if(Y(l.id,"extension"),nt(l.version,l.id),r.has(l.id))throw new h("duplicate-extension",`duplicate extension id ${l.id}`,[l.id]);r.set(l.id,l);for(let c of l.contributions)Y(c.id,c.kind),nt(c.version,`${l.id} \u2192 ${c.id}`),c.replaces&&Ht(c.replaces.targetRange,`${l.id} \u2192 replaces ${c.replaces.targetId}`);}for(let l of e){for(let c of l.dependencies??[])if(!r.has(c))throw new h("missing-dependency",`${l.id} requires missing extension ${c}`,[l.id,c]);for(let c of l.conflicts??[])if(r.has(c)){let p=[l.id,c].sort();throw new h("conflict",`extensions ${p[0]} and ${p[1]} conflict`,p)}}Bt(r);let n=new Set(t.availablePorts??[]);for(let l of e)for(let c of l.contributions)c.kind==="runtimePort"&&n.add(c.id);for(let l of e)for(let c of l.requiredPorts??[])if(!n.has(c))throw new h("missing-port",`${l.id} requires unavailable port ${c}`,[l.id,c]);let o=new Map,s=new Map,a=new Map;for(let l of e)for(let c of l.contributions){let p=_e(c.kind,c.id);if(c.replaces){let u=_e(c.kind,c.replaces.targetId),m=a.get(u)??[];m.push({ext:l.id,c}),a.set(u,m);continue}if(s.has(p)){let u=[o.get(p),l.id].sort();throw new h("id-collision",`${c.kind} id ${c.id} registered by both ${u[0]} and ${u[1]}`,u)}s.set(p,c),o.set(p,l.id);}let i=new Map(s);for(let[l,c]of a){let p=s.get(l);if(!p){let f=c[0];throw new h("replacement-target-missing",`${f.ext} replaces missing target ${f.c.replaces.targetId}`,[f.ext,f.c.replaces.targetId])}let u=p.replaceable??{kind:"none"};for(let{ext:f,c:y}of c){if(!q(p.version,y.replaces.targetRange))throw new h("replacement-version-mismatch",`${f} replaces ${y.replaces.targetId}@${p.version} outside range ${y.replaces.targetRange}`,[f,y.replaces.targetId]);if(u.kind==="none")throw new h("unauthorized-replacement",`${y.replaces.targetId} does not authorize replacement (attempted by ${f})`,[f,y.replaces.targetId])}let m=Mt(p,c);i.set(l,m);}return {extensions:r,contributions:i,get:(l,c)=>i.get(_e(l,c))}}function Mt(e,t){let r=e.replaceable??{kind:"none"};if(t.length===1)return t[0].c;if(r.kind==="priority"){let o=[...t].sort((i,d)=>(d.c.replaces.priority??0)-(i.c.replaces.priority??0)),s=o[0].c.replaces.priority??0,a=o.filter(i=>(i.c.replaces.priority??0)===s);if(a.length>1){let i=a.map(d=>d.ext).sort();throw new h("ambiguous-replacement",`multiple replacers of ${e.id} share top priority ${s}: ${i.join(", ")}`,i)}return o[0].c}let n=t.map(o=>o.ext).sort();throw new h("ambiguous-replacement",`multiple replacers of ${e.id}: ${n.join(", ")}`,n)}function Bt(e){let o=new Map,s=[],a=i=>{o.set(i,1),s.push(i);let d=[...e.get(i)?.dependencies??[]].sort();for(let l of d){let c=o.get(l)??0;if(c===1){let p=s.indexOf(l),u=[...s.slice(p),l];throw new h("dependency-cycle",`dependency cycle: ${u.join(" -> ")}`,u)}c===0&&a(l);}s.pop(),o.set(i,2);};for(let i of [...e.keys()].sort())(o.get(i)??0)===0&&a(i);}function nt(e,t){try{k(e);}catch{throw new h("invalid-version",`invalid version ${JSON.stringify(e)} in ${t}`,[t])}}function Ht(e,t){try{q("0.0.0",e);}catch{throw new h("invalid-version",`invalid version range ${JSON.stringify(e)} in ${t}`,[t])}}var S=class extends Error{constructor(t){super(t),this.name="BudgetError";}},M=class e{constructor(t,r){this.label=t;this.capacity=r;this.used=new G(`${t}.budget`,r);}label;capacity;used;children=new Set;activeReservations=0;cleanups=[];disposed=false;carveAmount=0;parent;get inUse(){return this.used.current}get available(){return this.used.remaining}get isDisposed(){return this.disposed}reserve(t){this.assertLive(),this.used.add(t),this.activeReservations+=1;let r=false,n=this;return {amount:t,get released(){return r},release(){r||(r=true,n.used.release(t),n.activeReservations-=1);}}}child(t,r){this.assertLive(),this.used.add(r);let n=new e(t,r);return n.parent=this,n.carveAmount=r,this.children.add(n),n}onRelease(t){this.assertLive(),this.cleanups.push(t);}dispose(){if(this.disposed)return;if(this.children.size>0)throw new S(`${this.label}: cannot release with ${this.children.size} child budget(s) outstanding`);if(this.activeReservations>0)throw new S(`${this.label}: cannot release with ${this.activeReservations} reservation(s) outstanding`);let t=[];for(let r=this.cleanups.length-1;r>=0;r--)try{this.cleanups[r]();}catch(n){t.push(n);}if(this.disposed=true,this.parent&&(this.parent.children.delete(this),this.parent.used.release(this.carveAmount),this.parent=void 0),t.length>0)throw new S(`${this.label}: ${t.length} cleanup error(s); first: ${String(t[0])}`)}assertLive(){if(this.disposed)throw new S(`${this.label}: budget already released`)}};var Q=class extends Error{constructor(r,n){super(n?`cancelled: ${n}`:"cancelled");this.derivedOnly=r;this.name="CancellationError";}derivedOnly},B=class{_cancelled=false;_phase="pre-publication";_reason;cancel(t){this._cancelled=true,t!==void 0&&(this._reason=t);}markPublished(){this._phase="post-publication";}get isCancelled(){return this._cancelled}get phase(){return this._phase}get isPublished(){return this._phase==="post-publication"}get derivedOnly(){return this._cancelled&&this._phase==="post-publication"}get token(){let t=this;return {get isCancelled(){return t._cancelled},get phase(){return t._phase},get derivedOnly(){return t.derivedOnly},checkpoint(){if(t._cancelled)throw new Q(t.derivedOnly,t._reason)}}}};var Z=class extends Error{constructor(r){super(`runtime port not available: ${r}`);this.portId=r;this.name="PortResolutionError";}portId},$e=class{ports=new Map;provide(t,r){return this.ports.set(t,r),this}has(t){return this.ports.has(t)}resolve(t){if(!this.ports.has(t))throw new Z(t);return this.ports.get(t)}missing(t){return t.filter(r=>!this.ports.has(r))}availablePorts(){return [...this.ports.keys()]}clock(){return this.resolve(w$1.clock)}identity(){return this.resolve(w$1.identity)}},Ae=class{constructor(t=0,r=1){this.step=r;this.t=t;}step;t;now(){let t=this.t;return this.t+=this.step,t}},De=class{constructor(t="id"){this.prefix=t;}prefix;n=0;newId(){return this.n+=1,`${this.prefix}-${this.n}`}};function Ut(e){let t=B$1(e.limits),r=Object.freeze({...e.config??{}}),n=e.capacity??t.maxDecompressedBytes,o=e.id??"op",s={id:o,limits:t,config:r,ports:e.ports,budget:new M(`op:${o}`,n),cancellation:new B};return Object.freeze(s)}function Vt(e){e.budget.dispose();}var Le=Object.freeze({maxRecursionDepth:{unit:"depth",phase:"xml-parse"},maxElementCount:{unit:"count",phase:"xml-parse"},maxPartCount:{unit:"count",phase:"package-read"},maxDecompressedBytes:{unit:"bytes",phase:"package-read"},maxCompressedBytes:{unit:"bytes",phase:"package-read"},maxCompressionRatio:{unit:"ratio",phase:"package-read"},maxChunkBytes:{unit:"bytes",phase:"package-read"},maxPaginationPasses:{unit:"passes",phase:"layout"},maxQueueDepth:{unit:"count",phase:"output"}}),ot=Object.keys(Le);function Xt(e,t){return new G(`${Le[t].phase}:${t}`,e[t])}var Fe=class{counter;current=0;peak=0;constructor(t){this.counter=new G("memory",t);}allocate(t){this.counter.add(t),this.current+=t,this.current>this.peak&&(this.peak=this.current);}free(t){this.counter.release(t),this.current=Math.max(0,this.current-t);}get currentBytes(){return this.current}get peakBytes(){return this.peak}reset(){this.counter.release(this.current),this.current=0;}};function jt(){for(let e of ot){let t=A[e],r=z[e];if(!Number.isFinite(t)||t<=0)throw new Error(`default ${e} must be finite > 0`);if(!Number.isFinite(r)||r<=0)throw new Error(`ceiling ${e} must be finite > 0`);if(t>r)throw new Error(`default ${e} exceeds ceiling`)}}function H(e,t=new Set){let r=new WeakSet,n=o=>{if(o===null)return "null";let s=typeof o;if(s==="boolean")return o?"true":"false";if(s==="number"){let a=o;if(!Number.isFinite(a))throw new Error(`non-finite number is not comparable: ${a}`);return Object.is(a,-0)?"0":String(a)}if(s==="string")return JSON.stringify(o);if(s==="bigint")return `${o.toString()}n`;if(Array.isArray(o))return `[${o.map(n).join(",")}]`;if(s==="object"){let a=o;if(r.has(a))throw new Error("cannot canonicalize a cyclic structure");r.add(a);let d=Object.keys(a).filter(l=>!t.has(l)).sort().map(l=>`${JSON.stringify(l)}:${n(a[l])}`).join(",");return r.delete(a),`{${d}}`}throw new Error(`unsupported value type in comparator input: ${s}`)};return n(e)}function Me(e,t){let r=H(e,t),n=0xcbf29ce484222325n,o=0x100000001b3n,s=0xffffffffffffffffn;for(let a=0;a<r.length;a++)n^=BigInt(r.charCodeAt(a)),n=n*o&s;return n.toString(16).padStart(16,"0")}var R="dev.docx-editor.core.comparator",Be={authoredState:{id:`${R}.authored-state`,mode:"canonical-exact",ephemera:["revision","provenance","producedAt","commitId"],note:"canonical normalized authored records; ephemera excluded"},anchor:{id:`${R}.anchor`,mode:"exact",ephemera:[],note:"internal anchor identity/affinity compares exactly"},yjsStateVector:{id:`${R}.yjs-state-vector`,mode:"sync-optimization-only",ephemera:[],note:"exchange optimization only; never proves update or delete-set coverage"},shapedRun:{id:`${R}.shaped-run`,mode:"exact",ephemera:[],note:"glyph ids, clusters, and fixed-point advances compare exactly"},paginationFingerprint:{id:`${R}.pagination-fingerprint`,mode:"exact",ephemera:[],note:"page/column boundaries, break causes, fixed-point geometry compare exactly"},semanticTree:{id:`${R}.semantic-tree`,mode:"exact",ephemera:[],note:"reading order, roles, headings, alt text compare exactly"},hitTest:{id:`${R}.hit-test`,mode:"exact",ephemera:[],note:"resolved hit target and cluster affinity compare exactly"},pdfSemantics:{id:`${R}.pdf-semantics`,mode:"canonical-exact",ephemera:["objectNumber","producer","creationDate","modDate","subsetTag"],note:"canonical semantic PDF objects; container ephemera excluded"},rasterCheckpoint:{id:`${R}.raster-checkpoint`,mode:"tolerance",ephemera:[],note:"documented unavoidable raster comparison; explicit tolerance only"},benchmarkEvidence:{id:`${R}.benchmark-evidence`,mode:"sync-optimization-only",ephemera:[],note:"diagnostic evidence, not an equivalence basis"}};function He(e,t,r,n={}){let o=Be[e];switch(o.mode){case "sync-optimization-only":throw new Error(`${o.id} is not an equivalence basis (${o.note})`);case "tolerance":{if(n.epsilon===void 0)throw new Error(`${o.id} requires an explicit epsilon`);return {equal:it(t,r,n.epsilon)}}case "exact":case "canonical-exact":{let s=o.mode==="canonical-exact"?new Set(o.ephemera):new Set,a=H(t,s),i=H(r,s);return a===i?{equal:true}:{equal:false,left:a,right:i}}}}function Ue(e,t){let r=Be[e];if(r.mode==="tolerance"||r.mode==="sync-optimization-only")throw new Error(`${r.id} has no canonical fingerprint (${r.mode})`);let n=r.mode==="canonical-exact"?new Set(r.ephemera):void 0;return Me(t,n)}function it(e,t,r){return typeof e=="number"&&typeof t=="number"?Number.isFinite(e)&&Number.isFinite(t)&&Math.abs(e-t)<=r:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((n,o)=>it(n,t[o],r)):false}var st=new Set([...t,...u]),at=/^[0-9a-f]{16}$/,Kt=/^[0-9a-f]*$/;function Ve(e){let t=[],r=o=>t.push(o);e.formatVersion!==1&&r(`unsupported formatVersion ${e.formatVersion}`),e.documentId||r("documentId is required"),e.source.kind==="docx"&&!/^[0-9a-f]{64}$/.test(e.source.sha256)&&r("docx source requires a 64-hex sha256");let n=-1;e.steps.forEach((o,s)=>{let a=`step[${s}]`;st.has(o.origin)||r(`${a}: unknown origin ${o.origin}`),(!Number.isInteger(o.baseRevision)||o.baseRevision<0)&&r(`${a}: baseRevision must be a non-negative integer`),o.baseRevision<n&&r(`${a}: baseRevision regressed below ${n}`);let i=o.expect;i.outcome==="applied"?(i.committedRevision===void 0?r(`${a}: applied step needs committedRevision`):i.committedRevision<=o.baseRevision?r(`${a}: committedRevision ${i.committedRevision} must exceed baseRevision ${o.baseRevision}`):n=i.committedRevision,i.modelChange&&Gt(i.modelChange,a,r)):(i.committedRevision!==void 0&&r(`${a}: ${i.outcome} step must not commit a revision`),i.authoredStateHash!==void 0&&r(`${a}: ${i.outcome} step must not change authored state`)),i.authoredStateHash!==void 0&&!at.test(i.authoredStateHash)&&r(`${a}: authoredStateHash must be 16-hex`),i.outputHash!==void 0&&!at.test(i.outputHash)&&r(`${a}: outputHash must be 16-hex`);});for(let o of [...e.snapshots??[],...e.updates??[]])o.documentId!==e.documentId&&r(`envelope documentId ${o.documentId} != ${e.documentId}`),Kt.test(o.bytesHex)||r("envelope bytesHex must be hex"),o.bytesHex.length!==o.byteLength*2&&r(`envelope byteLength ${o.byteLength} disagrees with ${o.bytesHex.length/2} decoded bytes`);return {valid:t.length===0,errors:t}}function Gt(e,t,r){st.has(e.origin)||r(`${t}: modelChange origin ${e.origin} unknown`),e.toRevision<=e.fromRevision&&r(`${t}: modelChange revision must advance`);}function zt(e,t){let r=Ve(e);if(!r.valid)return {ok:false,mismatches:r.errors};let n=[];return t.init(e),e.steps.forEach((o,s)=>{let a=`step[${s}]`,i=t.applyStep(o),d=o.expect;if(i.outcome!==d.outcome){n.push(`${a}: outcome ${i.outcome} != expected ${d.outcome}`);return}if(d.outcome==="applied"&&(i.committedRevision!==d.committedRevision&&n.push(`${a}: revision ${i.committedRevision} != expected ${d.committedRevision}`),d.authoredStateHash!==void 0))if(i.authoredState===void 0)n.push(`${a}: store returned no authored state to hash`);else {He("authoredState",i.authoredState,i.authoredState).equal||n.push(`${a}: authored state is not self-consistent`);let c=lt(i.authoredState);c!==d.authoredStateHash&&n.push(`${a}: authoredStateHash ${c} != expected ${d.authoredStateHash}`);}}),{ok:n.length===0,mismatches:n}}function lt(e){return Ue("authoredState",e)}var Wt=new Map([["embedRegular","regular"],["embedBold","bold"],["embedItalic","italic"],["embedBoldItalic","boldItalic"]]),Yt=32;function pt(e,t){let r=t.replace(/[^0-9a-fA-F]/g,"");if(r.length!==32)return null;let n=new Uint8Array(16);for(let a=0;a<16;a+=1){let i=Number.parseInt(r.slice(a*2,a*2+2),16);if(Number.isNaN(i))return null;n[15-a]=i;}let o=new Uint8Array(e),s=Math.min(Yt,o.length);for(let a=0;a<s;a+=1)o[a]=o[a]^n[a%16];return o}var Xe=(e,t)=>{if(!(e.kind==="textValue"||!("attributes"in e))){for(let r of e.attributes??[])if(r.localName===t)return r.value}},ct=e=>e.kind==="textValue"?[]:e.children??[],dt=e=>e.kind==="textValue"||!("localName"in e)?"":e.localName;function Jt(e,t,r){for(let n of e.relationships.get(t)??[]){if(n.id!==r)continue;if(n.targetMode==="External")return null;let o=q$1(t,n.rawTarget);return o.ok?o.partName:null}return null}function qt(e,t,r={}){if(!t)return [];let n=r.maxFontBytes??16*1024*1024,o=r.maxFonts??64,s=[],a=new Map,i=d=>{if(!(s.length>=o)){if(dt(d)==="font"){let l=Xe(d,"name");if(l&&l.length<=128)for(let c of ct(d)){if(s.length>=o)return;let p=Wt.get(dt(c));if(!p)continue;let u=Xe(c,"id"),m=Xe(c,"fontKey");if(!u||!m)continue;let f=Jt(e,t.name,u);if(!f)continue;let y=e.partBytes.get(f);if(!y||y.length===0||y.length>n)continue;let g=a.get(f);if(g){s.push({family:l,style:p,bytes:g,partName:f});continue}let O=pt(y,m);O&&(a.set(f,O),s.push({family:l,style:p,bytes:O,partName:f}));}}for(let l of ct(d))i(l);}};return i(t.root),s}function ut(e){if(e.kind!=="textValue")for(let t of e.children){if(t.kind==="textValue")continue;if(t.kind==="hyperlink"){let n=Ra(t);if(n!==void 0&&n.length>0)return n}let r=ut(t);if(r!==void 0)return r}}function Qt(e){let t="",r=false,n=o=>{if(!(r||o.kind==="textValue")){if(o.kind==="tab"||o.localName==="ptab"||o.localName==="tab"){r=true;return}if(o.kind==="text"||o.localName==="t"){for(let s of o.children)s.kind==="textValue"&&(t+=s.value);return}for(let s of o.children)n(s);}};return n(e),Cc(t)}function Zt(e,t,r,n){let o=r.filter(d=>{if(n.has(d.blockId))return false;let l=d.level+1;return l>=t.instruction.outlineStart&&l<=t.instruction.outlineEnd}),s=new Set(o.map(d=>d.blockId)),a=xc(e),i=new Map;for(let d of o){let l=Cc(d.text),c=i.get(l);c?c.push(d.blockId):i.set(l,[d.blockId]);}return t.resultParagraphIds.map(d=>{let l=Ea(e,d);if(!l||l.kind==="textValue")return null;let c=ut(l),p=c===void 0?void 0:a.get(c);if(p&&s.has(p.paragraphId)){let f=i.get(Cc(o.find(g=>g.blockId===p.paragraphId)?.text??"")),y=f?.indexOf(p.paragraphId)??-1;return f&&y>=0&&f.splice(y,1),p.paragraphId}let u=Qt(l);if(u.length===0)return null;let m=i.get(u);return !m||m.length===0?null:m.shift()??null})}function C(e){return e.namespaceUri===la?e.localName:`{${e.namespaceUri}}${e.localName}`}function I(e){let t=[];for(let r of e.attributes)t.push(r.namespaceUri===""||r.namespaceUri===la?`${r.localName}=${r.value}`:`{${r.namespaceUri}}${r.localName}=${r.value}`);return t.sort(),t}function ft(e,t){let r=I(e),n=r.length>0?`${C(e)}(${r.join(",")})`:C(e);if(t>=ba)return n;let o=[];for(let s of e.children){if(s.kind==="textValue"){s.value!==""&&o.push(`#${s.value}`);continue}o.push(ft(s,t+1));}return o.sort(),o.length>0?`${n}[${o.join(",")}]`:n}function mt(e){if(!e)return [];let t=[];for(let r of e.children)r.namespaceUri===la&&t.push(ft(r,1));return t.sort(),t}function je(e){if(e.kind==="textValue")return e.value;if(e.kind==="tab")return " ";if(e.kind==="hardBreak")return Yb(e);if(e.kind==="drawing")return jc();if(e.kind==="runProperties"||e.kind==="paragraphProperties"||e.kind==="generic")return "";if(e.kind==="hyperlink"||Jb(e)){let r="",n=e.kind==="hyperlink"?e.children:Lb(e)??[];for(let o of n)r+=je(o);return r}let t="";for(let r of e.children)t+=je(r);return t}function x(e,t){let r=new Map(e);for(let n of t.namespaceBindings)r.set(n.prefix,n.namespaceUri);return r}function U(e,t){try{return va(e,t)}catch(r){if(r instanceof pa&&r.reason==="undeclared-prefix")return `generic-refusal:undeclared-prefix:{${e.namespaceUri}}${e.localName}`;throw r}}function Ke(e,t,r=ua){if(e.kind==="textValue")return;if(e.kind==="runProperties"||e.kind==="paragraphProperties"){let o=x(r,e),s=[];for(let a of e.children)a.namespaceUri!==la&&s.push(U(a,o));s.sort(),t.push(...s);return}if(e.kind==="generic"){t.push(U(e,r));return}if(Jb(e)){t.push(wa(e));return}if(e.kind==="bookmarkStart"||e.kind==="bookmarkEnd"){t.push(va(e,r));return}if(e.kind==="drawing"){t.push(yt(e));return}if(ka(e.kind))return;let n=x(r,e);for(let o of e.children)Ke(o,t,n);}function er(e){return `hyperlink(${e.attributes.map(r=>`${r.namespaceUri}|${r.localName}=${r.value}`).sort().join(",")})`}function tr(e){for(let t of e.children)if(t.kind==="pictureBlipFill")for(let r of t.children){if(r.kind!=="pictureBlip")continue;let n=r.attributes.find(s=>s.localName==="embed"&&s.namespaceUri===oa)?.value,o=r.attributes.find(s=>s.localName==="link"&&s.namespaceUri===oa)?.value;if(n!==void 0)return `embed=${n}`;if(o!==void 0)return `link=${o}`}}function ee(e,t,r){if(e.kind==="textValue")return `#${e.value}`;if(t>=ba)return C(e);let n=x(r,e);if(e.kind==="generic")return U(e,n);let o=I(e),s=o.length>0?`${C(e)}(${o.join(",")})`:C(e),a=[];for(let i of e.children)i.kind!=="textValue"&&a.push(ee(i,t+1,n));return a.sort(),a.length>0?`${s}[${a.join(",")}]`:s}function rr(e,t,r){let n=x(r,e),o=[];for(let s of e.children)if(s.kind!=="textValue"){if(s.kind==="pictureBlipFill"){let a=s.children,i=a.find(l=>l.kind==="pictureBlip"),d=a.filter(l=>l.kind!=="pictureBlip").map(l=>ee(l,t+1,n));if(d.sort(),i&&i.kind==="pictureBlip"){let l=I(i),c=l.length>0?`pictureBlip(${l.join(",")})`:"pictureBlip";o.push(d.length>0?`${c}[${d.join(",")}]`:c);}else for(let l of a)o.push(ee(l,t+1,n));continue}o.push(ee(s,t+1,n));}return o.sort(),o}function Ge(e,t,r){if(e.kind==="textValue")return `#${e.value}`;if(t>=ba)return C(e);let n=x(r,e);if(e.kind==="drawingDocPr"){let i=I(e);return i.length>0?`docPr(${i.join(",")})`:"docPr"}if(e.kind==="picture"){let i=tr(e),d=rr(e,t+1,n),l=i===void 0?"picture":`picture(${i})`;return d.length>0?`${l}[${d.join(",")}]`:l}let o=I(e),s=o.length>0?`${C(e)}(${o.join(",")})`:C(e),a=[];for(let i of e.children){if(i.kind==="picture"){a.push(Ge(i,t+1,n));continue}if(i.kind==="generic"){a.push(U(i,n));continue}i.kind!=="textValue"&&a.push(Ge(i,t+1,n));}return a.length>0?`${s}[${a.join(",")}]`:s}function yt(e){let t=x(ua,e),r=e.children.find(i=>i.kind==="inlineDrawing"||i.kind==="anchoredDrawing");if(!r||r.kind==="textValue")return `drawing(${I(e).join(",")})`;let n=x(t,r),o=I(r),s=o.length>0?`${r.kind}(${o.join(",")})`:r.kind,a=[];for(let i of r.children){if(i.kind==="generic"){a.push(U(i,n));continue}i.kind!=="textValue"&&a.push(Ge(i,1,n));}return a.length>0?`drawing[${s};${a.join(";")}]`:`drawing[${s}]`}function nr(e,t,r){let n=e.children.find(c=>c.kind==="paragraphProperties"),o=[],s="",a=[],i=x(ua,e),d=(c,p)=>{if(c.kind==="run"){let u=x(p,c),m=c.children.find(f=>f.kind==="runProperties");o.push(mt(m)),s+=je(c);for(let f of c.children)Ke(f,a,u);return}if(c.kind==="drawing"){a.push(yt(c));return}if(c.kind==="hyperlink"){a.push(er(c));let u=x(p,c);for(let m of c.children)d(m,u);return}if(c.kind==="contentControl"){a.push(wa({...c,children:c.children.filter(m=>m.kind!=="contentControlContent")}));let u=x(p,c);for(let m of c.children){if(m.kind!=="contentControlContent")continue;let f=x(u,m);for(let y of m.children)d(y,f);}return}Ke(c,a,p);};for(let c of e.children)d(c,i);let l=Jc(e);return {ordinal:t,path:r,paraId:l===null?null:l.toUpperCase(),text:s,paragraphProperties:mt(n),runProperties:o,genericStructure:a}}function or(e){if(e.localName==="hdr"||e.localName==="ftr"||e.kind==="body")return e;for(let t of e.children)if(t.kind!=="textValue"&&(t.kind==="body"||t.localName==="hdr"||t.localName==="ftr"))return t;return e}function gt(e,t,r,n,o,s){if(s>ba)return;let a=0;for(let i of e.children){if(i.kind==="textValue"){i.value.trim()!==""&&o.push(`${t}/#text ${i.value}`);continue}let d=t===""?String(a):`${t}/${a}`;if(a+=1,i.kind==="paragraph"){r.push(i),n.push(d),o.push(`${d} p`);continue}let l=I(i);o.push(l.length>0?`${d} ${C(i)}(${l.join(",")})`:`${d} ${C(i)}`),gt(i,d,r,n,o,s+1);}}function ht(e){let t=or(e.root),r=[],n=[],o=[];gt(t,"",r,n,o,0);let s=r.map((a,i)=>nr(a,i,n[i]));return {partName:e.name,paragraphs:s,structure:o}}function ir(e){let t=[];for(let r of e){let n=ht(r);n&&t.push(n);}return {stories:t}}function ar(e,t){let r=[],n=(s,a,i)=>{r.push({path:s,before:JSON.stringify(a)??"undefined",after:JSON.stringify(i)??"undefined"});};e.stories.length!==t.stories.length&&n("stories.length",e.stories.length,t.stories.length);let o=Math.min(e.stories.length,t.stories.length);for(let s=0;s<o;s+=1){let a=e.stories[s],i=t.stories[s],d=p=>`${a.partName}${p}`;a.paragraphs.length!==i.paragraphs.length&&n(d(".paragraphs.length"),a.paragraphs.length,i.paragraphs.length);let l=Math.min(a.paragraphs.length,i.paragraphs.length);for(let p=0;p<l;p+=1){let u=a.paragraphs[p],m=i.paragraphs[p];u.text!==m.text&&n(d(`.p[${p}].text`),u.text,m.text),u.path!==m.path&&n(d(`.p[${p}].path`),u.path,m.path),u.paraId!==m.paraId&&n(d(`.p[${p}].paraId`),u.paraId,m.paraId),JSON.stringify(u.paragraphProperties)!==JSON.stringify(m.paragraphProperties)&&n(d(`.p[${p}].paragraphProperties`),u.paragraphProperties,m.paragraphProperties),JSON.stringify(u.runProperties)!==JSON.stringify(m.runProperties)&&n(d(`.p[${p}].runProperties`),u.runProperties,m.runProperties),JSON.stringify(u.genericStructure)!==JSON.stringify(m.genericStructure)&&n(d(`.p[${p}].genericStructure`),u.genericStructure,m.genericStructure);}a.structure.length!==i.structure.length&&n(d(".structure.length"),a.structure.length,i.structure.length);let c=Math.min(a.structure.length,i.structure.length);for(let p=0;p<c;p+=1)a.structure[p]!==i.structure[p]&&n(d(`.structure[${p}]`),a.structure[p],i.structure[p]);}return r}var V="http://schemas.openxmlformats.org/wordprocessingml/2006/main",cr="http://schemas.openxmlformats.org/package/2006/relationships",xt="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",w="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",dr="application/vnd.openxmlformats-package.relationships+xml",pr="http://schemas.openxmlformats.org/package/2006/content-types",Nt="/[Content_Types].xml",E="/word/numbering.xml",Ot=[{text:"\uF0B7",font:"Symbol"},{text:"o",font:"Courier New"},{text:"\uF0A7",font:"Wingdings"}],Rt=["decimal","lowerLetter","lowerRoman"],ze=9;function It(e,t){let r=720*(t+1),n='<w:start w:val="1"/>';if(e==="bullet"){let a=Ot[t%Ot.length];return `<w:lvl w:ilvl="${t}">${n}<w:numFmt w:val="bullet"/><w:lvlText w:val="${a.text}"/><w:lvlJc w:val="left"/><w:pPr><w:ind w:left="${r}" w:hanging="360"/></w:pPr><w:rPr><w:rFonts w:ascii="${a.font}" w:hAnsi="${a.font}" w:hint="default"/></w:rPr></w:lvl>`}let o=Rt[t%Rt.length],s=o==="lowerRoman";return `<w:lvl w:ilvl="${t}">${n}<w:numFmt w:val="${o}"/><w:lvlText w:val="%${t+1}."/><w:lvlJc w:val="${s?"right":"left"}"/><w:pPr><w:ind w:left="${r}" w:hanging="${s?180:360}"/></w:pPr></w:lvl>`}function ur(e,t){let r=Array.from({length:ze},(n,o)=>It(e,o)).join("");return `<w:abstractNum w:abstractNumId="${t}"><w:multiLevelType w:val="${e==="bullet"?"hybridMultilevel":"multilevel"}"/>${r}</w:abstractNum>`}function mr(){let e=Aa(`<w:numbering xmlns:w="${V}"></w:numbering>`,{name:E,contentType:w});return e.ok?e.part:null}var b=(e,t)=>{let r=[];for(let n of e.children)n.kind==="textValue"||n.localName!==t||n.namespaceUri===V&&r.push(n);return r},N=(e,t)=>e.attributes.find(r=>r.localName===t)?.value;function kt(e,t){let r=Aa(`<w:numbering xmlns:w="${V}">${e}</w:numbering>`,{name:E,contentType:w});if(!r.ok)return null;let n=[];for(let o of r.part.root.children)o.kind!=="textValue"&&n.push(o);if(n.length!==t.length)return null;for(let o=0;o<t.length;o+=1){let s=n[o],a=t[o];if(s.namespaceUri!==V||s.localName!==a.localName||a.attribute&&N(s,a.attribute.localName)!==a.attribute.value)return null}return n}var Ct=["numPicBullet","abstractNum","num","numIdMacAtCleanup"];function bt(e,t,r){let n=t.indexOf(r);if(n===-1)return e.length;let o=0;return e.forEach((s,a)=>{if(s.kind==="textValue")return;let i=t.indexOf(s.localName);i!==-1&&i<=n&&(o=a+1);}),o}function Et(e,t){let r=0;for(let n of e){let o=N(n,t);!o||!/^\d{1,9}$/.test(o)||(r=Math.max(r,Number(o)));}return r+1}function fr(e,t){let r=e.parts.get(E),n=r??mr();if(!n)return null;let o=n.root,s=b(o,"abstractNum"),a=b(o,"num"),i=t==="bullet"?"bullet":"decimal";for(let O of a){let $=N(O,"numId"),Ye=b(O,"abstractNumId")[0],Je=Ye?N(Ye,"val"):void 0;if(!$||!Je)continue;let qe=s.find(X=>N(X,"abstractNumId")===Je);if(!qe)continue;let Qe=b(qe,"lvl").find(X=>N(X,"ilvl")==="0"||N(X,"ilvl")===void 0),Ze=Qe?b(Qe,"numFmt")[0]:void 0;if(Ze&&N(Ze,"val")===i)return {pkg:e,numId:$}}let d=Et(s,"abstractNumId"),l=Et(a,"numId"),c=kt(ur(t,d)+`<w:num w:numId="${l}"><w:abstractNumId w:val="${d}"/></w:num>`,[{localName:"abstractNum",attribute:{localName:"abstractNumId",value:String(d)}},{localName:"num",attribute:{localName:"numId",value:String(l)}}]);if(!c)return null;let p=Ca(n),[u,m]=c.map(O=>te(O,p));if(!u||!m)return null;let f=Ha(n,o.id,bt(o.children,Ct,"abstractNum"),[u]);if(!f.ok)return null;let y=Ha(f.part,o.id,bt(f.part.root.children,Ct,"num"),[m]);if(!y.ok)return null;let g=Object.freeze({...e,parts:new Map([...e.parts,[E,y.part]])});if(!r){let O=xr(g);if(!O)return null;let $=Cr(O);if(!$)return null;g=$;}return {pkg:g,numId:String(l)}}var yr=["nsid","multiLevelType","tmpl","name","styleLink","numStyleLink","lvl"];function St(e){let t=N(e,"ilvl");return t===void 0||!/^\d{1,9}$/.test(t)?null:Number(t)}function gr(e,t){let r=0;return e.forEach((n,o)=>{if(n.kind!=="textValue"){if(n.localName==="lvl"&&n.namespaceUri===V){(St(n)??0)<t&&(r=o+1);return}yr.includes(n.localName)&&(r=o+1);}}),r}function hr(e,t,r,n){if(!Number.isInteger(r)||r<0||r>=ze||t.length===0||t.length>64)return null;let o=e.parts.get(E);if(!o)return null;let s=o.root,a=b(s,"num").find(f=>N(f,"numId")===t),i=a?b(a,"abstractNumId")[0]:void 0,d=i?N(i,"val"):void 0;if(!d)return null;let l=b(s,"abstractNum").find(f=>N(f,"abstractNumId")===d);if(!l||b(l,"numStyleLink").length>0)return null;let c=b(l,"lvl");if(c.some(f=>St(f)===r))return e;if(c.length>=ze)return null;let p=kt(It(n,r),[{localName:"lvl",attribute:{localName:"ilvl",value:String(r)}}]);if(!p)return null;let u=Ca(o),m=Ha(o,l.id,gr(l.children,r),[te(p[0],u)]);return m.ok?Object.freeze({...e,parts:new Map([...e.parts,[E,m.part]])}):null}function te(e,t){return e.kind==="textValue"?{...e,id:t()}:{...e,id:t(),children:e.children.map(r=>te(r,t))}}function xr(e){let t=e.mainDocumentPart,r=Nr(t),n=e.parts.get(r),o=Or(e),s=Aa(`<Relationships xmlns="${cr}"><Relationship Id="${o}" Type="${xt}" Target="numbering.xml"/></Relationships>`,{name:r,contentType:dr});if(!s.ok)return null;let a=e.relationships.get(t)??[],i={ownerPart:t,id:o,type:xt,rawTarget:"numbering.xml",targetMode:"Internal",order:a.reduce((u,m)=>Math.max(u,m.order),-1)+1},d=new Map([...e.relationships,[t,[...a,i]]]);if(!n)return Object.freeze({...e,parts:new Map([...e.parts,[r,s.part]]),relationships:d});let l=Ca(n),c=s.part.root.children[0];if(!c)return null;let p=Ha(n,n.root.id,n.root.children.length,[te(c,l)]);return p.ok?Object.freeze({...e,parts:new Map([...e.parts,[r,p.part]]),relationships:d}):null}function Nr(e){let t=e.lastIndexOf("/");return `${e.slice(0,t)}/_rels/${e.slice(t+1)}.rels`}function Or(e){let t=0;for(let r of e.relationships.values())for(let n of r){let o=/^rId(\d{1,9})$/.exec(n.id);o&&(t=Math.max(t,Number(o[1])));}for(let r of e.externalTargets){let n=/^rId(\d{1,9})$/.exec(r.id);n&&(t=Math.max(t,Number(n[1])));}return `rId${t+1}`}var Rr=`<Override PartName="${E}" ContentType="${w}"/>`;function Cr(e){let t=e.contentTypes.overrides.get(o(E));if(t===w)return e;if(t!==void 0)return null;let r=e.partBytes.get(Nt);if(!r)return null;let n=strFromU8(r),o$1=Pt(n);if(!o$1)return null;let s=n.lastIndexOf(`</${o$1.rootName}>`);if(s===-1)return null;let a=n.slice(0,s)+Rr+n.slice(s),i=Pt(a);if(!i||i.rootName!==o$1.rootName)return null;let d=[...o$1.children,vt("Override",{PartName:E,ContentType:w})];return i.children.length!==d.length||i.children.some((l,c)=>l!==d[c])?null:Object.freeze({...e,partBytes:new Map([...e.partBytes,[Nt,strToU8(a)]]),contentTypes:Object.freeze({defaults:e.contentTypes.defaults,overrides:new Map([...e.contentTypes.overrides,[o(E),w]])})})}function Pt(e){let t=ca(e);if(!t.ok)return null;let r=t.nodes.filter(i=>i.type==="element");if(r.length!==1)return null;let n=r[0],o=n.name.indexOf(":"),s=o===-1?"":n.name.slice(0,o);if(n.name.slice(o+1)!=="Types"||n.attributes[s?`xmlns:${s}`:"xmlns"]!==pr)return null;let a=[];for(let i of n.children)i.type==="element"&&a.push(vt(i.name,i.attributes));return {rootName:n.name,children:a}}function vt(e,t){let r=Object.entries(t).map(([n,o])=>`${n}=${o}`).sort();return [e,...r].join("")}function re(e){return e!=null&&e.kind!=="textValue"}function We(e,t){for(let r of e.children)if(r.kind!=="textValue"&&r.namespaceUri===la&&r.localName===t)return r;return null}function ne(e,t){for(let r of e.attributes)if(r.namespaceUri===la&&r.localName===t)return r.value}function _(e,t){let r=We(e,t);if(!r)return false;let n=ne(r,"val");return n===void 0?true:n!=="0"&&n!=="false"&&n!=="off"}var Tt=Object.freeze({trackRevisions:false,restrictedToTrackedChanges:false,doNotTrackMoves:false,doNotTrackFormatting:false});function br(e){if(!re(e))return Tt;let t=We(e,"documentProtection"),r=t===null?void 0:ne(t,"enforcement"),n=r!==void 0&&r!=="0"&&r!=="false"&&r!=="off";return {trackRevisions:_(e,"trackRevisions"),restrictedToTrackedChanges:n&&t!==null&&ne(t,"edit")==="trackedChanges",doNotTrackMoves:_(e,"doNotTrackMoves"),doNotTrackFormatting:_(e,"doNotTrackFormatting")}}var wt=Object.freeze({doNotShadeFormData:false});function Er(e){return re(e)?{doNotShadeFormData:_(e,"doNotShadeFormData")}:wt}function Pr(e,t){let r=e.parts.get(t.storyPartName);if(!r)return {ok:false,reason:`no story part named ${t.storyPartName}`};let n=[];for(let d of oe(r.root)){let l=me(d.node).tag;if(l===void 0||l.length===0)continue;let c=t.decide(l);c!=="keep"&&n.push({nodeId:d.node.id,policy:c});}let o=r,s=0,a=0;for(let{nodeId:d,policy:l}of n){let c=Fa(o,d);if(!c)continue;if(l==="remove"){let g=Ja(o,d,{deferValidation:true});if(!g.ok)return {ok:false,reason:`a node could not be removed: ${_t(g)}`};o=g.part,a+=1;continue}let p=c.children.find(g=>g.id===d);if(!p)continue;let u=ke(p),m=u?u.children:[],f=c.children.flatMap(g=>g.id===d?m:[g]),y=Ga(o,c.id,f,{deferValidation:true});if(!y.ok)return {ok:false,reason:`a node could not be unwrapped: ${_t(y)}`};o=y.part,s+=1;}let i=o===r?e:yb(e,o);if(!i.parts.has(t.storyPartName))return {ok:false,reason:"the story went missing during the export"};for(let d of t.namespaces)for(let l of kr(i,t.storyPartName,d)){let c=af(i,l.itemId),p=We$1(i,l.partName,c);if(p.pkg===i&&p.removed.length===0&&!Ir(i,l.partName,c))return {ok:false,reason:`the payloads in ${d} could not be removed`};if(i=p.pkg,c.size>0)continue;let u=Sr(i,l);if(!u.ok)return {ok:false,reason:`the payload store for ${d} could not be removed`};i=u.pkg;}return {ok:true,pkg:i,unwrapped:s,removed:a}}function Ir(e,t,r){return Se(e,t).every(n=>r.has(n.id))}function _t(e){return e.issues.map(t=>t.code).join(", ")||"the edit was refused"}function kr(e,t,r){return Oe(e,t).filter(n=>n.namespaceUri===r)}function Sr(e,t){let r=Eb(e,t.partName);if(!r.ok)return {pkg:e,ok:false};let n=Eb(r.pkg,t.propsPartName);return n.ok?{pkg:n.pkg,ok:true}:{pkg:e,ok:false}}
|
|
2
|
+
export{He as A,Ue as B,Ve as C,zt as D,lt as E,pt as F,qt as G,Zt as H,ht as I,ir as J,ar as K,fr as L,hr as M,Tt as N,br as O,wt as P,Er as Q,Pr as R,$t as a,rt as b,Y as c,k as d,J as e,q as f,h as g,Lt as h,S as i,M as j,Q as k,B as l,Z as m,$e as n,Ae as o,De as p,Ut as q,Vt as r,Le as s,ot as t,Xt as u,Fe as v,jt as w,H as x,Me as y,Be as z};
|