@abtnode/webapp 1.7.22 → 1.7.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blocklet.js +4 -4
- package/blocklet.yml +1 -1
- package/build/asset-manifest.json +12 -12
- package/build/index.html +1 -1
- package/build/{precache-manifest.c7904f8a3ca7bf34c5ccdd0da57c632c.js → precache-manifest.afc6e8466a1d4ae99d0ca4d4623ea15a.js} +11 -11
- package/build/service-worker.js +1 -1
- package/build/static/js/{14.9e09c4c7.chunk.js → 14.c54c2862.chunk.js} +2 -2
- package/build/static/js/14.c54c2862.chunk.js.map +1 -0
- package/build/static/js/{9.6c4c68d6.chunk.js → 9.ae6d0fe0.chunk.js} +3 -3
- package/build/static/js/{9.6c4c68d6.chunk.js.LICENSE.txt → 9.ae6d0fe0.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/9.ae6d0fe0.chunk.js.map +1 -0
- package/build/static/js/{main.246289e4.chunk.js → main.f54557e9.chunk.js} +2 -2
- package/build/static/js/{main.246289e4.chunk.js.map → main.f54557e9.chunk.js.map} +1 -1
- package/build/static/js/{runtime-main.cc3c6eff.js → runtime-main.68388efe.js} +2 -2
- package/build/static/js/{runtime-main.cc3c6eff.js.map → runtime-main.68388efe.js.map} +1 -1
- package/package.json +1 -1
- package/build/static/js/14.9e09c4c7.chunk.js.map +0 -1
- package/build/static/js/9.6c4c68d6.chunk.js.map +0 -1
package/blocklet.js
CHANGED
|
@@ -17,7 +17,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
17
17
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
18
18
|
PERFORMANCE OF THIS SOFTWARE.
|
|
19
19
|
***************************************************************************** */
|
|
20
|
-
var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function a(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function s(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function l(e,t){return function(n,r){t(n,r,e)}}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function p(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))}function c(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var d=Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function f(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||d(t,e,n)}function h(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function m(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}function y(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r}function v(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function b(e){return this instanceof b?(this.v=e,this):new b(e)}function _(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||s(e,t)}))})}function s(e,t){try{(n=o[e](t)).value instanceof b?Promise.resolve(n.value.v).then(l,u):p(i[0][2],n)}catch(e){p(i[0][3],e)}var n}function l(e){s("next",e)}function u(e){s("throw",e)}function p(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}function T(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:b(e[r](t)),done:"return"===r}:o?o(t):t}:o}}function E(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=h(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}function S(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var x=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function w(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&d(t,e,n);return x(t,e),t}function A(e){return e&&e.__esModule?e:{default:e}}function k(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function M(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}},function(e,t,n){"use strict";n.d(t,"g",(function(){return E})),n.d(t,"a",(function(){return x})),n.d(t,"b",(function(){return w})),n.d(t,"d",(function(){return k})),n.d(t,"c",(function(){return I})),n.d(t,"i",(function(){return R})),n.d(t,"f",(function(){return V})),n.d(t,"e",(function(){return Y})),n.d(t,"h",(function(){return z}));var r=n(52),o=n(2);var i=n(19),a=n(6),s=n(51),l=n(243),u=n(39),p=n(23);var c=n(32),d=n(3),f=n(247),h=n(1),g=n(154),m=n(13),y=n(15),v=n(0),b=n(33),_=n(246),T=n(127);function E(e,t,n,r,o,i,a,s){return S(1===arguments.length?e:{schema:e,document:t,rootValue:n,contextValue:r,variableValues:o,operationName:i,fieldResolver:a,typeResolver:s})}function S(e){var t=e.schema,n=e.document,r=e.rootValue,o=e.contextValue,i=e.variableValues,a=e.operationName,s=e.fieldResolver,l=e.typeResolver;x(t,n,i);var p=w(t,n,r,o,i,a,s,l);if(Array.isArray(p))return{errors:p};var d=function(e,t,n){var r=Object(_.a)(e.schema,t),o=k(e,r,t.selectionSet,Object.create(null),Object.create(null));try{var i="mutation"===t.operation?function(e,t,n,r,o){return i=Object.keys(o),a=function(i,a){var s=o[a],l=Object(c.a)(r,a),p=D(e,t,n,s,l);return void 0===p?i:Object(u.a)(p)?p.then((function(e){return i[a]=e,i})):(i[a]=p,i)},s=Object.create(null),i.reduce((function(e,t){return Object(u.a)(e)?e.then((function(e){return a(e,t)})):a(e,t)}),s);var i,a,s}(e,r,n,void 0,o):A(e,r,n,void 0,o);return Object(u.a)(i)?i.then(void 0,(function(t){return e.errors.push(t),Promise.resolve(null)})):i}catch(t){return e.errors.push(t),null}}(p,p.operation,r);return function e(t,n){if(Object(u.a)(n))return n.then((function(n){return e(t,n)}));return 0===t.errors.length?{data:n}:{errors:t.errors,data:n}}(p,d)}function x(e,t,n){t||Object(a.a)(0,"Must provide document"),Object(g.a)(e),null==n||Object(p.a)(n)||Object(a.a)(0,"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.")}function w(e,t,n,r,o,i,a,s){for(var l,u=!1,p=Object.create(null),c=0,f=t.definitions;c<f.length;c++){var g=f[c];switch(g.kind){case h.a.OPERATION_DEFINITION:!i&&l?u=!0:(!i||g.name&&g.name.value===i)&&(l=g);break;case h.a.FRAGMENT_DEFINITION:p[g.name.value]=g}}if(!l)return i?[new d.a('Unknown operation named "'.concat(i,'".'))]:[new d.a("Must provide an operation.")];if(u)return[new d.a("Must provide operation name if query contains multiple operations.")];var m=Object(T.c)(e,l.variableDefinitions||[],o||{},{maxErrors:50});return m.errors?m.errors:{schema:e,fragments:p,rootValue:n,contextValue:r,operation:l,variableValues:m.coerced,fieldResolver:a||Y,typeResolver:s||V,errors:[]}}function A(e,t,n,r,o){for(var i=Object.create(null),a=!1,s=0,l=Object.keys(o);s<l.length;s++){var p=l[s],d=D(e,t,n,o[p],Object(c.a)(r,p));void 0!==d&&(i[p]=d,!a&&Object(u.a)(d)&&(a=!0))}return a?function(e){var t=Object.keys(e),n=t.map((function(t){return e[t]}));return Promise.all(n).then((function(e){return e.reduce((function(e,n,r){return e[t[r]]=n,e}),Object.create(null))}))}(i):i}function k(e,t,n,r,o){for(var i=0,a=n.selections;i<a.length;i++){var s=a[i];switch(s.kind){case h.a.FIELD:if(!M(e,s))continue;var l=(c=s).alias?c.alias.value:c.name.value;r[l]||(r[l]=[]),r[l].push(s);break;case h.a.INLINE_FRAGMENT:if(!M(e,s)||!O(e,s,t))continue;k(e,t,s.selectionSet,r,o);break;case h.a.FRAGMENT_SPREAD:var u=s.name.value;if(o[u]||!M(e,s))continue;o[u]=!0;var p=e.fragments[u];if(!p||!O(e,p,t))continue;k(e,t,p.selectionSet,r,o)}}var c;return r}function M(e,t){var n=Object(T.b)(y.e,t,e.variableValues);if(n&&!0===n.if)return!1;var r=Object(T.b)(y.d,t,e.variableValues);return!r||!1!==r.if}function O(e,t,n){var r=t.typeCondition;if(!r)return!0;var o=Object(b.a)(e.schema,r);return o===n||!!Object(v.C)(o)&&e.schema.isPossibleType(o,n)}function D(e,t,n,r,o){var i=r[0].name.value,a=z(e.schema,t,i);if(a){var s=a.resolve||e.fieldResolver,l=I(e,a,r,t,o),u=R(e,a,r,s,n,l);return C(e,a.type,r,l,o,u)}}function I(e,t,n,r,o){return{fieldName:t.name,fieldNodes:n,returnType:t.type,parentType:r,path:o,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function R(e,t,n,r,o,i){try{var a=r(o,Object(T.a)(t,n[0],e.variableValues),e.contextValue,i);return Object(u.a)(a)?a.then(void 0,N):a}catch(e){return N(e)}}function N(e){return e instanceof Error?e:new Error("Unexpected error value: "+Object(o.a)(e))}function C(e,t,n,r,o,i){try{var a;return a=Object(u.a)(i)?i.then((function(i){return L(e,t,n,r,o,i)})):L(e,t,n,r,o,i),Object(u.a)(a)?a.then(void 0,(function(r){return F(r,n,o,t,e)})):a}catch(r){return F(r,n,o,t,e)}}function F(e,t,n,r,o){var i=Object(f.a)(N(e),t,Object(c.b)(n));if(Object(v.L)(r))throw i;return o.errors.push(i),null}function L(e,t,n,a,p,f){if(f instanceof Error)throw f;if(Object(v.L)(t)){var h=L(e,t.ofType,n,a,p,f);if(null===h)throw new Error("Cannot return null for non-nullable field ".concat(a.parentType.name,".").concat(a.fieldName,"."));return h}return Object(l.a)(f)?null:Object(v.J)(t)?function(e,t,n,o,i,a){if(!Object(r.e)(a))throw new d.a("Expected Iterable, but did not find one for field ".concat(o.parentType.name,".").concat(o.fieldName,"."));var s=t.ofType,l=!1,p=[];return Object(r.b)(a,(function(t,r){var a=Object(c.a)(i,r),d=C(e,s,n,o,a,t);!l&&Object(u.a)(d)&&(l=!0),p.push(d)})),l?Promise.all(p):p}(e,t,n,a,p,f):Object(v.I)(t)?function(e,t){var n=e.serialize(t);if(Object(s.a)(n))throw new Error('Expected a value of type "'.concat(Object(o.a)(e),'" but ')+"received: ".concat(Object(o.a)(t)));return n}(t,f):Object(v.C)(t)?function(e,t,n,r,o,i){var a=t.resolveType||e.typeResolver,s=e.contextValue,l=a(i,s,r,t);if(Object(u.a)(l))return l.then((function(a){return B(e,j(a,e,t,n,r,i),n,r,o,i)}));return B(e,j(l,e,t,n,r,i),n,r,o,i)}(e,t,n,a,p,f):Object(v.N)(t)?B(e,t,n,a,p,f):void Object(i.a)(!1,"Cannot complete value of unexpected output type: "+Object(o.a)(t))}function j(e,t,n,r,i,a){var s="string"==typeof e?t.schema.getType(e):e;if(!Object(v.N)(s))throw new d.a("Abstract type ".concat(n.name," must resolve to an Object type at runtime for field ").concat(i.parentType.name,".").concat(i.fieldName," with ")+"value ".concat(Object(o.a)(a),', received "').concat(Object(o.a)(s),'". ')+"Either the ".concat(n.name,' type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.'),r);if(!t.schema.isPossibleType(n,s))throw new d.a('Runtime Object type "'.concat(s.name,'" is not a possible type for "').concat(n.name,'".'),r);return s}function B(e,t,n,r,o,i){if(t.isTypeOf){var a=t.isTypeOf(i,e.contextValue,r);if(Object(u.a)(a))return a.then((function(r){if(!r)throw P(t,i,n);return H(e,t,n,o,i)}));if(!a)throw P(t,i,n)}return H(e,t,n,o,i)}function P(e,t,n){return new d.a('Expected value of type "'.concat(e.name,'" but got: ').concat(Object(o.a)(t),"."),n)}function H(e,t,n,r,o){return A(e,t,o,r,W(e,t,n))}var U,$,W=(U=function(e,t,n){for(var r=Object.create(null),o=Object.create(null),i=0;i<n.length;i++){var a=n[i];a.selectionSet&&(r=k(e,t,a.selectionSet,r,o))}return r},function(e,t,n){$||($=new WeakMap);var r,o=$.get(e);if(o){if(r=o.get(t)){var i=r.get(n);if(void 0!==i)return i}}else o=new WeakMap,$.set(e,o);r||(r=new WeakMap,o.set(t,r));var a=U(e,t,n);return r.set(n,a),a});var V=function(e,t,n,r){if(Object(p.a)(e)&&"string"==typeof e.__typename)return e.__typename;for(var o=n.schema.getPossibleTypes(r),i=[],a=0;a<o.length;a++){var s=o[a];if(s.isTypeOf){var l=s.isTypeOf(e,t,n);if(Object(u.a)(l))i[a]=l;else if(l)return s}}return i.length?Promise.all(i).then((function(e){for(var t=0;t<e.length;t++)if(e[t])return o[t]})):void 0},Y=function(e,t,n,r){if(Object(p.a)(e)||"function"==typeof e){var o=e[r.fieldName];return"function"==typeof o?e[r.fieldName](t,n,r):o}};function z(e,t,n){return n===m.a.name&&e.getQueryType()===t?m.a:n===m.c.name&&e.getQueryType()===t?m.c:n===m.d.name?m.d:t.getFields()[n]}},function(e,t,n){const r=n(45);e.exports=(e,t,n)=>new r(e,n).compare(new r(t,n))},function(e,t,n){class r{constructor(e,t){if(t=i(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!h(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&g(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();const t=`parseRange:${Object.keys(this.options).join(",")}:${e}`,n=o.get(t);if(n)return n;const r=this.options.loose,i=r?u[p.HYPHENRANGELOOSE]:u[p.HYPHENRANGE];e=e.replace(i,k(this.options.includePrerelease)),s("hyphen replace",e),e=e.replace(u[p.COMPARATORTRIM],c),s("comparator trim",e,u[p.COMPARATORTRIM]),e=(e=(e=e.replace(u[p.TILDETRIM],d)).replace(u[p.CARETTRIM],f)).split(/\s+/).join(" ");const l=r?u[p.COMPARATORLOOSE]:u[p.COMPARATOR],g=e.split(" ").map(e=>y(e,this.options)).join(" ").split(/\s+/).map(e=>A(e,this.options)).filter(this.options.loose?e=>!!e.match(l):()=>!0).map(e=>new a(e,this.options)),m=(g.length,new Map);for(const e of g){if(h(e))return[e];m.set(e.value,e)}m.size>1&&m.has("")&&m.delete("");const v=[...m.values()];return o.set(t,v),v}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(n=>m(n,t)&&e.set.some(e=>m(e,t)&&n.every(n=>e.every(e=>n.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(M(this.set[t],e,this.options))return!0;return!1}}e.exports=r;const o=new(n(136))({max:1e3}),i=n(196),a=n(198),s=n(195),l=n(45),{re:u,t:p,comparatorTrimReplace:c,tildeTrimReplace:d,caretTrimReplace:f}=n(134),h=e=>"<0.0.0-0"===e.value,g=e=>""===e.value,m=(e,t)=>{let n=!0;const r=e.slice();let o=r.pop();for(;n&&r.length;)n=r.every(e=>o.intersects(e,t)),o=r.pop();return n},y=(e,t)=>(s("comp",e,t),e=T(e,t),s("caret",e),e=b(e,t),s("tildes",e),e=S(e,t),s("xrange",e),e=w(e,t),s("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,b=(e,t)=>e.trim().split(/\s+/).map(e=>_(e,t)).join(" "),_=(e,t)=>{const n=t.loose?u[p.TILDELOOSE]:u[p.TILDE];return e.replace(n,(t,n,r,o,i)=>{let a;return s("tilde",e,t,n,r,o,i),v(n)?a="":v(r)?a=`>=${n}.0.0 <${+n+1}.0.0-0`:v(o)?a=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:i?(s("replaceTilde pr",i),a=`>=${n}.${r}.${o}-${i} <${n}.${+r+1}.0-0`):a=`>=${n}.${r}.${o} <${n}.${+r+1}.0-0`,s("tilde return",a),a})},T=(e,t)=>e.trim().split(/\s+/).map(e=>E(e,t)).join(" "),E=(e,t)=>{s("caret",e,t);const n=t.loose?u[p.CARETLOOSE]:u[p.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,(t,n,o,i,a)=>{let l;return s("caret",e,t,n,o,i,a),v(n)?l="":v(o)?l=`>=${n}.0.0${r} <${+n+1}.0.0-0`:v(i)?l="0"===n?`>=${n}.${o}.0${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.0${r} <${+n+1}.0.0-0`:a?(s("replaceCaret pr",a),l="0"===n?"0"===o?`>=${n}.${o}.${i}-${a} <${n}.${o}.${+i+1}-0`:`>=${n}.${o}.${i}-${a} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${i}-${a} <${+n+1}.0.0-0`):(s("no pr"),l="0"===n?"0"===o?`>=${n}.${o}.${i}${r} <${n}.${o}.${+i+1}-0`:`>=${n}.${o}.${i}${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${i} <${+n+1}.0.0-0`),s("caret return",l),l})},S=(e,t)=>(s("replaceXRanges",e,t),e.split(/\s+/).map(e=>x(e,t)).join(" ")),x=(e,t)=>{e=e.trim();const n=t.loose?u[p.XRANGELOOSE]:u[p.XRANGE];return e.replace(n,(n,r,o,i,a,l)=>{s("xRange",e,n,r,o,i,a,l);const u=v(o),p=u||v(i),c=p||v(a),d=c;return"="===r&&d&&(r=""),l=t.includePrerelease?"-0":"",u?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(p&&(i=0),a=0,">"===r?(r=">=",p?(o=+o+1,i=0,a=0):(i=+i+1,a=0)):"<="===r&&(r="<",p?o=+o+1:i=+i+1),"<"===r&&(l="-0"),n=`${r+o}.${i}.${a}${l}`):p?n=`>=${o}.0.0${l} <${+o+1}.0.0-0`:c&&(n=`>=${o}.${i}.0${l} <${o}.${+i+1}.0-0`),s("xRange return",n),n})},w=(e,t)=>(s("replaceStars",e,t),e.trim().replace(u[p.STAR],"")),A=(e,t)=>(s("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?p.GTE0PRE:p.GTE0],"")),k=e=>(t,n,r,o,i,a,s,l,u,p,c,d,f)=>`${n=v(r)?"":v(o)?`>=${r}.0.0${e?"-0":""}`:v(i)?`>=${r}.${o}.0${e?"-0":""}`:a?">="+n:`>=${n}${e?"-0":""}`} ${l=v(u)?"":v(p)?`<${+u+1}.0.0-0`:v(c)?`<${u}.${+p+1}.0-0`:d?`<=${u}.${p}.${c}-${d}`:e?`<${u}.${p}.${+c+1}-0`:"<="+l}`.trim(),M=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(s(e[n].semver),e[n].semver!==a.ANY&&e[n].semver.prerelease.length>0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}},function(e,t){var n=Array.isArray;e.exports=n},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){(function(e){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function o(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:n(34).Buffer}catch(e){}function s(e,t){var n=e.charCodeAt(t);return n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function l(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function u(e,t,n,r){for(var o=0,i=Math.min(e.length,n),a=t;a<i;a++){var s=e.charCodeAt(a)-48;o*=r,o+=s>=49?s-49+10:s>=17?s-17+10:s}return o}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<e.length&&(16===t?this._parseHex(e,o,n):(this._parseBase(e,t,o),"le"===n&&this._initArray(this.toArray(),t,n)))},i.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},i.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var i,a,s=0;if("be"===n)for(o=e.length-1,i=0;o>=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<<s&67108863,this.words[i+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===n)for(o=0,i=0;o<e.length;o+=3)a=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[i]|=a<<s&67108863,this.words[i+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var o,i=0,a=0;if("be"===n)for(r=e.length-1;r>=t;r-=2)o=l(e,t,r)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(r=(e.length-t)%2==0?t+1:t;r<e.length;r+=2)o=l(e,t,r)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this.strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,o=1;o<=67108863;o*=t)r++;r--,o=o/t|0;for(var i=e.length-n,a=i%r,s=Math.min(i,i-a)+n,l=0,p=n;p<s;p+=r)l=u(e,p,p+r,t),this.imuln(o),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==a){var c=1;for(l=u(e,p,e.length,t),p=0;p<a;p++)c*=t;this.imuln(c),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this.strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,s=67108863&a,l=a/67108864|0;n.words[0]=s;for(var u=1;u<r;u++){for(var p=l>>>26,c=67108863&l,d=Math.min(u,t.length-1),f=Math.max(0,u-e.length+1);f<=d;f++){var h=u-f|0;p+=(a=(o=0|e.words[h])*(i=0|t.words[f])+c)/67108864|0,c=67108863&a}n.words[u]=0|c,l=0|p}return 0!==l?n.words[u]=0|l:n.length--,n.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,i=0,a=0;a<this.length;a++){var s=this.words[a],l=(16777215&(s<<o|i)).toString(16);n=0!==(i=s>>>24-o&16777215)||a!==this.length-1?p[6-l.length]+l+n:l+n,(o+=2)>=26&&(o-=26,a--)}for(0!==i&&(n=i.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=c[e],f=d[e];n="";var h=this.clone();for(h.negative=0;!h.isZero();){var g=h.modn(f).toString(e);n=(h=h.idivn(f)).isZero()?g+n:p[u-g.length]+g+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==a),this.toArrayLike(a,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var o=this.byteLength(),i=n||Math.max(1,o);r(o<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var a,s,l="le"===t,u=new e(i),p=this.clone();if(l){for(s=0;!p.isZero();s++)a=p.andln(255),p.iushrn(8),u[s]=a;for(;s<i;s++)u[s]=0}else{for(s=0;s<i-o;s++)u[s]=0;for(s=0;!p.isZero();s++)a=p.andln(255),p.iushrn(8),u[i-s-1]=a}return u},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,26!==n)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},i.prototype.ior=function(e){return r(0==(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this.strip()},i.prototype.iand=function(e){return r(0==(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this.strip()},i.prototype.ixor=function(e){return r(0==(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var o=0;o<t;o++)this.words[o]=67108863&~this.words[o];return n>0&&(this.words[o]=~this.words[o]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<o:this.words[n]&~(1<<o),this.strip()},i.prototype.iadd=function(e){var t,n,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(n=this,r=e):(n=e,r=this);for(var o=0,i=0;i<r.length;i++)t=(0|n.words[i])+(0|r.words[i])+o,this.words[i]=67108863&t,o=t>>>26;for(;0!==o&&i<n.length;i++)t=(0|n.words[i])+o,this.words[i]=67108863&t,o=t>>>26;if(this.length=n.length,0!==o)this.words[this.length]=o,this.length++;else if(n!==this)for(;i<n.length;i++)this.words[i]=n.words[i];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a<r.length;a++)i=(t=(0|n.words[a])-(0|r.words[a])+i)>>26,this.words[a]=67108863&t;for(;0!==i&&a<n.length;a++)i=(t=(0|n.words[a])+i)>>26,this.words[a]=67108863&t;if(0===i&&a<n.length&&n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this.length=Math.max(this.length,a),n!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var h=function(e,t,n){var r,o,i,a=e.words,s=t.words,l=n.words,u=0,p=0|a[0],c=8191&p,d=p>>>13,f=0|a[1],h=8191&f,g=f>>>13,m=0|a[2],y=8191&m,v=m>>>13,b=0|a[3],_=8191&b,T=b>>>13,E=0|a[4],S=8191&E,x=E>>>13,w=0|a[5],A=8191&w,k=w>>>13,M=0|a[6],O=8191&M,D=M>>>13,I=0|a[7],R=8191&I,N=I>>>13,C=0|a[8],F=8191&C,L=C>>>13,j=0|a[9],B=8191&j,P=j>>>13,H=0|s[0],U=8191&H,$=H>>>13,W=0|s[1],V=8191&W,Y=W>>>13,z=0|s[2],G=8191&z,q=z>>>13,K=0|s[3],J=8191&K,X=K>>>13,Q=0|s[4],Z=8191&Q,ee=Q>>>13,te=0|s[5],ne=8191&te,re=te>>>13,oe=0|s[6],ie=8191&oe,ae=oe>>>13,se=0|s[7],le=8191&se,ue=se>>>13,pe=0|s[8],ce=8191&pe,de=pe>>>13,fe=0|s[9],he=8191&fe,ge=fe>>>13;n.negative=e.negative^t.negative,n.length=19;var me=(u+(r=Math.imul(c,U))|0)+((8191&(o=(o=Math.imul(c,$))+Math.imul(d,U)|0))<<13)|0;u=((i=Math.imul(d,$))+(o>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(h,U),o=(o=Math.imul(h,$))+Math.imul(g,U)|0,i=Math.imul(g,$);var ye=(u+(r=r+Math.imul(c,V)|0)|0)+((8191&(o=(o=o+Math.imul(c,Y)|0)+Math.imul(d,V)|0))<<13)|0;u=((i=i+Math.imul(d,Y)|0)+(o>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(y,U),o=(o=Math.imul(y,$))+Math.imul(v,U)|0,i=Math.imul(v,$),r=r+Math.imul(h,V)|0,o=(o=o+Math.imul(h,Y)|0)+Math.imul(g,V)|0,i=i+Math.imul(g,Y)|0;var ve=(u+(r=r+Math.imul(c,G)|0)|0)+((8191&(o=(o=o+Math.imul(c,q)|0)+Math.imul(d,G)|0))<<13)|0;u=((i=i+Math.imul(d,q)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(_,U),o=(o=Math.imul(_,$))+Math.imul(T,U)|0,i=Math.imul(T,$),r=r+Math.imul(y,V)|0,o=(o=o+Math.imul(y,Y)|0)+Math.imul(v,V)|0,i=i+Math.imul(v,Y)|0,r=r+Math.imul(h,G)|0,o=(o=o+Math.imul(h,q)|0)+Math.imul(g,G)|0,i=i+Math.imul(g,q)|0;var be=(u+(r=r+Math.imul(c,J)|0)|0)+((8191&(o=(o=o+Math.imul(c,X)|0)+Math.imul(d,J)|0))<<13)|0;u=((i=i+Math.imul(d,X)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(S,U),o=(o=Math.imul(S,$))+Math.imul(x,U)|0,i=Math.imul(x,$),r=r+Math.imul(_,V)|0,o=(o=o+Math.imul(_,Y)|0)+Math.imul(T,V)|0,i=i+Math.imul(T,Y)|0,r=r+Math.imul(y,G)|0,o=(o=o+Math.imul(y,q)|0)+Math.imul(v,G)|0,i=i+Math.imul(v,q)|0,r=r+Math.imul(h,J)|0,o=(o=o+Math.imul(h,X)|0)+Math.imul(g,J)|0,i=i+Math.imul(g,X)|0;var _e=(u+(r=r+Math.imul(c,Z)|0)|0)+((8191&(o=(o=o+Math.imul(c,ee)|0)+Math.imul(d,Z)|0))<<13)|0;u=((i=i+Math.imul(d,ee)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(A,U),o=(o=Math.imul(A,$))+Math.imul(k,U)|0,i=Math.imul(k,$),r=r+Math.imul(S,V)|0,o=(o=o+Math.imul(S,Y)|0)+Math.imul(x,V)|0,i=i+Math.imul(x,Y)|0,r=r+Math.imul(_,G)|0,o=(o=o+Math.imul(_,q)|0)+Math.imul(T,G)|0,i=i+Math.imul(T,q)|0,r=r+Math.imul(y,J)|0,o=(o=o+Math.imul(y,X)|0)+Math.imul(v,J)|0,i=i+Math.imul(v,X)|0,r=r+Math.imul(h,Z)|0,o=(o=o+Math.imul(h,ee)|0)+Math.imul(g,Z)|0,i=i+Math.imul(g,ee)|0;var Te=(u+(r=r+Math.imul(c,ne)|0)|0)+((8191&(o=(o=o+Math.imul(c,re)|0)+Math.imul(d,ne)|0))<<13)|0;u=((i=i+Math.imul(d,re)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(O,U),o=(o=Math.imul(O,$))+Math.imul(D,U)|0,i=Math.imul(D,$),r=r+Math.imul(A,V)|0,o=(o=o+Math.imul(A,Y)|0)+Math.imul(k,V)|0,i=i+Math.imul(k,Y)|0,r=r+Math.imul(S,G)|0,o=(o=o+Math.imul(S,q)|0)+Math.imul(x,G)|0,i=i+Math.imul(x,q)|0,r=r+Math.imul(_,J)|0,o=(o=o+Math.imul(_,X)|0)+Math.imul(T,J)|0,i=i+Math.imul(T,X)|0,r=r+Math.imul(y,Z)|0,o=(o=o+Math.imul(y,ee)|0)+Math.imul(v,Z)|0,i=i+Math.imul(v,ee)|0,r=r+Math.imul(h,ne)|0,o=(o=o+Math.imul(h,re)|0)+Math.imul(g,ne)|0,i=i+Math.imul(g,re)|0;var Ee=(u+(r=r+Math.imul(c,ie)|0)|0)+((8191&(o=(o=o+Math.imul(c,ae)|0)+Math.imul(d,ie)|0))<<13)|0;u=((i=i+Math.imul(d,ae)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(R,U),o=(o=Math.imul(R,$))+Math.imul(N,U)|0,i=Math.imul(N,$),r=r+Math.imul(O,V)|0,o=(o=o+Math.imul(O,Y)|0)+Math.imul(D,V)|0,i=i+Math.imul(D,Y)|0,r=r+Math.imul(A,G)|0,o=(o=o+Math.imul(A,q)|0)+Math.imul(k,G)|0,i=i+Math.imul(k,q)|0,r=r+Math.imul(S,J)|0,o=(o=o+Math.imul(S,X)|0)+Math.imul(x,J)|0,i=i+Math.imul(x,X)|0,r=r+Math.imul(_,Z)|0,o=(o=o+Math.imul(_,ee)|0)+Math.imul(T,Z)|0,i=i+Math.imul(T,ee)|0,r=r+Math.imul(y,ne)|0,o=(o=o+Math.imul(y,re)|0)+Math.imul(v,ne)|0,i=i+Math.imul(v,re)|0,r=r+Math.imul(h,ie)|0,o=(o=o+Math.imul(h,ae)|0)+Math.imul(g,ie)|0,i=i+Math.imul(g,ae)|0;var Se=(u+(r=r+Math.imul(c,le)|0)|0)+((8191&(o=(o=o+Math.imul(c,ue)|0)+Math.imul(d,le)|0))<<13)|0;u=((i=i+Math.imul(d,ue)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(F,U),o=(o=Math.imul(F,$))+Math.imul(L,U)|0,i=Math.imul(L,$),r=r+Math.imul(R,V)|0,o=(o=o+Math.imul(R,Y)|0)+Math.imul(N,V)|0,i=i+Math.imul(N,Y)|0,r=r+Math.imul(O,G)|0,o=(o=o+Math.imul(O,q)|0)+Math.imul(D,G)|0,i=i+Math.imul(D,q)|0,r=r+Math.imul(A,J)|0,o=(o=o+Math.imul(A,X)|0)+Math.imul(k,J)|0,i=i+Math.imul(k,X)|0,r=r+Math.imul(S,Z)|0,o=(o=o+Math.imul(S,ee)|0)+Math.imul(x,Z)|0,i=i+Math.imul(x,ee)|0,r=r+Math.imul(_,ne)|0,o=(o=o+Math.imul(_,re)|0)+Math.imul(T,ne)|0,i=i+Math.imul(T,re)|0,r=r+Math.imul(y,ie)|0,o=(o=o+Math.imul(y,ae)|0)+Math.imul(v,ie)|0,i=i+Math.imul(v,ae)|0,r=r+Math.imul(h,le)|0,o=(o=o+Math.imul(h,ue)|0)+Math.imul(g,le)|0,i=i+Math.imul(g,ue)|0;var xe=(u+(r=r+Math.imul(c,ce)|0)|0)+((8191&(o=(o=o+Math.imul(c,de)|0)+Math.imul(d,ce)|0))<<13)|0;u=((i=i+Math.imul(d,de)|0)+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(B,U),o=(o=Math.imul(B,$))+Math.imul(P,U)|0,i=Math.imul(P,$),r=r+Math.imul(F,V)|0,o=(o=o+Math.imul(F,Y)|0)+Math.imul(L,V)|0,i=i+Math.imul(L,Y)|0,r=r+Math.imul(R,G)|0,o=(o=o+Math.imul(R,q)|0)+Math.imul(N,G)|0,i=i+Math.imul(N,q)|0,r=r+Math.imul(O,J)|0,o=(o=o+Math.imul(O,X)|0)+Math.imul(D,J)|0,i=i+Math.imul(D,X)|0,r=r+Math.imul(A,Z)|0,o=(o=o+Math.imul(A,ee)|0)+Math.imul(k,Z)|0,i=i+Math.imul(k,ee)|0,r=r+Math.imul(S,ne)|0,o=(o=o+Math.imul(S,re)|0)+Math.imul(x,ne)|0,i=i+Math.imul(x,re)|0,r=r+Math.imul(_,ie)|0,o=(o=o+Math.imul(_,ae)|0)+Math.imul(T,ie)|0,i=i+Math.imul(T,ae)|0,r=r+Math.imul(y,le)|0,o=(o=o+Math.imul(y,ue)|0)+Math.imul(v,le)|0,i=i+Math.imul(v,ue)|0,r=r+Math.imul(h,ce)|0,o=(o=o+Math.imul(h,de)|0)+Math.imul(g,ce)|0,i=i+Math.imul(g,de)|0;var we=(u+(r=r+Math.imul(c,he)|0)|0)+((8191&(o=(o=o+Math.imul(c,ge)|0)+Math.imul(d,he)|0))<<13)|0;u=((i=i+Math.imul(d,ge)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(B,V),o=(o=Math.imul(B,Y))+Math.imul(P,V)|0,i=Math.imul(P,Y),r=r+Math.imul(F,G)|0,o=(o=o+Math.imul(F,q)|0)+Math.imul(L,G)|0,i=i+Math.imul(L,q)|0,r=r+Math.imul(R,J)|0,o=(o=o+Math.imul(R,X)|0)+Math.imul(N,J)|0,i=i+Math.imul(N,X)|0,r=r+Math.imul(O,Z)|0,o=(o=o+Math.imul(O,ee)|0)+Math.imul(D,Z)|0,i=i+Math.imul(D,ee)|0,r=r+Math.imul(A,ne)|0,o=(o=o+Math.imul(A,re)|0)+Math.imul(k,ne)|0,i=i+Math.imul(k,re)|0,r=r+Math.imul(S,ie)|0,o=(o=o+Math.imul(S,ae)|0)+Math.imul(x,ie)|0,i=i+Math.imul(x,ae)|0,r=r+Math.imul(_,le)|0,o=(o=o+Math.imul(_,ue)|0)+Math.imul(T,le)|0,i=i+Math.imul(T,ue)|0,r=r+Math.imul(y,ce)|0,o=(o=o+Math.imul(y,de)|0)+Math.imul(v,ce)|0,i=i+Math.imul(v,de)|0;var Ae=(u+(r=r+Math.imul(h,he)|0)|0)+((8191&(o=(o=o+Math.imul(h,ge)|0)+Math.imul(g,he)|0))<<13)|0;u=((i=i+Math.imul(g,ge)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(B,G),o=(o=Math.imul(B,q))+Math.imul(P,G)|0,i=Math.imul(P,q),r=r+Math.imul(F,J)|0,o=(o=o+Math.imul(F,X)|0)+Math.imul(L,J)|0,i=i+Math.imul(L,X)|0,r=r+Math.imul(R,Z)|0,o=(o=o+Math.imul(R,ee)|0)+Math.imul(N,Z)|0,i=i+Math.imul(N,ee)|0,r=r+Math.imul(O,ne)|0,o=(o=o+Math.imul(O,re)|0)+Math.imul(D,ne)|0,i=i+Math.imul(D,re)|0,r=r+Math.imul(A,ie)|0,o=(o=o+Math.imul(A,ae)|0)+Math.imul(k,ie)|0,i=i+Math.imul(k,ae)|0,r=r+Math.imul(S,le)|0,o=(o=o+Math.imul(S,ue)|0)+Math.imul(x,le)|0,i=i+Math.imul(x,ue)|0,r=r+Math.imul(_,ce)|0,o=(o=o+Math.imul(_,de)|0)+Math.imul(T,ce)|0,i=i+Math.imul(T,de)|0;var ke=(u+(r=r+Math.imul(y,he)|0)|0)+((8191&(o=(o=o+Math.imul(y,ge)|0)+Math.imul(v,he)|0))<<13)|0;u=((i=i+Math.imul(v,ge)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(B,J),o=(o=Math.imul(B,X))+Math.imul(P,J)|0,i=Math.imul(P,X),r=r+Math.imul(F,Z)|0,o=(o=o+Math.imul(F,ee)|0)+Math.imul(L,Z)|0,i=i+Math.imul(L,ee)|0,r=r+Math.imul(R,ne)|0,o=(o=o+Math.imul(R,re)|0)+Math.imul(N,ne)|0,i=i+Math.imul(N,re)|0,r=r+Math.imul(O,ie)|0,o=(o=o+Math.imul(O,ae)|0)+Math.imul(D,ie)|0,i=i+Math.imul(D,ae)|0,r=r+Math.imul(A,le)|0,o=(o=o+Math.imul(A,ue)|0)+Math.imul(k,le)|0,i=i+Math.imul(k,ue)|0,r=r+Math.imul(S,ce)|0,o=(o=o+Math.imul(S,de)|0)+Math.imul(x,ce)|0,i=i+Math.imul(x,de)|0;var Me=(u+(r=r+Math.imul(_,he)|0)|0)+((8191&(o=(o=o+Math.imul(_,ge)|0)+Math.imul(T,he)|0))<<13)|0;u=((i=i+Math.imul(T,ge)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(B,Z),o=(o=Math.imul(B,ee))+Math.imul(P,Z)|0,i=Math.imul(P,ee),r=r+Math.imul(F,ne)|0,o=(o=o+Math.imul(F,re)|0)+Math.imul(L,ne)|0,i=i+Math.imul(L,re)|0,r=r+Math.imul(R,ie)|0,o=(o=o+Math.imul(R,ae)|0)+Math.imul(N,ie)|0,i=i+Math.imul(N,ae)|0,r=r+Math.imul(O,le)|0,o=(o=o+Math.imul(O,ue)|0)+Math.imul(D,le)|0,i=i+Math.imul(D,ue)|0,r=r+Math.imul(A,ce)|0,o=(o=o+Math.imul(A,de)|0)+Math.imul(k,ce)|0,i=i+Math.imul(k,de)|0;var Oe=(u+(r=r+Math.imul(S,he)|0)|0)+((8191&(o=(o=o+Math.imul(S,ge)|0)+Math.imul(x,he)|0))<<13)|0;u=((i=i+Math.imul(x,ge)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(B,ne),o=(o=Math.imul(B,re))+Math.imul(P,ne)|0,i=Math.imul(P,re),r=r+Math.imul(F,ie)|0,o=(o=o+Math.imul(F,ae)|0)+Math.imul(L,ie)|0,i=i+Math.imul(L,ae)|0,r=r+Math.imul(R,le)|0,o=(o=o+Math.imul(R,ue)|0)+Math.imul(N,le)|0,i=i+Math.imul(N,ue)|0,r=r+Math.imul(O,ce)|0,o=(o=o+Math.imul(O,de)|0)+Math.imul(D,ce)|0,i=i+Math.imul(D,de)|0;var De=(u+(r=r+Math.imul(A,he)|0)|0)+((8191&(o=(o=o+Math.imul(A,ge)|0)+Math.imul(k,he)|0))<<13)|0;u=((i=i+Math.imul(k,ge)|0)+(o>>>13)|0)+(De>>>26)|0,De&=67108863,r=Math.imul(B,ie),o=(o=Math.imul(B,ae))+Math.imul(P,ie)|0,i=Math.imul(P,ae),r=r+Math.imul(F,le)|0,o=(o=o+Math.imul(F,ue)|0)+Math.imul(L,le)|0,i=i+Math.imul(L,ue)|0,r=r+Math.imul(R,ce)|0,o=(o=o+Math.imul(R,de)|0)+Math.imul(N,ce)|0,i=i+Math.imul(N,de)|0;var Ie=(u+(r=r+Math.imul(O,he)|0)|0)+((8191&(o=(o=o+Math.imul(O,ge)|0)+Math.imul(D,he)|0))<<13)|0;u=((i=i+Math.imul(D,ge)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(B,le),o=(o=Math.imul(B,ue))+Math.imul(P,le)|0,i=Math.imul(P,ue),r=r+Math.imul(F,ce)|0,o=(o=o+Math.imul(F,de)|0)+Math.imul(L,ce)|0,i=i+Math.imul(L,de)|0;var Re=(u+(r=r+Math.imul(R,he)|0)|0)+((8191&(o=(o=o+Math.imul(R,ge)|0)+Math.imul(N,he)|0))<<13)|0;u=((i=i+Math.imul(N,ge)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(B,ce),o=(o=Math.imul(B,de))+Math.imul(P,ce)|0,i=Math.imul(P,de);var Ne=(u+(r=r+Math.imul(F,he)|0)|0)+((8191&(o=(o=o+Math.imul(F,ge)|0)+Math.imul(L,he)|0))<<13)|0;u=((i=i+Math.imul(L,ge)|0)+(o>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Ce=(u+(r=Math.imul(B,he))|0)+((8191&(o=(o=Math.imul(B,ge))+Math.imul(P,he)|0))<<13)|0;return u=((i=Math.imul(P,ge))+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,l[0]=me,l[1]=ye,l[2]=ve,l[3]=be,l[4]=_e,l[5]=Te,l[6]=Ee,l[7]=Se,l[8]=xe,l[9]=we,l[10]=Ae,l[11]=ke,l[12]=Me,l[13]=Oe,l[14]=De,l[15]=Ie,l[16]=Re,l[17]=Ne,l[18]=Ce,0!==u&&(l[19]=u,n.length++),n};function g(e,t,n){return(new m).mulp(e,t,n)}function m(e,t){this.x=e,this.y=t}Math.imul||(h=f),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?h(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,o=0,i=0;i<n.length-1;i++){var a=o;o=0;for(var s=67108863&r,l=Math.min(i,t.length-1),u=Math.max(0,i-e.length+1);u<=l;u++){var p=i-u,c=(0|e.words[p])*(0|t.words[u]),d=67108863&c;s=67108863&(d=d+s|0),o+=(a=(a=a+(c/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}n.words[i]=s,r=a,a=o}return 0!==r?n.words[i]=r:n.length--,n.strip()}(this,e,t):g(this,e,t)},m.prototype.makeRBT=function(e){for(var t=new Array(e),n=i.prototype._countBits(e)-1,r=0;r<e;r++)t[r]=this.revBin(r,n,e);return t},m.prototype.revBin=function(e,t,n){if(0===e||e===n-1)return e;for(var r=0,o=0;o<t;o++)r|=(1&e)<<t-o-1,e>>=1;return r},m.prototype.permute=function(e,t,n,r,o,i){for(var a=0;a<i;a++)r[a]=t[e[a]],o[a]=n[e[a]]},m.prototype.transform=function(e,t,n,r,o,i){this.permute(i,e,t,n,r,o);for(var a=1;a<o;a<<=1)for(var s=a<<1,l=Math.cos(2*Math.PI/s),u=Math.sin(2*Math.PI/s),p=0;p<o;p+=s)for(var c=l,d=u,f=0;f<a;f++){var h=n[p+f],g=r[p+f],m=n[p+f+a],y=r[p+f+a],v=c*m-d*y;y=c*y+d*m,m=v,n[p+f]=h+m,r[p+f]=g+y,n[p+f+a]=h-m,r[p+f+a]=g-y,f!==s&&(v=l*c-u*d,d=l*d+u*c,c=v)}},m.prototype.guessLen13b=function(e,t){var n=1|Math.max(t,e),r=1&n,o=0;for(n=n/2|0;n;n>>>=1)o++;return 1<<o+1+r},m.prototype.conjugate=function(e,t,n){if(!(n<=1))for(var r=0;r<n/2;r++){var o=e[r];e[r]=e[n-r-1],e[n-r-1]=o,o=t[r],t[r]=-t[n-r-1],t[n-r-1]=-o}},m.prototype.normalize13b=function(e,t){for(var n=0,r=0;r<t/2;r++){var o=8192*Math.round(e[2*r+1]/t)+Math.round(e[2*r]/t)+n;e[r]=67108863&o,n=o<67108864?0:o/67108864|0}return e},m.prototype.convert13b=function(e,t,n,o){for(var i=0,a=0;a<t;a++)i+=0|e[a],n[2*a]=8191&i,i>>>=13,n[2*a+1]=8191&i,i>>>=13;for(a=2*t;a<o;++a)n[a]=0;r(0===i),r(0==(-8192&i))},m.prototype.stub=function(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=0;return t},m.prototype.mulp=function(e,t,n){var r=2*this.guessLen13b(e.length,t.length),o=this.makeRBT(r),i=this.stub(r),a=new Array(r),s=new Array(r),l=new Array(r),u=new Array(r),p=new Array(r),c=new Array(r),d=n.words;d.length=r,this.convert13b(e.words,e.length,a,r),this.convert13b(t.words,t.length,u,r),this.transform(a,i,s,l,r,o),this.transform(u,i,p,c,r,o);for(var f=0;f<r;f++){var h=s[f]*p[f]-l[f]*c[f];l[f]=s[f]*c[f]+l[f]*p[f],s[f]=h}return this.conjugate(s,l,r),this.transform(s,l,d,i,r,o),this.conjugate(d,i,r),this.normalize13b(d,r),n.negative=e.negative^t.negative,n.length=e.length+t.length,n.strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),g(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,n=0;n<this.length;n++){var o=(0|this.words[n])*e,i=(67108863&o)+(67108863&t);t>>=26,t+=o/67108864|0,t+=i>>>26,this.words[n]=67108863&i}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n<t.length;n++){var r=n/26|0,o=n%26;t[n]=(e.words[r]&1<<o)>>>o}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r<t.length&&0===t[r];r++,n=n.sqr());if(++r<t.length)for(var o=n.sqr();r<t.length;r++,o=o.sqr())0!==t[r]&&(n=n.mul(o));return n},i.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,n=e%26,o=(e-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&i,l=(0|this.words[t])-s<<n;this.words[t]=l|a,a=s>>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t<o;t++)this.words[t]=0;this.length+=o}return this.strip()},i.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,n){var o;r("number"==typeof e&&e>=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<<i,l=n;if(o-=a,o=Math.max(0,o),l){for(var u=0;u<a;u++)l.words[u]=this.words[u];l.length=a}if(0===a);else if(this.length>a)for(this.length-=a,u=0;u<this.length;u++)this.words[u]=this.words[u+a];else this.words[0]=0,this.length=1;var p=0;for(u=this.length-1;u>=0&&(0!==p||u>=o);u--){var c=0|this.words[u];this.words[u]=p<<26-i|c>>>i,p=c&s}return l&&0!==p&&(l.words[l.length++]=p),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,o=1<<t;return!(this.length<=n)&&!!(this.words[n]&o)},i.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var o=67108863^67108863>>>t<<t;this.words[this.length-1]&=o}return this.strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,n){var o,i,a=e.length+n;this._expand(a);var s=0;for(o=0;o<e.length;o++){i=(0|this.words[o+n])+s;var l=(0|e.words[o])*t;s=((i-=67108863&l)>>26)-(l/67108864|0),this.words[o+n]=67108863&i}for(;o<this.length-n;o++)s=(i=(0|this.words[o+n])+s)>>26,this.words[o+n]=67108863&i;if(0===s)return this.strip();for(r(-1===s),s=0,o=0;o<this.length;o++)s=(i=-(0|this.words[o])+s)>>26,this.words[o]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!==(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,l=r.length-o.length;if("mod"!==t){(s=new i(null)).length=l+1,s.words=new Array(s.length);for(var u=0;u<s.length;u++)s.words[u]=0}var p=r.clone()._ishlnsubmul(o,1,l);0===p.negative&&(r=p,s&&(s.words[l]=1));for(var c=l-1;c>=0;c--){var d=67108864*(0|r.words[o.length+c])+(0|r.words[o.length+c-1]);for(d=Math.min(d/a|0,67108863),r._ishlnsubmul(o,d,c);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(o,1,c),r.isZero()||(r.negative^=1);s&&(s.words[c]=d)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),o=e.andln(1),i=n.cmp(r);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,o=this.length-1;o>=0;o--)n=(t*n+(0|this.words[o]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*t;this.words[n]=o/e|0,t=o%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),l=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var p=n.clone(),c=t.clone();!t.isZero();){for(var d=0,f=1;0==(t.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(p),a.isub(c)),o.iushrn(1),a.iushrn(1);for(var h=0,g=1;0==(n.words[0]&g)&&h<26;++h,g<<=1);if(h>0)for(n.iushrn(h);h-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(p),l.isub(c)),s.iushrn(1),l.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(l)):(n.isub(t),s.isub(o),l.isub(a))}return{a:s,b:l,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),l=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,p=1;0==(t.words[0]&p)&&u<26;++u,p<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(l),a.iushrn(1);for(var c=0,d=1;0==(n.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(n.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var o=t.cmp(n);if(o<0){var i=t;t=n,n=i}else if(0===o||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,o=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=o,this;for(var i=o,a=n;0!==i&&a<this.length;a++){var s=0|this.words[a];i=(s+=i)>>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:o<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],o=0|e.words[n];if(r!==o){r<o?t=-1:r>o&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new S(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function T(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function x(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},o(b,v),b.prototype.split=function(e,t){for(var n=Math.min(e.length,9),r=0;r<n;r++)t.words[r]=e.words[r];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=4194303&o,r=10;r<e.length;r++){var i=0|e.words[r];e.words[r-10]=(4194303&i)<<4|o>>>22,o=i}o>>>=22,e.words[r-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n<e.length;n++){var r=0|e.words[n];t+=977*r,e.words[n]=67108863&t,t=64*r+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},o(_,v),o(T,v),o(E,v),E.prototype.imulK=function(e){for(var t=0,n=0;n<e.length;n++){var r=19*(0|e.words[n])+t,o=67108863&r;r>>>=26,e.words[n]=o,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new _;else if("p192"===e)t=new T;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return y[e]=t,t},S.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},S.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),l=s.redNeg(),u=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new i(2*p*p).toRed(this);0!==this.pow(p,u).cmp(l);)p.redIAdd(l);for(var c=this.pow(p,o),d=this.pow(e,o.addn(1).iushrn(1)),f=this.pow(e,o),h=a;0!==f.cmp(s);){for(var g=f,m=0;0!==g.cmp(s);m++)g=g.redSqr();r(m<h);var y=this.pow(c,new i(1).iushln(h-m-1));d=d.redMul(y),c=y.redSqr(),f=f.redMul(c),h=m}return d},S.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},S.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var n=new Array(16);n[0]=new i(1).toRed(this),n[1]=e;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],e);var o=n[0],a=0,s=0,l=t.bitLength()%26;for(0===l&&(l=26),r=t.length-1;r>=0;r--){for(var u=t.words[r],p=l-1;p>=0;p--){var c=u>>p&1;o!==n[0]&&(o=this.sqr(o)),0!==c||0!==a?(a<<=1,a|=c,(4===++s||0===r&&0===p)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}l=26}return o},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new x(e)},o(x,S),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,n(95)(e))},function(e,t,n){const r=n(47);e.exports=(e,t,n)=>new r(e,n).compare(new r(t,n))},function(e,t,n){class r{constructor(e,t){if(t=i(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!h(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&g(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();const t=`parseRange:${Object.keys(this.options).join(",")}:${e}`,n=o.get(t);if(n)return n;const r=this.options.loose,i=r?u[p.HYPHENRANGELOOSE]:u[p.HYPHENRANGE];e=e.replace(i,k(this.options.includePrerelease)),s("hyphen replace",e),e=e.replace(u[p.COMPARATORTRIM],c),s("comparator trim",e,u[p.COMPARATORTRIM]),e=(e=(e=e.replace(u[p.TILDETRIM],d)).replace(u[p.CARETTRIM],f)).split(/\s+/).join(" ");const l=r?u[p.COMPARATORLOOSE]:u[p.COMPARATOR],g=e.split(" ").map(e=>y(e,this.options)).join(" ").split(/\s+/).map(e=>A(e,this.options)).filter(this.options.loose?e=>!!e.match(l):()=>!0).map(e=>new a(e,this.options)),m=(g.length,new Map);for(const e of g){if(h(e))return[e];m.set(e.value,e)}m.size>1&&m.has("")&&m.delete("");const v=[...m.values()];return o.set(t,v),v}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(n=>m(n,t)&&e.set.some(e=>m(e,t)&&n.every(n=>e.every(e=>n.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(M(this.set[t],e,this.options))return!0;return!1}}e.exports=r;const o=new(n(136))({max:1e3}),i=n(221),a=n(223),s=n(220),l=n(47),{re:u,t:p,comparatorTrimReplace:c,tildeTrimReplace:d,caretTrimReplace:f}=n(142),h=e=>"<0.0.0-0"===e.value,g=e=>""===e.value,m=(e,t)=>{let n=!0;const r=e.slice();let o=r.pop();for(;n&&r.length;)n=r.every(e=>o.intersects(e,t)),o=r.pop();return n},y=(e,t)=>(s("comp",e,t),e=T(e,t),s("caret",e),e=b(e,t),s("tildes",e),e=S(e,t),s("xrange",e),e=w(e,t),s("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,b=(e,t)=>e.trim().split(/\s+/).map(e=>_(e,t)).join(" "),_=(e,t)=>{const n=t.loose?u[p.TILDELOOSE]:u[p.TILDE];return e.replace(n,(t,n,r,o,i)=>{let a;return s("tilde",e,t,n,r,o,i),v(n)?a="":v(r)?a=`>=${n}.0.0 <${+n+1}.0.0-0`:v(o)?a=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:i?(s("replaceTilde pr",i),a=`>=${n}.${r}.${o}-${i} <${n}.${+r+1}.0-0`):a=`>=${n}.${r}.${o} <${n}.${+r+1}.0-0`,s("tilde return",a),a})},T=(e,t)=>e.trim().split(/\s+/).map(e=>E(e,t)).join(" "),E=(e,t)=>{s("caret",e,t);const n=t.loose?u[p.CARETLOOSE]:u[p.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,(t,n,o,i,a)=>{let l;return s("caret",e,t,n,o,i,a),v(n)?l="":v(o)?l=`>=${n}.0.0${r} <${+n+1}.0.0-0`:v(i)?l="0"===n?`>=${n}.${o}.0${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.0${r} <${+n+1}.0.0-0`:a?(s("replaceCaret pr",a),l="0"===n?"0"===o?`>=${n}.${o}.${i}-${a} <${n}.${o}.${+i+1}-0`:`>=${n}.${o}.${i}-${a} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${i}-${a} <${+n+1}.0.0-0`):(s("no pr"),l="0"===n?"0"===o?`>=${n}.${o}.${i}${r} <${n}.${o}.${+i+1}-0`:`>=${n}.${o}.${i}${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${i} <${+n+1}.0.0-0`),s("caret return",l),l})},S=(e,t)=>(s("replaceXRanges",e,t),e.split(/\s+/).map(e=>x(e,t)).join(" ")),x=(e,t)=>{e=e.trim();const n=t.loose?u[p.XRANGELOOSE]:u[p.XRANGE];return e.replace(n,(n,r,o,i,a,l)=>{s("xRange",e,n,r,o,i,a,l);const u=v(o),p=u||v(i),c=p||v(a),d=c;return"="===r&&d&&(r=""),l=t.includePrerelease?"-0":"",u?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(p&&(i=0),a=0,">"===r?(r=">=",p?(o=+o+1,i=0,a=0):(i=+i+1,a=0)):"<="===r&&(r="<",p?o=+o+1:i=+i+1),"<"===r&&(l="-0"),n=`${r+o}.${i}.${a}${l}`):p?n=`>=${o}.0.0${l} <${+o+1}.0.0-0`:c&&(n=`>=${o}.${i}.0${l} <${o}.${+i+1}.0-0`),s("xRange return",n),n})},w=(e,t)=>(s("replaceStars",e,t),e.trim().replace(u[p.STAR],"")),A=(e,t)=>(s("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?p.GTE0PRE:p.GTE0],"")),k=e=>(t,n,r,o,i,a,s,l,u,p,c,d,f)=>`${n=v(r)?"":v(o)?`>=${r}.0.0${e?"-0":""}`:v(i)?`>=${r}.${o}.0${e?"-0":""}`:a?">="+n:`>=${n}${e?"-0":""}`} ${l=v(u)?"":v(p)?`<${+u+1}.0.0-0`:v(c)?`<${u}.${+p+1}.0-0`:d?`<=${u}.${p}.${c}-${d}`:e?`<${u}.${p}.${+c+1}-0`:"<="+l}`.trim(),M=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(s(e[n].semver),e[n].semver!==a.ANY&&e[n].semver.prerelease.length>0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}},function(e,t,n){"use strict";const r=n(16),o=n(1332),i=n(22),a=n(176);e.exports=o.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(e,t){return r("function"==typeof e,"Method must be a function"),r(void 0===t||t&&"string"==typeof t,"Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:e,description:t}})},validate(e,t,{method:n}){try{return n(e,t)}catch(e){return t.error("any.custom",{error:e})}},args:["method","description"],multi:!0},messages:{method(e){return this.prefs({messages:e})}},shared:{method(e){r(i.isSchema(e)&&e._flags.id,"Schema must be a schema with an id");const t=this.clone();return t.$_terms.shared=t.$_terms.shared||[],t.$_terms.shared.push(e),t.$_mutateRegister(e),t}},warning:{method(e,t){return r(e&&"string"==typeof e,"Invalid warning code"),this.$_addRule({name:"warning",args:{code:e,local:t},warn:!0})},validate:(e,t,{code:n,local:r})=>t.error(n,r),args:["code","local"],multi:!0}},modifiers:{keep(e,t=!0){e.keep=t},message(e,t){e.message=a.compile(t)},warn(e,t=!0){e.warn=t}},manifest:{build(e,t){for(const n in t){const r=t[n];if(["examples","externals","metas","notes","tags"].includes(n))for(const t of r)e=e[n.slice(0,-1)](t);else if("alterations"!==n)if("whens"!==n){if("shared"===n)for(const t of r)e=e.shared(t)}else for(const t of r){const{ref:n,is:r,not:o,then:i,otherwise:a,concat:s}=t;e=s?e.concat(s):n?e.when(n,{is:r,not:o,then:i,otherwise:a,switch:t.switch,break:t.break}):e.when(r,{then:i,otherwise:a,break:t.break})}else{const t={};for(const{target:e,adjuster:n}of r)t[e]=n;e=e.alter(t)}}return e}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},function(e,t,n){const r=n(49);e.exports=(e,t,n)=>new r(e,n).compare(new r(t,n))},function(e,t,n){class r{constructor(e,t){if(t=i(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!h(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&g(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();const t=`parseRange:${Object.keys(this.options).join(",")}:${e}`,n=o.get(t);if(n)return n;const r=this.options.loose,i=r?u[p.HYPHENRANGELOOSE]:u[p.HYPHENRANGE];e=e.replace(i,k(this.options.includePrerelease)),s("hyphen replace",e),e=e.replace(u[p.COMPARATORTRIM],c),s("comparator trim",e,u[p.COMPARATORTRIM]),e=(e=(e=e.replace(u[p.TILDETRIM],d)).replace(u[p.CARETTRIM],f)).split(/\s+/).join(" ");const l=r?u[p.COMPARATORLOOSE]:u[p.COMPARATOR],g=e.split(" ").map(e=>y(e,this.options)).join(" ").split(/\s+/).map(e=>A(e,this.options)).filter(this.options.loose?e=>!!e.match(l):()=>!0).map(e=>new a(e,this.options)),m=(g.length,new Map);for(const e of g){if(h(e))return[e];m.set(e.value,e)}m.size>1&&m.has("")&&m.delete("");const v=[...m.values()];return o.set(t,v),v}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(n=>m(n,t)&&e.set.some(e=>m(e,t)&&n.every(n=>e.every(e=>n.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(M(this.set[t],e,this.options))return!0;return!1}}e.exports=r;const o=new(n(136))({max:1e3}),i=n(239),a=n(241),s=n(238),l=n(49),{re:u,t:p,comparatorTrimReplace:c,tildeTrimReplace:d,caretTrimReplace:f}=n(152),h=e=>"<0.0.0-0"===e.value,g=e=>""===e.value,m=(e,t)=>{let n=!0;const r=e.slice();let o=r.pop();for(;n&&r.length;)n=r.every(e=>o.intersects(e,t)),o=r.pop();return n},y=(e,t)=>(s("comp",e,t),e=T(e,t),s("caret",e),e=b(e,t),s("tildes",e),e=S(e,t),s("xrange",e),e=w(e,t),s("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,b=(e,t)=>e.trim().split(/\s+/).map(e=>_(e,t)).join(" "),_=(e,t)=>{const n=t.loose?u[p.TILDELOOSE]:u[p.TILDE];return e.replace(n,(t,n,r,o,i)=>{let a;return s("tilde",e,t,n,r,o,i),v(n)?a="":v(r)?a=`>=${n}.0.0 <${+n+1}.0.0-0`:v(o)?a=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:i?(s("replaceTilde pr",i),a=`>=${n}.${r}.${o}-${i} <${n}.${+r+1}.0-0`):a=`>=${n}.${r}.${o} <${n}.${+r+1}.0-0`,s("tilde return",a),a})},T=(e,t)=>e.trim().split(/\s+/).map(e=>E(e,t)).join(" "),E=(e,t)=>{s("caret",e,t);const n=t.loose?u[p.CARETLOOSE]:u[p.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,(t,n,o,i,a)=>{let l;return s("caret",e,t,n,o,i,a),v(n)?l="":v(o)?l=`>=${n}.0.0${r} <${+n+1}.0.0-0`:v(i)?l="0"===n?`>=${n}.${o}.0${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.0${r} <${+n+1}.0.0-0`:a?(s("replaceCaret pr",a),l="0"===n?"0"===o?`>=${n}.${o}.${i}-${a} <${n}.${o}.${+i+1}-0`:`>=${n}.${o}.${i}-${a} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${i}-${a} <${+n+1}.0.0-0`):(s("no pr"),l="0"===n?"0"===o?`>=${n}.${o}.${i}${r} <${n}.${o}.${+i+1}-0`:`>=${n}.${o}.${i}${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${i} <${+n+1}.0.0-0`),s("caret return",l),l})},S=(e,t)=>(s("replaceXRanges",e,t),e.split(/\s+/).map(e=>x(e,t)).join(" ")),x=(e,t)=>{e=e.trim();const n=t.loose?u[p.XRANGELOOSE]:u[p.XRANGE];return e.replace(n,(n,r,o,i,a,l)=>{s("xRange",e,n,r,o,i,a,l);const u=v(o),p=u||v(i),c=p||v(a),d=c;return"="===r&&d&&(r=""),l=t.includePrerelease?"-0":"",u?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(p&&(i=0),a=0,">"===r?(r=">=",p?(o=+o+1,i=0,a=0):(i=+i+1,a=0)):"<="===r&&(r="<",p?o=+o+1:i=+i+1),"<"===r&&(l="-0"),n=`${r+o}.${i}.${a}${l}`):p?n=`>=${o}.0.0${l} <${+o+1}.0.0-0`:c&&(n=`>=${o}.${i}.0${l} <${o}.${+i+1}.0-0`),s("xRange return",n),n})},w=(e,t)=>(s("replaceStars",e,t),e.trim().replace(u[p.STAR],"")),A=(e,t)=>(s("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?p.GTE0PRE:p.GTE0],"")),k=e=>(t,n,r,o,i,a,s,l,u,p,c,d,f)=>`${n=v(r)?"":v(o)?`>=${r}.0.0${e?"-0":""}`:v(i)?`>=${r}.${o}.0${e?"-0":""}`:a?">="+n:`>=${n}${e?"-0":""}`} ${l=v(u)?"":v(p)?`<${+u+1}.0.0-0`:v(c)?`<${u}.${+p+1}.0-0`:d?`<=${u}.${p}.${c}-${d}`:e?`<${u}.${p}.${+c+1}-0`:"<="+l}`.trim(),M=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(s(e[n].semver),e[n].semver!==a.ANY&&e[n].semver.prerelease.length>0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}},function(e,t,n){"use strict";function r(e){var t=e.split(/\r\n|[\n\r]/g),n=o(t);if(0!==n)for(var r=1;r<t.length;r++)t[r]=t[r].slice(n);for(;t.length>0&&a(t[0]);)t.shift();for(;t.length>0&&a(t[t.length-1]);)t.pop();return t.join("\n")}function o(e){for(var t=null,n=1;n<e.length;n++){var r=e[n],o=i(r);if(o!==r.length&&((null===t||o<t)&&0===(t=o)))break}return null===t?0:t}function i(e){for(var t=0;t<e.length&&(" "===e[t]||"\t"===e[t]);)t++;return t}function a(e){return i(e)===e.length}function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=-1===e.indexOf("\n"),o=" "===e[0]||"\t"===e[0],i='"'===e[e.length-1],a=!r||i||n,s="";return!a||r&&o||(s+="\n"+t),s+=t?e.replace(/\n/g,"\n"+t):e,a&&(s+="\n"),'"""'+s.replace(/"""/g,'\\"""')+'"""'}n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return s}))},function(e,t,n){"use strict";var r=Array.prototype.find?function(e,t){return Array.prototype.find.call(e,t)}:function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(t(r))return r}};t.a=r},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(63);function o(e,t){for(var n=Object.create(null),o=0,i=Object(r.a)(e);o<i.length;o++){var a=i[o],s=a[0],l=a[1];n[s]=t(l,s)}return n}},function(e,t,n){var r=n(435),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},function(e,t,n){"use strict";var r=n(115),o=n(56);function i(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function l(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=o,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),o=0;o<e.length;o+=2)n.push(parseInt(e[o]+e[o+1],16))}else for(var r=0,o=0;o<e.length;o++){var a=e.charCodeAt(o);a<128?n[r++]=a:a<2048?(n[r++]=a>>6|192,n[r++]=63&a|128):i(e,o)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++o)),n[r++]=a>>18|240,n[r++]=a>>12&63|128,n[r++]=a>>6&63|128,n[r++]=63&a|128):(n[r++]=a>>12|224,n[r++]=a>>6&63|128,n[r++]=63&a|128)}else for(o=0;o<e.length;o++)n[o]=0|e[o];return n},t.toHex=function(e){for(var t="",n=0;n<e.length;n++)t+=s(e[n].toString(16));return t},t.htonl=a,t.toHex32=function(e,t){for(var n="",r=0;r<e.length;r++){var o=e[r];"little"===t&&(o=a(o)),n+=l(o.toString(16))}return n},t.zero2=s,t.zero8=l,t.join32=function(e,t,n,o){var i=n-t;r(i%4==0);for(var a=new Array(i/4),s=0,l=t;s<a.length;s++,l+=4){var u;u="big"===o?e[l]<<24|e[l+1]<<16|e[l+2]<<8|e[l+3]:e[l+3]<<24|e[l+2]<<16|e[l+1]<<8|e[l],a[s]=u>>>0}return a},t.split32=function(e,t){for(var n=new Array(4*e.length),r=0,o=0;r<e.length;r++,o+=4){var i=e[r];"big"===t?(n[o]=i>>>24,n[o+1]=i>>>16&255,n[o+2]=i>>>8&255,n[o+3]=255&i):(n[o+3]=i>>>24,n[o+2]=i>>>16&255,n[o+1]=i>>>8&255,n[o]=255&i)}return n},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,n){return e+t+n>>>0},t.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},t.sum32_5=function(e,t,n,r,o){return e+t+n+r+o>>>0},t.sum64=function(e,t,n,r){var o=e[t],i=r+e[t+1]>>>0,a=(i<r?1:0)+n+o;e[t]=a>>>0,e[t+1]=i},t.sum64_hi=function(e,t,n,r){return(t+r>>>0<t?1:0)+e+n>>>0},t.sum64_lo=function(e,t,n,r){return t+r>>>0},t.sum64_4_hi=function(e,t,n,r,o,i,a,s){var l=0,u=t;return l+=(u=u+r>>>0)<t?1:0,l+=(u=u+i>>>0)<i?1:0,e+n+o+a+(l+=(u=u+s>>>0)<s?1:0)>>>0},t.sum64_4_lo=function(e,t,n,r,o,i,a,s){return t+r+i+s>>>0},t.sum64_5_hi=function(e,t,n,r,o,i,a,s,l,u){var p=0,c=t;return p+=(c=c+r>>>0)<t?1:0,p+=(c=c+i>>>0)<i?1:0,p+=(c=c+s>>>0)<s?1:0,e+n+o+a+l+(p+=(c=c+u>>>0)<u?1:0)>>>0},t.sum64_5_lo=function(e,t,n,r,o,i,a,s,l,u){return t+r+i+s+u>>>0},t.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},t.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},t.shr64_hi=function(e,t,n){return e>>>n},t.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0}},function(e,t,n){const r=n(27);e.exports=(e={})=>{e&&e.user&&delete e.user.avatar;const t=(t,n="")=>("function"==typeof e.get?e.get(t):r(e,`headers[${t}]`))||n,n=t("x-real-port");return{ip:t("x-real-ip","127.0.0.1"),ua:t("user-agent"),protocol:t("x-real-protocol").replace(/:$/,"")||"http",user:e.user||{},url:e.originalUrl,query:e.query,hostname:t("x-real-hostname"),port:80===Number(n)?"":Number(n)}}},function(module,exports){var $jscomp=$jscomp||{};$jscomp.scope={},$jscomp.findInternal=function(e,t,n){e instanceof String&&(e=String(e));for(var r=e.length,o=0;o<r;o++){var i=e[o];if(t.call(n,i,o,e))return{i:o,v:i}}return{i:-1,v:void 0}},$jscomp.ASSUME_ES5=!1,$jscomp.ASSUME_NO_NATIVE_MAP=!1,$jscomp.ASSUME_NO_NATIVE_SET=!1,$jscomp.SIMPLE_FROUND_POLYFILL=!1,$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){e!=Array.prototype&&e!=Object.prototype&&(e[t]=n.value)},$jscomp.getGlobal=function(e){return"undefined"!=typeof window&&window===e?e:"undefined"!=typeof global&&null!=global?global:e},$jscomp.global=$jscomp.getGlobal(this),$jscomp.polyfill=function(e,t,n,r){if(t){for(n=$jscomp.global,e=e.split("."),r=0;r<e.length-1;r++){var o=e[r];o in n||(n[o]={}),n=n[o]}(t=t(r=n[e=e[e.length-1]]))!=r&&null!=t&&$jscomp.defineProperty(n,e,{configurable:!0,writable:!0,value:t})}},$jscomp.polyfill("Array.prototype.findIndex",(function(e){return e||function(e,t){return $jscomp.findInternal(this,e,t).i}}),"es6","es3"),$jscomp.checkStringArgs=function(e,t,n){if(null==e)throw new TypeError("The 'this' value for String.prototype."+n+" must not be null or undefined");if(t instanceof RegExp)throw new TypeError("First argument to String.prototype."+n+" must not be a regular expression");return e+""},$jscomp.polyfill("String.prototype.endsWith",(function(e){return e||function(e,t){var n=$jscomp.checkStringArgs(this,e,"endsWith");e+="",void 0===t&&(t=n.length),t=Math.max(0,Math.min(0|t,n.length));for(var r=e.length;0<r&&0<t;)if(n[--t]!=e[--r])return!1;return 0>=r}}),"es6","es3"),$jscomp.polyfill("Array.prototype.find",(function(e){return e||function(e,t){return $jscomp.findInternal(this,e,t).v}}),"es6","es3"),$jscomp.polyfill("String.prototype.startsWith",(function(e){return e||function(e,t){var n=$jscomp.checkStringArgs(this,e,"startsWith");e+="";var r=n.length,o=e.length;t=Math.max(0,Math.min(0|t,n.length));for(var i=0;i<o&&t<r;)if(n[t++]!=e[i++])return!1;return i>=o}}),"es6","es3"),$jscomp.polyfill("String.prototype.repeat",(function(e){return e||function(e){var t=$jscomp.checkStringArgs(this,null,"repeat");if(0>e||1342177279<e)throw new RangeError("Invalid count value");e|=0;for(var n="";e;)1&e&&(n+=t),(e>>>=1)&&(t+=t);return n}}),"es6","es3");var COMPILED=!0,goog=goog||{};goog.global=this||self,goog.isDef=function(e){return void 0!==e},goog.isString=function(e){return"string"==typeof e},goog.isBoolean=function(e){return"boolean"==typeof e},goog.isNumber=function(e){return"number"==typeof e},goog.exportPath_=function(e,t,n){e=e.split("."),n=n||goog.global,e[0]in n||void 0===n.execScript||n.execScript("var "+e[0]);for(var r;e.length&&(r=e.shift());)!e.length&&goog.isDef(t)?n[r]=t:n=n[r]&&n[r]!==Object.prototype[r]?n[r]:n[r]={}},goog.define=function(e,t){if(!COMPILED){var n=goog.global.CLOSURE_UNCOMPILED_DEFINES,r=goog.global.CLOSURE_DEFINES;n&&void 0===n.nodeType&&Object.prototype.hasOwnProperty.call(n,e)?t=n[e]:r&&void 0===r.nodeType&&Object.prototype.hasOwnProperty.call(r,e)&&(t=r[e])}return t},goog.FEATURESET_YEAR=2012,goog.DEBUG=!0,goog.LOCALE="en",goog.TRUSTED_SITE=!0,goog.STRICT_MODE_COMPATIBLE=!1,goog.DISALLOW_TEST_ONLY_CODE=COMPILED&&!goog.DEBUG,goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING=!1,goog.provide=function(e){if(goog.isInModuleLoader_())throw Error("goog.provide cannot be used within a module.");if(!COMPILED&&goog.isProvided_(e))throw Error('Namespace "'+e+'" already declared.');goog.constructNamespace_(e)},goog.constructNamespace_=function(e,t){if(!COMPILED){delete goog.implicitNamespaces_[e];for(var n=e;(n=n.substring(0,n.lastIndexOf(".")))&&!goog.getObjectByName(n);)goog.implicitNamespaces_[n]=!0}goog.exportPath_(e,t)},goog.getScriptNonce=function(e){return e&&e!=goog.global?goog.getScriptNonce_(e.document):(null===goog.cspNonce_&&(goog.cspNonce_=goog.getScriptNonce_(goog.global.document)),goog.cspNonce_)},goog.NONCE_PATTERN_=/^[\w+/_-]+[=]{0,2}$/,goog.cspNonce_=null,goog.getScriptNonce_=function(e){return(e=e.querySelector&&e.querySelector("script[nonce]"))&&(e=e.nonce||e.getAttribute("nonce"))&&goog.NONCE_PATTERN_.test(e)?e:""},goog.VALID_MODULE_RE_=/^[a-zA-Z_$][a-zA-Z0-9._$]*$/,goog.module=function(e){if(!goog.isString(e)||!e||-1==e.search(goog.VALID_MODULE_RE_))throw Error("Invalid module identifier");if(!goog.isInGoogModuleLoader_())throw Error("Module "+e+" has been loaded incorrectly. Note, modules cannot be loaded as normal scripts. They require some kind of pre-processing step. You're likely trying to load a module via a script tag or as a part of a concatenated bundle without rewriting the module. For more info see: https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide.");if(goog.moduleLoaderState_.moduleName)throw Error("goog.module may only be called once per module.");if(goog.moduleLoaderState_.moduleName=e,!COMPILED){if(goog.isProvided_(e))throw Error('Namespace "'+e+'" already declared.');delete goog.implicitNamespaces_[e]}},goog.module.get=function(e){return goog.module.getInternal_(e)},goog.module.getInternal_=function(e){if(!COMPILED){if(e in goog.loadedModules_)return goog.loadedModules_[e].exports;if(!goog.implicitNamespaces_[e])return null!=(e=goog.getObjectByName(e))?e:null}return null},goog.ModuleType={ES6:"es6",GOOG:"goog"},goog.moduleLoaderState_=null,goog.isInModuleLoader_=function(){return goog.isInGoogModuleLoader_()||goog.isInEs6ModuleLoader_()},goog.isInGoogModuleLoader_=function(){return!!goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.GOOG},goog.isInEs6ModuleLoader_=function(){if(goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.ES6)return!0;var e=goog.global.$jscomp;return!!e&&("function"==typeof e.getCurrentModulePath&&!!e.getCurrentModulePath())},goog.module.declareLegacyNamespace=function(){if(!COMPILED&&!goog.isInGoogModuleLoader_())throw Error("goog.module.declareLegacyNamespace must be called from within a goog.module");if(!COMPILED&&!goog.moduleLoaderState_.moduleName)throw Error("goog.module must be called prior to goog.module.declareLegacyNamespace.");goog.moduleLoaderState_.declareLegacyNamespace=!0},goog.declareModuleId=function(e){if(!COMPILED){if(!goog.isInEs6ModuleLoader_())throw Error("goog.declareModuleId may only be called from within an ES6 module");if(goog.moduleLoaderState_&&goog.moduleLoaderState_.moduleName)throw Error("goog.declareModuleId may only be called once per module.");if(e in goog.loadedModules_)throw Error('Module with namespace "'+e+'" already exists.')}if(goog.moduleLoaderState_)goog.moduleLoaderState_.moduleName=e;else{var t=goog.global.$jscomp;if(!t||"function"!=typeof t.getCurrentModulePath)throw Error('Module with namespace "'+e+'" has been loaded incorrectly.');t=t.require(t.getCurrentModulePath()),goog.loadedModules_[e]={exports:t,type:goog.ModuleType.ES6,moduleId:e}}},goog.setTestOnly=function(e){if(goog.DISALLOW_TEST_ONLY_CODE)throw e=e||"",Error("Importing test-only code into non-debug environment"+(e?": "+e:"."))},goog.forwardDeclare=function(e){},COMPILED||(goog.isProvided_=function(e){return e in goog.loadedModules_||!goog.implicitNamespaces_[e]&&goog.isDefAndNotNull(goog.getObjectByName(e))},goog.implicitNamespaces_={"goog.module":!0}),goog.getObjectByName=function(e,t){e=e.split("."),t=t||goog.global;for(var n=0;n<e.length;n++)if(t=t[e[n]],!goog.isDefAndNotNull(t))return null;return t},goog.globalize=function(e,t){for(var n in t=t||goog.global,e)t[n]=e[n]},goog.addDependency=function(e,t,n,r){!COMPILED&&goog.DEPENDENCIES_ENABLED&&goog.debugLoader_.addDependency(e,t,n,r)},goog.ENABLE_DEBUG_LOADER=!0,goog.logToConsole_=function(e){goog.global.console&&goog.global.console.error(e)},goog.require=function(e){if(!COMPILED){if(goog.ENABLE_DEBUG_LOADER&&goog.debugLoader_.requested(e),goog.isProvided_(e)){if(goog.isInModuleLoader_())return goog.module.getInternal_(e)}else if(goog.ENABLE_DEBUG_LOADER){var t=goog.moduleLoaderState_;goog.moduleLoaderState_=null;try{goog.debugLoader_.load_(e)}finally{goog.moduleLoaderState_=t}}return null}},goog.requireType=function(e){return{}},goog.basePath="",goog.nullFunction=function(){},goog.abstractMethod=function(){throw Error("unimplemented abstract method")},goog.addSingletonGetter=function(e){e.instance_=void 0,e.getInstance=function(){return e.instance_?e.instance_:(goog.DEBUG&&(goog.instantiatedSingletons_[goog.instantiatedSingletons_.length]=e),e.instance_=new e)}},goog.instantiatedSingletons_=[],goog.LOAD_MODULE_USING_EVAL=!0,goog.SEAL_MODULE_EXPORTS=goog.DEBUG,goog.loadedModules_={},goog.DEPENDENCIES_ENABLED=!COMPILED&&goog.ENABLE_DEBUG_LOADER,goog.TRANSPILE="detect",goog.ASSUME_ES_MODULES_TRANSPILED=!1,goog.TRANSPILE_TO_LANGUAGE="",goog.TRANSPILER="transpile.js",goog.hasBadLetScoping=null,goog.useSafari10Workaround=function(){if(null==goog.hasBadLetScoping){try{var a=!eval('"use strict";let x = 1; function f() { return typeof x; };f() == "number";')}catch(e){a=!1}goog.hasBadLetScoping=a}return goog.hasBadLetScoping},goog.workaroundSafari10EvalBug=function(e){return"(function(){"+e+"\n;})();\n"},goog.loadModule=function(e){var t=goog.moduleLoaderState_;try{if(goog.moduleLoaderState_={moduleName:"",declareLegacyNamespace:!1,type:goog.ModuleType.GOOG},goog.isFunction(e))var n=e.call(void 0,{});else{if(!goog.isString(e))throw Error("Invalid module definition");goog.useSafari10Workaround()&&(e=goog.workaroundSafari10EvalBug(e)),n=goog.loadModuleFromSource_.call(void 0,e)}var r=goog.moduleLoaderState_.moduleName;if(!goog.isString(r)||!r)throw Error('Invalid module name "'+r+'"');goog.moduleLoaderState_.declareLegacyNamespace?goog.constructNamespace_(r,n):goog.SEAL_MODULE_EXPORTS&&Object.seal&&"object"==typeof n&&null!=n&&Object.seal(n),goog.loadedModules_[r]={exports:n,type:goog.ModuleType.GOOG,moduleId:goog.moduleLoaderState_.moduleName}}finally{goog.moduleLoaderState_=t}},goog.loadModuleFromSource_=function(a){return eval(a),{}},goog.normalizePath_=function(e){e=e.split("/");for(var t=0;t<e.length;)"."==e[t]?e.splice(t,1):t&&".."==e[t]&&e[t-1]&&".."!=e[t-1]?e.splice(--t,2):t++;return e.join("/")},goog.loadFileSync_=function(e){if(goog.global.CLOSURE_LOAD_FILE_SYNC)return goog.global.CLOSURE_LOAD_FILE_SYNC(e);try{var t=new goog.global.XMLHttpRequest;return t.open("get",e,!1),t.send(),0==t.status||200==t.status?t.responseText:null}catch(e){return null}},goog.transpile_=function(e,t,n){var r=goog.global.$jscomp;r||(goog.global.$jscomp=r={});var o=r.transpile;if(!o){var i=goog.basePath+goog.TRANSPILER,a=goog.loadFileSync_(i);if(a){if(function(){(0,eval)(a+"\n//# sourceURL="+i)}.call(goog.global),goog.global.$gwtExport&&goog.global.$gwtExport.$jscomp&&!goog.global.$gwtExport.$jscomp.transpile)throw Error('The transpiler did not properly export the "transpile" method. $gwtExport: '+JSON.stringify(goog.global.$gwtExport));goog.global.$jscomp.transpile=goog.global.$gwtExport.$jscomp.transpile,o=(r=goog.global.$jscomp).transpile}}return o||(o=r.transpile=function(e,t){return goog.logToConsole_(t+" requires transpilation but no transpiler was found."),e}),o(e,t,n)},goog.typeOf=function(e){var t=typeof e;if("object"==t){if(!e)return"null";if(e instanceof Array)return"array";if(e instanceof Object)return t;var n=Object.prototype.toString.call(e);if("[object Window]"==n)return"object";if("[object Array]"==n||"number"==typeof e.length&&void 0!==e.splice&&void 0!==e.propertyIsEnumerable&&!e.propertyIsEnumerable("splice"))return"array";if("[object Function]"==n||void 0!==e.call&&void 0!==e.propertyIsEnumerable&&!e.propertyIsEnumerable("call"))return"function"}else if("function"==t&&void 0===e.call)return"object";return t},goog.isNull=function(e){return null===e},goog.isDefAndNotNull=function(e){return null!=e},goog.isArray=function(e){return"array"==goog.typeOf(e)},goog.isArrayLike=function(e){var t=goog.typeOf(e);return"array"==t||"object"==t&&"number"==typeof e.length},goog.isDateLike=function(e){return goog.isObject(e)&&"function"==typeof e.getFullYear},goog.isFunction=function(e){return"function"==goog.typeOf(e)},goog.isObject=function(e){var t=typeof e;return"object"==t&&null!=e||"function"==t},goog.getUid=function(e){return e[goog.UID_PROPERTY_]||(e[goog.UID_PROPERTY_]=++goog.uidCounter_)},goog.hasUid=function(e){return!!e[goog.UID_PROPERTY_]},goog.removeUid=function(e){null!==e&&"removeAttribute"in e&&e.removeAttribute(goog.UID_PROPERTY_);try{delete e[goog.UID_PROPERTY_]}catch(e){}},goog.UID_PROPERTY_="closure_uid_"+(1e9*Math.random()>>>0),goog.uidCounter_=0,goog.getHashCode=goog.getUid,goog.removeHashCode=goog.removeUid,goog.cloneObject=function(e){var t=goog.typeOf(e);if("object"==t||"array"==t){if("function"==typeof e.clone)return e.clone();for(var n in t="array"==t?[]:{},e)t[n]=goog.cloneObject(e[n]);return t}return e},goog.bindNative_=function(e,t,n){return e.call.apply(e.bind,arguments)},goog.bindJs_=function(e,t,n){if(!e)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),e.apply(t,n)}}return function(){return e.apply(t,arguments)}},goog.bind=function(e,t,n){return Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?goog.bind=goog.bindNative_:goog.bind=goog.bindJs_,goog.bind.apply(null,arguments)},goog.partial=function(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=n.slice();return t.push.apply(t,arguments),e.apply(this,t)}},goog.mixin=function(e,t){for(var n in t)e[n]=t[n]},goog.now=goog.TRUSTED_SITE&&Date.now||function(){return+new Date},goog.globalEval=function(e){if(goog.global.execScript)goog.global.execScript(e,"JavaScript");else{if(!goog.global.eval)throw Error("goog.globalEval not available");if(null==goog.evalWorksForGlobals_){try{goog.global.eval("var _evalTest_ = 1;")}catch(e){}if(void 0!==goog.global._evalTest_){try{delete goog.global._evalTest_}catch(e){}goog.evalWorksForGlobals_=!0}else goog.evalWorksForGlobals_=!1}if(goog.evalWorksForGlobals_)goog.global.eval(e);else{var t=goog.global.document,n=t.createElement("SCRIPT");n.type="text/javascript",n.defer=!1,n.appendChild(t.createTextNode(e)),t.head.appendChild(n),t.head.removeChild(n)}}},goog.evalWorksForGlobals_=null,goog.getCssName=function(e,t){if("."==String(e).charAt(0))throw Error('className passed in goog.getCssName must not start with ".". You passed: '+e);var n=function(e){return goog.cssNameMapping_[e]||e},r=function(e){e=e.split("-");for(var t=[],r=0;r<e.length;r++)t.push(n(e[r]));return t.join("-")};return r=goog.cssNameMapping_?"BY_WHOLE"==goog.cssNameMappingStyle_?n:r:function(e){return e},e=t?e+"-"+r(t):r(e),goog.global.CLOSURE_CSS_NAME_MAP_FN?goog.global.CLOSURE_CSS_NAME_MAP_FN(e):e},goog.setCssNameMapping=function(e,t){goog.cssNameMapping_=e,goog.cssNameMappingStyle_=t},!COMPILED&&goog.global.CLOSURE_CSS_NAME_MAPPING&&(goog.cssNameMapping_=goog.global.CLOSURE_CSS_NAME_MAPPING),goog.getMsg=function(e,t,n){return n&&n.html&&(e=e.replace(/</g,"<")),t&&(e=e.replace(/\{\$([^}]+)}/g,(function(e,n){return null!=t&&n in t?t[n]:e}))),e},goog.getMsgWithFallback=function(e,t){return e},goog.exportSymbol=function(e,t,n){goog.exportPath_(e,t,n)},goog.exportProperty=function(e,t,n){e[t]=n},goog.inherits=function(e,t){function n(){}n.prototype=t.prototype,e.superClass_=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.base=function(e,n,r){for(var o=Array(arguments.length-2),i=2;i<arguments.length;i++)o[i-2]=arguments[i];return t.prototype[n].apply(e,o)}},goog.base=function(e,t,n){var r=arguments.callee.caller;if(goog.STRICT_MODE_COMPATIBLE||goog.DEBUG&&!r)throw Error("arguments.caller not defined. goog.base() cannot be used with strict mode code. See http://www.ecma-international.org/ecma-262/5.1/#sec-C");if(void 0!==r.superClass_){for(var o=Array(arguments.length-1),i=1;i<arguments.length;i++)o[i-1]=arguments[i];return r.superClass_.constructor.apply(e,o)}if("string"!=typeof t&&"symbol"!=typeof t)throw Error("method names provided to goog.base must be a string or a symbol");for(o=Array(arguments.length-2),i=2;i<arguments.length;i++)o[i-2]=arguments[i];i=!1;for(var a=e.constructor.prototype;a;a=Object.getPrototypeOf(a))if(a[t]===r)i=!0;else if(i)return a[t].apply(e,o);if(e[t]===r)return e.constructor.prototype[t].apply(e,o);throw Error("goog.base called from a method of one name to a method of a different name")},goog.scope=function(e){if(goog.isInModuleLoader_())throw Error("goog.scope is not supported within a module.");e.call(goog.global)},COMPILED||(goog.global.COMPILED=COMPILED),goog.defineClass=function(e,t){var n=t.constructor,r=t.statics;return n&&n!=Object.prototype.constructor||(n=function(){throw Error("cannot instantiate an interface (no constructor defined).")}),n=goog.defineClass.createSealingConstructor_(n,e),e&&goog.inherits(n,e),delete t.constructor,delete t.statics,goog.defineClass.applyProperties_(n.prototype,t),null!=r&&(r instanceof Function?r(n):goog.defineClass.applyProperties_(n,r)),n},goog.defineClass.SEAL_CLASS_INSTANCES=goog.DEBUG,goog.defineClass.createSealingConstructor_=function(e,t){if(!goog.defineClass.SEAL_CLASS_INSTANCES)return e;var n=!goog.defineClass.isUnsealable_(t),r=function(){var t=e.apply(this,arguments)||this;return t[goog.UID_PROPERTY_]=t[goog.UID_PROPERTY_],this.constructor===r&&n&&Object.seal instanceof Function&&Object.seal(t),t};return r},goog.defineClass.isUnsealable_=function(e){return e&&e.prototype&&e.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]},goog.defineClass.OBJECT_PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),goog.defineClass.applyProperties_=function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);for(var r=0;r<goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length;r++)n=goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[r],Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},goog.tagUnsealableClass=function(e){!COMPILED&&goog.defineClass.SEAL_CLASS_INSTANCES&&(e.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]=!0)},goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_="goog_defineClass_legacy_unsealable",!COMPILED&&goog.DEPENDENCIES_ENABLED&&(goog.inHtmlDocument_=function(){var e=goog.global.document;return null!=e&&"write"in e},goog.isDocumentLoading_=function(){var e=goog.global.document;return e.attachEvent?"complete"!=e.readyState:"loading"==e.readyState},goog.findBasePath_=function(){if(goog.isDef(goog.global.CLOSURE_BASE_PATH)&&goog.isString(goog.global.CLOSURE_BASE_PATH))goog.basePath=goog.global.CLOSURE_BASE_PATH;else if(goog.inHtmlDocument_()){var e=goog.global.document,t=e.currentScript;for(t=(e=t?[t]:e.getElementsByTagName("SCRIPT")).length-1;0<=t;--t){var n=e[t].src,r=n.lastIndexOf("?");if(r=-1==r?n.length:r,"base.js"==n.substr(r-7,7)){goog.basePath=n.substr(0,r-7);break}}}},goog.findBasePath_(),goog.Transpiler=function(){this.requiresTranspilation_=null,this.transpilationTarget_=goog.TRANSPILE_TO_LANGUAGE},goog.Transpiler.prototype.createRequiresTranspilation_=function(){function a(t,n){e?d[t]=!0:n()?(c=t,d[t]=!1):e=d[t]=!0}function b(a){try{return!!eval(a)}catch(e){return!1}}var c="es3",d={es3:!1},e=!1,f=goog.global.navigator&&goog.global.navigator.userAgent?goog.global.navigator.userAgent:"";return a("es5",(function(){return b("[1,].length==1")})),a("es6",(function(){return!f.match(/Edge\/(\d+)(\.\d)*/i)&&b('(()=>{"use strict";class X{constructor(){if(new.target!=String)throw 1;this.x=42}}let q=Reflect.construct(X,[],String);if(q.x!=42||!(q instanceof String))throw 1;for(const a of[2,3]){if(a==2)continue;function f(z={a}){let a=0;return z.a}{function f(){return 0;}}return f()==3}})()')})),a("es7",(function(){return b("2 ** 2 == 4")})),a("es8",(function(){return b("async () => 1, true")})),a("es9",(function(){return b("({...rest} = {}), true")})),a("es_next",(function(){return!1})),{target:c,map:d}},goog.Transpiler.prototype.needsTranspile=function(e,t){if("always"==goog.TRANSPILE)return!0;if("never"==goog.TRANSPILE)return!1;if(!this.requiresTranspilation_){var n=this.createRequiresTranspilation_();this.requiresTranspilation_=n.map,this.transpilationTarget_=this.transpilationTarget_||n.target}if(e in this.requiresTranspilation_)return!!this.requiresTranspilation_[e]||!(!goog.inHtmlDocument_()||"es6"!=t||"noModule"in goog.global.document.createElement("script"));throw Error("Unknown language mode: "+e)},goog.Transpiler.prototype.transpile=function(e,t){return goog.transpile_(e,t,this.transpilationTarget_)},goog.transpiler_=new goog.Transpiler,goog.protectScriptTag_=function(e){return e.replace(/<\/(SCRIPT)/gi,"\\x3c/$1")},goog.DebugLoader_=function(){this.dependencies_={},this.idToPath_={},this.written_={},this.loadingDeps_=[],this.depsToLoad_=[],this.paused_=!1,this.factory_=new goog.DependencyFactory(goog.transpiler_),this.deferredCallbacks_={},this.deferredQueue_=[]},goog.DebugLoader_.prototype.bootstrap=function(e,t){function n(){r&&(goog.global.setTimeout(r,0),r=null)}var r=t;if(e.length){t=[];for(var o=0;o<e.length;o++){var i=this.getPathFromDeps_(e[o]);if(!i)throw Error("Unregonized namespace: "+e[o]);t.push(this.dependencies_[i])}i=goog.require;var a=0;for(o=0;o<e.length;o++)i(e[o]),t[o].onLoad((function(){++a==e.length&&n()}))}else n()},goog.DebugLoader_.prototype.loadClosureDeps=function(){this.depsToLoad_.push(this.factory_.createDependency(goog.normalizePath_(goog.basePath+"deps.js"),"deps.js",[],[],{},!1)),this.loadDeps_()},goog.DebugLoader_.prototype.requested=function(e,t){(e=this.getPathFromDeps_(e))&&(t||this.areDepsLoaded_(this.dependencies_[e].requires))&&(t=this.deferredCallbacks_[e])&&(delete this.deferredCallbacks_[e],t())},goog.DebugLoader_.prototype.setDependencyFactory=function(e){this.factory_=e},goog.DebugLoader_.prototype.load_=function(e){if(!this.getPathFromDeps_(e))throw e="goog.require could not find: "+e,goog.logToConsole_(e),Error(e);var t=this,n=[],r=function(e){var o=t.getPathFromDeps_(e);if(!o)throw Error("Bad dependency path or symbol: "+e);if(!t.written_[o]){for(t.written_[o]=!0,e=t.dependencies_[o],o=0;o<e.requires.length;o++)goog.isProvided_(e.requires[o])||r(e.requires[o]);n.push(e)}};r(e),e=!!this.depsToLoad_.length,this.depsToLoad_=this.depsToLoad_.concat(n),this.paused_||e||this.loadDeps_()},goog.DebugLoader_.prototype.loadDeps_=function(){for(var e=this,t=this.paused_;this.depsToLoad_.length&&!t;)!function(){var n=!1,r=e.depsToLoad_.shift(),o=!1;e.loading_(r);var i={pause:function(){if(n)throw Error("Cannot call pause after the call to load.");t=!0},resume:function(){n?e.resume_():t=!1},loaded:function(){if(o)throw Error("Double call to loaded.");o=!0,e.loaded_(r)},pending:function(){for(var t=[],n=0;n<e.loadingDeps_.length;n++)t.push(e.loadingDeps_[n]);return t},setModuleState:function(e){goog.moduleLoaderState_={type:e,moduleName:"",declareLegacyNamespace:!1}},registerEs6ModuleExports:function(e,t,n){n&&(goog.loadedModules_[n]={exports:t,type:goog.ModuleType.ES6,moduleId:n||""})},registerGoogModuleExports:function(e,t){goog.loadedModules_[e]={exports:t,type:goog.ModuleType.GOOG,moduleId:e}},clearModuleState:function(){goog.moduleLoaderState_=null},defer:function(t){if(n)throw Error("Cannot register with defer after the call to load.");e.defer_(r,t)},areDepsLoaded:function(){return e.areDepsLoaded_(r.requires)}};try{r.load(i)}finally{n=!0}}();t&&this.pause_()},goog.DebugLoader_.prototype.pause_=function(){this.paused_=!0},goog.DebugLoader_.prototype.resume_=function(){this.paused_&&(this.paused_=!1,this.loadDeps_())},goog.DebugLoader_.prototype.loading_=function(e){this.loadingDeps_.push(e)},goog.DebugLoader_.prototype.loaded_=function(e){for(var t=0;t<this.loadingDeps_.length;t++)if(this.loadingDeps_[t]==e){this.loadingDeps_.splice(t,1);break}for(t=0;t<this.deferredQueue_.length;t++)if(this.deferredQueue_[t]==e.path){this.deferredQueue_.splice(t,1);break}if(this.loadingDeps_.length==this.deferredQueue_.length&&!this.depsToLoad_.length)for(;this.deferredQueue_.length;)this.requested(this.deferredQueue_.shift(),!0);e.loaded()},goog.DebugLoader_.prototype.areDepsLoaded_=function(e){for(var t=0;t<e.length;t++){var n=this.getPathFromDeps_(e[t]);if(!n||!(n in this.deferredCallbacks_)&&!goog.isProvided_(e[t]))return!1}return!0},goog.DebugLoader_.prototype.getPathFromDeps_=function(e){return e in this.idToPath_?this.idToPath_[e]:e in this.dependencies_?e:null},goog.DebugLoader_.prototype.defer_=function(e,t){this.deferredCallbacks_[e.path]=t,this.deferredQueue_.push(e.path)},goog.LoadController=function(){},goog.LoadController.prototype.pause=function(){},goog.LoadController.prototype.resume=function(){},goog.LoadController.prototype.loaded=function(){},goog.LoadController.prototype.pending=function(){},goog.LoadController.prototype.registerEs6ModuleExports=function(e,t,n){},goog.LoadController.prototype.setModuleState=function(e){},goog.LoadController.prototype.clearModuleState=function(){},goog.LoadController.prototype.defer=function(e){},goog.LoadController.prototype.areDepsLoaded=function(){},goog.Dependency=function(e,t,n,r,o){this.path=e,this.relativePath=t,this.provides=n,this.requires=r,this.loadFlags=o,this.loaded_=!1,this.loadCallbacks_=[]},goog.Dependency.prototype.getPathName=function(){var e=this.path,t=e.indexOf("://");return 0<=t&&(0<=(t=(e=e.substring(t+3)).indexOf("/"))&&(e=e.substring(t+1))),e},goog.Dependency.prototype.onLoad=function(e){this.loaded_?e():this.loadCallbacks_.push(e)},goog.Dependency.prototype.loaded=function(){this.loaded_=!0;var e=this.loadCallbacks_;this.loadCallbacks_=[];for(var t=0;t<e.length;t++)e[t]()},goog.Dependency.defer_=!1,goog.Dependency.callbackMap_={},goog.Dependency.registerCallback_=function(e){var t=Math.random().toString(32);return goog.Dependency.callbackMap_[t]=e,t},goog.Dependency.unregisterCallback_=function(e){delete goog.Dependency.callbackMap_[e]},goog.Dependency.callback_=function(e,t){if(!(e in goog.Dependency.callbackMap_))throw Error("Callback key "+e+" does not exist (was base.js loaded more than once?).");for(var n=goog.Dependency.callbackMap_[e],r=[],o=1;o<arguments.length;o++)r.push(arguments[o]);n.apply(void 0,r)},goog.Dependency.prototype.load=function(e){if(goog.global.CLOSURE_IMPORT_SCRIPT)goog.global.CLOSURE_IMPORT_SCRIPT(this.path)?e.loaded():e.pause();else if(goog.inHtmlDocument_()){var t=goog.global.document;if("complete"==t.readyState&&!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING){if(/\bdeps.js$/.test(this.path))return void e.loaded();throw Error('Cannot write "'+this.path+'" after document load')}if(!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING&&goog.isDocumentLoading_()){var n=goog.Dependency.registerCallback_((function(t){goog.DebugLoader_.IS_OLD_IE_&&"complete"!=t.readyState||(goog.Dependency.unregisterCallback_(n),e.loaded())})),r=!goog.DebugLoader_.IS_OLD_IE_&&goog.getScriptNonce()?' nonce="'+goog.getScriptNonce()+'"':"";r='<script src="'+this.path+'" '+(goog.DebugLoader_.IS_OLD_IE_?"onreadystatechange":"onload")+"=\"goog.Dependency.callback_('"+n+'\', this)" type="text/javascript" '+(goog.Dependency.defer_?"defer":"")+r+"><\/script>",t.write(goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createHTML(r):r)}else{var o=t.createElement("script");o.defer=goog.Dependency.defer_,o.async=!1,o.type="text/javascript",(r=goog.getScriptNonce())&&o.setAttribute("nonce",r),goog.DebugLoader_.IS_OLD_IE_?(e.pause(),o.onreadystatechange=function(){"loaded"!=o.readyState&&"complete"!=o.readyState||(e.loaded(),e.resume())}):o.onload=function(){o.onload=null,e.loaded()},o.src=goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createScriptURL(this.path):this.path,t.head.appendChild(o)}}else goog.logToConsole_("Cannot use default debug loader outside of HTML documents."),"deps.js"==this.relativePath?(goog.logToConsole_("Consider setting CLOSURE_IMPORT_SCRIPT before loading base.js, or setting CLOSURE_NO_DEPS to true."),e.loaded()):e.pause()},goog.Es6ModuleDependency=function(e,t,n,r,o){goog.Dependency.call(this,e,t,n,r,o)},goog.inherits(goog.Es6ModuleDependency,goog.Dependency),goog.Es6ModuleDependency.prototype.load=function(e){if(goog.global.CLOSURE_IMPORT_SCRIPT)goog.global.CLOSURE_IMPORT_SCRIPT(this.path)?e.loaded():e.pause();else if(goog.inHtmlDocument_()){var t=goog.global.document,n=this;if(goog.isDocumentLoading_()){var r=function(e,n){e=n?'<script type="module" crossorigin>'+n+"<\/script>":'<script type="module" crossorigin src="'+e+'"><\/script>',t.write(goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createHTML(e):e)};goog.Dependency.defer_=!0}else r=function(e,n){var r=t.createElement("script");r.defer=!0,r.async=!1,r.type="module",r.setAttribute("crossorigin",!0);var o=goog.getScriptNonce();o&&r.setAttribute("nonce",o),n?r.textContent=goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createScript(n):n:r.src=goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createScriptURL(e):e,t.head.appendChild(r)};var o=goog.Dependency.registerCallback_((function(){goog.Dependency.unregisterCallback_(o),e.setModuleState(goog.ModuleType.ES6)}));r(void 0,'goog.Dependency.callback_("'+o+'")'),r(this.path,void 0);var i=goog.Dependency.registerCallback_((function(t){goog.Dependency.unregisterCallback_(i),e.registerEs6ModuleExports(n.path,t,goog.moduleLoaderState_.moduleName)}));r(void 0,'import * as m from "'+this.path+'"; goog.Dependency.callback_("'+i+'", m)');var a=goog.Dependency.registerCallback_((function(){goog.Dependency.unregisterCallback_(a),e.clearModuleState(),e.loaded()}));r(void 0,'goog.Dependency.callback_("'+a+'")')}else goog.logToConsole_("Cannot use default debug loader outside of HTML documents."),e.pause()},goog.TransformedDependency=function(e,t,n,r,o){goog.Dependency.call(this,e,t,n,r,o),this.contents_=null,this.lazyFetch_=!goog.inHtmlDocument_()||!("noModule"in goog.global.document.createElement("script"))},goog.inherits(goog.TransformedDependency,goog.Dependency),goog.TransformedDependency.prototype.load=function(e){function t(){r.contents_=goog.loadFileSync_(r.path),r.contents_&&(r.contents_=r.transform(r.contents_),r.contents_&&(r.contents_+="\n//# sourceURL="+r.path))}function n(){if(r.lazyFetch_&&t(),r.contents_){o&&e.setModuleState(goog.ModuleType.ES6);try{var n=r.contents_;if(r.contents_=null,goog.globalEval(n),o)var i=goog.moduleLoaderState_.moduleName}finally{o&&e.clearModuleState()}o&&goog.global.$jscomp.require.ensure([r.getPathName()],(function(){e.registerEs6ModuleExports(r.path,goog.global.$jscomp.require(r.getPathName()),i)})),e.loaded()}}var r=this;if(goog.global.CLOSURE_IMPORT_SCRIPT)t(),this.contents_&&goog.global.CLOSURE_IMPORT_SCRIPT("",this.contents_)?(this.contents_=null,e.loaded()):e.pause();else{var o=this.loadFlags.module==goog.ModuleType.ES6;this.lazyFetch_||t();var i=1<e.pending().length,a=i&&goog.DebugLoader_.IS_OLD_IE_;if(i=goog.Dependency.defer_&&(i||goog.isDocumentLoading_()),a||i)e.defer((function(){n()}));else{var s=goog.global.document;if(a=goog.inHtmlDocument_()&&"ActiveXObject"in goog.global,o&&goog.inHtmlDocument_()&&goog.isDocumentLoading_()&&!a){goog.Dependency.defer_=!0,e.pause();var l=s.onreadystatechange;s.onreadystatechange=function(){"interactive"==s.readyState&&(s.onreadystatechange=l,n(),e.resume()),goog.isFunction(l)&&l.apply(void 0,arguments)}}else!goog.DebugLoader_.IS_OLD_IE_&&goog.inHtmlDocument_()&&goog.isDocumentLoading_()?function(){var e=goog.global.document,t=goog.Dependency.registerCallback_((function(){goog.Dependency.unregisterCallback_(t),n()})),r='<script type="text/javascript">'+goog.protectScriptTag_('goog.Dependency.callback_("'+t+'");')+"<\/script>";e.write(goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createHTML(r):r)}():n()}}},goog.TransformedDependency.prototype.transform=function(e){},goog.TranspiledDependency=function(e,t,n,r,o,i){goog.TransformedDependency.call(this,e,t,n,r,o),this.transpiler=i},goog.inherits(goog.TranspiledDependency,goog.TransformedDependency),goog.TranspiledDependency.prototype.transform=function(e){return this.transpiler.transpile(e,this.getPathName())},goog.PreTranspiledEs6ModuleDependency=function(e,t,n,r,o){goog.TransformedDependency.call(this,e,t,n,r,o)},goog.inherits(goog.PreTranspiledEs6ModuleDependency,goog.TransformedDependency),goog.PreTranspiledEs6ModuleDependency.prototype.transform=function(e){return e},goog.GoogModuleDependency=function(e,t,n,r,o,i,a){goog.TransformedDependency.call(this,e,t,n,r,o),this.needsTranspile_=i,this.transpiler_=a},goog.inherits(goog.GoogModuleDependency,goog.TransformedDependency),goog.GoogModuleDependency.prototype.transform=function(e){return this.needsTranspile_&&(e=this.transpiler_.transpile(e,this.getPathName())),goog.LOAD_MODULE_USING_EVAL&&goog.isDef(goog.global.JSON)?"goog.loadModule("+goog.global.JSON.stringify(e+"\n//# sourceURL="+this.path+"\n")+");":'goog.loadModule(function(exports) {"use strict";'+e+"\n;return exports});\n//# sourceURL="+this.path+"\n"},goog.DebugLoader_.IS_OLD_IE_=!(goog.global.atob||!goog.global.document||!goog.global.document.all),goog.DebugLoader_.prototype.addDependency=function(e,t,n,r){t=t||[],e=e.replace(/\\/g,"/");var o=goog.normalizePath_(goog.basePath+e);for(r&&"boolean"!=typeof r||(r=r?{module:goog.ModuleType.GOOG}:{}),n=this.factory_.createDependency(o,e,t,n,r,goog.transpiler_.needsTranspile(r.lang||"es3",r.module)),this.dependencies_[o]=n,n=0;n<t.length;n++)this.idToPath_[t[n]]=o;this.idToPath_[e]=o},goog.DependencyFactory=function(e){this.transpiler=e},goog.DependencyFactory.prototype.createDependency=function(e,t,n,r,o,i){return o.module==goog.ModuleType.GOOG?new goog.GoogModuleDependency(e,t,n,r,o,i,this.transpiler):i?new goog.TranspiledDependency(e,t,n,r,o,this.transpiler):o.module==goog.ModuleType.ES6?"never"==goog.TRANSPILE&&goog.ASSUME_ES_MODULES_TRANSPILED?new goog.PreTranspiledEs6ModuleDependency(e,t,n,r,o):new goog.Es6ModuleDependency(e,t,n,r,o):new goog.Dependency(e,t,n,r,o)},goog.debugLoader_=new goog.DebugLoader_,goog.loadClosureDeps=function(){goog.debugLoader_.loadClosureDeps()},goog.setDependencyFactory=function(e){goog.debugLoader_.setDependencyFactory(e)},goog.global.CLOSURE_NO_DEPS||goog.debugLoader_.loadClosureDeps(),goog.bootstrap=function(e,t){goog.debugLoader_.bootstrap(e,t)}),goog.TRUSTED_TYPES_POLICY_NAME="",goog.identity_=function(e){return e},goog.createTrustedTypesPolicy=function(e){var t=null;if("undefined"==typeof TrustedTypes||!TrustedTypes.createPolicy)return t;try{t=TrustedTypes.createPolicy(e,{createHTML:goog.identity_,createScript:goog.identity_,createScriptURL:goog.identity_,createURL:goog.identity_})}catch(e){goog.logToConsole_(e.message)}return t},goog.TRUSTED_TYPES_POLICY_=goog.TRUSTED_TYPES_POLICY_NAME?goog.createTrustedTypesPolicy(goog.TRUSTED_TYPES_POLICY_NAME+"#base"):null,goog.object={},goog.object.is=function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},goog.object.forEach=function(e,t,n){for(var r in e)t.call(n,e[r],r,e)},goog.object.filter=function(e,t,n){var r,o={};for(r in e)t.call(n,e[r],r,e)&&(o[r]=e[r]);return o},goog.object.map=function(e,t,n){var r,o={};for(r in e)o[r]=t.call(n,e[r],r,e);return o},goog.object.some=function(e,t,n){for(var r in e)if(t.call(n,e[r],r,e))return!0;return!1},goog.object.every=function(e,t,n){for(var r in e)if(!t.call(n,e[r],r,e))return!1;return!0},goog.object.getCount=function(e){var t,n=0;for(t in e)n++;return n},goog.object.getAnyKey=function(e){for(var t in e)return t},goog.object.getAnyValue=function(e){for(var t in e)return e[t]},goog.object.contains=function(e,t){return goog.object.containsValue(e,t)},goog.object.getValues=function(e){var t,n=[],r=0;for(t in e)n[r++]=e[t];return n},goog.object.getKeys=function(e){var t,n=[],r=0;for(t in e)n[r++]=t;return n},goog.object.getValueByKeys=function(e,t){var n=goog.isArrayLike(t),r=n?t:arguments;for(n=n?0:1;n<r.length;n++){if(null==e)return;e=e[r[n]]}return e},goog.object.containsKey=function(e,t){return null!==e&&t in e},goog.object.containsValue=function(e,t){for(var n in e)if(e[n]==t)return!0;return!1},goog.object.findKey=function(e,t,n){for(var r in e)if(t.call(n,e[r],r,e))return r},goog.object.findValue=function(e,t,n){return(t=goog.object.findKey(e,t,n))&&e[t]},goog.object.isEmpty=function(e){for(var t in e)return!1;return!0},goog.object.clear=function(e){for(var t in e)delete e[t]},goog.object.remove=function(e,t){var n;return(n=t in e)&&delete e[t],n},goog.object.add=function(e,t,n){if(null!==e&&t in e)throw Error('The object already contains the key "'+t+'"');goog.object.set(e,t,n)},goog.object.get=function(e,t,n){return null!==e&&t in e?e[t]:n},goog.object.set=function(e,t,n){e[t]=n},goog.object.setIfUndefined=function(e,t,n){return t in e?e[t]:e[t]=n},goog.object.setWithReturnValueIfNotSet=function(e,t,n){return t in e?e[t]:(n=n(),e[t]=n)},goog.object.equals=function(e,t){for(var n in e)if(!(n in t)||e[n]!==t[n])return!1;for(var r in t)if(!(r in e))return!1;return!0},goog.object.clone=function(e){var t,n={};for(t in e)n[t]=e[t];return n},goog.object.unsafeClone=function(e){var t=goog.typeOf(e);if("object"==t||"array"==t){if(goog.isFunction(e.clone))return e.clone();for(var n in t="array"==t?[]:{},e)t[n]=goog.object.unsafeClone(e[n]);return t}return e},goog.object.transpose=function(e){var t,n={};for(t in e)n[e[t]]=t;return n},goog.object.PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),goog.object.extend=function(e,t){for(var n,r,o=1;o<arguments.length;o++){for(n in r=arguments[o])e[n]=r[n];for(var i=0;i<goog.object.PROTOTYPE_FIELDS_.length;i++)n=goog.object.PROTOTYPE_FIELDS_[i],Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}},goog.object.create=function(e){var t=arguments.length;if(1==t&&goog.isArray(arguments[0]))return goog.object.create.apply(null,arguments[0]);if(t%2)throw Error("Uneven number of arguments");for(var n={},r=0;r<t;r+=2)n[arguments[r]]=arguments[r+1];return n},goog.object.createSet=function(e){var t=arguments.length;if(1==t&&goog.isArray(arguments[0]))return goog.object.createSet.apply(null,arguments[0]);for(var n={},r=0;r<t;r++)n[arguments[r]]=!0;return n},goog.object.createImmutableView=function(e){var t=e;return Object.isFrozen&&!Object.isFrozen(e)&&(t=Object.create(e),Object.freeze(t)),t},goog.object.isImmutableView=function(e){return!!Object.isFrozen&&Object.isFrozen(e)},goog.object.getAllPropertyNames=function(e,t,n){if(!e)return[];if(!Object.getOwnPropertyNames||!Object.getPrototypeOf)return goog.object.getKeys(e);for(var r={};e&&(e!==Object.prototype||t)&&(e!==Function.prototype||n);){for(var o=Object.getOwnPropertyNames(e),i=0;i<o.length;i++)r[o[i]]=!0;e=Object.getPrototypeOf(e)}return goog.object.getKeys(r)},goog.object.getSuperClass=function(e){return(e=Object.getPrototypeOf(e.prototype))&&e.constructor},goog.debug={},goog.debug.Error=function(e){if(Error.captureStackTrace)Error.captureStackTrace(this,goog.debug.Error);else{var t=Error().stack;t&&(this.stack=t)}e&&(this.message=String(e)),this.reportErrorToServer=!0},goog.inherits(goog.debug.Error,Error),goog.debug.Error.prototype.name="CustomError",goog.dom={},goog.dom.NodeType={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12},goog.asserts={},goog.asserts.ENABLE_ASSERTS=goog.DEBUG,goog.asserts.AssertionError=function(e,t){goog.debug.Error.call(this,goog.asserts.subs_(e,t)),this.messagePattern=e},goog.inherits(goog.asserts.AssertionError,goog.debug.Error),goog.asserts.AssertionError.prototype.name="AssertionError",goog.asserts.DEFAULT_ERROR_HANDLER=function(e){throw e},goog.asserts.errorHandler_=goog.asserts.DEFAULT_ERROR_HANDLER,goog.asserts.subs_=function(e,t){for(var n="",r=(e=e.split("%s")).length-1,o=0;o<r;o++)n+=e[o]+(o<t.length?t[o]:"%s");return n+e[r]},goog.asserts.doAssertFailure_=function(e,t,n,r){var o="Assertion failed";if(n){o+=": "+n;var i=r}else e&&(o+=": "+e,i=t);e=new goog.asserts.AssertionError(""+o,i||[]),goog.asserts.errorHandler_(e)},goog.asserts.setErrorHandler=function(e){goog.asserts.ENABLE_ASSERTS&&(goog.asserts.errorHandler_=e)},goog.asserts.assert=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!e&&goog.asserts.doAssertFailure_("",null,t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertExists=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&null==e&&goog.asserts.doAssertFailure_("Expected to exist: %s.",[e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.fail=function(e,t){goog.asserts.ENABLE_ASSERTS&&goog.asserts.errorHandler_(new goog.asserts.AssertionError("Failure"+(e?": "+e:""),Array.prototype.slice.call(arguments,1)))},goog.asserts.assertNumber=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isNumber(e)&&goog.asserts.doAssertFailure_("Expected number but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertString=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isString(e)&&goog.asserts.doAssertFailure_("Expected string but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertFunction=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isFunction(e)&&goog.asserts.doAssertFailure_("Expected function but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertObject=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isObject(e)&&goog.asserts.doAssertFailure_("Expected object but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertArray=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isArray(e)&&goog.asserts.doAssertFailure_("Expected array but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertBoolean=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isBoolean(e)&&goog.asserts.doAssertFailure_("Expected boolean but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertElement=function(e,t,n){return!goog.asserts.ENABLE_ASSERTS||goog.isObject(e)&&e.nodeType==goog.dom.NodeType.ELEMENT||goog.asserts.doAssertFailure_("Expected Element but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertInstanceof=function(e,t,n,r){return!goog.asserts.ENABLE_ASSERTS||e instanceof t||goog.asserts.doAssertFailure_("Expected instanceof %s but got %s.",[goog.asserts.getType_(t),goog.asserts.getType_(e)],n,Array.prototype.slice.call(arguments,3)),e},goog.asserts.assertFinite=function(e,t,n){return!goog.asserts.ENABLE_ASSERTS||"number"==typeof e&&isFinite(e)||goog.asserts.doAssertFailure_("Expected %s to be a finite number but it is not.",[e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertObjectPrototypeIsIntact=function(){for(var e in Object.prototype)goog.asserts.fail(e+" should not be enumerable in Object.prototype.")},goog.asserts.getType_=function(e){return e instanceof Function?e.displayName||e.name||"unknown type name":e instanceof Object?e.constructor.displayName||e.constructor.name||Object.prototype.toString.call(e):null===e?"null":typeof e};var jspb={BinaryConstants:{},ConstBinaryMessage:function(){},BinaryMessage:function(){}};jspb.BinaryConstants.FieldType={INVALID:-1,DOUBLE:1,FLOAT:2,INT64:3,UINT64:4,INT32:5,FIXED64:6,FIXED32:7,BOOL:8,STRING:9,GROUP:10,MESSAGE:11,BYTES:12,UINT32:13,ENUM:14,SFIXED32:15,SFIXED64:16,SINT32:17,SINT64:18,FHASH64:30,VHASH64:31},jspb.BinaryConstants.WireType={INVALID:-1,VARINT:0,FIXED64:1,DELIMITED:2,START_GROUP:3,END_GROUP:4,FIXED32:5},jspb.BinaryConstants.FieldTypeToWireType=function(e){var t=jspb.BinaryConstants.FieldType,n=jspb.BinaryConstants.WireType;switch(e){case t.INT32:case t.INT64:case t.UINT32:case t.UINT64:case t.SINT32:case t.SINT64:case t.BOOL:case t.ENUM:case t.VHASH64:return n.VARINT;case t.DOUBLE:case t.FIXED64:case t.SFIXED64:case t.FHASH64:return n.FIXED64;case t.STRING:case t.MESSAGE:case t.BYTES:return n.DELIMITED;case t.FLOAT:case t.FIXED32:case t.SFIXED32:return n.FIXED32;default:return n.INVALID}},jspb.BinaryConstants.INVALID_FIELD_NUMBER=-1,jspb.BinaryConstants.FLOAT32_EPS=1401298464324817e-60,jspb.BinaryConstants.FLOAT32_MIN=11754943508222875e-54,jspb.BinaryConstants.FLOAT32_MAX=34028234663852886e22,jspb.BinaryConstants.FLOAT64_EPS=5e-324,jspb.BinaryConstants.FLOAT64_MIN=22250738585072014e-324,jspb.BinaryConstants.FLOAT64_MAX=17976931348623157e292,jspb.BinaryConstants.TWO_TO_20=1048576,jspb.BinaryConstants.TWO_TO_23=8388608,jspb.BinaryConstants.TWO_TO_31=2147483648,jspb.BinaryConstants.TWO_TO_32=4294967296,jspb.BinaryConstants.TWO_TO_52=4503599627370496,jspb.BinaryConstants.TWO_TO_63=0x8000000000000000,jspb.BinaryConstants.TWO_TO_64=0x10000000000000000,jspb.BinaryConstants.ZERO_HASH="\0\0\0\0\0\0\0\0",goog.array={},goog.NATIVE_ARRAY_PROTOTYPES=goog.TRUSTED_SITE,goog.array.ASSUME_NATIVE_FUNCTIONS=2012<goog.FEATURESET_YEAR,goog.array.peek=function(e){return e[e.length-1]},goog.array.last=goog.array.peek,goog.array.indexOf=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.indexOf)?function(e,t,n){return goog.asserts.assert(null!=e.length),Array.prototype.indexOf.call(e,t,n)}:function(e,t,n){if(n=null==n?0:0>n?Math.max(0,e.length+n):n,goog.isString(e))return goog.isString(t)&&1==t.length?e.indexOf(t,n):-1;for(;n<e.length;n++)if(n in e&&e[n]===t)return n;return-1},goog.array.lastIndexOf=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.lastIndexOf)?function(e,t,n){return goog.asserts.assert(null!=e.length),Array.prototype.lastIndexOf.call(e,t,null==n?e.length-1:n)}:function(e,t,n){if(0>(n=null==n?e.length-1:n)&&(n=Math.max(0,e.length+n)),goog.isString(e))return goog.isString(t)&&1==t.length?e.lastIndexOf(t,n):-1;for(;0<=n;n--)if(n in e&&e[n]===t)return n;return-1},goog.array.forEach=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.forEach)?function(e,t,n){goog.asserts.assert(null!=e.length),Array.prototype.forEach.call(e,t,n)}:function(e,t,n){for(var r=e.length,o=goog.isString(e)?e.split(""):e,i=0;i<r;i++)i in o&&t.call(n,o[i],i,e)},goog.array.forEachRight=function(e,t,n){var r=e.length,o=goog.isString(e)?e.split(""):e;for(--r;0<=r;--r)r in o&&t.call(n,o[r],r,e)},goog.array.filter=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.filter)?function(e,t,n){return goog.asserts.assert(null!=e.length),Array.prototype.filter.call(e,t,n)}:function(e,t,n){for(var r=e.length,o=[],i=0,a=goog.isString(e)?e.split(""):e,s=0;s<r;s++)if(s in a){var l=a[s];t.call(n,l,s,e)&&(o[i++]=l)}return o},goog.array.map=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.map)?function(e,t,n){return goog.asserts.assert(null!=e.length),Array.prototype.map.call(e,t,n)}:function(e,t,n){for(var r=e.length,o=Array(r),i=goog.isString(e)?e.split(""):e,a=0;a<r;a++)a in i&&(o[a]=t.call(n,i[a],a,e));return o},goog.array.reduce=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.reduce)?function(e,t,n,r){return goog.asserts.assert(null!=e.length),r&&(t=goog.bind(t,r)),Array.prototype.reduce.call(e,t,n)}:function(e,t,n,r){var o=n;return goog.array.forEach(e,(function(n,i){o=t.call(r,o,n,i,e)})),o},goog.array.reduceRight=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.reduceRight)?function(e,t,n,r){return goog.asserts.assert(null!=e.length),goog.asserts.assert(null!=t),r&&(t=goog.bind(t,r)),Array.prototype.reduceRight.call(e,t,n)}:function(e,t,n,r){var o=n;return goog.array.forEachRight(e,(function(n,i){o=t.call(r,o,n,i,e)})),o},goog.array.some=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.some)?function(e,t,n){return goog.asserts.assert(null!=e.length),Array.prototype.some.call(e,t,n)}:function(e,t,n){for(var r=e.length,o=goog.isString(e)?e.split(""):e,i=0;i<r;i++)if(i in o&&t.call(n,o[i],i,e))return!0;return!1},goog.array.every=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.every)?function(e,t,n){return goog.asserts.assert(null!=e.length),Array.prototype.every.call(e,t,n)}:function(e,t,n){for(var r=e.length,o=goog.isString(e)?e.split(""):e,i=0;i<r;i++)if(i in o&&!t.call(n,o[i],i,e))return!1;return!0},goog.array.count=function(e,t,n){var r=0;return goog.array.forEach(e,(function(e,o,i){t.call(n,e,o,i)&&++r}),n),r},goog.array.find=function(e,t,n){return 0>(t=goog.array.findIndex(e,t,n))?null:goog.isString(e)?e.charAt(t):e[t]},goog.array.findIndex=function(e,t,n){for(var r=e.length,o=goog.isString(e)?e.split(""):e,i=0;i<r;i++)if(i in o&&t.call(n,o[i],i,e))return i;return-1},goog.array.findRight=function(e,t,n){return 0>(t=goog.array.findIndexRight(e,t,n))?null:goog.isString(e)?e.charAt(t):e[t]},goog.array.findIndexRight=function(e,t,n){var r=e.length,o=goog.isString(e)?e.split(""):e;for(--r;0<=r;r--)if(r in o&&t.call(n,o[r],r,e))return r;return-1},goog.array.contains=function(e,t){return 0<=goog.array.indexOf(e,t)},goog.array.isEmpty=function(e){return 0==e.length},goog.array.clear=function(e){if(!goog.isArray(e))for(var t=e.length-1;0<=t;t--)delete e[t];e.length=0},goog.array.insert=function(e,t){goog.array.contains(e,t)||e.push(t)},goog.array.insertAt=function(e,t,n){goog.array.splice(e,n,0,t)},goog.array.insertArrayAt=function(e,t,n){goog.partial(goog.array.splice,e,n,0).apply(null,t)},goog.array.insertBefore=function(e,t,n){var r;2==arguments.length||0>(r=goog.array.indexOf(e,n))?e.push(t):goog.array.insertAt(e,t,r)},goog.array.remove=function(e,t){var n;return(n=0<=(t=goog.array.indexOf(e,t)))&&goog.array.removeAt(e,t),n},goog.array.removeLast=function(e,t){return 0<=(t=goog.array.lastIndexOf(e,t))&&(goog.array.removeAt(e,t),!0)},goog.array.removeAt=function(e,t){return goog.asserts.assert(null!=e.length),1==Array.prototype.splice.call(e,t,1).length},goog.array.removeIf=function(e,t,n){return 0<=(t=goog.array.findIndex(e,t,n))&&(goog.array.removeAt(e,t),!0)},goog.array.removeAllIf=function(e,t,n){var r=0;return goog.array.forEachRight(e,(function(o,i){t.call(n,o,i,e)&&goog.array.removeAt(e,i)&&r++})),r},goog.array.concat=function(e){return Array.prototype.concat.apply([],arguments)},goog.array.join=function(e){return Array.prototype.concat.apply([],arguments)},goog.array.toArray=function(e){var t=e.length;if(0<t){for(var n=Array(t),r=0;r<t;r++)n[r]=e[r];return n}return[]},goog.array.clone=goog.array.toArray,goog.array.extend=function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(goog.isArrayLike(r)){var o=e.length||0,i=r.length||0;e.length=o+i;for(var a=0;a<i;a++)e[o+a]=r[a]}else e.push(r)}},goog.array.splice=function(e,t,n,r){return goog.asserts.assert(null!=e.length),Array.prototype.splice.apply(e,goog.array.slice(arguments,1))},goog.array.slice=function(e,t,n){return goog.asserts.assert(null!=e.length),2>=arguments.length?Array.prototype.slice.call(e,t):Array.prototype.slice.call(e,t,n)},goog.array.removeDuplicates=function(e,t,n){t=t||e;var r=function(e){return goog.isObject(e)?"o"+goog.getUid(e):(typeof e).charAt(0)+e};n=n||r,r={};for(var o=0,i=0;i<e.length;){var a=e[i++],s=n(a);Object.prototype.hasOwnProperty.call(r,s)||(r[s]=!0,t[o++]=a)}t.length=o},goog.array.binarySearch=function(e,t,n){return goog.array.binarySearch_(e,n||goog.array.defaultCompare,!1,t)},goog.array.binarySelect=function(e,t,n){return goog.array.binarySearch_(e,t,!0,void 0,n)},goog.array.binarySearch_=function(e,t,n,r,o){for(var i,a=0,s=e.length;a<s;){var l=a+s>>1,u=n?t.call(o,e[l],l,e):t(r,e[l]);0<u?a=l+1:(s=l,i=!u)}return i?a:~a},goog.array.sort=function(e,t){e.sort(t||goog.array.defaultCompare)},goog.array.stableSort=function(e,t){for(var n=Array(e.length),r=0;r<e.length;r++)n[r]={index:r,value:e[r]};var o=t||goog.array.defaultCompare;for(goog.array.sort(n,(function(e,t){return o(e.value,t.value)||e.index-t.index})),r=0;r<e.length;r++)e[r]=n[r].value},goog.array.sortByKey=function(e,t,n){var r=n||goog.array.defaultCompare;goog.array.sort(e,(function(e,n){return r(t(e),t(n))}))},goog.array.sortObjectsByKey=function(e,t,n){goog.array.sortByKey(e,(function(e){return e[t]}),n)},goog.array.isSorted=function(e,t,n){t=t||goog.array.defaultCompare;for(var r=1;r<e.length;r++){var o=t(e[r-1],e[r]);if(0<o||0==o&&n)return!1}return!0},goog.array.equals=function(e,t,n){if(!goog.isArrayLike(e)||!goog.isArrayLike(t)||e.length!=t.length)return!1;var r=e.length;n=n||goog.array.defaultCompareEquality;for(var o=0;o<r;o++)if(!n(e[o],t[o]))return!1;return!0},goog.array.compare3=function(e,t,n){n=n||goog.array.defaultCompare;for(var r=Math.min(e.length,t.length),o=0;o<r;o++){var i=n(e[o],t[o]);if(0!=i)return i}return goog.array.defaultCompare(e.length,t.length)},goog.array.defaultCompare=function(e,t){return e>t?1:e<t?-1:0},goog.array.inverseDefaultCompare=function(e,t){return-goog.array.defaultCompare(e,t)},goog.array.defaultCompareEquality=function(e,t){return e===t},goog.array.binaryInsert=function(e,t,n){return 0>(n=goog.array.binarySearch(e,t,n))&&(goog.array.insertAt(e,t,-(n+1)),!0)},goog.array.binaryRemove=function(e,t,n){return 0<=(t=goog.array.binarySearch(e,t,n))&&goog.array.removeAt(e,t)},goog.array.bucket=function(e,t,n){for(var r={},o=0;o<e.length;o++){var i=e[o],a=t.call(n,i,o,e);goog.isDef(a)&&(r[a]||(r[a]=[])).push(i)}return r},goog.array.toObject=function(e,t,n){var r={};return goog.array.forEach(e,(function(o,i){r[t.call(n,o,i,e)]=o})),r},goog.array.range=function(e,t,n){var r=[],o=0,i=e;if(void 0!==t&&(o=e,i=t),0>(n=n||1)*(i-o))return[];if(0<n)for(e=o;e<i;e+=n)r.push(e);else for(e=o;e>i;e+=n)r.push(e);return r},goog.array.repeat=function(e,t){for(var n=[],r=0;r<t;r++)n[r]=e;return n},goog.array.flatten=function(e){for(var t=[],n=0;n<arguments.length;n++){var r=arguments[n];if(goog.isArray(r))for(var o=0;o<r.length;o+=8192){var i=goog.array.slice(r,o,o+8192);i=goog.array.flatten.apply(null,i);for(var a=0;a<i.length;a++)t.push(i[a])}else t.push(r)}return t},goog.array.rotate=function(e,t){return goog.asserts.assert(null!=e.length),e.length&&(0<(t%=e.length)?Array.prototype.unshift.apply(e,e.splice(-t,t)):0>t&&Array.prototype.push.apply(e,e.splice(0,-t))),e},goog.array.moveItem=function(e,t,n){goog.asserts.assert(0<=t&&t<e.length),goog.asserts.assert(0<=n&&n<e.length),t=Array.prototype.splice.call(e,t,1),Array.prototype.splice.call(e,n,0,t[0])},goog.array.zip=function(e){if(!arguments.length)return[];for(var t=[],n=arguments[0].length,r=1;r<arguments.length;r++)arguments[r].length<n&&(n=arguments[r].length);for(r=0;r<n;r++){for(var o=[],i=0;i<arguments.length;i++)o.push(arguments[i][r]);t.push(o)}return t},goog.array.shuffle=function(e,t){t=t||Math.random;for(var n=e.length-1;0<n;n--){var r=Math.floor(t()*(n+1)),o=e[n];e[n]=e[r],e[r]=o}},goog.array.copyByIndex=function(e,t){var n=[];return goog.array.forEach(t,(function(t){n.push(e[t])})),n},goog.array.concatMap=function(e,t,n){return goog.array.concat.apply([],goog.array.map(e,t,n))},goog.crypt={},goog.crypt.stringToByteArray=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var o=e.charCodeAt(r);255<o&&(t[n++]=255&o,o>>=8),t[n++]=o}return t},goog.crypt.byteArrayToString=function(e){if(8192>=e.length)return String.fromCharCode.apply(null,e);for(var t="",n=0;n<e.length;n+=8192){var r=goog.array.slice(e,n,n+8192);t+=String.fromCharCode.apply(null,r)}return t},goog.crypt.byteArrayToHex=function(e,t){return goog.array.map(e,(function(e){return 1<(e=e.toString(16)).length?e:"0"+e})).join(t||"")},goog.crypt.hexToByteArray=function(e){goog.asserts.assert(0==e.length%2,"Key string length must be multiple of 2");for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substring(n,n+2),16));return t},goog.crypt.stringToUtf8ByteArray=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var o=e.charCodeAt(r);128>o?t[n++]=o:(2048>o?t[n++]=o>>6|192:(55296==(64512&o)&&r+1<e.length&&56320==(64512&e.charCodeAt(r+1))?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++r)),t[n++]=o>>18|240,t[n++]=o>>12&63|128):t[n++]=o>>12|224,t[n++]=o>>6&63|128),t[n++]=63&o|128)}return t},goog.crypt.utf8ByteArrayToString=function(e){for(var t=[],n=0,r=0;n<e.length;){var o=e[n++];if(128>o)t[r++]=String.fromCharCode(o);else if(191<o&&224>o){var i=e[n++];t[r++]=String.fromCharCode((31&o)<<6|63&i)}else if(239<o&&365>o){i=e[n++];var a=e[n++];o=((7&o)<<18|(63&i)<<12|(63&a)<<6|63&e[n++])-65536,t[r++]=String.fromCharCode(55296+(o>>10)),t[r++]=String.fromCharCode(56320+(1023&o))}else i=e[n++],a=e[n++],t[r++]=String.fromCharCode((15&o)<<12|(63&i)<<6|63&a)}return t.join("")},goog.crypt.xorByteArray=function(e,t){goog.asserts.assert(e.length==t.length,"XOR array lengths must match");for(var n=[],r=0;r<e.length;r++)n.push(e[r]^t[r]);return n},goog.dom.asserts={},goog.dom.asserts.assertIsLocation=function(e){if(goog.asserts.ENABLE_ASSERTS){var t=goog.dom.asserts.getWindow_(e);t&&(!e||!(e instanceof t.Location)&&e instanceof t.Element)&&goog.asserts.fail("Argument is not a Location (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_(e))}return e},goog.dom.asserts.assertIsElementType_=function(e,t){if(goog.asserts.ENABLE_ASSERTS){var n=goog.dom.asserts.getWindow_(e);n&&void 0!==n[t]&&(e&&(e instanceof n[t]||!(e instanceof n.Location||e instanceof n.Element))||goog.asserts.fail("Argument is not a %s (or a non-Element, non-Location mock); got: %s",t,goog.dom.asserts.debugStringForType_(e)))}return e},goog.dom.asserts.assertIsHTMLAnchorElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLAnchorElement")},goog.dom.asserts.assertIsHTMLButtonElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLButtonElement")},goog.dom.asserts.assertIsHTMLLinkElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLLinkElement")},goog.dom.asserts.assertIsHTMLImageElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLImageElement")},goog.dom.asserts.assertIsHTMLAudioElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLAudioElement")},goog.dom.asserts.assertIsHTMLVideoElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLVideoElement")},goog.dom.asserts.assertIsHTMLInputElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLInputElement")},goog.dom.asserts.assertIsHTMLTextAreaElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLTextAreaElement")},goog.dom.asserts.assertIsHTMLCanvasElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLCanvasElement")},goog.dom.asserts.assertIsHTMLEmbedElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLEmbedElement")},goog.dom.asserts.assertIsHTMLFormElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLFormElement")},goog.dom.asserts.assertIsHTMLFrameElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLFrameElement")},goog.dom.asserts.assertIsHTMLIFrameElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLIFrameElement")},goog.dom.asserts.assertIsHTMLObjectElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLObjectElement")},goog.dom.asserts.assertIsHTMLScriptElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLScriptElement")},goog.dom.asserts.debugStringForType_=function(e){if(!goog.isObject(e))return void 0===e?"undefined":null===e?"null":typeof e;try{return e.constructor.displayName||e.constructor.name||Object.prototype.toString.call(e)}catch(e){return"<object could not be stringified>"}},goog.dom.asserts.getWindow_=function(e){try{var t=e&&e.ownerDocument,n=t&&(t.defaultView||t.parentWindow);if((n=n||goog.global).Element&&n.Location)return n}catch(e){}return null},goog.functions={},goog.functions.constant=function(e){return function(){return e}},goog.functions.FALSE=function(){return!1},goog.functions.TRUE=function(){return!0},goog.functions.NULL=function(){return null},goog.functions.identity=function(e,t){return e},goog.functions.error=function(e){return function(){throw Error(e)}},goog.functions.fail=function(e){return function(){throw e}},goog.functions.lock=function(e,t){return t=t||0,function(){return e.apply(this,Array.prototype.slice.call(arguments,0,t))}},goog.functions.nth=function(e){return function(){return arguments[e]}},goog.functions.partialRight=function(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=Array.prototype.slice.call(arguments);return t.push.apply(t,n),e.apply(this,t)}},goog.functions.withReturnValue=function(e,t){return goog.functions.sequence(e,goog.functions.constant(t))},goog.functions.equalTo=function(e,t){return function(n){return t?e==n:e===n}},goog.functions.compose=function(e,t){var n=arguments,r=n.length;return function(){var e;r&&(e=n[r-1].apply(this,arguments));for(var t=r-2;0<=t;t--)e=n[t].call(this,e);return e}},goog.functions.sequence=function(e){var t=arguments,n=t.length;return function(){for(var e,r=0;r<n;r++)e=t[r].apply(this,arguments);return e}},goog.functions.and=function(e){var t=arguments,n=t.length;return function(){for(var e=0;e<n;e++)if(!t[e].apply(this,arguments))return!1;return!0}},goog.functions.or=function(e){var t=arguments,n=t.length;return function(){for(var e=0;e<n;e++)if(t[e].apply(this,arguments))return!0;return!1}},goog.functions.not=function(e){return function(){return!e.apply(this,arguments)}},goog.functions.create=function(e,t){var n=function(){};return n.prototype=e.prototype,n=new n,e.apply(n,Array.prototype.slice.call(arguments,1)),n},goog.functions.CACHE_RETURN_VALUE=!0,goog.functions.cacheReturnValue=function(e){var t,n=!1;return function(){return goog.functions.CACHE_RETURN_VALUE?(n||(t=e(),n=!0),t):e()}},goog.functions.once=function(e){var t=e;return function(){if(t){var e=t;t=null,e()}}},goog.functions.debounce=function(e,t,n){var r=0;return function(o){goog.global.clearTimeout(r);var i=arguments;r=goog.global.setTimeout((function(){e.apply(n,i)}),t)}},goog.functions.throttle=function(e,t,n){var r=0,o=!1,i=[],a=function(){r=0,o&&(o=!1,s())},s=function(){r=goog.global.setTimeout(a,t),e.apply(n,i)};return function(e){i=arguments,r?o=!0:s()}},goog.functions.rateLimit=function(e,t,n){var r=0,o=function(){r=0};return function(i){r||(r=goog.global.setTimeout(o,t),e.apply(n,arguments))}},goog.dom.HtmlElement=function(){},goog.dom.TagName=function(e){this.tagName_=e},goog.dom.TagName.prototype.toString=function(){return this.tagName_},goog.dom.TagName.A=new goog.dom.TagName("A"),goog.dom.TagName.ABBR=new goog.dom.TagName("ABBR"),goog.dom.TagName.ACRONYM=new goog.dom.TagName("ACRONYM"),goog.dom.TagName.ADDRESS=new goog.dom.TagName("ADDRESS"),goog.dom.TagName.APPLET=new goog.dom.TagName("APPLET"),goog.dom.TagName.AREA=new goog.dom.TagName("AREA"),goog.dom.TagName.ARTICLE=new goog.dom.TagName("ARTICLE"),goog.dom.TagName.ASIDE=new goog.dom.TagName("ASIDE"),goog.dom.TagName.AUDIO=new goog.dom.TagName("AUDIO"),goog.dom.TagName.B=new goog.dom.TagName("B"),goog.dom.TagName.BASE=new goog.dom.TagName("BASE"),goog.dom.TagName.BASEFONT=new goog.dom.TagName("BASEFONT"),goog.dom.TagName.BDI=new goog.dom.TagName("BDI"),goog.dom.TagName.BDO=new goog.dom.TagName("BDO"),goog.dom.TagName.BIG=new goog.dom.TagName("BIG"),goog.dom.TagName.BLOCKQUOTE=new goog.dom.TagName("BLOCKQUOTE"),goog.dom.TagName.BODY=new goog.dom.TagName("BODY"),goog.dom.TagName.BR=new goog.dom.TagName("BR"),goog.dom.TagName.BUTTON=new goog.dom.TagName("BUTTON"),goog.dom.TagName.CANVAS=new goog.dom.TagName("CANVAS"),goog.dom.TagName.CAPTION=new goog.dom.TagName("CAPTION"),goog.dom.TagName.CENTER=new goog.dom.TagName("CENTER"),goog.dom.TagName.CITE=new goog.dom.TagName("CITE"),goog.dom.TagName.CODE=new goog.dom.TagName("CODE"),goog.dom.TagName.COL=new goog.dom.TagName("COL"),goog.dom.TagName.COLGROUP=new goog.dom.TagName("COLGROUP"),goog.dom.TagName.COMMAND=new goog.dom.TagName("COMMAND"),goog.dom.TagName.DATA=new goog.dom.TagName("DATA"),goog.dom.TagName.DATALIST=new goog.dom.TagName("DATALIST"),goog.dom.TagName.DD=new goog.dom.TagName("DD"),goog.dom.TagName.DEL=new goog.dom.TagName("DEL"),goog.dom.TagName.DETAILS=new goog.dom.TagName("DETAILS"),goog.dom.TagName.DFN=new goog.dom.TagName("DFN"),goog.dom.TagName.DIALOG=new goog.dom.TagName("DIALOG"),goog.dom.TagName.DIR=new goog.dom.TagName("DIR"),goog.dom.TagName.DIV=new goog.dom.TagName("DIV"),goog.dom.TagName.DL=new goog.dom.TagName("DL"),goog.dom.TagName.DT=new goog.dom.TagName("DT"),goog.dom.TagName.EM=new goog.dom.TagName("EM"),goog.dom.TagName.EMBED=new goog.dom.TagName("EMBED"),goog.dom.TagName.FIELDSET=new goog.dom.TagName("FIELDSET"),goog.dom.TagName.FIGCAPTION=new goog.dom.TagName("FIGCAPTION"),goog.dom.TagName.FIGURE=new goog.dom.TagName("FIGURE"),goog.dom.TagName.FONT=new goog.dom.TagName("FONT"),goog.dom.TagName.FOOTER=new goog.dom.TagName("FOOTER"),goog.dom.TagName.FORM=new goog.dom.TagName("FORM"),goog.dom.TagName.FRAME=new goog.dom.TagName("FRAME"),goog.dom.TagName.FRAMESET=new goog.dom.TagName("FRAMESET"),goog.dom.TagName.H1=new goog.dom.TagName("H1"),goog.dom.TagName.H2=new goog.dom.TagName("H2"),goog.dom.TagName.H3=new goog.dom.TagName("H3"),goog.dom.TagName.H4=new goog.dom.TagName("H4"),goog.dom.TagName.H5=new goog.dom.TagName("H5"),goog.dom.TagName.H6=new goog.dom.TagName("H6"),goog.dom.TagName.HEAD=new goog.dom.TagName("HEAD"),goog.dom.TagName.HEADER=new goog.dom.TagName("HEADER"),goog.dom.TagName.HGROUP=new goog.dom.TagName("HGROUP"),goog.dom.TagName.HR=new goog.dom.TagName("HR"),goog.dom.TagName.HTML=new goog.dom.TagName("HTML"),goog.dom.TagName.I=new goog.dom.TagName("I"),goog.dom.TagName.IFRAME=new goog.dom.TagName("IFRAME"),goog.dom.TagName.IMG=new goog.dom.TagName("IMG"),goog.dom.TagName.INPUT=new goog.dom.TagName("INPUT"),goog.dom.TagName.INS=new goog.dom.TagName("INS"),goog.dom.TagName.ISINDEX=new goog.dom.TagName("ISINDEX"),goog.dom.TagName.KBD=new goog.dom.TagName("KBD"),goog.dom.TagName.KEYGEN=new goog.dom.TagName("KEYGEN"),goog.dom.TagName.LABEL=new goog.dom.TagName("LABEL"),goog.dom.TagName.LEGEND=new goog.dom.TagName("LEGEND"),goog.dom.TagName.LI=new goog.dom.TagName("LI"),goog.dom.TagName.LINK=new goog.dom.TagName("LINK"),goog.dom.TagName.MAIN=new goog.dom.TagName("MAIN"),goog.dom.TagName.MAP=new goog.dom.TagName("MAP"),goog.dom.TagName.MARK=new goog.dom.TagName("MARK"),goog.dom.TagName.MATH=new goog.dom.TagName("MATH"),goog.dom.TagName.MENU=new goog.dom.TagName("MENU"),goog.dom.TagName.MENUITEM=new goog.dom.TagName("MENUITEM"),goog.dom.TagName.META=new goog.dom.TagName("META"),goog.dom.TagName.METER=new goog.dom.TagName("METER"),goog.dom.TagName.NAV=new goog.dom.TagName("NAV"),goog.dom.TagName.NOFRAMES=new goog.dom.TagName("NOFRAMES"),goog.dom.TagName.NOSCRIPT=new goog.dom.TagName("NOSCRIPT"),goog.dom.TagName.OBJECT=new goog.dom.TagName("OBJECT"),goog.dom.TagName.OL=new goog.dom.TagName("OL"),goog.dom.TagName.OPTGROUP=new goog.dom.TagName("OPTGROUP"),goog.dom.TagName.OPTION=new goog.dom.TagName("OPTION"),goog.dom.TagName.OUTPUT=new goog.dom.TagName("OUTPUT"),goog.dom.TagName.P=new goog.dom.TagName("P"),goog.dom.TagName.PARAM=new goog.dom.TagName("PARAM"),goog.dom.TagName.PICTURE=new goog.dom.TagName("PICTURE"),goog.dom.TagName.PRE=new goog.dom.TagName("PRE"),goog.dom.TagName.PROGRESS=new goog.dom.TagName("PROGRESS"),goog.dom.TagName.Q=new goog.dom.TagName("Q"),goog.dom.TagName.RP=new goog.dom.TagName("RP"),goog.dom.TagName.RT=new goog.dom.TagName("RT"),goog.dom.TagName.RTC=new goog.dom.TagName("RTC"),goog.dom.TagName.RUBY=new goog.dom.TagName("RUBY"),goog.dom.TagName.S=new goog.dom.TagName("S"),goog.dom.TagName.SAMP=new goog.dom.TagName("SAMP"),goog.dom.TagName.SCRIPT=new goog.dom.TagName("SCRIPT"),goog.dom.TagName.SECTION=new goog.dom.TagName("SECTION"),goog.dom.TagName.SELECT=new goog.dom.TagName("SELECT"),goog.dom.TagName.SMALL=new goog.dom.TagName("SMALL"),goog.dom.TagName.SOURCE=new goog.dom.TagName("SOURCE"),goog.dom.TagName.SPAN=new goog.dom.TagName("SPAN"),goog.dom.TagName.STRIKE=new goog.dom.TagName("STRIKE"),goog.dom.TagName.STRONG=new goog.dom.TagName("STRONG"),goog.dom.TagName.STYLE=new goog.dom.TagName("STYLE"),goog.dom.TagName.SUB=new goog.dom.TagName("SUB"),goog.dom.TagName.SUMMARY=new goog.dom.TagName("SUMMARY"),goog.dom.TagName.SUP=new goog.dom.TagName("SUP"),goog.dom.TagName.SVG=new goog.dom.TagName("SVG"),goog.dom.TagName.TABLE=new goog.dom.TagName("TABLE"),goog.dom.TagName.TBODY=new goog.dom.TagName("TBODY"),goog.dom.TagName.TD=new goog.dom.TagName("TD"),goog.dom.TagName.TEMPLATE=new goog.dom.TagName("TEMPLATE"),goog.dom.TagName.TEXTAREA=new goog.dom.TagName("TEXTAREA"),goog.dom.TagName.TFOOT=new goog.dom.TagName("TFOOT"),goog.dom.TagName.TH=new goog.dom.TagName("TH"),goog.dom.TagName.THEAD=new goog.dom.TagName("THEAD"),goog.dom.TagName.TIME=new goog.dom.TagName("TIME"),goog.dom.TagName.TITLE=new goog.dom.TagName("TITLE"),goog.dom.TagName.TR=new goog.dom.TagName("TR"),goog.dom.TagName.TRACK=new goog.dom.TagName("TRACK"),goog.dom.TagName.TT=new goog.dom.TagName("TT"),goog.dom.TagName.U=new goog.dom.TagName("U"),goog.dom.TagName.UL=new goog.dom.TagName("UL"),goog.dom.TagName.VAR=new goog.dom.TagName("VAR"),goog.dom.TagName.VIDEO=new goog.dom.TagName("VIDEO"),goog.dom.TagName.WBR=new goog.dom.TagName("WBR"),goog.dom.tags={},goog.dom.tags.VOID_TAGS_={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},goog.dom.tags.isVoidTag=function(e){return!0===goog.dom.tags.VOID_TAGS_[e]},goog.html={},goog.html.trustedtypes={},goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY=goog.TRUSTED_TYPES_POLICY_NAME?goog.createTrustedTypesPolicy(goog.TRUSTED_TYPES_POLICY_NAME+"#html"):null,goog.string={},goog.string.TypedString=function(){},goog.string.Const=function(e,t){this.stringConstValueWithSecurityContract__googStringSecurityPrivate_=e===goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_&&t||"",this.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_=goog.string.Const.TYPE_MARKER_},goog.string.Const.prototype.implementsGoogStringTypedString=!0,goog.string.Const.prototype.getTypedStringValue=function(){return this.stringConstValueWithSecurityContract__googStringSecurityPrivate_},goog.string.Const.prototype.toString=function(){return"Const{"+this.stringConstValueWithSecurityContract__googStringSecurityPrivate_+"}"},goog.string.Const.unwrap=function(e){return e instanceof goog.string.Const&&e.constructor===goog.string.Const&&e.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_===goog.string.Const.TYPE_MARKER_?e.stringConstValueWithSecurityContract__googStringSecurityPrivate_:(goog.asserts.fail("expected object of type Const, got '"+e+"'"),"type_error:Const")},goog.string.Const.from=function(e){return new goog.string.Const(goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_,e)},goog.string.Const.TYPE_MARKER_={},goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_={},goog.string.Const.EMPTY=goog.string.Const.from(""),goog.html.SafeScript=function(){this.privateDoNotAccessOrElseSafeScriptWrappedValue_="",this.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeScript.prototype.implementsGoogStringTypedString=!0,goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeScript.fromConstant=function(e){return 0===(e=goog.string.Const.unwrap(e)).length?goog.html.SafeScript.EMPTY:goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeScript.fromConstantAndArgs=function(e,t){for(var n=[],r=1;r<arguments.length;r++)n.push(goog.html.SafeScript.stringify_(arguments[r]));return goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse("("+goog.string.Const.unwrap(e)+")("+n.join(", ")+");")},goog.html.SafeScript.fromJson=function(e){return goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(goog.html.SafeScript.stringify_(e))},goog.html.SafeScript.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeScriptWrappedValue_.toString()},goog.DEBUG&&(goog.html.SafeScript.prototype.toString=function(){return"SafeScript{"+this.privateDoNotAccessOrElseSafeScriptWrappedValue_+"}"}),goog.html.SafeScript.unwrap=function(e){return goog.html.SafeScript.unwrapTrustedScript(e).toString()},goog.html.SafeScript.unwrapTrustedScript=function(e){return e instanceof goog.html.SafeScript&&e.constructor===goog.html.SafeScript&&e.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeScriptWrappedValue_:(goog.asserts.fail("expected object of type SafeScript, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeScript")},goog.html.SafeScript.stringify_=function(e){return JSON.stringify(e).replace(/</g,"\\x3c")},goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse=function(e){return(new goog.html.SafeScript).initSecurityPrivateDoNotAccessOrElse_(e)},goog.html.SafeScript.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e){return this.privateDoNotAccessOrElseSafeScriptWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createScript(e):e,this},goog.html.SafeScript.EMPTY=goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(""),goog.fs={},goog.fs.url={},goog.fs.url.createObjectUrl=function(e){return goog.fs.url.getUrlObject_().createObjectURL(e)},goog.fs.url.revokeObjectUrl=function(e){goog.fs.url.getUrlObject_().revokeObjectURL(e)},goog.fs.url.getUrlObject_=function(){var e=goog.fs.url.findUrlObject_();if(null!=e)return e;throw Error("This browser doesn't seem to support blob URLs")},goog.fs.url.findUrlObject_=function(){return goog.isDef(goog.global.URL)&&goog.isDef(goog.global.URL.createObjectURL)?goog.global.URL:goog.isDef(goog.global.webkitURL)&&goog.isDef(goog.global.webkitURL.createObjectURL)?goog.global.webkitURL:goog.isDef(goog.global.createObjectURL)?goog.global:null},goog.fs.url.browserSupportsObjectUrls=function(){return null!=goog.fs.url.findUrlObject_()},goog.i18n={},goog.i18n.bidi={},goog.i18n.bidi.FORCE_RTL=!1,goog.i18n.bidi.IS_RTL=goog.i18n.bidi.FORCE_RTL||("ar"==goog.LOCALE.substring(0,2).toLowerCase()||"fa"==goog.LOCALE.substring(0,2).toLowerCase()||"he"==goog.LOCALE.substring(0,2).toLowerCase()||"iw"==goog.LOCALE.substring(0,2).toLowerCase()||"ps"==goog.LOCALE.substring(0,2).toLowerCase()||"sd"==goog.LOCALE.substring(0,2).toLowerCase()||"ug"==goog.LOCALE.substring(0,2).toLowerCase()||"ur"==goog.LOCALE.substring(0,2).toLowerCase()||"yi"==goog.LOCALE.substring(0,2).toLowerCase())&&(2==goog.LOCALE.length||"-"==goog.LOCALE.substring(2,3)||"_"==goog.LOCALE.substring(2,3))||3<=goog.LOCALE.length&&"ckb"==goog.LOCALE.substring(0,3).toLowerCase()&&(3==goog.LOCALE.length||"-"==goog.LOCALE.substring(3,4)||"_"==goog.LOCALE.substring(3,4))||7<=goog.LOCALE.length&&("-"==goog.LOCALE.substring(2,3)||"_"==goog.LOCALE.substring(2,3))&&("adlm"==goog.LOCALE.substring(3,7).toLowerCase()||"arab"==goog.LOCALE.substring(3,7).toLowerCase()||"hebr"==goog.LOCALE.substring(3,7).toLowerCase()||"nkoo"==goog.LOCALE.substring(3,7).toLowerCase()||"rohg"==goog.LOCALE.substring(3,7).toLowerCase()||"thaa"==goog.LOCALE.substring(3,7).toLowerCase())||8<=goog.LOCALE.length&&("-"==goog.LOCALE.substring(3,4)||"_"==goog.LOCALE.substring(3,4))&&("adlm"==goog.LOCALE.substring(4,8).toLowerCase()||"arab"==goog.LOCALE.substring(4,8).toLowerCase()||"hebr"==goog.LOCALE.substring(4,8).toLowerCase()||"nkoo"==goog.LOCALE.substring(4,8).toLowerCase()||"rohg"==goog.LOCALE.substring(4,8).toLowerCase()||"thaa"==goog.LOCALE.substring(4,8).toLowerCase()),goog.i18n.bidi.Format={LRE:"",RLE:"",PDF:"",LRM:"",RLM:""},goog.i18n.bidi.Dir={LTR:1,RTL:-1,NEUTRAL:0},goog.i18n.bidi.RIGHT="right",goog.i18n.bidi.LEFT="left",goog.i18n.bidi.I18N_RIGHT=goog.i18n.bidi.IS_RTL?goog.i18n.bidi.LEFT:goog.i18n.bidi.RIGHT,goog.i18n.bidi.I18N_LEFT=goog.i18n.bidi.IS_RTL?goog.i18n.bidi.RIGHT:goog.i18n.bidi.LEFT,goog.i18n.bidi.toDir=function(e,t){return"number"==typeof e?0<e?goog.i18n.bidi.Dir.LTR:0>e?goog.i18n.bidi.Dir.RTL:t?null:goog.i18n.bidi.Dir.NEUTRAL:null==e?null:e?goog.i18n.bidi.Dir.RTL:goog.i18n.bidi.Dir.LTR},goog.i18n.bidi.ltrChars_="A-Za-zÀ-ÖØ-öø-ʸ̀-ऀ-Ⰰ-\ud801\ud804-\ud839\ud83c-\udbff豈-︀--",goog.i18n.bidi.rtlChars_="֑-ۯۺ-ࣿ\ud802-\ud803\ud83a-\ud83bיִ-﷿ﹰ-ﻼ",goog.i18n.bidi.htmlSkipReg_=/<[^>]*>|&[^;]+;/g,goog.i18n.bidi.stripHtmlIfNeeded_=function(e,t){return t?e.replace(goog.i18n.bidi.htmlSkipReg_,""):e},goog.i18n.bidi.rtlCharReg_=new RegExp("["+goog.i18n.bidi.rtlChars_+"]"),goog.i18n.bidi.ltrCharReg_=new RegExp("["+goog.i18n.bidi.ltrChars_+"]"),goog.i18n.bidi.hasAnyRtl=function(e,t){return goog.i18n.bidi.rtlCharReg_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.hasRtlChar=goog.i18n.bidi.hasAnyRtl,goog.i18n.bidi.hasAnyLtr=function(e,t){return goog.i18n.bidi.ltrCharReg_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.ltrRe_=new RegExp("^["+goog.i18n.bidi.ltrChars_+"]"),goog.i18n.bidi.rtlRe_=new RegExp("^["+goog.i18n.bidi.rtlChars_+"]"),goog.i18n.bidi.isRtlChar=function(e){return goog.i18n.bidi.rtlRe_.test(e)},goog.i18n.bidi.isLtrChar=function(e){return goog.i18n.bidi.ltrRe_.test(e)},goog.i18n.bidi.isNeutralChar=function(e){return!goog.i18n.bidi.isLtrChar(e)&&!goog.i18n.bidi.isRtlChar(e)},goog.i18n.bidi.ltrDirCheckRe_=new RegExp("^[^"+goog.i18n.bidi.rtlChars_+"]*["+goog.i18n.bidi.ltrChars_+"]"),goog.i18n.bidi.rtlDirCheckRe_=new RegExp("^[^"+goog.i18n.bidi.ltrChars_+"]*["+goog.i18n.bidi.rtlChars_+"]"),goog.i18n.bidi.startsWithRtl=function(e,t){return goog.i18n.bidi.rtlDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isRtlText=goog.i18n.bidi.startsWithRtl,goog.i18n.bidi.startsWithLtr=function(e,t){return goog.i18n.bidi.ltrDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isLtrText=goog.i18n.bidi.startsWithLtr,goog.i18n.bidi.isRequiredLtrRe_=/^http:\/\/.*/,goog.i18n.bidi.isNeutralText=function(e,t){return e=goog.i18n.bidi.stripHtmlIfNeeded_(e,t),goog.i18n.bidi.isRequiredLtrRe_.test(e)||!goog.i18n.bidi.hasAnyLtr(e)&&!goog.i18n.bidi.hasAnyRtl(e)},goog.i18n.bidi.ltrExitDirCheckRe_=new RegExp("["+goog.i18n.bidi.ltrChars_+"][^"+goog.i18n.bidi.rtlChars_+"]*$"),goog.i18n.bidi.rtlExitDirCheckRe_=new RegExp("["+goog.i18n.bidi.rtlChars_+"][^"+goog.i18n.bidi.ltrChars_+"]*$"),goog.i18n.bidi.endsWithLtr=function(e,t){return goog.i18n.bidi.ltrExitDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isLtrExitText=goog.i18n.bidi.endsWithLtr,goog.i18n.bidi.endsWithRtl=function(e,t){return goog.i18n.bidi.rtlExitDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isRtlExitText=goog.i18n.bidi.endsWithRtl,goog.i18n.bidi.rtlLocalesRe_=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i,goog.i18n.bidi.isRtlLanguage=function(e){return goog.i18n.bidi.rtlLocalesRe_.test(e)},goog.i18n.bidi.bracketGuardTextRe_=/(\(.*?\)+)|(\[.*?\]+)|(\{.*?\}+)|(<.*?>+)/g,goog.i18n.bidi.guardBracketInText=function(e,t){return t=(void 0===t?goog.i18n.bidi.hasAnyRtl(e):t)?goog.i18n.bidi.Format.RLM:goog.i18n.bidi.Format.LRM,e.replace(goog.i18n.bidi.bracketGuardTextRe_,t+"$&"+t)},goog.i18n.bidi.enforceRtlInHtml=function(e){return"<"==e.charAt(0)?e.replace(/<\w+/,"$& dir=rtl"):"\n<span dir=rtl>"+e+"</span>"},goog.i18n.bidi.enforceRtlInText=function(e){return goog.i18n.bidi.Format.RLE+e+goog.i18n.bidi.Format.PDF},goog.i18n.bidi.enforceLtrInHtml=function(e){return"<"==e.charAt(0)?e.replace(/<\w+/,"$& dir=ltr"):"\n<span dir=ltr>"+e+"</span>"},goog.i18n.bidi.enforceLtrInText=function(e){return goog.i18n.bidi.Format.LRE+e+goog.i18n.bidi.Format.PDF},goog.i18n.bidi.dimensionsRe_=/:\s*([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)/g,goog.i18n.bidi.leftRe_=/left/gi,goog.i18n.bidi.rightRe_=/right/gi,goog.i18n.bidi.tempRe_=/%%%%/g,goog.i18n.bidi.mirrorCSS=function(e){return e.replace(goog.i18n.bidi.dimensionsRe_,":$1 $4 $3 $2").replace(goog.i18n.bidi.leftRe_,"%%%%").replace(goog.i18n.bidi.rightRe_,goog.i18n.bidi.LEFT).replace(goog.i18n.bidi.tempRe_,goog.i18n.bidi.RIGHT)},goog.i18n.bidi.doubleQuoteSubstituteRe_=/([\u0591-\u05f2])"/g,goog.i18n.bidi.singleQuoteSubstituteRe_=/([\u0591-\u05f2])'/g,goog.i18n.bidi.normalizeHebrewQuote=function(e){return e.replace(goog.i18n.bidi.doubleQuoteSubstituteRe_,"$1״").replace(goog.i18n.bidi.singleQuoteSubstituteRe_,"$1׳")},goog.i18n.bidi.wordSeparatorRe_=/\s+/,goog.i18n.bidi.hasNumeralsRe_=/[\d\u06f0-\u06f9]/,goog.i18n.bidi.rtlDetectionThreshold_=.4,goog.i18n.bidi.estimateDirection=function(e,t){var n=0,r=0,o=!1;for(e=goog.i18n.bidi.stripHtmlIfNeeded_(e,t).split(goog.i18n.bidi.wordSeparatorRe_),t=0;t<e.length;t++){var i=e[t];goog.i18n.bidi.startsWithRtl(i)?(n++,r++):goog.i18n.bidi.isRequiredLtrRe_.test(i)?o=!0:goog.i18n.bidi.hasAnyLtr(i)?r++:goog.i18n.bidi.hasNumeralsRe_.test(i)&&(o=!0)}return 0==r?o?goog.i18n.bidi.Dir.LTR:goog.i18n.bidi.Dir.NEUTRAL:n/r>goog.i18n.bidi.rtlDetectionThreshold_?goog.i18n.bidi.Dir.RTL:goog.i18n.bidi.Dir.LTR},goog.i18n.bidi.detectRtlDirectionality=function(e,t){return goog.i18n.bidi.estimateDirection(e,t)==goog.i18n.bidi.Dir.RTL},goog.i18n.bidi.setElementDirAndAlign=function(e,t){e&&(t=goog.i18n.bidi.toDir(t))&&(e.style.textAlign=t==goog.i18n.bidi.Dir.RTL?goog.i18n.bidi.RIGHT:goog.i18n.bidi.LEFT,e.dir=t==goog.i18n.bidi.Dir.RTL?"rtl":"ltr")},goog.i18n.bidi.setElementDirByTextDirectionality=function(e,t){switch(goog.i18n.bidi.estimateDirection(t)){case goog.i18n.bidi.Dir.LTR:e.dir="ltr";break;case goog.i18n.bidi.Dir.RTL:e.dir="rtl";break;default:e.removeAttribute("dir")}},goog.i18n.bidi.DirectionalString=function(){},goog.html.TrustedResourceUrl=function(){this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_="",this.trustedURL_=null,this.TRUSTED_RESOURCE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.TrustedResourceUrl.prototype.implementsGoogStringTypedString=!0,goog.html.TrustedResourceUrl.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_.toString()},goog.html.TrustedResourceUrl.prototype.implementsGoogI18nBidiDirectionalString=!0,goog.html.TrustedResourceUrl.prototype.getDirection=function(){return goog.i18n.bidi.Dir.LTR},goog.html.TrustedResourceUrl.prototype.cloneWithParams=function(e,t){var n=goog.html.TrustedResourceUrl.unwrap(this),r=(n=goog.html.TrustedResourceUrl.URL_PARAM_PARSER_.exec(n))[3]||"";return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(n[1]+goog.html.TrustedResourceUrl.stringifyParams_("?",n[2]||"",e)+goog.html.TrustedResourceUrl.stringifyParams_("#",r,t))},goog.DEBUG&&(goog.html.TrustedResourceUrl.prototype.toString=function(){return"TrustedResourceUrl{"+this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_+"}"}),goog.html.TrustedResourceUrl.unwrap=function(e){return goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(e).toString()},goog.html.TrustedResourceUrl.unwrapTrustedScriptURL=function(e){return e instanceof goog.html.TrustedResourceUrl&&e.constructor===goog.html.TrustedResourceUrl&&e.TRUSTED_RESOURCE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_:(goog.asserts.fail("expected object of type TrustedResourceUrl, got '"+e+"' of type "+goog.typeOf(e)),"type_error:TrustedResourceUrl")},goog.html.TrustedResourceUrl.unwrapTrustedURL=function(e){return e.trustedURL_?e.trustedURL_:goog.html.TrustedResourceUrl.unwrap(e)},goog.html.TrustedResourceUrl.format=function(e,t){var n=goog.string.Const.unwrap(e);if(!goog.html.TrustedResourceUrl.BASE_URL_.test(n))throw Error("Invalid TrustedResourceUrl format: "+n);return e=n.replace(goog.html.TrustedResourceUrl.FORMAT_MARKER_,(function(e,r){if(!Object.prototype.hasOwnProperty.call(t,r))throw Error('Found marker, "'+r+'", in format string, "'+n+'", but no valid label mapping found in args: '+JSON.stringify(t));return(e=t[r])instanceof goog.string.Const?goog.string.Const.unwrap(e):encodeURIComponent(String(e))})),goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.TrustedResourceUrl.FORMAT_MARKER_=/%{(\w+)}/g,goog.html.TrustedResourceUrl.BASE_URL_=/^((https:)?\/\/[0-9a-z.:[\]-]+\/|\/[^/\\]|[^:/\\%]+\/|[^:/\\%]*[?#]|about:blank#)/i,goog.html.TrustedResourceUrl.URL_PARAM_PARSER_=/^([^?#]*)(\?[^#]*)?(#[\s\S]*)?/,goog.html.TrustedResourceUrl.formatWithParams=function(e,t,n,r){return goog.html.TrustedResourceUrl.format(e,t).cloneWithParams(n,r)},goog.html.TrustedResourceUrl.fromConstant=function(e){return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap(e))},goog.html.TrustedResourceUrl.fromConstants=function(e){for(var t="",n=0;n<e.length;n++)t+=goog.string.Const.unwrap(e[n]);return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(t)},goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse=function(e){var t=new goog.html.TrustedResourceUrl;return t.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createScriptURL(e):e,goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY&&(t.trustedURL_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createURL(e)),t},goog.html.TrustedResourceUrl.stringifyParams_=function(e,t,n){if(null==n)return t;if(goog.isString(n))return n?e+encodeURIComponent(n):"";for(var r in n){var o=n[r];o=goog.isArray(o)?o:[o];for(var i=0;i<o.length;i++){var a=o[i];null!=a&&(t||(t=e),t+=(t.length>e.length?"&":"")+encodeURIComponent(r)+"="+encodeURIComponent(String(a)))}}return t},goog.string.internal={},goog.string.internal.startsWith=function(e,t){return 0==e.lastIndexOf(t,0)},goog.string.internal.endsWith=function(e,t){var n=e.length-t.length;return 0<=n&&e.indexOf(t,n)==n},goog.string.internal.caseInsensitiveStartsWith=function(e,t){return 0==goog.string.internal.caseInsensitiveCompare(t,e.substr(0,t.length))},goog.string.internal.caseInsensitiveEndsWith=function(e,t){return 0==goog.string.internal.caseInsensitiveCompare(t,e.substr(e.length-t.length,t.length))},goog.string.internal.caseInsensitiveEquals=function(e,t){return e.toLowerCase()==t.toLowerCase()},goog.string.internal.isEmptyOrWhitespace=function(e){return/^[\s\xa0]*$/.test(e)},goog.string.internal.trim=goog.TRUSTED_SITE&&String.prototype.trim?function(e){return e.trim()}:function(e){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(e)[1]},goog.string.internal.caseInsensitiveCompare=function(e,t){return(e=String(e).toLowerCase())<(t=String(t).toLowerCase())?-1:e==t?0:1},goog.string.internal.newLineToBr=function(e,t){return e.replace(/(\r\n|\r|\n)/g,t?"<br />":"<br>")},goog.string.internal.htmlEscape=function(e,t){if(t)e=e.replace(goog.string.internal.AMP_RE_,"&").replace(goog.string.internal.LT_RE_,"<").replace(goog.string.internal.GT_RE_,">").replace(goog.string.internal.QUOT_RE_,""").replace(goog.string.internal.SINGLE_QUOTE_RE_,"'").replace(goog.string.internal.NULL_RE_,"�");else{if(!goog.string.internal.ALL_RE_.test(e))return e;-1!=e.indexOf("&")&&(e=e.replace(goog.string.internal.AMP_RE_,"&")),-1!=e.indexOf("<")&&(e=e.replace(goog.string.internal.LT_RE_,"<")),-1!=e.indexOf(">")&&(e=e.replace(goog.string.internal.GT_RE_,">")),-1!=e.indexOf('"')&&(e=e.replace(goog.string.internal.QUOT_RE_,""")),-1!=e.indexOf("'")&&(e=e.replace(goog.string.internal.SINGLE_QUOTE_RE_,"'")),-1!=e.indexOf("\0")&&(e=e.replace(goog.string.internal.NULL_RE_,"�"))}return e},goog.string.internal.AMP_RE_=/&/g,goog.string.internal.LT_RE_=/</g,goog.string.internal.GT_RE_=/>/g,goog.string.internal.QUOT_RE_=/"/g,goog.string.internal.SINGLE_QUOTE_RE_=/'/g,goog.string.internal.NULL_RE_=/\x00/g,goog.string.internal.ALL_RE_=/[\x00&<>"']/,goog.string.internal.whitespaceEscape=function(e,t){return goog.string.internal.newLineToBr(e.replace(/ /g,"  "),t)},goog.string.internal.contains=function(e,t){return-1!=e.indexOf(t)},goog.string.internal.caseInsensitiveContains=function(e,t){return goog.string.internal.contains(e.toLowerCase(),t.toLowerCase())},goog.string.internal.compareVersions=function(e,t){var n=0;e=goog.string.internal.trim(String(e)).split("."),t=goog.string.internal.trim(String(t)).split(".");for(var r=Math.max(e.length,t.length),o=0;0==n&&o<r;o++){var i=e[o]||"",a=t[o]||"";do{if(i=/(\d*)(\D*)(.*)/.exec(i)||["","","",""],a=/(\d*)(\D*)(.*)/.exec(a)||["","","",""],0==i[0].length&&0==a[0].length)break;n=0==i[1].length?0:parseInt(i[1],10);var s=0==a[1].length?0:parseInt(a[1],10);n=goog.string.internal.compareElements_(n,s)||goog.string.internal.compareElements_(0==i[2].length,0==a[2].length)||goog.string.internal.compareElements_(i[2],a[2]),i=i[3],a=a[3]}while(0==n)}return n},goog.string.internal.compareElements_=function(e,t){return e<t?-1:e>t?1:0},goog.html.SafeUrl=function(){this.privateDoNotAccessOrElseSafeUrlWrappedValue_="",this.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeUrl.INNOCUOUS_STRING="about:invalid#zClosurez",goog.html.SafeUrl.prototype.implementsGoogStringTypedString=!0,goog.html.SafeUrl.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeUrlWrappedValue_.toString()},goog.html.SafeUrl.prototype.implementsGoogI18nBidiDirectionalString=!0,goog.html.SafeUrl.prototype.getDirection=function(){return goog.i18n.bidi.Dir.LTR},goog.DEBUG&&(goog.html.SafeUrl.prototype.toString=function(){return"SafeUrl{"+this.privateDoNotAccessOrElseSafeUrlWrappedValue_+"}"}),goog.html.SafeUrl.unwrap=function(e){return goog.html.SafeUrl.unwrapTrustedURL(e).toString()},goog.html.SafeUrl.unwrapTrustedURL=function(e){return e instanceof goog.html.SafeUrl&&e.constructor===goog.html.SafeUrl&&e.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeUrlWrappedValue_:(goog.asserts.fail("expected object of type SafeUrl, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeUrl")},goog.html.SafeUrl.fromConstant=function(e){return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap(e))},goog.html.SAFE_MIME_TYPE_PATTERN_=/^(?:audio\/(?:3gpp2|3gpp|aac|L16|midi|mp3|mp4|mpeg|oga|ogg|opus|x-m4a|x-wav|wav|webm)|image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp|x-icon)|text\/csv|video\/(?:mpeg|mp4|ogg|webm|quicktime))(?:;\w+=(?:\w+|"[\w;=]+"))*$/i,goog.html.SafeUrl.isSafeMimeType=function(e){return goog.html.SAFE_MIME_TYPE_PATTERN_.test(e)},goog.html.SafeUrl.fromBlob=function(e){return e=goog.html.SAFE_MIME_TYPE_PATTERN_.test(e.type)?goog.fs.url.createObjectUrl(e):goog.html.SafeUrl.INNOCUOUS_STRING,goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.DATA_URL_PATTERN_=/^data:([^,]*);base64,[a-z0-9+\/]+=*$/i,goog.html.SafeUrl.fromDataUrl=function(e){var t=(e=e.replace(/(%0A|%0D)/g,"")).match(goog.html.DATA_URL_PATTERN_);return t=t&&goog.html.SAFE_MIME_TYPE_PATTERN_.test(t[1]),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(t?e:goog.html.SafeUrl.INNOCUOUS_STRING)},goog.html.SafeUrl.fromTelUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"tel:")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SIP_URL_PATTERN_=/^sip[s]?:[+a-z0-9_.!$%&'*\/=^`{|}~-]+@([a-z0-9-]+\.)+[a-z0-9]{2,63}$/i,goog.html.SafeUrl.fromSipUrl=function(e){return goog.html.SIP_URL_PATTERN_.test(decodeURIComponent(e))||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.fromFacebookMessengerUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"fb-messenger://share")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.fromWhatsAppUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"whatsapp://send")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.fromSmsUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"sms:")&&goog.html.SafeUrl.isSmsUrlBodyValid_(e)||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.isSmsUrlBodyValid_=function(e){var t=e.indexOf("#");if(0<t&&(e=e.substring(0,t)),!(t=e.match(/[?&]body=/gi)))return!0;if(1<t.length)return!1;if(!(e=e.match(/[?&]body=([^&]*)/)[1]))return!0;try{decodeURIComponent(e)}catch(e){return!1}return/^(?:[a-z0-9\-_.~]|%[0-9a-f]{2})+$/i.test(e)},goog.html.SafeUrl.fromSshUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"ssh://")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.sanitizeChromeExtensionUrl=function(e,t){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^chrome-extension:\/\/([^\/]+)\//,e,t)},goog.html.SafeUrl.sanitizeFirefoxExtensionUrl=function(e,t){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^moz-extension:\/\/([^\/]+)\//,e,t)},goog.html.SafeUrl.sanitizeEdgeExtensionUrl=function(e,t){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^ms-browser-extension:\/\/([^\/]+)\//,e,t)},goog.html.SafeUrl.sanitizeExtensionUrl_=function(e,t,n){return(e=e.exec(t))?(e=e[1],-1==(n instanceof goog.string.Const?[goog.string.Const.unwrap(n)]:n.map((function(e){return goog.string.Const.unwrap(e)}))).indexOf(e)&&(t=goog.html.SafeUrl.INNOCUOUS_STRING)):t=goog.html.SafeUrl.INNOCUOUS_STRING,goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(t)},goog.html.SafeUrl.fromTrustedResourceUrl=function(e){return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(goog.html.TrustedResourceUrl.unwrap(e))},goog.html.SAFE_URL_PATTERN_=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i,goog.html.SafeUrl.SAFE_URL_PATTERN=goog.html.SAFE_URL_PATTERN_,goog.html.SafeUrl.sanitize=function(e){return e instanceof goog.html.SafeUrl?e:(e="object"==typeof e&&e.implementsGoogStringTypedString?e.getTypedStringValue():String(e),goog.html.SAFE_URL_PATTERN_.test(e)||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e))},goog.html.SafeUrl.sanitizeAssertUnchanged=function(e,t){return e instanceof goog.html.SafeUrl?e:(e="object"==typeof e&&e.implementsGoogStringTypedString?e.getTypedStringValue():String(e),t&&/^data:/i.test(e)&&(t=goog.html.SafeUrl.fromDataUrl(e)).getTypedStringValue()==e?t:(goog.asserts.assert(goog.html.SAFE_URL_PATTERN_.test(e),"%s does not match the safe URL pattern",e)||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)))},goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse=function(e){var t=new goog.html.SafeUrl;return t.privateDoNotAccessOrElseSafeUrlWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createURL(e):e,t},goog.html.SafeUrl.ABOUT_BLANK=goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse("about:blank"),goog.html.SafeStyle=function(){this.privateDoNotAccessOrElseSafeStyleWrappedValue_="",this.SAFE_STYLE_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeStyle.prototype.implementsGoogStringTypedString=!0,goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeStyle.fromConstant=function(e){return 0===(e=goog.string.Const.unwrap(e)).length?goog.html.SafeStyle.EMPTY:(goog.asserts.assert(goog.string.internal.endsWith(e,";"),"Last character of style string is not ';': "+e),goog.asserts.assert(goog.string.internal.contains(e,":"),"Style string must contain at least one ':', to specify a \"name: value\" pair: "+e),goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(e))},goog.html.SafeStyle.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeStyleWrappedValue_},goog.DEBUG&&(goog.html.SafeStyle.prototype.toString=function(){return"SafeStyle{"+this.privateDoNotAccessOrElseSafeStyleWrappedValue_+"}"}),goog.html.SafeStyle.unwrap=function(e){return e instanceof goog.html.SafeStyle&&e.constructor===goog.html.SafeStyle&&e.SAFE_STYLE_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeStyleWrappedValue_:(goog.asserts.fail("expected object of type SafeStyle, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeStyle")},goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse=function(e){return(new goog.html.SafeStyle).initSecurityPrivateDoNotAccessOrElse_(e)},goog.html.SafeStyle.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e){return this.privateDoNotAccessOrElseSafeStyleWrappedValue_=e,this},goog.html.SafeStyle.EMPTY=goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(""),goog.html.SafeStyle.INNOCUOUS_STRING="zClosurez",goog.html.SafeStyle.create=function(e){var t,n="";for(t in e){if(!/^[-_a-zA-Z0-9]+$/.test(t))throw Error("Name allows only [-_a-zA-Z0-9], got: "+t);var r=e[t];null!=r&&(n+=t+":"+(r=goog.isArray(r)?goog.array.map(r,goog.html.SafeStyle.sanitizePropertyValue_).join(" "):goog.html.SafeStyle.sanitizePropertyValue_(r))+";")}return n?goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(n):goog.html.SafeStyle.EMPTY},goog.html.SafeStyle.sanitizePropertyValue_=function(e){if(e instanceof goog.html.SafeUrl)return'url("'+goog.html.SafeUrl.unwrap(e).replace(/</g,"%3c").replace(/[\\"]/g,"\\$&")+'")';if(e=e instanceof goog.string.Const?goog.string.Const.unwrap(e):goog.html.SafeStyle.sanitizePropertyValueString_(String(e)),/[{;}]/.test(e))throw new goog.asserts.AssertionError("Value does not allow [{;}], got: %s.",[e]);return e},goog.html.SafeStyle.sanitizePropertyValueString_=function(e){var t=e.replace(goog.html.SafeStyle.FUNCTIONS_RE_,"$1").replace(goog.html.SafeStyle.FUNCTIONS_RE_,"$1").replace(goog.html.SafeStyle.URL_RE_,"url");return goog.html.SafeStyle.VALUE_RE_.test(t)?goog.html.SafeStyle.COMMENT_RE_.test(e)?(goog.asserts.fail("String value disallows comments, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING):goog.html.SafeStyle.hasBalancedQuotes_(e)?goog.html.SafeStyle.hasBalancedSquareBrackets_(e)?goog.html.SafeStyle.sanitizeUrl_(e):(goog.asserts.fail("String value requires balanced square brackets and one identifier per pair of brackets, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING):(goog.asserts.fail("String value requires balanced quotes, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING):(goog.asserts.fail("String value allows only "+goog.html.SafeStyle.VALUE_ALLOWED_CHARS_+" and simple functions, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING)},goog.html.SafeStyle.hasBalancedQuotes_=function(e){for(var t=!0,n=!0,r=0;r<e.length;r++){var o=e.charAt(r);"'"==o&&n?t=!t:'"'==o&&t&&(n=!n)}return t&&n},goog.html.SafeStyle.hasBalancedSquareBrackets_=function(e){for(var t=!0,n=/^[-_a-zA-Z0-9]$/,r=0;r<e.length;r++){var o=e.charAt(r);if("]"==o){if(t)return!1;t=!0}else if("["==o){if(!t)return!1;t=!1}else if(!t&&!n.test(o))return!1}return t},goog.html.SafeStyle.VALUE_ALLOWED_CHARS_="[-,.\"'%_!# a-zA-Z0-9\\[\\]]",goog.html.SafeStyle.VALUE_RE_=new RegExp("^"+goog.html.SafeStyle.VALUE_ALLOWED_CHARS_+"+$"),goog.html.SafeStyle.URL_RE_=/\b(url\([ \t\n]*)('[ -&(-\[\]-~]*'|"[ !#-\[\]-~]*"|[!#-&*-\[\]-~]*)([ \t\n]*\))/g,goog.html.SafeStyle.FUNCTIONS_RE_=/\b(hsl|hsla|rgb|rgba|matrix|calc|minmax|fit-content|repeat|(rotate|scale|translate)(X|Y|Z|3d)?)\([-+*/0-9a-z.%\[\], ]+\)/g,goog.html.SafeStyle.COMMENT_RE_=/\/\*/,goog.html.SafeStyle.sanitizeUrl_=function(e){return e.replace(goog.html.SafeStyle.URL_RE_,(function(e,t,n,r){var o="";return n=n.replace(/^(['"])(.*)\1$/,(function(e,t,n){return o=t,n})),e=goog.html.SafeUrl.sanitize(n).getTypedStringValue(),t+o+e+o+r}))},goog.html.SafeStyle.concat=function(e){var t="",n=function(e){goog.isArray(e)?goog.array.forEach(e,n):t+=goog.html.SafeStyle.unwrap(e)};return goog.array.forEach(arguments,n),t?goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(t):goog.html.SafeStyle.EMPTY},goog.html.SafeStyleSheet=function(){this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_="",this.SAFE_STYLE_SHEET_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeStyleSheet.prototype.implementsGoogStringTypedString=!0,goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeStyleSheet.createRule=function(e,t){if(goog.string.internal.contains(e,"<"))throw Error("Selector does not allow '<', got: "+e);var n=e.replace(/('|")((?!\1)[^\r\n\f\\]|\\[\s\S])*\1/g,"");if(!/^[-_a-zA-Z0-9#.:* ,>+~[\]()=^$|]+$/.test(n))throw Error("Selector allows only [-_a-zA-Z0-9#.:* ,>+~[\\]()=^$|] and strings, got: "+e);if(!goog.html.SafeStyleSheet.hasBalancedBrackets_(n))throw Error("() and [] in selector must be balanced, got: "+e);return t instanceof goog.html.SafeStyle||(t=goog.html.SafeStyle.create(t)),e=e+"{"+goog.html.SafeStyle.unwrap(t).replace(/</g,"\\3C ")+"}",goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeStyleSheet.hasBalancedBrackets_=function(e){for(var t={"(":")","[":"]"},n=[],r=0;r<e.length;r++){var o=e[r];if(t[o])n.push(t[o]);else if(goog.object.contains(t,o)&&n.pop()!=o)return!1}return 0==n.length},goog.html.SafeStyleSheet.concat=function(e){var t="",n=function(e){goog.isArray(e)?goog.array.forEach(e,n):t+=goog.html.SafeStyleSheet.unwrap(e)};return goog.array.forEach(arguments,n),goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(t)},goog.html.SafeStyleSheet.fromConstant=function(e){return 0===(e=goog.string.Const.unwrap(e)).length?goog.html.SafeStyleSheet.EMPTY:(goog.asserts.assert(!goog.string.internal.contains(e,"<"),"Forbidden '<' character in style sheet string: "+e),goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(e))},goog.html.SafeStyleSheet.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_},goog.DEBUG&&(goog.html.SafeStyleSheet.prototype.toString=function(){return"SafeStyleSheet{"+this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_+"}"}),goog.html.SafeStyleSheet.unwrap=function(e){return e instanceof goog.html.SafeStyleSheet&&e.constructor===goog.html.SafeStyleSheet&&e.SAFE_STYLE_SHEET_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_:(goog.asserts.fail("expected object of type SafeStyleSheet, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeStyleSheet")},goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse=function(e){return(new goog.html.SafeStyleSheet).initSecurityPrivateDoNotAccessOrElse_(e)},goog.html.SafeStyleSheet.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e){return this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_=e,this},goog.html.SafeStyleSheet.EMPTY=goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(""),goog.labs={},goog.labs.userAgent={},goog.labs.userAgent.util={},goog.labs.userAgent.util.getNativeUserAgentString_=function(){var e=goog.labs.userAgent.util.getNavigator_();return e&&(e=e.userAgent)?e:""},goog.labs.userAgent.util.getNavigator_=function(){return goog.global.navigator},goog.labs.userAgent.util.userAgent_=goog.labs.userAgent.util.getNativeUserAgentString_(),goog.labs.userAgent.util.setUserAgent=function(e){goog.labs.userAgent.util.userAgent_=e||goog.labs.userAgent.util.getNativeUserAgentString_()},goog.labs.userAgent.util.getUserAgent=function(){return goog.labs.userAgent.util.userAgent_},goog.labs.userAgent.util.matchUserAgent=function(e){var t=goog.labs.userAgent.util.getUserAgent();return goog.string.internal.contains(t,e)},goog.labs.userAgent.util.matchUserAgentIgnoreCase=function(e){var t=goog.labs.userAgent.util.getUserAgent();return goog.string.internal.caseInsensitiveContains(t,e)},goog.labs.userAgent.util.extractVersionTuples=function(e){for(var t,n=/(\w[\w ]+)\/([^\s]+)\s*(?:\((.*?)\))?/g,r=[];t=n.exec(e);)r.push([t[1],t[2],t[3]||void 0]);return r},goog.labs.userAgent.browser={},goog.labs.userAgent.browser.matchOpera_=function(){return goog.labs.userAgent.util.matchUserAgent("Opera")},goog.labs.userAgent.browser.matchIE_=function(){return goog.labs.userAgent.util.matchUserAgent("Trident")||goog.labs.userAgent.util.matchUserAgent("MSIE")},goog.labs.userAgent.browser.matchEdgeHtml_=function(){return goog.labs.userAgent.util.matchUserAgent("Edge")},goog.labs.userAgent.browser.matchEdgeChromium_=function(){return goog.labs.userAgent.util.matchUserAgent("Edg/")},goog.labs.userAgent.browser.matchOperaChromium_=function(){return goog.labs.userAgent.util.matchUserAgent("OPR")},goog.labs.userAgent.browser.matchFirefox_=function(){return goog.labs.userAgent.util.matchUserAgent("Firefox")||goog.labs.userAgent.util.matchUserAgent("FxiOS")},goog.labs.userAgent.browser.matchSafari_=function(){return goog.labs.userAgent.util.matchUserAgent("Safari")&&!(goog.labs.userAgent.browser.matchChrome_()||goog.labs.userAgent.browser.matchCoast_()||goog.labs.userAgent.browser.matchOpera_()||goog.labs.userAgent.browser.matchEdgeHtml_()||goog.labs.userAgent.browser.matchEdgeChromium_()||goog.labs.userAgent.browser.matchOperaChromium_()||goog.labs.userAgent.browser.matchFirefox_()||goog.labs.userAgent.browser.isSilk()||goog.labs.userAgent.util.matchUserAgent("Android"))},goog.labs.userAgent.browser.matchCoast_=function(){return goog.labs.userAgent.util.matchUserAgent("Coast")},goog.labs.userAgent.browser.matchIosWebview_=function(){return(goog.labs.userAgent.util.matchUserAgent("iPad")||goog.labs.userAgent.util.matchUserAgent("iPhone"))&&!goog.labs.userAgent.browser.matchSafari_()&&!goog.labs.userAgent.browser.matchChrome_()&&!goog.labs.userAgent.browser.matchCoast_()&&!goog.labs.userAgent.browser.matchFirefox_()&&goog.labs.userAgent.util.matchUserAgent("AppleWebKit")},goog.labs.userAgent.browser.matchChrome_=function(){return(goog.labs.userAgent.util.matchUserAgent("Chrome")||goog.labs.userAgent.util.matchUserAgent("CriOS"))&&!goog.labs.userAgent.browser.matchEdgeHtml_()},goog.labs.userAgent.browser.matchAndroidBrowser_=function(){return goog.labs.userAgent.util.matchUserAgent("Android")&&!(goog.labs.userAgent.browser.isChrome()||goog.labs.userAgent.browser.isFirefox()||goog.labs.userAgent.browser.isOpera()||goog.labs.userAgent.browser.isSilk())},goog.labs.userAgent.browser.isOpera=goog.labs.userAgent.browser.matchOpera_,goog.labs.userAgent.browser.isIE=goog.labs.userAgent.browser.matchIE_,goog.labs.userAgent.browser.isEdge=goog.labs.userAgent.browser.matchEdgeHtml_,goog.labs.userAgent.browser.isEdgeChromium=goog.labs.userAgent.browser.matchEdgeChromium_,goog.labs.userAgent.browser.isOperaChromium=goog.labs.userAgent.browser.matchOperaChromium_,goog.labs.userAgent.browser.isFirefox=goog.labs.userAgent.browser.matchFirefox_,goog.labs.userAgent.browser.isSafari=goog.labs.userAgent.browser.matchSafari_,goog.labs.userAgent.browser.isCoast=goog.labs.userAgent.browser.matchCoast_,goog.labs.userAgent.browser.isIosWebview=goog.labs.userAgent.browser.matchIosWebview_,goog.labs.userAgent.browser.isChrome=goog.labs.userAgent.browser.matchChrome_,goog.labs.userAgent.browser.isAndroidBrowser=goog.labs.userAgent.browser.matchAndroidBrowser_,goog.labs.userAgent.browser.isSilk=function(){return goog.labs.userAgent.util.matchUserAgent("Silk")},goog.labs.userAgent.browser.getVersion=function(){function e(e){return e=goog.array.find(e,r),n[e]||""}var t=goog.labs.userAgent.util.getUserAgent();if(goog.labs.userAgent.browser.isIE())return goog.labs.userAgent.browser.getIEVersion_(t);t=goog.labs.userAgent.util.extractVersionTuples(t);var n={};goog.array.forEach(t,(function(e){n[e[0]]=e[1]}));var r=goog.partial(goog.object.containsKey,n);return goog.labs.userAgent.browser.isOpera()?e(["Version","Opera"]):goog.labs.userAgent.browser.isEdge()?e(["Edge"]):goog.labs.userAgent.browser.isEdgeChromium()?e(["Edg"]):goog.labs.userAgent.browser.isChrome()?e(["Chrome","CriOS"]):(t=t[2])&&t[1]||""},goog.labs.userAgent.browser.isVersionOrHigher=function(e){return 0<=goog.string.internal.compareVersions(goog.labs.userAgent.browser.getVersion(),e)},goog.labs.userAgent.browser.getIEVersion_=function(e){var t=/rv: *([\d\.]*)/.exec(e);if(t&&t[1])return t[1];t="";var n=/MSIE +([\d\.]+)/.exec(e);if(n&&n[1])if(e=/Trident\/(\d.\d)/.exec(e),"7.0"==n[1])if(e&&e[1])switch(e[1]){case"4.0":t="8.0";break;case"5.0":t="9.0";break;case"6.0":t="10.0";break;case"7.0":t="11.0"}else t="7.0";else t=n[1];return t},goog.html.SafeHtml=function(){this.privateDoNotAccessOrElseSafeHtmlWrappedValue_="",this.SAFE_HTML_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_,this.dir_=null},goog.html.SafeHtml.prototype.implementsGoogI18nBidiDirectionalString=!0,goog.html.SafeHtml.prototype.getDirection=function(){return this.dir_},goog.html.SafeHtml.prototype.implementsGoogStringTypedString=!0,goog.html.SafeHtml.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeHtmlWrappedValue_.toString()},goog.DEBUG&&(goog.html.SafeHtml.prototype.toString=function(){return"SafeHtml{"+this.privateDoNotAccessOrElseSafeHtmlWrappedValue_+"}"}),goog.html.SafeHtml.unwrap=function(e){return goog.html.SafeHtml.unwrapTrustedHTML(e).toString()},goog.html.SafeHtml.unwrapTrustedHTML=function(e){return e instanceof goog.html.SafeHtml&&e.constructor===goog.html.SafeHtml&&e.SAFE_HTML_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeHtmlWrappedValue_:(goog.asserts.fail("expected object of type SafeHtml, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeHtml")},goog.html.SafeHtml.htmlEscape=function(e){if(e instanceof goog.html.SafeHtml)return e;var t="object"==typeof e,n=null;return t&&e.implementsGoogI18nBidiDirectionalString&&(n=e.getDirection()),e=t&&e.implementsGoogStringTypedString?e.getTypedStringValue():String(e),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.htmlEscape(e),n)},goog.html.SafeHtml.htmlEscapePreservingNewlines=function(e){return e instanceof goog.html.SafeHtml?e:(e=goog.html.SafeHtml.htmlEscape(e),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.newLineToBr(goog.html.SafeHtml.unwrap(e)),e.getDirection()))},goog.html.SafeHtml.htmlEscapePreservingNewlinesAndSpaces=function(e){return e instanceof goog.html.SafeHtml?e:(e=goog.html.SafeHtml.htmlEscape(e),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.whitespaceEscape(goog.html.SafeHtml.unwrap(e)),e.getDirection()))},goog.html.SafeHtml.from=goog.html.SafeHtml.htmlEscape,goog.html.SafeHtml.VALID_NAMES_IN_TAG_=/^[a-zA-Z0-9-]+$/,goog.html.SafeHtml.URL_ATTRIBUTES_={action:!0,cite:!0,data:!0,formaction:!0,href:!0,manifest:!0,poster:!0,src:!0},goog.html.SafeHtml.NOT_ALLOWED_TAG_NAMES_={APPLET:!0,BASE:!0,EMBED:!0,IFRAME:!0,LINK:!0,MATH:!0,META:!0,OBJECT:!0,SCRIPT:!0,STYLE:!0,SVG:!0,TEMPLATE:!0},goog.html.SafeHtml.create=function(e,t,n){return goog.html.SafeHtml.verifyTagName(String(e)),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse(String(e),t,n)},goog.html.SafeHtml.verifyTagName=function(e){if(!goog.html.SafeHtml.VALID_NAMES_IN_TAG_.test(e))throw Error("Invalid tag name <"+e+">.");if(e.toUpperCase()in goog.html.SafeHtml.NOT_ALLOWED_TAG_NAMES_)throw Error("Tag name <"+e+"> is not allowed for SafeHtml.")},goog.html.SafeHtml.createIframe=function(e,t,n,r){e&&goog.html.TrustedResourceUrl.unwrap(e);var o={};return o.src=e||null,o.srcdoc=t&&goog.html.SafeHtml.unwrap(t),e=goog.html.SafeHtml.combineAttributes(o,{sandbox:""},n),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("iframe",e,r)},goog.html.SafeHtml.createSandboxIframe=function(e,t,n,r){if(!goog.html.SafeHtml.canUseSandboxIframe())throw Error("The browser does not support sandboxed iframes.");var o={};return o.src=e?goog.html.SafeUrl.unwrap(goog.html.SafeUrl.sanitize(e)):null,o.srcdoc=t||null,o.sandbox="",e=goog.html.SafeHtml.combineAttributes(o,{},n),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("iframe",e,r)},goog.html.SafeHtml.canUseSandboxIframe=function(){return goog.global.HTMLIFrameElement&&"sandbox"in goog.global.HTMLIFrameElement.prototype},goog.html.SafeHtml.createScriptSrc=function(e,t){return goog.html.TrustedResourceUrl.unwrap(e),e=goog.html.SafeHtml.combineAttributes({src:e},{},t),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("script",e)},goog.html.SafeHtml.createScript=function(e,t){for(var n in t){var r=n.toLowerCase();if("language"==r||"src"==r||"text"==r||"type"==r)throw Error('Cannot set "'+r+'" attribute')}for(n="",e=goog.array.concat(e),r=0;r<e.length;r++)n+=goog.html.SafeScript.unwrap(e[r]);return e=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(n,goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("script",t,e)},goog.html.SafeHtml.createStyle=function(e,t){t=goog.html.SafeHtml.combineAttributes({type:"text/css"},{},t);var n="";e=goog.array.concat(e);for(var r=0;r<e.length;r++)n+=goog.html.SafeStyleSheet.unwrap(e[r]);return e=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(n,goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("style",t,e)},goog.html.SafeHtml.createMetaRefresh=function(e,t){return e=goog.html.SafeUrl.unwrap(goog.html.SafeUrl.sanitize(e)),(goog.labs.userAgent.browser.isIE()||goog.labs.userAgent.browser.isEdge())&&goog.string.internal.contains(e,";")&&(e="'"+e.replace(/'/g,"%27")+"'"),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("meta",{"http-equiv":"refresh",content:(t||0)+"; url="+e})},goog.html.SafeHtml.getAttrNameAndValue_=function(e,t,n){if(n instanceof goog.string.Const)n=goog.string.Const.unwrap(n);else if("style"==t.toLowerCase())n=goog.html.SafeHtml.getStyleValue_(n);else{if(/^on/i.test(t))throw Error('Attribute "'+t+'" requires goog.string.Const value, "'+n+'" given.');if(t.toLowerCase()in goog.html.SafeHtml.URL_ATTRIBUTES_)if(n instanceof goog.html.TrustedResourceUrl)n=goog.html.TrustedResourceUrl.unwrap(n);else if(n instanceof goog.html.SafeUrl)n=goog.html.SafeUrl.unwrap(n);else{if(!goog.isString(n))throw Error('Attribute "'+t+'" on tag "'+e+'" requires goog.html.SafeUrl, goog.string.Const, or string, value "'+n+'" given.');n=goog.html.SafeUrl.sanitize(n).getTypedStringValue()}}return n.implementsGoogStringTypedString&&(n=n.getTypedStringValue()),goog.asserts.assert(goog.isString(n)||goog.isNumber(n),"String or number value expected, got "+typeof n+" with value: "+n),t+'="'+goog.string.internal.htmlEscape(String(n))+'"'},goog.html.SafeHtml.getStyleValue_=function(e){if(!goog.isObject(e))throw Error('The "style" attribute requires goog.html.SafeStyle or map of style properties, '+typeof e+" given: "+e);return e instanceof goog.html.SafeStyle||(e=goog.html.SafeStyle.create(e)),goog.html.SafeStyle.unwrap(e)},goog.html.SafeHtml.createWithDir=function(e,t,n,r){return(t=goog.html.SafeHtml.create(t,n,r)).dir_=e,t},goog.html.SafeHtml.join=function(e,t){var n=(e=goog.html.SafeHtml.htmlEscape(e)).getDirection(),r=[],o=function(e){goog.isArray(e)?goog.array.forEach(e,o):(e=goog.html.SafeHtml.htmlEscape(e),r.push(goog.html.SafeHtml.unwrap(e)),e=e.getDirection(),n==goog.i18n.bidi.Dir.NEUTRAL?n=e:e!=goog.i18n.bidi.Dir.NEUTRAL&&n!=e&&(n=null))};return goog.array.forEach(t,o),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(r.join(goog.html.SafeHtml.unwrap(e)),n)},goog.html.SafeHtml.concat=function(e){return goog.html.SafeHtml.join(goog.html.SafeHtml.EMPTY,Array.prototype.slice.call(arguments))},goog.html.SafeHtml.concatWithDir=function(e,t){var n=goog.html.SafeHtml.concat(goog.array.slice(arguments,1));return n.dir_=e,n},goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse=function(e,t){return(new goog.html.SafeHtml).initSecurityPrivateDoNotAccessOrElse_(e,t)},goog.html.SafeHtml.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e,t){return this.privateDoNotAccessOrElseSafeHtmlWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createHTML(e):e,this.dir_=t,this},goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse=function(e,t,n){var r=null,o="<"+e+goog.html.SafeHtml.stringifyAttributes(e,t);return goog.isDefAndNotNull(n)?goog.isArray(n)||(n=[n]):n=[],goog.dom.tags.isVoidTag(e.toLowerCase())?(goog.asserts.assert(!n.length,"Void tag <"+e+"> does not allow content."),o+=">"):(r=goog.html.SafeHtml.concat(n),o+=">"+goog.html.SafeHtml.unwrap(r)+"</"+e+">",r=r.getDirection()),(e=t&&t.dir)&&(r=/^(ltr|rtl|auto)$/i.test(e)?goog.i18n.bidi.Dir.NEUTRAL:null),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(o,r)},goog.html.SafeHtml.stringifyAttributes=function(e,t){var n="";if(t)for(var r in t){if(!goog.html.SafeHtml.VALID_NAMES_IN_TAG_.test(r))throw Error('Invalid attribute name "'+r+'".');var o=t[r];goog.isDefAndNotNull(o)&&(n+=" "+goog.html.SafeHtml.getAttrNameAndValue_(e,r,o))}return n},goog.html.SafeHtml.combineAttributes=function(e,t,n){var r,o={};for(r in e)goog.asserts.assert(r.toLowerCase()==r,"Must be lower case"),o[r]=e[r];for(r in t)goog.asserts.assert(r.toLowerCase()==r,"Must be lower case"),o[r]=t[r];for(r in n){var i=r.toLowerCase();if(i in e)throw Error('Cannot override "'+i+'" attribute, got "'+r+'" with value "'+n[r]+'"');i in t&&delete o[i],o[r]=n[r]}return o},goog.html.SafeHtml.DOCTYPE_HTML=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("<!DOCTYPE html>",goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.EMPTY=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("",goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.BR=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("<br>",goog.i18n.bidi.Dir.NEUTRAL),goog.html.uncheckedconversions={},goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract=function(e,t,n){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(t,n||null)},goog.html.uncheckedconversions.safeScriptFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.safeStyleFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.safeStyleSheetFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.safeUrlFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.trustedResourceUrlFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(t)},goog.dom.safe={},goog.dom.safe.InsertAdjacentHtmlPosition={AFTERBEGIN:"afterbegin",AFTEREND:"afterend",BEFOREBEGIN:"beforebegin",BEFOREEND:"beforeend"},goog.dom.safe.insertAdjacentHtml=function(e,t,n){e.insertAdjacentHTML(t,goog.html.SafeHtml.unwrapTrustedHTML(n))},goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_={MATH:!0,SCRIPT:!0,STYLE:!0,SVG:!0,TEMPLATE:!0},goog.dom.safe.isInnerHtmlCleanupRecursive_=goog.functions.cacheReturnValue((function(){if(goog.DEBUG&&"undefined"==typeof document)return!1;var e=document.createElement("div"),t=document.createElement("div");return t.appendChild(document.createElement("div")),e.appendChild(t),!(goog.DEBUG&&!e.firstChild)&&(t=e.firstChild.firstChild,e.innerHTML=goog.html.SafeHtml.unwrapTrustedHTML(goog.html.SafeHtml.EMPTY),!t.parentElement)})),goog.dom.safe.unsafeSetInnerHtmlDoNotUseOrElse=function(e,t){if(goog.dom.safe.isInnerHtmlCleanupRecursive_())for(;e.lastChild;)e.removeChild(e.lastChild);e.innerHTML=goog.html.SafeHtml.unwrapTrustedHTML(t)},goog.dom.safe.setInnerHtml=function(e,t){if(goog.asserts.ENABLE_ASSERTS){var n=e.tagName.toUpperCase();if(goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_[n])throw Error("goog.dom.safe.setInnerHtml cannot be used to set content of "+e.tagName+".")}goog.dom.safe.unsafeSetInnerHtmlDoNotUseOrElse(e,t)},goog.dom.safe.setOuterHtml=function(e,t){e.outerHTML=goog.html.SafeHtml.unwrapTrustedHTML(t)},goog.dom.safe.setFormElementAction=function(e,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),goog.dom.asserts.assertIsHTMLFormElement(e).action=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setButtonFormAction=function(e,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),goog.dom.asserts.assertIsHTMLButtonElement(e).formAction=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setInputFormAction=function(e,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),goog.dom.asserts.assertIsHTMLInputElement(e).formAction=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setStyle=function(e,t){e.style.cssText=goog.html.SafeStyle.unwrap(t)},goog.dom.safe.documentWrite=function(e,t){e.write(goog.html.SafeHtml.unwrapTrustedHTML(t))},goog.dom.safe.setAnchorHref=function(e,t){goog.dom.asserts.assertIsHTMLAnchorElement(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.href=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setImageSrc=function(e,t){if(goog.dom.asserts.assertIsHTMLImageElement(e),!(t instanceof goog.html.SafeUrl)){var n=/^data:image\//i.test(t);t=goog.html.SafeUrl.sanitizeAssertUnchanged(t,n)}e.src=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setAudioSrc=function(e,t){if(goog.dom.asserts.assertIsHTMLAudioElement(e),!(t instanceof goog.html.SafeUrl)){var n=/^data:audio\//i.test(t);t=goog.html.SafeUrl.sanitizeAssertUnchanged(t,n)}e.src=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setVideoSrc=function(e,t){if(goog.dom.asserts.assertIsHTMLVideoElement(e),!(t instanceof goog.html.SafeUrl)){var n=/^data:video\//i.test(t);t=goog.html.SafeUrl.sanitizeAssertUnchanged(t,n)}e.src=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setEmbedSrc=function(e,t){goog.dom.asserts.assertIsHTMLEmbedElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(t)},goog.dom.safe.setFrameSrc=function(e,t){goog.dom.asserts.assertIsHTMLFrameElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedURL(t)},goog.dom.safe.setIframeSrc=function(e,t){goog.dom.asserts.assertIsHTMLIFrameElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedURL(t)},goog.dom.safe.setIframeSrcdoc=function(e,t){goog.dom.asserts.assertIsHTMLIFrameElement(e),e.srcdoc=goog.html.SafeHtml.unwrapTrustedHTML(t)},goog.dom.safe.setLinkHrefAndRel=function(e,t,n){goog.dom.asserts.assertIsHTMLLinkElement(e),e.rel=n,goog.string.internal.caseInsensitiveContains(n,"stylesheet")?(goog.asserts.assert(t instanceof goog.html.TrustedResourceUrl,'URL must be TrustedResourceUrl because "rel" contains "stylesheet"'),e.href=goog.html.TrustedResourceUrl.unwrapTrustedURL(t)):e.href=t instanceof goog.html.TrustedResourceUrl?goog.html.TrustedResourceUrl.unwrapTrustedURL(t):t instanceof goog.html.SafeUrl?goog.html.SafeUrl.unwrapTrustedURL(t):goog.html.SafeUrl.unwrapTrustedURL(goog.html.SafeUrl.sanitizeAssertUnchanged(t))},goog.dom.safe.setObjectData=function(e,t){goog.dom.asserts.assertIsHTMLObjectElement(e),e.data=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(t)},goog.dom.safe.setScriptSrc=function(e,t){goog.dom.asserts.assertIsHTMLScriptElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(t),(t=goog.getScriptNonce())&&e.setAttribute("nonce",t)},goog.dom.safe.setScriptContent=function(e,t){goog.dom.asserts.assertIsHTMLScriptElement(e),e.text=goog.html.SafeScript.unwrapTrustedScript(t),(t=goog.getScriptNonce())&&e.setAttribute("nonce",t)},goog.dom.safe.setLocationHref=function(e,t){goog.dom.asserts.assertIsLocation(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.href=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.assignLocation=function(e,t){goog.dom.asserts.assertIsLocation(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.assign(goog.html.SafeUrl.unwrapTrustedURL(t))},goog.dom.safe.replaceLocation=function(e,t){goog.dom.asserts.assertIsLocation(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.replace(goog.html.SafeUrl.unwrapTrustedURL(t))},goog.dom.safe.openInWindow=function(e,t,n,r,o){return e=e instanceof goog.html.SafeUrl?e:goog.html.SafeUrl.sanitizeAssertUnchanged(e),(t||goog.global).open(goog.html.SafeUrl.unwrapTrustedURL(e),n?goog.string.Const.unwrap(n):"",r,o)},goog.dom.safe.parseFromStringHtml=function(e,t){return goog.dom.safe.parseFromString(e,t,"text/html")},goog.dom.safe.parseFromString=function(e,t,n){return e.parseFromString(goog.html.SafeHtml.unwrapTrustedHTML(t),n)},goog.dom.safe.createImageFromBlob=function(e){if(!/^image\/.*/g.test(e.type))throw Error("goog.dom.safe.createImageFromBlob only accepts MIME type image/.*.");var t=goog.global.URL.createObjectURL(e);return(e=new goog.global.Image).onload=function(){goog.global.URL.revokeObjectURL(t)},goog.dom.safe.setImageSrc(e,goog.html.uncheckedconversions.safeUrlFromStringKnownToSatisfyTypeContract(goog.string.Const.from("Image blob URL."),t)),e},goog.string.DETECT_DOUBLE_ESCAPING=!1,goog.string.FORCE_NON_DOM_HTML_UNESCAPING=!1,goog.string.Unicode={NBSP:" "},goog.string.startsWith=goog.string.internal.startsWith,goog.string.endsWith=goog.string.internal.endsWith,goog.string.caseInsensitiveStartsWith=goog.string.internal.caseInsensitiveStartsWith,goog.string.caseInsensitiveEndsWith=goog.string.internal.caseInsensitiveEndsWith,goog.string.caseInsensitiveEquals=goog.string.internal.caseInsensitiveEquals,goog.string.subs=function(e,t){for(var n=e.split("%s"),r="",o=Array.prototype.slice.call(arguments,1);o.length&&1<n.length;)r+=n.shift()+o.shift();return r+n.join("%s")},goog.string.collapseWhitespace=function(e){return e.replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},goog.string.isEmptyOrWhitespace=goog.string.internal.isEmptyOrWhitespace,goog.string.isEmptyString=function(e){return 0==e.length},goog.string.isEmpty=goog.string.isEmptyOrWhitespace,goog.string.isEmptyOrWhitespaceSafe=function(e){return goog.string.isEmptyOrWhitespace(goog.string.makeSafe(e))},goog.string.isEmptySafe=goog.string.isEmptyOrWhitespaceSafe,goog.string.isBreakingWhitespace=function(e){return!/[^\t\n\r ]/.test(e)},goog.string.isAlpha=function(e){return!/[^a-zA-Z]/.test(e)},goog.string.isNumeric=function(e){return!/[^0-9]/.test(e)},goog.string.isAlphaNumeric=function(e){return!/[^a-zA-Z0-9]/.test(e)},goog.string.isSpace=function(e){return" "==e},goog.string.isUnicodeChar=function(e){return 1==e.length&&" "<=e&&"~">=e||""<=e&&"�">=e},goog.string.stripNewlines=function(e){return e.replace(/(\r\n|\r|\n)+/g," ")},goog.string.canonicalizeNewlines=function(e){return e.replace(/(\r\n|\r|\n)/g,"\n")},goog.string.normalizeWhitespace=function(e){return e.replace(/\xa0|\s/g," ")},goog.string.normalizeSpaces=function(e){return e.replace(/\xa0|[ \t]+/g," ")},goog.string.collapseBreakingSpaces=function(e){return e.replace(/[\t\r\n ]+/g," ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g,"")},goog.string.trim=goog.string.internal.trim,goog.string.trimLeft=function(e){return e.replace(/^[\s\xa0]+/,"")},goog.string.trimRight=function(e){return e.replace(/[\s\xa0]+$/,"")},goog.string.caseInsensitiveCompare=goog.string.internal.caseInsensitiveCompare,goog.string.numberAwareCompare_=function(e,t,n){if(e==t)return 0;if(!e)return-1;if(!t)return 1;for(var r=e.toLowerCase().match(n),o=t.toLowerCase().match(n),i=Math.min(r.length,o.length),a=0;a<i;a++){n=r[a];var s=o[a];if(n!=s)return e=parseInt(n,10),!isNaN(e)&&(t=parseInt(s,10),!isNaN(t)&&e-t)?e-t:n<s?-1:1}return r.length!=o.length?r.length-o.length:e<t?-1:1},goog.string.intAwareCompare=function(e,t){return goog.string.numberAwareCompare_(e,t,/\d+|\D+/g)},goog.string.floatAwareCompare=function(e,t){return goog.string.numberAwareCompare_(e,t,/\d+|\.\d+|\D+/g)},goog.string.numerateCompare=goog.string.floatAwareCompare,goog.string.urlEncode=function(e){return encodeURIComponent(String(e))},goog.string.urlDecode=function(e){return decodeURIComponent(e.replace(/\+/g," "))},goog.string.newLineToBr=goog.string.internal.newLineToBr,goog.string.htmlEscape=function(e,t){return e=goog.string.internal.htmlEscape(e,t),goog.string.DETECT_DOUBLE_ESCAPING&&(e=e.replace(goog.string.E_RE_,"e")),e},goog.string.E_RE_=/e/g,goog.string.unescapeEntities=function(e){return goog.string.contains(e,"&")?!goog.string.FORCE_NON_DOM_HTML_UNESCAPING&&"document"in goog.global?goog.string.unescapeEntitiesUsingDom_(e):goog.string.unescapePureXmlEntities_(e):e},goog.string.unescapeEntitiesWithDocument=function(e,t){return goog.string.contains(e,"&")?goog.string.unescapeEntitiesUsingDom_(e,t):e},goog.string.unescapeEntitiesUsingDom_=function(e,t){var n={"&":"&","<":"<",">":">",""":'"'},r=t?t.createElement("div"):goog.global.document.createElement("div");return e.replace(goog.string.HTML_ENTITY_PATTERN_,(function(e,t){var o=n[e];return o||("#"==t.charAt(0)&&(t=Number("0"+t.substr(1)),isNaN(t)||(o=String.fromCharCode(t))),o||(goog.dom.safe.setInnerHtml(r,goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract(goog.string.Const.from("Single HTML entity."),e+" ")),o=r.firstChild.nodeValue.slice(0,-1)),n[e]=o)}))},goog.string.unescapePureXmlEntities_=function(e){return e.replace(/&([^;]+);/g,(function(e,t){switch(t){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';default:return"#"!=t.charAt(0)||(t=Number("0"+t.substr(1)),isNaN(t))?e:String.fromCharCode(t)}}))},goog.string.HTML_ENTITY_PATTERN_=/&([^;\s<&]+);?/g,goog.string.whitespaceEscape=function(e,t){return goog.string.newLineToBr(e.replace(/ /g,"  "),t)},goog.string.preserveSpaces=function(e){return e.replace(/(^|[\n ]) /g,"$1"+goog.string.Unicode.NBSP)},goog.string.stripQuotes=function(e,t){for(var n=t.length,r=0;r<n;r++){var o=1==n?t:t.charAt(r);if(e.charAt(0)==o&&e.charAt(e.length-1)==o)return e.substring(1,e.length-1)}return e},goog.string.truncate=function(e,t,n){return n&&(e=goog.string.unescapeEntities(e)),e.length>t&&(e=e.substring(0,t-3)+"..."),n&&(e=goog.string.htmlEscape(e)),e},goog.string.truncateMiddle=function(e,t,n,r){if(n&&(e=goog.string.unescapeEntities(e)),r&&e.length>t){r>t&&(r=t);var o=e.length-r;e=e.substring(0,t-r)+"..."+e.substring(o)}else e.length>t&&(r=Math.floor(t/2),o=e.length-r,e=e.substring(0,r+t%2)+"..."+e.substring(o));return n&&(e=goog.string.htmlEscape(e)),e},goog.string.specialEscapeChars_={"\0":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\x0B",'"':'\\"',"\\":"\\\\","<":"\\u003C"},goog.string.jsEscapeCache_={"'":"\\'"},goog.string.quote=function(e){e=String(e);for(var t=['"'],n=0;n<e.length;n++){var r=e.charAt(n),o=r.charCodeAt(0);t[n+1]=goog.string.specialEscapeChars_[r]||(31<o&&127>o?r:goog.string.escapeChar(r))}return t.push('"'),t.join("")},goog.string.escapeString=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=goog.string.escapeChar(e.charAt(n));return t.join("")},goog.string.escapeChar=function(e){if(e in goog.string.jsEscapeCache_)return goog.string.jsEscapeCache_[e];if(e in goog.string.specialEscapeChars_)return goog.string.jsEscapeCache_[e]=goog.string.specialEscapeChars_[e];var t=e.charCodeAt(0);if(31<t&&127>t)var n=e;else 256>t?(n="\\x",(16>t||256<t)&&(n+="0")):(n="\\u",4096>t&&(n+="0")),n+=t.toString(16).toUpperCase();return goog.string.jsEscapeCache_[e]=n},goog.string.contains=goog.string.internal.contains,goog.string.caseInsensitiveContains=goog.string.internal.caseInsensitiveContains,goog.string.countOf=function(e,t){return e&&t?e.split(t).length-1:0},goog.string.removeAt=function(e,t,n){var r=e;return 0<=t&&t<e.length&&0<n&&(r=e.substr(0,t)+e.substr(t+n,e.length-t-n)),r},goog.string.remove=function(e,t){return e.replace(t,"")},goog.string.removeAll=function(e,t){return t=new RegExp(goog.string.regExpEscape(t),"g"),e.replace(t,"")},goog.string.replaceAll=function(e,t,n){return t=new RegExp(goog.string.regExpEscape(t),"g"),e.replace(t,n.replace(/\$/g,"$$$$"))},goog.string.regExpEscape=function(e){return String(e).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},goog.string.repeat=String.prototype.repeat?function(e,t){return e.repeat(t)}:function(e,t){return Array(t+1).join(e)},goog.string.padNumber=function(e,t,n){return-1==(n=(e=goog.isDef(n)?e.toFixed(n):String(e)).indexOf("."))&&(n=e.length),goog.string.repeat("0",Math.max(0,t-n))+e},goog.string.makeSafe=function(e){return null==e?"":String(e)},goog.string.buildString=function(e){return Array.prototype.join.call(arguments,"")},goog.string.getRandomString=function(){return Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^goog.now()).toString(36)},goog.string.compareVersions=goog.string.internal.compareVersions,goog.string.hashCode=function(e){for(var t=0,n=0;n<e.length;++n)t=31*t+e.charCodeAt(n)>>>0;return t},goog.string.uniqueStringCounter_=2147483648*Math.random()|0,goog.string.createUniqueString=function(){return"goog_"+goog.string.uniqueStringCounter_++},goog.string.toNumber=function(e){var t=Number(e);return 0==t&&goog.string.isEmptyOrWhitespace(e)?NaN:t},goog.string.isLowerCamelCase=function(e){return/^[a-z]+([A-Z][a-z]*)*$/.test(e)},goog.string.isUpperCamelCase=function(e){return/^([A-Z][a-z]*)+$/.test(e)},goog.string.toCamelCase=function(e){return String(e).replace(/\-([a-z])/g,(function(e,t){return t.toUpperCase()}))},goog.string.toSelectorCase=function(e){return String(e).replace(/([A-Z])/g,"-$1").toLowerCase()},goog.string.toTitleCase=function(e,t){return t=goog.isString(t)?goog.string.regExpEscape(t):"\\s",e.replace(new RegExp("(^"+(t?"|["+t+"]+":"")+")([a-z])","g"),(function(e,t,n){return t+n.toUpperCase()}))},goog.string.capitalize=function(e){return String(e.charAt(0)).toUpperCase()+String(e.substr(1)).toLowerCase()},goog.string.parseInt=function(e){return isFinite(e)&&(e=String(e)),goog.isString(e)?/^\s*-?0x/i.test(e)?parseInt(e,16):parseInt(e,10):NaN},goog.string.splitLimit=function(e,t,n){e=e.split(t);for(var r=[];0<n&&e.length;)r.push(e.shift()),n--;return e.length&&r.push(e.join(t)),r},goog.string.lastComponent=function(e,t){if(!t)return e;"string"==typeof t&&(t=[t]);for(var n=-1,r=0;r<t.length;r++)if(""!=t[r]){var o=e.lastIndexOf(t[r]);o>n&&(n=o)}return-1==n?e:e.slice(n+1)},goog.string.editDistance=function(e,t){var n=[],r=[];if(e==t)return 0;if(!e.length||!t.length)return Math.max(e.length,t.length);for(var o=0;o<t.length+1;o++)n[o]=o;for(o=0;o<e.length;o++){r[0]=o+1;for(var i=0;i<t.length;i++)r[i+1]=Math.min(r[i]+1,n[i+1]+1,n[i]+Number(e[o]!=t[i]));for(i=0;i<n.length;i++)n[i]=r[i]}return r[t.length]},goog.labs.userAgent.engine={},goog.labs.userAgent.engine.isPresto=function(){return goog.labs.userAgent.util.matchUserAgent("Presto")},goog.labs.userAgent.engine.isTrident=function(){return goog.labs.userAgent.util.matchUserAgent("Trident")||goog.labs.userAgent.util.matchUserAgent("MSIE")},goog.labs.userAgent.engine.isEdge=function(){return goog.labs.userAgent.util.matchUserAgent("Edge")},goog.labs.userAgent.engine.isWebKit=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("WebKit")&&!goog.labs.userAgent.engine.isEdge()},goog.labs.userAgent.engine.isGecko=function(){return goog.labs.userAgent.util.matchUserAgent("Gecko")&&!goog.labs.userAgent.engine.isWebKit()&&!goog.labs.userAgent.engine.isTrident()&&!goog.labs.userAgent.engine.isEdge()},goog.labs.userAgent.engine.getVersion=function(){var e=goog.labs.userAgent.util.getUserAgent();if(e){e=goog.labs.userAgent.util.extractVersionTuples(e);var t,n=goog.labs.userAgent.engine.getEngineTuple_(e);if(n)return"Gecko"==n[0]?goog.labs.userAgent.engine.getVersionForKey_(e,"Firefox"):n[1];if((e=e[0])&&(t=e[2])&&(t=/Trident\/([^\s;]+)/.exec(t)))return t[1]}return""},goog.labs.userAgent.engine.getEngineTuple_=function(e){if(!goog.labs.userAgent.engine.isEdge())return e[1];for(var t=0;t<e.length;t++){var n=e[t];if("Edge"==n[0])return n}},goog.labs.userAgent.engine.isVersionOrHigher=function(e){return 0<=goog.string.compareVersions(goog.labs.userAgent.engine.getVersion(),e)},goog.labs.userAgent.engine.getVersionForKey_=function(e,t){return(e=goog.array.find(e,(function(e){return t==e[0]})))&&e[1]||""},goog.labs.userAgent.platform={},goog.labs.userAgent.platform.isAndroid=function(){return goog.labs.userAgent.util.matchUserAgent("Android")},goog.labs.userAgent.platform.isIpod=function(){return goog.labs.userAgent.util.matchUserAgent("iPod")},goog.labs.userAgent.platform.isIphone=function(){return goog.labs.userAgent.util.matchUserAgent("iPhone")&&!goog.labs.userAgent.util.matchUserAgent("iPod")&&!goog.labs.userAgent.util.matchUserAgent("iPad")},goog.labs.userAgent.platform.isIpad=function(){return goog.labs.userAgent.util.matchUserAgent("iPad")},goog.labs.userAgent.platform.isIos=function(){return goog.labs.userAgent.platform.isIphone()||goog.labs.userAgent.platform.isIpad()||goog.labs.userAgent.platform.isIpod()},goog.labs.userAgent.platform.isMacintosh=function(){return goog.labs.userAgent.util.matchUserAgent("Macintosh")},goog.labs.userAgent.platform.isLinux=function(){return goog.labs.userAgent.util.matchUserAgent("Linux")},goog.labs.userAgent.platform.isWindows=function(){return goog.labs.userAgent.util.matchUserAgent("Windows")},goog.labs.userAgent.platform.isChromeOS=function(){return goog.labs.userAgent.util.matchUserAgent("CrOS")},goog.labs.userAgent.platform.isChromecast=function(){return goog.labs.userAgent.util.matchUserAgent("CrKey")},goog.labs.userAgent.platform.isKaiOS=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("KaiOS")},goog.labs.userAgent.platform.isGo2Phone=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("GAFP")},goog.labs.userAgent.platform.getVersion=function(){var e=goog.labs.userAgent.util.getUserAgent(),t="";return goog.labs.userAgent.platform.isWindows()?t=(e=(t=/Windows (?:NT|Phone) ([0-9.]+)/).exec(e))?e[1]:"0.0":goog.labs.userAgent.platform.isIos()?t=(e=(t=/(?:iPhone|iPod|iPad|CPU)\s+OS\s+(\S+)/).exec(e))&&e[1].replace(/_/g,"."):goog.labs.userAgent.platform.isMacintosh()?t=(e=(t=/Mac OS X ([0-9_.]+)/).exec(e))?e[1].replace(/_/g,"."):"10":goog.labs.userAgent.platform.isKaiOS()?t=(e=(t=/(?:KaiOS)\/(\S+)/i).exec(e))&&e[1]:goog.labs.userAgent.platform.isAndroid()?t=(e=(t=/Android\s+([^\);]+)(\)|;)/).exec(e))&&e[1]:goog.labs.userAgent.platform.isChromeOS()&&(t=(e=(t=/(?:CrOS\s+(?:i686|x86_64)\s+([0-9.]+))/).exec(e))&&e[1]),t||""},goog.labs.userAgent.platform.isVersionOrHigher=function(e){return 0<=goog.string.compareVersions(goog.labs.userAgent.platform.getVersion(),e)},goog.reflect={},goog.reflect.object=function(e,t){return t},goog.reflect.objectProperty=function(e,t){return e},goog.reflect.sinkValue=function(e){return goog.reflect.sinkValue[" "](e),e},goog.reflect.sinkValue[" "]=goog.nullFunction,goog.reflect.canAccessProperty=function(e,t){try{return goog.reflect.sinkValue(e[t]),!0}catch(e){}return!1},goog.reflect.cache=function(e,t,n,r){return r=r?r(t):t,Object.prototype.hasOwnProperty.call(e,r)?e[r]:e[r]=n(t)},goog.userAgent={},goog.userAgent.ASSUME_IE=!1,goog.userAgent.ASSUME_EDGE=!1,goog.userAgent.ASSUME_GECKO=!1,goog.userAgent.ASSUME_WEBKIT=!1,goog.userAgent.ASSUME_MOBILE_WEBKIT=!1,goog.userAgent.ASSUME_OPERA=!1,goog.userAgent.ASSUME_ANY_VERSION=!1,goog.userAgent.BROWSER_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_GECKO||goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_OPERA,goog.userAgent.getUserAgentString=function(){return goog.labs.userAgent.util.getUserAgent()},goog.userAgent.getNavigatorTyped=function(){return goog.global.navigator||null},goog.userAgent.getNavigator=function(){return goog.userAgent.getNavigatorTyped()},goog.userAgent.OPERA=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_OPERA:goog.labs.userAgent.browser.isOpera(),goog.userAgent.IE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_IE:goog.labs.userAgent.browser.isIE(),goog.userAgent.EDGE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_EDGE:goog.labs.userAgent.engine.isEdge(),goog.userAgent.EDGE_OR_IE=goog.userAgent.EDGE||goog.userAgent.IE,goog.userAgent.GECKO=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_GECKO:goog.labs.userAgent.engine.isGecko(),goog.userAgent.WEBKIT=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_MOBILE_WEBKIT:goog.labs.userAgent.engine.isWebKit(),goog.userAgent.isMobile_=function(){return goog.userAgent.WEBKIT&&goog.labs.userAgent.util.matchUserAgent("Mobile")},goog.userAgent.MOBILE=goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.isMobile_(),goog.userAgent.SAFARI=goog.userAgent.WEBKIT,goog.userAgent.determinePlatform_=function(){var e=goog.userAgent.getNavigatorTyped();return e&&e.platform||""},goog.userAgent.PLATFORM=goog.userAgent.determinePlatform_(),goog.userAgent.ASSUME_MAC=!1,goog.userAgent.ASSUME_WINDOWS=!1,goog.userAgent.ASSUME_LINUX=!1,goog.userAgent.ASSUME_X11=!1,goog.userAgent.ASSUME_ANDROID=!1,goog.userAgent.ASSUME_IPHONE=!1,goog.userAgent.ASSUME_IPAD=!1,goog.userAgent.ASSUME_IPOD=!1,goog.userAgent.ASSUME_KAIOS=!1,goog.userAgent.ASSUME_GO2PHONE=!1,goog.userAgent.PLATFORM_KNOWN_=goog.userAgent.ASSUME_MAC||goog.userAgent.ASSUME_WINDOWS||goog.userAgent.ASSUME_LINUX||goog.userAgent.ASSUME_X11||goog.userAgent.ASSUME_ANDROID||goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD,goog.userAgent.MAC=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_MAC:goog.labs.userAgent.platform.isMacintosh(),goog.userAgent.WINDOWS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_WINDOWS:goog.labs.userAgent.platform.isWindows(),goog.userAgent.isLegacyLinux_=function(){return goog.labs.userAgent.platform.isLinux()||goog.labs.userAgent.platform.isChromeOS()},goog.userAgent.LINUX=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_LINUX:goog.userAgent.isLegacyLinux_(),goog.userAgent.isX11_=function(){var e=goog.userAgent.getNavigatorTyped();return!!e&&goog.string.contains(e.appVersion||"","X11")},goog.userAgent.X11=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_X11:goog.userAgent.isX11_(),goog.userAgent.ANDROID=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_ANDROID:goog.labs.userAgent.platform.isAndroid(),goog.userAgent.IPHONE=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE:goog.labs.userAgent.platform.isIphone(),goog.userAgent.IPAD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad(),goog.userAgent.IPOD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIpod(),goog.userAgent.IOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIos(),goog.userAgent.KAIOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_KAIOS:goog.labs.userAgent.platform.isKaiOS(),goog.userAgent.GO2PHONE=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_GO2PHONE:goog.labs.userAgent.platform.isGo2Phone(),goog.userAgent.determineVersion_=function(){var e="",t=goog.userAgent.getVersionRegexResult_();return t&&(e=t?t[1]:""),goog.userAgent.IE&&(null!=(t=goog.userAgent.getDocumentMode_())&&t>parseFloat(e))?String(t):e},goog.userAgent.getVersionRegexResult_=function(){var e=goog.userAgent.getUserAgentString();return goog.userAgent.GECKO?/rv:([^\);]+)(\)|;)/.exec(e):goog.userAgent.EDGE?/Edge\/([\d\.]+)/.exec(e):goog.userAgent.IE?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(e):goog.userAgent.WEBKIT?/WebKit\/(\S+)/.exec(e):goog.userAgent.OPERA?/(?:Version)[ \/]?(\S+)/.exec(e):void 0},goog.userAgent.getDocumentMode_=function(){var e=goog.global.document;return e?e.documentMode:void 0},goog.userAgent.VERSION=goog.userAgent.determineVersion_(),goog.userAgent.compare=function(e,t){return goog.string.compareVersions(e,t)},goog.userAgent.isVersionOrHigherCache_={},goog.userAgent.isVersionOrHigher=function(e){return goog.userAgent.ASSUME_ANY_VERSION||goog.reflect.cache(goog.userAgent.isVersionOrHigherCache_,e,(function(){return 0<=goog.string.compareVersions(goog.userAgent.VERSION,e)}))},goog.userAgent.isVersion=goog.userAgent.isVersionOrHigher,goog.userAgent.isDocumentModeOrHigher=function(e){return Number(goog.userAgent.DOCUMENT_MODE)>=e},goog.userAgent.isDocumentMode=goog.userAgent.isDocumentModeOrHigher,goog.userAgent.DOCUMENT_MODE=function(){if(goog.global.document&&goog.userAgent.IE)return goog.userAgent.getDocumentMode_()}(),goog.userAgent.product={},goog.userAgent.product.ASSUME_FIREFOX=!1,goog.userAgent.product.ASSUME_IPHONE=!1,goog.userAgent.product.ASSUME_IPAD=!1,goog.userAgent.product.ASSUME_ANDROID=!1,goog.userAgent.product.ASSUME_CHROME=!1,goog.userAgent.product.ASSUME_SAFARI=!1,goog.userAgent.product.PRODUCT_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_OPERA||goog.userAgent.product.ASSUME_FIREFOX||goog.userAgent.product.ASSUME_IPHONE||goog.userAgent.product.ASSUME_IPAD||goog.userAgent.product.ASSUME_ANDROID||goog.userAgent.product.ASSUME_CHROME||goog.userAgent.product.ASSUME_SAFARI,goog.userAgent.product.OPERA=goog.userAgent.OPERA,goog.userAgent.product.IE=goog.userAgent.IE,goog.userAgent.product.EDGE=goog.userAgent.EDGE,goog.userAgent.product.FIREFOX=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_FIREFOX:goog.labs.userAgent.browser.isFirefox(),goog.userAgent.product.isIphoneOrIpod_=function(){return goog.labs.userAgent.platform.isIphone()||goog.labs.userAgent.platform.isIpod()},goog.userAgent.product.IPHONE=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPHONE:goog.userAgent.product.isIphoneOrIpod_(),goog.userAgent.product.IPAD=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad(),goog.userAgent.product.ANDROID=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_ANDROID:goog.labs.userAgent.browser.isAndroidBrowser(),goog.userAgent.product.CHROME=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_CHROME:goog.labs.userAgent.browser.isChrome(),goog.userAgent.product.isSafariDesktop_=function(){return goog.labs.userAgent.browser.isSafari()&&!goog.labs.userAgent.platform.isIos()},goog.userAgent.product.SAFARI=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_SAFARI:goog.userAgent.product.isSafariDesktop_(),goog.crypt.base64={},goog.crypt.base64.DEFAULT_ALPHABET_COMMON_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",goog.crypt.base64.ENCODED_VALS=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_+"+/=",goog.crypt.base64.ENCODED_VALS_WEBSAFE=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_+"-_.",goog.crypt.base64.Alphabet={DEFAULT:0,NO_PADDING:1,WEBSAFE:2,WEBSAFE_DOT_PADDING:3,WEBSAFE_NO_PADDING:4},goog.crypt.base64.paddingChars_="=.",goog.crypt.base64.isPadding_=function(e){return goog.string.contains(goog.crypt.base64.paddingChars_,e)},goog.crypt.base64.byteToCharMaps_={};goog.crypt.base64.charToByteMap_=null,goog.crypt.base64.ASSUME_NATIVE_SUPPORT_=goog.userAgent.GECKO||goog.userAgent.WEBKIT&&!goog.userAgent.product.SAFARI||goog.userAgent.OPERA,goog.crypt.base64.HAS_NATIVE_ENCODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||"function"==typeof goog.global.btoa,goog.crypt.base64.HAS_NATIVE_DECODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||!goog.userAgent.product.SAFARI&&!goog.userAgent.IE&&"function"==typeof goog.global.atob,goog.crypt.base64.encodeByteArray=function(e,t){goog.asserts.assert(goog.isArrayLike(e),"encodeByteArray takes an array as a parameter"),void 0===t&&(t=goog.crypt.base64.Alphabet.DEFAULT),goog.crypt.base64.init_(),t=goog.crypt.base64.byteToCharMaps_[t];for(var n=[],r=0;r<e.length;r+=3){var o=e[r],i=r+1<e.length,a=i?e[r+1]:0,s=r+2<e.length,l=s?e[r+2]:0,u=o>>2;o=(3&o)<<4|a>>4,a=(15&a)<<2|l>>6,l&=63,s||(l=64,i||(a=64)),n.push(t[u],t[o],t[a]||"",t[l]||"")}return n.join("")},goog.crypt.base64.encodeString=function(e,t){return goog.crypt.base64.HAS_NATIVE_ENCODE_&&!t?goog.global.btoa(e):goog.crypt.base64.encodeByteArray(goog.crypt.stringToByteArray(e),t)},goog.crypt.base64.decodeString=function(e,t){if(goog.crypt.base64.HAS_NATIVE_DECODE_&&!t)return goog.global.atob(e);var n="";return goog.crypt.base64.decodeStringInternal_(e,(function(e){n+=String.fromCharCode(e)})),n},goog.crypt.base64.decodeStringToByteArray=function(e,t){var n=[];return goog.crypt.base64.decodeStringInternal_(e,(function(e){n.push(e)})),n},goog.crypt.base64.decodeStringToUint8Array=function(e){goog.asserts.assert(!goog.userAgent.IE||goog.userAgent.isVersionOrHigher("10"),"Browser does not support typed arrays");var t=e.length,n=3*t/4;n%3?n=Math.floor(n):goog.crypt.base64.isPadding_(e[t-1])&&(n=goog.crypt.base64.isPadding_(e[t-2])?n-2:n-1);var r=new Uint8Array(n),o=0;return goog.crypt.base64.decodeStringInternal_(e,(function(e){r[o++]=e})),r.subarray(0,o)},goog.crypt.base64.decodeStringInternal_=function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),o=goog.crypt.base64.charToByteMap_[n];if(null!=o)return o;if(!goog.string.isEmptyOrWhitespace(n))throw Error("Unknown base64 encoding at char: "+n)}return t}goog.crypt.base64.init_();for(var r=0;;){var o=n(-1),i=n(0),a=n(64),s=n(64);if(64===s&&-1===o)break;t(o<<2|i>>4),64!=a&&(t(i<<4&240|a>>2),64!=s&&t(a<<6&192|s))}},goog.crypt.base64.init_=function(){if(!goog.crypt.base64.charToByteMap_){goog.crypt.base64.charToByteMap_={};for(var e=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_.split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));goog.crypt.base64.byteToCharMaps_[n]=r;for(var o=0;o<r.length;o++){var i=r[o],a=goog.crypt.base64.charToByteMap_[i];void 0===a?goog.crypt.base64.charToByteMap_[i]=o:goog.asserts.assert(a===o)}}}},jspb.utils={},jspb.utils.split64Low=0,jspb.utils.split64High=0,jspb.utils.splitUint64=function(e){var t=e>>>0;e=Math.floor((e-t)/jspb.BinaryConstants.TWO_TO_32)>>>0,jspb.utils.split64Low=t,jspb.utils.split64High=e},jspb.utils.splitInt64=function(e){var t=0>e,n=(e=Math.abs(e))>>>0;e=Math.floor((e-n)/jspb.BinaryConstants.TWO_TO_32),e>>>=0,t&&(e=~e>>>0,4294967295<(n=1+(~n>>>0))&&(n=0,4294967295<++e&&(e=0))),jspb.utils.split64Low=n,jspb.utils.split64High=e},jspb.utils.splitZigzag64=function(e){var t=0>e;e=2*Math.abs(e),jspb.utils.splitUint64(e),e=jspb.utils.split64Low;var n=jspb.utils.split64High;t&&(0==e?0==n?n=e=4294967295:(n--,e=4294967295):e--),jspb.utils.split64Low=e,jspb.utils.split64High=n},jspb.utils.splitFloat32=function(e){var t=0>e?1:0;if(0===(e=t?-e:e))0<1/e?(jspb.utils.split64High=0,jspb.utils.split64Low=0):(jspb.utils.split64High=0,jspb.utils.split64Low=2147483648);else if(isNaN(e))jspb.utils.split64High=0,jspb.utils.split64Low=2147483647;else if(e>jspb.BinaryConstants.FLOAT32_MAX)jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|2139095040)>>>0;else if(e<jspb.BinaryConstants.FLOAT32_MIN)e=Math.round(e/Math.pow(2,-149)),jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|e)>>>0;else{var n=Math.floor(Math.log(e)/Math.LN2);e*=Math.pow(2,-n),e=8388607&Math.round(e*jspb.BinaryConstants.TWO_TO_23),jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|n+127<<23|e)>>>0}},jspb.utils.splitFloat64=function(e){var t=0>e?1:0;if(0===(e=t?-e:e))jspb.utils.split64High=0<1/e?0:2147483648,jspb.utils.split64Low=0;else if(isNaN(e))jspb.utils.split64High=2147483647,jspb.utils.split64Low=4294967295;else if(e>jspb.BinaryConstants.FLOAT64_MAX)jspb.utils.split64High=(t<<31|2146435072)>>>0,jspb.utils.split64Low=0;else if(e<jspb.BinaryConstants.FLOAT64_MIN){var n=e/Math.pow(2,-1074);e=n/jspb.BinaryConstants.TWO_TO_32,jspb.utils.split64High=(t<<31|e)>>>0,jspb.utils.split64Low=n>>>0}else{var r=0;if(2<=(n=e))for(;2<=n&&1023>r;)r++,n/=2;else for(;1>n&&-1022<r;)n*=2,r--;e=(n=e*Math.pow(2,-r))*jspb.BinaryConstants.TWO_TO_20&1048575,n=n*jspb.BinaryConstants.TWO_TO_52>>>0,jspb.utils.split64High=(t<<31|r+1023<<20|e)>>>0,jspb.utils.split64Low=n}},jspb.utils.splitHash64=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),o=e.charCodeAt(3),i=e.charCodeAt(4),a=e.charCodeAt(5),s=e.charCodeAt(6);e=e.charCodeAt(7),jspb.utils.split64Low=t+(n<<8)+(r<<16)+(o<<24)>>>0,jspb.utils.split64High=i+(a<<8)+(s<<16)+(e<<24)>>>0},jspb.utils.joinUint64=function(e,t){return t*jspb.BinaryConstants.TWO_TO_32+(e>>>0)},jspb.utils.joinInt64=function(e,t){var n=2147483648&t;return n&&(t=~t>>>0,0==(e=1+~e>>>0)&&(t=t+1>>>0)),e=jspb.utils.joinUint64(e,t),n?-e:e},jspb.utils.toZigzag64=function(e,t,n){var r=t>>31;return n(e<<1^r,(t<<1|e>>>31)^r)},jspb.utils.joinZigzag64=function(e,t){return jspb.utils.fromZigzag64(e,t,jspb.utils.joinInt64)},jspb.utils.fromZigzag64=function(e,t,n){var r=-(1&e);return n((e>>>1|t<<31)^r,t>>>1^r)},jspb.utils.joinFloat32=function(e,t){t=2*(e>>31)+1;var n=e>>>23&255;return e&=8388607,255==n?e?NaN:1/0*t:0==n?t*Math.pow(2,-149)*e:t*Math.pow(2,n-150)*(e+Math.pow(2,23))},jspb.utils.joinFloat64=function(e,t){var n=2*(t>>31)+1,r=t>>>20&2047;return e=jspb.BinaryConstants.TWO_TO_32*(1048575&t)+e,2047==r?e?NaN:1/0*n:0==r?n*Math.pow(2,-1074)*e:n*Math.pow(2,r-1075)*(e+jspb.BinaryConstants.TWO_TO_52)},jspb.utils.joinHash64=function(e,t){return String.fromCharCode(e>>>0&255,e>>>8&255,e>>>16&255,e>>>24&255,t>>>0&255,t>>>8&255,t>>>16&255,t>>>24&255)},jspb.utils.DIGITS="0123456789abcdef".split(""),jspb.utils.ZERO_CHAR_CODE_=48,jspb.utils.A_CHAR_CODE_=97,jspb.utils.joinUnsignedDecimalString=function(e,t){function n(e,t){return e=e?String(e):"",t?"0000000".slice(e.length)+e:e}if(2097151>=t)return""+jspb.utils.joinUint64(e,t);var r=(e>>>24|t<<8)>>>0&16777215;return e=(16777215&e)+6777216*r+6710656*(t=t>>16&65535),r+=8147497*t,t*=2,1e7<=e&&(r+=Math.floor(e/1e7),e%=1e7),1e7<=r&&(t+=Math.floor(r/1e7),r%=1e7),n(t,0)+n(r,t)+n(e,1)},jspb.utils.joinSignedDecimalString=function(e,t){var n=2147483648&t;return n&&(t=~t+(0==(e=1+~e>>>0)?1:0)>>>0),e=jspb.utils.joinUnsignedDecimalString(e,t),n?"-"+e:e},jspb.utils.hash64ToDecimalString=function(e,t){jspb.utils.splitHash64(e),e=jspb.utils.split64Low;var n=jspb.utils.split64High;return t?jspb.utils.joinSignedDecimalString(e,n):jspb.utils.joinUnsignedDecimalString(e,n)},jspb.utils.hash64ArrayToDecimalStrings=function(e,t){for(var n=Array(e.length),r=0;r<e.length;r++)n[r]=jspb.utils.hash64ToDecimalString(e[r],t);return n},jspb.utils.decimalStringToHash64=function(e){function t(e,t){for(var n=0;8>n&&(1!==e||0<t);n++)t=e*r[n]+t,r[n]=255&t,t>>>=8}goog.asserts.assert(0<e.length);var n=!1;"-"===e[0]&&(n=!0,e=e.slice(1));for(var r=[0,0,0,0,0,0,0,0],o=0;o<e.length;o++)t(10,e.charCodeAt(o)-jspb.utils.ZERO_CHAR_CODE_);return n&&(function(){for(var e=0;8>e;e++)r[e]=255&~r[e]}(),t(1,1)),goog.crypt.byteArrayToString(r)},jspb.utils.splitDecimalString=function(e){jspb.utils.splitHash64(jspb.utils.decimalStringToHash64(e))},jspb.utils.toHexDigit_=function(e){return String.fromCharCode(10>e?jspb.utils.ZERO_CHAR_CODE_+e:jspb.utils.A_CHAR_CODE_-10+e)},jspb.utils.fromHexCharCode_=function(e){return e>=jspb.utils.A_CHAR_CODE_?e-jspb.utils.A_CHAR_CODE_+10:e-jspb.utils.ZERO_CHAR_CODE_},jspb.utils.hash64ToHexString=function(e){var t=Array(18);t[0]="0",t[1]="x";for(var n=0;8>n;n++){var r=e.charCodeAt(7-n);t[2*n+2]=jspb.utils.toHexDigit_(r>>4),t[2*n+3]=jspb.utils.toHexDigit_(15&r)}return t.join("")},jspb.utils.hexStringToHash64=function(e){e=e.toLowerCase(),goog.asserts.assert(18==e.length),goog.asserts.assert("0"==e[0]),goog.asserts.assert("x"==e[1]);for(var t="",n=0;8>n;n++){var r=jspb.utils.fromHexCharCode_(e.charCodeAt(2*n+2)),o=jspb.utils.fromHexCharCode_(e.charCodeAt(2*n+3));t=String.fromCharCode(16*r+o)+t}return t},jspb.utils.hash64ToNumber=function(e,t){jspb.utils.splitHash64(e),e=jspb.utils.split64Low;var n=jspb.utils.split64High;return t?jspb.utils.joinInt64(e,n):jspb.utils.joinUint64(e,n)},jspb.utils.numberToHash64=function(e){return jspb.utils.splitInt64(e),jspb.utils.joinHash64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.utils.countVarints=function(e,t,n){for(var r=0,o=t;o<n;o++)r+=e[o]>>7;return n-t-r},jspb.utils.countVarintFields=function(e,t,n,r){var o=0;if(128>(r=8*r+jspb.BinaryConstants.WireType.VARINT))for(;t<n&&e[t++]==r;)for(o++;;){var i=e[t++];if(0==(128&i))break}else for(;t<n;){for(i=r;128<i;){if(e[t]!=(127&i|128))return o;t++,i>>=7}if(e[t++]!=i)break;for(o++;0!=(128&(i=e[t++])););}return o},jspb.utils.countFixedFields_=function(e,t,n,r,o){var i=0;if(128>r)for(;t<n&&e[t++]==r;)i++,t+=o;else for(;t<n;){for(var a=r;128<a;){if(e[t++]!=(127&a|128))return i;a>>=7}if(e[t++]!=a)break;i++,t+=o}return i},jspb.utils.countFixed32Fields=function(e,t,n,r){return jspb.utils.countFixedFields_(e,t,n,8*r+jspb.BinaryConstants.WireType.FIXED32,4)},jspb.utils.countFixed64Fields=function(e,t,n,r){return jspb.utils.countFixedFields_(e,t,n,8*r+jspb.BinaryConstants.WireType.FIXED64,8)},jspb.utils.countDelimitedFields=function(e,t,n,r){var o=0;for(r=8*r+jspb.BinaryConstants.WireType.DELIMITED;t<n;){for(var i=r;128<i;){if(e[t++]!=(127&i|128))return o;i>>=7}if(e[t++]!=i)break;o++;for(var a=0,s=1;a+=(127&(i=e[t++]))*s,s*=128,0!=(128&i););t+=a}return o},jspb.utils.debugBytesToTextFormat=function(e){var t='"';if(e){e=jspb.utils.byteSourceToUint8Array(e);for(var n=0;n<e.length;n++)t+="\\x",16>e[n]&&(t+="0"),t+=e[n].toString(16)}return t+'"'},jspb.utils.debugScalarToTextFormat=function(e){return"string"==typeof e?goog.string.quote(e):e.toString()},jspb.utils.stringToByteArray=function(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++){var r=e.charCodeAt(n);if(255<r)throw Error("Conversion error: string contains codepoint outside of byte range");t[n]=r}return t},jspb.utils.byteSourceToUint8Array=function(e){return e.constructor===Uint8Array?e:e.constructor===ArrayBuffer||"undefined"!=typeof Buffer&&e.constructor===Buffer||e.constructor===Array?new Uint8Array(e):e.constructor===String?goog.crypt.base64.decodeStringToUint8Array(e):(goog.asserts.fail("Type not convertible to Uint8Array."),new Uint8Array(0))},jspb.BinaryDecoder=function(e,t,n){this.bytes_=null,this.cursor_=this.end_=this.start_=0,this.error_=!1,e&&this.setBlock(e,t,n)},jspb.BinaryDecoder.instanceCache_=[],jspb.BinaryDecoder.alloc=function(e,t,n){if(jspb.BinaryDecoder.instanceCache_.length){var r=jspb.BinaryDecoder.instanceCache_.pop();return e&&r.setBlock(e,t,n),r}return new jspb.BinaryDecoder(e,t,n)},jspb.BinaryDecoder.prototype.free=function(){this.clear(),100>jspb.BinaryDecoder.instanceCache_.length&&jspb.BinaryDecoder.instanceCache_.push(this)},jspb.BinaryDecoder.prototype.clone=function(){return jspb.BinaryDecoder.alloc(this.bytes_,this.start_,this.end_-this.start_)},jspb.BinaryDecoder.prototype.clear=function(){this.bytes_=null,this.cursor_=this.end_=this.start_=0,this.error_=!1},jspb.BinaryDecoder.prototype.getBuffer=function(){return this.bytes_},jspb.BinaryDecoder.prototype.setBlock=function(e,t,n){this.bytes_=jspb.utils.byteSourceToUint8Array(e),this.start_=void 0!==t?t:0,this.end_=void 0!==n?this.start_+n:this.bytes_.length,this.cursor_=this.start_},jspb.BinaryDecoder.prototype.getEnd=function(){return this.end_},jspb.BinaryDecoder.prototype.setEnd=function(e){this.end_=e},jspb.BinaryDecoder.prototype.reset=function(){this.cursor_=this.start_},jspb.BinaryDecoder.prototype.getCursor=function(){return this.cursor_},jspb.BinaryDecoder.prototype.setCursor=function(e){this.cursor_=e},jspb.BinaryDecoder.prototype.advance=function(e){this.cursor_+=e,goog.asserts.assert(this.cursor_<=this.end_)},jspb.BinaryDecoder.prototype.atEnd=function(){return this.cursor_==this.end_},jspb.BinaryDecoder.prototype.pastEnd=function(){return this.cursor_>this.end_},jspb.BinaryDecoder.prototype.getError=function(){return this.error_||0>this.cursor_||this.cursor_>this.end_},jspb.BinaryDecoder.prototype.readSplitVarint64=function(e){for(var t=128,n=0,r=0,o=0;4>o&&128<=t;o++)n|=(127&(t=this.bytes_[this.cursor_++]))<<7*o;if(128<=t&&(n|=(127&(t=this.bytes_[this.cursor_++]))<<28,r|=(127&t)>>4),128<=t)for(o=0;5>o&&128<=t;o++)r|=(127&(t=this.bytes_[this.cursor_++]))<<7*o+3;if(128>t)return e(n>>>0,r>>>0);goog.asserts.fail("Failed to read varint, encoding is invalid."),this.error_=!0},jspb.BinaryDecoder.prototype.readSplitZigzagVarint64=function(e){return this.readSplitVarint64((function(t,n){return jspb.utils.fromZigzag64(t,n,e)}))},jspb.BinaryDecoder.prototype.readSplitFixed64=function(e){var t=this.bytes_,n=this.cursor_;this.cursor_+=8;for(var r=0,o=0,i=n+7;i>=n;i--)r=r<<8|t[i],o=o<<8|t[i+4];return e(r,o)},jspb.BinaryDecoder.prototype.skipVarint=function(){for(;128&this.bytes_[this.cursor_];)this.cursor_++;this.cursor_++},jspb.BinaryDecoder.prototype.unskipVarint=function(e){for(;128<e;)this.cursor_--,e>>>=7;this.cursor_--},jspb.BinaryDecoder.prototype.readUnsignedVarint32=function(){var e=this.bytes_,t=e[this.cursor_+0],n=127&t;return 128>t?(this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(127&(t=e[this.cursor_+1]))<<7,128>t?(this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(127&(t=e[this.cursor_+2]))<<14,128>t?(this.cursor_+=3,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(127&(t=e[this.cursor_+3]))<<21,128>t?(this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(15&(t=e[this.cursor_+4]))<<28,128>t?(this.cursor_+=5,goog.asserts.assert(this.cursor_<=this.end_),n>>>0):(this.cursor_+=5,128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&goog.asserts.assert(!1),goog.asserts.assert(this.cursor_<=this.end_),n)))))},jspb.BinaryDecoder.prototype.readSignedVarint32=jspb.BinaryDecoder.prototype.readUnsignedVarint32,jspb.BinaryDecoder.prototype.readUnsignedVarint32String=function(){return this.readUnsignedVarint32().toString()},jspb.BinaryDecoder.prototype.readSignedVarint32String=function(){return this.readSignedVarint32().toString()},jspb.BinaryDecoder.prototype.readZigzagVarint32=function(){var e=this.readUnsignedVarint32();return e>>>1^-(1&e)},jspb.BinaryDecoder.prototype.readUnsignedVarint64=function(){return this.readSplitVarint64(jspb.utils.joinUint64)},jspb.BinaryDecoder.prototype.readUnsignedVarint64String=function(){return this.readSplitVarint64(jspb.utils.joinUnsignedDecimalString)},jspb.BinaryDecoder.prototype.readSignedVarint64=function(){return this.readSplitVarint64(jspb.utils.joinInt64)},jspb.BinaryDecoder.prototype.readSignedVarint64String=function(){return this.readSplitVarint64(jspb.utils.joinSignedDecimalString)},jspb.BinaryDecoder.prototype.readZigzagVarint64=function(){return this.readSplitVarint64(jspb.utils.joinZigzag64)},jspb.BinaryDecoder.prototype.readZigzagVarintHash64=function(){return this.readSplitZigzagVarint64(jspb.utils.joinHash64)},jspb.BinaryDecoder.prototype.readZigzagVarint64String=function(){return this.readSplitZigzagVarint64(jspb.utils.joinSignedDecimalString)},jspb.BinaryDecoder.prototype.readUint8=function(){var e=this.bytes_[this.cursor_+0];return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),e},jspb.BinaryDecoder.prototype.readUint16=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),e<<0|t<<8},jspb.BinaryDecoder.prototype.readUint32=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],n=this.bytes_[this.cursor_+2],r=this.bytes_[this.cursor_+3];return this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),(e<<0|t<<8|n<<16|r<<24)>>>0},jspb.BinaryDecoder.prototype.readUint64=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinUint64(e,t)},jspb.BinaryDecoder.prototype.readUint64String=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinUnsignedDecimalString(e,t)},jspb.BinaryDecoder.prototype.readInt8=function(){var e=this.bytes_[this.cursor_+0];return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),e<<24>>24},jspb.BinaryDecoder.prototype.readInt16=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),(e<<0|t<<8)<<16>>16},jspb.BinaryDecoder.prototype.readInt32=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],n=this.bytes_[this.cursor_+2],r=this.bytes_[this.cursor_+3];return this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),e<<0|t<<8|n<<16|r<<24},jspb.BinaryDecoder.prototype.readInt64=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinInt64(e,t)},jspb.BinaryDecoder.prototype.readInt64String=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinSignedDecimalString(e,t)},jspb.BinaryDecoder.prototype.readFloat=function(){var e=this.readUint32();return jspb.utils.joinFloat32(e,0)},jspb.BinaryDecoder.prototype.readDouble=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinFloat64(e,t)},jspb.BinaryDecoder.prototype.readBool=function(){return!!this.bytes_[this.cursor_++]},jspb.BinaryDecoder.prototype.readEnum=function(){return this.readSignedVarint32()},jspb.BinaryDecoder.prototype.readString=function(e){var t=this.bytes_,n=this.cursor_;e=n+e;for(var r=[],o="";n<e;){var i=t[n++];if(128>i)r.push(i);else{if(192>i)continue;if(224>i){var a=t[n++];r.push((31&i)<<6|63&a)}else if(240>i){a=t[n++];var s=t[n++];r.push((15&i)<<12|(63&a)<<6|63&s)}else if(248>i){i=(7&i)<<18|(63&(a=t[n++]))<<12|(63&(s=t[n++]))<<6|63&t[n++],i-=65536,r.push(55296+(i>>10&1023),56320+(1023&i))}}8192<=r.length&&(o+=String.fromCharCode.apply(null,r),r.length=0)}return o+=goog.crypt.byteArrayToString(r),this.cursor_=n,o},jspb.BinaryDecoder.prototype.readStringWithLength=function(){var e=this.readUnsignedVarint32();return this.readString(e)},jspb.BinaryDecoder.prototype.readBytes=function(e){if(0>e||this.cursor_+e>this.bytes_.length)return this.error_=!0,goog.asserts.fail("Invalid byte length!"),new Uint8Array(0);var t=this.bytes_.subarray(this.cursor_,this.cursor_+e);return this.cursor_+=e,goog.asserts.assert(this.cursor_<=this.end_),t},jspb.BinaryDecoder.prototype.readVarintHash64=function(){return this.readSplitVarint64(jspb.utils.joinHash64)},jspb.BinaryDecoder.prototype.readFixedHash64=function(){var e=this.bytes_,t=this.cursor_,n=e[t+0],r=e[t+1],o=e[t+2],i=e[t+3],a=e[t+4],s=e[t+5],l=e[t+6];return e=e[t+7],this.cursor_+=8,String.fromCharCode(n,r,o,i,a,s,l,e)},jspb.BinaryReader=function(e,t,n){this.decoder_=jspb.BinaryDecoder.alloc(e,t,n),this.fieldCursor_=this.decoder_.getCursor(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID,this.error_=!1,this.readCallbacks_=null},jspb.BinaryReader.instanceCache_=[],jspb.BinaryReader.alloc=function(e,t,n){if(jspb.BinaryReader.instanceCache_.length){var r=jspb.BinaryReader.instanceCache_.pop();return e&&r.decoder_.setBlock(e,t,n),r}return new jspb.BinaryReader(e,t,n)},jspb.BinaryReader.prototype.alloc=jspb.BinaryReader.alloc,jspb.BinaryReader.prototype.free=function(){this.decoder_.clear(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID,this.error_=!1,this.readCallbacks_=null,100>jspb.BinaryReader.instanceCache_.length&&jspb.BinaryReader.instanceCache_.push(this)},jspb.BinaryReader.prototype.getFieldCursor=function(){return this.fieldCursor_},jspb.BinaryReader.prototype.getCursor=function(){return this.decoder_.getCursor()},jspb.BinaryReader.prototype.getBuffer=function(){return this.decoder_.getBuffer()},jspb.BinaryReader.prototype.getFieldNumber=function(){return this.nextField_},jspb.BinaryReader.prototype.getWireType=function(){return this.nextWireType_},jspb.BinaryReader.prototype.isDelimited=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED},jspb.BinaryReader.prototype.isEndGroup=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP},jspb.BinaryReader.prototype.getError=function(){return this.error_||this.decoder_.getError()},jspb.BinaryReader.prototype.setBlock=function(e,t,n){this.decoder_.setBlock(e,t,n),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID},jspb.BinaryReader.prototype.reset=function(){this.decoder_.reset(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID},jspb.BinaryReader.prototype.advance=function(e){this.decoder_.advance(e)},jspb.BinaryReader.prototype.nextField=function(){if(this.decoder_.atEnd())return!1;if(this.getError())return goog.asserts.fail("Decoder hit an error"),!1;this.fieldCursor_=this.decoder_.getCursor();var e=this.decoder_.readUnsignedVarint32(),t=e>>>3;return(e&=7)!=jspb.BinaryConstants.WireType.VARINT&&e!=jspb.BinaryConstants.WireType.FIXED32&&e!=jspb.BinaryConstants.WireType.FIXED64&&e!=jspb.BinaryConstants.WireType.DELIMITED&&e!=jspb.BinaryConstants.WireType.START_GROUP&&e!=jspb.BinaryConstants.WireType.END_GROUP?(goog.asserts.fail("Invalid wire type: %s (at position %s)",e,this.fieldCursor_),this.error_=!0,!1):(this.nextField_=t,this.nextWireType_=e,!0)},jspb.BinaryReader.prototype.unskipHeader=function(){this.decoder_.unskipVarint(this.nextField_<<3|this.nextWireType_)},jspb.BinaryReader.prototype.skipMatchingFields=function(){var e=this.nextField_;for(this.unskipHeader();this.nextField()&&this.getFieldNumber()==e;)this.skipField();this.decoder_.atEnd()||this.unskipHeader()},jspb.BinaryReader.prototype.skipVarintField=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.VARINT?(goog.asserts.fail("Invalid wire type for skipVarintField"),this.skipField()):this.decoder_.skipVarint()},jspb.BinaryReader.prototype.skipDelimitedField=function(){if(this.nextWireType_!=jspb.BinaryConstants.WireType.DELIMITED)goog.asserts.fail("Invalid wire type for skipDelimitedField"),this.skipField();else{var e=this.decoder_.readUnsignedVarint32();this.decoder_.advance(e)}},jspb.BinaryReader.prototype.skipFixed32Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED32?(goog.asserts.fail("Invalid wire type for skipFixed32Field"),this.skipField()):this.decoder_.advance(4)},jspb.BinaryReader.prototype.skipFixed64Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED64?(goog.asserts.fail("Invalid wire type for skipFixed64Field"),this.skipField()):this.decoder_.advance(8)},jspb.BinaryReader.prototype.skipGroup=function(){for(var e=this.nextField_;;){if(!this.nextField()){goog.asserts.fail("Unmatched start-group tag: stream EOF"),this.error_=!0;break}if(this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP){this.nextField_!=e&&(goog.asserts.fail("Unmatched end-group tag"),this.error_=!0);break}this.skipField()}},jspb.BinaryReader.prototype.skipField=function(){switch(this.nextWireType_){case jspb.BinaryConstants.WireType.VARINT:this.skipVarintField();break;case jspb.BinaryConstants.WireType.FIXED64:this.skipFixed64Field();break;case jspb.BinaryConstants.WireType.DELIMITED:this.skipDelimitedField();break;case jspb.BinaryConstants.WireType.FIXED32:this.skipFixed32Field();break;case jspb.BinaryConstants.WireType.START_GROUP:this.skipGroup();break;default:goog.asserts.fail("Invalid wire encoding for field.")}},jspb.BinaryReader.prototype.registerReadCallback=function(e,t){null===this.readCallbacks_&&(this.readCallbacks_={}),goog.asserts.assert(!this.readCallbacks_[e]),this.readCallbacks_[e]=t},jspb.BinaryReader.prototype.runReadCallback=function(e){return goog.asserts.assert(null!==this.readCallbacks_),e=this.readCallbacks_[e],goog.asserts.assert(e),e(this)},jspb.BinaryReader.prototype.readAny=function(e){this.nextWireType_=jspb.BinaryConstants.FieldTypeToWireType(e);var t=jspb.BinaryConstants.FieldType;switch(e){case t.DOUBLE:return this.readDouble();case t.FLOAT:return this.readFloat();case t.INT64:return this.readInt64();case t.UINT64:return this.readUint64();case t.INT32:return this.readInt32();case t.FIXED64:return this.readFixed64();case t.FIXED32:return this.readFixed32();case t.BOOL:return this.readBool();case t.STRING:return this.readString();case t.GROUP:goog.asserts.fail("Group field type not supported in readAny()");case t.MESSAGE:goog.asserts.fail("Message field type not supported in readAny()");case t.BYTES:return this.readBytes();case t.UINT32:return this.readUint32();case t.ENUM:return this.readEnum();case t.SFIXED32:return this.readSfixed32();case t.SFIXED64:return this.readSfixed64();case t.SINT32:return this.readSint32();case t.SINT64:return this.readSint64();case t.FHASH64:return this.readFixedHash64();case t.VHASH64:return this.readVarintHash64();default:goog.asserts.fail("Invalid field type in readAny()")}return 0},jspb.BinaryReader.prototype.readMessage=function(e,t){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var n=this.decoder_.getEnd(),r=this.decoder_.readUnsignedVarint32();r=this.decoder_.getCursor()+r,this.decoder_.setEnd(r),t(e,this),this.decoder_.setCursor(r),this.decoder_.setEnd(n)},jspb.BinaryReader.prototype.readGroup=function(e,t,n){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.START_GROUP),goog.asserts.assert(this.nextField_==e),n(t,this),this.error_||this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP||(goog.asserts.fail("Group submessage did not end with an END_GROUP tag"),this.error_=!0)},jspb.BinaryReader.prototype.getFieldDecoder=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32(),t=this.decoder_.getCursor(),n=t+e;return e=jspb.BinaryDecoder.alloc(this.decoder_.getBuffer(),t,e),this.decoder_.setCursor(n),e},jspb.BinaryReader.prototype.readInt32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint32()},jspb.BinaryReader.prototype.readInt32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint32String()},jspb.BinaryReader.prototype.readInt64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64()},jspb.BinaryReader.prototype.readInt64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64String()},jspb.BinaryReader.prototype.readUint32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint32()},jspb.BinaryReader.prototype.readUint32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint32String()},jspb.BinaryReader.prototype.readUint64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint64()},jspb.BinaryReader.prototype.readUint64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint64String()},jspb.BinaryReader.prototype.readSint32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint32()},jspb.BinaryReader.prototype.readSint64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint64()},jspb.BinaryReader.prototype.readSint64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint64String()},jspb.BinaryReader.prototype.readFixed32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readUint32()},jspb.BinaryReader.prototype.readFixed64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readUint64()},jspb.BinaryReader.prototype.readFixed64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readUint64String()},jspb.BinaryReader.prototype.readSfixed32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readInt32()},jspb.BinaryReader.prototype.readSfixed32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readInt32().toString()},jspb.BinaryReader.prototype.readSfixed64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readInt64()},jspb.BinaryReader.prototype.readSfixed64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readInt64String()},jspb.BinaryReader.prototype.readFloat=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readFloat()},jspb.BinaryReader.prototype.readDouble=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readDouble()},jspb.BinaryReader.prototype.readBool=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),!!this.decoder_.readUnsignedVarint32()},jspb.BinaryReader.prototype.readEnum=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64()},jspb.BinaryReader.prototype.readString=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32();return this.decoder_.readString(e)},jspb.BinaryReader.prototype.readBytes=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32();return this.decoder_.readBytes(e)},jspb.BinaryReader.prototype.readVarintHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readVarintHash64()},jspb.BinaryReader.prototype.readSintHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarintHash64()},jspb.BinaryReader.prototype.readSplitVarint64=function(e){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSplitVarint64(e)},jspb.BinaryReader.prototype.readSplitZigzagVarint64=function(e){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSplitVarint64((function(t,n){return jspb.utils.fromZigzag64(t,n,e)}))},jspb.BinaryReader.prototype.readFixedHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readFixedHash64()},jspb.BinaryReader.prototype.readSplitFixed64=function(e){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readSplitFixed64(e)},jspb.BinaryReader.prototype.readPackedField_=function(e){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var t=this.decoder_.readUnsignedVarint32();t=this.decoder_.getCursor()+t;for(var n=[];this.decoder_.getCursor()<t;)n.push(e.call(this.decoder_));return n},jspb.BinaryReader.prototype.readPackedInt32=function(){return this.readPackedField_(this.decoder_.readSignedVarint32)},jspb.BinaryReader.prototype.readPackedInt32String=function(){return this.readPackedField_(this.decoder_.readSignedVarint32String)},jspb.BinaryReader.prototype.readPackedInt64=function(){return this.readPackedField_(this.decoder_.readSignedVarint64)},jspb.BinaryReader.prototype.readPackedInt64String=function(){return this.readPackedField_(this.decoder_.readSignedVarint64String)},jspb.BinaryReader.prototype.readPackedUint32=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint32)},jspb.BinaryReader.prototype.readPackedUint32String=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint32String)},jspb.BinaryReader.prototype.readPackedUint64=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint64)},jspb.BinaryReader.prototype.readPackedUint64String=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint64String)},jspb.BinaryReader.prototype.readPackedSint32=function(){return this.readPackedField_(this.decoder_.readZigzagVarint32)},jspb.BinaryReader.prototype.readPackedSint64=function(){return this.readPackedField_(this.decoder_.readZigzagVarint64)},jspb.BinaryReader.prototype.readPackedSint64String=function(){return this.readPackedField_(this.decoder_.readZigzagVarint64String)},jspb.BinaryReader.prototype.readPackedFixed32=function(){return this.readPackedField_(this.decoder_.readUint32)},jspb.BinaryReader.prototype.readPackedFixed64=function(){return this.readPackedField_(this.decoder_.readUint64)},jspb.BinaryReader.prototype.readPackedFixed64String=function(){return this.readPackedField_(this.decoder_.readUint64String)},jspb.BinaryReader.prototype.readPackedSfixed32=function(){return this.readPackedField_(this.decoder_.readInt32)},jspb.BinaryReader.prototype.readPackedSfixed64=function(){return this.readPackedField_(this.decoder_.readInt64)},jspb.BinaryReader.prototype.readPackedSfixed64String=function(){return this.readPackedField_(this.decoder_.readInt64String)},jspb.BinaryReader.prototype.readPackedFloat=function(){return this.readPackedField_(this.decoder_.readFloat)},jspb.BinaryReader.prototype.readPackedDouble=function(){return this.readPackedField_(this.decoder_.readDouble)},jspb.BinaryReader.prototype.readPackedBool=function(){return this.readPackedField_(this.decoder_.readBool)},jspb.BinaryReader.prototype.readPackedEnum=function(){return this.readPackedField_(this.decoder_.readEnum)},jspb.BinaryReader.prototype.readPackedVarintHash64=function(){return this.readPackedField_(this.decoder_.readVarintHash64)},jspb.BinaryReader.prototype.readPackedFixedHash64=function(){return this.readPackedField_(this.decoder_.readFixedHash64)},jspb.BinaryEncoder=function(){this.buffer_=[]},jspb.BinaryEncoder.prototype.length=function(){return this.buffer_.length},jspb.BinaryEncoder.prototype.end=function(){var e=this.buffer_;return this.buffer_=[],e},jspb.BinaryEncoder.prototype.writeSplitVarint64=function(e,t){for(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(t==Math.floor(t)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32);0<t||127<e;)this.buffer_.push(127&e|128),e=(e>>>7|t<<25)>>>0,t>>>=7;this.buffer_.push(e)},jspb.BinaryEncoder.prototype.writeSplitFixed64=function(e,t){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(t==Math.floor(t)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUint32(e),this.writeUint32(t)},jspb.BinaryEncoder.prototype.writeUnsignedVarint32=function(e){for(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32);127<e;)this.buffer_.push(127&e|128),e>>>=7;this.buffer_.push(e)},jspb.BinaryEncoder.prototype.writeSignedVarint32=function(e){if(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),0<=e)this.writeUnsignedVarint32(e);else{for(var t=0;9>t;t++)this.buffer_.push(127&e|128),e>>=7;this.buffer_.push(1)}},jspb.BinaryEncoder.prototype.writeUnsignedVarint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_64),jspb.utils.splitInt64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeSignedVarint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitInt64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeZigzagVarint32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),this.writeUnsignedVarint32((e<<1^e>>31)>>>0)},jspb.BinaryEncoder.prototype.writeZigzagVarint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitZigzag64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeZigzagVarint64String=function(e){this.writeZigzagVarintHash64(jspb.utils.decimalStringToHash64(e))},jspb.BinaryEncoder.prototype.writeZigzagVarintHash64=function(e){var t=this;jspb.utils.splitHash64(e),jspb.utils.toZigzag64(jspb.utils.split64Low,jspb.utils.split64High,(function(e,n){t.writeSplitVarint64(e>>>0,n>>>0)}))},jspb.BinaryEncoder.prototype.writeUint8=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&256>e),this.buffer_.push(e>>>0&255)},jspb.BinaryEncoder.prototype.writeUint16=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&65536>e),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255)},jspb.BinaryEncoder.prototype.writeUint32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255),this.buffer_.push(e>>>16&255),this.buffer_.push(e>>>24&255)},jspb.BinaryEncoder.prototype.writeUint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_64),jspb.utils.splitUint64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeInt8=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(-128<=e&&128>e),this.buffer_.push(e>>>0&255)},jspb.BinaryEncoder.prototype.writeInt16=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(-32768<=e&&32768>e),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255)},jspb.BinaryEncoder.prototype.writeInt32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255),this.buffer_.push(e>>>16&255),this.buffer_.push(e>>>24&255)},jspb.BinaryEncoder.prototype.writeInt64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitInt64(e),this.writeSplitFixed64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeInt64String=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(+e>=-jspb.BinaryConstants.TWO_TO_63&&+e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitHash64(jspb.utils.decimalStringToHash64(e)),this.writeSplitFixed64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeFloat=function(e){goog.asserts.assert(1/0===e||-1/0===e||isNaN(e)||e>=-jspb.BinaryConstants.FLOAT32_MAX&&e<=jspb.BinaryConstants.FLOAT32_MAX),jspb.utils.splitFloat32(e),this.writeUint32(jspb.utils.split64Low)},jspb.BinaryEncoder.prototype.writeDouble=function(e){goog.asserts.assert(1/0===e||-1/0===e||isNaN(e)||e>=-jspb.BinaryConstants.FLOAT64_MAX&&e<=jspb.BinaryConstants.FLOAT64_MAX),jspb.utils.splitFloat64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeBool=function(e){goog.asserts.assert("boolean"==typeof e||"number"==typeof e),this.buffer_.push(e?1:0)},jspb.BinaryEncoder.prototype.writeEnum=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32(e)},jspb.BinaryEncoder.prototype.writeBytes=function(e){this.buffer_.push.apply(this.buffer_,e)},jspb.BinaryEncoder.prototype.writeVarintHash64=function(e){jspb.utils.splitHash64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeFixedHash64=function(e){jspb.utils.splitHash64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeString=function(e){for(var t=this.buffer_.length,n=0;n<e.length;n++){var r=e.charCodeAt(n);if(128>r)this.buffer_.push(r);else if(2048>r)this.buffer_.push(r>>6|192),this.buffer_.push(63&r|128);else if(65536>r)if(55296<=r&&56319>=r&&n+1<e.length){var o=e.charCodeAt(n+1);56320<=o&&57343>=o&&(r=1024*(r-55296)+o-56320+65536,this.buffer_.push(r>>18|240),this.buffer_.push(r>>12&63|128),this.buffer_.push(r>>6&63|128),this.buffer_.push(63&r|128),n++)}else this.buffer_.push(r>>12|224),this.buffer_.push(r>>6&63|128),this.buffer_.push(63&r|128)}return this.buffer_.length-t},jspb.arith={},jspb.arith.UInt64=function(e,t){this.lo=e,this.hi=t},jspb.arith.UInt64.prototype.cmp=function(e){return this.hi<e.hi||this.hi==e.hi&&this.lo<e.lo?-1:this.hi==e.hi&&this.lo==e.lo?0:1},jspb.arith.UInt64.prototype.rightShift=function(){return new jspb.arith.UInt64((this.lo>>>1|(1&this.hi)<<31)>>>0,this.hi>>>1>>>0)},jspb.arith.UInt64.prototype.leftShift=function(){return new jspb.arith.UInt64(this.lo<<1>>>0,(this.hi<<1|this.lo>>>31)>>>0)},jspb.arith.UInt64.prototype.msb=function(){return!!(2147483648&this.hi)},jspb.arith.UInt64.prototype.lsb=function(){return!!(1&this.lo)},jspb.arith.UInt64.prototype.zero=function(){return 0==this.lo&&0==this.hi},jspb.arith.UInt64.prototype.add=function(e){return new jspb.arith.UInt64((this.lo+e.lo&4294967295)>>>0>>>0,((this.hi+e.hi&4294967295)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},jspb.arith.UInt64.prototype.sub=function(e){return new jspb.arith.UInt64((this.lo-e.lo&4294967295)>>>0>>>0,((this.hi-e.hi&4294967295)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},jspb.arith.UInt64.mul32x32=function(e,t){var n=65535&e,r=65535&t,o=t>>>16;for(t=n*r+65536*(n*o&65535)+65536*((e>>>=16)*r&65535),n=e*o+(n*o>>>16)+(e*r>>>16);4294967296<=t;)t-=4294967296,n+=1;return new jspb.arith.UInt64(t>>>0,n>>>0)},jspb.arith.UInt64.prototype.mul=function(e){var t=jspb.arith.UInt64.mul32x32(this.lo,e);return(e=jspb.arith.UInt64.mul32x32(this.hi,e)).hi=e.lo,e.lo=0,t.add(e)},jspb.arith.UInt64.prototype.div=function(e){if(0==e)return[];var t=new jspb.arith.UInt64(0,0),n=new jspb.arith.UInt64(this.lo,this.hi);e=new jspb.arith.UInt64(e,0);for(var r=new jspb.arith.UInt64(1,0);!e.msb();)e=e.leftShift(),r=r.leftShift();for(;!r.zero();)0>=e.cmp(n)&&(t=t.add(r),n=n.sub(e)),e=e.rightShift(),r=r.rightShift();return[t,n]},jspb.arith.UInt64.prototype.toString=function(){for(var e="",t=this;!t.zero();){var n=(t=t.div(10))[0];e=t[1].lo+e,t=n}return""==e&&(e="0"),e},jspb.arith.UInt64.fromString=function(e){for(var t=new jspb.arith.UInt64(0,0),n=new jspb.arith.UInt64(0,0),r=0;r<e.length;r++){if("0">e[r]||"9"<e[r])return null;var o=parseInt(e[r],10);n.lo=o,t=t.mul(10).add(n)}return t},jspb.arith.UInt64.prototype.clone=function(){return new jspb.arith.UInt64(this.lo,this.hi)},jspb.arith.Int64=function(e,t){this.lo=e,this.hi=t},jspb.arith.Int64.prototype.add=function(e){return new jspb.arith.Int64((this.lo+e.lo&4294967295)>>>0>>>0,((this.hi+e.hi&4294967295)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},jspb.arith.Int64.prototype.sub=function(e){return new jspb.arith.Int64((this.lo-e.lo&4294967295)>>>0>>>0,((this.hi-e.hi&4294967295)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},jspb.arith.Int64.prototype.clone=function(){return new jspb.arith.Int64(this.lo,this.hi)},jspb.arith.Int64.prototype.toString=function(){var e=0!=(2147483648&this.hi),t=new jspb.arith.UInt64(this.lo,this.hi);return e&&(t=new jspb.arith.UInt64(0,0).sub(t)),(e?"-":"")+t.toString()},jspb.arith.Int64.fromString=function(e){var t=0<e.length&&"-"==e[0];return t&&(e=e.substring(1)),null===(e=jspb.arith.UInt64.fromString(e))?null:(t&&(e=new jspb.arith.UInt64(0,0).sub(e)),new jspb.arith.Int64(e.lo,e.hi))},jspb.BinaryWriter=function(){this.blocks_=[],this.totalLength_=0,this.encoder_=new jspb.BinaryEncoder,this.bookmarks_=[]},jspb.BinaryWriter.prototype.appendUint8Array_=function(e){var t=this.encoder_.end();this.blocks_.push(t),this.blocks_.push(e),this.totalLength_+=t.length+e.length},jspb.BinaryWriter.prototype.beginDelimited_=function(e){return this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),e=this.encoder_.end(),this.blocks_.push(e),this.totalLength_+=e.length,e.push(this.totalLength_),e},jspb.BinaryWriter.prototype.endDelimited_=function(e){var t=e.pop();for(t=this.totalLength_+this.encoder_.length()-t,goog.asserts.assert(0<=t);127<t;)e.push(127&t|128),t>>>=7,this.totalLength_++;e.push(t),this.totalLength_++},jspb.BinaryWriter.prototype.writeSerializedMessage=function(e,t,n){this.appendUint8Array_(e.subarray(t,n))},jspb.BinaryWriter.prototype.maybeWriteSerializedMessage=function(e,t,n){null!=e&&null!=t&&null!=n&&this.writeSerializedMessage(e,t,n)},jspb.BinaryWriter.prototype.reset=function(){this.blocks_=[],this.encoder_.end(),this.totalLength_=0,this.bookmarks_=[]},jspb.BinaryWriter.prototype.getResultBuffer=function(){goog.asserts.assert(0==this.bookmarks_.length);for(var e=new Uint8Array(this.totalLength_+this.encoder_.length()),t=this.blocks_,n=t.length,r=0,o=0;o<n;o++){var i=t[o];e.set(i,r),r+=i.length}return t=this.encoder_.end(),e.set(t,r),r+=t.length,goog.asserts.assert(r==e.length),this.blocks_=[e],e},jspb.BinaryWriter.prototype.getResultBase64String=function(e){return goog.crypt.base64.encodeByteArray(this.getResultBuffer(),e)},jspb.BinaryWriter.prototype.beginSubMessage=function(e){this.bookmarks_.push(this.beginDelimited_(e))},jspb.BinaryWriter.prototype.endSubMessage=function(){goog.asserts.assert(0<=this.bookmarks_.length),this.endDelimited_(this.bookmarks_.pop())},jspb.BinaryWriter.prototype.writeFieldHeader_=function(e,t){goog.asserts.assert(1<=e&&e==Math.floor(e)),this.encoder_.writeUnsignedVarint32(8*e+t)},jspb.BinaryWriter.prototype.writeAny=function(e,t,n){var r=jspb.BinaryConstants.FieldType;switch(e){case r.DOUBLE:this.writeDouble(t,n);break;case r.FLOAT:this.writeFloat(t,n);break;case r.INT64:this.writeInt64(t,n);break;case r.UINT64:this.writeUint64(t,n);break;case r.INT32:this.writeInt32(t,n);break;case r.FIXED64:this.writeFixed64(t,n);break;case r.FIXED32:this.writeFixed32(t,n);break;case r.BOOL:this.writeBool(t,n);break;case r.STRING:this.writeString(t,n);break;case r.GROUP:goog.asserts.fail("Group field type not supported in writeAny()");break;case r.MESSAGE:goog.asserts.fail("Message field type not supported in writeAny()");break;case r.BYTES:this.writeBytes(t,n);break;case r.UINT32:this.writeUint32(t,n);break;case r.ENUM:this.writeEnum(t,n);break;case r.SFIXED32:this.writeSfixed32(t,n);break;case r.SFIXED64:this.writeSfixed64(t,n);break;case r.SINT32:this.writeSint32(t,n);break;case r.SINT64:this.writeSint64(t,n);break;case r.FHASH64:this.writeFixedHash64(t,n);break;case r.VHASH64:this.writeVarintHash64(t,n);break;default:goog.asserts.fail("Invalid field type in writeAny()")}},jspb.BinaryWriter.prototype.writeUnsignedVarint32_=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeUnsignedVarint32(t))},jspb.BinaryWriter.prototype.writeSignedVarint32_=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(t))},jspb.BinaryWriter.prototype.writeUnsignedVarint64_=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeUnsignedVarint64(t))},jspb.BinaryWriter.prototype.writeSignedVarint64_=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint64(t))},jspb.BinaryWriter.prototype.writeZigzagVarint32_=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint32(t))},jspb.BinaryWriter.prototype.writeZigzagVarint64_=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint64(t))},jspb.BinaryWriter.prototype.writeZigzagVarint64String_=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint64String(t))},jspb.BinaryWriter.prototype.writeZigzagVarintHash64_=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarintHash64(t))},jspb.BinaryWriter.prototype.writeInt32=function(e,t){null!=t&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeInt32String=function(e,t){null!=t&&(t=parseInt(t,10),goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeInt64=function(e,t){null!=t&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeSignedVarint64_(e,t))},jspb.BinaryWriter.prototype.writeInt64String=function(e,t){null!=t&&(t=jspb.arith.Int64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeUint32=function(e,t){null!=t&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUnsignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeUint32String=function(e,t){null!=t&&(t=parseInt(t,10),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUnsignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeUint64=function(e,t){null!=t&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_64),this.writeUnsignedVarint64_(e,t))},jspb.BinaryWriter.prototype.writeUint64String=function(e,t){null!=t&&(t=jspb.arith.UInt64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeSint32=function(e,t){null!=t&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeZigzagVarint32_(e,t))},jspb.BinaryWriter.prototype.writeSint64=function(e,t){null!=t&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeZigzagVarint64_(e,t))},jspb.BinaryWriter.prototype.writeSintHash64=function(e,t){null!=t&&this.writeZigzagVarintHash64_(e,t)},jspb.BinaryWriter.prototype.writeSint64String=function(e,t){null!=t&&this.writeZigzagVarint64String_(e,t)},jspb.BinaryWriter.prototype.writeFixed32=function(e,t){null!=t&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeUint32(t))},jspb.BinaryWriter.prototype.writeFixed64=function(e,t){null!=t&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_64),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeUint64(t))},jspb.BinaryWriter.prototype.writeFixed64String=function(e,t){null!=t&&(t=jspb.arith.UInt64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeSfixed32=function(e,t){null!=t&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeInt32(t))},jspb.BinaryWriter.prototype.writeSfixed64=function(e,t){null!=t&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeInt64(t))},jspb.BinaryWriter.prototype.writeSfixed64String=function(e,t){null!=t&&(t=jspb.arith.Int64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeFloat=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeFloat(t))},jspb.BinaryWriter.prototype.writeDouble=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeDouble(t))},jspb.BinaryWriter.prototype.writeBool=function(e,t){null!=t&&(goog.asserts.assert("boolean"==typeof t||"number"==typeof t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeBool(t))},jspb.BinaryWriter.prototype.writeEnum=function(e,t){null!=t&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(t))},jspb.BinaryWriter.prototype.writeString=function(e,t){null!=t&&(e=this.beginDelimited_(e),this.encoder_.writeString(t),this.endDelimited_(e))},jspb.BinaryWriter.prototype.writeBytes=function(e,t){null!=t&&(t=jspb.utils.byteSourceToUint8Array(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(t.length),this.appendUint8Array_(t))},jspb.BinaryWriter.prototype.writeMessage=function(e,t,n){null!=t&&(e=this.beginDelimited_(e),n(t,this),this.endDelimited_(e))},jspb.BinaryWriter.prototype.writeMessageSet=function(e,t,n){null!=t&&(this.writeFieldHeader_(1,jspb.BinaryConstants.WireType.START_GROUP),this.writeFieldHeader_(2,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(e),e=this.beginDelimited_(3),n(t,this),this.endDelimited_(e),this.writeFieldHeader_(1,jspb.BinaryConstants.WireType.END_GROUP))},jspb.BinaryWriter.prototype.writeGroup=function(e,t,n){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.START_GROUP),n(t,this),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.END_GROUP))},jspb.BinaryWriter.prototype.writeFixedHash64=function(e,t){null!=t&&(goog.asserts.assert(8==t.length),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeFixedHash64(t))},jspb.BinaryWriter.prototype.writeVarintHash64=function(e,t){null!=t&&(goog.asserts.assert(8==t.length),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeVarintHash64(t))},jspb.BinaryWriter.prototype.writeSplitFixed64=function(e,t,n){this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t,n)},jspb.BinaryWriter.prototype.writeSplitVarint64=function(e,t,n){this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t,n)},jspb.BinaryWriter.prototype.writeSplitZigzagVarint64=function(e,t,n){this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT);var r=this.encoder_;jspb.utils.toZigzag64(t,n,(function(e,t){r.writeSplitVarint64(e>>>0,t>>>0)}))},jspb.BinaryWriter.prototype.writeRepeatedInt32=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeSignedVarint32_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedInt32String=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeInt32String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedInt64=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeSignedVarint64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSplitFixed64=function(e,t,n,r){if(null!=t)for(var o=0;o<t.length;o++)this.writeSplitFixed64(e,n(t[o]),r(t[o]))},jspb.BinaryWriter.prototype.writeRepeatedSplitVarint64=function(e,t,n,r){if(null!=t)for(var o=0;o<t.length;o++)this.writeSplitVarint64(e,n(t[o]),r(t[o]))},jspb.BinaryWriter.prototype.writeRepeatedSplitZigzagVarint64=function(e,t,n,r){if(null!=t)for(var o=0;o<t.length;o++)this.writeSplitZigzagVarint64(e,n(t[o]),r(t[o]))},jspb.BinaryWriter.prototype.writeRepeatedInt64String=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeInt64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint32=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeUnsignedVarint32_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint32String=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeUint32String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint64=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeUnsignedVarint64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint64String=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeUint64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSint32=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeZigzagVarint32_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSint64=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeZigzagVarint64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSint64String=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeZigzagVarint64String_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSintHash64=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeZigzagVarintHash64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFixed32=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeFixed32(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFixed64=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeFixed64(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFixed64String=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeFixed64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSfixed32=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeSfixed32(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSfixed64=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeSfixed64(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSfixed64String=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeSfixed64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFloat=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeFloat(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedDouble=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeDouble(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedBool=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeBool(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedEnum=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeEnum(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedString=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeString(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedBytes=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeBytes(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedMessage=function(e,t,n){if(null!=t)for(var r=0;r<t.length;r++){var o=this.beginDelimited_(e);n(t[r],this),this.endDelimited_(o)}},jspb.BinaryWriter.prototype.writeRepeatedGroup=function(e,t,n){if(null!=t)for(var r=0;r<t.length;r++)this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.START_GROUP),n(t[r],this),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.END_GROUP)},jspb.BinaryWriter.prototype.writeRepeatedFixedHash64=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeFixedHash64(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedVarintHash64=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeVarintHash64(e,t[n])},jspb.BinaryWriter.prototype.writePackedInt32=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeSignedVarint32(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedInt32String=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeSignedVarint32(parseInt(t[n],10));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedInt64=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeSignedVarint64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitFixed64=function(e,t,n,r){if(null!=t){e=this.beginDelimited_(e);for(var o=0;o<t.length;o++)this.encoder_.writeSplitFixed64(n(t[o]),r(t[o]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitVarint64=function(e,t,n,r){if(null!=t){e=this.beginDelimited_(e);for(var o=0;o<t.length;o++)this.encoder_.writeSplitVarint64(n(t[o]),r(t[o]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitZigzagVarint64=function(e,t,n,r){if(null!=t){e=this.beginDelimited_(e);for(var o=this.encoder_,i=0;i<t.length;i++)jspb.utils.toZigzag64(n(t[i]),r(t[i]),(function(e,t){o.writeSplitVarint64(e>>>0,t>>>0)}));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedInt64String=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++){var r=jspb.arith.Int64.fromString(t[n]);this.encoder_.writeSplitVarint64(r.lo,r.hi)}this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint32=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeUnsignedVarint32(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint32String=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeUnsignedVarint32(parseInt(t[n],10));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint64=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeUnsignedVarint64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint64String=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++){var r=jspb.arith.UInt64.fromString(t[n]);this.encoder_.writeSplitVarint64(r.lo,r.hi)}this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSint32=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarint32(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSint64=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarint64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSint64String=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarintHash64(jspb.utils.decimalStringToHash64(t[n]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSintHash64=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarintHash64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedFixed32=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeUint32(t[e])},jspb.BinaryWriter.prototype.writePackedFixed64=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeUint64(t[e])},jspb.BinaryWriter.prototype.writePackedFixed64String=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++){var n=jspb.arith.UInt64.fromString(t[e]);this.encoder_.writeSplitFixed64(n.lo,n.hi)}},jspb.BinaryWriter.prototype.writePackedSfixed32=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeInt32(t[e])},jspb.BinaryWriter.prototype.writePackedSfixed64=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeInt64(t[e])},jspb.BinaryWriter.prototype.writePackedSfixed64String=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeInt64String(t[e])},jspb.BinaryWriter.prototype.writePackedFloat=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeFloat(t[e])},jspb.BinaryWriter.prototype.writePackedDouble=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeDouble(t[e])},jspb.BinaryWriter.prototype.writePackedBool=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(t.length),e=0;e<t.length;e++)this.encoder_.writeBool(t[e])},jspb.BinaryWriter.prototype.writePackedEnum=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeEnum(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedFixedHash64=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeFixedHash64(t[e])},jspb.BinaryWriter.prototype.writePackedVarintHash64=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeVarintHash64(t[n]);this.endDelimited_(e)}},jspb.Map=function(e,t){this.arr_=e,this.valueCtor_=t,this.map_={},this.arrClean=!0,0<this.arr_.length&&this.loadFromArray_()},jspb.Map.prototype.loadFromArray_=function(){for(var e=0;e<this.arr_.length;e++){var t=this.arr_[e],n=t[0];this.map_[n.toString()]=new jspb.Map.Entry_(n,t[1])}this.arrClean=!0},jspb.Map.prototype.toArray=function(){if(this.arrClean){if(this.valueCtor_){var e,t=this.map_;for(e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var n=t[e].valueWrapper;n&&n.toArray()}}}else{for(this.arr_.length=0,(t=this.stringKeys_()).sort(),e=0;e<t.length;e++){var r=this.map_[t[e]];(n=r.valueWrapper)&&n.toArray(),this.arr_.push([r.key,r.value])}this.arrClean=!0}return this.arr_},jspb.Map.prototype.toObject=function(e,t){for(var n=this.toArray(),r=[],o=0;o<n.length;o++){var i=this.map_[n[o][0].toString()];this.wrapEntry_(i);var a=i.valueWrapper;a?(goog.asserts.assert(t),r.push([i.key,t(e,a)])):r.push([i.key,i.value])}return r},jspb.Map.fromObject=function(e,t,n){t=new jspb.Map([],t);for(var r=0;r<e.length;r++){var o=e[r][0],i=n(e[r][1]);t.set(o,i)}return t},jspb.Map.ArrayIteratorIterable_=function(e){this.idx_=0,this.arr_=e},jspb.Map.ArrayIteratorIterable_.prototype.next=function(){return this.idx_<this.arr_.length?{done:!1,value:this.arr_[this.idx_++]}:{done:!0,value:void 0}},"undefined"!=typeof Symbol&&(jspb.Map.ArrayIteratorIterable_.prototype[Symbol.iterator]=function(){return this}),jspb.Map.prototype.getLength=function(){return this.stringKeys_().length},jspb.Map.prototype.clear=function(){this.map_={},this.arrClean=!1},jspb.Map.prototype.del=function(e){e=e.toString();var t=this.map_.hasOwnProperty(e);return delete this.map_[e],this.arrClean=!1,t},jspb.Map.prototype.getEntryList=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++){var r=this.map_[t[n]];e.push([r.key,r.value])}return e},jspb.Map.prototype.entries=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++){var r=this.map_[t[n]];e.push([r.key,this.wrapEntry_(r)])}return new jspb.Map.ArrayIteratorIterable_(e)},jspb.Map.prototype.keys=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++)e.push(this.map_[t[n]].key);return new jspb.Map.ArrayIteratorIterable_(e)},jspb.Map.prototype.values=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++)e.push(this.wrapEntry_(this.map_[t[n]]));return new jspb.Map.ArrayIteratorIterable_(e)},jspb.Map.prototype.forEach=function(e,t){var n=this.stringKeys_();n.sort();for(var r=0;r<n.length;r++){var o=this.map_[n[r]];e.call(t,this.wrapEntry_(o),o.key,this)}},jspb.Map.prototype.set=function(e,t){var n=new jspb.Map.Entry_(e);return this.valueCtor_?(n.valueWrapper=t,n.value=t.toArray()):n.value=t,this.map_[e.toString()]=n,this.arrClean=!1,this},jspb.Map.prototype.wrapEntry_=function(e){return this.valueCtor_?(e.valueWrapper||(e.valueWrapper=new this.valueCtor_(e.value)),e.valueWrapper):e.value},jspb.Map.prototype.get=function(e){if(e=this.map_[e.toString()])return this.wrapEntry_(e)},jspb.Map.prototype.has=function(e){return e.toString()in this.map_},jspb.Map.prototype.serializeBinary=function(e,t,n,r,o){var i=this.stringKeys_();i.sort();for(var a=0;a<i.length;a++){var s=this.map_[i[a]];t.beginSubMessage(e),n.call(t,1,s.key),this.valueCtor_?r.call(t,2,this.wrapEntry_(s),o):r.call(t,2,s.value),t.endSubMessage()}},jspb.Map.deserializeBinary=function(e,t,n,r,o,i,a){for(;t.nextField()&&!t.isEndGroup();){var s=t.getFieldNumber();1==s?i=n.call(t):2==s&&(e.valueCtor_?(goog.asserts.assert(o),a||(a=new e.valueCtor_),r.call(t,a,o)):a=r.call(t))}goog.asserts.assert(null!=i),goog.asserts.assert(null!=a),e.set(i,a)},jspb.Map.prototype.stringKeys_=function(){var e,t=this.map_,n=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.push(e);return n},jspb.Map.Entry_=function(e,t){this.key=e,this.value=t,this.valueWrapper=void 0},jspb.ExtensionFieldInfo=function(e,t,n,r,o){this.fieldIndex=e,this.fieldName=t,this.ctor=n,this.toObjectFn=r,this.isRepeated=o},jspb.ExtensionFieldBinaryInfo=function(e,t,n,r,o,i){this.fieldInfo=e,this.binaryReaderFn=t,this.binaryWriterFn=n,this.binaryMessageSerializeFn=r,this.binaryMessageDeserializeFn=o,this.isPacked=i},jspb.ExtensionFieldInfo.prototype.isMessageType=function(){return!!this.ctor},jspb.Message=function(){},jspb.Message.GENERATE_TO_OBJECT=!0,jspb.Message.GENERATE_FROM_OBJECT=!goog.DISALLOW_TEST_ONLY_CODE,jspb.Message.GENERATE_TO_STRING=!0,jspb.Message.ASSUME_LOCAL_ARRAYS=!1,jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS=!0,jspb.Message.SUPPORTS_UINT8ARRAY_="function"==typeof Uint8Array,jspb.Message.prototype.getJsPbMessageId=function(){return this.messageId_},jspb.Message.getIndex_=function(e,t){return t+e.arrayIndexOffset_},jspb.Message.hiddenES6Property_=function(){},jspb.Message.getFieldNumber_=function(e,t){return t-e.arrayIndexOffset_},jspb.Message.initialize=function(e,t,n,r,o,i){if(e.wrappers_=null,t||(t=n?[n]:[]),e.messageId_=n?String(n):void 0,e.arrayIndexOffset_=0===n?-1:0,e.array=t,jspb.Message.initPivotAndExtensionObject_(e,r),e.convertedPrimitiveFields_={},jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS||(e.repeatedFields=o),o)for(t=0;t<o.length;t++)(n=o[t])<e.pivot_?(n=jspb.Message.getIndex_(e,n),e.array[n]=e.array[n]||jspb.Message.EMPTY_LIST_SENTINEL_):(jspb.Message.maybeInitEmptyExtensionObject_(e),e.extensionObject_[n]=e.extensionObject_[n]||jspb.Message.EMPTY_LIST_SENTINEL_);if(i&&i.length)for(t=0;t<i.length;t++)jspb.Message.computeOneofCase(e,i[t])},jspb.Message.EMPTY_LIST_SENTINEL_=goog.DEBUG&&Object.freeze?Object.freeze([]):[],jspb.Message.isArray_=function(e){return jspb.Message.ASSUME_LOCAL_ARRAYS?e instanceof Array:Array.isArray(e)},jspb.Message.isExtensionObject_=function(e){return!(null===e||"object"!=typeof e||jspb.Message.isArray_(e)||jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array)},jspb.Message.initPivotAndExtensionObject_=function(e,t){var n=e.array.length,r=-1;if(n&&(r=n-1,n=e.array[r],jspb.Message.isExtensionObject_(n)))return e.pivot_=jspb.Message.getFieldNumber_(e,r),void(e.extensionObject_=n);-1<t?(e.pivot_=Math.max(t,jspb.Message.getFieldNumber_(e,r+1)),e.extensionObject_=null):e.pivot_=Number.MAX_VALUE},jspb.Message.maybeInitEmptyExtensionObject_=function(e){var t=jspb.Message.getIndex_(e,e.pivot_);e.array[t]||(e.extensionObject_=e.array[t]={})},jspb.Message.toObjectList=function(e,t,n){for(var r=[],o=0;o<e.length;o++)r[o]=t.call(e[o],n,e[o]);return r},jspb.Message.toObjectExtension=function(e,t,n,r,o){for(var i in n){var a=n[i],s=r.call(e,a);if(null!=s){for(var l in a.fieldName)if(a.fieldName.hasOwnProperty(l))break;t[l]=a.toObjectFn?a.isRepeated?jspb.Message.toObjectList(s,a.toObjectFn,o):a.toObjectFn(o,s):s}}},jspb.Message.serializeBinaryExtensions=function(e,t,n,r){for(var o in n){var i=n[o],a=i.fieldInfo;if(!i.binaryWriterFn)throw Error("Message extension present that was generated without binary serialization support");var s=r.call(e,a);if(null!=s)if(a.isMessageType()){if(!i.binaryMessageSerializeFn)throw Error("Message extension present holding submessage without binary support enabled, and message is being serialized to binary format");i.binaryWriterFn.call(t,a.fieldIndex,s,i.binaryMessageSerializeFn)}else i.binaryWriterFn.call(t,a.fieldIndex,s)}},jspb.Message.readBinaryExtension=function(e,t,n,r,o){var i=n[t.getFieldNumber()];if(i){if(n=i.fieldInfo,!i.binaryReaderFn)throw Error("Deserializing extension whose generated code does not support binary format");if(n.isMessageType()){var a=new n.ctor;i.binaryReaderFn.call(t,a,i.binaryMessageDeserializeFn)}else a=i.binaryReaderFn.call(t);n.isRepeated&&!i.isPacked?(t=r.call(e,n))?t.push(a):o.call(e,n,[a]):o.call(e,n,a)}else t.skipField()},jspb.Message.getField=function(e,t){if(t<e.pivot_){t=jspb.Message.getIndex_(e,t);var n=e.array[t];return n===jspb.Message.EMPTY_LIST_SENTINEL_?e.array[t]=[]:n}if(e.extensionObject_)return(n=e.extensionObject_[t])===jspb.Message.EMPTY_LIST_SENTINEL_?e.extensionObject_[t]=[]:n},jspb.Message.getRepeatedField=function(e,t){return jspb.Message.getField(e,t)},jspb.Message.getOptionalFloatingPointField=function(e,t){return null==(e=jspb.Message.getField(e,t))?e:+e},jspb.Message.getBooleanField=function(e,t){return null==(e=jspb.Message.getField(e,t))?e:!!e},jspb.Message.getRepeatedFloatingPointField=function(e,t){var n=jspb.Message.getRepeatedField(e,t);if(e.convertedPrimitiveFields_||(e.convertedPrimitiveFields_={}),!e.convertedPrimitiveFields_[t]){for(var r=0;r<n.length;r++)n[r]=+n[r];e.convertedPrimitiveFields_[t]=!0}return n},jspb.Message.getRepeatedBooleanField=function(e,t){var n=jspb.Message.getRepeatedField(e,t);if(e.convertedPrimitiveFields_||(e.convertedPrimitiveFields_={}),!e.convertedPrimitiveFields_[t]){for(var r=0;r<n.length;r++)n[r]=!!n[r];e.convertedPrimitiveFields_[t]=!0}return n},jspb.Message.bytesAsB64=function(e){return null==e||"string"==typeof e?e:jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array?goog.crypt.base64.encodeByteArray(e):(goog.asserts.fail("Cannot coerce to b64 string: "+goog.typeOf(e)),null)},jspb.Message.bytesAsU8=function(e){return null==e||e instanceof Uint8Array?e:"string"==typeof e?goog.crypt.base64.decodeStringToUint8Array(e):(goog.asserts.fail("Cannot coerce to Uint8Array: "+goog.typeOf(e)),null)},jspb.Message.bytesListAsB64=function(e){return jspb.Message.assertConsistentTypes_(e),e.length&&"string"!=typeof e[0]?goog.array.map(e,jspb.Message.bytesAsB64):e},jspb.Message.bytesListAsU8=function(e){return jspb.Message.assertConsistentTypes_(e),!e.length||e[0]instanceof Uint8Array?e:goog.array.map(e,jspb.Message.bytesAsU8)},jspb.Message.assertConsistentTypes_=function(e){if(goog.DEBUG&&e&&1<e.length){var t=goog.typeOf(e[0]);goog.array.forEach(e,(function(e){goog.typeOf(e)!=t&&goog.asserts.fail("Inconsistent type in JSPB repeated field array. Got "+goog.typeOf(e)+" expected "+t)}))}},jspb.Message.getFieldWithDefault=function(e,t,n){return null==(e=jspb.Message.getField(e,t))?n:e},jspb.Message.getBooleanFieldWithDefault=function(e,t,n){return null==(e=jspb.Message.getBooleanField(e,t))?n:e},jspb.Message.getFloatingPointFieldWithDefault=function(e,t,n){return null==(e=jspb.Message.getOptionalFloatingPointField(e,t))?n:e},jspb.Message.getFieldProto3=jspb.Message.getFieldWithDefault,jspb.Message.getMapField=function(e,t,n,r){if(e.wrappers_||(e.wrappers_={}),t in e.wrappers_)return e.wrappers_[t];var o=jspb.Message.getField(e,t);if(!o){if(n)return;o=[],jspb.Message.setField(e,t,o)}return e.wrappers_[t]=new jspb.Map(o,r)},jspb.Message.setField=function(e,t,n){return goog.asserts.assertInstanceof(e,jspb.Message),t<e.pivot_?e.array[jspb.Message.getIndex_(e,t)]=n:(jspb.Message.maybeInitEmptyExtensionObject_(e),e.extensionObject_[t]=n),e},jspb.Message.setProto3IntField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,0)},jspb.Message.setProto3FloatField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,0)},jspb.Message.setProto3BooleanField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,!1)},jspb.Message.setProto3StringField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,"")},jspb.Message.setProto3BytesField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,"")},jspb.Message.setProto3EnumField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,0)},jspb.Message.setProto3StringIntField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,"0")},jspb.Message.setFieldIgnoringDefault_=function(e,t,n,r){return goog.asserts.assertInstanceof(e,jspb.Message),n!==r?jspb.Message.setField(e,t,n):t<e.pivot_?e.array[jspb.Message.getIndex_(e,t)]=null:(jspb.Message.maybeInitEmptyExtensionObject_(e),delete e.extensionObject_[t]),e},jspb.Message.addToRepeatedField=function(e,t,n,r){return goog.asserts.assertInstanceof(e,jspb.Message),t=jspb.Message.getRepeatedField(e,t),null!=r?t.splice(r,0,n):t.push(n),e},jspb.Message.setOneofField=function(e,t,n,r){return goog.asserts.assertInstanceof(e,jspb.Message),(n=jspb.Message.computeOneofCase(e,n))&&n!==t&&void 0!==r&&(e.wrappers_&&n in e.wrappers_&&(e.wrappers_[n]=void 0),jspb.Message.setField(e,n,void 0)),jspb.Message.setField(e,t,r)},jspb.Message.computeOneofCase=function(e,t){for(var n,r,o=0;o<t.length;o++){var i=t[o],a=jspb.Message.getField(e,i);null!=a&&(n=i,r=a,jspb.Message.setField(e,i,void 0))}return n?(jspb.Message.setField(e,n,r),n):0},jspb.Message.getWrapperField=function(e,t,n,r){if(e.wrappers_||(e.wrappers_={}),!e.wrappers_[n]){var o=jspb.Message.getField(e,n);(r||o)&&(e.wrappers_[n]=new t(o))}return e.wrappers_[n]},jspb.Message.getRepeatedWrapperField=function(e,t,n){return jspb.Message.wrapRepeatedField_(e,t,n),(t=e.wrappers_[n])==jspb.Message.EMPTY_LIST_SENTINEL_&&(t=e.wrappers_[n]=[]),t},jspb.Message.wrapRepeatedField_=function(e,t,n){if(e.wrappers_||(e.wrappers_={}),!e.wrappers_[n]){for(var r=jspb.Message.getRepeatedField(e,n),o=[],i=0;i<r.length;i++)o[i]=new t(r[i]);e.wrappers_[n]=o}},jspb.Message.setWrapperField=function(e,t,n){goog.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={});var r=n?n.toArray():n;return e.wrappers_[t]=n,jspb.Message.setField(e,t,r)},jspb.Message.setOneofWrapperField=function(e,t,n,r){goog.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={});var o=r?r.toArray():r;return e.wrappers_[t]=r,jspb.Message.setOneofField(e,t,n,o)},jspb.Message.setRepeatedWrapperField=function(e,t,n){goog.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={}),n=n||[];for(var r=[],o=0;o<n.length;o++)r[o]=n[o].toArray();return e.wrappers_[t]=n,jspb.Message.setField(e,t,r)},jspb.Message.addToRepeatedWrapperField=function(e,t,n,r,o){jspb.Message.wrapRepeatedField_(e,r,t);var i=e.wrappers_[t];return i||(i=e.wrappers_[t]=[]),n=n||new r,e=jspb.Message.getRepeatedField(e,t),null!=o?(i.splice(o,0,n),e.splice(o,0,n.toArray())):(i.push(n),e.push(n.toArray())),n},jspb.Message.toMap=function(e,t,n,r){for(var o={},i=0;i<e.length;i++)o[t.call(e[i])]=n?n.call(e[i],r,e[i]):e[i];return o},jspb.Message.prototype.syncMapFields_=function(){if(this.wrappers_)for(var e in this.wrappers_){var t=this.wrappers_[e];if(Array.isArray(t))for(var n=0;n<t.length;n++)t[n]&&t[n].toArray();else t&&t.toArray()}},jspb.Message.prototype.toArray=function(){return this.syncMapFields_(),this.array},jspb.Message.GENERATE_TO_STRING&&(jspb.Message.prototype.toString=function(){return this.syncMapFields_(),this.array.toString()}),jspb.Message.prototype.getExtension=function(e){if(this.extensionObject_){this.wrappers_||(this.wrappers_={});var t=e.fieldIndex;if(e.isRepeated){if(e.isMessageType())return this.wrappers_[t]||(this.wrappers_[t]=goog.array.map(this.extensionObject_[t]||[],(function(t){return new e.ctor(t)}))),this.wrappers_[t]}else if(e.isMessageType())return!this.wrappers_[t]&&this.extensionObject_[t]&&(this.wrappers_[t]=new e.ctor(this.extensionObject_[t])),this.wrappers_[t];return this.extensionObject_[t]}},jspb.Message.prototype.setExtension=function(e,t){this.wrappers_||(this.wrappers_={}),jspb.Message.maybeInitEmptyExtensionObject_(this);var n=e.fieldIndex;return e.isRepeated?(t=t||[],e.isMessageType()?(this.wrappers_[n]=t,this.extensionObject_[n]=goog.array.map(t,(function(e){return e.toArray()}))):this.extensionObject_[n]=t):e.isMessageType()?(this.wrappers_[n]=t,this.extensionObject_[n]=t?t.toArray():t):this.extensionObject_[n]=t,this},jspb.Message.difference=function(e,t){if(!(e instanceof t.constructor))throw Error("Messages have different types.");var n=e.toArray();t=t.toArray();var r=[],o=0,i=n.length>t.length?n.length:t.length;for(e.getJsPbMessageId()&&(r[0]=e.getJsPbMessageId(),o=1);o<i;o++)jspb.Message.compareFields(n[o],t[o])||(r[o]=t[o]);return new e.constructor(r)},jspb.Message.equals=function(e,t){return e==t||!(!e||!t)&&e instanceof t.constructor&&jspb.Message.compareFields(e.toArray(),t.toArray())},jspb.Message.compareExtensions=function(e,t){e=e||{},t=t||{};var n,r={};for(n in e)r[n]=0;for(n in t)r[n]=0;for(n in r)if(!jspb.Message.compareFields(e[n],t[n]))return!1;return!0},jspb.Message.compareFields=function(e,t){if(e==t)return!0;if(!goog.isObject(e)||!goog.isObject(t))return!!("number"==typeof e&&isNaN(e)||"number"==typeof t&&isNaN(t))&&String(e)==String(t);if(e.constructor!=t.constructor)return!1;if(jspb.Message.SUPPORTS_UINT8ARRAY_&&e.constructor===Uint8Array){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}if(e.constructor===Array){var r=void 0,o=void 0,i=Math.max(e.length,t.length);for(n=0;n<i;n++){var a=e[n],s=t[n];if(a&&a.constructor==Object&&(goog.asserts.assert(void 0===r),goog.asserts.assert(n===e.length-1),r=a,a=void 0),s&&s.constructor==Object&&(goog.asserts.assert(void 0===o),goog.asserts.assert(n===t.length-1),o=s,s=void 0),!jspb.Message.compareFields(a,s))return!1}return!r&&!o||(r=r||{},o=o||{},jspb.Message.compareExtensions(r,o))}if(e.constructor===Object)return jspb.Message.compareExtensions(e,t);throw Error("Invalid type in JSPB array")},jspb.Message.prototype.cloneMessage=function(){return jspb.Message.cloneMessage(this)},jspb.Message.prototype.clone=function(){return jspb.Message.cloneMessage(this)},jspb.Message.clone=function(e){return jspb.Message.cloneMessage(e)},jspb.Message.cloneMessage=function(e){return new e.constructor(jspb.Message.clone_(e.toArray()))},jspb.Message.copyInto=function(e,t){goog.asserts.assertInstanceof(e,jspb.Message),goog.asserts.assertInstanceof(t,jspb.Message),goog.asserts.assert(e.constructor==t.constructor,"Copy source and target message should have the same type."),e=jspb.Message.clone(e);for(var n=t.toArray(),r=e.toArray(),o=n.length=0;o<r.length;o++)n[o]=r[o];t.wrappers_=e.wrappers_,t.extensionObject_=e.extensionObject_},jspb.Message.clone_=function(e){if(Array.isArray(e)){for(var t=Array(e.length),n=0;n<e.length;n++){var r=e[n];null!=r&&(t[n]="object"==typeof r?jspb.Message.clone_(goog.asserts.assert(r)):r)}return t}if(jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array)return new Uint8Array(e);for(n in t={},e)null!=(r=e[n])&&(t[n]="object"==typeof r?jspb.Message.clone_(goog.asserts.assert(r)):r);return t},jspb.Message.registerMessageType=function(e,t){t.messageId=e},jspb.Message.messageSetExtensions={},jspb.Message.messageSetExtensionsBinary={},jspb.Export={},exports.Map=jspb.Map,exports.Message=jspb.Message,exports.BinaryReader=jspb.BinaryReader,exports.BinaryWriter=jspb.BinaryWriter,exports.ExtensionFieldInfo=jspb.ExtensionFieldInfo,exports.ExtensionFieldBinaryInfo=jspb.ExtensionFieldBinaryInfo,exports.exportSymbol=goog.exportSymbol,exports.inherits=goog.inherits,exports.object={extend:goog.object.extend},exports.typeOf=goog.typeOf},function(e,t,n){"use strict";const r=n(60).fromPromise,{makeDir:o,makeDirSync:i}=n(1234),a=r(o);e.exports={mkdirs:a,mkdirsSync:i,mkdirp:a,mkdirpSync:i,ensureDir:a,ensureDirSync:i}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAsyncIterable=t.isAsyncGenerator=t.isAsync=void 0;var r,o=n(1295),i=(r=o)&&r.__esModule?r:{default:r};function a(e){return"AsyncFunction"===e[Symbol.toStringTag]}t.default=function(e){if("function"!=typeof e)throw new Error("expected a function");return a(e)?(0,i.default)(e):e},t.isAsync=a,t.isAsyncGenerator=function(e){return"AsyncGenerator"===e[Symbol.toStringTag]},t.isAsyncIterable=function(e){return"function"==typeof e[Symbol.asyncIterator]}},function(e){e.exports=JSON.parse('{"name":"@abtnode/webapp","version":"1.7.22","homepage":".","publishConfig":{"access":"public","directory":".blocklet/bundle/"},"files":["build","blocklet.js","README.md"],"keywords":["arcblock","forge","react"],"author":"wangshijun <shijun@arcblock.io> https://github.com/wangshijun","repository":{"type":"git","url":"https://github.com/ArcBlock/blocklet-server/tree/master/core/webapp"},"bugs":{"url":"https://github.com/ArcBlock/blocklet-server/issues","email":"shijun@arcblock.io"},"dependencies":{"@abtnode/auth":"1.7.22","@abtnode/certificate-manager":"1.7.22","@abtnode/constant":"1.7.22","@abtnode/logger":"1.7.22","@abtnode/mocks":"1.7.22","@abtnode/router-adapter":"1.7.22","@abtnode/router-templates":"1.7.22","@abtnode/schema":"1.7.22","@abtnode/util":"1.7.22","@arcblock/did":"^1.16.15","@arcblock/did-auth":"^1.16.15","@arcblock/did-auth-storage-nedb":"^1.6.3","@arcblock/did-connect":"^2.1.14","@arcblock/did-motif":"^1.1.9","@arcblock/did-util":"^1.16.15","@arcblock/graphql-playground":"^2.1.14","@arcblock/license":"^2.1.14","@arcblock/vc":"^1.16.15","@arcblock/ws":"^1.16.15","@blocklet/meta":"1.7.22","@blocklet/sdk":"1.7.22","@graphql-tools/schema":"^7.1.0","@material-table/core":"^0.2.33","@ocap/client":"^1.16.15","@ocap/mcrypto":"^1.16.15","@ocap/util":"^1.16.15","@ocap/wallet":"^1.16.15","@uiw/react-markdown-preview":"^4.0.6","axios":"^0.27.2","body-parser":"^1.19.0","chalk":"^2.4.2","compression":"^1.7.4","cookie-parser":"^1.4.4","core-js":"2.5.7","cors":"^2.8.5","debug":"^4.3.3","dotenv-flow":"^3.2.0","express":"^4.17.1","express-async-errors":"^3.1.1","express-bearer-token":"^2.4.0","express-graphql":"0.9.0","express-history-api-fallback":"^2.2.1","file-saver":"^2.0.5","filesize":"^6.1.0","flat":"^5.0.0","fs-extra":"^10.0.1","github-markdown-css":"^4.0.0","graphql":"14.6.0","graphql-upload":"11.0.0","history":"^5.0.0","http-proxy":"^1.18.1","http-proxy-middleware":"^0.19.1","humanize-url":"^2.1.0","is-ip":"^3.1.0","is-url":"^1.2.4","js-yaml":"^4.1.0","json-schema-defaults":"^0.4.0","jsonwebtoken":"^8.5.1","jszip":"^3.7.1","lodash":"^4.17.21","lru-cache":"^6.0.0","md5":"^2.3.0","moment":"^2.29.1","morgan":"^1.9.1","multibase":"^4.0.6","notistack":"2.0.5","pretty-ms-i18n":"^1.0.3","prop-types":"^15.7.2","react":"^18.1.0","react-dom":"^18.1.0","react-dropzone":"^11.0.2","react-error-boundary":"^2.3.1","react-hook-form":"^6.11.5","react-image-gallery":"^1.0.8","react-router-dom":"^5.1.2","react-scripts":"^3.4.3","react-use":"^17.3.2","read-last-lines":"^1.8.0","semver":"^7.3.2","styled-components":"^5.0.1","tail":"^2.0.4","tar":"^6.1.0","timeago.js":"^4.0.2","tweetnacl":"^1.0.3","url-join":"^4.0.1"},"scripts":{"lint":"eslint src api","lint:fix":"eslint src api --fix","prepublishOnly":"npm run build","clean":"rm -rf build blocklet.js","deep-clean":"PM2_HOME=~/.arcblock/abtnode-dev pm2 kill && ps aux | grep nginx | grep master | awk \'{print $2}\' | xargs kill","start":"npm-run-all --parallel start:*","start:hub":"NODE_ENV=development node dev/hub.js","start:updater":"NODE_ENV=development node dev/updater.js","start:daemon":"NODE_ENV=development node dev/watcher/daemon.js","start:service":"NODE_ENV=development node dev/watcher/service.js","start:client":"NODE_ENV=development react-app-rewired start","start-e2e":"npm-run-all --parallel start-e2e:*","start-e2e:hub":"NODE_ENV=e2e node dev/hub.js","start-e2e:updater":"NODE_ENV=e2e node dev/updater.js","start-e2e:daemon":"NODE_ENV=e2e nyc --silent node dev/daemon.js","start-e2e:service":"NODE_ENV=e2e nyc --silent node dev/service.js","start-e2e:static":"node tools/test-blocklets-server.js","start-e2e:client":"BROWSER=none REACT_APP_ENV=e2e NODE_ENV=development react-app-rewired start","reset:blocklets":"NODE_ENV=development node tools/remove-blocklets.js","build":"npm run clean && npm run build:client && npm run build:daemon","build:client":"NODE_ENV=production CI=1 react-app-rewired build","build:daemon":"NODE_ENV=production NEDB_MULTI_PORT=40404 ABT_NODE_UPDATER_PORT=40405 ABT_NODE_SERVICE_PORT=40406 node ../../blocklet/cli/bin/blocklet.js bundle -w api/webpack.blocklet.js","build-daemon-debug":"NODE_ENV=development NEDB_MULTI_PORT=40404 ABT_NODE_UPDATER_PORT=40405 ABT_NODE_SERVICE_PORT=40406 TEST_BUILD=1 node ../cli/bin/blocklet.js bundle -w api/webpack.blocklet.js","prepare:e2e":"rm -rf /tmp/abtnode/e2e .nyc_output .cypress && node tools/prepare-e2e.js && cd ../ux && npm run build && cd ../blocklet-services && npm run build && cd ../../core/webapp","test:api":"jest","test:src":"react-app-rewired test","test:e2e":"npm run prepare:e2e && start-server-and-test start-e2e 3000 cypress-e2e","coverage":"rm -rf coverage* && npm-run-all coverage:*","coverage:api":"API=1 jest --coverage","coverage:src":"CI=1 react-app-rewired test --coverage","coverage:e2e":"npm run prepare:e2e && start-server-and-test start-e2e 3000 cypress-ci","cypress-e2e":"cypress open","cypress-install":"cypress install","cypress-ci":"cypress run --headed --browser chrome --record false && nyc report --reporter=text","merge:coverage":"./tools/merge-coverage.sh","analyze:daemon":"NODE_ENV=production ANALYZE_BUNDLE=1 node ../cli/bin/blocklet.js bundle -w api/webpack.blocklet.js","analyze:client":"npm run build:client && source-map-explorer \'build/static/js/*.js\'","dev:migration":"node tools/dev-migration"},"resolutions":{"graphql":"14.6.0"},"browserslist":{"production":[">0.2%","not dead","not op_mini all"],"development":["last 1 chrome version","last 1 firefox version","last 1 safari version"]},"devDependencies":{"@abtnode/client":"1.7.22","@abtnode/router-provider":"1.7.22","@abtnode/ux":"1.7.22","@arcblock/did-motif":"^1.1.9","@arcblock/event-hub":"1.16.15","@arcblock/icons":"^2.1.14","@arcblock/jwt":"1.16.15","@arcblock/ux":"^2.1.14","@blocklet/launcher-layout":"^1.7.14","@blocklet/list":"^0.8.28","@cypress/code-coverage":"^3.9.12","@emotion/react":"^11.9.0","@emotion/styled":"^11.8.1","@mui/icons-material":"^5.6.2","@mui/lab":"^5.0.0-alpha.81","@mui/material":"^5.6.4","@mui/styles":"^5.6.2","async-exit-hook":"^2.0.1","babel-plugin-istanbul":"^6.0.0","classnames":"^2.3.1","cypress":"^9.5.1","cypress-fail-fast":"^3.4.1","cypress-file-upload":"^5.0.8","cypress-localstorage-commands":"^1.7.0","cypress-react-selector":"^2.3.16","cypress-wait-until":"^1.7.2","jest":"^27.4.5","json-stable-stringify":"^1.0.1","mutationobserver-shim":"^0.3.7","node-cleanup":"^2.1.2","nodemon":"^1.19.1","npm-run-all":"^4.1.5","nyc":"^15.1.0","react-app-rewired":"^2.1.6","source-map-explorer":"^2.4.2","start-server-and-test":"^1.11.7","supertest":"^6.1.3","webpack-bundle-analyzer":"^4.1.0"},"nyc":{"all":false,"report-dir":"coverage-e2e","include":["src/**/*.js","api/**/*.js"],"exclude":["**/*.spec.js","**/*.test.js","api/webpack.blocklet.js"]},"license":"Apache-2.0","gitHead":"6190972e62b5e6b1039aa71a291b3e2c521df367"}')},function(e,t,n){"use strict";n.r(t),n.d(t,"parse",(function(){return d})),n.d(t,"parseValue",(function(){return f})),n.d(t,"parseType",(function(){return h}));var r=n(2),o=n(6),i=n(54),a=n(55),s=n(1),l=n(157),u=n(180),p=n(7),c=n(5);function d(e,t){return new g(e,t).parseDocument()}function f(e,t){var n=new g(e,t);n.expectToken(c.a.SOF);var r=n.parseValueLiteral(!1);return n.expectToken(c.a.EOF),r}function h(e,t){var n=new g(e,t);n.expectToken(c.a.SOF);var r=n.parseTypeReference();return n.expectToken(c.a.EOF),r}var g=function(){function e(e,t){var n="string"==typeof e?new l.a(e):e;n instanceof l.a||Object(o.a)(0,"Must provide Source. Received: ".concat(Object(r.a)(n))),this._lexer=Object(u.a)(n),this._options=t||{}}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(c.a.NAME);return{kind:s.a.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:s.a.DOCUMENT,definitions:this.many(c.a.SOF,this.parseDefinition,c.a.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(c.a.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(c.a.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(c.a.BRACE_L))return{kind:s.a.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,n=this.parseOperationType();return this.peek(c.a.NAME)&&(t=this.parseName()),{kind:s.a.OPERATION_DEFINITION,operation:n,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseOperationType=function(){var e=this.expectToken(c.a.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(c.a.PAREN_L,this.parseVariableDefinition,c.a.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:s.a.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(c.a.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(c.a.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(c.a.DOLLAR),{kind:s.a.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:s.a.SELECTION_SET,selections:this.many(c.a.BRACE_L,this.parseSelection,c.a.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(c.a.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,n=this._lexer.token,r=this.parseName();return this.expectOptionalToken(c.a.COLON)?(e=r,t=this.parseName()):t=r,{kind:s.a.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(c.a.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(c.a.PAREN_L,t,c.a.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(c.a.COLON),{kind:s.a.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:s.a.ARGUMENT,name:this.parseName(),value:(this.expectToken(c.a.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(c.a.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(c.a.NAME)?{kind:s.a.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:s.a.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e=this._lexer.token;return this.expectKeyword("fragment"),this._options.experimentalFragmentVariables?{kind:s.a.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}:{kind:s.a.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case c.a.BRACKET_L:return this.parseList(e);case c.a.BRACE_L:return this.parseObject(e);case c.a.INT:return this._lexer.advance(),{kind:s.a.INT,value:t.value,loc:this.loc(t)};case c.a.FLOAT:return this._lexer.advance(),{kind:s.a.FLOAT,value:t.value,loc:this.loc(t)};case c.a.STRING:case c.a.BLOCK_STRING:return this.parseStringLiteral();case c.a.NAME:return"true"===t.value||"false"===t.value?(this._lexer.advance(),{kind:s.a.BOOLEAN,value:"true"===t.value,loc:this.loc(t)}):"null"===t.value?(this._lexer.advance(),{kind:s.a.NULL,loc:this.loc(t)}):(this._lexer.advance(),{kind:s.a.ENUM,value:t.value,loc:this.loc(t)});case c.a.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:s.a.STRING,value:e.value,block:e.kind===c.a.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,n=this._lexer.token;return{kind:s.a.LIST,values:this.any(c.a.BRACKET_L,(function(){return t.parseValueLiteral(e)}),c.a.BRACKET_R),loc:this.loc(n)}},t.parseObject=function(e){var t=this,n=this._lexer.token;return{kind:s.a.OBJECT,fields:this.any(c.a.BRACE_L,(function(){return t.parseObjectField(e)}),c.a.BRACE_R),loc:this.loc(n)}},t.parseObjectField=function(e){var t=this._lexer.token,n=this.parseName();return this.expectToken(c.a.COLON),{kind:s.a.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(c.a.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(c.a.AT),{kind:s.a.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return this.expectOptionalToken(c.a.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(c.a.BRACKET_R),e={kind:s.a.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(c.a.BANG)?{kind:s.a.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:s.a.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===c.a.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(c.a.STRING)||this.peek(c.a.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token;this.expectKeyword("schema");var t=this.parseDirectives(!0),n=this.many(c.a.BRACE_L,this.parseOperationTypeDefinition,c.a.BRACE_R);return{kind:s.a.SCHEMA_DEFINITION,directives:t,operationTypes:n,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(c.a.COLON);var n=this.parseNamedType();return{kind:s.a.OPERATION_TYPE_DEFINITION,operation:t,type:n,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var n=this.parseName(),r=this.parseDirectives(!0);return{kind:s.a.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var n=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),i=this.parseFieldsDefinition();return{kind:s.a.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:o,fields:i,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e=[];if(this.expectOptionalKeyword("implements")){this.expectOptionalToken(c.a.AMP);do{e.push(this.parseNamedType())}while(this.expectOptionalToken(c.a.AMP)||this._options.allowLegacySDLImplementsInterfaces&&this.peek(c.a.NAME))}return e},t.parseFieldsDefinition=function(){return this._options.allowLegacySDLEmptyFields&&this.peek(c.a.BRACE_L)&&this._lexer.lookahead().kind===c.a.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(c.a.BRACE_L,this.parseFieldDefinition,c.a.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(c.a.COLON);var o=this.parseTypeReference(),i=this.parseDirectives(!0);return{kind:s.a.FIELD_DEFINITION,description:t,name:n,arguments:r,type:o,directives:i,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(c.a.PAREN_L,this.parseInputValueDef,c.a.PAREN_R)},t.parseInputValueDef=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(c.a.COLON);var r,o=this.parseTypeReference();this.expectOptionalToken(c.a.EQUALS)&&(r=this.parseValueLiteral(!0));var i=this.parseDirectives(!0);return{kind:s.a.INPUT_VALUE_DEFINITION,description:t,name:n,type:o,defaultValue:r,directives:i,loc:this.loc(e)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var n=this.parseName(),r=this.parseDirectives(!0),o=this.parseFieldsDefinition();return{kind:s.a.INTERFACE_TYPE_DEFINITION,description:t,name:n,directives:r,fields:o,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var n=this.parseName(),r=this.parseDirectives(!0),o=this.parseUnionMemberTypes();return{kind:s.a.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:o,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){var e=[];if(this.expectOptionalToken(c.a.EQUALS)){this.expectOptionalToken(c.a.PIPE);do{e.push(this.parseNamedType())}while(this.expectOptionalToken(c.a.PIPE))}return e},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var n=this.parseName(),r=this.parseDirectives(!0),o=this.parseEnumValuesDefinition();return{kind:s.a.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:o,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(c.a.BRACE_L,this.parseEnumValueDefinition,c.a.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseDirectives(!0);return{kind:s.a.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var n=this.parseName(),r=this.parseDirectives(!0),o=this.parseInputFieldsDefinition();return{kind:s.a.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:o,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(c.a.BRACE_L,this.parseInputValueDef,c.a.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===c.a.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),n=this.optionalMany(c.a.BRACE_L,this.parseOperationTypeDefinition,c.a.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return{kind:s.a.SCHEMA_EXTENSION,directives:t,operationTypes:n,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),n=this.parseDirectives(!0);if(0===n.length)throw this.unexpected();return{kind:s.a.SCALAR_TYPE_EXTENSION,name:t,directives:n,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),o=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===o.length)throw this.unexpected();return{kind:s.a.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:o,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:s.a.INTERFACE_TYPE_EXTENSION,name:t,directives:n,fields:r,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:s.a.UNION_TYPE_EXTENSION,name:t,directives:n,types:r,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:s.a.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:s.a.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(c.a.AT);var n=this.parseName(),r=this.parseArgumentDefs(),o=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var i=this.parseDirectiveLocations();return{kind:s.a.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:o,locations:i,loc:this.loc(e)}},t.parseDirectiveLocations=function(){this.expectOptionalToken(c.a.PIPE);var e=[];do{e.push(this.parseDirectiveLocation())}while(this.expectOptionalToken(c.a.PIPE));return e},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==p.a[t.value])return t;throw this.unexpected(e)},t.loc=function(e){if(!this._options.noLocation)return new m(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw Object(a.a)(this._lexer.source,t.start,"Expected ".concat(e,", found ").concat(y(t)))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind!==c.a.NAME||t.value!==e)throw Object(a.a)(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(y(t)));this._lexer.advance()},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===c.a.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=e||this._lexer.token;return Object(a.a)(this._lexer.source,t.start,"Unexpected ".concat(y(t)))},t.any=function(e,t,n){this.expectToken(e);for(var r=[];!this.expectOptionalToken(n);)r.push(t.call(this));return r},t.optionalMany=function(e,t,n){if(this.expectOptionalToken(e)){var r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}return[]},t.many=function(e,t,n){this.expectToken(e);var r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r},e}();function m(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}function y(e){var t=e.value;return t?"".concat(e.kind,' "').concat(t,'"'):e.kind}Object(i.a)(m,(function(){return{start:this.start,end:this.end}}))},function(e,t){e.exports=require("os")},function(module,exports,__webpack_require__){
|
|
20
|
+
var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function a(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function s(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function l(e,t){return function(n,r){t(n,r,e)}}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function p(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))}function c(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var d=Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function f(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||d(t,e,n)}function h(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function m(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}function y(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r}function v(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function b(e){return this instanceof b?(this.v=e,this):new b(e)}function _(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||s(e,t)}))})}function s(e,t){try{(n=o[e](t)).value instanceof b?Promise.resolve(n.value.v).then(l,u):p(i[0][2],n)}catch(e){p(i[0][3],e)}var n}function l(e){s("next",e)}function u(e){s("throw",e)}function p(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}function T(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:b(e[r](t)),done:"return"===r}:o?o(t):t}:o}}function E(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=h(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}function S(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var x=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function w(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&d(t,e,n);return x(t,e),t}function A(e){return e&&e.__esModule?e:{default:e}}function k(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function M(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}},function(e,t,n){"use strict";n.d(t,"g",(function(){return E})),n.d(t,"a",(function(){return x})),n.d(t,"b",(function(){return w})),n.d(t,"d",(function(){return k})),n.d(t,"c",(function(){return I})),n.d(t,"i",(function(){return R})),n.d(t,"f",(function(){return V})),n.d(t,"e",(function(){return Y})),n.d(t,"h",(function(){return z}));var r=n(52),o=n(2);var i=n(19),a=n(6),s=n(51),l=n(243),u=n(39),p=n(23);var c=n(32),d=n(3),f=n(247),h=n(1),g=n(154),m=n(13),y=n(15),v=n(0),b=n(33),_=n(246),T=n(127);function E(e,t,n,r,o,i,a,s){return S(1===arguments.length?e:{schema:e,document:t,rootValue:n,contextValue:r,variableValues:o,operationName:i,fieldResolver:a,typeResolver:s})}function S(e){var t=e.schema,n=e.document,r=e.rootValue,o=e.contextValue,i=e.variableValues,a=e.operationName,s=e.fieldResolver,l=e.typeResolver;x(t,n,i);var p=w(t,n,r,o,i,a,s,l);if(Array.isArray(p))return{errors:p};var d=function(e,t,n){var r=Object(_.a)(e.schema,t),o=k(e,r,t.selectionSet,Object.create(null),Object.create(null));try{var i="mutation"===t.operation?function(e,t,n,r,o){return i=Object.keys(o),a=function(i,a){var s=o[a],l=Object(c.a)(r,a),p=D(e,t,n,s,l);return void 0===p?i:Object(u.a)(p)?p.then((function(e){return i[a]=e,i})):(i[a]=p,i)},s=Object.create(null),i.reduce((function(e,t){return Object(u.a)(e)?e.then((function(e){return a(e,t)})):a(e,t)}),s);var i,a,s}(e,r,n,void 0,o):A(e,r,n,void 0,o);return Object(u.a)(i)?i.then(void 0,(function(t){return e.errors.push(t),Promise.resolve(null)})):i}catch(t){return e.errors.push(t),null}}(p,p.operation,r);return function e(t,n){if(Object(u.a)(n))return n.then((function(n){return e(t,n)}));return 0===t.errors.length?{data:n}:{errors:t.errors,data:n}}(p,d)}function x(e,t,n){t||Object(a.a)(0,"Must provide document"),Object(g.a)(e),null==n||Object(p.a)(n)||Object(a.a)(0,"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.")}function w(e,t,n,r,o,i,a,s){for(var l,u=!1,p=Object.create(null),c=0,f=t.definitions;c<f.length;c++){var g=f[c];switch(g.kind){case h.a.OPERATION_DEFINITION:!i&&l?u=!0:(!i||g.name&&g.name.value===i)&&(l=g);break;case h.a.FRAGMENT_DEFINITION:p[g.name.value]=g}}if(!l)return i?[new d.a('Unknown operation named "'.concat(i,'".'))]:[new d.a("Must provide an operation.")];if(u)return[new d.a("Must provide operation name if query contains multiple operations.")];var m=Object(T.c)(e,l.variableDefinitions||[],o||{},{maxErrors:50});return m.errors?m.errors:{schema:e,fragments:p,rootValue:n,contextValue:r,operation:l,variableValues:m.coerced,fieldResolver:a||Y,typeResolver:s||V,errors:[]}}function A(e,t,n,r,o){for(var i=Object.create(null),a=!1,s=0,l=Object.keys(o);s<l.length;s++){var p=l[s],d=D(e,t,n,o[p],Object(c.a)(r,p));void 0!==d&&(i[p]=d,!a&&Object(u.a)(d)&&(a=!0))}return a?function(e){var t=Object.keys(e),n=t.map((function(t){return e[t]}));return Promise.all(n).then((function(e){return e.reduce((function(e,n,r){return e[t[r]]=n,e}),Object.create(null))}))}(i):i}function k(e,t,n,r,o){for(var i=0,a=n.selections;i<a.length;i++){var s=a[i];switch(s.kind){case h.a.FIELD:if(!M(e,s))continue;var l=(c=s).alias?c.alias.value:c.name.value;r[l]||(r[l]=[]),r[l].push(s);break;case h.a.INLINE_FRAGMENT:if(!M(e,s)||!O(e,s,t))continue;k(e,t,s.selectionSet,r,o);break;case h.a.FRAGMENT_SPREAD:var u=s.name.value;if(o[u]||!M(e,s))continue;o[u]=!0;var p=e.fragments[u];if(!p||!O(e,p,t))continue;k(e,t,p.selectionSet,r,o)}}var c;return r}function M(e,t){var n=Object(T.b)(y.e,t,e.variableValues);if(n&&!0===n.if)return!1;var r=Object(T.b)(y.d,t,e.variableValues);return!r||!1!==r.if}function O(e,t,n){var r=t.typeCondition;if(!r)return!0;var o=Object(b.a)(e.schema,r);return o===n||!!Object(v.C)(o)&&e.schema.isPossibleType(o,n)}function D(e,t,n,r,o){var i=r[0].name.value,a=z(e.schema,t,i);if(a){var s=a.resolve||e.fieldResolver,l=I(e,a,r,t,o),u=R(e,a,r,s,n,l);return C(e,a.type,r,l,o,u)}}function I(e,t,n,r,o){return{fieldName:t.name,fieldNodes:n,returnType:t.type,parentType:r,path:o,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function R(e,t,n,r,o,i){try{var a=r(o,Object(T.a)(t,n[0],e.variableValues),e.contextValue,i);return Object(u.a)(a)?a.then(void 0,N):a}catch(e){return N(e)}}function N(e){return e instanceof Error?e:new Error("Unexpected error value: "+Object(o.a)(e))}function C(e,t,n,r,o,i){try{var a;return a=Object(u.a)(i)?i.then((function(i){return L(e,t,n,r,o,i)})):L(e,t,n,r,o,i),Object(u.a)(a)?a.then(void 0,(function(r){return F(r,n,o,t,e)})):a}catch(r){return F(r,n,o,t,e)}}function F(e,t,n,r,o){var i=Object(f.a)(N(e),t,Object(c.b)(n));if(Object(v.L)(r))throw i;return o.errors.push(i),null}function L(e,t,n,a,p,f){if(f instanceof Error)throw f;if(Object(v.L)(t)){var h=L(e,t.ofType,n,a,p,f);if(null===h)throw new Error("Cannot return null for non-nullable field ".concat(a.parentType.name,".").concat(a.fieldName,"."));return h}return Object(l.a)(f)?null:Object(v.J)(t)?function(e,t,n,o,i,a){if(!Object(r.e)(a))throw new d.a("Expected Iterable, but did not find one for field ".concat(o.parentType.name,".").concat(o.fieldName,"."));var s=t.ofType,l=!1,p=[];return Object(r.b)(a,(function(t,r){var a=Object(c.a)(i,r),d=C(e,s,n,o,a,t);!l&&Object(u.a)(d)&&(l=!0),p.push(d)})),l?Promise.all(p):p}(e,t,n,a,p,f):Object(v.I)(t)?function(e,t){var n=e.serialize(t);if(Object(s.a)(n))throw new Error('Expected a value of type "'.concat(Object(o.a)(e),'" but ')+"received: ".concat(Object(o.a)(t)));return n}(t,f):Object(v.C)(t)?function(e,t,n,r,o,i){var a=t.resolveType||e.typeResolver,s=e.contextValue,l=a(i,s,r,t);if(Object(u.a)(l))return l.then((function(a){return B(e,j(a,e,t,n,r,i),n,r,o,i)}));return B(e,j(l,e,t,n,r,i),n,r,o,i)}(e,t,n,a,p,f):Object(v.N)(t)?B(e,t,n,a,p,f):void Object(i.a)(!1,"Cannot complete value of unexpected output type: "+Object(o.a)(t))}function j(e,t,n,r,i,a){var s="string"==typeof e?t.schema.getType(e):e;if(!Object(v.N)(s))throw new d.a("Abstract type ".concat(n.name," must resolve to an Object type at runtime for field ").concat(i.parentType.name,".").concat(i.fieldName," with ")+"value ".concat(Object(o.a)(a),', received "').concat(Object(o.a)(s),'". ')+"Either the ".concat(n.name,' type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.'),r);if(!t.schema.isPossibleType(n,s))throw new d.a('Runtime Object type "'.concat(s.name,'" is not a possible type for "').concat(n.name,'".'),r);return s}function B(e,t,n,r,o,i){if(t.isTypeOf){var a=t.isTypeOf(i,e.contextValue,r);if(Object(u.a)(a))return a.then((function(r){if(!r)throw P(t,i,n);return H(e,t,n,o,i)}));if(!a)throw P(t,i,n)}return H(e,t,n,o,i)}function P(e,t,n){return new d.a('Expected value of type "'.concat(e.name,'" but got: ').concat(Object(o.a)(t),"."),n)}function H(e,t,n,r,o){return A(e,t,o,r,W(e,t,n))}var U,$,W=(U=function(e,t,n){for(var r=Object.create(null),o=Object.create(null),i=0;i<n.length;i++){var a=n[i];a.selectionSet&&(r=k(e,t,a.selectionSet,r,o))}return r},function(e,t,n){$||($=new WeakMap);var r,o=$.get(e);if(o){if(r=o.get(t)){var i=r.get(n);if(void 0!==i)return i}}else o=new WeakMap,$.set(e,o);r||(r=new WeakMap,o.set(t,r));var a=U(e,t,n);return r.set(n,a),a});var V=function(e,t,n,r){if(Object(p.a)(e)&&"string"==typeof e.__typename)return e.__typename;for(var o=n.schema.getPossibleTypes(r),i=[],a=0;a<o.length;a++){var s=o[a];if(s.isTypeOf){var l=s.isTypeOf(e,t,n);if(Object(u.a)(l))i[a]=l;else if(l)return s}}return i.length?Promise.all(i).then((function(e){for(var t=0;t<e.length;t++)if(e[t])return o[t]})):void 0},Y=function(e,t,n,r){if(Object(p.a)(e)||"function"==typeof e){var o=e[r.fieldName];return"function"==typeof o?e[r.fieldName](t,n,r):o}};function z(e,t,n){return n===m.a.name&&e.getQueryType()===t?m.a:n===m.c.name&&e.getQueryType()===t?m.c:n===m.d.name?m.d:t.getFields()[n]}},function(e,t,n){const r=n(45);e.exports=(e,t,n)=>new r(e,n).compare(new r(t,n))},function(e,t,n){class r{constructor(e,t){if(t=i(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!h(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&g(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();const t=`parseRange:${Object.keys(this.options).join(",")}:${e}`,n=o.get(t);if(n)return n;const r=this.options.loose,i=r?u[p.HYPHENRANGELOOSE]:u[p.HYPHENRANGE];e=e.replace(i,k(this.options.includePrerelease)),s("hyphen replace",e),e=e.replace(u[p.COMPARATORTRIM],c),s("comparator trim",e,u[p.COMPARATORTRIM]),e=(e=(e=e.replace(u[p.TILDETRIM],d)).replace(u[p.CARETTRIM],f)).split(/\s+/).join(" ");const l=r?u[p.COMPARATORLOOSE]:u[p.COMPARATOR],g=e.split(" ").map(e=>y(e,this.options)).join(" ").split(/\s+/).map(e=>A(e,this.options)).filter(this.options.loose?e=>!!e.match(l):()=>!0).map(e=>new a(e,this.options)),m=(g.length,new Map);for(const e of g){if(h(e))return[e];m.set(e.value,e)}m.size>1&&m.has("")&&m.delete("");const v=[...m.values()];return o.set(t,v),v}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(n=>m(n,t)&&e.set.some(e=>m(e,t)&&n.every(n=>e.every(e=>n.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(M(this.set[t],e,this.options))return!0;return!1}}e.exports=r;const o=new(n(136))({max:1e3}),i=n(196),a=n(198),s=n(195),l=n(45),{re:u,t:p,comparatorTrimReplace:c,tildeTrimReplace:d,caretTrimReplace:f}=n(134),h=e=>"<0.0.0-0"===e.value,g=e=>""===e.value,m=(e,t)=>{let n=!0;const r=e.slice();let o=r.pop();for(;n&&r.length;)n=r.every(e=>o.intersects(e,t)),o=r.pop();return n},y=(e,t)=>(s("comp",e,t),e=T(e,t),s("caret",e),e=b(e,t),s("tildes",e),e=S(e,t),s("xrange",e),e=w(e,t),s("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,b=(e,t)=>e.trim().split(/\s+/).map(e=>_(e,t)).join(" "),_=(e,t)=>{const n=t.loose?u[p.TILDELOOSE]:u[p.TILDE];return e.replace(n,(t,n,r,o,i)=>{let a;return s("tilde",e,t,n,r,o,i),v(n)?a="":v(r)?a=`>=${n}.0.0 <${+n+1}.0.0-0`:v(o)?a=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:i?(s("replaceTilde pr",i),a=`>=${n}.${r}.${o}-${i} <${n}.${+r+1}.0-0`):a=`>=${n}.${r}.${o} <${n}.${+r+1}.0-0`,s("tilde return",a),a})},T=(e,t)=>e.trim().split(/\s+/).map(e=>E(e,t)).join(" "),E=(e,t)=>{s("caret",e,t);const n=t.loose?u[p.CARETLOOSE]:u[p.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,(t,n,o,i,a)=>{let l;return s("caret",e,t,n,o,i,a),v(n)?l="":v(o)?l=`>=${n}.0.0${r} <${+n+1}.0.0-0`:v(i)?l="0"===n?`>=${n}.${o}.0${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.0${r} <${+n+1}.0.0-0`:a?(s("replaceCaret pr",a),l="0"===n?"0"===o?`>=${n}.${o}.${i}-${a} <${n}.${o}.${+i+1}-0`:`>=${n}.${o}.${i}-${a} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${i}-${a} <${+n+1}.0.0-0`):(s("no pr"),l="0"===n?"0"===o?`>=${n}.${o}.${i}${r} <${n}.${o}.${+i+1}-0`:`>=${n}.${o}.${i}${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${i} <${+n+1}.0.0-0`),s("caret return",l),l})},S=(e,t)=>(s("replaceXRanges",e,t),e.split(/\s+/).map(e=>x(e,t)).join(" ")),x=(e,t)=>{e=e.trim();const n=t.loose?u[p.XRANGELOOSE]:u[p.XRANGE];return e.replace(n,(n,r,o,i,a,l)=>{s("xRange",e,n,r,o,i,a,l);const u=v(o),p=u||v(i),c=p||v(a),d=c;return"="===r&&d&&(r=""),l=t.includePrerelease?"-0":"",u?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(p&&(i=0),a=0,">"===r?(r=">=",p?(o=+o+1,i=0,a=0):(i=+i+1,a=0)):"<="===r&&(r="<",p?o=+o+1:i=+i+1),"<"===r&&(l="-0"),n=`${r+o}.${i}.${a}${l}`):p?n=`>=${o}.0.0${l} <${+o+1}.0.0-0`:c&&(n=`>=${o}.${i}.0${l} <${o}.${+i+1}.0-0`),s("xRange return",n),n})},w=(e,t)=>(s("replaceStars",e,t),e.trim().replace(u[p.STAR],"")),A=(e,t)=>(s("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?p.GTE0PRE:p.GTE0],"")),k=e=>(t,n,r,o,i,a,s,l,u,p,c,d,f)=>`${n=v(r)?"":v(o)?`>=${r}.0.0${e?"-0":""}`:v(i)?`>=${r}.${o}.0${e?"-0":""}`:a?">="+n:`>=${n}${e?"-0":""}`} ${l=v(u)?"":v(p)?`<${+u+1}.0.0-0`:v(c)?`<${u}.${+p+1}.0-0`:d?`<=${u}.${p}.${c}-${d}`:e?`<${u}.${p}.${+c+1}-0`:"<="+l}`.trim(),M=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(s(e[n].semver),e[n].semver!==a.ANY&&e[n].semver.prerelease.length>0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}},function(e,t){var n=Array.isArray;e.exports=n},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){(function(e){!function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function o(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:n(34).Buffer}catch(e){}function s(e,t){var n=e.charCodeAt(t);return n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function l(e,t,n){var r=s(e,n);return n-1>=t&&(r|=s(e,n-1)<<4),r}function u(e,t,n,r){for(var o=0,i=Math.min(e.length,n),a=t;a<i;a++){var s=e.charCodeAt(a)-48;o*=r,o+=s>=49?s-49+10:s>=17?s-17+10:s}return o}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<e.length&&(16===t?this._parseHex(e,o,n):(this._parseBase(e,t,o),"le"===n&&this._initArray(this.toArray(),t,n)))},i.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},i.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var i,a,s=0;if("be"===n)for(o=e.length-1,i=0;o>=0;o-=3)a=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=a<<s&67108863,this.words[i+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);else if("le"===n)for(o=0,i=0;o<e.length;o+=3)a=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[i]|=a<<s&67108863,this.words[i+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var o,i=0,a=0;if("be"===n)for(r=e.length-1;r>=t;r-=2)o=l(e,t,r)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;else for(r=(e.length-t)%2==0?t+1:t;r<e.length;r+=2)o=l(e,t,r)<<i,this.words[a]|=67108863&o,i>=18?(i-=18,a+=1,this.words[a]|=o>>>26):i+=8;this.strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,o=1;o<=67108863;o*=t)r++;r--,o=o/t|0;for(var i=e.length-n,a=i%r,s=Math.min(i,i-a)+n,l=0,p=n;p<s;p+=r)l=u(e,p,p+r,t),this.imuln(o),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==a){var c=1;for(l=u(e,p,e.length,t),p=0;p<a;p++)c*=t;this.imuln(c),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this.strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var o=0|e.words[0],i=0|t.words[0],a=o*i,s=67108863&a,l=a/67108864|0;n.words[0]=s;for(var u=1;u<r;u++){for(var p=l>>>26,c=67108863&l,d=Math.min(u,t.length-1),f=Math.max(0,u-e.length+1);f<=d;f++){var h=u-f|0;p+=(a=(o=0|e.words[h])*(i=0|t.words[f])+c)/67108864|0,c=67108863&a}n.words[u]=0|c,l=0|p}return 0!==l?n.words[u]=0|l:n.length--,n.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,i=0,a=0;a<this.length;a++){var s=this.words[a],l=(16777215&(s<<o|i)).toString(16);n=0!==(i=s>>>24-o&16777215)||a!==this.length-1?p[6-l.length]+l+n:l+n,(o+=2)>=26&&(o-=26,a--)}for(0!==i&&(n=i.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=c[e],f=d[e];n="";var h=this.clone();for(h.negative=0;!h.isZero();){var g=h.modn(f).toString(e);n=(h=h.idivn(f)).isZero()?g+n:p[u-g.length]+g+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==a),this.toArrayLike(a,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var o=this.byteLength(),i=n||Math.max(1,o);r(o<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var a,s,l="le"===t,u=new e(i),p=this.clone();if(l){for(s=0;!p.isZero();s++)a=p.andln(255),p.iushrn(8),u[s]=a;for(;s<i;s++)u[s]=0}else{for(s=0;s<i-o;s++)u[s]=0;for(s=0;!p.isZero();s++)a=p.andln(255),p.iushrn(8),u[i-s-1]=a}return u},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,26!==n)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},i.prototype.ior=function(e){return r(0==(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this.strip()},i.prototype.iand=function(e){return r(0==(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this.strip()},i.prototype.ixor=function(e){return r(0==(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var o=0;o<t;o++)this.words[o]=67108863&~this.words[o];return n>0&&(this.words[o]=~this.words[o]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<o:this.words[n]&~(1<<o),this.strip()},i.prototype.iadd=function(e){var t,n,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(n=this,r=e):(n=e,r=this);for(var o=0,i=0;i<r.length;i++)t=(0|n.words[i])+(0|r.words[i])+o,this.words[i]=67108863&t,o=t>>>26;for(;0!==o&&i<n.length;i++)t=(0|n.words[i])+o,this.words[i]=67108863&t,o=t>>>26;if(this.length=n.length,0!==o)this.words[this.length]=o,this.length++;else if(n!==this)for(;i<n.length;i++)this.words[i]=n.words[i];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a<r.length;a++)i=(t=(0|n.words[a])-(0|r.words[a])+i)>>26,this.words[a]=67108863&t;for(;0!==i&&a<n.length;a++)i=(t=(0|n.words[a])+i)>>26,this.words[a]=67108863&t;if(0===i&&a<n.length&&n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this.length=Math.max(this.length,a),n!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var h=function(e,t,n){var r,o,i,a=e.words,s=t.words,l=n.words,u=0,p=0|a[0],c=8191&p,d=p>>>13,f=0|a[1],h=8191&f,g=f>>>13,m=0|a[2],y=8191&m,v=m>>>13,b=0|a[3],_=8191&b,T=b>>>13,E=0|a[4],S=8191&E,x=E>>>13,w=0|a[5],A=8191&w,k=w>>>13,M=0|a[6],O=8191&M,D=M>>>13,I=0|a[7],R=8191&I,N=I>>>13,C=0|a[8],F=8191&C,L=C>>>13,j=0|a[9],B=8191&j,P=j>>>13,H=0|s[0],U=8191&H,$=H>>>13,W=0|s[1],V=8191&W,Y=W>>>13,z=0|s[2],G=8191&z,q=z>>>13,K=0|s[3],J=8191&K,X=K>>>13,Q=0|s[4],Z=8191&Q,ee=Q>>>13,te=0|s[5],ne=8191&te,re=te>>>13,oe=0|s[6],ie=8191&oe,ae=oe>>>13,se=0|s[7],le=8191&se,ue=se>>>13,pe=0|s[8],ce=8191&pe,de=pe>>>13,fe=0|s[9],he=8191&fe,ge=fe>>>13;n.negative=e.negative^t.negative,n.length=19;var me=(u+(r=Math.imul(c,U))|0)+((8191&(o=(o=Math.imul(c,$))+Math.imul(d,U)|0))<<13)|0;u=((i=Math.imul(d,$))+(o>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(h,U),o=(o=Math.imul(h,$))+Math.imul(g,U)|0,i=Math.imul(g,$);var ye=(u+(r=r+Math.imul(c,V)|0)|0)+((8191&(o=(o=o+Math.imul(c,Y)|0)+Math.imul(d,V)|0))<<13)|0;u=((i=i+Math.imul(d,Y)|0)+(o>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(y,U),o=(o=Math.imul(y,$))+Math.imul(v,U)|0,i=Math.imul(v,$),r=r+Math.imul(h,V)|0,o=(o=o+Math.imul(h,Y)|0)+Math.imul(g,V)|0,i=i+Math.imul(g,Y)|0;var ve=(u+(r=r+Math.imul(c,G)|0)|0)+((8191&(o=(o=o+Math.imul(c,q)|0)+Math.imul(d,G)|0))<<13)|0;u=((i=i+Math.imul(d,q)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(_,U),o=(o=Math.imul(_,$))+Math.imul(T,U)|0,i=Math.imul(T,$),r=r+Math.imul(y,V)|0,o=(o=o+Math.imul(y,Y)|0)+Math.imul(v,V)|0,i=i+Math.imul(v,Y)|0,r=r+Math.imul(h,G)|0,o=(o=o+Math.imul(h,q)|0)+Math.imul(g,G)|0,i=i+Math.imul(g,q)|0;var be=(u+(r=r+Math.imul(c,J)|0)|0)+((8191&(o=(o=o+Math.imul(c,X)|0)+Math.imul(d,J)|0))<<13)|0;u=((i=i+Math.imul(d,X)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,r=Math.imul(S,U),o=(o=Math.imul(S,$))+Math.imul(x,U)|0,i=Math.imul(x,$),r=r+Math.imul(_,V)|0,o=(o=o+Math.imul(_,Y)|0)+Math.imul(T,V)|0,i=i+Math.imul(T,Y)|0,r=r+Math.imul(y,G)|0,o=(o=o+Math.imul(y,q)|0)+Math.imul(v,G)|0,i=i+Math.imul(v,q)|0,r=r+Math.imul(h,J)|0,o=(o=o+Math.imul(h,X)|0)+Math.imul(g,J)|0,i=i+Math.imul(g,X)|0;var _e=(u+(r=r+Math.imul(c,Z)|0)|0)+((8191&(o=(o=o+Math.imul(c,ee)|0)+Math.imul(d,Z)|0))<<13)|0;u=((i=i+Math.imul(d,ee)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(A,U),o=(o=Math.imul(A,$))+Math.imul(k,U)|0,i=Math.imul(k,$),r=r+Math.imul(S,V)|0,o=(o=o+Math.imul(S,Y)|0)+Math.imul(x,V)|0,i=i+Math.imul(x,Y)|0,r=r+Math.imul(_,G)|0,o=(o=o+Math.imul(_,q)|0)+Math.imul(T,G)|0,i=i+Math.imul(T,q)|0,r=r+Math.imul(y,J)|0,o=(o=o+Math.imul(y,X)|0)+Math.imul(v,J)|0,i=i+Math.imul(v,X)|0,r=r+Math.imul(h,Z)|0,o=(o=o+Math.imul(h,ee)|0)+Math.imul(g,Z)|0,i=i+Math.imul(g,ee)|0;var Te=(u+(r=r+Math.imul(c,ne)|0)|0)+((8191&(o=(o=o+Math.imul(c,re)|0)+Math.imul(d,ne)|0))<<13)|0;u=((i=i+Math.imul(d,re)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(O,U),o=(o=Math.imul(O,$))+Math.imul(D,U)|0,i=Math.imul(D,$),r=r+Math.imul(A,V)|0,o=(o=o+Math.imul(A,Y)|0)+Math.imul(k,V)|0,i=i+Math.imul(k,Y)|0,r=r+Math.imul(S,G)|0,o=(o=o+Math.imul(S,q)|0)+Math.imul(x,G)|0,i=i+Math.imul(x,q)|0,r=r+Math.imul(_,J)|0,o=(o=o+Math.imul(_,X)|0)+Math.imul(T,J)|0,i=i+Math.imul(T,X)|0,r=r+Math.imul(y,Z)|0,o=(o=o+Math.imul(y,ee)|0)+Math.imul(v,Z)|0,i=i+Math.imul(v,ee)|0,r=r+Math.imul(h,ne)|0,o=(o=o+Math.imul(h,re)|0)+Math.imul(g,ne)|0,i=i+Math.imul(g,re)|0;var Ee=(u+(r=r+Math.imul(c,ie)|0)|0)+((8191&(o=(o=o+Math.imul(c,ae)|0)+Math.imul(d,ie)|0))<<13)|0;u=((i=i+Math.imul(d,ae)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(R,U),o=(o=Math.imul(R,$))+Math.imul(N,U)|0,i=Math.imul(N,$),r=r+Math.imul(O,V)|0,o=(o=o+Math.imul(O,Y)|0)+Math.imul(D,V)|0,i=i+Math.imul(D,Y)|0,r=r+Math.imul(A,G)|0,o=(o=o+Math.imul(A,q)|0)+Math.imul(k,G)|0,i=i+Math.imul(k,q)|0,r=r+Math.imul(S,J)|0,o=(o=o+Math.imul(S,X)|0)+Math.imul(x,J)|0,i=i+Math.imul(x,X)|0,r=r+Math.imul(_,Z)|0,o=(o=o+Math.imul(_,ee)|0)+Math.imul(T,Z)|0,i=i+Math.imul(T,ee)|0,r=r+Math.imul(y,ne)|0,o=(o=o+Math.imul(y,re)|0)+Math.imul(v,ne)|0,i=i+Math.imul(v,re)|0,r=r+Math.imul(h,ie)|0,o=(o=o+Math.imul(h,ae)|0)+Math.imul(g,ie)|0,i=i+Math.imul(g,ae)|0;var Se=(u+(r=r+Math.imul(c,le)|0)|0)+((8191&(o=(o=o+Math.imul(c,ue)|0)+Math.imul(d,le)|0))<<13)|0;u=((i=i+Math.imul(d,ue)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(F,U),o=(o=Math.imul(F,$))+Math.imul(L,U)|0,i=Math.imul(L,$),r=r+Math.imul(R,V)|0,o=(o=o+Math.imul(R,Y)|0)+Math.imul(N,V)|0,i=i+Math.imul(N,Y)|0,r=r+Math.imul(O,G)|0,o=(o=o+Math.imul(O,q)|0)+Math.imul(D,G)|0,i=i+Math.imul(D,q)|0,r=r+Math.imul(A,J)|0,o=(o=o+Math.imul(A,X)|0)+Math.imul(k,J)|0,i=i+Math.imul(k,X)|0,r=r+Math.imul(S,Z)|0,o=(o=o+Math.imul(S,ee)|0)+Math.imul(x,Z)|0,i=i+Math.imul(x,ee)|0,r=r+Math.imul(_,ne)|0,o=(o=o+Math.imul(_,re)|0)+Math.imul(T,ne)|0,i=i+Math.imul(T,re)|0,r=r+Math.imul(y,ie)|0,o=(o=o+Math.imul(y,ae)|0)+Math.imul(v,ie)|0,i=i+Math.imul(v,ae)|0,r=r+Math.imul(h,le)|0,o=(o=o+Math.imul(h,ue)|0)+Math.imul(g,le)|0,i=i+Math.imul(g,ue)|0;var xe=(u+(r=r+Math.imul(c,ce)|0)|0)+((8191&(o=(o=o+Math.imul(c,de)|0)+Math.imul(d,ce)|0))<<13)|0;u=((i=i+Math.imul(d,de)|0)+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(B,U),o=(o=Math.imul(B,$))+Math.imul(P,U)|0,i=Math.imul(P,$),r=r+Math.imul(F,V)|0,o=(o=o+Math.imul(F,Y)|0)+Math.imul(L,V)|0,i=i+Math.imul(L,Y)|0,r=r+Math.imul(R,G)|0,o=(o=o+Math.imul(R,q)|0)+Math.imul(N,G)|0,i=i+Math.imul(N,q)|0,r=r+Math.imul(O,J)|0,o=(o=o+Math.imul(O,X)|0)+Math.imul(D,J)|0,i=i+Math.imul(D,X)|0,r=r+Math.imul(A,Z)|0,o=(o=o+Math.imul(A,ee)|0)+Math.imul(k,Z)|0,i=i+Math.imul(k,ee)|0,r=r+Math.imul(S,ne)|0,o=(o=o+Math.imul(S,re)|0)+Math.imul(x,ne)|0,i=i+Math.imul(x,re)|0,r=r+Math.imul(_,ie)|0,o=(o=o+Math.imul(_,ae)|0)+Math.imul(T,ie)|0,i=i+Math.imul(T,ae)|0,r=r+Math.imul(y,le)|0,o=(o=o+Math.imul(y,ue)|0)+Math.imul(v,le)|0,i=i+Math.imul(v,ue)|0,r=r+Math.imul(h,ce)|0,o=(o=o+Math.imul(h,de)|0)+Math.imul(g,ce)|0,i=i+Math.imul(g,de)|0;var we=(u+(r=r+Math.imul(c,he)|0)|0)+((8191&(o=(o=o+Math.imul(c,ge)|0)+Math.imul(d,he)|0))<<13)|0;u=((i=i+Math.imul(d,ge)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(B,V),o=(o=Math.imul(B,Y))+Math.imul(P,V)|0,i=Math.imul(P,Y),r=r+Math.imul(F,G)|0,o=(o=o+Math.imul(F,q)|0)+Math.imul(L,G)|0,i=i+Math.imul(L,q)|0,r=r+Math.imul(R,J)|0,o=(o=o+Math.imul(R,X)|0)+Math.imul(N,J)|0,i=i+Math.imul(N,X)|0,r=r+Math.imul(O,Z)|0,o=(o=o+Math.imul(O,ee)|0)+Math.imul(D,Z)|0,i=i+Math.imul(D,ee)|0,r=r+Math.imul(A,ne)|0,o=(o=o+Math.imul(A,re)|0)+Math.imul(k,ne)|0,i=i+Math.imul(k,re)|0,r=r+Math.imul(S,ie)|0,o=(o=o+Math.imul(S,ae)|0)+Math.imul(x,ie)|0,i=i+Math.imul(x,ae)|0,r=r+Math.imul(_,le)|0,o=(o=o+Math.imul(_,ue)|0)+Math.imul(T,le)|0,i=i+Math.imul(T,ue)|0,r=r+Math.imul(y,ce)|0,o=(o=o+Math.imul(y,de)|0)+Math.imul(v,ce)|0,i=i+Math.imul(v,de)|0;var Ae=(u+(r=r+Math.imul(h,he)|0)|0)+((8191&(o=(o=o+Math.imul(h,ge)|0)+Math.imul(g,he)|0))<<13)|0;u=((i=i+Math.imul(g,ge)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(B,G),o=(o=Math.imul(B,q))+Math.imul(P,G)|0,i=Math.imul(P,q),r=r+Math.imul(F,J)|0,o=(o=o+Math.imul(F,X)|0)+Math.imul(L,J)|0,i=i+Math.imul(L,X)|0,r=r+Math.imul(R,Z)|0,o=(o=o+Math.imul(R,ee)|0)+Math.imul(N,Z)|0,i=i+Math.imul(N,ee)|0,r=r+Math.imul(O,ne)|0,o=(o=o+Math.imul(O,re)|0)+Math.imul(D,ne)|0,i=i+Math.imul(D,re)|0,r=r+Math.imul(A,ie)|0,o=(o=o+Math.imul(A,ae)|0)+Math.imul(k,ie)|0,i=i+Math.imul(k,ae)|0,r=r+Math.imul(S,le)|0,o=(o=o+Math.imul(S,ue)|0)+Math.imul(x,le)|0,i=i+Math.imul(x,ue)|0,r=r+Math.imul(_,ce)|0,o=(o=o+Math.imul(_,de)|0)+Math.imul(T,ce)|0,i=i+Math.imul(T,de)|0;var ke=(u+(r=r+Math.imul(y,he)|0)|0)+((8191&(o=(o=o+Math.imul(y,ge)|0)+Math.imul(v,he)|0))<<13)|0;u=((i=i+Math.imul(v,ge)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(B,J),o=(o=Math.imul(B,X))+Math.imul(P,J)|0,i=Math.imul(P,X),r=r+Math.imul(F,Z)|0,o=(o=o+Math.imul(F,ee)|0)+Math.imul(L,Z)|0,i=i+Math.imul(L,ee)|0,r=r+Math.imul(R,ne)|0,o=(o=o+Math.imul(R,re)|0)+Math.imul(N,ne)|0,i=i+Math.imul(N,re)|0,r=r+Math.imul(O,ie)|0,o=(o=o+Math.imul(O,ae)|0)+Math.imul(D,ie)|0,i=i+Math.imul(D,ae)|0,r=r+Math.imul(A,le)|0,o=(o=o+Math.imul(A,ue)|0)+Math.imul(k,le)|0,i=i+Math.imul(k,ue)|0,r=r+Math.imul(S,ce)|0,o=(o=o+Math.imul(S,de)|0)+Math.imul(x,ce)|0,i=i+Math.imul(x,de)|0;var Me=(u+(r=r+Math.imul(_,he)|0)|0)+((8191&(o=(o=o+Math.imul(_,ge)|0)+Math.imul(T,he)|0))<<13)|0;u=((i=i+Math.imul(T,ge)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(B,Z),o=(o=Math.imul(B,ee))+Math.imul(P,Z)|0,i=Math.imul(P,ee),r=r+Math.imul(F,ne)|0,o=(o=o+Math.imul(F,re)|0)+Math.imul(L,ne)|0,i=i+Math.imul(L,re)|0,r=r+Math.imul(R,ie)|0,o=(o=o+Math.imul(R,ae)|0)+Math.imul(N,ie)|0,i=i+Math.imul(N,ae)|0,r=r+Math.imul(O,le)|0,o=(o=o+Math.imul(O,ue)|0)+Math.imul(D,le)|0,i=i+Math.imul(D,ue)|0,r=r+Math.imul(A,ce)|0,o=(o=o+Math.imul(A,de)|0)+Math.imul(k,ce)|0,i=i+Math.imul(k,de)|0;var Oe=(u+(r=r+Math.imul(S,he)|0)|0)+((8191&(o=(o=o+Math.imul(S,ge)|0)+Math.imul(x,he)|0))<<13)|0;u=((i=i+Math.imul(x,ge)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(B,ne),o=(o=Math.imul(B,re))+Math.imul(P,ne)|0,i=Math.imul(P,re),r=r+Math.imul(F,ie)|0,o=(o=o+Math.imul(F,ae)|0)+Math.imul(L,ie)|0,i=i+Math.imul(L,ae)|0,r=r+Math.imul(R,le)|0,o=(o=o+Math.imul(R,ue)|0)+Math.imul(N,le)|0,i=i+Math.imul(N,ue)|0,r=r+Math.imul(O,ce)|0,o=(o=o+Math.imul(O,de)|0)+Math.imul(D,ce)|0,i=i+Math.imul(D,de)|0;var De=(u+(r=r+Math.imul(A,he)|0)|0)+((8191&(o=(o=o+Math.imul(A,ge)|0)+Math.imul(k,he)|0))<<13)|0;u=((i=i+Math.imul(k,ge)|0)+(o>>>13)|0)+(De>>>26)|0,De&=67108863,r=Math.imul(B,ie),o=(o=Math.imul(B,ae))+Math.imul(P,ie)|0,i=Math.imul(P,ae),r=r+Math.imul(F,le)|0,o=(o=o+Math.imul(F,ue)|0)+Math.imul(L,le)|0,i=i+Math.imul(L,ue)|0,r=r+Math.imul(R,ce)|0,o=(o=o+Math.imul(R,de)|0)+Math.imul(N,ce)|0,i=i+Math.imul(N,de)|0;var Ie=(u+(r=r+Math.imul(O,he)|0)|0)+((8191&(o=(o=o+Math.imul(O,ge)|0)+Math.imul(D,he)|0))<<13)|0;u=((i=i+Math.imul(D,ge)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(B,le),o=(o=Math.imul(B,ue))+Math.imul(P,le)|0,i=Math.imul(P,ue),r=r+Math.imul(F,ce)|0,o=(o=o+Math.imul(F,de)|0)+Math.imul(L,ce)|0,i=i+Math.imul(L,de)|0;var Re=(u+(r=r+Math.imul(R,he)|0)|0)+((8191&(o=(o=o+Math.imul(R,ge)|0)+Math.imul(N,he)|0))<<13)|0;u=((i=i+Math.imul(N,ge)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(B,ce),o=(o=Math.imul(B,de))+Math.imul(P,ce)|0,i=Math.imul(P,de);var Ne=(u+(r=r+Math.imul(F,he)|0)|0)+((8191&(o=(o=o+Math.imul(F,ge)|0)+Math.imul(L,he)|0))<<13)|0;u=((i=i+Math.imul(L,ge)|0)+(o>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Ce=(u+(r=Math.imul(B,he))|0)+((8191&(o=(o=Math.imul(B,ge))+Math.imul(P,he)|0))<<13)|0;return u=((i=Math.imul(P,ge))+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,l[0]=me,l[1]=ye,l[2]=ve,l[3]=be,l[4]=_e,l[5]=Te,l[6]=Ee,l[7]=Se,l[8]=xe,l[9]=we,l[10]=Ae,l[11]=ke,l[12]=Me,l[13]=Oe,l[14]=De,l[15]=Ie,l[16]=Re,l[17]=Ne,l[18]=Ce,0!==u&&(l[19]=u,n.length++),n};function g(e,t,n){return(new m).mulp(e,t,n)}function m(e,t){this.x=e,this.y=t}Math.imul||(h=f),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?h(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,o=0,i=0;i<n.length-1;i++){var a=o;o=0;for(var s=67108863&r,l=Math.min(i,t.length-1),u=Math.max(0,i-e.length+1);u<=l;u++){var p=i-u,c=(0|e.words[p])*(0|t.words[u]),d=67108863&c;s=67108863&(d=d+s|0),o+=(a=(a=a+(c/67108864|0)|0)+(d>>>26)|0)>>>26,a&=67108863}n.words[i]=s,r=a,a=o}return 0!==r?n.words[i]=r:n.length--,n.strip()}(this,e,t):g(this,e,t)},m.prototype.makeRBT=function(e){for(var t=new Array(e),n=i.prototype._countBits(e)-1,r=0;r<e;r++)t[r]=this.revBin(r,n,e);return t},m.prototype.revBin=function(e,t,n){if(0===e||e===n-1)return e;for(var r=0,o=0;o<t;o++)r|=(1&e)<<t-o-1,e>>=1;return r},m.prototype.permute=function(e,t,n,r,o,i){for(var a=0;a<i;a++)r[a]=t[e[a]],o[a]=n[e[a]]},m.prototype.transform=function(e,t,n,r,o,i){this.permute(i,e,t,n,r,o);for(var a=1;a<o;a<<=1)for(var s=a<<1,l=Math.cos(2*Math.PI/s),u=Math.sin(2*Math.PI/s),p=0;p<o;p+=s)for(var c=l,d=u,f=0;f<a;f++){var h=n[p+f],g=r[p+f],m=n[p+f+a],y=r[p+f+a],v=c*m-d*y;y=c*y+d*m,m=v,n[p+f]=h+m,r[p+f]=g+y,n[p+f+a]=h-m,r[p+f+a]=g-y,f!==s&&(v=l*c-u*d,d=l*d+u*c,c=v)}},m.prototype.guessLen13b=function(e,t){var n=1|Math.max(t,e),r=1&n,o=0;for(n=n/2|0;n;n>>>=1)o++;return 1<<o+1+r},m.prototype.conjugate=function(e,t,n){if(!(n<=1))for(var r=0;r<n/2;r++){var o=e[r];e[r]=e[n-r-1],e[n-r-1]=o,o=t[r],t[r]=-t[n-r-1],t[n-r-1]=-o}},m.prototype.normalize13b=function(e,t){for(var n=0,r=0;r<t/2;r++){var o=8192*Math.round(e[2*r+1]/t)+Math.round(e[2*r]/t)+n;e[r]=67108863&o,n=o<67108864?0:o/67108864|0}return e},m.prototype.convert13b=function(e,t,n,o){for(var i=0,a=0;a<t;a++)i+=0|e[a],n[2*a]=8191&i,i>>>=13,n[2*a+1]=8191&i,i>>>=13;for(a=2*t;a<o;++a)n[a]=0;r(0===i),r(0==(-8192&i))},m.prototype.stub=function(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=0;return t},m.prototype.mulp=function(e,t,n){var r=2*this.guessLen13b(e.length,t.length),o=this.makeRBT(r),i=this.stub(r),a=new Array(r),s=new Array(r),l=new Array(r),u=new Array(r),p=new Array(r),c=new Array(r),d=n.words;d.length=r,this.convert13b(e.words,e.length,a,r),this.convert13b(t.words,t.length,u,r),this.transform(a,i,s,l,r,o),this.transform(u,i,p,c,r,o);for(var f=0;f<r;f++){var h=s[f]*p[f]-l[f]*c[f];l[f]=s[f]*c[f]+l[f]*p[f],s[f]=h}return this.conjugate(s,l,r),this.transform(s,l,d,i,r,o),this.conjugate(d,i,r),this.normalize13b(d,r),n.negative=e.negative^t.negative,n.length=e.length+t.length,n.strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),g(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,n=0;n<this.length;n++){var o=(0|this.words[n])*e,i=(67108863&o)+(67108863&t);t>>=26,t+=o/67108864|0,t+=i>>>26,this.words[n]=67108863&i}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n<t.length;n++){var r=n/26|0,o=n%26;t[n]=(e.words[r]&1<<o)>>>o}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r<t.length&&0===t[r];r++,n=n.sqr());if(++r<t.length)for(var o=n.sqr();r<t.length;r++,o=o.sqr())0!==t[r]&&(n=n.mul(o));return n},i.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,n=e%26,o=(e-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&i,l=(0|this.words[t])-s<<n;this.words[t]=l|a,a=s>>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t<o;t++)this.words[t]=0;this.length+=o}return this.strip()},i.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,n){var o;r("number"==typeof e&&e>=0),o=t?(t-t%26)/26:0;var i=e%26,a=Math.min((e-i)/26,this.length),s=67108863^67108863>>>i<<i,l=n;if(o-=a,o=Math.max(0,o),l){for(var u=0;u<a;u++)l.words[u]=this.words[u];l.length=a}if(0===a);else if(this.length>a)for(this.length-=a,u=0;u<this.length;u++)this.words[u]=this.words[u+a];else this.words[0]=0,this.length=1;var p=0;for(u=this.length-1;u>=0&&(0!==p||u>=o);u--){var c=0|this.words[u];this.words[u]=p<<26-i|c>>>i,p=c&s}return l&&0!==p&&(l.words[l.length++]=p),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,o=1<<t;return!(this.length<=n)&&!!(this.words[n]&o)},i.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var o=67108863^67108863>>>t<<t;this.words[this.length-1]&=o}return this.strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,n){var o,i,a=e.length+n;this._expand(a);var s=0;for(o=0;o<e.length;o++){i=(0|this.words[o+n])+s;var l=(0|e.words[o])*t;s=((i-=67108863&l)>>26)-(l/67108864|0),this.words[o+n]=67108863&i}for(;o<this.length-n;o++)s=(i=(0|this.words[o+n])+s)>>26,this.words[o+n]=67108863&i;if(0===s)return this.strip();for(r(-1===s),s=0,o=0;o<this.length;o++)s=(i=-(0|this.words[o])+s)>>26,this.words[o]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),o=e,a=0|o.words[o.length-1];0!==(n=26-this._countBits(a))&&(o=o.ushln(n),r.iushln(n),a=0|o.words[o.length-1]);var s,l=r.length-o.length;if("mod"!==t){(s=new i(null)).length=l+1,s.words=new Array(s.length);for(var u=0;u<s.length;u++)s.words[u]=0}var p=r.clone()._ishlnsubmul(o,1,l);0===p.negative&&(r=p,s&&(s.words[l]=1));for(var c=l-1;c>=0;c--){var d=67108864*(0|r.words[o.length+c])+(0|r.words[o.length+c-1]);for(d=Math.min(d/a|0,67108863),r._ishlnsubmul(o,d,c);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(o,1,c),r.isZero()||(r.negative^=1);s&&(s.words[c]=d)}return s&&s.strip(),r.strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),o=e.andln(1),i=n.cmp(r);return i<0||1===o&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,o=this.length-1;o>=0;o--)n=(t*n+(0|this.words[o]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*t;this.words[n]=o/e|0,t=o%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),l=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var p=n.clone(),c=t.clone();!t.isZero();){for(var d=0,f=1;0==(t.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(p),a.isub(c)),o.iushrn(1),a.iushrn(1);for(var h=0,g=1;0==(n.words[0]&g)&&h<26;++h,g<<=1);if(h>0)for(n.iushrn(h);h-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(p),l.isub(c)),s.iushrn(1),l.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(l)):(n.isub(t),s.isub(o),l.isub(a))}return{a:s,b:l,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),l=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,p=1;0==(t.words[0]&p)&&u<26;++u,p<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(l),a.iushrn(1);for(var c=0,d=1;0==(n.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(n.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var o=t.cmp(n);if(o<0){var i=t;t=n,n=i}else if(0===o||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,o=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=o,this;for(var i=o,a=n;0!==i&&a<this.length;a++){var s=0|this.words[a];i=(s+=i)>>>26,s&=67108863,this.words[a]=s}return 0!==i&&(this.words[a]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:o<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],o=0|e.words[n];if(r!==o){r<o?t=-1:r>o&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new S(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function T(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function x(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},o(b,v),b.prototype.split=function(e,t){for(var n=Math.min(e.length,9),r=0;r<n;r++)t.words[r]=e.words[r];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=4194303&o,r=10;r<e.length;r++){var i=0|e.words[r];e.words[r-10]=(4194303&i)<<4|o>>>22,o=i}o>>>=22,e.words[r-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n<e.length;n++){var r=0|e.words[n];t+=977*r,e.words[n]=67108863&t,t=64*r+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},o(_,v),o(T,v),o(E,v),E.prototype.imulK=function(e){for(var t=0,n=0;n<e.length;n++){var r=19*(0|e.words[n])+t,o=67108863&r;r>>>=26,e.words[n]=o,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new _;else if("p192"===e)t=new T;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return y[e]=t,t},S.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},S.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),l=s.redNeg(),u=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new i(2*p*p).toRed(this);0!==this.pow(p,u).cmp(l);)p.redIAdd(l);for(var c=this.pow(p,o),d=this.pow(e,o.addn(1).iushrn(1)),f=this.pow(e,o),h=a;0!==f.cmp(s);){for(var g=f,m=0;0!==g.cmp(s);m++)g=g.redSqr();r(m<h);var y=this.pow(c,new i(1).iushln(h-m-1));d=d.redMul(y),c=y.redSqr(),f=f.redMul(c),h=m}return d},S.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},S.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var n=new Array(16);n[0]=new i(1).toRed(this),n[1]=e;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],e);var o=n[0],a=0,s=0,l=t.bitLength()%26;for(0===l&&(l=26),r=t.length-1;r>=0;r--){for(var u=t.words[r],p=l-1;p>=0;p--){var c=u>>p&1;o!==n[0]&&(o=this.sqr(o)),0!==c||0!==a?(a<<=1,a|=c,(4===++s||0===r&&0===p)&&(o=this.mul(o,n[a]),s=0,a=0)):s=0}l=26}return o},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new x(e)},o(x,S),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,n(95)(e))},function(e,t,n){const r=n(47);e.exports=(e,t,n)=>new r(e,n).compare(new r(t,n))},function(e,t,n){class r{constructor(e,t){if(t=i(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!h(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&g(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();const t=`parseRange:${Object.keys(this.options).join(",")}:${e}`,n=o.get(t);if(n)return n;const r=this.options.loose,i=r?u[p.HYPHENRANGELOOSE]:u[p.HYPHENRANGE];e=e.replace(i,k(this.options.includePrerelease)),s("hyphen replace",e),e=e.replace(u[p.COMPARATORTRIM],c),s("comparator trim",e,u[p.COMPARATORTRIM]),e=(e=(e=e.replace(u[p.TILDETRIM],d)).replace(u[p.CARETTRIM],f)).split(/\s+/).join(" ");const l=r?u[p.COMPARATORLOOSE]:u[p.COMPARATOR],g=e.split(" ").map(e=>y(e,this.options)).join(" ").split(/\s+/).map(e=>A(e,this.options)).filter(this.options.loose?e=>!!e.match(l):()=>!0).map(e=>new a(e,this.options)),m=(g.length,new Map);for(const e of g){if(h(e))return[e];m.set(e.value,e)}m.size>1&&m.has("")&&m.delete("");const v=[...m.values()];return o.set(t,v),v}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(n=>m(n,t)&&e.set.some(e=>m(e,t)&&n.every(n=>e.every(e=>n.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(M(this.set[t],e,this.options))return!0;return!1}}e.exports=r;const o=new(n(136))({max:1e3}),i=n(221),a=n(223),s=n(220),l=n(47),{re:u,t:p,comparatorTrimReplace:c,tildeTrimReplace:d,caretTrimReplace:f}=n(142),h=e=>"<0.0.0-0"===e.value,g=e=>""===e.value,m=(e,t)=>{let n=!0;const r=e.slice();let o=r.pop();for(;n&&r.length;)n=r.every(e=>o.intersects(e,t)),o=r.pop();return n},y=(e,t)=>(s("comp",e,t),e=T(e,t),s("caret",e),e=b(e,t),s("tildes",e),e=S(e,t),s("xrange",e),e=w(e,t),s("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,b=(e,t)=>e.trim().split(/\s+/).map(e=>_(e,t)).join(" "),_=(e,t)=>{const n=t.loose?u[p.TILDELOOSE]:u[p.TILDE];return e.replace(n,(t,n,r,o,i)=>{let a;return s("tilde",e,t,n,r,o,i),v(n)?a="":v(r)?a=`>=${n}.0.0 <${+n+1}.0.0-0`:v(o)?a=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:i?(s("replaceTilde pr",i),a=`>=${n}.${r}.${o}-${i} <${n}.${+r+1}.0-0`):a=`>=${n}.${r}.${o} <${n}.${+r+1}.0-0`,s("tilde return",a),a})},T=(e,t)=>e.trim().split(/\s+/).map(e=>E(e,t)).join(" "),E=(e,t)=>{s("caret",e,t);const n=t.loose?u[p.CARETLOOSE]:u[p.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,(t,n,o,i,a)=>{let l;return s("caret",e,t,n,o,i,a),v(n)?l="":v(o)?l=`>=${n}.0.0${r} <${+n+1}.0.0-0`:v(i)?l="0"===n?`>=${n}.${o}.0${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.0${r} <${+n+1}.0.0-0`:a?(s("replaceCaret pr",a),l="0"===n?"0"===o?`>=${n}.${o}.${i}-${a} <${n}.${o}.${+i+1}-0`:`>=${n}.${o}.${i}-${a} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${i}-${a} <${+n+1}.0.0-0`):(s("no pr"),l="0"===n?"0"===o?`>=${n}.${o}.${i}${r} <${n}.${o}.${+i+1}-0`:`>=${n}.${o}.${i}${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${i} <${+n+1}.0.0-0`),s("caret return",l),l})},S=(e,t)=>(s("replaceXRanges",e,t),e.split(/\s+/).map(e=>x(e,t)).join(" ")),x=(e,t)=>{e=e.trim();const n=t.loose?u[p.XRANGELOOSE]:u[p.XRANGE];return e.replace(n,(n,r,o,i,a,l)=>{s("xRange",e,n,r,o,i,a,l);const u=v(o),p=u||v(i),c=p||v(a),d=c;return"="===r&&d&&(r=""),l=t.includePrerelease?"-0":"",u?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(p&&(i=0),a=0,">"===r?(r=">=",p?(o=+o+1,i=0,a=0):(i=+i+1,a=0)):"<="===r&&(r="<",p?o=+o+1:i=+i+1),"<"===r&&(l="-0"),n=`${r+o}.${i}.${a}${l}`):p?n=`>=${o}.0.0${l} <${+o+1}.0.0-0`:c&&(n=`>=${o}.${i}.0${l} <${o}.${+i+1}.0-0`),s("xRange return",n),n})},w=(e,t)=>(s("replaceStars",e,t),e.trim().replace(u[p.STAR],"")),A=(e,t)=>(s("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?p.GTE0PRE:p.GTE0],"")),k=e=>(t,n,r,o,i,a,s,l,u,p,c,d,f)=>`${n=v(r)?"":v(o)?`>=${r}.0.0${e?"-0":""}`:v(i)?`>=${r}.${o}.0${e?"-0":""}`:a?">="+n:`>=${n}${e?"-0":""}`} ${l=v(u)?"":v(p)?`<${+u+1}.0.0-0`:v(c)?`<${u}.${+p+1}.0-0`:d?`<=${u}.${p}.${c}-${d}`:e?`<${u}.${p}.${+c+1}-0`:"<="+l}`.trim(),M=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(s(e[n].semver),e[n].semver!==a.ANY&&e[n].semver.prerelease.length>0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}},function(e,t,n){"use strict";const r=n(16),o=n(1332),i=n(22),a=n(176);e.exports=o.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(e,t){return r("function"==typeof e,"Method must be a function"),r(void 0===t||t&&"string"==typeof t,"Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:e,description:t}})},validate(e,t,{method:n}){try{return n(e,t)}catch(e){return t.error("any.custom",{error:e})}},args:["method","description"],multi:!0},messages:{method(e){return this.prefs({messages:e})}},shared:{method(e){r(i.isSchema(e)&&e._flags.id,"Schema must be a schema with an id");const t=this.clone();return t.$_terms.shared=t.$_terms.shared||[],t.$_terms.shared.push(e),t.$_mutateRegister(e),t}},warning:{method(e,t){return r(e&&"string"==typeof e,"Invalid warning code"),this.$_addRule({name:"warning",args:{code:e,local:t},warn:!0})},validate:(e,t,{code:n,local:r})=>t.error(n,r),args:["code","local"],multi:!0}},modifiers:{keep(e,t=!0){e.keep=t},message(e,t){e.message=a.compile(t)},warn(e,t=!0){e.warn=t}},manifest:{build(e,t){for(const n in t){const r=t[n];if(["examples","externals","metas","notes","tags"].includes(n))for(const t of r)e=e[n.slice(0,-1)](t);else if("alterations"!==n)if("whens"!==n){if("shared"===n)for(const t of r)e=e.shared(t)}else for(const t of r){const{ref:n,is:r,not:o,then:i,otherwise:a,concat:s}=t;e=s?e.concat(s):n?e.when(n,{is:r,not:o,then:i,otherwise:a,switch:t.switch,break:t.break}):e.when(r,{then:i,otherwise:a,break:t.break})}else{const t={};for(const{target:e,adjuster:n}of r)t[e]=n;e=e.alter(t)}}return e}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},function(e,t,n){const r=n(49);e.exports=(e,t,n)=>new r(e,n).compare(new r(t,n))},function(e,t,n){class r{constructor(e,t){if(t=i(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!h(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&g(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();const t=`parseRange:${Object.keys(this.options).join(",")}:${e}`,n=o.get(t);if(n)return n;const r=this.options.loose,i=r?u[p.HYPHENRANGELOOSE]:u[p.HYPHENRANGE];e=e.replace(i,k(this.options.includePrerelease)),s("hyphen replace",e),e=e.replace(u[p.COMPARATORTRIM],c),s("comparator trim",e,u[p.COMPARATORTRIM]),e=(e=(e=e.replace(u[p.TILDETRIM],d)).replace(u[p.CARETTRIM],f)).split(/\s+/).join(" ");const l=r?u[p.COMPARATORLOOSE]:u[p.COMPARATOR],g=e.split(" ").map(e=>y(e,this.options)).join(" ").split(/\s+/).map(e=>A(e,this.options)).filter(this.options.loose?e=>!!e.match(l):()=>!0).map(e=>new a(e,this.options)),m=(g.length,new Map);for(const e of g){if(h(e))return[e];m.set(e.value,e)}m.size>1&&m.has("")&&m.delete("");const v=[...m.values()];return o.set(t,v),v}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(n=>m(n,t)&&e.set.some(e=>m(e,t)&&n.every(n=>e.every(e=>n.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(M(this.set[t],e,this.options))return!0;return!1}}e.exports=r;const o=new(n(136))({max:1e3}),i=n(239),a=n(241),s=n(238),l=n(49),{re:u,t:p,comparatorTrimReplace:c,tildeTrimReplace:d,caretTrimReplace:f}=n(152),h=e=>"<0.0.0-0"===e.value,g=e=>""===e.value,m=(e,t)=>{let n=!0;const r=e.slice();let o=r.pop();for(;n&&r.length;)n=r.every(e=>o.intersects(e,t)),o=r.pop();return n},y=(e,t)=>(s("comp",e,t),e=T(e,t),s("caret",e),e=b(e,t),s("tildes",e),e=S(e,t),s("xrange",e),e=w(e,t),s("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,b=(e,t)=>e.trim().split(/\s+/).map(e=>_(e,t)).join(" "),_=(e,t)=>{const n=t.loose?u[p.TILDELOOSE]:u[p.TILDE];return e.replace(n,(t,n,r,o,i)=>{let a;return s("tilde",e,t,n,r,o,i),v(n)?a="":v(r)?a=`>=${n}.0.0 <${+n+1}.0.0-0`:v(o)?a=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:i?(s("replaceTilde pr",i),a=`>=${n}.${r}.${o}-${i} <${n}.${+r+1}.0-0`):a=`>=${n}.${r}.${o} <${n}.${+r+1}.0-0`,s("tilde return",a),a})},T=(e,t)=>e.trim().split(/\s+/).map(e=>E(e,t)).join(" "),E=(e,t)=>{s("caret",e,t);const n=t.loose?u[p.CARETLOOSE]:u[p.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,(t,n,o,i,a)=>{let l;return s("caret",e,t,n,o,i,a),v(n)?l="":v(o)?l=`>=${n}.0.0${r} <${+n+1}.0.0-0`:v(i)?l="0"===n?`>=${n}.${o}.0${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.0${r} <${+n+1}.0.0-0`:a?(s("replaceCaret pr",a),l="0"===n?"0"===o?`>=${n}.${o}.${i}-${a} <${n}.${o}.${+i+1}-0`:`>=${n}.${o}.${i}-${a} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${i}-${a} <${+n+1}.0.0-0`):(s("no pr"),l="0"===n?"0"===o?`>=${n}.${o}.${i}${r} <${n}.${o}.${+i+1}-0`:`>=${n}.${o}.${i}${r} <${n}.${+o+1}.0-0`:`>=${n}.${o}.${i} <${+n+1}.0.0-0`),s("caret return",l),l})},S=(e,t)=>(s("replaceXRanges",e,t),e.split(/\s+/).map(e=>x(e,t)).join(" ")),x=(e,t)=>{e=e.trim();const n=t.loose?u[p.XRANGELOOSE]:u[p.XRANGE];return e.replace(n,(n,r,o,i,a,l)=>{s("xRange",e,n,r,o,i,a,l);const u=v(o),p=u||v(i),c=p||v(a),d=c;return"="===r&&d&&(r=""),l=t.includePrerelease?"-0":"",u?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(p&&(i=0),a=0,">"===r?(r=">=",p?(o=+o+1,i=0,a=0):(i=+i+1,a=0)):"<="===r&&(r="<",p?o=+o+1:i=+i+1),"<"===r&&(l="-0"),n=`${r+o}.${i}.${a}${l}`):p?n=`>=${o}.0.0${l} <${+o+1}.0.0-0`:c&&(n=`>=${o}.${i}.0${l} <${o}.${+i+1}.0-0`),s("xRange return",n),n})},w=(e,t)=>(s("replaceStars",e,t),e.trim().replace(u[p.STAR],"")),A=(e,t)=>(s("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?p.GTE0PRE:p.GTE0],"")),k=e=>(t,n,r,o,i,a,s,l,u,p,c,d,f)=>`${n=v(r)?"":v(o)?`>=${r}.0.0${e?"-0":""}`:v(i)?`>=${r}.${o}.0${e?"-0":""}`:a?">="+n:`>=${n}${e?"-0":""}`} ${l=v(u)?"":v(p)?`<${+u+1}.0.0-0`:v(c)?`<${u}.${+p+1}.0-0`:d?`<=${u}.${p}.${c}-${d}`:e?`<${u}.${p}.${+c+1}-0`:"<="+l}`.trim(),M=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(s(e[n].semver),e[n].semver!==a.ANY&&e[n].semver.prerelease.length>0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}},function(e,t,n){"use strict";function r(e){var t=e.split(/\r\n|[\n\r]/g),n=o(t);if(0!==n)for(var r=1;r<t.length;r++)t[r]=t[r].slice(n);for(;t.length>0&&a(t[0]);)t.shift();for(;t.length>0&&a(t[t.length-1]);)t.pop();return t.join("\n")}function o(e){for(var t=null,n=1;n<e.length;n++){var r=e[n],o=i(r);if(o!==r.length&&((null===t||o<t)&&0===(t=o)))break}return null===t?0:t}function i(e){for(var t=0;t<e.length&&(" "===e[t]||"\t"===e[t]);)t++;return t}function a(e){return i(e)===e.length}function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=-1===e.indexOf("\n"),o=" "===e[0]||"\t"===e[0],i='"'===e[e.length-1],a=!r||i||n,s="";return!a||r&&o||(s+="\n"+t),s+=t?e.replace(/\n/g,"\n"+t):e,a&&(s+="\n"),'"""'+s.replace(/"""/g,'\\"""')+'"""'}n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return s}))},function(e,t,n){"use strict";var r=Array.prototype.find?function(e,t){return Array.prototype.find.call(e,t)}:function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(t(r))return r}};t.a=r},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(63);function o(e,t){for(var n=Object.create(null),o=0,i=Object(r.a)(e);o<i.length;o++){var a=i[o],s=a[0],l=a[1];n[s]=t(l,s)}return n}},function(e,t,n){var r=n(435),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},function(e,t,n){"use strict";var r=n(115),o=n(56);function i(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function l(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=o,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),o=0;o<e.length;o+=2)n.push(parseInt(e[o]+e[o+1],16))}else for(var r=0,o=0;o<e.length;o++){var a=e.charCodeAt(o);a<128?n[r++]=a:a<2048?(n[r++]=a>>6|192,n[r++]=63&a|128):i(e,o)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++o)),n[r++]=a>>18|240,n[r++]=a>>12&63|128,n[r++]=a>>6&63|128,n[r++]=63&a|128):(n[r++]=a>>12|224,n[r++]=a>>6&63|128,n[r++]=63&a|128)}else for(o=0;o<e.length;o++)n[o]=0|e[o];return n},t.toHex=function(e){for(var t="",n=0;n<e.length;n++)t+=s(e[n].toString(16));return t},t.htonl=a,t.toHex32=function(e,t){for(var n="",r=0;r<e.length;r++){var o=e[r];"little"===t&&(o=a(o)),n+=l(o.toString(16))}return n},t.zero2=s,t.zero8=l,t.join32=function(e,t,n,o){var i=n-t;r(i%4==0);for(var a=new Array(i/4),s=0,l=t;s<a.length;s++,l+=4){var u;u="big"===o?e[l]<<24|e[l+1]<<16|e[l+2]<<8|e[l+3]:e[l+3]<<24|e[l+2]<<16|e[l+1]<<8|e[l],a[s]=u>>>0}return a},t.split32=function(e,t){for(var n=new Array(4*e.length),r=0,o=0;r<e.length;r++,o+=4){var i=e[r];"big"===t?(n[o]=i>>>24,n[o+1]=i>>>16&255,n[o+2]=i>>>8&255,n[o+3]=255&i):(n[o+3]=i>>>24,n[o+2]=i>>>16&255,n[o+1]=i>>>8&255,n[o]=255&i)}return n},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,n){return e+t+n>>>0},t.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},t.sum32_5=function(e,t,n,r,o){return e+t+n+r+o>>>0},t.sum64=function(e,t,n,r){var o=e[t],i=r+e[t+1]>>>0,a=(i<r?1:0)+n+o;e[t]=a>>>0,e[t+1]=i},t.sum64_hi=function(e,t,n,r){return(t+r>>>0<t?1:0)+e+n>>>0},t.sum64_lo=function(e,t,n,r){return t+r>>>0},t.sum64_4_hi=function(e,t,n,r,o,i,a,s){var l=0,u=t;return l+=(u=u+r>>>0)<t?1:0,l+=(u=u+i>>>0)<i?1:0,e+n+o+a+(l+=(u=u+s>>>0)<s?1:0)>>>0},t.sum64_4_lo=function(e,t,n,r,o,i,a,s){return t+r+i+s>>>0},t.sum64_5_hi=function(e,t,n,r,o,i,a,s,l,u){var p=0,c=t;return p+=(c=c+r>>>0)<t?1:0,p+=(c=c+i>>>0)<i?1:0,p+=(c=c+s>>>0)<s?1:0,e+n+o+a+l+(p+=(c=c+u>>>0)<u?1:0)>>>0},t.sum64_5_lo=function(e,t,n,r,o,i,a,s,l,u){return t+r+i+s+u>>>0},t.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},t.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},t.shr64_hi=function(e,t,n){return e>>>n},t.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0}},function(e,t,n){const r=n(27);e.exports=(e={})=>{e&&e.user&&delete e.user.avatar;const t=(t,n="")=>("function"==typeof e.get?e.get(t):r(e,`headers[${t}]`))||n,n=t("x-real-port");return{ip:t("x-real-ip","127.0.0.1"),ua:t("user-agent"),protocol:t("x-real-protocol").replace(/:$/,"")||"http",user:e.user||{},url:e.originalUrl,query:e.query,hostname:t("x-real-hostname"),port:80===Number(n)?"":Number(n)}}},function(module,exports){var $jscomp=$jscomp||{};$jscomp.scope={},$jscomp.findInternal=function(e,t,n){e instanceof String&&(e=String(e));for(var r=e.length,o=0;o<r;o++){var i=e[o];if(t.call(n,i,o,e))return{i:o,v:i}}return{i:-1,v:void 0}},$jscomp.ASSUME_ES5=!1,$jscomp.ASSUME_NO_NATIVE_MAP=!1,$jscomp.ASSUME_NO_NATIVE_SET=!1,$jscomp.SIMPLE_FROUND_POLYFILL=!1,$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){e!=Array.prototype&&e!=Object.prototype&&(e[t]=n.value)},$jscomp.getGlobal=function(e){return"undefined"!=typeof window&&window===e?e:"undefined"!=typeof global&&null!=global?global:e},$jscomp.global=$jscomp.getGlobal(this),$jscomp.polyfill=function(e,t,n,r){if(t){for(n=$jscomp.global,e=e.split("."),r=0;r<e.length-1;r++){var o=e[r];o in n||(n[o]={}),n=n[o]}(t=t(r=n[e=e[e.length-1]]))!=r&&null!=t&&$jscomp.defineProperty(n,e,{configurable:!0,writable:!0,value:t})}},$jscomp.polyfill("Array.prototype.findIndex",(function(e){return e||function(e,t){return $jscomp.findInternal(this,e,t).i}}),"es6","es3"),$jscomp.checkStringArgs=function(e,t,n){if(null==e)throw new TypeError("The 'this' value for String.prototype."+n+" must not be null or undefined");if(t instanceof RegExp)throw new TypeError("First argument to String.prototype."+n+" must not be a regular expression");return e+""},$jscomp.polyfill("String.prototype.endsWith",(function(e){return e||function(e,t){var n=$jscomp.checkStringArgs(this,e,"endsWith");e+="",void 0===t&&(t=n.length),t=Math.max(0,Math.min(0|t,n.length));for(var r=e.length;0<r&&0<t;)if(n[--t]!=e[--r])return!1;return 0>=r}}),"es6","es3"),$jscomp.polyfill("Array.prototype.find",(function(e){return e||function(e,t){return $jscomp.findInternal(this,e,t).v}}),"es6","es3"),$jscomp.polyfill("String.prototype.startsWith",(function(e){return e||function(e,t){var n=$jscomp.checkStringArgs(this,e,"startsWith");e+="";var r=n.length,o=e.length;t=Math.max(0,Math.min(0|t,n.length));for(var i=0;i<o&&t<r;)if(n[t++]!=e[i++])return!1;return i>=o}}),"es6","es3"),$jscomp.polyfill("String.prototype.repeat",(function(e){return e||function(e){var t=$jscomp.checkStringArgs(this,null,"repeat");if(0>e||1342177279<e)throw new RangeError("Invalid count value");e|=0;for(var n="";e;)1&e&&(n+=t),(e>>>=1)&&(t+=t);return n}}),"es6","es3");var COMPILED=!0,goog=goog||{};goog.global=this||self,goog.isDef=function(e){return void 0!==e},goog.isString=function(e){return"string"==typeof e},goog.isBoolean=function(e){return"boolean"==typeof e},goog.isNumber=function(e){return"number"==typeof e},goog.exportPath_=function(e,t,n){e=e.split("."),n=n||goog.global,e[0]in n||void 0===n.execScript||n.execScript("var "+e[0]);for(var r;e.length&&(r=e.shift());)!e.length&&goog.isDef(t)?n[r]=t:n=n[r]&&n[r]!==Object.prototype[r]?n[r]:n[r]={}},goog.define=function(e,t){if(!COMPILED){var n=goog.global.CLOSURE_UNCOMPILED_DEFINES,r=goog.global.CLOSURE_DEFINES;n&&void 0===n.nodeType&&Object.prototype.hasOwnProperty.call(n,e)?t=n[e]:r&&void 0===r.nodeType&&Object.prototype.hasOwnProperty.call(r,e)&&(t=r[e])}return t},goog.FEATURESET_YEAR=2012,goog.DEBUG=!0,goog.LOCALE="en",goog.TRUSTED_SITE=!0,goog.STRICT_MODE_COMPATIBLE=!1,goog.DISALLOW_TEST_ONLY_CODE=COMPILED&&!goog.DEBUG,goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING=!1,goog.provide=function(e){if(goog.isInModuleLoader_())throw Error("goog.provide cannot be used within a module.");if(!COMPILED&&goog.isProvided_(e))throw Error('Namespace "'+e+'" already declared.');goog.constructNamespace_(e)},goog.constructNamespace_=function(e,t){if(!COMPILED){delete goog.implicitNamespaces_[e];for(var n=e;(n=n.substring(0,n.lastIndexOf(".")))&&!goog.getObjectByName(n);)goog.implicitNamespaces_[n]=!0}goog.exportPath_(e,t)},goog.getScriptNonce=function(e){return e&&e!=goog.global?goog.getScriptNonce_(e.document):(null===goog.cspNonce_&&(goog.cspNonce_=goog.getScriptNonce_(goog.global.document)),goog.cspNonce_)},goog.NONCE_PATTERN_=/^[\w+/_-]+[=]{0,2}$/,goog.cspNonce_=null,goog.getScriptNonce_=function(e){return(e=e.querySelector&&e.querySelector("script[nonce]"))&&(e=e.nonce||e.getAttribute("nonce"))&&goog.NONCE_PATTERN_.test(e)?e:""},goog.VALID_MODULE_RE_=/^[a-zA-Z_$][a-zA-Z0-9._$]*$/,goog.module=function(e){if(!goog.isString(e)||!e||-1==e.search(goog.VALID_MODULE_RE_))throw Error("Invalid module identifier");if(!goog.isInGoogModuleLoader_())throw Error("Module "+e+" has been loaded incorrectly. Note, modules cannot be loaded as normal scripts. They require some kind of pre-processing step. You're likely trying to load a module via a script tag or as a part of a concatenated bundle without rewriting the module. For more info see: https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide.");if(goog.moduleLoaderState_.moduleName)throw Error("goog.module may only be called once per module.");if(goog.moduleLoaderState_.moduleName=e,!COMPILED){if(goog.isProvided_(e))throw Error('Namespace "'+e+'" already declared.');delete goog.implicitNamespaces_[e]}},goog.module.get=function(e){return goog.module.getInternal_(e)},goog.module.getInternal_=function(e){if(!COMPILED){if(e in goog.loadedModules_)return goog.loadedModules_[e].exports;if(!goog.implicitNamespaces_[e])return null!=(e=goog.getObjectByName(e))?e:null}return null},goog.ModuleType={ES6:"es6",GOOG:"goog"},goog.moduleLoaderState_=null,goog.isInModuleLoader_=function(){return goog.isInGoogModuleLoader_()||goog.isInEs6ModuleLoader_()},goog.isInGoogModuleLoader_=function(){return!!goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.GOOG},goog.isInEs6ModuleLoader_=function(){if(goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.ES6)return!0;var e=goog.global.$jscomp;return!!e&&("function"==typeof e.getCurrentModulePath&&!!e.getCurrentModulePath())},goog.module.declareLegacyNamespace=function(){if(!COMPILED&&!goog.isInGoogModuleLoader_())throw Error("goog.module.declareLegacyNamespace must be called from within a goog.module");if(!COMPILED&&!goog.moduleLoaderState_.moduleName)throw Error("goog.module must be called prior to goog.module.declareLegacyNamespace.");goog.moduleLoaderState_.declareLegacyNamespace=!0},goog.declareModuleId=function(e){if(!COMPILED){if(!goog.isInEs6ModuleLoader_())throw Error("goog.declareModuleId may only be called from within an ES6 module");if(goog.moduleLoaderState_&&goog.moduleLoaderState_.moduleName)throw Error("goog.declareModuleId may only be called once per module.");if(e in goog.loadedModules_)throw Error('Module with namespace "'+e+'" already exists.')}if(goog.moduleLoaderState_)goog.moduleLoaderState_.moduleName=e;else{var t=goog.global.$jscomp;if(!t||"function"!=typeof t.getCurrentModulePath)throw Error('Module with namespace "'+e+'" has been loaded incorrectly.');t=t.require(t.getCurrentModulePath()),goog.loadedModules_[e]={exports:t,type:goog.ModuleType.ES6,moduleId:e}}},goog.setTestOnly=function(e){if(goog.DISALLOW_TEST_ONLY_CODE)throw e=e||"",Error("Importing test-only code into non-debug environment"+(e?": "+e:"."))},goog.forwardDeclare=function(e){},COMPILED||(goog.isProvided_=function(e){return e in goog.loadedModules_||!goog.implicitNamespaces_[e]&&goog.isDefAndNotNull(goog.getObjectByName(e))},goog.implicitNamespaces_={"goog.module":!0}),goog.getObjectByName=function(e,t){e=e.split("."),t=t||goog.global;for(var n=0;n<e.length;n++)if(t=t[e[n]],!goog.isDefAndNotNull(t))return null;return t},goog.globalize=function(e,t){for(var n in t=t||goog.global,e)t[n]=e[n]},goog.addDependency=function(e,t,n,r){!COMPILED&&goog.DEPENDENCIES_ENABLED&&goog.debugLoader_.addDependency(e,t,n,r)},goog.ENABLE_DEBUG_LOADER=!0,goog.logToConsole_=function(e){goog.global.console&&goog.global.console.error(e)},goog.require=function(e){if(!COMPILED){if(goog.ENABLE_DEBUG_LOADER&&goog.debugLoader_.requested(e),goog.isProvided_(e)){if(goog.isInModuleLoader_())return goog.module.getInternal_(e)}else if(goog.ENABLE_DEBUG_LOADER){var t=goog.moduleLoaderState_;goog.moduleLoaderState_=null;try{goog.debugLoader_.load_(e)}finally{goog.moduleLoaderState_=t}}return null}},goog.requireType=function(e){return{}},goog.basePath="",goog.nullFunction=function(){},goog.abstractMethod=function(){throw Error("unimplemented abstract method")},goog.addSingletonGetter=function(e){e.instance_=void 0,e.getInstance=function(){return e.instance_?e.instance_:(goog.DEBUG&&(goog.instantiatedSingletons_[goog.instantiatedSingletons_.length]=e),e.instance_=new e)}},goog.instantiatedSingletons_=[],goog.LOAD_MODULE_USING_EVAL=!0,goog.SEAL_MODULE_EXPORTS=goog.DEBUG,goog.loadedModules_={},goog.DEPENDENCIES_ENABLED=!COMPILED&&goog.ENABLE_DEBUG_LOADER,goog.TRANSPILE="detect",goog.ASSUME_ES_MODULES_TRANSPILED=!1,goog.TRANSPILE_TO_LANGUAGE="",goog.TRANSPILER="transpile.js",goog.hasBadLetScoping=null,goog.useSafari10Workaround=function(){if(null==goog.hasBadLetScoping){try{var a=!eval('"use strict";let x = 1; function f() { return typeof x; };f() == "number";')}catch(e){a=!1}goog.hasBadLetScoping=a}return goog.hasBadLetScoping},goog.workaroundSafari10EvalBug=function(e){return"(function(){"+e+"\n;})();\n"},goog.loadModule=function(e){var t=goog.moduleLoaderState_;try{if(goog.moduleLoaderState_={moduleName:"",declareLegacyNamespace:!1,type:goog.ModuleType.GOOG},goog.isFunction(e))var n=e.call(void 0,{});else{if(!goog.isString(e))throw Error("Invalid module definition");goog.useSafari10Workaround()&&(e=goog.workaroundSafari10EvalBug(e)),n=goog.loadModuleFromSource_.call(void 0,e)}var r=goog.moduleLoaderState_.moduleName;if(!goog.isString(r)||!r)throw Error('Invalid module name "'+r+'"');goog.moduleLoaderState_.declareLegacyNamespace?goog.constructNamespace_(r,n):goog.SEAL_MODULE_EXPORTS&&Object.seal&&"object"==typeof n&&null!=n&&Object.seal(n),goog.loadedModules_[r]={exports:n,type:goog.ModuleType.GOOG,moduleId:goog.moduleLoaderState_.moduleName}}finally{goog.moduleLoaderState_=t}},goog.loadModuleFromSource_=function(a){return eval(a),{}},goog.normalizePath_=function(e){e=e.split("/");for(var t=0;t<e.length;)"."==e[t]?e.splice(t,1):t&&".."==e[t]&&e[t-1]&&".."!=e[t-1]?e.splice(--t,2):t++;return e.join("/")},goog.loadFileSync_=function(e){if(goog.global.CLOSURE_LOAD_FILE_SYNC)return goog.global.CLOSURE_LOAD_FILE_SYNC(e);try{var t=new goog.global.XMLHttpRequest;return t.open("get",e,!1),t.send(),0==t.status||200==t.status?t.responseText:null}catch(e){return null}},goog.transpile_=function(e,t,n){var r=goog.global.$jscomp;r||(goog.global.$jscomp=r={});var o=r.transpile;if(!o){var i=goog.basePath+goog.TRANSPILER,a=goog.loadFileSync_(i);if(a){if(function(){(0,eval)(a+"\n//# sourceURL="+i)}.call(goog.global),goog.global.$gwtExport&&goog.global.$gwtExport.$jscomp&&!goog.global.$gwtExport.$jscomp.transpile)throw Error('The transpiler did not properly export the "transpile" method. $gwtExport: '+JSON.stringify(goog.global.$gwtExport));goog.global.$jscomp.transpile=goog.global.$gwtExport.$jscomp.transpile,o=(r=goog.global.$jscomp).transpile}}return o||(o=r.transpile=function(e,t){return goog.logToConsole_(t+" requires transpilation but no transpiler was found."),e}),o(e,t,n)},goog.typeOf=function(e){var t=typeof e;if("object"==t){if(!e)return"null";if(e instanceof Array)return"array";if(e instanceof Object)return t;var n=Object.prototype.toString.call(e);if("[object Window]"==n)return"object";if("[object Array]"==n||"number"==typeof e.length&&void 0!==e.splice&&void 0!==e.propertyIsEnumerable&&!e.propertyIsEnumerable("splice"))return"array";if("[object Function]"==n||void 0!==e.call&&void 0!==e.propertyIsEnumerable&&!e.propertyIsEnumerable("call"))return"function"}else if("function"==t&&void 0===e.call)return"object";return t},goog.isNull=function(e){return null===e},goog.isDefAndNotNull=function(e){return null!=e},goog.isArray=function(e){return"array"==goog.typeOf(e)},goog.isArrayLike=function(e){var t=goog.typeOf(e);return"array"==t||"object"==t&&"number"==typeof e.length},goog.isDateLike=function(e){return goog.isObject(e)&&"function"==typeof e.getFullYear},goog.isFunction=function(e){return"function"==goog.typeOf(e)},goog.isObject=function(e){var t=typeof e;return"object"==t&&null!=e||"function"==t},goog.getUid=function(e){return e[goog.UID_PROPERTY_]||(e[goog.UID_PROPERTY_]=++goog.uidCounter_)},goog.hasUid=function(e){return!!e[goog.UID_PROPERTY_]},goog.removeUid=function(e){null!==e&&"removeAttribute"in e&&e.removeAttribute(goog.UID_PROPERTY_);try{delete e[goog.UID_PROPERTY_]}catch(e){}},goog.UID_PROPERTY_="closure_uid_"+(1e9*Math.random()>>>0),goog.uidCounter_=0,goog.getHashCode=goog.getUid,goog.removeHashCode=goog.removeUid,goog.cloneObject=function(e){var t=goog.typeOf(e);if("object"==t||"array"==t){if("function"==typeof e.clone)return e.clone();for(var n in t="array"==t?[]:{},e)t[n]=goog.cloneObject(e[n]);return t}return e},goog.bindNative_=function(e,t,n){return e.call.apply(e.bind,arguments)},goog.bindJs_=function(e,t,n){if(!e)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),e.apply(t,n)}}return function(){return e.apply(t,arguments)}},goog.bind=function(e,t,n){return Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?goog.bind=goog.bindNative_:goog.bind=goog.bindJs_,goog.bind.apply(null,arguments)},goog.partial=function(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=n.slice();return t.push.apply(t,arguments),e.apply(this,t)}},goog.mixin=function(e,t){for(var n in t)e[n]=t[n]},goog.now=goog.TRUSTED_SITE&&Date.now||function(){return+new Date},goog.globalEval=function(e){if(goog.global.execScript)goog.global.execScript(e,"JavaScript");else{if(!goog.global.eval)throw Error("goog.globalEval not available");if(null==goog.evalWorksForGlobals_){try{goog.global.eval("var _evalTest_ = 1;")}catch(e){}if(void 0!==goog.global._evalTest_){try{delete goog.global._evalTest_}catch(e){}goog.evalWorksForGlobals_=!0}else goog.evalWorksForGlobals_=!1}if(goog.evalWorksForGlobals_)goog.global.eval(e);else{var t=goog.global.document,n=t.createElement("SCRIPT");n.type="text/javascript",n.defer=!1,n.appendChild(t.createTextNode(e)),t.head.appendChild(n),t.head.removeChild(n)}}},goog.evalWorksForGlobals_=null,goog.getCssName=function(e,t){if("."==String(e).charAt(0))throw Error('className passed in goog.getCssName must not start with ".". You passed: '+e);var n=function(e){return goog.cssNameMapping_[e]||e},r=function(e){e=e.split("-");for(var t=[],r=0;r<e.length;r++)t.push(n(e[r]));return t.join("-")};return r=goog.cssNameMapping_?"BY_WHOLE"==goog.cssNameMappingStyle_?n:r:function(e){return e},e=t?e+"-"+r(t):r(e),goog.global.CLOSURE_CSS_NAME_MAP_FN?goog.global.CLOSURE_CSS_NAME_MAP_FN(e):e},goog.setCssNameMapping=function(e,t){goog.cssNameMapping_=e,goog.cssNameMappingStyle_=t},!COMPILED&&goog.global.CLOSURE_CSS_NAME_MAPPING&&(goog.cssNameMapping_=goog.global.CLOSURE_CSS_NAME_MAPPING),goog.getMsg=function(e,t,n){return n&&n.html&&(e=e.replace(/</g,"<")),t&&(e=e.replace(/\{\$([^}]+)}/g,(function(e,n){return null!=t&&n in t?t[n]:e}))),e},goog.getMsgWithFallback=function(e,t){return e},goog.exportSymbol=function(e,t,n){goog.exportPath_(e,t,n)},goog.exportProperty=function(e,t,n){e[t]=n},goog.inherits=function(e,t){function n(){}n.prototype=t.prototype,e.superClass_=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.base=function(e,n,r){for(var o=Array(arguments.length-2),i=2;i<arguments.length;i++)o[i-2]=arguments[i];return t.prototype[n].apply(e,o)}},goog.base=function(e,t,n){var r=arguments.callee.caller;if(goog.STRICT_MODE_COMPATIBLE||goog.DEBUG&&!r)throw Error("arguments.caller not defined. goog.base() cannot be used with strict mode code. See http://www.ecma-international.org/ecma-262/5.1/#sec-C");if(void 0!==r.superClass_){for(var o=Array(arguments.length-1),i=1;i<arguments.length;i++)o[i-1]=arguments[i];return r.superClass_.constructor.apply(e,o)}if("string"!=typeof t&&"symbol"!=typeof t)throw Error("method names provided to goog.base must be a string or a symbol");for(o=Array(arguments.length-2),i=2;i<arguments.length;i++)o[i-2]=arguments[i];i=!1;for(var a=e.constructor.prototype;a;a=Object.getPrototypeOf(a))if(a[t]===r)i=!0;else if(i)return a[t].apply(e,o);if(e[t]===r)return e.constructor.prototype[t].apply(e,o);throw Error("goog.base called from a method of one name to a method of a different name")},goog.scope=function(e){if(goog.isInModuleLoader_())throw Error("goog.scope is not supported within a module.");e.call(goog.global)},COMPILED||(goog.global.COMPILED=COMPILED),goog.defineClass=function(e,t){var n=t.constructor,r=t.statics;return n&&n!=Object.prototype.constructor||(n=function(){throw Error("cannot instantiate an interface (no constructor defined).")}),n=goog.defineClass.createSealingConstructor_(n,e),e&&goog.inherits(n,e),delete t.constructor,delete t.statics,goog.defineClass.applyProperties_(n.prototype,t),null!=r&&(r instanceof Function?r(n):goog.defineClass.applyProperties_(n,r)),n},goog.defineClass.SEAL_CLASS_INSTANCES=goog.DEBUG,goog.defineClass.createSealingConstructor_=function(e,t){if(!goog.defineClass.SEAL_CLASS_INSTANCES)return e;var n=!goog.defineClass.isUnsealable_(t),r=function(){var t=e.apply(this,arguments)||this;return t[goog.UID_PROPERTY_]=t[goog.UID_PROPERTY_],this.constructor===r&&n&&Object.seal instanceof Function&&Object.seal(t),t};return r},goog.defineClass.isUnsealable_=function(e){return e&&e.prototype&&e.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]},goog.defineClass.OBJECT_PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),goog.defineClass.applyProperties_=function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);for(var r=0;r<goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length;r++)n=goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[r],Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},goog.tagUnsealableClass=function(e){!COMPILED&&goog.defineClass.SEAL_CLASS_INSTANCES&&(e.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]=!0)},goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_="goog_defineClass_legacy_unsealable",!COMPILED&&goog.DEPENDENCIES_ENABLED&&(goog.inHtmlDocument_=function(){var e=goog.global.document;return null!=e&&"write"in e},goog.isDocumentLoading_=function(){var e=goog.global.document;return e.attachEvent?"complete"!=e.readyState:"loading"==e.readyState},goog.findBasePath_=function(){if(goog.isDef(goog.global.CLOSURE_BASE_PATH)&&goog.isString(goog.global.CLOSURE_BASE_PATH))goog.basePath=goog.global.CLOSURE_BASE_PATH;else if(goog.inHtmlDocument_()){var e=goog.global.document,t=e.currentScript;for(t=(e=t?[t]:e.getElementsByTagName("SCRIPT")).length-1;0<=t;--t){var n=e[t].src,r=n.lastIndexOf("?");if(r=-1==r?n.length:r,"base.js"==n.substr(r-7,7)){goog.basePath=n.substr(0,r-7);break}}}},goog.findBasePath_(),goog.Transpiler=function(){this.requiresTranspilation_=null,this.transpilationTarget_=goog.TRANSPILE_TO_LANGUAGE},goog.Transpiler.prototype.createRequiresTranspilation_=function(){function a(t,n){e?d[t]=!0:n()?(c=t,d[t]=!1):e=d[t]=!0}function b(a){try{return!!eval(a)}catch(e){return!1}}var c="es3",d={es3:!1},e=!1,f=goog.global.navigator&&goog.global.navigator.userAgent?goog.global.navigator.userAgent:"";return a("es5",(function(){return b("[1,].length==1")})),a("es6",(function(){return!f.match(/Edge\/(\d+)(\.\d)*/i)&&b('(()=>{"use strict";class X{constructor(){if(new.target!=String)throw 1;this.x=42}}let q=Reflect.construct(X,[],String);if(q.x!=42||!(q instanceof String))throw 1;for(const a of[2,3]){if(a==2)continue;function f(z={a}){let a=0;return z.a}{function f(){return 0;}}return f()==3}})()')})),a("es7",(function(){return b("2 ** 2 == 4")})),a("es8",(function(){return b("async () => 1, true")})),a("es9",(function(){return b("({...rest} = {}), true")})),a("es_next",(function(){return!1})),{target:c,map:d}},goog.Transpiler.prototype.needsTranspile=function(e,t){if("always"==goog.TRANSPILE)return!0;if("never"==goog.TRANSPILE)return!1;if(!this.requiresTranspilation_){var n=this.createRequiresTranspilation_();this.requiresTranspilation_=n.map,this.transpilationTarget_=this.transpilationTarget_||n.target}if(e in this.requiresTranspilation_)return!!this.requiresTranspilation_[e]||!(!goog.inHtmlDocument_()||"es6"!=t||"noModule"in goog.global.document.createElement("script"));throw Error("Unknown language mode: "+e)},goog.Transpiler.prototype.transpile=function(e,t){return goog.transpile_(e,t,this.transpilationTarget_)},goog.transpiler_=new goog.Transpiler,goog.protectScriptTag_=function(e){return e.replace(/<\/(SCRIPT)/gi,"\\x3c/$1")},goog.DebugLoader_=function(){this.dependencies_={},this.idToPath_={},this.written_={},this.loadingDeps_=[],this.depsToLoad_=[],this.paused_=!1,this.factory_=new goog.DependencyFactory(goog.transpiler_),this.deferredCallbacks_={},this.deferredQueue_=[]},goog.DebugLoader_.prototype.bootstrap=function(e,t){function n(){r&&(goog.global.setTimeout(r,0),r=null)}var r=t;if(e.length){t=[];for(var o=0;o<e.length;o++){var i=this.getPathFromDeps_(e[o]);if(!i)throw Error("Unregonized namespace: "+e[o]);t.push(this.dependencies_[i])}i=goog.require;var a=0;for(o=0;o<e.length;o++)i(e[o]),t[o].onLoad((function(){++a==e.length&&n()}))}else n()},goog.DebugLoader_.prototype.loadClosureDeps=function(){this.depsToLoad_.push(this.factory_.createDependency(goog.normalizePath_(goog.basePath+"deps.js"),"deps.js",[],[],{},!1)),this.loadDeps_()},goog.DebugLoader_.prototype.requested=function(e,t){(e=this.getPathFromDeps_(e))&&(t||this.areDepsLoaded_(this.dependencies_[e].requires))&&(t=this.deferredCallbacks_[e])&&(delete this.deferredCallbacks_[e],t())},goog.DebugLoader_.prototype.setDependencyFactory=function(e){this.factory_=e},goog.DebugLoader_.prototype.load_=function(e){if(!this.getPathFromDeps_(e))throw e="goog.require could not find: "+e,goog.logToConsole_(e),Error(e);var t=this,n=[],r=function(e){var o=t.getPathFromDeps_(e);if(!o)throw Error("Bad dependency path or symbol: "+e);if(!t.written_[o]){for(t.written_[o]=!0,e=t.dependencies_[o],o=0;o<e.requires.length;o++)goog.isProvided_(e.requires[o])||r(e.requires[o]);n.push(e)}};r(e),e=!!this.depsToLoad_.length,this.depsToLoad_=this.depsToLoad_.concat(n),this.paused_||e||this.loadDeps_()},goog.DebugLoader_.prototype.loadDeps_=function(){for(var e=this,t=this.paused_;this.depsToLoad_.length&&!t;)!function(){var n=!1,r=e.depsToLoad_.shift(),o=!1;e.loading_(r);var i={pause:function(){if(n)throw Error("Cannot call pause after the call to load.");t=!0},resume:function(){n?e.resume_():t=!1},loaded:function(){if(o)throw Error("Double call to loaded.");o=!0,e.loaded_(r)},pending:function(){for(var t=[],n=0;n<e.loadingDeps_.length;n++)t.push(e.loadingDeps_[n]);return t},setModuleState:function(e){goog.moduleLoaderState_={type:e,moduleName:"",declareLegacyNamespace:!1}},registerEs6ModuleExports:function(e,t,n){n&&(goog.loadedModules_[n]={exports:t,type:goog.ModuleType.ES6,moduleId:n||""})},registerGoogModuleExports:function(e,t){goog.loadedModules_[e]={exports:t,type:goog.ModuleType.GOOG,moduleId:e}},clearModuleState:function(){goog.moduleLoaderState_=null},defer:function(t){if(n)throw Error("Cannot register with defer after the call to load.");e.defer_(r,t)},areDepsLoaded:function(){return e.areDepsLoaded_(r.requires)}};try{r.load(i)}finally{n=!0}}();t&&this.pause_()},goog.DebugLoader_.prototype.pause_=function(){this.paused_=!0},goog.DebugLoader_.prototype.resume_=function(){this.paused_&&(this.paused_=!1,this.loadDeps_())},goog.DebugLoader_.prototype.loading_=function(e){this.loadingDeps_.push(e)},goog.DebugLoader_.prototype.loaded_=function(e){for(var t=0;t<this.loadingDeps_.length;t++)if(this.loadingDeps_[t]==e){this.loadingDeps_.splice(t,1);break}for(t=0;t<this.deferredQueue_.length;t++)if(this.deferredQueue_[t]==e.path){this.deferredQueue_.splice(t,1);break}if(this.loadingDeps_.length==this.deferredQueue_.length&&!this.depsToLoad_.length)for(;this.deferredQueue_.length;)this.requested(this.deferredQueue_.shift(),!0);e.loaded()},goog.DebugLoader_.prototype.areDepsLoaded_=function(e){for(var t=0;t<e.length;t++){var n=this.getPathFromDeps_(e[t]);if(!n||!(n in this.deferredCallbacks_)&&!goog.isProvided_(e[t]))return!1}return!0},goog.DebugLoader_.prototype.getPathFromDeps_=function(e){return e in this.idToPath_?this.idToPath_[e]:e in this.dependencies_?e:null},goog.DebugLoader_.prototype.defer_=function(e,t){this.deferredCallbacks_[e.path]=t,this.deferredQueue_.push(e.path)},goog.LoadController=function(){},goog.LoadController.prototype.pause=function(){},goog.LoadController.prototype.resume=function(){},goog.LoadController.prototype.loaded=function(){},goog.LoadController.prototype.pending=function(){},goog.LoadController.prototype.registerEs6ModuleExports=function(e,t,n){},goog.LoadController.prototype.setModuleState=function(e){},goog.LoadController.prototype.clearModuleState=function(){},goog.LoadController.prototype.defer=function(e){},goog.LoadController.prototype.areDepsLoaded=function(){},goog.Dependency=function(e,t,n,r,o){this.path=e,this.relativePath=t,this.provides=n,this.requires=r,this.loadFlags=o,this.loaded_=!1,this.loadCallbacks_=[]},goog.Dependency.prototype.getPathName=function(){var e=this.path,t=e.indexOf("://");return 0<=t&&(0<=(t=(e=e.substring(t+3)).indexOf("/"))&&(e=e.substring(t+1))),e},goog.Dependency.prototype.onLoad=function(e){this.loaded_?e():this.loadCallbacks_.push(e)},goog.Dependency.prototype.loaded=function(){this.loaded_=!0;var e=this.loadCallbacks_;this.loadCallbacks_=[];for(var t=0;t<e.length;t++)e[t]()},goog.Dependency.defer_=!1,goog.Dependency.callbackMap_={},goog.Dependency.registerCallback_=function(e){var t=Math.random().toString(32);return goog.Dependency.callbackMap_[t]=e,t},goog.Dependency.unregisterCallback_=function(e){delete goog.Dependency.callbackMap_[e]},goog.Dependency.callback_=function(e,t){if(!(e in goog.Dependency.callbackMap_))throw Error("Callback key "+e+" does not exist (was base.js loaded more than once?).");for(var n=goog.Dependency.callbackMap_[e],r=[],o=1;o<arguments.length;o++)r.push(arguments[o]);n.apply(void 0,r)},goog.Dependency.prototype.load=function(e){if(goog.global.CLOSURE_IMPORT_SCRIPT)goog.global.CLOSURE_IMPORT_SCRIPT(this.path)?e.loaded():e.pause();else if(goog.inHtmlDocument_()){var t=goog.global.document;if("complete"==t.readyState&&!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING){if(/\bdeps.js$/.test(this.path))return void e.loaded();throw Error('Cannot write "'+this.path+'" after document load')}if(!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING&&goog.isDocumentLoading_()){var n=goog.Dependency.registerCallback_((function(t){goog.DebugLoader_.IS_OLD_IE_&&"complete"!=t.readyState||(goog.Dependency.unregisterCallback_(n),e.loaded())})),r=!goog.DebugLoader_.IS_OLD_IE_&&goog.getScriptNonce()?' nonce="'+goog.getScriptNonce()+'"':"";r='<script src="'+this.path+'" '+(goog.DebugLoader_.IS_OLD_IE_?"onreadystatechange":"onload")+"=\"goog.Dependency.callback_('"+n+'\', this)" type="text/javascript" '+(goog.Dependency.defer_?"defer":"")+r+"><\/script>",t.write(goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createHTML(r):r)}else{var o=t.createElement("script");o.defer=goog.Dependency.defer_,o.async=!1,o.type="text/javascript",(r=goog.getScriptNonce())&&o.setAttribute("nonce",r),goog.DebugLoader_.IS_OLD_IE_?(e.pause(),o.onreadystatechange=function(){"loaded"!=o.readyState&&"complete"!=o.readyState||(e.loaded(),e.resume())}):o.onload=function(){o.onload=null,e.loaded()},o.src=goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createScriptURL(this.path):this.path,t.head.appendChild(o)}}else goog.logToConsole_("Cannot use default debug loader outside of HTML documents."),"deps.js"==this.relativePath?(goog.logToConsole_("Consider setting CLOSURE_IMPORT_SCRIPT before loading base.js, or setting CLOSURE_NO_DEPS to true."),e.loaded()):e.pause()},goog.Es6ModuleDependency=function(e,t,n,r,o){goog.Dependency.call(this,e,t,n,r,o)},goog.inherits(goog.Es6ModuleDependency,goog.Dependency),goog.Es6ModuleDependency.prototype.load=function(e){if(goog.global.CLOSURE_IMPORT_SCRIPT)goog.global.CLOSURE_IMPORT_SCRIPT(this.path)?e.loaded():e.pause();else if(goog.inHtmlDocument_()){var t=goog.global.document,n=this;if(goog.isDocumentLoading_()){var r=function(e,n){e=n?'<script type="module" crossorigin>'+n+"<\/script>":'<script type="module" crossorigin src="'+e+'"><\/script>',t.write(goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createHTML(e):e)};goog.Dependency.defer_=!0}else r=function(e,n){var r=t.createElement("script");r.defer=!0,r.async=!1,r.type="module",r.setAttribute("crossorigin",!0);var o=goog.getScriptNonce();o&&r.setAttribute("nonce",o),n?r.textContent=goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createScript(n):n:r.src=goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createScriptURL(e):e,t.head.appendChild(r)};var o=goog.Dependency.registerCallback_((function(){goog.Dependency.unregisterCallback_(o),e.setModuleState(goog.ModuleType.ES6)}));r(void 0,'goog.Dependency.callback_("'+o+'")'),r(this.path,void 0);var i=goog.Dependency.registerCallback_((function(t){goog.Dependency.unregisterCallback_(i),e.registerEs6ModuleExports(n.path,t,goog.moduleLoaderState_.moduleName)}));r(void 0,'import * as m from "'+this.path+'"; goog.Dependency.callback_("'+i+'", m)');var a=goog.Dependency.registerCallback_((function(){goog.Dependency.unregisterCallback_(a),e.clearModuleState(),e.loaded()}));r(void 0,'goog.Dependency.callback_("'+a+'")')}else goog.logToConsole_("Cannot use default debug loader outside of HTML documents."),e.pause()},goog.TransformedDependency=function(e,t,n,r,o){goog.Dependency.call(this,e,t,n,r,o),this.contents_=null,this.lazyFetch_=!goog.inHtmlDocument_()||!("noModule"in goog.global.document.createElement("script"))},goog.inherits(goog.TransformedDependency,goog.Dependency),goog.TransformedDependency.prototype.load=function(e){function t(){r.contents_=goog.loadFileSync_(r.path),r.contents_&&(r.contents_=r.transform(r.contents_),r.contents_&&(r.contents_+="\n//# sourceURL="+r.path))}function n(){if(r.lazyFetch_&&t(),r.contents_){o&&e.setModuleState(goog.ModuleType.ES6);try{var n=r.contents_;if(r.contents_=null,goog.globalEval(n),o)var i=goog.moduleLoaderState_.moduleName}finally{o&&e.clearModuleState()}o&&goog.global.$jscomp.require.ensure([r.getPathName()],(function(){e.registerEs6ModuleExports(r.path,goog.global.$jscomp.require(r.getPathName()),i)})),e.loaded()}}var r=this;if(goog.global.CLOSURE_IMPORT_SCRIPT)t(),this.contents_&&goog.global.CLOSURE_IMPORT_SCRIPT("",this.contents_)?(this.contents_=null,e.loaded()):e.pause();else{var o=this.loadFlags.module==goog.ModuleType.ES6;this.lazyFetch_||t();var i=1<e.pending().length,a=i&&goog.DebugLoader_.IS_OLD_IE_;if(i=goog.Dependency.defer_&&(i||goog.isDocumentLoading_()),a||i)e.defer((function(){n()}));else{var s=goog.global.document;if(a=goog.inHtmlDocument_()&&"ActiveXObject"in goog.global,o&&goog.inHtmlDocument_()&&goog.isDocumentLoading_()&&!a){goog.Dependency.defer_=!0,e.pause();var l=s.onreadystatechange;s.onreadystatechange=function(){"interactive"==s.readyState&&(s.onreadystatechange=l,n(),e.resume()),goog.isFunction(l)&&l.apply(void 0,arguments)}}else!goog.DebugLoader_.IS_OLD_IE_&&goog.inHtmlDocument_()&&goog.isDocumentLoading_()?function(){var e=goog.global.document,t=goog.Dependency.registerCallback_((function(){goog.Dependency.unregisterCallback_(t),n()})),r='<script type="text/javascript">'+goog.protectScriptTag_('goog.Dependency.callback_("'+t+'");')+"<\/script>";e.write(goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createHTML(r):r)}():n()}}},goog.TransformedDependency.prototype.transform=function(e){},goog.TranspiledDependency=function(e,t,n,r,o,i){goog.TransformedDependency.call(this,e,t,n,r,o),this.transpiler=i},goog.inherits(goog.TranspiledDependency,goog.TransformedDependency),goog.TranspiledDependency.prototype.transform=function(e){return this.transpiler.transpile(e,this.getPathName())},goog.PreTranspiledEs6ModuleDependency=function(e,t,n,r,o){goog.TransformedDependency.call(this,e,t,n,r,o)},goog.inherits(goog.PreTranspiledEs6ModuleDependency,goog.TransformedDependency),goog.PreTranspiledEs6ModuleDependency.prototype.transform=function(e){return e},goog.GoogModuleDependency=function(e,t,n,r,o,i,a){goog.TransformedDependency.call(this,e,t,n,r,o),this.needsTranspile_=i,this.transpiler_=a},goog.inherits(goog.GoogModuleDependency,goog.TransformedDependency),goog.GoogModuleDependency.prototype.transform=function(e){return this.needsTranspile_&&(e=this.transpiler_.transpile(e,this.getPathName())),goog.LOAD_MODULE_USING_EVAL&&goog.isDef(goog.global.JSON)?"goog.loadModule("+goog.global.JSON.stringify(e+"\n//# sourceURL="+this.path+"\n")+");":'goog.loadModule(function(exports) {"use strict";'+e+"\n;return exports});\n//# sourceURL="+this.path+"\n"},goog.DebugLoader_.IS_OLD_IE_=!(goog.global.atob||!goog.global.document||!goog.global.document.all),goog.DebugLoader_.prototype.addDependency=function(e,t,n,r){t=t||[],e=e.replace(/\\/g,"/");var o=goog.normalizePath_(goog.basePath+e);for(r&&"boolean"!=typeof r||(r=r?{module:goog.ModuleType.GOOG}:{}),n=this.factory_.createDependency(o,e,t,n,r,goog.transpiler_.needsTranspile(r.lang||"es3",r.module)),this.dependencies_[o]=n,n=0;n<t.length;n++)this.idToPath_[t[n]]=o;this.idToPath_[e]=o},goog.DependencyFactory=function(e){this.transpiler=e},goog.DependencyFactory.prototype.createDependency=function(e,t,n,r,o,i){return o.module==goog.ModuleType.GOOG?new goog.GoogModuleDependency(e,t,n,r,o,i,this.transpiler):i?new goog.TranspiledDependency(e,t,n,r,o,this.transpiler):o.module==goog.ModuleType.ES6?"never"==goog.TRANSPILE&&goog.ASSUME_ES_MODULES_TRANSPILED?new goog.PreTranspiledEs6ModuleDependency(e,t,n,r,o):new goog.Es6ModuleDependency(e,t,n,r,o):new goog.Dependency(e,t,n,r,o)},goog.debugLoader_=new goog.DebugLoader_,goog.loadClosureDeps=function(){goog.debugLoader_.loadClosureDeps()},goog.setDependencyFactory=function(e){goog.debugLoader_.setDependencyFactory(e)},goog.global.CLOSURE_NO_DEPS||goog.debugLoader_.loadClosureDeps(),goog.bootstrap=function(e,t){goog.debugLoader_.bootstrap(e,t)}),goog.TRUSTED_TYPES_POLICY_NAME="",goog.identity_=function(e){return e},goog.createTrustedTypesPolicy=function(e){var t=null;if("undefined"==typeof TrustedTypes||!TrustedTypes.createPolicy)return t;try{t=TrustedTypes.createPolicy(e,{createHTML:goog.identity_,createScript:goog.identity_,createScriptURL:goog.identity_,createURL:goog.identity_})}catch(e){goog.logToConsole_(e.message)}return t},goog.TRUSTED_TYPES_POLICY_=goog.TRUSTED_TYPES_POLICY_NAME?goog.createTrustedTypesPolicy(goog.TRUSTED_TYPES_POLICY_NAME+"#base"):null,goog.object={},goog.object.is=function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},goog.object.forEach=function(e,t,n){for(var r in e)t.call(n,e[r],r,e)},goog.object.filter=function(e,t,n){var r,o={};for(r in e)t.call(n,e[r],r,e)&&(o[r]=e[r]);return o},goog.object.map=function(e,t,n){var r,o={};for(r in e)o[r]=t.call(n,e[r],r,e);return o},goog.object.some=function(e,t,n){for(var r in e)if(t.call(n,e[r],r,e))return!0;return!1},goog.object.every=function(e,t,n){for(var r in e)if(!t.call(n,e[r],r,e))return!1;return!0},goog.object.getCount=function(e){var t,n=0;for(t in e)n++;return n},goog.object.getAnyKey=function(e){for(var t in e)return t},goog.object.getAnyValue=function(e){for(var t in e)return e[t]},goog.object.contains=function(e,t){return goog.object.containsValue(e,t)},goog.object.getValues=function(e){var t,n=[],r=0;for(t in e)n[r++]=e[t];return n},goog.object.getKeys=function(e){var t,n=[],r=0;for(t in e)n[r++]=t;return n},goog.object.getValueByKeys=function(e,t){var n=goog.isArrayLike(t),r=n?t:arguments;for(n=n?0:1;n<r.length;n++){if(null==e)return;e=e[r[n]]}return e},goog.object.containsKey=function(e,t){return null!==e&&t in e},goog.object.containsValue=function(e,t){for(var n in e)if(e[n]==t)return!0;return!1},goog.object.findKey=function(e,t,n){for(var r in e)if(t.call(n,e[r],r,e))return r},goog.object.findValue=function(e,t,n){return(t=goog.object.findKey(e,t,n))&&e[t]},goog.object.isEmpty=function(e){for(var t in e)return!1;return!0},goog.object.clear=function(e){for(var t in e)delete e[t]},goog.object.remove=function(e,t){var n;return(n=t in e)&&delete e[t],n},goog.object.add=function(e,t,n){if(null!==e&&t in e)throw Error('The object already contains the key "'+t+'"');goog.object.set(e,t,n)},goog.object.get=function(e,t,n){return null!==e&&t in e?e[t]:n},goog.object.set=function(e,t,n){e[t]=n},goog.object.setIfUndefined=function(e,t,n){return t in e?e[t]:e[t]=n},goog.object.setWithReturnValueIfNotSet=function(e,t,n){return t in e?e[t]:(n=n(),e[t]=n)},goog.object.equals=function(e,t){for(var n in e)if(!(n in t)||e[n]!==t[n])return!1;for(var r in t)if(!(r in e))return!1;return!0},goog.object.clone=function(e){var t,n={};for(t in e)n[t]=e[t];return n},goog.object.unsafeClone=function(e){var t=goog.typeOf(e);if("object"==t||"array"==t){if(goog.isFunction(e.clone))return e.clone();for(var n in t="array"==t?[]:{},e)t[n]=goog.object.unsafeClone(e[n]);return t}return e},goog.object.transpose=function(e){var t,n={};for(t in e)n[e[t]]=t;return n},goog.object.PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),goog.object.extend=function(e,t){for(var n,r,o=1;o<arguments.length;o++){for(n in r=arguments[o])e[n]=r[n];for(var i=0;i<goog.object.PROTOTYPE_FIELDS_.length;i++)n=goog.object.PROTOTYPE_FIELDS_[i],Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}},goog.object.create=function(e){var t=arguments.length;if(1==t&&goog.isArray(arguments[0]))return goog.object.create.apply(null,arguments[0]);if(t%2)throw Error("Uneven number of arguments");for(var n={},r=0;r<t;r+=2)n[arguments[r]]=arguments[r+1];return n},goog.object.createSet=function(e){var t=arguments.length;if(1==t&&goog.isArray(arguments[0]))return goog.object.createSet.apply(null,arguments[0]);for(var n={},r=0;r<t;r++)n[arguments[r]]=!0;return n},goog.object.createImmutableView=function(e){var t=e;return Object.isFrozen&&!Object.isFrozen(e)&&(t=Object.create(e),Object.freeze(t)),t},goog.object.isImmutableView=function(e){return!!Object.isFrozen&&Object.isFrozen(e)},goog.object.getAllPropertyNames=function(e,t,n){if(!e)return[];if(!Object.getOwnPropertyNames||!Object.getPrototypeOf)return goog.object.getKeys(e);for(var r={};e&&(e!==Object.prototype||t)&&(e!==Function.prototype||n);){for(var o=Object.getOwnPropertyNames(e),i=0;i<o.length;i++)r[o[i]]=!0;e=Object.getPrototypeOf(e)}return goog.object.getKeys(r)},goog.object.getSuperClass=function(e){return(e=Object.getPrototypeOf(e.prototype))&&e.constructor},goog.debug={},goog.debug.Error=function(e){if(Error.captureStackTrace)Error.captureStackTrace(this,goog.debug.Error);else{var t=Error().stack;t&&(this.stack=t)}e&&(this.message=String(e)),this.reportErrorToServer=!0},goog.inherits(goog.debug.Error,Error),goog.debug.Error.prototype.name="CustomError",goog.dom={},goog.dom.NodeType={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12},goog.asserts={},goog.asserts.ENABLE_ASSERTS=goog.DEBUG,goog.asserts.AssertionError=function(e,t){goog.debug.Error.call(this,goog.asserts.subs_(e,t)),this.messagePattern=e},goog.inherits(goog.asserts.AssertionError,goog.debug.Error),goog.asserts.AssertionError.prototype.name="AssertionError",goog.asserts.DEFAULT_ERROR_HANDLER=function(e){throw e},goog.asserts.errorHandler_=goog.asserts.DEFAULT_ERROR_HANDLER,goog.asserts.subs_=function(e,t){for(var n="",r=(e=e.split("%s")).length-1,o=0;o<r;o++)n+=e[o]+(o<t.length?t[o]:"%s");return n+e[r]},goog.asserts.doAssertFailure_=function(e,t,n,r){var o="Assertion failed";if(n){o+=": "+n;var i=r}else e&&(o+=": "+e,i=t);e=new goog.asserts.AssertionError(""+o,i||[]),goog.asserts.errorHandler_(e)},goog.asserts.setErrorHandler=function(e){goog.asserts.ENABLE_ASSERTS&&(goog.asserts.errorHandler_=e)},goog.asserts.assert=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!e&&goog.asserts.doAssertFailure_("",null,t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertExists=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&null==e&&goog.asserts.doAssertFailure_("Expected to exist: %s.",[e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.fail=function(e,t){goog.asserts.ENABLE_ASSERTS&&goog.asserts.errorHandler_(new goog.asserts.AssertionError("Failure"+(e?": "+e:""),Array.prototype.slice.call(arguments,1)))},goog.asserts.assertNumber=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isNumber(e)&&goog.asserts.doAssertFailure_("Expected number but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertString=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isString(e)&&goog.asserts.doAssertFailure_("Expected string but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertFunction=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isFunction(e)&&goog.asserts.doAssertFailure_("Expected function but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertObject=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isObject(e)&&goog.asserts.doAssertFailure_("Expected object but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertArray=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isArray(e)&&goog.asserts.doAssertFailure_("Expected array but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertBoolean=function(e,t,n){return goog.asserts.ENABLE_ASSERTS&&!goog.isBoolean(e)&&goog.asserts.doAssertFailure_("Expected boolean but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertElement=function(e,t,n){return!goog.asserts.ENABLE_ASSERTS||goog.isObject(e)&&e.nodeType==goog.dom.NodeType.ELEMENT||goog.asserts.doAssertFailure_("Expected Element but got %s: %s.",[goog.typeOf(e),e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertInstanceof=function(e,t,n,r){return!goog.asserts.ENABLE_ASSERTS||e instanceof t||goog.asserts.doAssertFailure_("Expected instanceof %s but got %s.",[goog.asserts.getType_(t),goog.asserts.getType_(e)],n,Array.prototype.slice.call(arguments,3)),e},goog.asserts.assertFinite=function(e,t,n){return!goog.asserts.ENABLE_ASSERTS||"number"==typeof e&&isFinite(e)||goog.asserts.doAssertFailure_("Expected %s to be a finite number but it is not.",[e],t,Array.prototype.slice.call(arguments,2)),e},goog.asserts.assertObjectPrototypeIsIntact=function(){for(var e in Object.prototype)goog.asserts.fail(e+" should not be enumerable in Object.prototype.")},goog.asserts.getType_=function(e){return e instanceof Function?e.displayName||e.name||"unknown type name":e instanceof Object?e.constructor.displayName||e.constructor.name||Object.prototype.toString.call(e):null===e?"null":typeof e};var jspb={BinaryConstants:{},ConstBinaryMessage:function(){},BinaryMessage:function(){}};jspb.BinaryConstants.FieldType={INVALID:-1,DOUBLE:1,FLOAT:2,INT64:3,UINT64:4,INT32:5,FIXED64:6,FIXED32:7,BOOL:8,STRING:9,GROUP:10,MESSAGE:11,BYTES:12,UINT32:13,ENUM:14,SFIXED32:15,SFIXED64:16,SINT32:17,SINT64:18,FHASH64:30,VHASH64:31},jspb.BinaryConstants.WireType={INVALID:-1,VARINT:0,FIXED64:1,DELIMITED:2,START_GROUP:3,END_GROUP:4,FIXED32:5},jspb.BinaryConstants.FieldTypeToWireType=function(e){var t=jspb.BinaryConstants.FieldType,n=jspb.BinaryConstants.WireType;switch(e){case t.INT32:case t.INT64:case t.UINT32:case t.UINT64:case t.SINT32:case t.SINT64:case t.BOOL:case t.ENUM:case t.VHASH64:return n.VARINT;case t.DOUBLE:case t.FIXED64:case t.SFIXED64:case t.FHASH64:return n.FIXED64;case t.STRING:case t.MESSAGE:case t.BYTES:return n.DELIMITED;case t.FLOAT:case t.FIXED32:case t.SFIXED32:return n.FIXED32;default:return n.INVALID}},jspb.BinaryConstants.INVALID_FIELD_NUMBER=-1,jspb.BinaryConstants.FLOAT32_EPS=1401298464324817e-60,jspb.BinaryConstants.FLOAT32_MIN=11754943508222875e-54,jspb.BinaryConstants.FLOAT32_MAX=34028234663852886e22,jspb.BinaryConstants.FLOAT64_EPS=5e-324,jspb.BinaryConstants.FLOAT64_MIN=22250738585072014e-324,jspb.BinaryConstants.FLOAT64_MAX=17976931348623157e292,jspb.BinaryConstants.TWO_TO_20=1048576,jspb.BinaryConstants.TWO_TO_23=8388608,jspb.BinaryConstants.TWO_TO_31=2147483648,jspb.BinaryConstants.TWO_TO_32=4294967296,jspb.BinaryConstants.TWO_TO_52=4503599627370496,jspb.BinaryConstants.TWO_TO_63=0x8000000000000000,jspb.BinaryConstants.TWO_TO_64=0x10000000000000000,jspb.BinaryConstants.ZERO_HASH="\0\0\0\0\0\0\0\0",goog.array={},goog.NATIVE_ARRAY_PROTOTYPES=goog.TRUSTED_SITE,goog.array.ASSUME_NATIVE_FUNCTIONS=2012<goog.FEATURESET_YEAR,goog.array.peek=function(e){return e[e.length-1]},goog.array.last=goog.array.peek,goog.array.indexOf=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.indexOf)?function(e,t,n){return goog.asserts.assert(null!=e.length),Array.prototype.indexOf.call(e,t,n)}:function(e,t,n){if(n=null==n?0:0>n?Math.max(0,e.length+n):n,goog.isString(e))return goog.isString(t)&&1==t.length?e.indexOf(t,n):-1;for(;n<e.length;n++)if(n in e&&e[n]===t)return n;return-1},goog.array.lastIndexOf=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.lastIndexOf)?function(e,t,n){return goog.asserts.assert(null!=e.length),Array.prototype.lastIndexOf.call(e,t,null==n?e.length-1:n)}:function(e,t,n){if(0>(n=null==n?e.length-1:n)&&(n=Math.max(0,e.length+n)),goog.isString(e))return goog.isString(t)&&1==t.length?e.lastIndexOf(t,n):-1;for(;0<=n;n--)if(n in e&&e[n]===t)return n;return-1},goog.array.forEach=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.forEach)?function(e,t,n){goog.asserts.assert(null!=e.length),Array.prototype.forEach.call(e,t,n)}:function(e,t,n){for(var r=e.length,o=goog.isString(e)?e.split(""):e,i=0;i<r;i++)i in o&&t.call(n,o[i],i,e)},goog.array.forEachRight=function(e,t,n){var r=e.length,o=goog.isString(e)?e.split(""):e;for(--r;0<=r;--r)r in o&&t.call(n,o[r],r,e)},goog.array.filter=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.filter)?function(e,t,n){return goog.asserts.assert(null!=e.length),Array.prototype.filter.call(e,t,n)}:function(e,t,n){for(var r=e.length,o=[],i=0,a=goog.isString(e)?e.split(""):e,s=0;s<r;s++)if(s in a){var l=a[s];t.call(n,l,s,e)&&(o[i++]=l)}return o},goog.array.map=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.map)?function(e,t,n){return goog.asserts.assert(null!=e.length),Array.prototype.map.call(e,t,n)}:function(e,t,n){for(var r=e.length,o=Array(r),i=goog.isString(e)?e.split(""):e,a=0;a<r;a++)a in i&&(o[a]=t.call(n,i[a],a,e));return o},goog.array.reduce=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.reduce)?function(e,t,n,r){return goog.asserts.assert(null!=e.length),r&&(t=goog.bind(t,r)),Array.prototype.reduce.call(e,t,n)}:function(e,t,n,r){var o=n;return goog.array.forEach(e,(function(n,i){o=t.call(r,o,n,i,e)})),o},goog.array.reduceRight=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.reduceRight)?function(e,t,n,r){return goog.asserts.assert(null!=e.length),goog.asserts.assert(null!=t),r&&(t=goog.bind(t,r)),Array.prototype.reduceRight.call(e,t,n)}:function(e,t,n,r){var o=n;return goog.array.forEachRight(e,(function(n,i){o=t.call(r,o,n,i,e)})),o},goog.array.some=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.some)?function(e,t,n){return goog.asserts.assert(null!=e.length),Array.prototype.some.call(e,t,n)}:function(e,t,n){for(var r=e.length,o=goog.isString(e)?e.split(""):e,i=0;i<r;i++)if(i in o&&t.call(n,o[i],i,e))return!0;return!1},goog.array.every=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.every)?function(e,t,n){return goog.asserts.assert(null!=e.length),Array.prototype.every.call(e,t,n)}:function(e,t,n){for(var r=e.length,o=goog.isString(e)?e.split(""):e,i=0;i<r;i++)if(i in o&&!t.call(n,o[i],i,e))return!1;return!0},goog.array.count=function(e,t,n){var r=0;return goog.array.forEach(e,(function(e,o,i){t.call(n,e,o,i)&&++r}),n),r},goog.array.find=function(e,t,n){return 0>(t=goog.array.findIndex(e,t,n))?null:goog.isString(e)?e.charAt(t):e[t]},goog.array.findIndex=function(e,t,n){for(var r=e.length,o=goog.isString(e)?e.split(""):e,i=0;i<r;i++)if(i in o&&t.call(n,o[i],i,e))return i;return-1},goog.array.findRight=function(e,t,n){return 0>(t=goog.array.findIndexRight(e,t,n))?null:goog.isString(e)?e.charAt(t):e[t]},goog.array.findIndexRight=function(e,t,n){var r=e.length,o=goog.isString(e)?e.split(""):e;for(--r;0<=r;r--)if(r in o&&t.call(n,o[r],r,e))return r;return-1},goog.array.contains=function(e,t){return 0<=goog.array.indexOf(e,t)},goog.array.isEmpty=function(e){return 0==e.length},goog.array.clear=function(e){if(!goog.isArray(e))for(var t=e.length-1;0<=t;t--)delete e[t];e.length=0},goog.array.insert=function(e,t){goog.array.contains(e,t)||e.push(t)},goog.array.insertAt=function(e,t,n){goog.array.splice(e,n,0,t)},goog.array.insertArrayAt=function(e,t,n){goog.partial(goog.array.splice,e,n,0).apply(null,t)},goog.array.insertBefore=function(e,t,n){var r;2==arguments.length||0>(r=goog.array.indexOf(e,n))?e.push(t):goog.array.insertAt(e,t,r)},goog.array.remove=function(e,t){var n;return(n=0<=(t=goog.array.indexOf(e,t)))&&goog.array.removeAt(e,t),n},goog.array.removeLast=function(e,t){return 0<=(t=goog.array.lastIndexOf(e,t))&&(goog.array.removeAt(e,t),!0)},goog.array.removeAt=function(e,t){return goog.asserts.assert(null!=e.length),1==Array.prototype.splice.call(e,t,1).length},goog.array.removeIf=function(e,t,n){return 0<=(t=goog.array.findIndex(e,t,n))&&(goog.array.removeAt(e,t),!0)},goog.array.removeAllIf=function(e,t,n){var r=0;return goog.array.forEachRight(e,(function(o,i){t.call(n,o,i,e)&&goog.array.removeAt(e,i)&&r++})),r},goog.array.concat=function(e){return Array.prototype.concat.apply([],arguments)},goog.array.join=function(e){return Array.prototype.concat.apply([],arguments)},goog.array.toArray=function(e){var t=e.length;if(0<t){for(var n=Array(t),r=0;r<t;r++)n[r]=e[r];return n}return[]},goog.array.clone=goog.array.toArray,goog.array.extend=function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(goog.isArrayLike(r)){var o=e.length||0,i=r.length||0;e.length=o+i;for(var a=0;a<i;a++)e[o+a]=r[a]}else e.push(r)}},goog.array.splice=function(e,t,n,r){return goog.asserts.assert(null!=e.length),Array.prototype.splice.apply(e,goog.array.slice(arguments,1))},goog.array.slice=function(e,t,n){return goog.asserts.assert(null!=e.length),2>=arguments.length?Array.prototype.slice.call(e,t):Array.prototype.slice.call(e,t,n)},goog.array.removeDuplicates=function(e,t,n){t=t||e;var r=function(e){return goog.isObject(e)?"o"+goog.getUid(e):(typeof e).charAt(0)+e};n=n||r,r={};for(var o=0,i=0;i<e.length;){var a=e[i++],s=n(a);Object.prototype.hasOwnProperty.call(r,s)||(r[s]=!0,t[o++]=a)}t.length=o},goog.array.binarySearch=function(e,t,n){return goog.array.binarySearch_(e,n||goog.array.defaultCompare,!1,t)},goog.array.binarySelect=function(e,t,n){return goog.array.binarySearch_(e,t,!0,void 0,n)},goog.array.binarySearch_=function(e,t,n,r,o){for(var i,a=0,s=e.length;a<s;){var l=a+s>>1,u=n?t.call(o,e[l],l,e):t(r,e[l]);0<u?a=l+1:(s=l,i=!u)}return i?a:~a},goog.array.sort=function(e,t){e.sort(t||goog.array.defaultCompare)},goog.array.stableSort=function(e,t){for(var n=Array(e.length),r=0;r<e.length;r++)n[r]={index:r,value:e[r]};var o=t||goog.array.defaultCompare;for(goog.array.sort(n,(function(e,t){return o(e.value,t.value)||e.index-t.index})),r=0;r<e.length;r++)e[r]=n[r].value},goog.array.sortByKey=function(e,t,n){var r=n||goog.array.defaultCompare;goog.array.sort(e,(function(e,n){return r(t(e),t(n))}))},goog.array.sortObjectsByKey=function(e,t,n){goog.array.sortByKey(e,(function(e){return e[t]}),n)},goog.array.isSorted=function(e,t,n){t=t||goog.array.defaultCompare;for(var r=1;r<e.length;r++){var o=t(e[r-1],e[r]);if(0<o||0==o&&n)return!1}return!0},goog.array.equals=function(e,t,n){if(!goog.isArrayLike(e)||!goog.isArrayLike(t)||e.length!=t.length)return!1;var r=e.length;n=n||goog.array.defaultCompareEquality;for(var o=0;o<r;o++)if(!n(e[o],t[o]))return!1;return!0},goog.array.compare3=function(e,t,n){n=n||goog.array.defaultCompare;for(var r=Math.min(e.length,t.length),o=0;o<r;o++){var i=n(e[o],t[o]);if(0!=i)return i}return goog.array.defaultCompare(e.length,t.length)},goog.array.defaultCompare=function(e,t){return e>t?1:e<t?-1:0},goog.array.inverseDefaultCompare=function(e,t){return-goog.array.defaultCompare(e,t)},goog.array.defaultCompareEquality=function(e,t){return e===t},goog.array.binaryInsert=function(e,t,n){return 0>(n=goog.array.binarySearch(e,t,n))&&(goog.array.insertAt(e,t,-(n+1)),!0)},goog.array.binaryRemove=function(e,t,n){return 0<=(t=goog.array.binarySearch(e,t,n))&&goog.array.removeAt(e,t)},goog.array.bucket=function(e,t,n){for(var r={},o=0;o<e.length;o++){var i=e[o],a=t.call(n,i,o,e);goog.isDef(a)&&(r[a]||(r[a]=[])).push(i)}return r},goog.array.toObject=function(e,t,n){var r={};return goog.array.forEach(e,(function(o,i){r[t.call(n,o,i,e)]=o})),r},goog.array.range=function(e,t,n){var r=[],o=0,i=e;if(void 0!==t&&(o=e,i=t),0>(n=n||1)*(i-o))return[];if(0<n)for(e=o;e<i;e+=n)r.push(e);else for(e=o;e>i;e+=n)r.push(e);return r},goog.array.repeat=function(e,t){for(var n=[],r=0;r<t;r++)n[r]=e;return n},goog.array.flatten=function(e){for(var t=[],n=0;n<arguments.length;n++){var r=arguments[n];if(goog.isArray(r))for(var o=0;o<r.length;o+=8192){var i=goog.array.slice(r,o,o+8192);i=goog.array.flatten.apply(null,i);for(var a=0;a<i.length;a++)t.push(i[a])}else t.push(r)}return t},goog.array.rotate=function(e,t){return goog.asserts.assert(null!=e.length),e.length&&(0<(t%=e.length)?Array.prototype.unshift.apply(e,e.splice(-t,t)):0>t&&Array.prototype.push.apply(e,e.splice(0,-t))),e},goog.array.moveItem=function(e,t,n){goog.asserts.assert(0<=t&&t<e.length),goog.asserts.assert(0<=n&&n<e.length),t=Array.prototype.splice.call(e,t,1),Array.prototype.splice.call(e,n,0,t[0])},goog.array.zip=function(e){if(!arguments.length)return[];for(var t=[],n=arguments[0].length,r=1;r<arguments.length;r++)arguments[r].length<n&&(n=arguments[r].length);for(r=0;r<n;r++){for(var o=[],i=0;i<arguments.length;i++)o.push(arguments[i][r]);t.push(o)}return t},goog.array.shuffle=function(e,t){t=t||Math.random;for(var n=e.length-1;0<n;n--){var r=Math.floor(t()*(n+1)),o=e[n];e[n]=e[r],e[r]=o}},goog.array.copyByIndex=function(e,t){var n=[];return goog.array.forEach(t,(function(t){n.push(e[t])})),n},goog.array.concatMap=function(e,t,n){return goog.array.concat.apply([],goog.array.map(e,t,n))},goog.crypt={},goog.crypt.stringToByteArray=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var o=e.charCodeAt(r);255<o&&(t[n++]=255&o,o>>=8),t[n++]=o}return t},goog.crypt.byteArrayToString=function(e){if(8192>=e.length)return String.fromCharCode.apply(null,e);for(var t="",n=0;n<e.length;n+=8192){var r=goog.array.slice(e,n,n+8192);t+=String.fromCharCode.apply(null,r)}return t},goog.crypt.byteArrayToHex=function(e,t){return goog.array.map(e,(function(e){return 1<(e=e.toString(16)).length?e:"0"+e})).join(t||"")},goog.crypt.hexToByteArray=function(e){goog.asserts.assert(0==e.length%2,"Key string length must be multiple of 2");for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substring(n,n+2),16));return t},goog.crypt.stringToUtf8ByteArray=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var o=e.charCodeAt(r);128>o?t[n++]=o:(2048>o?t[n++]=o>>6|192:(55296==(64512&o)&&r+1<e.length&&56320==(64512&e.charCodeAt(r+1))?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++r)),t[n++]=o>>18|240,t[n++]=o>>12&63|128):t[n++]=o>>12|224,t[n++]=o>>6&63|128),t[n++]=63&o|128)}return t},goog.crypt.utf8ByteArrayToString=function(e){for(var t=[],n=0,r=0;n<e.length;){var o=e[n++];if(128>o)t[r++]=String.fromCharCode(o);else if(191<o&&224>o){var i=e[n++];t[r++]=String.fromCharCode((31&o)<<6|63&i)}else if(239<o&&365>o){i=e[n++];var a=e[n++];o=((7&o)<<18|(63&i)<<12|(63&a)<<6|63&e[n++])-65536,t[r++]=String.fromCharCode(55296+(o>>10)),t[r++]=String.fromCharCode(56320+(1023&o))}else i=e[n++],a=e[n++],t[r++]=String.fromCharCode((15&o)<<12|(63&i)<<6|63&a)}return t.join("")},goog.crypt.xorByteArray=function(e,t){goog.asserts.assert(e.length==t.length,"XOR array lengths must match");for(var n=[],r=0;r<e.length;r++)n.push(e[r]^t[r]);return n},goog.dom.asserts={},goog.dom.asserts.assertIsLocation=function(e){if(goog.asserts.ENABLE_ASSERTS){var t=goog.dom.asserts.getWindow_(e);t&&(!e||!(e instanceof t.Location)&&e instanceof t.Element)&&goog.asserts.fail("Argument is not a Location (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_(e))}return e},goog.dom.asserts.assertIsElementType_=function(e,t){if(goog.asserts.ENABLE_ASSERTS){var n=goog.dom.asserts.getWindow_(e);n&&void 0!==n[t]&&(e&&(e instanceof n[t]||!(e instanceof n.Location||e instanceof n.Element))||goog.asserts.fail("Argument is not a %s (or a non-Element, non-Location mock); got: %s",t,goog.dom.asserts.debugStringForType_(e)))}return e},goog.dom.asserts.assertIsHTMLAnchorElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLAnchorElement")},goog.dom.asserts.assertIsHTMLButtonElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLButtonElement")},goog.dom.asserts.assertIsHTMLLinkElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLLinkElement")},goog.dom.asserts.assertIsHTMLImageElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLImageElement")},goog.dom.asserts.assertIsHTMLAudioElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLAudioElement")},goog.dom.asserts.assertIsHTMLVideoElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLVideoElement")},goog.dom.asserts.assertIsHTMLInputElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLInputElement")},goog.dom.asserts.assertIsHTMLTextAreaElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLTextAreaElement")},goog.dom.asserts.assertIsHTMLCanvasElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLCanvasElement")},goog.dom.asserts.assertIsHTMLEmbedElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLEmbedElement")},goog.dom.asserts.assertIsHTMLFormElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLFormElement")},goog.dom.asserts.assertIsHTMLFrameElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLFrameElement")},goog.dom.asserts.assertIsHTMLIFrameElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLIFrameElement")},goog.dom.asserts.assertIsHTMLObjectElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLObjectElement")},goog.dom.asserts.assertIsHTMLScriptElement=function(e){return goog.dom.asserts.assertIsElementType_(e,"HTMLScriptElement")},goog.dom.asserts.debugStringForType_=function(e){if(!goog.isObject(e))return void 0===e?"undefined":null===e?"null":typeof e;try{return e.constructor.displayName||e.constructor.name||Object.prototype.toString.call(e)}catch(e){return"<object could not be stringified>"}},goog.dom.asserts.getWindow_=function(e){try{var t=e&&e.ownerDocument,n=t&&(t.defaultView||t.parentWindow);if((n=n||goog.global).Element&&n.Location)return n}catch(e){}return null},goog.functions={},goog.functions.constant=function(e){return function(){return e}},goog.functions.FALSE=function(){return!1},goog.functions.TRUE=function(){return!0},goog.functions.NULL=function(){return null},goog.functions.identity=function(e,t){return e},goog.functions.error=function(e){return function(){throw Error(e)}},goog.functions.fail=function(e){return function(){throw e}},goog.functions.lock=function(e,t){return t=t||0,function(){return e.apply(this,Array.prototype.slice.call(arguments,0,t))}},goog.functions.nth=function(e){return function(){return arguments[e]}},goog.functions.partialRight=function(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=Array.prototype.slice.call(arguments);return t.push.apply(t,n),e.apply(this,t)}},goog.functions.withReturnValue=function(e,t){return goog.functions.sequence(e,goog.functions.constant(t))},goog.functions.equalTo=function(e,t){return function(n){return t?e==n:e===n}},goog.functions.compose=function(e,t){var n=arguments,r=n.length;return function(){var e;r&&(e=n[r-1].apply(this,arguments));for(var t=r-2;0<=t;t--)e=n[t].call(this,e);return e}},goog.functions.sequence=function(e){var t=arguments,n=t.length;return function(){for(var e,r=0;r<n;r++)e=t[r].apply(this,arguments);return e}},goog.functions.and=function(e){var t=arguments,n=t.length;return function(){for(var e=0;e<n;e++)if(!t[e].apply(this,arguments))return!1;return!0}},goog.functions.or=function(e){var t=arguments,n=t.length;return function(){for(var e=0;e<n;e++)if(t[e].apply(this,arguments))return!0;return!1}},goog.functions.not=function(e){return function(){return!e.apply(this,arguments)}},goog.functions.create=function(e,t){var n=function(){};return n.prototype=e.prototype,n=new n,e.apply(n,Array.prototype.slice.call(arguments,1)),n},goog.functions.CACHE_RETURN_VALUE=!0,goog.functions.cacheReturnValue=function(e){var t,n=!1;return function(){return goog.functions.CACHE_RETURN_VALUE?(n||(t=e(),n=!0),t):e()}},goog.functions.once=function(e){var t=e;return function(){if(t){var e=t;t=null,e()}}},goog.functions.debounce=function(e,t,n){var r=0;return function(o){goog.global.clearTimeout(r);var i=arguments;r=goog.global.setTimeout((function(){e.apply(n,i)}),t)}},goog.functions.throttle=function(e,t,n){var r=0,o=!1,i=[],a=function(){r=0,o&&(o=!1,s())},s=function(){r=goog.global.setTimeout(a,t),e.apply(n,i)};return function(e){i=arguments,r?o=!0:s()}},goog.functions.rateLimit=function(e,t,n){var r=0,o=function(){r=0};return function(i){r||(r=goog.global.setTimeout(o,t),e.apply(n,arguments))}},goog.dom.HtmlElement=function(){},goog.dom.TagName=function(e){this.tagName_=e},goog.dom.TagName.prototype.toString=function(){return this.tagName_},goog.dom.TagName.A=new goog.dom.TagName("A"),goog.dom.TagName.ABBR=new goog.dom.TagName("ABBR"),goog.dom.TagName.ACRONYM=new goog.dom.TagName("ACRONYM"),goog.dom.TagName.ADDRESS=new goog.dom.TagName("ADDRESS"),goog.dom.TagName.APPLET=new goog.dom.TagName("APPLET"),goog.dom.TagName.AREA=new goog.dom.TagName("AREA"),goog.dom.TagName.ARTICLE=new goog.dom.TagName("ARTICLE"),goog.dom.TagName.ASIDE=new goog.dom.TagName("ASIDE"),goog.dom.TagName.AUDIO=new goog.dom.TagName("AUDIO"),goog.dom.TagName.B=new goog.dom.TagName("B"),goog.dom.TagName.BASE=new goog.dom.TagName("BASE"),goog.dom.TagName.BASEFONT=new goog.dom.TagName("BASEFONT"),goog.dom.TagName.BDI=new goog.dom.TagName("BDI"),goog.dom.TagName.BDO=new goog.dom.TagName("BDO"),goog.dom.TagName.BIG=new goog.dom.TagName("BIG"),goog.dom.TagName.BLOCKQUOTE=new goog.dom.TagName("BLOCKQUOTE"),goog.dom.TagName.BODY=new goog.dom.TagName("BODY"),goog.dom.TagName.BR=new goog.dom.TagName("BR"),goog.dom.TagName.BUTTON=new goog.dom.TagName("BUTTON"),goog.dom.TagName.CANVAS=new goog.dom.TagName("CANVAS"),goog.dom.TagName.CAPTION=new goog.dom.TagName("CAPTION"),goog.dom.TagName.CENTER=new goog.dom.TagName("CENTER"),goog.dom.TagName.CITE=new goog.dom.TagName("CITE"),goog.dom.TagName.CODE=new goog.dom.TagName("CODE"),goog.dom.TagName.COL=new goog.dom.TagName("COL"),goog.dom.TagName.COLGROUP=new goog.dom.TagName("COLGROUP"),goog.dom.TagName.COMMAND=new goog.dom.TagName("COMMAND"),goog.dom.TagName.DATA=new goog.dom.TagName("DATA"),goog.dom.TagName.DATALIST=new goog.dom.TagName("DATALIST"),goog.dom.TagName.DD=new goog.dom.TagName("DD"),goog.dom.TagName.DEL=new goog.dom.TagName("DEL"),goog.dom.TagName.DETAILS=new goog.dom.TagName("DETAILS"),goog.dom.TagName.DFN=new goog.dom.TagName("DFN"),goog.dom.TagName.DIALOG=new goog.dom.TagName("DIALOG"),goog.dom.TagName.DIR=new goog.dom.TagName("DIR"),goog.dom.TagName.DIV=new goog.dom.TagName("DIV"),goog.dom.TagName.DL=new goog.dom.TagName("DL"),goog.dom.TagName.DT=new goog.dom.TagName("DT"),goog.dom.TagName.EM=new goog.dom.TagName("EM"),goog.dom.TagName.EMBED=new goog.dom.TagName("EMBED"),goog.dom.TagName.FIELDSET=new goog.dom.TagName("FIELDSET"),goog.dom.TagName.FIGCAPTION=new goog.dom.TagName("FIGCAPTION"),goog.dom.TagName.FIGURE=new goog.dom.TagName("FIGURE"),goog.dom.TagName.FONT=new goog.dom.TagName("FONT"),goog.dom.TagName.FOOTER=new goog.dom.TagName("FOOTER"),goog.dom.TagName.FORM=new goog.dom.TagName("FORM"),goog.dom.TagName.FRAME=new goog.dom.TagName("FRAME"),goog.dom.TagName.FRAMESET=new goog.dom.TagName("FRAMESET"),goog.dom.TagName.H1=new goog.dom.TagName("H1"),goog.dom.TagName.H2=new goog.dom.TagName("H2"),goog.dom.TagName.H3=new goog.dom.TagName("H3"),goog.dom.TagName.H4=new goog.dom.TagName("H4"),goog.dom.TagName.H5=new goog.dom.TagName("H5"),goog.dom.TagName.H6=new goog.dom.TagName("H6"),goog.dom.TagName.HEAD=new goog.dom.TagName("HEAD"),goog.dom.TagName.HEADER=new goog.dom.TagName("HEADER"),goog.dom.TagName.HGROUP=new goog.dom.TagName("HGROUP"),goog.dom.TagName.HR=new goog.dom.TagName("HR"),goog.dom.TagName.HTML=new goog.dom.TagName("HTML"),goog.dom.TagName.I=new goog.dom.TagName("I"),goog.dom.TagName.IFRAME=new goog.dom.TagName("IFRAME"),goog.dom.TagName.IMG=new goog.dom.TagName("IMG"),goog.dom.TagName.INPUT=new goog.dom.TagName("INPUT"),goog.dom.TagName.INS=new goog.dom.TagName("INS"),goog.dom.TagName.ISINDEX=new goog.dom.TagName("ISINDEX"),goog.dom.TagName.KBD=new goog.dom.TagName("KBD"),goog.dom.TagName.KEYGEN=new goog.dom.TagName("KEYGEN"),goog.dom.TagName.LABEL=new goog.dom.TagName("LABEL"),goog.dom.TagName.LEGEND=new goog.dom.TagName("LEGEND"),goog.dom.TagName.LI=new goog.dom.TagName("LI"),goog.dom.TagName.LINK=new goog.dom.TagName("LINK"),goog.dom.TagName.MAIN=new goog.dom.TagName("MAIN"),goog.dom.TagName.MAP=new goog.dom.TagName("MAP"),goog.dom.TagName.MARK=new goog.dom.TagName("MARK"),goog.dom.TagName.MATH=new goog.dom.TagName("MATH"),goog.dom.TagName.MENU=new goog.dom.TagName("MENU"),goog.dom.TagName.MENUITEM=new goog.dom.TagName("MENUITEM"),goog.dom.TagName.META=new goog.dom.TagName("META"),goog.dom.TagName.METER=new goog.dom.TagName("METER"),goog.dom.TagName.NAV=new goog.dom.TagName("NAV"),goog.dom.TagName.NOFRAMES=new goog.dom.TagName("NOFRAMES"),goog.dom.TagName.NOSCRIPT=new goog.dom.TagName("NOSCRIPT"),goog.dom.TagName.OBJECT=new goog.dom.TagName("OBJECT"),goog.dom.TagName.OL=new goog.dom.TagName("OL"),goog.dom.TagName.OPTGROUP=new goog.dom.TagName("OPTGROUP"),goog.dom.TagName.OPTION=new goog.dom.TagName("OPTION"),goog.dom.TagName.OUTPUT=new goog.dom.TagName("OUTPUT"),goog.dom.TagName.P=new goog.dom.TagName("P"),goog.dom.TagName.PARAM=new goog.dom.TagName("PARAM"),goog.dom.TagName.PICTURE=new goog.dom.TagName("PICTURE"),goog.dom.TagName.PRE=new goog.dom.TagName("PRE"),goog.dom.TagName.PROGRESS=new goog.dom.TagName("PROGRESS"),goog.dom.TagName.Q=new goog.dom.TagName("Q"),goog.dom.TagName.RP=new goog.dom.TagName("RP"),goog.dom.TagName.RT=new goog.dom.TagName("RT"),goog.dom.TagName.RTC=new goog.dom.TagName("RTC"),goog.dom.TagName.RUBY=new goog.dom.TagName("RUBY"),goog.dom.TagName.S=new goog.dom.TagName("S"),goog.dom.TagName.SAMP=new goog.dom.TagName("SAMP"),goog.dom.TagName.SCRIPT=new goog.dom.TagName("SCRIPT"),goog.dom.TagName.SECTION=new goog.dom.TagName("SECTION"),goog.dom.TagName.SELECT=new goog.dom.TagName("SELECT"),goog.dom.TagName.SMALL=new goog.dom.TagName("SMALL"),goog.dom.TagName.SOURCE=new goog.dom.TagName("SOURCE"),goog.dom.TagName.SPAN=new goog.dom.TagName("SPAN"),goog.dom.TagName.STRIKE=new goog.dom.TagName("STRIKE"),goog.dom.TagName.STRONG=new goog.dom.TagName("STRONG"),goog.dom.TagName.STYLE=new goog.dom.TagName("STYLE"),goog.dom.TagName.SUB=new goog.dom.TagName("SUB"),goog.dom.TagName.SUMMARY=new goog.dom.TagName("SUMMARY"),goog.dom.TagName.SUP=new goog.dom.TagName("SUP"),goog.dom.TagName.SVG=new goog.dom.TagName("SVG"),goog.dom.TagName.TABLE=new goog.dom.TagName("TABLE"),goog.dom.TagName.TBODY=new goog.dom.TagName("TBODY"),goog.dom.TagName.TD=new goog.dom.TagName("TD"),goog.dom.TagName.TEMPLATE=new goog.dom.TagName("TEMPLATE"),goog.dom.TagName.TEXTAREA=new goog.dom.TagName("TEXTAREA"),goog.dom.TagName.TFOOT=new goog.dom.TagName("TFOOT"),goog.dom.TagName.TH=new goog.dom.TagName("TH"),goog.dom.TagName.THEAD=new goog.dom.TagName("THEAD"),goog.dom.TagName.TIME=new goog.dom.TagName("TIME"),goog.dom.TagName.TITLE=new goog.dom.TagName("TITLE"),goog.dom.TagName.TR=new goog.dom.TagName("TR"),goog.dom.TagName.TRACK=new goog.dom.TagName("TRACK"),goog.dom.TagName.TT=new goog.dom.TagName("TT"),goog.dom.TagName.U=new goog.dom.TagName("U"),goog.dom.TagName.UL=new goog.dom.TagName("UL"),goog.dom.TagName.VAR=new goog.dom.TagName("VAR"),goog.dom.TagName.VIDEO=new goog.dom.TagName("VIDEO"),goog.dom.TagName.WBR=new goog.dom.TagName("WBR"),goog.dom.tags={},goog.dom.tags.VOID_TAGS_={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},goog.dom.tags.isVoidTag=function(e){return!0===goog.dom.tags.VOID_TAGS_[e]},goog.html={},goog.html.trustedtypes={},goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY=goog.TRUSTED_TYPES_POLICY_NAME?goog.createTrustedTypesPolicy(goog.TRUSTED_TYPES_POLICY_NAME+"#html"):null,goog.string={},goog.string.TypedString=function(){},goog.string.Const=function(e,t){this.stringConstValueWithSecurityContract__googStringSecurityPrivate_=e===goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_&&t||"",this.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_=goog.string.Const.TYPE_MARKER_},goog.string.Const.prototype.implementsGoogStringTypedString=!0,goog.string.Const.prototype.getTypedStringValue=function(){return this.stringConstValueWithSecurityContract__googStringSecurityPrivate_},goog.string.Const.prototype.toString=function(){return"Const{"+this.stringConstValueWithSecurityContract__googStringSecurityPrivate_+"}"},goog.string.Const.unwrap=function(e){return e instanceof goog.string.Const&&e.constructor===goog.string.Const&&e.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_===goog.string.Const.TYPE_MARKER_?e.stringConstValueWithSecurityContract__googStringSecurityPrivate_:(goog.asserts.fail("expected object of type Const, got '"+e+"'"),"type_error:Const")},goog.string.Const.from=function(e){return new goog.string.Const(goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_,e)},goog.string.Const.TYPE_MARKER_={},goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_={},goog.string.Const.EMPTY=goog.string.Const.from(""),goog.html.SafeScript=function(){this.privateDoNotAccessOrElseSafeScriptWrappedValue_="",this.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeScript.prototype.implementsGoogStringTypedString=!0,goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeScript.fromConstant=function(e){return 0===(e=goog.string.Const.unwrap(e)).length?goog.html.SafeScript.EMPTY:goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeScript.fromConstantAndArgs=function(e,t){for(var n=[],r=1;r<arguments.length;r++)n.push(goog.html.SafeScript.stringify_(arguments[r]));return goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse("("+goog.string.Const.unwrap(e)+")("+n.join(", ")+");")},goog.html.SafeScript.fromJson=function(e){return goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(goog.html.SafeScript.stringify_(e))},goog.html.SafeScript.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeScriptWrappedValue_.toString()},goog.DEBUG&&(goog.html.SafeScript.prototype.toString=function(){return"SafeScript{"+this.privateDoNotAccessOrElseSafeScriptWrappedValue_+"}"}),goog.html.SafeScript.unwrap=function(e){return goog.html.SafeScript.unwrapTrustedScript(e).toString()},goog.html.SafeScript.unwrapTrustedScript=function(e){return e instanceof goog.html.SafeScript&&e.constructor===goog.html.SafeScript&&e.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeScriptWrappedValue_:(goog.asserts.fail("expected object of type SafeScript, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeScript")},goog.html.SafeScript.stringify_=function(e){return JSON.stringify(e).replace(/</g,"\\x3c")},goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse=function(e){return(new goog.html.SafeScript).initSecurityPrivateDoNotAccessOrElse_(e)},goog.html.SafeScript.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e){return this.privateDoNotAccessOrElseSafeScriptWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createScript(e):e,this},goog.html.SafeScript.EMPTY=goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(""),goog.fs={},goog.fs.url={},goog.fs.url.createObjectUrl=function(e){return goog.fs.url.getUrlObject_().createObjectURL(e)},goog.fs.url.revokeObjectUrl=function(e){goog.fs.url.getUrlObject_().revokeObjectURL(e)},goog.fs.url.getUrlObject_=function(){var e=goog.fs.url.findUrlObject_();if(null!=e)return e;throw Error("This browser doesn't seem to support blob URLs")},goog.fs.url.findUrlObject_=function(){return goog.isDef(goog.global.URL)&&goog.isDef(goog.global.URL.createObjectURL)?goog.global.URL:goog.isDef(goog.global.webkitURL)&&goog.isDef(goog.global.webkitURL.createObjectURL)?goog.global.webkitURL:goog.isDef(goog.global.createObjectURL)?goog.global:null},goog.fs.url.browserSupportsObjectUrls=function(){return null!=goog.fs.url.findUrlObject_()},goog.i18n={},goog.i18n.bidi={},goog.i18n.bidi.FORCE_RTL=!1,goog.i18n.bidi.IS_RTL=goog.i18n.bidi.FORCE_RTL||("ar"==goog.LOCALE.substring(0,2).toLowerCase()||"fa"==goog.LOCALE.substring(0,2).toLowerCase()||"he"==goog.LOCALE.substring(0,2).toLowerCase()||"iw"==goog.LOCALE.substring(0,2).toLowerCase()||"ps"==goog.LOCALE.substring(0,2).toLowerCase()||"sd"==goog.LOCALE.substring(0,2).toLowerCase()||"ug"==goog.LOCALE.substring(0,2).toLowerCase()||"ur"==goog.LOCALE.substring(0,2).toLowerCase()||"yi"==goog.LOCALE.substring(0,2).toLowerCase())&&(2==goog.LOCALE.length||"-"==goog.LOCALE.substring(2,3)||"_"==goog.LOCALE.substring(2,3))||3<=goog.LOCALE.length&&"ckb"==goog.LOCALE.substring(0,3).toLowerCase()&&(3==goog.LOCALE.length||"-"==goog.LOCALE.substring(3,4)||"_"==goog.LOCALE.substring(3,4))||7<=goog.LOCALE.length&&("-"==goog.LOCALE.substring(2,3)||"_"==goog.LOCALE.substring(2,3))&&("adlm"==goog.LOCALE.substring(3,7).toLowerCase()||"arab"==goog.LOCALE.substring(3,7).toLowerCase()||"hebr"==goog.LOCALE.substring(3,7).toLowerCase()||"nkoo"==goog.LOCALE.substring(3,7).toLowerCase()||"rohg"==goog.LOCALE.substring(3,7).toLowerCase()||"thaa"==goog.LOCALE.substring(3,7).toLowerCase())||8<=goog.LOCALE.length&&("-"==goog.LOCALE.substring(3,4)||"_"==goog.LOCALE.substring(3,4))&&("adlm"==goog.LOCALE.substring(4,8).toLowerCase()||"arab"==goog.LOCALE.substring(4,8).toLowerCase()||"hebr"==goog.LOCALE.substring(4,8).toLowerCase()||"nkoo"==goog.LOCALE.substring(4,8).toLowerCase()||"rohg"==goog.LOCALE.substring(4,8).toLowerCase()||"thaa"==goog.LOCALE.substring(4,8).toLowerCase()),goog.i18n.bidi.Format={LRE:"",RLE:"",PDF:"",LRM:"",RLM:""},goog.i18n.bidi.Dir={LTR:1,RTL:-1,NEUTRAL:0},goog.i18n.bidi.RIGHT="right",goog.i18n.bidi.LEFT="left",goog.i18n.bidi.I18N_RIGHT=goog.i18n.bidi.IS_RTL?goog.i18n.bidi.LEFT:goog.i18n.bidi.RIGHT,goog.i18n.bidi.I18N_LEFT=goog.i18n.bidi.IS_RTL?goog.i18n.bidi.RIGHT:goog.i18n.bidi.LEFT,goog.i18n.bidi.toDir=function(e,t){return"number"==typeof e?0<e?goog.i18n.bidi.Dir.LTR:0>e?goog.i18n.bidi.Dir.RTL:t?null:goog.i18n.bidi.Dir.NEUTRAL:null==e?null:e?goog.i18n.bidi.Dir.RTL:goog.i18n.bidi.Dir.LTR},goog.i18n.bidi.ltrChars_="A-Za-zÀ-ÖØ-öø-ʸ̀-ऀ-Ⰰ-\ud801\ud804-\ud839\ud83c-\udbff豈-︀--",goog.i18n.bidi.rtlChars_="֑-ۯۺ-ࣿ\ud802-\ud803\ud83a-\ud83bיִ-﷿ﹰ-ﻼ",goog.i18n.bidi.htmlSkipReg_=/<[^>]*>|&[^;]+;/g,goog.i18n.bidi.stripHtmlIfNeeded_=function(e,t){return t?e.replace(goog.i18n.bidi.htmlSkipReg_,""):e},goog.i18n.bidi.rtlCharReg_=new RegExp("["+goog.i18n.bidi.rtlChars_+"]"),goog.i18n.bidi.ltrCharReg_=new RegExp("["+goog.i18n.bidi.ltrChars_+"]"),goog.i18n.bidi.hasAnyRtl=function(e,t){return goog.i18n.bidi.rtlCharReg_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.hasRtlChar=goog.i18n.bidi.hasAnyRtl,goog.i18n.bidi.hasAnyLtr=function(e,t){return goog.i18n.bidi.ltrCharReg_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.ltrRe_=new RegExp("^["+goog.i18n.bidi.ltrChars_+"]"),goog.i18n.bidi.rtlRe_=new RegExp("^["+goog.i18n.bidi.rtlChars_+"]"),goog.i18n.bidi.isRtlChar=function(e){return goog.i18n.bidi.rtlRe_.test(e)},goog.i18n.bidi.isLtrChar=function(e){return goog.i18n.bidi.ltrRe_.test(e)},goog.i18n.bidi.isNeutralChar=function(e){return!goog.i18n.bidi.isLtrChar(e)&&!goog.i18n.bidi.isRtlChar(e)},goog.i18n.bidi.ltrDirCheckRe_=new RegExp("^[^"+goog.i18n.bidi.rtlChars_+"]*["+goog.i18n.bidi.ltrChars_+"]"),goog.i18n.bidi.rtlDirCheckRe_=new RegExp("^[^"+goog.i18n.bidi.ltrChars_+"]*["+goog.i18n.bidi.rtlChars_+"]"),goog.i18n.bidi.startsWithRtl=function(e,t){return goog.i18n.bidi.rtlDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isRtlText=goog.i18n.bidi.startsWithRtl,goog.i18n.bidi.startsWithLtr=function(e,t){return goog.i18n.bidi.ltrDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isLtrText=goog.i18n.bidi.startsWithLtr,goog.i18n.bidi.isRequiredLtrRe_=/^http:\/\/.*/,goog.i18n.bidi.isNeutralText=function(e,t){return e=goog.i18n.bidi.stripHtmlIfNeeded_(e,t),goog.i18n.bidi.isRequiredLtrRe_.test(e)||!goog.i18n.bidi.hasAnyLtr(e)&&!goog.i18n.bidi.hasAnyRtl(e)},goog.i18n.bidi.ltrExitDirCheckRe_=new RegExp("["+goog.i18n.bidi.ltrChars_+"][^"+goog.i18n.bidi.rtlChars_+"]*$"),goog.i18n.bidi.rtlExitDirCheckRe_=new RegExp("["+goog.i18n.bidi.rtlChars_+"][^"+goog.i18n.bidi.ltrChars_+"]*$"),goog.i18n.bidi.endsWithLtr=function(e,t){return goog.i18n.bidi.ltrExitDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isLtrExitText=goog.i18n.bidi.endsWithLtr,goog.i18n.bidi.endsWithRtl=function(e,t){return goog.i18n.bidi.rtlExitDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(e,t))},goog.i18n.bidi.isRtlExitText=goog.i18n.bidi.endsWithRtl,goog.i18n.bidi.rtlLocalesRe_=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i,goog.i18n.bidi.isRtlLanguage=function(e){return goog.i18n.bidi.rtlLocalesRe_.test(e)},goog.i18n.bidi.bracketGuardTextRe_=/(\(.*?\)+)|(\[.*?\]+)|(\{.*?\}+)|(<.*?>+)/g,goog.i18n.bidi.guardBracketInText=function(e,t){return t=(void 0===t?goog.i18n.bidi.hasAnyRtl(e):t)?goog.i18n.bidi.Format.RLM:goog.i18n.bidi.Format.LRM,e.replace(goog.i18n.bidi.bracketGuardTextRe_,t+"$&"+t)},goog.i18n.bidi.enforceRtlInHtml=function(e){return"<"==e.charAt(0)?e.replace(/<\w+/,"$& dir=rtl"):"\n<span dir=rtl>"+e+"</span>"},goog.i18n.bidi.enforceRtlInText=function(e){return goog.i18n.bidi.Format.RLE+e+goog.i18n.bidi.Format.PDF},goog.i18n.bidi.enforceLtrInHtml=function(e){return"<"==e.charAt(0)?e.replace(/<\w+/,"$& dir=ltr"):"\n<span dir=ltr>"+e+"</span>"},goog.i18n.bidi.enforceLtrInText=function(e){return goog.i18n.bidi.Format.LRE+e+goog.i18n.bidi.Format.PDF},goog.i18n.bidi.dimensionsRe_=/:\s*([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)/g,goog.i18n.bidi.leftRe_=/left/gi,goog.i18n.bidi.rightRe_=/right/gi,goog.i18n.bidi.tempRe_=/%%%%/g,goog.i18n.bidi.mirrorCSS=function(e){return e.replace(goog.i18n.bidi.dimensionsRe_,":$1 $4 $3 $2").replace(goog.i18n.bidi.leftRe_,"%%%%").replace(goog.i18n.bidi.rightRe_,goog.i18n.bidi.LEFT).replace(goog.i18n.bidi.tempRe_,goog.i18n.bidi.RIGHT)},goog.i18n.bidi.doubleQuoteSubstituteRe_=/([\u0591-\u05f2])"/g,goog.i18n.bidi.singleQuoteSubstituteRe_=/([\u0591-\u05f2])'/g,goog.i18n.bidi.normalizeHebrewQuote=function(e){return e.replace(goog.i18n.bidi.doubleQuoteSubstituteRe_,"$1״").replace(goog.i18n.bidi.singleQuoteSubstituteRe_,"$1׳")},goog.i18n.bidi.wordSeparatorRe_=/\s+/,goog.i18n.bidi.hasNumeralsRe_=/[\d\u06f0-\u06f9]/,goog.i18n.bidi.rtlDetectionThreshold_=.4,goog.i18n.bidi.estimateDirection=function(e,t){var n=0,r=0,o=!1;for(e=goog.i18n.bidi.stripHtmlIfNeeded_(e,t).split(goog.i18n.bidi.wordSeparatorRe_),t=0;t<e.length;t++){var i=e[t];goog.i18n.bidi.startsWithRtl(i)?(n++,r++):goog.i18n.bidi.isRequiredLtrRe_.test(i)?o=!0:goog.i18n.bidi.hasAnyLtr(i)?r++:goog.i18n.bidi.hasNumeralsRe_.test(i)&&(o=!0)}return 0==r?o?goog.i18n.bidi.Dir.LTR:goog.i18n.bidi.Dir.NEUTRAL:n/r>goog.i18n.bidi.rtlDetectionThreshold_?goog.i18n.bidi.Dir.RTL:goog.i18n.bidi.Dir.LTR},goog.i18n.bidi.detectRtlDirectionality=function(e,t){return goog.i18n.bidi.estimateDirection(e,t)==goog.i18n.bidi.Dir.RTL},goog.i18n.bidi.setElementDirAndAlign=function(e,t){e&&(t=goog.i18n.bidi.toDir(t))&&(e.style.textAlign=t==goog.i18n.bidi.Dir.RTL?goog.i18n.bidi.RIGHT:goog.i18n.bidi.LEFT,e.dir=t==goog.i18n.bidi.Dir.RTL?"rtl":"ltr")},goog.i18n.bidi.setElementDirByTextDirectionality=function(e,t){switch(goog.i18n.bidi.estimateDirection(t)){case goog.i18n.bidi.Dir.LTR:e.dir="ltr";break;case goog.i18n.bidi.Dir.RTL:e.dir="rtl";break;default:e.removeAttribute("dir")}},goog.i18n.bidi.DirectionalString=function(){},goog.html.TrustedResourceUrl=function(){this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_="",this.trustedURL_=null,this.TRUSTED_RESOURCE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.TrustedResourceUrl.prototype.implementsGoogStringTypedString=!0,goog.html.TrustedResourceUrl.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_.toString()},goog.html.TrustedResourceUrl.prototype.implementsGoogI18nBidiDirectionalString=!0,goog.html.TrustedResourceUrl.prototype.getDirection=function(){return goog.i18n.bidi.Dir.LTR},goog.html.TrustedResourceUrl.prototype.cloneWithParams=function(e,t){var n=goog.html.TrustedResourceUrl.unwrap(this),r=(n=goog.html.TrustedResourceUrl.URL_PARAM_PARSER_.exec(n))[3]||"";return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(n[1]+goog.html.TrustedResourceUrl.stringifyParams_("?",n[2]||"",e)+goog.html.TrustedResourceUrl.stringifyParams_("#",r,t))},goog.DEBUG&&(goog.html.TrustedResourceUrl.prototype.toString=function(){return"TrustedResourceUrl{"+this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_+"}"}),goog.html.TrustedResourceUrl.unwrap=function(e){return goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(e).toString()},goog.html.TrustedResourceUrl.unwrapTrustedScriptURL=function(e){return e instanceof goog.html.TrustedResourceUrl&&e.constructor===goog.html.TrustedResourceUrl&&e.TRUSTED_RESOURCE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_:(goog.asserts.fail("expected object of type TrustedResourceUrl, got '"+e+"' of type "+goog.typeOf(e)),"type_error:TrustedResourceUrl")},goog.html.TrustedResourceUrl.unwrapTrustedURL=function(e){return e.trustedURL_?e.trustedURL_:goog.html.TrustedResourceUrl.unwrap(e)},goog.html.TrustedResourceUrl.format=function(e,t){var n=goog.string.Const.unwrap(e);if(!goog.html.TrustedResourceUrl.BASE_URL_.test(n))throw Error("Invalid TrustedResourceUrl format: "+n);return e=n.replace(goog.html.TrustedResourceUrl.FORMAT_MARKER_,(function(e,r){if(!Object.prototype.hasOwnProperty.call(t,r))throw Error('Found marker, "'+r+'", in format string, "'+n+'", but no valid label mapping found in args: '+JSON.stringify(t));return(e=t[r])instanceof goog.string.Const?goog.string.Const.unwrap(e):encodeURIComponent(String(e))})),goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.TrustedResourceUrl.FORMAT_MARKER_=/%{(\w+)}/g,goog.html.TrustedResourceUrl.BASE_URL_=/^((https:)?\/\/[0-9a-z.:[\]-]+\/|\/[^/\\]|[^:/\\%]+\/|[^:/\\%]*[?#]|about:blank#)/i,goog.html.TrustedResourceUrl.URL_PARAM_PARSER_=/^([^?#]*)(\?[^#]*)?(#[\s\S]*)?/,goog.html.TrustedResourceUrl.formatWithParams=function(e,t,n,r){return goog.html.TrustedResourceUrl.format(e,t).cloneWithParams(n,r)},goog.html.TrustedResourceUrl.fromConstant=function(e){return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap(e))},goog.html.TrustedResourceUrl.fromConstants=function(e){for(var t="",n=0;n<e.length;n++)t+=goog.string.Const.unwrap(e[n]);return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(t)},goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse=function(e){var t=new goog.html.TrustedResourceUrl;return t.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createScriptURL(e):e,goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY&&(t.trustedURL_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createURL(e)),t},goog.html.TrustedResourceUrl.stringifyParams_=function(e,t,n){if(null==n)return t;if(goog.isString(n))return n?e+encodeURIComponent(n):"";for(var r in n){var o=n[r];o=goog.isArray(o)?o:[o];for(var i=0;i<o.length;i++){var a=o[i];null!=a&&(t||(t=e),t+=(t.length>e.length?"&":"")+encodeURIComponent(r)+"="+encodeURIComponent(String(a)))}}return t},goog.string.internal={},goog.string.internal.startsWith=function(e,t){return 0==e.lastIndexOf(t,0)},goog.string.internal.endsWith=function(e,t){var n=e.length-t.length;return 0<=n&&e.indexOf(t,n)==n},goog.string.internal.caseInsensitiveStartsWith=function(e,t){return 0==goog.string.internal.caseInsensitiveCompare(t,e.substr(0,t.length))},goog.string.internal.caseInsensitiveEndsWith=function(e,t){return 0==goog.string.internal.caseInsensitiveCompare(t,e.substr(e.length-t.length,t.length))},goog.string.internal.caseInsensitiveEquals=function(e,t){return e.toLowerCase()==t.toLowerCase()},goog.string.internal.isEmptyOrWhitespace=function(e){return/^[\s\xa0]*$/.test(e)},goog.string.internal.trim=goog.TRUSTED_SITE&&String.prototype.trim?function(e){return e.trim()}:function(e){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(e)[1]},goog.string.internal.caseInsensitiveCompare=function(e,t){return(e=String(e).toLowerCase())<(t=String(t).toLowerCase())?-1:e==t?0:1},goog.string.internal.newLineToBr=function(e,t){return e.replace(/(\r\n|\r|\n)/g,t?"<br />":"<br>")},goog.string.internal.htmlEscape=function(e,t){if(t)e=e.replace(goog.string.internal.AMP_RE_,"&").replace(goog.string.internal.LT_RE_,"<").replace(goog.string.internal.GT_RE_,">").replace(goog.string.internal.QUOT_RE_,""").replace(goog.string.internal.SINGLE_QUOTE_RE_,"'").replace(goog.string.internal.NULL_RE_,"�");else{if(!goog.string.internal.ALL_RE_.test(e))return e;-1!=e.indexOf("&")&&(e=e.replace(goog.string.internal.AMP_RE_,"&")),-1!=e.indexOf("<")&&(e=e.replace(goog.string.internal.LT_RE_,"<")),-1!=e.indexOf(">")&&(e=e.replace(goog.string.internal.GT_RE_,">")),-1!=e.indexOf('"')&&(e=e.replace(goog.string.internal.QUOT_RE_,""")),-1!=e.indexOf("'")&&(e=e.replace(goog.string.internal.SINGLE_QUOTE_RE_,"'")),-1!=e.indexOf("\0")&&(e=e.replace(goog.string.internal.NULL_RE_,"�"))}return e},goog.string.internal.AMP_RE_=/&/g,goog.string.internal.LT_RE_=/</g,goog.string.internal.GT_RE_=/>/g,goog.string.internal.QUOT_RE_=/"/g,goog.string.internal.SINGLE_QUOTE_RE_=/'/g,goog.string.internal.NULL_RE_=/\x00/g,goog.string.internal.ALL_RE_=/[\x00&<>"']/,goog.string.internal.whitespaceEscape=function(e,t){return goog.string.internal.newLineToBr(e.replace(/ /g,"  "),t)},goog.string.internal.contains=function(e,t){return-1!=e.indexOf(t)},goog.string.internal.caseInsensitiveContains=function(e,t){return goog.string.internal.contains(e.toLowerCase(),t.toLowerCase())},goog.string.internal.compareVersions=function(e,t){var n=0;e=goog.string.internal.trim(String(e)).split("."),t=goog.string.internal.trim(String(t)).split(".");for(var r=Math.max(e.length,t.length),o=0;0==n&&o<r;o++){var i=e[o]||"",a=t[o]||"";do{if(i=/(\d*)(\D*)(.*)/.exec(i)||["","","",""],a=/(\d*)(\D*)(.*)/.exec(a)||["","","",""],0==i[0].length&&0==a[0].length)break;n=0==i[1].length?0:parseInt(i[1],10);var s=0==a[1].length?0:parseInt(a[1],10);n=goog.string.internal.compareElements_(n,s)||goog.string.internal.compareElements_(0==i[2].length,0==a[2].length)||goog.string.internal.compareElements_(i[2],a[2]),i=i[3],a=a[3]}while(0==n)}return n},goog.string.internal.compareElements_=function(e,t){return e<t?-1:e>t?1:0},goog.html.SafeUrl=function(){this.privateDoNotAccessOrElseSafeUrlWrappedValue_="",this.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeUrl.INNOCUOUS_STRING="about:invalid#zClosurez",goog.html.SafeUrl.prototype.implementsGoogStringTypedString=!0,goog.html.SafeUrl.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeUrlWrappedValue_.toString()},goog.html.SafeUrl.prototype.implementsGoogI18nBidiDirectionalString=!0,goog.html.SafeUrl.prototype.getDirection=function(){return goog.i18n.bidi.Dir.LTR},goog.DEBUG&&(goog.html.SafeUrl.prototype.toString=function(){return"SafeUrl{"+this.privateDoNotAccessOrElseSafeUrlWrappedValue_+"}"}),goog.html.SafeUrl.unwrap=function(e){return goog.html.SafeUrl.unwrapTrustedURL(e).toString()},goog.html.SafeUrl.unwrapTrustedURL=function(e){return e instanceof goog.html.SafeUrl&&e.constructor===goog.html.SafeUrl&&e.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeUrlWrappedValue_:(goog.asserts.fail("expected object of type SafeUrl, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeUrl")},goog.html.SafeUrl.fromConstant=function(e){return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap(e))},goog.html.SAFE_MIME_TYPE_PATTERN_=/^(?:audio\/(?:3gpp2|3gpp|aac|L16|midi|mp3|mp4|mpeg|oga|ogg|opus|x-m4a|x-wav|wav|webm)|image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp|x-icon)|text\/csv|video\/(?:mpeg|mp4|ogg|webm|quicktime))(?:;\w+=(?:\w+|"[\w;=]+"))*$/i,goog.html.SafeUrl.isSafeMimeType=function(e){return goog.html.SAFE_MIME_TYPE_PATTERN_.test(e)},goog.html.SafeUrl.fromBlob=function(e){return e=goog.html.SAFE_MIME_TYPE_PATTERN_.test(e.type)?goog.fs.url.createObjectUrl(e):goog.html.SafeUrl.INNOCUOUS_STRING,goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.DATA_URL_PATTERN_=/^data:([^,]*);base64,[a-z0-9+\/]+=*$/i,goog.html.SafeUrl.fromDataUrl=function(e){var t=(e=e.replace(/(%0A|%0D)/g,"")).match(goog.html.DATA_URL_PATTERN_);return t=t&&goog.html.SAFE_MIME_TYPE_PATTERN_.test(t[1]),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(t?e:goog.html.SafeUrl.INNOCUOUS_STRING)},goog.html.SafeUrl.fromTelUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"tel:")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SIP_URL_PATTERN_=/^sip[s]?:[+a-z0-9_.!$%&'*\/=^`{|}~-]+@([a-z0-9-]+\.)+[a-z0-9]{2,63}$/i,goog.html.SafeUrl.fromSipUrl=function(e){return goog.html.SIP_URL_PATTERN_.test(decodeURIComponent(e))||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.fromFacebookMessengerUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"fb-messenger://share")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.fromWhatsAppUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"whatsapp://send")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.fromSmsUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"sms:")&&goog.html.SafeUrl.isSmsUrlBodyValid_(e)||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.isSmsUrlBodyValid_=function(e){var t=e.indexOf("#");if(0<t&&(e=e.substring(0,t)),!(t=e.match(/[?&]body=/gi)))return!0;if(1<t.length)return!1;if(!(e=e.match(/[?&]body=([^&]*)/)[1]))return!0;try{decodeURIComponent(e)}catch(e){return!1}return/^(?:[a-z0-9\-_.~]|%[0-9a-f]{2})+$/i.test(e)},goog.html.SafeUrl.fromSshUrl=function(e){return goog.string.internal.caseInsensitiveStartsWith(e,"ssh://")||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeUrl.sanitizeChromeExtensionUrl=function(e,t){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^chrome-extension:\/\/([^\/]+)\//,e,t)},goog.html.SafeUrl.sanitizeFirefoxExtensionUrl=function(e,t){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^moz-extension:\/\/([^\/]+)\//,e,t)},goog.html.SafeUrl.sanitizeEdgeExtensionUrl=function(e,t){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^ms-browser-extension:\/\/([^\/]+)\//,e,t)},goog.html.SafeUrl.sanitizeExtensionUrl_=function(e,t,n){return(e=e.exec(t))?(e=e[1],-1==(n instanceof goog.string.Const?[goog.string.Const.unwrap(n)]:n.map((function(e){return goog.string.Const.unwrap(e)}))).indexOf(e)&&(t=goog.html.SafeUrl.INNOCUOUS_STRING)):t=goog.html.SafeUrl.INNOCUOUS_STRING,goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(t)},goog.html.SafeUrl.fromTrustedResourceUrl=function(e){return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(goog.html.TrustedResourceUrl.unwrap(e))},goog.html.SAFE_URL_PATTERN_=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i,goog.html.SafeUrl.SAFE_URL_PATTERN=goog.html.SAFE_URL_PATTERN_,goog.html.SafeUrl.sanitize=function(e){return e instanceof goog.html.SafeUrl?e:(e="object"==typeof e&&e.implementsGoogStringTypedString?e.getTypedStringValue():String(e),goog.html.SAFE_URL_PATTERN_.test(e)||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e))},goog.html.SafeUrl.sanitizeAssertUnchanged=function(e,t){return e instanceof goog.html.SafeUrl?e:(e="object"==typeof e&&e.implementsGoogStringTypedString?e.getTypedStringValue():String(e),t&&/^data:/i.test(e)&&(t=goog.html.SafeUrl.fromDataUrl(e)).getTypedStringValue()==e?t:(goog.asserts.assert(goog.html.SAFE_URL_PATTERN_.test(e),"%s does not match the safe URL pattern",e)||(e=goog.html.SafeUrl.INNOCUOUS_STRING),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(e)))},goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse=function(e){var t=new goog.html.SafeUrl;return t.privateDoNotAccessOrElseSafeUrlWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createURL(e):e,t},goog.html.SafeUrl.ABOUT_BLANK=goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse("about:blank"),goog.html.SafeStyle=function(){this.privateDoNotAccessOrElseSafeStyleWrappedValue_="",this.SAFE_STYLE_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeStyle.prototype.implementsGoogStringTypedString=!0,goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeStyle.fromConstant=function(e){return 0===(e=goog.string.Const.unwrap(e)).length?goog.html.SafeStyle.EMPTY:(goog.asserts.assert(goog.string.internal.endsWith(e,";"),"Last character of style string is not ';': "+e),goog.asserts.assert(goog.string.internal.contains(e,":"),"Style string must contain at least one ':', to specify a \"name: value\" pair: "+e),goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(e))},goog.html.SafeStyle.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeStyleWrappedValue_},goog.DEBUG&&(goog.html.SafeStyle.prototype.toString=function(){return"SafeStyle{"+this.privateDoNotAccessOrElseSafeStyleWrappedValue_+"}"}),goog.html.SafeStyle.unwrap=function(e){return e instanceof goog.html.SafeStyle&&e.constructor===goog.html.SafeStyle&&e.SAFE_STYLE_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeStyleWrappedValue_:(goog.asserts.fail("expected object of type SafeStyle, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeStyle")},goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse=function(e){return(new goog.html.SafeStyle).initSecurityPrivateDoNotAccessOrElse_(e)},goog.html.SafeStyle.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e){return this.privateDoNotAccessOrElseSafeStyleWrappedValue_=e,this},goog.html.SafeStyle.EMPTY=goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(""),goog.html.SafeStyle.INNOCUOUS_STRING="zClosurez",goog.html.SafeStyle.create=function(e){var t,n="";for(t in e){if(!/^[-_a-zA-Z0-9]+$/.test(t))throw Error("Name allows only [-_a-zA-Z0-9], got: "+t);var r=e[t];null!=r&&(n+=t+":"+(r=goog.isArray(r)?goog.array.map(r,goog.html.SafeStyle.sanitizePropertyValue_).join(" "):goog.html.SafeStyle.sanitizePropertyValue_(r))+";")}return n?goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(n):goog.html.SafeStyle.EMPTY},goog.html.SafeStyle.sanitizePropertyValue_=function(e){if(e instanceof goog.html.SafeUrl)return'url("'+goog.html.SafeUrl.unwrap(e).replace(/</g,"%3c").replace(/[\\"]/g,"\\$&")+'")';if(e=e instanceof goog.string.Const?goog.string.Const.unwrap(e):goog.html.SafeStyle.sanitizePropertyValueString_(String(e)),/[{;}]/.test(e))throw new goog.asserts.AssertionError("Value does not allow [{;}], got: %s.",[e]);return e},goog.html.SafeStyle.sanitizePropertyValueString_=function(e){var t=e.replace(goog.html.SafeStyle.FUNCTIONS_RE_,"$1").replace(goog.html.SafeStyle.FUNCTIONS_RE_,"$1").replace(goog.html.SafeStyle.URL_RE_,"url");return goog.html.SafeStyle.VALUE_RE_.test(t)?goog.html.SafeStyle.COMMENT_RE_.test(e)?(goog.asserts.fail("String value disallows comments, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING):goog.html.SafeStyle.hasBalancedQuotes_(e)?goog.html.SafeStyle.hasBalancedSquareBrackets_(e)?goog.html.SafeStyle.sanitizeUrl_(e):(goog.asserts.fail("String value requires balanced square brackets and one identifier per pair of brackets, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING):(goog.asserts.fail("String value requires balanced quotes, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING):(goog.asserts.fail("String value allows only "+goog.html.SafeStyle.VALUE_ALLOWED_CHARS_+" and simple functions, got: "+e),goog.html.SafeStyle.INNOCUOUS_STRING)},goog.html.SafeStyle.hasBalancedQuotes_=function(e){for(var t=!0,n=!0,r=0;r<e.length;r++){var o=e.charAt(r);"'"==o&&n?t=!t:'"'==o&&t&&(n=!n)}return t&&n},goog.html.SafeStyle.hasBalancedSquareBrackets_=function(e){for(var t=!0,n=/^[-_a-zA-Z0-9]$/,r=0;r<e.length;r++){var o=e.charAt(r);if("]"==o){if(t)return!1;t=!0}else if("["==o){if(!t)return!1;t=!1}else if(!t&&!n.test(o))return!1}return t},goog.html.SafeStyle.VALUE_ALLOWED_CHARS_="[-,.\"'%_!# a-zA-Z0-9\\[\\]]",goog.html.SafeStyle.VALUE_RE_=new RegExp("^"+goog.html.SafeStyle.VALUE_ALLOWED_CHARS_+"+$"),goog.html.SafeStyle.URL_RE_=/\b(url\([ \t\n]*)('[ -&(-\[\]-~]*'|"[ !#-\[\]-~]*"|[!#-&*-\[\]-~]*)([ \t\n]*\))/g,goog.html.SafeStyle.FUNCTIONS_RE_=/\b(hsl|hsla|rgb|rgba|matrix|calc|minmax|fit-content|repeat|(rotate|scale|translate)(X|Y|Z|3d)?)\([-+*/0-9a-z.%\[\], ]+\)/g,goog.html.SafeStyle.COMMENT_RE_=/\/\*/,goog.html.SafeStyle.sanitizeUrl_=function(e){return e.replace(goog.html.SafeStyle.URL_RE_,(function(e,t,n,r){var o="";return n=n.replace(/^(['"])(.*)\1$/,(function(e,t,n){return o=t,n})),e=goog.html.SafeUrl.sanitize(n).getTypedStringValue(),t+o+e+o+r}))},goog.html.SafeStyle.concat=function(e){var t="",n=function(e){goog.isArray(e)?goog.array.forEach(e,n):t+=goog.html.SafeStyle.unwrap(e)};return goog.array.forEach(arguments,n),t?goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(t):goog.html.SafeStyle.EMPTY},goog.html.SafeStyleSheet=function(){this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_="",this.SAFE_STYLE_SHEET_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_},goog.html.SafeStyleSheet.prototype.implementsGoogStringTypedString=!0,goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeStyleSheet.createRule=function(e,t){if(goog.string.internal.contains(e,"<"))throw Error("Selector does not allow '<', got: "+e);var n=e.replace(/('|")((?!\1)[^\r\n\f\\]|\\[\s\S])*\1/g,"");if(!/^[-_a-zA-Z0-9#.:* ,>+~[\]()=^$|]+$/.test(n))throw Error("Selector allows only [-_a-zA-Z0-9#.:* ,>+~[\\]()=^$|] and strings, got: "+e);if(!goog.html.SafeStyleSheet.hasBalancedBrackets_(n))throw Error("() and [] in selector must be balanced, got: "+e);return t instanceof goog.html.SafeStyle||(t=goog.html.SafeStyle.create(t)),e=e+"{"+goog.html.SafeStyle.unwrap(t).replace(/</g,"\\3C ")+"}",goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(e)},goog.html.SafeStyleSheet.hasBalancedBrackets_=function(e){for(var t={"(":")","[":"]"},n=[],r=0;r<e.length;r++){var o=e[r];if(t[o])n.push(t[o]);else if(goog.object.contains(t,o)&&n.pop()!=o)return!1}return 0==n.length},goog.html.SafeStyleSheet.concat=function(e){var t="",n=function(e){goog.isArray(e)?goog.array.forEach(e,n):t+=goog.html.SafeStyleSheet.unwrap(e)};return goog.array.forEach(arguments,n),goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(t)},goog.html.SafeStyleSheet.fromConstant=function(e){return 0===(e=goog.string.Const.unwrap(e)).length?goog.html.SafeStyleSheet.EMPTY:(goog.asserts.assert(!goog.string.internal.contains(e,"<"),"Forbidden '<' character in style sheet string: "+e),goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(e))},goog.html.SafeStyleSheet.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_},goog.DEBUG&&(goog.html.SafeStyleSheet.prototype.toString=function(){return"SafeStyleSheet{"+this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_+"}"}),goog.html.SafeStyleSheet.unwrap=function(e){return e instanceof goog.html.SafeStyleSheet&&e.constructor===goog.html.SafeStyleSheet&&e.SAFE_STYLE_SHEET_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_:(goog.asserts.fail("expected object of type SafeStyleSheet, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeStyleSheet")},goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse=function(e){return(new goog.html.SafeStyleSheet).initSecurityPrivateDoNotAccessOrElse_(e)},goog.html.SafeStyleSheet.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e){return this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_=e,this},goog.html.SafeStyleSheet.EMPTY=goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(""),goog.labs={},goog.labs.userAgent={},goog.labs.userAgent.util={},goog.labs.userAgent.util.getNativeUserAgentString_=function(){var e=goog.labs.userAgent.util.getNavigator_();return e&&(e=e.userAgent)?e:""},goog.labs.userAgent.util.getNavigator_=function(){return goog.global.navigator},goog.labs.userAgent.util.userAgent_=goog.labs.userAgent.util.getNativeUserAgentString_(),goog.labs.userAgent.util.setUserAgent=function(e){goog.labs.userAgent.util.userAgent_=e||goog.labs.userAgent.util.getNativeUserAgentString_()},goog.labs.userAgent.util.getUserAgent=function(){return goog.labs.userAgent.util.userAgent_},goog.labs.userAgent.util.matchUserAgent=function(e){var t=goog.labs.userAgent.util.getUserAgent();return goog.string.internal.contains(t,e)},goog.labs.userAgent.util.matchUserAgentIgnoreCase=function(e){var t=goog.labs.userAgent.util.getUserAgent();return goog.string.internal.caseInsensitiveContains(t,e)},goog.labs.userAgent.util.extractVersionTuples=function(e){for(var t,n=/(\w[\w ]+)\/([^\s]+)\s*(?:\((.*?)\))?/g,r=[];t=n.exec(e);)r.push([t[1],t[2],t[3]||void 0]);return r},goog.labs.userAgent.browser={},goog.labs.userAgent.browser.matchOpera_=function(){return goog.labs.userAgent.util.matchUserAgent("Opera")},goog.labs.userAgent.browser.matchIE_=function(){return goog.labs.userAgent.util.matchUserAgent("Trident")||goog.labs.userAgent.util.matchUserAgent("MSIE")},goog.labs.userAgent.browser.matchEdgeHtml_=function(){return goog.labs.userAgent.util.matchUserAgent("Edge")},goog.labs.userAgent.browser.matchEdgeChromium_=function(){return goog.labs.userAgent.util.matchUserAgent("Edg/")},goog.labs.userAgent.browser.matchOperaChromium_=function(){return goog.labs.userAgent.util.matchUserAgent("OPR")},goog.labs.userAgent.browser.matchFirefox_=function(){return goog.labs.userAgent.util.matchUserAgent("Firefox")||goog.labs.userAgent.util.matchUserAgent("FxiOS")},goog.labs.userAgent.browser.matchSafari_=function(){return goog.labs.userAgent.util.matchUserAgent("Safari")&&!(goog.labs.userAgent.browser.matchChrome_()||goog.labs.userAgent.browser.matchCoast_()||goog.labs.userAgent.browser.matchOpera_()||goog.labs.userAgent.browser.matchEdgeHtml_()||goog.labs.userAgent.browser.matchEdgeChromium_()||goog.labs.userAgent.browser.matchOperaChromium_()||goog.labs.userAgent.browser.matchFirefox_()||goog.labs.userAgent.browser.isSilk()||goog.labs.userAgent.util.matchUserAgent("Android"))},goog.labs.userAgent.browser.matchCoast_=function(){return goog.labs.userAgent.util.matchUserAgent("Coast")},goog.labs.userAgent.browser.matchIosWebview_=function(){return(goog.labs.userAgent.util.matchUserAgent("iPad")||goog.labs.userAgent.util.matchUserAgent("iPhone"))&&!goog.labs.userAgent.browser.matchSafari_()&&!goog.labs.userAgent.browser.matchChrome_()&&!goog.labs.userAgent.browser.matchCoast_()&&!goog.labs.userAgent.browser.matchFirefox_()&&goog.labs.userAgent.util.matchUserAgent("AppleWebKit")},goog.labs.userAgent.browser.matchChrome_=function(){return(goog.labs.userAgent.util.matchUserAgent("Chrome")||goog.labs.userAgent.util.matchUserAgent("CriOS"))&&!goog.labs.userAgent.browser.matchEdgeHtml_()},goog.labs.userAgent.browser.matchAndroidBrowser_=function(){return goog.labs.userAgent.util.matchUserAgent("Android")&&!(goog.labs.userAgent.browser.isChrome()||goog.labs.userAgent.browser.isFirefox()||goog.labs.userAgent.browser.isOpera()||goog.labs.userAgent.browser.isSilk())},goog.labs.userAgent.browser.isOpera=goog.labs.userAgent.browser.matchOpera_,goog.labs.userAgent.browser.isIE=goog.labs.userAgent.browser.matchIE_,goog.labs.userAgent.browser.isEdge=goog.labs.userAgent.browser.matchEdgeHtml_,goog.labs.userAgent.browser.isEdgeChromium=goog.labs.userAgent.browser.matchEdgeChromium_,goog.labs.userAgent.browser.isOperaChromium=goog.labs.userAgent.browser.matchOperaChromium_,goog.labs.userAgent.browser.isFirefox=goog.labs.userAgent.browser.matchFirefox_,goog.labs.userAgent.browser.isSafari=goog.labs.userAgent.browser.matchSafari_,goog.labs.userAgent.browser.isCoast=goog.labs.userAgent.browser.matchCoast_,goog.labs.userAgent.browser.isIosWebview=goog.labs.userAgent.browser.matchIosWebview_,goog.labs.userAgent.browser.isChrome=goog.labs.userAgent.browser.matchChrome_,goog.labs.userAgent.browser.isAndroidBrowser=goog.labs.userAgent.browser.matchAndroidBrowser_,goog.labs.userAgent.browser.isSilk=function(){return goog.labs.userAgent.util.matchUserAgent("Silk")},goog.labs.userAgent.browser.getVersion=function(){function e(e){return e=goog.array.find(e,r),n[e]||""}var t=goog.labs.userAgent.util.getUserAgent();if(goog.labs.userAgent.browser.isIE())return goog.labs.userAgent.browser.getIEVersion_(t);t=goog.labs.userAgent.util.extractVersionTuples(t);var n={};goog.array.forEach(t,(function(e){n[e[0]]=e[1]}));var r=goog.partial(goog.object.containsKey,n);return goog.labs.userAgent.browser.isOpera()?e(["Version","Opera"]):goog.labs.userAgent.browser.isEdge()?e(["Edge"]):goog.labs.userAgent.browser.isEdgeChromium()?e(["Edg"]):goog.labs.userAgent.browser.isChrome()?e(["Chrome","CriOS"]):(t=t[2])&&t[1]||""},goog.labs.userAgent.browser.isVersionOrHigher=function(e){return 0<=goog.string.internal.compareVersions(goog.labs.userAgent.browser.getVersion(),e)},goog.labs.userAgent.browser.getIEVersion_=function(e){var t=/rv: *([\d\.]*)/.exec(e);if(t&&t[1])return t[1];t="";var n=/MSIE +([\d\.]+)/.exec(e);if(n&&n[1])if(e=/Trident\/(\d.\d)/.exec(e),"7.0"==n[1])if(e&&e[1])switch(e[1]){case"4.0":t="8.0";break;case"5.0":t="9.0";break;case"6.0":t="10.0";break;case"7.0":t="11.0"}else t="7.0";else t=n[1];return t},goog.html.SafeHtml=function(){this.privateDoNotAccessOrElseSafeHtmlWrappedValue_="",this.SAFE_HTML_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_,this.dir_=null},goog.html.SafeHtml.prototype.implementsGoogI18nBidiDirectionalString=!0,goog.html.SafeHtml.prototype.getDirection=function(){return this.dir_},goog.html.SafeHtml.prototype.implementsGoogStringTypedString=!0,goog.html.SafeHtml.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeHtmlWrappedValue_.toString()},goog.DEBUG&&(goog.html.SafeHtml.prototype.toString=function(){return"SafeHtml{"+this.privateDoNotAccessOrElseSafeHtmlWrappedValue_+"}"}),goog.html.SafeHtml.unwrap=function(e){return goog.html.SafeHtml.unwrapTrustedHTML(e).toString()},goog.html.SafeHtml.unwrapTrustedHTML=function(e){return e instanceof goog.html.SafeHtml&&e.constructor===goog.html.SafeHtml&&e.SAFE_HTML_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_?e.privateDoNotAccessOrElseSafeHtmlWrappedValue_:(goog.asserts.fail("expected object of type SafeHtml, got '"+e+"' of type "+goog.typeOf(e)),"type_error:SafeHtml")},goog.html.SafeHtml.htmlEscape=function(e){if(e instanceof goog.html.SafeHtml)return e;var t="object"==typeof e,n=null;return t&&e.implementsGoogI18nBidiDirectionalString&&(n=e.getDirection()),e=t&&e.implementsGoogStringTypedString?e.getTypedStringValue():String(e),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.htmlEscape(e),n)},goog.html.SafeHtml.htmlEscapePreservingNewlines=function(e){return e instanceof goog.html.SafeHtml?e:(e=goog.html.SafeHtml.htmlEscape(e),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.newLineToBr(goog.html.SafeHtml.unwrap(e)),e.getDirection()))},goog.html.SafeHtml.htmlEscapePreservingNewlinesAndSpaces=function(e){return e instanceof goog.html.SafeHtml?e:(e=goog.html.SafeHtml.htmlEscape(e),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.whitespaceEscape(goog.html.SafeHtml.unwrap(e)),e.getDirection()))},goog.html.SafeHtml.from=goog.html.SafeHtml.htmlEscape,goog.html.SafeHtml.VALID_NAMES_IN_TAG_=/^[a-zA-Z0-9-]+$/,goog.html.SafeHtml.URL_ATTRIBUTES_={action:!0,cite:!0,data:!0,formaction:!0,href:!0,manifest:!0,poster:!0,src:!0},goog.html.SafeHtml.NOT_ALLOWED_TAG_NAMES_={APPLET:!0,BASE:!0,EMBED:!0,IFRAME:!0,LINK:!0,MATH:!0,META:!0,OBJECT:!0,SCRIPT:!0,STYLE:!0,SVG:!0,TEMPLATE:!0},goog.html.SafeHtml.create=function(e,t,n){return goog.html.SafeHtml.verifyTagName(String(e)),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse(String(e),t,n)},goog.html.SafeHtml.verifyTagName=function(e){if(!goog.html.SafeHtml.VALID_NAMES_IN_TAG_.test(e))throw Error("Invalid tag name <"+e+">.");if(e.toUpperCase()in goog.html.SafeHtml.NOT_ALLOWED_TAG_NAMES_)throw Error("Tag name <"+e+"> is not allowed for SafeHtml.")},goog.html.SafeHtml.createIframe=function(e,t,n,r){e&&goog.html.TrustedResourceUrl.unwrap(e);var o={};return o.src=e||null,o.srcdoc=t&&goog.html.SafeHtml.unwrap(t),e=goog.html.SafeHtml.combineAttributes(o,{sandbox:""},n),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("iframe",e,r)},goog.html.SafeHtml.createSandboxIframe=function(e,t,n,r){if(!goog.html.SafeHtml.canUseSandboxIframe())throw Error("The browser does not support sandboxed iframes.");var o={};return o.src=e?goog.html.SafeUrl.unwrap(goog.html.SafeUrl.sanitize(e)):null,o.srcdoc=t||null,o.sandbox="",e=goog.html.SafeHtml.combineAttributes(o,{},n),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("iframe",e,r)},goog.html.SafeHtml.canUseSandboxIframe=function(){return goog.global.HTMLIFrameElement&&"sandbox"in goog.global.HTMLIFrameElement.prototype},goog.html.SafeHtml.createScriptSrc=function(e,t){return goog.html.TrustedResourceUrl.unwrap(e),e=goog.html.SafeHtml.combineAttributes({src:e},{},t),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("script",e)},goog.html.SafeHtml.createScript=function(e,t){for(var n in t){var r=n.toLowerCase();if("language"==r||"src"==r||"text"==r||"type"==r)throw Error('Cannot set "'+r+'" attribute')}for(n="",e=goog.array.concat(e),r=0;r<e.length;r++)n+=goog.html.SafeScript.unwrap(e[r]);return e=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(n,goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("script",t,e)},goog.html.SafeHtml.createStyle=function(e,t){t=goog.html.SafeHtml.combineAttributes({type:"text/css"},{},t);var n="";e=goog.array.concat(e);for(var r=0;r<e.length;r++)n+=goog.html.SafeStyleSheet.unwrap(e[r]);return e=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(n,goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("style",t,e)},goog.html.SafeHtml.createMetaRefresh=function(e,t){return e=goog.html.SafeUrl.unwrap(goog.html.SafeUrl.sanitize(e)),(goog.labs.userAgent.browser.isIE()||goog.labs.userAgent.browser.isEdge())&&goog.string.internal.contains(e,";")&&(e="'"+e.replace(/'/g,"%27")+"'"),goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("meta",{"http-equiv":"refresh",content:(t||0)+"; url="+e})},goog.html.SafeHtml.getAttrNameAndValue_=function(e,t,n){if(n instanceof goog.string.Const)n=goog.string.Const.unwrap(n);else if("style"==t.toLowerCase())n=goog.html.SafeHtml.getStyleValue_(n);else{if(/^on/i.test(t))throw Error('Attribute "'+t+'" requires goog.string.Const value, "'+n+'" given.');if(t.toLowerCase()in goog.html.SafeHtml.URL_ATTRIBUTES_)if(n instanceof goog.html.TrustedResourceUrl)n=goog.html.TrustedResourceUrl.unwrap(n);else if(n instanceof goog.html.SafeUrl)n=goog.html.SafeUrl.unwrap(n);else{if(!goog.isString(n))throw Error('Attribute "'+t+'" on tag "'+e+'" requires goog.html.SafeUrl, goog.string.Const, or string, value "'+n+'" given.');n=goog.html.SafeUrl.sanitize(n).getTypedStringValue()}}return n.implementsGoogStringTypedString&&(n=n.getTypedStringValue()),goog.asserts.assert(goog.isString(n)||goog.isNumber(n),"String or number value expected, got "+typeof n+" with value: "+n),t+'="'+goog.string.internal.htmlEscape(String(n))+'"'},goog.html.SafeHtml.getStyleValue_=function(e){if(!goog.isObject(e))throw Error('The "style" attribute requires goog.html.SafeStyle or map of style properties, '+typeof e+" given: "+e);return e instanceof goog.html.SafeStyle||(e=goog.html.SafeStyle.create(e)),goog.html.SafeStyle.unwrap(e)},goog.html.SafeHtml.createWithDir=function(e,t,n,r){return(t=goog.html.SafeHtml.create(t,n,r)).dir_=e,t},goog.html.SafeHtml.join=function(e,t){var n=(e=goog.html.SafeHtml.htmlEscape(e)).getDirection(),r=[],o=function(e){goog.isArray(e)?goog.array.forEach(e,o):(e=goog.html.SafeHtml.htmlEscape(e),r.push(goog.html.SafeHtml.unwrap(e)),e=e.getDirection(),n==goog.i18n.bidi.Dir.NEUTRAL?n=e:e!=goog.i18n.bidi.Dir.NEUTRAL&&n!=e&&(n=null))};return goog.array.forEach(t,o),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(r.join(goog.html.SafeHtml.unwrap(e)),n)},goog.html.SafeHtml.concat=function(e){return goog.html.SafeHtml.join(goog.html.SafeHtml.EMPTY,Array.prototype.slice.call(arguments))},goog.html.SafeHtml.concatWithDir=function(e,t){var n=goog.html.SafeHtml.concat(goog.array.slice(arguments,1));return n.dir_=e,n},goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={},goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse=function(e,t){return(new goog.html.SafeHtml).initSecurityPrivateDoNotAccessOrElse_(e,t)},goog.html.SafeHtml.prototype.initSecurityPrivateDoNotAccessOrElse_=function(e,t){return this.privateDoNotAccessOrElseSafeHtmlWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createHTML(e):e,this.dir_=t,this},goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse=function(e,t,n){var r=null,o="<"+e+goog.html.SafeHtml.stringifyAttributes(e,t);return goog.isDefAndNotNull(n)?goog.isArray(n)||(n=[n]):n=[],goog.dom.tags.isVoidTag(e.toLowerCase())?(goog.asserts.assert(!n.length,"Void tag <"+e+"> does not allow content."),o+=">"):(r=goog.html.SafeHtml.concat(n),o+=">"+goog.html.SafeHtml.unwrap(r)+"</"+e+">",r=r.getDirection()),(e=t&&t.dir)&&(r=/^(ltr|rtl|auto)$/i.test(e)?goog.i18n.bidi.Dir.NEUTRAL:null),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(o,r)},goog.html.SafeHtml.stringifyAttributes=function(e,t){var n="";if(t)for(var r in t){if(!goog.html.SafeHtml.VALID_NAMES_IN_TAG_.test(r))throw Error('Invalid attribute name "'+r+'".');var o=t[r];goog.isDefAndNotNull(o)&&(n+=" "+goog.html.SafeHtml.getAttrNameAndValue_(e,r,o))}return n},goog.html.SafeHtml.combineAttributes=function(e,t,n){var r,o={};for(r in e)goog.asserts.assert(r.toLowerCase()==r,"Must be lower case"),o[r]=e[r];for(r in t)goog.asserts.assert(r.toLowerCase()==r,"Must be lower case"),o[r]=t[r];for(r in n){var i=r.toLowerCase();if(i in e)throw Error('Cannot override "'+i+'" attribute, got "'+r+'" with value "'+n[r]+'"');i in t&&delete o[i],o[r]=n[r]}return o},goog.html.SafeHtml.DOCTYPE_HTML=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("<!DOCTYPE html>",goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.EMPTY=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("",goog.i18n.bidi.Dir.NEUTRAL),goog.html.SafeHtml.BR=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("<br>",goog.i18n.bidi.Dir.NEUTRAL),goog.html.uncheckedconversions={},goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract=function(e,t,n){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(t,n||null)},goog.html.uncheckedconversions.safeScriptFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.safeStyleFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.safeStyleSheetFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.safeUrlFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(t)},goog.html.uncheckedconversions.trustedResourceUrlFromStringKnownToSatisfyTypeContract=function(e,t){return goog.asserts.assertString(goog.string.Const.unwrap(e),"must provide justification"),goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap(e)),"must provide non-empty justification"),goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(t)},goog.dom.safe={},goog.dom.safe.InsertAdjacentHtmlPosition={AFTERBEGIN:"afterbegin",AFTEREND:"afterend",BEFOREBEGIN:"beforebegin",BEFOREEND:"beforeend"},goog.dom.safe.insertAdjacentHtml=function(e,t,n){e.insertAdjacentHTML(t,goog.html.SafeHtml.unwrapTrustedHTML(n))},goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_={MATH:!0,SCRIPT:!0,STYLE:!0,SVG:!0,TEMPLATE:!0},goog.dom.safe.isInnerHtmlCleanupRecursive_=goog.functions.cacheReturnValue((function(){if(goog.DEBUG&&"undefined"==typeof document)return!1;var e=document.createElement("div"),t=document.createElement("div");return t.appendChild(document.createElement("div")),e.appendChild(t),!(goog.DEBUG&&!e.firstChild)&&(t=e.firstChild.firstChild,e.innerHTML=goog.html.SafeHtml.unwrapTrustedHTML(goog.html.SafeHtml.EMPTY),!t.parentElement)})),goog.dom.safe.unsafeSetInnerHtmlDoNotUseOrElse=function(e,t){if(goog.dom.safe.isInnerHtmlCleanupRecursive_())for(;e.lastChild;)e.removeChild(e.lastChild);e.innerHTML=goog.html.SafeHtml.unwrapTrustedHTML(t)},goog.dom.safe.setInnerHtml=function(e,t){if(goog.asserts.ENABLE_ASSERTS){var n=e.tagName.toUpperCase();if(goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_[n])throw Error("goog.dom.safe.setInnerHtml cannot be used to set content of "+e.tagName+".")}goog.dom.safe.unsafeSetInnerHtmlDoNotUseOrElse(e,t)},goog.dom.safe.setOuterHtml=function(e,t){e.outerHTML=goog.html.SafeHtml.unwrapTrustedHTML(t)},goog.dom.safe.setFormElementAction=function(e,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),goog.dom.asserts.assertIsHTMLFormElement(e).action=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setButtonFormAction=function(e,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),goog.dom.asserts.assertIsHTMLButtonElement(e).formAction=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setInputFormAction=function(e,t){t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),goog.dom.asserts.assertIsHTMLInputElement(e).formAction=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setStyle=function(e,t){e.style.cssText=goog.html.SafeStyle.unwrap(t)},goog.dom.safe.documentWrite=function(e,t){e.write(goog.html.SafeHtml.unwrapTrustedHTML(t))},goog.dom.safe.setAnchorHref=function(e,t){goog.dom.asserts.assertIsHTMLAnchorElement(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.href=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setImageSrc=function(e,t){if(goog.dom.asserts.assertIsHTMLImageElement(e),!(t instanceof goog.html.SafeUrl)){var n=/^data:image\//i.test(t);t=goog.html.SafeUrl.sanitizeAssertUnchanged(t,n)}e.src=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setAudioSrc=function(e,t){if(goog.dom.asserts.assertIsHTMLAudioElement(e),!(t instanceof goog.html.SafeUrl)){var n=/^data:audio\//i.test(t);t=goog.html.SafeUrl.sanitizeAssertUnchanged(t,n)}e.src=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setVideoSrc=function(e,t){if(goog.dom.asserts.assertIsHTMLVideoElement(e),!(t instanceof goog.html.SafeUrl)){var n=/^data:video\//i.test(t);t=goog.html.SafeUrl.sanitizeAssertUnchanged(t,n)}e.src=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.setEmbedSrc=function(e,t){goog.dom.asserts.assertIsHTMLEmbedElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(t)},goog.dom.safe.setFrameSrc=function(e,t){goog.dom.asserts.assertIsHTMLFrameElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedURL(t)},goog.dom.safe.setIframeSrc=function(e,t){goog.dom.asserts.assertIsHTMLIFrameElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedURL(t)},goog.dom.safe.setIframeSrcdoc=function(e,t){goog.dom.asserts.assertIsHTMLIFrameElement(e),e.srcdoc=goog.html.SafeHtml.unwrapTrustedHTML(t)},goog.dom.safe.setLinkHrefAndRel=function(e,t,n){goog.dom.asserts.assertIsHTMLLinkElement(e),e.rel=n,goog.string.internal.caseInsensitiveContains(n,"stylesheet")?(goog.asserts.assert(t instanceof goog.html.TrustedResourceUrl,'URL must be TrustedResourceUrl because "rel" contains "stylesheet"'),e.href=goog.html.TrustedResourceUrl.unwrapTrustedURL(t)):e.href=t instanceof goog.html.TrustedResourceUrl?goog.html.TrustedResourceUrl.unwrapTrustedURL(t):t instanceof goog.html.SafeUrl?goog.html.SafeUrl.unwrapTrustedURL(t):goog.html.SafeUrl.unwrapTrustedURL(goog.html.SafeUrl.sanitizeAssertUnchanged(t))},goog.dom.safe.setObjectData=function(e,t){goog.dom.asserts.assertIsHTMLObjectElement(e),e.data=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(t)},goog.dom.safe.setScriptSrc=function(e,t){goog.dom.asserts.assertIsHTMLScriptElement(e),e.src=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(t),(t=goog.getScriptNonce())&&e.setAttribute("nonce",t)},goog.dom.safe.setScriptContent=function(e,t){goog.dom.asserts.assertIsHTMLScriptElement(e),e.text=goog.html.SafeScript.unwrapTrustedScript(t),(t=goog.getScriptNonce())&&e.setAttribute("nonce",t)},goog.dom.safe.setLocationHref=function(e,t){goog.dom.asserts.assertIsLocation(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.href=goog.html.SafeUrl.unwrapTrustedURL(t)},goog.dom.safe.assignLocation=function(e,t){goog.dom.asserts.assertIsLocation(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.assign(goog.html.SafeUrl.unwrapTrustedURL(t))},goog.dom.safe.replaceLocation=function(e,t){goog.dom.asserts.assertIsLocation(e),t=t instanceof goog.html.SafeUrl?t:goog.html.SafeUrl.sanitizeAssertUnchanged(t),e.replace(goog.html.SafeUrl.unwrapTrustedURL(t))},goog.dom.safe.openInWindow=function(e,t,n,r,o){return e=e instanceof goog.html.SafeUrl?e:goog.html.SafeUrl.sanitizeAssertUnchanged(e),(t||goog.global).open(goog.html.SafeUrl.unwrapTrustedURL(e),n?goog.string.Const.unwrap(n):"",r,o)},goog.dom.safe.parseFromStringHtml=function(e,t){return goog.dom.safe.parseFromString(e,t,"text/html")},goog.dom.safe.parseFromString=function(e,t,n){return e.parseFromString(goog.html.SafeHtml.unwrapTrustedHTML(t),n)},goog.dom.safe.createImageFromBlob=function(e){if(!/^image\/.*/g.test(e.type))throw Error("goog.dom.safe.createImageFromBlob only accepts MIME type image/.*.");var t=goog.global.URL.createObjectURL(e);return(e=new goog.global.Image).onload=function(){goog.global.URL.revokeObjectURL(t)},goog.dom.safe.setImageSrc(e,goog.html.uncheckedconversions.safeUrlFromStringKnownToSatisfyTypeContract(goog.string.Const.from("Image blob URL."),t)),e},goog.string.DETECT_DOUBLE_ESCAPING=!1,goog.string.FORCE_NON_DOM_HTML_UNESCAPING=!1,goog.string.Unicode={NBSP:" "},goog.string.startsWith=goog.string.internal.startsWith,goog.string.endsWith=goog.string.internal.endsWith,goog.string.caseInsensitiveStartsWith=goog.string.internal.caseInsensitiveStartsWith,goog.string.caseInsensitiveEndsWith=goog.string.internal.caseInsensitiveEndsWith,goog.string.caseInsensitiveEquals=goog.string.internal.caseInsensitiveEquals,goog.string.subs=function(e,t){for(var n=e.split("%s"),r="",o=Array.prototype.slice.call(arguments,1);o.length&&1<n.length;)r+=n.shift()+o.shift();return r+n.join("%s")},goog.string.collapseWhitespace=function(e){return e.replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},goog.string.isEmptyOrWhitespace=goog.string.internal.isEmptyOrWhitespace,goog.string.isEmptyString=function(e){return 0==e.length},goog.string.isEmpty=goog.string.isEmptyOrWhitespace,goog.string.isEmptyOrWhitespaceSafe=function(e){return goog.string.isEmptyOrWhitespace(goog.string.makeSafe(e))},goog.string.isEmptySafe=goog.string.isEmptyOrWhitespaceSafe,goog.string.isBreakingWhitespace=function(e){return!/[^\t\n\r ]/.test(e)},goog.string.isAlpha=function(e){return!/[^a-zA-Z]/.test(e)},goog.string.isNumeric=function(e){return!/[^0-9]/.test(e)},goog.string.isAlphaNumeric=function(e){return!/[^a-zA-Z0-9]/.test(e)},goog.string.isSpace=function(e){return" "==e},goog.string.isUnicodeChar=function(e){return 1==e.length&&" "<=e&&"~">=e||""<=e&&"�">=e},goog.string.stripNewlines=function(e){return e.replace(/(\r\n|\r|\n)+/g," ")},goog.string.canonicalizeNewlines=function(e){return e.replace(/(\r\n|\r|\n)/g,"\n")},goog.string.normalizeWhitespace=function(e){return e.replace(/\xa0|\s/g," ")},goog.string.normalizeSpaces=function(e){return e.replace(/\xa0|[ \t]+/g," ")},goog.string.collapseBreakingSpaces=function(e){return e.replace(/[\t\r\n ]+/g," ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g,"")},goog.string.trim=goog.string.internal.trim,goog.string.trimLeft=function(e){return e.replace(/^[\s\xa0]+/,"")},goog.string.trimRight=function(e){return e.replace(/[\s\xa0]+$/,"")},goog.string.caseInsensitiveCompare=goog.string.internal.caseInsensitiveCompare,goog.string.numberAwareCompare_=function(e,t,n){if(e==t)return 0;if(!e)return-1;if(!t)return 1;for(var r=e.toLowerCase().match(n),o=t.toLowerCase().match(n),i=Math.min(r.length,o.length),a=0;a<i;a++){n=r[a];var s=o[a];if(n!=s)return e=parseInt(n,10),!isNaN(e)&&(t=parseInt(s,10),!isNaN(t)&&e-t)?e-t:n<s?-1:1}return r.length!=o.length?r.length-o.length:e<t?-1:1},goog.string.intAwareCompare=function(e,t){return goog.string.numberAwareCompare_(e,t,/\d+|\D+/g)},goog.string.floatAwareCompare=function(e,t){return goog.string.numberAwareCompare_(e,t,/\d+|\.\d+|\D+/g)},goog.string.numerateCompare=goog.string.floatAwareCompare,goog.string.urlEncode=function(e){return encodeURIComponent(String(e))},goog.string.urlDecode=function(e){return decodeURIComponent(e.replace(/\+/g," "))},goog.string.newLineToBr=goog.string.internal.newLineToBr,goog.string.htmlEscape=function(e,t){return e=goog.string.internal.htmlEscape(e,t),goog.string.DETECT_DOUBLE_ESCAPING&&(e=e.replace(goog.string.E_RE_,"e")),e},goog.string.E_RE_=/e/g,goog.string.unescapeEntities=function(e){return goog.string.contains(e,"&")?!goog.string.FORCE_NON_DOM_HTML_UNESCAPING&&"document"in goog.global?goog.string.unescapeEntitiesUsingDom_(e):goog.string.unescapePureXmlEntities_(e):e},goog.string.unescapeEntitiesWithDocument=function(e,t){return goog.string.contains(e,"&")?goog.string.unescapeEntitiesUsingDom_(e,t):e},goog.string.unescapeEntitiesUsingDom_=function(e,t){var n={"&":"&","<":"<",">":">",""":'"'},r=t?t.createElement("div"):goog.global.document.createElement("div");return e.replace(goog.string.HTML_ENTITY_PATTERN_,(function(e,t){var o=n[e];return o||("#"==t.charAt(0)&&(t=Number("0"+t.substr(1)),isNaN(t)||(o=String.fromCharCode(t))),o||(goog.dom.safe.setInnerHtml(r,goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract(goog.string.Const.from("Single HTML entity."),e+" ")),o=r.firstChild.nodeValue.slice(0,-1)),n[e]=o)}))},goog.string.unescapePureXmlEntities_=function(e){return e.replace(/&([^;]+);/g,(function(e,t){switch(t){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';default:return"#"!=t.charAt(0)||(t=Number("0"+t.substr(1)),isNaN(t))?e:String.fromCharCode(t)}}))},goog.string.HTML_ENTITY_PATTERN_=/&([^;\s<&]+);?/g,goog.string.whitespaceEscape=function(e,t){return goog.string.newLineToBr(e.replace(/ /g,"  "),t)},goog.string.preserveSpaces=function(e){return e.replace(/(^|[\n ]) /g,"$1"+goog.string.Unicode.NBSP)},goog.string.stripQuotes=function(e,t){for(var n=t.length,r=0;r<n;r++){var o=1==n?t:t.charAt(r);if(e.charAt(0)==o&&e.charAt(e.length-1)==o)return e.substring(1,e.length-1)}return e},goog.string.truncate=function(e,t,n){return n&&(e=goog.string.unescapeEntities(e)),e.length>t&&(e=e.substring(0,t-3)+"..."),n&&(e=goog.string.htmlEscape(e)),e},goog.string.truncateMiddle=function(e,t,n,r){if(n&&(e=goog.string.unescapeEntities(e)),r&&e.length>t){r>t&&(r=t);var o=e.length-r;e=e.substring(0,t-r)+"..."+e.substring(o)}else e.length>t&&(r=Math.floor(t/2),o=e.length-r,e=e.substring(0,r+t%2)+"..."+e.substring(o));return n&&(e=goog.string.htmlEscape(e)),e},goog.string.specialEscapeChars_={"\0":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\x0B",'"':'\\"',"\\":"\\\\","<":"\\u003C"},goog.string.jsEscapeCache_={"'":"\\'"},goog.string.quote=function(e){e=String(e);for(var t=['"'],n=0;n<e.length;n++){var r=e.charAt(n),o=r.charCodeAt(0);t[n+1]=goog.string.specialEscapeChars_[r]||(31<o&&127>o?r:goog.string.escapeChar(r))}return t.push('"'),t.join("")},goog.string.escapeString=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=goog.string.escapeChar(e.charAt(n));return t.join("")},goog.string.escapeChar=function(e){if(e in goog.string.jsEscapeCache_)return goog.string.jsEscapeCache_[e];if(e in goog.string.specialEscapeChars_)return goog.string.jsEscapeCache_[e]=goog.string.specialEscapeChars_[e];var t=e.charCodeAt(0);if(31<t&&127>t)var n=e;else 256>t?(n="\\x",(16>t||256<t)&&(n+="0")):(n="\\u",4096>t&&(n+="0")),n+=t.toString(16).toUpperCase();return goog.string.jsEscapeCache_[e]=n},goog.string.contains=goog.string.internal.contains,goog.string.caseInsensitiveContains=goog.string.internal.caseInsensitiveContains,goog.string.countOf=function(e,t){return e&&t?e.split(t).length-1:0},goog.string.removeAt=function(e,t,n){var r=e;return 0<=t&&t<e.length&&0<n&&(r=e.substr(0,t)+e.substr(t+n,e.length-t-n)),r},goog.string.remove=function(e,t){return e.replace(t,"")},goog.string.removeAll=function(e,t){return t=new RegExp(goog.string.regExpEscape(t),"g"),e.replace(t,"")},goog.string.replaceAll=function(e,t,n){return t=new RegExp(goog.string.regExpEscape(t),"g"),e.replace(t,n.replace(/\$/g,"$$$$"))},goog.string.regExpEscape=function(e){return String(e).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},goog.string.repeat=String.prototype.repeat?function(e,t){return e.repeat(t)}:function(e,t){return Array(t+1).join(e)},goog.string.padNumber=function(e,t,n){return-1==(n=(e=goog.isDef(n)?e.toFixed(n):String(e)).indexOf("."))&&(n=e.length),goog.string.repeat("0",Math.max(0,t-n))+e},goog.string.makeSafe=function(e){return null==e?"":String(e)},goog.string.buildString=function(e){return Array.prototype.join.call(arguments,"")},goog.string.getRandomString=function(){return Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^goog.now()).toString(36)},goog.string.compareVersions=goog.string.internal.compareVersions,goog.string.hashCode=function(e){for(var t=0,n=0;n<e.length;++n)t=31*t+e.charCodeAt(n)>>>0;return t},goog.string.uniqueStringCounter_=2147483648*Math.random()|0,goog.string.createUniqueString=function(){return"goog_"+goog.string.uniqueStringCounter_++},goog.string.toNumber=function(e){var t=Number(e);return 0==t&&goog.string.isEmptyOrWhitespace(e)?NaN:t},goog.string.isLowerCamelCase=function(e){return/^[a-z]+([A-Z][a-z]*)*$/.test(e)},goog.string.isUpperCamelCase=function(e){return/^([A-Z][a-z]*)+$/.test(e)},goog.string.toCamelCase=function(e){return String(e).replace(/\-([a-z])/g,(function(e,t){return t.toUpperCase()}))},goog.string.toSelectorCase=function(e){return String(e).replace(/([A-Z])/g,"-$1").toLowerCase()},goog.string.toTitleCase=function(e,t){return t=goog.isString(t)?goog.string.regExpEscape(t):"\\s",e.replace(new RegExp("(^"+(t?"|["+t+"]+":"")+")([a-z])","g"),(function(e,t,n){return t+n.toUpperCase()}))},goog.string.capitalize=function(e){return String(e.charAt(0)).toUpperCase()+String(e.substr(1)).toLowerCase()},goog.string.parseInt=function(e){return isFinite(e)&&(e=String(e)),goog.isString(e)?/^\s*-?0x/i.test(e)?parseInt(e,16):parseInt(e,10):NaN},goog.string.splitLimit=function(e,t,n){e=e.split(t);for(var r=[];0<n&&e.length;)r.push(e.shift()),n--;return e.length&&r.push(e.join(t)),r},goog.string.lastComponent=function(e,t){if(!t)return e;"string"==typeof t&&(t=[t]);for(var n=-1,r=0;r<t.length;r++)if(""!=t[r]){var o=e.lastIndexOf(t[r]);o>n&&(n=o)}return-1==n?e:e.slice(n+1)},goog.string.editDistance=function(e,t){var n=[],r=[];if(e==t)return 0;if(!e.length||!t.length)return Math.max(e.length,t.length);for(var o=0;o<t.length+1;o++)n[o]=o;for(o=0;o<e.length;o++){r[0]=o+1;for(var i=0;i<t.length;i++)r[i+1]=Math.min(r[i]+1,n[i+1]+1,n[i]+Number(e[o]!=t[i]));for(i=0;i<n.length;i++)n[i]=r[i]}return r[t.length]},goog.labs.userAgent.engine={},goog.labs.userAgent.engine.isPresto=function(){return goog.labs.userAgent.util.matchUserAgent("Presto")},goog.labs.userAgent.engine.isTrident=function(){return goog.labs.userAgent.util.matchUserAgent("Trident")||goog.labs.userAgent.util.matchUserAgent("MSIE")},goog.labs.userAgent.engine.isEdge=function(){return goog.labs.userAgent.util.matchUserAgent("Edge")},goog.labs.userAgent.engine.isWebKit=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("WebKit")&&!goog.labs.userAgent.engine.isEdge()},goog.labs.userAgent.engine.isGecko=function(){return goog.labs.userAgent.util.matchUserAgent("Gecko")&&!goog.labs.userAgent.engine.isWebKit()&&!goog.labs.userAgent.engine.isTrident()&&!goog.labs.userAgent.engine.isEdge()},goog.labs.userAgent.engine.getVersion=function(){var e=goog.labs.userAgent.util.getUserAgent();if(e){e=goog.labs.userAgent.util.extractVersionTuples(e);var t,n=goog.labs.userAgent.engine.getEngineTuple_(e);if(n)return"Gecko"==n[0]?goog.labs.userAgent.engine.getVersionForKey_(e,"Firefox"):n[1];if((e=e[0])&&(t=e[2])&&(t=/Trident\/([^\s;]+)/.exec(t)))return t[1]}return""},goog.labs.userAgent.engine.getEngineTuple_=function(e){if(!goog.labs.userAgent.engine.isEdge())return e[1];for(var t=0;t<e.length;t++){var n=e[t];if("Edge"==n[0])return n}},goog.labs.userAgent.engine.isVersionOrHigher=function(e){return 0<=goog.string.compareVersions(goog.labs.userAgent.engine.getVersion(),e)},goog.labs.userAgent.engine.getVersionForKey_=function(e,t){return(e=goog.array.find(e,(function(e){return t==e[0]})))&&e[1]||""},goog.labs.userAgent.platform={},goog.labs.userAgent.platform.isAndroid=function(){return goog.labs.userAgent.util.matchUserAgent("Android")},goog.labs.userAgent.platform.isIpod=function(){return goog.labs.userAgent.util.matchUserAgent("iPod")},goog.labs.userAgent.platform.isIphone=function(){return goog.labs.userAgent.util.matchUserAgent("iPhone")&&!goog.labs.userAgent.util.matchUserAgent("iPod")&&!goog.labs.userAgent.util.matchUserAgent("iPad")},goog.labs.userAgent.platform.isIpad=function(){return goog.labs.userAgent.util.matchUserAgent("iPad")},goog.labs.userAgent.platform.isIos=function(){return goog.labs.userAgent.platform.isIphone()||goog.labs.userAgent.platform.isIpad()||goog.labs.userAgent.platform.isIpod()},goog.labs.userAgent.platform.isMacintosh=function(){return goog.labs.userAgent.util.matchUserAgent("Macintosh")},goog.labs.userAgent.platform.isLinux=function(){return goog.labs.userAgent.util.matchUserAgent("Linux")},goog.labs.userAgent.platform.isWindows=function(){return goog.labs.userAgent.util.matchUserAgent("Windows")},goog.labs.userAgent.platform.isChromeOS=function(){return goog.labs.userAgent.util.matchUserAgent("CrOS")},goog.labs.userAgent.platform.isChromecast=function(){return goog.labs.userAgent.util.matchUserAgent("CrKey")},goog.labs.userAgent.platform.isKaiOS=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("KaiOS")},goog.labs.userAgent.platform.isGo2Phone=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("GAFP")},goog.labs.userAgent.platform.getVersion=function(){var e=goog.labs.userAgent.util.getUserAgent(),t="";return goog.labs.userAgent.platform.isWindows()?t=(e=(t=/Windows (?:NT|Phone) ([0-9.]+)/).exec(e))?e[1]:"0.0":goog.labs.userAgent.platform.isIos()?t=(e=(t=/(?:iPhone|iPod|iPad|CPU)\s+OS\s+(\S+)/).exec(e))&&e[1].replace(/_/g,"."):goog.labs.userAgent.platform.isMacintosh()?t=(e=(t=/Mac OS X ([0-9_.]+)/).exec(e))?e[1].replace(/_/g,"."):"10":goog.labs.userAgent.platform.isKaiOS()?t=(e=(t=/(?:KaiOS)\/(\S+)/i).exec(e))&&e[1]:goog.labs.userAgent.platform.isAndroid()?t=(e=(t=/Android\s+([^\);]+)(\)|;)/).exec(e))&&e[1]:goog.labs.userAgent.platform.isChromeOS()&&(t=(e=(t=/(?:CrOS\s+(?:i686|x86_64)\s+([0-9.]+))/).exec(e))&&e[1]),t||""},goog.labs.userAgent.platform.isVersionOrHigher=function(e){return 0<=goog.string.compareVersions(goog.labs.userAgent.platform.getVersion(),e)},goog.reflect={},goog.reflect.object=function(e,t){return t},goog.reflect.objectProperty=function(e,t){return e},goog.reflect.sinkValue=function(e){return goog.reflect.sinkValue[" "](e),e},goog.reflect.sinkValue[" "]=goog.nullFunction,goog.reflect.canAccessProperty=function(e,t){try{return goog.reflect.sinkValue(e[t]),!0}catch(e){}return!1},goog.reflect.cache=function(e,t,n,r){return r=r?r(t):t,Object.prototype.hasOwnProperty.call(e,r)?e[r]:e[r]=n(t)},goog.userAgent={},goog.userAgent.ASSUME_IE=!1,goog.userAgent.ASSUME_EDGE=!1,goog.userAgent.ASSUME_GECKO=!1,goog.userAgent.ASSUME_WEBKIT=!1,goog.userAgent.ASSUME_MOBILE_WEBKIT=!1,goog.userAgent.ASSUME_OPERA=!1,goog.userAgent.ASSUME_ANY_VERSION=!1,goog.userAgent.BROWSER_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_GECKO||goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_OPERA,goog.userAgent.getUserAgentString=function(){return goog.labs.userAgent.util.getUserAgent()},goog.userAgent.getNavigatorTyped=function(){return goog.global.navigator||null},goog.userAgent.getNavigator=function(){return goog.userAgent.getNavigatorTyped()},goog.userAgent.OPERA=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_OPERA:goog.labs.userAgent.browser.isOpera(),goog.userAgent.IE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_IE:goog.labs.userAgent.browser.isIE(),goog.userAgent.EDGE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_EDGE:goog.labs.userAgent.engine.isEdge(),goog.userAgent.EDGE_OR_IE=goog.userAgent.EDGE||goog.userAgent.IE,goog.userAgent.GECKO=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_GECKO:goog.labs.userAgent.engine.isGecko(),goog.userAgent.WEBKIT=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_MOBILE_WEBKIT:goog.labs.userAgent.engine.isWebKit(),goog.userAgent.isMobile_=function(){return goog.userAgent.WEBKIT&&goog.labs.userAgent.util.matchUserAgent("Mobile")},goog.userAgent.MOBILE=goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.isMobile_(),goog.userAgent.SAFARI=goog.userAgent.WEBKIT,goog.userAgent.determinePlatform_=function(){var e=goog.userAgent.getNavigatorTyped();return e&&e.platform||""},goog.userAgent.PLATFORM=goog.userAgent.determinePlatform_(),goog.userAgent.ASSUME_MAC=!1,goog.userAgent.ASSUME_WINDOWS=!1,goog.userAgent.ASSUME_LINUX=!1,goog.userAgent.ASSUME_X11=!1,goog.userAgent.ASSUME_ANDROID=!1,goog.userAgent.ASSUME_IPHONE=!1,goog.userAgent.ASSUME_IPAD=!1,goog.userAgent.ASSUME_IPOD=!1,goog.userAgent.ASSUME_KAIOS=!1,goog.userAgent.ASSUME_GO2PHONE=!1,goog.userAgent.PLATFORM_KNOWN_=goog.userAgent.ASSUME_MAC||goog.userAgent.ASSUME_WINDOWS||goog.userAgent.ASSUME_LINUX||goog.userAgent.ASSUME_X11||goog.userAgent.ASSUME_ANDROID||goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD,goog.userAgent.MAC=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_MAC:goog.labs.userAgent.platform.isMacintosh(),goog.userAgent.WINDOWS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_WINDOWS:goog.labs.userAgent.platform.isWindows(),goog.userAgent.isLegacyLinux_=function(){return goog.labs.userAgent.platform.isLinux()||goog.labs.userAgent.platform.isChromeOS()},goog.userAgent.LINUX=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_LINUX:goog.userAgent.isLegacyLinux_(),goog.userAgent.isX11_=function(){var e=goog.userAgent.getNavigatorTyped();return!!e&&goog.string.contains(e.appVersion||"","X11")},goog.userAgent.X11=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_X11:goog.userAgent.isX11_(),goog.userAgent.ANDROID=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_ANDROID:goog.labs.userAgent.platform.isAndroid(),goog.userAgent.IPHONE=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE:goog.labs.userAgent.platform.isIphone(),goog.userAgent.IPAD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad(),goog.userAgent.IPOD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIpod(),goog.userAgent.IOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIos(),goog.userAgent.KAIOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_KAIOS:goog.labs.userAgent.platform.isKaiOS(),goog.userAgent.GO2PHONE=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_GO2PHONE:goog.labs.userAgent.platform.isGo2Phone(),goog.userAgent.determineVersion_=function(){var e="",t=goog.userAgent.getVersionRegexResult_();return t&&(e=t?t[1]:""),goog.userAgent.IE&&(null!=(t=goog.userAgent.getDocumentMode_())&&t>parseFloat(e))?String(t):e},goog.userAgent.getVersionRegexResult_=function(){var e=goog.userAgent.getUserAgentString();return goog.userAgent.GECKO?/rv:([^\);]+)(\)|;)/.exec(e):goog.userAgent.EDGE?/Edge\/([\d\.]+)/.exec(e):goog.userAgent.IE?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(e):goog.userAgent.WEBKIT?/WebKit\/(\S+)/.exec(e):goog.userAgent.OPERA?/(?:Version)[ \/]?(\S+)/.exec(e):void 0},goog.userAgent.getDocumentMode_=function(){var e=goog.global.document;return e?e.documentMode:void 0},goog.userAgent.VERSION=goog.userAgent.determineVersion_(),goog.userAgent.compare=function(e,t){return goog.string.compareVersions(e,t)},goog.userAgent.isVersionOrHigherCache_={},goog.userAgent.isVersionOrHigher=function(e){return goog.userAgent.ASSUME_ANY_VERSION||goog.reflect.cache(goog.userAgent.isVersionOrHigherCache_,e,(function(){return 0<=goog.string.compareVersions(goog.userAgent.VERSION,e)}))},goog.userAgent.isVersion=goog.userAgent.isVersionOrHigher,goog.userAgent.isDocumentModeOrHigher=function(e){return Number(goog.userAgent.DOCUMENT_MODE)>=e},goog.userAgent.isDocumentMode=goog.userAgent.isDocumentModeOrHigher,goog.userAgent.DOCUMENT_MODE=function(){if(goog.global.document&&goog.userAgent.IE)return goog.userAgent.getDocumentMode_()}(),goog.userAgent.product={},goog.userAgent.product.ASSUME_FIREFOX=!1,goog.userAgent.product.ASSUME_IPHONE=!1,goog.userAgent.product.ASSUME_IPAD=!1,goog.userAgent.product.ASSUME_ANDROID=!1,goog.userAgent.product.ASSUME_CHROME=!1,goog.userAgent.product.ASSUME_SAFARI=!1,goog.userAgent.product.PRODUCT_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_OPERA||goog.userAgent.product.ASSUME_FIREFOX||goog.userAgent.product.ASSUME_IPHONE||goog.userAgent.product.ASSUME_IPAD||goog.userAgent.product.ASSUME_ANDROID||goog.userAgent.product.ASSUME_CHROME||goog.userAgent.product.ASSUME_SAFARI,goog.userAgent.product.OPERA=goog.userAgent.OPERA,goog.userAgent.product.IE=goog.userAgent.IE,goog.userAgent.product.EDGE=goog.userAgent.EDGE,goog.userAgent.product.FIREFOX=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_FIREFOX:goog.labs.userAgent.browser.isFirefox(),goog.userAgent.product.isIphoneOrIpod_=function(){return goog.labs.userAgent.platform.isIphone()||goog.labs.userAgent.platform.isIpod()},goog.userAgent.product.IPHONE=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPHONE:goog.userAgent.product.isIphoneOrIpod_(),goog.userAgent.product.IPAD=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad(),goog.userAgent.product.ANDROID=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_ANDROID:goog.labs.userAgent.browser.isAndroidBrowser(),goog.userAgent.product.CHROME=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_CHROME:goog.labs.userAgent.browser.isChrome(),goog.userAgent.product.isSafariDesktop_=function(){return goog.labs.userAgent.browser.isSafari()&&!goog.labs.userAgent.platform.isIos()},goog.userAgent.product.SAFARI=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_SAFARI:goog.userAgent.product.isSafariDesktop_(),goog.crypt.base64={},goog.crypt.base64.DEFAULT_ALPHABET_COMMON_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",goog.crypt.base64.ENCODED_VALS=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_+"+/=",goog.crypt.base64.ENCODED_VALS_WEBSAFE=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_+"-_.",goog.crypt.base64.Alphabet={DEFAULT:0,NO_PADDING:1,WEBSAFE:2,WEBSAFE_DOT_PADDING:3,WEBSAFE_NO_PADDING:4},goog.crypt.base64.paddingChars_="=.",goog.crypt.base64.isPadding_=function(e){return goog.string.contains(goog.crypt.base64.paddingChars_,e)},goog.crypt.base64.byteToCharMaps_={};goog.crypt.base64.charToByteMap_=null,goog.crypt.base64.ASSUME_NATIVE_SUPPORT_=goog.userAgent.GECKO||goog.userAgent.WEBKIT&&!goog.userAgent.product.SAFARI||goog.userAgent.OPERA,goog.crypt.base64.HAS_NATIVE_ENCODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||"function"==typeof goog.global.btoa,goog.crypt.base64.HAS_NATIVE_DECODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||!goog.userAgent.product.SAFARI&&!goog.userAgent.IE&&"function"==typeof goog.global.atob,goog.crypt.base64.encodeByteArray=function(e,t){goog.asserts.assert(goog.isArrayLike(e),"encodeByteArray takes an array as a parameter"),void 0===t&&(t=goog.crypt.base64.Alphabet.DEFAULT),goog.crypt.base64.init_(),t=goog.crypt.base64.byteToCharMaps_[t];for(var n=[],r=0;r<e.length;r+=3){var o=e[r],i=r+1<e.length,a=i?e[r+1]:0,s=r+2<e.length,l=s?e[r+2]:0,u=o>>2;o=(3&o)<<4|a>>4,a=(15&a)<<2|l>>6,l&=63,s||(l=64,i||(a=64)),n.push(t[u],t[o],t[a]||"",t[l]||"")}return n.join("")},goog.crypt.base64.encodeString=function(e,t){return goog.crypt.base64.HAS_NATIVE_ENCODE_&&!t?goog.global.btoa(e):goog.crypt.base64.encodeByteArray(goog.crypt.stringToByteArray(e),t)},goog.crypt.base64.decodeString=function(e,t){if(goog.crypt.base64.HAS_NATIVE_DECODE_&&!t)return goog.global.atob(e);var n="";return goog.crypt.base64.decodeStringInternal_(e,(function(e){n+=String.fromCharCode(e)})),n},goog.crypt.base64.decodeStringToByteArray=function(e,t){var n=[];return goog.crypt.base64.decodeStringInternal_(e,(function(e){n.push(e)})),n},goog.crypt.base64.decodeStringToUint8Array=function(e){goog.asserts.assert(!goog.userAgent.IE||goog.userAgent.isVersionOrHigher("10"),"Browser does not support typed arrays");var t=e.length,n=3*t/4;n%3?n=Math.floor(n):goog.crypt.base64.isPadding_(e[t-1])&&(n=goog.crypt.base64.isPadding_(e[t-2])?n-2:n-1);var r=new Uint8Array(n),o=0;return goog.crypt.base64.decodeStringInternal_(e,(function(e){r[o++]=e})),r.subarray(0,o)},goog.crypt.base64.decodeStringInternal_=function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),o=goog.crypt.base64.charToByteMap_[n];if(null!=o)return o;if(!goog.string.isEmptyOrWhitespace(n))throw Error("Unknown base64 encoding at char: "+n)}return t}goog.crypt.base64.init_();for(var r=0;;){var o=n(-1),i=n(0),a=n(64),s=n(64);if(64===s&&-1===o)break;t(o<<2|i>>4),64!=a&&(t(i<<4&240|a>>2),64!=s&&t(a<<6&192|s))}},goog.crypt.base64.init_=function(){if(!goog.crypt.base64.charToByteMap_){goog.crypt.base64.charToByteMap_={};for(var e=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_.split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));goog.crypt.base64.byteToCharMaps_[n]=r;for(var o=0;o<r.length;o++){var i=r[o],a=goog.crypt.base64.charToByteMap_[i];void 0===a?goog.crypt.base64.charToByteMap_[i]=o:goog.asserts.assert(a===o)}}}},jspb.utils={},jspb.utils.split64Low=0,jspb.utils.split64High=0,jspb.utils.splitUint64=function(e){var t=e>>>0;e=Math.floor((e-t)/jspb.BinaryConstants.TWO_TO_32)>>>0,jspb.utils.split64Low=t,jspb.utils.split64High=e},jspb.utils.splitInt64=function(e){var t=0>e,n=(e=Math.abs(e))>>>0;e=Math.floor((e-n)/jspb.BinaryConstants.TWO_TO_32),e>>>=0,t&&(e=~e>>>0,4294967295<(n=1+(~n>>>0))&&(n=0,4294967295<++e&&(e=0))),jspb.utils.split64Low=n,jspb.utils.split64High=e},jspb.utils.splitZigzag64=function(e){var t=0>e;e=2*Math.abs(e),jspb.utils.splitUint64(e),e=jspb.utils.split64Low;var n=jspb.utils.split64High;t&&(0==e?0==n?n=e=4294967295:(n--,e=4294967295):e--),jspb.utils.split64Low=e,jspb.utils.split64High=n},jspb.utils.splitFloat32=function(e){var t=0>e?1:0;if(0===(e=t?-e:e))0<1/e?(jspb.utils.split64High=0,jspb.utils.split64Low=0):(jspb.utils.split64High=0,jspb.utils.split64Low=2147483648);else if(isNaN(e))jspb.utils.split64High=0,jspb.utils.split64Low=2147483647;else if(e>jspb.BinaryConstants.FLOAT32_MAX)jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|2139095040)>>>0;else if(e<jspb.BinaryConstants.FLOAT32_MIN)e=Math.round(e/Math.pow(2,-149)),jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|e)>>>0;else{var n=Math.floor(Math.log(e)/Math.LN2);e*=Math.pow(2,-n),e=8388607&Math.round(e*jspb.BinaryConstants.TWO_TO_23),jspb.utils.split64High=0,jspb.utils.split64Low=(t<<31|n+127<<23|e)>>>0}},jspb.utils.splitFloat64=function(e){var t=0>e?1:0;if(0===(e=t?-e:e))jspb.utils.split64High=0<1/e?0:2147483648,jspb.utils.split64Low=0;else if(isNaN(e))jspb.utils.split64High=2147483647,jspb.utils.split64Low=4294967295;else if(e>jspb.BinaryConstants.FLOAT64_MAX)jspb.utils.split64High=(t<<31|2146435072)>>>0,jspb.utils.split64Low=0;else if(e<jspb.BinaryConstants.FLOAT64_MIN){var n=e/Math.pow(2,-1074);e=n/jspb.BinaryConstants.TWO_TO_32,jspb.utils.split64High=(t<<31|e)>>>0,jspb.utils.split64Low=n>>>0}else{var r=0;if(2<=(n=e))for(;2<=n&&1023>r;)r++,n/=2;else for(;1>n&&-1022<r;)n*=2,r--;e=(n=e*Math.pow(2,-r))*jspb.BinaryConstants.TWO_TO_20&1048575,n=n*jspb.BinaryConstants.TWO_TO_52>>>0,jspb.utils.split64High=(t<<31|r+1023<<20|e)>>>0,jspb.utils.split64Low=n}},jspb.utils.splitHash64=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),o=e.charCodeAt(3),i=e.charCodeAt(4),a=e.charCodeAt(5),s=e.charCodeAt(6);e=e.charCodeAt(7),jspb.utils.split64Low=t+(n<<8)+(r<<16)+(o<<24)>>>0,jspb.utils.split64High=i+(a<<8)+(s<<16)+(e<<24)>>>0},jspb.utils.joinUint64=function(e,t){return t*jspb.BinaryConstants.TWO_TO_32+(e>>>0)},jspb.utils.joinInt64=function(e,t){var n=2147483648&t;return n&&(t=~t>>>0,0==(e=1+~e>>>0)&&(t=t+1>>>0)),e=jspb.utils.joinUint64(e,t),n?-e:e},jspb.utils.toZigzag64=function(e,t,n){var r=t>>31;return n(e<<1^r,(t<<1|e>>>31)^r)},jspb.utils.joinZigzag64=function(e,t){return jspb.utils.fromZigzag64(e,t,jspb.utils.joinInt64)},jspb.utils.fromZigzag64=function(e,t,n){var r=-(1&e);return n((e>>>1|t<<31)^r,t>>>1^r)},jspb.utils.joinFloat32=function(e,t){t=2*(e>>31)+1;var n=e>>>23&255;return e&=8388607,255==n?e?NaN:1/0*t:0==n?t*Math.pow(2,-149)*e:t*Math.pow(2,n-150)*(e+Math.pow(2,23))},jspb.utils.joinFloat64=function(e,t){var n=2*(t>>31)+1,r=t>>>20&2047;return e=jspb.BinaryConstants.TWO_TO_32*(1048575&t)+e,2047==r?e?NaN:1/0*n:0==r?n*Math.pow(2,-1074)*e:n*Math.pow(2,r-1075)*(e+jspb.BinaryConstants.TWO_TO_52)},jspb.utils.joinHash64=function(e,t){return String.fromCharCode(e>>>0&255,e>>>8&255,e>>>16&255,e>>>24&255,t>>>0&255,t>>>8&255,t>>>16&255,t>>>24&255)},jspb.utils.DIGITS="0123456789abcdef".split(""),jspb.utils.ZERO_CHAR_CODE_=48,jspb.utils.A_CHAR_CODE_=97,jspb.utils.joinUnsignedDecimalString=function(e,t){function n(e,t){return e=e?String(e):"",t?"0000000".slice(e.length)+e:e}if(2097151>=t)return""+jspb.utils.joinUint64(e,t);var r=(e>>>24|t<<8)>>>0&16777215;return e=(16777215&e)+6777216*r+6710656*(t=t>>16&65535),r+=8147497*t,t*=2,1e7<=e&&(r+=Math.floor(e/1e7),e%=1e7),1e7<=r&&(t+=Math.floor(r/1e7),r%=1e7),n(t,0)+n(r,t)+n(e,1)},jspb.utils.joinSignedDecimalString=function(e,t){var n=2147483648&t;return n&&(t=~t+(0==(e=1+~e>>>0)?1:0)>>>0),e=jspb.utils.joinUnsignedDecimalString(e,t),n?"-"+e:e},jspb.utils.hash64ToDecimalString=function(e,t){jspb.utils.splitHash64(e),e=jspb.utils.split64Low;var n=jspb.utils.split64High;return t?jspb.utils.joinSignedDecimalString(e,n):jspb.utils.joinUnsignedDecimalString(e,n)},jspb.utils.hash64ArrayToDecimalStrings=function(e,t){for(var n=Array(e.length),r=0;r<e.length;r++)n[r]=jspb.utils.hash64ToDecimalString(e[r],t);return n},jspb.utils.decimalStringToHash64=function(e){function t(e,t){for(var n=0;8>n&&(1!==e||0<t);n++)t=e*r[n]+t,r[n]=255&t,t>>>=8}goog.asserts.assert(0<e.length);var n=!1;"-"===e[0]&&(n=!0,e=e.slice(1));for(var r=[0,0,0,0,0,0,0,0],o=0;o<e.length;o++)t(10,e.charCodeAt(o)-jspb.utils.ZERO_CHAR_CODE_);return n&&(function(){for(var e=0;8>e;e++)r[e]=255&~r[e]}(),t(1,1)),goog.crypt.byteArrayToString(r)},jspb.utils.splitDecimalString=function(e){jspb.utils.splitHash64(jspb.utils.decimalStringToHash64(e))},jspb.utils.toHexDigit_=function(e){return String.fromCharCode(10>e?jspb.utils.ZERO_CHAR_CODE_+e:jspb.utils.A_CHAR_CODE_-10+e)},jspb.utils.fromHexCharCode_=function(e){return e>=jspb.utils.A_CHAR_CODE_?e-jspb.utils.A_CHAR_CODE_+10:e-jspb.utils.ZERO_CHAR_CODE_},jspb.utils.hash64ToHexString=function(e){var t=Array(18);t[0]="0",t[1]="x";for(var n=0;8>n;n++){var r=e.charCodeAt(7-n);t[2*n+2]=jspb.utils.toHexDigit_(r>>4),t[2*n+3]=jspb.utils.toHexDigit_(15&r)}return t.join("")},jspb.utils.hexStringToHash64=function(e){e=e.toLowerCase(),goog.asserts.assert(18==e.length),goog.asserts.assert("0"==e[0]),goog.asserts.assert("x"==e[1]);for(var t="",n=0;8>n;n++){var r=jspb.utils.fromHexCharCode_(e.charCodeAt(2*n+2)),o=jspb.utils.fromHexCharCode_(e.charCodeAt(2*n+3));t=String.fromCharCode(16*r+o)+t}return t},jspb.utils.hash64ToNumber=function(e,t){jspb.utils.splitHash64(e),e=jspb.utils.split64Low;var n=jspb.utils.split64High;return t?jspb.utils.joinInt64(e,n):jspb.utils.joinUint64(e,n)},jspb.utils.numberToHash64=function(e){return jspb.utils.splitInt64(e),jspb.utils.joinHash64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.utils.countVarints=function(e,t,n){for(var r=0,o=t;o<n;o++)r+=e[o]>>7;return n-t-r},jspb.utils.countVarintFields=function(e,t,n,r){var o=0;if(128>(r=8*r+jspb.BinaryConstants.WireType.VARINT))for(;t<n&&e[t++]==r;)for(o++;;){var i=e[t++];if(0==(128&i))break}else for(;t<n;){for(i=r;128<i;){if(e[t]!=(127&i|128))return o;t++,i>>=7}if(e[t++]!=i)break;for(o++;0!=(128&(i=e[t++])););}return o},jspb.utils.countFixedFields_=function(e,t,n,r,o){var i=0;if(128>r)for(;t<n&&e[t++]==r;)i++,t+=o;else for(;t<n;){for(var a=r;128<a;){if(e[t++]!=(127&a|128))return i;a>>=7}if(e[t++]!=a)break;i++,t+=o}return i},jspb.utils.countFixed32Fields=function(e,t,n,r){return jspb.utils.countFixedFields_(e,t,n,8*r+jspb.BinaryConstants.WireType.FIXED32,4)},jspb.utils.countFixed64Fields=function(e,t,n,r){return jspb.utils.countFixedFields_(e,t,n,8*r+jspb.BinaryConstants.WireType.FIXED64,8)},jspb.utils.countDelimitedFields=function(e,t,n,r){var o=0;for(r=8*r+jspb.BinaryConstants.WireType.DELIMITED;t<n;){for(var i=r;128<i;){if(e[t++]!=(127&i|128))return o;i>>=7}if(e[t++]!=i)break;o++;for(var a=0,s=1;a+=(127&(i=e[t++]))*s,s*=128,0!=(128&i););t+=a}return o},jspb.utils.debugBytesToTextFormat=function(e){var t='"';if(e){e=jspb.utils.byteSourceToUint8Array(e);for(var n=0;n<e.length;n++)t+="\\x",16>e[n]&&(t+="0"),t+=e[n].toString(16)}return t+'"'},jspb.utils.debugScalarToTextFormat=function(e){return"string"==typeof e?goog.string.quote(e):e.toString()},jspb.utils.stringToByteArray=function(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++){var r=e.charCodeAt(n);if(255<r)throw Error("Conversion error: string contains codepoint outside of byte range");t[n]=r}return t},jspb.utils.byteSourceToUint8Array=function(e){return e.constructor===Uint8Array?e:e.constructor===ArrayBuffer||"undefined"!=typeof Buffer&&e.constructor===Buffer||e.constructor===Array?new Uint8Array(e):e.constructor===String?goog.crypt.base64.decodeStringToUint8Array(e):(goog.asserts.fail("Type not convertible to Uint8Array."),new Uint8Array(0))},jspb.BinaryDecoder=function(e,t,n){this.bytes_=null,this.cursor_=this.end_=this.start_=0,this.error_=!1,e&&this.setBlock(e,t,n)},jspb.BinaryDecoder.instanceCache_=[],jspb.BinaryDecoder.alloc=function(e,t,n){if(jspb.BinaryDecoder.instanceCache_.length){var r=jspb.BinaryDecoder.instanceCache_.pop();return e&&r.setBlock(e,t,n),r}return new jspb.BinaryDecoder(e,t,n)},jspb.BinaryDecoder.prototype.free=function(){this.clear(),100>jspb.BinaryDecoder.instanceCache_.length&&jspb.BinaryDecoder.instanceCache_.push(this)},jspb.BinaryDecoder.prototype.clone=function(){return jspb.BinaryDecoder.alloc(this.bytes_,this.start_,this.end_-this.start_)},jspb.BinaryDecoder.prototype.clear=function(){this.bytes_=null,this.cursor_=this.end_=this.start_=0,this.error_=!1},jspb.BinaryDecoder.prototype.getBuffer=function(){return this.bytes_},jspb.BinaryDecoder.prototype.setBlock=function(e,t,n){this.bytes_=jspb.utils.byteSourceToUint8Array(e),this.start_=void 0!==t?t:0,this.end_=void 0!==n?this.start_+n:this.bytes_.length,this.cursor_=this.start_},jspb.BinaryDecoder.prototype.getEnd=function(){return this.end_},jspb.BinaryDecoder.prototype.setEnd=function(e){this.end_=e},jspb.BinaryDecoder.prototype.reset=function(){this.cursor_=this.start_},jspb.BinaryDecoder.prototype.getCursor=function(){return this.cursor_},jspb.BinaryDecoder.prototype.setCursor=function(e){this.cursor_=e},jspb.BinaryDecoder.prototype.advance=function(e){this.cursor_+=e,goog.asserts.assert(this.cursor_<=this.end_)},jspb.BinaryDecoder.prototype.atEnd=function(){return this.cursor_==this.end_},jspb.BinaryDecoder.prototype.pastEnd=function(){return this.cursor_>this.end_},jspb.BinaryDecoder.prototype.getError=function(){return this.error_||0>this.cursor_||this.cursor_>this.end_},jspb.BinaryDecoder.prototype.readSplitVarint64=function(e){for(var t=128,n=0,r=0,o=0;4>o&&128<=t;o++)n|=(127&(t=this.bytes_[this.cursor_++]))<<7*o;if(128<=t&&(n|=(127&(t=this.bytes_[this.cursor_++]))<<28,r|=(127&t)>>4),128<=t)for(o=0;5>o&&128<=t;o++)r|=(127&(t=this.bytes_[this.cursor_++]))<<7*o+3;if(128>t)return e(n>>>0,r>>>0);goog.asserts.fail("Failed to read varint, encoding is invalid."),this.error_=!0},jspb.BinaryDecoder.prototype.readSplitZigzagVarint64=function(e){return this.readSplitVarint64((function(t,n){return jspb.utils.fromZigzag64(t,n,e)}))},jspb.BinaryDecoder.prototype.readSplitFixed64=function(e){var t=this.bytes_,n=this.cursor_;this.cursor_+=8;for(var r=0,o=0,i=n+7;i>=n;i--)r=r<<8|t[i],o=o<<8|t[i+4];return e(r,o)},jspb.BinaryDecoder.prototype.skipVarint=function(){for(;128&this.bytes_[this.cursor_];)this.cursor_++;this.cursor_++},jspb.BinaryDecoder.prototype.unskipVarint=function(e){for(;128<e;)this.cursor_--,e>>>=7;this.cursor_--},jspb.BinaryDecoder.prototype.readUnsignedVarint32=function(){var e=this.bytes_,t=e[this.cursor_+0],n=127&t;return 128>t?(this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(127&(t=e[this.cursor_+1]))<<7,128>t?(this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(127&(t=e[this.cursor_+2]))<<14,128>t?(this.cursor_+=3,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(127&(t=e[this.cursor_+3]))<<21,128>t?(this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),n):(n|=(15&(t=e[this.cursor_+4]))<<28,128>t?(this.cursor_+=5,goog.asserts.assert(this.cursor_<=this.end_),n>>>0):(this.cursor_+=5,128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&128<=e[this.cursor_++]&&goog.asserts.assert(!1),goog.asserts.assert(this.cursor_<=this.end_),n)))))},jspb.BinaryDecoder.prototype.readSignedVarint32=jspb.BinaryDecoder.prototype.readUnsignedVarint32,jspb.BinaryDecoder.prototype.readUnsignedVarint32String=function(){return this.readUnsignedVarint32().toString()},jspb.BinaryDecoder.prototype.readSignedVarint32String=function(){return this.readSignedVarint32().toString()},jspb.BinaryDecoder.prototype.readZigzagVarint32=function(){var e=this.readUnsignedVarint32();return e>>>1^-(1&e)},jspb.BinaryDecoder.prototype.readUnsignedVarint64=function(){return this.readSplitVarint64(jspb.utils.joinUint64)},jspb.BinaryDecoder.prototype.readUnsignedVarint64String=function(){return this.readSplitVarint64(jspb.utils.joinUnsignedDecimalString)},jspb.BinaryDecoder.prototype.readSignedVarint64=function(){return this.readSplitVarint64(jspb.utils.joinInt64)},jspb.BinaryDecoder.prototype.readSignedVarint64String=function(){return this.readSplitVarint64(jspb.utils.joinSignedDecimalString)},jspb.BinaryDecoder.prototype.readZigzagVarint64=function(){return this.readSplitVarint64(jspb.utils.joinZigzag64)},jspb.BinaryDecoder.prototype.readZigzagVarintHash64=function(){return this.readSplitZigzagVarint64(jspb.utils.joinHash64)},jspb.BinaryDecoder.prototype.readZigzagVarint64String=function(){return this.readSplitZigzagVarint64(jspb.utils.joinSignedDecimalString)},jspb.BinaryDecoder.prototype.readUint8=function(){var e=this.bytes_[this.cursor_+0];return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),e},jspb.BinaryDecoder.prototype.readUint16=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),e<<0|t<<8},jspb.BinaryDecoder.prototype.readUint32=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],n=this.bytes_[this.cursor_+2],r=this.bytes_[this.cursor_+3];return this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),(e<<0|t<<8|n<<16|r<<24)>>>0},jspb.BinaryDecoder.prototype.readUint64=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinUint64(e,t)},jspb.BinaryDecoder.prototype.readUint64String=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinUnsignedDecimalString(e,t)},jspb.BinaryDecoder.prototype.readInt8=function(){var e=this.bytes_[this.cursor_+0];return this.cursor_+=1,goog.asserts.assert(this.cursor_<=this.end_),e<<24>>24},jspb.BinaryDecoder.prototype.readInt16=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1];return this.cursor_+=2,goog.asserts.assert(this.cursor_<=this.end_),(e<<0|t<<8)<<16>>16},jspb.BinaryDecoder.prototype.readInt32=function(){var e=this.bytes_[this.cursor_+0],t=this.bytes_[this.cursor_+1],n=this.bytes_[this.cursor_+2],r=this.bytes_[this.cursor_+3];return this.cursor_+=4,goog.asserts.assert(this.cursor_<=this.end_),e<<0|t<<8|n<<16|r<<24},jspb.BinaryDecoder.prototype.readInt64=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinInt64(e,t)},jspb.BinaryDecoder.prototype.readInt64String=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinSignedDecimalString(e,t)},jspb.BinaryDecoder.prototype.readFloat=function(){var e=this.readUint32();return jspb.utils.joinFloat32(e,0)},jspb.BinaryDecoder.prototype.readDouble=function(){var e=this.readUint32(),t=this.readUint32();return jspb.utils.joinFloat64(e,t)},jspb.BinaryDecoder.prototype.readBool=function(){return!!this.bytes_[this.cursor_++]},jspb.BinaryDecoder.prototype.readEnum=function(){return this.readSignedVarint32()},jspb.BinaryDecoder.prototype.readString=function(e){var t=this.bytes_,n=this.cursor_;e=n+e;for(var r=[],o="";n<e;){var i=t[n++];if(128>i)r.push(i);else{if(192>i)continue;if(224>i){var a=t[n++];r.push((31&i)<<6|63&a)}else if(240>i){a=t[n++];var s=t[n++];r.push((15&i)<<12|(63&a)<<6|63&s)}else if(248>i){i=(7&i)<<18|(63&(a=t[n++]))<<12|(63&(s=t[n++]))<<6|63&t[n++],i-=65536,r.push(55296+(i>>10&1023),56320+(1023&i))}}8192<=r.length&&(o+=String.fromCharCode.apply(null,r),r.length=0)}return o+=goog.crypt.byteArrayToString(r),this.cursor_=n,o},jspb.BinaryDecoder.prototype.readStringWithLength=function(){var e=this.readUnsignedVarint32();return this.readString(e)},jspb.BinaryDecoder.prototype.readBytes=function(e){if(0>e||this.cursor_+e>this.bytes_.length)return this.error_=!0,goog.asserts.fail("Invalid byte length!"),new Uint8Array(0);var t=this.bytes_.subarray(this.cursor_,this.cursor_+e);return this.cursor_+=e,goog.asserts.assert(this.cursor_<=this.end_),t},jspb.BinaryDecoder.prototype.readVarintHash64=function(){return this.readSplitVarint64(jspb.utils.joinHash64)},jspb.BinaryDecoder.prototype.readFixedHash64=function(){var e=this.bytes_,t=this.cursor_,n=e[t+0],r=e[t+1],o=e[t+2],i=e[t+3],a=e[t+4],s=e[t+5],l=e[t+6];return e=e[t+7],this.cursor_+=8,String.fromCharCode(n,r,o,i,a,s,l,e)},jspb.BinaryReader=function(e,t,n){this.decoder_=jspb.BinaryDecoder.alloc(e,t,n),this.fieldCursor_=this.decoder_.getCursor(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID,this.error_=!1,this.readCallbacks_=null},jspb.BinaryReader.instanceCache_=[],jspb.BinaryReader.alloc=function(e,t,n){if(jspb.BinaryReader.instanceCache_.length){var r=jspb.BinaryReader.instanceCache_.pop();return e&&r.decoder_.setBlock(e,t,n),r}return new jspb.BinaryReader(e,t,n)},jspb.BinaryReader.prototype.alloc=jspb.BinaryReader.alloc,jspb.BinaryReader.prototype.free=function(){this.decoder_.clear(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID,this.error_=!1,this.readCallbacks_=null,100>jspb.BinaryReader.instanceCache_.length&&jspb.BinaryReader.instanceCache_.push(this)},jspb.BinaryReader.prototype.getFieldCursor=function(){return this.fieldCursor_},jspb.BinaryReader.prototype.getCursor=function(){return this.decoder_.getCursor()},jspb.BinaryReader.prototype.getBuffer=function(){return this.decoder_.getBuffer()},jspb.BinaryReader.prototype.getFieldNumber=function(){return this.nextField_},jspb.BinaryReader.prototype.getWireType=function(){return this.nextWireType_},jspb.BinaryReader.prototype.isDelimited=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED},jspb.BinaryReader.prototype.isEndGroup=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP},jspb.BinaryReader.prototype.getError=function(){return this.error_||this.decoder_.getError()},jspb.BinaryReader.prototype.setBlock=function(e,t,n){this.decoder_.setBlock(e,t,n),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID},jspb.BinaryReader.prototype.reset=function(){this.decoder_.reset(),this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER,this.nextWireType_=jspb.BinaryConstants.WireType.INVALID},jspb.BinaryReader.prototype.advance=function(e){this.decoder_.advance(e)},jspb.BinaryReader.prototype.nextField=function(){if(this.decoder_.atEnd())return!1;if(this.getError())return goog.asserts.fail("Decoder hit an error"),!1;this.fieldCursor_=this.decoder_.getCursor();var e=this.decoder_.readUnsignedVarint32(),t=e>>>3;return(e&=7)!=jspb.BinaryConstants.WireType.VARINT&&e!=jspb.BinaryConstants.WireType.FIXED32&&e!=jspb.BinaryConstants.WireType.FIXED64&&e!=jspb.BinaryConstants.WireType.DELIMITED&&e!=jspb.BinaryConstants.WireType.START_GROUP&&e!=jspb.BinaryConstants.WireType.END_GROUP?(goog.asserts.fail("Invalid wire type: %s (at position %s)",e,this.fieldCursor_),this.error_=!0,!1):(this.nextField_=t,this.nextWireType_=e,!0)},jspb.BinaryReader.prototype.unskipHeader=function(){this.decoder_.unskipVarint(this.nextField_<<3|this.nextWireType_)},jspb.BinaryReader.prototype.skipMatchingFields=function(){var e=this.nextField_;for(this.unskipHeader();this.nextField()&&this.getFieldNumber()==e;)this.skipField();this.decoder_.atEnd()||this.unskipHeader()},jspb.BinaryReader.prototype.skipVarintField=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.VARINT?(goog.asserts.fail("Invalid wire type for skipVarintField"),this.skipField()):this.decoder_.skipVarint()},jspb.BinaryReader.prototype.skipDelimitedField=function(){if(this.nextWireType_!=jspb.BinaryConstants.WireType.DELIMITED)goog.asserts.fail("Invalid wire type for skipDelimitedField"),this.skipField();else{var e=this.decoder_.readUnsignedVarint32();this.decoder_.advance(e)}},jspb.BinaryReader.prototype.skipFixed32Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED32?(goog.asserts.fail("Invalid wire type for skipFixed32Field"),this.skipField()):this.decoder_.advance(4)},jspb.BinaryReader.prototype.skipFixed64Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED64?(goog.asserts.fail("Invalid wire type for skipFixed64Field"),this.skipField()):this.decoder_.advance(8)},jspb.BinaryReader.prototype.skipGroup=function(){for(var e=this.nextField_;;){if(!this.nextField()){goog.asserts.fail("Unmatched start-group tag: stream EOF"),this.error_=!0;break}if(this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP){this.nextField_!=e&&(goog.asserts.fail("Unmatched end-group tag"),this.error_=!0);break}this.skipField()}},jspb.BinaryReader.prototype.skipField=function(){switch(this.nextWireType_){case jspb.BinaryConstants.WireType.VARINT:this.skipVarintField();break;case jspb.BinaryConstants.WireType.FIXED64:this.skipFixed64Field();break;case jspb.BinaryConstants.WireType.DELIMITED:this.skipDelimitedField();break;case jspb.BinaryConstants.WireType.FIXED32:this.skipFixed32Field();break;case jspb.BinaryConstants.WireType.START_GROUP:this.skipGroup();break;default:goog.asserts.fail("Invalid wire encoding for field.")}},jspb.BinaryReader.prototype.registerReadCallback=function(e,t){null===this.readCallbacks_&&(this.readCallbacks_={}),goog.asserts.assert(!this.readCallbacks_[e]),this.readCallbacks_[e]=t},jspb.BinaryReader.prototype.runReadCallback=function(e){return goog.asserts.assert(null!==this.readCallbacks_),e=this.readCallbacks_[e],goog.asserts.assert(e),e(this)},jspb.BinaryReader.prototype.readAny=function(e){this.nextWireType_=jspb.BinaryConstants.FieldTypeToWireType(e);var t=jspb.BinaryConstants.FieldType;switch(e){case t.DOUBLE:return this.readDouble();case t.FLOAT:return this.readFloat();case t.INT64:return this.readInt64();case t.UINT64:return this.readUint64();case t.INT32:return this.readInt32();case t.FIXED64:return this.readFixed64();case t.FIXED32:return this.readFixed32();case t.BOOL:return this.readBool();case t.STRING:return this.readString();case t.GROUP:goog.asserts.fail("Group field type not supported in readAny()");case t.MESSAGE:goog.asserts.fail("Message field type not supported in readAny()");case t.BYTES:return this.readBytes();case t.UINT32:return this.readUint32();case t.ENUM:return this.readEnum();case t.SFIXED32:return this.readSfixed32();case t.SFIXED64:return this.readSfixed64();case t.SINT32:return this.readSint32();case t.SINT64:return this.readSint64();case t.FHASH64:return this.readFixedHash64();case t.VHASH64:return this.readVarintHash64();default:goog.asserts.fail("Invalid field type in readAny()")}return 0},jspb.BinaryReader.prototype.readMessage=function(e,t){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var n=this.decoder_.getEnd(),r=this.decoder_.readUnsignedVarint32();r=this.decoder_.getCursor()+r,this.decoder_.setEnd(r),t(e,this),this.decoder_.setCursor(r),this.decoder_.setEnd(n)},jspb.BinaryReader.prototype.readGroup=function(e,t,n){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.START_GROUP),goog.asserts.assert(this.nextField_==e),n(t,this),this.error_||this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP||(goog.asserts.fail("Group submessage did not end with an END_GROUP tag"),this.error_=!0)},jspb.BinaryReader.prototype.getFieldDecoder=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32(),t=this.decoder_.getCursor(),n=t+e;return e=jspb.BinaryDecoder.alloc(this.decoder_.getBuffer(),t,e),this.decoder_.setCursor(n),e},jspb.BinaryReader.prototype.readInt32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint32()},jspb.BinaryReader.prototype.readInt32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint32String()},jspb.BinaryReader.prototype.readInt64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64()},jspb.BinaryReader.prototype.readInt64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64String()},jspb.BinaryReader.prototype.readUint32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint32()},jspb.BinaryReader.prototype.readUint32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint32String()},jspb.BinaryReader.prototype.readUint64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint64()},jspb.BinaryReader.prototype.readUint64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readUnsignedVarint64String()},jspb.BinaryReader.prototype.readSint32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint32()},jspb.BinaryReader.prototype.readSint64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint64()},jspb.BinaryReader.prototype.readSint64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarint64String()},jspb.BinaryReader.prototype.readFixed32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readUint32()},jspb.BinaryReader.prototype.readFixed64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readUint64()},jspb.BinaryReader.prototype.readFixed64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readUint64String()},jspb.BinaryReader.prototype.readSfixed32=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readInt32()},jspb.BinaryReader.prototype.readSfixed32String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readInt32().toString()},jspb.BinaryReader.prototype.readSfixed64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readInt64()},jspb.BinaryReader.prototype.readSfixed64String=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readInt64String()},jspb.BinaryReader.prototype.readFloat=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32),this.decoder_.readFloat()},jspb.BinaryReader.prototype.readDouble=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readDouble()},jspb.BinaryReader.prototype.readBool=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),!!this.decoder_.readUnsignedVarint32()},jspb.BinaryReader.prototype.readEnum=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSignedVarint64()},jspb.BinaryReader.prototype.readString=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32();return this.decoder_.readString(e)},jspb.BinaryReader.prototype.readBytes=function(){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var e=this.decoder_.readUnsignedVarint32();return this.decoder_.readBytes(e)},jspb.BinaryReader.prototype.readVarintHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readVarintHash64()},jspb.BinaryReader.prototype.readSintHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readZigzagVarintHash64()},jspb.BinaryReader.prototype.readSplitVarint64=function(e){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSplitVarint64(e)},jspb.BinaryReader.prototype.readSplitZigzagVarint64=function(e){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT),this.decoder_.readSplitVarint64((function(t,n){return jspb.utils.fromZigzag64(t,n,e)}))},jspb.BinaryReader.prototype.readFixedHash64=function(){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readFixedHash64()},jspb.BinaryReader.prototype.readSplitFixed64=function(e){return goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64),this.decoder_.readSplitFixed64(e)},jspb.BinaryReader.prototype.readPackedField_=function(e){goog.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var t=this.decoder_.readUnsignedVarint32();t=this.decoder_.getCursor()+t;for(var n=[];this.decoder_.getCursor()<t;)n.push(e.call(this.decoder_));return n},jspb.BinaryReader.prototype.readPackedInt32=function(){return this.readPackedField_(this.decoder_.readSignedVarint32)},jspb.BinaryReader.prototype.readPackedInt32String=function(){return this.readPackedField_(this.decoder_.readSignedVarint32String)},jspb.BinaryReader.prototype.readPackedInt64=function(){return this.readPackedField_(this.decoder_.readSignedVarint64)},jspb.BinaryReader.prototype.readPackedInt64String=function(){return this.readPackedField_(this.decoder_.readSignedVarint64String)},jspb.BinaryReader.prototype.readPackedUint32=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint32)},jspb.BinaryReader.prototype.readPackedUint32String=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint32String)},jspb.BinaryReader.prototype.readPackedUint64=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint64)},jspb.BinaryReader.prototype.readPackedUint64String=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint64String)},jspb.BinaryReader.prototype.readPackedSint32=function(){return this.readPackedField_(this.decoder_.readZigzagVarint32)},jspb.BinaryReader.prototype.readPackedSint64=function(){return this.readPackedField_(this.decoder_.readZigzagVarint64)},jspb.BinaryReader.prototype.readPackedSint64String=function(){return this.readPackedField_(this.decoder_.readZigzagVarint64String)},jspb.BinaryReader.prototype.readPackedFixed32=function(){return this.readPackedField_(this.decoder_.readUint32)},jspb.BinaryReader.prototype.readPackedFixed64=function(){return this.readPackedField_(this.decoder_.readUint64)},jspb.BinaryReader.prototype.readPackedFixed64String=function(){return this.readPackedField_(this.decoder_.readUint64String)},jspb.BinaryReader.prototype.readPackedSfixed32=function(){return this.readPackedField_(this.decoder_.readInt32)},jspb.BinaryReader.prototype.readPackedSfixed64=function(){return this.readPackedField_(this.decoder_.readInt64)},jspb.BinaryReader.prototype.readPackedSfixed64String=function(){return this.readPackedField_(this.decoder_.readInt64String)},jspb.BinaryReader.prototype.readPackedFloat=function(){return this.readPackedField_(this.decoder_.readFloat)},jspb.BinaryReader.prototype.readPackedDouble=function(){return this.readPackedField_(this.decoder_.readDouble)},jspb.BinaryReader.prototype.readPackedBool=function(){return this.readPackedField_(this.decoder_.readBool)},jspb.BinaryReader.prototype.readPackedEnum=function(){return this.readPackedField_(this.decoder_.readEnum)},jspb.BinaryReader.prototype.readPackedVarintHash64=function(){return this.readPackedField_(this.decoder_.readVarintHash64)},jspb.BinaryReader.prototype.readPackedFixedHash64=function(){return this.readPackedField_(this.decoder_.readFixedHash64)},jspb.BinaryEncoder=function(){this.buffer_=[]},jspb.BinaryEncoder.prototype.length=function(){return this.buffer_.length},jspb.BinaryEncoder.prototype.end=function(){var e=this.buffer_;return this.buffer_=[],e},jspb.BinaryEncoder.prototype.writeSplitVarint64=function(e,t){for(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(t==Math.floor(t)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32);0<t||127<e;)this.buffer_.push(127&e|128),e=(e>>>7|t<<25)>>>0,t>>>=7;this.buffer_.push(e)},jspb.BinaryEncoder.prototype.writeSplitFixed64=function(e,t){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(t==Math.floor(t)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUint32(e),this.writeUint32(t)},jspb.BinaryEncoder.prototype.writeUnsignedVarint32=function(e){for(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32);127<e;)this.buffer_.push(127&e|128),e>>>=7;this.buffer_.push(e)},jspb.BinaryEncoder.prototype.writeSignedVarint32=function(e){if(goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),0<=e)this.writeUnsignedVarint32(e);else{for(var t=0;9>t;t++)this.buffer_.push(127&e|128),e>>=7;this.buffer_.push(1)}},jspb.BinaryEncoder.prototype.writeUnsignedVarint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_64),jspb.utils.splitInt64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeSignedVarint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitInt64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeZigzagVarint32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),this.writeUnsignedVarint32((e<<1^e>>31)>>>0)},jspb.BinaryEncoder.prototype.writeZigzagVarint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitZigzag64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeZigzagVarint64String=function(e){this.writeZigzagVarintHash64(jspb.utils.decimalStringToHash64(e))},jspb.BinaryEncoder.prototype.writeZigzagVarintHash64=function(e){var t=this;jspb.utils.splitHash64(e),jspb.utils.toZigzag64(jspb.utils.split64Low,jspb.utils.split64High,(function(e,n){t.writeSplitVarint64(e>>>0,n>>>0)}))},jspb.BinaryEncoder.prototype.writeUint8=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&256>e),this.buffer_.push(e>>>0&255)},jspb.BinaryEncoder.prototype.writeUint16=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&65536>e),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255)},jspb.BinaryEncoder.prototype.writeUint32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_32),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255),this.buffer_.push(e>>>16&255),this.buffer_.push(e>>>24&255)},jspb.BinaryEncoder.prototype.writeUint64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(0<=e&&e<jspb.BinaryConstants.TWO_TO_64),jspb.utils.splitUint64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeInt8=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(-128<=e&&128>e),this.buffer_.push(e>>>0&255)},jspb.BinaryEncoder.prototype.writeInt16=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(-32768<=e&&32768>e),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255)},jspb.BinaryEncoder.prototype.writeInt32=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),this.buffer_.push(e>>>0&255),this.buffer_.push(e>>>8&255),this.buffer_.push(e>>>16&255),this.buffer_.push(e>>>24&255)},jspb.BinaryEncoder.prototype.writeInt64=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_63&&e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitInt64(e),this.writeSplitFixed64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeInt64String=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(+e>=-jspb.BinaryConstants.TWO_TO_63&&+e<jspb.BinaryConstants.TWO_TO_63),jspb.utils.splitHash64(jspb.utils.decimalStringToHash64(e)),this.writeSplitFixed64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeFloat=function(e){goog.asserts.assert(1/0===e||-1/0===e||isNaN(e)||e>=-jspb.BinaryConstants.FLOAT32_MAX&&e<=jspb.BinaryConstants.FLOAT32_MAX),jspb.utils.splitFloat32(e),this.writeUint32(jspb.utils.split64Low)},jspb.BinaryEncoder.prototype.writeDouble=function(e){goog.asserts.assert(1/0===e||-1/0===e||isNaN(e)||e>=-jspb.BinaryConstants.FLOAT64_MAX&&e<=jspb.BinaryConstants.FLOAT64_MAX),jspb.utils.splitFloat64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeBool=function(e){goog.asserts.assert("boolean"==typeof e||"number"==typeof e),this.buffer_.push(e?1:0)},jspb.BinaryEncoder.prototype.writeEnum=function(e){goog.asserts.assert(e==Math.floor(e)),goog.asserts.assert(e>=-jspb.BinaryConstants.TWO_TO_31&&e<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32(e)},jspb.BinaryEncoder.prototype.writeBytes=function(e){this.buffer_.push.apply(this.buffer_,e)},jspb.BinaryEncoder.prototype.writeVarintHash64=function(e){jspb.utils.splitHash64(e),this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeFixedHash64=function(e){jspb.utils.splitHash64(e),this.writeUint32(jspb.utils.split64Low),this.writeUint32(jspb.utils.split64High)},jspb.BinaryEncoder.prototype.writeString=function(e){for(var t=this.buffer_.length,n=0;n<e.length;n++){var r=e.charCodeAt(n);if(128>r)this.buffer_.push(r);else if(2048>r)this.buffer_.push(r>>6|192),this.buffer_.push(63&r|128);else if(65536>r)if(55296<=r&&56319>=r&&n+1<e.length){var o=e.charCodeAt(n+1);56320<=o&&57343>=o&&(r=1024*(r-55296)+o-56320+65536,this.buffer_.push(r>>18|240),this.buffer_.push(r>>12&63|128),this.buffer_.push(r>>6&63|128),this.buffer_.push(63&r|128),n++)}else this.buffer_.push(r>>12|224),this.buffer_.push(r>>6&63|128),this.buffer_.push(63&r|128)}return this.buffer_.length-t},jspb.arith={},jspb.arith.UInt64=function(e,t){this.lo=e,this.hi=t},jspb.arith.UInt64.prototype.cmp=function(e){return this.hi<e.hi||this.hi==e.hi&&this.lo<e.lo?-1:this.hi==e.hi&&this.lo==e.lo?0:1},jspb.arith.UInt64.prototype.rightShift=function(){return new jspb.arith.UInt64((this.lo>>>1|(1&this.hi)<<31)>>>0,this.hi>>>1>>>0)},jspb.arith.UInt64.prototype.leftShift=function(){return new jspb.arith.UInt64(this.lo<<1>>>0,(this.hi<<1|this.lo>>>31)>>>0)},jspb.arith.UInt64.prototype.msb=function(){return!!(2147483648&this.hi)},jspb.arith.UInt64.prototype.lsb=function(){return!!(1&this.lo)},jspb.arith.UInt64.prototype.zero=function(){return 0==this.lo&&0==this.hi},jspb.arith.UInt64.prototype.add=function(e){return new jspb.arith.UInt64((this.lo+e.lo&4294967295)>>>0>>>0,((this.hi+e.hi&4294967295)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},jspb.arith.UInt64.prototype.sub=function(e){return new jspb.arith.UInt64((this.lo-e.lo&4294967295)>>>0>>>0,((this.hi-e.hi&4294967295)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},jspb.arith.UInt64.mul32x32=function(e,t){var n=65535&e,r=65535&t,o=t>>>16;for(t=n*r+65536*(n*o&65535)+65536*((e>>>=16)*r&65535),n=e*o+(n*o>>>16)+(e*r>>>16);4294967296<=t;)t-=4294967296,n+=1;return new jspb.arith.UInt64(t>>>0,n>>>0)},jspb.arith.UInt64.prototype.mul=function(e){var t=jspb.arith.UInt64.mul32x32(this.lo,e);return(e=jspb.arith.UInt64.mul32x32(this.hi,e)).hi=e.lo,e.lo=0,t.add(e)},jspb.arith.UInt64.prototype.div=function(e){if(0==e)return[];var t=new jspb.arith.UInt64(0,0),n=new jspb.arith.UInt64(this.lo,this.hi);e=new jspb.arith.UInt64(e,0);for(var r=new jspb.arith.UInt64(1,0);!e.msb();)e=e.leftShift(),r=r.leftShift();for(;!r.zero();)0>=e.cmp(n)&&(t=t.add(r),n=n.sub(e)),e=e.rightShift(),r=r.rightShift();return[t,n]},jspb.arith.UInt64.prototype.toString=function(){for(var e="",t=this;!t.zero();){var n=(t=t.div(10))[0];e=t[1].lo+e,t=n}return""==e&&(e="0"),e},jspb.arith.UInt64.fromString=function(e){for(var t=new jspb.arith.UInt64(0,0),n=new jspb.arith.UInt64(0,0),r=0;r<e.length;r++){if("0">e[r]||"9"<e[r])return null;var o=parseInt(e[r],10);n.lo=o,t=t.mul(10).add(n)}return t},jspb.arith.UInt64.prototype.clone=function(){return new jspb.arith.UInt64(this.lo,this.hi)},jspb.arith.Int64=function(e,t){this.lo=e,this.hi=t},jspb.arith.Int64.prototype.add=function(e){return new jspb.arith.Int64((this.lo+e.lo&4294967295)>>>0>>>0,((this.hi+e.hi&4294967295)>>>0)+(4294967296<=this.lo+e.lo?1:0)>>>0)},jspb.arith.Int64.prototype.sub=function(e){return new jspb.arith.Int64((this.lo-e.lo&4294967295)>>>0>>>0,((this.hi-e.hi&4294967295)>>>0)-(0>this.lo-e.lo?1:0)>>>0)},jspb.arith.Int64.prototype.clone=function(){return new jspb.arith.Int64(this.lo,this.hi)},jspb.arith.Int64.prototype.toString=function(){var e=0!=(2147483648&this.hi),t=new jspb.arith.UInt64(this.lo,this.hi);return e&&(t=new jspb.arith.UInt64(0,0).sub(t)),(e?"-":"")+t.toString()},jspb.arith.Int64.fromString=function(e){var t=0<e.length&&"-"==e[0];return t&&(e=e.substring(1)),null===(e=jspb.arith.UInt64.fromString(e))?null:(t&&(e=new jspb.arith.UInt64(0,0).sub(e)),new jspb.arith.Int64(e.lo,e.hi))},jspb.BinaryWriter=function(){this.blocks_=[],this.totalLength_=0,this.encoder_=new jspb.BinaryEncoder,this.bookmarks_=[]},jspb.BinaryWriter.prototype.appendUint8Array_=function(e){var t=this.encoder_.end();this.blocks_.push(t),this.blocks_.push(e),this.totalLength_+=t.length+e.length},jspb.BinaryWriter.prototype.beginDelimited_=function(e){return this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),e=this.encoder_.end(),this.blocks_.push(e),this.totalLength_+=e.length,e.push(this.totalLength_),e},jspb.BinaryWriter.prototype.endDelimited_=function(e){var t=e.pop();for(t=this.totalLength_+this.encoder_.length()-t,goog.asserts.assert(0<=t);127<t;)e.push(127&t|128),t>>>=7,this.totalLength_++;e.push(t),this.totalLength_++},jspb.BinaryWriter.prototype.writeSerializedMessage=function(e,t,n){this.appendUint8Array_(e.subarray(t,n))},jspb.BinaryWriter.prototype.maybeWriteSerializedMessage=function(e,t,n){null!=e&&null!=t&&null!=n&&this.writeSerializedMessage(e,t,n)},jspb.BinaryWriter.prototype.reset=function(){this.blocks_=[],this.encoder_.end(),this.totalLength_=0,this.bookmarks_=[]},jspb.BinaryWriter.prototype.getResultBuffer=function(){goog.asserts.assert(0==this.bookmarks_.length);for(var e=new Uint8Array(this.totalLength_+this.encoder_.length()),t=this.blocks_,n=t.length,r=0,o=0;o<n;o++){var i=t[o];e.set(i,r),r+=i.length}return t=this.encoder_.end(),e.set(t,r),r+=t.length,goog.asserts.assert(r==e.length),this.blocks_=[e],e},jspb.BinaryWriter.prototype.getResultBase64String=function(e){return goog.crypt.base64.encodeByteArray(this.getResultBuffer(),e)},jspb.BinaryWriter.prototype.beginSubMessage=function(e){this.bookmarks_.push(this.beginDelimited_(e))},jspb.BinaryWriter.prototype.endSubMessage=function(){goog.asserts.assert(0<=this.bookmarks_.length),this.endDelimited_(this.bookmarks_.pop())},jspb.BinaryWriter.prototype.writeFieldHeader_=function(e,t){goog.asserts.assert(1<=e&&e==Math.floor(e)),this.encoder_.writeUnsignedVarint32(8*e+t)},jspb.BinaryWriter.prototype.writeAny=function(e,t,n){var r=jspb.BinaryConstants.FieldType;switch(e){case r.DOUBLE:this.writeDouble(t,n);break;case r.FLOAT:this.writeFloat(t,n);break;case r.INT64:this.writeInt64(t,n);break;case r.UINT64:this.writeUint64(t,n);break;case r.INT32:this.writeInt32(t,n);break;case r.FIXED64:this.writeFixed64(t,n);break;case r.FIXED32:this.writeFixed32(t,n);break;case r.BOOL:this.writeBool(t,n);break;case r.STRING:this.writeString(t,n);break;case r.GROUP:goog.asserts.fail("Group field type not supported in writeAny()");break;case r.MESSAGE:goog.asserts.fail("Message field type not supported in writeAny()");break;case r.BYTES:this.writeBytes(t,n);break;case r.UINT32:this.writeUint32(t,n);break;case r.ENUM:this.writeEnum(t,n);break;case r.SFIXED32:this.writeSfixed32(t,n);break;case r.SFIXED64:this.writeSfixed64(t,n);break;case r.SINT32:this.writeSint32(t,n);break;case r.SINT64:this.writeSint64(t,n);break;case r.FHASH64:this.writeFixedHash64(t,n);break;case r.VHASH64:this.writeVarintHash64(t,n);break;default:goog.asserts.fail("Invalid field type in writeAny()")}},jspb.BinaryWriter.prototype.writeUnsignedVarint32_=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeUnsignedVarint32(t))},jspb.BinaryWriter.prototype.writeSignedVarint32_=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(t))},jspb.BinaryWriter.prototype.writeUnsignedVarint64_=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeUnsignedVarint64(t))},jspb.BinaryWriter.prototype.writeSignedVarint64_=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint64(t))},jspb.BinaryWriter.prototype.writeZigzagVarint32_=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint32(t))},jspb.BinaryWriter.prototype.writeZigzagVarint64_=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint64(t))},jspb.BinaryWriter.prototype.writeZigzagVarint64String_=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint64String(t))},jspb.BinaryWriter.prototype.writeZigzagVarintHash64_=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarintHash64(t))},jspb.BinaryWriter.prototype.writeInt32=function(e,t){null!=t&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeInt32String=function(e,t){null!=t&&(t=parseInt(t,10),goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeInt64=function(e,t){null!=t&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeSignedVarint64_(e,t))},jspb.BinaryWriter.prototype.writeInt64String=function(e,t){null!=t&&(t=jspb.arith.Int64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeUint32=function(e,t){null!=t&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUnsignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeUint32String=function(e,t){null!=t&&(t=parseInt(t,10),goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeUnsignedVarint32_(e,t))},jspb.BinaryWriter.prototype.writeUint64=function(e,t){null!=t&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_64),this.writeUnsignedVarint64_(e,t))},jspb.BinaryWriter.prototype.writeUint64String=function(e,t){null!=t&&(t=jspb.arith.UInt64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeSint32=function(e,t){null!=t&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeZigzagVarint32_(e,t))},jspb.BinaryWriter.prototype.writeSint64=function(e,t){null!=t&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeZigzagVarint64_(e,t))},jspb.BinaryWriter.prototype.writeSintHash64=function(e,t){null!=t&&this.writeZigzagVarintHash64_(e,t)},jspb.BinaryWriter.prototype.writeSint64String=function(e,t){null!=t&&this.writeZigzagVarint64String_(e,t)},jspb.BinaryWriter.prototype.writeFixed32=function(e,t){null!=t&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_32),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeUint32(t))},jspb.BinaryWriter.prototype.writeFixed64=function(e,t){null!=t&&(goog.asserts.assert(0<=t&&t<jspb.BinaryConstants.TWO_TO_64),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeUint64(t))},jspb.BinaryWriter.prototype.writeFixed64String=function(e,t){null!=t&&(t=jspb.arith.UInt64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeSfixed32=function(e,t){null!=t&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeInt32(t))},jspb.BinaryWriter.prototype.writeSfixed64=function(e,t){null!=t&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_63&&t<jspb.BinaryConstants.TWO_TO_63),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeInt64(t))},jspb.BinaryWriter.prototype.writeSfixed64String=function(e,t){null!=t&&(t=jspb.arith.Int64.fromString(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t.lo,t.hi))},jspb.BinaryWriter.prototype.writeFloat=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeFloat(t))},jspb.BinaryWriter.prototype.writeDouble=function(e,t){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeDouble(t))},jspb.BinaryWriter.prototype.writeBool=function(e,t){null!=t&&(goog.asserts.assert("boolean"==typeof t||"number"==typeof t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeBool(t))},jspb.BinaryWriter.prototype.writeEnum=function(e,t){null!=t&&(goog.asserts.assert(t>=-jspb.BinaryConstants.TWO_TO_31&&t<jspb.BinaryConstants.TWO_TO_31),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(t))},jspb.BinaryWriter.prototype.writeString=function(e,t){null!=t&&(e=this.beginDelimited_(e),this.encoder_.writeString(t),this.endDelimited_(e))},jspb.BinaryWriter.prototype.writeBytes=function(e,t){null!=t&&(t=jspb.utils.byteSourceToUint8Array(t),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(t.length),this.appendUint8Array_(t))},jspb.BinaryWriter.prototype.writeMessage=function(e,t,n){null!=t&&(e=this.beginDelimited_(e),n(t,this),this.endDelimited_(e))},jspb.BinaryWriter.prototype.writeMessageSet=function(e,t,n){null!=t&&(this.writeFieldHeader_(1,jspb.BinaryConstants.WireType.START_GROUP),this.writeFieldHeader_(2,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(e),e=this.beginDelimited_(3),n(t,this),this.endDelimited_(e),this.writeFieldHeader_(1,jspb.BinaryConstants.WireType.END_GROUP))},jspb.BinaryWriter.prototype.writeGroup=function(e,t,n){null!=t&&(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.START_GROUP),n(t,this),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.END_GROUP))},jspb.BinaryWriter.prototype.writeFixedHash64=function(e,t){null!=t&&(goog.asserts.assert(8==t.length),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeFixedHash64(t))},jspb.BinaryWriter.prototype.writeVarintHash64=function(e,t){null!=t&&(goog.asserts.assert(8==t.length),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeVarintHash64(t))},jspb.BinaryWriter.prototype.writeSplitFixed64=function(e,t,n){this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(t,n)},jspb.BinaryWriter.prototype.writeSplitVarint64=function(e,t,n){this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(t,n)},jspb.BinaryWriter.prototype.writeSplitZigzagVarint64=function(e,t,n){this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.VARINT);var r=this.encoder_;jspb.utils.toZigzag64(t,n,(function(e,t){r.writeSplitVarint64(e>>>0,t>>>0)}))},jspb.BinaryWriter.prototype.writeRepeatedInt32=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeSignedVarint32_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedInt32String=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeInt32String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedInt64=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeSignedVarint64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSplitFixed64=function(e,t,n,r){if(null!=t)for(var o=0;o<t.length;o++)this.writeSplitFixed64(e,n(t[o]),r(t[o]))},jspb.BinaryWriter.prototype.writeRepeatedSplitVarint64=function(e,t,n,r){if(null!=t)for(var o=0;o<t.length;o++)this.writeSplitVarint64(e,n(t[o]),r(t[o]))},jspb.BinaryWriter.prototype.writeRepeatedSplitZigzagVarint64=function(e,t,n,r){if(null!=t)for(var o=0;o<t.length;o++)this.writeSplitZigzagVarint64(e,n(t[o]),r(t[o]))},jspb.BinaryWriter.prototype.writeRepeatedInt64String=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeInt64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint32=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeUnsignedVarint32_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint32String=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeUint32String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint64=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeUnsignedVarint64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedUint64String=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeUint64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSint32=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeZigzagVarint32_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSint64=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeZigzagVarint64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSint64String=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeZigzagVarint64String_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSintHash64=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeZigzagVarintHash64_(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFixed32=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeFixed32(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFixed64=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeFixed64(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFixed64String=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeFixed64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSfixed32=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeSfixed32(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSfixed64=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeSfixed64(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedSfixed64String=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeSfixed64String(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedFloat=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeFloat(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedDouble=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeDouble(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedBool=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeBool(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedEnum=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeEnum(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedString=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeString(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedBytes=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeBytes(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedMessage=function(e,t,n){if(null!=t)for(var r=0;r<t.length;r++){var o=this.beginDelimited_(e);n(t[r],this),this.endDelimited_(o)}},jspb.BinaryWriter.prototype.writeRepeatedGroup=function(e,t,n){if(null!=t)for(var r=0;r<t.length;r++)this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.START_GROUP),n(t[r],this),this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.END_GROUP)},jspb.BinaryWriter.prototype.writeRepeatedFixedHash64=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeFixedHash64(e,t[n])},jspb.BinaryWriter.prototype.writeRepeatedVarintHash64=function(e,t){if(null!=t)for(var n=0;n<t.length;n++)this.writeVarintHash64(e,t[n])},jspb.BinaryWriter.prototype.writePackedInt32=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeSignedVarint32(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedInt32String=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeSignedVarint32(parseInt(t[n],10));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedInt64=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeSignedVarint64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitFixed64=function(e,t,n,r){if(null!=t){e=this.beginDelimited_(e);for(var o=0;o<t.length;o++)this.encoder_.writeSplitFixed64(n(t[o]),r(t[o]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitVarint64=function(e,t,n,r){if(null!=t){e=this.beginDelimited_(e);for(var o=0;o<t.length;o++)this.encoder_.writeSplitVarint64(n(t[o]),r(t[o]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSplitZigzagVarint64=function(e,t,n,r){if(null!=t){e=this.beginDelimited_(e);for(var o=this.encoder_,i=0;i<t.length;i++)jspb.utils.toZigzag64(n(t[i]),r(t[i]),(function(e,t){o.writeSplitVarint64(e>>>0,t>>>0)}));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedInt64String=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++){var r=jspb.arith.Int64.fromString(t[n]);this.encoder_.writeSplitVarint64(r.lo,r.hi)}this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint32=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeUnsignedVarint32(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint32String=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeUnsignedVarint32(parseInt(t[n],10));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint64=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeUnsignedVarint64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedUint64String=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++){var r=jspb.arith.UInt64.fromString(t[n]);this.encoder_.writeSplitVarint64(r.lo,r.hi)}this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSint32=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarint32(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSint64=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarint64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSint64String=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarintHash64(jspb.utils.decimalStringToHash64(t[n]));this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedSintHash64=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeZigzagVarintHash64(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedFixed32=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeUint32(t[e])},jspb.BinaryWriter.prototype.writePackedFixed64=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeUint64(t[e])},jspb.BinaryWriter.prototype.writePackedFixed64String=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++){var n=jspb.arith.UInt64.fromString(t[e]);this.encoder_.writeSplitFixed64(n.lo,n.hi)}},jspb.BinaryWriter.prototype.writePackedSfixed32=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeInt32(t[e])},jspb.BinaryWriter.prototype.writePackedSfixed64=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeInt64(t[e])},jspb.BinaryWriter.prototype.writePackedSfixed64String=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeInt64String(t[e])},jspb.BinaryWriter.prototype.writePackedFloat=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*t.length),e=0;e<t.length;e++)this.encoder_.writeFloat(t[e])},jspb.BinaryWriter.prototype.writePackedDouble=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeDouble(t[e])},jspb.BinaryWriter.prototype.writePackedBool=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(t.length),e=0;e<t.length;e++)this.encoder_.writeBool(t[e])},jspb.BinaryWriter.prototype.writePackedEnum=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeEnum(t[n]);this.endDelimited_(e)}},jspb.BinaryWriter.prototype.writePackedFixedHash64=function(e,t){if(null!=t&&t.length)for(this.writeFieldHeader_(e,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*t.length),e=0;e<t.length;e++)this.encoder_.writeFixedHash64(t[e])},jspb.BinaryWriter.prototype.writePackedVarintHash64=function(e,t){if(null!=t&&t.length){e=this.beginDelimited_(e);for(var n=0;n<t.length;n++)this.encoder_.writeVarintHash64(t[n]);this.endDelimited_(e)}},jspb.Map=function(e,t){this.arr_=e,this.valueCtor_=t,this.map_={},this.arrClean=!0,0<this.arr_.length&&this.loadFromArray_()},jspb.Map.prototype.loadFromArray_=function(){for(var e=0;e<this.arr_.length;e++){var t=this.arr_[e],n=t[0];this.map_[n.toString()]=new jspb.Map.Entry_(n,t[1])}this.arrClean=!0},jspb.Map.prototype.toArray=function(){if(this.arrClean){if(this.valueCtor_){var e,t=this.map_;for(e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var n=t[e].valueWrapper;n&&n.toArray()}}}else{for(this.arr_.length=0,(t=this.stringKeys_()).sort(),e=0;e<t.length;e++){var r=this.map_[t[e]];(n=r.valueWrapper)&&n.toArray(),this.arr_.push([r.key,r.value])}this.arrClean=!0}return this.arr_},jspb.Map.prototype.toObject=function(e,t){for(var n=this.toArray(),r=[],o=0;o<n.length;o++){var i=this.map_[n[o][0].toString()];this.wrapEntry_(i);var a=i.valueWrapper;a?(goog.asserts.assert(t),r.push([i.key,t(e,a)])):r.push([i.key,i.value])}return r},jspb.Map.fromObject=function(e,t,n){t=new jspb.Map([],t);for(var r=0;r<e.length;r++){var o=e[r][0],i=n(e[r][1]);t.set(o,i)}return t},jspb.Map.ArrayIteratorIterable_=function(e){this.idx_=0,this.arr_=e},jspb.Map.ArrayIteratorIterable_.prototype.next=function(){return this.idx_<this.arr_.length?{done:!1,value:this.arr_[this.idx_++]}:{done:!0,value:void 0}},"undefined"!=typeof Symbol&&(jspb.Map.ArrayIteratorIterable_.prototype[Symbol.iterator]=function(){return this}),jspb.Map.prototype.getLength=function(){return this.stringKeys_().length},jspb.Map.prototype.clear=function(){this.map_={},this.arrClean=!1},jspb.Map.prototype.del=function(e){e=e.toString();var t=this.map_.hasOwnProperty(e);return delete this.map_[e],this.arrClean=!1,t},jspb.Map.prototype.getEntryList=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++){var r=this.map_[t[n]];e.push([r.key,r.value])}return e},jspb.Map.prototype.entries=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++){var r=this.map_[t[n]];e.push([r.key,this.wrapEntry_(r)])}return new jspb.Map.ArrayIteratorIterable_(e)},jspb.Map.prototype.keys=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++)e.push(this.map_[t[n]].key);return new jspb.Map.ArrayIteratorIterable_(e)},jspb.Map.prototype.values=function(){var e=[],t=this.stringKeys_();t.sort();for(var n=0;n<t.length;n++)e.push(this.wrapEntry_(this.map_[t[n]]));return new jspb.Map.ArrayIteratorIterable_(e)},jspb.Map.prototype.forEach=function(e,t){var n=this.stringKeys_();n.sort();for(var r=0;r<n.length;r++){var o=this.map_[n[r]];e.call(t,this.wrapEntry_(o),o.key,this)}},jspb.Map.prototype.set=function(e,t){var n=new jspb.Map.Entry_(e);return this.valueCtor_?(n.valueWrapper=t,n.value=t.toArray()):n.value=t,this.map_[e.toString()]=n,this.arrClean=!1,this},jspb.Map.prototype.wrapEntry_=function(e){return this.valueCtor_?(e.valueWrapper||(e.valueWrapper=new this.valueCtor_(e.value)),e.valueWrapper):e.value},jspb.Map.prototype.get=function(e){if(e=this.map_[e.toString()])return this.wrapEntry_(e)},jspb.Map.prototype.has=function(e){return e.toString()in this.map_},jspb.Map.prototype.serializeBinary=function(e,t,n,r,o){var i=this.stringKeys_();i.sort();for(var a=0;a<i.length;a++){var s=this.map_[i[a]];t.beginSubMessage(e),n.call(t,1,s.key),this.valueCtor_?r.call(t,2,this.wrapEntry_(s),o):r.call(t,2,s.value),t.endSubMessage()}},jspb.Map.deserializeBinary=function(e,t,n,r,o,i,a){for(;t.nextField()&&!t.isEndGroup();){var s=t.getFieldNumber();1==s?i=n.call(t):2==s&&(e.valueCtor_?(goog.asserts.assert(o),a||(a=new e.valueCtor_),r.call(t,a,o)):a=r.call(t))}goog.asserts.assert(null!=i),goog.asserts.assert(null!=a),e.set(i,a)},jspb.Map.prototype.stringKeys_=function(){var e,t=this.map_,n=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.push(e);return n},jspb.Map.Entry_=function(e,t){this.key=e,this.value=t,this.valueWrapper=void 0},jspb.ExtensionFieldInfo=function(e,t,n,r,o){this.fieldIndex=e,this.fieldName=t,this.ctor=n,this.toObjectFn=r,this.isRepeated=o},jspb.ExtensionFieldBinaryInfo=function(e,t,n,r,o,i){this.fieldInfo=e,this.binaryReaderFn=t,this.binaryWriterFn=n,this.binaryMessageSerializeFn=r,this.binaryMessageDeserializeFn=o,this.isPacked=i},jspb.ExtensionFieldInfo.prototype.isMessageType=function(){return!!this.ctor},jspb.Message=function(){},jspb.Message.GENERATE_TO_OBJECT=!0,jspb.Message.GENERATE_FROM_OBJECT=!goog.DISALLOW_TEST_ONLY_CODE,jspb.Message.GENERATE_TO_STRING=!0,jspb.Message.ASSUME_LOCAL_ARRAYS=!1,jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS=!0,jspb.Message.SUPPORTS_UINT8ARRAY_="function"==typeof Uint8Array,jspb.Message.prototype.getJsPbMessageId=function(){return this.messageId_},jspb.Message.getIndex_=function(e,t){return t+e.arrayIndexOffset_},jspb.Message.hiddenES6Property_=function(){},jspb.Message.getFieldNumber_=function(e,t){return t-e.arrayIndexOffset_},jspb.Message.initialize=function(e,t,n,r,o,i){if(e.wrappers_=null,t||(t=n?[n]:[]),e.messageId_=n?String(n):void 0,e.arrayIndexOffset_=0===n?-1:0,e.array=t,jspb.Message.initPivotAndExtensionObject_(e,r),e.convertedPrimitiveFields_={},jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS||(e.repeatedFields=o),o)for(t=0;t<o.length;t++)(n=o[t])<e.pivot_?(n=jspb.Message.getIndex_(e,n),e.array[n]=e.array[n]||jspb.Message.EMPTY_LIST_SENTINEL_):(jspb.Message.maybeInitEmptyExtensionObject_(e),e.extensionObject_[n]=e.extensionObject_[n]||jspb.Message.EMPTY_LIST_SENTINEL_);if(i&&i.length)for(t=0;t<i.length;t++)jspb.Message.computeOneofCase(e,i[t])},jspb.Message.EMPTY_LIST_SENTINEL_=goog.DEBUG&&Object.freeze?Object.freeze([]):[],jspb.Message.isArray_=function(e){return jspb.Message.ASSUME_LOCAL_ARRAYS?e instanceof Array:Array.isArray(e)},jspb.Message.isExtensionObject_=function(e){return!(null===e||"object"!=typeof e||jspb.Message.isArray_(e)||jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array)},jspb.Message.initPivotAndExtensionObject_=function(e,t){var n=e.array.length,r=-1;if(n&&(r=n-1,n=e.array[r],jspb.Message.isExtensionObject_(n)))return e.pivot_=jspb.Message.getFieldNumber_(e,r),void(e.extensionObject_=n);-1<t?(e.pivot_=Math.max(t,jspb.Message.getFieldNumber_(e,r+1)),e.extensionObject_=null):e.pivot_=Number.MAX_VALUE},jspb.Message.maybeInitEmptyExtensionObject_=function(e){var t=jspb.Message.getIndex_(e,e.pivot_);e.array[t]||(e.extensionObject_=e.array[t]={})},jspb.Message.toObjectList=function(e,t,n){for(var r=[],o=0;o<e.length;o++)r[o]=t.call(e[o],n,e[o]);return r},jspb.Message.toObjectExtension=function(e,t,n,r,o){for(var i in n){var a=n[i],s=r.call(e,a);if(null!=s){for(var l in a.fieldName)if(a.fieldName.hasOwnProperty(l))break;t[l]=a.toObjectFn?a.isRepeated?jspb.Message.toObjectList(s,a.toObjectFn,o):a.toObjectFn(o,s):s}}},jspb.Message.serializeBinaryExtensions=function(e,t,n,r){for(var o in n){var i=n[o],a=i.fieldInfo;if(!i.binaryWriterFn)throw Error("Message extension present that was generated without binary serialization support");var s=r.call(e,a);if(null!=s)if(a.isMessageType()){if(!i.binaryMessageSerializeFn)throw Error("Message extension present holding submessage without binary support enabled, and message is being serialized to binary format");i.binaryWriterFn.call(t,a.fieldIndex,s,i.binaryMessageSerializeFn)}else i.binaryWriterFn.call(t,a.fieldIndex,s)}},jspb.Message.readBinaryExtension=function(e,t,n,r,o){var i=n[t.getFieldNumber()];if(i){if(n=i.fieldInfo,!i.binaryReaderFn)throw Error("Deserializing extension whose generated code does not support binary format");if(n.isMessageType()){var a=new n.ctor;i.binaryReaderFn.call(t,a,i.binaryMessageDeserializeFn)}else a=i.binaryReaderFn.call(t);n.isRepeated&&!i.isPacked?(t=r.call(e,n))?t.push(a):o.call(e,n,[a]):o.call(e,n,a)}else t.skipField()},jspb.Message.getField=function(e,t){if(t<e.pivot_){t=jspb.Message.getIndex_(e,t);var n=e.array[t];return n===jspb.Message.EMPTY_LIST_SENTINEL_?e.array[t]=[]:n}if(e.extensionObject_)return(n=e.extensionObject_[t])===jspb.Message.EMPTY_LIST_SENTINEL_?e.extensionObject_[t]=[]:n},jspb.Message.getRepeatedField=function(e,t){return jspb.Message.getField(e,t)},jspb.Message.getOptionalFloatingPointField=function(e,t){return null==(e=jspb.Message.getField(e,t))?e:+e},jspb.Message.getBooleanField=function(e,t){return null==(e=jspb.Message.getField(e,t))?e:!!e},jspb.Message.getRepeatedFloatingPointField=function(e,t){var n=jspb.Message.getRepeatedField(e,t);if(e.convertedPrimitiveFields_||(e.convertedPrimitiveFields_={}),!e.convertedPrimitiveFields_[t]){for(var r=0;r<n.length;r++)n[r]=+n[r];e.convertedPrimitiveFields_[t]=!0}return n},jspb.Message.getRepeatedBooleanField=function(e,t){var n=jspb.Message.getRepeatedField(e,t);if(e.convertedPrimitiveFields_||(e.convertedPrimitiveFields_={}),!e.convertedPrimitiveFields_[t]){for(var r=0;r<n.length;r++)n[r]=!!n[r];e.convertedPrimitiveFields_[t]=!0}return n},jspb.Message.bytesAsB64=function(e){return null==e||"string"==typeof e?e:jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array?goog.crypt.base64.encodeByteArray(e):(goog.asserts.fail("Cannot coerce to b64 string: "+goog.typeOf(e)),null)},jspb.Message.bytesAsU8=function(e){return null==e||e instanceof Uint8Array?e:"string"==typeof e?goog.crypt.base64.decodeStringToUint8Array(e):(goog.asserts.fail("Cannot coerce to Uint8Array: "+goog.typeOf(e)),null)},jspb.Message.bytesListAsB64=function(e){return jspb.Message.assertConsistentTypes_(e),e.length&&"string"!=typeof e[0]?goog.array.map(e,jspb.Message.bytesAsB64):e},jspb.Message.bytesListAsU8=function(e){return jspb.Message.assertConsistentTypes_(e),!e.length||e[0]instanceof Uint8Array?e:goog.array.map(e,jspb.Message.bytesAsU8)},jspb.Message.assertConsistentTypes_=function(e){if(goog.DEBUG&&e&&1<e.length){var t=goog.typeOf(e[0]);goog.array.forEach(e,(function(e){goog.typeOf(e)!=t&&goog.asserts.fail("Inconsistent type in JSPB repeated field array. Got "+goog.typeOf(e)+" expected "+t)}))}},jspb.Message.getFieldWithDefault=function(e,t,n){return null==(e=jspb.Message.getField(e,t))?n:e},jspb.Message.getBooleanFieldWithDefault=function(e,t,n){return null==(e=jspb.Message.getBooleanField(e,t))?n:e},jspb.Message.getFloatingPointFieldWithDefault=function(e,t,n){return null==(e=jspb.Message.getOptionalFloatingPointField(e,t))?n:e},jspb.Message.getFieldProto3=jspb.Message.getFieldWithDefault,jspb.Message.getMapField=function(e,t,n,r){if(e.wrappers_||(e.wrappers_={}),t in e.wrappers_)return e.wrappers_[t];var o=jspb.Message.getField(e,t);if(!o){if(n)return;o=[],jspb.Message.setField(e,t,o)}return e.wrappers_[t]=new jspb.Map(o,r)},jspb.Message.setField=function(e,t,n){return goog.asserts.assertInstanceof(e,jspb.Message),t<e.pivot_?e.array[jspb.Message.getIndex_(e,t)]=n:(jspb.Message.maybeInitEmptyExtensionObject_(e),e.extensionObject_[t]=n),e},jspb.Message.setProto3IntField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,0)},jspb.Message.setProto3FloatField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,0)},jspb.Message.setProto3BooleanField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,!1)},jspb.Message.setProto3StringField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,"")},jspb.Message.setProto3BytesField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,"")},jspb.Message.setProto3EnumField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,0)},jspb.Message.setProto3StringIntField=function(e,t,n){return jspb.Message.setFieldIgnoringDefault_(e,t,n,"0")},jspb.Message.setFieldIgnoringDefault_=function(e,t,n,r){return goog.asserts.assertInstanceof(e,jspb.Message),n!==r?jspb.Message.setField(e,t,n):t<e.pivot_?e.array[jspb.Message.getIndex_(e,t)]=null:(jspb.Message.maybeInitEmptyExtensionObject_(e),delete e.extensionObject_[t]),e},jspb.Message.addToRepeatedField=function(e,t,n,r){return goog.asserts.assertInstanceof(e,jspb.Message),t=jspb.Message.getRepeatedField(e,t),null!=r?t.splice(r,0,n):t.push(n),e},jspb.Message.setOneofField=function(e,t,n,r){return goog.asserts.assertInstanceof(e,jspb.Message),(n=jspb.Message.computeOneofCase(e,n))&&n!==t&&void 0!==r&&(e.wrappers_&&n in e.wrappers_&&(e.wrappers_[n]=void 0),jspb.Message.setField(e,n,void 0)),jspb.Message.setField(e,t,r)},jspb.Message.computeOneofCase=function(e,t){for(var n,r,o=0;o<t.length;o++){var i=t[o],a=jspb.Message.getField(e,i);null!=a&&(n=i,r=a,jspb.Message.setField(e,i,void 0))}return n?(jspb.Message.setField(e,n,r),n):0},jspb.Message.getWrapperField=function(e,t,n,r){if(e.wrappers_||(e.wrappers_={}),!e.wrappers_[n]){var o=jspb.Message.getField(e,n);(r||o)&&(e.wrappers_[n]=new t(o))}return e.wrappers_[n]},jspb.Message.getRepeatedWrapperField=function(e,t,n){return jspb.Message.wrapRepeatedField_(e,t,n),(t=e.wrappers_[n])==jspb.Message.EMPTY_LIST_SENTINEL_&&(t=e.wrappers_[n]=[]),t},jspb.Message.wrapRepeatedField_=function(e,t,n){if(e.wrappers_||(e.wrappers_={}),!e.wrappers_[n]){for(var r=jspb.Message.getRepeatedField(e,n),o=[],i=0;i<r.length;i++)o[i]=new t(r[i]);e.wrappers_[n]=o}},jspb.Message.setWrapperField=function(e,t,n){goog.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={});var r=n?n.toArray():n;return e.wrappers_[t]=n,jspb.Message.setField(e,t,r)},jspb.Message.setOneofWrapperField=function(e,t,n,r){goog.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={});var o=r?r.toArray():r;return e.wrappers_[t]=r,jspb.Message.setOneofField(e,t,n,o)},jspb.Message.setRepeatedWrapperField=function(e,t,n){goog.asserts.assertInstanceof(e,jspb.Message),e.wrappers_||(e.wrappers_={}),n=n||[];for(var r=[],o=0;o<n.length;o++)r[o]=n[o].toArray();return e.wrappers_[t]=n,jspb.Message.setField(e,t,r)},jspb.Message.addToRepeatedWrapperField=function(e,t,n,r,o){jspb.Message.wrapRepeatedField_(e,r,t);var i=e.wrappers_[t];return i||(i=e.wrappers_[t]=[]),n=n||new r,e=jspb.Message.getRepeatedField(e,t),null!=o?(i.splice(o,0,n),e.splice(o,0,n.toArray())):(i.push(n),e.push(n.toArray())),n},jspb.Message.toMap=function(e,t,n,r){for(var o={},i=0;i<e.length;i++)o[t.call(e[i])]=n?n.call(e[i],r,e[i]):e[i];return o},jspb.Message.prototype.syncMapFields_=function(){if(this.wrappers_)for(var e in this.wrappers_){var t=this.wrappers_[e];if(Array.isArray(t))for(var n=0;n<t.length;n++)t[n]&&t[n].toArray();else t&&t.toArray()}},jspb.Message.prototype.toArray=function(){return this.syncMapFields_(),this.array},jspb.Message.GENERATE_TO_STRING&&(jspb.Message.prototype.toString=function(){return this.syncMapFields_(),this.array.toString()}),jspb.Message.prototype.getExtension=function(e){if(this.extensionObject_){this.wrappers_||(this.wrappers_={});var t=e.fieldIndex;if(e.isRepeated){if(e.isMessageType())return this.wrappers_[t]||(this.wrappers_[t]=goog.array.map(this.extensionObject_[t]||[],(function(t){return new e.ctor(t)}))),this.wrappers_[t]}else if(e.isMessageType())return!this.wrappers_[t]&&this.extensionObject_[t]&&(this.wrappers_[t]=new e.ctor(this.extensionObject_[t])),this.wrappers_[t];return this.extensionObject_[t]}},jspb.Message.prototype.setExtension=function(e,t){this.wrappers_||(this.wrappers_={}),jspb.Message.maybeInitEmptyExtensionObject_(this);var n=e.fieldIndex;return e.isRepeated?(t=t||[],e.isMessageType()?(this.wrappers_[n]=t,this.extensionObject_[n]=goog.array.map(t,(function(e){return e.toArray()}))):this.extensionObject_[n]=t):e.isMessageType()?(this.wrappers_[n]=t,this.extensionObject_[n]=t?t.toArray():t):this.extensionObject_[n]=t,this},jspb.Message.difference=function(e,t){if(!(e instanceof t.constructor))throw Error("Messages have different types.");var n=e.toArray();t=t.toArray();var r=[],o=0,i=n.length>t.length?n.length:t.length;for(e.getJsPbMessageId()&&(r[0]=e.getJsPbMessageId(),o=1);o<i;o++)jspb.Message.compareFields(n[o],t[o])||(r[o]=t[o]);return new e.constructor(r)},jspb.Message.equals=function(e,t){return e==t||!(!e||!t)&&e instanceof t.constructor&&jspb.Message.compareFields(e.toArray(),t.toArray())},jspb.Message.compareExtensions=function(e,t){e=e||{},t=t||{};var n,r={};for(n in e)r[n]=0;for(n in t)r[n]=0;for(n in r)if(!jspb.Message.compareFields(e[n],t[n]))return!1;return!0},jspb.Message.compareFields=function(e,t){if(e==t)return!0;if(!goog.isObject(e)||!goog.isObject(t))return!!("number"==typeof e&&isNaN(e)||"number"==typeof t&&isNaN(t))&&String(e)==String(t);if(e.constructor!=t.constructor)return!1;if(jspb.Message.SUPPORTS_UINT8ARRAY_&&e.constructor===Uint8Array){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}if(e.constructor===Array){var r=void 0,o=void 0,i=Math.max(e.length,t.length);for(n=0;n<i;n++){var a=e[n],s=t[n];if(a&&a.constructor==Object&&(goog.asserts.assert(void 0===r),goog.asserts.assert(n===e.length-1),r=a,a=void 0),s&&s.constructor==Object&&(goog.asserts.assert(void 0===o),goog.asserts.assert(n===t.length-1),o=s,s=void 0),!jspb.Message.compareFields(a,s))return!1}return!r&&!o||(r=r||{},o=o||{},jspb.Message.compareExtensions(r,o))}if(e.constructor===Object)return jspb.Message.compareExtensions(e,t);throw Error("Invalid type in JSPB array")},jspb.Message.prototype.cloneMessage=function(){return jspb.Message.cloneMessage(this)},jspb.Message.prototype.clone=function(){return jspb.Message.cloneMessage(this)},jspb.Message.clone=function(e){return jspb.Message.cloneMessage(e)},jspb.Message.cloneMessage=function(e){return new e.constructor(jspb.Message.clone_(e.toArray()))},jspb.Message.copyInto=function(e,t){goog.asserts.assertInstanceof(e,jspb.Message),goog.asserts.assertInstanceof(t,jspb.Message),goog.asserts.assert(e.constructor==t.constructor,"Copy source and target message should have the same type."),e=jspb.Message.clone(e);for(var n=t.toArray(),r=e.toArray(),o=n.length=0;o<r.length;o++)n[o]=r[o];t.wrappers_=e.wrappers_,t.extensionObject_=e.extensionObject_},jspb.Message.clone_=function(e){if(Array.isArray(e)){for(var t=Array(e.length),n=0;n<e.length;n++){var r=e[n];null!=r&&(t[n]="object"==typeof r?jspb.Message.clone_(goog.asserts.assert(r)):r)}return t}if(jspb.Message.SUPPORTS_UINT8ARRAY_&&e instanceof Uint8Array)return new Uint8Array(e);for(n in t={},e)null!=(r=e[n])&&(t[n]="object"==typeof r?jspb.Message.clone_(goog.asserts.assert(r)):r);return t},jspb.Message.registerMessageType=function(e,t){t.messageId=e},jspb.Message.messageSetExtensions={},jspb.Message.messageSetExtensionsBinary={},jspb.Export={},exports.Map=jspb.Map,exports.Message=jspb.Message,exports.BinaryReader=jspb.BinaryReader,exports.BinaryWriter=jspb.BinaryWriter,exports.ExtensionFieldInfo=jspb.ExtensionFieldInfo,exports.ExtensionFieldBinaryInfo=jspb.ExtensionFieldBinaryInfo,exports.exportSymbol=goog.exportSymbol,exports.inherits=goog.inherits,exports.object={extend:goog.object.extend},exports.typeOf=goog.typeOf},function(e,t,n){"use strict";const r=n(60).fromPromise,{makeDir:o,makeDirSync:i}=n(1234),a=r(o);e.exports={mkdirs:a,mkdirsSync:i,mkdirp:a,mkdirpSync:i,ensureDir:a,ensureDirSync:i}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAsyncIterable=t.isAsyncGenerator=t.isAsync=void 0;var r,o=n(1295),i=(r=o)&&r.__esModule?r:{default:r};function a(e){return"AsyncFunction"===e[Symbol.toStringTag]}t.default=function(e){if("function"!=typeof e)throw new Error("expected a function");return a(e)?(0,i.default)(e):e},t.isAsync=a,t.isAsyncGenerator=function(e){return"AsyncGenerator"===e[Symbol.toStringTag]},t.isAsyncIterable=function(e){return"function"==typeof e[Symbol.asyncIterator]}},function(e){e.exports=JSON.parse('{"name":"@abtnode/webapp","version":"1.7.23","homepage":".","publishConfig":{"access":"public","directory":".blocklet/bundle/"},"files":["build","blocklet.js","README.md"],"keywords":["arcblock","forge","react"],"author":"wangshijun <shijun@arcblock.io> https://github.com/wangshijun","repository":{"type":"git","url":"https://github.com/ArcBlock/blocklet-server/tree/master/core/webapp"},"bugs":{"url":"https://github.com/ArcBlock/blocklet-server/issues","email":"shijun@arcblock.io"},"dependencies":{"@abtnode/auth":"1.7.23","@abtnode/certificate-manager":"1.7.23","@abtnode/constant":"1.7.23","@abtnode/logger":"1.7.23","@abtnode/mocks":"1.7.23","@abtnode/router-adapter":"1.7.23","@abtnode/router-templates":"1.7.23","@abtnode/schema":"1.7.23","@abtnode/util":"1.7.23","@arcblock/did":"^1.16.15","@arcblock/did-auth":"^1.16.15","@arcblock/did-auth-storage-nedb":"^1.6.3","@arcblock/did-connect":"^2.1.14","@arcblock/did-motif":"^1.1.9","@arcblock/did-util":"^1.16.15","@arcblock/graphql-playground":"^2.1.14","@arcblock/license":"^2.1.14","@arcblock/vc":"^1.16.15","@arcblock/ws":"^1.16.15","@blocklet/meta":"1.7.23","@blocklet/sdk":"1.7.23","@graphql-tools/schema":"^7.1.0","@material-table/core":"^0.2.33","@ocap/client":"^1.16.15","@ocap/mcrypto":"^1.16.15","@ocap/util":"^1.16.15","@ocap/wallet":"^1.16.15","@uiw/react-markdown-preview":"^4.0.6","axios":"^0.27.2","body-parser":"^1.19.0","chalk":"^2.4.2","compression":"^1.7.4","cookie-parser":"^1.4.4","core-js":"2.5.7","cors":"^2.8.5","debug":"^4.3.3","dotenv-flow":"^3.2.0","express":"^4.17.1","express-async-errors":"^3.1.1","express-bearer-token":"^2.4.0","express-graphql":"0.9.0","express-history-api-fallback":"^2.2.1","file-saver":"^2.0.5","filesize":"^6.1.0","flat":"^5.0.0","fs-extra":"^10.0.1","github-markdown-css":"^4.0.0","graphql":"14.6.0","graphql-upload":"11.0.0","history":"^5.0.0","http-proxy":"^1.18.1","http-proxy-middleware":"^0.19.1","humanize-url":"^2.1.0","is-ip":"^3.1.0","is-url":"^1.2.4","js-yaml":"^4.1.0","json-schema-defaults":"^0.4.0","jsonwebtoken":"^8.5.1","jszip":"^3.7.1","lodash":"^4.17.21","lru-cache":"^6.0.0","md5":"^2.3.0","moment":"^2.29.1","morgan":"^1.9.1","multibase":"^4.0.6","notistack":"2.0.5","pretty-ms-i18n":"^1.0.3","prop-types":"^15.7.2","react":"^18.1.0","react-dom":"^18.1.0","react-dropzone":"^11.0.2","react-error-boundary":"^2.3.1","react-hook-form":"^6.11.5","react-image-gallery":"^1.0.8","react-router-dom":"^5.1.2","react-scripts":"^3.4.3","react-use":"^17.3.2","read-last-lines":"^1.8.0","semver":"^7.3.2","styled-components":"^5.0.1","tail":"^2.0.4","tar":"^6.1.0","timeago.js":"^4.0.2","tweetnacl":"^1.0.3","url-join":"^4.0.1"},"scripts":{"lint":"eslint src api","lint:fix":"eslint src api --fix","prepublishOnly":"npm run build","clean":"rm -rf build blocklet.js","deep-clean":"PM2_HOME=~/.arcblock/abtnode-dev pm2 kill && ps aux | grep nginx | grep master | awk \'{print $2}\' | xargs kill","start":"npm-run-all --parallel start:*","start:hub":"NODE_ENV=development node dev/hub.js","start:updater":"NODE_ENV=development node dev/updater.js","start:daemon":"NODE_ENV=development node dev/watcher/daemon.js","start:service":"NODE_ENV=development node dev/watcher/service.js","start:client":"NODE_ENV=development react-app-rewired start","start-e2e":"npm-run-all --parallel start-e2e:*","start-e2e:hub":"NODE_ENV=e2e node dev/hub.js","start-e2e:updater":"NODE_ENV=e2e node dev/updater.js","start-e2e:daemon":"NODE_ENV=e2e nyc --silent node dev/daemon.js","start-e2e:service":"NODE_ENV=e2e nyc --silent node dev/service.js","start-e2e:static":"node tools/test-blocklets-server.js","start-e2e:client":"BROWSER=none REACT_APP_ENV=e2e NODE_ENV=development react-app-rewired start","reset:blocklets":"NODE_ENV=development node tools/remove-blocklets.js","build":"npm run clean && npm run build:client && npm run build:daemon","build:client":"NODE_ENV=production CI=1 react-app-rewired build","build:daemon":"NODE_ENV=production NEDB_MULTI_PORT=40404 ABT_NODE_UPDATER_PORT=40405 ABT_NODE_SERVICE_PORT=40406 node ../../blocklet/cli/bin/blocklet.js bundle -w api/webpack.blocklet.js","build-daemon-debug":"NODE_ENV=development NEDB_MULTI_PORT=40404 ABT_NODE_UPDATER_PORT=40405 ABT_NODE_SERVICE_PORT=40406 TEST_BUILD=1 node ../cli/bin/blocklet.js bundle -w api/webpack.blocklet.js","prepare:e2e":"rm -rf /tmp/abtnode/e2e .nyc_output .cypress && node tools/prepare-e2e.js && cd ../ux && npm run build && cd ../blocklet-services && npm run build && cd ../../core/webapp","test:api":"jest","test:src":"react-app-rewired test","test:e2e":"npm run prepare:e2e && start-server-and-test start-e2e 3000 cypress-e2e","coverage":"rm -rf coverage* && npm-run-all coverage:*","coverage:api":"API=1 jest --coverage","coverage:src":"CI=1 react-app-rewired test --coverage","coverage:e2e":"npm run prepare:e2e && start-server-and-test start-e2e 3000 cypress-ci","cypress-e2e":"cypress open","cypress-install":"cypress install","cypress-ci":"cypress run --headed --browser chrome --record false && nyc report --reporter=text","merge:coverage":"./tools/merge-coverage.sh","analyze:daemon":"NODE_ENV=production ANALYZE_BUNDLE=1 node ../cli/bin/blocklet.js bundle -w api/webpack.blocklet.js","analyze:client":"npm run build:client && source-map-explorer \'build/static/js/*.js\'","dev:migration":"node tools/dev-migration"},"resolutions":{"graphql":"14.6.0"},"browserslist":{"production":[">0.2%","not dead","not op_mini all"],"development":["last 1 chrome version","last 1 firefox version","last 1 safari version"]},"devDependencies":{"@abtnode/client":"1.7.23","@abtnode/router-provider":"1.7.23","@abtnode/ux":"1.7.23","@arcblock/did-motif":"^1.1.9","@arcblock/event-hub":"1.16.15","@arcblock/icons":"^2.1.14","@arcblock/jwt":"1.16.15","@arcblock/ux":"^2.1.14","@blocklet/launcher-layout":"^1.7.14","@blocklet/list":"^0.8.28","@cypress/code-coverage":"^3.9.12","@emotion/react":"^11.9.0","@emotion/styled":"^11.8.1","@mui/icons-material":"^5.6.2","@mui/lab":"^5.0.0-alpha.81","@mui/material":"^5.6.4","@mui/styles":"^5.6.2","async-exit-hook":"^2.0.1","babel-plugin-istanbul":"^6.0.0","classnames":"^2.3.1","cypress":"^9.5.1","cypress-fail-fast":"^3.4.1","cypress-file-upload":"^5.0.8","cypress-localstorage-commands":"^1.7.0","cypress-react-selector":"^2.3.16","cypress-wait-until":"^1.7.2","jest":"^27.4.5","json-stable-stringify":"^1.0.1","mutationobserver-shim":"^0.3.7","node-cleanup":"^2.1.2","nodemon":"^1.19.1","npm-run-all":"^4.1.5","nyc":"^15.1.0","react-app-rewired":"^2.1.6","source-map-explorer":"^2.4.2","start-server-and-test":"^1.11.7","supertest":"^6.1.3","webpack-bundle-analyzer":"^4.1.0"},"nyc":{"all":false,"report-dir":"coverage-e2e","include":["src/**/*.js","api/**/*.js"],"exclude":["**/*.spec.js","**/*.test.js","api/webpack.blocklet.js"]},"license":"Apache-2.0","gitHead":"aa13838b7597bce11851d0b902575f861aa1ab34"}')},function(e,t,n){"use strict";n.r(t),n.d(t,"parse",(function(){return d})),n.d(t,"parseValue",(function(){return f})),n.d(t,"parseType",(function(){return h}));var r=n(2),o=n(6),i=n(54),a=n(55),s=n(1),l=n(157),u=n(180),p=n(7),c=n(5);function d(e,t){return new g(e,t).parseDocument()}function f(e,t){var n=new g(e,t);n.expectToken(c.a.SOF);var r=n.parseValueLiteral(!1);return n.expectToken(c.a.EOF),r}function h(e,t){var n=new g(e,t);n.expectToken(c.a.SOF);var r=n.parseTypeReference();return n.expectToken(c.a.EOF),r}var g=function(){function e(e,t){var n="string"==typeof e?new l.a(e):e;n instanceof l.a||Object(o.a)(0,"Must provide Source. Received: ".concat(Object(r.a)(n))),this._lexer=Object(u.a)(n),this._options=t||{}}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(c.a.NAME);return{kind:s.a.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:s.a.DOCUMENT,definitions:this.many(c.a.SOF,this.parseDefinition,c.a.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(c.a.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(c.a.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(c.a.BRACE_L))return{kind:s.a.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,n=this.parseOperationType();return this.peek(c.a.NAME)&&(t=this.parseName()),{kind:s.a.OPERATION_DEFINITION,operation:n,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseOperationType=function(){var e=this.expectToken(c.a.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(c.a.PAREN_L,this.parseVariableDefinition,c.a.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:s.a.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(c.a.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(c.a.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(c.a.DOLLAR),{kind:s.a.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:s.a.SELECTION_SET,selections:this.many(c.a.BRACE_L,this.parseSelection,c.a.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(c.a.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,n=this._lexer.token,r=this.parseName();return this.expectOptionalToken(c.a.COLON)?(e=r,t=this.parseName()):t=r,{kind:s.a.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(c.a.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(c.a.PAREN_L,t,c.a.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(c.a.COLON),{kind:s.a.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:s.a.ARGUMENT,name:this.parseName(),value:(this.expectToken(c.a.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(c.a.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(c.a.NAME)?{kind:s.a.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:s.a.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e=this._lexer.token;return this.expectKeyword("fragment"),this._options.experimentalFragmentVariables?{kind:s.a.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}:{kind:s.a.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case c.a.BRACKET_L:return this.parseList(e);case c.a.BRACE_L:return this.parseObject(e);case c.a.INT:return this._lexer.advance(),{kind:s.a.INT,value:t.value,loc:this.loc(t)};case c.a.FLOAT:return this._lexer.advance(),{kind:s.a.FLOAT,value:t.value,loc:this.loc(t)};case c.a.STRING:case c.a.BLOCK_STRING:return this.parseStringLiteral();case c.a.NAME:return"true"===t.value||"false"===t.value?(this._lexer.advance(),{kind:s.a.BOOLEAN,value:"true"===t.value,loc:this.loc(t)}):"null"===t.value?(this._lexer.advance(),{kind:s.a.NULL,loc:this.loc(t)}):(this._lexer.advance(),{kind:s.a.ENUM,value:t.value,loc:this.loc(t)});case c.a.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:s.a.STRING,value:e.value,block:e.kind===c.a.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,n=this._lexer.token;return{kind:s.a.LIST,values:this.any(c.a.BRACKET_L,(function(){return t.parseValueLiteral(e)}),c.a.BRACKET_R),loc:this.loc(n)}},t.parseObject=function(e){var t=this,n=this._lexer.token;return{kind:s.a.OBJECT,fields:this.any(c.a.BRACE_L,(function(){return t.parseObjectField(e)}),c.a.BRACE_R),loc:this.loc(n)}},t.parseObjectField=function(e){var t=this._lexer.token,n=this.parseName();return this.expectToken(c.a.COLON),{kind:s.a.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(c.a.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(c.a.AT),{kind:s.a.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return this.expectOptionalToken(c.a.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(c.a.BRACKET_R),e={kind:s.a.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(c.a.BANG)?{kind:s.a.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:s.a.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===c.a.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(c.a.STRING)||this.peek(c.a.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token;this.expectKeyword("schema");var t=this.parseDirectives(!0),n=this.many(c.a.BRACE_L,this.parseOperationTypeDefinition,c.a.BRACE_R);return{kind:s.a.SCHEMA_DEFINITION,directives:t,operationTypes:n,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(c.a.COLON);var n=this.parseNamedType();return{kind:s.a.OPERATION_TYPE_DEFINITION,operation:t,type:n,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var n=this.parseName(),r=this.parseDirectives(!0);return{kind:s.a.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var n=this.parseName(),r=this.parseImplementsInterfaces(),o=this.parseDirectives(!0),i=this.parseFieldsDefinition();return{kind:s.a.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:o,fields:i,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e=[];if(this.expectOptionalKeyword("implements")){this.expectOptionalToken(c.a.AMP);do{e.push(this.parseNamedType())}while(this.expectOptionalToken(c.a.AMP)||this._options.allowLegacySDLImplementsInterfaces&&this.peek(c.a.NAME))}return e},t.parseFieldsDefinition=function(){return this._options.allowLegacySDLEmptyFields&&this.peek(c.a.BRACE_L)&&this._lexer.lookahead().kind===c.a.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(c.a.BRACE_L,this.parseFieldDefinition,c.a.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(c.a.COLON);var o=this.parseTypeReference(),i=this.parseDirectives(!0);return{kind:s.a.FIELD_DEFINITION,description:t,name:n,arguments:r,type:o,directives:i,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(c.a.PAREN_L,this.parseInputValueDef,c.a.PAREN_R)},t.parseInputValueDef=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(c.a.COLON);var r,o=this.parseTypeReference();this.expectOptionalToken(c.a.EQUALS)&&(r=this.parseValueLiteral(!0));var i=this.parseDirectives(!0);return{kind:s.a.INPUT_VALUE_DEFINITION,description:t,name:n,type:o,defaultValue:r,directives:i,loc:this.loc(e)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var n=this.parseName(),r=this.parseDirectives(!0),o=this.parseFieldsDefinition();return{kind:s.a.INTERFACE_TYPE_DEFINITION,description:t,name:n,directives:r,fields:o,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var n=this.parseName(),r=this.parseDirectives(!0),o=this.parseUnionMemberTypes();return{kind:s.a.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:o,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){var e=[];if(this.expectOptionalToken(c.a.EQUALS)){this.expectOptionalToken(c.a.PIPE);do{e.push(this.parseNamedType())}while(this.expectOptionalToken(c.a.PIPE))}return e},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var n=this.parseName(),r=this.parseDirectives(!0),o=this.parseEnumValuesDefinition();return{kind:s.a.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:o,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(c.a.BRACE_L,this.parseEnumValueDefinition,c.a.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseDirectives(!0);return{kind:s.a.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var n=this.parseName(),r=this.parseDirectives(!0),o=this.parseInputFieldsDefinition();return{kind:s.a.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:o,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(c.a.BRACE_L,this.parseInputValueDef,c.a.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===c.a.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),n=this.optionalMany(c.a.BRACE_L,this.parseOperationTypeDefinition,c.a.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return{kind:s.a.SCHEMA_EXTENSION,directives:t,operationTypes:n,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),n=this.parseDirectives(!0);if(0===n.length)throw this.unexpected();return{kind:s.a.SCALAR_TYPE_EXTENSION,name:t,directives:n,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),o=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===o.length)throw this.unexpected();return{kind:s.a.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:o,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:s.a.INTERFACE_TYPE_EXTENSION,name:t,directives:n,fields:r,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:s.a.UNION_TYPE_EXTENSION,name:t,directives:n,types:r,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:s.a.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:s.a.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(c.a.AT);var n=this.parseName(),r=this.parseArgumentDefs(),o=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var i=this.parseDirectiveLocations();return{kind:s.a.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:o,locations:i,loc:this.loc(e)}},t.parseDirectiveLocations=function(){this.expectOptionalToken(c.a.PIPE);var e=[];do{e.push(this.parseDirectiveLocation())}while(this.expectOptionalToken(c.a.PIPE));return e},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==p.a[t.value])return t;throw this.unexpected(e)},t.loc=function(e){if(!this._options.noLocation)return new m(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw Object(a.a)(this._lexer.source,t.start,"Expected ".concat(e,", found ").concat(y(t)))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind!==c.a.NAME||t.value!==e)throw Object(a.a)(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(y(t)));this._lexer.advance()},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===c.a.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=e||this._lexer.token;return Object(a.a)(this._lexer.source,t.start,"Unexpected ".concat(y(t)))},t.any=function(e,t,n){this.expectToken(e);for(var r=[];!this.expectOptionalToken(n);)r.push(t.call(this));return r},t.optionalMany=function(e,t,n){if(this.expectOptionalToken(e)){var r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}return[]},t.many=function(e,t,n){this.expectToken(e);var r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r},e}();function m(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}function y(e){var t=e.value;return t?"".concat(e.kind,' "').concat(t,'"'):e.kind}Object(i.a)(m,(function(){return{start:this.start,end:this.end}}))},function(e,t){e.exports=require("os")},function(module,exports,__webpack_require__){
|
|
21
21
|
/*!
|
|
22
22
|
* depd
|
|
23
23
|
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|
@@ -494,7 +494,7 @@ e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月
|
|
|
494
494
|
//! moment.js locale configuration
|
|
495
495
|
e.defineLocale("zh-mo",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"D/M/YYYY",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var r=100*e+t;return r<600?"凌晨":r<900?"早上":r<1130?"上午":r<1230?"中午":r<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n(4))},function(e,t,n){!function(e){"use strict";
|
|
496
496
|
//! moment.js locale configuration
|
|
497
|
-
e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var r=100*e+t;return r<600?"凌晨":r<900?"早上":r<1130?"上午":r<1230?"中午":r<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n(4))},function(e){e.exports=JSON.parse('{"name":"@abtnode/auth","publishConfig":{"access":"public"},"version":"1.7.22","description":"Simple lib to manage auth in ABT Node","main":"lib/index.js","files":["lib","components"],"scripts":{"lint":"eslint tests lib","lint:fix":"eslint --fix tests lib","test":"node tools/jest.js","coverage":"npm run test -- --coverage"},"keywords":[],"author":"linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)","license":"MIT","dependencies":{"@abtnode/constant":"1.7.22","@abtnode/logger":"1.7.22","@abtnode/util":"1.7.22","@arcblock/did":"^1.16.15","@arcblock/vc":"^1.16.15","@blocklet/meta":"1.7.22","@ocap/client":"1.16.15","@ocap/mcrypto":"^1.16.15","@ocap/util":"^1.16.15","@ocap/wallet":"^1.16.15","axios":"^0.27.2","joi":"^17.6.0","jsonwebtoken":"^8.5.1","lodash":"^4.17.21","semver":"^7.3.2","url-join":"^4.0.1"},"devDependencies":{"jest":"^27.4.5"},"gitHead":"6190972e62b5e6b1039aa71a291b3e2c521df367"}')},function(e,t,n){"use strict";const r=n(1325);e.exports=class extends Error{constructor(e){super(e.filter(e=>""!==e).map(e=>"string"==typeof e?e:e instanceof Error?e.message:r(e)).join(" ")||"Unknown error"),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,t.assert)}}},function(e,t,n){"use strict";const r={};t=e.exports={array:Array.prototype,buffer:Buffer&&Buffer.prototype,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},r.typeMap=new Map([["[object Error]",t.error],["[object Map]",t.map],["[object Promise]",t.promise],["[object Set]",t.set],["[object WeakMap]",t.weakMap],["[object WeakSet]",t.weakSet]]),t.getInternalProto=function(e){if(Array.isArray(e))return t.array;if(Buffer&&e instanceof Buffer)return t.buffer;if(e instanceof Date)return t.date;if(e instanceof RegExp)return t.regex;if(e instanceof Error)return t.error;const n=Object.prototype.toString.call(e);return r.typeMap.get(n)||t.generic}},function(e,t,n){"use strict";t.keys=function(e,t={}){return!1!==t.symbols?Reflect.ownKeys(e):Object.getOwnPropertyNames(e)}},function(e,t,n){"use strict";const r=n(16),o=n(58),i=n(22),a={max:1e3,supported:new Set(["undefined","boolean","number","string"])};t.provider={provision:e=>new a.Cache(e)},a.Cache=class{constructor(e={}){i.assertOptions(e,["max"]),r(void 0===e.max||e.max&&e.max>0&&isFinite(e.max),"Invalid max cache size"),this._max=e.max||a.max,this._map=new Map,this._list=new a.List}get length(){return this._map.size}set(e,t){if(null!==e&&!a.supported.has(typeof e))return;let n=this._map.get(e);if(n)return n.value=t,void this._list.first(n);n=this._list.unshift({key:e,value:t}),this._map.set(e,n),this._compact()}get(e){const t=this._map.get(e);if(t)return this._list.first(t),o(t.value)}_compact(){if(this._map.size>this._max){const e=this._list.pop();this._map.delete(e.key)}}},a.List=class{constructor(){this.tail=null,this.head=null}unshift(e){return e.next=null,e.prev=this.head,this.head&&(this.head.next=e),this.head=e,this.tail||(this.tail=e),e}first(e){e!==this.head&&(this._remove(e),this.unshift(e))}pop(){return this._remove(this.tail)}_remove(e){const{next:t,prev:n}=e;return t.prev=n,n&&(n.next=t),e===this.tail&&(this.tail=t),e.prev=null,e.next=null,e}}},function(e,t,n){"use strict";const r=n(16),o=n(58),i=n(22),a=n(176),s={};t.type=function(e,t){const n=Object.getPrototypeOf(e),l=o(n),u=e._assign(Object.create(l)),p=Object.assign({},t);delete p.base,l._definition=p;const c=n._definition||{};p.messages=a.merge(c.messages,p.messages),p.properties=Object.assign({},c.properties,p.properties),u.type=p.type,p.flags=Object.assign({},c.flags,p.flags);const d=Object.assign({},c.terms);if(p.terms)for(const e in p.terms){const t=p.terms[e];r(void 0===u.$_terms[e],"Invalid term override for",p.type,e),u.$_terms[e]=t.init,d[e]=t}p.terms=d,p.args||(p.args=c.args),p.prepare=s.prepare(p.prepare,c.prepare),p.coerce&&("function"==typeof p.coerce&&(p.coerce={method:p.coerce}),p.coerce.from&&!Array.isArray(p.coerce.from)&&(p.coerce={method:p.coerce.method,from:[].concat(p.coerce.from)})),p.coerce=s.coerce(p.coerce,c.coerce),p.validate=s.validate(p.validate,c.validate);const f=Object.assign({},c.rules);if(p.rules)for(const e in p.rules){const t=p.rules[e];r("object"==typeof t,"Invalid rule definition for",p.type,e);let n=t.method;if(void 0===n&&(n=function(){return this.$_addRule(e)}),n&&(r(!l[e],"Rule conflict in",p.type,e),l[e]=n),r(!f[e],"Rule conflict in",p.type,e),f[e]=t,t.alias){const e=[].concat(t.alias);for(const n of e)l[n]=t.method}t.args&&(t.argsByName=new Map,t.args=t.args.map(e=>("string"==typeof e&&(e={name:e}),r(!t.argsByName.has(e.name),"Duplicated argument name",e.name),i.isSchema(e.assert)&&(e.assert=e.assert.strict().label(e.name)),t.argsByName.set(e.name,e),e)))}p.rules=f;const h=Object.assign({},c.modifiers);if(p.modifiers)for(const e in p.modifiers){r(!l[e],"Rule conflict in",p.type,e);const t=p.modifiers[e];r("function"==typeof t,"Invalid modifier definition for",p.type,e);const n=function(t){return this.rule({[e]:t})};l[e]=n,h[e]=t}if(p.modifiers=h,p.overrides){l._super=n,u.$_super={};for(const e in p.overrides)r(n[e],"Cannot override missing",e),p.overrides[e][i.symbols.parent]=n[e],u.$_super[e]=n[e].bind(u);Object.assign(l,p.overrides)}p.cast=Object.assign({},c.cast,p.cast);const g=Object.assign({},c.manifest,p.manifest);return g.build=s.build(p.manifest&&p.manifest.build,c.manifest&&c.manifest.build),p.manifest=g,p.rebuild=s.rebuild(p.rebuild,c.rebuild),u},s.build=function(e,t){return e&&t?function(n,r){return t(e(n,r),r)}:e||t},s.coerce=function(e,t){return e&&t?{from:e.from&&t.from?[...new Set([...e.from,...t.from])]:null,method(n,r){let o;if((!t.from||t.from.includes(typeof n))&&(o=t.method(n,r),o)){if(o.errors||void 0===o.value)return o;n=o.value}if(!e.from||e.from.includes(typeof n)){const t=e.method(n,r);if(t)return t}return o}}:e||t},s.prepare=function(e,t){return e&&t?function(n,r){const o=e(n,r);if(o){if(o.errors||void 0===o.value)return o;n=o.value}return t(n,r)||o}:e||t},s.rebuild=function(e,t){return e&&t?function(n){t(n),e(n)}:e||t},s.validate=function(e,t){return e&&t?function(n,r){const o=t(n,r);if(o){if(o.errors&&(!Array.isArray(o.errors)||o.errors.length))return o;n=o.value}return e(n,r)||o}:e||t}},function(e,t,n){"use strict";const r=n(16),o=n(58),i=n(22),a=n(176),s=n(107),l=n(123);let u;const p={};t.describe=function(e){const t=e._definition,n={type:e.type,flags:{},rules:[]};for(const t in e._flags)"_"!==t[0]&&(n.flags[t]=p.describe(e._flags[t]));Object.keys(n.flags).length||delete n.flags,e._preferences&&(n.preferences=o(e._preferences,{shallow:["messages"]}),delete n.preferences[i.symbols.prefs],n.preferences.messages&&(n.preferences.messages=a.decompile(n.preferences.messages))),e._valids&&(n.allow=e._valids.describe()),e._invalids&&(n.invalid=e._invalids.describe());for(const r of e._rules){if(!1===t.rules[r.name].manifest)continue;const e={name:r.name};for(const n in t.modifiers)void 0!==r[n]&&(e[n]=p.describe(r[n]));if(r.args){e.args={};for(const t in r.args){const n=r.args[t];("options"!==t||Object.keys(n).length)&&(e.args[t]=p.describe(n,{assign:t}))}Object.keys(e.args).length||delete e.args}n.rules.push(e)}n.rules.length||delete n.rules;for(const o in e.$_terms){if("_"===o[0])continue;r(!n[o],"Cannot describe schema due to internal name conflict with",o);const a=e.$_terms[o];if(!a)continue;if(a instanceof Map){a.size&&(n[o]=[...a.entries()]);continue}if(i.isValues(a)){n[o]=a.describe();continue}r(t.terms[o],"Term",o,"missing configuration");const s=t.terms[o].manifest,l="object"==typeof s;if(!a.length&&!l)continue;const u=[];for(const e of a)u.push(p.describe(e));if(l){const{from:e,to:t}=s.mapped;n[o]={};for(const r of u)n[o][r[t]]=r[e]}else"single"!==s?n[o]=u:(r(1===u.length,"Term",o,"contains more than one item"),n[o]=u[0])}return p.validate(e.$_root,n),n},p.describe=function(e,t={}){if(Array.isArray(e))return e.map(p.describe);if(e===i.symbols.deepDefault)return{special:"deep"};if("object"!=typeof e||null===e)return e;if("options"===t.assign)return o(e);if(Buffer&&Buffer.isBuffer(e))return{buffer:e.toString("binary")};if(e instanceof Date)return e.toISOString();if(e instanceof Error)return e;if(e instanceof RegExp)return"regex"===t.assign?e.toString():{regex:e.toString()};if(e[i.symbols.literal])return{function:e.literal};if("function"==typeof e.describe)return"ref"===t.assign?e.describe().ref:e.describe();const n={};for(const t in e){const r=e[t];void 0!==r&&(n[t]=p.describe(r,{assign:t}))}return n},t.build=function(e,t){return new p.Builder(e).parse(t)},p.Builder=class{constructor(e){this.joi=e}parse(e){p.validate(this.joi,e);let t=this.joi[e.type]()._bare();const n=t._definition;if(e.flags)for(const o in e.flags){const i=n.flags[o]&&n.flags[o].setter||o;r("function"==typeof t[i],"Invalid flag",o,"for type",e.type),t=t[i](this.build(e.flags[o]))}if(e.preferences&&(t=t.preferences(this.build(e.preferences))),e.allow&&(t=t.allow(...this.build(e.allow))),e.invalid&&(t=t.invalid(...this.build(e.invalid))),e.rules)for(const o of e.rules){r("function"==typeof t[o.name],"Invalid rule",o.name,"for type",e.type);const i=[];if(o.args){const t={};for(const e in o.args)t[e]=this.build(o.args[e],{assign:e});const a=Object.keys(t),s=n.rules[o.name].args;if(s){r(a.length<=s.length,"Invalid number of arguments for",e.type,o.name,"(expected up to",s.length,", found",a.length,")");for(const{name:e}of s)i.push(t[e])}else r(1===a.length,"Invalid number of arguments for",e.type,o.name,"(expected up to 1, found",a.length,")"),i.push(t[a[0]])}t=t[o.name](...i);const a={};for(const e in n.modifiers)void 0!==o[e]&&(a[e]=this.build(o[e]));Object.keys(a).length&&(t=t.rule(a))}const o={};for(const t in e){if(["allow","flags","invalid","whens","preferences","rules","type"].includes(t))continue;r(n.terms[t],"Term",t,"missing configuration");const i=n.terms[t].manifest;if("schema"!==i)if("values"!==i)if("single"!==i)if("object"!=typeof i)o[t]=this.build(e[t]);else{o[t]={};for(const n in e[t]){const r=e[t][n];o[t][n]=this.parse(r)}}else o[t]=this.build(e[t]);else o[t]=e[t].map(e=>this.build(e));else o[t]=e[t].map(e=>this.parse(e))}return e.whens&&(o.whens=e.whens.map(e=>this.build(e))),t=n.manifest.build(t,o),t.$_temp.ruleset=!1,t}build(e,t={}){if(null===e)return null;if(Array.isArray(e))return e.map(e=>this.build(e));if(e instanceof Error)return e;if("options"===t.assign)return o(e);if("regex"===t.assign)return p.regex(e);if("ref"===t.assign)return s.build(e);if("object"!=typeof e)return e;if(1===Object.keys(e).length){if(e.buffer)return r(Buffer,"Buffers are not supported"),Buffer&&Buffer.from(e.buffer,"binary");if(e.function)return{[i.symbols.literal]:!0,literal:e.function};if(e.override)return i.symbols.override;if(e.ref)return s.build(e.ref);if(e.regex)return p.regex(e.regex);if(e.special)return r(["deep"].includes(e.special),"Unknown special value",e.special),i.symbols.deepDefault;if(e.value)return o(e.value)}if(e.type)return this.parse(e);if(e.template)return l.build(e);const n={};for(const t in e)n[t]=this.build(e[t],{assign:t});return n}},p.regex=function(e){const t=e.lastIndexOf("/"),n=e.slice(1,t),r=e.slice(t+1);return new RegExp(n,r)},p.validate=function(e,t){u=u||n(347),e.assert(t,u.description)}},function(e,t,n){"use strict";const r=n(234),o=n(1330),i=n(106),a={codes:{error:1,pass:2,full:3},labels:{0:"never used",1:"always error",2:"always pass"}};t.setup=function(e){const t=function(){return e._tracer=e._tracer||new a.Tracer,e._tracer};e.trace=t,e[Symbol.for("@hapi/lab/coverage/initialize")]=t,e.untrace=()=>{e._tracer=null}},t.location=function(e){return e.$_setFlag("_tracerLocation",o.location(2))},a.Tracer=class{constructor(){this.name="Joi",this._schemas=new Map}_register(e){const t=this._schemas.get(e);if(t)return t.store;const n=new a.Store(e),{filename:r,line:i}=e._flags._tracerLocation||o.location(5);return this._schemas.set(e,{filename:r,line:i,store:n}),n}_combine(e,t){for(const{store:n}of this._schemas.values())n._combine(e,t)}report(e){const t=[];for(const{filename:n,line:r,store:o}of this._schemas.values()){if(e&&e!==n)continue;const i=[],s=[];for(const[e,t]of o._sources.entries()){if(a.sub(t.paths,s))continue;if(!t.entry){i.push({status:"never reached",paths:[...t.paths]}),s.push(...t.paths);continue}for(const n of["valid","invalid"]){const r=e[`_${n}s`];if(!r)continue;const o=new Set(r._values),a=new Set(r._refs);for(const{value:e,ref:r}of t[n])o.delete(e),a.delete(r);(o.size||a.size)&&i.push({status:[...o,...[...a].map(e=>e.display)],rule:n+"s"})}const n=e._rules.map(e=>e.name);for(const t of["default","failover"])void 0!==e._flags[t]&&n.push(t);for(const e of n){const n=a.labels[t.rule[e]||0];if(n){const r={rule:e,status:n};t.paths.size&&(r.paths=[...t.paths]),i.push(r)}}}i.length&&t.push({filename:n,line:r,missing:i,severity:"error",message:"Schema missing tests for "+i.map(a.message).join(", ")})}return t.length?t:null}},a.Store=class{constructor(e){this.active=!0,this._sources=new Map,this._combos=new Map,this._scan(e)}debug(e,t,n,r){e.mainstay.debug&&e.mainstay.debug.push({type:t,name:n,result:r,path:e.path})}entry(e,t){a.debug(t,{type:"entry"}),this._record(e,e=>{e.entry=!0})}filter(e,t,n,r){a.debug(t,{type:n,...r}),this._record(e,e=>{e[n].add(r)})}log(e,t,n,r,o){a.debug(t,{type:n,name:r,result:"full"===o?"pass":o}),this._record(e,e=>{e[n][r]=e[n][r]||0,e[n][r]|=a.codes[o]})}resolve(e,t,n){if(!e.mainstay.debug)return;const r={type:"resolve",ref:t.display,to:n,path:e.path};e.mainstay.debug.push(r)}value(e,t,n,o,i){if(!e.mainstay.debug||r(n,o))return;const a={type:"value",by:t,from:n,to:o,path:e.path};i&&(a.name=i),e.mainstay.debug.push(a)}_record(e,t){const n=this._sources.get(e);if(n)return void t(n);const r=this._combos.get(e);for(const e of r)this._record(e,t)}_scan(e,t){const n=t||[];let r=this._sources.get(e);r||(r={paths:new Set,entry:!1,rule:{},valid:new Set,invalid:new Set},this._sources.set(e,r)),n.length&&r.paths.add(n);e.$_modify({each:(e,t)=>{const r=a.id(e,t);this._scan(e,n.concat(r))},ref:!1})}_combine(e,t){this._combos.set(e,t)}},a.message=function(e){return`${e.paths?i.path(e.paths[0])+(e.rule?":":""):""}${e.rule||""} (${e.status})`},a.id=function(e,{source:t,name:n,path:r,key:o}){return e._flags.id?e._flags.id:o||(n="@"+n,"terms"===t?[n,r[Math.min(r.length-1,1)]]:n)},a.sub=function(e,t){for(const n of e)for(const e of t)if(r(n.slice(0,e.length),e))return!0;return!1},a.debug=function(e,t){e.mainstay.debug&&(t.path=e.debug?[...e.path,e.debug]:e.path,e.mainstay.debug.push(t))}},function(e,t,n){"use strict";const r=n(16),o=n(234),i=n(22),a={};e.exports=a.Values=class{constructor(e,t){this._values=new Set(e),this._refs=new Set(t),this._lowercase=a.lowercases(e),this._override=!1}get length(){return this._values.size+this._refs.size}add(e,t){i.isResolvable(e)?this._refs.has(e)||(this._refs.add(e),t&&t.register(e)):this.has(e,null,null,!1)||(this._values.add(e),"string"==typeof e&&this._lowercase.set(e.toLowerCase(),e))}static merge(e,t,n){if(e=e||new a.Values,t){if(t._override)return t.clone();for(const n of[...t._values,...t._refs])e.add(n)}if(n)for(const t of[...n._values,...n._refs])e.remove(t);return e.length?e:null}remove(e){i.isResolvable(e)?this._refs.delete(e):(this._values.delete(e),"string"==typeof e&&this._lowercase.delete(e.toLowerCase()))}has(e,t,n,r){return!!this.get(e,t,n,r)}get(e,t,n,r){if(!this.length)return!1;if(this._values.has(e))return{value:e};if("string"==typeof e&&e&&r){const t=this._lowercase.get(e.toLowerCase());if(t)return{value:t}}if(!this._refs.size&&"object"!=typeof e)return!1;if("object"==typeof e)for(const t of this._values)if(o(t,e))return{value:t};if(t)for(const i of this._refs){const a=i.resolve(e,t,n,null,{in:!0});if(void 0===a)continue;const s=i.in&&"object"==typeof a?Array.isArray(a)?a:Object.keys(a):[a];for(const t of s)if(typeof t==typeof e)if(r&&e&&"string"==typeof e){if(t.toLowerCase()===e.toLowerCase())return{value:t,ref:i}}else if(o(t,e))return{value:t,ref:i}}return!1}override(){this._override=!0}values(e){if(e&&e.display){const e=[];for(const t of[...this._values,...this._refs])void 0!==t&&e.push(t);return e}return Array.from([...this._values,...this._refs])}clone(){const e=new a.Values(this._values,this._refs);return e._override=this._override,e}concat(e){r(!e._override,"Cannot concat override set of values");const t=new a.Values([...this._values,...e._values],[...this._refs,...e._refs]);return t._override=this._override,t}describe(){const e=[];this._override&&e.push({override:!0});for(const t of this._values.values())e.push(t&&"object"==typeof t?{value:t}:t);for(const t of this._refs.values())e.push(t.describe());return e}},a.Values.prototype[i.symbols.values]=!0,a.Values.prototype.slice=a.Values.prototype.clone,a.lowercases=function(e){const t=new Map;if(e)for(const n of e)"string"==typeof n&&t.set(n.toLowerCase(),n);return t}},function(e,t,n){"use strict";const r=n(1341),o=n(16),i=n(58),a=n(1342),s=n(79),l=n(22),u=n(149),p=n(106),c=n(107),d=n(123),f={renameDefaults:{alias:!1,multiple:!1,override:!1}};e.exports=s.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:!1}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(e,t)=>e.keys(t),validate(e,{schema:t,error:n,state:r,prefs:o}){if(!e||typeof e!==t.$_property("typeof")||Array.isArray(e))return{value:e,errors:n("object.base",{type:t.$_property("typeof")})};if(!(t.$_terms.renames||t.$_terms.dependencies||t.$_terms.keys||t.$_terms.patterns||t.$_terms.externals))return;e=f.clone(e,o);const i=[];if(t.$_terms.renames&&!f.rename(t,e,r,o,i))return{value:e,errors:i};if(!t.$_terms.keys&&!t.$_terms.patterns&&!t.$_terms.dependencies)return{value:e,errors:i};const a=new Set(Object.keys(e));if(t.$_terms.keys){const n=[e,...r.ancestors];for(const s of t.$_terms.keys){const t=s.key,l=e[t];a.delete(t);const u=r.localize([...r.path,t],n,s),p=s.schema.$_validate(l,u,o);if(p.errors){if(o.abortEarly)return{value:e,errors:p.errors};void 0!==p.value&&(e[t]=p.value),i.push(...p.errors)}else"strip"===s.schema._flags.result||void 0===p.value&&void 0!==l?delete e[t]:void 0!==p.value&&(e[t]=p.value)}}if(a.size||t._flags._hasPatternMatch){const n=f.unknown(t,e,a,i,r,o);if(n)return n}if(t.$_terms.dependencies)for(const n of t.$_terms.dependencies){if(n.key&&void 0===n.key.resolve(e,r,o,null,{shadow:!1}))continue;const a=f.dependencies[n.rel](t,n,e,r,o);if(a){const n=t.$_createError(a.code,e,a.context,r,o);if(o.abortEarly)return{value:e,errors:n};i.push(n)}}return{value:e,errors:i}},rules:{and:{method(...e){return l.verifyFlat(e,"and"),f.dependency(this,"and",null,e)}},append:{method(e){return null==e||0===Object.keys(e).length?this:this.keys(e)}},assert:{method(e,t,n){d.isTemplate(e)||(e=u.ref(e)),o(void 0===n||"string"==typeof n,"Message must be a string"),t=this.$_compile(t,{appendPath:!0});const r=this.$_addRule({name:"assert",args:{subject:e,schema:t,message:n}});return r.$_mutateRegister(e),r.$_mutateRegister(t),r},validate(e,{error:t,prefs:n,state:r},{subject:o,schema:i,message:a}){const s=o.resolve(e,r,n),l=c.isRef(o)?o.absolute(r):[];return i.$_match(s,r.localize(l,[e,...r.ancestors],i),n)?e:t("object.assert",{subject:o,message:a})},args:["subject","schema","message"],multi:!0},instance:{method(e,t){return o("function"==typeof e,"constructor must be a function"),t=t||e.name,this.$_addRule({name:"instance",args:{constructor:e,name:t}})},validate:(e,t,{constructor:n,name:r})=>e instanceof n?e:t.error("object.instance",{type:r,value:e}),args:["constructor","name"]},keys:{method(e){o(void 0===e||"object"==typeof e,"Object schema must be a valid object"),o(!l.isSchema(e),"Object schema cannot be a joi schema");const t=this.clone();if(e)if(Object.keys(e).length){t.$_terms.keys=t.$_terms.keys?t.$_terms.keys.filter(t=>!e.hasOwnProperty(t.key)):new f.Keys;for(const n in e)l.tryWithPath(()=>t.$_terms.keys.push({key:n,schema:this.$_compile(e[n])}),n)}else t.$_terms.keys=new f.Keys;else t.$_terms.keys=null;return t.$_mutateRebuild()}},length:{method(e){return this.$_addRule({name:"length",args:{limit:e},operator:"="})},validate:(e,t,{limit:n},{name:r,operator:o,args:i})=>l.compare(Object.keys(e).length,n,o)?e:t.error("object."+r,{limit:i.limit,value:e}),args:[{name:"limit",ref:!0,assert:l.limit,message:"must be a positive integer"}]},max:{method(e){return this.$_addRule({name:"max",method:"length",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"length",args:{limit:e},operator:">="})}},nand:{method(...e){return l.verifyFlat(e,"nand"),f.dependency(this,"nand",null,e)}},or:{method(...e){return l.verifyFlat(e,"or"),f.dependency(this,"or",null,e)}},oxor:{method(...e){return f.dependency(this,"oxor",null,e)}},pattern:{method(e,t,n={}){const r=e instanceof RegExp;r||(e=this.$_compile(e,{appendPath:!0})),o(void 0!==t,"Invalid rule"),l.assertOptions(n,["fallthrough","matches"]),r&&o(!e.flags.includes("g")&&!e.flags.includes("y"),"pattern should not use global or sticky mode"),t=this.$_compile(t,{appendPath:!0});const i=this.clone();i.$_terms.patterns=i.$_terms.patterns||[];const a={[r?"regex":"schema"]:e,rule:t};return n.matches&&(a.matches=this.$_compile(n.matches),"array"!==a.matches.type&&(a.matches=a.matches.$_root.array().items(a.matches)),i.$_mutateRegister(a.matches),i.$_setFlag("_hasPatternMatch",!0,{clone:!1})),n.fallthrough&&(a.fallthrough=!0),i.$_terms.patterns.push(a),i.$_mutateRegister(t),i}},ref:{method(){return this.$_addRule("ref")},validate:(e,t)=>c.isRef(e)?e:t.error("object.refType",{value:e})},regex:{method(){return this.$_addRule("regex")},validate:(e,t)=>e instanceof RegExp?e:t.error("object.regex",{value:e})},rename:{method(e,t,n={}){o("string"==typeof e||e instanceof RegExp,"Rename missing the from argument"),o("string"==typeof t||t instanceof d,"Invalid rename to argument"),o(t!==e,"Cannot rename key to same name:",e),l.assertOptions(n,["alias","ignoreUndefined","override","multiple"]);const i=this.clone();i.$_terms.renames=i.$_terms.renames||[];for(const t of i.$_terms.renames)o(t.from!==e,"Cannot rename the same key multiple times");return t instanceof d&&i.$_mutateRegister(t),i.$_terms.renames.push({from:e,to:t,options:r(f.renameDefaults,n)}),i}},schema:{method(e="any"){return this.$_addRule({name:"schema",args:{type:e}})},validate:(e,t,{type:n})=>!l.isSchema(e)||"any"!==n&&e.type!==n?t.error("object.schema",{type:n}):e},unknown:{method(e){return this.$_setFlag("unknown",!1!==e)}},with:{method(e,t,n={}){return f.dependency(this,"with",e,t,n)}},without:{method(e,t,n={}){return f.dependency(this,"without",e,t,n)}},xor:{method(...e){return l.verifyFlat(e,"xor"),f.dependency(this,"xor",null,e)}}},overrides:{default(e,t){return void 0===e&&(e=l.symbols.deepDefault),this.$_parent("default",e,t)}},rebuild(e){if(e.$_terms.keys){const t=new a.Sorter;for(const n of e.$_terms.keys)l.tryWithPath(()=>t.add(n,{after:n.schema.$_rootReferences(),group:n.key}),n.key);e.$_terms.keys=new f.Keys(...t.nodes)}},manifest:{build(e,t){if(t.keys&&(e=e.keys(t.keys)),t.dependencies)for(const{rel:n,key:r=null,peers:o,options:i}of t.dependencies)e=f.dependency(e,n,r,o,i);if(t.patterns)for(const{regex:n,schema:r,rule:o,fallthrough:i,matches:a}of t.patterns)e=e.pattern(n||r,o,{fallthrough:i,matches:a});if(t.renames)for(const{from:n,to:r,options:o}of t.renames)e=e.rename(n,r,o);return e}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),f.clone=function(e,t){if("object"==typeof e){if(t.nonEnumerables)return i(e,{shallow:!0});const n=Object.create(Object.getPrototypeOf(e));return Object.assign(n,e),n}const n=function(...t){return e.apply(this,t)};return n.prototype=i(e.prototype),Object.defineProperty(n,"name",{value:e.name,writable:!1}),Object.defineProperty(n,"length",{value:e.length,writable:!1}),Object.assign(n,e),n},f.dependency=function(e,t,n,r,i){o(null===n||"string"==typeof n,t,"key must be a strings"),i||(i=r.length>1&&"object"==typeof r[r.length-1]?r.pop():{}),l.assertOptions(i,["separator"]),r=[].concat(r);const a=l.default(i.separator,"."),s=[];for(const e of r)o("string"==typeof e,t,"peers must be strings"),s.push(u.ref(e,{separator:a,ancestor:0,prefix:!1}));null!==n&&(n=u.ref(n,{separator:a,ancestor:0,prefix:!1}));const p=e.clone();return p.$_terms.dependencies=p.$_terms.dependencies||[],p.$_terms.dependencies.push(new f.Dependency(t,n,s,r)),p},f.dependencies={and(e,t,n,r,o){const i=[],a=[],s=t.peers.length;for(const e of t.peers)void 0===e.resolve(n,r,o,null,{shadow:!1})?i.push(e.key):a.push(e.key);if(i.length!==s&&a.length!==s)return{code:"object.and",context:{present:a,presentWithLabels:f.keysToLabels(e,a),missing:i,missingWithLabels:f.keysToLabels(e,i)}}},nand(e,t,n,r,o){const i=[];for(const e of t.peers)void 0!==e.resolve(n,r,o,null,{shadow:!1})&&i.push(e.key);if(i.length!==t.peers.length)return;const a=t.paths[0],s=t.paths.slice(1);return{code:"object.nand",context:{main:a,mainWithLabel:f.keysToLabels(e,a),peers:s,peersWithLabels:f.keysToLabels(e,s)}}},or(e,t,n,r,o){for(const e of t.peers)if(void 0!==e.resolve(n,r,o,null,{shadow:!1}))return;return{code:"object.missing",context:{peers:t.paths,peersWithLabels:f.keysToLabels(e,t.paths)}}},oxor(e,t,n,r,o){const i=[];for(const e of t.peers)void 0!==e.resolve(n,r,o,null,{shadow:!1})&&i.push(e.key);if(!i.length||1===i.length)return;const a={peers:t.paths,peersWithLabels:f.keysToLabels(e,t.paths)};return a.present=i,a.presentWithLabels=f.keysToLabels(e,i),{code:"object.oxor",context:a}},with(e,t,n,r,o){for(const i of t.peers)if(void 0===i.resolve(n,r,o,null,{shadow:!1}))return{code:"object.with",context:{main:t.key.key,mainWithLabel:f.keysToLabels(e,t.key.key),peer:i.key,peerWithLabel:f.keysToLabels(e,i.key)}}},without(e,t,n,r,o){for(const i of t.peers)if(void 0!==i.resolve(n,r,o,null,{shadow:!1}))return{code:"object.without",context:{main:t.key.key,mainWithLabel:f.keysToLabels(e,t.key.key),peer:i.key,peerWithLabel:f.keysToLabels(e,i.key)}}},xor(e,t,n,r,o){const i=[];for(const e of t.peers)void 0!==e.resolve(n,r,o,null,{shadow:!1})&&i.push(e.key);if(1===i.length)return;const a={peers:t.paths,peersWithLabels:f.keysToLabels(e,t.paths)};return 0===i.length?{code:"object.missing",context:a}:(a.present=i,a.presentWithLabels=f.keysToLabels(e,i),{code:"object.xor",context:a})}},f.keysToLabels=function(e,t){return Array.isArray(t)?t.map(t=>e.$_mapLabels(t)):e.$_mapLabels(t)},f.rename=function(e,t,n,r,o){const i={};for(const a of e.$_terms.renames){const s=[],l="string"!=typeof a.from;if(l)for(const e in t){if(void 0===t[e]&&a.options.ignoreUndefined)continue;if(e===a.to)continue;const n=a.from.exec(e);n&&s.push({from:e,to:a.to,match:n})}else!Object.prototype.hasOwnProperty.call(t,a.from)||void 0===t[a.from]&&a.options.ignoreUndefined||s.push(a);for(const u of s){const s=u.from;let p=u.to;if(p instanceof d&&(p=p.render(t,n,r,u.match)),s!==p){if(!a.options.multiple&&i[p]&&(o.push(e.$_createError("object.rename.multiple",t,{from:s,to:p,pattern:l},n,r)),r.abortEarly))return!1;if(Object.prototype.hasOwnProperty.call(t,p)&&!a.options.override&&!i[p]&&(o.push(e.$_createError("object.rename.override",t,{from:s,to:p,pattern:l},n,r)),r.abortEarly))return!1;void 0===t[s]?delete t[p]:t[p]=t[s],i[p]=!0,a.options.alias||delete t[s]}}}return!0},f.unknown=function(e,t,n,r,o,i){if(e.$_terms.patterns){let a=!1;const s=e.$_terms.patterns.map(e=>{if(e.matches)return a=!0,[]}),l=[t,...o.ancestors];for(const a of n){const u=t[a],p=[...o.path,a];for(let c=0;c<e.$_terms.patterns.length;++c){const d=e.$_terms.patterns[c];if(d.regex){const e=d.regex.test(a);if(o.mainstay.tracer.debug(o,"rule","pattern."+c,e?"pass":"error"),!e)continue}else if(!d.schema.$_match(a,o.nest(d.schema,"pattern."+c),i))continue;n.delete(a);const f=o.localize(p,l,{schema:d.rule,key:a}),h=d.rule.$_validate(u,f,i);if(h.errors){if(i.abortEarly)return{value:t,errors:h.errors};r.push(...h.errors)}if(d.matches&&s[c].push(a),t[a]=h.value,!d.fallthrough)break}}if(a)for(let n=0;n<s.length;++n){const a=s[n];if(!a)continue;const u=e.$_terms.patterns[n].matches,c=o.localize(o.path,l,u),d=u.$_validate(a,c,i);if(d.errors){const n=p.details(d.errors,{override:!1});n.matches=a;const s=e.$_createError("object.pattern.match",t,n,o,i);if(i.abortEarly)return{value:t,errors:s};r.push(s)}}}if(!n.size||!e.$_terms.keys&&!e.$_terms.patterns)return;if(i.stripUnknown&&!e._flags.unknown||i.skipFunctions){const e=!!i.stripUnknown&&(!0===i.stripUnknown||!!i.stripUnknown.objects);for(const r of n)e?(delete t[r],n.delete(r)):"function"==typeof t[r]&&n.delete(r)}if(!l.default(e._flags.unknown,i.allowUnknown))for(const a of n){const n=o.localize([...o.path,a],[]),s=e.$_createError("object.unknown",t[a],{child:a},n,i,{flags:!1});if(i.abortEarly)return{value:t,errors:s};r.push(s)}},f.Dependency=class{constructor(e,t,n,r){this.rel=e,this.key=t,this.peers=n,this.paths=r}describe(){const e={rel:this.rel,peers:this.paths};return null!==this.key&&(e.key=this.key.key),"."!==this.peers[0].separator&&(e.options={separator:this.peers[0].separator}),e}},f.Keys=class extends Array{concat(e){const t=this.slice(),n=new Map;for(let e=0;e<t.length;++e)n.set(t[e].key,e);for(const r of e){const e=r.key,o=n.get(e);void 0!==o?t[o]={key:e,schema:t[o].schema.concat(r.schema)}:t.push(r)}return t}}},function(e,t,n){"use strict";const r=n(30),o=n(697),i={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:r.URL||URL};t.analyze=function(e,t={}){if(!e)return o.code("DOMAIN_NON_EMPTY_STRING");if("string"!=typeof e)throw new Error("Invalid input: domain must be a string");if(e.length>256)return o.code("DOMAIN_TOO_LONG");if(!!i.nonAsciiRx.test(e)){if(!1===t.allowUnicode)return o.code("DOMAIN_INVALID_UNICODE_CHARS");e=e.normalize("NFC")}if(i.domainControlRx.test(e))return o.code("DOMAIN_INVALID_CHARS");e=i.punycode(e),t.allowFullyQualified&&"."===e[e.length-1]&&(e=e.slice(0,-1));const n=t.minDomainSegments||i.minDomainSegments,r=e.split(".");if(r.length<n)return o.code("DOMAIN_SEGMENTS_COUNT");if(t.maxDomainSegments&&r.length>t.maxDomainSegments)return o.code("DOMAIN_SEGMENTS_COUNT_MAX");const a=t.tlds;if(a){const e=r[r.length-1].toLowerCase();if(a.deny&&a.deny.has(e)||a.allow&&!a.allow.has(e))return o.code("DOMAIN_FORBIDDEN_TLDS")}for(let e=0;e<r.length;++e){const t=r[e];if(!t.length)return o.code("DOMAIN_EMPTY_SEGMENT");if(t.length>63)return o.code("DOMAIN_LONG_SEGMENT");if(e<r.length-1){if(!i.domainSegmentRx.test(t))return o.code("DOMAIN_INVALID_CHARS")}else if(!i.tldSegmentRx.test(t))return o.code("DOMAIN_INVALID_TLDS_CHARS")}return null},t.isValid=function(e,n){return!t.analyze(e,n)},i.punycode=function(e){e.includes("%")&&(e=e.replace(/%/g,"%25"));try{return new i.URL("http://"+e).host}catch(t){return e}}},function(e,t,n){"use strict";t.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"},t.code=function(e){return{code:e,error:t.codes[e]}}},function(e,t,n){"use strict";const r=n(16),o=n(699),i={generate:function(){const e={},t="!\\$&'\\(\\)\\*\\+,;=",n="\\w-\\.~%\\dA-Fa-f"+t+":@",r="["+n+"]",o="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";e.ipv4address="(?:"+o+"\\.){3}"+o;const i="[\\dA-Fa-f]{1,4}",a="(?:"+i+":"+i+"|"+e.ipv4address+")",s="(?:"+i+":){6}"+a,l="::(?:"+i+":){5}"+a,u="(?:"+i+")?::(?:"+i+":){4}"+a,p="(?:(?:"+i+":){0,1}"+i+")?::(?:"+i+":){3}"+a,c="(?:(?:"+i+":){0,2}"+i+")?::(?:"+i+":){2}"+a,d="(?:(?:"+i+":){0,3}"+i+")?::"+i+":"+a,f="(?:(?:"+i+":){0,4}"+i+")?::"+a;e.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",e.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",e.ipv6address="(?:"+s+"|"+l+"|"+u+"|"+p+"|"+c+"|"+d+"|"+f+"|(?:(?:[\\dA-Fa-f]{1,4}:){0,5}[\\dA-Fa-f]{1,4})?::[\\dA-Fa-f]{1,4}|(?:(?:[\\dA-Fa-f]{1,4}:){0,6}[\\dA-Fa-f]{1,4})?::)",e.ipvFuture="v[\\dA-Fa-f]+\\.[\\w-\\.~"+t+":]+",e.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",e.schemeRegex=new RegExp(e.scheme);const h="[\\w-\\.~%\\dA-Fa-f"+t+":]*",g="(?:"+("\\[(?:"+e.ipv6address+"|"+e.ipvFuture+")\\]")+"|"+e.ipv4address+"|[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=]{1,255})",m="(?:"+h+"@)?"+g+"(?::\\d*)?",y="(?:"+h+"@)?("+g+")(?::\\d*)?",v=r+"*",b=r+"+",_="(?:\\/"+v+")*",T="\\/(?:"+b+_+")?",E=b+_,S="[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=@]+"+_;return e.hierPart="(?:(?:\\/\\/"+m+_+")|"+T+"|"+E+"|(?:\\/\\/\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*))",e.hierPartCapture="(?:(?:\\/\\/"+y+_+")|"+T+"|"+E+")",e.relativeRef="(?:(?:\\/\\/"+m+_+")|"+T+"|"+S+"|)",e.relativeRefCapture="(?:(?:\\/\\/"+y+_+")|"+T+"|"+S+"|)",e.query="["+n+"\\/\\?]*(?=#|$)",e.queryWithSquareBrackets="["+n+"\\[\\]\\/\\?]*(?=#|$)",e.fragment="["+n+"\\/\\?]*",e}};i.rfc3986=i.generate(),t.ip={v4Cidr:i.rfc3986.ipv4Cidr,v6Cidr:i.rfc3986.ipv6Cidr,ipv4:i.rfc3986.ipv4address,ipv6:i.rfc3986.ipv6address,ipvfuture:i.rfc3986.ipvFuture},i.createRegex=function(e){const t=i.rfc3986,n="(?:\\?"+(e.allowQuerySquareBrackets?t.queryWithSquareBrackets:t.query)+")?(?:#"+t.fragment+")?",a=e.domain?t.relativeRefCapture:t.relativeRef;if(e.relativeOnly)return i.wrap(a+n);let s="";if(e.scheme){r(e.scheme instanceof RegExp||"string"==typeof e.scheme||Array.isArray(e.scheme),"scheme must be a RegExp, String, or Array");const n=[].concat(e.scheme);r(n.length>=1,"scheme must have at least 1 scheme specified");const i=[];for(let e=0;e<n.length;++e){const a=n[e];r(a instanceof RegExp||"string"==typeof a,"scheme at position "+e+" must be a RegExp or String"),a instanceof RegExp?i.push(a.source.toString()):(r(t.schemeRegex.test(a),"scheme at position "+e+" must be a valid scheme"),i.push(o(a)))}s=i.join("|")}const l="(?:"+(s?"(?:"+s+")":t.scheme)+":"+(e.domain?t.hierPartCapture:t.hierPart)+")",u=e.allowRelative?"(?:"+l+"|"+a+")":l;return i.wrap(u+n,s)},i.wrap=function(e,t){return{raw:e="(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])"+e,regex:new RegExp(`^${e}$`),scheme:t}},i.uriRegex=i.createRegex({}),t.regex=function(e={}){return e.scheme||e.allowRelative||e.relativeOnly||e.allowQuerySquareBrackets||e.domain?i.createRegex(e):i.uriRegex}},function(e,t,n){"use strict";e.exports=function(e){return e.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},function(e,t,n){const r=n(9),o=n(17),i=n(1358),a=n(1359),s=n(1368),l=n(1375);e.exports=i(e=>{const t=r.join(e,"db");o.existsSync(t)||o.mkdirSync(t,{recursive:!0});return{account:new a(t),certificate:new s(t),httpChallenge:new l(t)}})},function(e,t,n){const r=n(498),o=n(1363);e.exports=e=>{const t=r.socket("req");return t.connect(e),o.create(t)}},function(e,t){t.endsWithCallback=function(e){return e&&e.length>0&&"function"==typeof e[e.length-1]},t.execCursor=function(e,t,n){const{sort:r,skip:o,limit:i,projection:a,findArgs:s}=e;t.find(...s).sort(r).skip(o).limit(i).projection(a).exec(n)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8),o=n(20),i=n(59),a=n(704),s=n(352);t.publicKeyValidator={name:"PublicKeyInfo",class:a.Class.UNIVERSAL,tag:a.Tag.SEQUENCE,capture:"publicKeyInfo",value:[{name:"PublicKeyInfo.AlgorithmIdentifier",class:a.Class.UNIVERSAL,tag:a.Tag.SEQUENCE,value:[{name:"PublicKeyAlgorithmIdentifier.algorithm",class:a.Class.UNIVERSAL,tag:a.Tag.OID,capture:"publicKeyOID"}]},{name:"PublicKeyInfo.PublicKey",class:a.Class.UNIVERSAL,tag:a.Tag.BITSTRING,capture:"publicKey"}]},t.privateKeyValidator={name:"PrivateKeyInfo",class:a.Class.UNIVERSAL,tag:a.Tag.SEQUENCE,capture:"privateKeyInfo",value:[{name:"PrivateKeyInfo.Version",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.AlgorithmIdentifier",class:a.Class.UNIVERSAL,tag:a.Tag.SEQUENCE,value:[{name:"PrivateKeyAlgorithmIdentifier.algorithm",class:a.Class.UNIVERSAL,tag:a.Tag.OID,capture:"privateKeyOID"}]},{name:"PrivateKeyInfo.PrivateKey",class:a.Class.UNIVERSAL,tag:a.Tag.OCTETSTRING,capture:"privateKey"}]};const l={name:"RSAPublicKey",class:a.Class.UNIVERSAL,tag:a.Tag.SEQUENCE,value:[{name:"RSAPublicKey.modulus",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"publicKeyExponent"}]},u={name:"RSAPrivateKey",class:a.Class.UNIVERSAL,tag:a.Tag.SEQUENCE,value:[{name:"RSAPrivateKey.version",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyCoefficient"}]},p=[s.getOID("X25519"),s.getOID("X448"),s.getOID("Ed25519"),s.getOID("Ed448")];class c{constructor(e){const n={},r=e.validate(t.publicKeyValidator,n);if(null!=r)throw new Error("Cannot read X.509 public key: "+r.message);this.oid=a.ASN1.parseOID(n.publicKeyOID.bytes),this.algo=s.getOIDName(this.oid),this._pkcs8=e,this._keyRaw=a.ASN1.parseBitString(n.publicKey.bytes).buf,this._finalKey=this._keyRaw,this._finalPEM=""}static fromPEM(e){const t=a.PEM.parse(e)[0];if(t.procType.includes("ENCRYPTED"))throw new Error("Could not convert public key from PEM, PEM is encrypted.");const n=a.ASN1.fromDER(t.body,!0);switch(t.type){case"PUBLIC KEY":return new c(n);case"RSA PUBLIC KEY":const e=a.ASN1.Seq([a.ASN1.Seq([a.ASN1.OID(s.getOID("rsaEncryption")),a.ASN1.Null()]),a.ASN1.BitString(n.DER)]);return new c(e);default:throw new Error("Could not convert public key from PEM, recommend PKCS#8 PEM")}}static addVerifier(e,t){if(""===(e=s.getOID(e)))throw new Error("Invalid object identifier: "+e);if(null!=c._verifiers[e])throw new Error(`Verifier ${e} exists`);c._verifiers[e]=t}get keyRaw(){return this._finalKey}verify(e,t,n){const r=c._verifiers[this.oid];if(null!=r){const i=o.createHash(n).update(e).digest();return r.call(this,i,t)}const i=o.createVerify(n);return i.update(e),i.verify(this.toPEM(),t)}getFingerprint(e,t="PublicKey"){let n;switch(t){case"PublicKeyInfo":n=this._pkcs8.DER;break;case"PublicKey":n=this._keyRaw;break;default:throw new Error(`Unknown fingerprint type "${t}".`)}const r=o.createHash(e);return r.update(n),r.digest()}toASN1(){return this._pkcs8}toDER(){return this._pkcs8.DER}toPEM(){return""===this._finalPEM&&(this._finalPEM=new a.PEM("PUBLIC KEY",this._pkcs8.DER).toString()),this._finalPEM}toJSON(){return{oid:this.oid,algo:this.algo,publicKey:this._keyRaw}}[r.inspect.custom](e,t){return`<${this.constructor.name} ${r.inspect(this.toJSON(),t)}>`}}c._verifiers=Object.create(null),t.PublicKey=c;class d{constructor(e){const n=Object.create(null),r=e.validate(t.privateKeyValidator,n);if(null!=r)throw new Error("Cannot read X.509 private key: "+r.message);if(this.version=a.ASN1.parseIntegerNum(n.privateKeyVersion.bytes)+1,this.oid=a.ASN1.parseOID(n.privateKeyOID.bytes),this.algo=s.getOIDName(this.oid),this._pkcs8=e,this._keyRaw=n.privateKey.bytes,this._publicKeyRaw=null,this._finalKey=this._keyRaw,this._finalPEM="",p.includes(this.oid))if(this._finalKey=this._keyRaw=a.ASN1.parseDER(this._keyRaw,a.Class.UNIVERSAL,a.Tag.OCTETSTRING).bytes,"1.3.101.112"===this.oid){const e=i.sign.keyPair.fromSeed(this._keyRaw);this._publicKeyRaw=Buffer.from(e.publicKey),this._finalKey=Buffer.from(e.secretKey)}else if(2===this.version)for(const t of e.mustCompound())t.class===a.Class.CONTEXT_SPECIFIC&&1===t.tag&&(this._publicKeyRaw=a.ASN1.parseBitString(t.bytes).buf,this._finalKey=Buffer.concat([this._keyRaw,this._publicKeyRaw]))}static fromPEM(e){const t=a.PEM.parse(e)[0];if(t.procType.includes("ENCRYPTED"))throw new Error("Could not convert private key from PEM, PEM is encrypted.");let n=a.ASN1.fromDER(t.body,!0);switch(t.type){case"PRIVATE KEY":return new d(n);case"RSA PRIVATE KEY":return n=a.ASN1.Seq([n.value[0],a.ASN1.Seq([a.ASN1.OID(s.getOID("rsaEncryption")),a.ASN1.Null()]),new a.ASN1(a.Class.UNIVERSAL,a.Tag.OCTETSTRING,n.DER)]),new d(n);default:throw new Error("Could not convert private key from PEM, recommend PKCS#8 PEM")}}static addSigner(e,t){if(""===(e=s.getOID(e)))throw new Error("Invalid object identifier: "+e);if(null!=d._signers[e])throw new Error(`Signer ${e} exists`);d._signers[e]=t}get keyRaw(){return this._finalKey}get publicKeyRaw(){return this._publicKeyRaw}sign(e,t){const n=d._signers[this.oid];if(null!=n){const r=o.createHash(t).update(e).digest();return n.call(this,r)}const r=o.createSign(t);return r.update(e),r.sign(this.toPEM())}toASN1(){return this._pkcs8}toDER(){return this._pkcs8.DER}toPEM(){return""===this._finalPEM&&(this._finalPEM=new a.PEM("PRIVATE KEY",this._pkcs8.DER).toString()),this._finalPEM}toJSON(){return{version:this.version,oid:this.oid,algo:this.algo,privateKey:this._keyRaw,publicKey:this._publicKeyRaw}}[r.inspect.custom](e,t){return`<${this.constructor.name} ${r.inspect(this.toJSON(),t)}>`}}d._signers=Object.create(null),t.PrivateKey=d;class f extends c{static fromPublicKey(e){return new f(e.toASN1())}constructor(e){if(super(e),s.getOID(this.oid)!==s.getOID("rsaEncryption"))throw new Error("Invalid RSA public key, unknown OID: "+this.oid);const t=Object.create(null);this._pkcs1=a.ASN1.fromDER(this._keyRaw,!0);const n=this._pkcs1.validate(l,t);if(null!=n)throw new Error("Cannot read RSA public key: "+n.message);this.modulus=a.ASN1.parseIntegerStr(t.publicKeyModulus.bytes),this.exponent=a.ASN1.parseIntegerNum(t.publicKeyExponent.bytes)}toASN1(){return this._pkcs1}toDER(){return this._keyRaw}toPEM(){return""===this._finalPEM&&(this._finalPEM=new a.PEM("RSA PUBLIC KEY",this._keyRaw).toString()),this._finalPEM}toPublicKeyPEM(){return new a.PEM("PUBLIC KEY",this._pkcs8.DER).toString()}toJSON(){return{oid:this.oid,algo:this.algo,modulus:g(this.modulus),exponent:this.exponent}}[r.inspect.custom](e,t){return`<${this.constructor.name} ${r.inspect(this.toJSON(),t)}>`}}t.RSAPublicKey=f;class h extends d{static fromPrivateKey(e){return new h(e.toASN1())}constructor(e){if(super(e),s.getOID(this.oid)!==s.getOID("rsaEncryption"))throw new Error("Invalid RSA private key, unknown OID: "+this.oid);const t=Object.create(null);this._pkcs1=a.ASN1.fromDER(this._keyRaw,!0);const n=this._pkcs1.validate(u,t);if(null!=n)throw new Error("Cannot read RSA private key: "+n.message);this.publicExponent=a.ASN1.parseIntegerNum(t.privateKeyPublicExponent.bytes),this.privateExponent=a.ASN1.parseIntegerStr(t.privateKeyPrivateExponent.bytes),this.modulus=a.ASN1.parseIntegerStr(t.privateKeyModulus.bytes),this.prime1=a.ASN1.parseIntegerStr(t.privateKeyPrime1.bytes),this.prime2=a.ASN1.parseIntegerStr(t.privateKeyPrime2.bytes),this.exponent1=a.ASN1.parseIntegerStr(t.privateKeyExponent1.bytes),this.exponent2=a.ASN1.parseIntegerStr(t.privateKeyExponent2.bytes),this.coefficient=a.ASN1.parseIntegerStr(t.privateKeyCoefficient.bytes)}toASN1(){return this._pkcs1}toDER(){return this._keyRaw}toPEM(){return""===this._finalPEM&&(this._finalPEM=new a.PEM("RSA PRIVATE KEY",this._keyRaw).toString()),this._finalPEM}toPrivateKeyPEM(){return new a.PEM("PRIVATE KEY",this._pkcs8.DER).toString()}toJSON(){return{version:this.version,oid:this.oid,algo:this.algo,publicExponent:this.publicExponent,privateExponent:g(this.privateExponent),modulus:g(this.modulus),prime1:g(this.prime1),prime2:g(this.prime2),exponent1:g(this.exponent1),exponent2:g(this.exponent2),coefficient:g(this.coefficient)}}[r.inspect.custom](e,t){return`<${this.constructor.name} ${r.inspect(this.toJSON(),t)}>`}}function g(e){return e.length%8!=0&&e.startsWith("00")?e.slice(2):e}t.RSAPrivateKey=h,c.addVerifier(s.getOID("Ed25519"),(function(e,t){return i.sign.detached.verify(e,t,this.keyRaw)})),d.addSigner(s.getOID("Ed25519"),(function(e){const t=this.keyRaw;if(64!==t.length)throw new Error("Invalid signing key.");return Buffer.from(i.sign.detached(e,t))}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(705);t.BufferVisitor=r.BufferVisitor;var o=n(1372);t.PEM=o.PEM;var i=n(1373);t.ASN1=i.ASN1,t.Class=i.Class,t.Tag=i.Tag,t.BitString=i.BitString},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.BufferVisitor=class{constructor(e,t=0,n=0){this.start=t,this.end=n>t?n:t,this.buf=e}get length(){return this.buf.length}reset(e=0,t=0){return this.start=e,t>=this.start?this.end=t:this.end<this.start&&(this.end=this.start),this}walk(e){return this.start=this.end,this.end+=e,this}mustHas(e,t="Too few bytes to parse."){const n=this.end+e;if(n>this.buf.length){const e=new Error(t);throw e.available=this.buf.length,e.requested=n,e}return this.walk(0),this}mustWalk(e,t){return this.mustHas(e,t),this.walk(e),this}}},function(e,t,n){const r=n(8),o=n(353),i=n(1381),a=n(10)(n(236).name+":datastore"),s=n(707),l=n(150),u=n(1383),p=n(708),c=n(1389),d=n(1390),f=n(1402);function h(e){let t;"string"==typeof e?(t=e,this.inMemoryOnly=!1):(t=(e=e||{}).filename,this.inMemoryOnly=e.inMemoryOnly||!1,this.autoload=e.autoload||!1,this.timestampData=e.timestampData||!1),t&&"string"==typeof t&&0!==t.length?this.filename=t:(this.filename=null,this.inMemoryOnly=!0),this.compareStrings=e.compareStrings,this.persistence=new d({db:this,nodeWebkitAppName:e.nodeWebkitAppName,afterSerialization:e.afterSerialization,beforeDeserialization:e.beforeDeserialization,corruptAlertThreshold:e.corruptAlertThreshold}),this.executor=new u,this.inMemoryOnly&&(this.executor.ready=!0),this.indexes={},this.indexes._id=new c({fieldName:"_id",unique:!0}),this.ttlIndexes={},this.autoload&&this.loadDatabase(e.onload||(e=>{if(e)throw e}))}r.inherits(h,n(24).EventEmitter),h.prototype.loadDatabase=function(){this.executor.push({this:this.persistence,fn:this.persistence.loadDatabase,arguments:arguments},!0)},h.prototype.closeDatabase=function(){this.executor.push({this:this.persistence,fn:this.persistence.closeDatabase,arguments:arguments},!0,!0)},h.prototype.getAllData=function(){return this.indexes._id.getAll()},h.prototype.forEach=function(e){return this.indexes._id.forEach(e)},h.prototype.resetIndexes=function(e){for(const t in this.indexes)this.indexes[t].reset(e)},h.prototype.ensureIndex=function(e,t){if(3===arguments.length){const n=Array.prototype.slice.call(arguments,0);t=n[2],e=n[1];const r=n[0];for(const t in r)e.fieldName=t}let n;const r=t||function(){};if(!(e=e||{}).fieldName)return n=new Error("Cannot create an index without a fieldName"),n.missingFieldName=!0,r(n);if(this.indexes[e.fieldName])return r(null);this.indexes[e.fieldName]=e.hash?new c(e):new p(e),void 0!==e.expireAfterSeconds&&(this.ttlIndexes[e.fieldName]=e.expireAfterSeconds);try{this.indexes[e.fieldName].insertMultipleDocs(this.getAllData())}catch(t){return delete this.indexes[e.fieldName],r(t)}this.persistence.persistNewState([{$$indexCreated:e}],e=>r(e||null))},h.prototype.removeIndex=function(e,t){const n=t||function(){};delete this.indexes[e],this.persistence.persistNewState([{$$indexRemoved:e}],e=>n(e||null))},h.prototype.addToIndexes=function(e){let t,n,r;const o=Object.keys(this.indexes);for(t=0;t<o.length;t++)try{this.indexes[o[t]].insert(e)}catch(e){n=t,r=e;break}if(r){for(t=0;t<n;t++)this.indexes[o[t]].remove(e);throw r}},h.prototype.removeFromIndexes=function(e){const t=this;Object.keys(this.indexes).forEach(n=>{t.indexes[n].remove(e)})},h.prototype.updateIndexes=function(e,t){let n,r,o;const i=Object.keys(this.indexes),a=Array.isArray(e);for(n=0;n<i.length;n++){const s=this.indexes[i[n]];try{a?s.updateMultipleDocs(e):s.update(e,t)}catch(e){r=n,o=e;break}}if(o){for(n=0;n<r;n++)this.indexes[i[n]].revertUpdate(e,t);throw o}},h.prototype.getIndex=function(e){for(const t in e){const n=e[t];if("string"==typeof n||"number"==typeof n||"boolean"==typeof n||n instanceof Date||null===n){const r=this.indexes[t];if(r)return delete e[t],r.getMatching(n)}}for(const t in e){const n=e[t];if(n&&n.hasOwnProperty("$in")){const r=this.indexes[t];if(r)return delete e[t],r.getMatching(n.$in)}}for(const t in e){const n=e[t];if(n&&(n.hasOwnProperty("$lt")||n.hasOwnProperty("$lte")||n.hasOwnProperty("$gt")||n.hasOwnProperty("$gte"))){const r=this.indexes[t];if(r)return delete e[t],r.getBetweenBounds(n)}}return this.indexes._id},h.prototype.getCandidates=function(e,t,n){if("function"==typeof t&&(n=t,t=!1),e.$and){const t={},n=e.$and;for(const e of n){const n=Object.keys(e)[0];t[n]=e[n]}e=t}let r;try{r=this.getIndex(e)}catch(e){return n(e)}if(t)return n(null,r);const o=[],a=[];for(const e of r){let t=!0;for(const n in this.ttlIndexes){const r=e[n];void 0!==r&&r instanceof Date&&Date.now()>r.getTime()+1e3*this.ttlIndexes[n]&&(t=!1)}t?a.push(e):o.push(e._id)}i(o,(e,t)=>{this._remove({_id:e},{},e=>e?n(e):t())},e=>n(null,a))},h.prototype._insert=function(e,t){const n=t||function(){};let o;try{o=this.prepareDocumentForInsertion(e),this._insertInCache(o)}catch(e){return n(e)}this.persistence.persistNewState(r.isArray(o)?o:[o],e=>e?n(e):n(null,l.deepCopy(o)))},h.prototype.createNewId=function(){let e;const t=this.indexes._id;do{e=s.uid(16)}while(t.getMatchingSingle(e).length);return e},h.prototype.prepareDocumentForInsertion=function(e){let t;if(Array.isArray(e)){t=[];for(const n of e)t.push(this.prepareDocumentForInsertion(n))}else{if(t=l.deepCopy(e),void 0===t._id&&(t._id=this.createNewId()),this.timestampData){const e=new Date;void 0===t.createdAt&&(t.createdAt=e),void 0===t.updatedAt&&(t.updatedAt=e)}l.checkObject(t)}return t},h.prototype._insertInCache=function(e){r.isArray(e)?this._insertMultipleDocsInCache(e):this.addToIndexes(e)},h.prototype._insertMultipleDocsInCache=function(e){let t,n,r;for(t=0;t<e.length;t++)try{this.addToIndexes(e[t])}catch(e){r=e,n=t;break}if(r){for(t=0;t<n;t++)this.removeFromIndexes(e[t]);throw r}},h.prototype.insert=function(e,t,n){a("insert",arguments),s.convertObjectIdToString(e);const r=s.isMongoose()?[e,n||t]:[e,t];this.executor.push({this:this,fn:this._insert,arguments:r})},h.prototype.count=function(e,t,n){a("count",arguments),3===arguments.length&&(t=n),"function"==typeof e&&(t=e,e={});const r=new f(this,e,(e,t,n)=>e?n(e):n(null,t.length));if("function"!=typeof t)return r;r.exec(t)},h.prototype.find=function(e,t,n){switch(a("find",arguments),arguments.length){case 1:t={};break;case 2:"function"==typeof t&&(n=t,t={})}const r=new f(this,e,(function(e,t,r){const o=[];let i;if(e)return r(e);for(i=0;i<t.length;i++)o.push(l.deepCopy(t[i]));return s.isMongoose()&&"function"==typeof n?(this.res=o,r(null,this)):r(null,o)}));if(s.adaptToMongoose(r,t),"function"!=typeof n)return r;r.exec(n)},h.prototype.findOne=function(e,t,n){switch(a("findOne",arguments),arguments.length){case 1:t={};break;case 2:"function"==typeof t&&(n=t,t={})}const r=new f(this,e,(e,t,n)=>e?n(e):1===t.length?n(null,l.deepCopy(t[0])):n(null,null));if(s.adaptToMongoose(r,t),r.limit(1),"function"!=typeof n)return r;r.exec(n)},h.prototype._update=function(e,t,n,r){let i;s.convertObjectIdToString(e),s.convertObjectIdToString(t),a("_update",{query:e,updateQuery:t,options:n});const u=this;let p,c,d=0;"function"==typeof n&&(r=n,n={}),n||(n={}),i=r||function(){},p=void 0!==n.multi&&n.multi,c=void 0!==n.upsert&&n.upsert,o([function(n){if(!c)return delete t.$setOnInsert,n();const r=Object.assign({},e);new f(u,r).limit(1)._exec((e,o)=>{if(e)return i(e);if(1===o.length)return n();let a;try{l.checkObject(t),a=t}catch(n){try{const e=Object.assign(r,t.$setOnInsert||{});t.$setOnInsert&&delete t.$setOnInsert,a=l.modify(l.deepCopyStrictKeys(e),t)}catch(e){return i(e)}}return u._insert(a,(e,t)=>e?i(e):i(null,1,t,!0))})},function(){let r;const o=[];let a,s=[];u.getCandidates(e,(c,f)=>{if(c)return i(c);try{const n=l.prepare(e);for(const e of f)n(e)&&(p||0===d)&&(d+=1,u.timestampData&&(a=e.createdAt),r=l.modify(e,t),u.timestampData&&(r.createdAt=a,r.updatedAt=new Date),o.push({oldDoc:e,newDoc:r}),s.push(r))}catch(c){return i(c)}try{u.updateIndexes(o)}catch(c){return i(c)}u.persistence.persistNewState(s,e=>{if(e)return i(e);if(!n.returnUpdatedDocs)return i(null,d);for(let e=0;e<s.length;e++)s[e]=l.deepCopy(s[e]);return p||(s=s[0]),i(null,d,s)})})}])},h.prototype.update=function(){a("update",arguments),this.executor.push({this:this,fn:this._update,arguments:arguments})},h.prototype._remove=function(e,t,n){let r;a("_remove",arguments);const o=this;let i=0;const s=[];let u;"function"==typeof t&&(n=t,t={}),r=n||function(){},u=void 0!==t.multi&&t.multi,this.getCandidates(e,!0,(t,n)=>{if(t)return r(t);try{const t=l.prepare(e);for(const e of n)t(e)&&(u||0===i)&&(i+=1,s.push({$$deleted:!0,_id:e._id}),o.removeFromIndexes(e))}catch(t){return r(t)}o.persistence.persistNewState(s,e=>e?r(e):r(null,i))})},h.prototype.remove=function(){a("remove",arguments),this.executor.push({this:this,fn:this._remove,arguments:arguments})},e.exports=h},function(e,t,n){const r=n(20),o=n(10)(n(236).name+":cursor");function i(){return!!global.MONGOOSE_DRIVER_PATH}function a(e){return"object"==typeof e&&e.constructor&&"ObjectID"===e.constructor.name}e.exports.uid=function(e){return r.randomBytes(Math.ceil(Math.max(8,2*e))).toString("base64").replace(/[+\/]/g,"").slice(0,e)},e.exports.isMongoose=i,e.exports.isMongoId=a,e.exports.adaptToMongoose=function(e,t){if(!t)return e;const n=Object.keys(t).every(e=>["limit","skip","sort","fields"].includes(e));if(i()&&n){if(t.fields){Object.values(t.fields).every(e=>"object"!=typeof e)?e.projection(t.fields):(o("merge projection into query",{query:e.query,fields:t.fields}),e.query=Object.assign({},e.query,t.fields))}t.sort&&"object"==typeof t.sort&&e.sort(t.sort),"number"==typeof t.skip&&e.skip(t.skip),"number"==typeof t.limit&&e.limit(t.limit)}else e.projection(t);return e},e.exports.convertObjectIdToString=function e(t){if(!i())return;if(!t)return;if("object"!=typeof t)return;const n=t=>{if(Array.isArray(t))return void t.forEach((n,r)=>{n&&(a(n)?t[r]=n.toString():"object"==typeof n&&e(n))});Object.keys(t).forEach(n=>{t[n]&&(a(t[n])?t[n]=t[n].toString():e(t[n]))})};"function"==typeof t.toObject&&"object"==typeof t._doc?n(t._doc):n(t)}},function(e,t,n){const r=n(1387).AVLTree,o=n(8),i=n(150);function a(e,t){return e===t}function s(e){return null===e?"$n":"string"==typeof e?"$s"+e:"boolean"==typeof e?"$b"+e:"number"==typeof e?e:o.isArray(e)?"$d"+e.getTime():e}function l(e){this.fieldName=e.fieldName,this.unique=e.unique||!1,this.sparse=e.sparse||!1,this.treeOptions={unique:this.unique,vkUnique:!0,compareKeys:i.compareThings,checkValueEquality:a},this._extractKey=i.getDotFn(this.fieldName),this.keyFn="strict"===this.unique?s:e=>e,this.reset()}l.prototype.reset=function(e){this.tree=new r(this.treeOptions),e&&(Array.isArray(e)?this.insertMultipleDocs(e):this.insert(e))},l.prototype.insert=function(e){const t=this._extractKey(e);if(void 0===t&&this.sparse)return;if(!Array.isArray(t))return void this.tree.insert(this.keyFn(t),e);let n,r;for(let o=0;o<t.length;o++)try{this.tree.insert(this.keyFn(t[o]),e)}catch(e){r=e,n=o;break}if(r){for(let r=0;r<n;r++)this.tree.delete(this.keyFn(t[r]),e);throw r}},l.prototype.insertMultipleDocs=function(e){let t,n,r;for(t=0;t<e.length;t++)try{this.insert(e[t])}catch(e){n=e,r=t;break}if(n){for(t=0;t<r;t++)this.remove(e[t]);throw n}},l.prototype.remove=function(e){const t=this;if(Array.isArray(e))return void e.forEach(e=>{t.remove(e)});const n=this.keyFn(this._extractKey(e));if(void 0!==n||!this.sparse)if(Array.isArray(n))for(const t of n)this.tree.delete(t,e);else this.tree.delete(n,e)},l.prototype.update=function(e,t){this.remove(e);try{this.insert(t)}catch(t){throw this.insert(e),t}},l.prototype.updateMultipleDocs=function(e){let t,n,r;for(t=0;t<e.length;t++)this.remove(e[t].oldDoc);for(t=0;t<e.length;t++)try{this.insert(e[t].newDoc)}catch(e){r=e,n=t;break}if(r){for(t=0;t<n;t++)this.remove(e[t].newDoc);for(t=0;t<e.length;t++)this.insert(e[t].oldDoc);throw r}},l.prototype.revertUpdate=function(e,t){const n=[];o.isArray(e)?(e.forEach(e=>{n.push({oldDoc:e.newDoc,newDoc:e.oldDoc})}),this.updateMultipleDocs(n)):this.update(t,e)},l.prototype.getMatchingSingle=function(e){return this.tree.search(this.keyFn(e))},l.prototype.getMatching=function(e){if(!Array.isArray(e))return this.getMatchingSingle(e);const t={};for(const n of e)for(const e of this.getMatchingSingle(n))t[e._id]=e;return Object.values(t)},l.prototype.getBetweenBounds=function(e){const t=this.tree.betweenBounds(e);return delete e.$lt,delete e.$lte,delete e.$gt,delete e.$gte,t},l.prototype.getAll=function(){const e=[];return this.tree.executeOnEveryNode(t=>{const n=t.data;for(let t=0;t<n.length;t++)e.push(n[t])}),e},l.prototype.forEach=function(e){this.tree.executeOnEveryNode(t=>{const n=t.data;for(let t=0;t<n.length;t++)e(n[t])})},e.exports=l},function(e,t,n){const r=n(710);function o(e){e=e||{},this.left=null,this.right=null,this.parent=void 0!==e.parent?e.parent:null,e.hasOwnProperty("key")&&(this.key=e.key),this.data=r.isDef(e.value)?[e.value]:[],this.unique=e.unique||!1,this.vkUnique=e.vkUnique||!1,this.compareKeys=e.compareKeys||r.defaultCompareKeysFunction,this.checkValueEquality=e.checkValueEquality||r.defaultCheckValueEquality}o.prototype.getMaxKeyDescendant=function(){return this.right?this.right.getMaxKeyDescendant():this},o.prototype.getMaxKey=function(){return this.getMaxKeyDescendant().key},o.prototype.getMinKeyDescendant=function(){return this.left?this.left.getMinKeyDescendant():this},o.prototype.getMinKey=function(){return this.getMinKeyDescendant().key},o.prototype.checkAllNodesFullfillCondition=function(e){this.hasOwnProperty("key")&&(e(this.key,this.data),this.left&&this.left.checkAllNodesFullfillCondition(e),this.right&&this.right.checkAllNodesFullfillCondition(e))},o.prototype.checkNodeOrdering=function(){const e=this;this.hasOwnProperty("key")&&(this.left&&(this.left.checkAllNodesFullfillCondition(t=>{if(e.compareKeys(t,e.key)>=0)throw new Error(`Tree with root ${e.key} is not a binary search tree`)}),this.left.checkNodeOrdering()),this.right&&(this.right.checkAllNodesFullfillCondition(t=>{if(e.compareKeys(t,e.key)<=0)throw new Error(`Tree with root ${e.key} is not a binary search tree`)}),this.right.checkNodeOrdering()))},o.prototype.checkInternalPointers=function(){if(this.left){if(this.left.parent!==this)throw new Error("Parent pointer broken for key "+this.key);this.left.checkInternalPointers()}if(this.right){if(this.right.parent!==this)throw new Error("Parent pointer broken for key "+this.key);this.right.checkInternalPointers()}},o.prototype.checkIsBST=function(){if(this.checkNodeOrdering(),this.checkInternalPointers(),this.parent)throw new Error("The root shouldn't have a parent")},o.prototype.getNumberOfKeys=function(){let e;return this.hasOwnProperty("key")?(e=1,this.left&&(e+=this.left.getNumberOfKeys()),this.right&&(e+=this.right.getNumberOfKeys()),e):0},o.prototype.createSimilar=function(e){return(e=e||{}).unique=this.unique,e.compareKeys=this.compareKeys,e.checkValueEquality=this.checkValueEquality,new this.constructor(e)},o.prototype.createLeftChild=function(e){const t=this.createSimilar(e);return t.parent=this,this.left=t,t},o.prototype.createRightChild=function(e){const t=this.createSimilar(e);return t.parent=this,this.right=t,t},o.prototype.insert=function(e,t){if(!this.hasOwnProperty("key"))return this.key=e,void(r.isDef(t)&&this.data.push(t));const n=this.compareKeys(e,this.key);if(0===n){if(this.unique){if(this.data.includes(t))return;const n=new Error(`Can't insert key ${e}, it violates the unique constraint`);throw n.key=e,n.errorType="uniqueViolated",n}if(r.isDef(t)){if(this.vkUnique&&this.data.includes(t))return;this.data.push(t)}return}const o={key:e};r.isDef(t)&&(o.value=t),n<0?this.left?this.left.insert(e,t):this.createLeftChild(o):this.right?this.right.insert(e,t):this.createRightChild(o)},o.prototype.search=function(e){if(!this.hasOwnProperty("key"))return[];const t=this.compareKeys(e,this.key);return 0===t?this.data:t<0?this.left?this.left.search(e):[]:this.right?this.right.search(e):[]},o.prototype.searchAfter=function(e){if(!this.hasOwnProperty("key"))return[];if(0===this.compareKeys(this.key,e)){if(t=this.right){for(;t.left;)t=t.left;return t.data}for(t=this.parent;t;){if(this.compareKeys(e,t.key)<0)return t.data;t=t.parent}return[]}if(this.compareKeys(e,this.key)<0)return this.left?this.left.searchAfter(e):this.data;if(this.right)return this.right.searchAfter(e);for(var t=this.parent;t;){if(this.compareKeys(e,t.key)<0)return t.data;t=t.parent}return[]},o.prototype.searchBefore=function(e){if(!this.hasOwnProperty("key"))return[];if(0===this.compareKeys(this.key,e)){if(t=this.left){for(;t.right;)t=t.right;return t.data}for(t=this.parent;t;){if(this.compareKeys(e,t.key)>0)return t.data;t=t.parent}return[]}if(this.compareKeys(e,this.key)<0){if(this.left)return this.left.searchBefore(e);for(var t=this.parent;t;){if(this.compareKeys(e,t.key)>0)return t.data;t=t.parent}return[]}return this.right?this.right.searchBefore(e):this.data},o.prototype.searchNearestLte=function(e){const t=this._searchNearestLte(e);return t?t.data:null},o.prototype._searchNearestLte=function(e,t){if(!this.hasOwnProperty("key"))return null;let n=null;if(void 0!==t&&(n=t),0===this.compareKeys(e,this.key))return this;if((null==n||Math.abs(this.compareKeys(this.key,e))<Math.abs(this.compareKeys(e,n.key)))&&this.compareKeys(this.key,e)<=0&&(n=this),this.compareKeys(e,this.key)<0&&this.left){const t=this.left._searchNearestLte(e,n);null!=t&&(null==n||Math.abs(this.compareKeys(t.key,e))<Math.abs(this.compareKeys(e,n.key)))&&this.compareKeys(t.key,e)<=0&&(n=t)}if((null==n||this.compareKeys(e,this.key)>=0)&&this.right){const t=this.right._searchNearestLte(e,n);null!=t&&(null==n||Math.abs(this.compareKeys(t.key,e))<Math.abs(this.compareKeys(e,n.key)))&&this.compareKeys(t.key,e)<=0&&(n=t)}return n},o.prototype.searchNearestGte=function(e){const t=this._searchNearestGte(e);return t?t.data:null},o.prototype._searchNearestGte=function(e,t){if(!this.hasOwnProperty("key"))return null;let n=null;if(void 0!==t&&(n=t),0===this.compareKeys(e,this.key))return this;if((null==n||Math.abs(this.compareKeys(this.key,e))<Math.abs(this.compareKeys(e,n.key)))&&this.compareKeys(this.key,e)>=0&&(n=this),this.compareKeys(e,this.key)<0&&this.left){const t=this.left._searchNearestGte(e,n);null!=t&&(null==n||Math.abs(this.compareKeys(t.key,e))<Math.abs(this.compareKeys(e,n.key)))&&this.compareKeys(t.key,e)>=0&&(n=t)}if((null==n||this.compareKeys(e,this.key)>=0)&&this.right){const t=this.right._searchNearestGte(e,n);null!=t&&(null==n||Math.abs(this.compareKeys(t.key,e))<Math.abs(this.compareKeys(e,n.key)))&&this.compareKeys(t.key,e)>=0&&(n=t)}return n},o.prototype.searchNearest=function(e){const t=this._searchNearest(e);return t?t.data:null},o.prototype._searchNearest=function(e,t){if(!this.hasOwnProperty("key"))return null;let n=null;if(void 0!==t&&(n=t),0===this.compareKeys(e,this.key))return this;if((null==n||Math.abs(this.compareKeys(this.key,e))<Math.abs(this.compareKeys(e,n.key)))&&(n=this),this.compareKeys(e,this.key)<0){if(this.left){const t=this.left._searchNearest(e,n);null!=t&&(null==n||Math.abs(this.compareKeys(t.key,e))<Math.abs(this.compareKeys(e,n.key)))&&(n=t)}}else if(this.right){const t=this.right._searchNearest(e,n);null!=t&&(null==n||Math.abs(this.compareKeys(t.key,e))<Math.abs(this.compareKeys(e,n.key)))&&(n=t)}return n},o.prototype.getLowerBoundMatcher=function(e){if(!e.hasOwnProperty("$gt")&&!e.hasOwnProperty("$gte"))return()=>!0;if(e.hasOwnProperty("$gt")&&e.hasOwnProperty("$gte")){if(0===this.compareKeys(e.$gte,e.$gt)){const t=e.$gt;return e=>this.compareKeys(e,t)>0}if(this.compareKeys(e.$gte,e.$gt)>0){const t=e.$gte;return e=>this.compareKeys(e,t)>=0}const t=e.$gt;return e=>this.compareKeys(e,t)>0}if(e.hasOwnProperty("$gt")){const t=e.$gt;return e=>this.compareKeys(e,t)>0}const t=e.$gte;return e=>this.compareKeys(e,t)>=0},o.prototype.getUpperBoundMatcher=function(e){if(!e.hasOwnProperty("$lt")&&!e.hasOwnProperty("$lte"))return()=>!0;if(e.hasOwnProperty("$lt")&&e.hasOwnProperty("$lte")){if(0===this.compareKeys(e.$lte,e.$lt)){const t=e.$lt;return e=>this.compareKeys(e,t)<0}if(this.compareKeys(e.$lte,e.$lt)<0){const t=e.$lte;return e=>this.compareKeys(e,t)<=0}const t=e.$lt;return e=>this.compareKeys(e,t)<0}if(e.hasOwnProperty("$lt")){const t=e.$lt;return e=>this.compareKeys(e,t)<0}const t=e.$lte;return e=>this.compareKeys(e,t)<=0},o.prototype._betweenBounds=function(e,t,n){const r=t(this.key);if(r&&this.left&&this.left._betweenBounds(e,t,n),n(this.key)){if(r)for(const t of this.data)e.push(t);this.right&&this.right._betweenBounds(e,t,n)}},o.prototype.betweenBounds=function(e){if(!this.hasOwnProperty("key"))return[];const t=this.getLowerBoundMatcher(e),n=this.getUpperBoundMatcher(e),r=[];return this._betweenBounds(r,t,n),r},o.prototype.deleteIfLeaf=function(){return!this.left&&!this.right&&(this.parent?(this.parent.left===this?this.parent.left=null:this.parent.right=null,!0):(delete this.key,this.data=[],!0))},o.prototype.deleteIfOnlyOneChild=function(){let e;return this.left&&!this.right&&(e=this.left),!this.left&&this.right&&(e=this.right),!!e&&(this.parent?(this.parent.left===this?(this.parent.left=e,e.parent=this.parent):(this.parent.right=e,e.parent=this.parent),!0):(this.key=e.key,this.data=e.data,this.left=null,e.left&&(this.left=e.left,e.left.parent=this),this.right=null,e.right&&(this.right=e.right,e.right.parent=this),!0))},o.prototype.delete=function(e,t){let n;this.hasOwnProperty("key")&&(this.compareKeys(e,this.key)<0?this.left&&this.left.delete(e,t):this.compareKeys(e,this.key)>0?this.right&&this.right.delete(e,t):0!==!this.compareKeys(e,this.key)&&(this.data.length>1&&r.isDef(t)?this.data=this.data.filter((function(e){return!this.checkValueEquality(e,t)}),this):this.deleteIfLeaf()||this.deleteIfOnlyOneChild()||(Math.random()>=.5?(n=this.left.getMaxKeyDescendant(),this.key=n.key,this.data=n.data,this===n.parent?(this.left=n.left,n.left&&(n.left.parent=n.parent)):(n.parent.right=n.left,n.left&&(n.left.parent=n.parent))):(n=this.right.getMinKeyDescendant(),this.key=n.key,this.data=n.data,this===n.parent?(this.right=n.right,n.right&&(n.right.parent=n.parent)):(n.parent.left=n.right,n.right&&(n.right.parent=n.parent))))))},o.prototype.executeOnEveryNode=function(e){this.left&&this.left.executeOnEveryNode(e),e(this),this.right&&this.right.executeOnEveryNode(e)},o.prototype.prettyPrint=function(e,t){t=t||"",console.log(`${t}* ${this.key}`),e&&console.log(`${t}* ${this.data}`),(this.left||this.right)&&(this.left?this.left.prettyPrint(e,t+" "):console.log(t+" *"),this.right?this.right.prettyPrint(e,t+" "):console.log(t+" *"))},e.exports=o},function(e,t){e.exports.getRandomArray=function e(t){let n,r;return 0===t?[]:1===t?[0]:(n=e(t-1),r=Math.floor(Math.random()*t),n.splice(r,0,t-1),n)},e.exports.defaultCompareKeysFunction=function(e,t){const n=e-t;if(!isNaN(n))return n;const r=new Error(`Can't compare elements of type ${typeof e} and ${typeof t}`);throw r.a=e,r.b=t,r},e.exports.defaultCheckValueEquality=function(e,t){return e===t},e.exports.isDef=function(e){return void 0!==e}},function(e,t,n){!function(){"use strict";var t=n(8),r=n(11).Transform,o=n(161).StringDecoder;function i(e){if(!(this instanceof i))return new i(e);r.call(this,e),this._writableState.objectMode=!1,this._readableState.objectMode=!0,this._buffer="",this._decoder=new o("utf8")}t.inherits(i,r),i.prototype._transform=function(e,t,n){this._buffer+=this._decoder.write(e);var r=this._buffer.split(/\r?\n/);this._buffer=r.pop(),r.forEach(this.push.bind(this)),n()},i.prototype._flush=function(e){var t=this._buffer.trim();t&&this.push(t),e()},e.exports=i}()},function(e,t,n){const{dirname:r}=n(9),o=(e,t,n)=>{t.recursive=!1;const i=r(e);return i===e?t.mkdirAsync(e,t).catch(e=>{if("EISDIR"!==e.code)throw e}):t.mkdirAsync(e,t).then(()=>n||e,r=>{if("ENOENT"===r.code)return o(i,t).then(n=>o(e,t,n));if("EEXIST"!==r.code&&"EROFS"!==r.code)throw r;return t.statAsync(e).then(e=>{if(e.isDirectory())return n;throw r},()=>{throw r})})},i=(e,t,n)=>{const o=r(e);if(t.recursive=!1,o===e)try{return t.mkdirSync(e,t)}catch(e){if("EISDIR"!==e.code)throw e;return}try{return t.mkdirSync(e,t),n||e}catch(r){if("ENOENT"===r.code)return i(e,t,i(o,t,n));if("EEXIST"!==r.code&&"EROFS"!==r.code)throw r;try{if(!t.statSync(e).isDirectory())throw r}catch(e){throw r}}};e.exports={mkdirpManual:o,mkdirpManualSync:i}},function(e,t,n){const r=n(714),o=n(1410),i=n(717),a=n(1437);e.exports={WalletAuthenticator:r,WalletHandlers:i,AgentAuthenticator:o,AgentWalletHandlers:a}},function(e,t,n){const r=n(163),o=n(212),i=n(169),a=n(213),s=n(141),{toBase58:l}=n(21),{fromAddress:u}=n(46),{toAddress:p}=n(35),c=n(715),d=n(10)(n(151).name+":authenticator:wallet"),{DEFAULT_CHAIN_INFO:f}=c,h=n(1406),g=e=>{if(!e)return"";if(e&&e.type&&e.content)return JSON.stringify(o(e,["type","content"]));try{const t=JSON.parse(e);return t&&t.type&&t.content?e:""}catch(e){return""}};e.exports=class extends c{constructor({wallet:e,appInfo:t,timeout:n=8e3,chainInfo:r=f,baseUrl:o="",tokenKey:i="_t_"}){super(),this.wallet=this._validateWallet(e),this.appInfo=this._validateAppInfo(t),this.chainInfo=r,this.baseUrl=o,this.tokenKey=i,this.timeout=n,this.appInfo.link||(this.appInfo.link=this.baseUrl)}async uri({baseUrl:e,pathname:t="",token:n="",query:o={}}={}){const i={...o,[this.tokenKey]:n},a={action:"requestAuth",url:encodeURIComponent(`${this.baseUrl||e}${t}?${r.stringify(i)}`)},s="https://abtwallet.io/i/?"+r.stringify(a);return d("uri",{token:n,pathname:t,uri:s,params:i,payload:a}),s}getPublicUrl(e,t={},n=""){return`${this.baseUrl||n}${e}?${r.stringify(t)}`}async signResponse({response:e={},errorMessage:t="",successMessage:n="",nextWorkflow:r=""},o,i){const a=await this.getWalletInfo({baseUrl:o,request:i}),u=await this.getAppInfo({baseUrl:o,request:i,wallet:a}),p=i.context.wallet,c={appInfo:u,status:t?"error":"ok",errorMessage:t||"",successMessage:n||"",nextWorkflow:r||"",response:e};return{appPk:l(a.pk),authInfo:s.sign(a.address,a.sk,c,!0,p?p.jwt:void 0)}}async sign({context:e,request:t,claims:n,pathname:o="",baseUrl:a="",challenge:u="",extraParams:p={}}){const c=await this.tryWithTimeout(()=>this.genRequestedClaims({claims:n,context:{baseUrl:a,request:t,...e},extraParams:p})),d=c.find(e=>!1===i(this._isValidChainInfo(e.chainInfo),f)),h={baseUrl:a,request:t,...e,...p},g=await this.getWalletInfo(h),m={action:"responseAuth",challenge:u,appInfo:await this.getAppInfo({...h,wallet:g}),chainInfo:await this.getChainInfo(h,d?d.chainInfo:f),requestedClaims:c.map(e=>(delete e.chainInfo,e)),url:`${this.baseUrl||a}${o}?${r.stringify({[this.tokenKey]:e.token})}`},y=e.didwallet?e.didwallet.jwt:void 0;return{appPk:l(g.pk),authInfo:s.sign(g.address,g.sk,m,!0,y)}}async getChainInfo(e,t){if(t)return this._isValidChainInfo(t)?t:f;if("function"==typeof this.chainInfo){const t=await this.tryWithTimeout(()=>this.chainInfo(e));return this._isValidChainInfo(t)?t:f}return this.chainInfo||f}async getAppInfo(e){if("function"==typeof this.appInfo){const t=await this.tryWithTimeout(()=>this.appInfo(e));return t.link||(t.link=e.baseUrl),t.publisher||(t.publisher="did:abt:"+e.wallet.address),this._validateAppInfo(t)}return this.appInfo&&!this.appInfo.publisher&&(this.appInfo.publisher="did:abt:"+e.wallet.address),this.appInfo}async getWalletInfo(e){if("function"==typeof this.wallet){const t=await this.tryWithTimeout(()=>this.wallet(e));if(this._validateWallet(t))return t;throw new Error("Invalid wallet function provided")}return this.wallet}verify(e,t="en",n=!0){return new Promise(async(r,o)=>{try{const{iss:o,challenge:i="",action:a="responseAuth",requestedClaims:s}=await this._verify(e,"userPk","userInfo",t,n);r({token:e.token,userDid:p(o),userPk:e.userPk,claims:s,action:a,challenge:i}),d("verify.context",{userPk:e.userPk,userDid:p(o),action:a,challenge:i}),d("verify.claims",s)}catch(e){o(e)}})}genRequestedClaims({claims:e,context:t,extraParams:n}){return Promise.all(Object.keys(e).map(async r=>{let o=r,i=e[r];if(Array.isArray(e[r])&&([o,i]=e[r]),!h.claims[o])throw new Error("Unsupported claim type "+o);const a="function"==typeof this[o]?o:"getClaimInfo",s=await this[a]({claim:i,context:t,extraParams:n}),{value:l,error:u}=h.claims[o].validate(s);if(u)throw new Error(`Invalid ${o} claim: ${u.message}`);return l}))}async getClaimInfo({claim:e,context:t,extraParams:n}){const{userDid:r,userPk:o,didwallet:i}=t,a="function"==typeof e?await e({userDid:r?p(r):"",userPk:o||"",didwallet:i,extraParams:n,context:t}):e,s={...t,...n},l=await this.getChainInfo(s,a.chainInfo);return a.chainInfo=l,a}async signature({claim:e,context:t,extraParams:n}){const{data:r,type:o="mime:text/plain",digest:i="",method:s="sha3",wallet:p,sender:c,display:f,description:h,chainInfo:m,meta:y={}}=await this.getClaimInfo({claim:e,context:t,extraParams:n});if(d("claim.signature",{data:r,digest:i,type:o,sender:c,context:t}),!r&&!i)throw new Error("Signature claim requires either data or digest to be provided");const v=h||"Sign this transaction to continue.";if(o.endsWith("Tx")){if(!m.host)throw new Error("Invalid chainInfo when trying to encoding transaction");const e=new a(m.host);if("function"!=typeof e["encode"+o])throw new Error("Unsupported transaction type "+o);r.pk||(r.pk=t.userPk);try{const{buffer:n}=await e["encode"+o]({tx:r,wallet:p||u(c||t.userDid)});return{type:"signature",description:v,typeUrl:"fg:t:transaction",origin:l(n),method:s,display:g(f),digest:"",chainInfo:m,meta:y}}catch(e){throw new Error("Failed to encode transaction: "+e.message)}}return"fg:t:transaction"===o?{type:"signature",description:v,typeUrl:"fg:t:transaction",origin:l(r),display:g(f),method:s,digest:"",chainInfo:m,meta:y}:{type:"signature",description:h||"Sign this message to continue.",origin:r?l(r):"",typeUrl:o,display:g(f),method:s,digest:i,chainInfo:m,meta:y}}async prepareTx({claim:e,context:t,extraParams:n}){const{partialTx:r,requirement:o,type:i,display:s,wallet:p,sender:c,description:f,chainInfo:h,meta:m={}}=await this.getClaimInfo({claim:e,context:t,extraParams:n});if(d("claim.prepareTx",{partialTx:r,requirement:o,type:i,sender:c,context:t}),!r||!o)throw new Error("prepareTx claim requires both partialTx and requirement to be provided");const y=f||"Prepare and sign this transaction to continue.",v={tokens:[],assets:{}};if(i&&i.endsWith("Tx")){if(!h.host)throw new Error("Invalid chainInfo when trying to encoding partial transaction");const e=new a(h.host);if("function"!=typeof e["encode"+i])throw new Error(`Unsupported transaction type ${i} when encoding partial transaction`);r.pk||(r.pk=t.userPk);try{const{buffer:n}=await e["encode"+i]({tx:r,wallet:p||u(c||t.userDid)});return{type:"prepareTx",description:y,partialTx:l(n),display:g(s),requirement:Object.assign(v,o),chainInfo:h,meta:m}}catch(e){throw new Error("Failed to encode partial transaction: "+e.message)}}return{type:"prepareTx",description:y,partialTx:l(r),requirement:Object.assign(v,o),display:g(s),chainInfo:h,meta:m}}_validateAppInfo(e){if("function"==typeof e)return e;if(!e)throw new Error("Wallet authenticator can not work with invalid appInfo: empty");const{value:t,error:n}=h.appInfo.validate(e);if(n)throw new Error("Wallet authenticator can not work with invalid appInfo: "+n.message);return t}_isValidChainInfo(e){return e&&e.host}tryWithTimeout(e){if("function"!=typeof e)throw new Error("asyncFn must be a valid function");const t=Number(this.timeout)||8e3;return new Promise(async(n,r)=>{const o=setTimeout(()=>{r(new Error(`Async operation did not complete within ${t} ms`))},t);try{n(await e())}catch(e){r(e)}finally{clearTimeout(o)}})}},e.exports.formatDisplay=g},function(e,t,n){const r=n(141),{isValid:o}=n(46),i=n(10)(n(151).name+":authenticator:base");e.exports=class{_validateWallet(e){if(!e)throw new Error("WalletAuthenticator cannot work without wallet");if("function"==typeof e)return e;if(o(e))return{sk:e.secretKey,pk:e.publicKey,address:e.address};if(!e.sk)throw new Error("WalletAuthenticator cannot work without wallet.sk");if(!e.pk)throw new Error("WalletAuthenticator cannot work without wallet.pk");if(!e.address)throw new Error("WalletAuthenticator cannot work without wallet.address");return e}_verify(e,t,n,o="en",a=!0){return new Promise((s,l)=>{i("verify",e,o);const u={pkMissing:{en:t+" is required to complete auth",zh:t+" 参数缺失"},tokenMissing:{en:n+" is required to complete auth",zh:"JWT Token 参数缺失"},pkFormat:{en:t+" should be either base58 or base16 format",zh:t+" 无法解析"},tokenInvalid:{en:"Invalid JWT token",zh:"签名无效"},timeInvalid:{en:"JWT token expired, make sure your device time in sync with network",zh:"签名中的时间戳无效,请确保设备和网络时间同步"}},p=e[t],c=e[n];if(!p)return l(new Error(u.pkMissing[o]));if(!c)return l(new Error(u.tokenMissing[o]));if(!p)return l(new Error(u.pkFormat[o]));if(!r.verify(c,p)){const e=r.verify(c,p,{tolerance:0,enforceTimestamp:!1});if(a){const t=e?u.timeInvalid[o]:u.tokenInvalid[o];return l(new Error(t))}}return s(r.decode(c))})}},e.exports.DEFAULT_CHAIN_INFO={id:"none",host:"none"}},function(e,t,n){const r=n(233),o=n(1407),i=n(1408),a=r.extend(i).extend(o),s=/^(0x)?([A-Fa-f0-9]{64})$/,l={context:a.object({genesisTime:a.date().iso().required().raw(),genesisTx:a.string().regex(s).required().allow(""),renaissanceTime:a.date().iso().required().raw(),renaissanceTx:a.string().regex(s).required().allow("")}),tokenInput:a.object({address:a.DID().role("ROLE_TOKEN").required(),value:a.BN().positive().required()}),multiSig:a.array().items({signer:a.DID().required(),pk:a.any().required(),signature:a.any().required(),delegator:a.DID().valid("").optional(),data:a.any().optional()}),foreignToken:a.object({type:a.string().min(1).max(32).required(),contractAddress:a.DID().wallet("ethereum").required(),chainType:a.string().min(1).max(32).required(),chainName:a.string().min(1).max(32).required(),chainId:a.number().positive().required()})},u={txHash:s};e.exports=a,e.exports.schemas=l,e.exports.patterns=u},function(e,t,n){const r=n(10)(n(151).name+":handlers:wallet"),o=n(718),i=n(1436),a=()=>{};e.exports=class extends i{constructor({pathTransformer:e,tokenStorage:t,authenticator:n,onConnect:r=a,options:o={}}){super({pathTransformer:e,tokenStorage:t,authenticator:n,onConnect:r}),this.options={prefix:"/api/did",cleanupDelay:6e4,tokenKey:"_t_",encKey:"_ek_",...o}}attach({app:e,action:t,claims:n,onStart:i=a,onConnect:s,onAuth:l,onDecline:u=a,onComplete:p=a,onExpire:c=a,onError:d=console.error,authPrincipal:f=!0}){if("function"!=typeof l)throw new Error("onAuth callback is required to attach did auth handlers");if("function"!=typeof u)throw new Error("onDecline callback is required to attach did auth handlers");if("function"!=typeof p)throw new Error("onComplete callback is required to attach did auth handlers");const{prefix:h}=this.options,g=`${h}/${t}/auth`;r("attach routes",{action:t,prefix:h,pathname:g});const{generateSession:m,expireSession:y,checkSession:v,onAuthRequest:b,onAuthResponse:_,ensureContext:T,ensureSignedJson:E}=o({action:t,pathname:g,claims:n,onStart:i,onConnect:async(...e)=>{if("function"==typeof this.onConnect&&await this.onConnect(...e),"function"==typeof s)return s(...e)},onAuth:l,onDecline:u,onComplete:p,onExpire:c,onError:d,authPrincipal:f,options:this.options,pathTransformer:this.pathTransformer,tokenStorage:this.tokenStorage,authenticator:this.authenticator});e.get(`${h}/${t}/token`,m),e.post(`${h}/${t}/token`,m),e.get(`${h}/${t}/status`,T,v),e.get(`${h}/${t}/timeout`,T,y),e.get(g,T,E,b),e.post(g,T,E,_),e.get(g+"/submit",T,E,_)}}},function(e,t,n){const r=n(30),o=n(27),i=n(317),a=n(481),s=n(1411),l=n(28),u=n(1513),p=n(288),{isValid:c}=n(35),{stripHexPrefix:d,toBase64:f,fromBase64:h}=n(21),g=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,m=/^[a-zA-Z]:\\/,y=(n(10)(n(151).name+":handlers:util"),l.Hasher.SHA3.hash256),v=e=>(e.acceptsLanguages("en-US","zh-CN")||"en-US").split("-").shift(),b=()=>({}),_=e=>e,T={tokenMissing:{en:"Session Id is required to check status",zh:"缺少会话 ID 参数"},didMismatch:{en:"Login user and wallet user mismatch, please relogin and try again",zh:"登录用户和扫码用户不匹配,为保障安全,请重新登录应用"},challengeMismatch:{en:"Challenge mismatch",zh:"随机校验码不匹配"},token404:{en:"Session not found or expired",zh:"会话不存在或已过期"},didMissing:{en:"userDid is required to start auth",zh:"userDid 参数缺失,请勿尝试连接多个不同的钱包"},pkMissing:{en:"userPk is required to start auth",zh:"userPk 参数缺失,请勿尝试连接多个不同的钱包"},authClaim:{en:"authPrincipal claim is not configured correctly",zh:"authPrincipal 声明配置不正确"},userDeclined:{en:"You have declined the authentication request",zh:"授权请求被拒绝"}},E=(e,t)=>{const n=e.replace(/\/retrieve$/,"").replace(/\/auth$/,""),o=r.parse(t.originalUrl).pathname,[i]=o.split(n);return[i,e].join("/").replace(/\/+/g,"/")},S=(e,t)=>{const n=(e=>e.headers["x-path-prefix"]?`/${e.headers["x-path-prefix"]}/`.replace(/\/+/g,"/"):"/")(e).replace(/\/$/,""),[i="",a=80]=(e.get("x-real-hostname")||e.get("host")||"").split(":"),s=o(t,"x-real-port",null)||e.get("X-Real-Port")||a||"";return r.format({protocol:o(t,"x-real-protocol")||e.get("X-Real-protocol")||e.get("X-Forwarded-Proto")||e.protocol,hostname:i,port:80===Number(s)?"":s,pathname:n})},x=()=>d(l.getRandomBytes(16)).toUpperCase(),w=e=>{const t=(e||"").toString().toLowerCase();let n="",r="";t.indexOf("android")>-1?n="android":t.indexOf("darwin")>-1?n="ios":0===t.indexOf("arcwallet")&&(n="web");const o=t.split(/\s+/).find(e=>e.startsWith("arcwallet"));if(o){const e=o.split("/");e.length>1&&s.coerce(e[1])&&(r=s.coerce(e[1]).version)}let i="1.0.0";return("ios"===n&&r&&s.gte(r,"2.7.2")||"android"===n&&r&&s.gte(r,"2.7.16")||"web"===n)&&(i="1.1.0"),{os:n,version:r,jwt:i}},A=e=>e.startsWith("https://abtwallet.io/i/");e.exports=function({action:e,pathname:t,claims:n,onStart:r,onConnect:s,onAuth:l,onDecline:d,onComplete:k,onExpire:M,onError:O,pathTransformer:D,tokenStorage:I,authenticator:R,authPrincipal:N,getSignParams:C=b,getPathName:F=_,options:L}){const{tokenKey:j,encKey:B,cleanupDelay:P}=L,H=(Array.isArray(n)?n:[n]).filter(Boolean);if(H.length>0){const e=Object.keys(H[0]),t=H[0][e[0]];Array.isArray(t)?"authPrincipal"===t[0]&&(N=!1):"authPrincipal"===e[0]&&(N=!1)}if(N){let e,t,n,r="",i="Please select account to continue.";"string"==typeof N&&(c(N)?r=N:i=N),"object"==typeof N&&(r=o(N,"target",r),i=o(N,"description",i),t=o(N,"targetType",t),n=o(N,"declareParams",n),N.chainInfo&&R._isValidChainInfo(N.chainInfo)&&(e=N.chainInfo),R._isValidChainInfo(N)&&(e=N));const a=0===H.length;H.unshift({authPrincipal:{skippable:!0,description:i,target:r,chainInfo:e,targetType:t,declareParams:n,supervised:a}})}const U=H[0]&&H[0].authPrincipal&&H[0].authPrincipal.skippable,$=(t,n,r={})=>{const o={...n,...r||{}};return{locale:t,action:e,...Object.keys(o).filter(e=>!["userDid","userInfo","userSession","appSession","userPk","token"].includes(e)).reduce((e,t)=>(e[t]=o[t],e),{})}},W=(e,t)=>async(n,r,o=!1)=>{const i=(e,n)=>{if(o&&t[B]){const o=u.seal(Buffer.from(p(n)),(r=t[B],new Uint8Array(Buffer.from((e=>(e+"===".slice((e.length+3)%4)).replace(/-/g,"+").replace(/_/g,"/"))(r),"base64"))));return{[e]:Buffer.from(o).toString("base64")}}var r;return{[e]:n}};if("object"==typeof n){o=r;const t=Object.keys(n),a=Object.assign(...t.map(e=>i(e,n[e])));return I.update(e,a)}return I.update(e,i(n,r))},V=({req:e,res:t,stage:n,err:r})=>{const{token:i,store:a}=e.context||{};i&&I.update(i,{status:"error",error:r.message}),t.jsonp({error:r.message}),O({token:i,extraParams:o(a,"extraParams",{}),stage:n,err:r})},Y=(e,t)=>{const n=E(e,t);return D(n)},z=async({context:e,userDid:t,userPk:n})=>{const{locale:r,token:o,store:i}=e;if(i.currentStep>0){if(!t)return T.didMissing[r];if(!n)return T.pkMissing[r];if(t!==i.did)return await I.update(o,{status:"forbidden"}),T.didMismatch[r]}return!1};return{generateSession:async(e,n)=>{try{const i={"x-real-port":e.get("x-real-port"),"x-real-protocol":e.get("x-real-protocol"),connectedDid:o(e,"cookies.connected_did",""),connectedPk:o(e,"cookies.connected_pk",""),...e.body,...e.query,...e.params},a=y(Date.now().toString()).replace(/^0x/,"").slice(0,8);await I.create(a,"created");const s=Y(F(t,e),e),l=S(e,i),u=await R.uri({token:a,pathname:s,baseUrl:l,query:{}}),p=x(),c=await R.getWalletInfo({baseUrl:l,request:e}),d=await R.getAppInfo({baseUrl:l,request:e,wallet:c});await I.update(a,{currentStep:0,challenge:p,extraParams:i,appInfo:d});const f=$(v(e),i),h={req:e,challenge:p,baseUrl:l,deepLink:u,extraParams:f,updateSession:W(a,f),didwallet:w(e.query["user-agent"]||e.headers["user-agent"])},g=await r(h);n.jsonp({token:a,status:"created",url:u,appInfo:d,extra:g||{}})}catch(t){V({req:e,res:n,stage:"generate-token",err:t})}},expireSession:async(e,t)=>{try{const{locale:n,token:r,store:i}=e.context;if(!r)return void t.status(400).json({error:T.tokenMissing[n]});if(!i)return void t.status(400).json({error:T.token404[n]});M({token:r,extraParams:o(i,"extraParams",{}),status:"expired"}),"scanned"!==i.status&&await I.delete(r),t.status(200).json({token:r})}catch(n){V({req:e,res:t,stage:"mark-token-timeout",err:n})}},checkSession:async(e,t)=>{try{const{locale:n,token:r,store:i,params:a}=e.context;if(!r)return void t.status(400).json({error:T.tokenMissing[n]});if(!i)return void t.status(400).json({error:T.token404[n]});if("forbidden"===i.status)return void t.status(403).json({error:T.didMismatch[n]});if("succeed"===i.status){setTimeout(()=>{I.delete(r).catch(console.error)},P);const t=$(n,a,o(i,"extraParams",{}));await k({req:e,userDid:i.did,userPk:i.pk,extraParams:t,updateSession:W(r,t)})}t.status(200).json(Object.keys(i).filter(e=>"challenge"!==e).reduce((e,t)=>(e[t]=i[t],e),{}))}catch(n){V({req:e,res:t,stage:"check-token-status",err:n})}},onAuthRequest:async(e,n)=>{const{locale:r,token:a,store:l,params:u,didwallet:p}=e.context,c=$(r,u,o(l,"extraParams",{})),d=u.userDid||l.did||c.connectedDid,f=u.userPk||l.pk||c.connectedPk,h=await z({context:e.context,userDid:d,userPk:f});if(h)return n.jsonp({error:h});try{const r=[...H],o=U&&!!c.connectedDid;if(o&&i(r,"[0].authPrincipal.supervised",!1),"scanned"!==l.status&&await I.update(a,{status:"scanned",connectedWallet:p}),l.dynamic||o){const n=await s({req:e,userDid:d,userPk:f,didwallet:p,challenge:l.challenge,pathname:Y(F(t,e),e),baseUrl:S(e,c),extraParams:c,updateSession:W(a,c)});n&&r.push(n)}const u=await C(e),h=await R.sign(Object.assign(u,{context:{token:a,userDid:d,userPk:f,didwallet:p},claims:r[l.currentStep],pathname:Y(F(t,e),e),baseUrl:S(e,c),extraParams:c,challenge:l.challenge,appInfo:l.appInfo,request:e}));n.jsonp(Object.assign(h,{signed:!0}))}catch(t){V({req:e,res:n,stage:"send-auth-claim",err:t})}},onAuthResponse:async(e,n)=>{const{locale:r,token:i,store:a,params:u,didwallet:p}=e.context;try{const{userDid:c,userPk:h,action:y,challenge:v,claims:b}=await R.verify(u,r);a.did&&a.pk||await I.update(i,{did:c,pk:h});const _=$(r,u,o(a,"extraParams",{})),E={step:a.currentStep,req:e,userDid:c,userPk:h,challenge:a.challenge,didwallet:p,claims:b,baseUrl:S(e,_),extraParams:_,updateSession:W(i,_)},w=[...H],k=U&&!!_.connectedDid;if(a.dynamic||k){const e=await s(E);e&&w.push(e)}if("declineAuth"===y){await I.update(i,{status:"error",error:T.userDeclined[r],currentStep:w.length-1});const e=await d(E);return n.jsonp({...e||{}})}if(!v)return n.jsonp({error:T.challengeMismatch[r]});if(v!==a.challenge)return n.jsonp({error:T.challengeMismatch[r]});const M=await z({context:e.context,userDid:c,userPk:h});if(M)return n.jsonp({error:M});const O=a.currentStep>0;if(!1===O){const e=await s(E);e&&(await I.update(i,{dynamic:!0}),w.push(e))}const D=async t=>{if(t&&t.nextToken&&t.nextWorkflow)try{await I.update(t.nextToken,{prevToken:i})}catch(e){console.error("DIDAuth: failed to to update nextToken",e),await I.update(i,{status:"succeed"})}else{if(a.prevToken)try{await I.update(a.prevToken,{status:"succeed"})}catch(e){console.error("DIDAuth: failed to to update prevToken",e)}await I.update(i,{status:"succeed"})}let r="string"==typeof(o=E.extraParams.nw)&&!m.test(o)&&g.test(o)?E.extraParams.nw:"";var o;if(r&&t&&t.nextWorkflowData){const o=new URL(r),i=f(JSON.stringify(t.nextWorkflowData));if(i.length>1024){const t=new Error("base64 encoded nextWorkflowData should be less than 1024 characters");return V({req:e,res:n,stage:"append-next-workflow",err:t})}if(A(r)){const e=decodeURIComponent(o.searchParams.get("url")),t=new URL(e);t.searchParams.set("previousWorkflowData",i),o.searchParams.set("url",t.href)}else o.searchParams.set("previousWorkflowData",i);r=o.href}return n.jsonp({...Object.assign({nextWorkflow:r},t||{})})};if(1===w.length){return D(await l(E))}if(O&&a.currentStep<w.length){const e=await l(E);if(a.currentStep===w.length-1)return D(e)}const N=a.currentStep+1,L=x();await I.update(i,{currentStep:N,challenge:L});const j=await C(e);try{const r=await R.sign(Object.assign(j,{context:{token:i,userDid:c,userPk:h,didwallet:p},claims:w[N],pathname:Y(F(t,e),e),baseUrl:S(e,_),extraParams:_,challenge:L,appInfo:a.appInfo,request:e}));return n.jsonp(Object.assign(r,{signed:!0}))}catch(t){return V({req:e,res:n,stage:"next-auth-claim",err:t})}}catch(t){V({req:e,res:n,stage:"verify-auth-claim",err:t})}},ensureContext:async(e,t,n)=>{const r=w(e.query["user-agent"]||e.headers["user-agent"]),o={...e.body,...e.query,...e.params},i=o[j],a=v(e);let s=null;if(i&&(s=await I.read(i),o.previousWorkflowData))try{s.extraParams.previousWorkflowData=JSON.parse(h(o.previousWorkflowData)),await I.update(i,{extraParams:s.extraParams})}catch(e){console.warn("Could not parse previousWorkflowData",o.previousWorkflowData,e)}return e.context={locale:a,token:i,didwallet:r,params:o,store:s},n()},ensureSignedJson:(e,t,n)=>{if(void 0===e.ensureSignedJson){e.ensureSignedJson=!0;const n=t.jsonp;t.jsonp=async r=>{if(r.signed)return n.call(t,r);const i=r.response?{response:r.response}:{response:r};(r.error||r.errorMessage)&&(i.errorMessage=r.error||r.errorMessage),r.successMessage&&(i.successMessage=r.successMessage),r.nextWorkflow&&(i.nextWorkflow=r.nextWorkflow);const s=["error","errorMessage","successMessage","nextWorkflow"];"object"==typeof i.response&&(i.response=a(i.response,s));const l={...e.body,...e.query,...e.params}[j],u=l?await I.read(l):null,p=await R.signResponse(i,S(e,o(u,"extraParams",{})),e);n.call(t,p)}}const{token:r,store:i,locale:s}=e.context;if(!r||!i)return t.jsonp({error:T.token404[s]});n()},createExtraParams:$}},e.exports.isDeepLink=A,e.exports.parseWalletUA=w,e.exports.preparePathname=E,e.exports.prepareBaseUrl=S,e.exports.getStepChallenge=x},function(e,t,n){const r=n(80);e.exports=(e,t,n)=>0!==r(e,t,n)},function(e,t,n){const r=n(355),o=n(719),i=n(240),a=n(358),s=n(357),l=n(359);e.exports=(e,t,n,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return r(e,n,u);case"!=":return o(e,n,u);case">":return i(e,n,u);case">=":return a(e,n,u);case"<":return s(e,n,u);case"<=":return l(e,n,u);default:throw new TypeError("Invalid operator: "+t)}}},function(e,t,n){const r=n(508).create({proxy:!1}),o=n(212),i=n(141),{NODE_MODES:a}=n(25),s=n(1441),{SERVICE_PREFIX:l}=n(722),u=n(1444).version,{validateNotification:p,validateReceiver:c,validateOption:d}=s,f=process.env.ABT_NODE_MODE;e.exports=async(e,t,{appId:n,appSk:s,did:h}={},g=process.env.ABT_NODE_SERVICE_PORT,m={})=>{await c(e);const y=o(m,["keepForOfflineUser"]);await d(y),f!==a.DEBUG&&await p(t);const v=i.sign(n,s);try{const{data:o}=await r.post(`http://127.0.0.1:${g}${l}/api/sendToUser`,{apiVersion:u,data:{sender:{did:h,token:v,appDid:n},receiver:e,notification:t,options:y}},{headers:{"User-Agent":"BlockletSDK/"+u}});return o}catch(e){throw new Error(e.response?e.response.statusText:e.message)}}},function(e,t){e.exports={SERVICE_PREFIX:"/.well-known/service"}},function(e,t){e.exports={baseUrl:process.env.ABT_NODE_BASE_URL}},function(e,t,n){e.exports=n(1467)().Promise},function(e,t,n){const r=n(28);e.exports=function(e=16){return r.getRandomBytes(e).replace(/^0x/,"").toUpperCase()}},function(e,t,n){function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{createPassport:s,createPassportVC:l,createUserPassport:u}=n(147),{ROLES:p,VC_TYPE_NODE_PASSPORT:c}=n(25),d=n(87),{getPassportStatusEndpoint:f}=n(44),{authenticateByNFT:h,getOwnershipNFTClaim:g}=n(125),m=n(361),{messages:y}=n(44),v=n(40)(n(91).name),{createSessionToken:b}=n(124),_={requestProfile:{en:"This node has already been accepted, please login.",zh:"请提供节点所有者信息"},alreadyAccepted:{en:"Already accepted, please login",zh:"已经接受过该节点,请登录。"}};e.exports={getAssetProfile:e=>({extraParams:{locale:t}})=>g(e,t),getProfileClaim:async e=>({fields:["fullName","email","avatar"],description:_.requestProfile[e]}),onAddNodeOwnerAuth:async({action:e,req:t,node:n,baseUrl:o,claims:a,userDid:g,locale:_,challenge:T,userPk:E,updateSession:S})=>{const x=a.find(e=>"profile"===e.type);if(!x)throw new Error(y.missingProfileClaim[_]);const{teamDid:w,ownerDid:A,ownerNFT:k}=await h({node:n,claims:a,userDid:g,challenge:T,locale:_}),M=await n.getNodeInfo(),O={did:g,pk:E},D=M.ownerNft||{};"accept-server"===e?D.holder=A:D.did=k,await n.updateNodeOwner({nodeOwner:O,ownerNft:D}),v.info("verify owner to node",{userDid:g});const I=l({issuerName:M.name,issuerWallet:m(M.sk),ownerDid:g,passport:await s({name:p.OWNER,node:n,teamDid:w,locale:_,endpoint:o}),endpoint:f({baseUrl:o,userDid:g,teamDid:w}),types:[c],tag:M.did,ownerProfile:x,preferredColor:"default"}),R=p.OWNER,N=u(I,{role:R}),C=await n.addUser({teamDid:w,user:i(i({},x),{},{did:g,pk:E,approved:!0,locale:_,passports:[N],firstLoginAt:(new Date).toISOString(),lastLoginAt:(new Date).toISOString()})});await n.createAuditLog({action:"addUser",args:{teamDid:w,userDid:g,reason:"claim server with server nft"},context:d(r(t,{user:C})),result:C},n);const F=await b(g,{passport:N,role:R});return await S({sessionToken:F},!0),{disposition:"attachment",type:"VerifiableCredential",data:I}}}},function(e,t,n){function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const o=n(112),i=n(488),a=n(225),s=n(87),l=n(725),u=n(361),{getDisplayName:p}=n(104),{VC_TYPE_NODE_PASSPORT:c,PASSPORT_STATUS:d}=n(25),f=n(27),h=n(226),{messages:g,getUser:m,checkWalletVersion:y,getPassportStatusEndpoint:v}=n(44),{createPassport:b,createPassportVC:_,upsertToPassports:T,createUserPassport:E,getRoleFromLocalPassport:S}=n(147),x=n(346),w=n(235),A={BLOCKLET:"blocklet",NODE:"node"},k=async({type:e,node:t,req:n})=>{let r,o,i,s,l;const c=await t.getNodeInfo();if(e===A.NODE)r=c.did,o=c.did,i=c.name,s=u(c.sk),l="default";else{if(!A.BLOCKLET)throw new Error("createLostPassportListRoute: unknown type");{r=n.headers["x-blocklet-did"];const e=await t.getBlocklet({did:r,attachRuntimeInfo:!1}),u=a(e,c.sk);o=u.wallet.address,i=p(e,!0),s=u.wallet,l=u.passportColor}}return{teamDid:r,issuerDid:o,issuerName:i,issuerWallet:s,passportColor:l}};e.exports={createLostPassportListRoute:({node:e,type:t})=>({action:"lost-passport-list",claims:{profile:async({extraParams:e})=>{const{locale:t}=e;return{fields:["fullName"],description:g.description[t]}}},onAuth:async({userDid:n,extraParams:r,updateSession:o,req:a})=>{const{locale:s}=r,{teamDid:l,issuerDid:u}=await k({node:e,req:a,type:t}),p=await m(e,l,n);if(!p)throw new Error(g.userNotFound[s]);if(!p.approved)throw new Error(g.notAllowed[s]);if(p.passportTypes=i((p.passports||[]).filter(e=>e.status===d.VALID&&(e.issuer.id===u&&!(e.expirationDate&&Date.now()>new Date(e.expirationDate).getTime()))),"name"),!p.passportTypes.length)throw new Error(g.passportNotFound[s]);h.info("get passport type list",{userDid:n}),await o({user:p})}}),createLostPassportIssueRoute:({node:e,type:t,authServicePrefix:n})=>({action:"lost-passport-issue",authPrincipal:!1,claims:[{authPrincipal:async({extraParams:e})=>{const{receiverDid:t}=e;return{description:"Please select the required DID",target:t}}},{signature:async({extraParams:n,context:{request:r,didwallet:o}})=>{const{locale:i,passportName:a,receiverDid:s}=n;y({didwallet:o,locale:i});const{teamDid:u,issuerDid:p,issuerName:c,passportColor:d}=await k({node:e,req:r,type:t}),f=await m(e,u,s),h=await b({name:a,node:e,teamDid:u,locale:i});return{description:g.receivePassport[i],data:l(),type:"mime:text/plain",display:JSON.stringify({type:"svg",content:w({issuer:c,title:h.title,issuerDid:p,ownerName:f.fullName||"",ownerAvatarUrl:f.avatar||"",preferredColor:d})})}}}],onAuth:async({claims:i,userDid:a,userPk:l,extraParams:u,updateSession:p,baseUrl:y,req:w})=>{const{locale:M="en",receiverDid:O,passportName:D}=u,{teamDid:I,issuerDid:R,issuerName:N,issuerWallet:C,passportColor:F}=await k({node:e,req:w,type:t}),L=((e,t,n)=>e===A.BLOCKLET?o(t,n):t)(t,y,n),j=i.find(e=>"signature"===e.type);if(h.info("claim.signature.onAuth",{userPk:l,userDid:a,claim:j}),x(j,a,l,M),O!==a)throw new Error({en:"userDid and receiverDid are not same",zh:"userDid 和 receiverDid 不一致"}[M]);const B=await m(e,I,a);if(!B.approved)throw new Error(g.notAllowed[M]);if(!(B.passports||[]).find(e=>e.name===D&&e.status===d.VALID&&e.issuer.id===R&&(!e.expirationDate||Date.now()>new Date(e.expirationDate).getTime())))throw new Error({en:"Passport does not exist",zh:"通行证不存在"}[M]);const P={issuerName:N,issuerWallet:C,ownerDid:a,passport:await b({name:D,node:e,teamDid:I,locale:M,endpoint:y}),endpoint:v({baseUrl:L,userDid:a,teamDid:I}),types:[],ownerProfile:B,preferredColor:F};t===A.NODE&&(P.types=[c],P.tag=I);const H=_(P),U=S(f(H,"credentialSubject.passport")),$=E(H,{role:U}),W=await e.updateUser({teamDid:I,user:{did:a,pk:l,passports:T(B.passports||[],$)}});return await e.createAuditLog({action:"updateUser",args:{teamDid:I,userDid:a,passport:$,reason:"recovered passport"},context:s(r(w,{user:B})),result:W},e),await p({passportId:H.id}),{disposition:"attachment",type:"VerifiableCredential",data:H}}}),TEAM_TYPES:A}},function(e,t){e.exports=e=>"string"==typeof e&&e&&"/"!==e?`/${e}/`.replace(/\/+/g,"/"):"/"},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(2),o=n(19),i=n(31),a=n(51),s=n(1);function l(e,t){switch(e.kind){case s.a.NULL:return null;case s.a.INT:return parseInt(e.value,10);case s.a.FLOAT:return parseFloat(e.value);case s.a.STRING:case s.a.ENUM:case s.a.BOOLEAN:return e.value;case s.a.LIST:return e.values.map((function(e){return l(e,t)}));case s.a.OBJECT:return Object(i.a)(e.fields,(function(e){return e.name.value}),(function(e){return l(e.value,t)}));case s.a.VARIABLE:var n=e.name.value;return t&&!Object(a.a)(t[n])?t[n]:void 0}Object(o.a)(!1,"Unexpected value node: "+Object(r.a)(e))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return s}));var r=n(6),o=n(3),i=/^[_a-zA-Z][_a-zA-Z0-9]*$/;function a(e){var t=s(e);if(t)throw t;return e}function s(e,t){return"string"==typeof e||Object(r.a)(0,"Expected string"),e.length>1&&"_"===e[0]&&"_"===e[1]?new o.a('Name "'.concat(e,'" must not begin with "__", which is reserved by GraphQL introspection.'),t):i.test(e)?void 0:new o.a('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "'.concat(e,'" does not.'),t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(3),o=n(1),i=n(64);function a(e){return{Document:function(t){for(var n=0,a=t.definitions;n<a.length;n++){var s=a[n];Object(i.b)(s)||e.reportError(new r.a((l=s.kind===o.a.SCHEMA_DEFINITION||s.kind===o.a.SCHEMA_EXTENSION?"schema":s.name.value,"The ".concat(l," definition is not executable.")),s))}var l;return!1}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e){var t=Object.create(null);return{OperationDefinition:function(n){var o=n.name;return o&&(t[o.value]?e.reportError(new r.a(function(e){return'There can be only one operation named "'.concat(e,'".')}(o.value),[t[o.value],o])):t[o.value]=o),!1},FragmentDefinition:function(){return!1}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3),o=n(1);function i(e){var t=0;return{Document:function(e){t=e.definitions.filter((function(e){return e.kind===o.a.OPERATION_DEFINITION})).length},OperationDefinition:function(n){!n.name&&t>1&&e.reportError(new r.a("This anonymous operation must be the only defined operation.",n))}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e){return{OperationDefinition:function(t){var n;"subscription"===t.operation&&1!==t.selectionSet.selections.length&&e.reportError(new r.a((n=t.name&&t.name.value)?'Subscription "'.concat(n,'" must select only one top level field.'):"Anonymous Subscription must select only one top level field.",t.selectionSet.selections.slice(1)))}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(3),o=n(18),i=n(0),a=n(33);function s(e){return{InlineFragment:function(t){var n=t.typeCondition;if(n){var s=Object(a.a)(e.getSchema(),n);s&&!Object(i.D)(s)&&e.reportError(new r.a(function(e){return'Fragment cannot condition on non composite type "'.concat(e,'".')}(Object(o.print)(n)),n))}},FragmentDefinition:function(t){var n=Object(a.a)(e.getSchema(),t.typeCondition);n&&!Object(i.D)(n)&&e.reportError(new r.a(function(e,t){return'Fragment "'.concat(e,'" cannot condition on non composite type "').concat(t,'".')}(t.name.value,Object(o.print)(t.typeCondition)),t.typeCondition))}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(3),o=n(18),i=n(0),a=n(33);function s(e){return{VariableDefinition:function(t){var n=Object(a.a)(e.getSchema(),t.type);if(n&&!Object(i.G)(n)){var s=t.variable.name.value;e.reportError(new r.a(function(e,t){return'Variable "$'.concat(e,'" cannot be non-input type "').concat(t,'".')}(s,Object(o.print)(t.type)),t.type))}}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(2),o=n(3),i=n(0);function a(e){return{Field:function(t){var n=e.getType(),a=t.selectionSet;n&&(Object(i.I)(Object(i.A)(n))?a&&e.reportError(new o.a(function(e,t){return'Field "'.concat(e,'" must not have a selection since type "').concat(t,'" has no subfields.')}(t.name.value,Object(r.a)(n)),a)):a||e.reportError(new o.a(function(e,t){return'Field "'.concat(e,'" of type "').concat(t,'" must have a selection of subfields. Did you mean "').concat(e,' { ... }"?')}(t.name.value,Object(r.a)(n)),t)))}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(42),o=n(50),i=n(3),a=n(0);function s(e){return{Field:function(t){var n=e.getParentType();if(n&&!e.getFieldDef()){var s=e.getSchema(),l=t.name.value,u=function(e,t,n){if(Object(a.C)(t)){for(var r=[],o=Object.create(null),i=0,s=e.getPossibleTypes(t);i<s.length;i++){var l=s[i];if(l.getFields()[n]){r.push(l.name);for(var u=0,p=l.getInterfaces();u<p.length;u++){var c=p[u];c.getFields()[n]&&(o[c.name]=(o[c.name]||0)+1)}}}return Object.keys(o).sort((function(e,t){return o[t]-o[e]})).concat(r)}return[]}(s,n,l),p=0!==u.length?[]:function(e,t,n){if(Object(a.N)(t)||Object(a.H)(t)){var r=Object.keys(t.getFields());return Object(o.a)(n,r)}return[]}(0,n,l);e.reportError(new i.a(function(e,t,n,o){var i=n.map((function(e){return'"'.concat(e,'"')})),a=o.map((function(e){return'"'.concat(e,'"')}));return'Cannot query field "'.concat(e,'" on type "').concat(t,'".')+(Object(r.a)("to use an inline fragment on",i)||Object(r.a)(a))}(l,n.name,u,p),t))}}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e){var t=Object.create(null);return{OperationDefinition:function(){return!1},FragmentDefinition:function(n){var o=n.name.value;return t[o]?e.reportError(new r.a('There can be only one fragment named "'.concat(o,'".'),[t[o],n.name])):t[o]=n.name,!1}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e){return{FragmentSpread:function(t){var n=t.name.value;e.getFragment(n)||e.reportError(new r.a('Unknown fragment "'.concat(n,'".'),t.name))}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3);function o(e){return'Fragment "'.concat(e,'" is never used.')}function i(e){var t=[],n=[];return{OperationDefinition:function(e){return t.push(e),!1},FragmentDefinition:function(e){return n.push(e),!1},Document:{leave:function(){for(var i=Object.create(null),a=0;a<t.length;a++)for(var s=t[a],l=0,u=e.getRecursivelyReferencedFragments(s);l<u.length;l++){i[u[l].name.value]=!0}for(var p=0;p<n.length;p++){var c=n[p],d=c.name.value;!0!==i[d]&&e.reportError(new r.a(o(d),c))}}}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(2),o=n(3),i=n(0),a=n(33),s=n(101);function l(e){return{InlineFragment:function(t){var n=e.getType(),a=e.getParentType();Object(i.D)(n)&&Object(i.D)(a)&&!Object(s.a)(e.getSchema(),n,a)&&e.reportError(new o.a(function(e,t){return'Fragment cannot be spread here as objects of type "'.concat(e,'" can never be of type "').concat(t,'".')}(Object(r.a)(a),Object(r.a)(n)),t))},FragmentSpread:function(t){var n=t.name.value,l=function(e,t){var n=e.getFragment(t);if(n){var r=Object(a.a)(e.getSchema(),n.typeCondition);if(Object(i.D)(r))return r}}(e,n),u=e.getParentType();l&&u&&!Object(s.a)(e.getSchema(),l,u)&&e.reportError(new o.a(function(e,t,n){return'Fragment "'.concat(e,'" cannot be spread here as objects of type "').concat(t,'" can never be of type "').concat(n,'".')}(n,Object(r.a)(u),Object(r.a)(l)),t))}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e){var t=Object.create(null),n=[],o=Object.create(null);return{OperationDefinition:function(){return!1},FragmentDefinition:function(i){return function i(a){if(t[a.name.value])return;var s=a.name.value;t[s]=!0;var l=e.getFragmentSpreads(a.selectionSet);if(0===l.length)return;o[s]=n.length;for(var u=0;u<l.length;u++){var p=l[u],c=p.name.value,d=o[c];if(n.push(p),void 0===d){var f=e.getFragment(c);f&&i(f)}else{var h=n.slice(d),g=h.slice(0,-1).map((function(e){return e.name.value}));e.reportError(new r.a((m=c,v=void 0,v=(y=g).length?" via "+y.join(", "):"",'Cannot spread fragment "'.concat(m,'" within itself').concat(v,".")),h))}n.pop()}var m,y,v;o[s]=void 0}(i),!1}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e){var t=Object.create(null);return{OperationDefinition:function(){t=Object.create(null)},VariableDefinition:function(n){var o=n.variable.name.value;t[o]?e.reportError(new r.a(function(e){return'There can be only one variable named "'.concat(e,'".')}(o),[t[o],n.variable.name])):t[o]=n.variable.name}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3);function o(e,t){return t?'Variable "$'.concat(e,'" is not defined by operation "').concat(t,'".'):'Variable "$'.concat(e,'" is not defined.')}function i(e){var t=Object.create(null);return{OperationDefinition:{enter:function(){t=Object.create(null)},leave:function(n){for(var i=e.getRecursiveVariableUsages(n),a=0;a<i.length;a++){var s=i[a].node,l=s.name.value;!0!==t[l]&&e.reportError(new r.a(o(l,n.name&&n.name.value),[s,n]))}}},VariableDefinition:function(e){t[e.variable.name.value]=!0}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3);function o(e,t){return t?'Variable "$'.concat(e,'" is never used in operation "').concat(t,'".'):'Variable "$'.concat(e,'" is never used.')}function i(e){var t=[];return{OperationDefinition:{enter:function(){t=[]},leave:function(n){for(var i=Object.create(null),a=e.getRecursiveVariableUsages(n),s=n.name?n.name.value:null,l=0;l<a.length;l++){i[a[l].node.name.value]=!0}for(var u=0,p=t;u<p.length;u++){var c=p[u],d=c.variable.name.value;!0!==i[d]&&e.reportError(new r.a(o(d,s),c))}}},VariableDefinition:function(e){t.push(e)}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(2),o=n(3),i=n(1),a=n(0),s=n(33),l=n(101);function u(e,t,n){return'Variable "$'.concat(e,'" of type "').concat(t,'" used in position expecting type "').concat(n,'".')}function p(e){var t=Object.create(null);return{OperationDefinition:{enter:function(){t=Object.create(null)},leave:function(n){for(var i=e.getRecursiveVariableUsages(n),a=0;a<i.length;a++){var l=i[a],p=l.node,d=l.type,f=l.defaultValue,h=p.name.value,g=t[h];if(g&&d){var m=e.getSchema(),y=Object(s.a)(m,g.type);y&&!c(m,y,g.defaultValue,d,f)&&e.reportError(new o.a(u(h,Object(r.a)(y),Object(r.a)(d)),[g,p]))}}}},VariableDefinition:function(e){t[e.variable.name.value]=e}}}function c(e,t,n,r,o){if(Object(a.L)(r)&&!Object(a.L)(t)){if(!(null!=n&&n.kind!==i.a.NULL)&&!(void 0!==o))return!1;var s=r.ofType;return Object(l.c)(e,t,s)}return Object(l.c)(e,t,r)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(83),o=n(63),i=n(2),a=n(3),s=n(1),l=n(18),u=n(0),p=n(33);function c(e,t){return'Fields "'.concat(e,'" conflict because ').concat(function e(t){if(Array.isArray(t))return t.map((function(t){var n=t[0],r=t[1];return'subfields "'.concat(n,'" conflict because ').concat(e(r))})).join(" and ");return t}(t),". ")+"Use different aliases on the fields to fetch both if this was intentional."}function d(e){var t=new b,n=new Map;return{SelectionSet:function(r){for(var i=function(e,t,n,r,i){var a=[],s=y(e,t,r,i),l=s[0],u=s[1];if(function(e,t,n,r,i){for(var a=0,s=Object(o.a)(i);a<s.length;a++){var l=s[a],u=l[0],p=l[1];if(p.length>1)for(var c=0;c<p.length;c++)for(var d=c+1;d<p.length;d++){var f=m(e,n,r,!1,u,p[c],p[d]);f&&t.push(f)}}}(e,a,t,n,l),0!==u.length)for(var p=Object.create(null),c=0;c<u.length;c++){f(e,a,t,p,n,!1,l,u[c]);for(var d=c+1;d<u.length;d++)h(e,a,t,n,!1,u[c],u[d])}return a}(e,n,t,e.getParentType(),r),s=0;s<i.length;s++){var l=i[s],u=l[0],p=u[0],d=u[1],g=l[1],v=l[2];e.reportError(new a.a(c(p,d),g.concat(v)))}}}}function f(e,t,n,r,o,i,a,s){if(!r[s]){r[s]=!0;var l=e.getFragment(s);if(l){var u=v(e,n,l),p=u[0],c=u[1];if(a!==p){g(e,t,n,o,i,a,p);for(var d=0;d<c.length;d++)f(e,t,n,r,o,i,a,c[d])}}}}function h(e,t,n,r,o,i,a){if(i!==a&&!r.has(i,a,o)){r.add(i,a,o);var s=e.getFragment(i),l=e.getFragment(a);if(s&&l){var u=v(e,n,s),p=u[0],c=u[1],d=v(e,n,l),f=d[0],m=d[1];g(e,t,n,r,o,p,f);for(var y=0;y<m.length;y++)h(e,t,n,r,o,i,m[y]);for(var b=0;b<c.length;b++)h(e,t,n,r,o,c[b],a)}}}function g(e,t,n,r,o,i,a){for(var s=0,l=Object.keys(i);s<l.length;s++){var u=l[s],p=a[u];if(p)for(var c=i[u],d=0;d<c.length;d++)for(var f=0;f<p.length;f++){var h=m(e,n,r,o,u,c[d],p[f]);h&&t.push(h)}}}function m(e,t,n,o,a,s,p){var c=s[0],d=s[1],m=s[2],v=p[0],b=p[1],_=p[2],T=o||c!==v&&Object(u.N)(c)&&Object(u.N)(v),E=m&&m.type,S=_&&_.type;if(!T){var x=d.name.value,w=b.name.value;if(x!==w)return[[a,"".concat(x," and ").concat(w," are different fields")],[d],[b]];if(!function(e,t){if(e.length!==t.length)return!1;return e.every((function(e){var n,o,i=Object(r.a)(t,(function(t){return t.name.value===e.name.value}));return!!i&&(n=e.value,o=i.value,!n&&!o||Object(l.print)(n)===Object(l.print)(o))}))}(d.arguments||[],b.arguments||[]))return[[a,"they have differing arguments"],[d],[b]]}if(E&&S&&function e(t,n){if(Object(u.J)(t))return!Object(u.J)(n)||e(t.ofType,n.ofType);if(Object(u.J)(n))return!0;if(Object(u.L)(t))return!Object(u.L)(n)||e(t.ofType,n.ofType);if(Object(u.L)(n))return!0;if(Object(u.I)(t)||Object(u.I)(n))return t!==n;return!1}(E,S))return[[a,"they return conflicting types ".concat(Object(i.a)(E)," and ").concat(Object(i.a)(S))],[d],[b]];var A=d.selectionSet,k=b.selectionSet;return A&&k?function(e,t,n,r){if(e.length>0)return[[t,e.map((function(e){return e[0]}))],e.reduce((function(e,t){var n=t[1];return e.concat(n)}),[n]),e.reduce((function(e,t){var n=t[2];return e.concat(n)}),[r])]}(function(e,t,n,r,o,i,a,s){var l=[],u=y(e,t,o,i),p=u[0],c=u[1],d=y(e,t,a,s),m=d[0],v=d[1];if(g(e,l,t,n,r,p,m),0!==v.length)for(var b=Object.create(null),_=0;_<v.length;_++)f(e,l,t,b,n,r,p,v[_]);if(0!==c.length)for(var T=Object.create(null),E=0;E<c.length;E++)f(e,l,t,T,n,r,m,c[E]);for(var S=0;S<c.length;S++)for(var x=0;x<v.length;x++)h(e,l,t,n,r,c[S],v[x]);return l}(e,t,n,T,Object(u.A)(E),A,Object(u.A)(S),k),a,d,b):void 0}function y(e,t,n,r){var o=t.get(r);if(!o){var i=Object.create(null),a=Object.create(null);!function e(t,n,r,o,i){for(var a=0,l=r.selections;a<l.length;a++){var c=l[a];switch(c.kind){case s.a.FIELD:var d=c.name.value,f=void 0;(Object(u.N)(n)||Object(u.H)(n))&&(f=n.getFields()[d]);var h=c.alias?c.alias.value:d;o[h]||(o[h]=[]),o[h].push([n,c,f]);break;case s.a.FRAGMENT_SPREAD:i[c.name.value]=!0;break;case s.a.INLINE_FRAGMENT:var g=c.typeCondition,m=g?Object(p.a)(t.getSchema(),g):n;e(t,m,c.selectionSet,o,i)}}}(e,n,r,i,a),o=[i,Object.keys(a)],t.set(r,o)}return o}function v(e,t,n){var r=t.get(n.selectionSet);if(r)return r;var o=Object(p.a)(e.getSchema(),n.typeCondition);return y(e,t,o,n.selectionSet)}var b=function(){function e(){this._data=Object.create(null)}var t=e.prototype;return t.has=function(e,t,n){var r=this._data[e],o=r&&r[t];return void 0!==o&&(!1!==n||!1===o)},t.add=function(e,t,n){_(this._data,e,t,n),_(this._data,t,e,n)},e}();function _(e,t,n,r){var o=e[t];o||(o=Object.create(null),e[t]=o),o[n]=r}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e){var t=e.getSchema(),n=t&&(t.astNode||t.getQueryType()||t.getMutationType()||t.getSubscriptionType()),o=0;return{SchemaDefinition:function(t){n?e.reportError(new r.a("Cannot define a new schema within a schema extension.",t)):(o>0&&e.reportError(new r.a("Must provide only one schema definition.",t)),++o)}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(3);function o(e){return"There can be only one ".concat(e," type in schema.")}function i(e){return"Type for ".concat(e," already defined in the schema. It cannot be redefined.")}function a(e){var t=e.getSchema(),n=Object.create(null),a=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:s,SchemaExtension:s};function s(t){if(t.operationTypes)for(var s=0,l=t.operationTypes||[];s<l.length;s++){var u=l[s],p=u.operation,c=n[p];a[p]?e.reportError(new r.a(i(p),u)):c?e.reportError(new r.a(o(p),[c,u])):n[p]=u}return!1}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e){var t=Object.create(null),n=e.getSchema();return{ScalarTypeDefinition:o,ObjectTypeDefinition:o,InterfaceTypeDefinition:o,UnionTypeDefinition:o,EnumTypeDefinition:o,InputObjectTypeDefinition:o};function o(o){var i=o.name.value;if(!n||!n.getType(i))return t[i]?e.reportError(new r.a(function(e){return'There can be only one type named "'.concat(e,'".')}(i),[t[i],o.name])):t[i]=o.name,!1;e.reportError(new r.a(function(e){return'Type "'.concat(e,'" already exists in the schema. It cannot also be defined in this type definition.')}(i),o.name))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(3),o=n(0);function i(e,t){return'Enum value "'.concat(e,".").concat(t,'" can only be defined once.')}function a(e,t){return'Enum value "'.concat(e,".").concat(t,'" already exists in the schema. It cannot also be defined in this type extension.')}function s(e){var t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),s=Object.create(null);return{EnumTypeDefinition:l,EnumTypeExtension:l};function l(t){var l=t.name.value;if(s[l]||(s[l]=Object.create(null)),t.values)for(var u=s[l],p=0,c=t.values;p<c.length;p++){var d=c[p],f=d.name.value,h=n[l];Object(o.E)(h)&&h.getValue(f)?e.reportError(new r.a(a(l,f),d.name)):u[f]?e.reportError(new r.a(i(l,f),[u[f],d.name])):u[f]=d.name}return!1}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(3),o=n(0);function i(e,t){return'Field "'.concat(e,".").concat(t,'" can only be defined once.')}function a(e,t){return'Field "'.concat(e,".").concat(t,'" already exists in the schema. It cannot also be defined in this type extension.')}function s(e){var t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),o=Object.create(null);return{InputObjectTypeDefinition:s,InputObjectTypeExtension:s,InterfaceTypeDefinition:s,InterfaceTypeExtension:s,ObjectTypeDefinition:s,ObjectTypeExtension:s};function s(t){var s=t.name.value;if(o[s]||(o[s]=Object.create(null)),t.fields)for(var u=o[s],p=0,c=t.fields;p<c.length;p++){var d=c[p],f=d.name.value;l(n[s],f)?e.reportError(new r.a(a(s,f),d.name)):u[f]?e.reportError(new r.a(i(s,f),[u[f],d.name])):u[f]=d.name}return!1}}function l(e,t){return!!(Object(o.N)(e)||Object(o.H)(e)||Object(o.F)(e))&&e.getFields()[t]}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e){var t=Object.create(null),n=e.getSchema();return{DirectiveDefinition:function(o){var i=o.name.value;if(!n||!n.getDirective(i))return t[i]?e.reportError(new r.a(function(e){return'There can be only one directive named "'.concat(e,'".')}(i),[t[i],o.name])):t[i]=o.name,!1;e.reportError(new r.a(function(e){return'Directive "'.concat(e,'" already exists in the schema. It cannot be redefined.')}(i),o.name))}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r,o=n(42),i=n(50),a=n(3),s=n(1),l=n(64),u=n(0);function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){return"Cannot extend non-".concat(t,' type "').concat(e,'".')}function d(e){for(var t=e.getSchema(),n=Object.create(null),r=0,p=e.getDocument().definitions;r<p.length;r++){var d=p[r];Object(l.d)(d)&&(n[d.name.value]=d)}return{ScalarTypeExtension:g,ObjectTypeExtension:g,InterfaceTypeExtension:g,UnionTypeExtension:g,EnumTypeExtension:g,InputObjectTypeExtension:g};function g(r){var l=r.name.value,p=n[l],d=t&&t.getType(l);if(p){var g=f[p.kind];g!==r.kind&&e.reportError(new a.a(c(l,h(g)),[p,r]))}else if(d){var m=function(e){if(Object(u.R)(e))return s.a.SCALAR_TYPE_EXTENSION;if(Object(u.N)(e))return s.a.OBJECT_TYPE_EXTENSION;if(Object(u.H)(e))return s.a.INTERFACE_TYPE_EXTENSION;if(Object(u.T)(e))return s.a.UNION_TYPE_EXTENSION;if(Object(u.E)(e))return s.a.ENUM_TYPE_EXTENSION;if(Object(u.F)(e))return s.a.INPUT_OBJECT_TYPE_EXTENSION}(d);m!==r.kind&&e.reportError(new a.a(c(l,h(m)),r))}else{var y=Object.keys(n);t&&(y=y.concat(Object.keys(t.getTypeMap())));var v=Object(i.a)(l,y);e.reportError(new a.a(function(e,t){return'Cannot extend type "'.concat(e,'" because it is not defined.')+Object(o.a)(t.map((function(e){return'"'.concat(e,'"')})))}(l,v),r.name))}}}var f=(p(r={},s.a.SCALAR_TYPE_DEFINITION,s.a.SCALAR_TYPE_EXTENSION),p(r,s.a.OBJECT_TYPE_DEFINITION,s.a.OBJECT_TYPE_EXTENSION),p(r,s.a.INTERFACE_TYPE_DEFINITION,s.a.INTERFACE_TYPE_EXTENSION),p(r,s.a.UNION_TYPE_DEFINITION,s.a.UNION_TYPE_EXTENSION),p(r,s.a.ENUM_TYPE_DEFINITION,s.a.ENUM_TYPE_EXTENSION),p(r,s.a.INPUT_OBJECT_TYPE_DEFINITION,s.a.INPUT_OBJECT_TYPE_EXTENSION),r);function h(e){switch(e){case s.a.SCALAR_TYPE_EXTENSION:return"scalar";case s.a.OBJECT_TYPE_EXTENSION:return"object";case s.a.INTERFACE_TYPE_EXTENSION:return"interface";case s.a.UNION_TYPE_EXTENSION:return"union";case s.a.ENUM_TYPE_EXTENSION:return"enum";case s.a.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:return"unknown type"}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return E})),n.d(t,"a",(function(){return x})),n.d(t,"d",(function(){return k})),n.d(t,"c",(function(){return M}));var r=n(12),o=n(38),i=n(2),a=n(19),s=n(6),l=n(31),u=n(1),p=n(5),c=n(92),d=n(64),f=n(82),h=n(155),g=n(127),m=n(14),y=n(13),v=n(62),b=n(15),_=n(0),T=n(109);function E(e,t){var n;e&&e.kind===u.a.DOCUMENT||Object(s.a)(0,"Must provide valid Document AST"),t&&(t.assumeValid||t.assumeValidSDL)||Object(h.a)(e);for(var o=[],i=[],a=0,l=e.definitions;a<l.length;a++){var p=l[a];p.kind===u.a.SCHEMA_DEFINITION?n=p:Object(d.d)(p)?o.push(p):p.kind===u.a.DIRECTIVE_DEFINITION&&i.push(p)}var c=new x(t,(function(e){var t=f[e];if(void 0===t)throw new Error('Type "'.concat(e,'" not found in document.'));return t})),f=w(o,(function(e){return c.buildType(e)})),g=n?function(e){for(var t={},n=0,r=e.operationTypes;n<r.length;n++){var o=r[n];t[o.operation]=o.type.name.value}return t}(n):{query:"Query",mutation:"Mutation",subscription:"Subscription"},m=i.map((function(e){return c.buildDirective(e)}));return m.some((function(e){return"skip"===e.name}))||m.push(b.e),m.some((function(e){return"include"===e.name}))||m.push(b.d),m.some((function(e){return"deprecated"===e.name}))||m.push(b.b),new v.a({query:g.query?f[g.query]:null,mutation:g.mutation?f[g.mutation]:null,subscription:g.subscription?f[g.subscription]:null,types:Object(r.a)(f),directives:m,astNode:n,assumeValid:t&&t.assumeValid,allowedLegacyNames:t&&t.allowedLegacyNames})}var S=Object(o.a)(m.g.concat(y.m),(function(e){return e.name})),x=function(){function e(e,t){this._options=e,this._resolveType=t}var t=e.prototype;return t.getNamedType=function(e){var t=e.name.value;return S[t]||this._resolveType(t)},t.getWrappedType=function(e){return e.kind===u.a.LIST_TYPE?new _.d(this.getWrappedType(e.type)):e.kind===u.a.NON_NULL_TYPE?new _.e(this.getWrappedType(e.type)):this.getNamedType(e)},t.buildDirective=function(e){var t=this,n=e.locations.map((function(e){return e.value}));return new b.c({name:e.name.value,description:k(e,this._options),locations:n,isRepeatable:e.repeatable,args:w(e.arguments||[],(function(e){return t.buildArg(e)})),astNode:e})},t.buildField=function(e){var t=this;return{type:this.getWrappedType(e.type),description:k(e,this._options),args:w(e.arguments||[],(function(e){return t.buildArg(e)})),deprecationReason:A(e),astNode:e}},t.buildArg=function(e){var t=this.getWrappedType(e.type);return{type:t,description:k(e,this._options),defaultValue:Object(T.a)(e.defaultValue,t),astNode:e}},t.buildInputField=function(e){var t=this.getWrappedType(e.type);return{type:t,description:k(e,this._options),defaultValue:Object(T.a)(e.defaultValue,t),astNode:e}},t.buildEnumValue=function(e){return{description:k(e,this._options),deprecationReason:A(e),astNode:e}},t.buildType=function(e){var t=e.name.value;if(S[t])return S[t];switch(e.kind){case u.a.OBJECT_TYPE_DEFINITION:return this._makeTypeDef(e);case u.a.INTERFACE_TYPE_DEFINITION:return this._makeInterfaceDef(e);case u.a.ENUM_TYPE_DEFINITION:return this._makeEnumDef(e);case u.a.UNION_TYPE_DEFINITION:return this._makeUnionDef(e);case u.a.SCALAR_TYPE_DEFINITION:return this._makeScalarDef(e);case u.a.INPUT_OBJECT_TYPE_DEFINITION:return this._makeInputObjectDef(e)}Object(a.a)(!1,"Unexpected type definition node: "+Object(i.a)(e))},t._makeTypeDef=function(e){var t=this,n=e.interfaces,r=e.fields,o=n&&n.length>0?function(){return n.map((function(e){return t.getNamedType(e)}))}:[],i=r&&r.length>0?function(){return w(r,(function(e){return t.buildField(e)}))}:Object.create(null);return new _.f({name:e.name.value,description:k(e,this._options),interfaces:o,fields:i,astNode:e})},t._makeInterfaceDef=function(e){var t=this,n=e.fields,r=n&&n.length>0?function(){return w(n,(function(e){return t.buildField(e)}))}:Object.create(null);return new _.c({name:e.name.value,description:k(e,this._options),fields:r,astNode:e})},t._makeEnumDef=function(e){var t=this,n=e.values||[];return new _.a({name:e.name.value,description:k(e,this._options),values:w(n,(function(e){return t.buildEnumValue(e)})),astNode:e})},t._makeUnionDef=function(e){var t=this,n=e.types,r=n&&n.length>0?function(){return n.map((function(e){return t.getNamedType(e)}))}:[];return new _.h({name:e.name.value,description:k(e,this._options),types:r,astNode:e})},t._makeScalarDef=function(e){return new _.g({name:e.name.value,description:k(e,this._options),astNode:e})},t._makeInputObjectDef=function(e){var t=this,n=e.fields;return new _.b({name:e.name.value,description:k(e,this._options),fields:n?function(){return w(n,(function(e){return t.buildInputField(e)}))}:Object.create(null),astNode:e})},e}();function w(e,t){return Object(l.a)(e,(function(e){return e.name.value}),t)}function A(e){var t=Object(g.b)(b.b,e);return t&&t.reason}function k(e,t){if(e.description)return e.description.value;if(t&&t.commentDescriptions){var n=function(e){var t=e.loc;if(!t)return;var n=[],r=t.startToken.prev;for(;r&&r.kind===p.a.COMMENT&&r.next&&r.prev&&r.line+1===r.next.line&&r.line!==r.prev.line;){var o=String(r.value);n.push(o),r=r.prev}return n.reverse().join("\n")}(e);if(void 0!==n)return Object(f.a)("\n"+n)}}function M(e,t){return E(Object(c.parse)(e,t),t)}},function(e,t,n){function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const o=n(9),i=n(758),a=n(760),s=n(776),l=n(251);n(830);const u=n(392),p=n(376),c=n(832),d=n(834),{graphqlUploadExpress:f}=n(393),h=n(398),g=n(893),m=n(898),y=n(899),{MAX_UPLOAD_FILE_SIZE:v}=n(25),b=n(37),{setUserInfoHeaders:_}=n(44),T=n(40),E=n(1353),{BlockletStatus:S}=n(100),x=n(1376),{authWithJwt:w,authWithAccessKey:A,authWithVcPresentation:k}=n(124),{context:M,handlers:O}=n(1378),{protectGQL:D}=n(1446),I=n(1447),R=n(1462),N=T("webapp:index"),C=n(1472),F=n(1473),L=n(1474),j=n(1475),B=n(1476),P=n(1477),H=n(1478),U=n(1480),$=n(1481),W=n(1482),V=n(1483),Y=n(1485),z=n(1486),G=n(1487),q=n(1488),K=n(1489),J=n(1490),X=n(1491),Q=n(1494),Z=n(1507),ee=n(1508),te=n(1509),ne=1024*Number(process.env.MAX_UPLOAD_FILE_SIZE||v)*1024;e.exports=function(e){if(!process.env.ABT_NODE_DATA_DIR)throw new Error("Cannot start application without process.env.ABT_NODE_DATA_DIR");M.set("node",e);const t=l();t.set("trust proxy","loopback"),t.disable("x-powered-by"),t.use(a()),t.use(u()),t.use(p.json({limit:"4mb"})),t.use(p.urlencoded({extended:!0,limit:"2mb"})),t.use(i()),t.get("/error/502",async(t,n)=>{try{n.type("html"),n.status(502);const r=t.get("x-did"),o=await e.getNodeInfo(),i={version:o.version,mode:o.mode};if(r){const t=await e.getBlocklet({did:r,attachConfig:!1});return t?t.status===S.starting?n.send(y(t,o)):n.send(m(t,o)):n.send(g(i))}return n.send(g(i))}catch(e){return N.error("render 502 page failed",{error:e}),n.send("502 Error")}}),t.use(s("combined",{stream:T.getAccessLogStream(process.env.ABT_NODE_LOG_DIR)})),t.use(c()),t.use(async(t,n,r)=>{try{const{token:n,headers:r,body:o}=t;if(n){const r=await w(n,e);t.user=r}else if(r["x-access-key-id"]&&r["x-access-stamp"]&&r["x-access-signature"]){const n=await A({keyId:r["x-access-key-id"],stamp:r["x-access-stamp"],signature:r["x-access-signature"],node:e,blockletDid:r["x-access-blocklet"],serviceName:r["x-access-service"]});t.user=n}else o["x-authenticate"]&&o["x-authenticate"].vcPresentation&&(t.user=await k({node:e,vcPresentation:o["x-authenticate"].vcPresentation,challenge:o["x-authenticate"].challenge}))}catch(e){}r()}),t.use(async(e,t,n)=>{_(e),n()}),t.use(E.createRoutes(e.dataDirs.certManagerModule));const n=l.Router();O.attach(r({app:n},C(e))),O.attach(r({app:n},F(e))),O.attach(r({app:n},L(e))),O.attach(r({app:n},j(e))),O.attach(r({app:n},B(e))),O.attach(r({app:n},P(e))),O.attach(r({app:n},H(e))),O.attach(r({app:n},U(e))),O.attach(r({app:n},$(e))),O.attach(r({app:n},W(e))),O.attach(r({app:n},V(e))),O.attach(r({app:n},Y(e))),O.attach(r({app:n},z(e))),O.attach(r({app:n},G(e))),O.attach(r({app:n},q(e))),O.attach(r({app:n},K(e))),J.init(n,e),X.init(n,e),Q.init(n,e),Z.init(n,e),ee.init(n,e),te.init(n,e),x.init(t,e,{prefix:"/api"});const v=I.genConfig(e);t.use("/api/gql",f({maxFileSize:ne,maxFiles:10}),D(e,v),I(v,!1));{t.use(n);const e=o.resolve(__dirname,"./build");t.use(h()),t.use(l.static(e,{maxAge:"365d",index:!1})),t.use(d("index.html",{root:e})),t.use((e,t)=>{t.status(404).send("404 NOT FOUND")}),t.use((e,t,n,r)=>{console.error(e.stack),n.status(500).send("Something broke!")})}const re=b.createServer(t);return R(e).attach(re),re.app=t,re}},function(e,t,n){!function(){"use strict";var t=n(759),r=n(248),o={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function i(e){return"string"==typeof e||e instanceof String}function a(e,t){var n,r=t.headers.origin,o=[];return e.origin&&"*"!==e.origin?i(e.origin)?(o.push([{key:"Access-Control-Allow-Origin",value:e.origin}]),o.push([{key:"Vary",value:"Origin"}])):(n=function e(t,n){if(Array.isArray(n)){for(var r=0;r<n.length;++r)if(e(t,n[r]))return!0;return!1}return i(n)?t===n:n instanceof RegExp?n.test(t):!!n}(r,e.origin),o.push([{key:"Access-Control-Allow-Origin",value:!!n&&r}]),o.push([{key:"Vary",value:"Origin"}])):o.push([{key:"Access-Control-Allow-Origin",value:"*"}]),o}function s(e){return!0===e.credentials?{key:"Access-Control-Allow-Credentials",value:"true"}:null}function l(e){var t=e.exposedHeaders;return t?(t.join&&(t=t.join(",")),t&&t.length?{key:"Access-Control-Expose-Headers",value:t}:null):null}function u(e,t){for(var n=0,o=e.length;n<o;n++){var i=e[n];i&&(Array.isArray(i)?u(i,t):"Vary"===i.key&&i.value?r(t,i.value):i.value&&t.setHeader(i.key,i.value))}}e.exports=function(e){var n=null;return n="function"==typeof e?e:function(t,n){n(null,e)},function(e,r,i){n(e,(function(n,p){if(n)i(n);else{var c=t({},o,p),d=null;c.origin&&"function"==typeof c.origin?d=c.origin:c.origin&&(d=function(e,t){t(null,c.origin)}),d?d(e.headers.origin,(function(t,n){t||!n?i(t):(c.origin=n,function(e,t,n,r){var o=[];"OPTIONS"===(t.method&&t.method.toUpperCase&&t.method.toUpperCase())?(o.push(a(e,t)),o.push(s(e)),o.push(function(e){var t=e.methods;return t.join&&(t=e.methods.join(",")),{key:"Access-Control-Allow-Methods",value:t}}(e)),o.push(function(e,t){var n=e.allowedHeaders||e.headers,r=[];return n?n.join&&(n=n.join(",")):(n=t.headers["access-control-request-headers"],r.push([{key:"Vary",value:"Access-Control-Request-Headers"}])),n&&n.length&&r.push([{key:"Access-Control-Allow-Headers",value:n}]),r}(e,t)),o.push(function(e){var t=("number"==typeof e.maxAge||e.maxAge)&&e.maxAge.toString();return t&&t.length?{key:"Access-Control-Max-Age",value:t}:null}(e)),o.push(l(e)),u(o,n),e.preflightContinue?r():(n.statusCode=e.optionsSuccessStatus,n.setHeader("Content-Length","0"),n.end())):(o.push(a(e,t)),o.push(s(e)),o.push(l(e)),u(o,n),r())}(c,e,r,i))})):i()}}))}}}()},function(e,t,n){"use strict";
|
|
497
|
+
e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var r=100*e+t;return r<600?"凌晨":r<900?"早上":r<1130?"上午":r<1230?"中午":r<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n(4))},function(e){e.exports=JSON.parse('{"name":"@abtnode/auth","publishConfig":{"access":"public"},"version":"1.7.23","description":"Simple lib to manage auth in ABT Node","main":"lib/index.js","files":["lib","components"],"scripts":{"lint":"eslint tests lib","lint:fix":"eslint --fix tests lib","test":"node tools/jest.js","coverage":"npm run test -- --coverage"},"keywords":[],"author":"linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)","license":"MIT","dependencies":{"@abtnode/constant":"1.7.23","@abtnode/logger":"1.7.23","@abtnode/util":"1.7.23","@arcblock/did":"^1.16.15","@arcblock/vc":"^1.16.15","@blocklet/meta":"1.7.23","@ocap/client":"1.16.15","@ocap/mcrypto":"^1.16.15","@ocap/util":"^1.16.15","@ocap/wallet":"^1.16.15","axios":"^0.27.2","joi":"^17.6.0","jsonwebtoken":"^8.5.1","lodash":"^4.17.21","semver":"^7.3.2","url-join":"^4.0.1"},"devDependencies":{"jest":"^27.4.5"},"gitHead":"aa13838b7597bce11851d0b902575f861aa1ab34"}')},function(e,t,n){"use strict";const r=n(1325);e.exports=class extends Error{constructor(e){super(e.filter(e=>""!==e).map(e=>"string"==typeof e?e:e instanceof Error?e.message:r(e)).join(" ")||"Unknown error"),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,t.assert)}}},function(e,t,n){"use strict";const r={};t=e.exports={array:Array.prototype,buffer:Buffer&&Buffer.prototype,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},r.typeMap=new Map([["[object Error]",t.error],["[object Map]",t.map],["[object Promise]",t.promise],["[object Set]",t.set],["[object WeakMap]",t.weakMap],["[object WeakSet]",t.weakSet]]),t.getInternalProto=function(e){if(Array.isArray(e))return t.array;if(Buffer&&e instanceof Buffer)return t.buffer;if(e instanceof Date)return t.date;if(e instanceof RegExp)return t.regex;if(e instanceof Error)return t.error;const n=Object.prototype.toString.call(e);return r.typeMap.get(n)||t.generic}},function(e,t,n){"use strict";t.keys=function(e,t={}){return!1!==t.symbols?Reflect.ownKeys(e):Object.getOwnPropertyNames(e)}},function(e,t,n){"use strict";const r=n(16),o=n(58),i=n(22),a={max:1e3,supported:new Set(["undefined","boolean","number","string"])};t.provider={provision:e=>new a.Cache(e)},a.Cache=class{constructor(e={}){i.assertOptions(e,["max"]),r(void 0===e.max||e.max&&e.max>0&&isFinite(e.max),"Invalid max cache size"),this._max=e.max||a.max,this._map=new Map,this._list=new a.List}get length(){return this._map.size}set(e,t){if(null!==e&&!a.supported.has(typeof e))return;let n=this._map.get(e);if(n)return n.value=t,void this._list.first(n);n=this._list.unshift({key:e,value:t}),this._map.set(e,n),this._compact()}get(e){const t=this._map.get(e);if(t)return this._list.first(t),o(t.value)}_compact(){if(this._map.size>this._max){const e=this._list.pop();this._map.delete(e.key)}}},a.List=class{constructor(){this.tail=null,this.head=null}unshift(e){return e.next=null,e.prev=this.head,this.head&&(this.head.next=e),this.head=e,this.tail||(this.tail=e),e}first(e){e!==this.head&&(this._remove(e),this.unshift(e))}pop(){return this._remove(this.tail)}_remove(e){const{next:t,prev:n}=e;return t.prev=n,n&&(n.next=t),e===this.tail&&(this.tail=t),e.prev=null,e.next=null,e}}},function(e,t,n){"use strict";const r=n(16),o=n(58),i=n(22),a=n(176),s={};t.type=function(e,t){const n=Object.getPrototypeOf(e),l=o(n),u=e._assign(Object.create(l)),p=Object.assign({},t);delete p.base,l._definition=p;const c=n._definition||{};p.messages=a.merge(c.messages,p.messages),p.properties=Object.assign({},c.properties,p.properties),u.type=p.type,p.flags=Object.assign({},c.flags,p.flags);const d=Object.assign({},c.terms);if(p.terms)for(const e in p.terms){const t=p.terms[e];r(void 0===u.$_terms[e],"Invalid term override for",p.type,e),u.$_terms[e]=t.init,d[e]=t}p.terms=d,p.args||(p.args=c.args),p.prepare=s.prepare(p.prepare,c.prepare),p.coerce&&("function"==typeof p.coerce&&(p.coerce={method:p.coerce}),p.coerce.from&&!Array.isArray(p.coerce.from)&&(p.coerce={method:p.coerce.method,from:[].concat(p.coerce.from)})),p.coerce=s.coerce(p.coerce,c.coerce),p.validate=s.validate(p.validate,c.validate);const f=Object.assign({},c.rules);if(p.rules)for(const e in p.rules){const t=p.rules[e];r("object"==typeof t,"Invalid rule definition for",p.type,e);let n=t.method;if(void 0===n&&(n=function(){return this.$_addRule(e)}),n&&(r(!l[e],"Rule conflict in",p.type,e),l[e]=n),r(!f[e],"Rule conflict in",p.type,e),f[e]=t,t.alias){const e=[].concat(t.alias);for(const n of e)l[n]=t.method}t.args&&(t.argsByName=new Map,t.args=t.args.map(e=>("string"==typeof e&&(e={name:e}),r(!t.argsByName.has(e.name),"Duplicated argument name",e.name),i.isSchema(e.assert)&&(e.assert=e.assert.strict().label(e.name)),t.argsByName.set(e.name,e),e)))}p.rules=f;const h=Object.assign({},c.modifiers);if(p.modifiers)for(const e in p.modifiers){r(!l[e],"Rule conflict in",p.type,e);const t=p.modifiers[e];r("function"==typeof t,"Invalid modifier definition for",p.type,e);const n=function(t){return this.rule({[e]:t})};l[e]=n,h[e]=t}if(p.modifiers=h,p.overrides){l._super=n,u.$_super={};for(const e in p.overrides)r(n[e],"Cannot override missing",e),p.overrides[e][i.symbols.parent]=n[e],u.$_super[e]=n[e].bind(u);Object.assign(l,p.overrides)}p.cast=Object.assign({},c.cast,p.cast);const g=Object.assign({},c.manifest,p.manifest);return g.build=s.build(p.manifest&&p.manifest.build,c.manifest&&c.manifest.build),p.manifest=g,p.rebuild=s.rebuild(p.rebuild,c.rebuild),u},s.build=function(e,t){return e&&t?function(n,r){return t(e(n,r),r)}:e||t},s.coerce=function(e,t){return e&&t?{from:e.from&&t.from?[...new Set([...e.from,...t.from])]:null,method(n,r){let o;if((!t.from||t.from.includes(typeof n))&&(o=t.method(n,r),o)){if(o.errors||void 0===o.value)return o;n=o.value}if(!e.from||e.from.includes(typeof n)){const t=e.method(n,r);if(t)return t}return o}}:e||t},s.prepare=function(e,t){return e&&t?function(n,r){const o=e(n,r);if(o){if(o.errors||void 0===o.value)return o;n=o.value}return t(n,r)||o}:e||t},s.rebuild=function(e,t){return e&&t?function(n){t(n),e(n)}:e||t},s.validate=function(e,t){return e&&t?function(n,r){const o=t(n,r);if(o){if(o.errors&&(!Array.isArray(o.errors)||o.errors.length))return o;n=o.value}return e(n,r)||o}:e||t}},function(e,t,n){"use strict";const r=n(16),o=n(58),i=n(22),a=n(176),s=n(107),l=n(123);let u;const p={};t.describe=function(e){const t=e._definition,n={type:e.type,flags:{},rules:[]};for(const t in e._flags)"_"!==t[0]&&(n.flags[t]=p.describe(e._flags[t]));Object.keys(n.flags).length||delete n.flags,e._preferences&&(n.preferences=o(e._preferences,{shallow:["messages"]}),delete n.preferences[i.symbols.prefs],n.preferences.messages&&(n.preferences.messages=a.decompile(n.preferences.messages))),e._valids&&(n.allow=e._valids.describe()),e._invalids&&(n.invalid=e._invalids.describe());for(const r of e._rules){if(!1===t.rules[r.name].manifest)continue;const e={name:r.name};for(const n in t.modifiers)void 0!==r[n]&&(e[n]=p.describe(r[n]));if(r.args){e.args={};for(const t in r.args){const n=r.args[t];("options"!==t||Object.keys(n).length)&&(e.args[t]=p.describe(n,{assign:t}))}Object.keys(e.args).length||delete e.args}n.rules.push(e)}n.rules.length||delete n.rules;for(const o in e.$_terms){if("_"===o[0])continue;r(!n[o],"Cannot describe schema due to internal name conflict with",o);const a=e.$_terms[o];if(!a)continue;if(a instanceof Map){a.size&&(n[o]=[...a.entries()]);continue}if(i.isValues(a)){n[o]=a.describe();continue}r(t.terms[o],"Term",o,"missing configuration");const s=t.terms[o].manifest,l="object"==typeof s;if(!a.length&&!l)continue;const u=[];for(const e of a)u.push(p.describe(e));if(l){const{from:e,to:t}=s.mapped;n[o]={};for(const r of u)n[o][r[t]]=r[e]}else"single"!==s?n[o]=u:(r(1===u.length,"Term",o,"contains more than one item"),n[o]=u[0])}return p.validate(e.$_root,n),n},p.describe=function(e,t={}){if(Array.isArray(e))return e.map(p.describe);if(e===i.symbols.deepDefault)return{special:"deep"};if("object"!=typeof e||null===e)return e;if("options"===t.assign)return o(e);if(Buffer&&Buffer.isBuffer(e))return{buffer:e.toString("binary")};if(e instanceof Date)return e.toISOString();if(e instanceof Error)return e;if(e instanceof RegExp)return"regex"===t.assign?e.toString():{regex:e.toString()};if(e[i.symbols.literal])return{function:e.literal};if("function"==typeof e.describe)return"ref"===t.assign?e.describe().ref:e.describe();const n={};for(const t in e){const r=e[t];void 0!==r&&(n[t]=p.describe(r,{assign:t}))}return n},t.build=function(e,t){return new p.Builder(e).parse(t)},p.Builder=class{constructor(e){this.joi=e}parse(e){p.validate(this.joi,e);let t=this.joi[e.type]()._bare();const n=t._definition;if(e.flags)for(const o in e.flags){const i=n.flags[o]&&n.flags[o].setter||o;r("function"==typeof t[i],"Invalid flag",o,"for type",e.type),t=t[i](this.build(e.flags[o]))}if(e.preferences&&(t=t.preferences(this.build(e.preferences))),e.allow&&(t=t.allow(...this.build(e.allow))),e.invalid&&(t=t.invalid(...this.build(e.invalid))),e.rules)for(const o of e.rules){r("function"==typeof t[o.name],"Invalid rule",o.name,"for type",e.type);const i=[];if(o.args){const t={};for(const e in o.args)t[e]=this.build(o.args[e],{assign:e});const a=Object.keys(t),s=n.rules[o.name].args;if(s){r(a.length<=s.length,"Invalid number of arguments for",e.type,o.name,"(expected up to",s.length,", found",a.length,")");for(const{name:e}of s)i.push(t[e])}else r(1===a.length,"Invalid number of arguments for",e.type,o.name,"(expected up to 1, found",a.length,")"),i.push(t[a[0]])}t=t[o.name](...i);const a={};for(const e in n.modifiers)void 0!==o[e]&&(a[e]=this.build(o[e]));Object.keys(a).length&&(t=t.rule(a))}const o={};for(const t in e){if(["allow","flags","invalid","whens","preferences","rules","type"].includes(t))continue;r(n.terms[t],"Term",t,"missing configuration");const i=n.terms[t].manifest;if("schema"!==i)if("values"!==i)if("single"!==i)if("object"!=typeof i)o[t]=this.build(e[t]);else{o[t]={};for(const n in e[t]){const r=e[t][n];o[t][n]=this.parse(r)}}else o[t]=this.build(e[t]);else o[t]=e[t].map(e=>this.build(e));else o[t]=e[t].map(e=>this.parse(e))}return e.whens&&(o.whens=e.whens.map(e=>this.build(e))),t=n.manifest.build(t,o),t.$_temp.ruleset=!1,t}build(e,t={}){if(null===e)return null;if(Array.isArray(e))return e.map(e=>this.build(e));if(e instanceof Error)return e;if("options"===t.assign)return o(e);if("regex"===t.assign)return p.regex(e);if("ref"===t.assign)return s.build(e);if("object"!=typeof e)return e;if(1===Object.keys(e).length){if(e.buffer)return r(Buffer,"Buffers are not supported"),Buffer&&Buffer.from(e.buffer,"binary");if(e.function)return{[i.symbols.literal]:!0,literal:e.function};if(e.override)return i.symbols.override;if(e.ref)return s.build(e.ref);if(e.regex)return p.regex(e.regex);if(e.special)return r(["deep"].includes(e.special),"Unknown special value",e.special),i.symbols.deepDefault;if(e.value)return o(e.value)}if(e.type)return this.parse(e);if(e.template)return l.build(e);const n={};for(const t in e)n[t]=this.build(e[t],{assign:t});return n}},p.regex=function(e){const t=e.lastIndexOf("/"),n=e.slice(1,t),r=e.slice(t+1);return new RegExp(n,r)},p.validate=function(e,t){u=u||n(347),e.assert(t,u.description)}},function(e,t,n){"use strict";const r=n(234),o=n(1330),i=n(106),a={codes:{error:1,pass:2,full:3},labels:{0:"never used",1:"always error",2:"always pass"}};t.setup=function(e){const t=function(){return e._tracer=e._tracer||new a.Tracer,e._tracer};e.trace=t,e[Symbol.for("@hapi/lab/coverage/initialize")]=t,e.untrace=()=>{e._tracer=null}},t.location=function(e){return e.$_setFlag("_tracerLocation",o.location(2))},a.Tracer=class{constructor(){this.name="Joi",this._schemas=new Map}_register(e){const t=this._schemas.get(e);if(t)return t.store;const n=new a.Store(e),{filename:r,line:i}=e._flags._tracerLocation||o.location(5);return this._schemas.set(e,{filename:r,line:i,store:n}),n}_combine(e,t){for(const{store:n}of this._schemas.values())n._combine(e,t)}report(e){const t=[];for(const{filename:n,line:r,store:o}of this._schemas.values()){if(e&&e!==n)continue;const i=[],s=[];for(const[e,t]of o._sources.entries()){if(a.sub(t.paths,s))continue;if(!t.entry){i.push({status:"never reached",paths:[...t.paths]}),s.push(...t.paths);continue}for(const n of["valid","invalid"]){const r=e[`_${n}s`];if(!r)continue;const o=new Set(r._values),a=new Set(r._refs);for(const{value:e,ref:r}of t[n])o.delete(e),a.delete(r);(o.size||a.size)&&i.push({status:[...o,...[...a].map(e=>e.display)],rule:n+"s"})}const n=e._rules.map(e=>e.name);for(const t of["default","failover"])void 0!==e._flags[t]&&n.push(t);for(const e of n){const n=a.labels[t.rule[e]||0];if(n){const r={rule:e,status:n};t.paths.size&&(r.paths=[...t.paths]),i.push(r)}}}i.length&&t.push({filename:n,line:r,missing:i,severity:"error",message:"Schema missing tests for "+i.map(a.message).join(", ")})}return t.length?t:null}},a.Store=class{constructor(e){this.active=!0,this._sources=new Map,this._combos=new Map,this._scan(e)}debug(e,t,n,r){e.mainstay.debug&&e.mainstay.debug.push({type:t,name:n,result:r,path:e.path})}entry(e,t){a.debug(t,{type:"entry"}),this._record(e,e=>{e.entry=!0})}filter(e,t,n,r){a.debug(t,{type:n,...r}),this._record(e,e=>{e[n].add(r)})}log(e,t,n,r,o){a.debug(t,{type:n,name:r,result:"full"===o?"pass":o}),this._record(e,e=>{e[n][r]=e[n][r]||0,e[n][r]|=a.codes[o]})}resolve(e,t,n){if(!e.mainstay.debug)return;const r={type:"resolve",ref:t.display,to:n,path:e.path};e.mainstay.debug.push(r)}value(e,t,n,o,i){if(!e.mainstay.debug||r(n,o))return;const a={type:"value",by:t,from:n,to:o,path:e.path};i&&(a.name=i),e.mainstay.debug.push(a)}_record(e,t){const n=this._sources.get(e);if(n)return void t(n);const r=this._combos.get(e);for(const e of r)this._record(e,t)}_scan(e,t){const n=t||[];let r=this._sources.get(e);r||(r={paths:new Set,entry:!1,rule:{},valid:new Set,invalid:new Set},this._sources.set(e,r)),n.length&&r.paths.add(n);e.$_modify({each:(e,t)=>{const r=a.id(e,t);this._scan(e,n.concat(r))},ref:!1})}_combine(e,t){this._combos.set(e,t)}},a.message=function(e){return`${e.paths?i.path(e.paths[0])+(e.rule?":":""):""}${e.rule||""} (${e.status})`},a.id=function(e,{source:t,name:n,path:r,key:o}){return e._flags.id?e._flags.id:o||(n="@"+n,"terms"===t?[n,r[Math.min(r.length-1,1)]]:n)},a.sub=function(e,t){for(const n of e)for(const e of t)if(r(n.slice(0,e.length),e))return!0;return!1},a.debug=function(e,t){e.mainstay.debug&&(t.path=e.debug?[...e.path,e.debug]:e.path,e.mainstay.debug.push(t))}},function(e,t,n){"use strict";const r=n(16),o=n(234),i=n(22),a={};e.exports=a.Values=class{constructor(e,t){this._values=new Set(e),this._refs=new Set(t),this._lowercase=a.lowercases(e),this._override=!1}get length(){return this._values.size+this._refs.size}add(e,t){i.isResolvable(e)?this._refs.has(e)||(this._refs.add(e),t&&t.register(e)):this.has(e,null,null,!1)||(this._values.add(e),"string"==typeof e&&this._lowercase.set(e.toLowerCase(),e))}static merge(e,t,n){if(e=e||new a.Values,t){if(t._override)return t.clone();for(const n of[...t._values,...t._refs])e.add(n)}if(n)for(const t of[...n._values,...n._refs])e.remove(t);return e.length?e:null}remove(e){i.isResolvable(e)?this._refs.delete(e):(this._values.delete(e),"string"==typeof e&&this._lowercase.delete(e.toLowerCase()))}has(e,t,n,r){return!!this.get(e,t,n,r)}get(e,t,n,r){if(!this.length)return!1;if(this._values.has(e))return{value:e};if("string"==typeof e&&e&&r){const t=this._lowercase.get(e.toLowerCase());if(t)return{value:t}}if(!this._refs.size&&"object"!=typeof e)return!1;if("object"==typeof e)for(const t of this._values)if(o(t,e))return{value:t};if(t)for(const i of this._refs){const a=i.resolve(e,t,n,null,{in:!0});if(void 0===a)continue;const s=i.in&&"object"==typeof a?Array.isArray(a)?a:Object.keys(a):[a];for(const t of s)if(typeof t==typeof e)if(r&&e&&"string"==typeof e){if(t.toLowerCase()===e.toLowerCase())return{value:t,ref:i}}else if(o(t,e))return{value:t,ref:i}}return!1}override(){this._override=!0}values(e){if(e&&e.display){const e=[];for(const t of[...this._values,...this._refs])void 0!==t&&e.push(t);return e}return Array.from([...this._values,...this._refs])}clone(){const e=new a.Values(this._values,this._refs);return e._override=this._override,e}concat(e){r(!e._override,"Cannot concat override set of values");const t=new a.Values([...this._values,...e._values],[...this._refs,...e._refs]);return t._override=this._override,t}describe(){const e=[];this._override&&e.push({override:!0});for(const t of this._values.values())e.push(t&&"object"==typeof t?{value:t}:t);for(const t of this._refs.values())e.push(t.describe());return e}},a.Values.prototype[i.symbols.values]=!0,a.Values.prototype.slice=a.Values.prototype.clone,a.lowercases=function(e){const t=new Map;if(e)for(const n of e)"string"==typeof n&&t.set(n.toLowerCase(),n);return t}},function(e,t,n){"use strict";const r=n(1341),o=n(16),i=n(58),a=n(1342),s=n(79),l=n(22),u=n(149),p=n(106),c=n(107),d=n(123),f={renameDefaults:{alias:!1,multiple:!1,override:!1}};e.exports=s.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:!1}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(e,t)=>e.keys(t),validate(e,{schema:t,error:n,state:r,prefs:o}){if(!e||typeof e!==t.$_property("typeof")||Array.isArray(e))return{value:e,errors:n("object.base",{type:t.$_property("typeof")})};if(!(t.$_terms.renames||t.$_terms.dependencies||t.$_terms.keys||t.$_terms.patterns||t.$_terms.externals))return;e=f.clone(e,o);const i=[];if(t.$_terms.renames&&!f.rename(t,e,r,o,i))return{value:e,errors:i};if(!t.$_terms.keys&&!t.$_terms.patterns&&!t.$_terms.dependencies)return{value:e,errors:i};const a=new Set(Object.keys(e));if(t.$_terms.keys){const n=[e,...r.ancestors];for(const s of t.$_terms.keys){const t=s.key,l=e[t];a.delete(t);const u=r.localize([...r.path,t],n,s),p=s.schema.$_validate(l,u,o);if(p.errors){if(o.abortEarly)return{value:e,errors:p.errors};void 0!==p.value&&(e[t]=p.value),i.push(...p.errors)}else"strip"===s.schema._flags.result||void 0===p.value&&void 0!==l?delete e[t]:void 0!==p.value&&(e[t]=p.value)}}if(a.size||t._flags._hasPatternMatch){const n=f.unknown(t,e,a,i,r,o);if(n)return n}if(t.$_terms.dependencies)for(const n of t.$_terms.dependencies){if(n.key&&void 0===n.key.resolve(e,r,o,null,{shadow:!1}))continue;const a=f.dependencies[n.rel](t,n,e,r,o);if(a){const n=t.$_createError(a.code,e,a.context,r,o);if(o.abortEarly)return{value:e,errors:n};i.push(n)}}return{value:e,errors:i}},rules:{and:{method(...e){return l.verifyFlat(e,"and"),f.dependency(this,"and",null,e)}},append:{method(e){return null==e||0===Object.keys(e).length?this:this.keys(e)}},assert:{method(e,t,n){d.isTemplate(e)||(e=u.ref(e)),o(void 0===n||"string"==typeof n,"Message must be a string"),t=this.$_compile(t,{appendPath:!0});const r=this.$_addRule({name:"assert",args:{subject:e,schema:t,message:n}});return r.$_mutateRegister(e),r.$_mutateRegister(t),r},validate(e,{error:t,prefs:n,state:r},{subject:o,schema:i,message:a}){const s=o.resolve(e,r,n),l=c.isRef(o)?o.absolute(r):[];return i.$_match(s,r.localize(l,[e,...r.ancestors],i),n)?e:t("object.assert",{subject:o,message:a})},args:["subject","schema","message"],multi:!0},instance:{method(e,t){return o("function"==typeof e,"constructor must be a function"),t=t||e.name,this.$_addRule({name:"instance",args:{constructor:e,name:t}})},validate:(e,t,{constructor:n,name:r})=>e instanceof n?e:t.error("object.instance",{type:r,value:e}),args:["constructor","name"]},keys:{method(e){o(void 0===e||"object"==typeof e,"Object schema must be a valid object"),o(!l.isSchema(e),"Object schema cannot be a joi schema");const t=this.clone();if(e)if(Object.keys(e).length){t.$_terms.keys=t.$_terms.keys?t.$_terms.keys.filter(t=>!e.hasOwnProperty(t.key)):new f.Keys;for(const n in e)l.tryWithPath(()=>t.$_terms.keys.push({key:n,schema:this.$_compile(e[n])}),n)}else t.$_terms.keys=new f.Keys;else t.$_terms.keys=null;return t.$_mutateRebuild()}},length:{method(e){return this.$_addRule({name:"length",args:{limit:e},operator:"="})},validate:(e,t,{limit:n},{name:r,operator:o,args:i})=>l.compare(Object.keys(e).length,n,o)?e:t.error("object."+r,{limit:i.limit,value:e}),args:[{name:"limit",ref:!0,assert:l.limit,message:"must be a positive integer"}]},max:{method(e){return this.$_addRule({name:"max",method:"length",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"length",args:{limit:e},operator:">="})}},nand:{method(...e){return l.verifyFlat(e,"nand"),f.dependency(this,"nand",null,e)}},or:{method(...e){return l.verifyFlat(e,"or"),f.dependency(this,"or",null,e)}},oxor:{method(...e){return f.dependency(this,"oxor",null,e)}},pattern:{method(e,t,n={}){const r=e instanceof RegExp;r||(e=this.$_compile(e,{appendPath:!0})),o(void 0!==t,"Invalid rule"),l.assertOptions(n,["fallthrough","matches"]),r&&o(!e.flags.includes("g")&&!e.flags.includes("y"),"pattern should not use global or sticky mode"),t=this.$_compile(t,{appendPath:!0});const i=this.clone();i.$_terms.patterns=i.$_terms.patterns||[];const a={[r?"regex":"schema"]:e,rule:t};return n.matches&&(a.matches=this.$_compile(n.matches),"array"!==a.matches.type&&(a.matches=a.matches.$_root.array().items(a.matches)),i.$_mutateRegister(a.matches),i.$_setFlag("_hasPatternMatch",!0,{clone:!1})),n.fallthrough&&(a.fallthrough=!0),i.$_terms.patterns.push(a),i.$_mutateRegister(t),i}},ref:{method(){return this.$_addRule("ref")},validate:(e,t)=>c.isRef(e)?e:t.error("object.refType",{value:e})},regex:{method(){return this.$_addRule("regex")},validate:(e,t)=>e instanceof RegExp?e:t.error("object.regex",{value:e})},rename:{method(e,t,n={}){o("string"==typeof e||e instanceof RegExp,"Rename missing the from argument"),o("string"==typeof t||t instanceof d,"Invalid rename to argument"),o(t!==e,"Cannot rename key to same name:",e),l.assertOptions(n,["alias","ignoreUndefined","override","multiple"]);const i=this.clone();i.$_terms.renames=i.$_terms.renames||[];for(const t of i.$_terms.renames)o(t.from!==e,"Cannot rename the same key multiple times");return t instanceof d&&i.$_mutateRegister(t),i.$_terms.renames.push({from:e,to:t,options:r(f.renameDefaults,n)}),i}},schema:{method(e="any"){return this.$_addRule({name:"schema",args:{type:e}})},validate:(e,t,{type:n})=>!l.isSchema(e)||"any"!==n&&e.type!==n?t.error("object.schema",{type:n}):e},unknown:{method(e){return this.$_setFlag("unknown",!1!==e)}},with:{method(e,t,n={}){return f.dependency(this,"with",e,t,n)}},without:{method(e,t,n={}){return f.dependency(this,"without",e,t,n)}},xor:{method(...e){return l.verifyFlat(e,"xor"),f.dependency(this,"xor",null,e)}}},overrides:{default(e,t){return void 0===e&&(e=l.symbols.deepDefault),this.$_parent("default",e,t)}},rebuild(e){if(e.$_terms.keys){const t=new a.Sorter;for(const n of e.$_terms.keys)l.tryWithPath(()=>t.add(n,{after:n.schema.$_rootReferences(),group:n.key}),n.key);e.$_terms.keys=new f.Keys(...t.nodes)}},manifest:{build(e,t){if(t.keys&&(e=e.keys(t.keys)),t.dependencies)for(const{rel:n,key:r=null,peers:o,options:i}of t.dependencies)e=f.dependency(e,n,r,o,i);if(t.patterns)for(const{regex:n,schema:r,rule:o,fallthrough:i,matches:a}of t.patterns)e=e.pattern(n||r,o,{fallthrough:i,matches:a});if(t.renames)for(const{from:n,to:r,options:o}of t.renames)e=e.rename(n,r,o);return e}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),f.clone=function(e,t){if("object"==typeof e){if(t.nonEnumerables)return i(e,{shallow:!0});const n=Object.create(Object.getPrototypeOf(e));return Object.assign(n,e),n}const n=function(...t){return e.apply(this,t)};return n.prototype=i(e.prototype),Object.defineProperty(n,"name",{value:e.name,writable:!1}),Object.defineProperty(n,"length",{value:e.length,writable:!1}),Object.assign(n,e),n},f.dependency=function(e,t,n,r,i){o(null===n||"string"==typeof n,t,"key must be a strings"),i||(i=r.length>1&&"object"==typeof r[r.length-1]?r.pop():{}),l.assertOptions(i,["separator"]),r=[].concat(r);const a=l.default(i.separator,"."),s=[];for(const e of r)o("string"==typeof e,t,"peers must be strings"),s.push(u.ref(e,{separator:a,ancestor:0,prefix:!1}));null!==n&&(n=u.ref(n,{separator:a,ancestor:0,prefix:!1}));const p=e.clone();return p.$_terms.dependencies=p.$_terms.dependencies||[],p.$_terms.dependencies.push(new f.Dependency(t,n,s,r)),p},f.dependencies={and(e,t,n,r,o){const i=[],a=[],s=t.peers.length;for(const e of t.peers)void 0===e.resolve(n,r,o,null,{shadow:!1})?i.push(e.key):a.push(e.key);if(i.length!==s&&a.length!==s)return{code:"object.and",context:{present:a,presentWithLabels:f.keysToLabels(e,a),missing:i,missingWithLabels:f.keysToLabels(e,i)}}},nand(e,t,n,r,o){const i=[];for(const e of t.peers)void 0!==e.resolve(n,r,o,null,{shadow:!1})&&i.push(e.key);if(i.length!==t.peers.length)return;const a=t.paths[0],s=t.paths.slice(1);return{code:"object.nand",context:{main:a,mainWithLabel:f.keysToLabels(e,a),peers:s,peersWithLabels:f.keysToLabels(e,s)}}},or(e,t,n,r,o){for(const e of t.peers)if(void 0!==e.resolve(n,r,o,null,{shadow:!1}))return;return{code:"object.missing",context:{peers:t.paths,peersWithLabels:f.keysToLabels(e,t.paths)}}},oxor(e,t,n,r,o){const i=[];for(const e of t.peers)void 0!==e.resolve(n,r,o,null,{shadow:!1})&&i.push(e.key);if(!i.length||1===i.length)return;const a={peers:t.paths,peersWithLabels:f.keysToLabels(e,t.paths)};return a.present=i,a.presentWithLabels=f.keysToLabels(e,i),{code:"object.oxor",context:a}},with(e,t,n,r,o){for(const i of t.peers)if(void 0===i.resolve(n,r,o,null,{shadow:!1}))return{code:"object.with",context:{main:t.key.key,mainWithLabel:f.keysToLabels(e,t.key.key),peer:i.key,peerWithLabel:f.keysToLabels(e,i.key)}}},without(e,t,n,r,o){for(const i of t.peers)if(void 0!==i.resolve(n,r,o,null,{shadow:!1}))return{code:"object.without",context:{main:t.key.key,mainWithLabel:f.keysToLabels(e,t.key.key),peer:i.key,peerWithLabel:f.keysToLabels(e,i.key)}}},xor(e,t,n,r,o){const i=[];for(const e of t.peers)void 0!==e.resolve(n,r,o,null,{shadow:!1})&&i.push(e.key);if(1===i.length)return;const a={peers:t.paths,peersWithLabels:f.keysToLabels(e,t.paths)};return 0===i.length?{code:"object.missing",context:a}:(a.present=i,a.presentWithLabels=f.keysToLabels(e,i),{code:"object.xor",context:a})}},f.keysToLabels=function(e,t){return Array.isArray(t)?t.map(t=>e.$_mapLabels(t)):e.$_mapLabels(t)},f.rename=function(e,t,n,r,o){const i={};for(const a of e.$_terms.renames){const s=[],l="string"!=typeof a.from;if(l)for(const e in t){if(void 0===t[e]&&a.options.ignoreUndefined)continue;if(e===a.to)continue;const n=a.from.exec(e);n&&s.push({from:e,to:a.to,match:n})}else!Object.prototype.hasOwnProperty.call(t,a.from)||void 0===t[a.from]&&a.options.ignoreUndefined||s.push(a);for(const u of s){const s=u.from;let p=u.to;if(p instanceof d&&(p=p.render(t,n,r,u.match)),s!==p){if(!a.options.multiple&&i[p]&&(o.push(e.$_createError("object.rename.multiple",t,{from:s,to:p,pattern:l},n,r)),r.abortEarly))return!1;if(Object.prototype.hasOwnProperty.call(t,p)&&!a.options.override&&!i[p]&&(o.push(e.$_createError("object.rename.override",t,{from:s,to:p,pattern:l},n,r)),r.abortEarly))return!1;void 0===t[s]?delete t[p]:t[p]=t[s],i[p]=!0,a.options.alias||delete t[s]}}}return!0},f.unknown=function(e,t,n,r,o,i){if(e.$_terms.patterns){let a=!1;const s=e.$_terms.patterns.map(e=>{if(e.matches)return a=!0,[]}),l=[t,...o.ancestors];for(const a of n){const u=t[a],p=[...o.path,a];for(let c=0;c<e.$_terms.patterns.length;++c){const d=e.$_terms.patterns[c];if(d.regex){const e=d.regex.test(a);if(o.mainstay.tracer.debug(o,"rule","pattern."+c,e?"pass":"error"),!e)continue}else if(!d.schema.$_match(a,o.nest(d.schema,"pattern."+c),i))continue;n.delete(a);const f=o.localize(p,l,{schema:d.rule,key:a}),h=d.rule.$_validate(u,f,i);if(h.errors){if(i.abortEarly)return{value:t,errors:h.errors};r.push(...h.errors)}if(d.matches&&s[c].push(a),t[a]=h.value,!d.fallthrough)break}}if(a)for(let n=0;n<s.length;++n){const a=s[n];if(!a)continue;const u=e.$_terms.patterns[n].matches,c=o.localize(o.path,l,u),d=u.$_validate(a,c,i);if(d.errors){const n=p.details(d.errors,{override:!1});n.matches=a;const s=e.$_createError("object.pattern.match",t,n,o,i);if(i.abortEarly)return{value:t,errors:s};r.push(s)}}}if(!n.size||!e.$_terms.keys&&!e.$_terms.patterns)return;if(i.stripUnknown&&!e._flags.unknown||i.skipFunctions){const e=!!i.stripUnknown&&(!0===i.stripUnknown||!!i.stripUnknown.objects);for(const r of n)e?(delete t[r],n.delete(r)):"function"==typeof t[r]&&n.delete(r)}if(!l.default(e._flags.unknown,i.allowUnknown))for(const a of n){const n=o.localize([...o.path,a],[]),s=e.$_createError("object.unknown",t[a],{child:a},n,i,{flags:!1});if(i.abortEarly)return{value:t,errors:s};r.push(s)}},f.Dependency=class{constructor(e,t,n,r){this.rel=e,this.key=t,this.peers=n,this.paths=r}describe(){const e={rel:this.rel,peers:this.paths};return null!==this.key&&(e.key=this.key.key),"."!==this.peers[0].separator&&(e.options={separator:this.peers[0].separator}),e}},f.Keys=class extends Array{concat(e){const t=this.slice(),n=new Map;for(let e=0;e<t.length;++e)n.set(t[e].key,e);for(const r of e){const e=r.key,o=n.get(e);void 0!==o?t[o]={key:e,schema:t[o].schema.concat(r.schema)}:t.push(r)}return t}}},function(e,t,n){"use strict";const r=n(30),o=n(697),i={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:r.URL||URL};t.analyze=function(e,t={}){if(!e)return o.code("DOMAIN_NON_EMPTY_STRING");if("string"!=typeof e)throw new Error("Invalid input: domain must be a string");if(e.length>256)return o.code("DOMAIN_TOO_LONG");if(!!i.nonAsciiRx.test(e)){if(!1===t.allowUnicode)return o.code("DOMAIN_INVALID_UNICODE_CHARS");e=e.normalize("NFC")}if(i.domainControlRx.test(e))return o.code("DOMAIN_INVALID_CHARS");e=i.punycode(e),t.allowFullyQualified&&"."===e[e.length-1]&&(e=e.slice(0,-1));const n=t.minDomainSegments||i.minDomainSegments,r=e.split(".");if(r.length<n)return o.code("DOMAIN_SEGMENTS_COUNT");if(t.maxDomainSegments&&r.length>t.maxDomainSegments)return o.code("DOMAIN_SEGMENTS_COUNT_MAX");const a=t.tlds;if(a){const e=r[r.length-1].toLowerCase();if(a.deny&&a.deny.has(e)||a.allow&&!a.allow.has(e))return o.code("DOMAIN_FORBIDDEN_TLDS")}for(let e=0;e<r.length;++e){const t=r[e];if(!t.length)return o.code("DOMAIN_EMPTY_SEGMENT");if(t.length>63)return o.code("DOMAIN_LONG_SEGMENT");if(e<r.length-1){if(!i.domainSegmentRx.test(t))return o.code("DOMAIN_INVALID_CHARS")}else if(!i.tldSegmentRx.test(t))return o.code("DOMAIN_INVALID_TLDS_CHARS")}return null},t.isValid=function(e,n){return!t.analyze(e,n)},i.punycode=function(e){e.includes("%")&&(e=e.replace(/%/g,"%25"));try{return new i.URL("http://"+e).host}catch(t){return e}}},function(e,t,n){"use strict";t.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"},t.code=function(e){return{code:e,error:t.codes[e]}}},function(e,t,n){"use strict";const r=n(16),o=n(699),i={generate:function(){const e={},t="!\\$&'\\(\\)\\*\\+,;=",n="\\w-\\.~%\\dA-Fa-f"+t+":@",r="["+n+"]",o="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";e.ipv4address="(?:"+o+"\\.){3}"+o;const i="[\\dA-Fa-f]{1,4}",a="(?:"+i+":"+i+"|"+e.ipv4address+")",s="(?:"+i+":){6}"+a,l="::(?:"+i+":){5}"+a,u="(?:"+i+")?::(?:"+i+":){4}"+a,p="(?:(?:"+i+":){0,1}"+i+")?::(?:"+i+":){3}"+a,c="(?:(?:"+i+":){0,2}"+i+")?::(?:"+i+":){2}"+a,d="(?:(?:"+i+":){0,3}"+i+")?::"+i+":"+a,f="(?:(?:"+i+":){0,4}"+i+")?::"+a;e.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",e.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",e.ipv6address="(?:"+s+"|"+l+"|"+u+"|"+p+"|"+c+"|"+d+"|"+f+"|(?:(?:[\\dA-Fa-f]{1,4}:){0,5}[\\dA-Fa-f]{1,4})?::[\\dA-Fa-f]{1,4}|(?:(?:[\\dA-Fa-f]{1,4}:){0,6}[\\dA-Fa-f]{1,4})?::)",e.ipvFuture="v[\\dA-Fa-f]+\\.[\\w-\\.~"+t+":]+",e.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",e.schemeRegex=new RegExp(e.scheme);const h="[\\w-\\.~%\\dA-Fa-f"+t+":]*",g="(?:"+("\\[(?:"+e.ipv6address+"|"+e.ipvFuture+")\\]")+"|"+e.ipv4address+"|[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=]{1,255})",m="(?:"+h+"@)?"+g+"(?::\\d*)?",y="(?:"+h+"@)?("+g+")(?::\\d*)?",v=r+"*",b=r+"+",_="(?:\\/"+v+")*",T="\\/(?:"+b+_+")?",E=b+_,S="[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=@]+"+_;return e.hierPart="(?:(?:\\/\\/"+m+_+")|"+T+"|"+E+"|(?:\\/\\/\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*))",e.hierPartCapture="(?:(?:\\/\\/"+y+_+")|"+T+"|"+E+")",e.relativeRef="(?:(?:\\/\\/"+m+_+")|"+T+"|"+S+"|)",e.relativeRefCapture="(?:(?:\\/\\/"+y+_+")|"+T+"|"+S+"|)",e.query="["+n+"\\/\\?]*(?=#|$)",e.queryWithSquareBrackets="["+n+"\\[\\]\\/\\?]*(?=#|$)",e.fragment="["+n+"\\/\\?]*",e}};i.rfc3986=i.generate(),t.ip={v4Cidr:i.rfc3986.ipv4Cidr,v6Cidr:i.rfc3986.ipv6Cidr,ipv4:i.rfc3986.ipv4address,ipv6:i.rfc3986.ipv6address,ipvfuture:i.rfc3986.ipvFuture},i.createRegex=function(e){const t=i.rfc3986,n="(?:\\?"+(e.allowQuerySquareBrackets?t.queryWithSquareBrackets:t.query)+")?(?:#"+t.fragment+")?",a=e.domain?t.relativeRefCapture:t.relativeRef;if(e.relativeOnly)return i.wrap(a+n);let s="";if(e.scheme){r(e.scheme instanceof RegExp||"string"==typeof e.scheme||Array.isArray(e.scheme),"scheme must be a RegExp, String, or Array");const n=[].concat(e.scheme);r(n.length>=1,"scheme must have at least 1 scheme specified");const i=[];for(let e=0;e<n.length;++e){const a=n[e];r(a instanceof RegExp||"string"==typeof a,"scheme at position "+e+" must be a RegExp or String"),a instanceof RegExp?i.push(a.source.toString()):(r(t.schemeRegex.test(a),"scheme at position "+e+" must be a valid scheme"),i.push(o(a)))}s=i.join("|")}const l="(?:"+(s?"(?:"+s+")":t.scheme)+":"+(e.domain?t.hierPartCapture:t.hierPart)+")",u=e.allowRelative?"(?:"+l+"|"+a+")":l;return i.wrap(u+n,s)},i.wrap=function(e,t){return{raw:e="(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])"+e,regex:new RegExp(`^${e}$`),scheme:t}},i.uriRegex=i.createRegex({}),t.regex=function(e={}){return e.scheme||e.allowRelative||e.relativeOnly||e.allowQuerySquareBrackets||e.domain?i.createRegex(e):i.uriRegex}},function(e,t,n){"use strict";e.exports=function(e){return e.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},function(e,t,n){const r=n(9),o=n(17),i=n(1358),a=n(1359),s=n(1368),l=n(1375);e.exports=i(e=>{const t=r.join(e,"db");o.existsSync(t)||o.mkdirSync(t,{recursive:!0});return{account:new a(t),certificate:new s(t),httpChallenge:new l(t)}})},function(e,t,n){const r=n(498),o=n(1363);e.exports=e=>{const t=r.socket("req");return t.connect(e),o.create(t)}},function(e,t){t.endsWithCallback=function(e){return e&&e.length>0&&"function"==typeof e[e.length-1]},t.execCursor=function(e,t,n){const{sort:r,skip:o,limit:i,projection:a,findArgs:s}=e;t.find(...s).sort(r).skip(o).limit(i).projection(a).exec(n)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8),o=n(20),i=n(59),a=n(704),s=n(352);t.publicKeyValidator={name:"PublicKeyInfo",class:a.Class.UNIVERSAL,tag:a.Tag.SEQUENCE,capture:"publicKeyInfo",value:[{name:"PublicKeyInfo.AlgorithmIdentifier",class:a.Class.UNIVERSAL,tag:a.Tag.SEQUENCE,value:[{name:"PublicKeyAlgorithmIdentifier.algorithm",class:a.Class.UNIVERSAL,tag:a.Tag.OID,capture:"publicKeyOID"}]},{name:"PublicKeyInfo.PublicKey",class:a.Class.UNIVERSAL,tag:a.Tag.BITSTRING,capture:"publicKey"}]},t.privateKeyValidator={name:"PrivateKeyInfo",class:a.Class.UNIVERSAL,tag:a.Tag.SEQUENCE,capture:"privateKeyInfo",value:[{name:"PrivateKeyInfo.Version",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.AlgorithmIdentifier",class:a.Class.UNIVERSAL,tag:a.Tag.SEQUENCE,value:[{name:"PrivateKeyAlgorithmIdentifier.algorithm",class:a.Class.UNIVERSAL,tag:a.Tag.OID,capture:"privateKeyOID"}]},{name:"PrivateKeyInfo.PrivateKey",class:a.Class.UNIVERSAL,tag:a.Tag.OCTETSTRING,capture:"privateKey"}]};const l={name:"RSAPublicKey",class:a.Class.UNIVERSAL,tag:a.Tag.SEQUENCE,value:[{name:"RSAPublicKey.modulus",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"publicKeyExponent"}]},u={name:"RSAPrivateKey",class:a.Class.UNIVERSAL,tag:a.Tag.SEQUENCE,value:[{name:"RSAPrivateKey.version",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",class:a.Class.UNIVERSAL,tag:a.Tag.INTEGER,capture:"privateKeyCoefficient"}]},p=[s.getOID("X25519"),s.getOID("X448"),s.getOID("Ed25519"),s.getOID("Ed448")];class c{constructor(e){const n={},r=e.validate(t.publicKeyValidator,n);if(null!=r)throw new Error("Cannot read X.509 public key: "+r.message);this.oid=a.ASN1.parseOID(n.publicKeyOID.bytes),this.algo=s.getOIDName(this.oid),this._pkcs8=e,this._keyRaw=a.ASN1.parseBitString(n.publicKey.bytes).buf,this._finalKey=this._keyRaw,this._finalPEM=""}static fromPEM(e){const t=a.PEM.parse(e)[0];if(t.procType.includes("ENCRYPTED"))throw new Error("Could not convert public key from PEM, PEM is encrypted.");const n=a.ASN1.fromDER(t.body,!0);switch(t.type){case"PUBLIC KEY":return new c(n);case"RSA PUBLIC KEY":const e=a.ASN1.Seq([a.ASN1.Seq([a.ASN1.OID(s.getOID("rsaEncryption")),a.ASN1.Null()]),a.ASN1.BitString(n.DER)]);return new c(e);default:throw new Error("Could not convert public key from PEM, recommend PKCS#8 PEM")}}static addVerifier(e,t){if(""===(e=s.getOID(e)))throw new Error("Invalid object identifier: "+e);if(null!=c._verifiers[e])throw new Error(`Verifier ${e} exists`);c._verifiers[e]=t}get keyRaw(){return this._finalKey}verify(e,t,n){const r=c._verifiers[this.oid];if(null!=r){const i=o.createHash(n).update(e).digest();return r.call(this,i,t)}const i=o.createVerify(n);return i.update(e),i.verify(this.toPEM(),t)}getFingerprint(e,t="PublicKey"){let n;switch(t){case"PublicKeyInfo":n=this._pkcs8.DER;break;case"PublicKey":n=this._keyRaw;break;default:throw new Error(`Unknown fingerprint type "${t}".`)}const r=o.createHash(e);return r.update(n),r.digest()}toASN1(){return this._pkcs8}toDER(){return this._pkcs8.DER}toPEM(){return""===this._finalPEM&&(this._finalPEM=new a.PEM("PUBLIC KEY",this._pkcs8.DER).toString()),this._finalPEM}toJSON(){return{oid:this.oid,algo:this.algo,publicKey:this._keyRaw}}[r.inspect.custom](e,t){return`<${this.constructor.name} ${r.inspect(this.toJSON(),t)}>`}}c._verifiers=Object.create(null),t.PublicKey=c;class d{constructor(e){const n=Object.create(null),r=e.validate(t.privateKeyValidator,n);if(null!=r)throw new Error("Cannot read X.509 private key: "+r.message);if(this.version=a.ASN1.parseIntegerNum(n.privateKeyVersion.bytes)+1,this.oid=a.ASN1.parseOID(n.privateKeyOID.bytes),this.algo=s.getOIDName(this.oid),this._pkcs8=e,this._keyRaw=n.privateKey.bytes,this._publicKeyRaw=null,this._finalKey=this._keyRaw,this._finalPEM="",p.includes(this.oid))if(this._finalKey=this._keyRaw=a.ASN1.parseDER(this._keyRaw,a.Class.UNIVERSAL,a.Tag.OCTETSTRING).bytes,"1.3.101.112"===this.oid){const e=i.sign.keyPair.fromSeed(this._keyRaw);this._publicKeyRaw=Buffer.from(e.publicKey),this._finalKey=Buffer.from(e.secretKey)}else if(2===this.version)for(const t of e.mustCompound())t.class===a.Class.CONTEXT_SPECIFIC&&1===t.tag&&(this._publicKeyRaw=a.ASN1.parseBitString(t.bytes).buf,this._finalKey=Buffer.concat([this._keyRaw,this._publicKeyRaw]))}static fromPEM(e){const t=a.PEM.parse(e)[0];if(t.procType.includes("ENCRYPTED"))throw new Error("Could not convert private key from PEM, PEM is encrypted.");let n=a.ASN1.fromDER(t.body,!0);switch(t.type){case"PRIVATE KEY":return new d(n);case"RSA PRIVATE KEY":return n=a.ASN1.Seq([n.value[0],a.ASN1.Seq([a.ASN1.OID(s.getOID("rsaEncryption")),a.ASN1.Null()]),new a.ASN1(a.Class.UNIVERSAL,a.Tag.OCTETSTRING,n.DER)]),new d(n);default:throw new Error("Could not convert private key from PEM, recommend PKCS#8 PEM")}}static addSigner(e,t){if(""===(e=s.getOID(e)))throw new Error("Invalid object identifier: "+e);if(null!=d._signers[e])throw new Error(`Signer ${e} exists`);d._signers[e]=t}get keyRaw(){return this._finalKey}get publicKeyRaw(){return this._publicKeyRaw}sign(e,t){const n=d._signers[this.oid];if(null!=n){const r=o.createHash(t).update(e).digest();return n.call(this,r)}const r=o.createSign(t);return r.update(e),r.sign(this.toPEM())}toASN1(){return this._pkcs8}toDER(){return this._pkcs8.DER}toPEM(){return""===this._finalPEM&&(this._finalPEM=new a.PEM("PRIVATE KEY",this._pkcs8.DER).toString()),this._finalPEM}toJSON(){return{version:this.version,oid:this.oid,algo:this.algo,privateKey:this._keyRaw,publicKey:this._publicKeyRaw}}[r.inspect.custom](e,t){return`<${this.constructor.name} ${r.inspect(this.toJSON(),t)}>`}}d._signers=Object.create(null),t.PrivateKey=d;class f extends c{static fromPublicKey(e){return new f(e.toASN1())}constructor(e){if(super(e),s.getOID(this.oid)!==s.getOID("rsaEncryption"))throw new Error("Invalid RSA public key, unknown OID: "+this.oid);const t=Object.create(null);this._pkcs1=a.ASN1.fromDER(this._keyRaw,!0);const n=this._pkcs1.validate(l,t);if(null!=n)throw new Error("Cannot read RSA public key: "+n.message);this.modulus=a.ASN1.parseIntegerStr(t.publicKeyModulus.bytes),this.exponent=a.ASN1.parseIntegerNum(t.publicKeyExponent.bytes)}toASN1(){return this._pkcs1}toDER(){return this._keyRaw}toPEM(){return""===this._finalPEM&&(this._finalPEM=new a.PEM("RSA PUBLIC KEY",this._keyRaw).toString()),this._finalPEM}toPublicKeyPEM(){return new a.PEM("PUBLIC KEY",this._pkcs8.DER).toString()}toJSON(){return{oid:this.oid,algo:this.algo,modulus:g(this.modulus),exponent:this.exponent}}[r.inspect.custom](e,t){return`<${this.constructor.name} ${r.inspect(this.toJSON(),t)}>`}}t.RSAPublicKey=f;class h extends d{static fromPrivateKey(e){return new h(e.toASN1())}constructor(e){if(super(e),s.getOID(this.oid)!==s.getOID("rsaEncryption"))throw new Error("Invalid RSA private key, unknown OID: "+this.oid);const t=Object.create(null);this._pkcs1=a.ASN1.fromDER(this._keyRaw,!0);const n=this._pkcs1.validate(u,t);if(null!=n)throw new Error("Cannot read RSA private key: "+n.message);this.publicExponent=a.ASN1.parseIntegerNum(t.privateKeyPublicExponent.bytes),this.privateExponent=a.ASN1.parseIntegerStr(t.privateKeyPrivateExponent.bytes),this.modulus=a.ASN1.parseIntegerStr(t.privateKeyModulus.bytes),this.prime1=a.ASN1.parseIntegerStr(t.privateKeyPrime1.bytes),this.prime2=a.ASN1.parseIntegerStr(t.privateKeyPrime2.bytes),this.exponent1=a.ASN1.parseIntegerStr(t.privateKeyExponent1.bytes),this.exponent2=a.ASN1.parseIntegerStr(t.privateKeyExponent2.bytes),this.coefficient=a.ASN1.parseIntegerStr(t.privateKeyCoefficient.bytes)}toASN1(){return this._pkcs1}toDER(){return this._keyRaw}toPEM(){return""===this._finalPEM&&(this._finalPEM=new a.PEM("RSA PRIVATE KEY",this._keyRaw).toString()),this._finalPEM}toPrivateKeyPEM(){return new a.PEM("PRIVATE KEY",this._pkcs8.DER).toString()}toJSON(){return{version:this.version,oid:this.oid,algo:this.algo,publicExponent:this.publicExponent,privateExponent:g(this.privateExponent),modulus:g(this.modulus),prime1:g(this.prime1),prime2:g(this.prime2),exponent1:g(this.exponent1),exponent2:g(this.exponent2),coefficient:g(this.coefficient)}}[r.inspect.custom](e,t){return`<${this.constructor.name} ${r.inspect(this.toJSON(),t)}>`}}function g(e){return e.length%8!=0&&e.startsWith("00")?e.slice(2):e}t.RSAPrivateKey=h,c.addVerifier(s.getOID("Ed25519"),(function(e,t){return i.sign.detached.verify(e,t,this.keyRaw)})),d.addSigner(s.getOID("Ed25519"),(function(e){const t=this.keyRaw;if(64!==t.length)throw new Error("Invalid signing key.");return Buffer.from(i.sign.detached(e,t))}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(705);t.BufferVisitor=r.BufferVisitor;var o=n(1372);t.PEM=o.PEM;var i=n(1373);t.ASN1=i.ASN1,t.Class=i.Class,t.Tag=i.Tag,t.BitString=i.BitString},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.BufferVisitor=class{constructor(e,t=0,n=0){this.start=t,this.end=n>t?n:t,this.buf=e}get length(){return this.buf.length}reset(e=0,t=0){return this.start=e,t>=this.start?this.end=t:this.end<this.start&&(this.end=this.start),this}walk(e){return this.start=this.end,this.end+=e,this}mustHas(e,t="Too few bytes to parse."){const n=this.end+e;if(n>this.buf.length){const e=new Error(t);throw e.available=this.buf.length,e.requested=n,e}return this.walk(0),this}mustWalk(e,t){return this.mustHas(e,t),this.walk(e),this}}},function(e,t,n){const r=n(8),o=n(353),i=n(1381),a=n(10)(n(236).name+":datastore"),s=n(707),l=n(150),u=n(1383),p=n(708),c=n(1389),d=n(1390),f=n(1402);function h(e){let t;"string"==typeof e?(t=e,this.inMemoryOnly=!1):(t=(e=e||{}).filename,this.inMemoryOnly=e.inMemoryOnly||!1,this.autoload=e.autoload||!1,this.timestampData=e.timestampData||!1),t&&"string"==typeof t&&0!==t.length?this.filename=t:(this.filename=null,this.inMemoryOnly=!0),this.compareStrings=e.compareStrings,this.persistence=new d({db:this,nodeWebkitAppName:e.nodeWebkitAppName,afterSerialization:e.afterSerialization,beforeDeserialization:e.beforeDeserialization,corruptAlertThreshold:e.corruptAlertThreshold}),this.executor=new u,this.inMemoryOnly&&(this.executor.ready=!0),this.indexes={},this.indexes._id=new c({fieldName:"_id",unique:!0}),this.ttlIndexes={},this.autoload&&this.loadDatabase(e.onload||(e=>{if(e)throw e}))}r.inherits(h,n(24).EventEmitter),h.prototype.loadDatabase=function(){this.executor.push({this:this.persistence,fn:this.persistence.loadDatabase,arguments:arguments},!0)},h.prototype.closeDatabase=function(){this.executor.push({this:this.persistence,fn:this.persistence.closeDatabase,arguments:arguments},!0,!0)},h.prototype.getAllData=function(){return this.indexes._id.getAll()},h.prototype.forEach=function(e){return this.indexes._id.forEach(e)},h.prototype.resetIndexes=function(e){for(const t in this.indexes)this.indexes[t].reset(e)},h.prototype.ensureIndex=function(e,t){if(3===arguments.length){const n=Array.prototype.slice.call(arguments,0);t=n[2],e=n[1];const r=n[0];for(const t in r)e.fieldName=t}let n;const r=t||function(){};if(!(e=e||{}).fieldName)return n=new Error("Cannot create an index without a fieldName"),n.missingFieldName=!0,r(n);if(this.indexes[e.fieldName])return r(null);this.indexes[e.fieldName]=e.hash?new c(e):new p(e),void 0!==e.expireAfterSeconds&&(this.ttlIndexes[e.fieldName]=e.expireAfterSeconds);try{this.indexes[e.fieldName].insertMultipleDocs(this.getAllData())}catch(t){return delete this.indexes[e.fieldName],r(t)}this.persistence.persistNewState([{$$indexCreated:e}],e=>r(e||null))},h.prototype.removeIndex=function(e,t){const n=t||function(){};delete this.indexes[e],this.persistence.persistNewState([{$$indexRemoved:e}],e=>n(e||null))},h.prototype.addToIndexes=function(e){let t,n,r;const o=Object.keys(this.indexes);for(t=0;t<o.length;t++)try{this.indexes[o[t]].insert(e)}catch(e){n=t,r=e;break}if(r){for(t=0;t<n;t++)this.indexes[o[t]].remove(e);throw r}},h.prototype.removeFromIndexes=function(e){const t=this;Object.keys(this.indexes).forEach(n=>{t.indexes[n].remove(e)})},h.prototype.updateIndexes=function(e,t){let n,r,o;const i=Object.keys(this.indexes),a=Array.isArray(e);for(n=0;n<i.length;n++){const s=this.indexes[i[n]];try{a?s.updateMultipleDocs(e):s.update(e,t)}catch(e){r=n,o=e;break}}if(o){for(n=0;n<r;n++)this.indexes[i[n]].revertUpdate(e,t);throw o}},h.prototype.getIndex=function(e){for(const t in e){const n=e[t];if("string"==typeof n||"number"==typeof n||"boolean"==typeof n||n instanceof Date||null===n){const r=this.indexes[t];if(r)return delete e[t],r.getMatching(n)}}for(const t in e){const n=e[t];if(n&&n.hasOwnProperty("$in")){const r=this.indexes[t];if(r)return delete e[t],r.getMatching(n.$in)}}for(const t in e){const n=e[t];if(n&&(n.hasOwnProperty("$lt")||n.hasOwnProperty("$lte")||n.hasOwnProperty("$gt")||n.hasOwnProperty("$gte"))){const r=this.indexes[t];if(r)return delete e[t],r.getBetweenBounds(n)}}return this.indexes._id},h.prototype.getCandidates=function(e,t,n){if("function"==typeof t&&(n=t,t=!1),e.$and){const t={},n=e.$and;for(const e of n){const n=Object.keys(e)[0];t[n]=e[n]}e=t}let r;try{r=this.getIndex(e)}catch(e){return n(e)}if(t)return n(null,r);const o=[],a=[];for(const e of r){let t=!0;for(const n in this.ttlIndexes){const r=e[n];void 0!==r&&r instanceof Date&&Date.now()>r.getTime()+1e3*this.ttlIndexes[n]&&(t=!1)}t?a.push(e):o.push(e._id)}i(o,(e,t)=>{this._remove({_id:e},{},e=>e?n(e):t())},e=>n(null,a))},h.prototype._insert=function(e,t){const n=t||function(){};let o;try{o=this.prepareDocumentForInsertion(e),this._insertInCache(o)}catch(e){return n(e)}this.persistence.persistNewState(r.isArray(o)?o:[o],e=>e?n(e):n(null,l.deepCopy(o)))},h.prototype.createNewId=function(){let e;const t=this.indexes._id;do{e=s.uid(16)}while(t.getMatchingSingle(e).length);return e},h.prototype.prepareDocumentForInsertion=function(e){let t;if(Array.isArray(e)){t=[];for(const n of e)t.push(this.prepareDocumentForInsertion(n))}else{if(t=l.deepCopy(e),void 0===t._id&&(t._id=this.createNewId()),this.timestampData){const e=new Date;void 0===t.createdAt&&(t.createdAt=e),void 0===t.updatedAt&&(t.updatedAt=e)}l.checkObject(t)}return t},h.prototype._insertInCache=function(e){r.isArray(e)?this._insertMultipleDocsInCache(e):this.addToIndexes(e)},h.prototype._insertMultipleDocsInCache=function(e){let t,n,r;for(t=0;t<e.length;t++)try{this.addToIndexes(e[t])}catch(e){r=e,n=t;break}if(r){for(t=0;t<n;t++)this.removeFromIndexes(e[t]);throw r}},h.prototype.insert=function(e,t,n){a("insert",arguments),s.convertObjectIdToString(e);const r=s.isMongoose()?[e,n||t]:[e,t];this.executor.push({this:this,fn:this._insert,arguments:r})},h.prototype.count=function(e,t,n){a("count",arguments),3===arguments.length&&(t=n),"function"==typeof e&&(t=e,e={});const r=new f(this,e,(e,t,n)=>e?n(e):n(null,t.length));if("function"!=typeof t)return r;r.exec(t)},h.prototype.find=function(e,t,n){switch(a("find",arguments),arguments.length){case 1:t={};break;case 2:"function"==typeof t&&(n=t,t={})}const r=new f(this,e,(function(e,t,r){const o=[];let i;if(e)return r(e);for(i=0;i<t.length;i++)o.push(l.deepCopy(t[i]));return s.isMongoose()&&"function"==typeof n?(this.res=o,r(null,this)):r(null,o)}));if(s.adaptToMongoose(r,t),"function"!=typeof n)return r;r.exec(n)},h.prototype.findOne=function(e,t,n){switch(a("findOne",arguments),arguments.length){case 1:t={};break;case 2:"function"==typeof t&&(n=t,t={})}const r=new f(this,e,(e,t,n)=>e?n(e):1===t.length?n(null,l.deepCopy(t[0])):n(null,null));if(s.adaptToMongoose(r,t),r.limit(1),"function"!=typeof n)return r;r.exec(n)},h.prototype._update=function(e,t,n,r){let i;s.convertObjectIdToString(e),s.convertObjectIdToString(t),a("_update",{query:e,updateQuery:t,options:n});const u=this;let p,c,d=0;"function"==typeof n&&(r=n,n={}),n||(n={}),i=r||function(){},p=void 0!==n.multi&&n.multi,c=void 0!==n.upsert&&n.upsert,o([function(n){if(!c)return delete t.$setOnInsert,n();const r=Object.assign({},e);new f(u,r).limit(1)._exec((e,o)=>{if(e)return i(e);if(1===o.length)return n();let a;try{l.checkObject(t),a=t}catch(n){try{const e=Object.assign(r,t.$setOnInsert||{});t.$setOnInsert&&delete t.$setOnInsert,a=l.modify(l.deepCopyStrictKeys(e),t)}catch(e){return i(e)}}return u._insert(a,(e,t)=>e?i(e):i(null,1,t,!0))})},function(){let r;const o=[];let a,s=[];u.getCandidates(e,(c,f)=>{if(c)return i(c);try{const n=l.prepare(e);for(const e of f)n(e)&&(p||0===d)&&(d+=1,u.timestampData&&(a=e.createdAt),r=l.modify(e,t),u.timestampData&&(r.createdAt=a,r.updatedAt=new Date),o.push({oldDoc:e,newDoc:r}),s.push(r))}catch(c){return i(c)}try{u.updateIndexes(o)}catch(c){return i(c)}u.persistence.persistNewState(s,e=>{if(e)return i(e);if(!n.returnUpdatedDocs)return i(null,d);for(let e=0;e<s.length;e++)s[e]=l.deepCopy(s[e]);return p||(s=s[0]),i(null,d,s)})})}])},h.prototype.update=function(){a("update",arguments),this.executor.push({this:this,fn:this._update,arguments:arguments})},h.prototype._remove=function(e,t,n){let r;a("_remove",arguments);const o=this;let i=0;const s=[];let u;"function"==typeof t&&(n=t,t={}),r=n||function(){},u=void 0!==t.multi&&t.multi,this.getCandidates(e,!0,(t,n)=>{if(t)return r(t);try{const t=l.prepare(e);for(const e of n)t(e)&&(u||0===i)&&(i+=1,s.push({$$deleted:!0,_id:e._id}),o.removeFromIndexes(e))}catch(t){return r(t)}o.persistence.persistNewState(s,e=>e?r(e):r(null,i))})},h.prototype.remove=function(){a("remove",arguments),this.executor.push({this:this,fn:this._remove,arguments:arguments})},e.exports=h},function(e,t,n){const r=n(20),o=n(10)(n(236).name+":cursor");function i(){return!!global.MONGOOSE_DRIVER_PATH}function a(e){return"object"==typeof e&&e.constructor&&"ObjectID"===e.constructor.name}e.exports.uid=function(e){return r.randomBytes(Math.ceil(Math.max(8,2*e))).toString("base64").replace(/[+\/]/g,"").slice(0,e)},e.exports.isMongoose=i,e.exports.isMongoId=a,e.exports.adaptToMongoose=function(e,t){if(!t)return e;const n=Object.keys(t).every(e=>["limit","skip","sort","fields"].includes(e));if(i()&&n){if(t.fields){Object.values(t.fields).every(e=>"object"!=typeof e)?e.projection(t.fields):(o("merge projection into query",{query:e.query,fields:t.fields}),e.query=Object.assign({},e.query,t.fields))}t.sort&&"object"==typeof t.sort&&e.sort(t.sort),"number"==typeof t.skip&&e.skip(t.skip),"number"==typeof t.limit&&e.limit(t.limit)}else e.projection(t);return e},e.exports.convertObjectIdToString=function e(t){if(!i())return;if(!t)return;if("object"!=typeof t)return;const n=t=>{if(Array.isArray(t))return void t.forEach((n,r)=>{n&&(a(n)?t[r]=n.toString():"object"==typeof n&&e(n))});Object.keys(t).forEach(n=>{t[n]&&(a(t[n])?t[n]=t[n].toString():e(t[n]))})};"function"==typeof t.toObject&&"object"==typeof t._doc?n(t._doc):n(t)}},function(e,t,n){const r=n(1387).AVLTree,o=n(8),i=n(150);function a(e,t){return e===t}function s(e){return null===e?"$n":"string"==typeof e?"$s"+e:"boolean"==typeof e?"$b"+e:"number"==typeof e?e:o.isArray(e)?"$d"+e.getTime():e}function l(e){this.fieldName=e.fieldName,this.unique=e.unique||!1,this.sparse=e.sparse||!1,this.treeOptions={unique:this.unique,vkUnique:!0,compareKeys:i.compareThings,checkValueEquality:a},this._extractKey=i.getDotFn(this.fieldName),this.keyFn="strict"===this.unique?s:e=>e,this.reset()}l.prototype.reset=function(e){this.tree=new r(this.treeOptions),e&&(Array.isArray(e)?this.insertMultipleDocs(e):this.insert(e))},l.prototype.insert=function(e){const t=this._extractKey(e);if(void 0===t&&this.sparse)return;if(!Array.isArray(t))return void this.tree.insert(this.keyFn(t),e);let n,r;for(let o=0;o<t.length;o++)try{this.tree.insert(this.keyFn(t[o]),e)}catch(e){r=e,n=o;break}if(r){for(let r=0;r<n;r++)this.tree.delete(this.keyFn(t[r]),e);throw r}},l.prototype.insertMultipleDocs=function(e){let t,n,r;for(t=0;t<e.length;t++)try{this.insert(e[t])}catch(e){n=e,r=t;break}if(n){for(t=0;t<r;t++)this.remove(e[t]);throw n}},l.prototype.remove=function(e){const t=this;if(Array.isArray(e))return void e.forEach(e=>{t.remove(e)});const n=this.keyFn(this._extractKey(e));if(void 0!==n||!this.sparse)if(Array.isArray(n))for(const t of n)this.tree.delete(t,e);else this.tree.delete(n,e)},l.prototype.update=function(e,t){this.remove(e);try{this.insert(t)}catch(t){throw this.insert(e),t}},l.prototype.updateMultipleDocs=function(e){let t,n,r;for(t=0;t<e.length;t++)this.remove(e[t].oldDoc);for(t=0;t<e.length;t++)try{this.insert(e[t].newDoc)}catch(e){r=e,n=t;break}if(r){for(t=0;t<n;t++)this.remove(e[t].newDoc);for(t=0;t<e.length;t++)this.insert(e[t].oldDoc);throw r}},l.prototype.revertUpdate=function(e,t){const n=[];o.isArray(e)?(e.forEach(e=>{n.push({oldDoc:e.newDoc,newDoc:e.oldDoc})}),this.updateMultipleDocs(n)):this.update(t,e)},l.prototype.getMatchingSingle=function(e){return this.tree.search(this.keyFn(e))},l.prototype.getMatching=function(e){if(!Array.isArray(e))return this.getMatchingSingle(e);const t={};for(const n of e)for(const e of this.getMatchingSingle(n))t[e._id]=e;return Object.values(t)},l.prototype.getBetweenBounds=function(e){const t=this.tree.betweenBounds(e);return delete e.$lt,delete e.$lte,delete e.$gt,delete e.$gte,t},l.prototype.getAll=function(){const e=[];return this.tree.executeOnEveryNode(t=>{const n=t.data;for(let t=0;t<n.length;t++)e.push(n[t])}),e},l.prototype.forEach=function(e){this.tree.executeOnEveryNode(t=>{const n=t.data;for(let t=0;t<n.length;t++)e(n[t])})},e.exports=l},function(e,t,n){const r=n(710);function o(e){e=e||{},this.left=null,this.right=null,this.parent=void 0!==e.parent?e.parent:null,e.hasOwnProperty("key")&&(this.key=e.key),this.data=r.isDef(e.value)?[e.value]:[],this.unique=e.unique||!1,this.vkUnique=e.vkUnique||!1,this.compareKeys=e.compareKeys||r.defaultCompareKeysFunction,this.checkValueEquality=e.checkValueEquality||r.defaultCheckValueEquality}o.prototype.getMaxKeyDescendant=function(){return this.right?this.right.getMaxKeyDescendant():this},o.prototype.getMaxKey=function(){return this.getMaxKeyDescendant().key},o.prototype.getMinKeyDescendant=function(){return this.left?this.left.getMinKeyDescendant():this},o.prototype.getMinKey=function(){return this.getMinKeyDescendant().key},o.prototype.checkAllNodesFullfillCondition=function(e){this.hasOwnProperty("key")&&(e(this.key,this.data),this.left&&this.left.checkAllNodesFullfillCondition(e),this.right&&this.right.checkAllNodesFullfillCondition(e))},o.prototype.checkNodeOrdering=function(){const e=this;this.hasOwnProperty("key")&&(this.left&&(this.left.checkAllNodesFullfillCondition(t=>{if(e.compareKeys(t,e.key)>=0)throw new Error(`Tree with root ${e.key} is not a binary search tree`)}),this.left.checkNodeOrdering()),this.right&&(this.right.checkAllNodesFullfillCondition(t=>{if(e.compareKeys(t,e.key)<=0)throw new Error(`Tree with root ${e.key} is not a binary search tree`)}),this.right.checkNodeOrdering()))},o.prototype.checkInternalPointers=function(){if(this.left){if(this.left.parent!==this)throw new Error("Parent pointer broken for key "+this.key);this.left.checkInternalPointers()}if(this.right){if(this.right.parent!==this)throw new Error("Parent pointer broken for key "+this.key);this.right.checkInternalPointers()}},o.prototype.checkIsBST=function(){if(this.checkNodeOrdering(),this.checkInternalPointers(),this.parent)throw new Error("The root shouldn't have a parent")},o.prototype.getNumberOfKeys=function(){let e;return this.hasOwnProperty("key")?(e=1,this.left&&(e+=this.left.getNumberOfKeys()),this.right&&(e+=this.right.getNumberOfKeys()),e):0},o.prototype.createSimilar=function(e){return(e=e||{}).unique=this.unique,e.compareKeys=this.compareKeys,e.checkValueEquality=this.checkValueEquality,new this.constructor(e)},o.prototype.createLeftChild=function(e){const t=this.createSimilar(e);return t.parent=this,this.left=t,t},o.prototype.createRightChild=function(e){const t=this.createSimilar(e);return t.parent=this,this.right=t,t},o.prototype.insert=function(e,t){if(!this.hasOwnProperty("key"))return this.key=e,void(r.isDef(t)&&this.data.push(t));const n=this.compareKeys(e,this.key);if(0===n){if(this.unique){if(this.data.includes(t))return;const n=new Error(`Can't insert key ${e}, it violates the unique constraint`);throw n.key=e,n.errorType="uniqueViolated",n}if(r.isDef(t)){if(this.vkUnique&&this.data.includes(t))return;this.data.push(t)}return}const o={key:e};r.isDef(t)&&(o.value=t),n<0?this.left?this.left.insert(e,t):this.createLeftChild(o):this.right?this.right.insert(e,t):this.createRightChild(o)},o.prototype.search=function(e){if(!this.hasOwnProperty("key"))return[];const t=this.compareKeys(e,this.key);return 0===t?this.data:t<0?this.left?this.left.search(e):[]:this.right?this.right.search(e):[]},o.prototype.searchAfter=function(e){if(!this.hasOwnProperty("key"))return[];if(0===this.compareKeys(this.key,e)){if(t=this.right){for(;t.left;)t=t.left;return t.data}for(t=this.parent;t;){if(this.compareKeys(e,t.key)<0)return t.data;t=t.parent}return[]}if(this.compareKeys(e,this.key)<0)return this.left?this.left.searchAfter(e):this.data;if(this.right)return this.right.searchAfter(e);for(var t=this.parent;t;){if(this.compareKeys(e,t.key)<0)return t.data;t=t.parent}return[]},o.prototype.searchBefore=function(e){if(!this.hasOwnProperty("key"))return[];if(0===this.compareKeys(this.key,e)){if(t=this.left){for(;t.right;)t=t.right;return t.data}for(t=this.parent;t;){if(this.compareKeys(e,t.key)>0)return t.data;t=t.parent}return[]}if(this.compareKeys(e,this.key)<0){if(this.left)return this.left.searchBefore(e);for(var t=this.parent;t;){if(this.compareKeys(e,t.key)>0)return t.data;t=t.parent}return[]}return this.right?this.right.searchBefore(e):this.data},o.prototype.searchNearestLte=function(e){const t=this._searchNearestLte(e);return t?t.data:null},o.prototype._searchNearestLte=function(e,t){if(!this.hasOwnProperty("key"))return null;let n=null;if(void 0!==t&&(n=t),0===this.compareKeys(e,this.key))return this;if((null==n||Math.abs(this.compareKeys(this.key,e))<Math.abs(this.compareKeys(e,n.key)))&&this.compareKeys(this.key,e)<=0&&(n=this),this.compareKeys(e,this.key)<0&&this.left){const t=this.left._searchNearestLte(e,n);null!=t&&(null==n||Math.abs(this.compareKeys(t.key,e))<Math.abs(this.compareKeys(e,n.key)))&&this.compareKeys(t.key,e)<=0&&(n=t)}if((null==n||this.compareKeys(e,this.key)>=0)&&this.right){const t=this.right._searchNearestLte(e,n);null!=t&&(null==n||Math.abs(this.compareKeys(t.key,e))<Math.abs(this.compareKeys(e,n.key)))&&this.compareKeys(t.key,e)<=0&&(n=t)}return n},o.prototype.searchNearestGte=function(e){const t=this._searchNearestGte(e);return t?t.data:null},o.prototype._searchNearestGte=function(e,t){if(!this.hasOwnProperty("key"))return null;let n=null;if(void 0!==t&&(n=t),0===this.compareKeys(e,this.key))return this;if((null==n||Math.abs(this.compareKeys(this.key,e))<Math.abs(this.compareKeys(e,n.key)))&&this.compareKeys(this.key,e)>=0&&(n=this),this.compareKeys(e,this.key)<0&&this.left){const t=this.left._searchNearestGte(e,n);null!=t&&(null==n||Math.abs(this.compareKeys(t.key,e))<Math.abs(this.compareKeys(e,n.key)))&&this.compareKeys(t.key,e)>=0&&(n=t)}if((null==n||this.compareKeys(e,this.key)>=0)&&this.right){const t=this.right._searchNearestGte(e,n);null!=t&&(null==n||Math.abs(this.compareKeys(t.key,e))<Math.abs(this.compareKeys(e,n.key)))&&this.compareKeys(t.key,e)>=0&&(n=t)}return n},o.prototype.searchNearest=function(e){const t=this._searchNearest(e);return t?t.data:null},o.prototype._searchNearest=function(e,t){if(!this.hasOwnProperty("key"))return null;let n=null;if(void 0!==t&&(n=t),0===this.compareKeys(e,this.key))return this;if((null==n||Math.abs(this.compareKeys(this.key,e))<Math.abs(this.compareKeys(e,n.key)))&&(n=this),this.compareKeys(e,this.key)<0){if(this.left){const t=this.left._searchNearest(e,n);null!=t&&(null==n||Math.abs(this.compareKeys(t.key,e))<Math.abs(this.compareKeys(e,n.key)))&&(n=t)}}else if(this.right){const t=this.right._searchNearest(e,n);null!=t&&(null==n||Math.abs(this.compareKeys(t.key,e))<Math.abs(this.compareKeys(e,n.key)))&&(n=t)}return n},o.prototype.getLowerBoundMatcher=function(e){if(!e.hasOwnProperty("$gt")&&!e.hasOwnProperty("$gte"))return()=>!0;if(e.hasOwnProperty("$gt")&&e.hasOwnProperty("$gte")){if(0===this.compareKeys(e.$gte,e.$gt)){const t=e.$gt;return e=>this.compareKeys(e,t)>0}if(this.compareKeys(e.$gte,e.$gt)>0){const t=e.$gte;return e=>this.compareKeys(e,t)>=0}const t=e.$gt;return e=>this.compareKeys(e,t)>0}if(e.hasOwnProperty("$gt")){const t=e.$gt;return e=>this.compareKeys(e,t)>0}const t=e.$gte;return e=>this.compareKeys(e,t)>=0},o.prototype.getUpperBoundMatcher=function(e){if(!e.hasOwnProperty("$lt")&&!e.hasOwnProperty("$lte"))return()=>!0;if(e.hasOwnProperty("$lt")&&e.hasOwnProperty("$lte")){if(0===this.compareKeys(e.$lte,e.$lt)){const t=e.$lt;return e=>this.compareKeys(e,t)<0}if(this.compareKeys(e.$lte,e.$lt)<0){const t=e.$lte;return e=>this.compareKeys(e,t)<=0}const t=e.$lt;return e=>this.compareKeys(e,t)<0}if(e.hasOwnProperty("$lt")){const t=e.$lt;return e=>this.compareKeys(e,t)<0}const t=e.$lte;return e=>this.compareKeys(e,t)<=0},o.prototype._betweenBounds=function(e,t,n){const r=t(this.key);if(r&&this.left&&this.left._betweenBounds(e,t,n),n(this.key)){if(r)for(const t of this.data)e.push(t);this.right&&this.right._betweenBounds(e,t,n)}},o.prototype.betweenBounds=function(e){if(!this.hasOwnProperty("key"))return[];const t=this.getLowerBoundMatcher(e),n=this.getUpperBoundMatcher(e),r=[];return this._betweenBounds(r,t,n),r},o.prototype.deleteIfLeaf=function(){return!this.left&&!this.right&&(this.parent?(this.parent.left===this?this.parent.left=null:this.parent.right=null,!0):(delete this.key,this.data=[],!0))},o.prototype.deleteIfOnlyOneChild=function(){let e;return this.left&&!this.right&&(e=this.left),!this.left&&this.right&&(e=this.right),!!e&&(this.parent?(this.parent.left===this?(this.parent.left=e,e.parent=this.parent):(this.parent.right=e,e.parent=this.parent),!0):(this.key=e.key,this.data=e.data,this.left=null,e.left&&(this.left=e.left,e.left.parent=this),this.right=null,e.right&&(this.right=e.right,e.right.parent=this),!0))},o.prototype.delete=function(e,t){let n;this.hasOwnProperty("key")&&(this.compareKeys(e,this.key)<0?this.left&&this.left.delete(e,t):this.compareKeys(e,this.key)>0?this.right&&this.right.delete(e,t):0!==!this.compareKeys(e,this.key)&&(this.data.length>1&&r.isDef(t)?this.data=this.data.filter((function(e){return!this.checkValueEquality(e,t)}),this):this.deleteIfLeaf()||this.deleteIfOnlyOneChild()||(Math.random()>=.5?(n=this.left.getMaxKeyDescendant(),this.key=n.key,this.data=n.data,this===n.parent?(this.left=n.left,n.left&&(n.left.parent=n.parent)):(n.parent.right=n.left,n.left&&(n.left.parent=n.parent))):(n=this.right.getMinKeyDescendant(),this.key=n.key,this.data=n.data,this===n.parent?(this.right=n.right,n.right&&(n.right.parent=n.parent)):(n.parent.left=n.right,n.right&&(n.right.parent=n.parent))))))},o.prototype.executeOnEveryNode=function(e){this.left&&this.left.executeOnEveryNode(e),e(this),this.right&&this.right.executeOnEveryNode(e)},o.prototype.prettyPrint=function(e,t){t=t||"",console.log(`${t}* ${this.key}`),e&&console.log(`${t}* ${this.data}`),(this.left||this.right)&&(this.left?this.left.prettyPrint(e,t+" "):console.log(t+" *"),this.right?this.right.prettyPrint(e,t+" "):console.log(t+" *"))},e.exports=o},function(e,t){e.exports.getRandomArray=function e(t){let n,r;return 0===t?[]:1===t?[0]:(n=e(t-1),r=Math.floor(Math.random()*t),n.splice(r,0,t-1),n)},e.exports.defaultCompareKeysFunction=function(e,t){const n=e-t;if(!isNaN(n))return n;const r=new Error(`Can't compare elements of type ${typeof e} and ${typeof t}`);throw r.a=e,r.b=t,r},e.exports.defaultCheckValueEquality=function(e,t){return e===t},e.exports.isDef=function(e){return void 0!==e}},function(e,t,n){!function(){"use strict";var t=n(8),r=n(11).Transform,o=n(161).StringDecoder;function i(e){if(!(this instanceof i))return new i(e);r.call(this,e),this._writableState.objectMode=!1,this._readableState.objectMode=!0,this._buffer="",this._decoder=new o("utf8")}t.inherits(i,r),i.prototype._transform=function(e,t,n){this._buffer+=this._decoder.write(e);var r=this._buffer.split(/\r?\n/);this._buffer=r.pop(),r.forEach(this.push.bind(this)),n()},i.prototype._flush=function(e){var t=this._buffer.trim();t&&this.push(t),e()},e.exports=i}()},function(e,t,n){const{dirname:r}=n(9),o=(e,t,n)=>{t.recursive=!1;const i=r(e);return i===e?t.mkdirAsync(e,t).catch(e=>{if("EISDIR"!==e.code)throw e}):t.mkdirAsync(e,t).then(()=>n||e,r=>{if("ENOENT"===r.code)return o(i,t).then(n=>o(e,t,n));if("EEXIST"!==r.code&&"EROFS"!==r.code)throw r;return t.statAsync(e).then(e=>{if(e.isDirectory())return n;throw r},()=>{throw r})})},i=(e,t,n)=>{const o=r(e);if(t.recursive=!1,o===e)try{return t.mkdirSync(e,t)}catch(e){if("EISDIR"!==e.code)throw e;return}try{return t.mkdirSync(e,t),n||e}catch(r){if("ENOENT"===r.code)return i(e,t,i(o,t,n));if("EEXIST"!==r.code&&"EROFS"!==r.code)throw r;try{if(!t.statSync(e).isDirectory())throw r}catch(e){throw r}}};e.exports={mkdirpManual:o,mkdirpManualSync:i}},function(e,t,n){const r=n(714),o=n(1410),i=n(717),a=n(1437);e.exports={WalletAuthenticator:r,WalletHandlers:i,AgentAuthenticator:o,AgentWalletHandlers:a}},function(e,t,n){const r=n(163),o=n(212),i=n(169),a=n(213),s=n(141),{toBase58:l}=n(21),{fromAddress:u}=n(46),{toAddress:p}=n(35),c=n(715),d=n(10)(n(151).name+":authenticator:wallet"),{DEFAULT_CHAIN_INFO:f}=c,h=n(1406),g=e=>{if(!e)return"";if(e&&e.type&&e.content)return JSON.stringify(o(e,["type","content"]));try{const t=JSON.parse(e);return t&&t.type&&t.content?e:""}catch(e){return""}};e.exports=class extends c{constructor({wallet:e,appInfo:t,timeout:n=8e3,chainInfo:r=f,baseUrl:o="",tokenKey:i="_t_"}){super(),this.wallet=this._validateWallet(e),this.appInfo=this._validateAppInfo(t),this.chainInfo=r,this.baseUrl=o,this.tokenKey=i,this.timeout=n,this.appInfo.link||(this.appInfo.link=this.baseUrl)}async uri({baseUrl:e,pathname:t="",token:n="",query:o={}}={}){const i={...o,[this.tokenKey]:n},a={action:"requestAuth",url:encodeURIComponent(`${this.baseUrl||e}${t}?${r.stringify(i)}`)},s="https://abtwallet.io/i/?"+r.stringify(a);return d("uri",{token:n,pathname:t,uri:s,params:i,payload:a}),s}getPublicUrl(e,t={},n=""){return`${this.baseUrl||n}${e}?${r.stringify(t)}`}async signResponse({response:e={},errorMessage:t="",successMessage:n="",nextWorkflow:r=""},o,i){const a=await this.getWalletInfo({baseUrl:o,request:i}),u=await this.getAppInfo({baseUrl:o,request:i,wallet:a}),p=i.context.wallet,c={appInfo:u,status:t?"error":"ok",errorMessage:t||"",successMessage:n||"",nextWorkflow:r||"",response:e};return{appPk:l(a.pk),authInfo:s.sign(a.address,a.sk,c,!0,p?p.jwt:void 0)}}async sign({context:e,request:t,claims:n,pathname:o="",baseUrl:a="",challenge:u="",extraParams:p={}}){const c=await this.tryWithTimeout(()=>this.genRequestedClaims({claims:n,context:{baseUrl:a,request:t,...e},extraParams:p})),d=c.find(e=>!1===i(this._isValidChainInfo(e.chainInfo),f)),h={baseUrl:a,request:t,...e,...p},g=await this.getWalletInfo(h),m={action:"responseAuth",challenge:u,appInfo:await this.getAppInfo({...h,wallet:g}),chainInfo:await this.getChainInfo(h,d?d.chainInfo:f),requestedClaims:c.map(e=>(delete e.chainInfo,e)),url:`${this.baseUrl||a}${o}?${r.stringify({[this.tokenKey]:e.token})}`},y=e.didwallet?e.didwallet.jwt:void 0;return{appPk:l(g.pk),authInfo:s.sign(g.address,g.sk,m,!0,y)}}async getChainInfo(e,t){if(t)return this._isValidChainInfo(t)?t:f;if("function"==typeof this.chainInfo){const t=await this.tryWithTimeout(()=>this.chainInfo(e));return this._isValidChainInfo(t)?t:f}return this.chainInfo||f}async getAppInfo(e){if("function"==typeof this.appInfo){const t=await this.tryWithTimeout(()=>this.appInfo(e));return t.link||(t.link=e.baseUrl),t.publisher||(t.publisher="did:abt:"+e.wallet.address),this._validateAppInfo(t)}return this.appInfo&&!this.appInfo.publisher&&(this.appInfo.publisher="did:abt:"+e.wallet.address),this.appInfo}async getWalletInfo(e){if("function"==typeof this.wallet){const t=await this.tryWithTimeout(()=>this.wallet(e));if(this._validateWallet(t))return t;throw new Error("Invalid wallet function provided")}return this.wallet}verify(e,t="en",n=!0){return new Promise(async(r,o)=>{try{const{iss:o,challenge:i="",action:a="responseAuth",requestedClaims:s}=await this._verify(e,"userPk","userInfo",t,n);r({token:e.token,userDid:p(o),userPk:e.userPk,claims:s,action:a,challenge:i}),d("verify.context",{userPk:e.userPk,userDid:p(o),action:a,challenge:i}),d("verify.claims",s)}catch(e){o(e)}})}genRequestedClaims({claims:e,context:t,extraParams:n}){return Promise.all(Object.keys(e).map(async r=>{let o=r,i=e[r];if(Array.isArray(e[r])&&([o,i]=e[r]),!h.claims[o])throw new Error("Unsupported claim type "+o);const a="function"==typeof this[o]?o:"getClaimInfo",s=await this[a]({claim:i,context:t,extraParams:n}),{value:l,error:u}=h.claims[o].validate(s);if(u)throw new Error(`Invalid ${o} claim: ${u.message}`);return l}))}async getClaimInfo({claim:e,context:t,extraParams:n}){const{userDid:r,userPk:o,didwallet:i}=t,a="function"==typeof e?await e({userDid:r?p(r):"",userPk:o||"",didwallet:i,extraParams:n,context:t}):e,s={...t,...n},l=await this.getChainInfo(s,a.chainInfo);return a.chainInfo=l,a}async signature({claim:e,context:t,extraParams:n}){const{data:r,type:o="mime:text/plain",digest:i="",method:s="sha3",wallet:p,sender:c,display:f,description:h,chainInfo:m,meta:y={}}=await this.getClaimInfo({claim:e,context:t,extraParams:n});if(d("claim.signature",{data:r,digest:i,type:o,sender:c,context:t}),!r&&!i)throw new Error("Signature claim requires either data or digest to be provided");const v=h||"Sign this transaction to continue.";if(o.endsWith("Tx")){if(!m.host)throw new Error("Invalid chainInfo when trying to encoding transaction");const e=new a(m.host);if("function"!=typeof e["encode"+o])throw new Error("Unsupported transaction type "+o);r.pk||(r.pk=t.userPk);try{const{buffer:n}=await e["encode"+o]({tx:r,wallet:p||u(c||t.userDid)});return{type:"signature",description:v,typeUrl:"fg:t:transaction",origin:l(n),method:s,display:g(f),digest:"",chainInfo:m,meta:y}}catch(e){throw new Error("Failed to encode transaction: "+e.message)}}return"fg:t:transaction"===o?{type:"signature",description:v,typeUrl:"fg:t:transaction",origin:l(r),display:g(f),method:s,digest:"",chainInfo:m,meta:y}:{type:"signature",description:h||"Sign this message to continue.",origin:r?l(r):"",typeUrl:o,display:g(f),method:s,digest:i,chainInfo:m,meta:y}}async prepareTx({claim:e,context:t,extraParams:n}){const{partialTx:r,requirement:o,type:i,display:s,wallet:p,sender:c,description:f,chainInfo:h,meta:m={}}=await this.getClaimInfo({claim:e,context:t,extraParams:n});if(d("claim.prepareTx",{partialTx:r,requirement:o,type:i,sender:c,context:t}),!r||!o)throw new Error("prepareTx claim requires both partialTx and requirement to be provided");const y=f||"Prepare and sign this transaction to continue.",v={tokens:[],assets:{}};if(i&&i.endsWith("Tx")){if(!h.host)throw new Error("Invalid chainInfo when trying to encoding partial transaction");const e=new a(h.host);if("function"!=typeof e["encode"+i])throw new Error(`Unsupported transaction type ${i} when encoding partial transaction`);r.pk||(r.pk=t.userPk);try{const{buffer:n}=await e["encode"+i]({tx:r,wallet:p||u(c||t.userDid)});return{type:"prepareTx",description:y,partialTx:l(n),display:g(s),requirement:Object.assign(v,o),chainInfo:h,meta:m}}catch(e){throw new Error("Failed to encode partial transaction: "+e.message)}}return{type:"prepareTx",description:y,partialTx:l(r),requirement:Object.assign(v,o),display:g(s),chainInfo:h,meta:m}}_validateAppInfo(e){if("function"==typeof e)return e;if(!e)throw new Error("Wallet authenticator can not work with invalid appInfo: empty");const{value:t,error:n}=h.appInfo.validate(e);if(n)throw new Error("Wallet authenticator can not work with invalid appInfo: "+n.message);return t}_isValidChainInfo(e){return e&&e.host}tryWithTimeout(e){if("function"!=typeof e)throw new Error("asyncFn must be a valid function");const t=Number(this.timeout)||8e3;return new Promise(async(n,r)=>{const o=setTimeout(()=>{r(new Error(`Async operation did not complete within ${t} ms`))},t);try{n(await e())}catch(e){r(e)}finally{clearTimeout(o)}})}},e.exports.formatDisplay=g},function(e,t,n){const r=n(141),{isValid:o}=n(46),i=n(10)(n(151).name+":authenticator:base");e.exports=class{_validateWallet(e){if(!e)throw new Error("WalletAuthenticator cannot work without wallet");if("function"==typeof e)return e;if(o(e))return{sk:e.secretKey,pk:e.publicKey,address:e.address};if(!e.sk)throw new Error("WalletAuthenticator cannot work without wallet.sk");if(!e.pk)throw new Error("WalletAuthenticator cannot work without wallet.pk");if(!e.address)throw new Error("WalletAuthenticator cannot work without wallet.address");return e}_verify(e,t,n,o="en",a=!0){return new Promise((s,l)=>{i("verify",e,o);const u={pkMissing:{en:t+" is required to complete auth",zh:t+" 参数缺失"},tokenMissing:{en:n+" is required to complete auth",zh:"JWT Token 参数缺失"},pkFormat:{en:t+" should be either base58 or base16 format",zh:t+" 无法解析"},tokenInvalid:{en:"Invalid JWT token",zh:"签名无效"},timeInvalid:{en:"JWT token expired, make sure your device time in sync with network",zh:"签名中的时间戳无效,请确保设备和网络时间同步"}},p=e[t],c=e[n];if(!p)return l(new Error(u.pkMissing[o]));if(!c)return l(new Error(u.tokenMissing[o]));if(!p)return l(new Error(u.pkFormat[o]));if(!r.verify(c,p)){const e=r.verify(c,p,{tolerance:0,enforceTimestamp:!1});if(a){const t=e?u.timeInvalid[o]:u.tokenInvalid[o];return l(new Error(t))}}return s(r.decode(c))})}},e.exports.DEFAULT_CHAIN_INFO={id:"none",host:"none"}},function(e,t,n){const r=n(233),o=n(1407),i=n(1408),a=r.extend(i).extend(o),s=/^(0x)?([A-Fa-f0-9]{64})$/,l={context:a.object({genesisTime:a.date().iso().required().raw(),genesisTx:a.string().regex(s).required().allow(""),renaissanceTime:a.date().iso().required().raw(),renaissanceTx:a.string().regex(s).required().allow("")}),tokenInput:a.object({address:a.DID().role("ROLE_TOKEN").required(),value:a.BN().positive().required()}),multiSig:a.array().items({signer:a.DID().required(),pk:a.any().required(),signature:a.any().required(),delegator:a.DID().valid("").optional(),data:a.any().optional()}),foreignToken:a.object({type:a.string().min(1).max(32).required(),contractAddress:a.DID().wallet("ethereum").required(),chainType:a.string().min(1).max(32).required(),chainName:a.string().min(1).max(32).required(),chainId:a.number().positive().required()})},u={txHash:s};e.exports=a,e.exports.schemas=l,e.exports.patterns=u},function(e,t,n){const r=n(10)(n(151).name+":handlers:wallet"),o=n(718),i=n(1436),a=()=>{};e.exports=class extends i{constructor({pathTransformer:e,tokenStorage:t,authenticator:n,onConnect:r=a,options:o={}}){super({pathTransformer:e,tokenStorage:t,authenticator:n,onConnect:r}),this.options={prefix:"/api/did",cleanupDelay:6e4,tokenKey:"_t_",encKey:"_ek_",...o}}attach({app:e,action:t,claims:n,onStart:i=a,onConnect:s,onAuth:l,onDecline:u=a,onComplete:p=a,onExpire:c=a,onError:d=console.error,authPrincipal:f=!0}){if("function"!=typeof l)throw new Error("onAuth callback is required to attach did auth handlers");if("function"!=typeof u)throw new Error("onDecline callback is required to attach did auth handlers");if("function"!=typeof p)throw new Error("onComplete callback is required to attach did auth handlers");const{prefix:h}=this.options,g=`${h}/${t}/auth`;r("attach routes",{action:t,prefix:h,pathname:g});const{generateSession:m,expireSession:y,checkSession:v,onAuthRequest:b,onAuthResponse:_,ensureContext:T,ensureSignedJson:E}=o({action:t,pathname:g,claims:n,onStart:i,onConnect:async(...e)=>{if("function"==typeof this.onConnect&&await this.onConnect(...e),"function"==typeof s)return s(...e)},onAuth:l,onDecline:u,onComplete:p,onExpire:c,onError:d,authPrincipal:f,options:this.options,pathTransformer:this.pathTransformer,tokenStorage:this.tokenStorage,authenticator:this.authenticator});e.get(`${h}/${t}/token`,m),e.post(`${h}/${t}/token`,m),e.get(`${h}/${t}/status`,T,v),e.get(`${h}/${t}/timeout`,T,y),e.get(g,T,E,b),e.post(g,T,E,_),e.get(g+"/submit",T,E,_)}}},function(e,t,n){const r=n(30),o=n(27),i=n(317),a=n(481),s=n(1411),l=n(28),u=n(1513),p=n(288),{isValid:c}=n(35),{stripHexPrefix:d,toBase64:f,fromBase64:h}=n(21),g=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,m=/^[a-zA-Z]:\\/,y=(n(10)(n(151).name+":handlers:util"),l.Hasher.SHA3.hash256),v=e=>(e.acceptsLanguages("en-US","zh-CN")||"en-US").split("-").shift(),b=()=>({}),_=e=>e,T={tokenMissing:{en:"Session Id is required to check status",zh:"缺少会话 ID 参数"},didMismatch:{en:"Login user and wallet user mismatch, please relogin and try again",zh:"登录用户和扫码用户不匹配,为保障安全,请重新登录应用"},challengeMismatch:{en:"Challenge mismatch",zh:"随机校验码不匹配"},token404:{en:"Session not found or expired",zh:"会话不存在或已过期"},didMissing:{en:"userDid is required to start auth",zh:"userDid 参数缺失,请勿尝试连接多个不同的钱包"},pkMissing:{en:"userPk is required to start auth",zh:"userPk 参数缺失,请勿尝试连接多个不同的钱包"},authClaim:{en:"authPrincipal claim is not configured correctly",zh:"authPrincipal 声明配置不正确"},userDeclined:{en:"You have declined the authentication request",zh:"授权请求被拒绝"}},E=(e,t)=>{const n=e.replace(/\/retrieve$/,"").replace(/\/auth$/,""),o=r.parse(t.originalUrl).pathname,[i]=o.split(n);return[i,e].join("/").replace(/\/+/g,"/")},S=(e,t)=>{const n=(e=>e.headers["x-path-prefix"]?`/${e.headers["x-path-prefix"]}/`.replace(/\/+/g,"/"):"/")(e).replace(/\/$/,""),[i="",a=80]=(e.get("x-real-hostname")||e.get("host")||"").split(":"),s=o(t,"x-real-port",null)||e.get("X-Real-Port")||a||"";return r.format({protocol:o(t,"x-real-protocol")||e.get("X-Real-protocol")||e.get("X-Forwarded-Proto")||e.protocol,hostname:i,port:80===Number(s)?"":s,pathname:n})},x=()=>d(l.getRandomBytes(16)).toUpperCase(),w=e=>{const t=(e||"").toString().toLowerCase();let n="",r="";t.indexOf("android")>-1?n="android":t.indexOf("darwin")>-1?n="ios":0===t.indexOf("arcwallet")&&(n="web");const o=t.split(/\s+/).find(e=>e.startsWith("arcwallet"));if(o){const e=o.split("/");e.length>1&&s.coerce(e[1])&&(r=s.coerce(e[1]).version)}let i="1.0.0";return("ios"===n&&r&&s.gte(r,"2.7.2")||"android"===n&&r&&s.gte(r,"2.7.16")||"web"===n)&&(i="1.1.0"),{os:n,version:r,jwt:i}},A=e=>e.startsWith("https://abtwallet.io/i/");e.exports=function({action:e,pathname:t,claims:n,onStart:r,onConnect:s,onAuth:l,onDecline:d,onComplete:k,onExpire:M,onError:O,pathTransformer:D,tokenStorage:I,authenticator:R,authPrincipal:N,getSignParams:C=b,getPathName:F=_,options:L}){const{tokenKey:j,encKey:B,cleanupDelay:P}=L,H=(Array.isArray(n)?n:[n]).filter(Boolean);if(H.length>0){const e=Object.keys(H[0]),t=H[0][e[0]];Array.isArray(t)?"authPrincipal"===t[0]&&(N=!1):"authPrincipal"===e[0]&&(N=!1)}if(N){let e,t,n,r="",i="Please select account to continue.";"string"==typeof N&&(c(N)?r=N:i=N),"object"==typeof N&&(r=o(N,"target",r),i=o(N,"description",i),t=o(N,"targetType",t),n=o(N,"declareParams",n),N.chainInfo&&R._isValidChainInfo(N.chainInfo)&&(e=N.chainInfo),R._isValidChainInfo(N)&&(e=N));const a=0===H.length;H.unshift({authPrincipal:{skippable:!0,description:i,target:r,chainInfo:e,targetType:t,declareParams:n,supervised:a}})}const U=H[0]&&H[0].authPrincipal&&H[0].authPrincipal.skippable,$=(t,n,r={})=>{const o={...n,...r||{}};return{locale:t,action:e,...Object.keys(o).filter(e=>!["userDid","userInfo","userSession","appSession","userPk","token"].includes(e)).reduce((e,t)=>(e[t]=o[t],e),{})}},W=(e,t)=>async(n,r,o=!1)=>{const i=(e,n)=>{if(o&&t[B]){const o=u.seal(Buffer.from(p(n)),(r=t[B],new Uint8Array(Buffer.from((e=>(e+"===".slice((e.length+3)%4)).replace(/-/g,"+").replace(/_/g,"/"))(r),"base64"))));return{[e]:Buffer.from(o).toString("base64")}}var r;return{[e]:n}};if("object"==typeof n){o=r;const t=Object.keys(n),a=Object.assign(...t.map(e=>i(e,n[e])));return I.update(e,a)}return I.update(e,i(n,r))},V=({req:e,res:t,stage:n,err:r})=>{const{token:i,store:a}=e.context||{};i&&I.update(i,{status:"error",error:r.message}),t.jsonp({error:r.message}),O({token:i,extraParams:o(a,"extraParams",{}),stage:n,err:r})},Y=(e,t)=>{const n=E(e,t);return D(n)},z=async({context:e,userDid:t,userPk:n})=>{const{locale:r,token:o,store:i}=e;if(i.currentStep>0){if(!t)return T.didMissing[r];if(!n)return T.pkMissing[r];if(t!==i.did)return await I.update(o,{status:"forbidden"}),T.didMismatch[r]}return!1};return{generateSession:async(e,n)=>{try{const i={"x-real-port":e.get("x-real-port"),"x-real-protocol":e.get("x-real-protocol"),connectedDid:o(e,"cookies.connected_did",""),connectedPk:o(e,"cookies.connected_pk",""),...e.body,...e.query,...e.params},a=y(Date.now().toString()).replace(/^0x/,"").slice(0,8);await I.create(a,"created");const s=Y(F(t,e),e),l=S(e,i),u=await R.uri({token:a,pathname:s,baseUrl:l,query:{}}),p=x(),c=await R.getWalletInfo({baseUrl:l,request:e}),d=await R.getAppInfo({baseUrl:l,request:e,wallet:c});await I.update(a,{currentStep:0,challenge:p,extraParams:i,appInfo:d});const f=$(v(e),i),h={req:e,challenge:p,baseUrl:l,deepLink:u,extraParams:f,updateSession:W(a,f),didwallet:w(e.query["user-agent"]||e.headers["user-agent"])},g=await r(h);n.jsonp({token:a,status:"created",url:u,appInfo:d,extra:g||{}})}catch(t){V({req:e,res:n,stage:"generate-token",err:t})}},expireSession:async(e,t)=>{try{const{locale:n,token:r,store:i}=e.context;if(!r)return void t.status(400).json({error:T.tokenMissing[n]});if(!i)return void t.status(400).json({error:T.token404[n]});M({token:r,extraParams:o(i,"extraParams",{}),status:"expired"}),"scanned"!==i.status&&await I.delete(r),t.status(200).json({token:r})}catch(n){V({req:e,res:t,stage:"mark-token-timeout",err:n})}},checkSession:async(e,t)=>{try{const{locale:n,token:r,store:i,params:a}=e.context;if(!r)return void t.status(400).json({error:T.tokenMissing[n]});if(!i)return void t.status(400).json({error:T.token404[n]});if("forbidden"===i.status)return void t.status(403).json({error:T.didMismatch[n]});if("succeed"===i.status){setTimeout(()=>{I.delete(r).catch(console.error)},P);const t=$(n,a,o(i,"extraParams",{}));await k({req:e,userDid:i.did,userPk:i.pk,extraParams:t,updateSession:W(r,t)})}t.status(200).json(Object.keys(i).filter(e=>"challenge"!==e).reduce((e,t)=>(e[t]=i[t],e),{}))}catch(n){V({req:e,res:t,stage:"check-token-status",err:n})}},onAuthRequest:async(e,n)=>{const{locale:r,token:a,store:l,params:u,didwallet:p}=e.context,c=$(r,u,o(l,"extraParams",{})),d=u.userDid||l.did||c.connectedDid,f=u.userPk||l.pk||c.connectedPk,h=await z({context:e.context,userDid:d,userPk:f});if(h)return n.jsonp({error:h});try{const r=[...H],o=U&&!!c.connectedDid;if(o&&i(r,"[0].authPrincipal.supervised",!1),"scanned"!==l.status&&await I.update(a,{status:"scanned",connectedWallet:p}),l.dynamic||o){const n=await s({req:e,userDid:d,userPk:f,didwallet:p,challenge:l.challenge,pathname:Y(F(t,e),e),baseUrl:S(e,c),extraParams:c,updateSession:W(a,c)});n&&r.push(n)}const u=await C(e),h=await R.sign(Object.assign(u,{context:{token:a,userDid:d,userPk:f,didwallet:p},claims:r[l.currentStep],pathname:Y(F(t,e),e),baseUrl:S(e,c),extraParams:c,challenge:l.challenge,appInfo:l.appInfo,request:e}));n.jsonp(Object.assign(h,{signed:!0}))}catch(t){V({req:e,res:n,stage:"send-auth-claim",err:t})}},onAuthResponse:async(e,n)=>{const{locale:r,token:i,store:a,params:u,didwallet:p}=e.context;try{const{userDid:c,userPk:h,action:y,challenge:v,claims:b}=await R.verify(u,r);a.did&&a.pk||await I.update(i,{did:c,pk:h});const _=$(r,u,o(a,"extraParams",{})),E={step:a.currentStep,req:e,userDid:c,userPk:h,challenge:a.challenge,didwallet:p,claims:b,baseUrl:S(e,_),extraParams:_,updateSession:W(i,_)},w=[...H],k=U&&!!_.connectedDid;if(a.dynamic||k){const e=await s(E);e&&w.push(e)}if("declineAuth"===y){await I.update(i,{status:"error",error:T.userDeclined[r],currentStep:w.length-1});const e=await d(E);return n.jsonp({...e||{}})}if(!v)return n.jsonp({error:T.challengeMismatch[r]});if(v!==a.challenge)return n.jsonp({error:T.challengeMismatch[r]});const M=await z({context:e.context,userDid:c,userPk:h});if(M)return n.jsonp({error:M});const O=a.currentStep>0;if(!1===O){const e=await s(E);e&&(await I.update(i,{dynamic:!0}),w.push(e))}const D=async t=>{if(t&&t.nextToken&&t.nextWorkflow)try{await I.update(t.nextToken,{prevToken:i})}catch(e){console.error("DIDAuth: failed to to update nextToken",e),await I.update(i,{status:"succeed"})}else{if(a.prevToken)try{await I.update(a.prevToken,{status:"succeed"})}catch(e){console.error("DIDAuth: failed to to update prevToken",e)}await I.update(i,{status:"succeed"})}let r="string"==typeof(o=E.extraParams.nw)&&!m.test(o)&&g.test(o)?E.extraParams.nw:"";var o;if(r&&t&&t.nextWorkflowData){const o=new URL(r),i=f(JSON.stringify(t.nextWorkflowData));if(i.length>1024){const t=new Error("base64 encoded nextWorkflowData should be less than 1024 characters");return V({req:e,res:n,stage:"append-next-workflow",err:t})}if(A(r)){const e=decodeURIComponent(o.searchParams.get("url")),t=new URL(e);t.searchParams.set("previousWorkflowData",i),o.searchParams.set("url",t.href)}else o.searchParams.set("previousWorkflowData",i);r=o.href}return n.jsonp({...Object.assign({nextWorkflow:r},t||{})})};if(1===w.length){return D(await l(E))}if(O&&a.currentStep<w.length){const e=await l(E);if(a.currentStep===w.length-1)return D(e)}const N=a.currentStep+1,L=x();await I.update(i,{currentStep:N,challenge:L});const j=await C(e);try{const r=await R.sign(Object.assign(j,{context:{token:i,userDid:c,userPk:h,didwallet:p},claims:w[N],pathname:Y(F(t,e),e),baseUrl:S(e,_),extraParams:_,challenge:L,appInfo:a.appInfo,request:e}));return n.jsonp(Object.assign(r,{signed:!0}))}catch(t){return V({req:e,res:n,stage:"next-auth-claim",err:t})}}catch(t){V({req:e,res:n,stage:"verify-auth-claim",err:t})}},ensureContext:async(e,t,n)=>{const r=w(e.query["user-agent"]||e.headers["user-agent"]),o={...e.body,...e.query,...e.params},i=o[j],a=v(e);let s=null;if(i&&(s=await I.read(i),o.previousWorkflowData))try{s.extraParams.previousWorkflowData=JSON.parse(h(o.previousWorkflowData)),await I.update(i,{extraParams:s.extraParams})}catch(e){console.warn("Could not parse previousWorkflowData",o.previousWorkflowData,e)}return e.context={locale:a,token:i,didwallet:r,params:o,store:s},n()},ensureSignedJson:(e,t,n)=>{if(void 0===e.ensureSignedJson){e.ensureSignedJson=!0;const n=t.jsonp;t.jsonp=async r=>{if(r.signed)return n.call(t,r);const i=r.response?{response:r.response}:{response:r};(r.error||r.errorMessage)&&(i.errorMessage=r.error||r.errorMessage),r.successMessage&&(i.successMessage=r.successMessage),r.nextWorkflow&&(i.nextWorkflow=r.nextWorkflow);const s=["error","errorMessage","successMessage","nextWorkflow"];"object"==typeof i.response&&(i.response=a(i.response,s));const l={...e.body,...e.query,...e.params}[j],u=l?await I.read(l):null,p=await R.signResponse(i,S(e,o(u,"extraParams",{})),e);n.call(t,p)}}const{token:r,store:i,locale:s}=e.context;if(!r||!i)return t.jsonp({error:T.token404[s]});n()},createExtraParams:$}},e.exports.isDeepLink=A,e.exports.parseWalletUA=w,e.exports.preparePathname=E,e.exports.prepareBaseUrl=S,e.exports.getStepChallenge=x},function(e,t,n){const r=n(80);e.exports=(e,t,n)=>0!==r(e,t,n)},function(e,t,n){const r=n(355),o=n(719),i=n(240),a=n(358),s=n(357),l=n(359);e.exports=(e,t,n,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return r(e,n,u);case"!=":return o(e,n,u);case">":return i(e,n,u);case">=":return a(e,n,u);case"<":return s(e,n,u);case"<=":return l(e,n,u);default:throw new TypeError("Invalid operator: "+t)}}},function(e,t,n){const r=n(508).create({proxy:!1}),o=n(212),i=n(141),{NODE_MODES:a}=n(25),s=n(1441),{SERVICE_PREFIX:l}=n(722),u=n(1444).version,{validateNotification:p,validateReceiver:c,validateOption:d}=s,f=process.env.ABT_NODE_MODE;e.exports=async(e,t,{appId:n,appSk:s,did:h}={},g=process.env.ABT_NODE_SERVICE_PORT,m={})=>{await c(e);const y=o(m,["keepForOfflineUser"]);await d(y),f!==a.DEBUG&&await p(t);const v=i.sign(n,s);try{const{data:o}=await r.post(`http://127.0.0.1:${g}${l}/api/sendToUser`,{apiVersion:u,data:{sender:{did:h,token:v,appDid:n},receiver:e,notification:t,options:y}},{headers:{"User-Agent":"BlockletSDK/"+u}});return o}catch(e){throw new Error(e.response?e.response.statusText:e.message)}}},function(e,t){e.exports={SERVICE_PREFIX:"/.well-known/service"}},function(e,t){e.exports={baseUrl:process.env.ABT_NODE_BASE_URL}},function(e,t,n){e.exports=n(1467)().Promise},function(e,t,n){const r=n(28);e.exports=function(e=16){return r.getRandomBytes(e).replace(/^0x/,"").toUpperCase()}},function(e,t,n){function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{createPassport:s,createPassportVC:l,createUserPassport:u}=n(147),{ROLES:p,VC_TYPE_NODE_PASSPORT:c}=n(25),d=n(87),{getPassportStatusEndpoint:f}=n(44),{authenticateByNFT:h,getOwnershipNFTClaim:g}=n(125),m=n(361),{messages:y}=n(44),v=n(40)(n(91).name),{createSessionToken:b}=n(124),_={requestProfile:{en:"This node has already been accepted, please login.",zh:"请提供节点所有者信息"},alreadyAccepted:{en:"Already accepted, please login",zh:"已经接受过该节点,请登录。"}};e.exports={getAssetProfile:e=>({extraParams:{locale:t}})=>g(e,t),getProfileClaim:async e=>({fields:["fullName","email","avatar"],description:_.requestProfile[e]}),onAddNodeOwnerAuth:async({action:e,req:t,node:n,baseUrl:o,claims:a,userDid:g,locale:_,challenge:T,userPk:E,updateSession:S})=>{const x=a.find(e=>"profile"===e.type);if(!x)throw new Error(y.missingProfileClaim[_]);const{teamDid:w,ownerDid:A,ownerNFT:k}=await h({node:n,claims:a,userDid:g,challenge:T,locale:_}),M=await n.getNodeInfo(),O={did:g,pk:E},D=M.ownerNft||{};"accept-server"===e?D.holder=A:D.did=k,await n.updateNodeOwner({nodeOwner:O,ownerNft:D}),v.info("verify owner to node",{userDid:g});const I=l({issuerName:M.name,issuerWallet:m(M.sk),ownerDid:g,passport:await s({name:p.OWNER,node:n,teamDid:w,locale:_,endpoint:o}),endpoint:f({baseUrl:o,userDid:g,teamDid:w}),types:[c],tag:M.did,ownerProfile:x,preferredColor:"default"}),R=p.OWNER,N=u(I,{role:R}),C=await n.addUser({teamDid:w,user:i(i({},x),{},{did:g,pk:E,approved:!0,locale:_,passports:[N],firstLoginAt:(new Date).toISOString(),lastLoginAt:(new Date).toISOString()})});await n.createAuditLog({action:"addUser",args:{teamDid:w,userDid:g,reason:"claim server with server nft"},context:d(r(t,{user:C})),result:C},n);const F=await b(g,{passport:N,role:R});return await S({sessionToken:F},!0),{disposition:"attachment",type:"VerifiableCredential",data:I}}}},function(e,t,n){function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const o=n(112),i=n(488),a=n(225),s=n(87),l=n(725),u=n(361),{getDisplayName:p}=n(104),{VC_TYPE_NODE_PASSPORT:c,PASSPORT_STATUS:d}=n(25),f=n(27),h=n(226),{messages:g,getUser:m,checkWalletVersion:y,getPassportStatusEndpoint:v}=n(44),{createPassport:b,createPassportVC:_,upsertToPassports:T,createUserPassport:E,getRoleFromLocalPassport:S}=n(147),x=n(346),w=n(235),A={BLOCKLET:"blocklet",NODE:"node"},k=async({type:e,node:t,req:n})=>{let r,o,i,s,l;const c=await t.getNodeInfo();if(e===A.NODE)r=c.did,o=c.did,i=c.name,s=u(c.sk),l="default";else{if(!A.BLOCKLET)throw new Error("createLostPassportListRoute: unknown type");{r=n.headers["x-blocklet-did"];const e=await t.getBlocklet({did:r,attachRuntimeInfo:!1}),u=a(e,c.sk);o=u.wallet.address,i=p(e,!0),s=u.wallet,l=u.passportColor}}return{teamDid:r,issuerDid:o,issuerName:i,issuerWallet:s,passportColor:l}};e.exports={createLostPassportListRoute:({node:e,type:t})=>({action:"lost-passport-list",claims:{profile:async({extraParams:e})=>{const{locale:t}=e;return{fields:["fullName"],description:g.description[t]}}},onAuth:async({userDid:n,extraParams:r,updateSession:o,req:a})=>{const{locale:s}=r,{teamDid:l,issuerDid:u}=await k({node:e,req:a,type:t}),p=await m(e,l,n);if(!p)throw new Error(g.userNotFound[s]);if(!p.approved)throw new Error(g.notAllowed[s]);if(p.passportTypes=i((p.passports||[]).filter(e=>e.status===d.VALID&&(e.issuer.id===u&&!(e.expirationDate&&Date.now()>new Date(e.expirationDate).getTime()))),"name"),!p.passportTypes.length)throw new Error(g.passportNotFound[s]);h.info("get passport type list",{userDid:n}),await o({user:p})}}),createLostPassportIssueRoute:({node:e,type:t,authServicePrefix:n})=>({action:"lost-passport-issue",authPrincipal:!1,claims:[{authPrincipal:async({extraParams:e})=>{const{receiverDid:t}=e;return{description:"Please select the required DID",target:t}}},{signature:async({extraParams:n,context:{request:r,didwallet:o}})=>{const{locale:i,passportName:a,receiverDid:s}=n;y({didwallet:o,locale:i});const{teamDid:u,issuerDid:p,issuerName:c,passportColor:d}=await k({node:e,req:r,type:t}),f=await m(e,u,s),h=await b({name:a,node:e,teamDid:u,locale:i});return{description:g.receivePassport[i],data:l(),type:"mime:text/plain",display:JSON.stringify({type:"svg",content:w({issuer:c,title:h.title,issuerDid:p,ownerName:f.fullName||"",ownerAvatarUrl:f.avatar||"",preferredColor:d})})}}}],onAuth:async({claims:i,userDid:a,userPk:l,extraParams:u,updateSession:p,baseUrl:y,req:w})=>{const{locale:M="en",receiverDid:O,passportName:D}=u,{teamDid:I,issuerDid:R,issuerName:N,issuerWallet:C,passportColor:F}=await k({node:e,req:w,type:t}),L=((e,t,n)=>e===A.BLOCKLET?o(t,n):t)(t,y,n),j=i.find(e=>"signature"===e.type);if(h.info("claim.signature.onAuth",{userPk:l,userDid:a,claim:j}),x(j,a,l,M),O!==a)throw new Error({en:"userDid and receiverDid are not same",zh:"userDid 和 receiverDid 不一致"}[M]);const B=await m(e,I,a);if(!B.approved)throw new Error(g.notAllowed[M]);if(!(B.passports||[]).find(e=>e.name===D&&e.status===d.VALID&&e.issuer.id===R&&(!e.expirationDate||Date.now()>new Date(e.expirationDate).getTime())))throw new Error({en:"Passport does not exist",zh:"通行证不存在"}[M]);const P={issuerName:N,issuerWallet:C,ownerDid:a,passport:await b({name:D,node:e,teamDid:I,locale:M,endpoint:y}),endpoint:v({baseUrl:L,userDid:a,teamDid:I}),types:[],ownerProfile:B,preferredColor:F};t===A.NODE&&(P.types=[c],P.tag=I);const H=_(P),U=S(f(H,"credentialSubject.passport")),$=E(H,{role:U}),W=await e.updateUser({teamDid:I,user:{did:a,pk:l,passports:T(B.passports||[],$)}});return await e.createAuditLog({action:"updateUser",args:{teamDid:I,userDid:a,passport:$,reason:"recovered passport"},context:s(r(w,{user:B})),result:W},e),await p({passportId:H.id}),{disposition:"attachment",type:"VerifiableCredential",data:H}}}),TEAM_TYPES:A}},function(e,t){e.exports=e=>"string"==typeof e&&e&&"/"!==e?`/${e}/`.replace(/\/+/g,"/"):"/"},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(2),o=n(19),i=n(31),a=n(51),s=n(1);function l(e,t){switch(e.kind){case s.a.NULL:return null;case s.a.INT:return parseInt(e.value,10);case s.a.FLOAT:return parseFloat(e.value);case s.a.STRING:case s.a.ENUM:case s.a.BOOLEAN:return e.value;case s.a.LIST:return e.values.map((function(e){return l(e,t)}));case s.a.OBJECT:return Object(i.a)(e.fields,(function(e){return e.name.value}),(function(e){return l(e.value,t)}));case s.a.VARIABLE:var n=e.name.value;return t&&!Object(a.a)(t[n])?t[n]:void 0}Object(o.a)(!1,"Unexpected value node: "+Object(r.a)(e))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return s}));var r=n(6),o=n(3),i=/^[_a-zA-Z][_a-zA-Z0-9]*$/;function a(e){var t=s(e);if(t)throw t;return e}function s(e,t){return"string"==typeof e||Object(r.a)(0,"Expected string"),e.length>1&&"_"===e[0]&&"_"===e[1]?new o.a('Name "'.concat(e,'" must not begin with "__", which is reserved by GraphQL introspection.'),t):i.test(e)?void 0:new o.a('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "'.concat(e,'" does not.'),t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(3),o=n(1),i=n(64);function a(e){return{Document:function(t){for(var n=0,a=t.definitions;n<a.length;n++){var s=a[n];Object(i.b)(s)||e.reportError(new r.a((l=s.kind===o.a.SCHEMA_DEFINITION||s.kind===o.a.SCHEMA_EXTENSION?"schema":s.name.value,"The ".concat(l," definition is not executable.")),s))}var l;return!1}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e){var t=Object.create(null);return{OperationDefinition:function(n){var o=n.name;return o&&(t[o.value]?e.reportError(new r.a(function(e){return'There can be only one operation named "'.concat(e,'".')}(o.value),[t[o.value],o])):t[o.value]=o),!1},FragmentDefinition:function(){return!1}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3),o=n(1);function i(e){var t=0;return{Document:function(e){t=e.definitions.filter((function(e){return e.kind===o.a.OPERATION_DEFINITION})).length},OperationDefinition:function(n){!n.name&&t>1&&e.reportError(new r.a("This anonymous operation must be the only defined operation.",n))}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e){return{OperationDefinition:function(t){var n;"subscription"===t.operation&&1!==t.selectionSet.selections.length&&e.reportError(new r.a((n=t.name&&t.name.value)?'Subscription "'.concat(n,'" must select only one top level field.'):"Anonymous Subscription must select only one top level field.",t.selectionSet.selections.slice(1)))}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(3),o=n(18),i=n(0),a=n(33);function s(e){return{InlineFragment:function(t){var n=t.typeCondition;if(n){var s=Object(a.a)(e.getSchema(),n);s&&!Object(i.D)(s)&&e.reportError(new r.a(function(e){return'Fragment cannot condition on non composite type "'.concat(e,'".')}(Object(o.print)(n)),n))}},FragmentDefinition:function(t){var n=Object(a.a)(e.getSchema(),t.typeCondition);n&&!Object(i.D)(n)&&e.reportError(new r.a(function(e,t){return'Fragment "'.concat(e,'" cannot condition on non composite type "').concat(t,'".')}(t.name.value,Object(o.print)(t.typeCondition)),t.typeCondition))}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(3),o=n(18),i=n(0),a=n(33);function s(e){return{VariableDefinition:function(t){var n=Object(a.a)(e.getSchema(),t.type);if(n&&!Object(i.G)(n)){var s=t.variable.name.value;e.reportError(new r.a(function(e,t){return'Variable "$'.concat(e,'" cannot be non-input type "').concat(t,'".')}(s,Object(o.print)(t.type)),t.type))}}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(2),o=n(3),i=n(0);function a(e){return{Field:function(t){var n=e.getType(),a=t.selectionSet;n&&(Object(i.I)(Object(i.A)(n))?a&&e.reportError(new o.a(function(e,t){return'Field "'.concat(e,'" must not have a selection since type "').concat(t,'" has no subfields.')}(t.name.value,Object(r.a)(n)),a)):a||e.reportError(new o.a(function(e,t){return'Field "'.concat(e,'" of type "').concat(t,'" must have a selection of subfields. Did you mean "').concat(e,' { ... }"?')}(t.name.value,Object(r.a)(n)),t)))}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(42),o=n(50),i=n(3),a=n(0);function s(e){return{Field:function(t){var n=e.getParentType();if(n&&!e.getFieldDef()){var s=e.getSchema(),l=t.name.value,u=function(e,t,n){if(Object(a.C)(t)){for(var r=[],o=Object.create(null),i=0,s=e.getPossibleTypes(t);i<s.length;i++){var l=s[i];if(l.getFields()[n]){r.push(l.name);for(var u=0,p=l.getInterfaces();u<p.length;u++){var c=p[u];c.getFields()[n]&&(o[c.name]=(o[c.name]||0)+1)}}}return Object.keys(o).sort((function(e,t){return o[t]-o[e]})).concat(r)}return[]}(s,n,l),p=0!==u.length?[]:function(e,t,n){if(Object(a.N)(t)||Object(a.H)(t)){var r=Object.keys(t.getFields());return Object(o.a)(n,r)}return[]}(0,n,l);e.reportError(new i.a(function(e,t,n,o){var i=n.map((function(e){return'"'.concat(e,'"')})),a=o.map((function(e){return'"'.concat(e,'"')}));return'Cannot query field "'.concat(e,'" on type "').concat(t,'".')+(Object(r.a)("to use an inline fragment on",i)||Object(r.a)(a))}(l,n.name,u,p),t))}}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e){var t=Object.create(null);return{OperationDefinition:function(){return!1},FragmentDefinition:function(n){var o=n.name.value;return t[o]?e.reportError(new r.a('There can be only one fragment named "'.concat(o,'".'),[t[o],n.name])):t[o]=n.name,!1}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e){return{FragmentSpread:function(t){var n=t.name.value;e.getFragment(n)||e.reportError(new r.a('Unknown fragment "'.concat(n,'".'),t.name))}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3);function o(e){return'Fragment "'.concat(e,'" is never used.')}function i(e){var t=[],n=[];return{OperationDefinition:function(e){return t.push(e),!1},FragmentDefinition:function(e){return n.push(e),!1},Document:{leave:function(){for(var i=Object.create(null),a=0;a<t.length;a++)for(var s=t[a],l=0,u=e.getRecursivelyReferencedFragments(s);l<u.length;l++){i[u[l].name.value]=!0}for(var p=0;p<n.length;p++){var c=n[p],d=c.name.value;!0!==i[d]&&e.reportError(new r.a(o(d),c))}}}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(2),o=n(3),i=n(0),a=n(33),s=n(101);function l(e){return{InlineFragment:function(t){var n=e.getType(),a=e.getParentType();Object(i.D)(n)&&Object(i.D)(a)&&!Object(s.a)(e.getSchema(),n,a)&&e.reportError(new o.a(function(e,t){return'Fragment cannot be spread here as objects of type "'.concat(e,'" can never be of type "').concat(t,'".')}(Object(r.a)(a),Object(r.a)(n)),t))},FragmentSpread:function(t){var n=t.name.value,l=function(e,t){var n=e.getFragment(t);if(n){var r=Object(a.a)(e.getSchema(),n.typeCondition);if(Object(i.D)(r))return r}}(e,n),u=e.getParentType();l&&u&&!Object(s.a)(e.getSchema(),l,u)&&e.reportError(new o.a(function(e,t,n){return'Fragment "'.concat(e,'" cannot be spread here as objects of type "').concat(t,'" can never be of type "').concat(n,'".')}(n,Object(r.a)(u),Object(r.a)(l)),t))}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e){var t=Object.create(null),n=[],o=Object.create(null);return{OperationDefinition:function(){return!1},FragmentDefinition:function(i){return function i(a){if(t[a.name.value])return;var s=a.name.value;t[s]=!0;var l=e.getFragmentSpreads(a.selectionSet);if(0===l.length)return;o[s]=n.length;for(var u=0;u<l.length;u++){var p=l[u],c=p.name.value,d=o[c];if(n.push(p),void 0===d){var f=e.getFragment(c);f&&i(f)}else{var h=n.slice(d),g=h.slice(0,-1).map((function(e){return e.name.value}));e.reportError(new r.a((m=c,v=void 0,v=(y=g).length?" via "+y.join(", "):"",'Cannot spread fragment "'.concat(m,'" within itself').concat(v,".")),h))}n.pop()}var m,y,v;o[s]=void 0}(i),!1}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e){var t=Object.create(null);return{OperationDefinition:function(){t=Object.create(null)},VariableDefinition:function(n){var o=n.variable.name.value;t[o]?e.reportError(new r.a(function(e){return'There can be only one variable named "'.concat(e,'".')}(o),[t[o],n.variable.name])):t[o]=n.variable.name}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3);function o(e,t){return t?'Variable "$'.concat(e,'" is not defined by operation "').concat(t,'".'):'Variable "$'.concat(e,'" is not defined.')}function i(e){var t=Object.create(null);return{OperationDefinition:{enter:function(){t=Object.create(null)},leave:function(n){for(var i=e.getRecursiveVariableUsages(n),a=0;a<i.length;a++){var s=i[a].node,l=s.name.value;!0!==t[l]&&e.reportError(new r.a(o(l,n.name&&n.name.value),[s,n]))}}},VariableDefinition:function(e){t[e.variable.name.value]=!0}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(3);function o(e,t){return t?'Variable "$'.concat(e,'" is never used in operation "').concat(t,'".'):'Variable "$'.concat(e,'" is never used.')}function i(e){var t=[];return{OperationDefinition:{enter:function(){t=[]},leave:function(n){for(var i=Object.create(null),a=e.getRecursiveVariableUsages(n),s=n.name?n.name.value:null,l=0;l<a.length;l++){i[a[l].node.name.value]=!0}for(var u=0,p=t;u<p.length;u++){var c=p[u],d=c.variable.name.value;!0!==i[d]&&e.reportError(new r.a(o(d,s),c))}}},VariableDefinition:function(e){t.push(e)}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(2),o=n(3),i=n(1),a=n(0),s=n(33),l=n(101);function u(e,t,n){return'Variable "$'.concat(e,'" of type "').concat(t,'" used in position expecting type "').concat(n,'".')}function p(e){var t=Object.create(null);return{OperationDefinition:{enter:function(){t=Object.create(null)},leave:function(n){for(var i=e.getRecursiveVariableUsages(n),a=0;a<i.length;a++){var l=i[a],p=l.node,d=l.type,f=l.defaultValue,h=p.name.value,g=t[h];if(g&&d){var m=e.getSchema(),y=Object(s.a)(m,g.type);y&&!c(m,y,g.defaultValue,d,f)&&e.reportError(new o.a(u(h,Object(r.a)(y),Object(r.a)(d)),[g,p]))}}}},VariableDefinition:function(e){t[e.variable.name.value]=e}}}function c(e,t,n,r,o){if(Object(a.L)(r)&&!Object(a.L)(t)){if(!(null!=n&&n.kind!==i.a.NULL)&&!(void 0!==o))return!1;var s=r.ofType;return Object(l.c)(e,t,s)}return Object(l.c)(e,t,r)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(83),o=n(63),i=n(2),a=n(3),s=n(1),l=n(18),u=n(0),p=n(33);function c(e,t){return'Fields "'.concat(e,'" conflict because ').concat(function e(t){if(Array.isArray(t))return t.map((function(t){var n=t[0],r=t[1];return'subfields "'.concat(n,'" conflict because ').concat(e(r))})).join(" and ");return t}(t),". ")+"Use different aliases on the fields to fetch both if this was intentional."}function d(e){var t=new b,n=new Map;return{SelectionSet:function(r){for(var i=function(e,t,n,r,i){var a=[],s=y(e,t,r,i),l=s[0],u=s[1];if(function(e,t,n,r,i){for(var a=0,s=Object(o.a)(i);a<s.length;a++){var l=s[a],u=l[0],p=l[1];if(p.length>1)for(var c=0;c<p.length;c++)for(var d=c+1;d<p.length;d++){var f=m(e,n,r,!1,u,p[c],p[d]);f&&t.push(f)}}}(e,a,t,n,l),0!==u.length)for(var p=Object.create(null),c=0;c<u.length;c++){f(e,a,t,p,n,!1,l,u[c]);for(var d=c+1;d<u.length;d++)h(e,a,t,n,!1,u[c],u[d])}return a}(e,n,t,e.getParentType(),r),s=0;s<i.length;s++){var l=i[s],u=l[0],p=u[0],d=u[1],g=l[1],v=l[2];e.reportError(new a.a(c(p,d),g.concat(v)))}}}}function f(e,t,n,r,o,i,a,s){if(!r[s]){r[s]=!0;var l=e.getFragment(s);if(l){var u=v(e,n,l),p=u[0],c=u[1];if(a!==p){g(e,t,n,o,i,a,p);for(var d=0;d<c.length;d++)f(e,t,n,r,o,i,a,c[d])}}}}function h(e,t,n,r,o,i,a){if(i!==a&&!r.has(i,a,o)){r.add(i,a,o);var s=e.getFragment(i),l=e.getFragment(a);if(s&&l){var u=v(e,n,s),p=u[0],c=u[1],d=v(e,n,l),f=d[0],m=d[1];g(e,t,n,r,o,p,f);for(var y=0;y<m.length;y++)h(e,t,n,r,o,i,m[y]);for(var b=0;b<c.length;b++)h(e,t,n,r,o,c[b],a)}}}function g(e,t,n,r,o,i,a){for(var s=0,l=Object.keys(i);s<l.length;s++){var u=l[s],p=a[u];if(p)for(var c=i[u],d=0;d<c.length;d++)for(var f=0;f<p.length;f++){var h=m(e,n,r,o,u,c[d],p[f]);h&&t.push(h)}}}function m(e,t,n,o,a,s,p){var c=s[0],d=s[1],m=s[2],v=p[0],b=p[1],_=p[2],T=o||c!==v&&Object(u.N)(c)&&Object(u.N)(v),E=m&&m.type,S=_&&_.type;if(!T){var x=d.name.value,w=b.name.value;if(x!==w)return[[a,"".concat(x," and ").concat(w," are different fields")],[d],[b]];if(!function(e,t){if(e.length!==t.length)return!1;return e.every((function(e){var n,o,i=Object(r.a)(t,(function(t){return t.name.value===e.name.value}));return!!i&&(n=e.value,o=i.value,!n&&!o||Object(l.print)(n)===Object(l.print)(o))}))}(d.arguments||[],b.arguments||[]))return[[a,"they have differing arguments"],[d],[b]]}if(E&&S&&function e(t,n){if(Object(u.J)(t))return!Object(u.J)(n)||e(t.ofType,n.ofType);if(Object(u.J)(n))return!0;if(Object(u.L)(t))return!Object(u.L)(n)||e(t.ofType,n.ofType);if(Object(u.L)(n))return!0;if(Object(u.I)(t)||Object(u.I)(n))return t!==n;return!1}(E,S))return[[a,"they return conflicting types ".concat(Object(i.a)(E)," and ").concat(Object(i.a)(S))],[d],[b]];var A=d.selectionSet,k=b.selectionSet;return A&&k?function(e,t,n,r){if(e.length>0)return[[t,e.map((function(e){return e[0]}))],e.reduce((function(e,t){var n=t[1];return e.concat(n)}),[n]),e.reduce((function(e,t){var n=t[2];return e.concat(n)}),[r])]}(function(e,t,n,r,o,i,a,s){var l=[],u=y(e,t,o,i),p=u[0],c=u[1],d=y(e,t,a,s),m=d[0],v=d[1];if(g(e,l,t,n,r,p,m),0!==v.length)for(var b=Object.create(null),_=0;_<v.length;_++)f(e,l,t,b,n,r,p,v[_]);if(0!==c.length)for(var T=Object.create(null),E=0;E<c.length;E++)f(e,l,t,T,n,r,m,c[E]);for(var S=0;S<c.length;S++)for(var x=0;x<v.length;x++)h(e,l,t,n,r,c[S],v[x]);return l}(e,t,n,T,Object(u.A)(E),A,Object(u.A)(S),k),a,d,b):void 0}function y(e,t,n,r){var o=t.get(r);if(!o){var i=Object.create(null),a=Object.create(null);!function e(t,n,r,o,i){for(var a=0,l=r.selections;a<l.length;a++){var c=l[a];switch(c.kind){case s.a.FIELD:var d=c.name.value,f=void 0;(Object(u.N)(n)||Object(u.H)(n))&&(f=n.getFields()[d]);var h=c.alias?c.alias.value:d;o[h]||(o[h]=[]),o[h].push([n,c,f]);break;case s.a.FRAGMENT_SPREAD:i[c.name.value]=!0;break;case s.a.INLINE_FRAGMENT:var g=c.typeCondition,m=g?Object(p.a)(t.getSchema(),g):n;e(t,m,c.selectionSet,o,i)}}}(e,n,r,i,a),o=[i,Object.keys(a)],t.set(r,o)}return o}function v(e,t,n){var r=t.get(n.selectionSet);if(r)return r;var o=Object(p.a)(e.getSchema(),n.typeCondition);return y(e,t,o,n.selectionSet)}var b=function(){function e(){this._data=Object.create(null)}var t=e.prototype;return t.has=function(e,t,n){var r=this._data[e],o=r&&r[t];return void 0!==o&&(!1!==n||!1===o)},t.add=function(e,t,n){_(this._data,e,t,n),_(this._data,t,e,n)},e}();function _(e,t,n,r){var o=e[t];o||(o=Object.create(null),e[t]=o),o[n]=r}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e){var t=e.getSchema(),n=t&&(t.astNode||t.getQueryType()||t.getMutationType()||t.getSubscriptionType()),o=0;return{SchemaDefinition:function(t){n?e.reportError(new r.a("Cannot define a new schema within a schema extension.",t)):(o>0&&e.reportError(new r.a("Must provide only one schema definition.",t)),++o)}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(3);function o(e){return"There can be only one ".concat(e," type in schema.")}function i(e){return"Type for ".concat(e," already defined in the schema. It cannot be redefined.")}function a(e){var t=e.getSchema(),n=Object.create(null),a=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:s,SchemaExtension:s};function s(t){if(t.operationTypes)for(var s=0,l=t.operationTypes||[];s<l.length;s++){var u=l[s],p=u.operation,c=n[p];a[p]?e.reportError(new r.a(i(p),u)):c?e.reportError(new r.a(o(p),[c,u])):n[p]=u}return!1}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e){var t=Object.create(null),n=e.getSchema();return{ScalarTypeDefinition:o,ObjectTypeDefinition:o,InterfaceTypeDefinition:o,UnionTypeDefinition:o,EnumTypeDefinition:o,InputObjectTypeDefinition:o};function o(o){var i=o.name.value;if(!n||!n.getType(i))return t[i]?e.reportError(new r.a(function(e){return'There can be only one type named "'.concat(e,'".')}(i),[t[i],o.name])):t[i]=o.name,!1;e.reportError(new r.a(function(e){return'Type "'.concat(e,'" already exists in the schema. It cannot also be defined in this type definition.')}(i),o.name))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(3),o=n(0);function i(e,t){return'Enum value "'.concat(e,".").concat(t,'" can only be defined once.')}function a(e,t){return'Enum value "'.concat(e,".").concat(t,'" already exists in the schema. It cannot also be defined in this type extension.')}function s(e){var t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),s=Object.create(null);return{EnumTypeDefinition:l,EnumTypeExtension:l};function l(t){var l=t.name.value;if(s[l]||(s[l]=Object.create(null)),t.values)for(var u=s[l],p=0,c=t.values;p<c.length;p++){var d=c[p],f=d.name.value,h=n[l];Object(o.E)(h)&&h.getValue(f)?e.reportError(new r.a(a(l,f),d.name)):u[f]?e.reportError(new r.a(i(l,f),[u[f],d.name])):u[f]=d.name}return!1}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(3),o=n(0);function i(e,t){return'Field "'.concat(e,".").concat(t,'" can only be defined once.')}function a(e,t){return'Field "'.concat(e,".").concat(t,'" already exists in the schema. It cannot also be defined in this type extension.')}function s(e){var t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),o=Object.create(null);return{InputObjectTypeDefinition:s,InputObjectTypeExtension:s,InterfaceTypeDefinition:s,InterfaceTypeExtension:s,ObjectTypeDefinition:s,ObjectTypeExtension:s};function s(t){var s=t.name.value;if(o[s]||(o[s]=Object.create(null)),t.fields)for(var u=o[s],p=0,c=t.fields;p<c.length;p++){var d=c[p],f=d.name.value;l(n[s],f)?e.reportError(new r.a(a(s,f),d.name)):u[f]?e.reportError(new r.a(i(s,f),[u[f],d.name])):u[f]=d.name}return!1}}function l(e,t){return!!(Object(o.N)(e)||Object(o.H)(e)||Object(o.F)(e))&&e.getFields()[t]}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e){var t=Object.create(null),n=e.getSchema();return{DirectiveDefinition:function(o){var i=o.name.value;if(!n||!n.getDirective(i))return t[i]?e.reportError(new r.a(function(e){return'There can be only one directive named "'.concat(e,'".')}(i),[t[i],o.name])):t[i]=o.name,!1;e.reportError(new r.a(function(e){return'Directive "'.concat(e,'" already exists in the schema. It cannot be redefined.')}(i),o.name))}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r,o=n(42),i=n(50),a=n(3),s=n(1),l=n(64),u=n(0);function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){return"Cannot extend non-".concat(t,' type "').concat(e,'".')}function d(e){for(var t=e.getSchema(),n=Object.create(null),r=0,p=e.getDocument().definitions;r<p.length;r++){var d=p[r];Object(l.d)(d)&&(n[d.name.value]=d)}return{ScalarTypeExtension:g,ObjectTypeExtension:g,InterfaceTypeExtension:g,UnionTypeExtension:g,EnumTypeExtension:g,InputObjectTypeExtension:g};function g(r){var l=r.name.value,p=n[l],d=t&&t.getType(l);if(p){var g=f[p.kind];g!==r.kind&&e.reportError(new a.a(c(l,h(g)),[p,r]))}else if(d){var m=function(e){if(Object(u.R)(e))return s.a.SCALAR_TYPE_EXTENSION;if(Object(u.N)(e))return s.a.OBJECT_TYPE_EXTENSION;if(Object(u.H)(e))return s.a.INTERFACE_TYPE_EXTENSION;if(Object(u.T)(e))return s.a.UNION_TYPE_EXTENSION;if(Object(u.E)(e))return s.a.ENUM_TYPE_EXTENSION;if(Object(u.F)(e))return s.a.INPUT_OBJECT_TYPE_EXTENSION}(d);m!==r.kind&&e.reportError(new a.a(c(l,h(m)),r))}else{var y=Object.keys(n);t&&(y=y.concat(Object.keys(t.getTypeMap())));var v=Object(i.a)(l,y);e.reportError(new a.a(function(e,t){return'Cannot extend type "'.concat(e,'" because it is not defined.')+Object(o.a)(t.map((function(e){return'"'.concat(e,'"')})))}(l,v),r.name))}}}var f=(p(r={},s.a.SCALAR_TYPE_DEFINITION,s.a.SCALAR_TYPE_EXTENSION),p(r,s.a.OBJECT_TYPE_DEFINITION,s.a.OBJECT_TYPE_EXTENSION),p(r,s.a.INTERFACE_TYPE_DEFINITION,s.a.INTERFACE_TYPE_EXTENSION),p(r,s.a.UNION_TYPE_DEFINITION,s.a.UNION_TYPE_EXTENSION),p(r,s.a.ENUM_TYPE_DEFINITION,s.a.ENUM_TYPE_EXTENSION),p(r,s.a.INPUT_OBJECT_TYPE_DEFINITION,s.a.INPUT_OBJECT_TYPE_EXTENSION),r);function h(e){switch(e){case s.a.SCALAR_TYPE_EXTENSION:return"scalar";case s.a.OBJECT_TYPE_EXTENSION:return"object";case s.a.INTERFACE_TYPE_EXTENSION:return"interface";case s.a.UNION_TYPE_EXTENSION:return"union";case s.a.ENUM_TYPE_EXTENSION:return"enum";case s.a.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:return"unknown type"}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return E})),n.d(t,"a",(function(){return x})),n.d(t,"d",(function(){return k})),n.d(t,"c",(function(){return M}));var r=n(12),o=n(38),i=n(2),a=n(19),s=n(6),l=n(31),u=n(1),p=n(5),c=n(92),d=n(64),f=n(82),h=n(155),g=n(127),m=n(14),y=n(13),v=n(62),b=n(15),_=n(0),T=n(109);function E(e,t){var n;e&&e.kind===u.a.DOCUMENT||Object(s.a)(0,"Must provide valid Document AST"),t&&(t.assumeValid||t.assumeValidSDL)||Object(h.a)(e);for(var o=[],i=[],a=0,l=e.definitions;a<l.length;a++){var p=l[a];p.kind===u.a.SCHEMA_DEFINITION?n=p:Object(d.d)(p)?o.push(p):p.kind===u.a.DIRECTIVE_DEFINITION&&i.push(p)}var c=new x(t,(function(e){var t=f[e];if(void 0===t)throw new Error('Type "'.concat(e,'" not found in document.'));return t})),f=w(o,(function(e){return c.buildType(e)})),g=n?function(e){for(var t={},n=0,r=e.operationTypes;n<r.length;n++){var o=r[n];t[o.operation]=o.type.name.value}return t}(n):{query:"Query",mutation:"Mutation",subscription:"Subscription"},m=i.map((function(e){return c.buildDirective(e)}));return m.some((function(e){return"skip"===e.name}))||m.push(b.e),m.some((function(e){return"include"===e.name}))||m.push(b.d),m.some((function(e){return"deprecated"===e.name}))||m.push(b.b),new v.a({query:g.query?f[g.query]:null,mutation:g.mutation?f[g.mutation]:null,subscription:g.subscription?f[g.subscription]:null,types:Object(r.a)(f),directives:m,astNode:n,assumeValid:t&&t.assumeValid,allowedLegacyNames:t&&t.allowedLegacyNames})}var S=Object(o.a)(m.g.concat(y.m),(function(e){return e.name})),x=function(){function e(e,t){this._options=e,this._resolveType=t}var t=e.prototype;return t.getNamedType=function(e){var t=e.name.value;return S[t]||this._resolveType(t)},t.getWrappedType=function(e){return e.kind===u.a.LIST_TYPE?new _.d(this.getWrappedType(e.type)):e.kind===u.a.NON_NULL_TYPE?new _.e(this.getWrappedType(e.type)):this.getNamedType(e)},t.buildDirective=function(e){var t=this,n=e.locations.map((function(e){return e.value}));return new b.c({name:e.name.value,description:k(e,this._options),locations:n,isRepeatable:e.repeatable,args:w(e.arguments||[],(function(e){return t.buildArg(e)})),astNode:e})},t.buildField=function(e){var t=this;return{type:this.getWrappedType(e.type),description:k(e,this._options),args:w(e.arguments||[],(function(e){return t.buildArg(e)})),deprecationReason:A(e),astNode:e}},t.buildArg=function(e){var t=this.getWrappedType(e.type);return{type:t,description:k(e,this._options),defaultValue:Object(T.a)(e.defaultValue,t),astNode:e}},t.buildInputField=function(e){var t=this.getWrappedType(e.type);return{type:t,description:k(e,this._options),defaultValue:Object(T.a)(e.defaultValue,t),astNode:e}},t.buildEnumValue=function(e){return{description:k(e,this._options),deprecationReason:A(e),astNode:e}},t.buildType=function(e){var t=e.name.value;if(S[t])return S[t];switch(e.kind){case u.a.OBJECT_TYPE_DEFINITION:return this._makeTypeDef(e);case u.a.INTERFACE_TYPE_DEFINITION:return this._makeInterfaceDef(e);case u.a.ENUM_TYPE_DEFINITION:return this._makeEnumDef(e);case u.a.UNION_TYPE_DEFINITION:return this._makeUnionDef(e);case u.a.SCALAR_TYPE_DEFINITION:return this._makeScalarDef(e);case u.a.INPUT_OBJECT_TYPE_DEFINITION:return this._makeInputObjectDef(e)}Object(a.a)(!1,"Unexpected type definition node: "+Object(i.a)(e))},t._makeTypeDef=function(e){var t=this,n=e.interfaces,r=e.fields,o=n&&n.length>0?function(){return n.map((function(e){return t.getNamedType(e)}))}:[],i=r&&r.length>0?function(){return w(r,(function(e){return t.buildField(e)}))}:Object.create(null);return new _.f({name:e.name.value,description:k(e,this._options),interfaces:o,fields:i,astNode:e})},t._makeInterfaceDef=function(e){var t=this,n=e.fields,r=n&&n.length>0?function(){return w(n,(function(e){return t.buildField(e)}))}:Object.create(null);return new _.c({name:e.name.value,description:k(e,this._options),fields:r,astNode:e})},t._makeEnumDef=function(e){var t=this,n=e.values||[];return new _.a({name:e.name.value,description:k(e,this._options),values:w(n,(function(e){return t.buildEnumValue(e)})),astNode:e})},t._makeUnionDef=function(e){var t=this,n=e.types,r=n&&n.length>0?function(){return n.map((function(e){return t.getNamedType(e)}))}:[];return new _.h({name:e.name.value,description:k(e,this._options),types:r,astNode:e})},t._makeScalarDef=function(e){return new _.g({name:e.name.value,description:k(e,this._options),astNode:e})},t._makeInputObjectDef=function(e){var t=this,n=e.fields;return new _.b({name:e.name.value,description:k(e,this._options),fields:n?function(){return w(n,(function(e){return t.buildInputField(e)}))}:Object.create(null),astNode:e})},e}();function w(e,t){return Object(l.a)(e,(function(e){return e.name.value}),t)}function A(e){var t=Object(g.b)(b.b,e);return t&&t.reason}function k(e,t){if(e.description)return e.description.value;if(t&&t.commentDescriptions){var n=function(e){var t=e.loc;if(!t)return;var n=[],r=t.startToken.prev;for(;r&&r.kind===p.a.COMMENT&&r.next&&r.prev&&r.line+1===r.next.line&&r.line!==r.prev.line;){var o=String(r.value);n.push(o),r=r.prev}return n.reverse().join("\n")}(e);if(void 0!==n)return Object(f.a)("\n"+n)}}function M(e,t){return E(Object(c.parse)(e,t),t)}},function(e,t,n){function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const o=n(9),i=n(758),a=n(760),s=n(776),l=n(251);n(830);const u=n(392),p=n(376),c=n(832),d=n(834),{graphqlUploadExpress:f}=n(393),h=n(398),g=n(893),m=n(898),y=n(899),{MAX_UPLOAD_FILE_SIZE:v}=n(25),b=n(37),{setUserInfoHeaders:_}=n(44),T=n(40),E=n(1353),{BlockletStatus:S}=n(100),x=n(1376),{authWithJwt:w,authWithAccessKey:A,authWithVcPresentation:k}=n(124),{context:M,handlers:O}=n(1378),{protectGQL:D}=n(1446),I=n(1447),R=n(1462),N=T("webapp:index"),C=n(1472),F=n(1473),L=n(1474),j=n(1475),B=n(1476),P=n(1477),H=n(1478),U=n(1480),$=n(1481),W=n(1482),V=n(1483),Y=n(1485),z=n(1486),G=n(1487),q=n(1488),K=n(1489),J=n(1490),X=n(1491),Q=n(1494),Z=n(1507),ee=n(1508),te=n(1509),ne=1024*Number(process.env.MAX_UPLOAD_FILE_SIZE||v)*1024;e.exports=function(e){if(!process.env.ABT_NODE_DATA_DIR)throw new Error("Cannot start application without process.env.ABT_NODE_DATA_DIR");M.set("node",e);const t=l();t.set("trust proxy","loopback"),t.disable("x-powered-by"),t.use(a()),t.use(u()),t.use(p.json({limit:"4mb"})),t.use(p.urlencoded({extended:!0,limit:"2mb"})),t.use(i()),t.get("/error/502",async(t,n)=>{try{n.type("html"),n.status(502);const r=t.get("x-did"),o=await e.getNodeInfo(),i={version:o.version,mode:o.mode};if(r){const t=await e.getBlocklet({did:r,attachConfig:!1});return t?t.status===S.starting?n.send(y(t,o)):n.send(m(t,o)):n.send(g(i))}return n.send(g(i))}catch(e){return N.error("render 502 page failed",{error:e}),n.send("502 Error")}}),t.use(s("combined",{stream:T.getAccessLogStream(process.env.ABT_NODE_LOG_DIR)})),t.use(c()),t.use(async(t,n,r)=>{try{const{token:n,headers:r,body:o}=t;if(n){const r=await w(n,e);t.user=r}else if(r["x-access-key-id"]&&r["x-access-stamp"]&&r["x-access-signature"]){const n=await A({keyId:r["x-access-key-id"],stamp:r["x-access-stamp"],signature:r["x-access-signature"],node:e,blockletDid:r["x-access-blocklet"],serviceName:r["x-access-service"]});t.user=n}else o["x-authenticate"]&&o["x-authenticate"].vcPresentation&&(t.user=await k({node:e,vcPresentation:o["x-authenticate"].vcPresentation,challenge:o["x-authenticate"].challenge}))}catch(e){}r()}),t.use(async(e,t,n)=>{_(e),n()}),t.use(E.createRoutes(e.dataDirs.certManagerModule));const n=l.Router();O.attach(r({app:n},C(e))),O.attach(r({app:n},F(e))),O.attach(r({app:n},L(e))),O.attach(r({app:n},j(e))),O.attach(r({app:n},B(e))),O.attach(r({app:n},P(e))),O.attach(r({app:n},H(e))),O.attach(r({app:n},U(e))),O.attach(r({app:n},$(e))),O.attach(r({app:n},W(e))),O.attach(r({app:n},V(e))),O.attach(r({app:n},Y(e))),O.attach(r({app:n},z(e))),O.attach(r({app:n},G(e))),O.attach(r({app:n},q(e))),O.attach(r({app:n},K(e))),J.init(n,e),X.init(n,e),Q.init(n,e),Z.init(n,e),ee.init(n,e),te.init(n,e),x.init(t,e,{prefix:"/api"});const v=I.genConfig(e);t.use("/api/gql",f({maxFileSize:ne,maxFiles:10}),D(e,v),I(v,!1));{t.use(n);const e=o.resolve(__dirname,"./build");t.use(h()),t.use(l.static(e,{maxAge:"365d",index:!1})),t.use(d("index.html",{root:e})),t.use((e,t)=>{t.status(404).send("404 NOT FOUND")}),t.use((e,t,n,r)=>{console.error(e.stack),n.status(500).send("Something broke!")})}const re=b.createServer(t);return R(e).attach(re),re.app=t,re}},function(e,t,n){!function(){"use strict";var t=n(759),r=n(248),o={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function i(e){return"string"==typeof e||e instanceof String}function a(e,t){var n,r=t.headers.origin,o=[];return e.origin&&"*"!==e.origin?i(e.origin)?(o.push([{key:"Access-Control-Allow-Origin",value:e.origin}]),o.push([{key:"Vary",value:"Origin"}])):(n=function e(t,n){if(Array.isArray(n)){for(var r=0;r<n.length;++r)if(e(t,n[r]))return!0;return!1}return i(n)?t===n:n instanceof RegExp?n.test(t):!!n}(r,e.origin),o.push([{key:"Access-Control-Allow-Origin",value:!!n&&r}]),o.push([{key:"Vary",value:"Origin"}])):o.push([{key:"Access-Control-Allow-Origin",value:"*"}]),o}function s(e){return!0===e.credentials?{key:"Access-Control-Allow-Credentials",value:"true"}:null}function l(e){var t=e.exposedHeaders;return t?(t.join&&(t=t.join(",")),t&&t.length?{key:"Access-Control-Expose-Headers",value:t}:null):null}function u(e,t){for(var n=0,o=e.length;n<o;n++){var i=e[n];i&&(Array.isArray(i)?u(i,t):"Vary"===i.key&&i.value?r(t,i.value):i.value&&t.setHeader(i.key,i.value))}}e.exports=function(e){var n=null;return n="function"==typeof e?e:function(t,n){n(null,e)},function(e,r,i){n(e,(function(n,p){if(n)i(n);else{var c=t({},o,p),d=null;c.origin&&"function"==typeof c.origin?d=c.origin:c.origin&&(d=function(e,t){t(null,c.origin)}),d?d(e.headers.origin,(function(t,n){t||!n?i(t):(c.origin=n,function(e,t,n,r){var o=[];"OPTIONS"===(t.method&&t.method.toUpperCase&&t.method.toUpperCase())?(o.push(a(e,t)),o.push(s(e)),o.push(function(e){var t=e.methods;return t.join&&(t=e.methods.join(",")),{key:"Access-Control-Allow-Methods",value:t}}(e)),o.push(function(e,t){var n=e.allowedHeaders||e.headers,r=[];return n?n.join&&(n=n.join(",")):(n=t.headers["access-control-request-headers"],r.push([{key:"Vary",value:"Access-Control-Request-Headers"}])),n&&n.length&&r.push([{key:"Access-Control-Allow-Headers",value:n}]),r}(e,t)),o.push(function(e){var t=("number"==typeof e.maxAge||e.maxAge)&&e.maxAge.toString();return t&&t.length?{key:"Access-Control-Max-Age",value:t}:null}(e)),o.push(l(e)),u(o,n),e.preflightContinue?r():(n.statusCode=e.optionsSuccessStatus,n.setHeader("Content-Length","0"),n.end())):(o.push(a(e,t)),o.push(s(e)),o.push(l(e)),u(o,n),r())}(c,e,r,i))})):i()}}))}}}()},function(e,t,n){"use strict";
|
|
498
498
|
/*
|
|
499
499
|
object-assign
|
|
500
500
|
(c) Sindre Sorhus
|
|
@@ -694,7 +694,7 @@ var n=/; *([!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) *= *("(?:[ !\u0023-\u005b\u005d-\u
|
|
|
694
694
|
* Copyright(c) 2012-2017 Holiday Extras.
|
|
695
695
|
* Copyright(c) 2017 Roger C.
|
|
696
696
|
* MIT Licensed
|
|
697
|
-
*/var r=n(17),o=n(9),i=n(4),a=n(20),s=n(24),l={};e.exports=l;var u=["daily","test","m","h","custom"];function p(e,t){if(e.hash===a.createHash(e.hashType).update(e.name+"LOG_FILE"+e.date).digest("hex"))try{r.existsSync(e.name)&&r.unlinkSync(e.name)}catch(n){t&&console.error(new Date,"[FileStreamRotator] Could not remove old log file: ",e.name)}}l.getFrequency=function(e){var t=e.toLowerCase().match(/^(\d+)([mh])$/);if(t)return function(e,t){if("number"==typeof t){switch(e){case"m":if(t<0||t>60)return!1;break;case"h":if(t<0||t>24)return!1}return{type:e,digit:t}}}(t[2],parseInt(t[1]));var n=function(e){switch(e){case"custom":case"daily":return{type:e,digit:void 0};case"test":return{type:e,digit:0}}return!1}(e);return n||!1},l.parseFileSize=function(e){if(e&&"string"==typeof e){var t=e.toLowerCase().match(/^((?:0\.)?\d+)([kmg])$/);if(t)switch(t[2]){case"k":return 1024*t[1];case"m":return 1024*t[1]*1024;case"g":return 1024*t[1]*1024*1024}}return null},l.getDate=function(e,t,n){t=t||"YYYYMMDDHHmm";let r=n?i.utc():i().local();if(e&&-1!==u.indexOf(e.type))switch(e.type){case"m":var o=Math.floor(r.minutes()/e.digit)*e.digit;return r.minutes(o).format(t);case"h":var a=Math.floor(r.hour()/e.digit)*e.digit;return r.hour(a).format(t);case"daily":case"custom":case"test":return r.format(t)}return r.format(t)},l.setAuditLog=function(e,t,n){var i=null;if(e){var a=e.toString().substr(-1),s=e.toString().match(/^(\d+)/);if(Number(s[1])>0){var l=o.dirname(n.replace(/%DATE%.+/,"_filename"));try{if(t){var u=o.resolve(t);i=JSON.parse(r.readFileSync(u,{encoding:"utf-8"}))}else{u=o.resolve(l+"/.audit.json");i=JSON.parse(r.readFileSync(u,{encoding:"utf-8"}))}}catch(e){if("ENOENT"!==e.code)return null;i={keep:{days:!1,amount:Number(s[1])},auditLog:t||l+"/.audit.json",files:[]}}i.keep={days:"d"===a,amount:Number(s[1])}}}return i},l.writeAuditLog=function(e,t){try{c(e.auditLog),r.writeFileSync(e.auditLog,JSON.stringify(e,null,4))}catch(n){t&&console.error(new Date,"[FileStreamRotator] Failed to store log audit at:",e.auditLog,"Error:",n)}},l.addLogToAudit=function(e,t,n,r){if(t&&t.files){if(-1!==t.files.findIndex((function(t){return t.name===e})))return t;var o=Date.now();if(t.files.push({date:o,name:e,hash:a.createHash(t.hashType).update(e+"LOG_FILE"+o).digest("hex")}),t.keep.days){var s=i().subtract(t.keep.amount,"days").valueOf(),u=t.files.filter((function(e){return e.date>s||(e.hashType=t.hashType,p(e,r),n.emit("logRemoved",e),!1)}));t.files=u}else{var c=t.files.splice(-t.keep.amount);t.files.length>0&&t.files.filter((function(e){return e.hashType=t.hashType,p(e,r),n.emit("logRemoved",e),!1})),t.files=c}l.writeAuditLog(t,r)}return t},l.getStream=function(e){var t=null,a=null,p=this;if(!e.filename)return console.error(new Date,"[FileStreamRotator] No filename supplied. Defaulting to STDOUT"),process.stdout;e.frequency&&(t=p.getFrequency(e.frequency));let f=p.setAuditLog(e.max_logs,e.audit_file,e.filename);null!=f&&(f.hashType=void 0!==e.audit_hash_type?e.audit_hash_type:"md5"),p.verbose=void 0===e.verbose||e.verbose;var h=null,g=0,m=0;e.size&&(h=l.parseFileSize(e.size));var y=e.date_format||"YYYYMMDDHHmm";t&&"daily"==t.type&&(e.date_format||(y="YYYY-MM-DD"),i().format(y)==i().endOf("day").format(y)&&i().format(y)!=i().add(1,"day").format(y)||(p.verbose&&console.log(new Date,"[FileStreamRotator] Changing type to custom as date format changes more often than once a day or not every day"),t.type="custom")),t&&(a=e.frequency?p.getDate(t,y,e.utc):""),e.create_symlink=e.create_symlink||!1,e.extension=e.extension||"";var v=e.filename,b=null,_=v+(a?"."+a:"");if(v.match(/%DATE%/)&&(_=v.replace(/%DATE%/g,a||p.getDate(null,y,e.utc))),h){var T=null,E=_;if(f&&f.files&&f.files instanceof Array&&f.files.length>0){var S=f.files[f.files.length-1].name;if(S.match(E)){var x=S.match(E+"\\.(\\d+)");x&&(E=S,g=x[1])}}for(0==g&&E==_&&(E+=e.extension);r.existsSync(E);)T=E,g++,E=_+"."+g+e.extension;if(T){var w=r.statSync(T);w.size<h&&(E=T,g--,m=w.size)}_=E}else _+=e.extension;p.verbose&&console.log(new Date,"[FileStreamRotator] Logging to: ",_),c(_);var A=e.file_options||{flags:"a"},k=r.createWriteStream(_,A);if(a&&t&&u.indexOf(t.type)>-1||h>0){p.verbose&&console.log(new Date,"[FileStreamRotator] Rotating file: ",t?t.type:"",h?"size: "+h:"");var M,O=new s;return O.auditLog=f,O.end=function(){k.end.apply(k,arguments)},d(k,O),O.on("close",(function(){M&&M.close()})),O.on("new",(function(t){O.auditLog=p.addLogToAudit(t,O.auditLog,O,p.verbose),e.create_symlink&&function(e,t,n){let i=t||"current.log",a=o.dirname(e),s=o.basename(e),l=a+"/"+i;try{r.lstatSync(l).isSymbolicLink()&&(r.unlinkSync(l),r.symlinkSync(s,l))}catch(e){if(e&&"ENOENT"==e.code)try{r.symlinkSync(s,l)}catch(e){n&&console.error(new Date,"[FileStreamRotator] Could not create symlink file: ",l," -> ",s)}}}(t,e.symlink_name,p.verbose),e.watch_log&&O.emit("addWatcher",t)})),O.on("addWatcher",(function(t){M&&M.close(),e.watch_log&&(M=function(e,t,n){if(!e)return null;try{r.lstatSync(e);return r.watch(e,(function(t,o){if("rename"==t)try{r.lstatSync(e)}catch(t){n(t,e)}}))}catch(n){t&&console.log(new Date,"[FileStreamRotator] Could not add watcher for "+e)}}(t,p.verbose,(function(e,t){O.emit("createLog",t)})))})),O.on("createLog",(function(e){try{r.lstatSync(e)}catch(t){k&&"function"==k.end&&k.end(),k=r.createWriteStream(e,A),O.emit("new",e),d(k,O)}})),O.write=function(o,i){var s=t?this.getDate(t,y,e.utc):a;if(s!=a||h&&m>h){var l=v+(a&&t?"."+s:"");v.match(/%DATE%/)&&a&&(l=v.replace(/%DATE%/g,s)),h&&m>h?l+="."+ ++g+e.extension:(g=0,l+=e.extension),m=0,p.verbose&&console.log(new Date,n(8).format("[FileStreamRotator] Changing logs from %s to %s",_,l)),a=s,b=_,_=l,!0===e.end_stream?k.end():k.destroy(),c(_),k=r.createWriteStream(l,A),O.emit("new",l),O.emit("rotate",b,l),d(k,O)}k.write(o,i),m+=Buffer.byteLength(o,i)}.bind(this),process.nextTick((function(){O.emit("new",_)})),O.emit("new",_),O}return p.verbose&&console.log(new Date,"[FileStreamRotator] File won't be rotated: ",e.frequency,e.size),process.nextTick((function(){k.emit("new",_)})),k};var c=function(e){o.dirname(e).split(o.sep).reduce((function(e,t){if(e+=t+o.sep,!r.existsSync(e))try{r.mkdirSync(e)}catch(e){if("EEXIST"!==e.code)throw e}return e}),"")},d=function(e,t){e.on("close",(function(){t.emit("close")})),e.on("finish",(function(){t.emit("finish")})),e.on("error",(function(e){t.emit("error",e)})),e.on("open",(function(e){t.emit("open",e)}))}},function(e,t,n){var r={"./af":551,"./af.js":551,"./ar":552,"./ar-dz":553,"./ar-dz.js":553,"./ar-kw":554,"./ar-kw.js":554,"./ar-ly":555,"./ar-ly.js":555,"./ar-ma":556,"./ar-ma.js":556,"./ar-sa":557,"./ar-sa.js":557,"./ar-tn":558,"./ar-tn.js":558,"./ar.js":552,"./az":559,"./az.js":559,"./be":560,"./be.js":560,"./bg":561,"./bg.js":561,"./bm":562,"./bm.js":562,"./bn":563,"./bn-bd":564,"./bn-bd.js":564,"./bn.js":563,"./bo":565,"./bo.js":565,"./br":566,"./br.js":566,"./bs":567,"./bs.js":567,"./ca":568,"./ca.js":568,"./cs":569,"./cs.js":569,"./cv":570,"./cv.js":570,"./cy":571,"./cy.js":571,"./da":572,"./da.js":572,"./de":573,"./de-at":574,"./de-at.js":574,"./de-ch":575,"./de-ch.js":575,"./de.js":573,"./dv":576,"./dv.js":576,"./el":577,"./el.js":577,"./en-au":578,"./en-au.js":578,"./en-ca":579,"./en-ca.js":579,"./en-gb":580,"./en-gb.js":580,"./en-ie":581,"./en-ie.js":581,"./en-il":582,"./en-il.js":582,"./en-in":583,"./en-in.js":583,"./en-nz":584,"./en-nz.js":584,"./en-sg":585,"./en-sg.js":585,"./eo":586,"./eo.js":586,"./es":587,"./es-do":588,"./es-do.js":588,"./es-mx":589,"./es-mx.js":589,"./es-us":590,"./es-us.js":590,"./es.js":587,"./et":591,"./et.js":591,"./eu":592,"./eu.js":592,"./fa":593,"./fa.js":593,"./fi":594,"./fi.js":594,"./fil":595,"./fil.js":595,"./fo":596,"./fo.js":596,"./fr":597,"./fr-ca":598,"./fr-ca.js":598,"./fr-ch":599,"./fr-ch.js":599,"./fr.js":597,"./fy":600,"./fy.js":600,"./ga":601,"./ga.js":601,"./gd":602,"./gd.js":602,"./gl":603,"./gl.js":603,"./gom-deva":604,"./gom-deva.js":604,"./gom-latn":605,"./gom-latn.js":605,"./gu":606,"./gu.js":606,"./he":607,"./he.js":607,"./hi":608,"./hi.js":608,"./hr":609,"./hr.js":609,"./hu":610,"./hu.js":610,"./hy-am":611,"./hy-am.js":611,"./id":612,"./id.js":612,"./is":613,"./is.js":613,"./it":614,"./it-ch":615,"./it-ch.js":615,"./it.js":614,"./ja":616,"./ja.js":616,"./jv":617,"./jv.js":617,"./ka":618,"./ka.js":618,"./kk":619,"./kk.js":619,"./km":620,"./km.js":620,"./kn":621,"./kn.js":621,"./ko":622,"./ko.js":622,"./ku":623,"./ku.js":623,"./ky":624,"./ky.js":624,"./lb":625,"./lb.js":625,"./lo":626,"./lo.js":626,"./lt":627,"./lt.js":627,"./lv":628,"./lv.js":628,"./me":629,"./me.js":629,"./mi":630,"./mi.js":630,"./mk":631,"./mk.js":631,"./ml":632,"./ml.js":632,"./mn":633,"./mn.js":633,"./mr":634,"./mr.js":634,"./ms":635,"./ms-my":636,"./ms-my.js":636,"./ms.js":635,"./mt":637,"./mt.js":637,"./my":638,"./my.js":638,"./nb":639,"./nb.js":639,"./ne":640,"./ne.js":640,"./nl":641,"./nl-be":642,"./nl-be.js":642,"./nl.js":641,"./nn":643,"./nn.js":643,"./oc-lnc":644,"./oc-lnc.js":644,"./pa-in":645,"./pa-in.js":645,"./pl":646,"./pl.js":646,"./pt":647,"./pt-br":648,"./pt-br.js":648,"./pt.js":647,"./ro":649,"./ro.js":649,"./ru":650,"./ru.js":650,"./sd":651,"./sd.js":651,"./se":652,"./se.js":652,"./si":653,"./si.js":653,"./sk":654,"./sk.js":654,"./sl":655,"./sl.js":655,"./sq":656,"./sq.js":656,"./sr":657,"./sr-cyrl":658,"./sr-cyrl.js":658,"./sr.js":657,"./ss":659,"./ss.js":659,"./sv":660,"./sv.js":660,"./sw":661,"./sw.js":661,"./ta":662,"./ta.js":662,"./te":663,"./te.js":663,"./tet":664,"./tet.js":664,"./tg":665,"./tg.js":665,"./th":666,"./th.js":666,"./tk":667,"./tk.js":667,"./tl-ph":668,"./tl-ph.js":668,"./tlh":669,"./tlh.js":669,"./tr":670,"./tr.js":670,"./tzl":671,"./tzl.js":671,"./tzm":672,"./tzm-latn":673,"./tzm-latn.js":673,"./tzm.js":672,"./ug-cn":674,"./ug-cn.js":674,"./uk":675,"./uk.js":675,"./ur":676,"./ur.js":676,"./uz":677,"./uz-latn":678,"./uz-latn.js":678,"./uz.js":677,"./vi":679,"./vi.js":679,"./x-pseudo":680,"./x-pseudo.js":680,"./yo":681,"./yo.js":681,"./zh-cn":682,"./zh-cn.js":682,"./zh-hk":683,"./zh-hk.js":683,"./zh-mo":684,"./zh-mo.js":684,"./zh-tw":685,"./zh-tw.js":685};function o(e){var t=i(e);return n(t)}function i(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}o.keys=function(){return Object.keys(r)},o.resolve=i,e.exports=o,o.id=1322},function(e,t,n){const{transports:r}=n(338);n(550),e.exports=class extends r.DailyRotateFile{constructor(e){super(e),e.ignoreLevels?this.ignoreLevels=Array.isArray(e.ignoreLevels)?e.ignoreLevels:[e.ignoreLevels]:this.ignoreLevels=[]}log(e,t){(this.ignoreLevels||[]).includes(e.level)?t():super.log(e,t)}}},function(e,t){const n=e=>{e.setDate(e.getDate()-1);return{year:e.getFullYear().toString(),month:(e.getMonth()+1).toString().padStart(2,0),day:e.getDate().toString().padStart(2,0)}};e.exports={getPreDate:n,accessLogFilenameGenerator:(e,t)=>{if(!e)return"access.log";const{year:r,month:o,day:i}=n(e);let a=`access-${r}-${o}-${i}`;return t>1&&(a=`${a}-${t}`),a+".log.gz"}}},function(e,t,n){"use strict";e.exports=function(...e){try{return JSON.stringify.apply(null,e)}catch(e){return"[Cannot display object: "+e.message+"]"}}},function(e){e.exports=JSON.parse('{"name":"joi","description":"Object schema validation","version":"17.6.0","repository":"git://github.com/sideway/joi","main":"lib/index.js","types":"lib/index.d.ts","browser":"dist/joi-browser.min.js","files":["lib/**/*","dist/*"],"keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"^9.0.0","@hapi/topo":"^5.0.0","@sideway/address":"^4.1.3","@sideway/formula":"^3.0.0","@sideway/pinpoint":"^2.0.0"},"devDependencies":{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"24.x.x","typescript":"4.3.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"license":"BSD-3-Clause"}')},function(e,t,n){"use strict";const r={};e.exports=function(e){if(!e)return"";let t="";for(let n=0;n<e.length;++n){const o=e.charCodeAt(n);r.isSafe(o)?t+=e[n]:t+=r.escapeHtmlChar(o)}return t},r.escapeHtmlChar=function(e){const t=r.namedHtml[e];if(void 0!==t)return t;if(e>=256)return"&#"+e+";";return`&#x${e.toString(16).padStart(2,"0")};`},r.isSafe=function(e){return void 0!==r.safeCharCodes[e]},r.namedHtml={38:"&",60:"<",62:">",34:""",160:" ",162:"¢",163:"£",164:"¤",169:"©",174:"®"},r.safeCharCodes=function(){const e={};for(let t=32;t<123;++t)(t>=97||t>=65&&t<=90||t>=48&&t<=57||32===t||46===t||44===t||45===t||58===t||95===t)&&(e[t]=null);return e}()},function(e,t,n){"use strict";const r={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*\.?[0-9]*){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};t.Parser=class{constructor(e,t={}){if(!t[r.settings]&&t.constants)for(const e in t.constants){const n=t.constants[e];if(null!==n&&!["boolean","number","string"].includes(typeof n))throw new Error(`Formula constant ${e} contains invalid ${typeof n} value type`)}this.settings=t[r.settings]?t:Object.assign({[r.settings]:!0,constants:{},functions:{}},t),this.single=null,this._parts=null,this._parse(e)}_parse(e){let n=[],o="",i=0,a=!1;const s=e=>{if(i)throw new Error("Formula missing closing parenthesis");const s=n.length?n[n.length-1]:null;if(a||o||e){if(s&&"reference"===s.type&&")"===e)return s.type="function",s.value=this._subFormula(o,s.value),void(o="");if(")"===e){const e=new t.Parser(o,this.settings);n.push({type:"segment",value:e})}else if(a){if("]"===a)return n.push({type:"reference",value:o}),void(o="");n.push({type:"literal",value:o})}else if(r.operatorCharacters.includes(o))s&&"operator"===s.type&&r.operators.includes(s.value+o)?s.value+=o:n.push({type:"operator",value:o});else if(o.match(r.numberRx))n.push({type:"constant",value:parseFloat(o)});else if(void 0!==this.settings.constants[o])n.push({type:"constant",value:this.settings.constants[o]});else{if(!o.match(r.tokenRx))throw new Error("Formula contains invalid token: "+o);n.push({type:"reference",value:o})}o=""}};for(const t of e)a?t===a?(s(),a=!1):o+=t:i?"("===t?(o+=t,++i):")"===t?(--i,i?o+=t:s(t)):o+=t:t in r.literals?a=r.literals[t]:"("===t?(s(),++i):r.operatorCharacters.includes(t)?(s(),o=t,s()):" "!==t?o+=t:s();s(),n=n.map((e,t)=>"operator"!==e.type||"-"!==e.value||t&&"operator"!==n[t-1].type?e:{type:"operator",value:"n"});let l=!1;for(const e of n){if("operator"===e.type){if(r.operatorsPrefix.includes(e.value))continue;if(!l)throw new Error("Formula contains an operator in invalid position");if(!r.operators.includes(e.value))throw new Error("Formula contains an unknown operator "+e.value)}else if(l)throw new Error("Formula missing expected operator");l=!l}if(!l)throw new Error("Formula contains invalid trailing operator");1===n.length&&["reference","literal","constant"].includes(n[0].type)&&(this.single={type:"reference"===n[0].type?"reference":"value",value:n[0].value}),this._parts=n.map(e=>{if("operator"===e.type)return r.operatorsPrefix.includes(e.value)?e:e.value;if("reference"!==e.type)return e.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(e.value))throw new Error("Formula contains invalid reference "+e.value);return this.settings.reference?this.settings.reference(e.value):r.reference(e.value)})}_subFormula(e,n){const o=this.settings.functions[n];if("function"!=typeof o)throw new Error("Formula contains unknown function "+n);let i=[];if(e){let t="",o=0,a=!1;const s=()=>{if(!t)throw new Error(`Formula contains function ${n} with invalid arguments ${e}`);i.push(t),t=""};for(let n=0;n<e.length;++n){const i=e[n];a?(t+=i,i===a&&(a=!1)):i in r.literals&&!o?(t+=i,a=r.literals[i]):","!==i||o?(t+=i,"("===i?++o:")"===i&&--o):s()}s()}return i=i.map(e=>new t.Parser(e,this.settings)),function(e){const t=[];for(const n of i)t.push(n.evaluate(e));return o.call(e,...t)}}evaluate(e){const t=this._parts.slice();for(let n=t.length-2;n>=0;--n){const o=t[n];if(o&&"operator"===o.type){const i=t[n+1];t.splice(n+1,1);const a=r.evaluate(i,e);t[n]=r.single(o.value,a)}}return r.operatorsOrder.forEach(n=>{for(let o=1;o<t.length-1;)if(n.includes(t[o])){const n=t[o],i=r.evaluate(t[o-1],e),a=r.evaluate(t[o+1],e);t.splice(o,2);const s=r.calculate(n,i,a);t[o-1]=0===s?0:s}else o+=2}),r.evaluate(t[0],e)}},t.Parser.prototype[r.symbol]=!0,r.reference=function(e){return function(t){return t&&void 0!==t[e]?t[e]:null}},r.evaluate=function(e,t){return null===e?null:"function"==typeof e?e(t):e[r.symbol]?e.evaluate(t):e},r.single=function(e,t){if("!"===e)return!t;const n=-t;return 0===n?0:n},r.calculate=function(e,t,n){if("??"===e)return r.exists(t)?t:n;if("string"==typeof t||"string"==typeof n){if("+"===e)return(t=r.exists(t)?t:"")+(n=r.exists(n)?n:"")}else switch(e){case"^":return Math.pow(t,n);case"*":return t*n;case"/":return t/n;case"%":return t%n;case"+":return t+n;case"-":return t-n}switch(e){case"<":return t<n;case"<=":return t<=n;case">":return t>n;case">=":return t>=n;case"==":return t===n;case"!=":return t!==n;case"&&":return t&&n;case"||":return t||n}return null},r.exists=function(e){return null!=e}},function(e,t,n){"use strict";const r=n(58),o=n(22),i={annotations:Symbol("annotations")};t.error=function(e){if(!this._original||"object"!=typeof this._original)return this.details[0].message;const t=e?"":"[31m",n=e?"":"[41m",a=e?"":"[0m",s=r(this._original);for(let e=this.details.length-1;e>=0;--e){const t=e+1,n=this.details[e],r=n.path;let a=s;for(let e=0;;++e){const s=r[e];if(o.isSchema(a)&&(a=a.clone()),!(e+1<r.length&&"string"!=typeof a[s])){const e=a[i.annotations]||{errors:{},missing:{}};a[i.annotations]=e;const r=s||n.context.key;void 0!==a[s]?(e.errors[r]=e.errors[r]||[],e.errors[r].push(t)):e.missing[r]=t;break}a=a[s]}}const l=/_\$key\$_([, \d]+)_\$end\$_"/g,u=/"_\$miss\$_([^|]+)\|(\d+)_\$end\$_": "__missing__"/g,p=/\s*"_\$idx\$_([, \d]+)_\$end\$_",?\n(.*)/g,c=/"\[(NaN|Symbol.*|-?Infinity|function.*|\(.*)]"/g;let d=i.safeStringify(s,2).replace(l,(e,n)=>`" ${t}[${n}]${a}`).replace(u,(e,r,o)=>`${n}"${r}"${a}${t} [${o}]: -- missing --${a}`).replace(p,(e,n,r)=>`\n${r} ${t}[${n}]${a}`).replace(c,(e,t)=>t);d=`${d}\n${t}`;for(let e=0;e<this.details.length;++e){d=`${d}\n[${e+1}] ${this.details[e].message}`}return d+=a,d},i.safeStringify=function(e,t){return JSON.stringify(e,i.serializer(),t)},i.serializer=function(){const e=[],t=[],n=(n,r)=>t[0]===r?"[Circular ~]":"[Circular ~."+e.slice(0,t.indexOf(r)).join(".")+"]";return function(r,o){if(t.length>0){const i=t.indexOf(this);~i?(t.length=i+1,e.length=i+1,e[i]=r):(t.push(this),e.push(r)),~t.indexOf(o)&&(o=n.call(this,r,o))}else t.push(o);if(o){const e=o[i.annotations];if(e){if(Array.isArray(o)){const t=[];for(let n=0;n<o.length;++n)e.errors[n]&&t.push(`_$idx$_${e.errors[n].sort().join(", ")}_$end$_`),t.push(o[n]);o=t}else{for(const t in e.errors)o[`${t}_$key$_${e.errors[t].sort().join(", ")}_$end$_`]=o[t],o[t]=void 0;for(const t in e.missing)o[`_$miss$_${t}|${e.missing[t]}_$end$_`]="__missing__"}return o}}return o===1/0||o===-1/0||Number.isNaN(o)||"function"==typeof o||"symbol"==typeof o?"["+o.toString()+"]":o}}},function(e,t,n){"use strict";t.location=function(e=0){const t=Error.prepareStackTrace;Error.prepareStackTrace=(e,t)=>t;const n={};Error.captureStackTrace(n,this);const r=n.stack[e+1];return Error.prepareStackTrace=t,{filename:r.getFileName(),line:r.getLineNumber()}}},function(e,t,n){"use strict";const r=n(16),o=n(348),i=n(79),a=n(22),s=n(149),l=n(106),u=n(107),p={};e.exports=i.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:u.toSibling}},args:(e,...t)=>1===t.length&&Array.isArray(t[0])?e.try(...t[0]):e.try(...t),validate(e,t){const{schema:n,error:r,state:i,prefs:a}=t;if(n._flags.match){const t=[],s=[];for(let r=0;r<n.$_terms.matches.length;++r){const o=n.$_terms.matches[r],l=i.nest(o.schema,"match."+r);l.snapshot();const u=o.schema.$_validate(e,l,a);u.errors?(s.push(u.errors),l.restore()):t.push(u.value)}if(0===t.length){return{errors:r("alternatives.any",{details:s.map(e=>l.details(e,{override:!1}))})}}if("one"===n._flags.match)return 1===t.length?{value:t[0]}:{errors:r("alternatives.one")};if(t.length!==n.$_terms.matches.length){return{errors:r("alternatives.all",{details:s.map(e=>l.details(e,{override:!1}))})}}const u=e=>e.$_terms.matches.some(e=>"object"===e.schema.type||"alternatives"===e.schema.type&&u(e.schema));return u(n)?{value:t.reduce((e,t)=>o(e,t,{mergeArrays:!1}))}:{value:t[t.length-1]}}const s=[];for(let t=0;t<n.$_terms.matches.length;++t){const r=n.$_terms.matches[t];if(r.schema){const n=i.nest(r.schema,"match."+t);n.snapshot();const o=r.schema.$_validate(e,n,a);if(!o.errors)return o;n.restore(),s.push({schema:r.schema,reports:o.errors});continue}const o=r.ref?r.ref.resolve(e,i,a):e,l=r.is?[r]:r.switch;for(let n=0;n<l.length;++n){const s=l[n],{is:u,then:p,otherwise:c}=s,d=`match.${t}${r.switch?"."+n:""}`;if(u.$_match(o,i.nest(u,d+".is"),a)){if(p)return p.$_validate(e,i.nest(p,d+".then"),a)}else if(c)return c.$_validate(e,i.nest(c,d+".otherwise"),a)}}return p.errors(s,t)},rules:{conditional:{method(e,t){r(!this._flags._endedSwitch,"Unreachable condition"),r(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),r(void 0===t.break,"Cannot use break option with alternatives conditional");const n=this.clone(),o=s.when(n,e,t),i=o.is?[o]:o.switch;for(const e of i)if(e.then&&e.otherwise){n.$_setFlag("_endedSwitch",!0,{clone:!1});break}return n.$_terms.matches.push(o),n.$_mutateRebuild()}},match:{method(e){if(r(["any","one","all"].includes(e),"Invalid alternatives match mode",e),"any"!==e)for(const t of this.$_terms.matches)r(t.schema,"Cannot combine match mode",e,"with conditional rules");return this.$_setFlag("match",e)}},try:{method(...e){r(e.length,"Missing alternative schemas"),a.verifyFlat(e,"try"),r(!this._flags._endedSwitch,"Unreachable condition");const t=this.clone();for(const n of e)t.$_terms.matches.push({schema:t.$_compile(n)});return t.$_mutateRebuild()}}},overrides:{label(e){return this.$_parent("label",e).$_modify({each:(t,n)=>"is"!==n.path[0]?t.label(e):void 0,ref:!1})}},rebuild(e){e.$_modify({each:t=>{a.isSchema(t)&&"array"===t.type&&e.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(e,t){if(t.matches)for(const n of t.matches){const{schema:t,ref:r,is:o,not:i,then:a,otherwise:s}=n;e=t?e.try(t):r?e.conditional(r,{is:o,then:a,not:i,otherwise:s,switch:n.switch}):e.conditional(o,{then:a,otherwise:s})}return e}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),p.errors=function(e,{error:t,state:n}){if(!e.length)return{errors:t("alternatives.any")};if(1===e.length)return{errors:e[0].reports};const r=new Set,o=[];for(const{reports:i,schema:a}of e){if(i.length>1)return p.unmatched(e,t);const s=i[0];if(s instanceof l.Report==!1)return p.unmatched(e,t);if(s.state.path.length!==n.path.length){o.push({type:a.type,report:s});continue}if("any.only"===s.code){for(const e of s.local.valids)r.add(e);continue}const[u,c]=s.code.split(".");"base"===c?r.add(u):o.push({type:a.type,report:s})}return o.length?1===o.length?{errors:o[0].report}:p.unmatched(e,t):{errors:t("alternatives.types",{types:[...r]})}},p.unmatched=function(e,t){const n=[];for(const t of e)n.push(...t.reports);return{errors:t("alternatives.match",l.details(n,{override:!1}))}}},function(e,t,n){"use strict";const r=n(16),o=n(58),i=n(234),a=n(348),s=n(690),l=n(22),u=n(149),p=n(106),c=n(691),d=n(692),f=n(176),h=n(1333),g=n(107),m=n(693),y=n(1334),v=n(694),b={Base:class{constructor(e){this.type=e,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new h.Ids,this._preferences=null,this._refs=new g.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return r("function"==typeof d.describe,"Manifest functionality disabled"),d.describe(this)}allow(...e){return l.verifyFlat(e,"allow"),this._values(e,"_valids")}alter(e){r(e&&"object"==typeof e&&!Array.isArray(e),"Invalid targets argument"),r(!this._inRuleset(),"Cannot set alterations inside a ruleset");const t=this.clone();t.$_terms.alterations=t.$_terms.alterations||[];for(const n in e){const o=e[n];r("function"==typeof o,"Alteration adjuster for",n,"must be a function"),t.$_terms.alterations.push({target:n,adjuster:o})}return t.$_temp.ruleset=!1,t}artifact(e){return r(void 0!==e,"Artifact cannot be undefined"),r(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",e)}cast(e){return r(!1===e||"string"==typeof e,"Invalid to value"),r(!1===e||this._definition.cast[e],"Type",this.type,"does not support casting to",e),this.$_setFlag("cast",!1===e?void 0:e)}default(e,t){return this._default("default",e,t)}description(e){return r(e&&"string"==typeof e,"Description must be a non-empty string"),this.$_setFlag("description",e)}empty(e){const t=this.clone();return void 0!==e&&(e=t.$_compile(e,{override:!1})),t.$_setFlag("empty",e,{clone:!1})}error(e){return r(e,"Missing error"),r(e instanceof Error||"function"==typeof e,"Must provide a valid Error object or a function"),this.$_setFlag("error",e)}example(e,t={}){return r(void 0!==e,"Missing example"),l.assertOptions(t,["override"]),this._inner("examples",e,{single:!0,override:t.override})}external(e,t){return"object"==typeof e&&(r(!t,"Cannot combine options with description"),t=e.description,e=e.method),r("function"==typeof e,"Method must be a function"),r(void 0===t||t&&"string"==typeof t,"Description must be a non-empty string"),this._inner("externals",{method:e,description:t},{single:!0})}failover(e,t){return this._default("failover",e,t)}forbidden(){return this.presence("forbidden")}id(e){return e?(r("string"==typeof e,"id must be a non-empty string"),r(/^[^\.]+$/.test(e),"id cannot contain period character"),this.$_setFlag("id",e)):this.$_setFlag("id",void 0)}invalid(...e){return this._values(e,"_invalids")}label(e){return r(e&&"string"==typeof e,"Label name must be a non-empty string"),this.$_setFlag("label",e)}meta(e){return r(void 0!==e,"Meta cannot be undefined"),this._inner("metas",e,{single:!0})}note(...e){r(e.length,"Missing notes");for(const t of e)r(t&&"string"==typeof t,"Notes must be non-empty strings");return this._inner("notes",e)}only(e=!0){return r("boolean"==typeof e,"Invalid mode:",e),this.$_setFlag("only",e)}optional(){return this.presence("optional")}prefs(e){r(e,"Missing preferences"),r(void 0===e.context,"Cannot override context"),r(void 0===e.externals,"Cannot override externals"),r(void 0===e.warnings,"Cannot override warnings"),r(void 0===e.debug,"Cannot override debug"),l.checkPreferences(e);const t=this.clone();return t._preferences=l.preferences(t._preferences,e),t}presence(e){return r(["optional","required","forbidden"].includes(e),"Unknown presence mode",e),this.$_setFlag("presence",e)}raw(e=!0){return this.$_setFlag("result",e?"raw":void 0)}result(e){return r(["raw","strip"].includes(e),"Unknown result mode",e),this.$_setFlag("result",e)}required(){return this.presence("required")}strict(e){const t=this.clone(),n=void 0!==e&&!e;return t._preferences=l.preferences(t._preferences,{convert:n}),t}strip(e=!0){return this.$_setFlag("result",e?"strip":void 0)}tag(...e){r(e.length,"Missing tags");for(const t of e)r(t&&"string"==typeof t,"Tags must be non-empty strings");return this._inner("tags",e)}unit(e){return r(e&&"string"==typeof e,"Unit name must be a non-empty string"),this.$_setFlag("unit",e)}valid(...e){l.verifyFlat(e,"valid");const t=this.allow(...e);return t.$_setFlag("only",!!t._valids,{clone:!1}),t}when(e,t){const n=this.clone();n.$_terms.whens||(n.$_terms.whens=[]);const o=u.when(n,e,t);if(!["any","link"].includes(n.type)){const e=o.is?[o]:o.switch;for(const t of e)r(!t.then||"any"===t.then.type||t.then.type===n.type,"Cannot combine",n.type,"with",t.then&&t.then.type),r(!t.otherwise||"any"===t.otherwise.type||t.otherwise.type===n.type,"Cannot combine",n.type,"with",t.otherwise&&t.otherwise.type)}return n.$_terms.whens.push(o),n.$_mutateRebuild()}cache(e){r(!this._inRuleset(),"Cannot set caching inside a ruleset"),r(!this._cache,"Cannot override schema cache"),r(void 0===this._flags.artifact,"Cannot cache a rule with an artifact");const t=this.clone();return t._cache=e||s.provider.provision(),t.$_temp.ruleset=!1,t}clone(){const e=Object.create(Object.getPrototypeOf(this));return this._assign(e)}concat(e){r(l.isSchema(e),"Invalid schema object"),r("any"===this.type||"any"===e.type||e.type===this.type,"Cannot merge type",this.type,"with another type:",e.type),r(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),r(!e._inRuleset(),"Cannot concatenate a schema with open ruleset");let t=this.clone();if("any"===this.type&&"any"!==e.type){const n=e.clone();for(const e of Object.keys(t))"type"!==e&&(n[e]=t[e]);t=n}t._ids.concat(e._ids),t._refs.register(e,g.toSibling),t._preferences=t._preferences?l.preferences(t._preferences,e._preferences):e._preferences,t._valids=v.merge(t._valids,e._valids,e._invalids),t._invalids=v.merge(t._invalids,e._invalids,e._valids);for(const n of e._singleRules.keys())t._singleRules.has(n)&&(t._rules=t._rules.filter(e=>e.keep||e.name!==n),t._singleRules.delete(n));for(const n of e._rules)e._definition.rules[n.method].multi||t._singleRules.set(n.name,n),t._rules.push(n);if(t._flags.empty&&e._flags.empty){t._flags.empty=t._flags.empty.concat(e._flags.empty);const n=Object.assign({},e._flags);delete n.empty,a(t._flags,n)}else if(e._flags.empty){t._flags.empty=e._flags.empty;const n=Object.assign({},e._flags);delete n.empty,a(t._flags,n)}else a(t._flags,e._flags);for(const n in e.$_terms){const r=e.$_terms[n];r?t.$_terms[n]?t.$_terms[n]=t.$_terms[n].concat(r):t.$_terms[n]=r.slice():t.$_terms[n]||(t.$_terms[n]=r)}return this.$_root._tracer&&this.$_root._tracer._combine(t,[this,e]),t.$_mutateRebuild()}extend(e){return r(!e.base,"Cannot extend type with another base"),c.type(this,e)}extract(e){return e=Array.isArray(e)?e:e.split("."),this._ids.reach(e)}fork(e,t){r(!this._inRuleset(),"Cannot fork inside a ruleset");let n=this;for(let r of[].concat(e))r=Array.isArray(r)?r:r.split("."),n=n._ids.fork(r,t,n);return n.$_temp.ruleset=!1,n}rule(e){const t=this._definition;l.assertOptions(e,Object.keys(t.modifiers)),r(!1!==this.$_temp.ruleset,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const n=null===this.$_temp.ruleset?this._rules.length-1:this.$_temp.ruleset;r(n>=0&&n<this._rules.length,"Cannot apply rules to empty ruleset");const i=this.clone();for(let a=n;a<i._rules.length;++a){const n=i._rules[a],s=o(n);for(const o in e)t.modifiers[o](s,e[o]),r(s.name===n.name,"Cannot change rule name");i._rules[a]=s,i._singleRules.get(s.name)===n&&i._singleRules.set(s.name,s)}return i.$_temp.ruleset=!1,i.$_mutateRebuild()}get ruleset(){r(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const e=this.clone();return e.$_temp.ruleset=e._rules.length,e}get $(){return this.ruleset}tailor(e){e=[].concat(e),r(!this._inRuleset(),"Cannot tailor inside a ruleset");let t=this;if(this.$_terms.alterations)for(const{target:n,adjuster:o}of this.$_terms.alterations)e.includes(n)&&(t=o(t),r(l.isSchema(t),"Alteration adjuster for",n,"failed to return a schema object"));return t=t.$_modify({each:t=>t.tailor(e),ref:!1}),t.$_temp.ruleset=!1,t.$_mutateRebuild()}tracer(){return m.location?m.location(this):this}validate(e,t){return y.entry(e,this,t)}validateAsync(e,t){return y.entryAsync(e,this,t)}$_addRule(e){"string"==typeof e&&(e={name:e}),r(e&&"object"==typeof e,"Invalid options"),r(e.name&&"string"==typeof e.name,"Invalid rule name");for(const t in e)r("_"!==t[0],"Cannot set private rule properties");const t=Object.assign({},e);t._resolve=[],t.method=t.method||t.name;const n=this._definition.rules[t.method],o=t.args;r(n,"Unknown rule",t.method);const i=this.clone();if(o){r(1===Object.keys(o).length||Object.keys(o).length===this._definition.rules[t.name].args.length,"Invalid rule definition for",this.type,t.name);for(const e in o){let a=o[e];if(void 0!==a){if(n.argsByName){const s=n.argsByName.get(e);if(s.ref&&l.isResolvable(a))t._resolve.push(e),i.$_mutateRegister(a);else if(s.normalize&&(a=s.normalize(a),o[e]=a),s.assert){const t=l.validateArg(a,e,s);r(!t,t,"or reference")}}o[e]=a}else delete o[e]}}return n.multi||(i._ruleRemove(t.name,{clone:!1}),i._singleRules.set(t.name,t)),!1===i.$_temp.ruleset&&(i.$_temp.ruleset=null),n.priority?i._rules.unshift(t):i._rules.push(t),i}$_compile(e,t){return u.schema(this.$_root,e,t)}$_createError(e,t,n,r,o,i={}){const a=!1!==i.flags?this._flags:{},s=i.messages?f.merge(this._definition.messages,i.messages):this._definition.messages;return new p.Report(e,t,n,a,s,r,o)}$_getFlag(e){return this._flags[e]}$_getRule(e){return this._singleRules.get(e)}$_mapLabels(e){return e=Array.isArray(e)?e:e.split("."),this._ids.labels(e)}$_match(e,t,n,r){(n=Object.assign({},n)).abortEarly=!0,n._externals=!1,t.snapshot();const o=!y.validate(e,this,t,n,r).errors;return t.restore(),o}$_modify(e){return l.assertOptions(e,["each","once","ref","schema"]),h.schema(this,e)||this}$_mutateRebuild(){r(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset();return this.$_modify({each:(e,{source:t,name:n,path:r,key:o})=>{const i=this._definition[t][n]&&this._definition[t][n].register;!1!==i&&this.$_mutateRegister(e,{family:i,key:o})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(e,{family:t,key:n}={}){this._refs.register(e,t),this._ids.register(e,{key:n})}$_property(e){return this._definition.properties[e]}$_reach(e){return this._ids.reach(e)}$_rootReferences(){return this._refs.roots()}$_setFlag(e,t,n={}){r("_"===e[0]||!this._inRuleset(),"Cannot set flag inside a ruleset");const o=this._definition.flags[e]||{};if(i(t,o.default)&&(t=void 0),i(t,this._flags[e]))return this;const a=!1!==n.clone?this.clone():this;return void 0!==t?(a._flags[e]=t,a.$_mutateRegister(t)):delete a._flags[e],"_"!==e[0]&&(a.$_temp.ruleset=!1),a}$_parent(e,...t){return this[e][l.symbols.parent].call(this,...t)}$_validate(e,t,n){return y.validate(e,this,t,n)}_assign(e){e.type=this.type,e.$_root=this.$_root,e.$_temp=Object.assign({},this.$_temp),e.$_temp.whens={},e._ids=this._ids.clone(),e._preferences=this._preferences,e._valids=this._valids&&this._valids.clone(),e._invalids=this._invalids&&this._invalids.clone(),e._rules=this._rules.slice(),e._singleRules=o(this._singleRules,{shallow:!0}),e._refs=this._refs.clone(),e._flags=Object.assign({},this._flags),e._cache=null,e.$_terms={};for(const t in this.$_terms)e.$_terms[t]=this.$_terms[t]?this.$_terms[t].slice():null;e.$_super={};for(const t in this.$_super)e.$_super[t]=this._super[t].bind(e);return e}_bare(){const e=this.clone();e._reset();const t=e._definition.terms;for(const n in t){const r=t[n];e.$_terms[n]=r.init}return e.$_mutateRebuild()}_default(e,t,n={}){l.assertOptions(n,"literal"),r(void 0!==t,"Missing",e,"value"),r("function"==typeof t||!n.literal,"Only function value supports literal option"),"function"==typeof t&&n.literal&&(t={[l.symbols.literal]:!0,literal:t});return this.$_setFlag(e,t)}_generate(e,t,n){if(!this.$_terms.whens)return{schema:this};const r=[],o=[];for(let i=0;i<this.$_terms.whens.length;++i){const a=this.$_terms.whens[i];if(a.concat){r.push(a.concat),o.push(i+".concat");continue}const s=a.ref?a.ref.resolve(e,t,n):e,l=a.is?[a]:a.switch,u=o.length;for(let u=0;u<l.length;++u){const{is:p,then:c,otherwise:d}=l[u],f=`${i}${a.switch?"."+u:""}`;if(p.$_match(s,t.nest(p,f+".is"),n)){if(c){const i=t.localize([...t.path,f+".then"],t.ancestors,t.schemas),{schema:a,id:s}=c._generate(e,i,n);r.push(a),o.push(`${f}.then${s?`(${s})`:""}`);break}}else if(d){const i=t.localize([...t.path,f+".otherwise"],t.ancestors,t.schemas),{schema:a,id:s}=d._generate(e,i,n);r.push(a),o.push(`${f}.otherwise${s?`(${s})`:""}`);break}}if(a.break&&o.length>u)break}const i=o.join(", ");if(t.mainstay.tracer.debug(t,"rule","when",i),!i)return{schema:this};if(!t.mainstay.tracer.active&&this.$_temp.whens[i])return{schema:this.$_temp.whens[i],id:i};let a=this;this._definition.generate&&(a=this._definition.generate(this,e,t,n));for(const e of r)a=a.concat(e);return this.$_root._tracer&&this.$_root._tracer._combine(a,[this,...r]),this.$_temp.whens[i]=a,{schema:a,id:i}}_inner(e,t,n={}){r(!this._inRuleset(),`Cannot set ${e} inside a ruleset`);const o=this.clone();return o.$_terms[e]&&!n.override||(o.$_terms[e]=[]),n.single?o.$_terms[e].push(t):o.$_terms[e].push(...t),o.$_temp.ruleset=!1,o}_inRuleset(){return null!==this.$_temp.ruleset&&!1!==this.$_temp.ruleset}_ruleRemove(e,t={}){if(!this._singleRules.has(e))return this;const n=!1!==t.clone?this.clone():this;n._singleRules.delete(e);const r=[];for(let t=0;t<n._rules.length;++t){const o=n._rules[t];o.name!==e||o.keep?r.push(o):n._inRuleset()&&t<n.$_temp.ruleset&&--n.$_temp.ruleset}return n._rules=r,n}_values(e,t){l.verifyFlat(e,t.slice(1,-1));const n=this.clone(),o=e[0]===l.symbols.override;if(o&&(e=e.slice(1)),!n[t]&&e.length?n[t]=new v:o&&(n[t]=e.length?new v:null,n.$_mutateRebuild()),!n[t])return n;o&&n[t].override();for(const o of e){r(void 0!==o,"Cannot call allow/valid/invalid with undefined"),r(o!==l.symbols.override,"Override must be the first value");const e="_invalids"===t?"_valids":"_invalids";n[e]&&(n[e].remove(o),n[e].length||(r("_valids"===t||!n._flags.only,"Setting invalid value",o,"leaves schema rejecting all values due to previous valid rule"),n[e]=null)),n[t].add(o,n._refs)}return n}}};b.Base.prototype[l.symbols.any]={version:l.version,compile:u.compile,root:"$_root"},b.Base.prototype.isImmutable=!0,b.Base.prototype.deny=b.Base.prototype.invalid,b.Base.prototype.disallow=b.Base.prototype.invalid,b.Base.prototype.equal=b.Base.prototype.valid,b.Base.prototype.exist=b.Base.prototype.required,b.Base.prototype.not=b.Base.prototype.invalid,b.Base.prototype.options=b.Base.prototype.prefs,b.Base.prototype.preferences=b.Base.prototype.prefs,e.exports=new b.Base},function(e,t,n){"use strict";const r=n(16),o=n(22),i=n(107),a={};t.Ids=a.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const e=new a.Ids;return e._byId=new Map(this._byId),e._byKey=new Map(this._byKey),e._schemaChain=this._schemaChain,e}concat(e){e._schemaChain&&(this._schemaChain=!0);for(const[t,n]of e._byId.entries())r(!this._byKey.has(t),"Schema id conflicts with existing key:",t),this._byId.set(t,n);for(const[t,n]of e._byKey.entries())r(!this._byId.has(t),"Schema key conflicts with existing id:",t),this._byKey.set(t,n)}fork(e,t,n){const i=this._collect(e);i.push({schema:n});const s=i.shift();let l={id:s.id,schema:t(s.schema)};r(o.isSchema(l.schema),"adjuster function failed to return a joi schema type");for(const e of i)l={id:e.id,schema:a.fork(e.schema,l.id,l.schema)};return l.schema}labels(e,t=[]){const n=e[0],r=this._get(n);if(!r)return[...t,...e].join(".");const o=e.slice(1);return t=[...t,r.schema._flags.label||n],o.length?r.schema._ids.labels(o,t):t.join(".")}reach(e,t=[]){const n=e[0],o=this._get(n);r(o,"Schema does not contain path",[...t,...e].join("."));const i=e.slice(1);return i.length?o.schema._ids.reach(i,[...t,n]):o.schema}register(e,{key:t}={}){if(!e||!o.isSchema(e))return;(e.$_property("schemaChain")||e._ids._schemaChain)&&(this._schemaChain=!0);const n=e._flags.id;if(n){const t=this._byId.get(n);r(!t||t.schema===e,"Cannot add different schemas with the same id:",n),r(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,{schema:e,id:n})}t&&(r(!this._byKey.has(t),"Schema already contains key:",t),r(!this._byId.has(t),"Schema key conflicts with existing id:",t),this._byKey.set(t,{schema:e,id:t}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(e,t=[],n=[]){const o=e[0],i=this._get(o);r(i,"Schema does not contain path",[...t,...e].join(".")),n=[i,...n];const a=e.slice(1);return a.length?i.schema._ids._collect(a,[...t,o],n):n}_get(e){return this._byId.get(e)||this._byKey.get(e)}},a.fork=function(e,n,r){const o=t.schema(e,{each:(e,{key:t})=>{if(n===(e._flags.id||t))return r},ref:!1});return o?o.$_mutateRebuild():e},t.schema=function(e,t){let n;for(const r in e._flags){if("_"===r[0])continue;const o=a.scan(e._flags[r],{source:"flags",name:r},t);void 0!==o&&(n=n||e.clone(),n._flags[r]=o)}for(let r=0;r<e._rules.length;++r){const o=e._rules[r],i=a.scan(o.args,{source:"rules",name:o.name},t);if(void 0!==i){n=n||e.clone();const t=Object.assign({},o);t.args=i,n._rules[r]=t;n._singleRules.get(o.name)===o&&n._singleRules.set(o.name,t)}}for(const r in e.$_terms){if("_"===r[0])continue;const o=a.scan(e.$_terms[r],{source:"terms",name:r},t);void 0!==o&&(n=n||e.clone(),n.$_terms[r]=o)}return n},a.scan=function(e,t,n,r,s){const l=r||[];if(null===e||"object"!=typeof e)return;let u;if(Array.isArray(e)){for(let r=0;r<e.length;++r){const o="terms"===t.source&&"keys"===t.name&&e[r].key,i=a.scan(e[r],t,n,[r,...l],o);void 0!==i&&(u=u||e.slice(),u[r]=i)}return u}if(!1!==n.schema&&o.isSchema(e)||!1!==n.ref&&i.isRef(e)){const r=n.each(e,{...t,path:l,key:s});if(r===e)return;return r}for(const r in e){if("_"===r[0])continue;const o=a.scan(e[r],t,n,[r,...l],s);void 0!==o&&(u=u||Object.assign({},e),u[r]=o)}return u}},function(e,t,n){"use strict";const r=n(16),o=n(58),i=n(1335),a=n(148),s=n(22),l=n(106),u=n(1336),p={result:Symbol("result")};t.entry=function(e,t,n){let o=s.defaults;n&&(r(void 0===n.warnings,"Cannot override warnings preference in synchronous validation"),r(void 0===n.artifacts,"Cannot override artifacts preference in synchronous validation"),o=s.preferences(s.defaults,n));const i=p.entry(e,t,o);r(!i.mainstay.externals.length,"Schema with external rules must use validateAsync()");const a={value:i.value};return i.error&&(a.error=i.error),i.mainstay.warnings.length&&(a.warning=l.details(i.mainstay.warnings)),i.mainstay.debug&&(a.debug=i.mainstay.debug),i.mainstay.artifacts&&(a.artifacts=i.mainstay.artifacts),a},t.entryAsync=async function(e,t,n){let r=s.defaults;n&&(r=s.preferences(s.defaults,n));const o=p.entry(e,t,r),i=o.mainstay;if(o.error)throw i.debug&&(o.error.debug=i.debug),o.error;if(i.externals.length){let e=o.value;for(const{method:t,path:o,label:s}of i.externals){let i,l,u=e;o.length&&(i=o[o.length-1],l=a(e,o.slice(0,-1)),u=l[i]);try{const r=await t(u,{prefs:n});if(void 0===r||r===u)continue;l?l[i]=r:e=r}catch(e){throw r.errors.label&&(e.message+=` (${s})`),e}}o.value=e}if(!r.warnings&&!r.debug&&!r.artifacts)return o.value;const u={value:o.value};return i.warnings.length&&(u.warning=l.details(i.warnings)),i.debug&&(u.debug=i.debug),i.artifacts&&(u.artifacts=i.artifacts),u},p.entry=function(e,n,r){const{tracer:o,cleanup:i}=p.tracer(n,r),a={externals:[],warnings:[],tracer:o,debug:r.debug?[]:null,links:n._ids._schemaChain?new Map:null},s=n._ids._schemaChain?[{schema:n}]:null,c=new u([],[],{mainstay:a,schemas:s}),d=t.validate(e,n,c,r);i&&n.$_root.untrace();const f=l.process(d.errors,e,r);return{value:d.value,error:f,mainstay:a}},p.tracer=function(e,t){return e.$_root._tracer?{tracer:e.$_root._tracer._register(e)}:t.debug?(r(e.$_root.trace,"Debug mode not supported"),{tracer:e.$_root.trace()._register(e),cleanup:!0}):{tracer:p.ignore}},t.validate=function(e,t,n,r,o={}){if(t.$_terms.whens&&(t=t._generate(e,n,r).schema),t._preferences&&(r=p.prefs(t,r)),t._cache&&r.cache){const r=t._cache.get(e);if(n.mainstay.tracer.debug(n,"validate","cached",!!r),r)return r}const i=(o,i,a)=>t.$_createError(o,e,i,a||n,r),a={original:e,prefs:r,schema:t,state:n,error:i,errorsArray:p.errorsArray,warn:(e,t,r)=>n.mainstay.warnings.push(i(e,t,r)),message:(o,i)=>t.$_createError("custom",e,i,n,r,{messages:o})};n.mainstay.tracer.entry(t,n);const l=t._definition;if(l.prepare&&void 0!==e&&r.convert){const t=l.prepare(e,a);if(t){if(n.mainstay.tracer.value(n,"prepare",e,t.value),t.errors)return p.finalize(t.value,[].concat(t.errors),a);e=t.value}}if(l.coerce&&void 0!==e&&r.convert&&(!l.coerce.from||l.coerce.from.includes(typeof e))){const t=l.coerce.method(e,a);if(t){if(n.mainstay.tracer.value(n,"coerced",e,t.value),t.errors)return p.finalize(t.value,[].concat(t.errors),a);e=t.value}}const u=t._flags.empty;u&&u.$_match(p.trim(e,t),n.nest(u),s.defaults)&&(n.mainstay.tracer.value(n,"empty",e,void 0),e=void 0);const c=o.presence||t._flags.presence||(t._flags._endedSwitch?null:r.presence);if(void 0===e){if("forbidden"===c)return p.finalize(e,null,a);if("required"===c)return p.finalize(e,[t.$_createError("any.required",e,null,n,r)],a);if("optional"===c){if(t._flags.default!==s.symbols.deepDefault)return p.finalize(e,null,a);n.mainstay.tracer.value(n,"default",e,{}),e={}}}else if("forbidden"===c)return p.finalize(e,[t.$_createError("any.unknown",e,null,n,r)],a);const d=[];if(t._valids){const o=t._valids.get(e,n,r,t._flags.insensitive);if(o)return r.convert&&(n.mainstay.tracer.value(n,"valids",e,o.value),e=o.value),n.mainstay.tracer.filter(t,n,"valid",o),p.finalize(e,null,a);if(t._flags.only){const o=t.$_createError("any.only",e,{valids:t._valids.values({display:!0})},n,r);if(r.abortEarly)return p.finalize(e,[o],a);d.push(o)}}if(t._invalids){const o=t._invalids.get(e,n,r,t._flags.insensitive);if(o){n.mainstay.tracer.filter(t,n,"invalid",o);const i=t.$_createError("any.invalid",e,{invalids:t._invalids.values({display:!0})},n,r);if(r.abortEarly)return p.finalize(e,[i],a);d.push(i)}}if(l.validate){const t=l.validate(e,a);if(t&&(n.mainstay.tracer.value(n,"base",e,t.value),e=t.value,t.errors)){if(!Array.isArray(t.errors))return d.push(t.errors),p.finalize(e,d,a);if(t.errors.length)return d.push(...t.errors),p.finalize(e,d,a)}}return t._rules.length?p.rules(e,d,a):p.finalize(e,d,a)},p.rules=function(e,t,n){const{schema:r,state:o,prefs:i}=n;for(const a of r._rules){const l=r._definition.rules[a.method];if(l.convert&&i.convert){o.mainstay.tracer.log(r,o,"rule",a.name,"full");continue}let u,c=a.args;if(a._resolve.length){c=Object.assign({},c);for(const t of a._resolve){const n=l.argsByName.get(t),a=c[t].resolve(e,o,i),p=n.normalize?n.normalize(a):a,d=s.validateArg(p,null,n);if(d){u=r.$_createError("any.ref",a,{arg:t,ref:c[t],reason:d},o,i);break}c[t]=p}}u=u||l.validate(e,n,c,a);const d=p.rule(u,a);if(d.errors){if(o.mainstay.tracer.log(r,o,"rule",a.name,"error"),a.warn){o.mainstay.warnings.push(...d.errors);continue}if(i.abortEarly)return p.finalize(e,d.errors,n);t.push(...d.errors)}else o.mainstay.tracer.log(r,o,"rule",a.name,"pass"),o.mainstay.tracer.value(o,"rule",e,d.value,a.name),e=d.value}return p.finalize(e,t,n)},p.rule=function(e,t){return e instanceof l.Report?(p.error(e,t),{errors:[e],value:null}):Array.isArray(e)&&e[s.symbols.errors]?(e.forEach(e=>p.error(e,t)),{errors:e,value:null}):{errors:null,value:e}},p.error=function(e,t){return t.message&&e._setTemplate(t.message),e},p.finalize=function(e,t,n){t=t||[];const{schema:o,state:i,prefs:a}=n;if(t.length){const r=p.default("failover",void 0,t,n);void 0!==r&&(i.mainstay.tracer.value(i,"failover",e,r),e=r,t=[])}if(t.length&&o._flags.error)if("function"==typeof o._flags.error){t=o._flags.error(t),Array.isArray(t)||(t=[t]);for(const e of t)r(e instanceof Error||e instanceof l.Report,"error() must return an Error object")}else t=[o._flags.error];if(void 0===e){const r=p.default("default",e,t,n);i.mainstay.tracer.value(i,"default",e,r),e=r}if(o._flags.cast&&void 0!==e){const t=o._definition.cast[o._flags.cast];if(t.from(e)){const r=t.to(e,n);i.mainstay.tracer.value(i,"cast",e,r,o._flags.cast),e=r}}if(o.$_terms.externals&&a.externals&&!1!==a._externals)for(const{method:e}of o.$_terms.externals)i.mainstay.externals.push({method:e,path:i.path,label:l.label(o._flags,i,a)});const s={value:e,errors:t.length?t:null};return o._flags.result&&(s.value="strip"===o._flags.result?void 0:n.original,i.mainstay.tracer.value(i,o._flags.result,e,s.value),i.shadow(e,o._flags.result)),o._cache&&!1!==a.cache&&!o._refs.length&&o._cache.set(n.original,s),void 0===e||s.errors||void 0===o._flags.artifact||(i.mainstay.artifacts=i.mainstay.artifacts||new Map,i.mainstay.artifacts.has(o._flags.artifact)||i.mainstay.artifacts.set(o._flags.artifact,[]),i.mainstay.artifacts.get(o._flags.artifact).push(i.path)),s},p.prefs=function(e,t){const n=t===s.defaults;return n&&e._preferences[s.symbols.prefs]?e._preferences[s.symbols.prefs]:(t=s.preferences(t,e._preferences),n&&(e._preferences[s.symbols.prefs]=t),t)},p.default=function(e,t,n,r){const{schema:i,state:a,prefs:l}=r,u=i._flags[e];if(l.noDefaults||void 0===u)return t;if(a.mainstay.tracer.log(i,a,"rule",e,"full"),!u)return u;if("function"==typeof u){const t=u.length?[o(a.ancestors[0]),r]:[];try{return u(...t)}catch(t){return void n.push(i.$_createError("any."+e,null,{error:t},a,l))}}return"object"!=typeof u?u:u[s.symbols.literal]?u.literal:s.isResolvable(u)?u.resolve(t,a,l):o(u)},p.trim=function(e,t){if("string"!=typeof e)return e;const n=t.$_getRule("trim");return n&&n.args.enabled?e.trim():e},p.ignore={active:!1,debug:i,entry:i,filter:i,log:i,resolve:i,value:i},p.errorsArray=function(){const e=[];return e[s.symbols.errors]=!0,e}},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){"use strict";const r=n(58),o=n(148),i=n(22),a={value:Symbol("value")};e.exports=a.State=class{constructor(e,t,n){this.path=e,this.ancestors=t,this.mainstay=n.mainstay,this.schemas=n.schemas,this.debug=null}localize(e,t=null,n=null){const r=new a.State(e,t,this);return n&&r.schemas&&(r.schemas=[a.schemas(n),...r.schemas]),r}nest(e,t){const n=new a.State(this.path,this.ancestors,this);return n.schemas=n.schemas&&[a.schemas(e),...n.schemas],n.debug=t,n}shadow(e,t){this.mainstay.shadow=this.mainstay.shadow||new a.Shadow,this.mainstay.shadow.set(this.path,e,t)}snapshot(){this.mainstay.shadow&&(this._snapshot=r(this.mainstay.shadow.node(this.path)))}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0)}},a.schemas=function(e){return i.isSchema(e)?{schema:e}:e},a.Shadow=class{constructor(){this._values=null}set(e,t,n){if(!e.length)return;if("strip"===n&&"number"==typeof e[e.length-1])return;this._values=this._values||new Map;let r=this._values;for(let t=0;t<e.length;++t){const n=e[t];let o=r.get(n);o||(o=new Map,r.set(n,o)),r=o}r[a.value]=t}get(e){const t=this.node(e);if(t)return t[a.value]}node(e){if(this._values)return o(this._values,e,{iterables:!0})}override(e,t){if(!this._values)return;const n=e.slice(0,-1),r=e[e.length-1],i=o(this._values,n,{iterables:!0});t?i.set(r,t):i&&i.delete(r)}}},function(e,t,n){"use strict";const r=n(16),o=n(234),i=n(148),a=n(79),s=n(22),l=n(149),u={};e.exports=a.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(e,{schema:t,state:n,prefs:r}){if(!Array.isArray(e))return;const o=t.$_getRule("sort");return o?u.sort(t,e,o.args.options,n,r):void 0}},validate(e,{schema:t,error:n}){if(!Array.isArray(e)){if(t._flags.single){const t=[e];return t[s.symbols.arraySingle]=!0,{value:t}}return{errors:n("array.base")}}if(t.$_getRule("items")||t.$_terms.externals)return{value:e.slice()}},rules:{has:{method(e){e=this.$_compile(e,{appendPath:!0});const t=this.$_addRule({name:"has",args:{schema:e}});return t.$_mutateRegister(e),t},validate(e,{state:t,prefs:n,error:r},{schema:o}){const i=[e,...t.ancestors];for(let r=0;r<e.length;++r){const a=t.localize([...t.path,r],i,o);if(o.$_match(e[r],a,n))return e}const a=o._flags.label;return a?r("array.hasKnown",{patternLabel:a}):r("array.hasUnknown",null)},multi:!0},items:{method(...e){s.verifyFlat(e,"items");const t=this.$_addRule("items");for(let n=0;n<e.length;++n){const r=s.tryWithPath(()=>this.$_compile(e[n]),n,{append:!0});t.$_terms.items.push(r)}return t.$_mutateRebuild()},validate(e,{schema:t,error:n,state:r,prefs:o,errorsArray:i}){const a=t.$_terms._requireds.slice(),l=t.$_terms.ordered.slice(),p=[...t.$_terms._inclusions,...a],c=!e[s.symbols.arraySingle];delete e[s.symbols.arraySingle];const d=i();let f=e.length;for(let i=0;i<f;++i){const s=e[i];let h=!1,g=!1;const m=c?i:new Number(i),y=[...r.path,m];if(!t._flags.sparse&&void 0===s){if(d.push(n("array.sparse",{key:m,path:y,pos:i,value:void 0},r.localize(y))),o.abortEarly)return d;l.shift();continue}const v=[e,...r.ancestors];for(const e of t.$_terms._exclusions)if(e.$_match(s,r.localize(y,v,e),o,{presence:"ignore"})){if(d.push(n("array.excludes",{pos:i,value:s},r.localize(y))),o.abortEarly)return d;h=!0,l.shift();break}if(h)continue;if(t.$_terms.ordered.length){if(l.length){const a=l.shift(),p=a.$_validate(s,r.localize(y,v,a),o);if(p.errors){if(d.push(...p.errors),o.abortEarly)return d}else if("strip"===a._flags.result)u.fastSplice(e,i),--i,--f;else{if(!t._flags.sparse&&void 0===p.value){if(d.push(n("array.sparse",{key:m,path:y,pos:i,value:void 0},r.localize(y))),o.abortEarly)return d;continue}e[i]=p.value}continue}if(!t.$_terms.items.length){if(d.push(n("array.orderedLength",{pos:i,limit:t.$_terms.ordered.length})),o.abortEarly)return d;break}}const b=[];let _=a.length;for(let l=0;l<_;++l){const p=r.localize(y,v,a[l]);p.snapshot();const c=a[l].$_validate(s,p,o);if(b[l]=c,!c.errors){if(e[i]=c.value,g=!0,u.fastSplice(a,l),--l,--_,!t._flags.sparse&&void 0===c.value&&(d.push(n("array.sparse",{key:m,path:y,pos:i,value:void 0},r.localize(y))),o.abortEarly))return d;break}p.restore()}if(g)continue;const T=o.stripUnknown&&!!o.stripUnknown.arrays||!1;_=p.length;for(const l of p){let p;const c=a.indexOf(l);if(-1!==c)p=b[c];else{const a=r.localize(y,v,l);if(a.snapshot(),p=l.$_validate(s,a,o),!p.errors){"strip"===l._flags.result?(u.fastSplice(e,i),--i,--f):t._flags.sparse||void 0!==p.value?e[i]=p.value:(d.push(n("array.sparse",{key:m,path:y,pos:i,value:void 0},r.localize(y))),h=!0),g=!0;break}a.restore()}if(1===_){if(T){u.fastSplice(e,i),--i,--f,g=!0;break}if(d.push(...p.errors),o.abortEarly)return d;h=!0;break}}if(!h&&((t.$_terms._inclusions.length||t.$_terms._requireds.length)&&!g)){if(T){u.fastSplice(e,i),--i,--f;continue}if(d.push(n("array.includes",{pos:i,value:s},r.localize(y))),o.abortEarly)return d}}return a.length&&u.fillMissedErrors(t,d,a,e,r,o),l.length&&(u.fillOrderedErrors(t,d,l,e,r,o),d.length||u.fillDefault(l,e,r,o)),d.length?d:e},priority:!0,manifest:!1},length:{method(e){return this.$_addRule({name:"length",args:{limit:e},operator:"="})},validate:(e,t,{limit:n},{name:r,operator:o,args:i})=>s.compare(e.length,n,o)?e:t.error("array."+r,{limit:i.limit,value:e}),args:[{name:"limit",ref:!0,assert:s.limit,message:"must be a positive integer"}]},max:{method(e){return this.$_addRule({name:"max",method:"length",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"length",args:{limit:e},operator:">="})}},ordered:{method(...e){s.verifyFlat(e,"ordered");const t=this.$_addRule("items");for(let n=0;n<e.length;++n){const r=s.tryWithPath(()=>this.$_compile(e[n]),n,{append:!0});u.validateSingle(r,t),t.$_mutateRegister(r),t.$_terms.ordered.push(r)}return t.$_mutateRebuild()}},single:{method(e){const t=void 0===e||!!e;return r(!t||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",t)}},sort:{method(e={}){s.assertOptions(e,["by","order"]);const t={order:e.order||"ascending"};return e.by&&(t.by=l.ref(e.by,{ancestor:0}),r(!t.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:t}})},validate(e,{error:t,state:n,prefs:r,schema:o},{options:i}){const{value:a,errors:s}=u.sort(o,e,i,n,r);if(s)return s;for(let n=0;n<e.length;++n)if(e[n]!==a[n])return t("array.sort",{order:i.order,by:i.by?i.by.key:"value"});return e},convert:!0},sparse:{method(e){const t=void 0===e||!!e;if(this._flags.sparse===t)return this;return(t?this.clone():this.$_addRule("items")).$_setFlag("sparse",t,{clone:!1})}},unique:{method(e,t={}){r(!e||"function"==typeof e||"string"==typeof e,"comparator must be a function or a string"),s.assertOptions(t,["ignoreUndefined","separator"]);const n={name:"unique",args:{options:t,comparator:e}};if(e)if("string"==typeof e){const r=s.default(t.separator,".");n.path=r?e.split(r):[e]}else n.comparator=e;return this.$_addRule(n)},validate(e,{state:t,error:n,schema:a},{comparator:s,options:l},{comparator:u,path:p}){const c={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),object:new Map,function:new Map,custom:new Map},d=u||o,f=l.ignoreUndefined;for(let o=0;o<e.length;++o){const a=p?i(e[o],p):e[o],l=u?c.custom:c[typeof a];if(r(l,"Failed to find unique map container for type",typeof a),l instanceof Map){const r=l.entries();let i;for(;!(i=r.next()).done;)if(d(i.value[0],a)){const r=t.localize([...t.path,o],[e,...t.ancestors]),a={pos:o,value:e[o],dupePos:i.value[1],dupeValue:e[i.value[1]]};return p&&(a.path=s),n("array.unique",a,r)}l.set(a,o)}else{if((!f||void 0!==a)&&void 0!==l[a]){const r={pos:o,value:e[o],dupePos:l[a],dupeValue:e[l[a]]};p&&(r.path=s);return n("array.unique",r,t.localize([...t.path,o],[e,...t.ancestors]))}l[a]=o}}return e},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(e,t)=>new Set(e)}},rebuild(e){e.$_terms._inclusions=[],e.$_terms._exclusions=[],e.$_terms._requireds=[];for(const t of e.$_terms.items)u.validateSingle(t,e),"required"===t._flags.presence?e.$_terms._requireds.push(t):"forbidden"===t._flags.presence?e.$_terms._exclusions.push(t):e.$_terms._inclusions.push(t);for(const t of e.$_terms.ordered)u.validateSingle(t,e)},manifest:{build:(e,t)=>(t.items&&(e=e.items(...t.items)),t.ordered&&(e=e.ordered(...t.ordered)),e)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),u.fillMissedErrors=function(e,t,n,r,o,i){const a=[];let s=0;for(const e of n){const t=e._flags.label;t?a.push(t):++s}a.length?s?t.push(e.$_createError("array.includesRequiredBoth",r,{knownMisses:a,unknownMisses:s},o,i)):t.push(e.$_createError("array.includesRequiredKnowns",r,{knownMisses:a},o,i)):t.push(e.$_createError("array.includesRequiredUnknowns",r,{unknownMisses:s},o,i))},u.fillOrderedErrors=function(e,t,n,r,o,i){const a=[];for(const e of n)"required"===e._flags.presence&&a.push(e);a.length&&u.fillMissedErrors(e,t,a,r,o,i)},u.fillDefault=function(e,t,n,r){const o=[];let i=!0;for(let a=e.length-1;a>=0;--a){const s=e[a],l=[t,...n.ancestors],u=s.$_validate(void 0,n.localize(n.path,l,s),r).value;if(i){if(void 0===u)continue;i=!1}o.unshift(u)}o.length&&t.push(...o)},u.fastSplice=function(e,t){let n=t;for(;n<e.length;)e[n++]=e[n];--e.length},u.validateSingle=function(e,t){("array"===e.type||e._flags._arrayItems)&&(r(!t._flags.single,"Cannot specify array item with single rule enabled"),t.$_setFlag("_arrayItems",!0,{clone:!1}))},u.sort=function(e,t,n,r,o){const i="ascending"===n.order?1:-1,a=-1*i,s=i,l=(l,p)=>{let c=u.compare(l,p,a,s);if(null!==c)return c;if(n.by&&(l=n.by.resolve(l,r,o),p=n.by.resolve(p,r,o)),c=u.compare(l,p,a,s),null!==c)return c;const d=typeof l;if(d!==typeof p)throw e.$_createError("array.sort.mismatching",t,null,r,o);if("number"!==d&&"string"!==d)throw e.$_createError("array.sort.unsupported",t,{type:d},r,o);return"number"===d?(l-p)*i:l<p?a:s};try{return{value:t.slice().sort(l)}}catch(e){return{errors:e}}},u.compare=function(e,t,n,r){return e===t?0:void 0===e?1:void 0===t?-1:null===e?r:null===t?n:null}},function(e,t,n){"use strict";const r=n(16),o=n(79),i=n(22),a=n(694),s={isBool:function(e){return"boolean"==typeof e}};e.exports=o.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(e,{schema:t}){if("boolean"!=typeof e){if("string"==typeof e){const n=t._flags.sensitive?e:e.toLowerCase();e="true"===n||"false"!==n&&e}return"boolean"!=typeof e&&(e=t.$_terms.truthy&&t.$_terms.truthy.has(e,null,null,!t._flags.sensitive)||(!t.$_terms.falsy||!t.$_terms.falsy.has(e,null,null,!t._flags.sensitive))&&e),{value:e}}},validate(e,{error:t}){if("boolean"!=typeof e)return{value:e,errors:t("boolean.base")}},rules:{truthy:{method(...e){i.verifyFlat(e,"truthy");const t=this.clone();t.$_terms.truthy=t.$_terms.truthy||new a;for(let n=0;n<e.length;++n){const o=e[n];r(void 0!==o,"Cannot call truthy with undefined"),t.$_terms.truthy.add(o)}return t}},falsy:{method(...e){i.verifyFlat(e,"falsy");const t=this.clone();t.$_terms.falsy=t.$_terms.falsy||new a;for(let n=0;n<e.length;++n){const o=e[n];r(void 0!==o,"Cannot call falsy with undefined"),t.$_terms.falsy.add(o)}return t}},sensitive:{method(e=!0){return this.$_setFlag("sensitive",e)}}},cast:{number:{from:s.isBool,to:(e,t)=>e?1:0},string:{from:s.isBool,to:(e,t)=>e?"true":"false"}},manifest:{build:(e,t)=>(t.truthy&&(e=e.truthy(...t.truthy)),t.falsy&&(e=e.falsy(...t.falsy)),e)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},function(e,t,n){"use strict";const r=n(16),o=n(79),i=n(22),a=n(123),s={isDate:function(e){return e instanceof Date}};e.exports=o.extend({type:"date",coerce:{from:["number","string"],method:(e,{schema:t})=>({value:s.parse(e,t._flags.format)||e})},validate(e,{schema:t,error:n,prefs:r}){if(e instanceof Date&&!isNaN(e.getTime()))return;const o=t._flags.format;return r.convert&&o&&"string"==typeof e?{value:e,errors:n("date.format",{format:o})}:{value:e,errors:n("date.base")}},rules:{compare:{method:!1,validate(e,t,{date:n},{name:r,operator:o,args:a}){const s="now"===n?Date.now():n.getTime();return i.compare(e.getTime(),s,o)?e:t.error("date."+r,{limit:a.date,value:e})},args:[{name:"date",ref:!0,normalize:e=>"now"===e?e:s.parse(e),assert:e=>null!==e,message:"must have a valid date format"}]},format:{method(e){return r(["iso","javascript","unix"].includes(e),"Unknown date format",e),this.$_setFlag("format",e)}},greater:{method(e){return this.$_addRule({name:"greater",method:"compare",args:{date:e},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(e){return this.$_addRule({name:"less",method:"compare",args:{date:e},operator:"<"})}},max:{method(e){return this.$_addRule({name:"max",method:"compare",args:{date:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"compare",args:{date:e},operator:">="})}},timestamp:{method(e="javascript"){return r(["javascript","unix"].includes(e),'"type" must be one of "javascript, unix"'),this.format(e)}}},cast:{number:{from:s.isDate,to:(e,t)=>e.getTime()},string:{from:s.isDate,to:(e,{prefs:t})=>a.date(e,t)}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),s.parse=function(e,t){if(e instanceof Date)return e;if("string"!=typeof e&&(isNaN(e)||!isFinite(e)))return null;if(/^\s*$/.test(e))return null;if("iso"===t)return i.isIsoDate(e)?s.date(e.toString()):null;const n=e;if("string"==typeof e&&/^[+-]?\d+(\.\d+)?$/.test(e)&&(e=parseFloat(e)),t){if("javascript"===t)return s.date(1*e);if("unix"===t)return s.date(1e3*e);if("string"==typeof n)return null}return s.date(e)},s.date=function(e){const t=new Date(e);return isNaN(t.getTime())?null:t}},function(e,t,n){"use strict";const r=n(16),o=n(695);e.exports=o.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(e){return r(Number.isSafeInteger(e)&&e>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:e}})},validate:(e,t,{n:n})=>e.length===n?e:t.error("function.arity",{n:n})},class:{method(){return this.$_addRule("class")},validate:(e,t)=>/^\s*class\s/.test(e.toString())?e:t.error("function.class",{value:e})},minArity:{method(e){return r(Number.isSafeInteger(e)&&e>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:e}})},validate:(e,t,{n:n})=>e.length>=n?e:t.error("function.minArity",{n:n})},maxArity:{method(e){return r(Number.isSafeInteger(e)&&e>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:e}})},validate:(e,t,{n:n})=>e.length<=n?e:t.error("function.maxArity",{n:n})}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},function(e,t,n){"use strict";const r=n(16),o=n(58),i=n(348),a=n(148),s={};e.exports=function(e,t,n={}){if(r(e&&"object"==typeof e,"Invalid defaults value: must be an object"),r(!t||!0===t||"object"==typeof t,"Invalid source value: must be true, falsy or an object"),r("object"==typeof n,"Invalid options: must be an object"),!t)return null;if(n.shallow)return s.applyToDefaultsWithShallow(e,t,n);const a=o(e);if(!0===t)return a;const l=void 0!==n.nullOverride&&n.nullOverride;return i(a,t,{nullOverride:l,mergeArrays:!1})},s.applyToDefaultsWithShallow=function(e,t,n){const l=n.shallow;r(Array.isArray(l),"Invalid keys");const u=new Map,p=!0===t?null:new Set;for(let n of l){n=Array.isArray(n)?n:n.split(".");const r=a(e,n);r&&"object"==typeof r?u.set(r,p&&a(t,n)||r):p&&p.add(n)}const c=o(e,{},u);if(!p)return c;for(const e of p)s.reachCopy(c,t,e);const d=void 0!==n.nullOverride&&n.nullOverride;return i(c,t,{nullOverride:d,mergeArrays:!1})},s.reachCopy=function(e,t,n){for(const e of n){if(!(e in t))return;const n=t[e];if("object"!=typeof n||null===n)return;t=n}const r=t;let o=e;for(let e=0;e<n.length-1;++e){const t=n[e];"object"!=typeof o[t]&&(o[t]={}),o=o[t]}o[n[n.length-1]]=r}},function(e,t,n){"use strict";const r=n(16),o={};t.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(e,t){const n=[].concat((t=t||{}).before||[]),o=[].concat(t.after||[]),i=t.group||"?",a=t.sort||0;r(!n.includes(i),"Item cannot come before itself: "+i),r(!n.includes("?"),"Item cannot come before unassociated items"),r(!o.includes(i),"Item cannot come after itself: "+i),r(!o.includes("?"),"Item cannot come after unassociated items"),Array.isArray(e)||(e=[e]);for(const t of e){const e={seq:this._items.length,sort:a,before:n,after:o,group:i,node:t};this._items.push(e)}if(!t.manual){const e=this._sort();r(e,"item","?"!==i?"added into group "+i:"","created a dependencies error")}return this.nodes}merge(e){Array.isArray(e)||(e=[e]);for(const t of e)if(t)for(const e of t._items)this._items.push(Object.assign({},e));this._items.sort(o.mergeSort);for(let e=0;e<this._items.length;++e)this._items[e].seq=e;const t=this._sort();return r(t,"merge created a dependencies error"),this.nodes}sort(){const e=this._sort();return r(e,"sort created a dependencies error"),this.nodes}_sort(){const e={},t=Object.create(null),n=Object.create(null);for(const r of this._items){const o=r.seq,i=r.group;n[i]=n[i]||[],n[i].push(o),e[o]=r.before;for(const e of r.after)t[e]=t[e]||[],t[e].push(o)}for(const t in e){const r=[];for(const o in e[t]){const i=e[t][o];n[i]=n[i]||[],r.push(...n[i])}e[t]=r}for(const r in t)if(n[r])for(const o of n[r])e[o].push(...t[r]);const r={};for(const t in e){const n=e[t];for(const e of n)r[e]=r[e]||[],r[e].push(t)}const o={},i=[];for(let e=0;e<this._items.length;++e){let t=e;if(r[e]){t=null;for(let e=0;e<this._items.length;++e){if(!0===o[e])continue;r[e]||(r[e]=[]);const n=r[e].length;let i=0;for(let t=0;t<n;++t)o[r[e][t]]&&++i;if(i===n){t=e;break}}}null!==t&&(o[t]=!0,i.push(t))}if(i.length!==this._items.length)return!1;const a={};for(const e of this._items)a[e.seq]=e;this._items=[],this.nodes=[];for(const e of i){const t=a[e];this.nodes.push(t.node),this._items.push(t)}return!0}},o.mergeSort=(e,t)=>e.sort===t.sort?0:e.sort<t.sort?-1:1},function(e,t,n){"use strict";const r=n(16),o=n(79),i=n(22),a=n(149),s=n(106),l={};e.exports=o.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(e,t)=>e.ref(t),validate(e,{schema:t,state:n,prefs:o}){r(t.$_terms.link,"Uninitialized link schema");const i=l.generate(t,e,n,o),a=t.$_terms.link[0].ref;return i.$_validate(e,n.nest(i,`link:${a.display}:${i.type}`),o)},generate:(e,t,n,r)=>l.generate(e,t,n,r),rules:{ref:{method(e){r(!this.$_terms.link,"Cannot reinitialize schema"),e=a.ref(e),r("value"===e.type||"local"===e.type,"Invalid reference type:",e.type),r("local"===e.type||"root"===e.ancestor||e.ancestor>0,"Link cannot reference itself");const t=this.clone();return t.$_terms.link=[{ref:e}],t}},relative:{method(e=!0){return this.$_setFlag("relative",e)}}},overrides:{concat(e){r(this.$_terms.link,"Uninitialized link schema"),r(i.isSchema(e),"Invalid schema object"),r("link"!==e.type,"Cannot merge type link with another link");const t=this.clone();return t.$_terms.whens||(t.$_terms.whens=[]),t.$_terms.whens.push({concat:e}),t.$_mutateRebuild()}},manifest:{build:(e,t)=>(r(t.link,"Invalid link description missing link"),e.ref(t.link))}}),l.generate=function(e,t,n,r){let o=n.mainstay.links.get(e);if(o)return o._generate(t,n,r).schema;const i=e.$_terms.link[0].ref,{perspective:a,path:s}=l.perspective(i,n);l.assert(a,"which is outside of schema boundaries",i,e,n,r);try{o=s.length?a.$_reach(s):a}catch(t){l.assert(!1,"to non-existing schema",i,e,n,r)}return l.assert("link"!==o.type,"which is another link",i,e,n,r),e._flags.relative||n.mainstay.links.set(e,o),o._generate(t,n,r).schema},l.perspective=function(e,t){if("local"===e.type){for(const{schema:n,key:r}of t.schemas){if((n._flags.id||r)===e.path[0])return{perspective:n,path:e.path.slice(1)};if(n.$_terms.shared)for(const t of n.$_terms.shared)if(t._flags.id===e.path[0])return{perspective:t,path:e.path.slice(1)}}return{perspective:null,path:null}}return"root"===e.ancestor?{perspective:t.schemas[t.schemas.length-1].schema,path:e.path}:{perspective:t.schemas[e.ancestor]&&t.schemas[e.ancestor].schema,path:e.path}},l.assert=function(e,t,n,o,i,a){e||r(!1,`"${s.label(o._flags,i,a)}" contains link reference "${n.display}" ${t}`)}},function(e,t,n){"use strict";const r=n(16),o=n(79),i=n(22),a={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/};e.exports=o.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(e,{schema:t,error:n}){const r=e.match(a.numberRx);if(!r)return;e=e.trim();const o={value:parseFloat(e)};if(0===o.value&&(o.value=0),!t._flags.unsafe)if(e.match(/e/i)){if(a.normalizeExponent(`${o.value/Math.pow(10,r[1])}e${r[1]}`)!==a.normalizeExponent(e))return o.errors=n("number.unsafe"),o}else{const t=o.value.toString();if(t.match(/e/i))return o;if(t!==a.normalizeDecimal(e))return o.errors=n("number.unsafe"),o}return o}},validate(e,{schema:t,error:n,prefs:r}){if(e===1/0||e===-1/0)return{value:e,errors:n("number.infinity")};if(!i.isNumber(e))return{value:e,errors:n("number.base")};const o={value:e};if(r.convert){const e=t.$_getRule("precision");if(e){const t=Math.pow(10,e.args.limit);o.value=Math.round(o.value*t)/t}}return 0===o.value&&(o.value=0),!t._flags.unsafe&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(o.errors=n("number.unsafe")),o},rules:{compare:{method:!1,validate:(e,t,{limit:n},{name:r,operator:o,args:a})=>i.compare(e,n,o)?e:t.error("number."+r,{limit:a.limit,value:e}),args:[{name:"limit",ref:!0,assert:i.isNumber,message:"must be a number"}]},greater:{method(e){return this.$_addRule({name:"greater",method:"compare",args:{limit:e},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(e,t)=>Math.trunc(e)-e==0?e:t.error("number.integer")},less:{method(e){return this.$_addRule({name:"less",method:"compare",args:{limit:e},operator:"<"})}},max:{method(e){return this.$_addRule({name:"max",method:"compare",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"compare",args:{limit:e},operator:">="})}},multiple:{method(e){return this.$_addRule({name:"multiple",args:{base:e}})},validate:(e,t,{base:n},r)=>e*(1/n)%1==0?e:t.error("number.multiple",{multiple:r.args.base,value:e}),args:[{name:"base",ref:!0,assert:e=>"number"==typeof e&&isFinite(e)&&e>0,message:"must be a positive number"}],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(e,t)=>Number.isSafeInteger(e)&&e>=0&&e<=65535?e:t.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(e){return r(Number.isSafeInteger(e),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:e}})},validate(e,t,{limit:n}){const r=e.toString().match(a.precisionRx);return Math.max((r[1]?r[1].length:0)-(r[2]?parseInt(r[2],10):0),0)<=n?e:t.error("number.precision",{limit:n,value:e})},convert:!0},sign:{method(e){return r(["negative","positive"].includes(e),"Invalid sign",e),this.$_addRule({name:"sign",args:{sign:e}})},validate:(e,t,{sign:n})=>"negative"===n&&e<0||"positive"===n&&e>0?e:t.error("number."+n)},unsafe:{method(e=!0){return r("boolean"==typeof e,"enabled must be a boolean"),this.$_setFlag("unsafe",e)}}},cast:{string:{from:e=>"number"==typeof e,to:(e,t)=>e.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),a.normalizeExponent=function(e){return e.replace(/E/,"e").replace(/\.(\d*[1-9])?0+e/,".$1e").replace(/\.e/,"e").replace(/e\+/,"e").replace(/^\+/,"").replace(/^(-?)0+([1-9])/,"$1$2")},a.normalizeDecimal=function(e){return(e=e.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&e.endsWith("0")&&(e=e.replace(/0+$/,"")),"-0"===e?"0":e}},function(e,t,n){"use strict";const r=n(695);e.exports=r.extend({type:"object",cast:{map:{from:e=>e&&"object"==typeof e,to:(e,t)=>new Map(Object.entries(e))}}})},function(e,t,n){"use strict";const r=n(16),o=n(696),i=n(1347),a=n(1348),s=n(699),l=n(1349),u=n(698),p=n(79),c=n(22),d={tlds:l instanceof Set&&{tlds:{allow:l,deny:null}},base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:/^[a-f0-9]+$/i,ipRegex:a.regex({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};e.exports=p.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(e,{schema:t,state:n,prefs:r}){const o=t.$_getRule("normalize");o&&(e=e.normalize(o.args.form));const i=t.$_getRule("case");i&&(e="upper"===i.args.direction?e.toLocaleUpperCase():e.toLocaleLowerCase());const a=t.$_getRule("trim");if(a&&a.args.enabled&&(e=e.trim()),t.$_terms.replacements)for(const n of t.$_terms.replacements)e=e.replace(n.pattern,n.replacement);const s=t.$_getRule("hex");if(s&&s.args.options.byteAligned&&e.length%2!=0&&(e="0"+e),t.$_getRule("isoDate")){const t=d.isoDate(e);t&&(e=t)}if(t._flags.truncate){const o=t.$_getRule("max");if(o){let i=o.args.limit;if(c.isResolvable(i)&&(i=i.resolve(e,n,r),!c.limit(i)))return{value:e,errors:t.$_createError("any.ref",i,{ref:o.args.limit,arg:"limit",reason:"must be a positive integer"},n,r)};e=e.slice(0,i)}}return{value:e}}},validate(e,{schema:t,error:n}){if("string"!=typeof e)return{value:e,errors:n("string.base")};if(""===e){const r=t.$_getRule("min");if(r&&0===r.args.limit)return;return{value:e,errors:n("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(e,t)=>/^[a-zA-Z0-9]+$/.test(e)?e:t.error("string.alphanum")},base64:{method(e={}){return c.assertOptions(e,["paddingRequired","urlSafe"]),e={urlSafe:!1,paddingRequired:!0,...e},r("boolean"==typeof e.paddingRequired,"paddingRequired must be boolean"),r("boolean"==typeof e.urlSafe,"urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:e}})},validate:(e,t,{options:n})=>d.base64Regex[n.paddingRequired][n.urlSafe].test(e)?e:t.error("string.base64")},case:{method(e){return r(["lower","upper"].includes(e),"Invalid case:",e),this.$_addRule({name:"case",args:{direction:e}})},validate:(e,t,{direction:n})=>"lower"===n&&e===e.toLocaleLowerCase()||"upper"===n&&e===e.toLocaleUpperCase()?e:t.error(`string.${n}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(e,t){let n=e.length,r=0,o=1;for(;n--;){const t=e.charAt(n)*o;r+=t-9*(t>9),o^=3}return r>0&&r%10==0?e:t.error("string.creditCard")}},dataUri:{method(e={}){return c.assertOptions(e,["paddingRequired"]),e={paddingRequired:!0,...e},r("boolean"==typeof e.paddingRequired,"paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:e}})},validate(e,t,{options:n}){const r=e.match(d.dataUriRegex);if(r){if(!r[2])return e;if("base64"!==r[2])return e;if(d.base64Regex[n.paddingRequired].false.test(r[3]))return e}return t.error("string.dataUri")}},domain:{method(e){e&&c.assertOptions(e,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const t=d.addressOptions(e);return this.$_addRule({name:"domain",args:{options:e},address:t})},validate:(e,t,n,{address:r})=>o.isValid(e,r)?e:t.error("string.domain")},email:{method(e={}){c.assertOptions(e,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),r(void 0===e.multiple||"boolean"==typeof e.multiple,"multiple option must be an boolean");const t=d.addressOptions(e),n=new RegExp(`\\s*[${e.separator?s(e.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:e},regex:n,address:t})},validate(e,t,{options:n},{regex:r,address:o}){const a=n.multiple?e.split(r):[e],s=[];for(const e of a)i.isValid(e,o)||s.push(e);return s.length?t.error("string.email",{value:e,invalids:s}):e}},guid:{alias:"uuid",method(e={}){c.assertOptions(e,["version","separator"]);let t="";if(e.version){const n=[].concat(e.version);r(n.length>=1,"version must have at least 1 valid version specified");const o=new Set;for(let e=0;e<n.length;++e){const i=n[e];r("string"==typeof i,"version at position "+e+" must be a string");const a=d.guidVersions[i.toLowerCase()];r(a,"version at position "+e+" must be one of "+Object.keys(d.guidVersions).join(", ")),r(!o.has(a),"version at position "+e+" must not be a duplicate"),t+=a,o.add(a)}}r(d.guidSeparators.has(e.separator),'separator must be one of true, false, "-", or ":"');const n=void 0===e.separator?"[:-]?":!0===e.separator?"[:-]":!1===e.separator?"[]?":"\\"+e.separator,o=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${n})[0-9A-F]{4}\\2?[${t||"0-9A-F"}][0-9A-F]{3}\\2?[${t?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:e},regex:o})},validate(e,t,n,{regex:r}){const o=r.exec(e);return o?d.guidBrackets[o[1]]!==o[o.length-1]?t.error("string.guid"):e:t.error("string.guid")}},hex:{method(e={}){return c.assertOptions(e,["byteAligned"]),e={byteAligned:!1,...e},r("boolean"==typeof e.byteAligned,"byteAligned must be boolean"),this.$_addRule({name:"hex",args:{options:e}})},validate:(e,t,{options:n})=>d.hexRegex.test(e)?n.byteAligned&&e.length%2!=0?t.error("string.hexAlign"):e:t.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(e,t)=>o.isValid(e,{minDomainSegments:1})||d.ipRegex.test(e)?e:t.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(e={}){c.assertOptions(e,["cidr","version"]);const{cidr:t,versions:n,regex:r}=a.regex(e),o=e.version?n:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:t,version:o}},regex:r})},validate:(e,t,{options:n},{regex:r})=>r.test(e)?e:n.version?t.error("string.ipVersion",{value:e,cidr:n.cidr,version:n.version}):t.error("string.ip",{value:e,cidr:n.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(e,{error:t})=>d.isoDate(e)?e:t("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(e,t)=>d.isoDurationRegex.test(e)?e:t.error("string.isoDuration")},length:{method(e,t){return d.length(this,"length",e,"=",t)},validate(e,t,{limit:n,encoding:r},{name:o,operator:i,args:a}){const s=r?Buffer&&Buffer.byteLength(e,r):e.length;return c.compare(s,n,i)?e:t.error("string."+o,{limit:a.limit,value:e,encoding:r})},args:[{name:"limit",ref:!0,assert:c.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(e,t){return d.length(this,"max",e,"<=",t)},args:["limit","encoding"]},min:{method(e,t){return d.length(this,"min",e,">=",t)},args:["limit","encoding"]},normalize:{method(e="NFC"){return r(d.normalizationForms.includes(e),"normalization form must be one of "+d.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:e}})},validate:(e,{error:t},{form:n})=>e===e.normalize(n)?e:t("string.normalize",{value:e,form:n}),convert:!0},pattern:{alias:"regex",method(e,t={}){r(e instanceof RegExp,"regex must be a RegExp"),r(!e.flags.includes("g")&&!e.flags.includes("y"),"regex should not use global or sticky mode"),"string"==typeof t&&(t={name:t}),c.assertOptions(t,["invert","name"]);const n=["string.pattern",t.invert?".invert":"",t.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:e,options:t},errorCode:n})},validate:(e,t,{regex:n,options:r},{errorCode:o})=>n.test(e)^r.invert?e:t.error(o,{name:r.name,regex:n,value:e}),args:["regex","options"],multi:!0},replace:{method(e,t){"string"==typeof e&&(e=new RegExp(s(e),"g")),r(e instanceof RegExp,"pattern must be a RegExp"),r("string"==typeof t,"replacement must be a String");const n=this.clone();return n.$_terms.replacements||(n.$_terms.replacements=[]),n.$_terms.replacements.push({pattern:e,replacement:t}),n}},token:{method(){return this.$_addRule("token")},validate:(e,t)=>/^\w+$/.test(e)?e:t.error("string.token")},trim:{method(e=!0){return r("boolean"==typeof e,"enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:e}})},validate:(e,t,{enabled:n})=>n&&e!==e.trim()?t.error("string.trim"):e,convert:!0},truncate:{method(e=!0){return r("boolean"==typeof e,"enabled must be a boolean"),this.$_setFlag("truncate",e)}},uppercase:{method(){return this.case("upper")}},uri:{method(e={}){c.assertOptions(e,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme"]),e.domain&&c.assertOptions(e.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:t,scheme:n}=u.regex(e),r=e.domain?d.addressOptions(e.domain):null;return this.$_addRule({name:"uri",args:{options:e},regex:t,domain:r,scheme:n})},validate(e,t,{options:n},{regex:r,domain:i,scheme:a}){if(["http:/","https:/"].includes(e))return t.error("string.uri");const s=r.exec(e);if(s){const r=s[1]||s[2];return!i||n.allowRelative&&!r||o.isValid(r,i)?e:t.error("string.domain",{value:r})}return n.relativeOnly?t.error("string.uriRelativeOnly"):n.scheme?t.error("string.uriCustomScheme",{scheme:a,value:e}):t.error("string.uri")}}},manifest:{build(e,t){if(t.replacements)for(const{pattern:n,replacement:r}of t.replacements)e=e.replace(n,r);return e}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),d.addressOptions=function(e){if(!e)return e;if(r(void 0===e.minDomainSegments||Number.isSafeInteger(e.minDomainSegments)&&e.minDomainSegments>0,"minDomainSegments must be a positive integer"),r(void 0===e.maxDomainSegments||Number.isSafeInteger(e.maxDomainSegments)&&e.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),!1===e.tlds)return e;if(!0===e.tlds||void 0===e.tlds)return r(d.tlds,"Built-in TLD list disabled"),Object.assign({},e,d.tlds);r("object"==typeof e.tlds,"tlds must be true, false, or an object");const t=e.tlds.deny;if(t)return Array.isArray(t)&&(e=Object.assign({},e,{tlds:{deny:new Set(t)}})),r(e.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),r(!e.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),d.validateTlds(e.tlds.deny,"tlds.deny"),e;const n=e.tlds.allow;return n?!0===n?(r(d.tlds,"Built-in TLD list disabled"),Object.assign({},e,d.tlds)):(Array.isArray(n)&&(e=Object.assign({},e,{tlds:{allow:new Set(n)}})),r(e.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),d.validateTlds(e.tlds.allow,"tlds.allow"),e):e},d.validateTlds=function(e,t){for(const n of e)r(o.isValid(n,{minDomainSegments:1,maxDomainSegments:1}),t+" must contain valid top level domain names")},d.isoDate=function(e){if(!c.isIsoDate(e))return null;/.*T.*[+-]\d\d$/.test(e)&&(e+="00");const t=new Date(e);return isNaN(t.getTime())?null:t.toISOString()},d.length=function(e,t,n,o,i){return r(!i||Buffer&&Buffer.isEncoding(i),"Invalid encoding:",i),e.$_addRule({name:t,method:"length",args:{limit:n,encoding:i},operator:o})}},function(e,t,n){"use strict";const r=n(8),o=n(696),i=n(697),a={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(r.TextEncoder||TextEncoder)};t.analyze=function(e,t){return a.email(e,t)},t.isValid=function(e,t){return!a.email(e,t)},a.email=function(e,t={}){if("string"!=typeof e)throw new Error("Invalid input: email must be a string");if(!e)return i.code("EMPTY_STRING");const n=!a.nonAsciiRx.test(e);if(!n){if(!1===t.allowUnicode)return i.code("FORBIDDEN_UNICODE");e=e.normalize("NFC")}const r=e.split("@");if(2!==r.length)return r.length>2?i.code("MULTIPLE_AT_CHAR"):i.code("MISSING_AT_CHAR");const[s,l]=r;if(!s)return i.code("EMPTY_LOCAL");if(!t.ignoreLength){if(e.length>254)return i.code("ADDRESS_TOO_LONG");if(a.encoder.encode(s).length>64)return i.code("LOCAL_TOO_LONG")}return a.local(s,n)||o.analyze(l,t)},a.local=function(e,t){const n=e.split(".");for(const e of n){if(!e.length)return i.code("EMPTY_LOCAL_SEGMENT");if(t){if(!a.atextRx.test(e))return i.code("INVALID_LOCAL_CHARS")}else for(const t of e){if(a.atextRx.test(t))continue;const e=a.binary(t);if(!a.atomRx.test(e))return i.code("INVALID_LOCAL_CHARS")}}},a.binary=function(e){return Array.from(a.encoder.encode(e)).map(e=>String.fromCharCode(e)).join("")},a.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,a.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))},function(e,t,n){"use strict";const r=n(16),o=n(698);t.regex=function(e={}){r(void 0===e.cidr||"string"==typeof e.cidr,"options.cidr must be a string");const t=e.cidr?e.cidr.toLowerCase():"optional";r(["required","optional","forbidden"].includes(t),"options.cidr must be one of required, optional, forbidden"),r(void 0===e.version||"string"==typeof e.version||Array.isArray(e.version),"options.version must be a string or an array of string");let n=e.version||["ipv4","ipv6","ipvfuture"];Array.isArray(n)||(n=[n]),r(n.length>=1,"options.version must have at least 1 version specified");for(let e=0;e<n.length;++e)r("string"==typeof n[e],"options.version must only contain strings"),n[e]=n[e].toLowerCase(),r(["ipv4","ipv6","ipvfuture"].includes(n[e]),"options.version contains unknown version "+n[e]+" - must be one of ipv4, ipv6, ipvfuture");n=Array.from(new Set(n));const i=`(?:${n.map(e=>{if("forbidden"===t)return o.ip[e];const n="\\/"+("ipv4"===e?o.ip.v4Cidr:o.ip.v6Cidr);return"required"===t?`${o.ip[e]}${n}`:`${o.ip[e]}(?:${n})?`}).join("|")})`,a=new RegExp(`^${i}$`);return{cidr:t,versions:n,regex:a,raw:i}}},function(e,t,n){"use strict";const r={tlds:["AAA","AARP","ABARTH","ABB","ABBOTT","ABBVIE","ABC","ABLE","ABOGADO","ABUDHABI","AC","ACADEMY","ACCENTURE","ACCOUNTANT","ACCOUNTANTS","ACO","ACTOR","AD","ADAC","ADS","ADULT","AE","AEG","AERO","AETNA","AF","AFL","AFRICA","AG","AGAKHAN","AGENCY","AI","AIG","AIRBUS","AIRFORCE","AIRTEL","AKDN","AL","ALFAROMEO","ALIBABA","ALIPAY","ALLFINANZ","ALLSTATE","ALLY","ALSACE","ALSTOM","AM","AMAZON","AMERICANEXPRESS","AMERICANFAMILY","AMEX","AMFAM","AMICA","AMSTERDAM","ANALYTICS","ANDROID","ANQUAN","ANZ","AO","AOL","APARTMENTS","APP","APPLE","AQ","AQUARELLE","AR","ARAB","ARAMCO","ARCHI","ARMY","ARPA","ART","ARTE","AS","ASDA","ASIA","ASSOCIATES","AT","ATHLETA","ATTORNEY","AU","AUCTION","AUDI","AUDIBLE","AUDIO","AUSPOST","AUTHOR","AUTO","AUTOS","AVIANCA","AW","AWS","AX","AXA","AZ","AZURE","BA","BABY","BAIDU","BANAMEX","BANANAREPUBLIC","BAND","BANK","BAR","BARCELONA","BARCLAYCARD","BARCLAYS","BAREFOOT","BARGAINS","BASEBALL","BASKETBALL","BAUHAUS","BAYERN","BB","BBC","BBT","BBVA","BCG","BCN","BD","BE","BEATS","BEAUTY","BEER","BENTLEY","BERLIN","BEST","BESTBUY","BET","BF","BG","BH","BHARTI","BI","BIBLE","BID","BIKE","BING","BINGO","BIO","BIZ","BJ","BLACK","BLACKFRIDAY","BLOCKBUSTER","BLOG","BLOOMBERG","BLUE","BM","BMS","BMW","BN","BNPPARIBAS","BO","BOATS","BOEHRINGER","BOFA","BOM","BOND","BOO","BOOK","BOOKING","BOSCH","BOSTIK","BOSTON","BOT","BOUTIQUE","BOX","BR","BRADESCO","BRIDGESTONE","BROADWAY","BROKER","BROTHER","BRUSSELS","BS","BT","BUGATTI","BUILD","BUILDERS","BUSINESS","BUY","BUZZ","BV","BW","BY","BZ","BZH","CA","CAB","CAFE","CAL","CALL","CALVINKLEIN","CAM","CAMERA","CAMP","CANCERRESEARCH","CANON","CAPETOWN","CAPITAL","CAPITALONE","CAR","CARAVAN","CARDS","CARE","CAREER","CAREERS","CARS","CASA","CASE","CASH","CASINO","CAT","CATERING","CATHOLIC","CBA","CBN","CBRE","CBS","CC","CD","CENTER","CEO","CERN","CF","CFA","CFD","CG","CH","CHANEL","CHANNEL","CHARITY","CHASE","CHAT","CHEAP","CHINTAI","CHRISTMAS","CHROME","CHURCH","CI","CIPRIANI","CIRCLE","CISCO","CITADEL","CITI","CITIC","CITY","CITYEATS","CK","CL","CLAIMS","CLEANING","CLICK","CLINIC","CLINIQUE","CLOTHING","CLOUD","CLUB","CLUBMED","CM","CN","CO","COACH","CODES","COFFEE","COLLEGE","COLOGNE","COM","COMCAST","COMMBANK","COMMUNITY","COMPANY","COMPARE","COMPUTER","COMSEC","CONDOS","CONSTRUCTION","CONSULTING","CONTACT","CONTRACTORS","COOKING","COOKINGCHANNEL","COOL","COOP","CORSICA","COUNTRY","COUPON","COUPONS","COURSES","CPA","CR","CREDIT","CREDITCARD","CREDITUNION","CRICKET","CROWN","CRS","CRUISE","CRUISES","CU","CUISINELLA","CV","CW","CX","CY","CYMRU","CYOU","CZ","DABUR","DAD","DANCE","DATA","DATE","DATING","DATSUN","DAY","DCLK","DDS","DE","DEAL","DEALER","DEALS","DEGREE","DELIVERY","DELL","DELOITTE","DELTA","DEMOCRAT","DENTAL","DENTIST","DESI","DESIGN","DEV","DHL","DIAMONDS","DIET","DIGITAL","DIRECT","DIRECTORY","DISCOUNT","DISCOVER","DISH","DIY","DJ","DK","DM","DNP","DO","DOCS","DOCTOR","DOG","DOMAINS","DOT","DOWNLOAD","DRIVE","DTV","DUBAI","DUNLOP","DUPONT","DURBAN","DVAG","DVR","DZ","EARTH","EAT","EC","ECO","EDEKA","EDU","EDUCATION","EE","EG","EMAIL","EMERCK","ENERGY","ENGINEER","ENGINEERING","ENTERPRISES","EPSON","EQUIPMENT","ER","ERICSSON","ERNI","ES","ESQ","ESTATE","ET","ETISALAT","EU","EUROVISION","EUS","EVENTS","EXCHANGE","EXPERT","EXPOSED","EXPRESS","EXTRASPACE","FAGE","FAIL","FAIRWINDS","FAITH","FAMILY","FAN","FANS","FARM","FARMERS","FASHION","FAST","FEDEX","FEEDBACK","FERRARI","FERRERO","FI","FIAT","FIDELITY","FIDO","FILM","FINAL","FINANCE","FINANCIAL","FIRE","FIRESTONE","FIRMDALE","FISH","FISHING","FIT","FITNESS","FJ","FK","FLICKR","FLIGHTS","FLIR","FLORIST","FLOWERS","FLY","FM","FO","FOO","FOOD","FOODNETWORK","FOOTBALL","FORD","FOREX","FORSALE","FORUM","FOUNDATION","FOX","FR","FREE","FRESENIUS","FRL","FROGANS","FRONTDOOR","FRONTIER","FTR","FUJITSU","FUN","FUND","FURNITURE","FUTBOL","FYI","GA","GAL","GALLERY","GALLO","GALLUP","GAME","GAMES","GAP","GARDEN","GAY","GB","GBIZ","GD","GDN","GE","GEA","GENT","GENTING","GEORGE","GF","GG","GGEE","GH","GI","GIFT","GIFTS","GIVES","GIVING","GL","GLASS","GLE","GLOBAL","GLOBO","GM","GMAIL","GMBH","GMO","GMX","GN","GODADDY","GOLD","GOLDPOINT","GOLF","GOO","GOODYEAR","GOOG","GOOGLE","GOP","GOT","GOV","GP","GQ","GR","GRAINGER","GRAPHICS","GRATIS","GREEN","GRIPE","GROCERY","GROUP","GS","GT","GU","GUARDIAN","GUCCI","GUGE","GUIDE","GUITARS","GURU","GW","GY","HAIR","HAMBURG","HANGOUT","HAUS","HBO","HDFC","HDFCBANK","HEALTH","HEALTHCARE","HELP","HELSINKI","HERE","HERMES","HGTV","HIPHOP","HISAMITSU","HITACHI","HIV","HK","HKT","HM","HN","HOCKEY","HOLDINGS","HOLIDAY","HOMEDEPOT","HOMEGOODS","HOMES","HOMESENSE","HONDA","HORSE","HOSPITAL","HOST","HOSTING","HOT","HOTELES","HOTELS","HOTMAIL","HOUSE","HOW","HR","HSBC","HT","HU","HUGHES","HYATT","HYUNDAI","IBM","ICBC","ICE","ICU","ID","IE","IEEE","IFM","IKANO","IL","IM","IMAMAT","IMDB","IMMO","IMMOBILIEN","IN","INC","INDUSTRIES","INFINITI","INFO","ING","INK","INSTITUTE","INSURANCE","INSURE","INT","INTERNATIONAL","INTUIT","INVESTMENTS","IO","IPIRANGA","IQ","IR","IRISH","IS","ISMAILI","IST","ISTANBUL","IT","ITAU","ITV","JAGUAR","JAVA","JCB","JE","JEEP","JETZT","JEWELRY","JIO","JLL","JM","JMP","JNJ","JO","JOBS","JOBURG","JOT","JOY","JP","JPMORGAN","JPRS","JUEGOS","JUNIPER","KAUFEN","KDDI","KE","KERRYHOTELS","KERRYLOGISTICS","KERRYPROPERTIES","KFH","KG","KH","KI","KIA","KIM","KINDER","KINDLE","KITCHEN","KIWI","KM","KN","KOELN","KOMATSU","KOSHER","KP","KPMG","KPN","KR","KRD","KRED","KUOKGROUP","KW","KY","KYOTO","KZ","LA","LACAIXA","LAMBORGHINI","LAMER","LANCASTER","LANCIA","LAND","LANDROVER","LANXESS","LASALLE","LAT","LATINO","LATROBE","LAW","LAWYER","LB","LC","LDS","LEASE","LECLERC","LEFRAK","LEGAL","LEGO","LEXUS","LGBT","LI","LIDL","LIFE","LIFEINSURANCE","LIFESTYLE","LIGHTING","LIKE","LILLY","LIMITED","LIMO","LINCOLN","LINDE","LINK","LIPSY","LIVE","LIVING","LK","LLC","LLP","LOAN","LOANS","LOCKER","LOCUS","LOFT","LOL","LONDON","LOTTE","LOTTO","LOVE","LPL","LPLFINANCIAL","LR","LS","LT","LTD","LTDA","LU","LUNDBECK","LUXE","LUXURY","LV","LY","MA","MACYS","MADRID","MAIF","MAISON","MAKEUP","MAN","MANAGEMENT","MANGO","MAP","MARKET","MARKETING","MARKETS","MARRIOTT","MARSHALLS","MASERATI","MATTEL","MBA","MC","MCKINSEY","MD","ME","MED","MEDIA","MEET","MELBOURNE","MEME","MEMORIAL","MEN","MENU","MERCKMSD","MG","MH","MIAMI","MICROSOFT","MIL","MINI","MINT","MIT","MITSUBISHI","MK","ML","MLB","MLS","MM","MMA","MN","MO","MOBI","MOBILE","MODA","MOE","MOI","MOM","MONASH","MONEY","MONSTER","MORMON","MORTGAGE","MOSCOW","MOTO","MOTORCYCLES","MOV","MOVIE","MP","MQ","MR","MS","MSD","MT","MTN","MTR","MU","MUSEUM","MUSIC","MUTUAL","MV","MW","MX","MY","MZ","NA","NAB","NAGOYA","NAME","NATURA","NAVY","NBA","NC","NE","NEC","NET","NETBANK","NETFLIX","NETWORK","NEUSTAR","NEW","NEWS","NEXT","NEXTDIRECT","NEXUS","NF","NFL","NG","NGO","NHK","NI","NICO","NIKE","NIKON","NINJA","NISSAN","NISSAY","NL","NO","NOKIA","NORTHWESTERNMUTUAL","NORTON","NOW","NOWRUZ","NOWTV","NP","NR","NRA","NRW","NTT","NU","NYC","NZ","OBI","OBSERVER","OFFICE","OKINAWA","OLAYAN","OLAYANGROUP","OLDNAVY","OLLO","OM","OMEGA","ONE","ONG","ONL","ONLINE","OOO","OPEN","ORACLE","ORANGE","ORG","ORGANIC","ORIGINS","OSAKA","OTSUKA","OTT","OVH","PA","PAGE","PANASONIC","PARIS","PARS","PARTNERS","PARTS","PARTY","PASSAGENS","PAY","PCCW","PE","PET","PF","PFIZER","PG","PH","PHARMACY","PHD","PHILIPS","PHONE","PHOTO","PHOTOGRAPHY","PHOTOS","PHYSIO","PICS","PICTET","PICTURES","PID","PIN","PING","PINK","PIONEER","PIZZA","PK","PL","PLACE","PLAY","PLAYSTATION","PLUMBING","PLUS","PM","PN","PNC","POHL","POKER","POLITIE","PORN","POST","PR","PRAMERICA","PRAXI","PRESS","PRIME","PRO","PROD","PRODUCTIONS","PROF","PROGRESSIVE","PROMO","PROPERTIES","PROPERTY","PROTECTION","PRU","PRUDENTIAL","PS","PT","PUB","PW","PWC","PY","QA","QPON","QUEBEC","QUEST","RACING","RADIO","RE","READ","REALESTATE","REALTOR","REALTY","RECIPES","RED","REDSTONE","REDUMBRELLA","REHAB","REISE","REISEN","REIT","RELIANCE","REN","RENT","RENTALS","REPAIR","REPORT","REPUBLICAN","REST","RESTAURANT","REVIEW","REVIEWS","REXROTH","RICH","RICHARDLI","RICOH","RIL","RIO","RIP","RO","ROCHER","ROCKS","RODEO","ROGERS","ROOM","RS","RSVP","RU","RUGBY","RUHR","RUN","RW","RWE","RYUKYU","SA","SAARLAND","SAFE","SAFETY","SAKURA","SALE","SALON","SAMSCLUB","SAMSUNG","SANDVIK","SANDVIKCOROMANT","SANOFI","SAP","SARL","SAS","SAVE","SAXO","SB","SBI","SBS","SC","SCA","SCB","SCHAEFFLER","SCHMIDT","SCHOLARSHIPS","SCHOOL","SCHULE","SCHWARZ","SCIENCE","SCOT","SD","SE","SEARCH","SEAT","SECURE","SECURITY","SEEK","SELECT","SENER","SERVICES","SES","SEVEN","SEW","SEX","SEXY","SFR","SG","SH","SHANGRILA","SHARP","SHAW","SHELL","SHIA","SHIKSHA","SHOES","SHOP","SHOPPING","SHOUJI","SHOW","SHOWTIME","SI","SILK","SINA","SINGLES","SITE","SJ","SK","SKI","SKIN","SKY","SKYPE","SL","SLING","SM","SMART","SMILE","SN","SNCF","SO","SOCCER","SOCIAL","SOFTBANK","SOFTWARE","SOHU","SOLAR","SOLUTIONS","SONG","SONY","SOY","SPA","SPACE","SPORT","SPOT","SR","SRL","SS","ST","STADA","STAPLES","STAR","STATEBANK","STATEFARM","STC","STCGROUP","STOCKHOLM","STORAGE","STORE","STREAM","STUDIO","STUDY","STYLE","SU","SUCKS","SUPPLIES","SUPPLY","SUPPORT","SURF","SURGERY","SUZUKI","SV","SWATCH","SWISS","SX","SY","SYDNEY","SYSTEMS","SZ","TAB","TAIPEI","TALK","TAOBAO","TARGET","TATAMOTORS","TATAR","TATTOO","TAX","TAXI","TC","TCI","TD","TDK","TEAM","TECH","TECHNOLOGY","TEL","TEMASEK","TENNIS","TEVA","TF","TG","TH","THD","THEATER","THEATRE","TIAA","TICKETS","TIENDA","TIFFANY","TIPS","TIRES","TIROL","TJ","TJMAXX","TJX","TK","TKMAXX","TL","TM","TMALL","TN","TO","TODAY","TOKYO","TOOLS","TOP","TORAY","TOSHIBA","TOTAL","TOURS","TOWN","TOYOTA","TOYS","TR","TRADE","TRADING","TRAINING","TRAVEL","TRAVELCHANNEL","TRAVELERS","TRAVELERSINSURANCE","TRUST","TRV","TT","TUBE","TUI","TUNES","TUSHU","TV","TVS","TW","TZ","UA","UBANK","UBS","UG","UK","UNICOM","UNIVERSITY","UNO","UOL","UPS","US","UY","UZ","VA","VACATIONS","VANA","VANGUARD","VC","VE","VEGAS","VENTURES","VERISIGN","VERSICHERUNG","VET","VG","VI","VIAJES","VIDEO","VIG","VIKING","VILLAS","VIN","VIP","VIRGIN","VISA","VISION","VIVA","VIVO","VLAANDEREN","VN","VODKA","VOLKSWAGEN","VOLVO","VOTE","VOTING","VOTO","VOYAGE","VU","VUELOS","WALES","WALMART","WALTER","WANG","WANGGOU","WATCH","WATCHES","WEATHER","WEATHERCHANNEL","WEBCAM","WEBER","WEBSITE","WED","WEDDING","WEIBO","WEIR","WF","WHOSWHO","WIEN","WIKI","WILLIAMHILL","WIN","WINDOWS","WINE","WINNERS","WME","WOLTERSKLUWER","WOODSIDE","WORK","WORKS","WORLD","WOW","WS","WTC","WTF","XBOX","XEROX","XFINITY","XIHUAN","XIN","XN--11B4C3D","XN--1CK2E1B","XN--1QQW23A","XN--2SCRJ9C","XN--30RR7Y","XN--3BST00M","XN--3DS443G","XN--3E0B707E","XN--3HCRJ9C","XN--3PXU8K","XN--42C2D9A","XN--45BR5CYL","XN--45BRJ9C","XN--45Q11C","XN--4DBRK0CE","XN--4GBRIM","XN--54B7FTA0CC","XN--55QW42G","XN--55QX5D","XN--5SU34J936BGSG","XN--5TZM5G","XN--6FRZ82G","XN--6QQ986B3XL","XN--80ADXHKS","XN--80AO21A","XN--80AQECDR1A","XN--80ASEHDB","XN--80ASWG","XN--8Y0A063A","XN--90A3AC","XN--90AE","XN--90AIS","XN--9DBQ2A","XN--9ET52U","XN--9KRT00A","XN--B4W605FERD","XN--BCK1B9A5DRE4C","XN--C1AVG","XN--C2BR7G","XN--CCK2B3B","XN--CCKWCXETD","XN--CG4BKI","XN--CLCHC0EA0B2G2A9GCD","XN--CZR694B","XN--CZRS0T","XN--CZRU2D","XN--D1ACJ3B","XN--D1ALF","XN--E1A4C","XN--ECKVDTC9D","XN--EFVY88H","XN--FCT429K","XN--FHBEI","XN--FIQ228C5HS","XN--FIQ64B","XN--FIQS8S","XN--FIQZ9S","XN--FJQ720A","XN--FLW351E","XN--FPCRJ9C3D","XN--FZC2C9E2C","XN--FZYS8D69UVGM","XN--G2XX48C","XN--GCKR3F0F","XN--GECRJ9C","XN--GK3AT1E","XN--H2BREG3EVE","XN--H2BRJ9C","XN--H2BRJ9C8C","XN--HXT814E","XN--I1B6B1A6A2E","XN--IMR513N","XN--IO0A7I","XN--J1AEF","XN--J1AMH","XN--J6W193G","XN--JLQ480N2RG","XN--JLQ61U9W7B","XN--JVR189M","XN--KCRX77D1X4A","XN--KPRW13D","XN--KPRY57D","XN--KPUT3I","XN--L1ACC","XN--LGBBAT1AD8J","XN--MGB9AWBF","XN--MGBA3A3EJT","XN--MGBA3A4F16A","XN--MGBA7C0BBN0A","XN--MGBAAKC7DVF","XN--MGBAAM7A8H","XN--MGBAB2BD","XN--MGBAH1A3HJKRD","XN--MGBAI9AZGQP6J","XN--MGBAYH7GPA","XN--MGBBH1A","XN--MGBBH1A71E","XN--MGBC0A9AZCG","XN--MGBCA7DZDO","XN--MGBCPQ6GPA1A","XN--MGBERP4A5D4AR","XN--MGBGU82A","XN--MGBI4ECEXP","XN--MGBPL2FH","XN--MGBT3DHD","XN--MGBTX2B","XN--MGBX4CD0AB","XN--MIX891F","XN--MK1BU44C","XN--MXTQ1M","XN--NGBC5AZD","XN--NGBE9E0A","XN--NGBRX","XN--NODE","XN--NQV7F","XN--NQV7FS00EMA","XN--NYQY26A","XN--O3CW4H","XN--OGBPF8FL","XN--OTU796D","XN--P1ACF","XN--P1AI","XN--PGBS0DH","XN--PSSY2U","XN--Q7CE6A","XN--Q9JYB4C","XN--QCKA1PMC","XN--QXA6A","XN--QXAM","XN--RHQV96G","XN--ROVU88B","XN--RVC1E0AM3E","XN--S9BRJ9C","XN--SES554G","XN--T60B56A","XN--TCKWE","XN--TIQ49XQYJ","XN--UNUP4Y","XN--VERMGENSBERATER-CTB","XN--VERMGENSBERATUNG-PWB","XN--VHQUV","XN--VUQ861B","XN--W4R85EL8FHU5DNRA","XN--W4RS40L","XN--WGBH1C","XN--WGBL6A","XN--XHQ521B","XN--XKC2AL3HYE2A","XN--XKC2DL3A5EE0H","XN--Y9A3AQ","XN--YFRO4I67O","XN--YGBI2AMMX","XN--ZFR164B","XXX","XYZ","YACHTS","YAHOO","YAMAXUN","YANDEX","YE","YODOBASHI","YOGA","YOKOHAMA","YOU","YOUTUBE","YT","YUN","ZA","ZAPPOS","ZARA","ZERO","ZIP","ZM","ZONE","ZUERICH","ZW"]};e.exports=new Set(r.tlds.map(e=>e.toLowerCase()))},function(e,t,n){"use strict";const r=n(16),o=n(79),i={};i.Map=class extends Map{slice(){return new i.Map(this)}},e.exports=o.extend({type:"symbol",terms:{map:{init:new i.Map}},coerce:{method(e,{schema:t,error:n}){const r=t.$_terms.map.get(e);return r&&(e=r),t._flags.only&&"symbol"!=typeof e?{value:e,errors:n("symbol.map",{map:t.$_terms.map})}:{value:e}}},validate(e,{error:t}){if("symbol"!=typeof e)return{value:e,errors:t("symbol.base")}},rules:{map:{method(e){e&&!e[Symbol.iterator]&&"object"==typeof e&&(e=Object.entries(e)),r(e&&e[Symbol.iterator],"Iterable must be an iterable or object");const t=this.clone(),n=[];for(const o of e){r(o&&o[Symbol.iterator],"Entry must be an iterable");const[e,i]=o;r("object"!=typeof e&&"function"!=typeof e&&"symbol"!=typeof e,"Key must not be of type object, function, or Symbol"),r("symbol"==typeof i,"Value must be a Symbol"),t.$_terms.map.set(e,i),n.push(i)}return t.valid(...n)}}},manifest:{build:(e,t)=>(t.map&&(e=e.map(t.map)),e)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},function(e,t,n){"use strict";const r=n(16),o=n(79),i=n(22);e.exports=o.extend({type:"binary",coerce:{from:"string",method(e,{schema:t}){try{return{value:Buffer.from(e,t._flags.encoding)}}catch(e){}}},validate(e,{error:t}){if(!Buffer.isBuffer(e))return{value:e,errors:t("binary.base")}},rules:{encoding:{method(e){return r(Buffer.isEncoding(e),"Invalid encoding:",e),this.$_setFlag("encoding",e)}},length:{method(e){return this.$_addRule({name:"length",method:"length",args:{limit:e},operator:"="})},validate:(e,t,{limit:n},{name:r,operator:o,args:a})=>i.compare(e.length,n,o)?e:t.error("binary."+r,{limit:a.limit,value:e}),args:[{name:"limit",ref:!0,assert:i.limit,message:"must be a positive integer"}]},max:{method(e){return this.$_addRule({name:"max",method:"length",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"length",args:{limit:e},operator:">="})}}},cast:{string:{from:e=>Buffer.isBuffer(e),to:(e,t)=>e.toString()}},messages:{"binary.base":"{{#label}} must be a buffer or a string","binary.length":"{{#label}} must be {{#limit}} bytes","binary.max":"{{#label}} must be less than or equal to {{#limit}} bytes","binary.min":"{{#label}} must be at least {{#limit}} bytes"}})},function(e,t,n){const{toHex:r}=n(21),{Hasher:o}=n(28),i=e=>{if(e){const t=function(e){const t=e.replace("#",""),n=parseInt(t.slice(0,2),16)/255,r=parseInt(t.slice(2,4),16)/255,o=parseInt(t.slice(4,6),16)/255,i=Math.max(n,r,o),a=Math.min(n,r,o);let s,l;const u=(i+a)/2;if(i===a)s=0,l=0;else{const e=i-a;switch(l=u>.5?e/(2-i-a):e/(i+a),i){case n:s=(r-o)/e+(r<o?6:0);break;case r:s=(o-n)/e+2;break;case o:s=(n-r)/e+4}s/=6}return[s,l,u]}(e),n=[t[0]];t[1]>.7?n.push(.7):n.push(t[1]),t[2]>.6?n.push(.6):t[2]<.3?n.push(.3):n.push(t[2]);const r=[n[0],n[1],n[2]-.1],o=s(...n);return{startColor:s(...r),endColor:o}}return{startColor:"#2B3845",endColor:"#5A7A8A"}};function a(e){return"#"+r(o.SHA3.hash224(e)).slice(-6)}function s(e,t,n){let r,o,i;if(0===t)r=n,o=n,i=n;else{const a=(e,t,n)=>{let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e},s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;r=a(l,s,e+1/3),o=a(l,s,e),i=a(l,s,e-1/3)}return"#"+[Math.round(255*r),Math.round(255*o),Math.round(255*i)].map(e=>e.toString(16).padStart(2,0)).join("")}e.exports={getNftBGColor:i,getNftBGColorFromDid:function(e){return i(a(e))},DEFAULT_COLOR:{startColor:"#2B3845",endColor:"#5A7A8A"},getPassportColorFromDid:a}},function(e,t,n){const r=n(1354);e.exports={createRoutes:r}},function(e,t,n){const r=n(251),o=n(1355),i=n(700),a=r.Router();e.exports=e=>(i.init(e),a.use(o),a)},function(e,t,n){const r=n(251),o=n(1356),i=n(700),a=r.Router();a.get("/.well-known/acme-challenge/:token",async(e,t)=>{const n=await i.httpChallenge.findOne({key:e.params.token});return o.debug("acme challenge",{token:e.params.token,challenge:n}),n?t.send(n.value):t.status(404).send()}),e.exports=a},function(e,t,n){e.exports=n(40)(n(1357).name)},function(e){e.exports=JSON.parse('{"name":"@abtnode/certificate-manager","version":"1.7.22","description":"Manage ABT Node SSL certificates","author":"polunzh <polunzh@gmail.com>","homepage":"https://github.com/ArcBlock/blocklet-server#readme","license":"Apache-2.0","main":"lib/certificate-manager.js","publishConfig":{"access":"public"},"files":["libs","routes","sdk","states","validators","index.js","README.md"],"repository":{"type":"git","url":"git+https://github.com/ArcBlock/blocklet-server.git"},"scripts":{"lint":"eslint libs routes sdk states validators index.js","lint:fix":"npm run lint -- --fix","test":"node tools/jest.js","coverage":"npm run test -- --coverage"},"bugs":{"url":"https://github.com/ArcBlock/blocklet-server/issues"},"dependencies":{"@abtnode/cron":"1.7.22","@abtnode/db":"1.7.22","@abtnode/logger":"1.7.22","@abtnode/queue":"1.7.22","@abtnode/util":"1.7.22","@fidm/x509":"^1.2.1","@greenlock/manager":"^3.1.0","@nedb/core":"^1.1.0","@nedb/multi":"^1.2.2","@root/acme":"^3.1.0","@root/csr":"^0.8.1","@root/keypairs":"^0.10.1","@root/pem":"^1.0.4","acme-http-01-webroot":"^3.0.0","axios":"^0.27.2","debug":"^4.3.3","express":"^4.17.1","joi":"^17.6.0","lodash.get":"^4.4.2","moment":"^2.29.1","parse-domain":"^3.0.3","punycode":"^2.1.1","ursa-optional":"^0.10.2"},"gitHead":"6190972e62b5e6b1039aa71a291b3e2c521df367"}')},function(e,t){function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}e.exports=e=>{const t={};return new Proxy({},{get(r,o){if("init"===o)return(...r)=>n(t,e(...r));if(t[o])return t[o];throw new Error(`State ${String(o)} may not be initialized`)}})}},function(e,t,n){const r=n(349);e.exports=class extends r{constructor(e){super(e,{filename:"account.db"})}}},function(e,t,n){function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const a=n(17),s=n(9),l=n(8),u=n(1361),{EventEmitter:p}=n(24),c=n(1362).name,d=n(701)(Number(process.env.NEDB_MULTI_PORT)),f=n(40)(c);class h extends p{constructor(e,t){super();const n=t.db||{};this.filename=s.join(e,t.filename),this.options=Object.freeze(u(t)),this.db=new d(o({filename:this.filename,timestampData:!0},n)),f.info("initialized",{filename:this.filename}),this.ready=!1,this.readyCallbacks=[],this.db.loadDatabase(e=>{e?(f.error("failed to load disk database "+this.filename,{error:e}),console.error(e)):(this.ready=!0,this.readyCallbacks.length&&this.readyCallbacks.forEach(e=>e()))}),this.asyncDB=new Proxy(this.db,{get:(e,t)=>"function"==typeof e[t]?l.promisify((...n)=>{const r=n[n.length-1],o=n.slice(0,n.length-1);e[t](...o,(e,...t)=>e?r(e):1===t.length?r(null,t[0]):r(null,t))}).bind(e):e[t]})}onReady(e){this.ready?e():this.readyCallbacks.push(e)}paginate(e,t,n){const{pageSize:r=20,page:o=1}=n||{},i=Math.min(100,r);return new Promise((n,r)=>{this.db.find(e).sort(t).exec((e,t)=>{if(e)return r(e);const a=Math.ceil(t.length/i),s=t.length,l=(o-1)*i,u=t.slice(l,l+i);return u.forEach(e=>{e.id=e._id}),n({list:u,paging:{total:s,pageSize:i,pageCount:a,page:o}})})})}async updateById(e,t,n={}){const[,r]=await this.asyncDB.update({_id:e},t,o({multi:!1,upsert:!1,returnUpdatedDocs:!0},n));return r}update(...e){if(0===e.length)throw new Error("param is required by update method");return"string"==typeof e[0]?this.updateById(...e):this.asyncDB.update(e[0],e[1],o({returnUpdatedDocs:!0},e[2]||{}))}count(e={}){return new Promise((t,n)=>{this.db.count(e,(e,r)=>e?n(e):t(r))})}remove(e={},t={multi:!1}){return new Promise((n,r)=>{this.db.remove(e,t,(e,t)=>e?r(e):n(t))})}reset(){a.unlinkSync(this.filename)}find(...e){return 0===e.length?this.asyncDB.find({}):this.asyncDB.find(...e)}findOne(...e){return 0===e.length?this.asyncDB.findOne({}):this.asyncDB.findOne(...e)}insert(...e){return this.asyncDB.insert(...e)}compactDatafile(){this.db.persistence.compactDatafile(e=>{e&&console.error("failed to compact datafile: "+this.filename,e)})}}h.renameIdFiledName=(e,t="_id",n="id")=>{if(!e)return e;const r=e=>{e[t]&&(e[n]=e[t],delete e[t])};return Array.isArray(e)?(e.forEach(r),e):(r(e),e)},e.exports=h},function(e,t,n){(function(e){var n="[object Arguments]",r="[object Function]",o="[object GeneratorFunction]",i="[object Map]",a="[object Set]",s=/\w*$/,l=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,p={};p[n]=p["[object Array]"]=p["[object ArrayBuffer]"]=p["[object DataView]"]=p["[object Boolean]"]=p["[object Date]"]=p["[object Float32Array]"]=p["[object Float64Array]"]=p["[object Int8Array]"]=p["[object Int16Array]"]=p["[object Int32Array]"]=p[i]=p["[object Number]"]=p["[object Object]"]=p["[object RegExp]"]=p[a]=p["[object String]"]=p["[object Symbol]"]=p["[object Uint8Array]"]=p["[object Uint8ClampedArray]"]=p["[object Uint16Array]"]=p["[object Uint32Array]"]=!0,p["[object Error]"]=p[r]=p["[object WeakMap]"]=!1;var c="object"==typeof global&&global&&global.Object===Object&&global,d="object"==typeof self&&self&&self.Object===Object&&self,f=c||d||Function("return this")(),h=t&&!t.nodeType&&t,g=h&&"object"==typeof e&&e&&!e.nodeType&&e,m=g&&g.exports===h;function y(e,t){return e.set(t[0],t[1]),e}function v(e,t){return e.add(t),e}function b(e,t,n,r){var o=-1,i=e?e.length:0;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function _(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function T(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function E(e,t){return function(n){return e(t(n))}}function S(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var x,w=Array.prototype,A=Function.prototype,k=Object.prototype,M=f["__core-js_shared__"],O=(x=/[^.]+$/.exec(M&&M.keys&&M.keys.IE_PROTO||""))?"Symbol(src)_1."+x:"",D=A.toString,I=k.hasOwnProperty,R=k.toString,N=RegExp("^"+D.call(I).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=m?f.Buffer:void 0,F=f.Symbol,L=f.Uint8Array,j=E(Object.getPrototypeOf,Object),B=Object.create,P=k.propertyIsEnumerable,H=w.splice,U=Object.getOwnPropertySymbols,$=C?C.isBuffer:void 0,W=E(Object.keys,Object),V=ge(f,"DataView"),Y=ge(f,"Map"),z=ge(f,"Promise"),G=ge(f,"Set"),q=ge(f,"WeakMap"),K=ge(Object,"create"),J=_e(V),X=_e(Y),Q=_e(z),Z=_e(G),ee=_e(q),te=F?F.prototype:void 0,ne=te?te.valueOf:void 0;function re(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function oe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ie(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ae(e){this.__data__=new oe(e)}function se(e,t){var r=Ee(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Se(e)}(e)&&I.call(e,"callee")&&(!P.call(e,"callee")||R.call(e)==n)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],o=r.length,i=!!o;for(var a in e)!t&&!I.call(e,a)||i&&("length"==a||ve(a,o))||r.push(a);return r}function le(e,t,n){var r=e[t];I.call(e,t)&&Te(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function ue(e,t){for(var n=e.length;n--;)if(Te(e[n][0],t))return n;return-1}function pe(e,t,l,u,c,d,f){var h;if(u&&(h=d?u(e,c,d,f):u(e)),void 0!==h)return h;if(!Ae(e))return e;var g=Ee(e);if(g){if(h=function(e){var t=e.length,n=e.constructor(t);t&&"string"==typeof e[0]&&I.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!t)return function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(e,h)}else{var m=ye(e),E=m==r||m==o;if(xe(e))return function(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}(e,t);if("[object Object]"==m||m==n||E&&!d){if(_(e))return d?e:{};if(h=function(e){return"function"!=typeof e.constructor||be(e)?{}:function(e){return Ae(e)?B(e):{}}(j(e))}(E?{}:e),!t)return function(e,t){return fe(e,me(e),t)}(e,function(e,t){return e&&fe(t,ke(t),e)}(h,e))}else{if(!p[m])return d?e:{};h=function(e,t,n,r){var o=e.constructor;switch(t){case"[object ArrayBuffer]":return de(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return function(e,t){var n=t?de(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,t){var n=t?de(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,r);case i:return function(e,t,n){return b(t?n(T(e),!0):T(e),y,new e.constructor)}(e,r,n);case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return function(e){var t=new e.constructor(e.source,s.exec(e));return t.lastIndex=e.lastIndex,t}(e);case a:return function(e,t,n){return b(t?n(S(e),!0):S(e),v,new e.constructor)}(e,r,n);case"[object Symbol]":return l=e,ne?Object(ne.call(l)):{}}var l}(e,m,pe,t)}}f||(f=new ae);var x=f.get(e);if(x)return x;if(f.set(e,h),!g)var w=l?function(e){return function(e,t,n){var r=t(e);return Ee(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,ke,me)}(e):ke(e);return function(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n,e););}(w||e,(function(n,r){w&&(n=e[r=n]),le(h,r,pe(n,t,l,u,r,e,f))})),h}function ce(e){return!(!Ae(e)||(t=e,O&&O in t))&&(we(e)||_(e)?N:l).test(_e(e));var t}function de(e){var t=new e.constructor(e.byteLength);return new L(t).set(new L(e)),t}function fe(e,t,n,r){n||(n={});for(var o=-1,i=t.length;++o<i;){var a=t[o],s=r?r(n[a],e[a],a,n,e):void 0;le(n,a,void 0===s?e[a]:s)}return n}function he(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function ge(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ce(n)?n:void 0}re.prototype.clear=function(){this.__data__=K?K(null):{}},re.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},re.prototype.get=function(e){var t=this.__data__;if(K){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return I.call(t,e)?t[e]:void 0},re.prototype.has=function(e){var t=this.__data__;return K?void 0!==t[e]:I.call(t,e)},re.prototype.set=function(e,t){return this.__data__[e]=K&&void 0===t?"__lodash_hash_undefined__":t,this},oe.prototype.clear=function(){this.__data__=[]},oe.prototype.delete=function(e){var t=this.__data__,n=ue(t,e);return!(n<0)&&(n==t.length-1?t.pop():H.call(t,n,1),!0)},oe.prototype.get=function(e){var t=this.__data__,n=ue(t,e);return n<0?void 0:t[n][1]},oe.prototype.has=function(e){return ue(this.__data__,e)>-1},oe.prototype.set=function(e,t){var n=this.__data__,r=ue(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},ie.prototype.clear=function(){this.__data__={hash:new re,map:new(Y||oe),string:new re}},ie.prototype.delete=function(e){return he(this,e).delete(e)},ie.prototype.get=function(e){return he(this,e).get(e)},ie.prototype.has=function(e){return he(this,e).has(e)},ie.prototype.set=function(e,t){return he(this,e).set(e,t),this},ae.prototype.clear=function(){this.__data__=new oe},ae.prototype.delete=function(e){return this.__data__.delete(e)},ae.prototype.get=function(e){return this.__data__.get(e)},ae.prototype.has=function(e){return this.__data__.has(e)},ae.prototype.set=function(e,t){var n=this.__data__;if(n instanceof oe){var r=n.__data__;if(!Y||r.length<199)return r.push([e,t]),this;n=this.__data__=new ie(r)}return n.set(e,t),this};var me=U?E(U,Object):function(){return[]},ye=function(e){return R.call(e)};function ve(e,t){return!!(t=null==t?9007199254740991:t)&&("number"==typeof e||u.test(e))&&e>-1&&e%1==0&&e<t}function be(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||k)}function _e(e){if(null!=e){try{return D.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Te(e,t){return e===t||e!=e&&t!=t}(V&&"[object DataView]"!=ye(new V(new ArrayBuffer(1)))||Y&&ye(new Y)!=i||z&&"[object Promise]"!=ye(z.resolve())||G&&ye(new G)!=a||q&&"[object WeakMap]"!=ye(new q))&&(ye=function(e){var t=R.call(e),n="[object Object]"==t?e.constructor:void 0,r=n?_e(n):void 0;if(r)switch(r){case J:return"[object DataView]";case X:return i;case Q:return"[object Promise]";case Z:return a;case ee:return"[object WeakMap]"}return t});var Ee=Array.isArray;function Se(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}(e.length)&&!we(e)}var xe=$||function(){return!1};function we(e){var t=Ae(e)?R.call(e):"";return t==r||t==o}function Ae(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ke(e){return Se(e)?se(e):function(e){if(!be(e))return W(e);var t=[];for(var n in Object(e))I.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return pe(e,!0,!0)}}).call(this,n(95)(e))},function(e){e.exports=JSON.parse('{"name":"@abtnode/db","version":"1.7.22","description":"@nedb/core wrapper","author":"polunzh <polunzh@gmail.com>","homepage":"https://github.com/ArcBlock/blocklet-server#readme","license":"MIT","main":"lib/db.js","directories":{"lib":"lib"},"files":["lib"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/ArcBlock/blocklet-server.git"},"scripts":{"lint":"eslint tests lib","lint:fix":"eslint --fix tests lib","test":"node tools/jest.js","coverage":"npm run test -- --coverage"},"bugs":{"url":"https://github.com/ArcBlock/blocklet-server/issues"},"dependencies":{"@abtnode/logger":"1.7.22","@nedb/core":"^1.2.2","@nedb/multi":"^1.2.2","lodash.clonedeep":"^4.5.0"},"devDependencies":{"jest":"^27.4.5"},"gitHead":"6190972e62b5e6b1039aa71a291b3e2c521df367"}')},function(e,t,n){const r=n(1364),o=n(351),i=n(1367);t.create=function(e){class t{constructor(t){this.options=t,this.persistence=new i(e,t)}}for(const{name:n,supportsCursor:i}of o.METHODS_DESCRIPTIONS)t.prototype[n]=r.create(e,n,i);return t}},function(e,t,n){const r=n(350),o=n(702),i=n(1366);t.create=function(e,t,n){return function(...a){return n&&!o.endsWithCallback(a)?new i(e,this.options,a):r(e,this.options,t,a)}}},function(e,t,n){"use strict";var r={recursive:!0,inherited:!0,stack:!1,private:!1,exclude:[],include:[]};t.setDefaults=function(e){for(var t in e)r[t]=e[t]};var o={};function i(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}t.register=function(e,t){t=t||{};var n="Error"!==e.prototype.name?e.prototype.name:null,r=t.name||n||e.name||(new e).name;o[r]={constructor:e,options:t}},t.registerAll=function(e,n){e.forEach((function(e){t.register(e,n)}))},t.registerObject=function(e,n){for(var r in e)if(e.hasOwnProperty(r)){var o=e[r],a=i(n);a.name=r,t.register(o,a)}},t.registerAll([Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError]),t.toObject=function(e,n){n=n||{},o[e.name]||(n.name=e.name,t.register(e.constructor,n));var i=o[e.name].options,a={};for(var s in r)n.hasOwnProperty(s)?a[s]=n[s]:i.hasOwnProperty(s)?a[s]=i[s]:a[s]=r[s];var l={name:e.name,message:e.message};for(var u in a.stack&&(l.stack=e.stack),e){if(-1===a.include.indexOf(u)){if("function"==typeof e[u])continue;if(-1!==a.exclude.indexOf(u))continue;if(!a.inherited&&!e.hasOwnProperty(u))continue;if(!a.stack&&"stack"===u)continue;if(!a.private&&("_"===u[0]||"_"===u[u.length-1]))continue}var p=e[u];"object"==typeof p&&p&&p.name&&p.message?a.recursive&&(l[u]=t.toObject(p,n)):l[u]=p}return l},t.fromObject=function(e,n){n=n||{};var i=o[e.name];i||(i=o.Error);var a=i.constructor,s=i.options,l={};for(var u in r)n.hasOwnProperty(u)?l[u]=n[u]:s.hasOwnProperty(u)?l[u]=s[u]:l[u]=r[u];var p=Object.create(a.prototype);for(var c in e){if(l.recursive&&"object"==typeof e[c]){var d=e[c];if(d&&d.name&&d.message){p[c]=t.fromObject(d,n);continue}}p[c]=e[c]}return!p.stack&&Error.captureStackTrace&&Error.captureStackTrace(p,t.fromObject),p},t.stringify=function(e,n){return JSON.stringify(t.toObject(e,n))},t.parse=function(e,n){return t.fromObject(JSON.parse(e),n)}},function(e,t,n){const r=n(350),o=n(351);e.exports=class{constructor(e,t,n){this.findArgs=n,this.options=t,this.socket=e}sort(e){return this.sort=e,this}skip(e){return this.skip=e,this}limit(e){return this.limit=e,this}projection(e){return this.projection=e,this}toJSON(){return{skip:this.skip,sort:this.sort,limit:this.limit,projection:this.projection,findArgs:this.findArgs}}exec(e){r(this.socket,this.options,o.EXECUTE_CURSOR_PRIVATE,[this,e])}}},function(e,t,n){const r=n(350),o=n(351);e.exports=class{constructor(e,t){this.socket=e,this.options=t}setAutocompactionInterval(e){r(this.socket,this.options,o.PERSISTENCE_SET_AUTOCOMPACTION_INTERVAL,[e])}stopAutocompaction(){r(this.socket,this.options,o.PERSISTENCE_STOP_AUTOCOMPACTION)}compactDatafile(){r(this.socket,this.options,o.PERSISTENCE_COMPACT_DATAFILE)}}},function(e,t,n){const r=n(319),{CERT_STATUS:o}=n(1369),i=n(349),{getCertInfo:a}=n(1370);e.exports=class extends i{constructor(e){super(e,{filename:"certificate.db"})}async updateStatus(e,t){if(!Object.values(o).includes(t))throw new Error("invalid domain status");return super.update({domain:e},{$set:{status:t}})}insert(e){return e.certificate&&(e.meta=a(e.certificate)),super.insert(e)}async update(e,t,n){return t.certificate?t.meta=a(t.certificate):r(t,"$set.certificate")&&(t.$set.meta=a(r(t,"$set.certificate"))),super.update(e,t,n)}}},function(e,t){e.exports=Object.freeze({CERT_STATUS:{waiting:"waiting",creating:"creating",generated:"generated",renewaling:"renewaling",error:"error"},CERT_SOURCE:{letsEncrypt:"lets_encrypt",upload:"upload"}})},function(e,t,n){const r=n(20),o=n(17),i=n(319),{Certificate:a,PrivateKey:s}=n(1371),l=(e,t)=>r.createHash(t).update(e).digest("hex").match(/.{2}/g).join(":").toUpperCase();e.exports={ensureDir:e=>(o.existsSync(e)||o.mkdirSync(e,{recursive:!0}),e),getFingerprint:l,validateCertificate:(e,t)=>{const n=a.fromPEM(e.certificate),r=s.fromPEM(e.privateKey),o=Buffer.allocUnsafe(100),l=r.sign(o,"sha512");if(!n.publicKey.verify(o,l,"sha512"))throw new Error("Invalid certificate: signature verify failed");const u=i(n,"subject.commonName","");if(t&&t!==u)throw new Error("Invalid certificate: domain does not match");const p=i(n,"validFrom","");if(!p||new Date(p).getTime()>Date.now())throw new Error("Invalid certificate: not in valid period");const c=i(n,"validTo","");if(!c||new Date(c).getTime()<Date.now())throw new Error("Invalid certificate: not in valid period");return n},getCertInfo:e=>{const t=a.fromPEM(e);return{validFrom:t.validFrom.valueOf(),validTo:t.validTo.valueOf(),issuer:{countryName:t.issuer.countryName.valueOf(),organizationName:t.issuer.organizationName.valueOf(),commonName:t.issuer.commonName.valueOf()},sans:t.dnsNames,validityPeriod:t.validTo-t.validFrom,fingerprintAlg:"SHA256",fingerprint:l(t.raw,"sha256")}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(352);t.bytesFromIP=r.bytesFromIP,t.bytesToIP=r.bytesToIP,t.getOID=r.getOID,t.getOIDName=r.getOIDName;var o=n(703);t.PublicKey=o.PublicKey,t.PrivateKey=o.PrivateKey,t.RSAPublicKey=o.RSAPublicKey,t.RSAPrivateKey=o.RSAPrivateKey;var i=n(1374);t.Certificate=i.Certificate,t.DistinguishedName=i.DistinguishedName},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8);class o{static parse(e){const t=[],n=e.toString("utf8").split("\n").map(e=>e.trim()).filter(e=>""!==e&&!e.startsWith("#"));for(;n.length>0;)t.push(i(n));if(0===t.length)throw new Error("PEM: no block");return t}constructor(e,t){this.type=e,this.body=t,this.headers=Object.create(null)}get procType(){return this.getHeader("Proc-Type")}getHeader(e){const t=this.headers[e];return null==t?"":t}setHeader(e,t){if(e.includes(":"))throw new Error("pem: cannot encode a header key that contains a colon");if(""===e||""===t)throw new Error("pem: invalid header key or value");this.headers[e]=t}toString(){let e="-----BEGIN "+this.type+"-----\n";const t=Object.keys(this.headers);if(t.length>0){const n=this.procType;""!==n&&(e+=`Proc-Type: ${n}\n`),t.sort();for(const n of t)"Proc-Type"!==n&&(e+=`${n}: ${this.headers[n]}\n`);e+="\n"}const n=this.body.toString("base64");let r=0;for(;r<n.length;)e+=n.slice(r,r+64)+"\n",r+=64;return e+="-----END "+this.type+"-----\n",e}toBuffer(){return Buffer.from(this.toString(),"utf8")}valueOf(){return this.body}toJSON(){return{type:this.type,body:this.body,headers:this.headers}}[r.inspect.custom](e,t){return`<${this.constructor.name} ${r.inspect(this.toJSON(),t)}>`}}function i(e){let t=e.shift();if(null==t||!t.startsWith("-----BEGIN ")||!t.endsWith("-----"))throw new Error("pem: invalid BEGIN line");const n=t.slice("-----BEGIN ".length,t.length-"-----".length);if(""===n)throw new Error("pem: invalid type");const r=[];for(t=e.shift();null!=t&&t.includes(": ");){const n=t.split(": ");if(2!==n.length||""===n[0]||""===n[1])throw new Error("pem: invalid Header line");r.push(n),t=e.shift()}let i="";for(;null!=t&&!t.startsWith("-----END ");)i+=t,t=e.shift();if(null==t||t!==`-----END ${n}-----`)throw new Error("pem: invalid END line");const a=new o(n,Buffer.from(i,"base64"));if(""===i||a.body.toString("base64")!==i)throw new Error("pem: invalid base64 body");for(const e of r)a.setHeader(e[0],e[1]);return a}t.PEM=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8),o=n(705);var i,a;!function(e){e[e.UNIVERSAL=0]="UNIVERSAL",e[e.APPLICATION=64]="APPLICATION",e[e.CONTEXT_SPECIFIC=128]="CONTEXT_SPECIFIC",e[e.PRIVATE=192]="PRIVATE"}(i=t.Class||(t.Class={})),function(e){e[e.NONE=0]="NONE",e[e.BOOLEAN=1]="BOOLEAN",e[e.INTEGER=2]="INTEGER",e[e.BITSTRING=3]="BITSTRING",e[e.OCTETSTRING=4]="OCTETSTRING",e[e.NULL=5]="NULL",e[e.OID=6]="OID",e[e.ENUMERATED=10]="ENUMERATED",e[e.UTF8=12]="UTF8",e[e.SEQUENCE=16]="SEQUENCE",e[e.SET=17]="SET",e[e.NUMERICSTRING=18]="NUMERICSTRING",e[e.PRINTABLESTRING=19]="PRINTABLESTRING",e[e.T61STRING=20]="T61STRING",e[e.IA5STRING=22]="IA5STRING",e[e.UTCTIME=23]="UTCTIME",e[e.GENERALIZEDTIME=24]="GENERALIZEDTIME",e[e.GENERALSTRING=27]="GENERALSTRING"}(a=t.Tag||(t.Tag={}));class s{constructor(e,t){this.buf=e,this.bitLen=t}at(e){if(e<0||e>=this.bitLen||!Number.isInteger(e))return 0;const t=Math.floor(e/8),n=7-e%8;return this.buf[t]>>n&1}rightAlign(){const e=8-this.bitLen%8;if(8===e||0===this.buf.length)return this.buf;const t=Buffer.alloc(this.buf.length);t[0]=this.buf[0]>>e;for(let n=1;n<this.buf.length;n++)t[n]=this.buf[n-1]<<8-e,t[n]|=this.buf[n]>>e;return t}}t.BitString=s;class l{static Bool(e){const t=new l(i.UNIVERSAL,a.BOOLEAN,Buffer.from([e?255:0]));return t._value=e,t}static parseBool(e){if(!(e instanceof Buffer)||1!==e.length)throw new Error("ASN1 syntax error: invalid boolean");switch(e[0]){case 0:return!1;case 255:return!0;default:throw new Error("ASN1 syntax error: invalid boolean")}}static Integer(e){if(e instanceof Buffer){const t=new l(i.UNIVERSAL,a.INTEGER,e);return t._value=e.toString("hex"),t}if(!Number.isSafeInteger(e))throw new Error("ASN1 syntax error: invalid integer");let t;if(e>=-128&&e<128)t=Buffer.alloc(1),t.writeInt8(e,0);else if(e>=-32768&&e<32768)t=Buffer.alloc(2),t.writeIntBE(e,0,2);else if(e>=-8388608&&e<8388608)t=Buffer.alloc(3),t.writeIntBE(e,0,3);else if(e>=-2147483648&&e<2147483648)t=Buffer.alloc(4),t.writeIntBE(e,0,4);else if(e>=-549755813888&&e<549755813888)t=Buffer.alloc(5),t.writeIntBE(e,0,5);else{if(!(e>=-0x800000000000&&e<0x800000000000))throw new Error("ASN1 syntax error: invalid Integer");t=Buffer.alloc(6),t.writeIntBE(e,0,6)}const n=new l(i.UNIVERSAL,a.INTEGER,t);return n._value=e,n}static parseInteger(e){if(!(e instanceof Buffer)||0===e.length)throw new Error("ASN1 syntax error: invalid Integer");return e.length>6?e.toString("hex"):e.readIntBE(0,e.length)}static parseIntegerNum(e){const t=l.parseInteger(e);if("number"!=typeof t)throw new Error("ASN1 syntax error: invalid Integer number");return t}static parseIntegerStr(e){const t=l.parseInteger(e);return"number"==typeof t?t.toString(16):t}static BitString(e){e instanceof Buffer&&(e=new s(e,8*e.length));const t=8*e.buf.length-e.bitLen,n=Buffer.alloc(e.buf.length+1);return n.writeInt8(t,0),e.buf.copy(n,1),new l(i.UNIVERSAL,a.BITSTRING,n)}static parseBitString(e){if(!(e instanceof Buffer)||0===e.length)throw new Error("ASN1 syntax error: invalid BitString");const t=e[0];if(t>7||1===e.length&&t>0||0!=(e[e.length-1]&(1<<e[0])-1))throw new Error("ASN1 syntax error: invalid padding bits in BIT STRING");return new s(e.slice(1),8*(e.length-1)-t)}static Null(){const e=new l(i.UNIVERSAL,a.NULL,Buffer.alloc(0));return e._value=null,e}static parseNull(e){if(!(e instanceof Buffer)||0!==e.length)throw new Error("ASN1 syntax error: invalid null");return null}static OID(e){const t=e.split(".");if(0===t.length)throw new Error("ASN1 syntax error: invalid Object Identifier");const n=[];n.push(40*c(t[0])+c(t[1]));const r=[];for(let e=2;e<t.length;++e){let o=c(t[e]);for(r.length=0,r.push(127&o);o>127;)o>>>=7,r.unshift(127&o|128);n.push(...r)}const o=new l(i.UNIVERSAL,a.OID,Buffer.from(n));return o._value=e,o}static parseOID(e){if(!(e instanceof Buffer)||0===e.length)throw new Error("ASN1 syntax error: invalid OID");let t=Math.floor(e[0]/40)+"."+e[0]%40,n=0;for(let r=1;r<e.length;r++)e[r]>=128?(n+=127&e[r],n<<=7):(t+="."+(n+e[r]),n=0);return t}static UTF8(e){const t=new l(i.UNIVERSAL,a.UTF8,Buffer.from(e,"utf8"));return t._value=e,t}static parseUTF8(e){if(!(e instanceof Buffer))throw new Error("parse ASN1 error: invalid Buffer");return e.toString("utf8")}static NumericString(e){if(!u(e))throw new Error("ASN1 syntax error: invalid NumericString");const t=new l(i.UNIVERSAL,a.NUMERICSTRING,Buffer.from(e,"utf8"));return t._value=e,t}static parseNumericString(e){if(!(e instanceof Buffer))throw new Error("parse ASN1 error: invalid Buffer");const t=e.toString("utf8");if(!u(t))throw new Error("ASN1 syntax error: invalid NumericString");return t}static PrintableString(e){const t=new l(i.UNIVERSAL,a.PRINTABLESTRING,Buffer.from(e,"utf8"));return t._value=e,t}static parsePrintableString(e){if(!(e instanceof Buffer))throw new Error("parse ASN1 error: invalid Buffer");return e.toString("utf8")}static IA5String(e){if(!p(e))throw new Error("ASN1 syntax error: invalid IA5String");const t=new l(i.UNIVERSAL,a.IA5STRING,Buffer.from(e,"utf8"));return t._value=e,t}static parseIA5String(e){if(!(e instanceof Buffer))throw new Error("parse ASN1 error: invalid Buffer");const t=e.toString("utf8");if(!p(t))throw new Error("ASN1 syntax error: invalid IA5String");return t}static T61String(e){const t=new l(i.UNIVERSAL,a.T61STRING,Buffer.from(e,"utf8"));return t._value=e,t}static parseT61String(e){if(!(e instanceof Buffer))throw new Error("parse ASN1 error: invalid Buffer");return e.toString("utf8")}static GeneralString(e){const t=new l(i.UNIVERSAL,a.GENERALSTRING,Buffer.from(e,"utf8"));return t._value=e,t}static parseGeneralString(e){if(!(e instanceof Buffer))throw new Error("parse ASN1 error: invalid Buffer");return e.toString("utf8")}static UTCTime(e){let t="";const n=[];n.push((""+e.getUTCFullYear()).substr(2)),n.push(""+(e.getUTCMonth()+1)),n.push(""+e.getUTCDate()),n.push(""+e.getUTCHours()),n.push(""+e.getUTCMinutes()),n.push(""+e.getUTCSeconds());for(const e of n)e.length<2&&(t+="0"),t+=e;t+="Z";const r=new l(i.UNIVERSAL,a.UTCTIME,Buffer.from(t,"utf8"));return r._value=e,r}static parseUTCTime(e){if(!(e instanceof Buffer)||0===e.length)throw new Error("ASN1 syntax error: invalid UTC Time");const t=e.toString("utf8"),n=new Date;let r=c(t.substr(0,2));r=r>=50?1900+r:2e3+r;const o=c(t.substr(2,2))-1,i=c(t.substr(4,2)),a=c(t.substr(6,2)),s=c(t.substr(8,2));let l=0,u=0,p="";if(t.length>11&&(u=10,p=t.charAt(u),"+"!==p&&"-"!==p&&(l=c(t.substr(10,2)),u+=2)),n.setUTCFullYear(r,o,i),n.setUTCHours(a,s,l,0),u>0&&(p=t.charAt(u),"+"===p||"-"===p)){let e=60*c(t.substr(u+1,2))+c(t.substr(u+4,2));e*=6e4,"+"===p?n.setTime(+n-e):n.setTime(+n+e)}return n}static GeneralizedTime(e){let t="";const n=[];n.push(""+e.getUTCFullYear()),n.push(""+(e.getUTCMonth()+1)),n.push(""+e.getUTCDate()),n.push(""+e.getUTCHours()),n.push(""+e.getUTCMinutes()),n.push(""+e.getUTCSeconds());for(const e of n)e.length<2&&(t+="0"),t+=e;t+="Z";const r=new l(i.UNIVERSAL,a.GENERALIZEDTIME,Buffer.from(t,"utf8"));return r._value=e,r}static parseGeneralizedTime(e){if(!(e instanceof Buffer)||0===e.length)throw new Error("ASN1 syntax error: invalid Generalized Time");const t=e.toString("utf8"),n=new Date,r=c(t.substr(0,4)),o=c(t.substr(4,2))-1,i=c(t.substr(6,2)),a=c(t.substr(8,2)),s=c(t.substr(10,2)),l=c(t.substr(12,2));let u=0,p=0,d=!1;"Z"===t.charAt(t.length-1)&&(d=!0);const f=t.length-5,h=t.charAt(f);if("+"===h||"-"===h){p=60*c(t.substr(f+1,2))+c(t.substr(f+4,2)),p*=6e4,"+"===h&&(p*=-1),d=!0}return"."===t.charAt(14)&&(u=1e3*parseFloat(t.substr(14))),d?(n.setUTCFullYear(r,o,i),n.setUTCHours(a,s,l,u),n.setTime(+n+p)):(n.setFullYear(r,o,i),n.setHours(a,s,l,u)),n}static parseTime(e,t){switch(e){case a.UTCTIME:return l.parseUTCTime(t);case a.GENERALIZEDTIME:return l.parseGeneralizedTime(t);default:throw new Error("Invalid ASN1 time tag")}}static Set(e){const t=new l(i.UNIVERSAL,a.SET,Buffer.concat(e.map(e=>e.toDER())));return t._value=e,t}static Seq(e){const t=new l(i.UNIVERSAL,a.SEQUENCE,Buffer.concat(e.map(e=>e.toDER())));return t._value=e,t}static Spec(e,t,n=!0){const r=Array.isArray(t)?Buffer.concat(t.map(e=>e.toDER())):t.toDER();Array.isArray(t)&&(n=!0);const o=new l(i.CONTEXT_SPECIFIC,e,r,n);return o._value=t,o}static fromDER(e,t=!1){return l._fromDER(new o.BufferVisitor(e),t)}static parseDER(e,t,n){const r=l._fromDER(new o.BufferVisitor(e),!1);if(r.class!==t&&r.tag!==n)throw new Error(`invalid ASN.1 DER for class ${t} and tag ${n}`);return r}static parseDERWithTemplate(e,t){const n=l._fromDER(new o.BufferVisitor(e),!0),r={},i=n.validate(t,r);if(null!=i)throw i.data=n,i;return r}static _parseCompound(e,t){const n=[],r=e.length,i=new o.BufferVisitor(e);let a=0;for(;a<r;){const e=i.end;n.push(l._fromDER(i,t)),a+=i.end-e}return n}static _fromDER(e,t){if(!(e.buf instanceof Buffer)||0===e.length)throw new Error("ASN1 syntax error: invalid Generalized Time");e.mustWalk(1,"Too few bytes to read ASN.1 tag.");const n=e.start,r=e.buf[n],o=192&r,i=31&r,s=function(e){e.mustWalk(1,"Too few bytes to read ASN.1 value length.");const t=e.buf[e.start];if(0==(128&t))return t;const n=127&t;return e.mustWalk(n,"Too few bytes to read ASN.1 value length."),e.buf.readUIntBE(e.start,n)}(e);if(e.mustHas(s),0!==s&&i===a.NULL)throw new Error("invalid value length or NULL tag.");e.mustWalk(s);const u=32==(32&r),p=new l(o,i,e.buf.slice(e.start,e.end),u);return u&&t&&(p._value=l._parseCompound(p.bytes,t)),p._der=e.buf.slice(n,e.end),p}constructor(e,t,n,r=!1){this.class=e,this.tag=t,this.bytes=n,this.isCompound=r||t===a.SEQUENCE||t===a.SET,this._value=void 0,this._der=null}get value(){return void 0===this._value&&(this._value=this.valueOf()),this._value}get DER(){return null==this._der&&(this._der=this.toDER()),this._der}mustCompound(e="asn1 object value is not compound"){if(!this.isCompound||!Array.isArray(this.value)){const t=new Error(e);throw t.data=this.toJSON(),t}return this.value}equals(e){return e instanceof l&&(this.class===e.class&&this.tag===e.tag&&this.isCompound===e.isCompound&&!!this.bytes.equals(e.bytes))}toDER(){let e=this.class|this.tag;this.isCompound&&(e|=32);const t=function(e){if(e<=127)return 0;if(e<=255)return 1;if(e<=65535)return 2;if(e<=16777215)return 3;if(e<=4294967295)return 4;if(e<=0xffffffffff)return 5;if(e<=0xffffffffffff)return 6;throw new Error("invalid value length")}(this.bytes.length),n=Buffer.allocUnsafe(2+t+this.bytes.length);return n.writeInt8(e,0),0===t?(n.writeUInt8(this.bytes.length,1),this.bytes.copy(n,2)):(n.writeUInt8(128|t,1),n.writeUIntBE(this.bytes.length,2,t),this.bytes.copy(n,2+t)),n}valueOf(){if(this.isCompound)return l._parseCompound(this.bytes,!1);if(this.class!==i.UNIVERSAL)return this.bytes;switch(this.tag){case a.BOOLEAN:return l.parseBool(this.bytes);case a.INTEGER:return l.parseInteger(this.bytes);case a.BITSTRING:return l.parseBitString(this.bytes);case a.NULL:return l.parseNull(this.bytes);case a.OID:return l.parseOID(this.bytes);case a.UTF8:return l.parseUTF8(this.bytes);case a.NUMERICSTRING:return l.parseNumericString(this.bytes);case a.PRINTABLESTRING:return l.parsePrintableString(this.bytes);case a.T61STRING:return l.parseT61String(this.bytes);case a.IA5STRING:return l.parseIA5String(this.bytes);case a.GENERALSTRING:return l.parseGeneralString(this.bytes);case a.UTCTIME:return l.parseUTCTime(this.bytes);case a.GENERALIZEDTIME:return l.parseGeneralizedTime(this.bytes);default:return this.bytes}}validate(e,t={}){if(this.class!==e.class)return new Error(`ASN.1 object validate failure for ${e.name} : error class ${i[this.class]}`);if(!(Array.isArray(e.tag)?e.tag:[e.tag]).includes(this.tag))return new Error(`ASN.1 object validate failure for ${e.name}: error tag ${a[this.tag]}`);if(null!=e.capture&&(t[e.capture]=this),Array.isArray(e.value)){const n=this.mustCompound(e.name+" need compound ASN1 value");for(let r=0,o=0;r<e.value.length;r++)if(null!=n[o]){const i=n[o].validate(e.value[r],t);if(null==i)o++;else if(!0!==e.value[r].optional)return i}else if(!0!==e.value[r].optional)return new Error(`ASN.1 object validate failure for ${e.value[r].name}: not exists`)}else if(null!=e.value){const n=this.tag===a.BITSTRING?this.bytes.slice(1):this.bytes;return l.fromDER(n).validate(e.value,t)}return null}toJSON(){let e=this.value;return Array.isArray(e)&&(e=e.map(e=>e.toJSON())),{class:i[this.class],tag:this.class===i.UNIVERSAL?a[this.tag]:this.tag,value:e}}[r.inspect.custom](e,t){return t.depth<=2&&(t.depth=10),`<${this.constructor.name} ${r.inspect(this.toJSON(),t)}>`}}function u(e){for(const t of e){const e=t.charCodeAt(0);if(32!==e&&(e<48||e>57))return!1}return!0}function p(e){for(const t of e)if(t.charCodeAt(0)>=128)return!1;return!0}function c(e,t=10){const n=parseInt(e,t);if(Number.isNaN(n))throw new Error(`Invalid numeric string "${e}" in radix ${t}.`);return n}t.ASN1=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8),o=n(20),i=n(704),a=n(352),s=n(703),l=Object.create(null);l.CN=a.getOID("commonName"),l.commonName="CN",l.C=a.getOID("countryName"),l.countryName="C",l.L=a.getOID("localityName"),l.localityName="L",l.ST=a.getOID("stateOrProvinceName"),l.stateOrProvinceName="ST",l.O=a.getOID("organizationName"),l.organizationName="O",l.OU=a.getOID("organizationalUnitName"),l.organizationalUnitName="OU",l.E=a.getOID("emailAddress"),l.emailAddress="E";const u={name:"Certificate",class:i.Class.UNIVERSAL,tag:i.Tag.SEQUENCE,value:[{name:"Certificate.TBSCertificate",class:i.Class.UNIVERSAL,tag:i.Tag.SEQUENCE,capture:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",class:i.Class.CONTEXT_SPECIFIC,tag:i.Tag.NONE,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",class:i.Class.UNIVERSAL,tag:i.Tag.INTEGER,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",class:i.Class.UNIVERSAL,tag:i.Tag.INTEGER,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",class:i.Class.UNIVERSAL,tag:i.Tag.SEQUENCE,value:[{name:"Certificate.TBSCertificate.signature.algorithm",class:i.Class.UNIVERSAL,tag:i.Tag.OID,capture:"certinfoSignatureOID"},{name:"Certificate.TBSCertificate.signature.parameters",class:i.Class.UNIVERSAL,tag:i.Tag.OCTETSTRING,optional:!0,capture:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",class:i.Class.UNIVERSAL,tag:i.Tag.SEQUENCE,capture:"certIssuer"},{name:"Certificate.TBSCertificate.validity",class:i.Class.UNIVERSAL,tag:i.Tag.SEQUENCE,value:[{name:"Certificate.TBSCertificate.validity.notBefore",class:i.Class.UNIVERSAL,tag:[i.Tag.UTCTIME,i.Tag.GENERALIZEDTIME],capture:"certValidityNotBefore"},{name:"Certificate.TBSCertificate.validity.notAfter",class:i.Class.UNIVERSAL,tag:[i.Tag.UTCTIME,i.Tag.GENERALIZEDTIME],capture:"certValidityNotAfter"}]},{name:"Certificate.TBSCertificate.subject",class:i.Class.UNIVERSAL,tag:i.Tag.SEQUENCE,capture:"certSubject"},s.publicKeyValidator,{name:"Certificate.TBSCertificate.issuerUniqueID",class:i.Class.CONTEXT_SPECIFIC,tag:i.Tag.BOOLEAN,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",class:i.Class.UNIVERSAL,tag:i.Tag.BITSTRING,capture:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",class:i.Class.CONTEXT_SPECIFIC,tag:i.Tag.INTEGER,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",class:i.Class.UNIVERSAL,tag:i.Tag.BITSTRING,capture:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",class:i.Class.CONTEXT_SPECIFIC,tag:i.Tag.BITSTRING,capture:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",class:i.Class.UNIVERSAL,tag:i.Tag.SEQUENCE,value:[{name:"Certificate.signatureAlgorithm.algorithm",class:i.Class.UNIVERSAL,tag:i.Tag.OID,capture:"certSignatureOID"},{name:"Certificate.TBSCertificate.signature.parameters",class:i.Class.UNIVERSAL,tag:i.Tag.OCTETSTRING,optional:!0,capture:"certSignatureParams"}]},{name:"Certificate.signatureValue",class:i.Class.UNIVERSAL,tag:i.Tag.BITSTRING,capture:"certSignature"}]};class p{constructor(){this.attributes=[],this.uniqueId=null}get commonName(){return this.getFieldValue("commonName")}get organizationName(){return this.getFieldValue("organizationName")}get organizationalUnitName(){return this.getFieldValue("organizationalUnitName")}get countryName(){return this.getFieldValue("countryName")}get localityName(){return this.getFieldValue("localityName")}get serialName(){return this.getFieldValue("serialName")}getHash(){const e=o.createHash("sha1");for(const t of this.attributes)e.update(t.oid),e.update(t.value);return e.digest()}getField(e){for(const t of this.attributes)if(e===t.oid||e===t.name||e===t.shortName)return t;return null}addField(e){y([e]),this.attributes.push(e)}setAttrs(e){y(e),this.attributes=e}toJSON(){const e={};for(const t of this.attributes){const n=t.shortName;"string"==typeof n&&""!==n&&(e[n]=t.value)}return e.uniqueId=this.uniqueId,e.attributes=this.attributes,e}getFieldValue(e){const t=this.getField(e);return null!=t?t.value:""}}t.DistinguishedName=p;class c{static fromPEMs(e){const t=[],n=i.PEM.parse(e);for(const e of n){if("CERTIFICATE"!==e.type&&"X509 CERTIFICATE"!==e.type&&"TRUSTED CERTIFICATE"!==e.type)throw new Error("Could not convert certificate from PEM: invalid type");if(e.procType.includes("ENCRYPTED"))throw new Error("Could not convert certificate from PEM: PEM is encrypted.");const n=i.ASN1.fromDER(e.body);t.push(new c(n))}if(0===t.length)throw new Error("No Certificate");return t}static fromPEM(e){return c.fromPEMs(e)[0]}constructor(e){const t=Object.create(null),n=e.validate(u,t);if(null!=n)throw new Error("Cannot read X.509 certificate: "+n.message);if(this.raw=e.DER,this.version=null==t.certVersion?0:i.ASN1.parseIntegerNum(t.certVersion.bytes)+1,this.serialNumber=i.ASN1.parseIntegerStr(t.certSerialNumber.bytes),this.signatureOID=i.ASN1.parseOID(t.certSignatureOID.bytes),this.signatureAlgorithm=a.getOIDName(this.signatureOID),this.infoSignatureOID=i.ASN1.parseOID(t.certinfoSignatureOID.bytes),this.signature=i.ASN1.parseBitString(t.certSignature.bytes).buf,this.validFrom=i.ASN1.parseTime(t.certValidityNotBefore.tag,t.certValidityNotBefore.bytes),this.validTo=i.ASN1.parseTime(t.certValidityNotAfter.tag,t.certValidityNotAfter.bytes),this.issuer=new p,this.issuer.setAttrs(v(t.certIssuer)),null!=t.certIssuerUniqueId&&(this.issuer.uniqueId=i.ASN1.parseBitString(t.certIssuerUniqueId.bytes)),this.subject=new p,this.subject.setAttrs(v(t.certSubject)),null!=t.certSubjectUniqueId&&(this.subject.uniqueId=i.ASN1.parseBitString(t.certSubjectUniqueId.bytes)),this.extensions=[],this.subjectKeyIdentifier="",this.authorityKeyIdentifier="",this.ocspServer="",this.issuingCertificateURL="",this.isCA=!1,this.maxPathLen=-1,this.basicConstraintsValid=!1,this.keyUsage=0,this.dnsNames=[],this.emailAddresses=[],this.ipAddresses=[],this.uris=[],null!=t.certExtensions){this.extensions=function(e){const t=[];for(const n of e.mustCompound())for(const e of n.mustCompound())t.push(d(e));return t}(t.certExtensions);for(const e of this.extensions)if("string"==typeof e.subjectKeyIdentifier&&(this.subjectKeyIdentifier=e.subjectKeyIdentifier),"string"==typeof e.authorityKeyIdentifier&&(this.authorityKeyIdentifier=e.authorityKeyIdentifier),"string"==typeof e.authorityInfoAccessOcsp&&(this.ocspServer=e.authorityInfoAccessOcsp),"string"==typeof e.authorityInfoAccessIssuers&&(this.issuingCertificateURL=e.authorityInfoAccessIssuers),"boolean"==typeof e.basicConstraintsValid&&(this.isCA=e.isCA,this.maxPathLen=e.maxPathLen,this.basicConstraintsValid=e.basicConstraintsValid),"number"==typeof e.keyUsage&&(this.keyUsage=e.keyUsage),Array.isArray(e.altNames))for(const t of e.altNames)null!=t.dnsName&&this.dnsNames.push(t.dnsName),null!=t.email&&this.emailAddresses.push(t.email),null!=t.ip&&this.ipAddresses.push(t.ip),null!=t.uri&&this.uris.push(t.uri)}this.publicKey=new s.PublicKey(t.publicKeyInfo),this.publicKeyRaw=this.publicKey.toDER(),this.tbsCertificate=t.tbsCertificate}getExtension(e,t=""){for(const n of this.extensions)if(e===n.oid||e===n.name)return""===t?n:n[t];return null}checkSignature(e){if(3===this.version&&!this.basicConstraintsValid||this.basicConstraintsValid&&!this.isCA)return new Error("The parent constraint violation error");if(!0!==this.getExtension("keyUsage","keyCertSign"))return new Error("The parent constraint violation error");if(!e.isIssuer(this))return new Error("The parent certificate did not issue the given child certificate");const t=function(e){switch(a.getOIDName(e)){case"sha1WithRsaEncryption":return"sha1";case"md5WithRsaEncryption":return"md5";case"sha256WithRsaEncryption":return"sha256";case"sha384WithRsaEncryption":return"sha384";case"sha512WithRsaEncryption":return"sha512";case"RSASSA-PSS":return"sha256";case"ecdsaWithSha1":return"sha1";case"ecdsaWithSha256":return"sha256";case"ecdsaWithSha384":return"sha384";case"ecdsaWithSha512":return"sha512";case"dsaWithSha1":return"sha1";case"dsaWithSha256":return"sha256";default:return""}}(e.signatureOID);if(""===t)return new Error("Unknown child signature OID.");return!1===this.publicKey.verify(e.tbsCertificate.DER,e.signature,t)?new Error("Child signature not matched"):null}isIssuer(e){return this.issuer.getHash().equals(e.subject.getHash())}verifySubjectKeyIdentifier(){return this.publicKey.getFingerprint("sha1","PublicKey").toString("hex")===this.subjectKeyIdentifier}toJSON(){const e={};for(const t of Object.keys(this))e[t]=b(this[t]);return delete e.tbsCertificate,e}[r.inspect.custom](e,t){return t.depth<=2&&(t.depth=10),`<${this.constructor.name} ${r.inspect(this.toJSON(),t)}>`}}function d(e){const t={};switch(t.oid=i.ASN1.parseOID(e.value[0].bytes),t.critical=!1,e.value[1].tag===i.Tag.BOOLEAN?(t.critical=i.ASN1.parseBool(e.value[1].bytes),t.value=e.value[2].bytes):t.value=e.value[1].bytes,t.name=a.getOIDName(t.oid),t.name){case"keyUsage":!function(e){const t=i.ASN1.parseBitString(i.ASN1.fromDER(e.value).bytes);let n=0,r=0;e.keyUsage=0;for(let n=0;n<9;n++)0!==t.at(n)&&(e.keyUsage|=1<<n);t.buf.length>0&&(n=t.buf[0],r=t.buf.length>1?t.buf[1]:0);e.digitalSignature=128==(128&n),e.nonRepudiation=64==(64&n),e.keyEncipherment=32==(32&n),e.dataEncipherment=16==(16&n),e.keyAgreement=8==(8&n),e.keyCertSign=4==(4&n),e.cRLSign=2==(2&n),e.encipherOnly=1==(1&n),e.decipherOnly=128==(128&r)}(t);break;case"basicConstraints":!function(e){const t=i.ASN1.fromDER(e.value).mustCompound();t.length>0&&t[0].tag===i.Tag.BOOLEAN?e.isCA=i.ASN1.parseBool(t[0].bytes):e.isCA=!1;let n=null;t.length>0&&t[0].tag===i.Tag.INTEGER?n=t[0].bytes:t.length>1&&(n=t[1].bytes);e.maxPathLen=null!==n?i.ASN1.parseInteger(n):-1;e.basicConstraintsValid=!0}(t);break;case"extKeyUsage":!function(e){const t=i.ASN1.fromDER(e.value).mustCompound();for(const n of t)e[a.getOIDName(i.ASN1.parseOID(n.bytes))]=!0}(t);break;case"nsCertType":!function(e){const t=i.ASN1.parseBitString(i.ASN1.fromDER(e.value).bytes);let n=0;t.buf.length>0&&(n=t.buf[0]);e.client=128==(128&n),e.server=64==(64&n),e.email=32==(32&n),e.objsign=16==(16&n),e.reserved=8==(8&n),e.sslCA=4==(4&n),e.emailCA=2==(2&n),e.objCA=1==(1&n)}(t);break;case"subjectAltName":case"issuerAltName":f(t);break;case"subjectKeyIdentifier":!function(e){const t=i.ASN1.parseDERWithTemplate(e.value,h);e.subjectKeyIdentifier=t.subjectKeyIdentifier.bytes.toString("hex")}(t);break;case"authorityKeyIdentifier":!function(e){const t=i.ASN1.parseDERWithTemplate(e.value,g);e.authorityKeyIdentifier=t.authorityKeyIdentifier.bytes.toString("hex")}(t);break;case"authorityInfoAccess":!function(e){const t=i.ASN1.parseDERWithTemplate(e.value,m);null!=t.authorityInfoAccessOcsp&&(e.authorityInfoAccessOcsp=t.authorityInfoAccessOcsp.bytes.toString());null!=t.authorityInfoAccessIssuers&&(e.authorityInfoAccessIssuers=t.authorityInfoAccessIssuers.bytes.toString())}(t)}return t}function f(e){e.altNames=[];const t=i.ASN1.fromDER(e.value).mustCompound();for(const n of t){const t={tag:n.tag,value:n.bytes};switch(e.altNames.push(t),n.tag){case 1:t.email=n.bytes.toString();break;case 2:t.dnsName=n.bytes.toString();break;case 6:t.uri=n.bytes.toString();break;case 7:t.ip=a.bytesToIP(n.bytes);break;case 8:t.oid=i.ASN1.parseOID(n.bytes)}}}t.Certificate=c;const h={name:"subjectKeyIdentifier",class:i.Class.UNIVERSAL,tag:i.Tag.OCTETSTRING,capture:"subjectKeyIdentifier"};const g={name:"authorityKeyIdentifier",class:i.Class.UNIVERSAL,tag:i.Tag.SEQUENCE,value:[{name:"authorityKeyIdentifier.value",class:i.Class.CONTEXT_SPECIFIC,tag:i.Tag.NONE,capture:"authorityKeyIdentifier"}]};const m={name:"authorityInfoAccess",class:i.Class.UNIVERSAL,tag:i.Tag.SEQUENCE,value:[{name:"authorityInfoAccess.authorityInfoAccessOcsp",class:i.Class.UNIVERSAL,tag:i.Tag.SEQUENCE,optional:!0,value:[{name:"authorityInfoAccess.authorityInfoAccessOcsp.oid",class:i.Class.UNIVERSAL,tag:i.Tag.OID},{name:"authorityInfoAccess.authorityInfoAccessOcsp.value",class:i.Class.CONTEXT_SPECIFIC,tag:i.Tag.OID,capture:"authorityInfoAccessOcsp"}]},{name:"authorityInfoAccess.authorityInfoAccessIssuers",class:i.Class.UNIVERSAL,tag:i.Tag.SEQUENCE,optional:!0,value:[{name:"authorityInfoAccess.authorityInfoAccessIssuers.oid",class:i.Class.UNIVERSAL,tag:i.Tag.OID},{name:"authorityInfoAccess.authorityInfoAccessIssuers.value",class:i.Class.CONTEXT_SPECIFIC,tag:i.Tag.OID,capture:"authorityInfoAccessIssuers"}]}]};function y(e){for(const t of e){if(null!=t.name&&""!==t.name||(null!=t.oid&&(t.name=a.getOIDName(t.oid)),""===t.name&&null!=t.shortName&&(t.name=a.getOIDName(l[t.shortName]))),null==t.oid||""===t.oid){if(""===t.name)throw new Error("Attribute oid not specified.");t.oid=a.getOID(t.name)}if(null!=t.shortName&&""!==t.shortName||(t.shortName=null==l[t.name]?"":l[t.name]),null==t.value)throw new Error("Attribute value not specified.")}}function v(e){const t=[];for(const r of e.mustCompound())for(const e of r.mustCompound()){const r=e.mustCompound(),o={};o.oid=i.ASN1.parseOID(r[0].bytes),o.value=r[1].value,o.valueTag=r[1].tag,o.name=a.getOIDName(o.oid),o.shortName=(n=o.name,null==l[n]?"":l[n]),t.push(o)}var n;return t}function b(e){return null==e||e instanceof Buffer||"function"!=typeof e.toJSON?e:e.toJSON()}},function(e,t,n){const r=n(349);e.exports=class extends r{constructor(e){super(e,{filename:"http-challenge.db"})}}},function(e,t,n){function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{WELLKNOWN_SERVICE_PATH_PREFIX:a}=n(25),{BLOCKLET_CONFIGURABLE_KEY:s}=n(100),{getDisplayName:l}=n(104),u=n(40)(n(686).name),p=n(112);e.exports={init(e,t,{prefix:n,type:r}={}){e.get(n+"/invitation",async(e,n)=>{const{inviteId:i}=e.query,c=e.headers["x-group-path-prefix"]||"/",d=await t.getNodeInfo();try{let f;if("blocklet"===r){const t=await e.getBlocklet();f={did:t.meta.did,appDid:t.appDid,url:t.environmentObj[s.BLOCKLET_APP_URL],name:l(t),version:t.meta.version,logo:p(c,a,"/blocklet/logo"),chainHost:t.configObj.CHAIN_HOST,passportColor:t.configObj[s.BLOCKLET_PASSPORT_COLOR],description:t.meta.description}}else f={did:d.did,appDid:d.did,url:"/",name:d.name,version:d.version,description:d.description};const h=f.did,g=(await t.getInvitations({teamDid:h})).find(e=>e.inviteId===i);if(!g||Date.now()>new Date(g.expireDate).getTime())return void n.status(404).send("Invitation not found or invitation has been used");const m=(await t.getRoles({teamDid:h})).find(e=>e.name===g.role);try{m.permissions=await t.getPermissionsByRole({teamDid:h,role:{name:m.name}})}catch(e){u.error("failed to get role permission",{teamDid:h,role:m.name,error:e}),m.permissions=[]}const y=await t.getUser({teamDid:d.did,user:{did:g.inviter.did}}),v={did:g.inviter.did,email:g.inviter.email,fullName:g.inviter.fullName,role:g.inviter.role,avatar:y&&y.avatar};n.json(o(o({},g),{},{info:f,inviter:v,inviterRaw:g.inviter,role:m||{}}))}catch(e){u.error("failed to get invitation info",{inviteId:i,error:e}),n.status(500).end()}})}}},function(e,t){e.exports={getVcFromPresentation:e=>{const t=Array.isArray(e.verifiableCredential)?e.verifiableCredential[0]:e.verifiableCredential;return JSON.parse(t)}}},function(e,t,n){const r=n(9),o=n(112),i=n(28),a=n(1379),{fromSecretKey:s,WalletType:l}=n(46),{WalletAuthenticator:u}=n(713),{DEFAULT_SERVICE_PATH:p,WELLKNOWN_SERVICE_PATH_PREFIX:c}=n(25),d=n(1438),f=n(721),h=n(723),g=l({role:i.types.RoleType.ROLE_APPLICATION,pk:i.types.KeyType.ED25519,hash:i.types.HashType.SHA3}),m=s(process.env.ABT_NODE_SK,g),y=(()=>{const e={};return{get:t=>e[t],set:(t,n)=>{e[t]=n}}})(),v=new u({wallet:m,baseUrl:h.baseUrl,appInfo:async({baseUrl:e})=>{const t=await y.get("node").getNodeInfo();return{name:t.name,description:t.description,icon:`${h.baseUrl||e}/images/node.png?version=${t.version}`,link:h.baseUrl||e,updateSubEndpoint:!0,subscriptionEndpoint:o(p,c,"websocket"),nodeDid:t.did}},chainInfo:{host:"none",id:"none"}}),b=new d({authenticator:v,tokenStorage:new a({dbPath:r.join(process.env.ABT_NODE_DATA_DIR,"auth.db"),dbPort:Number(process.env.NEDB_MULTI_PORT),onload:e=>{e&&console.error("Failed to load database from "+r.join(process.env.ABT_NODE_DATA_DIR,"auth.db"),e)}}),sendNotificationFn:(e,t)=>{const n={appId:m.address,appSk:m.secretKey,did:m.address};return f(e,t,n,process.env.ABT_NODE_SERVICE_PORT)}});e.exports={authenticator:v,handlers:b,wallet:m,context:y}},function(e,t,n){const r=n(1380),o=n(701),i=n(1404),a=n(10)(n(1405).name);e.exports=class extends i{constructor(e={}){if(super(e),!e.dbPath)throw new Error("DiskAuthStorage requires a valid dbPath option to initialize");this.options=e;const t=e.dbPort?o(e.dbPort):r;this.db=new t(Object.assign({filename:e.dbPath,autoload:!0,timestampData:!0},e)),this.db.loadDatabase(t=>{t&&a("failed to load disk database "+e.dbPath,{error:t})})}read(e){return new Promise((t,n)=>{e?this.db.findOne({token:e},(e,r)=>{e?n(e):t(r)}):n(new Error("token is required to read auth record"))})}create(e,t="created"){return new Promise((n,r)=>{e?this.db.insert({token:e,status:t},(o,i)=>{o?r(o):(this.emit("create",i),a("emit.create",{token:e,status:t}),n(i))}):r(new Error("token is required to create auth record"))})}update(e,t={}){return new Promise((n,r)=>{e?this.db.update({token:e},{$set:t},{multi:!1,upsert:!1,returnUpdatedDocs:!0},(o,i,s)=>{o?r(o):(this.emit("update",s),a("emit.update",{token:e,updates:t}),n(s))}):r(new Error("token is required to update auth record"))})}delete(e){return new Promise((t,n)=>{e?this.db.remove({token:e},{multi:!0},(r,o)=>{r?n(r):(this.emit("destroy",e),t(o))}):n(new Error("token is required to delete auth record"))})}exist(e,t){return new Promise((n,r)=>{e?this.db.findOne({token:e,did:t},(e,t)=>{n(!e&&!!t)}):r(new Error("token is required to check auth record"))})}clear(){return new Promise((e,t)=>{this.db.remove({},{multi:!0},(n,r)=>{n?t(n):e(r)})})}}},function(e,t,n){e.exports=n(706),e.exports.Model=n(150),e.exports.PromisedDatastore=n(1403)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(n(1382)),o=i(n(105));function i(e){return e&&e.__esModule?e:{default:e}}t.default=(0,o.default)((function(e,t,n){return(0,r.default)(e,1,t,n)}),3),e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(535)),o=s(n(544)),i=s(n(90)),a=s(n(105));function s(e){return e&&e.__esModule?e:{default:e}}t.default=(0,a.default)((function(e,t,n,a){return(0,r.default)(t)(e,(0,o.default)((0,i.default)(n)),a)}),4),e.exports=t.default},function(e,t,n){const r=n(1384);function o(){this.buffer=[],this.ready=!1,this.open=!0,this.queue=r((e,t)=>{const n=[...e.arguments],r=e.arguments[e.arguments.length-1];"function"==typeof r?n[n.length-1]=function(){setImmediate(t);try{r.apply(null,arguments)}catch(e){process.emit("uncaughtException",e)}}:r||0===e.arguments.length?n.push(()=>{t()}):n[n.length-1]=function(){t()},e.fn.apply(e.this,n)},1)}o.prototype.push=function(e,t,n){if(!0===n)this.open=!1,this.processBuffer(),this.queue.push(e);else{if(!this.open){const t=new Error("Attempting operation on closed database."),n=e.arguments;if(n.length>0){const e=n[n.length-1];if("function"==typeof e)return void e(t)}throw t}this._push(e,t)}},o.prototype._push=function(e,t){this.ready||t?this.queue.push(e):this.buffer.push(e)},o.prototype.processBuffer=function(){let e;for(this.ready=!0,e=0;e<this.buffer.length;e++)this.queue.push(this.buffer[e]);this.buffer=[]},e.exports=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=(0,o.default)(e);return(0,r.default)((e,t)=>{n(e[0],t)},t,1)};var r=i(n(1385)),o=i(n(90));function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){if(null==t)t=1;else if(0===t)throw new RangeError("Concurrency must not be zero");var s=(0,a.default)(e),l=0,u=[];const p={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function c(e,t){return e?t?void(p[e]=p[e].filter(e=>e!==t)):p[e]=[]:Object.keys(p).forEach(e=>p[e]=[])}function d(e,...t){p[e].forEach(e=>e(...t))}var f=!1;function h(e,t,n,r){if(null!=r&&"function"!=typeof r)throw new Error("task callback must be a function");var i,a;function s(e,...t){return e?n?a(e):i():t.length<=1?i(t[0]):void i(t)}b.started=!0;var l={data:e,callback:n?s:r||s};if(t?b._tasks.unshift(l):b._tasks.push(l),f||(f=!0,(0,o.default)(()=>{f=!1,b.process()})),n||!r)return new Promise((e,t)=>{i=e,a=t})}function g(e){return function(t,...n){l-=1;for(var r=0,o=e.length;r<o;r++){var i=e[r],a=u.indexOf(i);0===a?u.shift():a>0&&u.splice(a,1),i.callback(t,...n),null!=t&&d("error",t,i.data)}l<=b.concurrency-b.buffer&&d("unsaturated"),b.idle()&&d("drain"),b.process()}}function m(e){return!(0!==e.length||!b.idle())&&((0,o.default)(()=>d("drain")),!0)}const y=e=>t=>{if(!t)return new Promise((t,n)=>{!function(e,t){const n=(...r)=>{c(e,n),t(...r)};p[e].push(n)}(e,(e,r)=>{if(e)return n(e);t(r)})});c(e),function(e,t){p[e].push(t)}(e,t)};var v=!1,b={_tasks:new i.default,*[Symbol.iterator](){yield*b._tasks[Symbol.iterator]()},concurrency:t,payload:n,buffer:t/4,started:!1,paused:!1,push(e,t){if(Array.isArray(e)){if(m(e))return;return e.map(e=>h(e,!1,!1,t))}return h(e,!1,!1,t)},pushAsync(e,t){if(Array.isArray(e)){if(m(e))return;return e.map(e=>h(e,!1,!0,t))}return h(e,!1,!0,t)},kill(){c(),b._tasks.empty()},unshift(e,t){if(Array.isArray(e)){if(m(e))return;return e.map(e=>h(e,!0,!1,t))}return h(e,!0,!1,t)},unshiftAsync(e,t){if(Array.isArray(e)){if(m(e))return;return e.map(e=>h(e,!0,!0,t))}return h(e,!0,!0,t)},remove(e){b._tasks.remove(e)},process(){if(!v){for(v=!0;!b.paused&&l<b.concurrency&&b._tasks.length;){var e=[],t=[],n=b._tasks.length;b.payload&&(n=Math.min(n,b.payload));for(var o=0;o<n;o++){var i=b._tasks.shift();e.push(i),u.push(i),t.push(i.data)}l+=1,0===b._tasks.length&&d("empty"),l===b.concurrency&&d("saturated");var a=(0,r.default)(g(e));s(t,a)}v=!1}},length:()=>b._tasks.length,running:()=>l,workersList:()=>u,idle:()=>b._tasks.length+l===0,pause(){b.paused=!0},resume(){!1!==b.paused&&(b.paused=!1,(0,o.default)(b.process))}};return Object.defineProperties(b,{saturated:{writable:!1,value:y("saturated")},unsaturated:{writable:!1,value:y("unsaturated")},empty:{writable:!1,value:y("empty")},drain:{writable:!1,value:y("drain")},error:{writable:!1,value:y("error")}}),b};var r=s(n(231)),o=s(n(533)),i=s(n(1386)),a=s(n(90));function s(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{constructor(){this.head=this.tail=null,this.length=0}removeLink(e){return e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev,e.prev=e.next=null,this.length-=1,e}empty(){for(;this.head;)this.shift();return this}insertAfter(e,t){t.prev=e,t.next=e.next,e.next?e.next.prev=t:this.tail=t,e.next=t,this.length+=1}insertBefore(e,t){t.prev=e.prev,t.next=e,e.prev?e.prev.next=t:this.head=t,e.prev=t,this.length+=1}unshift(e){this.head?this.insertBefore(this.head,e):o(this,e)}push(e){this.tail?this.insertAfter(this.tail,e):o(this,e)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var e=this.head;e;)yield e.data,e=e.next}remove(e){for(var t=this.head;t;){var{next:n}=t;e(t)&&this.removeLink(t),t=n}return this}}function o(e,t){e.length=1,e.head=e.tail=t}t.default=r,e.exports=t.default},function(e,t,n){e.exports.BinarySearchTree=n(709),e.exports.AVLTree=n(1388)},function(e,t,n){const r=n(8),o=n(709),i=n(710);function a(e){this.tree=new s(e)}function s(e){e=e||{},this.left=null,this.right=null,this.parent=void 0!==e.parent?e.parent:null,e.hasOwnProperty("key")&&(this.key=e.key),this.data=e.hasOwnProperty("value")?[e.value]:[],this.unique=e.unique||!1,this.vkUnique=e.vkUnique||!1,this.compareKeys=e.compareKeys||i.defaultCompareKeysFunction,this.checkValueEquality=e.checkValueEquality||i.defaultCheckValueEquality}r.inherits(s,o),a._AVLTree=s,s.prototype.checkHeightCorrect=function(){let e,t;if(this.hasOwnProperty("key")){if(this.left&&void 0===this.left.height)throw new Error("Undefined height for node "+this.left.key);if(this.right&&void 0===this.right.height)throw new Error("Undefined height for node "+this.right.key);if(void 0===this.height)throw new Error("Undefined height for node "+this.key);if(e=this.left?this.left.height:0,t=this.right?this.right.height:0,this.height!==1+Math.max(e,t))throw new Error("Height constraint failed for node "+this.key);this.left&&this.left.checkHeightCorrect(),this.right&&this.right.checkHeightCorrect()}},s.prototype.balanceFactor=function(){return(this.left?this.left.height:0)-(this.right?this.right.height:0)},s.prototype.checkBalanceFactors=function(){if(Math.abs(this.balanceFactor())>1)throw new Error("Tree is unbalanced at node "+this.key);this.left&&this.left.checkBalanceFactors(),this.right&&this.right.checkBalanceFactors()},s.prototype.checkIsAVLT=function(){s.super_.prototype.checkIsBST.call(this),this.checkHeightCorrect(),this.checkBalanceFactors()},a.prototype.checkIsAVLT=function(){this.tree.checkIsAVLT()},s.prototype.rightRotation=function(){const e=this,t=this.left;let n,r,o,i;return t?(n=t.right,e.parent?(t.parent=e.parent,e.parent.left===e?e.parent.left=t:e.parent.right=t):t.parent=null,t.right=e,e.parent=t,e.left=n,n&&(n.parent=e),r=t.left?t.left.height:0,o=n?n.height:0,i=e.right?e.right.height:0,e.height=Math.max(o,i)+1,t.height=Math.max(r,e.height)+1,t):this},s.prototype.leftRotation=function(){const e=this,t=this.right;let n,r,o,i;return t?(n=t.left,e.parent?(t.parent=e.parent,e.parent.left===e?e.parent.left=t:e.parent.right=t):t.parent=null,t.left=e,e.parent=t,e.right=n,n&&(n.parent=e),r=e.left?e.left.height:0,o=n?n.height:0,i=t.right?t.right.height:0,e.height=Math.max(r,o)+1,t.height=Math.max(i,e.height)+1,t):this},s.prototype.rightTooSmall=function(){return this.balanceFactor()<=1?this:(this.left.balanceFactor()<0&&this.left.leftRotation(),this.rightRotation())},s.prototype.leftTooSmall=function(){return this.balanceFactor()>=-1?this:(this.right.balanceFactor()>0&&this.right.rightRotation(),this.leftRotation())},s.prototype.rebalanceAlongPath=function(e){let t,n,r=this;if(!this.hasOwnProperty("key"))return delete this.height,this;for(n=e.length-1;n>=0;n-=1)e[n].height=1+Math.max(e[n].left?e[n].left.height:0,e[n].right?e[n].right.height:0),e[n].balanceFactor()>1&&(t=e[n].rightTooSmall(),0===n&&(r=t)),e[n].balanceFactor()<-1&&(t=e[n].leftTooSmall(),0===n&&(r=t));return r},s.prototype.insert=function(e,t){const n=[];let r=this;if(!this.hasOwnProperty("key"))return this.key=e,this.data.push(t),this.height=1,this;for(;;){if(0===r.compareKeys(r.key,e)){if(r.unique){if(r.data.includes(t))return;const n=new Error(`Can't insert key ${e}, it violates the unique constraint`);throw n.key=e,n.errorType="uniqueViolated",n}if(this.vkUnique&&r.data.includes(t))return;return r.data.push(t),this}if(n.push(r),r.compareKeys(e,r.key)<0){if(!r.left){n.push(r.createLeftChild({key:e,value:t}));break}r=r.left}else{if(!r.right){n.push(r.createRightChild({key:e,value:t}));break}r=r.right}}return this.rebalanceAlongPath(n)},a.prototype.insert=function(e,t){const n=this.tree.insert(e,t);n&&(this.tree=n)},s.prototype.delete=function(e,t){const n=[];let r;let o=this;const i=[];if(!this.hasOwnProperty("key"))return this;for(;0!==o.compareKeys(e,o.key);)if(i.push(o),o.compareKeys(e,o.key)<0){if(!o.left)return this;o=o.left}else{if(!o.right)return this;o=o.right}if(o.data.length>1&&void 0!==t)return o.data.forEach(e=>{o.checkValueEquality(e,t)||n.push(e)}),o.data=n,this;if(!o.left&&!o.right)return o===this?(delete o.key,o.data=[],delete o.height,this):(o.parent.left===o?o.parent.left=null:o.parent.right=null,this.rebalanceAlongPath(i));if(!o.left||!o.right)return r=o.left?o.left:o.right,o===this?(r.parent=null,r):(o.parent.left===o?(o.parent.left=r,r.parent=o.parent):(o.parent.right=r,r.parent=o.parent),this.rebalanceAlongPath(i));if(i.push(o),r=o.left,!r.right)return o.key=r.key,o.data=r.data,o.left=r.left,r.left&&(r.left.parent=o),this.rebalanceAlongPath(i);for(;r.right;)i.push(r),r=r.right;return o.key=r.key,o.data=r.data,r.parent.right=r.left,r.left&&(r.left.parent=r.parent),this.rebalanceAlongPath(i)},a.prototype.delete=function(e,t){const n=this.tree.delete(e,t);n&&(this.tree=n)},["getNumberOfKeys","getMinKey","getMaxKey","search","searchAfter","searchBefore","searchNearest","searchNearestLte","searchNearestGte","betweenBounds","prettyPrint","executeOnEveryNode"].forEach(e=>{a.prototype[e]=function(){return this.tree[e].apply(this.tree,arguments)}}),e.exports=a},function(e,t,n){const r=n(8),o=n(150);function i(e){this.fieldName=e.fieldName,this.unique=e.unique||!1,this.sparse=e.sparse||!1,this.data=new Map,this._extractKey=o.getDotFn(this.fieldName)}i.prototype.reset=function(e){this.data.clear(),e&&(Array.isArray(e)?this.insertMultipleDocs(e):this.insert(e))},i.prototype.insert=function(e){const t=this._extractKey(e);if(void 0!==t||!this.sparse)if(r.isArray(t)){const n=t;let r,o;for(let t=0;t<n.length;t++){const i=n[t];if(this.data.has(i)){o=new Error("duplicate key "+i),o.key=i,o.errorType="uniqueViolated",r=t;break}this.data.set(i,e)}if(o){for(let e=0;e<r;e++)this.data.delete(n[e]);throw o}}else{if(this.data.has(t)){const e=new Error("duplicate key "+t);throw e.key=t,e.errorType="uniqueViolated",e}this.data.set(t,e)}},i.prototype.insertMultipleDocs=function(e){let t,n,r;for(t=0;t<e.length;t++)try{this.insert(e[t])}catch(e){n=e,r=t;break}if(n){for(t=0;t<r;t++)this.remove(e[t]);throw n}},i.prototype.remove=function(e){let t;const n=this;if(r.isArray(e))e.forEach(e=>{n.remove(e)});else if(t=this._extractKey(e),void 0!==t||!this.sparse)if(r.isArray(t))for(const e of t)this.data.delete(e);else this.data.delete(t)},i.prototype.update=function(e,t){const n=this._extractKey(e);if(n==this._extractKey(t))this.data.set(n,t);else{this.remove(e);try{this.insert(t)}catch(t){throw this.insert(e),t}}},i.prototype.updateMultipleDocs=function(e){let t,n,r;for(t=0;t<e.length;t++)this.remove(e[t].oldDoc);for(t=0;t<e.length;t++)try{this.insert(e[t].newDoc)}catch(e){r=e,n=t;break}if(r){for(t=0;t<n;t++)this.remove(e[t].newDoc);for(t=0;t<e.length;t++)this.insert(e[t].oldDoc);throw r}},i.prototype.revertUpdate=function(e,t){const n=[];r.isArray(e)?(e.forEach(e=>{n.push({oldDoc:e.newDoc,newDoc:e.oldDoc})}),this.updateMultipleDocs(n)):this.update(t,e)},i.prototype.getMatchingSingle=function(e){const t=this.data.get(e);return t?[t]:[]},i.prototype.getMatching=function(e){if(!Array.isArray(e))return this.getMatchingSingle(e);const t={};for(const n of e)for(const e of this.getMatchingSingle(n))t[e._id]=e;return Object.values(t)},i.prototype.getBetweenBounds=function(e){return Object.values(this.data)},i.prototype.getAll=function(){return[...this.data.values()]},i.prototype.forEach=function(e){for(const[t,n]of this.data)e(n)},i.prototype[Symbol.iterator]=function*(){yield*this.data.values()},e.exports=i},function(e,t,n){const r=n(9),o=n(353),{LineTransform:i}=n(1391),a=n(17),s=n(1394),l=n(150),u=n(708),p=n(707);function c(e){let t,n,r;if(this.db=e.db,this.inMemoryOnly=this.db.inMemoryOnly,this.filename=this.db.filename,this.corruptAlertThreshold=void 0!==e.corruptAlertThreshold?e.corruptAlertThreshold:.1,this.writtenCount=0,this.writtenBytes=0,!this.inMemoryOnly&&this.filename&&"~"===this.filename.charAt(this.filename.length-1))throw new Error("The datafile name can't end with a ~, which is reserved for crash safe backup files");if(e.afterSerialization&&!e.beforeDeserialization)throw new Error("Serialization hook defined but deserialization hook undefined, cautiously refusing to start NeDB to prevent dataloss");if(!e.afterSerialization&&e.beforeDeserialization)throw new Error("Serialization hook undefined but deserialization hook defined, cautiously refusing to start NeDB to prevent dataloss");for(this.afterSerialization=e.afterSerialization||function(e){return l.serialize(e)},this.beforeDeserialization=e.beforeDeserialization||function(e){return l.deserialize(e)},t=1;t<30;t++)for(n=0;n<10;n+=1)if(r="_"+p.uid(t),this.beforeDeserialization(this.afterSerialization(r))!==r)throw new Error("beforeDeserialization is not the reverse of afterSerialization, cautiously refusing to start NeDB to prevent dataloss")}c.ensureDirectoryExists=function(e,t){t=t||function(){},s.mkdirp(e).then(t)},c.prototype.persistCachedDatabase=function(e,t){if("function"==typeof e&&(t=e,e=!0),t=t||function(){},this.inMemoryOnly)return t(null);const n=this.filename+"~",r=a.createWriteStream(n);let o=null;r.on("open",e=>o=e),this.db.forEach(e=>r.write(this.afterSerialization(e)+"\n"));for(const e in this.db.indexes){if("_id"===e)continue;const t=this.db.indexes[e];r.write(this.afterSerialization({$$indexCreated:{fieldName:e,unique:t.unique,sparse:t.sparse}})+"\n")}r.end(()=>{const r=()=>{s.crashSafeRename(n,this.filename,n=>{if(n)return t(n);const r=e=>e?t(e):(this.db.emit("compaction.done"),t(null));e?this._open(r):this.fd&&a.close(this.fd,()=>{r()})})};o?a.fsync(o,r):r()})},c.prototype.compactDatafile=function(e){e=e||function(){},this.db.executor.push({this:this,fn:this.persistCachedDatabase,arguments:[e]})},c.prototype.setAutocompactionInterval=function(e,t=0,n=Number.MAX_SAFE_INTEGER){let r;this.stopAutocompaction();const o=()=>{r=this.autocompactionIntervalId,(this.writtenCount>=t||this.writtenBytes>n)&&this.compactDatafile(()=>{this.writtenCount=this.writtenBytes=0,r==this.autocompactionIntervalId&&(this.autocompactionIntervalId=setTimeout(o,i))})},i=Math.max(e||0,5e3);this.autocompactionIntervalId=setTimeout(o,i)},c.prototype.stopAutocompaction=function(){this.autocompactionIntervalId&&(clearTimeout(this.autocompactionIntervalId),this.autocompactionIntervalId=null)},c.prototype.persistNewState=function(e,t){if(t=t||function(){},this.inMemoryOnly)return t(null);let n="";const r=e.length;for(let t=0;t<r;t++){const r=this.afterSerialization(e[t])+"\n";n+=r,this.writtenCount++,this.writtenBytes+=r.length}if(0===n.length)return t(null);s.appendFile(this.fd||this.filename,n,"utf8",e=>e?t(e):this.fd?void a.fsync(this.fd,e=>t(e)):t())},c.prototype.readFileAndParse=function(e){const t=this;let n=0;const r=[],o={},s={};let l,u=0;try{const e=a.createReadStream(this.filename,{fd:this.fd,start:0,autoClose:!1});l=new i,e.pipe(l)}catch(t){return e(null,{data:r,indexes:s})}l.on("end",()=>{if(n>0&&u/n>t.corruptAlertThreshold)return e(new Error(`More than ${Math.floor(100*t.corruptAlertThreshold)}% of the data file is corrupt, the wrong beforeDeserialization hook may be used. Cautiously refusing to start NeDB to prevent dataloss`));for(const e in o)r.push(o[e]);e(null,{data:r,indexes:s})}),l.on("error",t=>e(t)),l.on("data",e=>{try{const n=t.beforeDeserialization(e);n._id?!0===n.$$deleted?delete o[n._id]:o[n._id]=n:n.$$indexCreated&&null!=n.$$indexCreated.fieldName?s[n.$$indexCreated.fieldName]=n.$$indexCreated:"string"==typeof n.$$indexRemoved&&delete s[n.$$indexRemoved]}catch(e){u+=1}n++})},c.prototype.treatRawData=function(e){const t=e.split("\n"),n={},r=[],o={};let i=-1;for(let e=0;e<t.length;e++)try{const r=this.beforeDeserialization(t[e]);r._id?!0===r.$$deleted?delete n[r._id]:n[r._id]=r:r.$$indexCreated&&null!=r.$$indexCreated.fieldName?o[r.$$indexCreated.fieldName]=r.$$indexCreated:"string"==typeof r.$$indexRemoved&&delete o[r.$$indexRemoved]}catch(e){i++}if(t.length>0&&i/t.length>this.corruptAlertThreshold)throw new Error(`More than ${Math.floor(100*this.corruptAlertThreshold)}% of the data file is corrupt, the wrong beforeDeserialization hook may be used. Cautiously refusing to start NeDB to prevent dataloss`);for(const e in n)r.push(n[e]);return{data:r,indexes:o}},c.prototype._open=function(e){o([e=>{this.fd?a.close(this.fd,()=>{this.fd=null,e()}):e()},e=>{a.open(this.filename,"a+",(t,n)=>t?e(t):(this.fd=n,e()))}],e)},c.prototype.loadDatabase=function(e){const t=e||function(){};if(this.db.resetIndexes(),this.inMemoryOnly)return t(null);o([e=>{c.ensureDirectoryExists(r.dirname(this.filename),t=>{this._open(t=>{if(t)return e(t);s.ensureDatafileIntegrity(this.fd,t=>{this.readFileAndParse((t,n)=>{if(t)return e(t);for(const e in n.indexes)this.db.indexes[e]=new u(n.indexes[e]);try{this.db.resetIndexes(n.data)}catch(t){return this.db.resetIndexes(),e(t)}this.db.persistence.persistCachedDatabase(e)})})})})}],e=>e?t(e):(this.db.executor.processBuffer(),t(null)))},c.prototype.closeDatabase=function(e){if(e=e||function(){},this.inMemoryOnly)return e(null);this.persistCachedDatabase(!1,e)},e.exports=c},function(e,t,n){!function(){"use strict";e.exports.LineTransform=n(711),e.exports.LineReader=n(1392),e.exports.LineFilter=n(1393)}()},function(e,t,n){!function(){"use strict";var t=n(17),r=n(711),o=n(161).StringDecoder;(e.exports=function(e,n){if(this.file="object"==typeof e?this.file=n.input:e,!t.existsSync(this.file))throw new Error("File: "+e+" does not exist");n=n||{},this._encoding=n.encoding||"utf8",this._decoder=new o(this._encoding),this._reader=new r,this._source=t.createReadStream(this.file),this._source.setEncoding(this._encoding),this._init=!1,this._end=!1,this._cbs=[]}).prototype.nextLine=function(e){if(this._init||(this._init=!0,this._source.pipe(this._reader),this._reader.on("data",function(e){this._cbs.shift()(null,this._decoder.write(e)),0===this._cbs.length&&this._reader.pause()}.bind(this)),this._reader.on("end",function(){this._end=!0,this._cbs.forEach((function(e){e(null,null)})),this._cbs=[]}.bind(this))),this._end)return e(null,null);this._cbs.push(e),this._reader.resume()}}()},function(e,t,n){!function(){"use strict";var t=n(8),r=n(11).Transform,o=n(161).StringDecoder;function i(e){if(!(this instanceof i))return new i(e);r.call(this,e),this._writableState.objectMode=!0,this._readableState.objectMode=!0,this._decoder=new o("utf8");var n=(e=e||{}).include||[],a=e.exclude||[];t.isArray(n)||(n=[n]),t.isArray(a)||(a=[a]),this._include=n,this._exclude=a,e.skipEmpty&&this._exclude.push(/^$/),e.skipBlank&&this._exclude.push(/^\s+$/)}function a(e,t){s(e._include,t,!0,0===e._include.length)&&s(e._exclude,t,!1,!0)&&e.push(t)}function s(e,t,n,r){for(var o=e.length-1;o>=0;o--)if(e[o].test(t))return n;return r}t.inherits(i,r),i.prototype._transform=function(e,t,n){a.call(this,this,this._decoder.write(e)),n()},i.prototype._flush=function(e){e()},e.exports=i}()},function(e,t,n){const r=n(17),o=n(1395),[i,a]=[n(353),n(1401)],s=n(9),l={};l.exists=r.exists,l.rename=r.rename,l.writeFile=r.writeFile,l.unlink=r.unlink,l.appendFile=r.appendFile,l.readFile=r.readFile,l.mkdirp=o,l.ensureFileDoesntExist=function(e,t){l.exists(e,n=>{if(!n)return t(null);l.unlink(e,e=>t(e))})},l.flushToStorage=function(e,t){let n,o;if("string"==typeof e?(n=e,o="r+"):(n=e.filename,o=e.isDir?"r":"r+"),"r"===o&&("win32"===process.platform||"win64"===process.platform))return t(null);r.open(n,o,(e,n)=>{if(e)return t(e);r.fsync(n,e=>{r.close(n,n=>{if(e||n){const r=new Error("Failed to flush to storage");return r.errorOnFsync=e,r.errorOnClose=n,t(r)}return t(null)})})})},l.crashSafeWriteFile=function(e,t,n){const r=n||function(){},o=e+"~";i([a(l.flushToStorage,{filename:s.dirname(e),isDir:!0}),function(t){l.exists(e,n=>{if(!n)return t();l.flushToStorage(e,e=>t(e))})},function(e){l.writeFile(o,t,t=>e(t))},a(l.flushToStorage,o),function(t){l.rename(o,e,e=>t(e))},a(l.flushToStorage,{filename:s.dirname(e),isDir:!0})],e=>r(e))},l.crashSafeRename=function(e,t,n){const r=n||function(){},o=e;i([a(l.flushToStorage,{filename:s.dirname(t),isDir:!0}),a(l.flushToStorage,o),function(e){l.rename(o,t,t=>e(t))},a(l.flushToStorage,{filename:s.dirname(t),isDir:!0})],e=>r(e))},l.ensureDatafileIntegrity=function(e,t){const n=e+"~";l.exists(e,r=>{if(r)return t(null);l.exists(n,r=>{if(!r)return l.writeFile(e,"","utf8",e=>{t(e)});l.rename(n,e,e=>t(e))})})},e.exports=l},function(e,t,n){const r=n(1396),o=n(1397),{mkdirpNative:i,mkdirpNativeSync:a}=n(1398),{mkdirpManual:s,mkdirpManualSync:l}=n(712),{useNative:u,useNativeSync:p}=n(1400),c=(e,t)=>(e=o(e),t=r(t),u(t)?i(e,t):s(e,t));c.sync=(e,t)=>(e=o(e),t=r(t),p(t)?a(e,t):l(e,t)),c.native=(e,t)=>i(o(e),r(t)),c.manual=(e,t)=>s(o(e),r(t)),c.nativeSync=(e,t)=>a(o(e),r(t)),c.manualSync=(e,t)=>l(o(e),r(t)),e.exports=c},function(e,t,n){const{promisify:r}=n(8),o=n(17);e.exports=e=>{if(e)if("object"==typeof e)e={mode:511,fs:o,...e};else if("number"==typeof e)e={mode:e,fs:o};else{if("string"!=typeof e)throw new TypeError("invalid options argument");e={mode:parseInt(e,8),fs:o}}else e={mode:511,fs:o};return e.mkdir=e.mkdir||e.fs.mkdir||o.mkdir,e.mkdirAsync=r(e.mkdir),e.stat=e.stat||e.fs.stat||o.stat,e.statAsync=r(e.stat),e.statSync=e.statSync||e.fs.statSync||o.statSync,e.mkdirSync=e.mkdirSync||e.fs.mkdirSync||o.mkdirSync,e}},function(e,t,n){const r=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:o,parse:i}=n(9);e.exports=e=>{if(/\0/.test(e))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:e,code:"ERR_INVALID_ARG_VALUE"});if(e=o(e),"win32"===r){const t=/[*|"<>?:]/,{root:n}=i(e);if(t.test(e.substr(n.length)))throw Object.assign(new Error("Illegal characters in path."),{path:e,code:"EINVAL"})}return e}},function(e,t,n){const{dirname:r}=n(9),{findMade:o,findMadeSync:i}=n(1399),{mkdirpManual:a,mkdirpManualSync:s}=n(712);e.exports={mkdirpNative:(e,t)=>{t.recursive=!0;return r(e)===e?t.mkdirAsync(e,t):o(t,e).then(n=>t.mkdirAsync(e,t).then(()=>n).catch(n=>{if("ENOENT"===n.code)return a(e,t);throw n}))},mkdirpNativeSync:(e,t)=>{t.recursive=!0;if(r(e)===e)return t.mkdirSync(e,t);const n=i(t,e);try{return t.mkdirSync(e,t),n}catch(n){if("ENOENT"===n.code)return s(e,t);throw n}}}},function(e,t,n){const{dirname:r}=n(9),o=(e,t,n)=>n===t?Promise.resolve():e.statAsync(t).then(e=>e.isDirectory()?n:void 0,n=>"ENOENT"===n.code?o(e,r(t),t):void 0),i=(e,t,n)=>{if(n!==t)try{return e.statSync(t).isDirectory()?n:void 0}catch(n){return"ENOENT"===n.code?i(e,r(t),t):void 0}};e.exports={findMade:o,findMadeSync:i}},function(e,t,n){const r=n(17),o=(process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version).replace(/^v/,"").split("."),i=+o[0]>10||10==+o[0]&&+o[1]>=12,a=i?e=>e.mkdir===r.mkdir:()=>!1,s=i?e=>e.mkdirSync===r.mkdirSync:()=>!1;e.exports={useNative:a,useNativeSync:s}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,...t){return(...n)=>e(...t,...n)},e.exports=t.default},function(e,t,n){const r=n(10)(n(236).name+":cursor"),o=n(150);function i(e,t,n){this.db=e,this.query=t||{},n&&(this.execFn=n)}i.prototype.limit=function(e){return this._limit=e,this},i.prototype.skip=function(e){return this._skip=e,this},i.prototype.sort=function(e){return this._sort=e,this},i.prototype.projection=function(e){return this._projection=e,this},i.prototype.project=function(e){const t=[],n=this;let r,i,a;return void 0===this._projection||0===Object.keys(this._projection).length?e:(r=0!==this._projection._id,delete this._projection._id,a=Object.keys(this._projection),a.forEach(e=>{if(void 0!==i&&n._projection[e]!==i)throw new Error(`Can't both keep and omit field ${e} except for _id`);i=n._projection[e]}),e.forEach(e=>{let n;1===i?(n={$set:{}},a.forEach(t=>{n.$set[t]=o.getDotValue(e,t),void 0===n.$set[t]&&delete n.$set[t]}),n=o.modify({},n)):(n={$unset:{}},a.forEach(e=>{n.$unset[e]=!0}),n=o.modify(e,n)),r?n._id=e._id:delete n._id,t.push(n)}),t)},i.prototype._exec=function(e){let t=[],n=0,i=0;const a=(t,n)=>this.execFn?this.execFn(t,n,e):e(t,n),s=Object.assign({},this.query);r("exec.params",{query:s,skip:this._skip,limit:this._limit,sort:this._sort,projection:this._projection}),this.db.getCandidates(s,(e,l)=>{if(e)return a(e);try{const e=o.prepare(s);for(const r of l)if(e(r))if(this._sort)t.push(r);else if(this._skip&&this._skip>i)i++;else if(t.push(r),n++,this._limit&&this._limit<=n)break}catch(e){return a(e)}if(this._sort){const e=Object.keys(this._sort),n=[];for(let t=0;t<e.length;t++){const r=e[t];n.push({key:r,direction:this._sort[r]})}t.sort((e,t)=>{let r,i;for(let a=0;a<n.length;a++)if(r=n[a],i=r.direction*o.compareThings(o.getDotValue(e,r.key),o.getDotValue(t,r.key),this.db.compareStrings),0!==i)return i;return 0});const r=this._limit||t.length,i=this._skip||0;t=t.slice(i,i+r)}try{return t=this.project(t),r("exec.result",t),a(null,t)}catch(e){return a(e)}})},i.prototype.exec=function(){this.db.executor.push({this:this,fn:this._exec,arguments:arguments})},i.prototype.toArray=function(e){const t=this;process.nextTick(()=>{e(null,t.res)})},e.exports=i},function(e,t,n){const r=n(706),o=Object.freeze(["find","findOne","count","sort","skip","limit","projection"]),i=Object.freeze(["insert","remove","update","ensureIndex","removeIndex","getCandidates","loadDatabase","closeDatabase"]);const a=new Proxy(r,{get(e,t){const n=e[t];return"CURSOR_FN_LIST"===t?o:"RESULT_FN_LIST"===t?i:function e(t){if(void 0!==t)return new Proxy(t,{get(t,n){if("then"===n)return(e,n)=>{t.exec((t,r)=>{t?n(t):e(r)})};if("catch"===n)return e=>{t.exec(t=>{t&&e(t)})};const r=t[n];if("function"==typeof r){if(o.includes(n))return function(...t){return e(r.bind(this)(...t))};if(i.includes(n))return function(...e){return"function"==typeof e[e.length-1]?r.bind(this)(...e):new Promise((t,n)=>{r.bind(this)(...e,(e,r)=>{e?n(e):t(r)})})}}return r}})}(n)}});e.exports=a},function(e,t,n){const{EventEmitter:r}=n(24);e.exports=class extends r{constructor(e){super(e)}create(e,t="created"){throw new Error("AuthStorage.create must be implemented in child class")}read(e){throw new Error("AuthStorage.read must be implemented in child class")}update(e,t){throw new Error("AuthStorage.update must be implemented in child class")}delete(e){throw new Error("AuthStorage.delete must be implemented in child class")}exist(e,t){throw new Error("AuthStorage.exist must be implemented in child class")}}},function(e){e.exports=JSON.parse('{"name":"@arcblock/did-auth-storage-nedb","description":"Storage engine that uses nedb for did-auth","version":"1.6.3","author":"wangshijun <shijun@arcblock.io> (https://ocap.arcblock.io)","bugs":{"url":"https://github.com/ArcBlock/forge-js/issues","email":"shijun@arcblock.io"},"publishConfig":{"access":"public"},"contributors":["wangshijun <shijun@arcblock.io> (https://ocap.arcblock.io)"],"devDependencies":{"j2d":"^1.0.3-dev","jest":"^23.5.0","remark-cli":"^5.0.0","remark-preset-github":"^0.0.9"},"remarkConfig":{"plugins":["preset-github",["validate-links",{"repository":"ArcBlock/forge-js"}]]},"homepage":"https://github.com/ArcBlock/forge-js/tree/master/did/did-auth-storage-nedb","keywords":["forge","blockchain","arcblock","sdk","nodejs"],"license":"Apache-2.0","main":"./lib/index.js","files":["lib"],"repository":{"type":"git","url":"https://github.com/ArcBlock/forge-js/tree/master/did/did-auth-storage-nedb"},"scripts":{"lint":"eslint lib tests","docs":"yarn generate-dts && yarn generate-docs && yarn cleanup-docs && yarn format-docs","cleanup-docs":"node ../../tools/cleanup-docs.js docs/README.md $npm_package_name","generate-docs":"jsdoc2md lib/index.js > docs/README.md","generate-dts":"j2d lib/index.js","format-docs":"remark . -o","precommit":"CI=1 yarn test","prepush":"CI=1 yarn test","test":"npm run lint && node tools/jest.js","coverage":"npm run lint && yarn test -- --coverage"},"gitHead":"570a366418890ded86422e168417bae0c9967e35","dependencies":{"@arcblock/did-auth-storage":"^1.6.3","@nedb/core":"1.x","@nedb/multi":"1.x","debug":"^4.3.1"}}')},function(e,t,n){const r=n(716),o=n(1409),i=r.object({id:r.string().optional(),host:r.string().uri({scheme:["http","https"]}).required().allow("none")}).options({stripUnknown:!0,noDefaults:!1}),a=r.object({name:r.string().required(),description:r.string().required(),icon:r.string().uri({scheme:["http","https"]}).required(),link:r.string().uri({scheme:["http","https"]}).optional(),path:r.string().uri({scheme:["http","https"]}).default("https://abtwallet.io/i/"),publisher:r.string().optional(),updateSubEndpoint:r.boolean().optional(),subscriptionEndpoint:r.string().optional(),nodeDid:r.DID().optional()}).options({stripUnknown:!1,noDefaults:!1});e.exports=Object.freeze({chainInfo:i,appInfo:a,claims:o(i)})},function(e,t,n){const{BN:r}=n(21);e.exports=e=>({type:"BN",base:e.any(),messages:{"bn.nan":"{{#label}} is not a big number","bn.max":'{{#label}} needs to be less than or equal to "{{#threshold}}"',"bn.min":'{{#label}} needs to be greater than or equal to "{{#threshold}}"',"bn.less":'{{#label}} needs to be less than "{{#threshold}}"',"bn.greater":'{{#label}} needs to be greater than "{{#threshold}}"',"bn.positive":"{{#label}} needs to be positive","bn.negative":"{{#label}} needs to be negative"},prepare(e,t){try{return{value:new r(e)}}catch(e){return{errors:t.error("bn.nan")}}},coerce:e=>({value:e.toString(10)}),validate:e=>({value:e}),rules:{gt:{args:[{name:"threshold",ref:!0,assert:e=>r.isBN(e),message:"must be a big number",normalize:e=>new r(e)},{name:"equal",assert:e=>"boolean"==typeof e,message:"must be a boolean"}],validate(e,t,n){const o=new r(e);return n.equal&&o.lt(n.threshold)?t.error("bn.min",n):!n.equal&&o.lte(n.threshold)?t.error("bn.greater",n):e}},lt:{args:[{name:"threshold",ref:!0,assert:e=>r.isBN(e),message:"must be a big number",normalize:e=>new r(e)},{name:"equal",assert:e=>"boolean"==typeof e,message:"must be a boolean"}],validate(e,t,n){const o=new r(e);return n.equal&&o.gt(n.threshold)?t.error("bn.max",n):!n.equal&&o.gte(n.threshold)?t.error("bn.less",n):e}},min:{alias:"gte",method(e){return this.$_addRule({name:"gt",args:{threshold:e,equal:!0}})}},max:{alias:"lte",method(e){return this.$_addRule({name:"lt",args:{threshold:e,equal:!0}})}},greater:{alias:"gt",method(e){return this.$_addRule({name:"gt",args:{threshold:e,equal:!1}})}},less:{alias:"lt",method(e){return this.$_addRule({name:"lt",args:{threshold:e,equal:!1}})}},positive:{method(){return this.$_addRule({name:"gt",args:{threshold:0,equal:!1}})}},negative:{method(){return this.$_addRule({name:"lt",args:{threshold:0,equal:!1}})}}}})},function(e,t,n){const r=n(169),{types:o}=n(28),{isValid:i,toTypeInfo:a,DID_TYPE_ARCBLOCK:s,DID_TYPE_ETHEREUM:l}=n(35),u={wallet:["arcblock","ethereum","default","eth"],pk:Object.keys(o.KeyType),hash:Object.keys(o.HashType),role:Object.keys(o.RoleType)};e.exports=e=>({type:"DID",base:e.string().trim(),messages:{"did.empty":'Expect {{#label}} to be non-empty string, got "{{#value}}"',"did.invalid":'Expect {{#label}} to be valid did, got "{{#value}}"',"did.wallet":'Expect wallet type of {{#label}} to be "{{#expected}}" wallet, got "{{#actual}}"',"did.pk":'Expect pk type of {{#label}} to be "{{#expected}}", got "{{#actual}}"',"did.hash":'Expect hash type of {{#label}} to be "{{#expected}}", got "{{#actual}}"',"did.role":'Expect role type of {{#label}} to be "{{#expected}}", got "{{#actual}}"'},validate:(e,t)=>e&&"string"==typeof e?!1===i(e)?{errors:t.error("did.invalid",{value:e})}:{value:e}:{errors:t.error("did.empty",{value:e})},rules:{type:{args:[{name:"key",ref:!0,assert:e=>Object.keys(u).includes(e),message:"must be one of "+Object.keys(u).join(", ")},{name:"expected",assert:e=>Object.keys(u).some(t=>u[t].includes(e)),message:"must be valid type"}],validate(e,t,n){const o=a(e),i=a(e,!0);if("wallet"===n.key){if(["ethereum","eth"].includes(n.expected)&&!1===r(o,l))return t.error("did.wallet",{...n,actual:JSON.stringify(i)});if(["arcblock","default"].includes(n.expected)&&!1===r(o,s))return t.error("did.wallet",{...n,actual:JSON.stringify(i)})}return"pk"===n.key&&i.pk!==n.expected?t.error("did.pk",{...n,actual:i.pk}):"hash"===n.key&&i.hash!==n.expected?t.error("did.hash",{...n,actual:i.hash}):"role"===n.key&&i.role!==n.expected?t.error("did.role",{...n,actual:i.role}):e}},wallet:{method(e){return this.$_addRule({name:"type",args:{key:"wallet",expected:e}})}},pk:{method(e){return this.$_addRule({name:"type",args:{key:"pk",expected:e}})}},hash:{method(e){return this.$_addRule({name:"type",args:{key:"hash",expected:e}})}},role:{method(e){return this.$_addRule({name:"type",args:{key:"role",expected:e}})}}}})},function(e,t,n){const r=n(716),{types:o}=n(28),i=r.alternatives().try(r.object({did:r.DID().required(),endpoint:r.string().uri({scheme:["http","https"]}).required()}),r.DID().required());e.exports=e=>{const t={stripUnknown:!0,noDefaults:!1},n=(t,n)=>({type:r.string().valid(t).default(t),description:r.string().min(1).default(n),chainInfo:e,meta:r.any().optional().default({})});return{authPrincipal:r.object({...n("authPrincipal","Please select account to continue."),target:r.DID().optional().allow("").default(""),targetType:r.object({key:r.string().valid(...Object.keys(o.KeyType).map(e=>e.toLowerCase())).required(),hash:r.string().valid(...Object.keys(o.HashType).map(e=>e.toLowerCase())).required(),role:r.string().valid(...Object.keys(o.RoleType).map(e=>e.toLowerCase().split("_").pop())).required()}).optional(),declareParams:r.object({moniker:r.string().required(),issuer:r.DID().required()}).optional(),supervised:r.boolean().default(!1)}).options(t),profile:r.object({...n("profile","Please provide your profile to continue."),items:r.array().items(r.string().valid("fullName","email","phone","signature","avatar","birthday")).min(1).default(["fullName"])}).rename("fields","items",{ignoreUndefined:!0,override:!0}).options(t),signature:r.object({...n("signature","Sign this transaction or message to continue."),typeUrl:r.string().valid("fg:t:transaction","mime:text/plain","mime:text/html","eth:transaction").required(),display:r.string().allow("").default(""),method:r.string().allow("none",...Object.keys(o.HashType).map(e=>e.toLowerCase())).optional().default("sha3"),digest:r.string().allow("").default(""),origin:r.string().allow("").default("")}).options(t),prepareTx:r.object({...n("prepareTx","Prepare and sign this transaction to continue."),display:r.string().allow("").default(""),partialTx:r.string().required(),requirement:r.object({tokens:r.array().items(r.object({address:r.DID().required(),value:r.BN().positive().required()})).required(),assets:r.object({address:r.array().items(r.DID()).optional(),parent:r.array().items(r.DID()).optional(),issuer:r.array().items(r.DID()).optional()}).optional()}).required()}).options(t),agreement:r.object({...n("agreement","Confirm your agreement to continue."),uri:r.string().uri({scheme:["http","https"]}).required().allow(""),method:r.string().allow(...Object.keys(o.HashType).map(e=>e.toLowerCase())).optional().default("sha2"),digest:r.string().required()}).options(t),verifiableCredential:r.object({...n("verifiableCredential","Please present a verifiable credential to continue."),optional:r.boolean().default(!1),item:r.array().items(r.string().min(1).required()).min(1).optional(),target:r.DID().optional(),trustedIssuers:r.array().items(i).min(1).optional(),tag:r.string().min(1).allow("").default(""),filters:r.array().items(r.object({type:r.array().items(r.string().min(1).required()).min(1).optional(),target:r.DID().optional(),trustedIssuers:r.array().items(i).min(1).optional(),tag:r.string().min(1).allow("").default("")})).optional()}).options(t),asset:r.object({...n("asset","Please present an on chain asset to continue."),optional:r.boolean().default(!1),address:r.DID().optional(),trustedIssuers:r.array().items(i).min(1).optional(),trustedParents:r.array().items(r.DID().required()).min(1).optional(),tag:r.string().min(1).allow("").default(""),filters:r.array().items(r.object({address:r.DID().optional(),trustedIssuers:r.array().items(i).min(1).optional(),trustedParents:r.array().items(r.DID().required()).min(1).optional(),tag:r.string().min(1).allow("").default("")})).optional()}).options(t)}}},function(e,t,n){const r=n(163),o=n(169),i=n(141),{toBase58:a}=n(21),{toDid:s}=n(35),l=n(715),u=n(714),p=n(10)(n(151).name+":authenticator:wallet"),{DEFAULT_CHAIN_INFO:c}=l;e.exports=class extends u{async sign({token:e="",context:t,claims:n,appInfo:l,authorizer:u,verifiableClaims:d=[],pathname:f="",baseUrl:h="",challenge:g="",extraParams:m={},request:y}){this._verifyClaims(d),this._verifyAuthorizer(u),this._validateAppInfo(l);const v=await this.genRequestedClaims({claims:n,context:{baseUrl:h,request:y,...t},extraParams:m}),b={baseUrl:h,request:y,...t,...m},_=v.find(e=>!1===o(this._isValidChainInfo(e.chainInfo),c)),T=await this.getWalletInfo(b);l.publisher||(l.publisher=s(u.did));const E=await this.getChainInfo(b,_?_.chainInfo:null),S={action:"responseAuth",appInfo:l,iss:s(u.did),challenge:g,agentDid:s(T.address),chainInfo:E,verifiableClaims:d,requestedClaims:v.map(e=>(delete e.chainInfo,e)),url:`${this.baseUrl||h}${f}?${r.stringify({[this.tokenKey]:e,...m})}`},x=t.didwallet?t.didwallet.jwt:void 0,w={appPk:a(u.pk),agentPk:a(T.pk),authInfo:i.sign(T.address,T.sk,S,!0,x)};return p("responseAuth.sign",{context:t,extraParams:m,payload:S,signed:w}),w}_verifyClaims(e){if(!Array.isArray(e)||!e.length)throw new Error("Non-empty verified claims must be provided for agent to sign")}_verifyAuthorizer(e){if(!e||!e.pk||!e.did)throw new Error("Valid authorizer did and pk must be provided for agent to sign")}}},function(e,t,n){const r=n(152);e.exports={re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:n(237).SEMVER_SPEC_VERSION,SemVer:n(49),compareIdentifiers:n(354).compareIdentifiers,rcompareIdentifiers:n(354).rcompareIdentifiers,parse:n(153),valid:n(1412),clean:n(1413),inc:n(1414),diff:n(1415),major:n(1416),minor:n(1417),patch:n(1418),prerelease:n(1419),compare:n(80),rcompare:n(1420),compareLoose:n(1421),compareBuild:n(356),sort:n(1422),rsort:n(1423),gt:n(240),lt:n(357),eq:n(355),neq:n(719),gte:n(358),lte:n(359),cmp:n(720),coerce:n(1424),Comparator:n(241),Range:n(81),satisfies:n(242),toComparators:n(1425),maxSatisfying:n(1426),minSatisfying:n(1427),minVersion:n(1428),validRange:n(1429),outside:n(360),gtr:n(1430),ltr:n(1431),intersects:n(1432),simplifyRange:n(1433),subset:n(1434)}},function(e,t,n){const r=n(153);e.exports=(e,t)=>{const n=r(e,t);return n?n.version:null}},function(e,t,n){const r=n(153);e.exports=(e,t)=>{const n=r(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},function(e,t,n){const r=n(49);e.exports=(e,t,n,o)=>{"string"==typeof n&&(o=n,n=void 0);try{return new r(e,n).inc(t,o).version}catch(e){return null}}},function(e,t,n){const r=n(153),o=n(355);e.exports=(e,t)=>{if(o(e,t))return null;{const n=r(e),o=r(t),i=n.prerelease.length||o.prerelease.length,a=i?"pre":"",s=i?"prerelease":"";for(const e in n)if(("major"===e||"minor"===e||"patch"===e)&&n[e]!==o[e])return a+e;return s}}},function(e,t,n){const r=n(49);e.exports=(e,t)=>new r(e,t).major},function(e,t,n){const r=n(49);e.exports=(e,t)=>new r(e,t).minor},function(e,t,n){const r=n(49);e.exports=(e,t)=>new r(e,t).patch},function(e,t,n){const r=n(153);e.exports=(e,t)=>{const n=r(e,t);return n&&n.prerelease.length?n.prerelease:null}},function(e,t,n){const r=n(80);e.exports=(e,t,n)=>r(t,e,n)},function(e,t,n){const r=n(80);e.exports=(e,t)=>r(e,t,!0)},function(e,t,n){const r=n(356);e.exports=(e,t)=>e.sort((e,n)=>r(e,n,t))},function(e,t,n){const r=n(356);e.exports=(e,t)=>e.sort((e,n)=>r(n,e,t))},function(e,t,n){const r=n(49),o=n(153),{re:i,t:a}=n(152);e.exports=(e,t)=>{if(e instanceof r)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){let t;for(;(t=i[a.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&t.index+t[0].length===n.index+n[0].length||(n=t),i[a.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;i[a.COERCERTL].lastIndex=-1}else n=e.match(i[a.COERCE]);return null===n?null:o(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)}},function(e,t,n){const r=n(81);e.exports=(e,t)=>new r(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},function(e,t,n){const r=n(49),o=n(81);e.exports=(e,t,n)=>{let i=null,a=null,s=null;try{s=new o(t,n)}catch(e){return null}return e.forEach(e=>{s.test(e)&&(i&&-1!==a.compare(e)||(i=e,a=new r(i,n)))}),i}},function(e,t,n){const r=n(49),o=n(81);e.exports=(e,t,n)=>{let i=null,a=null,s=null;try{s=new o(t,n)}catch(e){return null}return e.forEach(e=>{s.test(e)&&(i&&1!==a.compare(e)||(i=e,a=new r(i,n)))}),i}},function(e,t,n){const r=n(49),o=n(81),i=n(240);e.exports=(e,t)=>{e=new o(e,t);let n=new r("0.0.0");if(e.test(n))return n;if(n=new r("0.0.0-0"),e.test(n))return n;n=null;for(let t=0;t<e.set.length;++t){const o=e.set[t];let a=null;o.forEach(e=>{const t=new r(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":a&&!i(t,a)||(a=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}),!a||n&&!i(n,a)||(n=a)}return n&&e.test(n)?n:null}},function(e,t,n){const r=n(81);e.exports=(e,t)=>{try{return new r(e,t).range||"*"}catch(e){return null}}},function(e,t,n){const r=n(360);e.exports=(e,t,n)=>r(e,t,">",n)},function(e,t,n){const r=n(360);e.exports=(e,t,n)=>r(e,t,"<",n)},function(e,t,n){const r=n(81);e.exports=(e,t,n)=>(e=new r(e,n),t=new r(t,n),e.intersects(t))},function(e,t,n){const r=n(242),o=n(80);e.exports=(e,t,n)=>{const i=[];let a=null,s=null;const l=e.sort((e,t)=>o(e,t,n));for(const e of l){r(e,t,n)?(s=e,a||(a=e)):(s&&i.push([a,s]),s=null,a=null)}a&&i.push([a,null]);const u=[];for(const[e,t]of i)e===t?u.push(e):t||e!==l[0]?t?e===l[0]?u.push("<="+t):u.push(`${e} - ${t}`):u.push(">="+e):u.push("*");const p=u.join(" || "),c="string"==typeof t.raw?t.raw:String(t);return p.length<c.length?p:t}},function(e,t,n){const r=n(81),o=n(241),{ANY:i}=o,a=n(242),s=n(80),l=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===i){if(1===t.length&&t[0].semver===i)return!0;e=n.includePrerelease?[new o(">=0.0.0-0")]:[new o(">=0.0.0")]}if(1===t.length&&t[0].semver===i){if(n.includePrerelease)return!0;t=[new o(">=0.0.0")]}const r=new Set;let l,c,d,f,h,g,m;for(const t of e)">"===t.operator||">="===t.operator?l=u(l,t,n):"<"===t.operator||"<="===t.operator?c=p(c,t,n):r.add(t.semver);if(r.size>1)return null;if(l&&c){if(d=s(l.semver,c.semver,n),d>0)return null;if(0===d&&(">="!==l.operator||"<="!==c.operator))return null}for(const e of r){if(l&&!a(e,String(l),n))return null;if(c&&!a(e,String(c),n))return null;for(const r of t)if(!a(e,String(r),n))return!1;return!0}let y=!(!c||n.includePrerelease||!c.semver.prerelease.length)&&c.semver,v=!(!l||n.includePrerelease||!l.semver.prerelease.length)&&l.semver;y&&1===y.prerelease.length&&"<"===c.operator&&0===y.prerelease[0]&&(y=!1);for(const e of t){if(m=m||">"===e.operator||">="===e.operator,g=g||"<"===e.operator||"<="===e.operator,l)if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),">"===e.operator||">="===e.operator){if(f=u(l,e,n),f===e&&f!==l)return!1}else if(">="===l.operator&&!a(l.semver,String(e),n))return!1;if(c)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),"<"===e.operator||"<="===e.operator){if(h=p(c,e,n),h===e&&h!==c)return!1}else if("<="===c.operator&&!a(c.semver,String(e),n))return!1;if(!e.operator&&(c||l)&&0!==d)return!1}return!(l&&g&&!c&&0!==d)&&(!(c&&m&&!l&&0!==d)&&(!v&&!y))},u=(e,t,n)=>{if(!e)return t;const r=s(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},p=(e,t,n)=>{if(!e)return t;const r=s(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,n={})=>{if(e===t)return!0;e=new r(e,n),t=new r(t,n);let o=!1;e:for(const r of e.set){for(const e of t.set){const t=l(r,e,n);if(o=o||null!==t,t)continue e}if(o)return!1}return!0}},function(e,t){function n(e){return(4294967296+e).toString(16).substring(1)}e.exports={normalizeInput:function(e){let t;if(e instanceof Uint8Array)t=e;else{if("string"!=typeof e)throw new Error("Input must be an string, Buffer or Uint8Array");t=(new TextEncoder).encode(e)}return t},toHex:function(e){return Array.prototype.map.call(e,(function(e){return(e<16?"0":"")+e.toString(16)})).join("")},debugPrint:function(e,t,r){let o="\n"+e+" = ";for(let i=0;i<t.length;i+=2){if(32===r)o+=n(t[i]).toUpperCase(),o+=" ",o+=n(t[i+1]).toUpperCase();else{if(64!==r)throw new Error("Invalid size "+r);o+=n(t[i+1]).toUpperCase(),o+=n(t[i]).toUpperCase()}i%6==4?o+="\n"+new Array(e.length+4).join(" "):i<t.length-2&&(o+=" ")}console.log(o)},testSpeed:function(e,t,n){let r=(new Date).getTime();const o=new Uint8Array(t);for(let e=0;e<t;e++)o[e]=e%256;const i=(new Date).getTime();console.log("Generated random input in "+(i-r)+"ms"),r=i;for(let i=0;i<n;i++){const n=e(o),i=(new Date).getTime(),a=i-r;r=i,console.log("Hashed in "+a+"ms: "+n.substring(0,20)+"..."),console.log(Math.round(t/(1<<20)/(a/1e3)*100)/100+" MB PER SECOND")}}}},function(e,t,n){const{EventEmitter:r}=n(24);e.exports=class extends r{constructor({pathTransformer:e,tokenStorage:t,authenticator:n,onConnect:r}){super(),this.authenticator=n,this.tokenStorage=t,this.tokenStorage.on("create",e=>this.emit("created",e)),this.tokenStorage.on("destroy",e=>this.emit("deleted",{token:e})),this.tokenStorage.on("update",async e=>{if(!e)return;const t={scanned:"scanned",succeed:"succeed",forbidden:"failed",error:"failed"};if(t[e.status]){const n=await this.tokenStorage.read(e.token);this.emit(t[e.status],n)}}),this.pathTransformer="function"==typeof e?e:e=>e,this.onConnect="function"==typeof r?r:()=>{}}}},function(e,t,n){const r=n(10)(n(151).name+":handlers:agent"),o=n(717),i=n(718),a=()=>{};e.exports=class extends o{constructor({tokenStorage:e,agentStorage:t,authenticator:n,onConnect:r=a,options:o={}}){o&&!o.prefix&&(o.prefix="/api/agent/:authorizeId"),super({tokenStorage:e,authenticator:n,onConnect:r,options:o}),this.agentStorage=t}attach({app:e,action:t,claims:n,onStart:o=a,onConnect:s,onAuth:l,onDecline:u=a,onComplete:p=a,onExpire:c=a,onError:d=console.error,authPrincipal:f=!0}){if("function"!=typeof l)throw new Error("onAuth callback is required to attach agent handlers");if("function"!=typeof u)throw new Error("onDecline callback is required to attach agent handlers");if("function"!=typeof p)throw new Error("onComplete callback is required to attach agent handlers");const{prefix:h,appKey:g=""}=this.options,m=`${h}/${t}/auth`;r("attach routes",{action:t,prefix:h,pathname:m});const y=async(e,t,n)=>{const r=e.query.authorizeId||e.query[g]||e.params.authorizeId||e.params[g];if(!r)return t.jsonp({error:"App ID is required to start"});const o=await this.agentStorage.read(r);return o?(e.authorizeId=r,e.authorization=o,n()):t.jsonp({error:"App authorization not found"})},{generateSession:v,expireSession:b,checkSession:_,onAuthRequest:T,onAuthResponse:E,ensureContext:S,ensureSignedJson:x}=i({action:t,pathname:m,claims:n,onStart:o,onConnect:s||this.onConnect,onAuth:l,onDecline:u,onComplete:p,onExpire:c,onError:d,getSignParams:e=>{if(!e.authorization)throw new Error("AgentWalletHandlers require valid req.authorization to compose sign params");const{appPk:t,appDid:n,appName:r,appLink:o,appDescription:i,appIcon:a,certificateContent:s}=e.authorization;return{authorizer:{pk:t,did:n},appInfo:{name:r,description:i,icon:a,link:o||""},verifiableClaims:[{type:"certificate",content:s}]}},getPathName:(e,t)=>e.replace("/:authorizeId/",`/${t.authorizeId}/`),authPrincipal:f,options:this.options,pathTransformer:this.pathTransformer,tokenStorage:this.tokenStorage,authenticator:this.authenticator});e.get(`${h}/${t}/token`,y,v),e.post(`${h}/${t}/token`,y,v),e.get(`${h}/${t}/status`,y,S,_),e.get(`${h}/${t}/timeout`,y,S,b),e.get(m,y,S,x,T),e.post(m,y,S,x,E),e.get(m+"/submit",y,S,x,E)}}},function(e,t,n){const r=["autoConnect","connectedDidOnly","sendNotificationFn","options"],o=["onStart"];function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u=n(27),{WalletHandlers:p}=n(713),c=n(1439),d=()=>({});e.exports=class extends p{constructor(e){let{autoConnect:t=!0,connectedDidOnly:n=!1,sendNotificationFn:o,options:i={}}=e,p=s(e,r);t&&n&&(i.sessionDidKey="headers[x-connected-did]"),super(a({options:i},p)),l(this,"getConnectedDid",({req:e,didwallet:t,extraParams:n})=>n&&"false"===n.autoConnect?null:this.enableConnect?(e=>e&&["ios","android"].includes(e.os))(t)?null:u(e,"headers[x-connected-did]"):null),this.enableConnect=!!t,this.sendNotificationFn=o||c.sendToUser.bind(c)}attach(e){let{onStart:t=d}=e,n=s(e,o);super.attach(a({onStart:async e=>{const r=await t(e)||{},o=this.getConnectedDid(e);if(r.connectedDid=o||"",r.saveConnect=this.enableConnect,o){let t="";try{t=new URL(decodeURIComponent(new URL(e.deepLink).searchParams.get("url"))),t.pathname=t.pathname.replace(/auth$/,"status")}catch(e){t="",console.error(e)}const r={type:"connect",url:e.deepLink};t&&(r.checkUrl=t.href),this.sendNotificationFn(o,r,e).catch(e=>{console.error(e),"function"==typeof n.onError&&n.onError(e)})}return r}},n))}}},function(e,t,n){const r=n(141),o=n(24),{WsClient:i}=n(320),a=n(1440),s=n(721),{SERVICE_PREFIX:l}=n(722),u=n(1445),p=new o;let c=null;e.exports={sendToUser:async(e,t,n)=>{a();const r={appId:process.env.BLOCKLET_APP_ID,appSk:process.env.BLOCKLET_APP_SK,did:process.env.BLOCKLET_DID};return s(e,t,r,process.env.ABT_NODE_SERVICE_PORT,n)},on:(e,t)=>(c||(()=>{if(!c){const e=u(),{address:t,publicKey:n,secretKey:o}=e,a=`ws://127.0.0.1:${process.env.ABT_NODE_SERVICE_PORT}${l}`,s=()=>r.sign(t,o,{});c=new i(a,{heartbeatIntervalMs:1e4,params:()=>({token:s(),pk:n})}),c.connect();const d=c.channel(e.address,()=>({token:s(),pk:n}));d.join().receive("error",e=>{const t="join channel error: "+e.message;console.error(t),p.emit("error",{message:t})}).receive("timeout",()=>{const e="join channel timeout";console.error(e),p.emit("error",{message:e})}),d.on("message",({status:e,response:t}={})=>{"ok"===e?p.emit(t.type,t):(p.emit("error",t),console.error({status:e,response:t}))})}})(),p.on(e,t)),off:p.off.bind(p)}},function(e,t){e.exports=()=>{["BLOCKLET_APP_ID","BLOCKLET_APP_NAME","BLOCKLET_APP_DESCRIPTION","BLOCKLET_APP_SK","BLOCKLET_DID","ABT_NODE","ABT_NODE_DID","ABT_NODE_PK","ABT_NODE_PORT","ABT_NODE_SERVICE_PORT"].forEach(e=>{if(!process.env[e])throw new Error(e+" does not exist in environments")})}},function(e,t,n){const{validateNotification:r,validateReceiver:o,validateOption:i}=n(1442);e.exports={validateNotification:r,validateReceiver:o,validateOption:i}},function(e,t,n){const r=n(233),{didExtension:o}=n(1443),i=r.extend(o),a="notification",s="connect",l="feed",u=i.object({did:i.DID().trim().required(),chainHost:i.string().uri().required()}).required(),p=i.object({credential:i.object().required().unknown(!0),tag:i.string()}).required(),c=i.object({address:i.DID().trim().allow(""),amount:i.string().required(),symbol:i.string().required(),senderDid:i.DID().trim().required(),chainHost:i.string().uri().required(),decimal:i.number().integer().required()}).required(),d=i.object({name:i.string().required(),title:i.string(),color:i.string(),bgColor:i.string(),link:i.string().uri()}),f=i.object({type:i.string().required().valid("asset","vc","token"),data:i.object().when("type",{is:"asset",then:u}).concat(i.object().when("type",{is:"vc",then:p})).concat(i.object().when("type",{is:"token",then:c}))}).required(),h=i.object({type:i.string().valid(a),title:i.string(),body:i.string(),attachments:i.array().items(f).default([]),actions:i.array().items(d).default([])}).required(),g=i.object({type:i.string().valid(s),url:i.string().uri().required(),checkUrl:i.string().uri()}).required(),m=i.object({type:i.string().valid(l),feedType:i.string().required(),data:i.object().required()}).required(),y=i.alternatives().try(h,g,m).required(),v=i.object({id:i.string().required(),createdAt:i.date().iso().required(),type:i.string().required(),receiver:i.object({did:i.DID().trim().required()}).required()}).unknown().required(),b=i.DID().trim().required(),_=i.alternatives().try(i.array().items(y),y).required(),T=i.alternatives().try(i.array().items(b),b).required(),E=i.object({keepForOfflineUser:i.boolean()});e.exports={validateReceiver:T.validateAsync.bind(T),validateNotification:_.validateAsync.bind(_),validateMessage:v.validateAsync.bind(v),validateOption:E.validateAsync.bind(E),tokenSchema:c,actionSchema:d,assetSchema:u,vcSchema:p,attachmentSchema:f,notificationSchema:y,messageSchema:v,optionSchema:E}},function(e,t,n){const r=n(17),o=n(9),{isValid:i}=n(35);e.exports={fileExtension:e=>({type:"file",base:e.string(),validate:(e,{error:t})=>e&&"string"==typeof e?{value:e}:{errors:t("file.empty",{file:e})},messages:{"file.empty":'file "{{#file}}" must be non-empty string',"file.enoent":'file "{{#file}}" does not exist',"file.error.generic":'file could not be read. message: "{{#message}}"'},rules:{exists:{multi:!1,method({baseDir:e=null,canSkip:t}={}){return this.$_addRule({name:"exists",args:{baseDir:e,canSkip:t}})},args:[{name:"baseDir",assert:e=>r.existsSync(e),message:"baseDir must exist"},{name:"canSkip",assert:e=>"function"==typeof e,message:"canSkip must be a function"}],validate(e,{error:t},{baseDir:n,canSkip:i}={}){if("function"==typeof i&&i(n,e))return e;try{return r.statSync(o.join(n,e)),e}catch(n){switch(n.code){case"ENOENT":return t("file.enoent",{file:e})}return t("file.error.generic",{message:n.message})}}}}}),didExtension:e=>({type:"DID",base:e.string(),validate:(e,{error:t})=>e&&"string"==typeof e?!1===i(e)?{errors:t("did.invalid",{did:e})}:{value:e}:{errors:t("did.empty",{did:e})},messages:{"did.empty":'did "{{#did}}" must be non-empty string',"did.invalid":'did "{{#did}}" is not valid'}})}},function(e){e.exports=JSON.parse('{"name":"@blocklet/sdk","publishConfig":{"access":"public"},"version":"1.7.22","description":"graphql client to read/write data on abt node","main":"lib/index.js","files":["lib","service"],"scripts":{"lint":"eslint tests lib","lint:fix":"eslint --fix tests lib","test":"node tools/jest.js","coverage":"npm run test -- --coverage"},"author":"linchen1987 <linchen.1987@foxmail.com> (http://github.com/linchen1987)","license":"MIT","dependencies":{"@abtnode/client":"1.7.22","@abtnode/constant":"1.7.22","@abtnode/logger":"1.7.22","@arcblock/did-auth":"^1.16.15","@arcblock/jwt":"^1.16.15","@arcblock/ws":"^1.16.15","@blocklet/meta":"1.7.22","@nedb/core":"^1.2.2","@ocap/mcrypto":"^1.16.15","@ocap/wallet":"^1.16.15","axios":"^0.27.2","fs-extra":"^10.0.1","joi":"^17.6.0","lodash":"^4.17.21","lru-cache":"^6.0.0","url-join":"^4.0.1"},"devDependencies":{"detect-port":"^1.3.0","jest":"^27.4.5"},"gitHead":"6190972e62b5e6b1039aa71a291b3e2c521df367"}')},function(e,t,n){const{fromSecretKey:r,WalletType:o}=n(46),{types:i}=n(28);e.exports=()=>{const e="eth"!==process.env.BLOCKLET_WALLET_TYPE?o({role:i.RoleType.ROLE_APPLICATION,pk:i.KeyType.ED25519,hash:i.HashType.SHA3}):"eth";return r(process.env.BLOCKLET_APP_SK,e)}},function(e,t,n){const r=n(27),{parse:o}=n(177),{NODE_MODES:i,ROLES:a}=n(25),s=e=>e.enableWelcomePage&&e.mode===i.DEBUG,l={getNodeInfo:!0,getBlockletMetaFromUrl:!0,getBlocklets:e=>s(e),getRoutingSites:e=>s(e),resetNode:()=>!1};e.exports={protectGQL:(e,t)=>async(n,s,u)=>{const p=n.query.query||n.body.query;if(p){const u=await e.states.node.read();try{const{definitions:c}=o(p),d=c.map(e=>(r(e,"selectionSet.selections")||[]).map(e=>r(e,"name.value"))).reduce((e,t)=>(e.push(...t),e),[]).filter(e=>"__schema"!==e).filter(e=>"function"==typeof l[e]?!l[e](u):!l[e]);if(!n.user&&d.length)return s.status(401).json({code:"forbidden",error:"not allowed"});if(c.filter(e=>"mutation"===e.operation).length>1)return s.status(403).json({code:"forbidden",error:"batch mutation not allowed"});if(c.some(e=>"mutation"===e.operation)&&[i.MAINTENANCE].includes(u.mode))return s.status(503).json({code:"under maintenance",error:"Blocklet server is under maintenance"});if(n.user&&n.user.role!==a.OWNER&&d.length){const r=await e.getRBAC(),o=await Promise.all(d.map(async e=>!t[e]||!!await r.canAny(n.user.role,t[e].permissions.map(e=>e.split("_")))));if(!o.every(Boolean))return s.status(403).json({code:"forbidden",error:"no permission"})}}catch(e){return console.error("Failed to validate query",{err:e,query:p}),s.json({code:"internal",error:e.message})}}return u()}}},function(e,t,n){function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const i=n(207),a=n(1448),{makeExecutableSchema:s}=n(1512),{GraphQLUpload:l}=n(393),{wipeSensitiveData:u,fixBlockletStatus:p}=n(104),c=n(87),d=n(1457),f=n(40)("@abtnode/gql"),h=n(1458),g=async({name:e,dataKeys:t,callback:n})=>{const a=Date.now();try{const s=await n(),l={};if(Array.isArray(t)?t.forEach(e=>{l[e]=s[e]}):l[t]=s,"blocklet"===t){const e=i(s);p(e),l[t]=u(e)}"blocklets"===t&&(l[t]=i(s||[]).map(e=>(p(e),u(e))));const c=Date.now()-a;return c>2e3&&f.warn("graphql resolver latency",{api:e,time:c+"ms"}),function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({code:"ok"},l)}catch(e){throw f.error("graphql resolver error",{error:e}),e}};e.exports=(e={},t=!0)=>{const n={addRoutingSite:e=>({site:e})},r=Object.entries(e).reduce((e,[t,{dataKeys:r,handler:o}])=>(n[t]?e[t]=({input:e}={},i)=>g({name:t,dataKeys:r,callback:()=>o(n[t](e),c(i))}):e[t]=({input:e}={},n)=>g({name:t,dataKeys:r,callback:()=>o(e,c(n))}),e),{});return a({schema:s({typeDefs:d,resolvers:{Upload:l}}),customFormatErrorFn:e=>(f.error("graphql error",{error:e}),{message:e.message,locations:e.locations,stack:e.stack?e.stack.split("\n"):[],path:e.path}),rootValue:r,graphiql:t})},e.exports.wrapResolver=g,e.exports.formatContext=c,e.exports.genConfig=h},function(e,t,n){"use strict";var r=u(n(30)),o=u(n(249)),i=u(n(102)),a=n(177),s=n(1449),l=n(1456);function u(e){return e&&e.__esModule?e:{default:e}}async function p(e){const t=await(0,s.parseBody)(e);return function(e,t){let n=e.query||t.query;"string"!=typeof n&&(n=null);let r=e.variables||t.variables;if(r&&"string"==typeof r)try{r=JSON.parse(r)}catch(e){throw(0,i.default)(400,"Variables are invalid JSON.")}else"object"!=typeof r&&(r=null);let o=e.operationName||t.operationName;"string"!=typeof o&&(o=null);const a=void 0!==e.raw||void 0!==t.raw;return{query:n,variables:r,operationName:o,raw:a}}(e.url&&r.default.parse(e.url,!0).query||{},t)}function c(e,t,n){const r=Buffer.from(n,"utf8");e.setHeader("Content-Type",t+"; charset=utf-8"),e.setHeader("Content-Length",String(r.length)),e.end(r)}e.exports=function(e){if(!e)throw new Error("GraphQL middleware requires options.");return function(t,n){let r,s,u,d,f,h,g,m,y=a.formatError,v=a.validate,b=a.execute,_=a.parse,T=!1;return p(t).then(e=>(s=e,E(s)),e=>E({query:null,variables:null,operationName:null,raw:null}).then(()=>Promise.reject(e))).then(e=>{if(!e.schema)throw new Error("GraphQL middleware options must contain a schema.");const l=e.schema,u=e.rootValue,p=e.fieldResolver,c=e.typeResolver,d=e.validationRules||[],y=e.graphiql;if(r=e.context||t,"GET"!==t.method&&"POST"!==t.method)throw n.setHeader("Allow","GET, POST"),(0,i.default)(405,"GraphQL only supports GET and POST requests.");if(f=s.query,g=s.variables,m=s.operationName,T=function(e,t){return!t.raw&&"html"===(0,o.default)(e).types(["json","html"])}(t,s)&&y,!f){if(T)return null;throw(0,i.default)(400,"Must provide query string.")}const E=(0,a.validateSchema)(l);if(E.length>0)return n.statusCode=500,{errors:E};const S=new a.Source(f,"GraphQL request");try{h=_(S)}catch(e){return n.statusCode=400,{errors:[e]}}const x=v(l,h,[...a.specifiedRules,...d]);if(x.length>0)return n.statusCode=400,{errors:x};if("GET"===t.method){const e=(0,a.getOperationAST)(h,m);if(e&&"query"!==e.operation){if(T)return null;throw n.setHeader("Allow","POST"),(0,i.default)(405,`Can only perform a ${e.operation} operation from a POST request.`)}}try{return b({schema:l,document:h,rootValue:u,contextValue:r,variableValues:g,operationName:m,fieldResolver:p,typeResolver:c})}catch(e){return n.statusCode=400,{errors:[e]}}}).then(e=>e&&d?Promise.resolve(d({document:h,variables:g,operationName:m,result:e,context:r})).then(t=>(t&&"object"==typeof t&&(e.extensions=t),e)):e).catch(e=>(n.statusCode=e.status||500,{errors:[e]})).then(e=>{if(200===n.statusCode&&e&&!e.data&&(n.statusCode=500),e&&e.errors&&(e.errors=e.errors.map(y)),T){const t=(0,l.renderGraphiQL)({query:f,variables:g,operationName:m,result:e,options:"boolean"!=typeof T?T:{}});return c(n,"text/html",t)}if(!e)throw(0,i.default)(500,"Internal Error");if(u||"function"!=typeof n.json){const t=JSON.stringify(e,null,u?2:0);c(n,"application/json",t)}else n.json(e)});async function E(r){const o="function"==typeof e?e(t,n,r):e,i=await o;if(!i||"object"!=typeof i)throw new Error("GraphQL middleware option function must return an options object or a promise which will be resolved to an options object.");return i.formatError&&console.warn("`formatError` is deprecated and replaced by `customFormatErrorFn`. It will be removed in version 1.0.0."),v=i.customValidateFn||v,b=i.customExecuteFn||b,_=i.customParseFn||_,y=i.customFormatErrorFn||i.formatError||y,d=i.extensions,u=i.pretty,i}}},e.exports.getGraphQLParams=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseBody=async function(e){const{body:t}=e;if("object"==typeof t&&!(t instanceof Buffer))return t;if(void 0===e.headers["content-type"])return{};const n=s.default.parse(e);if("string"==typeof t&&"application/graphql"===n.type)return{query:t};if(t)return{};const l=await async function(e,t){const n=(t.parameters.charset||"utf-8").toLowerCase();if("utf-"!==n.slice(0,4))throw(0,i.default)(415,`Unsupported charset "${n.toUpperCase()}".`);const a=e.headers["content-encoding"],s="string"==typeof a?a.toLowerCase():"identity",l="identity"===s?e.headers["content-length"]:null,u=function(e,t){switch(t){case"identity":return e;case"deflate":return e.pipe(r.default.createInflate());case"gzip":return e.pipe(r.default.createGunzip())}throw(0,i.default)(415,`Unsupported content-encoding "${t}".`)}(e,s);try{return await(0,o.default)(u,{encoding:n,length:l,limit:102400})}catch(e){throw"encoding.unsupported"===e.type?(0,i.default)(415,`Unsupported charset "${n.toUpperCase()}".`):(0,i.default)(400,`Invalid body: ${e.message}.`)}}(e,n);switch(n.type){case"application/graphql":return{query:l};case"application/json":if(u.test(l))try{return JSON.parse(l)}catch(e){}throw(0,i.default)(400,"POST body sent invalid JSON.");case"application/x-www-form-urlencoded":return a.default.parse(l)}return{}};var r=l(n(41)),o=l(n(1450)),i=l(n(102)),a=l(n(163)),s=l(n(159));function l(e){return e&&e.__esModule?e:{default:e}}const u=/^[ \t\n\r]*\{/},function(e,t,n){"use strict";
|
|
697
|
+
*/var r=n(17),o=n(9),i=n(4),a=n(20),s=n(24),l={};e.exports=l;var u=["daily","test","m","h","custom"];function p(e,t){if(e.hash===a.createHash(e.hashType).update(e.name+"LOG_FILE"+e.date).digest("hex"))try{r.existsSync(e.name)&&r.unlinkSync(e.name)}catch(n){t&&console.error(new Date,"[FileStreamRotator] Could not remove old log file: ",e.name)}}l.getFrequency=function(e){var t=e.toLowerCase().match(/^(\d+)([mh])$/);if(t)return function(e,t){if("number"==typeof t){switch(e){case"m":if(t<0||t>60)return!1;break;case"h":if(t<0||t>24)return!1}return{type:e,digit:t}}}(t[2],parseInt(t[1]));var n=function(e){switch(e){case"custom":case"daily":return{type:e,digit:void 0};case"test":return{type:e,digit:0}}return!1}(e);return n||!1},l.parseFileSize=function(e){if(e&&"string"==typeof e){var t=e.toLowerCase().match(/^((?:0\.)?\d+)([kmg])$/);if(t)switch(t[2]){case"k":return 1024*t[1];case"m":return 1024*t[1]*1024;case"g":return 1024*t[1]*1024*1024}}return null},l.getDate=function(e,t,n){t=t||"YYYYMMDDHHmm";let r=n?i.utc():i().local();if(e&&-1!==u.indexOf(e.type))switch(e.type){case"m":var o=Math.floor(r.minutes()/e.digit)*e.digit;return r.minutes(o).format(t);case"h":var a=Math.floor(r.hour()/e.digit)*e.digit;return r.hour(a).format(t);case"daily":case"custom":case"test":return r.format(t)}return r.format(t)},l.setAuditLog=function(e,t,n){var i=null;if(e){var a=e.toString().substr(-1),s=e.toString().match(/^(\d+)/);if(Number(s[1])>0){var l=o.dirname(n.replace(/%DATE%.+/,"_filename"));try{if(t){var u=o.resolve(t);i=JSON.parse(r.readFileSync(u,{encoding:"utf-8"}))}else{u=o.resolve(l+"/.audit.json");i=JSON.parse(r.readFileSync(u,{encoding:"utf-8"}))}}catch(e){if("ENOENT"!==e.code)return null;i={keep:{days:!1,amount:Number(s[1])},auditLog:t||l+"/.audit.json",files:[]}}i.keep={days:"d"===a,amount:Number(s[1])}}}return i},l.writeAuditLog=function(e,t){try{c(e.auditLog),r.writeFileSync(e.auditLog,JSON.stringify(e,null,4))}catch(n){t&&console.error(new Date,"[FileStreamRotator] Failed to store log audit at:",e.auditLog,"Error:",n)}},l.addLogToAudit=function(e,t,n,r){if(t&&t.files){if(-1!==t.files.findIndex((function(t){return t.name===e})))return t;var o=Date.now();if(t.files.push({date:o,name:e,hash:a.createHash(t.hashType).update(e+"LOG_FILE"+o).digest("hex")}),t.keep.days){var s=i().subtract(t.keep.amount,"days").valueOf(),u=t.files.filter((function(e){return e.date>s||(e.hashType=t.hashType,p(e,r),n.emit("logRemoved",e),!1)}));t.files=u}else{var c=t.files.splice(-t.keep.amount);t.files.length>0&&t.files.filter((function(e){return e.hashType=t.hashType,p(e,r),n.emit("logRemoved",e),!1})),t.files=c}l.writeAuditLog(t,r)}return t},l.getStream=function(e){var t=null,a=null,p=this;if(!e.filename)return console.error(new Date,"[FileStreamRotator] No filename supplied. Defaulting to STDOUT"),process.stdout;e.frequency&&(t=p.getFrequency(e.frequency));let f=p.setAuditLog(e.max_logs,e.audit_file,e.filename);null!=f&&(f.hashType=void 0!==e.audit_hash_type?e.audit_hash_type:"md5"),p.verbose=void 0===e.verbose||e.verbose;var h=null,g=0,m=0;e.size&&(h=l.parseFileSize(e.size));var y=e.date_format||"YYYYMMDDHHmm";t&&"daily"==t.type&&(e.date_format||(y="YYYY-MM-DD"),i().format(y)==i().endOf("day").format(y)&&i().format(y)!=i().add(1,"day").format(y)||(p.verbose&&console.log(new Date,"[FileStreamRotator] Changing type to custom as date format changes more often than once a day or not every day"),t.type="custom")),t&&(a=e.frequency?p.getDate(t,y,e.utc):""),e.create_symlink=e.create_symlink||!1,e.extension=e.extension||"";var v=e.filename,b=null,_=v+(a?"."+a:"");if(v.match(/%DATE%/)&&(_=v.replace(/%DATE%/g,a||p.getDate(null,y,e.utc))),h){var T=null,E=_;if(f&&f.files&&f.files instanceof Array&&f.files.length>0){var S=f.files[f.files.length-1].name;if(S.match(E)){var x=S.match(E+"\\.(\\d+)");x&&(E=S,g=x[1])}}for(0==g&&E==_&&(E+=e.extension);r.existsSync(E);)T=E,g++,E=_+"."+g+e.extension;if(T){var w=r.statSync(T);w.size<h&&(E=T,g--,m=w.size)}_=E}else _+=e.extension;p.verbose&&console.log(new Date,"[FileStreamRotator] Logging to: ",_),c(_);var A=e.file_options||{flags:"a"},k=r.createWriteStream(_,A);if(a&&t&&u.indexOf(t.type)>-1||h>0){p.verbose&&console.log(new Date,"[FileStreamRotator] Rotating file: ",t?t.type:"",h?"size: "+h:"");var M,O=new s;return O.auditLog=f,O.end=function(){k.end.apply(k,arguments)},d(k,O),O.on("close",(function(){M&&M.close()})),O.on("new",(function(t){O.auditLog=p.addLogToAudit(t,O.auditLog,O,p.verbose),e.create_symlink&&function(e,t,n){let i=t||"current.log",a=o.dirname(e),s=o.basename(e),l=a+"/"+i;try{r.lstatSync(l).isSymbolicLink()&&(r.unlinkSync(l),r.symlinkSync(s,l))}catch(e){if(e&&"ENOENT"==e.code)try{r.symlinkSync(s,l)}catch(e){n&&console.error(new Date,"[FileStreamRotator] Could not create symlink file: ",l," -> ",s)}}}(t,e.symlink_name,p.verbose),e.watch_log&&O.emit("addWatcher",t)})),O.on("addWatcher",(function(t){M&&M.close(),e.watch_log&&(M=function(e,t,n){if(!e)return null;try{r.lstatSync(e);return r.watch(e,(function(t,o){if("rename"==t)try{r.lstatSync(e)}catch(t){n(t,e)}}))}catch(n){t&&console.log(new Date,"[FileStreamRotator] Could not add watcher for "+e)}}(t,p.verbose,(function(e,t){O.emit("createLog",t)})))})),O.on("createLog",(function(e){try{r.lstatSync(e)}catch(t){k&&"function"==k.end&&k.end(),k=r.createWriteStream(e,A),O.emit("new",e),d(k,O)}})),O.write=function(o,i){var s=t?this.getDate(t,y,e.utc):a;if(s!=a||h&&m>h){var l=v+(a&&t?"."+s:"");v.match(/%DATE%/)&&a&&(l=v.replace(/%DATE%/g,s)),h&&m>h?l+="."+ ++g+e.extension:(g=0,l+=e.extension),m=0,p.verbose&&console.log(new Date,n(8).format("[FileStreamRotator] Changing logs from %s to %s",_,l)),a=s,b=_,_=l,!0===e.end_stream?k.end():k.destroy(),c(_),k=r.createWriteStream(l,A),O.emit("new",l),O.emit("rotate",b,l),d(k,O)}k.write(o,i),m+=Buffer.byteLength(o,i)}.bind(this),process.nextTick((function(){O.emit("new",_)})),O.emit("new",_),O}return p.verbose&&console.log(new Date,"[FileStreamRotator] File won't be rotated: ",e.frequency,e.size),process.nextTick((function(){k.emit("new",_)})),k};var c=function(e){o.dirname(e).split(o.sep).reduce((function(e,t){if(e+=t+o.sep,!r.existsSync(e))try{r.mkdirSync(e)}catch(e){if("EEXIST"!==e.code)throw e}return e}),"")},d=function(e,t){e.on("close",(function(){t.emit("close")})),e.on("finish",(function(){t.emit("finish")})),e.on("error",(function(e){t.emit("error",e)})),e.on("open",(function(e){t.emit("open",e)}))}},function(e,t,n){var r={"./af":551,"./af.js":551,"./ar":552,"./ar-dz":553,"./ar-dz.js":553,"./ar-kw":554,"./ar-kw.js":554,"./ar-ly":555,"./ar-ly.js":555,"./ar-ma":556,"./ar-ma.js":556,"./ar-sa":557,"./ar-sa.js":557,"./ar-tn":558,"./ar-tn.js":558,"./ar.js":552,"./az":559,"./az.js":559,"./be":560,"./be.js":560,"./bg":561,"./bg.js":561,"./bm":562,"./bm.js":562,"./bn":563,"./bn-bd":564,"./bn-bd.js":564,"./bn.js":563,"./bo":565,"./bo.js":565,"./br":566,"./br.js":566,"./bs":567,"./bs.js":567,"./ca":568,"./ca.js":568,"./cs":569,"./cs.js":569,"./cv":570,"./cv.js":570,"./cy":571,"./cy.js":571,"./da":572,"./da.js":572,"./de":573,"./de-at":574,"./de-at.js":574,"./de-ch":575,"./de-ch.js":575,"./de.js":573,"./dv":576,"./dv.js":576,"./el":577,"./el.js":577,"./en-au":578,"./en-au.js":578,"./en-ca":579,"./en-ca.js":579,"./en-gb":580,"./en-gb.js":580,"./en-ie":581,"./en-ie.js":581,"./en-il":582,"./en-il.js":582,"./en-in":583,"./en-in.js":583,"./en-nz":584,"./en-nz.js":584,"./en-sg":585,"./en-sg.js":585,"./eo":586,"./eo.js":586,"./es":587,"./es-do":588,"./es-do.js":588,"./es-mx":589,"./es-mx.js":589,"./es-us":590,"./es-us.js":590,"./es.js":587,"./et":591,"./et.js":591,"./eu":592,"./eu.js":592,"./fa":593,"./fa.js":593,"./fi":594,"./fi.js":594,"./fil":595,"./fil.js":595,"./fo":596,"./fo.js":596,"./fr":597,"./fr-ca":598,"./fr-ca.js":598,"./fr-ch":599,"./fr-ch.js":599,"./fr.js":597,"./fy":600,"./fy.js":600,"./ga":601,"./ga.js":601,"./gd":602,"./gd.js":602,"./gl":603,"./gl.js":603,"./gom-deva":604,"./gom-deva.js":604,"./gom-latn":605,"./gom-latn.js":605,"./gu":606,"./gu.js":606,"./he":607,"./he.js":607,"./hi":608,"./hi.js":608,"./hr":609,"./hr.js":609,"./hu":610,"./hu.js":610,"./hy-am":611,"./hy-am.js":611,"./id":612,"./id.js":612,"./is":613,"./is.js":613,"./it":614,"./it-ch":615,"./it-ch.js":615,"./it.js":614,"./ja":616,"./ja.js":616,"./jv":617,"./jv.js":617,"./ka":618,"./ka.js":618,"./kk":619,"./kk.js":619,"./km":620,"./km.js":620,"./kn":621,"./kn.js":621,"./ko":622,"./ko.js":622,"./ku":623,"./ku.js":623,"./ky":624,"./ky.js":624,"./lb":625,"./lb.js":625,"./lo":626,"./lo.js":626,"./lt":627,"./lt.js":627,"./lv":628,"./lv.js":628,"./me":629,"./me.js":629,"./mi":630,"./mi.js":630,"./mk":631,"./mk.js":631,"./ml":632,"./ml.js":632,"./mn":633,"./mn.js":633,"./mr":634,"./mr.js":634,"./ms":635,"./ms-my":636,"./ms-my.js":636,"./ms.js":635,"./mt":637,"./mt.js":637,"./my":638,"./my.js":638,"./nb":639,"./nb.js":639,"./ne":640,"./ne.js":640,"./nl":641,"./nl-be":642,"./nl-be.js":642,"./nl.js":641,"./nn":643,"./nn.js":643,"./oc-lnc":644,"./oc-lnc.js":644,"./pa-in":645,"./pa-in.js":645,"./pl":646,"./pl.js":646,"./pt":647,"./pt-br":648,"./pt-br.js":648,"./pt.js":647,"./ro":649,"./ro.js":649,"./ru":650,"./ru.js":650,"./sd":651,"./sd.js":651,"./se":652,"./se.js":652,"./si":653,"./si.js":653,"./sk":654,"./sk.js":654,"./sl":655,"./sl.js":655,"./sq":656,"./sq.js":656,"./sr":657,"./sr-cyrl":658,"./sr-cyrl.js":658,"./sr.js":657,"./ss":659,"./ss.js":659,"./sv":660,"./sv.js":660,"./sw":661,"./sw.js":661,"./ta":662,"./ta.js":662,"./te":663,"./te.js":663,"./tet":664,"./tet.js":664,"./tg":665,"./tg.js":665,"./th":666,"./th.js":666,"./tk":667,"./tk.js":667,"./tl-ph":668,"./tl-ph.js":668,"./tlh":669,"./tlh.js":669,"./tr":670,"./tr.js":670,"./tzl":671,"./tzl.js":671,"./tzm":672,"./tzm-latn":673,"./tzm-latn.js":673,"./tzm.js":672,"./ug-cn":674,"./ug-cn.js":674,"./uk":675,"./uk.js":675,"./ur":676,"./ur.js":676,"./uz":677,"./uz-latn":678,"./uz-latn.js":678,"./uz.js":677,"./vi":679,"./vi.js":679,"./x-pseudo":680,"./x-pseudo.js":680,"./yo":681,"./yo.js":681,"./zh-cn":682,"./zh-cn.js":682,"./zh-hk":683,"./zh-hk.js":683,"./zh-mo":684,"./zh-mo.js":684,"./zh-tw":685,"./zh-tw.js":685};function o(e){var t=i(e);return n(t)}function i(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}o.keys=function(){return Object.keys(r)},o.resolve=i,e.exports=o,o.id=1322},function(e,t,n){const{transports:r}=n(338);n(550),e.exports=class extends r.DailyRotateFile{constructor(e){super(e),e.ignoreLevels?this.ignoreLevels=Array.isArray(e.ignoreLevels)?e.ignoreLevels:[e.ignoreLevels]:this.ignoreLevels=[]}log(e,t){(this.ignoreLevels||[]).includes(e.level)?t():super.log(e,t)}}},function(e,t){const n=e=>{e.setDate(e.getDate()-1);return{year:e.getFullYear().toString(),month:(e.getMonth()+1).toString().padStart(2,0),day:e.getDate().toString().padStart(2,0)}};e.exports={getPreDate:n,accessLogFilenameGenerator:(e,t)=>{if(!e)return"access.log";const{year:r,month:o,day:i}=n(e);let a=`access-${r}-${o}-${i}`;return t>1&&(a=`${a}-${t}`),a+".log.gz"}}},function(e,t,n){"use strict";e.exports=function(...e){try{return JSON.stringify.apply(null,e)}catch(e){return"[Cannot display object: "+e.message+"]"}}},function(e){e.exports=JSON.parse('{"name":"joi","description":"Object schema validation","version":"17.6.0","repository":"git://github.com/sideway/joi","main":"lib/index.js","types":"lib/index.d.ts","browser":"dist/joi-browser.min.js","files":["lib/**/*","dist/*"],"keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"^9.0.0","@hapi/topo":"^5.0.0","@sideway/address":"^4.1.3","@sideway/formula":"^3.0.0","@sideway/pinpoint":"^2.0.0"},"devDependencies":{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"24.x.x","typescript":"4.3.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"license":"BSD-3-Clause"}')},function(e,t,n){"use strict";const r={};e.exports=function(e){if(!e)return"";let t="";for(let n=0;n<e.length;++n){const o=e.charCodeAt(n);r.isSafe(o)?t+=e[n]:t+=r.escapeHtmlChar(o)}return t},r.escapeHtmlChar=function(e){const t=r.namedHtml[e];if(void 0!==t)return t;if(e>=256)return"&#"+e+";";return`&#x${e.toString(16).padStart(2,"0")};`},r.isSafe=function(e){return void 0!==r.safeCharCodes[e]},r.namedHtml={38:"&",60:"<",62:">",34:""",160:" ",162:"¢",163:"£",164:"¤",169:"©",174:"®"},r.safeCharCodes=function(){const e={};for(let t=32;t<123;++t)(t>=97||t>=65&&t<=90||t>=48&&t<=57||32===t||46===t||44===t||45===t||58===t||95===t)&&(e[t]=null);return e}()},function(e,t,n){"use strict";const r={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*\.?[0-9]*){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};t.Parser=class{constructor(e,t={}){if(!t[r.settings]&&t.constants)for(const e in t.constants){const n=t.constants[e];if(null!==n&&!["boolean","number","string"].includes(typeof n))throw new Error(`Formula constant ${e} contains invalid ${typeof n} value type`)}this.settings=t[r.settings]?t:Object.assign({[r.settings]:!0,constants:{},functions:{}},t),this.single=null,this._parts=null,this._parse(e)}_parse(e){let n=[],o="",i=0,a=!1;const s=e=>{if(i)throw new Error("Formula missing closing parenthesis");const s=n.length?n[n.length-1]:null;if(a||o||e){if(s&&"reference"===s.type&&")"===e)return s.type="function",s.value=this._subFormula(o,s.value),void(o="");if(")"===e){const e=new t.Parser(o,this.settings);n.push({type:"segment",value:e})}else if(a){if("]"===a)return n.push({type:"reference",value:o}),void(o="");n.push({type:"literal",value:o})}else if(r.operatorCharacters.includes(o))s&&"operator"===s.type&&r.operators.includes(s.value+o)?s.value+=o:n.push({type:"operator",value:o});else if(o.match(r.numberRx))n.push({type:"constant",value:parseFloat(o)});else if(void 0!==this.settings.constants[o])n.push({type:"constant",value:this.settings.constants[o]});else{if(!o.match(r.tokenRx))throw new Error("Formula contains invalid token: "+o);n.push({type:"reference",value:o})}o=""}};for(const t of e)a?t===a?(s(),a=!1):o+=t:i?"("===t?(o+=t,++i):")"===t?(--i,i?o+=t:s(t)):o+=t:t in r.literals?a=r.literals[t]:"("===t?(s(),++i):r.operatorCharacters.includes(t)?(s(),o=t,s()):" "!==t?o+=t:s();s(),n=n.map((e,t)=>"operator"!==e.type||"-"!==e.value||t&&"operator"!==n[t-1].type?e:{type:"operator",value:"n"});let l=!1;for(const e of n){if("operator"===e.type){if(r.operatorsPrefix.includes(e.value))continue;if(!l)throw new Error("Formula contains an operator in invalid position");if(!r.operators.includes(e.value))throw new Error("Formula contains an unknown operator "+e.value)}else if(l)throw new Error("Formula missing expected operator");l=!l}if(!l)throw new Error("Formula contains invalid trailing operator");1===n.length&&["reference","literal","constant"].includes(n[0].type)&&(this.single={type:"reference"===n[0].type?"reference":"value",value:n[0].value}),this._parts=n.map(e=>{if("operator"===e.type)return r.operatorsPrefix.includes(e.value)?e:e.value;if("reference"!==e.type)return e.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(e.value))throw new Error("Formula contains invalid reference "+e.value);return this.settings.reference?this.settings.reference(e.value):r.reference(e.value)})}_subFormula(e,n){const o=this.settings.functions[n];if("function"!=typeof o)throw new Error("Formula contains unknown function "+n);let i=[];if(e){let t="",o=0,a=!1;const s=()=>{if(!t)throw new Error(`Formula contains function ${n} with invalid arguments ${e}`);i.push(t),t=""};for(let n=0;n<e.length;++n){const i=e[n];a?(t+=i,i===a&&(a=!1)):i in r.literals&&!o?(t+=i,a=r.literals[i]):","!==i||o?(t+=i,"("===i?++o:")"===i&&--o):s()}s()}return i=i.map(e=>new t.Parser(e,this.settings)),function(e){const t=[];for(const n of i)t.push(n.evaluate(e));return o.call(e,...t)}}evaluate(e){const t=this._parts.slice();for(let n=t.length-2;n>=0;--n){const o=t[n];if(o&&"operator"===o.type){const i=t[n+1];t.splice(n+1,1);const a=r.evaluate(i,e);t[n]=r.single(o.value,a)}}return r.operatorsOrder.forEach(n=>{for(let o=1;o<t.length-1;)if(n.includes(t[o])){const n=t[o],i=r.evaluate(t[o-1],e),a=r.evaluate(t[o+1],e);t.splice(o,2);const s=r.calculate(n,i,a);t[o-1]=0===s?0:s}else o+=2}),r.evaluate(t[0],e)}},t.Parser.prototype[r.symbol]=!0,r.reference=function(e){return function(t){return t&&void 0!==t[e]?t[e]:null}},r.evaluate=function(e,t){return null===e?null:"function"==typeof e?e(t):e[r.symbol]?e.evaluate(t):e},r.single=function(e,t){if("!"===e)return!t;const n=-t;return 0===n?0:n},r.calculate=function(e,t,n){if("??"===e)return r.exists(t)?t:n;if("string"==typeof t||"string"==typeof n){if("+"===e)return(t=r.exists(t)?t:"")+(n=r.exists(n)?n:"")}else switch(e){case"^":return Math.pow(t,n);case"*":return t*n;case"/":return t/n;case"%":return t%n;case"+":return t+n;case"-":return t-n}switch(e){case"<":return t<n;case"<=":return t<=n;case">":return t>n;case">=":return t>=n;case"==":return t===n;case"!=":return t!==n;case"&&":return t&&n;case"||":return t||n}return null},r.exists=function(e){return null!=e}},function(e,t,n){"use strict";const r=n(58),o=n(22),i={annotations:Symbol("annotations")};t.error=function(e){if(!this._original||"object"!=typeof this._original)return this.details[0].message;const t=e?"":"[31m",n=e?"":"[41m",a=e?"":"[0m",s=r(this._original);for(let e=this.details.length-1;e>=0;--e){const t=e+1,n=this.details[e],r=n.path;let a=s;for(let e=0;;++e){const s=r[e];if(o.isSchema(a)&&(a=a.clone()),!(e+1<r.length&&"string"!=typeof a[s])){const e=a[i.annotations]||{errors:{},missing:{}};a[i.annotations]=e;const r=s||n.context.key;void 0!==a[s]?(e.errors[r]=e.errors[r]||[],e.errors[r].push(t)):e.missing[r]=t;break}a=a[s]}}const l=/_\$key\$_([, \d]+)_\$end\$_"/g,u=/"_\$miss\$_([^|]+)\|(\d+)_\$end\$_": "__missing__"/g,p=/\s*"_\$idx\$_([, \d]+)_\$end\$_",?\n(.*)/g,c=/"\[(NaN|Symbol.*|-?Infinity|function.*|\(.*)]"/g;let d=i.safeStringify(s,2).replace(l,(e,n)=>`" ${t}[${n}]${a}`).replace(u,(e,r,o)=>`${n}"${r}"${a}${t} [${o}]: -- missing --${a}`).replace(p,(e,n,r)=>`\n${r} ${t}[${n}]${a}`).replace(c,(e,t)=>t);d=`${d}\n${t}`;for(let e=0;e<this.details.length;++e){d=`${d}\n[${e+1}] ${this.details[e].message}`}return d+=a,d},i.safeStringify=function(e,t){return JSON.stringify(e,i.serializer(),t)},i.serializer=function(){const e=[],t=[],n=(n,r)=>t[0]===r?"[Circular ~]":"[Circular ~."+e.slice(0,t.indexOf(r)).join(".")+"]";return function(r,o){if(t.length>0){const i=t.indexOf(this);~i?(t.length=i+1,e.length=i+1,e[i]=r):(t.push(this),e.push(r)),~t.indexOf(o)&&(o=n.call(this,r,o))}else t.push(o);if(o){const e=o[i.annotations];if(e){if(Array.isArray(o)){const t=[];for(let n=0;n<o.length;++n)e.errors[n]&&t.push(`_$idx$_${e.errors[n].sort().join(", ")}_$end$_`),t.push(o[n]);o=t}else{for(const t in e.errors)o[`${t}_$key$_${e.errors[t].sort().join(", ")}_$end$_`]=o[t],o[t]=void 0;for(const t in e.missing)o[`_$miss$_${t}|${e.missing[t]}_$end$_`]="__missing__"}return o}}return o===1/0||o===-1/0||Number.isNaN(o)||"function"==typeof o||"symbol"==typeof o?"["+o.toString()+"]":o}}},function(e,t,n){"use strict";t.location=function(e=0){const t=Error.prepareStackTrace;Error.prepareStackTrace=(e,t)=>t;const n={};Error.captureStackTrace(n,this);const r=n.stack[e+1];return Error.prepareStackTrace=t,{filename:r.getFileName(),line:r.getLineNumber()}}},function(e,t,n){"use strict";const r=n(16),o=n(348),i=n(79),a=n(22),s=n(149),l=n(106),u=n(107),p={};e.exports=i.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:u.toSibling}},args:(e,...t)=>1===t.length&&Array.isArray(t[0])?e.try(...t[0]):e.try(...t),validate(e,t){const{schema:n,error:r,state:i,prefs:a}=t;if(n._flags.match){const t=[],s=[];for(let r=0;r<n.$_terms.matches.length;++r){const o=n.$_terms.matches[r],l=i.nest(o.schema,"match."+r);l.snapshot();const u=o.schema.$_validate(e,l,a);u.errors?(s.push(u.errors),l.restore()):t.push(u.value)}if(0===t.length){return{errors:r("alternatives.any",{details:s.map(e=>l.details(e,{override:!1}))})}}if("one"===n._flags.match)return 1===t.length?{value:t[0]}:{errors:r("alternatives.one")};if(t.length!==n.$_terms.matches.length){return{errors:r("alternatives.all",{details:s.map(e=>l.details(e,{override:!1}))})}}const u=e=>e.$_terms.matches.some(e=>"object"===e.schema.type||"alternatives"===e.schema.type&&u(e.schema));return u(n)?{value:t.reduce((e,t)=>o(e,t,{mergeArrays:!1}))}:{value:t[t.length-1]}}const s=[];for(let t=0;t<n.$_terms.matches.length;++t){const r=n.$_terms.matches[t];if(r.schema){const n=i.nest(r.schema,"match."+t);n.snapshot();const o=r.schema.$_validate(e,n,a);if(!o.errors)return o;n.restore(),s.push({schema:r.schema,reports:o.errors});continue}const o=r.ref?r.ref.resolve(e,i,a):e,l=r.is?[r]:r.switch;for(let n=0;n<l.length;++n){const s=l[n],{is:u,then:p,otherwise:c}=s,d=`match.${t}${r.switch?"."+n:""}`;if(u.$_match(o,i.nest(u,d+".is"),a)){if(p)return p.$_validate(e,i.nest(p,d+".then"),a)}else if(c)return c.$_validate(e,i.nest(c,d+".otherwise"),a)}}return p.errors(s,t)},rules:{conditional:{method(e,t){r(!this._flags._endedSwitch,"Unreachable condition"),r(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),r(void 0===t.break,"Cannot use break option with alternatives conditional");const n=this.clone(),o=s.when(n,e,t),i=o.is?[o]:o.switch;for(const e of i)if(e.then&&e.otherwise){n.$_setFlag("_endedSwitch",!0,{clone:!1});break}return n.$_terms.matches.push(o),n.$_mutateRebuild()}},match:{method(e){if(r(["any","one","all"].includes(e),"Invalid alternatives match mode",e),"any"!==e)for(const t of this.$_terms.matches)r(t.schema,"Cannot combine match mode",e,"with conditional rules");return this.$_setFlag("match",e)}},try:{method(...e){r(e.length,"Missing alternative schemas"),a.verifyFlat(e,"try"),r(!this._flags._endedSwitch,"Unreachable condition");const t=this.clone();for(const n of e)t.$_terms.matches.push({schema:t.$_compile(n)});return t.$_mutateRebuild()}}},overrides:{label(e){return this.$_parent("label",e).$_modify({each:(t,n)=>"is"!==n.path[0]?t.label(e):void 0,ref:!1})}},rebuild(e){e.$_modify({each:t=>{a.isSchema(t)&&"array"===t.type&&e.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(e,t){if(t.matches)for(const n of t.matches){const{schema:t,ref:r,is:o,not:i,then:a,otherwise:s}=n;e=t?e.try(t):r?e.conditional(r,{is:o,then:a,not:i,otherwise:s,switch:n.switch}):e.conditional(o,{then:a,otherwise:s})}return e}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),p.errors=function(e,{error:t,state:n}){if(!e.length)return{errors:t("alternatives.any")};if(1===e.length)return{errors:e[0].reports};const r=new Set,o=[];for(const{reports:i,schema:a}of e){if(i.length>1)return p.unmatched(e,t);const s=i[0];if(s instanceof l.Report==!1)return p.unmatched(e,t);if(s.state.path.length!==n.path.length){o.push({type:a.type,report:s});continue}if("any.only"===s.code){for(const e of s.local.valids)r.add(e);continue}const[u,c]=s.code.split(".");"base"===c?r.add(u):o.push({type:a.type,report:s})}return o.length?1===o.length?{errors:o[0].report}:p.unmatched(e,t):{errors:t("alternatives.types",{types:[...r]})}},p.unmatched=function(e,t){const n=[];for(const t of e)n.push(...t.reports);return{errors:t("alternatives.match",l.details(n,{override:!1}))}}},function(e,t,n){"use strict";const r=n(16),o=n(58),i=n(234),a=n(348),s=n(690),l=n(22),u=n(149),p=n(106),c=n(691),d=n(692),f=n(176),h=n(1333),g=n(107),m=n(693),y=n(1334),v=n(694),b={Base:class{constructor(e){this.type=e,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new h.Ids,this._preferences=null,this._refs=new g.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return r("function"==typeof d.describe,"Manifest functionality disabled"),d.describe(this)}allow(...e){return l.verifyFlat(e,"allow"),this._values(e,"_valids")}alter(e){r(e&&"object"==typeof e&&!Array.isArray(e),"Invalid targets argument"),r(!this._inRuleset(),"Cannot set alterations inside a ruleset");const t=this.clone();t.$_terms.alterations=t.$_terms.alterations||[];for(const n in e){const o=e[n];r("function"==typeof o,"Alteration adjuster for",n,"must be a function"),t.$_terms.alterations.push({target:n,adjuster:o})}return t.$_temp.ruleset=!1,t}artifact(e){return r(void 0!==e,"Artifact cannot be undefined"),r(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",e)}cast(e){return r(!1===e||"string"==typeof e,"Invalid to value"),r(!1===e||this._definition.cast[e],"Type",this.type,"does not support casting to",e),this.$_setFlag("cast",!1===e?void 0:e)}default(e,t){return this._default("default",e,t)}description(e){return r(e&&"string"==typeof e,"Description must be a non-empty string"),this.$_setFlag("description",e)}empty(e){const t=this.clone();return void 0!==e&&(e=t.$_compile(e,{override:!1})),t.$_setFlag("empty",e,{clone:!1})}error(e){return r(e,"Missing error"),r(e instanceof Error||"function"==typeof e,"Must provide a valid Error object or a function"),this.$_setFlag("error",e)}example(e,t={}){return r(void 0!==e,"Missing example"),l.assertOptions(t,["override"]),this._inner("examples",e,{single:!0,override:t.override})}external(e,t){return"object"==typeof e&&(r(!t,"Cannot combine options with description"),t=e.description,e=e.method),r("function"==typeof e,"Method must be a function"),r(void 0===t||t&&"string"==typeof t,"Description must be a non-empty string"),this._inner("externals",{method:e,description:t},{single:!0})}failover(e,t){return this._default("failover",e,t)}forbidden(){return this.presence("forbidden")}id(e){return e?(r("string"==typeof e,"id must be a non-empty string"),r(/^[^\.]+$/.test(e),"id cannot contain period character"),this.$_setFlag("id",e)):this.$_setFlag("id",void 0)}invalid(...e){return this._values(e,"_invalids")}label(e){return r(e&&"string"==typeof e,"Label name must be a non-empty string"),this.$_setFlag("label",e)}meta(e){return r(void 0!==e,"Meta cannot be undefined"),this._inner("metas",e,{single:!0})}note(...e){r(e.length,"Missing notes");for(const t of e)r(t&&"string"==typeof t,"Notes must be non-empty strings");return this._inner("notes",e)}only(e=!0){return r("boolean"==typeof e,"Invalid mode:",e),this.$_setFlag("only",e)}optional(){return this.presence("optional")}prefs(e){r(e,"Missing preferences"),r(void 0===e.context,"Cannot override context"),r(void 0===e.externals,"Cannot override externals"),r(void 0===e.warnings,"Cannot override warnings"),r(void 0===e.debug,"Cannot override debug"),l.checkPreferences(e);const t=this.clone();return t._preferences=l.preferences(t._preferences,e),t}presence(e){return r(["optional","required","forbidden"].includes(e),"Unknown presence mode",e),this.$_setFlag("presence",e)}raw(e=!0){return this.$_setFlag("result",e?"raw":void 0)}result(e){return r(["raw","strip"].includes(e),"Unknown result mode",e),this.$_setFlag("result",e)}required(){return this.presence("required")}strict(e){const t=this.clone(),n=void 0!==e&&!e;return t._preferences=l.preferences(t._preferences,{convert:n}),t}strip(e=!0){return this.$_setFlag("result",e?"strip":void 0)}tag(...e){r(e.length,"Missing tags");for(const t of e)r(t&&"string"==typeof t,"Tags must be non-empty strings");return this._inner("tags",e)}unit(e){return r(e&&"string"==typeof e,"Unit name must be a non-empty string"),this.$_setFlag("unit",e)}valid(...e){l.verifyFlat(e,"valid");const t=this.allow(...e);return t.$_setFlag("only",!!t._valids,{clone:!1}),t}when(e,t){const n=this.clone();n.$_terms.whens||(n.$_terms.whens=[]);const o=u.when(n,e,t);if(!["any","link"].includes(n.type)){const e=o.is?[o]:o.switch;for(const t of e)r(!t.then||"any"===t.then.type||t.then.type===n.type,"Cannot combine",n.type,"with",t.then&&t.then.type),r(!t.otherwise||"any"===t.otherwise.type||t.otherwise.type===n.type,"Cannot combine",n.type,"with",t.otherwise&&t.otherwise.type)}return n.$_terms.whens.push(o),n.$_mutateRebuild()}cache(e){r(!this._inRuleset(),"Cannot set caching inside a ruleset"),r(!this._cache,"Cannot override schema cache"),r(void 0===this._flags.artifact,"Cannot cache a rule with an artifact");const t=this.clone();return t._cache=e||s.provider.provision(),t.$_temp.ruleset=!1,t}clone(){const e=Object.create(Object.getPrototypeOf(this));return this._assign(e)}concat(e){r(l.isSchema(e),"Invalid schema object"),r("any"===this.type||"any"===e.type||e.type===this.type,"Cannot merge type",this.type,"with another type:",e.type),r(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),r(!e._inRuleset(),"Cannot concatenate a schema with open ruleset");let t=this.clone();if("any"===this.type&&"any"!==e.type){const n=e.clone();for(const e of Object.keys(t))"type"!==e&&(n[e]=t[e]);t=n}t._ids.concat(e._ids),t._refs.register(e,g.toSibling),t._preferences=t._preferences?l.preferences(t._preferences,e._preferences):e._preferences,t._valids=v.merge(t._valids,e._valids,e._invalids),t._invalids=v.merge(t._invalids,e._invalids,e._valids);for(const n of e._singleRules.keys())t._singleRules.has(n)&&(t._rules=t._rules.filter(e=>e.keep||e.name!==n),t._singleRules.delete(n));for(const n of e._rules)e._definition.rules[n.method].multi||t._singleRules.set(n.name,n),t._rules.push(n);if(t._flags.empty&&e._flags.empty){t._flags.empty=t._flags.empty.concat(e._flags.empty);const n=Object.assign({},e._flags);delete n.empty,a(t._flags,n)}else if(e._flags.empty){t._flags.empty=e._flags.empty;const n=Object.assign({},e._flags);delete n.empty,a(t._flags,n)}else a(t._flags,e._flags);for(const n in e.$_terms){const r=e.$_terms[n];r?t.$_terms[n]?t.$_terms[n]=t.$_terms[n].concat(r):t.$_terms[n]=r.slice():t.$_terms[n]||(t.$_terms[n]=r)}return this.$_root._tracer&&this.$_root._tracer._combine(t,[this,e]),t.$_mutateRebuild()}extend(e){return r(!e.base,"Cannot extend type with another base"),c.type(this,e)}extract(e){return e=Array.isArray(e)?e:e.split("."),this._ids.reach(e)}fork(e,t){r(!this._inRuleset(),"Cannot fork inside a ruleset");let n=this;for(let r of[].concat(e))r=Array.isArray(r)?r:r.split("."),n=n._ids.fork(r,t,n);return n.$_temp.ruleset=!1,n}rule(e){const t=this._definition;l.assertOptions(e,Object.keys(t.modifiers)),r(!1!==this.$_temp.ruleset,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const n=null===this.$_temp.ruleset?this._rules.length-1:this.$_temp.ruleset;r(n>=0&&n<this._rules.length,"Cannot apply rules to empty ruleset");const i=this.clone();for(let a=n;a<i._rules.length;++a){const n=i._rules[a],s=o(n);for(const o in e)t.modifiers[o](s,e[o]),r(s.name===n.name,"Cannot change rule name");i._rules[a]=s,i._singleRules.get(s.name)===n&&i._singleRules.set(s.name,s)}return i.$_temp.ruleset=!1,i.$_mutateRebuild()}get ruleset(){r(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const e=this.clone();return e.$_temp.ruleset=e._rules.length,e}get $(){return this.ruleset}tailor(e){e=[].concat(e),r(!this._inRuleset(),"Cannot tailor inside a ruleset");let t=this;if(this.$_terms.alterations)for(const{target:n,adjuster:o}of this.$_terms.alterations)e.includes(n)&&(t=o(t),r(l.isSchema(t),"Alteration adjuster for",n,"failed to return a schema object"));return t=t.$_modify({each:t=>t.tailor(e),ref:!1}),t.$_temp.ruleset=!1,t.$_mutateRebuild()}tracer(){return m.location?m.location(this):this}validate(e,t){return y.entry(e,this,t)}validateAsync(e,t){return y.entryAsync(e,this,t)}$_addRule(e){"string"==typeof e&&(e={name:e}),r(e&&"object"==typeof e,"Invalid options"),r(e.name&&"string"==typeof e.name,"Invalid rule name");for(const t in e)r("_"!==t[0],"Cannot set private rule properties");const t=Object.assign({},e);t._resolve=[],t.method=t.method||t.name;const n=this._definition.rules[t.method],o=t.args;r(n,"Unknown rule",t.method);const i=this.clone();if(o){r(1===Object.keys(o).length||Object.keys(o).length===this._definition.rules[t.name].args.length,"Invalid rule definition for",this.type,t.name);for(const e in o){let a=o[e];if(void 0!==a){if(n.argsByName){const s=n.argsByName.get(e);if(s.ref&&l.isResolvable(a))t._resolve.push(e),i.$_mutateRegister(a);else if(s.normalize&&(a=s.normalize(a),o[e]=a),s.assert){const t=l.validateArg(a,e,s);r(!t,t,"or reference")}}o[e]=a}else delete o[e]}}return n.multi||(i._ruleRemove(t.name,{clone:!1}),i._singleRules.set(t.name,t)),!1===i.$_temp.ruleset&&(i.$_temp.ruleset=null),n.priority?i._rules.unshift(t):i._rules.push(t),i}$_compile(e,t){return u.schema(this.$_root,e,t)}$_createError(e,t,n,r,o,i={}){const a=!1!==i.flags?this._flags:{},s=i.messages?f.merge(this._definition.messages,i.messages):this._definition.messages;return new p.Report(e,t,n,a,s,r,o)}$_getFlag(e){return this._flags[e]}$_getRule(e){return this._singleRules.get(e)}$_mapLabels(e){return e=Array.isArray(e)?e:e.split("."),this._ids.labels(e)}$_match(e,t,n,r){(n=Object.assign({},n)).abortEarly=!0,n._externals=!1,t.snapshot();const o=!y.validate(e,this,t,n,r).errors;return t.restore(),o}$_modify(e){return l.assertOptions(e,["each","once","ref","schema"]),h.schema(this,e)||this}$_mutateRebuild(){r(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset();return this.$_modify({each:(e,{source:t,name:n,path:r,key:o})=>{const i=this._definition[t][n]&&this._definition[t][n].register;!1!==i&&this.$_mutateRegister(e,{family:i,key:o})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(e,{family:t,key:n}={}){this._refs.register(e,t),this._ids.register(e,{key:n})}$_property(e){return this._definition.properties[e]}$_reach(e){return this._ids.reach(e)}$_rootReferences(){return this._refs.roots()}$_setFlag(e,t,n={}){r("_"===e[0]||!this._inRuleset(),"Cannot set flag inside a ruleset");const o=this._definition.flags[e]||{};if(i(t,o.default)&&(t=void 0),i(t,this._flags[e]))return this;const a=!1!==n.clone?this.clone():this;return void 0!==t?(a._flags[e]=t,a.$_mutateRegister(t)):delete a._flags[e],"_"!==e[0]&&(a.$_temp.ruleset=!1),a}$_parent(e,...t){return this[e][l.symbols.parent].call(this,...t)}$_validate(e,t,n){return y.validate(e,this,t,n)}_assign(e){e.type=this.type,e.$_root=this.$_root,e.$_temp=Object.assign({},this.$_temp),e.$_temp.whens={},e._ids=this._ids.clone(),e._preferences=this._preferences,e._valids=this._valids&&this._valids.clone(),e._invalids=this._invalids&&this._invalids.clone(),e._rules=this._rules.slice(),e._singleRules=o(this._singleRules,{shallow:!0}),e._refs=this._refs.clone(),e._flags=Object.assign({},this._flags),e._cache=null,e.$_terms={};for(const t in this.$_terms)e.$_terms[t]=this.$_terms[t]?this.$_terms[t].slice():null;e.$_super={};for(const t in this.$_super)e.$_super[t]=this._super[t].bind(e);return e}_bare(){const e=this.clone();e._reset();const t=e._definition.terms;for(const n in t){const r=t[n];e.$_terms[n]=r.init}return e.$_mutateRebuild()}_default(e,t,n={}){l.assertOptions(n,"literal"),r(void 0!==t,"Missing",e,"value"),r("function"==typeof t||!n.literal,"Only function value supports literal option"),"function"==typeof t&&n.literal&&(t={[l.symbols.literal]:!0,literal:t});return this.$_setFlag(e,t)}_generate(e,t,n){if(!this.$_terms.whens)return{schema:this};const r=[],o=[];for(let i=0;i<this.$_terms.whens.length;++i){const a=this.$_terms.whens[i];if(a.concat){r.push(a.concat),o.push(i+".concat");continue}const s=a.ref?a.ref.resolve(e,t,n):e,l=a.is?[a]:a.switch,u=o.length;for(let u=0;u<l.length;++u){const{is:p,then:c,otherwise:d}=l[u],f=`${i}${a.switch?"."+u:""}`;if(p.$_match(s,t.nest(p,f+".is"),n)){if(c){const i=t.localize([...t.path,f+".then"],t.ancestors,t.schemas),{schema:a,id:s}=c._generate(e,i,n);r.push(a),o.push(`${f}.then${s?`(${s})`:""}`);break}}else if(d){const i=t.localize([...t.path,f+".otherwise"],t.ancestors,t.schemas),{schema:a,id:s}=d._generate(e,i,n);r.push(a),o.push(`${f}.otherwise${s?`(${s})`:""}`);break}}if(a.break&&o.length>u)break}const i=o.join(", ");if(t.mainstay.tracer.debug(t,"rule","when",i),!i)return{schema:this};if(!t.mainstay.tracer.active&&this.$_temp.whens[i])return{schema:this.$_temp.whens[i],id:i};let a=this;this._definition.generate&&(a=this._definition.generate(this,e,t,n));for(const e of r)a=a.concat(e);return this.$_root._tracer&&this.$_root._tracer._combine(a,[this,...r]),this.$_temp.whens[i]=a,{schema:a,id:i}}_inner(e,t,n={}){r(!this._inRuleset(),`Cannot set ${e} inside a ruleset`);const o=this.clone();return o.$_terms[e]&&!n.override||(o.$_terms[e]=[]),n.single?o.$_terms[e].push(t):o.$_terms[e].push(...t),o.$_temp.ruleset=!1,o}_inRuleset(){return null!==this.$_temp.ruleset&&!1!==this.$_temp.ruleset}_ruleRemove(e,t={}){if(!this._singleRules.has(e))return this;const n=!1!==t.clone?this.clone():this;n._singleRules.delete(e);const r=[];for(let t=0;t<n._rules.length;++t){const o=n._rules[t];o.name!==e||o.keep?r.push(o):n._inRuleset()&&t<n.$_temp.ruleset&&--n.$_temp.ruleset}return n._rules=r,n}_values(e,t){l.verifyFlat(e,t.slice(1,-1));const n=this.clone(),o=e[0]===l.symbols.override;if(o&&(e=e.slice(1)),!n[t]&&e.length?n[t]=new v:o&&(n[t]=e.length?new v:null,n.$_mutateRebuild()),!n[t])return n;o&&n[t].override();for(const o of e){r(void 0!==o,"Cannot call allow/valid/invalid with undefined"),r(o!==l.symbols.override,"Override must be the first value");const e="_invalids"===t?"_valids":"_invalids";n[e]&&(n[e].remove(o),n[e].length||(r("_valids"===t||!n._flags.only,"Setting invalid value",o,"leaves schema rejecting all values due to previous valid rule"),n[e]=null)),n[t].add(o,n._refs)}return n}}};b.Base.prototype[l.symbols.any]={version:l.version,compile:u.compile,root:"$_root"},b.Base.prototype.isImmutable=!0,b.Base.prototype.deny=b.Base.prototype.invalid,b.Base.prototype.disallow=b.Base.prototype.invalid,b.Base.prototype.equal=b.Base.prototype.valid,b.Base.prototype.exist=b.Base.prototype.required,b.Base.prototype.not=b.Base.prototype.invalid,b.Base.prototype.options=b.Base.prototype.prefs,b.Base.prototype.preferences=b.Base.prototype.prefs,e.exports=new b.Base},function(e,t,n){"use strict";const r=n(16),o=n(22),i=n(107),a={};t.Ids=a.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const e=new a.Ids;return e._byId=new Map(this._byId),e._byKey=new Map(this._byKey),e._schemaChain=this._schemaChain,e}concat(e){e._schemaChain&&(this._schemaChain=!0);for(const[t,n]of e._byId.entries())r(!this._byKey.has(t),"Schema id conflicts with existing key:",t),this._byId.set(t,n);for(const[t,n]of e._byKey.entries())r(!this._byId.has(t),"Schema key conflicts with existing id:",t),this._byKey.set(t,n)}fork(e,t,n){const i=this._collect(e);i.push({schema:n});const s=i.shift();let l={id:s.id,schema:t(s.schema)};r(o.isSchema(l.schema),"adjuster function failed to return a joi schema type");for(const e of i)l={id:e.id,schema:a.fork(e.schema,l.id,l.schema)};return l.schema}labels(e,t=[]){const n=e[0],r=this._get(n);if(!r)return[...t,...e].join(".");const o=e.slice(1);return t=[...t,r.schema._flags.label||n],o.length?r.schema._ids.labels(o,t):t.join(".")}reach(e,t=[]){const n=e[0],o=this._get(n);r(o,"Schema does not contain path",[...t,...e].join("."));const i=e.slice(1);return i.length?o.schema._ids.reach(i,[...t,n]):o.schema}register(e,{key:t}={}){if(!e||!o.isSchema(e))return;(e.$_property("schemaChain")||e._ids._schemaChain)&&(this._schemaChain=!0);const n=e._flags.id;if(n){const t=this._byId.get(n);r(!t||t.schema===e,"Cannot add different schemas with the same id:",n),r(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,{schema:e,id:n})}t&&(r(!this._byKey.has(t),"Schema already contains key:",t),r(!this._byId.has(t),"Schema key conflicts with existing id:",t),this._byKey.set(t,{schema:e,id:t}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(e,t=[],n=[]){const o=e[0],i=this._get(o);r(i,"Schema does not contain path",[...t,...e].join(".")),n=[i,...n];const a=e.slice(1);return a.length?i.schema._ids._collect(a,[...t,o],n):n}_get(e){return this._byId.get(e)||this._byKey.get(e)}},a.fork=function(e,n,r){const o=t.schema(e,{each:(e,{key:t})=>{if(n===(e._flags.id||t))return r},ref:!1});return o?o.$_mutateRebuild():e},t.schema=function(e,t){let n;for(const r in e._flags){if("_"===r[0])continue;const o=a.scan(e._flags[r],{source:"flags",name:r},t);void 0!==o&&(n=n||e.clone(),n._flags[r]=o)}for(let r=0;r<e._rules.length;++r){const o=e._rules[r],i=a.scan(o.args,{source:"rules",name:o.name},t);if(void 0!==i){n=n||e.clone();const t=Object.assign({},o);t.args=i,n._rules[r]=t;n._singleRules.get(o.name)===o&&n._singleRules.set(o.name,t)}}for(const r in e.$_terms){if("_"===r[0])continue;const o=a.scan(e.$_terms[r],{source:"terms",name:r},t);void 0!==o&&(n=n||e.clone(),n.$_terms[r]=o)}return n},a.scan=function(e,t,n,r,s){const l=r||[];if(null===e||"object"!=typeof e)return;let u;if(Array.isArray(e)){for(let r=0;r<e.length;++r){const o="terms"===t.source&&"keys"===t.name&&e[r].key,i=a.scan(e[r],t,n,[r,...l],o);void 0!==i&&(u=u||e.slice(),u[r]=i)}return u}if(!1!==n.schema&&o.isSchema(e)||!1!==n.ref&&i.isRef(e)){const r=n.each(e,{...t,path:l,key:s});if(r===e)return;return r}for(const r in e){if("_"===r[0])continue;const o=a.scan(e[r],t,n,[r,...l],s);void 0!==o&&(u=u||Object.assign({},e),u[r]=o)}return u}},function(e,t,n){"use strict";const r=n(16),o=n(58),i=n(1335),a=n(148),s=n(22),l=n(106),u=n(1336),p={result:Symbol("result")};t.entry=function(e,t,n){let o=s.defaults;n&&(r(void 0===n.warnings,"Cannot override warnings preference in synchronous validation"),r(void 0===n.artifacts,"Cannot override artifacts preference in synchronous validation"),o=s.preferences(s.defaults,n));const i=p.entry(e,t,o);r(!i.mainstay.externals.length,"Schema with external rules must use validateAsync()");const a={value:i.value};return i.error&&(a.error=i.error),i.mainstay.warnings.length&&(a.warning=l.details(i.mainstay.warnings)),i.mainstay.debug&&(a.debug=i.mainstay.debug),i.mainstay.artifacts&&(a.artifacts=i.mainstay.artifacts),a},t.entryAsync=async function(e,t,n){let r=s.defaults;n&&(r=s.preferences(s.defaults,n));const o=p.entry(e,t,r),i=o.mainstay;if(o.error)throw i.debug&&(o.error.debug=i.debug),o.error;if(i.externals.length){let e=o.value;for(const{method:t,path:o,label:s}of i.externals){let i,l,u=e;o.length&&(i=o[o.length-1],l=a(e,o.slice(0,-1)),u=l[i]);try{const r=await t(u,{prefs:n});if(void 0===r||r===u)continue;l?l[i]=r:e=r}catch(e){throw r.errors.label&&(e.message+=` (${s})`),e}}o.value=e}if(!r.warnings&&!r.debug&&!r.artifacts)return o.value;const u={value:o.value};return i.warnings.length&&(u.warning=l.details(i.warnings)),i.debug&&(u.debug=i.debug),i.artifacts&&(u.artifacts=i.artifacts),u},p.entry=function(e,n,r){const{tracer:o,cleanup:i}=p.tracer(n,r),a={externals:[],warnings:[],tracer:o,debug:r.debug?[]:null,links:n._ids._schemaChain?new Map:null},s=n._ids._schemaChain?[{schema:n}]:null,c=new u([],[],{mainstay:a,schemas:s}),d=t.validate(e,n,c,r);i&&n.$_root.untrace();const f=l.process(d.errors,e,r);return{value:d.value,error:f,mainstay:a}},p.tracer=function(e,t){return e.$_root._tracer?{tracer:e.$_root._tracer._register(e)}:t.debug?(r(e.$_root.trace,"Debug mode not supported"),{tracer:e.$_root.trace()._register(e),cleanup:!0}):{tracer:p.ignore}},t.validate=function(e,t,n,r,o={}){if(t.$_terms.whens&&(t=t._generate(e,n,r).schema),t._preferences&&(r=p.prefs(t,r)),t._cache&&r.cache){const r=t._cache.get(e);if(n.mainstay.tracer.debug(n,"validate","cached",!!r),r)return r}const i=(o,i,a)=>t.$_createError(o,e,i,a||n,r),a={original:e,prefs:r,schema:t,state:n,error:i,errorsArray:p.errorsArray,warn:(e,t,r)=>n.mainstay.warnings.push(i(e,t,r)),message:(o,i)=>t.$_createError("custom",e,i,n,r,{messages:o})};n.mainstay.tracer.entry(t,n);const l=t._definition;if(l.prepare&&void 0!==e&&r.convert){const t=l.prepare(e,a);if(t){if(n.mainstay.tracer.value(n,"prepare",e,t.value),t.errors)return p.finalize(t.value,[].concat(t.errors),a);e=t.value}}if(l.coerce&&void 0!==e&&r.convert&&(!l.coerce.from||l.coerce.from.includes(typeof e))){const t=l.coerce.method(e,a);if(t){if(n.mainstay.tracer.value(n,"coerced",e,t.value),t.errors)return p.finalize(t.value,[].concat(t.errors),a);e=t.value}}const u=t._flags.empty;u&&u.$_match(p.trim(e,t),n.nest(u),s.defaults)&&(n.mainstay.tracer.value(n,"empty",e,void 0),e=void 0);const c=o.presence||t._flags.presence||(t._flags._endedSwitch?null:r.presence);if(void 0===e){if("forbidden"===c)return p.finalize(e,null,a);if("required"===c)return p.finalize(e,[t.$_createError("any.required",e,null,n,r)],a);if("optional"===c){if(t._flags.default!==s.symbols.deepDefault)return p.finalize(e,null,a);n.mainstay.tracer.value(n,"default",e,{}),e={}}}else if("forbidden"===c)return p.finalize(e,[t.$_createError("any.unknown",e,null,n,r)],a);const d=[];if(t._valids){const o=t._valids.get(e,n,r,t._flags.insensitive);if(o)return r.convert&&(n.mainstay.tracer.value(n,"valids",e,o.value),e=o.value),n.mainstay.tracer.filter(t,n,"valid",o),p.finalize(e,null,a);if(t._flags.only){const o=t.$_createError("any.only",e,{valids:t._valids.values({display:!0})},n,r);if(r.abortEarly)return p.finalize(e,[o],a);d.push(o)}}if(t._invalids){const o=t._invalids.get(e,n,r,t._flags.insensitive);if(o){n.mainstay.tracer.filter(t,n,"invalid",o);const i=t.$_createError("any.invalid",e,{invalids:t._invalids.values({display:!0})},n,r);if(r.abortEarly)return p.finalize(e,[i],a);d.push(i)}}if(l.validate){const t=l.validate(e,a);if(t&&(n.mainstay.tracer.value(n,"base",e,t.value),e=t.value,t.errors)){if(!Array.isArray(t.errors))return d.push(t.errors),p.finalize(e,d,a);if(t.errors.length)return d.push(...t.errors),p.finalize(e,d,a)}}return t._rules.length?p.rules(e,d,a):p.finalize(e,d,a)},p.rules=function(e,t,n){const{schema:r,state:o,prefs:i}=n;for(const a of r._rules){const l=r._definition.rules[a.method];if(l.convert&&i.convert){o.mainstay.tracer.log(r,o,"rule",a.name,"full");continue}let u,c=a.args;if(a._resolve.length){c=Object.assign({},c);for(const t of a._resolve){const n=l.argsByName.get(t),a=c[t].resolve(e,o,i),p=n.normalize?n.normalize(a):a,d=s.validateArg(p,null,n);if(d){u=r.$_createError("any.ref",a,{arg:t,ref:c[t],reason:d},o,i);break}c[t]=p}}u=u||l.validate(e,n,c,a);const d=p.rule(u,a);if(d.errors){if(o.mainstay.tracer.log(r,o,"rule",a.name,"error"),a.warn){o.mainstay.warnings.push(...d.errors);continue}if(i.abortEarly)return p.finalize(e,d.errors,n);t.push(...d.errors)}else o.mainstay.tracer.log(r,o,"rule",a.name,"pass"),o.mainstay.tracer.value(o,"rule",e,d.value,a.name),e=d.value}return p.finalize(e,t,n)},p.rule=function(e,t){return e instanceof l.Report?(p.error(e,t),{errors:[e],value:null}):Array.isArray(e)&&e[s.symbols.errors]?(e.forEach(e=>p.error(e,t)),{errors:e,value:null}):{errors:null,value:e}},p.error=function(e,t){return t.message&&e._setTemplate(t.message),e},p.finalize=function(e,t,n){t=t||[];const{schema:o,state:i,prefs:a}=n;if(t.length){const r=p.default("failover",void 0,t,n);void 0!==r&&(i.mainstay.tracer.value(i,"failover",e,r),e=r,t=[])}if(t.length&&o._flags.error)if("function"==typeof o._flags.error){t=o._flags.error(t),Array.isArray(t)||(t=[t]);for(const e of t)r(e instanceof Error||e instanceof l.Report,"error() must return an Error object")}else t=[o._flags.error];if(void 0===e){const r=p.default("default",e,t,n);i.mainstay.tracer.value(i,"default",e,r),e=r}if(o._flags.cast&&void 0!==e){const t=o._definition.cast[o._flags.cast];if(t.from(e)){const r=t.to(e,n);i.mainstay.tracer.value(i,"cast",e,r,o._flags.cast),e=r}}if(o.$_terms.externals&&a.externals&&!1!==a._externals)for(const{method:e}of o.$_terms.externals)i.mainstay.externals.push({method:e,path:i.path,label:l.label(o._flags,i,a)});const s={value:e,errors:t.length?t:null};return o._flags.result&&(s.value="strip"===o._flags.result?void 0:n.original,i.mainstay.tracer.value(i,o._flags.result,e,s.value),i.shadow(e,o._flags.result)),o._cache&&!1!==a.cache&&!o._refs.length&&o._cache.set(n.original,s),void 0===e||s.errors||void 0===o._flags.artifact||(i.mainstay.artifacts=i.mainstay.artifacts||new Map,i.mainstay.artifacts.has(o._flags.artifact)||i.mainstay.artifacts.set(o._flags.artifact,[]),i.mainstay.artifacts.get(o._flags.artifact).push(i.path)),s},p.prefs=function(e,t){const n=t===s.defaults;return n&&e._preferences[s.symbols.prefs]?e._preferences[s.symbols.prefs]:(t=s.preferences(t,e._preferences),n&&(e._preferences[s.symbols.prefs]=t),t)},p.default=function(e,t,n,r){const{schema:i,state:a,prefs:l}=r,u=i._flags[e];if(l.noDefaults||void 0===u)return t;if(a.mainstay.tracer.log(i,a,"rule",e,"full"),!u)return u;if("function"==typeof u){const t=u.length?[o(a.ancestors[0]),r]:[];try{return u(...t)}catch(t){return void n.push(i.$_createError("any."+e,null,{error:t},a,l))}}return"object"!=typeof u?u:u[s.symbols.literal]?u.literal:s.isResolvable(u)?u.resolve(t,a,l):o(u)},p.trim=function(e,t){if("string"!=typeof e)return e;const n=t.$_getRule("trim");return n&&n.args.enabled?e.trim():e},p.ignore={active:!1,debug:i,entry:i,filter:i,log:i,resolve:i,value:i},p.errorsArray=function(){const e=[];return e[s.symbols.errors]=!0,e}},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){"use strict";const r=n(58),o=n(148),i=n(22),a={value:Symbol("value")};e.exports=a.State=class{constructor(e,t,n){this.path=e,this.ancestors=t,this.mainstay=n.mainstay,this.schemas=n.schemas,this.debug=null}localize(e,t=null,n=null){const r=new a.State(e,t,this);return n&&r.schemas&&(r.schemas=[a.schemas(n),...r.schemas]),r}nest(e,t){const n=new a.State(this.path,this.ancestors,this);return n.schemas=n.schemas&&[a.schemas(e),...n.schemas],n.debug=t,n}shadow(e,t){this.mainstay.shadow=this.mainstay.shadow||new a.Shadow,this.mainstay.shadow.set(this.path,e,t)}snapshot(){this.mainstay.shadow&&(this._snapshot=r(this.mainstay.shadow.node(this.path)))}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0)}},a.schemas=function(e){return i.isSchema(e)?{schema:e}:e},a.Shadow=class{constructor(){this._values=null}set(e,t,n){if(!e.length)return;if("strip"===n&&"number"==typeof e[e.length-1])return;this._values=this._values||new Map;let r=this._values;for(let t=0;t<e.length;++t){const n=e[t];let o=r.get(n);o||(o=new Map,r.set(n,o)),r=o}r[a.value]=t}get(e){const t=this.node(e);if(t)return t[a.value]}node(e){if(this._values)return o(this._values,e,{iterables:!0})}override(e,t){if(!this._values)return;const n=e.slice(0,-1),r=e[e.length-1],i=o(this._values,n,{iterables:!0});t?i.set(r,t):i&&i.delete(r)}}},function(e,t,n){"use strict";const r=n(16),o=n(234),i=n(148),a=n(79),s=n(22),l=n(149),u={};e.exports=a.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(e,{schema:t,state:n,prefs:r}){if(!Array.isArray(e))return;const o=t.$_getRule("sort");return o?u.sort(t,e,o.args.options,n,r):void 0}},validate(e,{schema:t,error:n}){if(!Array.isArray(e)){if(t._flags.single){const t=[e];return t[s.symbols.arraySingle]=!0,{value:t}}return{errors:n("array.base")}}if(t.$_getRule("items")||t.$_terms.externals)return{value:e.slice()}},rules:{has:{method(e){e=this.$_compile(e,{appendPath:!0});const t=this.$_addRule({name:"has",args:{schema:e}});return t.$_mutateRegister(e),t},validate(e,{state:t,prefs:n,error:r},{schema:o}){const i=[e,...t.ancestors];for(let r=0;r<e.length;++r){const a=t.localize([...t.path,r],i,o);if(o.$_match(e[r],a,n))return e}const a=o._flags.label;return a?r("array.hasKnown",{patternLabel:a}):r("array.hasUnknown",null)},multi:!0},items:{method(...e){s.verifyFlat(e,"items");const t=this.$_addRule("items");for(let n=0;n<e.length;++n){const r=s.tryWithPath(()=>this.$_compile(e[n]),n,{append:!0});t.$_terms.items.push(r)}return t.$_mutateRebuild()},validate(e,{schema:t,error:n,state:r,prefs:o,errorsArray:i}){const a=t.$_terms._requireds.slice(),l=t.$_terms.ordered.slice(),p=[...t.$_terms._inclusions,...a],c=!e[s.symbols.arraySingle];delete e[s.symbols.arraySingle];const d=i();let f=e.length;for(let i=0;i<f;++i){const s=e[i];let h=!1,g=!1;const m=c?i:new Number(i),y=[...r.path,m];if(!t._flags.sparse&&void 0===s){if(d.push(n("array.sparse",{key:m,path:y,pos:i,value:void 0},r.localize(y))),o.abortEarly)return d;l.shift();continue}const v=[e,...r.ancestors];for(const e of t.$_terms._exclusions)if(e.$_match(s,r.localize(y,v,e),o,{presence:"ignore"})){if(d.push(n("array.excludes",{pos:i,value:s},r.localize(y))),o.abortEarly)return d;h=!0,l.shift();break}if(h)continue;if(t.$_terms.ordered.length){if(l.length){const a=l.shift(),p=a.$_validate(s,r.localize(y,v,a),o);if(p.errors){if(d.push(...p.errors),o.abortEarly)return d}else if("strip"===a._flags.result)u.fastSplice(e,i),--i,--f;else{if(!t._flags.sparse&&void 0===p.value){if(d.push(n("array.sparse",{key:m,path:y,pos:i,value:void 0},r.localize(y))),o.abortEarly)return d;continue}e[i]=p.value}continue}if(!t.$_terms.items.length){if(d.push(n("array.orderedLength",{pos:i,limit:t.$_terms.ordered.length})),o.abortEarly)return d;break}}const b=[];let _=a.length;for(let l=0;l<_;++l){const p=r.localize(y,v,a[l]);p.snapshot();const c=a[l].$_validate(s,p,o);if(b[l]=c,!c.errors){if(e[i]=c.value,g=!0,u.fastSplice(a,l),--l,--_,!t._flags.sparse&&void 0===c.value&&(d.push(n("array.sparse",{key:m,path:y,pos:i,value:void 0},r.localize(y))),o.abortEarly))return d;break}p.restore()}if(g)continue;const T=o.stripUnknown&&!!o.stripUnknown.arrays||!1;_=p.length;for(const l of p){let p;const c=a.indexOf(l);if(-1!==c)p=b[c];else{const a=r.localize(y,v,l);if(a.snapshot(),p=l.$_validate(s,a,o),!p.errors){"strip"===l._flags.result?(u.fastSplice(e,i),--i,--f):t._flags.sparse||void 0!==p.value?e[i]=p.value:(d.push(n("array.sparse",{key:m,path:y,pos:i,value:void 0},r.localize(y))),h=!0),g=!0;break}a.restore()}if(1===_){if(T){u.fastSplice(e,i),--i,--f,g=!0;break}if(d.push(...p.errors),o.abortEarly)return d;h=!0;break}}if(!h&&((t.$_terms._inclusions.length||t.$_terms._requireds.length)&&!g)){if(T){u.fastSplice(e,i),--i,--f;continue}if(d.push(n("array.includes",{pos:i,value:s},r.localize(y))),o.abortEarly)return d}}return a.length&&u.fillMissedErrors(t,d,a,e,r,o),l.length&&(u.fillOrderedErrors(t,d,l,e,r,o),d.length||u.fillDefault(l,e,r,o)),d.length?d:e},priority:!0,manifest:!1},length:{method(e){return this.$_addRule({name:"length",args:{limit:e},operator:"="})},validate:(e,t,{limit:n},{name:r,operator:o,args:i})=>s.compare(e.length,n,o)?e:t.error("array."+r,{limit:i.limit,value:e}),args:[{name:"limit",ref:!0,assert:s.limit,message:"must be a positive integer"}]},max:{method(e){return this.$_addRule({name:"max",method:"length",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"length",args:{limit:e},operator:">="})}},ordered:{method(...e){s.verifyFlat(e,"ordered");const t=this.$_addRule("items");for(let n=0;n<e.length;++n){const r=s.tryWithPath(()=>this.$_compile(e[n]),n,{append:!0});u.validateSingle(r,t),t.$_mutateRegister(r),t.$_terms.ordered.push(r)}return t.$_mutateRebuild()}},single:{method(e){const t=void 0===e||!!e;return r(!t||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",t)}},sort:{method(e={}){s.assertOptions(e,["by","order"]);const t={order:e.order||"ascending"};return e.by&&(t.by=l.ref(e.by,{ancestor:0}),r(!t.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:t}})},validate(e,{error:t,state:n,prefs:r,schema:o},{options:i}){const{value:a,errors:s}=u.sort(o,e,i,n,r);if(s)return s;for(let n=0;n<e.length;++n)if(e[n]!==a[n])return t("array.sort",{order:i.order,by:i.by?i.by.key:"value"});return e},convert:!0},sparse:{method(e){const t=void 0===e||!!e;if(this._flags.sparse===t)return this;return(t?this.clone():this.$_addRule("items")).$_setFlag("sparse",t,{clone:!1})}},unique:{method(e,t={}){r(!e||"function"==typeof e||"string"==typeof e,"comparator must be a function or a string"),s.assertOptions(t,["ignoreUndefined","separator"]);const n={name:"unique",args:{options:t,comparator:e}};if(e)if("string"==typeof e){const r=s.default(t.separator,".");n.path=r?e.split(r):[e]}else n.comparator=e;return this.$_addRule(n)},validate(e,{state:t,error:n,schema:a},{comparator:s,options:l},{comparator:u,path:p}){const c={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),object:new Map,function:new Map,custom:new Map},d=u||o,f=l.ignoreUndefined;for(let o=0;o<e.length;++o){const a=p?i(e[o],p):e[o],l=u?c.custom:c[typeof a];if(r(l,"Failed to find unique map container for type",typeof a),l instanceof Map){const r=l.entries();let i;for(;!(i=r.next()).done;)if(d(i.value[0],a)){const r=t.localize([...t.path,o],[e,...t.ancestors]),a={pos:o,value:e[o],dupePos:i.value[1],dupeValue:e[i.value[1]]};return p&&(a.path=s),n("array.unique",a,r)}l.set(a,o)}else{if((!f||void 0!==a)&&void 0!==l[a]){const r={pos:o,value:e[o],dupePos:l[a],dupeValue:e[l[a]]};p&&(r.path=s);return n("array.unique",r,t.localize([...t.path,o],[e,...t.ancestors]))}l[a]=o}}return e},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(e,t)=>new Set(e)}},rebuild(e){e.$_terms._inclusions=[],e.$_terms._exclusions=[],e.$_terms._requireds=[];for(const t of e.$_terms.items)u.validateSingle(t,e),"required"===t._flags.presence?e.$_terms._requireds.push(t):"forbidden"===t._flags.presence?e.$_terms._exclusions.push(t):e.$_terms._inclusions.push(t);for(const t of e.$_terms.ordered)u.validateSingle(t,e)},manifest:{build:(e,t)=>(t.items&&(e=e.items(...t.items)),t.ordered&&(e=e.ordered(...t.ordered)),e)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),u.fillMissedErrors=function(e,t,n,r,o,i){const a=[];let s=0;for(const e of n){const t=e._flags.label;t?a.push(t):++s}a.length?s?t.push(e.$_createError("array.includesRequiredBoth",r,{knownMisses:a,unknownMisses:s},o,i)):t.push(e.$_createError("array.includesRequiredKnowns",r,{knownMisses:a},o,i)):t.push(e.$_createError("array.includesRequiredUnknowns",r,{unknownMisses:s},o,i))},u.fillOrderedErrors=function(e,t,n,r,o,i){const a=[];for(const e of n)"required"===e._flags.presence&&a.push(e);a.length&&u.fillMissedErrors(e,t,a,r,o,i)},u.fillDefault=function(e,t,n,r){const o=[];let i=!0;for(let a=e.length-1;a>=0;--a){const s=e[a],l=[t,...n.ancestors],u=s.$_validate(void 0,n.localize(n.path,l,s),r).value;if(i){if(void 0===u)continue;i=!1}o.unshift(u)}o.length&&t.push(...o)},u.fastSplice=function(e,t){let n=t;for(;n<e.length;)e[n++]=e[n];--e.length},u.validateSingle=function(e,t){("array"===e.type||e._flags._arrayItems)&&(r(!t._flags.single,"Cannot specify array item with single rule enabled"),t.$_setFlag("_arrayItems",!0,{clone:!1}))},u.sort=function(e,t,n,r,o){const i="ascending"===n.order?1:-1,a=-1*i,s=i,l=(l,p)=>{let c=u.compare(l,p,a,s);if(null!==c)return c;if(n.by&&(l=n.by.resolve(l,r,o),p=n.by.resolve(p,r,o)),c=u.compare(l,p,a,s),null!==c)return c;const d=typeof l;if(d!==typeof p)throw e.$_createError("array.sort.mismatching",t,null,r,o);if("number"!==d&&"string"!==d)throw e.$_createError("array.sort.unsupported",t,{type:d},r,o);return"number"===d?(l-p)*i:l<p?a:s};try{return{value:t.slice().sort(l)}}catch(e){return{errors:e}}},u.compare=function(e,t,n,r){return e===t?0:void 0===e?1:void 0===t?-1:null===e?r:null===t?n:null}},function(e,t,n){"use strict";const r=n(16),o=n(79),i=n(22),a=n(694),s={isBool:function(e){return"boolean"==typeof e}};e.exports=o.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(e,{schema:t}){if("boolean"!=typeof e){if("string"==typeof e){const n=t._flags.sensitive?e:e.toLowerCase();e="true"===n||"false"!==n&&e}return"boolean"!=typeof e&&(e=t.$_terms.truthy&&t.$_terms.truthy.has(e,null,null,!t._flags.sensitive)||(!t.$_terms.falsy||!t.$_terms.falsy.has(e,null,null,!t._flags.sensitive))&&e),{value:e}}},validate(e,{error:t}){if("boolean"!=typeof e)return{value:e,errors:t("boolean.base")}},rules:{truthy:{method(...e){i.verifyFlat(e,"truthy");const t=this.clone();t.$_terms.truthy=t.$_terms.truthy||new a;for(let n=0;n<e.length;++n){const o=e[n];r(void 0!==o,"Cannot call truthy with undefined"),t.$_terms.truthy.add(o)}return t}},falsy:{method(...e){i.verifyFlat(e,"falsy");const t=this.clone();t.$_terms.falsy=t.$_terms.falsy||new a;for(let n=0;n<e.length;++n){const o=e[n];r(void 0!==o,"Cannot call falsy with undefined"),t.$_terms.falsy.add(o)}return t}},sensitive:{method(e=!0){return this.$_setFlag("sensitive",e)}}},cast:{number:{from:s.isBool,to:(e,t)=>e?1:0},string:{from:s.isBool,to:(e,t)=>e?"true":"false"}},manifest:{build:(e,t)=>(t.truthy&&(e=e.truthy(...t.truthy)),t.falsy&&(e=e.falsy(...t.falsy)),e)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},function(e,t,n){"use strict";const r=n(16),o=n(79),i=n(22),a=n(123),s={isDate:function(e){return e instanceof Date}};e.exports=o.extend({type:"date",coerce:{from:["number","string"],method:(e,{schema:t})=>({value:s.parse(e,t._flags.format)||e})},validate(e,{schema:t,error:n,prefs:r}){if(e instanceof Date&&!isNaN(e.getTime()))return;const o=t._flags.format;return r.convert&&o&&"string"==typeof e?{value:e,errors:n("date.format",{format:o})}:{value:e,errors:n("date.base")}},rules:{compare:{method:!1,validate(e,t,{date:n},{name:r,operator:o,args:a}){const s="now"===n?Date.now():n.getTime();return i.compare(e.getTime(),s,o)?e:t.error("date."+r,{limit:a.date,value:e})},args:[{name:"date",ref:!0,normalize:e=>"now"===e?e:s.parse(e),assert:e=>null!==e,message:"must have a valid date format"}]},format:{method(e){return r(["iso","javascript","unix"].includes(e),"Unknown date format",e),this.$_setFlag("format",e)}},greater:{method(e){return this.$_addRule({name:"greater",method:"compare",args:{date:e},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(e){return this.$_addRule({name:"less",method:"compare",args:{date:e},operator:"<"})}},max:{method(e){return this.$_addRule({name:"max",method:"compare",args:{date:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"compare",args:{date:e},operator:">="})}},timestamp:{method(e="javascript"){return r(["javascript","unix"].includes(e),'"type" must be one of "javascript, unix"'),this.format(e)}}},cast:{number:{from:s.isDate,to:(e,t)=>e.getTime()},string:{from:s.isDate,to:(e,{prefs:t})=>a.date(e,t)}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),s.parse=function(e,t){if(e instanceof Date)return e;if("string"!=typeof e&&(isNaN(e)||!isFinite(e)))return null;if(/^\s*$/.test(e))return null;if("iso"===t)return i.isIsoDate(e)?s.date(e.toString()):null;const n=e;if("string"==typeof e&&/^[+-]?\d+(\.\d+)?$/.test(e)&&(e=parseFloat(e)),t){if("javascript"===t)return s.date(1*e);if("unix"===t)return s.date(1e3*e);if("string"==typeof n)return null}return s.date(e)},s.date=function(e){const t=new Date(e);return isNaN(t.getTime())?null:t}},function(e,t,n){"use strict";const r=n(16),o=n(695);e.exports=o.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(e){return r(Number.isSafeInteger(e)&&e>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:e}})},validate:(e,t,{n:n})=>e.length===n?e:t.error("function.arity",{n:n})},class:{method(){return this.$_addRule("class")},validate:(e,t)=>/^\s*class\s/.test(e.toString())?e:t.error("function.class",{value:e})},minArity:{method(e){return r(Number.isSafeInteger(e)&&e>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:e}})},validate:(e,t,{n:n})=>e.length>=n?e:t.error("function.minArity",{n:n})},maxArity:{method(e){return r(Number.isSafeInteger(e)&&e>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:e}})},validate:(e,t,{n:n})=>e.length<=n?e:t.error("function.maxArity",{n:n})}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},function(e,t,n){"use strict";const r=n(16),o=n(58),i=n(348),a=n(148),s={};e.exports=function(e,t,n={}){if(r(e&&"object"==typeof e,"Invalid defaults value: must be an object"),r(!t||!0===t||"object"==typeof t,"Invalid source value: must be true, falsy or an object"),r("object"==typeof n,"Invalid options: must be an object"),!t)return null;if(n.shallow)return s.applyToDefaultsWithShallow(e,t,n);const a=o(e);if(!0===t)return a;const l=void 0!==n.nullOverride&&n.nullOverride;return i(a,t,{nullOverride:l,mergeArrays:!1})},s.applyToDefaultsWithShallow=function(e,t,n){const l=n.shallow;r(Array.isArray(l),"Invalid keys");const u=new Map,p=!0===t?null:new Set;for(let n of l){n=Array.isArray(n)?n:n.split(".");const r=a(e,n);r&&"object"==typeof r?u.set(r,p&&a(t,n)||r):p&&p.add(n)}const c=o(e,{},u);if(!p)return c;for(const e of p)s.reachCopy(c,t,e);const d=void 0!==n.nullOverride&&n.nullOverride;return i(c,t,{nullOverride:d,mergeArrays:!1})},s.reachCopy=function(e,t,n){for(const e of n){if(!(e in t))return;const n=t[e];if("object"!=typeof n||null===n)return;t=n}const r=t;let o=e;for(let e=0;e<n.length-1;++e){const t=n[e];"object"!=typeof o[t]&&(o[t]={}),o=o[t]}o[n[n.length-1]]=r}},function(e,t,n){"use strict";const r=n(16),o={};t.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(e,t){const n=[].concat((t=t||{}).before||[]),o=[].concat(t.after||[]),i=t.group||"?",a=t.sort||0;r(!n.includes(i),"Item cannot come before itself: "+i),r(!n.includes("?"),"Item cannot come before unassociated items"),r(!o.includes(i),"Item cannot come after itself: "+i),r(!o.includes("?"),"Item cannot come after unassociated items"),Array.isArray(e)||(e=[e]);for(const t of e){const e={seq:this._items.length,sort:a,before:n,after:o,group:i,node:t};this._items.push(e)}if(!t.manual){const e=this._sort();r(e,"item","?"!==i?"added into group "+i:"","created a dependencies error")}return this.nodes}merge(e){Array.isArray(e)||(e=[e]);for(const t of e)if(t)for(const e of t._items)this._items.push(Object.assign({},e));this._items.sort(o.mergeSort);for(let e=0;e<this._items.length;++e)this._items[e].seq=e;const t=this._sort();return r(t,"merge created a dependencies error"),this.nodes}sort(){const e=this._sort();return r(e,"sort created a dependencies error"),this.nodes}_sort(){const e={},t=Object.create(null),n=Object.create(null);for(const r of this._items){const o=r.seq,i=r.group;n[i]=n[i]||[],n[i].push(o),e[o]=r.before;for(const e of r.after)t[e]=t[e]||[],t[e].push(o)}for(const t in e){const r=[];for(const o in e[t]){const i=e[t][o];n[i]=n[i]||[],r.push(...n[i])}e[t]=r}for(const r in t)if(n[r])for(const o of n[r])e[o].push(...t[r]);const r={};for(const t in e){const n=e[t];for(const e of n)r[e]=r[e]||[],r[e].push(t)}const o={},i=[];for(let e=0;e<this._items.length;++e){let t=e;if(r[e]){t=null;for(let e=0;e<this._items.length;++e){if(!0===o[e])continue;r[e]||(r[e]=[]);const n=r[e].length;let i=0;for(let t=0;t<n;++t)o[r[e][t]]&&++i;if(i===n){t=e;break}}}null!==t&&(o[t]=!0,i.push(t))}if(i.length!==this._items.length)return!1;const a={};for(const e of this._items)a[e.seq]=e;this._items=[],this.nodes=[];for(const e of i){const t=a[e];this.nodes.push(t.node),this._items.push(t)}return!0}},o.mergeSort=(e,t)=>e.sort===t.sort?0:e.sort<t.sort?-1:1},function(e,t,n){"use strict";const r=n(16),o=n(79),i=n(22),a=n(149),s=n(106),l={};e.exports=o.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(e,t)=>e.ref(t),validate(e,{schema:t,state:n,prefs:o}){r(t.$_terms.link,"Uninitialized link schema");const i=l.generate(t,e,n,o),a=t.$_terms.link[0].ref;return i.$_validate(e,n.nest(i,`link:${a.display}:${i.type}`),o)},generate:(e,t,n,r)=>l.generate(e,t,n,r),rules:{ref:{method(e){r(!this.$_terms.link,"Cannot reinitialize schema"),e=a.ref(e),r("value"===e.type||"local"===e.type,"Invalid reference type:",e.type),r("local"===e.type||"root"===e.ancestor||e.ancestor>0,"Link cannot reference itself");const t=this.clone();return t.$_terms.link=[{ref:e}],t}},relative:{method(e=!0){return this.$_setFlag("relative",e)}}},overrides:{concat(e){r(this.$_terms.link,"Uninitialized link schema"),r(i.isSchema(e),"Invalid schema object"),r("link"!==e.type,"Cannot merge type link with another link");const t=this.clone();return t.$_terms.whens||(t.$_terms.whens=[]),t.$_terms.whens.push({concat:e}),t.$_mutateRebuild()}},manifest:{build:(e,t)=>(r(t.link,"Invalid link description missing link"),e.ref(t.link))}}),l.generate=function(e,t,n,r){let o=n.mainstay.links.get(e);if(o)return o._generate(t,n,r).schema;const i=e.$_terms.link[0].ref,{perspective:a,path:s}=l.perspective(i,n);l.assert(a,"which is outside of schema boundaries",i,e,n,r);try{o=s.length?a.$_reach(s):a}catch(t){l.assert(!1,"to non-existing schema",i,e,n,r)}return l.assert("link"!==o.type,"which is another link",i,e,n,r),e._flags.relative||n.mainstay.links.set(e,o),o._generate(t,n,r).schema},l.perspective=function(e,t){if("local"===e.type){for(const{schema:n,key:r}of t.schemas){if((n._flags.id||r)===e.path[0])return{perspective:n,path:e.path.slice(1)};if(n.$_terms.shared)for(const t of n.$_terms.shared)if(t._flags.id===e.path[0])return{perspective:t,path:e.path.slice(1)}}return{perspective:null,path:null}}return"root"===e.ancestor?{perspective:t.schemas[t.schemas.length-1].schema,path:e.path}:{perspective:t.schemas[e.ancestor]&&t.schemas[e.ancestor].schema,path:e.path}},l.assert=function(e,t,n,o,i,a){e||r(!1,`"${s.label(o._flags,i,a)}" contains link reference "${n.display}" ${t}`)}},function(e,t,n){"use strict";const r=n(16),o=n(79),i=n(22),a={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/};e.exports=o.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(e,{schema:t,error:n}){const r=e.match(a.numberRx);if(!r)return;e=e.trim();const o={value:parseFloat(e)};if(0===o.value&&(o.value=0),!t._flags.unsafe)if(e.match(/e/i)){if(a.normalizeExponent(`${o.value/Math.pow(10,r[1])}e${r[1]}`)!==a.normalizeExponent(e))return o.errors=n("number.unsafe"),o}else{const t=o.value.toString();if(t.match(/e/i))return o;if(t!==a.normalizeDecimal(e))return o.errors=n("number.unsafe"),o}return o}},validate(e,{schema:t,error:n,prefs:r}){if(e===1/0||e===-1/0)return{value:e,errors:n("number.infinity")};if(!i.isNumber(e))return{value:e,errors:n("number.base")};const o={value:e};if(r.convert){const e=t.$_getRule("precision");if(e){const t=Math.pow(10,e.args.limit);o.value=Math.round(o.value*t)/t}}return 0===o.value&&(o.value=0),!t._flags.unsafe&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(o.errors=n("number.unsafe")),o},rules:{compare:{method:!1,validate:(e,t,{limit:n},{name:r,operator:o,args:a})=>i.compare(e,n,o)?e:t.error("number."+r,{limit:a.limit,value:e}),args:[{name:"limit",ref:!0,assert:i.isNumber,message:"must be a number"}]},greater:{method(e){return this.$_addRule({name:"greater",method:"compare",args:{limit:e},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(e,t)=>Math.trunc(e)-e==0?e:t.error("number.integer")},less:{method(e){return this.$_addRule({name:"less",method:"compare",args:{limit:e},operator:"<"})}},max:{method(e){return this.$_addRule({name:"max",method:"compare",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"compare",args:{limit:e},operator:">="})}},multiple:{method(e){return this.$_addRule({name:"multiple",args:{base:e}})},validate:(e,t,{base:n},r)=>e*(1/n)%1==0?e:t.error("number.multiple",{multiple:r.args.base,value:e}),args:[{name:"base",ref:!0,assert:e=>"number"==typeof e&&isFinite(e)&&e>0,message:"must be a positive number"}],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(e,t)=>Number.isSafeInteger(e)&&e>=0&&e<=65535?e:t.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(e){return r(Number.isSafeInteger(e),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:e}})},validate(e,t,{limit:n}){const r=e.toString().match(a.precisionRx);return Math.max((r[1]?r[1].length:0)-(r[2]?parseInt(r[2],10):0),0)<=n?e:t.error("number.precision",{limit:n,value:e})},convert:!0},sign:{method(e){return r(["negative","positive"].includes(e),"Invalid sign",e),this.$_addRule({name:"sign",args:{sign:e}})},validate:(e,t,{sign:n})=>"negative"===n&&e<0||"positive"===n&&e>0?e:t.error("number."+n)},unsafe:{method(e=!0){return r("boolean"==typeof e,"enabled must be a boolean"),this.$_setFlag("unsafe",e)}}},cast:{string:{from:e=>"number"==typeof e,to:(e,t)=>e.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),a.normalizeExponent=function(e){return e.replace(/E/,"e").replace(/\.(\d*[1-9])?0+e/,".$1e").replace(/\.e/,"e").replace(/e\+/,"e").replace(/^\+/,"").replace(/^(-?)0+([1-9])/,"$1$2")},a.normalizeDecimal=function(e){return(e=e.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&e.endsWith("0")&&(e=e.replace(/0+$/,"")),"-0"===e?"0":e}},function(e,t,n){"use strict";const r=n(695);e.exports=r.extend({type:"object",cast:{map:{from:e=>e&&"object"==typeof e,to:(e,t)=>new Map(Object.entries(e))}}})},function(e,t,n){"use strict";const r=n(16),o=n(696),i=n(1347),a=n(1348),s=n(699),l=n(1349),u=n(698),p=n(79),c=n(22),d={tlds:l instanceof Set&&{tlds:{allow:l,deny:null}},base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:/^[a-f0-9]+$/i,ipRegex:a.regex({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};e.exports=p.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(e,{schema:t,state:n,prefs:r}){const o=t.$_getRule("normalize");o&&(e=e.normalize(o.args.form));const i=t.$_getRule("case");i&&(e="upper"===i.args.direction?e.toLocaleUpperCase():e.toLocaleLowerCase());const a=t.$_getRule("trim");if(a&&a.args.enabled&&(e=e.trim()),t.$_terms.replacements)for(const n of t.$_terms.replacements)e=e.replace(n.pattern,n.replacement);const s=t.$_getRule("hex");if(s&&s.args.options.byteAligned&&e.length%2!=0&&(e="0"+e),t.$_getRule("isoDate")){const t=d.isoDate(e);t&&(e=t)}if(t._flags.truncate){const o=t.$_getRule("max");if(o){let i=o.args.limit;if(c.isResolvable(i)&&(i=i.resolve(e,n,r),!c.limit(i)))return{value:e,errors:t.$_createError("any.ref",i,{ref:o.args.limit,arg:"limit",reason:"must be a positive integer"},n,r)};e=e.slice(0,i)}}return{value:e}}},validate(e,{schema:t,error:n}){if("string"!=typeof e)return{value:e,errors:n("string.base")};if(""===e){const r=t.$_getRule("min");if(r&&0===r.args.limit)return;return{value:e,errors:n("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(e,t)=>/^[a-zA-Z0-9]+$/.test(e)?e:t.error("string.alphanum")},base64:{method(e={}){return c.assertOptions(e,["paddingRequired","urlSafe"]),e={urlSafe:!1,paddingRequired:!0,...e},r("boolean"==typeof e.paddingRequired,"paddingRequired must be boolean"),r("boolean"==typeof e.urlSafe,"urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:e}})},validate:(e,t,{options:n})=>d.base64Regex[n.paddingRequired][n.urlSafe].test(e)?e:t.error("string.base64")},case:{method(e){return r(["lower","upper"].includes(e),"Invalid case:",e),this.$_addRule({name:"case",args:{direction:e}})},validate:(e,t,{direction:n})=>"lower"===n&&e===e.toLocaleLowerCase()||"upper"===n&&e===e.toLocaleUpperCase()?e:t.error(`string.${n}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(e,t){let n=e.length,r=0,o=1;for(;n--;){const t=e.charAt(n)*o;r+=t-9*(t>9),o^=3}return r>0&&r%10==0?e:t.error("string.creditCard")}},dataUri:{method(e={}){return c.assertOptions(e,["paddingRequired"]),e={paddingRequired:!0,...e},r("boolean"==typeof e.paddingRequired,"paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:e}})},validate(e,t,{options:n}){const r=e.match(d.dataUriRegex);if(r){if(!r[2])return e;if("base64"!==r[2])return e;if(d.base64Regex[n.paddingRequired].false.test(r[3]))return e}return t.error("string.dataUri")}},domain:{method(e){e&&c.assertOptions(e,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const t=d.addressOptions(e);return this.$_addRule({name:"domain",args:{options:e},address:t})},validate:(e,t,n,{address:r})=>o.isValid(e,r)?e:t.error("string.domain")},email:{method(e={}){c.assertOptions(e,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),r(void 0===e.multiple||"boolean"==typeof e.multiple,"multiple option must be an boolean");const t=d.addressOptions(e),n=new RegExp(`\\s*[${e.separator?s(e.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:e},regex:n,address:t})},validate(e,t,{options:n},{regex:r,address:o}){const a=n.multiple?e.split(r):[e],s=[];for(const e of a)i.isValid(e,o)||s.push(e);return s.length?t.error("string.email",{value:e,invalids:s}):e}},guid:{alias:"uuid",method(e={}){c.assertOptions(e,["version","separator"]);let t="";if(e.version){const n=[].concat(e.version);r(n.length>=1,"version must have at least 1 valid version specified");const o=new Set;for(let e=0;e<n.length;++e){const i=n[e];r("string"==typeof i,"version at position "+e+" must be a string");const a=d.guidVersions[i.toLowerCase()];r(a,"version at position "+e+" must be one of "+Object.keys(d.guidVersions).join(", ")),r(!o.has(a),"version at position "+e+" must not be a duplicate"),t+=a,o.add(a)}}r(d.guidSeparators.has(e.separator),'separator must be one of true, false, "-", or ":"');const n=void 0===e.separator?"[:-]?":!0===e.separator?"[:-]":!1===e.separator?"[]?":"\\"+e.separator,o=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${n})[0-9A-F]{4}\\2?[${t||"0-9A-F"}][0-9A-F]{3}\\2?[${t?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:e},regex:o})},validate(e,t,n,{regex:r}){const o=r.exec(e);return o?d.guidBrackets[o[1]]!==o[o.length-1]?t.error("string.guid"):e:t.error("string.guid")}},hex:{method(e={}){return c.assertOptions(e,["byteAligned"]),e={byteAligned:!1,...e},r("boolean"==typeof e.byteAligned,"byteAligned must be boolean"),this.$_addRule({name:"hex",args:{options:e}})},validate:(e,t,{options:n})=>d.hexRegex.test(e)?n.byteAligned&&e.length%2!=0?t.error("string.hexAlign"):e:t.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(e,t)=>o.isValid(e,{minDomainSegments:1})||d.ipRegex.test(e)?e:t.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(e={}){c.assertOptions(e,["cidr","version"]);const{cidr:t,versions:n,regex:r}=a.regex(e),o=e.version?n:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:t,version:o}},regex:r})},validate:(e,t,{options:n},{regex:r})=>r.test(e)?e:n.version?t.error("string.ipVersion",{value:e,cidr:n.cidr,version:n.version}):t.error("string.ip",{value:e,cidr:n.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(e,{error:t})=>d.isoDate(e)?e:t("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(e,t)=>d.isoDurationRegex.test(e)?e:t.error("string.isoDuration")},length:{method(e,t){return d.length(this,"length",e,"=",t)},validate(e,t,{limit:n,encoding:r},{name:o,operator:i,args:a}){const s=r?Buffer&&Buffer.byteLength(e,r):e.length;return c.compare(s,n,i)?e:t.error("string."+o,{limit:a.limit,value:e,encoding:r})},args:[{name:"limit",ref:!0,assert:c.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(e,t){return d.length(this,"max",e,"<=",t)},args:["limit","encoding"]},min:{method(e,t){return d.length(this,"min",e,">=",t)},args:["limit","encoding"]},normalize:{method(e="NFC"){return r(d.normalizationForms.includes(e),"normalization form must be one of "+d.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:e}})},validate:(e,{error:t},{form:n})=>e===e.normalize(n)?e:t("string.normalize",{value:e,form:n}),convert:!0},pattern:{alias:"regex",method(e,t={}){r(e instanceof RegExp,"regex must be a RegExp"),r(!e.flags.includes("g")&&!e.flags.includes("y"),"regex should not use global or sticky mode"),"string"==typeof t&&(t={name:t}),c.assertOptions(t,["invert","name"]);const n=["string.pattern",t.invert?".invert":"",t.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:e,options:t},errorCode:n})},validate:(e,t,{regex:n,options:r},{errorCode:o})=>n.test(e)^r.invert?e:t.error(o,{name:r.name,regex:n,value:e}),args:["regex","options"],multi:!0},replace:{method(e,t){"string"==typeof e&&(e=new RegExp(s(e),"g")),r(e instanceof RegExp,"pattern must be a RegExp"),r("string"==typeof t,"replacement must be a String");const n=this.clone();return n.$_terms.replacements||(n.$_terms.replacements=[]),n.$_terms.replacements.push({pattern:e,replacement:t}),n}},token:{method(){return this.$_addRule("token")},validate:(e,t)=>/^\w+$/.test(e)?e:t.error("string.token")},trim:{method(e=!0){return r("boolean"==typeof e,"enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:e}})},validate:(e,t,{enabled:n})=>n&&e!==e.trim()?t.error("string.trim"):e,convert:!0},truncate:{method(e=!0){return r("boolean"==typeof e,"enabled must be a boolean"),this.$_setFlag("truncate",e)}},uppercase:{method(){return this.case("upper")}},uri:{method(e={}){c.assertOptions(e,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme"]),e.domain&&c.assertOptions(e.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:t,scheme:n}=u.regex(e),r=e.domain?d.addressOptions(e.domain):null;return this.$_addRule({name:"uri",args:{options:e},regex:t,domain:r,scheme:n})},validate(e,t,{options:n},{regex:r,domain:i,scheme:a}){if(["http:/","https:/"].includes(e))return t.error("string.uri");const s=r.exec(e);if(s){const r=s[1]||s[2];return!i||n.allowRelative&&!r||o.isValid(r,i)?e:t.error("string.domain",{value:r})}return n.relativeOnly?t.error("string.uriRelativeOnly"):n.scheme?t.error("string.uriCustomScheme",{scheme:a,value:e}):t.error("string.uri")}}},manifest:{build(e,t){if(t.replacements)for(const{pattern:n,replacement:r}of t.replacements)e=e.replace(n,r);return e}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),d.addressOptions=function(e){if(!e)return e;if(r(void 0===e.minDomainSegments||Number.isSafeInteger(e.minDomainSegments)&&e.minDomainSegments>0,"minDomainSegments must be a positive integer"),r(void 0===e.maxDomainSegments||Number.isSafeInteger(e.maxDomainSegments)&&e.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),!1===e.tlds)return e;if(!0===e.tlds||void 0===e.tlds)return r(d.tlds,"Built-in TLD list disabled"),Object.assign({},e,d.tlds);r("object"==typeof e.tlds,"tlds must be true, false, or an object");const t=e.tlds.deny;if(t)return Array.isArray(t)&&(e=Object.assign({},e,{tlds:{deny:new Set(t)}})),r(e.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),r(!e.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),d.validateTlds(e.tlds.deny,"tlds.deny"),e;const n=e.tlds.allow;return n?!0===n?(r(d.tlds,"Built-in TLD list disabled"),Object.assign({},e,d.tlds)):(Array.isArray(n)&&(e=Object.assign({},e,{tlds:{allow:new Set(n)}})),r(e.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),d.validateTlds(e.tlds.allow,"tlds.allow"),e):e},d.validateTlds=function(e,t){for(const n of e)r(o.isValid(n,{minDomainSegments:1,maxDomainSegments:1}),t+" must contain valid top level domain names")},d.isoDate=function(e){if(!c.isIsoDate(e))return null;/.*T.*[+-]\d\d$/.test(e)&&(e+="00");const t=new Date(e);return isNaN(t.getTime())?null:t.toISOString()},d.length=function(e,t,n,o,i){return r(!i||Buffer&&Buffer.isEncoding(i),"Invalid encoding:",i),e.$_addRule({name:t,method:"length",args:{limit:n,encoding:i},operator:o})}},function(e,t,n){"use strict";const r=n(8),o=n(696),i=n(697),a={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(r.TextEncoder||TextEncoder)};t.analyze=function(e,t){return a.email(e,t)},t.isValid=function(e,t){return!a.email(e,t)},a.email=function(e,t={}){if("string"!=typeof e)throw new Error("Invalid input: email must be a string");if(!e)return i.code("EMPTY_STRING");const n=!a.nonAsciiRx.test(e);if(!n){if(!1===t.allowUnicode)return i.code("FORBIDDEN_UNICODE");e=e.normalize("NFC")}const r=e.split("@");if(2!==r.length)return r.length>2?i.code("MULTIPLE_AT_CHAR"):i.code("MISSING_AT_CHAR");const[s,l]=r;if(!s)return i.code("EMPTY_LOCAL");if(!t.ignoreLength){if(e.length>254)return i.code("ADDRESS_TOO_LONG");if(a.encoder.encode(s).length>64)return i.code("LOCAL_TOO_LONG")}return a.local(s,n)||o.analyze(l,t)},a.local=function(e,t){const n=e.split(".");for(const e of n){if(!e.length)return i.code("EMPTY_LOCAL_SEGMENT");if(t){if(!a.atextRx.test(e))return i.code("INVALID_LOCAL_CHARS")}else for(const t of e){if(a.atextRx.test(t))continue;const e=a.binary(t);if(!a.atomRx.test(e))return i.code("INVALID_LOCAL_CHARS")}}},a.binary=function(e){return Array.from(a.encoder.encode(e)).map(e=>String.fromCharCode(e)).join("")},a.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,a.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))},function(e,t,n){"use strict";const r=n(16),o=n(698);t.regex=function(e={}){r(void 0===e.cidr||"string"==typeof e.cidr,"options.cidr must be a string");const t=e.cidr?e.cidr.toLowerCase():"optional";r(["required","optional","forbidden"].includes(t),"options.cidr must be one of required, optional, forbidden"),r(void 0===e.version||"string"==typeof e.version||Array.isArray(e.version),"options.version must be a string or an array of string");let n=e.version||["ipv4","ipv6","ipvfuture"];Array.isArray(n)||(n=[n]),r(n.length>=1,"options.version must have at least 1 version specified");for(let e=0;e<n.length;++e)r("string"==typeof n[e],"options.version must only contain strings"),n[e]=n[e].toLowerCase(),r(["ipv4","ipv6","ipvfuture"].includes(n[e]),"options.version contains unknown version "+n[e]+" - must be one of ipv4, ipv6, ipvfuture");n=Array.from(new Set(n));const i=`(?:${n.map(e=>{if("forbidden"===t)return o.ip[e];const n="\\/"+("ipv4"===e?o.ip.v4Cidr:o.ip.v6Cidr);return"required"===t?`${o.ip[e]}${n}`:`${o.ip[e]}(?:${n})?`}).join("|")})`,a=new RegExp(`^${i}$`);return{cidr:t,versions:n,regex:a,raw:i}}},function(e,t,n){"use strict";const r={tlds:["AAA","AARP","ABARTH","ABB","ABBOTT","ABBVIE","ABC","ABLE","ABOGADO","ABUDHABI","AC","ACADEMY","ACCENTURE","ACCOUNTANT","ACCOUNTANTS","ACO","ACTOR","AD","ADAC","ADS","ADULT","AE","AEG","AERO","AETNA","AF","AFL","AFRICA","AG","AGAKHAN","AGENCY","AI","AIG","AIRBUS","AIRFORCE","AIRTEL","AKDN","AL","ALFAROMEO","ALIBABA","ALIPAY","ALLFINANZ","ALLSTATE","ALLY","ALSACE","ALSTOM","AM","AMAZON","AMERICANEXPRESS","AMERICANFAMILY","AMEX","AMFAM","AMICA","AMSTERDAM","ANALYTICS","ANDROID","ANQUAN","ANZ","AO","AOL","APARTMENTS","APP","APPLE","AQ","AQUARELLE","AR","ARAB","ARAMCO","ARCHI","ARMY","ARPA","ART","ARTE","AS","ASDA","ASIA","ASSOCIATES","AT","ATHLETA","ATTORNEY","AU","AUCTION","AUDI","AUDIBLE","AUDIO","AUSPOST","AUTHOR","AUTO","AUTOS","AVIANCA","AW","AWS","AX","AXA","AZ","AZURE","BA","BABY","BAIDU","BANAMEX","BANANAREPUBLIC","BAND","BANK","BAR","BARCELONA","BARCLAYCARD","BARCLAYS","BAREFOOT","BARGAINS","BASEBALL","BASKETBALL","BAUHAUS","BAYERN","BB","BBC","BBT","BBVA","BCG","BCN","BD","BE","BEATS","BEAUTY","BEER","BENTLEY","BERLIN","BEST","BESTBUY","BET","BF","BG","BH","BHARTI","BI","BIBLE","BID","BIKE","BING","BINGO","BIO","BIZ","BJ","BLACK","BLACKFRIDAY","BLOCKBUSTER","BLOG","BLOOMBERG","BLUE","BM","BMS","BMW","BN","BNPPARIBAS","BO","BOATS","BOEHRINGER","BOFA","BOM","BOND","BOO","BOOK","BOOKING","BOSCH","BOSTIK","BOSTON","BOT","BOUTIQUE","BOX","BR","BRADESCO","BRIDGESTONE","BROADWAY","BROKER","BROTHER","BRUSSELS","BS","BT","BUGATTI","BUILD","BUILDERS","BUSINESS","BUY","BUZZ","BV","BW","BY","BZ","BZH","CA","CAB","CAFE","CAL","CALL","CALVINKLEIN","CAM","CAMERA","CAMP","CANCERRESEARCH","CANON","CAPETOWN","CAPITAL","CAPITALONE","CAR","CARAVAN","CARDS","CARE","CAREER","CAREERS","CARS","CASA","CASE","CASH","CASINO","CAT","CATERING","CATHOLIC","CBA","CBN","CBRE","CBS","CC","CD","CENTER","CEO","CERN","CF","CFA","CFD","CG","CH","CHANEL","CHANNEL","CHARITY","CHASE","CHAT","CHEAP","CHINTAI","CHRISTMAS","CHROME","CHURCH","CI","CIPRIANI","CIRCLE","CISCO","CITADEL","CITI","CITIC","CITY","CITYEATS","CK","CL","CLAIMS","CLEANING","CLICK","CLINIC","CLINIQUE","CLOTHING","CLOUD","CLUB","CLUBMED","CM","CN","CO","COACH","CODES","COFFEE","COLLEGE","COLOGNE","COM","COMCAST","COMMBANK","COMMUNITY","COMPANY","COMPARE","COMPUTER","COMSEC","CONDOS","CONSTRUCTION","CONSULTING","CONTACT","CONTRACTORS","COOKING","COOKINGCHANNEL","COOL","COOP","CORSICA","COUNTRY","COUPON","COUPONS","COURSES","CPA","CR","CREDIT","CREDITCARD","CREDITUNION","CRICKET","CROWN","CRS","CRUISE","CRUISES","CU","CUISINELLA","CV","CW","CX","CY","CYMRU","CYOU","CZ","DABUR","DAD","DANCE","DATA","DATE","DATING","DATSUN","DAY","DCLK","DDS","DE","DEAL","DEALER","DEALS","DEGREE","DELIVERY","DELL","DELOITTE","DELTA","DEMOCRAT","DENTAL","DENTIST","DESI","DESIGN","DEV","DHL","DIAMONDS","DIET","DIGITAL","DIRECT","DIRECTORY","DISCOUNT","DISCOVER","DISH","DIY","DJ","DK","DM","DNP","DO","DOCS","DOCTOR","DOG","DOMAINS","DOT","DOWNLOAD","DRIVE","DTV","DUBAI","DUNLOP","DUPONT","DURBAN","DVAG","DVR","DZ","EARTH","EAT","EC","ECO","EDEKA","EDU","EDUCATION","EE","EG","EMAIL","EMERCK","ENERGY","ENGINEER","ENGINEERING","ENTERPRISES","EPSON","EQUIPMENT","ER","ERICSSON","ERNI","ES","ESQ","ESTATE","ET","ETISALAT","EU","EUROVISION","EUS","EVENTS","EXCHANGE","EXPERT","EXPOSED","EXPRESS","EXTRASPACE","FAGE","FAIL","FAIRWINDS","FAITH","FAMILY","FAN","FANS","FARM","FARMERS","FASHION","FAST","FEDEX","FEEDBACK","FERRARI","FERRERO","FI","FIAT","FIDELITY","FIDO","FILM","FINAL","FINANCE","FINANCIAL","FIRE","FIRESTONE","FIRMDALE","FISH","FISHING","FIT","FITNESS","FJ","FK","FLICKR","FLIGHTS","FLIR","FLORIST","FLOWERS","FLY","FM","FO","FOO","FOOD","FOODNETWORK","FOOTBALL","FORD","FOREX","FORSALE","FORUM","FOUNDATION","FOX","FR","FREE","FRESENIUS","FRL","FROGANS","FRONTDOOR","FRONTIER","FTR","FUJITSU","FUN","FUND","FURNITURE","FUTBOL","FYI","GA","GAL","GALLERY","GALLO","GALLUP","GAME","GAMES","GAP","GARDEN","GAY","GB","GBIZ","GD","GDN","GE","GEA","GENT","GENTING","GEORGE","GF","GG","GGEE","GH","GI","GIFT","GIFTS","GIVES","GIVING","GL","GLASS","GLE","GLOBAL","GLOBO","GM","GMAIL","GMBH","GMO","GMX","GN","GODADDY","GOLD","GOLDPOINT","GOLF","GOO","GOODYEAR","GOOG","GOOGLE","GOP","GOT","GOV","GP","GQ","GR","GRAINGER","GRAPHICS","GRATIS","GREEN","GRIPE","GROCERY","GROUP","GS","GT","GU","GUARDIAN","GUCCI","GUGE","GUIDE","GUITARS","GURU","GW","GY","HAIR","HAMBURG","HANGOUT","HAUS","HBO","HDFC","HDFCBANK","HEALTH","HEALTHCARE","HELP","HELSINKI","HERE","HERMES","HGTV","HIPHOP","HISAMITSU","HITACHI","HIV","HK","HKT","HM","HN","HOCKEY","HOLDINGS","HOLIDAY","HOMEDEPOT","HOMEGOODS","HOMES","HOMESENSE","HONDA","HORSE","HOSPITAL","HOST","HOSTING","HOT","HOTELES","HOTELS","HOTMAIL","HOUSE","HOW","HR","HSBC","HT","HU","HUGHES","HYATT","HYUNDAI","IBM","ICBC","ICE","ICU","ID","IE","IEEE","IFM","IKANO","IL","IM","IMAMAT","IMDB","IMMO","IMMOBILIEN","IN","INC","INDUSTRIES","INFINITI","INFO","ING","INK","INSTITUTE","INSURANCE","INSURE","INT","INTERNATIONAL","INTUIT","INVESTMENTS","IO","IPIRANGA","IQ","IR","IRISH","IS","ISMAILI","IST","ISTANBUL","IT","ITAU","ITV","JAGUAR","JAVA","JCB","JE","JEEP","JETZT","JEWELRY","JIO","JLL","JM","JMP","JNJ","JO","JOBS","JOBURG","JOT","JOY","JP","JPMORGAN","JPRS","JUEGOS","JUNIPER","KAUFEN","KDDI","KE","KERRYHOTELS","KERRYLOGISTICS","KERRYPROPERTIES","KFH","KG","KH","KI","KIA","KIM","KINDER","KINDLE","KITCHEN","KIWI","KM","KN","KOELN","KOMATSU","KOSHER","KP","KPMG","KPN","KR","KRD","KRED","KUOKGROUP","KW","KY","KYOTO","KZ","LA","LACAIXA","LAMBORGHINI","LAMER","LANCASTER","LANCIA","LAND","LANDROVER","LANXESS","LASALLE","LAT","LATINO","LATROBE","LAW","LAWYER","LB","LC","LDS","LEASE","LECLERC","LEFRAK","LEGAL","LEGO","LEXUS","LGBT","LI","LIDL","LIFE","LIFEINSURANCE","LIFESTYLE","LIGHTING","LIKE","LILLY","LIMITED","LIMO","LINCOLN","LINDE","LINK","LIPSY","LIVE","LIVING","LK","LLC","LLP","LOAN","LOANS","LOCKER","LOCUS","LOFT","LOL","LONDON","LOTTE","LOTTO","LOVE","LPL","LPLFINANCIAL","LR","LS","LT","LTD","LTDA","LU","LUNDBECK","LUXE","LUXURY","LV","LY","MA","MACYS","MADRID","MAIF","MAISON","MAKEUP","MAN","MANAGEMENT","MANGO","MAP","MARKET","MARKETING","MARKETS","MARRIOTT","MARSHALLS","MASERATI","MATTEL","MBA","MC","MCKINSEY","MD","ME","MED","MEDIA","MEET","MELBOURNE","MEME","MEMORIAL","MEN","MENU","MERCKMSD","MG","MH","MIAMI","MICROSOFT","MIL","MINI","MINT","MIT","MITSUBISHI","MK","ML","MLB","MLS","MM","MMA","MN","MO","MOBI","MOBILE","MODA","MOE","MOI","MOM","MONASH","MONEY","MONSTER","MORMON","MORTGAGE","MOSCOW","MOTO","MOTORCYCLES","MOV","MOVIE","MP","MQ","MR","MS","MSD","MT","MTN","MTR","MU","MUSEUM","MUSIC","MUTUAL","MV","MW","MX","MY","MZ","NA","NAB","NAGOYA","NAME","NATURA","NAVY","NBA","NC","NE","NEC","NET","NETBANK","NETFLIX","NETWORK","NEUSTAR","NEW","NEWS","NEXT","NEXTDIRECT","NEXUS","NF","NFL","NG","NGO","NHK","NI","NICO","NIKE","NIKON","NINJA","NISSAN","NISSAY","NL","NO","NOKIA","NORTHWESTERNMUTUAL","NORTON","NOW","NOWRUZ","NOWTV","NP","NR","NRA","NRW","NTT","NU","NYC","NZ","OBI","OBSERVER","OFFICE","OKINAWA","OLAYAN","OLAYANGROUP","OLDNAVY","OLLO","OM","OMEGA","ONE","ONG","ONL","ONLINE","OOO","OPEN","ORACLE","ORANGE","ORG","ORGANIC","ORIGINS","OSAKA","OTSUKA","OTT","OVH","PA","PAGE","PANASONIC","PARIS","PARS","PARTNERS","PARTS","PARTY","PASSAGENS","PAY","PCCW","PE","PET","PF","PFIZER","PG","PH","PHARMACY","PHD","PHILIPS","PHONE","PHOTO","PHOTOGRAPHY","PHOTOS","PHYSIO","PICS","PICTET","PICTURES","PID","PIN","PING","PINK","PIONEER","PIZZA","PK","PL","PLACE","PLAY","PLAYSTATION","PLUMBING","PLUS","PM","PN","PNC","POHL","POKER","POLITIE","PORN","POST","PR","PRAMERICA","PRAXI","PRESS","PRIME","PRO","PROD","PRODUCTIONS","PROF","PROGRESSIVE","PROMO","PROPERTIES","PROPERTY","PROTECTION","PRU","PRUDENTIAL","PS","PT","PUB","PW","PWC","PY","QA","QPON","QUEBEC","QUEST","RACING","RADIO","RE","READ","REALESTATE","REALTOR","REALTY","RECIPES","RED","REDSTONE","REDUMBRELLA","REHAB","REISE","REISEN","REIT","RELIANCE","REN","RENT","RENTALS","REPAIR","REPORT","REPUBLICAN","REST","RESTAURANT","REVIEW","REVIEWS","REXROTH","RICH","RICHARDLI","RICOH","RIL","RIO","RIP","RO","ROCHER","ROCKS","RODEO","ROGERS","ROOM","RS","RSVP","RU","RUGBY","RUHR","RUN","RW","RWE","RYUKYU","SA","SAARLAND","SAFE","SAFETY","SAKURA","SALE","SALON","SAMSCLUB","SAMSUNG","SANDVIK","SANDVIKCOROMANT","SANOFI","SAP","SARL","SAS","SAVE","SAXO","SB","SBI","SBS","SC","SCA","SCB","SCHAEFFLER","SCHMIDT","SCHOLARSHIPS","SCHOOL","SCHULE","SCHWARZ","SCIENCE","SCOT","SD","SE","SEARCH","SEAT","SECURE","SECURITY","SEEK","SELECT","SENER","SERVICES","SES","SEVEN","SEW","SEX","SEXY","SFR","SG","SH","SHANGRILA","SHARP","SHAW","SHELL","SHIA","SHIKSHA","SHOES","SHOP","SHOPPING","SHOUJI","SHOW","SHOWTIME","SI","SILK","SINA","SINGLES","SITE","SJ","SK","SKI","SKIN","SKY","SKYPE","SL","SLING","SM","SMART","SMILE","SN","SNCF","SO","SOCCER","SOCIAL","SOFTBANK","SOFTWARE","SOHU","SOLAR","SOLUTIONS","SONG","SONY","SOY","SPA","SPACE","SPORT","SPOT","SR","SRL","SS","ST","STADA","STAPLES","STAR","STATEBANK","STATEFARM","STC","STCGROUP","STOCKHOLM","STORAGE","STORE","STREAM","STUDIO","STUDY","STYLE","SU","SUCKS","SUPPLIES","SUPPLY","SUPPORT","SURF","SURGERY","SUZUKI","SV","SWATCH","SWISS","SX","SY","SYDNEY","SYSTEMS","SZ","TAB","TAIPEI","TALK","TAOBAO","TARGET","TATAMOTORS","TATAR","TATTOO","TAX","TAXI","TC","TCI","TD","TDK","TEAM","TECH","TECHNOLOGY","TEL","TEMASEK","TENNIS","TEVA","TF","TG","TH","THD","THEATER","THEATRE","TIAA","TICKETS","TIENDA","TIFFANY","TIPS","TIRES","TIROL","TJ","TJMAXX","TJX","TK","TKMAXX","TL","TM","TMALL","TN","TO","TODAY","TOKYO","TOOLS","TOP","TORAY","TOSHIBA","TOTAL","TOURS","TOWN","TOYOTA","TOYS","TR","TRADE","TRADING","TRAINING","TRAVEL","TRAVELCHANNEL","TRAVELERS","TRAVELERSINSURANCE","TRUST","TRV","TT","TUBE","TUI","TUNES","TUSHU","TV","TVS","TW","TZ","UA","UBANK","UBS","UG","UK","UNICOM","UNIVERSITY","UNO","UOL","UPS","US","UY","UZ","VA","VACATIONS","VANA","VANGUARD","VC","VE","VEGAS","VENTURES","VERISIGN","VERSICHERUNG","VET","VG","VI","VIAJES","VIDEO","VIG","VIKING","VILLAS","VIN","VIP","VIRGIN","VISA","VISION","VIVA","VIVO","VLAANDEREN","VN","VODKA","VOLKSWAGEN","VOLVO","VOTE","VOTING","VOTO","VOYAGE","VU","VUELOS","WALES","WALMART","WALTER","WANG","WANGGOU","WATCH","WATCHES","WEATHER","WEATHERCHANNEL","WEBCAM","WEBER","WEBSITE","WED","WEDDING","WEIBO","WEIR","WF","WHOSWHO","WIEN","WIKI","WILLIAMHILL","WIN","WINDOWS","WINE","WINNERS","WME","WOLTERSKLUWER","WOODSIDE","WORK","WORKS","WORLD","WOW","WS","WTC","WTF","XBOX","XEROX","XFINITY","XIHUAN","XIN","XN--11B4C3D","XN--1CK2E1B","XN--1QQW23A","XN--2SCRJ9C","XN--30RR7Y","XN--3BST00M","XN--3DS443G","XN--3E0B707E","XN--3HCRJ9C","XN--3PXU8K","XN--42C2D9A","XN--45BR5CYL","XN--45BRJ9C","XN--45Q11C","XN--4DBRK0CE","XN--4GBRIM","XN--54B7FTA0CC","XN--55QW42G","XN--55QX5D","XN--5SU34J936BGSG","XN--5TZM5G","XN--6FRZ82G","XN--6QQ986B3XL","XN--80ADXHKS","XN--80AO21A","XN--80AQECDR1A","XN--80ASEHDB","XN--80ASWG","XN--8Y0A063A","XN--90A3AC","XN--90AE","XN--90AIS","XN--9DBQ2A","XN--9ET52U","XN--9KRT00A","XN--B4W605FERD","XN--BCK1B9A5DRE4C","XN--C1AVG","XN--C2BR7G","XN--CCK2B3B","XN--CCKWCXETD","XN--CG4BKI","XN--CLCHC0EA0B2G2A9GCD","XN--CZR694B","XN--CZRS0T","XN--CZRU2D","XN--D1ACJ3B","XN--D1ALF","XN--E1A4C","XN--ECKVDTC9D","XN--EFVY88H","XN--FCT429K","XN--FHBEI","XN--FIQ228C5HS","XN--FIQ64B","XN--FIQS8S","XN--FIQZ9S","XN--FJQ720A","XN--FLW351E","XN--FPCRJ9C3D","XN--FZC2C9E2C","XN--FZYS8D69UVGM","XN--G2XX48C","XN--GCKR3F0F","XN--GECRJ9C","XN--GK3AT1E","XN--H2BREG3EVE","XN--H2BRJ9C","XN--H2BRJ9C8C","XN--HXT814E","XN--I1B6B1A6A2E","XN--IMR513N","XN--IO0A7I","XN--J1AEF","XN--J1AMH","XN--J6W193G","XN--JLQ480N2RG","XN--JLQ61U9W7B","XN--JVR189M","XN--KCRX77D1X4A","XN--KPRW13D","XN--KPRY57D","XN--KPUT3I","XN--L1ACC","XN--LGBBAT1AD8J","XN--MGB9AWBF","XN--MGBA3A3EJT","XN--MGBA3A4F16A","XN--MGBA7C0BBN0A","XN--MGBAAKC7DVF","XN--MGBAAM7A8H","XN--MGBAB2BD","XN--MGBAH1A3HJKRD","XN--MGBAI9AZGQP6J","XN--MGBAYH7GPA","XN--MGBBH1A","XN--MGBBH1A71E","XN--MGBC0A9AZCG","XN--MGBCA7DZDO","XN--MGBCPQ6GPA1A","XN--MGBERP4A5D4AR","XN--MGBGU82A","XN--MGBI4ECEXP","XN--MGBPL2FH","XN--MGBT3DHD","XN--MGBTX2B","XN--MGBX4CD0AB","XN--MIX891F","XN--MK1BU44C","XN--MXTQ1M","XN--NGBC5AZD","XN--NGBE9E0A","XN--NGBRX","XN--NODE","XN--NQV7F","XN--NQV7FS00EMA","XN--NYQY26A","XN--O3CW4H","XN--OGBPF8FL","XN--OTU796D","XN--P1ACF","XN--P1AI","XN--PGBS0DH","XN--PSSY2U","XN--Q7CE6A","XN--Q9JYB4C","XN--QCKA1PMC","XN--QXA6A","XN--QXAM","XN--RHQV96G","XN--ROVU88B","XN--RVC1E0AM3E","XN--S9BRJ9C","XN--SES554G","XN--T60B56A","XN--TCKWE","XN--TIQ49XQYJ","XN--UNUP4Y","XN--VERMGENSBERATER-CTB","XN--VERMGENSBERATUNG-PWB","XN--VHQUV","XN--VUQ861B","XN--W4R85EL8FHU5DNRA","XN--W4RS40L","XN--WGBH1C","XN--WGBL6A","XN--XHQ521B","XN--XKC2AL3HYE2A","XN--XKC2DL3A5EE0H","XN--Y9A3AQ","XN--YFRO4I67O","XN--YGBI2AMMX","XN--ZFR164B","XXX","XYZ","YACHTS","YAHOO","YAMAXUN","YANDEX","YE","YODOBASHI","YOGA","YOKOHAMA","YOU","YOUTUBE","YT","YUN","ZA","ZAPPOS","ZARA","ZERO","ZIP","ZM","ZONE","ZUERICH","ZW"]};e.exports=new Set(r.tlds.map(e=>e.toLowerCase()))},function(e,t,n){"use strict";const r=n(16),o=n(79),i={};i.Map=class extends Map{slice(){return new i.Map(this)}},e.exports=o.extend({type:"symbol",terms:{map:{init:new i.Map}},coerce:{method(e,{schema:t,error:n}){const r=t.$_terms.map.get(e);return r&&(e=r),t._flags.only&&"symbol"!=typeof e?{value:e,errors:n("symbol.map",{map:t.$_terms.map})}:{value:e}}},validate(e,{error:t}){if("symbol"!=typeof e)return{value:e,errors:t("symbol.base")}},rules:{map:{method(e){e&&!e[Symbol.iterator]&&"object"==typeof e&&(e=Object.entries(e)),r(e&&e[Symbol.iterator],"Iterable must be an iterable or object");const t=this.clone(),n=[];for(const o of e){r(o&&o[Symbol.iterator],"Entry must be an iterable");const[e,i]=o;r("object"!=typeof e&&"function"!=typeof e&&"symbol"!=typeof e,"Key must not be of type object, function, or Symbol"),r("symbol"==typeof i,"Value must be a Symbol"),t.$_terms.map.set(e,i),n.push(i)}return t.valid(...n)}}},manifest:{build:(e,t)=>(t.map&&(e=e.map(t.map)),e)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},function(e,t,n){"use strict";const r=n(16),o=n(79),i=n(22);e.exports=o.extend({type:"binary",coerce:{from:"string",method(e,{schema:t}){try{return{value:Buffer.from(e,t._flags.encoding)}}catch(e){}}},validate(e,{error:t}){if(!Buffer.isBuffer(e))return{value:e,errors:t("binary.base")}},rules:{encoding:{method(e){return r(Buffer.isEncoding(e),"Invalid encoding:",e),this.$_setFlag("encoding",e)}},length:{method(e){return this.$_addRule({name:"length",method:"length",args:{limit:e},operator:"="})},validate:(e,t,{limit:n},{name:r,operator:o,args:a})=>i.compare(e.length,n,o)?e:t.error("binary."+r,{limit:a.limit,value:e}),args:[{name:"limit",ref:!0,assert:i.limit,message:"must be a positive integer"}]},max:{method(e){return this.$_addRule({name:"max",method:"length",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"length",args:{limit:e},operator:">="})}}},cast:{string:{from:e=>Buffer.isBuffer(e),to:(e,t)=>e.toString()}},messages:{"binary.base":"{{#label}} must be a buffer or a string","binary.length":"{{#label}} must be {{#limit}} bytes","binary.max":"{{#label}} must be less than or equal to {{#limit}} bytes","binary.min":"{{#label}} must be at least {{#limit}} bytes"}})},function(e,t,n){const{toHex:r}=n(21),{Hasher:o}=n(28),i=e=>{if(e){const t=function(e){const t=e.replace("#",""),n=parseInt(t.slice(0,2),16)/255,r=parseInt(t.slice(2,4),16)/255,o=parseInt(t.slice(4,6),16)/255,i=Math.max(n,r,o),a=Math.min(n,r,o);let s,l;const u=(i+a)/2;if(i===a)s=0,l=0;else{const e=i-a;switch(l=u>.5?e/(2-i-a):e/(i+a),i){case n:s=(r-o)/e+(r<o?6:0);break;case r:s=(o-n)/e+2;break;case o:s=(n-r)/e+4}s/=6}return[s,l,u]}(e),n=[t[0]];t[1]>.7?n.push(.7):n.push(t[1]),t[2]>.6?n.push(.6):t[2]<.3?n.push(.3):n.push(t[2]);const r=[n[0],n[1],n[2]-.1],o=s(...n);return{startColor:s(...r),endColor:o}}return{startColor:"#2B3845",endColor:"#5A7A8A"}};function a(e){return"#"+r(o.SHA3.hash224(e)).slice(-6)}function s(e,t,n){let r,o,i;if(0===t)r=n,o=n,i=n;else{const a=(e,t,n)=>{let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e},s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;r=a(l,s,e+1/3),o=a(l,s,e),i=a(l,s,e-1/3)}return"#"+[Math.round(255*r),Math.round(255*o),Math.round(255*i)].map(e=>e.toString(16).padStart(2,0)).join("")}e.exports={getNftBGColor:i,getNftBGColorFromDid:function(e){return i(a(e))},DEFAULT_COLOR:{startColor:"#2B3845",endColor:"#5A7A8A"},getPassportColorFromDid:a}},function(e,t,n){const r=n(1354);e.exports={createRoutes:r}},function(e,t,n){const r=n(251),o=n(1355),i=n(700),a=r.Router();e.exports=e=>(i.init(e),a.use(o),a)},function(e,t,n){const r=n(251),o=n(1356),i=n(700),a=r.Router();a.get("/.well-known/acme-challenge/:token",async(e,t)=>{const n=await i.httpChallenge.findOne({key:e.params.token});return o.debug("acme challenge",{token:e.params.token,challenge:n}),n?t.send(n.value):t.status(404).send()}),e.exports=a},function(e,t,n){e.exports=n(40)(n(1357).name)},function(e){e.exports=JSON.parse('{"name":"@abtnode/certificate-manager","version":"1.7.23","description":"Manage ABT Node SSL certificates","author":"polunzh <polunzh@gmail.com>","homepage":"https://github.com/ArcBlock/blocklet-server#readme","license":"Apache-2.0","main":"lib/certificate-manager.js","publishConfig":{"access":"public"},"files":["libs","routes","sdk","states","validators","index.js","README.md"],"repository":{"type":"git","url":"git+https://github.com/ArcBlock/blocklet-server.git"},"scripts":{"lint":"eslint libs routes sdk states validators index.js","lint:fix":"npm run lint -- --fix","test":"node tools/jest.js","coverage":"npm run test -- --coverage"},"bugs":{"url":"https://github.com/ArcBlock/blocklet-server/issues"},"dependencies":{"@abtnode/cron":"1.7.23","@abtnode/db":"1.7.23","@abtnode/logger":"1.7.23","@abtnode/queue":"1.7.23","@abtnode/util":"1.7.23","@fidm/x509":"^1.2.1","@greenlock/manager":"^3.1.0","@nedb/core":"^1.1.0","@nedb/multi":"^1.2.2","@root/acme":"^3.1.0","@root/csr":"^0.8.1","@root/keypairs":"^0.10.1","@root/pem":"^1.0.4","acme-http-01-webroot":"^3.0.0","axios":"^0.27.2","debug":"^4.3.3","express":"^4.17.1","joi":"^17.6.0","lodash.get":"^4.4.2","moment":"^2.29.1","parse-domain":"^3.0.3","punycode":"^2.1.1","ursa-optional":"^0.10.2"},"gitHead":"aa13838b7597bce11851d0b902575f861aa1ab34"}')},function(e,t){function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}e.exports=e=>{const t={};return new Proxy({},{get(r,o){if("init"===o)return(...r)=>n(t,e(...r));if(t[o])return t[o];throw new Error(`State ${String(o)} may not be initialized`)}})}},function(e,t,n){const r=n(349);e.exports=class extends r{constructor(e){super(e,{filename:"account.db"})}}},function(e,t,n){function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const a=n(17),s=n(9),l=n(8),u=n(1361),{EventEmitter:p}=n(24),c=n(1362).name,d=n(701)(Number(process.env.NEDB_MULTI_PORT)),f=n(40)(c);class h extends p{constructor(e,t){super();const n=t.db||{};this.filename=s.join(e,t.filename),this.options=Object.freeze(u(t)),this.db=new d(o({filename:this.filename,timestampData:!0},n)),f.info("initialized",{filename:this.filename}),this.ready=!1,this.readyCallbacks=[],this.db.loadDatabase(e=>{e?(f.error("failed to load disk database "+this.filename,{error:e}),console.error(e)):(this.ready=!0,this.readyCallbacks.length&&this.readyCallbacks.forEach(e=>e()))}),this.asyncDB=new Proxy(this.db,{get:(e,t)=>"function"==typeof e[t]?l.promisify((...n)=>{const r=n[n.length-1],o=n.slice(0,n.length-1);e[t](...o,(e,...t)=>e?r(e):1===t.length?r(null,t[0]):r(null,t))}).bind(e):e[t]})}onReady(e){this.ready?e():this.readyCallbacks.push(e)}paginate(e,t,n){const{pageSize:r=20,page:o=1}=n||{},i=Math.min(100,r);return new Promise((n,r)=>{this.db.find(e).sort(t).exec((e,t)=>{if(e)return r(e);const a=Math.ceil(t.length/i),s=t.length,l=(o-1)*i,u=t.slice(l,l+i);return u.forEach(e=>{e.id=e._id}),n({list:u,paging:{total:s,pageSize:i,pageCount:a,page:o}})})})}async updateById(e,t,n={}){const[,r]=await this.asyncDB.update({_id:e},t,o({multi:!1,upsert:!1,returnUpdatedDocs:!0},n));return r}update(...e){if(0===e.length)throw new Error("param is required by update method");return"string"==typeof e[0]?this.updateById(...e):this.asyncDB.update(e[0],e[1],o({returnUpdatedDocs:!0},e[2]||{}))}count(e={}){return new Promise((t,n)=>{this.db.count(e,(e,r)=>e?n(e):t(r))})}remove(e={},t={multi:!1}){return new Promise((n,r)=>{this.db.remove(e,t,(e,t)=>e?r(e):n(t))})}reset(){a.unlinkSync(this.filename)}find(...e){return 0===e.length?this.asyncDB.find({}):this.asyncDB.find(...e)}findOne(...e){return 0===e.length?this.asyncDB.findOne({}):this.asyncDB.findOne(...e)}insert(...e){return this.asyncDB.insert(...e)}compactDatafile(){this.db.persistence.compactDatafile(e=>{e&&console.error("failed to compact datafile: "+this.filename,e)})}}h.renameIdFiledName=(e,t="_id",n="id")=>{if(!e)return e;const r=e=>{e[t]&&(e[n]=e[t],delete e[t])};return Array.isArray(e)?(e.forEach(r),e):(r(e),e)},e.exports=h},function(e,t,n){(function(e){var n="[object Arguments]",r="[object Function]",o="[object GeneratorFunction]",i="[object Map]",a="[object Set]",s=/\w*$/,l=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,p={};p[n]=p["[object Array]"]=p["[object ArrayBuffer]"]=p["[object DataView]"]=p["[object Boolean]"]=p["[object Date]"]=p["[object Float32Array]"]=p["[object Float64Array]"]=p["[object Int8Array]"]=p["[object Int16Array]"]=p["[object Int32Array]"]=p[i]=p["[object Number]"]=p["[object Object]"]=p["[object RegExp]"]=p[a]=p["[object String]"]=p["[object Symbol]"]=p["[object Uint8Array]"]=p["[object Uint8ClampedArray]"]=p["[object Uint16Array]"]=p["[object Uint32Array]"]=!0,p["[object Error]"]=p[r]=p["[object WeakMap]"]=!1;var c="object"==typeof global&&global&&global.Object===Object&&global,d="object"==typeof self&&self&&self.Object===Object&&self,f=c||d||Function("return this")(),h=t&&!t.nodeType&&t,g=h&&"object"==typeof e&&e&&!e.nodeType&&e,m=g&&g.exports===h;function y(e,t){return e.set(t[0],t[1]),e}function v(e,t){return e.add(t),e}function b(e,t,n,r){var o=-1,i=e?e.length:0;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function _(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function T(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function E(e,t){return function(n){return e(t(n))}}function S(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var x,w=Array.prototype,A=Function.prototype,k=Object.prototype,M=f["__core-js_shared__"],O=(x=/[^.]+$/.exec(M&&M.keys&&M.keys.IE_PROTO||""))?"Symbol(src)_1."+x:"",D=A.toString,I=k.hasOwnProperty,R=k.toString,N=RegExp("^"+D.call(I).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=m?f.Buffer:void 0,F=f.Symbol,L=f.Uint8Array,j=E(Object.getPrototypeOf,Object),B=Object.create,P=k.propertyIsEnumerable,H=w.splice,U=Object.getOwnPropertySymbols,$=C?C.isBuffer:void 0,W=E(Object.keys,Object),V=ge(f,"DataView"),Y=ge(f,"Map"),z=ge(f,"Promise"),G=ge(f,"Set"),q=ge(f,"WeakMap"),K=ge(Object,"create"),J=_e(V),X=_e(Y),Q=_e(z),Z=_e(G),ee=_e(q),te=F?F.prototype:void 0,ne=te?te.valueOf:void 0;function re(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function oe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ie(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ae(e){this.__data__=new oe(e)}function se(e,t){var r=Ee(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Se(e)}(e)&&I.call(e,"callee")&&(!P.call(e,"callee")||R.call(e)==n)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],o=r.length,i=!!o;for(var a in e)!t&&!I.call(e,a)||i&&("length"==a||ve(a,o))||r.push(a);return r}function le(e,t,n){var r=e[t];I.call(e,t)&&Te(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function ue(e,t){for(var n=e.length;n--;)if(Te(e[n][0],t))return n;return-1}function pe(e,t,l,u,c,d,f){var h;if(u&&(h=d?u(e,c,d,f):u(e)),void 0!==h)return h;if(!Ae(e))return e;var g=Ee(e);if(g){if(h=function(e){var t=e.length,n=e.constructor(t);t&&"string"==typeof e[0]&&I.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!t)return function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(e,h)}else{var m=ye(e),E=m==r||m==o;if(xe(e))return function(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}(e,t);if("[object Object]"==m||m==n||E&&!d){if(_(e))return d?e:{};if(h=function(e){return"function"!=typeof e.constructor||be(e)?{}:function(e){return Ae(e)?B(e):{}}(j(e))}(E?{}:e),!t)return function(e,t){return fe(e,me(e),t)}(e,function(e,t){return e&&fe(t,ke(t),e)}(h,e))}else{if(!p[m])return d?e:{};h=function(e,t,n,r){var o=e.constructor;switch(t){case"[object ArrayBuffer]":return de(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return function(e,t){var n=t?de(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,t){var n=t?de(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,r);case i:return function(e,t,n){return b(t?n(T(e),!0):T(e),y,new e.constructor)}(e,r,n);case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return function(e){var t=new e.constructor(e.source,s.exec(e));return t.lastIndex=e.lastIndex,t}(e);case a:return function(e,t,n){return b(t?n(S(e),!0):S(e),v,new e.constructor)}(e,r,n);case"[object Symbol]":return l=e,ne?Object(ne.call(l)):{}}var l}(e,m,pe,t)}}f||(f=new ae);var x=f.get(e);if(x)return x;if(f.set(e,h),!g)var w=l?function(e){return function(e,t,n){var r=t(e);return Ee(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,ke,me)}(e):ke(e);return function(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n,e););}(w||e,(function(n,r){w&&(n=e[r=n]),le(h,r,pe(n,t,l,u,r,e,f))})),h}function ce(e){return!(!Ae(e)||(t=e,O&&O in t))&&(we(e)||_(e)?N:l).test(_e(e));var t}function de(e){var t=new e.constructor(e.byteLength);return new L(t).set(new L(e)),t}function fe(e,t,n,r){n||(n={});for(var o=-1,i=t.length;++o<i;){var a=t[o],s=r?r(n[a],e[a],a,n,e):void 0;le(n,a,void 0===s?e[a]:s)}return n}function he(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function ge(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ce(n)?n:void 0}re.prototype.clear=function(){this.__data__=K?K(null):{}},re.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},re.prototype.get=function(e){var t=this.__data__;if(K){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return I.call(t,e)?t[e]:void 0},re.prototype.has=function(e){var t=this.__data__;return K?void 0!==t[e]:I.call(t,e)},re.prototype.set=function(e,t){return this.__data__[e]=K&&void 0===t?"__lodash_hash_undefined__":t,this},oe.prototype.clear=function(){this.__data__=[]},oe.prototype.delete=function(e){var t=this.__data__,n=ue(t,e);return!(n<0)&&(n==t.length-1?t.pop():H.call(t,n,1),!0)},oe.prototype.get=function(e){var t=this.__data__,n=ue(t,e);return n<0?void 0:t[n][1]},oe.prototype.has=function(e){return ue(this.__data__,e)>-1},oe.prototype.set=function(e,t){var n=this.__data__,r=ue(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},ie.prototype.clear=function(){this.__data__={hash:new re,map:new(Y||oe),string:new re}},ie.prototype.delete=function(e){return he(this,e).delete(e)},ie.prototype.get=function(e){return he(this,e).get(e)},ie.prototype.has=function(e){return he(this,e).has(e)},ie.prototype.set=function(e,t){return he(this,e).set(e,t),this},ae.prototype.clear=function(){this.__data__=new oe},ae.prototype.delete=function(e){return this.__data__.delete(e)},ae.prototype.get=function(e){return this.__data__.get(e)},ae.prototype.has=function(e){return this.__data__.has(e)},ae.prototype.set=function(e,t){var n=this.__data__;if(n instanceof oe){var r=n.__data__;if(!Y||r.length<199)return r.push([e,t]),this;n=this.__data__=new ie(r)}return n.set(e,t),this};var me=U?E(U,Object):function(){return[]},ye=function(e){return R.call(e)};function ve(e,t){return!!(t=null==t?9007199254740991:t)&&("number"==typeof e||u.test(e))&&e>-1&&e%1==0&&e<t}function be(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||k)}function _e(e){if(null!=e){try{return D.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Te(e,t){return e===t||e!=e&&t!=t}(V&&"[object DataView]"!=ye(new V(new ArrayBuffer(1)))||Y&&ye(new Y)!=i||z&&"[object Promise]"!=ye(z.resolve())||G&&ye(new G)!=a||q&&"[object WeakMap]"!=ye(new q))&&(ye=function(e){var t=R.call(e),n="[object Object]"==t?e.constructor:void 0,r=n?_e(n):void 0;if(r)switch(r){case J:return"[object DataView]";case X:return i;case Q:return"[object Promise]";case Z:return a;case ee:return"[object WeakMap]"}return t});var Ee=Array.isArray;function Se(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}(e.length)&&!we(e)}var xe=$||function(){return!1};function we(e){var t=Ae(e)?R.call(e):"";return t==r||t==o}function Ae(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ke(e){return Se(e)?se(e):function(e){if(!be(e))return W(e);var t=[];for(var n in Object(e))I.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return pe(e,!0,!0)}}).call(this,n(95)(e))},function(e){e.exports=JSON.parse('{"name":"@abtnode/db","version":"1.7.23","description":"@nedb/core wrapper","author":"polunzh <polunzh@gmail.com>","homepage":"https://github.com/ArcBlock/blocklet-server#readme","license":"MIT","main":"lib/db.js","directories":{"lib":"lib"},"files":["lib"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/ArcBlock/blocklet-server.git"},"scripts":{"lint":"eslint tests lib","lint:fix":"eslint --fix tests lib","test":"node tools/jest.js","coverage":"npm run test -- --coverage"},"bugs":{"url":"https://github.com/ArcBlock/blocklet-server/issues"},"dependencies":{"@abtnode/logger":"1.7.23","@nedb/core":"^1.2.2","@nedb/multi":"^1.2.2","lodash.clonedeep":"^4.5.0"},"devDependencies":{"jest":"^27.4.5"},"gitHead":"aa13838b7597bce11851d0b902575f861aa1ab34"}')},function(e,t,n){const r=n(1364),o=n(351),i=n(1367);t.create=function(e){class t{constructor(t){this.options=t,this.persistence=new i(e,t)}}for(const{name:n,supportsCursor:i}of o.METHODS_DESCRIPTIONS)t.prototype[n]=r.create(e,n,i);return t}},function(e,t,n){const r=n(350),o=n(702),i=n(1366);t.create=function(e,t,n){return function(...a){return n&&!o.endsWithCallback(a)?new i(e,this.options,a):r(e,this.options,t,a)}}},function(e,t,n){"use strict";var r={recursive:!0,inherited:!0,stack:!1,private:!1,exclude:[],include:[]};t.setDefaults=function(e){for(var t in e)r[t]=e[t]};var o={};function i(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}t.register=function(e,t){t=t||{};var n="Error"!==e.prototype.name?e.prototype.name:null,r=t.name||n||e.name||(new e).name;o[r]={constructor:e,options:t}},t.registerAll=function(e,n){e.forEach((function(e){t.register(e,n)}))},t.registerObject=function(e,n){for(var r in e)if(e.hasOwnProperty(r)){var o=e[r],a=i(n);a.name=r,t.register(o,a)}},t.registerAll([Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError]),t.toObject=function(e,n){n=n||{},o[e.name]||(n.name=e.name,t.register(e.constructor,n));var i=o[e.name].options,a={};for(var s in r)n.hasOwnProperty(s)?a[s]=n[s]:i.hasOwnProperty(s)?a[s]=i[s]:a[s]=r[s];var l={name:e.name,message:e.message};for(var u in a.stack&&(l.stack=e.stack),e){if(-1===a.include.indexOf(u)){if("function"==typeof e[u])continue;if(-1!==a.exclude.indexOf(u))continue;if(!a.inherited&&!e.hasOwnProperty(u))continue;if(!a.stack&&"stack"===u)continue;if(!a.private&&("_"===u[0]||"_"===u[u.length-1]))continue}var p=e[u];"object"==typeof p&&p&&p.name&&p.message?a.recursive&&(l[u]=t.toObject(p,n)):l[u]=p}return l},t.fromObject=function(e,n){n=n||{};var i=o[e.name];i||(i=o.Error);var a=i.constructor,s=i.options,l={};for(var u in r)n.hasOwnProperty(u)?l[u]=n[u]:s.hasOwnProperty(u)?l[u]=s[u]:l[u]=r[u];var p=Object.create(a.prototype);for(var c in e){if(l.recursive&&"object"==typeof e[c]){var d=e[c];if(d&&d.name&&d.message){p[c]=t.fromObject(d,n);continue}}p[c]=e[c]}return!p.stack&&Error.captureStackTrace&&Error.captureStackTrace(p,t.fromObject),p},t.stringify=function(e,n){return JSON.stringify(t.toObject(e,n))},t.parse=function(e,n){return t.fromObject(JSON.parse(e),n)}},function(e,t,n){const r=n(350),o=n(351);e.exports=class{constructor(e,t,n){this.findArgs=n,this.options=t,this.socket=e}sort(e){return this.sort=e,this}skip(e){return this.skip=e,this}limit(e){return this.limit=e,this}projection(e){return this.projection=e,this}toJSON(){return{skip:this.skip,sort:this.sort,limit:this.limit,projection:this.projection,findArgs:this.findArgs}}exec(e){r(this.socket,this.options,o.EXECUTE_CURSOR_PRIVATE,[this,e])}}},function(e,t,n){const r=n(350),o=n(351);e.exports=class{constructor(e,t){this.socket=e,this.options=t}setAutocompactionInterval(e){r(this.socket,this.options,o.PERSISTENCE_SET_AUTOCOMPACTION_INTERVAL,[e])}stopAutocompaction(){r(this.socket,this.options,o.PERSISTENCE_STOP_AUTOCOMPACTION)}compactDatafile(){r(this.socket,this.options,o.PERSISTENCE_COMPACT_DATAFILE)}}},function(e,t,n){const r=n(319),{CERT_STATUS:o}=n(1369),i=n(349),{getCertInfo:a}=n(1370);e.exports=class extends i{constructor(e){super(e,{filename:"certificate.db"})}async updateStatus(e,t){if(!Object.values(o).includes(t))throw new Error("invalid domain status");return super.update({domain:e},{$set:{status:t}})}insert(e){return e.certificate&&(e.meta=a(e.certificate)),super.insert(e)}async update(e,t,n){return t.certificate?t.meta=a(t.certificate):r(t,"$set.certificate")&&(t.$set.meta=a(r(t,"$set.certificate"))),super.update(e,t,n)}}},function(e,t){e.exports=Object.freeze({CERT_STATUS:{waiting:"waiting",creating:"creating",generated:"generated",renewaling:"renewaling",error:"error"},CERT_SOURCE:{letsEncrypt:"lets_encrypt",upload:"upload"}})},function(e,t,n){const r=n(20),o=n(17),i=n(319),{Certificate:a,PrivateKey:s}=n(1371),l=(e,t)=>r.createHash(t).update(e).digest("hex").match(/.{2}/g).join(":").toUpperCase();e.exports={ensureDir:e=>(o.existsSync(e)||o.mkdirSync(e,{recursive:!0}),e),getFingerprint:l,validateCertificate:(e,t)=>{const n=a.fromPEM(e.certificate),r=s.fromPEM(e.privateKey),o=Buffer.allocUnsafe(100),l=r.sign(o,"sha512");if(!n.publicKey.verify(o,l,"sha512"))throw new Error("Invalid certificate: signature verify failed");const u=i(n,"subject.commonName","");if(t&&t!==u)throw new Error("Invalid certificate: domain does not match");const p=i(n,"validFrom","");if(!p||new Date(p).getTime()>Date.now())throw new Error("Invalid certificate: not in valid period");const c=i(n,"validTo","");if(!c||new Date(c).getTime()<Date.now())throw new Error("Invalid certificate: not in valid period");return n},getCertInfo:e=>{const t=a.fromPEM(e);return{validFrom:t.validFrom.valueOf(),validTo:t.validTo.valueOf(),issuer:{countryName:t.issuer.countryName.valueOf(),organizationName:t.issuer.organizationName.valueOf(),commonName:t.issuer.commonName.valueOf()},sans:t.dnsNames,validityPeriod:t.validTo-t.validFrom,fingerprintAlg:"SHA256",fingerprint:l(t.raw,"sha256")}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(352);t.bytesFromIP=r.bytesFromIP,t.bytesToIP=r.bytesToIP,t.getOID=r.getOID,t.getOIDName=r.getOIDName;var o=n(703);t.PublicKey=o.PublicKey,t.PrivateKey=o.PrivateKey,t.RSAPublicKey=o.RSAPublicKey,t.RSAPrivateKey=o.RSAPrivateKey;var i=n(1374);t.Certificate=i.Certificate,t.DistinguishedName=i.DistinguishedName},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8);class o{static parse(e){const t=[],n=e.toString("utf8").split("\n").map(e=>e.trim()).filter(e=>""!==e&&!e.startsWith("#"));for(;n.length>0;)t.push(i(n));if(0===t.length)throw new Error("PEM: no block");return t}constructor(e,t){this.type=e,this.body=t,this.headers=Object.create(null)}get procType(){return this.getHeader("Proc-Type")}getHeader(e){const t=this.headers[e];return null==t?"":t}setHeader(e,t){if(e.includes(":"))throw new Error("pem: cannot encode a header key that contains a colon");if(""===e||""===t)throw new Error("pem: invalid header key or value");this.headers[e]=t}toString(){let e="-----BEGIN "+this.type+"-----\n";const t=Object.keys(this.headers);if(t.length>0){const n=this.procType;""!==n&&(e+=`Proc-Type: ${n}\n`),t.sort();for(const n of t)"Proc-Type"!==n&&(e+=`${n}: ${this.headers[n]}\n`);e+="\n"}const n=this.body.toString("base64");let r=0;for(;r<n.length;)e+=n.slice(r,r+64)+"\n",r+=64;return e+="-----END "+this.type+"-----\n",e}toBuffer(){return Buffer.from(this.toString(),"utf8")}valueOf(){return this.body}toJSON(){return{type:this.type,body:this.body,headers:this.headers}}[r.inspect.custom](e,t){return`<${this.constructor.name} ${r.inspect(this.toJSON(),t)}>`}}function i(e){let t=e.shift();if(null==t||!t.startsWith("-----BEGIN ")||!t.endsWith("-----"))throw new Error("pem: invalid BEGIN line");const n=t.slice("-----BEGIN ".length,t.length-"-----".length);if(""===n)throw new Error("pem: invalid type");const r=[];for(t=e.shift();null!=t&&t.includes(": ");){const n=t.split(": ");if(2!==n.length||""===n[0]||""===n[1])throw new Error("pem: invalid Header line");r.push(n),t=e.shift()}let i="";for(;null!=t&&!t.startsWith("-----END ");)i+=t,t=e.shift();if(null==t||t!==`-----END ${n}-----`)throw new Error("pem: invalid END line");const a=new o(n,Buffer.from(i,"base64"));if(""===i||a.body.toString("base64")!==i)throw new Error("pem: invalid base64 body");for(const e of r)a.setHeader(e[0],e[1]);return a}t.PEM=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8),o=n(705);var i,a;!function(e){e[e.UNIVERSAL=0]="UNIVERSAL",e[e.APPLICATION=64]="APPLICATION",e[e.CONTEXT_SPECIFIC=128]="CONTEXT_SPECIFIC",e[e.PRIVATE=192]="PRIVATE"}(i=t.Class||(t.Class={})),function(e){e[e.NONE=0]="NONE",e[e.BOOLEAN=1]="BOOLEAN",e[e.INTEGER=2]="INTEGER",e[e.BITSTRING=3]="BITSTRING",e[e.OCTETSTRING=4]="OCTETSTRING",e[e.NULL=5]="NULL",e[e.OID=6]="OID",e[e.ENUMERATED=10]="ENUMERATED",e[e.UTF8=12]="UTF8",e[e.SEQUENCE=16]="SEQUENCE",e[e.SET=17]="SET",e[e.NUMERICSTRING=18]="NUMERICSTRING",e[e.PRINTABLESTRING=19]="PRINTABLESTRING",e[e.T61STRING=20]="T61STRING",e[e.IA5STRING=22]="IA5STRING",e[e.UTCTIME=23]="UTCTIME",e[e.GENERALIZEDTIME=24]="GENERALIZEDTIME",e[e.GENERALSTRING=27]="GENERALSTRING"}(a=t.Tag||(t.Tag={}));class s{constructor(e,t){this.buf=e,this.bitLen=t}at(e){if(e<0||e>=this.bitLen||!Number.isInteger(e))return 0;const t=Math.floor(e/8),n=7-e%8;return this.buf[t]>>n&1}rightAlign(){const e=8-this.bitLen%8;if(8===e||0===this.buf.length)return this.buf;const t=Buffer.alloc(this.buf.length);t[0]=this.buf[0]>>e;for(let n=1;n<this.buf.length;n++)t[n]=this.buf[n-1]<<8-e,t[n]|=this.buf[n]>>e;return t}}t.BitString=s;class l{static Bool(e){const t=new l(i.UNIVERSAL,a.BOOLEAN,Buffer.from([e?255:0]));return t._value=e,t}static parseBool(e){if(!(e instanceof Buffer)||1!==e.length)throw new Error("ASN1 syntax error: invalid boolean");switch(e[0]){case 0:return!1;case 255:return!0;default:throw new Error("ASN1 syntax error: invalid boolean")}}static Integer(e){if(e instanceof Buffer){const t=new l(i.UNIVERSAL,a.INTEGER,e);return t._value=e.toString("hex"),t}if(!Number.isSafeInteger(e))throw new Error("ASN1 syntax error: invalid integer");let t;if(e>=-128&&e<128)t=Buffer.alloc(1),t.writeInt8(e,0);else if(e>=-32768&&e<32768)t=Buffer.alloc(2),t.writeIntBE(e,0,2);else if(e>=-8388608&&e<8388608)t=Buffer.alloc(3),t.writeIntBE(e,0,3);else if(e>=-2147483648&&e<2147483648)t=Buffer.alloc(4),t.writeIntBE(e,0,4);else if(e>=-549755813888&&e<549755813888)t=Buffer.alloc(5),t.writeIntBE(e,0,5);else{if(!(e>=-0x800000000000&&e<0x800000000000))throw new Error("ASN1 syntax error: invalid Integer");t=Buffer.alloc(6),t.writeIntBE(e,0,6)}const n=new l(i.UNIVERSAL,a.INTEGER,t);return n._value=e,n}static parseInteger(e){if(!(e instanceof Buffer)||0===e.length)throw new Error("ASN1 syntax error: invalid Integer");return e.length>6?e.toString("hex"):e.readIntBE(0,e.length)}static parseIntegerNum(e){const t=l.parseInteger(e);if("number"!=typeof t)throw new Error("ASN1 syntax error: invalid Integer number");return t}static parseIntegerStr(e){const t=l.parseInteger(e);return"number"==typeof t?t.toString(16):t}static BitString(e){e instanceof Buffer&&(e=new s(e,8*e.length));const t=8*e.buf.length-e.bitLen,n=Buffer.alloc(e.buf.length+1);return n.writeInt8(t,0),e.buf.copy(n,1),new l(i.UNIVERSAL,a.BITSTRING,n)}static parseBitString(e){if(!(e instanceof Buffer)||0===e.length)throw new Error("ASN1 syntax error: invalid BitString");const t=e[0];if(t>7||1===e.length&&t>0||0!=(e[e.length-1]&(1<<e[0])-1))throw new Error("ASN1 syntax error: invalid padding bits in BIT STRING");return new s(e.slice(1),8*(e.length-1)-t)}static Null(){const e=new l(i.UNIVERSAL,a.NULL,Buffer.alloc(0));return e._value=null,e}static parseNull(e){if(!(e instanceof Buffer)||0!==e.length)throw new Error("ASN1 syntax error: invalid null");return null}static OID(e){const t=e.split(".");if(0===t.length)throw new Error("ASN1 syntax error: invalid Object Identifier");const n=[];n.push(40*c(t[0])+c(t[1]));const r=[];for(let e=2;e<t.length;++e){let o=c(t[e]);for(r.length=0,r.push(127&o);o>127;)o>>>=7,r.unshift(127&o|128);n.push(...r)}const o=new l(i.UNIVERSAL,a.OID,Buffer.from(n));return o._value=e,o}static parseOID(e){if(!(e instanceof Buffer)||0===e.length)throw new Error("ASN1 syntax error: invalid OID");let t=Math.floor(e[0]/40)+"."+e[0]%40,n=0;for(let r=1;r<e.length;r++)e[r]>=128?(n+=127&e[r],n<<=7):(t+="."+(n+e[r]),n=0);return t}static UTF8(e){const t=new l(i.UNIVERSAL,a.UTF8,Buffer.from(e,"utf8"));return t._value=e,t}static parseUTF8(e){if(!(e instanceof Buffer))throw new Error("parse ASN1 error: invalid Buffer");return e.toString("utf8")}static NumericString(e){if(!u(e))throw new Error("ASN1 syntax error: invalid NumericString");const t=new l(i.UNIVERSAL,a.NUMERICSTRING,Buffer.from(e,"utf8"));return t._value=e,t}static parseNumericString(e){if(!(e instanceof Buffer))throw new Error("parse ASN1 error: invalid Buffer");const t=e.toString("utf8");if(!u(t))throw new Error("ASN1 syntax error: invalid NumericString");return t}static PrintableString(e){const t=new l(i.UNIVERSAL,a.PRINTABLESTRING,Buffer.from(e,"utf8"));return t._value=e,t}static parsePrintableString(e){if(!(e instanceof Buffer))throw new Error("parse ASN1 error: invalid Buffer");return e.toString("utf8")}static IA5String(e){if(!p(e))throw new Error("ASN1 syntax error: invalid IA5String");const t=new l(i.UNIVERSAL,a.IA5STRING,Buffer.from(e,"utf8"));return t._value=e,t}static parseIA5String(e){if(!(e instanceof Buffer))throw new Error("parse ASN1 error: invalid Buffer");const t=e.toString("utf8");if(!p(t))throw new Error("ASN1 syntax error: invalid IA5String");return t}static T61String(e){const t=new l(i.UNIVERSAL,a.T61STRING,Buffer.from(e,"utf8"));return t._value=e,t}static parseT61String(e){if(!(e instanceof Buffer))throw new Error("parse ASN1 error: invalid Buffer");return e.toString("utf8")}static GeneralString(e){const t=new l(i.UNIVERSAL,a.GENERALSTRING,Buffer.from(e,"utf8"));return t._value=e,t}static parseGeneralString(e){if(!(e instanceof Buffer))throw new Error("parse ASN1 error: invalid Buffer");return e.toString("utf8")}static UTCTime(e){let t="";const n=[];n.push((""+e.getUTCFullYear()).substr(2)),n.push(""+(e.getUTCMonth()+1)),n.push(""+e.getUTCDate()),n.push(""+e.getUTCHours()),n.push(""+e.getUTCMinutes()),n.push(""+e.getUTCSeconds());for(const e of n)e.length<2&&(t+="0"),t+=e;t+="Z";const r=new l(i.UNIVERSAL,a.UTCTIME,Buffer.from(t,"utf8"));return r._value=e,r}static parseUTCTime(e){if(!(e instanceof Buffer)||0===e.length)throw new Error("ASN1 syntax error: invalid UTC Time");const t=e.toString("utf8"),n=new Date;let r=c(t.substr(0,2));r=r>=50?1900+r:2e3+r;const o=c(t.substr(2,2))-1,i=c(t.substr(4,2)),a=c(t.substr(6,2)),s=c(t.substr(8,2));let l=0,u=0,p="";if(t.length>11&&(u=10,p=t.charAt(u),"+"!==p&&"-"!==p&&(l=c(t.substr(10,2)),u+=2)),n.setUTCFullYear(r,o,i),n.setUTCHours(a,s,l,0),u>0&&(p=t.charAt(u),"+"===p||"-"===p)){let e=60*c(t.substr(u+1,2))+c(t.substr(u+4,2));e*=6e4,"+"===p?n.setTime(+n-e):n.setTime(+n+e)}return n}static GeneralizedTime(e){let t="";const n=[];n.push(""+e.getUTCFullYear()),n.push(""+(e.getUTCMonth()+1)),n.push(""+e.getUTCDate()),n.push(""+e.getUTCHours()),n.push(""+e.getUTCMinutes()),n.push(""+e.getUTCSeconds());for(const e of n)e.length<2&&(t+="0"),t+=e;t+="Z";const r=new l(i.UNIVERSAL,a.GENERALIZEDTIME,Buffer.from(t,"utf8"));return r._value=e,r}static parseGeneralizedTime(e){if(!(e instanceof Buffer)||0===e.length)throw new Error("ASN1 syntax error: invalid Generalized Time");const t=e.toString("utf8"),n=new Date,r=c(t.substr(0,4)),o=c(t.substr(4,2))-1,i=c(t.substr(6,2)),a=c(t.substr(8,2)),s=c(t.substr(10,2)),l=c(t.substr(12,2));let u=0,p=0,d=!1;"Z"===t.charAt(t.length-1)&&(d=!0);const f=t.length-5,h=t.charAt(f);if("+"===h||"-"===h){p=60*c(t.substr(f+1,2))+c(t.substr(f+4,2)),p*=6e4,"+"===h&&(p*=-1),d=!0}return"."===t.charAt(14)&&(u=1e3*parseFloat(t.substr(14))),d?(n.setUTCFullYear(r,o,i),n.setUTCHours(a,s,l,u),n.setTime(+n+p)):(n.setFullYear(r,o,i),n.setHours(a,s,l,u)),n}static parseTime(e,t){switch(e){case a.UTCTIME:return l.parseUTCTime(t);case a.GENERALIZEDTIME:return l.parseGeneralizedTime(t);default:throw new Error("Invalid ASN1 time tag")}}static Set(e){const t=new l(i.UNIVERSAL,a.SET,Buffer.concat(e.map(e=>e.toDER())));return t._value=e,t}static Seq(e){const t=new l(i.UNIVERSAL,a.SEQUENCE,Buffer.concat(e.map(e=>e.toDER())));return t._value=e,t}static Spec(e,t,n=!0){const r=Array.isArray(t)?Buffer.concat(t.map(e=>e.toDER())):t.toDER();Array.isArray(t)&&(n=!0);const o=new l(i.CONTEXT_SPECIFIC,e,r,n);return o._value=t,o}static fromDER(e,t=!1){return l._fromDER(new o.BufferVisitor(e),t)}static parseDER(e,t,n){const r=l._fromDER(new o.BufferVisitor(e),!1);if(r.class!==t&&r.tag!==n)throw new Error(`invalid ASN.1 DER for class ${t} and tag ${n}`);return r}static parseDERWithTemplate(e,t){const n=l._fromDER(new o.BufferVisitor(e),!0),r={},i=n.validate(t,r);if(null!=i)throw i.data=n,i;return r}static _parseCompound(e,t){const n=[],r=e.length,i=new o.BufferVisitor(e);let a=0;for(;a<r;){const e=i.end;n.push(l._fromDER(i,t)),a+=i.end-e}return n}static _fromDER(e,t){if(!(e.buf instanceof Buffer)||0===e.length)throw new Error("ASN1 syntax error: invalid Generalized Time");e.mustWalk(1,"Too few bytes to read ASN.1 tag.");const n=e.start,r=e.buf[n],o=192&r,i=31&r,s=function(e){e.mustWalk(1,"Too few bytes to read ASN.1 value length.");const t=e.buf[e.start];if(0==(128&t))return t;const n=127&t;return e.mustWalk(n,"Too few bytes to read ASN.1 value length."),e.buf.readUIntBE(e.start,n)}(e);if(e.mustHas(s),0!==s&&i===a.NULL)throw new Error("invalid value length or NULL tag.");e.mustWalk(s);const u=32==(32&r),p=new l(o,i,e.buf.slice(e.start,e.end),u);return u&&t&&(p._value=l._parseCompound(p.bytes,t)),p._der=e.buf.slice(n,e.end),p}constructor(e,t,n,r=!1){this.class=e,this.tag=t,this.bytes=n,this.isCompound=r||t===a.SEQUENCE||t===a.SET,this._value=void 0,this._der=null}get value(){return void 0===this._value&&(this._value=this.valueOf()),this._value}get DER(){return null==this._der&&(this._der=this.toDER()),this._der}mustCompound(e="asn1 object value is not compound"){if(!this.isCompound||!Array.isArray(this.value)){const t=new Error(e);throw t.data=this.toJSON(),t}return this.value}equals(e){return e instanceof l&&(this.class===e.class&&this.tag===e.tag&&this.isCompound===e.isCompound&&!!this.bytes.equals(e.bytes))}toDER(){let e=this.class|this.tag;this.isCompound&&(e|=32);const t=function(e){if(e<=127)return 0;if(e<=255)return 1;if(e<=65535)return 2;if(e<=16777215)return 3;if(e<=4294967295)return 4;if(e<=0xffffffffff)return 5;if(e<=0xffffffffffff)return 6;throw new Error("invalid value length")}(this.bytes.length),n=Buffer.allocUnsafe(2+t+this.bytes.length);return n.writeInt8(e,0),0===t?(n.writeUInt8(this.bytes.length,1),this.bytes.copy(n,2)):(n.writeUInt8(128|t,1),n.writeUIntBE(this.bytes.length,2,t),this.bytes.copy(n,2+t)),n}valueOf(){if(this.isCompound)return l._parseCompound(this.bytes,!1);if(this.class!==i.UNIVERSAL)return this.bytes;switch(this.tag){case a.BOOLEAN:return l.parseBool(this.bytes);case a.INTEGER:return l.parseInteger(this.bytes);case a.BITSTRING:return l.parseBitString(this.bytes);case a.NULL:return l.parseNull(this.bytes);case a.OID:return l.parseOID(this.bytes);case a.UTF8:return l.parseUTF8(this.bytes);case a.NUMERICSTRING:return l.parseNumericString(this.bytes);case a.PRINTABLESTRING:return l.parsePrintableString(this.bytes);case a.T61STRING:return l.parseT61String(this.bytes);case a.IA5STRING:return l.parseIA5String(this.bytes);case a.GENERALSTRING:return l.parseGeneralString(this.bytes);case a.UTCTIME:return l.parseUTCTime(this.bytes);case a.GENERALIZEDTIME:return l.parseGeneralizedTime(this.bytes);default:return this.bytes}}validate(e,t={}){if(this.class!==e.class)return new Error(`ASN.1 object validate failure for ${e.name} : error class ${i[this.class]}`);if(!(Array.isArray(e.tag)?e.tag:[e.tag]).includes(this.tag))return new Error(`ASN.1 object validate failure for ${e.name}: error tag ${a[this.tag]}`);if(null!=e.capture&&(t[e.capture]=this),Array.isArray(e.value)){const n=this.mustCompound(e.name+" need compound ASN1 value");for(let r=0,o=0;r<e.value.length;r++)if(null!=n[o]){const i=n[o].validate(e.value[r],t);if(null==i)o++;else if(!0!==e.value[r].optional)return i}else if(!0!==e.value[r].optional)return new Error(`ASN.1 object validate failure for ${e.value[r].name}: not exists`)}else if(null!=e.value){const n=this.tag===a.BITSTRING?this.bytes.slice(1):this.bytes;return l.fromDER(n).validate(e.value,t)}return null}toJSON(){let e=this.value;return Array.isArray(e)&&(e=e.map(e=>e.toJSON())),{class:i[this.class],tag:this.class===i.UNIVERSAL?a[this.tag]:this.tag,value:e}}[r.inspect.custom](e,t){return t.depth<=2&&(t.depth=10),`<${this.constructor.name} ${r.inspect(this.toJSON(),t)}>`}}function u(e){for(const t of e){const e=t.charCodeAt(0);if(32!==e&&(e<48||e>57))return!1}return!0}function p(e){for(const t of e)if(t.charCodeAt(0)>=128)return!1;return!0}function c(e,t=10){const n=parseInt(e,t);if(Number.isNaN(n))throw new Error(`Invalid numeric string "${e}" in radix ${t}.`);return n}t.ASN1=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8),o=n(20),i=n(704),a=n(352),s=n(703),l=Object.create(null);l.CN=a.getOID("commonName"),l.commonName="CN",l.C=a.getOID("countryName"),l.countryName="C",l.L=a.getOID("localityName"),l.localityName="L",l.ST=a.getOID("stateOrProvinceName"),l.stateOrProvinceName="ST",l.O=a.getOID("organizationName"),l.organizationName="O",l.OU=a.getOID("organizationalUnitName"),l.organizationalUnitName="OU",l.E=a.getOID("emailAddress"),l.emailAddress="E";const u={name:"Certificate",class:i.Class.UNIVERSAL,tag:i.Tag.SEQUENCE,value:[{name:"Certificate.TBSCertificate",class:i.Class.UNIVERSAL,tag:i.Tag.SEQUENCE,capture:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",class:i.Class.CONTEXT_SPECIFIC,tag:i.Tag.NONE,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",class:i.Class.UNIVERSAL,tag:i.Tag.INTEGER,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",class:i.Class.UNIVERSAL,tag:i.Tag.INTEGER,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",class:i.Class.UNIVERSAL,tag:i.Tag.SEQUENCE,value:[{name:"Certificate.TBSCertificate.signature.algorithm",class:i.Class.UNIVERSAL,tag:i.Tag.OID,capture:"certinfoSignatureOID"},{name:"Certificate.TBSCertificate.signature.parameters",class:i.Class.UNIVERSAL,tag:i.Tag.OCTETSTRING,optional:!0,capture:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",class:i.Class.UNIVERSAL,tag:i.Tag.SEQUENCE,capture:"certIssuer"},{name:"Certificate.TBSCertificate.validity",class:i.Class.UNIVERSAL,tag:i.Tag.SEQUENCE,value:[{name:"Certificate.TBSCertificate.validity.notBefore",class:i.Class.UNIVERSAL,tag:[i.Tag.UTCTIME,i.Tag.GENERALIZEDTIME],capture:"certValidityNotBefore"},{name:"Certificate.TBSCertificate.validity.notAfter",class:i.Class.UNIVERSAL,tag:[i.Tag.UTCTIME,i.Tag.GENERALIZEDTIME],capture:"certValidityNotAfter"}]},{name:"Certificate.TBSCertificate.subject",class:i.Class.UNIVERSAL,tag:i.Tag.SEQUENCE,capture:"certSubject"},s.publicKeyValidator,{name:"Certificate.TBSCertificate.issuerUniqueID",class:i.Class.CONTEXT_SPECIFIC,tag:i.Tag.BOOLEAN,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",class:i.Class.UNIVERSAL,tag:i.Tag.BITSTRING,capture:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",class:i.Class.CONTEXT_SPECIFIC,tag:i.Tag.INTEGER,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",class:i.Class.UNIVERSAL,tag:i.Tag.BITSTRING,capture:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",class:i.Class.CONTEXT_SPECIFIC,tag:i.Tag.BITSTRING,capture:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",class:i.Class.UNIVERSAL,tag:i.Tag.SEQUENCE,value:[{name:"Certificate.signatureAlgorithm.algorithm",class:i.Class.UNIVERSAL,tag:i.Tag.OID,capture:"certSignatureOID"},{name:"Certificate.TBSCertificate.signature.parameters",class:i.Class.UNIVERSAL,tag:i.Tag.OCTETSTRING,optional:!0,capture:"certSignatureParams"}]},{name:"Certificate.signatureValue",class:i.Class.UNIVERSAL,tag:i.Tag.BITSTRING,capture:"certSignature"}]};class p{constructor(){this.attributes=[],this.uniqueId=null}get commonName(){return this.getFieldValue("commonName")}get organizationName(){return this.getFieldValue("organizationName")}get organizationalUnitName(){return this.getFieldValue("organizationalUnitName")}get countryName(){return this.getFieldValue("countryName")}get localityName(){return this.getFieldValue("localityName")}get serialName(){return this.getFieldValue("serialName")}getHash(){const e=o.createHash("sha1");for(const t of this.attributes)e.update(t.oid),e.update(t.value);return e.digest()}getField(e){for(const t of this.attributes)if(e===t.oid||e===t.name||e===t.shortName)return t;return null}addField(e){y([e]),this.attributes.push(e)}setAttrs(e){y(e),this.attributes=e}toJSON(){const e={};for(const t of this.attributes){const n=t.shortName;"string"==typeof n&&""!==n&&(e[n]=t.value)}return e.uniqueId=this.uniqueId,e.attributes=this.attributes,e}getFieldValue(e){const t=this.getField(e);return null!=t?t.value:""}}t.DistinguishedName=p;class c{static fromPEMs(e){const t=[],n=i.PEM.parse(e);for(const e of n){if("CERTIFICATE"!==e.type&&"X509 CERTIFICATE"!==e.type&&"TRUSTED CERTIFICATE"!==e.type)throw new Error("Could not convert certificate from PEM: invalid type");if(e.procType.includes("ENCRYPTED"))throw new Error("Could not convert certificate from PEM: PEM is encrypted.");const n=i.ASN1.fromDER(e.body);t.push(new c(n))}if(0===t.length)throw new Error("No Certificate");return t}static fromPEM(e){return c.fromPEMs(e)[0]}constructor(e){const t=Object.create(null),n=e.validate(u,t);if(null!=n)throw new Error("Cannot read X.509 certificate: "+n.message);if(this.raw=e.DER,this.version=null==t.certVersion?0:i.ASN1.parseIntegerNum(t.certVersion.bytes)+1,this.serialNumber=i.ASN1.parseIntegerStr(t.certSerialNumber.bytes),this.signatureOID=i.ASN1.parseOID(t.certSignatureOID.bytes),this.signatureAlgorithm=a.getOIDName(this.signatureOID),this.infoSignatureOID=i.ASN1.parseOID(t.certinfoSignatureOID.bytes),this.signature=i.ASN1.parseBitString(t.certSignature.bytes).buf,this.validFrom=i.ASN1.parseTime(t.certValidityNotBefore.tag,t.certValidityNotBefore.bytes),this.validTo=i.ASN1.parseTime(t.certValidityNotAfter.tag,t.certValidityNotAfter.bytes),this.issuer=new p,this.issuer.setAttrs(v(t.certIssuer)),null!=t.certIssuerUniqueId&&(this.issuer.uniqueId=i.ASN1.parseBitString(t.certIssuerUniqueId.bytes)),this.subject=new p,this.subject.setAttrs(v(t.certSubject)),null!=t.certSubjectUniqueId&&(this.subject.uniqueId=i.ASN1.parseBitString(t.certSubjectUniqueId.bytes)),this.extensions=[],this.subjectKeyIdentifier="",this.authorityKeyIdentifier="",this.ocspServer="",this.issuingCertificateURL="",this.isCA=!1,this.maxPathLen=-1,this.basicConstraintsValid=!1,this.keyUsage=0,this.dnsNames=[],this.emailAddresses=[],this.ipAddresses=[],this.uris=[],null!=t.certExtensions){this.extensions=function(e){const t=[];for(const n of e.mustCompound())for(const e of n.mustCompound())t.push(d(e));return t}(t.certExtensions);for(const e of this.extensions)if("string"==typeof e.subjectKeyIdentifier&&(this.subjectKeyIdentifier=e.subjectKeyIdentifier),"string"==typeof e.authorityKeyIdentifier&&(this.authorityKeyIdentifier=e.authorityKeyIdentifier),"string"==typeof e.authorityInfoAccessOcsp&&(this.ocspServer=e.authorityInfoAccessOcsp),"string"==typeof e.authorityInfoAccessIssuers&&(this.issuingCertificateURL=e.authorityInfoAccessIssuers),"boolean"==typeof e.basicConstraintsValid&&(this.isCA=e.isCA,this.maxPathLen=e.maxPathLen,this.basicConstraintsValid=e.basicConstraintsValid),"number"==typeof e.keyUsage&&(this.keyUsage=e.keyUsage),Array.isArray(e.altNames))for(const t of e.altNames)null!=t.dnsName&&this.dnsNames.push(t.dnsName),null!=t.email&&this.emailAddresses.push(t.email),null!=t.ip&&this.ipAddresses.push(t.ip),null!=t.uri&&this.uris.push(t.uri)}this.publicKey=new s.PublicKey(t.publicKeyInfo),this.publicKeyRaw=this.publicKey.toDER(),this.tbsCertificate=t.tbsCertificate}getExtension(e,t=""){for(const n of this.extensions)if(e===n.oid||e===n.name)return""===t?n:n[t];return null}checkSignature(e){if(3===this.version&&!this.basicConstraintsValid||this.basicConstraintsValid&&!this.isCA)return new Error("The parent constraint violation error");if(!0!==this.getExtension("keyUsage","keyCertSign"))return new Error("The parent constraint violation error");if(!e.isIssuer(this))return new Error("The parent certificate did not issue the given child certificate");const t=function(e){switch(a.getOIDName(e)){case"sha1WithRsaEncryption":return"sha1";case"md5WithRsaEncryption":return"md5";case"sha256WithRsaEncryption":return"sha256";case"sha384WithRsaEncryption":return"sha384";case"sha512WithRsaEncryption":return"sha512";case"RSASSA-PSS":return"sha256";case"ecdsaWithSha1":return"sha1";case"ecdsaWithSha256":return"sha256";case"ecdsaWithSha384":return"sha384";case"ecdsaWithSha512":return"sha512";case"dsaWithSha1":return"sha1";case"dsaWithSha256":return"sha256";default:return""}}(e.signatureOID);if(""===t)return new Error("Unknown child signature OID.");return!1===this.publicKey.verify(e.tbsCertificate.DER,e.signature,t)?new Error("Child signature not matched"):null}isIssuer(e){return this.issuer.getHash().equals(e.subject.getHash())}verifySubjectKeyIdentifier(){return this.publicKey.getFingerprint("sha1","PublicKey").toString("hex")===this.subjectKeyIdentifier}toJSON(){const e={};for(const t of Object.keys(this))e[t]=b(this[t]);return delete e.tbsCertificate,e}[r.inspect.custom](e,t){return t.depth<=2&&(t.depth=10),`<${this.constructor.name} ${r.inspect(this.toJSON(),t)}>`}}function d(e){const t={};switch(t.oid=i.ASN1.parseOID(e.value[0].bytes),t.critical=!1,e.value[1].tag===i.Tag.BOOLEAN?(t.critical=i.ASN1.parseBool(e.value[1].bytes),t.value=e.value[2].bytes):t.value=e.value[1].bytes,t.name=a.getOIDName(t.oid),t.name){case"keyUsage":!function(e){const t=i.ASN1.parseBitString(i.ASN1.fromDER(e.value).bytes);let n=0,r=0;e.keyUsage=0;for(let n=0;n<9;n++)0!==t.at(n)&&(e.keyUsage|=1<<n);t.buf.length>0&&(n=t.buf[0],r=t.buf.length>1?t.buf[1]:0);e.digitalSignature=128==(128&n),e.nonRepudiation=64==(64&n),e.keyEncipherment=32==(32&n),e.dataEncipherment=16==(16&n),e.keyAgreement=8==(8&n),e.keyCertSign=4==(4&n),e.cRLSign=2==(2&n),e.encipherOnly=1==(1&n),e.decipherOnly=128==(128&r)}(t);break;case"basicConstraints":!function(e){const t=i.ASN1.fromDER(e.value).mustCompound();t.length>0&&t[0].tag===i.Tag.BOOLEAN?e.isCA=i.ASN1.parseBool(t[0].bytes):e.isCA=!1;let n=null;t.length>0&&t[0].tag===i.Tag.INTEGER?n=t[0].bytes:t.length>1&&(n=t[1].bytes);e.maxPathLen=null!==n?i.ASN1.parseInteger(n):-1;e.basicConstraintsValid=!0}(t);break;case"extKeyUsage":!function(e){const t=i.ASN1.fromDER(e.value).mustCompound();for(const n of t)e[a.getOIDName(i.ASN1.parseOID(n.bytes))]=!0}(t);break;case"nsCertType":!function(e){const t=i.ASN1.parseBitString(i.ASN1.fromDER(e.value).bytes);let n=0;t.buf.length>0&&(n=t.buf[0]);e.client=128==(128&n),e.server=64==(64&n),e.email=32==(32&n),e.objsign=16==(16&n),e.reserved=8==(8&n),e.sslCA=4==(4&n),e.emailCA=2==(2&n),e.objCA=1==(1&n)}(t);break;case"subjectAltName":case"issuerAltName":f(t);break;case"subjectKeyIdentifier":!function(e){const t=i.ASN1.parseDERWithTemplate(e.value,h);e.subjectKeyIdentifier=t.subjectKeyIdentifier.bytes.toString("hex")}(t);break;case"authorityKeyIdentifier":!function(e){const t=i.ASN1.parseDERWithTemplate(e.value,g);e.authorityKeyIdentifier=t.authorityKeyIdentifier.bytes.toString("hex")}(t);break;case"authorityInfoAccess":!function(e){const t=i.ASN1.parseDERWithTemplate(e.value,m);null!=t.authorityInfoAccessOcsp&&(e.authorityInfoAccessOcsp=t.authorityInfoAccessOcsp.bytes.toString());null!=t.authorityInfoAccessIssuers&&(e.authorityInfoAccessIssuers=t.authorityInfoAccessIssuers.bytes.toString())}(t)}return t}function f(e){e.altNames=[];const t=i.ASN1.fromDER(e.value).mustCompound();for(const n of t){const t={tag:n.tag,value:n.bytes};switch(e.altNames.push(t),n.tag){case 1:t.email=n.bytes.toString();break;case 2:t.dnsName=n.bytes.toString();break;case 6:t.uri=n.bytes.toString();break;case 7:t.ip=a.bytesToIP(n.bytes);break;case 8:t.oid=i.ASN1.parseOID(n.bytes)}}}t.Certificate=c;const h={name:"subjectKeyIdentifier",class:i.Class.UNIVERSAL,tag:i.Tag.OCTETSTRING,capture:"subjectKeyIdentifier"};const g={name:"authorityKeyIdentifier",class:i.Class.UNIVERSAL,tag:i.Tag.SEQUENCE,value:[{name:"authorityKeyIdentifier.value",class:i.Class.CONTEXT_SPECIFIC,tag:i.Tag.NONE,capture:"authorityKeyIdentifier"}]};const m={name:"authorityInfoAccess",class:i.Class.UNIVERSAL,tag:i.Tag.SEQUENCE,value:[{name:"authorityInfoAccess.authorityInfoAccessOcsp",class:i.Class.UNIVERSAL,tag:i.Tag.SEQUENCE,optional:!0,value:[{name:"authorityInfoAccess.authorityInfoAccessOcsp.oid",class:i.Class.UNIVERSAL,tag:i.Tag.OID},{name:"authorityInfoAccess.authorityInfoAccessOcsp.value",class:i.Class.CONTEXT_SPECIFIC,tag:i.Tag.OID,capture:"authorityInfoAccessOcsp"}]},{name:"authorityInfoAccess.authorityInfoAccessIssuers",class:i.Class.UNIVERSAL,tag:i.Tag.SEQUENCE,optional:!0,value:[{name:"authorityInfoAccess.authorityInfoAccessIssuers.oid",class:i.Class.UNIVERSAL,tag:i.Tag.OID},{name:"authorityInfoAccess.authorityInfoAccessIssuers.value",class:i.Class.CONTEXT_SPECIFIC,tag:i.Tag.OID,capture:"authorityInfoAccessIssuers"}]}]};function y(e){for(const t of e){if(null!=t.name&&""!==t.name||(null!=t.oid&&(t.name=a.getOIDName(t.oid)),""===t.name&&null!=t.shortName&&(t.name=a.getOIDName(l[t.shortName]))),null==t.oid||""===t.oid){if(""===t.name)throw new Error("Attribute oid not specified.");t.oid=a.getOID(t.name)}if(null!=t.shortName&&""!==t.shortName||(t.shortName=null==l[t.name]?"":l[t.name]),null==t.value)throw new Error("Attribute value not specified.")}}function v(e){const t=[];for(const r of e.mustCompound())for(const e of r.mustCompound()){const r=e.mustCompound(),o={};o.oid=i.ASN1.parseOID(r[0].bytes),o.value=r[1].value,o.valueTag=r[1].tag,o.name=a.getOIDName(o.oid),o.shortName=(n=o.name,null==l[n]?"":l[n]),t.push(o)}var n;return t}function b(e){return null==e||e instanceof Buffer||"function"!=typeof e.toJSON?e:e.toJSON()}},function(e,t,n){const r=n(349);e.exports=class extends r{constructor(e){super(e,{filename:"http-challenge.db"})}}},function(e,t,n){function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{WELLKNOWN_SERVICE_PATH_PREFIX:a}=n(25),{BLOCKLET_CONFIGURABLE_KEY:s}=n(100),{getDisplayName:l}=n(104),u=n(40)(n(686).name),p=n(112);e.exports={init(e,t,{prefix:n,type:r}={}){e.get(n+"/invitation",async(e,n)=>{const{inviteId:i}=e.query,c=e.headers["x-group-path-prefix"]||"/",d=await t.getNodeInfo();try{let f;if("blocklet"===r){const t=await e.getBlocklet();f={did:t.meta.did,appDid:t.appDid,url:t.environmentObj[s.BLOCKLET_APP_URL],name:l(t),version:t.meta.version,logo:p(c,a,"/blocklet/logo"),chainHost:t.configObj.CHAIN_HOST,passportColor:t.configObj[s.BLOCKLET_PASSPORT_COLOR],description:t.meta.description}}else f={did:d.did,appDid:d.did,url:"/",name:d.name,version:d.version,description:d.description};const h=f.did,g=(await t.getInvitations({teamDid:h})).find(e=>e.inviteId===i);if(!g||Date.now()>new Date(g.expireDate).getTime())return void n.status(404).send("Invitation not found or invitation has been used");const m=(await t.getRoles({teamDid:h})).find(e=>e.name===g.role);try{m.permissions=await t.getPermissionsByRole({teamDid:h,role:{name:m.name}})}catch(e){u.error("failed to get role permission",{teamDid:h,role:m.name,error:e}),m.permissions=[]}const y=await t.getUser({teamDid:d.did,user:{did:g.inviter.did}}),v={did:g.inviter.did,email:g.inviter.email,fullName:g.inviter.fullName,role:g.inviter.role,avatar:y&&y.avatar};n.json(o(o({},g),{},{info:f,inviter:v,inviterRaw:g.inviter,role:m||{}}))}catch(e){u.error("failed to get invitation info",{inviteId:i,error:e}),n.status(500).end()}})}}},function(e,t){e.exports={getVcFromPresentation:e=>{const t=Array.isArray(e.verifiableCredential)?e.verifiableCredential[0]:e.verifiableCredential;return JSON.parse(t)}}},function(e,t,n){const r=n(9),o=n(112),i=n(28),a=n(1379),{fromSecretKey:s,WalletType:l}=n(46),{WalletAuthenticator:u}=n(713),{DEFAULT_SERVICE_PATH:p,WELLKNOWN_SERVICE_PATH_PREFIX:c}=n(25),d=n(1438),f=n(721),h=n(723),g=l({role:i.types.RoleType.ROLE_APPLICATION,pk:i.types.KeyType.ED25519,hash:i.types.HashType.SHA3}),m=s(process.env.ABT_NODE_SK,g),y=(()=>{const e={};return{get:t=>e[t],set:(t,n)=>{e[t]=n}}})(),v=new u({wallet:m,baseUrl:h.baseUrl,appInfo:async({baseUrl:e})=>{const t=await y.get("node").getNodeInfo();return{name:t.name,description:t.description,icon:`${h.baseUrl||e}/images/node.png?version=${t.version}`,link:h.baseUrl||e,updateSubEndpoint:!0,subscriptionEndpoint:o(p,c,"websocket"),nodeDid:t.did}},chainInfo:{host:"none",id:"none"}}),b=new d({authenticator:v,tokenStorage:new a({dbPath:r.join(process.env.ABT_NODE_DATA_DIR,"auth.db"),dbPort:Number(process.env.NEDB_MULTI_PORT),onload:e=>{e&&console.error("Failed to load database from "+r.join(process.env.ABT_NODE_DATA_DIR,"auth.db"),e)}}),sendNotificationFn:(e,t)=>{const n={appId:m.address,appSk:m.secretKey,did:m.address};return f(e,t,n,process.env.ABT_NODE_SERVICE_PORT)}});e.exports={authenticator:v,handlers:b,wallet:m,context:y}},function(e,t,n){const r=n(1380),o=n(701),i=n(1404),a=n(10)(n(1405).name);e.exports=class extends i{constructor(e={}){if(super(e),!e.dbPath)throw new Error("DiskAuthStorage requires a valid dbPath option to initialize");this.options=e;const t=e.dbPort?o(e.dbPort):r;this.db=new t(Object.assign({filename:e.dbPath,autoload:!0,timestampData:!0},e)),this.db.loadDatabase(t=>{t&&a("failed to load disk database "+e.dbPath,{error:t})})}read(e){return new Promise((t,n)=>{e?this.db.findOne({token:e},(e,r)=>{e?n(e):t(r)}):n(new Error("token is required to read auth record"))})}create(e,t="created"){return new Promise((n,r)=>{e?this.db.insert({token:e,status:t},(o,i)=>{o?r(o):(this.emit("create",i),a("emit.create",{token:e,status:t}),n(i))}):r(new Error("token is required to create auth record"))})}update(e,t={}){return new Promise((n,r)=>{e?this.db.update({token:e},{$set:t},{multi:!1,upsert:!1,returnUpdatedDocs:!0},(o,i,s)=>{o?r(o):(this.emit("update",s),a("emit.update",{token:e,updates:t}),n(s))}):r(new Error("token is required to update auth record"))})}delete(e){return new Promise((t,n)=>{e?this.db.remove({token:e},{multi:!0},(r,o)=>{r?n(r):(this.emit("destroy",e),t(o))}):n(new Error("token is required to delete auth record"))})}exist(e,t){return new Promise((n,r)=>{e?this.db.findOne({token:e,did:t},(e,t)=>{n(!e&&!!t)}):r(new Error("token is required to check auth record"))})}clear(){return new Promise((e,t)=>{this.db.remove({},{multi:!0},(n,r)=>{n?t(n):e(r)})})}}},function(e,t,n){e.exports=n(706),e.exports.Model=n(150),e.exports.PromisedDatastore=n(1403)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(n(1382)),o=i(n(105));function i(e){return e&&e.__esModule?e:{default:e}}t.default=(0,o.default)((function(e,t,n){return(0,r.default)(e,1,t,n)}),3),e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(535)),o=s(n(544)),i=s(n(90)),a=s(n(105));function s(e){return e&&e.__esModule?e:{default:e}}t.default=(0,a.default)((function(e,t,n,a){return(0,r.default)(t)(e,(0,o.default)((0,i.default)(n)),a)}),4),e.exports=t.default},function(e,t,n){const r=n(1384);function o(){this.buffer=[],this.ready=!1,this.open=!0,this.queue=r((e,t)=>{const n=[...e.arguments],r=e.arguments[e.arguments.length-1];"function"==typeof r?n[n.length-1]=function(){setImmediate(t);try{r.apply(null,arguments)}catch(e){process.emit("uncaughtException",e)}}:r||0===e.arguments.length?n.push(()=>{t()}):n[n.length-1]=function(){t()},e.fn.apply(e.this,n)},1)}o.prototype.push=function(e,t,n){if(!0===n)this.open=!1,this.processBuffer(),this.queue.push(e);else{if(!this.open){const t=new Error("Attempting operation on closed database."),n=e.arguments;if(n.length>0){const e=n[n.length-1];if("function"==typeof e)return void e(t)}throw t}this._push(e,t)}},o.prototype._push=function(e,t){this.ready||t?this.queue.push(e):this.buffer.push(e)},o.prototype.processBuffer=function(){let e;for(this.ready=!0,e=0;e<this.buffer.length;e++)this.queue.push(this.buffer[e]);this.buffer=[]},e.exports=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=(0,o.default)(e);return(0,r.default)((e,t)=>{n(e[0],t)},t,1)};var r=i(n(1385)),o=i(n(90));function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){if(null==t)t=1;else if(0===t)throw new RangeError("Concurrency must not be zero");var s=(0,a.default)(e),l=0,u=[];const p={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function c(e,t){return e?t?void(p[e]=p[e].filter(e=>e!==t)):p[e]=[]:Object.keys(p).forEach(e=>p[e]=[])}function d(e,...t){p[e].forEach(e=>e(...t))}var f=!1;function h(e,t,n,r){if(null!=r&&"function"!=typeof r)throw new Error("task callback must be a function");var i,a;function s(e,...t){return e?n?a(e):i():t.length<=1?i(t[0]):void i(t)}b.started=!0;var l={data:e,callback:n?s:r||s};if(t?b._tasks.unshift(l):b._tasks.push(l),f||(f=!0,(0,o.default)(()=>{f=!1,b.process()})),n||!r)return new Promise((e,t)=>{i=e,a=t})}function g(e){return function(t,...n){l-=1;for(var r=0,o=e.length;r<o;r++){var i=e[r],a=u.indexOf(i);0===a?u.shift():a>0&&u.splice(a,1),i.callback(t,...n),null!=t&&d("error",t,i.data)}l<=b.concurrency-b.buffer&&d("unsaturated"),b.idle()&&d("drain"),b.process()}}function m(e){return!(0!==e.length||!b.idle())&&((0,o.default)(()=>d("drain")),!0)}const y=e=>t=>{if(!t)return new Promise((t,n)=>{!function(e,t){const n=(...r)=>{c(e,n),t(...r)};p[e].push(n)}(e,(e,r)=>{if(e)return n(e);t(r)})});c(e),function(e,t){p[e].push(t)}(e,t)};var v=!1,b={_tasks:new i.default,*[Symbol.iterator](){yield*b._tasks[Symbol.iterator]()},concurrency:t,payload:n,buffer:t/4,started:!1,paused:!1,push(e,t){if(Array.isArray(e)){if(m(e))return;return e.map(e=>h(e,!1,!1,t))}return h(e,!1,!1,t)},pushAsync(e,t){if(Array.isArray(e)){if(m(e))return;return e.map(e=>h(e,!1,!0,t))}return h(e,!1,!0,t)},kill(){c(),b._tasks.empty()},unshift(e,t){if(Array.isArray(e)){if(m(e))return;return e.map(e=>h(e,!0,!1,t))}return h(e,!0,!1,t)},unshiftAsync(e,t){if(Array.isArray(e)){if(m(e))return;return e.map(e=>h(e,!0,!0,t))}return h(e,!0,!0,t)},remove(e){b._tasks.remove(e)},process(){if(!v){for(v=!0;!b.paused&&l<b.concurrency&&b._tasks.length;){var e=[],t=[],n=b._tasks.length;b.payload&&(n=Math.min(n,b.payload));for(var o=0;o<n;o++){var i=b._tasks.shift();e.push(i),u.push(i),t.push(i.data)}l+=1,0===b._tasks.length&&d("empty"),l===b.concurrency&&d("saturated");var a=(0,r.default)(g(e));s(t,a)}v=!1}},length:()=>b._tasks.length,running:()=>l,workersList:()=>u,idle:()=>b._tasks.length+l===0,pause(){b.paused=!0},resume(){!1!==b.paused&&(b.paused=!1,(0,o.default)(b.process))}};return Object.defineProperties(b,{saturated:{writable:!1,value:y("saturated")},unsaturated:{writable:!1,value:y("unsaturated")},empty:{writable:!1,value:y("empty")},drain:{writable:!1,value:y("drain")},error:{writable:!1,value:y("error")}}),b};var r=s(n(231)),o=s(n(533)),i=s(n(1386)),a=s(n(90));function s(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{constructor(){this.head=this.tail=null,this.length=0}removeLink(e){return e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev,e.prev=e.next=null,this.length-=1,e}empty(){for(;this.head;)this.shift();return this}insertAfter(e,t){t.prev=e,t.next=e.next,e.next?e.next.prev=t:this.tail=t,e.next=t,this.length+=1}insertBefore(e,t){t.prev=e.prev,t.next=e,e.prev?e.prev.next=t:this.head=t,e.prev=t,this.length+=1}unshift(e){this.head?this.insertBefore(this.head,e):o(this,e)}push(e){this.tail?this.insertAfter(this.tail,e):o(this,e)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var e=this.head;e;)yield e.data,e=e.next}remove(e){for(var t=this.head;t;){var{next:n}=t;e(t)&&this.removeLink(t),t=n}return this}}function o(e,t){e.length=1,e.head=e.tail=t}t.default=r,e.exports=t.default},function(e,t,n){e.exports.BinarySearchTree=n(709),e.exports.AVLTree=n(1388)},function(e,t,n){const r=n(8),o=n(709),i=n(710);function a(e){this.tree=new s(e)}function s(e){e=e||{},this.left=null,this.right=null,this.parent=void 0!==e.parent?e.parent:null,e.hasOwnProperty("key")&&(this.key=e.key),this.data=e.hasOwnProperty("value")?[e.value]:[],this.unique=e.unique||!1,this.vkUnique=e.vkUnique||!1,this.compareKeys=e.compareKeys||i.defaultCompareKeysFunction,this.checkValueEquality=e.checkValueEquality||i.defaultCheckValueEquality}r.inherits(s,o),a._AVLTree=s,s.prototype.checkHeightCorrect=function(){let e,t;if(this.hasOwnProperty("key")){if(this.left&&void 0===this.left.height)throw new Error("Undefined height for node "+this.left.key);if(this.right&&void 0===this.right.height)throw new Error("Undefined height for node "+this.right.key);if(void 0===this.height)throw new Error("Undefined height for node "+this.key);if(e=this.left?this.left.height:0,t=this.right?this.right.height:0,this.height!==1+Math.max(e,t))throw new Error("Height constraint failed for node "+this.key);this.left&&this.left.checkHeightCorrect(),this.right&&this.right.checkHeightCorrect()}},s.prototype.balanceFactor=function(){return(this.left?this.left.height:0)-(this.right?this.right.height:0)},s.prototype.checkBalanceFactors=function(){if(Math.abs(this.balanceFactor())>1)throw new Error("Tree is unbalanced at node "+this.key);this.left&&this.left.checkBalanceFactors(),this.right&&this.right.checkBalanceFactors()},s.prototype.checkIsAVLT=function(){s.super_.prototype.checkIsBST.call(this),this.checkHeightCorrect(),this.checkBalanceFactors()},a.prototype.checkIsAVLT=function(){this.tree.checkIsAVLT()},s.prototype.rightRotation=function(){const e=this,t=this.left;let n,r,o,i;return t?(n=t.right,e.parent?(t.parent=e.parent,e.parent.left===e?e.parent.left=t:e.parent.right=t):t.parent=null,t.right=e,e.parent=t,e.left=n,n&&(n.parent=e),r=t.left?t.left.height:0,o=n?n.height:0,i=e.right?e.right.height:0,e.height=Math.max(o,i)+1,t.height=Math.max(r,e.height)+1,t):this},s.prototype.leftRotation=function(){const e=this,t=this.right;let n,r,o,i;return t?(n=t.left,e.parent?(t.parent=e.parent,e.parent.left===e?e.parent.left=t:e.parent.right=t):t.parent=null,t.left=e,e.parent=t,e.right=n,n&&(n.parent=e),r=e.left?e.left.height:0,o=n?n.height:0,i=t.right?t.right.height:0,e.height=Math.max(r,o)+1,t.height=Math.max(i,e.height)+1,t):this},s.prototype.rightTooSmall=function(){return this.balanceFactor()<=1?this:(this.left.balanceFactor()<0&&this.left.leftRotation(),this.rightRotation())},s.prototype.leftTooSmall=function(){return this.balanceFactor()>=-1?this:(this.right.balanceFactor()>0&&this.right.rightRotation(),this.leftRotation())},s.prototype.rebalanceAlongPath=function(e){let t,n,r=this;if(!this.hasOwnProperty("key"))return delete this.height,this;for(n=e.length-1;n>=0;n-=1)e[n].height=1+Math.max(e[n].left?e[n].left.height:0,e[n].right?e[n].right.height:0),e[n].balanceFactor()>1&&(t=e[n].rightTooSmall(),0===n&&(r=t)),e[n].balanceFactor()<-1&&(t=e[n].leftTooSmall(),0===n&&(r=t));return r},s.prototype.insert=function(e,t){const n=[];let r=this;if(!this.hasOwnProperty("key"))return this.key=e,this.data.push(t),this.height=1,this;for(;;){if(0===r.compareKeys(r.key,e)){if(r.unique){if(r.data.includes(t))return;const n=new Error(`Can't insert key ${e}, it violates the unique constraint`);throw n.key=e,n.errorType="uniqueViolated",n}if(this.vkUnique&&r.data.includes(t))return;return r.data.push(t),this}if(n.push(r),r.compareKeys(e,r.key)<0){if(!r.left){n.push(r.createLeftChild({key:e,value:t}));break}r=r.left}else{if(!r.right){n.push(r.createRightChild({key:e,value:t}));break}r=r.right}}return this.rebalanceAlongPath(n)},a.prototype.insert=function(e,t){const n=this.tree.insert(e,t);n&&(this.tree=n)},s.prototype.delete=function(e,t){const n=[];let r;let o=this;const i=[];if(!this.hasOwnProperty("key"))return this;for(;0!==o.compareKeys(e,o.key);)if(i.push(o),o.compareKeys(e,o.key)<0){if(!o.left)return this;o=o.left}else{if(!o.right)return this;o=o.right}if(o.data.length>1&&void 0!==t)return o.data.forEach(e=>{o.checkValueEquality(e,t)||n.push(e)}),o.data=n,this;if(!o.left&&!o.right)return o===this?(delete o.key,o.data=[],delete o.height,this):(o.parent.left===o?o.parent.left=null:o.parent.right=null,this.rebalanceAlongPath(i));if(!o.left||!o.right)return r=o.left?o.left:o.right,o===this?(r.parent=null,r):(o.parent.left===o?(o.parent.left=r,r.parent=o.parent):(o.parent.right=r,r.parent=o.parent),this.rebalanceAlongPath(i));if(i.push(o),r=o.left,!r.right)return o.key=r.key,o.data=r.data,o.left=r.left,r.left&&(r.left.parent=o),this.rebalanceAlongPath(i);for(;r.right;)i.push(r),r=r.right;return o.key=r.key,o.data=r.data,r.parent.right=r.left,r.left&&(r.left.parent=r.parent),this.rebalanceAlongPath(i)},a.prototype.delete=function(e,t){const n=this.tree.delete(e,t);n&&(this.tree=n)},["getNumberOfKeys","getMinKey","getMaxKey","search","searchAfter","searchBefore","searchNearest","searchNearestLte","searchNearestGte","betweenBounds","prettyPrint","executeOnEveryNode"].forEach(e=>{a.prototype[e]=function(){return this.tree[e].apply(this.tree,arguments)}}),e.exports=a},function(e,t,n){const r=n(8),o=n(150);function i(e){this.fieldName=e.fieldName,this.unique=e.unique||!1,this.sparse=e.sparse||!1,this.data=new Map,this._extractKey=o.getDotFn(this.fieldName)}i.prototype.reset=function(e){this.data.clear(),e&&(Array.isArray(e)?this.insertMultipleDocs(e):this.insert(e))},i.prototype.insert=function(e){const t=this._extractKey(e);if(void 0!==t||!this.sparse)if(r.isArray(t)){const n=t;let r,o;for(let t=0;t<n.length;t++){const i=n[t];if(this.data.has(i)){o=new Error("duplicate key "+i),o.key=i,o.errorType="uniqueViolated",r=t;break}this.data.set(i,e)}if(o){for(let e=0;e<r;e++)this.data.delete(n[e]);throw o}}else{if(this.data.has(t)){const e=new Error("duplicate key "+t);throw e.key=t,e.errorType="uniqueViolated",e}this.data.set(t,e)}},i.prototype.insertMultipleDocs=function(e){let t,n,r;for(t=0;t<e.length;t++)try{this.insert(e[t])}catch(e){n=e,r=t;break}if(n){for(t=0;t<r;t++)this.remove(e[t]);throw n}},i.prototype.remove=function(e){let t;const n=this;if(r.isArray(e))e.forEach(e=>{n.remove(e)});else if(t=this._extractKey(e),void 0!==t||!this.sparse)if(r.isArray(t))for(const e of t)this.data.delete(e);else this.data.delete(t)},i.prototype.update=function(e,t){const n=this._extractKey(e);if(n==this._extractKey(t))this.data.set(n,t);else{this.remove(e);try{this.insert(t)}catch(t){throw this.insert(e),t}}},i.prototype.updateMultipleDocs=function(e){let t,n,r;for(t=0;t<e.length;t++)this.remove(e[t].oldDoc);for(t=0;t<e.length;t++)try{this.insert(e[t].newDoc)}catch(e){r=e,n=t;break}if(r){for(t=0;t<n;t++)this.remove(e[t].newDoc);for(t=0;t<e.length;t++)this.insert(e[t].oldDoc);throw r}},i.prototype.revertUpdate=function(e,t){const n=[];r.isArray(e)?(e.forEach(e=>{n.push({oldDoc:e.newDoc,newDoc:e.oldDoc})}),this.updateMultipleDocs(n)):this.update(t,e)},i.prototype.getMatchingSingle=function(e){const t=this.data.get(e);return t?[t]:[]},i.prototype.getMatching=function(e){if(!Array.isArray(e))return this.getMatchingSingle(e);const t={};for(const n of e)for(const e of this.getMatchingSingle(n))t[e._id]=e;return Object.values(t)},i.prototype.getBetweenBounds=function(e){return Object.values(this.data)},i.prototype.getAll=function(){return[...this.data.values()]},i.prototype.forEach=function(e){for(const[t,n]of this.data)e(n)},i.prototype[Symbol.iterator]=function*(){yield*this.data.values()},e.exports=i},function(e,t,n){const r=n(9),o=n(353),{LineTransform:i}=n(1391),a=n(17),s=n(1394),l=n(150),u=n(708),p=n(707);function c(e){let t,n,r;if(this.db=e.db,this.inMemoryOnly=this.db.inMemoryOnly,this.filename=this.db.filename,this.corruptAlertThreshold=void 0!==e.corruptAlertThreshold?e.corruptAlertThreshold:.1,this.writtenCount=0,this.writtenBytes=0,!this.inMemoryOnly&&this.filename&&"~"===this.filename.charAt(this.filename.length-1))throw new Error("The datafile name can't end with a ~, which is reserved for crash safe backup files");if(e.afterSerialization&&!e.beforeDeserialization)throw new Error("Serialization hook defined but deserialization hook undefined, cautiously refusing to start NeDB to prevent dataloss");if(!e.afterSerialization&&e.beforeDeserialization)throw new Error("Serialization hook undefined but deserialization hook defined, cautiously refusing to start NeDB to prevent dataloss");for(this.afterSerialization=e.afterSerialization||function(e){return l.serialize(e)},this.beforeDeserialization=e.beforeDeserialization||function(e){return l.deserialize(e)},t=1;t<30;t++)for(n=0;n<10;n+=1)if(r="_"+p.uid(t),this.beforeDeserialization(this.afterSerialization(r))!==r)throw new Error("beforeDeserialization is not the reverse of afterSerialization, cautiously refusing to start NeDB to prevent dataloss")}c.ensureDirectoryExists=function(e,t){t=t||function(){},s.mkdirp(e).then(t)},c.prototype.persistCachedDatabase=function(e,t){if("function"==typeof e&&(t=e,e=!0),t=t||function(){},this.inMemoryOnly)return t(null);const n=this.filename+"~",r=a.createWriteStream(n);let o=null;r.on("open",e=>o=e),this.db.forEach(e=>r.write(this.afterSerialization(e)+"\n"));for(const e in this.db.indexes){if("_id"===e)continue;const t=this.db.indexes[e];r.write(this.afterSerialization({$$indexCreated:{fieldName:e,unique:t.unique,sparse:t.sparse}})+"\n")}r.end(()=>{const r=()=>{s.crashSafeRename(n,this.filename,n=>{if(n)return t(n);const r=e=>e?t(e):(this.db.emit("compaction.done"),t(null));e?this._open(r):this.fd&&a.close(this.fd,()=>{r()})})};o?a.fsync(o,r):r()})},c.prototype.compactDatafile=function(e){e=e||function(){},this.db.executor.push({this:this,fn:this.persistCachedDatabase,arguments:[e]})},c.prototype.setAutocompactionInterval=function(e,t=0,n=Number.MAX_SAFE_INTEGER){let r;this.stopAutocompaction();const o=()=>{r=this.autocompactionIntervalId,(this.writtenCount>=t||this.writtenBytes>n)&&this.compactDatafile(()=>{this.writtenCount=this.writtenBytes=0,r==this.autocompactionIntervalId&&(this.autocompactionIntervalId=setTimeout(o,i))})},i=Math.max(e||0,5e3);this.autocompactionIntervalId=setTimeout(o,i)},c.prototype.stopAutocompaction=function(){this.autocompactionIntervalId&&(clearTimeout(this.autocompactionIntervalId),this.autocompactionIntervalId=null)},c.prototype.persistNewState=function(e,t){if(t=t||function(){},this.inMemoryOnly)return t(null);let n="";const r=e.length;for(let t=0;t<r;t++){const r=this.afterSerialization(e[t])+"\n";n+=r,this.writtenCount++,this.writtenBytes+=r.length}if(0===n.length)return t(null);s.appendFile(this.fd||this.filename,n,"utf8",e=>e?t(e):this.fd?void a.fsync(this.fd,e=>t(e)):t())},c.prototype.readFileAndParse=function(e){const t=this;let n=0;const r=[],o={},s={};let l,u=0;try{const e=a.createReadStream(this.filename,{fd:this.fd,start:0,autoClose:!1});l=new i,e.pipe(l)}catch(t){return e(null,{data:r,indexes:s})}l.on("end",()=>{if(n>0&&u/n>t.corruptAlertThreshold)return e(new Error(`More than ${Math.floor(100*t.corruptAlertThreshold)}% of the data file is corrupt, the wrong beforeDeserialization hook may be used. Cautiously refusing to start NeDB to prevent dataloss`));for(const e in o)r.push(o[e]);e(null,{data:r,indexes:s})}),l.on("error",t=>e(t)),l.on("data",e=>{try{const n=t.beforeDeserialization(e);n._id?!0===n.$$deleted?delete o[n._id]:o[n._id]=n:n.$$indexCreated&&null!=n.$$indexCreated.fieldName?s[n.$$indexCreated.fieldName]=n.$$indexCreated:"string"==typeof n.$$indexRemoved&&delete s[n.$$indexRemoved]}catch(e){u+=1}n++})},c.prototype.treatRawData=function(e){const t=e.split("\n"),n={},r=[],o={};let i=-1;for(let e=0;e<t.length;e++)try{const r=this.beforeDeserialization(t[e]);r._id?!0===r.$$deleted?delete n[r._id]:n[r._id]=r:r.$$indexCreated&&null!=r.$$indexCreated.fieldName?o[r.$$indexCreated.fieldName]=r.$$indexCreated:"string"==typeof r.$$indexRemoved&&delete o[r.$$indexRemoved]}catch(e){i++}if(t.length>0&&i/t.length>this.corruptAlertThreshold)throw new Error(`More than ${Math.floor(100*this.corruptAlertThreshold)}% of the data file is corrupt, the wrong beforeDeserialization hook may be used. Cautiously refusing to start NeDB to prevent dataloss`);for(const e in n)r.push(n[e]);return{data:r,indexes:o}},c.prototype._open=function(e){o([e=>{this.fd?a.close(this.fd,()=>{this.fd=null,e()}):e()},e=>{a.open(this.filename,"a+",(t,n)=>t?e(t):(this.fd=n,e()))}],e)},c.prototype.loadDatabase=function(e){const t=e||function(){};if(this.db.resetIndexes(),this.inMemoryOnly)return t(null);o([e=>{c.ensureDirectoryExists(r.dirname(this.filename),t=>{this._open(t=>{if(t)return e(t);s.ensureDatafileIntegrity(this.fd,t=>{this.readFileAndParse((t,n)=>{if(t)return e(t);for(const e in n.indexes)this.db.indexes[e]=new u(n.indexes[e]);try{this.db.resetIndexes(n.data)}catch(t){return this.db.resetIndexes(),e(t)}this.db.persistence.persistCachedDatabase(e)})})})})}],e=>e?t(e):(this.db.executor.processBuffer(),t(null)))},c.prototype.closeDatabase=function(e){if(e=e||function(){},this.inMemoryOnly)return e(null);this.persistCachedDatabase(!1,e)},e.exports=c},function(e,t,n){!function(){"use strict";e.exports.LineTransform=n(711),e.exports.LineReader=n(1392),e.exports.LineFilter=n(1393)}()},function(e,t,n){!function(){"use strict";var t=n(17),r=n(711),o=n(161).StringDecoder;(e.exports=function(e,n){if(this.file="object"==typeof e?this.file=n.input:e,!t.existsSync(this.file))throw new Error("File: "+e+" does not exist");n=n||{},this._encoding=n.encoding||"utf8",this._decoder=new o(this._encoding),this._reader=new r,this._source=t.createReadStream(this.file),this._source.setEncoding(this._encoding),this._init=!1,this._end=!1,this._cbs=[]}).prototype.nextLine=function(e){if(this._init||(this._init=!0,this._source.pipe(this._reader),this._reader.on("data",function(e){this._cbs.shift()(null,this._decoder.write(e)),0===this._cbs.length&&this._reader.pause()}.bind(this)),this._reader.on("end",function(){this._end=!0,this._cbs.forEach((function(e){e(null,null)})),this._cbs=[]}.bind(this))),this._end)return e(null,null);this._cbs.push(e),this._reader.resume()}}()},function(e,t,n){!function(){"use strict";var t=n(8),r=n(11).Transform,o=n(161).StringDecoder;function i(e){if(!(this instanceof i))return new i(e);r.call(this,e),this._writableState.objectMode=!0,this._readableState.objectMode=!0,this._decoder=new o("utf8");var n=(e=e||{}).include||[],a=e.exclude||[];t.isArray(n)||(n=[n]),t.isArray(a)||(a=[a]),this._include=n,this._exclude=a,e.skipEmpty&&this._exclude.push(/^$/),e.skipBlank&&this._exclude.push(/^\s+$/)}function a(e,t){s(e._include,t,!0,0===e._include.length)&&s(e._exclude,t,!1,!0)&&e.push(t)}function s(e,t,n,r){for(var o=e.length-1;o>=0;o--)if(e[o].test(t))return n;return r}t.inherits(i,r),i.prototype._transform=function(e,t,n){a.call(this,this,this._decoder.write(e)),n()},i.prototype._flush=function(e){e()},e.exports=i}()},function(e,t,n){const r=n(17),o=n(1395),[i,a]=[n(353),n(1401)],s=n(9),l={};l.exists=r.exists,l.rename=r.rename,l.writeFile=r.writeFile,l.unlink=r.unlink,l.appendFile=r.appendFile,l.readFile=r.readFile,l.mkdirp=o,l.ensureFileDoesntExist=function(e,t){l.exists(e,n=>{if(!n)return t(null);l.unlink(e,e=>t(e))})},l.flushToStorage=function(e,t){let n,o;if("string"==typeof e?(n=e,o="r+"):(n=e.filename,o=e.isDir?"r":"r+"),"r"===o&&("win32"===process.platform||"win64"===process.platform))return t(null);r.open(n,o,(e,n)=>{if(e)return t(e);r.fsync(n,e=>{r.close(n,n=>{if(e||n){const r=new Error("Failed to flush to storage");return r.errorOnFsync=e,r.errorOnClose=n,t(r)}return t(null)})})})},l.crashSafeWriteFile=function(e,t,n){const r=n||function(){},o=e+"~";i([a(l.flushToStorage,{filename:s.dirname(e),isDir:!0}),function(t){l.exists(e,n=>{if(!n)return t();l.flushToStorage(e,e=>t(e))})},function(e){l.writeFile(o,t,t=>e(t))},a(l.flushToStorage,o),function(t){l.rename(o,e,e=>t(e))},a(l.flushToStorage,{filename:s.dirname(e),isDir:!0})],e=>r(e))},l.crashSafeRename=function(e,t,n){const r=n||function(){},o=e;i([a(l.flushToStorage,{filename:s.dirname(t),isDir:!0}),a(l.flushToStorage,o),function(e){l.rename(o,t,t=>e(t))},a(l.flushToStorage,{filename:s.dirname(t),isDir:!0})],e=>r(e))},l.ensureDatafileIntegrity=function(e,t){const n=e+"~";l.exists(e,r=>{if(r)return t(null);l.exists(n,r=>{if(!r)return l.writeFile(e,"","utf8",e=>{t(e)});l.rename(n,e,e=>t(e))})})},e.exports=l},function(e,t,n){const r=n(1396),o=n(1397),{mkdirpNative:i,mkdirpNativeSync:a}=n(1398),{mkdirpManual:s,mkdirpManualSync:l}=n(712),{useNative:u,useNativeSync:p}=n(1400),c=(e,t)=>(e=o(e),t=r(t),u(t)?i(e,t):s(e,t));c.sync=(e,t)=>(e=o(e),t=r(t),p(t)?a(e,t):l(e,t)),c.native=(e,t)=>i(o(e),r(t)),c.manual=(e,t)=>s(o(e),r(t)),c.nativeSync=(e,t)=>a(o(e),r(t)),c.manualSync=(e,t)=>l(o(e),r(t)),e.exports=c},function(e,t,n){const{promisify:r}=n(8),o=n(17);e.exports=e=>{if(e)if("object"==typeof e)e={mode:511,fs:o,...e};else if("number"==typeof e)e={mode:e,fs:o};else{if("string"!=typeof e)throw new TypeError("invalid options argument");e={mode:parseInt(e,8),fs:o}}else e={mode:511,fs:o};return e.mkdir=e.mkdir||e.fs.mkdir||o.mkdir,e.mkdirAsync=r(e.mkdir),e.stat=e.stat||e.fs.stat||o.stat,e.statAsync=r(e.stat),e.statSync=e.statSync||e.fs.statSync||o.statSync,e.mkdirSync=e.mkdirSync||e.fs.mkdirSync||o.mkdirSync,e}},function(e,t,n){const r=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:o,parse:i}=n(9);e.exports=e=>{if(/\0/.test(e))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:e,code:"ERR_INVALID_ARG_VALUE"});if(e=o(e),"win32"===r){const t=/[*|"<>?:]/,{root:n}=i(e);if(t.test(e.substr(n.length)))throw Object.assign(new Error("Illegal characters in path."),{path:e,code:"EINVAL"})}return e}},function(e,t,n){const{dirname:r}=n(9),{findMade:o,findMadeSync:i}=n(1399),{mkdirpManual:a,mkdirpManualSync:s}=n(712);e.exports={mkdirpNative:(e,t)=>{t.recursive=!0;return r(e)===e?t.mkdirAsync(e,t):o(t,e).then(n=>t.mkdirAsync(e,t).then(()=>n).catch(n=>{if("ENOENT"===n.code)return a(e,t);throw n}))},mkdirpNativeSync:(e,t)=>{t.recursive=!0;if(r(e)===e)return t.mkdirSync(e,t);const n=i(t,e);try{return t.mkdirSync(e,t),n}catch(n){if("ENOENT"===n.code)return s(e,t);throw n}}}},function(e,t,n){const{dirname:r}=n(9),o=(e,t,n)=>n===t?Promise.resolve():e.statAsync(t).then(e=>e.isDirectory()?n:void 0,n=>"ENOENT"===n.code?o(e,r(t),t):void 0),i=(e,t,n)=>{if(n!==t)try{return e.statSync(t).isDirectory()?n:void 0}catch(n){return"ENOENT"===n.code?i(e,r(t),t):void 0}};e.exports={findMade:o,findMadeSync:i}},function(e,t,n){const r=n(17),o=(process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version).replace(/^v/,"").split("."),i=+o[0]>10||10==+o[0]&&+o[1]>=12,a=i?e=>e.mkdir===r.mkdir:()=>!1,s=i?e=>e.mkdirSync===r.mkdirSync:()=>!1;e.exports={useNative:a,useNativeSync:s}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,...t){return(...n)=>e(...t,...n)},e.exports=t.default},function(e,t,n){const r=n(10)(n(236).name+":cursor"),o=n(150);function i(e,t,n){this.db=e,this.query=t||{},n&&(this.execFn=n)}i.prototype.limit=function(e){return this._limit=e,this},i.prototype.skip=function(e){return this._skip=e,this},i.prototype.sort=function(e){return this._sort=e,this},i.prototype.projection=function(e){return this._projection=e,this},i.prototype.project=function(e){const t=[],n=this;let r,i,a;return void 0===this._projection||0===Object.keys(this._projection).length?e:(r=0!==this._projection._id,delete this._projection._id,a=Object.keys(this._projection),a.forEach(e=>{if(void 0!==i&&n._projection[e]!==i)throw new Error(`Can't both keep and omit field ${e} except for _id`);i=n._projection[e]}),e.forEach(e=>{let n;1===i?(n={$set:{}},a.forEach(t=>{n.$set[t]=o.getDotValue(e,t),void 0===n.$set[t]&&delete n.$set[t]}),n=o.modify({},n)):(n={$unset:{}},a.forEach(e=>{n.$unset[e]=!0}),n=o.modify(e,n)),r?n._id=e._id:delete n._id,t.push(n)}),t)},i.prototype._exec=function(e){let t=[],n=0,i=0;const a=(t,n)=>this.execFn?this.execFn(t,n,e):e(t,n),s=Object.assign({},this.query);r("exec.params",{query:s,skip:this._skip,limit:this._limit,sort:this._sort,projection:this._projection}),this.db.getCandidates(s,(e,l)=>{if(e)return a(e);try{const e=o.prepare(s);for(const r of l)if(e(r))if(this._sort)t.push(r);else if(this._skip&&this._skip>i)i++;else if(t.push(r),n++,this._limit&&this._limit<=n)break}catch(e){return a(e)}if(this._sort){const e=Object.keys(this._sort),n=[];for(let t=0;t<e.length;t++){const r=e[t];n.push({key:r,direction:this._sort[r]})}t.sort((e,t)=>{let r,i;for(let a=0;a<n.length;a++)if(r=n[a],i=r.direction*o.compareThings(o.getDotValue(e,r.key),o.getDotValue(t,r.key),this.db.compareStrings),0!==i)return i;return 0});const r=this._limit||t.length,i=this._skip||0;t=t.slice(i,i+r)}try{return t=this.project(t),r("exec.result",t),a(null,t)}catch(e){return a(e)}})},i.prototype.exec=function(){this.db.executor.push({this:this,fn:this._exec,arguments:arguments})},i.prototype.toArray=function(e){const t=this;process.nextTick(()=>{e(null,t.res)})},e.exports=i},function(e,t,n){const r=n(706),o=Object.freeze(["find","findOne","count","sort","skip","limit","projection"]),i=Object.freeze(["insert","remove","update","ensureIndex","removeIndex","getCandidates","loadDatabase","closeDatabase"]);const a=new Proxy(r,{get(e,t){const n=e[t];return"CURSOR_FN_LIST"===t?o:"RESULT_FN_LIST"===t?i:function e(t){if(void 0!==t)return new Proxy(t,{get(t,n){if("then"===n)return(e,n)=>{t.exec((t,r)=>{t?n(t):e(r)})};if("catch"===n)return e=>{t.exec(t=>{t&&e(t)})};const r=t[n];if("function"==typeof r){if(o.includes(n))return function(...t){return e(r.bind(this)(...t))};if(i.includes(n))return function(...e){return"function"==typeof e[e.length-1]?r.bind(this)(...e):new Promise((t,n)=>{r.bind(this)(...e,(e,r)=>{e?n(e):t(r)})})}}return r}})}(n)}});e.exports=a},function(e,t,n){const{EventEmitter:r}=n(24);e.exports=class extends r{constructor(e){super(e)}create(e,t="created"){throw new Error("AuthStorage.create must be implemented in child class")}read(e){throw new Error("AuthStorage.read must be implemented in child class")}update(e,t){throw new Error("AuthStorage.update must be implemented in child class")}delete(e){throw new Error("AuthStorage.delete must be implemented in child class")}exist(e,t){throw new Error("AuthStorage.exist must be implemented in child class")}}},function(e){e.exports=JSON.parse('{"name":"@arcblock/did-auth-storage-nedb","description":"Storage engine that uses nedb for did-auth","version":"1.6.3","author":"wangshijun <shijun@arcblock.io> (https://ocap.arcblock.io)","bugs":{"url":"https://github.com/ArcBlock/forge-js/issues","email":"shijun@arcblock.io"},"publishConfig":{"access":"public"},"contributors":["wangshijun <shijun@arcblock.io> (https://ocap.arcblock.io)"],"devDependencies":{"j2d":"^1.0.3-dev","jest":"^23.5.0","remark-cli":"^5.0.0","remark-preset-github":"^0.0.9"},"remarkConfig":{"plugins":["preset-github",["validate-links",{"repository":"ArcBlock/forge-js"}]]},"homepage":"https://github.com/ArcBlock/forge-js/tree/master/did/did-auth-storage-nedb","keywords":["forge","blockchain","arcblock","sdk","nodejs"],"license":"Apache-2.0","main":"./lib/index.js","files":["lib"],"repository":{"type":"git","url":"https://github.com/ArcBlock/forge-js/tree/master/did/did-auth-storage-nedb"},"scripts":{"lint":"eslint lib tests","docs":"yarn generate-dts && yarn generate-docs && yarn cleanup-docs && yarn format-docs","cleanup-docs":"node ../../tools/cleanup-docs.js docs/README.md $npm_package_name","generate-docs":"jsdoc2md lib/index.js > docs/README.md","generate-dts":"j2d lib/index.js","format-docs":"remark . -o","precommit":"CI=1 yarn test","prepush":"CI=1 yarn test","test":"npm run lint && node tools/jest.js","coverage":"npm run lint && yarn test -- --coverage"},"gitHead":"570a366418890ded86422e168417bae0c9967e35","dependencies":{"@arcblock/did-auth-storage":"^1.6.3","@nedb/core":"1.x","@nedb/multi":"1.x","debug":"^4.3.1"}}')},function(e,t,n){const r=n(716),o=n(1409),i=r.object({id:r.string().optional(),host:r.string().uri({scheme:["http","https"]}).required().allow("none")}).options({stripUnknown:!0,noDefaults:!1}),a=r.object({name:r.string().required(),description:r.string().required(),icon:r.string().uri({scheme:["http","https"]}).required(),link:r.string().uri({scheme:["http","https"]}).optional(),path:r.string().uri({scheme:["http","https"]}).default("https://abtwallet.io/i/"),publisher:r.string().optional(),updateSubEndpoint:r.boolean().optional(),subscriptionEndpoint:r.string().optional(),nodeDid:r.DID().optional()}).options({stripUnknown:!1,noDefaults:!1});e.exports=Object.freeze({chainInfo:i,appInfo:a,claims:o(i)})},function(e,t,n){const{BN:r}=n(21);e.exports=e=>({type:"BN",base:e.any(),messages:{"bn.nan":"{{#label}} is not a big number","bn.max":'{{#label}} needs to be less than or equal to "{{#threshold}}"',"bn.min":'{{#label}} needs to be greater than or equal to "{{#threshold}}"',"bn.less":'{{#label}} needs to be less than "{{#threshold}}"',"bn.greater":'{{#label}} needs to be greater than "{{#threshold}}"',"bn.positive":"{{#label}} needs to be positive","bn.negative":"{{#label}} needs to be negative"},prepare(e,t){try{return{value:new r(e)}}catch(e){return{errors:t.error("bn.nan")}}},coerce:e=>({value:e.toString(10)}),validate:e=>({value:e}),rules:{gt:{args:[{name:"threshold",ref:!0,assert:e=>r.isBN(e),message:"must be a big number",normalize:e=>new r(e)},{name:"equal",assert:e=>"boolean"==typeof e,message:"must be a boolean"}],validate(e,t,n){const o=new r(e);return n.equal&&o.lt(n.threshold)?t.error("bn.min",n):!n.equal&&o.lte(n.threshold)?t.error("bn.greater",n):e}},lt:{args:[{name:"threshold",ref:!0,assert:e=>r.isBN(e),message:"must be a big number",normalize:e=>new r(e)},{name:"equal",assert:e=>"boolean"==typeof e,message:"must be a boolean"}],validate(e,t,n){const o=new r(e);return n.equal&&o.gt(n.threshold)?t.error("bn.max",n):!n.equal&&o.gte(n.threshold)?t.error("bn.less",n):e}},min:{alias:"gte",method(e){return this.$_addRule({name:"gt",args:{threshold:e,equal:!0}})}},max:{alias:"lte",method(e){return this.$_addRule({name:"lt",args:{threshold:e,equal:!0}})}},greater:{alias:"gt",method(e){return this.$_addRule({name:"gt",args:{threshold:e,equal:!1}})}},less:{alias:"lt",method(e){return this.$_addRule({name:"lt",args:{threshold:e,equal:!1}})}},positive:{method(){return this.$_addRule({name:"gt",args:{threshold:0,equal:!1}})}},negative:{method(){return this.$_addRule({name:"lt",args:{threshold:0,equal:!1}})}}}})},function(e,t,n){const r=n(169),{types:o}=n(28),{isValid:i,toTypeInfo:a,DID_TYPE_ARCBLOCK:s,DID_TYPE_ETHEREUM:l}=n(35),u={wallet:["arcblock","ethereum","default","eth"],pk:Object.keys(o.KeyType),hash:Object.keys(o.HashType),role:Object.keys(o.RoleType)};e.exports=e=>({type:"DID",base:e.string().trim(),messages:{"did.empty":'Expect {{#label}} to be non-empty string, got "{{#value}}"',"did.invalid":'Expect {{#label}} to be valid did, got "{{#value}}"',"did.wallet":'Expect wallet type of {{#label}} to be "{{#expected}}" wallet, got "{{#actual}}"',"did.pk":'Expect pk type of {{#label}} to be "{{#expected}}", got "{{#actual}}"',"did.hash":'Expect hash type of {{#label}} to be "{{#expected}}", got "{{#actual}}"',"did.role":'Expect role type of {{#label}} to be "{{#expected}}", got "{{#actual}}"'},validate:(e,t)=>e&&"string"==typeof e?!1===i(e)?{errors:t.error("did.invalid",{value:e})}:{value:e}:{errors:t.error("did.empty",{value:e})},rules:{type:{args:[{name:"key",ref:!0,assert:e=>Object.keys(u).includes(e),message:"must be one of "+Object.keys(u).join(", ")},{name:"expected",assert:e=>Object.keys(u).some(t=>u[t].includes(e)),message:"must be valid type"}],validate(e,t,n){const o=a(e),i=a(e,!0);if("wallet"===n.key){if(["ethereum","eth"].includes(n.expected)&&!1===r(o,l))return t.error("did.wallet",{...n,actual:JSON.stringify(i)});if(["arcblock","default"].includes(n.expected)&&!1===r(o,s))return t.error("did.wallet",{...n,actual:JSON.stringify(i)})}return"pk"===n.key&&i.pk!==n.expected?t.error("did.pk",{...n,actual:i.pk}):"hash"===n.key&&i.hash!==n.expected?t.error("did.hash",{...n,actual:i.hash}):"role"===n.key&&i.role!==n.expected?t.error("did.role",{...n,actual:i.role}):e}},wallet:{method(e){return this.$_addRule({name:"type",args:{key:"wallet",expected:e}})}},pk:{method(e){return this.$_addRule({name:"type",args:{key:"pk",expected:e}})}},hash:{method(e){return this.$_addRule({name:"type",args:{key:"hash",expected:e}})}},role:{method(e){return this.$_addRule({name:"type",args:{key:"role",expected:e}})}}}})},function(e,t,n){const r=n(716),{types:o}=n(28),i=r.alternatives().try(r.object({did:r.DID().required(),endpoint:r.string().uri({scheme:["http","https"]}).required()}),r.DID().required());e.exports=e=>{const t={stripUnknown:!0,noDefaults:!1},n=(t,n)=>({type:r.string().valid(t).default(t),description:r.string().min(1).default(n),chainInfo:e,meta:r.any().optional().default({})});return{authPrincipal:r.object({...n("authPrincipal","Please select account to continue."),target:r.DID().optional().allow("").default(""),targetType:r.object({key:r.string().valid(...Object.keys(o.KeyType).map(e=>e.toLowerCase())).required(),hash:r.string().valid(...Object.keys(o.HashType).map(e=>e.toLowerCase())).required(),role:r.string().valid(...Object.keys(o.RoleType).map(e=>e.toLowerCase().split("_").pop())).required()}).optional(),declareParams:r.object({moniker:r.string().required(),issuer:r.DID().required()}).optional(),supervised:r.boolean().default(!1)}).options(t),profile:r.object({...n("profile","Please provide your profile to continue."),items:r.array().items(r.string().valid("fullName","email","phone","signature","avatar","birthday")).min(1).default(["fullName"])}).rename("fields","items",{ignoreUndefined:!0,override:!0}).options(t),signature:r.object({...n("signature","Sign this transaction or message to continue."),typeUrl:r.string().valid("fg:t:transaction","mime:text/plain","mime:text/html","eth:transaction").required(),display:r.string().allow("").default(""),method:r.string().allow("none",...Object.keys(o.HashType).map(e=>e.toLowerCase())).optional().default("sha3"),digest:r.string().allow("").default(""),origin:r.string().allow("").default("")}).options(t),prepareTx:r.object({...n("prepareTx","Prepare and sign this transaction to continue."),display:r.string().allow("").default(""),partialTx:r.string().required(),requirement:r.object({tokens:r.array().items(r.object({address:r.DID().required(),value:r.BN().positive().required()})).required(),assets:r.object({address:r.array().items(r.DID()).optional(),parent:r.array().items(r.DID()).optional(),issuer:r.array().items(r.DID()).optional()}).optional()}).required()}).options(t),agreement:r.object({...n("agreement","Confirm your agreement to continue."),uri:r.string().uri({scheme:["http","https"]}).required().allow(""),method:r.string().allow(...Object.keys(o.HashType).map(e=>e.toLowerCase())).optional().default("sha2"),digest:r.string().required()}).options(t),verifiableCredential:r.object({...n("verifiableCredential","Please present a verifiable credential to continue."),optional:r.boolean().default(!1),item:r.array().items(r.string().min(1).required()).min(1).optional(),target:r.DID().optional(),trustedIssuers:r.array().items(i).min(1).optional(),tag:r.string().min(1).allow("").default(""),filters:r.array().items(r.object({type:r.array().items(r.string().min(1).required()).min(1).optional(),target:r.DID().optional(),trustedIssuers:r.array().items(i).min(1).optional(),tag:r.string().min(1).allow("").default("")})).optional()}).options(t),asset:r.object({...n("asset","Please present an on chain asset to continue."),optional:r.boolean().default(!1),address:r.DID().optional(),trustedIssuers:r.array().items(i).min(1).optional(),trustedParents:r.array().items(r.DID().required()).min(1).optional(),tag:r.string().min(1).allow("").default(""),filters:r.array().items(r.object({address:r.DID().optional(),trustedIssuers:r.array().items(i).min(1).optional(),trustedParents:r.array().items(r.DID().required()).min(1).optional(),tag:r.string().min(1).allow("").default("")})).optional()}).options(t)}}},function(e,t,n){const r=n(163),o=n(169),i=n(141),{toBase58:a}=n(21),{toDid:s}=n(35),l=n(715),u=n(714),p=n(10)(n(151).name+":authenticator:wallet"),{DEFAULT_CHAIN_INFO:c}=l;e.exports=class extends u{async sign({token:e="",context:t,claims:n,appInfo:l,authorizer:u,verifiableClaims:d=[],pathname:f="",baseUrl:h="",challenge:g="",extraParams:m={},request:y}){this._verifyClaims(d),this._verifyAuthorizer(u),this._validateAppInfo(l);const v=await this.genRequestedClaims({claims:n,context:{baseUrl:h,request:y,...t},extraParams:m}),b={baseUrl:h,request:y,...t,...m},_=v.find(e=>!1===o(this._isValidChainInfo(e.chainInfo),c)),T=await this.getWalletInfo(b);l.publisher||(l.publisher=s(u.did));const E=await this.getChainInfo(b,_?_.chainInfo:null),S={action:"responseAuth",appInfo:l,iss:s(u.did),challenge:g,agentDid:s(T.address),chainInfo:E,verifiableClaims:d,requestedClaims:v.map(e=>(delete e.chainInfo,e)),url:`${this.baseUrl||h}${f}?${r.stringify({[this.tokenKey]:e,...m})}`},x=t.didwallet?t.didwallet.jwt:void 0,w={appPk:a(u.pk),agentPk:a(T.pk),authInfo:i.sign(T.address,T.sk,S,!0,x)};return p("responseAuth.sign",{context:t,extraParams:m,payload:S,signed:w}),w}_verifyClaims(e){if(!Array.isArray(e)||!e.length)throw new Error("Non-empty verified claims must be provided for agent to sign")}_verifyAuthorizer(e){if(!e||!e.pk||!e.did)throw new Error("Valid authorizer did and pk must be provided for agent to sign")}}},function(e,t,n){const r=n(152);e.exports={re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:n(237).SEMVER_SPEC_VERSION,SemVer:n(49),compareIdentifiers:n(354).compareIdentifiers,rcompareIdentifiers:n(354).rcompareIdentifiers,parse:n(153),valid:n(1412),clean:n(1413),inc:n(1414),diff:n(1415),major:n(1416),minor:n(1417),patch:n(1418),prerelease:n(1419),compare:n(80),rcompare:n(1420),compareLoose:n(1421),compareBuild:n(356),sort:n(1422),rsort:n(1423),gt:n(240),lt:n(357),eq:n(355),neq:n(719),gte:n(358),lte:n(359),cmp:n(720),coerce:n(1424),Comparator:n(241),Range:n(81),satisfies:n(242),toComparators:n(1425),maxSatisfying:n(1426),minSatisfying:n(1427),minVersion:n(1428),validRange:n(1429),outside:n(360),gtr:n(1430),ltr:n(1431),intersects:n(1432),simplifyRange:n(1433),subset:n(1434)}},function(e,t,n){const r=n(153);e.exports=(e,t)=>{const n=r(e,t);return n?n.version:null}},function(e,t,n){const r=n(153);e.exports=(e,t)=>{const n=r(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},function(e,t,n){const r=n(49);e.exports=(e,t,n,o)=>{"string"==typeof n&&(o=n,n=void 0);try{return new r(e,n).inc(t,o).version}catch(e){return null}}},function(e,t,n){const r=n(153),o=n(355);e.exports=(e,t)=>{if(o(e,t))return null;{const n=r(e),o=r(t),i=n.prerelease.length||o.prerelease.length,a=i?"pre":"",s=i?"prerelease":"";for(const e in n)if(("major"===e||"minor"===e||"patch"===e)&&n[e]!==o[e])return a+e;return s}}},function(e,t,n){const r=n(49);e.exports=(e,t)=>new r(e,t).major},function(e,t,n){const r=n(49);e.exports=(e,t)=>new r(e,t).minor},function(e,t,n){const r=n(49);e.exports=(e,t)=>new r(e,t).patch},function(e,t,n){const r=n(153);e.exports=(e,t)=>{const n=r(e,t);return n&&n.prerelease.length?n.prerelease:null}},function(e,t,n){const r=n(80);e.exports=(e,t,n)=>r(t,e,n)},function(e,t,n){const r=n(80);e.exports=(e,t)=>r(e,t,!0)},function(e,t,n){const r=n(356);e.exports=(e,t)=>e.sort((e,n)=>r(e,n,t))},function(e,t,n){const r=n(356);e.exports=(e,t)=>e.sort((e,n)=>r(n,e,t))},function(e,t,n){const r=n(49),o=n(153),{re:i,t:a}=n(152);e.exports=(e,t)=>{if(e instanceof r)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){let t;for(;(t=i[a.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&t.index+t[0].length===n.index+n[0].length||(n=t),i[a.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;i[a.COERCERTL].lastIndex=-1}else n=e.match(i[a.COERCE]);return null===n?null:o(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)}},function(e,t,n){const r=n(81);e.exports=(e,t)=>new r(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},function(e,t,n){const r=n(49),o=n(81);e.exports=(e,t,n)=>{let i=null,a=null,s=null;try{s=new o(t,n)}catch(e){return null}return e.forEach(e=>{s.test(e)&&(i&&-1!==a.compare(e)||(i=e,a=new r(i,n)))}),i}},function(e,t,n){const r=n(49),o=n(81);e.exports=(e,t,n)=>{let i=null,a=null,s=null;try{s=new o(t,n)}catch(e){return null}return e.forEach(e=>{s.test(e)&&(i&&1!==a.compare(e)||(i=e,a=new r(i,n)))}),i}},function(e,t,n){const r=n(49),o=n(81),i=n(240);e.exports=(e,t)=>{e=new o(e,t);let n=new r("0.0.0");if(e.test(n))return n;if(n=new r("0.0.0-0"),e.test(n))return n;n=null;for(let t=0;t<e.set.length;++t){const o=e.set[t];let a=null;o.forEach(e=>{const t=new r(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":a&&!i(t,a)||(a=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}),!a||n&&!i(n,a)||(n=a)}return n&&e.test(n)?n:null}},function(e,t,n){const r=n(81);e.exports=(e,t)=>{try{return new r(e,t).range||"*"}catch(e){return null}}},function(e,t,n){const r=n(360);e.exports=(e,t,n)=>r(e,t,">",n)},function(e,t,n){const r=n(360);e.exports=(e,t,n)=>r(e,t,"<",n)},function(e,t,n){const r=n(81);e.exports=(e,t,n)=>(e=new r(e,n),t=new r(t,n),e.intersects(t))},function(e,t,n){const r=n(242),o=n(80);e.exports=(e,t,n)=>{const i=[];let a=null,s=null;const l=e.sort((e,t)=>o(e,t,n));for(const e of l){r(e,t,n)?(s=e,a||(a=e)):(s&&i.push([a,s]),s=null,a=null)}a&&i.push([a,null]);const u=[];for(const[e,t]of i)e===t?u.push(e):t||e!==l[0]?t?e===l[0]?u.push("<="+t):u.push(`${e} - ${t}`):u.push(">="+e):u.push("*");const p=u.join(" || "),c="string"==typeof t.raw?t.raw:String(t);return p.length<c.length?p:t}},function(e,t,n){const r=n(81),o=n(241),{ANY:i}=o,a=n(242),s=n(80),l=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===i){if(1===t.length&&t[0].semver===i)return!0;e=n.includePrerelease?[new o(">=0.0.0-0")]:[new o(">=0.0.0")]}if(1===t.length&&t[0].semver===i){if(n.includePrerelease)return!0;t=[new o(">=0.0.0")]}const r=new Set;let l,c,d,f,h,g,m;for(const t of e)">"===t.operator||">="===t.operator?l=u(l,t,n):"<"===t.operator||"<="===t.operator?c=p(c,t,n):r.add(t.semver);if(r.size>1)return null;if(l&&c){if(d=s(l.semver,c.semver,n),d>0)return null;if(0===d&&(">="!==l.operator||"<="!==c.operator))return null}for(const e of r){if(l&&!a(e,String(l),n))return null;if(c&&!a(e,String(c),n))return null;for(const r of t)if(!a(e,String(r),n))return!1;return!0}let y=!(!c||n.includePrerelease||!c.semver.prerelease.length)&&c.semver,v=!(!l||n.includePrerelease||!l.semver.prerelease.length)&&l.semver;y&&1===y.prerelease.length&&"<"===c.operator&&0===y.prerelease[0]&&(y=!1);for(const e of t){if(m=m||">"===e.operator||">="===e.operator,g=g||"<"===e.operator||"<="===e.operator,l)if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),">"===e.operator||">="===e.operator){if(f=u(l,e,n),f===e&&f!==l)return!1}else if(">="===l.operator&&!a(l.semver,String(e),n))return!1;if(c)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),"<"===e.operator||"<="===e.operator){if(h=p(c,e,n),h===e&&h!==c)return!1}else if("<="===c.operator&&!a(c.semver,String(e),n))return!1;if(!e.operator&&(c||l)&&0!==d)return!1}return!(l&&g&&!c&&0!==d)&&(!(c&&m&&!l&&0!==d)&&(!v&&!y))},u=(e,t,n)=>{if(!e)return t;const r=s(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},p=(e,t,n)=>{if(!e)return t;const r=s(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,n={})=>{if(e===t)return!0;e=new r(e,n),t=new r(t,n);let o=!1;e:for(const r of e.set){for(const e of t.set){const t=l(r,e,n);if(o=o||null!==t,t)continue e}if(o)return!1}return!0}},function(e,t){function n(e){return(4294967296+e).toString(16).substring(1)}e.exports={normalizeInput:function(e){let t;if(e instanceof Uint8Array)t=e;else{if("string"!=typeof e)throw new Error("Input must be an string, Buffer or Uint8Array");t=(new TextEncoder).encode(e)}return t},toHex:function(e){return Array.prototype.map.call(e,(function(e){return(e<16?"0":"")+e.toString(16)})).join("")},debugPrint:function(e,t,r){let o="\n"+e+" = ";for(let i=0;i<t.length;i+=2){if(32===r)o+=n(t[i]).toUpperCase(),o+=" ",o+=n(t[i+1]).toUpperCase();else{if(64!==r)throw new Error("Invalid size "+r);o+=n(t[i+1]).toUpperCase(),o+=n(t[i]).toUpperCase()}i%6==4?o+="\n"+new Array(e.length+4).join(" "):i<t.length-2&&(o+=" ")}console.log(o)},testSpeed:function(e,t,n){let r=(new Date).getTime();const o=new Uint8Array(t);for(let e=0;e<t;e++)o[e]=e%256;const i=(new Date).getTime();console.log("Generated random input in "+(i-r)+"ms"),r=i;for(let i=0;i<n;i++){const n=e(o),i=(new Date).getTime(),a=i-r;r=i,console.log("Hashed in "+a+"ms: "+n.substring(0,20)+"..."),console.log(Math.round(t/(1<<20)/(a/1e3)*100)/100+" MB PER SECOND")}}}},function(e,t,n){const{EventEmitter:r}=n(24);e.exports=class extends r{constructor({pathTransformer:e,tokenStorage:t,authenticator:n,onConnect:r}){super(),this.authenticator=n,this.tokenStorage=t,this.tokenStorage.on("create",e=>this.emit("created",e)),this.tokenStorage.on("destroy",e=>this.emit("deleted",{token:e})),this.tokenStorage.on("update",async e=>{if(!e)return;const t={scanned:"scanned",succeed:"succeed",forbidden:"failed",error:"failed"};if(t[e.status]){const n=await this.tokenStorage.read(e.token);this.emit(t[e.status],n)}}),this.pathTransformer="function"==typeof e?e:e=>e,this.onConnect="function"==typeof r?r:()=>{}}}},function(e,t,n){const r=n(10)(n(151).name+":handlers:agent"),o=n(717),i=n(718),a=()=>{};e.exports=class extends o{constructor({tokenStorage:e,agentStorage:t,authenticator:n,onConnect:r=a,options:o={}}){o&&!o.prefix&&(o.prefix="/api/agent/:authorizeId"),super({tokenStorage:e,authenticator:n,onConnect:r,options:o}),this.agentStorage=t}attach({app:e,action:t,claims:n,onStart:o=a,onConnect:s,onAuth:l,onDecline:u=a,onComplete:p=a,onExpire:c=a,onError:d=console.error,authPrincipal:f=!0}){if("function"!=typeof l)throw new Error("onAuth callback is required to attach agent handlers");if("function"!=typeof u)throw new Error("onDecline callback is required to attach agent handlers");if("function"!=typeof p)throw new Error("onComplete callback is required to attach agent handlers");const{prefix:h,appKey:g=""}=this.options,m=`${h}/${t}/auth`;r("attach routes",{action:t,prefix:h,pathname:m});const y=async(e,t,n)=>{const r=e.query.authorizeId||e.query[g]||e.params.authorizeId||e.params[g];if(!r)return t.jsonp({error:"App ID is required to start"});const o=await this.agentStorage.read(r);return o?(e.authorizeId=r,e.authorization=o,n()):t.jsonp({error:"App authorization not found"})},{generateSession:v,expireSession:b,checkSession:_,onAuthRequest:T,onAuthResponse:E,ensureContext:S,ensureSignedJson:x}=i({action:t,pathname:m,claims:n,onStart:o,onConnect:s||this.onConnect,onAuth:l,onDecline:u,onComplete:p,onExpire:c,onError:d,getSignParams:e=>{if(!e.authorization)throw new Error("AgentWalletHandlers require valid req.authorization to compose sign params");const{appPk:t,appDid:n,appName:r,appLink:o,appDescription:i,appIcon:a,certificateContent:s}=e.authorization;return{authorizer:{pk:t,did:n},appInfo:{name:r,description:i,icon:a,link:o||""},verifiableClaims:[{type:"certificate",content:s}]}},getPathName:(e,t)=>e.replace("/:authorizeId/",`/${t.authorizeId}/`),authPrincipal:f,options:this.options,pathTransformer:this.pathTransformer,tokenStorage:this.tokenStorage,authenticator:this.authenticator});e.get(`${h}/${t}/token`,y,v),e.post(`${h}/${t}/token`,y,v),e.get(`${h}/${t}/status`,y,S,_),e.get(`${h}/${t}/timeout`,y,S,b),e.get(m,y,S,x,T),e.post(m,y,S,x,E),e.get(m+"/submit",y,S,x,E)}}},function(e,t,n){const r=["autoConnect","connectedDidOnly","sendNotificationFn","options"],o=["onStart"];function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const u=n(27),{WalletHandlers:p}=n(713),c=n(1439),d=()=>({});e.exports=class extends p{constructor(e){let{autoConnect:t=!0,connectedDidOnly:n=!1,sendNotificationFn:o,options:i={}}=e,p=s(e,r);t&&n&&(i.sessionDidKey="headers[x-connected-did]"),super(a({options:i},p)),l(this,"getConnectedDid",({req:e,didwallet:t,extraParams:n})=>n&&"false"===n.autoConnect?null:this.enableConnect?(e=>e&&["ios","android"].includes(e.os))(t)?null:u(e,"headers[x-connected-did]"):null),this.enableConnect=!!t,this.sendNotificationFn=o||c.sendToUser.bind(c)}attach(e){let{onStart:t=d}=e,n=s(e,o);super.attach(a({onStart:async e=>{const r=await t(e)||{},o=this.getConnectedDid(e);if(r.connectedDid=o||"",r.saveConnect=this.enableConnect,o){let t="";try{t=new URL(decodeURIComponent(new URL(e.deepLink).searchParams.get("url"))),t.pathname=t.pathname.replace(/auth$/,"status")}catch(e){t="",console.error(e)}const r={type:"connect",url:e.deepLink};t&&(r.checkUrl=t.href),this.sendNotificationFn(o,r,e).catch(e=>{console.error(e),"function"==typeof n.onError&&n.onError(e)})}return r}},n))}}},function(e,t,n){const r=n(141),o=n(24),{WsClient:i}=n(320),a=n(1440),s=n(721),{SERVICE_PREFIX:l}=n(722),u=n(1445),p=new o;let c=null;e.exports={sendToUser:async(e,t,n)=>{a();const r={appId:process.env.BLOCKLET_APP_ID,appSk:process.env.BLOCKLET_APP_SK,did:process.env.BLOCKLET_DID};return s(e,t,r,process.env.ABT_NODE_SERVICE_PORT,n)},on:(e,t)=>(c||(()=>{if(!c){const e=u(),{address:t,publicKey:n,secretKey:o}=e,a=`ws://127.0.0.1:${process.env.ABT_NODE_SERVICE_PORT}${l}`,s=()=>r.sign(t,o,{});c=new i(a,{heartbeatIntervalMs:1e4,params:()=>({token:s(),pk:n})}),c.connect();const d=c.channel(e.address,()=>({token:s(),pk:n}));d.join().receive("error",e=>{const t="join channel error: "+e.message;console.error(t),p.emit("error",{message:t})}).receive("timeout",()=>{const e="join channel timeout";console.error(e),p.emit("error",{message:e})}),d.on("message",({status:e,response:t}={})=>{"ok"===e?p.emit(t.type,t):(p.emit("error",t),console.error({status:e,response:t}))})}})(),p.on(e,t)),off:p.off.bind(p)}},function(e,t){e.exports=()=>{["BLOCKLET_APP_ID","BLOCKLET_APP_NAME","BLOCKLET_APP_DESCRIPTION","BLOCKLET_APP_SK","BLOCKLET_DID","ABT_NODE","ABT_NODE_DID","ABT_NODE_PK","ABT_NODE_PORT","ABT_NODE_SERVICE_PORT"].forEach(e=>{if(!process.env[e])throw new Error(e+" does not exist in environments")})}},function(e,t,n){const{validateNotification:r,validateReceiver:o,validateOption:i}=n(1442);e.exports={validateNotification:r,validateReceiver:o,validateOption:i}},function(e,t,n){const r=n(233),{didExtension:o}=n(1443),i=r.extend(o),a="notification",s="connect",l="feed",u=i.object({did:i.DID().trim().required(),chainHost:i.string().uri().required()}).required(),p=i.object({credential:i.object().required().unknown(!0),tag:i.string()}).required(),c=i.object({address:i.DID().trim().allow(""),amount:i.string().required(),symbol:i.string().required(),senderDid:i.DID().trim().required(),chainHost:i.string().uri().required(),decimal:i.number().integer().required()}).required(),d=i.object({name:i.string().required(),title:i.string(),color:i.string(),bgColor:i.string(),link:i.string().uri()}),f=i.object({type:i.string().required().valid("asset","vc","token"),data:i.object().when("type",{is:"asset",then:u}).concat(i.object().when("type",{is:"vc",then:p})).concat(i.object().when("type",{is:"token",then:c}))}).required(),h=i.object({type:i.string().valid(a),title:i.string(),body:i.string(),attachments:i.array().items(f).default([]),actions:i.array().items(d).default([])}).required(),g=i.object({type:i.string().valid(s),url:i.string().uri().required(),checkUrl:i.string().uri()}).required(),m=i.object({type:i.string().valid(l),feedType:i.string().required(),data:i.object().required()}).required(),y=i.alternatives().try(h,g,m).required(),v=i.object({id:i.string().required(),createdAt:i.date().iso().required(),type:i.string().required(),receiver:i.object({did:i.DID().trim().required()}).required()}).unknown().required(),b=i.DID().trim().required(),_=i.alternatives().try(i.array().items(y),y).required(),T=i.alternatives().try(i.array().items(b),b).required(),E=i.object({keepForOfflineUser:i.boolean()});e.exports={validateReceiver:T.validateAsync.bind(T),validateNotification:_.validateAsync.bind(_),validateMessage:v.validateAsync.bind(v),validateOption:E.validateAsync.bind(E),tokenSchema:c,actionSchema:d,assetSchema:u,vcSchema:p,attachmentSchema:f,notificationSchema:y,messageSchema:v,optionSchema:E}},function(e,t,n){const r=n(17),o=n(9),{isValid:i}=n(35);e.exports={fileExtension:e=>({type:"file",base:e.string(),validate:(e,{error:t})=>e&&"string"==typeof e?{value:e}:{errors:t("file.empty",{file:e})},messages:{"file.empty":'file "{{#file}}" must be non-empty string',"file.enoent":'file "{{#file}}" does not exist',"file.error.generic":'file could not be read. message: "{{#message}}"'},rules:{exists:{multi:!1,method({baseDir:e=null,canSkip:t}={}){return this.$_addRule({name:"exists",args:{baseDir:e,canSkip:t}})},args:[{name:"baseDir",assert:e=>r.existsSync(e),message:"baseDir must exist"},{name:"canSkip",assert:e=>"function"==typeof e,message:"canSkip must be a function"}],validate(e,{error:t},{baseDir:n,canSkip:i}={}){if("function"==typeof i&&i(n,e))return e;try{return r.statSync(o.join(n,e)),e}catch(n){switch(n.code){case"ENOENT":return t("file.enoent",{file:e})}return t("file.error.generic",{message:n.message})}}}}}),didExtension:e=>({type:"DID",base:e.string(),validate:(e,{error:t})=>e&&"string"==typeof e?!1===i(e)?{errors:t("did.invalid",{did:e})}:{value:e}:{errors:t("did.empty",{did:e})},messages:{"did.empty":'did "{{#did}}" must be non-empty string',"did.invalid":'did "{{#did}}" is not valid'}})}},function(e){e.exports=JSON.parse('{"name":"@blocklet/sdk","publishConfig":{"access":"public"},"version":"1.7.23","description":"graphql client to read/write data on abt node","main":"lib/index.js","files":["lib","service"],"scripts":{"lint":"eslint tests lib","lint:fix":"eslint --fix tests lib","test":"node tools/jest.js","coverage":"npm run test -- --coverage"},"author":"linchen1987 <linchen.1987@foxmail.com> (http://github.com/linchen1987)","license":"MIT","dependencies":{"@abtnode/client":"1.7.23","@abtnode/constant":"1.7.23","@abtnode/logger":"1.7.23","@arcblock/did-auth":"^1.16.15","@arcblock/jwt":"^1.16.15","@arcblock/ws":"^1.16.15","@blocklet/meta":"1.7.23","@nedb/core":"^1.2.2","@ocap/mcrypto":"^1.16.15","@ocap/wallet":"^1.16.15","axios":"^0.27.2","fs-extra":"^10.0.1","joi":"^17.6.0","lodash":"^4.17.21","lru-cache":"^6.0.0","url-join":"^4.0.1"},"devDependencies":{"detect-port":"^1.3.0","jest":"^27.4.5"},"gitHead":"aa13838b7597bce11851d0b902575f861aa1ab34"}')},function(e,t,n){const{fromSecretKey:r,WalletType:o}=n(46),{types:i}=n(28);e.exports=()=>{const e="eth"!==process.env.BLOCKLET_WALLET_TYPE?o({role:i.RoleType.ROLE_APPLICATION,pk:i.KeyType.ED25519,hash:i.HashType.SHA3}):"eth";return r(process.env.BLOCKLET_APP_SK,e)}},function(e,t,n){const r=n(27),{parse:o}=n(177),{NODE_MODES:i,ROLES:a}=n(25),s=e=>e.enableWelcomePage&&e.mode===i.DEBUG,l={getNodeInfo:!0,getBlockletMetaFromUrl:!0,getBlocklets:e=>s(e),getRoutingSites:e=>s(e),resetNode:()=>!1};e.exports={protectGQL:(e,t)=>async(n,s,u)=>{const p=n.query.query||n.body.query;if(p){const u=await e.states.node.read();try{const{definitions:c}=o(p),d=c.map(e=>(r(e,"selectionSet.selections")||[]).map(e=>r(e,"name.value"))).reduce((e,t)=>(e.push(...t),e),[]).filter(e=>"__schema"!==e).filter(e=>"function"==typeof l[e]?!l[e](u):!l[e]);if(!n.user&&d.length)return s.status(401).json({code:"forbidden",error:"not allowed"});if(c.filter(e=>"mutation"===e.operation).length>1)return s.status(403).json({code:"forbidden",error:"batch mutation not allowed"});if(c.some(e=>"mutation"===e.operation)&&[i.MAINTENANCE].includes(u.mode))return s.status(503).json({code:"under maintenance",error:"Blocklet server is under maintenance"});if(n.user&&n.user.role!==a.OWNER&&d.length){const r=await e.getRBAC(),o=await Promise.all(d.map(async e=>!t[e]||!!await r.canAny(n.user.role,t[e].permissions.map(e=>e.split("_")))));if(!o.every(Boolean))return s.status(403).json({code:"forbidden",error:"no permission"})}}catch(e){return console.error("Failed to validate query",{err:e,query:p}),s.json({code:"internal",error:e.message})}}return u()}}},function(e,t,n){function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const i=n(207),a=n(1448),{makeExecutableSchema:s}=n(1512),{GraphQLUpload:l}=n(393),{wipeSensitiveData:u,fixBlockletStatus:p}=n(104),c=n(87),d=n(1457),f=n(40)("@abtnode/gql"),h=n(1458),g=async({name:e,dataKeys:t,callback:n})=>{const a=Date.now();try{const s=await n(),l={};if(Array.isArray(t)?t.forEach(e=>{l[e]=s[e]}):l[t]=s,"blocklet"===t){const e=i(s);p(e),l[t]=u(e)}"blocklets"===t&&(l[t]=i(s||[]).map(e=>(p(e),u(e))));const c=Date.now()-a;return c>2e3&&f.warn("graphql resolver latency",{api:e,time:c+"ms"}),function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({code:"ok"},l)}catch(e){throw f.error("graphql resolver error",{error:e}),e}};e.exports=(e={},t=!0)=>{const n={addRoutingSite:e=>({site:e})},r=Object.entries(e).reduce((e,[t,{dataKeys:r,handler:o}])=>(n[t]?e[t]=({input:e}={},i)=>g({name:t,dataKeys:r,callback:()=>o(n[t](e),c(i))}):e[t]=({input:e}={},n)=>g({name:t,dataKeys:r,callback:()=>o(e,c(n))}),e),{});return a({schema:s({typeDefs:d,resolvers:{Upload:l}}),customFormatErrorFn:e=>(f.error("graphql error",{error:e}),{message:e.message,locations:e.locations,stack:e.stack?e.stack.split("\n"):[],path:e.path}),rootValue:r,graphiql:t})},e.exports.wrapResolver=g,e.exports.formatContext=c,e.exports.genConfig=h},function(e,t,n){"use strict";var r=u(n(30)),o=u(n(249)),i=u(n(102)),a=n(177),s=n(1449),l=n(1456);function u(e){return e&&e.__esModule?e:{default:e}}async function p(e){const t=await(0,s.parseBody)(e);return function(e,t){let n=e.query||t.query;"string"!=typeof n&&(n=null);let r=e.variables||t.variables;if(r&&"string"==typeof r)try{r=JSON.parse(r)}catch(e){throw(0,i.default)(400,"Variables are invalid JSON.")}else"object"!=typeof r&&(r=null);let o=e.operationName||t.operationName;"string"!=typeof o&&(o=null);const a=void 0!==e.raw||void 0!==t.raw;return{query:n,variables:r,operationName:o,raw:a}}(e.url&&r.default.parse(e.url,!0).query||{},t)}function c(e,t,n){const r=Buffer.from(n,"utf8");e.setHeader("Content-Type",t+"; charset=utf-8"),e.setHeader("Content-Length",String(r.length)),e.end(r)}e.exports=function(e){if(!e)throw new Error("GraphQL middleware requires options.");return function(t,n){let r,s,u,d,f,h,g,m,y=a.formatError,v=a.validate,b=a.execute,_=a.parse,T=!1;return p(t).then(e=>(s=e,E(s)),e=>E({query:null,variables:null,operationName:null,raw:null}).then(()=>Promise.reject(e))).then(e=>{if(!e.schema)throw new Error("GraphQL middleware options must contain a schema.");const l=e.schema,u=e.rootValue,p=e.fieldResolver,c=e.typeResolver,d=e.validationRules||[],y=e.graphiql;if(r=e.context||t,"GET"!==t.method&&"POST"!==t.method)throw n.setHeader("Allow","GET, POST"),(0,i.default)(405,"GraphQL only supports GET and POST requests.");if(f=s.query,g=s.variables,m=s.operationName,T=function(e,t){return!t.raw&&"html"===(0,o.default)(e).types(["json","html"])}(t,s)&&y,!f){if(T)return null;throw(0,i.default)(400,"Must provide query string.")}const E=(0,a.validateSchema)(l);if(E.length>0)return n.statusCode=500,{errors:E};const S=new a.Source(f,"GraphQL request");try{h=_(S)}catch(e){return n.statusCode=400,{errors:[e]}}const x=v(l,h,[...a.specifiedRules,...d]);if(x.length>0)return n.statusCode=400,{errors:x};if("GET"===t.method){const e=(0,a.getOperationAST)(h,m);if(e&&"query"!==e.operation){if(T)return null;throw n.setHeader("Allow","POST"),(0,i.default)(405,`Can only perform a ${e.operation} operation from a POST request.`)}}try{return b({schema:l,document:h,rootValue:u,contextValue:r,variableValues:g,operationName:m,fieldResolver:p,typeResolver:c})}catch(e){return n.statusCode=400,{errors:[e]}}}).then(e=>e&&d?Promise.resolve(d({document:h,variables:g,operationName:m,result:e,context:r})).then(t=>(t&&"object"==typeof t&&(e.extensions=t),e)):e).catch(e=>(n.statusCode=e.status||500,{errors:[e]})).then(e=>{if(200===n.statusCode&&e&&!e.data&&(n.statusCode=500),e&&e.errors&&(e.errors=e.errors.map(y)),T){const t=(0,l.renderGraphiQL)({query:f,variables:g,operationName:m,result:e,options:"boolean"!=typeof T?T:{}});return c(n,"text/html",t)}if(!e)throw(0,i.default)(500,"Internal Error");if(u||"function"!=typeof n.json){const t=JSON.stringify(e,null,u?2:0);c(n,"application/json",t)}else n.json(e)});async function E(r){const o="function"==typeof e?e(t,n,r):e,i=await o;if(!i||"object"!=typeof i)throw new Error("GraphQL middleware option function must return an options object or a promise which will be resolved to an options object.");return i.formatError&&console.warn("`formatError` is deprecated and replaced by `customFormatErrorFn`. It will be removed in version 1.0.0."),v=i.customValidateFn||v,b=i.customExecuteFn||b,_=i.customParseFn||_,y=i.customFormatErrorFn||i.formatError||y,d=i.extensions,u=i.pretty,i}}},e.exports.getGraphQLParams=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseBody=async function(e){const{body:t}=e;if("object"==typeof t&&!(t instanceof Buffer))return t;if(void 0===e.headers["content-type"])return{};const n=s.default.parse(e);if("string"==typeof t&&"application/graphql"===n.type)return{query:t};if(t)return{};const l=await async function(e,t){const n=(t.parameters.charset||"utf-8").toLowerCase();if("utf-"!==n.slice(0,4))throw(0,i.default)(415,`Unsupported charset "${n.toUpperCase()}".`);const a=e.headers["content-encoding"],s="string"==typeof a?a.toLowerCase():"identity",l="identity"===s?e.headers["content-length"]:null,u=function(e,t){switch(t){case"identity":return e;case"deflate":return e.pipe(r.default.createInflate());case"gzip":return e.pipe(r.default.createGunzip())}throw(0,i.default)(415,`Unsupported content-encoding "${t}".`)}(e,s);try{return await(0,o.default)(u,{encoding:n,length:l,limit:102400})}catch(e){throw"encoding.unsupported"===e.type?(0,i.default)(415,`Unsupported charset "${n.toUpperCase()}".`):(0,i.default)(400,`Invalid body: ${e.message}.`)}}(e,n);switch(n.type){case"application/graphql":return{query:l};case"application/json":if(u.test(l))try{return JSON.parse(l)}catch(e){}throw(0,i.default)(400,"POST body sent invalid JSON.");case"application/x-www-form-urlencoded":return a.default.parse(l)}return{}};var r=l(n(41)),o=l(n(1450)),i=l(n(102)),a=l(n(163)),s=l(n(159));function l(e){return e&&e.__esModule?e:{default:e}}const u=/^[ \t\n\r]*\{/},function(e,t,n){"use strict";
|
|
698
698
|
/*!
|
|
699
699
|
* raw-body
|
|
700
700
|
* Copyright(c) 2013-2014 Jonathan Ong
|
|
@@ -718,7 +718,7 @@ var r=n(9).relative;e.exports=function(e){if(!e)throw new TypeError("argument na
|
|
|
718
718
|
* Copyright(c) 2014 Jonathan Ong
|
|
719
719
|
* Copyright(c) 2016 Douglas Christopher Wilson
|
|
720
720
|
* MIT Licensed
|
|
721
|
-
*/var r=n(1454);function o(e){if(!Object.prototype.hasOwnProperty.call(i.message,e))throw new Error("invalid status code: "+e);return i.message[e]}function i(e){if("number"==typeof e)return o(e);if("string"!=typeof e)throw new TypeError("code must be a number or string");var t=parseInt(e,10);return isNaN(t)?function(e){var t=e.toLowerCase();if(!Object.prototype.hasOwnProperty.call(i.code,t))throw new Error('invalid status message: "'+e+'"');return i.code[t]}(e):o(t)}e.exports=i,i.message=r,i.code=function(e){var t={};return Object.keys(e).forEach((function(n){var r=e[n],o=Number(n);t[r.toLowerCase()]=o})),t}(r),i.codes=function(e){return Object.keys(e).map((function(e){return Number(e)}))}(r),i.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0},i.empty={204:!0,205:!0,304:!0},i.retry={502:!0,503:!0,504:!0}},function(e){e.exports=JSON.parse('{"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I\'m a Teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Too Early","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"}')},function(e,t){e.exports=require("async_hooks")},function(e,t){e.exports={renderGraphiQL:()=>"GraphiQL disabled"}},function(e,t){e.exports="# Code generated by protoc-gen-gogql. DO NOT EDIT\n# source: service.proto\n\nscalar Any\n\nscalar Float32\n\nscalar Int32\n\nscalar Int64\n\nscalar Uint32\n\ninput BlockletRegistryInput {\n\tname: String \n\tdescription: String \n\turl: String \n\tlogoUrl: String \n\tmaintainer: String \n\tcdnUrl: String \n\tselected: Boolean \n\tprotected: Boolean \n\tid: String \n}\n\ninput BlockletServiceInput {\n\tname: String \n\tdescription: String \n\tversion: String \n\tconfig: String \n\tschema: String \n}\n\ninput BlockletStateInterfaceInput {\n\truleId: String \n\ttype: String \n\tname: String \n\turl: String \n}\n\ninput ConfigEntryInput {\n\tkey: String \n\tvalue: String \n\trequired: Boolean \n\tdescription: String \n\tvalidation: String \n\tsecure: Boolean \n\tcustom: Boolean \n}\n\ninput HashFileInput {\n\tfile: String \n\thash: String \n}\n\ninput IssuerInput {\n\tid: String \n\tname: String \n\tpk: String \n}\n\ninput MemberInfoInput {\n\tdid: String \n\tpk: String \n\trole: String \n\tavatar: String \n\tfullName: String \n\temail: String \n\tapproved: Boolean \n\tcreatedAt: String \n\tupdatedAt: String \n\tlocale: String \n\tpassports: [PassportInput!] \n\tfirstLoginAt: String \n\tlastLoginAt: String \n\tremark: String \n}\n\ninput NodeInfoInput {\n\tname: String \n\tdescription: String \n\tautoUpgrade: Boolean \n\tenableWelcomePage: Boolean \n\tregisterUrl: String \n\twebWalletUrl: String \n\tblockletRegistryList: [BlockletRegistryInput!] \n\tdiskAlertThreshold: Uint32 \n}\n\ninput PagingInput {\n\ttotal: Uint32 \n\tpageSize: Uint32 \n\tpageCount: Uint32 \n\tpage: Uint32 \n}\n\ninput PassportInput {\n\tid: String \n\tname: String \n\ttitle: String \n\tissuer: IssuerInput \n\ttype: [String!] \n\tissuanceDate: String \n\texpirationDate: String \n\tstatus: String \n\trole: String \n}\n\ninput PermissionInput {\n\tname: String \n\tdescription: String \n\tisProtected: Boolean \n}\n\ninput RequestAddDomainAliasInput {\n\tid: String \n\tdomainAlias: String \n\tforce: Boolean \n}\n\ninput RequestAddLetsEcryptCertInput {\n\tdomain: String \n}\n\ninput RequestAddNginxHttpsCertInput {\n\tname: String \n\tprivateKey: String \n\tcertificate: String \n}\n\ninput RequestAddRoutingRuleInput {\n\tid: String \n\trule: RoutingRuleInput \n}\n\ninput RequestAddRoutingSiteInput {\n\tdomain: String \n\ttype: String \n\trules: [RoutingRuleInput!] \n}\n\ninput RequestBlockletInput {\n\tdid: String \n\tregistryUrl: String \n\tattachRuntimeInfo: Boolean \n}\n\ninput RequestBlockletDiffInput {\n\tdid: String \n\thashFiles: [HashFileInput!] \n\trootDid: String \n}\n\ninput RequestBlockletMetaFromUrlInput {\n\turl: String \n\tcheckPrice: Boolean \n}\n\ninput RequestChangeBlockletStoreInput {\n\turl: String \n}\n\ninput RequestCheckDomainsInput {\n\tdomains: [String!] \n}\n\ninput RequestConfigBlockletInput {\n\tdid: [String!] \n\tconfigs: [ConfigEntryInput!] \n}\n\ninput RequestConfigPassportIssuanceInput {\n\tteamDid: String \n\tenable: Boolean \n}\n\ninput RequestConfigTrustedPassportsInput {\n\tteamDid: String \n\ttrustedPassports: [TrustedPassportInput!] \n}\n\ninput RequestCreateAccessKeyInput {\n\tremark: String \n\tpassport: String \n}\n\ninput RequestCreatePassportIssuanceInput {\n\tteamDid: String \n\townerDid: String \n\tname: String \n}\n\ninput RequestCreatePermissionInput {\n\tteamDid: String \n\tname: String \n\tdescription: String \n}\n\ninput RequestCreateRoleInput {\n\tteamDid: String \n\tname: String \n\ttitle: String \n\tdescription: String \n\tchildName: String \n\tpermissions: [String!] \n}\n\ninput RequestCreateWebHookInput {\n\ttype: SenderType \n\ttitle: String \n\tdescription: String \n\tparams: [WebHookParamInput!] \n}\n\ninput RequestDeleteAccessKeyInput {\n\taccessKeyId: String \n}\n\ninput RequestDeleteBlockletInput {\n\tdid: String \n\tkeepData: Boolean \n}\n\ninput RequestDeleteComponentInput {\n\tdid: String \n\trootDid: String \n\tkeepData: Boolean \n}\n\ninput RequestDeleteDomainAliasInput {\n\tid: String \n\tdomainAlias: String \n}\n\ninput RequestDeleteNginxHttpsCertInput {\n\tid: String \n}\n\ninput RequestDeletePermissionInput {\n\tteamDid: String \n\tname: String \n}\n\ninput RequestDeleteRoleInput {\n\tteamDid: String \n\tname: String \n}\n\ninput RequestDeleteRoutingRuleInput {\n\tid: String \n\truleId: String \n}\n\ninput RequestDeleteRoutingSiteInput {\n\tid: String \n}\n\ninput RequestDeleteTeamSessionInput {\n\tteamDid: String \n\tsessionId: String \n}\n\ninput RequestDeleteWebHookInput {\n\tid: String \n}\n\ninput RequestEndSessionInput {\n\tid: String \n}\n\ninput RequestFindCertificateByDomainInput {\n\tdomain: String \n}\n\ninput RequestGatewayInput {\n\trequestLimit: RequestLimitInput \n}\n\ninput RequestGetAuditLogsInput {\n\tpaging: PagingInput \n\tscope: String \n\tcategory: String \n}\n\ninput RequestGetBlockletsInput {\n\tuseCache: Boolean \n}\n\ninput RequestGetNotificationsInput {\n\treceiver: String \n\tsender: String \n\tread: Boolean \n\tpaging: PagingInput \n}\n\ninput RequestGetPassportIssuancesInput {\n\tteamDid: String \n\townerDid: String \n}\n\ninput RequestGetRoutingSitesInput {\n\tsnapshotHash: String \n}\n\ninput RequestGetRoutingSnapshotsInput {\n\tlimit: Int32 \n}\n\ninput RequestGetSessionInput {\n\tid: String \n}\n\ninput RequestGetSnapshotSitesInput {\n\thash: String \n}\n\ninput RequestGrantPermissionForRoleInput {\n\tteamDid: String \n\troleName: String \n\tgrantName: String \n}\n\ninput RequestHasPermissionInput {\n\tteamDid: String \n\trole: String \n\tpermission: String \n}\n\ninput RequestInstallComponentInput {\n\trootDid: String \n\tmountPoint: String \n\turl: String \n\tfile: Upload \n\tdid: String \n\tdiffVersion: String \n\tdeleteSet: [String!] \n\tname: String \n\ttitle: String \n}\n\ninput RequestInstallFromVcInput {\n\tchallenge: String \n\tvcPresentation: Any \n}\n\ninput RequestLatestBlockletVersionInput {\n\tdid: String \n\tversion: String \n}\n\ninput RequestLimitInput {\n\tenabled: Boolean \n\trate: Uint32 \n\tipHeader: String \n}\n\ninput RequestListBlockletsInput {\n\tregistryUrl: String \n}\n\ninput RequestNodeRoutingInput {\n\tprovider: String \n\tsnapshotHash: String \n\tforceRepopulate: Boolean \n}\n\ninput RequestReadNotificationsInput {\n\tid: String \n}\n\ninput RequestResetNodeInput {\n\towner: Boolean \n\tblocklets: Boolean \n\twebhooks: Boolean \n\tcertificates: Boolean \n\taccessKeys: Boolean \n\tblockletExtras: Boolean \n\troutingRules: Boolean \n\tusers: Boolean \n\tinvitations: Boolean \n}\n\ninput RequestRevokePermissionFromRoleInput {\n\tteamDid: String \n\troleName: String \n\tgrantName: String \n}\n\ninput RequestRevokeUserPassportInput {\n\tteamDid: String \n\tuserDid: String \n\tpassportId: String \n}\n\ninput RequestSendMsgInput {\n\twebhookId: String \n\tmessage: String \n}\n\ninput RequestStartSessionInput {\n\tdata: String \n}\n\ninput RequestTakeRoutingSnapshotInput {\n\tdryRun: Boolean \n\tmessage: String \n}\n\ninput RequestTeamPermissionInput {\n\tteamDid: String \n\tpermission: PermissionInput \n}\n\ninput RequestTeamRoleInput {\n\tteamDid: String \n\trole: RoleInput \n}\n\ninput RequestTeamUserInput {\n\tteamDid: String \n\tuser: MemberInfoInput \n}\n\ninput RequestUpdateAccessKeyInput {\n\taccessKeyId: String \n\tremark: String \n\tpassport: String \n}\n\ninput RequestUpdateChildBlockletsInput {\n\tupdateId: String \n}\n\ninput RequestUpdateNginxHttpsCertInput {\n\tid: String \n\tname: String \n}\n\ninput RequestUpdatePermissionsForRoleInput {\n\tteamDid: String \n\troleName: String \n\tgrantNames: [String!] \n}\n\ninput RequestUpdateRoutingRuleInput {\n\tid: String \n\trule: RoutingRuleInput \n}\n\ninput RequestUpdateRoutingSiteInput {\n\tid: String \n\tcorsAllowedOrigins: [String!] \n\tdomain: String \n}\n\ninput RequestUpdateSessionInput {\n\tid: String \n\tdata: String \n}\n\ninput RequestUpgradeBlockletInput {\n\tdid: String \n\tregistryUrl: String \n}\n\ninput RequestVersionedBlockletInput {\n\tdid: String \n\turl: String \n\tfile: Upload \n\tdiffVersion: String \n\tdeleteSet: [String!] \n\ttitle: String \n\tdescription: String \n\tstartImmediately: Boolean \n}\n\ninput RequsetCreateInvitationInput {\n\tteamDid: String \n\trole: String \n\tremark: String \n}\n\ninput RequsetCreateTransferNodeInvitationInput {\n\tteamDid: String \n\tremark: String \n}\n\ninput RequsetDeleteInvitationInput {\n\tteamDid: String \n\tinviteId: String \n}\n\ninput RoleInput {\n\tname: String \n\tdescription: String \n\tgrants: [String!] \n\ttitle: String \n\tisProtected: Boolean \n}\n\ninput RoutingRuleInput {\n\tid: String \n\tfrom: RoutingRuleFromInput \n\tto: RoutingRuleToInput \n\tisProtected: Boolean \n\tinterfaces: [BlockletStateInterfaceInput!] \n\tservices: [BlockletServiceInput!] \n}\n\ninput RoutingRuleFromInput {\n\tpathPrefix: String \n\theader: [RoutingRuleHeaderInput!] \n}\n\ninput RoutingRuleHeaderInput {\n\tkey: String \n\tvalue: String \n\ttype: HeaderMatchType \n}\n\ninput RoutingRuleToInput {\n\tport: Uint32 \n\ttype: BackendServiceType \n\tdid: String \n\turl: String \n\tredirectCode: Int32 \n\tinterfaceName: String \n\tcomponentId: String \n}\n\ninput TeamInput {\n\tteamDid: String \n}\n\ninput TrustedPassportInput {\n\tissuerDid: String \n\tremark: String \n\tmappings: [TrustedPassportMappingInput!] \n}\n\ninput TrustedPassportMappingInput {\n\tfrom: TrustedPassportMappingFromInput \n\tto: TrustedPassportMappingToInput \n}\n\ninput TrustedPassportMappingFromInput {\n\tpassport: String \n}\n\ninput TrustedPassportMappingToInput {\n\trole: String \n}\n\ninput WebHookParamInput {\n\tname: String \n\tdescription: String \n\trequired: Boolean \n\tdefaultValue: String \n\tvalue: String \n\ttype: String \n}\n\ntype AccessKey {\n\taccessKeyId: String \n\tremark: String \n\tpassport: String \n\tcreatedAt: String \n\tlastUsedAt: String \n\tcreatedBy: String \n\tupdatedBy: String \n}\n\ntype AuditLog {\n\tid: String \n\tscope: String \n\tcategory: String \n\taction: String \n\tcontent: String \n\tactor: AuditLogActor \n\tenv: AuditLogEnv \n\tgeo: AuditLogGeo \n\tcreatedAt: String \n\tip: String \n}\n\ntype AuditLogActor {\n\tdid: String \n\trole: String \n\tfullName: String \n}\n\ntype AuditLogEnv {\n\tbrowser: AuditLogEnvItem \n\tos: AuditLogEnvItem \n}\n\ntype AuditLogEnvItem {\n\tname: String \n\tversion: String \n}\n\ntype AuditLogGeo {\n\tcountry: String \n\tcity: String \n}\n\ntype BlockletCapabilities {\n\tclusterMode: Boolean \n\tcomponent: Boolean \n}\n\ntype BlockletDiff {\n\thasBlocklet: Boolean \n\tversion: String \n\taddSet: [String!] \n\tchangeSet: [String!] \n\tdeleteSet: [String!] \n}\n\ntype BlockletDist {\n\ttarball: String \n\tintegrity: String \n}\n\ntype BlockletEngine {\n\tname: String \n\tdisplayName: String \n\tdescription: String \n\tversion: String \n\tavailable: Boolean \n\tvisible: Boolean \n}\n\ntype BlockletMeta {\n\tdid: String \n\tname: String \n\tversion: String \n\tdescription: String \n\tinterfaces: [BlockletMetaInterface!] \n\tauthor: BlockletMetaPerson \n\tmain: String \n\tstats: BlockletStats \n\thomepage: String \n\tprice: Float32 \n\tpath: String \n\tcommunity: String \n\tdocumentation: String \n\tsupport: String \n\tscreenshots: [String!] \n\tkeywords: [String!] \n\tgroup: String \n\tlogo: String \n\ttitle: String \n\tdist: BlockletDist \n\tmaintainers: [BlockletMetaPerson!] \n\tcontributors: [BlockletMetaPerson!] \n\trepository: BlockletRepository \n\tpayment: BlockletPayment \n\tnftFactory: String \n\tlastPublishedAt: String \n\tcapabilities: BlockletCapabilities \n\tchildren: [ChildConfig!] \n\tenvironments: [Environment!] \n\trequirements: Requirement \n\tbundleDid: String \n\tbundleName: String \n}\n\ntype BlockletMetaInterface {\n\ttype: String \n\tname: String \n\tpath: String \n\tprefix: String \n\tprotocol: String \n\tport: Any \n\tservices: [BlockletMetaService!] \n}\n\ntype BlockletMetaPerson {\n\tname: String \n\temail: String \n\turl: String \n}\n\ntype BlockletMetaService {\n\tname: String \n\tconfig: Any \n}\n\ntype BlockletPayment {\n\tprice: [BlockletPaymentPrice!] \n\tshare: [BlockletPaymentShare!] \n}\n\ntype BlockletPaymentPrice {\n\taddress: String \n\tvalue: String \n\tsymbol: String \n}\n\ntype BlockletPaymentShare {\n\taddress: String \n\tname: String \n\tvalue: String \n}\n\ntype BlockletPreUpdateInfo {\n\tupdateId: String \n\tupdateList: [UpdateList!] \n}\n\ntype BlockletRegistry {\n\tname: String \n\tdescription: String \n\turl: String \n\tlogoUrl: String \n\tmaintainer: String \n\tcdnUrl: String \n\tselected: Boolean \n\tprotected: Boolean \n\tid: String \n}\n\ntype BlockletRepository {\n\ttype: String \n\turl: String \n}\n\ntype BlockletService {\n\tname: String \n\tdescription: String \n\tversion: String \n\tconfig: String \n\tschema: String \n}\n\ntype BlockletSettings {\n\tinitialized: Boolean \n\tenablePassportIssuance: Boolean \n\ttrustedPassports: [TrustedPassport!] \n\twhoCanAccess: String \n\towner: WalletInfo \n\tchildren: [DeletedBlockletState!] \n}\n\ntype BlockletState {\n\tmeta: BlockletMeta \n\tstatus: BlockletStatus \n\tcreatedAt: String \n\tinstalledAt: String \n\tstartedAt: String \n\tpausedAt: String \n\tstoppedAt: String \n\tenvironments: [ConfigEntry!] \n\tconfigs: [ConfigEntry!] \n\tdiskInfo: DiskInfo \n\truntimeInfo: RuntimeInfo \n\tsource: BlockletSource \n\tdeployedFrom: String \n\tbundleSource: Any \n\tport: Float32 \n\tinterfaces: [BlockletStateInterface!] \n\tengine: BlockletEngine \n\tmode: String \n\tports: Any \n\tchildren: [BlockletState!] \n\ttrustedPassports: [TrustedPassport!] \n\tenablePassportIssuance: Boolean \n\tdynamic: Boolean \n\tmountPoint: String \n\tsettings: BlockletSettings \n\tappDid: String \n\tsite: RoutingSite \n}\n\ntype BlockletStateInterface {\n\truleId: String \n\ttype: String \n\tname: String \n\turl: String \n}\n\ntype BlockletStats {\n\tdownloads: Float32 \n\tstar: Float32 \n\tpurchases: Float32 \n}\n\ntype BooleanResponse {\n\tcode: StatusCode \n\tresult: Boolean \n}\n\ntype Certificate {\n\tname: String \n\tdomain: String \n\tid: String \n\tmeta: CertificateMeta \n\tmatchedSites: [MatchedSites!] \n\tcreatedAt: String \n\tupdatedAt: String \n\tisProtected: Boolean \n\tsource: String \n\tstatus: String \n}\n\ntype CertificateIssuer {\n\tcountryName: String \n\torganizationName: String \n\tcommonName: String \n}\n\ntype CertificateMeta {\n\tissuer: CertificateIssuer \n\tsans: [String!] \n\tvalidFrom: Int64 \n\tvalidTo: Int64 \n\tfingerprintAlg: String \n\tfingerprint: String \n\tvalidityPeriod: Int64 \n}\n\ntype ChildConfig {\n\tname: String \n\tresolved: String \n\tmountPoint: String \n}\n\ntype ConfigEntry {\n\tkey: String \n\tvalue: String \n\trequired: Boolean \n\tdescription: String \n\tvalidation: String \n\tsecure: Boolean \n\tcustom: Boolean \n}\n\ntype CreateAccessKey {\n\taccessKeyId: String \n\taccessKeySecret: String \n\tremark: String \n\tpassport: String \n\tcreatedAt: String \n\tlastUsedAt: String \n}\n\ntype DelegationState {\n\tdelegated: Boolean \n}\n\ntype DeletedBlockletMeta {\n\tdid: String \n\tname: String \n\tversion: String \n\tdescription: String \n\ttitle: String \n\tbundleDid: String \n\tbundleName: String \n}\n\ntype DeletedBlockletState {\n\tmeta: DeletedBlockletMeta \n\tstatus: BlockletStatus \n\tdeployedFrom: String \n\tmountPoint: String \n\tdeletedAt: String \n}\n\ntype DiskInfo {\n\tapp: Float32 \n\tdata: Float32 \n\tlog: Float32 \n\tcache: Float32 \n\tblocklets: Float32 \n}\n\ntype Environment {\n\tname: String \n\tdescription: String \n\tdefault: String \n\trequired: Boolean \n\tsecure: Boolean \n\tvalidation: String \n\tshared: Boolean \n}\n\ntype Fuel {\n\tendpoint: String \n\taddress: String \n\tvalue: String \n\treason: String \n}\n\ntype Gateway {\n\trequestLimit: RequestLimit \n}\n\ntype GeneralResponse {\n\tcode: StatusCode \n}\n\ntype IPInfo {\n\tinternalV4: String \n\texternalV4: String \n\tinternalV6: String \n\texternalV6: String \n}\n\ntype InviteInfo {\n\tinviteId: String \n\trole: String \n\tremark: String \n\texpireDate: String \n\tinviter: MemberInfo \n\tteamDid: String \n\tinterfaceName: String \n}\n\ntype Issuer {\n\tid: String \n\tname: String \n\tpk: String \n}\n\ntype LatestBlockletVersion {\n\tdid: String \n\tversion: String \n\tregistryUrl: String \n}\n\ntype LauncherInfo {\n\tdid: String \n\ttype: String \n\tprovider: String \n\turl: String \n\ttag: String \n\tchainHost: String \n}\n\ntype MatchedSites {\n\tid: String \n\tdomain: String \n}\n\ntype MemberInfo {\n\tdid: String \n\tpk: String \n\trole: String \n\tavatar: String \n\tfullName: String \n\temail: String \n\tapproved: Boolean \n\tcreatedAt: String \n\tupdatedAt: String \n\tlocale: String \n\tpassports: [Passport!] \n\tfirstLoginAt: String \n\tlastLoginAt: String \n\tremark: String \n}\n\ntype NodeEnvInfo {\n\tip: IPInfo \n\tos: String \n\tlocation: String \n\tdocker: Boolean \n\timage: Boolean \n\tblockletEngines: [BlockletEngine!] \n\tgitpod: Boolean \n\tdisk: DiskInfo \n}\n\ntype NodeRouting {\n\tprovider: String \n\tsnapshotHash: String \n\tadminPath: String \n\trequestLimit: RequestLimit \n}\n\ntype NodeState {\n\tdid: String \n\tpk: String \n\tversion: String \n\tname: String \n\tdescription: String \n\tport: String \n\tinitialized: Boolean \n\tnodeOwner: WalletInfo \n\tcreatedAt: String \n\tstartedAt: String \n\tinitializedAt: String \n\tmode: String \n\trouting: NodeRouting \n\tmembers: [MemberInfo!] \n\tenvironments: [ConfigEntry!] \n\tuptime: Float32 \n\tautoUpgrade: Boolean \n\tnextVersion: String \n\tupgradeSessionId: String \n\tregisterUrl: String \n\tenableWelcomePage: Boolean \n\twebWalletUrl: String \n\tblockletRegistryList: [BlockletRegistry!] \n\townerNft: OwnerNft \n\tdiskAlertThreshold: Uint32 \n\ttrustedPassports: [TrustedPassport!] \n\tlauncher: LauncherInfo \n\tenablePassportIssuance: Boolean \n\tdidRegistry: String \n\tdidDomain: String \n}\n\ntype Notification {\n\tsender: String \n\treceiver: String \n\ttitle: String \n\tdescription: String \n\taction: String \n\tentityType: String \n\tentityId: String \n\tread: Boolean \n\tcreatedAt: String \n\tupdatedAt: String \n\tid: String \n\tseverity: String \n}\n\ntype OwnerNft {\n\tdid: String \n\tholder: String \n\tissuer: String \n}\n\ntype Paging {\n\ttotal: Uint32 \n\tpageSize: Uint32 \n\tpageCount: Uint32 \n\tpage: Uint32 \n}\n\ntype Passport {\n\tid: String \n\tname: String \n\ttitle: String \n\tissuer: Issuer \n\ttype: [String!] \n\tissuanceDate: String \n\texpirationDate: String \n\tstatus: String \n\trole: String \n}\n\ntype PassportIssuanceInfo {\n\tid: String \n\tname: String \n\ttitle: String \n\texpireDate: String \n\tteamDid: String \n\townerDid: String \n}\n\ntype Permission {\n\tname: String \n\tdescription: String \n\tisProtected: Boolean \n}\n\ntype RequestLimit {\n\tenabled: Boolean \n\trate: Uint32 \n\tipHeader: String \n}\n\ntype Requirement {\n\tserver: String \n\tos: Any \n\tcpu: Any \n\tfuels: [Fuel!] \n}\n\ntype ResponseAccessKeys {\n\tcode: StatusCode \n\tlist: [AccessKey!] \n}\n\ntype ResponseAddLetsEcryptCert {\n\tcode: StatusCode \n}\n\ntype ResponseAddNginxHttpsCert {\n\tcode: StatusCode \n}\n\ntype ResponseBlocklet {\n\tcode: StatusCode \n\tblocklet: BlockletState \n}\n\ntype ResponseBlockletDiff {\n\tcode: StatusCode \n\tblockletDiff: BlockletDiff \n}\n\ntype ResponseBlockletMeta {\n\tcode: StatusCode \n\tmeta: Any \n}\n\ntype ResponseBlockletMetaFromUrl {\n\tcode: StatusCode \n\tmeta: BlockletMeta \n\tisFree: Boolean \n\tisInstalled: Boolean \n\tisRunning: Boolean \n}\n\ntype ResponseCheckChildBlockletsForUpdates {\n\tcode: StatusCode \n\tpreUpdateInfo: BlockletPreUpdateInfo \n}\n\ntype ResponseCheckDomains {\n\tcode: StatusCode \n}\n\ntype ResponseCheckNodeVersion {\n\tcode: StatusCode \n\tversion: String \n}\n\ntype ResponseConfigBlocklet {\n\tcode: StatusCode \n\tblocklet: BlockletState \n}\n\ntype ResponseCreateAccessKey {\n\tcode: StatusCode \n\tdata: CreateAccessKey \n}\n\ntype ResponseCreateInvitation {\n\tcode: StatusCode \n\tinviteInfo: InviteInfo \n}\n\ntype ResponseCreatePassportIssuance {\n\tcode: StatusCode \n\tinfo: PassportIssuanceInfo \n}\n\ntype ResponseCreateTransferNodeInvitation {\n\tcode: StatusCode \n\tinviteInfo: InviteInfo \n}\n\ntype ResponseCreateWebHook {\n\tcode: StatusCode \n\twebhook: WebHookSender \n}\n\ntype ResponseDelegationState {\n\tcode: StatusCode \n\tstate: DelegationState \n}\n\ntype ResponseDeleteAccessKey {\n\tcode: StatusCode \n}\n\ntype ResponseDeleteNginxHttpsCert {\n\tcode: StatusCode \n}\n\ntype ResponseDeleteWebHook {\n\tcode: StatusCode \n}\n\ntype ResponseFindCertificateByDomain {\n\tcode: StatusCode \n\tcert: Certificate \n}\n\ntype ResponseGateway {\n\tcode: StatusCode \n\tgateway: Gateway \n}\n\ntype ResponseGetAuditLogs {\n\tcode: StatusCode \n\tlist: [AuditLog!] \n\tpaging: Paging \n}\n\ntype ResponseGetBlocklets {\n\tcode: StatusCode \n\tblocklets: [BlockletState!] \n}\n\ntype ResponseGetCertificates {\n\tcode: StatusCode \n\tcertificates: [Certificate!] \n}\n\ntype ResponseGetInvitations {\n\tcode: StatusCode \n\tinvitations: [InviteInfo!] \n}\n\ntype ResponseGetNodeEnv {\n\tcode: StatusCode \n\tinfo: NodeEnvInfo \n}\n\ntype ResponseGetNodeInfo {\n\tcode: StatusCode \n\tinfo: NodeState \n}\n\ntype ResponseGetNotifications {\n\tcode: StatusCode \n\tlist: [Notification!] \n\tpaging: Paging \n}\n\ntype ResponseGetPassportIssuances {\n\tcode: StatusCode \n\tlist: [PassportIssuanceInfo!] \n}\n\ntype ResponseGetRoutingProviders {\n\tcode: StatusCode \n\tproviders: [RoutingProvider!] \n}\n\ntype ResponseGetRoutingSites {\n\tcode: StatusCode \n\tsites: [RoutingSite!] \n}\n\ntype ResponseGetRoutingSnapshots {\n\tcode: StatusCode \n\tsnapshots: [RoutingSnapshot!] \n}\n\ntype ResponseGetServices {\n\tcode: StatusCode \n\tservices: [BlockletService!] \n}\n\ntype ResponseGetSession {\n\tcode: StatusCode \n\tsession: Any \n}\n\ntype ResponseGetSnapshotSites {\n\tcode: StatusCode \n\tsites: [RoutingSite!] \n}\n\ntype ResponseInstallFromVc {\n\tcode: StatusCode \n\tblocklet: BlockletState \n}\n\ntype ResponseLatestBlockletVersion {\n\tcode: StatusCode \n\tdata: LatestBlockletVersion \n}\n\ntype ResponseListBlocklets {\n\tcode: StatusCode \n\tblocklets: [BlockletMeta!] \n}\n\ntype ResponsePermission {\n\tcode: StatusCode \n\tpermission: Permission \n}\n\ntype ResponsePermissions {\n\tcode: StatusCode \n\tpermissions: [Permission!] \n}\n\ntype ResponseReadNotifications {\n\tcode: StatusCode \n\tnumAffected: Int32 \n}\n\ntype ResponseResetNode {\n\tcode: StatusCode \n}\n\ntype ResponseRole {\n\tcode: StatusCode \n\trole: Role \n}\n\ntype ResponseRoles {\n\tcode: StatusCode \n\troles: [Role!] \n}\n\ntype ResponseRoutingSite {\n\tcode: StatusCode \n\tsite: RoutingSite \n}\n\ntype ResponseSendMsg {\n\tcode: StatusCode \n}\n\ntype ResponseSenderList {\n\tcode: StatusCode \n\tsenders: [WebHookSender!] \n}\n\ntype ResponseTakeRoutingSnapshot {\n\tcode: StatusCode \n\thash: String \n}\n\ntype ResponseUpdateAccessKey {\n\tcode: StatusCode \n\tdata: AccessKey \n}\n\ntype ResponseUpdateNginxHttpsCert {\n\tcode: StatusCode \n}\n\ntype ResponseUpgradeNodeVersion {\n\tcode: StatusCode \n\tsessionId: String \n}\n\ntype ResponseUser {\n\tcode: StatusCode \n\tuser: MemberInfo \n}\n\ntype ResponseUsers {\n\tcode: StatusCode \n\tusers: [MemberInfo!] \n}\n\ntype ResponseWebHooks {\n\tcode: StatusCode \n\twebhooks: [WebHookRecord!] \n}\n\ntype Role {\n\tname: String \n\tdescription: String \n\tgrants: [String!] \n\ttitle: String \n\tisProtected: Boolean \n}\n\ntype RoutingProvider {\n\tname: String \n\tdescription: String \n\trunning: Boolean \n\tavailable: Boolean \n\terror: String \n}\n\ntype RoutingRule {\n\tid: String \n\tfrom: RoutingRuleFrom \n\tto: RoutingRuleTo \n\tisProtected: Boolean \n\tinterfaces: [BlockletStateInterface!] \n\tservices: [BlockletService!] \n}\n\ntype RoutingRuleFrom {\n\tpathPrefix: String \n\theader: [RoutingRuleHeader!] \n}\n\ntype RoutingRuleHeader {\n\tkey: String \n\tvalue: String \n\ttype: HeaderMatchType \n}\n\ntype RoutingRuleTo {\n\tport: Uint32 \n\ttype: BackendServiceType \n\tdid: String \n\turl: String \n\tredirectCode: Int32 \n\tinterfaceName: String \n\tcomponentId: String \n}\n\ntype RoutingSite {\n\tid: String \n\tdomain: String \n\tdomainAliases: [Any!] \n\trules: [RoutingRule!] \n\tisProtected: Boolean \n\tcorsAllowedOrigins: [String!] \n}\n\ntype RoutingSnapshot {\n\thash: String \n\ttree: String \n\tmessage: String \n\tauthor: String \n\tcreatedAt: String \n}\n\ntype RuntimeInfo {\n\tpid: String \n\tport: String \n\tuptime: String \n\tmemoryUsage: Float32 \n\tcpuUsage: Float32 \n}\n\ntype TrustedPassport {\n\tissuerDid: String \n\tremark: String \n\tmappings: [TrustedPassportMapping!] \n}\n\ntype TrustedPassportMapping {\n\tfrom: TrustedPassportMappingFrom \n\tto: TrustedPassportMappingTo \n}\n\ntype TrustedPassportMappingFrom {\n\tpassport: String \n}\n\ntype TrustedPassportMappingTo {\n\trole: String \n}\n\ntype UpdateList {\n\tid: String \n\tmeta: BlockletMeta \n}\n\ntype WalletInfo {\n\tdid: String \n\tpk: String \n}\n\ntype WebHookParam {\n\tname: String \n\tdescription: String \n\trequired: Boolean \n\tdefaultValue: String \n\tvalue: String \n\ttype: String \n}\n\ntype WebHookRecord {\n\ttype: SenderType \n\tid: String \n\tparams: [WebHookParam!] \n\tcreatedAt: String \n}\n\ntype WebHookSender {\n\ttype: SenderType \n\ttitle: String \n\tdescription: String \n\tparams: [WebHookParam!] \n}\n\nenum BackendServiceType {\n\tdaemon\n\tblocklet\n\tredirect\n\tnone\n\tgeneral_proxy\n\tdirect_response\n}\n\nenum BlockletSource {\n\tregistry\n\tlocal\n\tupload\n\turl\n\tcustom\n}\n\nenum BlockletStatus {\n\tadded\n\tdownloading\n\tdownloaded\n\tinstalling\n\tinstalled\n\tstarting\n\trunning\n\tstopping\n\tstopped\n\terror\n\tupgrading\n\trestarting\n\tcorrupted\n\twaiting\n\tdeleted\n\tunknown\n}\n\nenum HeaderMatchType {\n\texact\n\tpartial\n\tregexp\n}\n\nenum SenderType {\n\tslack\n\tapi\n}\n\nenum StatusCode {\n\tok\n\tblocklet_not_found\n\tblocklet_not_purchased\n\tforbidden\n\tinternal\n\ttimeout\n}\n\nscalar Upload\n\ntype Mutation {\n\tinstallBlocklet(input: RequestVersionedBlockletInput): ResponseBlocklet\n\tinstallBlockletFromVc(input: RequestInstallFromVcInput): ResponseInstallFromVc\n\tinstallComponent(input: RequestInstallComponentInput): ResponseBlocklet\n\tstartBlocklet(input: RequestBlockletInput): ResponseBlocklet\n\tstopBlocklet(input: RequestBlockletInput): ResponseBlocklet\n\treloadBlocklet(input: RequestBlockletInput): ResponseBlocklet\n\trestartBlocklet(input: RequestBlockletInput): ResponseBlocklet\n\tdeleteBlocklet(input: RequestDeleteBlockletInput): ResponseBlocklet\n\tdeleteComponent(input: RequestDeleteComponentInput): ResponseBlocklet\n\tcancelDownloadBlocklet(input: RequestBlockletInput): ResponseBlocklet\n\tupgradeBlocklet(input: RequestUpgradeBlockletInput): ResponseBlocklet\n\tconfigBlocklet(input: RequestConfigBlockletInput): ResponseConfigBlocklet\n\tcheckChildBlockletsForUpdates(input: RequestBlockletInput): ResponseCheckChildBlockletsForUpdates\n\tupdateChildBlocklets(input: RequestUpdateChildBlockletsInput): ResponseBlocklet\n\tupdateNodeInfo(input: NodeInfoInput): ResponseGetNodeInfo\n\tupdateNodeRouting(input: RequestNodeRoutingInput): ResponseGetNodeInfo\n\tupgradeNodeVersion: ResponseUpgradeNodeVersion\n\taddBlockletStore(input: RequestChangeBlockletStoreInput): GeneralResponse\n\tdeleteBlockletStore(input: RequestChangeBlockletStoreInput): GeneralResponse\n\tselectBlockletStore(input: RequestChangeBlockletStoreInput): GeneralResponse\n\tresetNode(input: RequestResetNodeInput): ResponseResetNode\n\tupdateGateway(input: RequestGatewayInput): ResponseGateway\n\tcreateMemberInvitation(input: RequsetCreateInvitationInput): ResponseCreateInvitation\n\tcreateTransferInvitation(input: RequsetCreateTransferNodeInvitationInput): ResponseCreateTransferNodeInvitation\n\tdeleteInvitation(input: RequsetDeleteInvitationInput): GeneralResponse\n\tcreatePassportIssuance(input: RequestCreatePassportIssuanceInput): ResponseCreatePassportIssuance\n\tdeletePassportIssuance(input: RequestDeleteTeamSessionInput): GeneralResponse\n\tconfigTrustedPassports(input: RequestConfigTrustedPassportsInput): GeneralResponse\n\tconfigPassportIssuance(input: RequestConfigPassportIssuanceInput): GeneralResponse\n\tremoveUser(input: RequestTeamUserInput): ResponseUser\n\tupdateUserApproval(input: RequestTeamUserInput): ResponseUser\n\tupdateUserRole(input: RequestTeamUserInput): ResponseUser\n\trevokeUserPassport(input: RequestRevokeUserPassportInput): ResponseUser\n\tenableUserPassport(input: RequestRevokeUserPassportInput): ResponseUser\n\tcreateRole(input: RequestCreateRoleInput): ResponseRole\n\tupdateRole(input: RequestTeamRoleInput): ResponseRole\n\tdeleteRole(input: RequestDeleteRoleInput): GeneralResponse\n\tcreatePermission(input: RequestCreatePermissionInput): ResponsePermission\n\tupdatePermission(input: RequestTeamPermissionInput): ResponsePermission\n\tdeletePermission(input: RequestDeletePermissionInput): GeneralResponse\n\tgrantPermissionForRole(input: RequestGrantPermissionForRoleInput): GeneralResponse\n\trevokePermissionFromRole(input: RequestRevokePermissionFromRoleInput): GeneralResponse\n\tupdatePermissionsForRole(input: RequestUpdatePermissionsForRoleInput): ResponseRole\n\thasPermission(input: RequestHasPermissionInput): BooleanResponse\n\treadNotifications(input: RequestReadNotificationsInput): ResponseReadNotifications\n\tunreadNotifications(input: RequestReadNotificationsInput): ResponseReadNotifications\n\taddRoutingSite(input: RequestAddRoutingSiteInput): ResponseRoutingSite\n\taddDomainAlias(input: RequestAddDomainAliasInput): ResponseRoutingSite\n\tdeleteDomainAlias(input: RequestDeleteDomainAliasInput): ResponseRoutingSite\n\tdeleteRoutingSite(input: RequestDeleteRoutingSiteInput): GeneralResponse\n\tupdateRoutingSite(input: RequestUpdateRoutingSiteInput): ResponseRoutingSite\n\taddRoutingRule(input: RequestAddRoutingRuleInput): ResponseRoutingSite\n\tupdateRoutingRule(input: RequestUpdateRoutingRuleInput): ResponseRoutingSite\n\tdeleteRoutingRule(input: RequestDeleteRoutingRuleInput): ResponseRoutingSite\n\ttakeRoutingSnapshot(input: RequestTakeRoutingSnapshotInput): ResponseTakeRoutingSnapshot\n\tupdateCertificate(input: RequestUpdateNginxHttpsCertInput): ResponseUpdateNginxHttpsCert\n\taddCertificate(input: RequestAddNginxHttpsCertInput): ResponseAddNginxHttpsCert\n\tdeleteCertificate(input: RequestDeleteNginxHttpsCertInput): ResponseDeleteNginxHttpsCert\n\tissueLetsEncryptCert(input: RequestAddLetsEcryptCertInput): ResponseAddLetsEcryptCert\n\tcreateAccessKey(input: RequestCreateAccessKeyInput): ResponseCreateAccessKey\n\tupdateAccessKey(input: RequestUpdateAccessKeyInput): ResponseUpdateAccessKey\n\tdeleteAccessKey(input: RequestDeleteAccessKeyInput): ResponseDeleteAccessKey\n\tcreateWebHook(input: RequestCreateWebHookInput): ResponseCreateWebHook\n\tdeleteWebHook(input: RequestDeleteWebHookInput): ResponseDeleteWebHook\n\tstartSession(input: RequestStartSessionInput): ResponseGetSession\n\tupdateSession(input: RequestUpdateSessionInput): ResponseGetSession\n\tendSession(input: RequestEndSessionInput): ResponseGetSession\n}\n\ntype Query {\n\tgetBlocklet(input: RequestBlockletInput): ResponseBlocklet\n\tgetBlockletMetaFromUrl(input: RequestBlockletMetaFromUrlInput): ResponseBlockletMetaFromUrl\n\tgetBlockletDiff(input: RequestBlockletDiffInput): ResponseBlockletDiff\n\tgetBlocklets(input: RequestGetBlockletsInput): ResponseGetBlocklets\n\tgetLatestBlockletVersion(input: RequestLatestBlockletVersionInput): ResponseLatestBlockletVersion\n\tgetNodeInfo: ResponseGetNodeInfo\n\tgetNodeEnv: ResponseGetNodeEnv\n\tcheckNodeVersion: ResponseCheckNodeVersion\n\tgetDelegationState: ResponseDelegationState\n\tlistBlocklets(input: RequestListBlockletsInput): ResponseListBlocklets\n\tgetBlockletMeta(input: RequestBlockletInput): ResponseBlockletMeta\n\tgetNotifications(input: RequestGetNotificationsInput): ResponseGetNotifications\n\tgetRoutingSites(input: RequestGetRoutingSitesInput): ResponseGetRoutingSites\n\tgetRoutingSnapshots(input: RequestGetRoutingSnapshotsInput): ResponseGetRoutingSnapshots\n\tgetSnapshotSites(input: RequestGetSnapshotSitesInput): ResponseGetSnapshotSites\n\tgetRoutingProviders: ResponseGetRoutingProviders\n\tgetServices: ResponseGetServices\n\tgetCertificates: ResponseGetCertificates\n\tcheckDomains(input: RequestCheckDomainsInput): ResponseCheckDomains\n\tfindCertificateByDomain(input: RequestFindCertificateByDomainInput): ResponseFindCertificateByDomain\n\tgetAccessKeys: ResponseAccessKeys\n\tgetWebHooks: ResponseWebHooks\n\tgetWebhookSenders: ResponseSenderList\n\tsendTestMessage(input: RequestSendMsgInput): ResponseSendMsg\n\tgetSession(input: RequestGetSessionInput): ResponseGetSession\n\tgetRoles(input: TeamInput): ResponseRoles\n\tgetPermissions(input: TeamInput): ResponsePermissions\n\tgetInvitations(input: TeamInput): ResponseGetInvitations\n\tgetUsers(input: TeamInput): ResponseUsers\n\tgetUser(input: RequestTeamUserInput): ResponseUser\n\tgetOwner(input: TeamInput): ResponseUser\n\tgetPermissionsByRole(input: RequestTeamRoleInput): ResponsePermissions\n\tgetPassportIssuances(input: RequestGetPassportIssuancesInput): ResponseGetPassportIssuances\n\tgetAuditLogs(input: RequestGetAuditLogsInput): ResponseGetAuditLogs\n}"},function(e,t,n){const r=n(1459),o=n(1460),i=n(1461);e.exports=e=>{const t=i(e),n={listBlocklets:[["query_blocklet"],"blocklets",e.listBlocklets],getBlockletMeta:[["query_blocklet"],"meta",e.getBlockletMeta],getBlocklet:[["query_blocklet","manage_blocklet"],"blocklet",e.getBlocklet,[o]],getBlocklets:[["query_blocklet"],"blocklets",e.getBlocklets],getBlockletDiff:[["query_blocklet","manage_blocklet"],"blockletDiff",e.getBlockletDiff,[o]],getLatestBlockletVersion:[["query_blocklet","manage_blocklet"],"data",e.getLatestBlockletVersion,[o]],getBlockletMetaFromUrl:[["query_blocklet"],["meta","isFree","isInstalled","isRunning"],e.getBlockletMetaFromUrl],installBlocklet:[["mutate_blocklet"],"blocklet",e.installBlocklet,[],[t]],installBlockletFromVc:[["mutate_blocklet"],"blocklet",e.installBlockletFromVc,[],[t]],installComponent:[["mutate_blocklet","manage_blocklet"],"blocklet",e.installComponent,[o],[t]],startBlocklet:[["mutate_blocklet","manage_blocklet"],"blocklet",e.startBlocklet,[o],[t]],stopBlocklet:[["mutate_blocklet","manage_blocklet"],"blocklet",e.stopBlocklet,[o],[t]],reloadBlocklet:[["mutate_blocklet","manage_blocklet"],"blocklet",e.reloadBlocklet,[o],[t]],restartBlocklet:[["mutate_blocklet","manage_blocklet"],"blocklet",e.restartBlocklet,[o],[t]],deleteBlocklet:[["mutate_blocklet"],"blocklet",e.deleteBlocklet,[],[t]],deleteComponent:[["mutate_blocklet","manage_blocklet"],"blocklet",e.deleteComponent,[o],[t]],cancelDownloadBlocklet:[["mutate_blocklet","manage_blocklet"],"blocklet",e.cancelDownloadBlocklet,[o],[t]],upgradeBlocklet:[["mutate_blocklet","manage_blocklet"],"blocklet",e.upgradeBlocklet,[o],[t]],configBlocklet:[["mutate_blocklet","manage_blocklet"],"blocklet",e.configBlocklet,[o],[t]],checkChildBlockletsForUpdates:[["mutate_blocklet","manage_blocklet"],"preUpdateInfo",e.checkChildBlockletsForUpdates,[o],[t]],updateChildBlocklets:[["mutate_blocklet","manage_blocklet"],"blocklet",e.updateChildBlocklets,[o],[t]],getNodeInfo:[[],"info",e.getNodeInfo],getNodeEnv:[["query_node"],"info",e.getNodeEnv],updateNodeInfo:[["mutate_node"],"info",e.updateNodeInfo,[],[t]],addBlockletStore:[["mutate_node"],"info",e.addBlockletStore,[],[t]],deleteBlockletStore:[["mutate_node"],"info",e.deleteBlockletStore,[],[t]],selectBlockletStore:[["mutate_node"],"info",e.selectBlockletStore,[],[t]],updateNodeRouting:[["mutate_node"],"info",e.updateNodeRouting,[],[t]],upgradeNodeVersion:[["mutate_node"],"sessionId",e.upgradeNodeVersion,[],[t]],checkNodeVersion:[["query_node"],"version",e.checkNodeVersion],resetNode:[["mutate_node"],"info",e.resetNode],getDelegationState:[[],"state",e.getDelegationState],updateGateway:[["mutate_node"],"gateway",e.updateGateway,[],[t]],getSession:[["query_session"],"session",e.getSession],startSession:[["mutate_session"],"session",e.startSession],updateSession:[["mutate_session"],"session",e.updateSession],endSession:[["mutate_session"],"session",e.endSession],getRoles:[["query_team"],"roles",e.getRoles,[r]],createRole:[["mutate_team"],"role",e.createRole,[r],[t]],updateRole:[["mutate_team"],"role",e.updateRole,[r],[t]],deleteRole:[["mutate_team"],"success",e.deleteRole,[r],[t]],getPermissions:[["query_team"],"permissions",e.getPermissions,[r]],createPermission:[["mutate_team"],"permission",e.createPermission,[r],[t]],updatePermission:[["mutate_team"],"role",e.updatePermission,[r],[t]],deletePermission:[["mutate_team"],"success",e.deletePermission,[r],[t]],grantPermissionForRole:[["mutate_team"],"success",e.grantPermissionForRole,[r],[t]],revokePermissionFromRole:[["mutate_team"],"success",e.revokePermissionFromRole,[r],[t]],updatePermissionsForRole:[["mutate_team"],"role",e.updatePermissionsForRole,[r],[t]],getPermissionsByRole:[["query_team"],"permissions",e.getPermissionsByRole,[r]],hasPermission:[["query_team"],"result",e.hasPermission,[r]],getUsers:[["query_team"],"users",e.getUsers,[r]],getUser:[["query_team"],"user",e.getUser,[r]],getOwner:[["query_team"],"user",e.getOwner,[r]],removeUser:[["mutate_team"],"user",e.removeUser,[r],[t]],updateUserApproval:[["mutate_team"],"user",e.updateUserApproval,[r],[t]],updateUserRole:[["mutate_team"],"user",e.updateUserRole,[r],[t]],getInvitations:[["query_team"],"invitations",e.getInvitations,[r]],createMemberInvitation:[["mutate_team"],"inviteInfo",e.createMemberInvitation,[r],[t]],createTransferInvitation:[["mutate_team"],"inviteInfo",e.createTransferInvitation,[r],[t]],deleteInvitation:[["mutate_team"],"invitation",e.deleteInvitation,[r],[t]],getPassportIssuances:[["query_team"],"list",e.getPassportIssuances,[r]],createPassportIssuance:[["mutate_team"],"info",e.createPassportIssuance,[r],[t]],deletePassportIssuance:[["mutate_team"],"invitation",e.deletePassportIssuance,[r],[t]],revokeUserPassport:[["mutate_team"],"user",e.revokeUserPassport,[r],[t]],enableUserPassport:[["mutate_team"],"user",e.enableUserPassport,[r],[t]],configTrustedPassports:[["mutate_team"],"info",e.configTrustedPassports,[r],[t]],configPassportIssuance:[["mutate_team"],"info",e.configPassportIssuance,[r],[t]],getAccessKeys:[["query_accessKey"],"list",e.getAccessKeys],createAccessKey:[["mutate_accessKey"],"data",e.createAccessKey,[],[t]],deleteAccessKey:[["mutate_accessKey"],"data",e.deleteAccessKey,[],[t]],updateAccessKey:[["mutate_accessKey"],"data",e.updateAccessKey,[],[t]],getRoutingSites:[["query_router"],"sites",e.getRoutingSites],getRoutingProviders:[["query_router"],"providers",e.getRoutingProviders],addRoutingSite:[["mutate_router"],"site",e.addRoutingSite,[],[t]],deleteRoutingSite:[["mutate_router"],"site",e.deleteRoutingSite,[],[t]],updateRoutingSite:[["mutate_router"],"site",e.updateRoutingSite,[],[t]],addRoutingRule:[["mutate_router"],"site",e.addRoutingRule,[],[t]],updateRoutingRule:[["mutate_router"],"site",e.updateRoutingRule,[],[t]],deleteRoutingRule:[["mutate_router"],"site",e.deleteRoutingRule,[],[t]],addDomainAlias:[["mutate_router","manage_blocklet"],"site",e.addDomainAlias,[],[t]],deleteDomainAlias:[["mutate_router"],"site",e.deleteDomainAlias,[],[t]],getServices:[["query_router"],"services",e.getServices],getRoutingSnapshots:[["query_router"],"snapshots",e.getRoutingSnapshots],getSnapshotSites:[["query_router"],"sites",e.getSnapshotSites],takeRoutingSnapshot:[["query_router","manage_blocklet"],"hash",e.takeRoutingSnapshot],checkDomains:[["query_router"],"result",e.checkDomains],findCertificateByDomain:[["query_router","manage_blocklet"],"cert",e.findCertificateByDomain],getCertificates:[["query_router","query_certificate"],"certificates",e.getCertificates],addCertificate:[["mutate_router","mutate_certificate"],"certificate",e.addCertificate,[],[t]],updateCertificate:[["mutate_router","mutate_certificate"],"certificate",e.updateCertificate,[],[t]],deleteCertificate:[["mutate_router","mutate_certificate"],"certificate",e.deleteCertificate,[],[t]],issueLetsEncryptCert:[["mutate_certificate","manage_blocklet"],"certificate",e.issueLetsEncryptCert,[],[t]],getNotifications:[["query_notification"],["list","paging"],e.getNotifications],readNotifications:[["mutate_notification"],"numAffected",e.readNotifications],unreadNotifications:[["mutate_notification"],"numAffected",e.unreadNotifications],getWebHooks:[["query_webhook"],"webhooks",e.getWebHooks],createWebHook:[["mutate_webhook"],"webhook",e.createWebHook,[],[t]],deleteWebHook:[["mutate_webhook"],"data",e.deleteWebHook,[],[t]],getWebhookSenders:[["query_webhook"],"senders",e.getWebhookSenders],sendTestMessage:[["mutate_webhook"],"data",e.sendTestMessage],getAuditLogs:[["query_node"],["list","paging"],e.getAuditLogs]};return Object.freeze(Object.keys(n).reduce((e,t)=>{const[r,o,i,a=[],s=[]]=n[t];return e[t]=(([e,t,n,r=[],o=[],i])=>({permissions:e,dataKeys:t,handler:new Proxy(n,{async apply(e,t,n){for(let e=0;e<r.length;e++)await Reflect.apply(r[e],t,[...n,i]);const a=await Reflect.apply(e,t,n);for(let e=0;e<o.length;e++)Reflect.apply(o[e],t,[...n,i,a]);return a}})}))([r,o,i,a,s,t]),e},{}))}},function(e,t,n){const{NODE_SERVICES:r}=n(25);e.exports=({teamDid:e},t)=>{const{did:n,role:o,blockletDid:i}=t.user;if(o===r.AUTH_SERVICE&&n!==e||"blocklet"===o&&i!==e)throw new Error("You cannot request other blocklet's data")}},function(e,t){e.exports=({did:e,rootDid:t},n)=>{const{role:r,blockletDid:o}=n.user;let i;if(t?i=t:e&&(i=Array.isArray(e)?e[0]:e),"blocklet"===r&&o!==i)throw new Error("You cannot request other blocklet's data")}},function(e,t){e.exports=e=>(t,n,r,o)=>{e.createAuditLog({action:r,args:t,context:n,result:o}).catch(e=>console.error("create audit log error",e))}},function(e,t,n){const{WsServer:r}=n(320),{types:o}=n(28),{fromSecretKey:i,WalletType:a}=n(46),{BlockletEvents:s}=n(100),{EVENTS:l}=n(25),u=n(40)(n(91).name+":ws"),{authWithJwt:p}=n(124),{createStreamLogManager:c,getLogFiles:d}=n(1463);u.debug=()=>null,e.exports=function(e){const t=new r({logger:u,pathname:"/websocket",authenticate:(t,n)=>{const{searchParams:r}=new URL(t.url,"http://"+(t.headers.host||"unknown")),s=r.get("token"),l=r.get("timestamp");s?s&&l?e.getNodeInfo().then(e=>{i(e.sk,a({role:o.RoleType.ROLE_APPLICATION,pk:o.KeyType.ED25519,hash:o.HashType.SHA3})).verify(l,s)?n(null,{did:e.did}):n(new Error("Signature is invalid"),null)}):p(s,e).then(e=>{n(null,{did:e.did})}).catch(()=>{n(new Error("token parse fail"),null)}):n(new Error("token not found"),null)},hooks:{receiveMessage:({socket:e,topic:n,event:r,payload:o})=>{t.emit(`${n}/${r}`,{socket:e,topic:n,event:r,payload:o}),u.info("client pushed socket message",{topic:n,event:r})}}}),n=({event:n,payload:r})=>{if(n){if(Object.values(s).includes(n)&&"function"==typeof e.handleBlockletEvent)return void e.handleBlockletEvent(n,r);if([l.NODE_STARTED,l.NODE_STOPPED].includes(n)&&"function"==typeof e.handleServerEvent)return void e.handleServerEvent(n,r);t.broadcast(n,r)}};t.on("cli/blocklet.deployed",n),t.on("cli/blocklet.statusChange",n),t.on("cli/blocklet.started",n),t.on("cli/blocklet.removed",n),t.on("cli/blocklet.updated",n),t.on("cli/routing.updated",n),t.on("cli/node.stopped",n),t.on("cli/node.started",n),t.on("cli/node.upgrading",n);const f=c({onGetLogFiles:t=>d({name:t,node:e}),onLog:({topic:e,level:n,logFiles:r,data:o})=>{t.broadcast(e,e,{level:n,logFiles:r,data:o},{enableLog:!1})}}),h=e.getSysInfoEmitter(5e3);h.on("info",e=>{t.broadcast("system.info","system.info",e,{enableLog:!1})});return["channel.join","channel.leave","channel.destroy"].forEach(n=>{t.on(n,r=>(async(n,{socket:r,topic:o})=>{const[i,...a]=o.split(".");if("log"===i){const e=a.join(".");"channel.join"===n&&f.add(e,o,(e,n,i)=>{t.send(r,o,o,{level:e,data:n,logFiles:i},{enableLog:!1})}),"channel.destroy"===n&&f.destroy(e)}"system"===i&&("channel.join"===n&&(h.startPolling(),u.info("start system info polling"),e.getSysInfo().then(e=>{t.send(r,o,o,e,{enableLog:!1})})),"channel.destroy"===n&&(u.info("stop system info polling"),h.stopPolling()))})(n,r))}),e.setEventHandler(({name:e,data:n})=>{if("blocklet.removed"===e)try{const{did:e}=n.meta,t="blocklet-"+e;u.info("destroy blocklet log stream",{name:t}),f.destroy(t)}catch(e){u.error("destroy blocklet log stream error",{error:e})}e&&t.broadcast(e,n)}),t}},function(e,t,n){const r=["recent"];function o(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}const i=n(9),a=n(17),s=n(169),{Tail:l}=n(1464),u=n(1465),{BLOCKLET_MODES:p}=n(100),c=n(40)(n(91).name);class d{constructor(){this._files=null,this._tails=null}async setFiles(e){return!s(this._files,e)&&(this.clearTails(),this._files=e,!0)}getRecent(e,t){this._files||t(new Error("files is empty")),Object.entries(this._files).forEach(([n,r])=>{r&&a.existsSync(r)&&u.read(r,e||0).then(e=>{t(null,n,e)}).catch(e=>{t(e,n)})})}ensureTails(){if(this._tails)return this._tails;if(!this._files)return{};try{return this._tails={},Object.entries(this._files).forEach(([e,t])=>{t&&a.existsSync(t)&&(this._tails[e]=new l(t))}),this._tails}catch(e){throw this._tails=null,e}}clearTails(){this._tails&&(Object.values(this._tails).forEach(e=>{e.unwatch()}),this._tails=null)}}const f=e=>{Object.values(e).forEach(e=>{if(!a.existsSync(e)){try{const t=i.dirname(e);a.mkdirSync(t,{recursive:!0})}catch(e){}a.writeFileSync(e,"","utf8")}})};e.exports={createStreamLogManager:({onLog:e,onGetLogFiles:t})=>{const n={},i=e=>{if(c.info("log stream: destroy",{name:e}),!n[e])return;const t=n[e];try{t.clearTails(),delete n[e]}catch(t){c.error("log stream: remove ref error ",t),delete n[e]}};return{add:async(a,s,l)=>{c.info("log stream: add",{name:a});const u=(e=>(n[e]||(n[e]=new d),n[e]))(a);try{const n=await t(a),{recent:p=100}=n,d=o(n,r),f=await u.setFiles(d);if(c.info("log stream: added",{name:a,logFiles:d}),u.getRecent(p,(e,t,n)=>{e&&c.error("log stream error ",e),l&&l(t,n,d)}),f){const t=u.ensureTails();Object.entries(t).forEach(([t,n])=>{n.on("line",n=>{e({topic:s,level:t,logFiles:d,data:n})}),n.on("error",e=>{c.error("log tail error ",{error:e}),i(a)})})}}catch(e){c.error("log stream error ",e)}},destroy:i}},getLogFiles:async({name:e,node:t})=>{const n=new Date,{yyyy:r,mm:o,dd:a}={yyyy:n.getFullYear(),mm:(""+(n.getMonth()+1)).padStart(2,0),dd:(""+n.getDate()).padStart(2,0)},s=`${r}-${o}-${a}`;if("abtnode"===e){const e=i.join(t.dataDirs.logs,"_abtnode"),n=i.join(e,`daemon-${s}.log`),r=i.join(e,`daemon-error-${s}.log`),o=i.join(e,"access.log"),a=i.join(e,"daemon.stdout.log"),l=i.join(e,"daemon.stderr.log");return f({info:n,error:r,access:o,stdout:a,stderr:l}),{info:n,error:r,access:o,stdout:a,stderr:l}}if("blocklet-services"===e){const e=i.join(t.dataDirs.logs,"_abtnode"),n=i.join(e,"service.log"),r=i.join(e,"service.error.log");return f({info:n,error:r}),{info:n,error:r}}if(0===e.indexOf("blocklet-")){const n=e.substring("blocklet-".length),r=await t.getBlocklet({did:n,attachConfig:!1}),{name:o}=r.meta,a=i.join(t.dataDirs.logs,o),l=i.join(a,`info-${s}.log`),u=i.join(a,`info-error-${s}.log`),c=i.join(a,"access.log"),d=i.join(a,"output.log"),h=i.join(a,"error.log");return f({info:l,error:u,access:c,stdout:d,stderr:h}),{info:l,error:u,access:c,stdout:d,stderr:h,recent:r.mode===p.DEVELOPMENT?0:100}}if(e.startsWith("service-gateway-")){const n=e.substring("service-gateway-".length),r=t.getRouterProvider(n);return r?r.getLogFilesForToday(i.join(t.dataDirs.router,n)):(c.error("router engine is empty",{name:e,providerName:n}),{})}return{}}}},function(e,t,n){let r=n(24),o=n(17),i=n(9);class a{info(){}error(){}}class s extends r.EventEmitter{constructor(e,t={}){super(),this.filename=e,this.absPath=i.dirname(this.filename),this.separator=void 0!==t.separator?t.separator:/[\r]{0,1}\n/,this.fsWatchOptions=t.fsWatchOptions||{},this.follow=null==t.follow||t.follow,this.logger=t.logger||new a,this.useWatchFile=t.useWatchFile||!1,this.flushAtEOF=t.flushAtEOF||!1,this.encoding=t.encoding||"utf-8";const n=t.fromBeginning||!1;this.nLines=t.nLines||void 0,this.logger.info("Tail starting..."),this.logger.info("filename: "+this.filename),this.logger.info("encoding: "+this.encoding);try{o.accessSync(this.filename,o.constants.F_OK)}catch(e){if("ENOENT"==e.code)throw e}let s;if(this.buffer="",this.internalDispatcher=new r.EventEmitter,this.queue=[],this.isWatching=!1,this.pos=0,this.internalDispatcher.on("next",()=>{this.readBlock()}),this.logger.info("fromBeginning: "+n),n)s=0;else if(void 0!==this.nLines){const e=o.readFileSync(this.filename,{flag:"r",encoding:this.encoding}),t=e.split(this.separator),n=""===t[t.length-1]?1:0;if(t.length-this.nLines-n<=0)s=0;else{const r=e.match(new RegExp(`(?:[^\r\n]*[\r]{0,1}\n){${t.length-this.nLines-n}}`));s=r&&r.length?Buffer.byteLength(r[0],this.encoding):this.latestPosition()}}else s=this.latestPosition();if(void 0===s)throw new Error("Tail can't initialize.");const l=n||null!=this.nLines;try{this.watch(s,l)}catch(e){this.logger.error(`watch for ${this.filename} failed: ${e}`),this.emit("error",`watch for ${this.filename} failed: ${e}`)}}latestPosition(){try{return o.statSync(this.filename).size}catch(e){throw this.logger.error(`size check for ${this.filename} failed: ${e}`),this.emit("error",`size check for ${this.filename} failed: ${e}`),e}}readBlock(){if(this.queue.length>=1){const e=this.queue[0];if(e.end>e.start){let t=o.createReadStream(this.filename,{start:e.start,end:e.end-1,encoding:this.encoding});t.on("error",e=>{this.logger.error("Tail error: "+e),this.emit("error",e)}),t.on("end",()=>{this.queue.shift();this.queue.length>0&&this.internalDispatcher.emit("next"),this.flushAtEOF&&this.buffer.length>0&&(this.emit("line",this.buffer),this.buffer="")}),t.on("data",e=>{if(null===this.separator)this.emit("line",e);else{this.buffer+=e;let t=this.buffer.split(this.separator);this.buffer=t.pop();for(const e of t)this.emit("line",e)}})}}}change(){let e=this.latestPosition();e<this.currentCursorPos?this.currentCursorPos=e:e>this.currentCursorPos&&(this.queue.push({start:this.currentCursorPos,end:e}),this.currentCursorPos=e,1==this.queue.length&&this.internalDispatcher.emit("next"))}watch(e,t){this.isWatching||(this.logger.info("filesystem.watch present? "+(null!=o.watch)),this.logger.info("useWatchFile: "+this.useWatchFile),this.isWatching=!0,this.currentCursorPos=e,t&&this.change(),!this.useWatchFile&&o.watch?(this.logger.info("watch strategy: watch"),this.watcher=o.watch(this.filename,this.fsWatchOptions,(e,t)=>{this.watchEvent(e,t)})):(this.logger.info("watch strategy: watchFile"),o.watchFile(this.filename,this.fsWatchOptions,(e,t)=>{this.watchFileEvent(e,t)})))}rename(e){void 0!==e&&e===this.filename||(this.unwatch(),this.follow?(this.filename=i.join(this.absPath,e),this.rewatchId=setTimeout(()=>{try{this.watch(this.currentCursorPos)}catch(e){this.logger.error(`'rename' event for ${this.filename}. File not available anymore.`),this.emit("error",e)}},1e3)):(this.logger.error(`'rename' event for ${this.filename}. File not available anymore.`),this.emit("error",`'rename' event for ${this.filename}. File not available anymore.`)))}watchEvent(e,t){try{"change"===e?this.change():"rename"===e&&this.rename(t)}catch(e){this.logger.error(`watchEvent for ${this.filename} failed: ${e}`),this.emit("error",`watchEvent for ${this.filename} failed: ${e}`)}}watchFileEvent(e,t){e.size>t.size&&(this.currentCursorPos=e.size,this.queue.push({start:t.size,end:e.size}),1==this.queue.length&&this.internalDispatcher.emit("next"))}unwatch(){this.watcher?this.watcher.close():o.unwatchFile(this.filename),this.rewatchId&&(clearTimeout(this.rewatchId),this.rewatchId=void 0),this.isWatching=!1,this.queue=[],this.logger&&this.logger.info("Unwatch "+this.filename)}}t.Tail=s},function(e,t,n){"use strict";var r=n(1466);e.exports={read:function(e,t,n){var o=["\n"];null==n&&(n="utf8");return new Promise((function(i,a){var s={stat:null,file:null};r.exists(e).then((function(e){if(!e)throw new Error("file does not exist")})).then((function(){var t=[r.stat(e).then((function(e){return s.stat=e})),r.open(e,"r").then((function(e){return s.file=e}))];return Promise.all(t)})).then((function(){var e=0,a=0,l="",u=function(){return l.length>s.stat.size&&(l=l.substring(l.length-s.stat.size)),l.length>=s.stat.size||a>=t?(o.includes(l.substring(0,1))&&(l=l.substring(1)),r.close(s.file),i("buffer"===n?Buffer.from(l,"binary"):Buffer.from(l,"binary").toString(n))):function(e,t,n){return r.read(t,Buffer.alloc(1),0,1,e.size-1-n).then((function(e){return String.fromCharCode(e[1][0])}))}(s.stat,s.file,e).then((function(t){l=t+l,o.includes(t)&&1<l.length&&a++,e++})).then(u)};return u()})).catch((function(e){return null!==s.file&&r.close(s.file).catch((function(){})),a(e)}))}))}}},function(e,t,n){var r,o=n(724);try{r=n(48)}catch(e){r=n(17)}var i=["appendFile","chmod","chown","close","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","link","lstat","mkdir","open","read","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","write","writeFile"];"function"==typeof r.access&&i.push("access"),"function"==typeof r.copyFile&&i.push("copyFile"),"function"==typeof r.mkdtemp&&i.push("mkdtemp"),n(1470).withCallback(r,t,i),t.exists=function(e,t){return"function"==typeof t?r.stat(e,(function(e){t(null,!e)})):new o((function(t){r.stat(e,(function(e){t(!e)}))}))}},function(e,t,n){"use strict";function r(e){var t=null;if(function(e){if(e)return"global.Promise"===e;if(void 0!==global.Promise){var t=/v(\d+)\.(\d+)\.(\d+)/.exec(process.version);return!(t&&0==+t[1]&&+t[2]<12)}return!1}(e))t={Promise:global.Promise,implementation:"global.Promise"};else if(e){var o=n(1469)(e);t={Promise:o.Promise||o,implementation:e}}else t=function(){for(var e=["es6-promise","promise","native-promise-only","bluebird","rsvp","when","q","pinkie","lie","vow"],t=0,n=e.length;t<n;t++)try{return r(e[t])}catch(e){}return null}();if(null===t)throw new Error('Cannot find any-promise implementation nor global.Promise. You must install polyfill or call require("any-promise/register") with your preferred implementation, e.g. require("any-promise/register/bluebird") on application load prior to any require("any-promise").');return t}e.exports=n(1468)(global,r)},function(e,t,n){"use strict";var r=null;e.exports=function(e,t){return function(n,o){n=n||null;var i=!1!==(o=o||{}).global;if(null===r&&i&&(r=e["@@any-promise/REGISTRATION"]||null),null!==r&&null!==n&&r.implementation!==n)throw new Error('any-promise already defined as "'+r.implementation+'". You can only register an implementation before the first call to require("any-promise") and an implementation cannot be changed');return null===r&&(r=null!==n&&void 0!==o.Promise?{Promise:o.Promise,implementation:n}:t(n),i&&(e["@@any-promise/REGISTRATION"]=r)),r}}},function(e,t){function n(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}n.keys=function(){return[]},n.resolve=n,e.exports=n,n.id=1469},function(e,t,n){var r=n(1471);function o(e,t,n){return i(e,t,n,r)}function i(e,t,n,r){return t||(t={},n=Object.keys(e)),Array.isArray(t)&&(n=t,t={}),n||(n=Object.keys(e)),"function"==typeof e&&(t=r(e)),n.forEach((function(n){"function"==typeof e[n]&&(t[n]=r(e[n]))})),Object.keys(e).forEach((function(n){(function(e,t){var n=Object.getOwnPropertyDescriptor(e,t);return!(!n||!n.get)&&"deprecated"===n.get.name})(e,n)||t[n]||(t[n]=e[n])})),t}e.exports=o,o.withCallback=function(e,t,n){return i(e,t,n,r.withCallback)},o.thenify=r},function(e,t,n){var r=n(724),o=n(116);function i(e,t){return o("function"==typeof e),s(e,t)}function a(e,t,n){return void 0===n&&(n=!0),function(r,o){if(r)return t(r);var i=arguments.length;if(i<=2||!n)return e(o);if(Array.isArray(n)){for(var a={},s=1;s<i;s++)a[n[s-1]]=arguments[s];return e(a)}for(a=new Array(i-1),s=1;s<i;++s)a[s-1]=arguments[s];e(a)}}function s(e,t){t=t||{};var n=e.name;n=(n||"").replace(/\s|bound(?!$)/g,"");var o=function(){var n=this,o=arguments.length;if(t.withCallback){var i=typeof arguments[o-1];if("function"===i)return e.apply(n,arguments)}for(var s=new Array(o+1),l=0;l<o;++l)s[l]=arguments[l];var u=l;return new r((function(r,o){s[u]=a(r,o,t.multiArgs),e.apply(n,s)}))};return Object.defineProperty(o,"name",{value:n}),o}e.exports=i,i.withCallback=function(e,t){return o("function"==typeof e),(t=t||{}).withCallback=!0,s(e,t)}},function(e,t,n){function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const{messages:o}=n(44),{authenticateByVc:i,getAuthVcClaim:a}=n(125),s=n(87),l=n(40)(n(91).name),{createSessionToken:u}=n(124);e.exports=function(e){return{action:"login",onConnect:async({userDid:t,extraParams:n})=>{const{locale:r}=n;if(!1===await e.isInitialized())throw new Error(o.notInitialized[r]);const i=await e.getNodeInfo();if(!await e.getUser({teamDid:i.did,user:{did:t}}))throw new Error(o.notAllowed[r]);return{verifiableCredential:a(e)}},onAuth:async({claims:t,challenge:n,userDid:o,userPk:a,updateSession:p,extraParams:c,req:d})=>{const{locale:f}=c,{role:h,teamDid:g,passport:m}=await i({node:e,locale:f,userDid:o,claims:t,challenge:n});try{const t=await e.updateUser({teamDid:g,user:{did:o,pk:a,locale:f,lastLoginAt:(new Date).toISOString()}});await e.createAuditLog({action:"login",args:{teamDid:g,userDid:o,passport:m},context:s(r(d,{user:t})),result:t},e);const n=await u(o,{passport:m,role:h});await p({sessionToken:n},!0),l.info("login.success",{userDid:o})}catch(e){throw l.error("login.error",{error:e,userDid:o}),new Error(e.message)}}}}},function(e,t,n){function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{messages:s}=n(44),l=n(87);e.exports=function(e){return{action:"switch-profile",onConnect:async({userDid:t,extraParams:{locale:n,connectedDid:r}})=>{if(t&&r&&t!==r)throw new Error(s.userMismatch[n]);const o=await e.getNodeInfo(),i=await e.getUser({teamDid:o.did,user:{did:t}});if(!i)throw new Error(s.notAllowed[n]);if(!i.approved)throw new Error(s.notAuthorized[n]);return{profile:{fields:["fullName","email","avatar"],description:s.requestProfile[n]}}},onAuth:async({claims:t,userDid:n,extraParams:{locale:o},req:a})=>{const u=await e.getNodeInfo(),p=await e.getUser({teamDid:u.did,user:{did:n}});if(!p)throw new Error(s.notAllowed[o]);if(!p.approved)throw new Error(s.notAuthorized[o]);const c=t.find(e=>"profile"===e.type),d=await e.updateUser({teamDid:u.did,user:i(i(i({},p),c),{},{locale:o})});await e.createAuditLog({action:"switchProfile",args:{teamDid:u.did,userDid:n,profile:c},context:l(r(a,{user:p})),result:d},e)}}}},function(e,t,n){function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const{messages:o}=n(44),{getAuthVcClaim:i,authenticateByVc:a}=n(125),s=n(87),{createSessionToken:l}=n(124);e.exports=function(e){return{action:"switch-passport",onConnect:async({userDid:t,extraParams:{locale:n,connectedDid:r}})=>{if(t&&r&&t!==r)throw new Error(o.userMismatch[n]);const a=await e.getNodeInfo(),s=await e.getUser({teamDid:a.did,user:{did:t}});if(!s)throw new Error(o.notAllowed[n]);if(!s.approved)throw new Error(o.notAuthorized[n]);return{verifiableCredential:i(e)}},onAuth:async({claims:t,challenge:n,userDid:o,updateSession:i,extraParams:u,req:p})=>{const{locale:c}=u,{role:d,passport:f}=await a({node:e,locale:c,userDid:o,claims:t,challenge:n}),h=await e.getNodeInfo(),g=await e.getUser({teamDid:h.did,user:{did:o}});await e.createAuditLog({action:"switchPassport",args:{teamDid:h.did,userDid:o,passport:f},context:s(r(p,{user:g})),result:{}},e);const m=await l(o,{passport:f,role:d});await i({sessionToken:m},!0)}}}},function(e,t,n){function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{ROLES:s,VC_TYPE_NODE_PASSPORT:l}=n(25),u=n(361),p=n(725),c=n(87),{createPassport:d,createPassportVC:f,createUserPassport:h}=n(147),g=n(235),m=n(346),{messages:y,checkWalletVersion:v,getPassportStatusEndpoint:b}=n(44),_=n(40)(n(91).name),{createSessionToken:T}=n(124);e.exports=function(e){return{action:"connect-owner",onConnect:()=>({profile:async({extraParams:{locale:t}})=>{const n=await e.getNodeInfo();if(n.ownerNft&&n.ownerNft.holder&&n.ownerNft.issuer)throw new Error(y.requestOwnershipNft[t]);return{fields:["fullName","email","avatar"],description:y.requestProfile[t]}},signature:async({extraParams:{locale:t},context:{didwallet:n}})=>{v({didwallet:n,locale:t});const r=await e.getNodeInfo(),o=await d({name:s.OWNER,node:e,teamDid:r.did,locale:t}),i=r.name;return{description:y.receivePassport[t],data:p(),type:"mime:text/plain",display:JSON.stringify({type:"svg",content:g({title:o.title,issuer:i,issuerDid:r.did,ownerName:"Your Name",preferredColor:"default"})})}}}),onAuth:async({claims:t,userDid:n,userPk:o,updateSession:a,extraParams:{locale:p},req:g,baseUrl:y})=>{const v=t.find(e=>"profile"===e.type),E=await e.getNodeInfo(),S=E.did,x=t.find(e=>"signature"===e.type);_.info("claim.signature.onAuth",{userPk:o,userDid:n,claim:x}),m(x,n,o,p),await e.updateNodeOwner({nodeOwner:{did:n,pk:o}}),_.info("connect owner to node",{userDid:n});const w=f({issuerName:E.name,issuerWallet:u(E.sk),ownerDid:n,passport:await d({name:s.OWNER,node:e,teamDid:S,locale:p,endpoint:y}),endpoint:b({baseUrl:y,userDid:n,teamDid:S}),types:[l],tag:E.did,ownerProfile:v}),A=s.OWNER,k=h(w,{role:A}),M=await e.addUser({teamDid:S,user:i(i({},v),{},{did:n,pk:o,passports:[k],approved:!0,locale:p,firstLoginAt:(new Date).toISOString(),lastLoginAt:(new Date).toISOString()})});await e.createAuditLog({action:"addUser",args:{teamDid:S,userDid:n,reason:"claim server"},context:c(r(g,{user:M})),result:M},e);const O=await T(n,{passport:k,role:A});return await a({sessionToken:O},!0),{disposition:"attachment",type:"VerifiableCredential",data:w}}}}},function(e,t,n){const{messages:r}=n(44),{onAddNodeOwnerAuth:o,getProfileClaim:i,getAssetProfile:a}=n(726);e.exports=function(e){return{action:"verify-owner",onConnect:()=>({asset:a(e),profile:async({extraParams:{locale:t}})=>{if(await e.isInitialized())throw new Error(r.alreadyInitiated[t]);return i(t)}}),onAuth:async({claims:t,userDid:n,userPk:i,challenge:a,updateSession:s,extraParams:{locale:l},req:u,baseUrl:p})=>{if(await e.isInitialized())throw new Error(r.alreadyInitiated[l]);return o({node:e,req:u,claims:t,userDid:n,userPk:i,challenge:a,updateSession:s,locale:l,baseUrl:p})}}}},function(e,t,n){const{onAddNodeOwnerAuth:r,getProfileClaim:o,getAssetProfile:i}=n(726);e.exports=function(e){return{action:"accept-server",onConnect:()=>({asset:i(e),profile:({extraParams:{locale:e}})=>o(e)}),onAuth:async({claims:t,userDid:n,userPk:o,challenge:i,updateSession:a,extraParams:{locale:s},req:l,baseUrl:u})=>r({action:"accept-server",node:e,req:l,claims:t,userDid:n,userPk:o,challenge:i,locale:s,baseUrl:u,updateSession:a})}}},function(e,t,n){function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const a=n(27),{isFreeBlocklet:s}=n(104),{BlockletEvents:l}=n(100),{VC_TYPE_BLOCKLET_PURCHASE:u}=n(25),{messages:p,getVCFromClaims:c}=n(44),d=n(40)(n(91).name),{getBlockletUrl:f}=n(1479),h=o(o({},p),{},{requestCredential:{en:"Please provide blocklet purchase NFT",zh:"请提供 Blocklet 购买凭证 NFT"},missingCredentialClaim:{en:"Blocklet purchase NFT not provided",zh:"请提供 Blocklet 购买凭证 NFT"},missingChallenge:{en:"Purchase NFT presentation does not include valid challenge",zh:"购买 NFT 中缺少正确的随机因子"},invalidCredentialType:{en:"Invalid blocklet purchase NFT type, expect "+u,zh:"无效的 Blocklet 购买凭证 NFT 类型,必须是 "+u},blockletDidNotMatch:{en:"This NFT is for another blocklet",zh:"购买凭证和要安装的 Blocklet 不匹配"},invalidCredentialProof:{en:"Invalid blocklet purchase NFT signature proof",zh:"无效的购买凭证签名"},purchaseNotRequired:{en:"This blocklet is free and does not require any purchase",zh:"该 Blocklet 可免费安装,不需要购买"},alreadyInstalled:{en:"This blocklet is already installed on this server",zh:"该 Blocklet 已经安装,不需要购买"},rootBlockletNotInstalled:{en:"The blocklet cannot be mounted to a blocklet that is not installed",zh:"该 Blocklet 无法挂载到未安装的 Blocklet"},sessionNotFound:{en:"Purchase session not found",zh:"购买会话不存在"}}),g=e=>[e],m=[u];e.exports=function(e){const{node:t}=e.states;return{action:"verify-purchase",claims:{verifiableCredential:async({extraParams:{locale:t,sid:n}})=>{const r=await e.getSession({id:n});if(!r)throw new Error(h.sessionNotFound[t]);let o,i,a;if("component"===r.type){let n;if([n,i,a]=await Promise.all([e.getBlocklet({did:r.rootDid,attachConfig:!1}),e.getBlockletMetaFromUrl({url:r.url}),e.getRegistryMeta(new URL(r.url).origin)]),!n)throw new Error(h.rootBlockletNotInstalled[t]);o=n.children.find(e=>e.meta.did===i.meta.did)}else[o,i,a]=await Promise.all([e.getBlocklet({did:r.blockletDid,attachConfig:!1}),e.getBlockletMetaFromUrl({url:f(r.registryUrl,r.blockletDid)}),e.getRegistryMeta(r.registryUrl)]);if(o)throw new Error(h.alreadyInstalled[t]);if(!0===s(i.meta))throw new Error(h.purchaseNotRequired[t]);return{description:h.requestCredential[t],item:m,trustedIssuers:g(a.id),tag:i.meta.did}}},onError:async({err:n,extraParams:{sid:r}})=>{const o=await e.updateSession({id:r,data:{status:"error",message:n.message}});t.emit(l.purchaseChange,{did:o.blockletDid,session:o}),d.error("emit blocklet purchase error event",o)},onDecline:async({extraParams:{sid:n}})=>{const r=await e.updateSession({id:n,data:{status:"declined"}});t.emit(l.purchaseChange,{did:r.blockletDid,session:r}),d.info("emit blocklet purchase decline event",r)},onAuth:async({userDid:n,claims:r,challenge:o,extraParams:{sid:i,locale:s}})=>{const u=await e.getSession({id:i});if(!u)throw new Error(h.sessionNotFound[s]);let p;p="component"===u.type?await e.getRegistryMeta(new URL(u.url).origin):await e.getRegistryMeta(u.registryUrl);const f=g(p.id),{vc:y}=await c({claims:r,challenge:o,trustedIssuers:f,vcTypes:m,locale:s});if(!y)throw new Error(h.missingCredentialClaim[s]);const v=a(y,"credentialSubject.purchased.blocklet")||a(y,"credentialSubject.purchased.blocklets");if(!(Array.isArray(v)?v:[v]).find(e=>e.id===u.blockletDid))throw new Error(h.blockletDidNotMatch[s]);const b=await e.updateSession({id:i,data:{status:"confirmed"}});t.emit(l.purchaseChange,{did:u.blockletDid,session:b}),d.info("emit blocklet purchase confirm event",b);const _={user:{did:n},blockletPurchaseVerified:!0};let T,E;if("component"===u.type){T=e.installComponent.bind(e);const{rootDid:t,mountPoint:n,url:r,name:o,did:i,title:a}=u;E={rootDid:t,mountPoint:n,url:r,name:o,did:i,title:a}}else T=e.installBlocklet.bind(e),E={did:u.blockletDid};T(E,_).then(()=>{d.info("install blocklet after verify purchase nft",u)}).catch(e=>{d.error("install blocklet after verify purchase nft failed",{session:u,err:e})})}}}},function(e,t,n){const r=n(112);e.exports={getBlockletUrl:(e,t)=>r(e,`/api/blocklets/${t}/blocklet.json`)}},function(e,t,n){const{createIssuePassportRequest:r,handleIssuePassportResponse:o,checkWalletVersion:i,beforeIssuePassportRequest:a}=n(44);e.exports=function(e){return{action:"issue-passport",onStart:async({extraParams:t})=>{const{locale:n="en",id:r}=t,o=(await e.getNodeInfo()).did;await a({node:e,teamDid:o,locale:n,id:r})},claims:{signature:async({extraParams:t,context:{didwallet:n}})=>{const{id:o,locale:a}=t;i({didwallet:n,locale:a});const s=await e.getNodeInfo(),l=s.did;return r({node:e,nodeInfo:s,teamDid:l,id:o,locale:a})}},onAuth:async({userDid:t,userPk:n,claims:r,extraParams:i,updateSession:a,req:s,baseUrl:l})=>{const{locale:u,id:p}=i,c=await e.getNodeInfo(),d=c.did;return o({req:s,node:e,nodeInfo:c,teamDid:d,userDid:t,userPk:n,id:p,locale:u,claims:r,statusEndpointBaseUrl:l,updateSession:a,endpoint:l})}}}},function(e,t,n){const{createLostPassportListRoute:r}=n(727);e.exports=function(e){return r({node:e,type:"node"})}},function(e,t,n){const{createLostPassportIssueRoute:r,TEAM_TYPES:o}=n(727);e.exports=function(e){return r({node:e,type:o.NODE})}},function(e,t,n){const{createInvitationRequest:r,handleInvitationResponse:o,messages:i,checkWalletVersion:a,beforeInvitationRequest:s}=n(44),{get:l}=n(1484),u=n(40)(n(91).name),{createSessionToken:p}=n(124);e.exports=function(e){return{action:"invite",onStart:async({extraParams:t})=>{const{locale:n="en",inviteId:r}=t,o=(await e.getNodeInfo()).did;await s({node:e,teamDid:o,locale:n,inviteId:r})},claims:{profile:async({userDid:t,extraParams:n})=>{const r=await e.getNodeInfo(),{locale:o,inviteId:a}=n;if("owner"===(await e.getInvitation({teamDid:r.did,inviteId:a})).role&&t===r.nodeOwner.did)throw new Error(i.notAllowedTransferToSelf[o]);if(!1===await e.isInitialized())throw new Error(i.notInitialized[o]);return{fields:["fullName","email","avatar"],description:i.description[o]}},signature:async({extraParams:t,context:{didwallet:n}})=>{const{locale:o,inviteId:i}=t;a({didwallet:n,locale:o});const s=await e.getNodeInfo(),l=s.did;return r({node:e,nodeInfo:s,teamDid:l,inviteId:i,locale:o})}},onAuth:async({claims:t,userDid:n,userPk:r,updateSession:i,extraParams:a,req:s,baseUrl:c})=>{const{locale:d,inviteId:f,previousWorkflowData:h}=a,g=await e.getNodeInfo(),m=g.did,y=c,v=c,{passport:b,response:_,role:T}=await o({req:s,node:e,nodeInfo:g,teamDid:m,userDid:n,userPk:r,inviteId:f,locale:d,claims:t,statusEndpointBaseUrl:y,endpoint:v,newNftOwner:l(h,"userDid")}),E=await p(n,{passport:b,role:T});return await i({sessionToken:E},!0),await i({passportId:_.data.id}),u.info("invite.success",{userDid:n}),_}}}},function(e,t,n){(function(e){var r;
|
|
721
|
+
*/var r=n(1454);function o(e){if(!Object.prototype.hasOwnProperty.call(i.message,e))throw new Error("invalid status code: "+e);return i.message[e]}function i(e){if("number"==typeof e)return o(e);if("string"!=typeof e)throw new TypeError("code must be a number or string");var t=parseInt(e,10);return isNaN(t)?function(e){var t=e.toLowerCase();if(!Object.prototype.hasOwnProperty.call(i.code,t))throw new Error('invalid status message: "'+e+'"');return i.code[t]}(e):o(t)}e.exports=i,i.message=r,i.code=function(e){var t={};return Object.keys(e).forEach((function(n){var r=e[n],o=Number(n);t[r.toLowerCase()]=o})),t}(r),i.codes=function(e){return Object.keys(e).map((function(e){return Number(e)}))}(r),i.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0},i.empty={204:!0,205:!0,304:!0},i.retry={502:!0,503:!0,504:!0}},function(e){e.exports=JSON.parse('{"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I\'m a Teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Too Early","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"}')},function(e,t){e.exports=require("async_hooks")},function(e,t){e.exports={renderGraphiQL:()=>"GraphiQL disabled"}},function(e,t){e.exports="# Code generated by protoc-gen-gogql. DO NOT EDIT\n# source: service.proto\n\nscalar Any\n\nscalar Float32\n\nscalar Int32\n\nscalar Int64\n\nscalar Uint32\n\ninput BlockletRegistryInput {\n\tname: String \n\tdescription: String \n\turl: String \n\tlogoUrl: String \n\tmaintainer: String \n\tcdnUrl: String \n\tselected: Boolean \n\tprotected: Boolean \n\tid: String \n}\n\ninput BlockletServiceInput {\n\tname: String \n\tdescription: String \n\tversion: String \n\tconfig: String \n\tschema: String \n}\n\ninput BlockletStateInterfaceInput {\n\truleId: String \n\ttype: String \n\tname: String \n\turl: String \n}\n\ninput ConfigEntryInput {\n\tkey: String \n\tvalue: String \n\trequired: Boolean \n\tdescription: String \n\tvalidation: String \n\tsecure: Boolean \n\tcustom: Boolean \n}\n\ninput HashFileInput {\n\tfile: String \n\thash: String \n}\n\ninput IssuerInput {\n\tid: String \n\tname: String \n\tpk: String \n}\n\ninput MemberInfoInput {\n\tdid: String \n\tpk: String \n\trole: String \n\tavatar: String \n\tfullName: String \n\temail: String \n\tapproved: Boolean \n\tcreatedAt: String \n\tupdatedAt: String \n\tlocale: String \n\tpassports: [PassportInput!] \n\tfirstLoginAt: String \n\tlastLoginAt: String \n\tremark: String \n}\n\ninput NodeInfoInput {\n\tname: String \n\tdescription: String \n\tautoUpgrade: Boolean \n\tenableWelcomePage: Boolean \n\tregisterUrl: String \n\twebWalletUrl: String \n\tblockletRegistryList: [BlockletRegistryInput!] \n\tdiskAlertThreshold: Uint32 \n}\n\ninput PagingInput {\n\ttotal: Uint32 \n\tpageSize: Uint32 \n\tpageCount: Uint32 \n\tpage: Uint32 \n}\n\ninput PassportInput {\n\tid: String \n\tname: String \n\ttitle: String \n\tissuer: IssuerInput \n\ttype: [String!] \n\tissuanceDate: String \n\texpirationDate: String \n\tstatus: String \n\trole: String \n}\n\ninput PermissionInput {\n\tname: String \n\tdescription: String \n\tisProtected: Boolean \n}\n\ninput RequestAddDomainAliasInput {\n\tid: String \n\tdomainAlias: String \n\tforce: Boolean \n}\n\ninput RequestAddLetsEcryptCertInput {\n\tdomain: String \n}\n\ninput RequestAddNginxHttpsCertInput {\n\tname: String \n\tprivateKey: String \n\tcertificate: String \n}\n\ninput RequestAddRoutingRuleInput {\n\tid: String \n\trule: RoutingRuleInput \n}\n\ninput RequestAddRoutingSiteInput {\n\tdomain: String \n\ttype: String \n\trules: [RoutingRuleInput!] \n}\n\ninput RequestBlockletInput {\n\tdid: String \n\tregistryUrl: String \n\tattachRuntimeInfo: Boolean \n}\n\ninput RequestBlockletDiffInput {\n\tdid: String \n\thashFiles: [HashFileInput!] \n\trootDid: String \n}\n\ninput RequestBlockletMetaFromUrlInput {\n\turl: String \n\tcheckPrice: Boolean \n}\n\ninput RequestChangeBlockletStoreInput {\n\turl: String \n}\n\ninput RequestCheckDomainsInput {\n\tdomains: [String!] \n}\n\ninput RequestConfigBlockletInput {\n\tdid: [String!] \n\tconfigs: [ConfigEntryInput!] \n}\n\ninput RequestConfigPassportIssuanceInput {\n\tteamDid: String \n\tenable: Boolean \n}\n\ninput RequestConfigTrustedPassportsInput {\n\tteamDid: String \n\ttrustedPassports: [TrustedPassportInput!] \n}\n\ninput RequestCreateAccessKeyInput {\n\tremark: String \n\tpassport: String \n}\n\ninput RequestCreatePassportIssuanceInput {\n\tteamDid: String \n\townerDid: String \n\tname: String \n}\n\ninput RequestCreatePermissionInput {\n\tteamDid: String \n\tname: String \n\tdescription: String \n}\n\ninput RequestCreateRoleInput {\n\tteamDid: String \n\tname: String \n\ttitle: String \n\tdescription: String \n\tchildName: String \n\tpermissions: [String!] \n}\n\ninput RequestCreateWebHookInput {\n\ttype: SenderType \n\ttitle: String \n\tdescription: String \n\tparams: [WebHookParamInput!] \n}\n\ninput RequestDeleteAccessKeyInput {\n\taccessKeyId: String \n}\n\ninput RequestDeleteBlockletInput {\n\tdid: String \n\tkeepData: Boolean \n}\n\ninput RequestDeleteComponentInput {\n\tdid: String \n\trootDid: String \n\tkeepData: Boolean \n}\n\ninput RequestDeleteDomainAliasInput {\n\tid: String \n\tdomainAlias: String \n}\n\ninput RequestDeleteNginxHttpsCertInput {\n\tid: String \n}\n\ninput RequestDeletePermissionInput {\n\tteamDid: String \n\tname: String \n}\n\ninput RequestDeleteRoleInput {\n\tteamDid: String \n\tname: String \n}\n\ninput RequestDeleteRoutingRuleInput {\n\tid: String \n\truleId: String \n}\n\ninput RequestDeleteRoutingSiteInput {\n\tid: String \n}\n\ninput RequestDeleteTeamSessionInput {\n\tteamDid: String \n\tsessionId: String \n}\n\ninput RequestDeleteWebHookInput {\n\tid: String \n}\n\ninput RequestEndSessionInput {\n\tid: String \n}\n\ninput RequestFindCertificateByDomainInput {\n\tdomain: String \n}\n\ninput RequestGatewayInput {\n\trequestLimit: RequestLimitInput \n}\n\ninput RequestGetAuditLogsInput {\n\tpaging: PagingInput \n\tscope: String \n\tcategory: String \n}\n\ninput RequestGetBlockletsInput {\n\tuseCache: Boolean \n}\n\ninput RequestGetNotificationsInput {\n\treceiver: String \n\tsender: String \n\tread: Boolean \n\tpaging: PagingInput \n}\n\ninput RequestGetPassportIssuancesInput {\n\tteamDid: String \n\townerDid: String \n}\n\ninput RequestGetRoutingSitesInput {\n\tsnapshotHash: String \n}\n\ninput RequestGetRoutingSnapshotsInput {\n\tlimit: Int32 \n}\n\ninput RequestGetSessionInput {\n\tid: String \n}\n\ninput RequestGetSnapshotSitesInput {\n\thash: String \n}\n\ninput RequestGrantPermissionForRoleInput {\n\tteamDid: String \n\troleName: String \n\tgrantName: String \n}\n\ninput RequestHasPermissionInput {\n\tteamDid: String \n\trole: String \n\tpermission: String \n}\n\ninput RequestInstallComponentInput {\n\trootDid: String \n\tmountPoint: String \n\turl: String \n\tfile: Upload \n\tdid: String \n\tdiffVersion: String \n\tdeleteSet: [String!] \n\tname: String \n\ttitle: String \n}\n\ninput RequestInstallFromVcInput {\n\tchallenge: String \n\tvcPresentation: Any \n}\n\ninput RequestLatestBlockletVersionInput {\n\tdid: String \n\tversion: String \n}\n\ninput RequestLimitInput {\n\tenabled: Boolean \n\trate: Uint32 \n\tipHeader: String \n}\n\ninput RequestListBlockletsInput {\n\tregistryUrl: String \n}\n\ninput RequestNodeRoutingInput {\n\tprovider: String \n\tsnapshotHash: String \n\tforceRepopulate: Boolean \n}\n\ninput RequestReadNotificationsInput {\n\tid: String \n}\n\ninput RequestResetNodeInput {\n\towner: Boolean \n\tblocklets: Boolean \n\twebhooks: Boolean \n\tcertificates: Boolean \n\taccessKeys: Boolean \n\tblockletExtras: Boolean \n\troutingRules: Boolean \n\tusers: Boolean \n\tinvitations: Boolean \n}\n\ninput RequestRevokePermissionFromRoleInput {\n\tteamDid: String \n\troleName: String \n\tgrantName: String \n}\n\ninput RequestRevokeUserPassportInput {\n\tteamDid: String \n\tuserDid: String \n\tpassportId: String \n}\n\ninput RequestSendMsgInput {\n\twebhookId: String \n\tmessage: String \n}\n\ninput RequestStartSessionInput {\n\tdata: String \n}\n\ninput RequestTakeRoutingSnapshotInput {\n\tdryRun: Boolean \n\tmessage: String \n}\n\ninput RequestTeamPermissionInput {\n\tteamDid: String \n\tpermission: PermissionInput \n}\n\ninput RequestTeamRoleInput {\n\tteamDid: String \n\trole: RoleInput \n}\n\ninput RequestTeamUserInput {\n\tteamDid: String \n\tuser: MemberInfoInput \n}\n\ninput RequestUpdateAccessKeyInput {\n\taccessKeyId: String \n\tremark: String \n\tpassport: String \n}\n\ninput RequestUpdateChildBlockletsInput {\n\tupdateId: String \n}\n\ninput RequestUpdateNginxHttpsCertInput {\n\tid: String \n\tname: String \n}\n\ninput RequestUpdatePermissionsForRoleInput {\n\tteamDid: String \n\troleName: String \n\tgrantNames: [String!] \n}\n\ninput RequestUpdateRoutingRuleInput {\n\tid: String \n\trule: RoutingRuleInput \n}\n\ninput RequestUpdateRoutingSiteInput {\n\tid: String \n\tcorsAllowedOrigins: [String!] \n\tdomain: String \n}\n\ninput RequestUpdateSessionInput {\n\tid: String \n\tdata: String \n}\n\ninput RequestUpgradeBlockletInput {\n\tdid: String \n\tregistryUrl: String \n}\n\ninput RequestVersionedBlockletInput {\n\tdid: String \n\turl: String \n\tfile: Upload \n\tdiffVersion: String \n\tdeleteSet: [String!] \n\ttitle: String \n\tdescription: String \n\tstartImmediately: Boolean \n}\n\ninput RequsetCreateInvitationInput {\n\tteamDid: String \n\trole: String \n\tremark: String \n}\n\ninput RequsetCreateTransferNodeInvitationInput {\n\tteamDid: String \n\tremark: String \n}\n\ninput RequsetDeleteInvitationInput {\n\tteamDid: String \n\tinviteId: String \n}\n\ninput RoleInput {\n\tname: String \n\tdescription: String \n\tgrants: [String!] \n\ttitle: String \n\tisProtected: Boolean \n}\n\ninput RoutingRuleInput {\n\tid: String \n\tfrom: RoutingRuleFromInput \n\tto: RoutingRuleToInput \n\tisProtected: Boolean \n\tinterfaces: [BlockletStateInterfaceInput!] \n\tservices: [BlockletServiceInput!] \n}\n\ninput RoutingRuleFromInput {\n\tpathPrefix: String \n\theader: [RoutingRuleHeaderInput!] \n}\n\ninput RoutingRuleHeaderInput {\n\tkey: String \n\tvalue: String \n\ttype: HeaderMatchType \n}\n\ninput RoutingRuleToInput {\n\tport: Uint32 \n\ttype: BackendServiceType \n\tdid: String \n\turl: String \n\tredirectCode: Int32 \n\tinterfaceName: String \n\tcomponentId: String \n}\n\ninput TeamInput {\n\tteamDid: String \n}\n\ninput TrustedPassportInput {\n\tissuerDid: String \n\tremark: String \n\tmappings: [TrustedPassportMappingInput!] \n}\n\ninput TrustedPassportMappingInput {\n\tfrom: TrustedPassportMappingFromInput \n\tto: TrustedPassportMappingToInput \n}\n\ninput TrustedPassportMappingFromInput {\n\tpassport: String \n}\n\ninput TrustedPassportMappingToInput {\n\trole: String \n}\n\ninput WebHookParamInput {\n\tname: String \n\tdescription: String \n\trequired: Boolean \n\tdefaultValue: String \n\tvalue: String \n\ttype: String \n}\n\ntype AccessKey {\n\taccessKeyId: String \n\tremark: String \n\tpassport: String \n\tcreatedAt: String \n\tlastUsedAt: String \n\tcreatedBy: String \n\tupdatedBy: String \n}\n\ntype AuditLog {\n\tid: String \n\tscope: String \n\tcategory: String \n\taction: String \n\tcontent: String \n\tactor: AuditLogActor \n\tenv: AuditLogEnv \n\tcreatedAt: String \n\tip: String \n}\n\ntype AuditLogActor {\n\tdid: String \n\trole: String \n\tfullName: String \n}\n\ntype AuditLogEnv {\n\tbrowser: AuditLogEnvItem \n\tos: AuditLogEnvItem \n}\n\ntype AuditLogEnvItem {\n\tname: String \n\tversion: String \n}\n\ntype BlockletCapabilities {\n\tclusterMode: Boolean \n\tcomponent: Boolean \n}\n\ntype BlockletDiff {\n\thasBlocklet: Boolean \n\tversion: String \n\taddSet: [String!] \n\tchangeSet: [String!] \n\tdeleteSet: [String!] \n}\n\ntype BlockletDist {\n\ttarball: String \n\tintegrity: String \n}\n\ntype BlockletEngine {\n\tname: String \n\tdisplayName: String \n\tdescription: String \n\tversion: String \n\tavailable: Boolean \n\tvisible: Boolean \n}\n\ntype BlockletMeta {\n\tdid: String \n\tname: String \n\tversion: String \n\tdescription: String \n\tinterfaces: [BlockletMetaInterface!] \n\tauthor: BlockletMetaPerson \n\tmain: String \n\tstats: BlockletStats \n\thomepage: String \n\tprice: Float32 \n\tpath: String \n\tcommunity: String \n\tdocumentation: String \n\tsupport: String \n\tscreenshots: [String!] \n\tkeywords: [String!] \n\tgroup: String \n\tlogo: String \n\ttitle: String \n\tdist: BlockletDist \n\tmaintainers: [BlockletMetaPerson!] \n\tcontributors: [BlockletMetaPerson!] \n\trepository: BlockletRepository \n\tpayment: BlockletPayment \n\tnftFactory: String \n\tlastPublishedAt: String \n\tcapabilities: BlockletCapabilities \n\tchildren: [ChildConfig!] \n\tenvironments: [Environment!] \n\trequirements: Requirement \n\tbundleDid: String \n\tbundleName: String \n}\n\ntype BlockletMetaInterface {\n\ttype: String \n\tname: String \n\tpath: String \n\tprefix: String \n\tprotocol: String \n\tport: Any \n\tservices: [BlockletMetaService!] \n}\n\ntype BlockletMetaPerson {\n\tname: String \n\temail: String \n\turl: String \n}\n\ntype BlockletMetaService {\n\tname: String \n\tconfig: Any \n}\n\ntype BlockletPayment {\n\tprice: [BlockletPaymentPrice!] \n\tshare: [BlockletPaymentShare!] \n}\n\ntype BlockletPaymentPrice {\n\taddress: String \n\tvalue: String \n\tsymbol: String \n}\n\ntype BlockletPaymentShare {\n\taddress: String \n\tname: String \n\tvalue: String \n}\n\ntype BlockletPreUpdateInfo {\n\tupdateId: String \n\tupdateList: [UpdateList!] \n}\n\ntype BlockletRegistry {\n\tname: String \n\tdescription: String \n\turl: String \n\tlogoUrl: String \n\tmaintainer: String \n\tcdnUrl: String \n\tselected: Boolean \n\tprotected: Boolean \n\tid: String \n}\n\ntype BlockletRepository {\n\ttype: String \n\turl: String \n}\n\ntype BlockletService {\n\tname: String \n\tdescription: String \n\tversion: String \n\tconfig: String \n\tschema: String \n}\n\ntype BlockletSettings {\n\tinitialized: Boolean \n\tenablePassportIssuance: Boolean \n\ttrustedPassports: [TrustedPassport!] \n\twhoCanAccess: String \n\towner: WalletInfo \n\tchildren: [DeletedBlockletState!] \n}\n\ntype BlockletState {\n\tmeta: BlockletMeta \n\tstatus: BlockletStatus \n\tcreatedAt: String \n\tinstalledAt: String \n\tstartedAt: String \n\tpausedAt: String \n\tstoppedAt: String \n\tenvironments: [ConfigEntry!] \n\tconfigs: [ConfigEntry!] \n\tdiskInfo: DiskInfo \n\truntimeInfo: RuntimeInfo \n\tsource: BlockletSource \n\tdeployedFrom: String \n\tbundleSource: Any \n\tport: Float32 \n\tinterfaces: [BlockletStateInterface!] \n\tengine: BlockletEngine \n\tmode: String \n\tports: Any \n\tchildren: [BlockletState!] \n\ttrustedPassports: [TrustedPassport!] \n\tenablePassportIssuance: Boolean \n\tdynamic: Boolean \n\tmountPoint: String \n\tsettings: BlockletSettings \n\tappDid: String \n\tsite: RoutingSite \n}\n\ntype BlockletStateInterface {\n\truleId: String \n\ttype: String \n\tname: String \n\turl: String \n}\n\ntype BlockletStats {\n\tdownloads: Float32 \n\tstar: Float32 \n\tpurchases: Float32 \n}\n\ntype BooleanResponse {\n\tcode: StatusCode \n\tresult: Boolean \n}\n\ntype Certificate {\n\tname: String \n\tdomain: String \n\tid: String \n\tmeta: CertificateMeta \n\tmatchedSites: [MatchedSites!] \n\tcreatedAt: String \n\tupdatedAt: String \n\tisProtected: Boolean \n\tsource: String \n\tstatus: String \n}\n\ntype CertificateIssuer {\n\tcountryName: String \n\torganizationName: String \n\tcommonName: String \n}\n\ntype CertificateMeta {\n\tissuer: CertificateIssuer \n\tsans: [String!] \n\tvalidFrom: Int64 \n\tvalidTo: Int64 \n\tfingerprintAlg: String \n\tfingerprint: String \n\tvalidityPeriod: Int64 \n}\n\ntype ChildConfig {\n\tname: String \n\tresolved: String \n\tmountPoint: String \n}\n\ntype ConfigEntry {\n\tkey: String \n\tvalue: String \n\trequired: Boolean \n\tdescription: String \n\tvalidation: String \n\tsecure: Boolean \n\tcustom: Boolean \n}\n\ntype CreateAccessKey {\n\taccessKeyId: String \n\taccessKeySecret: String \n\tremark: String \n\tpassport: String \n\tcreatedAt: String \n\tlastUsedAt: String \n}\n\ntype DelegationState {\n\tdelegated: Boolean \n}\n\ntype DeletedBlockletMeta {\n\tdid: String \n\tname: String \n\tversion: String \n\tdescription: String \n\ttitle: String \n\tbundleDid: String \n\tbundleName: String \n}\n\ntype DeletedBlockletState {\n\tmeta: DeletedBlockletMeta \n\tstatus: BlockletStatus \n\tdeployedFrom: String \n\tmountPoint: String \n\tdeletedAt: String \n}\n\ntype DiskInfo {\n\tapp: Float32 \n\tdata: Float32 \n\tlog: Float32 \n\tcache: Float32 \n\tblocklets: Float32 \n}\n\ntype Environment {\n\tname: String \n\tdescription: String \n\tdefault: String \n\trequired: Boolean \n\tsecure: Boolean \n\tvalidation: String \n\tshared: Boolean \n}\n\ntype Fuel {\n\tendpoint: String \n\taddress: String \n\tvalue: String \n\treason: String \n}\n\ntype Gateway {\n\trequestLimit: RequestLimit \n}\n\ntype GeneralResponse {\n\tcode: StatusCode \n}\n\ntype IPInfo {\n\tinternalV4: String \n\texternalV4: String \n\tinternalV6: String \n\texternalV6: String \n}\n\ntype InviteInfo {\n\tinviteId: String \n\trole: String \n\tremark: String \n\texpireDate: String \n\tinviter: MemberInfo \n\tteamDid: String \n\tinterfaceName: String \n}\n\ntype Issuer {\n\tid: String \n\tname: String \n\tpk: String \n}\n\ntype LatestBlockletVersion {\n\tdid: String \n\tversion: String \n\tregistryUrl: String \n}\n\ntype LauncherInfo {\n\tdid: String \n\ttype: String \n\tprovider: String \n\turl: String \n\ttag: String \n\tchainHost: String \n}\n\ntype MatchedSites {\n\tid: String \n\tdomain: String \n}\n\ntype MemberInfo {\n\tdid: String \n\tpk: String \n\trole: String \n\tavatar: String \n\tfullName: String \n\temail: String \n\tapproved: Boolean \n\tcreatedAt: String \n\tupdatedAt: String \n\tlocale: String \n\tpassports: [Passport!] \n\tfirstLoginAt: String \n\tlastLoginAt: String \n\tremark: String \n}\n\ntype NodeEnvInfo {\n\tip: IPInfo \n\tos: String \n\tlocation: String \n\tdocker: Boolean \n\timage: Boolean \n\tblockletEngines: [BlockletEngine!] \n\tgitpod: Boolean \n\tdisk: DiskInfo \n}\n\ntype NodeRouting {\n\tprovider: String \n\tsnapshotHash: String \n\tadminPath: String \n\trequestLimit: RequestLimit \n}\n\ntype NodeState {\n\tdid: String \n\tpk: String \n\tversion: String \n\tname: String \n\tdescription: String \n\tport: String \n\tinitialized: Boolean \n\tnodeOwner: WalletInfo \n\tcreatedAt: String \n\tstartedAt: String \n\tinitializedAt: String \n\tmode: String \n\trouting: NodeRouting \n\tmembers: [MemberInfo!] \n\tenvironments: [ConfigEntry!] \n\tuptime: Float32 \n\tautoUpgrade: Boolean \n\tnextVersion: String \n\tupgradeSessionId: String \n\tregisterUrl: String \n\tenableWelcomePage: Boolean \n\twebWalletUrl: String \n\tblockletRegistryList: [BlockletRegistry!] \n\townerNft: OwnerNft \n\tdiskAlertThreshold: Uint32 \n\ttrustedPassports: [TrustedPassport!] \n\tlauncher: LauncherInfo \n\tenablePassportIssuance: Boolean \n\tdidRegistry: String \n\tdidDomain: String \n}\n\ntype Notification {\n\tsender: String \n\treceiver: String \n\ttitle: String \n\tdescription: String \n\taction: String \n\tentityType: String \n\tentityId: String \n\tread: Boolean \n\tcreatedAt: String \n\tupdatedAt: String \n\tid: String \n\tseverity: String \n}\n\ntype OwnerNft {\n\tdid: String \n\tholder: String \n\tissuer: String \n}\n\ntype Paging {\n\ttotal: Uint32 \n\tpageSize: Uint32 \n\tpageCount: Uint32 \n\tpage: Uint32 \n}\n\ntype Passport {\n\tid: String \n\tname: String \n\ttitle: String \n\tissuer: Issuer \n\ttype: [String!] \n\tissuanceDate: String \n\texpirationDate: String \n\tstatus: String \n\trole: String \n}\n\ntype PassportIssuanceInfo {\n\tid: String \n\tname: String \n\ttitle: String \n\texpireDate: String \n\tteamDid: String \n\townerDid: String \n}\n\ntype Permission {\n\tname: String \n\tdescription: String \n\tisProtected: Boolean \n}\n\ntype RequestLimit {\n\tenabled: Boolean \n\trate: Uint32 \n\tipHeader: String \n}\n\ntype Requirement {\n\tserver: String \n\tos: Any \n\tcpu: Any \n\tfuels: [Fuel!] \n}\n\ntype ResponseAccessKeys {\n\tcode: StatusCode \n\tlist: [AccessKey!] \n}\n\ntype ResponseAddLetsEcryptCert {\n\tcode: StatusCode \n}\n\ntype ResponseAddNginxHttpsCert {\n\tcode: StatusCode \n}\n\ntype ResponseBlocklet {\n\tcode: StatusCode \n\tblocklet: BlockletState \n}\n\ntype ResponseBlockletDiff {\n\tcode: StatusCode \n\tblockletDiff: BlockletDiff \n}\n\ntype ResponseBlockletMeta {\n\tcode: StatusCode \n\tmeta: Any \n}\n\ntype ResponseBlockletMetaFromUrl {\n\tcode: StatusCode \n\tmeta: BlockletMeta \n\tisFree: Boolean \n\tisInstalled: Boolean \n\tisRunning: Boolean \n}\n\ntype ResponseCheckChildBlockletsForUpdates {\n\tcode: StatusCode \n\tpreUpdateInfo: BlockletPreUpdateInfo \n}\n\ntype ResponseCheckDomains {\n\tcode: StatusCode \n}\n\ntype ResponseCheckNodeVersion {\n\tcode: StatusCode \n\tversion: String \n}\n\ntype ResponseConfigBlocklet {\n\tcode: StatusCode \n\tblocklet: BlockletState \n}\n\ntype ResponseCreateAccessKey {\n\tcode: StatusCode \n\tdata: CreateAccessKey \n}\n\ntype ResponseCreateInvitation {\n\tcode: StatusCode \n\tinviteInfo: InviteInfo \n}\n\ntype ResponseCreatePassportIssuance {\n\tcode: StatusCode \n\tinfo: PassportIssuanceInfo \n}\n\ntype ResponseCreateTransferNodeInvitation {\n\tcode: StatusCode \n\tinviteInfo: InviteInfo \n}\n\ntype ResponseCreateWebHook {\n\tcode: StatusCode \n\twebhook: WebHookSender \n}\n\ntype ResponseDelegationState {\n\tcode: StatusCode \n\tstate: DelegationState \n}\n\ntype ResponseDeleteAccessKey {\n\tcode: StatusCode \n}\n\ntype ResponseDeleteNginxHttpsCert {\n\tcode: StatusCode \n}\n\ntype ResponseDeleteWebHook {\n\tcode: StatusCode \n}\n\ntype ResponseFindCertificateByDomain {\n\tcode: StatusCode \n\tcert: Certificate \n}\n\ntype ResponseGateway {\n\tcode: StatusCode \n\tgateway: Gateway \n}\n\ntype ResponseGetAuditLogs {\n\tcode: StatusCode \n\tlist: [AuditLog!] \n\tpaging: Paging \n}\n\ntype ResponseGetBlocklets {\n\tcode: StatusCode \n\tblocklets: [BlockletState!] \n}\n\ntype ResponseGetCertificates {\n\tcode: StatusCode \n\tcertificates: [Certificate!] \n}\n\ntype ResponseGetInvitations {\n\tcode: StatusCode \n\tinvitations: [InviteInfo!] \n}\n\ntype ResponseGetNodeEnv {\n\tcode: StatusCode \n\tinfo: NodeEnvInfo \n}\n\ntype ResponseGetNodeInfo {\n\tcode: StatusCode \n\tinfo: NodeState \n}\n\ntype ResponseGetNotifications {\n\tcode: StatusCode \n\tlist: [Notification!] \n\tpaging: Paging \n}\n\ntype ResponseGetPassportIssuances {\n\tcode: StatusCode \n\tlist: [PassportIssuanceInfo!] \n}\n\ntype ResponseGetRoutingProviders {\n\tcode: StatusCode \n\tproviders: [RoutingProvider!] \n}\n\ntype ResponseGetRoutingSites {\n\tcode: StatusCode \n\tsites: [RoutingSite!] \n}\n\ntype ResponseGetRoutingSnapshots {\n\tcode: StatusCode \n\tsnapshots: [RoutingSnapshot!] \n}\n\ntype ResponseGetServices {\n\tcode: StatusCode \n\tservices: [BlockletService!] \n}\n\ntype ResponseGetSession {\n\tcode: StatusCode \n\tsession: Any \n}\n\ntype ResponseGetSnapshotSites {\n\tcode: StatusCode \n\tsites: [RoutingSite!] \n}\n\ntype ResponseInstallFromVc {\n\tcode: StatusCode \n\tblocklet: BlockletState \n}\n\ntype ResponseLatestBlockletVersion {\n\tcode: StatusCode \n\tdata: LatestBlockletVersion \n}\n\ntype ResponseListBlocklets {\n\tcode: StatusCode \n\tblocklets: [BlockletMeta!] \n}\n\ntype ResponsePermission {\n\tcode: StatusCode \n\tpermission: Permission \n}\n\ntype ResponsePermissions {\n\tcode: StatusCode \n\tpermissions: [Permission!] \n}\n\ntype ResponseReadNotifications {\n\tcode: StatusCode \n\tnumAffected: Int32 \n}\n\ntype ResponseResetNode {\n\tcode: StatusCode \n}\n\ntype ResponseRole {\n\tcode: StatusCode \n\trole: Role \n}\n\ntype ResponseRoles {\n\tcode: StatusCode \n\troles: [Role!] \n}\n\ntype ResponseRoutingSite {\n\tcode: StatusCode \n\tsite: RoutingSite \n}\n\ntype ResponseSendMsg {\n\tcode: StatusCode \n}\n\ntype ResponseSenderList {\n\tcode: StatusCode \n\tsenders: [WebHookSender!] \n}\n\ntype ResponseTakeRoutingSnapshot {\n\tcode: StatusCode \n\thash: String \n}\n\ntype ResponseUpdateAccessKey {\n\tcode: StatusCode \n\tdata: AccessKey \n}\n\ntype ResponseUpdateNginxHttpsCert {\n\tcode: StatusCode \n}\n\ntype ResponseUpgradeNodeVersion {\n\tcode: StatusCode \n\tsessionId: String \n}\n\ntype ResponseUser {\n\tcode: StatusCode \n\tuser: MemberInfo \n}\n\ntype ResponseUsers {\n\tcode: StatusCode \n\tusers: [MemberInfo!] \n}\n\ntype ResponseWebHooks {\n\tcode: StatusCode \n\twebhooks: [WebHookRecord!] \n}\n\ntype Role {\n\tname: String \n\tdescription: String \n\tgrants: [String!] \n\ttitle: String \n\tisProtected: Boolean \n}\n\ntype RoutingProvider {\n\tname: String \n\tdescription: String \n\trunning: Boolean \n\tavailable: Boolean \n\terror: String \n}\n\ntype RoutingRule {\n\tid: String \n\tfrom: RoutingRuleFrom \n\tto: RoutingRuleTo \n\tisProtected: Boolean \n\tinterfaces: [BlockletStateInterface!] \n\tservices: [BlockletService!] \n}\n\ntype RoutingRuleFrom {\n\tpathPrefix: String \n\theader: [RoutingRuleHeader!] \n}\n\ntype RoutingRuleHeader {\n\tkey: String \n\tvalue: String \n\ttype: HeaderMatchType \n}\n\ntype RoutingRuleTo {\n\tport: Uint32 \n\ttype: BackendServiceType \n\tdid: String \n\turl: String \n\tredirectCode: Int32 \n\tinterfaceName: String \n\tcomponentId: String \n}\n\ntype RoutingSite {\n\tid: String \n\tdomain: String \n\tdomainAliases: [Any!] \n\trules: [RoutingRule!] \n\tisProtected: Boolean \n\tcorsAllowedOrigins: [String!] \n}\n\ntype RoutingSnapshot {\n\thash: String \n\ttree: String \n\tmessage: String \n\tauthor: String \n\tcreatedAt: String \n}\n\ntype RuntimeInfo {\n\tpid: String \n\tport: String \n\tuptime: String \n\tmemoryUsage: Float32 \n\tcpuUsage: Float32 \n}\n\ntype TrustedPassport {\n\tissuerDid: String \n\tremark: String \n\tmappings: [TrustedPassportMapping!] \n}\n\ntype TrustedPassportMapping {\n\tfrom: TrustedPassportMappingFrom \n\tto: TrustedPassportMappingTo \n}\n\ntype TrustedPassportMappingFrom {\n\tpassport: String \n}\n\ntype TrustedPassportMappingTo {\n\trole: String \n}\n\ntype UpdateList {\n\tid: String \n\tmeta: BlockletMeta \n}\n\ntype WalletInfo {\n\tdid: String \n\tpk: String \n}\n\ntype WebHookParam {\n\tname: String \n\tdescription: String \n\trequired: Boolean \n\tdefaultValue: String \n\tvalue: String \n\ttype: String \n}\n\ntype WebHookRecord {\n\ttype: SenderType \n\tid: String \n\tparams: [WebHookParam!] \n\tcreatedAt: String \n}\n\ntype WebHookSender {\n\ttype: SenderType \n\ttitle: String \n\tdescription: String \n\tparams: [WebHookParam!] \n}\n\nenum BackendServiceType {\n\tdaemon\n\tblocklet\n\tredirect\n\tnone\n\tgeneral_proxy\n\tdirect_response\n}\n\nenum BlockletSource {\n\tregistry\n\tlocal\n\tupload\n\turl\n\tcustom\n}\n\nenum BlockletStatus {\n\tadded\n\tdownloading\n\tdownloaded\n\tinstalling\n\tinstalled\n\tstarting\n\trunning\n\tstopping\n\tstopped\n\terror\n\tupgrading\n\trestarting\n\tcorrupted\n\twaiting\n\tdeleted\n\tunknown\n}\n\nenum HeaderMatchType {\n\texact\n\tpartial\n\tregexp\n}\n\nenum SenderType {\n\tslack\n\tapi\n}\n\nenum StatusCode {\n\tok\n\tblocklet_not_found\n\tblocklet_not_purchased\n\tforbidden\n\tinternal\n\ttimeout\n}\n\nscalar Upload\n\ntype Mutation {\n\tinstallBlocklet(input: RequestVersionedBlockletInput): ResponseBlocklet\n\tinstallBlockletFromVc(input: RequestInstallFromVcInput): ResponseInstallFromVc\n\tinstallComponent(input: RequestInstallComponentInput): ResponseBlocklet\n\tstartBlocklet(input: RequestBlockletInput): ResponseBlocklet\n\tstopBlocklet(input: RequestBlockletInput): ResponseBlocklet\n\treloadBlocklet(input: RequestBlockletInput): ResponseBlocklet\n\trestartBlocklet(input: RequestBlockletInput): ResponseBlocklet\n\tdeleteBlocklet(input: RequestDeleteBlockletInput): ResponseBlocklet\n\tdeleteComponent(input: RequestDeleteComponentInput): ResponseBlocklet\n\tcancelDownloadBlocklet(input: RequestBlockletInput): ResponseBlocklet\n\tupgradeBlocklet(input: RequestUpgradeBlockletInput): ResponseBlocklet\n\tconfigBlocklet(input: RequestConfigBlockletInput): ResponseConfigBlocklet\n\tcheckChildBlockletsForUpdates(input: RequestBlockletInput): ResponseCheckChildBlockletsForUpdates\n\tupdateChildBlocklets(input: RequestUpdateChildBlockletsInput): ResponseBlocklet\n\tupdateNodeInfo(input: NodeInfoInput): ResponseGetNodeInfo\n\tupdateNodeRouting(input: RequestNodeRoutingInput): ResponseGetNodeInfo\n\tupgradeNodeVersion: ResponseUpgradeNodeVersion\n\taddBlockletStore(input: RequestChangeBlockletStoreInput): GeneralResponse\n\tdeleteBlockletStore(input: RequestChangeBlockletStoreInput): GeneralResponse\n\tselectBlockletStore(input: RequestChangeBlockletStoreInput): GeneralResponse\n\tresetNode(input: RequestResetNodeInput): ResponseResetNode\n\tupdateGateway(input: RequestGatewayInput): ResponseGateway\n\tcreateMemberInvitation(input: RequsetCreateInvitationInput): ResponseCreateInvitation\n\tcreateTransferInvitation(input: RequsetCreateTransferNodeInvitationInput): ResponseCreateTransferNodeInvitation\n\tdeleteInvitation(input: RequsetDeleteInvitationInput): GeneralResponse\n\tcreatePassportIssuance(input: RequestCreatePassportIssuanceInput): ResponseCreatePassportIssuance\n\tdeletePassportIssuance(input: RequestDeleteTeamSessionInput): GeneralResponse\n\tconfigTrustedPassports(input: RequestConfigTrustedPassportsInput): GeneralResponse\n\tconfigPassportIssuance(input: RequestConfigPassportIssuanceInput): GeneralResponse\n\tremoveUser(input: RequestTeamUserInput): ResponseUser\n\tupdateUserApproval(input: RequestTeamUserInput): ResponseUser\n\tupdateUserRole(input: RequestTeamUserInput): ResponseUser\n\trevokeUserPassport(input: RequestRevokeUserPassportInput): ResponseUser\n\tenableUserPassport(input: RequestRevokeUserPassportInput): ResponseUser\n\tcreateRole(input: RequestCreateRoleInput): ResponseRole\n\tupdateRole(input: RequestTeamRoleInput): ResponseRole\n\tdeleteRole(input: RequestDeleteRoleInput): GeneralResponse\n\tcreatePermission(input: RequestCreatePermissionInput): ResponsePermission\n\tupdatePermission(input: RequestTeamPermissionInput): ResponsePermission\n\tdeletePermission(input: RequestDeletePermissionInput): GeneralResponse\n\tgrantPermissionForRole(input: RequestGrantPermissionForRoleInput): GeneralResponse\n\trevokePermissionFromRole(input: RequestRevokePermissionFromRoleInput): GeneralResponse\n\tupdatePermissionsForRole(input: RequestUpdatePermissionsForRoleInput): ResponseRole\n\thasPermission(input: RequestHasPermissionInput): BooleanResponse\n\treadNotifications(input: RequestReadNotificationsInput): ResponseReadNotifications\n\tunreadNotifications(input: RequestReadNotificationsInput): ResponseReadNotifications\n\taddRoutingSite(input: RequestAddRoutingSiteInput): ResponseRoutingSite\n\taddDomainAlias(input: RequestAddDomainAliasInput): ResponseRoutingSite\n\tdeleteDomainAlias(input: RequestDeleteDomainAliasInput): ResponseRoutingSite\n\tdeleteRoutingSite(input: RequestDeleteRoutingSiteInput): GeneralResponse\n\tupdateRoutingSite(input: RequestUpdateRoutingSiteInput): ResponseRoutingSite\n\taddRoutingRule(input: RequestAddRoutingRuleInput): ResponseRoutingSite\n\tupdateRoutingRule(input: RequestUpdateRoutingRuleInput): ResponseRoutingSite\n\tdeleteRoutingRule(input: RequestDeleteRoutingRuleInput): ResponseRoutingSite\n\ttakeRoutingSnapshot(input: RequestTakeRoutingSnapshotInput): ResponseTakeRoutingSnapshot\n\tupdateCertificate(input: RequestUpdateNginxHttpsCertInput): ResponseUpdateNginxHttpsCert\n\taddCertificate(input: RequestAddNginxHttpsCertInput): ResponseAddNginxHttpsCert\n\tdeleteCertificate(input: RequestDeleteNginxHttpsCertInput): ResponseDeleteNginxHttpsCert\n\tissueLetsEncryptCert(input: RequestAddLetsEcryptCertInput): ResponseAddLetsEcryptCert\n\tcreateAccessKey(input: RequestCreateAccessKeyInput): ResponseCreateAccessKey\n\tupdateAccessKey(input: RequestUpdateAccessKeyInput): ResponseUpdateAccessKey\n\tdeleteAccessKey(input: RequestDeleteAccessKeyInput): ResponseDeleteAccessKey\n\tcreateWebHook(input: RequestCreateWebHookInput): ResponseCreateWebHook\n\tdeleteWebHook(input: RequestDeleteWebHookInput): ResponseDeleteWebHook\n\tstartSession(input: RequestStartSessionInput): ResponseGetSession\n\tupdateSession(input: RequestUpdateSessionInput): ResponseGetSession\n\tendSession(input: RequestEndSessionInput): ResponseGetSession\n}\n\ntype Query {\n\tgetBlocklet(input: RequestBlockletInput): ResponseBlocklet\n\tgetBlockletMetaFromUrl(input: RequestBlockletMetaFromUrlInput): ResponseBlockletMetaFromUrl\n\tgetBlockletDiff(input: RequestBlockletDiffInput): ResponseBlockletDiff\n\tgetBlocklets(input: RequestGetBlockletsInput): ResponseGetBlocklets\n\tgetLatestBlockletVersion(input: RequestLatestBlockletVersionInput): ResponseLatestBlockletVersion\n\tgetNodeInfo: ResponseGetNodeInfo\n\tgetNodeEnv: ResponseGetNodeEnv\n\tcheckNodeVersion: ResponseCheckNodeVersion\n\tgetDelegationState: ResponseDelegationState\n\tlistBlocklets(input: RequestListBlockletsInput): ResponseListBlocklets\n\tgetBlockletMeta(input: RequestBlockletInput): ResponseBlockletMeta\n\tgetNotifications(input: RequestGetNotificationsInput): ResponseGetNotifications\n\tgetRoutingSites(input: RequestGetRoutingSitesInput): ResponseGetRoutingSites\n\tgetRoutingSnapshots(input: RequestGetRoutingSnapshotsInput): ResponseGetRoutingSnapshots\n\tgetSnapshotSites(input: RequestGetSnapshotSitesInput): ResponseGetSnapshotSites\n\tgetRoutingProviders: ResponseGetRoutingProviders\n\tgetServices: ResponseGetServices\n\tgetCertificates: ResponseGetCertificates\n\tcheckDomains(input: RequestCheckDomainsInput): ResponseCheckDomains\n\tfindCertificateByDomain(input: RequestFindCertificateByDomainInput): ResponseFindCertificateByDomain\n\tgetAccessKeys: ResponseAccessKeys\n\tgetWebHooks: ResponseWebHooks\n\tgetWebhookSenders: ResponseSenderList\n\tsendTestMessage(input: RequestSendMsgInput): ResponseSendMsg\n\tgetSession(input: RequestGetSessionInput): ResponseGetSession\n\tgetRoles(input: TeamInput): ResponseRoles\n\tgetPermissions(input: TeamInput): ResponsePermissions\n\tgetInvitations(input: TeamInput): ResponseGetInvitations\n\tgetUsers(input: TeamInput): ResponseUsers\n\tgetUser(input: RequestTeamUserInput): ResponseUser\n\tgetOwner(input: TeamInput): ResponseUser\n\tgetPermissionsByRole(input: RequestTeamRoleInput): ResponsePermissions\n\tgetPassportIssuances(input: RequestGetPassportIssuancesInput): ResponseGetPassportIssuances\n\tgetAuditLogs(input: RequestGetAuditLogsInput): ResponseGetAuditLogs\n}"},function(e,t,n){const r=n(1459),o=n(1460),i=n(1461);e.exports=e=>{const t=i(e),n={listBlocklets:[["query_blocklet"],"blocklets",e.listBlocklets],getBlockletMeta:[["query_blocklet"],"meta",e.getBlockletMeta],getBlocklet:[["query_blocklet","manage_blocklet"],"blocklet",e.getBlocklet,[o]],getBlocklets:[["query_blocklet"],"blocklets",e.getBlocklets],getBlockletDiff:[["query_blocklet","manage_blocklet"],"blockletDiff",e.getBlockletDiff,[o]],getLatestBlockletVersion:[["query_blocklet","manage_blocklet"],"data",e.getLatestBlockletVersion,[o]],getBlockletMetaFromUrl:[["query_blocklet"],["meta","isFree","isInstalled","isRunning"],e.getBlockletMetaFromUrl],installBlocklet:[["mutate_blocklet"],"blocklet",e.installBlocklet,[],[t]],installBlockletFromVc:[["mutate_blocklet"],"blocklet",e.installBlockletFromVc,[],[t]],installComponent:[["mutate_blocklet","manage_blocklet"],"blocklet",e.installComponent,[o],[t]],startBlocklet:[["mutate_blocklet","manage_blocklet"],"blocklet",e.startBlocklet,[o],[t]],stopBlocklet:[["mutate_blocklet","manage_blocklet"],"blocklet",e.stopBlocklet,[o],[t]],reloadBlocklet:[["mutate_blocklet","manage_blocklet"],"blocklet",e.reloadBlocklet,[o],[t]],restartBlocklet:[["mutate_blocklet","manage_blocklet"],"blocklet",e.restartBlocklet,[o],[t]],deleteBlocklet:[["mutate_blocklet"],"blocklet",e.deleteBlocklet,[],[t]],deleteComponent:[["mutate_blocklet","manage_blocklet"],"blocklet",e.deleteComponent,[o],[t]],cancelDownloadBlocklet:[["mutate_blocklet","manage_blocklet"],"blocklet",e.cancelDownloadBlocklet,[o],[t]],upgradeBlocklet:[["mutate_blocklet","manage_blocklet"],"blocklet",e.upgradeBlocklet,[o],[t]],configBlocklet:[["mutate_blocklet","manage_blocklet"],"blocklet",e.configBlocklet,[o],[t]],checkChildBlockletsForUpdates:[["mutate_blocklet","manage_blocklet"],"preUpdateInfo",e.checkChildBlockletsForUpdates,[o],[t]],updateChildBlocklets:[["mutate_blocklet","manage_blocklet"],"blocklet",e.updateChildBlocklets,[o],[t]],getNodeInfo:[[],"info",e.getNodeInfo],getNodeEnv:[["query_node"],"info",e.getNodeEnv],updateNodeInfo:[["mutate_node"],"info",e.updateNodeInfo,[],[t]],addBlockletStore:[["mutate_node"],"info",e.addBlockletStore,[],[t]],deleteBlockletStore:[["mutate_node"],"info",e.deleteBlockletStore,[],[t]],selectBlockletStore:[["mutate_node"],"info",e.selectBlockletStore,[],[t]],updateNodeRouting:[["mutate_node"],"info",e.updateNodeRouting,[],[t]],upgradeNodeVersion:[["mutate_node"],"sessionId",e.upgradeNodeVersion,[],[t]],checkNodeVersion:[["query_node"],"version",e.checkNodeVersion],resetNode:[["mutate_node"],"info",e.resetNode],getDelegationState:[[],"state",e.getDelegationState],updateGateway:[["mutate_node"],"gateway",e.updateGateway,[],[t]],getSession:[["query_session"],"session",e.getSession],startSession:[["mutate_session"],"session",e.startSession],updateSession:[["mutate_session"],"session",e.updateSession],endSession:[["mutate_session"],"session",e.endSession],getRoles:[["query_team"],"roles",e.getRoles,[r]],createRole:[["mutate_team"],"role",e.createRole,[r],[t]],updateRole:[["mutate_team"],"role",e.updateRole,[r],[t]],deleteRole:[["mutate_team"],"success",e.deleteRole,[r],[t]],getPermissions:[["query_team"],"permissions",e.getPermissions,[r]],createPermission:[["mutate_team"],"permission",e.createPermission,[r],[t]],updatePermission:[["mutate_team"],"role",e.updatePermission,[r],[t]],deletePermission:[["mutate_team"],"success",e.deletePermission,[r],[t]],grantPermissionForRole:[["mutate_team"],"success",e.grantPermissionForRole,[r],[t]],revokePermissionFromRole:[["mutate_team"],"success",e.revokePermissionFromRole,[r],[t]],updatePermissionsForRole:[["mutate_team"],"role",e.updatePermissionsForRole,[r],[t]],getPermissionsByRole:[["query_team"],"permissions",e.getPermissionsByRole,[r]],hasPermission:[["query_team"],"result",e.hasPermission,[r]],getUsers:[["query_team"],"users",e.getUsers,[r]],getUser:[["query_team"],"user",e.getUser,[r]],getOwner:[["query_team"],"user",e.getOwner,[r]],removeUser:[["mutate_team"],"user",e.removeUser,[r],[t]],updateUserApproval:[["mutate_team"],"user",e.updateUserApproval,[r],[t]],updateUserRole:[["mutate_team"],"user",e.updateUserRole,[r],[t]],getInvitations:[["query_team"],"invitations",e.getInvitations,[r]],createMemberInvitation:[["mutate_team"],"inviteInfo",e.createMemberInvitation,[r],[t]],createTransferInvitation:[["mutate_team"],"inviteInfo",e.createTransferInvitation,[r],[t]],deleteInvitation:[["mutate_team"],"invitation",e.deleteInvitation,[r],[t]],getPassportIssuances:[["query_team"],"list",e.getPassportIssuances,[r]],createPassportIssuance:[["mutate_team"],"info",e.createPassportIssuance,[r],[t]],deletePassportIssuance:[["mutate_team"],"invitation",e.deletePassportIssuance,[r],[t]],revokeUserPassport:[["mutate_team"],"user",e.revokeUserPassport,[r],[t]],enableUserPassport:[["mutate_team"],"user",e.enableUserPassport,[r],[t]],configTrustedPassports:[["mutate_team"],"info",e.configTrustedPassports,[r],[t]],configPassportIssuance:[["mutate_team"],"info",e.configPassportIssuance,[r],[t]],getAccessKeys:[["query_accessKey"],"list",e.getAccessKeys],createAccessKey:[["mutate_accessKey"],"data",e.createAccessKey,[],[t]],deleteAccessKey:[["mutate_accessKey"],"data",e.deleteAccessKey,[],[t]],updateAccessKey:[["mutate_accessKey"],"data",e.updateAccessKey,[],[t]],getRoutingSites:[["query_router"],"sites",e.getRoutingSites],getRoutingProviders:[["query_router"],"providers",e.getRoutingProviders],addRoutingSite:[["mutate_router"],"site",e.addRoutingSite,[],[t]],deleteRoutingSite:[["mutate_router"],"site",e.deleteRoutingSite,[],[t]],updateRoutingSite:[["mutate_router"],"site",e.updateRoutingSite,[],[t]],addRoutingRule:[["mutate_router"],"site",e.addRoutingRule,[],[t]],updateRoutingRule:[["mutate_router"],"site",e.updateRoutingRule,[],[t]],deleteRoutingRule:[["mutate_router"],"site",e.deleteRoutingRule,[],[t]],addDomainAlias:[["mutate_router","manage_blocklet"],"site",e.addDomainAlias,[],[t]],deleteDomainAlias:[["mutate_router"],"site",e.deleteDomainAlias,[],[t]],getServices:[["query_router"],"services",e.getServices],getRoutingSnapshots:[["query_router"],"snapshots",e.getRoutingSnapshots],getSnapshotSites:[["query_router"],"sites",e.getSnapshotSites],takeRoutingSnapshot:[["query_router","manage_blocklet"],"hash",e.takeRoutingSnapshot],checkDomains:[["query_router"],"result",e.checkDomains],findCertificateByDomain:[["query_router","manage_blocklet"],"cert",e.findCertificateByDomain],getCertificates:[["query_router","query_certificate"],"certificates",e.getCertificates],addCertificate:[["mutate_router","mutate_certificate"],"certificate",e.addCertificate,[],[t]],updateCertificate:[["mutate_router","mutate_certificate"],"certificate",e.updateCertificate,[],[t]],deleteCertificate:[["mutate_router","mutate_certificate"],"certificate",e.deleteCertificate,[],[t]],issueLetsEncryptCert:[["mutate_certificate","manage_blocklet"],"certificate",e.issueLetsEncryptCert,[],[t]],getNotifications:[["query_notification"],["list","paging"],e.getNotifications],readNotifications:[["mutate_notification"],"numAffected",e.readNotifications],unreadNotifications:[["mutate_notification"],"numAffected",e.unreadNotifications],getWebHooks:[["query_webhook"],"webhooks",e.getWebHooks],createWebHook:[["mutate_webhook"],"webhook",e.createWebHook,[],[t]],deleteWebHook:[["mutate_webhook"],"data",e.deleteWebHook,[],[t]],getWebhookSenders:[["query_webhook"],"senders",e.getWebhookSenders],sendTestMessage:[["mutate_webhook"],"data",e.sendTestMessage],getAuditLogs:[["query_node"],["list","paging"],e.getAuditLogs]};return Object.freeze(Object.keys(n).reduce((e,t)=>{const[r,o,i,a=[],s=[]]=n[t];return e[t]=(([e,t,n,r=[],o=[],i])=>({permissions:e,dataKeys:t,handler:new Proxy(n,{async apply(e,t,n){for(let e=0;e<r.length;e++)await Reflect.apply(r[e],t,[...n,i]);const a=await Reflect.apply(e,t,n);for(let e=0;e<o.length;e++)Reflect.apply(o[e],t,[...n,i,a]);return a}})}))([r,o,i,a,s,t]),e},{}))}},function(e,t,n){const{NODE_SERVICES:r}=n(25);e.exports=({teamDid:e},t)=>{const{did:n,role:o,blockletDid:i}=t.user;if(o===r.AUTH_SERVICE&&n!==e||"blocklet"===o&&i!==e)throw new Error("You cannot request other blocklet's data")}},function(e,t){e.exports=({did:e,rootDid:t},n)=>{const{role:r,blockletDid:o}=n.user;let i;if(t?i=t:e&&(i=Array.isArray(e)?e[0]:e),"blocklet"===r&&o!==i)throw new Error("You cannot request other blocklet's data")}},function(e,t){e.exports=e=>(t,n,r,o)=>{e.createAuditLog({action:r,args:t,context:n,result:o}).catch(e=>console.error("create audit log error",e))}},function(e,t,n){const{WsServer:r}=n(320),{types:o}=n(28),{fromSecretKey:i,WalletType:a}=n(46),{BlockletEvents:s}=n(100),{EVENTS:l}=n(25),u=n(40)(n(91).name+":ws"),{authWithJwt:p}=n(124),{createStreamLogManager:c,getLogFiles:d}=n(1463);u.debug=()=>null,e.exports=function(e){const t=new r({logger:u,pathname:"/websocket",authenticate:(t,n)=>{const{searchParams:r}=new URL(t.url,"http://"+(t.headers.host||"unknown")),s=r.get("token"),l=r.get("timestamp");s?s&&l?e.getNodeInfo().then(e=>{i(e.sk,a({role:o.RoleType.ROLE_APPLICATION,pk:o.KeyType.ED25519,hash:o.HashType.SHA3})).verify(l,s)?n(null,{did:e.did}):n(new Error("Signature is invalid"),null)}):p(s,e).then(e=>{n(null,{did:e.did})}).catch(()=>{n(new Error("token parse fail"),null)}):n(new Error("token not found"),null)},hooks:{receiveMessage:({socket:e,topic:n,event:r,payload:o})=>{t.emit(`${n}/${r}`,{socket:e,topic:n,event:r,payload:o}),u.info("client pushed socket message",{topic:n,event:r})}}}),n=({event:n,payload:r})=>{if(n){if(Object.values(s).includes(n)&&"function"==typeof e.handleBlockletEvent)return void e.handleBlockletEvent(n,r);if([l.NODE_STARTED,l.NODE_STOPPED].includes(n)&&"function"==typeof e.handleServerEvent)return void e.handleServerEvent(n,r);t.broadcast(n,r)}};t.on("cli/blocklet.deployed",n),t.on("cli/blocklet.statusChange",n),t.on("cli/blocklet.started",n),t.on("cli/blocklet.removed",n),t.on("cli/blocklet.updated",n),t.on("cli/routing.updated",n),t.on("cli/node.stopped",n),t.on("cli/node.started",n),t.on("cli/node.upgrading",n);const f=c({onGetLogFiles:t=>d({name:t,node:e}),onLog:({topic:e,level:n,logFiles:r,data:o})=>{t.broadcast(e,e,{level:n,logFiles:r,data:o},{enableLog:!1})}}),h=e.getSysInfoEmitter(5e3);h.on("info",e=>{t.broadcast("system.info","system.info",e,{enableLog:!1})});return["channel.join","channel.leave","channel.destroy"].forEach(n=>{t.on(n,r=>(async(n,{socket:r,topic:o})=>{const[i,...a]=o.split(".");if("log"===i){const e=a.join(".");"channel.join"===n&&f.add(e,o,(e,n,i)=>{t.send(r,o,o,{level:e,data:n,logFiles:i},{enableLog:!1})}),"channel.destroy"===n&&f.destroy(e)}"system"===i&&("channel.join"===n&&(h.startPolling(),u.info("start system info polling"),e.getSysInfo().then(e=>{t.send(r,o,o,e,{enableLog:!1})})),"channel.destroy"===n&&(u.info("stop system info polling"),h.stopPolling()))})(n,r))}),e.setEventHandler(({name:e,data:n})=>{if("blocklet.removed"===e)try{const{did:e}=n.meta,t="blocklet-"+e;u.info("destroy blocklet log stream",{name:t}),f.destroy(t)}catch(e){u.error("destroy blocklet log stream error",{error:e})}e&&t.broadcast(e,n)}),t}},function(e,t,n){const r=["recent"];function o(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}const i=n(9),a=n(17),s=n(169),{Tail:l}=n(1464),u=n(1465),{BLOCKLET_MODES:p}=n(100),c=n(40)(n(91).name);class d{constructor(){this._files=null,this._tails=null}async setFiles(e){return!s(this._files,e)&&(this.clearTails(),this._files=e,!0)}getRecent(e,t){this._files||t(new Error("files is empty")),Object.entries(this._files).forEach(([n,r])=>{r&&a.existsSync(r)&&u.read(r,e||0).then(e=>{t(null,n,e)}).catch(e=>{t(e,n)})})}ensureTails(){if(this._tails)return this._tails;if(!this._files)return{};try{return this._tails={},Object.entries(this._files).forEach(([e,t])=>{t&&a.existsSync(t)&&(this._tails[e]=new l(t))}),this._tails}catch(e){throw this._tails=null,e}}clearTails(){this._tails&&(Object.values(this._tails).forEach(e=>{e.unwatch()}),this._tails=null)}}const f=e=>{Object.values(e).forEach(e=>{if(!a.existsSync(e)){try{const t=i.dirname(e);a.mkdirSync(t,{recursive:!0})}catch(e){}a.writeFileSync(e,"","utf8")}})};e.exports={createStreamLogManager:({onLog:e,onGetLogFiles:t})=>{const n={},i=e=>{if(c.info("log stream: destroy",{name:e}),!n[e])return;const t=n[e];try{t.clearTails(),delete n[e]}catch(t){c.error("log stream: remove ref error ",t),delete n[e]}};return{add:async(a,s,l)=>{c.info("log stream: add",{name:a});const u=(e=>(n[e]||(n[e]=new d),n[e]))(a);try{const n=await t(a),{recent:p=100}=n,d=o(n,r),f=await u.setFiles(d);if(c.info("log stream: added",{name:a,logFiles:d}),u.getRecent(p,(e,t,n)=>{e&&c.error("log stream error ",e),l&&l(t,n,d)}),f){const t=u.ensureTails();Object.entries(t).forEach(([t,n])=>{n.on("line",n=>{e({topic:s,level:t,logFiles:d,data:n})}),n.on("error",e=>{c.error("log tail error ",{error:e}),i(a)})})}}catch(e){c.error("log stream error ",e)}},destroy:i}},getLogFiles:async({name:e,node:t})=>{const n=new Date,{yyyy:r,mm:o,dd:a}={yyyy:n.getFullYear(),mm:(""+(n.getMonth()+1)).padStart(2,0),dd:(""+n.getDate()).padStart(2,0)},s=`${r}-${o}-${a}`;if("abtnode"===e){const e=i.join(t.dataDirs.logs,"_abtnode"),n=i.join(e,`daemon-${s}.log`),r=i.join(e,`daemon-error-${s}.log`),o=i.join(e,"access.log"),a=i.join(e,"daemon.stdout.log"),l=i.join(e,"daemon.stderr.log");return f({info:n,error:r,access:o,stdout:a,stderr:l}),{info:n,error:r,access:o,stdout:a,stderr:l}}if("blocklet-services"===e){const e=i.join(t.dataDirs.logs,"_abtnode"),n=i.join(e,"service.log"),r=i.join(e,"service.error.log");return f({info:n,error:r}),{info:n,error:r}}if(0===e.indexOf("blocklet-")){const n=e.substring("blocklet-".length),r=await t.getBlocklet({did:n,attachConfig:!1}),{name:o}=r.meta,a=i.join(t.dataDirs.logs,o),l=i.join(a,`info-${s}.log`),u=i.join(a,`info-error-${s}.log`),c=i.join(a,"access.log"),d=i.join(a,"output.log"),h=i.join(a,"error.log");return f({info:l,error:u,access:c,stdout:d,stderr:h}),{info:l,error:u,access:c,stdout:d,stderr:h,recent:r.mode===p.DEVELOPMENT?0:100}}if(e.startsWith("service-gateway-")){const n=e.substring("service-gateway-".length),r=t.getRouterProvider(n);return r?r.getLogFilesForToday(i.join(t.dataDirs.router,n)):(c.error("router engine is empty",{name:e,providerName:n}),{})}return{}}}},function(e,t,n){let r=n(24),o=n(17),i=n(9);class a{info(){}error(){}}class s extends r.EventEmitter{constructor(e,t={}){super(),this.filename=e,this.absPath=i.dirname(this.filename),this.separator=void 0!==t.separator?t.separator:/[\r]{0,1}\n/,this.fsWatchOptions=t.fsWatchOptions||{},this.follow=null==t.follow||t.follow,this.logger=t.logger||new a,this.useWatchFile=t.useWatchFile||!1,this.flushAtEOF=t.flushAtEOF||!1,this.encoding=t.encoding||"utf-8";const n=t.fromBeginning||!1;this.nLines=t.nLines||void 0,this.logger.info("Tail starting..."),this.logger.info("filename: "+this.filename),this.logger.info("encoding: "+this.encoding);try{o.accessSync(this.filename,o.constants.F_OK)}catch(e){if("ENOENT"==e.code)throw e}let s;if(this.buffer="",this.internalDispatcher=new r.EventEmitter,this.queue=[],this.isWatching=!1,this.pos=0,this.internalDispatcher.on("next",()=>{this.readBlock()}),this.logger.info("fromBeginning: "+n),n)s=0;else if(void 0!==this.nLines){const e=o.readFileSync(this.filename,{flag:"r",encoding:this.encoding}),t=e.split(this.separator),n=""===t[t.length-1]?1:0;if(t.length-this.nLines-n<=0)s=0;else{const r=e.match(new RegExp(`(?:[^\r\n]*[\r]{0,1}\n){${t.length-this.nLines-n}}`));s=r&&r.length?Buffer.byteLength(r[0],this.encoding):this.latestPosition()}}else s=this.latestPosition();if(void 0===s)throw new Error("Tail can't initialize.");const l=n||null!=this.nLines;try{this.watch(s,l)}catch(e){this.logger.error(`watch for ${this.filename} failed: ${e}`),this.emit("error",`watch for ${this.filename} failed: ${e}`)}}latestPosition(){try{return o.statSync(this.filename).size}catch(e){throw this.logger.error(`size check for ${this.filename} failed: ${e}`),this.emit("error",`size check for ${this.filename} failed: ${e}`),e}}readBlock(){if(this.queue.length>=1){const e=this.queue[0];if(e.end>e.start){let t=o.createReadStream(this.filename,{start:e.start,end:e.end-1,encoding:this.encoding});t.on("error",e=>{this.logger.error("Tail error: "+e),this.emit("error",e)}),t.on("end",()=>{this.queue.shift();this.queue.length>0&&this.internalDispatcher.emit("next"),this.flushAtEOF&&this.buffer.length>0&&(this.emit("line",this.buffer),this.buffer="")}),t.on("data",e=>{if(null===this.separator)this.emit("line",e);else{this.buffer+=e;let t=this.buffer.split(this.separator);this.buffer=t.pop();for(const e of t)this.emit("line",e)}})}}}change(){let e=this.latestPosition();e<this.currentCursorPos?this.currentCursorPos=e:e>this.currentCursorPos&&(this.queue.push({start:this.currentCursorPos,end:e}),this.currentCursorPos=e,1==this.queue.length&&this.internalDispatcher.emit("next"))}watch(e,t){this.isWatching||(this.logger.info("filesystem.watch present? "+(null!=o.watch)),this.logger.info("useWatchFile: "+this.useWatchFile),this.isWatching=!0,this.currentCursorPos=e,t&&this.change(),!this.useWatchFile&&o.watch?(this.logger.info("watch strategy: watch"),this.watcher=o.watch(this.filename,this.fsWatchOptions,(e,t)=>{this.watchEvent(e,t)})):(this.logger.info("watch strategy: watchFile"),o.watchFile(this.filename,this.fsWatchOptions,(e,t)=>{this.watchFileEvent(e,t)})))}rename(e){void 0!==e&&e===this.filename||(this.unwatch(),this.follow?(this.filename=i.join(this.absPath,e),this.rewatchId=setTimeout(()=>{try{this.watch(this.currentCursorPos)}catch(e){this.logger.error(`'rename' event for ${this.filename}. File not available anymore.`),this.emit("error",e)}},1e3)):(this.logger.error(`'rename' event for ${this.filename}. File not available anymore.`),this.emit("error",`'rename' event for ${this.filename}. File not available anymore.`)))}watchEvent(e,t){try{"change"===e?this.change():"rename"===e&&this.rename(t)}catch(e){this.logger.error(`watchEvent for ${this.filename} failed: ${e}`),this.emit("error",`watchEvent for ${this.filename} failed: ${e}`)}}watchFileEvent(e,t){e.size>t.size&&(this.currentCursorPos=e.size,this.queue.push({start:t.size,end:e.size}),1==this.queue.length&&this.internalDispatcher.emit("next"))}unwatch(){this.watcher?this.watcher.close():o.unwatchFile(this.filename),this.rewatchId&&(clearTimeout(this.rewatchId),this.rewatchId=void 0),this.isWatching=!1,this.queue=[],this.logger&&this.logger.info("Unwatch "+this.filename)}}t.Tail=s},function(e,t,n){"use strict";var r=n(1466);e.exports={read:function(e,t,n){var o=["\n"];null==n&&(n="utf8");return new Promise((function(i,a){var s={stat:null,file:null};r.exists(e).then((function(e){if(!e)throw new Error("file does not exist")})).then((function(){var t=[r.stat(e).then((function(e){return s.stat=e})),r.open(e,"r").then((function(e){return s.file=e}))];return Promise.all(t)})).then((function(){var e=0,a=0,l="",u=function(){return l.length>s.stat.size&&(l=l.substring(l.length-s.stat.size)),l.length>=s.stat.size||a>=t?(o.includes(l.substring(0,1))&&(l=l.substring(1)),r.close(s.file),i("buffer"===n?Buffer.from(l,"binary"):Buffer.from(l,"binary").toString(n))):function(e,t,n){return r.read(t,Buffer.alloc(1),0,1,e.size-1-n).then((function(e){return String.fromCharCode(e[1][0])}))}(s.stat,s.file,e).then((function(t){l=t+l,o.includes(t)&&1<l.length&&a++,e++})).then(u)};return u()})).catch((function(e){return null!==s.file&&r.close(s.file).catch((function(){})),a(e)}))}))}}},function(e,t,n){var r,o=n(724);try{r=n(48)}catch(e){r=n(17)}var i=["appendFile","chmod","chown","close","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","link","lstat","mkdir","open","read","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","write","writeFile"];"function"==typeof r.access&&i.push("access"),"function"==typeof r.copyFile&&i.push("copyFile"),"function"==typeof r.mkdtemp&&i.push("mkdtemp"),n(1470).withCallback(r,t,i),t.exists=function(e,t){return"function"==typeof t?r.stat(e,(function(e){t(null,!e)})):new o((function(t){r.stat(e,(function(e){t(!e)}))}))}},function(e,t,n){"use strict";function r(e){var t=null;if(function(e){if(e)return"global.Promise"===e;if(void 0!==global.Promise){var t=/v(\d+)\.(\d+)\.(\d+)/.exec(process.version);return!(t&&0==+t[1]&&+t[2]<12)}return!1}(e))t={Promise:global.Promise,implementation:"global.Promise"};else if(e){var o=n(1469)(e);t={Promise:o.Promise||o,implementation:e}}else t=function(){for(var e=["es6-promise","promise","native-promise-only","bluebird","rsvp","when","q","pinkie","lie","vow"],t=0,n=e.length;t<n;t++)try{return r(e[t])}catch(e){}return null}();if(null===t)throw new Error('Cannot find any-promise implementation nor global.Promise. You must install polyfill or call require("any-promise/register") with your preferred implementation, e.g. require("any-promise/register/bluebird") on application load prior to any require("any-promise").');return t}e.exports=n(1468)(global,r)},function(e,t,n){"use strict";var r=null;e.exports=function(e,t){return function(n,o){n=n||null;var i=!1!==(o=o||{}).global;if(null===r&&i&&(r=e["@@any-promise/REGISTRATION"]||null),null!==r&&null!==n&&r.implementation!==n)throw new Error('any-promise already defined as "'+r.implementation+'". You can only register an implementation before the first call to require("any-promise") and an implementation cannot be changed');return null===r&&(r=null!==n&&void 0!==o.Promise?{Promise:o.Promise,implementation:n}:t(n),i&&(e["@@any-promise/REGISTRATION"]=r)),r}}},function(e,t){function n(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}n.keys=function(){return[]},n.resolve=n,e.exports=n,n.id=1469},function(e,t,n){var r=n(1471);function o(e,t,n){return i(e,t,n,r)}function i(e,t,n,r){return t||(t={},n=Object.keys(e)),Array.isArray(t)&&(n=t,t={}),n||(n=Object.keys(e)),"function"==typeof e&&(t=r(e)),n.forEach((function(n){"function"==typeof e[n]&&(t[n]=r(e[n]))})),Object.keys(e).forEach((function(n){(function(e,t){var n=Object.getOwnPropertyDescriptor(e,t);return!(!n||!n.get)&&"deprecated"===n.get.name})(e,n)||t[n]||(t[n]=e[n])})),t}e.exports=o,o.withCallback=function(e,t,n){return i(e,t,n,r.withCallback)},o.thenify=r},function(e,t,n){var r=n(724),o=n(116);function i(e,t){return o("function"==typeof e),s(e,t)}function a(e,t,n){return void 0===n&&(n=!0),function(r,o){if(r)return t(r);var i=arguments.length;if(i<=2||!n)return e(o);if(Array.isArray(n)){for(var a={},s=1;s<i;s++)a[n[s-1]]=arguments[s];return e(a)}for(a=new Array(i-1),s=1;s<i;++s)a[s-1]=arguments[s];e(a)}}function s(e,t){t=t||{};var n=e.name;n=(n||"").replace(/\s|bound(?!$)/g,"");var o=function(){var n=this,o=arguments.length;if(t.withCallback){var i=typeof arguments[o-1];if("function"===i)return e.apply(n,arguments)}for(var s=new Array(o+1),l=0;l<o;++l)s[l]=arguments[l];var u=l;return new r((function(r,o){s[u]=a(r,o,t.multiArgs),e.apply(n,s)}))};return Object.defineProperty(o,"name",{value:n}),o}e.exports=i,i.withCallback=function(e,t){return o("function"==typeof e),(t=t||{}).withCallback=!0,s(e,t)}},function(e,t,n){function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const{messages:o}=n(44),{authenticateByVc:i,getAuthVcClaim:a}=n(125),s=n(87),l=n(40)(n(91).name),{createSessionToken:u}=n(124);e.exports=function(e){return{action:"login",onConnect:async({userDid:t,extraParams:n})=>{const{locale:r}=n;if(!1===await e.isInitialized())throw new Error(o.notInitialized[r]);const i=await e.getNodeInfo();if(!await e.getUser({teamDid:i.did,user:{did:t}}))throw new Error(o.notAllowed[r]);return{verifiableCredential:a(e)}},onAuth:async({claims:t,challenge:n,userDid:o,userPk:a,updateSession:p,extraParams:c,req:d})=>{const{locale:f}=c,{role:h,teamDid:g,passport:m}=await i({node:e,locale:f,userDid:o,claims:t,challenge:n});try{const t=await e.updateUser({teamDid:g,user:{did:o,pk:a,locale:f,lastLoginAt:(new Date).toISOString()}});await e.createAuditLog({action:"login",args:{teamDid:g,userDid:o,passport:m},context:s(r(d,{user:t})),result:t},e);const n=await u(o,{passport:m,role:h});await p({sessionToken:n},!0),l.info("login.success",{userDid:o})}catch(e){throw l.error("login.error",{error:e,userDid:o}),new Error(e.message)}}}}},function(e,t,n){function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{messages:s}=n(44),l=n(87);e.exports=function(e){return{action:"switch-profile",onConnect:async({userDid:t,extraParams:{locale:n,connectedDid:r}})=>{if(t&&r&&t!==r)throw new Error(s.userMismatch[n]);const o=await e.getNodeInfo(),i=await e.getUser({teamDid:o.did,user:{did:t}});if(!i)throw new Error(s.notAllowed[n]);if(!i.approved)throw new Error(s.notAuthorized[n]);return{profile:{fields:["fullName","email","avatar"],description:s.requestProfile[n]}}},onAuth:async({claims:t,userDid:n,extraParams:{locale:o},req:a})=>{const u=await e.getNodeInfo(),p=await e.getUser({teamDid:u.did,user:{did:n}});if(!p)throw new Error(s.notAllowed[o]);if(!p.approved)throw new Error(s.notAuthorized[o]);const c=t.find(e=>"profile"===e.type),d=await e.updateUser({teamDid:u.did,user:i(i(i({},p),c),{},{locale:o})});await e.createAuditLog({action:"switchProfile",args:{teamDid:u.did,userDid:n,profile:c},context:l(r(a,{user:p})),result:d},e)}}}},function(e,t,n){function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}const{messages:o}=n(44),{getAuthVcClaim:i,authenticateByVc:a}=n(125),s=n(87),{createSessionToken:l}=n(124);e.exports=function(e){return{action:"switch-passport",onConnect:async({userDid:t,extraParams:{locale:n,connectedDid:r}})=>{if(t&&r&&t!==r)throw new Error(o.userMismatch[n]);const a=await e.getNodeInfo(),s=await e.getUser({teamDid:a.did,user:{did:t}});if(!s)throw new Error(o.notAllowed[n]);if(!s.approved)throw new Error(o.notAuthorized[n]);return{verifiableCredential:i(e)}},onAuth:async({claims:t,challenge:n,userDid:o,updateSession:i,extraParams:u,req:p})=>{const{locale:c}=u,{role:d,passport:f}=await a({node:e,locale:c,userDid:o,claims:t,challenge:n}),h=await e.getNodeInfo(),g=await e.getUser({teamDid:h.did,user:{did:o}});await e.createAuditLog({action:"switchPassport",args:{teamDid:h.did,userDid:o,passport:f},context:s(r(p,{user:g})),result:{}},e);const m=await l(o,{passport:f,role:d});await i({sessionToken:m},!0)}}}},function(e,t,n){function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{ROLES:s,VC_TYPE_NODE_PASSPORT:l}=n(25),u=n(361),p=n(725),c=n(87),{createPassport:d,createPassportVC:f,createUserPassport:h}=n(147),g=n(235),m=n(346),{messages:y,checkWalletVersion:v,getPassportStatusEndpoint:b}=n(44),_=n(40)(n(91).name),{createSessionToken:T}=n(124);e.exports=function(e){return{action:"connect-owner",onConnect:()=>({profile:async({extraParams:{locale:t}})=>{const n=await e.getNodeInfo();if(n.ownerNft&&n.ownerNft.holder&&n.ownerNft.issuer)throw new Error(y.requestOwnershipNft[t]);return{fields:["fullName","email","avatar"],description:y.requestProfile[t]}},signature:async({extraParams:{locale:t},context:{didwallet:n}})=>{v({didwallet:n,locale:t});const r=await e.getNodeInfo(),o=await d({name:s.OWNER,node:e,teamDid:r.did,locale:t}),i=r.name;return{description:y.receivePassport[t],data:p(),type:"mime:text/plain",display:JSON.stringify({type:"svg",content:g({title:o.title,issuer:i,issuerDid:r.did,ownerName:"Your Name",preferredColor:"default"})})}}}),onAuth:async({claims:t,userDid:n,userPk:o,updateSession:a,extraParams:{locale:p},req:g,baseUrl:y})=>{const v=t.find(e=>"profile"===e.type),E=await e.getNodeInfo(),S=E.did,x=t.find(e=>"signature"===e.type);_.info("claim.signature.onAuth",{userPk:o,userDid:n,claim:x}),m(x,n,o,p),await e.updateNodeOwner({nodeOwner:{did:n,pk:o}}),_.info("connect owner to node",{userDid:n});const w=f({issuerName:E.name,issuerWallet:u(E.sk),ownerDid:n,passport:await d({name:s.OWNER,node:e,teamDid:S,locale:p,endpoint:y}),endpoint:b({baseUrl:y,userDid:n,teamDid:S}),types:[l],tag:E.did,ownerProfile:v}),A=s.OWNER,k=h(w,{role:A}),M=await e.addUser({teamDid:S,user:i(i({},v),{},{did:n,pk:o,passports:[k],approved:!0,locale:p,firstLoginAt:(new Date).toISOString(),lastLoginAt:(new Date).toISOString()})});await e.createAuditLog({action:"addUser",args:{teamDid:S,userDid:n,reason:"claim server"},context:c(r(g,{user:M})),result:M},e);const O=await T(n,{passport:k,role:A});return await a({sessionToken:O},!0),{disposition:"attachment",type:"VerifiableCredential",data:w}}}}},function(e,t,n){const{messages:r}=n(44),{onAddNodeOwnerAuth:o,getProfileClaim:i,getAssetProfile:a}=n(726);e.exports=function(e){return{action:"verify-owner",onConnect:()=>({asset:a(e),profile:async({extraParams:{locale:t}})=>{if(await e.isInitialized())throw new Error(r.alreadyInitiated[t]);return i(t)}}),onAuth:async({claims:t,userDid:n,userPk:i,challenge:a,updateSession:s,extraParams:{locale:l},req:u,baseUrl:p})=>{if(await e.isInitialized())throw new Error(r.alreadyInitiated[l]);return o({node:e,req:u,claims:t,userDid:n,userPk:i,challenge:a,updateSession:s,locale:l,baseUrl:p})}}}},function(e,t,n){const{onAddNodeOwnerAuth:r,getProfileClaim:o,getAssetProfile:i}=n(726);e.exports=function(e){return{action:"accept-server",onConnect:()=>({asset:i(e),profile:({extraParams:{locale:e}})=>o(e)}),onAuth:async({claims:t,userDid:n,userPk:o,challenge:i,updateSession:a,extraParams:{locale:s},req:l,baseUrl:u})=>r({action:"accept-server",node:e,req:l,claims:t,userDid:n,userPk:o,challenge:i,locale:s,baseUrl:u,updateSession:a})}}},function(e,t,n){function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const a=n(27),{isFreeBlocklet:s}=n(104),{BlockletEvents:l}=n(100),{VC_TYPE_BLOCKLET_PURCHASE:u}=n(25),{messages:p,getVCFromClaims:c}=n(44),d=n(40)(n(91).name),{getBlockletUrl:f}=n(1479),h=o(o({},p),{},{requestCredential:{en:"Please provide blocklet purchase NFT",zh:"请提供 Blocklet 购买凭证 NFT"},missingCredentialClaim:{en:"Blocklet purchase NFT not provided",zh:"请提供 Blocklet 购买凭证 NFT"},missingChallenge:{en:"Purchase NFT presentation does not include valid challenge",zh:"购买 NFT 中缺少正确的随机因子"},invalidCredentialType:{en:"Invalid blocklet purchase NFT type, expect "+u,zh:"无效的 Blocklet 购买凭证 NFT 类型,必须是 "+u},blockletDidNotMatch:{en:"This NFT is for another blocklet",zh:"购买凭证和要安装的 Blocklet 不匹配"},invalidCredentialProof:{en:"Invalid blocklet purchase NFT signature proof",zh:"无效的购买凭证签名"},purchaseNotRequired:{en:"This blocklet is free and does not require any purchase",zh:"该 Blocklet 可免费安装,不需要购买"},alreadyInstalled:{en:"This blocklet is already installed on this server",zh:"该 Blocklet 已经安装,不需要购买"},rootBlockletNotInstalled:{en:"The blocklet cannot be mounted to a blocklet that is not installed",zh:"该 Blocklet 无法挂载到未安装的 Blocklet"},sessionNotFound:{en:"Purchase session not found",zh:"购买会话不存在"}}),g=e=>[e],m=[u];e.exports=function(e){const{node:t}=e.states;return{action:"verify-purchase",claims:{verifiableCredential:async({extraParams:{locale:t,sid:n}})=>{const r=await e.getSession({id:n});if(!r)throw new Error(h.sessionNotFound[t]);let o,i,a;if("component"===r.type){let n;if([n,i,a]=await Promise.all([e.getBlocklet({did:r.rootDid,attachConfig:!1}),e.getBlockletMetaFromUrl({url:r.url}),e.getRegistryMeta(new URL(r.url).origin)]),!n)throw new Error(h.rootBlockletNotInstalled[t]);o=n.children.find(e=>e.meta.did===i.meta.did)}else[o,i,a]=await Promise.all([e.getBlocklet({did:r.blockletDid,attachConfig:!1}),e.getBlockletMetaFromUrl({url:f(r.registryUrl,r.blockletDid)}),e.getRegistryMeta(r.registryUrl)]);if(o)throw new Error(h.alreadyInstalled[t]);if(!0===s(i.meta))throw new Error(h.purchaseNotRequired[t]);return{description:h.requestCredential[t],item:m,trustedIssuers:g(a.id),tag:i.meta.did}}},onError:async({err:n,extraParams:{sid:r}})=>{const o=await e.updateSession({id:r,data:{status:"error",message:n.message}});t.emit(l.purchaseChange,{did:o.blockletDid,session:o}),d.error("emit blocklet purchase error event",o)},onDecline:async({extraParams:{sid:n}})=>{const r=await e.updateSession({id:n,data:{status:"declined"}});t.emit(l.purchaseChange,{did:r.blockletDid,session:r}),d.info("emit blocklet purchase decline event",r)},onAuth:async({userDid:n,claims:r,challenge:o,extraParams:{sid:i,locale:s}})=>{const u=await e.getSession({id:i});if(!u)throw new Error(h.sessionNotFound[s]);let p;p="component"===u.type?await e.getRegistryMeta(new URL(u.url).origin):await e.getRegistryMeta(u.registryUrl);const f=g(p.id),{vc:y}=await c({claims:r,challenge:o,trustedIssuers:f,vcTypes:m,locale:s});if(!y)throw new Error(h.missingCredentialClaim[s]);const v=a(y,"credentialSubject.purchased.blocklet")||a(y,"credentialSubject.purchased.blocklets");if(!(Array.isArray(v)?v:[v]).find(e=>e.id===u.blockletDid))throw new Error(h.blockletDidNotMatch[s]);const b=await e.updateSession({id:i,data:{status:"confirmed"}});t.emit(l.purchaseChange,{did:u.blockletDid,session:b}),d.info("emit blocklet purchase confirm event",b);const _={user:{did:n},blockletPurchaseVerified:!0};let T,E;if("component"===u.type){T=e.installComponent.bind(e);const{rootDid:t,mountPoint:n,url:r,name:o,did:i,title:a}=u;E={rootDid:t,mountPoint:n,url:r,name:o,did:i,title:a}}else T=e.installBlocklet.bind(e),E={did:u.blockletDid};T(E,_).then(()=>{d.info("install blocklet after verify purchase nft",u)}).catch(e=>{d.error("install blocklet after verify purchase nft failed",{session:u,err:e})})}}}},function(e,t,n){const r=n(112);e.exports={getBlockletUrl:(e,t)=>r(e,`/api/blocklets/${t}/blocklet.json`)}},function(e,t,n){const{createIssuePassportRequest:r,handleIssuePassportResponse:o,checkWalletVersion:i,beforeIssuePassportRequest:a}=n(44);e.exports=function(e){return{action:"issue-passport",onStart:async({extraParams:t})=>{const{locale:n="en",id:r}=t,o=(await e.getNodeInfo()).did;await a({node:e,teamDid:o,locale:n,id:r})},claims:{signature:async({extraParams:t,context:{didwallet:n}})=>{const{id:o,locale:a}=t;i({didwallet:n,locale:a});const s=await e.getNodeInfo(),l=s.did;return r({node:e,nodeInfo:s,teamDid:l,id:o,locale:a})}},onAuth:async({userDid:t,userPk:n,claims:r,extraParams:i,updateSession:a,req:s,baseUrl:l})=>{const{locale:u,id:p}=i,c=await e.getNodeInfo(),d=c.did;return o({req:s,node:e,nodeInfo:c,teamDid:d,userDid:t,userPk:n,id:p,locale:u,claims:r,statusEndpointBaseUrl:l,updateSession:a,endpoint:l})}}}},function(e,t,n){const{createLostPassportListRoute:r}=n(727);e.exports=function(e){return r({node:e,type:"node"})}},function(e,t,n){const{createLostPassportIssueRoute:r,TEAM_TYPES:o}=n(727);e.exports=function(e){return r({node:e,type:o.NODE})}},function(e,t,n){const{createInvitationRequest:r,handleInvitationResponse:o,messages:i,checkWalletVersion:a,beforeInvitationRequest:s}=n(44),{get:l}=n(1484),u=n(40)(n(91).name),{createSessionToken:p}=n(124);e.exports=function(e){return{action:"invite",onStart:async({extraParams:t})=>{const{locale:n="en",inviteId:r}=t,o=(await e.getNodeInfo()).did;await s({node:e,teamDid:o,locale:n,inviteId:r})},claims:{profile:async({userDid:t,extraParams:n})=>{const r=await e.getNodeInfo(),{locale:o,inviteId:a}=n;if("owner"===(await e.getInvitation({teamDid:r.did,inviteId:a})).role&&t===r.nodeOwner.did)throw new Error(i.notAllowedTransferToSelf[o]);if(!1===await e.isInitialized())throw new Error(i.notInitialized[o]);return{fields:["fullName","email","avatar"],description:i.description[o]}},signature:async({extraParams:t,context:{didwallet:n}})=>{const{locale:o,inviteId:i}=t;a({didwallet:n,locale:o});const s=await e.getNodeInfo(),l=s.did;return r({node:e,nodeInfo:s,teamDid:l,inviteId:i,locale:o})}},onAuth:async({claims:t,userDid:n,userPk:r,updateSession:i,extraParams:a,req:s,baseUrl:c})=>{const{locale:d,inviteId:f,previousWorkflowData:h}=a,g=await e.getNodeInfo(),m=g.did,y=c,v=c,{passport:b,response:_,role:T}=await o({req:s,node:e,nodeInfo:g,teamDid:m,userDid:n,userPk:r,inviteId:f,locale:d,claims:t,statusEndpointBaseUrl:y,endpoint:v,newNftOwner:l(h,"userDid")}),E=await p(n,{passport:b,role:T});return await i({sessionToken:E},!0),await i({passportId:_.data.id}),u.info("invite.success",{userDid:n}),_}}}},function(e,t,n){(function(e){var r;
|
|
722
722
|
/**
|
|
723
723
|
* @license
|
|
724
724
|
* Lodash <https://lodash.com/>
|