next
Version:
The React Framework
31 lines (27 loc) • 271 kB
JavaScript
(()=>{var t={862:(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.AsnConvert=void 0;const i=o(62);const a=o(7);const c=o(859);const l=o(350);class AsnConvert{static serialize(t){return l.AsnSerializer.serialize(t)}static parse(t,r){return c.AsnParser.parse(t,r)}static toString(t){const r=a.BufferSourceConverter.isBufferSource(t)?a.BufferSourceConverter.toArrayBuffer(t):AsnConvert.serialize(t);const o=i.fromBER(r);if(o.offset===-1){throw new Error(`Cannot decode ASN.1 data. ${o.result.error}`)}return o.result.toString()}}r.AsnConvert=AsnConvert},184:(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.defaultConverter=r.AsnNullConverter=r.AsnGeneralizedTimeConverter=r.AsnUTCTimeConverter=r.AsnCharacterStringConverter=r.AsnGeneralStringConverter=r.AsnVisibleStringConverter=r.AsnGraphicStringConverter=r.AsnIA5StringConverter=r.AsnVideotexStringConverter=r.AsnTeletexStringConverter=r.AsnPrintableStringConverter=r.AsnNumericStringConverter=r.AsnUniversalStringConverter=r.AsnBmpStringConverter=r.AsnUtf8StringConverter=r.AsnOctetStringConverter=r.AsnBooleanConverter=r.AsnObjectIdentifierConverter=r.AsnBitStringConverter=r.AsnIntegerArrayBufferConverter=r.AsnEnumeratedConverter=r.AsnIntegerConverter=r.AsnAnyConverter=void 0;const i=o(62);const a=o(422);r.AsnAnyConverter={fromASN:t=>t instanceof i.Null?null:t.valueBeforeDecode,toASN:t=>{if(t===null){return new i.Null}const r=i.fromBER(t);if(r.result.error){throw new Error(r.result.error)}return r.result}};r.AsnIntegerConverter={fromASN:t=>t.valueBlock.valueHex.byteLength>4?t.valueBlock.toString():t.valueBlock.valueDec,toASN:t=>new i.Integer({value:t})};r.AsnEnumeratedConverter={fromASN:t=>t.valueBlock.valueDec,toASN:t=>new i.Enumerated({value:t})};r.AsnIntegerArrayBufferConverter={fromASN:t=>t.valueBlock.valueHex,toASN:t=>new i.Integer({valueHex:t})};r.AsnBitStringConverter={fromASN:t=>t.valueBlock.valueHex,toASN:t=>new i.BitString({valueHex:t})};r.AsnObjectIdentifierConverter={fromASN:t=>t.valueBlock.toString(),toASN:t=>new i.ObjectIdentifier({value:t})};r.AsnBooleanConverter={fromASN:t=>t.valueBlock.value,toASN:t=>new i.Boolean({value:t})};r.AsnOctetStringConverter={fromASN:t=>t.valueBlock.valueHex,toASN:t=>new i.OctetString({valueHex:t})};function createStringConverter(t){return{fromASN:t=>t.valueBlock.value,toASN:r=>new t({value:r})}}r.AsnUtf8StringConverter=createStringConverter(i.Utf8String);r.AsnBmpStringConverter=createStringConverter(i.BmpString);r.AsnUniversalStringConverter=createStringConverter(i.UniversalString);r.AsnNumericStringConverter=createStringConverter(i.NumericString);r.AsnPrintableStringConverter=createStringConverter(i.PrintableString);r.AsnTeletexStringConverter=createStringConverter(i.TeletexString);r.AsnVideotexStringConverter=createStringConverter(i.VideotexString);r.AsnIA5StringConverter=createStringConverter(i.IA5String);r.AsnGraphicStringConverter=createStringConverter(i.GraphicString);r.AsnVisibleStringConverter=createStringConverter(i.VisibleString);r.AsnGeneralStringConverter=createStringConverter(i.GeneralString);r.AsnCharacterStringConverter=createStringConverter(i.CharacterString);r.AsnUTCTimeConverter={fromASN:t=>t.toDate(),toASN:t=>new i.UTCTime({valueDate:t})};r.AsnGeneralizedTimeConverter={fromASN:t=>t.toDate(),toASN:t=>new i.GeneralizedTime({valueDate:t})};r.AsnNullConverter={fromASN:t=>null,toASN:t=>new i.Null};function defaultConverter(t){switch(t){case a.AsnPropTypes.Any:return r.AsnAnyConverter;case a.AsnPropTypes.BitString:return r.AsnBitStringConverter;case a.AsnPropTypes.BmpString:return r.AsnBmpStringConverter;case a.AsnPropTypes.Boolean:return r.AsnBooleanConverter;case a.AsnPropTypes.CharacterString:return r.AsnCharacterStringConverter;case a.AsnPropTypes.Enumerated:return r.AsnEnumeratedConverter;case a.AsnPropTypes.GeneralString:return r.AsnGeneralStringConverter;case a.AsnPropTypes.GeneralizedTime:return r.AsnGeneralizedTimeConverter;case a.AsnPropTypes.GraphicString:return r.AsnGraphicStringConverter;case a.AsnPropTypes.IA5String:return r.AsnIA5StringConverter;case a.AsnPropTypes.Integer:return r.AsnIntegerConverter;case a.AsnPropTypes.Null:return r.AsnNullConverter;case a.AsnPropTypes.NumericString:return r.AsnNumericStringConverter;case a.AsnPropTypes.ObjectIdentifier:return r.AsnObjectIdentifierConverter;case a.AsnPropTypes.OctetString:return r.AsnOctetStringConverter;case a.AsnPropTypes.PrintableString:return r.AsnPrintableStringConverter;case a.AsnPropTypes.TeletexString:return r.AsnTeletexStringConverter;case a.AsnPropTypes.UTCTime:return r.AsnUTCTimeConverter;case a.AsnPropTypes.UniversalString:return r.AsnUniversalStringConverter;case a.AsnPropTypes.Utf8String:return r.AsnUtf8StringConverter;case a.AsnPropTypes.VideotexString:return r.AsnVideotexStringConverter;case a.AsnPropTypes.VisibleString:return r.AsnVisibleStringConverter;default:return null}}r.defaultConverter=defaultConverter},358:(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.AsnProp=r.AsnType=void 0;const i=o(184);const a=o(455);const AsnType=t=>r=>{let o;if(!a.schemaStorage.has(r)){o=a.schemaStorage.createDefault(r);a.schemaStorage.set(r,o)}else{o=a.schemaStorage.get(r)}Object.assign(o,t)};r.AsnType=AsnType;const AsnProp=t=>(r,o)=>{let c;if(!a.schemaStorage.has(r.constructor)){c=a.schemaStorage.createDefault(r.constructor);a.schemaStorage.set(r.constructor,c)}else{c=a.schemaStorage.get(r.constructor)}const l=Object.assign({},t);if(typeof l.type==="number"&&!l.converter){const a=i.defaultConverter(t.type);if(!a){throw new Error(`Cannot get default converter for property '${o}' of ${r.constructor.name}`)}l.converter=a}c.items[o]=l};r.AsnProp=AsnProp},422:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.AsnPropTypes=r.AsnTypeTypes=void 0;var o;(function(t){t[t["Sequence"]=0]="Sequence";t[t["Set"]=1]="Set";t[t["Choice"]=2]="Choice"})(o=r.AsnTypeTypes||(r.AsnTypeTypes={}));var i;(function(t){t[t["Any"]=1]="Any";t[t["Boolean"]=2]="Boolean";t[t["OctetString"]=3]="OctetString";t[t["BitString"]=4]="BitString";t[t["Integer"]=5]="Integer";t[t["Enumerated"]=6]="Enumerated";t[t["ObjectIdentifier"]=7]="ObjectIdentifier";t[t["Utf8String"]=8]="Utf8String";t[t["BmpString"]=9]="BmpString";t[t["UniversalString"]=10]="UniversalString";t[t["NumericString"]=11]="NumericString";t[t["PrintableString"]=12]="PrintableString";t[t["TeletexString"]=13]="TeletexString";t[t["VideotexString"]=14]="VideotexString";t[t["IA5String"]=15]="IA5String";t[t["GraphicString"]=16]="GraphicString";t[t["VisibleString"]=17]="VisibleString";t[t["GeneralString"]=18]="GeneralString";t[t["CharacterString"]=19]="CharacterString";t[t["UTCTime"]=20]="UTCTime";t[t["GeneralizedTime"]=21]="GeneralizedTime";t[t["DATE"]=22]="DATE";t[t["TimeOfDay"]=23]="TimeOfDay";t[t["DateTime"]=24]="DateTime";t[t["Duration"]=25]="Duration";t[t["TIME"]=26]="TIME";t[t["Null"]=27]="Null"})(i=r.AsnPropTypes||(r.AsnPropTypes={}))},463:(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const i=o(657);(0,i.__exportStar)(o(150),r)},150:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.AsnSchemaValidationError=void 0;class AsnSchemaValidationError extends Error{constructor(){super(...arguments);this.schemas=[]}}r.AsnSchemaValidationError=AsnSchemaValidationError},83:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.isArrayEqual=r.isTypeOfArray=r.isConvertible=void 0;function isConvertible(t){if(t&&t.prototype){if(t.prototype.toASN&&t.prototype.fromASN){return true}else{return isConvertible(t.prototype)}}else{return!!(t&&t.toASN&&t.fromASN)}}r.isConvertible=isConvertible;function isTypeOfArray(t){var r;if(t){const o=Object.getPrototypeOf(t);if(((r=o===null||o===void 0?void 0:o.prototype)===null||r===void 0?void 0:r.constructor)===Array){return true}return isTypeOfArray(o)}return false}r.isTypeOfArray=isTypeOfArray;function isArrayEqual(t,r){if(!(t&&r)){return false}if(t.byteLength!==r.byteLength){return false}const o=new Uint8Array(t);const i=new Uint8Array(r);for(let r=0;r<t.byteLength;r++){if(o[r]!==i[r]){return false}}return true}r.isArrayEqual=isArrayEqual},297:(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.AsnSerializer=r.AsnParser=r.AsnPropTypes=r.AsnTypeTypes=r.AsnType=r.AsnProp=void 0;const i=o(657);(0,i.__exportStar)(o(184),r);(0,i.__exportStar)(o(176),r);var a=o(358);Object.defineProperty(r,"AsnProp",{enumerable:true,get:function(){return a.AsnProp}});Object.defineProperty(r,"AsnType",{enumerable:true,get:function(){return a.AsnType}});var c=o(422);Object.defineProperty(r,"AsnTypeTypes",{enumerable:true,get:function(){return c.AsnTypeTypes}});Object.defineProperty(r,"AsnPropTypes",{enumerable:true,get:function(){return c.AsnPropTypes}});var l=o(859);Object.defineProperty(r,"AsnParser",{enumerable:true,get:function(){return l.AsnParser}});var u=o(350);Object.defineProperty(r,"AsnSerializer",{enumerable:true,get:function(){return u.AsnSerializer}});(0,i.__exportStar)(o(463),r);(0,i.__exportStar)(o(503),r);(0,i.__exportStar)(o(862),r)},503:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.AsnArray=void 0;class AsnArray extends Array{constructor(t=[]){if(typeof t==="number"){super(t)}else{super();for(const r of t){this.push(r)}}}}r.AsnArray=AsnArray},859:(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.AsnParser=void 0;const i=o(62);const a=o(422);const c=o(184);const l=o(463);const u=o(83);const h=o(455);class AsnParser{static parse(t,r){let o;if(t instanceof ArrayBuffer){o=t}else if(typeof Buffer!=="undefined"&&Buffer.isBuffer(t)){o=new Uint8Array(t).buffer}else if(ArrayBuffer.isView(t)||t.buffer instanceof ArrayBuffer){o=t.buffer}else{throw new TypeError("Wrong type of 'data' argument")}const a=i.fromBER(o);if(a.result.error){throw new Error(a.result.error)}const c=this.fromASN(a.result,r);return c}static fromASN(t,r){var o;try{if((0,u.isConvertible)(r)){const o=new r;return o.fromASN(t)}const y=h.schemaStorage.get(r);h.schemaStorage.cache(r);let p=y.schema;if(t.constructor===i.Constructed&&y.type!==a.AsnTypeTypes.Choice){p=new i.Constructed({idBlock:{tagClass:3,tagNumber:t.idBlock.tagNumber},value:y.schema.valueBlock.value});for(const r in y.items){delete t[r]}}const g=i.compareSchema(t,t,p);if(!g.verified){throw new l.AsnSchemaValidationError(`Data does not match to ${r.name} ASN1 schema. ${g.result.error}`)}const d=new r;if((0,u.isTypeOfArray)(r)){if(typeof y.itemType==="number"){const o=c.defaultConverter(y.itemType);if(!o){throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`)}return r.from(t.valueBlock.value,(t=>o.fromASN(t)))}else{return r.from(t.valueBlock.value,(t=>this.fromASN(t,y.itemType)))}}for(const r in y.items){if(!t[r]){continue}const c=y.items[r];if(typeof c.type==="number"||(0,u.isConvertible)(c.type)){const l=(o=c.converter)!==null&&o!==void 0?o:(0,u.isConvertible)(c.type)?new c.type:null;if(!l){throw new Error("Converter is empty")}if(c.repeated){if(c.implicit){const o=c.repeated==="sequence"?i.Sequence:i.Set;const a=new o;a.valueBlock=t[r].valueBlock;const u=i.fromBER(a.toBER(false)).result.valueBlock.value;d[r]=Array.from(u,(t=>l.fromASN(t)))}else{d[r]=Array.from(t[r],(t=>l.fromASN(t)))}}else{let o=t[r];if(c.implicit){let t;if((0,u.isConvertible)(c.type)){t=(new c.type).toSchema("")}else{const r=a.AsnPropTypes[c.type];const o=i[r];if(!o){throw new Error(`Cannot get '${r}' class from asn1js module`)}t=new o}t.valueBlock=o.valueBlock;o=i.fromBER(t.toBER(false)).result}d[r]=l.fromASN(o)}}else{if(c.repeated){d[r]=Array.from(t[r],(t=>this.fromASN(t,c.type)))}else{d[r]=this.fromASN(t[r],c.type)}}}return d}catch(t){if(t instanceof l.AsnSchemaValidationError){t.schemas.push(r.name)}throw t}}}r.AsnParser=AsnParser},855:(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.AsnSchemaStorage=void 0;const i=o(62);const a=o(422);const c=o(83);class AsnSchemaStorage{constructor(){this.items=new WeakMap}has(t){return this.items.has(t)}get(t){var r,o,i,a;const c=this.items.get(t);if(!c){throw new Error(`Cannot get schema for '${(a=(i=(o=(r=t)===null||r===void 0?void 0:r.prototype)===null||o===void 0?void 0:o.constructor)===null||i===void 0?void 0:i.name)!==null&&a!==void 0?a:t}' target`)}return c}cache(t){const r=this.get(t);if(!r.schema){r.schema=this.create(t,true)}}createDefault(t){const r={type:a.AsnTypeTypes.Sequence,items:{}};const o=this.findParentSchema(t);if(o){Object.assign(r,o);r.items=Object.assign({},r.items,o.items)}return r}create(t,r){const o=this.items.get(t)||this.createDefault(t);const l=[];for(const t in o.items){const u=o.items[t];const h=r?t:"";let y;if(typeof u.type==="number"){const t=a.AsnPropTypes[u.type];const r=i[t];if(!r){throw new Error(`Cannot get ASN1 class by name '${t}'`)}y=new r({name:h})}else if((0,c.isConvertible)(u.type)){const t=new u.type;y=t.toSchema(h)}else if(u.optional){const t=this.get(u.type);if(t.type===a.AsnTypeTypes.Choice){y=new i.Any({name:h})}else{y=this.create(u.type,false);y.name=h}}else{y=new i.Any({name:h})}const p=!!u.optional||u.defaultValue!==undefined;if(u.repeated){y.name="";const t=u.repeated==="set"?i.Set:i.Sequence;y=new t({name:"",value:[new i.Repeated({name:h,value:y})]})}if(u.context!==null&&u.context!==undefined){if(u.implicit){if(typeof u.type==="number"||(0,c.isConvertible)(u.type)){const t=u.repeated?i.Constructed:i.Primitive;l.push(new t({name:h,optional:p,idBlock:{tagClass:3,tagNumber:u.context}}))}else{this.cache(u.type);const t=!!u.repeated;let r=!t?this.get(u.type).schema:y;r=r.valueBlock?r.valueBlock.value:r.value;l.push(new i.Constructed({name:!t?h:"",optional:p,idBlock:{tagClass:3,tagNumber:u.context},value:r}))}}else{l.push(new i.Constructed({optional:p,idBlock:{tagClass:3,tagNumber:u.context},value:[y]}))}}else{y.optional=p;l.push(y)}}switch(o.type){case a.AsnTypeTypes.Sequence:return new i.Sequence({value:l,name:""});case a.AsnTypeTypes.Set:return new i.Set({value:l,name:""});case a.AsnTypeTypes.Choice:return new i.Choice({value:l,name:""});default:throw new Error(`Unsupported ASN1 type in use`)}}set(t,r){this.items.set(t,r);return this}findParentSchema(t){const r=t.__proto__;if(r){const t=this.items.get(r);return t||this.findParentSchema(r)}return null}}r.AsnSchemaStorage=AsnSchemaStorage},350:(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.AsnSerializer=void 0;const i=o(62);const a=o(184);const c=o(422);const l=o(83);const u=o(455);class AsnSerializer{static serialize(t){if(t instanceof i.BaseBlock){return t.toBER(false)}return this.toASN(t).toBER(false)}static toASN(t){if(t&&(0,l.isConvertible)(t.constructor)){return t.toASN()}const r=t.constructor;const o=u.schemaStorage.get(r);u.schemaStorage.cache(r);let h=[];if(o.itemType){if(typeof o.itemType==="number"){const i=a.defaultConverter(o.itemType);if(!i){throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`)}h=t.map((t=>i.toASN(t)))}else{h=t.map((t=>this.toAsnItem({type:o.itemType},"[]",r,t)))}}else{for(const a in o.items){const c=o.items[a];const u=t[a];if(u===undefined||c.defaultValue===u||typeof c.defaultValue==="object"&&typeof u==="object"&&(0,l.isArrayEqual)(this.serialize(c.defaultValue),this.serialize(u))){continue}let y=AsnSerializer.toAsnItem(c,a,r,u);if(typeof c.context==="number"){if(c.implicit){if(!c.repeated&&(typeof c.type==="number"||(0,l.isConvertible)(c.type))){const t={};t.valueHex=y instanceof i.Null?y.valueBeforeDecode:y.valueBlock.toBER();h.push(new i.Primitive(Object.assign({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context}},t)))}else{h.push(new i.Constructed({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:y.valueBlock.value}))}}else{h.push(new i.Constructed({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:[y]}))}}else if(c.repeated){h=h.concat(y)}else{h.push(y)}}}let y;switch(o.type){case c.AsnTypeTypes.Sequence:y=new i.Sequence({value:h});break;case c.AsnTypeTypes.Set:y=new i.Set({value:h});break;case c.AsnTypeTypes.Choice:if(!h[0]){throw new Error(`Schema '${r.name}' has wrong data. Choice cannot be empty.`)}y=h[0];break}return y}static toAsnItem(t,r,o,a){let l;if(typeof t.type==="number"){const u=t.converter;if(!u){throw new Error(`Property '${r}' doesn't have converter for type ${c.AsnPropTypes[t.type]} in schema '${o.name}'`)}if(t.repeated){const r=Array.from(a,(t=>u.toASN(t)));const o=t.repeated==="sequence"?i.Sequence:i.Set;l=new o({value:r})}else{l=u.toASN(a)}}else{if(t.repeated){const r=Array.from(a,(t=>this.toASN(t)));const o=t.repeated==="sequence"?i.Sequence:i.Set;l=new o({value:r})}else{l=this.toASN(a)}}return l}}r.AsnSerializer=AsnSerializer},455:(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.schemaStorage=void 0;const i=o(855);r.schemaStorage=new i.AsnSchemaStorage},154:(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.BitString=void 0;const i=o(62);const a=o(7);class BitString{constructor(t,r=0){this.unusedBits=0;this.value=new ArrayBuffer(0);if(t){if(typeof t==="number"){this.fromNumber(t)}else if(a.BufferSourceConverter.isBufferSource(t)){this.unusedBits=r;this.value=a.BufferSourceConverter.toArrayBuffer(t)}else{throw TypeError("Unsupported type of 'params' argument for BitString")}}}fromASN(t){if(!(t instanceof i.BitString)){throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString")}this.unusedBits=t.valueBlock.unusedBits;this.value=t.valueBlock.valueHex;return this}toASN(){return new i.BitString({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(t){return new i.BitString({name:t})}toNumber(){let t="";const r=new Uint8Array(this.value);for(const o of r){t+=o.toString(2).padStart(8,"0")}t=t.split("").reverse().join("");if(this.unusedBits){t=t.slice(this.unusedBits).padStart(this.unusedBits,"0")}return parseInt(t,2)}fromNumber(t){let r=t.toString(2);const o=r.length+7>>3;this.unusedBits=(o<<3)-r.length;const i=new Uint8Array(o);r=r.padStart(o<<3,"0").split("").reverse().join("");let a=0;while(a<o){i[a]=parseInt(r.slice(a<<3,(a<<3)+8),2);a++}this.value=i.buffer}}r.BitString=BitString},176:(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const i=o(657);(0,i.__exportStar)(o(154),r);(0,i.__exportStar)(o(481),r)},481:(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.OctetString=void 0;const i=o(62);const a=o(7);class OctetString{constructor(t){if(typeof t==="number"){this.buffer=new ArrayBuffer(t)}else{if(a.BufferSourceConverter.isBufferSource(t)){this.buffer=a.BufferSourceConverter.toArrayBuffer(t)}else if(Array.isArray(t)){this.buffer=new Uint8Array(t)}else{this.buffer=new ArrayBuffer(0)}}}get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}fromASN(t){if(!(t instanceof i.OctetString)){throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString")}this.buffer=t.valueBlock.valueHex;return this}toASN(){return new i.OctetString({valueHex:this.buffer})}toSchema(t){return new i.OctetString({name:t})}}r.OctetString=OctetString},657:t=>{
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var r;var o;var i;var a;var c;var l;var u;var h;var y;var p;var g;var d;var m;var v;var B;var b;var k;var w;var S;var A;var C;var E;var P;var x;(function(r){var o=typeof global==="object"?global:typeof self==="object"?self:typeof this==="object"?this:{};if(typeof define==="function"&&define.amd){define("tslib",["exports"],(function(t){r(createExporter(o,createExporter(t)))}))}else if(true&&typeof t.exports==="object"){r(createExporter(o,createExporter(t.exports)))}else{r(createExporter(o))}function createExporter(t,r){if(t!==o){if(typeof Object.create==="function"){Object.defineProperty(t,"__esModule",{value:true})}else{t.__esModule=true}}return function(o,i){return t[o]=r?r(o,i):i}}})((function(t){var K=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var o in r)if(Object.prototype.hasOwnProperty.call(r,o))t[o]=r[o]};r=function(t,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");K(t,r);function __(){this.constructor=t}t.prototype=r===null?Object.create(r):(__.prototype=r.prototype,new __)};o=Object.assign||function(t){for(var r,o=1,i=arguments.length;o<i;o++){r=arguments[o];for(var a in r)if(Object.prototype.hasOwnProperty.call(r,a))t[a]=r[a]}return t};i=function(t,r){var o={};for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&r.indexOf(i)<0)o[i]=t[i];if(t!=null&&typeof Object.getOwnPropertySymbols==="function")for(var a=0,i=Object.getOwnPropertySymbols(t);a<i.length;a++){if(r.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(t,i[a]))o[i[a]]=t[i[a]]}return o};a=function(t,r,o,i){var a=arguments.length,c=a<3?r:i===null?i=Object.getOwnPropertyDescriptor(r,o):i,l;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")c=Reflect.decorate(t,r,o,i);else for(var u=t.length-1;u>=0;u--)if(l=t[u])c=(a<3?l(c):a>3?l(r,o,c):l(r,o))||c;return a>3&&c&&Object.defineProperty(r,o,c),c};c=function(t,r){return function(o,i){r(o,i,t)}};l=function(t,r){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(t,r)};u=function(t,r,o,i){function adopt(t){return t instanceof o?t:new o((function(r){r(t)}))}return new(o||(o=Promise))((function(o,a){function fulfilled(t){try{step(i.next(t))}catch(t){a(t)}}function rejected(t){try{step(i["throw"](t))}catch(t){a(t)}}function step(t){t.done?o(t.value):adopt(t.value).then(fulfilled,rejected)}step((i=i.apply(t,r||[])).next())}))};h=function(t,r){var o={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},i,a,c,l;return l={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function verb(t){return function(r){return step([t,r])}}function step(l){if(i)throw new TypeError("Generator is already executing.");while(o)try{if(i=1,a&&(c=l[0]&2?a["return"]:l[0]?a["throw"]||((c=a["return"])&&c.call(a),0):a.next)&&!(c=c.call(a,l[1])).done)return c;if(a=0,c)l=[l[0]&2,c.value];switch(l[0]){case 0:case 1:c=l;break;case 4:o.label++;return{value:l[1],done:false};case 5:o.label++;a=l[1];l=[0];continue;case 7:l=o.ops.pop();o.trys.pop();continue;default:if(!(c=o.trys,c=c.length>0&&c[c.length-1])&&(l[0]===6||l[0]===2)){o=0;continue}if(l[0]===3&&(!c||l[1]>c[0]&&l[1]<c[3])){o.label=l[1];break}if(l[0]===6&&o.label<c[1]){o.label=c[1];c=l;break}if(c&&o.label<c[2]){o.label=c[2];o.ops.push(l);break}if(c[2])o.ops.pop();o.trys.pop();continue}l=r.call(t,o)}catch(t){l=[6,t];a=0}finally{i=c=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};y=function(t,r){for(var o in t)if(o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o))x(r,t,o)};x=Object.create?function(t,r,o,i){if(i===undefined)i=o;Object.defineProperty(t,i,{enumerable:true,get:function(){return r[o]}})}:function(t,r,o,i){if(i===undefined)i=o;t[i]=r[o]};p=function(t){var r=typeof Symbol==="function"&&Symbol.iterator,o=r&&t[r],i=0;if(o)return o.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&i>=t.length)t=void 0;return{value:t&&t[i++],done:!t}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")};g=function(t,r){var o=typeof Symbol==="function"&&t[Symbol.iterator];if(!o)return t;var i=o.call(t),a,c=[],l;try{while((r===void 0||r-- >0)&&!(a=i.next()).done)c.push(a.value)}catch(t){l={error:t}}finally{try{if(a&&!a.done&&(o=i["return"]))o.call(i)}finally{if(l)throw l.error}}return c};d=function(){for(var t=[],r=0;r<arguments.length;r++)t=t.concat(g(arguments[r]));return t};m=function(){for(var t=0,r=0,o=arguments.length;r<o;r++)t+=arguments[r].length;for(var i=Array(t),a=0,r=0;r<o;r++)for(var c=arguments[r],l=0,u=c.length;l<u;l++,a++)i[a]=c[l];return i};v=function(t,r,o){if(o||arguments.length===2)for(var i=0,a=r.length,c;i<a;i++){if(c||!(i in r)){if(!c)c=Array.prototype.slice.call(r,0,i);c[i]=r[i]}}return t.concat(c||Array.prototype.slice.call(r))};B=function(t){return this instanceof B?(this.v=t,this):new B(t)};b=function(t,r,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=o.apply(t,r||[]),a,c=[];return a={},verb("next"),verb("throw"),verb("return"),a[Symbol.asyncIterator]=function(){return this},a;function verb(t){if(i[t])a[t]=function(r){return new Promise((function(o,i){c.push([t,r,o,i])>1||resume(t,r)}))}}function resume(t,r){try{step(i[t](r))}catch(t){settle(c[0][3],t)}}function step(t){t.value instanceof B?Promise.resolve(t.value.v).then(fulfill,reject):settle(c[0][2],t)}function fulfill(t){resume("next",t)}function reject(t){resume("throw",t)}function settle(t,r){if(t(r),c.shift(),c.length)resume(c[0][0],c[0][1])}};k=function(t){var r,o;return r={},verb("next"),verb("throw",(function(t){throw t})),verb("return"),r[Symbol.iterator]=function(){return this},r;function verb(i,a){r[i]=t[i]?function(r){return(o=!o)?{value:B(t[i](r)),done:i==="return"}:a?a(r):r}:a}};w=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t[Symbol.asyncIterator],o;return r?r.call(t):(t=typeof p==="function"?p(t):t[Symbol.iterator](),o={},verb("next"),verb("throw"),verb("return"),o[Symbol.asyncIterator]=function(){return this},o);function verb(r){o[r]=t[r]&&function(o){return new Promise((function(i,a){o=t[r](o),settle(i,a,o.done,o.value)}))}}function settle(t,r,o,i){Promise.resolve(i).then((function(r){t({value:r,done:o})}),r)}};S=function(t,r){if(Object.defineProperty){Object.defineProperty(t,"raw",{value:r})}else{t.raw=r}return t};var N=Object.create?function(t,r){Object.defineProperty(t,"default",{enumerable:true,value:r})}:function(t,r){t["default"]=r};A=function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o))x(r,t,o);N(r,t);return r};C=function(t){return t&&t.__esModule?t:{default:t}};E=function(t,r,o,i){if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof r==="function"?t!==r||!i:!r.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?i:o==="a"?i.call(t):i?i.value:r.get(t)};P=function(t,r,o,i,a){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof r==="function"?t!==r||!a:!r.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?a.call(t,o):a?a.value=o:r.set(t,o),o};t("__extends",r);t("__assign",o);t("__rest",i);t("__decorate",a);t("__param",c);t("__metadata",l);t("__awaiter",u);t("__generator",h);t("__exportStar",y);t("__createBinding",x);t("__values",p);t("__read",g);t("__spread",d);t("__spreadArrays",m);t("__spreadArray",v);t("__await",B);t("__asyncGenerator",b);t("__asyncDelegator",k);t("__asyncValues",w);t("__makeTemplateObject",S);t("__importStar",A);t("__importDefault",C);t("__classPrivateFieldGet",E);t("__classPrivateFieldSet",P)}))},628:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});class JsonError extends Error{constructor(t,r){super(r?`${t}. See the inner exception for more details.`:t);this.message=t;this.innerError=r}}class TransformError extends JsonError{constructor(t,r,o){super(r,o);this.schema=t}}class ParserError extends TransformError{constructor(t,r,o){super(t,`JSON doesn't match to '${t.target.name}' schema. ${r}`,o)}}class ValidationError extends JsonError{}class SerializerError extends JsonError{constructor(t,r,o){super(`Cannot serialize by '${t}' schema. ${r}`,o);this.schemaName=t}}class KeyError extends ParserError{constructor(t,r,o={}){super(t,"Some keys doesn't match to schema");this.keys=r;this.errors=o}}(function(t){t[t["Any"]=0]="Any";t[t["Boolean"]=1]="Boolean";t[t["Number"]=2]="Number";t[t["String"]=3]="String"})(r.JsonPropTypes||(r.JsonPropTypes={}));function checkType(t,o){switch(o){case r.JsonPropTypes.Boolean:return typeof t==="boolean";case r.JsonPropTypes.Number:return typeof t==="number";case r.JsonPropTypes.String:return typeof t==="string"}return true}function throwIfTypeIsWrong(t,o){if(!checkType(t,o)){throw new TypeError(`Value must be ${r.JsonPropTypes[o]}`)}}function isConvertible(t){if(t&&t.prototype){if(t.prototype.toJSON&&t.prototype.fromJSON){return true}else{return isConvertible(t.prototype)}}else{return!!(t&&t.toJSON&&t.fromJSON)}}class JsonSchemaStorage{constructor(){this.items=new Map}has(t){return this.items.has(t)||!!this.findParentSchema(t)}get(t){const r=this.items.get(t)||this.findParentSchema(t);if(!r){throw new Error("Cannot get schema for current target")}return r}create(t){const r={names:{}};const o=this.findParentSchema(t);if(o){Object.assign(r,o);r.names={};for(const t in o.names){r.names[t]=Object.assign({},o.names[t])}}r.target=t;return r}set(t,r){this.items.set(t,r);return this}findParentSchema(t){const r=t.__proto__;if(r){const t=this.items.get(r);return t||this.findParentSchema(r)}return null}}const o="default";const i=new JsonSchemaStorage;class PatternValidation{constructor(t){this.pattern=new RegExp(t)}validate(t){const r=new RegExp(this.pattern.source,this.pattern.flags);if(typeof t!=="string"){throw new ValidationError("Incoming value must be string")}if(!r.exec(t)){throw new ValidationError(`Value doesn't match to pattern '${r.toString()}'`)}}}class InclusiveValidation{constructor(t=Number.MIN_VALUE,r=Number.MAX_VALUE){this.min=t;this.max=r}validate(t){throwIfTypeIsWrong(t,r.JsonPropTypes.Number);if(!(this.min<=t&&t<=this.max)){const t=this.min===Number.MIN_VALUE?"MIN":this.min;const r=this.max===Number.MAX_VALUE?"MAX":this.max;throw new ValidationError(`Value doesn't match to diapason [${t},${r}]`)}}}class ExclusiveValidation{constructor(t=Number.MIN_VALUE,r=Number.MAX_VALUE){this.min=t;this.max=r}validate(t){throwIfTypeIsWrong(t,r.JsonPropTypes.Number);if(!(this.min<t&&t<this.max)){const t=this.min===Number.MIN_VALUE?"MIN":this.min;const r=this.max===Number.MAX_VALUE?"MAX":this.max;throw new ValidationError(`Value doesn't match to diapason (${t},${r})`)}}}class LengthValidation{constructor(t,r,o){this.length=t;this.minLength=r;this.maxLength=o}validate(t){if(this.length!==undefined){if(t.length!==this.length){throw new ValidationError(`Value length must be exactly ${this.length}.`)}return}if(this.minLength!==undefined){if(t.length<this.minLength){throw new ValidationError(`Value length must be more than ${this.minLength}.`)}}if(this.maxLength!==undefined){if(t.length>this.maxLength){throw new ValidationError(`Value length must be less than ${this.maxLength}.`)}}}}class EnumerationValidation{constructor(t){this.enumeration=t}validate(t){throwIfTypeIsWrong(t,r.JsonPropTypes.String);if(!this.enumeration.includes(t)){throw new ValidationError(`Value must be one of ${this.enumeration.map((t=>`'${t}'`)).join(", ")}`)}}}class JsonTransform{static checkValues(t,r){const o=Array.isArray(t)?t:[t];for(const i of o){for(const o of r.validations){if(o instanceof LengthValidation&&r.repeated){o.validate(t)}else{o.validate(i)}}}}static checkTypes(t,r){if(r.repeated&&!Array.isArray(t)){throw new TypeError("Value must be Array")}if(typeof r.type==="number"){const o=Array.isArray(t)?t:[t];for(const t of o){throwIfTypeIsWrong(t,r.type)}}}static getSchemaByName(t,r=o){return{...t.names[o],...t.names[r]}}}class JsonSerializer extends JsonTransform{static serialize(t,r,o,i){const a=this.toJSON(t,r);return JSON.stringify(a,o,i)}static toJSON(t,r={}){let a;let c=r.targetSchema;const l=r.schemaName||o;if(isConvertible(t)){return t.toJSON()}if(Array.isArray(t)){a=[];for(const o of t){a.push(this.toJSON(o,r))}}else if(typeof t==="object"){if(c&&!i.has(c)){throw new JsonError("Cannot get schema for `targetSchema` param")}c=c||t.constructor;if(i.has(c)){const r=i.get(c);a={};const o=this.getSchemaByName(r,l);for(const i in o){try{const r=o[i];const u=t[i];let h;if(r.optional&&u===undefined||r.defaultValue!==undefined&&u===r.defaultValue){continue}if(!r.optional&&u===undefined){throw new SerializerError(c.name,`Property '${i}' is required.`)}if(typeof r.type==="number"){if(r.converter){if(r.repeated){h=u.map((o=>r.converter.toJSON(o,t)))}else{h=r.converter.toJSON(u,t)}}else{h=u}}else{if(r.repeated){h=u.map((t=>this.toJSON(t,{schemaName:l})))}else{h=this.toJSON(u,{schemaName:l})}}this.checkTypes(h,r);this.checkValues(h,r);a[r.name||i]=h}catch(t){if(t instanceof SerializerError){throw t}else{throw new SerializerError(r.target.name,`Property '${i}' is wrong. ${t.message}`,t)}}}}else{a={};for(const r in t){a[r]=this.toJSON(t[r],{schemaName:l})}}}else{a=t}return a}}class JsonParser extends JsonTransform{static parse(t,r){const o=JSON.parse(t);return this.fromJSON(o,r)}static fromJSON(t,r){const a=r.targetSchema;const c=r.schemaName||o;const l=new a;if(isConvertible(l)){return l.fromJSON(t)}const u=i.get(a);const h=this.getSchemaByName(u,c);const y={};if(r.strictProperty&&!Array.isArray(t)){JsonParser.checkStrictProperty(t,h,u)}for(const o in h){try{const i=h[o];const a=i.name||o;const y=t[a];if(y===undefined&&(i.optional||i.defaultValue!==undefined)){continue}if(!i.optional&&y===undefined){throw new ParserError(u,`Property '${a}' is required.`)}this.checkTypes(y,i);this.checkValues(y,i);if(typeof i.type==="number"){if(i.converter){if(i.repeated){l[o]=y.map((t=>i.converter.fromJSON(t,l)))}else{l[o]=i.converter.fromJSON(y,l)}}else{l[o]=y}}else{const t={...r,targetSchema:i.type,schemaName:c};if(i.repeated){l[o]=y.map((r=>this.fromJSON(r,t)))}else{l[o]=this.fromJSON(y,t)}}}catch(t){if(!(t instanceof ParserError)){t=new ParserError(u,`Property '${o}' is wrong. ${t.message}`,t)}if(r.strictAllKeys){y[o]=t}else{throw t}}}const p=Object.keys(y);if(p.length){throw new KeyError(u,p,y)}return l}static checkStrictProperty(t,r,o){const i=Object.keys(t);const a=Object.keys(r);const c=[];for(const t of i){if(a.indexOf(t)===-1){c.push(t)}}if(c.length){throw new KeyError(o,c)}}}function getValidations(t){const o=[];if(t.pattern){o.push(new PatternValidation(t.pattern))}if(t.type===r.JsonPropTypes.Number||t.type===r.JsonPropTypes.Any){if(t.minInclusive!==undefined||t.maxInclusive!==undefined){o.push(new InclusiveValidation(t.minInclusive,t.maxInclusive))}if(t.minExclusive!==undefined||t.maxExclusive!==undefined){o.push(new ExclusiveValidation(t.minExclusive,t.maxExclusive))}if(t.enumeration!==undefined){o.push(new EnumerationValidation(t.enumeration))}}if(t.type===r.JsonPropTypes.String||t.repeated||t.type===r.JsonPropTypes.Any){if(t.length!==undefined||t.minLength!==undefined||t.maxLength!==undefined){o.push(new LengthValidation(t.length,t.minLength,t.maxLength))}}return o}const JsonProp=(t={})=>(a,c)=>{const l=`Cannot set type for ${c} property of ${a.constructor.name} schema`;let u;if(!i.has(a.constructor)){u=i.create(a.constructor);i.set(a.constructor,u)}else{u=i.get(a.constructor);if(u.target!==a.constructor){u=i.create(a.constructor);i.set(a.constructor,u)}}const h={type:r.JsonPropTypes.Any,validations:[]};const y=Object.assign(h,t);y.validations=getValidations(y);if(typeof y.type!=="number"){if(!i.has(y.type)&&!isConvertible(y.type)){throw new Error(`${l}. Assigning type doesn't have schema.`)}}let p;if(Array.isArray(t.schema)){p=t.schema}else{p=[t.schema||o]}for(const t of p){if(!u.names[t]){u.names[t]={}}const r=u.names[t];r[c]=y}};r.JsonError=JsonError;r.JsonParser=JsonParser;r.JsonProp=JsonProp;r.JsonSerializer=JsonSerializer;r.KeyError=KeyError;r.ParserError=ParserError;r.SerializerError=SerializerError;r.TransformError=TransformError;r.ValidationError=ValidationError},632:t=>{
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var r;var o;var i;var a;var c;var l;var u;var h;var y;var p;var g;var d;var m;var v;var B;var b;var k;var w;var S;var A;var C;var E;var P;var x;(function(r){var o=typeof global==="object"?global:typeof self==="object"?self:typeof this==="object"?this:{};if(typeof define==="function"&&define.amd){define("tslib",["exports"],(function(t){r(createExporter(o,createExporter(t)))}))}else if(true&&typeof t.exports==="object"){r(createExporter(o,createExporter(t.exports)))}else{r(createExporter(o))}function createExporter(t,r){if(t!==o){if(typeof Object.create==="function"){Object.defineProperty(t,"__esModule",{value:true})}else{t.__esModule=true}}return function(o,i){return t[o]=r?r(o,i):i}}})((function(t){var K=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var o in r)if(Object.prototype.hasOwnProperty.call(r,o))t[o]=r[o]};r=function(t,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");K(t,r);function __(){this.constructor=t}t.prototype=r===null?Object.create(r):(__.prototype=r.prototype,new __)};o=Object.assign||function(t){for(var r,o=1,i=arguments.length;o<i;o++){r=arguments[o];for(var a in r)if(Object.prototype.hasOwnProperty.call(r,a))t[a]=r[a]}return t};i=function(t,r){var o={};for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&r.indexOf(i)<0)o[i]=t[i];if(t!=null&&typeof Object.getOwnPropertySymbols==="function")for(var a=0,i=Object.getOwnPropertySymbols(t);a<i.length;a++){if(r.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(t,i[a]))o[i[a]]=t[i[a]]}return o};a=function(t,r,o,i){var a=arguments.length,c=a<3?r:i===null?i=Object.getOwnPropertyDescriptor(r,o):i,l;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")c=Reflect.decorate(t,r,o,i);else for(var u=t.length-1;u>=0;u--)if(l=t[u])c=(a<3?l(c):a>3?l(r,o,c):l(r,o))||c;return a>3&&c&&Object.defineProperty(r,o,c),c};c=function(t,r){return function(o,i){r(o,i,t)}};l=function(t,r){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(t,r)};u=function(t,r,o,i){function adopt(t){return t instanceof o?t:new o((function(r){r(t)}))}return new(o||(o=Promise))((function(o,a){function fulfilled(t){try{step(i.next(t))}catch(t){a(t)}}function rejected(t){try{step(i["throw"](t))}catch(t){a(t)}}function step(t){t.done?o(t.value):adopt(t.value).then(fulfilled,rejected)}step((i=i.apply(t,r||[])).next())}))};h=function(t,r){var o={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},i,a,c,l;return l={next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function verb(t){return function(r){return step([t,r])}}function step(l){if(i)throw new TypeError("Generator is already executing.");while(o)try{if(i=1,a&&(c=l[0]&2?a["return"]:l[0]?a["throw"]||((c=a["return"])&&c.call(a),0):a.next)&&!(c=c.call(a,l[1])).done)return c;if(a=0,c)l=[l[0]&2,c.value];switch(l[0]){case 0:case 1:c=l;break;case 4:o.label++;return{value:l[1],done:false};case 5:o.label++;a=l[1];l=[0];continue;case 7:l=o.ops.pop();o.trys.pop();continue;default:if(!(c=o.trys,c=c.length>0&&c[c.length-1])&&(l[0]===6||l[0]===2)){o=0;continue}if(l[0]===3&&(!c||l[1]>c[0]&&l[1]<c[3])){o.label=l[1];break}if(l[0]===6&&o.label<c[1]){o.label=c[1];c=l;break}if(c&&o.label<c[2]){o.label=c[2];o.ops.push(l);break}if(c[2])o.ops.pop();o.trys.pop();continue}l=r.call(t,o)}catch(t){l=[6,t];a=0}finally{i=c=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};y=function(t,r){for(var o in t)if(o!=="default"&&!Object.prototype.hasOwnProperty.call(r,o))x(r,t,o)};x=Object.create?function(t,r,o,i){if(i===undefined)i=o;Object.defineProperty(t,i,{enumerable:true,get:function(){return r[o]}})}:function(t,r,o,i){if(i===undefined)i=o;t[i]=r[o]};p=function(t){var r=typeof Symbol==="function"&&Symbol.iterator,o=r&&t[r],i=0;if(o)return o.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&i>=t.length)t=void 0;return{value:t&&t[i++],done:!t}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")};g=function(t,r){var o=typeof Symbol==="function"&&t[Symbol.iterator];if(!o)return t;var i=o.call(t),a,c=[],l;try{while((r===void 0||r-- >0)&&!(a=i.next()).done)c.push(a.value)}catch(t){l={error:t}}finally{try{if(a&&!a.done&&(o=i["return"]))o.call(i)}finally{if(l)throw l.error}}return c};d=function(){for(var t=[],r=0;r<arguments.length;r++)t=t.concat(g(arguments[r]));return t};m=function(){for(var t=0,r=0,o=arguments.length;r<o;r++)t+=arguments[r].length;for(var i=Array(t),a=0,r=0;r<o;r++)for(var c=arguments[r],l=0,u=c.length;l<u;l++,a++)i[a]=c[l];return i};v=function(t,r,o){if(o||arguments.length===2)for(var i=0,a=r.length,c;i<a;i++){if(c||!(i in r)){if(!c)c=Array.prototype.slice.call(r,0,i);c[i]=r[i]}}return t.concat(c||Array.prototype.slice.call(r))};B=function(t){return this instanceof B?(this.v=t,this):new B(t)};b=function(t,r,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=o.apply(t,r||[]),a,c=[];return a={},verb("next"),verb("throw"),verb("return"),a[Symbol.asyncIterator]=function(){return this},a;function verb(t){if(i[t])a[t]=function(r){return new Promise((function(o,i){c.push([t,r,o,i])>1||resume(t,r)}))}}function resume(t,r){try{step(i[t](r))}catch(t){settle(c[0][3],t)}}function step(t){t.value instanceof B?Promise.resolve(t.value.v).then(fulfill,reject):settle(c[0][2],t)}function fulfill(t){resume("next",t)}function reject(t){resume("throw",t)}function settle(t,r){if(t(r),c.shift(),c.length)resume(c[0][0],c[0][1])}};k=function(t){var r,o;return r={},verb("next"),verb("throw",(function(t){throw t})),verb("return"),r[Symbol.iterator]=function(){return this},r;function verb(i,a){r[i]=t[i]?function(r){return(o=!o)?{value:B(t[i](r)),done:i==="return"}:a?a(r):r}:a}};w=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t[Symbol.asyncIterator],o;return r?r.call(t):(t=typeof p==="function"?p(t):t[Symbol.iterator](),o={},verb("next"),verb("throw"),verb("return"),o[Symbol.asyncIterator]=function(){return this},o);function verb(r){o[r]=t[r]&&function(o){return new Promise((function(i,a){o=t[r](o),settle(i,a,o.done,o.value)}))}}function settle(t,r,o,i){Promise.resolve(i).then((function(r){t({value:r,done:o})}),r)}};S=function(t,r){if(Object.defineProperty){Object.defineProperty(t,"raw",{value:r})}else{t.raw=r}return t};var N=Object.create?function(t,r){Object.defineProperty(t,"default",{enumerable:true,value:r})}:function(t,r){t["default"]=r};A=function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o))x(r,t,o);N(r,t);return r};C=function(t){return t&&t.__esModule?t:{default:t}};E=function(t,r,o,i){if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof r==="function"?t!==r||!i:!r.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?i:o==="a"?i.call(t):i?i.value:r.get(t)};P=function(t,r,o,i,a){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof r==="function"?t!==r||!a:!r.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?a.call(t,o):a?a.value=o:r.set(t,o),o};t("__extends",r);t("__assign",o);t("__rest",i);t("__decorate",a);t("__param",c);t("__metadata",l);t("__awaiter",u);t("__generator",h);t("__exportStar",y);t("__createBinding",x);t("__values",p);t("__read",g);t("__spread",d);t("__spreadArrays",m);t("__spreadArray",v);t("__await",B);t("__asyncGenerator",b);t("__asyncDelegator",k);t("__asyncValues",w);t("__makeTemplateObject",S);t("__importStar",A);t("__importDefault",C);t("__classPrivateFieldGet",E);t("__classPrivateFieldSet",P)}))},62:(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.fromBER=fromBER;r.compareSchema=compareSchema;r.verifySchema=verifySchema;r.fromJSON=fromJSON;r.RawData=r.Repeated=r.Any=r.Choice=r.TIME=r.Duration=r.DateTime=r.TimeOfDay=r.DATE=r.GeneralizedTime=r.UTCTime=r.CharacterString=r.GeneralString=r.VisibleString=r.GraphicString=r.IA5String=r.VideotexString=r.TeletexString=r.PrintableString=r.NumericString=r.UniversalString=r.BmpString=r.RelativeObjectIdentifier=r.Utf8String=r.ObjectIdentifier=r.Enumerated=r.Integer=r.BitString=r.OctetString=r.Null=r.Set=r.Sequence=r.Boolean=r.EndOfContent=r.Constructed=r.Primitive=r.BaseBlock=r.ValueBlock=r.HexBlock=void 0;var i=o(911);function _createForOfIteratorHelper(t,r){var o;if(typeof Symbol==="undefined"||t[Symbol.iterator]==null){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&typeof t.length==="number"){if(o)t=o;var i=0;var a=function F(){};return{s:a,n:function n(){if(i>=t.length)return{done:true};return{done:false,value:t[i++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c=true,l=false,u;return{s:function s(){o=t[Symbol.iterator]()},n:function n(){var t=o.next();c=t.done;return t},e:function e(t){l=true;u=t},f:function f(){try{if(!c&&o.return!=null)o.return()}finally{if(l)throw u}}}}function _unsupportedIterableToArray(t,r){if(!t)return;if(typeof t==="string")return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);if(o==="Object"&&t.constructor)o=t.constructor.name;if(o==="Map"||o==="Set")return Array.from(t);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return _arrayLikeToArray(t,r)}function _arrayLikeToArray(t,r){if(r==null||r>t.length)r=t.length;for(var o=0,i=new Array(r);o<r;o++)i[o]=t[o];return i}const a=[new Uint8Array([1])];const c="0123456789";class LocalBaseBlock{constructor(t={}){this.blockLength=(0,i.getParametersValue)(t,"blockLength",0);this.error=(0,i.getParametersValue)(t,"error","");this.warnings=(0,i.getParametersValue)(t,"warnings",[]);if("valueBeforeDecode"in t)this.valueBeforeDecode=t.valueBeforeDecode.slice(0);else this.valueBeforeDecode=new ArrayBuffer(0)}static blockName(){return"baseBlock"}toJSON(){return{blockName:this.constructor.blockName(),blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:(0,i.bufferToHexCodes)(this.valueBeforeDecode,0,this.valueBeforeDecode.byteLength)}}}const HexBlock=t=>class LocalHexBlockMixin extends t{constructor(t={}){super(t);this.isHexOnly=(0,i.getParametersValue)(t,"isHexOnly",false);if("valueHex"in t)this.valueHex=t.valueHex.slice(0);else this.valueHex=new ArrayBuffer(0)}static blockName(){return"hexBlock"}fromBER(t,r,o){if((0,i.checkBufferParams)(this,t,r,o)===false)return-1;const a=new Uint8Array(t,r,o);if(a.length===0){this.warnings.push("Zero buffer length");return r}this.valueHex=t.slice(r,r+o);this.blockLength=o;return r+o}toBER(t=false){if(this.isHexOnly!==true){this.error='Flag "isHexOnly" is not set, abort';return new ArrayBuffer(0)}if(t===true)return new ArrayBuffer(this.valueHex.byteLength);return this.valueHex.slice(0)}toJSON(){let t={};try{t=super.toJSON()}catch(t){}t.blockName=this.constructor.blockName();t.isHexOnly=this.isHexOnly;t.valueHex=(0,i.bufferToHexCodes)(this.valueHex,0,this.valueHex.byteLength);return t}};r.HexBlock=HexBlock;class LocalIdentificationBlock extends(HexBlock(LocalBaseBlock)){constructor(t={}){super();if("idBlock"in t){this.isHexOnly=(0,i.getParametersValue)(t.idBlock,"isHexOnly",false);this.valueHex=(0,i.getParametersValue)(t.idBlock,"valueHex",new ArrayBuffer(0));this.tagClass=(0,i.getParametersValue)(t.idBlock,"tagClass",-1);this.tagNumber=(0,i.getParametersValue)(t.idBlock,"tagNumber",-1);this.isConstructed=(0,i.getParametersValue)(t.idBlock,"isConstructed",false)}else{this.tagClass=-1;this.tagNumber=-1;this.isConstructed=false}}static blockName(){return"identificationBlock"}toBER(t=false){let r=0;let o;let a;switch(this.tagClass){case 1:r|=0;break;case 2:r|=64;break;case 3:r|=128;break;case 4:r|=192;break;default:this.error="Unknown tag class";return new ArrayBuffer(0)}if(this.isConstructed)r|=32;if(this.tagNumber<31&&!this.isHexOnly){o=new ArrayBuffer(1);a=new Uint8Array(o);if(!t){let t=this.tagNumber;t&=31;r|=t;a[0]=r}return o}if(this.isHexOnly===false){const c=(0,i.utilToBase)(this.tagNumber,7);const l=new Uint8Array(c);const u=c.byteLength;o=new ArrayBuffer(u+1);a=new Uint8Array(o);a[0]=r|31;if(!t){for(let t=0;t<u-1;t++)a[t+1]=l[t]|128;a[u]=l[u-1]}return o}o=new A