@eigenpal/docx-editor-core 1.3.2 → 1.3.3
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/dist/chunk-2WGTGBBS.js +2 -0
- package/dist/chunk-7KMTWDPE.mjs +1 -0
- package/dist/{chunk-6V3SFHEM.js → chunk-BUEMXRXH.js} +1 -1
- package/dist/{chunk-UEPLDKKM.mjs → chunk-C52D36FA.mjs} +1 -1
- package/dist/{chunk-LAJPGQEE.mjs → chunk-CHTIWTHQ.mjs} +1 -1
- package/dist/chunk-CRMZH7U7.mjs +2 -0
- package/dist/{chunk-CDXCFHOY.mjs → chunk-ESCPS4AO.mjs} +1 -1
- package/dist/{chunk-7UZJ5YDF.mjs → chunk-EUZLYQRB.mjs} +1 -1
- package/dist/{chunk-RAWVGULQ.js → chunk-EV4LVK4X.js} +1 -1
- package/dist/{chunk-PMSGJXOE.mjs → chunk-GE2GV2AX.mjs} +1 -1
- package/dist/chunk-IUJCUITW.mjs +1 -0
- package/dist/{chunk-APNMO5JT.js → chunk-KXVCCT2A.js} +1 -1
- package/dist/chunk-L5NPEM7C.js +1 -0
- package/dist/{chunk-6WZW3NSJ.js → chunk-LIW3H4WB.js} +1 -1
- package/dist/chunk-OF373DBR.mjs +1 -0
- package/dist/{chunk-ZAZWHK4J.js → chunk-OPSOGVSU.js} +1 -1
- package/dist/chunk-Q4IEATDJ.js +1 -0
- package/dist/chunk-QAJSNLJR.mjs +1 -0
- package/dist/chunk-XLB6AC5Q.js +1 -0
- package/dist/chunk-YWM2QH36.js +1 -0
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/editor/index.js +1 -1
- package/dist/editor/index.mjs +1 -1
- package/dist/layout-bridge/index.d.mts +12 -3
- package/dist/layout-bridge/index.d.ts +12 -3
- package/dist/layout-bridge/index.js +1 -1
- package/dist/layout-bridge/index.mjs +1 -1
- package/dist/layout-bridge/tableInsertHover.js +1 -1
- package/dist/layout-bridge/tableInsertHover.mjs +1 -1
- package/dist/layout-painter/index.js +1 -1
- package/dist/layout-painter/index.mjs +1 -1
- package/dist/layout-painter/renderPage.js +1 -1
- package/dist/layout-painter/renderPage.mjs +1 -1
- package/dist/prosemirror/applyFormatting.js +1 -1
- package/dist/prosemirror/applyFormatting.mjs +1 -1
- package/dist/prosemirror/commands/formatting.js +1 -1
- package/dist/prosemirror/commands/formatting.mjs +1 -1
- package/dist/prosemirror/commands/index.js +1 -1
- package/dist/prosemirror/commands/index.mjs +1 -1
- package/dist/prosemirror/commands/paragraph.js +1 -1
- package/dist/prosemirror/commands/paragraph.mjs +1 -1
- package/dist/prosemirror/conversion/index.js +1 -1
- package/dist/prosemirror/conversion/index.mjs +1 -1
- package/dist/prosemirror/extensions/index.js +1 -1
- package/dist/prosemirror/extensions/index.mjs +1 -1
- package/dist/prosemirror/index.d.mts +12 -1
- package/dist/prosemirror/index.d.ts +12 -1
- package/dist/prosemirror/index.js +3 -3
- package/dist/prosemirror/index.mjs +3 -3
- package/dist/prosemirror/schema/index.js +1 -1
- package/dist/prosemirror/schema/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-2LEFMTNZ.mjs +0 -1
- package/dist/chunk-4GFTMGSV.mjs +0 -1
- package/dist/chunk-4PANZ3VU.js +0 -1
- package/dist/chunk-4RTVLMRZ.js +0 -2
- package/dist/chunk-KKXCBWVG.mjs +0 -1
- package/dist/chunk-LJE7HQEJ.mjs +0 -1
- package/dist/chunk-PFMM7QON.js +0 -1
- package/dist/chunk-QVRNNRG5.js +0 -1
- package/dist/chunk-SWBLJF6R.mjs +0 -2
- package/dist/chunk-WWBNJ7KF.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import {e,b,c,a as a$1}from'./chunk-KQTB5Y7P.mjs';import {a}from'./chunk-4GFTMGSV.mjs';import {i,g}from'./chunk-MJ6XZFVD.mjs';import {TextSelection}from'prosemirror-state';function O(e){let{$from:t}=e.selection,n=null,r=null,s=null,o=-1,a=-1;for(let i=t.depth;i>0;i--){let d=t.node(i);if(d.type.name==="tableCell"||d.type.name==="tableHeader"){s=d;let l=t.node(i-1);if(l?.type.name==="tableRow"){let b=0;l.forEach((h,y,S)=>{if(a===-1){if(S===t.index(i-1)){a=b;return}b+=h.attrs.colspan||1;}});}}else if(d.type.name==="tableRow")t.node(i-1)?.type.name==="table"&&(o=t.index(i-1));else if(d.type.name==="table"){n=d,r=t.before(i);break}}return !n||r==null||!s||o<0||a<0?null:{table:n,tablePos:r,cell:s,row:o,col:a,rowspan:s.attrs.rowspan||1,colspan:s.attrs.colspan||1}}function H(e){let t=[],n=[],r=0;for(let s=0;s<e.childCount;s++){let o=e.child(s),a=0;o.forEach(i=>{for(;t[s]?.[a];)a++;let d=i.attrs.rowspan||1,l=i.attrs.colspan||1;n.push({data:i,row:s,col:a,rowspan:d,colspan:l});for(let b=s;b<s+d;b++){let h=t[b]??[];t[b]=h;for(let y=a;y<a+l;y++)h[y]=true;}a+=l,r=Math.max(r,a);});}return {anchors:n,totalCols:r}}function j(e,t,n,r,s){let o={...e.attrs},a=s.reduce((l,b)=>l+b,0),i=a$1(s,t,n),d=n!==(e.attrs.colspan||1)||r!==(e.attrs.rowspan||1);return o.colspan=n,o.rowspan=r,o.colwidth=null,a>0&&(o.width=Math.round(i/a*5e3),o.widthType="pct"),d&&(o._originalFormatting=null),o}function K(e,t,n,r){let s=t+1;for(let o=0;o<e.childCount;o++){let a=e.child(o),i=s+1,d=0;for(let l=0;l<a.childCount;l++){let b=a.child(l);if(o===n&&d===r)return i;d+=b.attrs.colspan||1,i+=b.nodeSize;}s+=a.nodeSize;}return null}function Y(e,t){let n=e.attrs.width??9360;return Array.isArray(e.attrs.columnWidths)&&e.attrs.columnWidths.length>0?[...e.attrs.columnWidths]:Array.from({length:t},()=>Math.floor(n/Math.max(t,1)))}function q(e$1){let t=O(e$1);return t?{...e(t.rowspan,t.colspan),capturedCellRow:t.row,capturedCellCol:t.col}:null}function Q(e,t,n,r,s,o){if(n<1||r<1)return false;let a=O(e);if(!a||!t)return false;let i=a;if(s!=null&&o!=null&&(s!==a.row||o!==a.col)){let{anchors:p}=H(a.table),g=p.find(T=>T.row===s&&T.col===o);if(!g)return false;i={...a,cell:g.data,row:g.row,col:g.col,rowspan:g.rowspan,colspan:g.colspan};}if(n<i.rowspan||r<i.colspan||n===1&&r===1)return false;let{anchors:d,totalCols:l}=H(i.table),b$1=Y(i.table,l),h=b(b$1,i.col,i.colspan,r),y=d.find(p=>p.row===i.row&&p.col===i.col);if(!y)return false;let S=c(d,y,n,r,i.table.childCount,p=>{if(p)return y.data;let g=y.data.type.schema.nodes.paragraph.create(),T=j(y.data,0,1,1,h);return y.data.type.create(T,g)}),x=i.row+i.rowspan,w=Array.from({length:S.newRowCount},(p,g)=>g<x?{...i.table.child(g)?.attrs??{}}:g<i.row+n?{...i.table.child(x-1)?.attrs??{}}:{...i.table.child(g-S.deltaRows)?.attrs??{}}),k=Array.from({length:S.newRowCount},()=>[]);S.anchors.sort((p,g)=>p.row===g.row?p.col-g.col:p.row-g.row).forEach(p=>{let g=j(p.data,p.col,p.colspan,p.rowspan,h);k[p.row].push(p.data.type.create(g,p.data.content));});let u=k.map((p,g)=>i.table.type.schema.nodes.tableRow.create(w[g],p)),c$1=i.table.type.create({...i.table.attrs,columnWidths:h},u),f=e.tr.replaceWith(i.tablePos,i.tablePos+i.table.nodeSize,c$1),C=f.doc.nodeAt(i.tablePos);if(C){let p=K(C,i.tablePos,i.row,i.col);p!=null&&(f=f.setSelection(TextSelection.near(f.doc.resolve(p+1))));}return t(f.scrollIntoView()),true}var m=a.getCommands();function ee(e,t){return m.insertTable(e,t)}function te(e,t){return m.addRowAbove()(e,t)}function re(e,t){return m.addRowBelow()(e,t)}function ne(e,t){return m.deleteRow()(e,t)}function oe(e,t){return m.addColumnLeft()(e,t)}function ae(e,t){return m.addColumnRight()(e,t)}function ie(e,t){return m.deleteColumn()(e,t)}function se(e,t){return m.deleteTable()(e,t)}function le(e,t){return m.selectTable()(e,t)}function ce(e,t){return m.selectRow()(e,t)}function de(e,t){return m.selectColumn()(e,t)}function ue(e,t){return m.mergeCells()(e,t)}function pe(e,t){return m.splitCell()(e,t)}function me(e,t,n){return m.setCellBorder(e,t,n)}function fe(e,t){return m.setTableBorders(e,t)}function ge(e,t){return m.removeTableBorders()(e,t)}function be(e,t,n){return m.setAllTableBorders(n)(e,t)}function he(e,t,n){return m.setOutsideTableBorders(n)(e,t)}function ye(e,t,n){return m.setInsideTableBorders(n)(e,t)}function Ce(e){return m.setCellVerticalAlign(e)}function Te(e){return m.setCellMargins(e)}function Se(e){return m.setCellTextDirection(e)}function ke(){return m.toggleNoWrap()}function ve(e,t){return m.setRowHeight(e,t)}function xe(){return m.toggleHeaderRow()}function we(){return m.distributeColumns()}function Pe(){return m.autoFitContents()}function Ie(e){return m.setTableProperties(e)}function Ae(e){return m.applyTableStyle(e)}function Ee(e){return m.setCellFillColor(e)}function Me(e){return m.setTableBorderColor(e)}function Re(e){return m.setTableBorderWidth(e)}var Ne=a.getCommands();function Be(e,t,n,r){if(!t)return true;let s=e.tr.insert(r,n),o=i(e),a=e.schema.marks.insertion;return o&&a&&s.addMark(r,r+n.nodeSize,a.create({revisionId:o.revisionId,author:o.author,date:o.date})),t(s.scrollIntoView()),true}function We(e,t,n){return Ne.setImageWrapType(e,t,n)}function Fe(e){return (t,n)=>{let{from:r,to:s,empty:o}=t.selection;if(o)return false;let a=t.schema.marks.comment;if(!a)return false;if(n){let i=t.tr.addMark(r,s,a.create({commentId:e}));n(i);}return true}}function De(e){return (t,n)=>{let r=t.schema.marks.comment;if(!r)return false;if(n){let s=t.tr;t.doc.descendants((o,a)=>{if(o.isText)for(let i of o.marks)i.type===r&&i.attrs.commentId===e&&s.removeMark(a,a+o.nodeSize,i);}),s.steps.length>0&&n(s);}return true}}function V(e,t,n){return (r,s)=>{let o=r.schema.marks.insertion,a=r.schema.marks.deletion;if(!o&&!a)return false;let i=n==="accept"?o:a,d=n==="accept"?a:o;if(s){let l=r.tr,b=[];r.doc.nodesBetween(e,t,(h,y)=>{if(!h.isInline)return;let S=y+h.nodeSize,x=Math.max(e,y),w=Math.min(t,S);d&&h.marks.some(k=>k.type===d)&&b.push({from:x,to:w}),i&&h.marks.some(k=>k.type===i)&&l.removeMark(x,w,i);});for(let h of b.reverse())l.delete(h.from,h.to);l.steps.length>0&&s(l);}return true}}function Le(e,t){return V(e,t,"accept")}function ze(e,t){return V(e,t,"reject")}function _(e){let t=new Set,n=[],r=a=>{typeof a=="number"&&!t.has(a)&&(t.add(a),n.push(a));},s=e.schema.marks.insertion,o=e.schema.marks.deletion;return e.doc.descendants(a=>{if(a.type.name==="paragraph"){r(a.attrs.pPrIns?.revisionId),r(a.attrs.pPrDel?.revisionId);let i=a.attrs.pPrChange;if(Array.isArray(i))for(let d of i)r(d.info.id);}if(a.type.name==="tableRow"){r(a.attrs.trIns?.revisionId),r(a.attrs.trDel?.revisionId);let i=a.attrs.trPrChange;if(Array.isArray(i))for(let d of i)r(d.info.id);}if(a.type.name==="tableCell"||a.type.name==="tableHeader"){let i=a.attrs.cellMarker;r(i?.info?.revisionId);let d=a.attrs.tcPrChange;if(Array.isArray(d))for(let l of d)r(l.info.id);}if(a.type.name==="table"){let i=a.attrs.tblPrChange;if(Array.isArray(i))for(let d of i)r(d.info.id);}if(a.isInline)for(let i of a.marks)(s&&i.type===s||o&&i.type===o)&&r(i.attrs.revisionId);}),n}function He(){return (e,t)=>{let n=_(e);if(n.length===0)return false;if(!t)return true;let r=e,s=o=>{t(o),r=r.apply(o);};for(let o of n)M(o,"accept")(r,s);return true}}function je(){return (e,t)=>{let n=_(e);if(n.length===0)return false;if(!t)return true;let r=e,s=o=>{t(o),r=r.apply(o);};for(let o of n)M(o,"reject")(r,s);return true}}function $(e,t){let n=e.schema.marks.insertion,r=e.schema.marks.deletion;if(!n&&!r)return null;let s=null;return e.doc.descendants((o,a)=>{if(s)return false;if(o.isInline&&!(a+o.nodeSize<=t)){for(let i of o.marks)if(i.type===n||i.type===r)return s={from:Math.max(a,t),to:a+o.nodeSize,type:i.type===n?"insertion":"deletion"},false}}),!s&&t>0?$(e,0):s}function Oe(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="paragraph")return;let o=r.attrs.pPrIns,a=r.attrs.pPrDel;o&&o.revisionId===t&&n.push({pos:s,node:r,kind:"pPrIns"}),a&&a.revisionId===t&&n.push({pos:s,node:r,kind:"pPrDel"});}),n}function Ve(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="paragraph")return;let o=r.attrs.pPrChange;Array.isArray(o)&&o.forEach((a,i)=>{!a?.info||typeof a.info.id!="number"||a.info.id===t&&n.push({pos:s,node:r,entryIndex:i,prior:a.previousFormatting,current:a.currentFormatting});});}),n}function _e(e,t){let n=[],r=e.schema.marks.insertion,s=e.schema.marks.deletion;return e.doc.descendants((o,a)=>{if(o.isInline){for(let i of o.marks)if((r&&i.type===r||s&&i.type===s)&&i.attrs.revisionId===t){let d=i.type===r?"insertion":"deletion",l=n[n.length-1];l&&l.markName===d&&l.to===a?l.to=a+o.nodeSize:n.push({from:a,to:a+o.nodeSize,markName:d});}}}),n}function $e(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s=t+r.nodeSize,o=e.doc.nodeAt(s);!o||o.type.name!=="paragraph"||(e.setNodeMarkup(t,void 0,{...o.attrs,pPrIns:null,pPrDel:null}),e.join(s));}function N(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s={...r.attrs};s[n]=null,e.setNodeMarkup(t,void 0,s);}function Je(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s=r.attrs.pPrChange;if(!Array.isArray(s)||n<0||n>=s.length)return;let o=s.slice();o.splice(n,1),e.setNodeMarkup(t,void 0,{...r.attrs,pPrChange:o.length>0?o:null});}function Ue(e,t,n){let r={...e},s=["alignment","spaceBefore","spaceAfter","lineSpacing","lineSpacingRule","beforeAutospacing","afterAutospacing","spacingExplicit","indentLeft","indentRight","indentFirstLine","hangingIndent","styleId","borders","shading","tabs","pageBreakBefore","keepNext","keepLines","contextualSpacing","bidi","outlineLevel","numPr"];for(let o of s)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]??null);return n?.numPr&&!Object.prototype.hasOwnProperty.call(t,"numPr")&&(r.numPr=null),r.numPr==null&&(r.listIsBullet=null,r.listNumFmt=null,r.listMarker=null),r}function Ge(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="tableRow")return;let o=r.attrs.trIns,a=r.attrs.trDel;o&&o.revisionId===t&&n.push({pos:s,node:r,kind:"trIns"}),a&&a.revisionId===t&&n.push({pos:s,node:r,kind:"trDel"});}),n}function Ke(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="tableCell"&&r.type.name!=="tableHeader")return;let o=r.attrs.cellMarker;o?.info?.revisionId===t&&n.push({pos:s,node:r,cellKind:o.kind});}),n}function M(e,t){return (n,r)=>{let s=Oe(n,e),o=_e(n,e),a=Ve(n,e),i=Ge(n,e),d=Ke(n,e);if(s.length===0&&o.length===0&&a.length===0&&i.length===0&&d.length===0)return false;if(!r)return true;let l=n.tr;l.setMeta(g,true);let b=n.schema.marks.insertion,h=n.schema.marks.deletion,y=[...o].sort((u,c)=>c.from-u.from);for(let u of y){let c=u.markName==="insertion";if(t==="accept"&&!c||t==="reject"&&c)l.delete(u.from,u.to);else {let C=c?b:h;C&&l.removeMark(u.from,u.to,C);}}let S=[...s].sort((u,c)=>c.pos-u.pos);for(let u of S){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="paragraph")continue;let C=u.kind==="pPrIns"&&f.attrs.pPrIns?.revisionId===e,p=u.kind==="pPrDel"&&f.attrs.pPrDel?.revisionId===e;if(!C&&!p)continue;if(t==="reject"&&u.kind==="pPrIns"||t==="accept"&&u.kind==="pPrDel"){let T=c+f.nodeSize,R=l.doc.nodeAt(T);!R||R.type.name!=="paragraph"?N(l,c,u.kind):(N(l,c,u.kind),$e(l,c));}else N(l,c,u.kind);}let x=[...a].sort((u,c)=>c.pos-u.pos);for(let u of x){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="paragraph")continue;let C=f.attrs.pPrChange;if(!Array.isArray(C))continue;let p=C.findIndex(g=>g.info.id===e);if(!(p<0))if(t==="reject"&&u.prior){let g=Ue(f.attrs,u.prior,u.current),T=C.slice();T.splice(p,1),l.setNodeMarkup(c,void 0,{...g,pPrChange:T.length>0?T:null});}else Je(l,c,p);}let w=[...d].sort((u,c)=>c.pos-u.pos);for(let u of w){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="tableCell"&&f.type.name!=="tableHeader")continue;let C=f.attrs.cellMarker;!C||C.info.revisionId!==e||l.setNodeMarkup(c,void 0,{...f.attrs,cellMarker:null});}let k=[...i].sort((u,c)=>c.pos-u.pos);for(let u of k){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="tableRow")continue;let C=f.attrs.trIns,p=f.attrs.trDel,g=C?.revisionId===e,T=p?.revisionId===e;if(!g&&!T)continue;if(t==="reject"&&g||t==="accept"&&T){let v=l.doc.resolve(c+1),P=v.node(v.depth-1),I=v.before(v.depth-1);if(P?.type.name==="table"&&P.childCount>1)l.delete(c,c+f.nodeSize);else if(P?.type.name==="table")if(l.doc.resolve(I).parent.childCount===1){let U=l.doc.type.schema.nodes.paragraph;l.replaceWith(I,I+P.nodeSize,U.create());}else l.delete(I,I+P.nodeSize);else {let A={...f.attrs};g&&(A.trIns=null),T&&(A.trDel=null),l.setNodeMarkup(c,void 0,A);}}else {let v={...f.attrs};g&&(v.trIns=null),T&&(v.trDel=null),l.setNodeMarkup(c,void 0,v);}}return l.steps.length===0?false:(r(l),true)}}function Ye(e){return M(e,"accept")}function qe(e){return M(e,"reject")}function J(e,t){let n=e.schema.marks.insertion,r=e.schema.marks.deletion;if(!n&&!r)return null;let s=null;return e.doc.descendants((o,a)=>{if(o.isInline){if(a>=t)return false;for(let i of o.marks)(i.type===n||i.type===r)&&(s={from:a,to:a+o.nodeSize,type:i.type===n?"insertion":"deletion"});}}),!s&&t<e.doc.content.size?J(e,e.doc.content.size):s}function Qe(e){return e.doc.attrs.watermark??null}function Xe(e){return (t,n)=>(n&&n(t.tr.setDocAttribute("watermark",e)),true)}export{xe as A,we as B,Pe as C,Ie as D,Ae as E,Ee as F,Me as G,Re as H,Be as I,We as J,Fe as K,De as L,Le as M,ze as N,He as O,je as P,$ as Q,Ye as R,qe as S,J as T,Qe as U,Xe as V,q as a,Q as b,ee as c,te as d,re as e,ne as f,oe as g,ae as h,ie as i,se as j,le as k,ce as l,de as m,ue as n,pe as o,me as p,fe as q,ge as r,be as s,he as t,ye as u,Ce as v,Te as w,Se as x,ke as y,ve as z};
|
|
1
|
+
import {e,b,c,a as a$1}from'./chunk-KQTB5Y7P.mjs';import {a}from'./chunk-QAJSNLJR.mjs';import {i,g}from'./chunk-MJ6XZFVD.mjs';import {TextSelection}from'prosemirror-state';function O(e){let{$from:t}=e.selection,n=null,r=null,s=null,o=-1,a=-1;for(let i=t.depth;i>0;i--){let d=t.node(i);if(d.type.name==="tableCell"||d.type.name==="tableHeader"){s=d;let l=t.node(i-1);if(l?.type.name==="tableRow"){let b=0;l.forEach((h,y,S)=>{if(a===-1){if(S===t.index(i-1)){a=b;return}b+=h.attrs.colspan||1;}});}}else if(d.type.name==="tableRow")t.node(i-1)?.type.name==="table"&&(o=t.index(i-1));else if(d.type.name==="table"){n=d,r=t.before(i);break}}return !n||r==null||!s||o<0||a<0?null:{table:n,tablePos:r,cell:s,row:o,col:a,rowspan:s.attrs.rowspan||1,colspan:s.attrs.colspan||1}}function H(e){let t=[],n=[],r=0;for(let s=0;s<e.childCount;s++){let o=e.child(s),a=0;o.forEach(i=>{for(;t[s]?.[a];)a++;let d=i.attrs.rowspan||1,l=i.attrs.colspan||1;n.push({data:i,row:s,col:a,rowspan:d,colspan:l});for(let b=s;b<s+d;b++){let h=t[b]??[];t[b]=h;for(let y=a;y<a+l;y++)h[y]=true;}a+=l,r=Math.max(r,a);});}return {anchors:n,totalCols:r}}function j(e,t,n,r,s){let o={...e.attrs},a=s.reduce((l,b)=>l+b,0),i=a$1(s,t,n),d=n!==(e.attrs.colspan||1)||r!==(e.attrs.rowspan||1);return o.colspan=n,o.rowspan=r,o.colwidth=null,a>0&&(o.width=Math.round(i/a*5e3),o.widthType="pct"),d&&(o._originalFormatting=null),o}function K(e,t,n,r){let s=t+1;for(let o=0;o<e.childCount;o++){let a=e.child(o),i=s+1,d=0;for(let l=0;l<a.childCount;l++){let b=a.child(l);if(o===n&&d===r)return i;d+=b.attrs.colspan||1,i+=b.nodeSize;}s+=a.nodeSize;}return null}function Y(e,t){let n=e.attrs.width??9360;return Array.isArray(e.attrs.columnWidths)&&e.attrs.columnWidths.length>0?[...e.attrs.columnWidths]:Array.from({length:t},()=>Math.floor(n/Math.max(t,1)))}function q(e$1){let t=O(e$1);return t?{...e(t.rowspan,t.colspan),capturedCellRow:t.row,capturedCellCol:t.col}:null}function Q(e,t,n,r,s,o){if(n<1||r<1)return false;let a=O(e);if(!a||!t)return false;let i=a;if(s!=null&&o!=null&&(s!==a.row||o!==a.col)){let{anchors:p}=H(a.table),g=p.find(T=>T.row===s&&T.col===o);if(!g)return false;i={...a,cell:g.data,row:g.row,col:g.col,rowspan:g.rowspan,colspan:g.colspan};}if(n<i.rowspan||r<i.colspan||n===1&&r===1)return false;let{anchors:d,totalCols:l}=H(i.table),b$1=Y(i.table,l),h=b(b$1,i.col,i.colspan,r),y=d.find(p=>p.row===i.row&&p.col===i.col);if(!y)return false;let S=c(d,y,n,r,i.table.childCount,p=>{if(p)return y.data;let g=y.data.type.schema.nodes.paragraph.create(),T=j(y.data,0,1,1,h);return y.data.type.create(T,g)}),x=i.row+i.rowspan,w=Array.from({length:S.newRowCount},(p,g)=>g<x?{...i.table.child(g)?.attrs??{}}:g<i.row+n?{...i.table.child(x-1)?.attrs??{}}:{...i.table.child(g-S.deltaRows)?.attrs??{}}),k=Array.from({length:S.newRowCount},()=>[]);S.anchors.sort((p,g)=>p.row===g.row?p.col-g.col:p.row-g.row).forEach(p=>{let g=j(p.data,p.col,p.colspan,p.rowspan,h);k[p.row].push(p.data.type.create(g,p.data.content));});let u=k.map((p,g)=>i.table.type.schema.nodes.tableRow.create(w[g],p)),c$1=i.table.type.create({...i.table.attrs,columnWidths:h},u),f=e.tr.replaceWith(i.tablePos,i.tablePos+i.table.nodeSize,c$1),C=f.doc.nodeAt(i.tablePos);if(C){let p=K(C,i.tablePos,i.row,i.col);p!=null&&(f=f.setSelection(TextSelection.near(f.doc.resolve(p+1))));}return t(f.scrollIntoView()),true}var m=a.getCommands();function ee(e,t){return m.insertTable(e,t)}function te(e,t){return m.addRowAbove()(e,t)}function re(e,t){return m.addRowBelow()(e,t)}function ne(e,t){return m.deleteRow()(e,t)}function oe(e,t){return m.addColumnLeft()(e,t)}function ae(e,t){return m.addColumnRight()(e,t)}function ie(e,t){return m.deleteColumn()(e,t)}function se(e,t){return m.deleteTable()(e,t)}function le(e,t){return m.selectTable()(e,t)}function ce(e,t){return m.selectRow()(e,t)}function de(e,t){return m.selectColumn()(e,t)}function ue(e,t){return m.mergeCells()(e,t)}function pe(e,t){return m.splitCell()(e,t)}function me(e,t,n){return m.setCellBorder(e,t,n)}function fe(e,t){return m.setTableBorders(e,t)}function ge(e,t){return m.removeTableBorders()(e,t)}function be(e,t,n){return m.setAllTableBorders(n)(e,t)}function he(e,t,n){return m.setOutsideTableBorders(n)(e,t)}function ye(e,t,n){return m.setInsideTableBorders(n)(e,t)}function Ce(e){return m.setCellVerticalAlign(e)}function Te(e){return m.setCellMargins(e)}function Se(e){return m.setCellTextDirection(e)}function ke(){return m.toggleNoWrap()}function ve(e,t){return m.setRowHeight(e,t)}function xe(){return m.toggleHeaderRow()}function we(){return m.distributeColumns()}function Pe(){return m.autoFitContents()}function Ie(e){return m.setTableProperties(e)}function Ae(e){return m.applyTableStyle(e)}function Ee(e){return m.setCellFillColor(e)}function Me(e){return m.setTableBorderColor(e)}function Re(e){return m.setTableBorderWidth(e)}var Ne=a.getCommands();function Be(e,t,n,r){if(!t)return true;let s=e.tr.insert(r,n),o=i(e),a=e.schema.marks.insertion;return o&&a&&s.addMark(r,r+n.nodeSize,a.create({revisionId:o.revisionId,author:o.author,date:o.date})),t(s.scrollIntoView()),true}function We(e,t,n){return Ne.setImageWrapType(e,t,n)}function Fe(e){return (t,n)=>{let{from:r,to:s,empty:o}=t.selection;if(o)return false;let a=t.schema.marks.comment;if(!a)return false;if(n){let i=t.tr.addMark(r,s,a.create({commentId:e}));n(i);}return true}}function De(e){return (t,n)=>{let r=t.schema.marks.comment;if(!r)return false;if(n){let s=t.tr;t.doc.descendants((o,a)=>{if(o.isText)for(let i of o.marks)i.type===r&&i.attrs.commentId===e&&s.removeMark(a,a+o.nodeSize,i);}),s.steps.length>0&&n(s);}return true}}function V(e,t,n){return (r,s)=>{let o=r.schema.marks.insertion,a=r.schema.marks.deletion;if(!o&&!a)return false;let i=n==="accept"?o:a,d=n==="accept"?a:o;if(s){let l=r.tr,b=[];r.doc.nodesBetween(e,t,(h,y)=>{if(!h.isInline)return;let S=y+h.nodeSize,x=Math.max(e,y),w=Math.min(t,S);d&&h.marks.some(k=>k.type===d)&&b.push({from:x,to:w}),i&&h.marks.some(k=>k.type===i)&&l.removeMark(x,w,i);});for(let h of b.reverse())l.delete(h.from,h.to);l.steps.length>0&&s(l);}return true}}function Le(e,t){return V(e,t,"accept")}function ze(e,t){return V(e,t,"reject")}function _(e){let t=new Set,n=[],r=a=>{typeof a=="number"&&!t.has(a)&&(t.add(a),n.push(a));},s=e.schema.marks.insertion,o=e.schema.marks.deletion;return e.doc.descendants(a=>{if(a.type.name==="paragraph"){r(a.attrs.pPrIns?.revisionId),r(a.attrs.pPrDel?.revisionId);let i=a.attrs.pPrChange;if(Array.isArray(i))for(let d of i)r(d.info.id);}if(a.type.name==="tableRow"){r(a.attrs.trIns?.revisionId),r(a.attrs.trDel?.revisionId);let i=a.attrs.trPrChange;if(Array.isArray(i))for(let d of i)r(d.info.id);}if(a.type.name==="tableCell"||a.type.name==="tableHeader"){let i=a.attrs.cellMarker;r(i?.info?.revisionId);let d=a.attrs.tcPrChange;if(Array.isArray(d))for(let l of d)r(l.info.id);}if(a.type.name==="table"){let i=a.attrs.tblPrChange;if(Array.isArray(i))for(let d of i)r(d.info.id);}if(a.isInline)for(let i of a.marks)(s&&i.type===s||o&&i.type===o)&&r(i.attrs.revisionId);}),n}function He(){return (e,t)=>{let n=_(e);if(n.length===0)return false;if(!t)return true;let r=e,s=o=>{t(o),r=r.apply(o);};for(let o of n)M(o,"accept")(r,s);return true}}function je(){return (e,t)=>{let n=_(e);if(n.length===0)return false;if(!t)return true;let r=e,s=o=>{t(o),r=r.apply(o);};for(let o of n)M(o,"reject")(r,s);return true}}function $(e,t){let n=e.schema.marks.insertion,r=e.schema.marks.deletion;if(!n&&!r)return null;let s=null;return e.doc.descendants((o,a)=>{if(s)return false;if(o.isInline&&!(a+o.nodeSize<=t)){for(let i of o.marks)if(i.type===n||i.type===r)return s={from:Math.max(a,t),to:a+o.nodeSize,type:i.type===n?"insertion":"deletion"},false}}),!s&&t>0?$(e,0):s}function Oe(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="paragraph")return;let o=r.attrs.pPrIns,a=r.attrs.pPrDel;o&&o.revisionId===t&&n.push({pos:s,node:r,kind:"pPrIns"}),a&&a.revisionId===t&&n.push({pos:s,node:r,kind:"pPrDel"});}),n}function Ve(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="paragraph")return;let o=r.attrs.pPrChange;Array.isArray(o)&&o.forEach((a,i)=>{!a?.info||typeof a.info.id!="number"||a.info.id===t&&n.push({pos:s,node:r,entryIndex:i,prior:a.previousFormatting,current:a.currentFormatting});});}),n}function _e(e,t){let n=[],r=e.schema.marks.insertion,s=e.schema.marks.deletion;return e.doc.descendants((o,a)=>{if(o.isInline){for(let i of o.marks)if((r&&i.type===r||s&&i.type===s)&&i.attrs.revisionId===t){let d=i.type===r?"insertion":"deletion",l=n[n.length-1];l&&l.markName===d&&l.to===a?l.to=a+o.nodeSize:n.push({from:a,to:a+o.nodeSize,markName:d});}}}),n}function $e(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s=t+r.nodeSize,o=e.doc.nodeAt(s);!o||o.type.name!=="paragraph"||(e.setNodeMarkup(t,void 0,{...o.attrs,pPrIns:null,pPrDel:null}),e.join(s));}function N(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s={...r.attrs};s[n]=null,e.setNodeMarkup(t,void 0,s);}function Je(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s=r.attrs.pPrChange;if(!Array.isArray(s)||n<0||n>=s.length)return;let o=s.slice();o.splice(n,1),e.setNodeMarkup(t,void 0,{...r.attrs,pPrChange:o.length>0?o:null});}function Ue(e,t,n){let r={...e},s=["alignment","spaceBefore","spaceAfter","lineSpacing","lineSpacingRule","beforeAutospacing","afterAutospacing","spacingExplicit","indentLeft","indentRight","indentFirstLine","hangingIndent","styleId","borders","shading","tabs","pageBreakBefore","keepNext","keepLines","contextualSpacing","bidi","outlineLevel","numPr"];for(let o of s)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]??null);return n?.numPr&&!Object.prototype.hasOwnProperty.call(t,"numPr")&&(r.numPr=null),r.numPr==null&&(r.listIsBullet=null,r.listNumFmt=null,r.listMarker=null),r}function Ge(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="tableRow")return;let o=r.attrs.trIns,a=r.attrs.trDel;o&&o.revisionId===t&&n.push({pos:s,node:r,kind:"trIns"}),a&&a.revisionId===t&&n.push({pos:s,node:r,kind:"trDel"});}),n}function Ke(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="tableCell"&&r.type.name!=="tableHeader")return;let o=r.attrs.cellMarker;o?.info?.revisionId===t&&n.push({pos:s,node:r,cellKind:o.kind});}),n}function M(e,t){return (n,r)=>{let s=Oe(n,e),o=_e(n,e),a=Ve(n,e),i=Ge(n,e),d=Ke(n,e);if(s.length===0&&o.length===0&&a.length===0&&i.length===0&&d.length===0)return false;if(!r)return true;let l=n.tr;l.setMeta(g,true);let b=n.schema.marks.insertion,h=n.schema.marks.deletion,y=[...o].sort((u,c)=>c.from-u.from);for(let u of y){let c=u.markName==="insertion";if(t==="accept"&&!c||t==="reject"&&c)l.delete(u.from,u.to);else {let C=c?b:h;C&&l.removeMark(u.from,u.to,C);}}let S=[...s].sort((u,c)=>c.pos-u.pos);for(let u of S){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="paragraph")continue;let C=u.kind==="pPrIns"&&f.attrs.pPrIns?.revisionId===e,p=u.kind==="pPrDel"&&f.attrs.pPrDel?.revisionId===e;if(!C&&!p)continue;if(t==="reject"&&u.kind==="pPrIns"||t==="accept"&&u.kind==="pPrDel"){let T=c+f.nodeSize,R=l.doc.nodeAt(T);!R||R.type.name!=="paragraph"?N(l,c,u.kind):(N(l,c,u.kind),$e(l,c));}else N(l,c,u.kind);}let x=[...a].sort((u,c)=>c.pos-u.pos);for(let u of x){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="paragraph")continue;let C=f.attrs.pPrChange;if(!Array.isArray(C))continue;let p=C.findIndex(g=>g.info.id===e);if(!(p<0))if(t==="reject"&&u.prior){let g=Ue(f.attrs,u.prior,u.current),T=C.slice();T.splice(p,1),l.setNodeMarkup(c,void 0,{...g,pPrChange:T.length>0?T:null});}else Je(l,c,p);}let w=[...d].sort((u,c)=>c.pos-u.pos);for(let u of w){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="tableCell"&&f.type.name!=="tableHeader")continue;let C=f.attrs.cellMarker;!C||C.info.revisionId!==e||l.setNodeMarkup(c,void 0,{...f.attrs,cellMarker:null});}let k=[...i].sort((u,c)=>c.pos-u.pos);for(let u of k){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="tableRow")continue;let C=f.attrs.trIns,p=f.attrs.trDel,g=C?.revisionId===e,T=p?.revisionId===e;if(!g&&!T)continue;if(t==="reject"&&g||t==="accept"&&T){let v=l.doc.resolve(c+1),P=v.node(v.depth-1),I=v.before(v.depth-1);if(P?.type.name==="table"&&P.childCount>1)l.delete(c,c+f.nodeSize);else if(P?.type.name==="table")if(l.doc.resolve(I).parent.childCount===1){let U=l.doc.type.schema.nodes.paragraph;l.replaceWith(I,I+P.nodeSize,U.create());}else l.delete(I,I+P.nodeSize);else {let A={...f.attrs};g&&(A.trIns=null),T&&(A.trDel=null),l.setNodeMarkup(c,void 0,A);}}else {let v={...f.attrs};g&&(v.trIns=null),T&&(v.trDel=null),l.setNodeMarkup(c,void 0,v);}}return l.steps.length===0?false:(r(l),true)}}function Ye(e){return M(e,"accept")}function qe(e){return M(e,"reject")}function J(e,t){let n=e.schema.marks.insertion,r=e.schema.marks.deletion;if(!n&&!r)return null;let s=null;return e.doc.descendants((o,a)=>{if(o.isInline){if(a>=t)return false;for(let i of o.marks)(i.type===n||i.type===r)&&(s={from:a,to:a+o.nodeSize,type:i.type===n?"insertion":"deletion"});}}),!s&&t<e.doc.content.size?J(e,e.doc.content.size):s}function Qe(e){return e.doc.attrs.watermark??null}function Xe(e){return (t,n)=>(n&&n(t.tr.setDocAttribute("watermark",e)),true)}export{xe as A,we as B,Pe as C,Ie as D,Ae as E,Ee as F,Me as G,Re as H,Be as I,We as J,Fe as K,De as L,Le as M,ze as N,He as O,je as P,$ as Q,Ye as R,qe as S,J as T,Qe as U,Xe as V,q as a,Q as b,ee as c,te as d,re as e,ne as f,oe as g,ae as h,ie as i,se as j,le as k,ce as l,de as m,ue as n,pe as o,me as p,fe as q,ge as r,be as s,he as t,ye as u,Ce as v,Te as w,Se as x,ke as y,ve as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a,b as b$1}from'./chunk-
|
|
1
|
+
import {a,b as b$1}from'./chunk-QAJSNLJR.mjs';import {f as f$1}from'./chunk-U67MWOPZ.mjs';function y(e){return f$1(e,b$1)}var t=a.getCommands(),F=t.toggleBold(),f=t.toggleItalic(),S=t.toggleUnderline(),H=t.toggleStrike(),T=t.toggleSuperscript(),h=t.toggleSubscript();function M(e){return t.setTextColor(e)}var A=t.clearTextColor();function v(e){return t.setHighlight(e)}var z=t.clearHighlight();function U(e){return t.setFontSize(e)}var b=t.clearFontSize();function B(e){return t.setFontFamily(e)}var I=t.clearFontFamily();function R(e,o){return t.setUnderlineStyle(e,o)}function _(e,o){return t.setHyperlink(e,o)}var j=t.removeHyperlink();function q(e,o,i){return t.insertHyperlink(e,o,i)}export{y as a,F as b,f as c,S as d,H as e,T as f,h as g,M as h,A as i,v as j,z as k,U as l,b as m,B as n,I as o,R as p,_ as q,j as r,q as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var chunk2KHWHVTA_js=require('./chunk-2KHWHVTA.js'),chunkWWBNJ7KF_js=require('./chunk-WWBNJ7KF.js'),chunk7HANRHHL_js=require('./chunk-7HANRHHL.js'),prosemirrorState=require('prosemirror-state');function O(e){let{$from:t}=e.selection,n=null,r=null,s=null,o=-1,a=-1;for(let i=t.depth;i>0;i--){let d=t.node(i);if(d.type.name==="tableCell"||d.type.name==="tableHeader"){s=d;let l=t.node(i-1);if(l?.type.name==="tableRow"){let b=0;l.forEach((h,y,S)=>{if(a===-1){if(S===t.index(i-1)){a=b;return}b+=h.attrs.colspan||1;}});}}else if(d.type.name==="tableRow")t.node(i-1)?.type.name==="table"&&(o=t.index(i-1));else if(d.type.name==="table"){n=d,r=t.before(i);break}}return !n||r==null||!s||o<0||a<0?null:{table:n,tablePos:r,cell:s,row:o,col:a,rowspan:s.attrs.rowspan||1,colspan:s.attrs.colspan||1}}function H(e){let t=[],n=[],r=0;for(let s=0;s<e.childCount;s++){let o=e.child(s),a=0;o.forEach(i=>{for(;t[s]?.[a];)a++;let d=i.attrs.rowspan||1,l=i.attrs.colspan||1;n.push({data:i,row:s,col:a,rowspan:d,colspan:l});for(let b=s;b<s+d;b++){let h=t[b]??[];t[b]=h;for(let y=a;y<a+l;y++)h[y]=true;}a+=l,r=Math.max(r,a);});}return {anchors:n,totalCols:r}}function j(e,t,n,r,s){let o={...e.attrs},a=s.reduce((l,b)=>l+b,0),i=chunk2KHWHVTA_js.a(s,t,n),d=n!==(e.attrs.colspan||1)||r!==(e.attrs.rowspan||1);return o.colspan=n,o.rowspan=r,o.colwidth=null,a>0&&(o.width=Math.round(i/a*5e3),o.widthType="pct"),d&&(o._originalFormatting=null),o}function K(e,t,n,r){let s=t+1;for(let o=0;o<e.childCount;o++){let a=e.child(o),i=s+1,d=0;for(let l=0;l<a.childCount;l++){let b=a.child(l);if(o===n&&d===r)return i;d+=b.attrs.colspan||1,i+=b.nodeSize;}s+=a.nodeSize;}return null}function Y(e,t){let n=e.attrs.width??9360;return Array.isArray(e.attrs.columnWidths)&&e.attrs.columnWidths.length>0?[...e.attrs.columnWidths]:Array.from({length:t},()=>Math.floor(n/Math.max(t,1)))}function q(e){let t=O(e);return t?{...chunk2KHWHVTA_js.e(t.rowspan,t.colspan),capturedCellRow:t.row,capturedCellCol:t.col}:null}function Q(e,t,n,r,s,o){if(n<1||r<1)return false;let a=O(e);if(!a||!t)return false;let i=a;if(s!=null&&o!=null&&(s!==a.row||o!==a.col)){let{anchors:p}=H(a.table),g=p.find(T=>T.row===s&&T.col===o);if(!g)return false;i={...a,cell:g.data,row:g.row,col:g.col,rowspan:g.rowspan,colspan:g.colspan};}if(n<i.rowspan||r<i.colspan||n===1&&r===1)return false;let{anchors:d,totalCols:l}=H(i.table),b=Y(i.table,l),h=chunk2KHWHVTA_js.b(b,i.col,i.colspan,r),y=d.find(p=>p.row===i.row&&p.col===i.col);if(!y)return false;let S=chunk2KHWHVTA_js.c(d,y,n,r,i.table.childCount,p=>{if(p)return y.data;let g=y.data.type.schema.nodes.paragraph.create(),T=j(y.data,0,1,1,h);return y.data.type.create(T,g)}),x=i.row+i.rowspan,w=Array.from({length:S.newRowCount},(p,g)=>g<x?{...i.table.child(g)?.attrs??{}}:g<i.row+n?{...i.table.child(x-1)?.attrs??{}}:{...i.table.child(g-S.deltaRows)?.attrs??{}}),k=Array.from({length:S.newRowCount},()=>[]);S.anchors.sort((p,g)=>p.row===g.row?p.col-g.col:p.row-g.row).forEach(p=>{let g=j(p.data,p.col,p.colspan,p.rowspan,h);k[p.row].push(p.data.type.create(g,p.data.content));});let u=k.map((p,g)=>i.table.type.schema.nodes.tableRow.create(w[g],p)),c=i.table.type.create({...i.table.attrs,columnWidths:h},u),f=e.tr.replaceWith(i.tablePos,i.tablePos+i.table.nodeSize,c),C=f.doc.nodeAt(i.tablePos);if(C){let p=K(C,i.tablePos,i.row,i.col);p!=null&&(f=f.setSelection(prosemirrorState.TextSelection.near(f.doc.resolve(p+1))));}return t(f.scrollIntoView()),true}var m=chunkWWBNJ7KF_js.a.getCommands();function ee(e,t){return m.insertTable(e,t)}function te(e,t){return m.addRowAbove()(e,t)}function re(e,t){return m.addRowBelow()(e,t)}function ne(e,t){return m.deleteRow()(e,t)}function oe(e,t){return m.addColumnLeft()(e,t)}function ae(e,t){return m.addColumnRight()(e,t)}function ie(e,t){return m.deleteColumn()(e,t)}function se(e,t){return m.deleteTable()(e,t)}function le(e,t){return m.selectTable()(e,t)}function ce(e,t){return m.selectRow()(e,t)}function de(e,t){return m.selectColumn()(e,t)}function ue(e,t){return m.mergeCells()(e,t)}function pe(e,t){return m.splitCell()(e,t)}function me(e,t,n){return m.setCellBorder(e,t,n)}function fe(e,t){return m.setTableBorders(e,t)}function ge(e,t){return m.removeTableBorders()(e,t)}function be(e,t,n){return m.setAllTableBorders(n)(e,t)}function he(e,t,n){return m.setOutsideTableBorders(n)(e,t)}function ye(e,t,n){return m.setInsideTableBorders(n)(e,t)}function Ce(e){return m.setCellVerticalAlign(e)}function Te(e){return m.setCellMargins(e)}function Se(e){return m.setCellTextDirection(e)}function ke(){return m.toggleNoWrap()}function ve(e,t){return m.setRowHeight(e,t)}function xe(){return m.toggleHeaderRow()}function we(){return m.distributeColumns()}function Pe(){return m.autoFitContents()}function Ie(e){return m.setTableProperties(e)}function Ae(e){return m.applyTableStyle(e)}function Ee(e){return m.setCellFillColor(e)}function Me(e){return m.setTableBorderColor(e)}function Re(e){return m.setTableBorderWidth(e)}var Ne=chunkWWBNJ7KF_js.a.getCommands();function Be(e,t,n,r){if(!t)return true;let s=e.tr.insert(r,n),o=chunk7HANRHHL_js.i(e),a=e.schema.marks.insertion;return o&&a&&s.addMark(r,r+n.nodeSize,a.create({revisionId:o.revisionId,author:o.author,date:o.date})),t(s.scrollIntoView()),true}function We(e,t,n){return Ne.setImageWrapType(e,t,n)}function Fe(e){return (t,n)=>{let{from:r,to:s,empty:o}=t.selection;if(o)return false;let a=t.schema.marks.comment;if(!a)return false;if(n){let i=t.tr.addMark(r,s,a.create({commentId:e}));n(i);}return true}}function De(e){return (t,n)=>{let r=t.schema.marks.comment;if(!r)return false;if(n){let s=t.tr;t.doc.descendants((o,a)=>{if(o.isText)for(let i of o.marks)i.type===r&&i.attrs.commentId===e&&s.removeMark(a,a+o.nodeSize,i);}),s.steps.length>0&&n(s);}return true}}function V(e,t,n){return (r,s)=>{let o=r.schema.marks.insertion,a=r.schema.marks.deletion;if(!o&&!a)return false;let i=n==="accept"?o:a,d=n==="accept"?a:o;if(s){let l=r.tr,b=[];r.doc.nodesBetween(e,t,(h,y)=>{if(!h.isInline)return;let S=y+h.nodeSize,x=Math.max(e,y),w=Math.min(t,S);d&&h.marks.some(k=>k.type===d)&&b.push({from:x,to:w}),i&&h.marks.some(k=>k.type===i)&&l.removeMark(x,w,i);});for(let h of b.reverse())l.delete(h.from,h.to);l.steps.length>0&&s(l);}return true}}function Le(e,t){return V(e,t,"accept")}function ze(e,t){return V(e,t,"reject")}function _(e){let t=new Set,n=[],r=a=>{typeof a=="number"&&!t.has(a)&&(t.add(a),n.push(a));},s=e.schema.marks.insertion,o=e.schema.marks.deletion;return e.doc.descendants(a=>{if(a.type.name==="paragraph"){r(a.attrs.pPrIns?.revisionId),r(a.attrs.pPrDel?.revisionId);let i=a.attrs.pPrChange;if(Array.isArray(i))for(let d of i)r(d.info.id);}if(a.type.name==="tableRow"){r(a.attrs.trIns?.revisionId),r(a.attrs.trDel?.revisionId);let i=a.attrs.trPrChange;if(Array.isArray(i))for(let d of i)r(d.info.id);}if(a.type.name==="tableCell"||a.type.name==="tableHeader"){let i=a.attrs.cellMarker;r(i?.info?.revisionId);let d=a.attrs.tcPrChange;if(Array.isArray(d))for(let l of d)r(l.info.id);}if(a.type.name==="table"){let i=a.attrs.tblPrChange;if(Array.isArray(i))for(let d of i)r(d.info.id);}if(a.isInline)for(let i of a.marks)(s&&i.type===s||o&&i.type===o)&&r(i.attrs.revisionId);}),n}function He(){return (e,t)=>{let n=_(e);if(n.length===0)return false;if(!t)return true;let r=e,s=o=>{t(o),r=r.apply(o);};for(let o of n)M(o,"accept")(r,s);return true}}function je(){return (e,t)=>{let n=_(e);if(n.length===0)return false;if(!t)return true;let r=e,s=o=>{t(o),r=r.apply(o);};for(let o of n)M(o,"reject")(r,s);return true}}function $(e,t){let n=e.schema.marks.insertion,r=e.schema.marks.deletion;if(!n&&!r)return null;let s=null;return e.doc.descendants((o,a)=>{if(s)return false;if(o.isInline&&!(a+o.nodeSize<=t)){for(let i of o.marks)if(i.type===n||i.type===r)return s={from:Math.max(a,t),to:a+o.nodeSize,type:i.type===n?"insertion":"deletion"},false}}),!s&&t>0?$(e,0):s}function Oe(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="paragraph")return;let o=r.attrs.pPrIns,a=r.attrs.pPrDel;o&&o.revisionId===t&&n.push({pos:s,node:r,kind:"pPrIns"}),a&&a.revisionId===t&&n.push({pos:s,node:r,kind:"pPrDel"});}),n}function Ve(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="paragraph")return;let o=r.attrs.pPrChange;Array.isArray(o)&&o.forEach((a,i)=>{!a?.info||typeof a.info.id!="number"||a.info.id===t&&n.push({pos:s,node:r,entryIndex:i,prior:a.previousFormatting,current:a.currentFormatting});});}),n}function _e(e,t){let n=[],r=e.schema.marks.insertion,s=e.schema.marks.deletion;return e.doc.descendants((o,a)=>{if(o.isInline){for(let i of o.marks)if((r&&i.type===r||s&&i.type===s)&&i.attrs.revisionId===t){let d=i.type===r?"insertion":"deletion",l=n[n.length-1];l&&l.markName===d&&l.to===a?l.to=a+o.nodeSize:n.push({from:a,to:a+o.nodeSize,markName:d});}}}),n}function $e(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s=t+r.nodeSize,o=e.doc.nodeAt(s);!o||o.type.name!=="paragraph"||(e.setNodeMarkup(t,void 0,{...o.attrs,pPrIns:null,pPrDel:null}),e.join(s));}function N(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s={...r.attrs};s[n]=null,e.setNodeMarkup(t,void 0,s);}function Je(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s=r.attrs.pPrChange;if(!Array.isArray(s)||n<0||n>=s.length)return;let o=s.slice();o.splice(n,1),e.setNodeMarkup(t,void 0,{...r.attrs,pPrChange:o.length>0?o:null});}function Ue(e,t,n){let r={...e},s=["alignment","spaceBefore","spaceAfter","lineSpacing","lineSpacingRule","beforeAutospacing","afterAutospacing","spacingExplicit","indentLeft","indentRight","indentFirstLine","hangingIndent","styleId","borders","shading","tabs","pageBreakBefore","keepNext","keepLines","contextualSpacing","bidi","outlineLevel","numPr"];for(let o of s)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]??null);return n?.numPr&&!Object.prototype.hasOwnProperty.call(t,"numPr")&&(r.numPr=null),r.numPr==null&&(r.listIsBullet=null,r.listNumFmt=null,r.listMarker=null),r}function Ge(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="tableRow")return;let o=r.attrs.trIns,a=r.attrs.trDel;o&&o.revisionId===t&&n.push({pos:s,node:r,kind:"trIns"}),a&&a.revisionId===t&&n.push({pos:s,node:r,kind:"trDel"});}),n}function Ke(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="tableCell"&&r.type.name!=="tableHeader")return;let o=r.attrs.cellMarker;o?.info?.revisionId===t&&n.push({pos:s,node:r,cellKind:o.kind});}),n}function M(e,t){return (n,r)=>{let s=Oe(n,e),o=_e(n,e),a=Ve(n,e),i=Ge(n,e),d=Ke(n,e);if(s.length===0&&o.length===0&&a.length===0&&i.length===0&&d.length===0)return false;if(!r)return true;let l=n.tr;l.setMeta(chunk7HANRHHL_js.g,true);let b=n.schema.marks.insertion,h=n.schema.marks.deletion,y=[...o].sort((u,c)=>c.from-u.from);for(let u of y){let c=u.markName==="insertion";if(t==="accept"&&!c||t==="reject"&&c)l.delete(u.from,u.to);else {let C=c?b:h;C&&l.removeMark(u.from,u.to,C);}}let S=[...s].sort((u,c)=>c.pos-u.pos);for(let u of S){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="paragraph")continue;let C=u.kind==="pPrIns"&&f.attrs.pPrIns?.revisionId===e,p=u.kind==="pPrDel"&&f.attrs.pPrDel?.revisionId===e;if(!C&&!p)continue;if(t==="reject"&&u.kind==="pPrIns"||t==="accept"&&u.kind==="pPrDel"){let T=c+f.nodeSize,R=l.doc.nodeAt(T);!R||R.type.name!=="paragraph"?N(l,c,u.kind):(N(l,c,u.kind),$e(l,c));}else N(l,c,u.kind);}let x=[...a].sort((u,c)=>c.pos-u.pos);for(let u of x){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="paragraph")continue;let C=f.attrs.pPrChange;if(!Array.isArray(C))continue;let p=C.findIndex(g=>g.info.id===e);if(!(p<0))if(t==="reject"&&u.prior){let g=Ue(f.attrs,u.prior,u.current),T=C.slice();T.splice(p,1),l.setNodeMarkup(c,void 0,{...g,pPrChange:T.length>0?T:null});}else Je(l,c,p);}let w=[...d].sort((u,c)=>c.pos-u.pos);for(let u of w){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="tableCell"&&f.type.name!=="tableHeader")continue;let C=f.attrs.cellMarker;!C||C.info.revisionId!==e||l.setNodeMarkup(c,void 0,{...f.attrs,cellMarker:null});}let k=[...i].sort((u,c)=>c.pos-u.pos);for(let u of k){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="tableRow")continue;let C=f.attrs.trIns,p=f.attrs.trDel,g=C?.revisionId===e,T=p?.revisionId===e;if(!g&&!T)continue;if(t==="reject"&&g||t==="accept"&&T){let v=l.doc.resolve(c+1),P=v.node(v.depth-1),I=v.before(v.depth-1);if(P?.type.name==="table"&&P.childCount>1)l.delete(c,c+f.nodeSize);else if(P?.type.name==="table")if(l.doc.resolve(I).parent.childCount===1){let U=l.doc.type.schema.nodes.paragraph;l.replaceWith(I,I+P.nodeSize,U.create());}else l.delete(I,I+P.nodeSize);else {let A={...f.attrs};g&&(A.trIns=null),T&&(A.trDel=null),l.setNodeMarkup(c,void 0,A);}}else {let v={...f.attrs};g&&(v.trIns=null),T&&(v.trDel=null),l.setNodeMarkup(c,void 0,v);}}return l.steps.length===0?false:(r(l),true)}}function Ye(e){return M(e,"accept")}function qe(e){return M(e,"reject")}function J(e,t){let n=e.schema.marks.insertion,r=e.schema.marks.deletion;if(!n&&!r)return null;let s=null;return e.doc.descendants((o,a)=>{if(o.isInline){if(a>=t)return false;for(let i of o.marks)(i.type===n||i.type===r)&&(s={from:a,to:a+o.nodeSize,type:i.type===n?"insertion":"deletion"});}}),!s&&t<e.doc.content.size?J(e,e.doc.content.size):s}function Qe(e){return e.doc.attrs.watermark??null}function Xe(e){return (t,n)=>(n&&n(t.tr.setDocAttribute("watermark",e)),true)}exports.A=xe;exports.B=we;exports.C=Pe;exports.D=Ie;exports.E=Ae;exports.F=Ee;exports.G=Me;exports.H=Re;exports.I=Be;exports.J=We;exports.K=Fe;exports.L=De;exports.M=Le;exports.N=ze;exports.O=He;exports.P=je;exports.Q=$;exports.R=Ye;exports.S=qe;exports.T=J;exports.U=Qe;exports.V=Xe;exports.a=q;exports.b=Q;exports.c=ee;exports.d=te;exports.e=re;exports.f=ne;exports.g=oe;exports.h=ae;exports.i=ie;exports.j=se;exports.k=le;exports.l=ce;exports.m=de;exports.n=ue;exports.o=pe;exports.p=me;exports.q=fe;exports.r=ge;exports.s=be;exports.t=he;exports.u=ye;exports.v=Ce;exports.w=Te;exports.x=Se;exports.y=ke;exports.z=ve;
|
|
1
|
+
'use strict';var chunk2KHWHVTA_js=require('./chunk-2KHWHVTA.js'),chunkL5NPEM7C_js=require('./chunk-L5NPEM7C.js'),chunk7HANRHHL_js=require('./chunk-7HANRHHL.js'),prosemirrorState=require('prosemirror-state');function O(e){let{$from:t}=e.selection,n=null,r=null,s=null,o=-1,a=-1;for(let i=t.depth;i>0;i--){let d=t.node(i);if(d.type.name==="tableCell"||d.type.name==="tableHeader"){s=d;let l=t.node(i-1);if(l?.type.name==="tableRow"){let b=0;l.forEach((h,y,S)=>{if(a===-1){if(S===t.index(i-1)){a=b;return}b+=h.attrs.colspan||1;}});}}else if(d.type.name==="tableRow")t.node(i-1)?.type.name==="table"&&(o=t.index(i-1));else if(d.type.name==="table"){n=d,r=t.before(i);break}}return !n||r==null||!s||o<0||a<0?null:{table:n,tablePos:r,cell:s,row:o,col:a,rowspan:s.attrs.rowspan||1,colspan:s.attrs.colspan||1}}function H(e){let t=[],n=[],r=0;for(let s=0;s<e.childCount;s++){let o=e.child(s),a=0;o.forEach(i=>{for(;t[s]?.[a];)a++;let d=i.attrs.rowspan||1,l=i.attrs.colspan||1;n.push({data:i,row:s,col:a,rowspan:d,colspan:l});for(let b=s;b<s+d;b++){let h=t[b]??[];t[b]=h;for(let y=a;y<a+l;y++)h[y]=true;}a+=l,r=Math.max(r,a);});}return {anchors:n,totalCols:r}}function j(e,t,n,r,s){let o={...e.attrs},a=s.reduce((l,b)=>l+b,0),i=chunk2KHWHVTA_js.a(s,t,n),d=n!==(e.attrs.colspan||1)||r!==(e.attrs.rowspan||1);return o.colspan=n,o.rowspan=r,o.colwidth=null,a>0&&(o.width=Math.round(i/a*5e3),o.widthType="pct"),d&&(o._originalFormatting=null),o}function K(e,t,n,r){let s=t+1;for(let o=0;o<e.childCount;o++){let a=e.child(o),i=s+1,d=0;for(let l=0;l<a.childCount;l++){let b=a.child(l);if(o===n&&d===r)return i;d+=b.attrs.colspan||1,i+=b.nodeSize;}s+=a.nodeSize;}return null}function Y(e,t){let n=e.attrs.width??9360;return Array.isArray(e.attrs.columnWidths)&&e.attrs.columnWidths.length>0?[...e.attrs.columnWidths]:Array.from({length:t},()=>Math.floor(n/Math.max(t,1)))}function q(e){let t=O(e);return t?{...chunk2KHWHVTA_js.e(t.rowspan,t.colspan),capturedCellRow:t.row,capturedCellCol:t.col}:null}function Q(e,t,n,r,s,o){if(n<1||r<1)return false;let a=O(e);if(!a||!t)return false;let i=a;if(s!=null&&o!=null&&(s!==a.row||o!==a.col)){let{anchors:p}=H(a.table),g=p.find(T=>T.row===s&&T.col===o);if(!g)return false;i={...a,cell:g.data,row:g.row,col:g.col,rowspan:g.rowspan,colspan:g.colspan};}if(n<i.rowspan||r<i.colspan||n===1&&r===1)return false;let{anchors:d,totalCols:l}=H(i.table),b=Y(i.table,l),h=chunk2KHWHVTA_js.b(b,i.col,i.colspan,r),y=d.find(p=>p.row===i.row&&p.col===i.col);if(!y)return false;let S=chunk2KHWHVTA_js.c(d,y,n,r,i.table.childCount,p=>{if(p)return y.data;let g=y.data.type.schema.nodes.paragraph.create(),T=j(y.data,0,1,1,h);return y.data.type.create(T,g)}),x=i.row+i.rowspan,w=Array.from({length:S.newRowCount},(p,g)=>g<x?{...i.table.child(g)?.attrs??{}}:g<i.row+n?{...i.table.child(x-1)?.attrs??{}}:{...i.table.child(g-S.deltaRows)?.attrs??{}}),k=Array.from({length:S.newRowCount},()=>[]);S.anchors.sort((p,g)=>p.row===g.row?p.col-g.col:p.row-g.row).forEach(p=>{let g=j(p.data,p.col,p.colspan,p.rowspan,h);k[p.row].push(p.data.type.create(g,p.data.content));});let u=k.map((p,g)=>i.table.type.schema.nodes.tableRow.create(w[g],p)),c=i.table.type.create({...i.table.attrs,columnWidths:h},u),f=e.tr.replaceWith(i.tablePos,i.tablePos+i.table.nodeSize,c),C=f.doc.nodeAt(i.tablePos);if(C){let p=K(C,i.tablePos,i.row,i.col);p!=null&&(f=f.setSelection(prosemirrorState.TextSelection.near(f.doc.resolve(p+1))));}return t(f.scrollIntoView()),true}var m=chunkL5NPEM7C_js.a.getCommands();function ee(e,t){return m.insertTable(e,t)}function te(e,t){return m.addRowAbove()(e,t)}function re(e,t){return m.addRowBelow()(e,t)}function ne(e,t){return m.deleteRow()(e,t)}function oe(e,t){return m.addColumnLeft()(e,t)}function ae(e,t){return m.addColumnRight()(e,t)}function ie(e,t){return m.deleteColumn()(e,t)}function se(e,t){return m.deleteTable()(e,t)}function le(e,t){return m.selectTable()(e,t)}function ce(e,t){return m.selectRow()(e,t)}function de(e,t){return m.selectColumn()(e,t)}function ue(e,t){return m.mergeCells()(e,t)}function pe(e,t){return m.splitCell()(e,t)}function me(e,t,n){return m.setCellBorder(e,t,n)}function fe(e,t){return m.setTableBorders(e,t)}function ge(e,t){return m.removeTableBorders()(e,t)}function be(e,t,n){return m.setAllTableBorders(n)(e,t)}function he(e,t,n){return m.setOutsideTableBorders(n)(e,t)}function ye(e,t,n){return m.setInsideTableBorders(n)(e,t)}function Ce(e){return m.setCellVerticalAlign(e)}function Te(e){return m.setCellMargins(e)}function Se(e){return m.setCellTextDirection(e)}function ke(){return m.toggleNoWrap()}function ve(e,t){return m.setRowHeight(e,t)}function xe(){return m.toggleHeaderRow()}function we(){return m.distributeColumns()}function Pe(){return m.autoFitContents()}function Ie(e){return m.setTableProperties(e)}function Ae(e){return m.applyTableStyle(e)}function Ee(e){return m.setCellFillColor(e)}function Me(e){return m.setTableBorderColor(e)}function Re(e){return m.setTableBorderWidth(e)}var Ne=chunkL5NPEM7C_js.a.getCommands();function Be(e,t,n,r){if(!t)return true;let s=e.tr.insert(r,n),o=chunk7HANRHHL_js.i(e),a=e.schema.marks.insertion;return o&&a&&s.addMark(r,r+n.nodeSize,a.create({revisionId:o.revisionId,author:o.author,date:o.date})),t(s.scrollIntoView()),true}function We(e,t,n){return Ne.setImageWrapType(e,t,n)}function Fe(e){return (t,n)=>{let{from:r,to:s,empty:o}=t.selection;if(o)return false;let a=t.schema.marks.comment;if(!a)return false;if(n){let i=t.tr.addMark(r,s,a.create({commentId:e}));n(i);}return true}}function De(e){return (t,n)=>{let r=t.schema.marks.comment;if(!r)return false;if(n){let s=t.tr;t.doc.descendants((o,a)=>{if(o.isText)for(let i of o.marks)i.type===r&&i.attrs.commentId===e&&s.removeMark(a,a+o.nodeSize,i);}),s.steps.length>0&&n(s);}return true}}function V(e,t,n){return (r,s)=>{let o=r.schema.marks.insertion,a=r.schema.marks.deletion;if(!o&&!a)return false;let i=n==="accept"?o:a,d=n==="accept"?a:o;if(s){let l=r.tr,b=[];r.doc.nodesBetween(e,t,(h,y)=>{if(!h.isInline)return;let S=y+h.nodeSize,x=Math.max(e,y),w=Math.min(t,S);d&&h.marks.some(k=>k.type===d)&&b.push({from:x,to:w}),i&&h.marks.some(k=>k.type===i)&&l.removeMark(x,w,i);});for(let h of b.reverse())l.delete(h.from,h.to);l.steps.length>0&&s(l);}return true}}function Le(e,t){return V(e,t,"accept")}function ze(e,t){return V(e,t,"reject")}function _(e){let t=new Set,n=[],r=a=>{typeof a=="number"&&!t.has(a)&&(t.add(a),n.push(a));},s=e.schema.marks.insertion,o=e.schema.marks.deletion;return e.doc.descendants(a=>{if(a.type.name==="paragraph"){r(a.attrs.pPrIns?.revisionId),r(a.attrs.pPrDel?.revisionId);let i=a.attrs.pPrChange;if(Array.isArray(i))for(let d of i)r(d.info.id);}if(a.type.name==="tableRow"){r(a.attrs.trIns?.revisionId),r(a.attrs.trDel?.revisionId);let i=a.attrs.trPrChange;if(Array.isArray(i))for(let d of i)r(d.info.id);}if(a.type.name==="tableCell"||a.type.name==="tableHeader"){let i=a.attrs.cellMarker;r(i?.info?.revisionId);let d=a.attrs.tcPrChange;if(Array.isArray(d))for(let l of d)r(l.info.id);}if(a.type.name==="table"){let i=a.attrs.tblPrChange;if(Array.isArray(i))for(let d of i)r(d.info.id);}if(a.isInline)for(let i of a.marks)(s&&i.type===s||o&&i.type===o)&&r(i.attrs.revisionId);}),n}function He(){return (e,t)=>{let n=_(e);if(n.length===0)return false;if(!t)return true;let r=e,s=o=>{t(o),r=r.apply(o);};for(let o of n)M(o,"accept")(r,s);return true}}function je(){return (e,t)=>{let n=_(e);if(n.length===0)return false;if(!t)return true;let r=e,s=o=>{t(o),r=r.apply(o);};for(let o of n)M(o,"reject")(r,s);return true}}function $(e,t){let n=e.schema.marks.insertion,r=e.schema.marks.deletion;if(!n&&!r)return null;let s=null;return e.doc.descendants((o,a)=>{if(s)return false;if(o.isInline&&!(a+o.nodeSize<=t)){for(let i of o.marks)if(i.type===n||i.type===r)return s={from:Math.max(a,t),to:a+o.nodeSize,type:i.type===n?"insertion":"deletion"},false}}),!s&&t>0?$(e,0):s}function Oe(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="paragraph")return;let o=r.attrs.pPrIns,a=r.attrs.pPrDel;o&&o.revisionId===t&&n.push({pos:s,node:r,kind:"pPrIns"}),a&&a.revisionId===t&&n.push({pos:s,node:r,kind:"pPrDel"});}),n}function Ve(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="paragraph")return;let o=r.attrs.pPrChange;Array.isArray(o)&&o.forEach((a,i)=>{!a?.info||typeof a.info.id!="number"||a.info.id===t&&n.push({pos:s,node:r,entryIndex:i,prior:a.previousFormatting,current:a.currentFormatting});});}),n}function _e(e,t){let n=[],r=e.schema.marks.insertion,s=e.schema.marks.deletion;return e.doc.descendants((o,a)=>{if(o.isInline){for(let i of o.marks)if((r&&i.type===r||s&&i.type===s)&&i.attrs.revisionId===t){let d=i.type===r?"insertion":"deletion",l=n[n.length-1];l&&l.markName===d&&l.to===a?l.to=a+o.nodeSize:n.push({from:a,to:a+o.nodeSize,markName:d});}}}),n}function $e(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s=t+r.nodeSize,o=e.doc.nodeAt(s);!o||o.type.name!=="paragraph"||(e.setNodeMarkup(t,void 0,{...o.attrs,pPrIns:null,pPrDel:null}),e.join(s));}function N(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s={...r.attrs};s[n]=null,e.setNodeMarkup(t,void 0,s);}function Je(e,t,n){let r=e.doc.nodeAt(t);if(!r)return;let s=r.attrs.pPrChange;if(!Array.isArray(s)||n<0||n>=s.length)return;let o=s.slice();o.splice(n,1),e.setNodeMarkup(t,void 0,{...r.attrs,pPrChange:o.length>0?o:null});}function Ue(e,t,n){let r={...e},s=["alignment","spaceBefore","spaceAfter","lineSpacing","lineSpacingRule","beforeAutospacing","afterAutospacing","spacingExplicit","indentLeft","indentRight","indentFirstLine","hangingIndent","styleId","borders","shading","tabs","pageBreakBefore","keepNext","keepLines","contextualSpacing","bidi","outlineLevel","numPr"];for(let o of s)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o]??null);return n?.numPr&&!Object.prototype.hasOwnProperty.call(t,"numPr")&&(r.numPr=null),r.numPr==null&&(r.listIsBullet=null,r.listNumFmt=null,r.listMarker=null),r}function Ge(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="tableRow")return;let o=r.attrs.trIns,a=r.attrs.trDel;o&&o.revisionId===t&&n.push({pos:s,node:r,kind:"trIns"}),a&&a.revisionId===t&&n.push({pos:s,node:r,kind:"trDel"});}),n}function Ke(e,t){let n=[];return e.doc.descendants((r,s)=>{if(r.type.name!=="tableCell"&&r.type.name!=="tableHeader")return;let o=r.attrs.cellMarker;o?.info?.revisionId===t&&n.push({pos:s,node:r,cellKind:o.kind});}),n}function M(e,t){return (n,r)=>{let s=Oe(n,e),o=_e(n,e),a=Ve(n,e),i=Ge(n,e),d=Ke(n,e);if(s.length===0&&o.length===0&&a.length===0&&i.length===0&&d.length===0)return false;if(!r)return true;let l=n.tr;l.setMeta(chunk7HANRHHL_js.g,true);let b=n.schema.marks.insertion,h=n.schema.marks.deletion,y=[...o].sort((u,c)=>c.from-u.from);for(let u of y){let c=u.markName==="insertion";if(t==="accept"&&!c||t==="reject"&&c)l.delete(u.from,u.to);else {let C=c?b:h;C&&l.removeMark(u.from,u.to,C);}}let S=[...s].sort((u,c)=>c.pos-u.pos);for(let u of S){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="paragraph")continue;let C=u.kind==="pPrIns"&&f.attrs.pPrIns?.revisionId===e,p=u.kind==="pPrDel"&&f.attrs.pPrDel?.revisionId===e;if(!C&&!p)continue;if(t==="reject"&&u.kind==="pPrIns"||t==="accept"&&u.kind==="pPrDel"){let T=c+f.nodeSize,R=l.doc.nodeAt(T);!R||R.type.name!=="paragraph"?N(l,c,u.kind):(N(l,c,u.kind),$e(l,c));}else N(l,c,u.kind);}let x=[...a].sort((u,c)=>c.pos-u.pos);for(let u of x){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="paragraph")continue;let C=f.attrs.pPrChange;if(!Array.isArray(C))continue;let p=C.findIndex(g=>g.info.id===e);if(!(p<0))if(t==="reject"&&u.prior){let g=Ue(f.attrs,u.prior,u.current),T=C.slice();T.splice(p,1),l.setNodeMarkup(c,void 0,{...g,pPrChange:T.length>0?T:null});}else Je(l,c,p);}let w=[...d].sort((u,c)=>c.pos-u.pos);for(let u of w){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="tableCell"&&f.type.name!=="tableHeader")continue;let C=f.attrs.cellMarker;!C||C.info.revisionId!==e||l.setNodeMarkup(c,void 0,{...f.attrs,cellMarker:null});}let k=[...i].sort((u,c)=>c.pos-u.pos);for(let u of k){let c=l.mapping.map(u.pos),f=l.doc.nodeAt(c);if(!f||f.type.name!=="tableRow")continue;let C=f.attrs.trIns,p=f.attrs.trDel,g=C?.revisionId===e,T=p?.revisionId===e;if(!g&&!T)continue;if(t==="reject"&&g||t==="accept"&&T){let v=l.doc.resolve(c+1),P=v.node(v.depth-1),I=v.before(v.depth-1);if(P?.type.name==="table"&&P.childCount>1)l.delete(c,c+f.nodeSize);else if(P?.type.name==="table")if(l.doc.resolve(I).parent.childCount===1){let U=l.doc.type.schema.nodes.paragraph;l.replaceWith(I,I+P.nodeSize,U.create());}else l.delete(I,I+P.nodeSize);else {let A={...f.attrs};g&&(A.trIns=null),T&&(A.trDel=null),l.setNodeMarkup(c,void 0,A);}}else {let v={...f.attrs};g&&(v.trIns=null),T&&(v.trDel=null),l.setNodeMarkup(c,void 0,v);}}return l.steps.length===0?false:(r(l),true)}}function Ye(e){return M(e,"accept")}function qe(e){return M(e,"reject")}function J(e,t){let n=e.schema.marks.insertion,r=e.schema.marks.deletion;if(!n&&!r)return null;let s=null;return e.doc.descendants((o,a)=>{if(o.isInline){if(a>=t)return false;for(let i of o.marks)(i.type===n||i.type===r)&&(s={from:a,to:a+o.nodeSize,type:i.type===n?"insertion":"deletion"});}}),!s&&t<e.doc.content.size?J(e,e.doc.content.size):s}function Qe(e){return e.doc.attrs.watermark??null}function Xe(e){return (t,n)=>(n&&n(t.tr.setDocAttribute("watermark",e)),true)}exports.A=xe;exports.B=we;exports.C=Pe;exports.D=Ie;exports.E=Ae;exports.F=Ee;exports.G=Me;exports.H=Re;exports.I=Be;exports.J=We;exports.K=Fe;exports.L=De;exports.M=Le;exports.N=ze;exports.O=He;exports.P=je;exports.Q=$;exports.R=Ye;exports.S=qe;exports.T=J;exports.U=Qe;exports.V=Xe;exports.a=q;exports.b=Q;exports.c=ee;exports.d=te;exports.e=re;exports.f=ne;exports.g=oe;exports.h=ae;exports.i=ie;exports.j=se;exports.k=le;exports.l=ce;exports.m=de;exports.n=ue;exports.o=pe;exports.p=me;exports.q=fe;exports.r=ge;exports.s=be;exports.t=he;exports.u=ye;exports.v=Ce;exports.w=Te;exports.x=Se;exports.y=ke;exports.z=ve;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {t,w,q,y as y$1,o}from'./chunk-
|
|
1
|
+
import {t,w,q,y as y$1,o}from'./chunk-7KMTWDPE.mjs';import {f}from'./chunk-VW22RZ6C.mjs';import {a}from'./chunk-QYUPLKLP.mjs';var i={runImage:"layout-run-image",blockImage:"layout-block-image",pageFloatingImage:"layout-page-floating-image",cellFloatingImage:"layout-cell-floating-image",pageContent:"layout-page-content",paragraph:"layout-paragraph"},y=[`.${i.pageFloatingImage}`,`.${i.cellFloatingImage}`,`.${i.blockImage}`,`.${i.runImage}`].join(", ");function L(n){if(!(n instanceof Element))return null;let e=n.closest(y);if(!e)return null;let o=e.dataset.pmStart;if(o===void 0)return null;let t=Number(o);return Number.isNaN(t)?null:{pos:t,imageEl:e}}function b(n){if(!(n instanceof HTMLElement))return null;if(n.tagName==="IMG"&&n.classList.contains(i.runImage))return n;let e=n.closest(y);return e&&e.dataset.pmStart?e:null}function x(n,e=1){if(!n.classList.contains(i.runImage))return;let o=n.closest(`.${i.pageContent}`),t=n.closest(`.${i.paragraph}`);if(!o||!t)return;let r=n.getBoundingClientRect(),a=o.getBoundingClientRect(),l=t.getBoundingClientRect(),p=e>0?e:1;return {horizontalEmu:Math.round(f((r.left-a.left)/p)),verticalEmu:Math.round(f((r.top-l.top)/p))}}function T(n,e){return n==="inline"?"inline":n==="behind"?"behind":n==="inFront"?"inFront":n==="square"||n==="tight"||n==="through"?e==="right"?"squareRight":"squareLeft":null}var k=[{choice:"inline",i18nLabelKey:"inLineWithText",i18nDescKey:"inLineWithText",iconHint:"inline"},{choice:"squareLeft",i18nLabelKey:"squareLeft",i18nDescKey:"squareLeft",iconHint:"squareLeft"},{choice:"squareRight",i18nLabelKey:"squareRight",i18nDescKey:"squareRight",iconHint:"squareRight"},{choice:"behind",i18nLabelKey:"behindText",i18nDescKey:"behindText",iconHint:"behind"},{choice:"inFront",i18nLabelKey:"inFrontOfText",i18nDescKey:"inFrontOfText",iconHint:"inFront"}];function I(n,e){return true}function E(n){switch(n){case "inline":return "inline";case "square":case "tight":case "through":return "squareLeft";case "topAndBottom":return "topAndBottom";case "behind":return "behind";case "inFront":return "inFront";case "wrapRight":return "squareLeft";case "wrapLeft":return "squareRight";default:return}}function X(n,e){let o=new Map;for(let t=0;t<n.length;t++){let r=n[t],a=e[t];r&&a&&o.set(String(r.id),{block:r,measure:a});}return o}var c=class{constructor(e={}){a(this,"container",null);a(this,"blockLookup",new Map);a(this,"pageStates",[]);a(this,"totalPages",0);a(this,"options");a(this,"doc");a(this,"resolvedCommentIds",new Set);this.options=e,this.doc=e.document??document;}setBlockLookup(e){this.blockLookup=e;}mount(e){this.container=e,this.applyContainerStyles();}unmount(){this.container&&(this.container.innerHTML=""),this.container=null,this.pageStates=[];}applyContainerStyles(){if(!this.container)return;let e=this.options.pageGap??24;this.container.style.display="flex",this.container.style.flexDirection="column",this.container.style.alignItems="center",this.container.style.gap=`${e}px`,this.container.style.padding=`${e}px`,this.container.style.backgroundColor=this.options.containerBackground??"var(--doc-bg, #f8f9fa)",this.container.style.minHeight="100%";}paint(e){if(!this.container)throw new Error("LayoutPainter: not mounted");let{pages:o}=e;this.totalPages=o.length,this.container.innerHTML="",this.pageStates=[];for(let t=0;t<o.length;t++){let r=o[t],a={pageNumber:r.number,totalPages:this.totalPages,section:"body",resolvedCommentIds:this.resolvedCommentIds},l=this.renderPageWithLookup(r,a);this.container.appendChild(l),this.pageStates.push({element:l,pageNumber:r.number,fragmentCount:r.fragments.length});}}renderPageWithLookup(e,o){let t=this.doc.createElement("div");t.className="layout-page",t.dataset.pageNumber=String(e.number),t.style.position="relative",t.style.width=`${e.size.w}px`,t.style.height=`${e.size.h}px`,t.style.backgroundColor=this.options.pageBackground??"#ffffff",t.style.overflow="hidden",this.options.showShadow&&(t.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)");let r=this.doc.createElement("div");r.className="layout-page-content",r.style.position="absolute",r.style.top=`${e.margins.top}px`,r.style.left=`${e.margins.left}px`,r.style.right=`${e.margins.right}px`,r.style.bottom=`${e.margins.bottom}px`,r.style.overflow="visible";for(let a of e.fragments){let l=this.renderFragmentWithLookup(a,o);this.applyFragmentPosition(l,a),r.appendChild(l);}return t.appendChild(r),t}renderFragmentWithLookup(e,o$1){let t$1=this.blockLookup.get(String(e.blockId));if(e.kind==="paragraph"&&t$1){let r=t$1.block,a=t$1.measure;return t(e,r,a,o$1,{document:this.doc})}if(e.kind==="table"&&t$1){let r=t$1.block,a=t$1.measure;return w(e,r,a,o$1,{document:this.doc})}if(e.kind==="image"&&t$1){let r=t$1.block,a=t$1.measure;return q(e,r,a,o$1,{document:this.doc})}if(e.kind==="textBox"&&t$1){let r=t$1.block,a=t$1.measure;return y$1(e,r,a,o$1,{document:this.doc})}return o(e,o$1,{document:this.doc})}applyFragmentPosition(e,o){e.style.position="absolute",e.style.left=`${o.x}px`,e.style.top=`${o.y}px`,e.style.width=`${o.width}px`,"height"in o&&(e.style.height=`${o.height}px`);}getPageCount(){return this.totalPages}getPageElement(e){return this.pageStates[e]?.element??null}scrollToPage(e){let o=this.pageStates.find(t=>t.pageNumber===e);o?.element&&o.element.scrollIntoView({behavior:"smooth",block:"start"});}};function Z(n){return new c(n)}export{i as a,L as b,b as c,x as d,T as e,k as f,I as g,E as h,X as i,c as j,Z as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$1,c,d}from'./chunk-7OW3VCZE.mjs';import {b as b$4}from'./chunk-QPFJJPIC.mjs';import {a}from'./chunk-GYWTUUXX.mjs';import {b as b$1}from'./chunk-QAJSNLJR.mjs';import {b}from'./chunk-2XP6GLA4.mjs';import {b as b$3,n}from'./chunk-67LVRQIR.mjs';import {e}from'./chunk-VW22RZ6C.mjs';import {b as b$2}from'./chunk-DI6CRWSW.mjs';function we(e){if(!e||e.pattern&&e.pattern!=="clear")return;let n$1=e.fill?.rgb;if(!(!n$1||e.fill?.auto))return n(n$1)}function X(e){if(!e)return [];let n=[];e.bold&&n.push(b$1.mark("bold")),e.italic&&n.push(b$1.mark("italic")),e.underline&&e.underline.style!=="none"&&n.push(b$1.mark("underline",{style:e.underline.style,color:e.underline.color})),(e.strike||e.doubleStrike)&&n.push(b$1.mark("strike",{double:e.doubleStrike||false})),e.color&&!e.color.auto&&n.push(b$1.mark("textColor",{rgb:e.color.rgb,themeColor:e.color.themeColor,themeTint:e.color.themeTint,themeShade:e.color.themeShade}));let o=e.highlight&&e.highlight!=="none"?e.highlight:we(e.shading);return o&&n.push(b$1.mark("highlight",{color:o})),e.fontSize&&n.push(b$1.mark("fontSize",{size:e.fontSize})),e.fontFamily&&n.push(b$1.mark("fontFamily",{ascii:e.fontFamily.ascii,hAnsi:e.fontFamily.hAnsi,eastAsia:e.fontFamily.eastAsia,cs:e.fontFamily.cs,asciiTheme:e.fontFamily.asciiTheme,hAnsiTheme:e.fontFamily.hAnsiTheme,eastAsiaTheme:e.fontFamily.eastAsiaTheme,csTheme:e.fontFamily.csTheme})),e.vertAlign==="superscript"?n.push(b$1.mark("superscript")):e.vertAlign==="subscript"&&n.push(b$1.mark("subscript")),e.allCaps&&n.push(b$1.mark("allCaps")),e.smallCaps&&n.push(b$1.mark("smallCaps")),(e.spacing!=null||e.position!=null||e.scale!=null||e.kerning!=null)&&n.push(b$1.mark("characterSpacing",{spacing:e.spacing??null,position:e.position??null,scale:e.scale??null,kerning:e.kerning??null})),e.emboss&&n.push(b$1.mark("emboss")),e.imprint&&n.push(b$1.mark("imprint")),e.shadow&&n.push(b$1.mark("textShadow")),e.emphasisMark&&e.emphasisMark!=="none"&&n.push(b$1.mark("emphasisMark",{type:e.emphasisMark})),e.outline&&n.push(b$1.mark("textOutline")),e.hidden&&n.push(b$1.mark("hidden")),e.rtl&&n.push(b$1.mark("rtl")),e.effect&&e.effect!=="none"&&n.push(b$1.mark("textEffect",{effect:e.effect})),n}function E(e,n){if(!e)return;if(!n)return e;let o=n.resolveRunStyle(e.styleId);return o?b$2(o,e):e}function ee(e,n){let o="",l,t=e.type==="simpleField"?e.content:e.fieldResult;if(t){for(let s of t)if(s.type==="run"){for(let u of s.content)u.type==="text"&&(o+=u.text);!l&&s.formatting&&(l=s.formatting);}}let r=b$2(n,l),i=X(r);return b$1.node("field",{fieldType:e.fieldType,instruction:e.instruction,displayText:o,fieldKind:e.type==="simpleField"?"simple":"complex",fldLock:e.fldLock??false,dirty:e.dirty??false},void 0,i)}function te(e){return b$1.node("math",{display:e.display,ommlXml:e.ommlXml,plainText:e.plainText||""})}function K(e,n,o){let l=[],t=e.formatting?.styleId?o?.getRunStyleOwnProperties(e.formatting.styleId):void 0,r=b$2(b$2(n,t),e.formatting),i=X(r);for(let s of e.content){let u=pe(s,i);l.push(...u);}return l}function pe(e,n){switch(e.type){case "text":return e.text?[b$1.text(e.text,n)]:[];case "break":return e.breakType==="textWrapping"||!e.breakType?[b$1.node("hardBreak",null,void 0,n)]:[];case "tab":return [b$1.node("tab",null,void 0,n)];case "drawing":return e.image?[xe(e.image)]:[];case "shape":{let t=e.shape;return t.textBody&&t.textBody.content.length>0?[]:[ke(t)]}case "footnoteRef":let o=b$1.mark("footnoteRef",{id:e.id.toString(),noteType:"footnote"});return [b$1.text(e.id.toString(),[...n,o])];case "endnoteRef":let l=b$1.mark("footnoteRef",{id:e.id.toString(),noteType:"endnote"});return [b$1.text(e.id.toString(),[...n,l])];default:return []}}function xe(e$1){let n=e$1.size?.width?e(e$1.size.width):void 0,o=e$1.size?.height?e(e$1.size.height):void 0,l=e$1.wrap.type,t=e$1.wrap.wrapText,r=e$1.position?.horizontal?.alignment,i;l==="inline"||l==="topAndBottom"?i="none":l==="square"||l==="tight"||l==="through"?t==="left"?i="right":t==="right"||r==="left"?i="left":r==="right"?i="right":i="none":i="none";let s="inline";l==="inline"?s="inline":l==="topAndBottom"?s="block":b$4(l)||i&&i!=="none"?s="float":s="block";let u;if(e$1.transform){let P=[];e$1.transform.rotation&&P.push(`rotate(${e$1.transform.rotation}deg)`),e$1.transform.flipH&&P.push("scaleX(-1)"),e$1.transform.flipV&&P.push("scaleY(-1)"),P.length>0&&(u=P.join(" "));}let c=e$1.wrap.distT!=null?e(e$1.wrap.distT):void 0,f=e$1.wrap.distB!=null?e(e$1.wrap.distB):void 0,d=e$1.wrap.distL!=null?e(e$1.wrap.distL):void 0,m=e$1.wrap.distR!=null?e(e$1.wrap.distR):void 0,p;e$1.position&&(p={horizontal:e$1.position.horizontal?{relativeTo:e$1.position.horizontal.relativeTo,posOffset:e$1.position.horizontal.posOffset,align:e$1.position.horizontal.alignment}:void 0,vertical:e$1.position.vertical?{relativeTo:e$1.position.vertical.relativeTo,posOffset:e$1.position.vertical.posOffset,align:e$1.position.vertical.alignment}:void 0});let S,w,M;if(e$1.outline&&e$1.outline.width){S=Math.round(e$1.outline.width/914400*96*100)/100,e$1.outline.color?.rgb&&(w=`#${e$1.outline.color.rgb}`);let P={solid:"solid",dot:"dotted",dash:"dashed",lgDash:"dashed",dashDot:"dashed",lgDashDot:"dashed",lgDashDotDot:"dashed",sysDot:"dotted",sysDash:"dashed",sysDashDot:"dashed",sysDashDotDot:"dashed"};M=e$1.outline.style&&P[e$1.outline.style]||"solid";}let z=e$1.padding?.top?e(e$1.padding.top):void 0,I=e$1.padding?.bottom?e(e$1.padding.bottom):void 0,B=e$1.padding?.left?e(e$1.padding.left):void 0,g=e$1.padding?.right?e(e$1.padding.right):void 0;return b$1.node("image",{src:e$1.src||"",alt:e$1.alt,title:e$1.title,width:n,height:o,rId:e$1.rId,wrapType:l,displayMode:s,cssFloat:i,transform:u,distTop:c,distBottom:f,distLeft:d,distRight:m,position:p,borderWidth:S,borderColor:w,borderStyle:M,wrapText:t,hlinkHref:e$1.hlinkHref,cropTop:e$1.crop?.top,cropRight:e$1.crop?.right,cropBottom:e$1.crop?.bottom,cropLeft:e$1.crop?.left,opacity:e$1.opacity,effectExtentTop:z,effectExtentBottom:I,effectExtentLeft:B,effectExtentRight:g,layoutInCell:e$1.layoutInCell,allowOverlap:e$1.allowOverlap})}function Y(e,n,o){let l=[],t=e.href||(e.anchor?`#${e.anchor}`:""),r=b$1.mark("hyperlink",{href:t,tooltip:e.tooltip,rId:e.rId});for(let i of e.children)if(i.type==="run"){let s=i.formatting?.styleId?o?.getRunStyleOwnProperties(i.formatting.styleId):void 0,u=b$2(b$2(n,s),i.formatting),f=[...X(u),r];for(let d of i.content)l.push(...pe(d,f));}return l}function ke(e$1){let n=e$1.size?.width?e(e$1.size.width):100,o=e$1.size?.height?e(e$1.size.height):80,l,t="solid",r,i,s;if(e$1.fill&&(t=e$1.fill.type,e$1.fill.color?.rgb&&(l=`#${e$1.fill.color.rgb}`),e$1.fill.type==="gradient"&&e$1.fill.gradient)){let m=e$1.fill.gradient;r=m.type,i=m.angle,s=JSON.stringify(m.stops.map(p=>({position:p.position,color:p.color.rgb?`#${p.color.rgb}`:"#000000"})));}let u,c,f;e$1.outline&&(e$1.outline.width&&(u=Math.round(e$1.outline.width/914400*96*100)/100),e$1.outline.color?.rgb&&(c=`#${e$1.outline.color.rgb}`),f=e$1.outline.style||"solid");let d;if(e$1.transform){let m=[];e$1.transform.rotation&&m.push(`rotate(${e$1.transform.rotation}deg)`),e$1.transform.flipH&&m.push("scaleX(-1)"),e$1.transform.flipV&&m.push("scaleY(-1)"),m.length>0&&(d=m.join(" "));}return b$1.node("shape",{shapeType:e$1.shapeType||"rect",shapeId:e$1.id,width:n,height:o,fillColor:l,fillType:t,gradientType:r,gradientAngle:i,gradientStops:s,outlineWidth:u,outlineColor:c,outlineStyle:f,transform:d})}function V(e,n,o,l){let t=Fe(e,n),r=[],i,s=new Set,u;n&&(u=n.resolveParagraphStyle(e.formatting?.styleId).runFormatting);let c=b$2(u,l);for(let f of e.content){if(f.type==="commentRangeStart")s.add(f.id);else if(f.type==="commentRangeEnd")s.delete(f.id);else if(f.type==="run"){let d=K(f,c,n);s.size>0&&(d=O(d,s)),r.push(...d);}else if(f.type==="hyperlink"){let d=Y(f,c,n);r.push(...d);}else if(f.type==="simpleField"||f.type==="complexField"){let d=ee(f,c);d&&r.push(d);}else if(f.type==="inlineSdt"){let d=me(f,c,n);d&&r.push(d);}else if(f.type==="insertion"){let d=J(f,"insertion",c,n);s.size>0&&(d=O(d,s)),r.push(...d);}else if(f.type==="deletion"){let d=J(f,"deletion",c,n);s.size>0&&(d=O(d,s)),r.push(...d);}else if(f.type==="moveFrom"){let d=J(f,"deletion",c,n,true);s.size>0&&(d=O(d,s)),r.push(...d);}else if(f.type==="moveTo"){let d=J(f,"insertion",c,n,true);s.size>0&&(d=O(d,s)),r.push(...d);}else if(f.type==="mathEquation"){let d=te(f);d&&r.push(d);}f.type==="bookmarkStart"&&(i||(i=[]),i.push({id:f.id,name:f.name}));}return i&&(t.bookmarks=i),b$1.node("paragraph",t,r)}function O(e,n){if(n.size===0)return e;let o=[...n][0],l=b$1.marks.comment.create({commentId:o});return e.map(t=>t.isText?t.mark(l.addToSet(t.marks)):t)}function J(e,n,o,l,t=false){let r=[];for(let s of e.content)s.type==="run"?r.push(...K(s,o,l)):s.type==="hyperlink"&&r.push(...Y(s,o,l));let i=b$1.marks[n].create({revisionId:e.info.id,author:e.info.author,date:e.info.date??null,isMovePair:t});return r.map(s=>s.isText||s.type.allowsMarkType(i.type)?s.mark(i.addToSet(s.marks)):s)}function Fe(e,n){let o=e.formatting,l=o?.styleId,t={paraId:e.paraId??void 0,textId:e.textId??void 0,styleId:l,numPr:o?.numPr,listNumFmt:e.listRendering?.numFmt,listIsBullet:e.listRendering?.isBullet,listMarker:e.listRendering?.marker,listMarkerHidden:e.listRendering?.markerHidden||void 0,listMarkerFontFamily:e.listRendering?.markerFontFamily||void 0,listMarkerFontSize:e.listRendering?.markerFontSize||void 0,listMarkerSuffix:e.listRendering?.markerSuffix||void 0,listLevelNumFmts:e.listRendering?.levelNumFmts||void 0,listAbstractNumId:e.listRendering?.abstractNumId,listStartOverride:e.listRendering?.startOverride,_originalFormatting:o||void 0};if(n){let r=n.resolveParagraphStyle(l),i=r.paragraphFormatting,s=r.runFormatting;t.alignment=o?.alignment??i?.alignment,t.spaceBefore=o?.spaceBefore??i?.spaceBefore,t.spaceAfter=o?.spaceAfter??i?.spaceAfter,t.lineSpacing=o?.lineSpacing??i?.lineSpacing,t.lineSpacingRule=o?.lineSpacingRule??i?.lineSpacingRule,o?.spacingExplicit&&(t.spacingExplicit=o.spacingExplicit),t.indentLeft=o?.indentLeft??i?.indentLeft,t.indentRight=o?.indentRight??i?.indentRight,t.indentFirstLine=o?.indentFirstLine??i?.indentFirstLine,t.hangingIndent=o?.hangingIndent??i?.hangingIndent,t.borders=o?.borders??i?.borders,t.shading=o?.shading??i?.shading,t.tabs=o?.tabs??i?.tabs,t.pageBreakBefore=o?.pageBreakBefore??i?.pageBreakBefore,t.keepNext=o?.keepNext??i?.keepNext,t.keepLines=o?.keepLines??i?.keepLines,t.contextualSpacing=o?.contextualSpacing??i?.contextualSpacing,t.outlineLevel=o?.outlineLevel??i?.outlineLevel,t.bidi=o?.bidi??i?.bidi;let u=n.getDefaultCharacterStyle()?.rPr,c=u?b$2(s,u):s,f=E(o?.runProperties,n);t.defaultTextFormatting=b$2(c,f),!o?.numPr&&i?.numPr&&i.numPr.numId!==0&&(t.numPr=i.numPr);}else t.alignment=o?.alignment,t.spaceBefore=o?.spaceBefore,t.spaceAfter=o?.spaceAfter,t.lineSpacing=o?.lineSpacing,t.lineSpacingRule=o?.lineSpacingRule,o?.spacingExplicit&&(t.spacingExplicit=o.spacingExplicit),t.indentLeft=o?.indentLeft,t.indentRight=o?.indentRight,t.indentFirstLine=o?.indentFirstLine,t.hangingIndent=o?.hangingIndent,t.borders=o?.borders,t.shading=o?.shading,t.tabs=o?.tabs,t.pageBreakBefore=o?.pageBreakBefore,t.keepNext=o?.keepNext,t.keepLines=o?.keepLines,t.outlineLevel=o?.outlineLevel,t.bidi=o?.bidi,t.defaultTextFormatting=E(o?.runProperties,n);if(e.sectionProperties){t._sectionProperties=e.sectionProperties;let r=e.sectionProperties.sectionStart;(r==="nextPage"||r==="continuous"||r==="oddPage"||r==="evenPage")&&(t.sectionBreakType=r);}return e.renderedPageBreakBefore&&(t.renderedPageBreakBefore=true),e.pPrIns&&(t.pPrIns={revisionId:e.pPrIns.id,author:e.pPrIns.author,date:e.pPrIns.date??null}),e.pPrDel&&(t.pPrDel={revisionId:e.pPrDel.id,author:e.pPrDel.author,date:e.pPrDel.date??null}),e.propertyChanges&&e.propertyChanges.length>0&&(t.pPrChange=e.propertyChanges),t}function me(e,n,o){let l=e.properties,t=[];for(let r of e.content)if(r.type==="run"){let i=K(r,n,o);t.push(...i);}else if(r.type==="hyperlink"){let i=Y(r,n,o);t.push(...i);}else if(r.type==="simpleField"||r.type==="complexField"){let i=ee(r,n);i&&t.push(i);}else if(r.type==="inlineSdt"){let i=me(r,n,o);i&&t.push(i);}else if(r.type==="mathEquation"){let i=te(r);i&&t.push(i);}return b$1.node("sdt",a$1(l),t.length>0?t:void 0)}function ge(e){function n(l){return l.type==="break"&&l.breakType==="page"}function o(l){if(l.type==="run"){for(let t of l.content)if(n(t))return true;return false}if(l.type==="hyperlink"){for(let t of l.children)if(t.type==="run"&&o(t))return true;return false}if(l.type==="insertion"||l.type==="deletion"){let t=l;for(let r of t.content)if(o(r))return true;return false}return false}for(let l of e.content)if(o(l))return true;return false}function R(e,n,o){if(!e||!n)return;let l=e.getStyle(n);if(!l?.tblStylePr)return;let t=l.tblStylePr.find(u=>u.type===o);if(!t)return;let r=E(t.pPr?.runProperties,e),i=E(t.rPr,e),s=b$2(r,i);return {tcPr:t.tcPr,rPr:s}}function N(e,n){if(!e&&!n)return;if(!e)return n;if(!n)return e;let o={},l=e.tcPr,t=n.tcPr;if(l||t){let r={...l??{},...t??{}};(l?.borders||t?.borders)&&(r.borders={...l?.borders??{},...t?.borders??{}}),(l?.shading||t?.shading)&&(r.shading={...l?.shading??{},...t?.shading??{}}),(l?.margins||t?.margins)&&(r.margins={...l?.margins??{},...t?.margins??{}}),o.tcPr=r;}return o.rPr=b$2(e.rPr,n.rPr),o}function Se(e){let n=new Map,o=e.rows.length,l=new Map;for(let t=0;t<o;t++){let r=e.rows[t],i=0,s=r.cells.map(c=>{let f=c.formatting?.gridSpan??1,d=i;return i+=f,{colIndex:d,vMerge:c.formatting?.vMerge,key:`${t}-${d}`}});if(s.length>0&&s.every(({colIndex:c,vMerge:f})=>f==="continue"&&l.has(c))){for(let{colIndex:c,key:f}of s)l.delete(c),n.set(f,{rowSpan:1,skip:false});continue}for(let{colIndex:c,vMerge:f,key:d}of s){let m=c;if(f==="restart")l.set(m,t),n.set(d,{rowSpan:1,skip:false});else if(f==="continue"){let p=l.get(m);if(p!==void 0){let S=`${p}-${m}`,w=n.get(S);w&&w.rowSpan++,n.set(d,{rowSpan:1,skip:true});}else n.set(d,{rowSpan:1,skip:false});}else l.delete(m),n.set(d,{rowSpan:1,skip:false});}}return n}function ne(e,n,o){let l=Se(e),t=e.columnWidths,r=t?.reduce((P,x)=>P+x,0)??0,i=e.formatting?.styleId,s=e.formatting?.look,u=i?n?.getStyle(i):void 0,c=n?.getDefaultTableStyle(),f=e.formatting?.borders??u?.tblPr?.borders??c?.tblPr?.borders,d=e.formatting?.cellMargins??u?.tblPr?.cellMargins??c?.tblPr?.cellMargins??void 0,m=d?{top:d.top?.value,bottom:d.bottom?.value,left:d.left?.value,right:d.right?.value}:void 0,p={styleId:e.formatting?.styleId,width:e.formatting?.width?.value,widthType:e.formatting?.width?.type,justification:e.formatting?.justification,columnWidths:t,floating:e.formatting?.floating,cellMargins:m,look:e.formatting?.look,_originalFormatting:e.formatting||void 0};e.propertyChanges&&e.propertyChanges.length>0&&(p.tblPrChange=e.propertyChanges);let S={wholeTable:R(n,i,"wholeTable"),firstRow:R(n,i,"firstRow"),lastRow:R(n,i,"lastRow"),firstCol:R(n,i,"firstCol"),lastCol:R(n,i,"lastCol"),band1Horz:R(n,i,"band1Horz"),band2Horz:R(n,i,"band2Horz"),band1Vert:R(n,i,"band1Vert"),band2Vert:R(n,i,"band2Vert"),nwCell:R(n,i,"nwCell"),neCell:R(n,i,"neCell"),swCell:R(n,i,"swCell"),seCell:R(n,i,"seCell")},w=s?.noHBand!==true,M=s?.noVBand!==true,z=0,I=e.rows.length,B=t?.length??Math.max(0,...e.rows.map(P=>P.cells.reduce((x,F)=>x+(F.formatting?.gridSpan??1),0))),g=e.rows.map((P,x)=>{let F=x===0&&!!s?.firstRow,v=x===I-1&&!!s?.lastRow,h=w&&!F&&!v?z%2===0?S.band1Horz:S.band2Horz:void 0;return w&&!F&&!v&&z++,Re(P,n,F,t,r,S,h,M,s,f,x,I,B,l,m,o)});return b$1.node("table",p,g)}function Re(e,n,o,l,t,r,i,s,u,c,f,d,m,p,S,w){let M={height:e.formatting?.height?.value,heightRule:e.formatting?.heightRule,isHeader:!!e.formatting?.header,_originalFormatting:e.formatting||void 0};if(e.structuralChange){let C=e.structuralChange,D={revisionId:C.info.id,author:C.info.author,date:C.info.date??null};C.type==="tableRowInsertion"?M.trIns=D:C.type==="tableRowDeletion"&&(M.trDel=D);}e.propertyChanges&&e.propertyChanges.length>0&&(M.trPrChange=e.propertyChanges);let z=e.cells.length,I=f===0,B=f===(d??1)-1,g=e.formatting?.conditionalFormat,P=g?.firstRow??I,x=g?.lastRow??B,F=m??z,v=0,h=[];for(let C=0;C<e.cells.length;C++){let D=e.cells[C],H=D.formatting?.gridSpan??1,ye=`${f??0}-${v}`,re=p?.get(ye),Pe=re?.skip??false,Ce=re?.rowSpan??1,ie;if(l&&t&&t>0){let q=0;for(let A=0;A<H&&v+A<l.length;A++)q+=l[v+A];ie=Math.round(q/t*100);}if(v+=H,Pe)continue;let le=v-H===0,se=v===F,b=D.formatting?.conditionalFormat,G=b?.firstRow??P,Q=b?.lastRow??x,$=b?.firstColumn??le,W=b?.lastColumn??se,_;if(s){let q=u?.firstColumn?1:0,A=v-H-q;A>=0&&!(u?.lastColumn&&W)&&!(u?.firstColumn&&$)&&(_=A%2===0?r?.band1Vert:r?.band2Vert);}b?.oddVBand?_=r?.band1Vert:b?.evenVBand&&(_=r?.band2Vert);let L=i;g?.oddHBand?L=r?.band1Horz:g?.evenHBand&&(L=r?.band2Horz),b?.oddHBand?L=r?.band1Horz:b?.evenHBand&&(L=r?.band2Horz);let T=r?.wholeTable;T=N(T,L),T=N(T,_),G&&(u?.firstRow||g?.firstRow||b?.firstRow)&&(T=N(T,r?.firstRow)),Q&&(u?.lastRow||g?.lastRow||b?.lastRow)&&(T=N(T,r?.lastRow)),$&&(u?.firstColumn||g?.firstColumn||b?.firstColumn)&&(T=N(T,r?.firstCol)),W&&(u?.lastColumn||g?.lastColumn||b?.lastColumn)&&(T=N(T,r?.lastCol)),G&&$&&(u?.firstRow||g?.firstRow||b?.firstRow)&&(u?.firstColumn||g?.firstColumn||b?.firstColumn)&&(T=N(T,r?.nwCell)),G&&W&&(u?.firstRow||g?.firstRow||b?.firstRow)&&(u?.lastColumn||g?.lastColumn||b?.lastColumn)&&(T=N(T,r?.neCell)),Q&&$&&(u?.lastRow||g?.lastRow||b?.lastRow)&&(u?.firstColumn||g?.firstColumn||b?.firstColumn)&&(T=N(T,r?.swCell)),Q&&W&&(u?.lastRow||g?.lastRow||b?.lastRow)&&(u?.lastColumn||g?.lastColumn||b?.lastColumn)&&(T=N(T,r?.seCell)),h.push(he(D,n,o,ie,T,c,I,B,le,se,Ce,S,w));}if(h.length===0){let C=Math.max(F,1),D={formatting:C>1?{gridSpan:C}:void 0,content:[{type:"paragraph",content:[]}]},H=N(r?.wholeTable,i);h.push(he(D,n,o,t&&t>0?100:void 0,H,c,I,B,true,true,1,S,w));}return b$1.node("tableRow",M,h)}var Me=["top","bottom","left","right","insideH","insideV"];function ve(e,n){if(!e)return e;let o;for(let l of Me){let t=e[l];if(!t?.color?.themeColor||t.color.auto)continue;let r=b$3(t.color,n);r&&(o??(o={...e}),o[l]={...t,color:{rgb:r}});}return o??e}function he(e,n,o,l,t,r,i,s,u,c,f,d,m){let p=e.formatting,S=f??1,w=p?.width?.value,M=p?.width?.type;w===void 0&&l!==void 0&&(w=l,M="pct");let z=b$3(p?.shading?.fill??t?.tcPr?.shading?.fill,m),I=r?{top:i?r.top:r.insideH,bottom:s?r.bottom:r.insideH,left:u?r.left:r.insideV,right:c?r.right:r.insideV}:void 0,B=t?.tcPr?.borders,g=p?.borders,P=ve(I||B||g?{...I??{},...B??{},...g??{}}:void 0,m),x={colspan:p?.gridSpan??1,rowspan:S,width:w,widthType:M,verticalAlign:p?.verticalAlign,backgroundColor:z,textDirection:p?.textDirection,noWrap:p?.noWrap,borders:P,margins:p?.margins?{top:p.margins.top?.value,bottom:p.margins.bottom?.value,left:p.margins.left?.value,right:p.margins.right?.value}:t?.tcPr?.margins?{top:t.tcPr.margins.top?.value,bottom:t.tcPr.margins.bottom?.value,left:t.tcPr.margins.left?.value,right:t.tcPr.margins.right?.value}:d,_originalFormatting:p||void 0,_originalResolvedFill:z};if(e.structuralChange){let h=e.structuralChange,C={revisionId:h.info.id,author:h.info.author,date:h.info.date??null};h.type==="tableCellInsertion"?x.cellMarker={kind:"ins",info:C}:h.type==="tableCellDeletion"?x.cellMarker={kind:"del",info:C}:h.type==="tableCellMerge"&&(x.cellMarker={kind:"merge",info:C,vMerge:h.vMerge??"cont",...h.vMergeOrig?{vMergeOrig:h.vMergeOrig}:{}});}e.propertyChanges&&e.propertyChanges.length>0&&(x.tcPrChange=e.propertyChanges);let F=[];for(let h of e.content)h.type==="paragraph"?F.push(V(h,n,void 0,t?.rPr)):h.type==="table"&&F.push(ne(h,n));F.length===0&&F.push(b$1.node("paragraph",{},[]));let v=o?"tableHeader":"tableCell";return b$1.node(v,x,F)}function be(e,n){let o=Ne(e),l=V(e,n),t=[],r=o.length>0&&l.content.size===0,{anchored:i,inFlow:s}=Ie(o);for(let u of i)t.push(Te(u,n));r||t.push(l);for(let u of s)t.push(Te(u,n));return t}function Ie(e){let n=[],o=[];for(let l of e)c(l)?n.push(l):o.push(l);return {anchored:n,inFlow:o}}function Ne(e){let n=[];for(let o of e.content)if(o.type==="run"){for(let l of o.content)if(l.type==="shape"&&"shape"in l){let t=l.shape;t.textBody&&t.textBody.content.length>0&&n.push({type:"textBox",id:t.id,size:t.size,position:t.position,wrap:t.wrap,fill:t.fill,outline:t.outline,content:t.textBody.content,margins:t.textBody.margins});}}return n}function Te(e$1,n){let o=e$1.size?.width?e(e$1.size.width):200,l=e$1.size?.height?e(e$1.size.height):void 0,t;e$1.fill?.color?.rgb&&(t=`#${e$1.fill.color.rgb}`);let r,i,s;e$1.outline&&e$1.outline.width&&(r=Math.round(e$1.outline.width/914400*96*100)/100,e$1.outline.color?.rgb&&(i=`#${e$1.outline.color.rgb}`),s=e$1.outline.style||"solid");let u=e$1.margins?.top!=null?e(e$1.margins.top):4,c=e$1.margins?.bottom!=null?e(e$1.margins.bottom):4,f=e$1.margins?.left!=null?e(e$1.margins.left):7,d$1=e$1.margins?.right!=null?e(e$1.margins.right):7,m=[];for(let p of e$1.content)m.push(V(p,n));return m.length===0&&m.push(b$1.node("paragraph",{},[])),b$1.node("textBox",{width:o,height:l,textBoxId:e$1.id,fillColor:t,outlineWidth:r,outlineColor:i,outlineStyle:s,marginTop:u,marginBottom:c,marginLeft:f,marginRight:d$1,...d(e$1)},m)}function oe(e,n,o,l){let t=[];for(let r of e)if(r.type==="paragraph")t.push(...be(r,n)),l&&ge(r)&&t.push(b$1.node("pageBreak"));else if(r.type==="table")t.push(ne(r,n,o));else if(r.type==="blockSdt"){let i=oe(r.content,n,o,l),s=i.length>0?i:[b$1.node("paragraph",{},[])];t.push(b$1.node("blockSdt",a$1(r.properties),s));}return t}function mt(e,n){let o=e.package.theme??null,l=n?.styles?b(n.styles):null,t=oe(e.package.document.content,l,o,true);return t.length===0&&t.push(b$1.node("paragraph",{},[])),t[t.length-1]?.type.name==="blockSdt"&&t.push(b$1.node("paragraph",{},[])),b$1.node("doc",{defaultTabStopTwips:e.package.settings?.defaultTabStop??null,watermark:a(e)??null},t)}function Be(e,n){let o=n?.styles?b(n.styles):null,l=n?.theme??null,t=oe(e,o,l,false);return t.length===0&&t.push(b$1.node("paragraph",{},[])),b$1.node("doc",{defaultTabStopTwips:n?.defaultTabStopTwips??null},t)}function gt(e,n){return Be(e,n)}function ht(){return b$1.node("doc",null,[b$1.node("paragraph",{},[])])}export{mt as a,Be as b,gt as c,ht as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkL5NPEM7C_js=require('./chunk-L5NPEM7C.js');var e=chunkL5NPEM7C_js.a.getCommands();function g(t){return e.setAlignment(t)}var l=e.alignLeft(),u=e.alignCenter(),x=e.alignRight(),C=e.alignJustify();function f(t,n="auto"){return e.setLineSpacing(t,n)}var S=e.singleSpacing(),L=e.oneAndHalfSpacing(),b=e.doubleSpacing();function y(t=720){return e.increaseIndent(t)}function v(t=720){return e.decreaseIndent(t)}function A(t){return e.setIndentLeft(t)}function I(t){return e.setIndentRight(t)}function h(t,n){return e.setIndentFirstLine(t,n)}var R=e.toggleBulletList(),T=e.toggleNumberedList(),P=e.increaseListLevel(),B=e.decreaseListLevel(),k=e.removeList();function E(t){return e.setSpaceBefore(t)}function F(t){return e.setSpaceAfter(t)}function H(t,n){return e.applyStyle(t,n)}var J=e.clearStyle();function N(t){return e.insertSectionBreak(t)}var O=e.removeSectionBreak();function M(t,n="left",r="none"){return e.addTabStop(t,n,r)}function j(t){return e.removeTabStop(t)}var q=e.setRtl(),w=e.setLtr(),z=e.generateTOC();exports.A=j;exports.B=q;exports.C=w;exports.D=z;exports.a=g;exports.b=l;exports.c=u;exports.d=x;exports.e=C;exports.f=f;exports.g=S;exports.h=L;exports.i=b;exports.j=y;exports.k=v;exports.l=A;exports.m=I;exports.n=h;exports.o=R;exports.p=T;exports.q=P;exports.r=B;exports.s=k;exports.t=E;exports.u=F;exports.v=H;exports.w=J;exports.x=N;exports.y=O;exports.z=M;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunk2WGTGBBS_js=require('./chunk-2WGTGBBS.js');var t=new chunk2WGTGBBS_js.r(chunk2WGTGBBS_js.q());t.buildSchema();t.initializeRuntime();var s=t,n=t.getSchema();exports.a=s;exports.b=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkYWM2QH36_js=require('./chunk-YWM2QH36.js'),chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js'),chunkDC7S76ZX_js=require('./chunk-DC7S76ZX.js');var i={runImage:"layout-run-image",blockImage:"layout-block-image",pageFloatingImage:"layout-page-floating-image",cellFloatingImage:"layout-cell-floating-image",pageContent:"layout-page-content",paragraph:"layout-paragraph"},y=[`.${i.pageFloatingImage}`,`.${i.cellFloatingImage}`,`.${i.blockImage}`,`.${i.runImage}`].join(", ");function L(n){if(!(n instanceof Element))return null;let e=n.closest(y);if(!e)return null;let o=e.dataset.pmStart;if(o===void 0)return null;let t=Number(o);return Number.isNaN(t)?null:{pos:t,imageEl:e}}function b(n){if(!(n instanceof HTMLElement))return null;if(n.tagName==="IMG"&&n.classList.contains(i.runImage))return n;let e=n.closest(y);return e&&e.dataset.pmStart?e:null}function x(n,e=1){if(!n.classList.contains(i.runImage))return;let o=n.closest(`.${i.pageContent}`),t=n.closest(`.${i.paragraph}`);if(!o||!t)return;let r=n.getBoundingClientRect(),a=o.getBoundingClientRect(),l=t.getBoundingClientRect(),p=e>0?e:1;return {horizontalEmu:Math.round(chunk4Q2IP5FW_js.f((r.left-a.left)/p)),verticalEmu:Math.round(chunk4Q2IP5FW_js.f((r.top-l.top)/p))}}function T(n,e){return n==="inline"?"inline":n==="behind"?"behind":n==="inFront"?"inFront":n==="square"||n==="tight"||n==="through"?e==="right"?"squareRight":"squareLeft":null}var k=[{choice:"inline",i18nLabelKey:"inLineWithText",i18nDescKey:"inLineWithText",iconHint:"inline"},{choice:"squareLeft",i18nLabelKey:"squareLeft",i18nDescKey:"squareLeft",iconHint:"squareLeft"},{choice:"squareRight",i18nLabelKey:"squareRight",i18nDescKey:"squareRight",iconHint:"squareRight"},{choice:"behind",i18nLabelKey:"behindText",i18nDescKey:"behindText",iconHint:"behind"},{choice:"inFront",i18nLabelKey:"inFrontOfText",i18nDescKey:"inFrontOfText",iconHint:"inFront"}];function I(n,e){return true}function E(n){switch(n){case "inline":return "inline";case "square":case "tight":case "through":return "squareLeft";case "topAndBottom":return "topAndBottom";case "behind":return "behind";case "inFront":return "inFront";case "wrapRight":return "squareLeft";case "wrapLeft":return "squareRight";default:return}}function X(n,e){let o=new Map;for(let t=0;t<n.length;t++){let r=n[t],a=e[t];r&&a&&o.set(String(r.id),{block:r,measure:a});}return o}var c=class{constructor(e={}){chunkDC7S76ZX_js.a(this,"container",null);chunkDC7S76ZX_js.a(this,"blockLookup",new Map);chunkDC7S76ZX_js.a(this,"pageStates",[]);chunkDC7S76ZX_js.a(this,"totalPages",0);chunkDC7S76ZX_js.a(this,"options");chunkDC7S76ZX_js.a(this,"doc");chunkDC7S76ZX_js.a(this,"resolvedCommentIds",new Set);this.options=e,this.doc=e.document??document;}setBlockLookup(e){this.blockLookup=e;}mount(e){this.container=e,this.applyContainerStyles();}unmount(){this.container&&(this.container.innerHTML=""),this.container=null,this.pageStates=[];}applyContainerStyles(){if(!this.container)return;let e=this.options.pageGap??24;this.container.style.display="flex",this.container.style.flexDirection="column",this.container.style.alignItems="center",this.container.style.gap=`${e}px`,this.container.style.padding=`${e}px`,this.container.style.backgroundColor=this.options.containerBackground??"var(--doc-bg, #f8f9fa)",this.container.style.minHeight="100%";}paint(e){if(!this.container)throw new Error("LayoutPainter: not mounted");let{pages:o}=e;this.totalPages=o.length,this.container.innerHTML="",this.pageStates=[];for(let t=0;t<o.length;t++){let r=o[t],a={pageNumber:r.number,totalPages:this.totalPages,section:"body",resolvedCommentIds:this.resolvedCommentIds},l=this.renderPageWithLookup(r,a);this.container.appendChild(l),this.pageStates.push({element:l,pageNumber:r.number,fragmentCount:r.fragments.length});}}renderPageWithLookup(e,o){let t=this.doc.createElement("div");t.className="layout-page",t.dataset.pageNumber=String(e.number),t.style.position="relative",t.style.width=`${e.size.w}px`,t.style.height=`${e.size.h}px`,t.style.backgroundColor=this.options.pageBackground??"#ffffff",t.style.overflow="hidden",this.options.showShadow&&(t.style.boxShadow="0 2px 8px rgba(0, 0, 0, 0.15)");let r=this.doc.createElement("div");r.className="layout-page-content",r.style.position="absolute",r.style.top=`${e.margins.top}px`,r.style.left=`${e.margins.left}px`,r.style.right=`${e.margins.right}px`,r.style.bottom=`${e.margins.bottom}px`,r.style.overflow="visible";for(let a of e.fragments){let l=this.renderFragmentWithLookup(a,o);this.applyFragmentPosition(l,a),r.appendChild(l);}return t.appendChild(r),t}renderFragmentWithLookup(e,o){let t=this.blockLookup.get(String(e.blockId));if(e.kind==="paragraph"&&t){let r=t.block,a=t.measure;return chunkYWM2QH36_js.t(e,r,a,o,{document:this.doc})}if(e.kind==="table"&&t){let r=t.block,a=t.measure;return chunkYWM2QH36_js.w(e,r,a,o,{document:this.doc})}if(e.kind==="image"&&t){let r=t.block,a=t.measure;return chunkYWM2QH36_js.q(e,r,a,o,{document:this.doc})}if(e.kind==="textBox"&&t){let r=t.block,a=t.measure;return chunkYWM2QH36_js.y(e,r,a,o,{document:this.doc})}return chunkYWM2QH36_js.o(e,o,{document:this.doc})}applyFragmentPosition(e,o){e.style.position="absolute",e.style.left=`${o.x}px`,e.style.top=`${o.y}px`,e.style.width=`${o.width}px`,"height"in o&&(e.style.height=`${o.height}px`);}getPageCount(){return this.totalPages}getPageElement(e){return this.pageStates[e]?.element??null}scrollToPage(e){let o=this.pageStates.find(t=>t.pageNumber===e);o?.element&&o.element.scrollIntoView({behavior:"smooth",block:"start"});}};function Z(n){return new c(n)}exports.a=i;exports.b=L;exports.c=b;exports.d=x;exports.e=T;exports.f=k;exports.g=I;exports.h=E;exports.i=X;exports.j=c;exports.k=Z;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {c}from'./chunk-HKN2NKOG.mjs';import {V as V$1,L,T,k,l}from'./chunk-JHTURDPX.mjs';import {b}from'./chunk-IUJCUITW.mjs';import {e}from'./chunk-VW22RZ6C.mjs';function ee(e,n){if(e.pages.length===0)return null;let a=e.pageGap??0,r=0,t=null,o=1/0;for(let s=0;s<e.pages.length;s++){let i=e.pages[s],l=i.size?.h??e.pageSize.h,f=r,u=f+l;if(n.y>=f&&n.y<u)return {pageIndex:s,page:i,pageY:n.y-f};let c=f+l/2,m=Math.abs(n.y-c);m<o&&(o=m,t=s),r=u+a;}if(t!==null){let s=e.pages[t],i=A(e,t);return {pageIndex:t,page:s,pageY:Math.max(0,Math.min(n.y-i,s.size?.h??e.pageSize.h))}}return null}function A(e,n){let a=e.pageGap??0,r=0;for(let t=0;t<n&&t<e.pages.length;t++){let s=e.pages[t].size?.h??e.pageSize.h;r+=s+a;}return r}function Ne(e,n){return ee(e,{y:n})?.pageIndex??null}function te(e,n){return e.findIndex(a=>a.id===n)}function Ye(e,n){let a=0;for(let r=e.fromLine;r<e.toLine&&r<n.lines.length;r++)a+=n.lines[r].lineHeight;return a}function ge(e,n,a,r){let t=[...e.page.fragments].sort((o,s)=>{let i=o.y-s.y;return Math.abs(i)>.5?i:o.x-s.x});for(let o of t){let s=te(n,o.blockId);if(s===-1)continue;let i=n[s],l=a[s];if(!i||!l)continue;let f;if(o.kind==="paragraph"){if(i.kind!=="paragraph"||l.kind!=="paragraph")continue;f=Ye(o,l);}else if(o.kind==="table")f=o.height;else if(o.kind==="image")f=o.height;else continue;let u=r.x>=o.x&&r.x<=o.x+o.width,c=r.y>=o.y&&r.y<=o.y+f;if(u&&c)return {fragment:o,block:i,measure:l,pageIndex:e.pageIndex,localX:r.x-o.x,localY:r.y-o.y}}return null}function ze(e,n,a,r){for(let t of e.page.fragments){if(t.kind!=="image")continue;let o=te(n,t.blockId);if(o===-1)continue;let s=n[o],i=a[o];if(!s||!i)continue;let l=r.x>=t.x&&r.x<=t.x+t.width,f=r.y>=t.y&&r.y<=t.y+t.height;if(l&&f)return {fragment:t,block:s,measure:i,pageIndex:e.pageIndex,localX:r.x-t.x,localY:r.y-t.y}}return null}function pe(e,n,a,r){for(let t of e.page.fragments){if(t.kind!=="table")continue;let o=t,s=r.x>=o.x&&r.x<=o.x+o.width,i=r.y>=o.y&&r.y<=o.y+o.height;if(!s||!i)continue;let l=te(n,o.blockId);if(l===-1)continue;let f=n[l],u=a[l];if(!f||f.kind!=="table"||!u||u.kind!=="table")continue;let c=f,m=u,g=r.x-o.x,x=r.y-o.y,d=o.headerRowCount??0,h=d>0&&o.continuesFromPrev?V$1(m,d):0,p=0,b=-1;if(m.rows.length===0||c.rows.length===0)continue;if(h>0&&x<h){let M=0;for(let w=0;w<d&&w<m.rows.length;w++){let L=m.rows[w];if(x>=M&&x<M+L.height){b=w;break}M+=L.height;}b===-1&&(b=0);}else {let M=x-h;for(let w=o.fromRow;w<o.toRow&&w<m.rows.length;w++){let L=m.rows[w];if(M>=p&&M<p+L.height){b=w;break}p+=L.height;}}if(b===-1&&(b=Math.min(o.toRow-1,m.rows.length-1),b<o.fromRow))continue;let T=m.rows[b],H=c.rows[b];if(!T||!H)continue;let F=0,k=-1;if(T.cells.length===0||H.cells.length===0)continue;for(let M=0;M<T.cells.length;M++){let w=T.cells[M];if(g>=F&&g<F+w.width){k=M;break}F+=w.width;}if(k===-1&&(k=T.cells.length-1,k<0))continue;let P=T.cells[k],S=H.cells[k];if(!P||!S)continue;let y=0;if(h>0&&b<d)for(let M=0;M<b;M++)y+=m.rows[M]?.height??0;else {y=h;for(let M=o.fromRow;M<b;M++)y+=m.rows[M]?.height??0;}let R=0;for(let M=0;M<k;M++)R+=T.cells[M]?.width??0;let _,I;if(S.blocks&&S.blocks.length>0){let M=S.blocks[0],w=P.blocks[0];M.kind==="paragraph"&&w?.kind==="paragraph"&&(_=M,I=w);}let E=g-R,C=x-y;return {fragment:o,block:c,measure:m,pageIndex:e.pageIndex,rowIndex:b,colIndex:k,cellBlock:_,cellMeasure:I,cellLocalX:Math.max(0,E),cellLocalY:Math.max(0,C)}}return null}function We(e,n,a,r){let t={pageHit:null,fragmentHit:null,tableCellHit:null};if(t.pageHit=ee(e,r),!t.pageHit)return t;let o=A(e,t.pageHit.pageIndex),s={x:r.x,y:r.y-o};return t.fragmentHit=ge(t.pageHit,n,a,s),t.fragmentHit?.fragment.kind==="table"&&(t.tableCellHit=pe(t.pageHit,n,a,s)),t}function Ge(e){if(e.pages.length===0)return 0;let n=e.pageGap??0,a=0;for(let r=0;r<e.pages.length;r++){let t=e.pages[r];a+=t.size?.h??e.pageSize.h,r<e.pages.length-1&&(a+=n);}return a}function Ve(e,n){return A(e,n)}function Ue(e,n){if(n<0||n>=e.pages.length)return null;let a=A(e,n),t=e.pages[n].size?.h??e.pageSize.h;return {top:a,bottom:a+t}}function ne(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function be(e,n){let a=[];for(let r=n.fromRun;r<=n.toRun&&r<e.runs.length;r++){let t=e.runs[r];if(t){if(t.kind==="tab"||t.kind==="image"||t.kind==="lineBreak"){a.push(t);continue}if(t.kind==="text"){let o=t.text??"",s=r===n.fromRun,i=r===n.toRun;if(s||i){let l=s?n.fromChar:0,f=i?n.toChar:o.length,u=o.slice(l,f);u.length>0&&a.push({...t,text:u});}else a.push(t);}}}return a}function xe(e,n){let a,r,t=e.pmStart??0,o=0;for(let s=0;s<e.runs.length&&s<=n.toRun;s++){let i=e.runs[s];i&&(s<n.fromRun?i.kind==="text"?o+=(i.text??"").length:(i.kind==="tab"||i.kind==="lineBreak"||i.kind==="image")&&(o+=1):s===n.fromRun&&(o+=n.fromChar,a=t+o,i.kind==="text"&&(o=n.fromChar)));}if(a!==void 0){let s=0;for(let i=n.fromRun;i<=n.toRun&&i<e.runs.length;i++){let l=e.runs[i];if(l)if(l.kind==="text"){let f=l.text??"",u=i===n.fromRun?n.fromChar:0,c=i===n.toRun?n.toChar:f.length;s+=c-u;}else (l.kind==="tab"||l.kind==="lineBreak"||l.kind==="image")&&(s+=1);}r=a+s;}return {pmStart:a,pmEnd:r}}function $e(e,n,a,r){let t=0;for(let o=a;o<r&&o<e.lines.length;o++){let i=e.lines[o].lineHeight;if(n>=t&&n<t+i)return o;t+=i;}return r>a?Math.min(r-1,e.lines.length-1):null}function qe(e,n,a,r){let{pmStart:t,pmEnd:o}=xe(e,n);if(t===void 0||o===void 0)return {charOffset:0,pmPosition:e.pmStart??0};let s=e.attrs?.alignment??"left",i=0;s==="center"?i=Math.max(0,(r-n.width)/2):s==="right"&&(i=Math.max(0,r-n.width));let l$1=Math.max(0,a-i);if(l$1<=0)return {charOffset:0,pmPosition:t};let f=be(e,n);if(f.length===0)return {charOffset:0,pmPosition:t};let u=0,c=0;for(let g of f){if(g.kind==="tab"){let x=g.width??48,d=u+x;if(l$1<=d){let h=u+x/2;return l$1<h?{charOffset:c,pmPosition:t+c}:{charOffset:c+1,pmPosition:t+c+1}}u=d,c+=1;continue}if(g.kind==="image"){let x=g.width,d=u+x;if(l$1<=d){let h=u+x/2;return l$1<h?{charOffset:c,pmPosition:t+c}:{charOffset:c+1,pmPosition:t+c+1}}u=d,c+=1;continue}if(g.kind==="lineBreak"){if(l$1>=u)return {charOffset:c,pmPosition:t+c};c+=1;continue}if(g.kind==="text"){let x=g.text??"";if(x.length===0)continue;let d=ne(g),h=k(x,d),p=u+h.width;if(l$1<=p){let b=l$1-u,T=l(b,h.charWidths),H=c+T;return {charOffset:H,pmPosition:t+H}}u=p,c+=x.length;}}return {charOffset:o-t,pmPosition:o}}function oe(e){let{fragment:n,block:a,measure:r,localX:t,localY:o}=e;if(n.kind!=="paragraph"||a.kind!=="paragraph"||r.kind!=="paragraph")return null;let s=n,i=a,l=r,f=$e(l,o,s.fromLine,s.toLine);if(f===null)return null;let u=l.lines[f];if(!u)return null;let c=0;for(let T=s.fromLine;T<f;T++)c+=l.lines[T]?.lineHeight??0;let m=i.attrs?.indent,g=m?.left??0,x=m?.right??0,d=Math.max(0,n.width-g-x),h=t-g,{charOffset:p,pmPosition:b}=qe(i,u,h,d);return {pmPosition:b,charOffset:p,lineIndex:f}}function ke(e){let{cellBlock:n,cellMeasure:a,cellLocalX:r,cellLocalY:t}=e;if(!n||!a)return null;let o={fragment:{kind:"paragraph",blockId:n.id,x:0,y:0,width:a.lines.reduce((i,l)=>Math.max(i,l.width),100),fromLine:0,toLine:a.lines.length,height:a.totalHeight},block:n,measure:a,pageIndex:e.pageIndex,localX:r,localY:t};return oe(o)?.pmPosition??null}function je(e,n){if(n)return ke(n);if(!e)return null;let{fragment:a}=e;return a.kind==="paragraph"?oe(e)?.pmPosition??null:a.kind==="image"?a.pmStart??null:null}function Te(e,n,a,r){let t=e.pmStart??0,o=e.pmEnd??t;if(a<t||a>o)return null;let s=a-t;for(let i=0;i<n.lines.length;i++){let l=n.lines[i],{pmStart:f,pmEnd:u}=xe(e,l);if(f===void 0||u===void 0)continue;let c=f-t,m=u-t;if(s>=c&&s<=m){let g=s-c,x=be(e,l),d=0,h=0;for(let p of x)if(p.kind==="tab"){if(g<=h+1)return g<=h?{x:d,lineIndex:i}:{x:d+(p.width??48),lineIndex:i};d+=p.width??48,h+=1;}else if(p.kind==="image"){if(g<=h+1)return g<=h?{x:d,lineIndex:i}:{x:d+p.width,lineIndex:i};d+=p.width,h+=1;}else if(p.kind==="lineBreak"){if(g<=h)return {x:d,lineIndex:i};h+=1;}else if(p.kind==="text"){let b=p.text??"";if(g<=h+b.length){let F=g-h,k$1=ne(p),P=k(b.slice(0,F),k$1);return {x:d+P.width,lineIndex:i}}let T=ne(p),H=k(b,T);d+=H.width,h+=b.length;}return {x:d,lineIndex:i}}}return null}function Je(e,n,a,r,t,o,s){let i=Te(e,n,a);if(!i)return null;let l=e.attrs?.alignment??"left",f=e.attrs?.indent,u=f?.left??0,c=f?.right??0,m=Math.max(0,o-u-c),g=n.lines[i.lineIndex];if(!g)return null;let x=0;l==="center"?x=Math.max(0,(m-g.width)/2):l==="right"&&(x=Math.max(0,m-g.width));let d=0;for(let h=s;h<i.lineIndex;h++)d+=n.lines[h]?.lineHeight??0;return {x:r+u+x+i.x,y:t+d,height:g.lineHeight}}function Ke(e,n,a={}){let r=a.scope??"body",t=r==="body"?"layout-page-content":`layout-page-${r}`,o=`.${t} .layout-table-cell`,s=e.querySelectorAll(`.${t} .layout-table-cell-selected`);for(let c of Array.from(s))c.classList.remove("layout-table-cell-selected");let i=n.selection;if(!("$anchorCell"in i&&typeof i.forEachCell=="function")||!i.forEachCell)return;let f=[];i.forEachCell((c,m)=>{f.push([m,m+c.nodeSize]);});let u=e.querySelectorAll(o);for(let c of Array.from(u)){let m=c,g=m.dataset.pmStart;if(g===void 0)continue;let x=Number(g);for(let[d,h]of f)if(x>=d&&x<h){m.classList.add("layout-table-cell-selected");break}}}function Me(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function re(e,n){return e.findIndex(a=>a.id===n)}function V(e,n){let r=(e.pmStart??0)+1,t=0,o;for(let l=0;l<e.runs.length&&l<=n.toRun;l++){let f=e.runs[l];if(f){if(l<n.fromRun)f.kind==="text"?t+=(f.text??"").length:t+=1;else if(l===n.fromRun){t+=n.fromChar,o=r+t;break}}}o===void 0&&(o=r);let s=0;for(let l=n.fromRun;l<=n.toRun&&l<e.runs.length;l++){let f=e.runs[l];if(f)if(f.kind==="text"){let u=f.text??"",c=l===n.fromRun?n.fromChar:0,m=l===n.toRun?n.toChar:u.length;s+=m-c;}else s+=1;}let i=o+s;return {pmStart:o,pmEnd:i}}function Fe(e,n,a,r){let t=[];for(let o=0;o<n.lines.length;o++){let s=n.lines[o],i=V(e,s);i.pmStart===void 0||i.pmEnd===void 0||i.pmEnd>a&&i.pmStart<r&&t.push({line:s,index:o});}return t}function W(e,n,a){let r=V(e,n);return r.pmStart===void 0?0:Math.max(0,a-r.pmStart)}function G(e,n,a,r){let t=0,o=0;for(let s=n.fromRun;s<=n.toRun&&s<e.runs.length;s++){let i=e.runs[s];if(i){if(i.kind==="tab"){let l=i.width??48;if(o+1>=a)return a<=o?t:t+l;t+=l,o+=1;continue}if(i.kind==="image"){let l=i.width;if(o+1>=a)return a<=o?t:t+l;t+=l,o+=1;continue}if(i.kind==="lineBreak"){if(a<=o)return t;o+=1;continue}if(i.kind==="text"){let l=i.text??"",f=s===n.fromRun,u=s===n.toRun,c=f?n.fromChar:0,m=u?n.toChar:l.length,g=l.slice(c,m);if(o+g.length>=a){let h=a-o,p=Me(i),b=k(g.slice(0,h),p);return t+b.width}let x=Me(i),d=k(g,x);t+=d.width,o+=g.length;}}}return t}function J(e,n){let a=0;for(let r=0;r<n&&r<e.lines.length;r++)a+=e.lines[r].lineHeight;return a}function Qe(e,n,a,r,t){if(r===t)return [];let o=Math.min(r,t),s=Math.max(r,t),i=[];for(let l=0;l<e.pages.length;l++){let f=e.pages[l],u=A(e,l);for(let c of f.fragments){if(c.kind==="paragraph"){let m=re(n,c.blockId);if(m===-1)continue;let g=n[m],x=a[m];if(!g||g.kind!=="paragraph"||!x||x.kind!=="paragraph")continue;let d=g,h=x,p=c,b=Fe(d,h,o,s);for(let{line:T,index:H}of b){if(H<p.fromLine||H>=p.toLine)continue;let F=V(d,T);if(F.pmStart===void 0||F.pmEnd===void 0)continue;let k=Math.max(F.pmStart,o),P=Math.min(F.pmEnd,s);if(k>=P)continue;let S=W(d,T,k),y=W(d,T,P),B=d.attrs?.indent,R=B?.left??0,_=B?.right??0,I=Math.max(0,c.width-R-_),E=G(d,T,S),C=G(d,T,y),M=d.attrs?.alignment??"left",w=0;M==="center"?w=Math.max(0,(I-T.width)/2):M==="right"&&(w=Math.max(0,I-T.width));let L=J(h,H)-J(h,p.fromLine),D=c.x+R+w+Math.min(E,C),Y=Math.max(1,Math.abs(C-E)),z=c.y+L;i.push({x:D,y:z+u,width:Y,height:T.lineHeight,pageIndex:l});}}if(c.kind==="table"){let m=re(n,c.blockId);if(m===-1)continue;let g=n[m],x=a[m];if(!g||g.kind!=="table"||!x||x.kind!=="table")continue;let d=g,h=x,p=c,b=[],T=0;for(let y=0;y<h.rows.length;y++)b.push(Math.round(T)),T+=h.rows[y]?.height??0;b.push(Math.round(T));let H=p.headerRowCount??0,F=H>0&&p.continuesFromPrev?V$1(h,H):0,k=(b[p.fromRow]??0)+(p.topClip??0),P=p.bottomClip!==void 0?Math.round(p.height):F+((b[p.toRow]??0)-k),S=y=>F+(y-k);for(let y=p.fromRow;y<p.toRow&&y<d.rows.length;y++){let B=d.rows[y],R=h.rows[y];if(!B||!R)continue;let _=b[y]??0,I=0;for(let E=0;E<B.cells.length;E++){let C=B.cells[E],M=R.cells[E];if(!C||!M)continue;let w=C.padding?.top??0,L$1=L(C.blocks,M.blocks,w);for(let D=0;D<C.blocks.length;D++){let Y=C.blocks[D],z=M.blocks[D];if(!Y||Y.kind!=="paragraph"||!z||z.kind!=="paragraph")continue;let X=Y,Ae=z,De=L$1.lineTops[D]??[],ve=Fe(X,Ae,o,s);for(let{line:v,index:Oe}of ve){let q=V(X,v);if(q.pmStart===void 0||q.pmEnd===void 0)continue;let ae=Math.max(q.pmStart,o),se=Math.min(q.pmEnd,s);if(ae>=se)continue;let Q=S(_+(De[Oe]??0));if(Q+v.lineHeight<=F||Q>=P)continue;let _e=W(X,v,ae),Xe=W(X,v,se),le=G(X,v,_e,M.width),ce=G(X,v,Xe,M.width);i.push({x:p.x+I+Math.min(le,ce),y:p.y+Q+u,width:Math.max(1,Math.abs(ce-le)),height:v.lineHeight,pageIndex:l});}}I+=M.width;}}}if(c.kind==="image"){let m=c.pmStart??0;(c.pmEnd??m+1)>o&&m<s&&i.push({x:c.x,y:c.y+u,width:c.width,height:c.height,pageIndex:l});}}}return i}function Ze(e,n,a,r){for(let t=0;t<e.pages.length;t++){let o=e.pages[t],s=A(e,t);for(let i of o.fragments){if(i.kind==="paragraph"){let l=re(n,i.blockId);if(l===-1)continue;let f=n[l],u=a[l];if(!f||f.kind!=="paragraph"||!u||u.kind!=="paragraph")continue;let c=f,m=u,g=i,x=c.pmStart??0,d=c.pmEnd??x;if(r<x||r>d)continue;for(let h=g.fromLine;h<g.toLine;h++){let p=m.lines[h];if(!p)continue;let b=V(c,p);if(!(b.pmStart===void 0||b.pmEnd===void 0)&&r>=b.pmStart&&r<=b.pmEnd){let T=W(c,p,r),H=c.attrs?.indent,F=H?.left??0,k=H?.right??0,P=Math.max(0,i.width-F-k),S=G(c,p,T),y=c.attrs?.alignment??"left",B=0;y==="center"?B=Math.max(0,(P-p.width)/2):y==="right"&&(B=Math.max(0,P-p.width));let R=J(m,h)-J(m,g.fromLine);return {x:i.x+F+B+S,y:i.y+R+s,height:p.lineHeight,pageIndex:t}}}}if(i.kind==="image"){let l=i.pmStart??0,f=i.pmEnd??l+1;if(r>=l&&r<=f){let u=r===l?0:i.width;return {x:i.x+u,y:i.y+s,height:i.height,pageIndex:t}}}}}return null}function et(e){return e.length<=1?false:new Set(e.map(a=>a.pageIndex)).size>1}function tt(e){let n=new Map;for(let a of e){let r=n.get(a.pageIndex)??[];r.push(a),n.set(a.pageIndex,r);}return n}function nt(e){if(e.kind!=="paragraph")return false;let n=e.attrs;return n?!!(n.borders?.top||n.borders?.bottom||n.spacingExplicit?.before||n.spacingExplicit?.after):false}function ye(e){return He(e)}function He(e){let n=new Set;for(let a=1;a<e.length;a++){let r=e[a-1],t=e[a];r.kind==="table"&&t.kind==="paragraph"&&(t.runs.length>0||nt(t)||n.add(a));}return e.map((a,r)=>{if(a.kind==="table")return ot(a);if(a.kind!=="paragraph")return a;let t=n.has(r),o=a.attrs?.spacingExplicit,s=a.attrs?.spacing?.before!=null,i=a.attrs?.spacing?.after!=null,l=s&&!o?.before,f=i&&!o?.after,u=l||f;if(!u&&!t)return a;let c=a.attrs;return u&&c?.spacing&&(c={...c,spacing:{...c.spacing,before:o?.before?c.spacing.before:void 0,after:o?.after?c.spacing.after:void 0}}),t&&(c={...c??{},suppressEmptyParagraphHeight:true}),{...a,attrs:c}})}function ot(e){let n=false,a=e.rows.map(r=>{let t=false,o=r.cells.map(s=>{let i=He(s.blocks);return i.some((f,u)=>f!==s.blocks[u])?(t=true,{...s,blocks:i}):s});return t?(n=true,{...r,cells:o}):r});return n?{...e,rows:a}:e}function rt(e){return e?.align??e?.alignment}function we(e$1,n,a,r){let t=r.section==="header"?r.margins.header??48:r.pageSize.h-(r.margins.footer??48)-a,o=e$1.position?.vertical;if(!o)return n;let s=rt(o),i=o.posOffset!==void 0?e(o.posOffset):void 0;if(o.relativeTo==="page"){if(i!==void 0)return i-t;if(s==="top")return -t;if(s==="bottom")return r.pageSize.h-e$1.height-t;if(s==="center")return (r.pageSize.h-e$1.height)/2-t}if(o.relativeTo==="margin"){let l=r.margins.top,f=r.pageSize.h-r.margins.top-r.margins.bottom;if(i!==void 0)return l+i-t;if(s==="top")return l-t;if(s==="bottom")return l+f-e$1.height-t;if(s==="center")return l+(f-e$1.height)/2-t}return i!==void 0?n+i:n}function Pe(e){switch(e.kind){case "paragraph":case "table":return true;case "image":return !e.anchor?.isAnchored;case "textBox":return e.displayMode===void 0||e.displayMode==="inline";default:return false}}function it(e){return e?e.kind==="paragraph"||e.kind==="table"?e.totalHeight:e.kind==="image"||e.kind==="textBox"?e.height:0:0}function Se(e,n,a,r){let t=0,o=0,s=0;for(let i=0;i<e.length;i++){let l=e[i],f=n[i];if(!(!l||!f)){if(l.kind==="paragraph"&&f.kind==="paragraph"){let u=s,c=u+f.totalHeight;t=Math.min(t,u),o=Math.max(o,c);for(let m of l.runs){if(m.kind!=="image"||!m.position)continue;let g=we(m,u,a,r);t=Math.min(t,g),o=Math.max(o,g+m.height);}s=c;}else if(l.kind==="table"&&f.kind==="table"){let u=s+f.totalHeight;t=Math.min(t,s),o=Math.max(o,u),s=u;}else if(l.kind==="image"&&f.kind==="image"){let u=s+f.height;t=Math.min(t,s),o=Math.max(o,u),s=u;}else if(l.kind==="textBox"&&f.kind==="textBox"){let u=s+f.height;t=Math.min(t,s),o=Math.max(o,u),l.displayMode!=="float"&&(s=u);}}}return {visualTop:t,visualBottom:o}}function at(e,n,a,r){if(!e||!e.content||e.content.length===0)return;let t=b(e.content,{styles:r.styles??void 0,theme:r.theme??null,defaultTabStopTwips:r.defaultTabStopTwips??null});return Be(t,n,a,r)}function Be(e,n,a,r){let t=c(e,{theme:r.theme??void 0});if(t.length===0)return;let o=ye(t),s=r.measureBlocks(o,n),i=0,l=0;for(let c=0;c<o.length;c++){let m=it(s[c]);i+=m,Pe(o[c])&&(l+=m);}let{visualTop:f,visualBottom:u}=Se(o,s,i,a);return {blocks:o,measures:s,height:i,flowHeight:l,visualTop:f,visualBottom:u}}var K={header:null,footer:null};function st(){K.header=null,K.footer=null;}function Re(e,n){let a=n.querySelectorAll(`.layout-page-${e}`);if(a.length===0)return null;let r=n.defaultView,t=r?r.innerHeight/2:0,o=a[0],s=1/0;for(let c of Array.from(a)){let m=c.getBoundingClientRect(),g=Math.abs((m.top+m.bottom)/2-t);g<s&&(s=g,o=c);}let i=K[e];if(i&&i.host===o&&i.host.isConnected)return i;let l=Array.from(o.querySelectorAll("span[data-pm-start][data-pm-end]")),f=Array.from(o.querySelectorAll("[data-pm-start][data-pm-end]")),u={host:o,spans:l,ranged:f};return K[e]=u,u}function lt(e,n,a=globalThis.document){let r=e.state.selection;if(!r.empty)return null;let t=r.head,o=Re(n,a);if(!o)return null;let{host:s,spans:i}=o;for(let d of i){let h=Number(d.dataset.pmStart),p=Number(d.dataset.pmEnd);if(!(!Number.isFinite(h)||!Number.isFinite(p))&&t>=h&&t<=p){let b=s.ownerDocument.createRange(),T=s.ownerDocument.createTreeWalker(d,NodeFilter.SHOW_TEXT),H=t-h,F=T.nextNode();for(;F;){let S=F.data.length;if(H<=S){try{b.setStart(F,H),b.setEnd(F,H);let y=b.getClientRects()[0]??b.getBoundingClientRect();if(y&&y.height>0)return {top:y.top,left:y.left,height:y.height}}catch{}break}H-=S,F=T.nextNode();}let k=d.getBoundingClientRect(),P=(t-h)/Math.max(1,p-h);return {top:k.top,left:k.left+k.width*P,height:k.height}}}let l=s.querySelector(`[data-pm-start="${t}"]`);if(l){let d=l.getBoundingClientRect();return {top:d.top,left:d.left+1,height:d.height||16}}let f=o.ranged,u=null,c=1/0;for(let d of f){let h=Number(d.dataset.pmStart),p=Number(d.dataset.pmEnd);if(!Number.isFinite(h)||!Number.isFinite(p)||t<h||t>p)continue;let b=p-h;b<c&&(c=b,u=d);}if(u){let d=u.getBoundingClientRect(),h=Number(u.dataset.pmEnd),p=t>=h;return {top:d.top,left:p?d.right:d.left+1,height:d.height||16}}let m=null,g=-1/0;for(let d of f){let h=Number(d.dataset.pmStart);Number.isFinite(h)&&(h>t||h>g&&(g=h,m=d));}if(m){let d=m.getBoundingClientRect();return {top:d.top,left:d.right,height:d.height||16}}let x=s.getBoundingClientRect();return {top:x.top+2,left:x.left+2,height:16}}function ct(e,n,a=globalThis.document){let r=e.state.selection;if(r.empty)return [];let t=r.from,o=r.to,s=[],i=Re(n,a);if(!i)return s;let{host:l,spans:f}=i;for(let u of f){let c=Number(u.dataset.pmStart),m=Number(u.dataset.pmEnd);if(!Number.isFinite(c)||!Number.isFinite(m)||m<=t||c>=o)continue;if(u.classList.contains("layout-run-tab")){let p=u.getBoundingClientRect();s.push({top:p.top,left:p.left,width:p.width,height:p.height});continue}let g=null;if(u.firstChild?.nodeType===Node.TEXT_NODE?g=u.firstChild:u.firstChild?.nodeType===Node.ELEMENT_NODE&&u.firstChild.tagName==="A"&&u.firstChild.firstChild?.nodeType===Node.TEXT_NODE&&(g=u.firstChild.firstChild),!g)continue;let x=Math.max(0,t-c),d=Math.min(g.length,o-c);if(x>=d)continue;let h=l.ownerDocument.createRange();h.setStart(g,x),h.setEnd(g,d);for(let p of Array.from(h.getClientRects()))s.push({top:p.top,left:p.left,width:p.width,height:p.height});}return s}function Ie(e){return e?e.flowHeight??e.height:0}function ut(e){let{pageSize:n,margins:a,finalMargins:r,bodyBlocks:t,headers:o,footers:s,warn:i}=e,l=a.header??48,f=a.footer??48,u=a.top-l,c=a.bottom-f,m=Math.max(0,...(o??[]).map(Ie)),g=Math.max(0,...(s??[]).map(Ie)),x=m>u,d=g>c;if(!x&&!d)return {margins:a,finalMargins:r};let h=Math.max(0,n.h-24),p=false,b=F=>{let k={...F};return x&&(k.top=Math.max(F.top,l+m)),d&&(k.bottom=Math.max(F.bottom,f+g)),k.top+k.bottom>h&&(p=true,k.bottom=Math.max(0,Math.min(k.bottom,h-k.top)),k.top+k.bottom>h&&(k.top=Math.max(0,h-k.bottom))),k},T=b(a),H=b(r);if(t)for(let F of t){if(F.kind!=="sectionBreak")continue;let k=F;k.margins&&(k.margins=b(k.margins));}return p&&i&&i(`[layout] header/footer content exceeds page height; clamping margins to preserve a content area. pageHeight=${Math.round(n.h)} headerBand=${Math.round(m)} footerBand=${Math.round(g)} top=${Math.round(T.top)} bottom=${Math.round(T.bottom)}`),{margins:T,finalMargins:H}}var Ce=816,Ee=1056,U=96,ie=48;function $(e){return Math.round(e/1440*96)}function N(e,n){return e!=null?$(e):n}function ft(e){return {w:e?.pageWidth?$(e.pageWidth):Ce,h:e?.pageHeight?$(e.pageHeight):Ee}}function dt(e){return {top:N(e?.marginTop,U),right:N(e?.marginRight,U),bottom:N(e?.marginBottom,U),left:N(e?.marginLeft,U),header:N(e?.headerDistance,ie),footer:N(e?.footerDistance,ie)}}function ht(e,n){let a={header:null,footer:null,firstHeader:null,firstFooter:null};if(!e?.package)return a;let r=e.package.headers,t=e.package.footers,o=null,s=null,i=null,l=null;if(r&&n?.headerReferences){let f=n.headerReferences.find(c=>c.type==="default");f?.rId&&(o=r.get(f.rId)??null);let u=n.headerReferences.find(c=>c.type==="first");u?.rId&&(i=r.get(u.rId)??null);}if(t&&n?.footerReferences){let f=n.footerReferences.find(c=>c.type==="default");f?.rId&&(s=t.get(f.rId)??null);let u=n.footerReferences.find(c=>c.type==="first");u?.rId&&(l=t.get(u.rId)??null);}return n?.titlePg||(!o&&i&&(o=i),!s&&l&&(s=l)),{header:o,footer:s,firstHeader:i,firstFooter:l}}function mt(e){let n=e?.columnCount??1;if(n<=1)return;let a=$(e?.columnSpace??720);return {count:n,gap:a,equalWidth:e?.equalWidth??true,separator:e?.separator}}function Le(e){let n=e.pageSize.w-e.margins.left-e.margins.right,a=e.columns;return !a||a.count<=1?n:Math.floor((n-(a.count-1)*a.gap)/a.count)}function gt(e,n,a){let{configs:r,breakIndices:t}=T(e,n,a),o=0,s=[];for(let i=0;i<e.length;i++)s.push(Le(r[o]??n)),o<t.length&&i===t[o]&&o++;return s}export{st as A,lt as B,ct as C,ut as D,Ce as E,Ee as F,U as G,ie as H,$ as I,ft as J,dt as K,ht as L,mt as M,Le as N,gt as O,ee as a,A as b,Ne as c,ge as d,ze as e,pe as f,We as g,Ge as h,Ve as i,Ue as j,oe as k,ke as l,je as m,Te as n,Je as o,Ke as p,Qe as q,Ze as r,et as s,tt as t,ye as u,we as v,Pe as w,Se as x,at as y,Be as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkYWM2QH36_js=require('./chunk-YWM2QH36.js');var O=30,F=200,y=24,R=10,B=10,C=24;function N(_){let{mouseX:n,mouseY:l,pagesContainer:d,target:L,hfEditMode:m,edgeProximity:r=O}=_,T=`.${chunkYWM2QH36_js.v.table}`,H=`.${chunkYWM2QH36_js.v.row}`,p=`.${chunkYWM2QH36_js.v.cell}`,h=`.${chunkYWM2QH36_js.D.header}`,M=`.${chunkYWM2QH36_js.D.footer}`,E=t=>{let o=!!t.closest(h),e=!!t.closest(M);return !o&&!e?!m:o?m==="header":m==="footer"},c=L.closest(T);if(c&&!E(c)&&(c=null),!c){let t=d.querySelectorAll(T);for(let o of Array.from(t)){if(!E(o))continue;let e=o.getBoundingClientRect(),s=n>=e.left-r&&n<e.left,A=l>=e.top-r&&l<e.top,P=n>=e.left-r&&n<=e.right,I=l>=e.top-r&&l<=e.bottom;if(s&&I||A&&P){c=o;break}}}if(!c)return null;let i=c.getBoundingClientRect(),b=n<i.left+r&&n>=i.left-r,g=l<i.top+r&&l>=i.top-r;if(!b&&!g)return null;let u=c.querySelectorAll(`:scope > ${H}`);if(u.length===0)return null;let S=t=>t&&Number(t.dataset.pmStart)||0;if(b)for(let t=0;t<u.length;t++){let o=u[t].getBoundingClientRect();if(l>=o.top&&l<=o.bottom){let e=u[t].querySelector(p),s=S(e);if(!s)break;return {type:"row",clientX:i.left-y,clientY:o.top+o.height/2-R,cellPmPos:s}}}if(g){let t=u[0].querySelectorAll(`:scope > ${p}`);for(let o=0;o<t.length;o++){let e=t[o].getBoundingClientRect();if(n>=e.left&&n<=e.right){let s=S(t[o]);if(!s)break;return {type:"column",clientX:e.left+e.width/2-B,clientY:i.top-C,cellPmPos:s}}}}return null}exports.a=O;exports.b=F;exports.c=N;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkYPQACU4A_js=require('./chunk-YPQACU4A.js'),chunkRSU4HTC6_js=require('./chunk-RSU4HTC6.js'),chunkXLB6AC5Q_js=require('./chunk-XLB6AC5Q.js'),chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js');function ee(e,n){if(e.pages.length===0)return null;let a=e.pageGap??0,r=0,t=null,o=1/0;for(let s=0;s<e.pages.length;s++){let i=e.pages[s],l=i.size?.h??e.pageSize.h,f=r,u=f+l;if(n.y>=f&&n.y<u)return {pageIndex:s,page:i,pageY:n.y-f};let c=f+l/2,m=Math.abs(n.y-c);m<o&&(o=m,t=s),r=u+a;}if(t!==null){let s=e.pages[t],i=A(e,t);return {pageIndex:t,page:s,pageY:Math.max(0,Math.min(n.y-i,s.size?.h??e.pageSize.h))}}return null}function A(e,n){let a=e.pageGap??0,r=0;for(let t=0;t<n&&t<e.pages.length;t++){let s=e.pages[t].size?.h??e.pageSize.h;r+=s+a;}return r}function Ne(e,n){return ee(e,{y:n})?.pageIndex??null}function te(e,n){return e.findIndex(a=>a.id===n)}function Ye(e,n){let a=0;for(let r=e.fromLine;r<e.toLine&&r<n.lines.length;r++)a+=n.lines[r].lineHeight;return a}function ge(e,n,a,r){let t=[...e.page.fragments].sort((o,s)=>{let i=o.y-s.y;return Math.abs(i)>.5?i:o.x-s.x});for(let o of t){let s=te(n,o.blockId);if(s===-1)continue;let i=n[s],l=a[s];if(!i||!l)continue;let f;if(o.kind==="paragraph"){if(i.kind!=="paragraph"||l.kind!=="paragraph")continue;f=Ye(o,l);}else if(o.kind==="table")f=o.height;else if(o.kind==="image")f=o.height;else continue;let u=r.x>=o.x&&r.x<=o.x+o.width,c=r.y>=o.y&&r.y<=o.y+f;if(u&&c)return {fragment:o,block:i,measure:l,pageIndex:e.pageIndex,localX:r.x-o.x,localY:r.y-o.y}}return null}function ze(e,n,a,r){for(let t of e.page.fragments){if(t.kind!=="image")continue;let o=te(n,t.blockId);if(o===-1)continue;let s=n[o],i=a[o];if(!s||!i)continue;let l=r.x>=t.x&&r.x<=t.x+t.width,f=r.y>=t.y&&r.y<=t.y+t.height;if(l&&f)return {fragment:t,block:s,measure:i,pageIndex:e.pageIndex,localX:r.x-t.x,localY:r.y-t.y}}return null}function pe(e,n,a,r){for(let t of e.page.fragments){if(t.kind!=="table")continue;let o=t,s=r.x>=o.x&&r.x<=o.x+o.width,i=r.y>=o.y&&r.y<=o.y+o.height;if(!s||!i)continue;let l=te(n,o.blockId);if(l===-1)continue;let f=n[l],u=a[l];if(!f||f.kind!=="table"||!u||u.kind!=="table")continue;let c=f,m=u,g=r.x-o.x,x=r.y-o.y,d=o.headerRowCount??0,h=d>0&&o.continuesFromPrev?chunkRSU4HTC6_js.V(m,d):0,p=0,b=-1;if(m.rows.length===0||c.rows.length===0)continue;if(h>0&&x<h){let M=0;for(let w=0;w<d&&w<m.rows.length;w++){let L=m.rows[w];if(x>=M&&x<M+L.height){b=w;break}M+=L.height;}b===-1&&(b=0);}else {let M=x-h;for(let w=o.fromRow;w<o.toRow&&w<m.rows.length;w++){let L=m.rows[w];if(M>=p&&M<p+L.height){b=w;break}p+=L.height;}}if(b===-1&&(b=Math.min(o.toRow-1,m.rows.length-1),b<o.fromRow))continue;let T=m.rows[b],H=c.rows[b];if(!T||!H)continue;let F=0,k=-1;if(T.cells.length===0||H.cells.length===0)continue;for(let M=0;M<T.cells.length;M++){let w=T.cells[M];if(g>=F&&g<F+w.width){k=M;break}F+=w.width;}if(k===-1&&(k=T.cells.length-1,k<0))continue;let P=T.cells[k],S=H.cells[k];if(!P||!S)continue;let y=0;if(h>0&&b<d)for(let M=0;M<b;M++)y+=m.rows[M]?.height??0;else {y=h;for(let M=o.fromRow;M<b;M++)y+=m.rows[M]?.height??0;}let R=0;for(let M=0;M<k;M++)R+=T.cells[M]?.width??0;let _,I;if(S.blocks&&S.blocks.length>0){let M=S.blocks[0],w=P.blocks[0];M.kind==="paragraph"&&w?.kind==="paragraph"&&(_=M,I=w);}let E=g-R,C=x-y;return {fragment:o,block:c,measure:m,pageIndex:e.pageIndex,rowIndex:b,colIndex:k,cellBlock:_,cellMeasure:I,cellLocalX:Math.max(0,E),cellLocalY:Math.max(0,C)}}return null}function We(e,n,a,r){let t={pageHit:null,fragmentHit:null,tableCellHit:null};if(t.pageHit=ee(e,r),!t.pageHit)return t;let o=A(e,t.pageHit.pageIndex),s={x:r.x,y:r.y-o};return t.fragmentHit=ge(t.pageHit,n,a,s),t.fragmentHit?.fragment.kind==="table"&&(t.tableCellHit=pe(t.pageHit,n,a,s)),t}function Ge(e){if(e.pages.length===0)return 0;let n=e.pageGap??0,a=0;for(let r=0;r<e.pages.length;r++){let t=e.pages[r];a+=t.size?.h??e.pageSize.h,r<e.pages.length-1&&(a+=n);}return a}function Ve(e,n){return A(e,n)}function Ue(e,n){if(n<0||n>=e.pages.length)return null;let a=A(e,n),t=e.pages[n].size?.h??e.pageSize.h;return {top:a,bottom:a+t}}function ne(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function be(e,n){let a=[];for(let r=n.fromRun;r<=n.toRun&&r<e.runs.length;r++){let t=e.runs[r];if(t){if(t.kind==="tab"||t.kind==="image"||t.kind==="lineBreak"){a.push(t);continue}if(t.kind==="text"){let o=t.text??"",s=r===n.fromRun,i=r===n.toRun;if(s||i){let l=s?n.fromChar:0,f=i?n.toChar:o.length,u=o.slice(l,f);u.length>0&&a.push({...t,text:u});}else a.push(t);}}}return a}function xe(e,n){let a,r,t=e.pmStart??0,o=0;for(let s=0;s<e.runs.length&&s<=n.toRun;s++){let i=e.runs[s];i&&(s<n.fromRun?i.kind==="text"?o+=(i.text??"").length:(i.kind==="tab"||i.kind==="lineBreak"||i.kind==="image")&&(o+=1):s===n.fromRun&&(o+=n.fromChar,a=t+o,i.kind==="text"&&(o=n.fromChar)));}if(a!==void 0){let s=0;for(let i=n.fromRun;i<=n.toRun&&i<e.runs.length;i++){let l=e.runs[i];if(l)if(l.kind==="text"){let f=l.text??"",u=i===n.fromRun?n.fromChar:0,c=i===n.toRun?n.toChar:f.length;s+=c-u;}else (l.kind==="tab"||l.kind==="lineBreak"||l.kind==="image")&&(s+=1);}r=a+s;}return {pmStart:a,pmEnd:r}}function $e(e,n,a,r){let t=0;for(let o=a;o<r&&o<e.lines.length;o++){let i=e.lines[o].lineHeight;if(n>=t&&n<t+i)return o;t+=i;}return r>a?Math.min(r-1,e.lines.length-1):null}function qe(e,n,a,r){let{pmStart:t,pmEnd:o}=xe(e,n);if(t===void 0||o===void 0)return {charOffset:0,pmPosition:e.pmStart??0};let s=e.attrs?.alignment??"left",i=0;s==="center"?i=Math.max(0,(r-n.width)/2):s==="right"&&(i=Math.max(0,r-n.width));let l=Math.max(0,a-i);if(l<=0)return {charOffset:0,pmPosition:t};let f=be(e,n);if(f.length===0)return {charOffset:0,pmPosition:t};let u=0,c=0;for(let g of f){if(g.kind==="tab"){let x=g.width??48,d=u+x;if(l<=d){let h=u+x/2;return l<h?{charOffset:c,pmPosition:t+c}:{charOffset:c+1,pmPosition:t+c+1}}u=d,c+=1;continue}if(g.kind==="image"){let x=g.width,d=u+x;if(l<=d){let h=u+x/2;return l<h?{charOffset:c,pmPosition:t+c}:{charOffset:c+1,pmPosition:t+c+1}}u=d,c+=1;continue}if(g.kind==="lineBreak"){if(l>=u)return {charOffset:c,pmPosition:t+c};c+=1;continue}if(g.kind==="text"){let x=g.text??"";if(x.length===0)continue;let d=ne(g),h=chunkRSU4HTC6_js.k(x,d),p=u+h.width;if(l<=p){let b=l-u,T=chunkRSU4HTC6_js.l(b,h.charWidths),H=c+T;return {charOffset:H,pmPosition:t+H}}u=p,c+=x.length;}}return {charOffset:o-t,pmPosition:o}}function oe(e){let{fragment:n,block:a,measure:r,localX:t,localY:o}=e;if(n.kind!=="paragraph"||a.kind!=="paragraph"||r.kind!=="paragraph")return null;let s=n,i=a,l=r,f=$e(l,o,s.fromLine,s.toLine);if(f===null)return null;let u=l.lines[f];if(!u)return null;let c=0;for(let T=s.fromLine;T<f;T++)c+=l.lines[T]?.lineHeight??0;let m=i.attrs?.indent,g=m?.left??0,x=m?.right??0,d=Math.max(0,n.width-g-x),h=t-g,{charOffset:p,pmPosition:b}=qe(i,u,h,d);return {pmPosition:b,charOffset:p,lineIndex:f}}function ke(e){let{cellBlock:n,cellMeasure:a,cellLocalX:r,cellLocalY:t}=e;if(!n||!a)return null;let o={fragment:{kind:"paragraph",blockId:n.id,x:0,y:0,width:a.lines.reduce((i,l)=>Math.max(i,l.width),100),fromLine:0,toLine:a.lines.length,height:a.totalHeight},block:n,measure:a,pageIndex:e.pageIndex,localX:r,localY:t};return oe(o)?.pmPosition??null}function je(e,n){if(n)return ke(n);if(!e)return null;let{fragment:a}=e;return a.kind==="paragraph"?oe(e)?.pmPosition??null:a.kind==="image"?a.pmStart??null:null}function Te(e,n,a,r){let t=e.pmStart??0,o=e.pmEnd??t;if(a<t||a>o)return null;let s=a-t;for(let i=0;i<n.lines.length;i++){let l=n.lines[i],{pmStart:f,pmEnd:u}=xe(e,l);if(f===void 0||u===void 0)continue;let c=f-t,m=u-t;if(s>=c&&s<=m){let g=s-c,x=be(e,l),d=0,h=0;for(let p of x)if(p.kind==="tab"){if(g<=h+1)return g<=h?{x:d,lineIndex:i}:{x:d+(p.width??48),lineIndex:i};d+=p.width??48,h+=1;}else if(p.kind==="image"){if(g<=h+1)return g<=h?{x:d,lineIndex:i}:{x:d+p.width,lineIndex:i};d+=p.width,h+=1;}else if(p.kind==="lineBreak"){if(g<=h)return {x:d,lineIndex:i};h+=1;}else if(p.kind==="text"){let b=p.text??"";if(g<=h+b.length){let F=g-h,k=ne(p),P=chunkRSU4HTC6_js.k(b.slice(0,F),k);return {x:d+P.width,lineIndex:i}}let T=ne(p),H=chunkRSU4HTC6_js.k(b,T);d+=H.width,h+=b.length;}return {x:d,lineIndex:i}}}return null}function Je(e,n,a,r,t,o,s){let i=Te(e,n,a);if(!i)return null;let l=e.attrs?.alignment??"left",f=e.attrs?.indent,u=f?.left??0,c=f?.right??0,m=Math.max(0,o-u-c),g=n.lines[i.lineIndex];if(!g)return null;let x=0;l==="center"?x=Math.max(0,(m-g.width)/2):l==="right"&&(x=Math.max(0,m-g.width));let d=0;for(let h=s;h<i.lineIndex;h++)d+=n.lines[h]?.lineHeight??0;return {x:r+u+x+i.x,y:t+d,height:g.lineHeight}}function Ke(e,n,a={}){let r=a.scope??"body",t=r==="body"?"layout-page-content":`layout-page-${r}`,o=`.${t} .layout-table-cell`,s=e.querySelectorAll(`.${t} .layout-table-cell-selected`);for(let c of Array.from(s))c.classList.remove("layout-table-cell-selected");let i=n.selection;if(!("$anchorCell"in i&&typeof i.forEachCell=="function")||!i.forEachCell)return;let f=[];i.forEachCell((c,m)=>{f.push([m,m+c.nodeSize]);});let u=e.querySelectorAll(o);for(let c of Array.from(u)){let m=c,g=m.dataset.pmStart;if(g===void 0)continue;let x=Number(g);for(let[d,h]of f)if(x>=d&&x<h){m.classList.add("layout-table-cell-selected");break}}}function Me(e){return {fontFamily:e.fontFamily??"Arial",fontSize:e.fontSize??12,bold:e.bold,italic:e.italic,letterSpacing:e.letterSpacing}}function re(e,n){return e.findIndex(a=>a.id===n)}function V(e,n){let r=(e.pmStart??0)+1,t=0,o;for(let l=0;l<e.runs.length&&l<=n.toRun;l++){let f=e.runs[l];if(f){if(l<n.fromRun)f.kind==="text"?t+=(f.text??"").length:t+=1;else if(l===n.fromRun){t+=n.fromChar,o=r+t;break}}}o===void 0&&(o=r);let s=0;for(let l=n.fromRun;l<=n.toRun&&l<e.runs.length;l++){let f=e.runs[l];if(f)if(f.kind==="text"){let u=f.text??"",c=l===n.fromRun?n.fromChar:0,m=l===n.toRun?n.toChar:u.length;s+=m-c;}else s+=1;}let i=o+s;return {pmStart:o,pmEnd:i}}function Fe(e,n,a,r){let t=[];for(let o=0;o<n.lines.length;o++){let s=n.lines[o],i=V(e,s);i.pmStart===void 0||i.pmEnd===void 0||i.pmEnd>a&&i.pmStart<r&&t.push({line:s,index:o});}return t}function W(e,n,a){let r=V(e,n);return r.pmStart===void 0?0:Math.max(0,a-r.pmStart)}function G(e,n,a,r){let t=0,o=0;for(let s=n.fromRun;s<=n.toRun&&s<e.runs.length;s++){let i=e.runs[s];if(i){if(i.kind==="tab"){let l=i.width??48;if(o+1>=a)return a<=o?t:t+l;t+=l,o+=1;continue}if(i.kind==="image"){let l=i.width;if(o+1>=a)return a<=o?t:t+l;t+=l,o+=1;continue}if(i.kind==="lineBreak"){if(a<=o)return t;o+=1;continue}if(i.kind==="text"){let l=i.text??"",f=s===n.fromRun,u=s===n.toRun,c=f?n.fromChar:0,m=u?n.toChar:l.length,g=l.slice(c,m);if(o+g.length>=a){let h=a-o,p=Me(i),b=chunkRSU4HTC6_js.k(g.slice(0,h),p);return t+b.width}let x=Me(i),d=chunkRSU4HTC6_js.k(g,x);t+=d.width,o+=g.length;}}}return t}function J(e,n){let a=0;for(let r=0;r<n&&r<e.lines.length;r++)a+=e.lines[r].lineHeight;return a}function Qe(e,n,a,r,t){if(r===t)return [];let o=Math.min(r,t),s=Math.max(r,t),i=[];for(let l=0;l<e.pages.length;l++){let f=e.pages[l],u=A(e,l);for(let c of f.fragments){if(c.kind==="paragraph"){let m=re(n,c.blockId);if(m===-1)continue;let g=n[m],x=a[m];if(!g||g.kind!=="paragraph"||!x||x.kind!=="paragraph")continue;let d=g,h=x,p=c,b=Fe(d,h,o,s);for(let{line:T,index:H}of b){if(H<p.fromLine||H>=p.toLine)continue;let F=V(d,T);if(F.pmStart===void 0||F.pmEnd===void 0)continue;let k=Math.max(F.pmStart,o),P=Math.min(F.pmEnd,s);if(k>=P)continue;let S=W(d,T,k),y=W(d,T,P),B=d.attrs?.indent,R=B?.left??0,_=B?.right??0,I=Math.max(0,c.width-R-_),E=G(d,T,S),C=G(d,T,y),M=d.attrs?.alignment??"left",w=0;M==="center"?w=Math.max(0,(I-T.width)/2):M==="right"&&(w=Math.max(0,I-T.width));let L=J(h,H)-J(h,p.fromLine),D=c.x+R+w+Math.min(E,C),Y=Math.max(1,Math.abs(C-E)),z=c.y+L;i.push({x:D,y:z+u,width:Y,height:T.lineHeight,pageIndex:l});}}if(c.kind==="table"){let m=re(n,c.blockId);if(m===-1)continue;let g=n[m],x=a[m];if(!g||g.kind!=="table"||!x||x.kind!=="table")continue;let d=g,h=x,p=c,b=[],T=0;for(let y=0;y<h.rows.length;y++)b.push(Math.round(T)),T+=h.rows[y]?.height??0;b.push(Math.round(T));let H=p.headerRowCount??0,F=H>0&&p.continuesFromPrev?chunkRSU4HTC6_js.V(h,H):0,k=(b[p.fromRow]??0)+(p.topClip??0),P=p.bottomClip!==void 0?Math.round(p.height):F+((b[p.toRow]??0)-k),S=y=>F+(y-k);for(let y=p.fromRow;y<p.toRow&&y<d.rows.length;y++){let B=d.rows[y],R=h.rows[y];if(!B||!R)continue;let _=b[y]??0,I=0;for(let E=0;E<B.cells.length;E++){let C=B.cells[E],M=R.cells[E];if(!C||!M)continue;let w=C.padding?.top??0,L=chunkRSU4HTC6_js.L(C.blocks,M.blocks,w);for(let D=0;D<C.blocks.length;D++){let Y=C.blocks[D],z=M.blocks[D];if(!Y||Y.kind!=="paragraph"||!z||z.kind!=="paragraph")continue;let X=Y,Ae=z,De=L.lineTops[D]??[],ve=Fe(X,Ae,o,s);for(let{line:v,index:Oe}of ve){let q=V(X,v);if(q.pmStart===void 0||q.pmEnd===void 0)continue;let ae=Math.max(q.pmStart,o),se=Math.min(q.pmEnd,s);if(ae>=se)continue;let Q=S(_+(De[Oe]??0));if(Q+v.lineHeight<=F||Q>=P)continue;let _e=W(X,v,ae),Xe=W(X,v,se),le=G(X,v,_e,M.width),ce=G(X,v,Xe,M.width);i.push({x:p.x+I+Math.min(le,ce),y:p.y+Q+u,width:Math.max(1,Math.abs(ce-le)),height:v.lineHeight,pageIndex:l});}}I+=M.width;}}}if(c.kind==="image"){let m=c.pmStart??0;(c.pmEnd??m+1)>o&&m<s&&i.push({x:c.x,y:c.y+u,width:c.width,height:c.height,pageIndex:l});}}}return i}function Ze(e,n,a,r){for(let t=0;t<e.pages.length;t++){let o=e.pages[t],s=A(e,t);for(let i of o.fragments){if(i.kind==="paragraph"){let l=re(n,i.blockId);if(l===-1)continue;let f=n[l],u=a[l];if(!f||f.kind!=="paragraph"||!u||u.kind!=="paragraph")continue;let c=f,m=u,g=i,x=c.pmStart??0,d=c.pmEnd??x;if(r<x||r>d)continue;for(let h=g.fromLine;h<g.toLine;h++){let p=m.lines[h];if(!p)continue;let b=V(c,p);if(!(b.pmStart===void 0||b.pmEnd===void 0)&&r>=b.pmStart&&r<=b.pmEnd){let T=W(c,p,r),H=c.attrs?.indent,F=H?.left??0,k=H?.right??0,P=Math.max(0,i.width-F-k),S=G(c,p,T),y=c.attrs?.alignment??"left",B=0;y==="center"?B=Math.max(0,(P-p.width)/2):y==="right"&&(B=Math.max(0,P-p.width));let R=J(m,h)-J(m,g.fromLine);return {x:i.x+F+B+S,y:i.y+R+s,height:p.lineHeight,pageIndex:t}}}}if(i.kind==="image"){let l=i.pmStart??0,f=i.pmEnd??l+1;if(r>=l&&r<=f){let u=r===l?0:i.width;return {x:i.x+u,y:i.y+s,height:i.height,pageIndex:t}}}}}return null}function et(e){return e.length<=1?false:new Set(e.map(a=>a.pageIndex)).size>1}function tt(e){let n=new Map;for(let a of e){let r=n.get(a.pageIndex)??[];r.push(a),n.set(a.pageIndex,r);}return n}function nt(e){if(e.kind!=="paragraph")return false;let n=e.attrs;return n?!!(n.borders?.top||n.borders?.bottom||n.spacingExplicit?.before||n.spacingExplicit?.after):false}function ye(e){return He(e)}function He(e){let n=new Set;for(let a=1;a<e.length;a++){let r=e[a-1],t=e[a];r.kind==="table"&&t.kind==="paragraph"&&(t.runs.length>0||nt(t)||n.add(a));}return e.map((a,r)=>{if(a.kind==="table")return ot(a);if(a.kind!=="paragraph")return a;let t=n.has(r),o=a.attrs?.spacingExplicit,s=a.attrs?.spacing?.before!=null,i=a.attrs?.spacing?.after!=null,l=s&&!o?.before,f=i&&!o?.after,u=l||f;if(!u&&!t)return a;let c=a.attrs;return u&&c?.spacing&&(c={...c,spacing:{...c.spacing,before:o?.before?c.spacing.before:void 0,after:o?.after?c.spacing.after:void 0}}),t&&(c={...c??{},suppressEmptyParagraphHeight:true}),{...a,attrs:c}})}function ot(e){let n=false,a=e.rows.map(r=>{let t=false,o=r.cells.map(s=>{let i=He(s.blocks);return i.some((f,u)=>f!==s.blocks[u])?(t=true,{...s,blocks:i}):s});return t?(n=true,{...r,cells:o}):r});return n?{...e,rows:a}:e}function rt(e){return e?.align??e?.alignment}function we(e,n,a,r){let t=r.section==="header"?r.margins.header??48:r.pageSize.h-(r.margins.footer??48)-a,o=e.position?.vertical;if(!o)return n;let s=rt(o),i=o.posOffset!==void 0?chunk4Q2IP5FW_js.e(o.posOffset):void 0;if(o.relativeTo==="page"){if(i!==void 0)return i-t;if(s==="top")return -t;if(s==="bottom")return r.pageSize.h-e.height-t;if(s==="center")return (r.pageSize.h-e.height)/2-t}if(o.relativeTo==="margin"){let l=r.margins.top,f=r.pageSize.h-r.margins.top-r.margins.bottom;if(i!==void 0)return l+i-t;if(s==="top")return l-t;if(s==="bottom")return l+f-e.height-t;if(s==="center")return l+(f-e.height)/2-t}return i!==void 0?n+i:n}function Pe(e){switch(e.kind){case "paragraph":case "table":return true;case "image":return !e.anchor?.isAnchored;case "textBox":return e.displayMode===void 0||e.displayMode==="inline";default:return false}}function it(e){return e?e.kind==="paragraph"||e.kind==="table"?e.totalHeight:e.kind==="image"||e.kind==="textBox"?e.height:0:0}function Se(e,n,a,r){let t=0,o=0,s=0;for(let i=0;i<e.length;i++){let l=e[i],f=n[i];if(!(!l||!f)){if(l.kind==="paragraph"&&f.kind==="paragraph"){let u=s,c=u+f.totalHeight;t=Math.min(t,u),o=Math.max(o,c);for(let m of l.runs){if(m.kind!=="image"||!m.position)continue;let g=we(m,u,a,r);t=Math.min(t,g),o=Math.max(o,g+m.height);}s=c;}else if(l.kind==="table"&&f.kind==="table"){let u=s+f.totalHeight;t=Math.min(t,s),o=Math.max(o,u),s=u;}else if(l.kind==="image"&&f.kind==="image"){let u=s+f.height;t=Math.min(t,s),o=Math.max(o,u),s=u;}else if(l.kind==="textBox"&&f.kind==="textBox"){let u=s+f.height;t=Math.min(t,s),o=Math.max(o,u),l.displayMode!=="float"&&(s=u);}}}return {visualTop:t,visualBottom:o}}function at(e,n,a,r){if(!e||!e.content||e.content.length===0)return;let t=chunkXLB6AC5Q_js.b(e.content,{styles:r.styles??void 0,theme:r.theme??null,defaultTabStopTwips:r.defaultTabStopTwips??null});return Be(t,n,a,r)}function Be(e,n,a,r){let t=chunkYPQACU4A_js.c(e,{theme:r.theme??void 0});if(t.length===0)return;let o=ye(t),s=r.measureBlocks(o,n),i=0,l=0;for(let c=0;c<o.length;c++){let m=it(s[c]);i+=m,Pe(o[c])&&(l+=m);}let{visualTop:f,visualBottom:u}=Se(o,s,i,a);return {blocks:o,measures:s,height:i,flowHeight:l,visualTop:f,visualBottom:u}}var K={header:null,footer:null};function st(){K.header=null,K.footer=null;}function Re(e,n){let a=n.querySelectorAll(`.layout-page-${e}`);if(a.length===0)return null;let r=n.defaultView,t=r?r.innerHeight/2:0,o=a[0],s=1/0;for(let c of Array.from(a)){let m=c.getBoundingClientRect(),g=Math.abs((m.top+m.bottom)/2-t);g<s&&(s=g,o=c);}let i=K[e];if(i&&i.host===o&&i.host.isConnected)return i;let l=Array.from(o.querySelectorAll("span[data-pm-start][data-pm-end]")),f=Array.from(o.querySelectorAll("[data-pm-start][data-pm-end]")),u={host:o,spans:l,ranged:f};return K[e]=u,u}function lt(e,n,a=globalThis.document){let r=e.state.selection;if(!r.empty)return null;let t=r.head,o=Re(n,a);if(!o)return null;let{host:s,spans:i}=o;for(let d of i){let h=Number(d.dataset.pmStart),p=Number(d.dataset.pmEnd);if(!(!Number.isFinite(h)||!Number.isFinite(p))&&t>=h&&t<=p){let b=s.ownerDocument.createRange(),T=s.ownerDocument.createTreeWalker(d,NodeFilter.SHOW_TEXT),H=t-h,F=T.nextNode();for(;F;){let S=F.data.length;if(H<=S){try{b.setStart(F,H),b.setEnd(F,H);let y=b.getClientRects()[0]??b.getBoundingClientRect();if(y&&y.height>0)return {top:y.top,left:y.left,height:y.height}}catch{}break}H-=S,F=T.nextNode();}let k=d.getBoundingClientRect(),P=(t-h)/Math.max(1,p-h);return {top:k.top,left:k.left+k.width*P,height:k.height}}}let l=s.querySelector(`[data-pm-start="${t}"]`);if(l){let d=l.getBoundingClientRect();return {top:d.top,left:d.left+1,height:d.height||16}}let f=o.ranged,u=null,c=1/0;for(let d of f){let h=Number(d.dataset.pmStart),p=Number(d.dataset.pmEnd);if(!Number.isFinite(h)||!Number.isFinite(p)||t<h||t>p)continue;let b=p-h;b<c&&(c=b,u=d);}if(u){let d=u.getBoundingClientRect(),h=Number(u.dataset.pmEnd),p=t>=h;return {top:d.top,left:p?d.right:d.left+1,height:d.height||16}}let m=null,g=-1/0;for(let d of f){let h=Number(d.dataset.pmStart);Number.isFinite(h)&&(h>t||h>g&&(g=h,m=d));}if(m){let d=m.getBoundingClientRect();return {top:d.top,left:d.right,height:d.height||16}}let x=s.getBoundingClientRect();return {top:x.top+2,left:x.left+2,height:16}}function ct(e,n,a=globalThis.document){let r=e.state.selection;if(r.empty)return [];let t=r.from,o=r.to,s=[],i=Re(n,a);if(!i)return s;let{host:l,spans:f}=i;for(let u of f){let c=Number(u.dataset.pmStart),m=Number(u.dataset.pmEnd);if(!Number.isFinite(c)||!Number.isFinite(m)||m<=t||c>=o)continue;if(u.classList.contains("layout-run-tab")){let p=u.getBoundingClientRect();s.push({top:p.top,left:p.left,width:p.width,height:p.height});continue}let g=null;if(u.firstChild?.nodeType===Node.TEXT_NODE?g=u.firstChild:u.firstChild?.nodeType===Node.ELEMENT_NODE&&u.firstChild.tagName==="A"&&u.firstChild.firstChild?.nodeType===Node.TEXT_NODE&&(g=u.firstChild.firstChild),!g)continue;let x=Math.max(0,t-c),d=Math.min(g.length,o-c);if(x>=d)continue;let h=l.ownerDocument.createRange();h.setStart(g,x),h.setEnd(g,d);for(let p of Array.from(h.getClientRects()))s.push({top:p.top,left:p.left,width:p.width,height:p.height});}return s}function Ie(e){return e?e.flowHeight??e.height:0}function ut(e){let{pageSize:n,margins:a,finalMargins:r,bodyBlocks:t,headers:o,footers:s,warn:i}=e,l=a.header??48,f=a.footer??48,u=a.top-l,c=a.bottom-f,m=Math.max(0,...(o??[]).map(Ie)),g=Math.max(0,...(s??[]).map(Ie)),x=m>u,d=g>c;if(!x&&!d)return {margins:a,finalMargins:r};let h=Math.max(0,n.h-24),p=false,b=F=>{let k={...F};return x&&(k.top=Math.max(F.top,l+m)),d&&(k.bottom=Math.max(F.bottom,f+g)),k.top+k.bottom>h&&(p=true,k.bottom=Math.max(0,Math.min(k.bottom,h-k.top)),k.top+k.bottom>h&&(k.top=Math.max(0,h-k.bottom))),k},T=b(a),H=b(r);if(t)for(let F of t){if(F.kind!=="sectionBreak")continue;let k=F;k.margins&&(k.margins=b(k.margins));}return p&&i&&i(`[layout] header/footer content exceeds page height; clamping margins to preserve a content area. pageHeight=${Math.round(n.h)} headerBand=${Math.round(m)} footerBand=${Math.round(g)} top=${Math.round(T.top)} bottom=${Math.round(T.bottom)}`),{margins:T,finalMargins:H}}var Ce=816,Ee=1056,U=96,ie=48;function $(e){return Math.round(e/1440*96)}function N(e,n){return e!=null?$(e):n}function ft(e){return {w:e?.pageWidth?$(e.pageWidth):Ce,h:e?.pageHeight?$(e.pageHeight):Ee}}function dt(e){return {top:N(e?.marginTop,U),right:N(e?.marginRight,U),bottom:N(e?.marginBottom,U),left:N(e?.marginLeft,U),header:N(e?.headerDistance,ie),footer:N(e?.footerDistance,ie)}}function ht(e,n){let a={header:null,footer:null,firstHeader:null,firstFooter:null};if(!e?.package)return a;let r=e.package.headers,t=e.package.footers,o=null,s=null,i=null,l=null;if(r&&n?.headerReferences){let f=n.headerReferences.find(c=>c.type==="default");f?.rId&&(o=r.get(f.rId)??null);let u=n.headerReferences.find(c=>c.type==="first");u?.rId&&(i=r.get(u.rId)??null);}if(t&&n?.footerReferences){let f=n.footerReferences.find(c=>c.type==="default");f?.rId&&(s=t.get(f.rId)??null);let u=n.footerReferences.find(c=>c.type==="first");u?.rId&&(l=t.get(u.rId)??null);}return n?.titlePg||(!o&&i&&(o=i),!s&&l&&(s=l)),{header:o,footer:s,firstHeader:i,firstFooter:l}}function mt(e){let n=e?.columnCount??1;if(n<=1)return;let a=$(e?.columnSpace??720);return {count:n,gap:a,equalWidth:e?.equalWidth??true,separator:e?.separator}}function Le(e){let n=e.pageSize.w-e.margins.left-e.margins.right,a=e.columns;return !a||a.count<=1?n:Math.floor((n-(a.count-1)*a.gap)/a.count)}function gt(e,n,a){let{configs:r,breakIndices:t}=chunkRSU4HTC6_js.T(e,n,a),o=0,s=[];for(let i=0;i<e.length;i++)s.push(Le(r[o]??n)),o<t.length&&i===t[o]&&o++;return s}exports.A=st;exports.B=lt;exports.C=ct;exports.D=ut;exports.E=Ce;exports.F=Ee;exports.G=U;exports.H=ie;exports.I=$;exports.J=ft;exports.K=dt;exports.L=ht;exports.M=mt;exports.N=Le;exports.O=gt;exports.a=ee;exports.b=A;exports.c=Ne;exports.d=ge;exports.e=ze;exports.f=pe;exports.g=We;exports.h=Ge;exports.i=Ve;exports.j=Ue;exports.k=oe;exports.l=ke;exports.m=je;exports.n=Te;exports.o=Je;exports.p=Ke;exports.q=Qe;exports.r=Ze;exports.s=et;exports.t=tt;exports.u=ye;exports.v=we;exports.w=Pe;exports.x=Se;exports.y=at;exports.z=Be;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {r,q}from'./chunk-CRMZH7U7.mjs';var t=new r(q());t.buildSchema();t.initializeRuntime();var s=t,n=t.getSchema();export{s as a,n as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkC45EFOVP_js=require('./chunk-C45EFOVP.js'),chunkJFZIXFRC_js=require('./chunk-JFZIXFRC.js'),chunkRQVHKDXK_js=require('./chunk-RQVHKDXK.js'),chunkL5NPEM7C_js=require('./chunk-L5NPEM7C.js'),chunkLWH66Q7Q_js=require('./chunk-LWH66Q7Q.js'),chunkMJ5FQX7Q_js=require('./chunk-MJ5FQX7Q.js'),chunk4Q2IP5FW_js=require('./chunk-4Q2IP5FW.js'),chunkGSKMHXHG_js=require('./chunk-GSKMHXHG.js');function we(e){if(!e||e.pattern&&e.pattern!=="clear")return;let n=e.fill?.rgb;if(!(!n||e.fill?.auto))return chunkMJ5FQX7Q_js.n(n)}function X(e){if(!e)return [];let n=[];e.bold&&n.push(chunkL5NPEM7C_js.b.mark("bold")),e.italic&&n.push(chunkL5NPEM7C_js.b.mark("italic")),e.underline&&e.underline.style!=="none"&&n.push(chunkL5NPEM7C_js.b.mark("underline",{style:e.underline.style,color:e.underline.color})),(e.strike||e.doubleStrike)&&n.push(chunkL5NPEM7C_js.b.mark("strike",{double:e.doubleStrike||false})),e.color&&!e.color.auto&&n.push(chunkL5NPEM7C_js.b.mark("textColor",{rgb:e.color.rgb,themeColor:e.color.themeColor,themeTint:e.color.themeTint,themeShade:e.color.themeShade}));let o=e.highlight&&e.highlight!=="none"?e.highlight:we(e.shading);return o&&n.push(chunkL5NPEM7C_js.b.mark("highlight",{color:o})),e.fontSize&&n.push(chunkL5NPEM7C_js.b.mark("fontSize",{size:e.fontSize})),e.fontFamily&&n.push(chunkL5NPEM7C_js.b.mark("fontFamily",{ascii:e.fontFamily.ascii,hAnsi:e.fontFamily.hAnsi,eastAsia:e.fontFamily.eastAsia,cs:e.fontFamily.cs,asciiTheme:e.fontFamily.asciiTheme,hAnsiTheme:e.fontFamily.hAnsiTheme,eastAsiaTheme:e.fontFamily.eastAsiaTheme,csTheme:e.fontFamily.csTheme})),e.vertAlign==="superscript"?n.push(chunkL5NPEM7C_js.b.mark("superscript")):e.vertAlign==="subscript"&&n.push(chunkL5NPEM7C_js.b.mark("subscript")),e.allCaps&&n.push(chunkL5NPEM7C_js.b.mark("allCaps")),e.smallCaps&&n.push(chunkL5NPEM7C_js.b.mark("smallCaps")),(e.spacing!=null||e.position!=null||e.scale!=null||e.kerning!=null)&&n.push(chunkL5NPEM7C_js.b.mark("characterSpacing",{spacing:e.spacing??null,position:e.position??null,scale:e.scale??null,kerning:e.kerning??null})),e.emboss&&n.push(chunkL5NPEM7C_js.b.mark("emboss")),e.imprint&&n.push(chunkL5NPEM7C_js.b.mark("imprint")),e.shadow&&n.push(chunkL5NPEM7C_js.b.mark("textShadow")),e.emphasisMark&&e.emphasisMark!=="none"&&n.push(chunkL5NPEM7C_js.b.mark("emphasisMark",{type:e.emphasisMark})),e.outline&&n.push(chunkL5NPEM7C_js.b.mark("textOutline")),e.hidden&&n.push(chunkL5NPEM7C_js.b.mark("hidden")),e.rtl&&n.push(chunkL5NPEM7C_js.b.mark("rtl")),e.effect&&e.effect!=="none"&&n.push(chunkL5NPEM7C_js.b.mark("textEffect",{effect:e.effect})),n}function E(e,n){if(!e)return;if(!n)return e;let o=n.resolveRunStyle(e.styleId);return o?chunkGSKMHXHG_js.b(o,e):e}function ee(e,n){let o="",l,t=e.type==="simpleField"?e.content:e.fieldResult;if(t){for(let s of t)if(s.type==="run"){for(let u of s.content)u.type==="text"&&(o+=u.text);!l&&s.formatting&&(l=s.formatting);}}let r=chunkGSKMHXHG_js.b(n,l),i=X(r);return chunkL5NPEM7C_js.b.node("field",{fieldType:e.fieldType,instruction:e.instruction,displayText:o,fieldKind:e.type==="simpleField"?"simple":"complex",fldLock:e.fldLock??false,dirty:e.dirty??false},void 0,i)}function te(e){return chunkL5NPEM7C_js.b.node("math",{display:e.display,ommlXml:e.ommlXml,plainText:e.plainText||""})}function K(e,n,o){let l=[],t=e.formatting?.styleId?o?.getRunStyleOwnProperties(e.formatting.styleId):void 0,r=chunkGSKMHXHG_js.b(chunkGSKMHXHG_js.b(n,t),e.formatting),i=X(r);for(let s of e.content){let u=pe(s,i);l.push(...u);}return l}function pe(e,n){switch(e.type){case "text":return e.text?[chunkL5NPEM7C_js.b.text(e.text,n)]:[];case "break":return e.breakType==="textWrapping"||!e.breakType?[chunkL5NPEM7C_js.b.node("hardBreak",null,void 0,n)]:[];case "tab":return [chunkL5NPEM7C_js.b.node("tab",null,void 0,n)];case "drawing":return e.image?[xe(e.image)]:[];case "shape":{let t=e.shape;return t.textBody&&t.textBody.content.length>0?[]:[ke(t)]}case "footnoteRef":let o=chunkL5NPEM7C_js.b.mark("footnoteRef",{id:e.id.toString(),noteType:"footnote"});return [chunkL5NPEM7C_js.b.text(e.id.toString(),[...n,o])];case "endnoteRef":let l=chunkL5NPEM7C_js.b.mark("footnoteRef",{id:e.id.toString(),noteType:"endnote"});return [chunkL5NPEM7C_js.b.text(e.id.toString(),[...n,l])];default:return []}}function xe(e){let n=e.size?.width?chunk4Q2IP5FW_js.e(e.size.width):void 0,o=e.size?.height?chunk4Q2IP5FW_js.e(e.size.height):void 0,l=e.wrap.type,t=e.wrap.wrapText,r=e.position?.horizontal?.alignment,i;l==="inline"||l==="topAndBottom"?i="none":l==="square"||l==="tight"||l==="through"?t==="left"?i="right":t==="right"||r==="left"?i="left":r==="right"?i="right":i="none":i="none";let s="inline";l==="inline"?s="inline":l==="topAndBottom"?s="block":chunkJFZIXFRC_js.b(l)||i&&i!=="none"?s="float":s="block";let u;if(e.transform){let P=[];e.transform.rotation&&P.push(`rotate(${e.transform.rotation}deg)`),e.transform.flipH&&P.push("scaleX(-1)"),e.transform.flipV&&P.push("scaleY(-1)"),P.length>0&&(u=P.join(" "));}let c=e.wrap.distT!=null?chunk4Q2IP5FW_js.e(e.wrap.distT):void 0,f=e.wrap.distB!=null?chunk4Q2IP5FW_js.e(e.wrap.distB):void 0,d=e.wrap.distL!=null?chunk4Q2IP5FW_js.e(e.wrap.distL):void 0,m=e.wrap.distR!=null?chunk4Q2IP5FW_js.e(e.wrap.distR):void 0,p;e.position&&(p={horizontal:e.position.horizontal?{relativeTo:e.position.horizontal.relativeTo,posOffset:e.position.horizontal.posOffset,align:e.position.horizontal.alignment}:void 0,vertical:e.position.vertical?{relativeTo:e.position.vertical.relativeTo,posOffset:e.position.vertical.posOffset,align:e.position.vertical.alignment}:void 0});let S,w,M;if(e.outline&&e.outline.width){S=Math.round(e.outline.width/914400*96*100)/100,e.outline.color?.rgb&&(w=`#${e.outline.color.rgb}`);let P={solid:"solid",dot:"dotted",dash:"dashed",lgDash:"dashed",dashDot:"dashed",lgDashDot:"dashed",lgDashDotDot:"dashed",sysDot:"dotted",sysDash:"dashed",sysDashDot:"dashed",sysDashDotDot:"dashed"};M=e.outline.style&&P[e.outline.style]||"solid";}let z=e.padding?.top?chunk4Q2IP5FW_js.e(e.padding.top):void 0,I=e.padding?.bottom?chunk4Q2IP5FW_js.e(e.padding.bottom):void 0,B=e.padding?.left?chunk4Q2IP5FW_js.e(e.padding.left):void 0,g=e.padding?.right?chunk4Q2IP5FW_js.e(e.padding.right):void 0;return chunkL5NPEM7C_js.b.node("image",{src:e.src||"",alt:e.alt,title:e.title,width:n,height:o,rId:e.rId,wrapType:l,displayMode:s,cssFloat:i,transform:u,distTop:c,distBottom:f,distLeft:d,distRight:m,position:p,borderWidth:S,borderColor:w,borderStyle:M,wrapText:t,hlinkHref:e.hlinkHref,cropTop:e.crop?.top,cropRight:e.crop?.right,cropBottom:e.crop?.bottom,cropLeft:e.crop?.left,opacity:e.opacity,effectExtentTop:z,effectExtentBottom:I,effectExtentLeft:B,effectExtentRight:g,layoutInCell:e.layoutInCell,allowOverlap:e.allowOverlap})}function Y(e,n,o){let l=[],t=e.href||(e.anchor?`#${e.anchor}`:""),r=chunkL5NPEM7C_js.b.mark("hyperlink",{href:t,tooltip:e.tooltip,rId:e.rId});for(let i of e.children)if(i.type==="run"){let s=i.formatting?.styleId?o?.getRunStyleOwnProperties(i.formatting.styleId):void 0,u=chunkGSKMHXHG_js.b(chunkGSKMHXHG_js.b(n,s),i.formatting),f=[...X(u),r];for(let d of i.content)l.push(...pe(d,f));}return l}function ke(e){let n=e.size?.width?chunk4Q2IP5FW_js.e(e.size.width):100,o=e.size?.height?chunk4Q2IP5FW_js.e(e.size.height):80,l,t="solid",r,i,s;if(e.fill&&(t=e.fill.type,e.fill.color?.rgb&&(l=`#${e.fill.color.rgb}`),e.fill.type==="gradient"&&e.fill.gradient)){let m=e.fill.gradient;r=m.type,i=m.angle,s=JSON.stringify(m.stops.map(p=>({position:p.position,color:p.color.rgb?`#${p.color.rgb}`:"#000000"})));}let u,c,f;e.outline&&(e.outline.width&&(u=Math.round(e.outline.width/914400*96*100)/100),e.outline.color?.rgb&&(c=`#${e.outline.color.rgb}`),f=e.outline.style||"solid");let d;if(e.transform){let m=[];e.transform.rotation&&m.push(`rotate(${e.transform.rotation}deg)`),e.transform.flipH&&m.push("scaleX(-1)"),e.transform.flipV&&m.push("scaleY(-1)"),m.length>0&&(d=m.join(" "));}return chunkL5NPEM7C_js.b.node("shape",{shapeType:e.shapeType||"rect",shapeId:e.id,width:n,height:o,fillColor:l,fillType:t,gradientType:r,gradientAngle:i,gradientStops:s,outlineWidth:u,outlineColor:c,outlineStyle:f,transform:d})}function V(e,n,o,l){let t=Fe(e,n),r=[],i,s=new Set,u;n&&(u=n.resolveParagraphStyle(e.formatting?.styleId).runFormatting);let c=chunkGSKMHXHG_js.b(u,l);for(let f of e.content){if(f.type==="commentRangeStart")s.add(f.id);else if(f.type==="commentRangeEnd")s.delete(f.id);else if(f.type==="run"){let d=K(f,c,n);s.size>0&&(d=O(d,s)),r.push(...d);}else if(f.type==="hyperlink"){let d=Y(f,c,n);r.push(...d);}else if(f.type==="simpleField"||f.type==="complexField"){let d=ee(f,c);d&&r.push(d);}else if(f.type==="inlineSdt"){let d=me(f,c,n);d&&r.push(d);}else if(f.type==="insertion"){let d=J(f,"insertion",c,n);s.size>0&&(d=O(d,s)),r.push(...d);}else if(f.type==="deletion"){let d=J(f,"deletion",c,n);s.size>0&&(d=O(d,s)),r.push(...d);}else if(f.type==="moveFrom"){let d=J(f,"deletion",c,n,true);s.size>0&&(d=O(d,s)),r.push(...d);}else if(f.type==="moveTo"){let d=J(f,"insertion",c,n,true);s.size>0&&(d=O(d,s)),r.push(...d);}else if(f.type==="mathEquation"){let d=te(f);d&&r.push(d);}f.type==="bookmarkStart"&&(i||(i=[]),i.push({id:f.id,name:f.name}));}return i&&(t.bookmarks=i),chunkL5NPEM7C_js.b.node("paragraph",t,r)}function O(e,n){if(n.size===0)return e;let o=[...n][0],l=chunkL5NPEM7C_js.b.marks.comment.create({commentId:o});return e.map(t=>t.isText?t.mark(l.addToSet(t.marks)):t)}function J(e,n,o,l,t=false){let r=[];for(let s of e.content)s.type==="run"?r.push(...K(s,o,l)):s.type==="hyperlink"&&r.push(...Y(s,o,l));let i=chunkL5NPEM7C_js.b.marks[n].create({revisionId:e.info.id,author:e.info.author,date:e.info.date??null,isMovePair:t});return r.map(s=>s.isText||s.type.allowsMarkType(i.type)?s.mark(i.addToSet(s.marks)):s)}function Fe(e,n){let o=e.formatting,l=o?.styleId,t={paraId:e.paraId??void 0,textId:e.textId??void 0,styleId:l,numPr:o?.numPr,listNumFmt:e.listRendering?.numFmt,listIsBullet:e.listRendering?.isBullet,listMarker:e.listRendering?.marker,listMarkerHidden:e.listRendering?.markerHidden||void 0,listMarkerFontFamily:e.listRendering?.markerFontFamily||void 0,listMarkerFontSize:e.listRendering?.markerFontSize||void 0,listMarkerSuffix:e.listRendering?.markerSuffix||void 0,listLevelNumFmts:e.listRendering?.levelNumFmts||void 0,listAbstractNumId:e.listRendering?.abstractNumId,listStartOverride:e.listRendering?.startOverride,_originalFormatting:o||void 0};if(n){let r=n.resolveParagraphStyle(l),i=r.paragraphFormatting,s=r.runFormatting;t.alignment=o?.alignment??i?.alignment,t.spaceBefore=o?.spaceBefore??i?.spaceBefore,t.spaceAfter=o?.spaceAfter??i?.spaceAfter,t.lineSpacing=o?.lineSpacing??i?.lineSpacing,t.lineSpacingRule=o?.lineSpacingRule??i?.lineSpacingRule,o?.spacingExplicit&&(t.spacingExplicit=o.spacingExplicit),t.indentLeft=o?.indentLeft??i?.indentLeft,t.indentRight=o?.indentRight??i?.indentRight,t.indentFirstLine=o?.indentFirstLine??i?.indentFirstLine,t.hangingIndent=o?.hangingIndent??i?.hangingIndent,t.borders=o?.borders??i?.borders,t.shading=o?.shading??i?.shading,t.tabs=o?.tabs??i?.tabs,t.pageBreakBefore=o?.pageBreakBefore??i?.pageBreakBefore,t.keepNext=o?.keepNext??i?.keepNext,t.keepLines=o?.keepLines??i?.keepLines,t.contextualSpacing=o?.contextualSpacing??i?.contextualSpacing,t.outlineLevel=o?.outlineLevel??i?.outlineLevel,t.bidi=o?.bidi??i?.bidi;let u=n.getDefaultCharacterStyle()?.rPr,c=u?chunkGSKMHXHG_js.b(s,u):s,f=E(o?.runProperties,n);t.defaultTextFormatting=chunkGSKMHXHG_js.b(c,f),!o?.numPr&&i?.numPr&&i.numPr.numId!==0&&(t.numPr=i.numPr);}else t.alignment=o?.alignment,t.spaceBefore=o?.spaceBefore,t.spaceAfter=o?.spaceAfter,t.lineSpacing=o?.lineSpacing,t.lineSpacingRule=o?.lineSpacingRule,o?.spacingExplicit&&(t.spacingExplicit=o.spacingExplicit),t.indentLeft=o?.indentLeft,t.indentRight=o?.indentRight,t.indentFirstLine=o?.indentFirstLine,t.hangingIndent=o?.hangingIndent,t.borders=o?.borders,t.shading=o?.shading,t.tabs=o?.tabs,t.pageBreakBefore=o?.pageBreakBefore,t.keepNext=o?.keepNext,t.keepLines=o?.keepLines,t.outlineLevel=o?.outlineLevel,t.bidi=o?.bidi,t.defaultTextFormatting=E(o?.runProperties,n);if(e.sectionProperties){t._sectionProperties=e.sectionProperties;let r=e.sectionProperties.sectionStart;(r==="nextPage"||r==="continuous"||r==="oddPage"||r==="evenPage")&&(t.sectionBreakType=r);}return e.renderedPageBreakBefore&&(t.renderedPageBreakBefore=true),e.pPrIns&&(t.pPrIns={revisionId:e.pPrIns.id,author:e.pPrIns.author,date:e.pPrIns.date??null}),e.pPrDel&&(t.pPrDel={revisionId:e.pPrDel.id,author:e.pPrDel.author,date:e.pPrDel.date??null}),e.propertyChanges&&e.propertyChanges.length>0&&(t.pPrChange=e.propertyChanges),t}function me(e,n,o){let l=e.properties,t=[];for(let r of e.content)if(r.type==="run"){let i=K(r,n,o);t.push(...i);}else if(r.type==="hyperlink"){let i=Y(r,n,o);t.push(...i);}else if(r.type==="simpleField"||r.type==="complexField"){let i=ee(r,n);i&&t.push(i);}else if(r.type==="inlineSdt"){let i=me(r,n,o);i&&t.push(i);}else if(r.type==="mathEquation"){let i=te(r);i&&t.push(i);}return chunkL5NPEM7C_js.b.node("sdt",chunkC45EFOVP_js.a(l),t.length>0?t:void 0)}function ge(e){function n(l){return l.type==="break"&&l.breakType==="page"}function o(l){if(l.type==="run"){for(let t of l.content)if(n(t))return true;return false}if(l.type==="hyperlink"){for(let t of l.children)if(t.type==="run"&&o(t))return true;return false}if(l.type==="insertion"||l.type==="deletion"){let t=l;for(let r of t.content)if(o(r))return true;return false}return false}for(let l of e.content)if(o(l))return true;return false}function R(e,n,o){if(!e||!n)return;let l=e.getStyle(n);if(!l?.tblStylePr)return;let t=l.tblStylePr.find(u=>u.type===o);if(!t)return;let r=E(t.pPr?.runProperties,e),i=E(t.rPr,e),s=chunkGSKMHXHG_js.b(r,i);return {tcPr:t.tcPr,rPr:s}}function N(e,n){if(!e&&!n)return;if(!e)return n;if(!n)return e;let o={},l=e.tcPr,t=n.tcPr;if(l||t){let r={...l??{},...t??{}};(l?.borders||t?.borders)&&(r.borders={...l?.borders??{},...t?.borders??{}}),(l?.shading||t?.shading)&&(r.shading={...l?.shading??{},...t?.shading??{}}),(l?.margins||t?.margins)&&(r.margins={...l?.margins??{},...t?.margins??{}}),o.tcPr=r;}return o.rPr=chunkGSKMHXHG_js.b(e.rPr,n.rPr),o}function Se(e){let n=new Map,o=e.rows.length,l=new Map;for(let t=0;t<o;t++){let r=e.rows[t],i=0,s=r.cells.map(c=>{let f=c.formatting?.gridSpan??1,d=i;return i+=f,{colIndex:d,vMerge:c.formatting?.vMerge,key:`${t}-${d}`}});if(s.length>0&&s.every(({colIndex:c,vMerge:f})=>f==="continue"&&l.has(c))){for(let{colIndex:c,key:f}of s)l.delete(c),n.set(f,{rowSpan:1,skip:false});continue}for(let{colIndex:c,vMerge:f,key:d}of s){let m=c;if(f==="restart")l.set(m,t),n.set(d,{rowSpan:1,skip:false});else if(f==="continue"){let p=l.get(m);if(p!==void 0){let S=`${p}-${m}`,w=n.get(S);w&&w.rowSpan++,n.set(d,{rowSpan:1,skip:true});}else n.set(d,{rowSpan:1,skip:false});}else l.delete(m),n.set(d,{rowSpan:1,skip:false});}}return n}function ne(e,n,o){let l=Se(e),t=e.columnWidths,r=t?.reduce((P,x)=>P+x,0)??0,i=e.formatting?.styleId,s=e.formatting?.look,u=i?n?.getStyle(i):void 0,c=n?.getDefaultTableStyle(),f=e.formatting?.borders??u?.tblPr?.borders??c?.tblPr?.borders,d=e.formatting?.cellMargins??u?.tblPr?.cellMargins??c?.tblPr?.cellMargins??void 0,m=d?{top:d.top?.value,bottom:d.bottom?.value,left:d.left?.value,right:d.right?.value}:void 0,p={styleId:e.formatting?.styleId,width:e.formatting?.width?.value,widthType:e.formatting?.width?.type,justification:e.formatting?.justification,columnWidths:t,floating:e.formatting?.floating,cellMargins:m,look:e.formatting?.look,_originalFormatting:e.formatting||void 0};e.propertyChanges&&e.propertyChanges.length>0&&(p.tblPrChange=e.propertyChanges);let S={wholeTable:R(n,i,"wholeTable"),firstRow:R(n,i,"firstRow"),lastRow:R(n,i,"lastRow"),firstCol:R(n,i,"firstCol"),lastCol:R(n,i,"lastCol"),band1Horz:R(n,i,"band1Horz"),band2Horz:R(n,i,"band2Horz"),band1Vert:R(n,i,"band1Vert"),band2Vert:R(n,i,"band2Vert"),nwCell:R(n,i,"nwCell"),neCell:R(n,i,"neCell"),swCell:R(n,i,"swCell"),seCell:R(n,i,"seCell")},w=s?.noHBand!==true,M=s?.noVBand!==true,z=0,I=e.rows.length,B=t?.length??Math.max(0,...e.rows.map(P=>P.cells.reduce((x,F)=>x+(F.formatting?.gridSpan??1),0))),g=e.rows.map((P,x)=>{let F=x===0&&!!s?.firstRow,v=x===I-1&&!!s?.lastRow,h=w&&!F&&!v?z%2===0?S.band1Horz:S.band2Horz:void 0;return w&&!F&&!v&&z++,Re(P,n,F,t,r,S,h,M,s,f,x,I,B,l,m,o)});return chunkL5NPEM7C_js.b.node("table",p,g)}function Re(e,n,o,l,t,r,i,s,u,c,f,d,m,p,S,w){let M={height:e.formatting?.height?.value,heightRule:e.formatting?.heightRule,isHeader:!!e.formatting?.header,_originalFormatting:e.formatting||void 0};if(e.structuralChange){let C=e.structuralChange,D={revisionId:C.info.id,author:C.info.author,date:C.info.date??null};C.type==="tableRowInsertion"?M.trIns=D:C.type==="tableRowDeletion"&&(M.trDel=D);}e.propertyChanges&&e.propertyChanges.length>0&&(M.trPrChange=e.propertyChanges);let z=e.cells.length,I=f===0,B=f===(d??1)-1,g=e.formatting?.conditionalFormat,P=g?.firstRow??I,x=g?.lastRow??B,F=m??z,v=0,h=[];for(let C=0;C<e.cells.length;C++){let D=e.cells[C],H=D.formatting?.gridSpan??1,ye=`${f??0}-${v}`,re=p?.get(ye),Pe=re?.skip??false,Ce=re?.rowSpan??1,ie;if(l&&t&&t>0){let q=0;for(let A=0;A<H&&v+A<l.length;A++)q+=l[v+A];ie=Math.round(q/t*100);}if(v+=H,Pe)continue;let le=v-H===0,se=v===F,b=D.formatting?.conditionalFormat,G=b?.firstRow??P,Q=b?.lastRow??x,$=b?.firstColumn??le,W=b?.lastColumn??se,_;if(s){let q=u?.firstColumn?1:0,A=v-H-q;A>=0&&!(u?.lastColumn&&W)&&!(u?.firstColumn&&$)&&(_=A%2===0?r?.band1Vert:r?.band2Vert);}b?.oddVBand?_=r?.band1Vert:b?.evenVBand&&(_=r?.band2Vert);let L=i;g?.oddHBand?L=r?.band1Horz:g?.evenHBand&&(L=r?.band2Horz),b?.oddHBand?L=r?.band1Horz:b?.evenHBand&&(L=r?.band2Horz);let T=r?.wholeTable;T=N(T,L),T=N(T,_),G&&(u?.firstRow||g?.firstRow||b?.firstRow)&&(T=N(T,r?.firstRow)),Q&&(u?.lastRow||g?.lastRow||b?.lastRow)&&(T=N(T,r?.lastRow)),$&&(u?.firstColumn||g?.firstColumn||b?.firstColumn)&&(T=N(T,r?.firstCol)),W&&(u?.lastColumn||g?.lastColumn||b?.lastColumn)&&(T=N(T,r?.lastCol)),G&&$&&(u?.firstRow||g?.firstRow||b?.firstRow)&&(u?.firstColumn||g?.firstColumn||b?.firstColumn)&&(T=N(T,r?.nwCell)),G&&W&&(u?.firstRow||g?.firstRow||b?.firstRow)&&(u?.lastColumn||g?.lastColumn||b?.lastColumn)&&(T=N(T,r?.neCell)),Q&&$&&(u?.lastRow||g?.lastRow||b?.lastRow)&&(u?.firstColumn||g?.firstColumn||b?.firstColumn)&&(T=N(T,r?.swCell)),Q&&W&&(u?.lastRow||g?.lastRow||b?.lastRow)&&(u?.lastColumn||g?.lastColumn||b?.lastColumn)&&(T=N(T,r?.seCell)),h.push(he(D,n,o,ie,T,c,I,B,le,se,Ce,S,w));}if(h.length===0){let C=Math.max(F,1),D={formatting:C>1?{gridSpan:C}:void 0,content:[{type:"paragraph",content:[]}]},H=N(r?.wholeTable,i);h.push(he(D,n,o,t&&t>0?100:void 0,H,c,I,B,true,true,1,S,w));}return chunkL5NPEM7C_js.b.node("tableRow",M,h)}var Me=["top","bottom","left","right","insideH","insideV"];function ve(e,n){if(!e)return e;let o;for(let l of Me){let t=e[l];if(!t?.color?.themeColor||t.color.auto)continue;let r=chunkMJ5FQX7Q_js.b(t.color,n);r&&(o??(o={...e}),o[l]={...t,color:{rgb:r}});}return o??e}function he(e,n,o,l,t,r,i,s,u,c,f,d,m){let p=e.formatting,S=f??1,w=p?.width?.value,M=p?.width?.type;w===void 0&&l!==void 0&&(w=l,M="pct");let z=chunkMJ5FQX7Q_js.b(p?.shading?.fill??t?.tcPr?.shading?.fill,m),I=r?{top:i?r.top:r.insideH,bottom:s?r.bottom:r.insideH,left:u?r.left:r.insideV,right:c?r.right:r.insideV}:void 0,B=t?.tcPr?.borders,g=p?.borders,P=ve(I||B||g?{...I??{},...B??{},...g??{}}:void 0,m),x={colspan:p?.gridSpan??1,rowspan:S,width:w,widthType:M,verticalAlign:p?.verticalAlign,backgroundColor:z,textDirection:p?.textDirection,noWrap:p?.noWrap,borders:P,margins:p?.margins?{top:p.margins.top?.value,bottom:p.margins.bottom?.value,left:p.margins.left?.value,right:p.margins.right?.value}:t?.tcPr?.margins?{top:t.tcPr.margins.top?.value,bottom:t.tcPr.margins.bottom?.value,left:t.tcPr.margins.left?.value,right:t.tcPr.margins.right?.value}:d,_originalFormatting:p||void 0,_originalResolvedFill:z};if(e.structuralChange){let h=e.structuralChange,C={revisionId:h.info.id,author:h.info.author,date:h.info.date??null};h.type==="tableCellInsertion"?x.cellMarker={kind:"ins",info:C}:h.type==="tableCellDeletion"?x.cellMarker={kind:"del",info:C}:h.type==="tableCellMerge"&&(x.cellMarker={kind:"merge",info:C,vMerge:h.vMerge??"cont",...h.vMergeOrig?{vMergeOrig:h.vMergeOrig}:{}});}e.propertyChanges&&e.propertyChanges.length>0&&(x.tcPrChange=e.propertyChanges);let F=[];for(let h of e.content)h.type==="paragraph"?F.push(V(h,n,void 0,t?.rPr)):h.type==="table"&&F.push(ne(h,n));F.length===0&&F.push(chunkL5NPEM7C_js.b.node("paragraph",{},[]));let v=o?"tableHeader":"tableCell";return chunkL5NPEM7C_js.b.node(v,x,F)}function be(e,n){let o=Ne(e),l=V(e,n),t=[],r=o.length>0&&l.content.size===0,{anchored:i,inFlow:s}=Ie(o);for(let u of i)t.push(Te(u,n));r||t.push(l);for(let u of s)t.push(Te(u,n));return t}function Ie(e){let n=[],o=[];for(let l of e)chunkC45EFOVP_js.c(l)?n.push(l):o.push(l);return {anchored:n,inFlow:o}}function Ne(e){let n=[];for(let o of e.content)if(o.type==="run"){for(let l of o.content)if(l.type==="shape"&&"shape"in l){let t=l.shape;t.textBody&&t.textBody.content.length>0&&n.push({type:"textBox",id:t.id,size:t.size,position:t.position,wrap:t.wrap,fill:t.fill,outline:t.outline,content:t.textBody.content,margins:t.textBody.margins});}}return n}function Te(e,n){let o=e.size?.width?chunk4Q2IP5FW_js.e(e.size.width):200,l=e.size?.height?chunk4Q2IP5FW_js.e(e.size.height):void 0,t;e.fill?.color?.rgb&&(t=`#${e.fill.color.rgb}`);let r,i,s;e.outline&&e.outline.width&&(r=Math.round(e.outline.width/914400*96*100)/100,e.outline.color?.rgb&&(i=`#${e.outline.color.rgb}`),s=e.outline.style||"solid");let u=e.margins?.top!=null?chunk4Q2IP5FW_js.e(e.margins.top):4,c=e.margins?.bottom!=null?chunk4Q2IP5FW_js.e(e.margins.bottom):4,f=e.margins?.left!=null?chunk4Q2IP5FW_js.e(e.margins.left):7,d=e.margins?.right!=null?chunk4Q2IP5FW_js.e(e.margins.right):7,m=[];for(let p of e.content)m.push(V(p,n));return m.length===0&&m.push(chunkL5NPEM7C_js.b.node("paragraph",{},[])),chunkL5NPEM7C_js.b.node("textBox",{width:o,height:l,textBoxId:e.id,fillColor:t,outlineWidth:r,outlineColor:i,outlineStyle:s,marginTop:u,marginBottom:c,marginLeft:f,marginRight:d,...chunkC45EFOVP_js.d(e)},m)}function oe(e,n,o,l){let t=[];for(let r of e)if(r.type==="paragraph")t.push(...be(r,n)),l&&ge(r)&&t.push(chunkL5NPEM7C_js.b.node("pageBreak"));else if(r.type==="table")t.push(ne(r,n,o));else if(r.type==="blockSdt"){let i=oe(r.content,n,o,l),s=i.length>0?i:[chunkL5NPEM7C_js.b.node("paragraph",{},[])];t.push(chunkL5NPEM7C_js.b.node("blockSdt",chunkC45EFOVP_js.a(r.properties),s));}return t}function mt(e,n){let o=e.package.theme??null,l=n?.styles?chunkLWH66Q7Q_js.b(n.styles):null,t=oe(e.package.document.content,l,o,true);return t.length===0&&t.push(chunkL5NPEM7C_js.b.node("paragraph",{},[])),t[t.length-1]?.type.name==="blockSdt"&&t.push(chunkL5NPEM7C_js.b.node("paragraph",{},[])),chunkL5NPEM7C_js.b.node("doc",{defaultTabStopTwips:e.package.settings?.defaultTabStop??null,watermark:chunkRQVHKDXK_js.a(e)??null},t)}function Be(e,n){let o=n?.styles?chunkLWH66Q7Q_js.b(n.styles):null,l=n?.theme??null,t=oe(e,o,l,false);return t.length===0&&t.push(chunkL5NPEM7C_js.b.node("paragraph",{},[])),chunkL5NPEM7C_js.b.node("doc",{defaultTabStopTwips:n?.defaultTabStopTwips??null},t)}function gt(e,n){return Be(e,n)}function ht(){return chunkL5NPEM7C_js.b.node("doc",null,[chunkL5NPEM7C_js.b.node("paragraph",{},[])])}exports.a=mt;exports.b=Be;exports.c=gt;exports.d=ht;
|