@loaders.gl/xml
Advanced tools
Comparing version 4.2.0-alpha.6 to 4.2.0-beta.1
@@ -7,12 +7,12 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
else root['loaders'] = factory();})(globalThis, function () { | ||
"use strict";var __exports__=(()=>{var Ut=Object.create;var C=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var Gt=Object.getOwnPropertyNames;var $t=Object.getPrototypeOf,qt=Object.prototype.hasOwnProperty;var Wt=(e,t,i)=>t in e?C(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var m=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),kt=(e,t)=>{for(var i in t)C(e,i,{get:t[i],enumerable:!0})},B=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Gt(t))!qt.call(e,r)&&r!==i&&C(e,r,{get:()=>t[r],enumerable:!(s=vt(t,r))||s.enumerable});return e},M=(e,t,i)=>(B(e,t,"default"),i&&B(i,t,"default")),Z=(e,t,i)=>(i=e!=null?Ut($t(e)):{},B(t||!e||!e.__esModule?C(i,"default",{value:e,enumerable:!0}):i,e)),Yt=e=>B(C({},"__esModule",{value:!0}),e);var j=(e,t,i)=>(Wt(e,typeof t!="symbol"?t+"":t,i),i);var D=m((cs,J)=>{J.exports=globalThis.loaders});var R=m(E=>{"use strict";var et=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",Zt=et+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",st="["+et+"]["+Zt+"]*",jt=new RegExp("^"+st+"$"),Jt=function(e,t){let i=[],s=t.exec(e);for(;s;){let r=[];r.startIndex=t.lastIndex-s[0].length;let n=s.length;for(let h=0;h<n;h++)r.push(s[h]);i.push(r),s=t.exec(e)}return i},Dt=function(e){let t=jt.exec(e);return!(t===null||typeof t>"u")};E.isExist=function(e){return typeof e<"u"};E.isEmptyObject=function(e){return Object.keys(e).length===0};E.merge=function(e,t,i){if(t){let s=Object.keys(t),r=s.length;for(let n=0;n<r;n++)i==="strict"?e[s[n]]=[t[s[n]]]:e[s[n]]=t[s[n]]}};E.getValue=function(e){return E.isExist(e)?e:""};E.isName=Dt;E.getAllMatches=Jt;E.nameRegexp=st});var G=m(at=>{"use strict";var v=R(),te={allowBooleanAttributes:!1,unpairedTags:[]};at.validate=function(e,t){t=Object.assign({},te,t);let i=[],s=!1,r=!1;e[0]==="\uFEFF"&&(e=e.substr(1));for(let n=0;n<e.length;n++)if(e[n]==="<"&&e[n+1]==="?"){if(n+=2,n=rt(e,n),n.err)return n}else if(e[n]==="<"){let h=n;if(n++,e[n]==="!"){n=nt(e,n);continue}else{let a=!1;e[n]==="/"&&(a=!0,n++);let o="";for(;n<e.length&&e[n]!==">"&&e[n]!==" "&&e[n]!==" "&&e[n]!==` | ||
"use strict";var __exports__=(()=>{var Ut=Object.create;var C=Object.defineProperty;var vt=Object.getOwnPropertyDescriptor;var Gt=Object.getOwnPropertyNames;var $t=Object.getPrototypeOf,qt=Object.prototype.hasOwnProperty;var Wt=(e,t,i)=>t in e?C(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var m=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),kt=(e,t)=>{for(var i in t)C(e,i,{get:t[i],enumerable:!0})},M=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Gt(t))!qt.call(e,r)&&r!==i&&C(e,r,{get:()=>t[r],enumerable:!(s=vt(t,r))||s.enumerable});return e},B=(e,t,i)=>(M(e,t,"default"),i&&M(i,t,"default")),Z=(e,t,i)=>(i=e!=null?Ut($t(e)):{},M(t||!e||!e.__esModule?C(i,"default",{value:e,enumerable:!0}):i,e)),Yt=e=>M(C({},"__esModule",{value:!0}),e);var J=(e,t,i)=>(Wt(e,typeof t!="symbol"?t+"":t,i),i);var D=m((cs,j)=>{j.exports=globalThis.loaders});var R=m(E=>{"use strict";var et=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",Zt=et+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",st="["+et+"]["+Zt+"]*",Jt=new RegExp("^"+st+"$"),jt=function(e,t){let i=[],s=t.exec(e);for(;s;){let r=[];r.startIndex=t.lastIndex-s[0].length;let n=s.length;for(let h=0;h<n;h++)r.push(s[h]);i.push(r),s=t.exec(e)}return i},Dt=function(e){let t=Jt.exec(e);return!(t===null||typeof t>"u")};E.isExist=function(e){return typeof e<"u"};E.isEmptyObject=function(e){return Object.keys(e).length===0};E.merge=function(e,t,i){if(t){let s=Object.keys(t),r=s.length;for(let n=0;n<r;n++)i==="strict"?e[s[n]]=[t[s[n]]]:e[s[n]]=t[s[n]]}};E.getValue=function(e){return E.isExist(e)?e:""};E.isName=Dt;E.getAllMatches=jt;E.nameRegexp=st});var G=m(at=>{"use strict";var v=R(),te={allowBooleanAttributes:!1,unpairedTags:[]};at.validate=function(e,t){t=Object.assign({},te,t);let i=[],s=!1,r=!1;e[0]==="\uFEFF"&&(e=e.substr(1));for(let n=0;n<e.length;n++)if(e[n]==="<"&&e[n+1]==="?"){if(n+=2,n=rt(e,n),n.err)return n}else if(e[n]==="<"){let h=n;if(n++,e[n]==="!"){n=nt(e,n);continue}else{let a=!1;e[n]==="/"&&(a=!0,n++);let o="";for(;n<e.length&&e[n]!==">"&&e[n]!==" "&&e[n]!==" "&&e[n]!==` | ||
`&&e[n]!=="\r";n++)o+=e[n];if(o=o.trim(),o[o.length-1]==="/"&&(o=o.substring(0,o.length-1),n--),!he(o)){let f;return o.trim().length===0?f="Invalid space after '<'.":f="Tag '"+o+"' is an invalid name.",d("InvalidTag",f,T(e,n))}let c=ie(e,n);if(c===!1)return d("InvalidAttr","Attributes for '"+o+"' have open quote.",T(e,n));let u=c.value;if(n=c.index,u[u.length-1]==="/"){let f=n-u.length;u=u.substring(0,u.length-1);let g=ot(u,t);if(g===!0)s=!0;else return d(g.err.code,g.err.msg,T(e,f+g.err.line))}else if(a)if(c.tagClosed){if(u.trim().length>0)return d("InvalidTag","Closing tag '"+o+"' can't have attributes or invalid starting.",T(e,h));{let f=i.pop();if(o!==f.tagName){let g=T(e,f.tagStartPos);return d("InvalidTag","Expected closing tag '"+f.tagName+"' (opened in line "+g.line+", col "+g.col+") instead of closing tag '"+o+"'.",T(e,h))}i.length==0&&(r=!0)}}else return d("InvalidTag","Closing tag '"+o+"' doesn't have proper closing.",T(e,n));else{let f=ot(u,t);if(f!==!0)return d(f.err.code,f.err.msg,T(e,n-u.length+f.err.line));if(r===!0)return d("InvalidXml","Multiple possible root nodes found.",T(e,n));t.unpairedTags.indexOf(o)!==-1||i.push({tagName:o,tagStartPos:h}),s=!0}for(n++;n<e.length;n++)if(e[n]==="<")if(e[n+1]==="!"){n++,n=nt(e,n);continue}else if(e[n+1]==="?"){if(n=rt(e,++n),n.err)return n}else break;else if(e[n]==="&"){let f=oe(e,n);if(f==-1)return d("InvalidChar","char '&' is not expected.",T(e,n));n=f}else if(r===!0&&!it(e[n]))return d("InvalidXml","Extra text at the end",T(e,n));e[n]==="<"&&n--}}else{if(it(e[n]))continue;return d("InvalidChar","char '"+e[n]+"' is not expected.",T(e,n))}if(s){if(i.length==1)return d("InvalidTag","Unclosed tag '"+i[0].tagName+"'.",T(e,i[0].tagStartPos));if(i.length>0)return d("InvalidXml","Invalid '"+JSON.stringify(i.map(n=>n.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return d("InvalidXml","Start tag expected.",1);return!0};function it(e){return e===" "||e===" "||e===` | ||
`||e==="\r"}function rt(e,t){let i=t;for(;t<e.length;t++)if(e[t]=="?"||e[t]==" "){let s=e.substr(i,t-i);if(t>5&&s==="xml")return d("InvalidXml","XML declaration allowed only at the start of the document.",T(e,t));if(e[t]=="?"&&e[t+1]==">"){t++;break}else continue}return t}function nt(e,t){if(e.length>t+5&&e[t+1]==="-"&&e[t+2]==="-"){for(t+=3;t<e.length;t++)if(e[t]==="-"&&e[t+1]==="-"&&e[t+2]===">"){t+=2;break}}else if(e.length>t+8&&e[t+1]==="D"&&e[t+2]==="O"&&e[t+3]==="C"&&e[t+4]==="T"&&e[t+5]==="Y"&&e[t+6]==="P"&&e[t+7]==="E"){let i=1;for(t+=8;t<e.length;t++)if(e[t]==="<")i++;else if(e[t]===">"&&(i--,i===0))break}else if(e.length>t+9&&e[t+1]==="["&&e[t+2]==="C"&&e[t+3]==="D"&&e[t+4]==="A"&&e[t+5]==="T"&&e[t+6]==="A"&&e[t+7]==="["){for(t+=8;t<e.length;t++)if(e[t]==="]"&&e[t+1]==="]"&&e[t+2]===">"){t+=2;break}}return t}var ee='"',se="'";function ie(e,t){let i="",s="",r=!1;for(;t<e.length;t++){if(e[t]===ee||e[t]===se)s===""?s=e[t]:s!==e[t]||(s="");else if(e[t]===">"&&s===""){r=!0;break}i+=e[t]}return s!==""?!1:{value:i,index:t,tagClosed:r}}var re=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function ot(e,t){let i=v.getAllMatches(e,re),s={};for(let r=0;r<i.length;r++){if(i[r][1].length===0)return d("InvalidAttr","Attribute '"+i[r][2]+"' has no space in starting.",_(i[r]));if(i[r][3]!==void 0&&i[r][4]===void 0)return d("InvalidAttr","Attribute '"+i[r][2]+"' is without value.",_(i[r]));if(i[r][3]===void 0&&!t.allowBooleanAttributes)return d("InvalidAttr","boolean attribute '"+i[r][2]+"' is not allowed.",_(i[r]));let n=i[r][2];if(!ae(n))return d("InvalidAttr","Attribute '"+n+"' is an invalid name.",_(i[r]));if(!s.hasOwnProperty(n))s[n]=1;else return d("InvalidAttr","Attribute '"+n+"' is repeated.",_(i[r]))}return!0}function ne(e,t){let i=/\d/;for(e[t]==="x"&&(t++,i=/[\da-fA-F]/);t<e.length;t++){if(e[t]===";")return t;if(!e[t].match(i))break}return-1}function oe(e,t){if(t++,e[t]===";")return-1;if(e[t]==="#")return t++,ne(e,t);let i=0;for(;t<e.length;t++,i++)if(!(e[t].match(/\w/)&&i<20)){if(e[t]===";")break;return-1}return t}function d(e,t,i){return{err:{code:e,msg:t,line:i.line||i,col:i.col}}}function ae(e){return v.isName(e)}function he(e){return v.isName(e)}function T(e,t){let i=e.substring(0,t).split(/\r?\n/);return{line:i.length,col:i[i.length-1].length+1}}function _(e){return e.startIndex+e[1].length}});var ct=m($=>{var ht={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,i){return e}},ce=function(e){return Object.assign({},ht,e)};$.buildOptions=ce;$.defaultOptions=ht});var ut=m((Ns,lt)=>{"use strict";var q=class{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,i){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:i})}addChild(t){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,[":@"]:t[":@"]}):this.child.push({[t.tagname]:t.child})}};lt.exports=q});var pt=m((Ts,ft)=>{var le=R();function ue(e,t){let i={};if(e[t+3]==="O"&&e[t+4]==="C"&&e[t+5]==="T"&&e[t+6]==="Y"&&e[t+7]==="P"&&e[t+8]==="E"){t=t+9;let s=1,r=!1,n=!1,h="";for(;t<e.length;t++)if(e[t]==="<"&&!n){if(r&&de(e,t))t+=7,[entityName,val,t]=fe(e,t+1),val.indexOf("&")===-1&&(i[me(entityName)]={regx:RegExp(`&${entityName};`,"g"),val});else if(r&&ge(e,t))t+=8;else if(r&&Ne(e,t))t+=8;else if(r&&Te(e,t))t+=9;else if(pe)n=!0;else throw new Error("Invalid DOCTYPE");s++,h=""}else if(e[t]===">"){if(n?e[t-1]==="-"&&e[t-2]==="-"&&(n=!1,s--):s--,s===0)break}else e[t]==="["?r=!0:h+=e[t];if(s!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:i,i:t}}function fe(e,t){let i="";for(;t<e.length&&e[t]!=="'"&&e[t]!=='"';t++)i+=e[t];if(i=i.trim(),i.indexOf(" ")!==-1)throw new Error("External entites are not supported");let s=e[t++],r="";for(;t<e.length&&e[t]!==s;t++)r+=e[t];return[i,r,t]}function pe(e,t){return e[t+1]==="!"&&e[t+2]==="-"&&e[t+3]==="-"}function de(e,t){return e[t+1]==="!"&&e[t+2]==="E"&&e[t+3]==="N"&&e[t+4]==="T"&&e[t+5]==="I"&&e[t+6]==="T"&&e[t+7]==="Y"}function ge(e,t){return e[t+1]==="!"&&e[t+2]==="E"&&e[t+3]==="L"&&e[t+4]==="E"&&e[t+5]==="M"&&e[t+6]==="E"&&e[t+7]==="N"&&e[t+8]==="T"}function Ne(e,t){return e[t+1]==="!"&&e[t+2]==="A"&&e[t+3]==="T"&&e[t+4]==="T"&&e[t+5]==="L"&&e[t+6]==="I"&&e[t+7]==="S"&&e[t+8]==="T"}function Te(e,t){return e[t+1]==="!"&&e[t+2]==="N"&&e[t+3]==="O"&&e[t+4]==="T"&&e[t+5]==="A"&&e[t+6]==="T"&&e[t+7]==="I"&&e[t+8]==="O"&&e[t+9]==="N"}function me(e){if(le.isName(e))return e;throw new Error(`Invalid entity name ${e}`)}ft.exports=ue});var gt=m((ms,dt)=>{var Ee=/^[-+]?0x[a-fA-F0-9]+$/,be=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt);!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);var Se={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function Ae(e,t={}){if(t=Object.assign({},Se,t),!e||typeof e!="string")return e;let i=e.trim();if(t.skipLike!==void 0&&t.skipLike.test(i))return e;if(t.hex&&Ee.test(i))return Number.parseInt(i,16);{let s=be.exec(i);if(s){let r=s[1],n=s[2],h=Ie(s[3]),a=s[4]||s[6];if(!t.leadingZeros&&n.length>0&&r&&i[2]!==".")return e;if(!t.leadingZeros&&n.length>0&&!r&&i[1]!==".")return e;{let o=Number(i),c=""+o;return c.search(/[eE]/)!==-1||a?t.eNotation?o:e:i.indexOf(".")!==-1?c==="0"&&h===""||c===h||r&&c==="-"+h?o:e:n?h===c||r+h===c?o:e:i===c||i===r+c?o:e}}else return e}}function Ie(e){return e&&e.indexOf(".")!==-1&&(e=e.replace(/0+$/,""),e==="."?e="0":e[0]==="."?e="0"+e:e[e.length-1]==="."&&(e=e.substr(0,e.length-1))),e}dt.exports=Ae});var Tt=m((bs,Nt)=>{"use strict";var X=R(),P=ut(),ye=pt(),xe=gt(),Es="<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,X.nameRegexp),W=class{constructor(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"\xA2"},pound:{regex:/&(pound|#163);/g,val:"\xA3"},yen:{regex:/&(yen|#165);/g,val:"\xA5"},euro:{regex:/&(euro|#8364);/g,val:"\u20AC"},copyright:{regex:/&(copy|#169);/g,val:"\xA9"},reg:{regex:/&(reg|#174);/g,val:"\xAE"},inr:{regex:/&(inr|#8377);/g,val:"\u20B9"}},this.addExternalEntities=Ce,this.parseXml=we,this.parseTextData=Fe,this.resolveNameSpace=Oe,this.buildAttributesMap=Pe,this.isItStopNode=Re,this.replaceEntitiesValue=Be,this.readStopNodeData=Ue,this.saveTextToParentTag=Me,this.addChild=Le}};function Ce(e){let t=Object.keys(e);for(let i=0;i<t.length;i++){let s=t[i];this.lastEntities[s]={regex:new RegExp("&"+s+";","g"),val:e[s]}}}function Fe(e,t,i,s,r,n,h){if(e!==void 0&&(this.options.trimValues&&!s&&(e=e.trim()),e.length>0)){h||(e=this.replaceEntitiesValue(e));let a=this.options.tagValueProcessor(t,e,i,r,n);return a==null?e:typeof a!=typeof e||a!==e?a:this.options.trimValues?Y(e,this.options.parseTagValue,this.options.numberParseOptions):e.trim()===e?Y(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function Oe(e){if(this.options.removeNSPrefix){let t=e.split(":"),i=e.charAt(0)==="/"?"/":"";if(t[0]==="xmlns")return"";t.length===2&&(e=i+t[1])}return e}var _e=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Pe(e,t,i){if(!this.options.ignoreAttributes&&typeof e=="string"){let s=X.getAllMatches(e,_e),r=s.length,n={};for(let h=0;h<r;h++){let a=this.resolveNameSpace(s[h][1]),o=s[h][4],c=this.options.attributeNamePrefix+a;if(a.length)if(this.options.transformAttributeName&&(c=this.options.transformAttributeName(c)),c==="__proto__"&&(c="#__proto__"),o!==void 0){this.options.trimValues&&(o=o.trim()),o=this.replaceEntitiesValue(o);let u=this.options.attributeValueProcessor(a,o,t);u==null?n[c]=o:typeof u!=typeof o||u!==o?n[c]=u:n[c]=Y(o,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(n[c]=!0)}if(!Object.keys(n).length)return;if(this.options.attributesGroupName){let h={};return h[this.options.attributesGroupName]=n,h}return n}}var we=function(e){e=e.replace(/\r\n?/g,` | ||
`);let t=new P("!xml"),i=t,s="",r="";for(let n=0;n<e.length;n++)if(e[n]==="<")if(e[n+1]==="/"){let a=A(e,">",n,"Closing Tag is not closed."),o=e.substring(n+2,a).trim();if(this.options.removeNSPrefix){let f=o.indexOf(":");f!==-1&&(o=o.substr(f+1))}this.options.transformTagName&&(o=this.options.transformTagName(o)),i&&(s=this.saveTextToParentTag(s,i,r));let c=r.substring(r.lastIndexOf(".")+1);if(o&&this.options.unpairedTags.indexOf(o)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${o}>`);let u=0;c&&this.options.unpairedTags.indexOf(c)!==-1?(u=r.lastIndexOf(".",r.lastIndexOf(".")-1),this.tagsNodeStack.pop()):u=r.lastIndexOf("."),r=r.substring(0,u),i=this.tagsNodeStack.pop(),s="",n=a}else if(e[n+1]==="?"){let a=k(e,n,!1,"?>");if(!a)throw new Error("Pi Tag is not closed.");if(s=this.saveTextToParentTag(s,i,r),!(this.options.ignoreDeclaration&&a.tagName==="?xml"||this.options.ignorePiTags)){let o=new P(a.tagName);o.add(this.options.textNodeName,""),a.tagName!==a.tagExp&&a.attrExpPresent&&(o[":@"]=this.buildAttributesMap(a.tagExp,r,a.tagName)),this.addChild(i,o,r)}n=a.closeIndex+1}else if(e.substr(n+1,3)==="!--"){let a=A(e,"-->",n+4,"Comment is not closed.");if(this.options.commentPropName){let o=e.substring(n+4,a-2);s=this.saveTextToParentTag(s,i,r),i.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}n=a}else if(e.substr(n+1,2)==="!D"){let a=ye(e,n);this.docTypeEntities=a.entities,n=a.i}else if(e.substr(n+1,2)==="!["){let a=A(e,"]]>",n,"CDATA is not closed.")-2,o=e.substring(n+9,a);if(s=this.saveTextToParentTag(s,i,r),this.options.cdataPropName)i.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]);else{let c=this.parseTextData(o,i.tagname,r,!0,!1,!0);c==null&&(c=""),i.add(this.options.textNodeName,c)}n=a+2}else{let a=k(e,n,this.options.removeNSPrefix),o=a.tagName,c=a.tagExp,u=a.attrExpPresent,f=a.closeIndex;this.options.transformTagName&&(o=this.options.transformTagName(o)),i&&s&&i.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,i,r,!1));let g=i;if(g&&this.options.unpairedTags.indexOf(g.tagname)!==-1&&(i=this.tagsNodeStack.pop(),r=r.substring(0,r.lastIndexOf("."))),o!==t.tagname&&(r+=r?"."+o:o),this.isItStopNode(this.options.stopNodes,r,o)){let p="";if(c.length>0&&c.lastIndexOf("/")===c.length-1)n=a.closeIndex;else if(this.options.unpairedTags.indexOf(o)!==-1)n=a.closeIndex;else{let x=this.readStopNodeData(e,o,f+1);if(!x)throw new Error(`Unexpected end of ${o}`);n=x.i,p=x.tagContent}let N=new P(o);o!==c&&u&&(N[":@"]=this.buildAttributesMap(c,r,o)),p&&(p=this.parseTextData(p,o,r,!0,u,!0,!0)),r=r.substr(0,r.lastIndexOf(".")),N.add(this.options.textNodeName,p),this.addChild(i,N,r)}else{if(c.length>0&&c.lastIndexOf("/")===c.length-1){o[o.length-1]==="/"?(o=o.substr(0,o.length-1),c=o):c=c.substr(0,c.length-1),this.options.transformTagName&&(o=this.options.transformTagName(o));let p=new P(o);o!==c&&u&&(p[":@"]=this.buildAttributesMap(c,r,o)),this.addChild(i,p,r),r=r.substr(0,r.lastIndexOf("."))}else{let p=new P(o);this.tagsNodeStack.push(i),o!==c&&u&&(p[":@"]=this.buildAttributesMap(c,r,o)),this.addChild(i,p,r),i=p}s="",n=f}}else s+=e[n];return t.child};function Le(e,t,i){let s=this.options.updateTag(t.tagname,i,t[":@"]);s===!1||(typeof s=="string"&&(t.tagname=s),e.addChild(t))}var Be=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){let i=this.docTypeEntities[t];e=e.replace(i.regx,i.val)}for(let t in this.lastEntities){let i=this.lastEntities[t];e=e.replace(i.regex,i.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){let i=this.htmlEntities[t];e=e.replace(i.regex,i.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function Me(e,t,i,s){return e&&(s===void 0&&(s=Object.keys(t.child).length===0),e=this.parseTextData(e,t.tagname,i,!1,t[":@"]?Object.keys(t[":@"]).length!==0:!1,s),e!==void 0&&e!==""&&t.add(this.options.textNodeName,e),e=""),e}function Re(e,t,i){let s="*."+i;for(let r in e){let n=e[r];if(s===n||t===n)return!0}return!1}function Ve(e,t,i=">"){let s,r="";for(let n=t;n<e.length;n++){let h=e[n];if(s)h===s&&(s="");else if(h==='"'||h==="'")s=h;else if(h===i[0])if(i[1]){if(e[n+1]===i[1])return{data:r,index:n}}else return{data:r,index:n};else h===" "&&(h=" ");r+=h}}function A(e,t,i,s){let r=e.indexOf(t,i);if(r===-1)throw new Error(s);return r+t.length-1}function k(e,t,i,s=">"){let r=Ve(e,t+1,s);if(!r)return;let n=r.data,h=r.index,a=n.search(/\s/),o=n,c=!0;if(a!==-1&&(o=n.substr(0,a).replace(/\s\s*$/,""),n=n.substr(a+1)),i){let u=o.indexOf(":");u!==-1&&(o=o.substr(u+1),c=o!==r.data.substr(u+1))}return{tagName:o,tagExp:n,closeIndex:h,attrExpPresent:c}}function Ue(e,t,i){let s=i,r=1;for(;i<e.length;i++)if(e[i]==="<")if(e[i+1]==="/"){let n=A(e,">",i,`${t} is not closed`);if(e.substring(i+2,n).trim()===t&&(r--,r===0))return{tagContent:e.substring(s,i),i:n};i=n}else if(e[i+1]==="?")i=A(e,"?>",i+1,"StopNode is not closed.");else if(e.substr(i+1,3)==="!--")i=A(e,"-->",i+3,"StopNode is not closed.");else if(e.substr(i+1,2)==="![")i=A(e,"]]>",i,"StopNode is not closed.")-2;else{let n=k(e,i,">");n&&((n&&n.tagName)===t&&n.tagExp[n.tagExp.length-1]!=="/"&&r++,i=n.closeIndex)}}function Y(e,t,i){if(t&&typeof e=="string"){let s=e.trim();return s==="true"?!0:s==="false"?!1:xe(e,i)}else return X.isExist(e)?e:""}Nt.exports=W});var bt=m(Et=>{"use strict";function ve(e,t){return mt(e,t)}function mt(e,t,i){let s,r={};for(let n=0;n<e.length;n++){let h=e[n],a=Ge(h),o="";if(i===void 0?o=a:o=i+"."+a,a===t.textNodeName)s===void 0?s=h[a]:s+=""+h[a];else{if(a===void 0)continue;if(h[a]){let c=mt(h[a],t,o),u=qe(c,t);h[":@"]?$e(c,h[":@"],o,t):Object.keys(c).length===1&&c[t.textNodeName]!==void 0&&!t.alwaysCreateTextNode?c=c[t.textNodeName]:Object.keys(c).length===0&&(t.alwaysCreateTextNode?c[t.textNodeName]="":c=""),r[a]!==void 0&&r.hasOwnProperty(a)?(Array.isArray(r[a])||(r[a]=[r[a]]),r[a].push(c)):t.isArray(a,o,u)?r[a]=[c]:r[a]=c}}}return typeof s=="string"?s.length>0&&(r[t.textNodeName]=s):s!==void 0&&(r[t.textNodeName]=s),r}function Ge(e){let t=Object.keys(e);for(let i=0;i<t.length;i++){let s=t[i];if(s!==":@")return s}}function $e(e,t,i,s){if(t){let r=Object.keys(t),n=r.length;for(let h=0;h<n;h++){let a=r[h];s.isArray(a,i+"."+a,!0,!0)?e[a]=[t[a]]:e[a]=t[a]}}}function qe(e,t){let{textNodeName:i}=t,s=Object.keys(e).length;return!!(s===0||s===1&&(e[i]||typeof e[i]=="boolean"||e[i]===0))}Et.prettify=ve});var At=m((As,St)=>{var{buildOptions:We}=ct(),ke=Tt(),{prettify:Ye}=bt(),Xe=G(),Q=class{constructor(t){this.externalEntities={},this.options=We(t)}parse(t,i){if(typeof t!="string")if(t.toString)t=t.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(i){i===!0&&(i={});let n=Xe.validate(t,i);if(n!==!0)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}let s=new ke(this.options);s.addExternalEntities(this.externalEntities);let r=s.parseXml(t);return this.options.preserveOrder||r===void 0?r:Ye(r,this.options)}addEntity(t,i){if(i.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(t.indexOf("&")!==-1||t.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if(i==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=i}};St.exports=Q});var Ft=m((Is,Ct)=>{var Qe=` | ||
`;function He(e,t){let i="";return t.format&&t.indentBy.length>0&&(i=Qe),yt(e,t,"",i)}function yt(e,t,i,s){let r="",n=!1;for(let h=0;h<e.length;h++){let a=e[h],o=ze(a),c="";if(i.length===0?c=o:c=`${i}.${o}`,o===t.textNodeName){let N=a[o];Ke(c,t)||(N=t.tagValueProcessor(o,N),N=xt(N,t)),n&&(r+=s),r+=N,n=!1;continue}else if(o===t.cdataPropName){n&&(r+=s),r+=`<![CDATA[${a[o][0][t.textNodeName]}]]>`,n=!1;continue}else if(o===t.commentPropName){r+=s+`<!--${a[o][0][t.textNodeName]}-->`,n=!0;continue}else if(o[0]==="?"){let N=It(a[":@"],t),x=o==="?xml"?"":s,L=a[o][0][t.textNodeName];L=L.length!==0?" "+L:"",r+=x+`<${o}${L}${N}?>`,n=!0;continue}let u=s;u!==""&&(u+=t.indentBy);let f=It(a[":@"],t),g=s+`<${o}${f}`,p=yt(a[o],t,c,u);t.unpairedTags.indexOf(o)!==-1?t.suppressUnpairedNode?r+=g+">":r+=g+"/>":(!p||p.length===0)&&t.suppressEmptyNode?r+=g+"/>":p&&p.endsWith(">")?r+=g+`>${p}${s}</${o}>`:(r+=g+">",p&&s!==""&&(p.includes("/>")||p.includes("</"))?r+=s+t.indentBy+p+s:r+=p,r+=`</${o}>`),n=!0}return r}function ze(e){let t=Object.keys(e);for(let i=0;i<t.length;i++){let s=t[i];if(s!==":@")return s}}function It(e,t){let i="";if(e&&!t.ignoreAttributes)for(let s in e){let r=t.attributeValueProcessor(s,e[s]);r=xt(r,t),r===!0&&t.suppressBooleanAttributes?i+=` ${s.substr(t.attributeNamePrefix.length)}`:i+=` ${s.substr(t.attributeNamePrefix.length)}="${r}"`}return i}function Ke(e,t){e=e.substr(0,e.length-t.textNodeName.length-1);let i=e.substr(e.lastIndexOf(".")+1);for(let s in t.stopNodes)if(t.stopNodes[s]===e||t.stopNodes[s]==="*."+i)return!0;return!1}function xt(e,t){if(e&&e.length>0&&t.processEntities)for(let i=0;i<t.entities.length;i++){let s=t.entities[i];e=e.replace(s.regex,s.val)}return e}Ct.exports=He});var _t=m((ys,Ot)=>{"use strict";var Ze=Ft(),je={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function b(e){this.options=Object.assign({},je,e),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=ts),this.processTextOrObjNode=Je,this.options.format?(this.indentate=De,this.tagEndChar=`> | ||
`||e==="\r"}function rt(e,t){let i=t;for(;t<e.length;t++)if(e[t]=="?"||e[t]==" "){let s=e.substr(i,t-i);if(t>5&&s==="xml")return d("InvalidXml","XML declaration allowed only at the start of the document.",T(e,t));if(e[t]=="?"&&e[t+1]==">"){t++;break}else continue}return t}function nt(e,t){if(e.length>t+5&&e[t+1]==="-"&&e[t+2]==="-"){for(t+=3;t<e.length;t++)if(e[t]==="-"&&e[t+1]==="-"&&e[t+2]===">"){t+=2;break}}else if(e.length>t+8&&e[t+1]==="D"&&e[t+2]==="O"&&e[t+3]==="C"&&e[t+4]==="T"&&e[t+5]==="Y"&&e[t+6]==="P"&&e[t+7]==="E"){let i=1;for(t+=8;t<e.length;t++)if(e[t]==="<")i++;else if(e[t]===">"&&(i--,i===0))break}else if(e.length>t+9&&e[t+1]==="["&&e[t+2]==="C"&&e[t+3]==="D"&&e[t+4]==="A"&&e[t+5]==="T"&&e[t+6]==="A"&&e[t+7]==="["){for(t+=8;t<e.length;t++)if(e[t]==="]"&&e[t+1]==="]"&&e[t+2]===">"){t+=2;break}}return t}var ee='"',se="'";function ie(e,t){let i="",s="",r=!1;for(;t<e.length;t++){if(e[t]===ee||e[t]===se)s===""?s=e[t]:s!==e[t]||(s="");else if(e[t]===">"&&s===""){r=!0;break}i+=e[t]}return s!==""?!1:{value:i,index:t,tagClosed:r}}var re=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function ot(e,t){let i=v.getAllMatches(e,re),s={};for(let r=0;r<i.length;r++){if(i[r][1].length===0)return d("InvalidAttr","Attribute '"+i[r][2]+"' has no space in starting.",_(i[r]));if(i[r][3]!==void 0&&i[r][4]===void 0)return d("InvalidAttr","Attribute '"+i[r][2]+"' is without value.",_(i[r]));if(i[r][3]===void 0&&!t.allowBooleanAttributes)return d("InvalidAttr","boolean attribute '"+i[r][2]+"' is not allowed.",_(i[r]));let n=i[r][2];if(!ae(n))return d("InvalidAttr","Attribute '"+n+"' is an invalid name.",_(i[r]));if(!s.hasOwnProperty(n))s[n]=1;else return d("InvalidAttr","Attribute '"+n+"' is repeated.",_(i[r]))}return!0}function ne(e,t){let i=/\d/;for(e[t]==="x"&&(t++,i=/[\da-fA-F]/);t<e.length;t++){if(e[t]===";")return t;if(!e[t].match(i))break}return-1}function oe(e,t){if(t++,e[t]===";")return-1;if(e[t]==="#")return t++,ne(e,t);let i=0;for(;t<e.length;t++,i++)if(!(e[t].match(/\w/)&&i<20)){if(e[t]===";")break;return-1}return t}function d(e,t,i){return{err:{code:e,msg:t,line:i.line||i,col:i.col}}}function ae(e){return v.isName(e)}function he(e){return v.isName(e)}function T(e,t){let i=e.substring(0,t).split(/\r?\n/);return{line:i.length,col:i[i.length-1].length+1}}function _(e){return e.startIndex+e[1].length}});var ct=m($=>{var ht={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,i){return e}},ce=function(e){return Object.assign({},ht,e)};$.buildOptions=ce;$.defaultOptions=ht});var ut=m((Ns,lt)=>{"use strict";var q=class{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,i){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:i})}addChild(t){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,[":@"]:t[":@"]}):this.child.push({[t.tagname]:t.child})}};lt.exports=q});var pt=m((Ts,ft)=>{var le=R();function ue(e,t){let i={};if(e[t+3]==="O"&&e[t+4]==="C"&&e[t+5]==="T"&&e[t+6]==="Y"&&e[t+7]==="P"&&e[t+8]==="E"){t=t+9;let s=1,r=!1,n=!1,h="";for(;t<e.length;t++)if(e[t]==="<"&&!n){if(r&&de(e,t))t+=7,[entityName,val,t]=fe(e,t+1),val.indexOf("&")===-1&&(i[me(entityName)]={regx:RegExp(`&${entityName};`,"g"),val});else if(r&&ge(e,t))t+=8;else if(r&&Ne(e,t))t+=8;else if(r&&Te(e,t))t+=9;else if(pe)n=!0;else throw new Error("Invalid DOCTYPE");s++,h=""}else if(e[t]===">"){if(n?e[t-1]==="-"&&e[t-2]==="-"&&(n=!1,s--):s--,s===0)break}else e[t]==="["?r=!0:h+=e[t];if(s!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:i,i:t}}function fe(e,t){let i="";for(;t<e.length&&e[t]!=="'"&&e[t]!=='"';t++)i+=e[t];if(i=i.trim(),i.indexOf(" ")!==-1)throw new Error("External entites are not supported");let s=e[t++],r="";for(;t<e.length&&e[t]!==s;t++)r+=e[t];return[i,r,t]}function pe(e,t){return e[t+1]==="!"&&e[t+2]==="-"&&e[t+3]==="-"}function de(e,t){return e[t+1]==="!"&&e[t+2]==="E"&&e[t+3]==="N"&&e[t+4]==="T"&&e[t+5]==="I"&&e[t+6]==="T"&&e[t+7]==="Y"}function ge(e,t){return e[t+1]==="!"&&e[t+2]==="E"&&e[t+3]==="L"&&e[t+4]==="E"&&e[t+5]==="M"&&e[t+6]==="E"&&e[t+7]==="N"&&e[t+8]==="T"}function Ne(e,t){return e[t+1]==="!"&&e[t+2]==="A"&&e[t+3]==="T"&&e[t+4]==="T"&&e[t+5]==="L"&&e[t+6]==="I"&&e[t+7]==="S"&&e[t+8]==="T"}function Te(e,t){return e[t+1]==="!"&&e[t+2]==="N"&&e[t+3]==="O"&&e[t+4]==="T"&&e[t+5]==="A"&&e[t+6]==="T"&&e[t+7]==="I"&&e[t+8]==="O"&&e[t+9]==="N"}function me(e){if(le.isName(e))return e;throw new Error(`Invalid entity name ${e}`)}ft.exports=ue});var gt=m((ms,dt)=>{var Ee=/^[-+]?0x[a-fA-F0-9]+$/,Se=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt);!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);var be={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function Ae(e,t={}){if(t=Object.assign({},be,t),!e||typeof e!="string")return e;let i=e.trim();if(t.skipLike!==void 0&&t.skipLike.test(i))return e;if(t.hex&&Ee.test(i))return Number.parseInt(i,16);{let s=Se.exec(i);if(s){let r=s[1],n=s[2],h=Ie(s[3]),a=s[4]||s[6];if(!t.leadingZeros&&n.length>0&&r&&i[2]!==".")return e;if(!t.leadingZeros&&n.length>0&&!r&&i[1]!==".")return e;{let o=Number(i),c=""+o;return c.search(/[eE]/)!==-1||a?t.eNotation?o:e:i.indexOf(".")!==-1?c==="0"&&h===""||c===h||r&&c==="-"+h?o:e:n?h===c||r+h===c?o:e:i===c||i===r+c?o:e}}else return e}}function Ie(e){return e&&e.indexOf(".")!==-1&&(e=e.replace(/0+$/,""),e==="."?e="0":e[0]==="."?e="0"+e:e[e.length-1]==="."&&(e=e.substr(0,e.length-1))),e}dt.exports=Ae});var Tt=m((Ss,Nt)=>{"use strict";var X=R(),P=ut(),ye=pt(),xe=gt(),Es="<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,X.nameRegexp),W=class{constructor(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"\xA2"},pound:{regex:/&(pound|#163);/g,val:"\xA3"},yen:{regex:/&(yen|#165);/g,val:"\xA5"},euro:{regex:/&(euro|#8364);/g,val:"\u20AC"},copyright:{regex:/&(copy|#169);/g,val:"\xA9"},reg:{regex:/&(reg|#174);/g,val:"\xAE"},inr:{regex:/&(inr|#8377);/g,val:"\u20B9"}},this.addExternalEntities=Ce,this.parseXml=we,this.parseTextData=Fe,this.resolveNameSpace=Oe,this.buildAttributesMap=Pe,this.isItStopNode=Re,this.replaceEntitiesValue=Me,this.readStopNodeData=Ue,this.saveTextToParentTag=Be,this.addChild=Le}};function Ce(e){let t=Object.keys(e);for(let i=0;i<t.length;i++){let s=t[i];this.lastEntities[s]={regex:new RegExp("&"+s+";","g"),val:e[s]}}}function Fe(e,t,i,s,r,n,h){if(e!==void 0&&(this.options.trimValues&&!s&&(e=e.trim()),e.length>0)){h||(e=this.replaceEntitiesValue(e));let a=this.options.tagValueProcessor(t,e,i,r,n);return a==null?e:typeof a!=typeof e||a!==e?a:this.options.trimValues?Y(e,this.options.parseTagValue,this.options.numberParseOptions):e.trim()===e?Y(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function Oe(e){if(this.options.removeNSPrefix){let t=e.split(":"),i=e.charAt(0)==="/"?"/":"";if(t[0]==="xmlns")return"";t.length===2&&(e=i+t[1])}return e}var _e=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Pe(e,t,i){if(!this.options.ignoreAttributes&&typeof e=="string"){let s=X.getAllMatches(e,_e),r=s.length,n={};for(let h=0;h<r;h++){let a=this.resolveNameSpace(s[h][1]),o=s[h][4],c=this.options.attributeNamePrefix+a;if(a.length)if(this.options.transformAttributeName&&(c=this.options.transformAttributeName(c)),c==="__proto__"&&(c="#__proto__"),o!==void 0){this.options.trimValues&&(o=o.trim()),o=this.replaceEntitiesValue(o);let u=this.options.attributeValueProcessor(a,o,t);u==null?n[c]=o:typeof u!=typeof o||u!==o?n[c]=u:n[c]=Y(o,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(n[c]=!0)}if(!Object.keys(n).length)return;if(this.options.attributesGroupName){let h={};return h[this.options.attributesGroupName]=n,h}return n}}var we=function(e){e=e.replace(/\r\n?/g,` | ||
`);let t=new P("!xml"),i=t,s="",r="";for(let n=0;n<e.length;n++)if(e[n]==="<")if(e[n+1]==="/"){let a=A(e,">",n,"Closing Tag is not closed."),o=e.substring(n+2,a).trim();if(this.options.removeNSPrefix){let f=o.indexOf(":");f!==-1&&(o=o.substr(f+1))}this.options.transformTagName&&(o=this.options.transformTagName(o)),i&&(s=this.saveTextToParentTag(s,i,r));let c=r.substring(r.lastIndexOf(".")+1);if(o&&this.options.unpairedTags.indexOf(o)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${o}>`);let u=0;c&&this.options.unpairedTags.indexOf(c)!==-1?(u=r.lastIndexOf(".",r.lastIndexOf(".")-1),this.tagsNodeStack.pop()):u=r.lastIndexOf("."),r=r.substring(0,u),i=this.tagsNodeStack.pop(),s="",n=a}else if(e[n+1]==="?"){let a=k(e,n,!1,"?>");if(!a)throw new Error("Pi Tag is not closed.");if(s=this.saveTextToParentTag(s,i,r),!(this.options.ignoreDeclaration&&a.tagName==="?xml"||this.options.ignorePiTags)){let o=new P(a.tagName);o.add(this.options.textNodeName,""),a.tagName!==a.tagExp&&a.attrExpPresent&&(o[":@"]=this.buildAttributesMap(a.tagExp,r,a.tagName)),this.addChild(i,o,r)}n=a.closeIndex+1}else if(e.substr(n+1,3)==="!--"){let a=A(e,"-->",n+4,"Comment is not closed.");if(this.options.commentPropName){let o=e.substring(n+4,a-2);s=this.saveTextToParentTag(s,i,r),i.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}n=a}else if(e.substr(n+1,2)==="!D"){let a=ye(e,n);this.docTypeEntities=a.entities,n=a.i}else if(e.substr(n+1,2)==="!["){let a=A(e,"]]>",n,"CDATA is not closed.")-2,o=e.substring(n+9,a);if(s=this.saveTextToParentTag(s,i,r),this.options.cdataPropName)i.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]);else{let c=this.parseTextData(o,i.tagname,r,!0,!1,!0);c==null&&(c=""),i.add(this.options.textNodeName,c)}n=a+2}else{let a=k(e,n,this.options.removeNSPrefix),o=a.tagName,c=a.tagExp,u=a.attrExpPresent,f=a.closeIndex;this.options.transformTagName&&(o=this.options.transformTagName(o)),i&&s&&i.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,i,r,!1));let g=i;if(g&&this.options.unpairedTags.indexOf(g.tagname)!==-1&&(i=this.tagsNodeStack.pop(),r=r.substring(0,r.lastIndexOf("."))),o!==t.tagname&&(r+=r?"."+o:o),this.isItStopNode(this.options.stopNodes,r,o)){let p="";if(c.length>0&&c.lastIndexOf("/")===c.length-1)n=a.closeIndex;else if(this.options.unpairedTags.indexOf(o)!==-1)n=a.closeIndex;else{let x=this.readStopNodeData(e,o,f+1);if(!x)throw new Error(`Unexpected end of ${o}`);n=x.i,p=x.tagContent}let N=new P(o);o!==c&&u&&(N[":@"]=this.buildAttributesMap(c,r,o)),p&&(p=this.parseTextData(p,o,r,!0,u,!0,!0)),r=r.substr(0,r.lastIndexOf(".")),N.add(this.options.textNodeName,p),this.addChild(i,N,r)}else{if(c.length>0&&c.lastIndexOf("/")===c.length-1){o[o.length-1]==="/"?(o=o.substr(0,o.length-1),c=o):c=c.substr(0,c.length-1),this.options.transformTagName&&(o=this.options.transformTagName(o));let p=new P(o);o!==c&&u&&(p[":@"]=this.buildAttributesMap(c,r,o)),this.addChild(i,p,r),r=r.substr(0,r.lastIndexOf("."))}else{let p=new P(o);this.tagsNodeStack.push(i),o!==c&&u&&(p[":@"]=this.buildAttributesMap(c,r,o)),this.addChild(i,p,r),i=p}s="",n=f}}else s+=e[n];return t.child};function Le(e,t,i){let s=this.options.updateTag(t.tagname,i,t[":@"]);s===!1||(typeof s=="string"&&(t.tagname=s),e.addChild(t))}var Me=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){let i=this.docTypeEntities[t];e=e.replace(i.regx,i.val)}for(let t in this.lastEntities){let i=this.lastEntities[t];e=e.replace(i.regex,i.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){let i=this.htmlEntities[t];e=e.replace(i.regex,i.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function Be(e,t,i,s){return e&&(s===void 0&&(s=Object.keys(t.child).length===0),e=this.parseTextData(e,t.tagname,i,!1,t[":@"]?Object.keys(t[":@"]).length!==0:!1,s),e!==void 0&&e!==""&&t.add(this.options.textNodeName,e),e=""),e}function Re(e,t,i){let s="*."+i;for(let r in e){let n=e[r];if(s===n||t===n)return!0}return!1}function Ve(e,t,i=">"){let s,r="";for(let n=t;n<e.length;n++){let h=e[n];if(s)h===s&&(s="");else if(h==='"'||h==="'")s=h;else if(h===i[0])if(i[1]){if(e[n+1]===i[1])return{data:r,index:n}}else return{data:r,index:n};else h===" "&&(h=" ");r+=h}}function A(e,t,i,s){let r=e.indexOf(t,i);if(r===-1)throw new Error(s);return r+t.length-1}function k(e,t,i,s=">"){let r=Ve(e,t+1,s);if(!r)return;let n=r.data,h=r.index,a=n.search(/\s/),o=n,c=!0;if(a!==-1&&(o=n.substr(0,a).replace(/\s\s*$/,""),n=n.substr(a+1)),i){let u=o.indexOf(":");u!==-1&&(o=o.substr(u+1),c=o!==r.data.substr(u+1))}return{tagName:o,tagExp:n,closeIndex:h,attrExpPresent:c}}function Ue(e,t,i){let s=i,r=1;for(;i<e.length;i++)if(e[i]==="<")if(e[i+1]==="/"){let n=A(e,">",i,`${t} is not closed`);if(e.substring(i+2,n).trim()===t&&(r--,r===0))return{tagContent:e.substring(s,i),i:n};i=n}else if(e[i+1]==="?")i=A(e,"?>",i+1,"StopNode is not closed.");else if(e.substr(i+1,3)==="!--")i=A(e,"-->",i+3,"StopNode is not closed.");else if(e.substr(i+1,2)==="![")i=A(e,"]]>",i,"StopNode is not closed.")-2;else{let n=k(e,i,">");n&&((n&&n.tagName)===t&&n.tagExp[n.tagExp.length-1]!=="/"&&r++,i=n.closeIndex)}}function Y(e,t,i){if(t&&typeof e=="string"){let s=e.trim();return s==="true"?!0:s==="false"?!1:xe(e,i)}else return X.isExist(e)?e:""}Nt.exports=W});var St=m(Et=>{"use strict";function ve(e,t){return mt(e,t)}function mt(e,t,i){let s,r={};for(let n=0;n<e.length;n++){let h=e[n],a=Ge(h),o="";if(i===void 0?o=a:o=i+"."+a,a===t.textNodeName)s===void 0?s=h[a]:s+=""+h[a];else{if(a===void 0)continue;if(h[a]){let c=mt(h[a],t,o),u=qe(c,t);h[":@"]?$e(c,h[":@"],o,t):Object.keys(c).length===1&&c[t.textNodeName]!==void 0&&!t.alwaysCreateTextNode?c=c[t.textNodeName]:Object.keys(c).length===0&&(t.alwaysCreateTextNode?c[t.textNodeName]="":c=""),r[a]!==void 0&&r.hasOwnProperty(a)?(Array.isArray(r[a])||(r[a]=[r[a]]),r[a].push(c)):t.isArray(a,o,u)?r[a]=[c]:r[a]=c}}}return typeof s=="string"?s.length>0&&(r[t.textNodeName]=s):s!==void 0&&(r[t.textNodeName]=s),r}function Ge(e){let t=Object.keys(e);for(let i=0;i<t.length;i++){let s=t[i];if(s!==":@")return s}}function $e(e,t,i,s){if(t){let r=Object.keys(t),n=r.length;for(let h=0;h<n;h++){let a=r[h];s.isArray(a,i+"."+a,!0,!0)?e[a]=[t[a]]:e[a]=t[a]}}}function qe(e,t){let{textNodeName:i}=t,s=Object.keys(e).length;return!!(s===0||s===1&&(e[i]||typeof e[i]=="boolean"||e[i]===0))}Et.prettify=ve});var At=m((As,bt)=>{var{buildOptions:We}=ct(),ke=Tt(),{prettify:Ye}=St(),Xe=G(),Q=class{constructor(t){this.externalEntities={},this.options=We(t)}parse(t,i){if(typeof t!="string")if(t.toString)t=t.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(i){i===!0&&(i={});let n=Xe.validate(t,i);if(n!==!0)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}let s=new ke(this.options);s.addExternalEntities(this.externalEntities);let r=s.parseXml(t);return this.options.preserveOrder||r===void 0?r:Ye(r,this.options)}addEntity(t,i){if(i.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(t.indexOf("&")!==-1||t.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if(i==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=i}};bt.exports=Q});var Ft=m((Is,Ct)=>{var Qe=` | ||
`;function He(e,t){let i="";return t.format&&t.indentBy.length>0&&(i=Qe),yt(e,t,"",i)}function yt(e,t,i,s){let r="",n=!1;for(let h=0;h<e.length;h++){let a=e[h],o=ze(a),c="";if(i.length===0?c=o:c=`${i}.${o}`,o===t.textNodeName){let N=a[o];Ke(c,t)||(N=t.tagValueProcessor(o,N),N=xt(N,t)),n&&(r+=s),r+=N,n=!1;continue}else if(o===t.cdataPropName){n&&(r+=s),r+=`<![CDATA[${a[o][0][t.textNodeName]}]]>`,n=!1;continue}else if(o===t.commentPropName){r+=s+`<!--${a[o][0][t.textNodeName]}-->`,n=!0;continue}else if(o[0]==="?"){let N=It(a[":@"],t),x=o==="?xml"?"":s,L=a[o][0][t.textNodeName];L=L.length!==0?" "+L:"",r+=x+`<${o}${L}${N}?>`,n=!0;continue}let u=s;u!==""&&(u+=t.indentBy);let f=It(a[":@"],t),g=s+`<${o}${f}`,p=yt(a[o],t,c,u);t.unpairedTags.indexOf(o)!==-1?t.suppressUnpairedNode?r+=g+">":r+=g+"/>":(!p||p.length===0)&&t.suppressEmptyNode?r+=g+"/>":p&&p.endsWith(">")?r+=g+`>${p}${s}</${o}>`:(r+=g+">",p&&s!==""&&(p.includes("/>")||p.includes("</"))?r+=s+t.indentBy+p+s:r+=p,r+=`</${o}>`),n=!0}return r}function ze(e){let t=Object.keys(e);for(let i=0;i<t.length;i++){let s=t[i];if(s!==":@")return s}}function It(e,t){let i="";if(e&&!t.ignoreAttributes)for(let s in e){let r=t.attributeValueProcessor(s,e[s]);r=xt(r,t),r===!0&&t.suppressBooleanAttributes?i+=` ${s.substr(t.attributeNamePrefix.length)}`:i+=` ${s.substr(t.attributeNamePrefix.length)}="${r}"`}return i}function Ke(e,t){e=e.substr(0,e.length-t.textNodeName.length-1);let i=e.substr(e.lastIndexOf(".")+1);for(let s in t.stopNodes)if(t.stopNodes[s]===e||t.stopNodes[s]==="*."+i)return!0;return!1}function xt(e,t){if(e&&e.length>0&&t.processEntities)for(let i=0;i<t.entities.length;i++){let s=t.entities[i];e=e.replace(s.regex,s.val)}return e}Ct.exports=He});var _t=m((ys,Ot)=>{"use strict";var Ze=Ft(),Je={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function S(e){this.options=Object.assign({},Je,e),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=ts),this.processTextOrObjNode=je,this.options.format?(this.indentate=De,this.tagEndChar=`> | ||
`,this.newLine=` | ||
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}b.prototype.build=function(e){return this.options.preserveOrder?Ze(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0).val)};b.prototype.j2x=function(e,t){let i="",s="";for(let r in e)if(!(typeof e[r]>"u"))if(e[r]===null)r[0]==="?"?s+=this.indentate(t)+"<"+r+"?"+this.tagEndChar:s+=this.indentate(t)+"<"+r+"/"+this.tagEndChar;else if(e[r]instanceof Date)s+=this.buildTextValNode(e[r],r,"",t);else if(typeof e[r]!="object"){let n=this.isAttribute(r);if(n)i+=this.buildAttrPairStr(n,""+e[r]);else if(r===this.options.textNodeName){let h=this.options.tagValueProcessor(r,""+e[r]);s+=this.replaceEntitiesValue(h)}else s+=this.buildTextValNode(e[r],r,"",t)}else if(Array.isArray(e[r])){let n=e[r].length,h="";for(let a=0;a<n;a++){let o=e[r][a];typeof o>"u"||(o===null?r[0]==="?"?s+=this.indentate(t)+"<"+r+"?"+this.tagEndChar:s+=this.indentate(t)+"<"+r+"/"+this.tagEndChar:typeof o=="object"?this.options.oneListGroup?h+=this.j2x(o,t+1).val:h+=this.processTextOrObjNode(o,r,t):h+=this.buildTextValNode(o,r,"",t))}this.options.oneListGroup&&(h=this.buildObjectNode(h,r,"",t)),s+=h}else if(this.options.attributesGroupName&&r===this.options.attributesGroupName){let n=Object.keys(e[r]),h=n.length;for(let a=0;a<h;a++)i+=this.buildAttrPairStr(n[a],""+e[r][n[a]])}else s+=this.processTextOrObjNode(e[r],r,t);return{attrStr:i,val:s}};b.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&t==="true"?" "+e:" "+e+'="'+t+'"'};function Je(e,t,i){let s=this.j2x(e,i+1);return e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1?this.buildTextValNode(e[this.options.textNodeName],t,s.attrStr,i):this.buildObjectNode(s.val,t,s.attrStr,i)}b.prototype.buildObjectNode=function(e,t,i,s){if(e==="")return t[0]==="?"?this.indentate(s)+"<"+t+i+"?"+this.tagEndChar:this.indentate(s)+"<"+t+i+this.closeTag(t)+this.tagEndChar;{let r="</"+t+this.tagEndChar,n="";return t[0]==="?"&&(n="?",r=""),i&&e.indexOf("<")===-1?this.indentate(s)+"<"+t+i+n+">"+e+r:this.options.commentPropName!==!1&&t===this.options.commentPropName&&n.length===0?this.indentate(s)+`<!--${e}-->`+this.newLine:this.indentate(s)+"<"+t+i+n+this.tagEndChar+e+this.indentate(s)+r}};b.prototype.closeTag=function(e){let t="";return this.options.unpairedTags.indexOf(e)!==-1?this.options.suppressUnpairedNode||(t="/"):this.options.suppressEmptyNode?t="/":t=`></${e}`,t};b.prototype.buildTextValNode=function(e,t,i,s){if(this.options.cdataPropName!==!1&&t===this.options.cdataPropName)return this.indentate(s)+`<![CDATA[${e}]]>`+this.newLine;if(this.options.commentPropName!==!1&&t===this.options.commentPropName)return this.indentate(s)+`<!--${e}-->`+this.newLine;if(t[0]==="?")return this.indentate(s)+"<"+t+i+"?"+this.tagEndChar;{let r=this.options.tagValueProcessor(t,e);return r=this.replaceEntitiesValue(r),r===""?this.indentate(s)+"<"+t+i+this.closeTag(t)+this.tagEndChar:this.indentate(s)+"<"+t+i+">"+r+"</"+t+this.tagEndChar}};b.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){let i=this.options.entities[t];e=e.replace(i.regex,i.val)}return e};function De(e){return this.options.indentBy.repeat(e)}function ts(e){return e.startsWith(this.options.attributeNamePrefix)?e.substr(this.attrPrefixLen):!1}Ot.exports=b});var wt=m((xs,Pt)=>{"use strict";var es=G(),ss=At(),is=_t();Pt.exports={XMLParser:ss,XMLValidator:es,XMLBuilder:is}});var w={};kt(w,{HTMLLoader:()=>Rt,SAXParser:()=>S,XMLLoader:()=>I,_uncapitalize:()=>U,_uncapitalizeKeys:()=>y,convertXMLFieldToArrayInPlace:()=>Vt,convertXMLValueToArray:()=>K});M(w,Z(D(),1));var tt={ontext:()=>{},onprocessinginstruction:()=>{},onsgmldeclaration:()=>{},ondoctype:()=>{},oncomment:()=>{},onopentagstart:()=>{},onattribute:()=>{},onopentag:()=>{},onclosetag:()=>{},onopencdata:()=>{},oncdata:()=>{},onclosecdata:()=>{},onerror:()=>{},onend:()=>{},onready:()=>{},onscript:()=>{},onopennamespace:()=>{},onclosenamespace:()=>{}},Xt={...tt,strict:!1,MAX_BUFFER_LENGTH:64*1024,lowercase:!1,lowercasetags:!1,noscript:!1,strictEntities:!1,xmlns:void 0,position:void 0,trim:void 0,normalize:void 0},Qt=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Ht=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"],F=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,V=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,zt=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Kt=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,O={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830};Object.keys(O).forEach(e=>{let t=O[e];O[e]=typeof t=="number"?String.fromCharCode(t):t});var l=class{EVENTS=Qt;ENTITIES={...O};XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"};S=0;opt;trackPosition=!1;column=0;line=0;c="";error;q="";bufferCheckPosition;closed=!1;tags=[];looseCase="";closedRoot=!1;sawRoot=!1;strict=!1;tag;strictEntities;state;noscript=!1;attribList=[];ns;position=0;STATE={BEGIN:this.S++,BEGIN_WHITESPACE:this.S++,TEXT:this.S++,TEXT_ENTITY:this.S++,OPEN_WAKA:this.S++,SGML_DECL:this.S++,SGML_DECL_QUOTED:this.S++,DOCTYPE:this.S++,DOCTYPE_QUOTED:this.S++,DOCTYPE_DTD:this.S++,DOCTYPE_DTD_QUOTED:this.S++,COMMENT_STARTING:this.S++,COMMENT:this.S++,COMMENT_ENDING:this.S++,COMMENT_ENDED:this.S++,CDATA:this.S++,CDATA_ENDING:this.S++,CDATA_ENDING_2:this.S++,PROC_INST:this.S++,PROC_INST_BODY:this.S++,PROC_INST_ENDING:this.S++,OPEN_TAG:this.S++,OPEN_TAG_SLASH:this.S++,ATTRIB:this.S++,ATTRIB_NAME:this.S++,ATTRIB_NAME_SAW_WHITE:this.S++,ATTRIB_VALUE:this.S++,ATTRIB_VALUE_QUOTED:this.S++,ATTRIB_VALUE_CLOSED:this.S++,ATTRIB_VALUE_UNQUOTED:this.S++,ATTRIB_VALUE_ENTITY_Q:this.S++,ATTRIB_VALUE_ENTITY_U:this.S++,CLOSE_TAG:this.S++,CLOSE_TAG_SAW_WHITE:this.S++,SCRIPT:this.S++,SCRIPT_ENDING:this.S++};BUFFERS=Ht;CDATA="[CDATA[";DOCTYPE="DOCTYPE";XML_NAMESPACE="http://www.w3.org/XML/1998/namespace";XMLNS_NAMESPACE="http://www.w3.org/2000/xmlns/";rootNS={xml:this.XML_NAMESPACE,xmlns:this.XMLNS_NAMESPACE};comment;sgmlDecl;textNode="";tagName;doctype;procInstName;procInstBody;entity="";attribName;attribValue;cdata="";script="";startTagPosition=0;constructor(){this.S=0;for(let t in this.STATE)this.STATE.hasOwnProperty(t)&&(this.STATE[this.STATE[t]]=t);this.S=this.STATE}static charAt(t,i){let s="";return i<t.length&&(s=t.charAt(i)),s}static isWhitespace(t){return t===" "||t===` | ||
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}S.prototype.build=function(e){return this.options.preserveOrder?Ze(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0).val)};S.prototype.j2x=function(e,t){let i="",s="";for(let r in e)if(!(typeof e[r]>"u"))if(e[r]===null)r[0]==="?"?s+=this.indentate(t)+"<"+r+"?"+this.tagEndChar:s+=this.indentate(t)+"<"+r+"/"+this.tagEndChar;else if(e[r]instanceof Date)s+=this.buildTextValNode(e[r],r,"",t);else if(typeof e[r]!="object"){let n=this.isAttribute(r);if(n)i+=this.buildAttrPairStr(n,""+e[r]);else if(r===this.options.textNodeName){let h=this.options.tagValueProcessor(r,""+e[r]);s+=this.replaceEntitiesValue(h)}else s+=this.buildTextValNode(e[r],r,"",t)}else if(Array.isArray(e[r])){let n=e[r].length,h="";for(let a=0;a<n;a++){let o=e[r][a];typeof o>"u"||(o===null?r[0]==="?"?s+=this.indentate(t)+"<"+r+"?"+this.tagEndChar:s+=this.indentate(t)+"<"+r+"/"+this.tagEndChar:typeof o=="object"?this.options.oneListGroup?h+=this.j2x(o,t+1).val:h+=this.processTextOrObjNode(o,r,t):h+=this.buildTextValNode(o,r,"",t))}this.options.oneListGroup&&(h=this.buildObjectNode(h,r,"",t)),s+=h}else if(this.options.attributesGroupName&&r===this.options.attributesGroupName){let n=Object.keys(e[r]),h=n.length;for(let a=0;a<h;a++)i+=this.buildAttrPairStr(n[a],""+e[r][n[a]])}else s+=this.processTextOrObjNode(e[r],r,t);return{attrStr:i,val:s}};S.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&t==="true"?" "+e:" "+e+'="'+t+'"'};function je(e,t,i){let s=this.j2x(e,i+1);return e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1?this.buildTextValNode(e[this.options.textNodeName],t,s.attrStr,i):this.buildObjectNode(s.val,t,s.attrStr,i)}S.prototype.buildObjectNode=function(e,t,i,s){if(e==="")return t[0]==="?"?this.indentate(s)+"<"+t+i+"?"+this.tagEndChar:this.indentate(s)+"<"+t+i+this.closeTag(t)+this.tagEndChar;{let r="</"+t+this.tagEndChar,n="";return t[0]==="?"&&(n="?",r=""),i&&e.indexOf("<")===-1?this.indentate(s)+"<"+t+i+n+">"+e+r:this.options.commentPropName!==!1&&t===this.options.commentPropName&&n.length===0?this.indentate(s)+`<!--${e}-->`+this.newLine:this.indentate(s)+"<"+t+i+n+this.tagEndChar+e+this.indentate(s)+r}};S.prototype.closeTag=function(e){let t="";return this.options.unpairedTags.indexOf(e)!==-1?this.options.suppressUnpairedNode||(t="/"):this.options.suppressEmptyNode?t="/":t=`></${e}`,t};S.prototype.buildTextValNode=function(e,t,i,s){if(this.options.cdataPropName!==!1&&t===this.options.cdataPropName)return this.indentate(s)+`<![CDATA[${e}]]>`+this.newLine;if(this.options.commentPropName!==!1&&t===this.options.commentPropName)return this.indentate(s)+`<!--${e}-->`+this.newLine;if(t[0]==="?")return this.indentate(s)+"<"+t+i+"?"+this.tagEndChar;{let r=this.options.tagValueProcessor(t,e);return r=this.replaceEntitiesValue(r),r===""?this.indentate(s)+"<"+t+i+this.closeTag(t)+this.tagEndChar:this.indentate(s)+"<"+t+i+">"+r+"</"+t+this.tagEndChar}};S.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){let i=this.options.entities[t];e=e.replace(i.regex,i.val)}return e};function De(e){return this.options.indentBy.repeat(e)}function ts(e){return e.startsWith(this.options.attributeNamePrefix)?e.substr(this.attrPrefixLen):!1}Ot.exports=S});var wt=m((xs,Pt)=>{"use strict";var es=G(),ss=At(),is=_t();Pt.exports={XMLParser:ss,XMLValidator:es,XMLBuilder:is}});var w={};kt(w,{HTMLLoader:()=>Rt,SAXParser:()=>b,XMLLoader:()=>I,_uncapitalize:()=>U,_uncapitalizeKeys:()=>y,convertXMLFieldToArrayInPlace:()=>Vt,convertXMLValueToArray:()=>K});B(w,Z(D(),1));var tt={ontext:()=>{},onprocessinginstruction:()=>{},onsgmldeclaration:()=>{},ondoctype:()=>{},oncomment:()=>{},onopentagstart:()=>{},onattribute:()=>{},onopentag:()=>{},onclosetag:()=>{},onopencdata:()=>{},oncdata:()=>{},onclosecdata:()=>{},onerror:()=>{},onend:()=>{},onready:()=>{},onscript:()=>{},onopennamespace:()=>{},onclosenamespace:()=>{}},Xt={...tt,strict:!1,MAX_BUFFER_LENGTH:64*1024,lowercase:!1,lowercasetags:!1,noscript:!1,strictEntities:!1,xmlns:void 0,position:void 0,trim:void 0,normalize:void 0},Qt=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Ht=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"],F=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,V=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,zt=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Kt=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,O={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830};Object.keys(O).forEach(e=>{let t=O[e];O[e]=typeof t=="number"?String.fromCharCode(t):t});var l=class{EVENTS=Qt;ENTITIES={...O};XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"};S=0;opt;trackPosition=!1;column=0;line=0;c="";error;q="";bufferCheckPosition;closed=!1;tags=[];looseCase="";closedRoot=!1;sawRoot=!1;strict=!1;tag;strictEntities;state;noscript=!1;attribList=[];ns;position=0;STATE={BEGIN:this.S++,BEGIN_WHITESPACE:this.S++,TEXT:this.S++,TEXT_ENTITY:this.S++,OPEN_WAKA:this.S++,SGML_DECL:this.S++,SGML_DECL_QUOTED:this.S++,DOCTYPE:this.S++,DOCTYPE_QUOTED:this.S++,DOCTYPE_DTD:this.S++,DOCTYPE_DTD_QUOTED:this.S++,COMMENT_STARTING:this.S++,COMMENT:this.S++,COMMENT_ENDING:this.S++,COMMENT_ENDED:this.S++,CDATA:this.S++,CDATA_ENDING:this.S++,CDATA_ENDING_2:this.S++,PROC_INST:this.S++,PROC_INST_BODY:this.S++,PROC_INST_ENDING:this.S++,OPEN_TAG:this.S++,OPEN_TAG_SLASH:this.S++,ATTRIB:this.S++,ATTRIB_NAME:this.S++,ATTRIB_NAME_SAW_WHITE:this.S++,ATTRIB_VALUE:this.S++,ATTRIB_VALUE_QUOTED:this.S++,ATTRIB_VALUE_CLOSED:this.S++,ATTRIB_VALUE_UNQUOTED:this.S++,ATTRIB_VALUE_ENTITY_Q:this.S++,ATTRIB_VALUE_ENTITY_U:this.S++,CLOSE_TAG:this.S++,CLOSE_TAG_SAW_WHITE:this.S++,SCRIPT:this.S++,SCRIPT_ENDING:this.S++};BUFFERS=Ht;CDATA="[CDATA[";DOCTYPE="DOCTYPE";XML_NAMESPACE="http://www.w3.org/XML/1998/namespace";XMLNS_NAMESPACE="http://www.w3.org/2000/xmlns/";rootNS={xml:this.XML_NAMESPACE,xmlns:this.XMLNS_NAMESPACE};comment;sgmlDecl;textNode="";tagName;doctype;procInstName;procInstBody;entity="";attribName;attribValue;cdata="";script="";startTagPosition=0;constructor(){this.S=0;for(let t in this.STATE)this.STATE.hasOwnProperty(t)&&(this.STATE[this.STATE[t]]=t);this.S=this.STATE}static charAt(t,i){let s="";return i<t.length&&(s=t.charAt(i)),s}static isWhitespace(t){return t===" "||t===` | ||
`||t==="\r"||t===" "}static isQuote(t){return t==='"'||t==="'"}static isAttribEnd(t){return t===">"||l.isWhitespace(t)}static isMatch(t,i){return t.test(i)}static notMatch(t,i){return!l.isMatch(t,i)}static qname(t,i){let r=t.indexOf(":")<0?["",t]:t.split(":"),n=r[0],h=r[1];return i&&t==="xmlns"&&(n="xmlns",h=""),{prefix:n,local:h}}write(t){if(this.error)throw this.error;if(this.closed)return this.errorFunction("Cannot write after close. Assign an onready handler.");if(t===null)return this.end();typeof t=="object"&&(t=t.toString());let i=0,s;for(;s=l.charAt(t,i++),this.c=s,!!s;)switch(this.trackPosition&&(this.position++,s===` | ||
`?(this.line++,this.column=0):this.column++),this.state){case this.S.BEGIN:if(this.state=this.S.BEGIN_WHITESPACE,s==="\uFEFF")continue;this.beginWhiteSpace(s);continue;case this.S.BEGIN_WHITESPACE:this.beginWhiteSpace(s);continue;case this.S.TEXT:if(this.sawRoot&&!this.closedRoot){let h=i-1;for(;s&&s!=="<"&&s!=="&";)s=l.charAt(t,i++),s&&this.trackPosition&&(this.position++,s===` | ||
`?(this.line++,this.column=0):this.column++);this.textNode+=t.substring(h,i-1)}s==="<"&&!(this.sawRoot&&this.closedRoot&&!this.strict)?(this.state=this.S.OPEN_WAKA,this.startTagPosition=this.position):(!l.isWhitespace(s)&&(!this.sawRoot||this.closedRoot)&&this.strictFail("Text data outside of root node."),s==="&"?this.state=this.S.TEXT_ENTITY:this.textNode+=s);continue;case this.S.SCRIPT:s==="<"?this.state=this.S.SCRIPT_ENDING:this.script+=s;continue;case this.S.SCRIPT_ENDING:s==="/"?this.state=this.S.CLOSE_TAG:(this.script+=`<${s}`,this.state=this.S.SCRIPT);continue;case this.S.OPEN_WAKA:if(s==="!")this.state=this.S.SGML_DECL,this.sgmlDecl="";else if(!l.isWhitespace(s))if(l.isMatch(F,s))this.state=this.S.OPEN_TAG,this.tagName=s;else if(s==="/")this.state=this.S.CLOSE_TAG,this.tagName="";else if(s==="?")this.state=this.S.PROC_INST,this.procInstName=this.procInstBody="";else{if(this.strictFail("Unencoded <"),this.startTagPosition+1<this.position){let h=this.position-this.startTagPosition;s=new Array(h).join(" ")+s}this.textNode+=`<${s}`,this.state=this.S.TEXT}continue;case this.S.SGML_DECL:(this.sgmlDecl+s).toUpperCase()===this.CDATA?(this.emitNode("onopencdata"),this.state=this.S.CDATA,this.sgmlDecl="",this.cdata=""):this.sgmlDecl+s==="--"?(this.state=this.S.COMMENT,this.comment="",this.sgmlDecl=""):(this.sgmlDecl+s).toUpperCase()===this.DOCTYPE?(this.state=this.S.DOCTYPE,(this.doctype||this.sawRoot)&&this.strictFail("Inappropriately located doctype declaration"),this.doctype="",this.sgmlDecl=""):s===">"?(this.emitNode("onsgmldeclaration",this.sgmlDecl),this.sgmlDecl="",this.state=this.S.TEXT):l.isQuote(s)?(this.state=this.S.SGML_DECL_QUOTED,this.sgmlDecl+=s):this.sgmlDecl+=s;continue;case this.S.SGML_DECL_QUOTED:s===this.q&&(this.state=this.S.SGML_DECL,this.q=""),this.sgmlDecl+=s;continue;case this.S.DOCTYPE:s===">"?(this.state=this.S.TEXT,this.emitNode("ondoctype",this.doctype),this.doctype=!0):(this.doctype+=s,s==="["?this.state=this.S.DOCTYPE_DTD:l.isQuote(s)&&(this.state=this.S.DOCTYPE_QUOTED,this.q=s));continue;case this.S.DOCTYPE_QUOTED:this.doctype+=s,s===this.q&&(this.q="",this.state=this.S.DOCTYPE);continue;case this.S.DOCTYPE_DTD:this.doctype+=s,s==="]"?this.state=this.S.DOCTYPE:l.isQuote(s)&&(this.state=this.S.DOCTYPE_DTD_QUOTED,this.q=s);continue;case this.S.DOCTYPE_DTD_QUOTED:this.doctype+=s,s===this.q&&(this.state=this.S.DOCTYPE_DTD,this.q="");continue;case this.S.COMMENT:s==="-"?this.state=this.S.COMMENT_ENDING:this.comment+=s;continue;case this.S.COMMENT_ENDING:s==="-"?(this.state=this.S.COMMENT_ENDED,this.comment=this.textApplyOptions(this.comment),this.comment&&this.emitNode("oncomment",this.comment),this.comment=""):(this.comment+=`-${s}`,this.state=this.S.COMMENT);continue;case this.S.COMMENT_ENDED:s!==">"?(this.strictFail("Malformed comment"),this.comment+=`--${s}`,this.state=this.S.COMMENT):this.state=this.S.TEXT;continue;case this.S.CDATA:s==="]"?this.state=this.S.CDATA_ENDING:this.cdata+=s;continue;case this.S.CDATA_ENDING:s==="]"?this.state=this.S.CDATA_ENDING_2:(this.cdata+=`]${s}`,this.state=this.S.CDATA);continue;case this.S.CDATA_ENDING_2:s===">"?(this.cdata&&this.emitNode("oncdata",this.cdata),this.emitNode("onclosecdata"),this.cdata="",this.state=this.S.TEXT):s==="]"?this.cdata+="]":(this.cdata+=`]]${s}`,this.state=this.S.CDATA);continue;case this.S.PROC_INST:s==="?"?this.state=this.S.PROC_INST_ENDING:l.isWhitespace(s)?this.state=this.S.PROC_INST_BODY:this.procInstName+=s;continue;case this.S.PROC_INST_BODY:if(!this.procInstBody&&l.isWhitespace(s))continue;s==="?"?this.state=this.S.PROC_INST_ENDING:this.procInstBody+=s;continue;case this.S.PROC_INST_ENDING:s===">"?(this.emitNode("onprocessinginstruction",{name:this.procInstName,body:this.procInstBody}),this.procInstName=this.procInstBody="",this.state=this.S.TEXT):(this.procInstBody+=`?${s}`,this.state=this.S.PROC_INST_BODY);continue;case this.S.OPEN_TAG:l.isMatch(V,s)?this.tagName+=s:(this.newTag(),s===">"?this.openTag():s==="/"?this.state=this.S.OPEN_TAG_SLASH:(l.isWhitespace(s)||this.strictFail("Invalid character in tag name"),this.state=this.S.ATTRIB));continue;case this.S.OPEN_TAG_SLASH:s===">"?(this.openTag(!0),this.closeTag()):(this.strictFail("Forward-slash in opening tag not followed by >"),this.state=this.S.ATTRIB);continue;case this.S.ATTRIB:if(l.isWhitespace(s))continue;s===">"?this.openTag():s==="/"?this.state=this.S.OPEN_TAG_SLASH:l.isMatch(F,s)?(this.attribName=s,this.attribValue="",this.state=this.S.ATTRIB_NAME):this.strictFail("Invalid attribute name");continue;case this.S.ATTRIB_NAME:s==="="?this.state=this.S.ATTRIB_VALUE:s===">"?(this.strictFail("Attribute without value"),this.attribValue=this.attribName,this.attrib(),this.openTag()):l.isWhitespace(s)?this.state=this.S.ATTRIB_NAME_SAW_WHITE:l.isMatch(V,s)?this.attribName+=s:this.strictFail("Invalid attribute name");continue;case this.S.ATTRIB_NAME_SAW_WHITE:if(s==="=")this.state=this.S.ATTRIB_VALUE;else{if(l.isWhitespace(s))continue;this.strictFail("Attribute without value"),this.tag.attributes[this.attribName]="",this.attribValue="",this.emitNode("onattribute",{name:this.attribName,value:""}),this.attribName="",s===">"?this.openTag():l.isMatch(F,s)?(this.attribName=s,this.state=this.S.ATTRIB_NAME):(this.strictFail("Invalid attribute name"),this.state=this.S.ATTRIB)}continue;case this.S.ATTRIB_VALUE:if(l.isWhitespace(s))continue;l.isQuote(s)?(this.q=s,this.state=this.S.ATTRIB_VALUE_QUOTED):(this.strictFail("Unquoted attribute value"),this.state=this.S.ATTRIB_VALUE_UNQUOTED,this.attribValue=s);continue;case this.S.ATTRIB_VALUE_QUOTED:if(s!==this.q){s==="&"?this.state=this.S.ATTRIB_VALUE_ENTITY_Q:this.attribValue+=s;continue}this.attrib(),this.q="",this.state=this.S.ATTRIB_VALUE_CLOSED;continue;case this.S.ATTRIB_VALUE_CLOSED:l.isWhitespace(s)?this.state=this.S.ATTRIB:s===">"?this.openTag():s==="/"?this.state=this.S.OPEN_TAG_SLASH:l.isMatch(F,s)?(this.strictFail("No whitespace between attributes"),this.attribName=s,this.attribValue="",this.state=this.S.ATTRIB_NAME):this.strictFail("Invalid attribute name");continue;case this.S.ATTRIB_VALUE_UNQUOTED:if(!l.isAttribEnd(s)){s==="&"?this.state=this.S.ATTRIB_VALUE_ENTITY_U:this.attribValue+=s;continue}this.attrib(),s===">"?this.openTag():this.state=this.S.ATTRIB;continue;case this.S.CLOSE_TAG:if(this.tagName)s===">"?this.closeTag():l.isMatch(V,s)?this.tagName+=s:this.script?(this.script+=`</${this.tagName}`,this.tagName="",this.state=this.S.SCRIPT):(l.isWhitespace(s)||this.strictFail("Invalid tagname in closing tag"),this.state=this.S.CLOSE_TAG_SAW_WHITE);else{if(l.isWhitespace(s))continue;l.notMatch(F,s)?this.script?(this.script+=`</${s}`,this.state=this.S.SCRIPT):this.strictFail("Invalid tagname in closing tag."):this.tagName=s}continue;case this.S.CLOSE_TAG_SAW_WHITE:if(l.isWhitespace(s))continue;s===">"?this.closeTag():this.strictFail("Invalid characters in closing tag");continue;case this.S.TEXT_ENTITY:case this.S.ATTRIB_VALUE_ENTITY_Q:case this.S.ATTRIB_VALUE_ENTITY_U:let r,n;switch(this.state){case this.S.TEXT_ENTITY:r=this.S.TEXT,n="textNode";break;case this.S.ATTRIB_VALUE_ENTITY_Q:r=this.S.ATTRIB_VALUE_QUOTED,n="attribValue";break;case this.S.ATTRIB_VALUE_ENTITY_U:r=this.S.ATTRIB_VALUE_UNQUOTED,n="attribValue";break;default:throw new Error(`Unknown state: ${this.state}`)}s===";"?(this[n]+=this.parseEntity(),this.entity="",this.state=r):l.isMatch(this.entity.length?Kt:zt,s)?this.entity+=s:(this.strictFail("Invalid character in entity name"),this[n]+=`&${this.entity}${s}`,this.entity="",this.state=r);continue;default:throw new Error(`Unknown state: ${this.state}`)}return this.position>=this.bufferCheckPosition&&this.checkBufferLength(),this}emit(t,i){if(this.events.hasOwnProperty(t)){let s=t.replace(/^on/,"");this.events[t](i,s,this)}}clearBuffers(){for(let t=0,i=this.BUFFERS.length;t<i;t++)this[this[t]]=""}flushBuffers(){this.closeText(),this.cdata!==""&&(this.emitNode("oncdata",this.cdata),this.cdata=""),this.script!==""&&(this.emitNode("onscript",this.script),this.script="")}end(){return this.sawRoot&&!this.closedRoot&&this.strictFail("Unclosed root tag"),this.state!==this.S.BEGIN&&this.state!==this.S.BEGIN_WHITESPACE&&this.state!==this.S.TEXT&&this.errorFunction("Unexpected end"),this.closeText(),this.c="",this.closed=!0,this.emit("onend"),new S(this.opt)}errorFunction(t){this.closeText(),this.trackPosition&&(t+=` | ||
`?(this.line++,this.column=0):this.column++);this.textNode+=t.substring(h,i-1)}s==="<"&&!(this.sawRoot&&this.closedRoot&&!this.strict)?(this.state=this.S.OPEN_WAKA,this.startTagPosition=this.position):(!l.isWhitespace(s)&&(!this.sawRoot||this.closedRoot)&&this.strictFail("Text data outside of root node."),s==="&"?this.state=this.S.TEXT_ENTITY:this.textNode+=s);continue;case this.S.SCRIPT:s==="<"?this.state=this.S.SCRIPT_ENDING:this.script+=s;continue;case this.S.SCRIPT_ENDING:s==="/"?this.state=this.S.CLOSE_TAG:(this.script+=`<${s}`,this.state=this.S.SCRIPT);continue;case this.S.OPEN_WAKA:if(s==="!")this.state=this.S.SGML_DECL,this.sgmlDecl="";else if(!l.isWhitespace(s))if(l.isMatch(F,s))this.state=this.S.OPEN_TAG,this.tagName=s;else if(s==="/")this.state=this.S.CLOSE_TAG,this.tagName="";else if(s==="?")this.state=this.S.PROC_INST,this.procInstName=this.procInstBody="";else{if(this.strictFail("Unencoded <"),this.startTagPosition+1<this.position){let h=this.position-this.startTagPosition;s=new Array(h).join(" ")+s}this.textNode+=`<${s}`,this.state=this.S.TEXT}continue;case this.S.SGML_DECL:(this.sgmlDecl+s).toUpperCase()===this.CDATA?(this.emitNode("onopencdata"),this.state=this.S.CDATA,this.sgmlDecl="",this.cdata=""):this.sgmlDecl+s==="--"?(this.state=this.S.COMMENT,this.comment="",this.sgmlDecl=""):(this.sgmlDecl+s).toUpperCase()===this.DOCTYPE?(this.state=this.S.DOCTYPE,(this.doctype||this.sawRoot)&&this.strictFail("Inappropriately located doctype declaration"),this.doctype="",this.sgmlDecl=""):s===">"?(this.emitNode("onsgmldeclaration",this.sgmlDecl),this.sgmlDecl="",this.state=this.S.TEXT):l.isQuote(s)?(this.state=this.S.SGML_DECL_QUOTED,this.sgmlDecl+=s):this.sgmlDecl+=s;continue;case this.S.SGML_DECL_QUOTED:s===this.q&&(this.state=this.S.SGML_DECL,this.q=""),this.sgmlDecl+=s;continue;case this.S.DOCTYPE:s===">"?(this.state=this.S.TEXT,this.emitNode("ondoctype",this.doctype),this.doctype=!0):(this.doctype+=s,s==="["?this.state=this.S.DOCTYPE_DTD:l.isQuote(s)&&(this.state=this.S.DOCTYPE_QUOTED,this.q=s));continue;case this.S.DOCTYPE_QUOTED:this.doctype+=s,s===this.q&&(this.q="",this.state=this.S.DOCTYPE);continue;case this.S.DOCTYPE_DTD:this.doctype+=s,s==="]"?this.state=this.S.DOCTYPE:l.isQuote(s)&&(this.state=this.S.DOCTYPE_DTD_QUOTED,this.q=s);continue;case this.S.DOCTYPE_DTD_QUOTED:this.doctype+=s,s===this.q&&(this.state=this.S.DOCTYPE_DTD,this.q="");continue;case this.S.COMMENT:s==="-"?this.state=this.S.COMMENT_ENDING:this.comment+=s;continue;case this.S.COMMENT_ENDING:s==="-"?(this.state=this.S.COMMENT_ENDED,this.comment=this.textApplyOptions(this.comment),this.comment&&this.emitNode("oncomment",this.comment),this.comment=""):(this.comment+=`-${s}`,this.state=this.S.COMMENT);continue;case this.S.COMMENT_ENDED:s!==">"?(this.strictFail("Malformed comment"),this.comment+=`--${s}`,this.state=this.S.COMMENT):this.state=this.S.TEXT;continue;case this.S.CDATA:s==="]"?this.state=this.S.CDATA_ENDING:this.cdata+=s;continue;case this.S.CDATA_ENDING:s==="]"?this.state=this.S.CDATA_ENDING_2:(this.cdata+=`]${s}`,this.state=this.S.CDATA);continue;case this.S.CDATA_ENDING_2:s===">"?(this.cdata&&this.emitNode("oncdata",this.cdata),this.emitNode("onclosecdata"),this.cdata="",this.state=this.S.TEXT):s==="]"?this.cdata+="]":(this.cdata+=`]]${s}`,this.state=this.S.CDATA);continue;case this.S.PROC_INST:s==="?"?this.state=this.S.PROC_INST_ENDING:l.isWhitespace(s)?this.state=this.S.PROC_INST_BODY:this.procInstName+=s;continue;case this.S.PROC_INST_BODY:if(!this.procInstBody&&l.isWhitespace(s))continue;s==="?"?this.state=this.S.PROC_INST_ENDING:this.procInstBody+=s;continue;case this.S.PROC_INST_ENDING:s===">"?(this.emitNode("onprocessinginstruction",{name:this.procInstName,body:this.procInstBody}),this.procInstName=this.procInstBody="",this.state=this.S.TEXT):(this.procInstBody+=`?${s}`,this.state=this.S.PROC_INST_BODY);continue;case this.S.OPEN_TAG:l.isMatch(V,s)?this.tagName+=s:(this.newTag(),s===">"?this.openTag():s==="/"?this.state=this.S.OPEN_TAG_SLASH:(l.isWhitespace(s)||this.strictFail("Invalid character in tag name"),this.state=this.S.ATTRIB));continue;case this.S.OPEN_TAG_SLASH:s===">"?(this.openTag(!0),this.closeTag()):(this.strictFail("Forward-slash in opening tag not followed by >"),this.state=this.S.ATTRIB);continue;case this.S.ATTRIB:if(l.isWhitespace(s))continue;s===">"?this.openTag():s==="/"?this.state=this.S.OPEN_TAG_SLASH:l.isMatch(F,s)?(this.attribName=s,this.attribValue="",this.state=this.S.ATTRIB_NAME):this.strictFail("Invalid attribute name");continue;case this.S.ATTRIB_NAME:s==="="?this.state=this.S.ATTRIB_VALUE:s===">"?(this.strictFail("Attribute without value"),this.attribValue=this.attribName,this.attrib(),this.openTag()):l.isWhitespace(s)?this.state=this.S.ATTRIB_NAME_SAW_WHITE:l.isMatch(V,s)?this.attribName+=s:this.strictFail("Invalid attribute name");continue;case this.S.ATTRIB_NAME_SAW_WHITE:if(s==="=")this.state=this.S.ATTRIB_VALUE;else{if(l.isWhitespace(s))continue;this.strictFail("Attribute without value"),this.tag.attributes[this.attribName]="",this.attribValue="",this.emitNode("onattribute",{name:this.attribName,value:""}),this.attribName="",s===">"?this.openTag():l.isMatch(F,s)?(this.attribName=s,this.state=this.S.ATTRIB_NAME):(this.strictFail("Invalid attribute name"),this.state=this.S.ATTRIB)}continue;case this.S.ATTRIB_VALUE:if(l.isWhitespace(s))continue;l.isQuote(s)?(this.q=s,this.state=this.S.ATTRIB_VALUE_QUOTED):(this.strictFail("Unquoted attribute value"),this.state=this.S.ATTRIB_VALUE_UNQUOTED,this.attribValue=s);continue;case this.S.ATTRIB_VALUE_QUOTED:if(s!==this.q){s==="&"?this.state=this.S.ATTRIB_VALUE_ENTITY_Q:this.attribValue+=s;continue}this.attrib(),this.q="",this.state=this.S.ATTRIB_VALUE_CLOSED;continue;case this.S.ATTRIB_VALUE_CLOSED:l.isWhitespace(s)?this.state=this.S.ATTRIB:s===">"?this.openTag():s==="/"?this.state=this.S.OPEN_TAG_SLASH:l.isMatch(F,s)?(this.strictFail("No whitespace between attributes"),this.attribName=s,this.attribValue="",this.state=this.S.ATTRIB_NAME):this.strictFail("Invalid attribute name");continue;case this.S.ATTRIB_VALUE_UNQUOTED:if(!l.isAttribEnd(s)){s==="&"?this.state=this.S.ATTRIB_VALUE_ENTITY_U:this.attribValue+=s;continue}this.attrib(),s===">"?this.openTag():this.state=this.S.ATTRIB;continue;case this.S.CLOSE_TAG:if(this.tagName)s===">"?this.closeTag():l.isMatch(V,s)?this.tagName+=s:this.script?(this.script+=`</${this.tagName}`,this.tagName="",this.state=this.S.SCRIPT):(l.isWhitespace(s)||this.strictFail("Invalid tagname in closing tag"),this.state=this.S.CLOSE_TAG_SAW_WHITE);else{if(l.isWhitespace(s))continue;l.notMatch(F,s)?this.script?(this.script+=`</${s}`,this.state=this.S.SCRIPT):this.strictFail("Invalid tagname in closing tag."):this.tagName=s}continue;case this.S.CLOSE_TAG_SAW_WHITE:if(l.isWhitespace(s))continue;s===">"?this.closeTag():this.strictFail("Invalid characters in closing tag");continue;case this.S.TEXT_ENTITY:case this.S.ATTRIB_VALUE_ENTITY_Q:case this.S.ATTRIB_VALUE_ENTITY_U:let r,n;switch(this.state){case this.S.TEXT_ENTITY:r=this.S.TEXT,n="textNode";break;case this.S.ATTRIB_VALUE_ENTITY_Q:r=this.S.ATTRIB_VALUE_QUOTED,n="attribValue";break;case this.S.ATTRIB_VALUE_ENTITY_U:r=this.S.ATTRIB_VALUE_UNQUOTED,n="attribValue";break;default:throw new Error(`Unknown state: ${this.state}`)}s===";"?(this[n]+=this.parseEntity(),this.entity="",this.state=r):l.isMatch(this.entity.length?Kt:zt,s)?this.entity+=s:(this.strictFail("Invalid character in entity name"),this[n]+=`&${this.entity}${s}`,this.entity="",this.state=r);continue;default:throw new Error(`Unknown state: ${this.state}`)}return this.position>=this.bufferCheckPosition&&this.checkBufferLength(),this}emit(t,i){if(this.events.hasOwnProperty(t)){let s=t.replace(/^on/,"");this.events[t](i,s,this)}}clearBuffers(){for(let t=0,i=this.BUFFERS.length;t<i;t++)this[this[t]]=""}flushBuffers(){this.closeText(),this.cdata!==""&&(this.emitNode("oncdata",this.cdata),this.cdata=""),this.script!==""&&(this.emitNode("onscript",this.script),this.script="")}end(){return this.sawRoot&&!this.closedRoot&&this.strictFail("Unclosed root tag"),this.state!==this.S.BEGIN&&this.state!==this.S.BEGIN_WHITESPACE&&this.state!==this.S.TEXT&&this.errorFunction("Unexpected end"),this.closeText(),this.c="",this.closed=!0,this.emit("onend"),new b(this.opt)}errorFunction(t){this.closeText(),this.trackPosition&&(t+=` | ||
Line: ${this.line} | ||
@@ -22,4 +22,4 @@ Column: ${this.column} | ||
Actual: ${this.attribValue}`);else if(s==="xmlns"&&this.attribValue!==this.XMLNS_NAMESPACE)this.strictFail(`xmlns: prefix must be bound to ${this.XMLNS_NAMESPACE} | ||
Actual: ${this.attribValue}`);else{let r=this.tag,n=this.tags[this.tags.length-1]||this;r.ns===n.ns&&(r.ns=Object.create(n.ns)),r.ns[s]=this.attribValue}this.attribList.push([this.attribName,this.attribValue])}else this.tag.attributes[this.attribName]=this.attribValue,this.emitNode("onattribute",{name:this.attribName,value:this.attribValue});this.attribName=this.attribValue=""}newTag(){this.strict||(this.tagName=this.tagName[this.looseCase]());let t=this.tags[this.tags.length-1]||this,i=this.tag={name:this.tagName,attributes:{}};this.opt.xmlns&&(i.ns=t.ns),this.attribList.length=0,this.emitNode("onopentagstart",i)}parseEntity(){let t=this.entity,i=t.toLowerCase(),s=NaN,r="";return this.ENTITIES[t]?this.ENTITIES[t]:this.ENTITIES[i]?this.ENTITIES[i]:(t=i,t.charAt(0)==="#"&&(t.charAt(1)==="x"?(t=t.slice(2),s=parseInt(t,16),r=s.toString(16)):(t=t.slice(1),s=parseInt(t,10),r=s.toString(10))),t=t.replace(/^0+/,""),isNaN(s)||r.toLowerCase()!==t?(this.strictFail("Invalid character entity"),`&${this.entity};`):String.fromCodePoint(s))}beginWhiteSpace(t){t==="<"?(this.state=this.S.OPEN_WAKA,this.startTagPosition=this.position):l.isWhitespace(t)||(this.strictFail("Non-whitespace before first tag."),this.textNode=t,this.state=this.S.TEXT)}strictFail(t){if(typeof this!="object"||!(this instanceof S))throw new Error("bad call to strictFail");this.strict&&this.errorFunction(t)}textApplyOptions(t){return this.opt.trim&&(t=t.trim()),this.opt.normalize&&(t=t.replace(/\s+/g," ")),t}emitNode(t,i){this.textNode&&this.closeText(),this.emit(t,i)}closeText(){this.textNode=this.textApplyOptions(this.textNode),this.textNode!==void 0&&this.textNode!==""&&this.textNode!=="undefined"&&this.emit("ontext",this.textNode),this.textNode=""}checkBufferLength(){let t=Math.max(this.opt.MAX_BUFFER_LENGTH,10),i=0;for(let r=0,n=this.BUFFERS.length;r<n;r++){let h=this[this.BUFFERS[r]]?.length||0;if(h>t)switch(this.BUFFERS[r]){case"textNode":this.closeText();break;case"cdata":this.emitNode("oncdata",this.cdata),this.cdata="";break;case"script":this.emitNode("onscript",this.script),this.script="";break;default:this.errorFunction(`Max buffer length exceeded: ${this.BUFFERS[r]}`)}i=Math.max(i,h)}let s=this.opt.MAX_BUFFER_LENGTH-i;this.bufferCheckPosition=s+this.position}openTag(t){if(this.opt.xmlns){let i=this.tag,s=l.qname(this.tagName);i.prefix=s.prefix,i.local=s.local,i.uri=i.ns[s.prefix]||"",i.prefix&&!i.uri&&(this.strictFail(`Unbound namespace prefix: ${JSON.stringify(this.tagName)}`),i.uri=s.prefix);let r=this.tags[this.tags.length-1]||this;if(i.ns&&r.ns!==i.ns){let n=this;Object.keys(i.ns).forEach(h=>{n.emitNode("onopennamespace",{prefix:h,uri:i.ns[h]})})}for(let n=0,h=this.attribList.length;n<h;n++){let a=this.attribList[n],o=a[0],c=a[1],u=l.qname(o,!0),f=u.prefix,g=u.local,p=f===""?"":i.ns[f]||"",N={name:o,value:c,prefix:f,local:g,uri:p};f&&f!=="xmlns"&&!p&&(this.strictFail(`Unbound namespace prefix: ${JSON.stringify(f)}`),N.uri=f),this.tag.attributes[o]=N,this.emitNode("onattribute",N)}this.attribList.length=0}this.tag.isSelfClosing=Boolean(t),this.sawRoot=!0,this.tags.push(this.tag),this.emitNode("onopentag",this.tag),t||(!this.noscript&&this.tagName.toLowerCase()==="script"?this.state=this.S.SCRIPT:this.state=this.S.TEXT,this.tag=null,this.tagName=""),this.attribName=this.attribValue="",this.attribList.length=0}closeTag(){if(!this.tagName){this.strictFail("Weird empty close tag."),this.textNode+="</>",this.state=this.S.TEXT;return}if(this.script){if(this.tagName!=="script"){this.script+=`</${this.tagName}>`,this.tagName="",this.state=this.S.SCRIPT;return}this.emitNode("onscript",this.script),this.script=""}let t=this.tags.length,i=this.tagName;for(this.strict||(i=i[this.looseCase]());t--&&this.tags[t].name!==i;)this.strictFail("Unexpected close tag");if(t<0){this.strictFail(`Unmatched closing tag: ${this.tagName}`),this.textNode+=`</${this.tagName}>`,this.state=this.S.TEXT;return}this.tagName=i;let s=this.tags.length;for(;s-- >t;){let r=this.tag=this.tags.pop();this.tagName=this.tag.name,this.emitNode("onclosetag",this.tagName);let n={};for(let a in r.ns)r.ns.hasOwnProperty(a)&&(n[a]=r.ns[a]);let h=this.tags[this.tags.length-1]||this;if(this.opt.xmlns&&r.ns!==h.ns){let a=this;Object.keys(r.ns).forEach(o=>{let c=r.ns[o];a.emitNode("onclosenamespace",{prefix:o,uri:c})})}}t===0&&(this.closedRoot=!0),this.tagName=this.attribValue=this.attribName="",this.attribList.length=0,this.state=this.S.TEXT}},S=class extends l{opt=Xt;events=tt;constructor(t){super(),this.clearBuffers(),this.opt=t={...this.opt,...t},this.events={...this.events,...t},this.q=this.c="",this.opt.lowercase=this.opt.lowercase||this.opt.lowercasetags,this.bufferCheckPosition=this.opt.MAX_BUFFER_LENGTH,this.looseCase=this.opt.lowercase?"toLowerCase":"toUpperCase",this.tags=[],this.closed=this.closedRoot=this.sawRoot=!1,this.tag=this.error=null,this.strict=Boolean(this.opt.strict),this.noscript=Boolean(this.opt.strict||this.opt.noscript),this.state=this.S.BEGIN,this.strictEntities=this.opt.strictEntities,this.ENTITIES=this.strictEntities?Object.create(this.XML_ENTITIES):Object.create(this.ENTITIES),this.attribList=[],this.opt.xmlns&&(this.ns=Object.create(this.rootNS)),this.trackPosition=this.opt.position!==!1,this.trackPosition&&(this.position=this.line=this.column=0),this.emit("onready")}resume(){return this.error=null,this}close(){return this.write(null)}flush(){this.flushBuffers()}};j(S,"ENTITIES",O);function U(e){return typeof e=="string"?e.charAt(0).toLowerCase()+e.slice(1):e}function y(e){if(Array.isArray(e))return e.map(t=>y(t));if(e&&typeof e=="object"){let t={};for(let[i,s]of Object.entries(e))t[U(i)]=y(s);return t}return e}var Lt=Z(wt(),1);function H(e,t){if(t?._parser&&t._parser!=="fast-xml-parser")throw new Error(t?._parser);let i={allowBooleanAttributes:!0,ignoreDeclaration:!0,removeNSPrefix:t?.removeNSPrefix,textNodeName:t?.textNodeName,isArray:(r,n,h,a)=>Boolean(t?.arrayPaths?.some(c=>n===c)),...t?._fastXML},s=rs(e,i);return t?.uncapitalizeKeys?y(s):s}function rs(e,t){return new Lt.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"",...t}).parse(e)}var ns="4.2.0-alpha.5",I={name:"XML",id:"xml",module:"xml",version:ns,worker:!1,extensions:["xml"],mimeTypes:["application/xml","text/xml"],testText:os,options:{xml:{_parser:"fast-xml-parser",uncapitalizeKeys:!1,removeNSPrefix:!1,textNodeName:"value",arrayPaths:[]}},parse:async(e,t)=>H(new TextDecoder().decode(e),{...I.options.xml,...t?.xml}),parseTextSync:(e,t)=>H(e,{...I.options.xml,...t?.xml})};function os(e){return e.startsWith("<?xml")}function z(e,t){return Bt(e||{},t)}function Bt(e,t,i=0){if(i>3)return t;let s={...e};for(let[r,n]of Object.entries(t))n&&typeof n=="object"&&!Array.isArray(n)?s[r]=Bt(s[r]||{},t[r],i+1):s[r]=t[r];return s}var Rt={...I,name:"HTML",id:"html",extensions:["html","htm"],mimeTypes:["text/html"],testText:as,parse:async(e,t)=>Mt(new TextDecoder().decode(e),t),parseTextSync:(e,t)=>Mt(e,t)};function as(e){return e.startsWith("<html")}function Mt(e,t){return t=z(t,{xml:{_parser:"fast-xml-parser",_fastXML:{htmlEntities:!0}}}),I.parseTextSync?.(e,t)}function K(e){return Array.isArray(e)?e:(e&&typeof e=="object"&&e[0],e?[e]:[])}function Vt(e,t){e[t]=K(e[t])}return Yt(w);})(); | ||
Actual: ${this.attribValue}`);else{let r=this.tag,n=this.tags[this.tags.length-1]||this;r.ns===n.ns&&(r.ns=Object.create(n.ns)),r.ns[s]=this.attribValue}this.attribList.push([this.attribName,this.attribValue])}else this.tag.attributes[this.attribName]=this.attribValue,this.emitNode("onattribute",{name:this.attribName,value:this.attribValue});this.attribName=this.attribValue=""}newTag(){this.strict||(this.tagName=this.tagName[this.looseCase]());let t=this.tags[this.tags.length-1]||this,i=this.tag={name:this.tagName,attributes:{}};this.opt.xmlns&&(i.ns=t.ns),this.attribList.length=0,this.emitNode("onopentagstart",i)}parseEntity(){let t=this.entity,i=t.toLowerCase(),s=NaN,r="";return this.ENTITIES[t]?this.ENTITIES[t]:this.ENTITIES[i]?this.ENTITIES[i]:(t=i,t.charAt(0)==="#"&&(t.charAt(1)==="x"?(t=t.slice(2),s=parseInt(t,16),r=s.toString(16)):(t=t.slice(1),s=parseInt(t,10),r=s.toString(10))),t=t.replace(/^0+/,""),isNaN(s)||r.toLowerCase()!==t?(this.strictFail("Invalid character entity"),`&${this.entity};`):String.fromCodePoint(s))}beginWhiteSpace(t){t==="<"?(this.state=this.S.OPEN_WAKA,this.startTagPosition=this.position):l.isWhitespace(t)||(this.strictFail("Non-whitespace before first tag."),this.textNode=t,this.state=this.S.TEXT)}strictFail(t){if(typeof this!="object"||!(this instanceof b))throw new Error("bad call to strictFail");this.strict&&this.errorFunction(t)}textApplyOptions(t){return this.opt.trim&&(t=t.trim()),this.opt.normalize&&(t=t.replace(/\s+/g," ")),t}emitNode(t,i){this.textNode&&this.closeText(),this.emit(t,i)}closeText(){this.textNode=this.textApplyOptions(this.textNode),this.textNode!==void 0&&this.textNode!==""&&this.textNode!=="undefined"&&this.emit("ontext",this.textNode),this.textNode=""}checkBufferLength(){let t=Math.max(this.opt.MAX_BUFFER_LENGTH,10),i=0;for(let r=0,n=this.BUFFERS.length;r<n;r++){let h=this[this.BUFFERS[r]]?.length||0;if(h>t)switch(this.BUFFERS[r]){case"textNode":this.closeText();break;case"cdata":this.emitNode("oncdata",this.cdata),this.cdata="";break;case"script":this.emitNode("onscript",this.script),this.script="";break;default:this.errorFunction(`Max buffer length exceeded: ${this.BUFFERS[r]}`)}i=Math.max(i,h)}let s=this.opt.MAX_BUFFER_LENGTH-i;this.bufferCheckPosition=s+this.position}openTag(t){if(this.opt.xmlns){let i=this.tag,s=l.qname(this.tagName);i.prefix=s.prefix,i.local=s.local,i.uri=i.ns[s.prefix]||"",i.prefix&&!i.uri&&(this.strictFail(`Unbound namespace prefix: ${JSON.stringify(this.tagName)}`),i.uri=s.prefix);let r=this.tags[this.tags.length-1]||this;if(i.ns&&r.ns!==i.ns){let n=this;Object.keys(i.ns).forEach(h=>{n.emitNode("onopennamespace",{prefix:h,uri:i.ns[h]})})}for(let n=0,h=this.attribList.length;n<h;n++){let a=this.attribList[n],o=a[0],c=a[1],u=l.qname(o,!0),f=u.prefix,g=u.local,p=f===""?"":i.ns[f]||"",N={name:o,value:c,prefix:f,local:g,uri:p};f&&f!=="xmlns"&&!p&&(this.strictFail(`Unbound namespace prefix: ${JSON.stringify(f)}`),N.uri=f),this.tag.attributes[o]=N,this.emitNode("onattribute",N)}this.attribList.length=0}this.tag.isSelfClosing=Boolean(t),this.sawRoot=!0,this.tags.push(this.tag),this.emitNode("onopentag",this.tag),t||(!this.noscript&&this.tagName.toLowerCase()==="script"?this.state=this.S.SCRIPT:this.state=this.S.TEXT,this.tag=null,this.tagName=""),this.attribName=this.attribValue="",this.attribList.length=0}closeTag(){if(!this.tagName){this.strictFail("Weird empty close tag."),this.textNode+="</>",this.state=this.S.TEXT;return}if(this.script){if(this.tagName!=="script"){this.script+=`</${this.tagName}>`,this.tagName="",this.state=this.S.SCRIPT;return}this.emitNode("onscript",this.script),this.script=""}let t=this.tags.length,i=this.tagName;for(this.strict||(i=i[this.looseCase]());t--&&this.tags[t].name!==i;)this.strictFail("Unexpected close tag");if(t<0){this.strictFail(`Unmatched closing tag: ${this.tagName}`),this.textNode+=`</${this.tagName}>`,this.state=this.S.TEXT;return}this.tagName=i;let s=this.tags.length;for(;s-- >t;){let r=this.tag=this.tags.pop();this.tagName=this.tag.name,this.emitNode("onclosetag",this.tagName);let n={};for(let a in r.ns)r.ns.hasOwnProperty(a)&&(n[a]=r.ns[a]);let h=this.tags[this.tags.length-1]||this;if(this.opt.xmlns&&r.ns!==h.ns){let a=this;Object.keys(r.ns).forEach(o=>{let c=r.ns[o];a.emitNode("onclosenamespace",{prefix:o,uri:c})})}}t===0&&(this.closedRoot=!0),this.tagName=this.attribValue=this.attribName="",this.attribList.length=0,this.state=this.S.TEXT}},b=class extends l{opt=Xt;events=tt;constructor(t){super(),this.clearBuffers(),this.opt=t={...this.opt,...t},this.events={...this.events,...t},this.q=this.c="",this.opt.lowercase=this.opt.lowercase||this.opt.lowercasetags,this.bufferCheckPosition=this.opt.MAX_BUFFER_LENGTH,this.looseCase=this.opt.lowercase?"toLowerCase":"toUpperCase",this.tags=[],this.closed=this.closedRoot=this.sawRoot=!1,this.tag=this.error=null,this.strict=Boolean(this.opt.strict),this.noscript=Boolean(this.opt.strict||this.opt.noscript),this.state=this.S.BEGIN,this.strictEntities=this.opt.strictEntities,this.ENTITIES=this.strictEntities?Object.create(this.XML_ENTITIES):Object.create(this.ENTITIES),this.attribList=[],this.opt.xmlns&&(this.ns=Object.create(this.rootNS)),this.trackPosition=this.opt.position!==!1,this.trackPosition&&(this.position=this.line=this.column=0),this.emit("onready")}resume(){return this.error=null,this}close(){return this.write(null)}flush(){this.flushBuffers()}};J(b,"ENTITIES",O);function U(e){return typeof e=="string"?e.charAt(0).toLowerCase()+e.slice(1):e}function y(e){if(Array.isArray(e))return e.map(t=>y(t));if(e&&typeof e=="object"){let t={};for(let[i,s]of Object.entries(e))t[U(i)]=y(s);return t}return e}var Lt=Z(wt(),1);function H(e,t){if(t?._parser&&t._parser!=="fast-xml-parser")throw new Error(t?._parser);let i={allowBooleanAttributes:!0,ignoreDeclaration:!0,removeNSPrefix:t?.removeNSPrefix,textNodeName:t?.textNodeName,isArray:(r,n,h,a)=>Boolean(t?.arrayPaths?.some(c=>n===c)),...t?._fastXML},s=rs(e,i);return t?.uncapitalizeKeys?y(s):s}function rs(e,t){return new Lt.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"",...t}).parse(e)}var ns="4.2.0-alpha.6",I={dataType:null,batchType:null,name:"XML",id:"xml",module:"xml",version:ns,worker:!1,extensions:["xml"],mimeTypes:["application/xml","text/xml"],testText:os,options:{xml:{_parser:"fast-xml-parser",uncapitalizeKeys:!1,removeNSPrefix:!1,textNodeName:"value",arrayPaths:[]}},parse:async(e,t)=>H(new TextDecoder().decode(e),{...I.options.xml,...t?.xml}),parseTextSync:(e,t)=>H(e,{...I.options.xml,...t?.xml})};function os(e){return e.startsWith("<?xml")}function z(e,t){return Mt(e||{},t)}function Mt(e,t,i=0){if(i>3)return t;let s={...e};for(let[r,n]of Object.entries(t))n&&typeof n=="object"&&!Array.isArray(n)?s[r]=Mt(s[r]||{},t[r],i+1):s[r]=t[r];return s}var Rt={...I,name:"HTML",id:"html",extensions:["html","htm"],mimeTypes:["text/html"],testText:as,parse:async(e,t)=>Bt(new TextDecoder().decode(e),t),parseTextSync:(e,t)=>Bt(e,t)};function as(e){return e.startsWith("<html")}function Bt(e,t){return t=z(t,{xml:{_parser:"fast-xml-parser",_fastXML:{htmlEntities:!0}}}),I.parseTextSync?.(e,t)}function K(e){return Array.isArray(e)?e:(e&&typeof e=="object"&&e[0],e?[e]:[])}function Vt(e,t){e[t]=K(e[t])}return Yt(w);})(); | ||
return __exports__; | ||
}); |
@@ -1,2 +0,1 @@ | ||
import type { LoaderWithParser } from '@loaders.gl/loader-utils'; | ||
import { XMLLoaderOptions } from "./xml-loader.js"; | ||
@@ -10,3 +9,3 @@ export type HTMLLoaderOptions = XMLLoaderOptions; | ||
*/ | ||
export declare const HTMLLoader: LoaderWithParser<any, never, HTMLLoaderOptions>; | ||
export declare const HTMLLoader: any; | ||
//# sourceMappingURL=html-loader.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import type { LoaderWithParser, LoaderOptions } from '@loaders.gl/loader-utils'; | ||
import type { LoaderOptions } from '@loaders.gl/loader-utils'; | ||
import type { ParseXMLOptions } from "./lib/parsers/parse-xml.js"; | ||
@@ -9,3 +9,3 @@ export type XMLLoaderOptions = LoaderOptions & { | ||
*/ | ||
export declare const XMLLoader: LoaderWithParser<any, never, XMLLoaderOptions>; | ||
export declare const XMLLoader: any; | ||
//# sourceMappingURL=xml-loader.d.ts.map |
@@ -7,3 +7,3 @@ // loaders.gl | ||
// @ts-ignore TS2304: Cannot find name '__VERSION__'. | ||
const VERSION = typeof "4.2.0-alpha.5" !== 'undefined' ? "4.2.0-alpha.5" : 'latest'; | ||
const VERSION = typeof "4.2.0-alpha.6" !== 'undefined' ? "4.2.0-alpha.6" : 'latest'; | ||
/** | ||
@@ -13,2 +13,4 @@ * Loader for XML files | ||
export const XMLLoader = { | ||
dataType: null, | ||
batchType: null, | ||
name: 'XML', | ||
@@ -15,0 +17,0 @@ id: 'xml', |
{ | ||
"name": "@loaders.gl/xml", | ||
"version": "4.2.0-alpha.6", | ||
"version": "4.2.0-beta.1", | ||
"description": "Framework-independent loaders for the XML (eXtensible Markup Language) format", | ||
@@ -44,4 +44,4 @@ "license": "MIT", | ||
"dependencies": { | ||
"@loaders.gl/loader-utils": "4.2.0-alpha.6", | ||
"@loaders.gl/schema": "4.2.0-alpha.6", | ||
"@loaders.gl/loader-utils": "4.2.0-beta.1", | ||
"@loaders.gl/schema": "4.2.0-beta.1", | ||
"fast-xml-parser": "^4.2.5" | ||
@@ -52,3 +52,3 @@ }, | ||
}, | ||
"gitHead": "37bd8ca71763529f18727ee4bf29dd176aa914ca" | ||
"gitHead": "c386a9196516fe3ff24847b40e6c77be039cf905" | ||
} |
@@ -17,3 +17,3 @@ // loaders.gl | ||
*/ | ||
export const HTMLLoader: LoaderWithParser<any, never, HTMLLoaderOptions> = { | ||
export const HTMLLoader = { | ||
...XMLLoader, | ||
@@ -28,3 +28,3 @@ name: 'HTML', | ||
parseTextSync: (text: string, options?: XMLLoaderOptions) => parseTextSync(text, options) | ||
}; | ||
} as const satisfies LoaderWithParser<any, never, HTMLLoaderOptions>; | ||
@@ -31,0 +31,0 @@ function testHTMLFile(text: string): boolean { |
@@ -20,3 +20,5 @@ // loaders.gl | ||
*/ | ||
export const XMLLoader: LoaderWithParser<any, never, XMLLoaderOptions> = { | ||
export const XMLLoader = { | ||
dataType: null as any, | ||
batchType: null as never, | ||
name: 'XML', | ||
@@ -46,3 +48,3 @@ id: 'xml', | ||
parseXMLSync(text, {...XMLLoader.options.xml, ...options?.xml}) | ||
}; | ||
} as const satisfies LoaderWithParser<any, never, XMLLoaderOptions>; | ||
@@ -49,0 +51,0 @@ function testXMLFile(text: string): boolean { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8778
426677
+ Added@loaders.gl/loader-utils@4.2.0-beta.1(transitive)
+ Added@loaders.gl/schema@4.2.0-beta.1(transitive)
+ Added@loaders.gl/worker-utils@4.2.0-beta.1(transitive)
- Removed@loaders.gl/loader-utils@4.2.0-alpha.6(transitive)
- Removed@loaders.gl/schema@4.2.0-alpha.6(transitive)
- Removed@loaders.gl/worker-utils@4.2.0-alpha.6(transitive)