n8n-nodes-adeu 1.9.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,69 +1,77 @@
|
|
|
1
|
-
'use strict';var n8nWorkflow=require('n8n-workflow');var jo=Object.create;var Fr=Object.defineProperty;var Wo=Object.getOwnPropertyDescriptor;var Ho=Object.getOwnPropertyNames;var Vo=Object.getPrototypeOf,Go=Object.prototype.hasOwnProperty;var h=(e,t)=>Fr(e,"name",{value:t,configurable:true});var Se=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Xo=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ho(t))!Go.call(e,o)&&o!==r&&Fr(e,o,{get:()=>t[o],enumerable:!(n=Wo(t,o))||n.enumerable});return e};var Lr=(e,t,r)=>(r=e!=null?jo(Vo(e)):{},Xo(Fr(r,"default",{value:e,enumerable:true}),e));var Bn=Se((Rl,Rn)=>{Rn.exports={createRequire:h(function(){return function(){return {}}},"createRequire")};});var rt=Se(le=>{function ya(e,t,r){if(r===void 0&&(r=Array.prototype),e&&typeof r.find=="function")return r.find.call(e,t);for(var n=0;n<e.length;n++)if(tt(e,n)){var o=e[n];if(t.call(void 0,o,n,e))return o}}h(ya,"find");function ht(e,t){return t===void 0&&(t=Object),t&&typeof t.getOwnPropertyDescriptors=="function"&&(e=t.create(null,t.getOwnPropertyDescriptors(e))),t&&typeof t.freeze=="function"?t.freeze(e):e}h(ht,"freeze");function tt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}h(tt,"hasOwn");function Ea(e,t){if(e===null||typeof e!="object")throw new TypeError("target is not an object");for(var r in t)tt(t,r)&&(e[r]=t[r]);return e}h(Ea,"assign");var Zn=ht({allowfullscreen:true,async:true,autofocus:true,autoplay:true,checked:true,controls:true,default:true,defer:true,disabled:true,formnovalidate:true,hidden:true,ismap:true,itemscope:true,loop:true,multiple:true,muted:true,nomodule:true,novalidate:true,open:true,playsinline:true,readonly:true,required:true,reversed:true,selected:true});function Da(e){return tt(Zn,e.toLowerCase())}h(Da,"isHTMLBooleanAttribute");var Kn=ht({area:true,base:true,br:true,col:true,embed:true,hr:true,img:true,input:true,link:true,meta:true,param:true,source:true,track:true,wbr:true});function Aa(e){return tt(Kn,e.toLowerCase())}h(Aa,"isHTMLVoidElement");var Lt=ht({script:false,style:false,textarea:true,title:true});function ba(e){var t=e.toLowerCase();return tt(Lt,t)&&!Lt[t]}h(ba,"isHTMLRawTextElement");function Na(e){var t=e.toLowerCase();return tt(Lt,t)&&Lt[t]}h(Na,"isHTMLEscapableRawTextElement");function ei(e){return e===$t.HTML}h(ei,"isHTMLMimeType");function Ca(e){return ei(e)||e===$t.XML_XHTML_APPLICATION}h(Ca,"hasDefaultHTMLNamespace");var $t=ht({HTML:"text/html",XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),Ta=Object.keys($t).map(function(e){return $t[e]});function xa(e){return Ta.indexOf(e)>-1}h(xa,"isValidMimeType");var Sa=ht({HTML:"http://www.w3.org/1999/xhtml",SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});le.assign=Ea;le.find=ya;le.freeze=ht;le.HTML_BOOLEAN_ATTRIBUTES=Zn;le.HTML_RAW_TEXT_ELEMENTS=Lt;le.HTML_VOID_ELEMENTS=Kn;le.hasDefaultHTMLNamespace=Ca;le.hasOwn=tt;le.isHTMLBooleanAttribute=Da;le.isHTMLRawTextElement=ba;le.isHTMLEscapableRawTextElement=Na;le.isHTMLMimeType=ei;le.isHTMLVoidElement=Aa;le.isValidMimeType=xa;le.MIME_TYPE=$t;le.NAMESPACE=Sa;});var Wt=Se(jt=>{var Ia=rt();function ri(e,t){e.prototype=Object.create(Error.prototype,{constructor:{value:e},name:{value:e.name,enumerable:true,writable:t}});}h(ri,"extendError");var qt=Ia.freeze({Error:"Error",IndexSizeError:"IndexSizeError",DomstringSizeError:"DomstringSizeError",HierarchyRequestError:"HierarchyRequestError",WrongDocumentError:"WrongDocumentError",InvalidCharacterError:"InvalidCharacterError",NoDataAllowedError:"NoDataAllowedError",NoModificationAllowedError:"NoModificationAllowedError",NotFoundError:"NotFoundError",NotSupportedError:"NotSupportedError",InUseAttributeError:"InUseAttributeError",InvalidStateError:"InvalidStateError",SyntaxError:"SyntaxError",InvalidModificationError:"InvalidModificationError",NamespaceError:"NamespaceError",InvalidAccessError:"InvalidAccessError",ValidationError:"ValidationError",TypeMismatchError:"TypeMismatchError",SecurityError:"SecurityError",NetworkError:"NetworkError",AbortError:"AbortError",URLMismatchError:"URLMismatchError",QuotaExceededError:"QuotaExceededError",TimeoutError:"TimeoutError",InvalidNodeTypeError:"InvalidNodeTypeError",DataCloneError:"DataCloneError",EncodingError:"EncodingError",NotReadableError:"NotReadableError",UnknownError:"UnknownError",ConstraintError:"ConstraintError",DataError:"DataError",TransactionInactiveError:"TransactionInactiveError",ReadOnlyError:"ReadOnlyError",VersionError:"VersionError",OperationError:"OperationError",NotAllowedError:"NotAllowedError",OptOutError:"OptOutError"}),ni=Object.keys(qt);function ii(e){return typeof e=="number"&&e>=1&&e<=25}h(ii,"isValidDomExceptionCode");function Oa(e){return typeof e=="string"&&e.substring(e.length-qt.Error.length)===qt.Error}h(Oa,"endsWithError");function zt(e,t){ii(e)?(this.name=ni[e],this.message=t||""):(this.message=e,this.name=Oa(t)?t:qt.Error),Error.captureStackTrace&&Error.captureStackTrace(this,zt);}h(zt,"DOMException");ri(zt,true);Object.defineProperties(zt.prototype,{code:{enumerable:true,get:h(function(){var e=ni.indexOf(this.name);return ii(e)?e:0},"get")}});var oi={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25},Zr=Object.entries(oi);for(Ut=0;Ut<Zr.length;Ut++)ti=Zr[Ut][0],zt[ti]=Zr[Ut][1];var ti,Ut;function Kr(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,Kr);}h(Kr,"ParseError");ri(Kr);jt.DOMException=zt;jt.DOMExceptionName=qt;jt.ExceptionCode=oi;jt.ParseError=Kr;});var sn=Se(B=>{function hi(e){try{typeof e!="function"&&(e=RegExp);var t=new e("\u{1D306}","u").exec("\u{1D306}");return !!t&&t[0].length===2}catch{}return false}h(hi,"detectUnicodeSupport");var mt=hi();function We(e){if(e.source[0]!=="[")throw new Error(e+" can not be used with chars");return e.source.slice(1,e.source.lastIndexOf("]"))}h(We,"chars");function dt(e,t){if(e.source[0]!=="[")throw new Error("/"+e.source+"/ can not be used with chars_without");if(!t||typeof t!="string")throw new Error(JSON.stringify(t)+" is not a valid search");if(e.source.indexOf(t)===-1)throw new Error('"'+t+'" is not is /'+e.source+"/");if(t==="-"&&e.source.indexOf(t)!==1)throw new Error('"'+t+'" is not at the first postion of /'+e.source+"/");return new RegExp(e.source.replace(t,""),mt?"u":"")}h(dt,"chars_without");function q(e){var t=this;return new RegExp(Array.prototype.slice.call(arguments).map(function(r){var n=typeof r=="string";if(n&&t===void 0&&r==="|")throw new Error("use regg instead of reg to wrap expressions with `|`!");return n?r:r.source}).join(""),mt?"mu":"m")}h(q,"reg");function M(e){if(arguments.length===0)throw new Error("no parameters provided");return q.apply(M,["(?:"].concat(Array.prototype.slice.call(arguments),[")"]))}h(M,"regg");var ka="\uFFFD",He=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;mt&&(He=q("[",We(He),"\\u{10000}-\\u{10FFFF}","]"));var Pa=new RegExp("[^"+We(He)+"]",mt?"u":""),tn=/[\x20\x09\x0D\x0A]/,Ma=We(tn),X=q(tn,"+"),K=q(tn,"*"),Ht=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;mt&&(Ht=q("[",We(Ht),"\\u{10000}-\\u{10FFFF}","]"));var Ra=We(Ht),rn=q("[",Ra,We(/[-.0-9\xB7]/),We(/[\u0300-\u036F\u203F-\u2040]/),"]"),De=q(Ht,rn,"*"),ai=q(rn,"+"),Ba=q("&",De,";"),Fa=M(/&#[0-9]+;|&#x[0-9a-fA-F]+;/),Vt=M(Ba,"|",Fa),Gt=q("%",De,";"),nn=M(q('"',M(/[^%&"]/,"|",Gt,"|",Vt),"*",'"'),"|",q("'",M(/[^%&']/,"|",Gt,"|",Vt),"*","'")),La=M('"',M(/[^<&"]/,"|",Vt),"*",'"',"|","'",M(/[^<&']/,"|",Vt),"*","'"),$a=dt(Ht,":"),Ua=dt(rn,":"),si=q($a,Ua,"*"),Xt=q(si,M(":",si),"?"),qa=q("^",Xt,"$"),za=q("(",Xt,")"),pt=M(/"[^"]*"|'[^']*'/),ja=q(/^<\?/,"(",De,")",M(X,"(",He,"*?)"),"?",/\?>/),ui=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,Yt=M('"',ui,'*"',"|","'",dt(ui,"'"),"*'"),di="<!--",pi="-->",Wa=q(di,M(dt(He,"-"),"|",q("-",dt(He,"-"))),"*",pi),li="#PCDATA",Ha=M(q(/\(/,K,li,M(K,/\|/,K,Xt),"*",K,/\)\*/),"|",q(/\(/,K,li,K,/\)/)),Va=/[?*+]?/,Ga=q(/\([^>]+\)/,Va),Xa=M("EMPTY","|","ANY","|",Ha,"|",Ga),Ya="<!ELEMENT",Qa=q(Ya,X,M(Xt,"|",Gt),X,M(Xa,"|",Gt),K,">"),Ja=q("NOTATION",X,/\(/,K,De,M(K,/\|/,K,De),"*",K,/\)/),Za=q(/\(/,K,ai,M(K,/\|/,K,ai),"*",K,/\)/),Ka=M(Ja,"|",Za),es=M(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,"|",Ka),ts=M(/#REQUIRED|#IMPLIED/,"|",M(M("#FIXED",X),"?",La)),rs=M(X,De,X,es,X,ts),ns="<!ATTLIST",is=q(ns,X,De,rs,"*",K,">"),en="about:legacy-compat",os=M('"'+en+'"',"|","'"+en+"'"),on="SYSTEM",fr="PUBLIC",hr=M(M(on,X,pt),"|",M(fr,X,Yt,X,pt)),as=q("^",M(M(on,X,"(?<SystemLiteralOnly>",pt,")"),"|",M(fr,X,"(?<PubidLiteral>",Yt,")",X,"(?<SystemLiteral>",pt,")"))),ss=q("^",Yt,"$"),us=q("^",pt,"$"),ls=M(X,"NDATA",X,De),cs=M(nn,"|",M(hr,ls,"?")),mi="<!ENTITY",fs=q(mi,X,De,X,cs,K,">"),hs=M(nn,"|",hr),ds=q(mi,X,"%",X,De,X,hs,K,">"),ps=M(fs,"|",ds),ms=q(fr,X,Yt),gs=q("<!NOTATION",X,De,X,M(hr,"|",ms),K,">"),an=q(K,"=",K),ci=/1[.]\d+/,_s=q(X,"version",an,M("'",ci,"'","|",'"',ci,'"')),fi=/[A-Za-z][-A-Za-z0-9._]*/,vs=M(X,"encoding",an,M('"',fi,'"',"|","'",fi,"'")),ws=M(X,"standalone",an,M("'",M("yes","|","no"),"'","|",'"',M("yes","|","no"),'"')),ys=q(/^<\?xml/,_s,vs,"?",ws,"?",K,/\?>/),Es="<!DOCTYPE",Ds="<![CDATA[",As="]]>",bs=/<!\[CDATA\[/,Ns=/\]\]>/,Cs=q(He,"*?",Ns),Ts=q(bs,Cs);B.chars=We;B.chars_without=dt;B.detectUnicodeSupport=hi;B.reg=q;B.regg=M;B.ABOUT_LEGACY_COMPAT=en;B.ABOUT_LEGACY_COMPAT_SystemLiteral=os;B.AttlistDecl=is;B.CDATA_START=Ds;B.CDATA_END=As;B.CDSect=Ts;B.Char=He;B.Comment=Wa;B.COMMENT_START=di;B.COMMENT_END=pi;B.DOCTYPE_DECL_START=Es;B.elementdecl=Qa;B.EntityDecl=ps;B.EntityValue=nn;B.ExternalID=hr;B.ExternalID_match=as;B.Name=De;B.NotationDecl=gs;B.Reference=Vt;B.PEReference=Gt;B.PI=ja;B.PUBLIC=fr;B.PubidLiteral=Yt;B.PubidLiteral_match=ss;B.QName=Xt;B.QName_exact=qa;B.QName_group=za;B.S=X;B.SChar_s=Ma;B.S_OPT=K;B.SYSTEM=on;B.SystemLiteral=pt;B.SystemLiteral_match=us;B.InvalidChar=Pa;B.UNICODE_REPLACEMENT_CHARACTER=ka;B.UNICODE_SUPPORT=mt;B.XMLDecl=ys;});var mn=Se(ne=>{var Ne=rt(),Pe=Ne.find,xs=Ne.hasDefaultHTMLNamespace,_t=Ne.hasOwn,Ss=Ne.isHTMLMimeType,Is=Ne.isHTMLRawTextElement,Os=Ne.isHTMLVoidElement,Qt=Ne.MIME_TYPE,Me=Ne.NAMESPACE,de=Symbol(),Di=Wt(),S=Di.DOMException,Ae=Di.DOMExceptionName,ce=sn();function pe(e){if(e!==de)throw new TypeError("Illegal constructor")}h(pe,"checkSymbol");function ks(e){return e!==""}h(ks,"notEmptyString");function Ps(e){return e?e.split(/[\t\n\f\r ]+/).filter(ks):[]}h(Ps,"splitOnASCIIWhitespace");function Ms(e,t){return _t(e,t)||(e[t]=true),e}h(Ms,"orderedSetReducer");function gi(e){if(!e)return [];var t=Ps(e);return Object.keys(t.reduce(Ms,{}))}h(gi,"toOrderedSet");function Rs(e){return function(t){return e&&e.indexOf(t)!==-1}}h(Rs,"arrayIncludes");function Ai(e){if(!ce.QName_exact.test(e))throw new S(S.INVALID_CHARACTER_ERR,'invalid character in qualified name "'+e+'"')}h(Ai,"validateQualifiedName");function ln(e,t){Ai(t),e=e||null;var r=null,n=t;if(t.indexOf(":")>=0){var o=t.split(":");r=o[0],n=o[1];}if(r!==null&&e===null)throw new S(S.NAMESPACE_ERR,"prefix is non-null and namespace is null");if(r==="xml"&&e!==Ne.NAMESPACE.XML)throw new S(S.NAMESPACE_ERR,'prefix is "xml" and namespace is not the XML namespace');if((r==="xmlns"||t==="xmlns")&&e!==Ne.NAMESPACE.XMLNS)throw new S(S.NAMESPACE_ERR,'either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace');if(e===Ne.NAMESPACE.XMLNS&&r!=="xmlns"&&t!=="xmlns")throw new S(S.NAMESPACE_ERR,'namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"');return [e,r,n]}h(ln,"validateAndExtract");function yt(e,t){for(var r in e)_t(e,r)&&(t[r]=e[r]);}h(yt,"copy");function me(e,t){var r=e.prototype;if(!(r instanceof t)){let n=function(){};h(n,"t"),n.prototype=t.prototype,n=new n,yt(r,n),e.prototype=r=n;}r.constructor!=e&&(r.constructor=e);}h(me,"_extends");var ge={},be=ge.ELEMENT_NODE=1,vt=ge.ATTRIBUTE_NODE=2,mr=ge.TEXT_NODE=3,bi=ge.CDATA_SECTION_NODE=4,Ni=ge.ENTITY_REFERENCE_NODE=5,Bs=ge.ENTITY_NODE=6,cn=ge.PROCESSING_INSTRUCTION_NODE=7,fn=ge.COMMENT_NODE=8,gt=ge.DOCUMENT_NODE=9,Ci=ge.DOCUMENT_TYPE_NODE=10,Ve=ge.DOCUMENT_FRAGMENT_NODE=11,Fs=ge.NOTATION_NODE=12,re=Ne.freeze({DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32});function Ti(e,t){if(t.length<e.length)return Ti(t,e);var r=null;for(var n in e){if(e[n]!==t[n])return r;r=e[n];}return r}h(Ti,"commonAncestor");function _i(e){return e.guid||(e.guid=Math.random()),e.guid}h(_i,"docGUID");function ae(){}h(ae,"NodeList");ae.prototype={length:0,item:h(function(e){return e>=0&&e<this.length?this[e]:null},"item"),toString:h(function(e){var t;typeof e=="function"?t={requireWellFormed:false,splitCDATASections:true,nodeFilter:e}:e?t={requireWellFormed:!!e.requireWellFormed,splitCDATASections:e.splitCDATASections!==false,nodeFilter:e.nodeFilter||null}:t={requireWellFormed:false,splitCDATASections:true,nodeFilter:null};for(var r=[],n=0;n<this.length;n++)pn(this[n],r,null,t);return r.join("")},"toString"),filter:h(function(e){return Array.prototype.filter.call(this,e)},"filter"),indexOf:h(function(e){return Array.prototype.indexOf.call(this,e)},"indexOf")};ae.prototype[Symbol.iterator]=function(){var e=this,t=0;return {next:h(function(){return t<e.length?{value:e[t++],done:false}:{done:true}},"next"),return:h(function(){return {done:true}},"return")}};function ke(e,t){this._node=e,this._refresh=t,_r(this);}h(ke,"LiveNodeList");function _r(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var r=e._refresh(e._node);if($i(e,"length",r.length),!e.$$length||r.length<e.$$length)for(var n=r.length;n in e;n++)_t(e,n)&&delete e[n];yt(r,e),e._inc=t;}}h(_r,"_updateLiveList");ke.prototype.item=function(e){return _r(this),this[e]||null};me(ke,ae);function wt(){}h(wt,"NamedNodeMap");function xi(e,t){for(var r=0;r<e.length;){if(e[r]===t)return r;r++;}}h(xi,"_findNodeIndex");function Ls(e,t,r,n){if(n?t[xi(t,n)]=r:(t[t.length]=r,t.length++),e){r.ownerElement=e;var o=e.ownerDocument;o&&(n&&Oi(o,e,n),$s(o,e,r));}}h(Ls,"_addNamedNode");function vi(e,t,r){var n=xi(t,r);if(n>=0){for(var o=t.length-1;n<=o;)t[n]=t[++n];if(t.length=o,e){var i=e.ownerDocument;i&&Oi(i,e,r),r.ownerElement=null;}}}h(vi,"_removeNamedNode");wt.prototype={length:0,item:ae.prototype.item,getNamedItem:h(function(e){this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase());for(var t=0;t<this.length;){var r=this[t];if(r.nodeName===e)return r;t++;}return null},"getNamedItem"),setNamedItem:h(function(e){var t=e.ownerElement;if(t&&t!==this._ownerElement)throw new S(S.INUSE_ATTRIBUTE_ERR);var r=this.getNamedItemNS(e.namespaceURI,e.localName);return r===e?e:(Ls(this._ownerElement,this,e,r),r)},"setNamedItem"),setNamedItemNS:h(function(e){return this.setNamedItem(e)},"setNamedItemNS"),removeNamedItem:h(function(e){var t=this.getNamedItem(e);if(!t)throw new S(S.NOT_FOUND_ERR,e);return vi(this._ownerElement,this,t),t},"removeNamedItem"),removeNamedItemNS:h(function(e,t){var r=this.getNamedItemNS(e,t);if(!r)throw new S(S.NOT_FOUND_ERR,e?e+" : "+t:t);return vi(this._ownerElement,this,r),r},"removeNamedItemNS"),getNamedItemNS:h(function(e,t){e||(e=null);for(var r=0;r<this.length;){var n=this[r];if(n.localName===t&&n.namespaceURI===e)return n;r++;}return null},"getNamedItemNS")};wt.prototype[Symbol.iterator]=function(){var e=this,t=0;return {next:h(function(){return t<e.length?{value:e[t++],done:false}:{done:true}},"next"),return:h(function(){return {done:true}},"return")}};function Si(){}h(Si,"DOMImplementation");Si.prototype={hasFeature:h(function(e,t){return true},"hasFeature"),createDocument:h(function(e,t,r){var n=Qt.XML_APPLICATION;e===Me.HTML?n=Qt.XML_XHTML_APPLICATION:e===Me.SVG&&(n=Qt.XML_SVG_IMAGE);var o=new Ue(de,{contentType:n});if(o.implementation=this,o.childNodes=new ae,o.doctype=r||null,r&&o.appendChild(r),t){var i=o.createElementNS(e,t);o.appendChild(i);}return o},"createDocument"),createDocumentType:h(function(e,t,r,n){Ai(e);var o=new yr(de);return o.name=e,o.nodeName=e,o.publicId=t||"",o.systemId=r||"",o.internalSubset=n||"",o.childNodes=new ae,o},"createDocumentType"),createHTMLDocument:h(function(e){var t=new Ue(de,{contentType:Qt.HTML});if(t.implementation=this,t.childNodes=new ae,e!==false){t.doctype=this.createDocumentType("html"),t.doctype.ownerDocument=t,t.appendChild(t.doctype);var r=t.createElement("html");t.appendChild(r);var n=t.createElement("head");if(r.appendChild(n),typeof e=="string"){var o=t.createElement("title");o.appendChild(t.createTextNode(e)),n.appendChild(o);}r.appendChild(t.createElement("body"));}return t},"createHTMLDocument")};function W(e){pe(e);}h(W,"Node");W.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,parentNode:null,get parentElement(){return this.parentNode&&this.parentNode.nodeType===this.ELEMENT_NODE?this.parentNode:null},childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,baseURI:"about:blank",get isConnected(){var e=this.getRootNode();return e&&e.nodeType===e.DOCUMENT_NODE},contains:h(function(e){if(!e)return false;var t=e;do{if(this===t)return true;t=t.parentNode;}while(t);return false},"contains"),getRootNode:h(function(e){var t=this;do{if(!t.parentNode)return t;t=t.parentNode;}while(t)},"getRootNode"),isEqualNode:h(function(e){if(!e)return false;for(var t=[{node:this,other:e}];t.length>0;){var r=t.pop(),n=r.node,o=r.other;if(n.nodeType!==o.nodeType)return false;switch(n.nodeType){case n.DOCUMENT_TYPE_NODE:if(n.name!==o.name||n.publicId!==o.publicId||n.systemId!==o.systemId)return false;break;case n.ELEMENT_NODE:if(n.namespaceURI!==o.namespaceURI||n.prefix!==o.prefix||n.localName!==o.localName||n.attributes.length!==o.attributes.length)return false;for(var i=0;i<n.attributes.length;i++){var a=n.attributes.item(i),s=o.getAttributeNodeNS(a.namespaceURI,a.localName);if(!s)return false;t.push({node:a,other:s});}break;case n.ATTRIBUTE_NODE:if(n.namespaceURI!==o.namespaceURI||n.localName!==o.localName||n.value!==o.value)return false;break;case n.PROCESSING_INSTRUCTION_NODE:if(n.target!==o.target||n.data!==o.data)return false;break;case n.TEXT_NODE:case n.CDATA_SECTION_NODE:case n.COMMENT_NODE:if(n.data!==o.data)return false;break}if(n.childNodes.length!==o.childNodes.length)return false;for(var i=n.childNodes.length-1;i>=0;i--)t.push({node:n.childNodes[i],other:o.childNodes[i]});}return true},"isEqualNode"),isSameNode:h(function(e){return this===e},"isSameNode"),insertBefore:h(function(e,t){return gr(this,e,t)},"insertBefore"),replaceChild:h(function(e,t){gr(this,e,t,Ri),t&&this.removeChild(t);},"replaceChild"),removeChild:h(function(e){return Pi(this,e)},"removeChild"),appendChild:h(function(e){return this.insertBefore(e,null)},"appendChild"),hasChildNodes:h(function(){return this.firstChild!=null},"hasChildNodes"),cloneNode:h(function(e){return Li(this.ownerDocument||this,this,e)},"cloneNode"),normalize:h(function(){fe(this,null,{enter:h(function(e){for(var t=e.firstChild;t;){var r=t.nextSibling;r!==null&&r.nodeType===mr&&t.nodeType===mr?(e.removeChild(r),t.appendData(r.data)):t=r;}return true},"enter")});},"normalize"),isSupported:h(function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},"isSupported"),lookupPrefix:h(function(e){for(var t=this;t;){var r=t._nsMap;if(r){for(var n in r)if(_t(r,n)&&r[n]===e)return n}t=t.nodeType==vt?t.ownerDocument:t.parentNode;}return null},"lookupPrefix"),lookupNamespaceURI:h(function(e){for(var t=this;t;){var r=t._nsMap;if(r&&_t(r,e))return r[e];t=t.nodeType==vt?t.ownerDocument:t.parentNode;}return null},"lookupNamespaceURI"),isDefaultNamespace:h(function(e){var t=this.lookupPrefix(e);return t==null},"isDefaultNamespace"),compareDocumentPosition:h(function(e){if(this===e)return 0;var t=e,r=this,n=null,o=null;if(t instanceof nt&&(n=t,t=n.ownerElement),r instanceof nt&&(o=r,r=o.ownerElement,n&&t&&r===t))for(var i=0,a;a=r.attributes[i];i++){if(a===n)return re.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+re.DOCUMENT_POSITION_PRECEDING;if(a===o)return re.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+re.DOCUMENT_POSITION_FOLLOWING}if(!t||!r||r.ownerDocument!==t.ownerDocument)return re.DOCUMENT_POSITION_DISCONNECTED+re.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(_i(r.ownerDocument)>_i(t.ownerDocument)?re.DOCUMENT_POSITION_FOLLOWING:re.DOCUMENT_POSITION_PRECEDING);if(o&&t===r)return re.DOCUMENT_POSITION_CONTAINS+re.DOCUMENT_POSITION_PRECEDING;if(n&&t===r)return re.DOCUMENT_POSITION_CONTAINED_BY+re.DOCUMENT_POSITION_FOLLOWING;for(var s=[],l=t.parentNode;l;){if(!o&&l===r)return re.DOCUMENT_POSITION_CONTAINED_BY+re.DOCUMENT_POSITION_FOLLOWING;s.push(l),l=l.parentNode;}s.reverse();for(var u=[],f=r.parentNode;f;){if(!n&&f===t)return re.DOCUMENT_POSITION_CONTAINS+re.DOCUMENT_POSITION_PRECEDING;u.push(f),f=f.parentNode;}u.reverse();var c=Ti(s,u);for(var d in c.childNodes){var p=c.childNodes[d];if(p===r)return re.DOCUMENT_POSITION_FOLLOWING;if(p===t)return re.DOCUMENT_POSITION_PRECEDING;if(u.indexOf(p)>=0)return re.DOCUMENT_POSITION_FOLLOWING;if(s.indexOf(p)>=0)return re.DOCUMENT_POSITION_PRECEDING}return 0},"compareDocumentPosition")};function Ii(e){return e=="<"&&"<"||e==">"&&">"||e=="&"&&"&"||e=='"'&&"""||"&#"+e.charCodeAt()+";"}h(Ii,"_xmlEncoder");yt(ge,W);yt(ge,W.prototype);yt(re,W);yt(re,W.prototype);function pr(e,t){fe(e,null,{enter:h(function(r){return t(r)?fe.STOP:true},"enter")});}h(pr,"_visitNode");function fe(e,t,r){for(var n=[{node:e,context:t,phase:fe.ENTER}];n.length>0;){var o=n.pop();if(o.phase===fe.ENTER){var i=r.enter(o.node,o.context);if(i===fe.STOP)return fe.STOP;if(n.push({node:o.node,context:i,phase:fe.EXIT}),i==null)continue;for(var a=o.node.lastChild;a;)n.push({node:a,context:i,phase:fe.ENTER}),a=a.previousSibling;}else r.exit&&r.exit(o.node,o.context);}}h(fe,"walkDOM");fe.STOP=Symbol("walkDOM.STOP");fe.ENTER=0;fe.EXIT=1;function Ue(e,t){pe(e);var r=t||{};this.ownerDocument=this,this.contentType=r.contentType||Qt.XML_APPLICATION,this.type=Ss(this.contentType)?"html":"xml";}h(Ue,"Document");function $s(e,t,r){e&&e._inc++;var n=r.namespaceURI;n===Me.XMLNS&&(t._nsMap[r.prefix?r.localName:""]=r.value);}h($s,"_onAddAttribute");function Oi(e,t,r,n){e&&e._inc++;var o=r.namespaceURI;o===Me.XMLNS&&delete t._nsMap[r.prefix?r.localName:""];}h(Oi,"_onRemoveAttribute");function ki(e,t,r){if(e&&e._inc){e._inc++;var n=t.childNodes;if(r&&!r.nextSibling)n[n.length++]=r;else {for(var o=t.firstChild,i=0;o;)n[i++]=o,o=o.nextSibling;n.length=i,delete n[n.length];}}}h(ki,"_onUpdateChild");function Pi(e,t){if(e!==t.parentNode)throw new S(S.NOT_FOUND_ERR,"child's parent is not parent");var r=t.previousSibling,n=t.nextSibling;return r?r.nextSibling=n:e.firstChild=n,n?n.previousSibling=r:e.lastChild=r,ki(e.ownerDocument,e),t.parentNode=null,t.previousSibling=null,t.nextSibling=null,t}h(Pi,"_removeChild");function Us(e){return e&&(e.nodeType===W.DOCUMENT_NODE||e.nodeType===W.DOCUMENT_FRAGMENT_NODE||e.nodeType===W.ELEMENT_NODE)}h(Us,"hasValidParentNodeType");function qs(e){return e&&(e.nodeType===W.CDATA_SECTION_NODE||e.nodeType===W.COMMENT_NODE||e.nodeType===W.DOCUMENT_FRAGMENT_NODE||e.nodeType===W.DOCUMENT_TYPE_NODE||e.nodeType===W.ELEMENT_NODE||e.nodeType===W.PROCESSING_INSTRUCTION_NODE||e.nodeType===W.TEXT_NODE)}h(qs,"hasInsertableNodeType");function Ge(e){return e&&e.nodeType===W.DOCUMENT_TYPE_NODE}h(Ge,"isDocTypeNode");function $e(e){return e&&e.nodeType===W.ELEMENT_NODE}h($e,"isElementNode");function Mi(e){return e&&e.nodeType===W.TEXT_NODE}h(Mi,"isTextNode");function wi(e,t){var r=e.childNodes||[];if(Pe(r,$e)||Ge(t))return false;var n=Pe(r,Ge);return !(t&&n&&r.indexOf(n)>r.indexOf(t))}h(wi,"isElementInsertionPossible");function yi(e,t){var r=e.childNodes||[];function n(i){return $e(i)&&i!==t}if(h(n,"hasElementChildThatIsNotChild"),Pe(r,n))return false;var o=Pe(r,Ge);return !(t&&o&&r.indexOf(o)>r.indexOf(t))}h(yi,"isElementReplacementPossible");function zs(e,t,r){if(!Us(e))throw new S(S.HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+e.nodeType);if(r&&r.parentNode!==e)throw new S(S.NOT_FOUND_ERR,"child not in parent");if(!qs(t)||Ge(t)&&e.nodeType!==W.DOCUMENT_NODE)throw new S(S.HIERARCHY_REQUEST_ERR,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}h(zs,"assertPreInsertionValidity1to5");function js(e,t,r){var n=e.childNodes||[],o=t.childNodes||[];if(t.nodeType===W.DOCUMENT_FRAGMENT_NODE){var i=o.filter($e);if(i.length>1||Pe(o,Mi))throw new S(S.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(i.length===1&&!wi(e,r))throw new S(S.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if($e(t)&&!wi(e,r))throw new S(S.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(Ge(t)){if(Pe(n,Ge))throw new S(S.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=Pe(n,$e);if(r&&n.indexOf(a)<n.indexOf(r))throw new S(S.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element");if(!r&&a)throw new S(S.HIERARCHY_REQUEST_ERR,"Doctype can not be appended since element is present")}}h(js,"assertPreInsertionValidityInDocument");function Ri(e,t,r){var n=e.childNodes||[],o=t.childNodes||[];if(t.nodeType===W.DOCUMENT_FRAGMENT_NODE){var i=o.filter($e);if(i.length>1||Pe(o,Mi))throw new S(S.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(i.length===1&&!yi(e,r))throw new S(S.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if($e(t)&&!yi(e,r))throw new S(S.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(Ge(t)){let s=function(l){return Ge(l)&&l!==r};if(h(s,"hasDoctypeChildThatIsNotChild"),Pe(n,s))throw new S(S.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=Pe(n,$e);if(r&&n.indexOf(a)<n.indexOf(r))throw new S(S.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element")}}h(Ri,"assertPreReplacementValidityInDocument");function gr(e,t,r,n){zs(e,t,r),e.nodeType===W.DOCUMENT_NODE&&(n||js)(e,t,r);var o=t.parentNode;if(o&&o.removeChild(t),t.nodeType===Ve){var i=t.firstChild;if(i==null)return t;var a=t.lastChild;}else i=a=t;var s=r?r.previousSibling:e.lastChild;i.previousSibling=s,a.nextSibling=r,s?s.nextSibling=i:e.firstChild=i,r==null?e.lastChild=a:r.previousSibling=a;do i.parentNode=e;while(i!==a&&(i=i.nextSibling));return ki(e.ownerDocument||e,e,t),t.nodeType==Ve&&(t.firstChild=t.lastChild=null),t}h(gr,"_insertBefore");Ue.prototype={implementation:null,nodeName:"#document",nodeType:gt,doctype:null,documentElement:null,_inc:1,insertBefore:h(function(e,t){if(e.nodeType===Ve){for(var r=e.firstChild;r;){var n=r.nextSibling;this.insertBefore(r,t),r=n;}return e}return gr(this,e,t),e.ownerDocument=this,this.documentElement===null&&e.nodeType===be&&(this.documentElement=e),e},"insertBefore"),removeChild:h(function(e){var t=Pi(this,e);return t===this.documentElement&&(this.documentElement=null),t},"removeChild"),replaceChild:h(function(e,t){gr(this,e,t,Ri),e.ownerDocument=this,t&&this.removeChild(t),$e(e)&&(this.documentElement=e);},"replaceChild"),importNode:h(function(e,t){return Ws(this,e,t)},"importNode"),getElementById:h(function(e){var t=null;return pr(this.documentElement,function(r){if(r.nodeType==be&&r.getAttribute("id")==e)return t=r,true}),t},"getElementById"),createElement:h(function(e){var t=new qe(de);t.ownerDocument=this,this.type==="html"&&(e=e.toLowerCase()),xs(this.contentType)&&(t.namespaceURI=Me.HTML),t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new ae;var r=t.attributes=new wt;return r._ownerElement=t,t},"createElement"),createDocumentFragment:h(function(){var e=new Dt(de);return e.ownerDocument=this,e.childNodes=new ae,e},"createDocumentFragment"),createTextNode:h(function(e){var t=new Jt(de);return t.ownerDocument=this,t.childNodes=new ae,t.appendData(e),t},"createTextNode"),createComment:h(function(e){var t=new vr(de);return t.ownerDocument=this,t.childNodes=new ae,t.appendData(e),t},"createComment"),createCDATASection:h(function(e){if(e.indexOf("]]>")!==-1)throw new S(S.INVALID_CHARACTER_ERR,'data contains "]]>"');var t=new wr(de);return t.ownerDocument=this,t.childNodes=new ae,t.appendData(e),t},"createCDATASection"),createProcessingInstruction:h(function(e,t){var r=new Dr(de);return r.ownerDocument=this,r.childNodes=new ae,r.nodeName=r.target=e,r.nodeValue=r.data=t,r},"createProcessingInstruction"),createAttribute:h(function(e){if(!ce.QName_exact.test(e))throw new S(S.INVALID_CHARACTER_ERR,'invalid character in name "'+e+'"');return this.type==="html"&&(e=e.toLowerCase()),this._createAttribute(e)},"createAttribute"),_createAttribute:h(function(e){var t=new nt(de);return t.ownerDocument=this,t.childNodes=new ae,t.name=e,t.nodeName=e,t.localName=e,t.specified=true,t},"_createAttribute"),createEntityReference:h(function(e){if(!ce.Name.test(e))throw new S(S.INVALID_CHARACTER_ERR,'not a valid xml name "'+e+'"');if(this.type==="html")throw new S("document is an html document",Ae.NotSupportedError);var t=new Er(de);return t.ownerDocument=this,t.childNodes=new ae,t.nodeName=e,t},"createEntityReference"),createElementNS:h(function(e,t){var r=ln(e,t),n=new qe(de),o=n.attributes=new wt;return n.childNodes=new ae,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=r[0],n.prefix=r[1],n.localName=r[2],o._ownerElement=n,n},"createElementNS"),createAttributeNS:h(function(e,t){var r=ln(e,t),n=new nt(de);return n.ownerDocument=this,n.childNodes=new ae,n.nodeName=t,n.name=t,n.specified=true,n.namespaceURI=r[0],n.prefix=r[1],n.localName=r[2],n},"createAttributeNS")};me(Ue,W);function qe(e){pe(e),this._nsMap=Object.create(null);}h(qe,"Element");qe.prototype={nodeType:be,attributes:null,getQualifiedName:h(function(){return this.prefix?this.prefix+":"+this.localName:this.localName},"getQualifiedName"),_isInHTMLDocumentAndNamespace:h(function(){return this.ownerDocument.type==="html"&&this.namespaceURI===Me.HTML},"_isInHTMLDocumentAndNamespace"),hasAttributes:h(function(){return !!(this.attributes&&this.attributes.length)},"hasAttributes"),hasAttribute:h(function(e){return !!this.getAttributeNode(e)},"hasAttribute"),getAttribute:h(function(e){var t=this.getAttributeNode(e);return t?t.value:null},"getAttribute"),getAttributeNode:h(function(e){return this._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase()),this.attributes.getNamedItem(e)},"getAttributeNode"),setAttribute:h(function(e,t){this._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase());var r=this.getAttributeNode(e);r?r.value=r.nodeValue=""+t:(r=this.ownerDocument._createAttribute(e),r.value=r.nodeValue=""+t,this.setAttributeNode(r));},"setAttribute"),removeAttribute:h(function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t);},"removeAttribute"),setAttributeNode:h(function(e){return this.attributes.setNamedItem(e)},"setAttributeNode"),setAttributeNodeNS:h(function(e){return this.attributes.setNamedItemNS(e)},"setAttributeNodeNS"),removeAttributeNode:h(function(e){return this.attributes.removeNamedItem(e.nodeName)},"removeAttributeNode"),removeAttributeNS:h(function(e,t){var r=this.getAttributeNodeNS(e,t);r&&this.removeAttributeNode(r);},"removeAttributeNS"),hasAttributeNS:h(function(e,t){return this.getAttributeNodeNS(e,t)!=null},"hasAttributeNS"),getAttributeNS:h(function(e,t){var r=this.getAttributeNodeNS(e,t);return r?r.value:null},"getAttributeNS"),setAttributeNS:h(function(e,t,r){var n=ln(e,t),o=n[2],i=this.getAttributeNodeNS(e,o);i?i.value=i.nodeValue=""+r:(i=this.ownerDocument.createAttributeNS(e,t),i.value=i.nodeValue=""+r,this.setAttributeNode(i));},"setAttributeNS"),getAttributeNodeNS:h(function(e,t){return this.attributes.getNamedItemNS(e,t)},"getAttributeNodeNS"),getElementsByClassName:h(function(e){var t=gi(e);return new ke(this,function(r){var n=[];return t.length>0&&pr(r,function(o){if(o!==r&&o.nodeType===be){var i=o.getAttribute("class");if(i){var a=e===i;if(!a){var s=gi(i);a=t.every(Rs(s));}a&&n.push(o);}}}),n})},"getElementsByClassName"),getElementsByTagName:h(function(e){var t=(this.nodeType===gt?this:this.ownerDocument).type==="html",r=e.toLowerCase();return new ke(this,function(n){var o=[];return pr(n,function(i){if(!(i===n||i.nodeType!==be))if(e==="*")o.push(i);else {var a=i.getQualifiedName(),s=t&&i.namespaceURI===Me.HTML?r:e;a===s&&o.push(i);}}),o})},"getElementsByTagName"),getElementsByTagNameNS:h(function(e,t){return new ke(this,function(r){var n=[];return pr(r,function(o){o!==r&&o.nodeType===be&&(e==="*"||o.namespaceURI===e)&&(t==="*"||o.localName==t)&&n.push(o);}),n})},"getElementsByTagNameNS")};Ue.prototype.getElementsByClassName=qe.prototype.getElementsByClassName;Ue.prototype.getElementsByTagName=qe.prototype.getElementsByTagName;Ue.prototype.getElementsByTagNameNS=qe.prototype.getElementsByTagNameNS;me(qe,W);function nt(e){pe(e),this.namespaceURI=null,this.prefix=null,this.ownerElement=null;}h(nt,"Attr");nt.prototype.nodeType=vt;me(nt,W);function Et(e){pe(e);}h(Et,"CharacterData");Et.prototype={data:"",substringData:h(function(e,t){return this.data.substring(e,e+t)},"substringData"),appendData:h(function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length;},"appendData"),insertData:h(function(e,t){this.replaceData(e,0,t);},"insertData"),deleteData:h(function(e,t){this.replaceData(e,t,"");},"deleteData"),replaceData:h(function(e,t,r){var n=this.data.substring(0,e),o=this.data.substring(e+t);r=n+r+o,this.nodeValue=this.data=r,this.length=r.length;},"replaceData")};me(Et,W);function Jt(e){pe(e);}h(Jt,"Text");Jt.prototype={nodeName:"#text",nodeType:mr,splitText:h(function(e){var t=this.data,r=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(r);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n},"splitText")};me(Jt,Et);function vr(e){pe(e);}h(vr,"Comment");vr.prototype={nodeName:"#comment",nodeType:fn};me(vr,Et);function wr(e){pe(e);}h(wr,"CDATASection");wr.prototype={nodeName:"#cdata-section",nodeType:bi};me(wr,Jt);function yr(e){pe(e);}h(yr,"DocumentType");yr.prototype.nodeType=Ci;me(yr,W);function hn(e){pe(e);}h(hn,"Notation");hn.prototype.nodeType=Fs;me(hn,W);function dn(e){pe(e);}h(dn,"Entity");dn.prototype.nodeType=Bs;me(dn,W);function Er(e){pe(e);}h(Er,"EntityReference");Er.prototype.nodeType=Ni;me(Er,W);function Dt(e){pe(e);}h(Dt,"DocumentFragment");Dt.prototype.nodeName="#document-fragment";Dt.prototype.nodeType=Ve;me(Dt,W);function Dr(e){pe(e);}h(Dr,"ProcessingInstruction");Dr.prototype.nodeType=cn;me(Dr,Et);function Bi(){}h(Bi,"XMLSerializer");Bi.prototype.serializeToString=function(e,t){return Fi.call(e,t)};W.prototype.toString=Fi;function Fi(e){var t;typeof e=="function"?t={requireWellFormed:false,splitCDATASections:true,nodeFilter:e}:e!=null?t={requireWellFormed:!!e.requireWellFormed,splitCDATASections:e.splitCDATASections!==false,nodeFilter:e.nodeFilter||null}:t={requireWellFormed:false,splitCDATASections:true,nodeFilter:null};var r=[],n=this.nodeType===gt&&this.documentElement||this,o=n.prefix,i=n.namespaceURI;if(i&&o==null){var o=n.lookupPrefix(i);if(o==null)var a=[{namespace:i,prefix:null}];}return pn(this,r,a,t),r.join("")}h(Fi,"nodeSerializeToString");function Ei(e,t,r){var n=e.prefix||"",o=e.namespaceURI;if(!o||n==="xml"&&o===Me.XML||o===Me.XMLNS)return false;for(var i=r.length;i--;){var a=r[i];if(a.prefix===n)return a.namespace!==o}return true}h(Ei,"needNamespaceDefine");function dr(e,t,r){e.push(" ",t,'="',r.replace(/[<>&"\t\n\r]/g,Ii),'"');}h(dr,"addSerializedAttribute");function pn(e,t,r,n){r||(r=[]);var o=n.nodeFilter,i=n.requireWellFormed,a=n.splitCDATASections,s=e.nodeType===gt?e:e.ownerDocument,l=s.type==="html";fe(e,{ns:r},{enter:h(function(u,f){var c=f.ns;if(o)if(u=o(u),u){if(typeof u=="string")return t.push(u),null}else return null;switch(u.nodeType){case be:var d=u.attributes,p=d.length,g=u.tagName,m=g;if(!l&&!u.prefix&&u.namespaceURI){for(var b,y=0;y<d.length;y++)if(d.item(y).name==="xmlns"){b=d.item(y).value;break}if(!b)for(var w=c.length-1;w>=0;w--){var v=c[w];if(v.prefix===""&&v.namespace===u.namespaceURI){b=v.namespace;break}}if(b!==u.namespaceURI)for(var w=c.length-1;w>=0;w--){var v=c[w];if(v.namespace===u.namespaceURI){v.prefix&&(m=v.prefix+":"+g);break}}}t.push("<",m);for(var _=c.slice(),D=0;D<p;D++){var E=d.item(D);E.prefix=="xmlns"?_.push({prefix:E.localName,namespace:E.value}):E.nodeName=="xmlns"&&_.push({prefix:"",namespace:E.value});}for(var D=0;D<p;D++){var E=d.item(D);if(Ei(E,l,_)){var A=E.prefix||"",N=E.namespaceURI;dr(t,A?"xmlns:"+A:"xmlns",N),_.push({prefix:A,namespace:N});}var C=o?o(E):E;C&&(typeof C=="string"?t.push(C):dr(t,C.name,C.value));}if(g===m&&Ei(u,l,_)){var F=u.prefix||"",N=u.namespaceURI;dr(t,F?"xmlns:"+F:"xmlns",N),_.push({prefix:F,namespace:N});}var k=!u.firstChild;if(k&&(l||u.namespaceURI===Me.HTML)&&(k=Os(g)),k)return t.push("/>"),null;if(t.push(">"),l&&Is(g)){for(var R=u.firstChild;R;)R.data?t.push(R.data):pn(R,t,_.slice(),n),R=R.nextSibling;return t.push("</",m,">"),null}return {ns:_,tag:m};case gt:case Ve:if(i&&u.nodeType===gt&&u.documentElement==null)throw new S("The Document has no documentElement",Ae.InvalidStateError);return {ns:c};case vt:return dr(t,u.name,u.value),null;case mr:if(i&&ce.InvalidChar.test(u.data))throw new S("The Text node data contains characters outside the XML Char production",Ae.InvalidStateError);return t.push(u.data.replace(/[<&>]/g,Ii)),null;case bi:if(i&&u.data.indexOf("]]>")!==-1)throw new S('The CDATASection data contains "]]>"',Ae.InvalidStateError);return a?t.push(ce.CDATA_START,u.data.replace(/]]>/g,"]]]]><![CDATA[>"),ce.CDATA_END):t.push(ce.CDATA_START,u.data,ce.CDATA_END),null;case fn:if(i){if(ce.InvalidChar.test(u.data))throw new S("The comment node data contains characters outside the XML Char production",Ae.InvalidStateError);if(u.data.indexOf("--")!==-1||u.data[u.data.length-1]==="-")throw new S('The comment node data contains "--" or ends with "-"',Ae.InvalidStateError)}return t.push(ce.COMMENT_START,u.data,ce.COMMENT_END),null;case Ci:var j=u.publicId,O=u.systemId;if(i){if(j&&!ce.PubidLiteral_match.test(j))throw new S("DocumentType publicId is not a valid PubidLiteral",Ae.InvalidStateError);if(O&&O!=="."&&!ce.SystemLiteral_match.test(O))throw new S("DocumentType systemId is not a valid SystemLiteral",Ae.InvalidStateError);if(u.internalSubset&&u.internalSubset.indexOf("]>")!==-1)throw new S('DocumentType internalSubset contains "]>"',Ae.InvalidStateError)}return t.push(ce.DOCTYPE_DECL_START," ",u.name),j?(t.push(" ",ce.PUBLIC," ",j),O&&O!=="."&&t.push(" ",O)):O&&O!=="."&&t.push(" ",ce.SYSTEM," ",O),u.internalSubset&&t.push(" [",u.internalSubset,"]"),t.push(">"),null;case cn:if(i){if(u.target.indexOf(":")!==-1||u.target.toLowerCase()==="xml")throw new S("The ProcessingInstruction target is not well-formed",Ae.InvalidStateError);if(ce.InvalidChar.test(u.data))throw new S("The ProcessingInstruction data contains characters outside the XML Char production",Ae.InvalidStateError);if(u.data.indexOf("?>")!==-1)throw new S('The ProcessingInstruction data contains "?>"',Ae.InvalidStateError)}return t.push("<?",u.target," ",u.data,"?>"),null;case Ni:return t.push("&",u.nodeName,";"),null;default:return t.push("??",u.nodeName),null}},"enter"),exit:h(function(u,f){f&&f.tag&&t.push("</",f.tag,">");},"exit")});}h(pn,"serializeToString");function Ws(e,t,r){var n;return fe(t,null,{enter:h(function(o,i){var a=o.cloneNode(false);a.ownerDocument=e,a.parentNode=null,i===null?n=a:i.appendChild(a);var s=o.nodeType===vt||r;return s?a:null},"enter")}),n}h(Ws,"importNode");function Li(e,t,r){var n;return fe(t,null,{enter:h(function(o,i){var a=new o.constructor(de);for(var s in o)if(_t(o,s)){var l=o[s];typeof l!="object"&&l!=a[s]&&(a[s]=l);}o.childNodes&&(a.childNodes=new ae),a.ownerDocument=e;var u=r;switch(a.nodeType){case be:var f=o.attributes,c=a.attributes=new wt,d=f.length;c._ownerElement=a;for(var p=0;p<d;p++)a.setAttributeNode(Li(e,f.item(p),true));break;case vt:u=true;}return i!==null?i.appendChild(a):n=a,u?a:null},"enter")}),n}h(Li,"cloneNode");function $i(e,t,r){e[t]=r;}h($i,"__set__");function un(e){for(var t=[],r=e.firstChild;r;)r.nodeType===be&&t.push(r),r=r.nextSibling;return t}h(un,"childrenRefresh");try{Object.defineProperty&&(Object.defineProperty(ke.prototype,"length",{get:h(function(){return _r(this),this.$$length},"get")}),Object.defineProperty(W.prototype,"textContent",{get:h(function(){if(this.nodeType===be||this.nodeType===Ve){var e=[];return fe(this,null,{enter:h(function(t){if(t.nodeType===be||t.nodeType===Ve)return !0;if(t.nodeType===cn||t.nodeType===fn)return null;e.push(t.nodeValue);},"enter")}),e.join("")}return this.nodeValue},"get"),set:h(function(e){switch(this.nodeType){case be:case Ve:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e;}},"set")}),Object.defineProperty(qe.prototype,"children",{get:h(function(){return new ke(this,un)},"get")}),Object.defineProperty(Ue.prototype,"children",{get:h(function(){return new ke(this,un)},"get")}),Object.defineProperty(Dt.prototype,"children",{get:h(function(){return new ke(this,un)},"get")}),$i=h(function(e,t,r){e["$$"+t]=r;},"__set__"));}catch{}ne._updateLiveList=_r;ne.Attr=nt;ne.CDATASection=wr;ne.CharacterData=Et;ne.Comment=vr;ne.Document=Ue;ne.DocumentFragment=Dt;ne.DocumentType=yr;ne.DOMImplementation=Si;ne.Element=qe;ne.Entity=dn;ne.EntityReference=Er;ne.LiveNodeList=ke;ne.NamedNodeMap=wt;ne.Node=W;ne.NodeList=ae;ne.Notation=hn;ne.Text=Jt;ne.ProcessingInstruction=Dr;ne.walkDOM=fe;ne.XMLSerializer=Bi;});var qi=Se(Zt=>{var Ui=rt().freeze;Zt.XML_ENTITIES=Ui({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});Zt.HTML_ENTITIES=Ui({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
|
|
2
|
-
`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"});Zt.entityMap=Zt.HTML_ENTITIES;});var Zi=Se(br=>{var Ct=rt(),$=sn(),Vi=Wt(),Hs=Ct.isHTMLEscapableRawTextElement,Vs=Ct.isHTMLMimeType,Gs=Ct.isHTMLRawTextElement,rr=Ct.hasOwn,zi=Ct.NAMESPACE,ji=Vi.ParseError,Xs=Vi.DOMException,Kt=0,Xe=1,At=2,er=3,bt=4,Nt=5,tr=6,Ar=7;function Gi(){}h(Gi,"XMLReader");Gi.prototype={parse:h(function(e,t,r){var n=this.domBuilder;n.startDocument(),Xi(t,t=Object.create(null)),Ys(e,t,r,n,this.errorHandler),n.endDocument();},"parse")};var gn=/&#?\w+;?/g;function Ys(e,t,r,n,o){var i=Vs(n.mimeType);e.indexOf($.UNICODE_REPLACEMENT_CHARACTER)>=0&&o.warning("Unicode replacement character detected, source encoding issues?");function a(I){if(I>65535){I-=65536;var Z=55296+(I>>10),ie=56320+(I&1023);return String.fromCharCode(Z,ie)}else return String.fromCharCode(I)}h(a,"fixedFromCharCode");function s(I){var Z=I[I.length-1]===";"?I:I+";";if(!i&&Z!==I)return o.error("EntityRef: expecting ;"),I;var ie=$.Reference.exec(Z);if(!ie||ie[0].length!==Z.length)return o.error("entity not matching Reference production: "+I),I;var oe=Z.slice(1,-1);return rr(r,oe)?r[oe]:oe.charAt(0)==="#"?a(parseInt(oe.substring(1).replace("x","0x"))):(o.error("entity not found:"+I),I)}h(s,"entityReplacer");function l(I){if(I>b){var Z=e.substring(b,I).replace(gn,s);d&&p(b),n.characters(Z,0,I-b),b=I;}}h(l,"appendText");var u=0,f=0,c=/\r\n?|\n|$/g,d=n.locator;function p(I,Z){for(;I>=f&&(Z=c.exec(e));)u=f,f=Z.index+Z[0].length,d.lineNumber++;d.columnNumber=I-u+1;}h(p,"position");for(var g=[{currentNSMap:t}],m=[],b=0;;){try{var y=e.indexOf("<",b);if(y<0){if(!i&&m.length>0)return o.fatalError("unclosed xml tag(s): "+m.join(", "));if(!e.substring(b).match(/^\s*$/)){var w=n.doc,v=w.createTextNode(e.substring(b));if(w.documentElement)return o.error("Extra content at the end of the document");w.appendChild(v),n.currentElement=v;}return}if(y>b){var _=e.substring(b,y);!i&&m.length===0&&(_=_.replace(new RegExp($.S_OPT.source,"g"),""),_&&o.error("Unexpected content outside root element: '"+_+"'")),l(y);}switch(e.charAt(y+1)){case "/":var O=e.indexOf(">",y+2),D=e.substring(y+2,O>0?O:void 0);if(!D)return o.fatalError("end tag name missing");var E=O>0&&$.reg("^",$.QName_group,$.S_OPT,"$").exec(D);if(!E)return o.fatalError('end tag name contains invalid characters: "'+D+'"');if(!n.currentElement&&!n.doc.documentElement)return;var A=m[m.length-1]||n.currentElement.tagName||n.doc.documentElement.tagName||"";if(A!==E[1]){var N=E[1].toLowerCase();if(!i||A.toLowerCase()!==N)return o.fatalError('Opening and ending tag mismatch: "'+A+'" != "'+D+'"')}var C=g.pop();m.pop();var F=C.localNSMap;if(n.endElement(C.uri,C.localName,A),F)for(var k in F)rr(F,k)&&n.endPrefixMapping(k);O++;break;case "?":d&&p(y),O=Ks(e,y,n,o);break;case "!":d&&p(y),O=Qi(e,y,n,o,i);break;default:d&&p(y);var R=new Ji,j=g[g.length-1].currentNSMap,O=Qs(e,y,R,j,s,o,i),G=R.length;if(R.closed||(i&&Ct.isHTMLVoidElement(R.tagName)?R.closed=!0:m.push(R.tagName)),d&&G){for(var z=Wi(d,{}),L=0;L<G;L++){var Y=R[L];p(Y.offset),Y.locator=Wi(d,{});}n.locator=z,Hi(R,n,j)&&g.push(R),n.locator=d;}else Hi(R,n,j)&&g.push(R);i&&!R.closed?O=Js(e,O,R.tagName,s,n):O++;}}catch(I){if(I instanceof ji)throw I;if(I instanceof Xs)throw new ji(I.name+": "+I.message,n.locator,I);o.error("element parse error: "+I),O=-1;}O>b?b=O:l(Math.max(y,b)+1);}}h(Ys,"parse");function Wi(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}h(Wi,"copyLocator");function Qs(e,t,r,n,o,i,a){function s(p,g,m){if(rr(r.attributeNames,p))return i.fatalError("Attribute "+p+" redefined");if(!a&&g.indexOf("<")>=0)return i.fatalError("Unescaped '<' not allowed in attributes values");r.addValue(p,g.replace(/[\t\n\r]/g," ").replace(gn,o),m);}h(s,"addAttribute");for(var l,u,f=++t,c=Kt;;){var d=e.charAt(f);switch(d){case "=":if(c===Xe)l=e.slice(t,f),c=er;else if(c===At)c=er;else throw new Error("attribute equal must after attrName");break;case "'":case '"':if(c===er||c===Xe)if(c===Xe&&(i.warning('attribute value must after "="'),l=e.slice(t,f)),t=f+1,f=e.indexOf(d,t),f>0)u=e.slice(t,f),s(l,u,t-1),c=Nt;else throw new Error("attribute value no end '"+d+"' match");else if(c==bt)u=e.slice(t,f),s(l,u,t),i.warning('attribute "'+l+'" missed start quot('+d+")!!"),t=f+1,c=Nt;else throw new Error('attribute value must after "="');break;case "/":switch(c){case Kt:r.setTagName(e.slice(t,f));case Nt:case tr:case Ar:c=Ar,r.closed=true;case bt:case Xe:break;case At:r.closed=true;break;default:throw new Error("attribute invalid close char('/')")}break;case "":return i.error("unexpected end of input"),c==Kt&&r.setTagName(e.slice(t,f)),f;case ">":switch(c){case Kt:r.setTagName(e.slice(t,f));case Nt:case tr:case Ar:break;case bt:case Xe:u=e.slice(t,f),u.slice(-1)==="/"&&(r.closed=true,u=u.slice(0,-1));case At:c===At&&(u=l),c==bt?(i.warning('attribute "'+u+'" missed quot(")!'),s(l,u,t)):(a||i.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),s(u,u,t));break;case er:if(!a)return i.fatalError(`AttValue: ' or " expected`)}return f;case "\x80":d=" ";default:if(d<=" ")switch(c){case Kt:r.setTagName(e.slice(t,f)),c=tr;break;case Xe:l=e.slice(t,f),c=At;break;case bt:var u=e.slice(t,f);i.warning('attribute "'+u+'" missed quot(")!!'),s(l,u,t);case Nt:c=tr;break}else switch(c){case At:a||i.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),s(l,l,t),t=f,c=Xe;break;case Nt:i.warning('attribute space is required"'+l+'"!!');case tr:c=Xe,t=f;break;case er:c=bt,t=f;break;case Ar:throw new Error("elements closed character '/' and '>' must be connected to")}}f++;}}h(Qs,"parseElementStartPart");function Hi(e,t,r){for(var n=e.tagName,o=null,c=e.length;c--;){var i=e[c],a=i.qName,s=i.value,d=a.indexOf(":");if(d>0)var l=i.prefix=a.slice(0,d),u=a.slice(d+1),f=l==="xmlns"&&u;else u=a,l=null,f=a==="xmlns"&&"";i.localName=u,f!==false&&(o==null&&(o=Object.create(null),Xi(r,r=Object.create(null))),r[f]=o[f]=s,i.uri=zi.XMLNS,t.startPrefixMapping(f,s));}for(var c=e.length;c--;)i=e[c],i.prefix&&(i.prefix==="xml"&&(i.uri=zi.XML),i.prefix!=="xmlns"&&(i.uri=r[i.prefix]));var d=n.indexOf(":");d>0?(l=e.prefix=n.slice(0,d),u=e.localName=n.slice(d+1)):(l=null,u=e.localName=n);var p=e.uri=r[l||""];if(t.startElement(p,u,n,e),e.closed){if(t.endElement(p,u,n),o)for(l in o)rr(o,l)&&t.endPrefixMapping(l);}else return e.currentNSMap=r,e.localNSMap=o,true}h(Hi,"appendElement");function Js(e,t,r,n,o){var i=Hs(r);if(i||Gs(r)){var a=e.indexOf("</"+r+">",t),s=e.substring(t+1,a);return i&&(s=s.replace(gn,n)),o.characters(s,0,s.length),a}return t+1}h(Js,"parseHtmlSpecialContent");function Xi(e,t){for(var r in e)rr(e,r)&&(t[r]=e[r]);}h(Xi,"_copy");function Yi(e,t){var r=t;function n(f){return f=f||0,e.charAt(r+f)}h(n,"char");function o(f){f=f||1,r+=f;}h(o,"skip");function i(){for(var f=0;r<e.length;){var c=n();if(c!==" "&&c!==`
|
|
3
|
-
`&&c!==" "&&c!=="\r")return f;f++,
|
|
1
|
+
'use strict';var n8nWorkflow=require('n8n-workflow');var Wa=Object.create;var $r=Object.defineProperty;var Ha=Object.getOwnPropertyDescriptor;var Va=Object.getOwnPropertyNames;var Ga=Object.getPrototypeOf,Xa=Object.prototype.hasOwnProperty;var h=(e,t)=>$r(e,"name",{value:t,configurable:true});var Ie=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ya=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Va(t))!Xa.call(e,a)&&a!==r&&$r(e,a,{get:()=>t[a],enumerable:!(n=Ha(t,a))||n.enumerable});return e};var Ur=(e,t,r)=>(r=e!=null?Wa(Ga(e)):{},Ya($r(r,"default",{value:e,enumerable:true}),e));var Ln=Ie((Fl,Fn)=>{Fn.exports={createRequire:h(function(){return function(){return {}}},"createRequire")};});var rt=Ie(le=>{function Do(e,t,r){if(r===void 0&&(r=Array.prototype),e&&typeof r.find=="function")return r.find.call(e,t);for(var n=0;n<e.length;n++)if(tt(e,n)){var a=e[n];if(t.call(void 0,a,n,e))return a}}h(Do,"find");function ht(e,t){return t===void 0&&(t=Object),t&&typeof t.getOwnPropertyDescriptors=="function"&&(e=t.create(null,t.getOwnPropertyDescriptors(e))),t&&typeof t.freeze=="function"?t.freeze(e):e}h(ht,"freeze");function tt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}h(tt,"hasOwn");function bo(e,t){if(e===null||typeof e!="object")throw new TypeError("target is not an object");for(var r in t)tt(t,r)&&(e[r]=t[r]);return e}h(bo,"assign");var ei=ht({allowfullscreen:true,async:true,autofocus:true,autoplay:true,checked:true,controls:true,default:true,defer:true,disabled:true,formnovalidate:true,hidden:true,ismap:true,itemscope:true,loop:true,multiple:true,muted:true,nomodule:true,novalidate:true,open:true,playsinline:true,readonly:true,required:true,reversed:true,selected:true});function Ao(e){return tt(ei,e.toLowerCase())}h(Ao,"isHTMLBooleanAttribute");var ti=ht({area:true,base:true,br:true,col:true,embed:true,hr:true,img:true,input:true,link:true,meta:true,param:true,source:true,track:true,wbr:true});function No(e){return tt(ti,e.toLowerCase())}h(No,"isHTMLVoidElement");var Lt=ht({script:false,style:false,textarea:true,title:true});function Co(e){var t=e.toLowerCase();return tt(Lt,t)&&!Lt[t]}h(Co,"isHTMLRawTextElement");function To(e){var t=e.toLowerCase();return tt(Lt,t)&&Lt[t]}h(To,"isHTMLEscapableRawTextElement");function ri(e){return e===$t.HTML}h(ri,"isHTMLMimeType");function xo(e){return ri(e)||e===$t.XML_XHTML_APPLICATION}h(xo,"hasDefaultHTMLNamespace");var $t=ht({HTML:"text/html",XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),So=Object.keys($t).map(function(e){return $t[e]});function Io(e){return So.indexOf(e)>-1}h(Io,"isValidMimeType");var ko=ht({HTML:"http://www.w3.org/1999/xhtml",SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});le.assign=bo;le.find=Do;le.freeze=ht;le.HTML_BOOLEAN_ATTRIBUTES=ei;le.HTML_RAW_TEXT_ELEMENTS=Lt;le.HTML_VOID_ELEMENTS=ti;le.hasDefaultHTMLNamespace=xo;le.hasOwn=tt;le.isHTMLBooleanAttribute=Ao;le.isHTMLRawTextElement=Co;le.isHTMLEscapableRawTextElement=To;le.isHTMLMimeType=ri;le.isHTMLVoidElement=No;le.isValidMimeType=Io;le.MIME_TYPE=$t;le.NAMESPACE=ko;});var Wt=Ie(jt=>{var Po=rt();function ii(e,t){e.prototype=Object.create(Error.prototype,{constructor:{value:e},name:{value:e.name,enumerable:true,writable:t}});}h(ii,"extendError");var qt=Po.freeze({Error:"Error",IndexSizeError:"IndexSizeError",DomstringSizeError:"DomstringSizeError",HierarchyRequestError:"HierarchyRequestError",WrongDocumentError:"WrongDocumentError",InvalidCharacterError:"InvalidCharacterError",NoDataAllowedError:"NoDataAllowedError",NoModificationAllowedError:"NoModificationAllowedError",NotFoundError:"NotFoundError",NotSupportedError:"NotSupportedError",InUseAttributeError:"InUseAttributeError",InvalidStateError:"InvalidStateError",SyntaxError:"SyntaxError",InvalidModificationError:"InvalidModificationError",NamespaceError:"NamespaceError",InvalidAccessError:"InvalidAccessError",ValidationError:"ValidationError",TypeMismatchError:"TypeMismatchError",SecurityError:"SecurityError",NetworkError:"NetworkError",AbortError:"AbortError",URLMismatchError:"URLMismatchError",QuotaExceededError:"QuotaExceededError",TimeoutError:"TimeoutError",InvalidNodeTypeError:"InvalidNodeTypeError",DataCloneError:"DataCloneError",EncodingError:"EncodingError",NotReadableError:"NotReadableError",UnknownError:"UnknownError",ConstraintError:"ConstraintError",DataError:"DataError",TransactionInactiveError:"TransactionInactiveError",ReadOnlyError:"ReadOnlyError",VersionError:"VersionError",OperationError:"OperationError",NotAllowedError:"NotAllowedError",OptOutError:"OptOutError"}),ai=Object.keys(qt);function oi(e){return typeof e=="number"&&e>=1&&e<=25}h(oi,"isValidDomExceptionCode");function Oo(e){return typeof e=="string"&&e.substring(e.length-qt.Error.length)===qt.Error}h(Oo,"endsWithError");function zt(e,t){oi(e)?(this.name=ai[e],this.message=t||""):(this.message=e,this.name=Oo(t)?t:qt.Error),Error.captureStackTrace&&Error.captureStackTrace(this,zt);}h(zt,"DOMException");ii(zt,true);Object.defineProperties(zt.prototype,{code:{enumerable:true,get:h(function(){var e=ai.indexOf(this.name);return oi(e)?e:0},"get")}});var si={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25},en=Object.entries(si);for(Ut=0;Ut<en.length;Ut++)ni=en[Ut][0],zt[ni]=en[Ut][1];var ni,Ut;function tn(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,tn);}h(tn,"ParseError");ii(tn);jt.DOMException=zt;jt.DOMExceptionName=qt;jt.ExceptionCode=si;jt.ParseError=tn;});var ln=Ie(L=>{function pi(e){try{typeof e!="function"&&(e=RegExp);var t=new e("\u{1D306}","u").exec("\u{1D306}");return !!t&&t[0].length===2}catch{}return false}h(pi,"detectUnicodeSupport");var mt=pi();function We(e){if(e.source[0]!=="[")throw new Error(e+" can not be used with chars");return e.source.slice(1,e.source.lastIndexOf("]"))}h(We,"chars");function dt(e,t){if(e.source[0]!=="[")throw new Error("/"+e.source+"/ can not be used with chars_without");if(!t||typeof t!="string")throw new Error(JSON.stringify(t)+" is not a valid search");if(e.source.indexOf(t)===-1)throw new Error('"'+t+'" is not is /'+e.source+"/");if(t==="-"&&e.source.indexOf(t)!==1)throw new Error('"'+t+'" is not at the first postion of /'+e.source+"/");return new RegExp(e.source.replace(t,""),mt?"u":"")}h(dt,"chars_without");function W(e){var t=this;return new RegExp(Array.prototype.slice.call(arguments).map(function(r){var n=typeof r=="string";if(n&&t===void 0&&r==="|")throw new Error("use regg instead of reg to wrap expressions with `|`!");return n?r:r.source}).join(""),mt?"mu":"m")}h(W,"reg");function F(e){if(arguments.length===0)throw new Error("no parameters provided");return W.apply(F,["(?:"].concat(Array.prototype.slice.call(arguments),[")"]))}h(F,"regg");var Mo="\uFFFD",He=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;mt&&(He=W("[",We(He),"\\u{10000}-\\u{10FFFF}","]"));var Ro=new RegExp("[^"+We(He)+"]",mt?"u":""),nn=/[\x20\x09\x0D\x0A]/,Bo=We(nn),Y=W(nn,"+"),ee=W(nn,"*"),Ht=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;mt&&(Ht=W("[",We(Ht),"\\u{10000}-\\u{10FFFF}","]"));var Fo=We(Ht),an=W("[",Fo,We(/[-.0-9\xB7]/),We(/[\u0300-\u036F\u203F-\u2040]/),"]"),be=W(Ht,an,"*"),ui=W(an,"+"),Lo=W("&",be,";"),$o=F(/&#[0-9]+;|&#x[0-9a-fA-F]+;/),Vt=F(Lo,"|",$o),Gt=W("%",be,";"),on=F(W('"',F(/[^%&"]/,"|",Gt,"|",Vt),"*",'"'),"|",W("'",F(/[^%&']/,"|",Gt,"|",Vt),"*","'")),Uo=F('"',F(/[^<&"]/,"|",Vt),"*",'"',"|","'",F(/[^<&']/,"|",Vt),"*","'"),qo=dt(Ht,":"),zo=dt(an,":"),li=W(qo,zo,"*"),Xt=W(li,F(":",li),"?"),jo=W("^",Xt,"$"),Wo=W("(",Xt,")"),pt=F(/"[^"]*"|'[^']*'/),Ho=W(/^<\?/,"(",be,")",F(Y,"(",He,"*?)"),"?",/\?>/),ci=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,Yt=F('"',ci,'*"',"|","'",dt(ci,"'"),"*'"),mi="<!--",gi="-->",Vo=W(mi,F(dt(He,"-"),"|",W("-",dt(He,"-"))),"*",gi),fi="#PCDATA",Go=F(W(/\(/,ee,fi,F(ee,/\|/,ee,Xt),"*",ee,/\)\*/),"|",W(/\(/,ee,fi,ee,/\)/)),Xo=/[?*+]?/,Yo=W(/\([^>]+\)/,Xo),Qo=F("EMPTY","|","ANY","|",Go,"|",Yo),Jo="<!ELEMENT",Zo=W(Jo,Y,F(Xt,"|",Gt),Y,F(Qo,"|",Gt),ee,">"),Ko=W("NOTATION",Y,/\(/,ee,be,F(ee,/\|/,ee,be),"*",ee,/\)/),es=W(/\(/,ee,ui,F(ee,/\|/,ee,ui),"*",ee,/\)/),ts=F(Ko,"|",es),rs=F(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,"|",ts),ns=F(/#REQUIRED|#IMPLIED/,"|",F(F("#FIXED",Y),"?",Uo)),is=F(Y,be,Y,rs,Y,ns),as="<!ATTLIST",os=W(as,Y,be,is,"*",ee,">"),rn="about:legacy-compat",ss=F('"'+rn+'"',"|","'"+rn+"'"),sn="SYSTEM",dr="PUBLIC",pr=F(F(sn,Y,pt),"|",F(dr,Y,Yt,Y,pt)),us=W("^",F(F(sn,Y,"(?<SystemLiteralOnly>",pt,")"),"|",F(dr,Y,"(?<PubidLiteral>",Yt,")",Y,"(?<SystemLiteral>",pt,")"))),ls=W("^",Yt,"$"),cs=W("^",pt,"$"),fs=F(Y,"NDATA",Y,be),hs=F(on,"|",F(pr,fs,"?")),_i="<!ENTITY",ds=W(_i,Y,be,Y,hs,ee,">"),ps=F(on,"|",pr),ms=W(_i,Y,"%",Y,be,Y,ps,ee,">"),gs=F(ds,"|",ms),_s=W(dr,Y,Yt),vs=W("<!NOTATION",Y,be,Y,F(pr,"|",_s),ee,">"),un=W(ee,"=",ee),hi=/1[.]\d+/,ws=W(Y,"version",un,F("'",hi,"'","|",'"',hi,'"')),di=/[A-Za-z][-A-Za-z0-9._]*/,ys=F(Y,"encoding",un,F('"',di,'"',"|","'",di,"'")),Es=F(Y,"standalone",un,F("'",F("yes","|","no"),"'","|",'"',F("yes","|","no"),'"')),Ds=W(/^<\?xml/,ws,ys,"?",Es,"?",ee,/\?>/),bs="<!DOCTYPE",As="<![CDATA[",Ns="]]>",Cs=/<!\[CDATA\[/,Ts=/\]\]>/,xs=W(He,"*?",Ts),Ss=W(Cs,xs);L.chars=We;L.chars_without=dt;L.detectUnicodeSupport=pi;L.reg=W;L.regg=F;L.ABOUT_LEGACY_COMPAT=rn;L.ABOUT_LEGACY_COMPAT_SystemLiteral=ss;L.AttlistDecl=os;L.CDATA_START=As;L.CDATA_END=Ns;L.CDSect=Ss;L.Char=He;L.Comment=Vo;L.COMMENT_START=mi;L.COMMENT_END=gi;L.DOCTYPE_DECL_START=bs;L.elementdecl=Zo;L.EntityDecl=gs;L.EntityValue=on;L.ExternalID=pr;L.ExternalID_match=us;L.Name=be;L.NotationDecl=vs;L.Reference=Vt;L.PEReference=Gt;L.PI=Ho;L.PUBLIC=dr;L.PubidLiteral=Yt;L.PubidLiteral_match=ls;L.QName=Xt;L.QName_exact=jo;L.QName_group=Wo;L.S=Y;L.SChar_s=Bo;L.S_OPT=ee;L.SYSTEM=sn;L.SystemLiteral=pt;L.SystemLiteral_match=cs;L.InvalidChar=Ro;L.UNICODE_REPLACEMENT_CHARACTER=Mo;L.UNICODE_SUPPORT=mt;L.XMLDecl=Ds;});var _n=Ie(ie=>{var Ce=rt(),Me=Ce.find,Is=Ce.hasDefaultHTMLNamespace,_t=Ce.hasOwn,ks=Ce.isHTMLMimeType,Ps=Ce.isHTMLRawTextElement,Os=Ce.isHTMLVoidElement,Qt=Ce.MIME_TYPE,Re=Ce.NAMESPACE,de=Symbol(),Ai=Wt(),k=Ai.DOMException,Ae=Ai.DOMExceptionName,ce=ln();function me(e){if(e!==de)throw new TypeError("Illegal constructor")}h(me,"checkSymbol");function Ms(e){return e!==""}h(Ms,"notEmptyString");function Rs(e){return e?e.split(/[\t\n\f\r ]+/).filter(Ms):[]}h(Rs,"splitOnASCIIWhitespace");function Bs(e,t){return _t(e,t)||(e[t]=true),e}h(Bs,"orderedSetReducer");function vi(e){if(!e)return [];var t=Rs(e);return Object.keys(t.reduce(Bs,{}))}h(vi,"toOrderedSet");function Fs(e){return function(t){return e&&e.indexOf(t)!==-1}}h(Fs,"arrayIncludes");function Ni(e){if(!ce.QName_exact.test(e))throw new k(k.INVALID_CHARACTER_ERR,'invalid character in qualified name "'+e+'"')}h(Ni,"validateQualifiedName");function fn(e,t){Ni(t),e=e||null;var r=null,n=t;if(t.indexOf(":")>=0){var a=t.split(":");r=a[0],n=a[1];}if(r!==null&&e===null)throw new k(k.NAMESPACE_ERR,"prefix is non-null and namespace is null");if(r==="xml"&&e!==Ce.NAMESPACE.XML)throw new k(k.NAMESPACE_ERR,'prefix is "xml" and namespace is not the XML namespace');if((r==="xmlns"||t==="xmlns")&&e!==Ce.NAMESPACE.XMLNS)throw new k(k.NAMESPACE_ERR,'either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace');if(e===Ce.NAMESPACE.XMLNS&&r!=="xmlns"&&t!=="xmlns")throw new k(k.NAMESPACE_ERR,'namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"');return [e,r,n]}h(fn,"validateAndExtract");function yt(e,t){for(var r in e)_t(e,r)&&(t[r]=e[r]);}h(yt,"copy");function ge(e,t){var r=e.prototype;if(!(r instanceof t)){let n=function(){};h(n,"t"),n.prototype=t.prototype,n=new n,yt(r,n),e.prototype=r=n;}r.constructor!=e&&(r.constructor=e);}h(ge,"_extends");var _e={},Ne=_e.ELEMENT_NODE=1,vt=_e.ATTRIBUTE_NODE=2,_r=_e.TEXT_NODE=3,Ci=_e.CDATA_SECTION_NODE=4,Ti=_e.ENTITY_REFERENCE_NODE=5,Ls=_e.ENTITY_NODE=6,hn=_e.PROCESSING_INSTRUCTION_NODE=7,dn=_e.COMMENT_NODE=8,gt=_e.DOCUMENT_NODE=9,xi=_e.DOCUMENT_TYPE_NODE=10,Ve=_e.DOCUMENT_FRAGMENT_NODE=11,$s=_e.NOTATION_NODE=12,ne=Ce.freeze({DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32});function Si(e,t){if(t.length<e.length)return Si(t,e);var r=null;for(var n in e){if(e[n]!==t[n])return r;r=e[n];}return r}h(Si,"commonAncestor");function wi(e){return e.guid||(e.guid=Math.random()),e.guid}h(wi,"docGUID");function oe(){}h(oe,"NodeList");oe.prototype={length:0,item:h(function(e){return e>=0&&e<this.length?this[e]:null},"item"),toString:h(function(e){var t;typeof e=="function"?t={requireWellFormed:false,splitCDATASections:true,nodeFilter:e}:e?t={requireWellFormed:!!e.requireWellFormed,splitCDATASections:e.splitCDATASections!==false,nodeFilter:e.nodeFilter||null}:t={requireWellFormed:false,splitCDATASections:true,nodeFilter:null};for(var r=[],n=0;n<this.length;n++)gn(this[n],r,null,t);return r.join("")},"toString"),filter:h(function(e){return Array.prototype.filter.call(this,e)},"filter"),indexOf:h(function(e){return Array.prototype.indexOf.call(this,e)},"indexOf")};oe.prototype[Symbol.iterator]=function(){var e=this,t=0;return {next:h(function(){return t<e.length?{value:e[t++],done:false}:{done:true}},"next"),return:h(function(){return {done:true}},"return")}};function Oe(e,t){this._node=e,this._refresh=t,wr(this);}h(Oe,"LiveNodeList");function wr(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var r=e._refresh(e._node);if(qi(e,"length",r.length),!e.$$length||r.length<e.$$length)for(var n=r.length;n in e;n++)_t(e,n)&&delete e[n];yt(r,e),e._inc=t;}}h(wr,"_updateLiveList");Oe.prototype.item=function(e){return wr(this),this[e]||null};ge(Oe,oe);function wt(){}h(wt,"NamedNodeMap");function Ii(e,t){for(var r=0;r<e.length;){if(e[r]===t)return r;r++;}}h(Ii,"_findNodeIndex");function Us(e,t,r,n){if(n?t[Ii(t,n)]=r:(t[t.length]=r,t.length++),e){r.ownerElement=e;var a=e.ownerDocument;a&&(n&&Oi(a,e,n),qs(a,e,r));}}h(Us,"_addNamedNode");function yi(e,t,r){var n=Ii(t,r);if(n>=0){for(var a=t.length-1;n<=a;)t[n]=t[++n];if(t.length=a,e){var i=e.ownerDocument;i&&Oi(i,e,r),r.ownerElement=null;}}}h(yi,"_removeNamedNode");wt.prototype={length:0,item:oe.prototype.item,getNamedItem:h(function(e){this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase());for(var t=0;t<this.length;){var r=this[t];if(r.nodeName===e)return r;t++;}return null},"getNamedItem"),setNamedItem:h(function(e){var t=e.ownerElement;if(t&&t!==this._ownerElement)throw new k(k.INUSE_ATTRIBUTE_ERR);var r=this.getNamedItemNS(e.namespaceURI,e.localName);return r===e?e:(Us(this._ownerElement,this,e,r),r)},"setNamedItem"),setNamedItemNS:h(function(e){return this.setNamedItem(e)},"setNamedItemNS"),removeNamedItem:h(function(e){var t=this.getNamedItem(e);if(!t)throw new k(k.NOT_FOUND_ERR,e);return yi(this._ownerElement,this,t),t},"removeNamedItem"),removeNamedItemNS:h(function(e,t){var r=this.getNamedItemNS(e,t);if(!r)throw new k(k.NOT_FOUND_ERR,e?e+" : "+t:t);return yi(this._ownerElement,this,r),r},"removeNamedItemNS"),getNamedItemNS:h(function(e,t){e||(e=null);for(var r=0;r<this.length;){var n=this[r];if(n.localName===t&&n.namespaceURI===e)return n;r++;}return null},"getNamedItemNS")};wt.prototype[Symbol.iterator]=function(){var e=this,t=0;return {next:h(function(){return t<e.length?{value:e[t++],done:false}:{done:true}},"next"),return:h(function(){return {done:true}},"return")}};function ki(){}h(ki,"DOMImplementation");ki.prototype={hasFeature:h(function(e,t){return true},"hasFeature"),createDocument:h(function(e,t,r){var n=Qt.XML_APPLICATION;e===Re.HTML?n=Qt.XML_XHTML_APPLICATION:e===Re.SVG&&(n=Qt.XML_SVG_IMAGE);var a=new qe(de,{contentType:n});if(a.implementation=this,a.childNodes=new oe,a.doctype=r||null,r&&a.appendChild(r),t){var i=a.createElementNS(e,t);a.appendChild(i);}return a},"createDocument"),createDocumentType:h(function(e,t,r,n){Ni(e);var a=new Dr(de);return a.name=e,a.nodeName=e,a.publicId=t||"",a.systemId=r||"",a.internalSubset=n||"",a.childNodes=new oe,a},"createDocumentType"),createHTMLDocument:h(function(e){var t=new qe(de,{contentType:Qt.HTML});if(t.implementation=this,t.childNodes=new oe,e!==false){t.doctype=this.createDocumentType("html"),t.doctype.ownerDocument=t,t.appendChild(t.doctype);var r=t.createElement("html");t.appendChild(r);var n=t.createElement("head");if(r.appendChild(n),typeof e=="string"){var a=t.createElement("title");a.appendChild(t.createTextNode(e)),n.appendChild(a);}r.appendChild(t.createElement("body"));}return t},"createHTMLDocument")};function H(e){me(e);}h(H,"Node");H.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,parentNode:null,get parentElement(){return this.parentNode&&this.parentNode.nodeType===this.ELEMENT_NODE?this.parentNode:null},childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,baseURI:"about:blank",get isConnected(){var e=this.getRootNode();return e&&e.nodeType===e.DOCUMENT_NODE},contains:h(function(e){if(!e)return false;var t=e;do{if(this===t)return true;t=t.parentNode;}while(t);return false},"contains"),getRootNode:h(function(e){var t=this;do{if(!t.parentNode)return t;t=t.parentNode;}while(t)},"getRootNode"),isEqualNode:h(function(e){if(!e)return false;for(var t=[{node:this,other:e}];t.length>0;){var r=t.pop(),n=r.node,a=r.other;if(n.nodeType!==a.nodeType)return false;switch(n.nodeType){case n.DOCUMENT_TYPE_NODE:if(n.name!==a.name||n.publicId!==a.publicId||n.systemId!==a.systemId)return false;break;case n.ELEMENT_NODE:if(n.namespaceURI!==a.namespaceURI||n.prefix!==a.prefix||n.localName!==a.localName||n.attributes.length!==a.attributes.length)return false;for(var i=0;i<n.attributes.length;i++){var o=n.attributes.item(i),u=a.getAttributeNodeNS(o.namespaceURI,o.localName);if(!u)return false;t.push({node:o,other:u});}break;case n.ATTRIBUTE_NODE:if(n.namespaceURI!==a.namespaceURI||n.localName!==a.localName||n.value!==a.value)return false;break;case n.PROCESSING_INSTRUCTION_NODE:if(n.target!==a.target||n.data!==a.data)return false;break;case n.TEXT_NODE:case n.CDATA_SECTION_NODE:case n.COMMENT_NODE:if(n.data!==a.data)return false;break}if(n.childNodes.length!==a.childNodes.length)return false;for(var i=n.childNodes.length-1;i>=0;i--)t.push({node:n.childNodes[i],other:a.childNodes[i]});}return true},"isEqualNode"),isSameNode:h(function(e){return this===e},"isSameNode"),insertBefore:h(function(e,t){return vr(this,e,t)},"insertBefore"),replaceChild:h(function(e,t){vr(this,e,t,Fi),t&&this.removeChild(t);},"replaceChild"),removeChild:h(function(e){return Ri(this,e)},"removeChild"),appendChild:h(function(e){return this.insertBefore(e,null)},"appendChild"),hasChildNodes:h(function(){return this.firstChild!=null},"hasChildNodes"),cloneNode:h(function(e){return Ui(this.ownerDocument||this,this,e)},"cloneNode"),normalize:h(function(){fe(this,null,{enter:h(function(e){for(var t=e.firstChild;t;){var r=t.nextSibling;r!==null&&r.nodeType===_r&&t.nodeType===_r?(e.removeChild(r),t.appendData(r.data)):t=r;}return true},"enter")});},"normalize"),isSupported:h(function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},"isSupported"),lookupPrefix:h(function(e){for(var t=this;t;){var r=t._nsMap;if(r){for(var n in r)if(_t(r,n)&&r[n]===e)return n}t=t.nodeType==vt?t.ownerDocument:t.parentNode;}return null},"lookupPrefix"),lookupNamespaceURI:h(function(e){for(var t=this;t;){var r=t._nsMap;if(r&&_t(r,e))return r[e];t=t.nodeType==vt?t.ownerDocument:t.parentNode;}return null},"lookupNamespaceURI"),isDefaultNamespace:h(function(e){var t=this.lookupPrefix(e);return t==null},"isDefaultNamespace"),compareDocumentPosition:h(function(e){if(this===e)return 0;var t=e,r=this,n=null,a=null;if(t instanceof nt&&(n=t,t=n.ownerElement),r instanceof nt&&(a=r,r=a.ownerElement,n&&t&&r===t))for(var i=0,o;o=r.attributes[i];i++){if(o===n)return ne.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+ne.DOCUMENT_POSITION_PRECEDING;if(o===a)return ne.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+ne.DOCUMENT_POSITION_FOLLOWING}if(!t||!r||r.ownerDocument!==t.ownerDocument)return ne.DOCUMENT_POSITION_DISCONNECTED+ne.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(wi(r.ownerDocument)>wi(t.ownerDocument)?ne.DOCUMENT_POSITION_FOLLOWING:ne.DOCUMENT_POSITION_PRECEDING);if(a&&t===r)return ne.DOCUMENT_POSITION_CONTAINS+ne.DOCUMENT_POSITION_PRECEDING;if(n&&t===r)return ne.DOCUMENT_POSITION_CONTAINED_BY+ne.DOCUMENT_POSITION_FOLLOWING;for(var u=[],l=t.parentNode;l;){if(!a&&l===r)return ne.DOCUMENT_POSITION_CONTAINED_BY+ne.DOCUMENT_POSITION_FOLLOWING;u.push(l),l=l.parentNode;}u.reverse();for(var s=[],f=r.parentNode;f;){if(!n&&f===t)return ne.DOCUMENT_POSITION_CONTAINS+ne.DOCUMENT_POSITION_PRECEDING;s.push(f),f=f.parentNode;}s.reverse();var c=Si(u,s);for(var d in c.childNodes){var p=c.childNodes[d];if(p===r)return ne.DOCUMENT_POSITION_FOLLOWING;if(p===t)return ne.DOCUMENT_POSITION_PRECEDING;if(s.indexOf(p)>=0)return ne.DOCUMENT_POSITION_FOLLOWING;if(u.indexOf(p)>=0)return ne.DOCUMENT_POSITION_PRECEDING}return 0},"compareDocumentPosition")};function Pi(e){return e=="<"&&"<"||e==">"&&">"||e=="&"&&"&"||e=='"'&&"""||"&#"+e.charCodeAt()+";"}h(Pi,"_xmlEncoder");yt(_e,H);yt(_e,H.prototype);yt(ne,H);yt(ne,H.prototype);function gr(e,t){fe(e,null,{enter:h(function(r){return t(r)?fe.STOP:true},"enter")});}h(gr,"_visitNode");function fe(e,t,r){for(var n=[{node:e,context:t,phase:fe.ENTER}];n.length>0;){var a=n.pop();if(a.phase===fe.ENTER){var i=r.enter(a.node,a.context);if(i===fe.STOP)return fe.STOP;if(n.push({node:a.node,context:i,phase:fe.EXIT}),i==null)continue;for(var o=a.node.lastChild;o;)n.push({node:o,context:i,phase:fe.ENTER}),o=o.previousSibling;}else r.exit&&r.exit(a.node,a.context);}}h(fe,"walkDOM");fe.STOP=Symbol("walkDOM.STOP");fe.ENTER=0;fe.EXIT=1;function qe(e,t){me(e);var r=t||{};this.ownerDocument=this,this.contentType=r.contentType||Qt.XML_APPLICATION,this.type=ks(this.contentType)?"html":"xml";}h(qe,"Document");function qs(e,t,r){e&&e._inc++;var n=r.namespaceURI;n===Re.XMLNS&&(t._nsMap[r.prefix?r.localName:""]=r.value);}h(qs,"_onAddAttribute");function Oi(e,t,r,n){e&&e._inc++;var a=r.namespaceURI;a===Re.XMLNS&&delete t._nsMap[r.prefix?r.localName:""];}h(Oi,"_onRemoveAttribute");function Mi(e,t,r){if(e&&e._inc){e._inc++;var n=t.childNodes;if(r&&!r.nextSibling)n[n.length++]=r;else {for(var a=t.firstChild,i=0;a;)n[i++]=a,a=a.nextSibling;n.length=i,delete n[n.length];}}}h(Mi,"_onUpdateChild");function Ri(e,t){if(e!==t.parentNode)throw new k(k.NOT_FOUND_ERR,"child's parent is not parent");var r=t.previousSibling,n=t.nextSibling;return r?r.nextSibling=n:e.firstChild=n,n?n.previousSibling=r:e.lastChild=r,Mi(e.ownerDocument,e),t.parentNode=null,t.previousSibling=null,t.nextSibling=null,t}h(Ri,"_removeChild");function zs(e){return e&&(e.nodeType===H.DOCUMENT_NODE||e.nodeType===H.DOCUMENT_FRAGMENT_NODE||e.nodeType===H.ELEMENT_NODE)}h(zs,"hasValidParentNodeType");function js(e){return e&&(e.nodeType===H.CDATA_SECTION_NODE||e.nodeType===H.COMMENT_NODE||e.nodeType===H.DOCUMENT_FRAGMENT_NODE||e.nodeType===H.DOCUMENT_TYPE_NODE||e.nodeType===H.ELEMENT_NODE||e.nodeType===H.PROCESSING_INSTRUCTION_NODE||e.nodeType===H.TEXT_NODE)}h(js,"hasInsertableNodeType");function Ge(e){return e&&e.nodeType===H.DOCUMENT_TYPE_NODE}h(Ge,"isDocTypeNode");function Ue(e){return e&&e.nodeType===H.ELEMENT_NODE}h(Ue,"isElementNode");function Bi(e){return e&&e.nodeType===H.TEXT_NODE}h(Bi,"isTextNode");function Ei(e,t){var r=e.childNodes||[];if(Me(r,Ue)||Ge(t))return false;var n=Me(r,Ge);return !(t&&n&&r.indexOf(n)>r.indexOf(t))}h(Ei,"isElementInsertionPossible");function Di(e,t){var r=e.childNodes||[];function n(i){return Ue(i)&&i!==t}if(h(n,"hasElementChildThatIsNotChild"),Me(r,n))return false;var a=Me(r,Ge);return !(t&&a&&r.indexOf(a)>r.indexOf(t))}h(Di,"isElementReplacementPossible");function Ws(e,t,r){if(!zs(e))throw new k(k.HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+e.nodeType);if(r&&r.parentNode!==e)throw new k(k.NOT_FOUND_ERR,"child not in parent");if(!js(t)||Ge(t)&&e.nodeType!==H.DOCUMENT_NODE)throw new k(k.HIERARCHY_REQUEST_ERR,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}h(Ws,"assertPreInsertionValidity1to5");function Hs(e,t,r){var n=e.childNodes||[],a=t.childNodes||[];if(t.nodeType===H.DOCUMENT_FRAGMENT_NODE){var i=a.filter(Ue);if(i.length>1||Me(a,Bi))throw new k(k.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(i.length===1&&!Ei(e,r))throw new k(k.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(Ue(t)&&!Ei(e,r))throw new k(k.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(Ge(t)){if(Me(n,Ge))throw new k(k.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var o=Me(n,Ue);if(r&&n.indexOf(o)<n.indexOf(r))throw new k(k.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element");if(!r&&o)throw new k(k.HIERARCHY_REQUEST_ERR,"Doctype can not be appended since element is present")}}h(Hs,"assertPreInsertionValidityInDocument");function Fi(e,t,r){var n=e.childNodes||[],a=t.childNodes||[];if(t.nodeType===H.DOCUMENT_FRAGMENT_NODE){var i=a.filter(Ue);if(i.length>1||Me(a,Bi))throw new k(k.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(i.length===1&&!Di(e,r))throw new k(k.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(Ue(t)&&!Di(e,r))throw new k(k.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(Ge(t)){let u=function(l){return Ge(l)&&l!==r};if(h(u,"hasDoctypeChildThatIsNotChild"),Me(n,u))throw new k(k.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var o=Me(n,Ue);if(r&&n.indexOf(o)<n.indexOf(r))throw new k(k.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element")}}h(Fi,"assertPreReplacementValidityInDocument");function vr(e,t,r,n){Ws(e,t,r),e.nodeType===H.DOCUMENT_NODE&&(n||Hs)(e,t,r);var a=t.parentNode;if(a&&a.removeChild(t),t.nodeType===Ve){var i=t.firstChild;if(i==null)return t;var o=t.lastChild;}else i=o=t;var u=r?r.previousSibling:e.lastChild;i.previousSibling=u,o.nextSibling=r,u?u.nextSibling=i:e.firstChild=i,r==null?e.lastChild=o:r.previousSibling=o;do i.parentNode=e;while(i!==o&&(i=i.nextSibling));return Mi(e.ownerDocument||e,e,t),t.nodeType==Ve&&(t.firstChild=t.lastChild=null),t}h(vr,"_insertBefore");qe.prototype={implementation:null,nodeName:"#document",nodeType:gt,doctype:null,documentElement:null,_inc:1,insertBefore:h(function(e,t){if(e.nodeType===Ve){for(var r=e.firstChild;r;){var n=r.nextSibling;this.insertBefore(r,t),r=n;}return e}return vr(this,e,t),e.ownerDocument=this,this.documentElement===null&&e.nodeType===Ne&&(this.documentElement=e),e},"insertBefore"),removeChild:h(function(e){var t=Ri(this,e);return t===this.documentElement&&(this.documentElement=null),t},"removeChild"),replaceChild:h(function(e,t){vr(this,e,t,Fi),e.ownerDocument=this,t&&this.removeChild(t),Ue(e)&&(this.documentElement=e);},"replaceChild"),importNode:h(function(e,t){return Vs(this,e,t)},"importNode"),getElementById:h(function(e){var t=null;return gr(this.documentElement,function(r){if(r.nodeType==Ne&&r.getAttribute("id")==e)return t=r,true}),t},"getElementById"),createElement:h(function(e){var t=new ze(de);t.ownerDocument=this,this.type==="html"&&(e=e.toLowerCase()),Is(this.contentType)&&(t.namespaceURI=Re.HTML),t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new oe;var r=t.attributes=new wt;return r._ownerElement=t,t},"createElement"),createDocumentFragment:h(function(){var e=new Dt(de);return e.ownerDocument=this,e.childNodes=new oe,e},"createDocumentFragment"),createTextNode:h(function(e){var t=new Jt(de);return t.ownerDocument=this,t.childNodes=new oe,t.appendData(e),t},"createTextNode"),createComment:h(function(e){var t=new yr(de);return t.ownerDocument=this,t.childNodes=new oe,t.appendData(e),t},"createComment"),createCDATASection:h(function(e){if(e.indexOf("]]>")!==-1)throw new k(k.INVALID_CHARACTER_ERR,'data contains "]]>"');var t=new Er(de);return t.ownerDocument=this,t.childNodes=new oe,t.appendData(e),t},"createCDATASection"),createProcessingInstruction:h(function(e,t){var r=new Ar(de);return r.ownerDocument=this,r.childNodes=new oe,r.nodeName=r.target=e,r.nodeValue=r.data=t,r},"createProcessingInstruction"),createAttribute:h(function(e){if(!ce.QName_exact.test(e))throw new k(k.INVALID_CHARACTER_ERR,'invalid character in name "'+e+'"');return this.type==="html"&&(e=e.toLowerCase()),this._createAttribute(e)},"createAttribute"),_createAttribute:h(function(e){var t=new nt(de);return t.ownerDocument=this,t.childNodes=new oe,t.name=e,t.nodeName=e,t.localName=e,t.specified=true,t},"_createAttribute"),createEntityReference:h(function(e){if(!ce.Name.test(e))throw new k(k.INVALID_CHARACTER_ERR,'not a valid xml name "'+e+'"');if(this.type==="html")throw new k("document is an html document",Ae.NotSupportedError);var t=new br(de);return t.ownerDocument=this,t.childNodes=new oe,t.nodeName=e,t},"createEntityReference"),createElementNS:h(function(e,t){var r=fn(e,t),n=new ze(de),a=n.attributes=new wt;return n.childNodes=new oe,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=r[0],n.prefix=r[1],n.localName=r[2],a._ownerElement=n,n},"createElementNS"),createAttributeNS:h(function(e,t){var r=fn(e,t),n=new nt(de);return n.ownerDocument=this,n.childNodes=new oe,n.nodeName=t,n.name=t,n.specified=true,n.namespaceURI=r[0],n.prefix=r[1],n.localName=r[2],n},"createAttributeNS")};ge(qe,H);function ze(e){me(e),this._nsMap=Object.create(null);}h(ze,"Element");ze.prototype={nodeType:Ne,attributes:null,getQualifiedName:h(function(){return this.prefix?this.prefix+":"+this.localName:this.localName},"getQualifiedName"),_isInHTMLDocumentAndNamespace:h(function(){return this.ownerDocument.type==="html"&&this.namespaceURI===Re.HTML},"_isInHTMLDocumentAndNamespace"),hasAttributes:h(function(){return !!(this.attributes&&this.attributes.length)},"hasAttributes"),hasAttribute:h(function(e){return !!this.getAttributeNode(e)},"hasAttribute"),getAttribute:h(function(e){var t=this.getAttributeNode(e);return t?t.value:null},"getAttribute"),getAttributeNode:h(function(e){return this._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase()),this.attributes.getNamedItem(e)},"getAttributeNode"),setAttribute:h(function(e,t){this._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase());var r=this.getAttributeNode(e);r?r.value=r.nodeValue=""+t:(r=this.ownerDocument._createAttribute(e),r.value=r.nodeValue=""+t,this.setAttributeNode(r));},"setAttribute"),removeAttribute:h(function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t);},"removeAttribute"),setAttributeNode:h(function(e){return this.attributes.setNamedItem(e)},"setAttributeNode"),setAttributeNodeNS:h(function(e){return this.attributes.setNamedItemNS(e)},"setAttributeNodeNS"),removeAttributeNode:h(function(e){return this.attributes.removeNamedItem(e.nodeName)},"removeAttributeNode"),removeAttributeNS:h(function(e,t){var r=this.getAttributeNodeNS(e,t);r&&this.removeAttributeNode(r);},"removeAttributeNS"),hasAttributeNS:h(function(e,t){return this.getAttributeNodeNS(e,t)!=null},"hasAttributeNS"),getAttributeNS:h(function(e,t){var r=this.getAttributeNodeNS(e,t);return r?r.value:null},"getAttributeNS"),setAttributeNS:h(function(e,t,r){var n=fn(e,t),a=n[2],i=this.getAttributeNodeNS(e,a);i?i.value=i.nodeValue=""+r:(i=this.ownerDocument.createAttributeNS(e,t),i.value=i.nodeValue=""+r,this.setAttributeNode(i));},"setAttributeNS"),getAttributeNodeNS:h(function(e,t){return this.attributes.getNamedItemNS(e,t)},"getAttributeNodeNS"),getElementsByClassName:h(function(e){var t=vi(e);return new Oe(this,function(r){var n=[];return t.length>0&&gr(r,function(a){if(a!==r&&a.nodeType===Ne){var i=a.getAttribute("class");if(i){var o=e===i;if(!o){var u=vi(i);o=t.every(Fs(u));}o&&n.push(a);}}}),n})},"getElementsByClassName"),getElementsByTagName:h(function(e){var t=(this.nodeType===gt?this:this.ownerDocument).type==="html",r=e.toLowerCase();return new Oe(this,function(n){var a=[];return gr(n,function(i){if(!(i===n||i.nodeType!==Ne))if(e==="*")a.push(i);else {var o=i.getQualifiedName(),u=t&&i.namespaceURI===Re.HTML?r:e;o===u&&a.push(i);}}),a})},"getElementsByTagName"),getElementsByTagNameNS:h(function(e,t){return new Oe(this,function(r){var n=[];return gr(r,function(a){a!==r&&a.nodeType===Ne&&(e==="*"||a.namespaceURI===e)&&(t==="*"||a.localName==t)&&n.push(a);}),n})},"getElementsByTagNameNS")};qe.prototype.getElementsByClassName=ze.prototype.getElementsByClassName;qe.prototype.getElementsByTagName=ze.prototype.getElementsByTagName;qe.prototype.getElementsByTagNameNS=ze.prototype.getElementsByTagNameNS;ge(ze,H);function nt(e){me(e),this.namespaceURI=null,this.prefix=null,this.ownerElement=null;}h(nt,"Attr");nt.prototype.nodeType=vt;ge(nt,H);function Et(e){me(e);}h(Et,"CharacterData");Et.prototype={data:"",substringData:h(function(e,t){return this.data.substring(e,e+t)},"substringData"),appendData:h(function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length;},"appendData"),insertData:h(function(e,t){this.replaceData(e,0,t);},"insertData"),deleteData:h(function(e,t){this.replaceData(e,t,"");},"deleteData"),replaceData:h(function(e,t,r){var n=this.data.substring(0,e),a=this.data.substring(e+t);r=n+r+a,this.nodeValue=this.data=r,this.length=r.length;},"replaceData")};ge(Et,H);function Jt(e){me(e);}h(Jt,"Text");Jt.prototype={nodeName:"#text",nodeType:_r,splitText:h(function(e){var t=this.data,r=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(r);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n},"splitText")};ge(Jt,Et);function yr(e){me(e);}h(yr,"Comment");yr.prototype={nodeName:"#comment",nodeType:dn};ge(yr,Et);function Er(e){me(e);}h(Er,"CDATASection");Er.prototype={nodeName:"#cdata-section",nodeType:Ci};ge(Er,Jt);function Dr(e){me(e);}h(Dr,"DocumentType");Dr.prototype.nodeType=xi;ge(Dr,H);function pn(e){me(e);}h(pn,"Notation");pn.prototype.nodeType=$s;ge(pn,H);function mn(e){me(e);}h(mn,"Entity");mn.prototype.nodeType=Ls;ge(mn,H);function br(e){me(e);}h(br,"EntityReference");br.prototype.nodeType=Ti;ge(br,H);function Dt(e){me(e);}h(Dt,"DocumentFragment");Dt.prototype.nodeName="#document-fragment";Dt.prototype.nodeType=Ve;ge(Dt,H);function Ar(e){me(e);}h(Ar,"ProcessingInstruction");Ar.prototype.nodeType=hn;ge(Ar,Et);function Li(){}h(Li,"XMLSerializer");Li.prototype.serializeToString=function(e,t){return $i.call(e,t)};H.prototype.toString=$i;function $i(e){var t;typeof e=="function"?t={requireWellFormed:false,splitCDATASections:true,nodeFilter:e}:e!=null?t={requireWellFormed:!!e.requireWellFormed,splitCDATASections:e.splitCDATASections!==false,nodeFilter:e.nodeFilter||null}:t={requireWellFormed:false,splitCDATASections:true,nodeFilter:null};var r=[],n=this.nodeType===gt&&this.documentElement||this,a=n.prefix,i=n.namespaceURI;if(i&&a==null){var a=n.lookupPrefix(i);if(a==null)var o=[{namespace:i,prefix:null}];}return gn(this,r,o,t),r.join("")}h($i,"nodeSerializeToString");function bi(e,t,r){var n=e.prefix||"",a=e.namespaceURI;if(!a||n==="xml"&&a===Re.XML||a===Re.XMLNS)return false;for(var i=r.length;i--;){var o=r[i];if(o.prefix===n)return o.namespace!==a}return true}h(bi,"needNamespaceDefine");function mr(e,t,r){e.push(" ",t,'="',r.replace(/[<>&"\t\n\r]/g,Pi),'"');}h(mr,"addSerializedAttribute");function gn(e,t,r,n){r||(r=[]);var a=n.nodeFilter,i=n.requireWellFormed,o=n.splitCDATASections,u=e.nodeType===gt?e:e.ownerDocument,l=u.type==="html";fe(e,{ns:r},{enter:h(function(s,f){var c=f.ns;if(a)if(s=a(s),s){if(typeof s=="string")return t.push(s),null}else return null;switch(s.nodeType){case Ne:var d=s.attributes,p=d.length,m=s.tagName,g=m;if(!l&&!s.prefix&&s.namespaceURI){for(var b,w=0;w<d.length;w++)if(d.item(w).name==="xmlns"){b=d.item(w).value;break}if(!b)for(var v=c.length-1;v>=0;v--){var E=c[v];if(E.prefix===""&&E.namespace===s.namespaceURI){b=E.namespace;break}}if(b!==s.namespaceURI)for(var v=c.length-1;v>=0;v--){var E=c[v];if(E.namespace===s.namespaceURI){E.prefix&&(g=E.prefix+":"+m);break}}}t.push("<",g);for(var _=c.slice(),D=0;D<p;D++){var y=d.item(D);y.prefix=="xmlns"?_.push({prefix:y.localName,namespace:y.value}):y.nodeName=="xmlns"&&_.push({prefix:"",namespace:y.value});}for(var D=0;D<p;D++){var y=d.item(D);if(bi(y,l,_)){var N=y.prefix||"",C=y.namespaceURI;mr(t,N?"xmlns:"+N:"xmlns",C),_.push({prefix:N,namespace:C});}var A=a?a(y):y;A&&(typeof A=="string"?t.push(A):mr(t,A.name,A.value));}if(m===g&&bi(s,l,_)){var B=s.prefix||"",C=s.namespaceURI;mr(t,B?"xmlns:"+B:"xmlns",C),_.push({prefix:B,namespace:C});}var x=!s.firstChild;if(x&&(l||s.namespaceURI===Re.HTML)&&(x=Os(m)),x)return t.push("/>"),null;if(t.push(">"),l&&Ps(m)){for(var M=s.firstChild;M;)M.data?t.push(M.data):gn(M,t,_.slice(),n),M=M.nextSibling;return t.push("</",g,">"),null}return {ns:_,tag:g};case gt:case Ve:if(i&&s.nodeType===gt&&s.documentElement==null)throw new k("The Document has no documentElement",Ae.InvalidStateError);return {ns:c};case vt:return mr(t,s.name,s.value),null;case _r:if(i&&ce.InvalidChar.test(s.data))throw new k("The Text node data contains characters outside the XML Char production",Ae.InvalidStateError);return t.push(s.data.replace(/[<&>]/g,Pi)),null;case Ci:if(i&&s.data.indexOf("]]>")!==-1)throw new k('The CDATASection data contains "]]>"',Ae.InvalidStateError);return o?t.push(ce.CDATA_START,s.data.replace(/]]>/g,"]]]]><![CDATA[>"),ce.CDATA_END):t.push(ce.CDATA_START,s.data,ce.CDATA_END),null;case dn:if(i){if(ce.InvalidChar.test(s.data))throw new k("The comment node data contains characters outside the XML Char production",Ae.InvalidStateError);if(s.data.indexOf("--")!==-1||s.data[s.data.length-1]==="-")throw new k('The comment node data contains "--" or ends with "-"',Ae.InvalidStateError)}return t.push(ce.COMMENT_START,s.data,ce.COMMENT_END),null;case xi:var z=s.publicId,P=s.systemId;if(i){if(z&&!ce.PubidLiteral_match.test(z))throw new k("DocumentType publicId is not a valid PubidLiteral",Ae.InvalidStateError);if(P&&P!=="."&&!ce.SystemLiteral_match.test(P))throw new k("DocumentType systemId is not a valid SystemLiteral",Ae.InvalidStateError);if(s.internalSubset&&s.internalSubset.indexOf("]>")!==-1)throw new k('DocumentType internalSubset contains "]>"',Ae.InvalidStateError)}return t.push(ce.DOCTYPE_DECL_START," ",s.name),z?(t.push(" ",ce.PUBLIC," ",z),P&&P!=="."&&t.push(" ",P)):P&&P!=="."&&t.push(" ",ce.SYSTEM," ",P),s.internalSubset&&t.push(" [",s.internalSubset,"]"),t.push(">"),null;case hn:if(i){if(s.target.indexOf(":")!==-1||s.target.toLowerCase()==="xml")throw new k("The ProcessingInstruction target is not well-formed",Ae.InvalidStateError);if(ce.InvalidChar.test(s.data))throw new k("The ProcessingInstruction data contains characters outside the XML Char production",Ae.InvalidStateError);if(s.data.indexOf("?>")!==-1)throw new k('The ProcessingInstruction data contains "?>"',Ae.InvalidStateError)}return t.push("<?",s.target," ",s.data,"?>"),null;case Ti:return t.push("&",s.nodeName,";"),null;default:return t.push("??",s.nodeName),null}},"enter"),exit:h(function(s,f){f&&f.tag&&t.push("</",f.tag,">");},"exit")});}h(gn,"serializeToString");function Vs(e,t,r){var n;return fe(t,null,{enter:h(function(a,i){var o=a.cloneNode(false);o.ownerDocument=e,o.parentNode=null,i===null?n=o:i.appendChild(o);var u=a.nodeType===vt||r;return u?o:null},"enter")}),n}h(Vs,"importNode");function Ui(e,t,r){var n;return fe(t,null,{enter:h(function(a,i){var o=new a.constructor(de);for(var u in a)if(_t(a,u)){var l=a[u];typeof l!="object"&&l!=o[u]&&(o[u]=l);}a.childNodes&&(o.childNodes=new oe),o.ownerDocument=e;var s=r;switch(o.nodeType){case Ne:var f=a.attributes,c=o.attributes=new wt,d=f.length;c._ownerElement=o;for(var p=0;p<d;p++)o.setAttributeNode(Ui(e,f.item(p),true));break;case vt:s=true;}return i!==null?i.appendChild(o):n=o,s?o:null},"enter")}),n}h(Ui,"cloneNode");function qi(e,t,r){e[t]=r;}h(qi,"__set__");function cn(e){for(var t=[],r=e.firstChild;r;)r.nodeType===Ne&&t.push(r),r=r.nextSibling;return t}h(cn,"childrenRefresh");try{Object.defineProperty&&(Object.defineProperty(Oe.prototype,"length",{get:h(function(){return wr(this),this.$$length},"get")}),Object.defineProperty(H.prototype,"textContent",{get:h(function(){if(this.nodeType===Ne||this.nodeType===Ve){var e=[];return fe(this,null,{enter:h(function(t){if(t.nodeType===Ne||t.nodeType===Ve)return !0;if(t.nodeType===hn||t.nodeType===dn)return null;e.push(t.nodeValue);},"enter")}),e.join("")}return this.nodeValue},"get"),set:h(function(e){switch(this.nodeType){case Ne:case Ve:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e;}},"set")}),Object.defineProperty(ze.prototype,"children",{get:h(function(){return new Oe(this,cn)},"get")}),Object.defineProperty(qe.prototype,"children",{get:h(function(){return new Oe(this,cn)},"get")}),Object.defineProperty(Dt.prototype,"children",{get:h(function(){return new Oe(this,cn)},"get")}),qi=h(function(e,t,r){e["$$"+t]=r;},"__set__"));}catch{}ie._updateLiveList=wr;ie.Attr=nt;ie.CDATASection=Er;ie.CharacterData=Et;ie.Comment=yr;ie.Document=qe;ie.DocumentFragment=Dt;ie.DocumentType=Dr;ie.DOMImplementation=ki;ie.Element=ze;ie.Entity=mn;ie.EntityReference=br;ie.LiveNodeList=Oe;ie.NamedNodeMap=wt;ie.Node=H;ie.NodeList=oe;ie.Notation=pn;ie.Text=Jt;ie.ProcessingInstruction=Ar;ie.walkDOM=fe;ie.XMLSerializer=Li;});var ji=Ie(Zt=>{var zi=rt().freeze;Zt.XML_ENTITIES=zi({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});Zt.HTML_ENTITIES=zi({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
|
|
2
|
+
`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"});Zt.entityMap=Zt.HTML_ENTITIES;});var ea=Ie(Cr=>{var Ct=rt(),U=ln(),Xi=Wt(),Gs=Ct.isHTMLEscapableRawTextElement,Xs=Ct.isHTMLMimeType,Ys=Ct.isHTMLRawTextElement,rr=Ct.hasOwn,Wi=Ct.NAMESPACE,Hi=Xi.ParseError,Qs=Xi.DOMException,Kt=0,Xe=1,bt=2,er=3,At=4,Nt=5,tr=6,Nr=7;function Yi(){}h(Yi,"XMLReader");Yi.prototype={parse:h(function(e,t,r){var n=this.domBuilder;n.startDocument(),Qi(t,t=Object.create(null)),Js(e,t,r,n,this.errorHandler),n.endDocument();},"parse")};var vn=/&#?\w+;?/g;function Js(e,t,r,n,a){var i=Xs(n.mimeType);e.indexOf(U.UNICODE_REPLACEMENT_CHARACTER)>=0&&a.warning("Unicode replacement character detected, source encoding issues?");function o(I){if(I>65535){I-=65536;var Q=55296+(I>>10),K=56320+(I&1023);return String.fromCharCode(Q,K)}else return String.fromCharCode(I)}h(o,"fixedFromCharCode");function u(I){var Q=I[I.length-1]===";"?I:I+";";if(!i&&Q!==I)return a.error("EntityRef: expecting ;"),I;var K=U.Reference.exec(Q);if(!K||K[0].length!==Q.length)return a.error("entity not matching Reference production: "+I),I;var ae=Q.slice(1,-1);return rr(r,ae)?r[ae]:ae.charAt(0)==="#"?o(parseInt(ae.substring(1).replace("x","0x"))):(a.error("entity not found:"+I),I)}h(u,"entityReplacer");function l(I){if(I>b){var Q=e.substring(b,I).replace(vn,u);d&&p(b),n.characters(Q,0,I-b),b=I;}}h(l,"appendText");var s=0,f=0,c=/\r\n?|\n|$/g,d=n.locator;function p(I,Q){for(;I>=f&&(Q=c.exec(e));)s=f,f=Q.index+Q[0].length,d.lineNumber++;d.columnNumber=I-s+1;}h(p,"position");for(var m=[{currentNSMap:t}],g=[],b=0;;){try{var w=e.indexOf("<",b);if(w<0){if(!i&&g.length>0)return a.fatalError("unclosed xml tag(s): "+g.join(", "));if(!e.substring(b).match(/^\s*$/)){var v=n.doc,E=v.createTextNode(e.substring(b));if(v.documentElement)return a.error("Extra content at the end of the document");v.appendChild(E),n.currentElement=E;}return}if(w>b){var _=e.substring(b,w);!i&&g.length===0&&(_=_.replace(new RegExp(U.S_OPT.source,"g"),""),_&&a.error("Unexpected content outside root element: '"+_+"'")),l(w);}switch(e.charAt(w+1)){case "/":var P=e.indexOf(">",w+2),D=e.substring(w+2,P>0?P:void 0);if(!D)return a.fatalError("end tag name missing");var y=P>0&&U.reg("^",U.QName_group,U.S_OPT,"$").exec(D);if(!y)return a.fatalError('end tag name contains invalid characters: "'+D+'"');if(!n.currentElement&&!n.doc.documentElement)return;var N=g[g.length-1]||n.currentElement.tagName||n.doc.documentElement.tagName||"";if(N!==y[1]){var C=y[1].toLowerCase();if(!i||N.toLowerCase()!==C)return a.fatalError('Opening and ending tag mismatch: "'+N+'" != "'+D+'"')}var A=m.pop();g.pop();var B=A.localNSMap;if(n.endElement(A.uri,A.localName,N),B)for(var x in B)rr(B,x)&&n.endPrefixMapping(x);P++;break;case "?":d&&p(w),P=tu(e,w,n,a);break;case "!":d&&p(w),P=Zi(e,w,n,a,i);break;default:d&&p(w);var M=new Ki,z=m[m.length-1].currentNSMap,P=Zs(e,w,M,z,u,a,i),G=M.length;if(M.closed||(i&&Ct.isHTMLVoidElement(M.tagName)?M.closed=!0:g.push(M.tagName)),d&&G){for(var $=Vi(d,{}),R=0;R<G;R++){var j=M[R];p(j.offset),j.locator=Vi(d,{});}n.locator=$,Gi(M,n,z)&&m.push(M),n.locator=d;}else Gi(M,n,z)&&m.push(M);i&&!M.closed?P=Ks(e,P,M.tagName,u,n):P++;}}catch(I){if(I instanceof Hi)throw I;if(I instanceof Qs)throw new Hi(I.name+": "+I.message,n.locator,I);a.error("element parse error: "+I),P=-1;}P>b?b=P:l(Math.max(w,b)+1);}}h(Js,"parse");function Vi(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}h(Vi,"copyLocator");function Zs(e,t,r,n,a,i,o){function u(p,m,g){if(rr(r.attributeNames,p))return i.fatalError("Attribute "+p+" redefined");if(!o&&m.indexOf("<")>=0)return i.fatalError("Unescaped '<' not allowed in attributes values");r.addValue(p,m.replace(/[\t\n\r]/g," ").replace(vn,a),g);}h(u,"addAttribute");for(var l,s,f=++t,c=Kt;;){var d=e.charAt(f);switch(d){case "=":if(c===Xe)l=e.slice(t,f),c=er;else if(c===bt)c=er;else throw new Error("attribute equal must after attrName");break;case "'":case '"':if(c===er||c===Xe)if(c===Xe&&(i.warning('attribute value must after "="'),l=e.slice(t,f)),t=f+1,f=e.indexOf(d,t),f>0)s=e.slice(t,f),u(l,s,t-1),c=Nt;else throw new Error("attribute value no end '"+d+"' match");else if(c==At)s=e.slice(t,f),u(l,s,t),i.warning('attribute "'+l+'" missed start quot('+d+")!!"),t=f+1,c=Nt;else throw new Error('attribute value must after "="');break;case "/":switch(c){case Kt:r.setTagName(e.slice(t,f));case Nt:case tr:case Nr:c=Nr,r.closed=true;case At:case Xe:break;case bt:r.closed=true;break;default:throw new Error("attribute invalid close char('/')")}break;case "":return i.error("unexpected end of input"),c==Kt&&r.setTagName(e.slice(t,f)),f;case ">":switch(c){case Kt:r.setTagName(e.slice(t,f));case Nt:case tr:case Nr:break;case At:case Xe:s=e.slice(t,f),s.slice(-1)==="/"&&(r.closed=true,s=s.slice(0,-1));case bt:c===bt&&(s=l),c==At?(i.warning('attribute "'+s+'" missed quot(")!'),u(l,s,t)):(o||i.warning('attribute "'+s+'" missed value!! "'+s+'" instead!!'),u(s,s,t));break;case er:if(!o)return i.fatalError(`AttValue: ' or " expected`)}return f;case "\x80":d=" ";default:if(d<=" ")switch(c){case Kt:r.setTagName(e.slice(t,f)),c=tr;break;case Xe:l=e.slice(t,f),c=bt;break;case At:var s=e.slice(t,f);i.warning('attribute "'+s+'" missed quot(")!!'),u(l,s,t);case Nt:c=tr;break}else switch(c){case bt:o||i.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),u(l,l,t),t=f,c=Xe;break;case Nt:i.warning('attribute space is required"'+l+'"!!');case tr:c=Xe,t=f;break;case er:c=At,t=f;break;case Nr:throw new Error("elements closed character '/' and '>' must be connected to")}}f++;}}h(Zs,"parseElementStartPart");function Gi(e,t,r){for(var n=e.tagName,a=null,c=e.length;c--;){var i=e[c],o=i.qName,u=i.value,d=o.indexOf(":");if(d>0)var l=i.prefix=o.slice(0,d),s=o.slice(d+1),f=l==="xmlns"&&s;else s=o,l=null,f=o==="xmlns"&&"";i.localName=s,f!==false&&(a==null&&(a=Object.create(null),Qi(r,r=Object.create(null))),r[f]=a[f]=u,i.uri=Wi.XMLNS,t.startPrefixMapping(f,u));}for(var c=e.length;c--;)i=e[c],i.prefix&&(i.prefix==="xml"&&(i.uri=Wi.XML),i.prefix!=="xmlns"&&(i.uri=r[i.prefix]));var d=n.indexOf(":");d>0?(l=e.prefix=n.slice(0,d),s=e.localName=n.slice(d+1)):(l=null,s=e.localName=n);var p=e.uri=r[l||""];if(t.startElement(p,s,n,e),e.closed){if(t.endElement(p,s,n),a)for(l in a)rr(a,l)&&t.endPrefixMapping(l);}else return e.currentNSMap=r,e.localNSMap=a,true}h(Gi,"appendElement");function Ks(e,t,r,n,a){var i=Gs(r);if(i||Ys(r)){var o=e.indexOf("</"+r+">",t),u=e.substring(t+1,o);return i&&(u=u.replace(vn,n)),a.characters(u,0,u.length),o}return t+1}h(Ks,"parseHtmlSpecialContent");function Qi(e,t){for(var r in e)rr(e,r)&&(t[r]=e[r]);}h(Qi,"_copy");function Ji(e,t){var r=t;function n(f){return f=f||0,e.charAt(r+f)}h(n,"char");function a(f){f=f||1,r+=f;}h(a,"skip");function i(){for(var f=0;r<e.length;){var c=n();if(c!==" "&&c!==`
|
|
3
|
+
`&&c!==" "&&c!=="\r")return f;f++,a();}return -1}h(i,"skipBlanks");function o(){return e.substring(r)}h(o,"substringFromIndex");function u(f){return e.substring(r,r+f.length)===f}h(u,"substringStartsWith");function l(f){return e.substring(r,r+f.length).toUpperCase()===f.toUpperCase()}h(l,"substringStartsWithCaseInsensitive");function s(f){var c=U.reg("^",f),d=c.exec(o());return d?(a(d[0].length),d[0]):null}return h(s,"getMatch"),{char:n,getIndex:h(function(){return r},"getIndex"),getMatch:s,getSource:h(function(){return e},"getSource"),skip:a,skipBlanks:i,substringFromIndex:o,substringStartsWith:u,substringStartsWithCaseInsensitive:l}}h(Ji,"parseUtils");function eu(e,t){function r(u,l){var s=U.PI.exec(u.substringFromIndex());return s?s[1].toLowerCase()==="xml"?l.fatalError("xml declaration is only allowed at the start of the document, but found at position "+u.getIndex()):(u.skip(s[0].length),s[0]):l.fatalError("processing instruction is not well-formed at position "+u.getIndex())}h(r,"parsePI");var n=e.getSource();if(e.char()==="["){e.skip(1);for(var a=e.getIndex();e.getIndex()<n.length;){if(e.skipBlanks(),e.char()==="]"){var i=n.substring(a,e.getIndex());return e.skip(1),i}var o=null;if(e.char()==="<"&&e.char(1)==="!")switch(e.char(2)){case "E":e.char(3)==="L"?o=e.getMatch(U.elementdecl):e.char(3)==="N"&&(o=e.getMatch(U.EntityDecl));break;case "A":o=e.getMatch(U.AttlistDecl);break;case "N":o=e.getMatch(U.NotationDecl);break;case "-":o=e.getMatch(U.Comment);break}else if(e.char()==="<"&&e.char(1)==="?")o=r(e,t);else if(e.char()==="%")o=e.getMatch(U.PEReference);else return t.fatalError("Error detected in Markup declaration");if(!o)return t.fatalError("Error in internal subset at position "+e.getIndex())}return t.fatalError("doctype internal subset is not well-formed, missing ]")}}h(eu,"parseDoctypeInternalSubset");function Zi(e,t,r,n,a){var i=Ji(e,t);switch(a?i.char(2).toUpperCase():i.char(2)){case "-":var o=i.getMatch(U.Comment);return o?(r.comment(o,U.COMMENT_START.length,o.length-U.COMMENT_START.length-U.COMMENT_END.length),i.getIndex()):n.fatalError("comment is not well-formed at position "+i.getIndex());case "[":var u=i.getMatch(U.CDSect);return u?!a&&!r.currentElement?n.fatalError("CDATA outside of element"):(r.startCDATA(),r.characters(u,U.CDATA_START.length,u.length-U.CDATA_START.length-U.CDATA_END.length),r.endCDATA(),i.getIndex()):n.fatalError("Invalid CDATA starting at position "+t);case "D":{if(r.doc&&r.doc.documentElement)return n.fatalError("Doctype not allowed inside or after documentElement at position "+i.getIndex());if(a?!i.substringStartsWithCaseInsensitive(U.DOCTYPE_DECL_START):!i.substringStartsWith(U.DOCTYPE_DECL_START))return n.fatalError("Expected "+U.DOCTYPE_DECL_START+" at position "+i.getIndex());if(i.skip(U.DOCTYPE_DECL_START.length),i.skipBlanks()<1)return n.fatalError("Expected whitespace after "+U.DOCTYPE_DECL_START+" at position "+i.getIndex());var l={name:void 0,publicId:void 0,systemId:void 0,internalSubset:void 0};if(l.name=i.getMatch(U.Name),!l.name)return n.fatalError("doctype name missing or contains unexpected characters at position "+i.getIndex());if(a&&l.name.toLowerCase()!=="html"&&n.warning("Unexpected DOCTYPE in HTML document at position "+i.getIndex()),i.skipBlanks(),i.substringStartsWith(U.PUBLIC)||i.substringStartsWith(U.SYSTEM)){var s=U.ExternalID_match.exec(i.substringFromIndex());if(!s)return n.fatalError("doctype external id is not well-formed at position "+i.getIndex());s.groups.SystemLiteralOnly!==void 0?l.systemId=s.groups.SystemLiteralOnly:(l.systemId=s.groups.SystemLiteral,l.publicId=s.groups.PubidLiteral),i.skip(s[0].length);}else if(a&&i.substringStartsWithCaseInsensitive(U.SYSTEM)){if(i.skip(U.SYSTEM.length),i.skipBlanks()<1)return n.fatalError("Expected whitespace after "+U.SYSTEM+" at position "+i.getIndex());if(l.systemId=i.getMatch(U.ABOUT_LEGACY_COMPAT_SystemLiteral),!l.systemId)return n.fatalError("Expected "+U.ABOUT_LEGACY_COMPAT+" in single or double quotes after "+U.SYSTEM+" at position "+i.getIndex())}return a&&l.systemId&&!U.ABOUT_LEGACY_COMPAT_SystemLiteral.test(l.systemId)&&n.warning("Unexpected doctype.systemId in HTML document at position "+i.getIndex()),a||(i.skipBlanks(),l.internalSubset=eu(i,n)),i.skipBlanks(),i.char()!==">"?n.fatalError("doctype not terminated with > at position "+i.getIndex()):(i.skip(1),r.startDTD(l.name,l.publicId,l.systemId,l.internalSubset),r.endDTD(),i.getIndex())}default:return n.fatalError('Not well-formed XML starting with "<!" at position '+t)}}h(Zi,"parseDoctypeCommentOrCData");function tu(e,t,r,n){var a=e.substring(t).match(U.PI);if(!a)return n.fatalError("Invalid processing instruction starting at position "+t);if(a[1].toLowerCase()==="xml"){if(t>0)return n.fatalError("processing instruction at position "+t+" is an xml declaration which is only at the start of the document");if(!U.XMLDecl.test(e.substring(t)))return n.fatalError("xml declaration is not well-formed")}return r.processingInstruction(a[1],a[2]),t+a[0].length}h(tu,"parseProcessingInstruction");function Ki(){this.attributeNames=Object.create(null);}h(Ki,"ElementAttributes");Ki.prototype={setTagName:h(function(e){if(!U.QName_exact.test(e))throw new Error("invalid tagName:"+e);this.tagName=e;},"setTagName"),addValue:h(function(e,t,r){if(!U.QName_exact.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:r};},"addValue"),length:0,getLocalName:h(function(e){return this[e].localName},"getLocalName"),getLocator:h(function(e){return this[e].locator},"getLocator"),getQName:h(function(e){return this[e].qName},"getQName"),getURI:h(function(e){return this[e].uri},"getURI"),getValue:h(function(e){return this[e].value},"getValue")};Cr.XMLReader=Yi;Cr.parseUtils=Ji;Cr.parseDoctypeCommentOrCData=Zi;});var sa=Ie(xt=>{var it=rt(),ru=_n(),nu=Wt(),ta=ji(),iu=ea(),au=ru.DOMImplementation,ou=it.hasDefaultHTMLNamespace,su=it.isHTMLMimeType,uu=it.isValidMimeType,ia=it.MIME_TYPE,wn=it.NAMESPACE,ra=nu.ParseError,lu=iu.XMLReader;function aa(e){return e.replace(/\r[\n\u0085]/g,`
|
|
4
4
|
`).replace(/[\r\u0085\u2028\u2029]/g,`
|
|
5
|
-
`)}h(
|
|
6
|
-
`,f),c==-1&&(c=l.length-1);var p=l.substring(f,c+1);(n.hasOwnProperty?n.hasOwnProperty(p):n[p]!==void 0)?u+=String.fromCharCode(n[p]):(d==i&&(p=l.substring(f),c=l.length),u+=String.fromCharCode(d),n[p]=d,r[d++]=p),f=c+1;}return u}h(o,"diff_linesToCharsMunge_");var i=4e4,a=o(e);i=65535;var s=o(t);return {chars1:a,chars2:s,lineArray:r}};T.prototype.diff_charsToLines_=function(e,t){for(var r=0;r<e.length;r++){for(var n=e[r][1],o=[],i=0;i<n.length;i++)o[i]=t[n.charCodeAt(i)];e[r][1]=o.join("");}};T.prototype.diff_commonPrefix=function(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var r=0,n=Math.min(e.length,t.length),o=n,i=0;r<o;)e.substring(i,o)==t.substring(i,o)?(r=o,i=r):n=o,o=Math.floor((n-r)/2+r);return o};T.prototype.diff_commonSuffix=function(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var r=0,n=Math.min(e.length,t.length),o=n,i=0;r<o;)e.substring(e.length-o,e.length-i)==t.substring(t.length-o,t.length-i)?(r=o,i=r):n=o,o=Math.floor((n-r)/2+r);return o};T.prototype.diff_commonOverlap_=function(e,t){var r=e.length,n=t.length;if(r==0||n==0)return 0;r>n?e=e.substring(r-n):r<n&&(t=t.substring(0,r));var o=Math.min(r,n);if(e==t)return o;for(var i=0,a=1;;){var s=e.substring(o-a),l=t.indexOf(s);if(l==-1)return i;a+=l,(l==0||e.substring(o-a)==t.substring(0,a))&&(i=a,a++);}};T.prototype.diff_halfMatch_=function(e,t){if(this.Diff_Timeout<=0)return null;var r=e.length>t.length?e:t,n=e.length>t.length?t:e;if(r.length<4||n.length*2<r.length)return null;var o=this;function i(g,m,b){for(var y=g.substring(b,b+Math.floor(g.length/4)),w=-1,v="",_,D,E,A;(w=m.indexOf(y,w+1))!=-1;){var N=o.diff_commonPrefix(g.substring(b),m.substring(w)),C=o.diff_commonSuffix(g.substring(0,b),m.substring(0,w));v.length<C+N&&(v=m.substring(w-C,w)+m.substring(w,w+N),_=g.substring(0,b-C),D=g.substring(b+N),E=m.substring(0,w-C),A=m.substring(w+N));}return v.length*2>=g.length?[_,D,E,A,v]:null}h(i,"diff_halfMatchI_");var a=i(r,n,Math.ceil(r.length/4)),s=i(r,n,Math.ceil(r.length/2)),l;if(!a&&!s)return null;s?a?l=a[4].length>s[4].length?a:s:l=s:l=a;var u,f,c,d;e.length>t.length?(u=l[0],f=l[1],c=l[2],d=l[3]):(c=l[0],d=l[1],u=l[2],f=l[3]);var p=l[4];return [u,f,c,d,p]};T.prototype.diff_cleanupSemantic=function(e){for(var t=false,r=[],n=0,o=null,i=0,a=0,s=0,l=0,u=0;i<e.length;)e[i][0]==U?(r[n++]=i,a=l,s=u,l=0,u=0,o=e[i][1]):(e[i][0]==J?l+=e[i][1].length:u+=e[i][1].length,o&&o.length<=Math.max(a,s)&&o.length<=Math.max(l,u)&&(e.splice(r[n-1],0,new T.Diff(Q,o)),e[r[n-1]+1][0]=J,n--,n--,i=n>0?r[n-1]:-1,a=0,s=0,l=0,u=0,o=null,t=true)),i++;for(t&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),i=1;i<e.length;){if(e[i-1][0]==Q&&e[i][0]==J){var f=e[i-1][1],c=e[i][1],d=this.diff_commonOverlap_(f,c),p=this.diff_commonOverlap_(c,f);d>=p?(d>=f.length/2||d>=c.length/2)&&(e.splice(i,0,new T.Diff(U,c.substring(0,d))),e[i-1][1]=f.substring(0,f.length-d),e[i+1][1]=c.substring(d),i++):(p>=f.length/2||p>=c.length/2)&&(e.splice(i,0,new T.Diff(U,f.substring(0,p))),e[i-1][0]=J,e[i-1][1]=c.substring(0,c.length-p),e[i+1][0]=Q,e[i+1][1]=f.substring(p),i++),i++;}i++;}};T.prototype.diff_cleanupSemanticLossless=function(e){function t(p,g){if(!p||!g)return 6;var m=p.charAt(p.length-1),b=g.charAt(0),y=m.match(T.nonAlphaNumericRegex_),w=b.match(T.nonAlphaNumericRegex_),v=y&&m.match(T.whitespaceRegex_),_=w&&b.match(T.whitespaceRegex_),D=v&&m.match(T.linebreakRegex_),E=_&&b.match(T.linebreakRegex_),A=D&&p.match(T.blanklineEndRegex_),N=E&&g.match(T.blanklineStartRegex_);return A||N?5:D||E?4:y&&!v&&_?3:v||_?2:y||w?1:0}h(t,"diff_cleanupSemanticScore_");for(var r=1;r<e.length-1;){if(e[r-1][0]==U&&e[r+1][0]==U){var n=e[r-1][1],o=e[r][1],i=e[r+1][1],a=this.diff_commonSuffix(n,o);if(a){var s=o.substring(o.length-a);n=n.substring(0,n.length-a),o=s+o.substring(0,o.length-a),i=s+i;}for(var l=n,u=o,f=i,c=t(n,o)+t(o,i);o.charAt(0)===i.charAt(0);){n+=o.charAt(0),o=o.substring(1)+i.charAt(0),i=i.substring(1);var d=t(n,o)+t(o,i);d>=c&&(c=d,l=n,u=o,f=i);}e[r-1][1]!=l&&(l?e[r-1][1]=l:(e.splice(r-1,1),r--),e[r][1]=u,f?e[r+1][1]=f:(e.splice(r+1,1),r--));}r++;}};T.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/;T.whitespaceRegex_=/\s/;T.linebreakRegex_=/[\r\n]/;T.blanklineEndRegex_=/\n\r?\n$/;T.blanklineStartRegex_=/^\r?\n\r?\n/;T.prototype.diff_cleanupEfficiency=function(e){for(var t=false,r=[],n=0,o=null,i=0,a=false,s=false,l=false,u=false;i<e.length;)e[i][0]==U?(e[i][1].length<this.Diff_EditCost&&(l||u)?(r[n++]=i,a=l,s=u,o=e[i][1]):(n=0,o=null),l=u=false):(e[i][0]==Q?u=true:l=true,o&&(a&&s&&l&&u||o.length<this.Diff_EditCost/2&&a+s+l+u==3)&&(e.splice(r[n-1],0,new T.Diff(Q,o)),e[r[n-1]+1][0]=J,n--,o=null,a&&s?(l=u=true,n=0):(n--,i=n>0?r[n-1]:-1,l=u=false),t=true)),i++;t&&this.diff_cleanupMerge(e);};T.prototype.diff_cleanupMerge=function(e){e.push(new T.Diff(U,""));for(var t=0,r=0,n=0,o="",i="",a;t<e.length;)switch(e[t][0]){case J:n++,i+=e[t][1],t++;break;case Q:r++,o+=e[t][1],t++;break;case U:r+n>1?(r!==0&&n!==0&&(a=this.diff_commonPrefix(i,o),a!==0&&(t-r-n>0&&e[t-r-n-1][0]==U?e[t-r-n-1][1]+=i.substring(0,a):(e.splice(0,0,new T.Diff(U,i.substring(0,a))),t++),i=i.substring(a),o=o.substring(a)),a=this.diff_commonSuffix(i,o),a!==0&&(e[t][1]=i.substring(i.length-a)+e[t][1],i=i.substring(0,i.length-a),o=o.substring(0,o.length-a))),t-=r+n,e.splice(t,r+n),o.length&&(e.splice(t,0,new T.Diff(Q,o)),t++),i.length&&(e.splice(t,0,new T.Diff(J,i)),t++),t++):t!==0&&e[t-1][0]==U?(e[t-1][1]+=e[t][1],e.splice(t,1)):t++,n=0,r=0,o="",i="";break}e[e.length-1][1]===""&&e.pop();var s=false;for(t=1;t<e.length-1;)e[t-1][0]==U&&e[t+1][0]==U&&(e[t][1].substring(e[t][1].length-e[t-1][1].length)==e[t-1][1]?(e[t][1]=e[t-1][1]+e[t][1].substring(0,e[t][1].length-e[t-1][1].length),e[t+1][1]=e[t-1][1]+e[t+1][1],e.splice(t-1,1),s=true):e[t][1].substring(0,e[t+1][1].length)==e[t+1][1]&&(e[t-1][1]+=e[t+1][1],e[t][1]=e[t][1].substring(e[t+1][1].length)+e[t+1][1],e.splice(t+1,1),s=true)),t++;s&&this.diff_cleanupMerge(e);};T.prototype.diff_xIndex=function(e,t){var r=0,n=0,o=0,i=0,a;for(a=0;a<e.length&&(e[a][0]!==J&&(r+=e[a][1].length),e[a][0]!==Q&&(n+=e[a][1].length),!(r>t));a++)o=r,i=n;return e.length!=a&&e[a][0]===Q?i:i+(t-o)};T.prototype.diff_prettyHtml=function(e){for(var t=[],r=/&/g,n=/</g,o=/>/g,i=/\n/g,a=0;a<e.length;a++){var s=e[a][0],l=e[a][1],u=l.replace(r,"&").replace(n,"<").replace(o,">").replace(i,"¶<br>");switch(s){case J:t[a]='<ins style="background:#e6ffe6;">'+u+"</ins>";break;case Q:t[a]='<del style="background:#ffe6e6;">'+u+"</del>";break;case U:t[a]="<span>"+u+"</span>";break}}return t.join("")};T.prototype.diff_text1=function(e){for(var t=[],r=0;r<e.length;r++)e[r][0]!==J&&(t[r]=e[r][1]);return t.join("")};T.prototype.diff_text2=function(e){for(var t=[],r=0;r<e.length;r++)e[r][0]!==Q&&(t[r]=e[r][1]);return t.join("")};T.prototype.diff_levenshtein=function(e){for(var t=0,r=0,n=0,o=0;o<e.length;o++){var i=e[o][0],a=e[o][1];switch(i){case J:r+=a.length;break;case Q:n+=a.length;break;case U:t+=Math.max(r,n),r=0,n=0;break}}return t+=Math.max(r,n),t};T.prototype.diff_toDelta=function(e){for(var t=[],r=0;r<e.length;r++)switch(e[r][0]){case J:t[r]="+"+encodeURI(e[r][1]);break;case Q:t[r]="-"+e[r][1].length;break;case U:t[r]="="+e[r][1].length;break}return t.join(" ").replace(/%20/g," ")};T.prototype.diff_fromDelta=function(e,t){for(var r=[],n=0,o=0,i=t.split(/\t/g),a=0;a<i.length;a++){var s=i[a].substring(1);switch(i[a].charAt(0)){case "+":try{r[n++]=new T.Diff(J,decodeURI(s));}catch{throw new Error("Illegal escape in diff_fromDelta: "+s)}break;case "-":case "=":var l=parseInt(s,10);if(isNaN(l)||l<0)throw new Error("Invalid number in diff_fromDelta: "+s);var u=e.substring(o,o+=l);i[a].charAt(0)=="="?r[n++]=new T.Diff(U,u):r[n++]=new T.Diff(Q,u);break;default:if(i[a])throw new Error("Invalid diff operation in diff_fromDelta: "+i[a])}}if(o!=e.length)throw new Error("Delta length ("+o+") does not equal source text length ("+e.length+").");return r};T.prototype.match_main=function(e,t,r){if(e==null||t==null||r==null)throw new Error("Null input. (match_main)");return r=Math.max(0,Math.min(r,e.length)),e==t?0:e.length?e.substring(r,r+t.length)==t?r:this.match_bitap_(e,t,r):-1};T.prototype.match_bitap_=function(e,t,r){if(t.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var n=this.match_alphabet_(t),o=this;function i(_,D){var E=_/t.length,A=Math.abs(r-D);return o.Match_Distance?E+A/o.Match_Distance:A?1:E}h(i,"match_bitapScore_");var a=this.Match_Threshold,s=e.indexOf(t,r);s!=-1&&(a=Math.min(i(0,s),a),s=e.lastIndexOf(t,r+t.length),s!=-1&&(a=Math.min(i(0,s),a)));var l=1<<t.length-1;s=-1;for(var u,f,c=t.length+e.length,d,p=0;p<t.length;p++){for(u=0,f=c;u<f;)i(p,r+f)<=a?u=f:c=f,f=Math.floor((c-u)/2+u);c=f;var g=Math.max(1,r-f+1),m=Math.min(r+f,e.length)+t.length,b=Array(m+2);b[m+1]=(1<<p)-1;for(var y=m;y>=g;y--){var w=n[e.charAt(y-1)];if(p===0?b[y]=(b[y+1]<<1|1)&w:b[y]=(b[y+1]<<1|1)&w|((d[y+1]|d[y])<<1|1)|d[y+1],b[y]&l){var v=i(p,y-1);if(v<=a)if(a=v,s=y-1,s>r)g=Math.max(1,2*r-s);else break}}if(i(p+1,r)>a)break;d=b;}return s};T.prototype.match_alphabet_=function(e){for(var t={},r=0;r<e.length;r++)t[e.charAt(r)]=0;for(var r=0;r<e.length;r++)t[e.charAt(r)]|=1<<e.length-r-1;return t};T.prototype.patch_addContext_=function(e,t){if(t.length!=0){if(e.start2===null)throw Error("patch not initialized");for(var r=t.substring(e.start2,e.start2+e.length1),n=0;t.indexOf(r)!=t.lastIndexOf(r)&&r.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)n+=this.Patch_Margin,r=t.substring(e.start2-n,e.start2+e.length1+n);n+=this.Patch_Margin;var o=t.substring(e.start2-n,e.start2);o&&e.diffs.unshift(new T.Diff(U,o));var i=t.substring(e.start2+e.length1,e.start2+e.length1+n);i&&e.diffs.push(new T.Diff(U,i)),e.start1-=o.length,e.start2-=o.length,e.length1+=o.length+i.length,e.length2+=o.length+i.length;}};T.prototype.patch_make=function(e,t,r){var n,o;if(typeof e=="string"&&typeof t=="string"&&typeof r>"u")n=e,o=this.diff_main(n,t,true),o.length>2&&(this.diff_cleanupSemantic(o),this.diff_cleanupEfficiency(o));else if(e&&typeof e=="object"&&typeof t>"u"&&typeof r>"u")o=e,n=this.diff_text1(o);else if(typeof e=="string"&&t&&typeof t=="object"&&typeof r>"u")n=e,o=t;else if(typeof e=="string"&&typeof t=="string"&&r&&typeof r=="object")n=e,o=r;else throw new Error("Unknown call format to patch_make.");if(o.length===0)return [];for(var i=[],a=new T.patch_obj,s=0,l=0,u=0,f=n,c=n,d=0;d<o.length;d++){var p=o[d][0],g=o[d][1];switch(!s&&p!==U&&(a.start1=l,a.start2=u),p){case J:a.diffs[s++]=o[d],a.length2+=g.length,c=c.substring(0,u)+g+c.substring(u);break;case Q:a.length1+=g.length,a.diffs[s++]=o[d],c=c.substring(0,u)+c.substring(u+g.length);break;case U:g.length<=2*this.Patch_Margin&&s&&o.length!=d+1?(a.diffs[s++]=o[d],a.length1+=g.length,a.length2+=g.length):g.length>=2*this.Patch_Margin&&s&&(this.patch_addContext_(a,f),i.push(a),a=new T.patch_obj,s=0,f=c,l=u);break}p!==J&&(l+=g.length),p!==Q&&(u+=g.length);}return s&&(this.patch_addContext_(a,f),i.push(a)),i};T.prototype.patch_deepCopy=function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r],o=new T.patch_obj;o.diffs=[];for(var i=0;i<n.diffs.length;i++)o.diffs[i]=new T.Diff(n.diffs[i][0],n.diffs[i][1]);o.start1=n.start1,o.start2=n.start2,o.length1=n.length1,o.length2=n.length2,t[r]=o;}return t};T.prototype.patch_apply=function(e,t){if(e.length==0)return [t,[]];e=this.patch_deepCopy(e);var r=this.patch_addPadding(e);t=r+t+r,this.patch_splitMax(e);for(var n=0,o=[],i=0;i<e.length;i++){var a=e[i].start2+n,s=this.diff_text1(e[i].diffs),l,u=-1;if(s.length>this.Match_MaxBits?(l=this.match_main(t,s.substring(0,this.Match_MaxBits),a),l!=-1&&(u=this.match_main(t,s.substring(s.length-this.Match_MaxBits),a+s.length-this.Match_MaxBits),(u==-1||l>=u)&&(l=-1))):l=this.match_main(t,s,a),l==-1)o[i]=false,n-=e[i].length2-e[i].length1;else {o[i]=true,n=l-a;var f;if(u==-1?f=t.substring(l,l+s.length):f=t.substring(l,u+this.Match_MaxBits),s==f)t=t.substring(0,l)+this.diff_text2(e[i].diffs)+t.substring(l+s.length);else {var c=this.diff_main(s,f,false);if(s.length>this.Match_MaxBits&&this.diff_levenshtein(c)/s.length>this.Patch_DeleteThreshold)o[i]=false;else {this.diff_cleanupSemanticLossless(c);for(var d=0,p,g=0;g<e[i].diffs.length;g++){var m=e[i].diffs[g];m[0]!==U&&(p=this.diff_xIndex(c,d)),m[0]===J?t=t.substring(0,l+p)+m[1]+t.substring(l+p):m[0]===Q&&(t=t.substring(0,l+p)+t.substring(l+this.diff_xIndex(c,d+m[1].length))),m[0]!==Q&&(d+=m[1].length);}}}}}return t=t.substring(r.length,t.length-r.length),[t,o]};T.prototype.patch_addPadding=function(e){for(var t=this.Patch_Margin,r="",n=1;n<=t;n++)r+=String.fromCharCode(n);for(var n=0;n<e.length;n++)e[n].start1+=t,e[n].start2+=t;var o=e[0],i=o.diffs;if(i.length==0||i[0][0]!=U)i.unshift(new T.Diff(U,r)),o.start1-=t,o.start2-=t,o.length1+=t,o.length2+=t;else if(t>i[0][1].length){var a=t-i[0][1].length;i[0][1]=r.substring(i[0][1].length)+i[0][1],o.start1-=a,o.start2-=a,o.length1+=a,o.length2+=a;}if(o=e[e.length-1],i=o.diffs,i.length==0||i[i.length-1][0]!=U)i.push(new T.Diff(U,r)),o.length1+=t,o.length2+=t;else if(t>i[i.length-1][1].length){var a=t-i[i.length-1][1].length;i[i.length-1][1]+=r.substring(0,a),o.length1+=a,o.length2+=a;}return r};T.prototype.patch_splitMax=function(e){for(var t=this.Match_MaxBits,r=0;r<e.length;r++)if(!(e[r].length1<=t)){var n=e[r];e.splice(r--,1);for(var o=n.start1,i=n.start2,a="";n.diffs.length!==0;){var s=new T.patch_obj,l=true;for(s.start1=o-a.length,s.start2=i-a.length,a!==""&&(s.length1=s.length2=a.length,s.diffs.push(new T.Diff(U,a)));n.diffs.length!==0&&s.length1<t-this.Patch_Margin;){var u=n.diffs[0][0],f=n.diffs[0][1];u===J?(s.length2+=f.length,i+=f.length,s.diffs.push(n.diffs.shift()),l=false):u===Q&&s.diffs.length==1&&s.diffs[0][0]==U&&f.length>2*t?(s.length1+=f.length,o+=f.length,l=false,s.diffs.push(new T.Diff(u,f)),n.diffs.shift()):(f=f.substring(0,t-s.length1-this.Patch_Margin),s.length1+=f.length,o+=f.length,u===U?(s.length2+=f.length,i+=f.length):l=false,s.diffs.push(new T.Diff(u,f)),f==n.diffs[0][1]?n.diffs.shift():n.diffs[0][1]=n.diffs[0][1].substring(f.length));}a=this.diff_text2(s.diffs),a=a.substring(a.length-this.Patch_Margin);var c=this.diff_text1(n.diffs).substring(0,this.Patch_Margin);c!==""&&(s.length1+=c.length,s.length2+=c.length,s.diffs.length!==0&&s.diffs[s.diffs.length-1][0]===U?s.diffs[s.diffs.length-1][1]+=c:s.diffs.push(new T.Diff(U,c))),l||e.splice(++r,0,s);}}};T.prototype.patch_toText=function(e){for(var t=[],r=0;r<e.length;r++)t[r]=e[r];return t.join("")};T.prototype.patch_fromText=function(e){var t=[];if(!e)return t;for(var r=e.split(`
|
|
7
|
-
`),n=0,
|
|
8
|
-
`],n,
|
|
9
|
-
`;}return r.join("").replace(/%20/g," ")};It.exports=T;It.exports.diff_match_patch=T;It.exports.DIFF_DELETE=
|
|
10
|
-
`):r,
|
|
11
|
-
`+i;return
|
|
12
|
-
`+i):(
|
|
13
|
-
`+i),new n8nWorkflow.NodeApiError(this.getNode(),{message:i,errors:o},{message:s,description:l,itemIndex:t})}return a.includes("invalid docx")||a.includes("missing word/document.xml")?new n8nWorkflow.NodeApiError(this.getNode(),{message:r},{message:"The document could not be opened.",description:"Verify the input binary is a valid .docx file (not .doc, .pdf, or another format).",itemIndex:t}):new n8nWorkflow.NodeApiError(this.getNode(),{message:r},{message:"Adeu engine error.",description:r,itemIndex:t})}h(On,"mapAdeuErrorToNodeApiError");function Qo(e){if(!e||typeof e!="object")return false;let t=e;return typeof t.id=="string"&&typeof t.fileName=="string"&&typeof t.mimeType=="string"}h(Qo,"isStashedBinaryEntry");var Pn=[{displayName:"Static Data Key",name:"staticDataKey",type:"string",default:"adeu_last_redlined",required:true,placeholder:"e.g. adeu_last_redlined",description:"Key in workflow global static data to read the stashed binary metadata from (string). When the Apply Edits operation runs as an AI Agent tool, n8n's tool wrapper strips the binary from its output before any downstream node can see it. To work around that, Apply Edits writes the binary's storage id into workflow static data under 'adeu_last_redlined'. This operation reads that entry back, fetches the original buffer via getBinaryStream, and attaches a fresh IBinaryData onto the outgoing item. Leave the default unless you've customized the stash key on the Apply Edits side.",displayOptions:{show:{resource:["document"],operation:["hydrateToolOutput"]}}},{displayName:"Output Binary Property",name:"outputBinaryPropertyName",type:"string",default:"data",required:true,placeholder:"e.g. data",description:"Name of the binary property on the outgoing item that will hold the hydrated .docx (string, e.g. 'data'). Downstream nodes (e.g. Write Binary File, Gmail send) should be configured to read from this property name.",displayOptions:{show:{resource:["document"],operation:["hydrateToolOutput"]}}},{displayName:"On Missing",name:"onMissing",type:"options",default:"emit_empty",description:"What to do when no stashed binary entry is found under the configured key. 'Emit Empty' is the typical AI Agent path: emits an item with json.hydrated=false and no binary, so a downstream If node can gate any write step on whether the LLM actually called Apply Edits this turn. 'Throw' is for deterministic pipelines where the stash MUST be present and a missing entry indicates a workflow bug.",options:[{name:"Emit Empty",value:"emit_empty",description:"Emit a single item with json.hydrated=false and no binary. Downstream If on json.hydrated gates the write."},{name:"Throw",value:"throw",description:"Throw a NodeOperationError. Use when a missing stash indicates a workflow bug."}],displayOptions:{show:{resource:["document"],operation:["hydrateToolOutput"]}}},{displayName:"Clear After Read",name:"clearAfterRead",type:"boolean",default:true,description:"Whether to delete the static data entry after a successful hydration so it does not leak across workflow runs. Set false if you want to inspect or re-read the entry from a later node in the same run.",displayOptions:{show:{resource:["document"],operation:["hydrateToolOutput"]}}},{displayName:"Output Path Template",name:"outputPathTemplate",type:"string",default:"",placeholder:"e.g. C:\\Users\\Uzair\\.n8n-files\\{baseName}_{timestamp}.docx",description:"Optional template to compute the final write path on disk, returned on the output JSON as 'outputPath'. If set, you can configure downstream Write nodes to simply read '{{ $json.outputPath }}' with zero escaping risks. Supports these placeholders: '{baseName}' (filename with extension stripped), '{timestamp}' (current ISO 8601 timestamp with colons and dots replaced by dashes for Windows file compatibility), '{fileName}' (the stashed filename including extension), and '{ext}' (e.g., '.docx').",displayOptions:{show:{resource:["document"],operation:["hydrateToolOutput"]}}}];async function Mn(e){let t=this.getNodeParameter("staticDataKey",e),r=this.getNodeParameter("outputBinaryPropertyName",e),n=this.getNodeParameter("onMissing",e),o=this.getNodeParameter("clearAfterRead",e),i=this.getWorkflowStaticData("global"),a=i[t];if(!Qo(a)){if(n==="throw")throw new n8nWorkflow.NodeOperationError(this.getNode(),`No stashed binary found under static data key "${t}".`,{description:"The Apply Edits operation writes a stash entry into workflow static data only when it runs as an AI Agent tool and produces a binary. Verify that Apply Edits was actually called by the agent this turn, that it ran successfully, and that the key matches the one used on the writing side.",itemIndex:e});return [{json:{hydrated:false},pairedItem:{item:e}}]}let{id:s,fileName:l,mimeType:u}=a,f;try{let m=await this.helpers.getBinaryStream(s);f=await this.helpers.binaryToBuffer(m);}catch(m){throw new n8nWorkflow.NodeOperationError(this.getNode(),`Failed to load stashed binary (id=${s}) from external storage.`,{description:`The stash entry under "${t}" points at binary id "${s}", but the underlying data could not be loaded. This usually means the binary has been garbage-collected (n8n's execution data retention may be too short) or external storage is unavailable. Underlying error: ${m.message}`,itemIndex:e})}let c=u||et,d=await this.helpers.prepareBinaryData(f,l,c);o&&delete i[t];let p=this.getNodeParameter("outputPathTemplate",e,""),g;if(p.trim()!==""){let m=l.replace(/\.docx$/i,""),b=l.match(/\.docx$/i)?.[0]??".docx",y=new Date().toISOString().replace(/[:.]/g,"-").replace(/Z$/,"");g=p.replaceAll("{baseName}",m).replaceAll("{timestamp}",y).replaceAll("{fileName}",l).replaceAll("{ext}",b);}return [{json:{hydrated:true,fileName:l,sourceBinaryId:s,mimeType:c,...g!==void 0?{outputPath:g}:{}},binary:{[r]:d},pairedItem:{item:e}}]}h(Mn,"executeHydrateToolOutput");var zn=Lr(Bn());var Jo=(0, zn.createRequire)("/"),ft,Zo,Ko;try{ft=Jo("worker_threads"),Zo=ft.Worker,Ko=ft.isMarkedAsUntransferable;}catch{}var te=Uint8Array,we=Uint16Array,Qr=Int32Array,ur=new te([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),lr=new te([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Wr=new te([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),jn=h(function(e,t){for(var r=new we(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var o=new Qr(r[30]),n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return {b:r,r:o}},"freb"),ft=jn(ur,2),Wn=ft.b,Hr=ft.r;Wn[28]=258,Hr[258]=28;var Hn=jn(lr,0),ea=Hn.b,Fn=Hn.r,Vr=new we(32768);for(V=0;V<32768;++V)Fe=(V&43690)>>1|(V&21845)<<1,Fe=(Fe&52428)>>2|(Fe&13107)<<2,Fe=(Fe&61680)>>4|(Fe&3855)<<4,Vr[V]=((Fe&65280)>>8|(Fe&255)<<8)>>1;var Fe,V,Oe=h((function(e,t,r){for(var n=e.length,o=0,i=new we(t);o<n;++o)e[o]&&++i[e[o]-1];var a=new we(t);for(o=1;o<t;++o)a[o]=a[o-1]+i[o-1]<<1;var s;if(r){s=new we(1<<t);var l=15-t;for(o=0;o<n;++o)if(e[o])for(var u=o<<4|e[o],f=t-e[o],c=a[e[o]-1]++<<f,d=c|(1<<f)-1;c<=d;++c)s[Vr[c]>>l]=u;}else for(s=new we(n),o=0;o<n;++o)e[o]&&(s[o]=Vr[a[e[o]-1]++]>>15-e[o]);return s}),"hMap"),je=new te(288);for(V=0;V<144;++V)je[V]=8;var V;for(V=144;V<256;++V)je[V]=9;var V;for(V=256;V<280;++V)je[V]=7;var V;for(V=280;V<288;++V)je[V]=8;var V,Bt=new te(32);for(V=0;V<32;++V)Bt[V]=5;var V,ta=Oe(je,9,0),ra=Oe(je,9,1),na=Oe(Bt,5,0),ia=Oe(Bt,5,1),Ur=h(function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},"max"),Te=h(function(e,t,r){var n=t/8|0;return (e[n]|e[n+1]<<8)>>(t&7)&r},"bits"),qr=h(function(e,t){var r=t/8|0;return (e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},"bits16"),Jr=h(function(e){return (e+7)/8|0},"shft"),Ft=h(function(e,t,r){return (t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length),new te(e.subarray(t,r))},"slc");var oa=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],he=h(function(e,t,r){var n=new Error(t||oa[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,he),!r)throw n;return n},"err"),aa=h(function(e,t,r,n){var o=e.length,i=n?n.length:0;if(!o||t.f&&!t.l)return r||new te(0);var a=!r,s=a||t.i!=2,l=t.i;a&&(r=new te(o*3));var u=h(function(kt){var Pt=r.length;if(kt>Pt){var ct=new te(Math.max(Pt*2,kt));ct.set(r),r=ct;}},"cbuf"),f=t.f||0,c=t.p||0,d=t.b||0,p=t.l,g=t.d,m=t.m,b=t.n,y=o*8;do{if(!p){f=Te(e,c,1);var w=Te(e,c+1,3);if(c+=3,w)if(w==1)p=ra,g=ia,m=9,b=5;else if(w==2){var E=Te(e,c,31)+257,A=Te(e,c+10,15)+4,N=E+Te(e,c+5,31)+1;c+=14;for(var C=new te(N),F=new te(19),k=0;k<A;++k)F[Wr[k]]=Te(e,c+k*3,7);c+=A*3;for(var R=Ur(F),j=(1<<R)-1,O=Oe(F,R,1),k=0;k<N;){var G=O[Te(e,c,j)];c+=G&15;var v=G>>4;if(v<16)C[k++]=v;else {var z=0,L=0;for(v==16?(L=3+Te(e,c,3),c+=2,z=C[k-1]):v==17?(L=3+Te(e,c,7),c+=3):v==18&&(L=11+Te(e,c,127),c+=7);L--;)C[k++]=z;}}var Y=C.subarray(0,E),I=C.subarray(E);m=Ur(Y),b=Ur(I),p=Oe(Y,m,1),g=Oe(I,b,1);}else he(1);else {var v=Jr(c)+4,_=e[v-4]|e[v-3]<<8,D=v+_;if(D>o){l&&he(0);break}s&&u(d+_),r.set(e.subarray(v,D),d),t.b=d+=_,t.p=c=D*8,t.f=f;continue}if(c>y){l&&he(0);break}}s&&u(d+131072);for(var Z=(1<<m)-1,ie=(1<<b)-1,oe=c;;oe=c){var z=p[qr(e,c)&Z],_e=z>>4;if(c+=z&15,c>y){l&&he(0);break}if(z||he(2),_e<256)r[d++]=_e;else if(_e==256){oe=c,p=null;break}else {var ve=_e-254;if(_e>264){var k=_e-257,ee=ur[k];ve=Te(e,c,(1<<ee)-1)+Wn[k],c+=ee;}var xe=g[qr(e,c)&ie],ut=xe>>4;xe||he(3),c+=xe&15;var I=ea[ut];if(ut>3){var ee=lr[ut];I+=qr(e,c)&(1<<ee)-1,c+=ee;}if(c>y){l&&he(0);break}s&&u(d+131072);var lt=d+ve;if(d<I){var ir=i-I,or=Math.min(I,lt);for(ir+d<0&&he(3);d<or;++d)r[d]=n[ir+d];}for(;d<lt;++d)r[d]=r[d-I];}}t.l=p,t.p=oe,t.b=d,t.f=f,p&&(f=1,t.m=m,t.d=g,t.n=b);}while(!f);return d!=r.length&&a?Ft(r,0,d):r.subarray(0,d)},"inflt"),Le=h(function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8;},"wbits"),Mt=h(function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16;},"wbits16"),zr=h(function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var o=r.length,i=r.slice();if(!o)return {t:Gn,l:0};if(o==1){var a=new te(r[0].s+1);return a[r[0].s]=1,{t:a,l:1}}r.sort(function(D,E){return D.f-E.f}),r.push({s:-1,f:25001});var s=r[0],l=r[1],u=0,f=1,c=2;for(r[0]={s:-1,f:s.f+l.f,l:s,r:l};f!=o-1;)s=r[r[u].f<r[c].f?u++:c++],l=r[u!=f&&r[u].f<r[c].f?u++:c++],r[f++]={s:-1,f:s.f+l.f,l:s,r:l};for(var d=i[0].s,n=1;n<o;++n)i[n].s>d&&(d=i[n].s);var p=new we(d+1),g=Gr(r[f-1],p,0);if(g>t){var n=0,m=0,b=g-t,y=1<<b;for(i.sort(function(E,A){return p[A.s]-p[E.s]||E.f-A.f});n<o;++n){var w=i[n].s;if(p[w]>t)m+=y-(1<<g-p[w]),p[w]=t;else break}for(m>>=b;m>0;){var v=i[n].s;p[v]<t?m-=1<<t-p[v]++-1:++n;}for(;n>=0&&m;--n){var _=i[n].s;p[_]==t&&(--p[_],++m);}g=t;}return {t:new te(p),l:g}},"hTree"),Gr=h(function(e,t,r){return e.s==-1?Math.max(Gr(e.l,t,r+1),Gr(e.r,t,r+1)):t[e.s]=r},"ln"),Ln=h(function(e){for(var t=e.length;t&&!e[--t];);for(var r=new we(++t),n=0,o=e[0],i=1,a=h(function(l){r[n++]=l;},"w"),s=1;s<=t;++s)if(e[s]==o&&s!=t)++i;else {if(!o&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0);}else if(i>3){for(a(o),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0);}for(;i--;)a(o);i=1,o=e[s];}return {c:r.subarray(0,n),n:t}},"lc"),Rt=h(function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},"clen"),Vn=h(function(e,t,r){var n=r.length,o=Jr(t+2);e[o]=n&255,e[o+1]=n>>8,e[o+2]=e[o]^255,e[o+3]=e[o+1]^255;for(var i=0;i<n;++i)e[o+i+4]=r[i];return (o+4+n)*8},"wfblk"),$n=h(function(e,t,r,n,o,i,a,s,l,u,f){Le(t,f++,r),++o[256];for(var c=zr(o,15),d=c.t,p=c.l,g=zr(i,15),m=g.t,b=g.l,y=Ln(d),w=y.c,v=y.n,_=Ln(m),D=_.c,E=_.n,A=new we(19),N=0;N<w.length;++N)++A[w[N]&31];for(var N=0;N<D.length;++N)++A[D[N]&31];for(var C=zr(A,7),F=C.t,k=C.l,R=19;R>4&&!F[Wr[R-1]];--R);var j=u+5<<3,O=Rt(o,je)+Rt(i,Bt)+a,G=Rt(o,d)+Rt(i,m)+a+14+3*R+Rt(A,F)+2*A[16]+3*A[17]+7*A[18];if(l>=0&&j<=O&&j<=G)return Vn(t,f,e.subarray(l,l+u));var z,L,Y,I;if(Le(t,f,1+(G<O)),f+=2,G<O){z=Oe(d,p,0),L=d,Y=Oe(m,b,0),I=m;var Z=Oe(F,k,0);Le(t,f,v-257),Le(t,f+5,E-1),Le(t,f+10,R-4),f+=14;for(var N=0;N<R;++N)Le(t,f+3*N,F[Wr[N]]);f+=3*R;for(var ie=[w,D],oe=0;oe<2;++oe)for(var _e=ie[oe],N=0;N<_e.length;++N){var ve=_e[N]&31;Le(t,f,Z[ve]),f+=F[ve],ve>15&&(Le(t,f,_e[N]>>5&127),f+=_e[N]>>12);}}else z=ta,L=je,Y=na,I=Bt;for(var N=0;N<s;++N){var ee=n[N];if(ee>255){var ve=ee>>18&31;Mt(t,f,z[ve+257]),f+=L[ve+257],ve>7&&(Le(t,f,ee>>23&31),f+=ur[ve]);var xe=ee&31;Mt(t,f,Y[xe]),f+=I[xe],xe>3&&(Mt(t,f,ee>>5&8191),f+=lr[xe]);}else Mt(t,f,z[ee]),f+=L[ee];}return Mt(t,f,z[256]),f+L[256]},"wblk"),sa=new Qr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Gn=new te(0),ua=h(function(e,t,r,n,o,i){var a=i.z||e.length,s=new te(n+a+5*(1+Math.ceil(a/7e3))+o),l=s.subarray(n,s.length-o),u=i.l,f=(i.r||0)&7;if(t){f&&(l[0]=i.r>>3);for(var c=sa[t-1],d=c>>13,p=c&8191,g=(1<<r)-1,m=i.p||new we(32768),b=i.h||new we(g+1),y=Math.ceil(r/3),w=2*y,v=h(function(Br){return (e[Br]^e[Br+1]<<y^e[Br+2]<<w)&g},"hsh"),_=new Qr(25e3),D=new we(288),E=new we(32),A=0,N=0,C=i.i||0,F=0,k=i.w||0,R=0;C+2<a;++C){var j=v(C),O=C&32767,G=b[j];if(m[O]=G,b[j]=O,k<=C){var z=a-C;if((A>7e3||F>24576)&&(z>423||!u)){f=$n(e,l,0,_,D,E,N,F,R,C-R,f),F=A=N=0,R=C;for(var L=0;L<286;++L)D[L]=0;for(var L=0;L<30;++L)E[L]=0;}var Y=2,I=0,Z=p,ie=O-G&32767;if(z>2&&j==v(C-ie))for(var oe=Math.min(d,z)-1,_e=Math.min(32767,C),ve=Math.min(258,z);ie<=_e&&--Z&&O!=G;){if(e[C+Y]==e[C+Y-ie]){for(var ee=0;ee<ve&&e[C+ee]==e[C+ee-ie];++ee);if(ee>Y){if(Y=ee,I=ie,ee>oe)break;for(var xe=Math.min(ie,ee-2),ut=0,L=0;L<xe;++L){var lt=C-ie+L&32767,ir=m[lt],or=lt-ir&32767;or>ut&&(ut=or,G=lt);}}}O=G,G=m[O],ie+=O-G&32767;}if(I){_[F++]=268435456|Hr[Y]<<18|Fn[I];var kt=Hr[Y]&31,Pt=Fn[I]&31;N+=ur[kt]+lr[Pt],++D[257+kt],++E[Pt],k=C+Y,++A;}else _[F++]=e[C],++D[e[C]];}}for(C=Math.max(C,k);C<a;++C)_[F++]=e[C],++D[e[C]];f=$n(e,l,u,_,D,E,N,F,R,C-R,f),u||(i.r=f&7|l[f/8|0]<<3,f-=7,i.h=b,i.p=m,i.i=C,i.w=k);}else {for(var C=i.w||0;C<a+u;C+=65535){var ct=C+65535;ct>=a&&(l[f/8|0]=u,ct=a),f=Vn(l,f+1,e.subarray(C,ct));}i.i=a;}return Ft(s,0,n+Jr(f)+o)},"dflt"),la=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(r&1&&-306674912)^r>>>1;e[t]=r;}return e})(),ca=h(function(){var e=-1;return {p:h(function(t){for(var r=e,n=0;n<t.length;++n)r=la[r&255^t[n]]^r>>>8;e=r;},"p"),d:h(function(){return ~e},"d")}},"crc");var fa=h(function(e,t,r,n,o){if(!o&&(o={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),a=new te(i.length+e.length);a.set(i),a.set(e,i.length),e=a,o.w=i.length;}return ua(e,t.level==null?6:t.level,t.mem==null?o.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,r,n,o)},"dopt"),Xn=h(function(e,t){var r={};for(var n in e)r[n]=e[n];for(var n in t)r[n]=t[n];return r},"mrg");var Ie=h(function(e,t){return e[t]|e[t+1]<<8},"b2"),Ee=h(function(e,t){return (e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},"b4"),jr=h(function(e,t){return Ee(e,t)+Ee(e,t+4)*4294967296},"b8"),ue=h(function(e,t,r){for(;r;++t)e[t]=r,r>>>=8;},"wbytes");function ha(e,t){return fa(e,t||{},0,0)}h(ha,"deflateSync");function da(e,t){return aa(e,{i:2},t&&t.out,t&&t.dictionary)}h(da,"inflateSync");var Yn=h(function(e,t,r,n){for(var o in e){var i=e[o],a=t+o,s=n;Array.isArray(i)&&(s=Xn(n,i[1]),i=i[0]),ArrayBuffer.isView(i)?r[a]=[i,s]:(r[a+="/"]=[new te(0),s],Yn(i,a,r,n));}},"fltn"),Un=typeof TextEncoder<"u"&&new TextEncoder,Xr=typeof TextDecoder<"u"&&new TextDecoder,pa=0;try{Xr.decode(Gn,{stream:!0}),pa=1;}catch{}var ma=h(function(e){for(var t="",r=0;;){var n=e[r++],o=(n>127)+(n>223)+(n>239);if(r+o>e.length)return {s:t,r:Ft(e,r-1)};o?o==3?(n=((n&15)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,t+=String.fromCharCode(55296|n>>10,56320|n&1023)):o&1?t+=String.fromCharCode((n&31)<<6|e[r++]&63):t+=String.fromCharCode((n&15)<<12|(e[r++]&63)<<6|e[r++]&63):t+=String.fromCharCode(n);}},"dutf8");function sr(e,t){if(t){for(var r=new te(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}if(Un)return Un.encode(e);for(var o=e.length,i=new te(e.length+(e.length>>1)),a=0,s=h(function(f){i[a++]=f;},"w"),n=0;n<o;++n){if(a+5>i.length){var l=new te(a+8+(o-n<<1));l.set(i),i=l;}var u=e.charCodeAt(n);u<128||t?s(u):u<2048?(s(192|u>>6),s(128|u&63)):u>55295&&u<57344?(u=65536+(u&1047552)|e.charCodeAt(++n)&1023,s(240|u>>18),s(128|u>>12&63),s(128|u>>6&63),s(128|u&63)):(s(224|u>>12),s(128|u>>6&63),s(128|u&63));}return Ft(i,0,a)}h(sr,"strToU8");function cr(e,t){if(t){for(var r="",n=0;n<e.length;n+=16384)r+=String.fromCharCode.apply(null,e.subarray(n,n+16384));return r}else {if(Xr)return Xr.decode(e);var o=ma(e),i=o.s,r=o.r;return r.length&&he(8),i}}h(cr,"strFromU8");var ga=h(function(e,t){return t+30+Ie(e,t+26)+Ie(e,t+28)},"slzh"),_a=h(function(e,t,r){var n=Ie(e,t+28),o=Ie(e,t+30),i=cr(e.subarray(t+46,t+46+n),!(Ie(e,t+8)&2048)),a=t+46+n,s=va(e,a,o,r,Ee(e,t+20),Ee(e,t+24),Ee(e,t+42)),l=s[0],u=s[1],f=s[2];return [Ie(e,t+10),l,u,i,a+o+Ie(e,t+32),f]},"zh"),va=h(function(e,t,r,n,o,i,a){var s=o==4294967295,l=i==4294967295,u=a==4294967295,f=t+r,c=s+l+u;if(n&&c){for(;t+4<f;t+=4+Ie(e,t+2))if(Ie(e,t)==1)return [s?jr(e,t+4+8*l):o,l?jr(e,t+4):i,u?jr(e,t+4+8*(l+s)):a,1];n<2&&he(13);}return [o,i,a,0]},"z64hs"),Yr=h(function(e){var t=0;if(e)for(var r in e){var n=e[r].length;n>65535&&he(9),t+=n+4;}return t},"exfl"),qn=h(function(e,t,r,n,o,i,a,s){var l=n.length,u=r.extra,f=s&&s.length,c=Yr(u);ue(e,t,a!=null?33639248:67324752),t+=4,a!=null&&(e[t++]=20,e[t++]=r.os),e[t]=20,t+=2,e[t++]=r.flag<<1|(i<0&&8),e[t++]=o&&8,e[t++]=r.compression&255,e[t++]=r.compression>>8;var d=new Date(r.mtime==null?Date.now():r.mtime),p=d.getFullYear()-1980;if((p<0||p>119)&&he(10),ue(e,t,p<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>1),t+=4,i!=-1&&(ue(e,t,r.crc),ue(e,t+4,i<0?-i-2:i),ue(e,t+8,r.size)),ue(e,t+12,l),ue(e,t+14,c),t+=16,a!=null&&(ue(e,t,f),ue(e,t+6,r.attrs),ue(e,t+10,a),t+=14),e.set(n,t),t+=l,c)for(var g in u){var m=u[g],b=m.length;ue(e,t,+g),ue(e,t+2,b),e.set(m,t+4),t+=4+b;}return f&&(e.set(s,t),t+=f),t},"wzh"),wa=h(function(e,t,r,n,o){ue(e,t,101010256),ue(e,t+8,r),ue(e,t+10,r),ue(e,t+12,n),ue(e,t+16,o);},"wzf");function Qn(e,t){t||(t={});var r={},n=[];Yn(e,"",r,t);var o=0,i=0;for(var a in r){var s=r[a],l=s[0],u=s[1],f=u.level==0?0:8,c=sr(a),d=c.length,p=u.comment,g=p&&sr(p),m=g&&g.length,b=Yr(u.extra);d>65535&&he(11);var y=f?ha(l,u):l,w=y.length,v=ca();v.p(l),n.push(Xn(u,{size:l.length,crc:v.d(),c:y,f:c,m:g,u:d!=a.length||g&&p.length!=m,o,compression:f})),o+=30+d+b+w,i+=76+2*(d+b)+(m||0)+w;}for(var _=new te(i+22),D=o,E=i-o,A=0;A<n.length;++A){var c=n[A];qn(_,c.o,c,c.f,c.u,c.c.length);var N=30+c.f.length+Yr(c.extra);_.set(c.c,c.o+N),qn(_,o,c,c.f,c.u,c.c.length,c.o,c.m),o+=16+N+(c.m?c.m.length:0);}return wa(_,o,n.length,E,D),_}h(Qn,"zipSync");function Jn(e,t){for(var r={},n=e.length-22;Ee(e,n)!=101010256;--n)(!n||e.length-n>65558)&&he(13);var o=Ie(e,n+8);if(!o)return {};var i=Ee(e,n+16),a=Ee(e,n-20)==117853008;if(a){var s=Ee(e,n-12);a=Ee(e,s)==101075792,a&&(o=Ee(e,s+32),i=Ee(e,s+48));}for(var l=t&&t.filter,u=0;u<o;++u){var f=_a(e,i,a),c=f[0],d=f[1],p=f[2],g=f[3],m=f[4],b=f[5],y=ga(e,b);i=m,(!l||l({name:g,size:d,originalSize:p,compression:c}))&&(c?c==8?r[g]=da(e.subarray(y,y+d),{out:new te(p)}):he(14,"unknown compression type "+c):r[g]=Ft(e,y,y+d));}return r}h(Jn,"unzipSync");var kr=Lr(ao()),xo=Lr(so());function P(e,t){for(let r=0;r<e.childNodes.length;r++){let n=e.childNodes[r];if(n.nodeType===1&&n.tagName===t)return n}return null}h(P,"findChild");function cu(e,t){let r=[];for(let n=0;n<e.childNodes.length;n++){let o=e.childNodes[n];o.nodeType===1&&o.tagName===t&&r.push(o);}return r}h(cu,"findChildren");function x(e,t){return Array.from(e.getElementsByTagName(t))}h(x,"findAllDescendants");function En(e){return e.startsWith("\uFEFF")&&(e=e.slice(1)),new kr.DOMParser().parseFromString(e,"text/xml")}h(En,"parseXml");function fu(e){let t=new kr.XMLSerializer().serializeToString(e),n=/<([a-zA-Z0-9_:]+)(\s+[^>]+?)(>|\/>)/.exec(t);if(n&&!n[1].startsWith("?")){let o=n.index,i=t.substring(0,o);if(!i.includes("<")||i.trim().startsWith("<?xml")&&(i.match(/</g)||[]).length===1){let s=n[0],l=`<${n[1]}`,u=n[2],f=n[3],c=/([a-zA-Z0-9_:]+)\s*=\s*(["'])(.*?)\2/g,d=[],p;for(;(p=c.exec(u))!==null;)d.push(p[0].trim());d.sort((m,b)=>{let y=m.split("=")[0].trim(),w=b.split("=")[0].trim(),v=y.startsWith("xmlns"),_=w.startsWith("xmlns");return v&&!_?-1:!v&&_?1:y<w?-1:y>w?1:0});let g=d.length>0?`${l} ${d.join(" ")}${f}`:`${l}${f}`;t=t.substring(0,o)+g+t.substring(o+s.length);}}return t}h(fu,"serializeXml");var Ir=class{static{h(this,"Relationship");}constructor(e,t,r,n){this.id=e,this.type=t,this.target=r,this.isExternal=n;}id;type;target;isExternal},po=class{static{h(this,"Part");}constructor(e,t,r,n){this.partname=e,this.blob=t,this.contentType=n,this._element=r;}partname;blob;contentType;rels=new Map;_element;package;addRelationship(e,t,r,n=false){if(this.rels.set(e,new Ir(e,t,r,n)),this.partname.endsWith(".rels")){let o=this._element.ownerDocument;if(o){let i=o.createElementNS("http://schemas.openxmlformats.org/package/2006/relationships","Relationship");i.setAttribute("Id",e),i.setAttribute("Type",t),i.setAttribute("Target",r),n&&i.setAttribute("TargetMode","External"),this._element.appendChild(i);}}}},hu=class{static{h(this,"DocxPackage");}constructor(e){this.unzipped=e;}unzipped;parts=[];mainDocumentPart;getPartByPath(e){let t=e.startsWith("/")?e.substring(1):e;return this.parts.find(r=>r.partname===t||r.partname==="/"+t)}nextPartname(e){let t=1;for(;;){let r=e.replace("%d",t===1?"":t.toString());if(!this.getPartByPath(r))return r;t++;}}addPart(e,t,r){let n=En(r),o=new po(e,r,n.documentElement,t);o.package=this,this.parts.push(o);let i=this.getPartByPath("[Content_Types].xml");if(i){let a=i._element.ownerDocument;if(a){let s=a.createElement("Override");s.setAttribute("PartName",e),s.setAttribute("ContentType",t),i._element.appendChild(s);}}return o}getOrCreateRelsPart(e){let t=e.split("/"),r=t.pop(),n=t.join("/")+"/_rels/"+r+".rels",o=this.getPartByPath(n);return o||(o=this.addPart(n,"application/vnd.openxmlformats-package.relationships+xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
14
|
-
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"></Relationships>`)),
|
|
15
|
-
`+r),this.pkg.unzipped[t.partname.substring(1)]=sr(r);}return Buffer.from(Qn(this.pkg.unzipped))}},Ze=class{static{h(this,"Paragraph");}constructor(e,t){this._element=e,this._parent=t;}_element;_parent;get text(){let e="",t=this._element.getElementsByTagName("w:t");for(let r=0;r<t.length;r++)e+=t[r].textContent||"";return e}},Ke=class{static{h(this,"Run");}constructor(e,t){this._element=e,this._parent=t;}_element;_parent},du=class{static{h(this,"Cell");}constructor(e,t){this._element=e,this._parent=t;}_element;_parent},pu=class{static{h(this,"Row");}constructor(e,t){this._element=e,this._parent=t;let r=this._element.getElementsByTagName("w:tc");for(let n=0;n<r.length;n++)this.cells.push(new du(r[n],this));}_element;_parent;cells=[]},Dn=class{static{h(this,"Table");}constructor(e,t){this._element=e,this._parent=t;let r=this._element.getElementsByTagName("w:tr");for(let n=0;n<r.length;n++)this.rows.push(new pu(r[n],this));}_element;_parent;rows=[]},uo=class{static{h(this,"NotesPart");}constructor(e,t){this.part=e,this.note_type=t,this._element=e._element;}part;note_type;_element},mu=class{static{h(this,"FootnoteItem");}constructor(e,t,r){this._element=e,this._parent=t,this.note_type=r,this.id=e.getAttribute("w:id")||"",this.part=t.part;}_element;_parent;note_type;id;part},ze={w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",w16cid:"http://schemas.microsoft.com/office/word/2016/wordml/cid",w16cex:"http://schemas.microsoft.com/office/word/2018/wordml/cex",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006"},ye={COMMENTS:"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml",EXTENDED:"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml",IDS:"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsIds+xml",EXTENSIBLE:"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtensible+xml"},Ye={COMMENTS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",EXTENDED:"http://schemas.microsoft.com/office/2011/relationships/commentsExtended",IDS:"http://schemas.microsoft.com/office/2016/09/relationships/commentsIds",EXTENSIBLE:"http://schemas.microsoft.com/office/2018/08/relationships/commentsExtensible"},Pr=class{static{h(this,"CommentsManager");}constructor(e){this.doc=e;}doc;_commentsPart=null;_extendedPart=null;_idsPart=null;_extensiblePart=null;_nextId=null;get commentsPart(){return this._commentsPart||(this._commentsPart=this._getOrCreateCommentsPart(),this._ensureNamespaces()),this._commentsPart}get extendedPart(){return this._extendedPart||(this._extendedPart=this._getOrCreateExtendedPart()),this._extendedPart}get idsPart(){return this._idsPart||(this._idsPart=this._getOrCreateIdsPart()),this._idsPart}get extensiblePart(){return this._extensiblePart||(this._extensiblePart=this._getOrCreateExtensiblePart()),this._extensiblePart}get nextId(){return this._nextId===null&&(this._nextId=this._getNextCommentId()),this._nextId}set nextId(e){this._nextId=e;}_getExistingPartByType(e){return this.doc.pkg.parts.find(t=>t.contentType===e)||null}_linkPart(e,t){for(let r of this.doc.part.rels.values())if(!r.isExternal&&r.target===e.partname.split("/").pop())return e;return this.doc.relateTo(e,t),e}_getOrCreateCommentsPart(){let e=this._getExistingPartByType(ye.COMMENTS);if(e)return this._linkPart(e,Ye.COMMENTS);let t=this.doc.pkg.nextPartname("/word/comments%d.xml"),r=`<w:comments xmlns:w="${ze.w}" xmlns:w14="${ze.w14}" xmlns:w15="${ze.w15}" xmlns:w16cid="${ze.w16cid}" xmlns:w16cex="${ze.w16cex}" xmlns:mc="${ze.mc}" mc:Ignorable="w14 w15 w16cid w16cex"></w:comments>`;return e=this.doc.pkg.addPart(t,ye.COMMENTS,r),this.doc.relateTo(e,Ye.COMMENTS),e}_getOrCreateExtendedPart(){let e=this._getExistingPartByType(ye.EXTENDED);if(e)return this._linkPart(e,Ye.EXTENDED);let t=this.doc.pkg.nextPartname("/word/commentsExtended%d.xml"),r=`<w15:commentsEx xmlns:w15="${ze.w15}"></w15:commentsEx>`;return e=this.doc.pkg.addPart(t,ye.EXTENDED,r),this.doc.relateTo(e,Ye.EXTENDED),e}_getOrCreateIdsPart(){let e=this._getExistingPartByType(ye.IDS);if(e)return this._linkPart(e,Ye.IDS);let t=this.doc.pkg.nextPartname("/word/commentsIds%d.xml"),r=`<w16cid:commentsIds xmlns:w16cid="${ze.w16cid}"></w16cid:commentsIds>`;return e=this.doc.pkg.addPart(t,ye.IDS,r),this.doc.relateTo(e,Ye.IDS),e}_getOrCreateExtensiblePart(){let e=this._getExistingPartByType(ye.EXTENSIBLE);if(e)return this._linkPart(e,Ye.EXTENSIBLE);let t=this.doc.pkg.nextPartname("/word/commentsExtensible%d.xml"),r=`<w16cex:commentsExtensible xmlns:w16cex="${ze.w16cex}"></w16cex:commentsExtensible>`;return e=this.doc.pkg.addPart(t,ye.EXTENSIBLE,r),this.doc.relateTo(e,Ye.EXTENSIBLE),e}_ensureNamespaces(){}_getNextCommentId(){let e=[0],t=this._getExistingPartByType(ye.COMMENTS);if(t){let r=x(t._element,"w:comment");for(let n of r){let o=n.getAttribute("w:id");o&&e.push(parseInt(o,10)||0);}}return Math.max(...e)+1}_generateHexId(){return Math.floor(Math.random()*4294967295).toString(16).toUpperCase().padStart(8,"0")}_getInitials(e){return e?e.split(" ").filter(Boolean).map(t=>t[0]).join("").toUpperCase():""}_findParaIdForComment(e){if(!this._commentsPart)return null;for(let t of x(this._commentsPart._element,"w:comment"))if(t.getAttribute("w:id")===e)for(let r of x(t,"w:p")){let n=r.getAttribute("w14:paraId");if(n)return n}return null}_findThreadRootParaId(e){let t=this._findParaIdForComment(e),r=this._getExistingPartByType(ye.EXTENDED);if(!t||!r)return t;for(let n=0;n<r._element.childNodes.length;n++){let o=r._element.childNodes[n];if(o.nodeType===1&&o.getAttribute("w15:paraId")===t){let i=o.getAttribute("w15:paraIdParent");if(i)return i}}return t}addComment(e,t,r=null){let n=this.nextId.toString();this.nextId++;let o=new Date().toISOString().replace(/\.\d{3}Z$/,"Z"),i=this.commentsPart._element.ownerDocument,a=i.createElement("w:comment");a.setAttribute("w:id",n),a.setAttribute("w:author",e),a.setAttribute("w:date",o);let s=this._getInitials(e);s&&a.setAttribute("w:initials",s);let l=this._getExistingPartByType(ye.EXTENDED);r&&!l&&a.setAttribute("w15:p",r);let u=this._generateHexId(),f=this._generateHexId(),c=i.createElement("w:p");c.setAttribute("w14:paraId",u),c.setAttribute("w14:textId","77777777"),c.setAttribute("w:rsidR",f),c.setAttribute("w:rsidRDefault",f),c.setAttribute("w:rsidP",f);let d=i.createElement("w:pPr"),p=i.createElement("w:pStyle");p.setAttribute("w:val","CommentText"),d.appendChild(p),c.appendChild(d);let g=i.createElement("w:r"),m=i.createElement("w:rPr"),b=i.createElement("w:rStyle");b.setAttribute("w:val","CommentReference"),m.appendChild(b),g.appendChild(m),g.appendChild(i.createElement("w:annotationRef")),c.appendChild(g);let y=i.createElement("w:r"),w=i.createElement("w:t");if(w.textContent=t,y.appendChild(w),c.appendChild(y),a.appendChild(c),this.commentsPart._element.appendChild(a),this.extendedPart){let v=r?this._findThreadRootParaId(r):null,D=this.extendedPart._element.ownerDocument.createElement("w15:commentEx");D.setAttribute("w15:paraId",u),v&&D.setAttribute("w15:paraIdParent",v),D.setAttribute("w15:done","0"),this.extendedPart._element.appendChild(D);}if(this.idsPart){let _=this.idsPart._element.ownerDocument.createElement("w16cid:commentId");_.setAttribute("w16cid:paraId",u),_.setAttribute("w16cid:durableId",this._generateHexId()),this.idsPart._element.appendChild(_);}if(this.extensiblePart){let v=null;for(let _=0;_<this.idsPart._element.childNodes.length;_++){let D=this.idsPart._element.childNodes[_];if(D.nodeType===1&&D.getAttribute("w16cid:paraId")===u){v=D.getAttribute("w16cid:durableId");break}}if(v){let D=this.extensiblePart._element.ownerDocument.createElement("w16cex:commentExtensible");D.setAttribute("w16cex:durableId",v),D.setAttribute("w16cex:dateUtc",o),this.extensiblePart._element.appendChild(D);}}return n}deleteComment(e){if(!this._commentsPart)return;let t=null;for(let n of x(this._commentsPart._element,"w:comment"))if(n.getAttribute("w:id")===e){t=n;break}if(!t)return;let r=null;for(let n of x(t,"w:p")){let o=n.getAttribute("w14:paraId");if(o){r=o;break}}if(r){let n=[];if(this.extendedPart)for(let i=0;i<this.extendedPart._element.childNodes.length;i++){let a=this.extendedPart._element.childNodes[i];if(a.nodeType===1&&a.getAttribute("w15:paraIdParent")===r){let s=a.getAttribute("w15:paraId");if(s){for(let l of x(this._commentsPart._element,"w:comment"))for(let u of x(l,"w:p"))if(u.getAttribute("w14:paraId")===s){let f=l.getAttribute("w:id");f&&n.push(f);break}}}}for(let i of n)this.deleteComment(i);let o=null;if(this.idsPart){let i=[];for(let a=0;a<this.idsPart._element.childNodes.length;a++){let s=this.idsPart._element.childNodes[a];s.nodeType===1&&s.getAttribute("w16cid:paraId")===r&&(o=s.getAttribute("w16cid:durableId"),i.push(s));}i.forEach(a=>this.idsPart._element.removeChild(a));}if(this.extendedPart){let i=[];for(let a=0;a<this.extendedPart._element.childNodes.length;a++){let s=this.extendedPart._element.childNodes[a];s.nodeType===1&&s.getAttribute("w15:paraId")===r&&i.push(s);}i.forEach(a=>this.extendedPart._element.removeChild(a));}if(o&&this.extensiblePart){let i=[];for(let a=0;a<this.extensiblePart._element.childNodes.length;a++){let s=this.extensiblePart._element.childNodes[a];s.nodeType===1&&s.getAttribute("w16cex:durableId")===o&&i.push(s);}i.forEach(a=>this.extensiblePart._element.removeChild(a));}}t.parentNode&&t.parentNode.removeChild(t);}};function Mr(e){({part:e.mainDocumentPart,relateTo:h(()=>{},"relateTo")});let n={},o=e.parts.find(l=>l.contentType===ye.COMMENTS);if(!o)return n;let i={},a=x(o._element,"w:comment");for(let l of a){let u=l.getAttribute("w:id");if(!u)continue;let f=l.getAttribute("w:author")||"Unknown",c=l.getAttribute("w:date")||"",d=false,p=l.getAttribute("w15:done");(p==="1"||p==="true"||p==="on")&&(d=true);let g=l.getAttribute("w15:p")||null,m=x(l,"w:p");for(let w of m){let v=w.getAttribute("w14:paraId");v&&(i[v]=u);}let b=[];for(let w of m){let v=x(w,"w:t");for(let _ of v)_.textContent&&b.push(_.textContent);b.push(`
|
|
16
|
-
`);}let
|
|
5
|
+
`)}h(aa,"normalizeLineEndings");function oa(e){if(e=e||{},e.locator===void 0&&(e.locator=true),this.assign=e.assign||it.assign,this.domHandler=e.domHandler||xr,this.onError=e.onError||e.errorHandler,e.errorHandler&&typeof e.errorHandler!="function")throw new TypeError("errorHandler object is no longer supported, switch to onError!");e.errorHandler&&e.errorHandler("warning","The `errorHandler` option has been deprecated, use `onError` instead!",this),this.normalizeLineEndings=e.normalizeLineEndings||aa,this.locator=!!e.locator,this.xmlns=this.assign(Object.create(null),e.xmlns);}h(oa,"DOMParser");oa.prototype.parseFromString=function(e,t){if(!uu(t))throw new TypeError('DOMParser.parseFromString: the provided mimeType "'+t+'" is not valid.');var r=this.assign(Object.create(null),this.xmlns),n=ta.XML_ENTITIES,a=r[""]||null;ou(t)?(n=ta.HTML_ENTITIES,a=wn.HTML):t===ia.XML_SVG_IMAGE&&(a=wn.SVG),r[""]=a,r.xml=r.xml||wn.XML;var i=new this.domHandler({mimeType:t,defaultNamespace:a,onError:this.onError}),o=this.locator?{}:void 0;this.locator&&i.setDocumentLocator(o);var u=new lu;u.errorHandler=i,u.domBuilder=i;var l=!it.isHTMLMimeType(t);return l&&typeof e!="string"&&u.errorHandler.fatalError("source is not a string"),u.parse(this.normalizeLineEndings(String(e)),r,n),i.doc.documentElement||u.errorHandler.fatalError("missing root element"),i.doc};function xr(e){var t=e||{};this.mimeType=t.mimeType||ia.XML_APPLICATION,this.defaultNamespace=t.defaultNamespace||null,this.cdata=false,this.currentElement=void 0,this.doc=void 0,this.locator=void 0,this.onError=t.onError;}h(xr,"DOMHandler");function Tt(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber;}h(Tt,"position");xr.prototype={startDocument:h(function(){var e=new au;this.doc=su(this.mimeType)?e.createHTMLDocument(false):e.createDocument(this.defaultNamespace,"");},"startDocument"),startElement:h(function(e,t,r,n){var a=this.doc,i=a.createElementNS(e,r||t),o=n.length;Tr(this,i),this.currentElement=i,this.locator&&Tt(this.locator,i);for(var u=0;u<o;u++){var e=n.getURI(u),l=n.getValue(u),r=n.getQName(u),s=a.createAttributeNS(e,r);this.locator&&Tt(n.getLocator(u),s),s.value=s.nodeValue=l,i.setAttributeNode(s);}},"startElement"),endElement:h(function(e,t,r){this.currentElement=this.currentElement.parentNode;},"endElement"),startPrefixMapping:h(function(e,t){},"startPrefixMapping"),endPrefixMapping:h(function(e){},"endPrefixMapping"),processingInstruction:h(function(e,t){var r=this.doc.createProcessingInstruction(e,t);this.locator&&Tt(this.locator,r),Tr(this,r);},"processingInstruction"),ignorableWhitespace:h(function(e,t,r){},"ignorableWhitespace"),characters:h(function(e,t,r){if(e=na.apply(this,arguments),e){if(this.cdata)var n=this.doc.createCDATASection(e);else var n=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(e)&&this.doc.appendChild(n),this.locator&&Tt(this.locator,n);}},"characters"),skippedEntity:h(function(e){},"skippedEntity"),endDocument:h(function(){this.doc.normalize();},"endDocument"),setDocumentLocator:h(function(e){e&&(e.lineNumber=0),this.locator=e;},"setDocumentLocator"),comment:h(function(e,t,r){e=na.apply(this,arguments);var n=this.doc.createComment(e);this.locator&&Tt(this.locator,n),Tr(this,n);},"comment"),startCDATA:h(function(){this.cdata=true;},"startCDATA"),endCDATA:h(function(){this.cdata=false;},"endCDATA"),startDTD:h(function(e,t,r,n){var a=this.doc.implementation;if(a&&a.createDocumentType){var i=a.createDocumentType(e,t,r,n);this.locator&&Tt(this.locator,i),Tr(this,i),this.doc.doctype=i;}},"startDTD"),reportError:h(function(e,t){if(typeof this.onError=="function")try{this.onError(e,t,this);}catch(r){throw new ra("Reporting "+e+' "'+t+'" caused '+r,this.locator)}},"reportError"),warning:h(function(e){this.reportError("warning",e);},"warning"),error:h(function(e){this.reportError("error",e);},"error"),fatalError:h(function(e){throw this.reportError("fatalError",e),new ra(e,this.locator)},"fatalError")};function na(e,t,r){return typeof e=="string"?e.substr(t,r):e.length>=t+r||t?new java.lang.String(e,t,r)+"":e}h(na,"_toString");"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){xr.prototype[e]=function(){return null};});function Tr(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t);}h(Tr,"appendElement");function cu(e){if(e==="error")throw "onErrorStopParsing"}h(cu,"onErrorStopParsing");function fu(){throw "onWarningStopParsing"}h(fu,"onWarningStopParsing");xt.__DOMHandler=xr;xt.DOMParser=oa;xt.normalizeLineEndings=aa;xt.onErrorStopParsing=cu;xt.onWarningStopParsing=fu;});var ua=Ie(V=>{var St=rt();V.assign=St.assign;V.hasDefaultHTMLNamespace=St.hasDefaultHTMLNamespace;V.isHTMLMimeType=St.isHTMLMimeType;V.isValidMimeType=St.isValidMimeType;V.MIME_TYPE=St.MIME_TYPE;V.NAMESPACE=St.NAMESPACE;var Sr=Wt();V.DOMException=Sr.DOMException;V.DOMExceptionName=Sr.DOMExceptionName;V.ExceptionCode=Sr.ExceptionCode;V.ParseError=Sr.ParseError;var se=_n();V.Attr=se.Attr;V.CDATASection=se.CDATASection;V.CharacterData=se.CharacterData;V.Comment=se.Comment;V.Document=se.Document;V.DocumentFragment=se.DocumentFragment;V.DocumentType=se.DocumentType;V.DOMImplementation=se.DOMImplementation;V.Element=se.Element;V.Entity=se.Entity;V.EntityReference=se.EntityReference;V.LiveNodeList=se.LiveNodeList;V.NamedNodeMap=se.NamedNodeMap;V.Node=se.Node;V.NodeList=se.NodeList;V.Notation=se.Notation;V.ProcessingInstruction=se.ProcessingInstruction;V.Text=se.Text;V.XMLSerializer=se.XMLSerializer;var Ir=sa();V.DOMParser=Ir.DOMParser;V.normalizeLineEndings=Ir.normalizeLineEndings;V.onErrorStopParsing=Ir.onErrorStopParsing;V.onWarningStopParsing=Ir.onWarningStopParsing;});var la=Ie((tc,It)=>{var T=h(function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32;},"diff_match_patch"),J=-1,Z=1,q=0;T.Diff=function(e,t){return [e,t]};T.prototype.diff_main=function(e,t,r,n){typeof n>"u"&&(this.Diff_Timeout<=0?n=Number.MAX_VALUE:n=new Date().getTime()+this.Diff_Timeout*1e3);var a=n;if(e==null||t==null)throw new Error("Null input. (diff_main)");if(e==t)return e?[new T.Diff(q,e)]:[];typeof r>"u"&&(r=true);var i=r,o=this.diff_commonPrefix(e,t),u=e.substring(0,o);e=e.substring(o),t=t.substring(o),o=this.diff_commonSuffix(e,t);var l=e.substring(e.length-o);e=e.substring(0,e.length-o),t=t.substring(0,t.length-o);var s=this.diff_compute_(e,t,i,a);return u&&s.unshift(new T.Diff(q,u)),l&&s.push(new T.Diff(q,l)),this.diff_cleanupMerge(s),s};T.prototype.diff_compute_=function(e,t,r,n){var a;if(!e)return [new T.Diff(Z,t)];if(!t)return [new T.Diff(J,e)];var i=e.length>t.length?e:t,o=e.length>t.length?t:e,u=i.indexOf(o);if(u!=-1)return a=[new T.Diff(Z,i.substring(0,u)),new T.Diff(q,o),new T.Diff(Z,i.substring(u+o.length))],e.length>t.length&&(a[0][0]=a[2][0]=J),a;if(o.length==1)return [new T.Diff(J,e),new T.Diff(Z,t)];var l=this.diff_halfMatch_(e,t);if(l){var s=l[0],f=l[1],c=l[2],d=l[3],p=l[4],m=this.diff_main(s,c,r,n),g=this.diff_main(f,d,r,n);return m.concat([new T.Diff(q,p)],g)}return r&&e.length>100&&t.length>100?this.diff_lineMode_(e,t,n):this.diff_bisect_(e,t,n)};T.prototype.diff_lineMode_=function(e,t,r){var n=this.diff_linesToChars_(e,t);e=n.chars1,t=n.chars2;var a=n.lineArray,i=this.diff_main(e,t,false,r);this.diff_charsToLines_(i,a),this.diff_cleanupSemantic(i),i.push(new T.Diff(q,""));for(var o=0,u=0,l=0,s="",f="";o<i.length;){switch(i[o][0]){case Z:l++,f+=i[o][1];break;case J:u++,s+=i[o][1];break;case q:if(u>=1&&l>=1){i.splice(o-u-l,u+l),o=o-u-l;for(var c=this.diff_main(s,f,false,r),d=c.length-1;d>=0;d--)i.splice(o,0,c[d]);o=o+c.length;}l=0,u=0,s="",f="";break}o++;}return i.pop(),i};T.prototype.diff_bisect_=function(e,t,r){for(var n=e.length,a=t.length,i=Math.ceil((n+a)/2),o=i,u=2*i,l=new Array(u),s=new Array(u),f=0;f<u;f++)l[f]=-1,s[f]=-1;l[o+1]=0,s[o+1]=0;for(var c=n-a,d=c%2!=0,p=0,m=0,g=0,b=0,w=0;w<i&&!(new Date().getTime()>r);w++){for(var v=-w+p;v<=w-m;v+=2){var E=o+v,_;v==-w||v!=w&&l[E-1]<l[E+1]?_=l[E+1]:_=l[E-1]+1;for(var D=_-v;_<n&&D<a&&e.charAt(_)==t.charAt(D);)_++,D++;if(l[E]=_,_>n)m+=2;else if(D>a)p+=2;else if(d){var y=o+c-v;if(y>=0&&y<u&&s[y]!=-1){var N=n-s[y];if(_>=N)return this.diff_bisectSplit_(e,t,_,D,r)}}}for(var C=-w+g;C<=w-b;C+=2){var y=o+C,N;C==-w||C!=w&&s[y-1]<s[y+1]?N=s[y+1]:N=s[y-1]+1;for(var A=N-C;N<n&&A<a&&e.charAt(n-N-1)==t.charAt(a-A-1);)N++,A++;if(s[y]=N,N>n)b+=2;else if(A>a)g+=2;else if(!d){var E=o+c-C;if(E>=0&&E<u&&l[E]!=-1){var _=l[E],D=o+_-E;if(N=n-N,_>=N)return this.diff_bisectSplit_(e,t,_,D,r)}}}}return [new T.Diff(J,e),new T.Diff(Z,t)]};T.prototype.diff_bisectSplit_=function(e,t,r,n,a){var i=e.substring(0,r),o=t.substring(0,n),u=e.substring(r),l=t.substring(n),s=this.diff_main(i,o,false,a),f=this.diff_main(u,l,false,a);return s.concat(f)};T.prototype.diff_linesToChars_=function(e,t){var r=[],n={};r[0]="";function a(l){for(var s="",f=0,c=-1,d=r.length;c<l.length-1;){c=l.indexOf(`
|
|
6
|
+
`,f),c==-1&&(c=l.length-1);var p=l.substring(f,c+1);(n.hasOwnProperty?n.hasOwnProperty(p):n[p]!==void 0)?s+=String.fromCharCode(n[p]):(d==i&&(p=l.substring(f),c=l.length),s+=String.fromCharCode(d),n[p]=d,r[d++]=p),f=c+1;}return s}h(a,"diff_linesToCharsMunge_");var i=4e4,o=a(e);i=65535;var u=a(t);return {chars1:o,chars2:u,lineArray:r}};T.prototype.diff_charsToLines_=function(e,t){for(var r=0;r<e.length;r++){for(var n=e[r][1],a=[],i=0;i<n.length;i++)a[i]=t[n.charCodeAt(i)];e[r][1]=a.join("");}};T.prototype.diff_commonPrefix=function(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var r=0,n=Math.min(e.length,t.length),a=n,i=0;r<a;)e.substring(i,a)==t.substring(i,a)?(r=a,i=r):n=a,a=Math.floor((n-r)/2+r);return a};T.prototype.diff_commonSuffix=function(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var r=0,n=Math.min(e.length,t.length),a=n,i=0;r<a;)e.substring(e.length-a,e.length-i)==t.substring(t.length-a,t.length-i)?(r=a,i=r):n=a,a=Math.floor((n-r)/2+r);return a};T.prototype.diff_commonOverlap_=function(e,t){var r=e.length,n=t.length;if(r==0||n==0)return 0;r>n?e=e.substring(r-n):r<n&&(t=t.substring(0,r));var a=Math.min(r,n);if(e==t)return a;for(var i=0,o=1;;){var u=e.substring(a-o),l=t.indexOf(u);if(l==-1)return i;o+=l,(l==0||e.substring(a-o)==t.substring(0,o))&&(i=o,o++);}};T.prototype.diff_halfMatch_=function(e,t){if(this.Diff_Timeout<=0)return null;var r=e.length>t.length?e:t,n=e.length>t.length?t:e;if(r.length<4||n.length*2<r.length)return null;var a=this;function i(m,g,b){for(var w=m.substring(b,b+Math.floor(m.length/4)),v=-1,E="",_,D,y,N;(v=g.indexOf(w,v+1))!=-1;){var C=a.diff_commonPrefix(m.substring(b),g.substring(v)),A=a.diff_commonSuffix(m.substring(0,b),g.substring(0,v));E.length<A+C&&(E=g.substring(v-A,v)+g.substring(v,v+C),_=m.substring(0,b-A),D=m.substring(b+C),y=g.substring(0,v-A),N=g.substring(v+C));}return E.length*2>=m.length?[_,D,y,N,E]:null}h(i,"diff_halfMatchI_");var o=i(r,n,Math.ceil(r.length/4)),u=i(r,n,Math.ceil(r.length/2)),l;if(!o&&!u)return null;u?o?l=o[4].length>u[4].length?o:u:l=u:l=o;var s,f,c,d;e.length>t.length?(s=l[0],f=l[1],c=l[2],d=l[3]):(c=l[0],d=l[1],s=l[2],f=l[3]);var p=l[4];return [s,f,c,d,p]};T.prototype.diff_cleanupSemantic=function(e){for(var t=false,r=[],n=0,a=null,i=0,o=0,u=0,l=0,s=0;i<e.length;)e[i][0]==q?(r[n++]=i,o=l,u=s,l=0,s=0,a=e[i][1]):(e[i][0]==Z?l+=e[i][1].length:s+=e[i][1].length,a&&a.length<=Math.max(o,u)&&a.length<=Math.max(l,s)&&(e.splice(r[n-1],0,new T.Diff(J,a)),e[r[n-1]+1][0]=Z,n--,n--,i=n>0?r[n-1]:-1,o=0,u=0,l=0,s=0,a=null,t=true)),i++;for(t&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),i=1;i<e.length;){if(e[i-1][0]==J&&e[i][0]==Z){var f=e[i-1][1],c=e[i][1],d=this.diff_commonOverlap_(f,c),p=this.diff_commonOverlap_(c,f);d>=p?(d>=f.length/2||d>=c.length/2)&&(e.splice(i,0,new T.Diff(q,c.substring(0,d))),e[i-1][1]=f.substring(0,f.length-d),e[i+1][1]=c.substring(d),i++):(p>=f.length/2||p>=c.length/2)&&(e.splice(i,0,new T.Diff(q,f.substring(0,p))),e[i-1][0]=Z,e[i-1][1]=c.substring(0,c.length-p),e[i+1][0]=J,e[i+1][1]=f.substring(p),i++),i++;}i++;}};T.prototype.diff_cleanupSemanticLossless=function(e){function t(p,m){if(!p||!m)return 6;var g=p.charAt(p.length-1),b=m.charAt(0),w=g.match(T.nonAlphaNumericRegex_),v=b.match(T.nonAlphaNumericRegex_),E=w&&g.match(T.whitespaceRegex_),_=v&&b.match(T.whitespaceRegex_),D=E&&g.match(T.linebreakRegex_),y=_&&b.match(T.linebreakRegex_),N=D&&p.match(T.blanklineEndRegex_),C=y&&m.match(T.blanklineStartRegex_);return N||C?5:D||y?4:w&&!E&&_?3:E||_?2:w||v?1:0}h(t,"diff_cleanupSemanticScore_");for(var r=1;r<e.length-1;){if(e[r-1][0]==q&&e[r+1][0]==q){var n=e[r-1][1],a=e[r][1],i=e[r+1][1],o=this.diff_commonSuffix(n,a);if(o){var u=a.substring(a.length-o);n=n.substring(0,n.length-o),a=u+a.substring(0,a.length-o),i=u+i;}for(var l=n,s=a,f=i,c=t(n,a)+t(a,i);a.charAt(0)===i.charAt(0);){n+=a.charAt(0),a=a.substring(1)+i.charAt(0),i=i.substring(1);var d=t(n,a)+t(a,i);d>=c&&(c=d,l=n,s=a,f=i);}e[r-1][1]!=l&&(l?e[r-1][1]=l:(e.splice(r-1,1),r--),e[r][1]=s,f?e[r+1][1]=f:(e.splice(r+1,1),r--));}r++;}};T.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/;T.whitespaceRegex_=/\s/;T.linebreakRegex_=/[\r\n]/;T.blanklineEndRegex_=/\n\r?\n$/;T.blanklineStartRegex_=/^\r?\n\r?\n/;T.prototype.diff_cleanupEfficiency=function(e){for(var t=false,r=[],n=0,a=null,i=0,o=false,u=false,l=false,s=false;i<e.length;)e[i][0]==q?(e[i][1].length<this.Diff_EditCost&&(l||s)?(r[n++]=i,o=l,u=s,a=e[i][1]):(n=0,a=null),l=s=false):(e[i][0]==J?s=true:l=true,a&&(o&&u&&l&&s||a.length<this.Diff_EditCost/2&&o+u+l+s==3)&&(e.splice(r[n-1],0,new T.Diff(J,a)),e[r[n-1]+1][0]=Z,n--,a=null,o&&u?(l=s=true,n=0):(n--,i=n>0?r[n-1]:-1,l=s=false),t=true)),i++;t&&this.diff_cleanupMerge(e);};T.prototype.diff_cleanupMerge=function(e){e.push(new T.Diff(q,""));for(var t=0,r=0,n=0,a="",i="",o;t<e.length;)switch(e[t][0]){case Z:n++,i+=e[t][1],t++;break;case J:r++,a+=e[t][1],t++;break;case q:r+n>1?(r!==0&&n!==0&&(o=this.diff_commonPrefix(i,a),o!==0&&(t-r-n>0&&e[t-r-n-1][0]==q?e[t-r-n-1][1]+=i.substring(0,o):(e.splice(0,0,new T.Diff(q,i.substring(0,o))),t++),i=i.substring(o),a=a.substring(o)),o=this.diff_commonSuffix(i,a),o!==0&&(e[t][1]=i.substring(i.length-o)+e[t][1],i=i.substring(0,i.length-o),a=a.substring(0,a.length-o))),t-=r+n,e.splice(t,r+n),a.length&&(e.splice(t,0,new T.Diff(J,a)),t++),i.length&&(e.splice(t,0,new T.Diff(Z,i)),t++),t++):t!==0&&e[t-1][0]==q?(e[t-1][1]+=e[t][1],e.splice(t,1)):t++,n=0,r=0,a="",i="";break}e[e.length-1][1]===""&&e.pop();var u=false;for(t=1;t<e.length-1;)e[t-1][0]==q&&e[t+1][0]==q&&(e[t][1].substring(e[t][1].length-e[t-1][1].length)==e[t-1][1]?(e[t][1]=e[t-1][1]+e[t][1].substring(0,e[t][1].length-e[t-1][1].length),e[t+1][1]=e[t-1][1]+e[t+1][1],e.splice(t-1,1),u=true):e[t][1].substring(0,e[t+1][1].length)==e[t+1][1]&&(e[t-1][1]+=e[t+1][1],e[t][1]=e[t][1].substring(e[t+1][1].length)+e[t+1][1],e.splice(t+1,1),u=true)),t++;u&&this.diff_cleanupMerge(e);};T.prototype.diff_xIndex=function(e,t){var r=0,n=0,a=0,i=0,o;for(o=0;o<e.length&&(e[o][0]!==Z&&(r+=e[o][1].length),e[o][0]!==J&&(n+=e[o][1].length),!(r>t));o++)a=r,i=n;return e.length!=o&&e[o][0]===J?i:i+(t-a)};T.prototype.diff_prettyHtml=function(e){for(var t=[],r=/&/g,n=/</g,a=/>/g,i=/\n/g,o=0;o<e.length;o++){var u=e[o][0],l=e[o][1],s=l.replace(r,"&").replace(n,"<").replace(a,">").replace(i,"¶<br>");switch(u){case Z:t[o]='<ins style="background:#e6ffe6;">'+s+"</ins>";break;case J:t[o]='<del style="background:#ffe6e6;">'+s+"</del>";break;case q:t[o]="<span>"+s+"</span>";break}}return t.join("")};T.prototype.diff_text1=function(e){for(var t=[],r=0;r<e.length;r++)e[r][0]!==Z&&(t[r]=e[r][1]);return t.join("")};T.prototype.diff_text2=function(e){for(var t=[],r=0;r<e.length;r++)e[r][0]!==J&&(t[r]=e[r][1]);return t.join("")};T.prototype.diff_levenshtein=function(e){for(var t=0,r=0,n=0,a=0;a<e.length;a++){var i=e[a][0],o=e[a][1];switch(i){case Z:r+=o.length;break;case J:n+=o.length;break;case q:t+=Math.max(r,n),r=0,n=0;break}}return t+=Math.max(r,n),t};T.prototype.diff_toDelta=function(e){for(var t=[],r=0;r<e.length;r++)switch(e[r][0]){case Z:t[r]="+"+encodeURI(e[r][1]);break;case J:t[r]="-"+e[r][1].length;break;case q:t[r]="="+e[r][1].length;break}return t.join(" ").replace(/%20/g," ")};T.prototype.diff_fromDelta=function(e,t){for(var r=[],n=0,a=0,i=t.split(/\t/g),o=0;o<i.length;o++){var u=i[o].substring(1);switch(i[o].charAt(0)){case "+":try{r[n++]=new T.Diff(Z,decodeURI(u));}catch{throw new Error("Illegal escape in diff_fromDelta: "+u)}break;case "-":case "=":var l=parseInt(u,10);if(isNaN(l)||l<0)throw new Error("Invalid number in diff_fromDelta: "+u);var s=e.substring(a,a+=l);i[o].charAt(0)=="="?r[n++]=new T.Diff(q,s):r[n++]=new T.Diff(J,s);break;default:if(i[o])throw new Error("Invalid diff operation in diff_fromDelta: "+i[o])}}if(a!=e.length)throw new Error("Delta length ("+a+") does not equal source text length ("+e.length+").");return r};T.prototype.match_main=function(e,t,r){if(e==null||t==null||r==null)throw new Error("Null input. (match_main)");return r=Math.max(0,Math.min(r,e.length)),e==t?0:e.length?e.substring(r,r+t.length)==t?r:this.match_bitap_(e,t,r):-1};T.prototype.match_bitap_=function(e,t,r){if(t.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var n=this.match_alphabet_(t),a=this;function i(_,D){var y=_/t.length,N=Math.abs(r-D);return a.Match_Distance?y+N/a.Match_Distance:N?1:y}h(i,"match_bitapScore_");var o=this.Match_Threshold,u=e.indexOf(t,r);u!=-1&&(o=Math.min(i(0,u),o),u=e.lastIndexOf(t,r+t.length),u!=-1&&(o=Math.min(i(0,u),o)));var l=1<<t.length-1;u=-1;for(var s,f,c=t.length+e.length,d,p=0;p<t.length;p++){for(s=0,f=c;s<f;)i(p,r+f)<=o?s=f:c=f,f=Math.floor((c-s)/2+s);c=f;var m=Math.max(1,r-f+1),g=Math.min(r+f,e.length)+t.length,b=Array(g+2);b[g+1]=(1<<p)-1;for(var w=g;w>=m;w--){var v=n[e.charAt(w-1)];if(p===0?b[w]=(b[w+1]<<1|1)&v:b[w]=(b[w+1]<<1|1)&v|((d[w+1]|d[w])<<1|1)|d[w+1],b[w]&l){var E=i(p,w-1);if(E<=o)if(o=E,u=w-1,u>r)m=Math.max(1,2*r-u);else break}}if(i(p+1,r)>o)break;d=b;}return u};T.prototype.match_alphabet_=function(e){for(var t={},r=0;r<e.length;r++)t[e.charAt(r)]=0;for(var r=0;r<e.length;r++)t[e.charAt(r)]|=1<<e.length-r-1;return t};T.prototype.patch_addContext_=function(e,t){if(t.length!=0){if(e.start2===null)throw Error("patch not initialized");for(var r=t.substring(e.start2,e.start2+e.length1),n=0;t.indexOf(r)!=t.lastIndexOf(r)&&r.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)n+=this.Patch_Margin,r=t.substring(e.start2-n,e.start2+e.length1+n);n+=this.Patch_Margin;var a=t.substring(e.start2-n,e.start2);a&&e.diffs.unshift(new T.Diff(q,a));var i=t.substring(e.start2+e.length1,e.start2+e.length1+n);i&&e.diffs.push(new T.Diff(q,i)),e.start1-=a.length,e.start2-=a.length,e.length1+=a.length+i.length,e.length2+=a.length+i.length;}};T.prototype.patch_make=function(e,t,r){var n,a;if(typeof e=="string"&&typeof t=="string"&&typeof r>"u")n=e,a=this.diff_main(n,t,true),a.length>2&&(this.diff_cleanupSemantic(a),this.diff_cleanupEfficiency(a));else if(e&&typeof e=="object"&&typeof t>"u"&&typeof r>"u")a=e,n=this.diff_text1(a);else if(typeof e=="string"&&t&&typeof t=="object"&&typeof r>"u")n=e,a=t;else if(typeof e=="string"&&typeof t=="string"&&r&&typeof r=="object")n=e,a=r;else throw new Error("Unknown call format to patch_make.");if(a.length===0)return [];for(var i=[],o=new T.patch_obj,u=0,l=0,s=0,f=n,c=n,d=0;d<a.length;d++){var p=a[d][0],m=a[d][1];switch(!u&&p!==q&&(o.start1=l,o.start2=s),p){case Z:o.diffs[u++]=a[d],o.length2+=m.length,c=c.substring(0,s)+m+c.substring(s);break;case J:o.length1+=m.length,o.diffs[u++]=a[d],c=c.substring(0,s)+c.substring(s+m.length);break;case q:m.length<=2*this.Patch_Margin&&u&&a.length!=d+1?(o.diffs[u++]=a[d],o.length1+=m.length,o.length2+=m.length):m.length>=2*this.Patch_Margin&&u&&(this.patch_addContext_(o,f),i.push(o),o=new T.patch_obj,u=0,f=c,l=s);break}p!==Z&&(l+=m.length),p!==J&&(s+=m.length);}return u&&(this.patch_addContext_(o,f),i.push(o)),i};T.prototype.patch_deepCopy=function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r],a=new T.patch_obj;a.diffs=[];for(var i=0;i<n.diffs.length;i++)a.diffs[i]=new T.Diff(n.diffs[i][0],n.diffs[i][1]);a.start1=n.start1,a.start2=n.start2,a.length1=n.length1,a.length2=n.length2,t[r]=a;}return t};T.prototype.patch_apply=function(e,t){if(e.length==0)return [t,[]];e=this.patch_deepCopy(e);var r=this.patch_addPadding(e);t=r+t+r,this.patch_splitMax(e);for(var n=0,a=[],i=0;i<e.length;i++){var o=e[i].start2+n,u=this.diff_text1(e[i].diffs),l,s=-1;if(u.length>this.Match_MaxBits?(l=this.match_main(t,u.substring(0,this.Match_MaxBits),o),l!=-1&&(s=this.match_main(t,u.substring(u.length-this.Match_MaxBits),o+u.length-this.Match_MaxBits),(s==-1||l>=s)&&(l=-1))):l=this.match_main(t,u,o),l==-1)a[i]=false,n-=e[i].length2-e[i].length1;else {a[i]=true,n=l-o;var f;if(s==-1?f=t.substring(l,l+u.length):f=t.substring(l,s+this.Match_MaxBits),u==f)t=t.substring(0,l)+this.diff_text2(e[i].diffs)+t.substring(l+u.length);else {var c=this.diff_main(u,f,false);if(u.length>this.Match_MaxBits&&this.diff_levenshtein(c)/u.length>this.Patch_DeleteThreshold)a[i]=false;else {this.diff_cleanupSemanticLossless(c);for(var d=0,p,m=0;m<e[i].diffs.length;m++){var g=e[i].diffs[m];g[0]!==q&&(p=this.diff_xIndex(c,d)),g[0]===Z?t=t.substring(0,l+p)+g[1]+t.substring(l+p):g[0]===J&&(t=t.substring(0,l+p)+t.substring(l+this.diff_xIndex(c,d+g[1].length))),g[0]!==J&&(d+=g[1].length);}}}}}return t=t.substring(r.length,t.length-r.length),[t,a]};T.prototype.patch_addPadding=function(e){for(var t=this.Patch_Margin,r="",n=1;n<=t;n++)r+=String.fromCharCode(n);for(var n=0;n<e.length;n++)e[n].start1+=t,e[n].start2+=t;var a=e[0],i=a.diffs;if(i.length==0||i[0][0]!=q)i.unshift(new T.Diff(q,r)),a.start1-=t,a.start2-=t,a.length1+=t,a.length2+=t;else if(t>i[0][1].length){var o=t-i[0][1].length;i[0][1]=r.substring(i[0][1].length)+i[0][1],a.start1-=o,a.start2-=o,a.length1+=o,a.length2+=o;}if(a=e[e.length-1],i=a.diffs,i.length==0||i[i.length-1][0]!=q)i.push(new T.Diff(q,r)),a.length1+=t,a.length2+=t;else if(t>i[i.length-1][1].length){var o=t-i[i.length-1][1].length;i[i.length-1][1]+=r.substring(0,o),a.length1+=o,a.length2+=o;}return r};T.prototype.patch_splitMax=function(e){for(var t=this.Match_MaxBits,r=0;r<e.length;r++)if(!(e[r].length1<=t)){var n=e[r];e.splice(r--,1);for(var a=n.start1,i=n.start2,o="";n.diffs.length!==0;){var u=new T.patch_obj,l=true;for(u.start1=a-o.length,u.start2=i-o.length,o!==""&&(u.length1=u.length2=o.length,u.diffs.push(new T.Diff(q,o)));n.diffs.length!==0&&u.length1<t-this.Patch_Margin;){var s=n.diffs[0][0],f=n.diffs[0][1];s===Z?(u.length2+=f.length,i+=f.length,u.diffs.push(n.diffs.shift()),l=false):s===J&&u.diffs.length==1&&u.diffs[0][0]==q&&f.length>2*t?(u.length1+=f.length,a+=f.length,l=false,u.diffs.push(new T.Diff(s,f)),n.diffs.shift()):(f=f.substring(0,t-u.length1-this.Patch_Margin),u.length1+=f.length,a+=f.length,s===q?(u.length2+=f.length,i+=f.length):l=false,u.diffs.push(new T.Diff(s,f)),f==n.diffs[0][1]?n.diffs.shift():n.diffs[0][1]=n.diffs[0][1].substring(f.length));}o=this.diff_text2(u.diffs),o=o.substring(o.length-this.Patch_Margin);var c=this.diff_text1(n.diffs).substring(0,this.Patch_Margin);c!==""&&(u.length1+=c.length,u.length2+=c.length,u.diffs.length!==0&&u.diffs[u.diffs.length-1][0]===q?u.diffs[u.diffs.length-1][1]+=c:u.diffs.push(new T.Diff(q,c))),l||e.splice(++r,0,u);}}};T.prototype.patch_toText=function(e){for(var t=[],r=0;r<e.length;r++)t[r]=e[r];return t.join("")};T.prototype.patch_fromText=function(e){var t=[];if(!e)return t;for(var r=e.split(`
|
|
7
|
+
`),n=0,a=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;n<r.length;){var i=r[n].match(a);if(!i)throw new Error("Invalid patch string: "+r[n]);var o=new T.patch_obj;for(t.push(o),o.start1=parseInt(i[1],10),i[2]===""?(o.start1--,o.length1=1):i[2]=="0"?o.length1=0:(o.start1--,o.length1=parseInt(i[2],10)),o.start2=parseInt(i[3],10),i[4]===""?(o.start2--,o.length2=1):i[4]=="0"?o.length2=0:(o.start2--,o.length2=parseInt(i[4],10)),n++;n<r.length;){var u=r[n].charAt(0);try{var l=decodeURI(r[n].substring(1));}catch{throw new Error("Illegal escape in patch_fromText: "+l)}if(u=="-")o.diffs.push(new T.Diff(J,l));else if(u=="+")o.diffs.push(new T.Diff(Z,l));else if(u==" ")o.diffs.push(new T.Diff(q,l));else {if(u=="@")break;if(u!=="")throw new Error('Invalid patch mode "'+u+'" in: '+l)}n++;}}return t};T.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0;};T.patch_obj.prototype.toString=function(){var e,t;this.length1===0?e=this.start1+",0":this.length1==1?e=this.start1+1:e=this.start1+1+","+this.length1,this.length2===0?t=this.start2+",0":this.length2==1?t=this.start2+1:t=this.start2+1+","+this.length2;for(var r=["@@ -"+e+" +"+t+` @@
|
|
8
|
+
`],n,a=0;a<this.diffs.length;a++){switch(this.diffs[a][0]){case Z:n="+";break;case J:n="-";break;case q:n=" ";break}r[a+1]=n+encodeURI(this.diffs[a][1])+`
|
|
9
|
+
`;}return r.join("").replace(/%20/g," ")};It.exports=T;It.exports.diff_match_patch=T;It.exports.DIFF_DELETE=J;It.exports.DIFF_INSERT=Z;It.exports.DIFF_EQUAL=q;});var et="application/vnd.openxmlformats-officedocument.wordprocessingml.document";function kn(e,t){return t.split(".").reduce((r,n)=>{if(r&&typeof r=="object")return r[n]},e)}h(kn,"getNestedProperty");async function Qa(e,t){let r=this.getInputData()[e];if(!r.binary||!r.binary[t])throw new n8nWorkflow.NodeOperationError(this.getNode(),`No binary data found on property "${t}"`,{description:"Verify that the upstream node produced binary data and that the property name matches.",itemIndex:e});let n=r.binary[t],a=await this.helpers.getBinaryDataBuffer(e,t),i=n.fileName??"document.docx";return {buffer:a,fileName:i}}h(Qa,"getDocxBuffer");async function Fe(e,t){if(t.mode==="fromInput")return Qa.call(this,e,t.binaryPropertyName);let{sourceNodeName:r,binaryPropertyName:n}=t,a="sourceBinaryId"in t?t.sourceBinaryId:void 0;if(a&&a.trim()!=="")try{let c=await this.helpers.getBinaryStream(a);return {buffer:await this.helpers.binaryToBuffer(c),fileName:"document.docx"}}catch(c){throw new n8nWorkflow.NodeApiError(this.getNode(),{message:c.message},{message:`Failed to load document from Binary ID '${a}'.`,description:`The binary with ID '${a}' could not be loaded. This usually means the binary has expired, been garbage-collected, or the ID is incorrect.`,itemIndex:e})}if(!r||r.trim()==="")throw new n8nWorkflow.NodeApiError(this.getNode(),{message:"Source Node Name is empty"},{message:"Source Node Name is required when Document Source is 'From Another Node'.",description:"Set 'Source Node Name' to the exact name of the node in this workflow whose output holds the .docx binary (e.g. the trigger node). Node names are case-sensitive and must match the node label in the canvas exactly.",itemIndex:e});let i=r.replace(/'/g,"\\'"),o=`{{ $('${i}').first().binary.${n} }}`,u;try{u=this.evaluateExpression(o,e);}catch(c){throw new n8nWorkflow.NodeApiError(this.getNode(),{message:c.message},{message:`Failed to resolve binary from source node '${r}'.`,description:`Could not evaluate '${o}'. Verify the source node name is exactly correct (case-sensitive, including spaces and punctuation). Underlying error: ${c.message}`,itemIndex:e})}if(u==null||typeof u!="object"){let c=`{{ $('${i}').first().json }}`,d;try{d=this.evaluateExpression(c,e);}catch{d=void 0;}if(d==null)throw new n8nWorkflow.NodeApiError(this.getNode(),{message:"Source node produced no output"},{message:`Source node '${r}' has no output.`,description:`The expression '${o}' resolved to undefined and the node appears not to have executed in this run. Verify that '${r}' is upstream of this Adeu node, that its name matches exactly (case-sensitive), and that it has run successfully.`,itemIndex:e});let p="";try{let m=this.evaluateExpression(`{{ Object.keys($('${i}').first().binary || {}) }}`,e);Array.isArray(m)&&m.length>0?p=` Available binary properties on '${r}': `+m.map(g=>`'${g}'`).join(", ")+".":Array.isArray(m)&&m.length===0&&(p=` Source node '${r}' has no binary properties at all.`);}catch{}throw new n8nWorkflow.NodeApiError(this.getNode(),{message:"Binary property not found"},{message:`Source node '${r}' has no binary on property '${n}'.`,description:`The expression '${o}' resolved to undefined.${p} Update 'Binary Property Name' to match an existing property, or change the source node so it outputs the .docx on the expected property.`,itemIndex:e})}let l=u,s;try{if(l.id){let c=await this.helpers.getBinaryStream(l.id);s=await this.helpers.binaryToBuffer(c);}else if(l.data)s=Buffer.from(l.data,"base64");else throw new Error("Resolved binary metadata has neither an 'id' nor 'data' field.")}catch(c){throw new n8nWorkflow.NodeApiError(this.getNode(),{message:c.message},{message:`Failed to read binary content from source node '${r}'.`,description:`The binary metadata was found on property '${n}', but its contents could not be loaded. Underlying error: ${c.message}`,itemIndex:e})}let f=l.fileName??"document.docx";return {buffer:s,fileName:f}}h(Fe,"getDocxBufferFromSource");function ur(e,t){let r=e.lastIndexOf(".");return `${r===-1?e:e.substring(0,r)}_${t}.docx`}h(ur,"buildOutputFileName");function Pn(e,t,r){if(e==null||e==="")throw new n8nWorkflow.NodeOperationError(this.getNode(),`Parameter "${r}" is empty`,{description:`Provide a JSON value for "${r}".`,itemIndex:t});if(typeof e=="object")return e;let n=e.trim();n.startsWith("```")&&(n=n.replace(/^```[a-zA-Z]*\n?/,""),n=n.replace(/\n?```$/,"")),n=n.trim();try{return JSON.parse(n)}catch(a){throw new n8nWorkflow.NodeOperationError(this.getNode(),`Parameter "${r}" is not valid JSON`,{description:a.message,itemIndex:t})}}h(Pn,"parseJsonParameter");function On(e,t){let r=e.message??"Unknown error",n=e.name??"",a=e.errors,i=Array.isArray(a)?a.join(`
|
|
10
|
+
`):r,o=i.toLowerCase();if(n==="BatchValidationError"){let u="Batch validation failed.",l=`Review the listed failures:
|
|
11
|
+
`+i;return o.includes("target text not found")?(u="An edit could not be applied: target text not found.",l="Verify the exact `target_text` string \u2014 including punctuation and whitespace \u2014 against the document. Check the individual failures:\n"+i):o.includes("ambiguous match")?(u="An edit matched multiple locations in the document.",l="Provide more surrounding context in `target_text` to uniquely identify the location:\n"+i):o.includes("read-only")||o.includes("readonly")?(u="An edit targeted a read-only structural element.",l=`Cross-references, footnotes, hyperlinks, and the Structural Appendix cannot be modified via text replacement:
|
|
12
|
+
`+i):(o.includes("another author")||o.includes("nested"))&&(u="An edit overlaps with a pending tracked change by another author.",l=`Accept or reject the conflicting change first, or scope your edit outside of it:
|
|
13
|
+
`+i),new n8nWorkflow.NodeApiError(this.getNode(),{message:i,errors:a},{message:u,description:l,itemIndex:t})}return o.includes("invalid docx")||o.includes("missing word/document.xml")?new n8nWorkflow.NodeApiError(this.getNode(),{message:r},{message:"The document could not be opened.",description:"Verify the input binary is a valid .docx file (not .doc, .pdf, or another format).",itemIndex:t}):new n8nWorkflow.NodeApiError(this.getNode(),{message:r},{message:"Adeu engine error.",description:r,itemIndex:t})}h(On,"mapAdeuErrorToNodeApiError");function Ja(e){if(!e||typeof e!="object")return false;let t=e;return typeof t.id=="string"&&typeof t.fileName=="string"&&typeof t.mimeType=="string"}h(Ja,"isStashedBinaryEntry");var Rn=[{displayName:"Static Data Key",name:"staticDataKey",type:"string",default:"adeu_last_redlined",required:true,placeholder:"e.g. adeu_last_redlined",description:"Key in workflow global static data to read the stashed binary metadata from (string). When the Apply Edits operation runs as an AI Agent tool, n8n's tool wrapper strips the binary from its output before any downstream node can see it. To work around that, Apply Edits writes the binary's storage id into workflow static data under 'adeu_last_redlined'. This operation reads that entry back, fetches the original buffer via getBinaryStream, and attaches a fresh IBinaryData onto the outgoing item. Leave the default unless you've customized the stash key on the Apply Edits side.",displayOptions:{show:{resource:["document"],operation:["hydrateToolOutput"]}}},{displayName:"Output Binary Property",name:"outputBinaryPropertyName",type:"string",default:"data",required:true,placeholder:"e.g. data",description:"Name of the binary property on the outgoing item that will hold the hydrated .docx (string, e.g. 'data'). Downstream nodes (e.g. Write Binary File, Gmail send) should be configured to read from this property name.",displayOptions:{show:{resource:["document"],operation:["hydrateToolOutput"]}}},{displayName:"On Missing",name:"onMissing",type:"options",default:"emit_empty",description:"What to do when no stashed binary entry is found under the configured key. 'Emit Empty' is the typical AI Agent path: emits an item with json.hydrated=false and no binary, so a downstream If node can gate any write step on whether the LLM actually called Apply Edits this turn. 'Throw' is for deterministic pipelines where the stash MUST be present and a missing entry indicates a workflow bug.",options:[{name:"Emit Empty",value:"emit_empty",description:"Emit a single item with json.hydrated=false and no binary. Downstream If on json.hydrated gates the write."},{name:"Throw",value:"throw",description:"Throw a NodeOperationError. Use when a missing stash indicates a workflow bug."}],displayOptions:{show:{resource:["document"],operation:["hydrateToolOutput"]}}},{displayName:"Clear After Read",name:"clearAfterRead",type:"boolean",default:true,description:"Whether to delete the static data entry after a successful hydration so it does not leak across workflow runs. Set false if you want to inspect or re-read the entry from a later node in the same run.",displayOptions:{show:{resource:["document"],operation:["hydrateToolOutput"]}}},{displayName:"Output Path Template",name:"outputPathTemplate",type:"string",default:"",placeholder:"e.g. C:\\Users\\Uzair\\.n8n-files\\{baseName}_{timestamp}.docx",description:"Optional template to compute the final write path on disk, returned on the output JSON as 'outputPath'. If set, you can configure downstream Write nodes to simply read '{{ $json.outputPath }}' with zero escaping risks. Supports these placeholders: '{baseName}' (filename with extension stripped), '{timestamp}' (current ISO 8601 timestamp with colons and dots replaced by dashes for Windows file compatibility), '{fileName}' (the stashed filename including extension), and '{ext}' (e.g., '.docx').",displayOptions:{show:{resource:["document"],operation:["hydrateToolOutput"]}}}];async function Bn(e){let t=this.getNodeParameter("staticDataKey",e),r=this.getNodeParameter("outputBinaryPropertyName",e),n=this.getNodeParameter("onMissing",e),a=this.getNodeParameter("clearAfterRead",e),i=this.getWorkflowStaticData("global"),o=i[t];if(!Ja(o)){if(n==="throw")throw new n8nWorkflow.NodeOperationError(this.getNode(),`No stashed binary found under static data key "${t}".`,{description:"The Apply Edits operation writes a stash entry into workflow static data only when it runs as an AI Agent tool and produces a binary. Verify that Apply Edits was actually called by the agent this turn, that it ran successfully, and that the key matches the one used on the writing side.",itemIndex:e});return [{json:{hydrated:false},pairedItem:{item:e}}]}let{id:u,fileName:l,mimeType:s}=o,f;try{let g=await this.helpers.getBinaryStream(u);f=await this.helpers.binaryToBuffer(g);}catch(g){throw new n8nWorkflow.NodeOperationError(this.getNode(),`Failed to load stashed binary (id=${u}) from external storage.`,{description:`The stash entry under "${t}" points at binary id "${u}", but the underlying data could not be loaded. This usually means the binary has been garbage-collected (n8n's execution data retention may be too short) or external storage is unavailable. Underlying error: ${g.message}`,itemIndex:e})}let c=s||et,d=await this.helpers.prepareBinaryData(f,l,c);a&&delete i[t];let p=this.getNodeParameter("outputPathTemplate",e,""),m;if(p.trim()!==""){let g=l.replace(/\.docx$/i,""),b=l.match(/\.docx$/i)?.[0]??".docx",w=new Date().toISOString().replace(/[:.]/g,"-").replace(/Z$/,"");m=p.replaceAll("{baseName}",g).replaceAll("{timestamp}",w).replaceAll("{fileName}",l).replaceAll("{ext}",b);}return [{json:{hydrated:true,fileName:l,sourceBinaryId:u,mimeType:c,...m!==void 0?{outputPath:m}:{}},binary:{[r]:d},pairedItem:{item:e}}]}h(Bn,"executeHydrateToolOutput");var Wn=Ur(Ln());var Za=(0, Wn.createRequire)("/"),ft,Ka,eo;try{ft=Za("worker_threads"),Ka=ft.Worker,eo=ft.isMarkedAsUntransferable;}catch{}var re=Uint8Array,ye=Uint16Array,Zr=Int32Array,cr=new re([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),fr=new re([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Vr=new re([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Hn=h(function(e,t){for(var r=new ye(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var a=new Zr(r[30]),n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)a[i]=i-r[n]<<5|n;return {b:r,r:a}},"freb"),ft=Hn(cr,2),Vn=ft.b,Gr=ft.r;Vn[28]=258,Gr[258]=28;var Gn=Hn(fr,0),to=Gn.b,$n=Gn.r,Xr=new ye(32768);for(X=0;X<32768;++X)Le=(X&43690)>>1|(X&21845)<<1,Le=(Le&52428)>>2|(Le&13107)<<2,Le=(Le&61680)>>4|(Le&3855)<<4,Xr[X]=((Le&65280)>>8|(Le&255)<<8)>>1;var Le,X,Pe=h((function(e,t,r){for(var n=e.length,a=0,i=new ye(t);a<n;++a)e[a]&&++i[e[a]-1];var o=new ye(t);for(a=1;a<t;++a)o[a]=o[a-1]+i[a-1]<<1;var u;if(r){u=new ye(1<<t);var l=15-t;for(a=0;a<n;++a)if(e[a])for(var s=a<<4|e[a],f=t-e[a],c=o[e[a]-1]++<<f,d=c|(1<<f)-1;c<=d;++c)u[Xr[c]>>l]=s;}else for(u=new ye(n),a=0;a<n;++a)e[a]&&(u[a]=Xr[o[e[a]-1]++]>>15-e[a]);return u}),"hMap"),je=new re(288);for(X=0;X<144;++X)je[X]=8;var X;for(X=144;X<256;++X)je[X]=9;var X;for(X=256;X<280;++X)je[X]=7;var X;for(X=280;X<288;++X)je[X]=8;var X,Bt=new re(32);for(X=0;X<32;++X)Bt[X]=5;var X,ro=Pe(je,9,0),no=Pe(je,9,1),io=Pe(Bt,5,0),ao=Pe(Bt,5,1),zr=h(function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},"max"),xe=h(function(e,t,r){var n=t/8|0;return (e[n]|e[n+1]<<8)>>(t&7)&r},"bits"),jr=h(function(e,t){var r=t/8|0;return (e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},"bits16"),Kr=h(function(e){return (e+7)/8|0},"shft"),Ft=h(function(e,t,r){return (t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length),new re(e.subarray(t,r))},"slc");var oo=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],he=h(function(e,t,r){var n=new Error(t||oo[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,he),!r)throw n;return n},"err"),so=h(function(e,t,r,n){var a=e.length,i=n?n.length:0;if(!a||t.f&&!t.l)return r||new re(0);var o=!r,u=o||t.i!=2,l=t.i;o&&(r=new re(a*3));var s=h(function(Pt){var Ot=r.length;if(Pt>Ot){var ct=new re(Math.max(Ot*2,Pt));ct.set(r),r=ct;}},"cbuf"),f=t.f||0,c=t.p||0,d=t.b||0,p=t.l,m=t.d,g=t.m,b=t.n,w=a*8;do{if(!p){f=xe(e,c,1);var v=xe(e,c+1,3);if(c+=3,v)if(v==1)p=no,m=ao,g=9,b=5;else if(v==2){var y=xe(e,c,31)+257,N=xe(e,c+10,15)+4,C=y+xe(e,c+5,31)+1;c+=14;for(var A=new re(C),B=new re(19),x=0;x<N;++x)B[Vr[x]]=xe(e,c+x*3,7);c+=N*3;for(var M=zr(B),z=(1<<M)-1,P=Pe(B,M,1),x=0;x<C;){var G=P[xe(e,c,z)];c+=G&15;var E=G>>4;if(E<16)A[x++]=E;else {var $=0,R=0;for(E==16?(R=3+xe(e,c,3),c+=2,$=A[x-1]):E==17?(R=3+xe(e,c,7),c+=3):E==18&&(R=11+xe(e,c,127),c+=7);R--;)A[x++]=$;}}var j=A.subarray(0,y),I=A.subarray(y);g=zr(j),b=zr(I),p=Pe(j,g,1),m=Pe(I,b,1);}else he(1);else {var E=Kr(c)+4,_=e[E-4]|e[E-3]<<8,D=E+_;if(D>a){l&&he(0);break}u&&s(d+_),r.set(e.subarray(E,D),d),t.b=d+=_,t.p=c=D*8,t.f=f;continue}if(c>w){l&&he(0);break}}u&&s(d+131072);for(var Q=(1<<g)-1,K=(1<<b)-1,ae=c;;ae=c){var $=p[jr(e,c)&Q],ve=$>>4;if(c+=$&15,c>w){l&&he(0);break}if($||he(2),ve<256)r[d++]=ve;else if(ve==256){ae=c,p=null;break}else {var we=ve-254;if(ve>264){var x=ve-257,te=cr[x];we=xe(e,c,(1<<te)-1)+Vn[x],c+=te;}var Se=m[jr(e,c)&K],ut=Se>>4;Se||he(3),c+=Se&15;var I=to[ut];if(ut>3){var te=fr[ut];I+=jr(e,c)&(1<<te)-1,c+=te;}if(c>w){l&&he(0);break}u&&s(d+131072);var lt=d+we;if(d<I){var or=i-I,sr=Math.min(I,lt);for(or+d<0&&he(3);d<sr;++d)r[d]=n[or+d];}for(;d<lt;++d)r[d]=r[d-I];}}t.l=p,t.p=ae,t.b=d,t.f=f,p&&(f=1,t.m=g,t.d=m,t.n=b);}while(!f);return d!=r.length&&o?Ft(r,0,d):r.subarray(0,d)},"inflt"),$e=h(function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8;},"wbits"),Mt=h(function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16;},"wbits16"),Wr=h(function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var a=r.length,i=r.slice();if(!a)return {t:Yn,l:0};if(a==1){var o=new re(r[0].s+1);return o[r[0].s]=1,{t:o,l:1}}r.sort(function(D,y){return D.f-y.f}),r.push({s:-1,f:25001});var u=r[0],l=r[1],s=0,f=1,c=2;for(r[0]={s:-1,f:u.f+l.f,l:u,r:l};f!=a-1;)u=r[r[s].f<r[c].f?s++:c++],l=r[s!=f&&r[s].f<r[c].f?s++:c++],r[f++]={s:-1,f:u.f+l.f,l:u,r:l};for(var d=i[0].s,n=1;n<a;++n)i[n].s>d&&(d=i[n].s);var p=new ye(d+1),m=Yr(r[f-1],p,0);if(m>t){var n=0,g=0,b=m-t,w=1<<b;for(i.sort(function(y,N){return p[N.s]-p[y.s]||y.f-N.f});n<a;++n){var v=i[n].s;if(p[v]>t)g+=w-(1<<m-p[v]),p[v]=t;else break}for(g>>=b;g>0;){var E=i[n].s;p[E]<t?g-=1<<t-p[E]++-1:++n;}for(;n>=0&&g;--n){var _=i[n].s;p[_]==t&&(--p[_],++g);}m=t;}return {t:new re(p),l:m}},"hTree"),Yr=h(function(e,t,r){return e.s==-1?Math.max(Yr(e.l,t,r+1),Yr(e.r,t,r+1)):t[e.s]=r},"ln"),Un=h(function(e){for(var t=e.length;t&&!e[--t];);for(var r=new ye(++t),n=0,a=e[0],i=1,o=h(function(l){r[n++]=l;},"w"),u=1;u<=t;++u)if(e[u]==a&&u!=t)++i;else {if(!a&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0);}else if(i>3){for(o(a),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0);}for(;i--;)o(a);i=1,a=e[u];}return {c:r.subarray(0,n),n:t}},"lc"),Rt=h(function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},"clen"),Xn=h(function(e,t,r){var n=r.length,a=Kr(t+2);e[a]=n&255,e[a+1]=n>>8,e[a+2]=e[a]^255,e[a+3]=e[a+1]^255;for(var i=0;i<n;++i)e[a+i+4]=r[i];return (a+4+n)*8},"wfblk"),qn=h(function(e,t,r,n,a,i,o,u,l,s,f){$e(t,f++,r),++a[256];for(var c=Wr(a,15),d=c.t,p=c.l,m=Wr(i,15),g=m.t,b=m.l,w=Un(d),v=w.c,E=w.n,_=Un(g),D=_.c,y=_.n,N=new ye(19),C=0;C<v.length;++C)++N[v[C]&31];for(var C=0;C<D.length;++C)++N[D[C]&31];for(var A=Wr(N,7),B=A.t,x=A.l,M=19;M>4&&!B[Vr[M-1]];--M);var z=s+5<<3,P=Rt(a,je)+Rt(i,Bt)+o,G=Rt(a,d)+Rt(i,g)+o+14+3*M+Rt(N,B)+2*N[16]+3*N[17]+7*N[18];if(l>=0&&z<=P&&z<=G)return Xn(t,f,e.subarray(l,l+s));var $,R,j,I;if($e(t,f,1+(G<P)),f+=2,G<P){$=Pe(d,p,0),R=d,j=Pe(g,b,0),I=g;var Q=Pe(B,x,0);$e(t,f,E-257),$e(t,f+5,y-1),$e(t,f+10,M-4),f+=14;for(var C=0;C<M;++C)$e(t,f+3*C,B[Vr[C]]);f+=3*M;for(var K=[v,D],ae=0;ae<2;++ae)for(var ve=K[ae],C=0;C<ve.length;++C){var we=ve[C]&31;$e(t,f,Q[we]),f+=B[we],we>15&&($e(t,f,ve[C]>>5&127),f+=ve[C]>>12);}}else $=ro,R=je,j=io,I=Bt;for(var C=0;C<u;++C){var te=n[C];if(te>255){var we=te>>18&31;Mt(t,f,$[we+257]),f+=R[we+257],we>7&&($e(t,f,te>>23&31),f+=cr[we]);var Se=te&31;Mt(t,f,j[Se]),f+=I[Se],Se>3&&(Mt(t,f,te>>5&8191),f+=fr[Se]);}else Mt(t,f,$[te]),f+=R[te];}return Mt(t,f,$[256]),f+R[256]},"wblk"),uo=new Zr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Yn=new re(0),lo=h(function(e,t,r,n,a,i){var o=i.z||e.length,u=new re(n+o+5*(1+Math.ceil(o/7e3))+a),l=u.subarray(n,u.length-a),s=i.l,f=(i.r||0)&7;if(t){f&&(l[0]=i.r>>3);for(var c=uo[t-1],d=c>>13,p=c&8191,m=(1<<r)-1,g=i.p||new ye(32768),b=i.h||new ye(m+1),w=Math.ceil(r/3),v=2*w,E=h(function(Lr){return (e[Lr]^e[Lr+1]<<w^e[Lr+2]<<v)&m},"hsh"),_=new Zr(25e3),D=new ye(288),y=new ye(32),N=0,C=0,A=i.i||0,B=0,x=i.w||0,M=0;A+2<o;++A){var z=E(A),P=A&32767,G=b[z];if(g[P]=G,b[z]=P,x<=A){var $=o-A;if((N>7e3||B>24576)&&($>423||!s)){f=qn(e,l,0,_,D,y,C,B,M,A-M,f),B=N=C=0,M=A;for(var R=0;R<286;++R)D[R]=0;for(var R=0;R<30;++R)y[R]=0;}var j=2,I=0,Q=p,K=P-G&32767;if($>2&&z==E(A-K))for(var ae=Math.min(d,$)-1,ve=Math.min(32767,A),we=Math.min(258,$);K<=ve&&--Q&&P!=G;){if(e[A+j]==e[A+j-K]){for(var te=0;te<we&&e[A+te]==e[A+te-K];++te);if(te>j){if(j=te,I=K,te>ae)break;for(var Se=Math.min(K,te-2),ut=0,R=0;R<Se;++R){var lt=A-K+R&32767,or=g[lt],sr=lt-or&32767;sr>ut&&(ut=sr,G=lt);}}}P=G,G=g[P],K+=P-G&32767;}if(I){_[B++]=268435456|Gr[j]<<18|$n[I];var Pt=Gr[j]&31,Ot=$n[I]&31;C+=cr[Pt]+fr[Ot],++D[257+Pt],++y[Ot],x=A+j,++N;}else _[B++]=e[A],++D[e[A]];}}for(A=Math.max(A,x);A<o;++A)_[B++]=e[A],++D[e[A]];f=qn(e,l,s,_,D,y,C,B,M,A-M,f),s||(i.r=f&7|l[f/8|0]<<3,f-=7,i.h=b,i.p=g,i.i=A,i.w=x);}else {for(var A=i.w||0;A<o+s;A+=65535){var ct=A+65535;ct>=o&&(l[f/8|0]=s,ct=o),f=Xn(l,f+1,e.subarray(A,ct));}i.i=o;}return Ft(u,0,n+Kr(f)+a)},"dflt"),co=(function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(r&1&&-306674912)^r>>>1;e[t]=r;}return e})(),fo=h(function(){var e=-1;return {p:h(function(t){for(var r=e,n=0;n<t.length;++n)r=co[r&255^t[n]]^r>>>8;e=r;},"p"),d:h(function(){return ~e},"d")}},"crc");var ho=h(function(e,t,r,n,a){if(!a&&(a={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),o=new re(i.length+e.length);o.set(i),o.set(e,i.length),e=o,a.w=i.length;}return lo(e,t.level==null?6:t.level,t.mem==null?a.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,r,n,a)},"dopt"),Qn=h(function(e,t){var r={};for(var n in e)r[n]=e[n];for(var n in t)r[n]=t[n];return r},"mrg");var ke=h(function(e,t){return e[t]|e[t+1]<<8},"b2"),De=h(function(e,t){return (e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},"b4"),Hr=h(function(e,t){return De(e,t)+De(e,t+4)*4294967296},"b8"),ue=h(function(e,t,r){for(;r;++t)e[t]=r,r>>>=8;},"wbytes");function po(e,t){return ho(e,t||{},0,0)}h(po,"deflateSync");function mo(e,t){return so(e,{i:2},t&&t.out,t&&t.dictionary)}h(mo,"inflateSync");var Jn=h(function(e,t,r,n){for(var a in e){var i=e[a],o=t+a,u=n;Array.isArray(i)&&(u=Qn(n,i[1]),i=i[0]),ArrayBuffer.isView(i)?r[o]=[i,u]:(r[o+="/"]=[new re(0),u],Jn(i,o,r,n));}},"fltn"),zn=typeof TextEncoder<"u"&&new TextEncoder,Qr=typeof TextDecoder<"u"&&new TextDecoder,go=0;try{Qr.decode(Yn,{stream:!0}),go=1;}catch{}var _o=h(function(e){for(var t="",r=0;;){var n=e[r++],a=(n>127)+(n>223)+(n>239);if(r+a>e.length)return {s:t,r:Ft(e,r-1)};a?a==3?(n=((n&15)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,t+=String.fromCharCode(55296|n>>10,56320|n&1023)):a&1?t+=String.fromCharCode((n&31)<<6|e[r++]&63):t+=String.fromCharCode((n&15)<<12|(e[r++]&63)<<6|e[r++]&63):t+=String.fromCharCode(n);}},"dutf8");function lr(e,t){if(t){for(var r=new re(e.length),n=0;n<e.length;++n)r[n]=e.charCodeAt(n);return r}if(zn)return zn.encode(e);for(var a=e.length,i=new re(e.length+(e.length>>1)),o=0,u=h(function(f){i[o++]=f;},"w"),n=0;n<a;++n){if(o+5>i.length){var l=new re(o+8+(a-n<<1));l.set(i),i=l;}var s=e.charCodeAt(n);s<128||t?u(s):s<2048?(u(192|s>>6),u(128|s&63)):s>55295&&s<57344?(s=65536+(s&1047552)|e.charCodeAt(++n)&1023,u(240|s>>18),u(128|s>>12&63),u(128|s>>6&63),u(128|s&63)):(u(224|s>>12),u(128|s>>6&63),u(128|s&63));}return Ft(i,0,o)}h(lr,"strToU8");function hr(e,t){if(t){for(var r="",n=0;n<e.length;n+=16384)r+=String.fromCharCode.apply(null,e.subarray(n,n+16384));return r}else {if(Qr)return Qr.decode(e);var a=_o(e),i=a.s,r=a.r;return r.length&&he(8),i}}h(hr,"strFromU8");var vo=h(function(e,t){return t+30+ke(e,t+26)+ke(e,t+28)},"slzh"),wo=h(function(e,t,r){var n=ke(e,t+28),a=ke(e,t+30),i=hr(e.subarray(t+46,t+46+n),!(ke(e,t+8)&2048)),o=t+46+n,u=yo(e,o,a,r,De(e,t+20),De(e,t+24),De(e,t+42)),l=u[0],s=u[1],f=u[2];return [ke(e,t+10),l,s,i,o+a+ke(e,t+32),f]},"zh"),yo=h(function(e,t,r,n,a,i,o){var u=a==4294967295,l=i==4294967295,s=o==4294967295,f=t+r,c=u+l+s;if(n&&c){for(;t+4<f;t+=4+ke(e,t+2))if(ke(e,t)==1)return [u?Hr(e,t+4+8*l):a,l?Hr(e,t+4):i,s?Hr(e,t+4+8*(l+u)):o,1];n<2&&he(13);}return [a,i,o,0]},"z64hs"),Jr=h(function(e){var t=0;if(e)for(var r in e){var n=e[r].length;n>65535&&he(9),t+=n+4;}return t},"exfl"),jn=h(function(e,t,r,n,a,i,o,u){var l=n.length,s=r.extra,f=u&&u.length,c=Jr(s);ue(e,t,o!=null?33639248:67324752),t+=4,o!=null&&(e[t++]=20,e[t++]=r.os),e[t]=20,t+=2,e[t++]=r.flag<<1|(i<0&&8),e[t++]=a&&8,e[t++]=r.compression&255,e[t++]=r.compression>>8;var d=new Date(r.mtime==null?Date.now():r.mtime),p=d.getFullYear()-1980;if((p<0||p>119)&&he(10),ue(e,t,p<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>1),t+=4,i!=-1&&(ue(e,t,r.crc),ue(e,t+4,i<0?-i-2:i),ue(e,t+8,r.size)),ue(e,t+12,l),ue(e,t+14,c),t+=16,o!=null&&(ue(e,t,f),ue(e,t+6,r.attrs),ue(e,t+10,o),t+=14),e.set(n,t),t+=l,c)for(var m in s){var g=s[m],b=g.length;ue(e,t,+m),ue(e,t+2,b),e.set(g,t+4),t+=4+b;}return f&&(e.set(u,t),t+=f),t},"wzh"),Eo=h(function(e,t,r,n,a){ue(e,t,101010256),ue(e,t+8,r),ue(e,t+10,r),ue(e,t+12,n),ue(e,t+16,a);},"wzf");function Zn(e,t){t||(t={});var r={},n=[];Jn(e,"",r,t);var a=0,i=0;for(var o in r){var u=r[o],l=u[0],s=u[1],f=s.level==0?0:8,c=lr(o),d=c.length,p=s.comment,m=p&&lr(p),g=m&&m.length,b=Jr(s.extra);d>65535&&he(11);var w=f?po(l,s):l,v=w.length,E=fo();E.p(l),n.push(Qn(s,{size:l.length,crc:E.d(),c:w,f:c,m,u:d!=o.length||m&&p.length!=g,o:a,compression:f})),a+=30+d+b+v,i+=76+2*(d+b)+(g||0)+v;}for(var _=new re(i+22),D=a,y=i-a,N=0;N<n.length;++N){var c=n[N];jn(_,c.o,c,c.f,c.u,c.c.length);var C=30+c.f.length+Jr(c.extra);_.set(c.c,c.o+C),jn(_,a,c,c.f,c.u,c.c.length,c.o,c.m),a+=16+C+(c.m?c.m.length:0);}return Eo(_,a,n.length,y,D),_}h(Zn,"zipSync");function Kn(e,t){for(var r={},n=e.length-22;De(e,n)!=101010256;--n)(!n||e.length-n>65558)&&he(13);var a=ke(e,n+8);if(!a)return {};var i=De(e,n+16),o=De(e,n-20)==117853008;if(o){var u=De(e,n-12);o=De(e,u)==101075792,o&&(a=De(e,u+32),i=De(e,u+48));}for(var l=t&&t.filter,s=0;s<a;++s){var f=wo(e,i,o),c=f[0],d=f[1],p=f[2],m=f[3],g=f[4],b=f[5],w=vo(e,b);i=g,(!l||l({name:m,size:d,originalSize:p,compression:c}))&&(c?c==8?r[m]=mo(e.subarray(w,w+d),{out:new re(p)}):he(14,"unknown compression type "+c):r[m]=Ft(e,w,w+d));}return r}h(Kn,"unzipSync");var Rr=Ur(ua()),Ia=Ur(la());function O(e,t){for(let r=0;r<e.childNodes.length;r++){let n=e.childNodes[r];if(n.nodeType===1&&n.tagName===t)return n}return null}h(O,"findChild");function hu(e,t){let r=[];for(let n=0;n<e.childNodes.length;n++){let a=e.childNodes[n];a.nodeType===1&&a.tagName===t&&r.push(a);}return r}h(hu,"findChildren");function S(e,t){return Array.from(e.getElementsByTagName(t))}h(S,"findAllDescendants");function Dn(e){return e.startsWith("\uFEFF")&&(e=e.slice(1)),new Rr.DOMParser().parseFromString(e,"text/xml")}h(Dn,"parseXml");function du(e){let t=new Rr.XMLSerializer().serializeToString(e),n=/<([a-zA-Z0-9_:]+)(\s+[^>]+?)(>|\/>)/.exec(t);if(n&&!n[1].startsWith("?")){let a=n.index,i=t.substring(0,a);if(!i.includes("<")||i.trim().startsWith("<?xml")&&(i.match(/</g)||[]).length===1){let u=n[0],l=`<${n[1]}`,s=n[2],f=n[3],c=/([a-zA-Z0-9_:]+)\s*=\s*(["'])(.*?)\2/g,d=[],p;for(;(p=c.exec(s))!==null;)d.push(p[0].trim());d.sort((g,b)=>{let w=g.split("=")[0].trim(),v=b.split("=")[0].trim(),E=w.startsWith("xmlns"),_=v.startsWith("xmlns");return E&&!_?-1:!E&&_?1:w<v?-1:w>v?1:0});let m=d.length>0?`${l} ${d.join(" ")}${f}`:`${l}${f}`;t=t.substring(0,a)+m+t.substring(a+u.length);}}return t}h(du,"serializeXml");var Or=class{static{h(this,"Relationship");}constructor(e,t,r,n){this.id=e,this.type=t,this.target=r,this.isExternal=n;}id;type;target;isExternal},ga=class{static{h(this,"Part");}constructor(e,t,r,n){this.partname=e,this.blob=t,this.contentType=n,this._element=r;}partname;blob;contentType;rels=new Map;_element;package;addRelationship(e,t,r,n=false){if(this.rels.set(e,new Or(e,t,r,n)),this.partname.endsWith(".rels")){let a=this._element.ownerDocument;if(a){let i=a.createElementNS("http://schemas.openxmlformats.org/package/2006/relationships","Relationship");i.setAttribute("Id",e),i.setAttribute("Type",t),i.setAttribute("Target",r),n&&i.setAttribute("TargetMode","External"),this._element.appendChild(i);}}}},pu=class{static{h(this,"DocxPackage");}constructor(e){this.unzipped=e;}unzipped;parts=[];mainDocumentPart;getPartByPath(e){let t=e.startsWith("/")?e.substring(1):e;return this.parts.find(r=>r.partname===t||r.partname==="/"+t)}nextPartname(e){let t=1;for(;;){let r=e.replace("%d",t===1?"":t.toString());if(!this.getPartByPath(r))return r;t++;}}addPart(e,t,r){let n=Dn(r),a=new ga(e,r,n.documentElement,t);a.package=this,this.parts.push(a);let i=this.getPartByPath("[Content_Types].xml");if(i){let o=i._element.ownerDocument;if(o){let u=o.createElement("Override");u.setAttribute("PartName",e),u.setAttribute("ContentType",t),i._element.appendChild(u);}}return a}getOrCreateRelsPart(e){let t=e.split("/"),r=t.pop(),n=t.join("/")+"/_rels/"+r+".rels",a=this.getPartByPath(n);return a||(a=this.addPart(n,"application/vnd.openxmlformats-package.relationships+xml",`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
14
|
+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"></Relationships>`)),a}},ar=class _a{static{h(this,"_DocumentObject");}constructor(t,r){this.pkg=t,this.part=r;}pkg;part;settings={oddAndEvenPagesHeaderFooter:false};sections=[];get element(){return O(this.part._element,"w:body")||this.part._element}static async load(t){let r=t instanceof Uint8Array?t:new Uint8Array(t),n=Kn(r),a=new pu(n),i=n["[Content_Types].xml"],o={};if(i){let s=Dn(hr(i)),f=S(s.documentElement,"Override");for(let c of f)o[c.getAttribute("PartName")||""]=c.getAttribute("ContentType")||"";}for(let[s,f]of Object.entries(n))if(s.endsWith(".xml")||s.endsWith(".rels")){let c=hr(f),d=Dn(c),p=o["/"+s]||"application/xml",m=new ga("/"+s,c,d.documentElement,p);m.package=a,a.parts.push(m);}let u=a.getPartByPath("word/document.xml");if(!u)throw new Error("Invalid DOCX: Missing word/document.xml");a.mainDocumentPart=u;let l=a.getPartByPath("word/_rels/document.xml.rels");if(l){let s=S(l._element,"Relationship");for(let f of s){let c=f.getAttribute("Id"),d=f.getAttribute("Target"),p=f.getAttribute("Type"),m=f.getAttribute("TargetMode");c&&d&&p&&u.rels.set(c,new Or(c,p,d,m==="External"));}}return new _a(a,u)}relateTo(t,r){let n=1;for(;this.part.rels.has(`rId${n}`);)n++;let a=`rId${n}`,i=t.partname.split("/").pop();this.part.rels.set(a,new Or(a,r,i,false)),this.pkg.getOrCreateRelsPart(this.part.partname).addRelationship(a,r,i,false);}relateToExternal(t,r){let n=1;for(;this.part.rels.has(`rId${n}`);)n++;let a=`rId${n}`;return this.part.rels.set(a,new Or(a,r,t,true)),this.pkg.getOrCreateRelsPart(this.part.partname).addRelationship(a,r,t,true),a}async save(){for(let t of this.pkg.parts){let r=du(t._element.ownerDocument||t._element);r.startsWith("<?xml")||(r=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
15
|
+
`+r),this.pkg.unzipped[t.partname.substring(1)]=lr(r);}return Buffer.from(Zn(this.pkg.unzipped))}},Ze=class{static{h(this,"Paragraph");}constructor(e,t){this._element=e,this._parent=t;}_element;_parent;get text(){let e="",t=this._element.getElementsByTagName("w:t");for(let r=0;r<t.length;r++)e+=t[r].textContent||"";return e}},Ke=class{static{h(this,"Run");}constructor(e,t){this._element=e,this._parent=t;}_element;_parent},mu=class{static{h(this,"Cell");}constructor(e,t){this._element=e,this._parent=t;}_element;_parent},gu=class{static{h(this,"Row");}constructor(e,t){this._element=e,this._parent=t;let r=this._element.getElementsByTagName("w:tc");for(let n=0;n<r.length;n++)this.cells.push(new mu(r[n],this));}_element;_parent;cells=[]},An=class{static{h(this,"Table");}constructor(e,t){this._element=e,this._parent=t;let r=this._element.getElementsByTagName("w:tr");for(let n=0;n<r.length;n++)this.rows.push(new gu(r[n],this));}_element;_parent;rows=[]},ca=class{static{h(this,"NotesPart");}constructor(e,t){this.part=e,this.note_type=t,this._element=e._element;}part;note_type;_element},_u=class{static{h(this,"FootnoteItem");}constructor(e,t,r){this._element=e,this._parent=t,this.note_type=r,this.id=e.getAttribute("w:id")||"",this.part=t.part;}_element;_parent;note_type;id;part},pe={w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",w16cid:"http://schemas.microsoft.com/office/word/2016/wordml/cid",w16cex:"http://schemas.microsoft.com/office/word/2018/wordml/cex",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006"},Ee={COMMENTS:"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml",EXTENDED:"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml",IDS:"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsIds+xml",EXTENSIBLE:"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtensible+xml"},Ye={COMMENTS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",EXTENDED:"http://schemas.microsoft.com/office/2011/relationships/commentsExtended",IDS:"http://schemas.microsoft.com/office/2016/09/relationships/commentsIds",EXTENSIBLE:"http://schemas.microsoft.com/office/2018/08/relationships/commentsExtensible"},ir=class{static{h(this,"CommentsManager");}constructor(e){this.doc=e;}doc;_commentsPart=null;_extendedPart=null;_idsPart=null;_extensiblePart=null;_nextId=null;get commentsPart(){return this._commentsPart||(this._commentsPart=this._getOrCreateCommentsPart(),this._ensureNamespaces()),this._commentsPart}get extendedPart(){return this._extendedPart||(this._extendedPart=this._getOrCreateExtendedPart()),this._extendedPart}get idsPart(){return this._idsPart||(this._idsPart=this._getOrCreateIdsPart()),this._idsPart}get extensiblePart(){return this._extensiblePart||(this._extensiblePart=this._getOrCreateExtensiblePart()),this._extensiblePart}get nextId(){return this._nextId===null&&(this._nextId=this._getNextCommentId()),this._nextId}set nextId(e){this._nextId=e;}_getExistingPartByType(e){return this.doc.pkg.parts.find(t=>t.contentType===e)||null}_linkPart(e,t){for(let r of this.doc.part.rels.values())if(!r.isExternal&&r.target===e.partname.split("/").pop())return e;return this.doc.relateTo(e,t),e}_getOrCreateCommentsPart(){let e=this._getExistingPartByType(Ee.COMMENTS);if(e)return this._linkPart(e,Ye.COMMENTS);let t=this.doc.pkg.nextPartname("/word/comments%d.xml"),r=`<w:comments xmlns:w="${pe.w}" xmlns:w14="${pe.w14}" xmlns:w15="${pe.w15}" xmlns:w16cid="${pe.w16cid}" xmlns:w16cex="${pe.w16cex}" xmlns:mc="${pe.mc}" mc:Ignorable="w14 w15 w16cid w16cex"></w:comments>`;return e=this.doc.pkg.addPart(t,Ee.COMMENTS,r),this.doc.relateTo(e,Ye.COMMENTS),e}_getOrCreateExtendedPart(){let e=this._getExistingPartByType(Ee.EXTENDED);if(e)return this._linkPart(e,Ye.EXTENDED);let t=this.doc.pkg.nextPartname("/word/commentsExtended%d.xml"),r=`<w15:commentsEx xmlns:w15="${pe.w15}"></w15:commentsEx>`;return e=this.doc.pkg.addPart(t,Ee.EXTENDED,r),this.doc.relateTo(e,Ye.EXTENDED),e}_getOrCreateIdsPart(){let e=this._getExistingPartByType(Ee.IDS);if(e)return this._linkPart(e,Ye.IDS);let t=this.doc.pkg.nextPartname("/word/commentsIds%d.xml"),r=`<w16cid:commentsIds xmlns:w16cid="${pe.w16cid}"></w16cid:commentsIds>`;return e=this.doc.pkg.addPart(t,Ee.IDS,r),this.doc.relateTo(e,Ye.IDS),e}_getOrCreateExtensiblePart(){let e=this._getExistingPartByType(Ee.EXTENSIBLE);if(e)return this._linkPart(e,Ye.EXTENSIBLE);let t=this.doc.pkg.nextPartname("/word/commentsExtensible%d.xml"),r=`<w16cex:commentsExtensible xmlns:w16cex="${pe.w16cex}"></w16cex:commentsExtensible>`;return e=this.doc.pkg.addPart(t,Ee.EXTENSIBLE,r),this.doc.relateTo(e,Ye.EXTENSIBLE),e}_ensureNamespaces(){let e=this._commentsPart?._element;if(!e)return;let t=[["xmlns:w",pe.w],["xmlns:w14",pe.w14],["xmlns:w15",pe.w15],["xmlns:w16cid",pe.w16cid],["xmlns:w16cex",pe.w16cex],["xmlns:mc",pe.mc]];for(let[r,n]of t)e.getAttribute(r)||e.setAttribute(r,n);}_getNextCommentId(){let e=[0],t=this._getExistingPartByType(Ee.COMMENTS);if(t){let r=S(t._element,"w:comment");for(let n of r){let a=n.getAttribute("w:id");a&&e.push(parseInt(a,10)||0);}}return Math.max(...e)+1}_generateHexId(){return Math.floor(Math.random()*4294967295).toString(16).toUpperCase().padStart(8,"0")}_getInitials(e){return e?e.split(" ").filter(Boolean).map(t=>t[0]).join("").toUpperCase():""}_findParaIdForComment(e){if(!this._commentsPart)return null;for(let t of S(this._commentsPart._element,"w:comment"))if(t.getAttribute("w:id")===e)for(let r of S(t,"w:p")){let n=r.getAttribute("w14:paraId");if(n)return n}return null}_findThreadRootParaId(e){let t=this._findParaIdForComment(e),r=this._getExistingPartByType(Ee.EXTENDED);if(!t||!r)return t;for(let n=0;n<r._element.childNodes.length;n++){let a=r._element.childNodes[n];if(a.nodeType===1&&a.getAttribute("w15:paraId")===t){let i=a.getAttribute("w15:paraIdParent");if(i)return i}}return t}addComment(e,t,r=null){let n=this.nextId.toString();this.nextId++;let a=new Date().toISOString().replace(/\.\d{3}Z$/,"Z"),i=this.commentsPart._element.ownerDocument,o=i.createElement("w:comment");o.setAttribute("w:id",n),o.setAttribute("w:author",e),o.setAttribute("w:date",a);let u=this._getInitials(e);u&&o.setAttribute("w:initials",u);let l=this._getExistingPartByType(Ee.EXTENDED);r&&!l&&o.setAttribute("w15:p",r);let s=this._generateHexId(),f=this._generateHexId(),c=i.createElement("w:p");c.setAttribute("w14:paraId",s),c.setAttribute("w14:textId","77777777"),c.setAttribute("w:rsidR",f),c.setAttribute("w:rsidRDefault",f),c.setAttribute("w:rsidP",f);let d=i.createElement("w:pPr"),p=i.createElement("w:pStyle");p.setAttribute("w:val","CommentText"),d.appendChild(p),c.appendChild(d);let m=i.createElement("w:r"),g=i.createElement("w:rPr"),b=i.createElement("w:rStyle");b.setAttribute("w:val","CommentReference"),g.appendChild(b),m.appendChild(g),m.appendChild(i.createElement("w:annotationRef")),c.appendChild(m);let w=i.createElement("w:r"),v=i.createElement("w:t");if(v.textContent=t,w.appendChild(v),c.appendChild(w),o.appendChild(c),this.commentsPart._element.appendChild(o),this.extendedPart){let E=r?this._findThreadRootParaId(r):null,D=this.extendedPart._element.ownerDocument.createElement("w15:commentEx");D.setAttribute("w15:paraId",s),E&&D.setAttribute("w15:paraIdParent",E),D.setAttribute("w15:done","0"),this.extendedPart._element.appendChild(D);}if(this.idsPart){let _=this.idsPart._element.ownerDocument.createElement("w16cid:commentId");_.setAttribute("w16cid:paraId",s),_.setAttribute("w16cid:durableId",this._generateHexId()),this.idsPart._element.appendChild(_);}if(this.extensiblePart){let E=null;for(let _=0;_<this.idsPart._element.childNodes.length;_++){let D=this.idsPart._element.childNodes[_];if(D.nodeType===1&&D.getAttribute("w16cid:paraId")===s){E=D.getAttribute("w16cid:durableId");break}}if(E){let D=this.extensiblePart._element.ownerDocument.createElement("w16cex:commentExtensible");D.setAttribute("w16cex:durableId",E),D.setAttribute("w16cex:dateUtc",a),this.extensiblePart._element.appendChild(D);}}return n}deleteComment(e){if(!this.commentsPart)return;let t=null;for(let n of S(this.commentsPart._element,"w:comment"))if(n.getAttribute("w:id")===e){t=n;break}if(!t)return;let r=null;for(let n of S(t,"w:p")){let a=n.getAttribute("w14:paraId");if(a){r=a;break}}if(r){let n=[];if(this.extendedPart)for(let i=0;i<this.extendedPart._element.childNodes.length;i++){let o=this.extendedPart._element.childNodes[i];if(o.nodeType===1&&o.getAttribute("w15:paraIdParent")===r){let u=o.getAttribute("w15:paraId");if(u){for(let l of S(this.commentsPart._element,"w:comment"))for(let s of S(l,"w:p"))if(s.getAttribute("w14:paraId")===u){let f=l.getAttribute("w:id");f&&n.push(f);break}}}}for(let i of n)this.deleteComment(i);let a=null;if(this.idsPart){let i=[];for(let o=0;o<this.idsPart._element.childNodes.length;o++){let u=this.idsPart._element.childNodes[o];u.nodeType===1&&u.getAttribute("w16cid:paraId")===r&&(a=u.getAttribute("w16cid:durableId"),i.push(u));}i.forEach(o=>this.idsPart._element.removeChild(o));}if(this.extendedPart){let i=[];for(let o=0;o<this.extendedPart._element.childNodes.length;o++){let u=this.extendedPart._element.childNodes[o];u.nodeType===1&&u.getAttribute("w15:paraId")===r&&i.push(u);}i.forEach(o=>this.extendedPart._element.removeChild(o));}if(a&&this.extensiblePart){let i=[];for(let o=0;o<this.extensiblePart._element.childNodes.length;o++){let u=this.extensiblePart._element.childNodes[o];u.nodeType===1&&u.getAttribute("w16cex:durableId")===a&&i.push(u);}i.forEach(o=>this.extensiblePart._element.removeChild(o));}}t.parentNode&&t.parentNode.removeChild(t);}};function Br(e){({part:e.mainDocumentPart,relateTo:h(()=>{},"relateTo")});let n={},a=e.parts.find(l=>l.contentType===Ee.COMMENTS);if(!a)return n;let i={},o=S(a._element,"w:comment");for(let l of o){let s=l.getAttribute("w:id");if(!s)continue;let f=l.getAttribute("w:author")||"Unknown",c=l.getAttribute("w:date")||"",d=false,p=l.getAttribute("w15:done");(p==="1"||p==="true"||p==="on")&&(d=true);let m=l.getAttribute("w15:p")||null,g=S(l,"w:p");for(let v of g){let E=v.getAttribute("w14:paraId");E&&(i[E]=s);}let b=[];for(let v of g){let E=S(v,"w:t");for(let _ of E)_.textContent&&b.push(_.textContent);b.push(`
|
|
16
|
+
`);}let w=b.join("").trim();n[s]={author:f,text:w,date:c,resolved:d,parent_id:m};}let u=e.parts.find(l=>l.contentType===Ee.EXTENDED);if(u){let l=u._element.childNodes;for(let s=0;s<l.length;s++){let f=l[s];if(f.nodeType!==1)continue;let c=f.getAttribute("w15:paraId"),d=f.getAttribute("w15:paraIdParent"),p=f.getAttribute("w15:done");if(c){let m=i[c];if(m&&n[m]){if(d){let g=i[d];g&&(n[m].parent_id=g);}(p==="1"||p==="true"||p==="on")&&(n[m].resolved=true);}}}}return n}h(Br,"extract_comments_data");var vu="w:p",va="w:r",wa="w:t",wu="w:delText",yu="w:tab",Eu="w:br",Du="w:cr",Nn="w:rPr",bu="w:rPrChange",Au="w:commentReference",Nu="w:footnoteReference",Cu="w:endnoteReference",Tu="w:fldChar",xu="w:fldCharType",Su="w:instrText",Iu="w:ins",ku="w:del",Qe="w:id",yn="w:author",En="w:date",Pu="w:commentRangeStart",Ou="w:commentRangeEnd",Mu="w:hyperlink",Ru="r:id",Bu="w:fldSimple",Fu="w:instr",Lu="w:bookmarkStart",$u="w:name",Uu="w:sdt",qu="w:smartTag",zu="w:sdtContent",ya="w:b",ju="w:i",Te="w:val",Ea="w:pPr",Da="w:pStyle",ba="w:outlineLvl",Wu="w:numPr",Hu="w:numId",Vu="w:ilvl",Gu=/Heading[ ]?([1-6])(?![0-9])/;function Fr(e){let t=e.package||e.pkg||(e.part?e.part.pkg:null);if(t&&t._adeu_style_cache)return t._adeu_style_cache;let r={},n=null,a={},i=t?.getPartByPath("word/styles.xml");if(!i){let s=[r,null];return t&&(t._adeu_style_cache=s),s}let o=S(i._element,"w:style");for(let s of o){let f=s.getAttribute("w:styleId");if(!f)continue;let c=s.getAttribute("w:type"),d=s.getAttribute("w:default")==="1"||s.getAttribute("w:default")==="true";c==="paragraph"&&d&&(n=f);let p=O(s,"w:name"),m=p?p.getAttribute("w:val"):f;m&&typeof m=="string"&&(m.toLowerCase().startsWith("heading")?m=m.replace(/^heading/i,"Heading"):m.toLowerCase()==="title"&&(m="Title"));let g=O(s,"w:basedOn"),b=g?g.getAttribute("w:val"):null,w=null,v=O(s,"w:pPr");if(v){let D=O(v,"w:outlineLvl");if(D){let y=D.getAttribute("w:val");y&&/^\d+$/.test(y)&&(w=parseInt(y,10));}}let E=null,_=O(s,"w:rPr");if(_){let D=O(_,"w:b");if(D){let y=D.getAttribute("w:val");E=y!=="0"&&y!=="false"&&y!=="off";}}a[f]={name:m,based_on:b,outline_level:w,bold:E};}let u=h((s,f)=>{if(r[s])return r[s];if(f.has(s)||!a[s])return {name:s,outline_level:null,bold:false};f.add(s);let c=a[s],d=c.based_on,p=c.outline_level,m=c.bold!==null?c.bold:false;if(d){let b=u(d,f);p===null&&(p=b.outline_level),c.bold===null&&(m=b.bold);}let g={name:c.name,outline_level:p,bold:m};return r[s]=g,g},"resolve_style");for(let s in a)u(s,new Set);let l=[r,n];return t&&(t._adeu_style_cache=l),l}h(Fr,"_get_style_cache");function Aa(e){if(!e)return null;let t=e.match(Gu);return t?parseInt(t[1],10):null}h(Aa,"_detect_heading_level_from_name");function Cn(e,t,r){t||([t,r]=Fr(e._parent.part||e._parent));let n=O(e._element,Ea);if(n){let u=O(n,ba);if(u){let l=u.getAttribute(Te);if(l&&/^\d+$/.test(l)){let s=parseInt(l,10);if(s>=0&&s<=8)return true}}}let a=r;if(n){let u=O(n,Da);u&&(a=u.getAttribute(Te)||r);}let i=a&&t?t[a]:null;if(i&&i.outline_level!==null&&i.outline_level>=0&&i.outline_level<=8)return true;let o=i?i.name:a;return o&&typeof o=="string"&&o.toLowerCase().startsWith("heading")&&(o=o.replace(/^heading/i,"Heading")),!!(o?.startsWith("Heading")||o==="Title"||o&&o!=="Normal"&&Aa(o)!==null)}h(Cn,"is_native_heading");function Tn(e,t,r){t||([t,r]=Fr(e._parent.part||e._parent));let n=O(e._element,Ea);if(n){let u=O(n,ba);if(u){let l=u.getAttribute(Te);if(l&&/^\d+$/.test(l)){let s=parseInt(l,10);if(s>=0&&s<=8)return "#".repeat(s+1)+" "}}}let a=r;if(n){let u=O(n,Da);u&&(a=u.getAttribute(Te)||r);}let i=a&&t?t[a]:null;if(i&&i.outline_level!==null&&i.outline_level>=0&&i.outline_level<=8)return "#".repeat(i.outline_level+1)+" ";let o=i?i.name:a;if(o&&typeof o=="string"&&o.toLowerCase().startsWith("heading")&&(o=o.replace(/^heading/i,"Heading")),o?.startsWith("Heading")){let u=o.replace("Heading","").trim();if(/^\d+$/.test(u))return "#".repeat(parseInt(u,10))+" "}if(o==="Title")return "# ";if(n){let u=O(n,Wu);if(u){let l=O(u,Hu);if(l&&l.getAttribute(Te)!=="0"){let s=0,f=O(u,Vu);if(f){let c=f.getAttribute(Te);c&&(s=parseInt(c,10)||0);}return " ".repeat(s)+"* "}}}if(o&&o!=="Normal"){let u=Aa(o);if(u!==null)return "#".repeat(u)+" "}if(!o||o==="Normal"){let u=e.text.trim();if(u&&u.length<100&&u===u.toUpperCase()){let l=false;if(i?.bold)l=true;else {let s=S(e._element,va);for(let f of s)if(S(f,wa).map(p=>p.textContent||"").join("").trim()){let p=O(f,Nn);if(p){let m=O(p,ya);m&&m.getAttribute(Te)!=="0"&&m.getAttribute(Te)!=="false"&&(l=true);}break}}if(l)return "## "}}return ""}h(Tn,"get_paragraph_prefix");function Na(e,t,r){let n=Tn(e,t,r);if(!n)return false;let a=n.trimEnd();return a.length>0&&a==="#".repeat(a.length)}h(Na,"is_heading_paragraph");function Ca(e,t=null){let r="",n="",a=O(e._element,Nn),i=false,o=false;if(a){let u=O(a,ya);u&&u.getAttribute(Te)!=="0"&&u.getAttribute(Te)!=="false"&&(i=true);let l=O(a,ju);l&&l.getAttribute(Te)!=="0"&&l.getAttribute(Te)!=="false"&&(o=true);}if(t===null){let u=e._parent;t=u instanceof Ze?Cn(u):false;}return i&&!t&&(r+="**",n="**"+n),o&&(r+="_",n="_"+n),[r,n]}h(Ca,"get_run_style_markers");function Xu(e,t,r){return !t&&!r?e:e?e.includes(`
|
|
17
17
|
`)?e.split(`
|
|
18
|
-
`).map(
|
|
19
|
-
`):`${t}${e}${r}`:""}h(
|
|
20
|
-
`);}return t}h(
|
|
18
|
+
`).map(a=>a?`${t}${a}${r}`:"").join(`
|
|
19
|
+
`):`${t}${e}${r}`:""}h(Xu,"apply_formatting_to_segments");function ot(e){let t="";for(let r=0;r<e._element.childNodes.length;r++){let n=e._element.childNodes[r];if(n.nodeType===1)if(n.tagName===wa||n.tagName===wu){let a=n.textContent||"";t+=a.replace(/\t/g," ");}else n.tagName===yu?t+=" ":(n.tagName===Eu||n.tagName===Du)&&(t+=`
|
|
20
|
+
`);}return t}h(ot,"get_run_text");function*xn(e){let t=e._element||e.element||e;if(e.constructor.name==="NotesPart"){let r=e.note_type==="fn"?"w:footnote":"w:endnote",n=S(t,r);for(let a of n)a.getAttribute("w:type")==="separator"||a.getAttribute("w:type")==="continuationSeparator"||(yield new _u(a,e,e.note_type));return}for(let r=0;r<t.childNodes.length;r++){let n=t.childNodes[r];n.nodeType===1&&(n.tagName===vu?yield new Ze(n,e):n.tagName==="w:tbl"&&(yield new An(n,e)));}}h(xn,"iter_block_items");function*Ta(e){let t=e.pkg.parts.filter(i=>i.contentType==="application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml");for(let i of t)yield i;yield e;let r=e.pkg.parts.filter(i=>i.contentType==="application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml");for(let i of r)yield i;let n=e.pkg.getPartByPath("word/footnotes.xml"),a=e.pkg.getPartByPath("word/endnotes.xml");n&&(yield new ca(n,"fn")),a&&(yield new ca(a,"en"));}h(Ta,"iter_document_parts");function Yu(e){if(!e)return false;let t=e.toUpperCase().trim().split(/\s+/);return t.length>0&&(t[0]==="PAGE"||t[0]==="NUMPAGES")}h(Yu,"_is_page_instr");function xa(e){return e?e.part?e.part:e.pkg&&e.pkg.mainDocumentPart?e.pkg.mainDocumentPart:e._parent?xa(e._parent):null:null}h(xa,"_get_part");function*Sa(e){let t=false,r="",n=false;function*a(o){let u=null,l=O(o,Nn);if(l){let s=O(l,bu);s&&(u=s.getAttribute(Qe),yield {type:"fmt_start",id:u,author:s.getAttribute(yn)||void 0,date:s.getAttribute(En)||void 0});}for(let s=0;s<o.childNodes.length;s++){let f=o.childNodes[s];if(f.nodeType!==1)continue;let c=f.tagName;if(c===Au){let d=f.getAttribute(Qe);d&&(yield {type:"ref",id:d});}else if(c===Nu){let d=f.getAttribute(Qe);d&&(yield {type:"footnote",id:d});}else if(c===Cu){let d=f.getAttribute(Qe);d&&(yield {type:"endnote",id:d});}else if(c===Tu){let d=f.getAttribute(xu);if(d==="begin")t=true,r="";else if(d==="separate")if(Yu(r))n=true;else {let p=r.trim().split(/\s+/);p.length>1&&p[0]==="REF"&&(yield {type:"xref_start",id:p[1]});}else if(d==="end"){if(!n){let p=r.trim().split(/\s+/);p.length>1&&p[0]==="REF"&&(yield {type:"xref_end",id:p[1]});}t=false,r="",n=false;}}else c===Su&&t&&!n&&(r+=f.textContent||"");}n||(yield new Ke(o,e)),u!==null&&(yield {type:"fmt_end",id:u});}h(a,"process_run_element");function*i(o){for(let u=0;u<o.childNodes.length;u++){let l=o.childNodes[u];if(l.nodeType!==1)continue;let s=l.tagName;if(s===va)yield*a(l);else if(s===Iu){let f=l.getAttribute(Qe);yield {type:"ins_start",id:f,author:l.getAttribute(yn)||void 0,date:l.getAttribute(En)||void 0},yield*i(l),yield {type:"ins_end",id:f};}else if(s===ku){let f=l.getAttribute(Qe);yield {type:"del_start",id:f,author:l.getAttribute(yn)||void 0,date:l.getAttribute(En)||void 0},yield*i(l),yield {type:"del_end",id:f};}else if(s===Pu)yield {type:"start",id:l.getAttribute(Qe)};else if(s===Ou)yield {type:"end",id:l.getAttribute(Qe)};else if(s===Mu){let f=l.getAttribute(Ru)||l.getAttribute("id"),c="",d=xa(e._parent);if(f&&d){let p=d.rels.get(f);p&&p.isExternal&&(c=p.target);}c&&(yield {type:"hyperlink_start",id:f,date:c}),yield*i(l),c&&(yield {type:"hyperlink_end",id:f,date:c});}else if(s===Bu){let c=(l.getAttribute(Fu)||"").trim().split(/\s+/),d=c.length>1&&c[0]==="REF"?c[1]:"";d&&(yield {type:"xref_start",id:d}),yield*i(l),d&&(yield {type:"xref_end",id:d});}else if(s===Lu){let f=l.getAttribute($u);f&&(!f.startsWith("_")||f.startsWith("_Ref"))&&(yield {type:"bookmark",id:f});}else (s===Uu||s===qu||s===zu)&&(yield*i(l));}}h(i,"traverse_node"),yield*i(e._element);}h(Sa,"iter_paragraph_content");var nr=class{static{h(this,"DocumentMapper");}doc;clean_view;comments_map;full_text="";spans=[];appendix_start_index=-1;_text_chunks=[];constructor(e,t=false){this.doc=e,this.clean_view=t,this.comments_map=Br(e.pkg),this._build_map();}_build_map(){let e=0;this.spans=[],this._text_chunks=[],this.full_text="";for(let t of Ta(this.doc))e=this._map_blocks(t,e),this.spans.length>0&&this.spans[this.spans.length-1].text!==`
|
|
21
21
|
|
|
22
22
|
`&&(this._add_virtual_text(`
|
|
23
23
|
|
|
24
24
|
`,e,null),e+=2);for(;this.spans.length>0&&this.spans[this.spans.length-1].text===`
|
|
25
25
|
|
|
26
|
-
`;)this.spans.pop(),this._text_chunks.pop();this.full_text=this._text_chunks.join(""),this.appendix_start_index=-1;}_map_blocks(e,t){let r=t,n=e.constructor.name,
|
|
26
|
+
`;)this.spans.pop(),this._text_chunks.pop();this.full_text=this._text_chunks.join(""),this.appendix_start_index=-1;}_map_blocks(e,t){let r=t,n=e.constructor.name,a=e.part||e,[i,o]=Fr(a);if(n==="NotesPart"){let f=`---
|
|
27
27
|
${e.note_type==="fn"?"## Footnotes":"## Endnotes"}`;this._add_virtual_text(f,r,null),r+=f.length,this._add_virtual_text(`
|
|
28
28
|
|
|
29
|
-
`,r,null),r+=2;}let
|
|
29
|
+
`,r,null),r+=2;}let u=true,l=null;for(let s of xn(e))if(s.constructor.name==="FootnoteItem")r=this._map_blocks(s,r);else if(s instanceof Ze){if(!u){let d=l instanceof Ze?l:null;this._add_virtual_text(`
|
|
30
30
|
|
|
31
|
-
`,r,d),r+=2;}let c=
|
|
31
|
+
`,r,d),r+=2;}let c=Tn(s,i,o);u&&n==="FootnoteItem"&&(c=`[^${e.note_type}-${e.id}]: `+c),c&&(this._add_virtual_text(c,r,s),r+=c.length),r=this._map_paragraph_content(s,r,i,o),u=false,l=s;}else if(s instanceof An){if(!u){let c=l instanceof Ze?l:null;this._add_virtual_text(`
|
|
32
32
|
|
|
33
|
-
`,r,c),r+=2;}r=this._map_table(
|
|
34
|
-
`,r,null),r+=1),
|
|
35
|
-
`)&&(
|
|
36
|
-
`);for(let
|
|
37
|
-
`,D]),
|
|
38
|
-
`)}_add_virtual_text(e,t,r,n=null){let
|
|
33
|
+
`,r,c),r+=2;}r=this._map_table(s,r),u=false,l=s;}return r}_map_table(e,t){let r=t,n=0;for(let a of e.rows){let i=a._element,o=O(i,"w:trPr"),u=o?O(o,"w:ins"):null,l=o?O(o,"w:del"):null;if(this.clean_view&&l)continue;n>0&&(this._add_virtual_text(`
|
|
34
|
+
`,r,null),r+=1),u&&!this.clean_view?(this._add_virtual_text("{++ ",r,null),r+=4):l&&!this.clean_view&&(this._add_virtual_text("{-- ",r,null),r+=4);let s=new Set,f=0;for(let c of a.cells)s.has(c)||(s.add(c),f>0&&(this._add_virtual_text(" | ",r,null),r+=3),r=this._map_blocks(c,r),f+=1);if(u&&!this.clean_view){let c=` |Chg:${u.getAttribute("w:id")}++}`;this._add_virtual_text(c,r,null),r+=c.length;}else if(l&&!this.clean_view){let c=` |Chg:${l.getAttribute("w:id")}--}`;this._add_virtual_text(c,r,null),r+=c.length;}n+=1;}return r}_strip_markdown_formatting(e){let t=e;return t=t.replace(/^#+\s*/gm,""),t=t.replace(/\*\*(\w[\w\s]*\w|\w{2,})\*\*/g,"$1"),t=t.replace(/__(\w[\w\s]*\w|\w{2,})__/g,"$1"),t=t.replace(/(?<!\w)_(\w[\w\s]*\w|\w{2,})_(?!\w)/g,"$1"),t=t.replace(/(?<!\w)\*(\w[\w\s]*\w|\w{2,})\*(?!\w)/g,"$1"),t}_map_paragraph_content(e,t,r,n){let a=t,i={start:a,end:a,text:"",run:null,paragraph:e};this.spans.push(i);let o=new Set,u={},l={},s={},f=[],c=["",""],d=["",""],p=null,m=[],g=h(()=>{if(m.length===0)return;let[_,D]=c;_&&(this._add_virtual_text(_,a,e),a+=_.length);for(let[y,N,C,A,B]of m){if(y==="virtual")this._add_virtual_text(N,a,e,p);else {let x={start:a,end:a+N.length,text:N,run:C,paragraph:e,ins_id:A||void 0,del_id:B||void 0,hyperlink_id:p||void 0};this.spans.push(x),this._text_chunks.push(N);}a+=N.length;}D&&(this._add_virtual_text(D,a,e),a+=D.length),m=[];},"flush_pending_runs"),b=Array.from(Sa(e)),w=Na(e,r,n),v=Cn(e,r,n),E=w;for(let _=0;_<b.length;_++){let D=b[_];if(D instanceof Ke){let[y,N]=Ca(D,v),C=[],A=ot(D);if(E){if(A===""||/^\s*$/.test(A))continue;E=false;}if(A.includes(`
|
|
35
|
+
`)&&(y||N)){let z=A.split(`
|
|
36
|
+
`);for(let P=0;P<z.length;P++)P>0&&C.push(["real",`
|
|
37
|
+
`,D]),z[P]&&(y&&C.push(["virtual",y,null]),C.push(["real",z[P],D]),N&&C.push(["virtual",N,null]));}else y&&C.push(["virtual",y,null]),A&&C.push(["real",A,D]),N&&C.push(["virtual",N,null]);this.clean_view&&Object.keys(l).length>0;let B=C.map(z=>z[1]).join(""),x=Object.keys(u).pop()||null,M=Object.keys(l).pop()||null;if(B&&!(this.clean_view&&M)){let z=this.clean_view?["",""]:this._get_wrappers(x,M,o,s),P=[y,N];if(m.length>0&&z[0]===c[0]&&z[1]===c[1]){let G=false;P[0]===d[0]&&P[1]===d[1]&&d[0]!==""&&m[m.length-1][0]==="virtual"&&m[m.length-1][1]===d[1]&&(m.pop(),G=true);for(let[$,R,j]of C){if(G&&$==="virtual"&&R===P[0]){G=false;continue}m.push([$,R,j,x,M]);}d=P;}else {g(),c=z,d=P;for(let[G,$,R]of C)m.push([G,$,R,x,M]);}}if(!this.clean_view){(Object.keys(u).length>0||Object.keys(l).length>0||o.size>0||Object.keys(s).length>0)&&f.push([{...u},{...l},new Set(o),{...s}]);let P=false;if(x!==null||M!==null||Object.keys(s).length>0){let $=_+1,R=false,j=Object.keys(u).length,I=Object.keys(l).length,Q=Object.keys(s).length;for(;$<b.length;){let K=b[$];if(K instanceof Ke){if(!ot(K)){$++;continue}(j>0||I>0||Q>0)&&(R=true);break}else {let ae=K;ae.type==="ins_start"?j++:ae.type==="ins_end"?j=Math.max(0,j-1):ae.type==="del_start"?I++:ae.type==="del_end"?I=Math.max(0,I-1):ae.type==="fmt_start"?Q++:ae.type==="fmt_end"&&(Q=Math.max(0,Q-1));}$++;}R&&(P=true);}if(!P&&f.length>0){let $=this._build_merged_meta_block(f);if($){g(),c=["",""],d=["",""];let R=`{>>${$}<<}`;this._add_virtual_text(R,a,e),a+=R.length;}f=[];}}}else {let y=D;if(E=false,g(),c=["",""],d=["",""],y.type==="start")o.add(y.id);else if(y.type==="end")o.delete(y.id);else if(y.type==="ins_start")u[y.id]=y;else if(y.type==="ins_end")delete u[y.id];else if(y.type==="del_start")l[y.id]=y;else if(y.type==="del_end")delete l[y.id];else if(y.type==="fmt_start")s[y.id]=y;else if(y.type==="fmt_end")delete s[y.id];else if(y.type==="footnote"||y.type==="endnote"){g(),c=["",""],d=["",""];let C=`[^${y.type==="footnote"?"fn":"en"}-${y.id}]`;this._add_virtual_text(C,a,e),a+=C.length;}else if(y.type==="hyperlink_start")g(),c=["",""],d=["",""],this._add_virtual_text("[",a,e,y.id),a+=1,p=y.id;else if(y.type==="hyperlink_end"){g(),c=["",""],d=["",""];let N=`](${y.date})`;this._add_virtual_text(N,a,e,y.id),a+=N.length,p=null;}else if(y.type==="xref_start")g(),c=["",""],d=["",""],this._add_virtual_text("[~",a,e),a+=2;else if(y.type==="xref_end"){g(),c=["",""],d=["",""];let N=`~](#${y.id})`;this._add_virtual_text(N,a,e),a+=N.length;}else if(y.type==="bookmark"){g(),c=["",""],d=["",""];let N=`{#${y.id}}`;this._add_virtual_text(N,a,e),a+=N.length;}}}if(g(),f.length>0){let _=this._build_merged_meta_block(f);if(_){let D=`{>>${_}<<}`;this._add_virtual_text(D,a,e),a+=D.length;}}return a}_get_wrappers(e,t,r,n){return t?["{--","--}"]:e?["{++","++}"]:r.size>0||Object.keys(n).length>0?["{==","==}"]:["",""]}_build_merged_meta_block(e){let t=[],r=[],n=new Set;for(let[a,i,o,u]of e){for(let[s,f]of Object.entries(a)){let c=`Chg:${s}`;if(!n.has(c)){let d=f.author||"Unknown";t.push(`[${c} insert] ${d}`),n.add(c);}}for(let[s,f]of Object.entries(i)){let c=`Chg:${s}`;if(!n.has(c)){let d=f.author||"Unknown";t.push(`[${c} delete] ${d}`),n.add(c);}}for(let[s,f]of Object.entries(u)){let c=`Chg:${s}`;if(!n.has(c)){let d=f.author||"Unknown";t.push(`[${c} format] ${d}`),n.add(c);}}let l=Array.from(o).sort();for(let s of l){if(!this.comments_map[s])continue;let f=`Com:${s}`;if(!n.has(f)){let c=this.comments_map[s],d=`[${f}] ${c.author}`;c.date&&(d+=` @ ${c.date}`),c.resolved&&(d+="(RESOLVED)"),r.push(`${d}: ${c.text}`),n.add(f);}}}return [...t,...r].join(`
|
|
38
|
+
`)}_add_virtual_text(e,t,r,n=null){let a={start:t,end:t+e.length,text:e,run:null,paragraph:r,hyperlink_id:n||void 0};this.spans.push(a),this._text_chunks.push(e);}_replace_smart_quotes(e){return e.replace(/“/g,'"').replace(/”/g,'"').replace(/‘/g,"'").replace(/’/g,"'")}_make_fuzzy_regex(e){e=this._strip_markdown_formatting(e),e=this._replace_smart_quotes(e);let t=[],r=/(\[_+\])|(\s+)|(['"])|([.,;:\/])/g,n=0,a,i=h(u=>u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"escapeRegExp");for(;(a=r.exec(e))!==null;){let u=e.substring(n,a.index);u&&t.push(i(u));let l=a[1],s=a[2],f=a[3],c=a[4];l?t.push("\\[_+\\]"):s?(t.push("(?:\\*\\*|__|\\*|_)?"),t.push("\\s+"),t.push("(?:\\*\\*|__|\\*|_)?")):f?f==="'"?t.push("[\u2018\u2019']"):t.push('["\u201C\u201D]'):c&&(t.push("(?:\\*\\*|__|\\*|_)?"),t.push(i(c)),t.push("(?:\\*\\*|__|\\*|_)?")),n=r.lastIndex;}let o=e.substring(n);return o&&t.push(i(o)),t.join("")}find_match_index(e){let t=this.full_text.indexOf(e);if(t!==-1)return [t,e.length];let r=this._replace_smart_quotes(this.full_text),n=this._replace_smart_quotes(e);if(t=r.indexOf(n),t!==-1)return [t,e.length];let a=this._strip_markdown_formatting(e);if(this.full_text.includes(a))return t=this.full_text.indexOf(a),[t,a.length];try{let o=new RegExp(this._make_fuzzy_regex(e)).exec(this.full_text);if(o)return [o.index,o[0].length]}catch{}return [-1,0]}find_all_match_indices(e){if(!e)return [];let t=h(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"escapeRegExp"),r=[...this.full_text.matchAll(new RegExp(t(e),"g"))];if(r.length>0)return r.map(o=>[o.index,o[0].length]);let n=this._replace_smart_quotes(this.full_text),a=this._replace_smart_quotes(e);if(r=[...n.matchAll(new RegExp(t(a),"g"))],r.length>0)return r.map(o=>[o.index,o[0].length]);let i=this._strip_markdown_formatting(e);if(r=[...this.full_text.matchAll(new RegExp(t(i),"g"))],r.length>0)return r.map(o=>[o.index,o[0].length]);try{let o=new RegExp(this._make_fuzzy_regex(e),"g");if(r=[...this.full_text.matchAll(o)],r.length>0)return r.map(u=>[u.index,u[0].length])}catch{}return []}find_target_runs(e){let[t,r]=this.find_match_index(e);return t===-1?[]:this._resolve_runs_at_range(t,t+r)}find_target_runs_by_index(e,t,r=true){return this._resolve_runs_at_range(e,e+t,r)}get_virtual_spans_in_range(e,t){let r=e+t;return this.spans.filter(n=>n.run===null&&n.text===`
|
|
39
39
|
|
|
40
|
-
`&&n.start>=e&&n.end<=r)}_resolve_runs_at_range(e,t,r=true){let n=this.spans.filter(
|
|
41
|
-
`;)n--;
|
|
42
|
-
`)break;p--;}if(!
|
|
43
|
-
`)}h(
|
|
44
|
-
`)}h(
|
|
40
|
+
`&&n.start>=e&&n.end<=r)}_resolve_runs_at_range(e,t,r=true){let n=this.spans.filter(s=>s.end>e&&s.start<t);if(n.length===0)return [];let a=n.filter(s=>s.run!==null).map(s=>s.run);if(a.length===0)return [];let i=false,o=n.find(s=>s.run!==null),u=0;if(o){let s=e-o.start;if(s>0){let[,c]=this._split_run_at_index(a[0],s);a[0]=c,i=true,u=s;}}let l=[...n].reverse().find(s=>s.run!==null);if(l){let s=o===l,f=a[a.length-1],d=Math.min(l.end,t)-l.start;s&&u>0&&(d-=u);let p=ot(f);if(d>0&&d<p.length){let[m]=this._split_run_at_index(f,d);a[a.length-1]=m,i=true;}}return i&&r&&this._build_map(),a}get_insertion_anchor(e,t=true){let r=this.spans.filter(i=>i.end===e);if(r.length>0){for(let i=r.length-1;i>=0;i--)if(r[i].run)return [r[i].run,r[i].paragraph];for(let i=r.length-1;i>=0;i--)if(r[i].paragraph)return [null,r[i].paragraph]}let n=this.spans.filter(i=>i.start<e&&e<i.end);if(n.length>0){let i=n[0];if(i.run===null)return i.paragraph===null?this.get_insertion_anchor(i.end,t):[null,i.paragraph];{let o=e-i.start,[u]=this._split_run_at_index(i.run,o);return t&&this._build_map(),[u,i.paragraph]}}if(e===0&&this.spans.length>0){for(let i of this.spans)if(i.run)return [i.run,i.paragraph];for(let i of this.spans)if(i.paragraph)return [null,i.paragraph];return [null,null]}let a=this.spans.filter(i=>i.end<e);if(a.length>0){for(let i=a.length-1;i>=0;i--)if(a[i].run)return [a[i].run,a[i].paragraph];for(let i=a.length-1;i>=0;i--)if(a[i].paragraph)return [null,a[i].paragraph]}return [null,null]}_split_run_at_index(e,t){let r=ot(e),n=r.substring(0,t),a=r.substring(t);this._set_run_text_elements(e._element,n);let i=e._element.cloneNode(true);this._set_run_text_elements(i,a),e._element.parentNode&&e._element.parentNode.insertBefore(i,e._element.nextSibling);let o=new Ke(i,e._parent);return [e,o]}_set_run_text_elements(e,t){let r=[];for(let a=0;a<e.childNodes.length;a++){let i=e.childNodes[a];i.nodeType===1&&["w:t","w:delText","w:br","w:cr","w:tab"].includes(i.tagName)&&r.push(i);}for(let a of r)e.removeChild(a);let n=e.ownerDocument;if(n){let a=n.createElement("w:t");a.textContent=t,t.trim()!==t&&a.setAttribute("xml:space","preserve"),e.appendChild(a);}}get_context_at_range(e,t){let r=this.spans.filter(n=>n.run&&n.end>e&&n.start<t);return r.length>0?r[0]:null}};function fa(e){let t=0,r=0,n=e.length,a=h(i=>/[a-zA-Z0-9]/.test(i),"isAlnum");for(;r<n;){if(e[r]==="_"){let i=false;(r>0&&e[r-1]==="_"||r<n-1&&e[r+1]==="_")&&(i=true);let o=false;r>0&&a(e[r-1])&&r<n-1&&a(e[r+1])&&(o=true),!i&&!o&&t++;}r++;}return t}h(fa,"_count_standalone_underscores");function bn(e,t){if(!e||!t)return [0,0];let r=h(s=>/\s/.test(s),"isSpace"),n=0,a=Math.min(e.length,t.length);for(;n<a&&e[n]===t[n];)n++;if(n<e.length&&n<t.length)for(;n>0;){let s=!r(e[n-1])&&!r(e[n]),f=!r(t[n-1])&&!r(t[n]);if(s||f)n--;else break}for(;n>0;){if(n<e.length){let g=e.substring(n-1,n+1);if(g==="**"||g==="__"){n--;continue}}let s=e.substring(0,n),f=(s.match(/\*\*/g)||[]).length,c=(s.match(/__/g)||[]).length,d=fa(s);if(f%2!==0){n=s.lastIndexOf("**");continue}if(c%2!==0){n=s.lastIndexOf("__");continue}if(d%2!==0){let g=s.length-1,b=h(w=>/[a-zA-Z0-9]/.test(w),"isAlnum");for(;g>=0;){if(s[g]==="_"&&(g===0||s[g-1]!=="_")&&(g===s.length-1||s[g+1]!=="_")&&!(g>0&&b(s[g-1])&&g<s.length-1&&b(s[g+1]))){n=g;break}g--;}continue}let p=n,m=false;for(;p>0;){let g=e[p-1];if(g==="#"){for(n=p-1;n>0&&e[n-1]!==`
|
|
41
|
+
`;)n--;m=true;break}if(g===`
|
|
42
|
+
`)break;p--;}if(!m)break}let i=0,o=e.length-n,u=t.length-n,l=Math.min(o,u);for(;i<l&&e[e.length-1-i]===t[t.length-1-i];)i++;if(i>0)for(;i>0;){let s=false;i<e.length&&(s=!r(e[e.length-1-i])&&!r(e[e.length-i]));let f=false;if(i<t.length&&(f=!r(t[t.length-1-i])&&!r(t[t.length-i])),s||f)i--;else break}for(;i>0;){let s=e.length-i;if(s>0){let m=e.substring(s-1,s+1);if(m==="**"||m==="__"){i--;continue}}let f=e.substring(e.length-i),c=(f.match(/\*\*/g)||[]).length,d=(f.match(/__/g)||[]).length,p=fa(f);if(c%2!==0){i-=f.indexOf("**")+2;continue}if(d%2!==0){i-=f.indexOf("__")+2;continue}if(p%2!==0){let m=0,g=h(b=>/[a-zA-Z0-9]/.test(b),"isAlnum");for(;m<f.length;){if(f[m]==="_"&&(m===0||f[m-1]!=="_")&&(m===f.length-1||f[m+1]!=="_")&&!(m>0&&g(f[m-1])&&m<f.length-1&&g(f[m+1]))){i-=m+1;break}m++;}continue}break}i>0&&/^\s+$/.test(e.substring(e.length-i))&&(i=0);for(let s of ["**","__","_"]){let f=s.length,c=e.substring(n,e.length-i),d=t.substring(n,t.length-i);c.startsWith(s)&&d.startsWith(s)&&c.endsWith(s)&&d.endsWith(s)&&c.length>=2*f&&d.length>=2*f&&(n+=f,i+=f);}return [n,i]}h(bn,"trim_common_context");function Qu(e,t){let r=[],n={},a=/(\s+|[\p{L}\p{N}_]+|[^\p{L}\p{N}_\s])/gu,i=h(o=>{let u=o.split(a).filter(Boolean),l="";for(let s of u)if(s in n)l+=String.fromCharCode(n[s]);else {let f=r.length;n[s]=f,r.push(s),l+=String.fromCharCode(f);}return l},"encode_text");return [i(e),i(t),r]}h(Qu,"_words_to_chars");function Ju(e,t){let r=new Ia.default.diff_match_patch;r.Diff_Timeout=2;let[n,a,i]=Qu(e,t),o=r.diff_main(n,a,false);r.diff_cleanupSemantic(o);for(let f=0;f<o.length;f++){let c=o[f][1],d="";for(let p=0;p<c.length;p++)d+=i[c.charCodeAt(p)];o[f][1]=d;}let u=[],l=0,s=null;for(let[f,c]of o)if(f===0){if(s){let[d,p]=s;u.push({type:"modify",target_text:p,new_text:"",comment:"Diff: Text deleted",_match_start_index:d}),s=null;}l+=c.length;}else if(f===-1)s=[l,c],l+=c.length;else if(f===1)if(s){let[d,p]=s;u.push({type:"modify",target_text:p,new_text:c,comment:"Diff: Replacement",_match_start_index:d}),s=null;}else u.push({type:"modify",target_text:"",new_text:c,comment:"Diff: Text inserted",_match_start_index:l});if(s){let[f,c]=s;u.push({type:"modify",target_text:c,new_text:"",comment:"Diff: Text deleted",_match_start_index:f});}return u}h(Ju,"generate_edits_from_text");function ka(e,t,r="Original",n="Modified"){let a=Ju(e,t),i=[`--- ${r}`,`+++ ${n}`,""],o=40;for(let u of a){let l=u._match_start_index||0,s=u.target_text||"",f=u.new_text||"",[c,d]=bn(s,f),p=s.length-d,m=f.length-d,g=s.substring(c,p),b=f.substring(c,m),w=l+c,v=w+g.length,E=Math.max(0,w-o),_=e.substring(E,w);E>0&&(_="..."+_);let D=Math.min(e.length,v+o),y=e.substring(v,D);D<e.length&&(y=y+"..."),_=_.replace(/\n/g," ").replace(/\r/g,""),y=y.replace(/\n/g," ").replace(/\r/g,""),i.push("@@ Word Patch @@"),i.push(` ${_}`),g&&i.push(`- ${g}`),b&&i.push(`+ ${b}`),i.push(` ${y}`),i.push("");}return i.join(`
|
|
43
|
+
`)}h(ka,"create_word_patch_diff");var Zu=5,ha=50;function Ku(e,t,r,n){let a=n.length;if(a<2)throw new Error(`format_ambiguity_error requires at least 2 matches, got ${a}`);let i=n.slice(0,Zu),o=a-i.length,u=[`- Edit ${e} Failed: Ambiguous match. Target text appears ${a} times. First ${i.length} occurrences:`];for(let l=0;l<i.length;l++){let[s,f]=i[l],c=Math.max(0,s-ha),d=Math.min(r.length,f+ha),p=r.substring(c,s).replace(/\n/g," "),m=r.substring(f,d).replace(/\n/g," "),g=r.substring(s,f).replace(/\n/g," ");g.length>50&&(g=g.substring(0,25)+"..."+g.substring(g.length-20));let b=c>0?"...":"",w=d<r.length?"...":"";u.push(` ${l+1}. "${b}${p}[${g}]${m}${w}"`);}return o>0&&u.push(` ... and ${o} more occurrence(s) not shown.`),u.push(" Please provide more surrounding context in your target_text to uniquely identify the location."),u.join(`
|
|
44
|
+
`)}h(Ku,"format_ambiguity_error");function at(e){let t=e.nextSibling;for(;t;){if(t.nodeType===1)return t;t=t.nextSibling;}return null}h(at,"getNextElement");function kr(e){let t=e.previousSibling;for(;t;){if(t.nodeType===1)return t;t=t.previousSibling;}return null}h(kr,"getPreviousElement");function kt(e,t){t.parentNode&&t.parentNode.insertBefore(e,t.nextSibling);}h(kt,"insertAfter");var Pr=class extends Error{static{h(this,"BatchValidationError");}errors;constructor(e){super(`Batch validation failed:
|
|
45
45
|
`+e.join(`
|
|
46
|
-
`)),this.name="BatchValidationError",this.errors=e;}};function Ku(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],o=n.target_text||"",i=n.new_text||"";if((i.includes("{++")||i.includes("{--")||i.includes("{>>")||i.includes("{=="))&&t.push(`- Edit ${r+1} Failed: Do not manually write CriticMarkup tags ({++, {--, {>>, {==) in \`new_text\`. The engine handles redlining automatically. To add a comment, use the \`comment\` parameter.`),o.includes("[^")||i.includes("[^")){let a=(o.match(/\[\^(?:fn|en)-[^\]]+\]/g)||[]).sort(),s=(i.match(/\[\^(?:fn|en)-[^\]]+\]/g)||[]).sort();JSON.stringify(a)!==JSON.stringify(s)&&(s.length>a.length||s.some(l=>s.filter(u=>u===l).length>a.filter(u=>u===l).length)?t.push(`- Edit ${r+1} Failed: Cannot insert footnote/endnote markers via text replace. Markers like \`[^fn-N]\` are read-only projections. Use Word's References menu.`):t.push(`- Edit ${r+1} Failed: Cannot delete footnote/endnote references via text replace. The marker corresponds to a structural XML element.`));}if(o.includes("](")||i.includes("](")){let a=(o.match(/\[(?!~)[^\]]+\]\([^)]+\)/g)||[]).sort(),s=(i.match(/\[(?!~)[^\]]+\]\([^)]+\)/g)||[]).sort();a.length!==s.length?s.length>a.length?t.push(`- Edit ${r+1} Failed: Cannot insert hyperlinks via text replace. Use a dedicated structural operation.`):t.push(`- Edit ${r+1} Failed: Cannot delete hyperlinks via text replace. The marker corresponds to a structural XML element.`):a.length>1&&JSON.stringify(a)!==JSON.stringify(s)&&t.push(`- Edit ${r+1} Failed: Can only edit or retarget one hyperlink per text replacement. Please split into multiple edits.`);}if(o.includes("[~")||i.includes("[~")){let a=o.match(/\[~[^~]+~\]\(#[^\)]+\)/g)||[],s=i.match(/\[~[^~]+~\]\(#[^\)]+\)/g)||[];a.length!==s.length?s.length>a.length?t.push(`- Edit ${r+1} Failed: Cannot insert cross-references via text replace. Markers are read-only projections.`):t.push(`- Edit ${r+1} Failed: Cannot delete cross-references via text replace. The marker corresponds to a structural XML element.`):JSON.stringify(a)!==JSON.stringify(s)&&t.push(`- Edit ${r+1} Failed: Modifying or retargeting cross-reference markers is disallowed to prevent dependency corruption.`);}if(o.includes("{#")||i.includes("{#")){let a=o.match(/\{#[^\}]+\}/g)||[],s=i.match(/\{#[^\}]+\}/g)||[];for(let l of s)if(s.filter(u=>u===l).length>a.filter(u=>u===l).length){t.push(`- Edit ${r+1} Failed: Cannot modify or insert internal anchor markers (\`{#...}\`). These represent structural XML bookmarks.`);break}}if(n.type==="modify"&&i){let a=i.split(/[\r\n]+/);for(let s of a){let l=s.trimStart();if(l.startsWith("#######")){let u=l.length-l.replace(/^#+/,"").length;if(l.substring(u).startsWith(" ")||l.substring(u)===""){t.push(`- Edit ${r+1} Failed: Heading level ${u} is not supported (maximum is 6).`);break}}}}(o.includes("READONLY_BOUNDARY_START")||i.includes("READONLY_BOUNDARY_START")||o.includes("# Document Structure (Read-Only)")||i.includes("# Document Structure (Read-Only)"))&&t.push(`- Edit ${r+1} Failed: Modification targets the read-only boundary (Structural Appendix). This section cannot be edited.`);}return t}h(Ku,"validate_edit_strings");var Tn=class{static{h(this,"RedlineEngine");}doc;author;timestamp;current_id;mapper;comments_manager;clean_mapper=null;skipped_details=[];constructor(e,t="Adeu AI (TS)"){this.doc=e,this.author=t,this.timestamp=new Date().toISOString().replace(/\.\d{3}Z$/,"Z");let r="http://schemas.microsoft.com/office/word/2023/wordml/word16du";for(let n of this.doc.pkg.parts)(n===this.doc.part||n.contentType.includes("wordprocessingml")&&n.contentType.endsWith("+xml"))&&(n._element.hasAttribute("xmlns:w16du")||n._element.setAttribute("xmlns:w16du",r));this.current_id=this._scan_existing_ids(),this.mapper=new yn(this.doc),this.comments_manager=new Pr(this.doc);}_scan_existing_ids(){let e=0;for(let t of ["w:ins","w:del"]){let r=x(this.doc.element,t);for(let n of r){let o=parseInt(n.getAttribute("w:id")||"0",10);!isNaN(o)&&o>e&&(e=o);}}return e}accept_all_revisions(){let e=[this.doc.element];for(let n of this.doc.pkg.parts)n!==this.doc.part&&n.contentType.includes("wordprocessingml")&&n.contentType.endsWith("+xml")&&e.push(n._element);for(let n of e){let o=x(n,"w:ins");for(let s of o){this._clean_wrapping_comments(s);let l=s.parentNode;if(l){if(l.tagName==="w:trPr"){l.removeChild(s);continue}for(;s.firstChild;)l.insertBefore(s.firstChild,s);l.removeChild(s);}}let i=x(n,"w:p");for(let s of i){let l=P(s,"w:pPr");if(l){let u=P(l,"w:rPr"),f=u?P(u,"w:del"):null;if(u&&f){let c=false;for(let d of ["w:t","w:tab","w:br"]){for(let p of x(s,d)){if(d==="w:t"&&!p.textContent)continue;let g=false,m=p.parentNode;for(;m&&m!==s;){if(m.tagName==="w:del"){g=true;break}m=m.parentNode;}if(!g){c=true;break}}if(c)break}c?u.removeChild(f):(this._clean_wrapping_comments(s),this._delete_comments_in_element(s),s.parentNode&&s.parentNode.removeChild(s));}}}let a=x(n,"w:del");for(let s of a){this._clean_wrapping_comments(s),this._delete_comments_in_element(s);let l=s.parentNode;if(l)if(l.tagName==="w:trPr"){let u=l.parentNode;u&&u.parentNode&&u.parentNode.removeChild(u);}else l.removeChild(s);}}let t=new Set;for(let n of ["w:commentRangeStart","w:commentRangeEnd","w:commentReference"])for(let o of x(this.doc.element,n)){let i=o.getAttribute("w:id");i&&t.add(i);}let r=this.doc.pkg.parts.find(n=>n.contentType==="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml");if(r)for(let n of x(r._element,"w:comment")){let o=n.getAttribute("w:id");o&&t.add(o);}for(let n of t)this.comments_manager.deleteComment(n);}_getNextId(){return this.current_id++,this.current_id.toString()}_create_track_change_tag(e,t="",r=null){let o=this.doc.part._element.ownerDocument.createElement(e),i=r!==null?r:this._getNextId();return o.setAttribute("w:id",i),o.setAttribute("w:author",t||this.author),o.setAttribute("w:date",this.timestamp),o.setAttribute("w16du:dateUtc",this.timestamp),o}_set_text_content(e,t){e.textContent=t,t.trim()!==t&&e.setAttribute("xml:space","preserve");}_attach_comment(e,t,r,n){if(!n)return;let o=this.comments_manager.addComment(this.author,n),i=e.ownerDocument,a=i.createElement("w:commentRangeStart");a.setAttribute("w:id",o);let s=i.createElement("w:commentRangeEnd");s.setAttribute("w:id",o);let l=i.createElement("w:r"),u=i.createElement("w:rPr"),f=i.createElement("w:rStyle");f.setAttribute("w:val","CommentReference"),u.appendChild(f),l.appendChild(u);let c=i.createElement("w:commentReference");c.setAttribute("w:id",o),l.appendChild(c),e.insertBefore(a,t);let d=r.nextSibling;d?(e.insertBefore(s,d),e.insertBefore(l,s.nextSibling)):(e.appendChild(s),e.appendChild(l));}_attach_comment_spanning(e,t,r,n,o){if(!o)return;let i=this.comments_manager.addComment(this.author,o),a=e.ownerDocument,s=r.ownerDocument,l=a.createElement("w:commentRangeStart");l.setAttribute("w:id",i);let u=s.createElement("w:commentRangeEnd");u.setAttribute("w:id",i);let f=s.createElement("w:r"),c=s.createElement("w:rPr"),d=s.createElement("w:rStyle");d.setAttribute("w:val","CommentReference"),c.appendChild(d),f.appendChild(c);let p=s.createElement("w:commentReference");p.setAttribute("w:id",i),f.appendChild(p),e.insertBefore(l,t);let g=n.nextSibling;g?(r.insertBefore(u,g),r.insertBefore(f,u.nextSibling)):(r.appendChild(u),r.appendChild(f));}_track_insert_multiline(e,t,r,n){if(!e)return {first_node:null,last_p:null,last_ins:null,used_block_mode:false};let o=this.doc.part._element.ownerDocument,i=e.split(/[\r\n]+/),a=null;if(r!==null)a=r._element;else if(t!==null){let v=t._element;for(;v&&v.tagName!=="w:p";)v=v.parentNode;a=v;}for(;i.length>1&&i[i.length-1]==="";)i.pop();if(i.length===0)return {first_node:null,last_p:null,last_ins:null,used_block_mode:false};let[s,l]=this._parse_markdown_style(i[0]),f=l!==null&&a!==null,c=null,d=null;f||(d=this._build_tracked_ins_for_line((s===i[0],i[0]),t,n,o),c=d);let p=f?i:i.slice(1);if(p.length===0)return {first_node:c,last_p:null,last_ins:d,used_block_mode:false};if(!a)return {first_node:c,last_p:null,last_ins:d,used_block_mode:false};let g=a.parentNode;if(!g)return {first_node:c,last_p:null,last_ins:d,used_block_mode:false};let m=h((v,_)=>{g.insertBefore(v,_.nextSibling);},"insertAfterEl"),b=null,y=null,w=a;for(let v=0;v<p.length;v++){let _=p[v],[D,E]=this._parse_markdown_style(_),A=o.createElement("w:p");if(E)this._set_paragraph_style(A,E);else {let R=P(a,"w:pPr");R&&A.appendChild(R.cloneNode(true));}let N=P(A,"w:pPr");N||(N=o.createElement("w:pPr"),A.insertBefore(N,A.firstChild));let C=P(N,"w:rPr");C||(C=o.createElement("w:rPr"),N.appendChild(C));let F=this._create_track_change_tag("w:ins","",n);C.appendChild(F);let k=this._build_tracked_ins_for_line(D,t,n,o);k&&A.appendChild(k),m(A,w),w=A,b=A,y=k,c||(c=A);}return {first_node:c,last_p:b,last_ins:y,used_block_mode:f}}_build_tracked_ins_for_line(e,t,r,n){if(!e&&e!=="")return null;let o=this._create_track_change_tag("w:ins","",r),i=this._parse_inline_markdown(e);if(i.length===0)return null;for(let[a,s]of i){let l=n.createElement("w:r");if(t&&t._element){let f=P(t._element,"w:rPr");if(f){let c=f.cloneNode(true);for(let d of ["w:vanish","w:strike","w:dstrike"]){let p=P(c,d);p&&c.removeChild(p);}l.appendChild(c);}}this._apply_run_props(l,s,false);let u=n.createElement("w:t");this._set_text_content(u,a),l.appendChild(u),o.appendChild(l);}return o}_parse_markdown_style(e){let t=e.trimStart();if(t.startsWith("#")){let n=0,o=t;for(;o.startsWith("#");)n++,o=o.substring(1);if(o.startsWith(" "))return [o.trim(),`Heading ${n}`]}if(t.startsWith("* ")||t.startsWith("- "))return [t.substring(2).trim(),"List Paragraph"];let r=t.match(/^\d+\.\s+/);return r?[t.substring(r[0].length).trim(),"List Number"]:[e,null]}_parse_inline_markdown(e,t={}){if(!e)return [];let r=/(\*\*.*?\*\*)|(_.*?_)/,n=e.match(r);if(!n)return [[e,t]];let o=n.index,i=n[0],a=o+i.length,s=i.startsWith("**"),l=s?i.substring(2,i.length-2):i.substring(1,i.length-1),u=e.substring(0,o),f=e.substring(a),c=[];u&&c.push([u,t]);let d={...t};return s?d.bold=true:d.italic=true,c.push(...this._parse_inline_markdown(l,d)),c.push(...this._parse_inline_markdown(f,t)),c}_apply_run_props(e,t,r=false){if(!t){if(!r)return;t={};}let n=P(e,"w:rPr");if(!n&&(t.bold||t.italic||r)&&(n=e.ownerDocument.createElement("w:rPr"),e.appendChild(n)),n){let o=e.ownerDocument;if(t.bold){let i=P(n,"w:b");i||(i=o.createElement("w:b"),n.appendChild(i)),i.setAttribute("w:val","1");}else if(r){let i=P(n,"w:b");i&&n.removeChild(i);}if(t.italic){let i=P(n,"w:i");i||(i=o.createElement("w:i"),n.appendChild(i)),i.setAttribute("w:val","1");}else if(r){let i=P(n,"w:i");i&&n.removeChild(i);}}}_set_paragraph_style(e,t){let r=e.ownerDocument,n=P(e,"w:pPr");n&&e.removeChild(n);let o=r.createElement("w:pPr"),i=r.createElement("w:pStyle"),a=t.replace(/\s+/g,"");i.setAttribute("w:val",a),o.appendChild(i),e.insertBefore(o,e.firstChild);}_anchor_reply_comment(e,t){let r=this.doc.part._element.ownerDocument,n=x(this.doc.element,"w:commentRangeStart").filter(m=>m.getAttribute("w:id")===e);if(n.length===0)return;let o=n[0],i=r.createElement("w:commentRangeStart");i.setAttribute("w:id",t),Ot(i,o);let a=x(this.doc.element,"w:commentRangeEnd").filter(m=>m.getAttribute("w:id")===e);if(a.length===0)return;let s=a[0],l=x(this.doc.element,"w:commentReference").filter(m=>m.getAttribute("w:id")===e),u=s;if(l.length>0){let m=l[0];m.parentNode&&m.parentNode.tagName==="w:r"&&(u=m.parentNode);}let f=r.createElement("w:commentRangeEnd");f.setAttribute("w:id",t),Ot(f,u);let c=r.createElement("w:r"),d=r.createElement("w:rPr"),p=r.createElement("w:rStyle");p.setAttribute("w:val","CommentReference"),d.appendChild(p),c.appendChild(d);let g=r.createElement("w:commentReference");g.setAttribute("w:id",t),c.appendChild(g),Ot(c,f);}_clean_wrapping_comments(e){let t=e;for(;;){let l=Sr(t);if(l&&(l.tagName==="w:ins"||l.tagName==="w:del"))t=l;else break}let r=e;for(;;){let l=ot(r);if(l&&(l.tagName==="w:ins"||l.tagName==="w:del"))r=l;else break}let n=[],o=Sr(t);for(;o;)if(o.tagName==="w:commentRangeStart")n.push(o),o=Sr(o);else if(o.tagName==="w:rPr"||o.tagName==="w:pPr")o=Sr(o);else break;let i=[],a=ot(r);for(;a;)if(a.tagName==="w:commentRangeEnd")i.push(a),a=ot(a);else if(a.tagName==="w:r"&&x(a,"w:commentReference").length>0)i.push(a),a=ot(a);else if(a.tagName==="w:commentReference")i.push(a),a=ot(a);else break;let s=new Set;for(let l of i)if(l.tagName==="w:commentRangeEnd"){let u=l.getAttribute("w:id");u&&s.add(u);}else {let u=x(l,"w:commentReference")[0];if(!u&&l.tagName==="w:commentReference"&&(u=l),u){let f=u.getAttribute("w:id");f&&s.add(f);}}for(let l of n){let u=l.getAttribute("w:id");if(u&&s.has(u)){this.comments_manager.deleteComment(u),l.parentNode&&l.parentNode.removeChild(l);for(let f of i){let c=null;if(f.tagName==="w:commentRangeEnd")c=f.getAttribute("w:id");else {let d=x(f,"w:commentReference")[0];!d&&f.tagName==="w:commentReference"&&(d=f),d&&(c=d.getAttribute("w:id"));}c===u&&f.parentNode&&f.parentNode.removeChild(f);}}}}_delete_comments_in_element(e){let t=x(e,"w:commentReference");for(let r of t){let n=r.getAttribute("w:id");if(n){this.comments_manager.deleteComment(n);for(let o of ["w:commentRangeStart","w:commentRangeEnd"]){let i=x(this.doc.element,o);for(let a of i)a.getAttribute("w:id")===n&&a.parentNode&&a.parentNode.removeChild(a);}}}}validate_edits(e){let t=[];this.mapper.full_text||this.mapper._build_map(),t.push(...Ku(e));for(let r=0;r<e.length;r++){let n=e[r];if(!n.target_text)continue;let o=this.mapper.find_all_match_indices(n.target_text),i=this.mapper.full_text;if(o.length===0&&(this.clean_mapper||(this.clean_mapper=new yn(this.doc,true)),o=this.clean_mapper.find_all_match_indices(n.target_text),o.length>0&&(i=this.clean_mapper.full_text)),o.length===0)t.push(`- Edit ${r+1} Failed: Target text not found in document:
|
|
47
|
-
"${n.target_text}"`);else if(o.length>1){let a=o.map(([s,l])=>[s,s+l]);t.push(Ju(r+1,n.target_text,i,a));}for(let[a,s]of o){let l=this.mapper.spans.filter(f=>f.end>a&&f.start<a+s),u=new Set;for(let f of l)if(f.ins_id){let c=x(this.doc.element,"w:ins").filter(d=>d.getAttribute("w:id")===f.ins_id);if(c.length>0){let d=c[0].getAttribute("w:author");d&&d!==this.author&&u.add(d);}}u.size>0&&t.push(`- Edit ${r+1} Failed: Modification targets an active insertion from another author (${Array.from(u).join(", ")}). Accept that change first or scope your edit outside of it.`);}}return t}validate_review_actions(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],o=n.type;if(o==="reply"){let i=n.target_id.replace("Com:",""),a=false,s=this.doc.pkg.parts.find(l=>l.contentType==="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml");s&&(a=x(s._element,"w:comment").some(u=>u.getAttribute("w:id")===i)),a||t.push(`- Action ${r+1} Failed: Target comment ID ${n.target_id} not found.`);}else if(o==="accept"||o==="reject"){let i=n.target_id.replace("Chg:",""),a=x(this.doc.element,"w:ins").filter(l=>l.getAttribute("w:id")===i),s=x(this.doc.element,"w:del").filter(l=>l.getAttribute("w:id")===i);a.length===0&&s.length===0&&t.push(`- Action ${r+1} Failed: Target ID ${n.target_id} not found.`);}}return t}process_batch(e){this.skipped_details=[];let t=e.filter(l=>["accept","reject","reply"].includes(l.type)),r=e.filter(l=>!["accept","reject","reply"].includes(l.type)),n=[];if(t.length>0&&n.push(...this.validate_review_actions(t)),r.length>0&&n.push(...this.validate_edits(r)),n.length>0)throw new Zu(n);let o=0,i=0;if(t.length>0){let l=this.apply_review_actions(t);o=l[0],i=l[1],o>0&&(this.mapper._build_map(),this.clean_mapper&&this.clean_mapper._build_map());}let a=0,s=0;if(r.length>0){let l=this.apply_edits(r);a=l[0],s=l[1];}return {actions_applied:o,actions_skipped:i,edits_applied:a,edits_skipped:s,skipped_details:this.skipped_details}}apply_edits(e){let t=0,r=0,n=[];for(let i of e)if(i._match_start_index!==void 0&&i._match_start_index!==null)n.push([i,i.new_text||null]);else if(i.type==="insert_row"||i.type==="delete_row"){let[a]=this.mapper.find_match_index(i.target_text);a!==-1?(i._match_start_index=a,n.push([i,null])):(r++,this.skipped_details.push(`- Failed to locate row target: '${(i.target_text||"").substring(0,40)}...'`));}else {let a=this._pre_resolve_heuristic_edit(i);if(a)if(Array.isArray(a))for(let s of a)n.push([s,s.new_text]);else n.push([a,a.new_text]);else r++,this.skipped_details.push(`- Failed to apply edit targeting: '${(i.target_text||"insertion").substring(0,40)}...'`);}n.sort((i,a)=>(a[0]._match_start_index||0)-(i[0]._match_start_index||0));let o=[];for(let[i,a]of n){let s=i._match_start_index||0,l=s+(i.target_text?i.target_text.length:0);if(o.some(([c,d])=>s<d&&l>c)){r++,this.skipped_details.push(`- Skipped overlapping edit targeting: '${(i.target_text||"insertion").substring(0,40)}...'`);continue}let f=false;i.type==="modify"?f=this._apply_single_edit_indexed(i,a,false):(i.type==="insert_row"||i.type==="delete_row")&&(f=this._apply_table_edit(i,false)),f?(t++,o.push([s,l])):(r++,this.skipped_details.push(`- Failed to apply edit targeting: '${(i.target_text||"insertion").substring(0,40)}...'`));}return [t,r]}apply_review_actions(e){let t=0,r=0;for(let n of e){let o=n.type;if(o==="reply"){let u=n.target_id.replace("Com:",""),f=this.comments_manager.addComment(this.author,n.text,u);this._anchor_reply_comment(u,f),t++;continue}let i=n.target_id.replace("Chg:",""),a=x(this.doc.element,"w:ins").filter(u=>u.getAttribute("w:id")===i),s=x(this.doc.element,"w:del").filter(u=>u.getAttribute("w:id")===i),l=[...a,...s];if(l.length===0){r++,this.skipped_details.push(`- Failed to apply action: Target ID ${n.target_id} not found.`);continue}for(let u of l){let f=u.tagName==="w:ins",d=(u.parentNode?u.parentNode.tagName:"")==="w:trPr";if(o==="accept")if(f)if(this._clean_wrapping_comments(u),d)u.parentNode?.removeChild(u);else {for(;u.firstChild;)u.parentNode?.insertBefore(u.firstChild,u);u.parentNode?.removeChild(u);}else if(this._clean_wrapping_comments(u),this._delete_comments_in_element(u),d){let p=u.parentNode?.parentNode;p?.parentNode?.removeChild(p);}else u.parentNode?.removeChild(u);else if(o==="reject")if(f)if(this._clean_wrapping_comments(u),this._delete_comments_in_element(u),d){let p=u.parentNode?.parentNode;p?.parentNode?.removeChild(p);}else u.parentNode?.removeChild(u);else if(this._clean_wrapping_comments(u),d)u.parentNode?.removeChild(u);else {let p=Array.from(u.getElementsByTagName("w:delText"));for(let g of p){let m=g.ownerDocument.createElement("w:t");m.textContent=g.textContent,g.hasAttribute("xml:space")&&m.setAttribute("xml:space","preserve"),g.parentNode?.replaceChild(m,g);}for(;u.firstChild;)u.parentNode?.insertBefore(u.firstChild,u);u.parentNode?.removeChild(u);}}t++;}return [t,r]}_apply_table_edit(e,t){let r=e._match_start_index||0,[n,o]=this.mapper.get_insertion_anchor(r,t),i=null;if(n?i=n._element:o&&(i=o._element),!i)return false;let a=i;for(;a&&a.tagName!=="w:tr";)a=a.parentNode;if(!a)return false;if(e.type==="delete_row"){let s=P(a,"w:trPr");return s||(s=a.ownerDocument.createElement("w:trPr"),a.insertBefore(s,a.firstChild)),s.appendChild(this._create_track_change_tag("w:del")),true}else if(e.type==="insert_row"){let s=a.ownerDocument.createElement("w:tr"),l=a.ownerDocument.createElement("w:trPr");s.appendChild(l),l.appendChild(this._create_track_change_tag("w:ins"));for(let u of e.cells){let f=a.ownerDocument.createElement("w:tc"),c=a.ownerDocument.createElement("w:p"),d=a.ownerDocument.createElement("w:r"),p=a.ownerDocument.createElement("w:t");p.textContent=u,u.trim()!==u&&p.setAttribute("xml:space","preserve"),d.appendChild(p),c.appendChild(d),f.appendChild(c),s.appendChild(f);}return e.position==="above"?a.parentNode?.insertBefore(s,a):Ot(s,a),true}return false}_pre_resolve_heuristic_edit(e){if(!e.target_text)return null;let[t,r]=this.mapper.find_match_index(e.target_text),n=false;if(t===-1)if(this.clean_mapper||(this.clean_mapper=new yn(this.doc,true)),[t,r]=this.clean_mapper.find_match_index(e.target_text),t!==-1)n=true;else return null;let o=n?this.clean_mapper:this.mapper,i=e.new_text||"",a=this.mapper.full_text.substring(t,t+r);if(a===i||e.target_text===i)return {type:"modify",target_text:a,new_text:a,comment:e.comment,_match_start_index:t,_internal_op:"COMMENT_ONLY",_active_mapper_ref:o};let s="",l="",u="",f=t;if(i.startsWith(a))s="INSERTION",u=i.substring(a.length),f=t+r;else {let[c,d]=So(a,i),p=a.length-d,g=i.length-d;l=a.substring(c,p),u=i.substring(c,g),f=t+c,!l&&u?s="INSERTION":l&&!u?s="DELETION":l&&u?s="MODIFICATION":s="COMMENT_ONLY";}return {type:"modify",target_text:l,new_text:u,comment:e.comment,_match_start_index:f,_internal_op:s,_active_mapper_ref:o}}_apply_single_edit_indexed(e,t,r){let n=e._internal_op,o=e._active_mapper_ref||this.mapper,i=e._match_start_index||0,a=e.target_text?e.target_text.length:0,s=["DELETION","MODIFICATION"].includes(n)?this._getNextId():null,l=["INSERTION","MODIFICATION"].includes(n)?this._getNextId():null;if(n==="COMMENT_ONLY"){let y=o.find_target_runs_by_index(i,a,r);if(y.length===0)return false;if(!e.comment)return true;let w=y[0]._element,v=y[y.length-1]._element,_=w;for(;_&&_.tagName!=="w:p";)_=_.parentNode;let D=v;for(;D&&D.tagName!=="w:p";)D=D.parentNode;if(!_||!D)return false;let E=h((C,F)=>{let k=C;for(;k.parentNode&&k.parentNode!==F;)k=k.parentNode;return k},"ascend_to_paragraph_child"),A=E(w,_),N=E(v,D);return _===D?this._attach_comment(_,A,N,e.comment):this._attach_comment_spanning(_,A,D,N,e.comment),true}if(n==="INSERTION"){let[y,w]=o.get_insertion_anchor(i,r);if(!y&&!w)return false;let v=this._track_insert_multiline(e.new_text||"",y,w,l);if(!v.first_node)return false;if(v.first_node.tagName==="w:ins"&&(y?Ot(v.first_node,y._element):w&&w._element.appendChild(v.first_node)),e.comment){let D=h((E,A)=>{let N=E;for(;N.parentNode&&N.parentNode!==A;)N=N.parentNode;return N},"ascend_to_paragraph_child");if(v.last_p&&v.last_ins){let E=v.first_node;for(;E&&E.tagName!=="w:p";)E=E.parentNode;if(E){let A=v.first_node;v.first_node.tagName==="w:p"&&(A=x(v.first_node,"w:ins")[0]||v.first_node);let N=D(A,E),C=D(v.last_ins,v.last_p);this._attach_comment_spanning(E,N,v.last_p,C,e.comment);}}else {let E=v.first_node;for(;E&&E.tagName!=="w:p";)E=E.parentNode;if(E){let A=v.first_node;v.first_node.tagName==="w:p"&&(A=x(v.first_node,"w:ins")[0]||v.first_node);let N=D(A,E);this._attach_comment(E,N,N,e.comment);}}}return true}let u=o.find_target_runs_by_index(i,a,r),f=o.get_virtual_spans_in_range(i,a);if(u.length===0&&f.length===0)return false;let c=new Set;for(let y of u){let w=y._element.parentNode;for(;w&&w.tagName!=="w:p";)w=w.parentNode;w&&c.add(w);}let d=null,p=null;for(let y of u){let w=this._create_track_change_tag("w:del","",s),v=y._element.cloneNode(true);Array.from(v.getElementsByTagName("w:t")).forEach(D=>{let E=v.ownerDocument.createElement("w:delText");E.textContent=D.textContent,D.hasAttribute("xml:space")&&E.setAttribute("xml:space","preserve"),v.replaceChild(E,D);}),w.appendChild(v),y._element.parentNode?.replaceChild(w,y._element),d===null&&(d=w),p=w;}let g=null,m=null,b=null;if(n==="MODIFICATION"&&e.new_text&&p){let y=p;for(;y&&y.tagName!=="w:p";)y=y.parentNode;let w=y?new Ze(y,null):null,v=u.length>0?u[u.length-1]:null,_=this._track_insert_multiline(e.new_text,v,w,l);_.first_node&&(_.first_node.tagName==="w:ins"?(Ot(_.first_node,p),g=_.first_node):g=_.last_ins,m=_.last_p,b=_.last_ins);}if(n==="DELETION"||n==="MODIFICATION"){if(n==="MODIFICATION"&&u.length===0&&f.length>0&&e.new_text){let y=f[0];if(y.paragraph){let w=y.paragraph._element,v=x(w,"w:r"),_=v.length>0?new Ke(v[v.length-1],y.paragraph):null,D=this._track_insert_multiline(e.new_text,_,y.paragraph,l);D.first_node&&w.appendChild(D.first_node);}}for(let y of [...f].reverse())if(y.paragraph){let w=y.paragraph._element,v=ot(w);for(;v&&v.tagName!=="w:p";)v=ot(v);if(v&&v.tagName==="w:p"){let _=P(w,"w:pPr");_||(_=w.ownerDocument.createElement("w:pPr"),w.insertBefore(_,w.firstChild));let D=P(_,"w:rPr");D||(D=w.ownerDocument.createElement("w:rPr"),_.appendChild(D));let E=this._create_track_change_tag("w:del");D.appendChild(E);let A=Array.from(v.childNodes);for(let N of A)N.nodeType===1&&N.tagName==="w:pPr"||w.appendChild(N);v.parentNode&&v.parentNode.removeChild(v);}}}if(e.comment&&d!==null){let y,w;if(m&&b)y=b,w=m;else {let A=g!==null?g:p;for(y=A,w=A;w&&w.tagName!=="w:p";)w=w.parentNode;}let v=d;for(;v&&v.tagName!=="w:p";)v=v.parentNode;if(!v||!w)return true;let _=h((A,N)=>{let C=A;for(;C.parentNode&&C.parentNode!==N;)C=C.parentNode;return C},"ascend_to_paragraph_child"),D=_(d,v),E=_(y,w);v===w?this._attach_comment(v,D,E,e.comment):this._attach_comment_spanning(v,D,w,E,e.comment);}for(let y of c){let w=false;for(let v of ["w:t","w:tab","w:br"]){let _=x(y,v);for(let D of _){let E=false,A=D.parentNode;for(;A&&A!==y.parentNode;){if(A.tagName==="w:del"){E=true;break}A=A.parentNode;}if(!E){if(v==="w:t"&&!D.textContent)continue;w=true;break}}if(w)break}if(!w){let v=P(y,"w:pPr");v||(v=y.ownerDocument.createElement("w:pPr"),y.insertBefore(v,y.firstChild));let _=P(v,"w:rPr");if(_||(_=y.ownerDocument.createElement("w:rPr"),v.appendChild(_)),!P(_,"w:del")){let D=this._create_track_change_tag("w:del");_.appendChild(D);}}}return true}};function el(e,t,r=2){if(e===t)return 0;if(Math.abs(e.length-t.length)>r)return r+1;if(e.length===0)return t.length<=r?t.length:r+1;if(t.length===0)return e.length<=r?e.length:r+1;if(e.length>t.length){let o=e;e=t,t=o;}let n=Array.from({length:e.length+1},(o,i)=>i);for(let o=1;o<=t.length;o++){let i=[o],a=o;for(let s=1;s<=e.length;s++){let l=e[s-1]===t[o-1]?0:1,u=Math.min(n[s]+1,i[s-1]+1,n[s-1]+l);i.push(u),u<a&&(a=u);}if(a>r)return r+1;n=i;}return n[e.length]<=r?n[e.length]:r+1}h(el,"boundedLevenshtein");function tl(e){let t="",r=x(e._element,"w:r");for(let n of r)t+=at(new Ke(n,e));return t}h(tl,"_get_paragraph_text");function rl(e,t){let r={},n=new Set,o={},i=[],a=/^(?:[\d.\-()a-zA-Z]+\s*)?["“]([A-Z][A-Za-z0-9\s\-&'’]{1,60})["”]/,s=/\([^)]*?["“]([A-Z][A-Za-z0-9\s\-&'’]{1,60})["”][^)]*?\)/g;for(let y of Cn(e)){if(!(y instanceof Ze))continue;let w=tl(y).trim();if(!w)continue;let v=[],_=w.match(a);_&&v.push(_[1].trim());let D=w.matchAll(s);for(let N of D)v.push(N[1].trim());for(let N of v)r[N]?n.add(N):r[N]={count:0};let E=w.length>60?w.substring(0,60)+"...":w,A=x(y._element,"*");for(let N of A){if(N.tagName==="w:bookmarkStart"){let F=N.getAttribute("w:name");F&&(!F.startsWith("_")||F.startsWith("_Ref"))&&(o[F]||(o[F]={anchored_to:E,referenced_from:[]}));}let C=null;if(N.tagName==="w:fldSimple"){let k=(N.getAttribute("w:instr")||"").trim().split(/\s+/);k.length>1&&k[0]==="REF"&&(C=k[1]);}else if(N.tagName==="w:instrText"){let k=(N.textContent||"").trim().split(/\s+/);k.length>1&&k[0]==="REF"&&(C=k[1]);}C&&i.push([C,E]);}}for(let[y,w]of i)o[y]&&o[y].referenced_from.push(w);let l=[],u=Object.keys(r);if(u.length>0){let y=u.sort((D,E)=>E.length-D.length),w=h(D=>D.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"escapeRegExp"),v=y.map(w).join("|"),_=new RegExp(`(?<!["\u201C])\\b(${v})\\b(?![\u201D"])`,"g");for(let D of t.matchAll(_)){let E=D[1];r[E]&&r[E].count++;}for(let D of u)r[D].count===0&&(delete r[D],n.delete(D));}for(let y of n)l.push(`[Error] Duplicate Definition: '${y}' is defined multiple times.`);let f=new Set(["The","This","That","Such","A","An","Any","All","Some","No","Every","Each","As","In","Of","For","To","On","By","With"]),c=/\b[A-Z][a-zA-Z]*(?:\s+[A-Z][a-zA-Z]*)*\b/g,d=new Set(t.match(c)||[]),p=new Set(Object.keys(r)),g={};for(let y of p){let w=y[0].toLowerCase();g[w]||(g[w]=[]),g[w].push(y);}let m={};for(let y of d){let w=y.trim(),v=w.split(/\s+/);for(;v.length>0;){let E=v[0],A=E.charAt(0).toUpperCase()+E.slice(1).toLowerCase();if(f.has(A))v.shift();else break}if(w=v.join(" "),w.length<4||p.has(w))continue;let _=w[0].toLowerCase(),D=g[_]||[];if(w.length>5)for(let[E,A]of Object.entries(g))E!==_&&(D=D.concat(A));for(let E of D){if(Math.abs(w.length-E.length)>2||w===E+"s"||w===E+"es"||E===w+"s"||E===w+"es")continue;let A=el(w,E,2);A===0||A>2||E.length<=5&&(A>1||w[0].toLowerCase()!==E[0].toLowerCase())||(m[E]||(m[E]=[]),m[E].includes(w)||m[E].push(w));}}for(let[y,w]of Object.entries(m)){w.sort();let v=w.map(_=>`'${_}'`).join(", ");l.push(`[Info] Possible Typos for '${y}': Found ${v}`);}function b(y){return y.startsWith("[Error]")?0:y.startsWith("[Warning]")?1:2}return h(b,"diag_sort_key"),l.sort((y,w)=>{let v=b(y),_=b(w);return v!==_?v-_:y.localeCompare(w)}),[r,l,o]}h(rl,"extract_all_domain_metadata");function nl(e,t){let[r,n,o]=rl(e,t),i=[`
|
|
46
|
+
`)),this.name="BatchValidationError",this.errors=e;}};function el(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],a=n.target_text||"",i=n.new_text||"";if((i.includes("{++")||i.includes("{--")||i.includes("{>>")||i.includes("{=="))&&t.push(`- Edit ${r+1} Failed: Do not manually write CriticMarkup tags ({++, {--, {>>, {==) in \`new_text\`. The engine handles redlining automatically. To add a comment, use the \`comment\` parameter.`),a.includes("[^")||i.includes("[^")){let o=(a.match(/\[\^(?:fn|en)-[^\]]+\]/g)||[]).sort(),u=(i.match(/\[\^(?:fn|en)-[^\]]+\]/g)||[]).sort();JSON.stringify(o)!==JSON.stringify(u)&&(u.length>o.length||u.some(l=>u.filter(s=>s===l).length>o.filter(s=>s===l).length)?t.push(`- Edit ${r+1} Failed: Cannot insert footnote/endnote markers via text replace. Markers like \`[^fn-N]\` are read-only projections. Use Word's References menu.`):t.push(`- Edit ${r+1} Failed: Cannot delete footnote/endnote references via text replace. The marker corresponds to a structural XML element.`));}if(a.includes("](")||i.includes("](")){let o=(a.match(/\[(?!~)[^\]]+\]\([^)]+\)/g)||[]).sort(),u=(i.match(/\[(?!~)[^\]]+\]\([^)]+\)/g)||[]).sort();o.length!==u.length?u.length>o.length?t.push(`- Edit ${r+1} Failed: Cannot insert hyperlinks via text replace. Use a dedicated structural operation.`):t.push(`- Edit ${r+1} Failed: Cannot delete hyperlinks via text replace. The marker corresponds to a structural XML element.`):o.length>1&&JSON.stringify(o)!==JSON.stringify(u)&&t.push(`- Edit ${r+1} Failed: Can only edit or retarget one hyperlink per text replacement. Please split into multiple edits.`);}if(a.includes("[~")||i.includes("[~")){let o=a.match(/\[~[^~]+~\]\(#[^\)]+\)/g)||[],u=i.match(/\[~[^~]+~\]\(#[^\)]+\)/g)||[];o.length!==u.length?u.length>o.length?t.push(`- Edit ${r+1} Failed: Cannot insert cross-references via text replace. Markers are read-only projections.`):t.push(`- Edit ${r+1} Failed: Cannot delete cross-references via text replace. The marker corresponds to a structural XML element.`):JSON.stringify(o)!==JSON.stringify(u)&&t.push(`- Edit ${r+1} Failed: Modifying or retargeting cross-reference markers is disallowed to prevent dependency corruption.`);}if(a.includes("{#")||i.includes("{#")){let o=a.match(/\{#[^\}]+\}/g)||[],u=i.match(/\{#[^\}]+\}/g)||[];for(let l of u)if(u.filter(s=>s===l).length>o.filter(s=>s===l).length){t.push(`- Edit ${r+1} Failed: Cannot modify or insert internal anchor markers (\`{#...}\`). These represent structural XML bookmarks.`);break}}if(n.type==="modify"&&i){let o=i.split(/[\r\n]+/);for(let u of o){let l=u.trimStart();if(l.startsWith("#######")){let s=l.length-l.replace(/^#+/,"").length;if(l.substring(s).startsWith(" ")||l.substring(s)===""){t.push(`- Edit ${r+1} Failed: Heading level ${s} is not supported (maximum is 6).`);break}}}}(a.includes("READONLY_BOUNDARY_START")||i.includes("READONLY_BOUNDARY_START")||a.includes("# Document Structure (Read-Only)")||i.includes("# Document Structure (Read-Only)"))&&t.push(`- Edit ${r+1} Failed: Modification targets the read-only boundary (Structural Appendix). This section cannot be edited.`);}return t}h(el,"validate_edit_strings");var Sn=class{static{h(this,"RedlineEngine");}doc;author;timestamp;current_id;mapper;comments_manager;clean_mapper=null;skipped_details=[];constructor(e,t="Adeu AI (TS)"){this.doc=e,this.author=t,this.timestamp=new Date().toISOString().replace(/\.\d{3}Z$/,"Z");let r="http://schemas.microsoft.com/office/word/2023/wordml/word16du";for(let n of this.doc.pkg.parts)(n===this.doc.part||n.contentType.includes("wordprocessingml")&&n.contentType.endsWith("+xml"))&&(n._element.hasAttribute("xmlns:w16du")||n._element.setAttribute("xmlns:w16du",r));this.current_id=this._scan_existing_ids(),this.mapper=new nr(this.doc),this.comments_manager=new ir(this.doc);}_check_punctuation_warning(e){return e&&(e.includes("_")||e.includes("-"))?`Warning: target_text '${e}' contains tokenization-splitting punctuation ('_' or '-'). This can trigger mid-word splits in the diff engine. Consider using a longer plain-prose anchor.`:null}_build_edit_context_previews(e){if(e.type!=="modify")return [null,null];e._resolved_proxy_edit&&(e=e._resolved_proxy_edit);let t=e._resolved_start_idx;if(t==null)return [null,null];let r=e.target_text||"",n=e.new_text||"",a=r.length,o=(e._active_mapper_ref||this.mapper).full_text;if(!o)return [null,null];let u=Math.max(0,t-30),l=o.substring(u,t),s=o.substring(t+a,t+a+30),f=`${l}{--${r}--}{++${n}++}${s}`,c=f;return c=c.replace(/\{>>.*?<<\}/gs,""),c=c.replace(/\{--.*?--\}/gs,""),c=c.replace(/\{\+\+(.*?)\+\+\}/gs,"$1"),[f,c]}_scan_existing_ids(){let e=0;for(let t of ["w:ins","w:del"]){let r=S(this.doc.element,t);for(let n of r){let a=parseInt(n.getAttribute("w:id")||"0",10);!isNaN(a)&&a>e&&(e=a);}}return e}accept_all_revisions(){let e=[this.doc.element];for(let n of this.doc.pkg.parts)n!==this.doc.part&&n.contentType.includes("wordprocessingml")&&n.contentType.endsWith("+xml")&&e.push(n._element);for(let n of e){let a=S(n,"w:ins");for(let u of a){this._clean_wrapping_comments(u);let l=u.parentNode;if(l){if(l.tagName==="w:trPr"){l.removeChild(u);continue}for(;u.firstChild;)l.insertBefore(u.firstChild,u);l.removeChild(u);}}let i=S(n,"w:p");for(let u of i){let l=O(u,"w:pPr");if(l){let s=O(l,"w:rPr"),f=s?O(s,"w:del"):null;if(s&&f){let c=false;for(let d of ["w:t","w:tab","w:br"]){for(let p of S(u,d)){if(d==="w:t"&&!p.textContent)continue;let m=false,g=p.parentNode;for(;g&&g!==u;){if(g.tagName==="w:del"){m=true;break}g=g.parentNode;}if(!m){c=true;break}}if(c)break}c?s.removeChild(f):(this._clean_wrapping_comments(u),this._delete_comments_in_element(u),u.parentNode&&u.parentNode.removeChild(u));}}}let o=S(n,"w:del");for(let u of o){this._clean_wrapping_comments(u),this._delete_comments_in_element(u);let l=u.parentNode;if(l)if(l.tagName==="w:trPr"){let s=l.parentNode;s&&s.parentNode&&s.parentNode.removeChild(s);}else l.removeChild(u);}}for(let n of e){for(let i of ["w:commentRangeStart","w:commentRangeEnd"])for(let o of S(n,i))o.parentNode?.removeChild(o);let a=S(n,"w:commentReference");for(let i of a){let o=i.parentNode;o&&((o.tagName==="w:r"||o.tagName.endsWith(":r"))&&Array.from(o.childNodes).filter(l=>l.nodeType===1&&l.tagName!=="w:rPr"&&l.tagName!=="rPr").length<=1?o.parentNode?.removeChild(o):o.removeChild(i));}}let t=this.doc.pkg,r=new Set;for(let n of t.parts)if(n.partname.toLowerCase().includes("comments")){r.add(n.partname);let a=n.partname.startsWith("/")?n.partname:"/"+n.partname,i=n.partname.startsWith("/")?n.partname.substring(1):n.partname;r.add(a),r.add(i);}if(r.size>0){for(let a of t.parts)if(a.partname.endsWith(".rels")){let i=S(a._element,"Relationship"),o=[];for(let u of i)if((u.getAttribute("Target")||"").toLowerCase().includes("comments")){o.push(u);let s=a.partname.replace("/_rels/","/").replace(".rels",""),f=t.getPartByPath(s);if(f){let c=u.getAttribute("Id");c&&f.rels.delete(c);}}for(let u of o)u.parentNode?.removeChild(u);}let n=t.getPartByPath("[Content_Types].xml");if(n){let a=S(n._element,"Override"),i=[];for(let o of a){let u=o.getAttribute("PartName")||"";(r.has(u)||u.toLowerCase().includes("comments"))&&i.push(o);}for(let o of i)o.parentNode?.removeChild(o);}t.parts=t.parts.filter(a=>!a.partname.toLowerCase().includes("comments"));for(let a of Object.keys(t.unzipped))a.toLowerCase().includes("comments")&&delete t.unzipped[a];}}_getNextId(){return this.current_id++,this.current_id.toString()}_create_track_change_tag(e,t="",r=null){let a=this.doc.part._element.ownerDocument.createElement(e),i=r!==null?r:this._getNextId();return a.setAttribute("w:id",i),a.setAttribute("w:author",t||this.author),a.setAttribute("w:date",this.timestamp),a.setAttribute("w16du:dateUtc",this.timestamp),a}_set_text_content(e,t){e.textContent=t,t.trim()!==t&&e.setAttribute("xml:space","preserve");}_attach_comment(e,t,r,n){if(!n)return;let a=this.comments_manager.addComment(this.author,n),i=e.ownerDocument,o=i.createElement("w:commentRangeStart");o.setAttribute("w:id",a);let u=i.createElement("w:commentRangeEnd");u.setAttribute("w:id",a);let l=i.createElement("w:r"),s=i.createElement("w:rPr"),f=i.createElement("w:rStyle");f.setAttribute("w:val","CommentReference"),s.appendChild(f),l.appendChild(s);let c=i.createElement("w:commentReference");c.setAttribute("w:id",a),l.appendChild(c),e.insertBefore(o,t);let d=r.nextSibling;d?(e.insertBefore(u,d),e.insertBefore(l,u.nextSibling)):(e.appendChild(u),e.appendChild(l));}_attach_comment_spanning(e,t,r,n,a){if(!a)return;let i=this.comments_manager.addComment(this.author,a),o=e.ownerDocument,u=r.ownerDocument,l=o.createElement("w:commentRangeStart");l.setAttribute("w:id",i);let s=u.createElement("w:commentRangeEnd");s.setAttribute("w:id",i);let f=u.createElement("w:r"),c=u.createElement("w:rPr"),d=u.createElement("w:rStyle");d.setAttribute("w:val","CommentReference"),c.appendChild(d),f.appendChild(c);let p=u.createElement("w:commentReference");p.setAttribute("w:id",i),f.appendChild(p),e.insertBefore(l,t);let m=n.nextSibling;m?(r.insertBefore(s,m),r.insertBefore(f,s.nextSibling)):(r.appendChild(s),r.appendChild(f));}_track_insert_multiline(e,t,r,n){if(!e)return {first_node:null,last_p:null,last_ins:null,used_block_mode:false};let a=this.doc.part._element.ownerDocument,i=e.split(/[\r\n]+/),o=null;if(r!==null)o=r._element;else if(t!==null){let E=t._element;for(;E&&E.tagName!=="w:p";)E=E.parentNode;o=E;}for(;i.length>1&&i[i.length-1]==="";)i.pop();if(i.length===0)return {first_node:null,last_p:null,last_ins:null,used_block_mode:false};let[u,l]=this._parse_markdown_style(i[0]),f=l!==null&&o!==null,c=null,d=null;f||(d=this._build_tracked_ins_for_line((u===i[0],i[0]),t,n,a),c=d);let p=f?i:i.slice(1);if(p.length===0)return {first_node:c,last_p:null,last_ins:d,used_block_mode:false};if(!o)return {first_node:c,last_p:null,last_ins:d,used_block_mode:false};let m=o.parentNode;if(!m)return {first_node:c,last_p:null,last_ins:d,used_block_mode:false};let g=h((E,_)=>{m.insertBefore(E,_.nextSibling);},"insertAfterEl"),b=null,w=null,v=o;for(let E=0;E<p.length;E++){let _=p[E],[D,y]=this._parse_markdown_style(_),N=a.createElement("w:p");if(y)this._set_paragraph_style(N,y);else {let M=O(o,"w:pPr");M&&N.appendChild(M.cloneNode(true));}let C=O(N,"w:pPr");C||(C=a.createElement("w:pPr"),N.insertBefore(C,N.firstChild));let A=O(C,"w:rPr");A||(A=a.createElement("w:rPr"),C.appendChild(A));let B=this._create_track_change_tag("w:ins","",n);A.appendChild(B);let x=this._build_tracked_ins_for_line(D,t,n,a);x&&N.appendChild(x),g(N,v),v=N,b=N,w=x,c||(c=N);}return {first_node:c,last_p:b,last_ins:w,used_block_mode:f}}_build_tracked_ins_for_line(e,t,r,n){if(!e&&e!=="")return null;let a=this._create_track_change_tag("w:ins","",r),i=this._parse_inline_markdown(e);if(i.length===0)return null;for(let[o,u]of i){let l=n.createElement("w:r");if(t&&t._element){let f=O(t._element,"w:rPr");if(f){let c=f.cloneNode(true);for(let d of ["w:vanish","w:strike","w:dstrike","w:i","w:iCs","w:b","w:bCs"]){let p=O(c,d);p&&c.removeChild(p);}l.appendChild(c);}}this._apply_run_props(l,u,false);let s=n.createElement("w:t");this._set_text_content(s,o),l.appendChild(s),a.appendChild(l);}return a}_parse_markdown_style(e){let t=e.trimStart();if(t.startsWith("#")){let n=0,a=t;for(;a.startsWith("#");)n++,a=a.substring(1);if(a.startsWith(" "))return [a.trim(),`Heading ${n}`]}if(t.startsWith("* ")||t.startsWith("- "))return [t.substring(2).trim(),"List Paragraph"];let r=t.match(/^\d+\.\s+/);return r?[t.substring(r[0].length).trim(),"List Number"]:[e,null]}_parse_inline_markdown(e,t={}){if(!e)return [];let r=/(\*\*.*?\*\*)|(_.*?_)/,n=e.match(r);if(!n)return [[e,t]];let a=n.index,i=n[0],o=a+i.length,u=i.startsWith("**"),l=u?i.substring(2,i.length-2):i.substring(1,i.length-1),s=e.substring(0,a),f=e.substring(o),c=[];s&&c.push([s,t]);let d={...t};return u?d.bold=true:d.italic=true,c.push(...this._parse_inline_markdown(l,d)),c.push(...this._parse_inline_markdown(f,t)),c}_apply_run_props(e,t,r=false){if(!t){if(!r)return;t={};}let n=O(e,"w:rPr");if(!n&&(t.bold||t.italic||r)&&(n=e.ownerDocument.createElement("w:rPr"),e.appendChild(n)),n){let a=e.ownerDocument;if(t.bold){let i=O(n,"w:b");i||(i=a.createElement("w:b"),n.appendChild(i)),i.setAttribute("w:val","1");}else if(r){let i=O(n,"w:b");i&&n.removeChild(i);}if(t.italic){let i=O(n,"w:i");i||(i=a.createElement("w:i"),n.appendChild(i)),i.setAttribute("w:val","1");}else if(r){let i=O(n,"w:i");i&&n.removeChild(i);}}}_set_paragraph_style(e,t){let r=e.ownerDocument,n=O(e,"w:pPr");n&&e.removeChild(n);let a=r.createElement("w:pPr"),i=r.createElement("w:pStyle"),o=t.replace(/\s+/g,"");i.setAttribute("w:val",o),a.appendChild(i),e.insertBefore(a,e.firstChild);}_anchor_reply_comment(e,t){let r=this.doc.part._element.ownerDocument,n=S(this.doc.element,"w:commentRangeStart").filter(g=>g.getAttribute("w:id")===e);if(n.length===0)return;let a=n[0],i=r.createElement("w:commentRangeStart");i.setAttribute("w:id",t),kt(i,a);let o=S(this.doc.element,"w:commentRangeEnd").filter(g=>g.getAttribute("w:id")===e);if(o.length===0)return;let u=o[0],l=S(this.doc.element,"w:commentReference").filter(g=>g.getAttribute("w:id")===e),s=u;if(l.length>0){let g=l[0];g.parentNode&&g.parentNode.tagName==="w:r"&&(s=g.parentNode);}let f=r.createElement("w:commentRangeEnd");f.setAttribute("w:id",t),kt(f,s);let c=r.createElement("w:r"),d=r.createElement("w:rPr"),p=r.createElement("w:rStyle");p.setAttribute("w:val","CommentReference"),d.appendChild(p),c.appendChild(d);let m=r.createElement("w:commentReference");m.setAttribute("w:id",t),c.appendChild(m),kt(c,f);}_clean_wrapping_comments(e){let t=e;for(;;){let l=kr(t);if(l&&(l.tagName==="w:ins"||l.tagName==="w:del"))t=l;else break}let r=e;for(;;){let l=at(r);if(l&&(l.tagName==="w:ins"||l.tagName==="w:del"))r=l;else break}let n=[],a=kr(t);for(;a;)if(a.tagName==="w:commentRangeStart")n.push(a),a=kr(a);else if(a.tagName==="w:rPr"||a.tagName==="w:pPr")a=kr(a);else break;let i=[],o=at(r);for(;o;)if(o.tagName==="w:commentRangeEnd")i.push(o),o=at(o);else if(o.tagName==="w:r"&&S(o,"w:commentReference").length>0)i.push(o),o=at(o);else if(o.tagName==="w:commentReference")i.push(o),o=at(o);else break;let u=new Set;for(let l of i)if(l.tagName==="w:commentRangeEnd"){let s=l.getAttribute("w:id");s&&u.add(s);}else {let s=S(l,"w:commentReference")[0];if(!s&&l.tagName==="w:commentReference"&&(s=l),s){let f=s.getAttribute("w:id");f&&u.add(f);}}for(let l of n){let s=l.getAttribute("w:id");if(s&&u.has(s)){this.comments_manager.deleteComment(s),l.parentNode&&l.parentNode.removeChild(l);for(let f of i){let c=null;if(f.tagName==="w:commentRangeEnd")c=f.getAttribute("w:id");else {let d=S(f,"w:commentReference")[0];!d&&f.tagName==="w:commentReference"&&(d=f),d&&(c=d.getAttribute("w:id"));}c===s&&f.parentNode&&f.parentNode.removeChild(f);}}}}_delete_comments_in_element(e){let t=S(e,"w:commentReference");for(let r of t){let n=r.getAttribute("w:id");if(n){this.comments_manager.deleteComment(n);for(let a of ["w:commentRangeStart","w:commentRangeEnd"]){let i=S(this.doc.element,a);for(let o of i)o.getAttribute("w:id")===n&&o.parentNode&&o.parentNode.removeChild(o);}}}}validate_edits(e){let t=[];this.mapper.full_text||this.mapper._build_map(),t.push(...el(e));for(let r=0;r<e.length;r++){let n=e[r];if(!n.target_text)continue;let a=this.mapper.find_all_match_indices(n.target_text),i=this.mapper.full_text;if(a.length===0&&(this.clean_mapper||(this.clean_mapper=new nr(this.doc,true)),a=this.clean_mapper.find_all_match_indices(n.target_text),a.length>0&&(i=this.clean_mapper.full_text)),i===this.mapper.full_text&&a.length>1){let o=a.filter(([u,l])=>{let s=this.mapper.spans.filter(f=>f.run!==null&&f.end>u&&f.start<u+l);return s.length===0?true:s.some(f=>!f.del_id)});o.length>0&&(a=o);}if(a.length===0)t.push(`- Edit ${r+1} Failed: Target text not found in document:
|
|
47
|
+
"${n.target_text}"`);else if(a.length>1){let o=a.map(([u,l])=>[u,u+l]);t.push(Ku(r+1,n.target_text,i,o));}if(a.length===1){let[o,u]=a[0],l=i.substring(o,o+u),[s,f]=bn(l,n.new_text||""),c=l.length-f,d=l.substring(s,c),p=(n.new_text||"").substring(s,(n.new_text||"").length-f);if(d.includes(`
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
## Defined Terms`);for(let[s,l]of Object.entries(r))i.push(`- "${s}" \u2014 used ${l.count} times.`);}if(n.length>0){a=true,i.push(`
|
|
51
|
-
## Semantic Diagnostics`);for(let s of n)i.push(`- ${s}`);}if(Object.keys(o).length>0){a=true,i.push(`
|
|
52
|
-
## Named Anchors`);for(let[s,l]of Object.entries(o)){i.push(`- ${s} \u2192 Anchored to: "${l.anchored_to}"`);for(let u of l.referenced_from)i.push(` - Referenced from: "${u}"`);}}return a?i.join(`
|
|
53
|
-
`):""}h(nl,"build_structural_appendix");async function st(e,t=false){let r=await nr.load(e);return il(r,t)}h(st,"extractTextFromBuffer");function il(e,t=false,r=true){let n=Mr(e.pkg),o=[],i=0;for(let s of No(e)){let l=o.length>0?i+2:i,u=xn(s,n,t,l);u&&(o.length>0&&(i+=2),o.push(u),i+=u.length);}let a=o.join(`
|
|
49
|
+
`))if(p.includes(`
|
|
54
50
|
|
|
55
|
-
`)
|
|
56
|
-
${e.note_type==="fn"?"## Footnotes":"## Endnotes"}`;s.push(d),l+=d.length,u=false;}for(let c of Cn(e)){u||(l+=2);let d=l;if(c.constructor.name==="FootnoteItem"){let p=xn(c,t,r,d);p?(s.push(p),l=d+p.length,u=false):u||(l-=2);}else if(c instanceof Ze){let p=Nn(c,i,a);f&&e.constructor.name==="FootnoteItem"&&(p=`[^${e.note_type}-${e.id}]: `+p);let g=al(c,t,r,i,a),m=p+g;s.push(m),l=d+m.length,f=false,u=false;}else if(c instanceof Dn){let p=ol(c,t,r,d);p?(s.push(p),l=d+p.length,u=false):u||(l-=2),f=false;}}return s.join(`
|
|
51
|
+
`)){let m=l.split(`
|
|
57
52
|
|
|
58
|
-
`)
|
|
59
|
-
|
|
60
|
-
`)}h(co,"_build_merged_meta_block");var ul=class{static{h(this,"SanitizeReport");}filename;mode;author;tracked_changes_found=0;tracked_changes_accepted=0;tracked_changes_kept=0;change_lines=[];comments_removed=0;comments_kept=0;removed_comment_lines=[];kept_comment_lines=[];metadata_lines=[];structural_lines=[];warnings=[];status="clean";blocked_reason=null;constructor(e,t="full",r=null){this.filename=e,this.mode=t,this.author=r;}add_transform_lines(e){for(let t of e){let r=t.toLowerCase();r.includes("tracked change")||r.includes("insertion")||r.includes("deletion")||r.includes("accepted")?this.change_lines.push(t):r.includes("comment")||r.includes("[open]")||r.includes("[resolved]")?r.includes("kept")||r.includes("visible")?this.kept_comment_lines.push(t):this.removed_comment_lines.push(t):r.includes("author")||r.includes("template")||r.includes("company")||r.includes("manager")||r.includes("metadata")||r.includes("timestamp")||r.includes("custom xml")||r.includes("last modified by")||r.includes("revision count")||r.includes("last printed")?this.metadata_lines.push(t):r.includes("hyperlink")||r.includes("warning")?this.warnings.push(t):this.structural_lines.push(t);}}render(){let e="\u2550".repeat(50),t=[e,`Finalization Report: ${this.filename}`],r=[];if(this.mode==="keep-markup"&&r.push("--keep-markup"),this.author&&r.push(`--author "${this.author}"`),this.tracked_changes_accepted>0&&r.push("--accept-all"),r.length>0&&t.push(r.join(" ")),t.push(e),this.status==="blocked")return t.push(""),t.push(`BLOCKED: ${this.blocked_reason}`),t.push(e),t.join(`
|
|
53
|
+
`);m.length>=2&&m[0].trim()!==""&&m[m.length-1].trim()!==""&&t.push(`- Edit ${r+1} Failed: target_text spans a paragraph boundary with body text on both sides. The paragraph break is a structural element, not literal text, so it cannot be replaced as a single span without corrupting the document. Split this into one edit per paragraph.`);}else {let m=d.split(`
|
|
54
|
+
|
|
55
|
+
`);m.length>=2&&m[0].trim()!==""&&m[m.length-1].trim()!==""&&t.push(`- Edit ${r+1} Failed: target_text spans a paragraph boundary with body text on both sides. The paragraph break is a structural element, not literal text, so it cannot be replaced as a single span without corrupting the document. Split this into one edit per paragraph.`);}}for(let[o,u]of a){let l=this.mapper.spans.filter(f=>f.end>o&&f.start<o+u),s=new Set;for(let f of l)if(f.ins_id){let c=S(this.doc.element,"w:ins").filter(d=>d.getAttribute("w:id")===f.ins_id);if(c.length>0){let d=c[0].getAttribute("w:author");d&&d!==this.author&&s.add(d);}}s.size>0&&t.push(`- Edit ${r+1} Failed: Modification targets an active insertion from another author (${Array.from(s).join(", ")}). Accept that change first or scope your edit outside of it.`);}}return t}validate_review_actions(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],a=n.type;if(a==="reply"){let i=n.target_id.replace("Com:",""),o=false,u=this.doc.pkg.parts.find(l=>l.contentType==="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml");u&&(o=S(u._element,"w:comment").some(s=>s.getAttribute("w:id")===i)),o||t.push(`- Action ${r+1} Failed: Target comment ID ${n.target_id} not found.`);}else if(a==="accept"||a==="reject"){let i=n.target_id.replace("Chg:",""),o=S(this.doc.element,"w:ins").filter(l=>l.getAttribute("w:id")===i),u=S(this.doc.element,"w:del").filter(l=>l.getAttribute("w:id")===i);o.length===0&&u.length===0&&t.push(`- Action ${r+1} Failed: Target ID ${n.target_id} not found.`);}}return t}process_batch(e,t=false){if(t){let r=new Map;for(let n of this.doc.pkg.parts)n._element&&r.set(n,n._element.cloneNode(true));try{return this._process_batch_internal(e,!0)}finally{for(let[n,a]of r.entries()){let i=n._element.ownerDocument;i&&i.documentElement&&i.replaceChild(a,i.documentElement),n._element=a;}this.mapper=new nr(this.doc),this.comments_manager=new ir(this.doc),this.clean_mapper=null;}}else return this._process_batch_internal(e,false)}_process_batch_internal(e,t=false){this.skipped_details=[];let r=e.filter(s=>["accept","reject","reply"].includes(s.type)),n=e.filter(s=>!["accept","reject","reply"].includes(s.type));if(t){if(r.length>0){let s=this.validate_review_actions(r);if(s.length>0)throw new Pr(s)}}else {let s=[];if(r.length>0&&s.push(...this.validate_review_actions(r)),n.length>0&&s.push(...this.validate_edits(n)),s.length>0)throw new Pr(s)}let a=0,i=0;if(r.length>0){let s=this.apply_review_actions(r);if(a=s[0],i=s[1],i>0)throw new Pr(this.skipped_details);a>0&&(this.mapper._build_map(),this.clean_mapper&&this.clean_mapper._build_map());}let o=[],u=0,l=0;if(n.length>0)if(t)for(let s of n){let f=this.validate_edits([s]),c=this._check_punctuation_warning(s.target_text||"");if(f.length>0){l++,o.push({status:"failed",target_text:s.target_text||"",new_text:s.new_text||"",warning:c,error:f[0],critic_markup:null,clean_text:null});continue}if(this.apply_edits([s])[0]>0){u++;let m=this._build_edit_context_previews(s);o.push({status:"applied",target_text:s.target_text||"",new_text:s.new_text||"",warning:c,error:null,critic_markup:m[0],clean_text:m[1]});}else {l++;let m=this.skipped_details.length>0?this.skipped_details[this.skipped_details.length-1]:"Failed to apply edit";o.push({status:"failed",target_text:s.target_text||"",new_text:s.new_text||"",warning:c,error:m,critic_markup:null,clean_text:null});}}else {let s=this.validate_edits(n);if(s.length>0)throw new Pr(s);let f=n.map(d=>JSON.parse(JSON.stringify(d))),c=this.apply_edits(f);u=c[0],l=c[1];for(let d of f){let p=d._applied_status||false,m=d._error_msg||null,g=this._check_punctuation_warning(d.target_text||""),b=null,w=null;if(p){let v=this._build_edit_context_previews(d);b=v[0],w=v[1];}o.push({status:p?"applied":"failed",target_text:d.target_text||"",new_text:d.new_text||"",warning:g,error:m,critic_markup:b,clean_text:w});}}return {actions_applied:a,actions_skipped:i,edits_applied:u,edits_skipped:l,skipped_details:this.skipped_details,edits:o,engine:"node",version:"1.9.0"}}apply_edits(e){let t=0,r=0,n=[];for(let i of e)i._applied_status=false,i._error_msg=null;for(let i of e)if(i._resolved_start_idx!==void 0&&i._resolved_start_idx!==null)n.push([i,i.new_text||null]);else if(i._match_start_index!==void 0&&i._match_start_index!==null)i._resolved_start_idx=i._match_start_index,n.push([i,i.new_text||null]);else if(i.type==="insert_row"||i.type==="delete_row"){let o=this.mapper.find_all_match_indices(i.target_text);if(o.length===0&&(this.clean_mapper||(this.clean_mapper=new nr(this.doc,true)),o=this.clean_mapper.find_all_match_indices(i.target_text)),o.length>0)i._resolved_start_idx=o[0][0],n.push([i,null]);else {r++,i._applied_status=false;let l=`- Failed to locate row target: '${(i.target_text||"").trim().substring(0,40)}...'`;this.skipped_details.push(l),i._error_msg=l;}}else {let o=this._pre_resolve_heuristic_edit(i);if(o)if(Array.isArray(o))for(let u of o)u._resolved_start_idx=u._match_start_index,u._parent_edit_ref=i,(i._resolved_start_idx===void 0||i._resolved_start_idx===null)&&(i._resolved_start_idx=u._resolved_start_idx),i._resolved_proxy_edit||(i._resolved_proxy_edit=u),n.push([u,u.new_text]);else o._resolved_start_idx=o._match_start_index,o._parent_edit_ref=i,i._resolved_start_idx=o._resolved_start_idx,i._resolved_proxy_edit=o,n.push([o,o.new_text]);else {r++,i._applied_status=false;let s=`- Failed to apply edit targeting: '${(i.target_text||"insertion").trim().substring(0,40)}...'`;this.skipped_details.push(s),i._error_msg=s;}}n.sort((i,o)=>(o[0]._resolved_start_idx||0)-(i[0]._resolved_start_idx||0));let a=[];for(let[i,o]of n){let u=i._resolved_start_idx||0,l=u+(i.target_text?i.target_text.length:0);if(a.some(([c,d])=>u<d&&l>c)){r++;let p=`- Skipped overlapping edit targeting: '${(i.target_text||"insertion").trim().substring(0,40)}...'`;this.skipped_details.push(p),i._applied_status=false,i._error_msg=p;let m=i._parent_edit_ref;m&&(m._applied_status=false,m._error_msg=p);continue}let f=false;if(i.type==="modify"?f=this._apply_single_edit_indexed(i,o,false):(i.type==="insert_row"||i.type==="delete_row")&&(f=this._apply_table_edit(i,false)),f){t++,a.push([u,l]),i._applied_status=true;let c=i._parent_edit_ref;c&&(c._applied_status=true);}else {r++;let p=`- Failed to apply edit targeting: '${(i.target_text||"insertion").trim().substring(0,40)}...'`;this.skipped_details.push(p),i._applied_status=false,i._error_msg=p;let m=i._parent_edit_ref;m&&(m._applied_status||(m._applied_status=false,m._error_msg=p));}}return [t,r]}apply_review_actions(e){let t=0,r=0;for(let n of e){let a=n.type;if(a==="reply"){let s=n.target_id.replace("Com:",""),f=this.comments_manager.addComment(this.author,n.text,s);this._anchor_reply_comment(s,f),t++;continue}let i=n.target_id.replace("Chg:",""),o=S(this.doc.element,"w:ins").filter(s=>s.getAttribute("w:id")===i),u=S(this.doc.element,"w:del").filter(s=>s.getAttribute("w:id")===i),l=[...o,...u];if(l.length===0){r++,this.skipped_details.push(`- Failed to apply action: Target ID ${n.target_id} not found.`);continue}for(let s of l){let f=s.tagName==="w:ins",d=(s.parentNode?s.parentNode.tagName:"")==="w:trPr";if(a==="accept")if(f)if(this._clean_wrapping_comments(s),d)s.parentNode?.removeChild(s);else {for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.parentNode?.removeChild(s);}else if(this._clean_wrapping_comments(s),this._delete_comments_in_element(s),d){let p=s.parentNode?.parentNode;p?.parentNode?.removeChild(p);}else s.parentNode?.removeChild(s);else if(a==="reject")if(f)if(this._clean_wrapping_comments(s),this._delete_comments_in_element(s),d){let p=s.parentNode?.parentNode;p?.parentNode?.removeChild(p);}else s.parentNode?.removeChild(s);else if(this._clean_wrapping_comments(s),d)s.parentNode?.removeChild(s);else {let p=Array.from(s.getElementsByTagName("w:delText"));for(let m of p){let g=m.ownerDocument.createElement("w:t");g.textContent=m.textContent,m.hasAttribute("xml:space")&&g.setAttribute("xml:space","preserve"),m.parentNode?.replaceChild(g,m);}for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.parentNode?.removeChild(s);}}t++;}return [t,r]}_apply_table_edit(e,t){let r=e._resolved_start_idx!==void 0&&e._resolved_start_idx!==null?e._resolved_start_idx:e._match_start_index||0,[n,a]=this.mapper.get_insertion_anchor(r,t),i=null;if(n?i=n._element:a&&(i=a._element),!i)return false;let o=i;for(;o&&o.tagName!=="w:tr";)o=o.parentNode;if(!o)return false;if(e.type==="delete_row"){let u=O(o,"w:trPr");return u||(u=o.ownerDocument.createElement("w:trPr"),o.insertBefore(u,o.firstChild)),u.appendChild(this._create_track_change_tag("w:del")),true}else if(e.type==="insert_row"){let u=o.ownerDocument.createElement("w:tr"),l=o.ownerDocument.createElement("w:trPr");u.appendChild(l),l.appendChild(this._create_track_change_tag("w:ins"));for(let s of e.cells){let f=o.ownerDocument.createElement("w:tc"),c=o.ownerDocument.createElement("w:p"),d=o.ownerDocument.createElement("w:r"),p=o.ownerDocument.createElement("w:t");p.textContent=s,s.trim()!==s&&p.setAttribute("xml:space","preserve"),d.appendChild(p),c.appendChild(d),f.appendChild(c),u.appendChild(f);}return e.position==="above"?o.parentNode?.insertBefore(u,o):kt(u,o),true}return false}_first_live_match(e){let t=this.mapper.find_all_match_indices(e);if(t.length<=1)return this.mapper.find_match_index(e);for(let[r,n]of t){let a=this.mapper.spans.filter(i=>i.run!==null&&i.end>r&&i.start<r+n);if(a.length===0)return [r,n];if(a.some(i=>!i.del_id))return [r,n]}return this.mapper.find_match_index(e)}_pre_resolve_heuristic_edit(e){if(!e.target_text)return null;let[t,r]=this._first_live_match(e.target_text),n=false;if(t===-1)if(this.clean_mapper||(this.clean_mapper=new nr(this.doc,true)),[t,r]=this.clean_mapper.find_match_index(e.target_text),t!==-1)n=true;else return null;let a=n?this.clean_mapper:this.mapper,i=e.new_text||"",o=this.mapper.full_text.substring(t,t+r);if(o===i||e.target_text===i)return {type:"modify",target_text:o,new_text:o,comment:e.comment,_match_start_index:t,_internal_op:"COMMENT_ONLY",_active_mapper_ref:a};let u="",l="",s="",f=t;if(i.startsWith(o))u="INSERTION",s=i.substring(o.length),f=t+r;else {let[c,d]=bn(o,i),p=o.length-d,m=i.length-d;l=o.substring(c,p),s=i.substring(c,m),f=t+c,!l&&s?u="INSERTION":l&&!s?u="DELETION":l&&s?u="MODIFICATION":u="COMMENT_ONLY";}return {type:"modify",target_text:l,new_text:s,comment:e.comment,_match_start_index:f,_internal_op:u,_active_mapper_ref:a}}_apply_single_edit_indexed(e,t,r){let n=e._internal_op,a=e._active_mapper_ref||this.mapper,i=e._resolved_start_idx!==void 0&&e._resolved_start_idx!==null?e._resolved_start_idx:e._match_start_index||0,o=e.target_text?e.target_text.length:0,u=["DELETION","MODIFICATION"].includes(n)?this._getNextId():null,l=["INSERTION","MODIFICATION"].includes(n)?this._getNextId():null;if(n==="COMMENT_ONLY"){let w=a.find_target_runs_by_index(i,o,r);if(w.length===0)return false;if(!e.comment)return true;let v=w[0]._element,E=w[w.length-1]._element,_=v;for(;_&&_.tagName!=="w:p";)_=_.parentNode;let D=E;for(;D&&D.tagName!=="w:p";)D=D.parentNode;if(!_||!D)return false;let y=h((A,B)=>{let x=A;for(;x.parentNode&&x.parentNode!==B;)x=x.parentNode;return x},"ascend_to_paragraph_child"),N=y(v,_),C=y(E,D);return _===D?this._attach_comment(_,N,C,e.comment):this._attach_comment_spanning(_,N,D,C,e.comment),true}if(n==="INSERTION"){let[w,v]=a.get_insertion_anchor(i,r);if(!w&&!v)return false;let E=e.new_text||"",_=/\n\s*$/.test(E),D=null;{let C=a.spans.filter(A=>A.paragraph!==null&&A.start===i);C.length>0&&C[0].paragraph&&(D=C[0].paragraph._element);}if(_&&D&&D.parentNode){let C=D.parentNode,A=this.doc.part._element.ownerDocument,B=E.split(/[\r\n]+/).filter(P=>P!==""),x=null,M=null,z=null;for(let P of B){let[G,$]=this._parse_markdown_style(P),R=A.createElement("w:p");if($)this._set_paragraph_style(R,$);else {let K=O(D,"w:pPr");K&&R.appendChild(K.cloneNode(true));}let j=O(R,"w:pPr");j||(j=A.createElement("w:pPr"),R.insertBefore(j,R.firstChild));let I=O(j,"w:rPr");I||(I=A.createElement("w:rPr"),j.appendChild(I)),I.appendChild(this._create_track_change_tag("w:ins","",l));let Q=this._build_tracked_ins_for_line(G,w,l,A);Q&&R.appendChild(Q),C.insertBefore(R,D),x||(x=R),M=R,z=Q;}if(x){if(e.comment&&M&&z){let P=h(($,R)=>{let j=$;for(;j.parentNode&&j.parentNode!==R;)j=j.parentNode;return j},"ascend"),G=S(x,"w:ins")[0]||x;this._attach_comment_spanning(x,P(G,x),M,P(z,M),e.comment);}return true}}let y=this._track_insert_multiline(e.new_text||"",w,v,l);if(!y.first_node)return false;if(y.first_node.tagName==="w:ins"&&(w?kt(y.first_node,w._element):v&&v._element.appendChild(y.first_node)),e.comment){let C=h((A,B)=>{let x=A;for(;x.parentNode&&x.parentNode!==B;)x=x.parentNode;return x},"ascend_to_paragraph_child");if(y.last_p&&y.last_ins){let A=y.first_node;for(;A&&A.tagName!=="w:p";)A=A.parentNode;if(A){let B=y.first_node;y.first_node.tagName==="w:p"&&(B=S(y.first_node,"w:ins")[0]||y.first_node);let x=C(B,A),M=C(y.last_ins,y.last_p);this._attach_comment_spanning(A,x,y.last_p,M,e.comment);}}else {let A=y.first_node;for(;A&&A.tagName!=="w:p";)A=A.parentNode;if(A){let B=y.first_node;y.first_node.tagName==="w:p"&&(B=S(y.first_node,"w:ins")[0]||y.first_node);let x=C(B,A);this._attach_comment(A,x,x,e.comment);}}}return true}let s=a.find_target_runs_by_index(i,o,r),f=a.get_virtual_spans_in_range(i,o);if(s.length===0&&f.length===0)return false;let c=new Set;for(let w of s){let v=w._element.parentNode;for(;v&&v.tagName!=="w:p";)v=v.parentNode;v&&c.add(v);}let d=null,p=null;for(let w of s){let v=this._create_track_change_tag("w:del","",u),E=w._element.cloneNode(true);Array.from(E.getElementsByTagName("w:t")).forEach(D=>{let y=E.ownerDocument.createElement("w:delText");y.textContent=D.textContent,D.hasAttribute("xml:space")&&y.setAttribute("xml:space","preserve"),E.replaceChild(y,D);}),v.appendChild(E),w._element.parentNode?.replaceChild(v,w._element),d===null&&(d=v),p=v;}let m=null,g=null,b=null;if(n==="MODIFICATION"&&e.new_text&&p){let w=p;for(;w&&w.tagName!=="w:p";)w=w.parentNode;let v=w?new Ze(w,null):null,E=s.length>0?s[s.length-1]:null,_=this._track_insert_multiline(e.new_text,E,v,l);_.first_node&&(_.first_node.tagName==="w:ins"?(kt(_.first_node,p),m=_.first_node):m=_.last_ins,g=_.last_p,b=_.last_ins);}if(n==="DELETION"||n==="MODIFICATION"){if(n==="MODIFICATION"&&s.length===0&&f.length>0&&e.new_text){let w=f[0];if(w.paragraph){let v=w.paragraph._element,E=S(v,"w:r"),_=E.length>0?new Ke(E[E.length-1],w.paragraph):null,D=this._track_insert_multiline(e.new_text,_,w.paragraph,l);D.first_node&&v.appendChild(D.first_node);}}for(let w of [...f].reverse())if(w.paragraph){let v=w.paragraph._element,E=at(v);for(;E&&E.tagName!=="w:p";)E=at(E);if(E&&E.tagName==="w:p"){let _=O(v,"w:pPr");_||(_=v.ownerDocument.createElement("w:pPr"),v.insertBefore(_,v.firstChild));let D=O(_,"w:rPr");D||(D=v.ownerDocument.createElement("w:rPr"),_.appendChild(D));let y=this._create_track_change_tag("w:del");D.appendChild(y);let N=Array.from(E.childNodes);for(let C of N)C.nodeType===1&&C.tagName==="w:pPr"||v.appendChild(C);E.parentNode&&E.parentNode.removeChild(E);}}}if(e.comment&&d!==null){let w,v;if(g&&b)w=b,v=g;else {let N=m!==null?m:p;for(w=N,v=N;v&&v.tagName!=="w:p";)v=v.parentNode;}let E=d;for(;E&&E.tagName!=="w:p";)E=E.parentNode;if(!E||!v)return true;let _=h((N,C)=>{let A=N;for(;A.parentNode&&A.parentNode!==C;)A=A.parentNode;return A},"ascend_to_paragraph_child"),D=_(d,E),y=_(w,v);E===v?this._attach_comment(E,D,y,e.comment):this._attach_comment_spanning(E,D,v,y,e.comment);}for(let w of c){let v=false;for(let E of ["w:t","w:tab","w:br"]){let _=S(w,E);for(let D of _){let y=false,N=D.parentNode;for(;N&&N!==w.parentNode;){if(N.tagName==="w:del"){y=true;break}N=N.parentNode;}if(!y){if(E==="w:t"&&!D.textContent)continue;v=true;break}}if(v)break}if(!v){let E=O(w,"w:pPr");E||(E=w.ownerDocument.createElement("w:pPr"),w.insertBefore(E,w.firstChild));let _=O(E,"w:rPr");if(_||(_=w.ownerDocument.createElement("w:rPr"),E.appendChild(_)),!O(_,"w:del")){let D=this._create_track_change_tag("w:del");_.appendChild(D);}}}return true}};function tl(e,t,r=2){if(e===t)return 0;if(Math.abs(e.length-t.length)>r)return r+1;if(e.length===0)return t.length<=r?t.length:r+1;if(t.length===0)return e.length<=r?e.length:r+1;if(e.length>t.length){let a=e;e=t,t=a;}let n=Array.from({length:e.length+1},(a,i)=>i);for(let a=1;a<=t.length;a++){let i=[a],o=a;for(let u=1;u<=e.length;u++){let l=e[u-1]===t[a-1]?0:1,s=Math.min(n[u]+1,i[u-1]+1,n[u-1]+l);i.push(s),s<o&&(o=s);}if(o>r)return r+1;n=i;}return n[e.length]<=r?n[e.length]:r+1}h(tl,"boundedLevenshtein");function rl(e){let t="",r=S(e._element,"w:r");for(let n of r)t+=ot(new Ke(n,e));return t}h(rl,"_get_paragraph_text");function nl(e,t){let r={},n=new Set,a={},i=[],o=/^(?:[\d.\-()a-zA-Z]+\s*)?["“]([A-Z][A-Za-z0-9\s\-&'’]{1,60})["”]/,u=/\([^)]*?["“]([A-Z][A-Za-z0-9\s\-&'’]{1,60})["”][^)]*?\)/g;for(let w of xn(e)){if(!(w instanceof Ze))continue;let v=rl(w).trim();if(!v)continue;let E=[],_=v.match(o);_&&E.push(_[1].trim());let D=v.matchAll(u);for(let C of D)E.push(C[1].trim());for(let C of E)r[C]?n.add(C):r[C]={count:0};let y=v.length>60?v.substring(0,60)+"...":v,N=S(w._element,"*");for(let C of N){if(C.tagName==="w:bookmarkStart"){let B=C.getAttribute("w:name");B&&(!B.startsWith("_")||B.startsWith("_Ref"))&&(a[B]||(a[B]={anchored_to:y,referenced_from:[]}));}let A=null;if(C.tagName==="w:fldSimple"){let x=(C.getAttribute("w:instr")||"").trim().split(/\s+/);x.length>1&&x[0]==="REF"&&(A=x[1]);}else if(C.tagName==="w:instrText"){let x=(C.textContent||"").trim().split(/\s+/);x.length>1&&x[0]==="REF"&&(A=x[1]);}A&&i.push([A,y]);}}for(let[w,v]of i)a[w]&&a[w].referenced_from.push(v);let l=[],s=Object.keys(r);if(s.length>0){let w=s.sort((D,y)=>y.length-D.length),v=h(D=>D.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"escapeRegExp"),E=w.map(v).join("|"),_=new RegExp(`(?<!["\u201C])\\b(${E})\\b(?![\u201D"])`,"g");for(let D of t.matchAll(_)){let y=D[1];r[y]&&r[y].count++;}for(let D of s)r[D].count===0&&(delete r[D],n.delete(D));}for(let w of n)l.push(`[Error] Duplicate Definition: '${w}' is defined multiple times.`);let f=new Set(["The","This","That","Such","A","An","Any","All","Some","No","Every","Each","As","In","Of","For","To","On","By","With"]),c=/\b[A-Z][a-zA-Z]*(?:\s+[A-Z][a-zA-Z]*)*\b/g,d=new Set(t.match(c)||[]),p=new Set(Object.keys(r)),m={};for(let w of p){let v=w[0].toLowerCase();m[v]||(m[v]=[]),m[v].push(w);}let g={};for(let w of d){let v=w.trim(),E=v.split(/\s+/);for(;E.length>0;){let y=E[0],N=y.charAt(0).toUpperCase()+y.slice(1).toLowerCase();if(f.has(N))E.shift();else break}if(v=E.join(" "),v.length<4||p.has(v))continue;let _=v[0].toLowerCase(),D=m[_]||[];if(v.length>5)for(let[y,N]of Object.entries(m))y!==_&&(D=D.concat(N));for(let y of D){if(Math.abs(v.length-y.length)>2||v===y+"s"||v===y+"es"||y===v+"s"||y===v+"es")continue;let N=tl(v,y,2);N===0||N>2||y.length<=5&&(N>1||v[0].toLowerCase()!==y[0].toLowerCase())||(g[y]||(g[y]=[]),g[y].includes(v)||g[y].push(v));}}for(let[w,v]of Object.entries(g)){v.sort();let E=v.map(_=>`'${_}'`).join(", ");l.push(`[Info] Possible Typos for '${w}': Found ${E}`);}function b(w){return w.startsWith("[Error]")?0:w.startsWith("[Warning]")?1:2}return h(b,"diag_sort_key"),l.sort((w,v)=>{let E=b(w),_=b(v);return E!==_?E-_:w.localeCompare(v)}),[r,l,a]}h(nl,"extract_all_domain_metadata");function il(e,t){let[r,n,a]=nl(e,t),i=[`
|
|
56
|
+
|
|
57
|
+
---`,"","<!-- READONLY_BOUNDARY_START -->","# Document Structure (Read-Only)","The content below is metadata describing the document's reference structure. Do not include this section in any tracked changes or edits \u2014 it is for your context only and will be discarded on write."],o=false;if(Object.keys(r).length>0){o=true,i.push(`
|
|
58
|
+
## Defined Terms`);for(let[u,l]of Object.entries(r))i.push(`- "${u}" \u2014 used ${l.count} times.`);}if(n.length>0){o=true,i.push(`
|
|
59
|
+
## Semantic Diagnostics`);for(let u of n)i.push(`- ${u}`);}if(Object.keys(a).length>0){o=true,i.push(`
|
|
60
|
+
## Named Anchors`);for(let[u,l]of Object.entries(a)){i.push(`- ${u} \u2192 Anchored to: "${l.anchored_to}"`);for(let s of l.referenced_from)i.push(` - Referenced from: "${s}"`);}}return o?i.join(`
|
|
61
|
+
`):""}h(il,"build_structural_appendix");async function st(e,t=false){let r=await ar.load(e);return al(r,t)}h(st,"extractTextFromBuffer");function al(e,t=false,r=true){let n=Br(e.pkg),a=[],i=0;for(let u of Ta(e)){let l=a.length>0?i+2:i,s=In(u,n,t,l);s&&(a.length>0&&(i+=2),a.push(s),i+=s.length);}let o=a.join(`
|
|
62
|
+
|
|
63
|
+
`);if(r){let u=il(e,o);u&&(o+=u);}return o}h(al,"_extractTextFromDoc");function In(e,t,r,n){let a=e.part||e,[i,o]=Fr(a),u=[],l=n,s=true,f=true;if(e.constructor&&e.constructor.name==="NotesPart"){let d=`---
|
|
64
|
+
${e.note_type==="fn"?"## Footnotes":"## Endnotes"}`;u.push(d),l+=d.length,s=false;}for(let c of xn(e)){s||(l+=2);let d=l;if(c.constructor.name==="FootnoteItem"){let p=In(c,t,r,d);p?(u.push(p),l=d+p.length,s=false):s||(l-=2);}else if(c instanceof Ze){let p=Tn(c,i,o);f&&e.constructor.name==="FootnoteItem"&&(p=`[^${e.note_type}-${e.id}]: `+p);let m=sl(c,t,r,i,o),g=p+m;u.push(g),l=d+g.length,f=false,s=false;}else if(c instanceof An){let p=ol(c,t,r,d);p?(u.push(p),l=d+p.length,s=false):s||(l-=2),f=false;}}return u.join(`
|
|
65
|
+
|
|
66
|
+
`)}h(In,"_extract_blocks");function ol(e,t,r,n){let a=[],i=0,o=n;for(let u of e.rows){let l=[],s=new Set,f=O(u._element,"w:trPr"),c=f?O(f,"w:ins"):null,d=f?O(f,"w:del"):null;if(r&&d)continue;let p=o+(i>0?1:0),g=p+(!r&&c||!r&&d?4:0),b=true;for(let v of u.cells){if(s.has(v))continue;s.add(v),b||(g+=3);let E=In(v,t,r,g);l.push(E),g+=E.length,b=false;}let w=l.join(" | ");r||(c?w=`{++ ${w} |Chg:${c.getAttribute("w:id")}++}`:d&&(w=`{-- ${w} |Chg:${d.getAttribute("w:id")}--}`)),a.push(w),o=p+w.length,i++;}return a.join(`
|
|
67
|
+
`)}h(ol,"extract_table");function sl(e,t,r,n,a){let i=[],o={},u={},l=new Set,s={},f=[],c="",d=["",""],p=["",""],m=Array.from(Sa(e)),g=Na(e,n,a),b=Cn(e,n,a),w=g;for(let v=0;v<m.length;v++){let E=m[v];if(E instanceof Ke){let[_,D]=Ca(E,b),y=ot(E);if(r&&Object.keys(u).length>0)continue;if(w){if(!y||!y.trim())continue;w=false;}let N=Xu(y,_,D);if(N){let C=r?["",""]:ul(o,u,l,s),A=[_,D];if(c&&C[0]===d[0]&&C[1]===d[1]?(A[0]===p[0]&&A[1]===p[1]&&p[0]!==""&&c.endsWith(p[1])&&N.startsWith(A[0])?c=c.slice(0,-p[1].length)+N.slice(A[0].length):c+=N,p=A):(c&&i.push(`${d[0]}${c}${d[1]}`),c=N,d=C,p=A),!r){(Object.keys(o).length>0||Object.keys(u).length>0||l.size>0||Object.keys(s).length>0)&&f.push([{...o},{...u},new Set(l),{...s}]);let x=false;if(Object.keys(o).length>0||Object.keys(u).length>0||Object.keys(s).length>0){let z=v+1,P=false,G=Object.keys(o).length,$=Object.keys(u).length,R=Object.keys(s).length;for(;z<m.length;){let j=m[z];if(j instanceof Ke){if(!ot(j)){z++;continue}(G>0||$>0||R>0)&&(P=true);break}else {let I=j;I.type==="ins_start"?G++:I.type==="ins_end"?G=Math.max(0,G-1):I.type==="del_start"?$++:I.type==="del_end"?$=Math.max(0,$-1):I.type==="fmt_start"?R++:I.type==="fmt_end"&&(R=Math.max(0,R-1));}z++;}P&&(x=true);}if(!x&&f.length>0){let z=da(f,t);z&&(c&&(i.push(`${d[0]}${c}${d[1]}`),c="",d=["",""],p=["",""]),i.push(`{>>${z}<<}`)),f.length=0;}}}}else {let _=E;w=false,["ins_start","ins_end","del_start","del_end","fmt_start","fmt_end"].includes(_.type)||c&&(i.push(`${d[0]}${c}${d[1]}`),c="",d=["",""],p=["",""]),_.type==="start"?l.add(_.id):_.type==="end"?l.delete(_.id):_.type==="ins_start"?o[_.id]=_:_.type==="ins_end"?delete o[_.id]:_.type==="del_start"?u[_.id]=_:_.type==="del_end"?delete u[_.id]:_.type==="fmt_start"?s[_.id]=_:_.type==="fmt_end"?delete s[_.id]:_.type==="footnote"||_.type==="endnote"?(c&&(i.push(`${d[0]}${c}${d[1]}`),c="",d=["",""],p=["",""]),i.push(`[^${_.type==="footnote"?"fn":"en"}-${_.id}]`)):_.type==="hyperlink_start"?(c&&(i.push(`${d[0]}${c}${d[1]}`),c="",d=["",""],p=["",""]),i.push("[")):_.type==="hyperlink_end"?(c&&(i.push(`${d[0]}${c}${d[1]}`),c="",d=["",""],p=["",""]),i.push(`](${_.date})`)):_.type==="xref_start"?(c&&(i.push(`${d[0]}${c}${d[1]}`),c="",d=["",""],p=["",""]),i.push("[~")):_.type==="xref_end"?(c&&(i.push(`${d[0]}${c}${d[1]}`),c="",d=["",""],p=["",""]),i.push(`~](#${_.id})`)):_.type==="bookmark"&&(c&&(i.push(`${d[0]}${c}${d[1]}`),c="",d=["",""],p=["",""]),i.push(`{#${_.id}}`));}}if(c&&i.push(`${d[0]}${c}${d[1]}`),f.length>0){let v=da(f,t);v&&i.push(`{>>${v}<<}`);}return i.join("")}h(sl,"build_paragraph_text");function ul(e,t,r,n){return Object.keys(t).length>0?["{--","--}"]:Object.keys(e).length>0?["{++","++}"]:r.size>0||Object.keys(n).length>0?["{==","==}"]:["",""]}h(ul,"_get_wrappers");function da(e,t){let r=[],n=[],a=new Set;for(let[o,u,l,s]of e){let f=h(function(p){if(!t[p])return;let m=`Com:${p}`;if(a.has(m))return;let g=t[p],b=`[${m}] ${g.author}`;if(g.date&&(b+=` @ ${g.date}`),g.resolved&&(b+="(RESOLVED)"),n.push(`${b}: ${g.text}`),a.add(m),c[p]){let w=c[p].sort((v,E)=>(t[v]?.date||"").localeCompare(t[E]?.date||""));for(let v of w)f(v);}},"render_comment2");for(let[p,m]of Object.entries(o)){let g=`Chg:${p}`;a.has(g)||(r.push(`[${g} insert] ${m.author||"Unknown"}`),a.add(g));}for(let[p,m]of Object.entries(u)){let g=`Chg:${p}`;a.has(g)||(r.push(`[${g} delete] ${m.author||"Unknown"}`),a.add(g));}for(let[p,m]of Object.entries(s)){let g=`Chg:${p}`;a.has(g)||(r.push(`[${g} format] ${m.author||"Unknown"}`),a.add(g));}let c={};for(let[p,m]of Object.entries(t)){let g=m.parent_id;g&&(c[g]||(c[g]=[]),c[g].push(p));}let d=Array.from(l).sort();for(let p of d)f(p);}return [...r,...n].join(`
|
|
68
|
+
`)}h(da,"_build_merged_meta_block");var ll=class{static{h(this,"SanitizeReport");}filename;mode;author;tracked_changes_found=0;tracked_changes_accepted=0;tracked_changes_kept=0;change_lines=[];comments_removed=0;comments_kept=0;removed_comment_lines=[];kept_comment_lines=[];metadata_lines=[];structural_lines=[];warnings=[];status="clean";blocked_reason=null;constructor(e,t="full",r=null){this.filename=e,this.mode=t,this.author=r;}add_transform_lines(e){for(let t of e){let r=t.toLowerCase();r.includes("tracked change")||r.includes("insertion")||r.includes("deletion")||r.includes("accepted")?this.change_lines.push(t):r.includes("comment")||r.includes("[open]")||r.includes("[resolved]")?r.includes("kept")||r.includes("visible")?this.kept_comment_lines.push(t):this.removed_comment_lines.push(t):r.includes("author")||r.includes("template")||r.includes("company")||r.includes("manager")||r.includes("metadata")||r.includes("timestamp")||r.includes("custom xml")||r.includes("last modified by")||r.includes("revision count")||r.includes("last printed")?this.metadata_lines.push(t):r.includes("hyperlink")||r.includes("warning")?this.warnings.push(t):this.structural_lines.push(t);}}render(){let e="\u2550".repeat(50),t=[e,`Finalization Report: ${this.filename}`],r=[];if(this.mode==="keep-markup"&&r.push("--keep-markup"),this.author&&r.push(`--author "${this.author}"`),this.tracked_changes_accepted>0&&r.push("--accept-all"),r.length>0&&t.push(r.join(" ")),t.push(e),this.status==="blocked")return t.push(""),t.push(`BLOCKED: ${this.blocked_reason}`),t.push(e),t.join(`
|
|
61
69
|
`);if(this.mode==="keep-markup"&&(this.tracked_changes_kept>0||this.comments_kept>0)){if(t.push(""),t.push("VISIBLE TO COUNTERPARTY"),this.tracked_changes_kept>0&&t.push(` Tracked changes: ${this.tracked_changes_kept}`),this.comments_kept>0){t.push(` Open comments: ${this.comments_kept}`);for(let n of this.kept_comment_lines)t.push(` ${n}`);}this.author&&t.push(` Author on all markup: "${this.author}"`);}if(this.change_lines.length>0){t.push(""),t.push("TRACKED CHANGES");for(let n of this.change_lines)t.push(` ${n}`);}if(this.removed_comment_lines.length>0){t.push(""),t.push("COMMENTS (stripped)");for(let n of this.removed_comment_lines)t.push(` ${n}`);}if(this.metadata_lines.length>0){t.push(""),t.push("METADATA");for(let n of this.metadata_lines)t.push(` ${n}`);}if(this.structural_lines.length>0){t.push(""),t.push("STRUCTURAL & PROTECTION");for(let n of this.structural_lines)t.push(` ${n}`);}if(this.warnings.length>0){t.push(""),t.push("WARNINGS");for(let n of this.warnings)t.push(` \u26A0 ${n}`);}return t.push(""),t.push(e),this.warnings.length>0?t.push(`Result: CLEAN WITH WARNINGS (${this.warnings.length} warning${this.warnings.length>1?"s":""})`):t.push(`Result: CLEAN (${this.tracked_changes_found} changes resolved, ${this.comments_removed} comments removed)`),t.push(e),t.join(`
|
|
62
|
-
`)}};function Je(e,t){let r=[],n=e.getElementsByTagName("*");for(let o=0;o<n.length;o++){let i=n[o].tagName;(i===t||i.endsWith(":"+t))&&r.push(n[o]);}return r}h(Je,"findDescendantsByLocalName");function ll(e){let t=0;function r(a,s){let l=a?a.toString():"",u=s?s.toString():"";return l===u}h(r,"areRunsIdentical");function n(a){let s=["w:t","w:tab","w:br","w:cr","w:delText","w:rPr"];for(let l=0;l<a.childNodes.length;l++){let u=a.childNodes[l];if(u.nodeType===1){let f=u.tagName;if(!s.includes(f))return true}}return false}h(n,"hasSpecialContent");function o(a){let s=Array.from(a.childNodes).filter(u=>u.nodeType===1),l=0;for(;l<s.length-1;){let u=s[l],f=s[l+1];if(u.tagName==="w:r"&&f.tagName==="w:r"&&!n(u)&&!n(f)){let c=P(u,"w:rPr"),d=P(f,"w:rPr");if(r(c,d)){let p=null;for(let m=0;m<u.childNodes.length;m++){let b=u.childNodes[m];b.nodeType===1&&(b.tagName==="w:t"||b.tagName==="w:delText")&&(p=b);}let g=Array.from(f.childNodes).filter(m=>m.nodeType===1);for(let m of g)if(m.tagName!=="w:rPr")if((m.tagName==="w:t"||m.tagName==="w:delText")&&p&&p.tagName===m.tagName){let b=p.textContent||"",y=m.textContent||"",w=b+y;p.textContent=w,w.trim()!==w&&p.setAttribute("xml:space","preserve");}else u.appendChild(m),(m.tagName==="w:t"||m.tagName==="w:delText")&&(p=m);a.removeChild(f),s.splice(l+1,1),t++;continue}}["w:ins","w:del","w:hyperlink","w:sdt","w:smartTag","w:fldSimple","w:sdtContent"].includes(u.tagName)&&o(u),l++;}if(s.length>0){let u=s[s.length-1];["w:ins","w:del","w:hyperlink","w:sdt","w:smartTag","w:fldSimple","w:sdtContent"].includes(u.tagName)&&o(u);}}h(o,"coalesceContainer");let i=x(e.element,"w:p");for(let a of i)o(a);return t?[`Adjacent identical runs coalesced: ${t}`]:[]}h(ll,"coalesce_runs");function cl(e){let t=0,r=["w:rsidR","w:rsidRPr","w:rsidRDefault","w:rsidP","w:rsidDel","w:rsidSect","w:rsidTr"],n=e.element.getElementsByTagName("*");for(let i=0;i<n.length;i++)for(let a of r)n[i].hasAttribute(a)&&(n[i].removeAttribute(a),t++);let o=x(e.element,"w:rsids");for(let i of o)i.parentNode&&(i.parentNode.removeChild(i),t++);return t?[`rsid attributes: ${t} removed`]:[]}h(cl,"strip_rsid");function fl(e){let t=0,r=["w14:paraId","w14:textId"],n=e.element.getElementsByTagName("*");for(let o=0;o<n.length;o++)for(let i of r)n[o].hasAttribute(i)&&(n[o].removeAttribute(i),t++);return t?[`Paragraph/text IDs: ${t} removed`]:[]}h(fl,"strip_para_ids");function hl(e){let t=x(e.element,"w:proofErr");return t.forEach(r=>r.parentNode?.removeChild(r)),t.length?[`Spell check markers: ${t.length} removed`]:[]}h(hl,"strip_proof_errors");function dl(e){let t=0;for(let r of ["w:rPr","w:pPr"]){let n=x(e.element,r);for(let o of n)(o.childNodes.length===0||o.childNodes.length===1&&o.childNodes[0].nodeType===3&&!o.childNodes[0].textContent?.trim())&&(o.parentNode?.removeChild(o),t++);}return t?[`Empty property elements: ${t} removed`]:[]}h(dl,"strip_empty_properties");function pl(e){let t=0,r=x(e.element,"w:rPr");for(let n of r)if(P(n,"w:vanish")||P(n,"w:webHidden")){let o=n.parentNode;o&&o.tagName==="w:r"&&o.parentNode&&(o.parentNode.removeChild(o),t++);}return t?[`Hidden text runs: ${t} removed`]:[]}h(pl,"strip_hidden_text");function fo(e){let t=x(e.element,"w:ins").length,r=x(e.element,"w:del").length,n=x(e.element,"w:rPrChange").length+x(e.element,"w:pPrChange").length+x(e.element,"w:sectPrChange").length;return [t,r,n]}h(fo,"count_tracked_changes");function ml(e){let t=new Set;for(let r of ["w:ins","w:del","w:rPrChange","w:pPrChange","w:sectPrChange"])for(let n of x(e.element,r)){let o=n.getAttribute("w:author");o&&t.add(o);}return t}h(ml,"get_track_change_authors");function ho(e){let t=[],r=x(e,"w:t");for(let o of r)o.textContent&&t.push(o.textContent);let n=x(e,"w:delText");for(let o of n)o.textContent&&t.push(o.textContent);return t.join("")}h(ho,"_getElementText");function Or(e,t=60){let r=e.replace(/\n/g," ").trim();return r.length<=t?r:r.substring(0,t-3)+"..."}h(Or,"_truncate");function gl(e){let t=[],r=x(e.element,"w:ins"),n=x(e.element,"w:del");for(let a of r){let s=ho(a).trim();s&&t.push(` Accepted insertion: "${Or(s,60)}"`);}for(let a of n){let s=ho(a).trim();s&&t.push(` Accepted deletion of: "${Or(s,60)}"`);}new Tn(e).accept_all_revisions();for(let a of ["w:rPrChange","w:pPrChange","w:sectPrChange"])for(let s of x(e.element,a))s.parentNode?.removeChild(s);let i=r.length+n.length;return i?[`Tracked changes auto-accepted: ${i}`].concat(t):[]}h(gl,"accept_all_tracked_changes");function _l(e){let t=Mr(e.pkg),r=[],n=0,o=0;for(let[i,a]of Object.entries(t))a.resolved?o++:n++,r.push({id:i,...a});return {total:r.length,open:n,resolved:o,comments:r}}h(_l,"get_comments_summary");function vl(e){let t=Mr(e.pkg),r=Object.keys(t);if(r.length===0)return [];let n=[],o=new Pr(e);for(let[s,l]of Object.entries(t)){let u=l.resolved?"[Resolved]":"[Open]";n.push(` ${u} "${Or(l.text||"",60)}" (${l.author||"Unknown"})`),o.deleteComment(s);}for(let s of ["w:commentRangeStart","w:commentRangeEnd","w:commentReference"])for(let l of x(e.element,s))l.parentNode?.removeChild(l);let i=Object.values(t).filter(s=>s.resolved).length,a=Object.values(t).filter(s=>!s.resolved).length;return [`Comments removed: ${r.length} (${i} resolved, ${a} open)`].concat(n)}h(vl,"remove_all_comments");function wl(e,t){let r=new Pr(e);if(!r.commentsPart)return [];let n=new Set,o=x(r.commentsPart._element,"w:comment");for(let i of o){let a=i.getAttribute("w:author");if(a&&(n.add(a),i.setAttribute("w:author",t)),i.hasAttribute("w:initials")){let s=t.split(" ").filter(Boolean).map(l=>l[0]).join("").toUpperCase();i.setAttribute("w:initials",s);}}return n.size?[`Comment authors replaced: ${Array.from(n).sort().join(", ")} \u2192 "${t}"`]:[]}h(wl,"replace_comment_authors");function yl(e,t){let r=new Set;for(let n of ["w:ins","w:del","w:rPrChange","w:pPrChange"])for(let o of x(e.element,n)){let i=o.getAttribute("w:author");i&&(r.add(i),o.setAttribute("w:author",t));}return r.size?[`Track change authors replaced: ${Array.from(r).sort().join(", ")} \u2192 "${t}"`]:[]}h(yl,"replace_change_authors");function El(e){let t=0,r="2025-01-01T00:00:00Z";for(let n of ["w:ins","w:del","w:rPrChange","w:pPrChange"])for(let o of x(e.element,n))o.hasAttribute("w:date")&&(o.setAttribute("w:date",r),t++);return t?[`Track change timestamps: ${t} normalized`]:[]}h(El,"normalize_change_dates");function Dl(e){let t=[],r=e.pkg.getPartByPath("docProps/core.xml");r&&(Je(r._element,"creator").forEach(s=>{s.textContent&&(t.push(`Author: ${s.textContent}`),s.textContent="");}),Je(r._element,"lastModifiedBy").forEach(s=>{s.textContent&&(t.push(`Last modified by: ${s.textContent}`),s.textContent="");}),Je(r._element,"revision").forEach(s=>{s.textContent&&parseInt(s.textContent)>1&&(t.push(`Revision count: ${s.textContent} \u2192 1`),s.textContent="1");}));let n=e.pkg.getPartByPath("docProps/app.xml");if(n){let o=n._element,i=["TotalTime","Words","Characters","Paragraphs","Lines","CharactersWithSpaces"];for(let s of i)Je(o,s).forEach(l=>{l.textContent&&l.textContent!=="0"&&(s==="TotalTime"&&t.push(`Total editing time: ${l.textContent} minutes`),l.textContent="0");});let a=["Template","Manager","Company"];for(let s of a)Je(o,s).forEach(l=>{l.textContent&&(t.push(`${s}: ${l.textContent}`),l.textContent="");});}return t.length?["Metadata scrubbed:",...t.map(o=>` ${o}`)]:[]}h(Dl,"scrub_doc_properties");function Al(e){let t=false,r="1970-01-01T00:00:00Z",n=e.pkg.getPartByPath("docProps/core.xml");if(n)for(let o of ["created","modified","lastPrinted"])Je(n._element,o).forEach(i=>{i.textContent&&i.textContent!==r&&(i.textContent=r,t=true);});return t?["Timestamps normalized to epoch"]:[]}h(Al,"scrub_timestamps");function bl(e){let t=e.pkg.parts.filter(a=>a.partname.includes("/customXml"));if(t.length===0)return [];let r=new Set(t.map(a=>a.partname));e.pkg.parts=e.pkg.parts.filter(a=>!r.has(a.partname));let n=h(a=>{let s=[];for(let l of x(a._element,"Relationship")){let u=l.getAttribute("Target");u&&u.includes("customXml")&&s.push(l);}s.forEach(l=>l.parentNode?.removeChild(l));},"removeRelationsTo"),o=e.pkg.getPartByPath("_rels/.rels");o&&n(o);let i=e.pkg.getOrCreateRelsPart(e.part.partname);i&&n(i);for(let a of x(e.element,"w:sdtPr"))cu(a,"w:dataBinding").forEach(s=>a.removeChild(s));return [`Custom XML parts: ${t.length} removed`]}h(bl,"strip_custom_xml");function Nl(e){let t=0;for(let r of Je(e.element,"docPr")){let n=r.getAttribute("descr");if(n){let o=n.length<10,i=n.includes(".")&&n.length<60;(o||i)&&(r.removeAttribute("descr"),t++);}}return t?[`Image alt text: ${t} auto-generated descriptions removed`]:[]}h(Nl,"strip_image_alt_text");function Cl(e){let t=["sharepoint.com","onedrive.com",".internal","intranet","localhost","10.","192.168.","172.16."],r=[],n=e.pkg.getOrCreateRelsPart(e.part.partname);for(let o of x(n._element,"Relationship"))if(o.getAttribute("TargetMode")==="External"){let i=o.getAttribute("Target")||"";for(let a of t)if(i.toLowerCase().includes(a.toLowerCase())){r.push(`Hyperlink targets internal URL: ${Or(i,80)}`);break}}return r}h(Cl,"audit_hyperlinks");async function Oo(e,t){let r=new ul(t.filename,t.sanitize_mode||"full",t.author||null);if(t.sanitize_mode==="full"){let i=fo(e),a=i[0]+i[1]+i[2];if(r.tracked_changes_found=a,a>0&&!t.accept_all)return r.status="blocked",r.blocked_reason=`Document contains ${a} unresolved tracked changes (${i[0]} insertions, ${i[1]} deletions, ${i[2]} formatting). Review in Word first, or set accept_all=true.`,{reportText:r.render()};if(a>0){let l=ml(e);l.size>1&&r.warnings.push(`Multiple authors detected in tracked changes: ${Array.from(l).sort().join(", ")}. Review per-change list before sending.`),r.add_transform_lines(gl(e)),r.tracked_changes_accepted=a;}let s=_l(e);r.comments_removed=s.total,r.add_transform_lines(vl(e));}else if(t.sanitize_mode==="keep-markup"){let i=fo(e);r.tracked_changes_found=i[0]+i[1]+i[2],r.tracked_changes_kept=r.tracked_changes_found,t.author&&(r.add_transform_lines(wl(e,t.author)),r.add_transform_lines(yl(e,t.author)));}r.add_transform_lines(cl(e)),r.add_transform_lines(fl(e)),r.add_transform_lines(hl(e)),r.add_transform_lines(dl(e)),r.add_transform_lines(pl(e)),r.add_transform_lines(ll(e)),r.add_transform_lines(Dl(e)),r.add_transform_lines(Al(e)),r.add_transform_lines(bl(e)),r.add_transform_lines(Nl(e));let n=Cl(e);for(let i of n)r.warnings.push(i);if(r.add_transform_lines(El(e)),t.protection_mode==="read_only"||t.protection_mode==="encrypt"){t.protection_mode==="encrypt"&&r.warnings.push("Encryption mode (AES compound wrappers) is strictly unsupported in the zero-dependency Node engine. Falling back to native Word Read-Only lock.");let i=e.pkg.getPartByPath("word/settings.xml");if(i){let a=i._element.ownerDocument,s=Je(i._element,"documentProtection")[0];s||(s=a.createElement("w:documentProtection"),i._element.appendChild(s)),s.setAttribute("w:edit","readOnly"),s.setAttribute("w:enforcement","1"),r.structural_lines.push("Document locked (Read-Only enforcement injected into settings.xml)");}}t.export_pdf&&r.warnings.push("PDF export requires the Python/Word COM environment and is skipped in this zero-dependency Node agent.");for(let i of e.pkg.parts)if((i===e.part||i.contentType.includes("wordprocessingml")&&i.contentType.endsWith("+xml"))&&i._element.hasAttribute("xmlns:w16du")){let a=false;if(Array.from(i._element.attributes||[]).some(s=>s.name.startsWith("w16du:")&&s.name!=="xmlns:w16du")&&(a=true),!a){let s=x(i._element,"*");for(let l of s)if(l.tagName.startsWith("w16du:")||Array.from(l.attributes||[]).some(u=>u.name.startsWith("w16du:"))){a=true;break}}a||i._element.removeAttribute("xmlns:w16du");}r.warnings.length>0&&(r.status="clean_with_warnings");let o=await e.save();return {reportText:r.render(),outBuffer:o}}h(Oo,"finalize_document");var ko=[{displayName:"Input Binary Property",name:"binaryPropertyName",type:"string",default:"data",required:true,placeholder:"e.g. data",description:"Name of the binary property holding the .docx file (string, e.g. 'data'). In 'From Connected Input' mode this reads from the current item; in 'From Another Node' mode this specifies which property on the source node's output to read. Must be a valid .docx (not .doc, .pdf, or another format).",displayOptions:{show:{resource:["document"],operation:["extractMarkdown"]}}},{displayName:"Clean View",name:"cleanView",type:"boolean",default:false,description:"Whether to project the document as if all pending tracked changes were accepted (simulates Accept All). When false (default), all tracked changes are surfaced inline as CriticMarkup ({++ins++}, {--del--}, {>>comment<<}) so an AI can review and resolve them. Use false to review counterparty edits; use true to generate net-new redlines against a clean baseline.",displayOptions:{show:{resource:["document"],operation:["extractMarkdown"]}}}];async function Po(e){let t=this.getNodeParameter("binaryPropertyName",e),r=this.getNodeParameter("cleanView",e),o=this.getNodeParameter("documentSource",e,"fromInput")==="fromNode"?{mode:"fromNode",sourceNodeName:this.getNodeParameter("sourceNodeName",e,""),binaryPropertyName:t,sourceBinaryId:this.getNodeParameter("sourceBinaryId",e,"")}:{mode:"fromInput",binaryPropertyName:t},{buffer:i,fileName:a}=await Be.call(this,e,o),s=await st(i,r);return [{json:{fileName:a,cleanView:r,markdown:s},pairedItem:{item:e}}]}h(Po,"executeExtractMarkdown");var Mo=[{displayName:"Input Binary Property",name:"binaryPropertyName",type:"string",default:"data",required:true,placeholder:"e.g. data",description:"Name of the binary property holding the .docx file (string, e.g. 'data'). In 'From Connected Input' mode this reads from the current item; in 'From Another Node' mode this specifies which property on the source node's output to read. The file must be a valid .docx.",displayOptions:{show:{resource:["document"],operation:["applyEdits"]}}},{displayName:"Output Binary Property",name:"outputBinaryPropertyName",type:"string",default:"data",required:true,placeholder:"e.g. data",description:"Name of the binary property on the outgoing item that will hold the redlined .docx file (string, e.g. 'data'). If equal to the input property name, the original binary is overwritten on the outgoing item.",displayOptions:{show:{resource:["document"],operation:["applyEdits"]}}},{displayName:"Author",name:"author",type:"string",default:"Adeu AI",placeholder:"e.g. AI Reviewer",description:"Author name attached to all tracked changes and comments produced by this operation (string, e.g. 'AI Reviewer'). Shows up in Word's review pane as the author of every redline and comment created in this batch.",displayOptions:{show:{resource:["document"],operation:["applyEdits"]}}},{displayName:"Edits Source",name:"editsSource",type:"options",noDataExpression:true,default:"fromInputJson",description:"Where to read the list of DocumentChange objects from. Use 'Define Below' to read the array from the Changes (JSON) field on this node \u2014 this is the typical AI Agent path, since the LLM generates the array as a tool call argument that lands on that field via $fromAI(). Use 'From Input JSON' to read the array from a property on the upstream item's JSON, for deterministic pipelines where a non-AI node (HTTP Request, Code, etc.) has pre-populated it.",options:[{name:"Define Below",value:"defineBelow",description:"Read the array from the Changes (JSON) field on this node. Use for AI Agent workflows \u2014 the LLM populates that field via $fromAI() as a tool call argument."},{name:"From Input JSON",value:"fromInputJson",description:"Read the array from a property on the upstream item's JSON. Use for deterministic pipelines where a non-AI node has pre-populated the changes array."}],displayOptions:{show:{resource:["document"],operation:["applyEdits"]}}},{displayName:"JSON Path on Input Item",name:"editsJsonPath",type:"string",default:"changes",required:true,placeholder:"e.g. data.changes",description:"Property path on the input item JSON whose value is the array of DocumentChange objects (string, dot-notation supported, e.g. 'changes' or 'data.changes'). Must resolve to an array; throws an error otherwise.",displayOptions:{show:{resource:["document"],operation:["applyEdits"],editsSource:["fromInputJson"]}}},{displayName:"Changes (JSON)",name:"editsJson",type:"string",default:`[
|
|
70
|
+
`)}};function Je(e,t){let r=[],n=e.getElementsByTagName("*");for(let a=0;a<n.length;a++){let i=n[a].tagName;(i===t||i.endsWith(":"+t))&&r.push(n[a]);}return r}h(Je,"findDescendantsByLocalName");function cl(e){let t=0;function r(o,u){let l=o?o.toString():"",s=u?u.toString():"";return l===s}h(r,"areRunsIdentical");function n(o){let u=["w:t","w:tab","w:br","w:cr","w:delText","w:rPr"];for(let l=0;l<o.childNodes.length;l++){let s=o.childNodes[l];if(s.nodeType===1){let f=s.tagName;if(!u.includes(f))return true}}return false}h(n,"hasSpecialContent");function a(o){let u=Array.from(o.childNodes).filter(s=>s.nodeType===1),l=0;for(;l<u.length-1;){let s=u[l],f=u[l+1];if(s.tagName==="w:r"&&f.tagName==="w:r"&&!n(s)&&!n(f)){let c=O(s,"w:rPr"),d=O(f,"w:rPr");if(r(c,d)){let p=null;for(let g=0;g<s.childNodes.length;g++){let b=s.childNodes[g];b.nodeType===1&&(b.tagName==="w:t"||b.tagName==="w:delText")&&(p=b);}let m=Array.from(f.childNodes).filter(g=>g.nodeType===1);for(let g of m)if(g.tagName!=="w:rPr")if((g.tagName==="w:t"||g.tagName==="w:delText")&&p&&p.tagName===g.tagName){let b=p.textContent||"",w=g.textContent||"",v=b+w;p.textContent=v,v.trim()!==v&&p.setAttribute("xml:space","preserve");}else s.appendChild(g),(g.tagName==="w:t"||g.tagName==="w:delText")&&(p=g);o.removeChild(f),u.splice(l+1,1),t++;continue}}["w:ins","w:del","w:hyperlink","w:sdt","w:smartTag","w:fldSimple","w:sdtContent"].includes(s.tagName)&&a(s),l++;}if(u.length>0){let s=u[u.length-1];["w:ins","w:del","w:hyperlink","w:sdt","w:smartTag","w:fldSimple","w:sdtContent"].includes(s.tagName)&&a(s);}}h(a,"coalesceContainer");let i=S(e.element,"w:p");for(let o of i)a(o);return t?[`Adjacent identical runs coalesced: ${t}`]:[]}h(cl,"coalesce_runs");function fl(e){let t=0,r=["w:rsidR","w:rsidRPr","w:rsidRDefault","w:rsidP","w:rsidDel","w:rsidSect","w:rsidTr"],n=e.element.getElementsByTagName("*");for(let i=0;i<n.length;i++)for(let o of r)n[i].hasAttribute(o)&&(n[i].removeAttribute(o),t++);let a=S(e.element,"w:rsids");for(let i of a)i.parentNode&&(i.parentNode.removeChild(i),t++);return t?[`rsid attributes: ${t} removed`]:[]}h(fl,"strip_rsid");function hl(e){let t=0,r=["w14:paraId","w14:textId"],n=e.element.getElementsByTagName("*");for(let a=0;a<n.length;a++)for(let i of r)n[a].hasAttribute(i)&&(n[a].removeAttribute(i),t++);return t?[`Paragraph/text IDs: ${t} removed`]:[]}h(hl,"strip_para_ids");function dl(e){let t=S(e.element,"w:proofErr");return t.forEach(r=>r.parentNode?.removeChild(r)),t.length?[`Spell check markers: ${t.length} removed`]:[]}h(dl,"strip_proof_errors");function pl(e){let t=0;for(let r of ["w:rPr","w:pPr"]){let n=S(e.element,r);for(let a of n)(a.childNodes.length===0||a.childNodes.length===1&&a.childNodes[0].nodeType===3&&!a.childNodes[0].textContent?.trim())&&(a.parentNode?.removeChild(a),t++);}return t?[`Empty property elements: ${t} removed`]:[]}h(pl,"strip_empty_properties");function ml(e){let t=0,r=S(e.element,"w:rPr");for(let n of r)if(O(n,"w:vanish")||O(n,"w:webHidden")){let a=n.parentNode;a&&a.tagName==="w:r"&&a.parentNode&&(a.parentNode.removeChild(a),t++);}return t?[`Hidden text runs: ${t} removed`]:[]}h(ml,"strip_hidden_text");function pa(e){let t=S(e.element,"w:ins").length,r=S(e.element,"w:del").length,n=S(e.element,"w:rPrChange").length+S(e.element,"w:pPrChange").length+S(e.element,"w:sectPrChange").length;return [t,r,n]}h(pa,"count_tracked_changes");function gl(e){let t=new Set;for(let r of ["w:ins","w:del","w:rPrChange","w:pPrChange","w:sectPrChange"])for(let n of S(e.element,r)){let a=n.getAttribute("w:author");a&&t.add(a);}return t}h(gl,"get_track_change_authors");function ma(e){let t=[],r=S(e,"w:t");for(let a of r)a.textContent&&t.push(a.textContent);let n=S(e,"w:delText");for(let a of n)a.textContent&&t.push(a.textContent);return t.join("")}h(ma,"_getElementText");function Mr(e,t=60){let r=e.replace(/\n/g," ").trim();return r.length<=t?r:r.substring(0,t-3)+"..."}h(Mr,"_truncate");function _l(e){let t=[],r=S(e.element,"w:ins"),n=S(e.element,"w:del");for(let o of r){let u=ma(o).trim();u&&t.push(` Accepted insertion: "${Mr(u,60)}"`);}for(let o of n){let u=ma(o).trim();u&&t.push(` Accepted deletion of: "${Mr(u,60)}"`);}new Sn(e).accept_all_revisions();for(let o of ["w:rPrChange","w:pPrChange","w:sectPrChange"])for(let u of S(e.element,o))u.parentNode?.removeChild(u);let i=r.length+n.length;return i?[`Tracked changes auto-accepted: ${i}`].concat(t):[]}h(_l,"accept_all_tracked_changes");function vl(e){let t=Br(e.pkg),r=[],n=0,a=0;for(let[i,o]of Object.entries(t))o.resolved?a++:n++,r.push({id:i,...o});return {total:r.length,open:n,resolved:a,comments:r}}h(vl,"get_comments_summary");function wl(e){let t=Br(e.pkg),r=Object.keys(t);if(r.length===0)return [];let n=[],a=new ir(e);for(let[l,s]of Object.entries(t)){let f=s.resolved?"[Resolved]":"[Open]";n.push(` ${f} "${Mr(s.text||"",60)}" (${s.author||"Unknown"})`),a.deleteComment(l);}for(let l of ["w:commentRangeStart","w:commentRangeEnd"])for(let s of S(e.element,l))s.parentNode?.removeChild(s);let i=S(e.element,"w:commentReference");for(let l of i){let s=l.parentNode;s&&((s.tagName==="w:r"||s.tagName.endsWith(":r"))&&Array.from(s.childNodes).filter(c=>c.nodeType===1&&c.tagName!=="w:rPr"&&c.tagName!=="rPr").length<=1?s.parentNode?.removeChild(s):s.removeChild(l));}let o=Object.values(t).filter(l=>l.resolved).length,u=Object.values(t).filter(l=>!l.resolved).length;return [`Comments removed: ${r.length} (${o} resolved, ${u} open)`].concat(n)}h(wl,"remove_all_comments");function yl(e){let t=e.pkg,r=new Set;for(let a of t.parts)if(a.partname.toLowerCase().includes("comments")){r.add(a.partname);let i=a.partname.startsWith("/")?a.partname:"/"+a.partname,o=a.partname.startsWith("/")?a.partname.substring(1):a.partname;r.add(i),r.add(o);}if(r.size===0)return;for(let a of t.parts)if(a.partname.endsWith(".rels")){let i=S(a._element,"Relationship"),o=[];for(let u of i)if((u.getAttribute("Target")||"").toLowerCase().includes("comments")){o.push(u);let s=a.partname.replace("/_rels/","/").replace(".rels",""),f=t.getPartByPath(s);if(f){let c=u.getAttribute("Id");c&&f.rels.delete(c);}}for(let u of o)u.parentNode?.removeChild(u);}let n=t.getPartByPath("[Content_Types].xml");if(n){let a=S(n._element,"Override"),i=[];for(let o of a){let u=o.getAttribute("PartName")||"";(r.has(u)||u.toLowerCase().includes("comments"))&&i.push(o);}for(let o of i)o.parentNode?.removeChild(o);}t.parts=t.parts.filter(a=>!a.partname.toLowerCase().includes("comments"));for(let a of Object.keys(t.unzipped))a.toLowerCase().includes("comments")&&delete t.unzipped[a];}h(yl,"eject_comment_parts");function El(e,t){let r=new ir(e);if(!r.commentsPart)return [];let n=new Set,a=S(r.commentsPart._element,"w:comment");for(let i of a){let o=i.getAttribute("w:author");if(o&&(n.add(o),i.setAttribute("w:author",t)),i.hasAttribute("w:initials")){let u=t.split(" ").filter(Boolean).map(l=>l[0]).join("").toUpperCase();i.setAttribute("w:initials",u);}}return n.size?[`Comment authors replaced: ${Array.from(n).sort().join(", ")} \u2192 "${t}"`]:[]}h(El,"replace_comment_authors");function Dl(e,t){let r=new Set;for(let n of ["w:ins","w:del","w:rPrChange","w:pPrChange"])for(let a of S(e.element,n)){let i=a.getAttribute("w:author");i&&(r.add(i),a.setAttribute("w:author",t));}return r.size?[`Track change authors replaced: ${Array.from(r).sort().join(", ")} \u2192 "${t}"`]:[]}h(Dl,"replace_change_authors");function bl(e){let t=0,r="2025-01-01T00:00:00Z";for(let n of ["w:ins","w:del","w:rPrChange","w:pPrChange"])for(let a of S(e.element,n))a.hasAttribute("w:date")&&(a.setAttribute("w:date",r),t++);return t?[`Track change timestamps: ${t} normalized`]:[]}h(bl,"normalize_change_dates");function Al(e){let t=[],r=e.pkg.getPartByPath("docProps/core.xml");r&&(Je(r._element,"creator").forEach(u=>{u.textContent&&(t.push(`Author: ${u.textContent}`),u.textContent="");}),Je(r._element,"lastModifiedBy").forEach(u=>{u.textContent&&(t.push(`Last modified by: ${u.textContent}`),u.textContent="");}),Je(r._element,"revision").forEach(u=>{u.textContent&&parseInt(u.textContent)>1&&(t.push(`Revision count: ${u.textContent} \u2192 1`),u.textContent="1");}));let n=e.pkg.getPartByPath("docProps/app.xml");if(n){let a=n._element,i=["TotalTime","Words","Characters","Paragraphs","Lines","CharactersWithSpaces"];for(let u of i)Je(a,u).forEach(l=>{l.textContent&&l.textContent!=="0"&&(u==="TotalTime"&&t.push(`Total editing time: ${l.textContent} minutes`),l.textContent="0");});let o=["Template","Manager","Company"];for(let u of o)Je(a,u).forEach(l=>{l.textContent&&(t.push(`${u}: ${l.textContent}`),l.textContent="");});}return t.length?["Metadata scrubbed:",...t.map(a=>` ${a}`)]:[]}h(Al,"scrub_doc_properties");function Nl(e){let t=false,r="1970-01-01T00:00:00Z",n=e.pkg.getPartByPath("docProps/core.xml");if(n)for(let a of ["created","modified","lastPrinted"])Je(n._element,a).forEach(i=>{i.textContent&&i.textContent!==r&&(i.textContent=r,t=true);});return t?["Timestamps normalized to epoch"]:[]}h(Nl,"scrub_timestamps");function Cl(e){let t=e.pkg.parts.filter(o=>o.partname.includes("/customXml"));if(t.length===0)return [];let r=new Set(t.map(o=>o.partname));e.pkg.parts=e.pkg.parts.filter(o=>!r.has(o.partname));let n=h(o=>{let u=[];for(let l of S(o._element,"Relationship")){let s=l.getAttribute("Target");s&&s.includes("customXml")&&u.push(l);}u.forEach(l=>l.parentNode?.removeChild(l));},"removeRelationsTo"),a=e.pkg.getPartByPath("_rels/.rels");a&&n(a);let i=e.pkg.getOrCreateRelsPart(e.part.partname);i&&n(i);for(let o of S(e.element,"w:sdtPr"))hu(o,"w:dataBinding").forEach(u=>o.removeChild(u));return [`Custom XML parts: ${t.length} removed`]}h(Cl,"strip_custom_xml");function Tl(e){let t=0;for(let r of Je(e.element,"docPr")){let n=r.getAttribute("descr");if(n){let a=n.length<10,i=n.includes(".")&&n.length<60;(a||i)&&(r.removeAttribute("descr"),t++);}}return t?[`Image alt text: ${t} auto-generated descriptions removed`]:[]}h(Tl,"strip_image_alt_text");function xl(e){let t=["sharepoint.com","onedrive.com",".internal","intranet","localhost","10.","192.168.","172.16."],r=[],n=e.pkg.getOrCreateRelsPart(e.part.partname);for(let a of S(n._element,"Relationship"))if(a.getAttribute("TargetMode")==="External"){let i=a.getAttribute("Target")||"";for(let o of t)if(i.toLowerCase().includes(o.toLowerCase())){r.push(`Hyperlink targets internal URL: ${Mr(i,80)}`);break}}return r}h(xl,"audit_hyperlinks");async function Pa(e,t){let r=new ll(t.filename,t.sanitize_mode||"full",t.author||null);if(t.sanitize_mode==="full"){let i=pa(e),o=i[0]+i[1]+i[2];if(r.tracked_changes_found=o,o>0&&!t.accept_all)return r.status="blocked",r.blocked_reason=`Document contains ${o} unresolved tracked changes (${i[0]} insertions, ${i[1]} deletions, ${i[2]} formatting). Review in Word first, or set accept_all=true.`,{reportText:r.render()};if(o>0){let l=gl(e);l.size>1&&r.warnings.push(`Multiple authors detected in tracked changes: ${Array.from(l).sort().join(", ")}. Review per-change list before sending.`),r.add_transform_lines(_l(e)),r.tracked_changes_accepted=o;}let u=vl(e);r.comments_removed=u.total,r.add_transform_lines(wl(e)),yl(e);}else if(t.sanitize_mode==="keep-markup"){let i=pa(e);r.tracked_changes_found=i[0]+i[1]+i[2],r.tracked_changes_kept=r.tracked_changes_found,t.author&&(r.add_transform_lines(El(e,t.author)),r.add_transform_lines(Dl(e,t.author)));}r.add_transform_lines(fl(e)),r.add_transform_lines(hl(e)),r.add_transform_lines(dl(e)),r.add_transform_lines(pl(e)),r.add_transform_lines(ml(e)),r.add_transform_lines(cl(e)),r.add_transform_lines(Al(e)),r.add_transform_lines(Nl(e)),r.add_transform_lines(Cl(e)),r.add_transform_lines(Tl(e));let n=xl(e);for(let i of n)r.warnings.push(i);if(r.add_transform_lines(bl(e)),t.protection_mode==="read_only"||t.protection_mode==="encrypt"){t.protection_mode==="encrypt"&&r.warnings.push("Encryption mode (AES compound wrappers) is strictly unsupported in the zero-dependency Node engine. Falling back to native Word Read-Only lock.");let i=e.pkg.getPartByPath("word/settings.xml");if(i){let o=i._element.ownerDocument,u=Je(i._element,"documentProtection")[0];u||(u=o.createElement("w:documentProtection"),i._element.appendChild(u)),u.setAttribute("w:edit","readOnly"),u.setAttribute("w:enforcement","1"),r.structural_lines.push("Document locked (Read-Only enforcement injected into settings.xml)");}}t.export_pdf&&r.warnings.push("PDF export requires the Python/Word COM environment and is skipped in this zero-dependency Node agent.");for(let i of e.pkg.parts)if((i===e.part||i.contentType.includes("wordprocessingml")&&i.contentType.endsWith("+xml"))&&i._element.hasAttribute("xmlns:w16du")){let o=false;if(Array.from(i._element.attributes||[]).some(u=>u.name.startsWith("w16du:")&&u.name!=="xmlns:w16du")&&(o=true),!o){let u=S(i._element,"*");for(let l of u)if(l.tagName.startsWith("w16du:")||Array.from(l.attributes||[]).some(s=>s.name.startsWith("w16du:"))){o=true;break}}o||i._element.removeAttribute("xmlns:w16du");}r.warnings.length>0&&(r.status="clean_with_warnings");let a=await e.save();return {reportText:r.render(),outBuffer:a}}h(Pa,"finalize_document");var Oa=[{displayName:"Input Binary Property",name:"binaryPropertyName",type:"string",default:"data",required:true,placeholder:"e.g. data",description:"Name of the binary property holding the .docx file (string, e.g. 'data'). In 'From Connected Input' mode this reads from the current item; in 'From Another Node' mode this specifies which property on the source node's output to read. Must be a valid .docx (not .doc, .pdf, or another format).",displayOptions:{show:{resource:["document"],operation:["extractMarkdown"]}}},{displayName:"Clean View",name:"cleanView",type:"boolean",default:false,description:"Whether to project the document as if all pending tracked changes were accepted (simulates Accept All). When false (default), all tracked changes are surfaced inline as CriticMarkup ({++ins++}, {--del--}, {>>comment<<}) so an AI can review and resolve them. Use false to review counterparty edits; use true to generate net-new redlines against a clean baseline.",displayOptions:{show:{resource:["document"],operation:["extractMarkdown"]}}}];async function Ma(e){let t=this.getNodeParameter("binaryPropertyName",e),r=this.getNodeParameter("cleanView",e),a=this.getNodeParameter("documentSource",e,"fromInput")==="fromNode"?{mode:"fromNode",sourceNodeName:this.getNodeParameter("sourceNodeName",e,""),binaryPropertyName:t,sourceBinaryId:this.getNodeParameter("sourceBinaryId",e,"")}:{mode:"fromInput",binaryPropertyName:t},{buffer:i,fileName:o}=await Fe.call(this,e,a),u=await st(i,r);return [{json:{fileName:o,cleanView:r,markdown:u},pairedItem:{item:e}}]}h(Ma,"executeExtractMarkdown");var Ra=[{displayName:"Input Binary Property",name:"binaryPropertyName",type:"string",default:"data",required:true,placeholder:"e.g. data",description:"Name of the binary property holding the .docx file (string, e.g. 'data'). In 'From Connected Input' mode this reads from the current item; in 'From Another Node' mode this specifies which property on the source node's output to read. The file must be a valid .docx.",displayOptions:{show:{resource:["document"],operation:["applyEdits"]}}},{displayName:"Output Binary Property",name:"outputBinaryPropertyName",type:"string",default:"data",required:true,placeholder:"e.g. data",description:"Name of the binary property on the outgoing item that will hold the redlined .docx file (string, e.g. 'data'). If equal to the input property name, the original binary is overwritten on the outgoing item.",displayOptions:{show:{resource:["document"],operation:["applyEdits"]}}},{displayName:"Author",name:"author",type:"string",default:"Adeu AI",placeholder:"e.g. AI Reviewer",description:"Author name attached to all tracked changes and comments produced by this operation (string, e.g. 'AI Reviewer'). Shows up in Word's review pane as the author of every redline and comment created in this batch.",displayOptions:{show:{resource:["document"],operation:["applyEdits"]}}},{displayName:"Edits Source",name:"editsSource",type:"options",noDataExpression:true,default:"fromInputJson",description:"Where to read the list of DocumentChange objects from. Use 'Define Below' to read the array from the Changes (JSON) field on this node \u2014 this is the typical AI Agent path, since the LLM generates the array as a tool call argument that lands on that field via $fromAI(). Use 'From Input JSON' to read the array from a property on the upstream item's JSON, for deterministic pipelines where a non-AI node (HTTP Request, Code, etc.) has pre-populated it.",options:[{name:"Define Below",value:"defineBelow",description:"Read the array from the Changes (JSON) field on this node. Use for AI Agent workflows \u2014 the LLM populates that field via $fromAI() as a tool call argument."},{name:"From Input JSON",value:"fromInputJson",description:"Read the array from a property on the upstream item's JSON. Use for deterministic pipelines where a non-AI node has pre-populated the changes array."}],displayOptions:{show:{resource:["document"],operation:["applyEdits"]}}},{displayName:"JSON Path on Input Item",name:"editsJsonPath",type:"string",default:"changes",required:true,placeholder:"e.g. data.changes",description:"Property path on the input item JSON whose value is the array of DocumentChange objects (string, dot-notation supported, e.g. 'changes' or 'data.changes'). Must resolve to an array; throws an error otherwise.",displayOptions:{show:{resource:["document"],operation:["applyEdits"],editsSource:["fromInputJson"]}}},{displayName:"Changes (JSON)",name:"editsJson",type:"string",default:`[
|
|
63
71
|
{
|
|
64
72
|
"type": "modify",
|
|
65
73
|
"target_text": "State of New York",
|
|
66
74
|
"new_text": "State of Delaware",
|
|
67
75
|
"comment": "Standardizing governing law."
|
|
68
76
|
}
|
|
69
|
-
]`,required:true,description:`JSON-encoded string containing an array of DocumentChange objects. Each object has a 'type' field discriminator and type-specific fields. type='modify': requires target_text (string, copied EXACTLY from the source including punctuation, spacing, and case) and new_text (string); optional comment (string). Never include CriticMarkup tags like {++ ++} or {-- --} in new_text \u2014 the engine applies tracking automatically. Never target text already inside another author's pending tracked change. type='accept': requires target_id (string like 'Chg:12' from the Markdown projection); optional comment. type='reject': requires target_id (string like 'Chg:12'); optional comment. type='reply': requires target_id (string like 'Com:45') and text (string). type='insert_row': requires target_text (string anchoring a table cell), position ('above' or 'below'), and cells (array of strings, one per column). type='delete_row': requires target_text (string anchoring the row to delete). The whole batch is validated atomically: if any single edit fails (target text not found, ambiguous match, read-only target, overlapping another author's change), the entire batch is rejected and the document is left untouched. Example: '[{"type":"modify","target_text":"within thirty (30) days","new_text":"within forty-five (45) days","comment":"Per playbook."}]'. Markdown code fences (\`\`\`json ... \`\`\`) wrapping the value are stripped automatically.`,typeOptions:{rows:10},displayOptions:{show:{resource:["document"],operation:["applyEdits"],editsSource:["defineBelow"]}}},{displayName:"Return Markdown Output",name:"returnMarkdown",type:"boolean",default:true,description:"Whether to auto-extract the post-edit document as Markdown (with CriticMarkup) and include it in the outgoing JSON under the 'markdown' field. Useful for feeding the updated state back into a downstream AI Agent for review or further edits. Adds extraction overhead per call.",displayOptions:{show:{resource:["document"],operation:["applyEdits"]}}}];async function Ro(e){let t=this.getNodeParameter("binaryPropertyName",e),r=this.getNodeParameter("outputBinaryPropertyName",e),n=this.getNodeParameter("author",e),o=this.getNodeParameter("editsSource",e),i=this.getNodeParameter("returnMarkdown",e),a;if(o==="fromInputJson"){let D=this.getNodeParameter("editsJsonPath",e),E=this.getInputData()[e].json;if(a=Sn(E,D),a===void 0)throw new Error(`No property "${D}" found on the input item JSON. Verify the upstream node produced it, or switch "Edits Source" to "Define Below".`)}else {let D=this.getNodeParameter("editsJson",e);a=In.call(this,D,e,"Changes (JSON)");}if(!Array.isArray(a))throw new Error("Changes must be an array of DocumentChange objects.");let l=this.getNodeParameter("documentSource",e,"fromInput")==="fromNode"?{mode:"fromNode",sourceNodeName:this.getNodeParameter("sourceNodeName",e,""),binaryPropertyName:t,sourceBinaryId:this.getNodeParameter("sourceBinaryId",e,"")}:{mode:"fromInput",binaryPropertyName:t},{buffer:u,fileName:f}=await Be.call(this,e,l),c=await nr.load(u),p=new Tn(c,n).process_batch(a),g=await c.save(),m=ar(f,"redlined"),b=await this.helpers.prepareBinaryData(g,m,et),y=typeof this.isToolExecution=="function"&&this.isToolExecution(),w;if(y&&b.id){let D=this.getWorkflowStaticData("global");D.adeu_last_redlined={id:b.id,fileName:m,mimeType:et,timestamp:Date.now()},w=b.id;}let v;i&&(v=await st(g,false));let _=this.getInputData()[e].binary??{};return [{json:{fileName:m,author:n,stats:p,...v!==void 0?{markdown:v}:{},...w!==void 0?{redlinedBinaryId:w}:{}},binary:{..._,[r]:b},pairedItem:{item:e}}]}h(Ro,"executeApplyEdits");var Bo=[{displayName:"Original Document Source",name:"originalDocumentSource",type:"options",default:"fromInput",description:"Where to read the original (baseline) .docx file from. 'From Connected Input' reads from the current item; 'From Another Node' reads from a named upstream node \u2014 required when this node is called as an AI Agent tool.",options:[{name:"From Connected Input",value:"fromInput"},{name:"From Another Node",value:"fromNode"}],displayOptions:{show:{resource:["document"],operation:["generateDiff"]}}},{displayName:"Original Source Node Name",name:"originalSourceNodeName",type:"string",default:"",required:true,placeholder:"e.g. Download Original",description:"Exact name of the node whose output binary holds the original (baseline) .docx (string, case-sensitive). Must match the node label in the canvas exactly.",displayOptions:{show:{resource:["document"],operation:["generateDiff"],originalDocumentSource:["fromNode"]}}},{displayName:"Original Binary Property",name:"originalBinaryPropertyName",type:"string",default:"data",required:true,placeholder:"e.g. data",description:"Name of the binary property holding the original (baseline) .docx file (string, e.g. 'data'). In 'From Connected Input' mode this reads from the current item; in 'From Another Node' mode this specifies which property on the source node's output to read.",displayOptions:{show:{resource:["document"],operation:["generateDiff"]}}},{displayName:"Modified Document Source",name:"modifiedDocumentSource",type:"options",default:"fromInput",description:"Where to read the modified (compared-to) .docx file from. 'From Connected Input' reads from the current item; 'From Another Node' reads from a named upstream node \u2014 required when this node is called as an AI Agent tool.",options:[{name:"From Connected Input",value:"fromInput"},{name:"From Another Node",value:"fromNode"}],displayOptions:{show:{resource:["document"],operation:["generateDiff"]}}},{displayName:"Modified Source Node Name",name:"modifiedSourceNodeName",type:"string",default:"",required:true,placeholder:"e.g. Apply Edits",description:"Exact name of the node whose output binary holds the modified (compared-to) .docx (string, case-sensitive). Must match the node label in the canvas exactly.",displayOptions:{show:{resource:["document"],operation:["generateDiff"],modifiedDocumentSource:["fromNode"]}}},{displayName:"Modified Binary Property",name:"modifiedBinaryPropertyName",type:"string",default:"data2",required:true,placeholder:"e.g. data2",description:"Name of the binary property holding the modified (compared-to) .docx file (string, e.g. 'data2'). In 'From Connected Input' mode this reads from the current item and must be different from the original property; in 'From Another Node' mode this specifies which property on the source node's output to read.",displayOptions:{show:{resource:["document"],operation:["generateDiff"]}}},{displayName:"Clean View",name:"cleanView",type:"boolean",default:true,description:"Whether to compare the Accept All clean view of both documents. When true (default, recommended), diffs reflect the final content as if all tracked changes were accepted. When false, diffs the raw CriticMarkup-projected text including pending change markers \u2014 useful for auditing tracked-change differences themselves.",displayOptions:{show:{resource:["document"],operation:["generateDiff"]}}}];async function Fo(e){let t=this.getNodeParameter("originalBinaryPropertyName",e),r=this.getNodeParameter("modifiedBinaryPropertyName",e),n=this.getNodeParameter("cleanView",e),o=this.getNodeParameter("originalDocumentSource",e,"fromInput"),i=this.getNodeParameter("modifiedDocumentSource",e,"fromInput"),a=o==="fromNode"?{mode:"fromNode",sourceNodeName:this.getNodeParameter("originalSourceNodeName",e,""),binaryPropertyName:t}:{mode:"fromInput",binaryPropertyName:t},s=i==="fromNode"?{mode:"fromNode",sourceNodeName:this.getNodeParameter("modifiedSourceNodeName",e,""),binaryPropertyName:r}:{mode:"fromInput",binaryPropertyName:r},{buffer:l,fileName:u}=await Be.call(this,e,a),{buffer:f,fileName:c}=await Be.call(this,e,s),d=await st(l,n),p=await st(f,n),g=Io(d,p,u,c);return [{json:{originalFileName:u,modifiedFileName:c,cleanView:n,diff:g},pairedItem:{item:e}}]}h(Fo,"executeGenerateDiff");var Lo=[{displayName:"Input Binary Property",name:"binaryPropertyName",type:"string",default:"data",required:true,placeholder:"e.g. data",description:"Name of the binary property holding the .docx file (string, e.g. 'data'). In 'From Connected Input' mode this reads from the current item; in 'From Another Node' mode this specifies which property on the source node's output to read. The file must be a valid .docx.",displayOptions:{show:{resource:["document"],operation:["finalizeDocument"]}}},{displayName:"Output Binary Property",name:"outputBinaryPropertyName",type:"string",default:"data",required:true,placeholder:"e.g. data",description:"Name of the binary property on the outgoing item that will hold the finalized .docx file (string, e.g. 'data'). If equal to the input property name, the original binary is overwritten on the outgoing item.",displayOptions:{show:{resource:["document"],operation:["finalizeDocument"]}}},{displayName:"Sanitize Mode",name:"sanitizeMode",type:"options",default:"full",description:"How aggressively to sanitize the document before distribution. One of: 'baseline' (minimal metadata cleanup only), 'full' (strip metadata AND require all tracked changes resolved or auto-accepted), 'keep-markup' (strip metadata but preserve visible tracked changes and comments, optionally with author rewrite).",options:[{name:"Baseline",value:"baseline",description:"Minimal sanitization: strip RSID attributes, paragraph IDs, and proof errors only. Leaves tracked changes, comments, authors, and other metadata untouched."},{name:"Full",value:"full",description:"Strip metadata (authors, RSIDs, paragraph IDs, proof errors) and require all tracked changes and comments to be resolved. If pending tracked changes exist and 'Accept All Tracked Changes' is false, the operation is blocked and an error is thrown."},{name:"Keep Markup",value:"keep-markup",description:"Strip metadata but preserve all visible tracked changes and comments. Use 'Author Override' to rewrite the author name on every preserved redline and comment (e.g. replace 'AI Reviewer' with your firm name)."}],displayOptions:{show:{resource:["document"],operation:["finalizeDocument"]}}},{displayName:"Accept All Tracked Changes",name:"acceptAll",type:"boolean",default:false,description:"Whether to auto-accept all pending tracked changes before sanitization. Only applies when Sanitize Mode is 'full'. When false (default), the operation throws an error if any pending tracked changes exist, forcing the caller to resolve them first. If multiple distinct authors are detected in pending changes, a warning is included in the report to alert you of potential silent smuggles.",displayOptions:{show:{resource:["document"],operation:["finalizeDocument"],sanitizeMode:["full"]}}},{displayName:"Author Override",name:"authorOverride",type:"string",default:"",placeholder:"e.g. My Firm",description:"Only applies when Sanitize Mode is 'keep-markup'. Optional string. When set, replaces the author name on every preserved tracked change and comment with this value (e.g. 'My Law Firm'). Leave empty to keep original authors intact.",displayOptions:{show:{resource:["document"],operation:["finalizeDocument"],sanitizeMode:["keep-markup"]}}},{displayName:"Protection Mode",name:"protectionMode",type:"options",default:"none",description:"Optionally lock the finalized document. 'none' (default) leaves the document unlocked. 'read_only' injects a native Word read-only enforcement flag into settings.xml \u2014 Word users see a read-only banner and cannot edit without explicitly unlocking. AES encryption is not supported in this engine.",options:[{name:"None",value:"none"},{name:"Read Only",value:"read_only"}],displayOptions:{show:{resource:["document"],operation:["finalizeDocument"]}}}];async function $o(e){let t=this.getNodeParameter("binaryPropertyName",e),r=this.getNodeParameter("outputBinaryPropertyName",e),n=this.getNodeParameter("sanitizeMode",e),o=false;n==="full"&&(o=this.getNodeParameter("acceptAll",e));let i=null;if(n==="keep-markup"){let w=this.getNodeParameter("authorOverride",e);i=w.trim()===""?null:w;}let s=this.getNodeParameter("protectionMode",e)==="read_only"?"read_only":null,u=this.getNodeParameter("documentSource",e,"fromInput")==="fromNode"?{mode:"fromNode",sourceNodeName:this.getNodeParameter("sourceNodeName",e,""),binaryPropertyName:t,sourceBinaryId:this.getNodeParameter("sourceBinaryId",e,"")}:{mode:"fromInput",binaryPropertyName:t},{buffer:f,fileName:c}=await Be.call(this,e,u),d=await nr.load(f),{reportText:p,outBuffer:g}=await Oo(d,{filename:c,sanitize_mode:n,accept_all:o,protection_mode:s,author:i});if(!g)throw new Error(p);let m=ar(c,"finalized"),b=await this.helpers.prepareBinaryData(g,m,et),y=this.getInputData()[e].binary??{};return [{json:{fileName:m,sanitizeMode:n,report:p},binary:{...y,[r]:b},pairedItem:{item:e}}]}h($o,"executeFinalizeDocument");var Uo=[{displayName:"Operation",name:"operation",type:"options",noDataExpression:true,displayOptions:{show:{resource:["document"]}},options:[{name:"Apply Edits",value:"applyEdits",action:"Apply a batch of tracked changes to the document",description:"Apply a JSON array of DocumentChange objects (modify, accept, reject, reply, insert_row, delete_row) as native Word tracked changes and comments. The whole batch is pre-validated atomically: if any single edit is invalid, the entire batch is rejected and the document is left untouched."},{name:"Extract Markdown",value:"extractMarkdown",action:"Extract a Markdown representation of the document",description:"Project the .docx into LLM-friendly Markdown with CriticMarkup ({++ins++}, {--del--}, {>>comment<<}) plus a Semantic Appendix listing defined terms, cross-references, and potential typos. Each tracked change is tagged with a stable id (Chg:N, Com:N) for use in Apply Edits."},{name:"Finalize Document",value:"finalizeDocument",action:"Sanitize metadata and lock the document for distribution",description:"Strip author names, internal IDs, RSIDs, and proof errors; optionally auto-accept all pending tracked changes; optionally lock the document read-only. Use before sending to counterparties or signers."},{name:"Generate Diff",value:"generateDiff",action:"Generate a Word Patch diff between two documents",description:"Produce a sub-word level @@ Word Patch @@ diff between two .docx files. Reads the document text via the same Markdown projection used by Extract Markdown, so the diff respects CriticMarkup and Clean View settings."},{name:"Hydrate Tool Output",value:"hydrateToolOutput",action:"Hydrate a redlined binary stashed by Apply Edits as a tool",description:"Read a binary's storage id from workflow static data (where Apply Edits stashes it when run as an AI Agent tool) and re-attach the binary to a main-flow item. Necessary because n8n's AI Agent tool wrapper strips binaries from tool outputs, so the redlined .docx produced by an apply_edits tool call cannot reach downstream nodes directly. Place this node downstream of the AI Agent on the main connection, then route its output into Write Binary File, Gmail (attachment), Slack (file upload), etc."}],default:"extractMarkdown"},{displayName:"Document Source",name:"documentSource",type:"options",default:"fromInput",description:"Where to read the .docx file from. 'From Connected Input' reads the binary on the current input item \u2014 use this in deterministic pipelines (e.g. Gmail Trigger \u2192 Adeu \u2192 Gmail Reply). 'From Another Node' fetches the binary from a named upstream node by name \u2014 use this when the Adeu node is called as an AI Agent tool, since the Agent cannot pass binary data through JSON arguments.",options:[{name:"From Connected Input",value:"fromInput",description:"Read the binary from the current item's binary attachment. Default behavior for deterministic workflows."},{name:"From Another Node",value:"fromNode",description:"Read the binary from a named upstream node. Required when this node is used as an AI Agent tool."}],displayOptions:{show:{resource:["document"],operation:["applyEdits","extractMarkdown","finalizeDocument"]}}},{displayName:"Source Node Name",name:"sourceNodeName",type:"string",default:"",required:true,placeholder:"e.g. Gmail Trigger",description:"Exact name of the node in this workflow whose output binary holds the .docx file (string, case-sensitive). Must match the node's label in the canvas exactly, including spaces and punctuation. The referenced node must have already executed in this run and produced binary output on the property named in 'Input Binary Property'.",displayOptions:{show:{resource:["document"],operation:["applyEdits","extractMarkdown","finalizeDocument"],documentSource:["fromNode"]}}},{displayName:"Source Binary ID",name:"sourceBinaryId",type:"string",default:"",placeholder:"e.g. filesystem-v2:...",description:"Optional. When set (such as by an AI Agent during a multi-turn conversation), the node will load the document directly from this binary storage ID instead of reading from the source node. Leave empty on the first call to default to the baseline source node.",displayOptions:{show:{resource:["document"],operation:["applyEdits","extractMarkdown","finalizeDocument"],documentSource:["fromNode"]}}},...ko,...Mo,...Bo,...Lo,...Pn];var zo=class{static{h(this,"Adeu");}description={displayName:"Adeu",name:"adeu",icon:"file:adeu.svg",group:["transform"],version:1,subtitle:'={{$parameter["operation"]}}',description:"Operate on Microsoft Word (.docx) files: extract LLM-friendly Markdown with CriticMarkup, apply tracked changes and comments, generate sub-word diffs, and sanitize/finalize documents. Four operations on the Document resource: (1) Extract Markdown \u2014 project a .docx into Markdown plus a Semantic Appendix (defined terms, cross-references, typos); toggle Clean View to simulate Accept All. (2) Apply Edits \u2014 apply a JSON array of DocumentChange objects as native Word tracked changes; the entire batch is pre-validated atomically and rejected if any single edit is invalid. (3) Generate Diff \u2014 produce a @@ Word Patch @@ sub-word level diff between two .docx files. (4) Finalize Document \u2014 strip metadata, optionally accept all pending markup, and optionally lock the file read-only. DocumentChange schema (used by Apply Edits): each object has a 'type' field discriminator. type='modify' requires target_text (string, copied EXACTLY from the source including punctuation, spacing, and case) and new_text (string); optional 'comment' attaches a comment bubble. type='accept' or type='reject' requires target_id (string like 'Chg:12' from the Markdown projection); optional 'comment'. type='reply' requires target_id (string like 'Com:45') and text (string). type='insert_row' requires target_text (string), position ('above' or 'below'), and cells (array of strings). type='delete_row' requires target_text (string). Never wrap new_text in CriticMarkup tags like {++ ++} or {-- --}; the engine applies tracking automatically. Never target text already wrapped in another author's pending tracked change; accept or reject their change first by target_id. Binary handling for AI Agents: this tool cannot receive .docx files through JSON arguments because JSON cannot carry binary data. To process a document, set 'Document Source' to 'From Another Node' and 'Source Node Name' to the exact name of the workflow node that produced the .docx binary (typically the trigger node, e.g. 'Gmail Trigger', 'When clicking Test workflow', or an HTTP Request node configured to download a file). Node names are case-sensitive and must match the canvas label exactly. For the Generate Diff operation, set both 'Original Source Node Name' and 'Modified Source Node Name' independently.",defaults:{name:"Adeu"},usableAsTool:true,inputs:[n8nWorkflow.NodeConnectionTypes.Main],outputs:[n8nWorkflow.NodeConnectionTypes.Main],credentials:[],properties:[{displayName:"Resource",name:"resource",type:"options",noDataExpression:true,options:[{name:"Document",value:"document"}],default:"document"},...Uo]};async execute(){let t=this.getInputData(),r=[],n=this.getNodeParameter("resource",0),o=this.getNodeParameter("operation",0);for(let i=0;i<t.length;i++)try{let a;if(n==="document")switch(o){case "extractMarkdown":a=await Po.call(this,i);break;case "applyEdits":a=await Ro.call(this,i);break;case "generateDiff":a=await Fo.call(this,i);break;case "finalizeDocument":a=await $o.call(this,i);break;case "hydrateToolOutput":a=await Mn.call(this,i);break;default:throw new Error(`Unsupported operation: ${o}`)}else throw new Error(`Unsupported resource: ${n}`);r.push(...a);}catch(a){if(this.continueOnFail()){r.push({json:{error:a.message},pairedItem:{item:i}});continue}let s=a;throw s.name==="NodeOperationError"||s.name==="NodeApiError"?s:On.call(this,s,i)}return [r]}};exports.Adeu=zo;
|
|
77
|
+
]`,required:true,description:`JSON-encoded string containing an array of DocumentChange objects. Each object has a 'type' field discriminator and type-specific fields. type='modify': requires target_text (string, copied EXACTLY from the source including punctuation, spacing, and case) and new_text (string); optional comment (string). Never include CriticMarkup tags like {++ ++} or {-- --} in new_text \u2014 the engine applies tracking automatically. Never target text already inside another author's pending tracked change. type='accept': requires target_id (string like 'Chg:12' from the Markdown projection); optional comment. type='reject': requires target_id (string like 'Chg:12'); optional comment. type='reply': requires target_id (string like 'Com:45') and text (string). type='insert_row': requires target_text (string anchoring a table cell), position ('above' or 'below'), and cells (array of strings, one per column). type='delete_row': requires target_text (string anchoring the row to delete). The whole batch is validated atomically: if any single edit fails (target text not found, ambiguous match, read-only target, overlapping another author's change), the entire batch is rejected and the document is left untouched. Example: '[{"type":"modify","target_text":"within thirty (30) days","new_text":"within forty-five (45) days","comment":"Per playbook."}]'. Markdown code fences (\`\`\`json ... \`\`\`) wrapping the value are stripped automatically.`,typeOptions:{rows:10},displayOptions:{show:{resource:["document"],operation:["applyEdits"],editsSource:["defineBelow"]}}},{displayName:"Return Markdown Output",name:"returnMarkdown",type:"boolean",default:true,description:"Whether to auto-extract the post-edit document as Markdown (with CriticMarkup) and include it in the outgoing JSON under the 'markdown' field. Useful for feeding the updated state back into a downstream AI Agent for review or further edits. Adds extraction overhead per call.",displayOptions:{show:{resource:["document"],operation:["applyEdits"]}}}];async function Ba(e){let t=this.getNodeParameter("binaryPropertyName",e),r=this.getNodeParameter("outputBinaryPropertyName",e),n=this.getNodeParameter("author",e),a=this.getNodeParameter("editsSource",e),i=this.getNodeParameter("returnMarkdown",e),o;if(a==="fromInputJson"){let D=this.getNodeParameter("editsJsonPath",e),y=this.getInputData()[e].json;if(o=kn(y,D),o===void 0)throw new Error(`No property "${D}" found on the input item JSON. Verify the upstream node produced it, or switch "Edits Source" to "Define Below".`)}else {let D=this.getNodeParameter("editsJson",e);o=Pn.call(this,D,e,"Changes (JSON)");}if(!Array.isArray(o))throw new Error("Changes must be an array of DocumentChange objects.");let l=this.getNodeParameter("documentSource",e,"fromInput")==="fromNode"?{mode:"fromNode",sourceNodeName:this.getNodeParameter("sourceNodeName",e,""),binaryPropertyName:t,sourceBinaryId:this.getNodeParameter("sourceBinaryId",e,"")}:{mode:"fromInput",binaryPropertyName:t},{buffer:s,fileName:f}=await Fe.call(this,e,l),c=await ar.load(s),p=new Sn(c,n).process_batch(o),m=await c.save(),g=ur(f,"redlined"),b=await this.helpers.prepareBinaryData(m,g,et),w=typeof this.isToolExecution=="function"&&this.isToolExecution(),v;if(w&&b.id){let D=this.getWorkflowStaticData("global");D.adeu_last_redlined={id:b.id,fileName:g,mimeType:et,timestamp:Date.now()},v=b.id;}let E;i&&(E=await st(m,false));let _=this.getInputData()[e].binary??{};return [{json:{fileName:g,author:n,stats:p,...E!==void 0?{markdown:E}:{},...v!==void 0?{redlinedBinaryId:v}:{}},binary:{..._,[r]:b},pairedItem:{item:e}}]}h(Ba,"executeApplyEdits");var Fa=[{displayName:"Original Document Source",name:"originalDocumentSource",type:"options",default:"fromInput",description:"Where to read the original (baseline) .docx file from. 'From Connected Input' reads from the current item; 'From Another Node' reads from a named upstream node \u2014 required when this node is called as an AI Agent tool.",options:[{name:"From Connected Input",value:"fromInput"},{name:"From Another Node",value:"fromNode"}],displayOptions:{show:{resource:["document"],operation:["generateDiff"]}}},{displayName:"Original Source Node Name",name:"originalSourceNodeName",type:"string",default:"",required:true,placeholder:"e.g. Download Original",description:"Exact name of the node whose output binary holds the original (baseline) .docx (string, case-sensitive). Must match the node label in the canvas exactly.",displayOptions:{show:{resource:["document"],operation:["generateDiff"],originalDocumentSource:["fromNode"]}}},{displayName:"Original Binary Property",name:"originalBinaryPropertyName",type:"string",default:"data",required:true,placeholder:"e.g. data",description:"Name of the binary property holding the original (baseline) .docx file (string, e.g. 'data'). In 'From Connected Input' mode this reads from the current item; in 'From Another Node' mode this specifies which property on the source node's output to read.",displayOptions:{show:{resource:["document"],operation:["generateDiff"]}}},{displayName:"Modified Document Source",name:"modifiedDocumentSource",type:"options",default:"fromInput",description:"Where to read the modified (compared-to) .docx file from. 'From Connected Input' reads from the current item; 'From Another Node' reads from a named upstream node \u2014 required when this node is called as an AI Agent tool.",options:[{name:"From Connected Input",value:"fromInput"},{name:"From Another Node",value:"fromNode"}],displayOptions:{show:{resource:["document"],operation:["generateDiff"]}}},{displayName:"Modified Source Node Name",name:"modifiedSourceNodeName",type:"string",default:"",required:true,placeholder:"e.g. Apply Edits",description:"Exact name of the node whose output binary holds the modified (compared-to) .docx (string, case-sensitive). Must match the node label in the canvas exactly.",displayOptions:{show:{resource:["document"],operation:["generateDiff"],modifiedDocumentSource:["fromNode"]}}},{displayName:"Modified Binary Property",name:"modifiedBinaryPropertyName",type:"string",default:"data2",required:true,placeholder:"e.g. data2",description:"Name of the binary property holding the modified (compared-to) .docx file (string, e.g. 'data2'). In 'From Connected Input' mode this reads from the current item and must be different from the original property; in 'From Another Node' mode this specifies which property on the source node's output to read.",displayOptions:{show:{resource:["document"],operation:["generateDiff"]}}},{displayName:"Clean View",name:"cleanView",type:"boolean",default:true,description:"Whether to compare the Accept All clean view of both documents. When true (default, recommended), diffs reflect the final content as if all tracked changes were accepted. When false, diffs the raw CriticMarkup-projected text including pending change markers \u2014 useful for auditing tracked-change differences themselves.",displayOptions:{show:{resource:["document"],operation:["generateDiff"]}}}];async function La(e){let t=this.getNodeParameter("originalBinaryPropertyName",e),r=this.getNodeParameter("modifiedBinaryPropertyName",e),n=this.getNodeParameter("cleanView",e),a=this.getNodeParameter("originalDocumentSource",e,"fromInput"),i=this.getNodeParameter("modifiedDocumentSource",e,"fromInput"),o=a==="fromNode"?{mode:"fromNode",sourceNodeName:this.getNodeParameter("originalSourceNodeName",e,""),binaryPropertyName:t}:{mode:"fromInput",binaryPropertyName:t},u=i==="fromNode"?{mode:"fromNode",sourceNodeName:this.getNodeParameter("modifiedSourceNodeName",e,""),binaryPropertyName:r}:{mode:"fromInput",binaryPropertyName:r},{buffer:l,fileName:s}=await Fe.call(this,e,o),{buffer:f,fileName:c}=await Fe.call(this,e,u),d=await st(l,n),p=await st(f,n),m=ka(d,p,s,c);return [{json:{originalFileName:s,modifiedFileName:c,cleanView:n,diff:m},pairedItem:{item:e}}]}h(La,"executeGenerateDiff");var $a=[{displayName:"Input Binary Property",name:"binaryPropertyName",type:"string",default:"data",required:true,placeholder:"e.g. data",description:"Name of the binary property holding the .docx file (string, e.g. 'data'). In 'From Connected Input' mode this reads from the current item; in 'From Another Node' mode this specifies which property on the source node's output to read. The file must be a valid .docx.",displayOptions:{show:{resource:["document"],operation:["finalizeDocument"]}}},{displayName:"Output Binary Property",name:"outputBinaryPropertyName",type:"string",default:"data",required:true,placeholder:"e.g. data",description:"Name of the binary property on the outgoing item that will hold the finalized .docx file (string, e.g. 'data'). If equal to the input property name, the original binary is overwritten on the outgoing item.",displayOptions:{show:{resource:["document"],operation:["finalizeDocument"]}}},{displayName:"Sanitize Mode",name:"sanitizeMode",type:"options",default:"full",description:"How aggressively to sanitize the document before distribution. One of: 'baseline' (minimal metadata cleanup only), 'full' (strip metadata AND require all tracked changes resolved or auto-accepted), 'keep-markup' (strip metadata but preserve visible tracked changes and comments, optionally with author rewrite).",options:[{name:"Baseline",value:"baseline",description:"Minimal sanitization: strip RSID attributes, paragraph IDs, and proof errors only. Leaves tracked changes, comments, authors, and other metadata untouched."},{name:"Full",value:"full",description:"Strip metadata (authors, RSIDs, paragraph IDs, proof errors) and require all tracked changes and comments to be resolved. If pending tracked changes exist and 'Accept All Tracked Changes' is false, the operation is blocked and an error is thrown."},{name:"Keep Markup",value:"keep-markup",description:"Strip metadata but preserve all visible tracked changes and comments. Use 'Author Override' to rewrite the author name on every preserved redline and comment (e.g. replace 'AI Reviewer' with your firm name)."}],displayOptions:{show:{resource:["document"],operation:["finalizeDocument"]}}},{displayName:"Accept All Tracked Changes",name:"acceptAll",type:"boolean",default:false,description:"Whether to auto-accept all pending tracked changes before sanitization. Only applies when Sanitize Mode is 'full'. When false (default), the operation throws an error if any pending tracked changes exist, forcing the caller to resolve them first. If multiple distinct authors are detected in pending changes, a warning is included in the report to alert you of potential silent smuggles.",displayOptions:{show:{resource:["document"],operation:["finalizeDocument"],sanitizeMode:["full"]}}},{displayName:"Author Override",name:"authorOverride",type:"string",default:"",placeholder:"e.g. My Firm",description:"Only applies when Sanitize Mode is 'keep-markup'. Optional string. When set, replaces the author name on every preserved tracked change and comment with this value (e.g. 'My Law Firm'). Leave empty to keep original authors intact.",displayOptions:{show:{resource:["document"],operation:["finalizeDocument"],sanitizeMode:["keep-markup"]}}},{displayName:"Protection Mode",name:"protectionMode",type:"options",default:"none",description:"Optionally lock the finalized document. 'none' (default) leaves the document unlocked. 'read_only' injects a native Word read-only enforcement flag into settings.xml \u2014 Word users see a read-only banner and cannot edit without explicitly unlocking. AES encryption is not supported in this engine.",options:[{name:"None",value:"none"},{name:"Read Only",value:"read_only"}],displayOptions:{show:{resource:["document"],operation:["finalizeDocument"]}}}];async function Ua(e){let t=this.getNodeParameter("binaryPropertyName",e),r=this.getNodeParameter("outputBinaryPropertyName",e),n=this.getNodeParameter("sanitizeMode",e),a=false;n==="full"&&(a=this.getNodeParameter("acceptAll",e));let i=null;if(n==="keep-markup"){let v=this.getNodeParameter("authorOverride",e);i=v.trim()===""?null:v;}let u=this.getNodeParameter("protectionMode",e)==="read_only"?"read_only":null,s=this.getNodeParameter("documentSource",e,"fromInput")==="fromNode"?{mode:"fromNode",sourceNodeName:this.getNodeParameter("sourceNodeName",e,""),binaryPropertyName:t,sourceBinaryId:this.getNodeParameter("sourceBinaryId",e,"")}:{mode:"fromInput",binaryPropertyName:t},{buffer:f,fileName:c}=await Fe.call(this,e,s),d=await ar.load(f),{reportText:p,outBuffer:m}=await Pa(d,{filename:c,sanitize_mode:n,accept_all:a,protection_mode:u,author:i});if(!m)throw new Error(p);let g=ur(c,"finalized"),b=await this.helpers.prepareBinaryData(m,g,et),w=this.getInputData()[e].binary??{};return [{json:{fileName:g,sanitizeMode:n,report:p},binary:{...w,[r]:b},pairedItem:{item:e}}]}h(Ua,"executeFinalizeDocument");var qa=[{displayName:"Operation",name:"operation",type:"options",noDataExpression:true,displayOptions:{show:{resource:["document"]}},options:[{name:"Apply Edits",value:"applyEdits",action:"Apply a batch of tracked changes to the document",description:"Apply a JSON array of DocumentChange objects (modify, accept, reject, reply, insert_row, delete_row) as native Word tracked changes and comments. The whole batch is pre-validated atomically: if any single edit is invalid, the entire batch is rejected and the document is left untouched."},{name:"Extract Markdown",value:"extractMarkdown",action:"Extract a Markdown representation of the document",description:"Project the .docx into LLM-friendly Markdown with CriticMarkup ({++ins++}, {--del--}, {>>comment<<}) plus a Semantic Appendix listing defined terms, cross-references, and potential typos. Each tracked change is tagged with a stable id (Chg:N, Com:N) for use in Apply Edits."},{name:"Finalize Document",value:"finalizeDocument",action:"Sanitize metadata and lock the document for distribution",description:"Strip author names, internal IDs, RSIDs, and proof errors; optionally auto-accept all pending tracked changes; optionally lock the document read-only. Use before sending to counterparties or signers."},{name:"Generate Diff",value:"generateDiff",action:"Generate a Word Patch diff between two documents",description:"Produce a sub-word level @@ Word Patch @@ diff between two .docx files. Reads the document text via the same Markdown projection used by Extract Markdown, so the diff respects CriticMarkup and Clean View settings."},{name:"Hydrate Tool Output",value:"hydrateToolOutput",action:"Hydrate a redlined binary stashed by Apply Edits as a tool",description:"Read a binary's storage id from workflow static data (where Apply Edits stashes it when run as an AI Agent tool) and re-attach the binary to a main-flow item. Necessary because n8n's AI Agent tool wrapper strips binaries from tool outputs, so the redlined .docx produced by an apply_edits tool call cannot reach downstream nodes directly. Place this node downstream of the AI Agent on the main connection, then route its output into Write Binary File, Gmail (attachment), Slack (file upload), etc."}],default:"extractMarkdown"},{displayName:"Document Source",name:"documentSource",type:"options",default:"fromInput",description:"Where to read the .docx file from. 'From Connected Input' reads the binary on the current input item \u2014 use this in deterministic pipelines (e.g. Gmail Trigger \u2192 Adeu \u2192 Gmail Reply). 'From Another Node' fetches the binary from a named upstream node by name \u2014 use this when the Adeu node is called as an AI Agent tool, since the Agent cannot pass binary data through JSON arguments.",options:[{name:"From Connected Input",value:"fromInput",description:"Read the binary from the current item's binary attachment. Default behavior for deterministic workflows."},{name:"From Another Node",value:"fromNode",description:"Read the binary from a named upstream node. Required when this node is used as an AI Agent tool."}],displayOptions:{show:{resource:["document"],operation:["applyEdits","extractMarkdown","finalizeDocument"]}}},{displayName:"Source Node Name",name:"sourceNodeName",type:"string",default:"",required:true,placeholder:"e.g. Gmail Trigger",description:"Exact name of the node in this workflow whose output binary holds the .docx file (string, case-sensitive). Must match the node's label in the canvas exactly, including spaces and punctuation. The referenced node must have already executed in this run and produced binary output on the property named in 'Input Binary Property'.",displayOptions:{show:{resource:["document"],operation:["applyEdits","extractMarkdown","finalizeDocument"],documentSource:["fromNode"]}}},{displayName:"Source Binary ID",name:"sourceBinaryId",type:"string",default:"",placeholder:"e.g. filesystem-v2:...",description:"Optional. When set (such as by an AI Agent during a multi-turn conversation), the node will load the document directly from this binary storage ID instead of reading from the source node. Leave empty on the first call to default to the baseline source node.",displayOptions:{show:{resource:["document"],operation:["applyEdits","extractMarkdown","finalizeDocument"],documentSource:["fromNode"]}}},...Oa,...Ra,...Fa,...$a,...Rn];var ja=class{static{h(this,"Adeu");}description={displayName:"Adeu",name:"adeu",icon:"file:adeu.svg",group:["transform"],version:1,subtitle:'={{$parameter["operation"]}}',description:"Operate on Microsoft Word (.docx) files: extract LLM-friendly Markdown with CriticMarkup, apply tracked changes and comments, generate sub-word diffs, and sanitize/finalize documents. Four operations on the Document resource: (1) Extract Markdown \u2014 project a .docx into Markdown plus a Semantic Appendix (defined terms, cross-references, typos); toggle Clean View to simulate Accept All. (2) Apply Edits \u2014 apply a JSON array of DocumentChange objects as native Word tracked changes; the entire batch is pre-validated atomically and rejected if any single edit is invalid. (3) Generate Diff \u2014 produce a @@ Word Patch @@ sub-word level diff between two .docx files. (4) Finalize Document \u2014 strip metadata, optionally accept all pending markup, and optionally lock the file read-only. DocumentChange schema (used by Apply Edits): each object has a 'type' field discriminator. type='modify' requires target_text (string, copied EXACTLY from the source including punctuation, spacing, and case) and new_text (string); optional 'comment' attaches a comment bubble. type='accept' or type='reject' requires target_id (string like 'Chg:12' from the Markdown projection); optional 'comment'. type='reply' requires target_id (string like 'Com:45') and text (string). type='insert_row' requires target_text (string), position ('above' or 'below'), and cells (array of strings). type='delete_row' requires target_text (string). Never wrap new_text in CriticMarkup tags like {++ ++} or {-- --}; the engine applies tracking automatically. Never target text already wrapped in another author's pending tracked change; accept or reject their change first by target_id. Binary handling for AI Agents: this tool cannot receive .docx files through JSON arguments because JSON cannot carry binary data. To process a document, set 'Document Source' to 'From Another Node' and 'Source Node Name' to the exact name of the workflow node that produced the .docx binary (typically the trigger node, e.g. 'Gmail Trigger', 'When clicking Test workflow', or an HTTP Request node configured to download a file). Node names are case-sensitive and must match the canvas label exactly. For the Generate Diff operation, set both 'Original Source Node Name' and 'Modified Source Node Name' independently.",defaults:{name:"Adeu"},usableAsTool:true,inputs:[n8nWorkflow.NodeConnectionTypes.Main],outputs:[n8nWorkflow.NodeConnectionTypes.Main],credentials:[],properties:[{displayName:"Resource",name:"resource",type:"options",noDataExpression:true,options:[{name:"Document",value:"document"}],default:"document"},...qa]};async execute(){let t=this.getInputData(),r=[],n=this.getNodeParameter("resource",0),a=this.getNodeParameter("operation",0);for(let i=0;i<t.length;i++)try{let o;if(n==="document")switch(a){case "extractMarkdown":o=await Ma.call(this,i);break;case "applyEdits":o=await Ba.call(this,i);break;case "generateDiff":o=await La.call(this,i);break;case "finalizeDocument":o=await Ua.call(this,i);break;case "hydrateToolOutput":o=await Bn.call(this,i);break;default:throw new Error(`Unsupported operation: ${a}`)}else throw new Error(`Unsupported resource: ${n}`);r.push(...o);}catch(o){if(this.continueOnFail()){r.push({json:{error:o.message},pairedItem:{item:i}});continue}let u=o;throw u.name==="NodeOperationError"||u.name==="NodeApiError"?u:On.call(this,u,i)}return [r]}};exports.Adeu=ja;
|