@likable-hair/cciaa-service 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/dist/cciaa-service.cjs +8 -8
- package/dist/cciaa-service.cjs.map +1 -1
- package/dist/cciaa-service.js +284 -274
- package/dist/cciaa-service.js.map +1 -1
- package/package.json +2 -9
package/README.md
CHANGED
|
@@ -28,8 +28,6 @@ Install the package along with its required peer dependencies:
|
|
|
28
28
|
npm install @likable-hair/cciaa-service
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
> Puppeteer is listed as a peer dependency because it downloads a Chromium binary (~300MB) on install. This gives you full control over the version and avoids duplicate binaries if you already use Puppeteer in your project.
|
|
32
|
-
|
|
33
31
|
## Requirements
|
|
34
32
|
|
|
35
33
|
<ul>
|
package/dist/cciaa-service.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ct=":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=ct+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Bt="["+ct+"]["+kt+"]*",jt=new RegExp("^"+Bt+"$");function lt(e,t){const n=[];let r=t.exec(e);for(;r;){const s=[];s.startIndex=t.lastIndex-r[0].length;const o=r.length;for(let i=0;i<o;i++)s.push(r[i]);n.push(s),r=t.exec(e)}return n}const de=function(e){const t=jt.exec(e);return!(t===null||typeof t>"u")};function vt(e){return typeof e<"u"}const Mt={allowBooleanAttributes:!1,unpairedTags:[]};function $t(e,t){t=Object.assign({},Mt,t);const n=[];let r=!1,s=!1;e[0]==="\uFEFF"&&(e=e.substr(1));for(let o=0;o<e.length;o++)if(e[o]==="<"&&e[o+1]==="?"){if(o+=2,o=Ve(e,o),o.err)return o}else if(e[o]==="<"){let i=o;if(o++,e[o]==="!"){o=qe(e,o);continue}else{let
|
|
2
|
-
`&&e[o]!=="\r";o++)l+=e[o];if(l=l.trim(),l[l.length-1]==="/"&&(l=l.substring(0,l.length-1),o--),!Kt(l)){let d;return l.trim().length===0?d="Invalid space after '<'.":d="Tag '"+l+"' is an invalid name.",b("InvalidTag",d,
|
|
3
|
-
`||e==="\r"}function Ve(e,t){const n=t;for(;t<e.length;t++)if(e[t]=="?"||e[t]==" "){const r=e.substr(n,t-n);if(t>5&&r==="xml")return b("InvalidXml","XML declaration allowed only at the start of the document.",A(e,t));if(e[t]=="?"&&e[t+1]==">"){t++;break}else continue}return t}function qe(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 n=1;for(t+=8;t<e.length;t++)if(e[t]==="<")n++;else if(e[t]===">"&&(n--,n===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}const zt='"',Vt="'";function qt(e,t){let n="",r="",s=!1;for(;t<e.length;t++){if(e[t]===zt||e[t]===Vt)r===""?r=e[t]:r!==e[t]||(r="");else if(e[t]===">"&&r===""){s=!0;break}n+=e[t]}return r!==""?!1:{value:n,index:t,tagClosed:s}}const Ht=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function He(e,t){const n=lt(e,Ht),r={};for(let s=0;s<n.length;s++){if(n[s][1].length===0)return b("InvalidAttr","Attribute '"+n[s][2]+"' has no space in starting.",Y(n[s]));if(n[s][3]!==void 0&&n[s][4]===void 0)return b("InvalidAttr","Attribute '"+n[s][2]+"' is without value.",Y(n[s]));if(n[s][3]===void 0&&!t.allowBooleanAttributes)return b("InvalidAttr","boolean attribute '"+n[s][2]+"' is not allowed.",Y(n[s]));const o=n[s][2];if(!Xt(o))return b("InvalidAttr","Attribute '"+o+"' is an invalid name.",Y(n[s]));if(!r.hasOwnProperty(o))r[o]=1;else return b("InvalidAttr","Attribute '"+o+"' is repeated.",Y(n[s]))}return!0}function Jt(e,t){let n=/\d/;for(e[t]==="x"&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(e[t]===";")return t;if(!e[t].match(n))break}return-1}function Wt(e,t){if(t++,e[t]===";")return-1;if(e[t]==="#")return t++,Jt(e,t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(e[t]===";")break;return-1}return t}function b(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function Xt(e){return de(e)}function Kt(e){return de(e)}function A(e,t){const n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function Y(e){return e.startIndex+e[1].length}const Yt={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,n){return e},captureMetaData:!1};function ut(e){return typeof e=="boolean"?{enabled:e,maxEntitySize:1e4,maxExpansionDepth:10,maxTotalExpansions:1e3,maxExpandedLength:1e5,allowedTags:null,tagFilter:null}:typeof e=="object"&&e!==null?{enabled:e.enabled!==!1,maxEntitySize:e.maxEntitySize??1e4,maxExpansionDepth:e.maxExpansionDepth??10,maxTotalExpansions:e.maxTotalExpansions??1e3,maxExpandedLength:e.maxExpandedLength??1e5,allowedTags:e.allowedTags??null,tagFilter:e.tagFilter??null}:ut(!0)}const Zt=function(e){const t=Object.assign({},Yt,e);return t.processEntities=ut(t.processEntities),t};let ue;typeof Symbol!="function"?ue="@@xmlMetadata":ue=Symbol("XML Node Metadata");class ${constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,n){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:n})}addChild(t,n){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}),n!==void 0&&(this.child[this.child.length-1][ue]={startIndex:n})}static getMetaDataSymbol(){return ue}}class Gt{constructor(t){this.suppressValidationErr=!t,this.options=t}readDocType(t,n){const r={};if(t[n+3]==="O"&&t[n+4]==="C"&&t[n+5]==="T"&&t[n+6]==="Y"&&t[n+7]==="P"&&t[n+8]==="E"){n=n+9;let s=1,o=!1,i=!1,a="";for(;n<t.length;n++)if(t[n]==="<"&&!i){if(o&&M(t,"!ENTITY",n)){n+=7;let l,c;if([l,c,n]=this.readEntityExp(t,n+1,this.suppressValidationErr),c.indexOf("&")===-1){const f=l.replace(/[.\-+*:]/g,"\\.");r[l]={regx:RegExp(`&${f};`,"g"),val:c}}}else if(o&&M(t,"!ELEMENT",n)){n+=8;const{index:l}=this.readElementExp(t,n+1);n=l}else if(o&&M(t,"!ATTLIST",n))n+=8;else if(o&&M(t,"!NOTATION",n)){n+=9;const{index:l}=this.readNotationExp(t,n+1,this.suppressValidationErr);n=l}else if(M(t,"!--",n))i=!0;else throw new Error("Invalid DOCTYPE");s++,a=""}else if(t[n]===">"){if(i?t[n-1]==="-"&&t[n-2]==="-"&&(i=!1,s--):s--,s===0)break}else t[n]==="["?o=!0:a+=t[n];if(s!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:r,i:n}}readEntityExp(t,n){n=I(t,n);let r="";for(;n<t.length&&!/\s/.test(t[n])&&t[n]!=='"'&&t[n]!=="'";)r+=t[n],n++;if(Z(r),n=I(t,n),!this.suppressValidationErr){if(t.substring(n,n+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(t[n]==="%")throw new Error("Parameter entities are not supported")}let s="";if([n,s]=this.readIdentifierVal(t,n,"entity"),this.options.enabled!==!1&&this.options.maxEntitySize&&s.length>this.options.maxEntitySize)throw new Error(`Entity "${r}" size (${s.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return n--,[r,s,n]}readNotationExp(t,n){n=I(t,n);let r="";for(;n<t.length&&!/\s/.test(t[n]);)r+=t[n],n++;!this.suppressValidationErr&&Z(r),n=I(t,n);const s=t.substring(n,n+6).toUpperCase();if(!this.suppressValidationErr&&s!=="SYSTEM"&&s!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${s}"`);n+=s.length,n=I(t,n);let o=null,i=null;if(s==="PUBLIC")[n,o]=this.readIdentifierVal(t,n,"publicIdentifier"),n=I(t,n),(t[n]==='"'||t[n]==="'")&&([n,i]=this.readIdentifierVal(t,n,"systemIdentifier"));else if(s==="SYSTEM"&&([n,i]=this.readIdentifierVal(t,n,"systemIdentifier"),!this.suppressValidationErr&&!i))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:r,publicIdentifier:o,systemIdentifier:i,index:--n}}readIdentifierVal(t,n,r){let s="";const o=t[n];if(o!=='"'&&o!=="'")throw new Error(`Expected quoted string, found "${o}"`);for(n++;n<t.length&&t[n]!==o;)s+=t[n],n++;if(t[n]!==o)throw new Error(`Unterminated ${r} value`);return n++,[n,s]}readElementExp(t,n){n=I(t,n);let r="";for(;n<t.length&&!/\s/.test(t[n]);)r+=t[n],n++;if(!this.suppressValidationErr&&!de(r))throw new Error(`Invalid element name: "${r}"`);n=I(t,n);let s="";if(t[n]==="E"&&M(t,"MPTY",n))n+=4;else if(t[n]==="A"&&M(t,"NY",n))n+=2;else if(t[n]==="("){for(n++;n<t.length&&t[n]!==")";)s+=t[n],n++;if(t[n]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${t[n]}"`);return{elementName:r,contentModel:s.trim(),index:n}}readAttlistExp(t,n){n=I(t,n);let r="";for(;n<t.length&&!/\s/.test(t[n]);)r+=t[n],n++;Z(r),n=I(t,n);let s="";for(;n<t.length&&!/\s/.test(t[n]);)s+=t[n],n++;if(!Z(s))throw new Error(`Invalid attribute name: "${s}"`);n=I(t,n);let o="";if(t.substring(n,n+8).toUpperCase()==="NOTATION"){if(o="NOTATION",n+=8,n=I(t,n),t[n]!=="(")throw new Error(`Expected '(', found "${t[n]}"`);n++;let a=[];for(;n<t.length&&t[n]!==")";){let l="";for(;n<t.length&&t[n]!=="|"&&t[n]!==")";)l+=t[n],n++;if(l=l.trim(),!Z(l))throw new Error(`Invalid notation name: "${l}"`);a.push(l),t[n]==="|"&&(n++,n=I(t,n))}if(t[n]!==")")throw new Error("Unterminated list of notations");n++,o+=" ("+a.join("|")+")"}else{for(;n<t.length&&!/\s/.test(t[n]);)o+=t[n],n++;const a=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!a.includes(o.toUpperCase()))throw new Error(`Invalid attribute type: "${o}"`)}n=I(t,n);let i="";return t.substring(n,n+8).toUpperCase()==="#REQUIRED"?(i="#REQUIRED",n+=8):t.substring(n,n+7).toUpperCase()==="#IMPLIED"?(i="#IMPLIED",n+=7):[n,i]=this.readIdentifierVal(t,n,"ATTLIST"),{elementName:r,attributeName:s,attributeType:o,defaultValue:i,index:n}}}const I=(e,t)=>{for(;t<e.length&&/\s/.test(e[t]);)t++;return t};function M(e,t,n){for(let r=0;r<t.length;r++)if(t[r]!==e[n+r+1])return!1;return!0}function Z(e){if(de(e))return e;throw new Error(`Invalid entity name ${e}`)}const Qt=/^[-+]?0x[a-fA-F0-9]+$/,Dt=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,en={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function tn(e,t={}){if(t=Object.assign({},en,t),!e||typeof e!="string")return e;let n=e.trim();if(t.skipLike!==void 0&&t.skipLike.test(n))return e;if(e==="0")return 0;if(t.hex&&Qt.test(n))return on(n,16);if(n.includes("e")||n.includes("E"))return rn(e,n,t);{const r=Dt.exec(n);if(r){const s=r[1]||"",o=r[2];let i=sn(r[3]);const a=s?e[o.length+1]===".":e[o.length]===".";if(!t.leadingZeros&&(o.length>1||o.length===1&&!a))return e;{const l=Number(n),c=String(l);if(l===0)return l;if(c.search(/[eE]/)!==-1)return t.eNotation?l:e;if(n.indexOf(".")!==-1)return c==="0"||c===i||c===`${s}${i}`?l:e;let f=o?i:n;return o?f===c||s+f===c?l:e:f===c||f===s+c?l:e}}else return e}}const nn=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function rn(e,t,n){if(!n.eNotation)return e;const r=t.match(nn);if(r){let s=r[1]||"";const o=r[3].indexOf("e")===-1?"E":"e",i=r[2],a=s?e[i.length+1]===o:e[i.length]===o;return i.length>1&&a?e:i.length===1&&(r[3].startsWith(`.${o}`)||r[3][0]===o)?Number(t):n.leadingZeros&&!a?(t=(r[1]||"")+r[3],Number(t)):e}else return e}function sn(e){return e&&e.indexOf(".")!==-1&&(e=e.replace(/0+$/,""),e==="."?e="0":e[0]==="."?e="0"+e:e[e.length-1]==="."&&(e=e.substring(0,e.length-1))),e}function on(e,t){if(parseInt)return parseInt(e,t);if(Number.parseInt)return Number.parseInt(e,t);if(window&&window.parseInt)return window.parseInt(e,t);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function an(e){return typeof e=="function"?e:Array.isArray(e)?t=>{for(const n of e)if(typeof n=="string"&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}class cn{constructor(t){if(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:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(n,r)=>Je(r,10,"&#")},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(n,r)=>Je(r,16,"&#x")}},this.addExternalEntities=ln,this.parseXml=hn,this.parseTextData=un,this.resolveNameSpace=fn,this.buildAttributesMap=pn,this.isItStopNode=yn,this.replaceEntitiesValue=mn,this.readStopNodeData=wn,this.saveTextToParentTag=En,this.addChild=gn,this.ignoreAttributesFn=an(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0,this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodesExact=new Set,this.stopNodesWildcard=new Set;for(let n=0;n<this.options.stopNodes.length;n++){const r=this.options.stopNodes[n];typeof r=="string"&&(r.startsWith("*.")?this.stopNodesWildcard.add(r.substring(2)):this.stopNodesExact.add(r))}}}}function ln(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const r=t[n],s=r.replace(/[.\-+*:]/g,"\\.");this.lastEntities[r]={regex:new RegExp("&"+s+";","g"),val:e[r]}}}function un(e,t,n,r,s,o,i){if(e!==void 0&&(this.options.trimValues&&!r&&(e=e.trim()),e.length>0)){i||(e=this.replaceEntitiesValue(e,t,n));const a=this.options.tagValueProcessor(t,e,n,s,o);return a==null?e:typeof a!=typeof e||a!==e?a:this.options.trimValues?Ae(e,this.options.parseTagValue,this.options.numberParseOptions):e.trim()===e?Ae(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function fn(e){if(this.options.removeNSPrefix){const t=e.split(":"),n=e.charAt(0)==="/"?"/":"";if(t[0]==="xmlns")return"";t.length===2&&(e=n+t[1])}return e}const dn=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function pn(e,t,n){if(this.options.ignoreAttributes!==!0&&typeof e=="string"){const r=lt(e,dn),s=r.length,o={};for(let i=0;i<s;i++){const a=this.resolveNameSpace(r[i][1]);if(this.ignoreAttributesFn(a,t))continue;let l=r[i][4],c=this.options.attributeNamePrefix+a;if(a.length)if(this.options.transformAttributeName&&(c=this.options.transformAttributeName(c)),c==="__proto__"&&(c="#__proto__"),l!==void 0){this.options.trimValues&&(l=l.trim()),l=this.replaceEntitiesValue(l,n,t);const f=this.options.attributeValueProcessor(a,l,t);f==null?o[c]=l:typeof f!=typeof l||f!==l?o[c]=f:o[c]=Ae(l,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(o[c]=!0)}if(!Object.keys(o).length)return;if(this.options.attributesGroupName){const i={};return i[this.options.attributesGroupName]=o,i}return o}}const hn=function(e){e=e.replace(/\r\n?/g,`
|
|
4
|
-
`);const t=new $("!xml");let n=t,r="",s="";this.entityExpansionCount=0,this.currentExpandedLength=0;const o=new Gt(this.options.processEntities);for(let i=0;i<e.length;i++)if(e[i]==="<")if(e[i+1]==="/"){const l=z(e,">",i,"Closing Tag is not closed.");let c=e.substring(i+2,l).trim();if(this.options.removeNSPrefix){const E=c.indexOf(":");E!==-1&&(c=c.substr(E+1))}this.options.transformTagName&&(c=this.options.transformTagName(c)),n&&(r=this.saveTextToParentTag(r,n,s));const f=s.substring(s.lastIndexOf(".")+1);if(c&&this.options.unpairedTags.indexOf(c)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${c}>`);let d=0;f&&this.options.unpairedTags.indexOf(f)!==-1?(d=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):d=s.lastIndexOf("."),s=s.substring(0,d),n=this.tagsNodeStack.pop(),r="",i=l}else if(e[i+1]==="?"){let l=Re(e,i,!1,"?>");if(!l)throw new Error("Pi Tag is not closed.");if(r=this.saveTextToParentTag(r,n,s),!(this.options.ignoreDeclaration&&l.tagName==="?xml"||this.options.ignorePiTags)){const c=new $(l.tagName);c.add(this.options.textNodeName,""),l.tagName!==l.tagExp&&l.attrExpPresent&&(c[":@"]=this.buildAttributesMap(l.tagExp,s,l.tagName)),this.addChild(n,c,s,i)}i=l.closeIndex+1}else if(e.substr(i+1,3)==="!--"){const l=z(e,"-->",i+4,"Comment is not closed.");if(this.options.commentPropName){const c=e.substring(i+4,l-2);r=this.saveTextToParentTag(r,n,s),n.add(this.options.commentPropName,[{[this.options.textNodeName]:c}])}i=l}else if(e.substr(i+1,2)==="!D"){const l=o.readDocType(e,i);this.docTypeEntities=l.entities,i=l.i}else if(e.substr(i+1,2)==="!["){const l=z(e,"]]>",i,"CDATA is not closed.")-2,c=e.substring(i+9,l);r=this.saveTextToParentTag(r,n,s);let f=this.parseTextData(c,n.tagname,s,!0,!1,!0,!0);f==null&&(f=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:c}]):n.add(this.options.textNodeName,f),i=l+2}else{let l=Re(e,i,this.options.removeNSPrefix),c=l.tagName;const f=l.rawTagName;let d=l.tagExp,E=l.attrExpPresent,T=l.closeIndex;if(this.options.transformTagName){const h=this.options.transformTagName(c);d===c&&(d=h),c=h}n&&r&&n.tagname!=="!xml"&&(r=this.saveTextToParentTag(r,n,s,!1));const p=n;p&&this.options.unpairedTags.indexOf(p.tagname)!==-1&&(n=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),c!==t.tagname&&(s+=s?"."+c:c);const g=i;if(this.isItStopNode(this.stopNodesExact,this.stopNodesWildcard,s,c)){let h="";if(d.length>0&&d.lastIndexOf("/")===d.length-1)c[c.length-1]==="/"?(c=c.substr(0,c.length-1),s=s.substr(0,s.length-1),d=c):d=d.substr(0,d.length-1),i=l.closeIndex;else if(this.options.unpairedTags.indexOf(c)!==-1)i=l.closeIndex;else{const N=this.readStopNodeData(e,f,T+1);if(!N)throw new Error(`Unexpected end of ${f}`);i=N.i,h=N.tagContent}const y=new $(c);c!==d&&E&&(y[":@"]=this.buildAttributesMap(d,s,c)),h&&(h=this.parseTextData(h,c,s,!0,E,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),y.add(this.options.textNodeName,h),this.addChild(n,y,s,g)}else{if(d.length>0&&d.lastIndexOf("/")===d.length-1){if(c[c.length-1]==="/"?(c=c.substr(0,c.length-1),s=s.substr(0,s.length-1),d=c):d=d.substr(0,d.length-1),this.options.transformTagName){const y=this.options.transformTagName(c);d===c&&(d=y),c=y}const h=new $(c);c!==d&&E&&(h[":@"]=this.buildAttributesMap(d,s,c)),this.addChild(n,h,s,g),s=s.substr(0,s.lastIndexOf("."))}else{const h=new $(c);this.tagsNodeStack.push(n),c!==d&&E&&(h[":@"]=this.buildAttributesMap(d,s,c)),this.addChild(n,h,s,g),n=h}r="",i=T}}else r+=e[i];return t.child};function gn(e,t,n,r){this.options.captureMetaData||(r=void 0);const s=this.options.updateTag(t.tagname,n,t[":@"]);s===!1||(typeof s=="string"&&(t.tagname=s),e.addChild(t,r))}const mn=function(e,t,n){if(e.indexOf("&")===-1)return e;const r=this.options.processEntities;if(!r.enabled||r.allowedTags&&!r.allowedTags.includes(t)||r.tagFilter&&!r.tagFilter(t,n))return e;for(let s in this.docTypeEntities){const o=this.docTypeEntities[s],i=e.match(o.regx);if(i){if(this.entityExpansionCount+=i.length,r.maxTotalExpansions&&this.entityExpansionCount>r.maxTotalExpansions)throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${r.maxTotalExpansions}`);const a=e.length;if(e=e.replace(o.regx,o.val),r.maxExpandedLength&&(this.currentExpandedLength+=e.length-a,this.currentExpandedLength>r.maxExpandedLength))throw new Error(`Total expanded content size exceeded: ${this.currentExpandedLength} > ${r.maxExpandedLength}`)}}if(e.indexOf("&")===-1)return e;for(let s in this.lastEntities){const o=this.lastEntities[s];e=e.replace(o.regex,o.val)}if(e.indexOf("&")===-1)return e;if(this.options.htmlEntities)for(let s in this.htmlEntities){const o=this.htmlEntities[s];e=e.replace(o.regex,o.val)}return e=e.replace(this.ampEntity.regex,this.ampEntity.val),e};function En(e,t,n,r){return e&&(r===void 0&&(r=t.child.length===0),e=this.parseTextData(e,t.tagname,n,!1,t[":@"]?Object.keys(t[":@"]).length!==0:!1,r),e!==void 0&&e!==""&&t.add(this.options.textNodeName,e),e=""),e}function yn(e,t,n,r){return!!(t&&t.has(r)||e&&e.has(n))}function bn(e,t,n=">"){let r,s="";for(let o=t;o<e.length;o++){let i=e[o];if(r)i===r&&(r="");else if(i==='"'||i==="'")r=i;else if(i===n[0])if(n[1]){if(e[o+1]===n[1])return{data:s,index:o}}else return{data:s,index:o};else i===" "&&(i=" ");s+=i}}function z(e,t,n,r){const s=e.indexOf(t,n);if(s===-1)throw new Error(r);return s+t.length-1}function Re(e,t,n,r=">"){const s=bn(e,t+1,r);if(!s)return;let o=s.data;const i=s.index,a=o.search(/\s/);let l=o,c=!0;a!==-1&&(l=o.substring(0,a),o=o.substring(a+1).trimStart());const f=l;if(n){const d=l.indexOf(":");d!==-1&&(l=l.substr(d+1),c=l!==s.data.substr(d+1))}return{tagName:l,tagExp:o,closeIndex:i,attrExpPresent:c,rawTagName:f}}function wn(e,t,n){const r=n;let s=1;for(;n<e.length;n++)if(e[n]==="<")if(e[n+1]==="/"){const o=z(e,">",n,`${t} is not closed`);if(e.substring(n+2,o).trim()===t&&(s--,s===0))return{tagContent:e.substring(r,n),i:o};n=o}else if(e[n+1]==="?")n=z(e,"?>",n+1,"StopNode is not closed.");else if(e.substr(n+1,3)==="!--")n=z(e,"-->",n+3,"StopNode is not closed.");else if(e.substr(n+1,2)==="![")n=z(e,"]]>",n,"StopNode is not closed.")-2;else{const o=Re(e,n,">");o&&((o&&o.tagName)===t&&o.tagExp[o.tagExp.length-1]!=="/"&&s++,n=o.closeIndex)}}function Ae(e,t,n){if(t&&typeof e=="string"){const r=e.trim();return r==="true"?!0:r==="false"?!1:tn(e,n)}else return vt(e)?e:""}function Je(e,t,n){const r=Number.parseInt(e,t);return r>=0&&r<=1114111?String.fromCodePoint(r):n+e+";"}const we=$.getMetaDataSymbol();function Tn(e,t){return ft(e,t)}function ft(e,t,n){let r;const s={};for(let o=0;o<e.length;o++){const i=e[o],a=Sn(i);let l="";if(n===void 0?l=a:l=n+"."+a,a===t.textNodeName)r===void 0?r=i[a]:r+=""+i[a];else{if(a===void 0)continue;if(i[a]){let c=ft(i[a],t,l);const f=Rn(c,t);i[we]!==void 0&&(c[we]=i[we]),i[":@"]?Nn(c,i[":@"],l,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=""),s[a]!==void 0&&s.hasOwnProperty(a)?(Array.isArray(s[a])||(s[a]=[s[a]]),s[a].push(c)):t.isArray(a,l,f)?s[a]=[c]:s[a]=c}}}return typeof r=="string"?r.length>0&&(s[t.textNodeName]=r):r!==void 0&&(s[t.textNodeName]=r),s}function Sn(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const r=t[n];if(r!==":@")return r}}function Nn(e,t,n,r){if(t){const s=Object.keys(t),o=s.length;for(let i=0;i<o;i++){const a=s[i];r.isArray(a,n+"."+a,!0,!0)?e[a]=[t[a]]:e[a]=t[a]}}}function Rn(e,t){const{textNodeName:n}=t,r=Object.keys(e).length;return!!(r===0||r===1&&(e[n]||typeof e[n]=="boolean"||e[n]===0))}class An{constructor(t){this.externalEntities={},this.options=Zt(t)}parse(t,n){if(typeof t!="string"&&t.toString)t=t.toString();else if(typeof t!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(n){n===!0&&(n={});const o=$t(t,n);if(o!==!0)throw Error(`${o.err.msg}:${o.err.line}:${o.err.col}`)}const r=new cn(this.options);r.addExternalEntities(this.externalEntities);const s=r.parseXml(t);return this.options.preserveOrder||s===void 0?s:Tn(s,this.options)}addEntity(t,n){if(n.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(n==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=n}static getMetaDataSymbol(){return $.getMetaDataSymbol()}}function On(e){return{companyName:e.Denominazione,companyFiscalCode:e.CodFisc,companyVatNumber:e.PIva,companyLegalFormCode:e.NatGiu,companyLegalFormDescription:e.DescNatGiu,companyCciaaCode:e.Cciaa,companyCciaaDescription:e.DescCciaa,companyReaNumber:e.NRea,companyStatusCode:e.StatoAttivita,companyStatusDescription:e.DescStatoAttivita,companyRegistryStatusCode:e.StatoAttivitaReg,companyRegistryStatusDescription:e.DescStatoAttivitaReg,companySourceCode:e.Fonte,companySourceDescription:e.DescFonte,companyDeclaredActivity:e.AttivitaDichiarata,companyAtecoCode:e.ClassificazioneAteco.CodAttivita,companyAtecoDescription:e.ClassificazioneAteco.DescAttivita,companyAtecoClassificationCode:e.ClassificazioneAteco.CodCodifica,companyAtecoClassificationDescription:e.ClassificazioneAteco.DescCodifica,companyProvinceCode:e.IndirizzoSede.SglPrvSede,companyProvinceDescription:e.IndirizzoSede.DescPrvSede,companyMunicipalityCode:e.IndirizzoSede.CodComSede,companyMunicipalityDescription:e.IndirizzoSede.DescComSede,companyToponymCode:e.IndirizzoSede.CodToponSede,companyToponymDescription:e.IndirizzoSede.DescToponSede,companyStreet:e.IndirizzoSede.ViaSede,companyStreetNumber:String(e.IndirizzoSede.NCivicoSede),companyPostalCode:e.IndirizzoSede.CapSede,companyPec:e.IndirizzoPostaCertificata,companyShares:null,companyProfit:null,companyRevenue:null,companyIncorporationDate:null}}class Cn{constructor(t){Object.defineProperty(this,"client",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"parser",{enumerable:!0,configurable:!0,writable:!0,value:new An({ignoreAttributes:!1,attributeNamePrefix:""})})}async getCompanySummaryByVatNumber(t){try{const n=await this.client.get("/registroimprese/imprese/ricerca/partitaiva",{params:{partitaIva:t,fSoloSedi:"S"}});switch(n.status){case 200:break;case 404:throw new Error("Impresa non trovata");case 503:throw new Error("Servizio temporaneamente non disponibile");default:throw new Error(`Errore HTTP CCIAA ${n.status}`)}const r=this.parser.parse(n.data),s=r.Risposta.ListaImpreseRI.Impresa.AnagraficaImpresa;if(!s)throw new Error(`Impresa non trovata. Risposta: ${JSON.stringify(r.Risposta.Testata.Riepilogo)}`);return On(s)}catch(n){throw n&&new Error(`Errore HTTP CCIAA ${n}`)}}checkErrors(t){const n=t.Risposta.Testata.Messaggio;if(n&&n.GravitaErrore==="E")throw new Error(`[${n.CodiceErrore}] ${n.DescrizioneErrore}`)}}function dt(e,t){return function(){return e.apply(t,arguments)}}const{toString:In}=Object.prototype,{getPrototypeOf:xe}=Object,{iterator:pe,toStringTag:pt}=Symbol,he=(e=>t=>{const n=In.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),U=e=>(e=e.toLowerCase(),t=>he(t)===e),ge=e=>t=>typeof t===e,{isArray:X}=Array,W=ge("undefined");function Q(e){return e!==null&&!W(e)&&e.constructor!==null&&!W(e.constructor)&&P(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ht=U("ArrayBuffer");function Pn(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ht(e.buffer),t}const xn=ge("string"),P=ge("function"),gt=ge("number"),D=e=>e!==null&&typeof e=="object",_n=e=>e===!0||e===!1,ae=e=>{if(he(e)!=="object")return!1;const t=xe(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(pt in e)&&!(pe in e)},Fn=e=>{if(!D(e)||Q(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Ln=U("Date"),Un=U("File"),kn=U("Blob"),Bn=U("FileList"),jn=e=>D(e)&&P(e.pipe),vn=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||P(e.append)&&((t=he(e))==="formdata"||t==="object"&&P(e.toString)&&e.toString()==="[object FormData]"))},Mn=U("URLSearchParams"),[$n,zn,Vn,qn]=["ReadableStream","Request","Response","Headers"].map(U),Hn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ee(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),X(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Q(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let a;for(r=0;r<i;r++)a=o[r],t.call(null,e[a],a,e)}}function mt(e,t){if(Q(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const V=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Et=e=>!W(e)&&e!==V;function Oe(){const{caseless:e,skipUndefined:t}=Et(this)&&this||{},n={},r=(s,o)=>{if(o==="__proto__"||o==="constructor"||o==="prototype")return;const i=e&&mt(n,o)||o;ae(n[i])&&ae(s)?n[i]=Oe(n[i],s):ae(s)?n[i]=Oe({},s):X(s)?n[i]=s.slice():(!t||!W(s))&&(n[i]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&ee(arguments[s],r);return n}const Jn=(e,t,n,{allOwnKeys:r}={})=>(ee(t,(s,o)=>{n&&P(s)?Object.defineProperty(e,o,{value:dt(s,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),Wn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Xn=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Kn=(e,t,n,r)=>{let s,o,i;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=n!==!1&&xe(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Yn=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Zn=e=>{if(!e)return null;if(X(e))return e;let t=e.length;if(!gt(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Gn=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&xe(Uint8Array)),Qn=(e,t)=>{const r=(e&&e[pe]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},Dn=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},er=U("HTMLFormElement"),tr=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),We=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),nr=U("RegExp"),yt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ee(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},rr=e=>{yt(e,(t,n)=>{if(P(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(P(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},sr=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return X(e)?r(e):r(String(e).split(t)),n},or=()=>{},ir=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function ar(e){return!!(e&&P(e.append)&&e[pt]==="FormData"&&e[pe])}const cr=e=>{const t=new Array(10),n=(r,s)=>{if(D(r)){if(t.indexOf(r)>=0)return;if(Q(r))return r;if(!("toJSON"in r)){t[s]=r;const o=X(r)?[]:{};return ee(r,(i,a)=>{const l=n(i,s+1);!W(l)&&(o[a]=l)}),t[s]=void 0,o}}return r};return n(e,0)},lr=U("AsyncFunction"),ur=e=>e&&(D(e)||P(e))&&P(e.then)&&P(e.catch),bt=((e,t)=>e?setImmediate:t?((n,r)=>(V.addEventListener("message",({source:s,data:o})=>{s===V&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),V.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",P(V.postMessage)),fr=typeof queueMicrotask<"u"?queueMicrotask.bind(V):typeof process<"u"&&process.nextTick||bt,dr=e=>e!=null&&P(e[pe]),u={isArray:X,isArrayBuffer:ht,isBuffer:Q,isFormData:vn,isArrayBufferView:Pn,isString:xn,isNumber:gt,isBoolean:_n,isObject:D,isPlainObject:ae,isEmptyObject:Fn,isReadableStream:$n,isRequest:zn,isResponse:Vn,isHeaders:qn,isUndefined:W,isDate:Ln,isFile:Un,isBlob:kn,isRegExp:nr,isFunction:P,isStream:jn,isURLSearchParams:Mn,isTypedArray:Gn,isFileList:Bn,forEach:ee,merge:Oe,extend:Jn,trim:Hn,stripBOM:Wn,inherits:Xn,toFlatObject:Kn,kindOf:he,kindOfTest:U,endsWith:Yn,toArray:Zn,forEachEntry:Qn,matchAll:Dn,isHTMLForm:er,hasOwnProperty:We,hasOwnProp:We,reduceDescriptors:yt,freezeMethods:rr,toObjectSet:sr,toCamelCase:tr,noop:or,toFiniteNumber:ir,findKey:mt,global:V,isContextDefined:Et,isSpecCompliantForm:ar,toJSONObject:cr,isAsyncFn:lr,isThenable:ur,setImmediate:bt,asap:fr,isIterable:dr};let m=class wt extends Error{static from(t,n,r,s,o,i){const a=new wt(t.message,n||t.code,r,s,o);return a.cause=t,a.name=t.name,i&&Object.assign(a,i),a}constructor(t,n,r,s,o){super(t),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),s&&(this.request=s),o&&(this.response=o,this.status=o.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:u.toJSONObject(this.config),code:this.code,status:this.status}}};m.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";m.ERR_BAD_OPTION="ERR_BAD_OPTION";m.ECONNABORTED="ECONNABORTED";m.ETIMEDOUT="ETIMEDOUT";m.ERR_NETWORK="ERR_NETWORK";m.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";m.ERR_DEPRECATED="ERR_DEPRECATED";m.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";m.ERR_BAD_REQUEST="ERR_BAD_REQUEST";m.ERR_CANCELED="ERR_CANCELED";m.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";m.ERR_INVALID_URL="ERR_INVALID_URL";const pr=null;function Ce(e){return u.isPlainObject(e)||u.isArray(e)}function Tt(e){return u.endsWith(e,"[]")?e.slice(0,-2):e}function Xe(e,t,n){return e?e.concat(t).map(function(s,o){return s=Tt(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function hr(e){return u.isArray(e)&&!e.some(Ce)}const gr=u.toFlatObject(u,{},null,function(t){return/^is[A-Z]/.test(t)});function me(e,t,n){if(!u.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=u.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,h){return!u.isUndefined(h[g])});const r=n.metaTokens,s=n.visitor||f,o=n.dots,i=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&u.isSpecCompliantForm(t);if(!u.isFunction(s))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(u.isDate(p))return p.toISOString();if(u.isBoolean(p))return p.toString();if(!l&&u.isBlob(p))throw new m("Blob is not supported. Use a Buffer instead.");return u.isArrayBuffer(p)||u.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function f(p,g,h){let y=p;if(p&&!h&&typeof p=="object"){if(u.endsWith(g,"{}"))g=r?g:g.slice(0,-2),p=JSON.stringify(p);else if(u.isArray(p)&&hr(p)||(u.isFileList(p)||u.endsWith(g,"[]"))&&(y=u.toArray(p)))return g=Tt(g),y.forEach(function(S,O){!(u.isUndefined(S)||S===null)&&t.append(i===!0?Xe([g],O,o):i===null?g:g+"[]",c(S))}),!1}return Ce(p)?!0:(t.append(Xe(h,g,o),c(p)),!1)}const d=[],E=Object.assign(gr,{defaultVisitor:f,convertValue:c,isVisitable:Ce});function T(p,g){if(!u.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(p),u.forEach(p,function(y,N){(!(u.isUndefined(y)||y===null)&&s.call(t,y,u.isString(N)?N.trim():N,g,E))===!0&&T(y,g?g.concat(N):[N])}),d.pop()}}if(!u.isObject(e))throw new TypeError("data must be an object");return T(e),t}function Ke(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function _e(e,t){this._pairs=[],e&&me(e,this,t)}const St=_e.prototype;St.append=function(t,n){this._pairs.push([t,n])};St.toString=function(t){const n=t?function(r){return t.call(this,r,Ke)}:Ke;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function mr(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Nt(e,t,n){if(!t)return e;const r=n&&n.encode||mr,s=u.isFunction(n)?{serialize:n}:n,o=s&&s.serialize;let i;if(o?i=o(t,s):i=u.isURLSearchParams(t)?t.toString():new _e(t,s).toString(r),i){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ye{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){u.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Fe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Er=typeof URLSearchParams<"u"?URLSearchParams:_e,yr=typeof FormData<"u"?FormData:null,br=typeof Blob<"u"?Blob:null,wr={isBrowser:!0,classes:{URLSearchParams:Er,FormData:yr,Blob:br},protocols:["http","https","file","blob","url","data"]},Le=typeof window<"u"&&typeof document<"u",Ie=typeof navigator=="object"&&navigator||void 0,Tr=Le&&(!Ie||["ReactNative","NativeScript","NS"].indexOf(Ie.product)<0),Sr=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Nr=Le&&window.location.href||"http://localhost",Rr=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Le,hasStandardBrowserEnv:Tr,hasStandardBrowserWebWorkerEnv:Sr,navigator:Ie,origin:Nr},Symbol.toStringTag,{value:"Module"})),R={...Rr,...wr};function Ar(e,t){return me(e,new R.classes.URLSearchParams,{visitor:function(n,r,s,o){return R.isNode&&u.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function Or(e){return u.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Cr(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function Rt(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),l=o>=n.length;return i=!i&&u.isArray(s)?s.length:i,l?(u.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!a):((!s[i]||!u.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&u.isArray(s[i])&&(s[i]=Cr(s[i])),!a)}if(u.isFormData(e)&&u.isFunction(e.entries)){const n={};return u.forEachEntry(e,(r,s)=>{t(Or(r),s,n,0)}),n}return null}function Ir(e,t,n){if(u.isString(e))try{return(t||JSON.parse)(e),u.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const te={transitional:Fe,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=u.isObject(t);if(o&&u.isHTMLForm(t)&&(t=new FormData(t)),u.isFormData(t))return s?JSON.stringify(Rt(t)):t;if(u.isArrayBuffer(t)||u.isBuffer(t)||u.isStream(t)||u.isFile(t)||u.isBlob(t)||u.isReadableStream(t))return t;if(u.isArrayBufferView(t))return t.buffer;if(u.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Ar(t,this.formSerializer).toString();if((a=u.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return me(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),Ir(t)):t}],transformResponse:[function(t){const n=this.transitional||te.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(u.isResponse(t)||u.isReadableStream(t))return t;if(t&&u.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(a){if(i)throw a.name==="SyntaxError"?m.from(a,m.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:R.classes.FormData,Blob:R.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};u.forEach(["delete","get","head","post","put","patch"],e=>{te.headers[e]={}});const Pr=u.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),xr=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
5
|
-
`).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&Pr[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Ze=Symbol("internals");function G(e){return e&&String(e).trim().toLowerCase()}function ce(e){return e===!1||e==null?e:u.isArray(e)?e.map(ce):String(e)}function _r(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Fr=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Te(e,t,n,r,s){if(u.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!u.isString(t)){if(u.isString(r))return t.indexOf(r)!==-1;if(u.isRegExp(r))return r.test(t)}}function Lr(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Ur(e,t){const n=u.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}let x=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(
|
|
6
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Ze]=this[Ze]={accessors:{}}).accessors,s=this.prototype;function o(i){const a=G(i);r[a]||(Ur(s,i),r[a]=!0)}return u.isArray(t)?t.forEach(o):o(t),this}};x.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);u.reduceDescriptors(x.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});u.freezeMethods(x);function Se(e,t){const n=this||te,r=t||n,s=x.from(r.headers);let o=r.data;return u.forEach(e,function(a){o=a.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function At(e){return!!(e&&e.__CANCEL__)}let ne=class extends m{constructor(t,n,r){super(t??"canceled",m.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function Ot(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new m("Request failed with status code "+n.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function kr(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Br(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),f=r[o];i||(i=c),n[s]=l,r[s]=c;let d=o,E=0;for(;d!==s;)E+=n[d++],d=d%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),c-i<t)return;const T=f&&c-f;return T?Math.round(E*1e3/T):void 0}}function jr(e,t){let n=0,r=1e3/t,s,o;const i=(c,f=Date.now())=>{n=f,s=null,o&&(clearTimeout(o),o=null),e(...c)};return[(...c)=>{const f=Date.now(),d=f-n;d>=r?i(c,f):(s=c,o||(o=setTimeout(()=>{o=null,i(s)},r-d)))},()=>s&&i(s)]}const fe=(e,t,n=3)=>{let r=0;const s=Br(50,250);return jr(o=>{const i=o.loaded,a=o.lengthComputable?o.total:void 0,l=i-r,c=s(l),f=i<=a;r=i;const d={loaded:i,total:a,progress:a?i/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&f?(a-i)/c:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},Ge=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Qe=e=>(...t)=>u.asap(()=>e(...t)),vr=R.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,R.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(R.origin),R.navigator&&/(msie|trident)/i.test(R.navigator.userAgent)):()=>!0,Mr=R.hasStandardBrowserEnv?{write(e,t,n,r,s,o,i){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];u.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),u.isString(r)&&a.push(`path=${r}`),u.isString(s)&&a.push(`domain=${s}`),o===!0&&a.push("secure"),u.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function $r(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function zr(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ct(e,t,n){let r=!$r(t);return e&&(r||n==!1)?zr(e,t):t}const De=e=>e instanceof x?{...e}:e;function H(e,t){t=t||{};const n={};function r(c,f,d,E){return u.isPlainObject(c)&&u.isPlainObject(f)?u.merge.call({caseless:E},c,f):u.isPlainObject(f)?u.merge({},f):u.isArray(f)?f.slice():f}function s(c,f,d,E){if(u.isUndefined(f)){if(!u.isUndefined(c))return r(void 0,c,d,E)}else return r(c,f,d,E)}function o(c,f){if(!u.isUndefined(f))return r(void 0,f)}function i(c,f){if(u.isUndefined(f)){if(!u.isUndefined(c))return r(void 0,c)}else return r(void 0,f)}function a(c,f,d){if(d in t)return r(c,f);if(d in e)return r(void 0,c)}const l={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(c,f,d)=>s(De(c),De(f),d,!0)};return u.forEach(Object.keys({...e,...t}),function(f){if(f==="__proto__"||f==="constructor"||f==="prototype")return;const d=u.hasOwnProp(l,f)?l[f]:s,E=d(e[f],t[f],f);u.isUndefined(E)&&d!==a||(n[f]=E)}),n}const It=e=>{const t=H({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:a}=t;if(t.headers=i=x.from(i),t.url=Nt(Ct(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),u.isFormData(n)){if(R.hasStandardBrowserEnv||R.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(u.isFunction(n.getHeaders)){const l=n.getHeaders(),c=["content-type","content-length"];Object.entries(l).forEach(([f,d])=>{c.includes(f.toLowerCase())&&i.set(f,d)})}}if(R.hasStandardBrowserEnv&&(r&&u.isFunction(r)&&(r=r(t)),r||r!==!1&&vr(t.url))){const l=s&&o&&Mr.read(o);l&&i.set(s,l)}return t},Vr=typeof XMLHttpRequest<"u",qr=Vr&&function(e){return new Promise(function(n,r){const s=It(e);let o=s.data;const i=x.from(s.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=s,f,d,E,T,p;function g(){T&&T(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(f),s.signal&&s.signal.removeEventListener("abort",f)}let h=new XMLHttpRequest;h.open(s.method.toUpperCase(),s.url,!0),h.timeout=s.timeout;function y(){if(!h)return;const S=x.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),L={data:!a||a==="text"||a==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:S,config:e,request:h};Ot(function(_){n(_),g()},function(_){r(_),g()},L),h=null}"onloadend"in h?h.onloadend=y:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(y)},h.onabort=function(){h&&(r(new m("Request aborted",m.ECONNABORTED,e,h)),h=null)},h.onerror=function(O){const L=O&&O.message?O.message:"Network Error",j=new m(L,m.ERR_NETWORK,e,h);j.event=O||null,r(j),h=null},h.ontimeout=function(){let O=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const L=s.transitional||Fe;s.timeoutErrorMessage&&(O=s.timeoutErrorMessage),r(new m(O,L.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,e,h)),h=null},o===void 0&&i.setContentType(null),"setRequestHeader"in h&&u.forEach(i.toJSON(),function(O,L){h.setRequestHeader(L,O)}),u.isUndefined(s.withCredentials)||(h.withCredentials=!!s.withCredentials),a&&a!=="json"&&(h.responseType=s.responseType),c&&([E,p]=fe(c,!0),h.addEventListener("progress",E)),l&&h.upload&&([d,T]=fe(l),h.upload.addEventListener("progress",d),h.upload.addEventListener("loadend",T)),(s.cancelToken||s.signal)&&(f=S=>{h&&(r(!S||S.type?new ne(null,e,h):S),h.abort(),h=null)},s.cancelToken&&s.cancelToken.subscribe(f),s.signal&&(s.signal.aborted?f():s.signal.addEventListener("abort",f)));const N=kr(s.url);if(N&&R.protocols.indexOf(N)===-1){r(new m("Unsupported protocol "+N+":",m.ERR_BAD_REQUEST,e));return}h.send(o||null)})},Hr=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(c){if(!s){s=!0,a();const f=c instanceof Error?c:this.reason;r.abort(f instanceof m?f:new ne(f instanceof Error?f.message:f))}};let i=t&&setTimeout(()=>{i=null,o(new m(`timeout of ${t}ms exceeded`,m.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(o):c.removeEventListener("abort",o)}),e=null)};e.forEach(c=>c.addEventListener("abort",o));const{signal:l}=r;return l.unsubscribe=()=>u.asap(a),l}},Jr=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},Wr=async function*(e,t){for await(const n of Xr(e))yield*Jr(n,t)},Xr=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},et=(e,t,n,r)=>{const s=Wr(e,t);let o=0,i,a=l=>{i||(i=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:c,value:f}=await s.next();if(c){a(),l.close();return}let d=f.byteLength;if(n){let E=o+=d;n(E)}l.enqueue(new Uint8Array(f))}catch(c){throw a(c),c}},cancel(l){return a(l),s.return()}},{highWaterMark:2})},tt=64*1024,{isFunction:ie}=u,Kr=(({Request:e,Response:t})=>({Request:e,Response:t}))(u.global),{ReadableStream:nt,TextEncoder:rt}=u.global,st=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Yr=e=>{e=u.merge.call({skipUndefined:!0},Kr,e);const{fetch:t,Request:n,Response:r}=e,s=t?ie(t):typeof fetch=="function",o=ie(n),i=ie(r);if(!s)return!1;const a=s&&ie(nt),l=s&&(typeof rt=="function"?(p=>g=>p.encode(g))(new rt):async p=>new Uint8Array(await new n(p).arrayBuffer())),c=o&&a&&st(()=>{let p=!1;const g=new n(R.origin,{body:new nt,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!g}),f=i&&a&&st(()=>u.isReadableStream(new r("").body)),d={stream:f&&(p=>p.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!d[p]&&(d[p]=(g,h)=>{let y=g&&g[p];if(y)return y.call(g);throw new m(`Response type '${p}' is not supported`,m.ERR_NOT_SUPPORT,h)})});const E=async p=>{if(p==null)return 0;if(u.isBlob(p))return p.size;if(u.isSpecCompliantForm(p))return(await new n(R.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(u.isArrayBufferView(p)||u.isArrayBuffer(p))return p.byteLength;if(u.isURLSearchParams(p)&&(p=p+""),u.isString(p))return(await l(p)).byteLength},T=async(p,g)=>{const h=u.toFiniteNumber(p.getContentLength());return h??E(g)};return async p=>{let{url:g,method:h,data:y,signal:N,cancelToken:S,timeout:O,onDownloadProgress:L,onUploadProgress:j,responseType:_,headers:ye,withCredentials:re="same-origin",fetchOptions:ke}=It(p),Be=t||fetch;_=_?(_+"").toLowerCase():"text";let se=Hr([N,S&&S.toAbortSignal()],O),K=null;const v=se&&se.unsubscribe&&(()=>{se.unsubscribe()});let je;try{if(j&&c&&h!=="get"&&h!=="head"&&(je=await T(ye,y))!==0){let B=new n(g,{method:"POST",body:y,duplex:"half"}),J;if(u.isFormData(y)&&(J=B.headers.get("content-type"))&&ye.setContentType(J),B.body){const[be,oe]=Ge(je,fe(Qe(j)));y=et(B.body,tt,be,oe)}}u.isString(re)||(re=re?"include":"omit");const C=o&&"credentials"in n.prototype,ve={...ke,signal:se,method:h.toUpperCase(),headers:ye.normalize().toJSON(),body:y,duplex:"half",credentials:C?re:void 0};K=o&&new n(g,ve);let k=await(o?Be(K,ke):Be(g,ve));const Me=f&&(_==="stream"||_==="response");if(f&&(L||Me&&v)){const B={};["status","statusText","headers"].forEach($e=>{B[$e]=k[$e]});const J=u.toFiniteNumber(k.headers.get("content-length")),[be,oe]=L&&Ge(J,fe(Qe(L),!0))||[];k=new r(et(k.body,tt,be,()=>{oe&&oe(),v&&v()}),B)}_=_||"text";let Ut=await d[u.findKey(d,_)||"text"](k,p);return!Me&&v&&v(),await new Promise((B,J)=>{Ot(B,J,{data:Ut,headers:x.from(k.headers),status:k.status,statusText:k.statusText,config:p,request:K})})}catch(C){throw v&&v(),C&&C.name==="TypeError"&&/Load failed|fetch/i.test(C.message)?Object.assign(new m("Network Error",m.ERR_NETWORK,p,K,C&&C.response),{cause:C.cause||C}):m.from(C,C&&C.code,p,K,C&&C.response)}}},Zr=new Map,Pt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,o=[r,s,n];let i=o.length,a=i,l,c,f=Zr;for(;a--;)l=o[a],c=f.get(l),c===void 0&&f.set(l,c=a?new Map:Yr(t)),f=c;return c};Pt();const Ue={http:pr,xhr:qr,fetch:{get:Pt}};u.forEach(Ue,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ot=e=>`- ${e}`,Gr=e=>u.isFunction(e)||e===null||e===!1;function Qr(e,t){e=u.isArray(e)?e:[e];const{length:n}=e;let r,s;const o={};for(let i=0;i<n;i++){r=e[i];let a;if(s=r,!Gr(r)&&(s=Ue[(a=String(r)).toLowerCase()],s===void 0))throw new m(`Unknown adapter '${a}'`);if(s&&(u.isFunction(s)||(s=s.get(t))))break;o[a||"#"+i]=s}if(!s){const i=Object.entries(o).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=n?i.length>1?`since :
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ct=":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=ct+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Bt="["+ct+"]["+kt+"]*",jt=new RegExp("^"+Bt+"$");function lt(e,t){const n=[];let r=t.exec(e);for(;r;){const s=[];s.startIndex=t.lastIndex-r[0].length;const o=r.length;for(let i=0;i<o;i++)s.push(r[i]);n.push(s),r=t.exec(e)}return n}const de=function(e){const t=jt.exec(e);return!(t===null||typeof t>"u")};function vt(e){return typeof e<"u"}const Mt={allowBooleanAttributes:!1,unpairedTags:[]};function $t(e,t){t=Object.assign({},Mt,t);const n=[];let r=!1,s=!1;e[0]==="\uFEFF"&&(e=e.substr(1));for(let o=0;o<e.length;o++)if(e[o]==="<"&&e[o+1]==="?"){if(o+=2,o=Ve(e,o),o.err)return o}else if(e[o]==="<"){let i=o;if(o++,e[o]==="!"){o=qe(e,o);continue}else{let c=!1;e[o]==="/"&&(c=!0,o++);let l="";for(;o<e.length&&e[o]!==">"&&e[o]!==" "&&e[o]!==" "&&e[o]!==`
|
|
2
|
+
`&&e[o]!=="\r";o++)l+=e[o];if(l=l.trim(),l[l.length-1]==="/"&&(l=l.substring(0,l.length-1),o--),!Kt(l)){let d;return l.trim().length===0?d="Invalid space after '<'.":d="Tag '"+l+"' is an invalid name.",b("InvalidTag",d,R(e,o))}const a=qt(e,o);if(a===!1)return b("InvalidAttr","Attributes for '"+l+"' have open quote.",R(e,o));let f=a.value;if(o=a.index,f[f.length-1]==="/"){const d=o-f.length;f=f.substring(0,f.length-1);const E=He(f,t);if(E===!0)r=!0;else return b(E.err.code,E.err.msg,R(e,d+E.err.line))}else if(c)if(a.tagClosed){if(f.trim().length>0)return b("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",R(e,i));if(n.length===0)return b("InvalidTag","Closing tag '"+l+"' has not been opened.",R(e,i));{const d=n.pop();if(l!==d.tagName){let E=R(e,d.tagStartPos);return b("InvalidTag","Expected closing tag '"+d.tagName+"' (opened in line "+E.line+", col "+E.col+") instead of closing tag '"+l+"'.",R(e,i))}n.length==0&&(s=!0)}}else return b("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",R(e,o));else{const d=He(f,t);if(d!==!0)return b(d.err.code,d.err.msg,R(e,o-f.length+d.err.line));if(s===!0)return b("InvalidXml","Multiple possible root nodes found.",R(e,o));t.unpairedTags.indexOf(l)!==-1||n.push({tagName:l,tagStartPos:i}),r=!0}for(o++;o<e.length;o++)if(e[o]==="<")if(e[o+1]==="!"){o++,o=qe(e,o);continue}else if(e[o+1]==="?"){if(o=Ve(e,++o),o.err)return o}else break;else if(e[o]==="&"){const d=Wt(e,o);if(d==-1)return b("InvalidChar","char '&' is not expected.",R(e,o));o=d}else if(s===!0&&!ze(e[o]))return b("InvalidXml","Extra text at the end",R(e,o));e[o]==="<"&&o--}}else{if(ze(e[o]))continue;return b("InvalidChar","char '"+e[o]+"' is not expected.",R(e,o))}if(r){if(n.length==1)return b("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",R(e,n[0].tagStartPos));if(n.length>0)return b("InvalidXml","Invalid '"+JSON.stringify(n.map(o=>o.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return b("InvalidXml","Start tag expected.",1);return!0}function ze(e){return e===" "||e===" "||e===`
|
|
3
|
+
`||e==="\r"}function Ve(e,t){const n=t;for(;t<e.length;t++)if(e[t]=="?"||e[t]==" "){const r=e.substr(n,t-n);if(t>5&&r==="xml")return b("InvalidXml","XML declaration allowed only at the start of the document.",R(e,t));if(e[t]=="?"&&e[t+1]==">"){t++;break}else continue}return t}function qe(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 n=1;for(t+=8;t<e.length;t++)if(e[t]==="<")n++;else if(e[t]===">"&&(n--,n===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}const zt='"',Vt="'";function qt(e,t){let n="",r="",s=!1;for(;t<e.length;t++){if(e[t]===zt||e[t]===Vt)r===""?r=e[t]:r!==e[t]||(r="");else if(e[t]===">"&&r===""){s=!0;break}n+=e[t]}return r!==""?!1:{value:n,index:t,tagClosed:s}}const Ht=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function He(e,t){const n=lt(e,Ht),r={};for(let s=0;s<n.length;s++){if(n[s][1].length===0)return b("InvalidAttr","Attribute '"+n[s][2]+"' has no space in starting.",Y(n[s]));if(n[s][3]!==void 0&&n[s][4]===void 0)return b("InvalidAttr","Attribute '"+n[s][2]+"' is without value.",Y(n[s]));if(n[s][3]===void 0&&!t.allowBooleanAttributes)return b("InvalidAttr","boolean attribute '"+n[s][2]+"' is not allowed.",Y(n[s]));const o=n[s][2];if(!Xt(o))return b("InvalidAttr","Attribute '"+o+"' is an invalid name.",Y(n[s]));if(!Object.prototype.hasOwnProperty.call(r,o))r[o]=1;else return b("InvalidAttr","Attribute '"+o+"' is repeated.",Y(n[s]))}return!0}function Jt(e,t){let n=/\d/;for(e[t]==="x"&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(e[t]===";")return t;if(!e[t].match(n))break}return-1}function Wt(e,t){if(t++,e[t]===";")return-1;if(e[t]==="#")return t++,Jt(e,t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(e[t]===";")break;return-1}return t}function b(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function Xt(e){return de(e)}function Kt(e){return de(e)}function R(e,t){const n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function Y(e){return e.startIndex+e[1].length}const Yt={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,n){return e},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0};function ut(e){return typeof e=="boolean"?{enabled:e,maxEntitySize:1e4,maxExpansionDepth:10,maxTotalExpansions:1e3,maxExpandedLength:1e5,allowedTags:null,tagFilter:null}:typeof e=="object"&&e!==null?{enabled:e.enabled!==!1,maxEntitySize:e.maxEntitySize??1e4,maxExpansionDepth:e.maxExpansionDepth??10,maxTotalExpansions:e.maxTotalExpansions??1e3,maxExpandedLength:e.maxExpandedLength??1e5,allowedTags:e.allowedTags??null,tagFilter:e.tagFilter??null}:ut(!0)}const Zt=function(e){const t=Object.assign({},Yt,e);return t.processEntities=ut(t.processEntities),t};let ue;typeof Symbol!="function"?ue="@@xmlMetadata":ue=Symbol("XML Node Metadata");class j{constructor(t){this.tagname=t,this.child=[],this[":@"]=Object.create(null)}add(t,n){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:n})}addChild(t,n){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}),n!==void 0&&(this.child[this.child.length-1][ue]={startIndex:n})}static getMetaDataSymbol(){return ue}}class Gt{constructor(t){this.suppressValidationErr=!t,this.options=t}readDocType(t,n){const r=Object.create(null);if(t[n+3]==="O"&&t[n+4]==="C"&&t[n+5]==="T"&&t[n+6]==="Y"&&t[n+7]==="P"&&t[n+8]==="E"){n=n+9;let s=1,o=!1,i=!1,c="";for(;n<t.length;n++)if(t[n]==="<"&&!i){if(o&&$(t,"!ENTITY",n)){n+=7;let l,a;if([l,a,n]=this.readEntityExp(t,n+1,this.suppressValidationErr),a.indexOf("&")===-1){const f=l.replace(/[.\-+*:]/g,"\\.");r[l]={regx:RegExp(`&${f};`,"g"),val:a}}}else if(o&&$(t,"!ELEMENT",n)){n+=8;const{index:l}=this.readElementExp(t,n+1);n=l}else if(o&&$(t,"!ATTLIST",n))n+=8;else if(o&&$(t,"!NOTATION",n)){n+=9;const{index:l}=this.readNotationExp(t,n+1,this.suppressValidationErr);n=l}else if($(t,"!--",n))i=!0;else throw new Error("Invalid DOCTYPE");s++,c=""}else if(t[n]===">"){if(i?t[n-1]==="-"&&t[n-2]==="-"&&(i=!1,s--):s--,s===0)break}else t[n]==="["?o=!0:c+=t[n];if(s!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:r,i:n}}readEntityExp(t,n){n=I(t,n);let r="";for(;n<t.length&&!/\s/.test(t[n])&&t[n]!=='"'&&t[n]!=="'";)r+=t[n],n++;if(Z(r),n=I(t,n),!this.suppressValidationErr){if(t.substring(n,n+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(t[n]==="%")throw new Error("Parameter entities are not supported")}let s="";if([n,s]=this.readIdentifierVal(t,n,"entity"),this.options.enabled!==!1&&this.options.maxEntitySize&&s.length>this.options.maxEntitySize)throw new Error(`Entity "${r}" size (${s.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return n--,[r,s,n]}readNotationExp(t,n){n=I(t,n);let r="";for(;n<t.length&&!/\s/.test(t[n]);)r+=t[n],n++;!this.suppressValidationErr&&Z(r),n=I(t,n);const s=t.substring(n,n+6).toUpperCase();if(!this.suppressValidationErr&&s!=="SYSTEM"&&s!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${s}"`);n+=s.length,n=I(t,n);let o=null,i=null;if(s==="PUBLIC")[n,o]=this.readIdentifierVal(t,n,"publicIdentifier"),n=I(t,n),(t[n]==='"'||t[n]==="'")&&([n,i]=this.readIdentifierVal(t,n,"systemIdentifier"));else if(s==="SYSTEM"&&([n,i]=this.readIdentifierVal(t,n,"systemIdentifier"),!this.suppressValidationErr&&!i))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:r,publicIdentifier:o,systemIdentifier:i,index:--n}}readIdentifierVal(t,n,r){let s="";const o=t[n];if(o!=='"'&&o!=="'")throw new Error(`Expected quoted string, found "${o}"`);for(n++;n<t.length&&t[n]!==o;)s+=t[n],n++;if(t[n]!==o)throw new Error(`Unterminated ${r} value`);return n++,[n,s]}readElementExp(t,n){n=I(t,n);let r="";for(;n<t.length&&!/\s/.test(t[n]);)r+=t[n],n++;if(!this.suppressValidationErr&&!de(r))throw new Error(`Invalid element name: "${r}"`);n=I(t,n);let s="";if(t[n]==="E"&&$(t,"MPTY",n))n+=4;else if(t[n]==="A"&&$(t,"NY",n))n+=2;else if(t[n]==="("){for(n++;n<t.length&&t[n]!==")";)s+=t[n],n++;if(t[n]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${t[n]}"`);return{elementName:r,contentModel:s.trim(),index:n}}readAttlistExp(t,n){n=I(t,n);let r="";for(;n<t.length&&!/\s/.test(t[n]);)r+=t[n],n++;Z(r),n=I(t,n);let s="";for(;n<t.length&&!/\s/.test(t[n]);)s+=t[n],n++;if(!Z(s))throw new Error(`Invalid attribute name: "${s}"`);n=I(t,n);let o="";if(t.substring(n,n+8).toUpperCase()==="NOTATION"){if(o="NOTATION",n+=8,n=I(t,n),t[n]!=="(")throw new Error(`Expected '(', found "${t[n]}"`);n++;let c=[];for(;n<t.length&&t[n]!==")";){let l="";for(;n<t.length&&t[n]!=="|"&&t[n]!==")";)l+=t[n],n++;if(l=l.trim(),!Z(l))throw new Error(`Invalid notation name: "${l}"`);c.push(l),t[n]==="|"&&(n++,n=I(t,n))}if(t[n]!==")")throw new Error("Unterminated list of notations");n++,o+=" ("+c.join("|")+")"}else{for(;n<t.length&&!/\s/.test(t[n]);)o+=t[n],n++;const c=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!c.includes(o.toUpperCase()))throw new Error(`Invalid attribute type: "${o}"`)}n=I(t,n);let i="";return t.substring(n,n+8).toUpperCase()==="#REQUIRED"?(i="#REQUIRED",n+=8):t.substring(n,n+7).toUpperCase()==="#IMPLIED"?(i="#IMPLIED",n+=7):[n,i]=this.readIdentifierVal(t,n,"ATTLIST"),{elementName:r,attributeName:s,attributeType:o,defaultValue:i,index:n}}}const I=(e,t)=>{for(;t<e.length&&/\s/.test(e[t]);)t++;return t};function $(e,t,n){for(let r=0;r<t.length;r++)if(t[r]!==e[n+r+1])return!1;return!0}function Z(e){if(de(e))return e;throw new Error(`Invalid entity name ${e}`)}const Qt=/^[-+]?0x[a-fA-F0-9]+$/,Dt=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,en={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function tn(e,t={}){if(t=Object.assign({},en,t),!e||typeof e!="string")return e;let n=e.trim();if(t.skipLike!==void 0&&t.skipLike.test(n))return e;if(e==="0")return 0;if(t.hex&&Qt.test(n))return on(n,16);if(n.includes("e")||n.includes("E"))return rn(e,n,t);{const r=Dt.exec(n);if(r){const s=r[1]||"",o=r[2];let i=sn(r[3]);const c=s?e[o.length+1]===".":e[o.length]===".";if(!t.leadingZeros&&(o.length>1||o.length===1&&!c))return e;{const l=Number(n),a=String(l);if(l===0)return l;if(a.search(/[eE]/)!==-1)return t.eNotation?l:e;if(n.indexOf(".")!==-1)return a==="0"||a===i||a===`${s}${i}`?l:e;let f=o?i:n;return o?f===a||s+f===a?l:e:f===a||f===s+a?l:e}}else return e}}const nn=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function rn(e,t,n){if(!n.eNotation)return e;const r=t.match(nn);if(r){let s=r[1]||"";const o=r[3].indexOf("e")===-1?"E":"e",i=r[2],c=s?e[i.length+1]===o:e[i.length]===o;return i.length>1&&c?e:i.length===1&&(r[3].startsWith(`.${o}`)||r[3][0]===o)?Number(t):n.leadingZeros&&!c?(t=(r[1]||"")+r[3],Number(t)):e}else return e}function sn(e){return e&&e.indexOf(".")!==-1&&(e=e.replace(/0+$/,""),e==="."?e="0":e[0]==="."?e="0"+e:e[e.length-1]==="."&&(e=e.substring(0,e.length-1))),e}function on(e,t){if(parseInt)return parseInt(e,t);if(Number.parseInt)return Number.parseInt(e,t);if(window&&window.parseInt)return window.parseInt(e,t);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function an(e){return typeof e=="function"?e:Array.isArray(e)?t=>{for(const n of e)if(typeof n=="string"&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}class cn{constructor(t){if(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:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(n,r)=>Je(r,10,"&#")},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(n,r)=>Je(r,16,"&#x")}},this.addExternalEntities=ln,this.parseXml=hn,this.parseTextData=un,this.resolveNameSpace=fn,this.buildAttributesMap=pn,this.isItStopNode=yn,this.replaceEntitiesValue=mn,this.readStopNodeData=wn,this.saveTextToParentTag=En,this.addChild=gn,this.ignoreAttributesFn=an(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0,this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodesExact=new Set,this.stopNodesWildcard=new Set;for(let n=0;n<this.options.stopNodes.length;n++){const r=this.options.stopNodes[n];typeof r=="string"&&(r.startsWith("*.")?this.stopNodesWildcard.add(r.substring(2)):this.stopNodesExact.add(r))}}}}function ln(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const r=t[n],s=r.replace(/[.\-+*:]/g,"\\.");this.lastEntities[r]={regex:new RegExp("&"+s+";","g"),val:e[r]}}}function un(e,t,n,r,s,o,i){if(e!==void 0&&(this.options.trimValues&&!r&&(e=e.trim()),e.length>0)){i||(e=this.replaceEntitiesValue(e,t,n));const c=this.options.tagValueProcessor(t,e,n,s,o);return c==null?e:typeof c!=typeof e||c!==e?c:this.options.trimValues?Re(e,this.options.parseTagValue,this.options.numberParseOptions):e.trim()===e?Re(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function fn(e){if(this.options.removeNSPrefix){const t=e.split(":"),n=e.charAt(0)==="/"?"/":"";if(t[0]==="xmlns")return"";t.length===2&&(e=n+t[1])}return e}const dn=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function pn(e,t,n){if(this.options.ignoreAttributes!==!0&&typeof e=="string"){const r=lt(e,dn),s=r.length,o={};for(let i=0;i<s;i++){const c=this.resolveNameSpace(r[i][1]);if(this.ignoreAttributesFn(c,t))continue;let l=r[i][4],a=this.options.attributeNamePrefix+c;if(c.length)if(this.options.transformAttributeName&&(a=this.options.transformAttributeName(a)),a==="__proto__"&&(a="#__proto__"),l!==void 0){this.options.trimValues&&(l=l.trim()),l=this.replaceEntitiesValue(l,n,t);const f=this.options.attributeValueProcessor(c,l,t);f==null?o[a]=l:typeof f!=typeof l||f!==l?o[a]=f:o[a]=Re(l,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(o[a]=!0)}if(!Object.keys(o).length)return;if(this.options.attributesGroupName){const i={};return i[this.options.attributesGroupName]=o,i}return o}}const hn=function(e){e=e.replace(/\r\n?/g,`
|
|
4
|
+
`);const t=new j("!xml");let n=t,r="",s="";this.entityExpansionCount=0,this.currentExpandedLength=0;const o=new Gt(this.options.processEntities);for(let i=0;i<e.length;i++)if(e[i]==="<")if(e[i+1]==="/"){const l=z(e,">",i,"Closing Tag is not closed.");let a=e.substring(i+2,l).trim();if(this.options.removeNSPrefix){const E=a.indexOf(":");E!==-1&&(a=a.substr(E+1))}this.options.transformTagName&&(a=this.options.transformTagName(a)),n&&(r=this.saveTextToParentTag(r,n,s));const f=s.substring(s.lastIndexOf(".")+1);if(a&&this.options.unpairedTags.indexOf(a)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${a}>`);let d=0;f&&this.options.unpairedTags.indexOf(f)!==-1?(d=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):d=s.lastIndexOf("."),s=s.substring(0,d),n=this.tagsNodeStack.pop(),r="",i=l}else if(e[i+1]==="?"){let l=Oe(e,i,!1,"?>");if(!l)throw new Error("Pi Tag is not closed.");if(r=this.saveTextToParentTag(r,n,s),!(this.options.ignoreDeclaration&&l.tagName==="?xml"||this.options.ignorePiTags)){const a=new j(l.tagName);a.add(this.options.textNodeName,""),l.tagName!==l.tagExp&&l.attrExpPresent&&(a[":@"]=this.buildAttributesMap(l.tagExp,s,l.tagName)),this.addChild(n,a,s,i)}i=l.closeIndex+1}else if(e.substr(i+1,3)==="!--"){const l=z(e,"-->",i+4,"Comment is not closed.");if(this.options.commentPropName){const a=e.substring(i+4,l-2);r=this.saveTextToParentTag(r,n,s),n.add(this.options.commentPropName,[{[this.options.textNodeName]:a}])}i=l}else if(e.substr(i+1,2)==="!D"){const l=o.readDocType(e,i);this.docTypeEntities=l.entities,i=l.i}else if(e.substr(i+1,2)==="!["){const l=z(e,"]]>",i,"CDATA is not closed.")-2,a=e.substring(i+9,l);r=this.saveTextToParentTag(r,n,s);let f=this.parseTextData(a,n.tagname,s,!0,!1,!0,!0);f==null&&(f=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:a}]):n.add(this.options.textNodeName,f),i=l+2}else{let l=Oe(e,i,this.options.removeNSPrefix),a=l.tagName;const f=l.rawTagName;let d=l.tagExp,E=l.attrExpPresent,T=l.closeIndex;if(this.options.transformTagName){const h=this.options.transformTagName(a);d===a&&(d=h),a=h}if(this.options.strictReservedNames&&(a===this.options.commentPropName||a===this.options.cdataPropName))throw new Error(`Invalid tag name: ${a}`);n&&r&&n.tagname!=="!xml"&&(r=this.saveTextToParentTag(r,n,s,!1));const p=n;p&&this.options.unpairedTags.indexOf(p.tagname)!==-1&&(n=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),a!==t.tagname&&(s+=s?"."+a:a);const g=i;if(this.isItStopNode(this.stopNodesExact,this.stopNodesWildcard,s,a)){let h="";if(d.length>0&&d.lastIndexOf("/")===d.length-1)a[a.length-1]==="/"?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),d=a):d=d.substr(0,d.length-1),i=l.closeIndex;else if(this.options.unpairedTags.indexOf(a)!==-1)i=l.closeIndex;else{const N=this.readStopNodeData(e,f,T+1);if(!N)throw new Error(`Unexpected end of ${f}`);i=N.i,h=N.tagContent}const y=new j(a);a!==d&&E&&(y[":@"]=this.buildAttributesMap(d,s,a)),h&&(h=this.parseTextData(h,a,s,!0,E,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),y.add(this.options.textNodeName,h),this.addChild(n,y,s,g)}else{if(d.length>0&&d.lastIndexOf("/")===d.length-1){if(a[a.length-1]==="/"?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),d=a):d=d.substr(0,d.length-1),this.options.transformTagName){const y=this.options.transformTagName(a);d===a&&(d=y),a=y}const h=new j(a);a!==d&&E&&(h[":@"]=this.buildAttributesMap(d,s,a)),this.addChild(n,h,s,g),s=s.substr(0,s.lastIndexOf("."))}else if(this.options.unpairedTags.indexOf(a)!==-1){const h=new j(a);a!==d&&E&&(h[":@"]=this.buildAttributesMap(d,s)),this.addChild(n,h,s,g),s=s.substr(0,s.lastIndexOf(".")),i=l.closeIndex;continue}else{const h=new j(a);if(this.tagsNodeStack.length>this.options.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(n),a!==d&&E&&(h[":@"]=this.buildAttributesMap(d,s,a)),this.addChild(n,h,s,g),n=h}r="",i=T}}else r+=e[i];return t.child};function gn(e,t,n,r){this.options.captureMetaData||(r=void 0);const s=this.options.updateTag(t.tagname,n,t[":@"]);s===!1||(typeof s=="string"&&(t.tagname=s),e.addChild(t,r))}const mn=function(e,t,n){if(e.indexOf("&")===-1)return e;const r=this.options.processEntities;if(!r.enabled||r.allowedTags&&!r.allowedTags.includes(t)||r.tagFilter&&!r.tagFilter(t,n))return e;for(let s in this.docTypeEntities){const o=this.docTypeEntities[s],i=e.match(o.regx);if(i){if(this.entityExpansionCount+=i.length,r.maxTotalExpansions&&this.entityExpansionCount>r.maxTotalExpansions)throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${r.maxTotalExpansions}`);const c=e.length;if(e=e.replace(o.regx,o.val),r.maxExpandedLength&&(this.currentExpandedLength+=e.length-c,this.currentExpandedLength>r.maxExpandedLength))throw new Error(`Total expanded content size exceeded: ${this.currentExpandedLength} > ${r.maxExpandedLength}`)}}if(e.indexOf("&")===-1)return e;for(let s in this.lastEntities){const o=this.lastEntities[s];e=e.replace(o.regex,o.val)}if(e.indexOf("&")===-1)return e;if(this.options.htmlEntities)for(let s in this.htmlEntities){const o=this.htmlEntities[s];e=e.replace(o.regex,o.val)}return e=e.replace(this.ampEntity.regex,this.ampEntity.val),e};function En(e,t,n,r){return e&&(r===void 0&&(r=t.child.length===0),e=this.parseTextData(e,t.tagname,n,!1,t[":@"]?Object.keys(t[":@"]).length!==0:!1,r),e!==void 0&&e!==""&&t.add(this.options.textNodeName,e),e=""),e}function yn(e,t,n,r){return!!(t&&t.has(r)||e&&e.has(n))}function bn(e,t,n=">"){let r,s="";for(let o=t;o<e.length;o++){let i=e[o];if(r)i===r&&(r="");else if(i==='"'||i==="'")r=i;else if(i===n[0])if(n[1]){if(e[o+1]===n[1])return{data:s,index:o}}else return{data:s,index:o};else i===" "&&(i=" ");s+=i}}function z(e,t,n,r){const s=e.indexOf(t,n);if(s===-1)throw new Error(r);return s+t.length-1}function Oe(e,t,n,r=">"){const s=bn(e,t+1,r);if(!s)return;let o=s.data;const i=s.index,c=o.search(/\s/);let l=o,a=!0;c!==-1&&(l=o.substring(0,c),o=o.substring(c+1).trimStart());const f=l;if(n){const d=l.indexOf(":");d!==-1&&(l=l.substr(d+1),a=l!==s.data.substr(d+1))}return{tagName:l,tagExp:o,closeIndex:i,attrExpPresent:a,rawTagName:f}}function wn(e,t,n){const r=n;let s=1;for(;n<e.length;n++)if(e[n]==="<")if(e[n+1]==="/"){const o=z(e,">",n,`${t} is not closed`);if(e.substring(n+2,o).trim()===t&&(s--,s===0))return{tagContent:e.substring(r,n),i:o};n=o}else if(e[n+1]==="?")n=z(e,"?>",n+1,"StopNode is not closed.");else if(e.substr(n+1,3)==="!--")n=z(e,"-->",n+3,"StopNode is not closed.");else if(e.substr(n+1,2)==="![")n=z(e,"]]>",n,"StopNode is not closed.")-2;else{const o=Oe(e,n,">");o&&((o&&o.tagName)===t&&o.tagExp[o.tagExp.length-1]!=="/"&&s++,n=o.closeIndex)}}function Re(e,t,n){if(t&&typeof e=="string"){const r=e.trim();return r==="true"?!0:r==="false"?!1:tn(e,n)}else return vt(e)?e:""}function Je(e,t,n){const r=Number.parseInt(e,t);return r>=0&&r<=1114111?String.fromCodePoint(r):n+e+";"}const we=j.getMetaDataSymbol();function Tn(e,t){return ft(e,t)}function ft(e,t,n){let r;const s={};for(let o=0;o<e.length;o++){const i=e[o],c=Sn(i);let l="";if(n===void 0?l=c:l=n+"."+c,c===t.textNodeName)r===void 0?r=i[c]:r+=""+i[c];else{if(c===void 0)continue;if(i[c]){let a=ft(i[c],t,l);const f=On(a,t);i[":@"]?Nn(a,i[":@"],l,t):Object.keys(a).length===1&&a[t.textNodeName]!==void 0&&!t.alwaysCreateTextNode?a=a[t.textNodeName]:Object.keys(a).length===0&&(t.alwaysCreateTextNode?a[t.textNodeName]="":a=""),i[we]!==void 0&&typeof a=="object"&&a!==null&&(a[we]=i[we]),s[c]!==void 0&&Object.prototype.hasOwnProperty.call(s,c)?(Array.isArray(s[c])||(s[c]=[s[c]]),s[c].push(a)):t.isArray(c,l,f)?s[c]=[a]:s[c]=a}}}return typeof r=="string"?r.length>0&&(s[t.textNodeName]=r):r!==void 0&&(s[t.textNodeName]=r),s}function Sn(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const r=t[n];if(r!==":@")return r}}function Nn(e,t,n,r){if(t){const s=Object.keys(t),o=s.length;for(let i=0;i<o;i++){const c=s[i];r.isArray(c,n+"."+c,!0,!0)?e[c]=[t[c]]:e[c]=t[c]}}}function On(e,t){const{textNodeName:n}=t,r=Object.keys(e).length;return!!(r===0||r===1&&(e[n]||typeof e[n]=="boolean"||e[n]===0))}class Rn{constructor(t){this.externalEntities={},this.options=Zt(t)}parse(t,n){if(typeof t!="string"&&t.toString)t=t.toString();else if(typeof t!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(n){n===!0&&(n={});const o=$t(t,n);if(o!==!0)throw Error(`${o.err.msg}:${o.err.line}:${o.err.col}`)}const r=new cn(this.options);r.addExternalEntities(this.externalEntities);const s=r.parseXml(t);return this.options.preserveOrder||s===void 0?s:Tn(s,this.options)}addEntity(t,n){if(n.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(n==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=n}static getMetaDataSymbol(){return j.getMetaDataSymbol()}}function An(e){return{companyName:e.Denominazione,companyFiscalCode:e.CodFisc,companyVatNumber:e.PIva,companyLegalFormCode:e.NatGiu,companyLegalFormDescription:e.DescNatGiu,companyCciaaCode:e.Cciaa,companyCciaaDescription:e.DescCciaa,companyReaNumber:e.NRea,companyStatusCode:e.StatoAttivita,companyStatusDescription:e.DescStatoAttivita,companyRegistryStatusCode:e.StatoAttivitaReg,companyRegistryStatusDescription:e.DescStatoAttivitaReg,companySourceCode:e.Fonte,companySourceDescription:e.DescFonte,companyDeclaredActivity:e.AttivitaDichiarata,companyAtecoCode:e.ClassificazioneAteco.CodAttivita,companyAtecoDescription:e.ClassificazioneAteco.DescAttivita,companyAtecoClassificationCode:e.ClassificazioneAteco.CodCodifica,companyAtecoClassificationDescription:e.ClassificazioneAteco.DescCodifica,companyProvinceCode:e.IndirizzoSede.SglPrvSede,companyProvinceDescription:e.IndirizzoSede.DescPrvSede,companyMunicipalityCode:e.IndirizzoSede.CodComSede,companyMunicipalityDescription:e.IndirizzoSede.DescComSede,companyToponymCode:e.IndirizzoSede.CodToponSede,companyToponymDescription:e.IndirizzoSede.DescToponSede,companyStreet:e.IndirizzoSede.ViaSede,companyStreetNumber:String(e.IndirizzoSede.NCivicoSede),companyPostalCode:e.IndirizzoSede.CapSede,companyPec:e.IndirizzoPostaCertificata,companyShares:null,companyProfit:null,companyRevenue:null,companyIncorporationDate:null}}class Cn{constructor(t){Object.defineProperty(this,"client",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"parser",{enumerable:!0,configurable:!0,writable:!0,value:new Rn({ignoreAttributes:!1,attributeNamePrefix:""})})}async getCompanySummaryByVatNumber(t){try{const n=await this.client.get("/registroimprese/imprese/ricerca/partitaiva",{params:{partitaIva:t,fSoloSedi:"S"}});switch(n.status){case 200:break;case 404:throw new Error("Impresa non trovata");case 503:throw new Error("Servizio temporaneamente non disponibile");default:throw new Error(`Errore HTTP CCIAA ${n.status}`)}const r=this.parser.parse(n.data),s=r.Risposta.ListaImpreseRI.Impresa.AnagraficaImpresa;if(!s)throw new Error(`Impresa non trovata. Risposta: ${JSON.stringify(r.Risposta.Testata.Riepilogo)}`);return An(s)}catch(n){throw n&&new Error(`Errore HTTP CCIAA ${n}`)}}checkErrors(t){const n=t.Risposta.Testata.Messaggio;if(n&&n.GravitaErrore==="E")throw new Error(`[${n.CodiceErrore}] ${n.DescrizioneErrore}`)}}function dt(e,t){return function(){return e.apply(t,arguments)}}const{toString:In}=Object.prototype,{getPrototypeOf:xe}=Object,{iterator:pe,toStringTag:pt}=Symbol,he=(e=>t=>{const n=In.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),U=e=>(e=e.toLowerCase(),t=>he(t)===e),ge=e=>t=>typeof t===e,{isArray:X}=Array,W=ge("undefined");function Q(e){return e!==null&&!W(e)&&e.constructor!==null&&!W(e.constructor)&&P(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ht=U("ArrayBuffer");function Pn(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ht(e.buffer),t}const xn=ge("string"),P=ge("function"),gt=ge("number"),D=e=>e!==null&&typeof e=="object",_n=e=>e===!0||e===!1,ae=e=>{if(he(e)!=="object")return!1;const t=xe(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(pt in e)&&!(pe in e)},Fn=e=>{if(!D(e)||Q(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Ln=U("Date"),Un=U("File"),kn=U("Blob"),Bn=U("FileList"),jn=e=>D(e)&&P(e.pipe),vn=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||P(e.append)&&((t=he(e))==="formdata"||t==="object"&&P(e.toString)&&e.toString()==="[object FormData]"))},Mn=U("URLSearchParams"),[$n,zn,Vn,qn]=["ReadableStream","Request","Response","Headers"].map(U),Hn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ee(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),X(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Q(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let c;for(r=0;r<i;r++)c=o[r],t.call(null,e[c],c,e)}}function mt(e,t){if(Q(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const V=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Et=e=>!W(e)&&e!==V;function Ae(){const{caseless:e,skipUndefined:t}=Et(this)&&this||{},n={},r=(s,o)=>{if(o==="__proto__"||o==="constructor"||o==="prototype")return;const i=e&&mt(n,o)||o;ae(n[i])&&ae(s)?n[i]=Ae(n[i],s):ae(s)?n[i]=Ae({},s):X(s)?n[i]=s.slice():(!t||!W(s))&&(n[i]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&ee(arguments[s],r);return n}const Jn=(e,t,n,{allOwnKeys:r}={})=>(ee(t,(s,o)=>{n&&P(s)?Object.defineProperty(e,o,{value:dt(s,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),Wn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Xn=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Kn=(e,t,n,r)=>{let s,o,i;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=n!==!1&&xe(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Yn=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Zn=e=>{if(!e)return null;if(X(e))return e;let t=e.length;if(!gt(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Gn=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&xe(Uint8Array)),Qn=(e,t)=>{const r=(e&&e[pe]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},Dn=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},er=U("HTMLFormElement"),tr=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),We=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),nr=U("RegExp"),yt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ee(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},rr=e=>{yt(e,(t,n)=>{if(P(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(P(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},sr=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return X(e)?r(e):r(String(e).split(t)),n},or=()=>{},ir=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function ar(e){return!!(e&&P(e.append)&&e[pt]==="FormData"&&e[pe])}const cr=e=>{const t=new Array(10),n=(r,s)=>{if(D(r)){if(t.indexOf(r)>=0)return;if(Q(r))return r;if(!("toJSON"in r)){t[s]=r;const o=X(r)?[]:{};return ee(r,(i,c)=>{const l=n(i,s+1);!W(l)&&(o[c]=l)}),t[s]=void 0,o}}return r};return n(e,0)},lr=U("AsyncFunction"),ur=e=>e&&(D(e)||P(e))&&P(e.then)&&P(e.catch),bt=((e,t)=>e?setImmediate:t?((n,r)=>(V.addEventListener("message",({source:s,data:o})=>{s===V&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),V.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",P(V.postMessage)),fr=typeof queueMicrotask<"u"?queueMicrotask.bind(V):typeof process<"u"&&process.nextTick||bt,dr=e=>e!=null&&P(e[pe]),u={isArray:X,isArrayBuffer:ht,isBuffer:Q,isFormData:vn,isArrayBufferView:Pn,isString:xn,isNumber:gt,isBoolean:_n,isObject:D,isPlainObject:ae,isEmptyObject:Fn,isReadableStream:$n,isRequest:zn,isResponse:Vn,isHeaders:qn,isUndefined:W,isDate:Ln,isFile:Un,isBlob:kn,isRegExp:nr,isFunction:P,isStream:jn,isURLSearchParams:Mn,isTypedArray:Gn,isFileList:Bn,forEach:ee,merge:Ae,extend:Jn,trim:Hn,stripBOM:Wn,inherits:Xn,toFlatObject:Kn,kindOf:he,kindOfTest:U,endsWith:Yn,toArray:Zn,forEachEntry:Qn,matchAll:Dn,isHTMLForm:er,hasOwnProperty:We,hasOwnProp:We,reduceDescriptors:yt,freezeMethods:rr,toObjectSet:sr,toCamelCase:tr,noop:or,toFiniteNumber:ir,findKey:mt,global:V,isContextDefined:Et,isSpecCompliantForm:ar,toJSONObject:cr,isAsyncFn:lr,isThenable:ur,setImmediate:bt,asap:fr,isIterable:dr};let m=class wt extends Error{static from(t,n,r,s,o,i){const c=new wt(t.message,n||t.code,r,s,o);return c.cause=t,c.name=t.name,i&&Object.assign(c,i),c}constructor(t,n,r,s,o){super(t),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),s&&(this.request=s),o&&(this.response=o,this.status=o.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:u.toJSONObject(this.config),code:this.code,status:this.status}}};m.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";m.ERR_BAD_OPTION="ERR_BAD_OPTION";m.ECONNABORTED="ECONNABORTED";m.ETIMEDOUT="ETIMEDOUT";m.ERR_NETWORK="ERR_NETWORK";m.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";m.ERR_DEPRECATED="ERR_DEPRECATED";m.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";m.ERR_BAD_REQUEST="ERR_BAD_REQUEST";m.ERR_CANCELED="ERR_CANCELED";m.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";m.ERR_INVALID_URL="ERR_INVALID_URL";const pr=null;function Ce(e){return u.isPlainObject(e)||u.isArray(e)}function Tt(e){return u.endsWith(e,"[]")?e.slice(0,-2):e}function Xe(e,t,n){return e?e.concat(t).map(function(s,o){return s=Tt(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function hr(e){return u.isArray(e)&&!e.some(Ce)}const gr=u.toFlatObject(u,{},null,function(t){return/^is[A-Z]/.test(t)});function me(e,t,n){if(!u.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=u.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,h){return!u.isUndefined(h[g])});const r=n.metaTokens,s=n.visitor||f,o=n.dots,i=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&u.isSpecCompliantForm(t);if(!u.isFunction(s))throw new TypeError("visitor must be a function");function a(p){if(p===null)return"";if(u.isDate(p))return p.toISOString();if(u.isBoolean(p))return p.toString();if(!l&&u.isBlob(p))throw new m("Blob is not supported. Use a Buffer instead.");return u.isArrayBuffer(p)||u.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function f(p,g,h){let y=p;if(p&&!h&&typeof p=="object"){if(u.endsWith(g,"{}"))g=r?g:g.slice(0,-2),p=JSON.stringify(p);else if(u.isArray(p)&&hr(p)||(u.isFileList(p)||u.endsWith(g,"[]"))&&(y=u.toArray(p)))return g=Tt(g),y.forEach(function(S,A){!(u.isUndefined(S)||S===null)&&t.append(i===!0?Xe([g],A,o):i===null?g:g+"[]",a(S))}),!1}return Ce(p)?!0:(t.append(Xe(h,g,o),a(p)),!1)}const d=[],E=Object.assign(gr,{defaultVisitor:f,convertValue:a,isVisitable:Ce});function T(p,g){if(!u.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(p),u.forEach(p,function(y,N){(!(u.isUndefined(y)||y===null)&&s.call(t,y,u.isString(N)?N.trim():N,g,E))===!0&&T(y,g?g.concat(N):[N])}),d.pop()}}if(!u.isObject(e))throw new TypeError("data must be an object");return T(e),t}function Ke(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function _e(e,t){this._pairs=[],e&&me(e,this,t)}const St=_e.prototype;St.append=function(t,n){this._pairs.push([t,n])};St.toString=function(t){const n=t?function(r){return t.call(this,r,Ke)}:Ke;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function mr(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Nt(e,t,n){if(!t)return e;const r=n&&n.encode||mr,s=u.isFunction(n)?{serialize:n}:n,o=s&&s.serialize;let i;if(o?i=o(t,s):i=u.isURLSearchParams(t)?t.toString():new _e(t,s).toString(r),i){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ye{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){u.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Fe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Er=typeof URLSearchParams<"u"?URLSearchParams:_e,yr=typeof FormData<"u"?FormData:null,br=typeof Blob<"u"?Blob:null,wr={isBrowser:!0,classes:{URLSearchParams:Er,FormData:yr,Blob:br},protocols:["http","https","file","blob","url","data"]},Le=typeof window<"u"&&typeof document<"u",Ie=typeof navigator=="object"&&navigator||void 0,Tr=Le&&(!Ie||["ReactNative","NativeScript","NS"].indexOf(Ie.product)<0),Sr=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Nr=Le&&window.location.href||"http://localhost",Or=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Le,hasStandardBrowserEnv:Tr,hasStandardBrowserWebWorkerEnv:Sr,navigator:Ie,origin:Nr},Symbol.toStringTag,{value:"Module"})),O={...Or,...wr};function Rr(e,t){return me(e,new O.classes.URLSearchParams,{visitor:function(n,r,s,o){return O.isNode&&u.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function Ar(e){return u.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Cr(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function Ot(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),l=o>=n.length;return i=!i&&u.isArray(s)?s.length:i,l?(u.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!c):((!s[i]||!u.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&u.isArray(s[i])&&(s[i]=Cr(s[i])),!c)}if(u.isFormData(e)&&u.isFunction(e.entries)){const n={};return u.forEachEntry(e,(r,s)=>{t(Ar(r),s,n,0)}),n}return null}function Ir(e,t,n){if(u.isString(e))try{return(t||JSON.parse)(e),u.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const te={transitional:Fe,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=u.isObject(t);if(o&&u.isHTMLForm(t)&&(t=new FormData(t)),u.isFormData(t))return s?JSON.stringify(Ot(t)):t;if(u.isArrayBuffer(t)||u.isBuffer(t)||u.isStream(t)||u.isFile(t)||u.isBlob(t)||u.isReadableStream(t))return t;if(u.isArrayBufferView(t))return t.buffer;if(u.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Rr(t,this.formSerializer).toString();if((c=u.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return me(c?{"files[]":t}:t,l&&new l,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),Ir(t)):t}],transformResponse:[function(t){const n=this.transitional||te.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(u.isResponse(t)||u.isReadableStream(t))return t;if(t&&u.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(c){if(i)throw c.name==="SyntaxError"?m.from(c,m.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:O.classes.FormData,Blob:O.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};u.forEach(["delete","get","head","post","put","patch"],e=>{te.headers[e]={}});const Pr=u.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),xr=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
5
|
+
`).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&Pr[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Ze=Symbol("internals");function G(e){return e&&String(e).trim().toLowerCase()}function ce(e){return e===!1||e==null?e:u.isArray(e)?e.map(ce):String(e)}function _r(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Fr=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Te(e,t,n,r,s){if(u.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!u.isString(t)){if(u.isString(r))return t.indexOf(r)!==-1;if(u.isRegExp(r))return r.test(t)}}function Lr(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Ur(e,t){const n=u.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}let x=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(c,l,a){const f=G(l);if(!f)throw new Error("header name must be a non-empty string");const d=u.findKey(s,f);(!d||s[d]===void 0||a===!0||a===void 0&&s[d]!==!1)&&(s[d||l]=ce(c))}const i=(c,l)=>u.forEach(c,(a,f)=>o(a,f,l));if(u.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(u.isString(t)&&(t=t.trim())&&!Fr(t))i(xr(t),n);else if(u.isObject(t)&&u.isIterable(t)){let c={},l,a;for(const f of t){if(!u.isArray(f))throw TypeError("Object iterator must return a key-value pair");c[a=f[0]]=(l=c[a])?u.isArray(l)?[...l,f[1]]:[l,f[1]]:f[1]}i(c,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=G(t),t){const r=u.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return _r(s);if(u.isFunction(n))return n.call(this,s,r);if(u.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=G(t),t){const r=u.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Te(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=G(i),i){const c=u.findKey(r,i);c&&(!n||Te(r,r[c],c,n))&&(delete r[c],s=!0)}}return u.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||Te(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return u.forEach(this,(s,o)=>{const i=u.findKey(r,o);if(i){n[i]=ce(s),delete n[o];return}const c=t?Lr(o):String(o).trim();c!==o&&delete n[o],n[c]=ce(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return u.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&u.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
6
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Ze]=this[Ze]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=G(i);r[c]||(Ur(s,i),r[c]=!0)}return u.isArray(t)?t.forEach(o):o(t),this}};x.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);u.reduceDescriptors(x.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});u.freezeMethods(x);function Se(e,t){const n=this||te,r=t||n,s=x.from(r.headers);let o=r.data;return u.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function Rt(e){return!!(e&&e.__CANCEL__)}let ne=class extends m{constructor(t,n,r){super(t??"canceled",m.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function At(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new m("Request failed with status code "+n.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function kr(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Br(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(l){const a=Date.now(),f=r[o];i||(i=a),n[s]=l,r[s]=a;let d=o,E=0;for(;d!==s;)E+=n[d++],d=d%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),a-i<t)return;const T=f&&a-f;return T?Math.round(E*1e3/T):void 0}}function jr(e,t){let n=0,r=1e3/t,s,o;const i=(a,f=Date.now())=>{n=f,s=null,o&&(clearTimeout(o),o=null),e(...a)};return[(...a)=>{const f=Date.now(),d=f-n;d>=r?i(a,f):(s=a,o||(o=setTimeout(()=>{o=null,i(s)},r-d)))},()=>s&&i(s)]}const fe=(e,t,n=3)=>{let r=0;const s=Br(50,250);return jr(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,l=i-r,a=s(l),f=i<=c;r=i;const d={loaded:i,total:c,progress:c?i/c:void 0,bytes:l,rate:a||void 0,estimated:a&&c&&f?(c-i)/a:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(d)},n)},Ge=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Qe=e=>(...t)=>u.asap(()=>e(...t)),vr=O.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,O.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(O.origin),O.navigator&&/(msie|trident)/i.test(O.navigator.userAgent)):()=>!0,Mr=O.hasStandardBrowserEnv?{write(e,t,n,r,s,o,i){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];u.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),u.isString(r)&&c.push(`path=${r}`),u.isString(s)&&c.push(`domain=${s}`),o===!0&&c.push("secure"),u.isString(i)&&c.push(`SameSite=${i}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function $r(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function zr(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ct(e,t,n){let r=!$r(t);return e&&(r||n==!1)?zr(e,t):t}const De=e=>e instanceof x?{...e}:e;function H(e,t){t=t||{};const n={};function r(a,f,d,E){return u.isPlainObject(a)&&u.isPlainObject(f)?u.merge.call({caseless:E},a,f):u.isPlainObject(f)?u.merge({},f):u.isArray(f)?f.slice():f}function s(a,f,d,E){if(u.isUndefined(f)){if(!u.isUndefined(a))return r(void 0,a,d,E)}else return r(a,f,d,E)}function o(a,f){if(!u.isUndefined(f))return r(void 0,f)}function i(a,f){if(u.isUndefined(f)){if(!u.isUndefined(a))return r(void 0,a)}else return r(void 0,f)}function c(a,f,d){if(d in t)return r(a,f);if(d in e)return r(void 0,a)}const l={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(a,f,d)=>s(De(a),De(f),d,!0)};return u.forEach(Object.keys({...e,...t}),function(f){if(f==="__proto__"||f==="constructor"||f==="prototype")return;const d=u.hasOwnProp(l,f)?l[f]:s,E=d(e[f],t[f],f);u.isUndefined(E)&&d!==c||(n[f]=E)}),n}const It=e=>{const t=H({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:c}=t;if(t.headers=i=x.from(i),t.url=Nt(Ct(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),u.isFormData(n)){if(O.hasStandardBrowserEnv||O.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(u.isFunction(n.getHeaders)){const l=n.getHeaders(),a=["content-type","content-length"];Object.entries(l).forEach(([f,d])=>{a.includes(f.toLowerCase())&&i.set(f,d)})}}if(O.hasStandardBrowserEnv&&(r&&u.isFunction(r)&&(r=r(t)),r||r!==!1&&vr(t.url))){const l=s&&o&&Mr.read(o);l&&i.set(s,l)}return t},Vr=typeof XMLHttpRequest<"u",qr=Vr&&function(e){return new Promise(function(n,r){const s=It(e);let o=s.data;const i=x.from(s.headers).normalize();let{responseType:c,onUploadProgress:l,onDownloadProgress:a}=s,f,d,E,T,p;function g(){T&&T(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(f),s.signal&&s.signal.removeEventListener("abort",f)}let h=new XMLHttpRequest;h.open(s.method.toUpperCase(),s.url,!0),h.timeout=s.timeout;function y(){if(!h)return;const S=x.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),L={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:S,config:e,request:h};At(function(_){n(_),g()},function(_){r(_),g()},L),h=null}"onloadend"in h?h.onloadend=y:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(y)},h.onabort=function(){h&&(r(new m("Request aborted",m.ECONNABORTED,e,h)),h=null)},h.onerror=function(A){const L=A&&A.message?A.message:"Network Error",v=new m(L,m.ERR_NETWORK,e,h);v.event=A||null,r(v),h=null},h.ontimeout=function(){let A=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const L=s.transitional||Fe;s.timeoutErrorMessage&&(A=s.timeoutErrorMessage),r(new m(A,L.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,e,h)),h=null},o===void 0&&i.setContentType(null),"setRequestHeader"in h&&u.forEach(i.toJSON(),function(A,L){h.setRequestHeader(L,A)}),u.isUndefined(s.withCredentials)||(h.withCredentials=!!s.withCredentials),c&&c!=="json"&&(h.responseType=s.responseType),a&&([E,p]=fe(a,!0),h.addEventListener("progress",E)),l&&h.upload&&([d,T]=fe(l),h.upload.addEventListener("progress",d),h.upload.addEventListener("loadend",T)),(s.cancelToken||s.signal)&&(f=S=>{h&&(r(!S||S.type?new ne(null,e,h):S),h.abort(),h=null)},s.cancelToken&&s.cancelToken.subscribe(f),s.signal&&(s.signal.aborted?f():s.signal.addEventListener("abort",f)));const N=kr(s.url);if(N&&O.protocols.indexOf(N)===-1){r(new m("Unsupported protocol "+N+":",m.ERR_BAD_REQUEST,e));return}h.send(o||null)})},Hr=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(a){if(!s){s=!0,c();const f=a instanceof Error?a:this.reason;r.abort(f instanceof m?f:new ne(f instanceof Error?f.message:f))}};let i=t&&setTimeout(()=>{i=null,o(new m(`timeout of ${t}ms exceeded`,m.ETIMEDOUT))},t);const c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(a=>{a.unsubscribe?a.unsubscribe(o):a.removeEventListener("abort",o)}),e=null)};e.forEach(a=>a.addEventListener("abort",o));const{signal:l}=r;return l.unsubscribe=()=>u.asap(c),l}},Jr=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},Wr=async function*(e,t){for await(const n of Xr(e))yield*Jr(n,t)},Xr=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},et=(e,t,n,r)=>{const s=Wr(e,t);let o=0,i,c=l=>{i||(i=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:a,value:f}=await s.next();if(a){c(),l.close();return}let d=f.byteLength;if(n){let E=o+=d;n(E)}l.enqueue(new Uint8Array(f))}catch(a){throw c(a),a}},cancel(l){return c(l),s.return()}},{highWaterMark:2})},tt=64*1024,{isFunction:ie}=u,Kr=(({Request:e,Response:t})=>({Request:e,Response:t}))(u.global),{ReadableStream:nt,TextEncoder:rt}=u.global,st=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Yr=e=>{e=u.merge.call({skipUndefined:!0},Kr,e);const{fetch:t,Request:n,Response:r}=e,s=t?ie(t):typeof fetch=="function",o=ie(n),i=ie(r);if(!s)return!1;const c=s&&ie(nt),l=s&&(typeof rt=="function"?(p=>g=>p.encode(g))(new rt):async p=>new Uint8Array(await new n(p).arrayBuffer())),a=o&&c&&st(()=>{let p=!1;const g=new n(O.origin,{body:new nt,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!g}),f=i&&c&&st(()=>u.isReadableStream(new r("").body)),d={stream:f&&(p=>p.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!d[p]&&(d[p]=(g,h)=>{let y=g&&g[p];if(y)return y.call(g);throw new m(`Response type '${p}' is not supported`,m.ERR_NOT_SUPPORT,h)})});const E=async p=>{if(p==null)return 0;if(u.isBlob(p))return p.size;if(u.isSpecCompliantForm(p))return(await new n(O.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(u.isArrayBufferView(p)||u.isArrayBuffer(p))return p.byteLength;if(u.isURLSearchParams(p)&&(p=p+""),u.isString(p))return(await l(p)).byteLength},T=async(p,g)=>{const h=u.toFiniteNumber(p.getContentLength());return h??E(g)};return async p=>{let{url:g,method:h,data:y,signal:N,cancelToken:S,timeout:A,onDownloadProgress:L,onUploadProgress:v,responseType:_,headers:ye,withCredentials:re="same-origin",fetchOptions:ke}=It(p),Be=t||fetch;_=_?(_+"").toLowerCase():"text";let se=Hr([N,S&&S.toAbortSignal()],A),K=null;const M=se&&se.unsubscribe&&(()=>{se.unsubscribe()});let je;try{if(v&&a&&h!=="get"&&h!=="head"&&(je=await T(ye,y))!==0){let B=new n(g,{method:"POST",body:y,duplex:"half"}),J;if(u.isFormData(y)&&(J=B.headers.get("content-type"))&&ye.setContentType(J),B.body){const[be,oe]=Ge(je,fe(Qe(v)));y=et(B.body,tt,be,oe)}}u.isString(re)||(re=re?"include":"omit");const C=o&&"credentials"in n.prototype,ve={...ke,signal:se,method:h.toUpperCase(),headers:ye.normalize().toJSON(),body:y,duplex:"half",credentials:C?re:void 0};K=o&&new n(g,ve);let k=await(o?Be(K,ke):Be(g,ve));const Me=f&&(_==="stream"||_==="response");if(f&&(L||Me&&M)){const B={};["status","statusText","headers"].forEach($e=>{B[$e]=k[$e]});const J=u.toFiniteNumber(k.headers.get("content-length")),[be,oe]=L&&Ge(J,fe(Qe(L),!0))||[];k=new r(et(k.body,tt,be,()=>{oe&&oe(),M&&M()}),B)}_=_||"text";let Ut=await d[u.findKey(d,_)||"text"](k,p);return!Me&&M&&M(),await new Promise((B,J)=>{At(B,J,{data:Ut,headers:x.from(k.headers),status:k.status,statusText:k.statusText,config:p,request:K})})}catch(C){throw M&&M(),C&&C.name==="TypeError"&&/Load failed|fetch/i.test(C.message)?Object.assign(new m("Network Error",m.ERR_NETWORK,p,K,C&&C.response),{cause:C.cause||C}):m.from(C,C&&C.code,p,K,C&&C.response)}}},Zr=new Map,Pt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,o=[r,s,n];let i=o.length,c=i,l,a,f=Zr;for(;c--;)l=o[c],a=f.get(l),a===void 0&&f.set(l,a=c?new Map:Yr(t)),f=a;return a};Pt();const Ue={http:pr,xhr:qr,fetch:{get:Pt}};u.forEach(Ue,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ot=e=>`- ${e}`,Gr=e=>u.isFunction(e)||e===null||e===!1;function Qr(e,t){e=u.isArray(e)?e:[e];const{length:n}=e;let r,s;const o={};for(let i=0;i<n;i++){r=e[i];let c;if(s=r,!Gr(r)&&(s=Ue[(c=String(r)).toLowerCase()],s===void 0))throw new m(`Unknown adapter '${c}'`);if(s&&(u.isFunction(s)||(s=s.get(t))))break;o[c||"#"+i]=s}if(!s){const i=Object.entries(o).map(([l,a])=>`adapter ${l} `+(a===!1?"is not supported by the environment":"is not available in the build"));let c=n?i.length>1?`since :
|
|
7
7
|
`+i.map(ot).join(`
|
|
8
|
-
`):" "+ot(i[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+
|
|
9
|
-
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=H(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&le.assertOptions(r,{silentJSONParsing:F.transitional(F.boolean),forcedJSONParsing:F.transitional(F.boolean),clarifyTimeoutError:F.transitional(F.boolean),legacyInterceptorReqResOrdering:F.transitional(F.boolean)},!1),s!=null&&(u.isFunction(s)?n.paramsSerializer={serialize:s}:le.assertOptions(s,{encode:F.function,serialize:F.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),le.assertOptions(n,{baseUrl:F.spelling("baseURL"),withXsrfToken:F.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&u.merge(o.common,o[n.method]);o&&u.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),n.headers=x.concat(i,o);const
|
|
8
|
+
`):" "+ot(i[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const xt={getAdapter:Qr,adapters:Ue};function Ne(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ne(null,e)}function it(e){return Ne(e),e.headers=x.from(e.headers),e.data=Se.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),xt.getAdapter(e.adapter||te.adapter,e)(e).then(function(r){return Ne(e),r.data=Se.call(e,e.transformResponse,r),r.headers=x.from(r.headers),r},function(r){return Rt(r)||(Ne(e),r&&r.response&&(r.response.data=Se.call(e,e.transformResponse,r.response),r.response.headers=x.from(r.response.headers))),Promise.reject(r)})}const _t="1.13.5",Ee={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ee[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const at={};Ee.transitional=function(t,n,r){function s(o,i){return"[Axios v"+_t+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,c)=>{if(t===!1)throw new m(s(i," has been removed"+(n?" in "+n:"")),m.ERR_DEPRECATED);return n&&!at[i]&&(at[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,c):!0}};Ee.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Dr(e,t,n){if(typeof e!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const c=e[o],l=c===void 0||i(c,o,e);if(l!==!0)throw new m("option "+o+" must be "+l,m.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new m("Unknown option "+o,m.ERR_BAD_OPTION)}}const le={assertOptions:Dr,validators:Ee},F=le.validators;let q=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ye,response:new Ye}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
9
|
+
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=H(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&le.assertOptions(r,{silentJSONParsing:F.transitional(F.boolean),forcedJSONParsing:F.transitional(F.boolean),clarifyTimeoutError:F.transitional(F.boolean),legacyInterceptorReqResOrdering:F.transitional(F.boolean)},!1),s!=null&&(u.isFunction(s)?n.paramsSerializer={serialize:s}:le.assertOptions(s,{encode:F.function,serialize:F.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),le.assertOptions(n,{baseUrl:F.spelling("baseURL"),withXsrfToken:F.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&u.merge(o.common,o[n.method]);o&&u.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),n.headers=x.concat(i,o);const c=[];let l=!0;this.interceptors.request.forEach(function(g){if(typeof g.runWhen=="function"&&g.runWhen(n)===!1)return;l=l&&g.synchronous;const h=n.transitional||Fe;h&&h.legacyInterceptorReqResOrdering?c.unshift(g.fulfilled,g.rejected):c.push(g.fulfilled,g.rejected)});const a=[];this.interceptors.response.forEach(function(g){a.push(g.fulfilled,g.rejected)});let f,d=0,E;if(!l){const p=[it.bind(this),void 0];for(p.unshift(...c),p.push(...a),E=p.length,f=Promise.resolve(n);d<E;)f=f.then(p[d++],p[d++]);return f}E=c.length;let T=n;for(;d<E;){const p=c[d++],g=c[d++];try{T=p(T)}catch(h){g.call(this,h);break}}try{f=it.call(this,T)}catch(p){return Promise.reject(p)}for(d=0,E=a.length;d<E;)f=f.then(a[d++],a[d++]);return f}getUri(t){t=H(this.defaults,t);const n=Ct(t.baseURL,t.url,t.allowAbsoluteUrls);return Nt(n,t.params,t.paramsSerializer)}};u.forEach(["delete","get","head","options"],function(t){q.prototype[t]=function(n,r){return this.request(H(r||{},{method:t,url:n,data:(r||{}).data}))}});u.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,c){return this.request(H(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}q.prototype[t]=n(),q.prototype[t+"Form"]=n(!0)});let es=class Ft{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{r.subscribe(c),o=c}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,c){r.reason||(r.reason=new ne(o,i,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ft(function(s){t=s}),cancel:t}}};function ts(e){return function(n){return e.apply(null,n)}}function ns(e){return u.isObject(e)&&e.isAxiosError===!0}const Pe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Pe).forEach(([e,t])=>{Pe[t]=e});function Lt(e){const t=new q(e),n=dt(q.prototype.request,t);return u.extend(n,q.prototype,t,{allOwnKeys:!0}),u.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Lt(H(e,s))},n}const w=Lt(te);w.Axios=q;w.CanceledError=ne;w.CancelToken=es;w.isCancel=Rt;w.VERSION=_t;w.toFormData=me;w.AxiosError=m;w.Cancel=w.CanceledError;w.all=function(t){return Promise.all(t)};w.spread=ts;w.isAxiosError=ns;w.mergeConfig=H;w.AxiosHeaders=x;w.formToJSON=e=>Ot(u.isHTMLForm(e)?new FormData(e):e);w.getAdapter=xt.getAdapter;w.HttpStatusCode=Pe;w.default=w;const{Axios:as,AxiosError:cs,CanceledError:ls,isCancel:us,CancelToken:fs,VERSION:ds,all:ps,Cancel:hs,isAxiosError:gs,spread:ms,toFormData:Es,AxiosHeaders:ys,HttpStatusCode:bs,formToJSON:ws,getAdapter:Ts,mergeConfig:Ss}=w;class rs{constructor(t){Object.defineProperty(this,"axiosInstance",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"companies",{enumerable:!0,configurable:!0,writable:!0,value:void 0});const n=t.environment==="production"?"https://aiws.infocamere.it/aiws/rest":"https://aiwscl.infocamere.it/aiws/rest";this.axiosInstance=w.create({baseURL:n,headers:{username:t.username,password:t.password,Accept:"application/xml"},validateStatus:()=>!0}),this.companies=new Cn(this.axiosInstance)}}exports.AIWSService=rs;
|
|
10
10
|
//# sourceMappingURL=cciaa-service.cjs.map
|