@nocobase/plugin-verification 1.7.0-beta.9 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/client/83b24f85ae99a175.js +10 -0
  2. package/dist/client/937c9eccebc38607.js +10 -0
  3. package/dist/client/VerificationMenu.d.ts +1 -1
  4. package/dist/client/index.d.ts +1 -1
  5. package/dist/client/index.js +1 -1
  6. package/dist/client/otp-verification/VerificationCode.d.ts +1 -1
  7. package/dist/client/schemas/{verificators.d.ts → verifiers.d.ts} +2 -2
  8. package/dist/client/verification-manager/index.d.ts +2 -2
  9. package/dist/client/{verificators/VerificatorSelect.d.ts → verifiers/VerifierSelect.d.ts} +1 -1
  10. package/dist/client/{verificators/Verificators.d.ts → verifiers/Verifiers.d.ts} +1 -1
  11. package/dist/collections/verifiers.d.ts +50 -0
  12. package/dist/collections/verifiers.js +70 -0
  13. package/dist/externalVersion.js +6 -5
  14. package/dist/locale/en-US.json +6 -5
  15. package/dist/locale/zh-CN.json +6 -5
  16. package/dist/node_modules/@alicloud/dysmsapi20170525/dist/client.js +2 -2
  17. package/dist/node_modules/@alicloud/dysmsapi20170525/package.json +1 -1
  18. package/dist/node_modules/@alicloud/openapi-client/dist/client.js +2 -2
  19. package/dist/node_modules/@alicloud/openapi-client/package.json +1 -1
  20. package/dist/node_modules/@alicloud/tea-util/dist/client.js +1 -1
  21. package/dist/node_modules/@alicloud/tea-util/package.json +1 -1
  22. package/dist/node_modules/tencentcloud-sdk-nodejs/package.json +1 -1
  23. package/dist/node_modules/tencentcloud-sdk-nodejs/tencentcloud/index.js +2 -2
  24. package/dist/server/Plugin.d.ts +3 -0
  25. package/dist/server/Plugin.js +25 -13
  26. package/dist/server/actions/{verificators.js → verifiers.js} +38 -38
  27. package/dist/server/collections/otp-records.js +2 -2
  28. package/dist/server/collections/users-verificators.d.ts +0 -4
  29. package/dist/server/collections/users-verificators.js +1 -1
  30. package/dist/server/collections/users-verifiers.d.ts +14 -0
  31. package/dist/server/collections/users-verifiers.js +58 -0
  32. package/dist/server/collections/verificators.js +1 -1
  33. package/dist/server/collections/verifiers.d.ts +10 -0
  34. package/dist/server/collections/verifiers.js +47 -0
  35. package/dist/server/migrations/20250111192640-providers2verificators.js +16 -2
  36. package/dist/server/migrations/20250507220644-fix-verifier-typo.d.ts +14 -0
  37. package/dist/server/migrations/20250507220644-fix-verifier-typo.js +86 -0
  38. package/dist/server/otp-verification/index.d.ts +1 -0
  39. package/dist/server/otp-verification/index.js +62 -4
  40. package/dist/server/otp-verification/sms/resource/sms-otp.js +11 -11
  41. package/dist/server/verification-manager.d.ts +5 -5
  42. package/dist/server/verification-manager.js +29 -29
  43. package/dist/server/verification.d.ts +5 -5
  44. package/dist/server/verification.js +5 -5
  45. package/package.json +2 -2
  46. package/dist/client/cfedbdcfbe65d5f6.js +0 -10
  47. package/dist/client/d0b398212e5aa575.js +0 -10
  48. /package/dist/client/{verificators → verifiers}/verification-types.d.ts +0 -0
  49. /package/dist/server/actions/{verificators.d.ts → verifiers.d.ts} +0 -0
@@ -1,2 +1,2 @@
1
- (function(){var e={6992:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const n=s(r(3173));const i=s(r(2944));class BearerTokenCredential extends n.default{constructor(e){if(!e){throw new Error("Missing required bearerToken option in config for bearer")}const t=new i.default({type:"bearer"});super(t);this.bearerToken=e}}t["default"]=BearerTokenCredential},4060:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.Config=void 0;const n=s(r(8067));const i=s(r(6992));const o=s(r(2944));t.Config=o.default;const a=s(r(6215));const u=s(r(5503));const c=s(r(7679));const d=s(r(5923));const l=s(r(2461));const p=s(r(7465));const f=s(r(6712));const h=s(r(8228));class InnerCredentialsClient{constructor(e,t){this.type=e;this.provider=t}async getAccessKeyId(){const e=await this.provider.getCredentials();return e.accessKeyId}async getAccessKeySecret(){const e=await this.provider.getCredentials();return e.accessKeySecret}async getSecurityToken(){const e=await this.provider.getCredentials();return e.securityToken}getBearerToken(){return}getType(){return this.type}async getCredential(){const e=await this.provider.getCredentials();return new u.default({accessKeyId:e.accessKeyId,accessKeySecret:e.accessKeySecret,securityToken:e.securityToken,bearerToken:undefined,type:this.getType()})}}class Credential{constructor(e=null,t={}){this.load(e,t)}getAccessKeyId(){return this.credential.getAccessKeyId()}getAccessKeySecret(){return this.credential.getAccessKeySecret()}getSecurityToken(){return this.credential.getSecurityToken()}getBearerToken(){return this.credential.getBearerToken()}getType(){return this.credential.getType()}getCredential(){return this.credential.getCredential()}load(e,t){if(!e){this.credential=new InnerCredentialsClient("default",h.default.builder().build());return}if(!e.type){throw new Error("Missing required type option")}switch(e.type){case"access_key":this.credential=new InnerCredentialsClient("access_key",c.default.builder().withAccessKeyId(e.accessKeyId).withAccessKeySecret(e.accessKeySecret).build());break;case"sts":this.credential=new InnerCredentialsClient("sts",d.default.builder().withAccessKeyId(e.accessKeyId).withAccessKeySecret(e.accessKeySecret).withSecurityToken(e.securityToken).build());break;case"ecs_ram_role":this.credential=new InnerCredentialsClient("ecs_ram_role",f.default.builder().withRoleName(e.roleName).withDisableIMDSv1(e.disableIMDSv1).build());break;case"ram_role_arn":{let t;if(e.securityToken){t=d.default.builder().withAccessKeyId(e.accessKeyId).withAccessKeySecret(e.accessKeySecret).withSecurityToken(e.securityToken).build()}else{t=c.default.builder().withAccessKeyId(e.accessKeyId).withAccessKeySecret(e.accessKeySecret).build()}this.credential=new InnerCredentialsClient("ram_role_arn",l.default.builder().withCredentialsProvider(t).withRoleArn(e.roleArn).withPolicy(e.policy).withDurationSeconds(e.roleSessionExpiration).withRoleSessionName(e.roleSessionName).build())}break;case"oidc_role_arn":this.credential=new InnerCredentialsClient("oidc_role_arn",p.default.builder().withRoleArn(e.roleArn).withOIDCProviderArn(e.oidcProviderArn).withOIDCTokenFilePath(e.oidcTokenFilePath).withRoleSessionName(e.roleSessionName).withPolicy(e.policy).withDurationSeconds(e.roleSessionExpiration).build());break;case"rsa_key_pair":this.credential=new n.default(e.publicKeyId,e.privateKeyFile);break;case"bearer":this.credential=new i.default(e.bearerToken);break;case"credentials_uri":this.credential=new a.default(e.credentialsURI);break;default:throw new Error("Invalid type option, support: access_key, sts, ecs_ram_role, ram_role_arn, rsa_key_pair, credentials_uri")}}}t["default"]=Credential},2944:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});const o=i(r(4165));class Config extends o.Model{constructor(e){super(e)}static names(){return{accessKeyId:"accessKeyId",accessKeySecret:"accessKeySecret",securityToken:"securityToken",bearerToken:"bearerToken",durationSeconds:"durationSeconds",roleArn:"roleArn",policy:"policy",roleSessionExpiration:"roleSessionExpiration",roleSessionName:"roleSessionName",publicKeyId:"publicKeyId",privateKeyFile:"privateKeyFile",roleName:"roleName",enableIMDSv2:"enableIMDSv2",disableIMDSv1:"disableIMDSv1",metadataTokenDuration:"metadataTokenDuration",credentialsURI:"credentialsURI",oidcProviderArn:"oidcProviderArn",oidcTokenFilePath:"oidcTokenFilePath",type:"type"}}static types(){return{accessKeyId:"string",accessKeySecret:"string",securityToken:"string",bearerToken:"string",durationSeconds:"number",roleArn:"string",policy:"string",roleSessionExpiration:"number",roleSessionName:"string",publicKeyId:"string",privateKeyFile:"string",roleName:"string",enableIMDSv2:"boolean",disableIMDSv1:"boolean",metadataTokenDuration:"number",credentialsURI:"string",oidcProviderArn:"string",oidcTokenFilePath:"string",type:"string"}}}t["default"]=Config},5503:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});const o=i(r(4165));class CredentialModel extends o.Model{constructor(e){super(e)}static names(){return{accessKeyId:"accessKeyId",accessKeySecret:"accessKeySecret",securityToken:"securityToken",bearerToken:"bearerToken",type:"type"}}static types(){return{accessKeyId:"string",accessKeySecret:"string",securityToken:"string",bearerToken:"string",type:"string"}}}t["default"]=CredentialModel},8498:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.CredentialsBuilder=void 0;class Credentials{constructor(e){this.accessKeyId=e.accessKeyId;this.accessKeySecret=e.accessKeySecret;this.securityToken=e.securityToken;this.providerName=e.providerName}static builder(){return new CredentialsBuilder}}t["default"]=Credentials;class CredentialsBuilder{withAccessKeyId(e){this.accessKeyId=e;return this}withAccessKeySecret(e){this.accessKeySecret=e;return this}withSecurityToken(e){this.securityToken=e;return this}withProviderName(e){this.providerName=e;return this}build(){return new Credentials(this)}}t.CredentialsBuilder=CredentialsBuilder},3173:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const n=s(r(5503));class DefaultCredential{constructor(e){this.accessKeyId=e.accessKeyId||"";this.accessKeySecret=e.accessKeySecret||"";this.securityToken=e.securityToken||"";this.bearerToken=e.bearerToken||"";this.type=e.type||""}async getAccessKeyId(){return this.accessKeyId}async getAccessKeySecret(){return this.accessKeySecret}async getSecurityToken(){return this.securityToken}getBearerToken(){return this.bearerToken}getType(){return this.type}async getCredential(){return new n.default({accessKeyId:this.accessKeyId,accessKeySecret:this.accessKeySecret,securityToken:this.securityToken,bearerToken:this.bearerToken,type:this.type})}}t["default"]=DefaultCredential},3982:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getProfile=t.getConfiguration=void 0;const n=r(7147);const i=r(3837);const o=s(r(1017));const a=s(r(2037));const u=s(r(8498));const c=s(r(7679));const d=s(r(2461));const l=s(r(7465));const p=s(r(6712));const f=i.promisify(n.readFile);class CLIProfileCredentialsProviderBuilder{build(){if(!this.profileName){this.profileName=process.env.ALIBABA_CLOUD_PROFILE}if(process.env.ALIBABA_CLOUD_CLI_PROFILE_DISABLED==="true"){throw new Error("the CLI profile is disabled")}return new CLIProfileCredentialsProvider(this)}withProfileName(e){this.profileName=e;return this}}class Configuration{}async function getConfiguration(e){let t;try{t=await f(e,"utf8")}catch(t){throw new Error(`reading aliyun cli config from '${e}' failed.`)}let r;try{r=JSON.parse(t)}catch(r){throw new Error(`parse aliyun cli config from '${e}' failed: ${t}`)}if(!r||!r.profiles||r.profiles.length===0){throw new Error(`no any configured profiles in '${e}'`)}return r}t.getConfiguration=getConfiguration;function getProfile(e,t){for(const r of e.profiles){if(r.name===t){return r}}throw new Error(`unable to get profile with '${t}'`)}t.getProfile=getProfile;class CLIProfileCredentialsProvider{constructor(e){this.homedir=a.default.homedir();this.profileName=e.profileName}static builder(){return new CLIProfileCredentialsProviderBuilder}getCredentialsProvider(e,t){const r=getProfile(e,t);switch(r.mode){case"AK":return c.default.builder().withAccessKeyId(r.access_key_id).withAccessKeySecret(r.access_key_secret).build();case"RamRoleArn":{const e=c.default.builder().withAccessKeyId(r.access_key_id).withAccessKeySecret(r.access_key_secret).build();return d.default.builder().withCredentialsProvider(e).withRoleArn(r.ram_role_arn).withRoleSessionName(r.ram_session_name).withDurationSeconds(r.expired_seconds).withStsRegionId(r.sts_region).build()}case"EcsRamRole":return p.default.builder().withRoleName(r.ram_role_name).build();case"OIDC":return l.default.builder().withOIDCTokenFilePath(r.oidc_token_file).withOIDCProviderArn(r.oidc_provider_arn).withRoleArn(r.ram_role_arn).withStsRegionId(r.sts_region).withDurationSeconds(r.expired_seconds).withRoleSessionName(r.ram_session_name).build();case"ChainableRamRoleArn":{const t=this.getCredentialsProvider(e,r.source_profile);return d.default.builder().withCredentialsProvider(t).withRoleArn(r.ram_role_arn).withRoleSessionName(r.ram_session_name).withDurationSeconds(r.expired_seconds).withStsRegionId(r.sts_region).build()}default:throw new Error(`unsupported profile mode '${r.mode}'`)}}async getCredentials(){if(!this.innerProvider){if(!this.homedir){throw new Error("cannot found home dir")}const e=o.default.join(this.homedir,".aliyun/config.json");const t=await getConfiguration(e);const r=this.profileName||t.current;this.innerProvider=this.getCredentialsProvider(t,r)}const e=await this.innerProvider.getCredentials();return u.default.builder().withAccessKeyId(e.accessKeyId).withAccessKeySecret(e.accessKeySecret).withSecurityToken(e.securityToken).withProviderName(`${this.getProviderName()}/${this.innerProvider.getProviderName()}`).build()}getProviderName(){return"cli_profile"}}t["default"]=CLIProfileCredentialsProvider},8228:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const n=s(r(8498));const i=s(r(3982));const o=s(r(6712));const a=s(r(2524));const u=s(r(7465));const c=s(r(5979));class DefaultCredentialsProvider{constructor(e){this.providers=[];try{const e=a.default.builder().build();this.providers.push(e)}catch(e){}try{const e=u.default.builder().build();this.providers.push(e)}catch(e){}try{const e=i.default.builder().build();this.providers.push(e)}catch(e){}try{const e=c.default.builder().build();this.providers.push(e)}catch(e){}if(process.env.ALIBABA_CLOUD_ECS_METADATA){try{const e=o.default.builder().withRoleName(process.env.ALIBABA_CLOUD_ECS_METADATA).build();this.providers.push(e)}catch(e){}}}static builder(){return new DefaultCredentialsProviderBuilder}async getCredentials(){if(this.lastUsedProvider){const e=await this.lastUsedProvider.getCredentials();return n.default.builder().withAccessKeyId(e.accessKeyId).withAccessKeySecret(e.accessKeySecret).withSecurityToken(e.securityToken).withProviderName(`${this.getProviderName()}/${this.lastUsedProvider.getProviderName()}`).build()}const e=[];for(const t of this.providers){this.lastUsedProvider=t;let r;try{r=await t.getCredentials()}catch(t){e.push(t);continue}if(r){return n.default.builder().withAccessKeyId(r.accessKeyId).withAccessKeySecret(r.accessKeySecret).withSecurityToken(r.securityToken).withProviderName(`${this.getProviderName()}/${this.lastUsedProvider.getProviderName()}`).build()}}throw new Error(`unable to get credentials from any of the providers in the chain: ${e.map((e=>e.message)).join(", ")}`)}getProviderName(){return"default"}}t["default"]=DefaultCredentialsProvider;class DefaultCredentialsProviderBuilder{build(){return new DefaultCredentialsProvider(this)}}},6712:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const n=s(r(8498));const i=r(3077);const o=s(r(8650));const a=r(2418);const u=21600;class ECSRAMRoleCredentialsProvider{constructor(e){this.doRequest=i.doRequest;this.roleName=e.roleName;this.disableIMDSv1=e.disableIMDSv1}static builder(){return new ECSRAMRoleCredentialsProviderBuilder}async getCredentials(){if(!this.session||this.needUpdateCredential()){const e=await this.getCredentialsInternal();const t=a.parseUTC(e.expiration);this.session=e;this.expirationTimestamp=t/1e3}return n.default.builder().withAccessKeyId(this.session.accessKeyId).withAccessKeySecret(this.session.accessKeySecret).withSecurityToken(this.session.securityToken).withProviderName(this.getProviderName()).build()}needUpdateCredential(){if(!this.expirationTimestamp){return true}return this.expirationTimestamp-Date.now()/1e3<=180}async getMetadataToken(){const e=i.Request.builder().withMethod("PUT").withProtocol("http").withHost("100.100.100.200").withPath("/latest/api/token").withHeaders({"x-aliyun-ecs-metadata-token-ttl-seconds":`${u}`}).build();try{const t=await this.doRequest(e);if(t.statusCode!==200){throw new Error(`get metadata token failed with ${t.statusCode}`)}return t.body.toString("utf8")}catch(e){if(this.disableIMDSv1){throw e}return null}}async getRoleName(){const e=i.Request.builder().withMethod("GET").withProtocol("http").withHost("100.100.100.200").withPath("/latest/meta-data/ram/security-credentials/");const t=await this.getMetadataToken();if(t!==null){e.withHeaders({"x-aliyun-ecs-metadata-token":t})}const r=e.build();const s=await this.doRequest(r);if(s.statusCode!==200){throw new Error(`get role name failed: ${r.method} ${r.toRequestURL()} ${s.statusCode}`)}return s.body.toString().trim()}async getCredentialsInternal(){let e=this.roleName;if(!e){e=await this.getRoleName()}const t=i.Request.builder().withMethod("GET").withProtocol("http").withHost("100.100.100.200").withPath(`/latest/meta-data/ram/security-credentials/${e}`);const r=await this.getMetadataToken();if(r!==null){t.withHeaders({"x-aliyun-ecs-metadata-token":r})}const s=t.build();const n=await this.doRequest(s);if(n.statusCode!==200){throw new Error(`get sts token failed, httpStatus: ${n.statusCode}, message = ${n.body.toString()}`)}let a;try{a=JSON.parse(n.body.toString())}catch(e){throw new Error(`get sts token failed, json parse failed: ${e.message}`)}if(!a||!a.AccessKeyId||!a.AccessKeySecret||!a.SecurityToken){throw new Error("get sts token failed")}if(a.Code!=="Success"){throw new Error("refresh Ecs sts token err, Code is not Success")}return new o.default(a.AccessKeyId,a.AccessKeySecret,a.SecurityToken,a.Expiration)}getProviderName(){return"ecs_ram_role"}}t["default"]=ECSRAMRoleCredentialsProvider;class ECSRAMRoleCredentialsProviderBuilder{constructor(){this.disableIMDSv1=false}withRoleName(e){this.roleName=e;return this}withDisableIMDSv1(e){this.disableIMDSv1=e;return this}build(){if(!this.roleName){this.roleName=process.env.ALIBABA_CLOUD_ECS_METADATA}if(process.env.ALIBABA_CLOUD_IMDSV1_DISABLED==="true"){this.disableIMDSv1=true}return new ECSRAMRoleCredentialsProvider(this)}}},2524:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const n=s(r(8498));class EnvironmentVariableCredentialsProvider{static builder(){return new EnvironmentVariableCredentialsProviderBuilder}async getCredentials(){const e=process.env.ALIBABA_CLOUD_ACCESS_KEY_ID;if(!e){throw new Error("unable to get credentials from enviroment variables, Access key ID must be specified via environment variable (ALIBABA_CLOUD_ACCESS_KEY_ID)")}const t=process.env.ALIBABA_CLOUD_ACCESS_KEY_SECRET;if(!t){throw new Error("unable to get credentials from enviroment variables, Access key secret must be specified via environment variable (ALIBABA_CLOUD_ACCESS_KEY_SECRET)")}const r=process.env.ALIBABA_CLOUD_SECURITY_TOKEN;return n.default.builder().withAccessKeyId(e).withAccessKeySecret(t).withSecurityToken(r).withProviderName(this.getProviderName()).build()}getProviderName(){return"env"}constructor(e){}}t["default"]=EnvironmentVariableCredentialsProvider;class EnvironmentVariableCredentialsProviderBuilder{build(){return new EnvironmentVariableCredentialsProvider(this)}}},3077:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.doRequest=t.Response=t.RequestBuilder=t.Request=void 0;const n=s(r(9074));class Request{constructor(e){this.method=e.method;this.protocol=e.protocol;this.host=e.host;this.path=e.path;this.queries=e.queries;this.headers=e.headers;this.bodyForm=e.bodyForm;this.bodyBytes=e.bodyBytes}static builder(){return new RequestBuilder}toRequestURL(){let e=`${this.protocol}://${this.host}${this.path}`;if(this.queries&&Object.keys(this.queries).length>0){e+=`?`+querystringify(this.queries)}return e}}t.Request=Request;class RequestBuilder{build(){if(!this.protocol){this.protocol="https"}if(!this.path){this.path="/"}if(!this.headers){this.headers={}}if(!this.queries){this.queries={}}return new Request(this)}withMethod(e){this.method=e;return this}withProtocol(e){this.protocol=e;return this}withHost(e){this.host=e;return this}withPath(e){this.path=e;return this}withQueries(e){this.queries=e;return this}withHeaders(e){this.headers=e;return this}withBodyForm(e){this.bodyForm=e;return this}}t.RequestBuilder=RequestBuilder;class Response{constructor(e){this.statusCode=e.statusCode;this.headers=e.headers;this.body=e.body}static builder(){return new ResponseBuilder}}t.Response=Response;class ResponseBuilder{constructor(){this.headers={}}withStatusCode(e){this.statusCode=e;return this}withHeaders(e){this.headers=e;return this}withBody(e){this.body=e;return this}build(){return new Response(this)}}function querystringify(e){const t=[];for(const[r,s]of Object.entries(e)){t.push(r+"="+encodeURIComponent(s))}return t.join("&")}async function doRequest(e){const t=e.toRequestURL();let r;if(e.bodyForm&&Object.keys(e.bodyForm).length>0){r=querystringify(e.bodyForm);if(!e.headers["Content-Type"]){e.headers["Content-Type"]="application/x-www-form-urlencoded"}}const s=await n.default.request(t,{method:e.method,data:r,headers:e.headers});const i=await n.default.read(s,"");return Response.builder().withStatusCode(s.statusCode).withHeaders(s.headers).withBody(i).build()}t.doRequest=doRequest},7465:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const a=r(7147);const u=r(3837);const c=o(r(8498));const d=o(r(8650));const l=i(r(6517));const p=r(3077);const f=r(2418);const h=u.promisify(a.readFile);class OIDCRoleArnCredentialsProviderBuilder{withOIDCProviderArn(e){this.oidcProviderArn=e;return this}withOIDCTokenFilePath(e){this.oidcTokenFilePath=e;return this}withRoleArn(e){this.roleArn=e;return this}withRoleSessionName(e){this.roleSessionName=e;return this}withDurationSeconds(e){this.durationSeconds=e;return this}withStsEndpoint(e){this.stsEndpoint=e;return this}withStsRegionId(e){this.stsRegionId=e;return this}withPolicy(e){this.policy=e;return this}build(){if(!this.oidcProviderArn){this.oidcProviderArn=process.env.ALIBABA_CLOUD_OIDC_PROVIDER_ARN}if(!this.oidcTokenFilePath){this.oidcTokenFilePath=process.env.ALIBABA_CLOUD_OIDC_TOKEN_FILE}if(!this.roleSessionName){this.roleSessionName=process.env.ALIBABA_CLOUD_ROLE_SESSION_NAME}if(!this.durationSeconds){this.durationSeconds=3600}if(!this.roleArn){this.roleArn=process.env.ALIBABA_CLOUD_ROLE_ARN}if(!this.roleArn){throw new Error("roleArn does not exist and env ALIBABA_CLOUD_ROLE_ARN is null.")}if(!this.oidcProviderArn){throw new Error("oidcProviderArn does not exist and env ALIBABA_CLOUD_OIDC_PROVIDER_ARN is null.")}if(!this.oidcTokenFilePath){throw new Error("oidcTokenFilePath is not exists and env ALIBABA_CLOUD_OIDC_TOKEN_FILE is null.")}if(!this.roleSessionName){this.roleSessionName="credentials-nodejs-"+Date.now()}if(this.durationSeconds<900){throw new Error("session duration should be in the range of 900s - max session duration")}if(!this.stsEndpoint){if(this.stsRegionId){this.stsEndpoint=`sts.${this.stsRegionId}.aliyuncs.com`}else{this.stsEndpoint="sts.aliyuncs.com"}}return new OIDCRoleArnCredentialsProvider(this)}}class OIDCRoleArnCredentialsProvider{constructor(e){this.doRequest=p.doRequest;this.roleArn=e.roleArn;this.oidcProviderArn=e.oidcProviderArn;this.oidcTokenFilePath=e.oidcTokenFilePath;this.policy=e.policy;this.durationSeconds=e.durationSeconds;this.roleSessionName=e.roleSessionName;this.stsEndpoint=e.stsEndpoint;this.doRequest=p.doRequest}static builder(){return new OIDCRoleArnCredentialsProviderBuilder}async getCredentials(){if(!this.session||this.needUpdateCredential()){const e=await this.getCredentialsInternal();const t=f.parseUTC(e.expiration);this.expirationTimestamp=Math.floor(t/1e3);this.lastUpdateTimestamp=Date.now();this.session=e}return c.default.builder().withAccessKeyId(this.session.accessKeyId).withAccessKeySecret(this.session.accessKeySecret).withSecurityToken(this.session.securityToken).withProviderName(this.getProviderName()).build()}getProviderName(){return"oidc_role_arn"}async getCredentialsInternal(){const e=await h(this.oidcTokenFilePath,"utf8");const t=p.Request.builder().withMethod("POST").withProtocol("https").withHost(this.stsEndpoint);const r=Object.create(null);r["Version"]="2015-04-01";r["Action"]="AssumeRoleWithOIDC";r["Format"]="JSON";r["Timestamp"]=l.timestamp();t.withQueries(r);const s=Object.create(null);s["OIDCProviderArn"]=this.oidcProviderArn;s["OIDCToken"]=e;s["RoleArn"]=this.roleArn;if(this.policy){s["Policy"]=this.policy}s["RoleSessionName"]=this.roleSessionName;s["DurationSeconds"]=`${this.durationSeconds}`;t.withBodyForm(s);const n=Object.create(null);n["Content-Type"]="application/x-www-form-urlencoded";t.withHeaders(n);const i=t.build();const o=await this.doRequest(i);if(o.statusCode!==200){throw new Error(`get sts token failed with OIDC: ${o.body.toString("utf8")}`)}let a;try{a=JSON.parse(o.body.toString("utf8"))}catch(e){throw new Error(`get sts token failed with OIDC, unmarshal fail: ${o.body.toString("utf8")}`)}if(!a||!a.Credentials){throw new Error(`get sts token failed with OIDC`)}const{AccessKeyId:u,AccessKeySecret:c,SecurityToken:f,Expiration:m}=a.Credentials;if(!u||!c||!f){throw new Error("get sts token failed with OIDC")}return new d.default(u,c,f,m)}needUpdateCredential(){if(!this.expirationTimestamp){return true}return this.expirationTimestamp-Date.now()/1e3<=180}}t["default"]=OIDCRoleArnCredentialsProvider},5979:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const n=s(r(1017));const i=s(r(2037));const o=s(r(8498));const a=r(6517);const u=s(r(7679));const c=s(r(6712));const d=s(r(2461));class ProfileCredentialsProvider{constructor(e){this.homedir=i.default.homedir();this.profileName=e.profileName}async getCredentials(){if(!this.innerProvider){let e=process.env.ALIBABA_CLOUD_CREDENTIALS_FILE;if(!e){if(!this.homedir){throw new Error("cannot found home dir")}e=n.default.join(this.homedir,".alibabacloud/credentials")}const t=await a.loadIni(e);this.innerProvider=this.getCredentialsProvider(t)}const e=await this.innerProvider.getCredentials();return o.default.builder().withAccessKeyId(e.accessKeyId).withAccessKeySecret(e.accessKeySecret).withSecurityToken(e.securityToken).withProviderName(`${this.getProviderName()}/${this.innerProvider.getProviderName()}`).build()}getCredentialsProvider(e){const t=e[this.profileName]||{};if(!t.type){throw new Error(`Can not find credential type for "${this.profileName}"`)}switch(t.type){case"access_key":return u.default.builder().withAccessKeyId(t.access_key_id).withAccessKeySecret(t.access_key_secret).build();case"ecs_ram_role":return c.default.builder().withRoleName(t.role_name).build();case"ram_role_arn":{const e=u.default.builder().withAccessKeyId(t.access_key_id).withAccessKeySecret(t.access_key_secret).build();return d.default.builder().withCredentialsProvider(e).withRoleArn(t.role_arn).build()}default:throw new Error("Invalid type option, support: access_key, ecs_ram_role, ram_role_arn")}}getProviderName(){return"profile"}static builder(){return new ProfileCredentialsProviderBuilder}}t["default"]=ProfileCredentialsProvider;class ProfileCredentialsProviderBuilder{withProfileName(e){this.profileName=e;return this}build(){if(!this.profileName){this.profileName=process.env.ALIBABA_CLOUD_PROFILE||"default"}return new ProfileCredentialsProvider(this)}}},2461:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const a=i(r(8683));const u=o(r(8237));const c=i(r(6517));const d=o(r(8498));const l=r(3077);const p=r(2418);const f=o(r(8650));const h=u.default("sign");class RAMRoleARNCredentialsProviderBuilder{build(){if(!this.credentialsProvider){throw new Error("must specify a previous credentials provider to asssume role")}if(!this.roleArn){throw new Error("the RoleArn is empty")}if(!this.roleSessionName){this.roleSessionName="credentials-nodejs-"+Date.now()}if(!this.durationSeconds){this.durationSeconds=3600}if(this.durationSeconds<900){throw new Error("session duration should be in the range of 900s - max session duration")}if(!this.stsEndpoint){if(this.stsRegionId){this.stsEndpoint=`sts.${this.stsRegionId}.aliyuncs.com`}else{this.stsEndpoint="sts.aliyuncs.com"}}return new RAMRoleARNCredentialsProvider(this)}withCredentialsProvider(e){this.credentialsProvider=e;return this}withRoleArn(e){this.roleArn=e;return this}withStsRegionId(e){this.stsRegionId=e;return this}withStsEndpoint(e){this.stsEndpoint=e;return this}withRoleSessionName(e){this.roleSessionName=e;return this}withPolicy(e){this.policy=e;return this}withExternalId(e){this.externalId=e;return this}withDurationSeconds(e){this.durationSeconds=e;return this}}function encode(e){const t=encodeURIComponent(e);return t.replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}class RAMRoleARNCredentialsProvider{constructor(e){this.doRequest=l.doRequest;this.credentialsProvider=e.credentialsProvider;this.stsEndpoint=e.stsEndpoint;this.roleSessionName=e.roleSessionName;this.policy=e.policy;this.durationSeconds=e.durationSeconds;this.roleArn=e.roleArn;this.externalId=e.externalId}static builder(){return new RAMRoleARNCredentialsProviderBuilder}async getCredentialsInternal(e){const t="POST";const r=l.Request.builder().withMethod(t).withProtocol("https").withHost(this.stsEndpoint);const s=Object.create(null);s["Version"]="2015-04-01";s["Action"]="AssumeRole";s["Format"]="JSON";s["Timestamp"]=c.timestamp();s["SignatureMethod"]="HMAC-SHA1";s["SignatureVersion"]="1.0";s["SignatureNonce"]=a.makeNonce();s["AccessKeyId"]=e.accessKeyId;if(e.securityToken){s["SecurityToken"]=e.securityToken}const n=Object.create(null);n["RoleArn"]=this.roleArn;if(this.policy){n["Policy"]=this.policy}if(this.externalId){n["ExternalId"]=this.externalId}n["RoleSessionName"]=this.roleSessionName;n["DurationSeconds"]=`${this.durationSeconds}`;r.withBodyForm(n);const i=Object.create(null);for(const[e,t]of Object.entries(s)){i[e]=t}for(const[e,t]of Object.entries(n)){i[e]=t}const o=Object.keys(i).sort();const u=`${t}&${encode("/")}&${encode(o.map((e=>`${encode(e)}=${encode(i[e])}`)).join("&"))}`;h("stringToSign[Client]:");h(u);const d=e.accessKeySecret+"&";const p=a.sha1(u,d,"base64");s["Signature"]=p;r.withQueries(s);const m=Object.create(null);m["Content-Type"]="application/x-www-form-urlencoded";m["x-acs-credentials-provider"]=e.providerName;r.withHeaders(m);const y=r.build();const g=await this.doRequest(y);if(g.statusCode!=200){if(g.headers["content-type"]&&g.headers["content-type"].startsWith("application/json")){const e=JSON.parse(g.body.toString("utf8"));const t=e.Message.slice("Specified signature is not matched with our calculation. server string to sign is:".length);h("stringToSign[Server]:");h(u);if(e.Code==="SignatureDoesNotMatch"&&t===u){throw new Error(`the access key secret is invalid`)}}throw new Error(`refresh session token failed: ${g.body.toString("utf8")}`)}let S;try{S=JSON.parse(g.body.toString("utf8"))}catch(e){throw new Error(`refresh RoleArn sts token err, unmarshal fail: ${g.body.toString("utf8")}`)}if(!S||!S.Credentials){throw new Error(`refresh RoleArn sts token err, fail to get credentials`)}if(!S.Credentials.AccessKeyId||!S.Credentials.AccessKeySecret||!S.Credentials.SecurityToken){throw new Error("refresh RoleArn sts token err, fail to get credentials")}const{AccessKeyId:T,AccessKeySecret:w,SecurityToken:b,Expiration:C}=S.Credentials;return new f.default(T,w,b,C)}async getCredentials(){if(!this.session||this.needUpdateCredential()){const e=await this.credentialsProvider.getCredentials();const t=await this.getCredentialsInternal(e);const r=p.parseUTC(t.expiration);this.expirationTimestamp=Math.floor(r/1e3);this.lastUpdateTimestamp=Date.now();this.session=t}return d.default.builder().withAccessKeyId(this.session.accessKeyId).withAccessKeySecret(this.session.accessKeySecret).withSecurityToken(this.session.securityToken).withProviderName(`${this.getProviderName()}/${this.credentialsProvider.getProviderName()}`).build()}needUpdateCredential(){if(!this.expirationTimestamp){return true}return this.expirationTimestamp-Date.now()/1e3<=180}getProviderName(){return"ram_role_arn"}}t["default"]=RAMRoleARNCredentialsProvider},8650:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});class Session{constructor(e,t,r,s){this.accessKeyId=e;this.accessKeySecret=t;this.securityToken=r;this.expiration=s}}t["default"]=Session},7679:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.StaticAKCredentialsProviderBuilder=void 0;const n=s(r(8498));class StaticAKCredentialsProviderBuilder{withAccessKeyId(e){this.accessKeyId=e;return this}withAccessKeySecret(e){this.accessKeySecret=e;return this}build(){if(!this.accessKeyId){this.accessKeyId=process.env["ALIBABA_CLOUD_ACCESS_KEY_ID"]}if(!this.accessKeyId){throw new Error("the access key id is empty")}if(!this.accessKeySecret){this.accessKeySecret=process.env["ALIBABA_CLOUD_ACCESS_KEY_SECRET"]}if(!this.accessKeySecret){throw new Error("the access key secret is empty")}return new StaticAKCredentialsProvider(this)}}t.StaticAKCredentialsProviderBuilder=StaticAKCredentialsProviderBuilder;class StaticAKCredentialsProvider{constructor(e){this.accessKeyId=e.accessKeyId;this.accessKeySecret=e.accessKeySecret}static builder(){return new StaticAKCredentialsProviderBuilder}getProviderName(){return"static_ak"}async getCredentials(){const e=n.default.builder().withAccessKeyId(this.accessKeyId).withAccessKeySecret(this.accessKeySecret).withProviderName("static_ak").build();return e}}t["default"]=StaticAKCredentialsProvider},5923:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.StaticSTSCredentialsProviderBuilder=void 0;const n=s(r(8498));class StaticSTSCredentialsProviderBuilder{withAccessKeyId(e){this.accessKeyId=e;return this}withAccessKeySecret(e){this.accessKeySecret=e;return this}withSecurityToken(e){this.securityToken=e;return this}build(){if(!this.accessKeyId){this.accessKeyId=process.env["ALIBABA_CLOUD_ACCESS_KEY_ID"]}if(!this.accessKeyId){throw new Error("the access key id is empty")}if(!this.accessKeySecret){this.accessKeySecret=process.env["ALIBABA_CLOUD_ACCESS_KEY_SECRET"]}if(!this.accessKeySecret){throw new Error("the access key secret is empty")}if(!this.securityToken){this.securityToken=process.env["ALIBABA_CLOUD_SECURITY_TOKEN"]}if(!this.securityToken){throw new Error("the security token is empty")}return new StaticSTSCredentialsProvider(this)}}t.StaticSTSCredentialsProviderBuilder=StaticSTSCredentialsProviderBuilder;class StaticSTSCredentialsProvider{constructor(e){this.accessKeyId=e.accessKeyId;this.accessKeySecret=e.accessKeySecret;this.securityToken=e.securityToken}static builder(){return new StaticSTSCredentialsProviderBuilder}getProviderName(){return"static_sts"}async getCredentials(){return n.default.builder().withAccessKeyId(this.accessKeyId).withAccessKeySecret(this.accessKeySecret).withSecurityToken(this.securityToken).withProviderName(this.getProviderName()).build()}}t["default"]=StaticSTSCredentialsProvider},2418:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.parseUTC=void 0;function parseUTC(e){if(!e){throw new Error("invalid UTC format time string")}if(e.length===20){if(e[4]!=="-"||e[7]!=="-"||e[10]!=="T"||e[13]!==":"||e[16]!==":"||e[19]!=="Z"){throw new Error("invalid UTC format date string")}}else if(e.length===24){if(e[4]!=="-"||e[7]!=="-"||e[10]!=="T"||e[13]!==":"||e[16]!==":"||e[19]!=="."||e[23]!=="Z"){throw new Error("invalid UTC format date string")}}else{throw new Error("invalid UTC format time string")}const t=e.slice(0,4);const r=Number.parseInt(t,10);if(isNaN(r)){throw new Error("invalid year string")}const s=e.slice(5,7);const n=Number.parseInt(s,10);if(isNaN(n)){throw new Error("invalid month string")}if(n<1||n>12){throw new Error("invalid month value")}const i=e.slice(8,10);const o=Number.parseInt(i,10);if(isNaN(o)){throw new Error("invalid date string")}if(o<1||o>31){throw new Error("invalid date value")}const a=e.slice(11,13);const u=Number.parseInt(a,10);if(isNaN(u)){throw new Error("invalid hours string")}if(u<0||u>24){throw new Error("invalid hours value")}const c=e.slice(14,16);const d=Number.parseInt(c,10);if(isNaN(d)){throw new Error("invalid minutes string")}if(d<0||d>60){throw new Error("invalid minutes value")}const l=e.slice(17,19);const p=Number.parseInt(l,10);if(isNaN(p)){throw new Error("invalid seconds string")}if(p<0||p>60){throw new Error("invalid seconds value")}if(e.length===24){const t=e.slice(20,23);const s=Number.parseInt(t,10);if(isNaN(s)){throw new Error("invalid ms string")}return Date.UTC(r,n-1,o,u,d,p,s)}return Date.UTC(r,n-1,o,u,d,p)}t.parseUTC=parseUTC},8067:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const a=o(r(7147));const u=o(r(1206));const c=i(r(6517));const d=r(6050);const l=o(r(2944));const p="http://100.100.100.200/latest/meta-data/ram/security-credentials/";class RsaKeyPairCredential extends u.default{constructor(e,t){if(!e){throw new Error("Missing required publicKeyId option in config for rsa_key_pair")}if(!t){throw new Error("Missing required privateKeyFile option in config for rsa_key_pair")}if(!a.default.existsSync(t)){throw new Error(`privateKeyFile ${t} cannot be empty`)}const r=new l.default({type:"rsa_key_pair"});super(r);this.privateKey=c.parseFile(t);this.publicKeyId=e}async updateCredential(){const e=p+this.roleName;const t=await d.request(e,{accessKeyId:this.publicKeyId,action:"GenerateSessionAccessKey",durationSeconds:3600,signatureMethod:"SHA256withRSA",signatureType:"PRIVATEKEY"},{},this.privateKey);this.sessionCredential=t.Credentials}}t["default"]=RsaKeyPairCredential},1206:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const a=o(r(3173));const u=i(r(6517));const c=o(r(2944));const d=o(r(5503));class SessionCredential extends a.default{constructor(e){const t=new c.default({type:e.type,accessKeyId:e.accessKeyId,accessKeySecret:e.accessKeySecret,securityToken:e.securityToken});super(t);this.sessionCredential=null;this.durationSeconds=e.durationSeconds||3600}async updateCredential(){throw new Error("need implemented in sub-class")}async ensureCredential(){const e=this.needUpdateCredential();if(e){await this.updateCredential()}}async getAccessKeyId(){await this.ensureCredential();return this.sessionCredential.AccessKeyId}async getAccessKeySecret(){await this.ensureCredential();return this.sessionCredential.AccessKeySecret}async getSecurityToken(){await this.ensureCredential();return this.sessionCredential.SecurityToken}needUpdateCredential(){if(!this.sessionCredential||!this.sessionCredential.Expiration||!this.sessionCredential.AccessKeyId||!this.sessionCredential.AccessKeySecret||!this.sessionCredential.SecurityToken){return true}const e=u.timestamp(new Date,this.durationSeconds*.05*1e3);if(this.sessionCredential.Expiration<e){return true}return false}async getCredential(){await this.ensureCredential();return new d.default({accessKeyId:this.sessionCredential.AccessKeyId,accessKeySecret:this.sessionCredential.AccessKeySecret,securityToken:this.sessionCredential.SecurityToken,bearerToken:this.bearerToken,type:this.type})}}t["default"]=SessionCredential},6215:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const n=s(r(9074));const i=s(r(2944));const o=s(r(1206));class URICredential extends o.default{constructor(e){const t=new i.default({type:"credentials_uri",credentialsURI:e});super(t);if(!e){this.credentialsURI=process.env["ALIBABA_CLOUD_CREDENTIALS_URI"]}else{this.credentialsURI=e}if(!this.credentialsURI){throw new Error("Missing required credentialsURI option in config or environment variable for credentials_uri")}}async updateCredential(){const e=this.credentialsURI;const t=await n.default.request(e,{});if(t.statusCode!==200){throw new Error(`Get credentials from ${e} failed, status code is ${t.statusCode}`)}const r=await n.default.read(t,"utf8");let s;try{s=JSON.parse(r)}catch(t){throw new Error(`Get credentials from ${e} failed, unmarshal response failed, JSON is: ${r}`)}if(s.Code!=="Success"){throw new Error(`Get credentials from ${e} failed, Code is ${s.Code}`)}this.sessionCredential={AccessKeyId:s.AccessKeyId,AccessKeySecret:s.AccessKeySecret,Expiration:s.Expiration,SecurityToken:s.SecurityToken}}}t["default"]=URICredential},8524:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.DEFAULT_CLIENT=t.DEFAULT_UA=void 0;const a=i(r(2037));const u=o(r(9807));t.DEFAULT_UA=`AlibabaCloud (${a.platform()}; ${a.arch()}) `+`Node.js/${process.version} Core/${u.default.version}`;t.DEFAULT_CLIENT=`Node.js(${process.version}), ${u.default.name}: ${u.default.version}`},6050:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.request=void 0;const a=o(r(9074));const u=i(r(8683));const c=i(r(8524));const d=i(r(6517));const l=new Set([200,"200","OK","Success"]);function firstLetterUpper(e){return e.slice(0,1).toUpperCase()+e.slice(1)}function formatParams(e){const t=Object.keys(e);const r={};for(const s of t){r[firstLetterUpper(s)]=e[s]}return r}function encode(e){const t=encodeURIComponent(e);return t.replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function replaceRepeatList(e,t,r){for(let s=0;s<r.length;s++){const n=r[s];if(n&&typeof n==="object"){const r=Object.keys(n);for(const i of r){e[`${t}.${s+1}.${i}`]=n[i]}}else{e[`${t}.${s+1}`]=n}}}function flatParams(e){const t={};const r=Object.keys(e);for(const s of r){const r=e[s];if(Array.isArray(r)){replaceRepeatList(t,s,r)}else{t[s]=r}}return t}function normalize(e){const t=[];const r=flatParams(e);const s=Object.keys(r).sort();for(const e of s){const s=r[e];t.push([encode(e),encode(s)])}return t}function canonicalize(e){const t=[];for(const[r,s]of e){t.push(r+"="+s)}return t.join("&")}function _buildParams(){const e={Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureNonce:u.makeNonce(),SignatureVersion:"1.0",Timestamp:d.timestamp(),Version:"2015-04-01",RegionId:"cn-hangzhou"};return e}async function request(e,t={},r={},s){let n=Object.assign({headers:{"x-sdk-client":c.DEFAULT_CLIENT,"user-agent":c.DEFAULT_UA}},r);if(n.formatParams!==false){t=formatParams(t)}t=Object.assign(Object.assign({},_buildParams()),t);const i=(r.method||"GET").toUpperCase();const o=normalize(t);if(!n.anonymous){const e=canonicalize(o);const t=`${i}&${encode("/")}&${encode(e)}`;const r=s+"&";const n=u.sha1(t,r,"base64");o.push(["Signature",encode(n)])}const d=r.method==="POST"?`${e}/`:`${e}/?${canonicalize(o)}`;if(r.method==="POST"){r.headers=r.headers||{};r.headers["content-type"]="application/x-www-form-urlencoded";r.data=canonicalize(o)}const p=await a.default.request(d,r);const f=await a.default.read(p,"utf8");const h=JSON.parse(f);if(h.Code&&!l.has(h.Code)){const e=new Error(`${h.Message}`);e.name=h.Code+"Error";e.data=h;e.code=h.Code;e.url=d;throw e}return h}t.request=request},6517:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.loadIni=t.parseFile=t.timestamp=void 0;const a=i(r(8885));const u=i(r(8683));const c=o(r(7147));const d=r(3837);const l=d.promisify(c.default.readFile);const p=d.promisify(c.default.access);function timestamp(e,t){let r=new Date(e);if(!e||isNaN(r.getTime())){r=new Date}if(t){r.setTime(r.getTime()+t)}const s=r.getUTCFullYear();const n=u.pad2(r.getUTCMonth()+1);const i=u.pad2(r.getUTCDate());const o=u.pad2(r.getUTCHours());const a=u.pad2(r.getUTCMinutes());const c=u.pad2(r.getUTCSeconds());return`${s}-${n}-${i}T${o}:${a}:${c}Z`}t.timestamp=timestamp;function parseFile(e,t=false){try{c.default.accessSync(e,c.default.constants.R_OK)}catch(e){if(t){return null}throw new Error("Has no read permission to credentials file")}return a.parse(c.default.readFileSync(e,"utf-8"))}t.parseFile=parseFile;async function loadIni(e){await p(e,c.default.constants.R_OK);const t=await l(e,"utf-8");return a.parse(t)}t.loadIni=loadIni},3023:function(e,t,r){"use strict";var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(Object.hasOwnProperty.call(e,r))t[r]=e[r];t["default"]=e;return t};var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const i=s(r(1979)),o=i;const a=s(r(6642)),u=a;const c=n(r(8190));const d=n(r(2306));const l=s(r(4165));class AddShortUrlRequest extends l.Model{constructor(e){super(e)}static names(){return{effectiveDays:"EffectiveDays",ownerId:"OwnerId",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",shortUrlName:"ShortUrlName",sourceUrl:"SourceUrl"}}static types(){return{effectiveDays:"string",ownerId:"number",resourceOwnerAccount:"string",resourceOwnerId:"number",shortUrlName:"string",sourceUrl:"string"}}}t.AddShortUrlRequest=AddShortUrlRequest;class AddShortUrlResponseBody extends l.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",message:"Message",requestId:"RequestId"}}static types(){return{code:"string",data:AddShortUrlResponseBodyData,message:"string",requestId:"string"}}}t.AddShortUrlResponseBody=AddShortUrlResponseBody;class AddShortUrlResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:AddShortUrlResponseBody}}}t.AddShortUrlResponse=AddShortUrlResponse;class AddSmsSignRequest extends l.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",remark:"Remark",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",signFileList:"SignFileList",signName:"SignName",signSource:"SignSource",signType:"SignType"}}static types(){return{ownerId:"number",remark:"string",resourceOwnerAccount:"string",resourceOwnerId:"number",signFileList:{type:"array",itemType:AddSmsSignRequestSignFileList},signName:"string",signSource:"number",signType:"number"}}}t.AddSmsSignRequest=AddSmsSignRequest;class AddSmsSignResponseBody extends l.Model{constructor(e){super(e)}static names(){return{code:"Code",message:"Message",requestId:"RequestId",signName:"SignName"}}static types(){return{code:"string",message:"string",requestId:"string",signName:"string"}}}t.AddSmsSignResponseBody=AddSmsSignResponseBody;class AddSmsSignResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:AddSmsSignResponseBody}}}t.AddSmsSignResponse=AddSmsSignResponse;class AddSmsTemplateRequest extends l.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",remark:"Remark",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",templateContent:"TemplateContent",templateName:"TemplateName",templateType:"TemplateType"}}static types(){return{ownerId:"number",remark:"string",resourceOwnerAccount:"string",resourceOwnerId:"number",templateContent:"string",templateName:"string",templateType:"number"}}}t.AddSmsTemplateRequest=AddSmsTemplateRequest;class AddSmsTemplateResponseBody extends l.Model{constructor(e){super(e)}static names(){return{code:"Code",message:"Message",requestId:"RequestId",templateCode:"TemplateCode"}}static types(){return{code:"string",message:"string",requestId:"string",templateCode:"string"}}}t.AddSmsTemplateResponseBody=AddSmsTemplateResponseBody;class AddSmsTemplateResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:AddSmsTemplateResponseBody}}}t.AddSmsTemplateResponse=AddSmsTemplateResponse;class CheckMobilesCardSupportRequest extends l.Model{constructor(e){super(e)}static names(){return{mobiles:"Mobiles",templateCode:"TemplateCode"}}static types(){return{mobiles:{type:"array",itemType:{type:"map",keyType:"string",valueType:"any"}},templateCode:"string"}}}t.CheckMobilesCardSupportRequest=CheckMobilesCardSupportRequest;class CheckMobilesCardSupportResponseBody extends l.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",requestId:"RequestId",success:"Success"}}static types(){return{code:"string",data:{type:"array",itemType:{type:"map",keyType:"string",valueType:"any"}},requestId:"string",success:"boolean"}}}t.CheckMobilesCardSupportResponseBody=CheckMobilesCardSupportResponseBody;class CheckMobilesCardSupportResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:CheckMobilesCardSupportResponseBody}}}t.CheckMobilesCardSupportResponse=CheckMobilesCardSupportResponse;class CreateCardSmsTemplateRequest extends l.Model{constructor(e){super(e)}static names(){return{factorys:"Factorys",memo:"Memo",template:"Template",templateName:"TemplateName"}}static types(){return{factorys:"string",memo:"string",template:{type:"map",keyType:"string",valueType:"any"},templateName:"string"}}}t.CreateCardSmsTemplateRequest=CreateCardSmsTemplateRequest;class CreateCardSmsTemplateShrinkRequest extends l.Model{constructor(e){super(e)}static names(){return{factorys:"Factorys",memo:"Memo",templateShrink:"Template",templateName:"TemplateName"}}static types(){return{factorys:"string",memo:"string",templateShrink:"string",templateName:"string"}}}t.CreateCardSmsTemplateShrinkRequest=CreateCardSmsTemplateShrinkRequest;class CreateCardSmsTemplateResponseBody extends l.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",requestId:"RequestId",success:"Success"}}static types(){return{code:"string",data:CreateCardSmsTemplateResponseBodyData,requestId:"string",success:"boolean"}}}t.CreateCardSmsTemplateResponseBody=CreateCardSmsTemplateResponseBody;class CreateCardSmsTemplateResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:CreateCardSmsTemplateResponseBody}}}t.CreateCardSmsTemplateResponse=CreateCardSmsTemplateResponse;class DeleteShortUrlRequest extends l.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",sourceUrl:"SourceUrl"}}static types(){return{ownerId:"number",resourceOwnerAccount:"string",resourceOwnerId:"number",sourceUrl:"string"}}}t.DeleteShortUrlRequest=DeleteShortUrlRequest;class DeleteShortUrlResponseBody extends l.Model{constructor(e){super(e)}static names(){return{code:"Code",message:"Message",requestId:"RequestId"}}static types(){return{code:"string",message:"string",requestId:"string"}}}t.DeleteShortUrlResponseBody=DeleteShortUrlResponseBody;class DeleteShortUrlResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:DeleteShortUrlResponseBody}}}t.DeleteShortUrlResponse=DeleteShortUrlResponse;class DeleteSmsSignRequest extends l.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",signName:"SignName"}}static types(){return{ownerId:"number",resourceOwnerAccount:"string",resourceOwnerId:"number",signName:"string"}}}t.DeleteSmsSignRequest=DeleteSmsSignRequest;class DeleteSmsSignResponseBody extends l.Model{constructor(e){super(e)}static names(){return{code:"Code",message:"Message",requestId:"RequestId",signName:"SignName"}}static types(){return{code:"string",message:"string",requestId:"string",signName:"string"}}}t.DeleteSmsSignResponseBody=DeleteSmsSignResponseBody;class DeleteSmsSignResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:DeleteSmsSignResponseBody}}}t.DeleteSmsSignResponse=DeleteSmsSignResponse;class DeleteSmsTemplateRequest extends l.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",templateCode:"TemplateCode"}}static types(){return{ownerId:"number",resourceOwnerAccount:"string",resourceOwnerId:"number",templateCode:"string"}}}t.DeleteSmsTemplateRequest=DeleteSmsTemplateRequest;class DeleteSmsTemplateResponseBody extends l.Model{constructor(e){super(e)}static names(){return{code:"Code",message:"Message",requestId:"RequestId",templateCode:"TemplateCode"}}static types(){return{code:"string",message:"string",requestId:"string",templateCode:"string"}}}t.DeleteSmsTemplateResponseBody=DeleteSmsTemplateResponseBody;class DeleteSmsTemplateResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:DeleteSmsTemplateResponseBody}}}t.DeleteSmsTemplateResponse=DeleteSmsTemplateResponse;class GetCardSmsLinkRequest extends l.Model{constructor(e){super(e)}static names(){return{cardCodeType:"CardCodeType",cardLinkType:"CardLinkType",cardTemplateCode:"CardTemplateCode",cardTemplateParamJson:"CardTemplateParamJson",customShortCodeJson:"CustomShortCodeJson",domain:"Domain",outId:"OutId",phoneNumberJson:"PhoneNumberJson",signNameJson:"SignNameJson"}}static types(){return{cardCodeType:"number",cardLinkType:"number",cardTemplateCode:"string",cardTemplateParamJson:"string",customShortCodeJson:"string",domain:"string",outId:"string",phoneNumberJson:"string",signNameJson:"string"}}}t.GetCardSmsLinkRequest=GetCardSmsLinkRequest;class GetCardSmsLinkResponseBody extends l.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",requestId:"RequestId",success:"Success"}}static types(){return{code:"string",data:GetCardSmsLinkResponseBodyData,requestId:"string",success:"boolean"}}}t.GetCardSmsLinkResponseBody=GetCardSmsLinkResponseBody;class GetCardSmsLinkResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:GetCardSmsLinkResponseBody}}}t.GetCardSmsLinkResponse=GetCardSmsLinkResponse;class GetMediaResourceIdRequest extends l.Model{constructor(e){super(e)}static names(){return{extendInfo:"ExtendInfo",fileSize:"FileSize",memo:"Memo",ossKey:"OssKey",resourceType:"ResourceType"}}static types(){return{extendInfo:"string",fileSize:"number",memo:"string",ossKey:"string",resourceType:"number"}}}t.GetMediaResourceIdRequest=GetMediaResourceIdRequest;class GetMediaResourceIdResponseBody extends l.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",requestId:"RequestId",success:"Success"}}static types(){return{code:"string",data:GetMediaResourceIdResponseBodyData,requestId:"string",success:"boolean"}}}t.GetMediaResourceIdResponseBody=GetMediaResourceIdResponseBody;class GetMediaResourceIdResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:GetMediaResourceIdResponseBody}}}t.GetMediaResourceIdResponse=GetMediaResourceIdResponse;class GetOSSInfoForCardTemplateResponseBody extends l.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",requestId:"RequestId",success:"Success"}}static types(){return{code:"string",data:GetOSSInfoForCardTemplateResponseBodyData,requestId:"string",success:"boolean"}}}t.GetOSSInfoForCardTemplateResponseBody=GetOSSInfoForCardTemplateResponseBody;class GetOSSInfoForCardTemplateResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:GetOSSInfoForCardTemplateResponseBody}}}t.GetOSSInfoForCardTemplateResponse=GetOSSInfoForCardTemplateResponse;class ListTagResourcesRequest extends l.Model{constructor(e){super(e)}static names(){return{nextToken:"NextToken",ownerId:"OwnerId",pageSize:"PageSize",prodCode:"ProdCode",regionId:"RegionId",resourceId:"ResourceId",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",resourceType:"ResourceType",tag:"Tag"}}static types(){return{nextToken:"string",ownerId:"number",pageSize:"number",prodCode:"string",regionId:"string",resourceId:{type:"array",itemType:"string"},resourceOwnerAccount:"string",resourceOwnerId:"number",resourceType:"string",tag:{type:"array",itemType:ListTagResourcesRequestTag}}}}t.ListTagResourcesRequest=ListTagResourcesRequest;class ListTagResourcesResponseBody extends l.Model{constructor(e){super(e)}static names(){return{code:"Code",nextToken:"NextToken",requestId:"RequestId",tagResources:"TagResources"}}static types(){return{code:"string",nextToken:"string",requestId:"string",tagResources:ListTagResourcesResponseBodyTagResources}}}t.ListTagResourcesResponseBody=ListTagResourcesResponseBody;class ListTagResourcesResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:ListTagResourcesResponseBody}}}t.ListTagResourcesResponse=ListTagResourcesResponse;class ModifySmsSignRequest extends l.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",remark:"Remark",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",signFileList:"SignFileList",signName:"SignName",signSource:"SignSource",signType:"SignType"}}static types(){return{ownerId:"number",remark:"string",resourceOwnerAccount:"string",resourceOwnerId:"number",signFileList:{type:"array",itemType:ModifySmsSignRequestSignFileList},signName:"string",signSource:"number",signType:"number"}}}t.ModifySmsSignRequest=ModifySmsSignRequest;class ModifySmsSignResponseBody extends l.Model{constructor(e){super(e)}static names(){return{code:"Code",message:"Message",requestId:"RequestId",signName:"SignName"}}static types(){return{code:"string",message:"string",requestId:"string",signName:"string"}}}t.ModifySmsSignResponseBody=ModifySmsSignResponseBody;class ModifySmsSignResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:ModifySmsSignResponseBody}}}t.ModifySmsSignResponse=ModifySmsSignResponse;class ModifySmsTemplateRequest extends l.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",remark:"Remark",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",templateCode:"TemplateCode",templateContent:"TemplateContent",templateName:"TemplateName",templateType:"TemplateType"}}static types(){return{ownerId:"number",remark:"string",resourceOwnerAccount:"string",resourceOwnerId:"number",templateCode:"string",templateContent:"string",templateName:"string",templateType:"number"}}}t.ModifySmsTemplateRequest=ModifySmsTemplateRequest;class ModifySmsTemplateResponseBody extends l.Model{constructor(e){super(e)}static names(){return{code:"Code",message:"Message",requestId:"RequestId",templateCode:"TemplateCode"}}static types(){return{code:"string",message:"string",requestId:"string",templateCode:"string"}}}t.ModifySmsTemplateResponseBody=ModifySmsTemplateResponseBody;class ModifySmsTemplateResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:ModifySmsTemplateResponseBody}}}t.ModifySmsTemplateResponse=ModifySmsTemplateResponse;class QueryCardSmsTemplateRequest extends l.Model{constructor(e){super(e)}static names(){return{templateCode:"TemplateCode"}}static types(){return{templateCode:"string"}}}t.QueryCardSmsTemplateRequest=QueryCardSmsTemplateRequest;class QueryCardSmsTemplateResponseBody extends l.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",requestId:"RequestId",success:"Success"}}static types(){return{code:"string",data:QueryCardSmsTemplateResponseBodyData,requestId:"string",success:"boolean"}}}t.QueryCardSmsTemplateResponseBody=QueryCardSmsTemplateResponseBody;class QueryCardSmsTemplateResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:QueryCardSmsTemplateResponseBody}}}t.QueryCardSmsTemplateResponse=QueryCardSmsTemplateResponse;class QueryCardSmsTemplateReportRequest extends l.Model{constructor(e){super(e)}static names(){return{endDate:"EndDate",startDate:"StartDate",templateCodes:"TemplateCodes"}}static types(){return{endDate:"string",startDate:"string",templateCodes:{type:"array",itemType:"string"}}}}t.QueryCardSmsTemplateReportRequest=QueryCardSmsTemplateReportRequest;class QueryCardSmsTemplateReportResponseBody extends l.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",requestId:"RequestId",success:"Success"}}static types(){return{code:"string",data:{type:"array",itemType:{type:"map",keyType:"string",valueType:"any"}},requestId:"string",success:"boolean"}}}t.QueryCardSmsTemplateReportResponseBody=QueryCardSmsTemplateReportResponseBody;class QueryCardSmsTemplateReportResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:QueryCardSmsTemplateReportResponseBody}}}t.QueryCardSmsTemplateReportResponse=QueryCardSmsTemplateReportResponse;class QuerySendDetailsRequest extends l.Model{constructor(e){super(e)}static names(){return{bizId:"BizId",currentPage:"CurrentPage",ownerId:"OwnerId",pageSize:"PageSize",phoneNumber:"PhoneNumber",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",sendDate:"SendDate"}}static types(){return{bizId:"string",currentPage:"number",ownerId:"number",pageSize:"number",phoneNumber:"string",resourceOwnerAccount:"string",resourceOwnerId:"number",sendDate:"string"}}}t.QuerySendDetailsRequest=QuerySendDetailsRequest;class QuerySendDetailsResponseBody extends l.Model{constructor(e){super(e)}static names(){return{code:"Code",message:"Message",requestId:"RequestId",smsSendDetailDTOs:"SmsSendDetailDTOs",totalCount:"TotalCount"}}static types(){return{code:"string",message:"string",requestId:"string",smsSendDetailDTOs:QuerySendDetailsResponseBodySmsSendDetailDTOs,totalCount:"string"}}}t.QuerySendDetailsResponseBody=QuerySendDetailsResponseBody;class QuerySendDetailsResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:QuerySendDetailsResponseBody}}}t.QuerySendDetailsResponse=QuerySendDetailsResponse;class QuerySendStatisticsRequest extends l.Model{constructor(e){super(e)}static names(){return{endDate:"EndDate",isGlobe:"IsGlobe",ownerId:"OwnerId",pageIndex:"PageIndex",pageSize:"PageSize",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",signName:"SignName",startDate:"StartDate",templateType:"TemplateType"}}static types(){return{endDate:"string",isGlobe:"number",ownerId:"number",pageIndex:"number",pageSize:"number",resourceOwnerAccount:"string",resourceOwnerId:"number",signName:"string",startDate:"string",templateType:"number"}}}t.QuerySendStatisticsRequest=QuerySendStatisticsRequest;class QuerySendStatisticsResponseBody extends l.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",message:"Message",requestId:"RequestId"}}static types(){return{code:"string",data:QuerySendStatisticsResponseBodyData,message:"string",requestId:"string"}}}t.QuerySendStatisticsResponseBody=QuerySendStatisticsResponseBody;class QuerySendStatisticsResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:QuerySendStatisticsResponseBody}}}t.QuerySendStatisticsResponse=QuerySendStatisticsResponse;class QueryShortUrlRequest extends l.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",shortUrl:"ShortUrl"}}static types(){return{ownerId:"number",resourceOwnerAccount:"string",resourceOwnerId:"number",shortUrl:"string"}}}t.QueryShortUrlRequest=QueryShortUrlRequest;class QueryShortUrlResponseBody extends l.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",message:"Message",requestId:"RequestId"}}static types(){return{code:"string",data:QueryShortUrlResponseBodyData,message:"string",requestId:"string"}}}t.QueryShortUrlResponseBody=QueryShortUrlResponseBody;class QueryShortUrlResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:QueryShortUrlResponseBody}}}t.QueryShortUrlResponse=QueryShortUrlResponse;class QuerySmsSignRequest extends l.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",signName:"SignName"}}static types(){return{ownerId:"number",resourceOwnerAccount:"string",resourceOwnerId:"number",signName:"string"}}}t.QuerySmsSignRequest=QuerySmsSignRequest;class QuerySmsSignResponseBody extends l.Model{constructor(e){super(e)}static names(){return{code:"Code",createDate:"CreateDate",message:"Message",reason:"Reason",requestId:"RequestId",signName:"SignName",signStatus:"SignStatus"}}static types(){return{code:"string",createDate:"string",message:"string",reason:"string",requestId:"string",signName:"string",signStatus:"number"}}}t.QuerySmsSignResponseBody=QuerySmsSignResponseBody;class QuerySmsSignResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:QuerySmsSignResponseBody}}}t.QuerySmsSignResponse=QuerySmsSignResponse;class QuerySmsSignListRequest extends l.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",pageIndex:"PageIndex",pageSize:"PageSize",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId"}}static types(){return{ownerId:"number",pageIndex:"number",pageSize:"number",resourceOwnerAccount:"string",resourceOwnerId:"number"}}}t.QuerySmsSignListRequest=QuerySmsSignListRequest;class QuerySmsSignListResponseBody extends l.Model{constructor(e){super(e)}static names(){return{code:"Code",currentPage:"CurrentPage",message:"Message",pageSize:"PageSize",requestId:"RequestId",smsSignList:"SmsSignList",totalCount:"TotalCount"}}static types(){return{code:"string",currentPage:"number",message:"string",pageSize:"number",requestId:"string",smsSignList:{type:"array",itemType:QuerySmsSignListResponseBodySmsSignList},totalCount:"number"}}}t.QuerySmsSignListResponseBody=QuerySmsSignListResponseBody;class QuerySmsSignListResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:QuerySmsSignListResponseBody}}}t.QuerySmsSignListResponse=QuerySmsSignListResponse;class QuerySmsTemplateRequest extends l.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",templateCode:"TemplateCode"}}static types(){return{ownerId:"number",resourceOwnerAccount:"string",resourceOwnerId:"number",templateCode:"string"}}}t.QuerySmsTemplateRequest=QuerySmsTemplateRequest;class QuerySmsTemplateResponseBody extends l.Model{constructor(e){super(e)}static names(){return{code:"Code",createDate:"CreateDate",message:"Message",reason:"Reason",requestId:"RequestId",templateCode:"TemplateCode",templateContent:"TemplateContent",templateName:"TemplateName",templateStatus:"TemplateStatus",templateType:"TemplateType"}}static types(){return{code:"string",createDate:"string",message:"string",reason:"string",requestId:"string",templateCode:"string",templateContent:"string",templateName:"string",templateStatus:"number",templateType:"number"}}}t.QuerySmsTemplateResponseBody=QuerySmsTemplateResponseBody;class QuerySmsTemplateResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:QuerySmsTemplateResponseBody}}}t.QuerySmsTemplateResponse=QuerySmsTemplateResponse;class QuerySmsTemplateListRequest extends l.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",pageIndex:"PageIndex",pageSize:"PageSize",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId"}}static types(){return{ownerId:"number",pageIndex:"number",pageSize:"number",resourceOwnerAccount:"string",resourceOwnerId:"number"}}}t.QuerySmsTemplateListRequest=QuerySmsTemplateListRequest;class QuerySmsTemplateListResponseBody extends l.Model{constructor(e){super(e)}static names(){return{code:"Code",currentPage:"CurrentPage",message:"Message",pageSize:"PageSize",requestId:"RequestId",smsTemplateList:"SmsTemplateList",totalCount:"TotalCount"}}static types(){return{code:"string",currentPage:"number",message:"string",pageSize:"number",requestId:"string",smsTemplateList:{type:"array",itemType:QuerySmsTemplateListResponseBodySmsTemplateList},totalCount:"number"}}}t.QuerySmsTemplateListResponseBody=QuerySmsTemplateListResponseBody;class QuerySmsTemplateListResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:QuerySmsTemplateListResponseBody}}}t.QuerySmsTemplateListResponse=QuerySmsTemplateListResponse;class SendBatchCardSmsRequest extends l.Model{constructor(e){super(e)}static names(){return{cardTemplateCode:"CardTemplateCode",cardTemplateParamJson:"CardTemplateParamJson",digitalTemplateCode:"DigitalTemplateCode",digitalTemplateParamJson:"DigitalTemplateParamJson",fallbackType:"FallbackType",outId:"OutId",phoneNumberJson:"PhoneNumberJson",signNameJson:"SignNameJson",smsTemplateCode:"SmsTemplateCode",smsTemplateParamJson:"SmsTemplateParamJson",smsUpExtendCodeJson:"SmsUpExtendCodeJson"}}static types(){return{cardTemplateCode:"string",cardTemplateParamJson:"string",digitalTemplateCode:"string",digitalTemplateParamJson:"string",fallbackType:"string",outId:"string",phoneNumberJson:"string",signNameJson:"string",smsTemplateCode:"string",smsTemplateParamJson:"string",smsUpExtendCodeJson:"string"}}}t.SendBatchCardSmsRequest=SendBatchCardSmsRequest;class SendBatchCardSmsResponseBody extends l.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",requestId:"RequestId",success:"Success"}}static types(){return{code:"string",data:SendBatchCardSmsResponseBodyData,requestId:"string",success:"boolean"}}}t.SendBatchCardSmsResponseBody=SendBatchCardSmsResponseBody;class SendBatchCardSmsResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:SendBatchCardSmsResponseBody}}}t.SendBatchCardSmsResponse=SendBatchCardSmsResponse;class SendBatchSmsRequest extends l.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",phoneNumberJson:"PhoneNumberJson",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",signNameJson:"SignNameJson",smsUpExtendCodeJson:"SmsUpExtendCodeJson",templateCode:"TemplateCode",templateParamJson:"TemplateParamJson"}}static types(){return{ownerId:"number",phoneNumberJson:"string",resourceOwnerAccount:"string",resourceOwnerId:"number",signNameJson:"string",smsUpExtendCodeJson:"string",templateCode:"string",templateParamJson:"string"}}}t.SendBatchSmsRequest=SendBatchSmsRequest;class SendBatchSmsResponseBody extends l.Model{constructor(e){super(e)}static names(){return{bizId:"BizId",code:"Code",message:"Message",requestId:"RequestId"}}static types(){return{bizId:"string",code:"string",message:"string",requestId:"string"}}}t.SendBatchSmsResponseBody=SendBatchSmsResponseBody;class SendBatchSmsResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:SendBatchSmsResponseBody}}}t.SendBatchSmsResponse=SendBatchSmsResponse;class SendCardSmsRequest extends l.Model{constructor(e){super(e)}static names(){return{cardObjects:"CardObjects",cardTemplateCode:"CardTemplateCode",digitalTemplateCode:"DigitalTemplateCode",digitalTemplateParam:"DigitalTemplateParam",fallbackType:"FallbackType",outId:"OutId",signName:"SignName",smsTemplateCode:"SmsTemplateCode",smsTemplateParam:"SmsTemplateParam",smsUpExtendCode:"SmsUpExtendCode"}}static types(){return{cardObjects:{type:"array",itemType:SendCardSmsRequestCardObjects},cardTemplateCode:"string",digitalTemplateCode:"string",digitalTemplateParam:"string",fallbackType:"string",outId:"string",signName:"string",smsTemplateCode:"string",smsTemplateParam:"string",smsUpExtendCode:"string"}}}t.SendCardSmsRequest=SendCardSmsRequest;class SendCardSmsResponseBody extends l.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",requestId:"RequestId",success:"Success"}}static types(){return{code:"string",data:SendCardSmsResponseBodyData,requestId:"string",success:"boolean"}}}t.SendCardSmsResponseBody=SendCardSmsResponseBody;class SendCardSmsResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:SendCardSmsResponseBody}}}t.SendCardSmsResponse=SendCardSmsResponse;class SendSmsRequest extends l.Model{constructor(e){super(e)}static names(){return{outId:"OutId",ownerId:"OwnerId",phoneNumbers:"PhoneNumbers",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",signName:"SignName",smsUpExtendCode:"SmsUpExtendCode",templateCode:"TemplateCode",templateParam:"TemplateParam"}}static types(){return{outId:"string",ownerId:"number",phoneNumbers:"string",resourceOwnerAccount:"string",resourceOwnerId:"number",signName:"string",smsUpExtendCode:"string",templateCode:"string",templateParam:"string"}}}t.SendSmsRequest=SendSmsRequest;class SendSmsResponseBody extends l.Model{constructor(e){super(e)}static names(){return{bizId:"BizId",code:"Code",message:"Message",requestId:"RequestId"}}static types(){return{bizId:"string",code:"string",message:"string",requestId:"string"}}}t.SendSmsResponseBody=SendSmsResponseBody;class SendSmsResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:SendSmsResponseBody}}}t.SendSmsResponse=SendSmsResponse;class TagResourcesRequest extends l.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",prodCode:"ProdCode",regionId:"RegionId",resourceId:"ResourceId",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",resourceType:"ResourceType",tag:"Tag"}}static types(){return{ownerId:"number",prodCode:"string",regionId:"string",resourceId:{type:"array",itemType:"string"},resourceOwnerAccount:"string",resourceOwnerId:"number",resourceType:"string",tag:{type:"array",itemType:TagResourcesRequestTag}}}}t.TagResourcesRequest=TagResourcesRequest;class TagResourcesResponseBody extends l.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",requestId:"RequestId"}}static types(){return{code:"string",data:"string",requestId:"string"}}}t.TagResourcesResponseBody=TagResourcesResponseBody;class TagResourcesResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:TagResourcesResponseBody}}}t.TagResourcesResponse=TagResourcesResponse;class UntagResourcesRequest extends l.Model{constructor(e){super(e)}static names(){return{all:"All",ownerId:"OwnerId",prodCode:"ProdCode",regionId:"RegionId",resourceId:"ResourceId",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",resourceType:"ResourceType",tagKey:"TagKey"}}static types(){return{all:"boolean",ownerId:"number",prodCode:"string",regionId:"string",resourceId:{type:"array",itemType:"string"},resourceOwnerAccount:"string",resourceOwnerId:"number",resourceType:"string",tagKey:{type:"array",itemType:"string"}}}}t.UntagResourcesRequest=UntagResourcesRequest;class UntagResourcesResponseBody extends l.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",requestId:"RequestId"}}static types(){return{code:"string",data:"string",requestId:"string"}}}t.UntagResourcesResponseBody=UntagResourcesResponseBody;class UntagResourcesResponse extends l.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:UntagResourcesResponseBody}}}t.UntagResourcesResponse=UntagResourcesResponse;class AddShortUrlResponseBodyData extends l.Model{constructor(e){super(e)}static names(){return{expireDate:"ExpireDate",shortUrl:"ShortUrl",sourceUrl:"SourceUrl"}}static types(){return{expireDate:"string",shortUrl:"string",sourceUrl:"string"}}}t.AddShortUrlResponseBodyData=AddShortUrlResponseBodyData;class AddSmsSignRequestSignFileList extends l.Model{constructor(e){super(e)}static names(){return{fileContents:"FileContents",fileSuffix:"FileSuffix"}}static types(){return{fileContents:"string",fileSuffix:"string"}}}t.AddSmsSignRequestSignFileList=AddSmsSignRequestSignFileList;class CreateCardSmsTemplateResponseBodyData extends l.Model{constructor(e){super(e)}static names(){return{templateCode:"TemplateCode"}}static types(){return{templateCode:"string"}}}t.CreateCardSmsTemplateResponseBodyData=CreateCardSmsTemplateResponseBodyData;class GetCardSmsLinkResponseBodyData extends l.Model{constructor(e){super(e)}static names(){return{cardPhoneNumbers:"CardPhoneNumbers",cardSignNames:"CardSignNames",cardSmsLinks:"CardSmsLinks",cardTmpState:"CardTmpState",notMediaMobiles:"NotMediaMobiles"}}static types(){return{cardPhoneNumbers:"string",cardSignNames:"string",cardSmsLinks:"string",cardTmpState:"number",notMediaMobiles:"string"}}}t.GetCardSmsLinkResponseBodyData=GetCardSmsLinkResponseBodyData;class GetMediaResourceIdResponseBodyData extends l.Model{constructor(e){super(e)}static names(){return{resUrlDownload:"ResUrlDownload",resourceId:"ResourceId"}}static types(){return{resUrlDownload:"string",resourceId:"number"}}}t.GetMediaResourceIdResponseBodyData=GetMediaResourceIdResponseBodyData;class GetOSSInfoForCardTemplateResponseBodyData extends l.Model{constructor(e){super(e)}static names(){return{accessKeyId:"AccessKeyId",aliUid:"AliUid",bucket:"Bucket",expireTime:"ExpireTime",host:"Host",policy:"Policy",signature:"Signature",startPath:"StartPath"}}static types(){return{accessKeyId:"string",aliUid:"string",bucket:"string",expireTime:"string",host:"string",policy:"string",signature:"string",startPath:"string"}}}t.GetOSSInfoForCardTemplateResponseBodyData=GetOSSInfoForCardTemplateResponseBodyData;class ListTagResourcesRequestTag extends l.Model{constructor(e){super(e)}static names(){return{key:"Key",value:"Value"}}static types(){return{key:"string",value:"string"}}}t.ListTagResourcesRequestTag=ListTagResourcesRequestTag;class ListTagResourcesResponseBodyTagResourcesTagResource extends l.Model{constructor(e){super(e)}static names(){return{resourceId:"ResourceId",resourceType:"ResourceType",tagKey:"TagKey",tagValue:"TagValue"}}static types(){return{resourceId:"string",resourceType:"string",tagKey:"string",tagValue:"string"}}}t.ListTagResourcesResponseBodyTagResourcesTagResource=ListTagResourcesResponseBodyTagResourcesTagResource;class ListTagResourcesResponseBodyTagResources extends l.Model{constructor(e){super(e)}static names(){return{tagResource:"TagResource"}}static types(){return{tagResource:{type:"array",itemType:ListTagResourcesResponseBodyTagResourcesTagResource}}}}t.ListTagResourcesResponseBodyTagResources=ListTagResourcesResponseBodyTagResources;class ModifySmsSignRequestSignFileList extends l.Model{constructor(e){super(e)}static names(){return{fileContents:"FileContents",fileSuffix:"FileSuffix"}}static types(){return{fileContents:"string",fileSuffix:"string"}}}t.ModifySmsSignRequestSignFileList=ModifySmsSignRequestSignFileList;class QueryCardSmsTemplateResponseBodyData extends l.Model{constructor(e){super(e)}static names(){return{templates:"Templates"}}static types(){return{templates:{type:"array",itemType:{type:"map",keyType:"string",valueType:"any"}}}}}t.QueryCardSmsTemplateResponseBodyData=QueryCardSmsTemplateResponseBodyData;class QuerySendDetailsResponseBodySmsSendDetailDTOsSmsSendDetailDTO extends l.Model{constructor(e){super(e)}static names(){return{content:"Content",errCode:"ErrCode",outId:"OutId",phoneNum:"PhoneNum",receiveDate:"ReceiveDate",sendDate:"SendDate",sendStatus:"SendStatus",templateCode:"TemplateCode"}}static types(){return{content:"string",errCode:"string",outId:"string",phoneNum:"string",receiveDate:"string",sendDate:"string",sendStatus:"number",templateCode:"string"}}}t.QuerySendDetailsResponseBodySmsSendDetailDTOsSmsSendDetailDTO=QuerySendDetailsResponseBodySmsSendDetailDTOsSmsSendDetailDTO;class QuerySendDetailsResponseBodySmsSendDetailDTOs extends l.Model{constructor(e){super(e)}static names(){return{smsSendDetailDTO:"SmsSendDetailDTO"}}static types(){return{smsSendDetailDTO:{type:"array",itemType:QuerySendDetailsResponseBodySmsSendDetailDTOsSmsSendDetailDTO}}}}t.QuerySendDetailsResponseBodySmsSendDetailDTOs=QuerySendDetailsResponseBodySmsSendDetailDTOs;class QuerySendStatisticsResponseBodyDataTargetList extends l.Model{constructor(e){super(e)}static names(){return{noRespondedCount:"NoRespondedCount",respondedFailCount:"RespondedFailCount",respondedSuccessCount:"RespondedSuccessCount",sendDate:"SendDate",totalCount:"TotalCount"}}static types(){return{noRespondedCount:"number",respondedFailCount:"number",respondedSuccessCount:"number",sendDate:"string",totalCount:"number"}}}t.QuerySendStatisticsResponseBodyDataTargetList=QuerySendStatisticsResponseBodyDataTargetList;class QuerySendStatisticsResponseBodyData extends l.Model{constructor(e){super(e)}static names(){return{targetList:"TargetList",totalSize:"TotalSize"}}static types(){return{targetList:{type:"array",itemType:QuerySendStatisticsResponseBodyDataTargetList},totalSize:"number"}}}t.QuerySendStatisticsResponseBodyData=QuerySendStatisticsResponseBodyData;class QueryShortUrlResponseBodyData extends l.Model{constructor(e){super(e)}static names(){return{createDate:"CreateDate",expireDate:"ExpireDate",pageViewCount:"PageViewCount",shortUrl:"ShortUrl",shortUrlName:"ShortUrlName",shortUrlStatus:"ShortUrlStatus",sourceUrl:"SourceUrl",uniqueVisitorCount:"UniqueVisitorCount"}}static types(){return{createDate:"string",expireDate:"string",pageViewCount:"string",shortUrl:"string",shortUrlName:"string",shortUrlStatus:"string",sourceUrl:"string",uniqueVisitorCount:"string"}}}t.QueryShortUrlResponseBodyData=QueryShortUrlResponseBodyData;class QuerySmsSignListResponseBodySmsSignListReason extends l.Model{constructor(e){super(e)}static names(){return{rejectDate:"RejectDate",rejectInfo:"RejectInfo",rejectSubInfo:"RejectSubInfo"}}static types(){return{rejectDate:"string",rejectInfo:"string",rejectSubInfo:"string"}}}t.QuerySmsSignListResponseBodySmsSignListReason=QuerySmsSignListResponseBodySmsSignListReason;class QuerySmsSignListResponseBodySmsSignList extends l.Model{constructor(e){super(e)}static names(){return{auditStatus:"AuditStatus",businessType:"BusinessType",createDate:"CreateDate",orderId:"OrderId",reason:"Reason",signName:"SignName"}}static types(){return{auditStatus:"string",businessType:"string",createDate:"string",orderId:"string",reason:QuerySmsSignListResponseBodySmsSignListReason,signName:"string"}}}t.QuerySmsSignListResponseBodySmsSignList=QuerySmsSignListResponseBodySmsSignList;class QuerySmsTemplateListResponseBodySmsTemplateListReason extends l.Model{constructor(e){super(e)}static names(){return{rejectDate:"RejectDate",rejectInfo:"RejectInfo",rejectSubInfo:"RejectSubInfo"}}static types(){return{rejectDate:"string",rejectInfo:"string",rejectSubInfo:"string"}}}t.QuerySmsTemplateListResponseBodySmsTemplateListReason=QuerySmsTemplateListResponseBodySmsTemplateListReason;class QuerySmsTemplateListResponseBodySmsTemplateList extends l.Model{constructor(e){super(e)}static names(){return{auditStatus:"AuditStatus",createDate:"CreateDate",orderId:"OrderId",outerTemplateType:"OuterTemplateType",reason:"Reason",templateCode:"TemplateCode",templateContent:"TemplateContent",templateName:"TemplateName",templateType:"TemplateType"}}static types(){return{auditStatus:"string",createDate:"string",orderId:"string",outerTemplateType:"number",reason:QuerySmsTemplateListResponseBodySmsTemplateListReason,templateCode:"string",templateContent:"string",templateName:"string",templateType:"number"}}}t.QuerySmsTemplateListResponseBodySmsTemplateList=QuerySmsTemplateListResponseBodySmsTemplateList;class SendBatchCardSmsResponseBodyData extends l.Model{constructor(e){super(e)}static names(){return{bizCardId:"BizCardId",bizDigitalId:"BizDigitalId",bizSmsId:"BizSmsId",cardTmpState:"CardTmpState",mediaMobiles:"MediaMobiles",notMediaMobiles:"NotMediaMobiles"}}static types(){return{bizCardId:"string",bizDigitalId:"string",bizSmsId:"string",cardTmpState:"number",mediaMobiles:"string",notMediaMobiles:"string"}}}t.SendBatchCardSmsResponseBodyData=SendBatchCardSmsResponseBodyData;class SendCardSmsRequestCardObjects extends l.Model{constructor(e){super(e)}static names(){return{customUrl:"customUrl",dyncParams:"dyncParams",mobile:"mobile"}}static types(){return{customUrl:"string",dyncParams:"string",mobile:"string"}}}t.SendCardSmsRequestCardObjects=SendCardSmsRequestCardObjects;class SendCardSmsResponseBodyData extends l.Model{constructor(e){super(e)}static names(){return{bizCardId:"BizCardId",bizDigitalId:"BizDigitalId",bizSmsId:"BizSmsId",cardTmpState:"CardTmpState",mediaMobiles:"MediaMobiles",notMediaMobiles:"NotMediaMobiles"}}static types(){return{bizCardId:"string",bizDigitalId:"string",bizSmsId:"string",cardTmpState:"number",mediaMobiles:"string",notMediaMobiles:"string"}}}t.SendCardSmsResponseBodyData=SendCardSmsResponseBodyData;class TagResourcesRequestTag extends l.Model{constructor(e){super(e)}static names(){return{key:"Key",value:"Value"}}static types(){return{key:"string",value:"string"}}}t.TagResourcesRequestTag=TagResourcesRequestTag;class Client extends a.default{constructor(e){super(e);this._endpointRule="central";this._endpointMap={"ap-southeast-1":"dysmsapi.ap-southeast-1.aliyuncs.com","ap-southeast-5":"dysmsapi-xman.ap-southeast-5.aliyuncs.com","cn-beijing":"dysmsapi-proxy.cn-beijing.aliyuncs.com","cn-hongkong":"dysmsapi-xman.cn-hongkong.aliyuncs.com"};this.checkConfig(e);this._endpoint=this.getEndpoint("dysmsapi",this._regionId,this._endpointRule,this._network,this._suffix,this._endpointMap,this._endpoint)}getEndpoint(e,t,r,s,n,o,a){if(!i.default.empty(a)){return a}if(!i.default.isUnset(o)&&!i.default.empty(o[t])){return o[t]}return d.default.getEndpointRules(e,t,r,s,n)}async addShortUrlWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}let s={};if(!i.default.isUnset(e.effectiveDays)){s["EffectiveDays"]=e.effectiveDays}if(!i.default.isUnset(e.shortUrlName)){s["ShortUrlName"]=e.shortUrlName}if(!i.default.isUnset(e.sourceUrl)){s["SourceUrl"]=e.sourceUrl}let n=new u.OpenApiRequest({query:c.default.query(r),body:c.default.parseToMap(s)});let o=new u.Params({action:"AddShortUrl",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(o,n,t),new AddShortUrlResponse({}))}async addShortUrl(e){let t=new o.RuntimeOptions({});return await this.addShortUrlWithOptions(e,t)}async addSmsSignWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.remark)){r["Remark"]=e.remark}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.signName)){r["SignName"]=e.signName}if(!i.default.isUnset(e.signSource)){r["SignSource"]=e.signSource}if(!i.default.isUnset(e.signType)){r["SignType"]=e.signType}let s={};if(!i.default.isUnset(e.signFileList)){s["SignFileList"]=e.signFileList}let n=new u.OpenApiRequest({query:c.default.query(r),body:c.default.parseToMap(s)});let o=new u.Params({action:"AddSmsSign",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(o,n,t),new AddSmsSignResponse({}))}async addSmsSign(e){let t=new o.RuntimeOptions({});return await this.addSmsSignWithOptions(e,t)}async addSmsTemplateWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.remark)){r["Remark"]=e.remark}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.templateContent)){r["TemplateContent"]=e.templateContent}if(!i.default.isUnset(e.templateName)){r["TemplateName"]=e.templateName}if(!i.default.isUnset(e.templateType)){r["TemplateType"]=e.templateType}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"AddSmsTemplate",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(n,s,t),new AddSmsTemplateResponse({}))}async addSmsTemplate(e){let t=new o.RuntimeOptions({});return await this.addSmsTemplateWithOptions(e,t)}async checkMobilesCardSupportWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.mobiles)){r["Mobiles"]=e.mobiles}if(!i.default.isUnset(e.templateCode)){r["TemplateCode"]=e.templateCode}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"CheckMobilesCardSupport",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(n,s,t),new CheckMobilesCardSupportResponse({}))}async checkMobilesCardSupport(e){let t=new o.RuntimeOptions({});return await this.checkMobilesCardSupportWithOptions(e,t)}async createCardSmsTemplateWithOptions(e,t){i.default.validateModel(e);let r=new CreateCardSmsTemplateShrinkRequest({});c.default.convert(e,r);if(!i.default.isUnset(e.template)){r.templateShrink=c.default.arrayToStringWithSpecifiedStyle(e.template,"Template","json")}let s={};if(!i.default.isUnset(r.factorys)){s["Factorys"]=r.factorys}if(!i.default.isUnset(r.memo)){s["Memo"]=r.memo}if(!i.default.isUnset(r.templateShrink)){s["Template"]=r.templateShrink}if(!i.default.isUnset(r.templateName)){s["TemplateName"]=r.templateName}let n=new u.OpenApiRequest({query:c.default.query(s)});let o=new u.Params({action:"CreateCardSmsTemplate",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(o,n,t),new CreateCardSmsTemplateResponse({}))}async createCardSmsTemplate(e){let t=new o.RuntimeOptions({});return await this.createCardSmsTemplateWithOptions(e,t)}async deleteShortUrlWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}let s={};if(!i.default.isUnset(e.sourceUrl)){s["SourceUrl"]=e.sourceUrl}let n=new u.OpenApiRequest({query:c.default.query(r),body:c.default.parseToMap(s)});let o=new u.Params({action:"DeleteShortUrl",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(o,n,t),new DeleteShortUrlResponse({}))}async deleteShortUrl(e){let t=new o.RuntimeOptions({});return await this.deleteShortUrlWithOptions(e,t)}async deleteSmsSignWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.signName)){r["SignName"]=e.signName}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"DeleteSmsSign",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(n,s,t),new DeleteSmsSignResponse({}))}async deleteSmsSign(e){let t=new o.RuntimeOptions({});return await this.deleteSmsSignWithOptions(e,t)}async deleteSmsTemplateWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.templateCode)){r["TemplateCode"]=e.templateCode}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"DeleteSmsTemplate",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(n,s,t),new DeleteSmsTemplateResponse({}))}async deleteSmsTemplate(e){let t=new o.RuntimeOptions({});return await this.deleteSmsTemplateWithOptions(e,t)}async getCardSmsLinkWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.cardCodeType)){r["CardCodeType"]=e.cardCodeType}if(!i.default.isUnset(e.cardLinkType)){r["CardLinkType"]=e.cardLinkType}if(!i.default.isUnset(e.cardTemplateCode)){r["CardTemplateCode"]=e.cardTemplateCode}if(!i.default.isUnset(e.cardTemplateParamJson)){r["CardTemplateParamJson"]=e.cardTemplateParamJson}if(!i.default.isUnset(e.customShortCodeJson)){r["CustomShortCodeJson"]=e.customShortCodeJson}if(!i.default.isUnset(e.domain)){r["Domain"]=e.domain}if(!i.default.isUnset(e.outId)){r["OutId"]=e.outId}if(!i.default.isUnset(e.phoneNumberJson)){r["PhoneNumberJson"]=e.phoneNumberJson}if(!i.default.isUnset(e.signNameJson)){r["SignNameJson"]=e.signNameJson}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"GetCardSmsLink",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(n,s,t),new GetCardSmsLinkResponse({}))}async getCardSmsLink(e){let t=new o.RuntimeOptions({});return await this.getCardSmsLinkWithOptions(e,t)}async getMediaResourceIdWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.extendInfo)){r["ExtendInfo"]=e.extendInfo}if(!i.default.isUnset(e.fileSize)){r["FileSize"]=e.fileSize}if(!i.default.isUnset(e.memo)){r["Memo"]=e.memo}if(!i.default.isUnset(e.ossKey)){r["OssKey"]=e.ossKey}if(!i.default.isUnset(e.resourceType)){r["ResourceType"]=e.resourceType}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"GetMediaResourceId",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(n,s,t),new GetMediaResourceIdResponse({}))}async getMediaResourceId(e){let t=new o.RuntimeOptions({});return await this.getMediaResourceIdWithOptions(e,t)}async getOSSInfoForCardTemplateWithOptions(e){let t=new u.OpenApiRequest({});let r=new u.Params({action:"GetOSSInfoForCardTemplate",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(r,t,e),new GetOSSInfoForCardTemplateResponse({}))}async getOSSInfoForCardTemplate(){let e=new o.RuntimeOptions({});return await this.getOSSInfoForCardTemplateWithOptions(e)}async listTagResourcesWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.nextToken)){r["NextToken"]=e.nextToken}if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.pageSize)){r["PageSize"]=e.pageSize}if(!i.default.isUnset(e.prodCode)){r["ProdCode"]=e.prodCode}if(!i.default.isUnset(e.regionId)){r["RegionId"]=e.regionId}if(!i.default.isUnset(e.resourceId)){r["ResourceId"]=e.resourceId}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.resourceType)){r["ResourceType"]=e.resourceType}if(!i.default.isUnset(e.tag)){r["Tag"]=e.tag}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"ListTagResources",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(n,s,t),new ListTagResourcesResponse({}))}async listTagResources(e){let t=new o.RuntimeOptions({});return await this.listTagResourcesWithOptions(e,t)}async modifySmsSignWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.remark)){r["Remark"]=e.remark}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.signName)){r["SignName"]=e.signName}if(!i.default.isUnset(e.signSource)){r["SignSource"]=e.signSource}if(!i.default.isUnset(e.signType)){r["SignType"]=e.signType}let s={};if(!i.default.isUnset(e.signFileList)){s["SignFileList"]=e.signFileList}let n=new u.OpenApiRequest({query:c.default.query(r),body:c.default.parseToMap(s)});let o=new u.Params({action:"ModifySmsSign",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(o,n,t),new ModifySmsSignResponse({}))}async modifySmsSign(e){let t=new o.RuntimeOptions({});return await this.modifySmsSignWithOptions(e,t)}async modifySmsTemplateWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.remark)){r["Remark"]=e.remark}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.templateCode)){r["TemplateCode"]=e.templateCode}if(!i.default.isUnset(e.templateContent)){r["TemplateContent"]=e.templateContent}if(!i.default.isUnset(e.templateName)){r["TemplateName"]=e.templateName}if(!i.default.isUnset(e.templateType)){r["TemplateType"]=e.templateType}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"ModifySmsTemplate",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(n,s,t),new ModifySmsTemplateResponse({}))}async modifySmsTemplate(e){let t=new o.RuntimeOptions({});return await this.modifySmsTemplateWithOptions(e,t)}async queryCardSmsTemplateWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.templateCode)){r["TemplateCode"]=e.templateCode}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"QueryCardSmsTemplate",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(n,s,t),new QueryCardSmsTemplateResponse({}))}async queryCardSmsTemplate(e){let t=new o.RuntimeOptions({});return await this.queryCardSmsTemplateWithOptions(e,t)}async queryCardSmsTemplateReportWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.endDate)){r["EndDate"]=e.endDate}if(!i.default.isUnset(e.startDate)){r["StartDate"]=e.startDate}if(!i.default.isUnset(e.templateCodes)){r["TemplateCodes"]=e.templateCodes}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"QueryCardSmsTemplateReport",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(n,s,t),new QueryCardSmsTemplateReportResponse({}))}async queryCardSmsTemplateReport(e){let t=new o.RuntimeOptions({});return await this.queryCardSmsTemplateReportWithOptions(e,t)}async querySendDetailsWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.bizId)){r["BizId"]=e.bizId}if(!i.default.isUnset(e.currentPage)){r["CurrentPage"]=e.currentPage}if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.pageSize)){r["PageSize"]=e.pageSize}if(!i.default.isUnset(e.phoneNumber)){r["PhoneNumber"]=e.phoneNumber}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.sendDate)){r["SendDate"]=e.sendDate}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"QuerySendDetails",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(n,s,t),new QuerySendDetailsResponse({}))}async querySendDetails(e){let t=new o.RuntimeOptions({});return await this.querySendDetailsWithOptions(e,t)}async querySendStatisticsWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.endDate)){r["EndDate"]=e.endDate}if(!i.default.isUnset(e.isGlobe)){r["IsGlobe"]=e.isGlobe}if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.pageIndex)){r["PageIndex"]=e.pageIndex}if(!i.default.isUnset(e.pageSize)){r["PageSize"]=e.pageSize}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.signName)){r["SignName"]=e.signName}if(!i.default.isUnset(e.startDate)){r["StartDate"]=e.startDate}if(!i.default.isUnset(e.templateType)){r["TemplateType"]=e.templateType}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"QuerySendStatistics",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(n,s,t),new QuerySendStatisticsResponse({}))}async querySendStatistics(e){let t=new o.RuntimeOptions({});return await this.querySendStatisticsWithOptions(e,t)}async queryShortUrlWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}let s={};if(!i.default.isUnset(e.shortUrl)){s["ShortUrl"]=e.shortUrl}let n=new u.OpenApiRequest({query:c.default.query(r),body:c.default.parseToMap(s)});let o=new u.Params({action:"QueryShortUrl",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(o,n,t),new QueryShortUrlResponse({}))}async queryShortUrl(e){let t=new o.RuntimeOptions({});return await this.queryShortUrlWithOptions(e,t)}async querySmsSignWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.signName)){r["SignName"]=e.signName}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"QuerySmsSign",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(n,s,t),new QuerySmsSignResponse({}))}async querySmsSign(e){let t=new o.RuntimeOptions({});return await this.querySmsSignWithOptions(e,t)}async querySmsSignListWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.pageIndex)){r["PageIndex"]=e.pageIndex}if(!i.default.isUnset(e.pageSize)){r["PageSize"]=e.pageSize}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"QuerySmsSignList",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(n,s,t),new QuerySmsSignListResponse({}))}async querySmsSignList(e){let t=new o.RuntimeOptions({});return await this.querySmsSignListWithOptions(e,t)}async querySmsTemplateWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.templateCode)){r["TemplateCode"]=e.templateCode}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"QuerySmsTemplate",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(n,s,t),new QuerySmsTemplateResponse({}))}async querySmsTemplate(e){let t=new o.RuntimeOptions({});return await this.querySmsTemplateWithOptions(e,t)}async querySmsTemplateListWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.pageIndex)){r["PageIndex"]=e.pageIndex}if(!i.default.isUnset(e.pageSize)){r["PageSize"]=e.pageSize}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"QuerySmsTemplateList",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(n,s,t),new QuerySmsTemplateListResponse({}))}async querySmsTemplateList(e){let t=new o.RuntimeOptions({});return await this.querySmsTemplateListWithOptions(e,t)}async sendBatchCardSmsWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.cardTemplateCode)){r["CardTemplateCode"]=e.cardTemplateCode}if(!i.default.isUnset(e.cardTemplateParamJson)){r["CardTemplateParamJson"]=e.cardTemplateParamJson}if(!i.default.isUnset(e.digitalTemplateCode)){r["DigitalTemplateCode"]=e.digitalTemplateCode}if(!i.default.isUnset(e.digitalTemplateParamJson)){r["DigitalTemplateParamJson"]=e.digitalTemplateParamJson}if(!i.default.isUnset(e.fallbackType)){r["FallbackType"]=e.fallbackType}if(!i.default.isUnset(e.outId)){r["OutId"]=e.outId}if(!i.default.isUnset(e.phoneNumberJson)){r["PhoneNumberJson"]=e.phoneNumberJson}if(!i.default.isUnset(e.signNameJson)){r["SignNameJson"]=e.signNameJson}if(!i.default.isUnset(e.smsTemplateCode)){r["SmsTemplateCode"]=e.smsTemplateCode}if(!i.default.isUnset(e.smsTemplateParamJson)){r["SmsTemplateParamJson"]=e.smsTemplateParamJson}if(!i.default.isUnset(e.smsUpExtendCodeJson)){r["SmsUpExtendCodeJson"]=e.smsUpExtendCodeJson}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"SendBatchCardSms",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(n,s,t),new SendBatchCardSmsResponse({}))}async sendBatchCardSms(e){let t=new o.RuntimeOptions({});return await this.sendBatchCardSmsWithOptions(e,t)}async sendBatchSmsWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.phoneNumberJson)){r["PhoneNumberJson"]=e.phoneNumberJson}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.signNameJson)){r["SignNameJson"]=e.signNameJson}if(!i.default.isUnset(e.smsUpExtendCodeJson)){r["SmsUpExtendCodeJson"]=e.smsUpExtendCodeJson}if(!i.default.isUnset(e.templateCode)){r["TemplateCode"]=e.templateCode}if(!i.default.isUnset(e.templateParamJson)){r["TemplateParamJson"]=e.templateParamJson}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"SendBatchSms",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(n,s,t),new SendBatchSmsResponse({}))}async sendBatchSms(e){let t=new o.RuntimeOptions({});return await this.sendBatchSmsWithOptions(e,t)}async sendCardSmsWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.cardObjects)){r["CardObjects"]=e.cardObjects}if(!i.default.isUnset(e.cardTemplateCode)){r["CardTemplateCode"]=e.cardTemplateCode}if(!i.default.isUnset(e.digitalTemplateCode)){r["DigitalTemplateCode"]=e.digitalTemplateCode}if(!i.default.isUnset(e.digitalTemplateParam)){r["DigitalTemplateParam"]=e.digitalTemplateParam}if(!i.default.isUnset(e.fallbackType)){r["FallbackType"]=e.fallbackType}if(!i.default.isUnset(e.outId)){r["OutId"]=e.outId}if(!i.default.isUnset(e.signName)){r["SignName"]=e.signName}if(!i.default.isUnset(e.smsTemplateCode)){r["SmsTemplateCode"]=e.smsTemplateCode}if(!i.default.isUnset(e.smsTemplateParam)){r["SmsTemplateParam"]=e.smsTemplateParam}if(!i.default.isUnset(e.smsUpExtendCode)){r["SmsUpExtendCode"]=e.smsUpExtendCode}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"SendCardSms",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(n,s,t),new SendCardSmsResponse({}))}async sendCardSms(e){let t=new o.RuntimeOptions({});return await this.sendCardSmsWithOptions(e,t)}async sendSmsWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.outId)){r["OutId"]=e.outId}if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.phoneNumbers)){r["PhoneNumbers"]=e.phoneNumbers}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.signName)){r["SignName"]=e.signName}if(!i.default.isUnset(e.smsUpExtendCode)){r["SmsUpExtendCode"]=e.smsUpExtendCode}if(!i.default.isUnset(e.templateCode)){r["TemplateCode"]=e.templateCode}if(!i.default.isUnset(e.templateParam)){r["TemplateParam"]=e.templateParam}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"SendSms",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(n,s,t),new SendSmsResponse({}))}async sendSms(e){let t=new o.RuntimeOptions({});return await this.sendSmsWithOptions(e,t)}async tagResourcesWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.prodCode)){r["ProdCode"]=e.prodCode}if(!i.default.isUnset(e.regionId)){r["RegionId"]=e.regionId}if(!i.default.isUnset(e.resourceId)){r["ResourceId"]=e.resourceId}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.resourceType)){r["ResourceType"]=e.resourceType}if(!i.default.isUnset(e.tag)){r["Tag"]=e.tag}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"TagResources",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(n,s,t),new TagResourcesResponse({}))}async tagResources(e){let t=new o.RuntimeOptions({});return await this.tagResourcesWithOptions(e,t)}async untagResourcesWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.all)){r["All"]=e.all}if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.prodCode)){r["ProdCode"]=e.prodCode}if(!i.default.isUnset(e.regionId)){r["RegionId"]=e.regionId}if(!i.default.isUnset(e.resourceId)){r["ResourceId"]=e.resourceId}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.resourceType)){r["ResourceType"]=e.resourceType}if(!i.default.isUnset(e.tagKey)){r["TagKey"]=e.tagKey}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"UntagResources",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return l.cast(await this.callApi(n,s,t),new UntagResourcesResponse({}))}async untagResources(e){let t=new o.RuntimeOptions({});return await this.untagResourcesWithOptions(e,t)}}t["default"]=Client},2306:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=function(){function Client(){}Client.getEndpointRules=function(e,t,r,s,n){var i;if(s&&s.length&&s!="public"){s="-"+s}else{s=""}n=n||"";if(n.length){n="-"+n}if(r=="regional"){if(!t||!t.length){throw new Error("RegionId is empty, please set a valid RegionId")}i=""+e+n+s+"."+t+".aliyuncs.com"}else{i=""+e+n+s+".aliyuncs.com"}return i};return Client}();t["default"]=r},2652:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.InterceptorContextResponse=t.InterceptorContextConfiguration=t.InterceptorContextRequest=t.AttributeMap=t.InterceptorContext=void 0;const a=o(r(4060));const u=i(r(4165));class InterceptorContext extends u.Model{constructor(e){super(e)}static names(){return{request:"request",configuration:"configuration",response:"response"}}static types(){return{request:InterceptorContextRequest,configuration:InterceptorContextConfiguration,response:InterceptorContextResponse}}}t.InterceptorContext=InterceptorContext;class AttributeMap extends u.Model{constructor(e){super(e)}static names(){return{attributes:"attributes",key:"key"}}static types(){return{attributes:{type:"map",keyType:"string",valueType:"any"},key:{type:"map",keyType:"string",valueType:"string"}}}}t.AttributeMap=AttributeMap;class InterceptorContextRequest extends u.Model{constructor(e){super(e)}static names(){return{headers:"headers",query:"query",body:"body",stream:"stream",hostMap:"hostMap",pathname:"pathname",productId:"productId",action:"action",version:"version",protocol:"protocol",method:"method",authType:"authType",bodyType:"bodyType",reqBodyType:"reqBodyType",style:"style",credential:"credential",signatureVersion:"signatureVersion",signatureAlgorithm:"signatureAlgorithm",userAgent:"userAgent"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},query:{type:"map",keyType:"string",valueType:"string"},body:"any",stream:"Readable",hostMap:{type:"map",keyType:"string",valueType:"string"},pathname:"string",productId:"string",action:"string",version:"string",protocol:"string",method:"string",authType:"string",bodyType:"string",reqBodyType:"string",style:"string",credential:a.default,signatureVersion:"string",signatureAlgorithm:"string",userAgent:"string"}}}t.InterceptorContextRequest=InterceptorContextRequest;class InterceptorContextConfiguration extends u.Model{constructor(e){super(e)}static names(){return{regionId:"regionId",endpoint:"endpoint",endpointRule:"endpointRule",endpointMap:"endpointMap",endpointType:"endpointType",network:"network",suffix:"suffix"}}static types(){return{regionId:"string",endpoint:"string",endpointRule:"string",endpointMap:{type:"map",keyType:"string",valueType:"string"},endpointType:"string",network:"string",suffix:"string"}}}t.InterceptorContextConfiguration=InterceptorContextConfiguration;class InterceptorContextResponse extends u.Model{constructor(e){super(e)}static names(){return{statusCode:"statusCode",headers:"headers",body:"body",deserializedBody:"deserializedBody"}}static types(){return{statusCode:"number",headers:{type:"map",keyType:"string",valueType:"string"},body:"Readable",deserializedBody:"any"}}}t.InterceptorContextResponse=InterceptorContextResponse;class Client{constructor(){}}t["default"]=Client},6642:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.Params=t.OpenApiRequest=t.Config=t.GlobalParameters=void 0;const a=o(r(1979));const u=i(r(4060)),c=u;const d=o(r(2868));const l=i(r(2652));const p=o(r(5757));const f=i(r(4165));class GlobalParameters extends f.Model{constructor(e){super(e)}static names(){return{headers:"headers",queries:"queries"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},queries:{type:"map",keyType:"string",valueType:"string"}}}}t.GlobalParameters=GlobalParameters;class Config extends f.Model{constructor(e){super(e)}static names(){return{accessKeyId:"accessKeyId",accessKeySecret:"accessKeySecret",securityToken:"securityToken",bearerToken:"bearerToken",protocol:"protocol",method:"method",regionId:"regionId",readTimeout:"readTimeout",connectTimeout:"connectTimeout",httpProxy:"httpProxy",httpsProxy:"httpsProxy",credential:"credential",endpoint:"endpoint",noProxy:"noProxy",maxIdleConns:"maxIdleConns",network:"network",userAgent:"userAgent",suffix:"suffix",socks5Proxy:"socks5Proxy",socks5NetWork:"socks5NetWork",endpointType:"endpointType",openPlatformEndpoint:"openPlatformEndpoint",type:"type",signatureVersion:"signatureVersion",signatureAlgorithm:"signatureAlgorithm",globalParameters:"globalParameters",key:"key",cert:"cert",ca:"ca",disableHttp2:"disableHttp2"}}static types(){return{accessKeyId:"string",accessKeySecret:"string",securityToken:"string",bearerToken:"string",protocol:"string",method:"string",regionId:"string",readTimeout:"number",connectTimeout:"number",httpProxy:"string",httpsProxy:"string",credential:u.default,endpoint:"string",noProxy:"string",maxIdleConns:"number",network:"string",userAgent:"string",suffix:"string",socks5Proxy:"string",socks5NetWork:"string",endpointType:"string",openPlatformEndpoint:"string",type:"string",signatureVersion:"string",signatureAlgorithm:"string",globalParameters:GlobalParameters,key:"string",cert:"string",ca:"string",disableHttp2:"boolean"}}}t.Config=Config;class OpenApiRequest extends f.Model{constructor(e){super(e)}static names(){return{headers:"headers",query:"query",body:"body",stream:"stream",hostMap:"hostMap",endpointOverride:"endpointOverride"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},query:{type:"map",keyType:"string",valueType:"string"},body:"any",stream:"Readable",hostMap:{type:"map",keyType:"string",valueType:"string"},endpointOverride:"string"}}}t.OpenApiRequest=OpenApiRequest;class Params extends f.Model{constructor(e){super(e)}static names(){return{action:"action",version:"version",protocol:"protocol",pathname:"pathname",method:"method",authType:"authType",bodyType:"bodyType",reqBodyType:"reqBodyType",style:"style"}}static types(){return{action:"string",version:"string",protocol:"string",pathname:"string",method:"string",authType:"string",bodyType:"string",reqBodyType:"string",style:"string"}}}t.Params=Params;class Client{constructor(e){if(a.default.isUnset(e)){throw f.newError({code:"ParameterMissing",message:"'config' can not be unset"})}if(!a.default.empty(e.accessKeyId)&&!a.default.empty(e.accessKeySecret)){if(!a.default.empty(e.securityToken)){e.type="sts"}else{e.type="access_key"}let t=new c.Config({accessKeyId:e.accessKeyId,type:e.type,accessKeySecret:e.accessKeySecret});t.securityToken=e.securityToken;this._credential=new u.default(t)}else if(!a.default.empty(e.bearerToken)){let t=new c.Config({type:"bearer",bearerToken:e.bearerToken});this._credential=new u.default(t)}else if(!a.default.isUnset(e.credential)){this._credential=e.credential}this._endpoint=e.endpoint;this._endpointType=e.endpointType;this._network=e.network;this._suffix=e.suffix;this._protocol=e.protocol;this._method=e.method;this._regionId=e.regionId;this._userAgent=e.userAgent;this._readTimeout=e.readTimeout;this._connectTimeout=e.connectTimeout;this._httpProxy=e.httpProxy;this._httpsProxy=e.httpsProxy;this._noProxy=e.noProxy;this._socks5Proxy=e.socks5Proxy;this._socks5NetWork=e.socks5NetWork;this._maxIdleConns=e.maxIdleConns;this._signatureVersion=e.signatureVersion;this._signatureAlgorithm=e.signatureAlgorithm;this._globalParameters=e.globalParameters;this._key=e.key;this._cert=e.cert;this._ca=e.ca;this._disableHttp2=e.disableHttp2}async doRPCRequest(e,t,r,s,n,i,o,u){let c={timeouted:"retry",key:a.default.defaultString(u.key,this._key),cert:a.default.defaultString(u.cert,this._cert),ca:a.default.defaultString(u.ca,this._ca),readTimeout:a.default.defaultNumber(u.readTimeout,this._readTimeout),connectTimeout:a.default.defaultNumber(u.connectTimeout,this._connectTimeout),httpProxy:a.default.defaultString(u.httpProxy,this._httpProxy),httpsProxy:a.default.defaultString(u.httpsProxy,this._httpsProxy),noProxy:a.default.defaultString(u.noProxy,this._noProxy),socks5Proxy:a.default.defaultString(u.socks5Proxy,this._socks5Proxy),socks5NetWork:a.default.defaultString(u.socks5NetWork,this._socks5NetWork),maxIdleConns:a.default.defaultNumber(u.maxIdleConns,this._maxIdleConns),retry:{retryable:u.autoretry,maxAttempts:a.default.defaultNumber(u.maxAttempts,3)},backoff:{policy:a.default.defaultString(u.backoffPolicy,"no"),period:a.default.defaultNumber(u.backoffPeriod,1)},ignoreSSL:u.ignoreSSL};let l=null;let p=Date.now();let h=0;while(f.allowRetry(c["retry"],h,p)){if(h>0){let e=f.getBackoffTime(c["backoff"],h);if(e>0){await f.sleep(e)}}h=h+1;try{let p=new f.Request;p.protocol=a.default.defaultString(this._protocol,r);p.method=s;p.pathname="/";let h={};let m={};if(!a.default.isUnset(this._globalParameters)){let e=this._globalParameters;if(!a.default.isUnset(e.queries)){h=e.queries}if(!a.default.isUnset(e.headers)){m=e.headers}}let y={};let g={};if(!a.default.isUnset(u.extendsParameters)){let e=u.extendsParameters;if(!a.default.isUnset(e.headers)){y=e.headers}if(!a.default.isUnset(e.queries)){g=e.queries}}p.query=Object.assign(Object.assign(Object.assign({Action:e,Format:"json",Version:t,Timestamp:d.default.getTimestamp(),SignatureNonce:a.default.getNonce()},h),g),o.query);let S=this.getRpcHeaders();if(a.default.isUnset(S)){p.headers=Object.assign(Object.assign({host:this._endpoint,"x-acs-version":t,"x-acs-action":e,"user-agent":this.getUserAgent()},m),y)}else{p.headers=Object.assign(Object.assign(Object.assign({host:this._endpoint,"x-acs-version":t,"x-acs-action":e,"user-agent":this.getUserAgent()},m),y),S)}if(!a.default.isUnset(o.body)){let e=a.default.assertAsMap(o.body);let t=a.default.anyifyMapValue(d.default.query(e));p.body=new f.BytesReadable(a.default.toFormString(t));p.headers["content-type"]="application/x-www-form-urlencoded"}if(!a.default.equalString(n,"Anonymous")){let e=await this._credential.getCredential();let t=e.type;if(a.default.equalString(t,"bearer")){let t=e.bearerToken;p.query["BearerToken"]=t;p.query["SignatureType"]="BEARERTOKEN"}else{let t=e.accessKeyId;let r=e.accessKeySecret;let s=e.securityToken;if(!a.default.empty(s)){p.query["SecurityToken"]=s}p.query["SignatureMethod"]="HMAC-SHA1";p.query["SignatureVersion"]="1.0";p.query["AccessKeyId"]=t;let n=null;if(!a.default.isUnset(o.body)){n=a.default.assertAsMap(o.body)}let i=Object.assign(Object.assign({},p.query),d.default.query(n));p.query["Signature"]=d.default.getRPCSignature(i,p.method,r)}}l=p;let T=await f.doAction(p,c);if(a.default.is4xx(T.statusCode)||a.default.is5xx(T.statusCode)){let e=await a.default.readAsJSON(T.body);let t=a.default.assertAsMap(e);let r=Client.defaultAny(t["RequestId"],t["requestId"]);t["statusCode"]=T.statusCode;throw f.newError({code:`${Client.defaultAny(t["Code"],t["code"])}`,message:`code: ${T.statusCode}, ${Client.defaultAny(t["Message"],t["message"])} request id: ${r}`,data:t,description:`${Client.defaultAny(t["Description"],t["description"])}`,accessDeniedDetail:Client.defaultAny(t["AccessDeniedDetail"],t["accessDeniedDetail"])})}if(a.default.equalString(i,"binary")){let e={body:T.body,headers:T.headers,statusCode:T.statusCode};return e}else if(a.default.equalString(i,"byte")){let e=await a.default.readAsBytes(T.body);return{body:e,headers:T.headers,statusCode:T.statusCode}}else if(a.default.equalString(i,"string")){let e=await a.default.readAsString(T.body);return{body:e,headers:T.headers,statusCode:T.statusCode}}else if(a.default.equalString(i,"json")){let e=await a.default.readAsJSON(T.body);let t=a.default.assertAsMap(e);return{body:t,headers:T.headers,statusCode:T.statusCode}}else if(a.default.equalString(i,"array")){let e=await a.default.readAsJSON(T.body);return{body:e,headers:T.headers,statusCode:T.statusCode}}else{return{headers:T.headers,statusCode:T.statusCode}}}catch(e){if(f.isRetryable(e)){continue}throw e}}throw f.newUnretryableError(l)}async doROARequest(e,t,r,s,n,i,o,u,c){let l={timeouted:"retry",key:a.default.defaultString(c.key,this._key),cert:a.default.defaultString(c.cert,this._cert),ca:a.default.defaultString(c.ca,this._ca),readTimeout:a.default.defaultNumber(c.readTimeout,this._readTimeout),connectTimeout:a.default.defaultNumber(c.connectTimeout,this._connectTimeout),httpProxy:a.default.defaultString(c.httpProxy,this._httpProxy),httpsProxy:a.default.defaultString(c.httpsProxy,this._httpsProxy),noProxy:a.default.defaultString(c.noProxy,this._noProxy),socks5Proxy:a.default.defaultString(c.socks5Proxy,this._socks5Proxy),socks5NetWork:a.default.defaultString(c.socks5NetWork,this._socks5NetWork),maxIdleConns:a.default.defaultNumber(c.maxIdleConns,this._maxIdleConns),retry:{retryable:c.autoretry,maxAttempts:a.default.defaultNumber(c.maxAttempts,3)},backoff:{policy:a.default.defaultString(c.backoffPolicy,"no"),period:a.default.defaultNumber(c.backoffPeriod,1)},ignoreSSL:c.ignoreSSL};let p=null;let h=Date.now();let m=0;while(f.allowRetry(l["retry"],m,h)){if(m>0){let e=f.getBackoffTime(l["backoff"],m);if(e>0){await f.sleep(e)}}m=m+1;try{let h=new f.Request;h.protocol=a.default.defaultString(this._protocol,r);h.method=s;h.pathname=i;let m={};let y={};if(!a.default.isUnset(this._globalParameters)){let e=this._globalParameters;if(!a.default.isUnset(e.queries)){m=e.queries}if(!a.default.isUnset(e.headers)){y=e.headers}}let g={};let S={};if(!a.default.isUnset(c.extendsParameters)){let e=c.extendsParameters;if(!a.default.isUnset(e.headers)){g=e.headers}if(!a.default.isUnset(e.queries)){S=e.queries}}h.headers=Object.assign(Object.assign(Object.assign({date:a.default.getDateUTCString(),host:this._endpoint,accept:"application/json","x-acs-signature-nonce":a.default.getNonce(),"x-acs-signature-method":"HMAC-SHA1","x-acs-signature-version":"1.0","x-acs-version":t,"x-acs-action":e,"user-agent":a.default.getUserAgent(this._userAgent)},y),g),u.headers);if(!a.default.isUnset(u.body)){h.body=new f.BytesReadable(a.default.toJSONString(u.body));h.headers["content-type"]="application/json; charset=utf-8"}h.query=Object.assign(Object.assign({},m),S);if(!a.default.isUnset(u.query)){h.query=Object.assign(Object.assign({},h.query),u.query)}if(!a.default.equalString(n,"Anonymous")){let e=await this._credential.getCredential();let t=e.type;if(a.default.equalString(t,"bearer")){let t=e.bearerToken;h.headers["x-acs-bearer-token"]=t;h.headers["x-acs-signature-type"]="BEARERTOKEN"}else{let t=e.accessKeyId;let r=e.accessKeySecret;let s=e.securityToken;if(!a.default.empty(s)){h.headers["x-acs-accesskey-id"]=t;h.headers["x-acs-security-token"]=s}let n=d.default.getStringToSign(h);h.headers["authorization"]=`acs ${t}:${d.default.getROASignature(n,r)}`}}p=h;let T=await f.doAction(h,l);if(a.default.equalNumber(T.statusCode,204)){return{headers:T.headers}}if(a.default.is4xx(T.statusCode)||a.default.is5xx(T.statusCode)){let e=await a.default.readAsJSON(T.body);let t=a.default.assertAsMap(e);let r=Client.defaultAny(t["RequestId"],t["requestId"]);r=Client.defaultAny(r,t["requestid"]);t["statusCode"]=T.statusCode;throw f.newError({code:`${Client.defaultAny(t["Code"],t["code"])}`,message:`code: ${T.statusCode}, ${Client.defaultAny(t["Message"],t["message"])} request id: ${r}`,data:t,description:`${Client.defaultAny(t["Description"],t["description"])}`,accessDeniedDetail:Client.defaultAny(t["AccessDeniedDetail"],t["accessDeniedDetail"])})}if(a.default.equalString(o,"binary")){let e={body:T.body,headers:T.headers,statusCode:T.statusCode};return e}else if(a.default.equalString(o,"byte")){let e=await a.default.readAsBytes(T.body);return{body:e,headers:T.headers,statusCode:T.statusCode}}else if(a.default.equalString(o,"string")){let e=await a.default.readAsString(T.body);return{body:e,headers:T.headers,statusCode:T.statusCode}}else if(a.default.equalString(o,"json")){let e=await a.default.readAsJSON(T.body);let t=a.default.assertAsMap(e);return{body:t,headers:T.headers,statusCode:T.statusCode}}else if(a.default.equalString(o,"array")){let e=await a.default.readAsJSON(T.body);return{body:e,headers:T.headers,statusCode:T.statusCode}}else{return{headers:T.headers,statusCode:T.statusCode}}}catch(e){if(f.isRetryable(e)){continue}throw e}}throw f.newUnretryableError(p)}async doROARequestWithForm(e,t,r,s,n,i,o,u,c){let l={timeouted:"retry",key:a.default.defaultString(c.key,this._key),cert:a.default.defaultString(c.cert,this._cert),ca:a.default.defaultString(c.ca,this._ca),readTimeout:a.default.defaultNumber(c.readTimeout,this._readTimeout),connectTimeout:a.default.defaultNumber(c.connectTimeout,this._connectTimeout),httpProxy:a.default.defaultString(c.httpProxy,this._httpProxy),httpsProxy:a.default.defaultString(c.httpsProxy,this._httpsProxy),noProxy:a.default.defaultString(c.noProxy,this._noProxy),socks5Proxy:a.default.defaultString(c.socks5Proxy,this._socks5Proxy),socks5NetWork:a.default.defaultString(c.socks5NetWork,this._socks5NetWork),maxIdleConns:a.default.defaultNumber(c.maxIdleConns,this._maxIdleConns),retry:{retryable:c.autoretry,maxAttempts:a.default.defaultNumber(c.maxAttempts,3)},backoff:{policy:a.default.defaultString(c.backoffPolicy,"no"),period:a.default.defaultNumber(c.backoffPeriod,1)},ignoreSSL:c.ignoreSSL};let p=null;let h=Date.now();let m=0;while(f.allowRetry(l["retry"],m,h)){if(m>0){let e=f.getBackoffTime(l["backoff"],m);if(e>0){await f.sleep(e)}}m=m+1;try{let h=new f.Request;h.protocol=a.default.defaultString(this._protocol,r);h.method=s;h.pathname=i;let m={};let y={};if(!a.default.isUnset(this._globalParameters)){let e=this._globalParameters;if(!a.default.isUnset(e.queries)){m=e.queries}if(!a.default.isUnset(e.headers)){y=e.headers}}let g={};let S={};if(!a.default.isUnset(c.extendsParameters)){let e=c.extendsParameters;if(!a.default.isUnset(e.headers)){g=e.headers}if(!a.default.isUnset(e.queries)){S=e.queries}}h.headers=Object.assign(Object.assign(Object.assign({date:a.default.getDateUTCString(),host:this._endpoint,accept:"application/json","x-acs-signature-nonce":a.default.getNonce(),"x-acs-signature-method":"HMAC-SHA1","x-acs-signature-version":"1.0","x-acs-version":t,"x-acs-action":e,"user-agent":a.default.getUserAgent(this._userAgent)},y),g),u.headers);if(!a.default.isUnset(u.body)){let e=a.default.assertAsMap(u.body);h.body=new f.BytesReadable(d.default.toForm(e));h.headers["content-type"]="application/x-www-form-urlencoded"}h.query=Object.assign(Object.assign({},m),S);if(!a.default.isUnset(u.query)){h.query=Object.assign(Object.assign({},h.query),u.query)}if(!a.default.equalString(n,"Anonymous")){let e=await this._credential.getCredential();let t=e.type;if(a.default.equalString(t,"bearer")){let t=e.bearerToken;h.headers["x-acs-bearer-token"]=t;h.headers["x-acs-signature-type"]="BEARERTOKEN"}else{let t=e.accessKeyId;let r=e.accessKeySecret;let s=e.securityToken;if(!a.default.empty(s)){h.headers["x-acs-accesskey-id"]=t;h.headers["x-acs-security-token"]=s}let n=d.default.getStringToSign(h);h.headers["authorization"]=`acs ${t}:${d.default.getROASignature(n,r)}`}}p=h;let T=await f.doAction(h,l);if(a.default.equalNumber(T.statusCode,204)){return{headers:T.headers}}if(a.default.is4xx(T.statusCode)||a.default.is5xx(T.statusCode)){let e=await a.default.readAsJSON(T.body);let t=a.default.assertAsMap(e);t["statusCode"]=T.statusCode;throw f.newError({code:`${Client.defaultAny(t["Code"],t["code"])}`,message:`code: ${T.statusCode}, ${Client.defaultAny(t["Message"],t["message"])} request id: ${Client.defaultAny(t["RequestId"],t["requestId"])}`,data:t,description:`${Client.defaultAny(t["Description"],t["description"])}`,accessDeniedDetail:Client.defaultAny(t["AccessDeniedDetail"],t["accessDeniedDetail"])})}if(a.default.equalString(o,"binary")){let e={body:T.body,headers:T.headers,statusCode:T.statusCode};return e}else if(a.default.equalString(o,"byte")){let e=await a.default.readAsBytes(T.body);return{body:e,headers:T.headers,statusCode:T.statusCode}}else if(a.default.equalString(o,"string")){let e=await a.default.readAsString(T.body);return{body:e,headers:T.headers,statusCode:T.statusCode}}else if(a.default.equalString(o,"json")){let e=await a.default.readAsJSON(T.body);let t=a.default.assertAsMap(e);return{body:t,headers:T.headers,statusCode:T.statusCode}}else if(a.default.equalString(o,"array")){let e=await a.default.readAsJSON(T.body);return{body:e,headers:T.headers,statusCode:T.statusCode}}else{return{headers:T.headers,statusCode:T.statusCode}}}catch(e){if(f.isRetryable(e)){continue}throw e}}throw f.newUnretryableError(p)}async doRequest(e,t,r){let s={timeouted:"retry",key:a.default.defaultString(r.key,this._key),cert:a.default.defaultString(r.cert,this._cert),ca:a.default.defaultString(r.ca,this._ca),readTimeout:a.default.defaultNumber(r.readTimeout,this._readTimeout),connectTimeout:a.default.defaultNumber(r.connectTimeout,this._connectTimeout),httpProxy:a.default.defaultString(r.httpProxy,this._httpProxy),httpsProxy:a.default.defaultString(r.httpsProxy,this._httpsProxy),noProxy:a.default.defaultString(r.noProxy,this._noProxy),socks5Proxy:a.default.defaultString(r.socks5Proxy,this._socks5Proxy),socks5NetWork:a.default.defaultString(r.socks5NetWork,this._socks5NetWork),maxIdleConns:a.default.defaultNumber(r.maxIdleConns,this._maxIdleConns),retry:{retryable:r.autoretry,maxAttempts:a.default.defaultNumber(r.maxAttempts,3)},backoff:{policy:a.default.defaultString(r.backoffPolicy,"no"),period:a.default.defaultNumber(r.backoffPeriod,1)},ignoreSSL:r.ignoreSSL};let n=null;let i=Date.now();let o=0;while(f.allowRetry(s["retry"],o,i)){if(o>0){let e=f.getBackoffTime(s["backoff"],o);if(e>0){await f.sleep(e)}}o=o+1;try{let i=new f.Request;i.protocol=a.default.defaultString(this._protocol,e.protocol);i.method=e.method;i.pathname=e.pathname;let o={};let u={};if(!a.default.isUnset(this._globalParameters)){let e=this._globalParameters;if(!a.default.isUnset(e.queries)){o=e.queries}if(!a.default.isUnset(e.headers)){u=e.headers}}let c={};let l={};if(!a.default.isUnset(r.extendsParameters)){let e=r.extendsParameters;if(!a.default.isUnset(e.headers)){c=e.headers}if(!a.default.isUnset(e.queries)){l=e.queries}}i.query=Object.assign(Object.assign(Object.assign({},o),l),t.query);i.headers=Object.assign(Object.assign(Object.assign({host:this._endpoint,"x-acs-version":e.version,"x-acs-action":e.action,"user-agent":this.getUserAgent(),"x-acs-date":d.default.getTimestamp(),"x-acs-signature-nonce":a.default.getNonce(),accept:"application/json"},u),c),t.headers);if(a.default.equalString(e.style,"RPC")){let e=this.getRpcHeaders();if(!a.default.isUnset(e)){i.headers=Object.assign(Object.assign({},i.headers),e)}}let h=a.default.defaultString(this._signatureAlgorithm,"ACS3-HMAC-SHA256");let m=d.default.hexEncode(d.default.hash(a.default.toBytes(""),h));if(!a.default.isUnset(t.stream)){let e=await a.default.readAsBytes(t.stream);m=d.default.hexEncode(d.default.hash(e,h));i.body=new f.BytesReadable(e);i.headers["content-type"]="application/octet-stream"}else{if(!a.default.isUnset(t.body)){if(a.default.equalString(e.reqBodyType,"byte")){let e=a.default.assertAsBytes(t.body);m=d.default.hexEncode(d.default.hash(e,h));i.body=new f.BytesReadable(e)}else if(a.default.equalString(e.reqBodyType,"json")){let e=a.default.toJSONString(t.body);m=d.default.hexEncode(d.default.hash(a.default.toBytes(e),h));i.body=new f.BytesReadable(e);i.headers["content-type"]="application/json; charset=utf-8"}else{let e=a.default.assertAsMap(t.body);let r=d.default.toForm(e);m=d.default.hexEncode(d.default.hash(a.default.toBytes(r),h));i.body=new f.BytesReadable(r);i.headers["content-type"]="application/x-www-form-urlencoded"}}}i.headers["x-acs-content-sha256"]=m;if(!a.default.equalString(e.authType,"Anonymous")){let t=await this._credential.getCredential();let r=t.type;if(a.default.equalString(r,"bearer")){let r=t.bearerToken;i.headers["x-acs-bearer-token"]=r;if(a.default.equalString(e.style,"RPC")){i.query["SignatureType"]="BEARERTOKEN"}else{i.headers["x-acs-signature-type"]="BEARERTOKEN"}}else{let e=t.accessKeyId;let r=t.accessKeySecret;let s=t.securityToken;if(!a.default.empty(s)){i.headers["x-acs-accesskey-id"]=e;i.headers["x-acs-security-token"]=s}i.headers["Authorization"]=d.default.getAuthorization(i,h,m,e,r)}}n=i;let y=await f.doAction(i,s);if(a.default.is4xx(y.statusCode)||a.default.is5xx(y.statusCode)){let e={};if(!a.default.isUnset(y.headers["content-type"])&&a.default.equalString(y.headers["content-type"],"text/xml;charset=utf-8")){let t=await a.default.readAsString(y.body);let r=p.default.parseXml(t,null);e=a.default.assertAsMap(r["Error"])}else{let t=await a.default.readAsJSON(y.body);e=a.default.assertAsMap(t)}e["statusCode"]=y.statusCode;throw f.newError({code:`${Client.defaultAny(e["Code"],e["code"])}`,message:`code: ${y.statusCode}, ${Client.defaultAny(e["Message"],e["message"])} request id: ${Client.defaultAny(e["RequestId"],e["requestId"])}`,data:e,description:`${Client.defaultAny(e["Description"],e["description"])}`,accessDeniedDetail:Client.defaultAny(e["AccessDeniedDetail"],e["accessDeniedDetail"])})}if(a.default.equalString(e.bodyType,"binary")){let e={body:y.body,headers:y.headers,statusCode:y.statusCode};return e}else if(a.default.equalString(e.bodyType,"byte")){let e=await a.default.readAsBytes(y.body);return{body:e,headers:y.headers,statusCode:y.statusCode}}else if(a.default.equalString(e.bodyType,"string")){let e=await a.default.readAsString(y.body);return{body:e,headers:y.headers,statusCode:y.statusCode}}else if(a.default.equalString(e.bodyType,"json")){let e=await a.default.readAsJSON(y.body);let t=a.default.assertAsMap(e);return{body:t,headers:y.headers,statusCode:y.statusCode}}else if(a.default.equalString(e.bodyType,"array")){let e=await a.default.readAsJSON(y.body);return{body:e,headers:y.headers,statusCode:y.statusCode}}else{let e=await a.default.readAsString(y.body);return{body:e,headers:y.headers,statusCode:y.statusCode}}}catch(e){if(f.isRetryable(e)){continue}throw e}}throw f.newUnretryableError(n)}async execute(e,t,r){let s={timeouted:"retry",key:a.default.defaultString(r.key,this._key),cert:a.default.defaultString(r.cert,this._cert),ca:a.default.defaultString(r.ca,this._ca),readTimeout:a.default.defaultNumber(r.readTimeout,this._readTimeout),connectTimeout:a.default.defaultNumber(r.connectTimeout,this._connectTimeout),httpProxy:a.default.defaultString(r.httpProxy,this._httpProxy),httpsProxy:a.default.defaultString(r.httpsProxy,this._httpsProxy),noProxy:a.default.defaultString(r.noProxy,this._noProxy),socks5Proxy:a.default.defaultString(r.socks5Proxy,this._socks5Proxy),socks5NetWork:a.default.defaultString(r.socks5NetWork,this._socks5NetWork),maxIdleConns:a.default.defaultNumber(r.maxIdleConns,this._maxIdleConns),retry:{retryable:r.autoretry,maxAttempts:a.default.defaultNumber(r.maxAttempts,3)},backoff:{policy:a.default.defaultString(r.backoffPolicy,"no"),period:a.default.defaultNumber(r.backoffPeriod,1)},ignoreSSL:r.ignoreSSL,disableHttp2:Client.defaultAny(this._disableHttp2,false)};let n=null;let i=Date.now();let o=0;while(f.allowRetry(s["retry"],o,i)){if(o>0){let e=f.getBackoffTime(s["backoff"],o);if(e>0){await f.sleep(e)}}o=o+1;try{let i=new f.Request;let o=this.getRpcHeaders();let u={};let c={};if(!a.default.isUnset(this._globalParameters)){let e=this._globalParameters;if(!a.default.isUnset(e.queries)){u=e.queries}if(!a.default.isUnset(e.headers)){c=e.headers}}let d={};let p={};if(!a.default.isUnset(r.extendsParameters)){let e=r.extendsParameters;if(!a.default.isUnset(e.headers)){d=e.headers}if(!a.default.isUnset(e.queries)){p=e.queries}}let h=new l.InterceptorContextRequest({headers:Object.assign(Object.assign(Object.assign(Object.assign({},c),d),t.headers),o),query:Object.assign(Object.assign(Object.assign({},u),p),t.query),body:t.body,stream:t.stream,hostMap:t.hostMap,pathname:e.pathname,productId:this._productId,action:e.action,version:e.version,protocol:a.default.defaultString(this._protocol,e.protocol),method:a.default.defaultString(this._method,e.method),authType:e.authType,bodyType:e.bodyType,reqBodyType:e.reqBodyType,style:e.style,credential:this._credential,signatureVersion:this._signatureVersion,signatureAlgorithm:this._signatureAlgorithm,userAgent:this.getUserAgent()});let m=new l.InterceptorContextConfiguration({regionId:this._regionId,endpoint:a.default.defaultString(t.endpointOverride,this._endpoint),endpointRule:this._endpointRule,endpointMap:this._endpointMap,endpointType:this._endpointType,network:this._network,suffix:this._suffix});let y=new l.InterceptorContext({request:h,configuration:m});let g=new l.AttributeMap({});await this._spi.modifyConfiguration(y,g);await this._spi.modifyRequest(y,g);i.protocol=y.request.protocol;i.method=y.request.method;i.pathname=y.request.pathname;i.query=y.request.query;i.body=y.request.stream;i.headers=y.request.headers;n=i;let S=await f.doAction(i,s);let T=new l.InterceptorContextResponse({statusCode:S.statusCode,headers:S.headers,body:S.body});y.response=T;await this._spi.modifyResponse(y,g);return{headers:y.response.headers,statusCode:y.response.statusCode,body:y.response.deserializedBody}}catch(e){if(f.isRetryable(e)){continue}throw e}}throw f.newUnretryableError(n)}async callApi(e,t,r){if(a.default.isUnset(e)){throw f.newError({code:"ParameterMissing",message:"'params' can not be unset"})}if(a.default.isUnset(this._signatureAlgorithm)||!a.default.equalString(this._signatureAlgorithm,"v2")){return await this.doRequest(e,t,r)}else if(a.default.equalString(e.style,"ROA")&&a.default.equalString(e.reqBodyType,"json")){return await this.doROARequest(e.action,e.version,e.protocol,e.method,e.authType,e.pathname,e.bodyType,t,r)}else if(a.default.equalString(e.style,"ROA")){return await this.doROARequestWithForm(e.action,e.version,e.protocol,e.method,e.authType,e.pathname,e.bodyType,t,r)}else{return await this.doRPCRequest(e.action,e.version,e.protocol,e.method,e.authType,e.bodyType,t,r)}}getUserAgent(){let e=a.default.getUserAgent(this._userAgent);return e}async getAccessKeyId(){if(a.default.isUnset(this._credential)){return""}let e=await this._credential.getAccessKeyId();return e}async getAccessKeySecret(){if(a.default.isUnset(this._credential)){return""}let e=await this._credential.getAccessKeySecret();return e}async getSecurityToken(){if(a.default.isUnset(this._credential)){return""}let e=await this._credential.getSecurityToken();return e}async getBearerToken(){if(a.default.isUnset(this._credential)){return""}let e=this._credential.getBearerToken();return e}async getType(){if(a.default.isUnset(this._credential)){return""}let e=this._credential.getType();return e}static defaultAny(e,t){if(a.default.isUnset(e)){return t}return e}checkConfig(e){if(a.default.empty(this._endpointRule)&&a.default.empty(e.endpoint)){throw f.newError({code:"ParameterMissing",message:"'config.endpoint' can not be empty"})}}setGatewayClient(e){this._spi=e}setRpcHeaders(e){this._headers=e}getRpcHeaders(){let e=this._headers;this._headers=null;return e}}t["default"]=Client},2868:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const a=i(r(4165));const u=o(r(1979));const c=o(r(8683));const d=o(r(3477));const l=o(r(6113));const p="-----BEGIN PRIVATE KEY-----\n";const f="\n-----END PRIVATE KEY-----";function replaceRepeatList(e,t,r){if(r){r=r+"."}for(var s=0;s<t.length;s++){var n=t[s];let i=r+(s+1);if(typeof n==="undefined"||n==null){continue}if(Array.isArray(n)){replaceRepeatList(e,n,i)}else if(n instanceof Object){flatMap(e,n,i)}else{e[i]=n.toString()}}}function flatMap(e,t,r=""){if(r){r=r+"."}t=toMap(t);let s=Object.keys(t);for(let n=0;n<s.length;n++){let i=s[n];let o=t[i];i=r+i;if(typeof o==="undefined"||o==null){continue}if(Array.isArray(o)){replaceRepeatList(e,o,i)}else if(o instanceof Object){flatMap(e,o,i)}else{e[i]=o.toString()}}return e}function filter(e){return e.replace(/[\t\n\r\f]/g," ")}function getCanonicalizedHeaders(e){const t="x-acs-";const r=Object.keys(e);const s=[];for(let e=0;e<r.length;e++){const n=r[e];if(n.startsWith(t)){s.push(n)}}s.sort();var n="";for(let t=0;t<s.length;t++){const r=s[t];n+=`${r}:${filter(e[r]).trim()}\n`}return n}function getCanonicalizedResource(e,t){const r=!t?[]:Object.keys(t).sort();if(r.length===0){return e}var s=[];for(var n=0;n<r.length;n++){const e=r[n];s.push(`${e}=${t[e]}`)}return`${e}?${s.join("&")}`}function getAuthorizationQueryString(e){let t=[];const r=!e?[]:Object.keys(e).sort();for(let s=0;s<r.length;s++){const n=r[s];let i=n+"=";if(typeof e[n]!=="undefined"&&e[n]!==null){i=i+encode(e[n])}t.push(i)}return t.join("&")}function getAuthorizationHeaders(e){let t="";let r={};const s=!e?[]:Object.keys(e);for(let t=0;t<s.length;t++){const n=s[t];const i=s[t].toLowerCase();if(i.startsWith("x-acs-")||i==="host"||i==="content-type"){if(r[i]){r[i].push((e[n]||"").trim())}else{r[i]=[(e[n]||"").trim()]}}}var n=Object.keys(r).sort();for(let e=0;e<n.length;e++){const s=n[e];let i=r[s].sort();t+=`${s}:${i.join(",")}\n`}return{canonicalheaders:t,hsKeys:n}}function encode(e){var t=encodeURIComponent(e);return t.replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function normalize(e){var t=[];var r={};flatMap(r,e);var s=Object.keys(r).sort();for(let e=0;e<s.length;e++){var n=s[e];var i=r[n];t.push([encode(n),encode(i)])}return t}function canonicalize(e){var t=[];for(var r=0;r<e.length;r++){var[s,n]=e[r];t.push(s+"="+n)}return t.join("&")}function isModelClass(e){if(!e){return false}return typeof e.types==="function"&&typeof e.names==="function"}function isObjectOrArray(e){return Array.isArray(e)||e instanceof Object&&typeof e!=="function"}function toMap(e){if(!isObjectOrArray(e)){return null}else if(e instanceof a.Model){return a.toMap(e)}else if(e&&e.toMap&&typeof e.toMap==="function"){return e.toMap()}else if(Array.isArray(e)){const t=[];e.forEach((e=>{if(isObjectOrArray(e)){t.push(toMap(e))}else{t.push(e)}}));return t}else if(e instanceof Object){const t={};Object.entries(e).forEach((([e,r])=>{if(isObjectOrArray(r)){t[e]=toMap(r)}else{t[e]=r}}));return t}}class Client{static convert(e,t){if(!t){return}let r=Object.assign({},e);let s=t.constructor;let n=s.types();for(let e of Object.keys(s.names())){if(r[e]!==null&&r[e]!==undefined){if(isModelClass(n[e])){t[e]=new n[e](t[e]);Client.convert(r[e],t[e])}else if(n[e]&&n[e].type==="array"){t[e]=r[e].map((function(t){if(isModelClass(n[e].itemType)){var r=new n[e].itemType({});Client.convert(t,r);return r}return t}))}else if(n[e]&&n[e].type==="map"){t[e]={};Object.keys(r[e]).map((function(s){if(isModelClass(n[e].valueType)){var i=new n[e].valueType({});Client.convert(r[e][s],i);t[e][s]=i}else{t[e][s]=r[e][s]}}))}else{t[e]=r[e]}}}}static getStringToSign(e){const t=e.method;const r=e.headers["accept"];const s=e.headers["content-md5"]||"";const n=e.headers["content-type"]||"";const i=e.headers["date"]||"";const o=`${t}\n${r}\n${s}\n${n}\n${i}\n`;const a=getCanonicalizedHeaders(e.headers);const u=getCanonicalizedResource(e.pathname,e.query);return`${o}${a}${u}`}static getROASignature(e,t){const r=Buffer.from(e,"utf8");return c.default.sha1(r,t,"base64")}static toForm(e){if(!e){return""}let t={};flatMap(t,e);return u.default.toFormString(t)}static getTimestamp(){let e=new Date;let t=e.getUTCFullYear();let r=c.default.pad2(e.getUTCMonth()+1);let s=c.default.pad2(e.getUTCDate());let n=c.default.pad2(e.getUTCHours());let i=c.default.pad2(e.getUTCMinutes());let o=c.default.pad2(e.getUTCSeconds());return`${t}-${r}-${s}T${n}:${i}:${o}Z`}static query(e){if(!e){return{}}let t={};flatMap(t,e);return t}static getRPCSignature(e,t,r){var s=normalize(e);var n=canonicalize(s);var i=`${t}&${encode("/")}&${encode(n)}`;const o=r+"&";return c.default.sha1(i,o,"base64")}static arrayToStringWithSpecifiedStyle(e,t,r){if(!e){return""}if(r==="repeatList"){let r={};replaceRepeatList(r,e,t);return d.default.stringify(r,"&&")}else if(r==="json"){return JSON.stringify(toMap(e))}else if(r==="simple"){return e.join(",")}else if(r==="spaceDelimited"){return e.join(" ")}else if(r==="pipeDelimited"){return e.join("|")}else{return""}}static parseToMap(e){return toMap(e)}static getEndpoint(e,t,r){if(r=="internal"){let t=e.split(".");t[0]+="-internal";e=t.join(".")}if(t&&r=="accelerate"){return"oss-accelerate.aliyuncs.com"}return e}static hexEncode(e){return e.toString("hex")}static hash(e,t){if(t==="ACS3-HMAC-SHA256"||t==="ACS3-RSA-SHA256"){const t=l.default.createHash("sha256");t.update(e);return t.digest()}else if(t=="ACS3-HMAC-SM3"){const t=l.default.createHash("sm3");t.update(e);return t.digest()}}static signatureMethod(e,t,r){if(r==="ACS3-HMAC-SHA256"){const r=l.default.createHmac("sha256",e);r.update(t);return r.digest()}else if(r==="ACS3-HMAC-SM3"){const r=l.default.createHmac("sm3",e);r.update(t);return r.digest()}else if(r==="ACS3-RSA-SHA256"){if(!e.startsWith(p)){e=p+e}if(!e.endsWith(f)){e=e+f}var s=l.default.createSign("RSA-SHA256");s.update(t);var n=s.sign({key:e,padding:l.default.constants.RSA_PKCS1_PADDING});return n}}static getAuthorization(e,t,r,s,n){const i=(e.pathname||"").replace("+","%20").replace("*","%2A").replace("%7E","~");const o=e.method;const a=getAuthorizationQueryString(e.query);const u=getAuthorizationHeaders(e.headers);const c=u["canonicalheaders"];const d=u["hsKeys"];const l=o+"\n"+i+"\n"+a+"\n"+c+"\n"+d.join(";")+"\n"+r;let p=Buffer.from(l);const f=t+"\n"+Client.hexEncode(Client.hash(p,t));const h=Client.hexEncode(Client.signatureMethod(n,f,t));const m=`${t} Credential=${s},SignedHeaders=${d.join(";")},Signature=${h}`;return m}static getEncodePath(e){if(typeof e==="undefined"||e===null){return""}let t=e.split("/");for(let e=0;e<t.length;e++){t[e]=encode(t[e])}return t.join("/")}static getEncodeParam(e){if(typeof e==="undefined"||e===null){return""}return encode(e)}}t["default"]=Client},8190:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const a=i(r(4165));const u=o(r(1979));const c=o(r(8683));const d=o(r(3477));const l=o(r(6113));const p="-----BEGIN PRIVATE KEY-----\n";const f="\n-----END PRIVATE KEY-----";function replaceRepeatList(e,t,r){if(r){r=r+"."}for(var s=0;s<t.length;s++){var n=t[s];let i=r+(s+1);if(typeof n==="undefined"||n==null){continue}if(Array.isArray(n)){replaceRepeatList(e,n,i)}else if(n instanceof Object){flatMap(e,n,i)}else{e[i]=n.toString()}}}function flatMap(e,t,r=""){if(r){r=r+"."}t=toMap(t);let s=Object.keys(t);for(let n=0;n<s.length;n++){let i=s[n];let o=t[i];i=r+i;if(typeof o==="undefined"||o==null){continue}if(Array.isArray(o)){replaceRepeatList(e,o,i)}else if(o instanceof Object){flatMap(e,o,i)}else{e[i]=o.toString()}}return e}function filter(e){return e.replace(/[\t\n\r\f]/g," ")}function getCanonicalizedHeaders(e){const t="x-acs-";const r=Object.keys(e);const s=[];for(let e=0;e<r.length;e++){const n=r[e];if(n.startsWith(t)){s.push(n)}}s.sort();var n="";for(let t=0;t<s.length;t++){const r=s[t];n+=`${r}:${filter(e[r]).trim()}\n`}return n}function getCanonicalizedResource(e,t){const r=!t?[]:Object.keys(t).sort();if(r.length===0){return e}var s=[];for(var n=0;n<r.length;n++){const e=r[n];s.push(`${e}=${t[e]}`)}return`${e}?${s.join("&")}`}function getAuthorizationQueryString(e){let t=[];const r=!e?[]:Object.keys(e).sort();for(let s=0;s<r.length;s++){const n=r[s];let i=n+"=";if(typeof e[n]!=="undefined"&&e[n]!==null){i=i+encode(e[n])}t.push(i)}return t.join("&")}function getAuthorizationHeaders(e){let t="";let r={};const s=!e?[]:Object.keys(e);for(let t=0;t<s.length;t++){const n=s[t];const i=s[t].toLowerCase();if(i.startsWith("x-acs-")||i==="host"||i==="content-type"){if(r[i]){r[i].push((e[n]||"").trim())}else{r[i]=[(e[n]||"").trim()]}}}var n=Object.keys(r).sort();for(let e=0;e<n.length;e++){const s=n[e];let i=r[s].sort();t+=`${s}:${i.join(",")}\n`}return{canonicalheaders:t,hsKeys:n}}function encode(e){var t=encodeURIComponent(e);return t.replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function normalize(e){var t=[];var r={};flatMap(r,e);var s=Object.keys(r).sort();for(let e=0;e<s.length;e++){var n=s[e];var i=r[n];t.push([encode(n),encode(i)])}return t}function canonicalize(e){var t=[];for(var r=0;r<e.length;r++){var[s,n]=e[r];t.push(s+"="+n)}return t.join("&")}function isModelClass(e){if(!e){return false}return typeof e.types==="function"&&typeof e.names==="function"}function isObjectOrArray(e){return Array.isArray(e)||e instanceof Object&&typeof e!=="function"}function toMap(e){if(!isObjectOrArray(e)){return null}else if(e instanceof a.Model){return a.toMap(e)}else if(e&&e.toMap&&typeof e.toMap==="function"){return e.toMap()}else if(Array.isArray(e)){const t=[];e.forEach((e=>{if(isObjectOrArray(e)){t.push(toMap(e))}else{t.push(e)}}));return t}else if(e instanceof Object){const t={};Object.entries(e).forEach((([e,r])=>{if(isObjectOrArray(r)){t[e]=toMap(r)}else{t[e]=r}}));return t}}class Client{static convert(e,t){if(!t){return}let r=Object.assign({},e);let s=t.constructor;let n=s.types();for(let e of Object.keys(s.names())){if(r[e]){if(isModelClass(n[e])){t[e]=new n[e](t[e]);Client.convert(r[e],t[e]);continue}t[e]=r[e]}}}static getStringToSign(e){const t=e.method;const r=e.headers["accept"];const s=e.headers["content-md5"]||"";const n=e.headers["content-type"]||"";const i=e.headers["date"]||"";const o=`${t}\n${r}\n${s}\n${n}\n${i}\n`;const a=getCanonicalizedHeaders(e.headers);const u=getCanonicalizedResource(e.pathname,e.query);return`${o}${a}${u}`}static getROASignature(e,t){const r=Buffer.from(e,"utf8");return c.default.sha1(r,t,"base64")}static toForm(e){if(!e){return""}let t={};flatMap(t,e);return u.default.toFormString(t)}static getTimestamp(){let e=new Date;let t=e.getUTCFullYear();let r=c.default.pad2(e.getUTCMonth()+1);let s=c.default.pad2(e.getUTCDate());let n=c.default.pad2(e.getUTCHours());let i=c.default.pad2(e.getUTCMinutes());let o=c.default.pad2(e.getUTCSeconds());return`${t}-${r}-${s}T${n}:${i}:${o}Z`}static query(e){if(!e){return{}}let t={};flatMap(t,e);return t}static getRPCSignature(e,t,r){var s=normalize(e);var n=canonicalize(s);var i=`${t}&${encode("/")}&${encode(n)}`;const o=r+"&";return c.default.sha1(i,o,"base64")}static arrayToStringWithSpecifiedStyle(e,t,r){if(!e){return""}if(r==="repeatList"){let r={};replaceRepeatList(r,e,t);return d.default.stringify(r,"&&")}else if(r==="json"){return JSON.stringify(e)}else if(r==="simple"){return e.join(",")}else if(r==="spaceDelimited"){return e.join(" ")}else if(r==="pipeDelimited"){return e.join("|")}else{return""}}static parseToMap(e){return toMap(e)}static getEndpoint(e,t,r){if(r=="internal"){let t=e.split(".");t[0]+="-internal";e=t.join(".")}if(t&&r=="accelerate"){return"oss-accelerate.aliyuncs.com"}return e}static hexEncode(e){return e.toString("hex")}static hash(e,t){if(t==="ACS3-HMAC-SHA256"||t==="ACS3-RSA-SHA256"){const t=l.default.createHash("sha256");t.update(e);return t.digest()}else if(t=="ACS3-HMAC-SM3"){const t=l.default.createHash("sm3");t.update(e);return t.digest()}}static signatureMethod(e,t,r){if(r==="ACS3-HMAC-SHA256"){const r=l.default.createHmac("sha256",e);r.update(t);return r.digest()}else if(r==="ACS3-HMAC-SM3"){const r=l.default.createHmac("sm3",e);r.update(t);return r.digest()}else if(r==="ACS3-RSA-SHA256"){if(!e.startsWith(p)){e=p+e}if(!e.endsWith(f)){e=e+f}var s=l.default.createSign("RSA-SHA256");s.update(t);var n=s.sign({key:e,padding:l.default.constants.RSA_PKCS1_PADDING});return n}}static getAuthorization(e,t,r,s,n){const i=(e.pathname||"").replace("+","%20").replace("*","%2A").replace("%7E","~");const o=e.method;const a=getAuthorizationQueryString(e.query);const u=getAuthorizationHeaders(e.headers);const c=u["canonicalheaders"];const d=u["hsKeys"];const l=o+"\n"+i+"\n"+a+"\n"+c+"\n"+d.join(";")+"\n"+r;let p=Buffer.from(l);const f=t+"\n"+Client.hexEncode(Client.hash(p,t));const h=Client.hexEncode(Client.signatureMethod(n,f,t));const m=`${t} Credential=${s},SignedHeaders=${d.join(";")},Signature=${h}`;return m}static getEncodePath(e){if(typeof e==="undefined"||e===null){return""}let t=e.split("/");for(let e=0;e<t.length;e++){t[e]=encode(t[e])}return t.join("/")}static getEncodeParam(e){if(typeof e==="undefined"||e===null){return""}return encode(e)}}t["default"]=Client},4165:function(e,t,r){"use strict";var s=this&&this.__extends||function(){var extendStatics=function(e,t){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(t.hasOwnProperty(r))e[r]=t[r]};return extendStatics(e,t)};return function(e,t){extendStatics(e,t);function __(){this.constructor=e}e.prototype=t===null?Object.create(t):(__.prototype=t.prototype,new __)}}();var n=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};var a=this&&this.__awaiter||function(e,t,r,s){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(s.next(e))}catch(e){n(e)}}function rejected(e){try{step(s["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((s=s.apply(e,t||[])).next())}))};var u=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},s,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(o){if(s)throw new TypeError("Generator is already executing.");while(r)try{if(s=1,n&&(i=o[0]&2?n["return"]:o[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;if(n=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;n=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){r.label=o[1];break}if(o[0]===6&&r.label<i[1]){r.label=i[1];i=o;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(o);break}if(i[2])r.ops.pop();r.trys.pop();continue}o=t.call(e,r)}catch(e){o=[6,e];n=0}finally{s=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};Object.defineProperty(t,"__esModule",{value:true});t.isRetryable=t.retryError=t.newUnretryableError=t.getBackoffTime=t.allowRetry=t.sleep=t.cast=t.Model=t.toMap=t.newError=t.doAction=t.Response=t.Request=t.BytesReadable=void 0;var c=o(r(3477));var d=r(3685);var l=r(5687);var p=r(2781);var f=o(r(9074));var h=r(7310);var m=function(e){s(BytesReadable,e);function BytesReadable(t){var r=e.call(this)||this;if(typeof t==="string"){r.value=Buffer.from(t)}else if(Buffer.isBuffer(t)){r.value=t}return r}BytesReadable.prototype._read=function(){this.push(this.value);this.push(null)};return BytesReadable}(p.Readable);t.BytesReadable=m;var y=function(){function Request(){this.headers={};this.query={}}return Request}();t.Request=y;var g=function(){function Response(e){this.statusCode=e.statusCode;this.statusMessage=e.statusMessage;this.headers=this.convertHeaders(e.headers);this.body=e}Response.prototype.convertHeaders=function(e){var t={};var r=Object.keys(e);for(var s=0;s<r.length;s++){var n=r[s];t[n]=e[n]}return t};Response.prototype.readBytes=function(){return a(this,void 0,void 0,(function(){var e;return u(this,(function(t){switch(t.label){case 0:return[4,f.read(this.body,"")];case 1:e=t.sent();return[2,e]}}))}))};return Response}();t.Response=g;function buildURL(e){var t=e.protocol+"://"+e.headers["host"];if(e.port){t+=":"+e.port}t+=""+e.pathname;var r=h.parse(t);if(e.query&&Object.keys(e.query).length>0){if(r.query){t+="&"+c.stringify(e.query)}else{t+="?"+c.stringify(e.query)}}return t}function isModelClass(e){if(!e){return false}return typeof e.types==="function"&&typeof e.names==="function"}function doAction(e,t){if(t===void 0){t=null}return a(this,void 0,void 0,(function(){var r,s,n,i,o;return u(this,(function(a){switch(a.label){case 0:r=buildURL(e);s=(e.method||"GET").toUpperCase();n={method:s,headers:e.headers};if(s!=="GET"&&s!=="HEAD"){n.data=e.body}if(t){if(typeof t.timeout!=="undefined"){n.timeout=Number(t.timeout)}if(typeof t.readTimeout!=="undefined"){n.readTimeout=Number(t.readTimeout)}if(typeof t.connectTimeout!=="undefined"){n.connectTimeout=Number(t.connectTimeout)}if(typeof t.ignoreSSL!=="undefined"){n.rejectUnauthorized=!t.ignoreSSL}if(typeof t.key!=="undefined"){n.key=String(t.key)}if(typeof t.cert!=="undefined"){n.cert=String(t.cert)}if(typeof t.ca!=="undefined"){n.ca=String(t.ca)}i={keepAlive:true};if(typeof t.keepAlive!=="undefined"){i.keepAlive=t.keepAlive;if(e.protocol&&e.protocol.toLowerCase()==="https"){n.agent=new l.Agent(i)}else{n.agent=new d.Agent(i)}}}return[4,f.request(r,n)];case 1:o=a.sent();return[2,new g(o)]}}))}))}t.doAction=doAction;var S=function(e){s(ResponseError,e);function ResponseError(t){var r=e.call(this,t.code+": "+t.message)||this;r.code=t.code;r.data=t.data;r.description=t.description;r.accessDeniedDetail=t.accessDeniedDetail;if(r.data&&r.data.statusCode){r.statusCode=Number(r.data.statusCode)}return r}return ResponseError}(Error);function newError(e){return new S(e)}t.newError=newError;function getValue(e,t){if(typeof e==="string"){return t}if(e.type==="array"){if(!Array.isArray(t)){throw new Error("expect: array, actual: "+typeof t)}return t.map((function(t){return getValue(e.itemType,t)}))}if(typeof e==="function"){if(isModelClass(e)){return new e(t)}return t}return t}function toMap(e){if(e===void 0){e=undefined}if(typeof e==="undefined"||e==null){return null}if(e instanceof T){return e.toMap()}if(typeof e.toMap==="function"){return e.toMap()}if(Array.isArray(e)){return e.map((function(e){return toMap(e)}))}return e}t.toMap=toMap;var T=function(){function Model(e){var t=this;if(e==null){return}var r=this.constructor;var s=r.names();var n=r.types();Object.keys(s).forEach((function(r){var s=e[r];if(s===undefined||s===null){return}var i=n[r];t[r]=getValue(i,s)}))}Model.prototype.toMap=function(){var e=this;var t={};var r=this.constructor;var s=r.names();Object.keys(s).forEach((function(r){var n=s[r];var i=e[r];if(typeof i==="undefined"||i==null){return}t[n]=toMap(i)}));return t};return Model}();t.Model=T;function cast(e,t){if(!e){throw new Error("can not cast to Map")}if(typeof e!=="object"){throw new Error("can not cast to Map")}var r=e;var s=t.constructor;var n=s.names();var i=s.types();Object.keys(n).forEach((function(e){var s=n[e];var o=r[s];var a=i[e];if(typeof o==="undefined"||o==null){return}if(typeof a==="string"){if(a==="Readable"||a==="map"||a==="Buffer"||a==="any"||typeof o===a){t[e]=o;return}if(a==="string"&&(typeof o==="number"||typeof o==="boolean")){t[e]=o.toString();return}if(a==="boolean"){if(o===1||o===0){t[e]=!!o;return}if(o==="true"||o==="false"){t[e]=o==="true";return}}if(a==="number"&&typeof o==="string"){if(o.match(/^\d*$/)){t[e]=parseInt(o);return}if(o.match(/^[\.\d]*$/)){t[e]=parseFloat(o);return}}throw new Error("type of "+e+" is mismatch, expect "+a+", but "+typeof o)}else if(a.type==="map"){if(!(o instanceof Object)){throw new Error("type of "+e+" is mismatch, expect object, but "+typeof o)}t[e]=o}else if(a.type==="array"){if(!Array.isArray(o)){throw new Error("type of "+e+" is mismatch, expect array, but "+typeof o)}if(typeof a.itemType==="function"){t[e]=o.map((function(e){if(isModelClass(a.itemType)){return cast(e,new a.itemType({}))}return e}))}else{t[e]=o}}else if(typeof a==="function"){if(!(o instanceof Object)){throw new Error("type of "+e+" is mismatch, expect object, but "+typeof o)}if(isModelClass(a)){t[e]=cast(o,new a({}));return}t[e]=o}else{}}));return t}t.cast=cast;function sleep(e){return new Promise((function(t){setTimeout(t,e)}))}t.sleep=sleep;function allowRetry(e,t,r){if(t===0){return true}if(e.retryable!==true){return false}if(e.policy==="never"){return false}if(e.policy==="always"){return true}if(e.policy==="simple"){return t<e["maxAttempts"]}if(e.policy==="timeout"){return Date.now()-r<e.timeout}if(e.maxAttempts&&typeof e.maxAttempts==="number"){return e.maxAttempts>=t}return false}t.allowRetry=allowRetry;function getBackoffTime(e,t){if(t===0){return 0}if(e.policy==="no"){return 0}if(e.policy==="fixed"){return e.period}if(e.policy==="random"){var r=e["minPeriod"];var s=e["maxPeriod"];return r+(s-r)*Math.random()}if(e.policy==="exponential"){var n=e.initial;var i=e.multiplier;var o=n*Math.pow(1+i,t-1);var s=e.max;return Math.min(o,s)}if(e.policy==="exponential_random"){var n=e.initial;var i=e.multiplier;var o=n*Math.pow(1+i,t-1);var s=e.max;return Math.min(o*(.5+Math.random()),s)}return 0}t.getBackoffTime=getBackoffTime;var w=function(e){s(UnretryableError,e);function UnretryableError(t){var r=e.call(this,t)||this;r.name="UnretryableError";return r}return UnretryableError}(Error);function newUnretryableError(e){var t=new w("");t.data={lastRequest:e};return t}t.newUnretryableError=newUnretryableError;var b=function(e){s(RetryError,e);function RetryError(t){var r=e.call(this,t)||this;r.name="RetryError";return r}return RetryError}(Error);function retryError(e,t){var r=new b("");r.data={request:e,response:t};return r}t.retryError=retryError;function isRetryable(e){if(typeof e==="undefined"||e===null){return false}return e.name==="RetryError"}t.isRetryable=isRetryable},1979:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.RuntimeOptions=t.ExtendsParameters=void 0;const a=r(2781);const u=i(r(4165));const c=i(r(8683));const d=o(r(3477));const l=r(2037);const p=`AlibabaCloud (${l.platform()}; ${l.arch()}) Node.js/${process.version} Core/1.0.1 TeaDSL/1`;class ExtendsParameters extends u.Model{constructor(e){super(e)}static names(){return{headers:"headers",queries:"queries"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},queries:{type:"map",keyType:"string",valueType:"string"}}}}t.ExtendsParameters=ExtendsParameters;class RuntimeOptions extends u.Model{constructor(e){super(e)}static names(){return{autoretry:"autoretry",ignoreSSL:"ignoreSSL",key:"key",cert:"cert",ca:"ca",maxAttempts:"max_attempts",backoffPolicy:"backoff_policy",backoffPeriod:"backoff_period",readTimeout:"readTimeout",connectTimeout:"connectTimeout",httpProxy:"httpProxy",httpsProxy:"httpsProxy",noProxy:"noProxy",maxIdleConns:"maxIdleConns",keepAlive:"keepAlive",extendsParameters:"extendsParameters"}}static types(){return{autoretry:"boolean",ignoreSSL:"boolean",key:"string",cert:"string",ca:"string",maxAttempts:"number",backoffPolicy:"string",backoffPeriod:"number",readTimeout:"number",connectTimeout:"number",httpProxy:"string",httpsProxy:"string",noProxy:"string",maxIdleConns:"number",keepAlive:"boolean",extendsParameters:ExtendsParameters}}}t.RuntimeOptions=RuntimeOptions;function read(e){return new Promise(((t,r)=>{let s,n,i;var cleanup=function(){e.removeListener("error",n);e.removeListener("data",s);e.removeListener("end",i)};var o=[];var a=0;s=function(e){o.push(e);a+=e.length};n=function(e){cleanup();r(e)};i=function(){cleanup();t(Buffer.concat(o,a))};e.on("error",n);e.on("data",s);e.on("end",i)}))}class Client{static toString(e){return e.toString()}static parseJSON(e){return JSON.parse(e)}static async readAsBytes(e){return await read(e)}static async readAsString(e){let t=await Client.readAsBytes(e);return Client.toString(t)}static async readAsJSON(e){return Client.parseJSON(await Client.readAsString(e))}static getNonce(){return c.makeNonce()}static getDateUTCString(){const e=new Date;return e.toUTCString()}static defaultString(e,t){return e||t}static defaultNumber(e,t){return e||t}static toFormString(e){return d.default.stringify(e)}static toJSONString(e){if(typeof e==="string"){return e}return JSON.stringify(e)}static toBytes(e){return Buffer.from(e)}static empty(e){return!e}static equalString(e,t){return e===t}static equalNumber(e,t){return e===t}static isUnset(e){if(typeof e==="undefined"){return true}if(e===null){return true}return false}static stringifyMapValue(e){if(!e){return e}const t={};for(const[r,s]of Object.entries(e)){if(typeof s==="undefined"||s===null){continue}t[r]=String(s)}return t}static anyifyMapValue(e){return e}static assertAsBoolean(e){if(typeof e==="boolean"){return e}throw new Error(`The value is not a boolean`)}static assertAsString(e){if(typeof e==="string"){return e}throw new Error(`The value is not a string`)}static assertAsNumber(e){if(typeof e==="number"){return e}throw new Error(`The value is not a number`)}static assertAsInteger(e){if(Number.isInteger(e)){return e}throw new Error(`The value is not a int number`)}static assertAsMap(e){if(e&&typeof e==="object"&&!Array.isArray(e)){return e}throw new Error(`The value is not a object`)}static assertAsArray(e){if(Array.isArray(e)){return e}throw new Error(`The value is not array`)}static assertAsBytes(e){if(Buffer.isBuffer(e)){return e}throw new Error(`The value is not bytes`)}static getUserAgent(e){if(!e||!e.length){return p}return p+" "+e}static is2xx(e){return e>=200&&e<300}static is3xx(e){return e>=300&&e<400}static is4xx(e){return e>=400&&e<500}static is5xx(e){return e>=500&&e<600}static validateModel(e){}static toMap(e){return u.toMap(e)}static async sleep(e){return new Promise((t=>{setTimeout((()=>{t()}),e)}))}static toArray(e){if(!(e instanceof Array)){return null}let t=[];e.forEach((e=>{if(!e){return}t.push(u.toMap(e))}));return t}static assertAsReadable(e){if(e instanceof a.Readable){return e}throw new Error(`The value is not a readable`)}}t["default"]=Client},5757:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(6189);class Client{static parseXml(e,t){let r=this._parseXML(e);if(t!==null&&typeof t!=="undefined"){r=this._xmlCast(r,t)}return r}static toXML(e){const t=new s.Builder;return t.buildObject(e)}static _parseXML(e){let t=new s.Parser({explicitArray:false});let r={};t.parseString(e,(function(e,t){r.err=e;r.output=t}));if(r.err){throw r.err}return r.output}static _xmlCast(e,t){e=e||{};let r={};let s=t;let n=s.names();let i=s.types();Object.keys(n).forEach((t=>{let s=n[t];let o=e[s];let a=i[t];switch(a){case"boolean":if(!o){r[s]=false;return}r[s]=o==="false"?false:true;return;case"number":if(o!=0&&!o){r[s]=NaN;return}r[s]=+o;return;case"string":if(!o){r[s]="";return}r[s]=o.toString();return;default:if(a.type==="array"){if(!o){r[s]=[];return}if(!Array.isArray(o)){o=[o]}if(typeof a.itemType==="function"){r[s]=o.map((e=>this._xmlCast(e,a.itemType)))}else{r[s]=o}}else if(typeof a==="function"){if(!o){o={}}r[s]=this._xmlCast(o,a)}else{r[s]=o}}}));return r}}t["default"]=Client},4697:function(e){var t=1e3;var r=t*60;var s=r*60;var n=s*24;var i=n*7;var o=n*365.25;e.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0){return parse(e)}else if(r==="number"&&isFinite(e)){return t.long?fmtLong(e):fmtShort(e)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function parse(e){e=String(e);if(e.length>100){return}var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a){return}var u=parseFloat(a[1]);var c=(a[2]||"ms").toLowerCase();switch(c){case"years":case"year":case"yrs":case"yr":case"y":return u*o;case"weeks":case"week":case"w":return u*i;case"days":case"day":case"d":return u*n;case"hours":case"hour":case"hrs":case"hr":case"h":return u*s;case"minutes":case"minute":case"mins":case"min":case"m":return u*r;case"seconds":case"second":case"secs":case"sec":case"s":return u*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return undefined}}function fmtShort(e){var i=Math.abs(e);if(i>=n){return Math.round(e/n)+"d"}if(i>=s){return Math.round(e/s)+"h"}if(i>=r){return Math.round(e/r)+"m"}if(i>=t){return Math.round(e/t)+"s"}return e+"ms"}function fmtLong(e){var i=Math.abs(e);if(i>=n){return plural(e,i,n,"day")}if(i>=s){return plural(e,i,s,"hour")}if(i>=r){return plural(e,i,r,"minute")}if(i>=t){return plural(e,i,t,"second")}return e+" ms"}function plural(e,t,r,s){var n=t>=r*1.5;return Math.round(e/r)+" "+s+(n?"s":"")}},8222:function(e,t,r){t.formatArgs=formatArgs;t.save=save;t.load=load;t.useColors=useColors;t.storage=localstorage();t.destroy=(()=>{let e=false;return()=>{if(!e){e=true;console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}}})();t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function useColors(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)){return true}if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)){return false}let e;return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function formatArgs(t){t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff);if(!this.useColors){return}const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let s=0;let n=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{if(e==="%%"){return}s++;if(e==="%c"){n=s}}));t.splice(n,0,r)}t.log=console.debug||console.log||(()=>{});function save(e){try{if(e){t.storage.setItem("debug",e)}else{t.storage.removeItem("debug")}}catch(e){}}function load(){let e;try{e=t.storage.getItem("debug")}catch(e){}if(!e&&typeof process!=="undefined"&&"env"in process){e=process.env.DEBUG}return e}function localstorage(){try{return localStorage}catch(e){}}e.exports=r(6243)(t);const{formatters:s}=e.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},6243:function(e,t,r){function setup(e){createDebug.debug=createDebug;createDebug.default=createDebug;createDebug.coerce=coerce;createDebug.disable=disable;createDebug.enable=enable;createDebug.enabled=enabled;createDebug.humanize=r(4697);createDebug.destroy=destroy;Object.keys(e).forEach((t=>{createDebug[t]=e[t]}));createDebug.names=[];createDebug.skips=[];createDebug.formatters={};function selectColor(e){let t=0;for(let r=0;r<e.length;r++){t=(t<<5)-t+e.charCodeAt(r);t|=0}return createDebug.colors[Math.abs(t)%createDebug.colors.length]}createDebug.selectColor=selectColor;function createDebug(e){let t;let r=null;let s;let n;function debug(...e){if(!debug.enabled){return}const r=debug;const s=Number(new Date);const n=s-(t||s);r.diff=n;r.prev=t;r.curr=s;t=s;e[0]=createDebug.coerce(e[0]);if(typeof e[0]!=="string"){e.unshift("%O")}let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((t,s)=>{if(t==="%%"){return"%"}i++;const n=createDebug.formatters[s];if(typeof n==="function"){const s=e[i];t=n.call(r,s);e.splice(i,1);i--}return t}));createDebug.formatArgs.call(r,e);const o=r.log||createDebug.log;o.apply(r,e)}debug.namespace=e;debug.useColors=createDebug.useColors();debug.color=createDebug.selectColor(e);debug.extend=extend;debug.destroy=createDebug.destroy;Object.defineProperty(debug,"enabled",{enumerable:true,configurable:false,get:()=>{if(r!==null){return r}if(s!==createDebug.namespaces){s=createDebug.namespaces;n=createDebug.enabled(e)}return n},set:e=>{r=e}});if(typeof createDebug.init==="function"){createDebug.init(debug)}return debug}function extend(e,t){const r=createDebug(this.namespace+(typeof t==="undefined"?":":t)+e);r.log=this.log;return r}function enable(e){createDebug.save(e);createDebug.namespaces=e;createDebug.names=[];createDebug.skips=[];let t;const r=(typeof e==="string"?e:"").split(/[\s,]+/);const s=r.length;for(t=0;t<s;t++){if(!r[t]){continue}e=r[t].replace(/\*/g,".*?");if(e[0]==="-"){createDebug.skips.push(new RegExp("^"+e.slice(1)+"$"))}else{createDebug.names.push(new RegExp("^"+e+"$"))}}}function disable(){const e=[...createDebug.names.map(toNamespace),...createDebug.skips.map(toNamespace).map((e=>"-"+e))].join(",");createDebug.enable("");return e}function enabled(e){if(e[e.length-1]==="*"){return true}let t;let r;for(t=0,r=createDebug.skips.length;t<r;t++){if(createDebug.skips[t].test(e)){return false}}for(t=0,r=createDebug.names.length;t<r;t++){if(createDebug.names[t].test(e)){return true}}return false}function toNamespace(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}function coerce(e){if(e instanceof Error){return e.stack||e.message}return e}function destroy(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}createDebug.enable(createDebug.load());return createDebug}e.exports=setup},8237:function(e,t,r){if(typeof process==="undefined"||process.type==="renderer"||process.browser===true||process.__nwjs){e.exports=r(8222)}else{e.exports=r(5332)}},5332:function(e,t,r){const s=r(6224);const n=r(3837);t.init=init;t.log=log;t.formatArgs=formatArgs;t.save=save;t.load=load;t.useColors=useColors;t.destroy=n.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");t.colors=[6,2,3,4,5,1];try{const e=r(9318);if(e&&(e.stderr||e).level>=2){t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const r=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let s=process.env[t];if(/^(yes|on|true|enabled)$/i.test(s)){s=true}else if(/^(no|off|false|disabled)$/i.test(s)){s=false}else if(s==="null"){s=null}else{s=Number(s)}e[r]=s;return e}),{});function useColors(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):s.isatty(process.stderr.fd)}function formatArgs(t){const{namespace:r,useColors:s}=this;if(s){const s=this.color;const n="[3"+(s<8?s:"8;5;"+s);const i=` ${n};1m${r} `;t[0]=i+t[0].split("\n").join("\n"+i);t.push(n+"m+"+e.exports.humanize(this.diff)+"")}else{t[0]=getDate()+r+" "+t[0]}}function getDate(){if(t.inspectOpts.hideDate){return""}return(new Date).toISOString()+" "}function log(...e){return process.stderr.write(n.formatWithOptions(t.inspectOpts,...e)+"\n")}function save(e){if(e){process.env.DEBUG=e}else{delete process.env.DEBUG}}function load(){return process.env.DEBUG}function init(e){e.inspectOpts={};const r=Object.keys(t.inspectOpts);for(let s=0;s<r.length;s++){e.inspectOpts[r[s]]=t.inspectOpts[r[s]]}}e.exports=r(6243)(t);const{formatters:i}=e.exports;i.o=function(e){this.inspectOpts.colors=this.useColors;return n.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")};i.O=function(e){this.inspectOpts.colors=this.useColors;return n.inspect(e,this.inspectOpts)}},1621:function(e){"use strict";e.exports=(e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":e.length===1?"-":"--";const s=t.indexOf(r+e);const n=t.indexOf("--");return s!==-1&&(n===-1?true:s<n)}},9074:function(e,t,r){"use strict";const s=r(9796);const n=r(3685);const i=r(5687);const o=r(7310).parse;const a=r(7310).format;const u=r(8237)("httpx:body");const c=r(8237)("httpx:header");const d=new n.Agent({keepAlive:true});const l=new i.Agent({keepAlive:true});const p=3e3;const f=Symbol("TIMER::READ_TIMER");const h=Symbol("TIMER::READ_TIME_OUT");const m=Symbol("TIMER::READ_TIMER_START_AT");function decompress(e){switch(e.headers["content-encoding"]){case"gzip":return e.pipe(s.createGunzip());case"deflate":return e.pipe(s.createInflate());default:return e}}var append=function(e,t,r){e.name=t+e.name;e.message=`${r}. ${e.message}`;return e};const isNumber=function(e){return e!==null&&!isNaN(e)};t.request=function(e,t){t||(t={});const r=typeof e==="string"?o(e):e;let s,y;if(isNumber(t.readTimeout)||isNumber(t.connectTimeout)){s=isNumber(t.readTimeout)?Number(t.readTimeout):p;y=isNumber(t.connectTimeout)?Number(t.connectTimeout):p}else if(isNumber(t.timeout)){s=y=Number(t.timeout)}else{s=y=p}const g=r.protocol==="https:";const S=(t.method||"GET").toUpperCase();const T=g?l:d;const w=t.agent||T;var b={host:r.hostname||"localhost",path:r.path||"/",method:S,port:r.port||(r.protocol==="https:"?443:80),agent:w,headers:t.headers||{},key:t.key||"",cert:t.cert||"",ca:t.ca||"",timeout:y};if(g&&typeof t.rejectUnauthorized!=="undefined"){b.rejectUnauthorized=t.rejectUnauthorized}if(t.compression){b.headers["accept-encoding"]="gzip,deflate"}const C=g?i:n;if(typeof t.beforeRequest==="function"){b=t.beforeRequest(b)}return new Promise(((e,n)=>{const i=C.request(b);const o=t.data;var fulfilled=t=>{if(c.enabled){const e=t.req._header;e.split("\r\n").forEach((e=>{c("> %s",e)}));c("< HTTP/%s %s %s",t.httpVersion,t.statusCode,t.statusMessage);Object.keys(t.headers).forEach((e=>{c("< %s: %s",e,t.headers[e])}))}e(t)};var rejected=e=>{e.message+=`${S} ${a(r)} failed.`;if(i.socket&&i.socket[f]){clearTimeout(i.socket[f])}n(e)};var abort=e=>{i.abort();rejected(e)};const startResponseTimer=function(e){const t=setTimeout((()=>{if(e[f]){clearTimeout(e[f]);e[f]=null}var t=new Error;var r=`ReadTimeout(${s})`;abort(append(t,"RequestTimeout",r))}),s);e[h]=s;e[f]=t;e[m]=Date.now();t.unref()};if(!o||"string"===typeof o||o instanceof Buffer){if(u.enabled){if(!o){u("<no request body>")}else if("string"===typeof o){u(o)}else{u(`Buffer <ignored>, Buffer length: ${o.length}`)}}i.end(o)}else if("function"===typeof o.pipe){o.pipe(i);if(u.enabled){u("<request body is a stream>")}o.once("error",(e=>{abort(append(e,"HttpX","Stream occor error"))}))}i.on("response",fulfilled);i.on("error",rejected);i.once("socket",(function(e){if(e.readyState==="opening"){e.once("connect",(function(){startResponseTimer(e)}))}else{startResponseTimer(e)}}))}))};t.read=function(e,t){const r=decompress(e);return new Promise(((s,n)=>{const i=e.socket||e.client;const makeReadTimeoutError=()=>{const t=e.req;var r=new Error;r.name="RequestTimeoutError";r.message=`ReadTimeout: ${i[h]}. ${t.method} ${t.path} failed.`;return r};let o;const a=i[f];if(!a){n(makeReadTimeoutError());return}const c=i[h]-(Date.now()-i[m]);clearTimeout(a);if(c<=0){n(makeReadTimeoutError());return}o=setTimeout((function(){n(makeReadTimeoutError())}),c);var d,l,p;var cleanup=function(){r.removeListener("error",d);r.removeListener("data",l);r.removeListener("end",p);if(o){clearTimeout(o)}};const y=[];var g=0;l=function(e){y.push(e);g+=e.length};d=function(e){cleanup();n(e)};p=function(){cleanup();var e=Buffer.concat(y,g);u("");if(t){const r=e.toString(t);u(r);return s(r)}if(u.enabled){u(e.toString())}s(e)};r.on("error",d);r.on("data",l);r.on("end",p)}))};function readyToRead(e){return new Promise(((t,r)=>{var s,n,i;var cleanup=function(){e.removeListener("error",i);e.removeListener("end",n);e.removeListener("readable",s)};s=function(){cleanup();t(false)};n=function(){cleanup();t(true)};i=function(e){cleanup();r(e)};e.once("readable",s);e.once("end",n);e.once("error",i)}))}class Event{constructor(e,t,r,s){this.id=e;this.event=t;this.data=r;this.retry=s}}t.Event=Event;const y="data: ";const g="event: ";const S="id: ";const T="retry: ";function tryGetEvents(e,t){const r=e+t;let s=0;const n=[];for(let e=0;e<r.length-1;e++){const t=r[e];const i=r[e+1];if(t==="\n"&&i==="\n"){const t=r.substring(s,e);const i=t.split("\n");const o=new Event;i.forEach((e=>{if(e.startsWith(y)){o.data=e.substring(y.length)}else if(e.startsWith(g)){o.event=e.substring(g.length)}else if(e.startsWith(S)){o.id=e.substring(S.length)}else if(e.startsWith(T)){o.retry=e.substring(T.length)}}));n.push(o);s=e+2}}const i=r.substring(s);return[n,i]}t.readAsSSE=async function*(e){const t=decompress(e);const r=e.socket||e.client;clearTimeout(r[f]);let s="";while(true){const e=await readyToRead(t);if(e){return}let r;while(null!==(r=t.read())){const[e,t]=tryGetEvents(s,r.toString());s=t;if(e&&e.length>0){for(const t of e){yield t}}}}}},8885:function(e,t){t.parse=t.decode=decode;t.stringify=t.encode=encode;t.safe=safe;t.unsafe=unsafe;var r=typeof process!=="undefined"&&process.platform==="win32"?"\r\n":"\n";function encode(e,t){var s=[];var n="";if(typeof t==="string"){t={section:t,whitespace:false}}else{t=t||{};t.whitespace=t.whitespace===true}var i=t.whitespace?" = ":"=";Object.keys(e).forEach((function(t,o,a){var u=e[t];if(u&&Array.isArray(u)){u.forEach((function(e){n+=safe(t+"[]")+i+safe(e)+"\n"}))}else if(u&&typeof u==="object")s.push(t);else n+=safe(t)+i+safe(u)+r}));if(t.section&&n.length)n="["+safe(t.section)+"]"+r+n;s.forEach((function(s,i,o){var a=dotSplit(s).join("\\.");var u=(t.section?t.section+".":"")+a;var c=encode(e[s],{section:u,whitespace:t.whitespace});if(n.length&&c.length)n+=r;n+=c}));return n}function dotSplit(e){return e.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map((function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")}))}function decode(e){var t={};var r=t;var s=null;var n=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;var i=e.split(/[\r\n]+/g);i.forEach((function(e,i,o){if(!e||e.match(/^\s*[;#]/))return;var a=e.match(n);if(!a)return;if(a[1]!==undefined){s=unsafe(a[1]);if(s==="__proto__"){r={};return}r=t[s]=t[s]||{};return}var u=unsafe(a[2]);if(u==="__proto__")return;var c=a[3]?unsafe(a[4]):true;switch(c){case"true":case"false":case"null":c=JSON.parse(c)}if(u.length>2&&u.slice(-2)==="[]"){u=u.substring(0,u.length-2);if(u==="__proto__")return;if(!r[u])r[u]=[];else if(!Array.isArray(r[u]))r[u]=[r[u]]}if(Array.isArray(r[u]))r[u].push(c);else r[u]=c}));Object.keys(t).filter((function(e,r,s){if(!t[e]||typeof t[e]!=="object"||Array.isArray(t[e]))return false;var n=dotSplit(e);var i=t;var o=n.pop();var a=o.replace(/\\\./g,".");n.forEach((function(e,t,r){if(e==="__proto__")return;if(!i[e]||typeof i[e]!=="object")i[e]={};i=i[e]}));if(i===t&&a===o)return false;i[a]=t[e];return true})).forEach((function(e,r,s){delete t[e]}));return t}function isQuoted(e){return e.charAt(0)==='"'&&e.slice(-1)==='"'||e.charAt(0)==="'"&&e.slice(-1)==="'"}function safe(e){return typeof e!=="string"||e.match(/[=\r\n]/)||e.match(/^\[/)||e.length>1&&isQuoted(e)||e!==e.trim()?JSON.stringify(e):e.replace(/;/g,"\\;").replace(/#/g,"\\#")}function unsafe(e,t){e=(e||"").trim();if(isQuoted(e)){if(e.charAt(0)==="'")e=e.substr(1,e.length-2);try{e=JSON.parse(e)}catch(e){}}else{var r=false;var s="";for(var n=0,i=e.length;n<i;n++){var o=e.charAt(n);if(r){if("\\;#".indexOf(o)!==-1)s+=o;else s+="\\"+o;r=false}else if(";#".indexOf(o)!==-1)break;else if(o==="\\")r=true;else s+=o}if(r)s+="\\";return s.trim()}return e}},8683:function(e,t,r){"use strict";const s=r(7147);const n=r(2037);const i=r(6113);t.loadJSONSync=function(e){var t=s.readFileSync(e,"utf8");if(t.charCodeAt(0)===65279){t=t.slice(1)}try{return JSON.parse(t)}catch(t){t.message=e+": "+t.message;throw t}};t.encode=function(e,t){if(typeof e!=="string"){e=""+e}return Buffer.from(e,t)};t.makeHasher=function(e){return function(t,r){var s=i.createHash(e);s.update(t);return s.digest(r)}};t.createHash=t.makeHasher;t.md5=t.makeHasher("md5");t.createHmac=function(e){return function(t,r,s){return i.createHmac(e,r).update(t).digest(s)}};t.sha1=t.createHmac("sha1");t.random=function(e,t){return Math.floor(e+Math.random()*(t-e))};t.makeNonce=function(){var e=0;var r;const s=n.hostname();const i=process.pid;return function(){var n=Math.floor(Math.random()*1e12);if(n===r){e++}else{e=0}r=n;var o=`${s}${i}${n}${e}`;return t.md5(o,"hex")}}();t.pad2=function(e){if(e<10){return"0"+e}return""+e};t.pad3=function(e){if(e<10){return"00"+e}else if(e<100){return"0"+e}return""+e};t.getYYYYMMDD=function(e){var r=e.getFullYear();var s=t.pad2(e.getMonth()+1);var n=t.pad2(e.getDate());return""+r+s+n};t.sleep=function(e){return new Promise((t=>{setTimeout(t,e)}))};t.getIPv4=function(){var e=n.networkInterfaces();var t=Object.keys(e);for(var r=0;r<t.length;r++){var s=t[r];var i=e[s];for(var o=0;o<i.length;o++){var a=i[o];if(!a.internal&&a.family==="IPv4"){return a.address}}}return""};t.getMac=function(){var e=n.networkInterfaces();var t=Object.keys(e);for(var r=0;r<t.length;r++){var s=t[r];var i=e[s];for(var o=0;o<i.length;o++){var a=i[o];if(!a.internal&&a.family==="IPv4"){return a.mac}}}return"00:00:00:00:00:00"};t.readAll=function(e){return new Promise(((t,r)=>{var s,n,i;var cleanup=function(t){e.removeListener("error",s);e.removeListener("data",n);e.removeListener("end",i)};var o=[];var a=0;n=function(e){o.push(e);a+=e.length};s=function(e){cleanup();r(e)};i=function(){cleanup();t(Buffer.concat(o,a))};e.on("error",s);e.on("data",n);e.on("end",i)}))}},2043:function(e,t,r){(function(e){e.parser=function(e,t){return new SAXParser(e,t)};e.SAXParser=SAXParser;e.SAXStream=SAXStream;e.createStream=createStream;e.MAX_BUFFER_LENGTH=64*1024;var t=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];e.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function SAXParser(t,r){if(!(this instanceof SAXParser)){return new SAXParser(t,r)}var s=this;clearBuffers(s);s.q=s.c="";s.bufferCheckPosition=e.MAX_BUFFER_LENGTH;s.opt=r||{};s.opt.lowercase=s.opt.lowercase||s.opt.lowercasetags;s.looseCase=s.opt.lowercase?"toLowerCase":"toUpperCase";s.tags=[];s.closed=s.closedRoot=s.sawRoot=false;s.tag=s.error=null;s.strict=!!t;s.noscript=!!(t||s.opt.noscript);s.state=h.BEGIN;s.strictEntities=s.opt.strictEntities;s.ENTITIES=s.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES);s.attribList=[];if(s.opt.xmlns){s.ns=Object.create(c)}s.trackPosition=s.opt.position!==false;if(s.trackPosition){s.position=s.line=s.column=0}emit(s,"onready")}if(!Object.create){Object.create=function(e){function F(){}F.prototype=e;var t=new F;return t}}if(!Object.keys){Object.keys=function(e){var t=[];for(var r in e)if(e.hasOwnProperty(r))t.push(r);return t}}function checkBufferLength(r){var s=Math.max(e.MAX_BUFFER_LENGTH,10);var n=0;for(var i=0,o=t.length;i<o;i++){var a=r[t[i]].length;if(a>s){switch(t[i]){case"textNode":closeText(r);break;case"cdata":emitNode(r,"oncdata",r.cdata);r.cdata="";break;case"script":emitNode(r,"onscript",r.script);r.script="";break;default:error(r,"Max buffer length exceeded: "+t[i])}}n=Math.max(n,a)}var u=e.MAX_BUFFER_LENGTH-n;r.bufferCheckPosition=u+r.position}function clearBuffers(e){for(var r=0,s=t.length;r<s;r++){e[t[r]]=""}}function flushBuffers(e){closeText(e);if(e.cdata!==""){emitNode(e,"oncdata",e.cdata);e.cdata=""}if(e.script!==""){emitNode(e,"onscript",e.script);e.script=""}}SAXParser.prototype={end:function(){end(this)},write:write,resume:function(){this.error=null;return this},close:function(){return this.write(null)},flush:function(){flushBuffers(this)}};var s;try{s=r(2781).Stream}catch(e){s=function(){}}if(!s)s=function(){};var n=e.EVENTS.filter((function(e){return e!=="error"&&e!=="end"}));function createStream(e,t){return new SAXStream(e,t)}function SAXStream(e,t){if(!(this instanceof SAXStream)){return new SAXStream(e,t)}s.apply(this);this._parser=new SAXParser(e,t);this.writable=true;this.readable=true;var r=this;this._parser.onend=function(){r.emit("end")};this._parser.onerror=function(e){r.emit("error",e);r._parser.error=null};this._decoder=null;n.forEach((function(e){Object.defineProperty(r,"on"+e,{get:function(){return r._parser["on"+e]},set:function(t){if(!t){r.removeAllListeners(e);r._parser["on"+e]=t;return t}r.on(e,t)},enumerable:true,configurable:false})}))}SAXStream.prototype=Object.create(s.prototype,{constructor:{value:SAXStream}});SAXStream.prototype.write=function(e){if(typeof Buffer==="function"&&typeof Buffer.isBuffer==="function"&&Buffer.isBuffer(e)){if(!this._decoder){var t=r(1576).StringDecoder;this._decoder=new t("utf8")}e=this._decoder.write(e)}this._parser.write(e.toString());this.emit("data",e);return true};SAXStream.prototype.end=function(e){if(e&&e.length){this.write(e)}this._parser.end();return true};SAXStream.prototype.on=function(e,t){var r=this;if(!r._parser["on"+e]&&n.indexOf(e)!==-1){r._parser["on"+e]=function(){var t=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e);r.emit.apply(r,t)}}return s.prototype.on.call(r,e,t)};var i="[CDATA[";var o="DOCTYPE";var a="http://www.w3.org/XML/1998/namespace";var u="http://www.w3.org/2000/xmlns/";var c={xml:a,xmlns:u};var d=/[:_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]/;var l=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;var p=/[#:_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]/;var f=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function isWhitespace(e){return e===" "||e==="\n"||e==="\r"||e==="\t"}function isQuote(e){return e==='"'||e==="'"}function isAttribEnd(e){return e===">"||isWhitespace(e)}function isMatch(e,t){return e.test(t)}function notMatch(e,t){return!isMatch(e,t)}var h=0;e.STATE={BEGIN:h++,BEGIN_WHITESPACE:h++,TEXT:h++,TEXT_ENTITY:h++,OPEN_WAKA:h++,SGML_DECL:h++,SGML_DECL_QUOTED:h++,DOCTYPE:h++,DOCTYPE_QUOTED:h++,DOCTYPE_DTD:h++,DOCTYPE_DTD_QUOTED:h++,COMMENT_STARTING:h++,COMMENT:h++,COMMENT_ENDING:h++,COMMENT_ENDED:h++,CDATA:h++,CDATA_ENDING:h++,CDATA_ENDING_2:h++,PROC_INST:h++,PROC_INST_BODY:h++,PROC_INST_ENDING:h++,OPEN_TAG:h++,OPEN_TAG_SLASH:h++,ATTRIB:h++,ATTRIB_NAME:h++,ATTRIB_NAME_SAW_WHITE:h++,ATTRIB_VALUE:h++,ATTRIB_VALUE_QUOTED:h++,ATTRIB_VALUE_CLOSED:h++,ATTRIB_VALUE_UNQUOTED:h++,ATTRIB_VALUE_ENTITY_Q:h++,ATTRIB_VALUE_ENTITY_U:h++,CLOSE_TAG:h++,CLOSE_TAG_SAW_WHITE:h++,SCRIPT:h++,SCRIPT_ENDING:h++};e.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"};e.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830};Object.keys(e.ENTITIES).forEach((function(t){var r=e.ENTITIES[t];var s=typeof r==="number"?String.fromCharCode(r):r;e.ENTITIES[t]=s}));for(var m in e.STATE){e.STATE[e.STATE[m]]=m}h=e.STATE;function emit(e,t,r){e[t]&&e[t](r)}function emitNode(e,t,r){if(e.textNode)closeText(e);emit(e,t,r)}function closeText(e){e.textNode=textopts(e.opt,e.textNode);if(e.textNode)emit(e,"ontext",e.textNode);e.textNode=""}function textopts(e,t){if(e.trim)t=t.trim();if(e.normalize)t=t.replace(/\s+/g," ");return t}function error(e,t){closeText(e);if(e.trackPosition){t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c}t=new Error(t);e.error=t;emit(e,"onerror",t);return e}function end(e){if(e.sawRoot&&!e.closedRoot)strictFail(e,"Unclosed root tag");if(e.state!==h.BEGIN&&e.state!==h.BEGIN_WHITESPACE&&e.state!==h.TEXT){error(e,"Unexpected end")}closeText(e);e.c="";e.closed=true;emit(e,"onend");SAXParser.call(e,e.strict,e.opt);return e}function strictFail(e,t){if(typeof e!=="object"||!(e instanceof SAXParser)){throw new Error("bad call to strictFail")}if(e.strict){error(e,t)}}function newTag(e){if(!e.strict)e.tagName=e.tagName[e.looseCase]();var t=e.tags[e.tags.length-1]||e;var r=e.tag={name:e.tagName,attributes:{}};if(e.opt.xmlns){r.ns=t.ns}e.attribList.length=0;emitNode(e,"onopentagstart",r)}function qname(e,t){var r=e.indexOf(":");var s=r<0?["",e]:e.split(":");var n=s[0];var i=s[1];if(t&&e==="xmlns"){n="xmlns";i=""}return{prefix:n,local:i}}function attrib(e){if(!e.strict){e.attribName=e.attribName[e.looseCase]()}if(e.attribList.indexOf(e.attribName)!==-1||e.tag.attributes.hasOwnProperty(e.attribName)){e.attribName=e.attribValue="";return}if(e.opt.xmlns){var t=qname(e.attribName,true);var r=t.prefix;var s=t.local;if(r==="xmlns"){if(s==="xml"&&e.attribValue!==a){strictFail(e,"xml: prefix must be bound to "+a+"\n"+"Actual: "+e.attribValue)}else if(s==="xmlns"&&e.attribValue!==u){strictFail(e,"xmlns: prefix must be bound to "+u+"\n"+"Actual: "+e.attribValue)}else{var n=e.tag;var i=e.tags[e.tags.length-1]||e;if(n.ns===i.ns){n.ns=Object.create(i.ns)}n.ns[s]=e.attribValue}}e.attribList.push([e.attribName,e.attribValue])}else{e.tag.attributes[e.attribName]=e.attribValue;emitNode(e,"onattribute",{name:e.attribName,value:e.attribValue})}e.attribName=e.attribValue=""}function openTag(e,t){if(e.opt.xmlns){var r=e.tag;var s=qname(e.tagName);r.prefix=s.prefix;r.local=s.local;r.uri=r.ns[s.prefix]||"";if(r.prefix&&!r.uri){strictFail(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName));r.uri=s.prefix}var n=e.tags[e.tags.length-1]||e;if(r.ns&&n.ns!==r.ns){Object.keys(r.ns).forEach((function(t){emitNode(e,"onopennamespace",{prefix:t,uri:r.ns[t]})}))}for(var i=0,o=e.attribList.length;i<o;i++){var a=e.attribList[i];var u=a[0];var c=a[1];var d=qname(u,true);var l=d.prefix;var p=d.local;var f=l===""?"":r.ns[l]||"";var m={name:u,value:c,prefix:l,local:p,uri:f};if(l&&l!=="xmlns"&&!f){strictFail(e,"Unbound namespace prefix: "+JSON.stringify(l));m.uri=l}e.tag.attributes[u]=m;emitNode(e,"onattribute",m)}e.attribList.length=0}e.tag.isSelfClosing=!!t;e.sawRoot=true;e.tags.push(e.tag);emitNode(e,"onopentag",e.tag);if(!t){if(!e.noscript&&e.tagName.toLowerCase()==="script"){e.state=h.SCRIPT}else{e.state=h.TEXT}e.tag=null;e.tagName=""}e.attribName=e.attribValue="";e.attribList.length=0}function closeTag(e){if(!e.tagName){strictFail(e,"Weird empty close tag.");e.textNode+="</>";e.state=h.TEXT;return}if(e.script){if(e.tagName!=="script"){e.script+="</"+e.tagName+">";e.tagName="";e.state=h.SCRIPT;return}emitNode(e,"onscript",e.script);e.script=""}var t=e.tags.length;var r=e.tagName;if(!e.strict){r=r[e.looseCase]()}var s=r;while(t--){var n=e.tags[t];if(n.name!==s){strictFail(e,"Unexpected close tag")}else{break}}if(t<0){strictFail(e,"Unmatched closing tag: "+e.tagName);e.textNode+="</"+e.tagName+">";e.state=h.TEXT;return}e.tagName=r;var i=e.tags.length;while(i-- >t){var o=e.tag=e.tags.pop();e.tagName=e.tag.name;emitNode(e,"onclosetag",e.tagName);var a={};for(var u in o.ns){a[u]=o.ns[u]}var c=e.tags[e.tags.length-1]||e;if(e.opt.xmlns&&o.ns!==c.ns){Object.keys(o.ns).forEach((function(t){var r=o.ns[t];emitNode(e,"onclosenamespace",{prefix:t,uri:r})}))}}if(t===0)e.closedRoot=true;e.tagName=e.attribValue=e.attribName="";e.attribList.length=0;e.state=h.TEXT}function parseEntity(e){var t=e.entity;var r=t.toLowerCase();var s;var n="";if(e.ENTITIES[t]){return e.ENTITIES[t]}if(e.ENTITIES[r]){return e.ENTITIES[r]}t=r;if(t.charAt(0)==="#"){if(t.charAt(1)==="x"){t=t.slice(2);s=parseInt(t,16);n=s.toString(16)}else{t=t.slice(1);s=parseInt(t,10);n=s.toString(10)}}t=t.replace(/^0+/,"");if(isNaN(s)||n.toLowerCase()!==t){strictFail(e,"Invalid character entity");return"&"+e.entity+";"}return String.fromCodePoint(s)}function beginWhiteSpace(e,t){if(t==="<"){e.state=h.OPEN_WAKA;e.startTagPosition=e.position}else if(!isWhitespace(t)){strictFail(e,"Non-whitespace before first tag.");e.textNode=t;e.state=h.TEXT}}function charAt(e,t){var r="";if(t<e.length){r=e.charAt(t)}return r}function write(e){var t=this;if(this.error){throw this.error}if(t.closed){return error(t,"Cannot write after close. Assign an onready handler.")}if(e===null){return end(t)}if(typeof e==="object"){e=e.toString()}var r=0;var s="";while(true){s=charAt(e,r++);t.c=s;if(!s){break}if(t.trackPosition){t.position++;if(s==="\n"){t.line++;t.column=0}else{t.column++}}switch(t.state){case h.BEGIN:t.state=h.BEGIN_WHITESPACE;if(s==="\ufeff"){continue}beginWhiteSpace(t,s);continue;case h.BEGIN_WHITESPACE:beginWhiteSpace(t,s);continue;case h.TEXT:if(t.sawRoot&&!t.closedRoot){var n=r-1;while(s&&s!=="<"&&s!=="&"){s=charAt(e,r++);if(s&&t.trackPosition){t.position++;if(s==="\n"){t.line++;t.column=0}else{t.column++}}}t.textNode+=e.substring(n,r-1)}if(s==="<"&&!(t.sawRoot&&t.closedRoot&&!t.strict)){t.state=h.OPEN_WAKA;t.startTagPosition=t.position}else{if(!isWhitespace(s)&&(!t.sawRoot||t.closedRoot)){strictFail(t,"Text data outside of root node.")}if(s==="&"){t.state=h.TEXT_ENTITY}else{t.textNode+=s}}continue;case h.SCRIPT:if(s==="<"){t.state=h.SCRIPT_ENDING}else{t.script+=s}continue;case h.SCRIPT_ENDING:if(s==="/"){t.state=h.CLOSE_TAG}else{t.script+="<"+s;t.state=h.SCRIPT}continue;case h.OPEN_WAKA:if(s==="!"){t.state=h.SGML_DECL;t.sgmlDecl=""}else if(isWhitespace(s)){}else if(isMatch(d,s)){t.state=h.OPEN_TAG;t.tagName=s}else if(s==="/"){t.state=h.CLOSE_TAG;t.tagName=""}else if(s==="?"){t.state=h.PROC_INST;t.procInstName=t.procInstBody=""}else{strictFail(t,"Unencoded <");if(t.startTagPosition+1<t.position){var a=t.position-t.startTagPosition;s=new Array(a).join(" ")+s}t.textNode+="<"+s;t.state=h.TEXT}continue;case h.SGML_DECL:if((t.sgmlDecl+s).toUpperCase()===i){emitNode(t,"onopencdata");t.state=h.CDATA;t.sgmlDecl="";t.cdata=""}else if(t.sgmlDecl+s==="--"){t.state=h.COMMENT;t.comment="";t.sgmlDecl=""}else if((t.sgmlDecl+s).toUpperCase()===o){t.state=h.DOCTYPE;if(t.doctype||t.sawRoot){strictFail(t,"Inappropriately located doctype declaration")}t.doctype="";t.sgmlDecl=""}else if(s===">"){emitNode(t,"onsgmldeclaration",t.sgmlDecl);t.sgmlDecl="";t.state=h.TEXT}else if(isQuote(s)){t.state=h.SGML_DECL_QUOTED;t.sgmlDecl+=s}else{t.sgmlDecl+=s}continue;case h.SGML_DECL_QUOTED:if(s===t.q){t.state=h.SGML_DECL;t.q=""}t.sgmlDecl+=s;continue;case h.DOCTYPE:if(s===">"){t.state=h.TEXT;emitNode(t,"ondoctype",t.doctype);t.doctype=true}else{t.doctype+=s;if(s==="["){t.state=h.DOCTYPE_DTD}else if(isQuote(s)){t.state=h.DOCTYPE_QUOTED;t.q=s}}continue;case h.DOCTYPE_QUOTED:t.doctype+=s;if(s===t.q){t.q="";t.state=h.DOCTYPE}continue;case h.DOCTYPE_DTD:t.doctype+=s;if(s==="]"){t.state=h.DOCTYPE}else if(isQuote(s)){t.state=h.DOCTYPE_DTD_QUOTED;t.q=s}continue;case h.DOCTYPE_DTD_QUOTED:t.doctype+=s;if(s===t.q){t.state=h.DOCTYPE_DTD;t.q=""}continue;case h.COMMENT:if(s==="-"){t.state=h.COMMENT_ENDING}else{t.comment+=s}continue;case h.COMMENT_ENDING:if(s==="-"){t.state=h.COMMENT_ENDED;t.comment=textopts(t.opt,t.comment);if(t.comment){emitNode(t,"oncomment",t.comment)}t.comment=""}else{t.comment+="-"+s;t.state=h.COMMENT}continue;case h.COMMENT_ENDED:if(s!==">"){strictFail(t,"Malformed comment");t.comment+="--"+s;t.state=h.COMMENT}else{t.state=h.TEXT}continue;case h.CDATA:if(s==="]"){t.state=h.CDATA_ENDING}else{t.cdata+=s}continue;case h.CDATA_ENDING:if(s==="]"){t.state=h.CDATA_ENDING_2}else{t.cdata+="]"+s;t.state=h.CDATA}continue;case h.CDATA_ENDING_2:if(s===">"){if(t.cdata){emitNode(t,"oncdata",t.cdata)}emitNode(t,"onclosecdata");t.cdata="";t.state=h.TEXT}else if(s==="]"){t.cdata+="]"}else{t.cdata+="]]"+s;t.state=h.CDATA}continue;case h.PROC_INST:if(s==="?"){t.state=h.PROC_INST_ENDING}else if(isWhitespace(s)){t.state=h.PROC_INST_BODY}else{t.procInstName+=s}continue;case h.PROC_INST_BODY:if(!t.procInstBody&&isWhitespace(s)){continue}else if(s==="?"){t.state=h.PROC_INST_ENDING}else{t.procInstBody+=s}continue;case h.PROC_INST_ENDING:if(s===">"){emitNode(t,"onprocessinginstruction",{name:t.procInstName,body:t.procInstBody});t.procInstName=t.procInstBody="";t.state=h.TEXT}else{t.procInstBody+="?"+s;t.state=h.PROC_INST_BODY}continue;case h.OPEN_TAG:if(isMatch(l,s)){t.tagName+=s}else{newTag(t);if(s===">"){openTag(t)}else if(s==="/"){t.state=h.OPEN_TAG_SLASH}else{if(!isWhitespace(s)){strictFail(t,"Invalid character in tag name")}t.state=h.ATTRIB}}continue;case h.OPEN_TAG_SLASH:if(s===">"){openTag(t,true);closeTag(t)}else{strictFail(t,"Forward-slash in opening tag not followed by >");t.state=h.ATTRIB}continue;case h.ATTRIB:if(isWhitespace(s)){continue}else if(s===">"){openTag(t)}else if(s==="/"){t.state=h.OPEN_TAG_SLASH}else if(isMatch(d,s)){t.attribName=s;t.attribValue="";t.state=h.ATTRIB_NAME}else{strictFail(t,"Invalid attribute name")}continue;case h.ATTRIB_NAME:if(s==="="){t.state=h.ATTRIB_VALUE}else if(s===">"){strictFail(t,"Attribute without value");t.attribValue=t.attribName;attrib(t);openTag(t)}else if(isWhitespace(s)){t.state=h.ATTRIB_NAME_SAW_WHITE}else if(isMatch(l,s)){t.attribName+=s}else{strictFail(t,"Invalid attribute name")}continue;case h.ATTRIB_NAME_SAW_WHITE:if(s==="="){t.state=h.ATTRIB_VALUE}else if(isWhitespace(s)){continue}else{strictFail(t,"Attribute without value");t.tag.attributes[t.attribName]="";t.attribValue="";emitNode(t,"onattribute",{name:t.attribName,value:""});t.attribName="";if(s===">"){openTag(t)}else if(isMatch(d,s)){t.attribName=s;t.state=h.ATTRIB_NAME}else{strictFail(t,"Invalid attribute name");t.state=h.ATTRIB}}continue;case h.ATTRIB_VALUE:if(isWhitespace(s)){continue}else if(isQuote(s)){t.q=s;t.state=h.ATTRIB_VALUE_QUOTED}else{strictFail(t,"Unquoted attribute value");t.state=h.ATTRIB_VALUE_UNQUOTED;t.attribValue=s}continue;case h.ATTRIB_VALUE_QUOTED:if(s!==t.q){if(s==="&"){t.state=h.ATTRIB_VALUE_ENTITY_Q}else{t.attribValue+=s}continue}attrib(t);t.q="";t.state=h.ATTRIB_VALUE_CLOSED;continue;case h.ATTRIB_VALUE_CLOSED:if(isWhitespace(s)){t.state=h.ATTRIB}else if(s===">"){openTag(t)}else if(s==="/"){t.state=h.OPEN_TAG_SLASH}else if(isMatch(d,s)){strictFail(t,"No whitespace between attributes");t.attribName=s;t.attribValue="";t.state=h.ATTRIB_NAME}else{strictFail(t,"Invalid attribute name")}continue;case h.ATTRIB_VALUE_UNQUOTED:if(!isAttribEnd(s)){if(s==="&"){t.state=h.ATTRIB_VALUE_ENTITY_U}else{t.attribValue+=s}continue}attrib(t);if(s===">"){openTag(t)}else{t.state=h.ATTRIB}continue;case h.CLOSE_TAG:if(!t.tagName){if(isWhitespace(s)){continue}else if(notMatch(d,s)){if(t.script){t.script+="</"+s;t.state=h.SCRIPT}else{strictFail(t,"Invalid tagname in closing tag.")}}else{t.tagName=s}}else if(s===">"){closeTag(t)}else if(isMatch(l,s)){t.tagName+=s}else if(t.script){t.script+="</"+t.tagName;t.tagName="";t.state=h.SCRIPT}else{if(!isWhitespace(s)){strictFail(t,"Invalid tagname in closing tag")}t.state=h.CLOSE_TAG_SAW_WHITE}continue;case h.CLOSE_TAG_SAW_WHITE:if(isWhitespace(s)){continue}if(s===">"){closeTag(t)}else{strictFail(t,"Invalid characters in closing tag")}continue;case h.TEXT_ENTITY:case h.ATTRIB_VALUE_ENTITY_Q:case h.ATTRIB_VALUE_ENTITY_U:var u;var c;switch(t.state){case h.TEXT_ENTITY:u=h.TEXT;c="textNode";break;case h.ATTRIB_VALUE_ENTITY_Q:u=h.ATTRIB_VALUE_QUOTED;c="attribValue";break;case h.ATTRIB_VALUE_ENTITY_U:u=h.ATTRIB_VALUE_UNQUOTED;c="attribValue";break}if(s===";"){if(t.opt.unparsedEntities){var m=parseEntity(t);t.entity="";t.state=u;t.write(m)}else{t[c]+=parseEntity(t);t.entity="";t.state=u}}else if(isMatch(t.entity.length?f:p,s)){t.entity+=s}else{strictFail(t,"Invalid character in entity name");t[c]+="&"+t.entity+s;t.entity="";t.state=u}continue;default:{throw new Error(t,"Unknown state: "+t.state)}}}if(t.position>=t.bufferCheckPosition){checkBufferLength(t)}return t}
2
- /*! http://mths.be/fromcodepoint v0.1.0 by @mathias */if(!String.fromCodePoint){(function(){var e=String.fromCharCode;var t=Math.floor;var fromCodePoint=function(){var r=16384;var s=[];var n;var i;var o=-1;var a=arguments.length;if(!a){return""}var u="";while(++o<a){var c=Number(arguments[o]);if(!isFinite(c)||c<0||c>1114111||t(c)!==c){throw RangeError("Invalid code point: "+c)}if(c<=65535){s.push(c)}else{c-=65536;n=(c>>10)+55296;i=c%1024+56320;s.push(n,i)}if(o+1===a||s.length>r){u+=e.apply(null,s);s.length=0}}return u};if(Object.defineProperty){Object.defineProperty(String,"fromCodePoint",{value:fromCodePoint,configurable:true,writable:true})}else{String.fromCodePoint=fromCodePoint}})()}})(false?0:t)},9318:function(e,t,r){"use strict";const s=r(2037);const n=r(1621);const i=process.env;let o;if(n("no-color")||n("no-colors")||n("color=false")){o=false}else if(n("color")||n("colors")||n("color=true")||n("color=always")){o=true}if("FORCE_COLOR"in i){o=i.FORCE_COLOR.length===0||parseInt(i.FORCE_COLOR,10)!==0}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e){if(o===false){return 0}if(n("color=16m")||n("color=full")||n("color=truecolor")){return 3}if(n("color=256")){return 2}if(e&&!e.isTTY&&o!==true){return 0}const t=o?1:0;if(process.platform==="win32"){const e=s.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in i){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in i))||i.CI_NAME==="codeship"){return 1}return t}if("TEAMCITY_VERSION"in i){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION)?1:0}if(i.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in i){const e=parseInt((i.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(i.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(i.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)){return 1}if("COLORTERM"in i){return 1}if(i.TERM==="dumb"){return t}return t}function getSupportLevel(e){const t=supportsColor(e);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)}},2624:function(e,t){(function(){"use strict";t.stripBOM=function(e){if(e[0]==="\ufeff"){return e.substring(1)}else{return e}}}).call(this)},3337:function(e,t,r){(function(){"use strict";var e,s,n,i,o,a={}.hasOwnProperty;e=r(2958);s=r(7251).defaults;i=function(e){return typeof e==="string"&&(e.indexOf("&")>=0||e.indexOf(">")>=0||e.indexOf("<")>=0)};o=function(e){return"<![CDATA["+n(e)+"]]>"};n=function(e){return e.replace("]]>","]]]]><![CDATA[>")};t.Builder=function(){function Builder(e){var t,r,n;this.options={};r=s["0.2"];for(t in r){if(!a.call(r,t))continue;n=r[t];this.options[t]=n}for(t in e){if(!a.call(e,t))continue;n=e[t];this.options[t]=n}}Builder.prototype.buildObject=function(t){var r,n,u,c,d;r=this.options.attrkey;n=this.options.charkey;if(Object.keys(t).length===1&&this.options.rootName===s["0.2"].rootName){d=Object.keys(t)[0];t=t[d]}else{d=this.options.rootName}u=function(e){return function(t,s){var c,d,l,p,f,h;if(typeof s!=="object"){if(e.options.cdata&&i(s)){t.raw(o(s))}else{t.txt(s)}}else if(Array.isArray(s)){for(p in s){if(!a.call(s,p))continue;d=s[p];for(f in d){l=d[f];t=u(t.ele(f),l).up()}}}else{for(f in s){if(!a.call(s,f))continue;d=s[f];if(f===r){if(typeof d==="object"){for(c in d){h=d[c];t=t.att(c,h)}}}else if(f===n){if(e.options.cdata&&i(d)){t=t.raw(o(d))}else{t=t.txt(d)}}else if(Array.isArray(d)){for(p in d){if(!a.call(d,p))continue;l=d[p];if(typeof l==="string"){if(e.options.cdata&&i(l)){t=t.ele(f).raw(o(l)).up()}else{t=t.ele(f,l).up()}}else{t=u(t.ele(f),l).up()}}}else if(typeof d==="object"){t=u(t.ele(f),d).up()}else{if(typeof d==="string"&&e.options.cdata&&i(d)){t=t.ele(f).raw(o(d)).up()}else{if(d==null){d=""}t=t.ele(f,d.toString()).up()}}}}return t}}(this);c=e.create(d,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars});return u(c,t).end(this.options.renderOpts)};return Builder}()}).call(this)},7251:function(e,t){(function(){t.defaults={.1:{explicitCharkey:false,trim:true,normalize:true,normalizeTags:false,attrkey:"@",charkey:"#",explicitArray:false,ignoreAttrs:false,mergeAttrs:false,explicitRoot:false,validator:null,xmlns:false,explicitChildren:false,childkey:"@@",charsAsChildren:false,includeWhiteChars:false,async:false,strict:true,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},.2:{explicitCharkey:false,trim:false,normalize:false,normalizeTags:false,attrkey:"$",charkey:"_",explicitArray:true,ignoreAttrs:false,mergeAttrs:false,explicitRoot:true,validator:null,xmlns:false,explicitChildren:false,preserveChildrenOrder:false,childkey:"$$",charsAsChildren:false,includeWhiteChars:false,async:false,strict:true,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:true},doctype:null,renderOpts:{pretty:true,indent:" ",newline:"\n"},headless:false,chunkSize:1e4,emptyTag:"",cdata:false}}}).call(this)},3314:function(e,t,r){(function(){"use strict";var e,s,n,i,o,a,u,c,d,bind=function(e,t){return function(){return e.apply(t,arguments)}},extend=function(e,t){for(var r in t){if(l.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},l={}.hasOwnProperty;c=r(2043);i=r(2361);e=r(2624);u=r(9236);d=r(9512).setImmediate;s=r(7251).defaults;o=function(e){return typeof e==="object"&&e!=null&&Object.keys(e).length===0};a=function(e,t,r){var s,n,i;for(s=0,n=e.length;s<n;s++){i=e[s];t=i(t,r)}return t};n=function(e,t,r){var s;s=Object.create(null);s.value=r;s.writable=true;s.enumerable=true;s.configurable=true;return Object.defineProperty(e,t,s)};t.Parser=function(r){extend(Parser,r);function Parser(e){this.parseStringPromise=bind(this.parseStringPromise,this);this.parseString=bind(this.parseString,this);this.reset=bind(this.reset,this);this.assignOrPush=bind(this.assignOrPush,this);this.processAsync=bind(this.processAsync,this);var r,n,i;if(!(this instanceof t.Parser)){return new t.Parser(e)}this.options={};n=s["0.2"];for(r in n){if(!l.call(n,r))continue;i=n[r];this.options[r]=i}for(r in e){if(!l.call(e,r))continue;i=e[r];this.options[r]=i}if(this.options.xmlns){this.options.xmlnskey=this.options.attrkey+"ns"}if(this.options.normalizeTags){if(!this.options.tagNameProcessors){this.options.tagNameProcessors=[]}this.options.tagNameProcessors.unshift(u.normalize)}this.reset()}Parser.prototype.processAsync=function(){var e,t;try{if(this.remaining.length<=this.options.chunkSize){e=this.remaining;this.remaining="";this.saxParser=this.saxParser.write(e);return this.saxParser.close()}else{e=this.remaining.substr(0,this.options.chunkSize);this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length);this.saxParser=this.saxParser.write(e);return d(this.processAsync)}}catch(e){t=e;if(!this.saxParser.errThrown){this.saxParser.errThrown=true;return this.emit(t)}}};Parser.prototype.assignOrPush=function(e,t,r){if(!(t in e)){if(!this.options.explicitArray){return n(e,t,r)}else{return n(e,t,[r])}}else{if(!(e[t]instanceof Array)){n(e,t,[e[t]])}return e[t].push(r)}};Parser.prototype.reset=function(){var e,t,r,s;this.removeAllListeners();this.saxParser=c.parser(this.options.strict,{trim:false,normalize:false,xmlns:this.options.xmlns});this.saxParser.errThrown=false;this.saxParser.onerror=function(e){return function(t){e.saxParser.resume();if(!e.saxParser.errThrown){e.saxParser.errThrown=true;return e.emit("error",t)}}}(this);this.saxParser.onend=function(e){return function(){if(!e.saxParser.ended){e.saxParser.ended=true;return e.emit("end",e.resultObject)}}}(this);this.saxParser.ended=false;this.EXPLICIT_CHARKEY=this.options.explicitCharkey;this.resultObject=null;s=[];e=this.options.attrkey;t=this.options.charkey;this.saxParser.onopentag=function(r){return function(i){var o,u,c,d,p;c={};c[t]="";if(!r.options.ignoreAttrs){p=i.attributes;for(o in p){if(!l.call(p,o))continue;if(!(e in c)&&!r.options.mergeAttrs){c[e]={}}u=r.options.attrValueProcessors?a(r.options.attrValueProcessors,i.attributes[o],o):i.attributes[o];d=r.options.attrNameProcessors?a(r.options.attrNameProcessors,o):o;if(r.options.mergeAttrs){r.assignOrPush(c,d,u)}else{n(c[e],d,u)}}}c["#name"]=r.options.tagNameProcessors?a(r.options.tagNameProcessors,i.name):i.name;if(r.options.xmlns){c[r.options.xmlnskey]={uri:i.uri,local:i.local}}return s.push(c)}}(this);this.saxParser.onclosetag=function(e){return function(){var r,i,u,c,d,p,f,h,m,y;p=s.pop();d=p["#name"];if(!e.options.explicitChildren||!e.options.preserveChildrenOrder){delete p["#name"]}if(p.cdata===true){r=p.cdata;delete p.cdata}m=s[s.length-1];if(p[t].match(/^\s*$/)&&!r){i=p[t];delete p[t]}else{if(e.options.trim){p[t]=p[t].trim()}if(e.options.normalize){p[t]=p[t].replace(/\s{2,}/g," ").trim()}p[t]=e.options.valueProcessors?a(e.options.valueProcessors,p[t],d):p[t];if(Object.keys(p).length===1&&t in p&&!e.EXPLICIT_CHARKEY){p=p[t]}}if(o(p)){if(typeof e.options.emptyTag==="function"){p=e.options.emptyTag()}else{p=e.options.emptyTag!==""?e.options.emptyTag:i}}if(e.options.validator!=null){y="/"+function(){var e,t,r;r=[];for(e=0,t=s.length;e<t;e++){c=s[e];r.push(c["#name"])}return r}().concat(d).join("/");(function(){var t;try{return p=e.options.validator(y,m&&m[d],p)}catch(r){t=r;return e.emit("error",t)}})()}if(e.options.explicitChildren&&!e.options.mergeAttrs&&typeof p==="object"){if(!e.options.preserveChildrenOrder){c={};if(e.options.attrkey in p){c[e.options.attrkey]=p[e.options.attrkey];delete p[e.options.attrkey]}if(!e.options.charsAsChildren&&e.options.charkey in p){c[e.options.charkey]=p[e.options.charkey];delete p[e.options.charkey]}if(Object.getOwnPropertyNames(p).length>0){c[e.options.childkey]=p}p=c}else if(m){m[e.options.childkey]=m[e.options.childkey]||[];f={};for(u in p){if(!l.call(p,u))continue;n(f,u,p[u])}m[e.options.childkey].push(f);delete p["#name"];if(Object.keys(p).length===1&&t in p&&!e.EXPLICIT_CHARKEY){p=p[t]}}}if(s.length>0){return e.assignOrPush(m,d,p)}else{if(e.options.explicitRoot){h=p;p={};n(p,d,h)}e.resultObject=p;e.saxParser.ended=true;return e.emit("end",e.resultObject)}}}(this);r=function(e){return function(r){var n,i;i=s[s.length-1];if(i){i[t]+=r;if(e.options.explicitChildren&&e.options.preserveChildrenOrder&&e.options.charsAsChildren&&(e.options.includeWhiteChars||r.replace(/\\n/g,"").trim()!=="")){i[e.options.childkey]=i[e.options.childkey]||[];n={"#name":"__text__"};n[t]=r;if(e.options.normalize){n[t]=n[t].replace(/\s{2,}/g," ").trim()}i[e.options.childkey].push(n)}return i}}}(this);this.saxParser.ontext=r;return this.saxParser.oncdata=function(e){return function(e){var t;t=r(e);if(t){return t.cdata=true}}}(this)};Parser.prototype.parseString=function(t,r){var s;if(r!=null&&typeof r==="function"){this.on("end",(function(e){this.reset();return r(null,e)}));this.on("error",(function(e){this.reset();return r(e)}))}try{t=t.toString();if(t.trim()===""){this.emit("end",null);return true}t=e.stripBOM(t);if(this.options.async){this.remaining=t;d(this.processAsync);return this.saxParser}return this.saxParser.write(t).close()}catch(e){s=e;if(!(this.saxParser.errThrown||this.saxParser.ended)){this.emit("error",s);return this.saxParser.errThrown=true}else if(this.saxParser.ended){throw s}}};Parser.prototype.parseStringPromise=function(e){return new Promise(function(t){return function(r,s){return t.parseString(e,(function(e,t){if(e){return s(e)}else{return r(t)}}))}}(this))};return Parser}(i);t.parseString=function(e,r,s){var n,i,o;if(s!=null){if(typeof s==="function"){n=s}if(typeof r==="object"){i=r}}else{if(typeof r==="function"){n=r}i={}}o=new t.Parser(i);return o.parseString(e,n)};t.parseStringPromise=function(e,r){var s,n;if(typeof r==="object"){s=r}n=new t.Parser(s);return n.parseStringPromise(e)}}).call(this)},9236:function(e,t){(function(){"use strict";var e;e=new RegExp(/(?!xmlns)^.*:/);t.normalize=function(e){return e.toLowerCase()};t.firstCharLowerCase=function(e){return e.charAt(0).toLowerCase()+e.slice(1)};t.stripPrefix=function(t){return t.replace(e,"")};t.parseNumbers=function(e){if(!isNaN(e)){e=e%1===0?parseInt(e,10):parseFloat(e)}return e};t.parseBooleans=function(e){if(/^(?:true|false)$/i.test(e)){e=e.toLowerCase()==="true"}return e}}).call(this)},6189:function(e,t,r){(function(){"use strict";var e,s,n,i,extend=function(e,t){for(var r in t){if(o.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},o={}.hasOwnProperty;s=r(7251);e=r(3337);n=r(3314);i=r(9236);t.defaults=s.defaults;t.processors=i;t.ValidationError=function(e){extend(ValidationError,e);function ValidationError(e){this.message=e}return ValidationError}(Error);t.Builder=e.Builder;t.Parser=n.Parser;t.parseString=n.parseString;t.parseStringPromise=n.parseStringPromise}).call(this)},2839:function(e){(function(){e.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(this)},9267:function(e){(function(){e.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(this)},8229:function(e){(function(){var t,r,s,n,i,o,a,u=[].slice,c={}.hasOwnProperty;t=function(){var e,t,r,s,n,o;o=arguments[0],n=2<=arguments.length?u.call(arguments,1):[];if(i(Object.assign)){Object.assign.apply(null,arguments)}else{for(e=0,r=n.length;e<r;e++){s=n[e];if(s!=null){for(t in s){if(!c.call(s,t))continue;o[t]=s[t]}}}}return o};i=function(e){return!!e&&Object.prototype.toString.call(e)==="[object Function]"};o=function(e){var t;return!!e&&((t=typeof e)==="function"||t==="object")};s=function(e){if(i(Array.isArray)){return Array.isArray(e)}else{return Object.prototype.toString.call(e)==="[object Array]"}};n=function(e){var t;if(s(e)){return!e.length}else{for(t in e){if(!c.call(e,t))continue;return false}return true}};a=function(e){var t,r;return o(e)&&(r=Object.getPrototypeOf(e))&&(t=r.constructor)&&typeof t==="function"&&t instanceof t&&Function.prototype.toString.call(t)===Function.prototype.toString.call(Object)};r=function(e){if(i(e.valueOf)){return e.valueOf()}else{return e}};e.exports.assign=t;e.exports.isFunction=i;e.exports.isObject=o;e.exports.isArray=s;e.exports.isEmpty=n;e.exports.isPlainObject=a;e.exports.getValue=r}).call(this)},9766:function(e){(function(){e.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(this)},8376:function(e,t,r){(function(){var t,s,n;t=r(9267);n=r(7608);e.exports=s=function(){function XMLAttribute(e,r,s){this.parent=e;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}if(r==null){throw new Error("Missing attribute name. "+this.debugInfo(r))}this.name=this.stringify.name(r);this.value=this.stringify.attValue(s);this.type=t.Attribute;this.isId=false;this.schemaTypeInfo=null}Object.defineProperty(XMLAttribute.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(XMLAttribute.prototype,"ownerElement",{get:function(){return this.parent}});Object.defineProperty(XMLAttribute.prototype,"textContent",{get:function(){return this.value},set:function(e){return this.value=e||""}});Object.defineProperty(XMLAttribute.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(XMLAttribute.prototype,"prefix",{get:function(){return""}});Object.defineProperty(XMLAttribute.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(XMLAttribute.prototype,"specified",{get:function(){return true}});XMLAttribute.prototype.clone=function(){return Object.create(this)};XMLAttribute.prototype.toString=function(e){return this.options.writer.attribute(this,this.options.writer.filterOptions(e))};XMLAttribute.prototype.debugInfo=function(e){e=e||this.name;if(e==null){return"parent: <"+this.parent.name+">"}else{return"attribute: {"+e+"}, parent: <"+this.parent.name+">"}};XMLAttribute.prototype.isEqualNode=function(e){if(e.namespaceURI!==this.namespaceURI){return false}if(e.prefix!==this.prefix){return false}if(e.localName!==this.localName){return false}if(e.value!==this.value){return false}return true};return XMLAttribute}()}).call(this)},333:function(e,t,r){(function(){var t,s,n,extend=function(e,t){for(var r in t){if(i.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},i={}.hasOwnProperty;t=r(9267);n=r(7709);e.exports=s=function(e){extend(XMLCData,e);function XMLCData(e,r){XMLCData.__super__.constructor.call(this,e);if(r==null){throw new Error("Missing CDATA text. "+this.debugInfo())}this.name="#cdata-section";this.type=t.CData;this.value=this.stringify.cdata(r)}XMLCData.prototype.clone=function(){return Object.create(this)};XMLCData.prototype.toString=function(e){return this.options.writer.cdata(this,this.options.writer.filterOptions(e))};return XMLCData}(n)}).call(this)},7709:function(e,t,r){(function(){var t,s,extend=function(e,t){for(var r in t){if(n.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},n={}.hasOwnProperty;s=r(7608);e.exports=t=function(e){extend(XMLCharacterData,e);function XMLCharacterData(e){XMLCharacterData.__super__.constructor.call(this,e);this.value=""}Object.defineProperty(XMLCharacterData.prototype,"data",{get:function(){return this.value},set:function(e){return this.value=e||""}});Object.defineProperty(XMLCharacterData.prototype,"length",{get:function(){return this.value.length}});Object.defineProperty(XMLCharacterData.prototype,"textContent",{get:function(){return this.value},set:function(e){return this.value=e||""}});XMLCharacterData.prototype.clone=function(){return Object.create(this)};XMLCharacterData.prototype.substringData=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.appendData=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.insertData=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.deleteData=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.replaceData=function(e,t,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.isEqualNode=function(e){if(!XMLCharacterData.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)){return false}if(e.data!==this.data){return false}return true};return XMLCharacterData}(s)}).call(this)},4407:function(e,t,r){(function(){var t,s,n,extend=function(e,t){for(var r in t){if(i.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},i={}.hasOwnProperty;t=r(9267);s=r(7709);e.exports=n=function(e){extend(XMLComment,e);function XMLComment(e,r){XMLComment.__super__.constructor.call(this,e);if(r==null){throw new Error("Missing comment text. "+this.debugInfo())}this.name="#comment";this.type=t.Comment;this.value=this.stringify.comment(r)}XMLComment.prototype.clone=function(){return Object.create(this)};XMLComment.prototype.toString=function(e){return this.options.writer.comment(this,this.options.writer.filterOptions(e))};return XMLComment}(s)}).call(this)},6681:function(e,t,r){(function(){var t,s,n;s=r(6744);n=r(7028);e.exports=t=function(){function XMLDOMConfiguration(){var e;this.defaultParams={"canonical-form":false,"cdata-sections":false,comments:false,"datatype-normalization":false,"element-content-whitespace":true,entities:true,"error-handler":new s,infoset:true,"validate-if-schema":false,namespaces:true,"namespace-declarations":true,"normalize-characters":false,"schema-location":"","schema-type":"","split-cdata-sections":true,validate:false,"well-formed":true};this.params=e=Object.create(this.defaultParams)}Object.defineProperty(XMLDOMConfiguration.prototype,"parameterNames",{get:function(){return new n(Object.keys(this.defaultParams))}});XMLDOMConfiguration.prototype.getParameter=function(e){if(this.params.hasOwnProperty(e)){return this.params[e]}else{return null}};XMLDOMConfiguration.prototype.canSetParameter=function(e,t){return true};XMLDOMConfiguration.prototype.setParameter=function(e,t){if(t!=null){return this.params[e]=t}else{return delete this.params[e]}};return XMLDOMConfiguration}()}).call(this)},6744:function(e){(function(){var t;e.exports=t=function(){function XMLDOMErrorHandler(){}XMLDOMErrorHandler.prototype.handleError=function(e){throw new Error(e)};return XMLDOMErrorHandler}()}).call(this)},8310:function(e){(function(){var t;e.exports=t=function(){function XMLDOMImplementation(){}XMLDOMImplementation.prototype.hasFeature=function(e,t){return true};XMLDOMImplementation.prototype.createDocumentType=function(e,t,r){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.createDocument=function(e,t,r){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.createHTMLDocument=function(e){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.getFeature=function(e,t){throw new Error("This DOM method is not implemented.")};return XMLDOMImplementation}()}).call(this)},7028:function(e){(function(){var t;e.exports=t=function(){function XMLDOMStringList(e){this.arr=e||[]}Object.defineProperty(XMLDOMStringList.prototype,"length",{get:function(){return this.arr.length}});XMLDOMStringList.prototype.item=function(e){return this.arr[e]||null};XMLDOMStringList.prototype.contains=function(e){return this.arr.indexOf(e)!==-1};return XMLDOMStringList}()}).call(this)},1015:function(e,t,r){(function(){var t,s,n,extend=function(e,t){for(var r in t){if(i.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},i={}.hasOwnProperty;n=r(7608);t=r(9267);e.exports=s=function(e){extend(XMLDTDAttList,e);function XMLDTDAttList(e,r,s,n,i,o){XMLDTDAttList.__super__.constructor.call(this,e);if(r==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(s==null){throw new Error("Missing DTD attribute name. "+this.debugInfo(r))}if(!n){throw new Error("Missing DTD attribute type. "+this.debugInfo(r))}if(!i){throw new Error("Missing DTD attribute default. "+this.debugInfo(r))}if(i.indexOf("#")!==0){i="#"+i}if(!i.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)){throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(r))}if(o&&!i.match(/^(#FIXED|#DEFAULT)$/)){throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(r))}this.elementName=this.stringify.name(r);this.type=t.AttributeDeclaration;this.attributeName=this.stringify.name(s);this.attributeType=this.stringify.dtdAttType(n);if(o){this.defaultValue=this.stringify.dtdAttDefault(o)}this.defaultValueType=i}XMLDTDAttList.prototype.toString=function(e){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(e))};return XMLDTDAttList}(n)}).call(this)},2421:function(e,t,r){(function(){var t,s,n,extend=function(e,t){for(var r in t){if(i.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},i={}.hasOwnProperty;n=r(7608);t=r(9267);e.exports=s=function(e){extend(XMLDTDElement,e);function XMLDTDElement(e,r,s){XMLDTDElement.__super__.constructor.call(this,e);if(r==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(!s){s="(#PCDATA)"}if(Array.isArray(s)){s="("+s.join(",")+")"}this.name=this.stringify.name(r);this.type=t.ElementDeclaration;this.value=this.stringify.dtdElementValue(s)}XMLDTDElement.prototype.toString=function(e){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(e))};return XMLDTDElement}(n)}).call(this)},53:function(e,t,r){(function(){var t,s,n,i,extend=function(e,t){for(var r in t){if(o.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},o={}.hasOwnProperty;i=r(8229).isObject;n=r(7608);t=r(9267);e.exports=s=function(e){extend(XMLDTDEntity,e);function XMLDTDEntity(e,r,s,n){XMLDTDEntity.__super__.constructor.call(this,e);if(s==null){throw new Error("Missing DTD entity name. "+this.debugInfo(s))}if(n==null){throw new Error("Missing DTD entity value. "+this.debugInfo(s))}this.pe=!!r;this.name=this.stringify.name(s);this.type=t.EntityDeclaration;if(!i(n)){this.value=this.stringify.dtdEntityValue(n);this.internal=true}else{if(!n.pubID&&!n.sysID){throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(s))}if(n.pubID&&!n.sysID){throw new Error("System identifier is required for a public external entity. "+this.debugInfo(s))}this.internal=false;if(n.pubID!=null){this.pubID=this.stringify.dtdPubID(n.pubID)}if(n.sysID!=null){this.sysID=this.stringify.dtdSysID(n.sysID)}if(n.nData!=null){this.nData=this.stringify.dtdNData(n.nData)}if(this.pe&&this.nData){throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(s))}}}Object.defineProperty(XMLDTDEntity.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDEntity.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(XMLDTDEntity.prototype,"notationName",{get:function(){return this.nData||null}});Object.defineProperty(XMLDTDEntity.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(XMLDTDEntity.prototype,"xmlEncoding",{get:function(){return null}});Object.defineProperty(XMLDTDEntity.prototype,"xmlVersion",{get:function(){return null}});XMLDTDEntity.prototype.toString=function(e){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(e))};return XMLDTDEntity}(n)}).call(this)},2837:function(e,t,r){(function(){var t,s,n,extend=function(e,t){for(var r in t){if(i.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},i={}.hasOwnProperty;n=r(7608);t=r(9267);e.exports=s=function(e){extend(XMLDTDNotation,e);function XMLDTDNotation(e,r,s){XMLDTDNotation.__super__.constructor.call(this,e);if(r==null){throw new Error("Missing DTD notation name. "+this.debugInfo(r))}if(!s.pubID&&!s.sysID){throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(r))}this.name=this.stringify.name(r);this.type=t.NotationDeclaration;if(s.pubID!=null){this.pubID=this.stringify.dtdPubID(s.pubID)}if(s.sysID!=null){this.sysID=this.stringify.dtdSysID(s.sysID)}}Object.defineProperty(XMLDTDNotation.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDNotation.prototype,"systemId",{get:function(){return this.sysID}});XMLDTDNotation.prototype.toString=function(e){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(e))};return XMLDTDNotation}(n)}).call(this)},6364:function(e,t,r){(function(){var t,s,n,i,extend=function(e,t){for(var r in t){if(o.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},o={}.hasOwnProperty;i=r(8229).isObject;n=r(7608);t=r(9267);e.exports=s=function(e){extend(XMLDeclaration,e);function XMLDeclaration(e,r,s,n){var o;XMLDeclaration.__super__.constructor.call(this,e);if(i(r)){o=r,r=o.version,s=o.encoding,n=o.standalone}if(!r){r="1.0"}this.type=t.Declaration;this.version=this.stringify.xmlVersion(r);if(s!=null){this.encoding=this.stringify.xmlEncoding(s)}if(n!=null){this.standalone=this.stringify.xmlStandalone(n)}}XMLDeclaration.prototype.toString=function(e){return this.options.writer.declaration(this,this.options.writer.filterOptions(e))};return XMLDeclaration}(n)}).call(this)},1801:function(e,t,r){(function(){var t,s,n,i,o,a,u,c,d,extend=function(e,t){for(var r in t){if(l.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},l={}.hasOwnProperty;d=r(8229).isObject;c=r(7608);t=r(9267);s=r(1015);i=r(53);n=r(2421);o=r(2837);u=r(4361);e.exports=a=function(e){extend(XMLDocType,e);function XMLDocType(e,r,s){var n,i,o,a,u,c;XMLDocType.__super__.constructor.call(this,e);this.type=t.DocType;if(e.children){a=e.children;for(i=0,o=a.length;i<o;i++){n=a[i];if(n.type===t.Element){this.name=n.name;break}}}this.documentObject=e;if(d(r)){u=r,r=u.pubID,s=u.sysID}if(s==null){c=[r,s],s=c[0],r=c[1]}if(r!=null){this.pubID=this.stringify.dtdPubID(r)}if(s!=null){this.sysID=this.stringify.dtdSysID(s)}}Object.defineProperty(XMLDocType.prototype,"entities",{get:function(){var e,r,s,n,i;n={};i=this.children;for(r=0,s=i.length;r<s;r++){e=i[r];if(e.type===t.EntityDeclaration&&!e.pe){n[e.name]=e}}return new u(n)}});Object.defineProperty(XMLDocType.prototype,"notations",{get:function(){var e,r,s,n,i;n={};i=this.children;for(r=0,s=i.length;r<s;r++){e=i[r];if(e.type===t.NotationDeclaration){n[e.name]=e}}return new u(n)}});Object.defineProperty(XMLDocType.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDocType.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(XMLDocType.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});XMLDocType.prototype.element=function(e,t){var r;r=new n(this,e,t);this.children.push(r);return this};XMLDocType.prototype.attList=function(e,t,r,n,i){var o;o=new s(this,e,t,r,n,i);this.children.push(o);return this};XMLDocType.prototype.entity=function(e,t){var r;r=new i(this,false,e,t);this.children.push(r);return this};XMLDocType.prototype.pEntity=function(e,t){var r;r=new i(this,true,e,t);this.children.push(r);return this};XMLDocType.prototype.notation=function(e,t){var r;r=new o(this,e,t);this.children.push(r);return this};XMLDocType.prototype.toString=function(e){return this.options.writer.docType(this,this.options.writer.filterOptions(e))};XMLDocType.prototype.ele=function(e,t){return this.element(e,t)};XMLDocType.prototype.att=function(e,t,r,s,n){return this.attList(e,t,r,s,n)};XMLDocType.prototype.ent=function(e,t){return this.entity(e,t)};XMLDocType.prototype.pent=function(e,t){return this.pEntity(e,t)};XMLDocType.prototype.not=function(e,t){return this.notation(e,t)};XMLDocType.prototype.up=function(){return this.root()||this.documentObject};XMLDocType.prototype.isEqualNode=function(e){if(!XMLDocType.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)){return false}if(e.name!==this.name){return false}if(e.publicId!==this.publicId){return false}if(e.systemId!==this.systemId){return false}return true};return XMLDocType}(c)}).call(this)},3730:function(e,t,r){(function(){var t,s,n,i,o,a,u,c,extend=function(e,t){for(var r in t){if(d.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},d={}.hasOwnProperty;c=r(8229).isPlainObject;n=r(8310);s=r(6681);o=r(7608);t=r(9267);u=r(8594);a=r(5913);e.exports=i=function(e){extend(XMLDocument,e);function XMLDocument(e){XMLDocument.__super__.constructor.call(this,null);this.name="#document";this.type=t.Document;this.documentURI=null;this.domConfig=new s;e||(e={});if(!e.writer){e.writer=new a}this.options=e;this.stringify=new u(e)}Object.defineProperty(XMLDocument.prototype,"implementation",{value:new n});Object.defineProperty(XMLDocument.prototype,"doctype",{get:function(){var e,r,s,n;n=this.children;for(r=0,s=n.length;r<s;r++){e=n[r];if(e.type===t.DocType){return e}}return null}});Object.defineProperty(XMLDocument.prototype,"documentElement",{get:function(){return this.rootObject||null}});Object.defineProperty(XMLDocument.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"strictErrorChecking",{get:function(){return false}});Object.defineProperty(XMLDocument.prototype,"xmlEncoding",{get:function(){if(this.children.length!==0&&this.children[0].type===t.Declaration){return this.children[0].encoding}else{return null}}});Object.defineProperty(XMLDocument.prototype,"xmlStandalone",{get:function(){if(this.children.length!==0&&this.children[0].type===t.Declaration){return this.children[0].standalone==="yes"}else{return false}}});Object.defineProperty(XMLDocument.prototype,"xmlVersion",{get:function(){if(this.children.length!==0&&this.children[0].type===t.Declaration){return this.children[0].version}else{return"1.0"}}});Object.defineProperty(XMLDocument.prototype,"URL",{get:function(){return this.documentURI}});Object.defineProperty(XMLDocument.prototype,"origin",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"compatMode",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"characterSet",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"contentType",{get:function(){return null}});XMLDocument.prototype.end=function(e){var t;t={};if(!e){e=this.options.writer}else if(c(e)){t=e;e=this.options.writer}return e.document(this,e.filterOptions(t))};XMLDocument.prototype.toString=function(e){return this.options.writer.document(this,this.options.writer.filterOptions(e))};XMLDocument.prototype.createElement=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createTextNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createComment=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createCDATASection=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createProcessingInstruction=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createAttribute=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createEntityReference=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementsByTagName=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.importNode=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createElementNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createAttributeNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementsByTagNameNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementById=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.adoptNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.renameNode=function(e,t,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementsByClassName=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createEvent=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createNodeIterator=function(e,t,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createTreeWalker=function(e,t,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};return XMLDocument}(o)}).call(this)},7356:function(e,t,r){(function(){var t,s,n,i,o,a,u,c,d,l,p,f,h,m,y,g,S,T,w,b,C,O,I,v,R={}.hasOwnProperty;v=r(8229),O=v.isObject,C=v.isFunction,I=v.isPlainObject,b=v.getValue;t=r(9267);f=r(3730);m=r(9437);i=r(333);o=r(4407);g=r(6329);w=r(1318);y=r(6939);l=r(6364);p=r(1801);a=r(1015);c=r(53);u=r(2421);d=r(2837);n=r(8376);T=r(8594);S=r(5913);s=r(9766);e.exports=h=function(){function XMLDocumentCB(e,r,s){var n;this.name="?xml";this.type=t.Document;e||(e={});n={};if(!e.writer){e.writer=new S}else if(I(e.writer)){n=e.writer;e.writer=new S}this.options=e;this.writer=e.writer;this.writerOptions=this.writer.filterOptions(n);this.stringify=new T(e);this.onDataCallback=r||function(){};this.onEndCallback=s||function(){};this.currentNode=null;this.currentLevel=-1;this.openTags={};this.documentStarted=false;this.documentCompleted=false;this.root=null}XMLDocumentCB.prototype.createChildNode=function(e){var r,s,n,i,o,a,u,c;switch(e.type){case t.CData:this.cdata(e.value);break;case t.Comment:this.comment(e.value);break;case t.Element:n={};u=e.attribs;for(s in u){if(!R.call(u,s))continue;r=u[s];n[s]=r.value}this.node(e.name,n);break;case t.Dummy:this.dummy();break;case t.Raw:this.raw(e.value);break;case t.Text:this.text(e.value);break;case t.ProcessingInstruction:this.instruction(e.target,e.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+e.constructor.name)}c=e.children;for(o=0,a=c.length;o<a;o++){i=c[o];this.createChildNode(i);if(i.type===t.Element){this.up()}}return this};XMLDocumentCB.prototype.dummy=function(){return this};XMLDocumentCB.prototype.node=function(e,t,r){var s;if(e==null){throw new Error("Missing node name.")}if(this.root&&this.currentLevel===-1){throw new Error("Document can only have one root node. "+this.debugInfo(e))}this.openCurrent();e=b(e);if(t==null){t={}}t=b(t);if(!O(t)){s=[t,r],r=s[0],t=s[1]}this.currentNode=new m(this,e,t);this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;if(r!=null){this.text(r)}return this};XMLDocumentCB.prototype.element=function(e,r,s){var n,i,o,a,u,c;if(this.currentNode&&this.currentNode.type===t.DocType){this.dtdElement.apply(this,arguments)}else{if(Array.isArray(e)||O(e)||C(e)){a=this.options.noValidation;this.options.noValidation=true;c=new f(this.options).element("TEMP_ROOT");c.element(e);this.options.noValidation=a;u=c.children;for(i=0,o=u.length;i<o;i++){n=u[i];this.createChildNode(n);if(n.type===t.Element){this.up()}}}else{this.node(e,r,s)}}return this};XMLDocumentCB.prototype.attribute=function(e,t){var r,s;if(!this.currentNode||this.currentNode.children){throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(e))}if(e!=null){e=b(e)}if(O(e)){for(r in e){if(!R.call(e,r))continue;s=e[r];this.attribute(r,s)}}else{if(C(t)){t=t.apply()}if(this.options.keepNullAttributes&&t==null){this.currentNode.attribs[e]=new n(this,e,"")}else if(t!=null){this.currentNode.attribs[e]=new n(this,e,t)}}return this};XMLDocumentCB.prototype.text=function(e){var t;this.openCurrent();t=new w(this,e);this.onData(this.writer.text(t,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.cdata=function(e){var t;this.openCurrent();t=new i(this,e);this.onData(this.writer.cdata(t,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.comment=function(e){var t;this.openCurrent();t=new o(this,e);this.onData(this.writer.comment(t,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.raw=function(e){var t;this.openCurrent();t=new g(this,e);this.onData(this.writer.raw(t,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.instruction=function(e,t){var r,s,n,i,o;this.openCurrent();if(e!=null){e=b(e)}if(t!=null){t=b(t)}if(Array.isArray(e)){for(r=0,i=e.length;r<i;r++){s=e[r];this.instruction(s)}}else if(O(e)){for(s in e){if(!R.call(e,s))continue;n=e[s];this.instruction(s,n)}}else{if(C(t)){t=t.apply()}o=new y(this,e,t);this.onData(this.writer.processingInstruction(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1)}return this};XMLDocumentCB.prototype.declaration=function(e,t,r){var s;this.openCurrent();if(this.documentStarted){throw new Error("declaration() must be the first node.")}s=new l(this,e,t,r);this.onData(this.writer.declaration(s,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.doctype=function(e,t,r){this.openCurrent();if(e==null){throw new Error("Missing root node name.")}if(this.root){throw new Error("dtd() must come before the root node.")}this.currentNode=new p(this,t,r);this.currentNode.rootNodeName=e;this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;return this};XMLDocumentCB.prototype.dtdElement=function(e,t){var r;this.openCurrent();r=new u(this,e,t);this.onData(this.writer.dtdElement(r,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.attList=function(e,t,r,s,n){var i;this.openCurrent();i=new a(this,e,t,r,s,n);this.onData(this.writer.dtdAttList(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.entity=function(e,t){var r;this.openCurrent();r=new c(this,false,e,t);this.onData(this.writer.dtdEntity(r,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.pEntity=function(e,t){var r;this.openCurrent();r=new c(this,true,e,t);this.onData(this.writer.dtdEntity(r,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.notation=function(e,t){var r;this.openCurrent();r=new d(this,e,t);this.onData(this.writer.dtdNotation(r,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.up=function(){if(this.currentLevel<0){throw new Error("The document node has no parent.")}if(this.currentNode){if(this.currentNode.children){this.closeNode(this.currentNode)}else{this.openNode(this.currentNode)}this.currentNode=null}else{this.closeNode(this.openTags[this.currentLevel])}delete this.openTags[this.currentLevel];this.currentLevel--;return this};XMLDocumentCB.prototype.end=function(){while(this.currentLevel>=0){this.up()}return this.onEnd()};XMLDocumentCB.prototype.openCurrent=function(){if(this.currentNode){this.currentNode.children=true;return this.openNode(this.currentNode)}};XMLDocumentCB.prototype.openNode=function(e){var r,n,i,o;if(!e.isOpen){if(!this.root&&this.currentLevel===0&&e.type===t.Element){this.root=e}n="";if(e.type===t.Element){this.writerOptions.state=s.OpenTag;n=this.writer.indent(e,this.writerOptions,this.currentLevel)+"<"+e.name;o=e.attribs;for(i in o){if(!R.call(o,i))continue;r=o[i];n+=this.writer.attribute(r,this.writerOptions,this.currentLevel)}n+=(e.children?">":"/>")+this.writer.endline(e,this.writerOptions,this.currentLevel);this.writerOptions.state=s.InsideTag}else{this.writerOptions.state=s.OpenTag;n=this.writer.indent(e,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+e.rootNodeName;if(e.pubID&&e.sysID){n+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'}else if(e.sysID){n+=' SYSTEM "'+e.sysID+'"'}if(e.children){n+=" [";this.writerOptions.state=s.InsideTag}else{this.writerOptions.state=s.CloseTag;n+=">"}n+=this.writer.endline(e,this.writerOptions,this.currentLevel)}this.onData(n,this.currentLevel);return e.isOpen=true}};XMLDocumentCB.prototype.closeNode=function(e){var r;if(!e.isClosed){r="";this.writerOptions.state=s.CloseTag;if(e.type===t.Element){r=this.writer.indent(e,this.writerOptions,this.currentLevel)+"</"+e.name+">"+this.writer.endline(e,this.writerOptions,this.currentLevel)}else{r=this.writer.indent(e,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(e,this.writerOptions,this.currentLevel)}this.writerOptions.state=s.None;this.onData(r,this.currentLevel);return e.isClosed=true}};XMLDocumentCB.prototype.onData=function(e,t){this.documentStarted=true;return this.onDataCallback(e,t+1)};XMLDocumentCB.prototype.onEnd=function(){this.documentCompleted=true;return this.onEndCallback()};XMLDocumentCB.prototype.debugInfo=function(e){if(e==null){return""}else{return"node: <"+e+">"}};XMLDocumentCB.prototype.ele=function(){return this.element.apply(this,arguments)};XMLDocumentCB.prototype.nod=function(e,t,r){return this.node(e,t,r)};XMLDocumentCB.prototype.txt=function(e){return this.text(e)};XMLDocumentCB.prototype.dat=function(e){return this.cdata(e)};XMLDocumentCB.prototype.com=function(e){return this.comment(e)};XMLDocumentCB.prototype.ins=function(e,t){return this.instruction(e,t)};XMLDocumentCB.prototype.dec=function(e,t,r){return this.declaration(e,t,r)};XMLDocumentCB.prototype.dtd=function(e,t,r){return this.doctype(e,t,r)};XMLDocumentCB.prototype.e=function(e,t,r){return this.element(e,t,r)};XMLDocumentCB.prototype.n=function(e,t,r){return this.node(e,t,r)};XMLDocumentCB.prototype.t=function(e){return this.text(e)};XMLDocumentCB.prototype.d=function(e){return this.cdata(e)};XMLDocumentCB.prototype.c=function(e){return this.comment(e)};XMLDocumentCB.prototype.r=function(e){return this.raw(e)};XMLDocumentCB.prototype.i=function(e,t){return this.instruction(e,t)};XMLDocumentCB.prototype.att=function(){if(this.currentNode&&this.currentNode.type===t.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};XMLDocumentCB.prototype.a=function(){if(this.currentNode&&this.currentNode.type===t.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};XMLDocumentCB.prototype.ent=function(e,t){return this.entity(e,t)};XMLDocumentCB.prototype.pent=function(e,t){return this.pEntity(e,t)};XMLDocumentCB.prototype.not=function(e,t){return this.notation(e,t)};return XMLDocumentCB}()}).call(this)},3590:function(e,t,r){(function(){var t,s,n,extend=function(e,t){for(var r in t){if(i.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},i={}.hasOwnProperty;n=r(7608);t=r(9267);e.exports=s=function(e){extend(XMLDummy,e);function XMLDummy(e){XMLDummy.__super__.constructor.call(this,e);this.type=t.Dummy}XMLDummy.prototype.clone=function(){return Object.create(this)};XMLDummy.prototype.toString=function(e){return""};return XMLDummy}(n)}).call(this)},9437:function(e,t,r){(function(){var t,s,n,i,o,a,u,c,d,extend=function(e,t){for(var r in t){if(l.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},l={}.hasOwnProperty;d=r(8229),c=d.isObject,u=d.isFunction,a=d.getValue;o=r(7608);t=r(9267);s=r(8376);i=r(4361);e.exports=n=function(e){extend(XMLElement,e);function XMLElement(e,r,s){var n,i,o,a;XMLElement.__super__.constructor.call(this,e);if(r==null){throw new Error("Missing element name. "+this.debugInfo())}this.name=this.stringify.name(r);this.type=t.Element;this.attribs={};this.schemaTypeInfo=null;if(s!=null){this.attribute(s)}if(e.type===t.Document){this.isRoot=true;this.documentObject=e;e.rootObject=this;if(e.children){a=e.children;for(i=0,o=a.length;i<o;i++){n=a[i];if(n.type===t.DocType){n.name=this.name;break}}}}}Object.defineProperty(XMLElement.prototype,"tagName",{get:function(){return this.name}});Object.defineProperty(XMLElement.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(XMLElement.prototype,"prefix",{get:function(){return""}});Object.defineProperty(XMLElement.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(XMLElement.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"attributes",{get:function(){if(!this.attributeMap||!this.attributeMap.nodes){this.attributeMap=new i(this.attribs)}return this.attributeMap}});XMLElement.prototype.clone=function(){var e,t,r,s;r=Object.create(this);if(r.isRoot){r.documentObject=null}r.attribs={};s=this.attribs;for(t in s){if(!l.call(s,t))continue;e=s[t];r.attribs[t]=e.clone()}r.children=[];this.children.forEach((function(e){var t;t=e.clone();t.parent=r;return r.children.push(t)}));return r};XMLElement.prototype.attribute=function(e,t){var r,n;if(e!=null){e=a(e)}if(c(e)){for(r in e){if(!l.call(e,r))continue;n=e[r];this.attribute(r,n)}}else{if(u(t)){t=t.apply()}if(this.options.keepNullAttributes&&t==null){this.attribs[e]=new s(this,e,"")}else if(t!=null){this.attribs[e]=new s(this,e,t)}}return this};XMLElement.prototype.removeAttribute=function(e){var t,r,s;if(e==null){throw new Error("Missing attribute name. "+this.debugInfo())}e=a(e);if(Array.isArray(e)){for(r=0,s=e.length;r<s;r++){t=e[r];delete this.attribs[t]}}else{delete this.attribs[e]}return this};XMLElement.prototype.toString=function(e){return this.options.writer.element(this,this.options.writer.filterOptions(e))};XMLElement.prototype.att=function(e,t){return this.attribute(e,t)};XMLElement.prototype.a=function(e,t){return this.attribute(e,t)};XMLElement.prototype.getAttribute=function(e){if(this.attribs.hasOwnProperty(e)){return this.attribs[e].value}else{return null}};XMLElement.prototype.setAttribute=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getAttributeNode=function(e){if(this.attribs.hasOwnProperty(e)){return this.attribs[e]}else{return null}};XMLElement.prototype.setAttributeNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.removeAttributeNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagName=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getAttributeNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setAttributeNS=function(e,t,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.removeAttributeNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getAttributeNodeNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setAttributeNodeNS=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagNameNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.hasAttribute=function(e){return this.attribs.hasOwnProperty(e)};XMLElement.prototype.hasAttributeNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setIdAttribute=function(e,t){if(this.attribs.hasOwnProperty(e)){return this.attribs[e].isId}else{return t}};XMLElement.prototype.setIdAttributeNS=function(e,t,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setIdAttributeNode=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagName=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagNameNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByClassName=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.isEqualNode=function(e){var t,r,s;if(!XMLElement.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)){return false}if(e.namespaceURI!==this.namespaceURI){return false}if(e.prefix!==this.prefix){return false}if(e.localName!==this.localName){return false}if(e.attribs.length!==this.attribs.length){return false}for(t=r=0,s=this.attribs.length-1;0<=s?r<=s:r>=s;t=0<=s?++r:--r){if(!this.attribs[t].isEqualNode(e.attribs[t])){return false}}return true};return XMLElement}(o)}).call(this)},4361:function(e){(function(){var t;e.exports=t=function(){function XMLNamedNodeMap(e){this.nodes=e}Object.defineProperty(XMLNamedNodeMap.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}});XMLNamedNodeMap.prototype.clone=function(){return this.nodes=null};XMLNamedNodeMap.prototype.getNamedItem=function(e){return this.nodes[e]};XMLNamedNodeMap.prototype.setNamedItem=function(e){var t;t=this.nodes[e.nodeName];this.nodes[e.nodeName]=e;return t||null};XMLNamedNodeMap.prototype.removeNamedItem=function(e){var t;t=this.nodes[e];delete this.nodes[e];return t||null};XMLNamedNodeMap.prototype.item=function(e){return this.nodes[Object.keys(this.nodes)[e]]||null};XMLNamedNodeMap.prototype.getNamedItemNS=function(e,t){throw new Error("This DOM method is not implemented.")};XMLNamedNodeMap.prototype.setNamedItemNS=function(e){throw new Error("This DOM method is not implemented.")};XMLNamedNodeMap.prototype.removeNamedItemNS=function(e,t){throw new Error("This DOM method is not implemented.")};return XMLNamedNodeMap}()}).call(this)},7608:function(e,t,r){(function(){var t,s,n,i,o,a,u,c,d,l,p,f,h,m,y,g,S,T,w,b={}.hasOwnProperty;w=r(8229),T=w.isObject,S=w.isFunction,g=w.isEmpty,y=w.getValue;c=null;n=null;i=null;o=null;a=null;h=null;m=null;f=null;u=null;s=null;p=null;d=null;t=null;e.exports=l=function(){function XMLNode(e){this.parent=e;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}this.value=null;this.children=[];this.baseURI=null;if(!c){c=r(9437);n=r(333);i=r(4407);o=r(6364);a=r(1801);h=r(6329);m=r(1318);f=r(6939);u=r(3590);s=r(9267);p=r(6768);d=r(4361);t=r(2839)}}Object.defineProperty(XMLNode.prototype,"nodeName",{get:function(){return this.name}});Object.defineProperty(XMLNode.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(XMLNode.prototype,"nodeValue",{get:function(){return this.value}});Object.defineProperty(XMLNode.prototype,"parentNode",{get:function(){return this.parent}});Object.defineProperty(XMLNode.prototype,"childNodes",{get:function(){if(!this.childNodeList||!this.childNodeList.nodes){this.childNodeList=new p(this.children)}return this.childNodeList}});Object.defineProperty(XMLNode.prototype,"firstChild",{get:function(){return this.children[0]||null}});Object.defineProperty(XMLNode.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}});Object.defineProperty(XMLNode.prototype,"previousSibling",{get:function(){var e;e=this.parent.children.indexOf(this);return this.parent.children[e-1]||null}});Object.defineProperty(XMLNode.prototype,"nextSibling",{get:function(){var e;e=this.parent.children.indexOf(this);return this.parent.children[e+1]||null}});Object.defineProperty(XMLNode.prototype,"ownerDocument",{get:function(){return this.document()||null}});Object.defineProperty(XMLNode.prototype,"textContent",{get:function(){var e,t,r,n,i;if(this.nodeType===s.Element||this.nodeType===s.DocumentFragment){i="";n=this.children;for(t=0,r=n.length;t<r;t++){e=n[t];if(e.textContent){i+=e.textContent}}return i}else{return null}},set:function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}});XMLNode.prototype.setParent=function(e){var t,r,s,n,i;this.parent=e;if(e){this.options=e.options;this.stringify=e.stringify}n=this.children;i=[];for(r=0,s=n.length;r<s;r++){t=n[r];i.push(t.setParent(this))}return i};XMLNode.prototype.element=function(e,t,r){var s,n,i,o,a,u,c,d,l,p,f;u=null;if(t===null&&r==null){l=[{},null],t=l[0],r=l[1]}if(t==null){t={}}t=y(t);if(!T(t)){p=[t,r],r=p[0],t=p[1]}if(e!=null){e=y(e)}if(Array.isArray(e)){for(i=0,c=e.length;i<c;i++){n=e[i];u=this.element(n)}}else if(S(e)){u=this.element(e.apply())}else if(T(e)){for(a in e){if(!b.call(e,a))continue;f=e[a];if(S(f)){f=f.apply()}if(!this.options.ignoreDecorators&&this.stringify.convertAttKey&&a.indexOf(this.stringify.convertAttKey)===0){u=this.attribute(a.substr(this.stringify.convertAttKey.length),f)}else if(!this.options.separateArrayItems&&Array.isArray(f)&&g(f)){u=this.dummy()}else if(T(f)&&g(f)){u=this.element(a)}else if(!this.options.keepNullNodes&&f==null){u=this.dummy()}else if(!this.options.separateArrayItems&&Array.isArray(f)){for(o=0,d=f.length;o<d;o++){n=f[o];s={};s[a]=n;u=this.element(s)}}else if(T(f)){if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&a.indexOf(this.stringify.convertTextKey)===0){u=this.element(f)}else{u=this.element(a);u.element(f)}}else{u=this.element(a,f)}}}else if(!this.options.keepNullNodes&&r===null){u=this.dummy()}else{if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&e.indexOf(this.stringify.convertTextKey)===0){u=this.text(r)}else if(!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&e.indexOf(this.stringify.convertCDataKey)===0){u=this.cdata(r)}else if(!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&e.indexOf(this.stringify.convertCommentKey)===0){u=this.comment(r)}else if(!this.options.ignoreDecorators&&this.stringify.convertRawKey&&e.indexOf(this.stringify.convertRawKey)===0){u=this.raw(r)}else if(!this.options.ignoreDecorators&&this.stringify.convertPIKey&&e.indexOf(this.stringify.convertPIKey)===0){u=this.instruction(e.substr(this.stringify.convertPIKey.length),r)}else{u=this.node(e,t,r)}}if(u==null){throw new Error("Could not create any elements with: "+e+". "+this.debugInfo())}return u};XMLNode.prototype.insertBefore=function(e,t,r){var s,n,i,o,a;if(e!=null?e.type:void 0){i=e;o=t;i.setParent(this);if(o){n=children.indexOf(o);a=children.splice(n);children.push(i);Array.prototype.push.apply(children,a)}else{children.push(i)}return i}else{if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(e))}n=this.parent.children.indexOf(this);a=this.parent.children.splice(n);s=this.parent.element(e,t,r);Array.prototype.push.apply(this.parent.children,a);return s}};XMLNode.prototype.insertAfter=function(e,t,r){var s,n,i;if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(e))}n=this.parent.children.indexOf(this);i=this.parent.children.splice(n+1);s=this.parent.element(e,t,r);Array.prototype.push.apply(this.parent.children,i);return s};XMLNode.prototype.remove=function(){var e,t;if(this.isRoot){throw new Error("Cannot remove the root element. "+this.debugInfo())}e=this.parent.children.indexOf(this);[].splice.apply(this.parent.children,[e,e-e+1].concat(t=[])),t;return this.parent};XMLNode.prototype.node=function(e,t,r){var s,n;if(e!=null){e=y(e)}t||(t={});t=y(t);if(!T(t)){n=[t,r],r=n[0],t=n[1]}s=new c(this,e,t);if(r!=null){s.text(r)}this.children.push(s);return s};XMLNode.prototype.text=function(e){var t;if(T(e)){this.element(e)}t=new m(this,e);this.children.push(t);return this};XMLNode.prototype.cdata=function(e){var t;t=new n(this,e);this.children.push(t);return this};XMLNode.prototype.comment=function(e){var t;t=new i(this,e);this.children.push(t);return this};XMLNode.prototype.commentBefore=function(e){var t,r,s;r=this.parent.children.indexOf(this);s=this.parent.children.splice(r);t=this.parent.comment(e);Array.prototype.push.apply(this.parent.children,s);return this};XMLNode.prototype.commentAfter=function(e){var t,r,s;r=this.parent.children.indexOf(this);s=this.parent.children.splice(r+1);t=this.parent.comment(e);Array.prototype.push.apply(this.parent.children,s);return this};XMLNode.prototype.raw=function(e){var t;t=new h(this,e);this.children.push(t);return this};XMLNode.prototype.dummy=function(){var e;e=new u(this);return e};XMLNode.prototype.instruction=function(e,t){var r,s,n,i,o;if(e!=null){e=y(e)}if(t!=null){t=y(t)}if(Array.isArray(e)){for(i=0,o=e.length;i<o;i++){r=e[i];this.instruction(r)}}else if(T(e)){for(r in e){if(!b.call(e,r))continue;s=e[r];this.instruction(r,s)}}else{if(S(t)){t=t.apply()}n=new f(this,e,t);this.children.push(n)}return this};XMLNode.prototype.instructionBefore=function(e,t){var r,s,n;s=this.parent.children.indexOf(this);n=this.parent.children.splice(s);r=this.parent.instruction(e,t);Array.prototype.push.apply(this.parent.children,n);return this};XMLNode.prototype.instructionAfter=function(e,t){var r,s,n;s=this.parent.children.indexOf(this);n=this.parent.children.splice(s+1);r=this.parent.instruction(e,t);Array.prototype.push.apply(this.parent.children,n);return this};XMLNode.prototype.declaration=function(e,t,r){var n,i;n=this.document();i=new o(n,e,t,r);if(n.children.length===0){n.children.unshift(i)}else if(n.children[0].type===s.Declaration){n.children[0]=i}else{n.children.unshift(i)}return n.root()||n};XMLNode.prototype.dtd=function(e,t){var r,n,i,o,u,c,d,l,p,f;n=this.document();i=new a(n,e,t);p=n.children;for(o=u=0,d=p.length;u<d;o=++u){r=p[o];if(r.type===s.DocType){n.children[o]=i;return i}}f=n.children;for(o=c=0,l=f.length;c<l;o=++c){r=f[o];if(r.isRoot){n.children.splice(o,0,i);return i}}n.children.push(i);return i};XMLNode.prototype.up=function(){if(this.isRoot){throw new Error("The root node has no parent. Use doc() if you need to get the document object.")}return this.parent};XMLNode.prototype.root=function(){var e;e=this;while(e){if(e.type===s.Document){return e.rootObject}else if(e.isRoot){return e}else{e=e.parent}}};XMLNode.prototype.document=function(){var e;e=this;while(e){if(e.type===s.Document){return e}else{e=e.parent}}};XMLNode.prototype.end=function(e){return this.document().end(e)};XMLNode.prototype.prev=function(){var e;e=this.parent.children.indexOf(this);if(e<1){throw new Error("Already at the first node. "+this.debugInfo())}return this.parent.children[e-1]};XMLNode.prototype.next=function(){var e;e=this.parent.children.indexOf(this);if(e===-1||e===this.parent.children.length-1){throw new Error("Already at the last node. "+this.debugInfo())}return this.parent.children[e+1]};XMLNode.prototype.importDocument=function(e){var t;t=e.root().clone();t.parent=this;t.isRoot=false;this.children.push(t);return this};XMLNode.prototype.debugInfo=function(e){var t,r;e=e||this.name;if(e==null&&!((t=this.parent)!=null?t.name:void 0)){return""}else if(e==null){return"parent: <"+this.parent.name+">"}else if(!((r=this.parent)!=null?r.name:void 0)){return"node: <"+e+">"}else{return"node: <"+e+">, parent: <"+this.parent.name+">"}};XMLNode.prototype.ele=function(e,t,r){return this.element(e,t,r)};XMLNode.prototype.nod=function(e,t,r){return this.node(e,t,r)};XMLNode.prototype.txt=function(e){return this.text(e)};XMLNode.prototype.dat=function(e){return this.cdata(e)};XMLNode.prototype.com=function(e){return this.comment(e)};XMLNode.prototype.ins=function(e,t){return this.instruction(e,t)};XMLNode.prototype.doc=function(){return this.document()};XMLNode.prototype.dec=function(e,t,r){return this.declaration(e,t,r)};XMLNode.prototype.e=function(e,t,r){return this.element(e,t,r)};XMLNode.prototype.n=function(e,t,r){return this.node(e,t,r)};XMLNode.prototype.t=function(e){return this.text(e)};XMLNode.prototype.d=function(e){return this.cdata(e)};XMLNode.prototype.c=function(e){return this.comment(e)};XMLNode.prototype.r=function(e){return this.raw(e)};XMLNode.prototype.i=function(e,t){return this.instruction(e,t)};XMLNode.prototype.u=function(){return this.up()};XMLNode.prototype.importXMLBuilder=function(e){return this.importDocument(e)};XMLNode.prototype.replaceChild=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.removeChild=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.appendChild=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.hasChildNodes=function(){return this.children.length!==0};XMLNode.prototype.cloneNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isSupported=function(e,t){return true};XMLNode.prototype.hasAttributes=function(){return this.attribs.length!==0};XMLNode.prototype.compareDocumentPosition=function(e){var r,s;r=this;if(r===e){return 0}else if(this.document()!==e.document()){s=t.Disconnected|t.ImplementationSpecific;if(Math.random()<.5){s|=t.Preceding}else{s|=t.Following}return s}else if(r.isAncestor(e)){return t.Contains|t.Preceding}else if(r.isDescendant(e)){return t.Contains|t.Following}else if(r.isPreceding(e)){return t.Preceding}else{return t.Following}};XMLNode.prototype.isSameNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.lookupPrefix=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isDefaultNamespace=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.lookupNamespaceURI=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isEqualNode=function(e){var t,r,s;if(e.nodeType!==this.nodeType){return false}if(e.children.length!==this.children.length){return false}for(t=r=0,s=this.children.length-1;0<=s?r<=s:r>=s;t=0<=s?++r:--r){if(!this.children[t].isEqualNode(e.children[t])){return false}}return true};XMLNode.prototype.getFeature=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.setUserData=function(e,t,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.getUserData=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.contains=function(e){if(!e){return false}return e===this||this.isDescendant(e)};XMLNode.prototype.isDescendant=function(e){var t,r,s,n,i;i=this.children;for(s=0,n=i.length;s<n;s++){t=i[s];if(e===t){return true}r=t.isDescendant(e);if(r){return true}}return false};XMLNode.prototype.isAncestor=function(e){return e.isDescendant(this)};XMLNode.prototype.isPreceding=function(e){var t,r;t=this.treePosition(e);r=this.treePosition(this);if(t===-1||r===-1){return false}else{return t<r}};XMLNode.prototype.isFollowing=function(e){var t,r;t=this.treePosition(e);r=this.treePosition(this);if(t===-1||r===-1){return false}else{return t>r}};XMLNode.prototype.treePosition=function(e){var t,r;r=0;t=false;this.foreachTreeNode(this.document(),(function(s){r++;if(!t&&s===e){return t=true}}));if(t){return r}else{return-1}};XMLNode.prototype.foreachTreeNode=function(e,t){var r,s,n,i,o;e||(e=this.document());i=e.children;for(s=0,n=i.length;s<n;s++){r=i[s];if(o=t(r)){return o}else{o=this.foreachTreeNode(r,t);if(o){return o}}}};return XMLNode}()}).call(this)},6768:function(e){(function(){var t;e.exports=t=function(){function XMLNodeList(e){this.nodes=e}Object.defineProperty(XMLNodeList.prototype,"length",{get:function(){return this.nodes.length||0}});XMLNodeList.prototype.clone=function(){return this.nodes=null};XMLNodeList.prototype.item=function(e){return this.nodes[e]||null};return XMLNodeList}()}).call(this)},6939:function(e,t,r){(function(){var t,s,n,extend=function(e,t){for(var r in t){if(i.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},i={}.hasOwnProperty;t=r(9267);s=r(7709);e.exports=n=function(e){extend(XMLProcessingInstruction,e);function XMLProcessingInstruction(e,r,s){XMLProcessingInstruction.__super__.constructor.call(this,e);if(r==null){throw new Error("Missing instruction target. "+this.debugInfo())}this.type=t.ProcessingInstruction;this.target=this.stringify.insTarget(r);this.name=this.target;if(s){this.value=this.stringify.insValue(s)}}XMLProcessingInstruction.prototype.clone=function(){return Object.create(this)};XMLProcessingInstruction.prototype.toString=function(e){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(e))};XMLProcessingInstruction.prototype.isEqualNode=function(e){if(!XMLProcessingInstruction.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)){return false}if(e.target!==this.target){return false}return true};return XMLProcessingInstruction}(s)}).call(this)},6329:function(e,t,r){(function(){var t,s,n,extend=function(e,t){for(var r in t){if(i.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},i={}.hasOwnProperty;t=r(9267);s=r(7608);e.exports=n=function(e){extend(XMLRaw,e);function XMLRaw(e,r){XMLRaw.__super__.constructor.call(this,e);if(r==null){throw new Error("Missing raw text. "+this.debugInfo())}this.type=t.Raw;this.value=this.stringify.raw(r)}XMLRaw.prototype.clone=function(){return Object.create(this)};XMLRaw.prototype.toString=function(e){return this.options.writer.raw(this,this.options.writer.filterOptions(e))};return XMLRaw}(s)}).call(this)},8601:function(e,t,r){(function(){var t,s,n,i,extend=function(e,t){for(var r in t){if(o.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},o={}.hasOwnProperty;t=r(9267);i=r(6752);s=r(9766);e.exports=n=function(e){extend(XMLStreamWriter,e);function XMLStreamWriter(e,t){this.stream=e;XMLStreamWriter.__super__.constructor.call(this,t)}XMLStreamWriter.prototype.endline=function(e,t,r){if(e.isLastRootNode&&t.state===s.CloseTag){return""}else{return XMLStreamWriter.__super__.endline.call(this,e,t,r)}};XMLStreamWriter.prototype.document=function(e,t){var r,s,n,i,o,a,u,c,d;u=e.children;for(s=n=0,o=u.length;n<o;s=++n){r=u[s];r.isLastRootNode=s===e.children.length-1}t=this.filterOptions(t);c=e.children;d=[];for(i=0,a=c.length;i<a;i++){r=c[i];d.push(this.writeChildNode(r,t,0))}return d};XMLStreamWriter.prototype.attribute=function(e,t,r){return this.stream.write(XMLStreamWriter.__super__.attribute.call(this,e,t,r))};XMLStreamWriter.prototype.cdata=function(e,t,r){return this.stream.write(XMLStreamWriter.__super__.cdata.call(this,e,t,r))};XMLStreamWriter.prototype.comment=function(e,t,r){return this.stream.write(XMLStreamWriter.__super__.comment.call(this,e,t,r))};XMLStreamWriter.prototype.declaration=function(e,t,r){return this.stream.write(XMLStreamWriter.__super__.declaration.call(this,e,t,r))};XMLStreamWriter.prototype.docType=function(e,t,r){var n,i,o,a;r||(r=0);this.openNode(e,t,r);t.state=s.OpenTag;this.stream.write(this.indent(e,t,r));this.stream.write("<!DOCTYPE "+e.root().name);if(e.pubID&&e.sysID){this.stream.write(' PUBLIC "'+e.pubID+'" "'+e.sysID+'"')}else if(e.sysID){this.stream.write(' SYSTEM "'+e.sysID+'"')}if(e.children.length>0){this.stream.write(" [");this.stream.write(this.endline(e,t,r));t.state=s.InsideTag;a=e.children;for(i=0,o=a.length;i<o;i++){n=a[i];this.writeChildNode(n,t,r+1)}t.state=s.CloseTag;this.stream.write("]")}t.state=s.CloseTag;this.stream.write(t.spaceBeforeSlash+">");this.stream.write(this.endline(e,t,r));t.state=s.None;return this.closeNode(e,t,r)};XMLStreamWriter.prototype.element=function(e,r,n){var i,a,u,c,d,l,p,f,h,m;n||(n=0);this.openNode(e,r,n);r.state=s.OpenTag;this.stream.write(this.indent(e,r,n)+"<"+e.name);h=e.attribs;for(p in h){if(!o.call(h,p))continue;i=h[p];this.attribute(i,r,n)}u=e.children.length;c=u===0?null:e.children[0];if(u===0||e.children.every((function(e){return(e.type===t.Text||e.type===t.Raw)&&e.value===""}))){if(r.allowEmpty){this.stream.write(">");r.state=s.CloseTag;this.stream.write("</"+e.name+">")}else{r.state=s.CloseTag;this.stream.write(r.spaceBeforeSlash+"/>")}}else if(r.pretty&&u===1&&(c.type===t.Text||c.type===t.Raw)&&c.value!=null){this.stream.write(">");r.state=s.InsideTag;r.suppressPrettyCount++;f=true;this.writeChildNode(c,r,n+1);r.suppressPrettyCount--;f=false;r.state=s.CloseTag;this.stream.write("</"+e.name+">")}else{this.stream.write(">"+this.endline(e,r,n));r.state=s.InsideTag;m=e.children;for(d=0,l=m.length;d<l;d++){a=m[d];this.writeChildNode(a,r,n+1)}r.state=s.CloseTag;this.stream.write(this.indent(e,r,n)+"</"+e.name+">")}this.stream.write(this.endline(e,r,n));r.state=s.None;return this.closeNode(e,r,n)};XMLStreamWriter.prototype.processingInstruction=function(e,t,r){return this.stream.write(XMLStreamWriter.__super__.processingInstruction.call(this,e,t,r))};XMLStreamWriter.prototype.raw=function(e,t,r){return this.stream.write(XMLStreamWriter.__super__.raw.call(this,e,t,r))};XMLStreamWriter.prototype.text=function(e,t,r){return this.stream.write(XMLStreamWriter.__super__.text.call(this,e,t,r))};XMLStreamWriter.prototype.dtdAttList=function(e,t,r){return this.stream.write(XMLStreamWriter.__super__.dtdAttList.call(this,e,t,r))};XMLStreamWriter.prototype.dtdElement=function(e,t,r){return this.stream.write(XMLStreamWriter.__super__.dtdElement.call(this,e,t,r))};XMLStreamWriter.prototype.dtdEntity=function(e,t,r){return this.stream.write(XMLStreamWriter.__super__.dtdEntity.call(this,e,t,r))};XMLStreamWriter.prototype.dtdNotation=function(e,t,r){return this.stream.write(XMLStreamWriter.__super__.dtdNotation.call(this,e,t,r))};return XMLStreamWriter}(i)}).call(this)},5913:function(e,t,r){(function(){var t,s,extend=function(e,t){for(var r in t){if(n.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},n={}.hasOwnProperty;s=r(6752);e.exports=t=function(e){extend(XMLStringWriter,e);function XMLStringWriter(e){XMLStringWriter.__super__.constructor.call(this,e)}XMLStringWriter.prototype.document=function(e,t){var r,s,n,i,o;t=this.filterOptions(t);i="";o=e.children;for(s=0,n=o.length;s<n;s++){r=o[s];i+=this.writeChildNode(r,t,0)}if(t.pretty&&i.slice(-t.newline.length)===t.newline){i=i.slice(0,-t.newline.length)}return i};return XMLStringWriter}(s)}).call(this)},8594:function(e){(function(){var t,bind=function(e,t){return function(){return e.apply(t,arguments)}},r={}.hasOwnProperty;e.exports=t=function(){function XMLStringifier(e){this.assertLegalName=bind(this.assertLegalName,this);this.assertLegalChar=bind(this.assertLegalChar,this);var t,s,n;e||(e={});this.options=e;if(!this.options.version){this.options.version="1.0"}s=e.stringify||{};for(t in s){if(!r.call(s,t))continue;n=s[t];this[t]=n}}XMLStringifier.prototype.name=function(e){if(this.options.noValidation){return e}return this.assertLegalName(""+e||"")};XMLStringifier.prototype.text=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(this.textEscape(""+e||""))};XMLStringifier.prototype.cdata=function(e){if(this.options.noValidation){return e}e=""+e||"";e=e.replace("]]>","]]]]><![CDATA[>");return this.assertLegalChar(e)};XMLStringifier.prototype.comment=function(e){if(this.options.noValidation){return e}e=""+e||"";if(e.match(/--/)){throw new Error("Comment text cannot contain double-hypen: "+e)}return this.assertLegalChar(e)};XMLStringifier.prototype.raw=function(e){if(this.options.noValidation){return e}return""+e||""};XMLStringifier.prototype.attValue=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(this.attEscape(e=""+e||""))};XMLStringifier.prototype.insTarget=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.insValue=function(e){if(this.options.noValidation){return e}e=""+e||"";if(e.match(/\?>/)){throw new Error("Invalid processing instruction value: "+e)}return this.assertLegalChar(e)};XMLStringifier.prototype.xmlVersion=function(e){if(this.options.noValidation){return e}e=""+e||"";if(!e.match(/1\.[0-9]+/)){throw new Error("Invalid version number: "+e)}return e};XMLStringifier.prototype.xmlEncoding=function(e){if(this.options.noValidation){return e}e=""+e||"";if(!e.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)){throw new Error("Invalid encoding: "+e)}return this.assertLegalChar(e)};XMLStringifier.prototype.xmlStandalone=function(e){if(this.options.noValidation){return e}if(e){return"yes"}else{return"no"}};XMLStringifier.prototype.dtdPubID=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdSysID=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdElementValue=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdAttType=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdAttDefault=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdEntityValue=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdNData=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.convertAttKey="@";XMLStringifier.prototype.convertPIKey="?";XMLStringifier.prototype.convertTextKey="#text";XMLStringifier.prototype.convertCDataKey="#cdata";XMLStringifier.prototype.convertCommentKey="#comment";XMLStringifier.prototype.convertRawKey="#raw";XMLStringifier.prototype.assertLegalChar=function(e){var t,r;if(this.options.noValidation){return e}t="";if(this.options.version==="1.0"){t=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(r=e.match(t)){throw new Error("Invalid character in string: "+e+" at index "+r.index)}}else if(this.options.version==="1.1"){t=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(r=e.match(t)){throw new Error("Invalid character in string: "+e+" at index "+r.index)}}return e};XMLStringifier.prototype.assertLegalName=function(e){var t;if(this.options.noValidation){return e}this.assertLegalChar(e);t=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/;if(!e.match(t)){throw new Error("Invalid character in name")}return e};XMLStringifier.prototype.textEscape=function(e){var t;if(this.options.noValidation){return e}t=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return e.replace(t,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;")};XMLStringifier.prototype.attEscape=function(e){var t;if(this.options.noValidation){return e}t=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return e.replace(t,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;")};return XMLStringifier}()}).call(this)},1318:function(e,t,r){(function(){var t,s,n,extend=function(e,t){for(var r in t){if(i.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},i={}.hasOwnProperty;t=r(9267);s=r(7709);e.exports=n=function(e){extend(XMLText,e);function XMLText(e,r){XMLText.__super__.constructor.call(this,e);if(r==null){throw new Error("Missing element text. "+this.debugInfo())}this.name="#text";this.type=t.Text;this.value=this.stringify.text(r)}Object.defineProperty(XMLText.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLText.prototype,"wholeText",{get:function(){var e,t,r;r="";t=this.previousSibling;while(t){r=t.data+r;t=t.previousSibling}r+=this.data;e=this.nextSibling;while(e){r=r+e.data;e=e.nextSibling}return r}});XMLText.prototype.clone=function(){return Object.create(this)};XMLText.prototype.toString=function(e){return this.options.writer.text(this,this.options.writer.filterOptions(e))};XMLText.prototype.splitText=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLText.prototype.replaceWholeText=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};return XMLText}(s)}).call(this)},6752:function(e,t,r){(function(){var t,s,n,i,o,a,u,c,d,l,p,f,h,m,y,g,S,T={}.hasOwnProperty;S=r(8229).assign;t=r(9267);d=r(6364);l=r(1801);n=r(333);i=r(4407);f=r(9437);m=r(6329);y=r(1318);h=r(6939);p=r(3590);o=r(1015);a=r(2421);u=r(53);c=r(2837);s=r(9766);e.exports=g=function(){function XMLWriterBase(e){var t,r,s;e||(e={});this.options=e;r=e.writer||{};for(t in r){if(!T.call(r,t))continue;s=r[t];this["_"+t]=this[t];this[t]=s}}XMLWriterBase.prototype.filterOptions=function(e){var t,r,n,i,o,a,u,c;e||(e={});e=S({},this.options,e);t={writer:this};t.pretty=e.pretty||false;t.allowEmpty=e.allowEmpty||false;t.indent=(r=e.indent)!=null?r:" ";t.newline=(n=e.newline)!=null?n:"\n";t.offset=(i=e.offset)!=null?i:0;t.dontPrettyTextNodes=(o=(a=e.dontPrettyTextNodes)!=null?a:e.dontprettytextnodes)!=null?o:0;t.spaceBeforeSlash=(u=(c=e.spaceBeforeSlash)!=null?c:e.spacebeforeslash)!=null?u:"";if(t.spaceBeforeSlash===true){t.spaceBeforeSlash=" "}t.suppressPrettyCount=0;t.user={};t.state=s.None;return t};XMLWriterBase.prototype.indent=function(e,t,r){var s;if(!t.pretty||t.suppressPrettyCount){return""}else if(t.pretty){s=(r||0)+t.offset+1;if(s>0){return new Array(s).join(t.indent)}}return""};XMLWriterBase.prototype.endline=function(e,t,r){if(!t.pretty||t.suppressPrettyCount){return""}else{return t.newline}};XMLWriterBase.prototype.attribute=function(e,t,r){var s;this.openAttribute(e,t,r);s=" "+e.name+'="'+e.value+'"';this.closeAttribute(e,t,r);return s};XMLWriterBase.prototype.cdata=function(e,t,r){var n;this.openNode(e,t,r);t.state=s.OpenTag;n=this.indent(e,t,r)+"<![CDATA[";t.state=s.InsideTag;n+=e.value;t.state=s.CloseTag;n+="]]>"+this.endline(e,t,r);t.state=s.None;this.closeNode(e,t,r);return n};XMLWriterBase.prototype.comment=function(e,t,r){var n;this.openNode(e,t,r);t.state=s.OpenTag;n=this.indent(e,t,r)+"\x3c!-- ";t.state=s.InsideTag;n+=e.value;t.state=s.CloseTag;n+=" --\x3e"+this.endline(e,t,r);t.state=s.None;this.closeNode(e,t,r);return n};XMLWriterBase.prototype.declaration=function(e,t,r){var n;this.openNode(e,t,r);t.state=s.OpenTag;n=this.indent(e,t,r)+"<?xml";t.state=s.InsideTag;n+=' version="'+e.version+'"';if(e.encoding!=null){n+=' encoding="'+e.encoding+'"'}if(e.standalone!=null){n+=' standalone="'+e.standalone+'"'}t.state=s.CloseTag;n+=t.spaceBeforeSlash+"?>";n+=this.endline(e,t,r);t.state=s.None;this.closeNode(e,t,r);return n};XMLWriterBase.prototype.docType=function(e,t,r){var n,i,o,a,u;r||(r=0);this.openNode(e,t,r);t.state=s.OpenTag;a=this.indent(e,t,r);a+="<!DOCTYPE "+e.root().name;if(e.pubID&&e.sysID){a+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'}else if(e.sysID){a+=' SYSTEM "'+e.sysID+'"'}if(e.children.length>0){a+=" [";a+=this.endline(e,t,r);t.state=s.InsideTag;u=e.children;for(i=0,o=u.length;i<o;i++){n=u[i];a+=this.writeChildNode(n,t,r+1)}t.state=s.CloseTag;a+="]"}t.state=s.CloseTag;a+=t.spaceBeforeSlash+">";a+=this.endline(e,t,r);t.state=s.None;this.closeNode(e,t,r);return a};XMLWriterBase.prototype.element=function(e,r,n){var i,o,a,u,c,d,l,p,f,h,m,y,g,S;n||(n=0);h=false;m="";this.openNode(e,r,n);r.state=s.OpenTag;m+=this.indent(e,r,n)+"<"+e.name;y=e.attribs;for(f in y){if(!T.call(y,f))continue;i=y[f];m+=this.attribute(i,r,n)}a=e.children.length;u=a===0?null:e.children[0];if(a===0||e.children.every((function(e){return(e.type===t.Text||e.type===t.Raw)&&e.value===""}))){if(r.allowEmpty){m+=">";r.state=s.CloseTag;m+="</"+e.name+">"+this.endline(e,r,n)}else{r.state=s.CloseTag;m+=r.spaceBeforeSlash+"/>"+this.endline(e,r,n)}}else if(r.pretty&&a===1&&(u.type===t.Text||u.type===t.Raw)&&u.value!=null){m+=">";r.state=s.InsideTag;r.suppressPrettyCount++;h=true;m+=this.writeChildNode(u,r,n+1);r.suppressPrettyCount--;h=false;r.state=s.CloseTag;m+="</"+e.name+">"+this.endline(e,r,n)}else{if(r.dontPrettyTextNodes){g=e.children;for(c=0,l=g.length;c<l;c++){o=g[c];if((o.type===t.Text||o.type===t.Raw)&&o.value!=null){r.suppressPrettyCount++;h=true;break}}}m+=">"+this.endline(e,r,n);r.state=s.InsideTag;S=e.children;for(d=0,p=S.length;d<p;d++){o=S[d];m+=this.writeChildNode(o,r,n+1)}r.state=s.CloseTag;m+=this.indent(e,r,n)+"</"+e.name+">";if(h){r.suppressPrettyCount--}m+=this.endline(e,r,n);r.state=s.None}this.closeNode(e,r,n);return m};XMLWriterBase.prototype.writeChildNode=function(e,r,s){switch(e.type){case t.CData:return this.cdata(e,r,s);case t.Comment:return this.comment(e,r,s);case t.Element:return this.element(e,r,s);case t.Raw:return this.raw(e,r,s);case t.Text:return this.text(e,r,s);case t.ProcessingInstruction:return this.processingInstruction(e,r,s);case t.Dummy:return"";case t.Declaration:return this.declaration(e,r,s);case t.DocType:return this.docType(e,r,s);case t.AttributeDeclaration:return this.dtdAttList(e,r,s);case t.ElementDeclaration:return this.dtdElement(e,r,s);case t.EntityDeclaration:return this.dtdEntity(e,r,s);case t.NotationDeclaration:return this.dtdNotation(e,r,s);default:throw new Error("Unknown XML node type: "+e.constructor.name)}};XMLWriterBase.prototype.processingInstruction=function(e,t,r){var n;this.openNode(e,t,r);t.state=s.OpenTag;n=this.indent(e,t,r)+"<?";t.state=s.InsideTag;n+=e.target;if(e.value){n+=" "+e.value}t.state=s.CloseTag;n+=t.spaceBeforeSlash+"?>";n+=this.endline(e,t,r);t.state=s.None;this.closeNode(e,t,r);return n};XMLWriterBase.prototype.raw=function(e,t,r){var n;this.openNode(e,t,r);t.state=s.OpenTag;n=this.indent(e,t,r);t.state=s.InsideTag;n+=e.value;t.state=s.CloseTag;n+=this.endline(e,t,r);t.state=s.None;this.closeNode(e,t,r);return n};XMLWriterBase.prototype.text=function(e,t,r){var n;this.openNode(e,t,r);t.state=s.OpenTag;n=this.indent(e,t,r);t.state=s.InsideTag;n+=e.value;t.state=s.CloseTag;n+=this.endline(e,t,r);t.state=s.None;this.closeNode(e,t,r);return n};XMLWriterBase.prototype.dtdAttList=function(e,t,r){var n;this.openNode(e,t,r);t.state=s.OpenTag;n=this.indent(e,t,r)+"<!ATTLIST";t.state=s.InsideTag;n+=" "+e.elementName+" "+e.attributeName+" "+e.attributeType;if(e.defaultValueType!=="#DEFAULT"){n+=" "+e.defaultValueType}if(e.defaultValue){n+=' "'+e.defaultValue+'"'}t.state=s.CloseTag;n+=t.spaceBeforeSlash+">"+this.endline(e,t,r);t.state=s.None;this.closeNode(e,t,r);return n};XMLWriterBase.prototype.dtdElement=function(e,t,r){var n;this.openNode(e,t,r);t.state=s.OpenTag;n=this.indent(e,t,r)+"<!ELEMENT";t.state=s.InsideTag;n+=" "+e.name+" "+e.value;t.state=s.CloseTag;n+=t.spaceBeforeSlash+">"+this.endline(e,t,r);t.state=s.None;this.closeNode(e,t,r);return n};XMLWriterBase.prototype.dtdEntity=function(e,t,r){var n;this.openNode(e,t,r);t.state=s.OpenTag;n=this.indent(e,t,r)+"<!ENTITY";t.state=s.InsideTag;if(e.pe){n+=" %"}n+=" "+e.name;if(e.value){n+=' "'+e.value+'"'}else{if(e.pubID&&e.sysID){n+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'}else if(e.sysID){n+=' SYSTEM "'+e.sysID+'"'}if(e.nData){n+=" NDATA "+e.nData}}t.state=s.CloseTag;n+=t.spaceBeforeSlash+">"+this.endline(e,t,r);t.state=s.None;this.closeNode(e,t,r);return n};XMLWriterBase.prototype.dtdNotation=function(e,t,r){var n;this.openNode(e,t,r);t.state=s.OpenTag;n=this.indent(e,t,r)+"<!NOTATION";t.state=s.InsideTag;n+=" "+e.name;if(e.pubID&&e.sysID){n+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'}else if(e.pubID){n+=' PUBLIC "'+e.pubID+'"'}else if(e.sysID){n+=' SYSTEM "'+e.sysID+'"'}t.state=s.CloseTag;n+=t.spaceBeforeSlash+">"+this.endline(e,t,r);t.state=s.None;this.closeNode(e,t,r);return n};XMLWriterBase.prototype.openNode=function(e,t,r){};XMLWriterBase.prototype.closeNode=function(e,t,r){};XMLWriterBase.prototype.openAttribute=function(e,t,r){};XMLWriterBase.prototype.closeAttribute=function(e,t,r){};return XMLWriterBase}()}).call(this)},2958:function(e,t,r){(function(){var t,s,n,i,o,a,u,c,d,l;l=r(8229),c=l.assign,d=l.isFunction;n=r(8310);i=r(3730);o=r(7356);u=r(5913);a=r(8601);t=r(9267);s=r(9766);e.exports.create=function(e,t,r,s){var n,o;if(e==null){throw new Error("Root element needs a name.")}s=c({},t,r,s);n=new i(s);o=n.element(e);if(!s.headless){n.declaration(s);if(s.pubID!=null||s.sysID!=null){n.dtd(s)}}return o};e.exports.begin=function(e,t,r){var s;if(d(e)){s=[e,t],t=s[0],r=s[1];e={}}if(t){return new o(e,t,r)}else{return new i(e)}};e.exports.stringWriter=function(e){return new u(e)};e.exports.streamWriter=function(e,t){return new a(e,t)};e.exports.implementation=new n;e.exports.nodeType=t;e.exports.writerState=s}).call(this)},6113:function(e){"use strict";e.exports=require("crypto")},2361:function(e){"use strict";e.exports=require("events")},7147:function(e){"use strict";e.exports=require("fs")},3685:function(e){"use strict";e.exports=require("http")},5687:function(e){"use strict";e.exports=require("https")},2037:function(e){"use strict";e.exports=require("os")},1017:function(e){"use strict";e.exports=require("path")},3477:function(e){"use strict";e.exports=require("querystring")},2781:function(e){"use strict";e.exports=require("stream")},1576:function(e){"use strict";e.exports=require("string_decoder")},9512:function(e){"use strict";e.exports=require("timers")},6224:function(e){"use strict";e.exports=require("tty")},7310:function(e){"use strict";e.exports=require("url")},3837:function(e){"use strict";e.exports=require("util")},9796:function(e){"use strict";e.exports=require("zlib")},9807:function(e){"use strict";e.exports=JSON.parse('{"name":"@alicloud/credentials","version":"2.4.0","description":"alibaba cloud node.js sdk credentials","main":"dist/src/client.js","scripts":{"prepublishOnly":"tsc","build":"tsc","lint":"eslint --fix ./src --ext .ts","test":"mocha -b -r ts-node/register test/**/*.test.ts test/*.test.ts --timeout 15000","test-dev":"nyc -e .ts -r=html -r=text -r=lcov mocha -b -r ts-node/register","cov":"nyc -e .ts -r=html -r=text -r=lcov npm run test","ci":"npm run cov","integration":"mocha -b -r ts-node/register -R spec integration/*.test.ts","clean":"rm -rf coverage"},"repository":{"type":"git","url":"git+https://github.com/aliyun/nodejs-credentials.git"},"keywords":["alibaba cloud","sdk","credentials"],"author":"Alibaba Cloud SDK","license":"MIT","devDependencies":{"@types/debug":"^4.1.12","@types/expect.js":"^0.3.29","@types/ini":"^1.3.30","@types/mocha":"^10.0.6","@types/rewire":"^2.5.28","@typescript-eslint/eslint-plugin":"^6.18.1","@typescript-eslint/parser":"^6.18.1","eslint":"^8.56.0","expect.js":"^0.3.1","mm":"^2.4.1","mocha":"^10.1.0","nyc":"^15.1.0","rewire":"^7.0.0","ts-node":"^10.9.2","typescript":"^3.7.5"},"dependencies":{"@alicloud/tea-typescript":"^1.5.3","httpx":"^2.2.0","ini":"^1.3.5","kitx":"^2.0.0"},"bugs":{"url":"https://github.com/aliyun/nodejs-credentials/issues"},"homepage":"https://github.com/aliyun/nodejs-credentials#readme","files":["src","dist"]}')}};var t={};function __nccwpck_require__(r){var s=t[r];if(s!==undefined){return s.exports}var n=t[r]={exports:{}};var i=true;try{e[r].call(n.exports,n,n.exports,__nccwpck_require__);i=false}finally{if(i)delete t[r]}return n.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(3023);module.exports=r})();
1
+ (function(){var e={6992:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const n=s(r(3173));const i=s(r(2944));class BearerTokenCredential extends n.default{constructor(e){if(!e){throw new Error("Missing required bearerToken option in config for bearer")}const t=new i.default({type:"bearer"});super(t);this.bearerToken=e}}t["default"]=BearerTokenCredential},4060:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.Config=void 0;const n=s(r(8067));const i=s(r(6992));const o=s(r(2944));t.Config=o.default;const a=s(r(6215));const u=s(r(5503));const c=s(r(7679));const l=s(r(5923));const d=s(r(2461));const p=s(r(7465));const f=s(r(6712));const h=s(r(8228));class InnerCredentialsClient{constructor(e,t){this.type=e;this.provider=t}async getAccessKeyId(){const e=await this.provider.getCredentials();return e.accessKeyId}async getAccessKeySecret(){const e=await this.provider.getCredentials();return e.accessKeySecret}async getSecurityToken(){const e=await this.provider.getCredentials();return e.securityToken}getBearerToken(){return}getType(){return this.type}async getCredential(){const e=await this.provider.getCredentials();return new u.default({accessKeyId:e.accessKeyId,accessKeySecret:e.accessKeySecret,securityToken:e.securityToken,bearerToken:undefined,type:this.getType()})}}class Credential{constructor(e=null,t={}){this.load(e,t)}getAccessKeyId(){return this.credential.getAccessKeyId()}getAccessKeySecret(){return this.credential.getAccessKeySecret()}getSecurityToken(){return this.credential.getSecurityToken()}getBearerToken(){return this.credential.getBearerToken()}getType(){return this.credential.getType()}getCredential(){return this.credential.getCredential()}load(e,t){if(!e){this.credential=new InnerCredentialsClient("default",h.default.builder().build());return}if(!e.type){throw new Error("Missing required type option")}switch(e.type){case"access_key":this.credential=new InnerCredentialsClient("access_key",c.default.builder().withAccessKeyId(e.accessKeyId).withAccessKeySecret(e.accessKeySecret).build());break;case"sts":this.credential=new InnerCredentialsClient("sts",l.default.builder().withAccessKeyId(e.accessKeyId).withAccessKeySecret(e.accessKeySecret).withSecurityToken(e.securityToken).build());break;case"ecs_ram_role":this.credential=new InnerCredentialsClient("ecs_ram_role",f.default.builder().withRoleName(e.roleName).withDisableIMDSv1(e.disableIMDSv1).build());break;case"ram_role_arn":{let t;if(e.securityToken){t=l.default.builder().withAccessKeyId(e.accessKeyId).withAccessKeySecret(e.accessKeySecret).withSecurityToken(e.securityToken).build()}else{t=c.default.builder().withAccessKeyId(e.accessKeyId).withAccessKeySecret(e.accessKeySecret).build()}this.credential=new InnerCredentialsClient("ram_role_arn",d.default.builder().withCredentialsProvider(t).withRoleArn(e.roleArn).withPolicy(e.policy).withDurationSeconds(e.roleSessionExpiration).withRoleSessionName(e.roleSessionName).build())}break;case"oidc_role_arn":this.credential=new InnerCredentialsClient("oidc_role_arn",p.default.builder().withRoleArn(e.roleArn).withOIDCProviderArn(e.oidcProviderArn).withOIDCTokenFilePath(e.oidcTokenFilePath).withRoleSessionName(e.roleSessionName).withPolicy(e.policy).withDurationSeconds(e.roleSessionExpiration).build());break;case"rsa_key_pair":this.credential=new n.default(e.publicKeyId,e.privateKeyFile);break;case"bearer":this.credential=new i.default(e.bearerToken);break;case"credentials_uri":this.credential=new a.default(e.credentialsURI);break;default:throw new Error("Invalid type option, support: access_key, sts, ecs_ram_role, ram_role_arn, rsa_key_pair, credentials_uri")}}}t["default"]=Credential},2944:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});const o=i(r(4165));class Config extends o.Model{constructor(e){super(e)}static names(){return{accessKeyId:"accessKeyId",accessKeySecret:"accessKeySecret",securityToken:"securityToken",bearerToken:"bearerToken",durationSeconds:"durationSeconds",roleArn:"roleArn",policy:"policy",roleSessionExpiration:"roleSessionExpiration",roleSessionName:"roleSessionName",publicKeyId:"publicKeyId",privateKeyFile:"privateKeyFile",roleName:"roleName",enableIMDSv2:"enableIMDSv2",disableIMDSv1:"disableIMDSv1",metadataTokenDuration:"metadataTokenDuration",credentialsURI:"credentialsURI",oidcProviderArn:"oidcProviderArn",oidcTokenFilePath:"oidcTokenFilePath",type:"type"}}static types(){return{accessKeyId:"string",accessKeySecret:"string",securityToken:"string",bearerToken:"string",durationSeconds:"number",roleArn:"string",policy:"string",roleSessionExpiration:"number",roleSessionName:"string",publicKeyId:"string",privateKeyFile:"string",roleName:"string",enableIMDSv2:"boolean",disableIMDSv1:"boolean",metadataTokenDuration:"number",credentialsURI:"string",oidcProviderArn:"string",oidcTokenFilePath:"string",type:"string"}}}t["default"]=Config},5503:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});const o=i(r(4165));class CredentialModel extends o.Model{constructor(e){super(e)}static names(){return{accessKeyId:"accessKeyId",accessKeySecret:"accessKeySecret",securityToken:"securityToken",bearerToken:"bearerToken",type:"type"}}static types(){return{accessKeyId:"string",accessKeySecret:"string",securityToken:"string",bearerToken:"string",type:"string"}}}t["default"]=CredentialModel},8498:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.CredentialsBuilder=void 0;class Credentials{constructor(e){this.accessKeyId=e.accessKeyId;this.accessKeySecret=e.accessKeySecret;this.securityToken=e.securityToken;this.providerName=e.providerName}static builder(){return new CredentialsBuilder}}t["default"]=Credentials;class CredentialsBuilder{withAccessKeyId(e){this.accessKeyId=e;return this}withAccessKeySecret(e){this.accessKeySecret=e;return this}withSecurityToken(e){this.securityToken=e;return this}withProviderName(e){this.providerName=e;return this}build(){return new Credentials(this)}}t.CredentialsBuilder=CredentialsBuilder},3173:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const n=s(r(5503));class DefaultCredential{constructor(e){this.accessKeyId=e.accessKeyId||"";this.accessKeySecret=e.accessKeySecret||"";this.securityToken=e.securityToken||"";this.bearerToken=e.bearerToken||"";this.type=e.type||""}async getAccessKeyId(){return this.accessKeyId}async getAccessKeySecret(){return this.accessKeySecret}async getSecurityToken(){return this.securityToken}getBearerToken(){return this.bearerToken}getType(){return this.type}async getCredential(){return new n.default({accessKeyId:this.accessKeyId,accessKeySecret:this.accessKeySecret,securityToken:this.securityToken,bearerToken:this.bearerToken,type:this.type})}}t["default"]=DefaultCredential},3982:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getProfile=t.getConfiguration=void 0;const n=r(7147);const i=r(3837);const o=s(r(1017));const a=s(r(2037));const u=s(r(8498));const c=s(r(7679));const l=s(r(2461));const d=s(r(7465));const p=s(r(6712));const f=i.promisify(n.readFile);class CLIProfileCredentialsProviderBuilder{build(){if(!this.profileName){this.profileName=process.env.ALIBABA_CLOUD_PROFILE}if(process.env.ALIBABA_CLOUD_CLI_PROFILE_DISABLED==="true"){throw new Error("the CLI profile is disabled")}return new CLIProfileCredentialsProvider(this)}withProfileName(e){this.profileName=e;return this}}class Configuration{}async function getConfiguration(e){let t;try{t=await f(e,"utf8")}catch(t){throw new Error(`reading aliyun cli config from '${e}' failed.`)}let r;try{r=JSON.parse(t)}catch(r){throw new Error(`parse aliyun cli config from '${e}' failed: ${t}`)}if(!r||!r.profiles||r.profiles.length===0){throw new Error(`no any configured profiles in '${e}'`)}return r}t.getConfiguration=getConfiguration;function getProfile(e,t){for(const r of e.profiles){if(r.name===t){return r}}throw new Error(`unable to get profile with '${t}'`)}t.getProfile=getProfile;class CLIProfileCredentialsProvider{constructor(e){this.homedir=a.default.homedir();this.profileName=e.profileName}static builder(){return new CLIProfileCredentialsProviderBuilder}getCredentialsProvider(e,t){const r=getProfile(e,t);switch(r.mode){case"AK":return c.default.builder().withAccessKeyId(r.access_key_id).withAccessKeySecret(r.access_key_secret).build();case"RamRoleArn":{const e=c.default.builder().withAccessKeyId(r.access_key_id).withAccessKeySecret(r.access_key_secret).build();return l.default.builder().withCredentialsProvider(e).withRoleArn(r.ram_role_arn).withRoleSessionName(r.ram_session_name).withDurationSeconds(r.expired_seconds).withStsRegionId(r.sts_region).build()}case"EcsRamRole":return p.default.builder().withRoleName(r.ram_role_name).build();case"OIDC":return d.default.builder().withOIDCTokenFilePath(r.oidc_token_file).withOIDCProviderArn(r.oidc_provider_arn).withRoleArn(r.ram_role_arn).withStsRegionId(r.sts_region).withDurationSeconds(r.expired_seconds).withRoleSessionName(r.ram_session_name).build();case"ChainableRamRoleArn":{const t=this.getCredentialsProvider(e,r.source_profile);return l.default.builder().withCredentialsProvider(t).withRoleArn(r.ram_role_arn).withRoleSessionName(r.ram_session_name).withDurationSeconds(r.expired_seconds).withStsRegionId(r.sts_region).build()}default:throw new Error(`unsupported profile mode '${r.mode}'`)}}async getCredentials(){if(!this.innerProvider){if(!this.homedir){throw new Error("cannot found home dir")}const e=o.default.join(this.homedir,".aliyun/config.json");const t=await getConfiguration(e);const r=this.profileName||t.current;this.innerProvider=this.getCredentialsProvider(t,r)}const e=await this.innerProvider.getCredentials();return u.default.builder().withAccessKeyId(e.accessKeyId).withAccessKeySecret(e.accessKeySecret).withSecurityToken(e.securityToken).withProviderName(`${this.getProviderName()}/${this.innerProvider.getProviderName()}`).build()}getProviderName(){return"cli_profile"}}t["default"]=CLIProfileCredentialsProvider},8228:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const n=s(r(8498));const i=s(r(3982));const o=s(r(6712));const a=s(r(2524));const u=s(r(7465));const c=s(r(5979));class DefaultCredentialsProvider{constructor(e){this.providers=[];try{const e=a.default.builder().build();this.providers.push(e)}catch(e){}try{const e=u.default.builder().build();this.providers.push(e)}catch(e){}try{const e=i.default.builder().build();this.providers.push(e)}catch(e){}try{const e=c.default.builder().build();this.providers.push(e)}catch(e){}if(process.env.ALIBABA_CLOUD_ECS_METADATA){try{const e=o.default.builder().withRoleName(process.env.ALIBABA_CLOUD_ECS_METADATA).build();this.providers.push(e)}catch(e){}}}static builder(){return new DefaultCredentialsProviderBuilder}async getCredentials(){if(this.lastUsedProvider){const e=await this.lastUsedProvider.getCredentials();return n.default.builder().withAccessKeyId(e.accessKeyId).withAccessKeySecret(e.accessKeySecret).withSecurityToken(e.securityToken).withProviderName(`${this.getProviderName()}/${this.lastUsedProvider.getProviderName()}`).build()}const e=[];for(const t of this.providers){this.lastUsedProvider=t;let r;try{r=await t.getCredentials()}catch(t){e.push(t);continue}if(r){return n.default.builder().withAccessKeyId(r.accessKeyId).withAccessKeySecret(r.accessKeySecret).withSecurityToken(r.securityToken).withProviderName(`${this.getProviderName()}/${this.lastUsedProvider.getProviderName()}`).build()}}throw new Error(`unable to get credentials from any of the providers in the chain: ${e.map((e=>e.message)).join(", ")}`)}getProviderName(){return"default"}}t["default"]=DefaultCredentialsProvider;class DefaultCredentialsProviderBuilder{build(){return new DefaultCredentialsProvider(this)}}},6712:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const n=s(r(8498));const i=r(3077);const o=s(r(8650));const a=r(2418);const u=21600;class ECSRAMRoleCredentialsProvider{constructor(e){this.doRequest=i.doRequest;this.roleName=e.roleName;this.disableIMDSv1=e.disableIMDSv1}static builder(){return new ECSRAMRoleCredentialsProviderBuilder}async getCredentials(){if(!this.session||this.needUpdateCredential()){const e=await this.getCredentialsInternal();const t=a.parseUTC(e.expiration);this.session=e;this.expirationTimestamp=t/1e3}return n.default.builder().withAccessKeyId(this.session.accessKeyId).withAccessKeySecret(this.session.accessKeySecret).withSecurityToken(this.session.securityToken).withProviderName(this.getProviderName()).build()}needUpdateCredential(){if(!this.expirationTimestamp){return true}return this.expirationTimestamp-Date.now()/1e3<=180}async getMetadataToken(){const e=i.Request.builder().withMethod("PUT").withProtocol("http").withHost("100.100.100.200").withPath("/latest/api/token").withHeaders({"x-aliyun-ecs-metadata-token-ttl-seconds":`${u}`}).build();try{const t=await this.doRequest(e);if(t.statusCode!==200){throw new Error(`get metadata token failed with ${t.statusCode}`)}return t.body.toString("utf8")}catch(e){if(this.disableIMDSv1){throw e}return null}}async getRoleName(){const e=i.Request.builder().withMethod("GET").withProtocol("http").withHost("100.100.100.200").withPath("/latest/meta-data/ram/security-credentials/");const t=await this.getMetadataToken();if(t!==null){e.withHeaders({"x-aliyun-ecs-metadata-token":t})}const r=e.build();const s=await this.doRequest(r);if(s.statusCode!==200){throw new Error(`get role name failed: ${r.method} ${r.toRequestURL()} ${s.statusCode}`)}return s.body.toString().trim()}async getCredentialsInternal(){let e=this.roleName;if(!e){e=await this.getRoleName()}const t=i.Request.builder().withMethod("GET").withProtocol("http").withHost("100.100.100.200").withPath(`/latest/meta-data/ram/security-credentials/${e}`);const r=await this.getMetadataToken();if(r!==null){t.withHeaders({"x-aliyun-ecs-metadata-token":r})}const s=t.build();const n=await this.doRequest(s);if(n.statusCode!==200){throw new Error(`get sts token failed, httpStatus: ${n.statusCode}, message = ${n.body.toString()}`)}let a;try{a=JSON.parse(n.body.toString())}catch(e){throw new Error(`get sts token failed, json parse failed: ${e.message}`)}if(!a||!a.AccessKeyId||!a.AccessKeySecret||!a.SecurityToken){throw new Error("get sts token failed")}if(a.Code!=="Success"){throw new Error("refresh Ecs sts token err, Code is not Success")}return new o.default(a.AccessKeyId,a.AccessKeySecret,a.SecurityToken,a.Expiration)}getProviderName(){return"ecs_ram_role"}}t["default"]=ECSRAMRoleCredentialsProvider;class ECSRAMRoleCredentialsProviderBuilder{constructor(){this.disableIMDSv1=false}withRoleName(e){this.roleName=e;return this}withDisableIMDSv1(e){this.disableIMDSv1=e;return this}build(){if(!this.roleName){this.roleName=process.env.ALIBABA_CLOUD_ECS_METADATA}if(process.env.ALIBABA_CLOUD_IMDSV1_DISABLED==="true"){this.disableIMDSv1=true}return new ECSRAMRoleCredentialsProvider(this)}}},2524:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const n=s(r(8498));class EnvironmentVariableCredentialsProvider{static builder(){return new EnvironmentVariableCredentialsProviderBuilder}async getCredentials(){const e=process.env.ALIBABA_CLOUD_ACCESS_KEY_ID;if(!e){throw new Error("unable to get credentials from enviroment variables, Access key ID must be specified via environment variable (ALIBABA_CLOUD_ACCESS_KEY_ID)")}const t=process.env.ALIBABA_CLOUD_ACCESS_KEY_SECRET;if(!t){throw new Error("unable to get credentials from enviroment variables, Access key secret must be specified via environment variable (ALIBABA_CLOUD_ACCESS_KEY_SECRET)")}const r=process.env.ALIBABA_CLOUD_SECURITY_TOKEN;return n.default.builder().withAccessKeyId(e).withAccessKeySecret(t).withSecurityToken(r).withProviderName(this.getProviderName()).build()}getProviderName(){return"env"}constructor(e){}}t["default"]=EnvironmentVariableCredentialsProvider;class EnvironmentVariableCredentialsProviderBuilder{build(){return new EnvironmentVariableCredentialsProvider(this)}}},3077:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.doRequest=t.Response=t.RequestBuilder=t.Request=void 0;const n=s(r(9074));class Request{constructor(e){this.method=e.method;this.protocol=e.protocol;this.host=e.host;this.path=e.path;this.queries=e.queries;this.headers=e.headers;this.bodyForm=e.bodyForm;this.bodyBytes=e.bodyBytes}static builder(){return new RequestBuilder}toRequestURL(){let e=`${this.protocol}://${this.host}${this.path}`;if(this.queries&&Object.keys(this.queries).length>0){e+=`?`+querystringify(this.queries)}return e}}t.Request=Request;class RequestBuilder{build(){if(!this.protocol){this.protocol="https"}if(!this.path){this.path="/"}if(!this.headers){this.headers={}}if(!this.queries){this.queries={}}return new Request(this)}withMethod(e){this.method=e;return this}withProtocol(e){this.protocol=e;return this}withHost(e){this.host=e;return this}withPath(e){this.path=e;return this}withQueries(e){this.queries=e;return this}withHeaders(e){this.headers=e;return this}withBodyForm(e){this.bodyForm=e;return this}}t.RequestBuilder=RequestBuilder;class Response{constructor(e){this.statusCode=e.statusCode;this.headers=e.headers;this.body=e.body}static builder(){return new ResponseBuilder}}t.Response=Response;class ResponseBuilder{constructor(){this.headers={}}withStatusCode(e){this.statusCode=e;return this}withHeaders(e){this.headers=e;return this}withBody(e){this.body=e;return this}build(){return new Response(this)}}function querystringify(e){const t=[];for(const[r,s]of Object.entries(e)){t.push(r+"="+encodeURIComponent(s))}return t.join("&")}async function doRequest(e){const t=e.toRequestURL();let r;if(e.bodyForm&&Object.keys(e.bodyForm).length>0){r=querystringify(e.bodyForm);if(!e.headers["Content-Type"]){e.headers["Content-Type"]="application/x-www-form-urlencoded"}}const s=await n.default.request(t,{method:e.method,data:r,headers:e.headers});const i=await n.default.read(s,"");return Response.builder().withStatusCode(s.statusCode).withHeaders(s.headers).withBody(i).build()}t.doRequest=doRequest},7465:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const a=r(7147);const u=r(3837);const c=o(r(8498));const l=o(r(8650));const d=i(r(6517));const p=r(3077);const f=r(2418);const h=u.promisify(a.readFile);class OIDCRoleArnCredentialsProviderBuilder{withOIDCProviderArn(e){this.oidcProviderArn=e;return this}withOIDCTokenFilePath(e){this.oidcTokenFilePath=e;return this}withRoleArn(e){this.roleArn=e;return this}withRoleSessionName(e){this.roleSessionName=e;return this}withDurationSeconds(e){this.durationSeconds=e;return this}withStsEndpoint(e){this.stsEndpoint=e;return this}withStsRegionId(e){this.stsRegionId=e;return this}withPolicy(e){this.policy=e;return this}build(){if(!this.oidcProviderArn){this.oidcProviderArn=process.env.ALIBABA_CLOUD_OIDC_PROVIDER_ARN}if(!this.oidcTokenFilePath){this.oidcTokenFilePath=process.env.ALIBABA_CLOUD_OIDC_TOKEN_FILE}if(!this.roleSessionName){this.roleSessionName=process.env.ALIBABA_CLOUD_ROLE_SESSION_NAME}if(!this.durationSeconds){this.durationSeconds=3600}if(!this.roleArn){this.roleArn=process.env.ALIBABA_CLOUD_ROLE_ARN}if(!this.roleArn){throw new Error("roleArn does not exist and env ALIBABA_CLOUD_ROLE_ARN is null.")}if(!this.oidcProviderArn){throw new Error("oidcProviderArn does not exist and env ALIBABA_CLOUD_OIDC_PROVIDER_ARN is null.")}if(!this.oidcTokenFilePath){throw new Error("oidcTokenFilePath is not exists and env ALIBABA_CLOUD_OIDC_TOKEN_FILE is null.")}if(!this.roleSessionName){this.roleSessionName="credentials-nodejs-"+Date.now()}if(this.durationSeconds<900){throw new Error("session duration should be in the range of 900s - max session duration")}if(!this.stsEndpoint){if(this.stsRegionId){this.stsEndpoint=`sts.${this.stsRegionId}.aliyuncs.com`}else{this.stsEndpoint="sts.aliyuncs.com"}}return new OIDCRoleArnCredentialsProvider(this)}}class OIDCRoleArnCredentialsProvider{constructor(e){this.doRequest=p.doRequest;this.roleArn=e.roleArn;this.oidcProviderArn=e.oidcProviderArn;this.oidcTokenFilePath=e.oidcTokenFilePath;this.policy=e.policy;this.durationSeconds=e.durationSeconds;this.roleSessionName=e.roleSessionName;this.stsEndpoint=e.stsEndpoint;this.doRequest=p.doRequest}static builder(){return new OIDCRoleArnCredentialsProviderBuilder}async getCredentials(){if(!this.session||this.needUpdateCredential()){const e=await this.getCredentialsInternal();const t=f.parseUTC(e.expiration);this.expirationTimestamp=Math.floor(t/1e3);this.lastUpdateTimestamp=Date.now();this.session=e}return c.default.builder().withAccessKeyId(this.session.accessKeyId).withAccessKeySecret(this.session.accessKeySecret).withSecurityToken(this.session.securityToken).withProviderName(this.getProviderName()).build()}getProviderName(){return"oidc_role_arn"}async getCredentialsInternal(){const e=await h(this.oidcTokenFilePath,"utf8");const t=p.Request.builder().withMethod("POST").withProtocol("https").withHost(this.stsEndpoint);const r=Object.create(null);r["Version"]="2015-04-01";r["Action"]="AssumeRoleWithOIDC";r["Format"]="JSON";r["Timestamp"]=d.timestamp();t.withQueries(r);const s=Object.create(null);s["OIDCProviderArn"]=this.oidcProviderArn;s["OIDCToken"]=e;s["RoleArn"]=this.roleArn;if(this.policy){s["Policy"]=this.policy}s["RoleSessionName"]=this.roleSessionName;s["DurationSeconds"]=`${this.durationSeconds}`;t.withBodyForm(s);const n=Object.create(null);n["Content-Type"]="application/x-www-form-urlencoded";t.withHeaders(n);const i=t.build();const o=await this.doRequest(i);if(o.statusCode!==200){throw new Error(`get sts token failed with OIDC: ${o.body.toString("utf8")}`)}let a;try{a=JSON.parse(o.body.toString("utf8"))}catch(e){throw new Error(`get sts token failed with OIDC, unmarshal fail: ${o.body.toString("utf8")}`)}if(!a||!a.Credentials){throw new Error(`get sts token failed with OIDC`)}const{AccessKeyId:u,AccessKeySecret:c,SecurityToken:f,Expiration:m}=a.Credentials;if(!u||!c||!f){throw new Error("get sts token failed with OIDC")}return new l.default(u,c,f,m)}needUpdateCredential(){if(!this.expirationTimestamp){return true}return this.expirationTimestamp-Date.now()/1e3<=180}}t["default"]=OIDCRoleArnCredentialsProvider},5979:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const n=s(r(1017));const i=s(r(2037));const o=s(r(8498));const a=r(6517);const u=s(r(7679));const c=s(r(6712));const l=s(r(2461));class ProfileCredentialsProvider{constructor(e){this.homedir=i.default.homedir();this.profileName=e.profileName}async getCredentials(){if(!this.innerProvider){let e=process.env.ALIBABA_CLOUD_CREDENTIALS_FILE;if(!e){if(!this.homedir){throw new Error("cannot found home dir")}e=n.default.join(this.homedir,".alibabacloud/credentials")}const t=await a.loadIni(e);this.innerProvider=this.getCredentialsProvider(t)}const e=await this.innerProvider.getCredentials();return o.default.builder().withAccessKeyId(e.accessKeyId).withAccessKeySecret(e.accessKeySecret).withSecurityToken(e.securityToken).withProviderName(`${this.getProviderName()}/${this.innerProvider.getProviderName()}`).build()}getCredentialsProvider(e){const t=e[this.profileName]||{};if(!t.type){throw new Error(`Can not find credential type for "${this.profileName}"`)}switch(t.type){case"access_key":return u.default.builder().withAccessKeyId(t.access_key_id).withAccessKeySecret(t.access_key_secret).build();case"ecs_ram_role":return c.default.builder().withRoleName(t.role_name).build();case"ram_role_arn":{const e=u.default.builder().withAccessKeyId(t.access_key_id).withAccessKeySecret(t.access_key_secret).build();return l.default.builder().withCredentialsProvider(e).withRoleArn(t.role_arn).build()}default:throw new Error("Invalid type option, support: access_key, ecs_ram_role, ram_role_arn")}}getProviderName(){return"profile"}static builder(){return new ProfileCredentialsProviderBuilder}}t["default"]=ProfileCredentialsProvider;class ProfileCredentialsProviderBuilder{withProfileName(e){this.profileName=e;return this}build(){if(!this.profileName){this.profileName=process.env.ALIBABA_CLOUD_PROFILE||"default"}return new ProfileCredentialsProvider(this)}}},2461:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const a=i(r(8683));const u=o(r(8237));const c=i(r(6517));const l=o(r(8498));const d=r(3077);const p=r(2418);const f=o(r(8650));const h=u.default("sign");class RAMRoleARNCredentialsProviderBuilder{build(){if(!this.credentialsProvider){throw new Error("must specify a previous credentials provider to asssume role")}if(!this.roleArn){throw new Error("the RoleArn is empty")}if(!this.roleSessionName){this.roleSessionName="credentials-nodejs-"+Date.now()}if(!this.durationSeconds){this.durationSeconds=3600}if(this.durationSeconds<900){throw new Error("session duration should be in the range of 900s - max session duration")}if(!this.stsEndpoint){if(this.stsRegionId){this.stsEndpoint=`sts.${this.stsRegionId}.aliyuncs.com`}else{this.stsEndpoint="sts.aliyuncs.com"}}return new RAMRoleARNCredentialsProvider(this)}withCredentialsProvider(e){this.credentialsProvider=e;return this}withRoleArn(e){this.roleArn=e;return this}withStsRegionId(e){this.stsRegionId=e;return this}withStsEndpoint(e){this.stsEndpoint=e;return this}withRoleSessionName(e){this.roleSessionName=e;return this}withPolicy(e){this.policy=e;return this}withExternalId(e){this.externalId=e;return this}withDurationSeconds(e){this.durationSeconds=e;return this}}function encode(e){const t=encodeURIComponent(e);return t.replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}class RAMRoleARNCredentialsProvider{constructor(e){this.doRequest=d.doRequest;this.credentialsProvider=e.credentialsProvider;this.stsEndpoint=e.stsEndpoint;this.roleSessionName=e.roleSessionName;this.policy=e.policy;this.durationSeconds=e.durationSeconds;this.roleArn=e.roleArn;this.externalId=e.externalId}static builder(){return new RAMRoleARNCredentialsProviderBuilder}async getCredentialsInternal(e){const t="POST";const r=d.Request.builder().withMethod(t).withProtocol("https").withHost(this.stsEndpoint);const s=Object.create(null);s["Version"]="2015-04-01";s["Action"]="AssumeRole";s["Format"]="JSON";s["Timestamp"]=c.timestamp();s["SignatureMethod"]="HMAC-SHA1";s["SignatureVersion"]="1.0";s["SignatureNonce"]=a.makeNonce();s["AccessKeyId"]=e.accessKeyId;if(e.securityToken){s["SecurityToken"]=e.securityToken}const n=Object.create(null);n["RoleArn"]=this.roleArn;if(this.policy){n["Policy"]=this.policy}if(this.externalId){n["ExternalId"]=this.externalId}n["RoleSessionName"]=this.roleSessionName;n["DurationSeconds"]=`${this.durationSeconds}`;r.withBodyForm(n);const i=Object.create(null);for(const[e,t]of Object.entries(s)){i[e]=t}for(const[e,t]of Object.entries(n)){i[e]=t}const o=Object.keys(i).sort();const u=`${t}&${encode("/")}&${encode(o.map((e=>`${encode(e)}=${encode(i[e])}`)).join("&"))}`;h("stringToSign[Client]:");h(u);const l=e.accessKeySecret+"&";const p=a.sha1(u,l,"base64");s["Signature"]=p;r.withQueries(s);const m=Object.create(null);m["Content-Type"]="application/x-www-form-urlencoded";m["x-acs-credentials-provider"]=e.providerName;r.withHeaders(m);const y=r.build();const g=await this.doRequest(y);if(g.statusCode!=200){if(g.headers["content-type"]&&g.headers["content-type"].startsWith("application/json")){const e=JSON.parse(g.body.toString("utf8"));const t=e.Message.slice("Specified signature is not matched with our calculation. server string to sign is:".length);h("stringToSign[Server]:");h(u);if(e.Code==="SignatureDoesNotMatch"&&t===u){throw new Error(`the access key secret is invalid`)}}throw new Error(`refresh session token failed: ${g.body.toString("utf8")}`)}let S;try{S=JSON.parse(g.body.toString("utf8"))}catch(e){throw new Error(`refresh RoleArn sts token err, unmarshal fail: ${g.body.toString("utf8")}`)}if(!S||!S.Credentials){throw new Error(`refresh RoleArn sts token err, fail to get credentials`)}if(!S.Credentials.AccessKeyId||!S.Credentials.AccessKeySecret||!S.Credentials.SecurityToken){throw new Error("refresh RoleArn sts token err, fail to get credentials")}const{AccessKeyId:T,AccessKeySecret:w,SecurityToken:b,Expiration:C}=S.Credentials;return new f.default(T,w,b,C)}async getCredentials(){if(!this.session||this.needUpdateCredential()){const e=await this.credentialsProvider.getCredentials();const t=await this.getCredentialsInternal(e);const r=p.parseUTC(t.expiration);this.expirationTimestamp=Math.floor(r/1e3);this.lastUpdateTimestamp=Date.now();this.session=t}return l.default.builder().withAccessKeyId(this.session.accessKeyId).withAccessKeySecret(this.session.accessKeySecret).withSecurityToken(this.session.securityToken).withProviderName(`${this.getProviderName()}/${this.credentialsProvider.getProviderName()}`).build()}needUpdateCredential(){if(!this.expirationTimestamp){return true}return this.expirationTimestamp-Date.now()/1e3<=180}getProviderName(){return"ram_role_arn"}}t["default"]=RAMRoleARNCredentialsProvider},8650:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});class Session{constructor(e,t,r,s){this.accessKeyId=e;this.accessKeySecret=t;this.securityToken=r;this.expiration=s}}t["default"]=Session},7679:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.StaticAKCredentialsProviderBuilder=void 0;const n=s(r(8498));class StaticAKCredentialsProviderBuilder{withAccessKeyId(e){this.accessKeyId=e;return this}withAccessKeySecret(e){this.accessKeySecret=e;return this}build(){if(!this.accessKeyId){this.accessKeyId=process.env["ALIBABA_CLOUD_ACCESS_KEY_ID"]}if(!this.accessKeyId){throw new Error("the access key id is empty")}if(!this.accessKeySecret){this.accessKeySecret=process.env["ALIBABA_CLOUD_ACCESS_KEY_SECRET"]}if(!this.accessKeySecret){throw new Error("the access key secret is empty")}return new StaticAKCredentialsProvider(this)}}t.StaticAKCredentialsProviderBuilder=StaticAKCredentialsProviderBuilder;class StaticAKCredentialsProvider{constructor(e){this.accessKeyId=e.accessKeyId;this.accessKeySecret=e.accessKeySecret}static builder(){return new StaticAKCredentialsProviderBuilder}getProviderName(){return"static_ak"}async getCredentials(){const e=n.default.builder().withAccessKeyId(this.accessKeyId).withAccessKeySecret(this.accessKeySecret).withProviderName("static_ak").build();return e}}t["default"]=StaticAKCredentialsProvider},5923:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.StaticSTSCredentialsProviderBuilder=void 0;const n=s(r(8498));class StaticSTSCredentialsProviderBuilder{withAccessKeyId(e){this.accessKeyId=e;return this}withAccessKeySecret(e){this.accessKeySecret=e;return this}withSecurityToken(e){this.securityToken=e;return this}build(){if(!this.accessKeyId){this.accessKeyId=process.env["ALIBABA_CLOUD_ACCESS_KEY_ID"]}if(!this.accessKeyId){throw new Error("the access key id is empty")}if(!this.accessKeySecret){this.accessKeySecret=process.env["ALIBABA_CLOUD_ACCESS_KEY_SECRET"]}if(!this.accessKeySecret){throw new Error("the access key secret is empty")}if(!this.securityToken){this.securityToken=process.env["ALIBABA_CLOUD_SECURITY_TOKEN"]}if(!this.securityToken){throw new Error("the security token is empty")}return new StaticSTSCredentialsProvider(this)}}t.StaticSTSCredentialsProviderBuilder=StaticSTSCredentialsProviderBuilder;class StaticSTSCredentialsProvider{constructor(e){this.accessKeyId=e.accessKeyId;this.accessKeySecret=e.accessKeySecret;this.securityToken=e.securityToken}static builder(){return new StaticSTSCredentialsProviderBuilder}getProviderName(){return"static_sts"}async getCredentials(){return n.default.builder().withAccessKeyId(this.accessKeyId).withAccessKeySecret(this.accessKeySecret).withSecurityToken(this.securityToken).withProviderName(this.getProviderName()).build()}}t["default"]=StaticSTSCredentialsProvider},2418:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.parseUTC=void 0;function parseUTC(e){if(!e){throw new Error("invalid UTC format time string")}if(e.length===20){if(e[4]!=="-"||e[7]!=="-"||e[10]!=="T"||e[13]!==":"||e[16]!==":"||e[19]!=="Z"){throw new Error("invalid UTC format date string")}}else if(e.length===24){if(e[4]!=="-"||e[7]!=="-"||e[10]!=="T"||e[13]!==":"||e[16]!==":"||e[19]!=="."||e[23]!=="Z"){throw new Error("invalid UTC format date string")}}else{throw new Error("invalid UTC format time string")}const t=e.slice(0,4);const r=Number.parseInt(t,10);if(isNaN(r)){throw new Error("invalid year string")}const s=e.slice(5,7);const n=Number.parseInt(s,10);if(isNaN(n)){throw new Error("invalid month string")}if(n<1||n>12){throw new Error("invalid month value")}const i=e.slice(8,10);const o=Number.parseInt(i,10);if(isNaN(o)){throw new Error("invalid date string")}if(o<1||o>31){throw new Error("invalid date value")}const a=e.slice(11,13);const u=Number.parseInt(a,10);if(isNaN(u)){throw new Error("invalid hours string")}if(u<0||u>24){throw new Error("invalid hours value")}const c=e.slice(14,16);const l=Number.parseInt(c,10);if(isNaN(l)){throw new Error("invalid minutes string")}if(l<0||l>60){throw new Error("invalid minutes value")}const d=e.slice(17,19);const p=Number.parseInt(d,10);if(isNaN(p)){throw new Error("invalid seconds string")}if(p<0||p>60){throw new Error("invalid seconds value")}if(e.length===24){const t=e.slice(20,23);const s=Number.parseInt(t,10);if(isNaN(s)){throw new Error("invalid ms string")}return Date.UTC(r,n-1,o,u,l,p,s)}return Date.UTC(r,n-1,o,u,l,p)}t.parseUTC=parseUTC},8067:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const a=o(r(7147));const u=o(r(1206));const c=i(r(6517));const l=r(6050);const d=o(r(2944));const p="http://100.100.100.200/latest/meta-data/ram/security-credentials/";class RsaKeyPairCredential extends u.default{constructor(e,t){if(!e){throw new Error("Missing required publicKeyId option in config for rsa_key_pair")}if(!t){throw new Error("Missing required privateKeyFile option in config for rsa_key_pair")}if(!a.default.existsSync(t)){throw new Error(`privateKeyFile ${t} cannot be empty`)}const r=new d.default({type:"rsa_key_pair"});super(r);this.privateKey=c.parseFile(t);this.publicKeyId=e}async updateCredential(){const e=p+this.roleName;const t=await l.request(e,{accessKeyId:this.publicKeyId,action:"GenerateSessionAccessKey",durationSeconds:3600,signatureMethod:"SHA256withRSA",signatureType:"PRIVATEKEY"},{},this.privateKey);this.sessionCredential=t.Credentials}}t["default"]=RsaKeyPairCredential},1206:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const a=o(r(3173));const u=i(r(6517));const c=o(r(2944));const l=o(r(5503));class SessionCredential extends a.default{constructor(e){const t=new c.default({type:e.type,accessKeyId:e.accessKeyId,accessKeySecret:e.accessKeySecret,securityToken:e.securityToken});super(t);this.sessionCredential=null;this.durationSeconds=e.durationSeconds||3600}async updateCredential(){throw new Error("need implemented in sub-class")}async ensureCredential(){const e=this.needUpdateCredential();if(e){await this.updateCredential()}}async getAccessKeyId(){await this.ensureCredential();return this.sessionCredential.AccessKeyId}async getAccessKeySecret(){await this.ensureCredential();return this.sessionCredential.AccessKeySecret}async getSecurityToken(){await this.ensureCredential();return this.sessionCredential.SecurityToken}needUpdateCredential(){if(!this.sessionCredential||!this.sessionCredential.Expiration||!this.sessionCredential.AccessKeyId||!this.sessionCredential.AccessKeySecret||!this.sessionCredential.SecurityToken){return true}const e=u.timestamp(new Date,this.durationSeconds*.05*1e3);if(this.sessionCredential.Expiration<e){return true}return false}async getCredential(){await this.ensureCredential();return new l.default({accessKeyId:this.sessionCredential.AccessKeyId,accessKeySecret:this.sessionCredential.AccessKeySecret,securityToken:this.sessionCredential.SecurityToken,bearerToken:this.bearerToken,type:this.type})}}t["default"]=SessionCredential},6215:function(e,t,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const n=s(r(9074));const i=s(r(2944));const o=s(r(1206));class URICredential extends o.default{constructor(e){const t=new i.default({type:"credentials_uri",credentialsURI:e});super(t);if(!e){this.credentialsURI=process.env["ALIBABA_CLOUD_CREDENTIALS_URI"]}else{this.credentialsURI=e}if(!this.credentialsURI){throw new Error("Missing required credentialsURI option in config or environment variable for credentials_uri")}}async updateCredential(){const e=this.credentialsURI;const t=await n.default.request(e,{});if(t.statusCode!==200){throw new Error(`Get credentials from ${e} failed, status code is ${t.statusCode}`)}const r=await n.default.read(t,"utf8");let s;try{s=JSON.parse(r)}catch(t){throw new Error(`Get credentials from ${e} failed, unmarshal response failed, JSON is: ${r}`)}if(s.Code!=="Success"){throw new Error(`Get credentials from ${e} failed, Code is ${s.Code}`)}this.sessionCredential={AccessKeyId:s.AccessKeyId,AccessKeySecret:s.AccessKeySecret,Expiration:s.Expiration,SecurityToken:s.SecurityToken}}}t["default"]=URICredential},8524:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.DEFAULT_CLIENT=t.DEFAULT_UA=void 0;const a=i(r(2037));const u=o(r(9807));t.DEFAULT_UA=`AlibabaCloud (${a.platform()}; ${a.arch()}) `+`Node.js/${process.version} Core/${u.default.version}`;t.DEFAULT_CLIENT=`Node.js(${process.version}), ${u.default.name}: ${u.default.version}`},6050:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.request=void 0;const a=o(r(9074));const u=i(r(8683));const c=i(r(8524));const l=i(r(6517));const d=new Set([200,"200","OK","Success"]);function firstLetterUpper(e){return e.slice(0,1).toUpperCase()+e.slice(1)}function formatParams(e){const t=Object.keys(e);const r={};for(const s of t){r[firstLetterUpper(s)]=e[s]}return r}function encode(e){const t=encodeURIComponent(e);return t.replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function replaceRepeatList(e,t,r){for(let s=0;s<r.length;s++){const n=r[s];if(n&&typeof n==="object"){const r=Object.keys(n);for(const i of r){e[`${t}.${s+1}.${i}`]=n[i]}}else{e[`${t}.${s+1}`]=n}}}function flatParams(e){const t={};const r=Object.keys(e);for(const s of r){const r=e[s];if(Array.isArray(r)){replaceRepeatList(t,s,r)}else{t[s]=r}}return t}function normalize(e){const t=[];const r=flatParams(e);const s=Object.keys(r).sort();for(const e of s){const s=r[e];t.push([encode(e),encode(s)])}return t}function canonicalize(e){const t=[];for(const[r,s]of e){t.push(r+"="+s)}return t.join("&")}function _buildParams(){const e={Format:"JSON",SignatureMethod:"HMAC-SHA1",SignatureNonce:u.makeNonce(),SignatureVersion:"1.0",Timestamp:l.timestamp(),Version:"2015-04-01",RegionId:"cn-hangzhou"};return e}async function request(e,t={},r={},s){let n=Object.assign({headers:{"x-sdk-client":c.DEFAULT_CLIENT,"user-agent":c.DEFAULT_UA}},r);if(n.formatParams!==false){t=formatParams(t)}t=Object.assign(Object.assign({},_buildParams()),t);const i=(r.method||"GET").toUpperCase();const o=normalize(t);if(!n.anonymous){const e=canonicalize(o);const t=`${i}&${encode("/")}&${encode(e)}`;const r=s+"&";const n=u.sha1(t,r,"base64");o.push(["Signature",encode(n)])}const l=r.method==="POST"?`${e}/`:`${e}/?${canonicalize(o)}`;if(r.method==="POST"){r.headers=r.headers||{};r.headers["content-type"]="application/x-www-form-urlencoded";r.data=canonicalize(o)}const p=await a.default.request(l,r);const f=await a.default.read(p,"utf8");const h=JSON.parse(f);if(h.Code&&!d.has(h.Code)){const e=new Error(`${h.Message}`);e.name=h.Code+"Error";e.data=h;e.code=h.Code;e.url=l;throw e}return h}t.request=request},6517:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.loadIni=t.parseFile=t.timestamp=void 0;const a=i(r(8885));const u=i(r(8683));const c=o(r(7147));const l=r(3837);const d=l.promisify(c.default.readFile);const p=l.promisify(c.default.access);function timestamp(e,t){let r=new Date(e);if(!e||isNaN(r.getTime())){r=new Date}if(t){r.setTime(r.getTime()+t)}const s=r.getUTCFullYear();const n=u.pad2(r.getUTCMonth()+1);const i=u.pad2(r.getUTCDate());const o=u.pad2(r.getUTCHours());const a=u.pad2(r.getUTCMinutes());const c=u.pad2(r.getUTCSeconds());return`${s}-${n}-${i}T${o}:${a}:${c}Z`}t.timestamp=timestamp;function parseFile(e,t=false){try{c.default.accessSync(e,c.default.constants.R_OK)}catch(e){if(t){return null}throw new Error("Has no read permission to credentials file")}return a.parse(c.default.readFileSync(e,"utf-8"))}t.parseFile=parseFile;async function loadIni(e){await p(e,c.default.constants.R_OK);const t=await d(e,"utf-8");return a.parse(t)}t.loadIni=loadIni},3023:function(e,t,r){"use strict";var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(Object.hasOwnProperty.call(e,r))t[r]=e[r];t["default"]=e;return t};var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const i=s(r(1979)),o=i;const a=s(r(6642)),u=a;const c=n(r(8190));const l=n(r(2306));const d=s(r(4165));class AddShortUrlRequest extends d.Model{constructor(e){super(e)}static names(){return{effectiveDays:"EffectiveDays",ownerId:"OwnerId",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",shortUrlName:"ShortUrlName",sourceUrl:"SourceUrl"}}static types(){return{effectiveDays:"string",ownerId:"number",resourceOwnerAccount:"string",resourceOwnerId:"number",shortUrlName:"string",sourceUrl:"string"}}}t.AddShortUrlRequest=AddShortUrlRequest;class AddShortUrlResponseBody extends d.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",message:"Message",requestId:"RequestId"}}static types(){return{code:"string",data:AddShortUrlResponseBodyData,message:"string",requestId:"string"}}}t.AddShortUrlResponseBody=AddShortUrlResponseBody;class AddShortUrlResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:AddShortUrlResponseBody}}}t.AddShortUrlResponse=AddShortUrlResponse;class AddSmsSignRequest extends d.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",remark:"Remark",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",signFileList:"SignFileList",signName:"SignName",signSource:"SignSource",signType:"SignType"}}static types(){return{ownerId:"number",remark:"string",resourceOwnerAccount:"string",resourceOwnerId:"number",signFileList:{type:"array",itemType:AddSmsSignRequestSignFileList},signName:"string",signSource:"number",signType:"number"}}}t.AddSmsSignRequest=AddSmsSignRequest;class AddSmsSignResponseBody extends d.Model{constructor(e){super(e)}static names(){return{code:"Code",message:"Message",requestId:"RequestId",signName:"SignName"}}static types(){return{code:"string",message:"string",requestId:"string",signName:"string"}}}t.AddSmsSignResponseBody=AddSmsSignResponseBody;class AddSmsSignResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:AddSmsSignResponseBody}}}t.AddSmsSignResponse=AddSmsSignResponse;class AddSmsTemplateRequest extends d.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",remark:"Remark",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",templateContent:"TemplateContent",templateName:"TemplateName",templateType:"TemplateType"}}static types(){return{ownerId:"number",remark:"string",resourceOwnerAccount:"string",resourceOwnerId:"number",templateContent:"string",templateName:"string",templateType:"number"}}}t.AddSmsTemplateRequest=AddSmsTemplateRequest;class AddSmsTemplateResponseBody extends d.Model{constructor(e){super(e)}static names(){return{code:"Code",message:"Message",requestId:"RequestId",templateCode:"TemplateCode"}}static types(){return{code:"string",message:"string",requestId:"string",templateCode:"string"}}}t.AddSmsTemplateResponseBody=AddSmsTemplateResponseBody;class AddSmsTemplateResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:AddSmsTemplateResponseBody}}}t.AddSmsTemplateResponse=AddSmsTemplateResponse;class CheckMobilesCardSupportRequest extends d.Model{constructor(e){super(e)}static names(){return{mobiles:"Mobiles",templateCode:"TemplateCode"}}static types(){return{mobiles:{type:"array",itemType:{type:"map",keyType:"string",valueType:"any"}},templateCode:"string"}}}t.CheckMobilesCardSupportRequest=CheckMobilesCardSupportRequest;class CheckMobilesCardSupportResponseBody extends d.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",requestId:"RequestId",success:"Success"}}static types(){return{code:"string",data:{type:"array",itemType:{type:"map",keyType:"string",valueType:"any"}},requestId:"string",success:"boolean"}}}t.CheckMobilesCardSupportResponseBody=CheckMobilesCardSupportResponseBody;class CheckMobilesCardSupportResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:CheckMobilesCardSupportResponseBody}}}t.CheckMobilesCardSupportResponse=CheckMobilesCardSupportResponse;class CreateCardSmsTemplateRequest extends d.Model{constructor(e){super(e)}static names(){return{factorys:"Factorys",memo:"Memo",template:"Template",templateName:"TemplateName"}}static types(){return{factorys:"string",memo:"string",template:{type:"map",keyType:"string",valueType:"any"},templateName:"string"}}}t.CreateCardSmsTemplateRequest=CreateCardSmsTemplateRequest;class CreateCardSmsTemplateShrinkRequest extends d.Model{constructor(e){super(e)}static names(){return{factorys:"Factorys",memo:"Memo",templateShrink:"Template",templateName:"TemplateName"}}static types(){return{factorys:"string",memo:"string",templateShrink:"string",templateName:"string"}}}t.CreateCardSmsTemplateShrinkRequest=CreateCardSmsTemplateShrinkRequest;class CreateCardSmsTemplateResponseBody extends d.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",requestId:"RequestId",success:"Success"}}static types(){return{code:"string",data:CreateCardSmsTemplateResponseBodyData,requestId:"string",success:"boolean"}}}t.CreateCardSmsTemplateResponseBody=CreateCardSmsTemplateResponseBody;class CreateCardSmsTemplateResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:CreateCardSmsTemplateResponseBody}}}t.CreateCardSmsTemplateResponse=CreateCardSmsTemplateResponse;class DeleteShortUrlRequest extends d.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",sourceUrl:"SourceUrl"}}static types(){return{ownerId:"number",resourceOwnerAccount:"string",resourceOwnerId:"number",sourceUrl:"string"}}}t.DeleteShortUrlRequest=DeleteShortUrlRequest;class DeleteShortUrlResponseBody extends d.Model{constructor(e){super(e)}static names(){return{code:"Code",message:"Message",requestId:"RequestId"}}static types(){return{code:"string",message:"string",requestId:"string"}}}t.DeleteShortUrlResponseBody=DeleteShortUrlResponseBody;class DeleteShortUrlResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:DeleteShortUrlResponseBody}}}t.DeleteShortUrlResponse=DeleteShortUrlResponse;class DeleteSmsSignRequest extends d.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",signName:"SignName"}}static types(){return{ownerId:"number",resourceOwnerAccount:"string",resourceOwnerId:"number",signName:"string"}}}t.DeleteSmsSignRequest=DeleteSmsSignRequest;class DeleteSmsSignResponseBody extends d.Model{constructor(e){super(e)}static names(){return{code:"Code",message:"Message",requestId:"RequestId",signName:"SignName"}}static types(){return{code:"string",message:"string",requestId:"string",signName:"string"}}}t.DeleteSmsSignResponseBody=DeleteSmsSignResponseBody;class DeleteSmsSignResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:DeleteSmsSignResponseBody}}}t.DeleteSmsSignResponse=DeleteSmsSignResponse;class DeleteSmsTemplateRequest extends d.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",templateCode:"TemplateCode"}}static types(){return{ownerId:"number",resourceOwnerAccount:"string",resourceOwnerId:"number",templateCode:"string"}}}t.DeleteSmsTemplateRequest=DeleteSmsTemplateRequest;class DeleteSmsTemplateResponseBody extends d.Model{constructor(e){super(e)}static names(){return{code:"Code",message:"Message",requestId:"RequestId",templateCode:"TemplateCode"}}static types(){return{code:"string",message:"string",requestId:"string",templateCode:"string"}}}t.DeleteSmsTemplateResponseBody=DeleteSmsTemplateResponseBody;class DeleteSmsTemplateResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:DeleteSmsTemplateResponseBody}}}t.DeleteSmsTemplateResponse=DeleteSmsTemplateResponse;class GetCardSmsLinkRequest extends d.Model{constructor(e){super(e)}static names(){return{cardCodeType:"CardCodeType",cardLinkType:"CardLinkType",cardTemplateCode:"CardTemplateCode",cardTemplateParamJson:"CardTemplateParamJson",customShortCodeJson:"CustomShortCodeJson",domain:"Domain",outId:"OutId",phoneNumberJson:"PhoneNumberJson",signNameJson:"SignNameJson"}}static types(){return{cardCodeType:"number",cardLinkType:"number",cardTemplateCode:"string",cardTemplateParamJson:"string",customShortCodeJson:"string",domain:"string",outId:"string",phoneNumberJson:"string",signNameJson:"string"}}}t.GetCardSmsLinkRequest=GetCardSmsLinkRequest;class GetCardSmsLinkResponseBody extends d.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",requestId:"RequestId",success:"Success"}}static types(){return{code:"string",data:GetCardSmsLinkResponseBodyData,requestId:"string",success:"boolean"}}}t.GetCardSmsLinkResponseBody=GetCardSmsLinkResponseBody;class GetCardSmsLinkResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:GetCardSmsLinkResponseBody}}}t.GetCardSmsLinkResponse=GetCardSmsLinkResponse;class GetMediaResourceIdRequest extends d.Model{constructor(e){super(e)}static names(){return{extendInfo:"ExtendInfo",fileSize:"FileSize",memo:"Memo",ossKey:"OssKey",resourceType:"ResourceType"}}static types(){return{extendInfo:"string",fileSize:"number",memo:"string",ossKey:"string",resourceType:"number"}}}t.GetMediaResourceIdRequest=GetMediaResourceIdRequest;class GetMediaResourceIdResponseBody extends d.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",requestId:"RequestId",success:"Success"}}static types(){return{code:"string",data:GetMediaResourceIdResponseBodyData,requestId:"string",success:"boolean"}}}t.GetMediaResourceIdResponseBody=GetMediaResourceIdResponseBody;class GetMediaResourceIdResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:GetMediaResourceIdResponseBody}}}t.GetMediaResourceIdResponse=GetMediaResourceIdResponse;class GetOSSInfoForCardTemplateResponseBody extends d.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",requestId:"RequestId",success:"Success"}}static types(){return{code:"string",data:GetOSSInfoForCardTemplateResponseBodyData,requestId:"string",success:"boolean"}}}t.GetOSSInfoForCardTemplateResponseBody=GetOSSInfoForCardTemplateResponseBody;class GetOSSInfoForCardTemplateResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:GetOSSInfoForCardTemplateResponseBody}}}t.GetOSSInfoForCardTemplateResponse=GetOSSInfoForCardTemplateResponse;class ListTagResourcesRequest extends d.Model{constructor(e){super(e)}static names(){return{nextToken:"NextToken",ownerId:"OwnerId",pageSize:"PageSize",prodCode:"ProdCode",regionId:"RegionId",resourceId:"ResourceId",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",resourceType:"ResourceType",tag:"Tag"}}static types(){return{nextToken:"string",ownerId:"number",pageSize:"number",prodCode:"string",regionId:"string",resourceId:{type:"array",itemType:"string"},resourceOwnerAccount:"string",resourceOwnerId:"number",resourceType:"string",tag:{type:"array",itemType:ListTagResourcesRequestTag}}}}t.ListTagResourcesRequest=ListTagResourcesRequest;class ListTagResourcesResponseBody extends d.Model{constructor(e){super(e)}static names(){return{code:"Code",nextToken:"NextToken",requestId:"RequestId",tagResources:"TagResources"}}static types(){return{code:"string",nextToken:"string",requestId:"string",tagResources:ListTagResourcesResponseBodyTagResources}}}t.ListTagResourcesResponseBody=ListTagResourcesResponseBody;class ListTagResourcesResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:ListTagResourcesResponseBody}}}t.ListTagResourcesResponse=ListTagResourcesResponse;class ModifySmsSignRequest extends d.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",remark:"Remark",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",signFileList:"SignFileList",signName:"SignName",signSource:"SignSource",signType:"SignType"}}static types(){return{ownerId:"number",remark:"string",resourceOwnerAccount:"string",resourceOwnerId:"number",signFileList:{type:"array",itemType:ModifySmsSignRequestSignFileList},signName:"string",signSource:"number",signType:"number"}}}t.ModifySmsSignRequest=ModifySmsSignRequest;class ModifySmsSignResponseBody extends d.Model{constructor(e){super(e)}static names(){return{code:"Code",message:"Message",requestId:"RequestId",signName:"SignName"}}static types(){return{code:"string",message:"string",requestId:"string",signName:"string"}}}t.ModifySmsSignResponseBody=ModifySmsSignResponseBody;class ModifySmsSignResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:ModifySmsSignResponseBody}}}t.ModifySmsSignResponse=ModifySmsSignResponse;class ModifySmsTemplateRequest extends d.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",remark:"Remark",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",templateCode:"TemplateCode",templateContent:"TemplateContent",templateName:"TemplateName",templateType:"TemplateType"}}static types(){return{ownerId:"number",remark:"string",resourceOwnerAccount:"string",resourceOwnerId:"number",templateCode:"string",templateContent:"string",templateName:"string",templateType:"number"}}}t.ModifySmsTemplateRequest=ModifySmsTemplateRequest;class ModifySmsTemplateResponseBody extends d.Model{constructor(e){super(e)}static names(){return{code:"Code",message:"Message",requestId:"RequestId",templateCode:"TemplateCode"}}static types(){return{code:"string",message:"string",requestId:"string",templateCode:"string"}}}t.ModifySmsTemplateResponseBody=ModifySmsTemplateResponseBody;class ModifySmsTemplateResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:ModifySmsTemplateResponseBody}}}t.ModifySmsTemplateResponse=ModifySmsTemplateResponse;class QueryCardSmsTemplateRequest extends d.Model{constructor(e){super(e)}static names(){return{templateCode:"TemplateCode"}}static types(){return{templateCode:"string"}}}t.QueryCardSmsTemplateRequest=QueryCardSmsTemplateRequest;class QueryCardSmsTemplateResponseBody extends d.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",requestId:"RequestId",success:"Success"}}static types(){return{code:"string",data:QueryCardSmsTemplateResponseBodyData,requestId:"string",success:"boolean"}}}t.QueryCardSmsTemplateResponseBody=QueryCardSmsTemplateResponseBody;class QueryCardSmsTemplateResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:QueryCardSmsTemplateResponseBody}}}t.QueryCardSmsTemplateResponse=QueryCardSmsTemplateResponse;class QueryCardSmsTemplateReportRequest extends d.Model{constructor(e){super(e)}static names(){return{endDate:"EndDate",startDate:"StartDate",templateCodes:"TemplateCodes"}}static types(){return{endDate:"string",startDate:"string",templateCodes:{type:"array",itemType:"string"}}}}t.QueryCardSmsTemplateReportRequest=QueryCardSmsTemplateReportRequest;class QueryCardSmsTemplateReportResponseBody extends d.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",requestId:"RequestId",success:"Success"}}static types(){return{code:"string",data:{type:"array",itemType:{type:"map",keyType:"string",valueType:"any"}},requestId:"string",success:"boolean"}}}t.QueryCardSmsTemplateReportResponseBody=QueryCardSmsTemplateReportResponseBody;class QueryCardSmsTemplateReportResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:QueryCardSmsTemplateReportResponseBody}}}t.QueryCardSmsTemplateReportResponse=QueryCardSmsTemplateReportResponse;class QuerySendDetailsRequest extends d.Model{constructor(e){super(e)}static names(){return{bizId:"BizId",currentPage:"CurrentPage",ownerId:"OwnerId",pageSize:"PageSize",phoneNumber:"PhoneNumber",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",sendDate:"SendDate"}}static types(){return{bizId:"string",currentPage:"number",ownerId:"number",pageSize:"number",phoneNumber:"string",resourceOwnerAccount:"string",resourceOwnerId:"number",sendDate:"string"}}}t.QuerySendDetailsRequest=QuerySendDetailsRequest;class QuerySendDetailsResponseBody extends d.Model{constructor(e){super(e)}static names(){return{code:"Code",message:"Message",requestId:"RequestId",smsSendDetailDTOs:"SmsSendDetailDTOs",totalCount:"TotalCount"}}static types(){return{code:"string",message:"string",requestId:"string",smsSendDetailDTOs:QuerySendDetailsResponseBodySmsSendDetailDTOs,totalCount:"string"}}}t.QuerySendDetailsResponseBody=QuerySendDetailsResponseBody;class QuerySendDetailsResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:QuerySendDetailsResponseBody}}}t.QuerySendDetailsResponse=QuerySendDetailsResponse;class QuerySendStatisticsRequest extends d.Model{constructor(e){super(e)}static names(){return{endDate:"EndDate",isGlobe:"IsGlobe",ownerId:"OwnerId",pageIndex:"PageIndex",pageSize:"PageSize",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",signName:"SignName",startDate:"StartDate",templateType:"TemplateType"}}static types(){return{endDate:"string",isGlobe:"number",ownerId:"number",pageIndex:"number",pageSize:"number",resourceOwnerAccount:"string",resourceOwnerId:"number",signName:"string",startDate:"string",templateType:"number"}}}t.QuerySendStatisticsRequest=QuerySendStatisticsRequest;class QuerySendStatisticsResponseBody extends d.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",message:"Message",requestId:"RequestId"}}static types(){return{code:"string",data:QuerySendStatisticsResponseBodyData,message:"string",requestId:"string"}}}t.QuerySendStatisticsResponseBody=QuerySendStatisticsResponseBody;class QuerySendStatisticsResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:QuerySendStatisticsResponseBody}}}t.QuerySendStatisticsResponse=QuerySendStatisticsResponse;class QueryShortUrlRequest extends d.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",shortUrl:"ShortUrl"}}static types(){return{ownerId:"number",resourceOwnerAccount:"string",resourceOwnerId:"number",shortUrl:"string"}}}t.QueryShortUrlRequest=QueryShortUrlRequest;class QueryShortUrlResponseBody extends d.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",message:"Message",requestId:"RequestId"}}static types(){return{code:"string",data:QueryShortUrlResponseBodyData,message:"string",requestId:"string"}}}t.QueryShortUrlResponseBody=QueryShortUrlResponseBody;class QueryShortUrlResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:QueryShortUrlResponseBody}}}t.QueryShortUrlResponse=QueryShortUrlResponse;class QuerySmsSignRequest extends d.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",signName:"SignName"}}static types(){return{ownerId:"number",resourceOwnerAccount:"string",resourceOwnerId:"number",signName:"string"}}}t.QuerySmsSignRequest=QuerySmsSignRequest;class QuerySmsSignResponseBody extends d.Model{constructor(e){super(e)}static names(){return{code:"Code",createDate:"CreateDate",message:"Message",reason:"Reason",requestId:"RequestId",signName:"SignName",signStatus:"SignStatus"}}static types(){return{code:"string",createDate:"string",message:"string",reason:"string",requestId:"string",signName:"string",signStatus:"number"}}}t.QuerySmsSignResponseBody=QuerySmsSignResponseBody;class QuerySmsSignResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:QuerySmsSignResponseBody}}}t.QuerySmsSignResponse=QuerySmsSignResponse;class QuerySmsSignListRequest extends d.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",pageIndex:"PageIndex",pageSize:"PageSize",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId"}}static types(){return{ownerId:"number",pageIndex:"number",pageSize:"number",resourceOwnerAccount:"string",resourceOwnerId:"number"}}}t.QuerySmsSignListRequest=QuerySmsSignListRequest;class QuerySmsSignListResponseBody extends d.Model{constructor(e){super(e)}static names(){return{code:"Code",currentPage:"CurrentPage",message:"Message",pageSize:"PageSize",requestId:"RequestId",smsSignList:"SmsSignList",totalCount:"TotalCount"}}static types(){return{code:"string",currentPage:"number",message:"string",pageSize:"number",requestId:"string",smsSignList:{type:"array",itemType:QuerySmsSignListResponseBodySmsSignList},totalCount:"number"}}}t.QuerySmsSignListResponseBody=QuerySmsSignListResponseBody;class QuerySmsSignListResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:QuerySmsSignListResponseBody}}}t.QuerySmsSignListResponse=QuerySmsSignListResponse;class QuerySmsTemplateRequest extends d.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",templateCode:"TemplateCode"}}static types(){return{ownerId:"number",resourceOwnerAccount:"string",resourceOwnerId:"number",templateCode:"string"}}}t.QuerySmsTemplateRequest=QuerySmsTemplateRequest;class QuerySmsTemplateResponseBody extends d.Model{constructor(e){super(e)}static names(){return{code:"Code",createDate:"CreateDate",message:"Message",reason:"Reason",requestId:"RequestId",templateCode:"TemplateCode",templateContent:"TemplateContent",templateName:"TemplateName",templateStatus:"TemplateStatus",templateType:"TemplateType"}}static types(){return{code:"string",createDate:"string",message:"string",reason:"string",requestId:"string",templateCode:"string",templateContent:"string",templateName:"string",templateStatus:"number",templateType:"number"}}}t.QuerySmsTemplateResponseBody=QuerySmsTemplateResponseBody;class QuerySmsTemplateResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:QuerySmsTemplateResponseBody}}}t.QuerySmsTemplateResponse=QuerySmsTemplateResponse;class QuerySmsTemplateListRequest extends d.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",pageIndex:"PageIndex",pageSize:"PageSize",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId"}}static types(){return{ownerId:"number",pageIndex:"number",pageSize:"number",resourceOwnerAccount:"string",resourceOwnerId:"number"}}}t.QuerySmsTemplateListRequest=QuerySmsTemplateListRequest;class QuerySmsTemplateListResponseBody extends d.Model{constructor(e){super(e)}static names(){return{code:"Code",currentPage:"CurrentPage",message:"Message",pageSize:"PageSize",requestId:"RequestId",smsTemplateList:"SmsTemplateList",totalCount:"TotalCount"}}static types(){return{code:"string",currentPage:"number",message:"string",pageSize:"number",requestId:"string",smsTemplateList:{type:"array",itemType:QuerySmsTemplateListResponseBodySmsTemplateList},totalCount:"number"}}}t.QuerySmsTemplateListResponseBody=QuerySmsTemplateListResponseBody;class QuerySmsTemplateListResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:QuerySmsTemplateListResponseBody}}}t.QuerySmsTemplateListResponse=QuerySmsTemplateListResponse;class SendBatchCardSmsRequest extends d.Model{constructor(e){super(e)}static names(){return{cardTemplateCode:"CardTemplateCode",cardTemplateParamJson:"CardTemplateParamJson",digitalTemplateCode:"DigitalTemplateCode",digitalTemplateParamJson:"DigitalTemplateParamJson",fallbackType:"FallbackType",outId:"OutId",phoneNumberJson:"PhoneNumberJson",signNameJson:"SignNameJson",smsTemplateCode:"SmsTemplateCode",smsTemplateParamJson:"SmsTemplateParamJson",smsUpExtendCodeJson:"SmsUpExtendCodeJson"}}static types(){return{cardTemplateCode:"string",cardTemplateParamJson:"string",digitalTemplateCode:"string",digitalTemplateParamJson:"string",fallbackType:"string",outId:"string",phoneNumberJson:"string",signNameJson:"string",smsTemplateCode:"string",smsTemplateParamJson:"string",smsUpExtendCodeJson:"string"}}}t.SendBatchCardSmsRequest=SendBatchCardSmsRequest;class SendBatchCardSmsResponseBody extends d.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",requestId:"RequestId",success:"Success"}}static types(){return{code:"string",data:SendBatchCardSmsResponseBodyData,requestId:"string",success:"boolean"}}}t.SendBatchCardSmsResponseBody=SendBatchCardSmsResponseBody;class SendBatchCardSmsResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:SendBatchCardSmsResponseBody}}}t.SendBatchCardSmsResponse=SendBatchCardSmsResponse;class SendBatchSmsRequest extends d.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",phoneNumberJson:"PhoneNumberJson",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",signNameJson:"SignNameJson",smsUpExtendCodeJson:"SmsUpExtendCodeJson",templateCode:"TemplateCode",templateParamJson:"TemplateParamJson"}}static types(){return{ownerId:"number",phoneNumberJson:"string",resourceOwnerAccount:"string",resourceOwnerId:"number",signNameJson:"string",smsUpExtendCodeJson:"string",templateCode:"string",templateParamJson:"string"}}}t.SendBatchSmsRequest=SendBatchSmsRequest;class SendBatchSmsResponseBody extends d.Model{constructor(e){super(e)}static names(){return{bizId:"BizId",code:"Code",message:"Message",requestId:"RequestId"}}static types(){return{bizId:"string",code:"string",message:"string",requestId:"string"}}}t.SendBatchSmsResponseBody=SendBatchSmsResponseBody;class SendBatchSmsResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:SendBatchSmsResponseBody}}}t.SendBatchSmsResponse=SendBatchSmsResponse;class SendCardSmsRequest extends d.Model{constructor(e){super(e)}static names(){return{cardObjects:"CardObjects",cardTemplateCode:"CardTemplateCode",digitalTemplateCode:"DigitalTemplateCode",digitalTemplateParam:"DigitalTemplateParam",fallbackType:"FallbackType",outId:"OutId",signName:"SignName",smsTemplateCode:"SmsTemplateCode",smsTemplateParam:"SmsTemplateParam",smsUpExtendCode:"SmsUpExtendCode"}}static types(){return{cardObjects:{type:"array",itemType:SendCardSmsRequestCardObjects},cardTemplateCode:"string",digitalTemplateCode:"string",digitalTemplateParam:"string",fallbackType:"string",outId:"string",signName:"string",smsTemplateCode:"string",smsTemplateParam:"string",smsUpExtendCode:"string"}}}t.SendCardSmsRequest=SendCardSmsRequest;class SendCardSmsResponseBody extends d.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",requestId:"RequestId",success:"Success"}}static types(){return{code:"string",data:SendCardSmsResponseBodyData,requestId:"string",success:"boolean"}}}t.SendCardSmsResponseBody=SendCardSmsResponseBody;class SendCardSmsResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:SendCardSmsResponseBody}}}t.SendCardSmsResponse=SendCardSmsResponse;class SendSmsRequest extends d.Model{constructor(e){super(e)}static names(){return{outId:"OutId",ownerId:"OwnerId",phoneNumbers:"PhoneNumbers",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",signName:"SignName",smsUpExtendCode:"SmsUpExtendCode",templateCode:"TemplateCode",templateParam:"TemplateParam"}}static types(){return{outId:"string",ownerId:"number",phoneNumbers:"string",resourceOwnerAccount:"string",resourceOwnerId:"number",signName:"string",smsUpExtendCode:"string",templateCode:"string",templateParam:"string"}}}t.SendSmsRequest=SendSmsRequest;class SendSmsResponseBody extends d.Model{constructor(e){super(e)}static names(){return{bizId:"BizId",code:"Code",message:"Message",requestId:"RequestId"}}static types(){return{bizId:"string",code:"string",message:"string",requestId:"string"}}}t.SendSmsResponseBody=SendSmsResponseBody;class SendSmsResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:SendSmsResponseBody}}}t.SendSmsResponse=SendSmsResponse;class TagResourcesRequest extends d.Model{constructor(e){super(e)}static names(){return{ownerId:"OwnerId",prodCode:"ProdCode",regionId:"RegionId",resourceId:"ResourceId",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",resourceType:"ResourceType",tag:"Tag"}}static types(){return{ownerId:"number",prodCode:"string",regionId:"string",resourceId:{type:"array",itemType:"string"},resourceOwnerAccount:"string",resourceOwnerId:"number",resourceType:"string",tag:{type:"array",itemType:TagResourcesRequestTag}}}}t.TagResourcesRequest=TagResourcesRequest;class TagResourcesResponseBody extends d.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",requestId:"RequestId"}}static types(){return{code:"string",data:"string",requestId:"string"}}}t.TagResourcesResponseBody=TagResourcesResponseBody;class TagResourcesResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:TagResourcesResponseBody}}}t.TagResourcesResponse=TagResourcesResponse;class UntagResourcesRequest extends d.Model{constructor(e){super(e)}static names(){return{all:"All",ownerId:"OwnerId",prodCode:"ProdCode",regionId:"RegionId",resourceId:"ResourceId",resourceOwnerAccount:"ResourceOwnerAccount",resourceOwnerId:"ResourceOwnerId",resourceType:"ResourceType",tagKey:"TagKey"}}static types(){return{all:"boolean",ownerId:"number",prodCode:"string",regionId:"string",resourceId:{type:"array",itemType:"string"},resourceOwnerAccount:"string",resourceOwnerId:"number",resourceType:"string",tagKey:{type:"array",itemType:"string"}}}}t.UntagResourcesRequest=UntagResourcesRequest;class UntagResourcesResponseBody extends d.Model{constructor(e){super(e)}static names(){return{code:"Code",data:"Data",requestId:"RequestId"}}static types(){return{code:"string",data:"string",requestId:"string"}}}t.UntagResourcesResponseBody=UntagResourcesResponseBody;class UntagResourcesResponse extends d.Model{constructor(e){super(e)}static names(){return{headers:"headers",statusCode:"statusCode",body:"body"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},statusCode:"number",body:UntagResourcesResponseBody}}}t.UntagResourcesResponse=UntagResourcesResponse;class AddShortUrlResponseBodyData extends d.Model{constructor(e){super(e)}static names(){return{expireDate:"ExpireDate",shortUrl:"ShortUrl",sourceUrl:"SourceUrl"}}static types(){return{expireDate:"string",shortUrl:"string",sourceUrl:"string"}}}t.AddShortUrlResponseBodyData=AddShortUrlResponseBodyData;class AddSmsSignRequestSignFileList extends d.Model{constructor(e){super(e)}static names(){return{fileContents:"FileContents",fileSuffix:"FileSuffix"}}static types(){return{fileContents:"string",fileSuffix:"string"}}}t.AddSmsSignRequestSignFileList=AddSmsSignRequestSignFileList;class CreateCardSmsTemplateResponseBodyData extends d.Model{constructor(e){super(e)}static names(){return{templateCode:"TemplateCode"}}static types(){return{templateCode:"string"}}}t.CreateCardSmsTemplateResponseBodyData=CreateCardSmsTemplateResponseBodyData;class GetCardSmsLinkResponseBodyData extends d.Model{constructor(e){super(e)}static names(){return{cardPhoneNumbers:"CardPhoneNumbers",cardSignNames:"CardSignNames",cardSmsLinks:"CardSmsLinks",cardTmpState:"CardTmpState",notMediaMobiles:"NotMediaMobiles"}}static types(){return{cardPhoneNumbers:"string",cardSignNames:"string",cardSmsLinks:"string",cardTmpState:"number",notMediaMobiles:"string"}}}t.GetCardSmsLinkResponseBodyData=GetCardSmsLinkResponseBodyData;class GetMediaResourceIdResponseBodyData extends d.Model{constructor(e){super(e)}static names(){return{resUrlDownload:"ResUrlDownload",resourceId:"ResourceId"}}static types(){return{resUrlDownload:"string",resourceId:"number"}}}t.GetMediaResourceIdResponseBodyData=GetMediaResourceIdResponseBodyData;class GetOSSInfoForCardTemplateResponseBodyData extends d.Model{constructor(e){super(e)}static names(){return{accessKeyId:"AccessKeyId",aliUid:"AliUid",bucket:"Bucket",expireTime:"ExpireTime",host:"Host",policy:"Policy",signature:"Signature",startPath:"StartPath"}}static types(){return{accessKeyId:"string",aliUid:"string",bucket:"string",expireTime:"string",host:"string",policy:"string",signature:"string",startPath:"string"}}}t.GetOSSInfoForCardTemplateResponseBodyData=GetOSSInfoForCardTemplateResponseBodyData;class ListTagResourcesRequestTag extends d.Model{constructor(e){super(e)}static names(){return{key:"Key",value:"Value"}}static types(){return{key:"string",value:"string"}}}t.ListTagResourcesRequestTag=ListTagResourcesRequestTag;class ListTagResourcesResponseBodyTagResourcesTagResource extends d.Model{constructor(e){super(e)}static names(){return{resourceId:"ResourceId",resourceType:"ResourceType",tagKey:"TagKey",tagValue:"TagValue"}}static types(){return{resourceId:"string",resourceType:"string",tagKey:"string",tagValue:"string"}}}t.ListTagResourcesResponseBodyTagResourcesTagResource=ListTagResourcesResponseBodyTagResourcesTagResource;class ListTagResourcesResponseBodyTagResources extends d.Model{constructor(e){super(e)}static names(){return{tagResource:"TagResource"}}static types(){return{tagResource:{type:"array",itemType:ListTagResourcesResponseBodyTagResourcesTagResource}}}}t.ListTagResourcesResponseBodyTagResources=ListTagResourcesResponseBodyTagResources;class ModifySmsSignRequestSignFileList extends d.Model{constructor(e){super(e)}static names(){return{fileContents:"FileContents",fileSuffix:"FileSuffix"}}static types(){return{fileContents:"string",fileSuffix:"string"}}}t.ModifySmsSignRequestSignFileList=ModifySmsSignRequestSignFileList;class QueryCardSmsTemplateResponseBodyData extends d.Model{constructor(e){super(e)}static names(){return{templates:"Templates"}}static types(){return{templates:{type:"array",itemType:{type:"map",keyType:"string",valueType:"any"}}}}}t.QueryCardSmsTemplateResponseBodyData=QueryCardSmsTemplateResponseBodyData;class QuerySendDetailsResponseBodySmsSendDetailDTOsSmsSendDetailDTO extends d.Model{constructor(e){super(e)}static names(){return{content:"Content",errCode:"ErrCode",outId:"OutId",phoneNum:"PhoneNum",receiveDate:"ReceiveDate",sendDate:"SendDate",sendStatus:"SendStatus",templateCode:"TemplateCode"}}static types(){return{content:"string",errCode:"string",outId:"string",phoneNum:"string",receiveDate:"string",sendDate:"string",sendStatus:"number",templateCode:"string"}}}t.QuerySendDetailsResponseBodySmsSendDetailDTOsSmsSendDetailDTO=QuerySendDetailsResponseBodySmsSendDetailDTOsSmsSendDetailDTO;class QuerySendDetailsResponseBodySmsSendDetailDTOs extends d.Model{constructor(e){super(e)}static names(){return{smsSendDetailDTO:"SmsSendDetailDTO"}}static types(){return{smsSendDetailDTO:{type:"array",itemType:QuerySendDetailsResponseBodySmsSendDetailDTOsSmsSendDetailDTO}}}}t.QuerySendDetailsResponseBodySmsSendDetailDTOs=QuerySendDetailsResponseBodySmsSendDetailDTOs;class QuerySendStatisticsResponseBodyDataTargetList extends d.Model{constructor(e){super(e)}static names(){return{noRespondedCount:"NoRespondedCount",respondedFailCount:"RespondedFailCount",respondedSuccessCount:"RespondedSuccessCount",sendDate:"SendDate",totalCount:"TotalCount"}}static types(){return{noRespondedCount:"number",respondedFailCount:"number",respondedSuccessCount:"number",sendDate:"string",totalCount:"number"}}}t.QuerySendStatisticsResponseBodyDataTargetList=QuerySendStatisticsResponseBodyDataTargetList;class QuerySendStatisticsResponseBodyData extends d.Model{constructor(e){super(e)}static names(){return{targetList:"TargetList",totalSize:"TotalSize"}}static types(){return{targetList:{type:"array",itemType:QuerySendStatisticsResponseBodyDataTargetList},totalSize:"number"}}}t.QuerySendStatisticsResponseBodyData=QuerySendStatisticsResponseBodyData;class QueryShortUrlResponseBodyData extends d.Model{constructor(e){super(e)}static names(){return{createDate:"CreateDate",expireDate:"ExpireDate",pageViewCount:"PageViewCount",shortUrl:"ShortUrl",shortUrlName:"ShortUrlName",shortUrlStatus:"ShortUrlStatus",sourceUrl:"SourceUrl",uniqueVisitorCount:"UniqueVisitorCount"}}static types(){return{createDate:"string",expireDate:"string",pageViewCount:"string",shortUrl:"string",shortUrlName:"string",shortUrlStatus:"string",sourceUrl:"string",uniqueVisitorCount:"string"}}}t.QueryShortUrlResponseBodyData=QueryShortUrlResponseBodyData;class QuerySmsSignListResponseBodySmsSignListReason extends d.Model{constructor(e){super(e)}static names(){return{rejectDate:"RejectDate",rejectInfo:"RejectInfo",rejectSubInfo:"RejectSubInfo"}}static types(){return{rejectDate:"string",rejectInfo:"string",rejectSubInfo:"string"}}}t.QuerySmsSignListResponseBodySmsSignListReason=QuerySmsSignListResponseBodySmsSignListReason;class QuerySmsSignListResponseBodySmsSignList extends d.Model{constructor(e){super(e)}static names(){return{auditStatus:"AuditStatus",businessType:"BusinessType",createDate:"CreateDate",orderId:"OrderId",reason:"Reason",signName:"SignName"}}static types(){return{auditStatus:"string",businessType:"string",createDate:"string",orderId:"string",reason:QuerySmsSignListResponseBodySmsSignListReason,signName:"string"}}}t.QuerySmsSignListResponseBodySmsSignList=QuerySmsSignListResponseBodySmsSignList;class QuerySmsTemplateListResponseBodySmsTemplateListReason extends d.Model{constructor(e){super(e)}static names(){return{rejectDate:"RejectDate",rejectInfo:"RejectInfo",rejectSubInfo:"RejectSubInfo"}}static types(){return{rejectDate:"string",rejectInfo:"string",rejectSubInfo:"string"}}}t.QuerySmsTemplateListResponseBodySmsTemplateListReason=QuerySmsTemplateListResponseBodySmsTemplateListReason;class QuerySmsTemplateListResponseBodySmsTemplateList extends d.Model{constructor(e){super(e)}static names(){return{auditStatus:"AuditStatus",createDate:"CreateDate",orderId:"OrderId",outerTemplateType:"OuterTemplateType",reason:"Reason",templateCode:"TemplateCode",templateContent:"TemplateContent",templateName:"TemplateName",templateType:"TemplateType"}}static types(){return{auditStatus:"string",createDate:"string",orderId:"string",outerTemplateType:"number",reason:QuerySmsTemplateListResponseBodySmsTemplateListReason,templateCode:"string",templateContent:"string",templateName:"string",templateType:"number"}}}t.QuerySmsTemplateListResponseBodySmsTemplateList=QuerySmsTemplateListResponseBodySmsTemplateList;class SendBatchCardSmsResponseBodyData extends d.Model{constructor(e){super(e)}static names(){return{bizCardId:"BizCardId",bizDigitalId:"BizDigitalId",bizSmsId:"BizSmsId",cardTmpState:"CardTmpState",mediaMobiles:"MediaMobiles",notMediaMobiles:"NotMediaMobiles"}}static types(){return{bizCardId:"string",bizDigitalId:"string",bizSmsId:"string",cardTmpState:"number",mediaMobiles:"string",notMediaMobiles:"string"}}}t.SendBatchCardSmsResponseBodyData=SendBatchCardSmsResponseBodyData;class SendCardSmsRequestCardObjects extends d.Model{constructor(e){super(e)}static names(){return{customUrl:"customUrl",dyncParams:"dyncParams",mobile:"mobile"}}static types(){return{customUrl:"string",dyncParams:"string",mobile:"string"}}}t.SendCardSmsRequestCardObjects=SendCardSmsRequestCardObjects;class SendCardSmsResponseBodyData extends d.Model{constructor(e){super(e)}static names(){return{bizCardId:"BizCardId",bizDigitalId:"BizDigitalId",bizSmsId:"BizSmsId",cardTmpState:"CardTmpState",mediaMobiles:"MediaMobiles",notMediaMobiles:"NotMediaMobiles"}}static types(){return{bizCardId:"string",bizDigitalId:"string",bizSmsId:"string",cardTmpState:"number",mediaMobiles:"string",notMediaMobiles:"string"}}}t.SendCardSmsResponseBodyData=SendCardSmsResponseBodyData;class TagResourcesRequestTag extends d.Model{constructor(e){super(e)}static names(){return{key:"Key",value:"Value"}}static types(){return{key:"string",value:"string"}}}t.TagResourcesRequestTag=TagResourcesRequestTag;class Client extends a.default{constructor(e){super(e);this._endpointRule="central";this._endpointMap={"ap-southeast-1":"dysmsapi.ap-southeast-1.aliyuncs.com","ap-southeast-5":"dysmsapi-xman.ap-southeast-5.aliyuncs.com","cn-beijing":"dysmsapi-proxy.cn-beijing.aliyuncs.com","cn-hongkong":"dysmsapi-xman.cn-hongkong.aliyuncs.com"};this.checkConfig(e);this._endpoint=this.getEndpoint("dysmsapi",this._regionId,this._endpointRule,this._network,this._suffix,this._endpointMap,this._endpoint)}getEndpoint(e,t,r,s,n,o,a){if(!i.default.empty(a)){return a}if(!i.default.isUnset(o)&&!i.default.empty(o[t])){return o[t]}return l.default.getEndpointRules(e,t,r,s,n)}async addShortUrlWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}let s={};if(!i.default.isUnset(e.effectiveDays)){s["EffectiveDays"]=e.effectiveDays}if(!i.default.isUnset(e.shortUrlName)){s["ShortUrlName"]=e.shortUrlName}if(!i.default.isUnset(e.sourceUrl)){s["SourceUrl"]=e.sourceUrl}let n=new u.OpenApiRequest({query:c.default.query(r),body:c.default.parseToMap(s)});let o=new u.Params({action:"AddShortUrl",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(o,n,t),new AddShortUrlResponse({}))}async addShortUrl(e){let t=new o.RuntimeOptions({});return await this.addShortUrlWithOptions(e,t)}async addSmsSignWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.remark)){r["Remark"]=e.remark}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.signName)){r["SignName"]=e.signName}if(!i.default.isUnset(e.signSource)){r["SignSource"]=e.signSource}if(!i.default.isUnset(e.signType)){r["SignType"]=e.signType}let s={};if(!i.default.isUnset(e.signFileList)){s["SignFileList"]=e.signFileList}let n=new u.OpenApiRequest({query:c.default.query(r),body:c.default.parseToMap(s)});let o=new u.Params({action:"AddSmsSign",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(o,n,t),new AddSmsSignResponse({}))}async addSmsSign(e){let t=new o.RuntimeOptions({});return await this.addSmsSignWithOptions(e,t)}async addSmsTemplateWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.remark)){r["Remark"]=e.remark}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.templateContent)){r["TemplateContent"]=e.templateContent}if(!i.default.isUnset(e.templateName)){r["TemplateName"]=e.templateName}if(!i.default.isUnset(e.templateType)){r["TemplateType"]=e.templateType}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"AddSmsTemplate",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(n,s,t),new AddSmsTemplateResponse({}))}async addSmsTemplate(e){let t=new o.RuntimeOptions({});return await this.addSmsTemplateWithOptions(e,t)}async checkMobilesCardSupportWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.mobiles)){r["Mobiles"]=e.mobiles}if(!i.default.isUnset(e.templateCode)){r["TemplateCode"]=e.templateCode}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"CheckMobilesCardSupport",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(n,s,t),new CheckMobilesCardSupportResponse({}))}async checkMobilesCardSupport(e){let t=new o.RuntimeOptions({});return await this.checkMobilesCardSupportWithOptions(e,t)}async createCardSmsTemplateWithOptions(e,t){i.default.validateModel(e);let r=new CreateCardSmsTemplateShrinkRequest({});c.default.convert(e,r);if(!i.default.isUnset(e.template)){r.templateShrink=c.default.arrayToStringWithSpecifiedStyle(e.template,"Template","json")}let s={};if(!i.default.isUnset(r.factorys)){s["Factorys"]=r.factorys}if(!i.default.isUnset(r.memo)){s["Memo"]=r.memo}if(!i.default.isUnset(r.templateShrink)){s["Template"]=r.templateShrink}if(!i.default.isUnset(r.templateName)){s["TemplateName"]=r.templateName}let n=new u.OpenApiRequest({query:c.default.query(s)});let o=new u.Params({action:"CreateCardSmsTemplate",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(o,n,t),new CreateCardSmsTemplateResponse({}))}async createCardSmsTemplate(e){let t=new o.RuntimeOptions({});return await this.createCardSmsTemplateWithOptions(e,t)}async deleteShortUrlWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}let s={};if(!i.default.isUnset(e.sourceUrl)){s["SourceUrl"]=e.sourceUrl}let n=new u.OpenApiRequest({query:c.default.query(r),body:c.default.parseToMap(s)});let o=new u.Params({action:"DeleteShortUrl",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(o,n,t),new DeleteShortUrlResponse({}))}async deleteShortUrl(e){let t=new o.RuntimeOptions({});return await this.deleteShortUrlWithOptions(e,t)}async deleteSmsSignWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.signName)){r["SignName"]=e.signName}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"DeleteSmsSign",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(n,s,t),new DeleteSmsSignResponse({}))}async deleteSmsSign(e){let t=new o.RuntimeOptions({});return await this.deleteSmsSignWithOptions(e,t)}async deleteSmsTemplateWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.templateCode)){r["TemplateCode"]=e.templateCode}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"DeleteSmsTemplate",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(n,s,t),new DeleteSmsTemplateResponse({}))}async deleteSmsTemplate(e){let t=new o.RuntimeOptions({});return await this.deleteSmsTemplateWithOptions(e,t)}async getCardSmsLinkWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.cardCodeType)){r["CardCodeType"]=e.cardCodeType}if(!i.default.isUnset(e.cardLinkType)){r["CardLinkType"]=e.cardLinkType}if(!i.default.isUnset(e.cardTemplateCode)){r["CardTemplateCode"]=e.cardTemplateCode}if(!i.default.isUnset(e.cardTemplateParamJson)){r["CardTemplateParamJson"]=e.cardTemplateParamJson}if(!i.default.isUnset(e.customShortCodeJson)){r["CustomShortCodeJson"]=e.customShortCodeJson}if(!i.default.isUnset(e.domain)){r["Domain"]=e.domain}if(!i.default.isUnset(e.outId)){r["OutId"]=e.outId}if(!i.default.isUnset(e.phoneNumberJson)){r["PhoneNumberJson"]=e.phoneNumberJson}if(!i.default.isUnset(e.signNameJson)){r["SignNameJson"]=e.signNameJson}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"GetCardSmsLink",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(n,s,t),new GetCardSmsLinkResponse({}))}async getCardSmsLink(e){let t=new o.RuntimeOptions({});return await this.getCardSmsLinkWithOptions(e,t)}async getMediaResourceIdWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.extendInfo)){r["ExtendInfo"]=e.extendInfo}if(!i.default.isUnset(e.fileSize)){r["FileSize"]=e.fileSize}if(!i.default.isUnset(e.memo)){r["Memo"]=e.memo}if(!i.default.isUnset(e.ossKey)){r["OssKey"]=e.ossKey}if(!i.default.isUnset(e.resourceType)){r["ResourceType"]=e.resourceType}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"GetMediaResourceId",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(n,s,t),new GetMediaResourceIdResponse({}))}async getMediaResourceId(e){let t=new o.RuntimeOptions({});return await this.getMediaResourceIdWithOptions(e,t)}async getOSSInfoForCardTemplateWithOptions(e){let t=new u.OpenApiRequest({});let r=new u.Params({action:"GetOSSInfoForCardTemplate",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(r,t,e),new GetOSSInfoForCardTemplateResponse({}))}async getOSSInfoForCardTemplate(){let e=new o.RuntimeOptions({});return await this.getOSSInfoForCardTemplateWithOptions(e)}async listTagResourcesWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.nextToken)){r["NextToken"]=e.nextToken}if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.pageSize)){r["PageSize"]=e.pageSize}if(!i.default.isUnset(e.prodCode)){r["ProdCode"]=e.prodCode}if(!i.default.isUnset(e.regionId)){r["RegionId"]=e.regionId}if(!i.default.isUnset(e.resourceId)){r["ResourceId"]=e.resourceId}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.resourceType)){r["ResourceType"]=e.resourceType}if(!i.default.isUnset(e.tag)){r["Tag"]=e.tag}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"ListTagResources",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(n,s,t),new ListTagResourcesResponse({}))}async listTagResources(e){let t=new o.RuntimeOptions({});return await this.listTagResourcesWithOptions(e,t)}async modifySmsSignWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.remark)){r["Remark"]=e.remark}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.signName)){r["SignName"]=e.signName}if(!i.default.isUnset(e.signSource)){r["SignSource"]=e.signSource}if(!i.default.isUnset(e.signType)){r["SignType"]=e.signType}let s={};if(!i.default.isUnset(e.signFileList)){s["SignFileList"]=e.signFileList}let n=new u.OpenApiRequest({query:c.default.query(r),body:c.default.parseToMap(s)});let o=new u.Params({action:"ModifySmsSign",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(o,n,t),new ModifySmsSignResponse({}))}async modifySmsSign(e){let t=new o.RuntimeOptions({});return await this.modifySmsSignWithOptions(e,t)}async modifySmsTemplateWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.remark)){r["Remark"]=e.remark}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.templateCode)){r["TemplateCode"]=e.templateCode}if(!i.default.isUnset(e.templateContent)){r["TemplateContent"]=e.templateContent}if(!i.default.isUnset(e.templateName)){r["TemplateName"]=e.templateName}if(!i.default.isUnset(e.templateType)){r["TemplateType"]=e.templateType}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"ModifySmsTemplate",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(n,s,t),new ModifySmsTemplateResponse({}))}async modifySmsTemplate(e){let t=new o.RuntimeOptions({});return await this.modifySmsTemplateWithOptions(e,t)}async queryCardSmsTemplateWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.templateCode)){r["TemplateCode"]=e.templateCode}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"QueryCardSmsTemplate",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(n,s,t),new QueryCardSmsTemplateResponse({}))}async queryCardSmsTemplate(e){let t=new o.RuntimeOptions({});return await this.queryCardSmsTemplateWithOptions(e,t)}async queryCardSmsTemplateReportWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.endDate)){r["EndDate"]=e.endDate}if(!i.default.isUnset(e.startDate)){r["StartDate"]=e.startDate}if(!i.default.isUnset(e.templateCodes)){r["TemplateCodes"]=e.templateCodes}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"QueryCardSmsTemplateReport",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(n,s,t),new QueryCardSmsTemplateReportResponse({}))}async queryCardSmsTemplateReport(e){let t=new o.RuntimeOptions({});return await this.queryCardSmsTemplateReportWithOptions(e,t)}async querySendDetailsWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.bizId)){r["BizId"]=e.bizId}if(!i.default.isUnset(e.currentPage)){r["CurrentPage"]=e.currentPage}if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.pageSize)){r["PageSize"]=e.pageSize}if(!i.default.isUnset(e.phoneNumber)){r["PhoneNumber"]=e.phoneNumber}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.sendDate)){r["SendDate"]=e.sendDate}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"QuerySendDetails",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(n,s,t),new QuerySendDetailsResponse({}))}async querySendDetails(e){let t=new o.RuntimeOptions({});return await this.querySendDetailsWithOptions(e,t)}async querySendStatisticsWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.endDate)){r["EndDate"]=e.endDate}if(!i.default.isUnset(e.isGlobe)){r["IsGlobe"]=e.isGlobe}if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.pageIndex)){r["PageIndex"]=e.pageIndex}if(!i.default.isUnset(e.pageSize)){r["PageSize"]=e.pageSize}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.signName)){r["SignName"]=e.signName}if(!i.default.isUnset(e.startDate)){r["StartDate"]=e.startDate}if(!i.default.isUnset(e.templateType)){r["TemplateType"]=e.templateType}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"QuerySendStatistics",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(n,s,t),new QuerySendStatisticsResponse({}))}async querySendStatistics(e){let t=new o.RuntimeOptions({});return await this.querySendStatisticsWithOptions(e,t)}async queryShortUrlWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}let s={};if(!i.default.isUnset(e.shortUrl)){s["ShortUrl"]=e.shortUrl}let n=new u.OpenApiRequest({query:c.default.query(r),body:c.default.parseToMap(s)});let o=new u.Params({action:"QueryShortUrl",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(o,n,t),new QueryShortUrlResponse({}))}async queryShortUrl(e){let t=new o.RuntimeOptions({});return await this.queryShortUrlWithOptions(e,t)}async querySmsSignWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.signName)){r["SignName"]=e.signName}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"QuerySmsSign",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(n,s,t),new QuerySmsSignResponse({}))}async querySmsSign(e){let t=new o.RuntimeOptions({});return await this.querySmsSignWithOptions(e,t)}async querySmsSignListWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.pageIndex)){r["PageIndex"]=e.pageIndex}if(!i.default.isUnset(e.pageSize)){r["PageSize"]=e.pageSize}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"QuerySmsSignList",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(n,s,t),new QuerySmsSignListResponse({}))}async querySmsSignList(e){let t=new o.RuntimeOptions({});return await this.querySmsSignListWithOptions(e,t)}async querySmsTemplateWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.templateCode)){r["TemplateCode"]=e.templateCode}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"QuerySmsTemplate",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(n,s,t),new QuerySmsTemplateResponse({}))}async querySmsTemplate(e){let t=new o.RuntimeOptions({});return await this.querySmsTemplateWithOptions(e,t)}async querySmsTemplateListWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.pageIndex)){r["PageIndex"]=e.pageIndex}if(!i.default.isUnset(e.pageSize)){r["PageSize"]=e.pageSize}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"QuerySmsTemplateList",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(n,s,t),new QuerySmsTemplateListResponse({}))}async querySmsTemplateList(e){let t=new o.RuntimeOptions({});return await this.querySmsTemplateListWithOptions(e,t)}async sendBatchCardSmsWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.cardTemplateCode)){r["CardTemplateCode"]=e.cardTemplateCode}if(!i.default.isUnset(e.cardTemplateParamJson)){r["CardTemplateParamJson"]=e.cardTemplateParamJson}if(!i.default.isUnset(e.digitalTemplateCode)){r["DigitalTemplateCode"]=e.digitalTemplateCode}if(!i.default.isUnset(e.digitalTemplateParamJson)){r["DigitalTemplateParamJson"]=e.digitalTemplateParamJson}if(!i.default.isUnset(e.fallbackType)){r["FallbackType"]=e.fallbackType}if(!i.default.isUnset(e.outId)){r["OutId"]=e.outId}if(!i.default.isUnset(e.phoneNumberJson)){r["PhoneNumberJson"]=e.phoneNumberJson}if(!i.default.isUnset(e.signNameJson)){r["SignNameJson"]=e.signNameJson}if(!i.default.isUnset(e.smsTemplateCode)){r["SmsTemplateCode"]=e.smsTemplateCode}if(!i.default.isUnset(e.smsTemplateParamJson)){r["SmsTemplateParamJson"]=e.smsTemplateParamJson}if(!i.default.isUnset(e.smsUpExtendCodeJson)){r["SmsUpExtendCodeJson"]=e.smsUpExtendCodeJson}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"SendBatchCardSms",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(n,s,t),new SendBatchCardSmsResponse({}))}async sendBatchCardSms(e){let t=new o.RuntimeOptions({});return await this.sendBatchCardSmsWithOptions(e,t)}async sendBatchSmsWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.phoneNumberJson)){r["PhoneNumberJson"]=e.phoneNumberJson}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.signNameJson)){r["SignNameJson"]=e.signNameJson}if(!i.default.isUnset(e.smsUpExtendCodeJson)){r["SmsUpExtendCodeJson"]=e.smsUpExtendCodeJson}if(!i.default.isUnset(e.templateCode)){r["TemplateCode"]=e.templateCode}if(!i.default.isUnset(e.templateParamJson)){r["TemplateParamJson"]=e.templateParamJson}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"SendBatchSms",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(n,s,t),new SendBatchSmsResponse({}))}async sendBatchSms(e){let t=new o.RuntimeOptions({});return await this.sendBatchSmsWithOptions(e,t)}async sendCardSmsWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.cardObjects)){r["CardObjects"]=e.cardObjects}if(!i.default.isUnset(e.cardTemplateCode)){r["CardTemplateCode"]=e.cardTemplateCode}if(!i.default.isUnset(e.digitalTemplateCode)){r["DigitalTemplateCode"]=e.digitalTemplateCode}if(!i.default.isUnset(e.digitalTemplateParam)){r["DigitalTemplateParam"]=e.digitalTemplateParam}if(!i.default.isUnset(e.fallbackType)){r["FallbackType"]=e.fallbackType}if(!i.default.isUnset(e.outId)){r["OutId"]=e.outId}if(!i.default.isUnset(e.signName)){r["SignName"]=e.signName}if(!i.default.isUnset(e.smsTemplateCode)){r["SmsTemplateCode"]=e.smsTemplateCode}if(!i.default.isUnset(e.smsTemplateParam)){r["SmsTemplateParam"]=e.smsTemplateParam}if(!i.default.isUnset(e.smsUpExtendCode)){r["SmsUpExtendCode"]=e.smsUpExtendCode}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"SendCardSms",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(n,s,t),new SendCardSmsResponse({}))}async sendCardSms(e){let t=new o.RuntimeOptions({});return await this.sendCardSmsWithOptions(e,t)}async sendSmsWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.outId)){r["OutId"]=e.outId}if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.phoneNumbers)){r["PhoneNumbers"]=e.phoneNumbers}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.signName)){r["SignName"]=e.signName}if(!i.default.isUnset(e.smsUpExtendCode)){r["SmsUpExtendCode"]=e.smsUpExtendCode}if(!i.default.isUnset(e.templateCode)){r["TemplateCode"]=e.templateCode}if(!i.default.isUnset(e.templateParam)){r["TemplateParam"]=e.templateParam}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"SendSms",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(n,s,t),new SendSmsResponse({}))}async sendSms(e){let t=new o.RuntimeOptions({});return await this.sendSmsWithOptions(e,t)}async tagResourcesWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.prodCode)){r["ProdCode"]=e.prodCode}if(!i.default.isUnset(e.regionId)){r["RegionId"]=e.regionId}if(!i.default.isUnset(e.resourceId)){r["ResourceId"]=e.resourceId}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.resourceType)){r["ResourceType"]=e.resourceType}if(!i.default.isUnset(e.tag)){r["Tag"]=e.tag}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"TagResources",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(n,s,t),new TagResourcesResponse({}))}async tagResources(e){let t=new o.RuntimeOptions({});return await this.tagResourcesWithOptions(e,t)}async untagResourcesWithOptions(e,t){i.default.validateModel(e);let r={};if(!i.default.isUnset(e.all)){r["All"]=e.all}if(!i.default.isUnset(e.ownerId)){r["OwnerId"]=e.ownerId}if(!i.default.isUnset(e.prodCode)){r["ProdCode"]=e.prodCode}if(!i.default.isUnset(e.regionId)){r["RegionId"]=e.regionId}if(!i.default.isUnset(e.resourceId)){r["ResourceId"]=e.resourceId}if(!i.default.isUnset(e.resourceOwnerAccount)){r["ResourceOwnerAccount"]=e.resourceOwnerAccount}if(!i.default.isUnset(e.resourceOwnerId)){r["ResourceOwnerId"]=e.resourceOwnerId}if(!i.default.isUnset(e.resourceType)){r["ResourceType"]=e.resourceType}if(!i.default.isUnset(e.tagKey)){r["TagKey"]=e.tagKey}let s=new u.OpenApiRequest({query:c.default.query(r)});let n=new u.Params({action:"UntagResources",version:"2017-05-25",protocol:"HTTPS",pathname:"/",method:"POST",authType:"AK",style:"RPC",reqBodyType:"formData",bodyType:"json"});return d.cast(await this.callApi(n,s,t),new UntagResourcesResponse({}))}async untagResources(e){let t=new o.RuntimeOptions({});return await this.untagResourcesWithOptions(e,t)}}t["default"]=Client},2306:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=function(){function Client(){}Client.getEndpointRules=function(e,t,r,s,n){var i;if(s&&s.length&&s!="public"){s="-"+s}else{s=""}n=n||"";if(n.length){n="-"+n}if(r=="regional"){if(!t||!t.length){throw new Error("RegionId is empty, please set a valid RegionId")}i=""+e+n+s+"."+t+".aliyuncs.com"}else{i=""+e+n+s+".aliyuncs.com"}return i};return Client}();t["default"]=r},2652:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.InterceptorContextResponse=t.InterceptorContextConfiguration=t.InterceptorContextRequest=t.AttributeMap=t.InterceptorContext=void 0;const a=o(r(4060));const u=i(r(4165));class InterceptorContext extends u.Model{constructor(e){super(e)}static names(){return{request:"request",configuration:"configuration",response:"response"}}static types(){return{request:InterceptorContextRequest,configuration:InterceptorContextConfiguration,response:InterceptorContextResponse}}}t.InterceptorContext=InterceptorContext;class AttributeMap extends u.Model{constructor(e){super(e)}static names(){return{attributes:"attributes",key:"key"}}static types(){return{attributes:{type:"map",keyType:"string",valueType:"any"},key:{type:"map",keyType:"string",valueType:"string"}}}}t.AttributeMap=AttributeMap;class InterceptorContextRequest extends u.Model{constructor(e){super(e)}static names(){return{headers:"headers",query:"query",body:"body",stream:"stream",hostMap:"hostMap",pathname:"pathname",productId:"productId",action:"action",version:"version",protocol:"protocol",method:"method",authType:"authType",bodyType:"bodyType",reqBodyType:"reqBodyType",style:"style",credential:"credential",signatureVersion:"signatureVersion",signatureAlgorithm:"signatureAlgorithm",userAgent:"userAgent"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},query:{type:"map",keyType:"string",valueType:"string"},body:"any",stream:"Readable",hostMap:{type:"map",keyType:"string",valueType:"string"},pathname:"string",productId:"string",action:"string",version:"string",protocol:"string",method:"string",authType:"string",bodyType:"string",reqBodyType:"string",style:"string",credential:a.default,signatureVersion:"string",signatureAlgorithm:"string",userAgent:"string"}}}t.InterceptorContextRequest=InterceptorContextRequest;class InterceptorContextConfiguration extends u.Model{constructor(e){super(e)}static names(){return{regionId:"regionId",endpoint:"endpoint",endpointRule:"endpointRule",endpointMap:"endpointMap",endpointType:"endpointType",network:"network",suffix:"suffix"}}static types(){return{regionId:"string",endpoint:"string",endpointRule:"string",endpointMap:{type:"map",keyType:"string",valueType:"string"},endpointType:"string",network:"string",suffix:"string"}}}t.InterceptorContextConfiguration=InterceptorContextConfiguration;class InterceptorContextResponse extends u.Model{constructor(e){super(e)}static names(){return{statusCode:"statusCode",headers:"headers",body:"body",deserializedBody:"deserializedBody"}}static types(){return{statusCode:"number",headers:{type:"map",keyType:"string",valueType:"string"},body:"Readable",deserializedBody:"any"}}}t.InterceptorContextResponse=InterceptorContextResponse;class Client{constructor(){}}t["default"]=Client},6642:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.Params=t.OpenApiRequest=t.Config=t.GlobalParameters=void 0;const a=o(r(1979));const u=i(r(4060)),c=u;const l=o(r(2868));const d=i(r(2652));const p=o(r(5757));const f=i(r(4165));class GlobalParameters extends f.Model{constructor(e){super(e)}static names(){return{headers:"headers",queries:"queries"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},queries:{type:"map",keyType:"string",valueType:"string"}}}}t.GlobalParameters=GlobalParameters;class Config extends f.Model{constructor(e){super(e)}static names(){return{accessKeyId:"accessKeyId",accessKeySecret:"accessKeySecret",securityToken:"securityToken",bearerToken:"bearerToken",protocol:"protocol",method:"method",regionId:"regionId",readTimeout:"readTimeout",connectTimeout:"connectTimeout",httpProxy:"httpProxy",httpsProxy:"httpsProxy",credential:"credential",endpoint:"endpoint",noProxy:"noProxy",maxIdleConns:"maxIdleConns",network:"network",userAgent:"userAgent",suffix:"suffix",socks5Proxy:"socks5Proxy",socks5NetWork:"socks5NetWork",endpointType:"endpointType",openPlatformEndpoint:"openPlatformEndpoint",type:"type",signatureVersion:"signatureVersion",signatureAlgorithm:"signatureAlgorithm",globalParameters:"globalParameters",key:"key",cert:"cert",ca:"ca",disableHttp2:"disableHttp2"}}static types(){return{accessKeyId:"string",accessKeySecret:"string",securityToken:"string",bearerToken:"string",protocol:"string",method:"string",regionId:"string",readTimeout:"number",connectTimeout:"number",httpProxy:"string",httpsProxy:"string",credential:u.default,endpoint:"string",noProxy:"string",maxIdleConns:"number",network:"string",userAgent:"string",suffix:"string",socks5Proxy:"string",socks5NetWork:"string",endpointType:"string",openPlatformEndpoint:"string",type:"string",signatureVersion:"string",signatureAlgorithm:"string",globalParameters:GlobalParameters,key:"string",cert:"string",ca:"string",disableHttp2:"boolean"}}}t.Config=Config;class OpenApiRequest extends f.Model{constructor(e){super(e)}static names(){return{headers:"headers",query:"query",body:"body",stream:"stream",hostMap:"hostMap",endpointOverride:"endpointOverride"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},query:{type:"map",keyType:"string",valueType:"string"},body:"any",stream:"Readable",hostMap:{type:"map",keyType:"string",valueType:"string"},endpointOverride:"string"}}}t.OpenApiRequest=OpenApiRequest;class Params extends f.Model{constructor(e){super(e)}static names(){return{action:"action",version:"version",protocol:"protocol",pathname:"pathname",method:"method",authType:"authType",bodyType:"bodyType",reqBodyType:"reqBodyType",style:"style"}}static types(){return{action:"string",version:"string",protocol:"string",pathname:"string",method:"string",authType:"string",bodyType:"string",reqBodyType:"string",style:"string"}}}t.Params=Params;class Client{constructor(e){if(a.default.isUnset(e)){throw f.newError({code:"ParameterMissing",message:"'config' can not be unset"})}if(!a.default.empty(e.accessKeyId)&&!a.default.empty(e.accessKeySecret)){if(!a.default.empty(e.securityToken)){e.type="sts"}else{e.type="access_key"}let t=new c.Config({accessKeyId:e.accessKeyId,type:e.type,accessKeySecret:e.accessKeySecret});t.securityToken=e.securityToken;this._credential=new u.default(t)}else if(!a.default.empty(e.bearerToken)){let t=new c.Config({type:"bearer",bearerToken:e.bearerToken});this._credential=new u.default(t)}else if(!a.default.isUnset(e.credential)){this._credential=e.credential}this._endpoint=e.endpoint;this._endpointType=e.endpointType;this._network=e.network;this._suffix=e.suffix;this._protocol=e.protocol;this._method=e.method;this._regionId=e.regionId;this._userAgent=e.userAgent;this._readTimeout=e.readTimeout;this._connectTimeout=e.connectTimeout;this._httpProxy=e.httpProxy;this._httpsProxy=e.httpsProxy;this._noProxy=e.noProxy;this._socks5Proxy=e.socks5Proxy;this._socks5NetWork=e.socks5NetWork;this._maxIdleConns=e.maxIdleConns;this._signatureVersion=e.signatureVersion;this._signatureAlgorithm=e.signatureAlgorithm;this._globalParameters=e.globalParameters;this._key=e.key;this._cert=e.cert;this._ca=e.ca;this._disableHttp2=e.disableHttp2}async doRPCRequest(e,t,r,s,n,i,o,u){let c={timeouted:"retry",key:a.default.defaultString(u.key,this._key),cert:a.default.defaultString(u.cert,this._cert),ca:a.default.defaultString(u.ca,this._ca),readTimeout:a.default.defaultNumber(u.readTimeout,this._readTimeout),connectTimeout:a.default.defaultNumber(u.connectTimeout,this._connectTimeout),httpProxy:a.default.defaultString(u.httpProxy,this._httpProxy),httpsProxy:a.default.defaultString(u.httpsProxy,this._httpsProxy),noProxy:a.default.defaultString(u.noProxy,this._noProxy),socks5Proxy:a.default.defaultString(u.socks5Proxy,this._socks5Proxy),socks5NetWork:a.default.defaultString(u.socks5NetWork,this._socks5NetWork),maxIdleConns:a.default.defaultNumber(u.maxIdleConns,this._maxIdleConns),retry:{retryable:u.autoretry,maxAttempts:a.default.defaultNumber(u.maxAttempts,3)},backoff:{policy:a.default.defaultString(u.backoffPolicy,"no"),period:a.default.defaultNumber(u.backoffPeriod,1)},ignoreSSL:u.ignoreSSL};let d=null;let p=Date.now();let h=0;while(f.allowRetry(c["retry"],h,p)){if(h>0){let e=f.getBackoffTime(c["backoff"],h);if(e>0){await f.sleep(e)}}h=h+1;try{let p=new f.Request;p.protocol=a.default.defaultString(this._protocol,r);p.method=s;p.pathname="/";let h={};let m={};if(!a.default.isUnset(this._globalParameters)){let e=this._globalParameters;if(!a.default.isUnset(e.queries)){h=e.queries}if(!a.default.isUnset(e.headers)){m=e.headers}}let y={};let g={};if(!a.default.isUnset(u.extendsParameters)){let e=u.extendsParameters;if(!a.default.isUnset(e.headers)){y=e.headers}if(!a.default.isUnset(e.queries)){g=e.queries}}p.query=Object.assign(Object.assign(Object.assign({Action:e,Format:"json",Version:t,Timestamp:l.default.getTimestamp(),SignatureNonce:a.default.getNonce()},h),g),o.query);let S=this.getRpcHeaders();if(a.default.isUnset(S)){p.headers=Object.assign(Object.assign({host:this._endpoint,"x-acs-version":t,"x-acs-action":e,"user-agent":this.getUserAgent()},m),y)}else{p.headers=Object.assign(Object.assign(Object.assign({host:this._endpoint,"x-acs-version":t,"x-acs-action":e,"user-agent":this.getUserAgent()},m),y),S)}if(!a.default.isUnset(o.body)){let e=a.default.assertAsMap(o.body);let t=a.default.anyifyMapValue(l.default.query(e));p.body=new f.BytesReadable(a.default.toFormString(t));p.headers["content-type"]="application/x-www-form-urlencoded"}if(!a.default.equalString(n,"Anonymous")){let e=await this._credential.getCredential();let t=e.type;if(a.default.equalString(t,"bearer")){let t=e.bearerToken;p.query["BearerToken"]=t;p.query["SignatureType"]="BEARERTOKEN"}else{let t=e.accessKeyId;let r=e.accessKeySecret;let s=e.securityToken;if(!a.default.empty(s)){p.query["SecurityToken"]=s}p.query["SignatureMethod"]="HMAC-SHA1";p.query["SignatureVersion"]="1.0";p.query["AccessKeyId"]=t;let n=null;if(!a.default.isUnset(o.body)){n=a.default.assertAsMap(o.body)}let i=Object.assign(Object.assign({},p.query),l.default.query(n));p.query["Signature"]=l.default.getRPCSignature(i,p.method,r)}}d=p;let T=await f.doAction(p,c);if(a.default.is4xx(T.statusCode)||a.default.is5xx(T.statusCode)){let e=await a.default.readAsJSON(T.body);let t=a.default.assertAsMap(e);let r=Client.defaultAny(t["RequestId"],t["requestId"]);t["statusCode"]=T.statusCode;throw f.newError({code:`${Client.defaultAny(t["Code"],t["code"])}`,message:`code: ${T.statusCode}, ${Client.defaultAny(t["Message"],t["message"])} request id: ${r}`,data:t,description:`${Client.defaultAny(t["Description"],t["description"])}`,accessDeniedDetail:Client.defaultAny(t["AccessDeniedDetail"],t["accessDeniedDetail"])})}if(a.default.equalString(i,"binary")){let e={body:T.body,headers:T.headers,statusCode:T.statusCode};return e}else if(a.default.equalString(i,"byte")){let e=await a.default.readAsBytes(T.body);return{body:e,headers:T.headers,statusCode:T.statusCode}}else if(a.default.equalString(i,"string")){let e=await a.default.readAsString(T.body);return{body:e,headers:T.headers,statusCode:T.statusCode}}else if(a.default.equalString(i,"json")){let e=await a.default.readAsJSON(T.body);let t=a.default.assertAsMap(e);return{body:t,headers:T.headers,statusCode:T.statusCode}}else if(a.default.equalString(i,"array")){let e=await a.default.readAsJSON(T.body);return{body:e,headers:T.headers,statusCode:T.statusCode}}else{return{headers:T.headers,statusCode:T.statusCode}}}catch(e){if(f.isRetryable(e)){continue}throw e}}throw f.newUnretryableError(d)}async doROARequest(e,t,r,s,n,i,o,u,c){let d={timeouted:"retry",key:a.default.defaultString(c.key,this._key),cert:a.default.defaultString(c.cert,this._cert),ca:a.default.defaultString(c.ca,this._ca),readTimeout:a.default.defaultNumber(c.readTimeout,this._readTimeout),connectTimeout:a.default.defaultNumber(c.connectTimeout,this._connectTimeout),httpProxy:a.default.defaultString(c.httpProxy,this._httpProxy),httpsProxy:a.default.defaultString(c.httpsProxy,this._httpsProxy),noProxy:a.default.defaultString(c.noProxy,this._noProxy),socks5Proxy:a.default.defaultString(c.socks5Proxy,this._socks5Proxy),socks5NetWork:a.default.defaultString(c.socks5NetWork,this._socks5NetWork),maxIdleConns:a.default.defaultNumber(c.maxIdleConns,this._maxIdleConns),retry:{retryable:c.autoretry,maxAttempts:a.default.defaultNumber(c.maxAttempts,3)},backoff:{policy:a.default.defaultString(c.backoffPolicy,"no"),period:a.default.defaultNumber(c.backoffPeriod,1)},ignoreSSL:c.ignoreSSL};let p=null;let h=Date.now();let m=0;while(f.allowRetry(d["retry"],m,h)){if(m>0){let e=f.getBackoffTime(d["backoff"],m);if(e>0){await f.sleep(e)}}m=m+1;try{let h=new f.Request;h.protocol=a.default.defaultString(this._protocol,r);h.method=s;h.pathname=i;let m={};let y={};if(!a.default.isUnset(this._globalParameters)){let e=this._globalParameters;if(!a.default.isUnset(e.queries)){m=e.queries}if(!a.default.isUnset(e.headers)){y=e.headers}}let g={};let S={};if(!a.default.isUnset(c.extendsParameters)){let e=c.extendsParameters;if(!a.default.isUnset(e.headers)){g=e.headers}if(!a.default.isUnset(e.queries)){S=e.queries}}h.headers=Object.assign(Object.assign(Object.assign({date:a.default.getDateUTCString(),host:this._endpoint,accept:"application/json","x-acs-signature-nonce":a.default.getNonce(),"x-acs-signature-method":"HMAC-SHA1","x-acs-signature-version":"1.0","x-acs-version":t,"x-acs-action":e,"user-agent":a.default.getUserAgent(this._userAgent)},y),g),u.headers);if(!a.default.isUnset(u.body)){h.body=new f.BytesReadable(a.default.toJSONString(u.body));h.headers["content-type"]="application/json; charset=utf-8"}h.query=Object.assign(Object.assign({},m),S);if(!a.default.isUnset(u.query)){h.query=Object.assign(Object.assign({},h.query),u.query)}if(!a.default.equalString(n,"Anonymous")){let e=await this._credential.getCredential();let t=e.type;if(a.default.equalString(t,"bearer")){let t=e.bearerToken;h.headers["x-acs-bearer-token"]=t;h.headers["x-acs-signature-type"]="BEARERTOKEN"}else{let t=e.accessKeyId;let r=e.accessKeySecret;let s=e.securityToken;if(!a.default.empty(s)){h.headers["x-acs-accesskey-id"]=t;h.headers["x-acs-security-token"]=s}let n=l.default.getStringToSign(h);h.headers["authorization"]=`acs ${t}:${l.default.getROASignature(n,r)}`}}p=h;let T=await f.doAction(h,d);if(a.default.equalNumber(T.statusCode,204)){return{headers:T.headers}}if(a.default.is4xx(T.statusCode)||a.default.is5xx(T.statusCode)){let e=await a.default.readAsJSON(T.body);let t=a.default.assertAsMap(e);let r=Client.defaultAny(t["RequestId"],t["requestId"]);r=Client.defaultAny(r,t["requestid"]);t["statusCode"]=T.statusCode;throw f.newError({code:`${Client.defaultAny(t["Code"],t["code"])}`,message:`code: ${T.statusCode}, ${Client.defaultAny(t["Message"],t["message"])} request id: ${r}`,data:t,description:`${Client.defaultAny(t["Description"],t["description"])}`,accessDeniedDetail:Client.defaultAny(t["AccessDeniedDetail"],t["accessDeniedDetail"])})}if(a.default.equalString(o,"binary")){let e={body:T.body,headers:T.headers,statusCode:T.statusCode};return e}else if(a.default.equalString(o,"byte")){let e=await a.default.readAsBytes(T.body);return{body:e,headers:T.headers,statusCode:T.statusCode}}else if(a.default.equalString(o,"string")){let e=await a.default.readAsString(T.body);return{body:e,headers:T.headers,statusCode:T.statusCode}}else if(a.default.equalString(o,"json")){let e=await a.default.readAsJSON(T.body);let t=a.default.assertAsMap(e);return{body:t,headers:T.headers,statusCode:T.statusCode}}else if(a.default.equalString(o,"array")){let e=await a.default.readAsJSON(T.body);return{body:e,headers:T.headers,statusCode:T.statusCode}}else{return{headers:T.headers,statusCode:T.statusCode}}}catch(e){if(f.isRetryable(e)){continue}throw e}}throw f.newUnretryableError(p)}async doROARequestWithForm(e,t,r,s,n,i,o,u,c){let d={timeouted:"retry",key:a.default.defaultString(c.key,this._key),cert:a.default.defaultString(c.cert,this._cert),ca:a.default.defaultString(c.ca,this._ca),readTimeout:a.default.defaultNumber(c.readTimeout,this._readTimeout),connectTimeout:a.default.defaultNumber(c.connectTimeout,this._connectTimeout),httpProxy:a.default.defaultString(c.httpProxy,this._httpProxy),httpsProxy:a.default.defaultString(c.httpsProxy,this._httpsProxy),noProxy:a.default.defaultString(c.noProxy,this._noProxy),socks5Proxy:a.default.defaultString(c.socks5Proxy,this._socks5Proxy),socks5NetWork:a.default.defaultString(c.socks5NetWork,this._socks5NetWork),maxIdleConns:a.default.defaultNumber(c.maxIdleConns,this._maxIdleConns),retry:{retryable:c.autoretry,maxAttempts:a.default.defaultNumber(c.maxAttempts,3)},backoff:{policy:a.default.defaultString(c.backoffPolicy,"no"),period:a.default.defaultNumber(c.backoffPeriod,1)},ignoreSSL:c.ignoreSSL};let p=null;let h=Date.now();let m=0;while(f.allowRetry(d["retry"],m,h)){if(m>0){let e=f.getBackoffTime(d["backoff"],m);if(e>0){await f.sleep(e)}}m=m+1;try{let h=new f.Request;h.protocol=a.default.defaultString(this._protocol,r);h.method=s;h.pathname=i;let m={};let y={};if(!a.default.isUnset(this._globalParameters)){let e=this._globalParameters;if(!a.default.isUnset(e.queries)){m=e.queries}if(!a.default.isUnset(e.headers)){y=e.headers}}let g={};let S={};if(!a.default.isUnset(c.extendsParameters)){let e=c.extendsParameters;if(!a.default.isUnset(e.headers)){g=e.headers}if(!a.default.isUnset(e.queries)){S=e.queries}}h.headers=Object.assign(Object.assign(Object.assign({date:a.default.getDateUTCString(),host:this._endpoint,accept:"application/json","x-acs-signature-nonce":a.default.getNonce(),"x-acs-signature-method":"HMAC-SHA1","x-acs-signature-version":"1.0","x-acs-version":t,"x-acs-action":e,"user-agent":a.default.getUserAgent(this._userAgent)},y),g),u.headers);if(!a.default.isUnset(u.body)){let e=a.default.assertAsMap(u.body);h.body=new f.BytesReadable(l.default.toForm(e));h.headers["content-type"]="application/x-www-form-urlencoded"}h.query=Object.assign(Object.assign({},m),S);if(!a.default.isUnset(u.query)){h.query=Object.assign(Object.assign({},h.query),u.query)}if(!a.default.equalString(n,"Anonymous")){let e=await this._credential.getCredential();let t=e.type;if(a.default.equalString(t,"bearer")){let t=e.bearerToken;h.headers["x-acs-bearer-token"]=t;h.headers["x-acs-signature-type"]="BEARERTOKEN"}else{let t=e.accessKeyId;let r=e.accessKeySecret;let s=e.securityToken;if(!a.default.empty(s)){h.headers["x-acs-accesskey-id"]=t;h.headers["x-acs-security-token"]=s}let n=l.default.getStringToSign(h);h.headers["authorization"]=`acs ${t}:${l.default.getROASignature(n,r)}`}}p=h;let T=await f.doAction(h,d);if(a.default.equalNumber(T.statusCode,204)){return{headers:T.headers}}if(a.default.is4xx(T.statusCode)||a.default.is5xx(T.statusCode)){let e=await a.default.readAsJSON(T.body);let t=a.default.assertAsMap(e);t["statusCode"]=T.statusCode;throw f.newError({code:`${Client.defaultAny(t["Code"],t["code"])}`,message:`code: ${T.statusCode}, ${Client.defaultAny(t["Message"],t["message"])} request id: ${Client.defaultAny(t["RequestId"],t["requestId"])}`,data:t,description:`${Client.defaultAny(t["Description"],t["description"])}`,accessDeniedDetail:Client.defaultAny(t["AccessDeniedDetail"],t["accessDeniedDetail"])})}if(a.default.equalString(o,"binary")){let e={body:T.body,headers:T.headers,statusCode:T.statusCode};return e}else if(a.default.equalString(o,"byte")){let e=await a.default.readAsBytes(T.body);return{body:e,headers:T.headers,statusCode:T.statusCode}}else if(a.default.equalString(o,"string")){let e=await a.default.readAsString(T.body);return{body:e,headers:T.headers,statusCode:T.statusCode}}else if(a.default.equalString(o,"json")){let e=await a.default.readAsJSON(T.body);let t=a.default.assertAsMap(e);return{body:t,headers:T.headers,statusCode:T.statusCode}}else if(a.default.equalString(o,"array")){let e=await a.default.readAsJSON(T.body);return{body:e,headers:T.headers,statusCode:T.statusCode}}else{return{headers:T.headers,statusCode:T.statusCode}}}catch(e){if(f.isRetryable(e)){continue}throw e}}throw f.newUnretryableError(p)}async doRequest(e,t,r){let s={timeouted:"retry",key:a.default.defaultString(r.key,this._key),cert:a.default.defaultString(r.cert,this._cert),ca:a.default.defaultString(r.ca,this._ca),readTimeout:a.default.defaultNumber(r.readTimeout,this._readTimeout),connectTimeout:a.default.defaultNumber(r.connectTimeout,this._connectTimeout),httpProxy:a.default.defaultString(r.httpProxy,this._httpProxy),httpsProxy:a.default.defaultString(r.httpsProxy,this._httpsProxy),noProxy:a.default.defaultString(r.noProxy,this._noProxy),socks5Proxy:a.default.defaultString(r.socks5Proxy,this._socks5Proxy),socks5NetWork:a.default.defaultString(r.socks5NetWork,this._socks5NetWork),maxIdleConns:a.default.defaultNumber(r.maxIdleConns,this._maxIdleConns),retry:{retryable:r.autoretry,maxAttempts:a.default.defaultNumber(r.maxAttempts,3)},backoff:{policy:a.default.defaultString(r.backoffPolicy,"no"),period:a.default.defaultNumber(r.backoffPeriod,1)},ignoreSSL:r.ignoreSSL};let n=null;let i=Date.now();let o=0;while(f.allowRetry(s["retry"],o,i)){if(o>0){let e=f.getBackoffTime(s["backoff"],o);if(e>0){await f.sleep(e)}}o=o+1;try{let i=new f.Request;i.protocol=a.default.defaultString(this._protocol,e.protocol);i.method=e.method;i.pathname=e.pathname;let o={};let u={};if(!a.default.isUnset(this._globalParameters)){let e=this._globalParameters;if(!a.default.isUnset(e.queries)){o=e.queries}if(!a.default.isUnset(e.headers)){u=e.headers}}let c={};let d={};if(!a.default.isUnset(r.extendsParameters)){let e=r.extendsParameters;if(!a.default.isUnset(e.headers)){c=e.headers}if(!a.default.isUnset(e.queries)){d=e.queries}}i.query=Object.assign(Object.assign(Object.assign({},o),d),t.query);i.headers=Object.assign(Object.assign(Object.assign({host:this._endpoint,"x-acs-version":e.version,"x-acs-action":e.action,"user-agent":this.getUserAgent(),"x-acs-date":l.default.getTimestamp(),"x-acs-signature-nonce":a.default.getNonce(),accept:"application/json"},u),c),t.headers);if(a.default.equalString(e.style,"RPC")){let e=this.getRpcHeaders();if(!a.default.isUnset(e)){i.headers=Object.assign(Object.assign({},i.headers),e)}}let h=a.default.defaultString(this._signatureAlgorithm,"ACS3-HMAC-SHA256");let m=l.default.hexEncode(l.default.hash(a.default.toBytes(""),h));if(!a.default.isUnset(t.stream)){let e=await a.default.readAsBytes(t.stream);m=l.default.hexEncode(l.default.hash(e,h));i.body=new f.BytesReadable(e);i.headers["content-type"]="application/octet-stream"}else{if(!a.default.isUnset(t.body)){if(a.default.equalString(e.reqBodyType,"byte")){let e=a.default.assertAsBytes(t.body);m=l.default.hexEncode(l.default.hash(e,h));i.body=new f.BytesReadable(e)}else if(a.default.equalString(e.reqBodyType,"json")){let e=a.default.toJSONString(t.body);m=l.default.hexEncode(l.default.hash(a.default.toBytes(e),h));i.body=new f.BytesReadable(e);i.headers["content-type"]="application/json; charset=utf-8"}else{let e=a.default.assertAsMap(t.body);let r=l.default.toForm(e);m=l.default.hexEncode(l.default.hash(a.default.toBytes(r),h));i.body=new f.BytesReadable(r);i.headers["content-type"]="application/x-www-form-urlencoded"}}}i.headers["x-acs-content-sha256"]=m;if(!a.default.equalString(e.authType,"Anonymous")){let t=await this._credential.getCredential();let r=t.type;if(a.default.equalString(r,"bearer")){let r=t.bearerToken;i.headers["x-acs-bearer-token"]=r;if(a.default.equalString(e.style,"RPC")){i.query["SignatureType"]="BEARERTOKEN"}else{i.headers["x-acs-signature-type"]="BEARERTOKEN"}}else{let e=t.accessKeyId;let r=t.accessKeySecret;let s=t.securityToken;if(!a.default.empty(s)){i.headers["x-acs-accesskey-id"]=e;i.headers["x-acs-security-token"]=s}i.headers["Authorization"]=l.default.getAuthorization(i,h,m,e,r)}}n=i;let y=await f.doAction(i,s);if(a.default.is4xx(y.statusCode)||a.default.is5xx(y.statusCode)){let e={};if(!a.default.isUnset(y.headers["content-type"])&&a.default.equalString(y.headers["content-type"],"text/xml;charset=utf-8")){let t=await a.default.readAsString(y.body);let r=p.default.parseXml(t,null);e=a.default.assertAsMap(r["Error"])}else{let t=await a.default.readAsJSON(y.body);e=a.default.assertAsMap(t)}e["statusCode"]=y.statusCode;throw f.newError({code:`${Client.defaultAny(e["Code"],e["code"])}`,message:`code: ${y.statusCode}, ${Client.defaultAny(e["Message"],e["message"])} request id: ${Client.defaultAny(e["RequestId"],e["requestId"])}`,data:e,description:`${Client.defaultAny(e["Description"],e["description"])}`,accessDeniedDetail:Client.defaultAny(e["AccessDeniedDetail"],e["accessDeniedDetail"])})}if(a.default.equalString(e.bodyType,"binary")){let e={body:y.body,headers:y.headers,statusCode:y.statusCode};return e}else if(a.default.equalString(e.bodyType,"byte")){let e=await a.default.readAsBytes(y.body);return{body:e,headers:y.headers,statusCode:y.statusCode}}else if(a.default.equalString(e.bodyType,"string")){let e=await a.default.readAsString(y.body);return{body:e,headers:y.headers,statusCode:y.statusCode}}else if(a.default.equalString(e.bodyType,"json")){let e=await a.default.readAsJSON(y.body);let t=a.default.assertAsMap(e);return{body:t,headers:y.headers,statusCode:y.statusCode}}else if(a.default.equalString(e.bodyType,"array")){let e=await a.default.readAsJSON(y.body);return{body:e,headers:y.headers,statusCode:y.statusCode}}else{let e=await a.default.readAsString(y.body);return{body:e,headers:y.headers,statusCode:y.statusCode}}}catch(e){if(f.isRetryable(e)){continue}throw e}}throw f.newUnretryableError(n)}async execute(e,t,r){let s={timeouted:"retry",key:a.default.defaultString(r.key,this._key),cert:a.default.defaultString(r.cert,this._cert),ca:a.default.defaultString(r.ca,this._ca),readTimeout:a.default.defaultNumber(r.readTimeout,this._readTimeout),connectTimeout:a.default.defaultNumber(r.connectTimeout,this._connectTimeout),httpProxy:a.default.defaultString(r.httpProxy,this._httpProxy),httpsProxy:a.default.defaultString(r.httpsProxy,this._httpsProxy),noProxy:a.default.defaultString(r.noProxy,this._noProxy),socks5Proxy:a.default.defaultString(r.socks5Proxy,this._socks5Proxy),socks5NetWork:a.default.defaultString(r.socks5NetWork,this._socks5NetWork),maxIdleConns:a.default.defaultNumber(r.maxIdleConns,this._maxIdleConns),retry:{retryable:r.autoretry,maxAttempts:a.default.defaultNumber(r.maxAttempts,3)},backoff:{policy:a.default.defaultString(r.backoffPolicy,"no"),period:a.default.defaultNumber(r.backoffPeriod,1)},ignoreSSL:r.ignoreSSL,disableHttp2:Client.defaultAny(this._disableHttp2,false)};let n=null;let i=Date.now();let o=0;while(f.allowRetry(s["retry"],o,i)){if(o>0){let e=f.getBackoffTime(s["backoff"],o);if(e>0){await f.sleep(e)}}o=o+1;try{let i=new f.Request;let o=this.getRpcHeaders();let u={};let c={};if(!a.default.isUnset(this._globalParameters)){let e=this._globalParameters;if(!a.default.isUnset(e.queries)){u=e.queries}if(!a.default.isUnset(e.headers)){c=e.headers}}let l={};let p={};if(!a.default.isUnset(r.extendsParameters)){let e=r.extendsParameters;if(!a.default.isUnset(e.headers)){l=e.headers}if(!a.default.isUnset(e.queries)){p=e.queries}}let h=new d.InterceptorContextRequest({headers:Object.assign(Object.assign(Object.assign(Object.assign({},c),l),t.headers),o),query:Object.assign(Object.assign(Object.assign({},u),p),t.query),body:t.body,stream:t.stream,hostMap:t.hostMap,pathname:e.pathname,productId:this._productId,action:e.action,version:e.version,protocol:a.default.defaultString(this._protocol,e.protocol),method:a.default.defaultString(this._method,e.method),authType:e.authType,bodyType:e.bodyType,reqBodyType:e.reqBodyType,style:e.style,credential:this._credential,signatureVersion:this._signatureVersion,signatureAlgorithm:this._signatureAlgorithm,userAgent:this.getUserAgent()});let m=new d.InterceptorContextConfiguration({regionId:this._regionId,endpoint:a.default.defaultString(t.endpointOverride,this._endpoint),endpointRule:this._endpointRule,endpointMap:this._endpointMap,endpointType:this._endpointType,network:this._network,suffix:this._suffix});let y=new d.InterceptorContext({request:h,configuration:m});let g=new d.AttributeMap({});await this._spi.modifyConfiguration(y,g);await this._spi.modifyRequest(y,g);i.protocol=y.request.protocol;i.method=y.request.method;i.pathname=y.request.pathname;i.query=y.request.query;i.body=y.request.stream;i.headers=y.request.headers;n=i;let S=await f.doAction(i,s);let T=new d.InterceptorContextResponse({statusCode:S.statusCode,headers:S.headers,body:S.body});y.response=T;await this._spi.modifyResponse(y,g);return{headers:y.response.headers,statusCode:y.response.statusCode,body:y.response.deserializedBody}}catch(e){if(f.isRetryable(e)){continue}throw e}}throw f.newUnretryableError(n)}async callApi(e,t,r){if(a.default.isUnset(e)){throw f.newError({code:"ParameterMissing",message:"'params' can not be unset"})}if(a.default.isUnset(this._signatureAlgorithm)||!a.default.equalString(this._signatureAlgorithm,"v2")){return await this.doRequest(e,t,r)}else if(a.default.equalString(e.style,"ROA")&&a.default.equalString(e.reqBodyType,"json")){return await this.doROARequest(e.action,e.version,e.protocol,e.method,e.authType,e.pathname,e.bodyType,t,r)}else if(a.default.equalString(e.style,"ROA")){return await this.doROARequestWithForm(e.action,e.version,e.protocol,e.method,e.authType,e.pathname,e.bodyType,t,r)}else{return await this.doRPCRequest(e.action,e.version,e.protocol,e.method,e.authType,e.bodyType,t,r)}}getUserAgent(){let e=a.default.getUserAgent(this._userAgent);return e}async getAccessKeyId(){if(a.default.isUnset(this._credential)){return""}let e=await this._credential.getAccessKeyId();return e}async getAccessKeySecret(){if(a.default.isUnset(this._credential)){return""}let e=await this._credential.getAccessKeySecret();return e}async getSecurityToken(){if(a.default.isUnset(this._credential)){return""}let e=await this._credential.getSecurityToken();return e}async getBearerToken(){if(a.default.isUnset(this._credential)){return""}let e=this._credential.getBearerToken();return e}async getType(){if(a.default.isUnset(this._credential)){return""}let e=this._credential.getType();return e}static defaultAny(e,t){if(a.default.isUnset(e)){return t}return e}checkConfig(e){if(a.default.empty(this._endpointRule)&&a.default.empty(e.endpoint)){throw f.newError({code:"ParameterMissing",message:"'config.endpoint' can not be empty"})}}setGatewayClient(e){this._spi=e}setRpcHeaders(e){this._headers=e}getRpcHeaders(){let e=this._headers;this._headers=null;return e}}t["default"]=Client},2868:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const a=i(r(4165));const u=o(r(1979));const c=o(r(8683));const l=o(r(3477));const d=o(r(6113));const p="-----BEGIN PRIVATE KEY-----\n";const f="\n-----END PRIVATE KEY-----";function replaceRepeatList(e,t,r){if(r){r=r+"."}for(var s=0;s<t.length;s++){var n=t[s];let i=r+(s+1);if(typeof n==="undefined"||n==null){continue}if(Array.isArray(n)){replaceRepeatList(e,n,i)}else if(n instanceof Object){flatMap(e,n,i)}else{e[i]=n.toString()}}}function flatMap(e,t,r=""){if(r){r=r+"."}t=toMap(t);let s=Object.keys(t);for(let n=0;n<s.length;n++){let i=s[n];let o=t[i];i=r+i;if(typeof o==="undefined"||o==null){continue}if(Array.isArray(o)){replaceRepeatList(e,o,i)}else if(o instanceof Object){flatMap(e,o,i)}else{e[i]=o.toString()}}return e}function filter(e){return e.replace(/[\t\n\r\f]/g," ")}function getCanonicalizedHeaders(e){const t="x-acs-";const r=Object.keys(e);const s=[];for(let e=0;e<r.length;e++){const n=r[e];if(n.startsWith(t)){s.push(n)}}s.sort();var n="";for(let t=0;t<s.length;t++){const r=s[t];n+=`${r}:${filter(e[r]).trim()}\n`}return n}function getCanonicalizedResource(e,t){const r=!t?[]:Object.keys(t).sort();if(r.length===0){return e}var s=[];for(var n=0;n<r.length;n++){const e=r[n];s.push(`${e}=${t[e]}`)}return`${e}?${s.join("&")}`}function getAuthorizationQueryString(e){let t=[];const r=!e?[]:Object.keys(e).sort();for(let s=0;s<r.length;s++){const n=r[s];let i=n+"=";if(typeof e[n]!=="undefined"&&e[n]!==null){i=i+encode(e[n])}t.push(i)}return t.join("&")}function getAuthorizationHeaders(e){let t="";let r={};const s=!e?[]:Object.keys(e);for(let t=0;t<s.length;t++){const n=s[t];const i=s[t].toLowerCase();if(i.startsWith("x-acs-")||i==="host"||i==="content-type"){if(r[i]){r[i].push((e[n]||"").trim())}else{r[i]=[(e[n]||"").trim()]}}}var n=Object.keys(r).sort();for(let e=0;e<n.length;e++){const s=n[e];let i=r[s].sort();t+=`${s}:${i.join(",")}\n`}return{canonicalheaders:t,hsKeys:n}}function encode(e){var t=encodeURIComponent(e);return t.replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function normalize(e){var t=[];var r={};flatMap(r,e);var s=Object.keys(r).sort();for(let e=0;e<s.length;e++){var n=s[e];var i=r[n];t.push([encode(n),encode(i)])}return t}function canonicalize(e){var t=[];for(var r=0;r<e.length;r++){var[s,n]=e[r];t.push(s+"="+n)}return t.join("&")}function isModelClass(e){if(!e){return false}return typeof e.types==="function"&&typeof e.names==="function"}function isObjectOrArray(e){return Array.isArray(e)||e instanceof Object&&typeof e!=="function"}function toMap(e){if(!isObjectOrArray(e)){return null}else if(e instanceof a.Model){return a.toMap(e)}else if(e&&e.toMap&&typeof e.toMap==="function"){return e.toMap()}else if(Array.isArray(e)){const t=[];e.forEach((e=>{if(isObjectOrArray(e)){t.push(toMap(e))}else{t.push(e)}}));return t}else if(e instanceof Object){const t={};Object.entries(e).forEach((([e,r])=>{if(isObjectOrArray(r)){t[e]=toMap(r)}else{t[e]=r}}));return t}}class Client{static convert(e,t){if(!t){return}let r=Object.assign({},e);let s=t.constructor;let n=s.types();for(let e of Object.keys(s.names())){if(r[e]!==null&&r[e]!==undefined){if(isModelClass(n[e])){t[e]=new n[e](t[e]);Client.convert(r[e],t[e])}else if(n[e]&&n[e].type==="array"){t[e]=r[e].map((function(t){if(isModelClass(n[e].itemType)){var r=new n[e].itemType({});Client.convert(t,r);return r}return t}))}else if(n[e]&&n[e].type==="map"){t[e]={};Object.keys(r[e]).map((function(s){if(isModelClass(n[e].valueType)){var i=new n[e].valueType({});Client.convert(r[e][s],i);t[e][s]=i}else{t[e][s]=r[e][s]}}))}else{t[e]=r[e]}}}}static getStringToSign(e){const t=e.method;const r=e.headers["accept"];const s=e.headers["content-md5"]||"";const n=e.headers["content-type"]||"";const i=e.headers["date"]||"";const o=`${t}\n${r}\n${s}\n${n}\n${i}\n`;const a=getCanonicalizedHeaders(e.headers);const u=getCanonicalizedResource(e.pathname,e.query);return`${o}${a}${u}`}static getROASignature(e,t){const r=Buffer.from(e,"utf8");return c.default.sha1(r,t,"base64")}static toForm(e){if(!e){return""}let t={};flatMap(t,e);return u.default.toFormString(t)}static getTimestamp(){let e=new Date;let t=e.getUTCFullYear();let r=c.default.pad2(e.getUTCMonth()+1);let s=c.default.pad2(e.getUTCDate());let n=c.default.pad2(e.getUTCHours());let i=c.default.pad2(e.getUTCMinutes());let o=c.default.pad2(e.getUTCSeconds());return`${t}-${r}-${s}T${n}:${i}:${o}Z`}static query(e){if(!e){return{}}let t={};flatMap(t,e);return t}static getRPCSignature(e,t,r){var s=normalize(e);var n=canonicalize(s);var i=`${t}&${encode("/")}&${encode(n)}`;const o=r+"&";return c.default.sha1(i,o,"base64")}static arrayToStringWithSpecifiedStyle(e,t,r){if(!e){return""}if(r==="repeatList"){let r={};replaceRepeatList(r,e,t);return l.default.stringify(r,"&&")}else if(r==="json"){return JSON.stringify(toMap(e))}else if(r==="simple"){return e.join(",")}else if(r==="spaceDelimited"){return e.join(" ")}else if(r==="pipeDelimited"){return e.join("|")}else{return""}}static parseToMap(e){return toMap(e)}static getEndpoint(e,t,r){if(r=="internal"){let t=e.split(".");t[0]+="-internal";e=t.join(".")}if(t&&r=="accelerate"){return"oss-accelerate.aliyuncs.com"}return e}static hexEncode(e){return e.toString("hex")}static hash(e,t){if(t==="ACS3-HMAC-SHA256"||t==="ACS3-RSA-SHA256"){const t=d.default.createHash("sha256");t.update(e);return t.digest()}else if(t=="ACS3-HMAC-SM3"){const t=d.default.createHash("sm3");t.update(e);return t.digest()}}static signatureMethod(e,t,r){if(r==="ACS3-HMAC-SHA256"){const r=d.default.createHmac("sha256",e);r.update(t);return r.digest()}else if(r==="ACS3-HMAC-SM3"){const r=d.default.createHmac("sm3",e);r.update(t);return r.digest()}else if(r==="ACS3-RSA-SHA256"){if(!e.startsWith(p)){e=p+e}if(!e.endsWith(f)){e=e+f}var s=d.default.createSign("RSA-SHA256");s.update(t);var n=s.sign({key:e,padding:d.default.constants.RSA_PKCS1_PADDING});return n}}static getAuthorization(e,t,r,s,n){const i=(e.pathname||"").replace("+","%20").replace("*","%2A").replace("%7E","~");const o=e.method;const a=getAuthorizationQueryString(e.query);const u=getAuthorizationHeaders(e.headers);const c=u["canonicalheaders"];const l=u["hsKeys"];const d=o+"\n"+i+"\n"+a+"\n"+c+"\n"+l.join(";")+"\n"+r;let p=Buffer.from(d);const f=t+"\n"+Client.hexEncode(Client.hash(p,t));const h=Client.hexEncode(Client.signatureMethod(n,f,t));const m=`${t} Credential=${s},SignedHeaders=${l.join(";")},Signature=${h}`;return m}static getEncodePath(e){if(typeof e==="undefined"||e===null){return""}let t=e.split("/");for(let e=0;e<t.length;e++){t[e]=encode(t[e])}return t.join("/")}static getEncodeParam(e){if(typeof e==="undefined"||e===null){return""}return encode(e)}}t["default"]=Client},8190:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const a=i(r(4165));const u=o(r(1979));const c=o(r(8683));const l=o(r(3477));const d=o(r(6113));const p="-----BEGIN PRIVATE KEY-----\n";const f="\n-----END PRIVATE KEY-----";function replaceRepeatList(e,t,r){if(r){r=r+"."}for(var s=0;s<t.length;s++){var n=t[s];let i=r+(s+1);if(typeof n==="undefined"||n==null){continue}if(Array.isArray(n)){replaceRepeatList(e,n,i)}else if(n instanceof Object){flatMap(e,n,i)}else{e[i]=n.toString()}}}function flatMap(e,t,r=""){if(r){r=r+"."}t=toMap(t);let s=Object.keys(t);for(let n=0;n<s.length;n++){let i=s[n];let o=t[i];i=r+i;if(typeof o==="undefined"||o==null){continue}if(Array.isArray(o)){replaceRepeatList(e,o,i)}else if(o instanceof Object){flatMap(e,o,i)}else{e[i]=o.toString()}}return e}function filter(e){return e.replace(/[\t\n\r\f]/g," ")}function getCanonicalizedHeaders(e){const t="x-acs-";const r=Object.keys(e);const s=[];for(let e=0;e<r.length;e++){const n=r[e];if(n.startsWith(t)){s.push(n)}}s.sort();var n="";for(let t=0;t<s.length;t++){const r=s[t];n+=`${r}:${filter(e[r]).trim()}\n`}return n}function getCanonicalizedResource(e,t){const r=!t?[]:Object.keys(t).sort();if(r.length===0){return e}var s=[];for(var n=0;n<r.length;n++){const e=r[n];s.push(`${e}=${t[e]}`)}return`${e}?${s.join("&")}`}function getAuthorizationQueryString(e){let t=[];const r=!e?[]:Object.keys(e).sort();for(let s=0;s<r.length;s++){const n=r[s];let i=n+"=";if(typeof e[n]!=="undefined"&&e[n]!==null){i=i+encode(e[n])}t.push(i)}return t.join("&")}function getAuthorizationHeaders(e){let t="";let r={};const s=!e?[]:Object.keys(e);for(let t=0;t<s.length;t++){const n=s[t];const i=s[t].toLowerCase();if(i.startsWith("x-acs-")||i==="host"||i==="content-type"){if(r[i]){r[i].push((e[n]||"").trim())}else{r[i]=[(e[n]||"").trim()]}}}var n=Object.keys(r).sort();for(let e=0;e<n.length;e++){const s=n[e];let i=r[s].sort();t+=`${s}:${i.join(",")}\n`}return{canonicalheaders:t,hsKeys:n}}function encode(e){var t=encodeURIComponent(e);return t.replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function normalize(e){var t=[];var r={};flatMap(r,e);var s=Object.keys(r).sort();for(let e=0;e<s.length;e++){var n=s[e];var i=r[n];t.push([encode(n),encode(i)])}return t}function canonicalize(e){var t=[];for(var r=0;r<e.length;r++){var[s,n]=e[r];t.push(s+"="+n)}return t.join("&")}function isModelClass(e){if(!e){return false}return typeof e.types==="function"&&typeof e.names==="function"}function isObjectOrArray(e){return Array.isArray(e)||e instanceof Object&&typeof e!=="function"}function toMap(e){if(!isObjectOrArray(e)){return null}else if(e instanceof a.Model){return a.toMap(e)}else if(e&&e.toMap&&typeof e.toMap==="function"){return e.toMap()}else if(Array.isArray(e)){const t=[];e.forEach((e=>{if(isObjectOrArray(e)){t.push(toMap(e))}else{t.push(e)}}));return t}else if(e instanceof Object){const t={};Object.entries(e).forEach((([e,r])=>{if(isObjectOrArray(r)){t[e]=toMap(r)}else{t[e]=r}}));return t}}class Client{static convert(e,t){if(!t){return}let r=Object.assign({},e);let s=t.constructor;let n=s.types();for(let e of Object.keys(s.names())){if(r[e]){if(isModelClass(n[e])){t[e]=new n[e](t[e]);Client.convert(r[e],t[e]);continue}t[e]=r[e]}}}static getStringToSign(e){const t=e.method;const r=e.headers["accept"];const s=e.headers["content-md5"]||"";const n=e.headers["content-type"]||"";const i=e.headers["date"]||"";const o=`${t}\n${r}\n${s}\n${n}\n${i}\n`;const a=getCanonicalizedHeaders(e.headers);const u=getCanonicalizedResource(e.pathname,e.query);return`${o}${a}${u}`}static getROASignature(e,t){const r=Buffer.from(e,"utf8");return c.default.sha1(r,t,"base64")}static toForm(e){if(!e){return""}let t={};flatMap(t,e);return u.default.toFormString(t)}static getTimestamp(){let e=new Date;let t=e.getUTCFullYear();let r=c.default.pad2(e.getUTCMonth()+1);let s=c.default.pad2(e.getUTCDate());let n=c.default.pad2(e.getUTCHours());let i=c.default.pad2(e.getUTCMinutes());let o=c.default.pad2(e.getUTCSeconds());return`${t}-${r}-${s}T${n}:${i}:${o}Z`}static query(e){if(!e){return{}}let t={};flatMap(t,e);return t}static getRPCSignature(e,t,r){var s=normalize(e);var n=canonicalize(s);var i=`${t}&${encode("/")}&${encode(n)}`;const o=r+"&";return c.default.sha1(i,o,"base64")}static arrayToStringWithSpecifiedStyle(e,t,r){if(!e){return""}if(r==="repeatList"){let r={};replaceRepeatList(r,e,t);return l.default.stringify(r,"&&")}else if(r==="json"){return JSON.stringify(e)}else if(r==="simple"){return e.join(",")}else if(r==="spaceDelimited"){return e.join(" ")}else if(r==="pipeDelimited"){return e.join("|")}else{return""}}static parseToMap(e){return toMap(e)}static getEndpoint(e,t,r){if(r=="internal"){let t=e.split(".");t[0]+="-internal";e=t.join(".")}if(t&&r=="accelerate"){return"oss-accelerate.aliyuncs.com"}return e}static hexEncode(e){return e.toString("hex")}static hash(e,t){if(t==="ACS3-HMAC-SHA256"||t==="ACS3-RSA-SHA256"){const t=d.default.createHash("sha256");t.update(e);return t.digest()}else if(t=="ACS3-HMAC-SM3"){const t=d.default.createHash("sm3");t.update(e);return t.digest()}}static signatureMethod(e,t,r){if(r==="ACS3-HMAC-SHA256"){const r=d.default.createHmac("sha256",e);r.update(t);return r.digest()}else if(r==="ACS3-HMAC-SM3"){const r=d.default.createHmac("sm3",e);r.update(t);return r.digest()}else if(r==="ACS3-RSA-SHA256"){if(!e.startsWith(p)){e=p+e}if(!e.endsWith(f)){e=e+f}var s=d.default.createSign("RSA-SHA256");s.update(t);var n=s.sign({key:e,padding:d.default.constants.RSA_PKCS1_PADDING});return n}}static getAuthorization(e,t,r,s,n){const i=(e.pathname||"").replace("+","%20").replace("*","%2A").replace("%7E","~");const o=e.method;const a=getAuthorizationQueryString(e.query);const u=getAuthorizationHeaders(e.headers);const c=u["canonicalheaders"];const l=u["hsKeys"];const d=o+"\n"+i+"\n"+a+"\n"+c+"\n"+l.join(";")+"\n"+r;let p=Buffer.from(d);const f=t+"\n"+Client.hexEncode(Client.hash(p,t));const h=Client.hexEncode(Client.signatureMethod(n,f,t));const m=`${t} Credential=${s},SignedHeaders=${l.join(";")},Signature=${h}`;return m}static getEncodePath(e){if(typeof e==="undefined"||e===null){return""}let t=e.split("/");for(let e=0;e<t.length;e++){t[e]=encode(t[e])}return t.join("/")}static getEncodeParam(e){if(typeof e==="undefined"||e===null){return""}return encode(e)}}t["default"]=Client},4165:function(e,t,r){"use strict";var s=this&&this.__extends||function(){var extendStatics=function(e,t){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(t.hasOwnProperty(r))e[r]=t[r]};return extendStatics(e,t)};return function(e,t){extendStatics(e,t);function __(){this.constructor=e}e.prototype=t===null?Object.create(t):(__.prototype=t.prototype,new __)}}();var n=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};var a=this&&this.__awaiter||function(e,t,r,s){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(s.next(e))}catch(e){n(e)}}function rejected(e){try{step(s["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((s=s.apply(e,t||[])).next())}))};var u=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},s,n,i,o;return o={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function verb(e){return function(t){return step([e,t])}}function step(o){if(s)throw new TypeError("Generator is already executing.");while(r)try{if(s=1,n&&(i=o[0]&2?n["return"]:o[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;if(n=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;n=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){r.label=o[1];break}if(o[0]===6&&r.label<i[1]){r.label=i[1];i=o;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(o);break}if(i[2])r.ops.pop();r.trys.pop();continue}o=t.call(e,r)}catch(e){o=[6,e];n=0}finally{s=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};Object.defineProperty(t,"__esModule",{value:true});t.isRetryable=t.retryError=t.newUnretryableError=t.getBackoffTime=t.allowRetry=t.sleep=t.cast=t.Model=t.toMap=t.newError=t.doAction=t.Response=t.Request=t.BytesReadable=void 0;var c=o(r(3477));var l=r(3685);var d=r(5687);var p=r(2781);var f=o(r(9074));var h=r(7310);var m=function(e){s(BytesReadable,e);function BytesReadable(t){var r=e.call(this)||this;if(typeof t==="string"){r.value=Buffer.from(t)}else if(Buffer.isBuffer(t)){r.value=t}return r}BytesReadable.prototype._read=function(){this.push(this.value);this.push(null)};return BytesReadable}(p.Readable);t.BytesReadable=m;var y=function(){function Request(){this.headers={};this.query={}}return Request}();t.Request=y;var g=function(){function Response(e){this.statusCode=e.statusCode;this.statusMessage=e.statusMessage;this.headers=this.convertHeaders(e.headers);this.body=e}Response.prototype.convertHeaders=function(e){var t={};var r=Object.keys(e);for(var s=0;s<r.length;s++){var n=r[s];t[n]=e[n]}return t};Response.prototype.readBytes=function(){return a(this,void 0,void 0,(function(){var e;return u(this,(function(t){switch(t.label){case 0:return[4,f.read(this.body,"")];case 1:e=t.sent();return[2,e]}}))}))};return Response}();t.Response=g;function buildURL(e){var t=e.protocol+"://"+e.headers["host"];if(e.port){t+=":"+e.port}t+=""+e.pathname;var r=h.parse(t);if(e.query&&Object.keys(e.query).length>0){if(r.query){t+="&"+c.stringify(e.query)}else{t+="?"+c.stringify(e.query)}}return t}function isModelClass(e){if(!e){return false}return typeof e.types==="function"&&typeof e.names==="function"}function doAction(e,t){if(t===void 0){t=null}return a(this,void 0,void 0,(function(){var r,s,n,i,o;return u(this,(function(a){switch(a.label){case 0:r=buildURL(e);s=(e.method||"GET").toUpperCase();n={method:s,headers:e.headers};if(s!=="GET"&&s!=="HEAD"){n.data=e.body}if(t){if(typeof t.timeout!=="undefined"){n.timeout=Number(t.timeout)}if(typeof t.readTimeout!=="undefined"){n.readTimeout=Number(t.readTimeout)}if(typeof t.connectTimeout!=="undefined"){n.connectTimeout=Number(t.connectTimeout)}if(typeof t.ignoreSSL!=="undefined"){n.rejectUnauthorized=!t.ignoreSSL}if(typeof t.key!=="undefined"){n.key=String(t.key)}if(typeof t.cert!=="undefined"){n.cert=String(t.cert)}if(typeof t.ca!=="undefined"){n.ca=String(t.ca)}i={keepAlive:true};if(typeof t.keepAlive!=="undefined"){i.keepAlive=t.keepAlive;if(e.protocol&&e.protocol.toLowerCase()==="https"){n.agent=new d.Agent(i)}else{n.agent=new l.Agent(i)}}}return[4,f.request(r,n)];case 1:o=a.sent();return[2,new g(o)]}}))}))}t.doAction=doAction;var S=function(e){s(ResponseError,e);function ResponseError(t){var r=e.call(this,t.code+": "+t.message)||this;r.code=t.code;r.data=t.data;r.description=t.description;r.accessDeniedDetail=t.accessDeniedDetail;if(r.data&&r.data.statusCode){r.statusCode=Number(r.data.statusCode)}return r}return ResponseError}(Error);function newError(e){return new S(e)}t.newError=newError;function getValue(e,t){if(typeof e==="string"){return t}if(e.type==="array"){if(!Array.isArray(t)){throw new Error("expect: array, actual: "+typeof t)}return t.map((function(t){return getValue(e.itemType,t)}))}if(typeof e==="function"){if(isModelClass(e)){return new e(t)}return t}return t}function toMap(e){if(e===void 0){e=undefined}if(typeof e==="undefined"||e==null){return null}if(e instanceof T){return e.toMap()}if(typeof e.toMap==="function"){return e.toMap()}if(Array.isArray(e)){return e.map((function(e){return toMap(e)}))}return e}t.toMap=toMap;var T=function(){function Model(e){var t=this;if(e==null){return}var r=this.constructor;var s=r.names();var n=r.types();Object.keys(s).forEach((function(r){var s=e[r];if(s===undefined||s===null){return}var i=n[r];t[r]=getValue(i,s)}))}Model.prototype.toMap=function(){var e=this;var t={};var r=this.constructor;var s=r.names();Object.keys(s).forEach((function(r){var n=s[r];var i=e[r];if(typeof i==="undefined"||i==null){return}t[n]=toMap(i)}));return t};return Model}();t.Model=T;function cast(e,t){if(!e){throw new Error("can not cast to Map")}if(typeof e!=="object"){throw new Error("can not cast to Map")}var r=e;var s=t.constructor;var n=s.names();var i=s.types();Object.keys(n).forEach((function(e){var s=n[e];var o=r[s];var a=i[e];if(typeof o==="undefined"||o==null){return}if(typeof a==="string"){if(a==="Readable"||a==="map"||a==="Buffer"||a==="any"||typeof o===a){t[e]=o;return}if(a==="string"&&(typeof o==="number"||typeof o==="boolean")){t[e]=o.toString();return}if(a==="boolean"){if(o===1||o===0){t[e]=!!o;return}if(o==="true"||o==="false"){t[e]=o==="true";return}}if(a==="number"&&typeof o==="string"){if(o.match(/^\d*$/)){t[e]=parseInt(o);return}if(o.match(/^[\.\d]*$/)){t[e]=parseFloat(o);return}}throw new Error("type of "+e+" is mismatch, expect "+a+", but "+typeof o)}else if(a.type==="map"){if(!(o instanceof Object)){throw new Error("type of "+e+" is mismatch, expect object, but "+typeof o)}t[e]=o}else if(a.type==="array"){if(!Array.isArray(o)){throw new Error("type of "+e+" is mismatch, expect array, but "+typeof o)}if(typeof a.itemType==="function"){t[e]=o.map((function(e){if(isModelClass(a.itemType)){return cast(e,new a.itemType({}))}return e}))}else{t[e]=o}}else if(typeof a==="function"){if(!(o instanceof Object)){throw new Error("type of "+e+" is mismatch, expect object, but "+typeof o)}if(isModelClass(a)){t[e]=cast(o,new a({}));return}t[e]=o}else{}}));return t}t.cast=cast;function sleep(e){return new Promise((function(t){setTimeout(t,e)}))}t.sleep=sleep;function allowRetry(e,t,r){if(t===0){return true}if(e.retryable!==true){return false}if(e.policy==="never"){return false}if(e.policy==="always"){return true}if(e.policy==="simple"){return t<e["maxAttempts"]}if(e.policy==="timeout"){return Date.now()-r<e.timeout}if(e.maxAttempts&&typeof e.maxAttempts==="number"){return e.maxAttempts>=t}return false}t.allowRetry=allowRetry;function getBackoffTime(e,t){if(t===0){return 0}if(e.policy==="no"){return 0}if(e.policy==="fixed"){return e.period}if(e.policy==="random"){var r=e["minPeriod"];var s=e["maxPeriod"];return r+(s-r)*Math.random()}if(e.policy==="exponential"){var n=e.initial;var i=e.multiplier;var o=n*Math.pow(1+i,t-1);var s=e.max;return Math.min(o,s)}if(e.policy==="exponential_random"){var n=e.initial;var i=e.multiplier;var o=n*Math.pow(1+i,t-1);var s=e.max;return Math.min(o*(.5+Math.random()),s)}return 0}t.getBackoffTime=getBackoffTime;var w=function(e){s(UnretryableError,e);function UnretryableError(t){var r=e.call(this,t)||this;r.name="UnretryableError";return r}return UnretryableError}(Error);function newUnretryableError(e){var t=new w("");t.data={lastRequest:e};return t}t.newUnretryableError=newUnretryableError;var b=function(e){s(RetryError,e);function RetryError(t){var r=e.call(this,t)||this;r.name="RetryError";return r}return RetryError}(Error);function retryError(e,t){var r=new b("");r.data={request:e,response:t};return r}t.retryError=retryError;function isRetryable(e){if(typeof e==="undefined"||e===null){return false}return e.name==="RetryError"}t.isRetryable=isRetryable},1979:function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){if(s===undefined)s=r;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,s){if(s===undefined)s=r;e[s]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))s(t,e,r);n(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.RuntimeOptions=t.ExtendsParameters=void 0;const a=r(2781);const u=i(r(4165));const c=i(r(8683));const l=o(r(3477));const d=r(2037);const p=`AlibabaCloud (${d.platform()}; ${d.arch()}) Node.js/${process.version} Core/1.0.1 TeaDSL/1`;class ExtendsParameters extends u.Model{constructor(e){super(e)}static names(){return{headers:"headers",queries:"queries"}}static types(){return{headers:{type:"map",keyType:"string",valueType:"string"},queries:{type:"map",keyType:"string",valueType:"string"}}}}t.ExtendsParameters=ExtendsParameters;class RuntimeOptions extends u.Model{constructor(e){super(e)}static names(){return{autoretry:"autoretry",ignoreSSL:"ignoreSSL",key:"key",cert:"cert",ca:"ca",maxAttempts:"max_attempts",backoffPolicy:"backoff_policy",backoffPeriod:"backoff_period",readTimeout:"readTimeout",connectTimeout:"connectTimeout",httpProxy:"httpProxy",httpsProxy:"httpsProxy",noProxy:"noProxy",maxIdleConns:"maxIdleConns",keepAlive:"keepAlive",extendsParameters:"extendsParameters"}}static types(){return{autoretry:"boolean",ignoreSSL:"boolean",key:"string",cert:"string",ca:"string",maxAttempts:"number",backoffPolicy:"string",backoffPeriod:"number",readTimeout:"number",connectTimeout:"number",httpProxy:"string",httpsProxy:"string",noProxy:"string",maxIdleConns:"number",keepAlive:"boolean",extendsParameters:ExtendsParameters}}}t.RuntimeOptions=RuntimeOptions;function read(e){return new Promise(((t,r)=>{let s,n,i;var cleanup=function(){e.removeListener("error",n);e.removeListener("data",s);e.removeListener("end",i)};var o=[];var a=0;s=function(e){o.push(e);a+=e.length};n=function(e){cleanup();r(e)};i=function(){cleanup();t(Buffer.concat(o,a))};e.on("error",n);e.on("data",s);e.on("end",i)}))}class Client{static toString(e){return e.toString()}static parseJSON(e){return JSON.parse(e)}static async readAsBytes(e){return await read(e)}static async readAsString(e){let t=await Client.readAsBytes(e);return Client.toString(t)}static async readAsJSON(e){return Client.parseJSON(await Client.readAsString(e))}static getNonce(){return c.makeNonce()}static getDateUTCString(){const e=new Date;return e.toUTCString()}static defaultString(e,t){return e||t}static defaultNumber(e,t){return e||t}static toFormString(e){return l.default.stringify(e)}static toJSONString(e){if(typeof e==="string"){return e}return JSON.stringify(e)}static toBytes(e){return Buffer.from(e)}static empty(e){return!e}static equalString(e,t){return e===t}static equalNumber(e,t){return e===t}static isUnset(e){if(typeof e==="undefined"){return true}if(e===null){return true}return false}static stringifyMapValue(e){if(!e){return e}const t={};for(const[r,s]of Object.entries(e)){if(typeof s==="undefined"||s===null){continue}t[r]=String(s)}return t}static anyifyMapValue(e){return e}static assertAsBoolean(e){if(typeof e==="boolean"){return e}throw new Error(`The value is not a boolean`)}static assertAsString(e){if(typeof e==="string"){return e}throw new Error(`The value is not a string`)}static assertAsNumber(e){if(typeof e==="number"){return e}throw new Error(`The value is not a number`)}static assertAsInteger(e){if(Number.isInteger(e)){return e}throw new Error(`The value is not a int number`)}static assertAsMap(e){if(e&&typeof e==="object"&&!Array.isArray(e)){return e}throw new Error(`The value is not a object`)}static assertAsArray(e){if(Array.isArray(e)){return e}throw new Error(`The value is not array`)}static assertAsBytes(e){if(Buffer.isBuffer(e)){return e}throw new Error(`The value is not bytes`)}static getUserAgent(e){if(!e||!e.length){return p}return p+" "+e}static is2xx(e){return e>=200&&e<300}static is3xx(e){return e>=300&&e<400}static is4xx(e){return e>=400&&e<500}static is5xx(e){return e>=500&&e<600}static validateModel(e){}static toMap(e){return u.toMap(e)}static async sleep(e){return new Promise((t=>{setTimeout((()=>{t()}),e)}))}static toArray(e){if(!(e instanceof Array)){return null}let t=[];e.forEach((e=>{if(!e){return}t.push(u.toMap(e))}));return t}static assertAsReadable(e){if(e instanceof a.Readable){return e}throw new Error(`The value is not a readable`)}}t["default"]=Client},5757:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(6189);class Client{static parseXml(e,t){let r=this._parseXML(e);if(t!==null&&typeof t!=="undefined"){r=this._xmlCast(r,t)}return r}static toXML(e){const t=new s.Builder;return t.buildObject(e)}static _parseXML(e){let t=new s.Parser({explicitArray:false});let r={};t.parseString(e,(function(e,t){r.err=e;r.output=t}));if(r.err){throw r.err}return r.output}static _xmlCast(e,t){e=e||{};let r={};let s=t;let n=s.names();let i=s.types();Object.keys(n).forEach((t=>{let s=n[t];let o=e[s];let a=i[t];switch(a){case"boolean":if(!o){r[s]=false;return}r[s]=o==="false"?false:true;return;case"number":if(o!=0&&!o){r[s]=NaN;return}r[s]=+o;return;case"string":if(!o){r[s]="";return}r[s]=o.toString();return;default:if(a.type==="array"){if(!o){r[s]=[];return}if(!Array.isArray(o)){o=[o]}if(typeof a.itemType==="function"){r[s]=o.map((e=>this._xmlCast(e,a.itemType)))}else{r[s]=o}}else if(typeof a==="function"){if(!o){o={}}r[s]=this._xmlCast(o,a)}else{r[s]=o}}}));return r}}t["default"]=Client},4697:function(e){var t=1e3;var r=t*60;var s=r*60;var n=s*24;var i=n*7;var o=n*365.25;e.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0){return parse(e)}else if(r==="number"&&isFinite(e)){return t.long?fmtLong(e):fmtShort(e)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function parse(e){e=String(e);if(e.length>100){return}var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a){return}var u=parseFloat(a[1]);var c=(a[2]||"ms").toLowerCase();switch(c){case"years":case"year":case"yrs":case"yr":case"y":return u*o;case"weeks":case"week":case"w":return u*i;case"days":case"day":case"d":return u*n;case"hours":case"hour":case"hrs":case"hr":case"h":return u*s;case"minutes":case"minute":case"mins":case"min":case"m":return u*r;case"seconds":case"second":case"secs":case"sec":case"s":return u*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return undefined}}function fmtShort(e){var i=Math.abs(e);if(i>=n){return Math.round(e/n)+"d"}if(i>=s){return Math.round(e/s)+"h"}if(i>=r){return Math.round(e/r)+"m"}if(i>=t){return Math.round(e/t)+"s"}return e+"ms"}function fmtLong(e){var i=Math.abs(e);if(i>=n){return plural(e,i,n,"day")}if(i>=s){return plural(e,i,s,"hour")}if(i>=r){return plural(e,i,r,"minute")}if(i>=t){return plural(e,i,t,"second")}return e+" ms"}function plural(e,t,r,s){var n=t>=r*1.5;return Math.round(e/r)+" "+s+(n?"s":"")}},8222:function(e,t,r){t.formatArgs=formatArgs;t.save=save;t.load=load;t.useColors=useColors;t.storage=localstorage();t.destroy=(()=>{let e=false;return()=>{if(!e){e=true;console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}}})();t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function useColors(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)){return true}if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)){return false}let e;return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function formatArgs(t){t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff);if(!this.useColors){return}const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let s=0;let n=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{if(e==="%%"){return}s++;if(e==="%c"){n=s}}));t.splice(n,0,r)}t.log=console.debug||console.log||(()=>{});function save(e){try{if(e){t.storage.setItem("debug",e)}else{t.storage.removeItem("debug")}}catch(e){}}function load(){let e;try{e=t.storage.getItem("debug")}catch(e){}if(!e&&typeof process!=="undefined"&&"env"in process){e=process.env.DEBUG}return e}function localstorage(){try{return localStorage}catch(e){}}e.exports=r(6243)(t);const{formatters:s}=e.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},6243:function(e,t,r){function setup(e){createDebug.debug=createDebug;createDebug.default=createDebug;createDebug.coerce=coerce;createDebug.disable=disable;createDebug.enable=enable;createDebug.enabled=enabled;createDebug.humanize=r(4697);createDebug.destroy=destroy;Object.keys(e).forEach((t=>{createDebug[t]=e[t]}));createDebug.names=[];createDebug.skips=[];createDebug.formatters={};function selectColor(e){let t=0;for(let r=0;r<e.length;r++){t=(t<<5)-t+e.charCodeAt(r);t|=0}return createDebug.colors[Math.abs(t)%createDebug.colors.length]}createDebug.selectColor=selectColor;function createDebug(e){let t;let r=null;let s;let n;function debug(...e){if(!debug.enabled){return}const r=debug;const s=Number(new Date);const n=s-(t||s);r.diff=n;r.prev=t;r.curr=s;t=s;e[0]=createDebug.coerce(e[0]);if(typeof e[0]!=="string"){e.unshift("%O")}let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((t,s)=>{if(t==="%%"){return"%"}i++;const n=createDebug.formatters[s];if(typeof n==="function"){const s=e[i];t=n.call(r,s);e.splice(i,1);i--}return t}));createDebug.formatArgs.call(r,e);const o=r.log||createDebug.log;o.apply(r,e)}debug.namespace=e;debug.useColors=createDebug.useColors();debug.color=createDebug.selectColor(e);debug.extend=extend;debug.destroy=createDebug.destroy;Object.defineProperty(debug,"enabled",{enumerable:true,configurable:false,get:()=>{if(r!==null){return r}if(s!==createDebug.namespaces){s=createDebug.namespaces;n=createDebug.enabled(e)}return n},set:e=>{r=e}});if(typeof createDebug.init==="function"){createDebug.init(debug)}return debug}function extend(e,t){const r=createDebug(this.namespace+(typeof t==="undefined"?":":t)+e);r.log=this.log;return r}function enable(e){createDebug.save(e);createDebug.namespaces=e;createDebug.names=[];createDebug.skips=[];let t;const r=(typeof e==="string"?e:"").split(/[\s,]+/);const s=r.length;for(t=0;t<s;t++){if(!r[t]){continue}e=r[t].replace(/\*/g,".*?");if(e[0]==="-"){createDebug.skips.push(new RegExp("^"+e.slice(1)+"$"))}else{createDebug.names.push(new RegExp("^"+e+"$"))}}}function disable(){const e=[...createDebug.names.map(toNamespace),...createDebug.skips.map(toNamespace).map((e=>"-"+e))].join(",");createDebug.enable("");return e}function enabled(e){if(e[e.length-1]==="*"){return true}let t;let r;for(t=0,r=createDebug.skips.length;t<r;t++){if(createDebug.skips[t].test(e)){return false}}for(t=0,r=createDebug.names.length;t<r;t++){if(createDebug.names[t].test(e)){return true}}return false}function toNamespace(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}function coerce(e){if(e instanceof Error){return e.stack||e.message}return e}function destroy(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}createDebug.enable(createDebug.load());return createDebug}e.exports=setup},8237:function(e,t,r){if(typeof process==="undefined"||process.type==="renderer"||process.browser===true||process.__nwjs){e.exports=r(8222)}else{e.exports=r(5332)}},5332:function(e,t,r){const s=r(6224);const n=r(3837);t.init=init;t.log=log;t.formatArgs=formatArgs;t.save=save;t.load=load;t.useColors=useColors;t.destroy=n.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");t.colors=[6,2,3,4,5,1];try{const e=r(9318);if(e&&(e.stderr||e).level>=2){t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const r=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let s=process.env[t];if(/^(yes|on|true|enabled)$/i.test(s)){s=true}else if(/^(no|off|false|disabled)$/i.test(s)){s=false}else if(s==="null"){s=null}else{s=Number(s)}e[r]=s;return e}),{});function useColors(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):s.isatty(process.stderr.fd)}function formatArgs(t){const{namespace:r,useColors:s}=this;if(s){const s=this.color;const n="[3"+(s<8?s:"8;5;"+s);const i=` ${n};1m${r} `;t[0]=i+t[0].split("\n").join("\n"+i);t.push(n+"m+"+e.exports.humanize(this.diff)+"")}else{t[0]=getDate()+r+" "+t[0]}}function getDate(){if(t.inspectOpts.hideDate){return""}return(new Date).toISOString()+" "}function log(...e){return process.stderr.write(n.formatWithOptions(t.inspectOpts,...e)+"\n")}function save(e){if(e){process.env.DEBUG=e}else{delete process.env.DEBUG}}function load(){return process.env.DEBUG}function init(e){e.inspectOpts={};const r=Object.keys(t.inspectOpts);for(let s=0;s<r.length;s++){e.inspectOpts[r[s]]=t.inspectOpts[r[s]]}}e.exports=r(6243)(t);const{formatters:i}=e.exports;i.o=function(e){this.inspectOpts.colors=this.useColors;return n.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")};i.O=function(e){this.inspectOpts.colors=this.useColors;return n.inspect(e,this.inspectOpts)}},9074:function(e,t,r){"use strict";const s=r(9796);const n=r(3685);const i=r(5687);const o=r(7310).parse;const a=r(7310).format;const u=r(8237)("httpx:body");const c=r(8237)("httpx:header");const l=new n.Agent({keepAlive:true});const d=new i.Agent({keepAlive:true});const p=3e3;const f=Symbol("TIMER::READ_TIMER");const h=Symbol("TIMER::READ_TIME_OUT");const m=Symbol("TIMER::READ_TIMER_START_AT");function decompress(e){switch(e.headers["content-encoding"]){case"gzip":return e.pipe(s.createGunzip());case"deflate":return e.pipe(s.createInflate());default:return e}}var append=function(e,t,r){e.name=t+e.name;e.message=`${r}. ${e.message}`;return e};const isNumber=function(e){return e!==null&&!isNaN(e)};t.request=function(e,t){t||(t={});const r=typeof e==="string"?o(e):e;let s,y;if(isNumber(t.readTimeout)||isNumber(t.connectTimeout)){s=isNumber(t.readTimeout)?Number(t.readTimeout):p;y=isNumber(t.connectTimeout)?Number(t.connectTimeout):p}else if(isNumber(t.timeout)){s=y=Number(t.timeout)}else{s=y=p}const g=r.protocol==="https:";const S=(t.method||"GET").toUpperCase();const T=g?d:l;const w=t.agent||T;var b={host:r.hostname||"localhost",path:r.path||"/",method:S,port:r.port||(r.protocol==="https:"?443:80),agent:w,headers:t.headers||{},key:t.key||"",cert:t.cert||"",ca:t.ca||"",timeout:y};if(g&&typeof t.rejectUnauthorized!=="undefined"){b.rejectUnauthorized=t.rejectUnauthorized}if(t.compression){b.headers["accept-encoding"]="gzip,deflate"}const C=g?i:n;if(typeof t.beforeRequest==="function"){b=t.beforeRequest(b)}return new Promise(((e,n)=>{const i=C.request(b);const o=t.data;var fulfilled=t=>{if(c.enabled){const e=t.req._header;e.split("\r\n").forEach((e=>{c("> %s",e)}));c("< HTTP/%s %s %s",t.httpVersion,t.statusCode,t.statusMessage);Object.keys(t.headers).forEach((e=>{c("< %s: %s",e,t.headers[e])}))}e(t)};var rejected=e=>{e.message+=`${S} ${a(r)} failed.`;if(i.socket&&i.socket[f]){clearTimeout(i.socket[f])}n(e)};var abort=e=>{i.abort();rejected(e)};const startResponseTimer=function(e){const t=setTimeout((()=>{if(e[f]){clearTimeout(e[f]);e[f]=null}var t=new Error;var r=`ReadTimeout(${s})`;abort(append(t,"RequestTimeout",r))}),s);e[h]=s;e[f]=t;e[m]=Date.now();t.unref()};if(!o||"string"===typeof o||o instanceof Buffer){if(u.enabled){if(!o){u("<no request body>")}else if("string"===typeof o){u(o)}else{u(`Buffer <ignored>, Buffer length: ${o.length}`)}}i.end(o)}else if("function"===typeof o.pipe){o.pipe(i);if(u.enabled){u("<request body is a stream>")}o.once("error",(e=>{abort(append(e,"HttpX","Stream occor error"))}))}i.on("response",fulfilled);i.on("error",rejected);i.once("socket",(function(e){if(e.readyState==="opening"){e.once("connect",(function(){startResponseTimer(e)}))}else{startResponseTimer(e)}}))}))};t.read=function(e,t){const r=decompress(e);return new Promise(((s,n)=>{const i=e.socket||e.client;const makeReadTimeoutError=()=>{const t=e.req;var r=new Error;r.name="RequestTimeoutError";r.message=`ReadTimeout: ${i[h]}. ${t.method} ${t.path} failed.`;return r};let o;const a=i[f];if(!a){n(makeReadTimeoutError());return}const c=i[h]-(Date.now()-i[m]);clearTimeout(a);if(c<=0){n(makeReadTimeoutError());return}o=setTimeout((function(){n(makeReadTimeoutError())}),c);var l,d,p;var cleanup=function(){r.removeListener("error",l);r.removeListener("data",d);r.removeListener("end",p);if(o){clearTimeout(o)}};const y=[];var g=0;d=function(e){y.push(e);g+=e.length};l=function(e){cleanup();n(e)};p=function(){cleanup();var e=Buffer.concat(y,g);u("");if(t){const r=e.toString(t);u(r);return s(r)}if(u.enabled){u(e.toString())}s(e)};r.on("error",l);r.on("data",d);r.on("end",p)}))};function readyToRead(e){return new Promise(((t,r)=>{var s,n,i;var cleanup=function(){e.removeListener("error",i);e.removeListener("end",n);e.removeListener("readable",s)};s=function(){cleanup();t(false)};n=function(){cleanup();t(true)};i=function(e){cleanup();r(e)};e.once("readable",s);e.once("end",n);e.once("error",i)}))}class Event{constructor(e,t,r,s){this.id=e;this.event=t;this.data=r;this.retry=s}}t.Event=Event;const y="data: ";const g="event: ";const S="id: ";const T="retry: ";function tryGetEvents(e,t){const r=e+t;let s=0;const n=[];for(let e=0;e<r.length-1;e++){const t=r[e];const i=r[e+1];if(t==="\n"&&i==="\n"){const t=r.substring(s,e);const i=t.split("\n");const o=new Event;i.forEach((e=>{if(e.startsWith(y)){o.data=e.substring(y.length)}else if(e.startsWith(g)){o.event=e.substring(g.length)}else if(e.startsWith(S)){o.id=e.substring(S.length)}else if(e.startsWith(T)){o.retry=e.substring(T.length)}}));n.push(o);s=e+2}}const i=r.substring(s);return[n,i]}t.readAsSSE=async function*(e){const t=decompress(e);const r=e.socket||e.client;clearTimeout(r[f]);let s="";while(true){const e=await readyToRead(t);if(e){return}let r;while(null!==(r=t.read())){const[e,t]=tryGetEvents(s,r.toString());s=t;if(e&&e.length>0){for(const t of e){yield t}}}}}},8885:function(e,t){t.parse=t.decode=decode;t.stringify=t.encode=encode;t.safe=safe;t.unsafe=unsafe;var r=typeof process!=="undefined"&&process.platform==="win32"?"\r\n":"\n";function encode(e,t){var s=[];var n="";if(typeof t==="string"){t={section:t,whitespace:false}}else{t=t||{};t.whitespace=t.whitespace===true}var i=t.whitespace?" = ":"=";Object.keys(e).forEach((function(t,o,a){var u=e[t];if(u&&Array.isArray(u)){u.forEach((function(e){n+=safe(t+"[]")+i+safe(e)+"\n"}))}else if(u&&typeof u==="object")s.push(t);else n+=safe(t)+i+safe(u)+r}));if(t.section&&n.length)n="["+safe(t.section)+"]"+r+n;s.forEach((function(s,i,o){var a=dotSplit(s).join("\\.");var u=(t.section?t.section+".":"")+a;var c=encode(e[s],{section:u,whitespace:t.whitespace});if(n.length&&c.length)n+=r;n+=c}));return n}function dotSplit(e){return e.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map((function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")}))}function decode(e){var t={};var r=t;var s=null;var n=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;var i=e.split(/[\r\n]+/g);i.forEach((function(e,i,o){if(!e||e.match(/^\s*[;#]/))return;var a=e.match(n);if(!a)return;if(a[1]!==undefined){s=unsafe(a[1]);if(s==="__proto__"){r={};return}r=t[s]=t[s]||{};return}var u=unsafe(a[2]);if(u==="__proto__")return;var c=a[3]?unsafe(a[4]):true;switch(c){case"true":case"false":case"null":c=JSON.parse(c)}if(u.length>2&&u.slice(-2)==="[]"){u=u.substring(0,u.length-2);if(u==="__proto__")return;if(!r[u])r[u]=[];else if(!Array.isArray(r[u]))r[u]=[r[u]]}if(Array.isArray(r[u]))r[u].push(c);else r[u]=c}));Object.keys(t).filter((function(e,r,s){if(!t[e]||typeof t[e]!=="object"||Array.isArray(t[e]))return false;var n=dotSplit(e);var i=t;var o=n.pop();var a=o.replace(/\\\./g,".");n.forEach((function(e,t,r){if(e==="__proto__")return;if(!i[e]||typeof i[e]!=="object")i[e]={};i=i[e]}));if(i===t&&a===o)return false;i[a]=t[e];return true})).forEach((function(e,r,s){delete t[e]}));return t}function isQuoted(e){return e.charAt(0)==='"'&&e.slice(-1)==='"'||e.charAt(0)==="'"&&e.slice(-1)==="'"}function safe(e){return typeof e!=="string"||e.match(/[=\r\n]/)||e.match(/^\[/)||e.length>1&&isQuoted(e)||e!==e.trim()?JSON.stringify(e):e.replace(/;/g,"\\;").replace(/#/g,"\\#")}function unsafe(e,t){e=(e||"").trim();if(isQuoted(e)){if(e.charAt(0)==="'")e=e.substr(1,e.length-2);try{e=JSON.parse(e)}catch(e){}}else{var r=false;var s="";for(var n=0,i=e.length;n<i;n++){var o=e.charAt(n);if(r){if("\\;#".indexOf(o)!==-1)s+=o;else s+="\\"+o;r=false}else if(";#".indexOf(o)!==-1)break;else if(o==="\\")r=true;else s+=o}if(r)s+="\\";return s.trim()}return e}},8683:function(e,t,r){"use strict";const s=r(7147);const n=r(2037);const i=r(6113);t.loadJSONSync=function(e){var t=s.readFileSync(e,"utf8");if(t.charCodeAt(0)===65279){t=t.slice(1)}try{return JSON.parse(t)}catch(t){t.message=e+": "+t.message;throw t}};t.encode=function(e,t){if(typeof e!=="string"){e=""+e}return Buffer.from(e,t)};t.makeHasher=function(e){return function(t,r){var s=i.createHash(e);s.update(t);return s.digest(r)}};t.createHash=t.makeHasher;t.md5=t.makeHasher("md5");t.createHmac=function(e){return function(t,r,s){return i.createHmac(e,r).update(t).digest(s)}};t.sha1=t.createHmac("sha1");t.random=function(e,t){return Math.floor(e+Math.random()*(t-e))};t.makeNonce=function(){var e=0;var r;const s=n.hostname();const i=process.pid;return function(){var n=Math.floor(Math.random()*1e12);if(n===r){e++}else{e=0}r=n;var o=`${s}${i}${n}${e}`;return t.md5(o,"hex")}}();t.pad2=function(e){if(e<10){return"0"+e}return""+e};t.pad3=function(e){if(e<10){return"00"+e}else if(e<100){return"0"+e}return""+e};t.getYYYYMMDD=function(e){var r=e.getFullYear();var s=t.pad2(e.getMonth()+1);var n=t.pad2(e.getDate());return""+r+s+n};t.sleep=function(e){return new Promise((t=>{setTimeout(t,e)}))};t.getIPv4=function(){var e=n.networkInterfaces();var t=Object.keys(e);for(var r=0;r<t.length;r++){var s=t[r];var i=e[s];for(var o=0;o<i.length;o++){var a=i[o];if(!a.internal&&a.family==="IPv4"){return a.address}}}return""};t.getMac=function(){var e=n.networkInterfaces();var t=Object.keys(e);for(var r=0;r<t.length;r++){var s=t[r];var i=e[s];for(var o=0;o<i.length;o++){var a=i[o];if(!a.internal&&a.family==="IPv4"){return a.mac}}}return"00:00:00:00:00:00"};t.readAll=function(e){return new Promise(((t,r)=>{var s,n,i;var cleanup=function(t){e.removeListener("error",s);e.removeListener("data",n);e.removeListener("end",i)};var o=[];var a=0;n=function(e){o.push(e);a+=e.length};s=function(e){cleanup();r(e)};i=function(){cleanup();t(Buffer.concat(o,a))};e.on("error",s);e.on("data",n);e.on("end",i)}))}},2043:function(e,t,r){(function(e){e.parser=function(e,t){return new SAXParser(e,t)};e.SAXParser=SAXParser;e.SAXStream=SAXStream;e.createStream=createStream;e.MAX_BUFFER_LENGTH=64*1024;var t=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];e.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function SAXParser(t,r){if(!(this instanceof SAXParser)){return new SAXParser(t,r)}var s=this;clearBuffers(s);s.q=s.c="";s.bufferCheckPosition=e.MAX_BUFFER_LENGTH;s.opt=r||{};s.opt.lowercase=s.opt.lowercase||s.opt.lowercasetags;s.looseCase=s.opt.lowercase?"toLowerCase":"toUpperCase";s.tags=[];s.closed=s.closedRoot=s.sawRoot=false;s.tag=s.error=null;s.strict=!!t;s.noscript=!!(t||s.opt.noscript);s.state=h.BEGIN;s.strictEntities=s.opt.strictEntities;s.ENTITIES=s.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES);s.attribList=[];if(s.opt.xmlns){s.ns=Object.create(c)}s.trackPosition=s.opt.position!==false;if(s.trackPosition){s.position=s.line=s.column=0}emit(s,"onready")}if(!Object.create){Object.create=function(e){function F(){}F.prototype=e;var t=new F;return t}}if(!Object.keys){Object.keys=function(e){var t=[];for(var r in e)if(e.hasOwnProperty(r))t.push(r);return t}}function checkBufferLength(r){var s=Math.max(e.MAX_BUFFER_LENGTH,10);var n=0;for(var i=0,o=t.length;i<o;i++){var a=r[t[i]].length;if(a>s){switch(t[i]){case"textNode":closeText(r);break;case"cdata":emitNode(r,"oncdata",r.cdata);r.cdata="";break;case"script":emitNode(r,"onscript",r.script);r.script="";break;default:error(r,"Max buffer length exceeded: "+t[i])}}n=Math.max(n,a)}var u=e.MAX_BUFFER_LENGTH-n;r.bufferCheckPosition=u+r.position}function clearBuffers(e){for(var r=0,s=t.length;r<s;r++){e[t[r]]=""}}function flushBuffers(e){closeText(e);if(e.cdata!==""){emitNode(e,"oncdata",e.cdata);e.cdata=""}if(e.script!==""){emitNode(e,"onscript",e.script);e.script=""}}SAXParser.prototype={end:function(){end(this)},write:write,resume:function(){this.error=null;return this},close:function(){return this.write(null)},flush:function(){flushBuffers(this)}};var s;try{s=r(2781).Stream}catch(e){s=function(){}}if(!s)s=function(){};var n=e.EVENTS.filter((function(e){return e!=="error"&&e!=="end"}));function createStream(e,t){return new SAXStream(e,t)}function SAXStream(e,t){if(!(this instanceof SAXStream)){return new SAXStream(e,t)}s.apply(this);this._parser=new SAXParser(e,t);this.writable=true;this.readable=true;var r=this;this._parser.onend=function(){r.emit("end")};this._parser.onerror=function(e){r.emit("error",e);r._parser.error=null};this._decoder=null;n.forEach((function(e){Object.defineProperty(r,"on"+e,{get:function(){return r._parser["on"+e]},set:function(t){if(!t){r.removeAllListeners(e);r._parser["on"+e]=t;return t}r.on(e,t)},enumerable:true,configurable:false})}))}SAXStream.prototype=Object.create(s.prototype,{constructor:{value:SAXStream}});SAXStream.prototype.write=function(e){if(typeof Buffer==="function"&&typeof Buffer.isBuffer==="function"&&Buffer.isBuffer(e)){if(!this._decoder){var t=r(1576).StringDecoder;this._decoder=new t("utf8")}e=this._decoder.write(e)}this._parser.write(e.toString());this.emit("data",e);return true};SAXStream.prototype.end=function(e){if(e&&e.length){this.write(e)}this._parser.end();return true};SAXStream.prototype.on=function(e,t){var r=this;if(!r._parser["on"+e]&&n.indexOf(e)!==-1){r._parser["on"+e]=function(){var t=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e);r.emit.apply(r,t)}}return s.prototype.on.call(r,e,t)};var i="[CDATA[";var o="DOCTYPE";var a="http://www.w3.org/XML/1998/namespace";var u="http://www.w3.org/2000/xmlns/";var c={xml:a,xmlns:u};var l=/[:_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]/;var d=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;var p=/[#:_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]/;var f=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function isWhitespace(e){return e===" "||e==="\n"||e==="\r"||e==="\t"}function isQuote(e){return e==='"'||e==="'"}function isAttribEnd(e){return e===">"||isWhitespace(e)}function isMatch(e,t){return e.test(t)}function notMatch(e,t){return!isMatch(e,t)}var h=0;e.STATE={BEGIN:h++,BEGIN_WHITESPACE:h++,TEXT:h++,TEXT_ENTITY:h++,OPEN_WAKA:h++,SGML_DECL:h++,SGML_DECL_QUOTED:h++,DOCTYPE:h++,DOCTYPE_QUOTED:h++,DOCTYPE_DTD:h++,DOCTYPE_DTD_QUOTED:h++,COMMENT_STARTING:h++,COMMENT:h++,COMMENT_ENDING:h++,COMMENT_ENDED:h++,CDATA:h++,CDATA_ENDING:h++,CDATA_ENDING_2:h++,PROC_INST:h++,PROC_INST_BODY:h++,PROC_INST_ENDING:h++,OPEN_TAG:h++,OPEN_TAG_SLASH:h++,ATTRIB:h++,ATTRIB_NAME:h++,ATTRIB_NAME_SAW_WHITE:h++,ATTRIB_VALUE:h++,ATTRIB_VALUE_QUOTED:h++,ATTRIB_VALUE_CLOSED:h++,ATTRIB_VALUE_UNQUOTED:h++,ATTRIB_VALUE_ENTITY_Q:h++,ATTRIB_VALUE_ENTITY_U:h++,CLOSE_TAG:h++,CLOSE_TAG_SAW_WHITE:h++,SCRIPT:h++,SCRIPT_ENDING:h++};e.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"};e.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830};Object.keys(e.ENTITIES).forEach((function(t){var r=e.ENTITIES[t];var s=typeof r==="number"?String.fromCharCode(r):r;e.ENTITIES[t]=s}));for(var m in e.STATE){e.STATE[e.STATE[m]]=m}h=e.STATE;function emit(e,t,r){e[t]&&e[t](r)}function emitNode(e,t,r){if(e.textNode)closeText(e);emit(e,t,r)}function closeText(e){e.textNode=textopts(e.opt,e.textNode);if(e.textNode)emit(e,"ontext",e.textNode);e.textNode=""}function textopts(e,t){if(e.trim)t=t.trim();if(e.normalize)t=t.replace(/\s+/g," ");return t}function error(e,t){closeText(e);if(e.trackPosition){t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c}t=new Error(t);e.error=t;emit(e,"onerror",t);return e}function end(e){if(e.sawRoot&&!e.closedRoot)strictFail(e,"Unclosed root tag");if(e.state!==h.BEGIN&&e.state!==h.BEGIN_WHITESPACE&&e.state!==h.TEXT){error(e,"Unexpected end")}closeText(e);e.c="";e.closed=true;emit(e,"onend");SAXParser.call(e,e.strict,e.opt);return e}function strictFail(e,t){if(typeof e!=="object"||!(e instanceof SAXParser)){throw new Error("bad call to strictFail")}if(e.strict){error(e,t)}}function newTag(e){if(!e.strict)e.tagName=e.tagName[e.looseCase]();var t=e.tags[e.tags.length-1]||e;var r=e.tag={name:e.tagName,attributes:{}};if(e.opt.xmlns){r.ns=t.ns}e.attribList.length=0;emitNode(e,"onopentagstart",r)}function qname(e,t){var r=e.indexOf(":");var s=r<0?["",e]:e.split(":");var n=s[0];var i=s[1];if(t&&e==="xmlns"){n="xmlns";i=""}return{prefix:n,local:i}}function attrib(e){if(!e.strict){e.attribName=e.attribName[e.looseCase]()}if(e.attribList.indexOf(e.attribName)!==-1||e.tag.attributes.hasOwnProperty(e.attribName)){e.attribName=e.attribValue="";return}if(e.opt.xmlns){var t=qname(e.attribName,true);var r=t.prefix;var s=t.local;if(r==="xmlns"){if(s==="xml"&&e.attribValue!==a){strictFail(e,"xml: prefix must be bound to "+a+"\n"+"Actual: "+e.attribValue)}else if(s==="xmlns"&&e.attribValue!==u){strictFail(e,"xmlns: prefix must be bound to "+u+"\n"+"Actual: "+e.attribValue)}else{var n=e.tag;var i=e.tags[e.tags.length-1]||e;if(n.ns===i.ns){n.ns=Object.create(i.ns)}n.ns[s]=e.attribValue}}e.attribList.push([e.attribName,e.attribValue])}else{e.tag.attributes[e.attribName]=e.attribValue;emitNode(e,"onattribute",{name:e.attribName,value:e.attribValue})}e.attribName=e.attribValue=""}function openTag(e,t){if(e.opt.xmlns){var r=e.tag;var s=qname(e.tagName);r.prefix=s.prefix;r.local=s.local;r.uri=r.ns[s.prefix]||"";if(r.prefix&&!r.uri){strictFail(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName));r.uri=s.prefix}var n=e.tags[e.tags.length-1]||e;if(r.ns&&n.ns!==r.ns){Object.keys(r.ns).forEach((function(t){emitNode(e,"onopennamespace",{prefix:t,uri:r.ns[t]})}))}for(var i=0,o=e.attribList.length;i<o;i++){var a=e.attribList[i];var u=a[0];var c=a[1];var l=qname(u,true);var d=l.prefix;var p=l.local;var f=d===""?"":r.ns[d]||"";var m={name:u,value:c,prefix:d,local:p,uri:f};if(d&&d!=="xmlns"&&!f){strictFail(e,"Unbound namespace prefix: "+JSON.stringify(d));m.uri=d}e.tag.attributes[u]=m;emitNode(e,"onattribute",m)}e.attribList.length=0}e.tag.isSelfClosing=!!t;e.sawRoot=true;e.tags.push(e.tag);emitNode(e,"onopentag",e.tag);if(!t){if(!e.noscript&&e.tagName.toLowerCase()==="script"){e.state=h.SCRIPT}else{e.state=h.TEXT}e.tag=null;e.tagName=""}e.attribName=e.attribValue="";e.attribList.length=0}function closeTag(e){if(!e.tagName){strictFail(e,"Weird empty close tag.");e.textNode+="</>";e.state=h.TEXT;return}if(e.script){if(e.tagName!=="script"){e.script+="</"+e.tagName+">";e.tagName="";e.state=h.SCRIPT;return}emitNode(e,"onscript",e.script);e.script=""}var t=e.tags.length;var r=e.tagName;if(!e.strict){r=r[e.looseCase]()}var s=r;while(t--){var n=e.tags[t];if(n.name!==s){strictFail(e,"Unexpected close tag")}else{break}}if(t<0){strictFail(e,"Unmatched closing tag: "+e.tagName);e.textNode+="</"+e.tagName+">";e.state=h.TEXT;return}e.tagName=r;var i=e.tags.length;while(i-- >t){var o=e.tag=e.tags.pop();e.tagName=e.tag.name;emitNode(e,"onclosetag",e.tagName);var a={};for(var u in o.ns){a[u]=o.ns[u]}var c=e.tags[e.tags.length-1]||e;if(e.opt.xmlns&&o.ns!==c.ns){Object.keys(o.ns).forEach((function(t){var r=o.ns[t];emitNode(e,"onclosenamespace",{prefix:t,uri:r})}))}}if(t===0)e.closedRoot=true;e.tagName=e.attribValue=e.attribName="";e.attribList.length=0;e.state=h.TEXT}function parseEntity(e){var t=e.entity;var r=t.toLowerCase();var s;var n="";if(e.ENTITIES[t]){return e.ENTITIES[t]}if(e.ENTITIES[r]){return e.ENTITIES[r]}t=r;if(t.charAt(0)==="#"){if(t.charAt(1)==="x"){t=t.slice(2);s=parseInt(t,16);n=s.toString(16)}else{t=t.slice(1);s=parseInt(t,10);n=s.toString(10)}}t=t.replace(/^0+/,"");if(isNaN(s)||n.toLowerCase()!==t){strictFail(e,"Invalid character entity");return"&"+e.entity+";"}return String.fromCodePoint(s)}function beginWhiteSpace(e,t){if(t==="<"){e.state=h.OPEN_WAKA;e.startTagPosition=e.position}else if(!isWhitespace(t)){strictFail(e,"Non-whitespace before first tag.");e.textNode=t;e.state=h.TEXT}}function charAt(e,t){var r="";if(t<e.length){r=e.charAt(t)}return r}function write(e){var t=this;if(this.error){throw this.error}if(t.closed){return error(t,"Cannot write after close. Assign an onready handler.")}if(e===null){return end(t)}if(typeof e==="object"){e=e.toString()}var r=0;var s="";while(true){s=charAt(e,r++);t.c=s;if(!s){break}if(t.trackPosition){t.position++;if(s==="\n"){t.line++;t.column=0}else{t.column++}}switch(t.state){case h.BEGIN:t.state=h.BEGIN_WHITESPACE;if(s==="\ufeff"){continue}beginWhiteSpace(t,s);continue;case h.BEGIN_WHITESPACE:beginWhiteSpace(t,s);continue;case h.TEXT:if(t.sawRoot&&!t.closedRoot){var n=r-1;while(s&&s!=="<"&&s!=="&"){s=charAt(e,r++);if(s&&t.trackPosition){t.position++;if(s==="\n"){t.line++;t.column=0}else{t.column++}}}t.textNode+=e.substring(n,r-1)}if(s==="<"&&!(t.sawRoot&&t.closedRoot&&!t.strict)){t.state=h.OPEN_WAKA;t.startTagPosition=t.position}else{if(!isWhitespace(s)&&(!t.sawRoot||t.closedRoot)){strictFail(t,"Text data outside of root node.")}if(s==="&"){t.state=h.TEXT_ENTITY}else{t.textNode+=s}}continue;case h.SCRIPT:if(s==="<"){t.state=h.SCRIPT_ENDING}else{t.script+=s}continue;case h.SCRIPT_ENDING:if(s==="/"){t.state=h.CLOSE_TAG}else{t.script+="<"+s;t.state=h.SCRIPT}continue;case h.OPEN_WAKA:if(s==="!"){t.state=h.SGML_DECL;t.sgmlDecl=""}else if(isWhitespace(s)){}else if(isMatch(l,s)){t.state=h.OPEN_TAG;t.tagName=s}else if(s==="/"){t.state=h.CLOSE_TAG;t.tagName=""}else if(s==="?"){t.state=h.PROC_INST;t.procInstName=t.procInstBody=""}else{strictFail(t,"Unencoded <");if(t.startTagPosition+1<t.position){var a=t.position-t.startTagPosition;s=new Array(a).join(" ")+s}t.textNode+="<"+s;t.state=h.TEXT}continue;case h.SGML_DECL:if((t.sgmlDecl+s).toUpperCase()===i){emitNode(t,"onopencdata");t.state=h.CDATA;t.sgmlDecl="";t.cdata=""}else if(t.sgmlDecl+s==="--"){t.state=h.COMMENT;t.comment="";t.sgmlDecl=""}else if((t.sgmlDecl+s).toUpperCase()===o){t.state=h.DOCTYPE;if(t.doctype||t.sawRoot){strictFail(t,"Inappropriately located doctype declaration")}t.doctype="";t.sgmlDecl=""}else if(s===">"){emitNode(t,"onsgmldeclaration",t.sgmlDecl);t.sgmlDecl="";t.state=h.TEXT}else if(isQuote(s)){t.state=h.SGML_DECL_QUOTED;t.sgmlDecl+=s}else{t.sgmlDecl+=s}continue;case h.SGML_DECL_QUOTED:if(s===t.q){t.state=h.SGML_DECL;t.q=""}t.sgmlDecl+=s;continue;case h.DOCTYPE:if(s===">"){t.state=h.TEXT;emitNode(t,"ondoctype",t.doctype);t.doctype=true}else{t.doctype+=s;if(s==="["){t.state=h.DOCTYPE_DTD}else if(isQuote(s)){t.state=h.DOCTYPE_QUOTED;t.q=s}}continue;case h.DOCTYPE_QUOTED:t.doctype+=s;if(s===t.q){t.q="";t.state=h.DOCTYPE}continue;case h.DOCTYPE_DTD:t.doctype+=s;if(s==="]"){t.state=h.DOCTYPE}else if(isQuote(s)){t.state=h.DOCTYPE_DTD_QUOTED;t.q=s}continue;case h.DOCTYPE_DTD_QUOTED:t.doctype+=s;if(s===t.q){t.state=h.DOCTYPE_DTD;t.q=""}continue;case h.COMMENT:if(s==="-"){t.state=h.COMMENT_ENDING}else{t.comment+=s}continue;case h.COMMENT_ENDING:if(s==="-"){t.state=h.COMMENT_ENDED;t.comment=textopts(t.opt,t.comment);if(t.comment){emitNode(t,"oncomment",t.comment)}t.comment=""}else{t.comment+="-"+s;t.state=h.COMMENT}continue;case h.COMMENT_ENDED:if(s!==">"){strictFail(t,"Malformed comment");t.comment+="--"+s;t.state=h.COMMENT}else{t.state=h.TEXT}continue;case h.CDATA:if(s==="]"){t.state=h.CDATA_ENDING}else{t.cdata+=s}continue;case h.CDATA_ENDING:if(s==="]"){t.state=h.CDATA_ENDING_2}else{t.cdata+="]"+s;t.state=h.CDATA}continue;case h.CDATA_ENDING_2:if(s===">"){if(t.cdata){emitNode(t,"oncdata",t.cdata)}emitNode(t,"onclosecdata");t.cdata="";t.state=h.TEXT}else if(s==="]"){t.cdata+="]"}else{t.cdata+="]]"+s;t.state=h.CDATA}continue;case h.PROC_INST:if(s==="?"){t.state=h.PROC_INST_ENDING}else if(isWhitespace(s)){t.state=h.PROC_INST_BODY}else{t.procInstName+=s}continue;case h.PROC_INST_BODY:if(!t.procInstBody&&isWhitespace(s)){continue}else if(s==="?"){t.state=h.PROC_INST_ENDING}else{t.procInstBody+=s}continue;case h.PROC_INST_ENDING:if(s===">"){emitNode(t,"onprocessinginstruction",{name:t.procInstName,body:t.procInstBody});t.procInstName=t.procInstBody="";t.state=h.TEXT}else{t.procInstBody+="?"+s;t.state=h.PROC_INST_BODY}continue;case h.OPEN_TAG:if(isMatch(d,s)){t.tagName+=s}else{newTag(t);if(s===">"){openTag(t)}else if(s==="/"){t.state=h.OPEN_TAG_SLASH}else{if(!isWhitespace(s)){strictFail(t,"Invalid character in tag name")}t.state=h.ATTRIB}}continue;case h.OPEN_TAG_SLASH:if(s===">"){openTag(t,true);closeTag(t)}else{strictFail(t,"Forward-slash in opening tag not followed by >");t.state=h.ATTRIB}continue;case h.ATTRIB:if(isWhitespace(s)){continue}else if(s===">"){openTag(t)}else if(s==="/"){t.state=h.OPEN_TAG_SLASH}else if(isMatch(l,s)){t.attribName=s;t.attribValue="";t.state=h.ATTRIB_NAME}else{strictFail(t,"Invalid attribute name")}continue;case h.ATTRIB_NAME:if(s==="="){t.state=h.ATTRIB_VALUE}else if(s===">"){strictFail(t,"Attribute without value");t.attribValue=t.attribName;attrib(t);openTag(t)}else if(isWhitespace(s)){t.state=h.ATTRIB_NAME_SAW_WHITE}else if(isMatch(d,s)){t.attribName+=s}else{strictFail(t,"Invalid attribute name")}continue;case h.ATTRIB_NAME_SAW_WHITE:if(s==="="){t.state=h.ATTRIB_VALUE}else if(isWhitespace(s)){continue}else{strictFail(t,"Attribute without value");t.tag.attributes[t.attribName]="";t.attribValue="";emitNode(t,"onattribute",{name:t.attribName,value:""});t.attribName="";if(s===">"){openTag(t)}else if(isMatch(l,s)){t.attribName=s;t.state=h.ATTRIB_NAME}else{strictFail(t,"Invalid attribute name");t.state=h.ATTRIB}}continue;case h.ATTRIB_VALUE:if(isWhitespace(s)){continue}else if(isQuote(s)){t.q=s;t.state=h.ATTRIB_VALUE_QUOTED}else{strictFail(t,"Unquoted attribute value");t.state=h.ATTRIB_VALUE_UNQUOTED;t.attribValue=s}continue;case h.ATTRIB_VALUE_QUOTED:if(s!==t.q){if(s==="&"){t.state=h.ATTRIB_VALUE_ENTITY_Q}else{t.attribValue+=s}continue}attrib(t);t.q="";t.state=h.ATTRIB_VALUE_CLOSED;continue;case h.ATTRIB_VALUE_CLOSED:if(isWhitespace(s)){t.state=h.ATTRIB}else if(s===">"){openTag(t)}else if(s==="/"){t.state=h.OPEN_TAG_SLASH}else if(isMatch(l,s)){strictFail(t,"No whitespace between attributes");t.attribName=s;t.attribValue="";t.state=h.ATTRIB_NAME}else{strictFail(t,"Invalid attribute name")}continue;case h.ATTRIB_VALUE_UNQUOTED:if(!isAttribEnd(s)){if(s==="&"){t.state=h.ATTRIB_VALUE_ENTITY_U}else{t.attribValue+=s}continue}attrib(t);if(s===">"){openTag(t)}else{t.state=h.ATTRIB}continue;case h.CLOSE_TAG:if(!t.tagName){if(isWhitespace(s)){continue}else if(notMatch(l,s)){if(t.script){t.script+="</"+s;t.state=h.SCRIPT}else{strictFail(t,"Invalid tagname in closing tag.")}}else{t.tagName=s}}else if(s===">"){closeTag(t)}else if(isMatch(d,s)){t.tagName+=s}else if(t.script){t.script+="</"+t.tagName;t.tagName="";t.state=h.SCRIPT}else{if(!isWhitespace(s)){strictFail(t,"Invalid tagname in closing tag")}t.state=h.CLOSE_TAG_SAW_WHITE}continue;case h.CLOSE_TAG_SAW_WHITE:if(isWhitespace(s)){continue}if(s===">"){closeTag(t)}else{strictFail(t,"Invalid characters in closing tag")}continue;case h.TEXT_ENTITY:case h.ATTRIB_VALUE_ENTITY_Q:case h.ATTRIB_VALUE_ENTITY_U:var u;var c;switch(t.state){case h.TEXT_ENTITY:u=h.TEXT;c="textNode";break;case h.ATTRIB_VALUE_ENTITY_Q:u=h.ATTRIB_VALUE_QUOTED;c="attribValue";break;case h.ATTRIB_VALUE_ENTITY_U:u=h.ATTRIB_VALUE_UNQUOTED;c="attribValue";break}if(s===";"){if(t.opt.unparsedEntities){var m=parseEntity(t);t.entity="";t.state=u;t.write(m)}else{t[c]+=parseEntity(t);t.entity="";t.state=u}}else if(isMatch(t.entity.length?f:p,s)){t.entity+=s}else{strictFail(t,"Invalid character in entity name");t[c]+="&"+t.entity+s;t.entity="";t.state=u}continue;default:{throw new Error(t,"Unknown state: "+t.state)}}}if(t.position>=t.bufferCheckPosition){checkBufferLength(t)}return t}
2
+ /*! http://mths.be/fromcodepoint v0.1.0 by @mathias */if(!String.fromCodePoint){(function(){var e=String.fromCharCode;var t=Math.floor;var fromCodePoint=function(){var r=16384;var s=[];var n;var i;var o=-1;var a=arguments.length;if(!a){return""}var u="";while(++o<a){var c=Number(arguments[o]);if(!isFinite(c)||c<0||c>1114111||t(c)!==c){throw RangeError("Invalid code point: "+c)}if(c<=65535){s.push(c)}else{c-=65536;n=(c>>10)+55296;i=c%1024+56320;s.push(n,i)}if(o+1===a||s.length>r){u+=e.apply(null,s);s.length=0}}return u};if(Object.defineProperty){Object.defineProperty(String,"fromCodePoint",{value:fromCodePoint,configurable:true,writable:true})}else{String.fromCodePoint=fromCodePoint}})()}})(false?0:t)},9318:function(e,t,r){"use strict";const s=r(2037);const n=r(6224);const i=r(1533);const{env:o}=process;let a;if(i("no-color")||i("no-colors")||i("color=false")||i("color=never")){a=0}else if(i("color")||i("colors")||i("color=true")||i("color=always")){a=1}if("FORCE_COLOR"in o){if(o.FORCE_COLOR==="true"){a=1}else if(o.FORCE_COLOR==="false"){a=0}else{a=o.FORCE_COLOR.length===0?1:Math.min(parseInt(o.FORCE_COLOR,10),3)}}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e,t){if(a===0){return 0}if(i("color=16m")||i("color=full")||i("color=truecolor")){return 3}if(i("color=256")){return 2}if(e&&!t&&a===undefined){return 0}const r=a||0;if(o.TERM==="dumb"){return r}if(process.platform==="win32"){const e=s.release().split(".");if(Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in o){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in o))||o.CI_NAME==="codeship"){return 1}return r}if("TEAMCITY_VERSION"in o){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0}if(o.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in o){const e=parseInt((o.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(o.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)){return 1}if("COLORTERM"in o){return 1}return r}function getSupportLevel(e){const t=supportsColor(e,e&&e.isTTY);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:translateLevel(supportsColor(true,n.isatty(1))),stderr:translateLevel(supportsColor(true,n.isatty(2)))}},1533:function(e){"use strict";e.exports=(e,t=process.argv)=>{const r=e.startsWith("-")?"":e.length===1?"-":"--";const s=t.indexOf(r+e);const n=t.indexOf("--");return s!==-1&&(n===-1||s<n)}},2624:function(e,t){(function(){"use strict";t.stripBOM=function(e){if(e[0]==="\ufeff"){return e.substring(1)}else{return e}}}).call(this)},3337:function(e,t,r){(function(){"use strict";var e,s,n,i,o,a={}.hasOwnProperty;e=r(2958);s=r(7251).defaults;i=function(e){return typeof e==="string"&&(e.indexOf("&")>=0||e.indexOf(">")>=0||e.indexOf("<")>=0)};o=function(e){return"<![CDATA["+n(e)+"]]>"};n=function(e){return e.replace("]]>","]]]]><![CDATA[>")};t.Builder=function(){function Builder(e){var t,r,n;this.options={};r=s["0.2"];for(t in r){if(!a.call(r,t))continue;n=r[t];this.options[t]=n}for(t in e){if(!a.call(e,t))continue;n=e[t];this.options[t]=n}}Builder.prototype.buildObject=function(t){var r,n,u,c,l;r=this.options.attrkey;n=this.options.charkey;if(Object.keys(t).length===1&&this.options.rootName===s["0.2"].rootName){l=Object.keys(t)[0];t=t[l]}else{l=this.options.rootName}u=function(e){return function(t,s){var c,l,d,p,f,h;if(typeof s!=="object"){if(e.options.cdata&&i(s)){t.raw(o(s))}else{t.txt(s)}}else if(Array.isArray(s)){for(p in s){if(!a.call(s,p))continue;l=s[p];for(f in l){d=l[f];t=u(t.ele(f),d).up()}}}else{for(f in s){if(!a.call(s,f))continue;l=s[f];if(f===r){if(typeof l==="object"){for(c in l){h=l[c];t=t.att(c,h)}}}else if(f===n){if(e.options.cdata&&i(l)){t=t.raw(o(l))}else{t=t.txt(l)}}else if(Array.isArray(l)){for(p in l){if(!a.call(l,p))continue;d=l[p];if(typeof d==="string"){if(e.options.cdata&&i(d)){t=t.ele(f).raw(o(d)).up()}else{t=t.ele(f,d).up()}}else{t=u(t.ele(f),d).up()}}}else if(typeof l==="object"){t=u(t.ele(f),l).up()}else{if(typeof l==="string"&&e.options.cdata&&i(l)){t=t.ele(f).raw(o(l)).up()}else{if(l==null){l=""}t=t.ele(f,l.toString()).up()}}}}return t}}(this);c=e.create(l,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars});return u(c,t).end(this.options.renderOpts)};return Builder}()}).call(this)},7251:function(e,t){(function(){t.defaults={.1:{explicitCharkey:false,trim:true,normalize:true,normalizeTags:false,attrkey:"@",charkey:"#",explicitArray:false,ignoreAttrs:false,mergeAttrs:false,explicitRoot:false,validator:null,xmlns:false,explicitChildren:false,childkey:"@@",charsAsChildren:false,includeWhiteChars:false,async:false,strict:true,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},.2:{explicitCharkey:false,trim:false,normalize:false,normalizeTags:false,attrkey:"$",charkey:"_",explicitArray:true,ignoreAttrs:false,mergeAttrs:false,explicitRoot:true,validator:null,xmlns:false,explicitChildren:false,preserveChildrenOrder:false,childkey:"$$",charsAsChildren:false,includeWhiteChars:false,async:false,strict:true,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:true},doctype:null,renderOpts:{pretty:true,indent:" ",newline:"\n"},headless:false,chunkSize:1e4,emptyTag:"",cdata:false}}}).call(this)},3314:function(e,t,r){(function(){"use strict";var e,s,n,i,o,a,u,c,l,bind=function(e,t){return function(){return e.apply(t,arguments)}},extend=function(e,t){for(var r in t){if(d.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},d={}.hasOwnProperty;c=r(2043);i=r(2361);e=r(2624);u=r(9236);l=r(9512).setImmediate;s=r(7251).defaults;o=function(e){return typeof e==="object"&&e!=null&&Object.keys(e).length===0};a=function(e,t,r){var s,n,i;for(s=0,n=e.length;s<n;s++){i=e[s];t=i(t,r)}return t};n=function(e,t,r){var s;s=Object.create(null);s.value=r;s.writable=true;s.enumerable=true;s.configurable=true;return Object.defineProperty(e,t,s)};t.Parser=function(r){extend(Parser,r);function Parser(e){this.parseStringPromise=bind(this.parseStringPromise,this);this.parseString=bind(this.parseString,this);this.reset=bind(this.reset,this);this.assignOrPush=bind(this.assignOrPush,this);this.processAsync=bind(this.processAsync,this);var r,n,i;if(!(this instanceof t.Parser)){return new t.Parser(e)}this.options={};n=s["0.2"];for(r in n){if(!d.call(n,r))continue;i=n[r];this.options[r]=i}for(r in e){if(!d.call(e,r))continue;i=e[r];this.options[r]=i}if(this.options.xmlns){this.options.xmlnskey=this.options.attrkey+"ns"}if(this.options.normalizeTags){if(!this.options.tagNameProcessors){this.options.tagNameProcessors=[]}this.options.tagNameProcessors.unshift(u.normalize)}this.reset()}Parser.prototype.processAsync=function(){var e,t;try{if(this.remaining.length<=this.options.chunkSize){e=this.remaining;this.remaining="";this.saxParser=this.saxParser.write(e);return this.saxParser.close()}else{e=this.remaining.substr(0,this.options.chunkSize);this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length);this.saxParser=this.saxParser.write(e);return l(this.processAsync)}}catch(e){t=e;if(!this.saxParser.errThrown){this.saxParser.errThrown=true;return this.emit(t)}}};Parser.prototype.assignOrPush=function(e,t,r){if(!(t in e)){if(!this.options.explicitArray){return n(e,t,r)}else{return n(e,t,[r])}}else{if(!(e[t]instanceof Array)){n(e,t,[e[t]])}return e[t].push(r)}};Parser.prototype.reset=function(){var e,t,r,s;this.removeAllListeners();this.saxParser=c.parser(this.options.strict,{trim:false,normalize:false,xmlns:this.options.xmlns});this.saxParser.errThrown=false;this.saxParser.onerror=function(e){return function(t){e.saxParser.resume();if(!e.saxParser.errThrown){e.saxParser.errThrown=true;return e.emit("error",t)}}}(this);this.saxParser.onend=function(e){return function(){if(!e.saxParser.ended){e.saxParser.ended=true;return e.emit("end",e.resultObject)}}}(this);this.saxParser.ended=false;this.EXPLICIT_CHARKEY=this.options.explicitCharkey;this.resultObject=null;s=[];e=this.options.attrkey;t=this.options.charkey;this.saxParser.onopentag=function(r){return function(i){var o,u,c,l,p;c={};c[t]="";if(!r.options.ignoreAttrs){p=i.attributes;for(o in p){if(!d.call(p,o))continue;if(!(e in c)&&!r.options.mergeAttrs){c[e]={}}u=r.options.attrValueProcessors?a(r.options.attrValueProcessors,i.attributes[o],o):i.attributes[o];l=r.options.attrNameProcessors?a(r.options.attrNameProcessors,o):o;if(r.options.mergeAttrs){r.assignOrPush(c,l,u)}else{n(c[e],l,u)}}}c["#name"]=r.options.tagNameProcessors?a(r.options.tagNameProcessors,i.name):i.name;if(r.options.xmlns){c[r.options.xmlnskey]={uri:i.uri,local:i.local}}return s.push(c)}}(this);this.saxParser.onclosetag=function(e){return function(){var r,i,u,c,l,p,f,h,m,y;p=s.pop();l=p["#name"];if(!e.options.explicitChildren||!e.options.preserveChildrenOrder){delete p["#name"]}if(p.cdata===true){r=p.cdata;delete p.cdata}m=s[s.length-1];if(p[t].match(/^\s*$/)&&!r){i=p[t];delete p[t]}else{if(e.options.trim){p[t]=p[t].trim()}if(e.options.normalize){p[t]=p[t].replace(/\s{2,}/g," ").trim()}p[t]=e.options.valueProcessors?a(e.options.valueProcessors,p[t],l):p[t];if(Object.keys(p).length===1&&t in p&&!e.EXPLICIT_CHARKEY){p=p[t]}}if(o(p)){if(typeof e.options.emptyTag==="function"){p=e.options.emptyTag()}else{p=e.options.emptyTag!==""?e.options.emptyTag:i}}if(e.options.validator!=null){y="/"+function(){var e,t,r;r=[];for(e=0,t=s.length;e<t;e++){c=s[e];r.push(c["#name"])}return r}().concat(l).join("/");(function(){var t;try{return p=e.options.validator(y,m&&m[l],p)}catch(r){t=r;return e.emit("error",t)}})()}if(e.options.explicitChildren&&!e.options.mergeAttrs&&typeof p==="object"){if(!e.options.preserveChildrenOrder){c={};if(e.options.attrkey in p){c[e.options.attrkey]=p[e.options.attrkey];delete p[e.options.attrkey]}if(!e.options.charsAsChildren&&e.options.charkey in p){c[e.options.charkey]=p[e.options.charkey];delete p[e.options.charkey]}if(Object.getOwnPropertyNames(p).length>0){c[e.options.childkey]=p}p=c}else if(m){m[e.options.childkey]=m[e.options.childkey]||[];f={};for(u in p){if(!d.call(p,u))continue;n(f,u,p[u])}m[e.options.childkey].push(f);delete p["#name"];if(Object.keys(p).length===1&&t in p&&!e.EXPLICIT_CHARKEY){p=p[t]}}}if(s.length>0){return e.assignOrPush(m,l,p)}else{if(e.options.explicitRoot){h=p;p={};n(p,l,h)}e.resultObject=p;e.saxParser.ended=true;return e.emit("end",e.resultObject)}}}(this);r=function(e){return function(r){var n,i;i=s[s.length-1];if(i){i[t]+=r;if(e.options.explicitChildren&&e.options.preserveChildrenOrder&&e.options.charsAsChildren&&(e.options.includeWhiteChars||r.replace(/\\n/g,"").trim()!=="")){i[e.options.childkey]=i[e.options.childkey]||[];n={"#name":"__text__"};n[t]=r;if(e.options.normalize){n[t]=n[t].replace(/\s{2,}/g," ").trim()}i[e.options.childkey].push(n)}return i}}}(this);this.saxParser.ontext=r;return this.saxParser.oncdata=function(e){return function(e){var t;t=r(e);if(t){return t.cdata=true}}}(this)};Parser.prototype.parseString=function(t,r){var s;if(r!=null&&typeof r==="function"){this.on("end",(function(e){this.reset();return r(null,e)}));this.on("error",(function(e){this.reset();return r(e)}))}try{t=t.toString();if(t.trim()===""){this.emit("end",null);return true}t=e.stripBOM(t);if(this.options.async){this.remaining=t;l(this.processAsync);return this.saxParser}return this.saxParser.write(t).close()}catch(e){s=e;if(!(this.saxParser.errThrown||this.saxParser.ended)){this.emit("error",s);return this.saxParser.errThrown=true}else if(this.saxParser.ended){throw s}}};Parser.prototype.parseStringPromise=function(e){return new Promise(function(t){return function(r,s){return t.parseString(e,(function(e,t){if(e){return s(e)}else{return r(t)}}))}}(this))};return Parser}(i);t.parseString=function(e,r,s){var n,i,o;if(s!=null){if(typeof s==="function"){n=s}if(typeof r==="object"){i=r}}else{if(typeof r==="function"){n=r}i={}}o=new t.Parser(i);return o.parseString(e,n)};t.parseStringPromise=function(e,r){var s,n;if(typeof r==="object"){s=r}n=new t.Parser(s);return n.parseStringPromise(e)}}).call(this)},9236:function(e,t){(function(){"use strict";var e;e=new RegExp(/(?!xmlns)^.*:/);t.normalize=function(e){return e.toLowerCase()};t.firstCharLowerCase=function(e){return e.charAt(0).toLowerCase()+e.slice(1)};t.stripPrefix=function(t){return t.replace(e,"")};t.parseNumbers=function(e){if(!isNaN(e)){e=e%1===0?parseInt(e,10):parseFloat(e)}return e};t.parseBooleans=function(e){if(/^(?:true|false)$/i.test(e)){e=e.toLowerCase()==="true"}return e}}).call(this)},6189:function(e,t,r){(function(){"use strict";var e,s,n,i,extend=function(e,t){for(var r in t){if(o.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},o={}.hasOwnProperty;s=r(7251);e=r(3337);n=r(3314);i=r(9236);t.defaults=s.defaults;t.processors=i;t.ValidationError=function(e){extend(ValidationError,e);function ValidationError(e){this.message=e}return ValidationError}(Error);t.Builder=e.Builder;t.Parser=n.Parser;t.parseString=n.parseString;t.parseStringPromise=n.parseStringPromise}).call(this)},2839:function(e){(function(){e.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(this)},9267:function(e){(function(){e.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(this)},8229:function(e){(function(){var t,r,s,n,i,o,a,u=[].slice,c={}.hasOwnProperty;t=function(){var e,t,r,s,n,o;o=arguments[0],n=2<=arguments.length?u.call(arguments,1):[];if(i(Object.assign)){Object.assign.apply(null,arguments)}else{for(e=0,r=n.length;e<r;e++){s=n[e];if(s!=null){for(t in s){if(!c.call(s,t))continue;o[t]=s[t]}}}}return o};i=function(e){return!!e&&Object.prototype.toString.call(e)==="[object Function]"};o=function(e){var t;return!!e&&((t=typeof e)==="function"||t==="object")};s=function(e){if(i(Array.isArray)){return Array.isArray(e)}else{return Object.prototype.toString.call(e)==="[object Array]"}};n=function(e){var t;if(s(e)){return!e.length}else{for(t in e){if(!c.call(e,t))continue;return false}return true}};a=function(e){var t,r;return o(e)&&(r=Object.getPrototypeOf(e))&&(t=r.constructor)&&typeof t==="function"&&t instanceof t&&Function.prototype.toString.call(t)===Function.prototype.toString.call(Object)};r=function(e){if(i(e.valueOf)){return e.valueOf()}else{return e}};e.exports.assign=t;e.exports.isFunction=i;e.exports.isObject=o;e.exports.isArray=s;e.exports.isEmpty=n;e.exports.isPlainObject=a;e.exports.getValue=r}).call(this)},9766:function(e){(function(){e.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(this)},8376:function(e,t,r){(function(){var t,s,n;t=r(9267);n=r(7608);e.exports=s=function(){function XMLAttribute(e,r,s){this.parent=e;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}if(r==null){throw new Error("Missing attribute name. "+this.debugInfo(r))}this.name=this.stringify.name(r);this.value=this.stringify.attValue(s);this.type=t.Attribute;this.isId=false;this.schemaTypeInfo=null}Object.defineProperty(XMLAttribute.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(XMLAttribute.prototype,"ownerElement",{get:function(){return this.parent}});Object.defineProperty(XMLAttribute.prototype,"textContent",{get:function(){return this.value},set:function(e){return this.value=e||""}});Object.defineProperty(XMLAttribute.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(XMLAttribute.prototype,"prefix",{get:function(){return""}});Object.defineProperty(XMLAttribute.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(XMLAttribute.prototype,"specified",{get:function(){return true}});XMLAttribute.prototype.clone=function(){return Object.create(this)};XMLAttribute.prototype.toString=function(e){return this.options.writer.attribute(this,this.options.writer.filterOptions(e))};XMLAttribute.prototype.debugInfo=function(e){e=e||this.name;if(e==null){return"parent: <"+this.parent.name+">"}else{return"attribute: {"+e+"}, parent: <"+this.parent.name+">"}};XMLAttribute.prototype.isEqualNode=function(e){if(e.namespaceURI!==this.namespaceURI){return false}if(e.prefix!==this.prefix){return false}if(e.localName!==this.localName){return false}if(e.value!==this.value){return false}return true};return XMLAttribute}()}).call(this)},333:function(e,t,r){(function(){var t,s,n,extend=function(e,t){for(var r in t){if(i.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},i={}.hasOwnProperty;t=r(9267);n=r(7709);e.exports=s=function(e){extend(XMLCData,e);function XMLCData(e,r){XMLCData.__super__.constructor.call(this,e);if(r==null){throw new Error("Missing CDATA text. "+this.debugInfo())}this.name="#cdata-section";this.type=t.CData;this.value=this.stringify.cdata(r)}XMLCData.prototype.clone=function(){return Object.create(this)};XMLCData.prototype.toString=function(e){return this.options.writer.cdata(this,this.options.writer.filterOptions(e))};return XMLCData}(n)}).call(this)},7709:function(e,t,r){(function(){var t,s,extend=function(e,t){for(var r in t){if(n.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},n={}.hasOwnProperty;s=r(7608);e.exports=t=function(e){extend(XMLCharacterData,e);function XMLCharacterData(e){XMLCharacterData.__super__.constructor.call(this,e);this.value=""}Object.defineProperty(XMLCharacterData.prototype,"data",{get:function(){return this.value},set:function(e){return this.value=e||""}});Object.defineProperty(XMLCharacterData.prototype,"length",{get:function(){return this.value.length}});Object.defineProperty(XMLCharacterData.prototype,"textContent",{get:function(){return this.value},set:function(e){return this.value=e||""}});XMLCharacterData.prototype.clone=function(){return Object.create(this)};XMLCharacterData.prototype.substringData=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.appendData=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.insertData=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.deleteData=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.replaceData=function(e,t,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLCharacterData.prototype.isEqualNode=function(e){if(!XMLCharacterData.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)){return false}if(e.data!==this.data){return false}return true};return XMLCharacterData}(s)}).call(this)},4407:function(e,t,r){(function(){var t,s,n,extend=function(e,t){for(var r in t){if(i.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},i={}.hasOwnProperty;t=r(9267);s=r(7709);e.exports=n=function(e){extend(XMLComment,e);function XMLComment(e,r){XMLComment.__super__.constructor.call(this,e);if(r==null){throw new Error("Missing comment text. "+this.debugInfo())}this.name="#comment";this.type=t.Comment;this.value=this.stringify.comment(r)}XMLComment.prototype.clone=function(){return Object.create(this)};XMLComment.prototype.toString=function(e){return this.options.writer.comment(this,this.options.writer.filterOptions(e))};return XMLComment}(s)}).call(this)},6681:function(e,t,r){(function(){var t,s,n;s=r(6744);n=r(7028);e.exports=t=function(){function XMLDOMConfiguration(){var e;this.defaultParams={"canonical-form":false,"cdata-sections":false,comments:false,"datatype-normalization":false,"element-content-whitespace":true,entities:true,"error-handler":new s,infoset:true,"validate-if-schema":false,namespaces:true,"namespace-declarations":true,"normalize-characters":false,"schema-location":"","schema-type":"","split-cdata-sections":true,validate:false,"well-formed":true};this.params=e=Object.create(this.defaultParams)}Object.defineProperty(XMLDOMConfiguration.prototype,"parameterNames",{get:function(){return new n(Object.keys(this.defaultParams))}});XMLDOMConfiguration.prototype.getParameter=function(e){if(this.params.hasOwnProperty(e)){return this.params[e]}else{return null}};XMLDOMConfiguration.prototype.canSetParameter=function(e,t){return true};XMLDOMConfiguration.prototype.setParameter=function(e,t){if(t!=null){return this.params[e]=t}else{return delete this.params[e]}};return XMLDOMConfiguration}()}).call(this)},6744:function(e){(function(){var t;e.exports=t=function(){function XMLDOMErrorHandler(){}XMLDOMErrorHandler.prototype.handleError=function(e){throw new Error(e)};return XMLDOMErrorHandler}()}).call(this)},8310:function(e){(function(){var t;e.exports=t=function(){function XMLDOMImplementation(){}XMLDOMImplementation.prototype.hasFeature=function(e,t){return true};XMLDOMImplementation.prototype.createDocumentType=function(e,t,r){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.createDocument=function(e,t,r){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.createHTMLDocument=function(e){throw new Error("This DOM method is not implemented.")};XMLDOMImplementation.prototype.getFeature=function(e,t){throw new Error("This DOM method is not implemented.")};return XMLDOMImplementation}()}).call(this)},7028:function(e){(function(){var t;e.exports=t=function(){function XMLDOMStringList(e){this.arr=e||[]}Object.defineProperty(XMLDOMStringList.prototype,"length",{get:function(){return this.arr.length}});XMLDOMStringList.prototype.item=function(e){return this.arr[e]||null};XMLDOMStringList.prototype.contains=function(e){return this.arr.indexOf(e)!==-1};return XMLDOMStringList}()}).call(this)},1015:function(e,t,r){(function(){var t,s,n,extend=function(e,t){for(var r in t){if(i.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},i={}.hasOwnProperty;n=r(7608);t=r(9267);e.exports=s=function(e){extend(XMLDTDAttList,e);function XMLDTDAttList(e,r,s,n,i,o){XMLDTDAttList.__super__.constructor.call(this,e);if(r==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(s==null){throw new Error("Missing DTD attribute name. "+this.debugInfo(r))}if(!n){throw new Error("Missing DTD attribute type. "+this.debugInfo(r))}if(!i){throw new Error("Missing DTD attribute default. "+this.debugInfo(r))}if(i.indexOf("#")!==0){i="#"+i}if(!i.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)){throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(r))}if(o&&!i.match(/^(#FIXED|#DEFAULT)$/)){throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(r))}this.elementName=this.stringify.name(r);this.type=t.AttributeDeclaration;this.attributeName=this.stringify.name(s);this.attributeType=this.stringify.dtdAttType(n);if(o){this.defaultValue=this.stringify.dtdAttDefault(o)}this.defaultValueType=i}XMLDTDAttList.prototype.toString=function(e){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(e))};return XMLDTDAttList}(n)}).call(this)},2421:function(e,t,r){(function(){var t,s,n,extend=function(e,t){for(var r in t){if(i.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},i={}.hasOwnProperty;n=r(7608);t=r(9267);e.exports=s=function(e){extend(XMLDTDElement,e);function XMLDTDElement(e,r,s){XMLDTDElement.__super__.constructor.call(this,e);if(r==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(!s){s="(#PCDATA)"}if(Array.isArray(s)){s="("+s.join(",")+")"}this.name=this.stringify.name(r);this.type=t.ElementDeclaration;this.value=this.stringify.dtdElementValue(s)}XMLDTDElement.prototype.toString=function(e){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(e))};return XMLDTDElement}(n)}).call(this)},53:function(e,t,r){(function(){var t,s,n,i,extend=function(e,t){for(var r in t){if(o.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},o={}.hasOwnProperty;i=r(8229).isObject;n=r(7608);t=r(9267);e.exports=s=function(e){extend(XMLDTDEntity,e);function XMLDTDEntity(e,r,s,n){XMLDTDEntity.__super__.constructor.call(this,e);if(s==null){throw new Error("Missing DTD entity name. "+this.debugInfo(s))}if(n==null){throw new Error("Missing DTD entity value. "+this.debugInfo(s))}this.pe=!!r;this.name=this.stringify.name(s);this.type=t.EntityDeclaration;if(!i(n)){this.value=this.stringify.dtdEntityValue(n);this.internal=true}else{if(!n.pubID&&!n.sysID){throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(s))}if(n.pubID&&!n.sysID){throw new Error("System identifier is required for a public external entity. "+this.debugInfo(s))}this.internal=false;if(n.pubID!=null){this.pubID=this.stringify.dtdPubID(n.pubID)}if(n.sysID!=null){this.sysID=this.stringify.dtdSysID(n.sysID)}if(n.nData!=null){this.nData=this.stringify.dtdNData(n.nData)}if(this.pe&&this.nData){throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(s))}}}Object.defineProperty(XMLDTDEntity.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDEntity.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(XMLDTDEntity.prototype,"notationName",{get:function(){return this.nData||null}});Object.defineProperty(XMLDTDEntity.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(XMLDTDEntity.prototype,"xmlEncoding",{get:function(){return null}});Object.defineProperty(XMLDTDEntity.prototype,"xmlVersion",{get:function(){return null}});XMLDTDEntity.prototype.toString=function(e){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(e))};return XMLDTDEntity}(n)}).call(this)},2837:function(e,t,r){(function(){var t,s,n,extend=function(e,t){for(var r in t){if(i.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},i={}.hasOwnProperty;n=r(7608);t=r(9267);e.exports=s=function(e){extend(XMLDTDNotation,e);function XMLDTDNotation(e,r,s){XMLDTDNotation.__super__.constructor.call(this,e);if(r==null){throw new Error("Missing DTD notation name. "+this.debugInfo(r))}if(!s.pubID&&!s.sysID){throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(r))}this.name=this.stringify.name(r);this.type=t.NotationDeclaration;if(s.pubID!=null){this.pubID=this.stringify.dtdPubID(s.pubID)}if(s.sysID!=null){this.sysID=this.stringify.dtdSysID(s.sysID)}}Object.defineProperty(XMLDTDNotation.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDTDNotation.prototype,"systemId",{get:function(){return this.sysID}});XMLDTDNotation.prototype.toString=function(e){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(e))};return XMLDTDNotation}(n)}).call(this)},6364:function(e,t,r){(function(){var t,s,n,i,extend=function(e,t){for(var r in t){if(o.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},o={}.hasOwnProperty;i=r(8229).isObject;n=r(7608);t=r(9267);e.exports=s=function(e){extend(XMLDeclaration,e);function XMLDeclaration(e,r,s,n){var o;XMLDeclaration.__super__.constructor.call(this,e);if(i(r)){o=r,r=o.version,s=o.encoding,n=o.standalone}if(!r){r="1.0"}this.type=t.Declaration;this.version=this.stringify.xmlVersion(r);if(s!=null){this.encoding=this.stringify.xmlEncoding(s)}if(n!=null){this.standalone=this.stringify.xmlStandalone(n)}}XMLDeclaration.prototype.toString=function(e){return this.options.writer.declaration(this,this.options.writer.filterOptions(e))};return XMLDeclaration}(n)}).call(this)},1801:function(e,t,r){(function(){var t,s,n,i,o,a,u,c,l,extend=function(e,t){for(var r in t){if(d.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},d={}.hasOwnProperty;l=r(8229).isObject;c=r(7608);t=r(9267);s=r(1015);i=r(53);n=r(2421);o=r(2837);u=r(4361);e.exports=a=function(e){extend(XMLDocType,e);function XMLDocType(e,r,s){var n,i,o,a,u,c;XMLDocType.__super__.constructor.call(this,e);this.type=t.DocType;if(e.children){a=e.children;for(i=0,o=a.length;i<o;i++){n=a[i];if(n.type===t.Element){this.name=n.name;break}}}this.documentObject=e;if(l(r)){u=r,r=u.pubID,s=u.sysID}if(s==null){c=[r,s],s=c[0],r=c[1]}if(r!=null){this.pubID=this.stringify.dtdPubID(r)}if(s!=null){this.sysID=this.stringify.dtdSysID(s)}}Object.defineProperty(XMLDocType.prototype,"entities",{get:function(){var e,r,s,n,i;n={};i=this.children;for(r=0,s=i.length;r<s;r++){e=i[r];if(e.type===t.EntityDeclaration&&!e.pe){n[e.name]=e}}return new u(n)}});Object.defineProperty(XMLDocType.prototype,"notations",{get:function(){var e,r,s,n,i;n={};i=this.children;for(r=0,s=i.length;r<s;r++){e=i[r];if(e.type===t.NotationDeclaration){n[e.name]=e}}return new u(n)}});Object.defineProperty(XMLDocType.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(XMLDocType.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(XMLDocType.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});XMLDocType.prototype.element=function(e,t){var r;r=new n(this,e,t);this.children.push(r);return this};XMLDocType.prototype.attList=function(e,t,r,n,i){var o;o=new s(this,e,t,r,n,i);this.children.push(o);return this};XMLDocType.prototype.entity=function(e,t){var r;r=new i(this,false,e,t);this.children.push(r);return this};XMLDocType.prototype.pEntity=function(e,t){var r;r=new i(this,true,e,t);this.children.push(r);return this};XMLDocType.prototype.notation=function(e,t){var r;r=new o(this,e,t);this.children.push(r);return this};XMLDocType.prototype.toString=function(e){return this.options.writer.docType(this,this.options.writer.filterOptions(e))};XMLDocType.prototype.ele=function(e,t){return this.element(e,t)};XMLDocType.prototype.att=function(e,t,r,s,n){return this.attList(e,t,r,s,n)};XMLDocType.prototype.ent=function(e,t){return this.entity(e,t)};XMLDocType.prototype.pent=function(e,t){return this.pEntity(e,t)};XMLDocType.prototype.not=function(e,t){return this.notation(e,t)};XMLDocType.prototype.up=function(){return this.root()||this.documentObject};XMLDocType.prototype.isEqualNode=function(e){if(!XMLDocType.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)){return false}if(e.name!==this.name){return false}if(e.publicId!==this.publicId){return false}if(e.systemId!==this.systemId){return false}return true};return XMLDocType}(c)}).call(this)},3730:function(e,t,r){(function(){var t,s,n,i,o,a,u,c,extend=function(e,t){for(var r in t){if(l.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},l={}.hasOwnProperty;c=r(8229).isPlainObject;n=r(8310);s=r(6681);o=r(7608);t=r(9267);u=r(8594);a=r(5913);e.exports=i=function(e){extend(XMLDocument,e);function XMLDocument(e){XMLDocument.__super__.constructor.call(this,null);this.name="#document";this.type=t.Document;this.documentURI=null;this.domConfig=new s;e||(e={});if(!e.writer){e.writer=new a}this.options=e;this.stringify=new u(e)}Object.defineProperty(XMLDocument.prototype,"implementation",{value:new n});Object.defineProperty(XMLDocument.prototype,"doctype",{get:function(){var e,r,s,n;n=this.children;for(r=0,s=n.length;r<s;r++){e=n[r];if(e.type===t.DocType){return e}}return null}});Object.defineProperty(XMLDocument.prototype,"documentElement",{get:function(){return this.rootObject||null}});Object.defineProperty(XMLDocument.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"strictErrorChecking",{get:function(){return false}});Object.defineProperty(XMLDocument.prototype,"xmlEncoding",{get:function(){if(this.children.length!==0&&this.children[0].type===t.Declaration){return this.children[0].encoding}else{return null}}});Object.defineProperty(XMLDocument.prototype,"xmlStandalone",{get:function(){if(this.children.length!==0&&this.children[0].type===t.Declaration){return this.children[0].standalone==="yes"}else{return false}}});Object.defineProperty(XMLDocument.prototype,"xmlVersion",{get:function(){if(this.children.length!==0&&this.children[0].type===t.Declaration){return this.children[0].version}else{return"1.0"}}});Object.defineProperty(XMLDocument.prototype,"URL",{get:function(){return this.documentURI}});Object.defineProperty(XMLDocument.prototype,"origin",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"compatMode",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"characterSet",{get:function(){return null}});Object.defineProperty(XMLDocument.prototype,"contentType",{get:function(){return null}});XMLDocument.prototype.end=function(e){var t;t={};if(!e){e=this.options.writer}else if(c(e)){t=e;e=this.options.writer}return e.document(this,e.filterOptions(t))};XMLDocument.prototype.toString=function(e){return this.options.writer.document(this,this.options.writer.filterOptions(e))};XMLDocument.prototype.createElement=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createTextNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createComment=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createCDATASection=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createProcessingInstruction=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createAttribute=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createEntityReference=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementsByTagName=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.importNode=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createElementNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createAttributeNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementsByTagNameNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementById=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.adoptNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.renameNode=function(e,t,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.getElementsByClassName=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createEvent=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createNodeIterator=function(e,t,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLDocument.prototype.createTreeWalker=function(e,t,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};return XMLDocument}(o)}).call(this)},7356:function(e,t,r){(function(){var t,s,n,i,o,a,u,c,l,d,p,f,h,m,y,g,S,T,w,b,C,O,I,v,R={}.hasOwnProperty;v=r(8229),O=v.isObject,C=v.isFunction,I=v.isPlainObject,b=v.getValue;t=r(9267);f=r(3730);m=r(9437);i=r(333);o=r(4407);g=r(6329);w=r(1318);y=r(6939);d=r(6364);p=r(1801);a=r(1015);c=r(53);u=r(2421);l=r(2837);n=r(8376);T=r(8594);S=r(5913);s=r(9766);e.exports=h=function(){function XMLDocumentCB(e,r,s){var n;this.name="?xml";this.type=t.Document;e||(e={});n={};if(!e.writer){e.writer=new S}else if(I(e.writer)){n=e.writer;e.writer=new S}this.options=e;this.writer=e.writer;this.writerOptions=this.writer.filterOptions(n);this.stringify=new T(e);this.onDataCallback=r||function(){};this.onEndCallback=s||function(){};this.currentNode=null;this.currentLevel=-1;this.openTags={};this.documentStarted=false;this.documentCompleted=false;this.root=null}XMLDocumentCB.prototype.createChildNode=function(e){var r,s,n,i,o,a,u,c;switch(e.type){case t.CData:this.cdata(e.value);break;case t.Comment:this.comment(e.value);break;case t.Element:n={};u=e.attribs;for(s in u){if(!R.call(u,s))continue;r=u[s];n[s]=r.value}this.node(e.name,n);break;case t.Dummy:this.dummy();break;case t.Raw:this.raw(e.value);break;case t.Text:this.text(e.value);break;case t.ProcessingInstruction:this.instruction(e.target,e.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+e.constructor.name)}c=e.children;for(o=0,a=c.length;o<a;o++){i=c[o];this.createChildNode(i);if(i.type===t.Element){this.up()}}return this};XMLDocumentCB.prototype.dummy=function(){return this};XMLDocumentCB.prototype.node=function(e,t,r){var s;if(e==null){throw new Error("Missing node name.")}if(this.root&&this.currentLevel===-1){throw new Error("Document can only have one root node. "+this.debugInfo(e))}this.openCurrent();e=b(e);if(t==null){t={}}t=b(t);if(!O(t)){s=[t,r],r=s[0],t=s[1]}this.currentNode=new m(this,e,t);this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;if(r!=null){this.text(r)}return this};XMLDocumentCB.prototype.element=function(e,r,s){var n,i,o,a,u,c;if(this.currentNode&&this.currentNode.type===t.DocType){this.dtdElement.apply(this,arguments)}else{if(Array.isArray(e)||O(e)||C(e)){a=this.options.noValidation;this.options.noValidation=true;c=new f(this.options).element("TEMP_ROOT");c.element(e);this.options.noValidation=a;u=c.children;for(i=0,o=u.length;i<o;i++){n=u[i];this.createChildNode(n);if(n.type===t.Element){this.up()}}}else{this.node(e,r,s)}}return this};XMLDocumentCB.prototype.attribute=function(e,t){var r,s;if(!this.currentNode||this.currentNode.children){throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(e))}if(e!=null){e=b(e)}if(O(e)){for(r in e){if(!R.call(e,r))continue;s=e[r];this.attribute(r,s)}}else{if(C(t)){t=t.apply()}if(this.options.keepNullAttributes&&t==null){this.currentNode.attribs[e]=new n(this,e,"")}else if(t!=null){this.currentNode.attribs[e]=new n(this,e,t)}}return this};XMLDocumentCB.prototype.text=function(e){var t;this.openCurrent();t=new w(this,e);this.onData(this.writer.text(t,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.cdata=function(e){var t;this.openCurrent();t=new i(this,e);this.onData(this.writer.cdata(t,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.comment=function(e){var t;this.openCurrent();t=new o(this,e);this.onData(this.writer.comment(t,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.raw=function(e){var t;this.openCurrent();t=new g(this,e);this.onData(this.writer.raw(t,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.instruction=function(e,t){var r,s,n,i,o;this.openCurrent();if(e!=null){e=b(e)}if(t!=null){t=b(t)}if(Array.isArray(e)){for(r=0,i=e.length;r<i;r++){s=e[r];this.instruction(s)}}else if(O(e)){for(s in e){if(!R.call(e,s))continue;n=e[s];this.instruction(s,n)}}else{if(C(t)){t=t.apply()}o=new y(this,e,t);this.onData(this.writer.processingInstruction(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1)}return this};XMLDocumentCB.prototype.declaration=function(e,t,r){var s;this.openCurrent();if(this.documentStarted){throw new Error("declaration() must be the first node.")}s=new d(this,e,t,r);this.onData(this.writer.declaration(s,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.doctype=function(e,t,r){this.openCurrent();if(e==null){throw new Error("Missing root node name.")}if(this.root){throw new Error("dtd() must come before the root node.")}this.currentNode=new p(this,t,r);this.currentNode.rootNodeName=e;this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;return this};XMLDocumentCB.prototype.dtdElement=function(e,t){var r;this.openCurrent();r=new u(this,e,t);this.onData(this.writer.dtdElement(r,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.attList=function(e,t,r,s,n){var i;this.openCurrent();i=new a(this,e,t,r,s,n);this.onData(this.writer.dtdAttList(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.entity=function(e,t){var r;this.openCurrent();r=new c(this,false,e,t);this.onData(this.writer.dtdEntity(r,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.pEntity=function(e,t){var r;this.openCurrent();r=new c(this,true,e,t);this.onData(this.writer.dtdEntity(r,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.notation=function(e,t){var r;this.openCurrent();r=new l(this,e,t);this.onData(this.writer.dtdNotation(r,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};XMLDocumentCB.prototype.up=function(){if(this.currentLevel<0){throw new Error("The document node has no parent.")}if(this.currentNode){if(this.currentNode.children){this.closeNode(this.currentNode)}else{this.openNode(this.currentNode)}this.currentNode=null}else{this.closeNode(this.openTags[this.currentLevel])}delete this.openTags[this.currentLevel];this.currentLevel--;return this};XMLDocumentCB.prototype.end=function(){while(this.currentLevel>=0){this.up()}return this.onEnd()};XMLDocumentCB.prototype.openCurrent=function(){if(this.currentNode){this.currentNode.children=true;return this.openNode(this.currentNode)}};XMLDocumentCB.prototype.openNode=function(e){var r,n,i,o;if(!e.isOpen){if(!this.root&&this.currentLevel===0&&e.type===t.Element){this.root=e}n="";if(e.type===t.Element){this.writerOptions.state=s.OpenTag;n=this.writer.indent(e,this.writerOptions,this.currentLevel)+"<"+e.name;o=e.attribs;for(i in o){if(!R.call(o,i))continue;r=o[i];n+=this.writer.attribute(r,this.writerOptions,this.currentLevel)}n+=(e.children?">":"/>")+this.writer.endline(e,this.writerOptions,this.currentLevel);this.writerOptions.state=s.InsideTag}else{this.writerOptions.state=s.OpenTag;n=this.writer.indent(e,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+e.rootNodeName;if(e.pubID&&e.sysID){n+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'}else if(e.sysID){n+=' SYSTEM "'+e.sysID+'"'}if(e.children){n+=" [";this.writerOptions.state=s.InsideTag}else{this.writerOptions.state=s.CloseTag;n+=">"}n+=this.writer.endline(e,this.writerOptions,this.currentLevel)}this.onData(n,this.currentLevel);return e.isOpen=true}};XMLDocumentCB.prototype.closeNode=function(e){var r;if(!e.isClosed){r="";this.writerOptions.state=s.CloseTag;if(e.type===t.Element){r=this.writer.indent(e,this.writerOptions,this.currentLevel)+"</"+e.name+">"+this.writer.endline(e,this.writerOptions,this.currentLevel)}else{r=this.writer.indent(e,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(e,this.writerOptions,this.currentLevel)}this.writerOptions.state=s.None;this.onData(r,this.currentLevel);return e.isClosed=true}};XMLDocumentCB.prototype.onData=function(e,t){this.documentStarted=true;return this.onDataCallback(e,t+1)};XMLDocumentCB.prototype.onEnd=function(){this.documentCompleted=true;return this.onEndCallback()};XMLDocumentCB.prototype.debugInfo=function(e){if(e==null){return""}else{return"node: <"+e+">"}};XMLDocumentCB.prototype.ele=function(){return this.element.apply(this,arguments)};XMLDocumentCB.prototype.nod=function(e,t,r){return this.node(e,t,r)};XMLDocumentCB.prototype.txt=function(e){return this.text(e)};XMLDocumentCB.prototype.dat=function(e){return this.cdata(e)};XMLDocumentCB.prototype.com=function(e){return this.comment(e)};XMLDocumentCB.prototype.ins=function(e,t){return this.instruction(e,t)};XMLDocumentCB.prototype.dec=function(e,t,r){return this.declaration(e,t,r)};XMLDocumentCB.prototype.dtd=function(e,t,r){return this.doctype(e,t,r)};XMLDocumentCB.prototype.e=function(e,t,r){return this.element(e,t,r)};XMLDocumentCB.prototype.n=function(e,t,r){return this.node(e,t,r)};XMLDocumentCB.prototype.t=function(e){return this.text(e)};XMLDocumentCB.prototype.d=function(e){return this.cdata(e)};XMLDocumentCB.prototype.c=function(e){return this.comment(e)};XMLDocumentCB.prototype.r=function(e){return this.raw(e)};XMLDocumentCB.prototype.i=function(e,t){return this.instruction(e,t)};XMLDocumentCB.prototype.att=function(){if(this.currentNode&&this.currentNode.type===t.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};XMLDocumentCB.prototype.a=function(){if(this.currentNode&&this.currentNode.type===t.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};XMLDocumentCB.prototype.ent=function(e,t){return this.entity(e,t)};XMLDocumentCB.prototype.pent=function(e,t){return this.pEntity(e,t)};XMLDocumentCB.prototype.not=function(e,t){return this.notation(e,t)};return XMLDocumentCB}()}).call(this)},3590:function(e,t,r){(function(){var t,s,n,extend=function(e,t){for(var r in t){if(i.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},i={}.hasOwnProperty;n=r(7608);t=r(9267);e.exports=s=function(e){extend(XMLDummy,e);function XMLDummy(e){XMLDummy.__super__.constructor.call(this,e);this.type=t.Dummy}XMLDummy.prototype.clone=function(){return Object.create(this)};XMLDummy.prototype.toString=function(e){return""};return XMLDummy}(n)}).call(this)},9437:function(e,t,r){(function(){var t,s,n,i,o,a,u,c,l,extend=function(e,t){for(var r in t){if(d.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},d={}.hasOwnProperty;l=r(8229),c=l.isObject,u=l.isFunction,a=l.getValue;o=r(7608);t=r(9267);s=r(8376);i=r(4361);e.exports=n=function(e){extend(XMLElement,e);function XMLElement(e,r,s){var n,i,o,a;XMLElement.__super__.constructor.call(this,e);if(r==null){throw new Error("Missing element name. "+this.debugInfo())}this.name=this.stringify.name(r);this.type=t.Element;this.attribs={};this.schemaTypeInfo=null;if(s!=null){this.attribute(s)}if(e.type===t.Document){this.isRoot=true;this.documentObject=e;e.rootObject=this;if(e.children){a=e.children;for(i=0,o=a.length;i<o;i++){n=a[i];if(n.type===t.DocType){n.name=this.name;break}}}}}Object.defineProperty(XMLElement.prototype,"tagName",{get:function(){return this.name}});Object.defineProperty(XMLElement.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(XMLElement.prototype,"prefix",{get:function(){return""}});Object.defineProperty(XMLElement.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(XMLElement.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLElement.prototype,"attributes",{get:function(){if(!this.attributeMap||!this.attributeMap.nodes){this.attributeMap=new i(this.attribs)}return this.attributeMap}});XMLElement.prototype.clone=function(){var e,t,r,s;r=Object.create(this);if(r.isRoot){r.documentObject=null}r.attribs={};s=this.attribs;for(t in s){if(!d.call(s,t))continue;e=s[t];r.attribs[t]=e.clone()}r.children=[];this.children.forEach((function(e){var t;t=e.clone();t.parent=r;return r.children.push(t)}));return r};XMLElement.prototype.attribute=function(e,t){var r,n;if(e!=null){e=a(e)}if(c(e)){for(r in e){if(!d.call(e,r))continue;n=e[r];this.attribute(r,n)}}else{if(u(t)){t=t.apply()}if(this.options.keepNullAttributes&&t==null){this.attribs[e]=new s(this,e,"")}else if(t!=null){this.attribs[e]=new s(this,e,t)}}return this};XMLElement.prototype.removeAttribute=function(e){var t,r,s;if(e==null){throw new Error("Missing attribute name. "+this.debugInfo())}e=a(e);if(Array.isArray(e)){for(r=0,s=e.length;r<s;r++){t=e[r];delete this.attribs[t]}}else{delete this.attribs[e]}return this};XMLElement.prototype.toString=function(e){return this.options.writer.element(this,this.options.writer.filterOptions(e))};XMLElement.prototype.att=function(e,t){return this.attribute(e,t)};XMLElement.prototype.a=function(e,t){return this.attribute(e,t)};XMLElement.prototype.getAttribute=function(e){if(this.attribs.hasOwnProperty(e)){return this.attribs[e].value}else{return null}};XMLElement.prototype.setAttribute=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getAttributeNode=function(e){if(this.attribs.hasOwnProperty(e)){return this.attribs[e]}else{return null}};XMLElement.prototype.setAttributeNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.removeAttributeNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagName=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getAttributeNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setAttributeNS=function(e,t,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.removeAttributeNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getAttributeNodeNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setAttributeNodeNS=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagNameNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.hasAttribute=function(e){return this.attribs.hasOwnProperty(e)};XMLElement.prototype.hasAttributeNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setIdAttribute=function(e,t){if(this.attribs.hasOwnProperty(e)){return this.attribs[e].isId}else{return t}};XMLElement.prototype.setIdAttributeNS=function(e,t,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.setIdAttributeNode=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagName=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByTagNameNS=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.getElementsByClassName=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLElement.prototype.isEqualNode=function(e){var t,r,s;if(!XMLElement.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)){return false}if(e.namespaceURI!==this.namespaceURI){return false}if(e.prefix!==this.prefix){return false}if(e.localName!==this.localName){return false}if(e.attribs.length!==this.attribs.length){return false}for(t=r=0,s=this.attribs.length-1;0<=s?r<=s:r>=s;t=0<=s?++r:--r){if(!this.attribs[t].isEqualNode(e.attribs[t])){return false}}return true};return XMLElement}(o)}).call(this)},4361:function(e){(function(){var t;e.exports=t=function(){function XMLNamedNodeMap(e){this.nodes=e}Object.defineProperty(XMLNamedNodeMap.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}});XMLNamedNodeMap.prototype.clone=function(){return this.nodes=null};XMLNamedNodeMap.prototype.getNamedItem=function(e){return this.nodes[e]};XMLNamedNodeMap.prototype.setNamedItem=function(e){var t;t=this.nodes[e.nodeName];this.nodes[e.nodeName]=e;return t||null};XMLNamedNodeMap.prototype.removeNamedItem=function(e){var t;t=this.nodes[e];delete this.nodes[e];return t||null};XMLNamedNodeMap.prototype.item=function(e){return this.nodes[Object.keys(this.nodes)[e]]||null};XMLNamedNodeMap.prototype.getNamedItemNS=function(e,t){throw new Error("This DOM method is not implemented.")};XMLNamedNodeMap.prototype.setNamedItemNS=function(e){throw new Error("This DOM method is not implemented.")};XMLNamedNodeMap.prototype.removeNamedItemNS=function(e,t){throw new Error("This DOM method is not implemented.")};return XMLNamedNodeMap}()}).call(this)},7608:function(e,t,r){(function(){var t,s,n,i,o,a,u,c,l,d,p,f,h,m,y,g,S,T,w,b={}.hasOwnProperty;w=r(8229),T=w.isObject,S=w.isFunction,g=w.isEmpty,y=w.getValue;c=null;n=null;i=null;o=null;a=null;h=null;m=null;f=null;u=null;s=null;p=null;l=null;t=null;e.exports=d=function(){function XMLNode(e){this.parent=e;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}this.value=null;this.children=[];this.baseURI=null;if(!c){c=r(9437);n=r(333);i=r(4407);o=r(6364);a=r(1801);h=r(6329);m=r(1318);f=r(6939);u=r(3590);s=r(9267);p=r(6768);l=r(4361);t=r(2839)}}Object.defineProperty(XMLNode.prototype,"nodeName",{get:function(){return this.name}});Object.defineProperty(XMLNode.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty(XMLNode.prototype,"nodeValue",{get:function(){return this.value}});Object.defineProperty(XMLNode.prototype,"parentNode",{get:function(){return this.parent}});Object.defineProperty(XMLNode.prototype,"childNodes",{get:function(){if(!this.childNodeList||!this.childNodeList.nodes){this.childNodeList=new p(this.children)}return this.childNodeList}});Object.defineProperty(XMLNode.prototype,"firstChild",{get:function(){return this.children[0]||null}});Object.defineProperty(XMLNode.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}});Object.defineProperty(XMLNode.prototype,"previousSibling",{get:function(){var e;e=this.parent.children.indexOf(this);return this.parent.children[e-1]||null}});Object.defineProperty(XMLNode.prototype,"nextSibling",{get:function(){var e;e=this.parent.children.indexOf(this);return this.parent.children[e+1]||null}});Object.defineProperty(XMLNode.prototype,"ownerDocument",{get:function(){return this.document()||null}});Object.defineProperty(XMLNode.prototype,"textContent",{get:function(){var e,t,r,n,i;if(this.nodeType===s.Element||this.nodeType===s.DocumentFragment){i="";n=this.children;for(t=0,r=n.length;t<r;t++){e=n[t];if(e.textContent){i+=e.textContent}}return i}else{return null}},set:function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}});XMLNode.prototype.setParent=function(e){var t,r,s,n,i;this.parent=e;if(e){this.options=e.options;this.stringify=e.stringify}n=this.children;i=[];for(r=0,s=n.length;r<s;r++){t=n[r];i.push(t.setParent(this))}return i};XMLNode.prototype.element=function(e,t,r){var s,n,i,o,a,u,c,l,d,p,f;u=null;if(t===null&&r==null){d=[{},null],t=d[0],r=d[1]}if(t==null){t={}}t=y(t);if(!T(t)){p=[t,r],r=p[0],t=p[1]}if(e!=null){e=y(e)}if(Array.isArray(e)){for(i=0,c=e.length;i<c;i++){n=e[i];u=this.element(n)}}else if(S(e)){u=this.element(e.apply())}else if(T(e)){for(a in e){if(!b.call(e,a))continue;f=e[a];if(S(f)){f=f.apply()}if(!this.options.ignoreDecorators&&this.stringify.convertAttKey&&a.indexOf(this.stringify.convertAttKey)===0){u=this.attribute(a.substr(this.stringify.convertAttKey.length),f)}else if(!this.options.separateArrayItems&&Array.isArray(f)&&g(f)){u=this.dummy()}else if(T(f)&&g(f)){u=this.element(a)}else if(!this.options.keepNullNodes&&f==null){u=this.dummy()}else if(!this.options.separateArrayItems&&Array.isArray(f)){for(o=0,l=f.length;o<l;o++){n=f[o];s={};s[a]=n;u=this.element(s)}}else if(T(f)){if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&a.indexOf(this.stringify.convertTextKey)===0){u=this.element(f)}else{u=this.element(a);u.element(f)}}else{u=this.element(a,f)}}}else if(!this.options.keepNullNodes&&r===null){u=this.dummy()}else{if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&e.indexOf(this.stringify.convertTextKey)===0){u=this.text(r)}else if(!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&e.indexOf(this.stringify.convertCDataKey)===0){u=this.cdata(r)}else if(!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&e.indexOf(this.stringify.convertCommentKey)===0){u=this.comment(r)}else if(!this.options.ignoreDecorators&&this.stringify.convertRawKey&&e.indexOf(this.stringify.convertRawKey)===0){u=this.raw(r)}else if(!this.options.ignoreDecorators&&this.stringify.convertPIKey&&e.indexOf(this.stringify.convertPIKey)===0){u=this.instruction(e.substr(this.stringify.convertPIKey.length),r)}else{u=this.node(e,t,r)}}if(u==null){throw new Error("Could not create any elements with: "+e+". "+this.debugInfo())}return u};XMLNode.prototype.insertBefore=function(e,t,r){var s,n,i,o,a;if(e!=null?e.type:void 0){i=e;o=t;i.setParent(this);if(o){n=children.indexOf(o);a=children.splice(n);children.push(i);Array.prototype.push.apply(children,a)}else{children.push(i)}return i}else{if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(e))}n=this.parent.children.indexOf(this);a=this.parent.children.splice(n);s=this.parent.element(e,t,r);Array.prototype.push.apply(this.parent.children,a);return s}};XMLNode.prototype.insertAfter=function(e,t,r){var s,n,i;if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo(e))}n=this.parent.children.indexOf(this);i=this.parent.children.splice(n+1);s=this.parent.element(e,t,r);Array.prototype.push.apply(this.parent.children,i);return s};XMLNode.prototype.remove=function(){var e,t;if(this.isRoot){throw new Error("Cannot remove the root element. "+this.debugInfo())}e=this.parent.children.indexOf(this);[].splice.apply(this.parent.children,[e,e-e+1].concat(t=[])),t;return this.parent};XMLNode.prototype.node=function(e,t,r){var s,n;if(e!=null){e=y(e)}t||(t={});t=y(t);if(!T(t)){n=[t,r],r=n[0],t=n[1]}s=new c(this,e,t);if(r!=null){s.text(r)}this.children.push(s);return s};XMLNode.prototype.text=function(e){var t;if(T(e)){this.element(e)}t=new m(this,e);this.children.push(t);return this};XMLNode.prototype.cdata=function(e){var t;t=new n(this,e);this.children.push(t);return this};XMLNode.prototype.comment=function(e){var t;t=new i(this,e);this.children.push(t);return this};XMLNode.prototype.commentBefore=function(e){var t,r,s;r=this.parent.children.indexOf(this);s=this.parent.children.splice(r);t=this.parent.comment(e);Array.prototype.push.apply(this.parent.children,s);return this};XMLNode.prototype.commentAfter=function(e){var t,r,s;r=this.parent.children.indexOf(this);s=this.parent.children.splice(r+1);t=this.parent.comment(e);Array.prototype.push.apply(this.parent.children,s);return this};XMLNode.prototype.raw=function(e){var t;t=new h(this,e);this.children.push(t);return this};XMLNode.prototype.dummy=function(){var e;e=new u(this);return e};XMLNode.prototype.instruction=function(e,t){var r,s,n,i,o;if(e!=null){e=y(e)}if(t!=null){t=y(t)}if(Array.isArray(e)){for(i=0,o=e.length;i<o;i++){r=e[i];this.instruction(r)}}else if(T(e)){for(r in e){if(!b.call(e,r))continue;s=e[r];this.instruction(r,s)}}else{if(S(t)){t=t.apply()}n=new f(this,e,t);this.children.push(n)}return this};XMLNode.prototype.instructionBefore=function(e,t){var r,s,n;s=this.parent.children.indexOf(this);n=this.parent.children.splice(s);r=this.parent.instruction(e,t);Array.prototype.push.apply(this.parent.children,n);return this};XMLNode.prototype.instructionAfter=function(e,t){var r,s,n;s=this.parent.children.indexOf(this);n=this.parent.children.splice(s+1);r=this.parent.instruction(e,t);Array.prototype.push.apply(this.parent.children,n);return this};XMLNode.prototype.declaration=function(e,t,r){var n,i;n=this.document();i=new o(n,e,t,r);if(n.children.length===0){n.children.unshift(i)}else if(n.children[0].type===s.Declaration){n.children[0]=i}else{n.children.unshift(i)}return n.root()||n};XMLNode.prototype.dtd=function(e,t){var r,n,i,o,u,c,l,d,p,f;n=this.document();i=new a(n,e,t);p=n.children;for(o=u=0,l=p.length;u<l;o=++u){r=p[o];if(r.type===s.DocType){n.children[o]=i;return i}}f=n.children;for(o=c=0,d=f.length;c<d;o=++c){r=f[o];if(r.isRoot){n.children.splice(o,0,i);return i}}n.children.push(i);return i};XMLNode.prototype.up=function(){if(this.isRoot){throw new Error("The root node has no parent. Use doc() if you need to get the document object.")}return this.parent};XMLNode.prototype.root=function(){var e;e=this;while(e){if(e.type===s.Document){return e.rootObject}else if(e.isRoot){return e}else{e=e.parent}}};XMLNode.prototype.document=function(){var e;e=this;while(e){if(e.type===s.Document){return e}else{e=e.parent}}};XMLNode.prototype.end=function(e){return this.document().end(e)};XMLNode.prototype.prev=function(){var e;e=this.parent.children.indexOf(this);if(e<1){throw new Error("Already at the first node. "+this.debugInfo())}return this.parent.children[e-1]};XMLNode.prototype.next=function(){var e;e=this.parent.children.indexOf(this);if(e===-1||e===this.parent.children.length-1){throw new Error("Already at the last node. "+this.debugInfo())}return this.parent.children[e+1]};XMLNode.prototype.importDocument=function(e){var t;t=e.root().clone();t.parent=this;t.isRoot=false;this.children.push(t);return this};XMLNode.prototype.debugInfo=function(e){var t,r;e=e||this.name;if(e==null&&!((t=this.parent)!=null?t.name:void 0)){return""}else if(e==null){return"parent: <"+this.parent.name+">"}else if(!((r=this.parent)!=null?r.name:void 0)){return"node: <"+e+">"}else{return"node: <"+e+">, parent: <"+this.parent.name+">"}};XMLNode.prototype.ele=function(e,t,r){return this.element(e,t,r)};XMLNode.prototype.nod=function(e,t,r){return this.node(e,t,r)};XMLNode.prototype.txt=function(e){return this.text(e)};XMLNode.prototype.dat=function(e){return this.cdata(e)};XMLNode.prototype.com=function(e){return this.comment(e)};XMLNode.prototype.ins=function(e,t){return this.instruction(e,t)};XMLNode.prototype.doc=function(){return this.document()};XMLNode.prototype.dec=function(e,t,r){return this.declaration(e,t,r)};XMLNode.prototype.e=function(e,t,r){return this.element(e,t,r)};XMLNode.prototype.n=function(e,t,r){return this.node(e,t,r)};XMLNode.prototype.t=function(e){return this.text(e)};XMLNode.prototype.d=function(e){return this.cdata(e)};XMLNode.prototype.c=function(e){return this.comment(e)};XMLNode.prototype.r=function(e){return this.raw(e)};XMLNode.prototype.i=function(e,t){return this.instruction(e,t)};XMLNode.prototype.u=function(){return this.up()};XMLNode.prototype.importXMLBuilder=function(e){return this.importDocument(e)};XMLNode.prototype.replaceChild=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.removeChild=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.appendChild=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.hasChildNodes=function(){return this.children.length!==0};XMLNode.prototype.cloneNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isSupported=function(e,t){return true};XMLNode.prototype.hasAttributes=function(){return this.attribs.length!==0};XMLNode.prototype.compareDocumentPosition=function(e){var r,s;r=this;if(r===e){return 0}else if(this.document()!==e.document()){s=t.Disconnected|t.ImplementationSpecific;if(Math.random()<.5){s|=t.Preceding}else{s|=t.Following}return s}else if(r.isAncestor(e)){return t.Contains|t.Preceding}else if(r.isDescendant(e)){return t.Contains|t.Following}else if(r.isPreceding(e)){return t.Preceding}else{return t.Following}};XMLNode.prototype.isSameNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.lookupPrefix=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isDefaultNamespace=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.lookupNamespaceURI=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.isEqualNode=function(e){var t,r,s;if(e.nodeType!==this.nodeType){return false}if(e.children.length!==this.children.length){return false}for(t=r=0,s=this.children.length-1;0<=s?r<=s:r>=s;t=0<=s?++r:--r){if(!this.children[t].isEqualNode(e.children[t])){return false}}return true};XMLNode.prototype.getFeature=function(e,t){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.setUserData=function(e,t,r){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.getUserData=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLNode.prototype.contains=function(e){if(!e){return false}return e===this||this.isDescendant(e)};XMLNode.prototype.isDescendant=function(e){var t,r,s,n,i;i=this.children;for(s=0,n=i.length;s<n;s++){t=i[s];if(e===t){return true}r=t.isDescendant(e);if(r){return true}}return false};XMLNode.prototype.isAncestor=function(e){return e.isDescendant(this)};XMLNode.prototype.isPreceding=function(e){var t,r;t=this.treePosition(e);r=this.treePosition(this);if(t===-1||r===-1){return false}else{return t<r}};XMLNode.prototype.isFollowing=function(e){var t,r;t=this.treePosition(e);r=this.treePosition(this);if(t===-1||r===-1){return false}else{return t>r}};XMLNode.prototype.treePosition=function(e){var t,r;r=0;t=false;this.foreachTreeNode(this.document(),(function(s){r++;if(!t&&s===e){return t=true}}));if(t){return r}else{return-1}};XMLNode.prototype.foreachTreeNode=function(e,t){var r,s,n,i,o;e||(e=this.document());i=e.children;for(s=0,n=i.length;s<n;s++){r=i[s];if(o=t(r)){return o}else{o=this.foreachTreeNode(r,t);if(o){return o}}}};return XMLNode}()}).call(this)},6768:function(e){(function(){var t;e.exports=t=function(){function XMLNodeList(e){this.nodes=e}Object.defineProperty(XMLNodeList.prototype,"length",{get:function(){return this.nodes.length||0}});XMLNodeList.prototype.clone=function(){return this.nodes=null};XMLNodeList.prototype.item=function(e){return this.nodes[e]||null};return XMLNodeList}()}).call(this)},6939:function(e,t,r){(function(){var t,s,n,extend=function(e,t){for(var r in t){if(i.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},i={}.hasOwnProperty;t=r(9267);s=r(7709);e.exports=n=function(e){extend(XMLProcessingInstruction,e);function XMLProcessingInstruction(e,r,s){XMLProcessingInstruction.__super__.constructor.call(this,e);if(r==null){throw new Error("Missing instruction target. "+this.debugInfo())}this.type=t.ProcessingInstruction;this.target=this.stringify.insTarget(r);this.name=this.target;if(s){this.value=this.stringify.insValue(s)}}XMLProcessingInstruction.prototype.clone=function(){return Object.create(this)};XMLProcessingInstruction.prototype.toString=function(e){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(e))};XMLProcessingInstruction.prototype.isEqualNode=function(e){if(!XMLProcessingInstruction.__super__.isEqualNode.apply(this,arguments).isEqualNode(e)){return false}if(e.target!==this.target){return false}return true};return XMLProcessingInstruction}(s)}).call(this)},6329:function(e,t,r){(function(){var t,s,n,extend=function(e,t){for(var r in t){if(i.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},i={}.hasOwnProperty;t=r(9267);s=r(7608);e.exports=n=function(e){extend(XMLRaw,e);function XMLRaw(e,r){XMLRaw.__super__.constructor.call(this,e);if(r==null){throw new Error("Missing raw text. "+this.debugInfo())}this.type=t.Raw;this.value=this.stringify.raw(r)}XMLRaw.prototype.clone=function(){return Object.create(this)};XMLRaw.prototype.toString=function(e){return this.options.writer.raw(this,this.options.writer.filterOptions(e))};return XMLRaw}(s)}).call(this)},8601:function(e,t,r){(function(){var t,s,n,i,extend=function(e,t){for(var r in t){if(o.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},o={}.hasOwnProperty;t=r(9267);i=r(6752);s=r(9766);e.exports=n=function(e){extend(XMLStreamWriter,e);function XMLStreamWriter(e,t){this.stream=e;XMLStreamWriter.__super__.constructor.call(this,t)}XMLStreamWriter.prototype.endline=function(e,t,r){if(e.isLastRootNode&&t.state===s.CloseTag){return""}else{return XMLStreamWriter.__super__.endline.call(this,e,t,r)}};XMLStreamWriter.prototype.document=function(e,t){var r,s,n,i,o,a,u,c,l;u=e.children;for(s=n=0,o=u.length;n<o;s=++n){r=u[s];r.isLastRootNode=s===e.children.length-1}t=this.filterOptions(t);c=e.children;l=[];for(i=0,a=c.length;i<a;i++){r=c[i];l.push(this.writeChildNode(r,t,0))}return l};XMLStreamWriter.prototype.attribute=function(e,t,r){return this.stream.write(XMLStreamWriter.__super__.attribute.call(this,e,t,r))};XMLStreamWriter.prototype.cdata=function(e,t,r){return this.stream.write(XMLStreamWriter.__super__.cdata.call(this,e,t,r))};XMLStreamWriter.prototype.comment=function(e,t,r){return this.stream.write(XMLStreamWriter.__super__.comment.call(this,e,t,r))};XMLStreamWriter.prototype.declaration=function(e,t,r){return this.stream.write(XMLStreamWriter.__super__.declaration.call(this,e,t,r))};XMLStreamWriter.prototype.docType=function(e,t,r){var n,i,o,a;r||(r=0);this.openNode(e,t,r);t.state=s.OpenTag;this.stream.write(this.indent(e,t,r));this.stream.write("<!DOCTYPE "+e.root().name);if(e.pubID&&e.sysID){this.stream.write(' PUBLIC "'+e.pubID+'" "'+e.sysID+'"')}else if(e.sysID){this.stream.write(' SYSTEM "'+e.sysID+'"')}if(e.children.length>0){this.stream.write(" [");this.stream.write(this.endline(e,t,r));t.state=s.InsideTag;a=e.children;for(i=0,o=a.length;i<o;i++){n=a[i];this.writeChildNode(n,t,r+1)}t.state=s.CloseTag;this.stream.write("]")}t.state=s.CloseTag;this.stream.write(t.spaceBeforeSlash+">");this.stream.write(this.endline(e,t,r));t.state=s.None;return this.closeNode(e,t,r)};XMLStreamWriter.prototype.element=function(e,r,n){var i,a,u,c,l,d,p,f,h,m;n||(n=0);this.openNode(e,r,n);r.state=s.OpenTag;this.stream.write(this.indent(e,r,n)+"<"+e.name);h=e.attribs;for(p in h){if(!o.call(h,p))continue;i=h[p];this.attribute(i,r,n)}u=e.children.length;c=u===0?null:e.children[0];if(u===0||e.children.every((function(e){return(e.type===t.Text||e.type===t.Raw)&&e.value===""}))){if(r.allowEmpty){this.stream.write(">");r.state=s.CloseTag;this.stream.write("</"+e.name+">")}else{r.state=s.CloseTag;this.stream.write(r.spaceBeforeSlash+"/>")}}else if(r.pretty&&u===1&&(c.type===t.Text||c.type===t.Raw)&&c.value!=null){this.stream.write(">");r.state=s.InsideTag;r.suppressPrettyCount++;f=true;this.writeChildNode(c,r,n+1);r.suppressPrettyCount--;f=false;r.state=s.CloseTag;this.stream.write("</"+e.name+">")}else{this.stream.write(">"+this.endline(e,r,n));r.state=s.InsideTag;m=e.children;for(l=0,d=m.length;l<d;l++){a=m[l];this.writeChildNode(a,r,n+1)}r.state=s.CloseTag;this.stream.write(this.indent(e,r,n)+"</"+e.name+">")}this.stream.write(this.endline(e,r,n));r.state=s.None;return this.closeNode(e,r,n)};XMLStreamWriter.prototype.processingInstruction=function(e,t,r){return this.stream.write(XMLStreamWriter.__super__.processingInstruction.call(this,e,t,r))};XMLStreamWriter.prototype.raw=function(e,t,r){return this.stream.write(XMLStreamWriter.__super__.raw.call(this,e,t,r))};XMLStreamWriter.prototype.text=function(e,t,r){return this.stream.write(XMLStreamWriter.__super__.text.call(this,e,t,r))};XMLStreamWriter.prototype.dtdAttList=function(e,t,r){return this.stream.write(XMLStreamWriter.__super__.dtdAttList.call(this,e,t,r))};XMLStreamWriter.prototype.dtdElement=function(e,t,r){return this.stream.write(XMLStreamWriter.__super__.dtdElement.call(this,e,t,r))};XMLStreamWriter.prototype.dtdEntity=function(e,t,r){return this.stream.write(XMLStreamWriter.__super__.dtdEntity.call(this,e,t,r))};XMLStreamWriter.prototype.dtdNotation=function(e,t,r){return this.stream.write(XMLStreamWriter.__super__.dtdNotation.call(this,e,t,r))};return XMLStreamWriter}(i)}).call(this)},5913:function(e,t,r){(function(){var t,s,extend=function(e,t){for(var r in t){if(n.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},n={}.hasOwnProperty;s=r(6752);e.exports=t=function(e){extend(XMLStringWriter,e);function XMLStringWriter(e){XMLStringWriter.__super__.constructor.call(this,e)}XMLStringWriter.prototype.document=function(e,t){var r,s,n,i,o;t=this.filterOptions(t);i="";o=e.children;for(s=0,n=o.length;s<n;s++){r=o[s];i+=this.writeChildNode(r,t,0)}if(t.pretty&&i.slice(-t.newline.length)===t.newline){i=i.slice(0,-t.newline.length)}return i};return XMLStringWriter}(s)}).call(this)},8594:function(e){(function(){var t,bind=function(e,t){return function(){return e.apply(t,arguments)}},r={}.hasOwnProperty;e.exports=t=function(){function XMLStringifier(e){this.assertLegalName=bind(this.assertLegalName,this);this.assertLegalChar=bind(this.assertLegalChar,this);var t,s,n;e||(e={});this.options=e;if(!this.options.version){this.options.version="1.0"}s=e.stringify||{};for(t in s){if(!r.call(s,t))continue;n=s[t];this[t]=n}}XMLStringifier.prototype.name=function(e){if(this.options.noValidation){return e}return this.assertLegalName(""+e||"")};XMLStringifier.prototype.text=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(this.textEscape(""+e||""))};XMLStringifier.prototype.cdata=function(e){if(this.options.noValidation){return e}e=""+e||"";e=e.replace("]]>","]]]]><![CDATA[>");return this.assertLegalChar(e)};XMLStringifier.prototype.comment=function(e){if(this.options.noValidation){return e}e=""+e||"";if(e.match(/--/)){throw new Error("Comment text cannot contain double-hypen: "+e)}return this.assertLegalChar(e)};XMLStringifier.prototype.raw=function(e){if(this.options.noValidation){return e}return""+e||""};XMLStringifier.prototype.attValue=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(this.attEscape(e=""+e||""))};XMLStringifier.prototype.insTarget=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.insValue=function(e){if(this.options.noValidation){return e}e=""+e||"";if(e.match(/\?>/)){throw new Error("Invalid processing instruction value: "+e)}return this.assertLegalChar(e)};XMLStringifier.prototype.xmlVersion=function(e){if(this.options.noValidation){return e}e=""+e||"";if(!e.match(/1\.[0-9]+/)){throw new Error("Invalid version number: "+e)}return e};XMLStringifier.prototype.xmlEncoding=function(e){if(this.options.noValidation){return e}e=""+e||"";if(!e.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)){throw new Error("Invalid encoding: "+e)}return this.assertLegalChar(e)};XMLStringifier.prototype.xmlStandalone=function(e){if(this.options.noValidation){return e}if(e){return"yes"}else{return"no"}};XMLStringifier.prototype.dtdPubID=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdSysID=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdElementValue=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdAttType=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdAttDefault=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdEntityValue=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.dtdNData=function(e){if(this.options.noValidation){return e}return this.assertLegalChar(""+e||"")};XMLStringifier.prototype.convertAttKey="@";XMLStringifier.prototype.convertPIKey="?";XMLStringifier.prototype.convertTextKey="#text";XMLStringifier.prototype.convertCDataKey="#cdata";XMLStringifier.prototype.convertCommentKey="#comment";XMLStringifier.prototype.convertRawKey="#raw";XMLStringifier.prototype.assertLegalChar=function(e){var t,r;if(this.options.noValidation){return e}t="";if(this.options.version==="1.0"){t=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(r=e.match(t)){throw new Error("Invalid character in string: "+e+" at index "+r.index)}}else if(this.options.version==="1.1"){t=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(r=e.match(t)){throw new Error("Invalid character in string: "+e+" at index "+r.index)}}return e};XMLStringifier.prototype.assertLegalName=function(e){var t;if(this.options.noValidation){return e}this.assertLegalChar(e);t=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/;if(!e.match(t)){throw new Error("Invalid character in name")}return e};XMLStringifier.prototype.textEscape=function(e){var t;if(this.options.noValidation){return e}t=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return e.replace(t,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;")};XMLStringifier.prototype.attEscape=function(e){var t;if(this.options.noValidation){return e}t=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return e.replace(t,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;")};return XMLStringifier}()}).call(this)},1318:function(e,t,r){(function(){var t,s,n,extend=function(e,t){for(var r in t){if(i.call(t,r))e[r]=t[r]}function ctor(){this.constructor=e}ctor.prototype=t.prototype;e.prototype=new ctor;e.__super__=t.prototype;return e},i={}.hasOwnProperty;t=r(9267);s=r(7709);e.exports=n=function(e){extend(XMLText,e);function XMLText(e,r){XMLText.__super__.constructor.call(this,e);if(r==null){throw new Error("Missing element text. "+this.debugInfo())}this.name="#text";this.type=t.Text;this.value=this.stringify.text(r)}Object.defineProperty(XMLText.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(XMLText.prototype,"wholeText",{get:function(){var e,t,r;r="";t=this.previousSibling;while(t){r=t.data+r;t=t.previousSibling}r+=this.data;e=this.nextSibling;while(e){r=r+e.data;e=e.nextSibling}return r}});XMLText.prototype.clone=function(){return Object.create(this)};XMLText.prototype.toString=function(e){return this.options.writer.text(this,this.options.writer.filterOptions(e))};XMLText.prototype.splitText=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};XMLText.prototype.replaceWholeText=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())};return XMLText}(s)}).call(this)},6752:function(e,t,r){(function(){var t,s,n,i,o,a,u,c,l,d,p,f,h,m,y,g,S,T={}.hasOwnProperty;S=r(8229).assign;t=r(9267);l=r(6364);d=r(1801);n=r(333);i=r(4407);f=r(9437);m=r(6329);y=r(1318);h=r(6939);p=r(3590);o=r(1015);a=r(2421);u=r(53);c=r(2837);s=r(9766);e.exports=g=function(){function XMLWriterBase(e){var t,r,s;e||(e={});this.options=e;r=e.writer||{};for(t in r){if(!T.call(r,t))continue;s=r[t];this["_"+t]=this[t];this[t]=s}}XMLWriterBase.prototype.filterOptions=function(e){var t,r,n,i,o,a,u,c;e||(e={});e=S({},this.options,e);t={writer:this};t.pretty=e.pretty||false;t.allowEmpty=e.allowEmpty||false;t.indent=(r=e.indent)!=null?r:" ";t.newline=(n=e.newline)!=null?n:"\n";t.offset=(i=e.offset)!=null?i:0;t.dontPrettyTextNodes=(o=(a=e.dontPrettyTextNodes)!=null?a:e.dontprettytextnodes)!=null?o:0;t.spaceBeforeSlash=(u=(c=e.spaceBeforeSlash)!=null?c:e.spacebeforeslash)!=null?u:"";if(t.spaceBeforeSlash===true){t.spaceBeforeSlash=" "}t.suppressPrettyCount=0;t.user={};t.state=s.None;return t};XMLWriterBase.prototype.indent=function(e,t,r){var s;if(!t.pretty||t.suppressPrettyCount){return""}else if(t.pretty){s=(r||0)+t.offset+1;if(s>0){return new Array(s).join(t.indent)}}return""};XMLWriterBase.prototype.endline=function(e,t,r){if(!t.pretty||t.suppressPrettyCount){return""}else{return t.newline}};XMLWriterBase.prototype.attribute=function(e,t,r){var s;this.openAttribute(e,t,r);s=" "+e.name+'="'+e.value+'"';this.closeAttribute(e,t,r);return s};XMLWriterBase.prototype.cdata=function(e,t,r){var n;this.openNode(e,t,r);t.state=s.OpenTag;n=this.indent(e,t,r)+"<![CDATA[";t.state=s.InsideTag;n+=e.value;t.state=s.CloseTag;n+="]]>"+this.endline(e,t,r);t.state=s.None;this.closeNode(e,t,r);return n};XMLWriterBase.prototype.comment=function(e,t,r){var n;this.openNode(e,t,r);t.state=s.OpenTag;n=this.indent(e,t,r)+"\x3c!-- ";t.state=s.InsideTag;n+=e.value;t.state=s.CloseTag;n+=" --\x3e"+this.endline(e,t,r);t.state=s.None;this.closeNode(e,t,r);return n};XMLWriterBase.prototype.declaration=function(e,t,r){var n;this.openNode(e,t,r);t.state=s.OpenTag;n=this.indent(e,t,r)+"<?xml";t.state=s.InsideTag;n+=' version="'+e.version+'"';if(e.encoding!=null){n+=' encoding="'+e.encoding+'"'}if(e.standalone!=null){n+=' standalone="'+e.standalone+'"'}t.state=s.CloseTag;n+=t.spaceBeforeSlash+"?>";n+=this.endline(e,t,r);t.state=s.None;this.closeNode(e,t,r);return n};XMLWriterBase.prototype.docType=function(e,t,r){var n,i,o,a,u;r||(r=0);this.openNode(e,t,r);t.state=s.OpenTag;a=this.indent(e,t,r);a+="<!DOCTYPE "+e.root().name;if(e.pubID&&e.sysID){a+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'}else if(e.sysID){a+=' SYSTEM "'+e.sysID+'"'}if(e.children.length>0){a+=" [";a+=this.endline(e,t,r);t.state=s.InsideTag;u=e.children;for(i=0,o=u.length;i<o;i++){n=u[i];a+=this.writeChildNode(n,t,r+1)}t.state=s.CloseTag;a+="]"}t.state=s.CloseTag;a+=t.spaceBeforeSlash+">";a+=this.endline(e,t,r);t.state=s.None;this.closeNode(e,t,r);return a};XMLWriterBase.prototype.element=function(e,r,n){var i,o,a,u,c,l,d,p,f,h,m,y,g,S;n||(n=0);h=false;m="";this.openNode(e,r,n);r.state=s.OpenTag;m+=this.indent(e,r,n)+"<"+e.name;y=e.attribs;for(f in y){if(!T.call(y,f))continue;i=y[f];m+=this.attribute(i,r,n)}a=e.children.length;u=a===0?null:e.children[0];if(a===0||e.children.every((function(e){return(e.type===t.Text||e.type===t.Raw)&&e.value===""}))){if(r.allowEmpty){m+=">";r.state=s.CloseTag;m+="</"+e.name+">"+this.endline(e,r,n)}else{r.state=s.CloseTag;m+=r.spaceBeforeSlash+"/>"+this.endline(e,r,n)}}else if(r.pretty&&a===1&&(u.type===t.Text||u.type===t.Raw)&&u.value!=null){m+=">";r.state=s.InsideTag;r.suppressPrettyCount++;h=true;m+=this.writeChildNode(u,r,n+1);r.suppressPrettyCount--;h=false;r.state=s.CloseTag;m+="</"+e.name+">"+this.endline(e,r,n)}else{if(r.dontPrettyTextNodes){g=e.children;for(c=0,d=g.length;c<d;c++){o=g[c];if((o.type===t.Text||o.type===t.Raw)&&o.value!=null){r.suppressPrettyCount++;h=true;break}}}m+=">"+this.endline(e,r,n);r.state=s.InsideTag;S=e.children;for(l=0,p=S.length;l<p;l++){o=S[l];m+=this.writeChildNode(o,r,n+1)}r.state=s.CloseTag;m+=this.indent(e,r,n)+"</"+e.name+">";if(h){r.suppressPrettyCount--}m+=this.endline(e,r,n);r.state=s.None}this.closeNode(e,r,n);return m};XMLWriterBase.prototype.writeChildNode=function(e,r,s){switch(e.type){case t.CData:return this.cdata(e,r,s);case t.Comment:return this.comment(e,r,s);case t.Element:return this.element(e,r,s);case t.Raw:return this.raw(e,r,s);case t.Text:return this.text(e,r,s);case t.ProcessingInstruction:return this.processingInstruction(e,r,s);case t.Dummy:return"";case t.Declaration:return this.declaration(e,r,s);case t.DocType:return this.docType(e,r,s);case t.AttributeDeclaration:return this.dtdAttList(e,r,s);case t.ElementDeclaration:return this.dtdElement(e,r,s);case t.EntityDeclaration:return this.dtdEntity(e,r,s);case t.NotationDeclaration:return this.dtdNotation(e,r,s);default:throw new Error("Unknown XML node type: "+e.constructor.name)}};XMLWriterBase.prototype.processingInstruction=function(e,t,r){var n;this.openNode(e,t,r);t.state=s.OpenTag;n=this.indent(e,t,r)+"<?";t.state=s.InsideTag;n+=e.target;if(e.value){n+=" "+e.value}t.state=s.CloseTag;n+=t.spaceBeforeSlash+"?>";n+=this.endline(e,t,r);t.state=s.None;this.closeNode(e,t,r);return n};XMLWriterBase.prototype.raw=function(e,t,r){var n;this.openNode(e,t,r);t.state=s.OpenTag;n=this.indent(e,t,r);t.state=s.InsideTag;n+=e.value;t.state=s.CloseTag;n+=this.endline(e,t,r);t.state=s.None;this.closeNode(e,t,r);return n};XMLWriterBase.prototype.text=function(e,t,r){var n;this.openNode(e,t,r);t.state=s.OpenTag;n=this.indent(e,t,r);t.state=s.InsideTag;n+=e.value;t.state=s.CloseTag;n+=this.endline(e,t,r);t.state=s.None;this.closeNode(e,t,r);return n};XMLWriterBase.prototype.dtdAttList=function(e,t,r){var n;this.openNode(e,t,r);t.state=s.OpenTag;n=this.indent(e,t,r)+"<!ATTLIST";t.state=s.InsideTag;n+=" "+e.elementName+" "+e.attributeName+" "+e.attributeType;if(e.defaultValueType!=="#DEFAULT"){n+=" "+e.defaultValueType}if(e.defaultValue){n+=' "'+e.defaultValue+'"'}t.state=s.CloseTag;n+=t.spaceBeforeSlash+">"+this.endline(e,t,r);t.state=s.None;this.closeNode(e,t,r);return n};XMLWriterBase.prototype.dtdElement=function(e,t,r){var n;this.openNode(e,t,r);t.state=s.OpenTag;n=this.indent(e,t,r)+"<!ELEMENT";t.state=s.InsideTag;n+=" "+e.name+" "+e.value;t.state=s.CloseTag;n+=t.spaceBeforeSlash+">"+this.endline(e,t,r);t.state=s.None;this.closeNode(e,t,r);return n};XMLWriterBase.prototype.dtdEntity=function(e,t,r){var n;this.openNode(e,t,r);t.state=s.OpenTag;n=this.indent(e,t,r)+"<!ENTITY";t.state=s.InsideTag;if(e.pe){n+=" %"}n+=" "+e.name;if(e.value){n+=' "'+e.value+'"'}else{if(e.pubID&&e.sysID){n+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'}else if(e.sysID){n+=' SYSTEM "'+e.sysID+'"'}if(e.nData){n+=" NDATA "+e.nData}}t.state=s.CloseTag;n+=t.spaceBeforeSlash+">"+this.endline(e,t,r);t.state=s.None;this.closeNode(e,t,r);return n};XMLWriterBase.prototype.dtdNotation=function(e,t,r){var n;this.openNode(e,t,r);t.state=s.OpenTag;n=this.indent(e,t,r)+"<!NOTATION";t.state=s.InsideTag;n+=" "+e.name;if(e.pubID&&e.sysID){n+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'}else if(e.pubID){n+=' PUBLIC "'+e.pubID+'"'}else if(e.sysID){n+=' SYSTEM "'+e.sysID+'"'}t.state=s.CloseTag;n+=t.spaceBeforeSlash+">"+this.endline(e,t,r);t.state=s.None;this.closeNode(e,t,r);return n};XMLWriterBase.prototype.openNode=function(e,t,r){};XMLWriterBase.prototype.closeNode=function(e,t,r){};XMLWriterBase.prototype.openAttribute=function(e,t,r){};XMLWriterBase.prototype.closeAttribute=function(e,t,r){};return XMLWriterBase}()}).call(this)},2958:function(e,t,r){(function(){var t,s,n,i,o,a,u,c,l,d;d=r(8229),c=d.assign,l=d.isFunction;n=r(8310);i=r(3730);o=r(7356);u=r(5913);a=r(8601);t=r(9267);s=r(9766);e.exports.create=function(e,t,r,s){var n,o;if(e==null){throw new Error("Root element needs a name.")}s=c({},t,r,s);n=new i(s);o=n.element(e);if(!s.headless){n.declaration(s);if(s.pubID!=null||s.sysID!=null){n.dtd(s)}}return o};e.exports.begin=function(e,t,r){var s;if(l(e)){s=[e,t],t=s[0],r=s[1];e={}}if(t){return new o(e,t,r)}else{return new i(e)}};e.exports.stringWriter=function(e){return new u(e)};e.exports.streamWriter=function(e,t){return new a(e,t)};e.exports.implementation=new n;e.exports.nodeType=t;e.exports.writerState=s}).call(this)},6113:function(e){"use strict";e.exports=require("crypto")},2361:function(e){"use strict";e.exports=require("events")},7147:function(e){"use strict";e.exports=require("fs")},3685:function(e){"use strict";e.exports=require("http")},5687:function(e){"use strict";e.exports=require("https")},2037:function(e){"use strict";e.exports=require("os")},1017:function(e){"use strict";e.exports=require("path")},3477:function(e){"use strict";e.exports=require("querystring")},2781:function(e){"use strict";e.exports=require("stream")},1576:function(e){"use strict";e.exports=require("string_decoder")},9512:function(e){"use strict";e.exports=require("timers")},6224:function(e){"use strict";e.exports=require("tty")},7310:function(e){"use strict";e.exports=require("url")},3837:function(e){"use strict";e.exports=require("util")},9796:function(e){"use strict";e.exports=require("zlib")},9807:function(e){"use strict";e.exports=JSON.parse('{"name":"@alicloud/credentials","version":"2.4.0","description":"alibaba cloud node.js sdk credentials","main":"dist/src/client.js","scripts":{"prepublishOnly":"tsc","build":"tsc","lint":"eslint --fix ./src --ext .ts","test":"mocha -b -r ts-node/register test/**/*.test.ts test/*.test.ts --timeout 15000","test-dev":"nyc -e .ts -r=html -r=text -r=lcov mocha -b -r ts-node/register","cov":"nyc -e .ts -r=html -r=text -r=lcov npm run test","ci":"npm run cov","integration":"mocha -b -r ts-node/register -R spec integration/*.test.ts","clean":"rm -rf coverage"},"repository":{"type":"git","url":"git+https://github.com/aliyun/nodejs-credentials.git"},"keywords":["alibaba cloud","sdk","credentials"],"author":"Alibaba Cloud SDK","license":"MIT","devDependencies":{"@types/debug":"^4.1.12","@types/expect.js":"^0.3.29","@types/ini":"^1.3.30","@types/mocha":"^10.0.6","@types/rewire":"^2.5.28","@typescript-eslint/eslint-plugin":"^6.18.1","@typescript-eslint/parser":"^6.18.1","eslint":"^8.56.0","expect.js":"^0.3.1","mm":"^2.4.1","mocha":"^10.1.0","nyc":"^15.1.0","rewire":"^7.0.0","ts-node":"^10.9.2","typescript":"^3.7.5"},"dependencies":{"@alicloud/tea-typescript":"^1.5.3","httpx":"^2.2.0","ini":"^1.3.5","kitx":"^2.0.0"},"bugs":{"url":"https://github.com/aliyun/nodejs-credentials/issues"},"homepage":"https://github.com/aliyun/nodejs-credentials#readme","files":["src","dist"]}')}};var t={};function __nccwpck_require__(r){var s=t[r];if(s!==undefined){return s.exports}var n=t[r]={exports:{}};var i=true;try{e[r].call(n.exports,n,n.exports,__nccwpck_require__);i=false}finally{if(i)delete t[r]}return n.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(3023);module.exports=r})();