mirror of https://github.com/abpframework/eventhub
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
456 KiB
11 lines
456 KiB
/*! For license information please see AuthenticationService.js.LICENSE.txt */
|
|
(()=>{var t={671:function(n){var t;t=function(){return function(n){function t(r){if(i[r])return i[r].exports;var u=i[r]={i:r,l:!1,exports:{}};return n[r].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var i={};return t.m=n,t.c=i,t.d=function(n,i,r){t.o(n,i)||Object.defineProperty(n,i,{enumerable:!0,get:r})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,i){var r,u;if((1&i&&(n=t(n)),8&i)||4&i&&"object"==typeof n&&n&&n.__esModule)return n;if(r=Object.create(null),t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),2&i&&"string"!=typeof n)for(u in n)t.d(r,u,function(t){return n[t]}.bind(null,u));return r},t.n=function(n){var i=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(i,"a",i),i},t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},t.p="",t(t.s=22)}([function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),f={debug:function(){},info:function(){},warn:function(){},error:function(){}},i=void 0,r=void 0;(t.Log=function(){function n(){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n)}return n.reset=function(){r=3;i=f},n.debug=function(){if(r>=4){for(var t=arguments.length,u=Array(t),n=0;n<t;n++)u[n]=arguments[n];i.debug.apply(i,Array.from(u))}},n.info=function(){if(r>=3){for(var t=arguments.length,u=Array(t),n=0;n<t;n++)u[n]=arguments[n];i.info.apply(i,Array.from(u))}},n.warn=function(){if(r>=2){for(var t=arguments.length,u=Array(t),n=0;n<t;n++)u[n]=arguments[n];i.warn.apply(i,Array.from(u))}},n.error=function(){if(r>=1){for(var t=arguments.length,u=Array(t),n=0;n<t;n++)u[n]=arguments[n];i.error.apply(i,Array.from(u))}},u(n,null,[{key:"NONE",get:function(){return 0}},{key:"ERROR",get:function(){return 1}},{key:"WARN",get:function(){return 2}},{key:"INFO",get:function(){return 3}},{key:"DEBUG",get:function(){return 4}},{key:"level",get:function(){return r},set:function(n){if(!(0<=n&&n<=4))throw new Error("Invalid log level");r=n}},{key:"logger",get:function(){return i},set:function(n){if(!n.debug&&n.info&&(n.debug=n.info),!(n.debug&&n.info&&n.warn&&n.error))throw new Error("Invalid logger");i=n}}]),n}()).reset()},function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),f={setInterval:function(n){function t(){return n.apply(this,arguments)}return t.toString=function(){return n.toString()},t}(function(n,t){return setInterval(n,t)}),clearInterval:function(n){function t(){return n.apply(this,arguments)}return t.toString=function(){return n.toString()},t}(function(n){return clearInterval(n)})},i=!1,r=null;t.Global=function(){function n(){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n)}return n._testing=function(){i=!0},n.setXMLHttpRequest=function(n){r=n},u(n,null,[{key:"location",get:function(){if(!i)return location}},{key:"localStorage",get:function(){if(!i&&"undefined"!=typeof window)return localStorage}},{key:"sessionStorage",get:function(){if(!i&&"undefined"!=typeof window)return sessionStorage}},{key:"XMLHttpRequest",get:function(){if(!i&&"undefined"!=typeof window)return r||XMLHttpRequest}},{key:"timer",get:function(){if(!i)return f}}]),n}()},function(n,t,i){"use strict";function o(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}var u;Object.defineProperty(t,"__esModule",{value:!0});t.MetadataService=void 0;var f=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),r=i(0),e=i(7);u=".well-known/openid-configuration";t.MetadataService=function(){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.JsonService;if(o(this,n),!t)throw r.Log.error("MetadataService: No settings passed to MetadataService"),new Error("settings");this._settings=t;this._jsonService=new i(["application/jwk-set+json"])}return n.prototype.resetSigningKeys=function(){this._settings=this._settings||{};this._settings.signingKeys=void 0},n.prototype.getMetadata=function(){var n=this;return this._settings.metadata?(r.Log.debug("MetadataService.getMetadata: Returning metadata from settings"),Promise.resolve(this._settings.metadata)):this.metadataUrl?(r.Log.debug("MetadataService.getMetadata: getting metadata from",this.metadataUrl),this._jsonService.getJson(this.metadataUrl).then(function(t){r.Log.debug("MetadataService.getMetadata: json received");var i=n._settings.metadataSeed||{};return n._settings.metadata=Object.assign({},i,t),n._settings.metadata})):(r.Log.error("MetadataService.getMetadata: No authority or metadataUrl configured on settings"),Promise.reject(new Error("No authority or metadataUrl configured on settings")))},n.prototype.getIssuer=function(){return this._getMetadataProperty("issuer")},n.prototype.getAuthorizationEndpoint=function(){return this._getMetadataProperty("authorization_endpoint")},n.prototype.getUserInfoEndpoint=function(){return this._getMetadataProperty("userinfo_endpoint")},n.prototype.getTokenEndpoint=function(){var n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._getMetadataProperty("token_endpoint",n)},n.prototype.getCheckSessionIframe=function(){return this._getMetadataProperty("check_session_iframe",!0)},n.prototype.getEndSessionEndpoint=function(){return this._getMetadataProperty("end_session_endpoint",!0)},n.prototype.getRevocationEndpoint=function(){return this._getMetadataProperty("revocation_endpoint",!0)},n.prototype.getKeysEndpoint=function(){return this._getMetadataProperty("jwks_uri",!0)},n.prototype._getMetadataProperty=function(n){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return r.Log.debug("MetadataService.getMetadataProperty for: "+n),this.getMetadata().then(function(i){if(r.Log.debug("MetadataService.getMetadataProperty: metadata recieved"),void 0===i[n]){if(!0===t)return void r.Log.warn("MetadataService.getMetadataProperty: Metadata does not contain optional property "+n);throw r.Log.error("MetadataService.getMetadataProperty: Metadata does not contain property "+n),new Error("Metadata does not contain property "+n);}return i[n]})},n.prototype.getSigningKeys=function(){var n=this;return this._settings.signingKeys?(r.Log.debug("MetadataService.getSigningKeys: Returning signingKeys from settings"),Promise.resolve(this._settings.signingKeys)):this._getMetadataProperty("jwks_uri").then(function(t){return r.Log.debug("MetadataService.getSigningKeys: jwks_uri received",t),n._jsonService.getJson(t).then(function(t){if(r.Log.debug("MetadataService.getSigningKeys: key set received",t),!t.keys)throw r.Log.error("MetadataService.getSigningKeys: Missing keys on keyset"),new Error("Missing keys on keyset");return n._settings.signingKeys=t.keys,n._settings.signingKeys})})},f(n,[{key:"metadataUrl",get:function(){return this._metadataUrl||(this._settings.metadataUrl?this._metadataUrl=this._settings.metadataUrl:(this._metadataUrl=this._settings.authority,this._metadataUrl&&this._metadataUrl.indexOf(u)<0&&("/"!==this._metadataUrl[this._metadataUrl.length-1]&&(this._metadataUrl+="/"),this._metadataUrl+=u))),this._metadataUrl}}]),n}()},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.UrlUtility=void 0;var r=i(0),u=i(1);t.UrlUtility=function(){function n(){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n)}return n.addQueryParam=function(n,t,i){return n.indexOf("?")<0&&(n+="?"),"?"!==n[n.length-1]&&(n+="&"),n+=encodeURIComponent(t),(n+="=")+encodeURIComponent(i)},n.parseUrlFragment=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.Global,t,c;"string"!=typeof n&&(n=o.location.href);t=n.lastIndexOf(e);t>=0&&(n=n.substr(t+1));"?"===e&&(t=n.indexOf("#"))>=0&&(n=n.substr(0,t));for(var i,f={},s=/([^&=]+)=([^&]*)/g,h=0;i=s.exec(n);)if(f[decodeURIComponent(i[1])]=decodeURIComponent(i[2].replace(/\+/g," ")),h++>50)return r.Log.error("UrlUtility.parseUrlFragment: response exceeded expected number of parameters",n),{error:"Response exceeded expected number of parameters"};for(c in f)return f;return{}},n}()},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.JoseUtil=void 0;var r=i(26),u=function(n){return n&&n.__esModule?n:{"default":n}}(i(33));t.JoseUtil=u.default({jws:r.jws,KeyUtil:r.KeyUtil,X509:r.X509,crypto:r.crypto,hextob64u:r.hextob64u,b64tohex:r.b64tohex,AllowedSigningAlgs:r.AllowedSigningAlgs})},function(n,t,i){"use strict";function l(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}Object.defineProperty(t,"__esModule",{value:!0});t.OidcClientSettings=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},e=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),u=i(0),o=i(23),s=i(6),h=i(24),c=i(2);var f=".well-known/openid-configuration",a="id_token",v="openid",y="client_secret_post";t.OidcClientSettings=function(){function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},ot=t.authority,st=t.metadataUrl,ht=t.metadata,ct=t.signingKeys,lt=t.metadataSeed,at=t.client_id,vt=t.client_secret,f=t.response_type,yt=void 0===f?a:f,e=t.scope,pt=void 0===e?v:e,wt=t.redirect_uri,bt=t.post_logout_redirect_uri,p=t.client_authentication,kt=void 0===p?y:p,dt=t.prompt,gt=t.display,ni=t.max_age,ti=t.ui_locales,ii=t.acr_values,ri=t.resource,ui=t.response_mode,w=t.filterProtocolClaims,fi=void 0===w||w,b=t.loadUserInfo,ei=void 0===b||b,k=t.staleStateAge,oi=void 0===k?900:k,d=t.clockSkew,si=void 0===d?300:d,g=t.clockService,hi=void 0===g?new o.ClockService:g,nt=t.userInfoJwtIssuer,ci=void 0===nt?"OP":nt,tt=t.mergeClaims,li=void 0!==tt&&tt,it=t.stateStore,ai=void 0===it?new s.WebStorageStateStore:it,rt=t.ResponseValidatorCtor,vi=void 0===rt?h.ResponseValidator:rt,ut=t.MetadataServiceCtor,yi=void 0===ut?c.MetadataService:ut,ft=t.extraQueryParams,i=void 0===ft?{}:ft,et=t.extraTokenParams,u=void 0===et?{}:et;l(this,n);this._authority=ot;this._metadataUrl=st;this._metadata=ht;this._metadataSeed=lt;this._signingKeys=ct;this._client_id=at;this._client_secret=vt;this._response_type=yt;this._scope=pt;this._redirect_uri=wt;this._post_logout_redirect_uri=bt;this._client_authentication=kt;this._prompt=dt;this._display=gt;this._max_age=ni;this._ui_locales=ti;this._acr_values=ii;this._resource=ri;this._response_mode=ui;this._filterProtocolClaims=!!fi;this._loadUserInfo=!!ei;this._staleStateAge=oi;this._clockSkew=si;this._clockService=hi;this._userInfoJwtIssuer=ci;this._mergeClaims=!!li;this._stateStore=ai;this._validator=new vi(this);this._metadataService=new yi(this);this._extraQueryParams="object"===(void 0===i?"undefined":r(i))?i:{};this._extraTokenParams="object"===(void 0===u?"undefined":r(u))?u:{}}return n.prototype.getEpochTime=function(){return this._clockService.getEpochTime()},e(n,[{key:"client_id",get:function(){return this._client_id},set:function(n){if(this._client_id)throw u.Log.error("OidcClientSettings.set_client_id: client_id has already been assigned."),new Error("client_id has already been assigned.");this._client_id=n}},{key:"client_secret",get:function(){return this._client_secret}},{key:"response_type",get:function(){return this._response_type}},{key:"scope",get:function(){return this._scope}},{key:"redirect_uri",get:function(){return this._redirect_uri}},{key:"post_logout_redirect_uri",get:function(){return this._post_logout_redirect_uri}},{key:"client_authentication",get:function(){return this._client_authentication}},{key:"prompt",get:function(){return this._prompt}},{key:"display",get:function(){return this._display}},{key:"max_age",get:function(){return this._max_age}},{key:"ui_locales",get:function(){return this._ui_locales}},{key:"acr_values",get:function(){return this._acr_values}},{key:"resource",get:function(){return this._resource}},{key:"response_mode",get:function(){return this._response_mode}},{key:"authority",get:function(){return this._authority},set:function(n){if(this._authority)throw u.Log.error("OidcClientSettings.set_authority: authority has already been assigned."),new Error("authority has already been assigned.");this._authority=n}},{key:"metadataUrl",get:function(){return this._metadataUrl||(this._metadataUrl=this.authority,this._metadataUrl&&this._metadataUrl.indexOf(f)<0&&("/"!==this._metadataUrl[this._metadataUrl.length-1]&&(this._metadataUrl+="/"),this._metadataUrl+=f)),this._metadataUrl}},{key:"metadata",get:function(){return this._metadata},set:function(n){this._metadata=n}},{key:"metadataSeed",get:function(){return this._metadataSeed},set:function(n){this._metadataSeed=n}},{key:"signingKeys",get:function(){return this._signingKeys},set:function(n){this._signingKeys=n}},{key:"filterProtocolClaims",get:function(){return this._filterProtocolClaims}},{key:"loadUserInfo",get:function(){return this._loadUserInfo}},{key:"staleStateAge",get:function(){return this._staleStateAge}},{key:"clockSkew",get:function(){return this._clockSkew}},{key:"userInfoJwtIssuer",get:function(){return this._userInfoJwtIssuer}},{key:"mergeClaims",get:function(){return this._mergeClaims}},{key:"stateStore",get:function(){return this._stateStore}},{key:"validator",get:function(){return this._validator}},{key:"metadataService",get:function(){return this._metadataService}},{key:"extraQueryParams",get:function(){return this._extraQueryParams},set:function(n){this._extraQueryParams="object"===(void 0===n?"undefined":r(n))?n:{}}},{key:"extraTokenParams",get:function(){return this._extraTokenParams},set:function(n){this._extraTokenParams="object"===(void 0===n?"undefined":r(n))?n:{}}}]),n}()},function(n,t,i){"use strict";function f(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}Object.defineProperty(t,"__esModule",{value:!0});t.WebStorageStateStore=void 0;var r=i(0),u=i(1);t.WebStorageStateStore=function(){function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.prefix,e=void 0===i?"oidc.":i,r=t.store,o=void 0===r?u.Global.localStorage:r;f(this,n);this._store=o;this._prefix=e}return n.prototype.set=function(n,t){return r.Log.debug("WebStorageStateStore.set",n),n=this._prefix+n,this._store.setItem(n,t),Promise.resolve()},n.prototype.get=function(n){r.Log.debug("WebStorageStateStore.get",n);n=this._prefix+n;var t=this._store.getItem(n);return Promise.resolve(t)},n.prototype.remove=function(n){r.Log.debug("WebStorageStateStore.remove",n);n=this._prefix+n;var t=this._store.getItem(n);return this._store.removeItem(n),Promise.resolve(t)},n.prototype.getAllKeys=function(){var t,n,i;for(r.Log.debug("WebStorageStateStore.getAllKeys"),t=[],n=0;n<this._store.length;n++)i=this._store.key(n),0===i.indexOf(this._prefix)&&t.push(i.substr(this._prefix.length));return Promise.resolve(t)},n}()},function(n,t,i){"use strict";function f(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}Object.defineProperty(t,"__esModule",{value:!0});t.JsonService=void 0;var r=i(0),u=i(1);t.JsonService=function(){function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.Global.XMLHttpRequest,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;f(this,n);this._contentTypes=t&&Array.isArray(t)?t.slice():[];this._contentTypes.push("application/json");i&&this._contentTypes.push("application/jwt");this._XMLHttpRequest=r;this._jwtHandler=i}return n.prototype.getJson=function(n,t){var i=this;if(!n)throw r.Log.error("JsonService.getJson: No url passed"),new Error("url");return r.Log.debug("JsonService.getJson, url: ",n),new Promise(function(u,f){var e=new i._XMLHttpRequest,o,s;e.open("GET",n);o=i._contentTypes;s=i._jwtHandler;e.onload=function(){var t,i;if(r.Log.debug("JsonService.getJson: HTTP response received, status",e.status),200===e.status){if(t=e.getResponseHeader("Content-Type"),t){if(i=o.find(function(n){if(t.startsWith(n))return!0}),"application/jwt"==i)return void s(e).then(u,f);if(i)try{return void u(JSON.parse(e.responseText))}catch(n){return r.Log.error("JsonService.getJson: Error parsing JSON response",n.message),void f(n)}}f(Error("Invalid response Content-Type: "+t+", from URL: "+n))}else f(Error(e.statusText+" ("+e.status+")"))};e.onerror=function(){r.Log.error("JsonService.getJson: network error");f(Error("Network Error"))};t&&(r.Log.debug("JsonService.getJson: token passed, setting Authorization header"),e.setRequestHeader("Authorization","Bearer "+t));e.send()})},n.prototype.postForm=function(n,t,i){var u=this;if(!n)throw r.Log.error("JsonService.postForm: No url passed"),new Error("url");return r.Log.debug("JsonService.postForm, url: ",n),new Promise(function(f,e){var o=new u._XMLHttpRequest,h,s,c,l;o.open("POST",n);h=u._contentTypes;o.onload=function(){var t,i;if(r.Log.debug("JsonService.postForm: HTTP response received, status",o.status),200!==o.status){if(400===o.status&&(i=o.getResponseHeader("Content-Type"))&&h.find(function(n){if(i.startsWith(n))return!0}))try{if(t=JSON.parse(o.responseText),t&&t.error)return r.Log.error("JsonService.postForm: Error from server: ",t.error),void e(new Error(t.error))}catch(n){return r.Log.error("JsonService.postForm: Error parsing JSON response",n.message),void e(n)}e(Error(o.statusText+" ("+o.status+")"))}else{if((i=o.getResponseHeader("Content-Type"))&&h.find(function(n){if(i.startsWith(n))return!0}))try{return void f(JSON.parse(o.responseText))}catch(n){return r.Log.error("JsonService.postForm: Error parsing JSON response",n.message),void e(n)}e(Error("Invalid response Content-Type: "+i+", from URL: "+n))}};o.onerror=function(){r.Log.error("JsonService.postForm: network error");e(Error("Network Error"))};s="";for(c in t)l=t[c],l&&(s.length>0&&(s+="&"),s+=encodeURIComponent(c),s+="=",s+=encodeURIComponent(l));o.setRequestHeader("Content-Type","application/x-www-form-urlencoded");void 0!==i&&o.setRequestHeader("Authorization","Basic "+btoa(i));o.send(s)})},n}()},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.SigninRequest=void 0;var u=i(0),r=i(3),f=i(13);t.SigninRequest=function(){function n(t){var i=t.url,c=t.client_id,l=t.redirect_uri,e=t.response_type,a=t.scope,w=t.authority,k=t.data,d=t.prompt,g=t.display,nt=t.max_age,tt=t.ui_locales,it=t.id_token_hint,rt=t.login_hint,ut=t.acr_values,ft=t.resource,o=t.response_mode,et=t.request,ot=t.request_uri,b=t.extraQueryParams,st=t.request_type,ht=t.client_secret,ct=t.extraTokenParams,lt=t.skipUserInfo,v,y,s,h,p;if(function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n),!i)throw u.Log.error("SigninRequest.ctor: No url passed"),new Error("url");if(!c)throw u.Log.error("SigninRequest.ctor: No client_id passed"),new Error("client_id");if(!l)throw u.Log.error("SigninRequest.ctor: No redirect_uri passed"),new Error("redirect_uri");if(!e)throw u.Log.error("SigninRequest.ctor: No response_type passed"),new Error("response_type");if(!a)throw u.Log.error("SigninRequest.ctor: No scope passed"),new Error("scope");if(!w)throw u.Log.error("SigninRequest.ctor: No authority passed"),new Error("authority");v=n.isOidc(e);y=n.isCode(e);o||(o=n.isCode(e)?"query":null);this.state=new f.SigninState({nonce:v,data:k,client_id:c,authority:w,redirect_uri:l,code_verifier:y,request_type:st,response_mode:o,client_secret:ht,scope:a,extraTokenParams:ct,skipUserInfo:lt});i=r.UrlUtility.addQueryParam(i,"client_id",c);i=r.UrlUtility.addQueryParam(i,"redirect_uri",l);i=r.UrlUtility.addQueryParam(i,"response_type",e);i=r.UrlUtility.addQueryParam(i,"scope",a);i=r.UrlUtility.addQueryParam(i,"state",this.state.id);v&&(i=r.UrlUtility.addQueryParam(i,"nonce",this.state.nonce));y&&(i=r.UrlUtility.addQueryParam(i,"code_challenge",this.state.code_challenge),i=r.UrlUtility.addQueryParam(i,"code_challenge_method","S256"));s={prompt:d,display:g,max_age:nt,ui_locales:tt,id_token_hint:it,login_hint:rt,acr_values:ut,resource:ft,request:et,request_uri:ot,response_mode:o};for(h in s)s[h]&&(i=r.UrlUtility.addQueryParam(i,h,s[h]));for(p in b)i=r.UrlUtility.addQueryParam(i,p,b[p]);this.url=i}return n.isOidc=function(n){return!!n.split(/\s+/g).filter(function(n){return"id_token"===n})[0]},n.isOAuth=function(n){return!!n.split(/\s+/g).filter(function(n){return"token"===n})[0]},n.isCode=function(n){return!!n.split(/\s+/g).filter(function(n){return"code"===n})[0]},n}()},function(n,t,i){"use strict";function e(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}Object.defineProperty(t,"__esModule",{value:!0});t.State=void 0;var u=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),r=i(0),f=function(n){return n&&n.__esModule?n:{"default":n}}(i(14));t.State=function(){function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.id,u=t.data,i=t.created,o=t.request_type;e(this,n);this._id=r||f.default();this._data=u;this._created="number"==typeof i&&i>0?i:parseInt(Date.now()/1e3);this._request_type=o}return n.prototype.toStorageString=function(){return r.Log.debug("State.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})},n.fromStorageString=function(t){return r.Log.debug("State.fromStorageString"),new n(JSON.parse(t))},n.clearStaleState=function(t,i){var u=Date.now()/1e3-i;return t.getAllKeys().then(function(i){var o;r.Log.debug("State.clearStaleState: got keys",i);for(var f=[],s=function(e){var s=i[e];o=t.get(s).then(function(i){var f=!1,e;if(i)try{e=n.fromStorageString(i);r.Log.debug("State.clearStaleState: got item from key: ",s,e.created);e.created<=u&&(f=!0)}catch(n){r.Log.error("State.clearStaleState: Error parsing state for key",s,n.message);f=!0}else r.Log.debug("State.clearStaleState: no item in storage for key: ",s),f=!0;if(f)return r.Log.debug("State.clearStaleState: removed item for key: ",s),t.remove(s)});f.push(o)},e=0;e<i.length;e++)s(e);return r.Log.debug("State.clearStaleState: waiting on promise count:",f.length),Promise.all(f)})},u(n,[{key:"id",get:function(){return this._id}},{key:"data",get:function(){return this._data}},{key:"created",get:function(){return this._created}},{key:"request_type",get:function(){return this._request_type}}]),n}()},function(n,t,i){"use strict";function v(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}Object.defineProperty(t,"__esModule",{value:!0});t.OidcClient=void 0;var o=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),r=i(0),f=i(5),s=i(12),u=i(8),h=i(34),c=i(35),l=i(36),a=i(13),e=i(9);t.OidcClient=function(){function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};v(this,n);this._settings=t instanceof f.OidcClientSettings?t:new f.OidcClientSettings(t)}return n.prototype.createSigninRequest=function(){var p=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.response_type,i=n.scope,f=n.redirect_uri,d=n.data,g=n.state,e=n.prompt,o=n.display,s=n.max_age,h=n.ui_locales,nt=n.id_token_hint,tt=n.login_hint,c=n.acr_values,l=n.resource,it=n.request,rt=n.request_uri,a=n.response_mode,v=n.extraQueryParams,y=n.extraTokenParams,ut=n.request_type,ft=n.skipUserInfo,w=arguments[1],b,k;return r.Log.debug("OidcClient.createSigninRequest"),b=this._settings.client_id,t=t||this._settings.response_type,i=i||this._settings.scope,f=f||this._settings.redirect_uri,e=e||this._settings.prompt,o=o||this._settings.display,s=s||this._settings.max_age,h=h||this._settings.ui_locales,c=c||this._settings.acr_values,l=l||this._settings.resource,a=a||this._settings.response_mode,v=v||this._settings.extraQueryParams,y=y||this._settings.extraTokenParams,k=this._settings.authority,u.SigninRequest.isCode(t)&&"code"!==t?Promise.reject(new Error("OpenID Connect hybrid flow is not supported")):this._metadataService.getAuthorizationEndpoint().then(function(n){r.Log.debug("OidcClient.createSigninRequest: Received authorization endpoint",n);var et=new u.SigninRequest({url:n,client_id:b,redirect_uri:f,response_type:t,scope:i,data:d||g,authority:k,prompt:e,display:o,max_age:s,ui_locales:h,id_token_hint:nt,login_hint:tt,acr_values:c,resource:l,request:it,request_uri:rt,extraQueryParams:v,extraTokenParams:y,request_type:ut,response_mode:a,client_secret:p._settings.client_secret,skipUserInfo:ft}),ot=et.state;return(w=w||p._stateStore).set(ot.id,ot.toStorageString()).then(function(){return et})})},n.prototype.readSigninResponseState=function(n,t){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2],f;r.Log.debug("OidcClient.readSigninResponseState");var o="query"===this._settings.response_mode||!this._settings.response_mode&&u.SigninRequest.isCode(this._settings.response_type),s=o?"?":"#",i=new h.SigninResponse(n,s);return i.state?(t=t||this._stateStore,f=e?t.remove.bind(t):t.get.bind(t),f(i.state).then(function(n){if(!n)throw r.Log.error("OidcClient.readSigninResponseState: No matching state found in storage"),new Error("No matching state found in storage");return{state:a.SigninState.fromStorageString(n),response:i}})):(r.Log.error("OidcClient.readSigninResponseState: No state in response"),Promise.reject(new Error("No state in response")))},n.prototype.processSigninResponse=function(n,t){var i=this;return r.Log.debug("OidcClient.processSigninResponse"),this.readSigninResponseState(n,t,!0).then(function(n){var t=n.state,u=n.response;return r.Log.debug("OidcClient.processSigninResponse: Received state from storage; validating response"),i._validator.validateSigninResponse(t,u)})},n.prototype.createSignoutRequest=function(){var f=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=n.id_token_hint,o=n.data,s=n.state,t=n.post_logout_redirect_uri,i=n.extraQueryParams,h=n.request_type,u=arguments[1];return r.Log.debug("OidcClient.createSignoutRequest"),t=t||this._settings.post_logout_redirect_uri,i=i||this._settings.extraQueryParams,this._metadataService.getEndSessionEndpoint().then(function(n){if(!n)throw r.Log.error("OidcClient.createSignoutRequest: No end session endpoint url returned"),new Error("no end session endpoint");r.Log.debug("OidcClient.createSignoutRequest: Received end session endpoint",n);var a=new c.SignoutRequest({url:n,id_token_hint:e,post_logout_redirect_uri:t,data:o||s,extraQueryParams:i,request_type:h}),l=a.state;return l&&(r.Log.debug("OidcClient.createSignoutRequest: Signout request has state to persist"),(u=u||f._stateStore).set(l.id,l.toStorageString())),a})},n.prototype.readSignoutResponseState=function(n,t){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i,u,f;return(r.Log.debug("OidcClient.readSignoutResponseState"),i=new l.SignoutResponse(n),!i.state)?(r.Log.debug("OidcClient.readSignoutResponseState: No state in response"),i.error?(r.Log.warn("OidcClient.readSignoutResponseState: Response was error: ",i.error),Promise.reject(new s.ErrorResponse(i))):Promise.resolve({state:void 0,response:i})):(u=i.state,t=t||this._stateStore,f=o?t.remove.bind(t):t.get.bind(t),f(u).then(function(n){if(!n)throw r.Log.error("OidcClient.readSignoutResponseState: No matching state found in storage"),new Error("No matching state found in storage");return{state:e.State.fromStorageString(n),response:i}}))},n.prototype.processSignoutResponse=function(n,t){var i=this;return r.Log.debug("OidcClient.processSignoutResponse"),this.readSignoutResponseState(n,t,!0).then(function(n){var t=n.state,u=n.response;return t?(r.Log.debug("OidcClient.processSignoutResponse: Received state from storage; validating response"),i._validator.validateSignoutResponse(t,u)):(r.Log.debug("OidcClient.processSignoutResponse: No state from storage; skipping validating response"),u)})},n.prototype.clearStaleState=function(n){return r.Log.debug("OidcClient.clearStaleState"),n=n||this._stateStore,e.State.clearStaleState(n,this.settings.staleStateAge)},o(n,[{key:"_stateStore",get:function(){return this.settings.stateStore}},{key:"_validator",get:function(){return this.settings.validator}},{key:"_metadataService",get:function(){return this.settings.metadataService}},{key:"settings",get:function(){return this._settings}},{key:"metadataService",get:function(){return this._metadataService}}]),n}()},function(n,t,i){"use strict";function e(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}Object.defineProperty(t,"__esModule",{value:!0});t.TokenClient=void 0;var u=i(7),f=i(2),r=i(0);t.TokenClient=function(){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.JsonService,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:f.MetadataService;if(e(this,n),!t)throw r.Log.error("TokenClient.ctor: No settings passed"),new Error("settings");this._settings=t;this._jsonService=new i;this._metadataService=new o(this._settings)}return n.prototype.exchangeCode=function(){var u=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t,i;return(n=Object.assign({},n)).grant_type=n.grant_type||"authorization_code",n.client_id=n.client_id||this._settings.client_id,n.client_secret=n.client_secret||this._settings.client_secret,n.redirect_uri=n.redirect_uri||this._settings.redirect_uri,t=void 0,i=n._client_authentication||this._settings._client_authentication,delete n._client_authentication,n.code?n.redirect_uri?n.code_verifier?n.client_id?n.client_secret||"client_secret_basic"!=i?("client_secret_basic"==i&&(t=n.client_id+":"+n.client_secret,delete n.client_id,delete n.client_secret),this._metadataService.getTokenEndpoint(!1).then(function(i){return r.Log.debug("TokenClient.exchangeCode: Received token endpoint"),u._jsonService.postForm(i,n,t).then(function(n){return r.Log.debug("TokenClient.exchangeCode: response received"),n})})):(r.Log.error("TokenClient.exchangeCode: No client_secret passed"),Promise.reject(new Error("A client_secret is required"))):(r.Log.error("TokenClient.exchangeCode: No client_id passed"),Promise.reject(new Error("A client_id is required"))):(r.Log.error("TokenClient.exchangeCode: No code_verifier passed"),Promise.reject(new Error("A code_verifier is required"))):(r.Log.error("TokenClient.exchangeCode: No redirect_uri passed"),Promise.reject(new Error("A redirect_uri is required"))):(r.Log.error("TokenClient.exchangeCode: No code passed"),Promise.reject(new Error("A code is required")))},n.prototype.exchangeRefreshToken=function(){var u=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t,i;return(n=Object.assign({},n)).grant_type=n.grant_type||"refresh_token",n.client_id=n.client_id||this._settings.client_id,n.client_secret=n.client_secret||this._settings.client_secret,t=void 0,i=n._client_authentication||this._settings._client_authentication,delete n._client_authentication,n.refresh_token?n.client_id?("client_secret_basic"==i&&(t=n.client_id+":"+n.client_secret,delete n.client_id,delete n.client_secret),this._metadataService.getTokenEndpoint(!1).then(function(i){return r.Log.debug("TokenClient.exchangeRefreshToken: Received token endpoint"),u._jsonService.postForm(i,n,t).then(function(n){return r.Log.debug("TokenClient.exchangeRefreshToken: response received"),n})})):(r.Log.error("TokenClient.exchangeRefreshToken: No client_id passed"),Promise.reject(new Error("A client_id is required"))):(r.Log.error("TokenClient.exchangeRefreshToken: No refresh_token passed"),Promise.reject(new Error("A refresh_token is required")))},n}()},function(n,t,i){"use strict";function u(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function f(n,t){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?n:t}Object.defineProperty(t,"__esModule",{value:!0});t.ErrorResponse=void 0;var r=i(0);t.ErrorResponse=function(n){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=e.error,s=e.error_description,h=e.error_uri,c=e.state,l=e.session_state,i;if(u(this,t),!o)throw r.Log.error("No error passed to ErrorResponse"),new Error("error");return i=f(this,n.call(this,s||o)),i.name="ErrorResponse",i.error=o,i.error_description=s,i.error_uri=h,i.state=c,i.session_state=l,i}return function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}});t&&(Object.setPrototypeOf?Object.setPrototypeOf(n,t):n.__proto__=t)}(t,n),t}(Error)},function(n,t,i){"use strict";function s(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function h(n,t){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?n:t}Object.defineProperty(t,"__esModule",{value:!0});t.SigninState=void 0;var e=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),u=i(0),o=i(9),f=i(4),r=function(n){return n&&n.__esModule?n:{"default":n}}(i(14));t.SigninState=function(n){function t(){var u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=u.nonce,l=u.authority,a=u.client_id,v=u.redirect_uri,o=u.code_verifier,y=u.response_mode,p=u.client_secret,w=u.scope,b=u.extraTokenParams,k=u.skipUserInfo,i,c;return s(this,t),i=h(this,n.call(this,arguments[0])),(!0===e?i._nonce=r.default():e&&(i._nonce=e),!0===o?i._code_verifier=r.default()+r.default()+r.default():o&&(i._code_verifier=o),i.code_verifier)&&(c=f.JoseUtil.hashString(i.code_verifier,"SHA256"),i._code_challenge=f.JoseUtil.hexToBase64Url(c)),i._redirect_uri=v,i._authority=l,i._client_id=a,i._response_mode=y,i._client_secret=p,i._scope=w,i._extraTokenParams=b,i._skipUserInfo=k,i}return function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}});t&&(Object.setPrototypeOf?Object.setPrototypeOf(n,t):n.__proto__=t)}(t,n),t.prototype.toStorageString=function(){return u.Log.debug("SigninState.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,nonce:this.nonce,code_verifier:this.code_verifier,redirect_uri:this.redirect_uri,authority:this.authority,client_id:this.client_id,response_mode:this.response_mode,client_secret:this.client_secret,scope:this.scope,extraTokenParams:this.extraTokenParams,skipUserInfo:this.skipUserInfo})},t.fromStorageString=function(n){return u.Log.debug("SigninState.fromStorageString"),new t(JSON.parse(n))},e(t,[{key:"nonce",get:function(){return this._nonce}},{key:"authority",get:function(){return this._authority}},{key:"client_id",get:function(){return this._client_id}},{key:"redirect_uri",get:function(){return this._redirect_uri}},{key:"code_verifier",get:function(){return this._code_verifier}},{key:"code_challenge",get:function(){return this._code_challenge}},{key:"response_mode",get:function(){return this._response_mode}},{key:"client_secret",get:function(){return this._client_secret}},{key:"scope",get:function(){return this._scope}},{key:"extraTokenParams",get:function(){return this._extraTokenParams}},{key:"skipUserInfo",get:function(){return this._skipUserInfo}}]),t}(o.State)},function(n,t){"use strict";function r(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(n){return(n^i.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16)})}function u(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(n){return(n^16*Math.random()>>n/4).toString(16)})}Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){return("undefined"!=i&&null!==i&&void 0!==i.getRandomValues?r:u)().replace(/-/g,"")};var i="undefined"!=typeof window?window.crypto||window.msCrypto:null;n.exports=t.default},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.User=void 0;var u=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),r=i(0);t.User=function(){function n(t){var i=t.id_token,r=t.session_state,u=t.access_token,f=t.refresh_token,e=t.token_type,o=t.scope,s=t.profile,h=t.expires_at,c=t.state;!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n);this.id_token=i;this.session_state=r;this.access_token=u;this.refresh_token=f;this.token_type=e;this.scope=o;this.profile=s;this.expires_at=h;this.state=c}return n.prototype.toStorageString=function(){return r.Log.debug("User.toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})},n.fromStorageString=function(t){return r.Log.debug("User.fromStorageString"),new n(JSON.parse(t))},u(n,[{key:"expires_in",get:function(){if(this.expires_at){var n=parseInt(Date.now()/1e3);return this.expires_at-n}},set:function(n){var t=parseInt(n),i;"number"==typeof t&&t>0&&(i=parseInt(Date.now()/1e3),this.expires_at=i+t)}},{key:"expired",get:function(){var n=this.expires_in;if(void 0!==n)return n<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}}]),n}()},function(n,t,i){"use strict";function f(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}Object.defineProperty(t,"__esModule",{value:!0});t.AccessTokenEvents=void 0;var r=i(0),u=i(46);t.AccessTokenEvents=function(){function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.accessTokenExpiringNotificationTime,o=void 0===i?60:i,r=t.accessTokenExpiringTimer,s=void 0===r?new u.Timer("Access token expiring"):r,e=t.accessTokenExpiredTimer,h=void 0===e?new u.Timer("Access token expired"):e;f(this,n);this._accessTokenExpiringNotificationTime=o;this._accessTokenExpiring=s;this._accessTokenExpired=h}return n.prototype.load=function(n){var t,i,u;n.access_token&&void 0!==n.expires_in?(t=n.expires_in,(r.Log.debug("AccessTokenEvents.load: access token present, remaining duration:",t),t>0)?(i=t-this._accessTokenExpiringNotificationTime,i<=0&&(i=1),r.Log.debug("AccessTokenEvents.load: registering expiring timer in:",i),this._accessTokenExpiring.init(i)):(r.Log.debug("AccessTokenEvents.load: canceling existing expiring timer becase we're past expiration."),this._accessTokenExpiring.cancel()),u=t+1,r.Log.debug("AccessTokenEvents.load: registering expired timer in:",u),this._accessTokenExpired.init(u)):(this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel())},n.prototype.unload=function(){r.Log.debug("AccessTokenEvents.unload: canceling existing access token timers");this._accessTokenExpiring.cancel();this._accessTokenExpired.cancel()},n.prototype.addAccessTokenExpiring=function(n){this._accessTokenExpiring.addHandler(n)},n.prototype.removeAccessTokenExpiring=function(n){this._accessTokenExpiring.removeHandler(n)},n.prototype.addAccessTokenExpired=function(n){this._accessTokenExpired.addHandler(n)},n.prototype.removeAccessTokenExpired=function(n){this._accessTokenExpired.removeHandler(n)},n}()},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Event=void 0;var r=i(0);t.Event=function(){function n(t){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n);this._name=t;this._callbacks=[]}return n.prototype.addHandler=function(n){this._callbacks.push(n)},n.prototype.removeHandler=function(n){var t=this._callbacks.findIndex(function(t){return t===n});t>=0&&this._callbacks.splice(t,1)},n.prototype.raise=function(){var n,t;for(r.Log.debug("Event: Raising event: "+this._name),n=0;n<this._callbacks.length;n++)(t=this._callbacks)[n].apply(t,arguments)},n}()},function(n,t,i){"use strict";function o(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}Object.defineProperty(t,"__esModule",{value:!0});t.SessionMonitor=void 0;var u=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),r=i(0),f=i(19),e=i(1);t.SessionMonitor=function(){function n(t){var i=this,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f.CheckSessionIFrame,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.Global.timer;if(o(this,n),!t)throw r.Log.error("SessionMonitor.ctor: No user manager passed to SessionMonitor"),new Error("userManager");this._userManager=t;this._CheckSessionIFrameCtor=u;this._timer=s;this._userManager.events.addUserLoaded(this._start.bind(this));this._userManager.events.addUserUnloaded(this._stop.bind(this));Promise.resolve(this._userManager.getUser().then(function(n){n?i._start(n):i._settings.monitorAnonymousSession&&i._userManager.querySessionStatus().then(function(n){var t={session_state:n.session_state};n.sub&&n.sid&&(t.profile={sub:n.sub,sid:n.sid});i._start(t)}).catch(function(n){r.Log.error("SessionMonitor ctor: error from querySessionStatus:",n.message)})}).catch(function(n){r.Log.error("SessionMonitor ctor: error from getUser:",n.message)}))}return n.prototype._start=function(n){var t=this,i=n.session_state;i&&(n.profile?(this._sub=n.profile.sub,this._sid=n.profile.sid,r.Log.debug("SessionMonitor._start: session_state:",i,", sub:",this._sub)):(this._sub=void 0,this._sid=void 0,r.Log.debug("SessionMonitor._start: session_state:",i,", anonymous user")),this._checkSessionIFrame?this._checkSessionIFrame.start(i):this._metadataService.getCheckSessionIframe().then(function(n){if(n){r.Log.debug("SessionMonitor._start: Initializing check session iframe");var u=t._client_id,f=t._checkSessionInterval,e=t._stopCheckSessionOnError;t._checkSessionIFrame=new t._CheckSessionIFrameCtor(t._callback.bind(t),u,n,f,e);t._checkSessionIFrame.load().then(function(){t._checkSessionIFrame.start(i)})}else r.Log.warn("SessionMonitor._start: No check session iframe found in the metadata")}).catch(function(n){r.Log.error("SessionMonitor._start: Error from getCheckSessionIframe:",n.message)}))},n.prototype._stop=function(){var n=this,t;(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&(r.Log.debug("SessionMonitor._stop"),this._checkSessionIFrame.stop()),this._settings.monitorAnonymousSession)&&(t=this._timer.setInterval(function(){n._timer.clearInterval(t);n._userManager.querySessionStatus().then(function(t){var i={session_state:t.session_state};t.sub&&t.sid&&(i.profile={sub:t.sub,sid:t.sid});n._start(i)}).catch(function(n){r.Log.error("SessionMonitor: error from querySessionStatus:",n.message)})},1e3))},n.prototype._callback=function(){var n=this;this._userManager.querySessionStatus().then(function(t){var i=!0;t?t.sub===n._sub?(i=!1,n._checkSessionIFrame.start(t.session_state),t.sid===n._sid?r.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, restarting check session iframe; session_state:",t.session_state):(r.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, session state has changed, restarting check session iframe; session_state:",t.session_state),n._userManager.events._raiseUserSessionChanged())):r.Log.debug("SessionMonitor._callback: Different subject signed into OP:",t.sub):r.Log.debug("SessionMonitor._callback: Subject no longer signed into OP");i&&(n._sub?(r.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed out event"),n._userManager.events._raiseUserSignedOut()):(r.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed in event"),n._userManager.events._raiseUserSignedIn()))}).catch(function(t){n._sub&&(r.Log.debug("SessionMonitor._callback: Error calling queryCurrentSigninSession; raising signed out event",t.message),n._userManager.events._raiseUserSignedOut())})},u(n,[{key:"_settings",get:function(){return this._userManager.settings}},{key:"_metadataService",get:function(){return this._userManager.metadataService}},{key:"_client_id",get:function(){return this._settings.client_id}},{key:"_checkSessionInterval",get:function(){return this._settings.checkSessionInterval}},{key:"_stopCheckSessionOnError",get:function(){return this._settings.stopCheckSessionOnError}}]),n}()},function(n,t,i){"use strict";function u(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}Object.defineProperty(t,"__esModule",{value:!0});t.CheckSessionIFrame=void 0;var r=i(0);t.CheckSessionIFrame=function(){function n(t,i,r,f){var o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],e;u(this,n);this._callback=t;this._client_id=i;this._url=r;this._interval=f||2e3;this._stopOnError=o;e=r.indexOf("/",r.indexOf("//")+2);this._frame_origin=r.substr(0,e);this._frame=window.document.createElement("iframe");this._frame.style.visibility="hidden";this._frame.style.position="absolute";this._frame.style.display="none";this._frame.width=0;this._frame.height=0;this._frame.src=r}return n.prototype.load=function(){var n=this;return new Promise(function(t){n._frame.onload=function(){t()};window.document.body.appendChild(n._frame);n._boundMessageEvent=n._message.bind(n);window.addEventListener("message",n._boundMessageEvent,!1)})},n.prototype._message=function(n){n.origin===this._frame_origin&&n.source===this._frame.contentWindow&&("error"===n.data?(r.Log.error("CheckSessionIFrame: error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===n.data?(r.Log.debug("CheckSessionIFrame: changed message from check session op iframe"),this.stop(),this._callback()):r.Log.debug("CheckSessionIFrame: "+n.data+" message from check session op iframe"))},n.prototype.start=function(n){var t=this,i;this._session_state!==n&&(r.Log.debug("CheckSessionIFrame.start"),this.stop(),this._session_state=n,i=function(){t._frame.contentWindow.postMessage(t._client_id+" "+t._session_state,t._frame_origin)},i(),this._timer=window.setInterval(i,this._interval))},n.prototype.stop=function(){this._session_state=null;this._timer&&(r.Log.debug("CheckSessionIFrame.stop"),window.clearInterval(this._timer),this._timer=null)},n}()},function(n,t,i){"use strict";function s(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}var u,f;Object.defineProperty(t,"__esModule",{value:!0});t.TokenRevocationClient=void 0;var r=i(0),e=i(2),o=i(1);u="access_token";f="refresh_token";t.TokenRevocationClient=function(){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.Global.XMLHttpRequest,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.MetadataService;if(s(this,n),!t)throw r.Log.error("TokenRevocationClient.ctor: No settings provided"),new Error("No settings provided.");this._settings=t;this._XMLHttpRequestCtor=i;this._metadataService=new u(this._settings)}return n.prototype.revoke=function(n,t){var e=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"access_token";if(!n)throw r.Log.error("TokenRevocationClient.revoke: No token provided"),new Error("No token provided.");if(i!==u&&i!=f)throw r.Log.error("TokenRevocationClient.revoke: Invalid token type"),new Error("Invalid token type.");return this._metadataService.getRevocationEndpoint().then(function(u){if(u){r.Log.debug("TokenRevocationClient.revoke: Revoking "+i);var f=e._settings.client_id,o=e._settings.client_secret;return e._revoke(u,f,o,n,i)}if(t)throw r.Log.error("TokenRevocationClient.revoke: Revocation not supported"),new Error("Revocation not supported");})},n.prototype._revoke=function(n,t,i,u,f){var e=this;return new Promise(function(o,s){var h=new e._XMLHttpRequestCtor,c;h.open("POST",n);h.onload=function(){r.Log.debug("TokenRevocationClient.revoke: HTTP response received, status",h.status);200===h.status?o():s(Error(h.statusText+" ("+h.status+")"))};h.onerror=function(){r.Log.debug("TokenRevocationClient.revoke: Network Error.");s("Network Error")};c="client_id="+encodeURIComponent(t);i&&(c+="&client_secret="+encodeURIComponent(i));c+="&token_type_hint="+encodeURIComponent(f);c+="&token="+encodeURIComponent(u);h.setRequestHeader("Content-Type","application/x-www-form-urlencoded");h.send(c)})},n}()},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CordovaPopupWindow=void 0;var u=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),r=i(0);t.CordovaPopupWindow=function(){function n(t){var i=this;!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n);this._promise=new Promise(function(n,t){i._resolve=n;i._reject=t});this.features=t.popupWindowFeatures||"location=no,toolbar=no,zoom=no";this.target=t.popupWindowTarget||"_blank";this.redirect_uri=t.startUrl;r.Log.debug("CordovaPopupWindow.ctor: redirect_uri: "+this.redirect_uri)}return n.prototype._isInAppBrowserInstalled=function(n){return["cordova-plugin-inappbrowser","cordova-plugin-inappbrowser.inappbrowser","org.apache.cordova.inappbrowser"].some(function(t){return n.hasOwnProperty(t)})},n.prototype.navigate=function(n){if(n&&n.url){if(!window.cordova)return this._error("cordova is undefined");var t=window.cordova.require("cordova/plugin_list").metadata;if(!1===this._isInAppBrowserInstalled(t))return this._error("InAppBrowser plugin not found");this._popup=cordova.InAppBrowser.open(n.url,this.target,this.features);this._popup?(r.Log.debug("CordovaPopupWindow.navigate: popup successfully created"),this._exitCallbackEvent=this._exitCallback.bind(this),this._loadStartCallbackEvent=this._loadStartCallback.bind(this),this._popup.addEventListener("exit",this._exitCallbackEvent,!1),this._popup.addEventListener("loadstart",this._loadStartCallbackEvent,!1)):this._error("Error opening popup window")}else this._error("No url provided");return this.promise},n.prototype._loadStartCallback=function(n){0===n.url.indexOf(this.redirect_uri)&&this._success({url:n.url})},n.prototype._exitCallback=function(n){this._error(n)},n.prototype._success=function(n){this._cleanup();r.Log.debug("CordovaPopupWindow: Successful response from cordova popup window");this._resolve(n)},n.prototype._error=function(n){this._cleanup();r.Log.error(n);this._reject(new Error(n))},n.prototype.close=function(){this._cleanup()},n.prototype._cleanup=function(){this._popup&&(r.Log.debug("CordovaPopupWindow: cleaning up popup"),this._popup.removeEventListener("exit",this._exitCallbackEvent,!1),this._popup.removeEventListener("loadstart",this._loadStartCallbackEvent,!1),this._popup.close());this._popup=null},u(n,[{key:"promise",get:function(){return this._promise}}]),n}()},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(0),u=i(10),f=i(5),e=i(6),o=i(37),s=i(38),h=i(16),c=i(2),l=i(48),a=i(49),v=i(19),y=i(20),p=i(18),w=i(1),b=i(15),k=i(50);t.default={Version:k.Version,Log:r.Log,OidcClient:u.OidcClient,OidcClientSettings:f.OidcClientSettings,WebStorageStateStore:e.WebStorageStateStore,InMemoryWebStorage:o.InMemoryWebStorage,UserManager:s.UserManager,AccessTokenEvents:h.AccessTokenEvents,MetadataService:c.MetadataService,CordovaPopupNavigator:l.CordovaPopupNavigator,CordovaIFrameNavigator:a.CordovaIFrameNavigator,CheckSessionIFrame:v.CheckSessionIFrame,TokenRevocationClient:y.TokenRevocationClient,SessionMonitor:p.SessionMonitor,Global:w.Global,User:b.User};n.exports=t.default},function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ClockService=function(){function n(){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n)}return n.prototype.getEpochTime=function(){return Promise.resolve(Date.now()/1e3|0)},n}()},function(n,t,i){"use strict";function l(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}var e;Object.defineProperty(t,"__esModule",{value:!0});t.ResponseValidator=void 0;var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},r=i(0),o=i(2),s=i(25),h=i(11),f=i(12),c=i(4);e=["nonce","at_hash","iat","nbf","exp","aud","iss","c_hash"];t.ResponseValidator=function(){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.MetadataService,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.UserInfoService,f=arguments.length>3&&void 0!==arguments[3]?arguments[3]:c.JoseUtil,e=arguments.length>4&&void 0!==arguments[4]?arguments[4]:h.TokenClient;if(l(this,n),!t)throw r.Log.error("ResponseValidator.ctor: No settings passed to ResponseValidator"),new Error("settings");this._settings=t;this._metadataService=new i(this._settings);this._userInfoService=new u(this._settings);this._joseUtil=f;this._tokenClient=new e(this._settings)}return n.prototype.validateSigninResponse=function(n,t){var i=this;return r.Log.debug("ResponseValidator.validateSigninResponse"),this._processSigninParams(n,t).then(function(t){return r.Log.debug("ResponseValidator.validateSigninResponse: state processed"),i._validateTokens(n,t).then(function(t){return r.Log.debug("ResponseValidator.validateSigninResponse: tokens validated"),i._processClaims(n,t).then(function(n){return r.Log.debug("ResponseValidator.validateSigninResponse: claims processed"),n})})})},n.prototype.validateSignoutResponse=function(n,t){return n.id!==t.state?(r.Log.error("ResponseValidator.validateSignoutResponse: State does not match"),Promise.reject(new Error("State does not match"))):(r.Log.debug("ResponseValidator.validateSignoutResponse: state validated"),t.state=n.data,t.error?(r.Log.warn("ResponseValidator.validateSignoutResponse: Response was error",t.error),Promise.reject(new f.ErrorResponse(t))):Promise.resolve(t))},n.prototype._processSigninParams=function(n,t){if(n.id!==t.state)return r.Log.error("ResponseValidator._processSigninParams: State does not match"),Promise.reject(new Error("State does not match"));if(!n.client_id)return r.Log.error("ResponseValidator._processSigninParams: No client_id on state"),Promise.reject(new Error("No client_id on state"));if(!n.authority)return r.Log.error("ResponseValidator._processSigninParams: No authority on state"),Promise.reject(new Error("No authority on state"));if(this._settings.authority){if(this._settings.authority&&this._settings.authority!==n.authority)return r.Log.error("ResponseValidator._processSigninParams: authority mismatch on settings vs. signin state"),Promise.reject(new Error("authority mismatch on settings vs. signin state"))}else this._settings.authority=n.authority;if(this._settings.client_id){if(this._settings.client_id&&this._settings.client_id!==n.client_id)return r.Log.error("ResponseValidator._processSigninParams: client_id mismatch on settings vs. signin state"),Promise.reject(new Error("client_id mismatch on settings vs. signin state"))}else this._settings.client_id=n.client_id;return r.Log.debug("ResponseValidator._processSigninParams: state validated"),t.state=n.data,t.error?(r.Log.warn("ResponseValidator._processSigninParams: Response was error",t.error),Promise.reject(new f.ErrorResponse(t))):n.nonce&&!t.id_token?(r.Log.error("ResponseValidator._processSigninParams: Expecting id_token in response"),Promise.reject(new Error("No id_token in response"))):!n.nonce&&t.id_token?(r.Log.error("ResponseValidator._processSigninParams: Not expecting id_token in response"),Promise.reject(new Error("Unexpected id_token in response"))):n.code_verifier&&!t.code?(r.Log.error("ResponseValidator._processSigninParams: Expecting code in response"),Promise.reject(new Error("No code in response"))):!n.code_verifier&&t.code?(r.Log.error("ResponseValidator._processSigninParams: Not expecting code in response"),Promise.reject(new Error("Unexpected code in response"))):(t.scope||(t.scope=n.scope),Promise.resolve(t))},n.prototype._processClaims=function(n,t){var i=this;if(t.isOpenIdConnect){if(r.Log.debug("ResponseValidator._processClaims: response is OIDC, processing claims"),t.profile=this._filterProtocolClaims(t.profile),!0!==n.skipUserInfo&&this._settings.loadUserInfo&&t.access_token)return r.Log.debug("ResponseValidator._processClaims: loading user info"),this._userInfoService.getClaims(t.access_token).then(function(n){return r.Log.debug("ResponseValidator._processClaims: user info claims received from user info endpoint"),n.sub!==t.profile.sub?(r.Log.error("ResponseValidator._processClaims: sub from user info endpoint does not match sub in id_token"),Promise.reject(new Error("sub from user info endpoint does not match sub in id_token"))):(t.profile=i._mergeClaims(t.profile,n),r.Log.debug("ResponseValidator._processClaims: user info claims received, updated profile:",t.profile),t)});r.Log.debug("ResponseValidator._processClaims: not loading user info")}else r.Log.debug("ResponseValidator._processClaims: response is not OIDC, not processing claims");return Promise.resolve(t)},n.prototype._mergeClaims=function(n,t){var r=Object.assign({},n),i,e,o,f;for(i in t)for(e=t[i],Array.isArray(e)||(e=[e]),o=0;o<e.length;o++)f=e[o],r[i]?Array.isArray(r[i])?r[i].indexOf(f)<0&&r[i].push(f):r[i]!==f&&(r[i]="object"===(void 0===f?"undefined":u(f))&&this._settings.mergeClaims?this._mergeClaims(r[i],f):[r[i],f]):r[i]=f;return r},n.prototype._filterProtocolClaims=function(n){r.Log.debug("ResponseValidator._filterProtocolClaims, incoming claims:",n);var t=Object.assign({},n);return this._settings._filterProtocolClaims?(e.forEach(function(n){delete t[n]}),r.Log.debug("ResponseValidator._filterProtocolClaims: protocol claims filtered",t)):r.Log.debug("ResponseValidator._filterProtocolClaims: protocol claims not filtered"),t},n.prototype._validateTokens=function(n,t){return t.code?(r.Log.debug("ResponseValidator._validateTokens: Validating code"),this._processCode(n,t)):t.id_token?t.access_token?(r.Log.debug("ResponseValidator._validateTokens: Validating id_token and access_token"),this._validateIdTokenAndAccessToken(n,t)):(r.Log.debug("ResponseValidator._validateTokens: Validating id_token"),this._validateIdToken(n,t)):(r.Log.debug("ResponseValidator._validateTokens: No code to process or id_token to validate"),Promise.resolve(t))},n.prototype._processCode=function(n,t){var f=this,i={client_id:n.client_id,client_secret:n.client_secret,code:t.code,redirect_uri:n.redirect_uri,code_verifier:n.code_verifier};return n.extraTokenParams&&"object"===u(n.extraTokenParams)&&Object.assign(i,n.extraTokenParams),this._tokenClient.exchangeCode(i).then(function(i){for(var u in i)t[u]=i[u];return t.id_token?(r.Log.debug("ResponseValidator._processCode: token response successful, processing id_token"),f._validateIdTokenAttributes(n,t)):(r.Log.debug("ResponseValidator._processCode: token response successful, returning response"),t)})},n.prototype._validateIdTokenAttributes=function(n,t){var i=this;return this._metadataService.getIssuer().then(function(u){var e=n.client_id,f=i._settings.clockSkew;return r.Log.debug("ResponseValidator._validateIdTokenAttributes: Validaing JWT attributes; using clock skew (in seconds) of: ",f),i._settings.getEpochTime().then(function(o){return i._joseUtil.validateJwtAttributes(t.id_token,u,e,f,o).then(function(i){return n.nonce&&n.nonce!==i.nonce?(r.Log.error("ResponseValidator._validateIdTokenAttributes: Invalid nonce in id_token"),Promise.reject(new Error("Invalid nonce in id_token"))):i.sub?(t.profile=i,t):(r.Log.error("ResponseValidator._validateIdTokenAttributes: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))})})})},n.prototype._validateIdTokenAndAccessToken=function(n,t){var i=this;return this._validateIdToken(n,t).then(function(n){return i._validateAccessToken(n)})},n.prototype._getSigningKeyForJwt=function(n){var t=this;return this._metadataService.getSigningKeys().then(function(i){var f=n.header.kid,u;if(!i)return r.Log.error("ResponseValidator._validateIdToken: No signing keys from metadata"),Promise.reject(new Error("No signing keys from metadata"));if(r.Log.debug("ResponseValidator._validateIdToken: Received signing keys"),u=void 0,f)u=i.filter(function(n){return n.kid===f})[0];else{if((i=t._filterByAlg(i,n.header.alg)).length>1)return r.Log.error("ResponseValidator._validateIdToken: No kid found in id_token and more than one key found in metadata"),Promise.reject(new Error("No kid found in id_token and more than one key found in metadata"));u=i[0]}return Promise.resolve(u)})},n.prototype._getSigningKeyForJwtWithSingleRetry=function(n){var t=this;return this._getSigningKeyForJwt(n).then(function(i){return i?Promise.resolve(i):(t._metadataService.resetSigningKeys(),t._getSigningKeyForJwt(n))})},n.prototype._validateIdToken=function(n,t){var u=this,i;return n.nonce?(i=this._joseUtil.parseJwt(t.id_token),i&&i.header&&i.payload?n.nonce!==i.payload.nonce?(r.Log.error("ResponseValidator._validateIdToken: Invalid nonce in id_token"),Promise.reject(new Error("Invalid nonce in id_token"))):this._metadataService.getIssuer().then(function(f){return r.Log.debug("ResponseValidator._validateIdToken: Received issuer"),u._getSigningKeyForJwtWithSingleRetry(i).then(function(e){if(!e)return r.Log.error("ResponseValidator._validateIdToken: No key matching kid or alg found in signing keys"),Promise.reject(new Error("No key matching kid or alg found in signing keys"));var s=n.client_id,o=u._settings.clockSkew;return r.Log.debug("ResponseValidator._validateIdToken: Validaing JWT; using clock skew (in seconds) of: ",o),u._joseUtil.validateJwt(t.id_token,e,f,s,o).then(function(){return r.Log.debug("ResponseValidator._validateIdToken: JWT validation successful"),i.payload.sub?(t.profile=i.payload,t):(r.Log.error("ResponseValidator._validateIdToken: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))})})}):(r.Log.error("ResponseValidator._validateIdToken: Failed to parse id_token",i),Promise.reject(new Error("Failed to parse id_token")))):(r.Log.error("ResponseValidator._validateIdToken: No nonce on state"),Promise.reject(new Error("No nonce on state")))},n.prototype._filterByAlg=function(n,t){var i=null;if(t.startsWith("RS"))i="RSA";else if(t.startsWith("PS"))i="PS";else{if(!t.startsWith("ES"))return r.Log.debug("ResponseValidator._filterByAlg: alg not supported: ",t),[];i="EC"}return r.Log.debug("ResponseValidator._filterByAlg: Looking for keys that match kty: ",i),n=n.filter(function(n){return n.kty===i}),r.Log.debug("ResponseValidator._filterByAlg: Number of keys that match kty: ",i,n.length),n},n.prototype._validateAccessToken=function(n){var u,t,i,e,f,s,o;return n.profile?n.profile.at_hash?n.id_token?(u=this._joseUtil.parseJwt(n.id_token),!u||!u.header)?(r.Log.error("ResponseValidator._validateAccessToken: Failed to parse id_token",u),Promise.reject(new Error("Failed to parse id_token"))):(t=u.header.alg,!t||5!==t.length)?(r.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",t),Promise.reject(new Error("Unsupported alg: "+t))):(i=t.substr(2,3),!i)?(r.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",t,i),Promise.reject(new Error("Unsupported alg: "+t))):256!==(i=parseInt(i))&&384!==i&&512!==i?(r.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",t,i),Promise.reject(new Error("Unsupported alg: "+t))):(e="sha"+i,f=this._joseUtil.hashString(n.access_token,e),!f)?(r.Log.error("ResponseValidator._validateAccessToken: access_token hash failed:",e),Promise.reject(new Error("Failed to validate at_hash"))):(s=f.substr(0,f.length/2),o=this._joseUtil.hexToBase64Url(s),o!==n.profile.at_hash?(r.Log.error("ResponseValidator._validateAccessToken: Failed to validate at_hash",o,n.profile.at_hash),Promise.reject(new Error("Failed to validate at_hash"))):(r.Log.debug("ResponseValidator._validateAccessToken: success"),Promise.resolve(n))):(r.Log.error("ResponseValidator._validateAccessToken: No id_token"),Promise.reject(new Error("No id_token"))):(r.Log.error("ResponseValidator._validateAccessToken: No at_hash in id_token"),Promise.reject(new Error("No at_hash in id_token"))):(r.Log.error("ResponseValidator._validateAccessToken: No profile loaded from id_token"),Promise.reject(new Error("No profile loaded from id_token")))},n}()},function(n,t,i){"use strict";function o(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}Object.defineProperty(t,"__esModule",{value:!0});t.UserInfoService=void 0;var u=i(7),f=i(2),r=i(0),e=i(4);t.UserInfoService=function(){function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.JsonService,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:f.MetadataService,h=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.JoseUtil;if(o(this,n),!t)throw r.Log.error("UserInfoService.ctor: No settings passed"),new Error("settings");this._settings=t;this._jsonService=new i(void 0,void 0,this._getClaimsFromJwt.bind(this));this._metadataService=new s(this._settings);this._joseUtil=h}return n.prototype.getClaims=function(n){var t=this;return n?this._metadataService.getUserInfoEndpoint().then(function(i){return r.Log.debug("UserInfoService.getClaims: received userinfo url",i),t._jsonService.getJson(i,n).then(function(n){return r.Log.debug("UserInfoService.getClaims: claims received",n),n})}):(r.Log.error("UserInfoService.getClaims: No token passed"),Promise.reject(new Error("A token is required")))},n.prototype._getClaimsFromJwt=function(n){var i=this,t,f,u;try{if(t=this._joseUtil.parseJwt(n.responseText),!t||!t.header||!t.payload)return r.Log.error("UserInfoService._getClaimsFromJwt: Failed to parse JWT",t),Promise.reject(new Error("Failed to parse id_token"));f=t.header.kid;u=void 0;switch(this._settings.userInfoJwtIssuer){case"OP":u=this._metadataService.getIssuer();break;case"ANY":u=Promise.resolve(t.payload.iss);break;default:u=Promise.resolve(this._settings.userInfoJwtIssuer)}return u.then(function(u){return r.Log.debug("UserInfoService._getClaimsFromJwt: Received issuer:"+u),i._metadataService.getSigningKeys().then(function(e){var o,h,s;if(!e)return r.Log.error("UserInfoService._getClaimsFromJwt: No signing keys from metadata"),Promise.reject(new Error("No signing keys from metadata"));if(r.Log.debug("UserInfoService._getClaimsFromJwt: Received signing keys"),o=void 0,f)o=e.filter(function(n){return n.kid===f})[0];else{if((e=i._filterByAlg(e,t.header.alg)).length>1)return r.Log.error("UserInfoService._getClaimsFromJwt: No kid found in id_token and more than one key found in metadata"),Promise.reject(new Error("No kid found in id_token and more than one key found in metadata"));o=e[0]}return o?(h=i._settings.client_id,s=i._settings.clockSkew,r.Log.debug("UserInfoService._getClaimsFromJwt: Validaing JWT; using clock skew (in seconds) of: ",s),i._joseUtil.validateJwt(n.responseText,o,u,h,s,void 0,!0).then(function(){return r.Log.debug("UserInfoService._getClaimsFromJwt: JWT validation successful"),t.payload})):(r.Log.error("UserInfoService._getClaimsFromJwt: No key matching kid or alg found in signing keys"),Promise.reject(new Error("No key matching kid or alg found in signing keys")))})})}catch(e){return r.Log.error("UserInfoService._getClaimsFromJwt: Error parsing JWT response",e.message),void reject(e)}},n.prototype._filterByAlg=function(n,t){var i=null;if(t.startsWith("RS"))i="RSA";else if(t.startsWith("PS"))i="PS";else{if(!t.startsWith("ES"))return r.Log.debug("UserInfoService._filterByAlg: alg not supported: ",t),[];i="EC"}return r.Log.debug("UserInfoService._filterByAlg: Looking for keys that match kty: ",i),n=n.filter(function(n){return n.kty===i}),r.Log.debug("UserInfoService._filterByAlg: Number of keys that match kty: ",i,n.length),n},n}()},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.AllowedSigningAlgs=t.b64tohex=t.hextob64u=t.crypto=t.X509=t.KeyUtil=t.jws=void 0;var r=i(27);t.jws=r.jws;t.KeyUtil=r.KEYUTIL;t.X509=r.X509;t.crypto=r.crypto;t.hextob64u=r.hextob64u;t.b64tohex=r.b64tohex;t.AllowedSigningAlgs=["RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"]},function(n,t,i){"use strict";(function(n){function dt(n){for(var i,r="",t=0;t+3<=n.length;t+=3)i=parseInt(n.substring(t,t+3),16),r+=lt.charAt(i>>6)+lt.charAt(63&i);for(t+1==n.length?(i=parseInt(n.substring(t,t+1),16),r+=lt.charAt(i<<2)):t+2==n.length&&(i=parseInt(n.substring(t,t+2),16),r+=lt.charAt(i>>2)+lt.charAt((3&i)<<4));(3&r.length)>0;)r+="=";return r}function gt(n){for(var u,t,i="",r=0,f=0;f<n.length&&"="!=n.charAt(f);++f)(t=lt.indexOf(n.charAt(f)))<0||(0==r?(i+=et(t>>2),u=3&t,r=1):1==r?(i+=et(u<<2|t>>4),u=15&t,r=2):2==r?(i+=et(u),i+=et(t>>2),u=3&t,r=3):(i+=et(u<<2|t>>4),i+=et(15&t),r=0));return 1==r&&(i+=et(u<<2)),i}function yr(n){for(var i=gt(n),r=[],t=0;2*t<i.length;++t)r[t]=parseInt(i.substring(2*t,2*t+2),16);return r}function r(n,t,i){null!=n&&("number"==typeof n?this.fromNumber(n,t,i):null==t&&"string"!=typeof n?this.fromString(n,256):this.fromString(n,t))}function o(){return new r(null)}function et(n){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(n)}function pr(n,t){var i=ui[n.charCodeAt(t)];return null==i?-1:i}function ht(n){var t=o();return t.fromInt(n),t}function li(n){var t,i=1;return 0!=(t=n>>>16)&&(n=t,i+=16),0!=(t=n>>8)&&(n=t,i+=8),0!=(t=n>>4)&&(n=t,i+=4),0!=(t=n>>2)&&(n=t,i+=2),0!=(t=n>>1)&&(n=t,i+=1),i}function at(n){this.m=n}function vt(n){this.m=n;this.mp=n.invDigit();this.mpl=32767&this.mp;this.mph=this.mp>>15;this.um=(1<<n.DB-15)-1;this.mt2=2*n.t}function rf(n,t){return n&t}function di(n,t){return n|t}function wr(n,t){return n^t}function br(n,t){return n&~t}function uf(n){if(0==n)return-1;var t=0;return 0==(65535&n)&&(n>>=16,t+=16),0==(255&n)&&(n>>=8,t+=8),0==(15&n)&&(n>>=4,t+=4),0==(3&n)&&(n>>=2,t+=2),0==(1&n)&&++t,t}function ff(n){for(var t=0;0!=n;)n&=n-1,++t;return t}function fi(){}function kr(n){return n}function ti(n){this.r2=o();this.q3=o();r.ONE.dlShiftTo(2*n.t,this.r2);this.mu=this.r2.divide(n);this.m=n}function nr(){this.i=0;this.j=0;this.S=[]}function tr(){!function(n){g[y++]^=255&n;g[y++]^=n>>8&255;g[y++]^=n>>16&255;g[y++]^=n>>24&255;y>=256&&(y-=256)}((new Date).getTime())}function ef(){if(null==gi){for(tr(),(gi=new nr).init(g),y=0;y<g.length;++y)g[y]=0;y=0}return gi.next()}function yt(){}function ei(n,t){return new r(n,t)}function gr(n,t,i){for(var u="",r=0;u.length<t;)u+=i(String.fromCharCode.apply(String,n.concat([(4278190080&r)>>24,(16711680&r)>>16,(65280&r)>>8,255&r]))),r+=1;return u}function e(){this.n=null;this.e=0;this.d=null;this.p=null;this.q=null;this.dmp1=null;this.dmq1=null;this.coeff=null}function k(n,t){this.x=t;this.q=n}function s(n,t,i,u){this.curve=n;this.x=t;this.y=i;this.z=null==u?r.ONE:u;this.zinv=null}function ct(n,t,i){this.q=n;this.a=this.fromBigInteger(t);this.b=this.fromBigInteger(i);this.infinity=new s(this,null,null)}function nu(n){for(var i=[],t=0;t<n.length;t++)i[t]=n.charCodeAt(t);return i}function tu(n){for(var i="",t=0;t<n.length;t++)i+=String.fromCharCode(n[t]);return i}function ai(n){for(var t,r="",i=0;i<n.length;i++)t=n[i].toString(16),1==t.length&&(t="0"+t),r+=t;return r}function ot(n){return ai(nu(n))}function vi(n){return(n=(n=n.replace(/\=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")}function si(n){return n.length%4==2?n+="==":n.length%4==3&&(n+="="),(n=n.replace(/-/g,"+")).replace(/_/g,"/")}function v(n){return n.length%2==1&&(n="0"+n),vi(dt(n))}function c(n){return gt(si(n))}function er(n){return yi(wi(n))}function p(n){return decodeURIComponent(pi(n))}function nt(n){for(var i="",t=0;t<n.length-1;t+=2)i+=String.fromCharCode(parseInt(n.substr(t,2),16));return i}function ut(n){for(var i="",t=0;t<n.length;t++)i+=("0"+n.charCodeAt(t).toString(16)).slice(-2);return i}function iu(n){return dt(n)}function ru(n){return iu(n).replace(/(.{64})/g,"$1\r\n").replace(/\r\n$/,"")}function uu(n){return gt(n.replace(/[^0-9A-Za-z\/+=]*/g,""))}function d(n,t){return"-----BEGIN "+t+"-----\r\n"+ru(n)+"\r\n-----END "+t+"-----\r\n"}function ft(n,t){if(-1==n.indexOf("-----BEGIN "))throw"can't find PEM header: "+t;return uu(n=void 0!==t?(n=n.replace(new RegExp("^[^]*-----BEGIN "+t+"-----"),"")).replace(new RegExp("-----END "+t+"-----[^]*$"),""):(n=n.replace(/^[^]*-----BEGIN [^-]+-----/,"")).replace(/-----END [^-]+-----[^]*$/,""))}function or(n){var t,f,e,o,s,h,r,u,c,l,i;if(i=n.match(/^(\d{2}|\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(|\.\d+)Z$/))return u=i[1],t=parseInt(u),2===u.length&&(50<=t&&t<100?t=1900+t:0<=t&&t<50&&(t=2e3+t)),f=parseInt(i[2])-1,e=parseInt(i[3]),o=parseInt(i[4]),s=parseInt(i[5]),h=parseInt(i[6]),r=0,""!==(c=i[7])&&(l=(c.substr(1)+"00").substr(0,3),r=parseInt(l)),Date.UTC(t,f,e,o,s,h,r);throw"unsupported zulu format: "+n;}function fu(n){return~~(or(n)/1e3)}function yi(n){return n.replace(/%/g,"")}function pi(n){return n.replace(/(..)/g,"%$1")}function eu(n){var r="malformed IPv6 address",u,f,t,i;if(!n.match(/^[0-9A-Fa-f:]+$/))throw r;if(u=(n=n.toLowerCase()).split(":").length-1,u<2)throw r;if(f=":".repeat(9-u),t=(n=n.replace("::",f)).split(":"),8!=t.length)throw r;for(i=0;i<8;i++)t[i]=("0000"+t[i]).slice(-4);return t.join("")}function ou(n){var i,t,r,u;if(!n.match(/^[0-9A-Fa-f]{32}$/))throw"malformed IPv6 address octet";for(i=(n=n.toLowerCase()).match(/.{1,4}/g),t=0;t<8;t++)i[t]=i[t].replace(/^0+/,""),""==i[t]&&(i[t]="0");if(r=(n=":"+i.join(":")+":").match(/:(0:){2,}/g),null===r)return n.slice(1,-1);for(u="",t=0;t<r.length;t++)r[t].length>u.length&&(u=r[t]);return(n=n.replace(u,"::")).slice(1,-1)}function sr(n){var t="malformed hex value";if(!n.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw t;if(8!=n.length)return 32==n.length?ou(n):n;try{return parseInt(n.substr(0,2),16)+"."+parseInt(n.substr(2,2),16)+"."+parseInt(n.substr(4,2),16)+"."+parseInt(n.substr(6,2),16)}catch(n){throw t;}}function wi(n){for(var i=encodeURIComponent(n),r="",t=0;t<i.length;t++)"%"==i[t]?(r+=i.substr(t,3),t+=2):r=r+"%"+ot(i[t]);return r}function su(n){return!(n.length%2!=0||!n.match(/^[0-9a-f]+$/)&&!n.match(/^[0-9A-F]+$/))}function hr(n){return n.length%2==1?"0"+n:n.substr(0,1)>"7"?"00"+n:n}function cu(n,t){for(var i="",u=t/4-n.length,r=0;r<u;r++)i+="0";return i+n}function lu(n,t,i){for(var u="",r=0;u.length<t;)u+=nt(i(ut(n+String.fromCharCode.apply(String,[(4278190080&r)>>24,(16711680&r)>>16,(65280&r)>>8,255&r])))),r+=1;return u}function au(n){var t,r,u;for(t in i.crypto.Util.DIGESTINFOHEAD)if(r=i.crypto.Util.DIGESTINFOHEAD[t],u=r.length,n.substring(0,u)==r)return[t,n.substring(u)];return[]}function a(n){var y,f=u,r=f.getChildIdx,e=f.getV,t=f.getTLV,o=f.getVbyList,c=f.getVbyListEx,s=f.getTLVbyList,w=f.getTLVbyListEx,h=f.getIdxbyList,b=f.getIdxbyListEx,g=f.getVidx,v=f.oidname,tt=f.hextooidstr,k=a,it=ft;try{y=i.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(n){}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"};this.hex=null;this.version=0;this.foffset=0;this.aExtInfo=null;this.getVersion=function(){return null===this.hex||0!==this.version?this.version:"a003020102"!==s(this.hex,0,[0,0])?(this.version=1,this.foffset=-1,1):(this.version=3,3)};this.getSerialNumberHex=function(){return c(this.hex,0,[0,0],"02")};this.getSignatureAlgorithmField=function(){var n=w(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(n)};this.getAlgorithmIdentifierName=function(n){for(var t in y)if(n===y[t])return t;return v(c(n,0,[0],"06"))};this.getIssuer=function(){return this.getX500Name(this.getIssuerHex())};this.getIssuerHex=function(){return s(this.hex,0,[0,3+this.foffset],"30")};this.getIssuerString=function(){return k.hex2dn(this.getIssuerHex())};this.getSubject=function(){return this.getX500Name(this.getSubjectHex())};this.getSubjectHex=function(){return s(this.hex,0,[0,5+this.foffset],"30")};this.getSubjectString=function(){return k.hex2dn(this.getSubjectHex())};this.getNotBefore=function(){var n=o(this.hex,0,[0,4+this.foffset,0]);return n=n.replace(/(..)/g,"%$1"),decodeURIComponent(n)};this.getNotAfter=function(){var n=o(this.hex,0,[0,4+this.foffset,1]);return n=n.replace(/(..)/g,"%$1"),decodeURIComponent(n)};this.getPublicKeyHex=function(){return f.getTLVbyList(this.hex,0,[0,6+this.foffset],"30")};this.getPublicKeyIdx=function(){return h(this.hex,0,[0,6+this.foffset],"30")};this.getPublicKeyContentIdx=function(){var n=this.getPublicKeyIdx();return h(this.hex,n,[1,0],"30")};this.getPublicKey=function(){return l.getKey(this.getPublicKeyHex(),null,"pkcs8pub")};this.getSignatureAlgorithmName=function(){var n=s(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(n)};this.getSignatureValueHex=function(){return o(this.hex,0,[2],"03",!0)};this.verifySignature=function(n){var r=this.getSignatureAlgorithmField(),u=this.getSignatureValueHex(),f=s(this.hex,0,[0],"30"),t=new i.crypto.Signature({alg:r});return t.init(n),t.updateHex(f),t.verify(u)};this.parseExt=function(n){var c,i,t,a,u,s,l,v;if(void 0===n){if(t=this.hex,3!==this.version)return-1;c=h(t,0,[0,7,0],"30");i=r(t,c)}else{if(t=ft(n),a=h(t,0,[0,3,0,0],"06"),"2a864886f70d01090e"!=e(t,a))return void(this.aExtInfo=[]);c=h(t,0,[0,3,0,1,0],"30");i=r(t,c);this.hex=t}for(this.aExtInfo=[],u=0;u<i.length;u++)s={critical:!1},l=0,3===r(t,i[u]).length&&(s.critical=!0,l=1),s.oid=f.hextooidstr(o(t,i[u],[0],"06")),v=h(t,i[u],[1+l]),s.vidx=g(t,v),this.aExtInfo.push(s)};this.getExtInfo=function(n){var r=this.aExtInfo,u=n,t;if(n.match(/^[0-9.]+$/)||(u=i.asn1.x509.OID.name2oid(n)),""!==u)for(t=0;t<r.length;t++)if(r[t].oid===u)return r[t]};this.getExtBasicConstraints=function(n,i){var u,r,f,o;if(void 0===n&&void 0===i){if(u=this.getExtInfo("basicConstraints"),void 0===u)return;n=t(this.hex,u.vidx);i=u.critical}if(r={extname:"basicConstraints"},i&&(r.critical=!0),"3000"===n)return r;if("30030101ff"===n)return r.cA=!0,r;if("30060101ff02"===n.substr(0,12))return f=e(n,10),o=parseInt(f,16),r.cA=!0,r.pathLen=o,r;throw new Error("hExtV parse error: "+n);};this.getExtKeyUsage=function(n,i){var r,u;if(void 0===n&&void 0===i){if(r=this.getExtInfo("keyUsage"),void 0===r)return;n=t(this.hex,r.vidx);i=r.critical}return u={extname:"keyUsage"},i&&(u.critical=!0),u.names=this.getExtKeyUsageString(n).split(","),u};this.getExtKeyUsageBin=function(n){var r,i;if(void 0===n){if(r=this.getExtInfo("keyUsage"),void 0===r)return"";n=t(this.hex,r.vidx)}if(8!=n.length&&10!=n.length)throw new Error("malformed key usage value: "+n);return i="000000000000000"+parseInt(n.substr(6),16).toString(2),8==n.length&&(i=i.slice(-8)),10==n.length&&(i=i.slice(-16)),""==(i=i.replace(/0+$/,""))&&(i="0"),i};this.getExtKeyUsageString=function(n){for(var i=this.getExtKeyUsageBin(n),r=[],t=0;t<i.length;t++)"1"==i.substr(t,1)&&r.push(a.KEYUSAGE_NAME[t]);return r.join(",")};this.getExtSubjectKeyIdentifier=function(n,i){var r,u,f;if(void 0===n&&void 0===i){if(r=this.getExtInfo("subjectKeyIdentifier"),void 0===r)return;n=t(this.hex,r.vidx);i=r.critical}return u={extname:"subjectKeyIdentifier"},i&&(u.critical=!0),f=e(n,0),u.kid={hex:f},u};this.getExtAuthorityKeyIdentifier=function(n,i){var s,f,o,u,h,c,l;if(void 0===n&&void 0===i){if(s=this.getExtInfo("authorityKeyIdentifier"),void 0===s)return;n=t(this.hex,s.vidx);i=s.critical}for(f={extname:"authorityKeyIdentifier"},i&&(f.critical=!0),o=r(n,0),u=0;u<o.length;u++)h=n.substr(o[u],2),("80"===h&&(f.kid={hex:e(n,o[u])}),"a1"===h)&&(c=t(n,o[u]),l=this.getGeneralNames(c),f.issuer=l[0].dn),"82"===h&&(f.sn={hex:e(n,o[u])});return f};this.getExtExtKeyUsage=function(n,i){var u,f,s,o;if(void 0===n&&void 0===i){if(u=this.getExtInfo("extKeyUsage"),void 0===u)return;n=t(this.hex,u.vidx);i=u.critical}for(f={extname:"extKeyUsage",array:[]},i&&(f.critical=!0),s=r(n,0),o=0;o<s.length;o++)f.array.push(v(e(n,s[o])));return f};this.getExtExtKeyUsageName=function(){var f=this.getExtInfo("extKeyUsage"),n,i,o,u;if(void 0===f)return f;if(n=[],i=t(this.hex,f.vidx),""===i)return n;for(o=r(i,0),u=0;u<o.length;u++)n.push(v(e(i,o[u])));return n};this.getExtSubjectAltName=function(n,i){var r,u;if(void 0===n&&void 0===i){if(r=this.getExtInfo("subjectAltName"),void 0===r)return;n=t(this.hex,r.vidx);i=r.critical}return u={extname:"subjectAltName",array:[]},i&&(u.critical=!0),u.array=this.getGeneralNames(n),u};this.getExtIssuerAltName=function(n,i){var r,u;if(void 0===n&&void 0===i){if(r=this.getExtInfo("issuerAltName"),void 0===r)return;n=t(this.hex,r.vidx);i=r.critical}return u={extname:"issuerAltName",array:[]},i&&(u.critical=!0),u.array=this.getGeneralNames(n),u};this.getGeneralNames=function(n){for(var u,f=r(n,0),e=[],i=0;i<f.length;i++)u=this.getGeneralName(t(n,f[i])),void 0!==u&&e.push(u);return e};this.getGeneralName=function(n){var t=n.substr(0,2),i=e(n,0),r=nt(i);return"81"==t?{rfc822:r}:"82"==t?{dns:r}:"86"==t?{uri:r}:"87"==t?{ip:sr(i)}:"a4"==t?{dn:this.getX500Name(i)}:void 0};this.getExtSubjectAltName2=function(){var i,n,u,s=this.getExtInfo("subjectAltName");if(void 0===s)return s;for(var f=[],h=t(this.hex,s.vidx),c=r(h,0),o=0;o<c.length;o++)u=h.substr(c[o],2),i=e(h,c[o]),"81"===u&&(n=p(i),f.push(["MAIL",n])),"82"===u&&(n=p(i),f.push(["DNS",n])),"84"===u&&(n=a.hex2dn(i,0),f.push(["DN",n])),"86"===u&&(n=p(i),f.push(["URI",n])),"87"===u&&(n=sr(i),f.push(["IP",n]));return f};this.getExtCRLDistributionPoints=function(n,i){var u,f,o,e,s;if(void 0===n&&void 0===i){if(u=this.getExtInfo("cRLDistributionPoints"),void 0===u)return;n=t(this.hex,u.vidx);i=u.critical}for(f={extname:"cRLDistributionPoints",array:[]},i&&(f.critical=!0),o=r(n,0),e=0;e<o.length;e++)s=t(n,o[e]),f.array.push(this.getDistributionPoint(s));return f};this.getDistributionPoint=function(n){for(var e,o,f={},u=r(n,0),i=0;i<u.length;i++)e=n.substr(u[i],2),o=t(n,u[i]),"a0"==e&&(f.dpname=this.getDistributionPointName(o));return f};this.getDistributionPointName=function(n){for(var e,o,f={},u=r(n,0),i=0;i<u.length;i++)e=n.substr(u[i],2),o=t(n,u[i]),"a0"==e&&(f.full=this.getGeneralNames(o));return f};this.getExtCRLDistributionPointsURI=function(){var n=this.getExtInfo("cRLDistributionPoints"),f;if(void 0===n)return n;for(var i=[],u=r(this.hex,n.vidx),t=0;t<u.length;t++)try{f=p(o(this.hex,u[t],[0,0,0],"86"));i.push(f)}catch(n){}return i};this.getExtAIAInfo=function(){var t=this.getExtInfo("authorityInfoAccess"),f,e;if(void 0===t)return t;for(var i={ocsp:[],caissuer:[]},u=r(this.hex,t.vidx),n=0;n<u.length;n++)f=o(this.hex,u[n],[0],"06"),e=o(this.hex,u[n],[1],"86"),"2b06010505073001"===f&&i.ocsp.push(p(e)),"2b06010505073002"===f&&i.caissuer.push(p(e));return i};this.getExtAuthorityInfoAccess=function(n,i){var e,u,s,f,h,l;if(void 0===n&&void 0===i){if(e=this.getExtInfo("authorityInfoAccess"),void 0===e)return;n=t(this.hex,e.vidx);i=e.critical}for(u={extname:"authorityInfoAccess",array:[]},i&&(u.critical=!0),s=r(n,0),f=0;f<s.length;f++)if(h=c(n,s[f],[0],"06"),l=p(o(n,s[f],[1],"86")),"2b06010505073001"==h)u.array.push({ocsp:l});else{if("2b06010505073002"!=h)throw new Error("unknown method: "+h);u.array.push({caissuer:l})}return u};this.getExtCertificatePolicies=function(n,i){var u,f,o,e,s,h;if(void 0===n&&void 0===i){if(u=this.getExtInfo("certificatePolicies"),void 0===u)return;n=t(this.hex,u.vidx);i=u.critical}for(f={extname:"certificatePolicies",array:[]},i&&(f.critical=!0),o=r(n,0),e=0;e<o.length;e++)s=t(n,o[e]),h=this.getPolicyInformation(s),f.array.push(h);return f};this.getPolicyInformation=function(n){var i={},c=o(n,0,[0],"06"),f,e,u,s,h;if(i.policyoid=v(c),f=b(n,0,[1],"30"),-1!=f)for(i.array=[],e=r(n,f),u=0;u<e.length;u++)s=t(n,e[u]),h=this.getPolicyQualifierInfo(s),i.array.push(h);return i};this.getPolicyQualifierInfo=function(n){var t={},i=o(n,0,[0],"06"),r,u;return"2b06010505070201"===i?(r=c(n,0,[1],"16"),t.cps=nt(r)):"2b06010505070202"===i&&(u=s(n,0,[1],"30"),t.unotice=this.getUserNotice(u)),t};this.getUserNotice=function(n){for(var u,f={},e=r(n,0),i=0;i<e.length;i++)u=t(n,e[i]),"30"!=u.substr(0,2)&&(f.exptext=this.getDisplayText(u));return f};this.getDisplayText=function(n){var t={};return t.type={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"}[n.substr(0,2)],t.str=nt(e(n,0)),t};this.getExtCRLNumber=function(n,t){var i={extname:"cRLNumber"};if(t&&(i.critical=!0),"02"==n.substr(0,2))return i.num={hex:e(n,0)},i;throw new Error("hExtV parse error: "+n);};this.getExtCRLReason=function(n,t){var i={extname:"cRLReason"};if(t&&(i.critical=!0),"0a"==n.substr(0,2))return i.code=parseInt(e(n,0),16),i;throw new Error("hExtV parse error: "+n);};this.getExtOcspNonce=function(n,t){var i={extname:"ocspNonce"},r;return t&&(i.critical=!0),r=e(n,0),i.hex=r,i};this.getExtOcspNoCheck=function(n,t){var i={extname:"ocspNoCheck"};return t&&(i.critical=!0),i};this.getExtAdobeTimeStamp=function(n,i){var e,u,f,h,o,s;if(void 0===n&&void 0===i){if(e=this.getExtInfo("adobeTimeStamp"),void 0===e)return;n=t(this.hex,e.vidx);i=e.critical}return u={extname:"adobeTimeStamp"},i&&(u.critical=!0),f=r(n,0),f.length>1&&(h=t(n,f[1]),o=this.getGeneralName(h),null!=o.uri&&(u.uri=o.uri)),f.length>2&&(s=t(n,f[2]),"0101ff"==s&&(u.reqauth=!0),"010100"==s&&(u.reqauth=!1)),u};this.getX500NameRule=function(n){for(var o,f,u=null,e=[],t=0;t<n.length;t++)for(o=n[t],f=0;f<o.length;f++)e.push(o[f]);for(t=0;t<e.length;t++){var s=e[t],r=s.ds,c=s.value,h=s.type;if("prn"!=r&&"utf8"!=r&&"ia5"!=r)return"mixed";if("ia5"==r){if("CN"!=h)return"mixed";if(i.lang.String.isMail(c))continue;return"mixed"}if("C"==h){if("prn"==r)continue;return"mixed"}if(null==u)u=r;else if(u!==r)return"mixed"}return null==u?"prn":u};this.getX500Name=function(n){var t=this.getX500NameArray(n);return{array:t,str:this.dnarraytostr(t)}};this.getX500NameArray=function(n){for(var u=[],f=r(n,0),i=0;i<f.length;i++)u.push(this.getRDN(t(n,f[i])));return u};this.getRDN=function(n){for(var u=[],f=r(n,0),i=0;i<f.length;i++)u.push(this.getAttrTypeAndValue(t(n,f[i])));return u};this.getAttrTypeAndValue=function(n){var t={type:null,value:null,ds:null},u=r(n,0),f=o(n,u[0],[],"06"),e=o(n,u[1],[]),s=i.asn1.ASN1Util.oidHexToInt(f);return t.type=i.asn1.x509.OID.oid2atype(s),t.value=nt(e),t.ds=this.HEX2STAG[n.substr(u[1],2)],t};this.readCertPEM=function(n){this.readCertHex(it(n))};this.readCertHex=function(n){this.hex=n;this.getVersion();try{h(this.hex,0,[0,7],"a3");this.parseExt()}catch(n){}};this.getParam=function(){var n={};return n.version=this.getVersion(),n.serial={hex:this.getSerialNumberHex()},n.sigalg=this.getSignatureAlgorithmField(),n.issuer=this.getIssuer(),n.notbefore=this.getNotBefore(),n.notafter=this.getNotAfter(),n.subject=this.getSubject(),n.sbjpubkey=d(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo.length>0&&(n.ext=this.getExtParamArray()),n.sighex=this.getSignatureValueHex(),n};this.getExtParamArray=function(n){var o,u;null==n&&-1!=b(this.hex,0,[0,"[3]"])&&(n=w(this.hex,0,[0,"[3]",0],"30"));for(var f=[],e=r(n,0),i=0;i<e.length;i++)o=t(n,e[i]),u=this.getExtParam(o),null!=u&&f.push(u);return f};this.getExtParam=function(n){var e=r(n,0).length,u,t,f,i,h;if(2!=e&&3!=e)throw new Error("wrong number elements in Extension: "+e+" "+n);return(u=tt(o(n,0,[0],"06")),t=!1,3==e&&"0101ff"==s(n,0,[1])&&(t=!0),f=s(n,0,[e-1,0]),i=void 0,"2.5.29.14"==u?i=this.getExtSubjectKeyIdentifier(f,t):"2.5.29.15"==u?i=this.getExtKeyUsage(f,t):"2.5.29.17"==u?i=this.getExtSubjectAltName(f,t):"2.5.29.18"==u?i=this.getExtIssuerAltName(f,t):"2.5.29.19"==u?i=this.getExtBasicConstraints(f,t):"2.5.29.31"==u?i=this.getExtCRLDistributionPoints(f,t):"2.5.29.32"==u?i=this.getExtCertificatePolicies(f,t):"2.5.29.35"==u?i=this.getExtAuthorityKeyIdentifier(f,t):"2.5.29.37"==u?i=this.getExtExtKeyUsage(f,t):"1.3.6.1.5.5.7.1.1"==u?i=this.getExtAuthorityInfoAccess(f,t):"2.5.29.20"==u?i=this.getExtCRLNumber(f,t):"2.5.29.21"==u?i=this.getExtCRLReason(f,t):"1.3.6.1.5.5.7.48.1.2"==u?i=this.getExtOcspNonce(f,t):"1.3.6.1.5.5.7.48.1.5"==u?i=this.getExtOcspNoCheck(f,t):"1.2.840.113583.1.1.9.1"==u&&(i=this.getExtAdobeTimeStamp(f,t)),null!=i)?i:(h={extname:u,extn:f},t&&(h.critical=!0),h)};this.findExt=function(n,t){for(var i=0;i<n.length;i++)if(n[i].extname==t)return n[i];return null};this.updateExtCDPFullURI=function(n,t){var u=this.findExt(n,"cRLDistributionPoints"),r,i,f,e,o;if(null!=u&&null!=u.array)for(r=u.array,i=0;i<r.length;i++)if(null!=r[i].dpname&&null!=r[i].dpname.full)for(f=r[i].dpname.full,e=0;e<f.length;e++)o=f[i],null!=o.uri&&(o.uri=t)};this.updateExtAIAOCSP=function(n,t){var u=this.findExt(n,"authorityInfoAccess"),r,i;if(null!=u&&null!=u.array)for(r=u.array,i=0;i<r.length;i++)null!=r[i].ocsp&&(r[i].ocsp=t)};this.updateExtAIACAIssuer=function(n,t){var u=this.findExt(n,"authorityInfoAccess"),r,i;if(null!=u&&null!=u.array)for(r=u.array,i=0;i<r.length;i++)null!=r[i].caissuer&&(r[i].caissuer=t)};this.dnarraytostr=function(n){return"/"+n.map(function(n){return function(n){return n.map(function(n){return function(n){return n.type+"="+n.value}(n)}).join("+")}(n)}).join("/")};this.getInfo=function(){var n,r,o,c=function(n){return JSON.stringify(n.array).replace(/[\[\]\{\}\"]/g,"")},l=function(n){for(var t,i,f,r="",e=n.array,u=0;u<e.length;u++)if(t=e[u],r+=" policy oid: "+t.policyoid+"\n",void 0!==t.array)for(i=0;i<t.array.length;i++)f=t.array[i],void 0!==f.cps&&(r+=" cps: "+f.cps+"\n");return r},v=function(n){for(var t,i="",u=n.array,r=0;r<u.length;r++){t=u[r];try{void 0!==t.dpname.full[0].uri&&(i+=" "+t.dpname.full[0].uri+"\n")}catch(n){}try{void 0!==t.dname.full[0].dn.hex&&(i+=" "+a.hex2dn(t.dpname.full[0].dn.hex)+"\n")}catch(n){}}return i},y=function(n){for(var t,i="",u=n.array,r=0;r<u.length;r++)t=u[r],void 0!==t.caissuer&&(i+=" caissuer: "+t.caissuer+"\n"),void 0!==t.ocsp&&(i+=" ocsp: "+t.ocsp+"\n");return i},u,f,t,s,e,h;if(n="Basic Fields\n",n+=" serial number: "+this.getSerialNumberHex()+"\n",n+=" signature algorithm: "+this.getSignatureAlgorithmField()+"\n",n+=" issuer: "+this.getIssuerString()+"\n",n+=" notBefore: "+this.getNotBefore()+"\n",n+=" notAfter: "+this.getNotAfter()+"\n",n+=" subject: "+this.getSubjectString()+"\n",n+=" subject public key info: \n",n+=" key algorithm: "+(r=this.getPublicKey()).type+"\n","RSA"===r.type&&(n+=" n="+hr(r.n.toString(16)).substr(0,16)+"...\n",n+=" e="+hr(r.e.toString(16))+"\n"),null!=(o=this.aExtInfo))for(n+="X509v3 Extensions:\n",u=0;u<o.length;u++)f=o[u],t=i.asn1.x509.OID.oid2name(f.oid),""===t&&(t=f.oid),s="",(!0===f.critical&&(s="CRITICAL"),n+=" "+t+" "+s+":\n","basicConstraints"===t)?(e=this.getExtBasicConstraints(),void 0===e.cA?n+=" {}\n":(n+=" cA=true",void 0!==e.pathLen&&(n+=", pathLen="+e.pathLen),n+="\n")):"keyUsage"===t?n+=" "+this.getExtKeyUsageString()+"\n":"subjectKeyIdentifier"===t?n+=" "+this.getExtSubjectKeyIdentifier().kid.hex+"\n":"authorityKeyIdentifier"===t?(h=this.getExtAuthorityKeyIdentifier(),void 0!==h.kid&&(n+=" kid="+h.kid.hex+"\n")):"extKeyUsage"===t?n+=" "+this.getExtExtKeyUsage().array.join(", ")+"\n":"subjectAltName"===t?n+=" "+c(this.getExtSubjectAltName())+"\n":"cRLDistributionPoints"===t?n+=v(this.getExtCRLDistributionPoints()):"authorityInfoAccess"===t?n+=y(this.getExtAuthorityInfoAccess()):"certificatePolicies"===t&&(n+=l(this.getExtCertificatePolicies()));return(n+="signature algorithm: "+this.getSignatureAlgorithmName()+"\n")+"signature: "+this.getSignatureValueHex().substr(0,16)+"...\n"};"string"==typeof n&&(-1!=n.indexOf("-----BEGIN")?this.readCertPEM(n):i.lang.String.isHex(n)&&this.readCertHex(n))}var h,wt,hi,ri,bt,kt,ci,lr,bi,ar,ki,vr,f,st,lt,ni,tt,ui,gi,g,y,b,dr,it,ir,rr,ur,fr,i,oi,rt,u,cr,l,hu,vu,yu,pu,wu,bu,ku,du,gu,nf,tf;Object.defineProperty(t,"__esModule",{value:!0});var w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},ii={userAgent:!1},pt={};for(void 0===h&&(h={}),h.lang={extend:function(n,t,i){var u,r,f,e;if(!t||!n)throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");if(u=function(){},u.prototype=t.prototype,n.prototype=new u,n.prototype.constructor=n,n.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t),i){for(r in i)n.prototype[r]=i[r];f=function(){};e=["toString","valueOf"];try{/MSIE/.test(ii.userAgent)&&(f=function(n,t){for(r=0;r<e.length;r+=1){var i=e[r],u=t[i];"function"==typeof u&&u!=Object.prototype[i]&&(n[i]=u)}})}catch(n){}f(n.prototype,i)}}},f=f||(wt=Math,ri=(hi={}).lib={},bt=ri.Base=function(){function n(){}return{extend:function(t){n.prototype=this;var i=new n;return t&&i.mixIn(t),i.hasOwnProperty("init")||(i.init=function(){i.$super.init.apply(this,arguments)}),i.init.prototype=i,i.$super=this,i},create:function(){var n=this.extend();return n.init.apply(n,arguments),n},init:function(){},mixIn:function(n){for(var t in n)n.hasOwnProperty(t)&&(this[t]=n[t]);n.hasOwnProperty("toString")&&(this.toString=n.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),kt=ri.WordArray=bt.extend({init:function(n,t){n=this.words=n||[];this.sigBytes=null!=t?t:4*n.length},toString:function(n){return(n||lr).stringify(this)},concat:function(n){var u=this.words,f=n.words,i=this.sigBytes,r=n.sigBytes,t,e;if(this.clamp(),i%4)for(t=0;t<r;t++)e=f[t>>>2]>>>24-t%4*8&255,u[i+t>>>2]|=e<<24-(i+t)%4*8;else for(t=0;t<r;t+=4)u[i+t>>>2]=f[t>>>2];return this.sigBytes+=r,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8;t.length=wt.ceil(n/4)},clone:function(){var n=bt.clone.call(this);return n.words=this.words.slice(0),n},random:function(n){for(var t=[],i=0;i<n;i+=4)t.push(4294967296*wt.random()|0);return new kt.init(t,n)}}),ci=hi.enc={},lr=ci.Hex={stringify:function(n){for(var r,u=n.words,f=n.sigBytes,i=[],t=0;t<f;t++)r=u[t>>>2]>>>24-t%4*8&255,i.push((r>>>4).toString(16)),i.push((15&r).toString(16));return i.join("")},parse:function(n){for(var i=n.length,r=[],t=0;t<i;t+=2)r[t>>>3]|=parseInt(n.substr(t,2),16)<<24-t%8*4;return new kt.init(r,i/2)}},bi=ci.Latin1={stringify:function(n){for(var r,u=n.words,f=n.sigBytes,i=[],t=0;t<f;t++)r=u[t>>>2]>>>24-t%4*8&255,i.push(String.fromCharCode(r));return i.join("")},parse:function(n){for(var i=n.length,r=[],t=0;t<i;t++)r[t>>>2]|=(255&n.charCodeAt(t))<<24-t%4*8;return new kt.init(r,i)}},ar=ci.Utf8={stringify:function(n){try{return decodeURIComponent(escape(bi.stringify(n)))}catch(n){throw new Error("Malformed UTF-8 data");}},parse:function(n){return bi.parse(unescape(encodeURIComponent(n)))}},ki=ri.BufferedBlockAlgorithm=bt.extend({reset:function(){this._data=new kt.init;this._nDataBytes=0},_append:function(n){"string"==typeof n&&(n=ar.parse(n));this._data.concat(n);this._nDataBytes+=n.sigBytes},_process:function(n){var r=this._data,e=r.words,o=r.sigBytes,u=this.blockSize,f=o/(4*u),t=(f=n?wt.ceil(f):wt.max((0|f)-this._minBufferSize,0))*u,s=wt.min(4*t,o),i,h;if(t){for(i=0;i<t;i+=u)this._doProcessBlock(e,i);h=e.splice(0,t);r.sigBytes-=s}return new kt.init(h,s)},clone:function(){var n=bt.clone.call(this);return n._data=this._data.clone(),n},_minBufferSize:0}),ri.Hasher=ki.extend({cfg:bt.extend(),init:function(n){this.cfg=this.cfg.extend(n);this.reset()},reset:function(){ki.reset.call(this);this._doReset()},update:function(n){return this._append(n),this._process(),this},finalize:function(n){return n&&this._append(n),this._doFinalize()},blockSize:16,_createHelper:function(n){return function(t,i){return new n.init(i).finalize(t)}},_createHmacHelper:function(n){return function(t,i){return new vr.HMAC.init(n,i).finalize(t)}}}),vr=hi.algo={},hi),!function(){var n,i=(n=f).lib,t=i.Base,r=i.WordArray;(n=n.x64={}).Word=t.extend({init:function(n,t){this.high=n;this.low=t}});n.WordArray=t.extend({init:function(n,t){n=this.words=n||[];this.sigBytes=null!=t?t:8*n.length},toX32:function(){for(var i,u=this.words,f=u.length,n=[],t=0;t<f;t++)i=u[t],n.push(i.high),n.push(i.low);return r.create(n,this.sigBytes)},clone:function(){for(var r=t.clone.call(this),i=r.words=this.words.slice(0),u=i.length,n=0;n<u;n++)i[n]=i[n].clone();return r}})}(),function(){var n=f,t=n.lib.WordArray;n.enc.Base64={stringify:function(n){var i=n.words,u=n.sigBytes,f=this._map,t,e,r;for(n.clamp(),n=[],t=0;t<u;t+=3)for(e=(i[t>>>2]>>>24-t%4*8&255)<<16|(i[t+1>>>2]>>>24-(t+1)%4*8&255)<<8|i[t+2>>>2]>>>24-(t+2)%4*8&255,r=0;4>r&&t+.75*r<u;r++)n.push(f.charAt(e>>>6*(3-r)&63));if(i=f.charAt(64))for(;n.length%4;)n.push(i);return n.join("")},parse:function(n){var e=n.length,f=this._map,o,s;(r=f.charAt(64))&&-1!=(r=n.indexOf(r))&&(e=r);for(var r=[],u=0,i=0;i<e;i++)i%4&&(o=f.indexOf(n.charAt(i-1))<<i%4*2,s=f.indexOf(n.charAt(i))>>>6-i%4*2,r[u>>>2]|=(o|s)<<24-u%4*8,u++);return t.create(r,u)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(n){for(var r,v,h,t,e=f,y=(i=e.lib).WordArray,o=i.Hasher,i=e.algo,c=[],l=[],a=function(n){return 4294967296*(n-(0|n))|0},s=2,u=0;64>u;){n:{for(r=s,v=n.sqrt(r),h=2;h<=v;h++)if(!(r%h)){r=!1;break n}r=!0}r&&(8>u&&(c[u]=a(n.pow(s,.5))),l[u]=a(n.pow(s,1/3)),u++);s++}t=[];i=i.SHA256=o.extend({_doReset:function(){this._hash=new y.init(c.slice(0))},_doProcessBlock:function(n,i){for(var o,s,r=this._hash.words,f=r[0],h=r[1],c=r[2],y=r[3],e=r[4],a=r[5],v=r[6],p=r[7],u=0;64>u;u++)16>u?t[u]=0|n[i+u]:(o=t[u-15],s=t[u-2],t[u]=((o<<25|o>>>7)^(o<<14|o>>>18)^o>>>3)+t[u-7]+((s<<15|s>>>17)^(s<<13|s>>>19)^s>>>10)+t[u-16]),o=p+((e<<26|e>>>6)^(e<<21|e>>>11)^(e<<7|e>>>25))+(e&a^~e&v)+l[u]+t[u],s=((f<<30|f>>>2)^(f<<19|f>>>13)^(f<<10|f>>>22))+(f&h^f&c^h&c),p=v,v=a,a=e,e=y+o|0,y=c,c=h,h=f,f=o+s|0;r[0]=r[0]+f|0;r[1]=r[1]+h|0;r[2]=r[2]+c|0;r[3]=r[3]+y|0;r[4]=r[4]+e|0;r[5]=r[5]+a|0;r[6]=r[6]+v|0;r[7]=r[7]+p|0},_doFinalize:function(){var r=this._data,t=r.words,u=8*this._nDataBytes,i=8*r.sigBytes;return t[i>>>5]|=128<<24-i%32,t[14+(i+64>>>9<<4)]=n.floor(u/4294967296),t[15+(i+64>>>9<<4)]=u,r.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var n=o.clone.call(this);return n._hash=this._hash.clone(),n}});e.SHA256=o._createHelper(i);e.HmacSHA256=o._createHmacHelper(i)}(Math),function(){function n(){return t.create.apply(t,arguments)}for(var u=f,e=u.lib.Hasher,t=(i=u.x64).Word,s=i.WordArray,i=u.algo,h=[n(1116352408,3609767458),n(1899447441,602891725),n(3049323471,3964484399),n(3921009573,2173295548),n(961987163,4081628472),n(1508970993,3053834265),n(2453635748,2937671579),n(2870763221,3664609560),n(3624381080,2734883394),n(310598401,1164996542),n(607225278,1323610764),n(1426881987,3590304994),n(1925078388,4068182383),n(2162078206,991336113),n(2614888103,633803317),n(3248222580,3479774868),n(3835390401,2666613458),n(4022224774,944711139),n(264347078,2341262773),n(604807628,2007800933),n(770255983,1495990901),n(1249150122,1856431235),n(1555081692,3175218132),n(1996064986,2198950837),n(2554220882,3999719339),n(2821834349,766784016),n(2952996808,2566594879),n(3210313671,3203337956),n(3336571891,1034457026),n(3584528711,2466948901),n(113926993,3758326383),n(338241895,168717936),n(666307205,1188179964),n(773529912,1546045734),n(1294757372,1522805485),n(1396182291,2643833823),n(1695183700,2343527390),n(1986661051,1014477480),n(2177026350,1206759142),n(2456956037,344077627),n(2730485921,1290863460),n(2820302411,3158454273),n(3259730800,3505952657),n(3345764771,106217008),n(3516065817,3606008344),n(3600352804,1432725776),n(4094571909,1467031594),n(275423344,851169720),n(430227734,3100823752),n(506948616,1363258195),n(659060556,3750685593),n(883997877,3785050280),n(958139571,3318307427),n(1322822218,3812723403),n(1537002063,2003034995),n(1747873779,3602036899),n(1955562222,1575990012),n(2024104815,1125592928),n(2227730452,2716904306),n(2361852424,442776044),n(2428436474,593698344),n(2756734187,3733110249),n(3204031479,2999351573),n(3329325298,3815920427),n(3391569614,3928383900),n(3515267271,566280711),n(3940187606,3454069534),n(4118630271,4000239992),n(116418474,1914138554),n(174292421,2731055270),n(289380356,3203993006),n(460393269,320620315),n(685471733,587496836),n(852142971,1086792851),n(1017036298,365543100),n(1126000580,2618297676),n(1288033470,3409855158),n(1501505948,4234509866),n(1607167915,987167468),n(1816402316,1246189591)],r=[],o=0;80>o;o++)r[o]=n();i=i.SHA512=e.extend({_doReset:function(){this._hash=new s.init([new t.init(1779033703,4089235720),new t.init(3144134277,2227873595),new t.init(1013904242,4271175723),new t.init(2773480762,1595750129),new t.init(1359893119,2917565137),new t.init(2600822924,725511199),new t.init(528734635,4215389547),new t.init(1541459225,327033209)])},_doProcessBlock:function(n,t){for(var y,a,i,ft=(f=this._hash.words)[0],et=f[1],ot=f[2],st=f[3],ht=f[4],ct=f[5],lt=f[6],f=f[7],ui=ft.high,at=ft.low,fi=et.high,vt=et.low,ei=ot.high,yt=ot.low,oi=st.high,pt=st.low,si=ht.high,wt=ht.low,hi=ct.high,bt=ct.low,ci=lt.high,kt=lt.low,li=f.high,dt=f.low,s=ui,e=at,g=fi,b=vt,nt=ei,k=yt,ti=oi,tt=pt,c=si,o=wt,gt=hi,it=bt,ni=ci,rt=kt,ii=li,ut=dt,l=0;80>l;l++){if(y=r[l],16>l)a=y.high=0|n[t+2*l],i=y.low=0|n[t+2*l+1];else{a=((i=(a=r[l-15]).high)>>>1|(v=a.low)<<31)^(i>>>8|v<<24)^i>>>7;var v=(v>>>1|i<<31)^(v>>>8|i<<24)^(v>>>7|i<<25),d=((i=(d=r[l-2]).high)>>>19|(u=d.low)<<13)^(i<<3|u>>>29)^i>>>6,u=(u>>>19|i<<13)^(u<<3|i>>>29)^(u>>>6|i<<26),ri=(i=r[l-7]).high,p=(w=r[l-16]).high,w=w.low;a=(a=(a=a+ri+((i=v+i.low)>>>0<v>>>0?1:0))+d+((i+=u)>>>0<u>>>0?1:0))+p+((i+=w)>>>0<w>>>0?1:0);y.high=a;y.low=i}ri=c>^~c∋w=o&it^~o&rt;y=s&g^s&nt^g&nt;var vi=e&b^e&k^b&k,yi=(v=(s>>>28|e<<4)^(s<<30|e>>>2)^(s<<25|e>>>7),d=(e>>>28|s<<4)^(e<<30|s>>>2)^(e<<25|s>>>7),(u=h[l]).high),ai=u.low;p=ii+((c>>>14|o<<18)^(c>>>18|o<<14)^(c<<23|o>>>9))+((u=ut+((o>>>14|c<<18)^(o>>>18|c<<14)^(o<<23|c>>>9)))>>>0<ut>>>0?1:0);ii=ni;ut=rt;ni=gt;rt=it;gt=c;it=o;c=ti+(p=(p=(p=p+ri+((u+=w)>>>0<w>>>0?1:0))+yi+((u+=ai)>>>0<ai>>>0?1:0))+a+((u+=i)>>>0<i>>>0?1:0))+((o=tt+u|0)>>>0<tt>>>0?1:0)|0;ti=nt;tt=k;nt=g;k=b;g=s;b=e;s=p+(y=v+y+((i=d+vi)>>>0<d>>>0?1:0))+((e=u+i|0)>>>0<u>>>0?1:0)|0}at=ft.low=at+e;ft.high=ui+s+(at>>>0<e>>>0?1:0);vt=et.low=vt+b;et.high=fi+g+(vt>>>0<b>>>0?1:0);yt=ot.low=yt+k;ot.high=ei+nt+(yt>>>0<k>>>0?1:0);pt=st.low=pt+tt;st.high=oi+ti+(pt>>>0<tt>>>0?1:0);wt=ht.low=wt+o;ht.high=si+c+(wt>>>0<o>>>0?1:0);bt=ct.low=bt+it;ct.high=hi+gt+(bt>>>0<it>>>0?1:0);kt=lt.low=kt+rt;lt.high=ci+ni+(kt>>>0<rt>>>0?1:0);dt=f.low=dt+ut;f.high=li+ii+(dt>>>0<ut>>>0?1:0)},_doFinalize:function(){var i=this._data,n=i.words,r=8*this._nDataBytes,t=8*i.sigBytes;return n[t>>>5]|=128<<24-t%32,n[30+(t+128>>>10<<5)]=Math.floor(r/4294967296),n[31+(t+128>>>10<<5)]=r,i.sigBytes=4*n.length,this._process(),this._hash.toX32()},clone:function(){var n=e.clone.call(this);return n._hash=this._hash.clone(),n},blockSize:32});u.SHA512=e._createHelper(i);u.HmacSHA512=e._createHmacHelper(i)}(),function(){var i=f,n=(t=i.x64).Word,u=t.WordArray,r=(t=i.algo).SHA512,t=t.SHA384=r.extend({_doReset:function(){this._hash=new u.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},_doFinalize:function(){var n=r._doFinalize.call(this);return n.sigBytes-=16,n}});i.SHA384=r._createHelper(t);i.HmacSHA384=r._createHmacHelper(t)}(),lt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/","Microsoft Internet Explorer"==ii.appName?(r.prototype.am=function(n,t,i,r,u,f){for(var o=32767&t,s=t>>15;--f>=0;){var e=32767&this[n],h=this[n++]>>15,c=s*e+h*o;u=((e=o*e+((32767&c)<<15)+i[r]+(1073741823&u))>>>30)+(c>>>15)+s*h+(u>>>30);i[r++]=1073741823&e}return u},st=30):"Netscape"!=ii.appName?(r.prototype.am=function(n,t,i,r,u,f){for(;--f>=0;){var e=t*this[n++]+i[r]+u;u=Math.floor(e/67108864);i[r++]=67108863&e}return u},st=26):(r.prototype.am=function(n,t,i,r,u,f){for(var o=16383&t,s=t>>14;--f>=0;){var e=16383&this[n],h=this[n++]>>14,c=s*e+h*o;u=((e=o*e+((16383&c)<<14)+i[r]+u)>>28)+(c>>14)+s*h;i[r++]=268435455&e}return u},st=28),r.prototype.DB=st,r.prototype.DM=(1<<st)-1,r.prototype.DV=1<<st,r.prototype.FV=Math.pow(2,52),r.prototype.F1=52-st,r.prototype.F2=2*st-52,ui=[],ni="0".charCodeAt(0),tt=0;tt<=9;++tt)ui[ni++]=tt;for(ni="a".charCodeAt(0),tt=10;tt<36;++tt)ui[ni++]=tt;for(ni="A".charCodeAt(0),tt=10;tt<36;++tt)ui[ni++]=tt;if(at.prototype.convert=function(n){return n.s<0||n.compareTo(this.m)>=0?n.mod(this.m):n},at.prototype.revert=function(n){return n},at.prototype.reduce=function(n){n.divRemTo(this.m,null,n)},at.prototype.mulTo=function(n,t,i){n.multiplyTo(t,i);this.reduce(i)},at.prototype.sqrTo=function(n,t){n.squareTo(t);this.reduce(t)},vt.prototype.convert=function(n){var t=o();return n.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),n.s<0&&t.compareTo(r.ZERO)>0&&this.m.subTo(t,t),t},vt.prototype.revert=function(n){var t=o();return n.copyTo(t),this.reduce(t),t},vt.prototype.reduce=function(n){for(var t,i,r;n.t<=this.mt2;)n[n.t++]=0;for(t=0;t<this.m.t;++t)for(i=32767&n[t],r=i*this.mpl+((i*this.mph+(n[t]>>15)*this.mpl&this.um)<<15)&n.DM,n[i=t+this.m.t]+=this.m.am(0,r,n,t,0,this.m.t);n[i]>=n.DV;)n[i]-=n.DV,n[++i]++;n.clamp();n.drShiftTo(this.m.t,n);n.compareTo(this.m)>=0&&n.subTo(this.m,n)},vt.prototype.mulTo=function(n,t,i){n.multiplyTo(t,i);this.reduce(i)},vt.prototype.sqrTo=function(n,t){n.squareTo(t);this.reduce(t)},r.prototype.copyTo=function(n){for(var t=this.t-1;t>=0;--t)n[t]=this[t];n.t=this.t;n.s=this.s},r.prototype.fromInt=function(n){this.t=1;this.s=n<0?-1:0;n>0?this[0]=n:n<-1?this[0]=n+this.DV:this.t=0},r.prototype.fromString=function(n,t){var u,f;if(16==t)u=4;else if(8==t)u=3;else if(256==t)u=8;else if(2==t)u=1;else if(32==t)u=5;else{if(4!=t)return void this.fromRadix(n,t);u=2}this.t=0;this.s=0;for(var e=n.length,o=!1,i=0;--e>=0;)f=8==u?255&n[e]:pr(n,e),f<0?"-"==n.charAt(e)&&(o=!0):(o=!1,0==i?this[this.t++]=f:i+u>this.DB?(this[this.t-1]|=(f&(1<<this.DB-i)-1)<<i,this[this.t++]=f>>this.DB-i):this[this.t-1]|=f<<i,(i+=u)>=this.DB&&(i-=this.DB));8==u&&0!=(128&n[0])&&(this.s=-1,i>0&&(this[this.t-1]|=(1<<this.DB-i)-1<<i));this.clamp();o&&r.ZERO.subTo(this,this)},r.prototype.clamp=function(){for(var n=this.s&this.DM;this.t>0&&this[this.t-1]==n;)--this.t},r.prototype.dlShiftTo=function(n,t){for(var i=this.t-1;i>=0;--i)t[i+n]=this[i];for(i=n-1;i>=0;--i)t[i]=0;t.t=this.t+n;t.s=this.s},r.prototype.drShiftTo=function(n,t){for(var i=n;i<this.t;++i)t[i-n]=this[i];t.t=Math.max(this.t-n,0);t.s=this.s},r.prototype.lShiftTo=function(n,t){for(var u=n%this.DB,e=this.DB-u,o=(1<<e)-1,r=Math.floor(n/this.DB),f=this.s<<u&this.DM,i=this.t-1;i>=0;--i)t[i+r+1]=this[i]>>e|f,f=(this[i]&o)<<u;for(i=r-1;i>=0;--i)t[i]=0;t[r]=f;t.t=this.t+r+1;t.s=this.s;t.clamp()},r.prototype.rShiftTo=function(n,t){var i,r;if(t.s=this.s,i=Math.floor(n/this.DB),i>=this.t)t.t=0;else{var u=n%this.DB,f=this.DB-u,e=(1<<u)-1;for(t[0]=this[i]>>u,r=i+1;r<this.t;++r)t[r-i-1]|=(this[r]&e)<<f,t[r-i]=this[r]>>u;u>0&&(t[this.t-i-1]|=(this.s&e)<<f);t.t=this.t-i;t.clamp()}},r.prototype.subTo=function(n,t){for(var r=0,i=0,u=Math.min(n.t,this.t);r<u;)i+=this[r]-n[r],t[r++]=i&this.DM,i>>=this.DB;if(n.t<this.t){for(i-=n.s;r<this.t;)i+=this[r],t[r++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;r<n.t;)i-=n[r],t[r++]=i&this.DM,i>>=this.DB;i-=n.s}t.s=i<0?-1:0;i<-1?t[r++]=this.DV+i:i>0&&(t[r++]=i);t.t=r;t.clamp()},r.prototype.multiplyTo=function(n,t){var u=this.abs(),f=n.abs(),i=u.t;for(t.t=i+f.t;--i>=0;)t[i]=0;for(i=0;i<f.t;++i)t[i+u.t]=u.am(0,f[i],t,i,0,u.t);t.s=0;t.clamp();this.s!=n.s&&r.ZERO.subTo(t,t)},r.prototype.squareTo=function(n){for(var r,i=this.abs(),t=n.t=2*i.t;--t>=0;)n[t]=0;for(t=0;t<i.t-1;++t)r=i.am(t,i[t],n,2*t,0,1),(n[t+i.t]+=i.am(t+1,2*i[t],n,2*t+1,r,i.t-t-1))>=i.DV&&(n[t+i.t]-=i.DV,n[t+i.t+1]=1);n.t>0&&(n[n.t-1]+=i.am(t,i[t],n,2*t,0,1));n.s=0;n.clamp()},r.prototype.divRemTo=function(n,t,i){var s=n.abs(),l,f,a,y;if(!(s.t<=0)){if(l=this.abs(),l.t<s.t)return null!=t&&t.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=o());var u=o(),p=this.s,b=n.s,c=this.DB-li(s[s.t-1]);if(c>0?(s.lShiftTo(c,u),l.lShiftTo(c,i)):(s.copyTo(u),l.copyTo(i)),f=u.t,a=u[f-1],0!=a){var w=a*(1<<this.F1)+(f>1?u[f-2]>>this.F2:0),k=this.FV/w,d=(1<<this.F1)/w,g=1<<this.F2,h=i.t,v=h-f,e=null==t?o():t;for(u.dlShiftTo(v,e),i.compareTo(e)>=0&&(i[i.t++]=1,i.subTo(e,i)),r.ONE.dlShiftTo(f,e),e.subTo(u,u);u.t<f;)u[u.t++]=0;for(;--v>=0;)if(y=i[--h]==a?this.DM:Math.floor(i[h]*k+(i[h-1]+g)*d),(i[h]+=u.am(0,y,i,v,0,f))<y)for(u.dlShiftTo(v,e),i.subTo(e,i);i[h]<--y;)i.subTo(e,i);null!=t&&(i.drShiftTo(f,t),p!=b&&r.ZERO.subTo(t,t));i.t=f;i.clamp();c>0&&i.rShiftTo(c,i);p<0&&r.ZERO.subTo(i,i)}}},r.prototype.invDigit=function(){var t,n;return this.t<1?0:(t=this[0],0==(1&t))?0:(n=3&t,(n=(n=(n=(n=n*(2-(15&t)*n)&15)*(2-(255&t)*n)&255)*(2-((65535&t)*n&65535))&65535)*(2-t*n%this.DV)%this.DV)>0?this.DV-n:-n)},r.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},r.prototype.exp=function(n,t){var s;if(n>4294967295||n<1)return r.ONE;var i=o(),u=o(),f=t.convert(this),e=li(n)-1;for(f.copyTo(i);--e>=0;)(t.sqrTo(i,u),(n&1<<e)>0)?t.mulTo(u,f,i):(s=i,i=u,u=s);return t.revert(i)},r.prototype.toString=function(n){var t;if(this.s<0)return"-"+this.negate().toString(n);if(16==n)t=4;else if(8==n)t=3;else if(2==n)t=1;else if(32==n)t=5;else{if(4!=n)return this.toRadix(n);t=2}var u,o=(1<<t)-1,f=!1,e="",r=this.t,i=this.DB-r*this.DB%t;if(r-->0)for(i<this.DB&&(u=this[r]>>i)>0&&(f=!0,e=et(u));r>=0;)i<t?(u=(this[r]&(1<<i)-1)<<t-i,u|=this[--r]>>(i+=this.DB-t)):(u=this[r]>>(i-=t)&o,i<=0&&(i+=this.DB,--r)),u>0&&(f=!0),f&&(e+=et(u));return f?e:"0"},r.prototype.negate=function(){var n=o();return r.ZERO.subTo(this,n),n},r.prototype.abs=function(){return this.s<0?this.negate():this},r.prototype.compareTo=function(n){var t=this.s-n.s,i;if(0!=t)return t;if(i=this.t,0!=(t=i-n.t))return this.s<0?-t:t;for(;--i>=0;)if(0!=(t=this[i]-n[i]))return t;return 0},r.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+li(this[this.t-1]^this.s&this.DM)},r.prototype.mod=function(n){var t=o();return this.abs().divRemTo(n,null,t),this.s<0&&t.compareTo(r.ZERO)>0&&n.subTo(t,t),t},r.prototype.modPowInt=function(n,t){var i;return i=n<256||t.isEven()?new at(t):new vt(t),this.exp(n,i)},r.ZERO=ht(0),r.ONE=ht(1),fi.prototype.convert=kr,fi.prototype.revert=kr,fi.prototype.mulTo=function(n,t,i){n.multiplyTo(t,i)},fi.prototype.sqrTo=function(n,t){n.squareTo(t)},ti.prototype.convert=function(n){if(n.s<0||n.t>2*this.m.t)return n.mod(this.m);if(n.compareTo(this.m)<0)return n;var t=o();return n.copyTo(t),this.reduce(t),t},ti.prototype.revert=function(n){return n},ti.prototype.reduce=function(n){for(n.drShiftTo(this.m.t-1,this.r2),n.t>this.m.t+1&&(n.t=this.m.t+1,n.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);n.compareTo(this.r2)<0;)n.dAddOffset(1,this.m.t+1);for(n.subTo(this.r2,n);n.compareTo(this.m)>=0;)n.subTo(this.m,n)},ti.prototype.mulTo=function(n,t,i){n.multiplyTo(t,i);this.reduce(i)},ti.prototype.sqrTo=function(n,t){n.squareTo(t);this.reduce(t)},b=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],dr=67108864/b[b.length-1],r.prototype.chunkSize=function(n){return Math.floor(Math.LN2*this.DB/Math.log(n))},r.prototype.toRadix=function(n){if(null==n&&(n=10),0==this.signum()||n<2||n>36)return"0";var e=this.chunkSize(n),u=Math.pow(n,e),f=ht(u),t=o(),i=o(),r="";for(this.divRemTo(f,t,i);t.signum()>0;)r=(u+i.intValue()).toString(n).substr(1)+r,t.divRemTo(f,t,i);return i.intValue().toString(n)+r},r.prototype.fromRadix=function(n,t){var e;this.fromInt(0);null==t&&(t=10);for(var o=this.chunkSize(t),h=Math.pow(t,o),s=!1,u=0,i=0,f=0;f<n.length;++f)e=pr(n,f),e<0?"-"==n.charAt(f)&&0==this.signum()&&(s=!0):(i=t*i+e,++u>=o&&(this.dMultiply(h),this.dAddOffset(i,0),u=0,i=0));u>0&&(this.dMultiply(Math.pow(t,u)),this.dAddOffset(i,0));s&&r.ZERO.subTo(this,this)},r.prototype.fromNumber=function(n,t,i){if("number"==typeof t)if(n<2)this.fromInt(1);else for(this.fromNumber(n,i),this.testBit(n-1)||this.bitwiseTo(r.ONE.shiftLeft(n-1),di,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>n&&this.subTo(r.ONE.shiftLeft(n-1),this);else{var u=[],f=7&n;u.length=1+(n>>3);t.nextBytes(u);f>0?u[0]&=(1<<f)-1:u[0]=0;this.fromString(u,256)}},r.prototype.bitwiseTo=function(n,t,i){for(var u,f=Math.min(n.t,this.t),r=0;r<f;++r)i[r]=t(this[r],n[r]);if(n.t<this.t){for(u=n.s&this.DM,r=f;r<this.t;++r)i[r]=t(this[r],u);i.t=this.t}else{for(u=this.s&this.DM,r=f;r<n.t;++r)i[r]=t(u,n[r]);i.t=n.t}i.s=t(this.s,n.s);i.clamp()},r.prototype.changeBit=function(n,t){var i=r.ONE.shiftLeft(n);return this.bitwiseTo(i,t,i),i},r.prototype.addTo=function(n,t){for(var r=0,i=0,u=Math.min(n.t,this.t);r<u;)i+=this[r]+n[r],t[r++]=i&this.DM,i>>=this.DB;if(n.t<this.t){for(i+=n.s;r<this.t;)i+=this[r],t[r++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;r<n.t;)i+=n[r],t[r++]=i&this.DM,i>>=this.DB;i+=n.s}t.s=i<0?-1:0;i>0?t[r++]=i:i<-1&&(t[r++]=this.DV+i);t.t=r;t.clamp()},r.prototype.dMultiply=function(n){this[this.t]=this.am(0,n-1,this,0,0,this.t);++this.t;this.clamp()},r.prototype.dAddOffset=function(n,t){if(0!=n){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=n;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},r.prototype.multiplyLowerTo=function(n,t,i){var u,r=Math.min(this.t+n.t,t);for(i.s=0,i.t=r;r>0;)i[--r]=0;for(u=i.t-this.t;r<u;++r)i[r+this.t]=this.am(0,n[r],i,r,0,this.t);for(u=Math.min(n.t,t);r<u;++r)this.am(0,n[r],i,r,0,t-r);i.clamp()},r.prototype.multiplyUpperTo=function(n,t,i){--t;var r=i.t=this.t+n.t-t;for(i.s=0;--r>=0;)i[r]=0;for(r=Math.max(t-this.t,0);r<n.t;++r)i[this.t+r-t]=this.am(t-r,n[r],i,0,0,this.t+r-t);i.clamp();i.drShiftTo(1,i)},r.prototype.modInt=function(n){var r,t,i;if(n<=0)return 0;if(r=this.DV%n,t=this.s<0?n-1:0,this.t>0)if(0==r)t=this[0]%n;else for(i=this.t-1;i>=0;--i)t=(r*t+this[i])%n;return t},r.prototype.millerRabin=function(n){var i=this.subtract(r.ONE),u=i.getLowestSetBit(),s,f,e,t,h;if(u<=0)return!1;for(s=i.shiftRight(u),(n=n+1>>1)>b.length&&(n=b.length),f=o(),e=0;e<n;++e)if(f.fromInt(b[Math.floor(Math.random()*b.length)]),t=f.modPow(s,this),0!=t.compareTo(r.ONE)&&0!=t.compareTo(i)){for(h=1;h++<u&&0!=t.compareTo(i);)if(0==(t=t.modPowInt(2,this)).compareTo(r.ONE))return!1;if(0!=t.compareTo(i))return!1}return!0},r.prototype.clone=function(){var n=o();return this.copyTo(n),n},r.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},r.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},r.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},r.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},r.prototype.toByteArray=function(){var i=this.t,u=[],t,n,r;if(u[0]=this.s,n=this.DB-i*this.DB%8,r=0,i-->0)for(n<this.DB&&(t=this[i]>>n)!=(this.s&this.DM)>>n&&(u[r++]=t|this.s<<this.DB-n);i>=0;)n<8?(t=(this[i]&(1<<n)-1)<<8-n,t|=this[--i]>>(n+=this.DB-8)):(t=this[i]>>(n-=8)&255,n<=0&&(n+=this.DB,--i)),0!=(128&t)&&(t|=-256),0==r&&(128&this.s)!=(128&t)&&++r,(r>0||t!=this.s)&&(u[r++]=t);return u},r.prototype.equals=function(n){return 0==this.compareTo(n)},r.prototype.min=function(n){return this.compareTo(n)<0?this:n},r.prototype.max=function(n){return this.compareTo(n)>0?this:n},r.prototype.and=function(n){var t=o();return this.bitwiseTo(n,rf,t),t},r.prototype.or=function(n){var t=o();return this.bitwiseTo(n,di,t),t},r.prototype.xor=function(n){var t=o();return this.bitwiseTo(n,wr,t),t},r.prototype.andNot=function(n){var t=o();return this.bitwiseTo(n,br,t),t},r.prototype.not=function(){for(var n=o(),t=0;t<this.t;++t)n[t]=this.DM&~this[t];return n.t=this.t,n.s=~this.s,n},r.prototype.shiftLeft=function(n){var t=o();return n<0?this.rShiftTo(-n,t):this.lShiftTo(n,t),t},r.prototype.shiftRight=function(n){var t=o();return n<0?this.lShiftTo(-n,t):this.rShiftTo(n,t),t},r.prototype.getLowestSetBit=function(){for(var n=0;n<this.t;++n)if(0!=this[n])return n*this.DB+uf(this[n]);return this.s<0?this.t*this.DB:-1},r.prototype.bitCount=function(){for(var t=0,i=this.s&this.DM,n=0;n<this.t;++n)t+=ff(this[n]^i);return t},r.prototype.testBit=function(n){var t=Math.floor(n/this.DB);return t>=this.t?0!=this.s:0!=(this[t]&1<<n%this.DB)},r.prototype.setBit=function(n){return this.changeBit(n,di)},r.prototype.clearBit=function(n){return this.changeBit(n,br)},r.prototype.flipBit=function(n){return this.changeBit(n,wr)},r.prototype.add=function(n){var t=o();return this.addTo(n,t),t},r.prototype.subtract=function(n){var t=o();return this.subTo(n,t),t},r.prototype.multiply=function(n){var t=o();return this.multiplyTo(n,t),t},r.prototype.divide=function(n){var t=o();return this.divRemTo(n,t,null),t},r.prototype.remainder=function(n){var t=o();return this.divRemTo(n,null,t),t},r.prototype.divideAndRemainder=function(n){var t=o(),i=o();return this.divRemTo(n,t,i),[t,i]},r.prototype.modPow=function(n,t){var l,f,i=n.bitLength(),r=ht(1),y;if(i<=0)return r;l=i<18?1:i<48?3:i<144?4:i<768?5:6;f=i<8?new at(t):t.isEven()?new ti(t):new vt(t);var h=[],u=3,a=l-1,p=(1<<l)-1;if(h[1]=f.convert(this),l>1)for(y=o(),f.sqrTo(h[1],y);u<=p;)h[u]=o(),f.mulTo(y,h[u-2],h[u]),u+=2;var c,v,e=n.t-1,w=!0,s=o();for(i=li(n[e])-1;e>=0;){for(i>=a?c=n[e]>>i-a&p:(c=(n[e]&(1<<i+1)-1)<<a-i,e>0&&(c|=n[e-1]>>this.DB+i-a)),u=l;0==(1&c);)c>>=1,--u;if((i-=u)<0&&(i+=this.DB,--e),w)h[c].copyTo(r),w=!1;else{for(;u>1;)f.sqrTo(r,s),f.sqrTo(s,r),u-=2;u>0?f.sqrTo(r,s):(v=r,r=s,s=v);f.mulTo(s,h[c],r)}for(;e>=0&&0==(n[e]&1<<i);)f.sqrTo(r,s),v=r,r=s,s=v,--i<0&&(i=this.DB-1,--e)}return f.revert(r)},r.prototype.modInverse=function(n){var s=n.isEven();if(this.isEven()&&s||0==n.signum())return r.ZERO;for(var u=n.clone(),f=this.clone(),e=ht(1),i=ht(0),o=ht(0),t=ht(1);0!=u.signum();){for(;u.isEven();)u.rShiftTo(1,u),s?(e.isEven()&&i.isEven()||(e.addTo(this,e),i.subTo(n,i)),e.rShiftTo(1,e)):i.isEven()||i.subTo(n,i),i.rShiftTo(1,i);for(;f.isEven();)f.rShiftTo(1,f),s?(o.isEven()&&t.isEven()||(o.addTo(this,o),t.subTo(n,t)),o.rShiftTo(1,o)):t.isEven()||t.subTo(n,t),t.rShiftTo(1,t);u.compareTo(f)>=0?(u.subTo(f,u),s&&e.subTo(o,e),i.subTo(t,i)):(f.subTo(u,f),s&&o.subTo(e,o),t.subTo(i,t))}return 0!=f.compareTo(r.ONE)?r.ZERO:t.compareTo(n)>=0?t.subtract(n):t.signum()<0?(t.addTo(n,t),t.signum()<0?t.add(n):t):t},r.prototype.pow=function(n){return this.exp(n,new fi)},r.prototype.gcd=function(n){var i=this.s<0?this.negate():this.clone(),t=n.s<0?n.negate():n.clone(),f,u,r;if(i.compareTo(t)<0&&(f=i,i=t,t=f),u=i.getLowestSetBit(),r=t.getLowestSetBit(),r<0)return i;for(u<r&&(r=u),r>0&&(i.rShiftTo(r,i),t.rShiftTo(r,t));i.signum()>0;)(u=i.getLowestSetBit())>0&&i.rShiftTo(u,i),(u=t.getLowestSetBit())>0&&t.rShiftTo(u,t),i.compareTo(t)>=0?(i.subTo(t,i),i.rShiftTo(1,i)):(t.subTo(i,t),t.rShiftTo(1,t));return r>0&&t.lShiftTo(r,t),t},r.prototype.isProbablePrime=function(n){var t,i=this.abs(),r,u;if(1==i.t&&i[0]<=b[b.length-1]){for(t=0;t<b.length;++t)if(i[0]==b[t])return!0;return!1}if(i.isEven())return!1;for(t=1;t<b.length;){for(r=b[t],u=t+1;u<b.length&&r<dr;)r*=b[u++];for(r=i.modInt(r);t<u;)if(r%b[t++]==0)return!1}return i.millerRabin(n)},r.prototype.square=function(){var n=o();return this.squareTo(n),n},nr.prototype.init=function(n){for(var i,r,t=0;t<256;++t)this.S[t]=t;for(i=0,t=0;t<256;++t)i=i+this.S[t]+n[t%n.length]&255,r=this.S[t],this.S[t]=this.S[i],this.S[i]=r;this.i=0;this.j=0},nr.prototype.next=function(){var n;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,n=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=n,this.S[n+this.S[this.i]&255]},null==g){if(g=[],y=0,void 0!==pt&&(void 0!==pt.crypto||void 0!==pt.msCrypto))if(ir=pt.crypto||pt.msCrypto,ir.getRandomValues)for(rr=new Uint8Array(32),ir.getRandomValues(rr),it=0;it<32;++it)g[y++]=rr[it];else if("Netscape"==ii.appName&&ii.appVersion<"5")for(ur=pt.crypto.random(32),it=0;it<ur.length;++it)g[y++]=255&ur.charCodeAt(it);for(;y<256;)it=Math.floor(65536*Math.random()),g[y++]=it>>>8,g[y++]=255⁢y=0;tr()}yt.prototype.nextBytes=function(n){for(var t=0;t<n.length;++t)n[t]=ef()};e.prototype.doPublic=function(n){return n.modPowInt(this.e,this.n)};e.prototype.setPublic=function(n,t){if(this.isPublic=!0,this.isPrivate=!1,"string"!=typeof n)this.n=n,this.e=t;else{if(!(null!=n&&null!=t&&n.length>0&&t.length>0))throw"Invalid RSA public key";this.n=ei(n,16);this.e=parseInt(t,16)}};e.prototype.encrypt=function(n){var u=function(n,t){var i,e,u,o,f;if(t<n.length+11)throw"Message too long for RSA";for(i=[],e=n.length-1;e>=0&&t>0;)u=n.charCodeAt(e--),u<128?i[--t]=u:u>127&&u<2048?(i[--t]=63&u|128,i[--t]=u>>6|192):(i[--t]=63&u|128,i[--t]=u>>6&63|128,i[--t]=u>>12|224);for(i[--t]=0,o=new yt,f=[];t>2;){for(f[0]=0;0==f[0];)o.nextBytes(f);i[--t]=f[0]}return i[--t]=2,i[--t]=0,new r(i)}(n,this.n.bitLength()+7>>3),i,t;return null==u?null:(i=this.doPublic(u),null==i)?null:(t=i.toString(16),0==(1&t.length)?t:"0"+t)};e.prototype.encryptOAEP=function(n,t,u){var o=function(n,t,u,f){var v=i.crypto.MessageDigest,w=i.crypto.Util,c=null,e,l,s,o,y,h,p,a;if(u||(u="sha1"),"string"==typeof u&&(c=v.getCanonicalAlgName(u),f=v.getHashLength(c),u=function(n){return nt(w.hashHex(ut(n),c))}),n.length+2*f+2>t)throw"Message too long for RSA";for(l="",e=0;e<t-n.length-2*f-2;e+=1)l+="\0";for(s=u("")+l+"\x01"+n,o=new Array(f),(new yt).nextBytes(o),y=gr(o,s.length,u),h=[],e=0;e<s.length;e+=1)h[e]=s.charCodeAt(e)^y.charCodeAt(e);for(p=gr(h,o.length,u),a=[0],e=0;e<o.length;e+=1)a[e+1]=o[e]^p.charCodeAt(e);return new r(a.concat(h))}(n,this.n.bitLength()+7>>3,t,u),e,f;return null==o?null:(e=this.doPublic(o),null==e)?null:(f=e.toString(16),0==(1&f.length)?f:"0"+f)};e.prototype.type="RSA";k.prototype.equals=function(n){return n==this||this.q.equals(n.q)&&this.x.equals(n.x)};k.prototype.toBigInteger=function(){return this.x};k.prototype.negate=function(){return new k(this.q,this.x.negate().mod(this.q))};k.prototype.add=function(n){return new k(this.q,this.x.add(n.toBigInteger()).mod(this.q))};k.prototype.subtract=function(n){return new k(this.q,this.x.subtract(n.toBigInteger()).mod(this.q))};k.prototype.multiply=function(n){return new k(this.q,this.x.multiply(n.toBigInteger()).mod(this.q))};k.prototype.square=function(){return new k(this.q,this.x.square().mod(this.q))};k.prototype.divide=function(n){return new k(this.q,this.x.multiply(n.toBigInteger().modInverse(this.q)).mod(this.q))};s.prototype.getX=function(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))};s.prototype.getY=function(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))};s.prototype.equals=function(n){return n==this||(this.isInfinity()?n.isInfinity():n.isInfinity()?this.isInfinity():!!n.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(n.z)).mod(this.curve.q).equals(r.ZERO)&&n.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(n.z)).mod(this.curve.q).equals(r.ZERO))};s.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(r.ZERO)&&!this.y.toBigInteger().equals(r.ZERO)};s.prototype.negate=function(){return new s(this.curve,this.x,this.y.negate(),this.z)};s.prototype.add=function(n){var t,i;if(this.isInfinity())return n;if(n.isInfinity())return this;if(t=n.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(n.z)).mod(this.curve.q),i=n.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(n.z)).mod(this.curve.q),r.ZERO.equals(i))return r.ZERO.equals(t)?this.twice():this.curve.getInfinity();var h=new r("3"),c=this.x.toBigInteger(),l=this.y.toBigInteger(),f=(n.x.toBigInteger(),n.y.toBigInteger(),i.square()),u=f.multiply(i),e=c.multiply(f),o=t.square().multiply(this.z),a=o.subtract(e.shiftLeft(1)).multiply(n.z).subtract(u).multiply(i).mod(this.curve.q),v=e.multiply(h).multiply(t).subtract(l.multiply(u)).subtract(o.multiply(t)).multiply(n.z).add(t.multiply(u)).mod(this.curve.q),y=u.multiply(this.z).multiply(n.z).mod(this.curve.q);return new s(this.curve,this.curve.fromBigInteger(a),this.curve.fromBigInteger(v),y)};s.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var f=new r("3"),i=this.x.toBigInteger(),e=this.y.toBigInteger(),t=e.multiply(this.z),u=t.multiply(e).mod(this.curve.q),o=this.curve.a.toBigInteger(),n=i.square().multiply(f);r.ZERO.equals(o)||(n=n.add(this.z.square().multiply(o)));var h=(n=n.mod(this.curve.q)).square().subtract(i.shiftLeft(3).multiply(u)).shiftLeft(1).multiply(t).mod(this.curve.q),c=n.multiply(f).multiply(i).subtract(u.shiftLeft(1)).shiftLeft(2).multiply(u).subtract(n.square().multiply(n)).mod(this.curve.q),l=t.square().multiply(t).shiftLeft(3).mod(this.curve.q);return new s(this.curve,this.curve.fromBigInteger(h),this.curve.fromBigInteger(c),l)};s.prototype.multiply=function(n){var f,e;if(this.isInfinity())return this;if(0==n.signum())return this.curve.getInfinity();for(var o=n,h=o.multiply(new r("3")),a=this.negate(),u=this,c=this.curve.q.subtract(n),l=c.multiply(new r("3")),i=new s(this.curve,this.x,this.y),v=i.negate(),t=h.bitLength()-2;t>0;--t)u=u.twice(),f=h.testBit(t),f!=o.testBit(t)&&(u=u.add(f?this:a));for(t=l.bitLength()-2;t>0;--t)i=i.twice(),e=l.testBit(t),e!=c.testBit(t)&&(i=i.add(e?i:v));return u};s.prototype.multiplyTwo=function(n,t,i){var u,r,f;for(u=n.bitLength()>i.bitLength()?n.bitLength()-1:i.bitLength()-1,r=this.curve.getInfinity(),f=this.add(t);u>=0;)r=r.twice(),n.testBit(u)?r=i.testBit(u)?r.add(f):r.add(this):i.testBit(u)&&(r=r.add(t)),--u;return r};ct.prototype.getQ=function(){return this.q};ct.prototype.getA=function(){return this.a};ct.prototype.getB=function(){return this.b};ct.prototype.equals=function(n){return n==this||this.q.equals(n.q)&&this.a.equals(n.a)&&this.b.equals(n.b)};ct.prototype.getInfinity=function(){return this.infinity};ct.prototype.fromBigInteger=function(n){return new k(this.q,n)};ct.prototype.decodePointHex=function(n){switch(parseInt(n.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:return null;case 4:case 6:case 7:var t=(n.length-2)/2,i=n.substr(2,t),u=n.substr(t+2,t);return new s(this,this.fromBigInteger(new r(i,16)),this.fromBigInteger(new r(u,16)));default:return null}};k.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)};s.prototype.getEncoded=function(n){var i=function(n,t){var i=n.toByteArrayUnsigned();if(t<i.length)i=i.slice(i.length-t);else for(;t>i.length;)i.unshift(0);return i},u=this.getX().toBigInteger(),r=this.getY().toBigInteger(),t=i(u,32);return n?r.isEven()?t.unshift(2):t.unshift(3):(t.unshift(4),t=t.concat(i(r,32))),t};s.decodeFrom=function(n,t){var e,o;t[0];var i=t.length-1,u=t.slice(1,1+i/2),f=t.slice(1+i/2,1+i);return u.unshift(0),f.unshift(0),e=new r(u),o=new r(f),new s(n,n.fromBigInteger(e),n.fromBigInteger(o))};s.decodeFromHex=function(n,t){t.substr(0,2);var i=t.length-2,u=t.substr(2,i/2),f=t.substr(2+i/2,i/2),e=new r(u,16),o=new r(f,16);return new s(n,n.fromBigInteger(e),n.fromBigInteger(o))};s.prototype.add2D=function(n){if(this.isInfinity())return n;if(n.isInfinity())return this;if(this.x.equals(n.x))return this.y.equals(n.y)?this.twice():this.curve.getInfinity();var r=n.x.subtract(this.x),t=n.y.subtract(this.y).divide(r),i=t.square().subtract(this.x).subtract(n.x),u=t.multiply(this.x.subtract(i)).subtract(this.y);return new s(this.curve,i,u)};s.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var n=this.curve.fromBigInteger(r.valueOf(2)),u=this.curve.fromBigInteger(r.valueOf(3)),t=this.x.square().multiply(u).add(this.curve.a).divide(this.y.multiply(n)),i=t.square().subtract(this.x.multiply(n)),f=t.multiply(this.x.subtract(i)).subtract(this.y);return new s(this.curve,i,f)};s.prototype.multiply2D=function(n){var u;if(this.isInfinity())return this;if(0==n.signum())return this.curve.getInfinity();for(var f=n,e=f.multiply(new r("3")),o=this.negate(),i=this,t=e.bitLength()-2;t>0;--t)i=i.twice(),u=e.testBit(t),u!=f.testBit(t)&&(i=i.add2D(u?this:o));return i};s.prototype.isOnCurve=function(){var n=this.getX().toBigInteger(),t=this.getY().toBigInteger(),r=this.curve.getA().toBigInteger(),u=this.curve.getB().toBigInteger(),i=this.curve.getQ(),f=t.multiply(t).mod(i),e=n.multiply(n).multiply(n).add(r.multiply(n)).add(u).mod(i);return f.equals(e)};s.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"};s.prototype.validate=function(){var n=this.curve.getQ(),t,i;if(this.isInfinity())throw new Error("Point is at infinity.");if(t=this.getX().toBigInteger(),i=this.getY().toBigInteger(),t.compareTo(r.ONE)<0||t.compareTo(n.subtract(r.ONE))>0)throw new Error("x coordinate out of bounds");if(i.compareTo(r.ONE)<0||i.compareTo(n.subtract(r.ONE))>0)throw new Error("y coordinate out of bounds");if(!this.isOnCurve())throw new Error("Point is not on the curve.");if(this.multiply(n).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0};fr=function(){function r(n,t,r){return t?i[t]:String.fromCharCode(parseInt(r,16))}var n=new RegExp('(?:false|true|null|[\\{\\}\\[\\]]|(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)|(?:"(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))*"))',"g"),t=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),i={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},u=new String(""),f=Object.hasOwnProperty;return function(i,e){var l,s,a=i.match(n),c=a[0],v=!1,o;"{"===c?l={}:"["===c?l=[]:(l=[],v=!0);for(var h=[l],y=1-v,p=a.length;y<p;++y)switch((c=a[y]).charCodeAt(0)){default:(o=h[0])[s||o.length]=+c;s=void 0;break;case 34:if(-1!==(c=c.substring(1,c.length-1)).indexOf("\\")&&(c=c.replace(t,r)),o=h[0],!s){if(!(o instanceof Array)){s=c||u;break}s=o.length}o[s]=c;s=void 0;break;case 91:o=h[0];h.unshift(o[s||o.length]=[]);s=void 0;break;case 93:h.shift();break;case 102:(o=h[0])[s||o.length]=!1;s=void 0;break;case 110:(o=h[0])[s||o.length]=null;s=void 0;break;case 116:(o=h[0])[s||o.length]=!0;s=void 0;break;case 123:o=h[0];h.unshift(o[s||o.length]={});s=void 0;break;case 125:h.shift()}if(v){if(1!==h.length)throw new Error;l=l[0]}else if(h.length)throw new Error;return e&&(l=function n(t,i){var r=t[i],u,o,s,h;if(r&&"object"===(void 0===r?"undefined":w(r))){u=null;for(o in r)f.call(r,o)&&r!==t&&(s=n(r,o),void 0!==s?r[o]=s:(u||(u=[]),u.push(o)));if(u)for(h=u.length;--h>=0;)delete r[u[h]]}return e.call(t,i,r)}({"":l},"")),l}}();void 0!==i&&i||(t.KJUR=i={});void 0!==i.asn1&&i.asn1||(i.asn1={});i.asn1.ASN1Util=new function(){this.integerToByteHex=function(n){var t=n.toString(16);return t.length%2==1&&(t="0"+t),t};this.bigIntToMinTwosComplementsHex=function(n){var t=n.toString(16),i,u,f;if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{for(i=t.substr(1).length,i%2==1?i+=1:t.match(/^[0-7]/)||(i+=2),u="",f=0;f<i;f++)u+="f";t=new r(u,16).xor(n).add(r.ONE).toString(16).replace(/^-/,"")}return t};this.getPEMStringFromHex=function(n,t){return d(n,t)};this.newObject=function(n){var r=i.asn1,v=r.ASN1Object,y=r.DERBoolean,p=r.DERInteger,w=r.DERBitString,b=r.DEROctetString,k=r.DERNull,d=r.DERObjectIdentifier,g=r.DEREnumerated,nt=r.DERUTF8String,tt=r.DERNumericString,it=r.DERPrintableString,rt=r.DERTeletexString,ut=r.DERIA5String,ft=r.DERUTCTime,et=r.DERGeneralizedTime,ot=r.DERVisibleString,st=r.DERBMPString,ht=r.DERSequence,ct=r.DERSet,l=r.DERTaggedObject,h=r.ASN1Util.newObject,c,t,s,f,a;if(n instanceof r.ASN1Object)return n;if(c=Object.keys(n),1!=c.length)throw new Error("key of param shall be only one.");if(t=c[0],-1==":asn1:bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":"+t+":"))throw new Error("undefined key: "+t);if("bool"==t)return new y(n[t]);if("int"==t)return new p(n[t]);if("bitstr"==t)return new w(n[t]);if("octstr"==t)return new b(n[t]);if("null"==t)return new k(n[t]);if("oid"==t)return new d(n[t]);if("enum"==t)return new g(n[t]);if("utf8str"==t)return new nt(n[t]);if("numstr"==t)return new tt(n[t]);if("prnstr"==t)return new it(n[t]);if("telstr"==t)return new rt(n[t]);if("ia5str"==t)return new ut(n[t]);if("utctime"==t)return new ft(n[t]);if("gentime"==t)return new et(n[t]);if("visstr"==t)return new ot(n[t]);if("bmpstr"==t)return new st(n[t]);if("asn1"==t)return new v(n[t]);if("seq"==t){for(var e=n[t],o=[],u=0;u<e.length;u++)s=h(e[u]),o.push(s);return new ht({array:o})}if("set"==t){for(e=n[t],o=[],u=0;u<e.length;u++)s=h(e[u]),o.push(s);return new ct({array:o})}if("tag"==t)return(f=n[t],"[object Array]"===Object.prototype.toString.call(f)&&3==f.length)?(a=h(f[2]),new l({tag:f[0],explicit:f[1],obj:a})):new l(f)};this.jsonToASN1HEX=function(n){return this.newObject(n).getEncodedHex()}};i.asn1.ASN1Util.oidHexToInt=function(n){for(var f,t="",e=parseInt(n.substr(0,2),16),i=(t=Math.floor(e/40)+"."+e%40,""),u=2;u<n.length;u+=2)f=("00000000"+parseInt(n.substr(u,2),16).toString(2)).slice(-8),i+=f.substr(1,7),"0"==f.substr(0,1)&&(t=t+"."+new r(i,2).toString(10),i="");return t};i.asn1.ASN1Util.oidIntToHex=function(n){var f=function(n){var t=n.toString(16);return 1==t.length&&(t="0"+t),t},e=function(n){var s="",i=new r(n,10).toString(2),e=7-i.length%7,o,t,u;for(7==e&&(e=0),o="",t=0;t<e;t++)o+="0";for(i=o+i,t=0;t<i.length-1;t+=7)u=i.substr(t,7),t!=i.length-7&&(u="1"+u),s+=f(parseInt(u,2));return s},i;if(!n.match(/^[0-9.]+$/))throw"malformed oid string: "+n;var u="",t=n.split("."),o=40*parseInt(t[0])+parseInt(t[1]);for(u+=f(o),t.splice(0,2),i=0;i<t.length;i++)u+=e(t[i]);return u};i.asn1.ASN1Object=function(n){this.params=null;this.getLengthHexFromValue=function(){var t,n,i;if(void 0===this.hV||null==this.hV)throw new Error("this.hV is null or undefined");if(this.hV.length%2==1)throw new Error("value hex must be even length: n=0,v="+this.hV);if(t=this.hV.length/2,n=t.toString(16),n.length%2==1&&(n="0"+n),t<128)return n;if(i=n.length/2,i>15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);return(128+i).toString(16)+n};this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV};this.getValueHex=function(){return this.getEncodedHex(),this.hV};this.getFreshValueHex=function(){return""};this.setByParam=function(n){this.params=n};null!=n&&null!=n.tlv&&(this.hTLV=n.tlv,this.isModified=!1)};i.asn1.DERAbstractString=function(n){i.asn1.DERAbstractString.superclass.constructor.call(this);this.getString=function(){return this.s};this.setString=function(n){this.hTLV=null;this.isModified=!0;this.s=n;this.hV=er(this.s).toLowerCase()};this.setStringHex=function(n){this.hTLV=null;this.isModified=!0;this.s=null;this.hV=n};this.getFreshValueHex=function(){return this.hV};void 0!==n&&("string"==typeof n?this.setString(n):void 0!==n.str?this.setString(n.str):void 0!==n.hex&&this.setStringHex(n.hex))};h.lang.extend(i.asn1.DERAbstractString,i.asn1.ASN1Object);i.asn1.DERAbstractTime=function(){i.asn1.DERAbstractTime.superclass.constructor.call(this);this.localDateToUTC=function(n){var t=n.getTime()+6e4*n.getTimezoneOffset();return new Date(t)};this.formatDate=function(n,t,i){var u=this.zeroPadding,r=this.localDateToUTC(n),e=String(r.getFullYear()),f,o,s;return"utc"==t&&(e=e.substr(2,2)),f=e+u(String(r.getMonth()+1),2)+u(String(r.getDate()),2)+u(String(r.getHours()),2)+u(String(r.getMinutes()),2)+u(String(r.getSeconds()),2),!0===i&&(o=r.getMilliseconds(),0!=o&&(s=u(String(o),3),f=f+"."+(s=s.replace(/[0]+$/,"")))),f+"Z"};this.zeroPadding=function(n,t){return n.length>=t?n:new Array(t-n.length+1).join("0")+n};this.getString=function(){return this.s};this.setString=function(n){this.hTLV=null;this.isModified=!0;this.s=n;this.hV=ot(n)};this.setByDateValue=function(n,t,i,r,u,f){var e=new Date(Date.UTC(n,t-1,i,r,u,f,0));this.setByDate(e)};this.getFreshValueHex=function(){return this.hV}};h.lang.extend(i.asn1.DERAbstractTime,i.asn1.ASN1Object);i.asn1.DERAbstractStructured=function(n){i.asn1.DERAbstractString.superclass.constructor.call(this);this.setByASN1ObjectArray=function(n){this.hTLV=null;this.isModified=!0;this.asn1Array=n};this.appendASN1Object=function(n){this.hTLV=null;this.isModified=!0;this.asn1Array.push(n)};this.asn1Array=[];void 0!==n&&void 0!==n.array&&(this.asn1Array=n.array)};h.lang.extend(i.asn1.DERAbstractStructured,i.asn1.ASN1Object);i.asn1.DERBoolean=function(n){i.asn1.DERBoolean.superclass.constructor.call(this);this.hT="01";this.hTLV=0==n?"010100":"0101ff"};h.lang.extend(i.asn1.DERBoolean,i.asn1.ASN1Object);i.asn1.DERInteger=function(n){i.asn1.DERInteger.superclass.constructor.call(this);this.hT="02";this.setByBigInteger=function(n){this.hTLV=null;this.isModified=!0;this.hV=i.asn1.ASN1Util.bigIntToMinTwosComplementsHex(n)};this.setByInteger=function(n){var t=new r(String(n),10);this.setByBigInteger(t)};this.setValueHex=function(n){this.hV=n};this.getFreshValueHex=function(){return this.hV};void 0!==n&&(void 0!==n.bigint?this.setByBigInteger(n.bigint):void 0!==n.int?this.setByInteger(n.int):"number"==typeof n?this.setByInteger(n):void 0!==n.hex&&this.setValueHex(n.hex))};h.lang.extend(i.asn1.DERInteger,i.asn1.ASN1Object);i.asn1.DERBitString=function(n){if(void 0!==n&&void 0!==n.obj){var t=i.asn1.ASN1Util.newObject(n.obj);n.hex="00"+t.getEncodedHex()}i.asn1.DERBitString.superclass.constructor.call(this);this.hT="03";this.setHexValueIncludingUnusedBits=function(n){this.hTLV=null;this.isModified=!0;this.hV=n};this.setUnusedBitsAndHexValue=function(n,t){if(n<0||7<n)throw"unused bits shall be from 0 to 7: u = "+n;var i="0"+n;this.hTLV=null;this.isModified=!0;this.hV=i+t};this.setByBinaryString=function(n){var r=8-(n=n.replace(/0+$/,"")).length%8,t,u,f,i;for(8==r&&(r=0),t=0;t<=r;t++)n+="0";for(u="",t=0;t<n.length-1;t+=8)f=n.substr(t,8),i=parseInt(f,2).toString(16),1==i.length&&(i="0"+i),u+=i;this.hTLV=null;this.isModified=!0;this.hV="0"+r+u};this.setByBooleanArray=function(n){for(var i="",t=0;t<n.length;t++)i+=1==n[t]?"1":"0";this.setByBinaryString(i)};this.newFalseArray=function(n){for(var i=new Array(n),t=0;t<n;t++)i[t]=!1;return i};this.getFreshValueHex=function(){return this.hV};void 0!==n&&("string"==typeof n&&n.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(n):void 0!==n.hex?this.setHexValueIncludingUnusedBits(n.hex):void 0!==n.bin?this.setByBinaryString(n.bin):void 0!==n.array&&this.setByBooleanArray(n.array))};h.lang.extend(i.asn1.DERBitString,i.asn1.ASN1Object);i.asn1.DEROctetString=function(n){if(void 0!==n&&void 0!==n.obj){var t=i.asn1.ASN1Util.newObject(n.obj);n.hex=t.getEncodedHex()}i.asn1.DEROctetString.superclass.constructor.call(this,n);this.hT="04"};h.lang.extend(i.asn1.DEROctetString,i.asn1.DERAbstractString);i.asn1.DERNull=function(){i.asn1.DERNull.superclass.constructor.call(this);this.hT="05";this.hTLV="0500"};h.lang.extend(i.asn1.DERNull,i.asn1.ASN1Object);i.asn1.DERObjectIdentifier=function(n){i.asn1.DERObjectIdentifier.superclass.constructor.call(this);this.hT="06";this.setValueHex=function(n){this.hTLV=null;this.isModified=!0;this.s=null;this.hV=n};this.setValueOidString=function(n){var t=function(n){var u=function(n){var t=n.toString(16);return 1==t.length&&(t="0"+t),t},f=function(n){var o="",i=parseInt(n,10).toString(2),f=7-i.length%7,e,t,r;for(7==f&&(f=0),e="",t=0;t<f;t++)e+="0";for(i=e+i,t=0;t<i.length-1;t+=7)r=i.substr(t,7),t!=i.length-7&&(r="1"+r),o+=u(parseInt(r,2));return o},i;try{if(!n.match(/^[0-9.]+$/))return null;var r="",t=n.split("."),e=40*parseInt(t[0],10)+parseInt(t[1],10);for(r+=u(e),t.splice(0,2),i=0;i<t.length;i++)r+=f(t[i]);return r}catch(n){return null}}(n);if(null==t)throw new Error("malformed oid string: "+n);this.hTLV=null;this.isModified=!0;this.s=null;this.hV=t};this.setValueName=function(n){var t=i.asn1.x509.OID.name2oid(n);if(""===t)throw new Error("DERObjectIdentifier oidName undefined: "+n);this.setValueOidString(t)};this.setValueNameOrOid=function(n){n.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(n):this.setValueName(n)};this.getFreshValueHex=function(){return this.hV};this.setByParam=function(n){"string"==typeof n?this.setValueNameOrOid(n):void 0!==n.oid?this.setValueNameOrOid(n.oid):void 0!==n.name?this.setValueNameOrOid(n.name):void 0!==n.hex&&this.setValueHex(n.hex)};void 0!==n&&this.setByParam(n)};h.lang.extend(i.asn1.DERObjectIdentifier,i.asn1.ASN1Object);i.asn1.DEREnumerated=function(n){i.asn1.DEREnumerated.superclass.constructor.call(this);this.hT="0a";this.setByBigInteger=function(n){this.hTLV=null;this.isModified=!0;this.hV=i.asn1.ASN1Util.bigIntToMinTwosComplementsHex(n)};this.setByInteger=function(n){var t=new r(String(n),10);this.setByBigInteger(t)};this.setValueHex=function(n){this.hV=n};this.getFreshValueHex=function(){return this.hV};void 0!==n&&(void 0!==n.int?this.setByInteger(n.int):"number"==typeof n?this.setByInteger(n):void 0!==n.hex&&this.setValueHex(n.hex))};h.lang.extend(i.asn1.DEREnumerated,i.asn1.ASN1Object);i.asn1.DERUTF8String=function(n){i.asn1.DERUTF8String.superclass.constructor.call(this,n);this.hT="0c"};h.lang.extend(i.asn1.DERUTF8String,i.asn1.DERAbstractString);i.asn1.DERNumericString=function(n){i.asn1.DERNumericString.superclass.constructor.call(this,n);this.hT="12"};h.lang.extend(i.asn1.DERNumericString,i.asn1.DERAbstractString);i.asn1.DERPrintableString=function(n){i.asn1.DERPrintableString.superclass.constructor.call(this,n);this.hT="13"};h.lang.extend(i.asn1.DERPrintableString,i.asn1.DERAbstractString);i.asn1.DERTeletexString=function(n){i.asn1.DERTeletexString.superclass.constructor.call(this,n);this.hT="14"};h.lang.extend(i.asn1.DERTeletexString,i.asn1.DERAbstractString);i.asn1.DERIA5String=function(n){i.asn1.DERIA5String.superclass.constructor.call(this,n);this.hT="16"};h.lang.extend(i.asn1.DERIA5String,i.asn1.DERAbstractString);i.asn1.DERVisibleString=function(n){i.asn1.DERIA5String.superclass.constructor.call(this,n);this.hT="1a"};h.lang.extend(i.asn1.DERVisibleString,i.asn1.DERAbstractString);i.asn1.DERBMPString=function(n){i.asn1.DERBMPString.superclass.constructor.call(this,n);this.hT="1e"};h.lang.extend(i.asn1.DERBMPString,i.asn1.DERAbstractString);i.asn1.DERUTCTime=function(n){i.asn1.DERUTCTime.superclass.constructor.call(this,n);this.hT="17";this.setByDate=function(n){this.hTLV=null;this.isModified=!0;this.date=n;this.s=this.formatDate(this.date,"utc");this.hV=ot(this.s)};this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=ot(this.s)),this.hV};void 0!==n&&(void 0!==n.str?this.setString(n.str):"string"==typeof n&&n.match(/^[0-9]{12}Z$/)?this.setString(n):void 0!==n.hex?this.setStringHex(n.hex):void 0!==n.date&&this.setByDate(n.date))};h.lang.extend(i.asn1.DERUTCTime,i.asn1.DERAbstractTime);i.asn1.DERGeneralizedTime=function(n){i.asn1.DERGeneralizedTime.superclass.constructor.call(this,n);this.hT="18";this.withMillis=!1;this.setByDate=function(n){this.hTLV=null;this.isModified=!0;this.date=n;this.s=this.formatDate(this.date,"gen",this.withMillis);this.hV=ot(this.s)};this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=ot(this.s)),this.hV};void 0!==n&&(void 0!==n.str?this.setString(n.str):"string"==typeof n&&n.match(/^[0-9]{14}Z$/)?this.setString(n):void 0!==n.hex?this.setStringHex(n.hex):void 0!==n.date&&this.setByDate(n.date),!0===n.millis&&(this.withMillis=!0))};h.lang.extend(i.asn1.DERGeneralizedTime,i.asn1.DERAbstractTime);i.asn1.DERSequence=function(n){i.asn1.DERSequence.superclass.constructor.call(this,n);this.hT="30";this.getFreshValueHex=function(){for(var t="",n=0;n<this.asn1Array.length;n++)t+=this.asn1Array[n].getEncodedHex();return this.hV=t,this.hV}};h.lang.extend(i.asn1.DERSequence,i.asn1.DERAbstractStructured);i.asn1.DERSet=function(n){i.asn1.DERSet.superclass.constructor.call(this,n);this.hT="31";this.sortFlag=!0;this.getFreshValueHex=function(){for(var i,n=[],t=0;t<this.asn1Array.length;t++)i=this.asn1Array[t],n.push(i.getEncodedHex());return 1==this.sortFlag&&n.sort(),this.hV=n.join(""),this.hV};void 0!==n&&void 0!==n.sortflag&&0==n.sortflag&&(this.sortFlag=!1)};h.lang.extend(i.asn1.DERSet,i.asn1.DERAbstractStructured);i.asn1.DERTaggedObject=function(n){i.asn1.DERTaggedObject.superclass.constructor.call(this);var t=i.asn1;this.hT="a0";this.hV="";this.isExplicit=!0;this.asn1Object=null;this.setASN1Object=function(n,t,i){this.hT=t;this.isExplicit=n;this.asn1Object=i;this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=i.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,t),this.isModified=!1)};this.getFreshValueHex=function(){return this.hV};this.setByParam=function(n){null!=n.tag&&(this.hT=n.tag);null!=n.explicit&&(this.isExplicit=n.explicit);null!=n.tage&&(this.hT=n.tage,this.isExplicit=!0);null!=n.tagi&&(this.hT=n.tagi,this.isExplicit=!1);null!=n.obj&&(n.obj instanceof t.ASN1Object?(this.asn1Object=n.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)):"object"==w(n.obj)&&(this.asn1Object=t.ASN1Util.newObject(n.obj),this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))};null!=n&&this.setByParam(n)};h.lang.extend(i.asn1.DERTaggedObject,i.asn1.ASN1Object);u=new function(){};u.getLblen=function(n,t){if("8"!=n.substr(t+2,1))return 1;var i=parseInt(n.substr(t+3,1));return 0==i?-1:0<i&&i<10?i+1:-2};u.getL=function(n,t){var i=u.getLblen(n,t);return i<1?"":n.substr(t+2,2*i)};u.getVblen=function(n,t){var i;return""==(i=u.getL(n,t))?-1:("8"===i.substr(0,1)?new r(i.substr(2),16):new r(i,16)).intValue()};u.getVidx=function(n,t){var i=u.getLblen(n,t);return i<0?i:t+2*(i+1)};u.getV=function(n,t){var i=u.getVidx(n,t),r=u.getVblen(n,t);return n.substr(i,2*r)};u.getTLV=function(n,t){return n.substr(t,2)+u.getL(n,t)+u.getV(n,t)};u.getTLVblen=function(n,t){return 2+2*u.getLblen(n,t)+2*u.getVblen(n,t)};u.getNextSiblingIdx=function(n,t){return u.getVidx(n,t)+2*u.getVblen(n,t)};u.getChildIdx=function(n,t){var e,i,r,o=u,h=[],f,s;for(e=o.getVidx(n,t),i=2*o.getVblen(n,t),"03"==n.substr(t,2)&&(e+=2,i-=2),r=0,f=e;r<=i;)if(s=o.getTLVblen(n,f),(r+=s)<=i&&h.push(f),f+=s,r>=i)break;return h};u.getNthChildIdx=function(n,t,i){return u.getChildIdx(n,t)[i]};u.getIdxbyList=function(n,t,i,r){var f,e,o=u;return 0==i.length?void 0!==r&&n.substr(t,2)!==r?-1:t:(f=i.shift())>=(e=o.getChildIdx(n,t)).length?-1:o.getIdxbyList(n,e[f],i,r)};u.getIdxbyListEx=function(n,t,i,r){var f,s,e=u,c,o,h;if(0==i.length)return void 0!==r&&n.substr(t,2)!==r?-1:t;for(f=i.shift(),s=e.getChildIdx(n,t),c=0,o=0;o<s.length;o++){if(h=n.substr(s[o],2),"number"==typeof f&&!e.isContextTag(h)&&c==f||"string"==typeof f&&e.isContextTag(h,f))return e.getIdxbyListEx(n,s[o],i,r);e.isContextTag(h)||c++}return-1};u.getTLVbyList=function(n,t,i,r){var e=u,f=e.getIdxbyList(n,t,i,r);return-1==f||f>=n.length?null:e.getTLV(n,f)};u.getTLVbyListEx=function(n,t,i,r){var f=u,e=f.getIdxbyListEx(n,t,i,r);return-1==e?null:f.getTLV(n,e)};u.getVbyList=function(n,t,i,r,f){var o,e,s=u;return-1==(o=s.getIdxbyList(n,t,i,r))||o>=n.length?null:(e=s.getV(n,o),!0===f&&(e=e.substr(2)),e)};u.getVbyListEx=function(n,t,i,r,f){var o,e,s=u;return-1==(o=s.getIdxbyListEx(n,t,i,r))?null:(e=s.getV(n,o),"03"==n.substr(o,2)&&!1!==f&&(e=e.substr(2)),e)};u.getInt=function(n,t,i){var r,f;null==i&&(i=-1);try{return(r=n.substr(t,2),"02"!=r&&"03"!=r)?i:(f=u.getV(n,t),"02"==r?parseInt(f,16):function(n){var i;try{if(i=n.substr(0,2),"00"==i)return parseInt(n.substr(2),16);var r=parseInt(i,16),u=n.substr(2),t=parseInt(u,16).toString(2);return"0"==t&&(t="00000000"),t=t.slice(0,0-r),parseInt(t,2)}catch(n){return-1}}(f))}catch(n){return i}};u.getOID=function(n,t,i){null==i&&(i=null);try{return"06"!=n.substr(t,2)?i:function(n){var u,r,f;if(!su(n))return null;try{var e=[],h=n.substr(0,2),o=parseInt(h,16);e[0]=new String(Math.floor(o/40));e[1]=new String(o%40);for(var s=n.substr(2),i=[],t=0;t<s.length/2;t++)i.push(parseInt(s.substr(2*t,2),16));for(u=[],r="",t=0;t<i.length;t++)128&i[t]?r+=cr((127&i[t]).toString(2),7):(r+=cr((127&i[t]).toString(2),7),u.push(new String(parseInt(r,2))),r="");return f=e.join("."),u.length>0&&(f=f+"."+u.join(".")),f}catch(n){return null}}(u.getV(n,t))}catch(n){return i}};u.getOIDName=function(n,t,r){var f,e;null==r&&(r=null);try{return(f=u.getOID(n,t,r),f==r)?r:(e=i.asn1.x509.OID.oid2name(f),""==e?f:e)}catch(n){return r}};u.getString=function(n,t,i){null==i&&(i=null);try{return nt(u.getV(n,t))}catch(n){return i}};u.hextooidstr=function(n){var o=function(n,t){return n.length>=t?n:new Array(t-n.length+1).join("0")+n},e=[],c=n.substr(0,2),s=parseInt(c,16),u,r,f;e[0]=new String(Math.floor(s/40));e[1]=new String(s%40);for(var h=n.substr(2),i=[],t=0;t<h.length/2;t++)i.push(parseInt(h.substr(2*t,2),16));for(u=[],r="",t=0;t<i.length;t++)128&i[t]?r+=o((127&i[t]).toString(2),7):(r+=o((127&i[t]).toString(2),7),u.push(new String(parseInt(r,2))),r="");return f=e.join("."),u.length>0&&(f=f+"."+u.join(".")),f};u.dump=function(n,t,r,f){var v=u,s=v.getV,y=v.dump,g=v.getChildIdx,e=n,b,o,k,h,nt,tt,l,c,a,w;if(n instanceof i.asn1.ASN1Object&&(e=n.getEncodedHex()),b=function(n,t){return n.length<=2*t?n:n.substr(0,t)+"..(total "+n.length/2+"bytes).."+n.substr(n.length-t,t)},void 0===t&&(t={ommit_long_octet:32}),void 0===r&&(r=0),void 0===f&&(f=""),k=t.ommit_long_octet,"01"==(o=e.substr(r,2)))return"00"==(h=s(e,r))?f+"BOOLEAN FALSE\n":f+"BOOLEAN TRUE\n";if("02"==o)return f+"INTEGER "+b(h=s(e,r),k)+"\n";if("03"==o)return h=s(e,r),v.isASN1HEX(h.substr(2))?(a=f+"BITSTRING, encapsulates\n")+y(h.substr(2),t,0,f+" "):f+"BITSTRING "+b(h,k)+"\n";if("04"==o)return h=s(e,r),v.isASN1HEX(h)?(a=f+"OCTETSTRING, encapsulates\n")+y(h,t,0,f+" "):f+"OCTETSTRING "+b(h,k)+"\n";if("05"==o)return f+"NULL\n";if("06"==o){var ut=s(e,r),it=i.asn1.ASN1Util.oidHexToInt(ut),d=i.asn1.x509.OID.oid2name(it),rt=it.replace(/\./g," ");return""!=d?f+"ObjectIdentifier "+d+" ("+rt+")\n":f+"ObjectIdentifier ("+rt+")\n"}if("0a"==o)return f+"ENUMERATED "+parseInt(s(e,r))+"\n";if("0c"==o)return f+"UTF8String '"+p(s(e,r))+"'\n";if("13"==o)return f+"PrintableString '"+p(s(e,r))+"'\n";if("14"==o)return f+"TeletexString '"+p(s(e,r))+"'\n";if("16"==o)return f+"IA5String '"+p(s(e,r))+"'\n";if("17"==o)return f+"UTCTime "+p(s(e,r))+"\n";if("18"==o)return f+"GeneralizedTime "+p(s(e,r))+"\n";if("1a"==o)return f+"VisualString '"+p(s(e,r))+"'\n";if("1e"==o)return f+"BMPString '"+p(s(e,r))+"'\n";if("30"==o){if("3000"==e.substr(r,4))return f+"SEQUENCE {}\n";for(a=f+"SEQUENCE\n",nt=t,(2==(c=g(e,r)).length||3==c.length)&&"06"==e.substr(c[0],2)&&"04"==e.substr(c[c.length-1],2)&&(d=v.oidname(s(e,c[0])),tt=JSON.parse(JSON.stringify(t)),tt.x509ExtName=d,nt=tt),l=0;l<c.length;l++)a+=y(e,nt,c[l],f+" ");return a}if("31"==o){for(a=f+"SET\n",c=g(e,r),l=0;l<c.length;l++)a+=y(e,t,c[l],f+" ");return a}if(0!=(128&(o=parseInt(o,16)))){if(w=31&o,0!=(32&o)){for(a=f+"["+w+"]\n",c=g(e,r),l=0;l<c.length;l++)a+=y(e,t,c[l],f+" ");return a}return h=s(e,r),u.isASN1HEX(h)?(a=f+"["+w+"]\n")+y(h,t,0,f+" "):(("68747470"==h.substr(0,8)||"subjectAltName"===t.x509ExtName&&2==w)&&(h=p(h)),f+"["+w+"] "+h+"\n")}return f+"UNKNOWN("+o+") "+s(e,r)+"\n"};u.isContextTag=function(n,t){var i,r;n=n.toLowerCase();try{i=parseInt(n,16)}catch(n){return-1}if(void 0===t)return 128==(192&i);try{return null!=t.match(/^\[[0-9]+\]$/)&&!((r=parseInt(t.substr(1,t.length-1),10))>31)&&128==(192&i)&&(31&i)==r}catch(n){return!1}};u.isASN1HEX=function(n){var t=u;if(n.length%2==1)return!1;var i=t.getVblen(n,0),r=n.substr(0,2),f=t.getL(n,0);return n.length-r.length-f.length==2*i};u.checkStrictDER=function(n,t,r,f,e){var o=u,s,h,l,a,v;if(void 0===r){if("string"!=typeof n)throw new Error("not hex string");if(n=n.toLowerCase(),!i.lang.String.isHex(n))throw new Error("not hex string");r=n.length;e=(f=n.length/2)<128?1:Math.ceil(f.toString(16))+1}if(o.getL(n,t).length>2*e)throw new Error("L of TLV too long: idx="+t);if(s=o.getVblen(n,t),s>f)throw new Error("value of L too long than hex: idx="+t);if(h=o.getTLV(n,t),l=h.length-2-o.getL(n,t).length,l!==2*s)throw new Error("V string length and L's value not the same:"+l+"/"+2*s);if(0===t&&n.length!=h.length)throw new Error("total length and TLV length unmatch:"+n.length+"!="+h.length);if(a=n.substr(t,2),"02"===a&&(v=o.getVidx(n,t),"00"==n.substr(v,2)&&n.charCodeAt(v+2)<56))throw new Error("not least zeros for DER INTEGER");if(32&parseInt(a,16)){for(var w=o.getVblen(n,t),y=0,p=o.getChildIdx(n,t),c=0;c<p.length;c++)y+=o.getTLV(n,p[c]).length,o.checkStrictDER(n,p[c],r,f,e);if(2*w!=y)throw new Error("sum of children's TLV length and L unmatch: "+2*w+"!="+y);}};u.oidname=function(n){var r=i.asn1,t;return i.lang.String.isHex(n)&&(n=r.ASN1Util.oidHexToInt(n)),t=r.x509.OID.oid2name(n),""===t&&(t=n),t};void 0!==i&&i||(t.KJUR=i={});void 0!==i.lang&&i.lang||(i.lang={});i.lang.String=function(){};"function"==typeof n?(t.utf8tob64u=oi=function(t){return vi(n.from(t,"utf8").toString("base64"))},t.b64utoutf8=rt=function(t){return n.from(si(t),"base64").toString("utf8")}):(t.utf8tob64u=oi=function(n){return v(yi(wi(n)))},t.b64utoutf8=rt=function(n){return decodeURIComponent(pi(c(n)))});i.lang.String.isInteger=function(n){return!!n.match(/^[0-9]+$/)||!!n.match(/^-[0-9]+$/)};i.lang.String.isHex=function(n){return su(n)};i.lang.String.isBase64=function(n){return!(!(n=n.replace(/\s+/g,"")).match(/^[0-9A-Za-z+\/]+={0,3}$/)||n.length%4!=0)};i.lang.String.isBase64URL=function(n){return!n.match(/[+/=]/)&&(n=si(n),i.lang.String.isBase64(n))};i.lang.String.isIntegerArray=function(n){return!!(n=n.replace(/\s+/g,"")).match(/^\[[0-9,]+\]$/)};i.lang.String.isPrintable=function(n){return null!==n.match(/^[0-9A-Za-z '()+,-./:=?]*$/)};i.lang.String.isIA5=function(n){return null!==n.match(/^[\x20-\x21\x23-\x7f]*$/)};i.lang.String.isMail=function(n){return null!==n.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)};cr=function(n,t,i){return null==i&&(i="0"),n.length>=t?n:new Array(t-n.length+1).join(i)+n};void 0!==i&&i||(t.KJUR=i={});void 0!==i.crypto&&i.crypto||(i.crypto={});i.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"};this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHAwithRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"};this.CRYPTOJSMESSAGEDIGESTNAME={md5:f.algo.MD5,sha1:f.algo.SHA1,sha224:f.algo.SHA224,sha256:f.algo.SHA256,sha384:f.algo.SHA384,sha512:f.algo.SHA512,ripemd160:f.algo.RIPEMD160};this.getDigestInfoHex=function(n,t){if(void 0===this.DIGESTINFOHEAD[t])throw"alg not supported in Util.DIGESTINFOHEAD: "+t;return this.DIGESTINFOHEAD[t]+n};this.getPaddedDigestInfoHex=function(n,t,i){var r=this.getDigestInfoHex(n,t),u=i/4;if(r.length+22>u)throw"key is too short for SigAlg: keylen="+i+","+t;for(var f="0001",e="00"+r,o="",h=u-f.length-e.length,s=0;s<h;s+=2)o+="ff";return f+o+e};this.hashString=function(n,t){return new i.crypto.MessageDigest({alg:t}).digestString(n)};this.hashHex=function(n,t){return new i.crypto.MessageDigest({alg:t}).digestHex(n)};this.sha1=function(n){return this.hashString(n,"sha1")};this.sha256=function(n){return this.hashString(n,"sha256")};this.sha256Hex=function(n){return this.hashHex(n,"sha256")};this.sha512=function(n){return this.hashString(n,"sha512")};this.sha512Hex=function(n){return this.hashHex(n,"sha512")};this.isKey=function(n){return n instanceof e||n instanceof i.crypto.DSA||n instanceof i.crypto.ECDSA}};i.crypto.Util.md5=function(n){return new i.crypto.MessageDigest({alg:"md5",prov:"cryptojs"}).digestString(n)};i.crypto.Util.ripemd160=function(n){return new i.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"}).digestString(n)};i.crypto.Util.SECURERANDOMGEN=new yt;i.crypto.Util.getRandomHexOfNbytes=function(n){var t=new Array(n);return i.crypto.Util.SECURERANDOMGEN.nextBytes(t),ai(t)};i.crypto.Util.getRandomBigIntegerOfNbytes=function(n){return new r(i.crypto.Util.getRandomHexOfNbytes(n),16)};i.crypto.Util.getRandomHexOfNbits=function(n){var r=n%8,t=new Array((n-r)/8+1);return i.crypto.Util.SECURERANDOMGEN.nextBytes(t),t[0]=(255<<r&255^255)&t[0],ai(t)};i.crypto.Util.getRandomBigIntegerOfNbits=function(n){return new r(i.crypto.Util.getRandomHexOfNbits(n),16)};i.crypto.Util.getRandomBigIntegerZeroToMax=function(n){for(var t,r=n.bitLength();;)if(t=i.crypto.Util.getRandomBigIntegerOfNbits(r),-1!=n.compareTo(t))return t};i.crypto.Util.getRandomBigIntegerMinToMax=function(n,t){var r=n.compareTo(t),u;if(1==r)throw"biMin is greater than biMax";return 0==r?n:(u=t.subtract(n),i.crypto.Util.getRandomBigIntegerZeroToMax(u).add(n))};i.crypto.MessageDigest=function(n){this.setAlgAndProvider=function(n,t){if(null!==(n=i.crypto.MessageDigest.getCanonicalAlgName(n))&&void 0===t&&(t=i.crypto.Util.DEFAULTPROVIDER[n]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(n)&&"cryptojs"==t){try{this.md=i.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[n].create()}catch(t){throw"setAlgAndProvider hash alg set fail alg="+n+"/"+t;}this.updateString=function(n){this.md.update(n)};this.updateHex=function(n){var t=f.enc.Hex.parse(n);this.md.update(t)};this.digest=function(){return this.md.finalize().toString(f.enc.Hex)};this.digestString=function(n){return this.updateString(n),this.digest()};this.digestHex=function(n){return this.updateHex(n),this.digest()}}if(-1!=":sha256:".indexOf(n)&&"sjcl"==t){try{this.md=new sjcl.hash.sha256}catch(t){throw"setAlgAndProvider hash alg set fail alg="+n+"/"+t;}this.updateString=function(n){this.md.update(n)};this.updateHex=function(n){var t=sjcl.codec.hex.toBits(n);this.md.update(t)};this.digest=function(){var n=this.md.finalize();return sjcl.codec.hex.fromBits(n)};this.digestString=function(n){return this.updateString(n),this.digest()};this.digestHex=function(n){return this.updateHex(n),this.digest()}}};this.updateString=function(){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName;};this.updateHex=function(){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName;};this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName;};this.digestString=function(){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName;};this.digestHex=function(){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName;};void 0!==n&&void 0!==n.alg&&(this.algName=n.alg,void 0===n.prov&&(this.provName=i.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))};i.crypto.MessageDigest.getCanonicalAlgName=function(n){return"string"==typeof n&&(n=(n=n.toLowerCase()).replace(/-/,"")),n};i.crypto.MessageDigest.getHashLength=function(n){var t=i.crypto.MessageDigest,r=t.getCanonicalAlgName(n);if(void 0===t.HASHLENGTH[r])throw"not supported algorithm: "+n;return t.HASHLENGTH[r]};i.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20};i.crypto.Mac=function(n){this.setAlgAndProvider=function(n,t){var r,u;if(null==(n=n.toLowerCase())&&(n="hmacsha1"),"hmac"!=(n=n.toLowerCase()).substr(0,4))throw"setAlgAndProvider unsupported HMAC alg: "+n;if(void 0===t&&(t=i.crypto.Util.DEFAULTPROVIDER[n]),this.algProv=n+"/"+t,r=n.substr(4),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(r)&&"cryptojs"==t){try{u=i.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[r];this.mac=f.algo.HMAC.create(u,this.pass)}catch(n){throw"setAlgAndProvider hash alg set fail hashAlg="+r+"/"+n;}this.updateString=function(n){this.mac.update(n)};this.updateHex=function(n){var t=f.enc.Hex.parse(n);this.mac.update(t)};this.doFinal=function(){return this.mac.finalize().toString(f.enc.Hex)};this.doFinalString=function(n){return this.updateString(n),this.doFinal()};this.doFinalHex=function(n){return this.updateHex(n),this.doFinal()}}};this.updateString=function(){throw"updateString(str) not supported for this alg/prov: "+this.algProv;};this.updateHex=function(){throw"updateHex(hex) not supported for this alg/prov: "+this.algProv;};this.doFinal=function(){throw"digest() not supported for this alg/prov: "+this.algProv;};this.doFinalString=function(){throw"digestString(str) not supported for this alg/prov: "+this.algProv;};this.doFinalHex=function(){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv;};this.setPassword=function(n){if("string"==typeof n){var t=n;return n.length%2!=1&&n.match(/^[0-9A-Fa-f]+$/)||(t=ut(n)),void(this.pass=f.enc.Hex.parse(t))}if("object"!=(void 0===n?"undefined":w(n)))throw"KJUR.crypto.Mac unsupported password type: "+n;if(t=null,void 0!==n.hex){if(n.hex.length%2!=0||!n.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex password: "+n.hex;t=n.hex}if(void 0!==n.utf8&&(t=er(n.utf8)),void 0!==n.rstr&&(t=ut(n.rstr)),void 0!==n.b64&&(t=gt(n.b64)),void 0!==n.b64u&&(t=c(n.b64u)),null==t)throw"KJUR.crypto.Mac unsupported password type: "+n;this.pass=f.enc.Hex.parse(t)};void 0!==n&&(void 0!==n.pass&&this.setPassword(n.pass),void 0!==n.alg&&(this.algName=n.alg,void 0===n.prov&&(this.provName=i.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))};i.crypto.Signature=function(n){var t=null;if(this._setAlgNames=function(){var n=this.algName.match(/^(.+)with(.+)$/);n&&(this.mdAlgName=n[1].toLowerCase(),this.pubkeyAlgName=n[2].toLowerCase(),"rsaandmgf1"==this.pubkeyAlgName&&"sha"==this.mdAlgName&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(n,t){for(var i="",u=t/4-n.length,r=0;r<u;r++)i+="0";return i+n},this.setAlgAndProvider=function(n,t){if(this._setAlgNames(),"cryptojs/jsrsa"!=t)throw new Error("provider not supported: "+t);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)){try{this.md=new i.crypto.MessageDigest({alg:this.mdAlgName})}catch(n){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+n);}this.init=function(n,t){var i=null;try{i=void 0===t?l.getKey(n):l.getKey(n,t)}catch(n){throw"init failed:"+n;}if(!0===i.isPrivate)this.prvKey=i,this.state="SIGN";else{if(!0!==i.isPublic)throw"init failed.:"+i;this.pubKey=i;this.state="VERIFY"}};this.updateString=function(n){this.md.updateString(n)};this.updateHex=function(n){this.md.updateHex(n)};this.sign=function(){if(this.sHashHex=this.md.digest(),void 0===this.prvKey&&void 0!==this.ecprvhex&&void 0!==this.eccurvename&&void 0!==i.crypto.ECDSA&&(this.prvKey=new i.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof e&&"rsaandmgf1"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof e&&"rsa"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof i.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof i.crypto.DSA))throw"Signature: unsupported private key alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign};this.signString=function(n){return this.updateString(n),this.sign()};this.signHex=function(n){return this.updateHex(n),this.sign()};this.verify=function(n){if(this.sHashHex=this.md.digest(),void 0===this.pubKey&&void 0!==this.ecpubhex&&void 0!==this.eccurvename&&void 0!==i.crypto.ECDSA&&(this.pubKey=new i.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof e&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,n,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof e&&"rsa"===this.pubkeyAlgName||void 0!==i.crypto.ECDSA&&this.pubKey instanceof i.crypto.ECDSA||void 0!==i.crypto.DSA&&this.pubKey instanceof i.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,n);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName;}}},this.init=function(){throw"init(key, pass) not supported for this alg:prov="+this.algProvName;},this.updateString=function(){throw"updateString(str) not supported for this alg:prov="+this.algProvName;},this.updateHex=function(){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName;},this.sign=function(){throw"sign() not supported for this alg:prov="+this.algProvName;},this.signString=function(){throw"digestString(str) not supported for this alg:prov="+this.algProvName;},this.signHex=function(){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName;},this.verify=function(){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName;},this.initParams=n,void 0!==n&&(void 0!==n.alg&&(this.algName=n.alg,this.provName=void 0===n.prov?i.crypto.Util.DEFAULTPROVIDER[this.algName]:n.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==n.psssaltlen&&(this.pssSaltLen=n.psssaltlen),void 0!==n.prvkeypem)){if(void 0!==n.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported";try{t=l.getKey(n.prvkeypem);this.init(t)}catch(n){throw"fatal error to load pem private key: "+n;}}};i.crypto.Cipher=function(){};i.crypto.Cipher.encrypt=function(n,t,r){var u,f;if(t instanceof e&&t.isPublic){if(u=i.crypto.Cipher.getAlgByKeyAndName(t,r),"RSA"===u)return t.encrypt(n);if("RSAOAEP"===u)return t.encryptOAEP(n,"sha1");if(f=u.match(/^RSAOAEP(\d+)$/),null!==f)return t.encryptOAEP(n,"sha"+f[1]);throw"Cipher.encrypt: unsupported algorithm for RSAKey: "+r;}throw"Cipher.encrypt: unsupported key or algorithm";};i.crypto.Cipher.decrypt=function(n,t,r){var u,f;if(t instanceof e&&t.isPrivate){if(u=i.crypto.Cipher.getAlgByKeyAndName(t,r),"RSA"===u)return t.decrypt(n);if("RSAOAEP"===u)return t.decryptOAEP(n,"sha1");if(f=u.match(/^RSAOAEP(\d+)$/),null!==f)return t.decryptOAEP(n,"sha"+f[1]);throw"Cipher.decrypt: unsupported algorithm for RSAKey: "+r;}throw"Cipher.decrypt: unsupported key or algorithm";};i.crypto.Cipher.getAlgByKeyAndName=function(n,t){if(n instanceof e){if(-1!=":RSA:RSAOAEP:RSAOAEP224:RSAOAEP256:RSAOAEP384:RSAOAEP512:".indexOf(t))return t;if(null==t)return"RSA";throw"getAlgByKeyAndName: not supported algorithm name for RSAKey: "+t;}throw"getAlgByKeyAndName: not supported algorithm name: "+t;};i.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040023":"secp521r1","2b81040022":"secp384r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}};void 0!==i&&i||(t.KJUR=i={});void 0!==i.crypto&&i.crypto||(i.crypto={});i.crypto.ECDSA=function(n){var e=Error,t=r,l=s,c=i.crypto.ECDSA,v=i.crypto.ECParameterDB,o=c.getName,a=u,f=a.getVbyListEx,h=a.isASN1HEX,y=new yt;this.type="EC";this.isPrivate=!1;this.isPublic=!1;this.getBigRandom=function(n){return new t(n.bitLength(),y).mod(n.subtract(t.ONE)).add(t.ONE)};this.setNamedCurve=function(n){this.ecparams=v.getByName(n);this.prvKeyHex=null;this.pubKeyHex=null;this.curveName=n};this.setPrivateKeyHex=function(n){this.isPrivate=!0;this.prvKeyHex=n};this.setPublicKeyHex=function(n){this.isPublic=!0;this.pubKeyHex=n};this.getPublicKeyXYHex=function(){var n=this.pubKeyHex,t,i;if("04"!==n.substr(0,2))throw"this method supports uncompressed format(04) only";if(t=this.ecparams.keylen/4,n.length!==2+2*t)throw"malformed public key hex length";return i={},i.x=n.substr(2,t),i.y=n.substr(2+t),i};this.getShortNISTPCurveName=function(){var n=this.curveName;return"secp256r1"===n||"NIST P-256"===n||"P-256"===n||"prime256v1"===n?"P-256":"secp384r1"===n||"NIST P-384"===n||"P-384"===n?"P-384":null};this.generateKeyPairHex=function(){var f=this.ecparams.n,t=this.getBigRandom(f),i=this.ecparams.G.multiply(t),e=i.getX().toBigInteger(),o=i.getY().toBigInteger(),n=this.ecparams.keylen/4,r=("0000000000"+t.toString(16)).slice(-n),u="04"+("0000000000"+e.toString(16)).slice(-n)+("0000000000"+o.toString(16)).slice(-n);return this.setPrivateKeyHex(r),this.setPublicKeyHex(u),{ecprvhex:r,ecpubhex:u}};this.signWithMessageHash=function(n){return this.signHex(n,this.prvKeyHex)};this.signHex=function(n,i){var o=new t(i,16),r=this.ecparams.n,s=new t(n.substring(0,this.ecparams.keylen/4),16),f,u,e;do f=this.getBigRandom(r),u=this.ecparams.G.multiply(f).getX().toBigInteger().mod(r);while(u.compareTo(t.ZERO)<=0);return e=f.modInverse(r).multiply(s.add(o.multiply(u))).mod(r),c.biRSSigToASN1Sig(u,e)};this.sign=function(n,i){var s=i,u=this.ecparams.n,h=t.fromByteArrayUnsigned(n),e,f,o;do e=this.getBigRandom(u),f=this.ecparams.G.multiply(e).getX().toBigInteger().mod(u);while(f.compareTo(r.ZERO)<=0);return o=e.modInverse(u).multiply(h.add(s.multiply(f))).mod(u),this.serializeSig(f,o)};this.verifyWithMessageHash=function(n,t){return this.verifyHex(n,t,this.pubKeyHex)};this.verifyHex=function(n,i,r){var f,e,u,o,s;try{return u=c.parseSigHex(i),f=u.r,e=u.s,o=l.decodeFromHex(this.ecparams.curve,r),s=new t(n.substring(0,this.ecparams.keylen/4),16),this.verifyRaw(s,f,e,o)}catch(n){return!1}};this.verify=function(n,i,r){var u,f,e,o,h;if(Bitcoin.Util.isArray(i))o=this.parseSig(i),u=o.r,f=o.s;else{if("object"!==(void 0===i?"undefined":w(i))||!i.r||!i.s)throw"Invalid value for signature";u=i.r;f=i.s}if(r instanceof s)e=r;else{if(!Bitcoin.Util.isArray(r))throw"Invalid format for pubkey value, must be byte array or ECPointFp";e=l.decodeFrom(this.ecparams.curve,r)}return h=t.fromByteArrayUnsigned(n),this.verifyRaw(h,u,f,e)};this.verifyRaw=function(n,i,r,u){var f=this.ecparams.n,o=this.ecparams.G;if(i.compareTo(t.ONE)<0||i.compareTo(f)>=0||r.compareTo(t.ONE)<0||r.compareTo(f)>=0)return!1;var e=r.modInverse(f),s=n.multiply(e).mod(f),h=i.multiply(e).mod(f);return o.multiply(s).add(u.multiply(h)).getX().toBigInteger().mod(f).equals(i)};this.serializeSig=function(n,t){var r=n.toByteArraySigned(),u=t.toByteArraySigned(),i=[];return i.push(2),i.push(r.length),(i=i.concat(r)).push(2),i.push(u.length),(i=i.concat(u)).unshift(i.length),i.unshift(48),i};this.parseSig=function(n){var i,r,u;if(48!=n[0])throw new Error("Signature not a valid DERSequence");if(2!=n[i=2])throw new Error("First element in signature must be a DERInteger");if(r=n.slice(i+2,i+2+n[i+1]),2!=n[i+=2+n[i+1]])throw new Error("Second element in signature must be a DERInteger");return u=n.slice(i+2,i+2+n[i+1]),i+=2+n[i+1],{r:t.fromByteArrayUnsigned(r),s:t.fromByteArrayUnsigned(u)}};this.parseSigCompact=function(n){var i,r;if(65!==n.length)throw"Signature has the wrong length";if(i=n[0]-27,i<0||i>7)throw"Invalid signature type";return r=this.ecparams.n,{r:t.fromByteArrayUnsigned(n.slice(1,33)).mod(r),s:t.fromByteArrayUnsigned(n.slice(33,65)).mod(r),i:i}};this.readPKCS5PrvKeyHex=function(n){if(!1===h(n))throw new Error("not ASN.1 hex string");var t,i,r;try{t=f(n,0,["[0]",0],"06");i=f(n,0,[1],"04");try{r=f(n,0,["[1]",0],"03")}catch(n){}}catch(n){throw new Error("malformed PKCS#1/5 plain ECC private key");}if(this.curveName=o(t),void 0===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName);this.setPublicKeyHex(r);this.setPrivateKeyHex(i);this.isPublic=!1};this.readPKCS8PrvKeyHex=function(n){if(!1===h(n))throw new e("not ASN.1 hex string");var t,i,r;try{f(n,0,[1,0],"06");t=f(n,0,[1,1],"06");i=f(n,0,[2,0,1],"04");try{r=f(n,0,[2,0,"[1]",0],"03")}catch(n){}}catch(n){throw new e("malformed PKCS#8 plain ECC private key");}if(this.curveName=o(t),void 0===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName);this.setPublicKeyHex(r);this.setPrivateKeyHex(i);this.isPublic=!1};this.readPKCS8PubKeyHex=function(n){if(!1===h(n))throw new e("not ASN.1 hex string");var t,i;try{f(n,0,[0,0],"06");t=f(n,0,[0,1],"06");i=f(n,0,[1],"03")}catch(n){throw new e("malformed PKCS#8 ECC public key");}if(this.curveName=o(t),null===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName);this.setPublicKeyHex(i)};this.readCertPubKeyHex=function(n){if(!1===h(n))throw new e("not ASN.1 hex string");var t,i;try{t=f(n,0,[0,5,0,1],"06");i=f(n,0,[0,5,1],"03")}catch(n){throw new e("malformed X.509 certificate ECC public key");}if(this.curveName=o(t),null===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName);this.setPublicKeyHex(i)};void 0!==n&&void 0!==n.curve&&(this.curveName=n.curve);void 0===this.curveName&&(this.curveName="secp256r1");this.setNamedCurve(this.curveName);void 0!==n&&(void 0!==n.prv&&this.setPrivateKeyHex(n.prv),void 0!==n.pub&&this.setPublicKeyHex(n.pub))};i.crypto.ECDSA.parseSigHex=function(n){var t=i.crypto.ECDSA.parseSigHexInHexRS(n);return{r:new r(t.r,16),s:new r(t.s,16)}};i.crypto.ECDSA.parseSigHexInHexRS=function(n){var i=u,o=i.getChildIdx,e=i.getV,t,r,f;if(i.checkStrictDER(n,0),"30"!=n.substr(0,2))throw new Error("signature is not a ASN.1 sequence");if(t=o(n,0),2!=t.length)throw new Error("signature shall have two elements");if(r=t[0],f=t[1],"02"!=n.substr(r,2))throw new Error("1st item not ASN.1 integer");if("02"!=n.substr(f,2))throw new Error("2nd item not ASN.1 integer");return{r:e(n,r),s:e(n,f)}};i.crypto.ECDSA.asn1SigToConcatSig=function(n){var u=i.crypto.ECDSA.parseSigHexInHexRS(n),t=u.r,r=u.s;if("00"==t.substr(0,2)&&t.length%32==2&&(t=t.substr(2)),"00"==r.substr(0,2)&&r.length%32==2&&(r=r.substr(2)),t.length%32==30&&(t="00"+t),r.length%32==30&&(r="00"+r),t.length%32!=0)throw"unknown ECDSA sig r length error";if(r.length%32!=0)throw"unknown ECDSA sig s length error";return t+r};i.crypto.ECDSA.concatSigToASN1Sig=function(n){if(n.length*4%128!=0)throw"unknown ECDSA concatinated r-s sig length error";var t=n.substr(0,n.length/2),r=n.substr(n.length/2);return i.crypto.ECDSA.hexRSSigToASN1Sig(t,r)};i.crypto.ECDSA.hexRSSigToASN1Sig=function(n,t){var u=new r(n,16),f=new r(t,16);return i.crypto.ECDSA.biRSSigToASN1Sig(u,f)};i.crypto.ECDSA.biRSSigToASN1Sig=function(n,t){var r=i.asn1,u=new r.DERInteger({bigint:n}),f=new r.DERInteger({bigint:t});return new r.DERSequence({array:[u,f]}).getEncodedHex()};i.crypto.ECDSA.getName=function(n){return"2b8104001f"===n?"secp192k1":"2a8648ce3d030107"===n?"secp256r1":"2b8104000a"===n?"secp256k1":"2b81040021"===n?"secp224r1":"2b81040022"===n?"secp384r1":-1!=="|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(n)?"secp256r1":-1!=="|secp256k1|".indexOf(n)?"secp256k1":-1!=="|secp224r1|NIST P-224|P-224|".indexOf(n)?"secp224r1":-1!=="|secp384r1|NIST P-384|P-384|".indexOf(n)?"secp384r1":null};void 0!==i&&i||(t.KJUR=i={});void 0!==i.crypto&&i.crypto||(i.crypto={});i.crypto.ECParameterDB=new function(){function t(n){return new r(n,16)}var n={},i={};this.getByName=function(t){var r=t;if(void 0!==i[r]&&(r=i[t]),void 0!==n[r])return n[r];throw"unregistered EC curve name: "+r;};this.regist=function(r,u,f,e,o,s,h,c,l,a,v,y){var p;n[r]={};var b=t(f),k=t(e),d=t(o),g=t(s),nt=t(h),w=new ct(b,k,d),tt=w.decodePointHex("04"+c+l);for(n[r].name=r,n[r].keylen=u,n[r].curve=w,n[r].G=tt,n[r].n=g,n[r].h=nt,n[r].oid=v,n[r].info=y,p=0;p<a.length;p++)i[a[p]]=r}};i.crypto.ECParameterDB.regist("secp128r1",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC","E87579C11079F43DD824993C2CEE5ED3","FFFFFFFE0000000075A30D1B9038A115","1","161FF7528B899B2D0C28607CA52C5B86","CF5AC8395BAFEB13C02DA292DDED7A83",[],"","secp128r1 : SECG curve over a 128 bit prime field");i.crypto.ECParameterDB.regist("secp160k1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB","938CF935318FDCED6BC28286531733C3F03C4FEE",[],"","secp160k1 : SECG curve over a 160 bit prime field");i.crypto.ECParameterDB.regist("secp160r1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45","0100000000000000000001F4C8F927AED3CA752257","1","4A96B5688EF573284664698968C38BB913CBFC82","23A628553168947D59DCC912042351377AC5FB32",[],"","secp160r1 : SECG curve over a 160 bit prime field");i.crypto.ECParameterDB.regist("secp192k1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",[]);i.crypto.ECParameterDB.regist("secp192r1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",[]);i.crypto.ECParameterDB.regist("secp224r1",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",[]);i.crypto.ECParameterDB.regist("secp256k1",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","1","79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",[]);i.crypto.ECParameterDB.regist("secp256r1",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",["NIST P-256","P-256","prime256v1"]);i.crypto.ECParameterDB.regist("secp384r1",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f",["NIST P-384","P-384"]);i.crypto.ECParameterDB.regist("secp521r1",521,"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC","051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409","1","C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66","011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650",["NIST P-521","P-521"]);l=function(){var t=function(n,t,i){return r(f.AES,n,t,i)},r=function(n,t,i,r){var h=f.enc.Hex.parse(t),e=f.enc.Hex.parse(i),o=f.enc.Hex.parse(r),u={},s;return u.key=e,u.iv=o,u.ciphertext=h,s=n.decrypt(u,e,{iv:o}),f.enc.Hex.stringify(s)},o=function(n,t,i){return s(f.AES,n,t,i)},s=function(n,t,i,r){var u=f.enc.Hex.parse(t),e=f.enc.Hex.parse(i),o=f.enc.Hex.parse(r),s=n.encrypt(u,e,{iv:o}),h=f.enc.Hex.parse(s.toString());return f.enc.Base64.stringify(h)},n={"AES-256-CBC":{proc:t,eproc:o,keylen:32,ivlen:16},"AES-192-CBC":{proc:t,eproc:o,keylen:24,ivlen:16},"AES-128-CBC":{proc:t,eproc:o,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:function(n,t,i){return r(f.TripleDES,n,t,i)},eproc:function(n,t,i){return s(f.TripleDES,n,t,i)},keylen:24,ivlen:8},"DES-CBC":{proc:function(n,t,i){return r(f.DES,n,t,i)},eproc:function(n,t,i){return s(f.DES,n,t,i)},keylen:8,ivlen:8}},c=function(n){var t={},f=n.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m")),e,i,r,o,u;return f&&(t.cipher=f[1],t.ivsalt=f[2]),e=n.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----")),e&&(t.type=e[1]),i=-1,r=0,-1!=n.indexOf("\r\n\r\n")&&(i=n.indexOf("\r\n\r\n"),r=2),-1!=n.indexOf("\n\n")&&(i=n.indexOf("\n\n"),r=1),o=n.indexOf("-----END"),-1!=i&&-1!=o&&(u=n.substring(i+2*r,o-r),u=u.replace(/\s+/g,""),t.data=u),t},h=function(t,i,r){for(var u,o,h=r.substring(0,16),c=f.enc.Hex.parse(h),l=f.enc.Utf8.parse(i),a=n[t].keylen+n[t].ivlen,s="",e=null;;)if(u=f.algo.MD5.create(),null!=e&&u.update(e),u.update(l),u.update(c),e=u.finalize(),(s+=f.enc.Hex.stringify(e)).length>=2*a)break;return o={},o.keyhex=s.substr(0,2*n[t].keylen),o.ivhex=s.substr(2*n[t].keylen,2*n[t].ivlen),o},a=function(t,i,r,u){var e=f.enc.Base64.parse(t),o=f.enc.Hex.stringify(e);return n[i].proc(o,r,u)};return{version:"1.0.0",parsePKCS5PEM:function(n){return c(n)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(n,t,i){return h(n,t,i)},decryptKeyB64:function(n,t,i,r){return a(n,t,i,r)},getDecryptedKeyHex:function(n,t){var i=c(n),r=(i.type,i.cipher),u=i.ivsalt,f=i.data,e=h(r,t,u).keyhex;return a(f,r,e,u)},getEncryptedPKCS5PEMFromPrvKeyHex:function(t,i,r,u,e){var o="";if(void 0!==u&&null!=u||(u="AES-256-CBC"),void 0===n[u])throw"KEYUTIL unsupported algorithm: "+u;return void 0!==e&&null!=e||(e=function(n){var t=f.lib.WordArray.random(n);return f.enc.Hex.stringify(t)}(n[u].ivlen).toUpperCase()),o="-----BEGIN "+t+" PRIVATE KEY-----\r\n",o+="Proc-Type: 4,ENCRYPTED\r\n",o+="DEK-Info: "+u+","+e+"\r\n",o+="\r\n",(o+=function(t,i,r,u){return n[i].eproc(t,r,u)}(i,u,h(u,r,e).keyhex,e).replace(/(.{64})/g,"$1\r\n"))+"\r\n-----END "+t+" PRIVATE KEY-----\r\n"},parseHexOfEncryptedPKCS8:function(n){var a=u,i=a.getChildIdx,t=a.getV,r={},h=i(n,0),f,c,e,o,s,l;if(2!=h.length)throw"malformed format: SEQUENCE(0).items != 2: "+h.length;if(r.ciphertext=t(n,h[1]),f=i(n,h[0]),2!=f.length)throw"malformed format: SEQUENCE(0.0).items != 2: "+f.length;if("2a864886f70d01050d"!=t(n,f[0]))throw"this only supports pkcs5PBES2";if(c=i(n,f[1]),2!=f.length)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+c.length;if(e=i(n,c[1]),2!=e.length)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+e.length;if("2a864886f70d0307"!=t(n,e[0]))throw"this only supports TripleDES";if(r.encryptionSchemeAlg="TripleDES",r.encryptionSchemeIV=t(n,e[1]),o=i(n,c[0]),2!=o.length)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+o.length;if("2a864886f70d01050c"!=t(n,o[0]))throw"this only supports pkcs5PBKDF2";if(s=i(n,o[1]),s.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+s.length;r.pbkdf2Salt=t(n,s[0]);l=t(n,s[1]);try{r.pbkdf2Iter=parseInt(l,16)}catch(n){throw"malformed format pbkdf2Iter: "+l;}return r},getPBKDF2KeyHexFromParam:function(n,t){var i=f.enc.Hex.parse(n.pbkdf2Salt),r=n.pbkdf2Iter,u=f.PBKDF2(t,i,{keySize:6,iterations:r});return f.enc.Hex.stringify(u)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(n,t){var u=ft(n,"ENCRYPTED PRIVATE KEY"),i=this.parseHexOfEncryptedPKCS8(u),e=l.getPBKDF2KeyHexFromParam(i,t),r={};r.ciphertext=f.enc.Hex.parse(i.ciphertext);var o=f.enc.Hex.parse(e),s=f.enc.Hex.parse(i.encryptionSchemeIV),h=f.TripleDES.decrypt(r,o,{iv:s});return f.enc.Hex.stringify(h)},getKeyFromEncryptedPKCS8PEM:function(n,t){var i=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(n,t);return this.getKeyFromPlainPrivatePKCS8Hex(i)},parsePlainPrivatePKCS8Hex:function(n){var f=u,e=f.getChildIdx,o=f.getV,r={algparam:null},t,i;if("30"!=n.substr(0,2))throw"malformed plain PKCS8 private key(code:001)";if(t=e(n,0),3!=t.length)throw"malformed plain PKCS8 private key(code:002)";if("30"!=n.substr(t[1],2))throw"malformed PKCS8 private key(code:003)";if(i=e(n,t[1]),2!=i.length)throw"malformed PKCS8 private key(code:004)";if("06"!=n.substr(i[0],2))throw"malformed PKCS8 private key(code:005)";if(r.algoid=o(n,i[0]),"06"==n.substr(i[1],2)&&(r.algparam=o(n,i[1])),"04"!=n.substr(t[2],2))throw"malformed PKCS8 private key(code:006)";return r.keyidx=f.getVidx(n,t[2]),r},getKeyFromPlainPrivatePKCS8PEM:function(n){var t=ft(n,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(t)},getKeyFromPlainPrivatePKCS8Hex:function(n){var t,r=this.parsePlainPrivatePKCS8Hex(n);if("2a864886f70d010101"==r.algoid)t=new e;else if("2a8648ce380401"==r.algoid)t=new i.crypto.DSA;else{if("2a8648ce3d0201"!=r.algoid)throw"unsupported private key algorithm";t=new i.crypto.ECDSA}return t.readPKCS8PrvKeyHex(n),t},_getKeyFromPublicPKCS8Hex:function(n){var t,r=u.getVbyList(n,0,[0,0],"06");if("2a864886f70d010101"===r)t=new e;else if("2a8648ce380401"===r)t=new i.crypto.DSA;else{if("2a8648ce3d0201"!==r)throw"unsupported PKCS#8 public key hex";t=new i.crypto.ECDSA}return t.readPKCS8PubKeyHex(n),t},parsePublicRawRSAKeyHex:function(n){var r=u,e=r.getChildIdx,f=r.getV,i={},t;if("30"!=n.substr(0,2))throw"malformed RSA key(code:001)";if(t=e(n,0),2!=t.length)throw"malformed RSA key(code:002)";if("02"!=n.substr(t[0],2))throw"malformed RSA key(code:003)";if(i.n=f(n,t[0]),"02"!=n.substr(t[1],2))throw"malformed RSA key(code:004)";return i.e=f(n,t[1]),i},parsePublicPKCS8Hex:function(n){var r=u,s=r.getChildIdx,e=r.getV,i={algparam:null},f=s(n,0),o,t;if(2!=f.length)throw"outer DERSequence shall have 2 elements: "+f.length;if(o=f[0],"30"!=n.substr(o,2))throw"malformed PKCS8 public key(code:001)";if(t=s(n,o),2!=t.length)throw"malformed PKCS8 public key(code:002)";if("06"!=n.substr(t[0],2))throw"malformed PKCS8 public key(code:003)";if(i.algoid=e(n,t[0]),"06"==n.substr(t[1],2)?i.algparam=e(n,t[1]):"30"==n.substr(t[1],2)&&(i.algparam={},i.algparam.p=r.getVbyList(n,t[1],[0],"02"),i.algparam.q=r.getVbyList(n,t[1],[1],"02"),i.algparam.g=r.getVbyList(n,t[1],[2],"02")),"03"!=n.substr(f[1],2))throw"malformed PKCS8 public key(code:004)";return i.key=e(n,f[1]).substr(2),i}}}();l.getKey=function(n,t,f){var s,wt=(tt=u).getChildIdx,h=(tt.getV,tt.getVbyList),at=i.crypto,w=at.ECDSA,b=at.DSA,p=e,rt=ft,y=l,k,g,vt,nt,d,tt,yt,it,pt,ct;if(void 0!==p&&n instanceof p||void 0!==w&&n instanceof w||void 0!==b&&n instanceof b)return n;if(void 0!==n.curve&&void 0!==n.xy&&void 0===n.d)return new w({pub:n.xy,curve:n.curve});if(void 0!==n.curve&&void 0!==n.d)return new w({prv:n.d,curve:n.curve});if(void 0===n.kty&&void 0!==n.n&&void 0!==n.e&&void 0===n.d)return(o=new p).setPublic(n.n,n.e),o;if(void 0===n.kty&&void 0!==n.n&&void 0!==n.e&&void 0!==n.d&&void 0!==n.p&&void 0!==n.q&&void 0!==n.dp&&void 0!==n.dq&&void 0!==n.co&&void 0===n.qi)return(o=new p).setPrivateEx(n.n,n.e,n.d,n.p,n.q,n.dp,n.dq,n.co),o;if(void 0===n.kty&&void 0!==n.n&&void 0!==n.e&&void 0!==n.d&&void 0===n.p)return(o=new p).setPrivate(n.n,n.e,n.d),o;if(void 0!==n.p&&void 0!==n.q&&void 0!==n.g&&void 0!==n.y&&void 0===n.x)return(o=new b).setPublic(n.p,n.q,n.g,n.y),o;if(void 0!==n.p&&void 0!==n.q&&void 0!==n.g&&void 0!==n.y&&void 0!==n.x)return(o=new b).setPrivate(n.p,n.q,n.g,n.y,n.x),o;if("RSA"===n.kty&&void 0!==n.n&&void 0!==n.e&&void 0===n.d)return(o=new p).setPublic(c(n.n),c(n.e)),o;if("RSA"===n.kty&&void 0!==n.n&&void 0!==n.e&&void 0!==n.d&&void 0!==n.p&&void 0!==n.q&&void 0!==n.dp&&void 0!==n.dq&&void 0!==n.qi)return(o=new p).setPrivateEx(c(n.n),c(n.e),c(n.d),c(n.p),c(n.q),c(n.dp),c(n.dq),c(n.qi)),o;if("RSA"===n.kty&&void 0!==n.n&&void 0!==n.e&&void 0!==n.d)return(o=new p).setPrivate(c(n.n),c(n.e),c(n.d)),o;if("EC"===n.kty&&void 0!==n.crv&&void 0!==n.x&&void 0!==n.y&&void 0===n.d)return k=(v=new w({curve:n.crv})).ecparams.keylen/4,g="04"+("0000000000"+c(n.x)).slice(-k)+("0000000000"+c(n.y)).slice(-k),v.setPublicKeyHex(g),v;if("EC"===n.kty&&void 0!==n.crv&&void 0!==n.x&&void 0!==n.y&&void 0!==n.d)return k=(v=new w({curve:n.crv})).ecparams.keylen/4,g="04"+("0000000000"+c(n.x)).slice(-k)+("0000000000"+c(n.y)).slice(-k),vt=("0000000000"+c(n.d)).slice(-k),v.setPublicKeyHex(g),v.setPrivateKeyHex(vt),v;if("pkcs5prv"===f){if(d=n,tt=u,9===(nt=wt(d,0)).length)(o=new p).readPKCS5PrvKeyHex(d);else if(6===nt.length)(o=new b).readPKCS5PrvKeyHex(d);else{if(!(nt.length>2&&"04"===d.substr(nt[1],2)))throw"unsupported PKCS#1/5 hexadecimal key";(o=new w).readPKCS5PrvKeyHex(d)}return o}if("pkcs8prv"===f)return y.getKeyFromPlainPrivatePKCS8Hex(n);if("pkcs8pub"===f)return y._getKeyFromPublicPKCS8Hex(n);if("x509pub"===f)return a.getPublicKeyFromCertHex(n);if(-1!=n.indexOf("-END CERTIFICATE-",0)||-1!=n.indexOf("-END X509 CERTIFICATE-",0)||-1!=n.indexOf("-END TRUSTED CERTIFICATE-",0))return a.getPublicKeyFromCertPEM(n);if(-1!=n.indexOf("-END PUBLIC KEY-"))return yt=ft(n,"PUBLIC KEY"),y._getKeyFromPublicPKCS8Hex(yt);if(-1!=n.indexOf("-END RSA PRIVATE KEY-")&&-1==n.indexOf("4,ENCRYPTED"))return it=rt(n,"RSA PRIVATE KEY"),y.getKey(it,null,"pkcs5prv");if(-1!=n.indexOf("-END DSA PRIVATE KEY-")&&-1==n.indexOf("4,ENCRYPTED")){var ut=h(s=rt(n,"DSA PRIVATE KEY"),0,[1],"02"),et=h(s,0,[2],"02"),ot=h(s,0,[3],"02"),st=h(s,0,[4],"02"),ht=h(s,0,[5],"02");return(o=new b).setPrivate(new r(ut,16),new r(et,16),new r(ot,16),new r(st,16),new r(ht,16)),o}if(-1!=n.indexOf("-END EC PRIVATE KEY-")&&-1==n.indexOf("4,ENCRYPTED"))return it=rt(n,"EC PRIVATE KEY"),y.getKey(it,null,"pkcs5prv");if(-1!=n.indexOf("-END PRIVATE KEY-"))return y.getKeyFromPlainPrivatePKCS8PEM(n);if(-1!=n.indexOf("-END RSA PRIVATE KEY-")&&-1!=n.indexOf("4,ENCRYPTED"))return pt=y.getDecryptedKeyHex(n,t),ct=new e,ct.readPKCS5PrvKeyHex(pt),ct;if(-1!=n.indexOf("-END EC PRIVATE KEY-")&&-1!=n.indexOf("4,ENCRYPTED")){var v,o=h(s=y.getDecryptedKeyHex(n,t),0,[1],"04"),lt=h(s,0,[2,0],"06"),bt=h(s,0,[3,0],"03").substr(2);if(void 0===i.crypto.OID.oidhex2name[lt])throw"undefined OID(hex) in KJUR.crypto.OID: "+lt;return(v=new w({curve:i.crypto.OID.oidhex2name[lt]})).setPublicKeyHex(bt),v.setPrivateKeyHex(o),v.isPublic=!1,v}if(-1!=n.indexOf("-END DSA PRIVATE KEY-")&&-1!=n.indexOf("4,ENCRYPTED"))return ut=h(s=y.getDecryptedKeyHex(n,t),0,[1],"02"),et=h(s,0,[2],"02"),ot=h(s,0,[3],"02"),st=h(s,0,[4],"02"),ht=h(s,0,[5],"02"),(o=new b).setPrivate(new r(ut,16),new r(et,16),new r(ot,16),new r(st,16),new r(ht,16)),o;if(-1!=n.indexOf("-END ENCRYPTED PRIVATE KEY-"))return y.getKeyFromEncryptedPKCS8PEM(n,t);throw new Error("not supported argument");};l.generateKeypair=function(n,t){var h,r,f,o,s;if("RSA"==n){h=t;(r=new e).generate(h,"10001");r.isPrivate=!0;r.isPublic=!0;var u=new e,c=r.n.toString(16),l=r.e.toString(16);return u.setPublic(c,l),u.isPrivate=!1,u.isPublic=!0,(f={}).prvKeyObj=r,f.pubKeyObj=u,f}if("EC"==n)return o=t,s=new i.crypto.ECDSA({curve:o}).generateKeyPairHex(),(r=new i.crypto.ECDSA({curve:o})).setPublicKeyHex(s.ecpubhex),r.setPrivateKeyHex(s.ecprvhex),r.isPrivate=!0,r.isPublic=!1,(u=new i.crypto.ECDSA({curve:o})).setPublicKeyHex(s.ecpubhex),u.isPrivate=!1,u.isPublic=!0,(f={}).prvKeyObj=r,f.pubKeyObj=u,f;throw"unknown algorithm: "+n;};l.getPEM=function(n,t,r,u,o,s){function k(n){return c({seq:[{int:0},{int:{bigint:n.n}},{int:n.e},{int:{bigint:n.d}},{int:{bigint:n.p}},{int:{bigint:n.q}},{int:{bigint:n.dmp1}},{int:{bigint:n.dmq1}},{int:{bigint:n.coeff}}]})}function tt(n){return c({seq:[{int:1},{octstr:{hex:n.prvKeyHex}},{tag:["a0",!0,{oid:{name:n.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+n.pubKeyHex}}]}]})}function it(n){return c({seq:[{int:0},{int:{bigint:n.p}},{int:{bigint:n.q}},{int:{bigint:n.g}},{int:{bigint:n.y}},{int:{bigint:n.x}}]})}var g=i,p=g.asn1,ut=p.DERObjectIdentifier,ft=p.DERInteger,c=p.ASN1Util.newObject,et=p.x509.SubjectPublicKeyInfo,nt=g.crypto,l=nt.DSA,a=nt.ECDSA,v=e,h,b,rt,y;if((void 0!==v&&n instanceof v||void 0!==l&&n instanceof l||void 0!==a&&n instanceof a)&&1==n.isPublic&&(void 0===t||"PKCS8PUB"==t))return d(h=new et(n).getEncodedHex(),"PUBLIC KEY");if("PKCS1PRV"==t&&void 0!==v&&n instanceof v&&(void 0===r||null==r)&&1==n.isPrivate)return d(h=k(n).getEncodedHex(),"RSA PRIVATE KEY");if("PKCS1PRV"==t&&void 0!==a&&n instanceof a&&(void 0===r||null==r)&&1==n.isPrivate){var ot=new ut({name:n.curveName}).getEncodedHex(),w=tt(n).getEncodedHex(),st="";return(st+=d(ot,"EC PARAMETERS"))+d(w,"EC PRIVATE KEY")}if("PKCS1PRV"==t&&void 0!==l&&n instanceof l&&(void 0===r||null==r)&&1==n.isPrivate)return d(h=it(n).getEncodedHex(),"DSA PRIVATE KEY");if("PKCS5PRV"==t&&void 0!==v&&n instanceof v&&void 0!==r&&null!=r&&1==n.isPrivate)return h=k(n).getEncodedHex(),void 0===u&&(u="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",h,r,u,s);if("PKCS5PRV"==t&&void 0!==a&&n instanceof a&&void 0!==r&&null!=r&&1==n.isPrivate)return h=tt(n).getEncodedHex(),void 0===u&&(u="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",h,r,u,s);if("PKCS5PRV"==t&&void 0!==l&&n instanceof l&&void 0!==r&&null!=r&&1==n.isPrivate)return h=it(n).getEncodedHex(),void 0===u&&(u="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",h,r,u,s);if(b=function(n,t){var i=rt(n,t);return new c({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:i.pbkdf2Salt}},{int:i.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:i.encryptionSchemeIV}}]}]}]},{octstr:{hex:i.ciphertext}}]}).getEncodedHex()},rt=function(n,t){var r=f.lib.WordArray.random(8),u=f.lib.WordArray.random(8),e=f.PBKDF2(t,r,{keySize:6,iterations:100}),o=f.enc.Hex.parse(n),s=f.TripleDES.encrypt(o,e,{iv:u})+"",i={};return i.ciphertext=s,i.pbkdf2Salt=f.enc.Hex.stringify(r),i.pbkdf2Iter=100,i.encryptionSchemeAlg="DES-EDE3-CBC",i.encryptionSchemeIV=f.enc.Hex.stringify(u),i},"PKCS8PRV"==t&&null!=v&&n instanceof v&&1==n.isPrivate)return y=k(n).getEncodedHex(),h=c({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{"null":!0}]},{octstr:{hex:y}}]}).getEncodedHex(),void 0===r||null==r?d(h,"PRIVATE KEY"):d(w=b(h,r),"ENCRYPTED PRIVATE KEY");if("PKCS8PRV"==t&&void 0!==a&&n instanceof a&&1==n.isPrivate)return y=new c({seq:[{int:1},{octstr:{hex:n.prvKeyHex}},{tag:["a1",!0,{bitstr:{hex:"00"+n.pubKeyHex}}]}]}).getEncodedHex(),h=c({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:n.curveName}}]},{octstr:{hex:y}}]}).getEncodedHex(),void 0===r||null==r?d(h,"PRIVATE KEY"):d(w=b(h,r),"ENCRYPTED PRIVATE KEY");if("PKCS8PRV"==t&&void 0!==l&&n instanceof l&&1==n.isPrivate)return y=new ft({bigint:n.x}).getEncodedHex(),h=c({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:n.p}},{int:{bigint:n.q}},{int:{bigint:n.g}}]}]},{octstr:{hex:y}}]}).getEncodedHex(),void 0===r||null==r?d(h,"PRIVATE KEY"):d(w=b(h,r),"ENCRYPTED PRIVATE KEY");throw new Error("unsupported object nor format");};l.getKeyFromCSRPEM=function(n){var t=ft(n,"CERTIFICATE REQUEST");return l.getKeyFromCSRHex(t)};l.getKeyFromCSRHex=function(n){var t=l.parseCSRHex(n);return l.getKey(t.p8pubkeyhex,null,"pkcs8pub")};l.parseCSRHex=function(n){var f=u,e=f.getChildIdx,s=f.getTLV,o={},t=n,i,r;if("30"!=t.substr(0,2))throw"malformed CSR(code:001)";if(i=e(t,0),i.length<1)throw"malformed CSR(code:002)";if("30"!=t.substr(i[0],2))throw"malformed CSR(code:003)";if(r=e(t,i[0]),r.length<3)throw"malformed CSR(code:004)";return o.p8pubkeyhex=s(t,r[2]),o};l.getKeyID=function(n){var t=l,r=u;"string"==typeof n&&-1!=n.indexOf("BEGIN ")&&(n=t.getKey(n));var f=ft(t.getPEM(n)),e=r.getIdxbyList(f,0,[1]),o=r.getV(f,e).substring(2);return i.crypto.Util.hashHex(o,"sha1")};l.getJWKFromKey=function(n){var t={},u,r;if(n instanceof e&&n.isPrivate)return t.kty="RSA",t.n=v(n.n.toString(16)),t.e=v(n.e.toString(16)),t.d=v(n.d.toString(16)),t.p=v(n.p.toString(16)),t.q=v(n.q.toString(16)),t.dp=v(n.dmp1.toString(16)),t.dq=v(n.dmq1.toString(16)),t.qi=v(n.coeff.toString(16)),t;if(n instanceof e&&n.isPublic)return t.kty="RSA",t.n=v(n.n.toString(16)),t.e=v(n.e.toString(16)),t;if(n instanceof i.crypto.ECDSA&&n.isPrivate){if("P-256"!==(r=n.getShortNISTPCurveName())&&"P-384"!==r)throw"unsupported curve name for JWT: "+r;return u=n.getPublicKeyXYHex(),t.kty="EC",t.crv=r,t.x=v(u.x),t.y=v(u.y),t.d=v(n.prvKeyHex),t}if(n instanceof i.crypto.ECDSA&&n.isPublic){if("P-256"!==(r=n.getShortNISTPCurveName())&&"P-384"!==r)throw"unsupported curve name for JWT: "+r;return u=n.getPublicKeyXYHex(),t.kty="EC",t.crv=r,t.x=v(u.x),t.y=v(u.y),t}throw"not supported key object";};e.getPosArrayOfChildrenFromHex=function(n){return u.getChildIdx(n,0)};e.getHexValueArrayOfChildrenFromHex=function(n){var t,i=u.getV,r=i(n,(t=e.getPosArrayOfChildrenFromHex(n))[0]),f=i(n,t[1]),o=i(n,t[2]),s=i(n,t[3]),h=i(n,t[4]),c=i(n,t[5]),l=i(n,t[6]),a=i(n,t[7]),v=i(n,t[8]);return(t=[]).push(r,f,o,s,h,c,l,a,v),t};e.prototype.readPrivateKeyFromPEMString=function(n){var i=ft(n),t=e.getHexValueArrayOfChildrenFromHex(i);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])};e.prototype.readPKCS5PrvKeyHex=function(n){var t=e.getHexValueArrayOfChildrenFromHex(n);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])};e.prototype.readPKCS8PrvKeyHex=function(n){var i,r,f,e,o,s,h,c,l=u,t=l.getVbyListEx;if(!1===l.isASN1HEX(n))throw new Error("not ASN.1 hex string");try{i=t(n,0,[2,0,1],"02");r=t(n,0,[2,0,2],"02");f=t(n,0,[2,0,3],"02");e=t(n,0,[2,0,4],"02");o=t(n,0,[2,0,5],"02");s=t(n,0,[2,0,6],"02");h=t(n,0,[2,0,7],"02");c=t(n,0,[2,0,8],"02")}catch(n){throw new Error("malformed PKCS#8 plain RSA private key");}this.setPrivateEx(i,r,f,e,o,s,h,c)};e.prototype.readPKCS5PubKeyHex=function(n){var i=u,r=i.getV,t,f,e;if(!1===i.isASN1HEX(n))throw new Error("keyHex is not ASN.1 hex string");if(t=i.getChildIdx(n,0),2!==t.length||"02"!==n.substr(t[0],2)||"02"!==n.substr(t[1],2))throw new Error("wrong hex for PKCS#5 public key");f=r(n,t[0]);e=r(n,t[1]);this.setPublic(f,e)};e.prototype.readPKCS8PubKeyHex=function(n){var t=u,i;if(!1===t.isASN1HEX(n))throw new Error("not ASN.1 hex string");if("06092a864886f70d010101"!==t.getTLVbyListEx(n,0,[0,0]))throw new Error("not PKCS8 RSA public key");i=t.getTLVbyListEx(n,0,[1,0]);this.readPKCS5PubKeyHex(i)};e.prototype.readCertPubKeyHex=function(n){var t,i;(t=new a).readCertHex(n);i=t.getPublicKeyHex();this.readPKCS8PubKeyHex(i)};hu=new RegExp("[^0-9a-f]","gi");e.prototype.sign=function(n,t){var r=function(n){return i.crypto.Util.hashString(n,t)}(n);return this.signWithMessageHash(r,t)};e.prototype.signWithMessageHash=function(n,t){var r=ei(i.crypto.Util.getPaddedDigestInfoHex(n,t,this.n.bitLength()),16);return cu(this.doPrivate(r).toString(16),this.n.bitLength())};e.prototype.signPSS=function(n,t,r){var u=function(n){return i.crypto.Util.hashHex(n,t)}(ut(n));return void 0===r&&(r=-1),this.signWithMessageHashPSS(u,t,r)};e.prototype.signWithMessageHashPSS=function(n,t,u){var f,v=nt(n),o=v.length,y=this.n.bitLength()-1,h=Math.ceil(y/8),p=function(n){return i.crypto.Util.hashHex(n,t)},e,c,l,w;if(-1===u||void 0===u)u=o;else if(-2===u)u=h-o-2;else if(u<-2)throw new Error("invalid salt length");if(h<o+u+2)throw new Error("data too long");for(e="",u>0&&(e=new Array(u),(new yt).nextBytes(e),e=String.fromCharCode.apply(String,e)),c=nt(p(ut("\0\0\0\0\0\0\0\0"+v+e))),l=[],f=0;f<h-u-o-2;f+=1)l[f]=0;var a=String.fromCharCode.apply(String,l)+"\x01"+e,b=lu(c,a.length,p),s=[];for(f=0;f<a.length;f+=1)s[f]=a.charCodeAt(f)^b.charCodeAt(f);for(w=65280>>8*h-y&255,s[0]&=~w,f=0;f<o;f++)s.push(c.charCodeAt(f));return s.push(188),cu(this.doPrivate(new r(s)).toString(16),this.n.bitLength())};e.prototype.verify=function(n,t){var u=ei(t=(t=t.replace(hu,"")).replace(/[ \n]+/g,""),16),r,f;return u.bitLength()>this.n.bitLength()?0:(r=au(this.doPublic(u).toString(16).replace(/^1f+00/,"")),0==r.length)?!1:(f=r[0],r[1]==function(n){return i.crypto.Util.hashString(n,f)}(n))};e.prototype.verifyWithMessageHash=function(n,t){var r,i;return t.length!=Math.ceil(this.n.bitLength()/4)?!1:(r=ei(t,16),r.bitLength()>this.n.bitLength())?0:(i=au(this.doPublic(r).toString(16).replace(/^1f+00/,"")),0!=i.length&&(i[0],i[1]==n))};e.prototype.verifyPSS=function(n,t,r,u){var f=function(n){return i.crypto.Util.hashHex(n,r)}(ut(n));return void 0===u&&(u=-1),this.verifyWithMessageHashPSS(f,t,r,u)};e.prototype.verifyWithMessageHashPSS=function(n,t,u,f){var o,k,c,a;if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var e,d=new r(t,16),v=function(n){return i.crypto.Util.hashHex(n,u)},y=nt(n),h=y.length,p=this.n.bitLength()-1,s=Math.ceil(p/8);if(-1===f||void 0===f)f=h;else if(-2===f)f=s-h-2;else if(f<-2)throw new Error("invalid salt length");if(s<h+f+2)throw new Error("data too long");for(o=this.doPublic(d).toByteArray(),e=0;e<o.length;e+=1)o[e]&=255;for(;o.length<s;)o.unshift(0);if(188!==o[s-1])throw new Error("encoded message does not end in 0xbc");var l=(o=String.fromCharCode.apply(String,o)).substr(0,s-h-1),w=o.substr(l.length,h),b=65280>>8*s-p&255;if(0!=(l.charCodeAt(0)&b))throw new Error("bits beyond keysize not zero");for(k=lu(w,l.length,v),c=[],e=0;e<l.length;e+=1)c[e]=l.charCodeAt(e)^k.charCodeAt(e);for(c[0]&=~b,a=s-h-f-2,e=0;e<a;e+=1)if(0!==c[e])throw new Error("leftmost octets not zero");if(1!==c[a])throw new Error("0x01 marker not found");return w===nt(v(ut("\0\0\0\0\0\0\0\0"+y+String.fromCharCode.apply(String,c.slice(-f)))))};e.SALT_LEN_HLEN=-1;e.SALT_LEN_MAX=-2;e.SALT_LEN_RECOVER=-2;a.hex2dn=function(n,t){if(void 0===t&&(t=0),"30"!==n.substr(t,2))throw new Error("malformed DN");for(var i=[],f=u.getChildIdx(n,t),r=0;r<f.length;r++)i.push(a.hex2rdn(n,f[r]));return"/"+(i=i.map(function(n){return n.replace("/","\\/")})).join("/")};a.hex2rdn=function(n,t){if(void 0===t&&(t=0),"31"!==n.substr(t,2))throw new Error("malformed RDN");for(var i=[],f=u.getChildIdx(n,t),r=0;r<f.length;r++)i.push(a.hex2attrTypeValue(n,f[r]));return(i=i.map(function(n){return n.replace("+","\\+")})).join("+")};a.hex2attrTypeValue=function(n,t){var f=u,e=f.getV,r,o,s;if(void 0===t&&(t=0),"30"!==n.substr(t,2))throw new Error("malformed attribute type and value");return r=f.getChildIdx(n,t),2!==r.length||n.substr(r[0],2),o=e(n,r[0]),s=i.asn1.ASN1Util.oidHexToInt(o),i.asn1.x509.OID.oid2atype(s)+"="+nt(e(n,r[1]))};a.getPublicKeyFromCertHex=function(n){var t=new a;return t.readCertHex(n),t.getPublicKey()};a.getPublicKeyFromCertPEM=function(n){var t=new a;return t.readCertPEM(n),t.getPublicKey()};a.getPublicKeyInfoPropOfCertPEM=function(n){var f,i,r=u.getVbyList,t={algparam:null};return(f=new a).readCertPEM(n),i=f.getPublicKeyHex(),t.keyhex=r(i,0,[1],"03").substr(2),t.algoid=r(i,0,[0,0],"06"),"2a8648ce3d0201"===t.algoid&&(t.algparam=r(i,0,[0,1],"06")),t};a.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];void 0!==i&&i||(t.KJUR=i={});void 0!==i.jws&&i.jws||(i.jws={});i.jws.JWS=function(){var n=i.jws.JWS.isSafeJSONString;this.parseJWS=function(t,i){var r,o,h,u,l;if(void 0===this.parsedJWS||!i&&void 0===this.parsedJWS.sigvalH){if(r=t.match(/^([^.]+)\.([^.]+)\.([^.]+)$/),null==r)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";var f=r[1],e=r[2],s=r[3],a=f+"."+e;if((this.parsedJWS={},this.parsedJWS.headB64U=f,this.parsedJWS.payloadB64U=e,this.parsedJWS.sigvalB64U=s,this.parsedJWS.si=a,i)||(o=c(s),h=ei(o,16),this.parsedJWS.sigvalH=o,this.parsedJWS.sigvalBI=h),u=rt(f),l=rt(e),this.parsedJWS.headS=u,this.parsedJWS.payloadS=l,!n(u,this.parsedJWS,"headP"))throw"malformed JSON string for JWS Head: "+u;}}};i.jws.JWS.sign=function(n,t,r,u,f){var s,e,y,d=i,a=d.jws.JWS,tt=a.readSafeJSONString,it=a.isSafeJSONString,p=d.crypto,rt=(p.ECDSA,p.Mac),g=p.Signature,b=JSON,o,c,l,k,nt,h;if("string"!=typeof t&&"object"!=(void 0===t?"undefined":w(t)))throw"spHeader must be JSON string or object: "+t;if("object"==(void 0===t?"undefined":w(t))&&(e=t,s=b.stringify(e)),"string"==typeof t){if(!it(s=t))throw"JWS Head is not safe JSON string: "+s;e=tt(s)}if(y=r,"object"==(void 0===r?"undefined":w(r))&&(y=b.stringify(r)),""!=n&&null!=n||void 0===e.alg||(n=e.alg),""!=n&&null!=n&&void 0===e.alg&&(e.alg=n,s=b.stringify(e)),n!==e.alg)throw"alg and sHeader.alg doesn't match: "+n+"!="+e.alg;if(o=null,void 0===a.jwsalg2sigalg[n])throw"unsupported alg name: "+n;if(o=a.jwsalg2sigalg[n],c=oi(s)+"."+oi(y),l="","Hmac"==o.substr(0,4)){if(void 0===u)throw"mac key shall be specified for HS* alg";k=new rt({alg:o,prov:"cryptojs",pass:u});k.updateString(c);l=k.doFinal()}else-1!=o.indexOf("withECDSA")?((h=new g({alg:o})).init(u,f),h.updateString(c),nt=h.sign(),l=i.crypto.ECDSA.asn1SigToConcatSig(nt)):"none"!=o&&((h=new g({alg:o})).init(u,f),h.updateString(c),l=h.sign());return c+"."+v(l)};i.jws.JWS.verify=function(n,t,r){var g,nt=i,a=nt.jws.JWS,ut=a.readSafeJSONString,v=nt.crypto,tt=v.ECDSA,ft=v.Mac,it=v.Signature,f,u,k,s,d;if(void 0!==w(e)&&(g=e),f=n.split("."),3!==f.length)return!1;var h,y=f[0]+"."+f[1],p=c(f[2]),b=ut(rt(f[0])),o=null;if(void 0===b.alg)throw"algorithm not specified in header";if(h=(o=b.alg).substr(0,2),null!=r&&"[object Array]"===Object.prototype.toString.call(r)&&r.length>0&&-1==(":"+r.join(":")+":").indexOf(":"+o+":"))throw"algorithm '"+o+"' not accepted in the list";if("none"!=o&&null===t)throw"key shall be specified to verify.";if("string"==typeof t&&-1!=t.indexOf("-----BEGIN ")&&(t=l.getKey(t)),!("RS"!=h&&"PS"!=h||t instanceof g))throw"key shall be a RSAKey obj for RS* and PS* algs";if("ES"==h&&!(t instanceof tt))throw"key shall be a ECDSA obj for ES* algs";if(u=null,void 0===a.jwsalg2sigalg[b.alg])throw"unsupported alg name: "+o;if("none"==(u=a.jwsalg2sigalg[o]))throw"not supported";if("Hmac"==u.substr(0,4)){if(void 0===t)throw"hexadecimal key shall be specified for HMAC";return k=new ft({alg:u,pass:t}),k.updateString(y),p==k.doFinal()}if(-1!=u.indexOf("withECDSA")){d=null;try{d=tt.concatSigToASN1Sig(p)}catch(n){return!1}return(s=new it({alg:u})).init(t),s.updateString(y),s.verify(d)}return(s=new it({alg:u})).init(t),s.updateString(y),s.verify(p)};i.jws.JWS.parse=function(n){var e,u,f,r=n.split("."),t={};if(2!=r.length&&3!=r.length)throw"malformed sJWS: wrong number of '.' splitted elements";return e=r[0],u=r[1],3==r.length&&(f=r[2]),t.headerObj=i.jws.JWS.readSafeJSONString(rt(e)),t.payloadObj=i.jws.JWS.readSafeJSONString(rt(u)),t.headerPP=JSON.stringify(t.headerObj,null," "),t.payloadPP=null==t.payloadObj?rt(u):JSON.stringify(t.payloadObj,null," "),void 0!==f&&(t.sigHex=c(f)),t};i.jws.JWS.verifyJWT=function(n,t,r){var h=i.jws,e=h.JWS,l=e.readSafeJSONString,o=e.inArray,v=e.includedArray,s=n.split("."),y=s[0],p=s[1],a=(c(s[2]),l(rt(y))),u=l(rt(p)),f;if(void 0===a.alg)return!1;if(void 0===r.alg)throw"acceptField.alg shall be specified";if(!o(a.alg,r.alg)||void 0!==u.iss&&"object"===w(r.iss)&&!o(u.iss,r.iss)||void 0!==u.sub&&"object"===w(r.sub)&&!o(u.sub,r.sub))return!1;if(void 0!==u.aud&&"object"===w(r.aud))if("string"==typeof u.aud){if(!o(u.aud,r.aud))return!1}else if("object"==w(u.aud)&&!v(u.aud,r.aud))return!1;return f=h.IntDate.getNow(),void 0!==r.verifyAt&&"number"==typeof r.verifyAt&&(f=r.verifyAt),void 0!==r.gracePeriod&&"number"==typeof r.gracePeriod||(r.gracePeriod=0),!(void 0!==u.exp&&"number"==typeof u.exp&&u.exp+r.gracePeriod<f||void 0!==u.nbf&&"number"==typeof u.nbf&&f<u.nbf-r.gracePeriod||void 0!==u.iat&&"number"==typeof u.iat&&f<u.iat-r.gracePeriod||void 0!==u.jti&&void 0!==r.jti&&u.jti!==r.jti||!e.verify(n,t,r.alg))};i.jws.JWS.includedArray=function(n,t){var u=i.jws.JWS.inArray,r;if(null===n||"object"!==(void 0===n?"undefined":w(n))||"number"!=typeof n.length)return!1;for(r=0;r<n.length;r++)if(!u(n[r],t))return!1;return!0};i.jws.JWS.inArray=function(n,t){if(null===t||"object"!==(void 0===t?"undefined":w(t))||"number"!=typeof t.length)return!1;for(var i=0;i<t.length;i++)if(t[i]==n)return!0;return!1};i.jws.JWS.jwsalg2sigalg={HS256:"HmacSHA256",HS384:"HmacSHA384",HS512:"HmacSHA512",RS256:"SHA256withRSA",RS384:"SHA384withRSA",RS512:"SHA512withRSA",ES256:"SHA256withECDSA",ES384:"SHA384withECDSA",PS256:"SHA256withRSAandMGF1",PS384:"SHA384withRSAandMGF1",PS512:"SHA512withRSAandMGF1",none:"none"};i.jws.JWS.isSafeJSONString=function(n,t,i){var r=null;try{return"object"!=(void 0===(r=fr(n))?"undefined":w(r))||r.constructor===Array?0:(t&&(t[i]=r),1)}catch(n){return 0}};i.jws.JWS.readSafeJSONString=function(n){var t=null;try{return"object"!=(void 0===(t=fr(n))?"undefined":w(t))||t.constructor===Array?null:t}catch(n){return null}};i.jws.JWS.getEncodedSignatureValueFromJWS=function(n){var t=n.match(/^[^.]+\.[^.]+\.([^.]+)$/);if(null==t)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";return t[1]};i.jws.JWS.getJWKthumbprint=function(n){var t,r;if("RSA"!==n.kty&&"EC"!==n.kty&&"oct"!==n.kty)throw"unsupported algorithm for JWK Thumprint";if(t="{","RSA"===n.kty){if("string"!=typeof n.n||"string"!=typeof n.e)throw"wrong n and e value for RSA key";t+='"e":"'+n.e+'",';t+='"kty":"'+n.kty+'",';t+='"n":"'+n.n+'"}'}else if("EC"===n.kty){if("string"!=typeof n.crv||"string"!=typeof n.x||"string"!=typeof n.y)throw"wrong crv, x and y value for EC key";t+='"crv":"'+n.crv+'",';t+='"kty":"'+n.kty+'",';t+='"x":"'+n.x+'",';t+='"y":"'+n.y+'"}'}else if("oct"===n.kty){if("string"!=typeof n.k)throw"wrong k value for oct(symmetric) key";t+='"kty":"'+n.kty+'",';t+='"k":"'+n.k+'"}'}return r=ut(t),v(i.crypto.Util.hashHex(r,"sha256"))};i.jws.IntDate={};i.jws.IntDate.get=function(n){var r=i.jws.IntDate,t=r.getNow,u=r.getZulu;if("now"==n)return t();if("now + 1hour"==n)return t()+3600;if("now + 1day"==n)return t()+86400;if("now + 1month"==n)return t()+2592e3;if("now + 1year"==n)return t()+31536e3;if(n.match(/Z$/))return u(n);if(n.match(/^[0-9]+$/))return parseInt(n);throw"unsupported format: "+n;};i.jws.IntDate.getZulu=function(n){return fu(n)};i.jws.IntDate.getNow=function(){return~~(new Date/1e3)};i.jws.IntDate.intDate2UTCString=function(n){return new Date(1e3*n).toUTCString()};i.jws.IntDate.intDate2Zulu=function(n){var t=new Date(1e3*n);return("0000"+t.getUTCFullYear()).slice(-4)+("00"+(t.getUTCMonth()+1)).slice(-2)+("00"+t.getUTCDate()).slice(-2)+("00"+t.getUTCHours()).slice(-2)+("00"+t.getUTCMinutes()).slice(-2)+("00"+t.getUTCSeconds()).slice(-2)+"Z"};t.SecureRandom=yt;t.rng_seed_time=tr;t.BigInteger=r;t.RSAKey=e;vu=i.crypto.EDSA;t.EDSA=vu;yu=i.crypto.DSA;t.DSA=yu;pu=i.crypto.Signature;t.Signature=pu;wu=i.crypto.MessageDigest;t.MessageDigest=wu;bu=i.crypto.Mac;t.Mac=bu;ku=i.crypto.Cipher;t.Cipher=ku;t.KEYUTIL=l;t.ASN1HEX=u;t.X509=a;t.CryptoJS=f;t.b64tohex=gt;t.b64toBA=yr;t.stoBA=nu;t.BAtos=tu;t.BAtohex=ai;t.stohex=ot;t.stob64=function(n){return dt(ot(n))};t.stob64u=function(n){return vi(dt(ot(n)))};t.b64utos=function(n){return tu(yr(si(n)))};t.b64tob64u=vi;t.b64utob64=si;t.hex2b64=dt;t.hextob64u=v;t.b64utohex=c;t.utf8tob64u=oi;t.b64utoutf8=rt;t.utf8tob64=function(n){return dt(yi(wi(n)))};t.b64toutf8=function(n){return decodeURIComponent(pi(gt(n)))};t.utf8tohex=er;t.hextoutf8=p;t.hextorstr=nt;t.rstrtohex=ut;t.hextob64=iu;t.hextob64nl=ru;t.b64nltohex=uu;t.hextopem=d;t.pemtohex=ft;t.hextoArrayBuffer=function(n){if(n.length%2!=0)throw"input is not even length";if(null==n.match(/^[0-9A-Fa-f]+$/))throw"input is not hexadecimal";for(var i=new ArrayBuffer(n.length/2),r=new DataView(i),t=0;t<n.length/2;t++)r.setUint8(t,parseInt(n.substr(2*t,2),16));return i};t.ArrayBuffertohex=function(n){for(var i="",r=new DataView(n),t=0;t<n.byteLength;t++)i+=("00"+r.getUint8(t).toString(16)).slice(-2);return i};t.zulutomsec=or;t.zulutosec=fu;t.zulutodate=function(n){return new Date(or(n))};t.datetozulu=function(n,t,i){var r,u=n.getUTCFullYear(),f;if(t){if(u<1950||2049<u)throw"not proper year for UTCTime: "+u;r=(""+u).slice(-2)}else r=("000"+u).slice(-4);return(r+=("0"+(n.getUTCMonth()+1)).slice(-2),r+=("0"+n.getUTCDate()).slice(-2),r+=("0"+n.getUTCHours()).slice(-2),r+=("0"+n.getUTCMinutes()).slice(-2),r+=("0"+n.getUTCSeconds()).slice(-2),i)&&(f=n.getUTCMilliseconds(),0!==f&&(r+="."+(f=(f=("00"+f).slice(-3)).replace(/0+$/g,"")))),r+"Z"};t.uricmptohex=yi;t.hextouricmp=pi;t.ipv6tohex=eu;t.hextoipv6=ou;t.hextoip=sr;t.iptohex=function(n){var i="malformed IP address",r,u,t;if(!(n=n.toLowerCase(n)).match(/^[0-9.]+$/)){if(n.match(/^[0-9a-f:]+$/)&&-1!==n.indexOf(":"))return eu(n);throw i;}if(r=n.split("."),4!==r.length)throw i;u="";try{for(t=0;t<4;t++)u+=("0"+parseInt(r[t]).toString(16)).slice(-2);return u}catch(n){throw i;}};t.encodeURIComponentAll=wi;t.newline_toUnix=function(n){return n.replace(/\r\n/gm,"\n")};t.newline_toDos=function(n){return(n=n.replace(/\r\n/gm,"\n")).replace(/\n/gm,"\r\n")};t.hextoposhex=hr;t.intarystrtohex=function(n){n=(n=(n=n.replace(/^\s*\[\s*/,"")).replace(/\s*\]\s*$/,"")).replace(/\s*/g,"");try{return n.split(/,/).map(function(n){var t=parseInt(n);if(t<0||255<t)throw"integer not in range 0-255";return("00"+t.toString(16)).slice(-2)}).join("")}catch(n){throw"malformed integer array string: "+n;}};t.strdiffidx=function(n,t){var r=n.length,i;for(n.length>t.length&&(r=t.length),i=0;i<r;i++)if(n.charCodeAt(i)!=t.charCodeAt(i))return i;return n.length!=t.length?r:-1};t.KJUR=i;du=i.crypto;t.crypto=du;gu=i.asn1;t.asn1=gu;nf=i.jws;t.jws=nf;tf=i.lang;t.lang=tf}).call(this,i(28).Buffer)},function(n,t,i){"use strict";(function(n){function h(){return r.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function e(n,t){if(h()<t)throw new RangeError("Invalid typed array length");return r.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(t)).__proto__=r.prototype:(null===n&&(n=new r(t)),n.length=t),n}function r(n,t,i){if(!(r.TYPED_ARRAY_SUPPORT||this instanceof r))return new r(n,t,i);if("number"==typeof n){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return p(this,n)}return g(this,n,t,i)}function g(n,t,i,u){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(n,t,i,u){if(t.byteLength,i<0||t.byteLength<i)throw new RangeError("'offset' is out of bounds");if(t.byteLength<i+(u||0))throw new RangeError("'length' is out of bounds");return t=void 0===i&&void 0===u?new Uint8Array(t):void 0===u?new Uint8Array(t,i):new Uint8Array(t,i,u),r.TYPED_ARRAY_SUPPORT?(n=t).__proto__=r.prototype:n=w(n,t),n}(n,t,i,u):"string"==typeof t?function(n,t,i){if("string"==typeof i&&""!==i||(i="utf8"),!r.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var u=0|tt(t,i),f=(n=e(n,u)).write(t,i);return f!==u&&(n=n.slice(0,f)),n}(n,t,i):function(n,t){if(r.isBuffer(t)){var i=0|b(t.length);return 0===(n=e(n,i)).length||t.copy(n,0,0,i),n}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||function(n){return n!=n}(t.length)?e(n,0):w(n,t);if("Buffer"===t.type&&d(t.data))return w(n,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");}(n,t)}function nt(n){if("number"!=typeof n)throw new TypeError('"size" argument must be a number');if(n<0)throw new RangeError('"size" argument must not be negative');}function p(n,t){if(nt(t),n=e(n,t<0?0:0|b(t)),!r.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)n[i]=0;return n}function w(n,t){var r=t.length<0?0:0|b(t.length),i;for(n=e(n,r),i=0;i<r;i+=1)n[i]=255&t[i];return n}function b(n){if(n>=h())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+h().toString(16)+" bytes");return 0|n}function tt(n,t){var i,u;if(r.isBuffer(n))return n.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(n)||n instanceof ArrayBuffer))return n.byteLength;if("string"!=typeof n&&(n=""+n),i=n.length,0===i)return 0;for(u=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return a(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return ct(n).length;default:if(u)return a(n).length;t=(""+t).toLowerCase();u=!0}}function lt(n,t,i){var r=!1;if(((void 0===t||t<0)&&(t=0),t>this.length)||((void 0===i||i>this.length)&&(i=this.length),i<=0)||(i>>>=0)<=(t>>>=0))return"";for(n||(n="utf8");;)switch(n){case"hex":return gt(this,t,i);case"utf8":case"utf-8":return ft(this,t,i);case"ascii":return kt(this,t,i);case"latin1":case"binary":return dt(this,t,i);case"base64":return bt(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ni(this,t,i);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase();r=!0}}function o(n,t,i){var r=n[t];n[t]=n[i];n[i]=r}function it(n,t,i,u,f){if(0===n.length)return-1;if("string"==typeof i?(u=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=f?0:n.length-1),i<0&&(i=n.length+i),i>=n.length){if(f)return-1;i=n.length-1}else if(i<0){if(!f)return-1;i=0}if("string"==typeof t&&(t=r.from(t,u)),r.isBuffer(t))return 0===t.length?-1:rt(n,t,i,u,f);if("number"==typeof t)return t&=255,r.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?f?Uint8Array.prototype.indexOf.call(n,t,i):Uint8Array.prototype.lastIndexOf.call(n,t,i):rt(n,[t],i,u,f);throw new TypeError("val must be string, number or Buffer");}function rt(n,t,i,r,u){function l(n,t){return 1===h?n[t]:n.readUInt16BE(t*h)}var f,h=1,c=n.length,o=t.length,e,a,s;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(n.length<2||t.length<2)return-1;h=2;c/=2;o/=2;i/=2}if(u)for(e=-1,f=i;f<c;f++)if(l(n,f)===l(t,-1===e?0:f-e)){if(-1===e&&(e=f),f-e+1===o)return e*h}else-1!==e&&(f-=f-e),e=-1;else for(i+o>c&&(i=c-o),f=i;f>=0;f--){for(a=!0,s=0;s<o;s++)if(l(n,f+s)!==l(t,s)){a=!1;break}if(a)return f}return-1}function at(n,t,i,r){var f,e,u,o;if(i=Number(i)||0,f=n.length-i,r?(r=Number(r))>f&&(r=f):r=f,e=t.length,e%2!=0)throw new TypeError("Invalid hex string");for(r>e/2&&(r=e/2),u=0;u<r;++u){if(o=parseInt(t.substr(2*u,2),16),isNaN(o))return u;n[i+u]=o}return u}function vt(n,t,i,r){return v(a(t,n.length-i),n,i,r)}function ut(n,t,i,r){return v(function(n){for(var i=[],t=0;t<n.length;++t)i.push(255&n.charCodeAt(t));return i}(t),n,i,r)}function yt(n,t,i,r){return ut(n,t,i,r)}function pt(n,t,i,r){return v(ct(t),n,i,r)}function wt(n,t,i,r){return v(function(n,t){for(var u,f,e,i=[],r=0;r<n.length&&!((t-=2)<0);++r)f=(u=n.charCodeAt(r))>>8,e=u%256,i.push(e),i.push(f);return i}(t,n.length-i),n,i,r)}function bt(n,t,i){return 0===t&&i===n.length?y.fromByteArray(n):y.fromByteArray(n.slice(t,i))}function ft(n,t,i){var h,u;for(i=Math.min(n.length,i),h=[],u=t;u<i;){var e,s,l,f,o=n[u],r=null,c=o>239?4:o>223?3:o>191?2:1;if(u+c<=i)switch(c){case 1:o<128&&(r=o);break;case 2:128==(192&(e=n[u+1]))&&(f=(31&o)<<6|63&e)>127&&(r=f);break;case 3:e=n[u+1];s=n[u+2];128==(192&e)&&128==(192&s)&&(f=(15&o)<<12|(63&e)<<6|63&s)>2047&&(f<55296||f>57343)&&(r=f);break;case 4:e=n[u+1];s=n[u+2];l=n[u+3];128==(192&e)&&128==(192&s)&&128==(192&l)&&(f=(15&o)<<18|(63&e)<<12|(63&s)<<6|63&l)>65535&&f<1114112&&(r=f)}null===r?(r=65533,c=1):r>65535&&(r-=65536,h.push(r>>>10&1023|55296),r=56320|1023&r);h.push(r);u+=c}return function(n){var r=n.length,i,t;if(r<=k)return String.fromCharCode.apply(String,n);for(i="",t=0;t<r;)i+=String.fromCharCode.apply(String,n.slice(t,t+=k));return i}(h)}function kt(n,t,i){var u="",r;for(i=Math.min(n.length,i),r=t;r<i;++r)u+=String.fromCharCode(127&n[r]);return u}function dt(n,t,i){var u="",r;for(i=Math.min(n.length,i),r=t;r<i;++r)u+=String.fromCharCode(n[r]);return u}function gt(n,t,i){var f=n.length,u,r;for((!t||t<0)&&(t=0),(!i||i<0||i>f)&&(i=f),u="",r=t;r<i;++r)u+=ti(n[r]);return u}function ni(n,t,i){for(var u=n.slice(t,i),f="",r=0;r<u.length;r+=2)f+=String.fromCharCode(u[r]+256*u[r+1]);return f}function u(n,t,i){if(n%1!=0||n<0)throw new RangeError("offset is not uint");if(n+t>i)throw new RangeError("Trying to access beyond buffer length");}function f(n,t,i,u,f,e){if(!r.isBuffer(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>f||t<e)throw new RangeError('"value" argument is out of bounds');if(i+u>n.length)throw new RangeError("Index out of range");}function c(n,t,i,r){t<0&&(t=65535+t+1);for(var u=0,f=Math.min(n.length-i,2);u<f;++u)n[i+u]=(t&255<<8*(r?u:1-u))>>>8*(r?u:1-u)}function l(n,t,i,r){t<0&&(t=4294967295+t+1);for(var u=0,f=Math.min(n.length-i,4);u<f;++u)n[i+u]=t>>>8*(r?u:3-u)&255}function et(n,t,i,r){if(i+r>n.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range");}function ot(n,t,i,r,u){return u||et(n,0,i,4),s.write(n,t,i,r,23,4),i+4}function st(n,t,i,r,u){return u||et(n,0,i,8),s.write(n,t,i,r,52,8),i+8}function ti(n){return n<16?"0"+n.toString(16):n.toString(16)}function a(n,t){var i;t=t||1/0;for(var e=n.length,u=null,r=[],f=0;f<e;++f){if((i=n.charCodeAt(f))>55295&&i<57344){if(!u){if(i>56319){(t-=3)>-1&&r.push(239,191,189);continue}if(f+1===e){(t-=3)>-1&&r.push(239,191,189);continue}u=i;continue}if(i<56320){(t-=3)>-1&&r.push(239,191,189);u=i;continue}i=65536+(u-55296<<10|i-56320)}else u&&(t-=3)>-1&&r.push(239,191,189);if(u=null,i<128){if((t-=1)<0)break;r.push(i)}else if(i<2048){if((t-=2)<0)break;r.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;r.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;r.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return r}function ct(n){return y.toByteArray(function(n){if((n=function(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}(n).replace(ht,"")).length<2)return"";for(;n.length%4!=0;)n+="=";return n}(n))}function v(n,t,i,r){for(var u=0;u<r&&!(u+i>=t.length||u>=n.length);++u)t[u+i]=n[u];return u}var y=i(30),s=i(31),d=i(32),k,ht;t.Buffer=r;t.SlowBuffer=function(n){return+n!=n&&(n=0),r.alloc(+n)};t.INSPECT_MAX_BYTES=50;r.TYPED_ARRAY_SUPPORT=void 0!==n.TYPED_ARRAY_SUPPORT?n.TYPED_ARRAY_SUPPORT:function(){try{var n=new Uint8Array(1);return n.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===n.foo()&&"function"==typeof n.subarray&&0===n.subarray(1,1).byteLength}catch(n){return!1}}();t.kMaxLength=h();r.poolSize=8192;r._augment=function(n){return n.__proto__=r.prototype,n};r.from=function(n,t,i){return g(null,n,t,i)};r.TYPED_ARRAY_SUPPORT&&(r.prototype.__proto__=Uint8Array.prototype,r.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&r[Symbol.species]===r&&Object.defineProperty(r,Symbol.species,{value:null,configurable:!0}));r.alloc=function(n,t,i){return function(n,t,i,r){return nt(t),t<=0?e(n,t):void 0!==i?"string"==typeof r?e(n,t).fill(i,r):e(n,t).fill(i):e(n,t)}(null,n,t,i)};r.allocUnsafe=function(n){return p(null,n)};r.allocUnsafeSlow=function(n){return p(null,n)};r.isBuffer=function(n){return!(null==n||!n._isBuffer)};r.compare=function(n,t){if(!r.isBuffer(n)||!r.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(n===t)return 0;for(var u=n.length,f=t.length,i=0,e=Math.min(u,f);i<e;++i)if(n[i]!==t[i]){u=n[i];f=t[i];break}return u<f?-1:f<u?1:0};r.isEncoding=function(n){switch(String(n).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};r.concat=function(n,t){var i,f,e,u;if(!d(n))throw new TypeError('"list" argument must be an Array of Buffers');if(0===n.length)return r.alloc(0);if(void 0===t)for(t=0,i=0;i<n.length;++i)t+=n[i].length;for(f=r.allocUnsafe(t),e=0,i=0;i<n.length;++i){if(u=n[i],!r.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(f,e);e+=u.length}return f};r.byteLength=tt;r.prototype._isBuffer=!0;r.prototype.swap16=function(){var t=this.length,n;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(n=0;n<t;n+=2)o(this,n,n+1);return this};r.prototype.swap32=function(){var t=this.length,n;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(n=0;n<t;n+=4)o(this,n,n+3),o(this,n+1,n+2);return this};r.prototype.swap64=function(){var t=this.length,n;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(n=0;n<t;n+=8)o(this,n,n+7),o(this,n+1,n+6),o(this,n+2,n+5),o(this,n+3,n+4);return this};r.prototype.toString=function(){var n=0|this.length;return 0===n?"":0===arguments.length?ft(this,0,n):lt.apply(this,arguments)};r.prototype.equals=function(n){if(!r.isBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n||0===r.compare(this,n)};r.prototype.inspect=function(){var n="",i=t.INSPECT_MAX_BYTES;return this.length>0&&(n=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(n+=" ... ")),"<Buffer "+n+">"};r.prototype.compare=function(n,t,i,u,f){if(!r.isBuffer(n))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===i&&(i=n?n.length:0),void 0===u&&(u=0),void 0===f&&(f=this.length),t<0||i>n.length||u<0||f>this.length)throw new RangeError("out of range index");if(u>=f&&t>=i)return 0;if(u>=f)return-1;if(t>=i)return 1;if(this===n)return 0;for(var o=(f>>>=0)-(u>>>=0),s=(i>>>=0)-(t>>>=0),l=Math.min(o,s),h=this.slice(u,f),c=n.slice(t,i),e=0;e<l;++e)if(h[e]!==c[e]){o=h[e];s=c[e];break}return o<s?-1:s<o?1:0};r.prototype.includes=function(n,t,i){return-1!==this.indexOf(n,t,i)};r.prototype.indexOf=function(n,t,i){return it(this,n,t,i,!0)};r.prototype.lastIndexOf=function(n,t,i){return it(this,n,t,i,!1)};r.prototype.write=function(n,t,i,r){var u,f;if(void 0===t)r="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)r=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0;isFinite(i)?(i|=0,void 0===r&&(r="utf8")):(r=i,i=void 0)}if(u=this.length-t,(void 0===i||i>u)&&(i=u),n.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");for(r||(r="utf8"),f=!1;;)switch(r){case"hex":return at(this,n,t,i);case"utf8":case"utf-8":return vt(this,n,t,i);case"ascii":return ut(this,n,t,i);case"latin1":case"binary":return yt(this,n,t,i);case"base64":return pt(this,n,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return wt(this,n,t,i);default:if(f)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase();f=!0}};r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};k=4096;r.prototype.slice=function(n,t){var f,i=this.length,e,u;if((n=~~n)<0?(n+=i)<0&&(n=0):n>i&&(n=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),t<n&&(t=n),r.TYPED_ARRAY_SUPPORT)(f=this.subarray(n,t)).__proto__=r.prototype;else for(e=t-n,f=new r(e,void 0),u=0;u<e;++u)f[u]=this[u+n];return f};r.prototype.readUIntLE=function(n,t,i){n|=0;t|=0;i||u(n,t,this.length);for(var r=this[n],f=1,e=0;++e<t&&(f*=256);)r+=this[n+e]*f;return r};r.prototype.readUIntBE=function(n,t,i){n|=0;t|=0;i||u(n,t,this.length);for(var r=this[n+--t],f=1;t>0&&(f*=256);)r+=this[n+--t]*f;return r};r.prototype.readUInt8=function(n,t){return t||u(n,1,this.length),this[n]};r.prototype.readUInt16LE=function(n,t){return t||u(n,2,this.length),this[n]|this[n+1]<<8};r.prototype.readUInt16BE=function(n,t){return t||u(n,2,this.length),this[n]<<8|this[n+1]};r.prototype.readUInt32LE=function(n,t){return t||u(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+16777216*this[n+3]};r.prototype.readUInt32BE=function(n,t){return t||u(n,4,this.length),16777216*this[n]+(this[n+1]<<16|this[n+2]<<8|this[n+3])};r.prototype.readIntLE=function(n,t,i){n|=0;t|=0;i||u(n,t,this.length);for(var r=this[n],f=1,e=0;++e<t&&(f*=256);)r+=this[n+e]*f;return r>=(f*=128)&&(r-=Math.pow(2,8*t)),r};r.prototype.readIntBE=function(n,t,i){n|=0;t|=0;i||u(n,t,this.length);for(var f=t,e=1,r=this[n+--f];f>0&&(e*=256);)r+=this[n+--f]*e;return r>=(e*=128)&&(r-=Math.pow(2,8*t)),r};r.prototype.readInt8=function(n,t){return t||u(n,1,this.length),128&this[n]?-1*(256-this[n]):this[n]};r.prototype.readInt16LE=function(n,t){t||u(n,2,this.length);var i=this[n]|this[n+1]<<8;return 32768&i?4294901760|i:i};r.prototype.readInt16BE=function(n,t){t||u(n,2,this.length);var i=this[n+1]|this[n]<<8;return 32768&i?4294901760|i:i};r.prototype.readInt32LE=function(n,t){return t||u(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24};r.prototype.readInt32BE=function(n,t){return t||u(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]};r.prototype.readFloatLE=function(n,t){return t||u(n,4,this.length),s.read(this,n,!0,23,4)};r.prototype.readFloatBE=function(n,t){return t||u(n,4,this.length),s.read(this,n,!1,23,4)};r.prototype.readDoubleLE=function(n,t){return t||u(n,8,this.length),s.read(this,n,!0,52,8)};r.prototype.readDoubleBE=function(n,t){return t||u(n,8,this.length),s.read(this,n,!1,52,8)};r.prototype.writeUIntLE=function(n,t,i,r){n=+n;t|=0;i|=0;r||f(this,n,t,i,Math.pow(2,8*i)-1,0);var u=1,e=0;for(this[t]=255&n;++e<i&&(u*=256);)this[t+e]=n/u&255;return t+i};r.prototype.writeUIntBE=function(n,t,i,r){n=+n;t|=0;i|=0;r||f(this,n,t,i,Math.pow(2,8*i)-1,0);var u=i-1,e=1;for(this[t+u]=255&n;--u>=0&&(e*=256);)this[t+u]=n/e&255;return t+i};r.prototype.writeUInt8=function(n,t,i){return n=+n,t|=0,i||f(this,n,t,1,255,0),r.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),this[t]=255&n,t+1};r.prototype.writeUInt16LE=function(n,t,i){return n=+n,t|=0,i||f(this,n,t,2,65535,0),r.TYPED_ARRAY_SUPPORT?(this[t]=255&n,this[t+1]=n>>>8):c(this,n,t,!0),t+2};r.prototype.writeUInt16BE=function(n,t,i){return n=+n,t|=0,i||f(this,n,t,2,65535,0),r.TYPED_ARRAY_SUPPORT?(this[t]=n>>>8,this[t+1]=255&n):c(this,n,t,!1),t+2};r.prototype.writeUInt32LE=function(n,t,i){return n=+n,t|=0,i||f(this,n,t,4,4294967295,0),r.TYPED_ARRAY_SUPPORT?(this[t+3]=n>>>24,this[t+2]=n>>>16,this[t+1]=n>>>8,this[t]=255&n):l(this,n,t,!0),t+4};r.prototype.writeUInt32BE=function(n,t,i){return n=+n,t|=0,i||f(this,n,t,4,4294967295,0),r.TYPED_ARRAY_SUPPORT?(this[t]=n>>>24,this[t+1]=n>>>16,this[t+2]=n>>>8,this[t+3]=255&n):l(this,n,t,!1),t+4};r.prototype.writeIntLE=function(n,t,i,r){var u;(n=+n,t|=0,r)||(u=Math.pow(2,8*i-1),f(this,n,t,i,u-1,-u));var e=0,s=1,o=0;for(this[t]=255&n;++e<i&&(s*=256);)n<0&&0===o&&0!==this[t+e-1]&&(o=1),this[t+e]=(n/s>>0)-o&255;return t+i};r.prototype.writeIntBE=function(n,t,i,r){var e;(n=+n,t|=0,r)||(e=Math.pow(2,8*i-1),f(this,n,t,i,e-1,-e));var u=i-1,s=1,o=0;for(this[t+u]=255&n;--u>=0&&(s*=256);)n<0&&0===o&&0!==this[t+u+1]&&(o=1),this[t+u]=(n/s>>0)-o&255;return t+i};r.prototype.writeInt8=function(n,t,i){return n=+n,t|=0,i||f(this,n,t,1,127,-128),r.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),n<0&&(n=255+n+1),this[t]=255&n,t+1};r.prototype.writeInt16LE=function(n,t,i){return n=+n,t|=0,i||f(this,n,t,2,32767,-32768),r.TYPED_ARRAY_SUPPORT?(this[t]=255&n,this[t+1]=n>>>8):c(this,n,t,!0),t+2};r.prototype.writeInt16BE=function(n,t,i){return n=+n,t|=0,i||f(this,n,t,2,32767,-32768),r.TYPED_ARRAY_SUPPORT?(this[t]=n>>>8,this[t+1]=255&n):c(this,n,t,!1),t+2};r.prototype.writeInt32LE=function(n,t,i){return n=+n,t|=0,i||f(this,n,t,4,2147483647,-2147483648),r.TYPED_ARRAY_SUPPORT?(this[t]=255&n,this[t+1]=n>>>8,this[t+2]=n>>>16,this[t+3]=n>>>24):l(this,n,t,!0),t+4};r.prototype.writeInt32BE=function(n,t,i){return n=+n,t|=0,i||f(this,n,t,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),r.TYPED_ARRAY_SUPPORT?(this[t]=n>>>24,this[t+1]=n>>>16,this[t+2]=n>>>8,this[t+3]=255&n):l(this,n,t,!1),t+4};r.prototype.writeFloatLE=function(n,t,i){return ot(this,n,t,!0,i)};r.prototype.writeFloatBE=function(n,t,i){return ot(this,n,t,!1,i)};r.prototype.writeDoubleLE=function(n,t,i){return st(this,n,t,!0,i)};r.prototype.writeDoubleBE=function(n,t,i){return st(this,n,t,!1,i)};r.prototype.copy=function(n,t,i,u){if((i||(i=0),u||0===u||(u=this.length),t>=n.length&&(t=n.length),t||(t=0),u>0&&u<i&&(u=i),u===i)||0===n.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(u<0)throw new RangeError("sourceEnd out of bounds");u>this.length&&(u=this.length);n.length-t<u-i&&(u=n.length-t+i);var f,e=u-i;if(this===n&&i<t&&t<u)for(f=e-1;f>=0;--f)n[f+t]=this[f+i];else if(e<1e3||!r.TYPED_ARRAY_SUPPORT)for(f=0;f<e;++f)n[f+t]=this[f+i];else Uint8Array.prototype.set.call(n,this.subarray(i,i+e),t);return e};r.prototype.fill=function(n,t,i,u){var e,f,o,s;if("string"==typeof n){if(("string"==typeof t?(u=t,t=0,i=this.length):"string"==typeof i&&(u=i,i=this.length),1===n.length)&&(e=n.charCodeAt(0),e<256&&(n=e)),void 0!==u&&"string"!=typeof u)throw new TypeError("encoding must be a string");if("string"==typeof u&&!r.isEncoding(u))throw new TypeError("Unknown encoding: "+u);}else"number"==typeof n&&(n&=255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;if(t>>>=0,i=void 0===i?this.length:i>>>0,n||(n=0),"number"==typeof n)for(f=t;f<i;++f)this[f]=n;else for(o=r.isBuffer(n)?n:a(new r(n,u).toString()),s=o.length,f=0;f<i-t;++f)this[f+t]=o[f%s];return this};ht=/[^+\/0-9A-Za-z-_]/g}).call(this,i(29))},function(n){var t=function(){return this}();try{t=t||new Function("return this")()}catch(n){"object"==typeof window&&(t=window)}n.exports=t},function(n,t){"use strict";function e(n){var i=n.length,t;if(i%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return t=n.indexOf("="),-1===t&&(t=i),[t,t===i?0:4-t%4]}function h(n,t,i){for(var e,f,o=[],u=t;u<i;u+=3)e=(n[u]<<16&16711680)+(n[u+1]<<8&65280)+(255&n[u+2]),o.push(r[(f=e)>>18&63]+r[f>>12&63]+r[f>>6&63]+r[63&f]);return o.join("")}t.byteLength=function(n){var t=e(n),r=t[0],i=t[1];return 3*(r+i)/4-i};t.toByteArray=function(n){for(var r,c=e(n),h=c[0],s=c[1],u=new o(function(n,t,i){return 3*(t+i)/4-i}(0,h,s)),f=0,l=s>0?h-4:h,t=0;t<l;t+=4)r=i[n.charCodeAt(t)]<<18|i[n.charCodeAt(t+1)]<<12|i[n.charCodeAt(t+2)]<<6|i[n.charCodeAt(t+3)],u[f++]=r>>16&255,u[f++]=r>>8&255,u[f++]=255&r;return 2===s&&(r=i[n.charCodeAt(t)]<<2|i[n.charCodeAt(t+1)]>>4,u[f++]=255&r),1===s&&(r=i[n.charCodeAt(t)]<<10|i[n.charCodeAt(t+1)]<<4|i[n.charCodeAt(t+2)]>>2,u[f++]=r>>8&255,u[f++]=255&r),u};t.fromByteArray=function(n){for(var t,i=n.length,e=i%3,f=[],o=16383,u=0,s=i-e;u<s;u+=o)f.push(h(n,u,u+o>s?s:u+o));return 1===e?(t=n[i-1],f.push(r[t>>2]+r[t<<4&63]+"==")):2===e&&(t=(n[i-2]<<8)+n[i-1],f.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),f.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,s=f.length;u<s;++u)r[u]=f[u],i[f.charCodeAt(u)]=u;i["-".charCodeAt(0)]=62;i["_".charCodeAt(0)]=63},function(n,t){t.read=function(n,t,i,r,u){var f,o,l=8*u-r-1,a=(1<<l)-1,v=a>>1,e=-7,s=i?u-1:0,c=i?-1:1,h=n[t+s];for(s+=c,f=h&(1<<-e)-1,h>>=-e,e+=l;e>0;f=256*f+n[t+s],s+=c,e-=8);for(o=f&(1<<-e)-1,f>>=-e,e+=r;e>0;o=256*o+n[t+s],s+=c,e-=8);if(0===f)f=1-v;else{if(f===a)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,r);f-=v}return(h?-1:1)*o*Math.pow(2,f-r)};t.write=function(n,t,i,r,u,f){var e,o,s,l=8*f-u-1,a=(1<<l)-1,h=a>>1,y=23===u?Math.pow(2,-24)-Math.pow(2,-77):0,c=r?0:f-1,v=r?1:-1,p=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,e=a):(e=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-e))<1&&(e--,s*=2),(t+=e+h>=1?y/s:y*Math.pow(2,1-h))*s>=2&&(e++,s/=2),e+h>=a?(o=0,e=a):e+h>=1?(o=(t*s-1)*Math.pow(2,u),e+=h):(o=t*Math.pow(2,h-1)*Math.pow(2,u),e=0));u>=8;n[i+c]=255&o,c+=v,o/=256,u-=8);for(e=e<<u|o,l+=u;l>0;n[i+c]=255&e,c+=v,e/=256,l-=8);n[i+c-v]|=128*p}},function(n){var t={}.toString;n.exports=Array.isArray||function(n){return"[object Array]"==t.call(n)}},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(n){var t=n.jws,i=n.KeyUtil,u=n.X509,f=n.crypto,e=n.hextob64u,o=n.b64tohex,s=n.AllowedSigningAlgs;return function(){function n(){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n)}return n.parseJwt=function(n){r.Log.debug("JoseUtil.parseJwt");try{var i=t.JWS.parse(n);return{header:i.headerObj,payload:i.payloadObj}}catch(u){r.Log.error(u)}},n.validateJwt=function(t,f,e,s,h,c,l){r.Log.debug("JoseUtil.validateJwt");try{if("RSA"===f.kty)if(f.e&&f.n)f=i.getKey(f);else{if(!f.x5c||!f.x5c.length)return r.Log.error("JoseUtil.validateJwt: RSA key missing key material",f),Promise.reject(new Error("RSA key missing key material"));var a=o(f.x5c[0]);f=u.getPublicKeyFromCertHex(a)}else{if("EC"!==f.kty)return r.Log.error("JoseUtil.validateJwt: Unsupported key type",f&&f.kty),Promise.reject(new Error(f.kty));if(!(f.crv&&f.x&&f.y))return r.Log.error("JoseUtil.validateJwt: EC key missing key material",f),Promise.reject(new Error("EC key missing key material"));f=i.getKey(f)}return n._validateJwt(t,f,e,s,h,c,l)}catch(n){return r.Log.error(n&&n.message||n),Promise.reject("JWT validation failed")}},n.validateJwtAttributes=function(t,i,u,f,e,o){var s,h,c;if(f||(f=0),e||(e=parseInt(Date.now()/1e3)),s=n.parseJwt(t).payload,!s.iss)return r.Log.error("JoseUtil._validateJwt: issuer was not provided"),Promise.reject(new Error("issuer was not provided"));if(s.iss!==i)return r.Log.error("JoseUtil._validateJwt: Invalid issuer in token",s.iss),Promise.reject(new Error("Invalid issuer in token: "+s.iss));if(!s.aud)return r.Log.error("JoseUtil._validateJwt: aud was not provided"),Promise.reject(new Error("aud was not provided"));if(!(s.aud===u||Array.isArray(s.aud)&&s.aud.indexOf(u)>=0))return r.Log.error("JoseUtil._validateJwt: Invalid audience in token",s.aud),Promise.reject(new Error("Invalid audience in token: "+s.aud));if(s.azp&&s.azp!==u)return r.Log.error("JoseUtil._validateJwt: Invalid azp in token",s.azp),Promise.reject(new Error("Invalid azp in token: "+s.azp));if(!o){if(h=e+f,c=e-f,!s.iat)return r.Log.error("JoseUtil._validateJwt: iat was not provided"),Promise.reject(new Error("iat was not provided"));if(h<s.iat)return r.Log.error("JoseUtil._validateJwt: iat is in the future",s.iat),Promise.reject(new Error("iat is in the future: "+s.iat));if(s.nbf&&h<s.nbf)return r.Log.error("JoseUtil._validateJwt: nbf is in the future",s.nbf),Promise.reject(new Error("nbf is in the future: "+s.nbf));if(!s.exp)return r.Log.error("JoseUtil._validateJwt: exp was not provided"),Promise.reject(new Error("exp was not provided"));if(s.exp<c)return r.Log.error("JoseUtil._validateJwt: exp is in the past",s.exp),Promise.reject(new Error("exp is in the past:"+s.exp))}return Promise.resolve(s)},n._validateJwt=function(i,u,f,e,o,h,c){return n.validateJwtAttributes(i,f,e,o,h,c).then(function(n){try{return t.JWS.verify(i,u,s)?n:(r.Log.error("JoseUtil._validateJwt: signature validation failed"),Promise.reject(new Error("signature validation failed")))}catch(n){return r.Log.error(n&&n.message||n),Promise.reject(new Error("signature validation failed"))}})},n.hashString=function(n,t){try{return f.Util.hashString(n,t)}catch(i){r.Log.error(i)}},n.hexToBase64Url=function(n){try{return e(n)}catch(t){r.Log.error(t)}},n}()};var r=i(0);n.exports=t.default},function(n,t,i){"use strict";function f(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}Object.defineProperty(t,"__esModule",{value:!0});t.SigninResponse=void 0;var r=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),u=i(3);t.SigninResponse=function(){function n(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#",i;f(this,n);i=u.UrlUtility.parseUrlFragment(t,r);this.error=i.error;this.error_description=i.error_description;this.error_uri=i.error_uri;this.code=i.code;this.state=i.state;this.id_token=i.id_token;this.session_state=i.session_state;this.access_token=i.access_token;this.token_type=i.token_type;this.scope=i.scope;this.profile=void 0;this.expires_in=i.expires_in}return r(n,[{key:"expires_in",get:function(){if(this.expires_at){var n=parseInt(Date.now()/1e3);return this.expires_at-n}},set:function(n){var t=parseInt(n),i;"number"==typeof t&&t>0&&(i=parseInt(Date.now()/1e3),this.expires_at=i+t)}},{key:"expired",get:function(){var n=this.expires_in;if(void 0!==n)return n<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}},{key:"isOpenIdConnect",get:function(){return this.scopes.indexOf("openid")>=0||!!this.id_token}}]),n}()},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.SignoutRequest=void 0;var u=i(0),r=i(3),f=i(9);t.SignoutRequest=function n(t){var i=t.url,o=t.id_token_hint,s=t.post_logout_redirect_uri,h=t.data,c=t.extraQueryParams,l=t.request_type,e;if(function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n),!i)throw u.Log.error("SignoutRequest.ctor: No url passed"),new Error("url");for(e in o&&(i=r.UrlUtility.addQueryParam(i,"id_token_hint",o)),s&&(i=r.UrlUtility.addQueryParam(i,"post_logout_redirect_uri",s),h&&(this.state=new f.State({data:h,request_type:l}),i=r.UrlUtility.addQueryParam(i,"state",this.state.id))),c)i=r.UrlUtility.addQueryParam(i,e,c[e]);this.url=i}},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.SignoutResponse=void 0;var r=i(3);t.SignoutResponse=function n(t){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n);var i=r.UrlUtility.parseUrlFragment(t,"?");this.error=i.error;this.error_description=i.error_description;this.error_uri=i.error_uri;this.state=i.state}},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.InMemoryWebStorage=void 0;var u=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),r=i(0);t.InMemoryWebStorage=function(){function n(){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n);this._data={}}return n.prototype.getItem=function(n){return r.Log.debug("InMemoryWebStorage.getItem",n),this._data[n]},n.prototype.setItem=function(n,t){r.Log.debug("InMemoryWebStorage.setItem",n);this._data[n]=t},n.prototype.removeItem=function(n){r.Log.debug("InMemoryWebStorage.removeItem",n);delete this._data[n]},n.prototype.key=function(n){return Object.getOwnPropertyNames(this._data)[n]},u(n,[{key:"length",get:function(){return Object.getOwnPropertyNames(this._data).length}}]),n}()},function(n,t,i){"use strict";function p(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function w(n,t){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?n:t}Object.defineProperty(t,"__esModule",{value:!0});t.UserManager=void 0;var e=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),r=i(0),o=i(10),u=i(39),f=i(15),s=i(45),h=i(47),c=i(18),l=i(8),a=i(20),v=i(11),y=i(4);t.UserManager=function(n){function t(){var f=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h.SilentRenewService,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c.SessionMonitor,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.TokenRevocationClient,b=arguments.length>4&&void 0!==arguments[4]?arguments[4]:v.TokenClient,k=arguments.length>5&&void 0!==arguments[5]?arguments[5]:y.JoseUtil,i;return p(this,t),f instanceof u.UserManagerSettings||(f=new u.UserManagerSettings(f)),i=w(this,n.call(this,f)),i._events=new s.UserManagerEvents(f),i._silentRenewService=new e(i),i.settings.automaticSilentRenew&&(r.Log.debug("UserManager.ctor: automaticSilentRenew is configured, setting up silent renew"),i.startSilentRenew()),i.settings.monitorSession&&(r.Log.debug("UserManager.ctor: monitorSession is configured, setting up session monitor"),i._sessionMonitor=new o(i)),i._tokenRevocationClient=new l(i._settings),i._tokenClient=new b(i._settings),i._joseUtil=k,i}return function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}});t&&(Object.setPrototypeOf?Object.setPrototypeOf(n,t):n.__proto__=t)}(t,n),t.prototype.getUser=function(){var n=this;return this._loadUser().then(function(t){return t?(r.Log.info("UserManager.getUser: user loaded"),n._events.load(t,!1),t):(r.Log.info("UserManager.getUser: user not found in storage"),null)})},t.prototype.removeUser=function(){var n=this;return this.storeUser(null).then(function(){r.Log.info("UserManager.removeUser: user removed from storage");n._events.unload()})},t.prototype.signinRedirect=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t;return(n=Object.assign({},n)).request_type="si:r",t={useReplaceToNavigate:n.useReplaceToNavigate},this._signinStart(n,this._redirectNavigator,t).then(function(){r.Log.info("UserManager.signinRedirect: successful")})},t.prototype.signinRedirectCallback=function(n){return this._signinEnd(n||this._redirectNavigator.url).then(function(n){return n.profile&&n.profile.sub?r.Log.info("UserManager.signinRedirectCallback: successful, signed in sub: ",n.profile.sub):r.Log.info("UserManager.signinRedirectCallback: no sub"),n})},t.prototype.signinPopup=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t;return(n=Object.assign({},n)).request_type="si:p",t=n.redirect_uri||this.settings.popup_redirect_uri||this.settings.redirect_uri,t?(n.redirect_uri=t,n.display="popup",this._signin(n,this._popupNavigator,{startUrl:t,popupWindowFeatures:n.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:n.popupWindowTarget||this.settings.popupWindowTarget}).then(function(n){return n&&(n.profile&&n.profile.sub?r.Log.info("UserManager.signinPopup: signinPopup successful, signed in sub: ",n.profile.sub):r.Log.info("UserManager.signinPopup: no sub")),n})):(r.Log.error("UserManager.signinPopup: No popup_redirect_uri or redirect_uri configured"),Promise.reject(new Error("No popup_redirect_uri or redirect_uri configured")))},t.prototype.signinPopupCallback=function(n){return this._signinCallback(n,this._popupNavigator).then(function(n){return n&&(n.profile&&n.profile.sub?r.Log.info("UserManager.signinPopupCallback: successful, signed in sub: ",n.profile.sub):r.Log.info("UserManager.signinPopupCallback: no sub")),n}).catch(function(n){r.Log.error(n.message)})},t.prototype.signinSilent=function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n=Object.assign({},n),this._loadUser().then(function(i){return i&&i.refresh_token?(n.refresh_token=i.refresh_token,t._useRefreshToken(n)):(n.request_type="si:s",n.id_token_hint=n.id_token_hint||t.settings.includeIdTokenInSilentRenew&&i&&i.id_token,i&&t._settings.validateSubOnSilentRenew&&(r.Log.debug("UserManager.signinSilent, subject prior to silent renew: ",i.profile.sub),n.current_sub=i.profile.sub),t._signinSilentIframe(n))})},t.prototype._useRefreshToken=function(){var n=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._tokenClient.exchangeRefreshToken(t).then(function(t){return t?t.access_token?n._loadUser().then(function(i){if(i){var u=Promise.resolve();return t.id_token&&(u=n._validateIdTokenFromTokenRefreshToken(i.profile,t.id_token)),u.then(function(){return r.Log.debug("UserManager._useRefreshToken: refresh token response success"),i.id_token=t.id_token||i.id_token,i.access_token=t.access_token,i.refresh_token=t.refresh_token||i.refresh_token,i.expires_in=t.expires_in,n.storeUser(i).then(function(){return n._events.load(i),i})})}return null}):(r.Log.error("UserManager._useRefreshToken: No access token returned from token endpoint"),Promise.reject("No access token returned from token endpoint")):(r.Log.error("UserManager._useRefreshToken: No response returned from token endpoint"),Promise.reject("No response returned from token endpoint"))})},t.prototype._validateIdTokenFromTokenRefreshToken=function(n,t){var i=this;return this._metadataService.getIssuer().then(function(u){return i.settings.getEpochTime().then(function(f){return i._joseUtil.validateJwtAttributes(t,u,i._settings.client_id,i._settings.clockSkew,f).then(function(t){return t?t.sub!==n.sub?(r.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: sub in id_token does not match current sub"),Promise.reject(new Error("sub in id_token does not match current sub"))):t.auth_time&&t.auth_time!==n.auth_time?(r.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: auth_time in id_token does not match original auth_time"),Promise.reject(new Error("auth_time in id_token does not match original auth_time"))):t.azp&&t.azp!==n.azp?(r.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: azp in id_token does not match original azp"),Promise.reject(new Error("azp in id_token does not match original azp"))):!t.azp&&n.azp?(r.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: azp not in id_token, but present in original id_token"),Promise.reject(new Error("azp not in id_token, but present in original id_token"))):void 0:(r.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: Failed to validate id_token"),Promise.reject(new Error("Failed to validate id_token")))})})})},t.prototype._signinSilentIframe=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=n.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return t?(n.redirect_uri=t,n.prompt=n.prompt||"none",this._signin(n,this._iframeNavigator,{startUrl:t,silentRequestTimeout:n.silentRequestTimeout||this.settings.silentRequestTimeout}).then(function(n){return n&&(n.profile&&n.profile.sub?r.Log.info("UserManager.signinSilent: successful, signed in sub: ",n.profile.sub):r.Log.info("UserManager.signinSilent: no sub")),n})):(r.Log.error("UserManager.signinSilent: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},t.prototype.signinSilentCallback=function(n){return this._signinCallback(n,this._iframeNavigator).then(function(n){return n&&(n.profile&&n.profile.sub?r.Log.info("UserManager.signinSilentCallback: successful, signed in sub: ",n.profile.sub):r.Log.info("UserManager.signinSilentCallback: no sub")),n})},t.prototype.signinCallback=function(n){var t=this;return this.readSigninResponseState(n).then(function(i){var r=i.state;return i.response,"si:r"===r.request_type?t.signinRedirectCallback(n):"si:p"===r.request_type?t.signinPopupCallback(n):"si:s"===r.request_type?t.signinSilentCallback(n):Promise.reject(new Error("invalid response_type in state"))})},t.prototype.signoutCallback=function(n,t){var i=this;return this.readSignoutResponseState(n).then(function(r){var u=r.state,f=r.response;return u?"so:r"===u.request_type?i.signoutRedirectCallback(n):"so:p"===u.request_type?i.signoutPopupCallback(n,t):Promise.reject(new Error("invalid response_type in state")):f})},t.prototype.querySessionStatus=function(){var i=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t;return(n=Object.assign({},n)).request_type="si:s",t=n.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri,t?(n.redirect_uri=t,n.prompt="none",n.response_type=n.response_type||this.settings.query_status_response_type,n.scope=n.scope||"openid",n.skipUserInfo=!0,this._signinStart(n,this._iframeNavigator,{startUrl:t,silentRequestTimeout:n.silentRequestTimeout||this.settings.silentRequestTimeout}).then(function(n){return i.processSigninResponse(n.url).then(function(n){if(r.Log.debug("UserManager.querySessionStatus: got signin response"),n.session_state&&n.profile.sub)return r.Log.info("UserManager.querySessionStatus: querySessionStatus success for sub: ",n.profile.sub),{session_state:n.session_state,sub:n.profile.sub,sid:n.profile.sid};r.Log.info("querySessionStatus successful, user not authenticated")}).catch(function(n){if(n.session_state&&i.settings.monitorAnonymousSession&&("login_required"==n.message||"consent_required"==n.message||"interaction_required"==n.message||"account_selection_required"==n.message))return r.Log.info("UserManager.querySessionStatus: querySessionStatus success for anonymous user"),{session_state:n.session_state};throw n;})})):(r.Log.error("UserManager.querySessionStatus: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},t.prototype._signin=function(n,t){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signinStart(n,t,r).then(function(t){return i._signinEnd(t.url,n)})},t.prototype._signinStart=function(n,t){var u=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.prepare(i).then(function(t){return r.Log.debug("UserManager._signinStart: got navigator window handle"),u.createSigninRequest(n).then(function(n){return r.Log.debug("UserManager._signinStart: got signin request"),i.url=n.url,i.id=n.state.id,t.navigate(i)}).catch(function(n){throw t.close&&(r.Log.debug("UserManager._signinStart: Error after preparing navigator, closing navigator window"),t.close()),n;})})},t.prototype._signinEnd=function(n){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.processSigninResponse(n).then(function(n){r.Log.debug("UserManager._signinEnd: got signin response");var u=new f.User(n);if(i.current_sub){if(i.current_sub!==u.profile.sub)return r.Log.debug("UserManager._signinEnd: current user does not match user returned from signin. sub from signin: ",u.profile.sub),Promise.reject(new Error("login_required"));r.Log.debug("UserManager._signinEnd: current user matches user returned from signin")}return t.storeUser(u).then(function(){return r.Log.debug("UserManager._signinEnd: user stored"),t._events.load(u),u})})},t.prototype._signinCallback=function(n,t){r.Log.debug("UserManager._signinCallback");var i="query"===this._settings.response_mode||!this._settings.response_mode&&l.SigninRequest.isCode(this._settings.response_type)?"?":"#";return t.callback(n,void 0,i)},t.prototype.signoutRedirect=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t,i;return(n=Object.assign({},n)).request_type="so:r",t=n.post_logout_redirect_uri||this.settings.post_logout_redirect_uri,t&&(n.post_logout_redirect_uri=t),i={useReplaceToNavigate:n.useReplaceToNavigate},this._signoutStart(n,this._redirectNavigator,i).then(function(){r.Log.info("UserManager.signoutRedirect: successful")})},t.prototype.signoutRedirectCallback=function(n){return this._signoutEnd(n||this._redirectNavigator.url).then(function(n){return r.Log.info("UserManager.signoutRedirectCallback: successful"),n})},t.prototype.signoutPopup=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t;return(n=Object.assign({},n)).request_type="so:p",t=n.post_logout_redirect_uri||this.settings.popup_post_logout_redirect_uri||this.settings.post_logout_redirect_uri,n.post_logout_redirect_uri=t,n.display="popup",n.post_logout_redirect_uri&&(n.state=n.state||{}),this._signout(n,this._popupNavigator,{startUrl:t,popupWindowFeatures:n.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:n.popupWindowTarget||this.settings.popupWindowTarget}).then(function(){r.Log.info("UserManager.signoutPopup: successful")})},t.prototype.signoutPopupCallback=function(n,t){return void 0===t&&"boolean"==typeof n&&(t=n,n=null),this._popupNavigator.callback(n,t,"?").then(function(){r.Log.info("UserManager.signoutPopupCallback: successful")})},t.prototype._signout=function(n,t){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._signoutStart(n,t,r).then(function(n){return i._signoutEnd(n.url)})},t.prototype._signoutStart=function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this,u=arguments[1],t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u.prepare(t).then(function(u){return r.Log.debug("UserManager._signoutStart: got navigator window handle"),n._loadUser().then(function(f){return r.Log.debug("UserManager._signoutStart: loaded current user from storage"),(n._settings.revokeAccessTokenOnSignout?n._revokeInternal(f):Promise.resolve()).then(function(){var e=i.id_token_hint||f&&f.id_token;return e&&(r.Log.debug("UserManager._signoutStart: Setting id_token into signout request"),i.id_token_hint=e),n.removeUser().then(function(){return r.Log.debug("UserManager._signoutStart: user removed, creating signout request"),n.createSignoutRequest(i).then(function(n){return r.Log.debug("UserManager._signoutStart: got signout request"),t.url=n.url,n.state&&(t.id=n.state.id),u.navigate(t)})})})}).catch(function(n){throw u.close&&(r.Log.debug("UserManager._signoutStart: Error after preparing navigator, closing navigator window"),u.close()),n;})})},t.prototype._signoutEnd=function(n){return this.processSignoutResponse(n).then(function(n){return r.Log.debug("UserManager._signoutEnd: got signout response"),n})},t.prototype.revokeAccessToken=function(){var n=this;return this._loadUser().then(function(t){return n._revokeInternal(t,!0).then(function(i){if(i)return r.Log.debug("UserManager.revokeAccessToken: removing token properties from user and re-storing"),t.access_token=null,t.refresh_token=null,t.expires_at=null,t.token_type=null,n.storeUser(t).then(function(){r.Log.debug("UserManager.revokeAccessToken: user stored");n._events.load(t)})})}).then(function(){r.Log.info("UserManager.revokeAccessToken: access token revoked successfully")})},t.prototype._revokeInternal=function(n,t){var f=this,i,u;return n?(i=n.access_token,u=n.refresh_token,this._revokeAccessTokenInternal(i,t).then(function(n){return f._revokeRefreshTokenInternal(u,t).then(function(t){return n||t||r.Log.debug("UserManager.revokeAccessToken: no need to revoke due to no token(s), or JWT format"),n||t})})):Promise.resolve(!1)},t.prototype._revokeAccessTokenInternal=function(n,t){return!n||n.indexOf(".")>=0?Promise.resolve(!1):this._tokenRevocationClient.revoke(n,t).then(function(){return!0})},t.prototype._revokeRefreshTokenInternal=function(n,t){return n?this._tokenRevocationClient.revoke(n,t,"refresh_token").then(function(){return!0}):Promise.resolve(!1)},t.prototype.startSilentRenew=function(){this._silentRenewService.start()},t.prototype.stopSilentRenew=function(){this._silentRenewService.stop()},t.prototype._loadUser=function(){return this._userStore.get(this._userStoreKey).then(function(n){return n?(r.Log.debug("UserManager._loadUser: user storageString loaded"),f.User.fromStorageString(n)):(r.Log.debug("UserManager._loadUser: no user storageString"),null)})},t.prototype.storeUser=function(n){if(n){r.Log.debug("UserManager.storeUser: storing user");var t=n.toStorageString();return this._userStore.set(this._userStoreKey,t)}return r.Log.debug("storeUser.storeUser: removing user"),this._userStore.remove(this._userStoreKey)},e(t,[{key:"_redirectNavigator",get:function(){return this.settings.redirectNavigator}},{key:"_popupNavigator",get:function(){return this.settings.popupNavigator}},{key:"_iframeNavigator",get:function(){return this.settings.iframeNavigator}},{key:"_userStore",get:function(){return this.settings.userStore}},{key:"events",get:function(){return this._events}},{key:"_userStoreKey",get:function(){return"user:"+this.settings.authority+":"+this.settings.client_id}}]),t}(o.OidcClient)},function(n,t,i){"use strict";function l(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function a(n,t){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?n:t}Object.defineProperty(t,"__esModule",{value:!0});t.UserManagerSettings=void 0;var r=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),u=(i(0),i(5)),f=i(40),e=i(41),o=i(43),s=i(6),h=i(1),c=i(8);t.UserManagerSettings=function(n){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},ft=r.popup_redirect_uri,et=r.popup_post_logout_redirect_uri,ot=r.popupWindowFeatures,st=r.popupWindowTarget,ht=r.silent_redirect_uri,ct=r.silentRequestTimeout,u=r.automaticSilentRenew,lt=void 0!==u&&u,v=r.validateSubOnSilentRenew,at=void 0!==v&&v,y=r.includeIdTokenInSilentRenew,vt=void 0===y||y,p=r.monitorSession,yt=void 0===p||p,w=r.monitorAnonymousSession,pt=void 0!==w&&w,b=r.checkSessionInterval,wt=void 0===b?2e3:b,k=r.stopCheckSessionOnError,bt=void 0===k||k,d=r.query_status_response_type,g=r.revokeAccessTokenOnSignout,kt=void 0!==g&&g,nt=r.accessTokenExpiringNotificationTime,dt=void 0===nt?60:nt,tt=r.redirectNavigator,gt=void 0===tt?new f.RedirectNavigator:tt,it=r.popupNavigator,ni=void 0===it?new e.PopupNavigator:it,rt=r.iframeNavigator,ti=void 0===rt?new o.IFrameNavigator:rt,ut=r.userStore,ii=void 0===ut?new s.WebStorageStateStore({store:h.Global.sessionStorage}):ut,i;return l(this,t),i=a(this,n.call(this,arguments[0])),i._popup_redirect_uri=ft,i._popup_post_logout_redirect_uri=et,i._popupWindowFeatures=ot,i._popupWindowTarget=st,i._silent_redirect_uri=ht,i._silentRequestTimeout=ct,i._automaticSilentRenew=lt,i._validateSubOnSilentRenew=at,i._includeIdTokenInSilentRenew=vt,i._accessTokenExpiringNotificationTime=dt,i._monitorSession=yt,i._monitorAnonymousSession=pt,i._checkSessionInterval=wt,i._stopCheckSessionOnError=bt,i._query_status_response_type=d?d:arguments[0]&&arguments[0].response_type?c.SigninRequest.isOidc(arguments[0].response_type)?"id_token":"code":"id_token",i._revokeAccessTokenOnSignout=kt,i._redirectNavigator=gt,i._popupNavigator=ni,i._iframeNavigator=ti,i._userStore=ii,i}return function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}});t&&(Object.setPrototypeOf?Object.setPrototypeOf(n,t):n.__proto__=t)}(t,n),r(t,[{key:"popup_redirect_uri",get:function(){return this._popup_redirect_uri}},{key:"popup_post_logout_redirect_uri",get:function(){return this._popup_post_logout_redirect_uri}},{key:"popupWindowFeatures",get:function(){return this._popupWindowFeatures}},{key:"popupWindowTarget",get:function(){return this._popupWindowTarget}},{key:"silent_redirect_uri",get:function(){return this._silent_redirect_uri}},{key:"silentRequestTimeout",get:function(){return this._silentRequestTimeout}},{key:"automaticSilentRenew",get:function(){return this._automaticSilentRenew}},{key:"validateSubOnSilentRenew",get:function(){return this._validateSubOnSilentRenew}},{key:"includeIdTokenInSilentRenew",get:function(){return this._includeIdTokenInSilentRenew}},{key:"accessTokenExpiringNotificationTime",get:function(){return this._accessTokenExpiringNotificationTime}},{key:"monitorSession",get:function(){return this._monitorSession}},{key:"monitorAnonymousSession",get:function(){return this._monitorAnonymousSession}},{key:"checkSessionInterval",get:function(){return this._checkSessionInterval}},{key:"stopCheckSessionOnError",get:function(){return this._stopCheckSessionOnError}},{key:"query_status_response_type",get:function(){return this._query_status_response_type}},{key:"revokeAccessTokenOnSignout",get:function(){return this._revokeAccessTokenOnSignout}},{key:"redirectNavigator",get:function(){return this._redirectNavigator}},{key:"popupNavigator",get:function(){return this._popupNavigator}},{key:"iframeNavigator",get:function(){return this._iframeNavigator}},{key:"userStore",get:function(){return this._userStore}}]),t}(u.OidcClientSettings)},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.RedirectNavigator=void 0;var r=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),u=i(0);t.RedirectNavigator=function(){function n(){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n)}return n.prototype.prepare=function(){return Promise.resolve(this)},n.prototype.navigate=function(n){return n&&n.url?(n.useReplaceToNavigate?window.location.replace(n.url):window.location=n.url,Promise.resolve()):(u.Log.error("RedirectNavigator.navigate: No url provided"),Promise.reject(new Error("No url provided")))},r(n,[{key:"url",get:function(){return window.location.href}}]),n}()},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PopupNavigator=void 0;var u=i(0),r=i(42);t.PopupNavigator=function(){function n(){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n)}return n.prototype.prepare=function(n){var t=new r.PopupWindow(n);return Promise.resolve(t)},n.prototype.callback=function(n,t,i){u.Log.debug("PopupNavigator.callback");try{return r.PopupWindow.notifyOpener(n,t,i),Promise.resolve()}catch(f){return Promise.reject(f)}},n}()},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PopupWindow=void 0;var u=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),r=i(0),f=i(3);t.PopupWindow=function(){function n(t){var i=this,u,f;!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n);this._promise=new Promise(function(n,t){i._resolve=n;i._reject=t});u=t.popupWindowTarget||"_blank";f=t.popupWindowFeatures||"location=no,toolbar=no,width=500,height=500,left=100,top=100;";this._popup=window.open("",u,f);this._popup&&(r.Log.debug("PopupWindow.ctor: popup successfully created"),this._checkForPopupClosedTimer=window.setInterval(this._checkForPopupClosed.bind(this),500))}return n.prototype.navigate=function(n){return this._popup?n&&n.url?(r.Log.debug("PopupWindow.navigate: Setting URL in popup"),this._id=n.id,this._id&&(window["popupCallback_"+n.id]=this._callback.bind(this)),this._popup.focus(),this._popup.window.location=n.url):(this._error("PopupWindow.navigate: no url provided"),this._error("No url provided")):this._error("PopupWindow.navigate: Error opening popup window"),this.promise},n.prototype._success=function(n){r.Log.debug("PopupWindow.callback: Successful response from popup window");this._cleanup();this._resolve(n)},n.prototype._error=function(n){r.Log.error("PopupWindow.error: ",n);this._cleanup();this._reject(new Error(n))},n.prototype.close=function(){this._cleanup(!1)},n.prototype._cleanup=function(n){r.Log.debug("PopupWindow.cleanup");window.clearInterval(this._checkForPopupClosedTimer);this._checkForPopupClosedTimer=null;delete window["popupCallback_"+this._id];this._popup&&!n&&this._popup.close();this._popup=null},n.prototype._checkForPopupClosed=function(){this._popup&&!this._popup.closed||this._error("Popup window closed")},n.prototype._callback=function(n,t){this._cleanup(t);n?(r.Log.debug("PopupWindow.callback success"),this._success({url:n})):(r.Log.debug("PopupWindow.callback: Invalid response from popup"),this._error("Invalid response from popup"))},n.notifyOpener=function(n,t,i){var u,o,e;window.opener?(n=n||window.location.href)&&(u=f.UrlUtility.parseUrlFragment(n,i),u.state?(o="popupCallback_"+u.state,e=window.opener[o],e?(r.Log.debug("PopupWindow.notifyOpener: passing url message to opener"),e(n,t)):r.Log.warn("PopupWindow.notifyOpener: no matching callback found on opener")):r.Log.warn("PopupWindow.notifyOpener: no state found in response url")):r.Log.warn("PopupWindow.notifyOpener: no window.opener. Can't complete notification.")},u(n,[{key:"promise",get:function(){return this._promise}}]),n}()},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.IFrameNavigator=void 0;var u=i(0),r=i(44);t.IFrameNavigator=function(){function n(){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n)}return n.prototype.prepare=function(n){var t=new r.IFrameWindow(n);return Promise.resolve(t)},n.prototype.callback=function(n){u.Log.debug("IFrameNavigator.callback");try{return r.IFrameWindow.notifyParent(n),Promise.resolve()}catch(t){return Promise.reject(t)}},n}()},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.IFrameWindow=void 0;var u=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),r=i(0);t.IFrameWindow=function(){function n(){var t=this;!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n);this._promise=new Promise(function(n,i){t._resolve=n;t._reject=i});this._boundMessageEvent=this._message.bind(this);window.addEventListener("message",this._boundMessageEvent,!1);this._frame=window.document.createElement("iframe");this._frame.style.visibility="hidden";this._frame.style.position="absolute";this._frame.width=0;this._frame.height=0;window.document.body.appendChild(this._frame)}return n.prototype.navigate=function(n){if(n&&n.url){var t=n.silentRequestTimeout||1e4;r.Log.debug("IFrameWindow.navigate: Using timeout of:",t);this._timer=window.setTimeout(this._timeout.bind(this),t);this._frame.src=n.url}else this._error("No url provided");return this.promise},n.prototype._success=function(n){this._cleanup();r.Log.debug("IFrameWindow: Successful response from frame window");this._resolve(n)},n.prototype._error=function(n){this._cleanup();r.Log.error(n);this._reject(new Error(n))},n.prototype.close=function(){this._cleanup()},n.prototype._cleanup=function(){this._frame&&(r.Log.debug("IFrameWindow: cleanup"),window.removeEventListener("message",this._boundMessageEvent,!1),window.clearTimeout(this._timer),window.document.body.removeChild(this._frame),this._timer=null,this._frame=null,this._boundMessageEvent=null)},n.prototype._timeout=function(){r.Log.debug("IFrameWindow.timeout");this._error("Frame window timed out")},n.prototype._message=function(n){if(r.Log.debug("IFrameWindow.message"),this._timer&&n.origin===this._origin&&n.source===this._frame.contentWindow&&"string"==typeof n.data&&(n.data.startsWith("http://")||n.data.startsWith("https://"))){var t=n.data;t?this._success({url:t}):this._error("Invalid response from frame")}},n.notifyParent=function(n){r.Log.debug("IFrameWindow.notifyParent");(n=n||window.location.href)&&(r.Log.debug("IFrameWindow.notifyParent: posting url message to parent"),window.parent.postMessage(n,location.protocol+"//"+location.host))},u(n,[{key:"promise",get:function(){return this._promise}},{key:"_origin",get:function(){return location.protocol+"//"+location.host}}]),n}()},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.UserManagerEvents=void 0;var r=i(0),f=i(16),u=i(17);t.UserManagerEvents=function(n){function t(i){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,t);var r=function(n,t){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?n:t}(this,n.call(this,i));return r._userLoaded=new u.Event("User loaded"),r._userUnloaded=new u.Event("User unloaded"),r._silentRenewError=new u.Event("Silent renew error"),r._userSignedIn=new u.Event("User signed in"),r._userSignedOut=new u.Event("User signed out"),r._userSessionChanged=new u.Event("User session changed"),r}return function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}});t&&(Object.setPrototypeOf?Object.setPrototypeOf(n,t):n.__proto__=t)}(t,n),t.prototype.load=function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];r.Log.debug("UserManagerEvents.load");n.prototype.load.call(this,t);i&&this._userLoaded.raise(t)},t.prototype.unload=function(){r.Log.debug("UserManagerEvents.unload");n.prototype.unload.call(this);this._userUnloaded.raise()},t.prototype.addUserLoaded=function(n){this._userLoaded.addHandler(n)},t.prototype.removeUserLoaded=function(n){this._userLoaded.removeHandler(n)},t.prototype.addUserUnloaded=function(n){this._userUnloaded.addHandler(n)},t.prototype.removeUserUnloaded=function(n){this._userUnloaded.removeHandler(n)},t.prototype.addSilentRenewError=function(n){this._silentRenewError.addHandler(n)},t.prototype.removeSilentRenewError=function(n){this._silentRenewError.removeHandler(n)},t.prototype._raiseSilentRenewError=function(n){r.Log.debug("UserManagerEvents._raiseSilentRenewError",n.message);this._silentRenewError.raise(n)},t.prototype.addUserSignedIn=function(n){this._userSignedIn.addHandler(n)},t.prototype.removeUserSignedIn=function(n){this._userSignedIn.removeHandler(n)},t.prototype._raiseUserSignedIn=function(){r.Log.debug("UserManagerEvents._raiseUserSignedIn");this._userSignedIn.raise()},t.prototype.addUserSignedOut=function(n){this._userSignedOut.addHandler(n)},t.prototype.removeUserSignedOut=function(n){this._userSignedOut.removeHandler(n)},t.prototype._raiseUserSignedOut=function(){r.Log.debug("UserManagerEvents._raiseUserSignedOut");this._userSignedOut.raise()},t.prototype.addUserSessionChanged=function(n){this._userSessionChanged.addHandler(n)},t.prototype.removeUserSessionChanged=function(n){this._userSessionChanged.removeHandler(n)},t.prototype._raiseUserSessionChanged=function(){r.Log.debug("UserManagerEvents._raiseUserSessionChanged");this._userSessionChanged.raise()},t}(f.AccessTokenEvents)},function(n,t,i){"use strict";function o(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function s(n,t){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?n:t}Object.defineProperty(t,"__esModule",{value:!0});t.Timer=void 0;var u=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),r=i(0),f=i(1),e=i(17);t.Timer=function(n){function t(i){var u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f.Global.timer,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r;return o(this,t),r=s(this,n.call(this,i)),r._timer=u,r._nowFunc=e||function(){return Date.now()/1e3},r}return function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}});t&&(Object.setPrototypeOf?Object.setPrototypeOf(n,t):n.__proto__=t)}(t,n),t.prototype.init=function(n){var i,t;n<=0&&(n=1);n=parseInt(n);i=this.now+n;this.expiration===i&&this._timerHandle?r.Log.debug("Timer.init timer "+this._name+" skipping initialization since already initialized for expiration:",this.expiration):(this.cancel(),r.Log.debug("Timer.init timer "+this._name+" for duration:",n),this._expiration=i,t=5,n<t&&(t=n),this._timerHandle=this._timer.setInterval(this._callback.bind(this),1e3*t))},t.prototype.cancel=function(){this._timerHandle&&(r.Log.debug("Timer.cancel: ",this._name),this._timer.clearInterval(this._timerHandle),this._timerHandle=null)},t.prototype._callback=function(){var t=this._expiration-this.now;r.Log.debug("Timer.callback; "+this._name+" timer expires in:",t);this._expiration<=this.now&&(this.cancel(),n.prototype.raise.call(this))},u(t,[{key:"now",get:function(){return parseInt(this._nowFunc())}},{key:"expiration",get:function(){return this._expiration}}]),t}(e.Event)},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.SilentRenewService=void 0;var r=i(0);t.SilentRenewService=function(){function n(t){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n);this._userManager=t}return n.prototype.start=function(){this._callback||(this._callback=this._tokenExpiring.bind(this),this._userManager.events.addAccessTokenExpiring(this._callback),this._userManager.getUser().then(function(){}).catch(function(n){r.Log.error("SilentRenewService.start: Error from getUser:",n.message)}))},n.prototype.stop=function(){this._callback&&(this._userManager.events.removeAccessTokenExpiring(this._callback),delete this._callback)},n.prototype._tokenExpiring=function(){var n=this;this._userManager.signinSilent().then(function(){r.Log.debug("SilentRenewService._tokenExpiring: Silent token renewal successful")},function(t){r.Log.error("SilentRenewService._tokenExpiring: Error from signinSilent:",t.message);n._userManager.events._raiseSilentRenewError(t)})},n}()},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CordovaPopupNavigator=void 0;var r=i(21);t.CordovaPopupNavigator=function(){function n(){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n)}return n.prototype.prepare=function(n){var t=new r.CordovaPopupWindow(n);return Promise.resolve(t)},n}()},function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CordovaIFrameNavigator=void 0;var r=i(21);t.CordovaIFrameNavigator=function(){function n(){!function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}(this,n)}return n.prototype.prepare=function(n){n.popupWindowFeatures="hidden=yes";var t=new r.CordovaPopupWindow(n);return Promise.resolve(t)},n}()},function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Version="1.11.5"}])};n.exports=t()},981:(n,t,i)=>{t.kO=t.Pd=void 0;const o=i(671);var f,u;!function(n){n.Success="success";n.RequiresRedirect="requiresRedirect"}(f=t.Pd||(t.Pd={})),function(n){n.Redirect="redirect";n.Success="success";n.Failure="failure";n.OperationCompleted="operationCompleted"}(u=t.kO||(t.kO={}));class e{constructor(n){this._userManager=n}async trySilentSignIn(){return this._intialSilentSignIn||(this._intialSilentSignIn=(async()=>{try{await this._userManager.signinSilent()}catch(n){}})()),this._intialSilentSignIn}async getUser(){window.parent!==window||window.opener||window.frameElement||!this._userManager.settings.redirect_uri||location.href.startsWith(this._userManager.settings.redirect_uri)||await r.instance.trySilentSignIn();const n=await this._userManager.getUser();return n&&n.profile}async getAccessToken(n){function i(n){const t=new Date;return t.setTime(t.getTime()+1e3*n),t}const t=await this._userManager.getUser();if(function(n){return!(!n||!n.access_token||n.expired||!n.scopes)}(t)&&function(n,t){const i=new Set(t);if(n&&n.scopes)for(const t of n.scopes)if(!i.has(t))return!1;return!0}(n,t.scopes))return{status:f.Success,token:{grantedScopes:t.scopes,expires:i(t.expires_in),value:t.access_token}};try{const r=n&&n.scopes?{scope:n.scopes.join(" ")}:void 0,t=await this._userManager.signinSilent(r);return{status:f.Success,token:{grantedScopes:t.scopes,expires:i(t.expires_in),value:t.access_token}}}catch(n){return{status:f.RequiresRedirect}}}async signIn(n){try{return await this._userManager.clearStaleState(),await this._userManager.signinSilent(this.createArguments()),this.success(n)}catch(t){try{return await this._userManager.clearStaleState(),await this._userManager.signinRedirect(this.createArguments(n)),this.redirect()}catch(n){return this.error(this.getExceptionMessage(n))}}}async completeSignIn(n){const t=await this.loginRequired(n),i=await this.stateExists(n);try{const t=await this._userManager.signinCallback(n);return window.self!==window.top?this.operationCompleted():this.success(t&&t.state)}catch(n){return t||window.self!==window.top||!i?this.operationCompleted():this.error("There was an error signing in.")}}async signOut(n){try{return await this._userManager.metadataService.getEndSessionEndpoint()?(await this._userManager.signoutRedirect(this.createArguments(n)),this.redirect()):(await this._userManager.removeUser(),this.success(n))}catch(n){return this.error(this.getExceptionMessage(n))}}async completeSignOut(n){try{if(await this.stateExists(n)){const t=await this._userManager.signoutCallback(n);return this.success(t&&t.state)}return this.operationCompleted()}catch(n){return this.error(this.getExceptionMessage(n))}}getExceptionMessage(n){return function(n){return n&&n.error_description}(n)?n.error_description:function(n){return n&&n.message}(n)?n.message:n.toString()}async stateExists(n){const t=new URLSearchParams(new URL(n).search).get("state");if(t&&this._userManager.settings.stateStore)return await this._userManager.settings.stateStore.get(t)}async loginRequired(n){const t=new URLSearchParams(new URL(n).search).get("error");return!(!t||!this._userManager.settings.stateStore)&&!1}createArguments(n){return{useReplaceToNavigate:!0,data:n}}error(n){return{status:u.Failure,errorMessage:n}}success(n){return{status:u.Success,state:n}}redirect(){return{status:u.Redirect}}operationCompleted(){return{status:u.OperationCompleted}}}class r{static init(n){return r._initialized||(r._initialized=r.initializeCore(n)),r._initialized}static handleCallback(){return r.initializeCore()}static async initializeCore(n){const t=n||r.resolveCachedSettings();if(!n&&t){const n=r.createUserManagerCore(t);window.parent!==window&&!window.opener&&window.frameElement&&n.settings.redirect_uri&&location.href.startsWith(n.settings.redirect_uri)&&(r.instance=new e(n),r._initialized=(async()=>{await r.instance.completeSignIn(location.href)})())}else if(n){const t=await r.createUserManager(n);r.instance=new e(t)}}static resolveCachedSettings(){const n=window.sessionStorage.getItem(`${r._infrastructureKey}.CachedAuthSettings`);if(n)return JSON.parse(n)}static getUser(){return r.instance.getUser()}static getAccessToken(n){return r.instance.getAccessToken(n)}static signIn(n){return r.instance.signIn(n)}static async completeSignIn(n){let t=this._pendingOperations[n];return t||(t=r.instance.completeSignIn(n),await t,delete this._pendingOperations[n]),t}static signOut(n){return r.instance.signOut(n)}static async completeSignOut(n){let t=this._pendingOperations[n];return t||(t=r.instance.completeSignOut(n),await t,delete this._pendingOperations[n]),t}static async createUserManager(n){let t;if(function(n){return n.hasOwnProperty("configurationEndpoint")}(n)){const i=await fetch(n.configurationEndpoint);if(!i.ok)throw new Error(`Could not load settings from '${n.configurationEndpoint}'`);t=await i.json()}else n.scope||(n.scope=n.defaultScopes.join(" ")),null===n.response_type&&delete n.response_type,t=n;return window.sessionStorage.setItem(`${r._infrastructureKey}.CachedAuthSettings`,JSON.stringify(t)),r.createUserManagerCore(t)}static createUserManagerCore(n){const t=new o.UserManager(n);return t.events.addUserSignedOut(async()=>{t.removeUser()}),t}}r._infrastructureKey="Microsoft.AspNetCore.Components.WebAssembly.Authentication";r._pendingOperations={};r.handleCallback();window.AuthenticationService=r}},n={};!function i(r){if(n[r])return n[r].exports;var u=n[r]={exports:{}};return t[r].call(u.exports,u,u.exports,i),u.exports}(981)})();
|
|
|
|
function getFileById(n,t){var i=n._blazorFilesById[t];if(!i)throw new Error("There is no file with ID "+t+". The file list may have changed");return i}function getArrayBufferFromFileAsync(n,t){var i=getFileById(n,t);return i.readPromise||(i.readPromise=new Promise(function(n,t){var r=new FileReader;r.onload=function(){n(r.result)};r.onerror=function(n){t(n)};r.readAsArrayBuffer(i.blob)})),i.readPromise}function hasParentInTree(n,t){return n.parentElement?n.parentElement.id===t?!0:hasParentInTree(n.parentElement,t):!1}!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).Popper={})}(this,function(n){function h(n){return{width:(n=n.getBoundingClientRect()).width,height:n.height,top:n.top,right:n.right,bottom:n.bottom,left:n.left,x:n.left,y:n.top}}function t(n){return null==n?window:"[object Window]"!==n.toString()?(n=n.ownerDocument)&&n.defaultView||window:n}function d(n){return{scrollLeft:(n=t(n)).pageXOffset,scrollTop:n.pageYOffset}}function l(n){return n instanceof t(n).Element||n instanceof Element}function r(n){return n instanceof t(n).HTMLElement||n instanceof HTMLElement}function ht(n){return"undefined"!=typeof ShadowRoot&&(n instanceof t(n).ShadowRoot||n instanceof ShadowRoot)}function u(n){return n?(n.nodeName||"").toLowerCase():null}function e(n){return((l(n)?n.ownerDocument:n.document)||window.document).documentElement}function g(n){return h(e(n)).left+d(n).scrollLeft}function o(n){return t(n).getComputedStyle(n)}function nt(n){return n=o(n),/auto|scroll|overlay|hidden/.test(n.overflow+n.overflowY+n.overflowX)}function ci(n,i,f){var s;void 0===f&&(f=!1);s=e(i);n=h(n);var l=r(i),c={scrollLeft:0,scrollTop:0},o={x:0,y:0};return(l||!l&&!f)&&(("body"!==u(i)||nt(s))&&(c=i!==t(i)&&r(i)?{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}:d(i)),r(i)?((o=h(i)).x+=i.clientLeft,o.y+=i.clientTop):s&&(o.x=g(s))),{x:n.left+c.scrollLeft-o.x,y:n.top+c.scrollTop-o.y,width:n.width,height:n.height}}function tt(n){var t=h(n),i=n.offsetWidth,r=n.offsetHeight;return 1>=Math.abs(t.width-i)&&(i=t.width),1>=Math.abs(t.height-r)&&(r=t.height),{x:n.offsetLeft,y:n.offsetTop,width:i,height:r}}function p(n){return"html"===u(n)?n:n.assignedSlot||n.parentNode||(ht(n)?n.host:null)||e(n)}function ct(n){return 0<=["html","body","#document"].indexOf(u(n))?n.ownerDocument.body:r(n)&&nt(n)?n:ct(p(n))}function a(n,i){var u,r;return void 0===i&&(i=[]),r=ct(n),n=r===(null==(u=n.ownerDocument)?void 0:u.body),u=t(r),r=n?[u].concat(u.visualViewport||[],nt(r)?r:[]):r,i=i.concat(r),n?i:i.concat(a(p(r)))}function lt(n){return r(n)&&"fixed"!==o(n).position?n.offsetParent:null}function v(n){for(var f,e=t(n),i=lt(n);i&&0<=["table","td","th"].indexOf(u(i))&&"static"===o(i).position;)i=lt(i);if(i&&("html"===u(i)||"body"===u(i)&&"static"===o(i).position))return e;if(!i)n:{for(i=-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),n=p(n);r(n)&&0>["html","body"].indexOf(u(n));){if(f=o(n),"none"!==f.transform||"none"!==f.perspective||"paint"===f.contain||-1!==["transform","perspective"].indexOf(f.willChange)||i&&"filter"===f.willChange||i&&f.filter&&"none"!==f.filter){i=n;break n}n=n.parentNode}i=null}return i||e}function li(n){function i(n){t.add(n.name);[].concat(n.requires||[],n.requiresIfExists||[]).forEach(function(n){t.has(n)||(n=r.get(n))&&i(n)});u.push(n)}var r=new Map,t=new Set,u=[];return n.forEach(function(n){r.set(n.name,n)}),n.forEach(function(n){t.has(n.name)||i(n)}),u}function ai(n){var t;return function(){return t||(t=new Promise(function(i){Promise.resolve().then(function(){t=void 0;i(n())})})),t}}function f(n){return n.split("-")[0]}function at(n,t){var i=t.getRootNode&&t.getRootNode();if(n.contains(t))return!0;if(i&&ht(i))do{if(t&&n.isSameNode(t))return!0;t=t.parentNode||t.host}while(t);return!1}function it(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function vt(n,u){var f,c,l,s;return"viewport"===u?(u=t(n),f=e(n),u=u.visualViewport,c=f.clientWidth,f=f.clientHeight,l=0,s=0,u&&(c=u.width,f=u.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(l=u.offsetLeft,s=u.offsetTop)),n=it(n={width:c,height:f,x:l+g(n),y:s})):r(u)?((n=h(u)).top+=u.clientTop,n.left+=u.clientLeft,n.bottom=n.top+u.clientHeight,n.right=n.left+u.clientWidth,n.width=u.clientWidth,n.height=u.clientHeight,n.x=n.left,n.y=n.top):(s=e(n),n=e(s),c=d(s),u=null==(f=s.ownerDocument)?void 0:f.body,f=i(n.scrollWidth,n.clientWidth,u?u.scrollWidth:0,u?u.clientWidth:0),l=i(n.scrollHeight,n.clientHeight,u?u.scrollHeight:0,u?u.clientHeight:0),s=-c.scrollLeft+g(s),c=-c.scrollTop,"rtl"===o(u||n).direction&&(s+=i(n.clientWidth,u?u.clientWidth:0)-f),n=it({width:f,height:l,x:s,y:c})),n}function vi(n,t,f){return t="clippingParents"===t?function(n){var i=a(p(n)),t=0<=["absolute","fixed"].indexOf(o(n).position)&&r(n)?v(n):n;return l(t)?i.filter(function(n){return l(n)&&at(n,t)&&"body"!==u(n)}):[]}(n):[].concat(t),(f=(f=[].concat(t,[f])).reduce(function(t,r){return r=vt(n,r),t.top=i(r.top,t.top),t.right=s(r.right,t.right),t.bottom=s(r.bottom,t.bottom),t.left=i(r.left,t.left),t},vt(n,f[0]))).width=f.right-f.left,f.height=f.bottom-f.top,f.x=f.left,f.y=f.top,f}function rt(n){return 0<=["top","bottom"].indexOf(n)?"x":"y"}function yt(n){var t=n.reference,e=n.element,u=(n=n.placement)?f(n):null,i,r;n=n?n.split("-")[1]:null;i=t.x+t.width/2-e.width/2;r=t.y+t.height/2-e.height/2;switch(u){case"top":i={x:i,y:t.y-e.height};break;case"bottom":i={x:i,y:t.y+t.height};break;case"right":i={x:t.x+t.width,y:r};break;case"left":i={x:t.x-e.width,y:r};break;default:i={x:t.x,y:t.y}}if(null!=(u=u?rt(u):null))switch(r="y"===u?"height":"width",n){case"start":i[u]-=t[r]/2-e[r]/2;break;case"end":i[u]+=t[r]/2-e[r]/2}return i}function pt(n){return Object.assign({},{top:0,right:0,bottom:0,left:0},n)}function wt(n,t){return t.reduce(function(t,i){return t[i]=n,t},{})}function c(n,t){var i,f,o,a,c,v;void 0===t&&(t={});i=t;t=void 0===(t=i.placement)?n.placement:t;var r=i.boundary,s=void 0===r?"clippingParents":r,u=void 0===(r=i.rootBoundary)?"viewport":r;return r=void 0===(r=i.elementContext)?"popper":r,f=i.altBoundary,o=void 0!==f&&f,i=pt("number"!=typeof(i=void 0===(i=i.padding)?0:i)?i:wt(i,y)),a=n.elements.reference,f=n.rects.popper,s=vi(l(o=n.elements[o?"popper"===r?"reference":"popper":r])?o:o.contextElement||e(n.elements.popper),s,u),o=yt({reference:u=h(a),element:f,strategy:"absolute",placement:t}),f=it(Object.assign({},f,o)),u="popper"===r?f:u,c={top:s.top-u.top+i.top,bottom:u.bottom-s.bottom+i.bottom,left:s.left-u.left+i.left,right:u.right-s.right+i.right},(n=n.modifiersData.offset,"popper"===r&&n)&&(v=n[t],Object.keys(c).forEach(function(n){var t=0<=["right","bottom"].indexOf(n)?1:-1,i=0<=["top","bottom"].indexOf(n)?"y":"x";c[n]+=v[i]*t})),c}function bt(){for(var t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];return!i.some(function(n){return!(n&&"function"==typeof n.getBoundingClientRect)})}function ut(n){void 0===n&&(n={});var i=n.defaultModifiers,r=void 0===i?[]:i,t=void 0===(n=n.defaultOptions)?ri:n;return function(n,i,u){function h(){o.forEach(function(n){return n()});o=[]}void 0===u&&(u=t);var f={placement:"bottom",orderedModifiers:[],options:Object.assign({},ri,t),modifiersData:{},elements:{reference:n,popper:i},attributes:{},styles:{}},o=[],s=!1,e={state:f,setOptions:function(u){return h(),f.options=Object.assign({},t,f.options,u),f.scrollParents={reference:l(n)?a(n):n.contextElement?a(n.contextElement):[],popper:a(i)},u=function(n){var t=li(n);return yi.reduce(function(n,i){return n.concat(t.filter(function(n){return n.phase===i}))},[])}(function(n){var t=n.reduce(function(n,t){var i=n[t.name];return n[t.name]=i?Object.assign({},i,t,{options:Object.assign({},i.options,t.options),data:Object.assign({},i.data,t.data)}):t,n},{});return Object.keys(t).map(function(n){return t[n]})}([].concat(r,f.options.modifiers))),f.orderedModifiers=u.filter(function(n){return n.enabled}),f.orderedModifiers.forEach(function(n){var i=n.name,t=n.options;t=void 0===t?{}:t;"function"==typeof(n=n.effect)&&(i=n({state:f,name:i,instance:e,options:t}),o.push(i||function(){}))}),e.update()},forceUpdate:function(){var n,t,i,r;if(!s&&(n=f.elements,t=n.reference,bt(t,n=n.popper)))for(f.rects={reference:ci(t,v(n),"fixed"===f.options.strategy),popper:tt(n)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach(function(n){return f.modifiersData[n.name]=Object.assign({},n.data)}),t=0;t<f.orderedModifiers.length;t++)!0===f.reset?(f.reset=!1,t=-1):(i=f.orderedModifiers[t],n=i.fn,r=i.options,r=void 0===r?{}:r,i=i.name,"function"==typeof n&&(f=n({state:f,options:r,name:i,instance:e})||f))},update:ai(function(){return new Promise(function(n){e.forceUpdate();n(f)})}),destroy:function(){h();s=!0}};return bt(n,i)?(e.setOptions(u).then(function(n){!s&&u.onFirstUpdate&&u.onFirstUpdate(n)}),e):e}}function kt(n){var f,u=n.popper,p=n.popperRect,w=n.placement,r=n.offsets,nt=n.position,c=n.gpuAcceleration,k=n.adaptive,i,l;!0===(n=n.roundOffsets)?(n=r.y,i=window.devicePixelRatio||1,n={x:b(b(r.x*i)/i)||0,y:b(b(n*i)/i)||0}):n="function"==typeof n?n(r):r;n=void 0===(n=(i=n).x)?0:n;i=void 0===(i=i.y)?0:i;l=r.hasOwnProperty("x");r=r.hasOwnProperty("y");var s,a="left",y="top",tt=window;if(k){var h=v(u),d="clientHeight",g="clientWidth";h===t(u)&&"static"!==o(h=e(u)).position&&(d="scrollHeight",g="scrollWidth");"top"===w&&(y="bottom",i-=h[d]-p.height,i*=c?1:-1);"left"===w&&(a="right",n-=h[g]-p.width,n*=c?1:-1)}return u=Object.assign({position:nt},k&&pi),c?Object.assign({},u,((s={})[y]=r?"0":"",s[a]=l?"0":"",s.transform=2>(tt.devicePixelRatio||1)?"translate("+n+"px, "+i+"px)":"translate3d("+n+"px, "+i+"px, 0)",s)):Object.assign({},u,((f={})[y]=r?i+"px":"",f[a]=l?n+"px":"",f.transform="",f))}function w(n){return n.replace(/left|right|bottom|top/g,function(n){return wi[n]})}function dt(n){return n.replace(/start|end/g,function(n){return bi[n]})}function gt(n,t,i){return void 0===i&&(i={x:0,y:0}),{top:n.top-t.height-i.y,right:n.right-t.width+i.x,bottom:n.bottom-t.height+i.y,left:n.left-t.width-i.x}}function ni(n){return["top","right","bottom","left"].some(function(t){return 0<=n[t]})}var y=["top","bottom","right","left"],ti=y.reduce(function(n,t){return n.concat([t+"-start",t+"-end"])},[]),ii=[].concat(y,["auto"]).reduce(function(n,t){return n.concat([t,t+"-start",t+"-end"])},[]),yi="beforeRead read afterRead beforeMain main afterMain beforeWrite write afterWrite".split(" "),i=Math.max,s=Math.min,b=Math.round,ri={placement:"bottom",modifiers:[],strategy:"absolute"},k={passive:!0},ft={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(n){var r=n.state,i=n.instance,u=(n=n.options).scroll,f=void 0===u||u,e=void 0===(n=n.resize)||n,o=t(r.elements.popper),s=[].concat(r.scrollParents.reference,r.scrollParents.popper);return f&&s.forEach(function(n){n.addEventListener("scroll",i.update,k)}),e&&o.addEventListener("resize",i.update,k),function(){f&&s.forEach(function(n){n.removeEventListener("scroll",i.update,k)});e&&o.removeEventListener("resize",i.update,k)}},data:{}},et={name:"popperOffsets",enabled:!0,phase:"read",fn:function(n){var t=n.state;t.modifiersData[n.name]=yt({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},pi={top:"auto",right:"auto",bottom:"auto",left:"auto"},ot={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(n){var t=n.state,i=n.options,r;n=void 0===(n=i.gpuAcceleration)||n;r=i.adaptive;r=void 0===r||r;i=void 0===(i=i.roundOffsets)||i;n={placement:f(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:n};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,kt(Object.assign({},n,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:r,roundOffsets:i}))));null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,kt(Object.assign({},n,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:i}))));t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},st={name:"applyStyles",enabled:!0,phase:"write",fn:function(n){var t=n.state;Object.keys(t.elements).forEach(function(n){var e=t.styles[n]||{},f=t.attributes[n]||{},i=t.elements[n];r(i)&&u(i)&&(Object.assign(i.style,e),Object.keys(f).forEach(function(n){var t=f[n];!1===t?i.removeAttribute(n):i.setAttribute(n,!0===t?"":t)}))})},effect:function(n){var t=n.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach(function(n){var f=t.elements[n],e=t.attributes[n]||{};n=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:i[n]).reduce(function(n,t){return n[t]="",n},{});r(f)&&u(f)&&(Object.assign(f.style,n),Object.keys(e).forEach(function(n){f.removeAttribute(n)}))})}},requires:["computeStyles"]},ui={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(n){var t=n.state,u=n.name,r=void 0===(n=n.options.offset)?[0,0]:n,i=(n=ii.reduce(function(n,i){var e=t.rects,o=f(i),s=0<=["left","top"].indexOf(o)?-1:1,u="function"==typeof r?r(Object.assign({},e,{placement:i})):r;return e=(e=u[0])||0,u=((u=u[1])||0)*s,o=0<=["left","right"].indexOf(o)?{x:u,y:e}:{x:e,y:u},n[i]=o,n},{}))[t.placement],e=i.x;i=i.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=e,t.modifiersData.popperOffsets.y+=i);t.modifiersData[u]=n}},wi={left:"right",right:"left",bottom:"top",top:"bottom"},bi={start:"end",end:"start"},fi={name:"flip",enabled:!0,phase:"main",fn:function(n){var i=n.state,t=n.options,u,r,l,d,a,p;if(n=n.name,!i.modifiersData[n]._skip){u=t.mainAxis;u=void 0===u||u;r=t.altAxis;r=void 0===r||r;var h=t.fallbackPlacements,nt=t.padding,tt=t.boundary,it=t.rootBoundary,ut=t.altBoundary,e=t.flipVariations,k=void 0===e||e,ft=t.allowedAutoPlacements;for(e=f(t=i.options.placement),h=h||(e!==t&&k?function(n){if("auto"===f(n))return[];var t=w(n);return[dt(n),t,dt(t)]}(t):[w(t)]),l=[t].concat(h).reduce(function(n,t){return n.concat("auto"===f(t)?function(n,t){var r;void 0===t&&(t={});var o=t.boundary,s=t.rootBoundary,h=t.padding,i=t.flipVariations,u=t.allowedAutoPlacements,l=void 0===u?ii:u,e=t.placement.split("-")[1];return 0===(i=(t=e?i?ti:ti.filter(function(n){return n.split("-")[1]===e}):y).filter(function(n){return 0<=l.indexOf(n)})).length&&(i=t),r=i.reduce(function(t,i){return t[i]=c(n,{placement:i,boundary:o,rootBoundary:s,padding:h})[f(i)],t},{}),Object.keys(r).sort(function(n,t){return r[n]-r[t]})}(i,{placement:t,boundary:tt,rootBoundary:it,padding:nt,flipVariations:k,allowedAutoPlacements:ft}):t)},[]),t=i.rects.reference,h=i.rects.popper,d=new Map,e=!0,a=l[0],p=0;p<l.length;p++){var v=l[p],rt=f(v),o="start"===v.split("-")[1],s=0<=["top","bottom"].indexOf(rt),b=s?"width":"height",g=c(i,{placement:v,boundary:tt,rootBoundary:it,altBoundary:ut,padding:nt});if(o=s?o?"right":"left":o?"bottom":"top",t[b]>h[b]&&(o=w(o)),b=w(o),s=[],u&&s.push(0>=g[rt]),r&&s.push(0>=g[o],0>=g[b]),s.every(function(n){return n})){a=v;e=!1;break}d.set(v,s)}if(e)for(u=function(n){var t=l.find(function(t){if(t=d.get(t))return t.slice(0,n).every(function(n){return n})});if(t)return a=t,"break"},r=k?3:1;0<r&&"break"!==u(r);r--);i.placement!==a&&(i.modifiersData[n]._skip=!0,i.placement=a,i.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},ei={name:"preventOverflow",enabled:!0,phase:"main",fn:function(n){var r=n.state,e=n.options,et;n=n.name;var t=e.mainAxis,h=void 0===t||t,d=void 0!==(t=e.altAxis)&&t;t=void 0===(t=e.tether)||t;var l=e.tetherOffset,w=void 0===l?0:l,b=c(r,{boundary:e.boundary,rootBoundary:e.rootBoundary,padding:e.padding,altBoundary:e.altBoundary});e=f(r.placement);var g=r.placement.split("-")[1],y=!g,u=rt(e);e="x"===u?"y":"x";l=r.modifiersData.popperOffsets;var a=r.rects.reference,o=r.rects.popper,k="function"==typeof w?w(Object.assign({},r.rects,{placement:r.placement})):w;if(w={x:0,y:0},l){if(h||d){var nt="y"===u?"top":"left",it="y"===u?"bottom":"right",p="y"===u?"height":"width",ot=l[u],st=l[u]+b[nt],ut=l[u]-b[it],ht=t?-o[p]/2:0,ft="start"===g?a[p]:o[p];g="start"===g?-o[p]:-a[p];o=r.elements.arrow;o=t&&o?tt(o):{width:0,height:0};et=r.modifiersData["arrow#persistent"]?r.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0};nt=et[nt];it=et[it];o=i(0,s(a[p],o[p]));ft=y?a[p]/2-ht-o-nt-k:ft-o-nt-k;a=y?-a[p]/2+ht+o+it+k:g+o+it+k;y=r.elements.arrow&&v(r.elements.arrow);k=r.modifiersData.offset?r.modifiersData.offset[r.placement][u]:0;y=l[u]+ft-k-(y?"y"===u?y.clientTop||0:y.clientLeft||0:0);a=l[u]+a-k;h&&(h=t?s(st,y):st,ut=t?i(ut,a):ut,h=i(h,s(ot,ut)),l[u]=h,w[u]=h-ot);d&&(h=(d=l[e])+b["x"===u?"top":"left"],b=d-b["x"===u?"bottom":"right"],h=t?s(h,y):h,t=t?i(b,a):b,t=i(h,s(d,t)),l[e]=t,w[e]=t-d)}r.modifiersData[n]=w}},requiresIfExists:["offset"]},oi={name:"arrow",enabled:!0,phase:"main",fn:function(n){var h,t=n.state,l=n.name,r=n.options,e=t.elements.arrow,o=t.modifiersData.popperOffsets,u=f(t.placement);if(n=rt(u),u=0<=["left","right"].indexOf(u)?"height":"width",e&&o){r=pt("number"!=typeof(r="function"==typeof(r=r.padding)?r(Object.assign({},t.rects,{placement:t.placement})):r)?r:wt(r,y));var c=tt(e),a="y"===n?"top":"left",p="y"===n?"bottom":"right",w=t.rects.reference[u]+t.rects.reference[n]-o[n]-t.rects.popper[u];o=o[n]-t.rects.reference[n];o=(e=(e=v(e))?"y"===n?e.clientHeight||0:e.clientWidth||0:0)/2-c[u]/2+(w/2-o/2);u=i(r[a],s(o,e-c[u]-r[p]));t.modifiersData[l]=((h={})[n]=u,h.centerOffset=u-o,h)}},effect:function(n){var t=n.state;if(null!=(n=void 0===(n=n.options.element)?"[data-popper-arrow]":n)){if("string"==typeof n&&!(n=t.elements.popper.querySelector(n)))return;at(t.elements.popper,n)&&(t.elements.arrow=n)}},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},si={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(n){var t=n.state;n=n.name;var i=t.rects.reference,r=t.rects.popper,u=t.modifiersData.preventOverflow,e=c(t,{elementContext:"reference"}),f=c(t,{altBoundary:!0});i=gt(e,i);r=gt(f,r,u);u=ni(i);f=ni(r);t.modifiersData[n]={referenceClippingOffsets:i,popperEscapeOffsets:r,isReferenceHidden:u,hasPopperEscaped:f};t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}},ki=ut({defaultModifiers:[ft,et,ot,st]}),hi=[ft,et,ot,st,ui,fi,ei,oi,si],di=ut({defaultModifiers:hi});n.applyStyles=st;n.arrow=oi;n.computeStyles=ot;n.createPopper=di;n.createPopperLite=ki;n.defaultModifiers=hi;n.detectOverflow=c;n.eventListeners=ft;n.flip=fi;n.hide=si;n.offset=ui;n.popperGenerator=ut;n.popperOffsets=et;n.preventOverflow=ei;Object.defineProperty(n,"__esModule",{value:!0})});!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@popperjs/core")):"function"==typeof define&&define.amd?define(["@popperjs/core"],t):(n=n||self).tippy=t(n.Popper)}(this,function(n){"use strict";function v(n,t,i){if(Array.isArray(n)){var r=n[t];return null==r?Array.isArray(i)?i[t]:i:r}return n}function y(n,t){var i={}.toString.call(n);return 0===i.indexOf("[object")&&i.indexOf(t+"]")>-1}function tt(n,t){return"function"==typeof n?n.apply(void 0,t):n}function it(n,t){return 0===t?n:function(r){clearTimeout(i);i=setTimeout(function(){n(r)},t)};var i}function rt(n,t){var i=Object.assign({},n);return t.forEach(function(n){delete i[n]}),i}function e(n){return[].concat(n)}function ut(n,t){-1===n.indexOf(t)&&n.push(t)}function ft(n){return n.split("-")[0]}function o(n){return[].slice.call(n)}function f(){return document.createElement("div")}function h(n){return["Element","Fragment"].some(function(t){return y(n,t)})}function p(n){return y(n,"MouseEvent")}function et(n){return!(!n||!n._tippy||n._tippy.reference!==n)}function dt(n){return h(n)?[n]:function(n){return y(n,"NodeList")}(n)?o(n):Array.isArray(n)?n:o(document.querySelectorAll(n))}function w(n,t){n.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function s(n,t){n.forEach(function(n){n&&n.setAttribute("data-state",t)})}function ot(n){var i,t=e(n)[0];return(null==t||null==(i=t.ownerDocument)?void 0:i.body)?t.ownerDocument:document}function b(n,t,i){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(t){n[r](t,i)})}function gt(){r.isTouch||(r.isTouch=!0,window.performance&&document.addEventListener("mousemove",ht))}function ht(){var n=performance.now();n-st<20&&(r.isTouch=!1,document.removeEventListener("mousemove",ht));st=n}function ni(){var n=document.activeElement,t;et(n)&&(t=n._tippy,n.blur&&!t.state.isVisible&&n.blur())}function ct(n){var t=(n.plugins||[]).reduce(function(t,i){var r=i.name,u=i.defaultValue;return r&&(t[r]=void 0!==n[r]?n[r]:u),t},{});return Object.assign({},n,{},t)}function lt(n,i){var r=Object.assign({},i,{content:tt(i.content,[n])},i.ignoreAttributes?{}:function(n,i){return(i?Object.keys(ct(Object.assign({},t,{plugins:i}))):ti).reduce(function(t,i){var r=(n.getAttribute("data-tippy-"+i)||"").trim();if(!r)return t;if("content"===i)t[i]=r;else try{t[i]=JSON.parse(r)}catch(n){t[i]=r}return t},{})}(n,i.plugins));return r.aria=Object.assign({},t.aria,{},r.aria),r.aria={expanded:"auto"===r.aria.expanded?i.interactive:r.aria.expanded,content:"auto"===r.aria.content?i.interactive?null:"describedby":r.aria.content},r}function k(n,t){n.innerHTML=t}function at(n){var t=f();return!0===n?t.className="tippy-arrow":(t.className="tippy-svg-arrow",h(n)?t.appendChild(n):k(t,n)),t}function vt(n,t){h(t.content)?(k(n,""),n.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?k(n,t.content):n.textContent=t.content)}function c(n){var i=n.firstElementChild,t=o(i.children);return{box:i,content:t.find(function(n){return n.classList.contains("tippy-content")}),arrow:t.find(function(n){return n.classList.contains("tippy-arrow")||n.classList.contains("tippy-svg-arrow")}),backdrop:t.find(function(n){return n.classList.contains("tippy-backdrop")})}}function yt(n){function u(t,i){var e=c(r),u=e.box,o=e.content,f=e.arrow;i.theme?u.setAttribute("data-theme",i.theme):u.removeAttribute("data-theme");"string"==typeof i.animation?u.setAttribute("data-animation",i.animation):u.removeAttribute("data-animation");i.inertia?u.setAttribute("data-inertia",""):u.removeAttribute("data-inertia");u.style.maxWidth="number"==typeof i.maxWidth?i.maxWidth+"px":i.maxWidth;i.role?u.setAttribute("role",i.role):u.removeAttribute("role");t.content===i.content&&t.allowHTML===i.allowHTML||vt(o,n.props);i.arrow?f?t.arrow!==i.arrow&&(u.removeChild(f),u.appendChild(at(i.arrow))):u.appendChild(at(i.arrow)):f&&u.removeChild(f)}var r=f(),t=f(),i;return t.className="tippy-box",t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1"),i=f(),i.className="tippy-content",i.setAttribute("data-state","hidden"),vt(i,n.props),r.appendChild(t),t.appendChild(i),u(n.props,n.props),{popper:r,onUpdate:u}}function ri(i,h){function gi(){var n=y.props.touch;return Array.isArray(n)?n:[n,0]}function nr(){return"hold"===gi()[0]}function g(){var n;return!!(null==(n=y.props.render)?void 0:n.$$tippy)}function rt(){return vi||i}function at(){var n=rt().parentNode;return n?ot(n):document}function vt(){return c(k)}function tr(n){return y.state.isMounted&&!y.state.isVisible||r.isTouch||wt&&"focus"===wt.type?0:v(y.props.delay,n?0:1,t.delay)}function bt(){k.style.pointerEvents=y.props.interactive&&y.state.isVisible?"":"none";k.style.zIndex=""+y.props.zIndex}function d(n,t,i){var r;(void 0===i&&(i=!0),ki.forEach(function(i){i[n]&&i[n].apply(void 0,t)}),i)&&(r=y.props)[n].apply(r,t)}function ir(){var r=y.props.aria,n,t;r.content&&(n="aria-"+r.content,t=k.id,e(y.props.triggerTarget||i).forEach(function(i){var r=i.getAttribute(n),u;y.state.isVisible?i.setAttribute(n,r?r+" "+t:t):(u=r&&r.replace(t,"").trim(),u?i.setAttribute(n,u):i.removeAttribute(n))}))}function yt(){!di&&y.props.aria.expanded&&e(y.props.triggerTarget||i).forEach(function(n){y.props.interactive?n.setAttribute("aria-expanded",y.state.isVisible&&n===rt()?"true":"false"):n.removeAttribute("aria-expanded")})}function fi(){at().removeEventListener("mousemove",nt);l=l.filter(function(n){return n!==nt})}function dt(n){if(!(r.isTouch&&(ti||"mousedown"===n.type)||y.props.interactive&&k.contains(n.target))){if(rt().contains(n.target)){if(r.isTouch)return;if(y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else d("onClickOutside",[y,n]);!0===y.props.hideOnClick&&(y.clearDelayTimeouts(),y.hide(),ni=!0,setTimeout(function(){ni=!1}),y.state.isMounted||ei())}}function rr(){ti=!0}function ur(){ti=!1}function fr(){var n=at();n.addEventListener("mousedown",dt,!0);n.addEventListener("touchend",dt,u);n.addEventListener("touchstart",ur,u);n.addEventListener("touchmove",rr,u)}function ei(){var n=at();n.removeEventListener("mousedown",dt,!0);n.removeEventListener("touchend",dt,u);n.removeEventListener("touchstart",ur,u);n.removeEventListener("touchmove",rr,u)}function er(n,t){function r(n){n.target===i&&(b(i,"remove",r),t())}var i=vt().box;if(0===n)return t();b(i,"remove",li);b(i,"add",r);li=r}function st(n,t,r){void 0===r&&(r=!1);e(y.props.triggerTarget||i).forEach(function(i){i.addEventListener(n,t,r);ui.push({node:i,eventType:n,handler:t,options:r})})}function or(){var n;nr()&&(st("touchstart",hr,{passive:!0}),st("touchend",lr,{passive:!0}));(n=y.props.trigger,n.split(/\s+/).filter(Boolean)).forEach(function(n){if("manual"!==n)switch(st(n,hr),n){case"mouseenter":st("mouseleave",lr);break;case"focus":st(kt?"focusout":"blur",ar);break;case"focusin":st("focusout",ar)}})}function sr(){ui.forEach(function(n){var t=n.node,i=n.eventType,r=n.handler,u=n.options;t.removeEventListener(i,r,u)});ui=[]}function hr(n){var i,t=!1,r;!y.state.isEnabled||vr(n)||ni||(r="focus"===(null==(i=wt)?void 0:i.type),wt=n,vi=n.currentTarget,yt(),!y.state.isVisible&&p(n)&&l.forEach(function(t){return t(n)}),"click"===n.type&&(y.props.trigger.indexOf("mouseenter")<0||ht)&&!1!==y.props.hideOnClick&&y.state.isVisible?t=!0:wr(n),"click"===n.type&&(ht=!t),t&&!r&>(n))}function cr(n){var t=n.target,i=rt().contains(t)||k.contains(t);"mousemove"===n.type&&i||function(n,t){var i=t.clientX,r=t.clientY;return n.every(function(n){var u=n.popperRect,o=n.popperState,f=n.props.interactiveBorder,e=ft(o.placement),t=o.modifiersData.offset;if(!t)return!0;var s="bottom"===e?t.top.y:0,h="top"===e?t.bottom.y:0,c="right"===e?t.left.x:0,l="left"===e?t.right.x:0,a=u.top-r+s>f,v=r-u.bottom-h>f,y=u.left-i+c>f,p=i-u.right-l>f;return a||v||y||p})}(oi().concat(k).map(function(n){var t,i=null==(t=n._tippy.popperInstance)?void 0:t.state;return i?{popperRect:n.getBoundingClientRect(),popperState:i,props:et}:null}).filter(Boolean),n)&&(fi(),gt(n))}function lr(n){vr(n)||y.props.trigger.indexOf("click")>=0&&ht||(y.props.interactive?y.hideWithInteractivity(n):gt(n))}function ar(n){y.props.trigger.indexOf("focusin")<0&&n.target!==rt()||y.props.interactive&&n.relatedTarget&&k.contains(n.relatedTarget)||gt(n)}function vr(n){return!!r.isTouch&&nr()!==n.type.indexOf("touch")>=0}function yr(){pr();var t=y.props,u=t.popperOptions,o=t.placement,s=t.offset,f=t.getReferenceClientRect,h=t.moveTransition,e=g()?c(k).arrow:null,l=f?{getBoundingClientRect:f,contextElement:f.contextElement||rt()}:i,r=[{name:"offset",options:{offset:s}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!h}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(n){var i=n.state,t;g()&&(t=vt().box,["placement","reference-hidden","escaped"].forEach(function(n){"placement"===n?t.setAttribute("data-placement",i.placement):i.attributes.popper["data-popper-"+n]?t.setAttribute("data-"+n,""):t.removeAttribute("data-"+n)}),i.attributes.popper={})}}];g()&&e&&r.push({name:"arrow",options:{element:e,padding:3}});r.push.apply(r,(null==u?void 0:u.modifiers)||[]);y.popperInstance=n.createPopper(l,k,Object.assign({},u,{placement:o,onFirstUpdate:ai,modifiers:r}))}function pr(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function oi(){return o(k.querySelectorAll("[data-tippy-root]"))}function wr(n){y.clearDelayTimeouts();n&&d("onTrigger",[y,n]);fr();var t=tr(!0),i=gi(),f=i[0],u=i[1];r.isTouch&&"hold"===f&&u&&(t=u);t?si=setTimeout(function(){y.show()},t):y.show()}function gt(n){if(y.clearDelayTimeouts(),d("onUntrigger",[y,n]),y.state.isVisible){if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(n.type)>=0&&ht)){var t=tr(!1);t?hi=setTimeout(function(){y.state.isVisible&&y.hide()},t):ci=requestAnimationFrame(function(){y.hide()})}}else ei()}var pt,si,hi,ci,wt,li,ai,vi,yi,et=lt(i,Object.assign({},t,{},ct((pt=h,Object.keys(pt).reduce(function(n,t){return void 0!==pt[t]&&(n[t]=pt[t]),n},{}))))),ht=!1,ni=!1,ti=!1,ri=!1,ui=[],nt=it(cr,et.interactiveDebounce),br=ii++,pi=(yi=et.plugins).filter(function(n,t){return yi.indexOf(n)===t}),y={id:br,reference:i,popper:f(),popperInstance:null,props:et,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:pi,clearDelayTimeouts:function(){clearTimeout(si);clearTimeout(hi);cancelAnimationFrame(ci)},setProps:function(n){if(!y.state.isDestroyed){d("onBeforeUpdate",[y,n]);sr();var r=y.props,t=lt(i,Object.assign({},y.props,{},n,{ignoreAttributes:!0}));y.props=t;or();r.interactiveDebounce!==t.interactiveDebounce&&(fi(),nt=it(cr,t.interactiveDebounce));r.triggerTarget&&!t.triggerTarget?e(r.triggerTarget).forEach(function(n){n.removeAttribute("aria-expanded")}):t.triggerTarget&&i.removeAttribute("aria-expanded");yt();bt();bi&&bi(r,t);y.popperInstance&&(yr(),oi().forEach(function(n){requestAnimationFrame(n._tippy.popperInstance.forceUpdate)}));d("onAfterUpdate",[y,n])}},setContent:function(n){y.setProps({content:n})},show:function(){var u=y.state.isVisible,f=y.state.isDestroyed,e=!y.state.isEnabled,o=r.isTouch&&!y.props.touch,n=v(y.props.duration,0,t.duration);if(!u&&!f&&!e&&!o&&!rt().hasAttribute("disabled")&&(d("onShow",[y],!1),!1!==y.props.onShow(y))){if(y.state.isVisible=!0,g()&&(k.style.visibility="visible"),bt(),fr(),y.state.isMounted||(k.style.transition="none"),g()){var i=vt(),h=i.box,c=i.content;w([h,c],0)}ai=function(){var t;if(y.state.isVisible&&!ri){if(ri=!0,k.offsetHeight,k.style.transition=y.props.moveTransition,g()&&y.props.animation){var i=vt(),r=i.box,u=i.content;w([r,u],n);s([r,u],"visible")}ir();yt();ut(a,y);null==(t=y.popperInstance)||t.forceUpdate();y.state.isMounted=!0;d("onMount",[y]);y.props.animation&&g()&&function(n,t){er(n,t)}(n,function(){y.state.isShown=!0;d("onShown",[y])})}},function(){var n,i=y.props.appendTo,r=rt();n=y.props.interactive&&i===t.appendTo||"parent"===i?r.parentNode:tt(i,[r]);n.contains(k)||n.appendChild(k);yr()}()}},hide:function(){var f=!y.state.isVisible,e=y.state.isDestroyed,o=!y.state.isEnabled,n=v(y.props.duration,1,t.duration);if(!f&&!e&&!o&&(d("onHide",[y],!1),!1!==y.props.onHide(y))){if(y.state.isVisible=!1,y.state.isShown=!1,ri=!1,ht=!1,g()&&(k.style.visibility="hidden"),fi(),ei(),bt(),g()){var i=vt(),r=i.box,u=i.content;y.props.animation&&(w([r,u],n),s([r,u],"hidden"))}ir();yt();y.props.animation?g()&&function(n,t){er(n,function(){!y.state.isVisible&&k.parentNode&&k.parentNode.contains(k)&&t()})}(n,y.unmount):y.unmount()}},hideWithInteractivity:function(n){at().addEventListener("mousemove",nt);ut(l,nt);nt(n)},enable:function(){y.state.isEnabled=!0},disable:function(){y.hide();y.state.isEnabled=!1},unmount:function(){(y.state.isVisible&&y.hide(),y.state.isMounted)&&(pr(),oi().forEach(function(n){n._tippy.unmount()}),k.parentNode&&k.parentNode.removeChild(k),a=a.filter(function(n){return n!==y}),y.state.isMounted=!1,d("onHidden",[y]))},destroy:function(){y.state.isDestroyed||(y.clearDelayTimeouts(),y.unmount(),sr(),delete i._tippy,y.state.isDestroyed=!0,d("onDestroy",[y]))}},ki,di;if(!et.render)return y;var wi=et.render(y),k=wi.popper,bi=wi.onUpdate;return k.setAttribute("data-tippy-root",""),k.id="tippy-"+y.id,y.popper=k,i._tippy=y,k._tippy=y,ki=pi.map(function(n){return n.fn(y)}),di=i.hasAttribute("aria-expanded"),or(),yt(),bt(),d("onCreate",[y]),et.showOnCreate&&wr(),k.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),k.addEventListener("mouseleave",function(n){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&(at().addEventListener("mousemove",nt),nt(n))}),y}function i(n,i){var f,e,r;return void 0===i&&(i={}),f=t.plugins.concat(i.plugins||[]),document.addEventListener("touchstart",gt,u),window.addEventListener("blur",ni),e=Object.assign({},i,{plugins:f}),r=dt(n).reduce(function(n,t){var i=t&&ri(t,e);return i&&n.push(i),n},[]),h(n)?r[0]:r}function pt(n){var t=n.clientX,i=n.clientY;d={clientX:t,clientY:i}}function wt(n,t){return!n||!t||n.top!==t.top||n.right!==t.right||n.bottom!==t.bottom||n.left!==t.left}var nt="undefined"!=typeof window&&"undefined"!=typeof document,bt=nt?navigator.userAgent:"",kt=/MSIE |Trident\//.test(bt),u={passive:!0,capture:!0},r={isTouch:!1},st=0,t=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),ti=Object.keys(t);yt.$$tippy=!0;var ii=1,l=[],a=[];i.defaultProps=t;i.setDefaultProps=function(n){Object.keys(n).forEach(function(i){t[i]=n[i]})};i.currentInput=r;var ui=Object.assign({},n.applyStyles,{effect:function(n){var t=n.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,i.popper);t.styles=i;t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow)}}),fi={mouseover:"mouseenter",focusin:"focus",click:"click"},ei={name:"animateFill",defaultValue:!1,fn:function(n){var r;if(!(null==(r=n.props.render)?void 0:r.$$tippy))return{};var u=c(n.popper),i=u.box,e=u.content,t=n.props.animateFill?function(){var n=f();return n.className="tippy-backdrop",s([n],"hidden"),n}():null;return{onCreate:function(){t&&(i.insertBefore(t,i.firstElementChild),i.setAttribute("data-animatefill",""),i.style.overflow="hidden",n.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(t){var n=i.style.transitionDuration,r=Number(n.replace("ms",""));e.style.transitionDelay=Math.round(r/10)+"ms";t.style.transitionDuration=n;s([t],"visible")}},onShow:function(){t&&(t.style.transitionDuration="0ms")},onHide:function(){t&&s([t],"hidden")}}}},d={clientX:0,clientY:0},g=[];var oi={name:"followCursor",defaultValue:!1,fn:function(n){function s(){return"initial"===n.props.followCursor&&n.state.isVisible}function h(){t.addEventListener("mousemove",e)}function c(){t.removeEventListener("mousemove",e)}function l(){r=!0;n.setProps({getReferenceClientRect:null});r=!1}function e(t){var o=!t.target||i.contains(t.target),r=n.props.followCursor,u=t.clientX,f=t.clientY,e=i.getBoundingClientRect(),s=u-e.left,h=f-e.top;!o&&n.props.interactive||n.setProps({getReferenceClientRect:function(){var n=i.getBoundingClientRect(),t=u,e=f;"initial"===r&&(t=n.left+s,e=n.top+h);var o="horizontal"===r?n.top:e,c="vertical"===r?n.right:t,l="horizontal"===r?n.bottom:e,a="vertical"===r?n.left:t;return{width:c-a,height:l-o,top:o,right:c,bottom:l,left:a}}})}function a(){n.props.followCursor&&(g.push({instance:n,doc:t}),function(n){n.addEventListener("mousemove",pt)}(t))}function v(){0===(g=g.filter(function(t){return t.instance!==n})).filter(function(n){return n.doc===t}).length&&function(n){n.removeEventListener("mousemove",pt)}(t)}var i=n.reference,t=ot(n.props.triggerTarget||i),r=!1,u=!1,f=!0,o=n.props;return{onCreate:a,onDestroy:v,onBeforeUpdate:function(){o=n.props},onAfterUpdate:function(t,i){var f=i.followCursor;r||void 0!==f&&o.followCursor!==f&&(v(),f?(a(),!n.state.isMounted||u||s()||h()):(c(),l()))},onMount:function(){n.props.followCursor&&!u&&(f&&(e(d),f=!1),s()||h())},onTrigger:function(n,t){p(t)&&(d={clientX:t.clientX,clientY:t.clientY});u="focus"===t.type},onHidden:function(){n.props.followCursor&&(l(),c(),f=!0)}}}},si={name:"inlinePositioning",defaultValue:!1,fn:function(n){function f(){var t;i||(t=function(n,t){var i;return{popperOptions:Object.assign({},n.popperOptions,{modifiers:[].concat(((null==(i=n.popperOptions)?void 0:i.modifiers)||[]).filter(function(n){return n.name!==t.name}),[t])})}}(n.props,e),i=!0,n.setProps(t),i=!1)}var r,u=n.reference,t=-1,i=!1,e={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(i){var f=i.state;n.props.inlinePositioning&&(r!==f.placement&&n.setProps({getReferenceClientRect:function(){return function(n){return function(n,t,i,r){if(i.length<2||null===n)return t;if(2===i.length&&r>=0&&i[0].left>i[1].right)return i[r]||t;switch(n){case"top":case"bottom":var u=i[0],f=i[i.length-1],h="top"===n,c=u.top,l=f.bottom,a=h?u.left:f.left,v=h?u.right:f.right;return{top:c,bottom:l,left:a,right:v,width:v-a,height:l-c};case"left":case"right":var e=Math.min.apply(Math,i.map(function(n){return n.left})),o=Math.max.apply(Math,i.map(function(n){return n.right})),s=i.filter(function(t){return"left"===n?t.left===e:t.right===o}),y=s[0].top,p=s[s.length-1].bottom;return{top:y,bottom:p,left:e,right:o,width:o-e,height:p-y};default:return t}}(ft(n),u.getBoundingClientRect(),o(u.getClientRects()),t)}(f.placement)}}),r=f.placement)}};return{onCreate:f,onAfterUpdate:f,onTrigger:function(i,r){if(p(r)){var u=o(n.reference.getClientRects()),f=u.find(function(n){return n.left-2<=r.clientX&&n.right+2>=r.clientX&&n.top-2<=r.clientY&&n.bottom+2>=r.clientY});t=u.indexOf(f)}},onUntrigger:function(){t=-1}}}},hi={name:"sticky",defaultValue:!1,fn:function(n){function t(t){return!0===n.props.sticky||n.props.sticky===t}function u(){var o=t("reference")?(n.popperInstance?n.popperInstance.state.elements.reference:f).getBoundingClientRect():null,s=t("popper")?e.getBoundingClientRect():null;(o&&wt(i,o)||s&&wt(r,s))&&n.popperInstance&&n.popperInstance.update();i=o;r=s;n.state.isMounted&&requestAnimationFrame(u)}var f=n.reference,e=n.popper,i=null,r=null;return{onMount:function(){n.props.sticky&&u()}}}};return nt&&function(n){var t=document.createElement("style"),i,r;t.textContent=n;t.setAttribute("data-tippy-stylesheet","");i=document.head;r=document.querySelector("head>style,head>link");r?i.insertBefore(t,r):i.appendChild(t)}('.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}'),i.setDefaultProps({plugins:[ei,oi,si,hi],render:yt}),i.createSingleton=function(n,t){function y(){u=o.map(function(n){return n.reference})}function c(n){o.forEach(function(t){n?t.enable():t.disable()})}function p(n){return o.map(function(t){var i=t.setProps;return t.setProps=function(r){i(r);t.reference===e&&n.setProps(r)},function(){t.setProps=i}})}function s(n,t){var r=u.indexOf(t),i;t!==e&&(e=t,i=(l||[]).concat("content").reduce(function(n,t){return n[t]=o[r].props[t],n},{}),n.setProps(Object.assign({},i,{getReferenceClientRect:"function"==typeof i.getReferenceClientRect?i.getReferenceClientRect:function(){return t.getBoundingClientRect()}})))}var a,w;void 0===t&&(t={});var e,o=n,u=[],l=t.overrides,v=[],h=!1;c(!1);y();var b={fn:function(){return{onDestroy:function(){c(!0)},onHidden:function(){e=null},onClickOutside:function(n){n.props.showOnCreate&&!h&&(h=!0,e=null)},onShow:function(n){n.props.showOnCreate&&!h&&(h=!0,s(n,u[0]))},onTrigger:function(n,t){s(n,t.currentTarget)}}}},r=i(f(),Object.assign({},rt(t,["overrides"]),{plugins:[b].concat(t.plugins||[]),triggerTarget:u,popperOptions:Object.assign({},t.popperOptions,{modifiers:[].concat((null==(a=t.popperOptions)?void 0:a.modifiers)||[],[ui])})})),k=r.show;return r.show=function(n){if(k(),!e&&null==n)return s(r,u[0]);if(!e||null!=n){if("number"==typeof n)return u[n]&&s(r,u[n]);if(o.includes(n)){var t=n.reference;return s(r,t)}return u.includes(n)?s(r,n):void 0}},r.showNext=function(){var t=u[0],n;if(!e)return r.show(0);n=u.indexOf(e);r.show(u[n+1]||t)},r.showPrevious=function(){var n=u[u.length-1],t,i;if(!e)return r.show(n);t=u.indexOf(e);i=u[t-1]||n;r.show(i)},w=r.setProps,r.setProps=function(n){l=n.overrides||l;w(n)},r.setInstances=function(n){c(!0);v.forEach(function(n){return n()});o=n;c(!1);y();p(r);r.setProps({triggerTarget:u})},v=p(r),r},i.delegate=function(n,r){function o(n){var u,o,e;n.target&&!c&&(u=n.target.closest(y),u&&(o=u.getAttribute("data-tippy-trigger")||r.trigger||t.trigger,u._tippy||"touchstart"===n.type&&"boolean"==typeof a.touch||"touchstart"!==n.type&&o.indexOf(fi[n.type])<0||(e=i(u,a),e&&(f=f.concat(e)))))}function s(n,t,i,r){void 0===r&&(r=!1);n.addEventListener(t,i,r);h.push({node:n,eventType:t,handler:i,options:r})}var h=[],f=[],c=!1,y=r.target,l=rt(r,["target"]),p=Object.assign({},l,{trigger:"manual",touch:!1}),a=Object.assign({},l,{showOnCreate:!0}),v=i(n,p);return e(v).forEach(function(n){var t=n.destroy,i=n.enable,r=n.disable;n.destroy=function(n){void 0===n&&(n=!0);n&&f.forEach(function(n){n.destroy()});f=[];h.forEach(function(n){var t=n.node,i=n.eventType,r=n.handler,u=n.options;t.removeEventListener(i,r,u)});h=[];t()};n.enable=function(){i();f.forEach(function(n){return n.enable()});c=!1};n.disable=function(){r();f.forEach(function(n){return n.disable()});c=!0},function(n){var t=n.reference;s(t,"touchstart",o,u);s(t,"mouseover",o);s(t,"focusin",o);s(t,"click",o)}(n)}),v},i.hideAll=function(n){var i=void 0===n?{}:n,t=i.exclude,r=i.duration;a.forEach(function(n){var i=!1,u;(t&&(i=et(t)?n.reference===t:n.popper===t.popper),i)||(u=n.props.duration,n.setProps({duration:r}),n.hide(),n.state.isDestroyed||n.setProps({duration:u}))})},i.roundArrow='<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"><\/svg>',i});!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n="undefined"!=typeof globalThis?globalThis:n||self).flatpickr=t()}(this,function(){"use strict";function nt(){for(var t,i,u=0,n=0,f=arguments.length;n<f;n++)u+=arguments[n].length;for(t=Array(u),i=0,n=0;n<f;n++)for(var e=arguments[n],r=0,o=e.length;r<o;r++,i++)t[i]=e[r];return t}function tt(n,t){var i;return function(){var r=this;clearTimeout(i);i=setTimeout(function(){return n.apply(r,arguments)},t)}}function r(n,t,i){if(!0===i)return n.classList.add(t);n.classList.remove(t)}function n(n,t,i){var r=window.document.createElement(n);return t=t||"",i=i||"",r.className=t,void 0!==i&&(r.textContent=i),r}function a(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function it(n,t){return t(n)?n:n.parentNode?it(n.parentNode,t):void 0}function v(t,i){var u=n("div","numInputWrapper"),r=n("input","numInput "+t),e=n("span","arrowUp"),o=n("span","arrowDown"),f;if(-1===navigator.userAgent.indexOf("MSIE 9.0")?r.type="number":(r.type="text",r.pattern="\\d*"),void 0!==i)for(f in i)r.setAttribute(f,i[f]);return u.appendChild(r),u.appendChild(e),u.appendChild(o),u}function f(n){try{return"function"==typeof n.composedPath?n.composedPath()[0]:n.target}catch(t){return n.target}}function e(n,t,i){return void 0===i&&(i=!0),!1!==i?new Date(n.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):n.getTime()-t.getTime()}function g(n){var t=n.defaultHour,i=n.defaultMinute,r=n.defaultSeconds,f,o;if(void 0!==n.minDate){var u=n.minDate.getHours(),e=n.minDate.getMinutes(),s=n.minDate.getSeconds();t<u&&(t=u);t===u&&i<e&&(i=e);t===u&&i===e&&r<s&&(r=n.minDate.getSeconds())}return void 0!==n.maxDate&&(f=n.maxDate.getHours(),o=n.maxDate.getMinutes(),(t=Math.min(t,f))===f&&(i=Math.min(o,i)),t===f&&i===o&&(r=n.maxDate.getSeconds())),{hours:t,minutes:i,seconds:r}}function et(h,l){function vi(n){return n.bind(b)}function yi(){var n=b.config;!1===n.weekNumbers&&1===n.showMonths||!0!==n.noCalendar&&window.requestAnimationFrame(function(){if(void 0!==b.calendarContainer&&(b.calendarContainer.style.visibility="hidden",b.calendarContainer.style.display="block"),void 0!==b.daysContainer){var t=(b.days.offsetWidth+1)*n.showMonths;b.daysContainer.style.width=t+"px";b.calendarContainer.style.width=t+(void 0!==b.weekWrapper?b.weekWrapper.offsetWidth:0)+"px";b.calendarContainer.style.removeProperty("visibility");b.calendarContainer.style.removeProperty("display")}})}function ht(n){var t,i,r;0===b.selectedDates.length&&(t=void 0===b.config.minDate||e(new Date,b.config.minDate)>=0?new Date:new Date(b.config.minDate.getTime()),i=g(b.config),t.setHours(i.hours,i.minutes,i.seconds,t.getMilliseconds()),b.selectedDates=[t],b.latestSelectedDateObj=t);void 0!==n&&"blur"!==n.type&&function(n){var r,c;n.preventDefault();var v="keydown"===n.type,l=f(n),t=l;void 0!==b.amPM&&l===b.amPM&&(b.amPM.textContent=b.l10n.amPM[o(b.amPM.textContent===b.l10n.amPM[0])]);var a=parseFloat(t.getAttribute("min")),e=parseFloat(t.getAttribute("max")),s=parseFloat(t.getAttribute("step")),h=parseInt(t.value,10),y=n.delta||(v?38===n.which?1:-1:0),i=h+s*y;void 0!==t.value&&2===t.value.length&&(r=t===b.hourElement,c=t===b.minuteElement,i<a?(i=e+i+o(!r)+(o(r)&&o(!b.amPM)),c&&ui(void 0,-1,b.hourElement)):i>e&&(i=t===b.hourElement?i-e-o(!b.amPM):a,c&&ui(void 0,1,b.hourElement)),b.amPM&&r&&(1===s?i+h===23:Math.abs(i-h)>s)&&(b.amPM.textContent=b.l10n.amPM[o(b.amPM.textContent===b.l10n.amPM[0])]),t.value=u(i))}(n);r=b._input.value;yt();ot();b._input.value!==r&&b._debouncedChange()}function yt(){var h,r,i;if(void 0!==b.hourElement&&void 0!==b.minuteElement){var f,s,n=(parseInt(b.hourElement.value.slice(-2),10)||0)%24,t=(parseInt(b.minuteElement.value,10)||0)%60,u=void 0!==b.secondElement?(parseInt(b.secondElement.value,10)||0)%60:0;void 0!==b.amPM&&(f=n,s=b.amPM.textContent,n=f%12+12*o(s===b.l10n.amPM[1]));h=void 0!==b.config.minTime||b.config.minDate&&b.minDateHasTime&&b.latestSelectedDateObj&&0===e(b.latestSelectedDateObj,b.config.minDate,!0);(void 0!==b.config.maxTime||b.config.maxDate&&b.maxDateHasTime&&b.latestSelectedDateObj&&0===e(b.latestSelectedDateObj,b.config.maxDate,!0))&&(r=void 0!==b.config.maxTime?b.config.maxTime:b.config.maxDate,(n=Math.min(n,r.getHours()))===r.getHours()&&(t=Math.min(t,r.getMinutes())),t===r.getMinutes()&&(u=Math.min(u,r.getSeconds())));h&&(i=void 0!==b.config.minTime?b.config.minTime:b.config.minDate,(n=Math.max(n,i.getHours()))===i.getHours()&&t<i.getMinutes()&&(t=i.getMinutes()),t===i.getMinutes()&&(u=Math.max(u,i.getSeconds())));ii(n,t,u)}}function pt(n){var t=n||b.latestSelectedDateObj;t&&ii(t.getHours(),t.getMinutes(),t.getSeconds())}function ii(n,t,i){void 0!==b.latestSelectedDateObj&&b.latestSelectedDateObj.setHours(n%24,t,i||0,0);b.hourElement&&b.minuteElement&&!b.isMobile&&(b.hourElement.value=u(b.config.time_24hr?n:(12+n)%12+12*o(n%12==0)),b.minuteElement.value=u(t),void 0!==b.amPM&&(b.amPM.textContent=b.l10n.amPM[o(n>=12)]),void 0!==b.secondElement&&(b.secondElement.value=u(i)))}function fr(n){var i=f(n),t=parseInt(i.value)+(n.delta||0);(t/1e3>1||"Enter"===n.key&&!/[^\d]/.test(t.toString()))&&dt(t)}function ut(n,t,i,r){return t instanceof Array?t.forEach(function(t){return ut(n,t,i,r)}):n instanceof Array?n.forEach(function(n){return ut(n,t,i,r)}):(n.addEventListener(t,i,r),void b._handlers.push({remove:function(){return n.removeEventListener(t,i)}}))}function ri(){et("onChange")}function wt(n,t){var i=void 0!==n?b.parseDate(n):b.latestSelectedDateObj||(b.config.minDate&&b.config.minDate>b.now?b.config.minDate:b.config.maxDate&&b.config.maxDate<b.now?b.config.maxDate:b.now),r=b.currentYear,u=b.currentMonth;try{void 0!==i&&(b.currentYear=i.getFullYear(),b.currentMonth=i.getMonth())}catch(n){n.message="Invalid date supplied: "+i;b.config.errorHandler(n)}t&&b.currentYear!==r&&(et("onYearChange"),ct());!t||b.currentYear===r&&b.currentMonth===u||et("onMonthChange");b.redraw()}function er(n){var t=f(n);~t.className.indexOf("arrow")&&ui(n,t.classList.contains("arrowUp")?1:-1)}function ui(n,t,i){var r=n&&f(n),u=i||r&&r.parentNode&&r.parentNode.firstChild,e=li("increment");e.delta=t;u&&u.dispatchEvent(e)}function fi(t,i,u,f){var s=st(i,!0),o=n("span","flatpickr-day "+t,i.getDate().toString());return o.dateObj=i,o.$i=f,o.setAttribute("aria-label",b.formatDate(i,b.config.ariaDateFormat)),-1===t.indexOf("hidden")&&0===e(i,b.now)&&(b.todayDateElem=o,o.classList.add("today"),o.setAttribute("aria-current","date")),s?(o.tabIndex=-1,ai(i)&&(o.classList.add("selected"),b.selectedDateElem=o,"range"===b.config.mode&&(r(o,"startRange",b.selectedDates[0]&&0===e(i,b.selectedDates[0],!0)),r(o,"endRange",b.selectedDates[1]&&0===e(i,b.selectedDates[1],!0)),"nextMonthDay"===t&&o.classList.add("inRange")))):o.classList.add("flatpickr-disabled"),"range"===b.config.mode&&function(n){return!("range"!==b.config.mode||b.selectedDates.length<2)&&e(n,b.selectedDates[0])>=0&&e(n,b.selectedDates[1])<=0}(i)&&!ai(i)&&o.classList.add("inRange"),b.weekNumbers&&1===b.config.showMonths&&"prevMonthDay"!==t&&u%7==1&&b.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+b.config.getWeek(i)+"<\/span>"),et("onDayCreate",o),o}function ei(n){n.focus();"range"===b.config.mode&&hi(n)}function bt(n){for(var t,f=n>0?0:b.config.showMonths-1,e=n>0?b.config.showMonths:-1,i=f;i!=e;i+=n)for(var r=b.daysContainer.children[i],o=n>0?0:r.children.length-1,s=n>0?r.children.length:-1,u=o;u!=s;u+=n)if(t=r.children[u],-1===t.className.indexOf("hidden")&&st(t.dateObj))return t}function at(n,t){var r=gt(document.activeElement||document.body),i=void 0!==n?n:r?document.activeElement:void 0!==b.selectedDateElem&>(b.selectedDateElem)?b.selectedDateElem:void 0!==b.todayDateElem&>(b.todayDateElem)?b.todayDateElem:bt(t>0?1:-1);void 0===i?b._input.focus():r?function(n,t){for(var f,o=-1===n.className.indexOf("Month")?n.dateObj.getMonth():b.currentMonth,h=t>0?b.config.showMonths:-1,r=t>0?1:-1,u=o-b.currentMonth;u!=h;u+=r)for(var e=b.daysContainer.children[u],c=o-b.currentMonth===u?n.$i+t:t<0?e.children.length-1:0,s=e.children.length,i=c;i>=0&&i<s&&i!=(t>0?s:-1);i+=r)if(f=e.children[i],-1===f.className.indexOf("hidden")&&st(f.dateObj)&&Math.abs(n.$i-i)>=Math.abs(t))return ei(f);b.changeMonth(r);at(bt(r),0)}(i,t):ei(i)}function or(t,i){for(var f,s,h=(new Date(t,i,1).getDay()-b.l10n.firstDayOfWeek+7)%7,c=b.utils.getDaysInMonth((i- -11)%12,t),o=b.utils.getDaysInMonth(i,t),e=window.document.createDocumentFragment(),l=b.config.showMonths>1,a=l?"prevMonthDay hidden":"prevMonthDay",v=l?"nextMonthDay hidden":"nextMonthDay",r=c+1-h,u=0;r<=c;r++,u++)e.appendChild(fi(a,new Date(t,i-1,r),r,u));for(r=1;r<=o;r++,u++)e.appendChild(fi("",new Date(t,i,r),r,u));for(f=o+1;f<=42-h&&(1===b.config.showMonths||u%7!=0);f++,u++)e.appendChild(fi(v,new Date(t,i+1,f%o),f,u));return s=n("div","dayContainer"),s.appendChild(e),s}function kt(){var i,n,t;if(void 0!==b.daysContainer){for(a(b.daysContainer),b.weekNumbers&&a(b.weekNumbers),i=document.createDocumentFragment(),n=0;n<b.config.showMonths;n++)t=new Date(b.currentYear,b.currentMonth,1),t.setMonth(b.currentMonth+n),i.appendChild(or(t.getFullYear(),t.getMonth()));b.daysContainer.appendChild(i);b.days=b.daysContainer.firstChild;"range"===b.config.mode&&1===b.selectedDates.length&&hi()}}function ct(){var r,t,i;if(!(b.config.showMonths>1||"dropdown"!==b.config.monthSelectorType))for(r=function(n){return!(void 0!==b.config.minDate&&b.currentYear===b.config.minDate.getFullYear()&&n<b.config.minDate.getMonth())&&!(void 0!==b.config.maxDate&&b.currentYear===b.config.maxDate.getFullYear()&&n>b.config.maxDate.getMonth())},b.monthsDropdownContainer.tabIndex=-1,b.monthsDropdownContainer.innerHTML="",t=0;t<12;t++)r(t)&&(i=n("option","flatpickr-monthDropdown-month"),i.value=new Date(b.currentYear,t).getMonth().toString(),i.textContent=y(t,b.config.shorthandCurrentMonth,b.l10n),i.tabIndex=-1,b.currentMonth===t&&(i.selected=!0),b.monthsDropdownContainer.appendChild(i))}function sr(){var i,e=n("div","flatpickr-month"),o=window.document.createDocumentFragment(),u,t,r;return b.config.showMonths>1||"static"===b.config.monthSelectorType?i=n("span","cur-month"):(b.monthsDropdownContainer=n("select","flatpickr-monthDropdown-months"),b.monthsDropdownContainer.setAttribute("aria-label",b.l10n.monthAriaLabel),ut(b.monthsDropdownContainer,"change",function(n){var t=f(n),i=parseInt(t.value,10);b.changeMonth(i-b.currentMonth);et("onMonthChange")}),ct(),i=b.monthsDropdownContainer),u=v("cur-year",{tabindex:"-1"}),t=u.getElementsByTagName("input")[0],t.setAttribute("aria-label",b.l10n.yearAriaLabel),b.config.minDate&&t.setAttribute("min",b.config.minDate.getFullYear().toString()),b.config.maxDate&&(t.setAttribute("max",b.config.maxDate.getFullYear().toString()),t.disabled=!!b.config.minDate&&b.config.minDate.getFullYear()===b.config.maxDate.getFullYear()),r=n("div","flatpickr-current-month"),r.appendChild(i),r.appendChild(u),o.appendChild(r),e.appendChild(o),{container:e,yearElement:t,monthElement:i}}function pi(){var t,n;for(a(b.monthNav),b.monthNav.appendChild(b.prevMonthNav),b.config.showMonths&&(b.yearElements=[],b.monthElements=[]),t=b.config.showMonths;t--;)n=sr(),b.yearElements.push(n.yearElement),b.monthElements.push(n.monthElement),b.monthNav.appendChild(n.container);b.monthNav.appendChild(b.nextMonthNav)}function wi(){var t,i;for(b.weekdayContainer?a(b.weekdayContainer):b.weekdayContainer=n("div","flatpickr-weekdays"),t=b.config.showMonths;t--;)i=n("div","flatpickr-weekdaycontainer"),b.weekdayContainer.appendChild(i);return bi(),b.weekdayContainer}function bi(){var t,n,i;if(b.weekdayContainer)for(t=b.l10n.firstDayOfWeek,n=nt(b.l10n.weekdays.shorthand),t>0&&t<n.length&&(n=nt(n.splice(t,n.length),n.splice(0,t))),i=b.config.showMonths;i--;)b.weekdayContainer.children[i].innerHTML="\n <span class='flatpickr-weekday'>\n "+n.join("<\/span><span class='flatpickr-weekday'>")+"\n <\/span>\n "}function oi(n,t){void 0===t&&(t=!0);var i=t?n:n-b.currentMonth;i<0&&!0===b._hidePrevMonthArrow||i>0&&!0===b._hideNextMonthArrow||(b.currentMonth+=i,(b.currentMonth<0||b.currentMonth>11)&&(b.currentYear+=b.currentMonth>11?1:-1,b.currentMonth=(b.currentMonth+12)%12,et("onYearChange"),ct()),kt(),et("onMonthChange"),ti())}function lt(n){return!(!b.config.appendTo||!b.config.appendTo.contains(n))||b.calendarContainer.contains(n)}function si(n){if(b.isOpen&&!b.config.inline){var t=f(n),r=lt(t),i=t===b.input||t===b.altInput||b.element.contains(t)||n.path&&n.path.indexOf&&(~n.path.indexOf(b.input)||~n.path.indexOf(b.altInput)),u="blur"===n.type?i&&n.relatedTarget&&!lt(n.relatedTarget):!i&&!r&&!lt(n.relatedTarget),e=!b.config.ignoredFocusElements.some(function(n){return n.contains(t)});u&&e&&(void 0!==b.timeContainer&&void 0!==b.minuteElement&&void 0!==b.hourElement&&""!==b.input.value&&void 0!==b.input.value&&ht(),b.close(),b.config&&"range"===b.config.mode&&1===b.selectedDates.length&&(b.clear(!1),b.redraw()))}}function dt(n){if(!(!n||b.config.minDate&&n<b.config.minDate.getFullYear()||b.config.maxDate&&n>b.config.maxDate.getFullYear())){var t=n,i=b.currentYear!==t;b.currentYear=t||b.currentYear;b.config.maxDate&&b.currentYear===b.config.maxDate.getFullYear()?b.currentMonth=Math.min(b.config.maxDate.getMonth(),b.currentMonth):b.config.minDate&&b.currentYear===b.config.minDate.getFullYear()&&(b.currentMonth=Math.max(b.config.minDate.getMonth(),b.currentMonth));i&&(b.redraw(),et("onYearChange"),ct())}}function st(n,t){var f,i,s;if(void 0===t&&(t=!0),i=b.parseDate(n,void 0,t),b.config.minDate&&i&&e(i,b.config.minDate,void 0!==t?t:!b.minDateHasTime)<0||b.config.maxDate&&i&&e(i,b.config.maxDate,void 0!==t?t:!b.maxDateHasTime)>0)return!1;if(!b.config.enable&&0===b.config.disable.length)return!0;if(void 0===i)return!1;for(var u=!!b.config.enable,h=null!==(f=b.config.enable)&&void 0!==f?f:b.config.disable,o=0,r=void 0;o<h.length;o++){if("function"==typeof(r=h[o])&&r(i)||r instanceof Date&&void 0!==i&&r.getTime()===i.getTime())return u;if("string"==typeof r)return s=b.parseDate(r,void 0,!0),s&&s.getTime()===i.getTime()?u:!u;if("object"==typeof r&&void 0!==i&&r.from&&r.to&&i.getTime()>=r.from.getTime()&&i.getTime()<=r.to.getTime())return u}return!u}function gt(n){return void 0!==b.daysContainer&&-1===n.className.indexOf("hidden")&&-1===n.className.indexOf("flatpickr-disabled")&&b.daysContainer.contains(n)}function hr(n){n.target===b._input&&(b.selectedDates.length>0||b._input.value.length>0)&&(!n.relatedTarget||!lt(n.relatedTarget))&&b.setDate(b._input.value,!0,n.target===b.altInput?b.config.altFormat:b.config.dateFormat)}function cr(n){var t=f(n),i=b.config.wrap?h.contains(t):t===b._input,u=b.config.allowInput,a=b.isOpen&&(!u||!i),v=b.config.inline&&i&&!u,r,o,e,s,c,l;if(13===n.keyCode&&i){if(u)return b.setDate(b._input.value,!0,t===b.altInput?b.config.altFormat:b.config.dateFormat),t.blur();b.open()}else if(lt(t)||a||v){r=!!b.timeContainer&&b.timeContainer.contains(t);switch(n.keyCode){case 13:r?(n.preventDefault(),ht(),ci()):tr(n);break;case 27:n.preventDefault();ci();break;case 8:case 46:i&&!b.config.allowInput&&(n.preventDefault(),b.clear());break;case 37:case 39:r||i?b.hourElement&&b.hourElement.focus():(n.preventDefault(),void 0!==b.daysContainer&&(!1===u||document.activeElement&>(document.activeElement)))&&(o=39===n.keyCode?1:-1,n.ctrlKey?(n.stopPropagation(),oi(o),at(bt(1),0)):at(void 0,o));break;case 38:case 40:n.preventDefault();e=40===n.keyCode?1:-1;b.daysContainer&&void 0!==t.$i||t===b.input||t===b.altInput?n.ctrlKey?(n.stopPropagation(),dt(b.currentYear-e),at(bt(1),0)):r||at(void 0,7*e):t===b.currentYearElement?dt(b.currentYear-e):b.config.enableTime&&(!r&&b.hourElement&&b.hourElement.focus(),ht(n),b._debouncedChange());break;case 9:r?(s=[b.hourElement,b.minuteElement,b.secondElement,b.amPM].concat(b.pluginElements).filter(function(n){return n}),c=s.indexOf(t),-1!==c&&(l=s[c+(n.shiftKey?-1:1)],n.preventDefault(),(l||b._input).focus())):!b.config.noCalendar&&b.daysContainer&&b.daysContainer.contains(t)&&n.shiftKey&&(n.preventDefault(),b._input.focus())}}if(void 0!==b.amPM&&t===b.amPM)switch(n.key){case b.l10n.amPM[0].charAt(0):case b.l10n.amPM[0].charAt(0).toLowerCase():b.amPM.textContent=b.l10n.amPM[0];yt();ot();break;case b.l10n.amPM[1].charAt(0):case b.l10n.amPM[1].charAt(0).toLowerCase():b.amPM.textContent=b.l10n.amPM[1];yt();ot()}(i||lt(t))&&et("onKeyDown",n)}function hi(n){var e;if(1===b.selectedDates.length&&(!n||n.classList.contains("flatpickr-day")&&!n.classList.contains("flatpickr-disabled"))){for(var u=n?n.dateObj.getTime():b.days.firstElementChild.dateObj.getTime(),i=b.parseDate(b.selectedDates[0],void 0,!0).getTime(),h=Math.min(u,b.selectedDates[0].getTime()),c=Math.max(u,b.selectedDates[0].getTime()),o=!1,f=0,r=0,t=h;t<c;t+=ft)st(new Date(t),!0)||(o=o||t>h&&t<c,t<i&&(!f||t>f)?f=t:t>i&&(!r||t<r)&&(r=t));for(e=0;e<b.config.showMonths;e++)for(var l=b.daysContainer.children[e],a=function(t){var a,h,c,e=l.children[t],s=e.dateObj.getTime(),v=f>0&&s<f||r>0&&s>r;return v?(e.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(n){e.classList.remove(n)}),"continue"):o&&!v?"continue":(["startRange","inRange","endRange","notAllowed"].forEach(function(n){e.classList.remove(n)}),void(void 0!==n&&(n.classList.add(u<=b.selectedDates[0].getTime()?"startRange":"endRange"),i<u&&s===i?e.classList.add("startRange"):i>u&&s===i&&e.classList.add("endRange"),s>=f&&(0===r||s<=r)&&(h=i,c=u,(a=s)>Math.min(h,c)&&a<Math.max(h,c))&&e.classList.add("inRange"))))},s=0,v=l.children.length;s<v;s++)a(s)}}function lr(){!b.isOpen||b.config.static||b.config.inline||ni()}function ki(n){return function(t){var i=b.config["_"+n+"Date"]=b.parseDate(t,b.config.dateFormat),r=b.config["_"+("min"===n?"max":"min")+"Date"];void 0!==i&&(b["min"===n?"minDateHasTime":"maxDateHasTime"]=i.getHours()>0||i.getMinutes()>0||i.getSeconds()>0);b.selectedDates&&(b.selectedDates=b.selectedDates.filter(function(n){return st(n)}),b.selectedDates.length||"min"!==n||pt(i),ot());b.daysContainer&&(nr(),void 0!==i?b.currentYearElement[n]=i.getFullYear().toString():b.currentYearElement.removeAttribute(n),b.currentYearElement.disabled=!!r&&void 0!==i&&r.getFullYear()===i.getFullYear())}}function di(){return b.config.wrap?h.querySelector("[data-input]"):h}function gi(){"object"!=typeof b.config.locale&&void 0===t.l10ns[b.config.locale]&&b.config.errorHandler(new Error("flatpickr: invalid locale "+b.config.locale));b.l10n=i(i({},t.l10ns.default),"object"==typeof b.config.locale?b.config.locale:"default"!==b.config.locale?t.l10ns[b.config.locale]:void 0);k.K="("+b.l10n.amPM[0]+"|"+b.l10n.amPM[1]+"|"+b.l10n.amPM[0].toLowerCase()+"|"+b.l10n.amPM[1].toLowerCase()+")";void 0===i(i({},l),JSON.parse(JSON.stringify(h.dataset||{}))).time_24hr&&void 0===t.defaultConfig.time_24hr&&(b.config.time_24hr=b.l10n.time_24hr);b.formatDate=rt(b);b.parseDate=d({config:b.config,l10n:b.l10n})}function ni(n){var f;if("function"!=typeof b.config.position){if(void 0!==b.calendarContainer){et("onPreCalendarPosition");var l=n||b._positionElement,e=Array.prototype.reduce.call(b.calendarContainer.children,function(n,t){return n+t.offsetHeight},0),i=b.calendarContainer.offsetWidth,o=b.config.position.split(" "),a=o[0],v=o.length>1?o[1]:null,t=l.getBoundingClientRect(),w=window.innerHeight-t.bottom,s="above"===a||"below"!==a&&w<e&&t.top>e,k=window.pageYOffset+t.top+(s?-e-2:l.offsetHeight+2);if(r(b.calendarContainer,"arrowTop",!s),r(b.calendarContainer,"arrowBottom",s),!b.config.inline){var u=window.pageXOffset+t.left,h=!1,c=!1;"center"===v?(u-=(i-t.width)/2,h=!0):"right"===v&&(u-=i-t.width,c=!0);r(b.calendarContainer,"arrowLeft",!h&&!c);r(b.calendarContainer,"arrowCenter",h);r(b.calendarContainer,"arrowRight",c);var y=window.document.body.offsetWidth-(window.pageXOffset+t.right),p=u+i>window.document.body.offsetWidth,d=y+i>window.document.body.offsetWidth;if(r(b.calendarContainer,"rightMost",p),!b.config.static)if(b.calendarContainer.style.top=k+"px",p)if(d){if(f=function(){for(var i,r,n=null,t=0;t<document.styleSheets.length;t++){i=document.styleSheets[t];try{i.cssRules}catch(n){continue}n=i;break}return null!=n?n:(r=document.createElement("style"),document.head.appendChild(r),r.sheet)}(),void 0===f)return;var g=window.document.body.offsetWidth,nt=Math.max(0,g/2-i/2),tt=f.cssRules.length,it="{left:"+t.left+"px;right:auto;}";r(b.calendarContainer,"rightMost",!1);r(b.calendarContainer,"centerMost",!0);f.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+it,tt);b.calendarContainer.style.left=nt+"px";b.calendarContainer.style.right="auto"}else b.calendarContainer.style.left="auto",b.calendarContainer.style.right=y+"px";else b.calendarContainer.style.left=u+"px",b.calendarContainer.style.right="auto"}}}else b.config.position(b,n)}function nr(){b.config.noCalendar||b.isMobile||(ct(),ti(),kt())}function ci(){b._input.focus();-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(b.close,0):b.close()}function tr(n){var i,u,s,h,c;if(n.preventDefault(),n.stopPropagation(),i=it(f(n),function(n){return n.classList&&n.classList.contains("flatpickr-day")&&!n.classList.contains("flatpickr-disabled")&&!n.classList.contains("notAllowed")}),void 0!==i){var r=i,t=b.latestSelectedDateObj=new Date(r.dateObj.getTime()),o=(t.getMonth()<b.currentMonth||t.getMonth()>b.currentMonth+b.config.showMonths-1)&&"range"!==b.config.mode;(b.selectedDateElem=r,"single"===b.config.mode)?b.selectedDates=[t]:"multiple"===b.config.mode?(u=ai(t),u?b.selectedDates.splice(parseInt(u),1):b.selectedDates.push(t)):"range"===b.config.mode&&(2===b.selectedDates.length&&b.clear(!1,!1),b.latestSelectedDateObj=t,b.selectedDates.push(t),0!==e(t,b.selectedDates[0],!0)&&b.selectedDates.sort(function(n,t){return n.getTime()-t.getTime()}));(yt(),o)&&(s=b.currentYear!==t.getFullYear(),b.currentYear=t.getFullYear(),b.currentMonth=t.getMonth(),s&&(et("onYearChange"),ct()),et("onMonthChange"));(ti(),kt(),ot(),o||"range"===b.config.mode||1!==b.config.showMonths?void 0!==b.selectedDateElem&&void 0===b.hourElement&&b.selectedDateElem&&b.selectedDateElem.focus():ei(r),void 0!==b.hourElement&&void 0!==b.hourElement&&b.hourElement.focus(),b.config.closeOnSelect)&&(h="single"===b.config.mode&&!b.config.enableTime,c="range"===b.config.mode&&2===b.selectedDates.length&&!b.config.enableTime,(h||c)&&ci());ri()}}function ir(n,t){var i=[];if(n instanceof Array)i=n.map(function(n){return b.parseDate(n,t)});else if(n instanceof Date||"number"==typeof n)i=[b.parseDate(n,t)];else if("string"==typeof n)switch(b.config.mode){case"single":case"time":i=[b.parseDate(n,t)];break;case"multiple":i=n.split(b.config.conjunction).map(function(n){return b.parseDate(n,t)});break;case"range":i=n.split(b.l10n.rangeSeparator).map(function(n){return b.parseDate(n,t)})}else b.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(n)));b.selectedDates=b.config.allowInvalidPreload?i:i.filter(function(n){return n instanceof Date&&st(n,!1)});"range"===b.config.mode&&b.selectedDates.sort(function(n,t){return n.getTime()-t.getTime()})}function rr(n){return n.slice().map(function(n){return"string"==typeof n||"number"==typeof n||n instanceof Date?b.parseDate(n,void 0,!0):n&&"object"==typeof n&&n.from&&n.to?{from:b.parseDate(n.from,void 0),to:b.parseDate(n.to,void 0)}:n}).filter(function(n){return n})}function et(n,t){var i,r;if(void 0!==b.config){if(i=b.config[n],void 0!==i&&i.length>0)for(r=0;i[r]&&r<i.length;r++)i[r](b.selectedDates,b.input.value,b,t);"onChange"===n&&(b.input.dispatchEvent(li("change")),b.input.dispatchEvent(li("input")))}}function li(n){var t=document.createEvent("Event");return t.initEvent(n,!0,!0),t}function ai(n){for(var t=0;t<b.selectedDates.length;t++)if(0===e(b.selectedDates[t],n))return""+t;return!1}function ti(){b.config.noCalendar||b.isMobile||!b.monthNav||(b.yearElements.forEach(function(n,t){var i=new Date(b.currentYear,b.currentMonth,1);i.setMonth(b.currentMonth+t);b.config.showMonths>1||"static"===b.config.monthSelectorType?b.monthElements[t].textContent=y(i.getMonth(),b.config.shorthandCurrentMonth,b.l10n)+" ":b.monthsDropdownContainer.value=i.getMonth().toString();n.value=i.getFullYear().toString()}),b._hidePrevMonthArrow=void 0!==b.config.minDate&&(b.currentYear===b.config.minDate.getFullYear()?b.currentMonth<=b.config.minDate.getMonth():b.currentYear<b.config.minDate.getFullYear()),b._hideNextMonthArrow=void 0!==b.config.maxDate&&(b.currentYear===b.config.maxDate.getFullYear()?b.currentMonth+1>b.config.maxDate.getMonth():b.currentYear>b.config.maxDate.getFullYear()))}function ur(n){return b.selectedDates.map(function(t){return b.formatDate(t,n)}).filter(function(n,t,i){return"range"!==b.config.mode||b.config.enableTime||i.indexOf(n)===t}).join("range"!==b.config.mode?b.config.conjunction:b.l10n.rangeSeparator)}function ot(n){void 0===n&&(n=!0);void 0!==b.mobileInput&&b.mobileFormatStr&&(b.mobileInput.value=void 0!==b.latestSelectedDateObj?b.formatDate(b.latestSelectedDateObj,b.mobileFormatStr):"");b.input.value=ur(b.config.dateFormat);void 0!==b.altInput&&(b.altInput.value=ur(b.config.altFormat));!1!==n&&et("onValueUpdate")}function ar(n){var t=f(n),i=b.prevMonthNav.contains(t),r=b.nextMonthNav.contains(t);i||r?oi(i?-1:1):b.yearElements.indexOf(t)>=0?t.select():t.classList.contains("arrowUp")?b.changeYear(b.currentYear+1):t.classList.contains("arrowDown")&&b.changeYear(b.currentYear-1)}var b={config:i(i({},s),t.defaultConfig),l10n:c},vt;return b.parseDate=d({config:b.config,l10n:b.l10n}),b._handlers=[],b.pluginElements=[],b.loadedPlugins=[],b._bind=ut,b._setHoursFromDate=pt,b._positionCalendar=ni,b.changeMonth=oi,b.changeYear=dt,b.clear=function(n,t){if(void 0===n&&(n=!0),void 0===t&&(t=!0),b.input.value="",void 0!==b.altInput&&(b.altInput.value=""),void 0!==b.mobileInput&&(b.mobileInput.value=""),b.selectedDates=[],b.latestSelectedDateObj=void 0,!0===t&&(b.currentYear=b._initialDate.getFullYear(),b.currentMonth=b._initialDate.getMonth()),!0===b.config.enableTime){var i=g(b.config),r=i.hours,u=i.minutes,f=i.seconds;ii(r,u,f)}b.redraw();n&&et("onChange")},b.close=function(){b.isOpen=!1;b.isMobile||(void 0!==b.calendarContainer&&b.calendarContainer.classList.remove("open"),void 0!==b._input&&b._input.classList.remove("active"));et("onClose")},b._createElement=n,b.destroy=function(){var t,n;for(void 0!==b.config&&et("onDestroy"),t=b._handlers.length;t--;)b._handlers[t].remove();if(b._handlers=[],b.mobileInput)b.mobileInput.parentNode&&b.mobileInput.parentNode.removeChild(b.mobileInput),b.mobileInput=void 0;else if(b.calendarContainer&&b.calendarContainer.parentNode)if(b.config.static&&b.calendarContainer.parentNode){if(n=b.calendarContainer.parentNode,n.lastChild&&n.removeChild(n.lastChild),n.parentNode){for(;n.firstChild;)n.parentNode.insertBefore(n.firstChild,n);n.parentNode.removeChild(n)}}else b.calendarContainer.parentNode.removeChild(b.calendarContainer);b.altInput&&(b.input.type="text",b.altInput.parentNode&&b.altInput.parentNode.removeChild(b.altInput),delete b.altInput);b.input&&(b.input.type=b.input._type,b.input.classList.remove("flatpickr-input"),b.input.removeAttribute("readonly"));["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(n){try{delete b[n]}catch(n){}})},b.isEnabled=st,b.jumpToDate=wt,b.open=function(n,t){var i,r;if(void 0===t&&(t=b._positionElement),!0===b.isMobile)return n&&(n.preventDefault(),i=f(n),i&&i.blur()),void 0!==b.mobileInput&&(b.mobileInput.focus(),b.mobileInput.click()),void et("onOpen");b._input.disabled||b.config.inline||(r=b.isOpen,b.isOpen=!0,r||(b.calendarContainer.classList.add("open"),b._input.classList.add("active"),et("onOpen"),ni(t)),!0===b.config.enableTime&&!0===b.config.noCalendar&&(!1!==b.config.allowInput||void 0!==n&&b.timeContainer.contains(n.relatedTarget)||setTimeout(function(){return b.hourElement.select()},50)))},b.redraw=nr,b.set=function(n,t){if(null!==n&&"object"==typeof n)for(var i in Object.assign(b.config,n),n)void 0!==vt[i]&&vt[i].forEach(function(n){return n()});else b.config[n]=t,void 0!==vt[n]?vt[n].forEach(function(n){return n()}):p.indexOf(n)>-1&&(b.config[n]=w(t));b.redraw();ot(!0)},b.setDate=function(n,t,i){if(void 0===t&&(t=!1),void 0===i&&(i=b.config.dateFormat),0!==n&&!n||n instanceof Array&&0===n.length)return b.clear(t);ir(n,i);b.latestSelectedDateObj=b.selectedDates[b.selectedDates.length-1];b.redraw();wt(void 0,t);pt();0===b.selectedDates.length&&b.clear(!1);ot(t);t&&et("onChange")},b.toggle=function(n){if(!0===b.isOpen)return b.close();b.open(n)},vt={locale:[gi,bi],showMonths:[pi,yi,wi],minDate:[wt],maxDate:[wt],clickOpens:[function(){!0===b.config.clickOpens?(ut(b._input,"focus",b.open),ut(b._input,"click",b.open)):(b._input.removeEventListener("focus",b.open),b._input.removeEventListener("click",b.open))}]},function(){b.element=b.input=h;b.isOpen=!1,function(){var e=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],n=i(i({},JSON.parse(JSON.stringify(h.dataset||{}))),l),c={},f,v,y,a,r,o,u;for(b.config.parseDate=n.parseDate,b.config.formatDate=n.formatDate,Object.defineProperty(b.config,"enable",{get:function(){return b.config._enable},set:function(n){b.config._enable=rr(n)}}),Object.defineProperty(b.config,"disable",{get:function(){return b.config._disable},set:function(n){b.config._disable=rr(n)}}),f="time"===n.mode,!n.dateFormat&&(n.enableTime||f)&&(v=t.defaultConfig.dateFormat||s.dateFormat,c.dateFormat=n.noCalendar||f?"H:i"+(n.enableSeconds?":S":""):v+" H:i"+(n.enableSeconds?":S":"")),n.altInput&&(n.enableTime||f)&&!n.altFormat&&(y=t.defaultConfig.altFormat||s.altFormat,c.altFormat=n.noCalendar||f?"h:i"+(n.enableSeconds?":S K":" K"):y+" h:i"+(n.enableSeconds?":S":"")+" K"),Object.defineProperty(b.config,"minDate",{get:function(){return b.config._minDate},set:ki("min")}),Object.defineProperty(b.config,"maxDate",{get:function(){return b.config._maxDate},set:ki("max")}),a=function(n){return function(t){b.config["min"===n?"_minTime":"_maxTime"]=b.parseDate(t,"H:i:S")}},Object.defineProperty(b.config,"minTime",{get:function(){return b.config._minTime},set:a("min")}),Object.defineProperty(b.config,"maxTime",{get:function(){return b.config._maxTime},set:a("max")}),"time"===n.mode&&(b.config.noCalendar=!0,b.config.enableTime=!0),Object.assign(b.config,c,n),r=0;r<e.length;r++)b.config[e[r]]=!0===b.config[e[r]]||"true"===b.config[e[r]];for(p.filter(function(n){return void 0!==b.config[n]}).forEach(function(n){b.config[n]=w(b.config[n]||[]).map(vi)}),b.isMobile=!b.config.disableMobile&&!b.config.inline&&"single"===b.config.mode&&!b.config.disable.length&&!b.config.enable&&!b.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),r=0;r<b.config.plugins.length;r++){o=b.config.plugins[r](b)||{};for(u in o)p.indexOf(u)>-1?b.config[u]=w(o[u]).map(vi).concat(b.config[u]):void 0===n[u]&&(b.config[u]=o[u])}n.altInputClass||(b.config.altInputClass=di().className+" "+b.config.altInputClass);et("onParseConfig")}();gi(),function(){if(b.input=di(),!b.input)return void b.config.errorHandler(new Error("Invalid input element specified"));b.input._type=b.input.type;b.input.type="text";b.input.classList.add("flatpickr-input");b._input=b.input;b.config.altInput&&(b.altInput=n(b.input.nodeName,b.config.altInputClass),b._input=b.altInput,b.altInput.placeholder=b.input.placeholder,b.altInput.disabled=b.input.disabled,b.altInput.required=b.input.required,b.altInput.tabIndex=b.input.tabIndex,b.altInput.type="text",b.input.setAttribute("type","hidden"),!b.config.static&&b.input.parentNode&&b.input.parentNode.insertBefore(b.altInput,b.input.nextSibling));b.config.allowInput||b._input.setAttribute("readonly","readonly");b._positionElement=b.config.positionElement||b._input}(),function(){b.selectedDates=[];b.now=b.parseDate(b.config.now)||new Date;var n=b.config.defaultDate||("INPUT"!==b.input.nodeName&&"TEXTAREA"!==b.input.nodeName||!b.input.placeholder||b.input.value!==b.input.placeholder?b.input.value:null);n&&ir(n,b.config.dateFormat);b._initialDate=b.selectedDates.length>0?b.selectedDates[0]:b.config.minDate&&b.config.minDate.getTime()>b.now.getTime()?b.config.minDate:b.config.maxDate&&b.config.maxDate.getTime()<b.now.getTime()?b.config.maxDate:b.now;b.currentYear=b._initialDate.getFullYear();b.currentMonth=b._initialDate.getMonth();b.selectedDates.length>0&&(b.latestSelectedDateObj=b.selectedDates[0]);void 0!==b.config.minTime&&(b.config.minTime=b.parseDate(b.config.minTime,"H:i"));void 0!==b.config.maxTime&&(b.config.maxTime=b.parseDate(b.config.maxTime,"H:i"));b.minDateHasTime=!!b.config.minDate&&(b.config.minDate.getHours()>0||b.config.minDate.getMinutes()>0||b.config.minDate.getSeconds()>0);b.maxDateHasTime=!!b.config.maxDate&&(b.config.maxDate.getHours()>0||b.config.maxDate.getMinutes()>0||b.config.maxDate.getSeconds()>0)}();b.utils={getDaysInMonth:function(n,t){return void 0===n&&(n=b.currentMonth),void 0===t&&(t=b.currentYear),1===n&&(t%4==0&&t%100!=0||t%400==0)?29:b.l10n.daysInMonth[n]}};b.isMobile||function(){var i=window.document.createDocumentFragment(),s,t;if(b.calendarContainer=n("div","flatpickr-calendar"),b.calendarContainer.tabIndex=-1,!b.config.noCalendar){if(i.appendChild((b.monthNav=n("div","flatpickr-months"),b.yearElements=[],b.monthElements=[],b.prevMonthNav=n("span","flatpickr-prev-month"),b.prevMonthNav.innerHTML=b.config.prevArrow,b.nextMonthNav=n("span","flatpickr-next-month"),b.nextMonthNav.innerHTML=b.config.nextArrow,pi(),Object.defineProperty(b,"_hidePrevMonthArrow",{get:function(){return b.__hidePrevMonthArrow},set:function(n){b.__hidePrevMonthArrow!==n&&(r(b.prevMonthNav,"flatpickr-disabled",n),b.__hidePrevMonthArrow=n)}}),Object.defineProperty(b,"_hideNextMonthArrow",{get:function(){return b.__hideNextMonthArrow},set:function(n){b.__hideNextMonthArrow!==n&&(r(b.nextMonthNav,"flatpickr-disabled",n),b.__hideNextMonthArrow=n)}}),b.currentYearElement=b.yearElements[0],ti(),b.monthNav)),b.innerContainer=n("div","flatpickr-innerContainer"),b.config.weekNumbers){var f=function(){var t,i;return b.calendarContainer.classList.add("hasWeeks"),t=n("div","flatpickr-weekwrapper"),t.appendChild(n("span","flatpickr-weekday",b.l10n.weekAbbreviation)),i=n("div","flatpickr-weeks"),t.appendChild(i),{weekWrapper:t,weekNumbers:i}}(),e=f.weekWrapper,h=f.weekNumbers;b.innerContainer.appendChild(e);b.weekNumbers=h;b.weekWrapper=e}b.rContainer=n("div","flatpickr-rContainer");b.rContainer.appendChild(wi());b.daysContainer||(b.daysContainer=n("div","flatpickr-days"),b.daysContainer.tabIndex=-1);kt();b.rContainer.appendChild(b.daysContainer);b.innerContainer.appendChild(b.rContainer);i.appendChild(b.innerContainer)}b.config.enableTime&&i.appendChild(function(){var t,e,i,r,f;return b.calendarContainer.classList.add("hasTime"),b.config.noCalendar&&b.calendarContainer.classList.add("noCalendar"),t=g(b.config),b.timeContainer=n("div","flatpickr-time"),b.timeContainer.tabIndex=-1,e=n("span","flatpickr-time-separator",":"),i=v("flatpickr-hour",{"aria-label":b.l10n.hourAriaLabel}),b.hourElement=i.getElementsByTagName("input")[0],r=v("flatpickr-minute",{"aria-label":b.l10n.minuteAriaLabel}),b.minuteElement=r.getElementsByTagName("input")[0],b.hourElement.tabIndex=b.minuteElement.tabIndex=-1,b.hourElement.value=u(b.latestSelectedDateObj?b.latestSelectedDateObj.getHours():b.config.time_24hr?t.hours:function(n){switch(n%24){case 0:case 12:return 12;default:return n%12}}(t.hours)),b.minuteElement.value=u(b.latestSelectedDateObj?b.latestSelectedDateObj.getMinutes():t.minutes),b.hourElement.setAttribute("step",b.config.hourIncrement.toString()),b.minuteElement.setAttribute("step",b.config.minuteIncrement.toString()),b.hourElement.setAttribute("min",b.config.time_24hr?"0":"1"),b.hourElement.setAttribute("max",b.config.time_24hr?"23":"12"),b.hourElement.setAttribute("maxlength","2"),b.minuteElement.setAttribute("min","0"),b.minuteElement.setAttribute("max","59"),b.minuteElement.setAttribute("maxlength","2"),b.timeContainer.appendChild(i),b.timeContainer.appendChild(e),b.timeContainer.appendChild(r),b.config.time_24hr&&b.timeContainer.classList.add("time24hr"),b.config.enableSeconds&&(b.timeContainer.classList.add("hasSeconds"),f=v("flatpickr-second"),b.secondElement=f.getElementsByTagName("input")[0],b.secondElement.value=u(b.latestSelectedDateObj?b.latestSelectedDateObj.getSeconds():t.seconds),b.secondElement.setAttribute("step",b.minuteElement.getAttribute("step")),b.secondElement.setAttribute("min","0"),b.secondElement.setAttribute("max","59"),b.secondElement.setAttribute("maxlength","2"),b.timeContainer.appendChild(n("span","flatpickr-time-separator",":")),b.timeContainer.appendChild(f)),b.config.time_24hr||(b.amPM=n("span","flatpickr-am-pm",b.l10n.amPM[o((b.latestSelectedDateObj?b.hourElement.value:b.config.defaultHour)>11)]),b.amPM.title=b.l10n.toggleTitle,b.amPM.tabIndex=-1,b.timeContainer.appendChild(b.amPM)),b.timeContainer}());r(b.calendarContainer,"rangeMode","range"===b.config.mode);r(b.calendarContainer,"animate",!0===b.config.animate);r(b.calendarContainer,"multiMonth",b.config.showMonths>1);b.calendarContainer.appendChild(i);s=void 0!==b.config.appendTo&&void 0!==b.config.appendTo.nodeType;(b.config.inline||b.config.static)&&(b.calendarContainer.classList.add(b.config.inline?"inline":"static"),b.config.inline&&(!s&&b.element.parentNode?b.element.parentNode.insertBefore(b.calendarContainer,b._input.nextSibling):void 0!==b.config.appendTo&&b.config.appendTo.appendChild(b.calendarContainer)),b.config.static)&&(t=n("div","flatpickr-wrapper"),b.element.parentNode&&b.element.parentNode.insertBefore(t,b.element),t.appendChild(b.element),b.altInput&&t.appendChild(b.altInput),t.appendChild(b.calendarContainer));b.config.static||b.config.inline||(void 0!==b.config.appendTo?b.config.appendTo:window.document.body).appendChild(b.calendarContainer)}(),function(){var t,i;if(b.config.wrap&&["open","close","toggle","clear"].forEach(function(n){Array.prototype.forEach.call(b.element.querySelectorAll("[data-"+n+"]"),function(t){return ut(t,"click",b[n])})}),b.isMobile)return void function(){var t=b.config.enableTime?b.config.noCalendar?"time":"datetime-local":"date";b.mobileInput=n("input",b.input.className+" flatpickr-mobile");b.mobileInput.tabIndex=1;b.mobileInput.type=t;b.mobileInput.disabled=b.input.disabled;b.mobileInput.required=b.input.required;b.mobileInput.placeholder=b.input.placeholder;b.mobileFormatStr="datetime-local"===t?"Y-m-d\\TH:i:S":"date"===t?"Y-m-d":"H:i:S";b.selectedDates.length>0&&(b.mobileInput.defaultValue=b.mobileInput.value=b.formatDate(b.selectedDates[0],b.mobileFormatStr));b.config.minDate&&(b.mobileInput.min=b.formatDate(b.config.minDate,"Y-m-d"));b.config.maxDate&&(b.mobileInput.max=b.formatDate(b.config.maxDate,"Y-m-d"));b.input.getAttribute("step")&&(b.mobileInput.step=String(b.input.getAttribute("step")));b.input.type="hidden";void 0!==b.altInput&&(b.altInput.type="hidden");try{b.input.parentNode&&b.input.parentNode.insertBefore(b.mobileInput,b.input.nextSibling)}catch(t){}ut(b.mobileInput,"change",function(n){b.setDate(f(n).value,!1,b.mobileFormatStr);et("onChange");et("onClose")})}();t=tt(lr,50);b._debouncedChange=tt(ri,300);b.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&ut(b.daysContainer,"mouseover",function(n){"range"===b.config.mode&&hi(f(n))});ut(window.document.body,"keydown",cr);b.config.inline||b.config.static||ut(window,"resize",t);void 0!==window.ontouchstart?ut(window.document,"touchstart",si):ut(window.document,"mousedown",si);ut(window.document,"focus",si,{capture:!0});!0===b.config.clickOpens&&(ut(b._input,"focus",b.open),ut(b._input,"click",b.open));void 0!==b.daysContainer&&(ut(b.monthNav,"click",ar),ut(b.monthNav,["keyup","increment"],fr),ut(b.daysContainer,"click",tr));void 0!==b.timeContainer&&void 0!==b.minuteElement&&void 0!==b.hourElement&&(i=function(n){return f(n).select()},ut(b.timeContainer,["increment"],ht),ut(b.timeContainer,"blur",ht,{capture:!0}),ut(b.timeContainer,"click",er),ut([b.hourElement,b.minuteElement],["focus","click"],i),void 0!==b.secondElement&&ut(b.secondElement,"focus",function(){return b.secondElement&&b.secondElement.select()}),void 0!==b.amPM&&ut(b.amPM,"click",function(n){ht(n);ri()}));b.config.allowInput&&ut(b._input,"blur",hr)}();(b.selectedDates.length||b.config.noCalendar)&&(b.config.enableTime&&pt(b.config.noCalendar?b.latestSelectedDateObj:void 0),ot(!1));yi();var e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!b.isMobile&&e&&ni();et("onReady")}(),b}function h(n,t){for(var i,f=Array.prototype.slice.call(n).filter(function(n){return n instanceof HTMLElement}),r=[],u=0;u<f.length;u++){i=f[u];try{if(null!==i.getAttribute("data-fp-omit"))continue;void 0!==i._flatpickr&&(i._flatpickr.destroy(),i._flatpickr=void 0);i._flatpickr=et(i,t||{});r.push(i._flatpickr)}catch(n){console.error(n)}}return 1===r.length?r[0]:r}var i=function(){return(i=Object.assign||function(n){for(var r,i,t=1,u=arguments.length;t<u;t++)for(i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n}).apply(this,arguments)},p=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],s={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return"undefined"!=typeof console&&console.warn(n)},getWeek:function(n){var t=new Date(n.getTime()),i;return t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7),i=new Date(t.getFullYear(),0,4),1+Math.round(((t.getTime()-i.getTime())/864e5-3+(i.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g><\/g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /><\/svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g><\/g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /><\/svg>",shorthandCurrentMonth:!1,showMonths:1,"static":!1,time_24hr:!1,weekNumbers:!1,wrap:!1},c={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var t=n%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},u=function(n,t){return void 0===t&&(t=2),("000"+n).slice(-1*t)},o=function(n){return!0===n?1:0},w=function(n){return n instanceof Array?n:[n]},b=function(){},y=function(n,t,i){return i.months[t?"shorthand":"longhand"][n]},ut={D:b,F:function(n,t,i){n.setMonth(i.months.longhand.indexOf(t))},G:function(n,t){n.setHours(parseFloat(t))},H:function(n,t){n.setHours(parseFloat(t))},J:function(n,t){n.setDate(parseFloat(t))},K:function(n,t,i){n.setHours(n.getHours()%12+12*o(new RegExp(i.amPM[1],"i").test(t)))},M:function(n,t,i){n.setMonth(i.months.shorthand.indexOf(t))},S:function(n,t){n.setSeconds(parseFloat(t))},U:function(n,t){return new Date(1e3*parseFloat(t))},W:function(n,t,i){var u=parseInt(t),r=new Date(n.getFullYear(),0,2+7*(u-1),0,0,0,0);return r.setDate(r.getDate()-r.getDay()+i.firstDayOfWeek),r},Y:function(n,t){n.setFullYear(parseFloat(t))},Z:function(n,t){return new Date(t)},d:function(n,t){n.setDate(parseFloat(t))},h:function(n,t){n.setHours(parseFloat(t))},i:function(n,t){n.setMinutes(parseFloat(t))},j:function(n,t){n.setDate(parseFloat(t))},l:b,m:function(n,t){n.setMonth(parseFloat(t)-1)},n:function(n,t){n.setMonth(parseFloat(t)-1)},s:function(n,t){n.setSeconds(parseFloat(t))},u:function(n,t){return new Date(parseFloat(t))},w:b,y:function(n,t){n.setFullYear(2e3+parseFloat(t))}},k={D:"(\\w+)",F:"(\\w+)",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"(\\w+)",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"(\\w+)",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},l={Z:function(n){return n.toISOString()},D:function(n,t,i){return t.weekdays.shorthand[l.w(n,t,i)]},F:function(n,t,i){return y(l.n(n,t,i)-1,!1,t)},G:function(n,t,i){return u(l.h(n,t,i))},H:function(n){return u(n.getHours())},J:function(n,t){return void 0!==t.ordinal?n.getDate()+t.ordinal(n.getDate()):n.getDate()},K:function(n,t){return t.amPM[o(n.getHours()>11)]},M:function(n,t){return y(n.getMonth(),!0,t)},S:function(n){return u(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,t,i){return i.getWeek(n)},Y:function(n){return u(n.getFullYear(),4)},d:function(n){return u(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return u(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,t){return t.weekdays.longhand[n.getDay()]},m:function(n){return u(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},rt=function(n){var i=n.config,t=void 0===i?s:i,r=n.l10n,f=void 0===r?c:r,u=n.isMobile,e=void 0!==u&&u;return function(n,i,r){var u=r||f;return void 0===t.formatDate||e?i.split("").map(function(i,r,f){return l[i]&&"\\"!==f[r-1]?l[i](n,u,t):"\\"!==i?i:""}).join(""):t.formatDate(n,i,u)}},d=function(n){var i=n.config,t=void 0===i?s:i,r=n.l10n,u=void 0===r?c:r;return function(n,i,r,f){var e,y,p,o,c,v;if(0===n||n){if(y=f||u,p=n,n instanceof Date)e=new Date(n.getTime());else if("string"!=typeof n&&void 0!==n.toFixed)e=new Date(n);else if("string"==typeof n)if(o=i||(t||s).dateFormat,c=String(n).trim(),"today"===c)e=new Date,r=!0;else if(/Z$/.test(c)||/GMT$/.test(c))e=new Date(n);else if(t&&t.parseDate)e=t.parseDate(n,o);else{e=t&&t.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0);for(var w=void 0,b=[],l=0,g=0,a="";l<o.length;l++){var h=o[l],d="\\"===h,nt="\\"===o[l-1]||d;k[h]&&!nt?(a+=k[h],v=new RegExp(a).exec(n),v&&(w=!0)&&b["Y"!==h?"push":"unshift"]({fn:ut[h],val:v[++g]})):d||(a+=".");b.forEach(function(n){var t=n.fn,i=n.val;return e=t(e,i,y)||e})}e=w?e:void 0}if(e instanceof Date&&!isNaN(e.getTime()))return!0===r&&e.setHours(0,0,0,0),e;t.errorHandler(new Error("Invalid date provided: "+p))}}},ft=864e5,t;return"function"!=typeof Object.assign&&(Object.assign=function(n){for(var f,i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];if(!n)throw TypeError("Cannot convert undefined or null to object");for(var e=function(t){t&&Object.keys(t).forEach(function(i){return n[i]=t[i]})},r=0,u=i;r<u.length;r++)f=u[r],e(f);return n}),"undefined"!=typeof HTMLElement&&"undefined"!=typeof HTMLCollection&&"undefined"!=typeof NodeList&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(n){return h(this,n)},HTMLElement.prototype.flatpickr=function(n){return h([this],n)}),t=function(n,t){return"string"==typeof n?h(window.document.querySelectorAll(n),t):n instanceof Node?h([n],t):h(n,t)},t.defaultConfig={},t.l10ns={en:i({},c),"default":i({},c)},t.localize=function(n){t.l10ns.default=i(i({},t.l10ns.default),n)},t.setDefaults=function(n){t.defaultConfig=i(i({},t.defaultConfig),n)},t.parseDate=d({}),t.formatDate=rt({}),t.compareDates=e,"undefined"!=typeof jQuery&&void 0!==jQuery.fn&&(jQuery.fn.flatpickr=function(n){return h(this,n)}),Date.prototype.fp_incr=function(n){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof n?parseInt(n,10):n))},"undefined"!=typeof window&&(window.flatpickr=t),t});!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n="undefined"!=typeof globalThis?globalThis:n||self).monthSelectPlugin=t()}(this,function(){"use strict";var n=function(){return(n=Object.assign||function(n){for(var r,i,t=1,u=arguments.length;t<u;t++)for(i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i]);return n}).apply(this,arguments)},t=function(n,t,i){return i.months[t?"shorthand":"longhand"][n]},i={shorthand:!1,dateFormat:"F Y",altFormat:"F Y",theme:"light"};return function(r){var u=n(n({},i),r);return function(n){function r(){var i,t,u,r;if(n.rContainer){for(i=n.rContainer.querySelectorAll(".flatpickr-monthSelect-month.selected"),t=0;t<i.length;t++)i[t].classList.remove("selected");u=(n.selectedDates[0]||new Date).getMonth();r=n.rContainer.querySelector(".flatpickr-monthSelect-month:nth-child("+(u+1)+")");r&&r.classList.add("selected")}}function e(){var t=n.selectedDates[0];t&&((t=new Date(t)).setFullYear(n.currentYear),n.config.minDate&&t<n.config.minDate&&(t=n.config.minDate),n.config.maxDate&&t>n.config.maxDate&&(t=n.config.maxDate),n.currentYear=t.getFullYear());n.currentYearElement.value=String(n.currentYear);n.rContainer&&n.rContainer.querySelectorAll(".flatpickr-monthSelect-month").forEach(function(t){t.dateObj.setFullYear(n.currentYear);n.config.minDate&&t.dateObj<n.config.minDate||n.config.maxDate&&t.dateObj>n.config.maxDate?t.classList.add("disabled"):t.classList.remove("disabled")});r()}function o(t){t.preventDefault();t.stopPropagation();var i=function(n){try{return"function"==typeof n.composedPath?n.composedPath()[0]:n.target}catch(t){return n.target}}(t);i instanceof Element&&!i.classList.contains("disabled")&&(s(i.dateObj),n.close())}function s(t){var i=new Date(t);i.setFullYear(n.currentYear);n.setDate(i,!0);r()}var i,f;return n.config.dateFormat=u.dateFormat,n.config.altFormat=u.altFormat,i={monthsContainer:null},f={37:-1,39:1,40:3,38:-3},{onParseConfig:function(){n.config.mode="single";n.config.enableTime=!1},onValueUpdate:r,onKeyDown:function(t,r,u,e){var c=void 0!==f[e.keyCode],l,o,h;(c||13===e.keyCode)&&n.rContainer&&i.monthsContainer&&(l=n.rContainer.querySelector(".flatpickr-monthSelect-month.selected"),o=Array.prototype.indexOf.call(i.monthsContainer.children,document.activeElement),-1===o&&(h=l||i.monthsContainer.firstElementChild,h.focus(),o=h.$i),c?i.monthsContainer.children[(12+o+f[e.keyCode])%12].focus():13===e.keyCode&&i.monthsContainer.contains(document.activeElement)&&s(document.activeElement.dateObj))},onReady:[function(){n.currentMonth=0},function(){var t,i;if(n.rContainer&&n.daysContainer&&n.weekdayContainer)for(n.rContainer.removeChild(n.daysContainer),n.rContainer.removeChild(n.weekdayContainer),t=0;t<n.monthElements.length;t++)i=n.monthElements[t],i.parentNode&&i.parentNode.removeChild(i)},function(){n._bind(n.prevMonthNav,"click",function(t){t.preventDefault();t.stopPropagation();n.changeYear(n.currentYear-1);e()});n._bind(n.nextMonthNav,"click",function(t){t.preventDefault();t.stopPropagation();n.changeYear(n.currentYear+1);e()})},function(){var f,r;if(n.rContainer){for(i.monthsContainer=n._createElement("div","flatpickr-monthSelect-months"),i.monthsContainer.tabIndex=-1,n.calendarContainer.classList.add("flatpickr-monthSelect-theme-"+u.theme),f=0;f<12;f++)r=n._createElement("span","flatpickr-monthSelect-month"),r.dateObj=new Date(n.currentYear,f),r.$i=f,r.textContent=t(f,u.shorthand,n.l10n),r.tabIndex=-1,r.addEventListener("click",o),i.monthsContainer.appendChild(r),(n.config.minDate&&r.dateObj<n.config.minDate||n.config.maxDate&&r.dateObj>n.config.maxDate)&&r.classList.add("disabled");n.rContainer.appendChild(i.monthsContainer)}},r,function(){n.loadedPlugins.push("monthSelect")}],onDestroy:function(){if(null!==i.monthsContainer)for(var t=i.monthsContainer.querySelectorAll(".flatpickr-monthSelect-month"),n=0;n<t.length;n++)t[n].removeEventListener("click",o)}}}}});window.blazorise||(window.blazorise={});window.blazorise={lastClickedDocumentElement:null,utils:{getRequiredElement:(n,t)=>n?n:document.getElementById(t)},addClass:(n,t)=>{n.classList.add(t)},removeClass:(n,t)=>{n.classList.contains(t)&&n.classList.remove(t)},toggleClass:(n,t)=>{n&&(n.classList.contains(t)?n.classList.remove(t):n.classList.add(t))},addClassToBody:n=>{blazorise.addClass(document.body,n)},removeClassFromBody:n=>{blazorise.removeClass(document.body,n)},parentHasClass:(n,t)=>n&&n.parentElement?n.parentElement.classList.contains(t):!1,setProperty:(n,t,i)=>{n&&t&&(n[t]=i)},getElementInfo:(n,t)=>{if(n||(n=document.getElementById(t)),n){const t=n.getBoundingClientRect();return{boundingClientRect:{x:t.x,y:t.y,top:t.top,bottom:t.bottom,left:t.left,right:t.right,width:t.width,height:t.height},offsetTop:n.offsetTop,offsetLeft:n.offsetLeft,offsetWidth:n.offsetWidth,offsetHeight:n.offsetHeight,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft,scrollWidth:n.scrollWidth,scrollHeight:n.scrollHeight,clientTop:n.clientTop,clientLeft:n.clientLeft,clientWidth:n.clientWidth,clientHeight:n.clientHeight}}return{}},setTextValue(n,t){n.value=t},hasSelectionCapabilities:n=>{const t=n&&n.nodeName&&n.nodeName.toLowerCase();return t&&(t==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||t==="textarea"||n.contentEditable==="true")},setCaret:(n,t)=>{window.blazorise.hasSelectionCapabilities(n)&&window.requestAnimationFrame(()=>{n.selectionStart=t,n.selectionEnd=t})},getCaret:n=>window.blazorise.hasSelectionCapabilities(n)?n.selectionStart:-1,getSelectedOptions:n=>{var i,r,t;const u=document.getElementById(n),f=u.options.length;for(i=[],t=0;t<f;t++)r=u.options[t],r.selected&&i.push(r.value);return i},setSelectedOptions:(n,t)=>{const i=document.getElementById(n);if(i&&i.options){const n=i.options.length;for(var r=0;r<n;r++){const n=i.options[r];n.selected=t&&t.find(t=>t!==null&&t.toString()===n.value)?!0:!1}}},closableComponents:[],addClosableComponent:(n,t)=>{window.blazorise.closableComponents.push({elementId:n,dotnetAdapter:t})},findClosableComponent:n=>{for(index=0;index<window.blazorise.closableComponents.length;++index)if(window.blazorise.closableComponents[index].elementId===n)return window.blazorise.closableComponents[index];return null},findClosableComponentIndex:n=>{for(index=0;index<window.blazorise.closableComponents.length;++index)if(window.blazorise.closableComponents[index].elementId===n)return index;return-1},isClosableComponent:n=>{for(index=0;index<window.blazorise.closableComponents.length;++index)if(window.blazorise.closableComponents[index].elementId===n)return!0;return!1},registerClosableComponent:(n,t)=>{n&&window.blazorise.isClosableComponent(n.id)!==!0&&window.blazorise.addClosableComponent(n.id,t)},unregisterClosableComponent:n=>{if(n){const t=window.blazorise.findClosableComponentIndex(n.id);t!==-1&&window.blazorise.closableComponents.splice(t,1)}},tryClose:(n,t,i,r)=>{let u=new Promise(u=>{n.dotnetAdapter.invokeMethodAsync("SafeToClose",t,i?"escape":"leave",r).then(t=>u({elementId:n.elementId,dotnetAdapter:n.dotnetAdapter,status:t===!0?"ok":"cancelled"})).catch(()=>u({elementId:n.elementId,status:"error"}))});u&&u.then(n=>{n.status==="ok"&&n.dotnetAdapter.invokeMethodAsync("Close",i?"escape":"leave").catch(()=>window.blazorise.unregisterClosableComponent(n.elementId))})},focus:(n,t,i)=>{n=window.blazorise.utils.getRequiredElement(n,t),n&&n.focus({preventScroll:!i})},tooltip:{_instances:[],initialize:(n,t,i)=>{const r={theme:"blazorise",content:i.text,placement:i.placement,maxWidth:i.multiline?"15rem":null,duration:i.fade?[i.fadeDuration,i.fadeDuration]:[0,0],arrow:i.showArrow,allowHTML:!0,trigger:i.trigger},u=i.alwaysActive?{showOnCreate:!0,hideOnClick:!1,trigger:"manual"}:{},f=tippy(n,{...r,...u});window.blazorise.tooltip._instances[t]=f},destroy:(n,t)=>{var i=window.blazorise.tooltip._instances||{};const r=i[t];r&&(r.hide(),delete i[t])},updateContent:(n,t,i)=>{const r=window.blazorise.tooltip._instances[t];r&&r.setContent(i)}},textEdit:{_instances:[],initialize:(n,t,i,r)=>{var u=window.blazorise.textEdit._instances=window.blazorise.textEdit._instances||{};u[t]=i==="numeric"?new window.blazorise.NumericMaskValidator(n,t):i==="datetime"?new window.blazorise.DateTimeMaskValidator(n,t):i==="regex"?new window.blazorise.RegExMaskValidator(n,t,r):new window.blazorise.NoValidator;n.addEventListener("keypress",n=>{window.blazorise.textEdit.keyPress(u[t],n)});n.addEventListener("paste",n=>{window.blazorise.textEdit.paste(u[t],n)})},destroy:(n,t)=>{var i=window.blazorise.textEdit._instances||{};delete i[t]},keyPress:(n,t)=>{var i=String.fromCharCode(t.which);return n.isValid(i)||t.preventDefault()},paste:(n,t)=>n.isValid(t.clipboardData.getData("text/plain"))||t.preventDefault()},numericEdit:{_instances:[],initialize:(n,t,i,r)=>{const u=new window.blazorise.NumericMaskValidator(n,t,i,r);window.blazorise.numericEdit._instances[i]=u;t.addEventListener("keypress",n=>{window.blazorise.numericEdit.keyPress(window.blazorise.numericEdit._instances[i],n)});t.addEventListener("paste",n=>{window.blazorise.numericEdit.paste(window.blazorise.numericEdit._instances[i],n)});u.decimals&&u.decimals!==2&&u.truncate()},update:(n,t,i)=>{const r=window.blazorise.numericEdit._instances[t];r&&r.update(i)},destroy:(n,t)=>{var i=window.blazorise.numericEdit._instances||{};delete i[t]},keyPress:(n,t)=>{var i=String.fromCharCode(t.which);return t.which===13||n.isValid(i)||t.preventDefault()},paste:(n,t)=>n.isValid(t.clipboardData.getData("text/plain"))||t.preventDefault()},datePicker:{_pickers:[],initialize:(n,t,i)=>{function r(n){n.forEach(n=>{if(n.attributeName==="class"){const t=window.blazorise.datePicker._pickers[n.target.id];if(t&&t.altInput){const n=[...t.altInput.classList].filter(n=>!["input","active"].includes(n)),i=[...t.input.classList].filter(n=>!["flatpickr-input"].includes(n));n.forEach(n=>{t.altInput.classList.remove(n)});i.forEach(n=>{t.altInput.classList.add(n)})}}})}const u=new MutationObserver(r);u.observe(document.getElementById(t),{attributes:!0});const f={enableTime:i.inputMode===1,dateFormat:i.inputMode===1?"Y-m-d H:i":"Y-m-d",allowInput:!0,altInput:!0,altFormat:i.displayFormat?i.displayFormat:i.inputMode===1?"Y-m-d H:i":"Y-m-d",defaultValue:i.default,minDate:i.min,maxDate:i.max,locale:{firstDayOfWeek:i.firstDayOfWeek},time_24hr:i.timeAs24hr?i.timeAs24hr:!1},e=i.inputMode===2?{plugins:[new monthSelectPlugin({shorthand:!1,dateFormat:"Y-m-d",altFormat:"M Y"})]}:{},o=flatpickr(n,{...f,...e});window.blazorise.datePicker._pickers[t]=o},destroy:(n,t)=>{const i=window.blazorise.datePicker._pickers||{};delete i[t]},updateValue:(n,t,i)=>{const r=window.blazorise.datePicker._pickers[t];r&&r.setDate(i)},updateOptions:(n,t,i)=>{const r=window.blazorise.datePicker._pickers[t];r&&(i.firstDayOfWeek.changed&&r.set("firstDayOfWeek",i.firstDayOfWeek.value),i.displayFormat.changed&&r.set("altFormat",i.displayFormat.value),i.timeAs24hr.changed&&r.set("time_24hr",i.timeAs24hr.value),i.min.changed&&r.set("minDate",i.min.value),i.max.changed&&r.set("maxDate",i.max.value))},open:(n,t)=>{const i=window.blazorise.datePicker._pickers[t];i&&i.open()},close:(n,t)=>{const i=window.blazorise.datePicker._pickers[t];i&&i.close()},toggle:(n,t)=>{const i=window.blazorise.datePicker._pickers[t];i&&i.toggle()}},timePicker:{_pickers:[],initialize:(n,t,i)=>{function r(n){n.forEach(n=>{if(n.attributeName==="class"){const t=window.blazorise.timePicker._pickers[n.target.id];if(t&&t.altInput){const n=[...t.altInput.classList].filter(n=>!["input","active"].includes(n)),i=[...t.input.classList].filter(n=>!["flatpickr-input"].includes(n));n.forEach(n=>{t.altInput.classList.remove(n)});i.forEach(n=>{t.altInput.classList.add(n)})}}})}const u=new MutationObserver(r);u.observe(document.getElementById(t),{attributes:!0});const f=flatpickr(n,{enableTime:!0,noCalendar:!0,dateFormat:"H:i",allowInput:!0,altInput:!0,altFormat:i.displayFormat?i.displayFormat:"H:i",defaultValue:i.default,minTime:i.min,maxTime:i.max,time_24hr:i.timeAs24hr?i.timeAs24hr:!1});window.blazorise.timePicker._pickers[t]=f},destroy:(n,t)=>{const i=window.blazorise.timePicker._pickers||{};delete i[t]},updateValue:(n,t,i)=>{const r=window.blazorise.timePicker._pickers[t];r&&r.setDate(i)},updateOptions:(n,t,i)=>{const r=window.blazorise.timePicker._pickers[t];r&&(i.displayFormat.changed&&r.set("altFormat",i.displayFormat.value),i.timeAs24hr.changed&&r.set("time_24hr",i.timeAs24hr.value),i.min.changed&&r.set("minTime",i.min.value),i.max.changed&&r.set("maxTime",i.max.value))},open:(n,t)=>{const i=window.blazorise.timePicker._pickers[t];i&&i.open()},close:(n,t)=>{const i=window.blazorise.timePicker._pickers[t];i&&i.close()},toggle:(n,t)=>{const i=window.blazorise.timePicker._pickers[t];i&&i.toggle()}},NoValidator:function(){this.isValid=function(){return!0}},NumericMaskValidator:function(n,t,i,r){this.dotnetAdapter=n;this.elementId=i;this.element=t;this.decimals=r.decimals===null||r.decimals===undefined?2:r.decimals;this.separator=r.separator||".";this.step=r.step||1;this.min=r.min;this.max=r.max;this.regex=function(){var n="\\"+this.separator,t=this.decimals,i="{0,"+t+"}";return t?new RegExp("^(-)?(((\\d+("+n+"\\d"+i+")?)|("+n+"\\d"+i+")))?$"):/^(-)?(\d*)$/};this.carret=function(){return[this.element.selectionStart,this.element.selectionEnd]};this.isValid=function(n){var t=this.element.value,i=this.carret();return(t=t.substring(0,i[0])+n+t.substring(i[1]),!!this.regex().test(t))?(t||"").replace(this.separator,"."):!1};this.update=function(n){n.decimals&&n.decimals.changed&&(this.decimals=n.decimals.value,this.truncate())};this.truncate=function(){let i=(this.element.value||"").replace(this.separator,"."),n=Number(i);n=Math.trunc(n*Math.pow(10,this.decimals))/Math.pow(10,this.decimals);let t=n.toString().replace(".",this.separator);this.element.value=t;this.dotnetAdapter.invokeMethodAsync("SetValue",t)}},DateTimeMaskValidator:function(n,t){this.elementId=t;this.element=n;this.regex=function(){return/^\d{0,4}$|^\d{4}-0?$|^\d{4}-(?:0?[1-9]|1[012])(?:-(?:0?[1-9]?|[12]\d|3[01])?)?$/};this.carret=function(){return[this.element.selectionStart,this.element.selectionEnd]};this.isValid=function(n){var t=this.element.value,i=this.carret();return t=t.substring(0,i[0])+n+t.substring(i[1]),!!this.regex().test(t)}},RegExMaskValidator:function(n,t,i){this.elementId=t;this.element=n;this.editMask=i;this.regex=function(){return new RegExp(this.editMask)};this.carret=function(){return[this.element.selectionStart,this.element.selectionEnd]};this.isValid=function(n){var t=this.element.value,i=this.carret();return t=t.substring(0,i[0])+n+t.substring(i[1]),!!this.regex().test(t)}},button:{_instances:[],initialize:(n,t,i)=>{window.blazorise.button._instances[t]=new window.blazorise.ButtonInfo(n,t,i),n.type==="submit"&&n.addEventListener("click",n=>{window.blazorise.button.click(window.blazorise.button._instances[t],n)})},destroy:n=>{var t=window.blazorise.button._instances||{};delete t[n]},click:(n,t)=>{if(n.preventDefaultOnSubmit)return t.preventDefault()}},ButtonInfo:function(n,t,i){this.elementId=t;this.element=n;this.preventDefaultOnSubmit=i},link:{scrollIntoView:n=>{var t=document.getElementById(n);t&&(t.scrollIntoView(),window.location.hash=n)}},fileEdit:{_instances:[],initialize:(n,t,i)=>{var r=0;window.blazorise.fileEdit._instances[i]=new window.blazorise.FileEditInfo(n,t,i);t.addEventListener("change",function(){t._blazorFilesById={};var i=Array.prototype.map.call(t.files,function(n){var i={id:++r,lastModified:new Date(n.lastModified).toISOString(),name:n.name,size:n.size,type:n.type};return t._blazorFilesById[i.id]=i,Object.defineProperty(i,"blob",{value:n}),i});n.invokeMethodAsync("NotifyChange",i).then(null,function(n){throw new Error(n);})})},destroy:(n,t)=>{var i=window.blazorise.fileEdit._instances||{};delete i[t]},reset:(n,t)=>{if(n){n.value="";var i=window.blazorise.fileEdit._instances[t];i&&i.adapter.invokeMethodAsync("NotifyChange",[]).then(null,function(n){throw new Error(n);})}},readFileData:function(n,t,i,r){var u=getArrayBufferFromFileAsync(n,t);return u.then(function(n){var t=new Uint8Array(n,i,r);return uint8ToBase64(t)})},ensureArrayBufferReadyForSharedMemoryInterop:function(n,t){return getArrayBufferFromFileAsync(n,t).then(function(i){getFileById(n,t).arrayBuffer=i})},readFileDataSharedMemory:function(n){var u=Blazor.platform.readStringField(n,0),f=document.querySelector("[_bl_"+u+"]"),e=Blazor.platform.readInt32Field(n,4),t=Blazor.platform.readUint64Field(n,8),o=Blazor.platform.readInt32Field(n,16),s=Blazor.platform.readInt32Field(n,20),h=Blazor.platform.readInt32Field(n,24),i=getFileById(f,e).arrayBuffer,r=Math.min(h,i.byteLength-t),c=new Uint8Array(i,t,r),l=Blazor.platform.toUint8Array(o);return l.set(c,s),r},open:(n,t)=>{!n&&t&&(n=document.getElementById(t)),n&&n.click()}},FileEditInfo:function(n,t,i){this.adapter=n;this.element=t;this.elementId=i},breakpoint:{getBreakpoint:function(){return window.getComputedStyle(document.body,":before").content.replace(/\"/g,"")},breakpointComponents:[],lastBreakpoint:null,addBreakpointComponent:(n,t)=>{window.blazorise.breakpoint.breakpointComponents.push({elementId:n,dotnetAdapter:t})},findBreakpointComponentIndex:n=>{for(index=0;index<window.blazorise.breakpoint.breakpointComponents.length;++index)if(window.blazorise.breakpoint.breakpointComponents[index].elementId===n)return index;return-1},isBreakpointComponent:n=>{for(index=0;index<window.blazorise.breakpoint.breakpointComponents.length;++index)if(window.blazorise.breakpoint.breakpointComponents[index].elementId===n)return!0;return!1},registerBreakpointComponent:(n,t)=>{window.blazorise.breakpoint.isBreakpointComponent(n)!==!0&&window.blazorise.breakpoint.addBreakpointComponent(n,t)},unregisterBreakpointComponent:n=>{const t=window.blazorise.breakpoint.findBreakpointComponentIndex(n);t!==-1&&window.blazorise.breakpoint.breakpointComponents.splice(t,1)},onBreakpoint:(n,t)=>{n.invokeMethodAsync("OnBreakpoint",t)}},table:{initializeTableFixedHeader:function(n){function i(n){const t=n.querySelectorAll("thead tr");if(t!==null&&t.length>1){let n=0;for(let i=0;i<t.length;i++){let r=t[i].querySelectorAll("th");r.forEach(t=>t.style.top=`${n}px`);n+=r[0].offsetHeight}}}let t=null;this.resizeThottler=function(){t||(t=setTimeout(function(){t=null;i(n)}.bind(this),66))};i(n);window.addEventListener("resize",this.resizeThottler,!1)},destroyTableFixedHeader:function(n){typeof this.resizeThottler=="function"&&window.removeEventListener("resize",this.resizeThottler);const t=n.querySelectorAll("thead tr");if(t!==null&&t.length>1)for(let n=0;n<t.length;n++){let i=t[n].querySelectorAll("th");i.forEach(n=>n.style.top=`${0}px`)}},fixedHeaderScrollTableToPixels:function(n,t,i){n!==null&&n.parentElement!==null&&(n.parentElement.scrollTop=i)},fixedHeaderScrollTableToRow:function(n,t,i){if(n!==null){let t=n.querySelectorAll("tr"),r=t.length;r>0&&i>=0&&i<r&&t[i].scrollIntoView({behavior:"smooth",block:"start"})}},initializeResizable:function(n,t,i){const r="b-table-resizer",f="b-table-resizing",e=0;let u=null;if(n!==null&&(u=n.querySelectorAll("thead tr:first-child > th")),u!==null){const t=function(){let t=0;if(n!==null){const i=n.querySelectorAll("tr");i.forEach(n=>{let i=n.querySelector("th:first-child,td:first-child");i!==null&&(t+=i.offsetHeight)})}return t},o=()=>i===e?n!==null?n.querySelector("tr:first-child > th:first-child").offsetHeight:0:t();let s=o();const h=function(i){if(i.querySelector(`.${r}`)===null){const u=document.createElement("div");u.classList.add(r);u.style.height=`${s}px`;u.addEventListener("click",function(n){n.preventDefault();n.stopPropagation()});let e,h;i.addEventListener("click",function(n){let t=e!==null&&h!==null;if(t){let i=new Date,r=i-e,u=r>100,f=i-h,o=f<100;t&&u&&o&&(n.preventDefault(),n.stopPropagation());e=null;h=null}});i.appendChild(u);let c=0,l=0;const y=function(n){e=new Date;c=n.clientX;const t=window.getComputedStyle(i);l=parseInt(t.width,10);document.addEventListener("pointermove",a);document.addEventListener("pointerup",v);u.classList.add(f)},a=function(n){const r=n.clientX-c;u.style.height=`${t()}px`;i.style.width=`${l+r}px`},v=function(){h=new Date;u.classList.remove(f);n.querySelectorAll(`.${r}`).forEach(n=>n.style.height=`${o()}px`);document.removeEventListener("pointermove",a);document.removeEventListener("pointerup",v)};u.addEventListener("pointerdown",y)}};[].forEach.call(u,function(n){h(n)})}},destroyResizable:function(n){n!==null&&n.querySelectorAll(".b-table-resizer").forEach(n=>n.remove())}}};document.addEventListener("mousedown",function(n){window.blazorise.lastClickedDocumentElement=n.target});document.addEventListener("mouseup",function(n){if(n.button===0&&n.target===window.blazorise.lastClickedDocumentElement&&window.blazorise.closableComponents&&window.blazorise.closableComponents.length>0){const t=window.blazorise.closableComponents[window.blazorise.closableComponents.length-1];t&&window.blazorise.tryClose(t,n.target.id,!1,hasParentInTree(n.target,t.elementId))}});document.addEventListener("keyup",function(n){if(n.keyCode===27&&window.blazorise.closableComponents&&window.blazorise.closableComponents.length>0){const n=window.blazorise.closableComponents[window.blazorise.closableComponents.length-1];n&&window.blazorise.tryClose(n,n.elementId,!0,!1)}});window.addEventListener("resize",function(){if(window.blazorise.breakpoint.breakpointComponents&&window.blazorise.breakpoint.breakpointComponents.length>0){var n=window.blazorise.breakpoint.getBreakpoint();if(window.blazorise.breakpoint.lastBreakpoint!==n)for(window.blazorise.breakpoint.lastBreakpoint=n,index=0;index<window.blazorise.breakpoint.breakpointComponents.length;++index)window.blazorise.breakpoint.onBreakpoint(window.blazorise.breakpoint.breakpointComponents[index].dotnetAdapter,n)}});window.blazorise.breakpoint.lastBreakpoint=window.blazorise.breakpoint.getBreakpoint();var uint8ToBase64=function(){function u(t){return n[t>>18&63]+n[t>>12&63]+n[t>>6&63]+n[t&63]}function f(n,t,i){for(var f,e=[],r=t;r<i;r+=3)f=(n[r]<<16&16711680)+(n[r+1]<<8&65280)+(n[r+2]&255),e.push(u(f));return e.join("")}for(var n=[],i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,r=i.length;t<r;++t)n[t]=i[t];return function(t){for(var i,r=t.length,o=r%3,e=[],s=16383,u=0,h=r-o;u<h;u+=s)e.push(f(t,u,u+s>h?h:u+s));return o===1?(i=t[r-1],e.push(n[i>>2]+n[i<<4&63]+"==")):o===2&&(i=(t[r-2]<<8)+t[r-1],e.push(n[i>>10]+n[i>>4&63]+n[i<<2&63]+"=")),e.join("")}}();
|
|
|
|
function mutateDOMChange(n){el=document.getElementById(n);ev=document.createEvent("Event");ev.initEvent("change",!0,!1);el.dispatchEvent(ev)}window.blazoriseBootstrap||(window.blazoriseBootstrap={});window.blazoriseBootstrap={tooltip:{initialize:n=>(n.querySelector(".custom-control-input,.btn")&&n.classList.add("b-tooltip-inline"),!0)},modal:{open:(n,t)=>{var i=Number(document.body.getAttribute("data-modals")||"0");return i===0&&window.blazorise.addClassToBody("modal-open"),i+=1,document.body.setAttribute("data-modals",i.toString()),t&&(n.querySelector(".modal-body").scrollTop=0),!0},close:()=>{var n=Number(document.body.getAttribute("data-modals")||"0");return n-=1,n<0&&(n=0),n===0&&window.blazorise.removeClassFromBody("modal-open"),document.body.setAttribute("data-modals",n.toString()),!0}}};
|
|
|
|
var abp=abp||{};(function(){abp.utils=abp.utils||{};abp.domReady=function(n){document.readyState==="complete"||document.readyState==="interactive"?setTimeout(n,1):document.addEventListener("DOMContentLoaded",n)};abp.utils.setCookieValue=function(n,t,i,r,u){var f=encodeURIComponent(n)+"=";t&&(f=f+encodeURIComponent(t));i&&(f=f+"; expires="+i);r&&(f=f+"; path="+r);u&&(f=f+"; secure");document.cookie=f};abp.utils.getCookieValue=function(n){for(var i,r=document.cookie.split("; "),t=0;t<r.length;t++)if(r[t]&&(i=r[t].split("="),i.length==2)&&decodeURIComponent(i[0])===n)return decodeURIComponent(i[1]||"");return null};abp.utils.deleteCookie=function(n,t){var i=encodeURIComponent(n)+"=";i=i+"; expires="+new Date((new Date).getTime()-864e5).toUTCString();t&&(i=i+"; path="+t);document.cookie=i};abp.utils.addClassToTag=function(n,t){for(var r=document.getElementsByTagName(n),i=0;i<r.length;i++)r[i].classList.add(t)};abp.utils.removeClassFromTag=function(n,t){for(var r=document.getElementsByTagName(n),i=0;i<r.length;i++)r[i].classList.remove(t)};abp.utils.hasClassOnTag=function(n,t){var i=document.getElementsByTagName(n);return i.length?i[0].classList.contains(t):!1};abp.utils.replaceLinkHrefById=function(n,t){var i=document.getElementById(n);i&&i.href!==t&&(i.href=t)};abp.utils.toggleFullscreen=function(){var n=document.documentElement;document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement?document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen():n.requestFullscreen?n.requestFullscreen():n.msRequestFullscreen?n.msRequestFullscreen():n.mozRequestFullScreen?n.mozRequestFullScreen():n.webkitRequestFullscreen&&n.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)};abp.utils.requestFullscreen=function(){var n=document.documentElement;document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement||(n.requestFullscreen?n.requestFullscreen():n.msRequestFullscreen?n.msRequestFullscreen():n.mozRequestFullScreen?n.mozRequestFullScreen():n.webkitRequestFullscreen&&n.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT))};abp.utils.exitFullscreen=function(){!document.fullscreenElement&&!document.mozFullScreenElement&&!document.webkitFullscreenElement&&!document.msFullscreenElement||(document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen())}})();
|
|
|
|
(()=>{"use strict";var e,t,n;!function(e){window.DotNet=e;const t=[],n=new Map,r=new Map,o="__jsObjectId",s="__byte[]";class a{constructor(e){this._jsObject=e,this._cachedFunctions=new Map}findFunction(e){const t=this._cachedFunctions.get(e);if(t)return t;let n,r=this._jsObject;if(e.split(".").forEach((t=>{if(!(t in r))throw new Error(`Could not find '${e}' ('${t}' was undefined).`);n=r,r=r[t]})),r instanceof Function)return r=r.bind(n),this._cachedFunctions.set(e,r),r;throw new Error(`The value '${e}' is not a function.`)}getWrappedObject(){return this._jsObject}}const i={},c={0:new a(window)};c[0]._cachedFunctions.set("import",(e=>("string"==typeof e&&e.startsWith("./")&&(e=document.baseURI+e.substr(2)),import(e))));let l,u=1,d=1,f=null;function m(e){t.push(e)}function h(e){if(e&&"object"==typeof e){c[d]=new a(e);const t={[o]:d};return d++,t}throw new Error(`Cannot create a JSObjectReference from the value '${e}'.`)}function p(e){let t=-1;if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Blob)t=e.size;else{if(!(e.buffer instanceof ArrayBuffer))throw new Error("Supplied value is not a typed array or blob.");if(void 0===e.byteLength)throw new Error(`Cannot create a JSStreamReference from the value '${e}' as it doesn't have a byteLength.`);t=e.byteLength}const n={__jsStreamReferenceLength:t};try{const t=h(e);n.__jsObjectId=t.__jsObjectId}catch{throw new Error(`Cannot create a JSStreamReference from the value '${e}'.`)}return n}function y(e){return e?JSON.parse(e,((e,n)=>t.reduce(((t,n)=>n(e,t)),n))):null}function g(e,t,n,r){const o=w();if(o.invokeDotNetFromJS){const s=D(r),a=o.invokeDotNetFromJS(e,t,n,s);return a?y(a):null}throw new Error("The current dispatcher does not support synchronous calls from JS to .NET. Use invokeMethodAsync instead.")}function b(e,t,n,r){if(e&&n)throw new Error(`For instance method calls, assemblyName should be null. Received '${e}'.`);const o=u++,s=new Promise(((e,t)=>{i[o]={resolve:e,reject:t}}));try{const s=D(r);w().beginInvokeDotNetFromJS(o,e,t,n,s)}catch(e){v(o,!1,e)}return s}function w(){if(null!==f)return f;throw new Error("No .NET call dispatcher has been set.")}function v(e,t,n){if(!i.hasOwnProperty(e))throw new Error(`There is no pending async call with ID ${e}.`);const r=i[e];delete i[e],t?r.resolve(n):r.reject(n)}function E(e){return e instanceof Error?`${e.message}\n${e.stack}`:e?e.toString():"null"}function _(e,t){let n=c[t];if(n)return n.findFunction(e);throw new Error(`JS object instance with ID ${t} does not exist (has it been disposed?).`)}function I(e){delete c[e]}e.attachDispatcher=function(e){f=e},e.attachReviver=m,e.invokeMethod=function(e,t,...n){return g(e,t,null,n)},e.invokeMethodAsync=function(e,t,...n){return b(e,t,null,n)},e.createJSObjectReference=h,e.createJSStreamReference=p,e.disposeJSObjectReference=function(e){const t=e&&e.__jsObjectId;"number"==typeof t&&I(t)},function(e){e[e.Default=0]="Default",e[e.JSObjectReference=1]="JSObjectReference",e[e.JSStreamReference=2]="JSStreamReference"}(l=e.JSCallResultType||(e.JSCallResultType={})),e.jsCallDispatcher={findJSFunction:_,disposeJSObjectReferenceById:I,invokeJSFromDotNet:(e,t,n,r)=>{const o=S(_(e,r).apply(null,y(t)),n);return null==o?null:D(o)},beginInvokeJSFromDotNet:(e,t,n,r,o)=>{const s=new Promise((e=>{e(_(t,o).apply(null,y(n)))}));e&&s.then((t=>w().endInvokeJSFromDotNet(e,!0,D([e,!0,S(t,r)]))),(t=>w().endInvokeJSFromDotNet(e,!1,JSON.stringify([e,!1,E(t)]))))},endInvokeDotNetFromJS:(e,t,n)=>{const r=t?y(n):new Error(n);v(parseInt(e),t,r)},receiveByteArray:(e,t)=>{n.set(e,t)},supplyDotNetStream:(e,t)=>{if(r.has(e)){const n=r.get(e);r.delete(e),n.resolve(t)}else{const n=new A;n.resolve(t),r.set(e,n)}}};class N{constructor(e){this._id=e}invokeMethod(e,...t){return g(null,e,this._id,t)}invokeMethodAsync(e,...t){return b(null,e,this._id,t)}dispose(){b(null,"__Dispose",this._id,null).catch((e=>console.error(e)))}serializeAsArg(){return{__dotNetObject:this._id}}}e.DotNetObject=N,m((function(e,t){if(t&&"object"==typeof t){if(t.hasOwnProperty("__dotNetObject"))return new N(t.__dotNetObject);if(t.hasOwnProperty(o)){const e=t.__jsObjectId,n=c[e];if(n)return n.getWrappedObject();throw new Error(`JS object instance with Id '${e}' does not exist. It may have been disposed.`)}if(t.hasOwnProperty(s)){const e=t["__byte[]"],r=n.get(e);if(void 0===r)throw new Error(`Byte array index '${e}' does not exist.`);return n.delete(e),r}if(t.hasOwnProperty("__dotNetStream"))return new C(t.__dotNetStream)}return t}));class C{constructor(e){var t;if(r.has(e))this._streamPromise=null===(t=r.get(e))||void 0===t?void 0:t.streamPromise,r.delete(e);else{const t=new A;r.set(e,t),this._streamPromise=t.streamPromise}}stream(){return this._streamPromise}async arrayBuffer(){return new Response(await this.stream()).arrayBuffer()}}class A{constructor(){this.streamPromise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}function S(e,t){switch(t){case l.Default:return e;case l.JSObjectReference:return h(e);case l.JSStreamReference:return p(e);default:throw new Error(`Invalid JS call result type '${t}'.`)}}let R=0;function D(e){return R=0,JSON.stringify(e,k)}function k(e,t){if(t instanceof N)return t.serializeAsArg();if(t instanceof Uint8Array){f.sendByteArray(R,t);const e={[s]:R};return R++,e}return t}}(e||(e={})),function(e){e[e.prependFrame=1]="prependFrame",e[e.removeFrame=2]="removeFrame",e[e.setAttribute=3]="setAttribute",e[e.removeAttribute=4]="removeAttribute",e[e.updateText=5]="updateText",e[e.stepIn=6]="stepIn",e[e.stepOut=7]="stepOut",e[e.updateMarkup=8]="updateMarkup",e[e.permutationListEntry=9]="permutationListEntry",e[e.permutationListEnd=10]="permutationListEnd"}(t||(t={})),function(e){e[e.element=1]="element",e[e.text=2]="text",e[e.attribute=3]="attribute",e[e.component=4]="component",e[e.region=5]="region",e[e.elementReferenceCapture=6]="elementReferenceCapture",e[e.markup=8]="markup"}(n||(n={}));class r{constructor(e,t){this.componentId=e,this.fieldValue=t}static fromEvent(e,t){const n=t.target;if(n instanceof Element){const t=function(e){return e instanceof HTMLInputElement?e.type&&"checkbox"===e.type.toLowerCase()?{value:e.checked}:{value:e.value}:e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement?{value:e.value}:null}(n);if(t)return new r(e,t.value)}return null}}const o=new Map,s=new Map,a={createEventArgs:()=>({})},i=[];function c(e){return o.get(e)}function l(e){const t=o.get(e);return(null==t?void 0:t.browserEventName)||e}function u(e,t){e.forEach((e=>o.set(e,t)))}function d(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];t.push({identifier:r.identifier,clientX:r.clientX,clientY:r.clientY,screenX:r.screenX,screenY:r.screenY,pageX:r.pageX,pageY:r.pageY})}return t}function f(e){return{detail:e.detail,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,offsetX:e.offsetX,offsetY:e.offsetY,pageX:e.pageX,pageY:e.pageY,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey}}u(["input","change"],{createEventArgs:function(e){const t=e.target;if(function(e){return-1!==m.indexOf(e.getAttribute("type"))}(t))return{value:function(e){const t=e.value,n=e.type;switch(n){case"date":case"month":return t;case"datetime-local":return 16===t.length?t+":00":t;case"time":return 5===t.length?t+":00":t;case"week":return t}throw new Error(`Invalid element type '${n}'.`)}(t)};if(function(e){return e instanceof HTMLSelectElement&&"select-multiple"===e.type}(t)){const e=t;return{value:Array.from(e.options).filter((e=>e.selected)).map((e=>e.value))}}return{value:function(e){return!!e&&"INPUT"===e.tagName&&"checkbox"===e.getAttribute("type")}(t)?!!t.checked:t.value}}}),u(["copy","cut","paste"],a),u(["drag","dragend","dragenter","dragleave","dragover","dragstart","drop"],{createEventArgs:e=>{return{...f(t=e),dataTransfer:t.dataTransfer?{dropEffect:t.dataTransfer.dropEffect,effectAllowed:t.dataTransfer.effectAllowed,files:Array.from(t.dataTransfer.files).map((e=>e.name)),items:Array.from(t.dataTransfer.items).map((e=>({kind:e.kind,type:e.type}))),types:t.dataTransfer.types}:null};var t}}),u(["focus","blur","focusin","focusout"],a),u(["keydown","keyup","keypress"],{createEventArgs:e=>{return{key:(t=e).key,code:t.code,location:t.location,repeat:t.repeat,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey};var t}}),u(["contextmenu","click","mouseover","mouseout","mousemove","mousedown","mouseup","dblclick"],{createEventArgs:e=>f(e)}),u(["error"],{createEventArgs:e=>{return{message:(t=e).message,filename:t.filename,lineno:t.lineno,colno:t.colno};var t}}),u(["loadstart","timeout","abort","load","loadend","progress"],{createEventArgs:e=>{return{lengthComputable:(t=e).lengthComputable,loaded:t.loaded,total:t.total};var t}}),u(["touchcancel","touchend","touchmove","touchenter","touchleave","touchstart"],{createEventArgs:e=>{return{detail:(t=e).detail,touches:d(t.touches),targetTouches:d(t.targetTouches),changedTouches:d(t.changedTouches),ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,type:t.type};var t}}),u(["gotpointercapture","lostpointercapture","pointercancel","pointerdown","pointerenter","pointerleave","pointermove","pointerout","pointerover","pointerup"],{createEventArgs:e=>{return{...f(t=e),pointerId:t.pointerId,width:t.width,height:t.height,pressure:t.pressure,tiltX:t.tiltX,tiltY:t.tiltY,pointerType:t.pointerType,isPrimary:t.isPrimary};var t}}),u(["wheel","mousewheel"],{createEventArgs:e=>{return{...f(t=e),deltaX:t.deltaX,deltaY:t.deltaY,deltaZ:t.deltaZ,deltaMode:t.deltaMode};var t}}),u(["toggle"],a);const m=["date","datetime-local","month","time","week"],h=new Map;let p,y,g=0;const b={async add(e,t,n){if(!n)throw new Error("initialParameters must be an object, even if empty.");const r="__bl-dynamic-root:"+(++g).toString();h.set(r,e);const o=await E().invokeMethodAsync("AddRootComponent",t,r),s=new v(o,y[t]);return await s.setParameters(n),s}};class w{invoke(e){return this._callback(e)}setCallback(t){this._selfJSObjectReference||(this._selfJSObjectReference=e.createJSObjectReference(this)),this._callback=t}getJSObjectReference(){return this._selfJSObjectReference}dispose(){this._selfJSObjectReference&&e.disposeJSObjectReference(this._selfJSObjectReference)}}class v{constructor(e,t){this._jsEventCallbackWrappers=new Map,this._componentId=e;for(const e of t)"eventcallback"===e.type&&this._jsEventCallbackWrappers.set(e.name.toLowerCase(),new w)}setParameters(e){const t={},n=Object.entries(e||{}),r=n.length;for(const[e,r]of n){const n=this._jsEventCallbackWrappers.get(e.toLowerCase());n&&r?(n.setCallback(r),t[e]=n.getJSObjectReference()):t[e]=r}return E().invokeMethodAsync("SetRootComponentParameters",this._componentId,r,t)}async dispose(){if(null!==this._componentId){await E().invokeMethodAsync("RemoveRootComponent",this._componentId),this._componentId=null;for(const e of this._jsEventCallbackWrappers.values())e.dispose()}}}function E(){if(!p)throw new Error("Dynamic root components have not been enabled in this application.");return p}const _=new Map;function I(e,t,n){return C(e,t.eventHandlerId,(()=>N(e).invokeMethodAsync("DispatchEventAsync",t,n)))}function N(e){const t=_.get(e);if(!t)throw new Error(`No interop methods are registered for renderer ${e}`);return t}let C=(e,t,n)=>n();const A=B(["abort","blur","change","error","focus","load","loadend","loadstart","mouseenter","mouseleave","progress","reset","scroll","submit","unload","toggle","DOMNodeInsertedIntoDocument","DOMNodeRemovedFromDocument"]),S={submit:!0},R=B(["click","dblclick","mousedown","mousemove","mouseup"]);class D{constructor(e){this.browserRendererId=e,this.afterClickCallbacks=[];const t=++D.nextEventDelegatorId;this.eventsCollectionKey=`_blazorEvents_${t}`,this.eventInfoStore=new k(this.onGlobalEvent.bind(this))}setListener(e,t,n,r){const o=this.getEventHandlerInfosForElement(e,!0),s=o.getHandler(t);if(s)this.eventInfoStore.update(s.eventHandlerId,n);else{const s={element:e,eventName:t,eventHandlerId:n,renderingComponentId:r};this.eventInfoStore.add(s),o.setHandler(t,s)}}getHandler(e){return this.eventInfoStore.get(e)}removeListener(e){const t=this.eventInfoStore.remove(e);if(t){const e=t.element,n=this.getEventHandlerInfosForElement(e,!1);n&&n.removeHandler(t.eventName)}}notifyAfterClick(e){this.afterClickCallbacks.push(e),this.eventInfoStore.addGlobalListener("click")}setStopPropagation(e,t,n){this.getEventHandlerInfosForElement(e,!0).stopPropagation(t,n)}setPreventDefault(e,t,n){this.getEventHandlerInfosForElement(e,!0).preventDefault(t,n)}onGlobalEvent(e){if(!(e.target instanceof Element))return;this.dispatchGlobalEventToAllElements(e.type,e);const t=(n=e.type,s.get(n));var n;t&&t.forEach((t=>this.dispatchGlobalEventToAllElements(t,e))),"click"===e.type&&this.afterClickCallbacks.forEach((t=>t(e)))}dispatchGlobalEventToAllElements(e,t){const n=t.composedPath();let o=n.shift(),s=null,a=!1;const i=A.hasOwnProperty(e);let l=!1;for(;o;){const f=o,m=this.getEventHandlerInfosForElement(f,!1);if(m){const n=m.getHandler(e);if(n&&(u=f,d=t.type,!((u instanceof HTMLButtonElement||u instanceof HTMLInputElement||u instanceof HTMLTextAreaElement||u instanceof HTMLSelectElement)&&R.hasOwnProperty(d)&&u.disabled))){if(!a){const n=c(e);s=(null==n?void 0:n.createEventArgs)?n.createEventArgs(t):{},a=!0}S.hasOwnProperty(t.type)&&t.preventDefault(),I(this.browserRendererId,{eventHandlerId:n.eventHandlerId,eventName:e,eventFieldInfo:r.fromEvent(n.renderingComponentId,t)},s)}m.stopPropagation(e)&&(l=!0),m.preventDefault(e)&&t.preventDefault()}o=i||l?void 0:n.shift()}var u,d}getEventHandlerInfosForElement(e,t){return e.hasOwnProperty(this.eventsCollectionKey)?e[this.eventsCollectionKey]:t?e[this.eventsCollectionKey]=new O:null}}D.nextEventDelegatorId=0;class k{constructor(e){this.globalListener=e,this.infosByEventHandlerId={},this.countByEventName={},i.push(this.handleEventNameAliasAdded.bind(this))}add(e){if(this.infosByEventHandlerId[e.eventHandlerId])throw new Error(`Event ${e.eventHandlerId} is already tracked`);this.infosByEventHandlerId[e.eventHandlerId]=e,this.addGlobalListener(e.eventName)}get(e){return this.infosByEventHandlerId[e]}addGlobalListener(e){if(e=l(e),this.countByEventName.hasOwnProperty(e))this.countByEventName[e]++;else{this.countByEventName[e]=1;const t=A.hasOwnProperty(e);document.addEventListener(e,this.globalListener,t)}}update(e,t){if(this.infosByEventHandlerId.hasOwnProperty(t))throw new Error(`Event ${t} is already tracked`);const n=this.infosByEventHandlerId[e];delete this.infosByEventHandlerId[e],n.eventHandlerId=t,this.infosByEventHandlerId[t]=n}remove(e){const t=this.infosByEventHandlerId[e];if(t){delete this.infosByEventHandlerId[e];const n=l(t.eventName);0==--this.countByEventName[n]&&(delete this.countByEventName[n],document.removeEventListener(n,this.globalListener))}return t}handleEventNameAliasAdded(e,t){if(this.countByEventName.hasOwnProperty(e)){const n=this.countByEventName[e];delete this.countByEventName[e],document.removeEventListener(e,this.globalListener),this.addGlobalListener(t),this.countByEventName[t]+=n-1}}}class O{constructor(){this.handlers={},this.preventDefaultFlags=null,this.stopPropagationFlags=null}getHandler(e){return this.handlers.hasOwnProperty(e)?this.handlers[e]:null}setHandler(e,t){this.handlers[e]=t}removeHandler(e){delete this.handlers[e]}preventDefault(e,t){return void 0!==t&&(this.preventDefaultFlags=this.preventDefaultFlags||{},this.preventDefaultFlags[e]=t),!!this.preventDefaultFlags&&this.preventDefaultFlags[e]}stopPropagation(e,t){return void 0!==t&&(this.stopPropagationFlags=this.stopPropagationFlags||{},this.stopPropagationFlags[e]=t),!!this.stopPropagationFlags&&this.stopPropagationFlags[e]}}function B(e){const t={};return e.forEach((e=>{t[e]=!0})),t}const F=X("_blazorLogicalChildren"),M=X("_blazorLogicalParent"),T=X("_blazorLogicalEnd");function j(e,t){if(e.childNodes.length>0&&!t)throw new Error("New logical elements must start empty, or allowExistingContents must be true");return F in e||(e[F]=[]),e}function L(e,t){const n=document.createComment("!");return P(n,e,t),n}function P(e,t,n){const r=e;if(e instanceof Comment&&z(r)&&z(r).length>0)throw new Error("Not implemented: inserting non-empty logical container");if(H(r))throw new Error("Not implemented: moving existing logical children");const o=z(t);if(n<o.length){const t=o[n];t.parentNode.insertBefore(e,t),o.splice(n,0,r)}else K(e,t),o.push(r);r[M]=t,F in r||(r[F]=[])}function x(e,t){const n=z(e).splice(t,1)[0];if(n instanceof Comment){const e=z(n);if(e)for(;e.length>0;)x(n,0)}const r=n;r.parentNode.removeChild(r)}function H(e){return e[M]||null}function $(e,t){return z(e)[t]}function J(e){var t=G(e);return"http://www.w3.org/2000/svg"===t.namespaceURI&&"foreignObject"!==t.tagName}function z(e){return e[F]}function U(e,t){const n=z(e);t.forEach((e=>{e.moveRangeStart=n[e.fromSiblingIndex],e.moveRangeEnd=V(e.moveRangeStart)})),t.forEach((t=>{const r=t.moveToBeforeMarker=document.createComment("marker"),o=n[t.toSiblingIndex+1];o?o.parentNode.insertBefore(r,o):K(r,e)})),t.forEach((e=>{const t=e.moveToBeforeMarker,n=t.parentNode,r=e.moveRangeStart,o=e.moveRangeEnd;let s=r;for(;s;){const e=s.nextSibling;if(n.insertBefore(s,t),s===o)break;s=e}n.removeChild(t)})),t.forEach((e=>{n[e.toSiblingIndex]=e.moveRangeStart}))}function G(e){if(e instanceof Element||e instanceof DocumentFragment)return e;if(e instanceof Comment)return e.parentNode;throw new Error("Not a valid logical element")}function W(e){const t=z(H(e));return t[Array.prototype.indexOf.call(t,e)+1]||null}function K(e,t){if(t instanceof Element||t instanceof DocumentFragment)t.appendChild(e);else{if(!(t instanceof Comment))throw new Error(`Cannot append node because the parent is not a valid logical element. Parent: ${t}`);{const n=W(t);n?n.parentNode.insertBefore(e,n):K(e,H(t))}}}function V(e){if(e instanceof Element||e instanceof DocumentFragment)return e;const t=W(e);if(t)return t.previousSibling;{const t=H(e);return t instanceof Element||t instanceof DocumentFragment?t.lastChild:V(t)}}function X(e){return"function"==typeof Symbol?Symbol():e}function Y(e){return`_bl_${e}`}e.attachReviver(((e,t)=>t&&"object"==typeof t&&t.hasOwnProperty("__internalId")&&"string"==typeof t.__internalId?function(e){const t=`[${Y(e)}]`;return document.querySelector(t)}(t.__internalId):t));const q="_blazorDeferredValue",Z=document.createElement("template"),Q=document.createElementNS("http://www.w3.org/2000/svg","g"),ee={},te="__internal_",ne="preventDefault_",re="stopPropagation_";class oe{constructor(e){this.rootComponentIds=new Set,this.childComponentLocations={},this.eventDelegator=new D(e),this.eventDelegator.notifyAfterClick((e=>{if(!me)return;if(0!==e.button||function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e))return;if(e.defaultPrevented)return;const t=function(e){const t=!window._blazorDisableComposedPath&&e.composedPath&&e.composedPath();if(t){for(let e=0;e<t.length;e++){const n=t[e];if(n instanceof Element&&"A"===n.tagName)return n}return null}return _e(e.target,"A")}(e);if(t&&function(e){const t=e.getAttribute("target");return(!t||"_self"===t)&&e.hasAttribute("href")&&!e.hasAttribute("download")}(t)){const n=Ee(t.getAttribute("href"));Ie(n)&&(e.preventDefault(),be(n,!0,!1))}}))}attachRootComponentToLogicalElement(e,t,n){this.attachComponentToElement(e,t),this.rootComponentIds.add(e),n||(ee[e]=t)}updateComponent(e,t,n,r){var o;const s=this.childComponentLocations[t];if(!s)throw new Error(`No element is currently associated with component ${t}`);const a=ee[t];if(a){const e=function(e){return e[T]||null}(a);delete ee[t],e?function(e,t){const n=H(e);if(!n)throw new Error("Can't clear between nodes. The start node does not have a logical parent.");const r=z(n),o=r.indexOf(e)+1,s=r.indexOf(t);for(let e=o;e<=s;e++)x(n,o);e.textContent="!"}(a,e):function(e){let t;for(;t=e.firstChild;)e.removeChild(t)}(a)}const i=null===(o=G(s))||void 0===o?void 0:o.getRootNode(),c=i&&i.activeElement;this.applyEdits(e,t,s,0,n,r),c instanceof HTMLElement&&i&&i.activeElement!==c&&c.focus()}disposeComponent(e){this.rootComponentIds.delete(e)&&function(e){const t=z(e);for(;t.length;)x(e,0)}(this.childComponentLocations[e]),delete this.childComponentLocations[e]}disposeEventHandler(e){this.eventDelegator.removeListener(e)}attachComponentToElement(e,t){this.childComponentLocations[e]=t}applyEdits(e,n,r,o,s,a){let i,c=0,l=o;const u=e.arrayBuilderSegmentReader,d=e.editReader,f=e.frameReader,m=u.values(s),h=u.offset(s),p=h+u.count(s);for(let s=h;s<p;s++){const u=e.diffReader.editsEntry(m,s),h=d.editType(u);switch(h){case t.prependFrame:{const t=d.newTreeIndex(u),o=e.referenceFramesEntry(a,t),s=d.siblingIndex(u);this.insertFrame(e,n,r,l+s,a,o,t);break}case t.removeFrame:x(r,l+d.siblingIndex(u));break;case t.setAttribute:{const t=d.newTreeIndex(u),o=e.referenceFramesEntry(a,t),s=$(r,l+d.siblingIndex(u));if(!(s instanceof Element))throw new Error("Cannot set attribute on non-element child");this.applyAttribute(e,n,s,o);break}case t.removeAttribute:{const t=$(r,l+d.siblingIndex(u));if(!(t instanceof HTMLElement))throw new Error("Cannot remove attribute from non-element child");{const n=d.removedAttributeName(u);this.tryApplySpecialProperty(e,t,n,null)||t.removeAttribute(n)}break}case t.updateText:{const t=d.newTreeIndex(u),n=e.referenceFramesEntry(a,t),o=$(r,l+d.siblingIndex(u));if(!(o instanceof Text))throw new Error("Cannot set text content on non-text child");o.textContent=f.textContent(n);break}case t.updateMarkup:{const t=d.newTreeIndex(u),n=e.referenceFramesEntry(a,t),o=d.siblingIndex(u);x(r,l+o),this.insertMarkup(e,r,l+o,n);break}case t.stepIn:r=$(r,l+d.siblingIndex(u)),c++,l=0;break;case t.stepOut:r=H(r),c--,l=0===c?o:0;break;case t.permutationListEntry:i=i||[],i.push({fromSiblingIndex:l+d.siblingIndex(u),toSiblingIndex:l+d.moveToSiblingIndex(u)});break;case t.permutationListEnd:U(r,i),i=void 0;break;default:throw new Error(`Unknown edit type: ${h}`)}}}insertFrame(e,t,r,o,s,a,i){const c=e.frameReader,l=c.frameType(a);switch(l){case n.element:return this.insertElement(e,t,r,o,s,a,i),1;case n.text:return this.insertText(e,r,o,a),1;case n.attribute:throw new Error("Attribute frames should only be present as leading children of element frames.");case n.component:return this.insertComponent(e,r,o,a),1;case n.region:return this.insertFrameRange(e,t,r,o,s,i+1,i+c.subtreeLength(a));case n.elementReferenceCapture:if(r instanceof Element)return u=r,d=c.elementReferenceCaptureId(a),u.setAttribute(Y(d),""),0;throw new Error("Reference capture frames can only be children of element frames.");case n.markup:return this.insertMarkup(e,r,o,a),1;default:throw new Error(`Unknown frame type: ${l}`)}var u,d}insertElement(e,t,r,o,s,a,i){const c=e.frameReader,l=c.elementName(a),u="svg"===l||J(r)?document.createElementNS("http://www.w3.org/2000/svg",l):document.createElement(l),d=j(u);let f=!1;const m=i+c.subtreeLength(a);for(let a=i+1;a<m;a++){const i=e.referenceFramesEntry(s,a);if(c.frameType(i)!==n.attribute){P(u,r,o),f=!0,this.insertFrameRange(e,t,d,0,s,a,m);break}this.applyAttribute(e,t,u,i)}f||P(u,r,o),u instanceof HTMLOptionElement?this.trySetSelectValueFromOptionElement(u):q in u&&le(u,u._blazorDeferredValue)}trySetSelectValueFromOptionElement(e){const t=this.findClosestAncestorSelectElement(e);if(!t||!(q in t))return!1;if(ie(t))e.selected=-1!==t._blazorDeferredValue.indexOf(e.value);else{if(t._blazorDeferredValue!==e.value)return!1;ce(t,e.value),delete t._blazorDeferredValue}return!0}insertComponent(e,t,n,r){const o=L(t,n),s=e.frameReader.componentId(r);this.attachComponentToElement(s,o)}insertText(e,t,n,r){const o=e.frameReader.textContent(r);P(document.createTextNode(o),t,n)}insertMarkup(e,t,n,r){const o=L(t,n),s=(a=e.frameReader.markupContent(r),J(t)?(Q.innerHTML=a||" ",Q):(Z.innerHTML=a||" ",Z.content));var a;let i=0;for(;s.firstChild;)P(s.firstChild,o,i++)}applyAttribute(e,t,n,r){const o=e.frameReader,s=o.attributeName(r),a=o.attributeEventHandlerId(r);if(a){const e=ae(s);this.eventDelegator.setListener(n,e,a,t)}else this.tryApplySpecialProperty(e,n,s,r)||n.setAttribute(s,o.attributeValue(r))}tryApplySpecialProperty(e,t,n,r){switch(n){case"value":return this.tryApplyValueProperty(e,t,r);case"checked":return this.tryApplyCheckedProperty(e,t,r);default:return!!n.startsWith(te)&&(this.applyInternalAttribute(e,t,n.substring(te.length),r),!0)}}applyInternalAttribute(e,t,n,r){const o=r?e.frameReader.attributeValue(r):null;if(n.startsWith(re)){const e=ae(n.substring(re.length));this.eventDelegator.setStopPropagation(t,e,null!==o)}else{if(!n.startsWith(ne))throw new Error(`Unsupported internal attribute '${n}'`);{const e=ae(n.substring(ne.length));this.eventDelegator.setPreventDefault(t,e,null!==o)}}}tryApplyValueProperty(e,t,n){const r=e.frameReader;if("INPUT"===t.tagName&&"time"===t.getAttribute("type")&&!t.getAttribute("step")){const e=n?r.attributeValue(n):null;if(e)return t.value=e.substring(0,5),!0}switch(t.tagName){case"INPUT":case"SELECT":case"TEXTAREA":{let e=n?r.attributeValue(n):null;return e&&t instanceof HTMLSelectElement&&ie(t)&&(e=JSON.parse(e)),le(t,e),t._blazorDeferredValue=e,!0}case"OPTION":{const e=n?r.attributeValue(n):null;return e||""===e?t.setAttribute("value",e):t.removeAttribute("value"),this.trySetSelectValueFromOptionElement(t),!0}default:return!1}}tryApplyCheckedProperty(e,t,n){if("INPUT"===t.tagName){const r=n?e.frameReader.attributeValue(n):null;return t.checked=null!==r,!0}return!1}findClosestAncestorSelectElement(e){for(;e;){if(e instanceof HTMLSelectElement)return e;e=e.parentElement}return null}insertFrameRange(e,t,n,r,o,s,a){const i=r;for(let i=s;i<a;i++){const s=e.referenceFramesEntry(o,i);r+=this.insertFrame(e,t,n,r,o,s,i),i+=se(e,s)}return r-i}}function se(e,t){const r=e.frameReader;switch(r.frameType(t)){case n.component:case n.element:case n.region:return r.subtreeLength(t)-1;default:return 0}}function ae(e){if(e.startsWith("on"))return e.substring(2);throw new Error(`Attribute should be an event name, but doesn't start with 'on'. Value: '${e}'`)}function ie(e){return"select-multiple"===e.type}function ce(e,t){e.value=t||""}function le(e,t){e instanceof HTMLSelectElement?ie(e)?function(e,t){t||(t=[]);for(let n=0;n<e.options.length;n++)e.options[n].selected=-1!==t.indexOf(e.options[n].value)}(e,t):ce(e,t):e.value=t}const ue={};let de=!1;function fe(e,t,n,r){let o=ue[e];o||(o=ue[e]=new oe(e)),o.attachRootComponentToLogicalElement(n,t,r)}let me=!1,he=!1,pe=null;const ye={listenForNavigationEvents:function(e){pe=e,he||(he=!0,window.addEventListener("popstate",(()=>we(!1))))},enableNavigationInterception:function(){me=!0},navigateTo:ge,getBaseURI:()=>document.baseURI,getLocationHref:()=>location.href};function ge(e,t,n=!1){const r=Ee(e),o=t instanceof Object?t:{forceLoad:t,replaceHistoryEntry:n};!o.forceLoad&&Ie(r)?be(r,!1,o.replaceHistoryEntry):function(e,t){if(location.href===e){const t=e+"?";history.replaceState(null,"",t),location.replace(e)}else t?location.replace(e):location.href=e}(e,o.replaceHistoryEntry)}function be(e,t,n){de=!0,n?history.replaceState(null,"",e):history.pushState(null,"",e),we(t)}async function we(e){pe&&await pe(location.href,e)}let ve;function Ee(e){return ve=ve||document.createElement("a"),ve.href=e,ve.href}function _e(e,t){return e?e.tagName===t?e:_e(e.parentElement,t):null}function Ie(e){const t=(n=document.baseURI).substr(0,n.lastIndexOf("/")+1);var n;return e.startsWith(t)}const Ne={focus:function(e,t){if(e instanceof HTMLElement)e.focus({preventScroll:t});else{if(!(e instanceof SVGElement))throw new Error("Unable to focus an invalid element.");if(!e.hasAttribute("tabindex"))throw new Error("Unable to focus an SVG element that does not have a tabindex.");e.focus({preventScroll:t})}},focusBySelector:function(e){const t=document.querySelector(e);t&&(t.hasAttribute("tabindex")||(t.tabIndex=-1),t.focus())}},Ce={init:function(e,t,n,r=50){const o=Se(t);(o||document.documentElement).style.overflowAnchor="none";const s=new IntersectionObserver((function(r){r.forEach((r=>{var o;if(!r.isIntersecting)return;const s=t.getBoundingClientRect(),a=n.getBoundingClientRect().top-s.bottom,i=null===(o=r.rootBounds)||void 0===o?void 0:o.height;r.target===t?e.invokeMethodAsync("OnSpacerBeforeVisible",r.intersectionRect.top-r.boundingClientRect.top,a,i):r.target===n&&n.offsetHeight>0&&e.invokeMethodAsync("OnSpacerAfterVisible",r.boundingClientRect.bottom-r.intersectionRect.bottom,a,i)}))}),{root:o,rootMargin:`${r}px`});s.observe(t),s.observe(n);const a=c(t),i=c(n);function c(e){const t=new MutationObserver((()=>{s.unobserve(e),s.observe(e)}));return t.observe(e,{attributes:!0}),t}Ae[e._id]={intersectionObserver:s,mutationObserverBefore:a,mutationObserverAfter:i}},dispose:function(e){const t=Ae[e._id];t&&(t.intersectionObserver.disconnect(),t.mutationObserverBefore.disconnect(),t.mutationObserverAfter.disconnect(),e.dispose(),delete Ae[e._id])}},Ae={};function Se(e){return e?"visible"!==getComputedStyle(e).overflowY?e:Se(e.parentElement):null}const Re={getAndRemoveExistingTitle:function(){var e;const t=document.getElementsByTagName("title");if(0===t.length)return null;let n=null;for(let r=t.length-1;r>=0;r--){const o=t[r],s=o.previousSibling;s instanceof Comment&&null!==H(s)||(null===n&&(n=o.textContent),null===(e=o.parentNode)||void 0===e||e.removeChild(o))}return n}},De={init:function(e,t){t._blazorInputFileNextFileId=0,t.addEventListener("click",(function(){t.value=""})),t.addEventListener("change",(function(){t._blazorFilesById={};const n=Array.prototype.map.call(t.files,(function(e){const n={id:++t._blazorInputFileNextFileId,lastModified:new Date(e.lastModified).toISOString(),name:e.name,size:e.size,contentType:e.type,readPromise:void 0,arrayBuffer:void 0,blob:e};return t._blazorFilesById[n.id]=n,n}));e.invokeMethodAsync("NotifyChange",n)}))},toImageFile:async function(e,t,n,r,o){const s=ke(e,t),a=await new Promise((function(e){const t=new Image;t.onload=function(){e(t)},t.src=URL.createObjectURL(s.blob)})),i=await new Promise((function(e){var t;const s=Math.min(1,r/a.width),i=Math.min(1,o/a.height),c=Math.min(s,i),l=document.createElement("canvas");l.width=Math.round(a.width*c),l.height=Math.round(a.height*c),null===(t=l.getContext("2d"))||void 0===t||t.drawImage(a,0,0,l.width,l.height),l.toBlob(e,n)})),c={id:++e._blazorInputFileNextFileId,lastModified:s.lastModified,name:s.name,size:(null==i?void 0:i.size)||0,contentType:n,blob:i||s.blob};return e._blazorFilesById[c.id]=c,c},readFileData:async function(e,t){return ke(e,t).blob}};function ke(e,t){const n=e._blazorFilesById[t];if(!n)throw new Error(`There is no file with ID ${t}. The file list may have changed.`);return n}const Oe=new Map,Be={navigateTo:ge,registerCustomEventType:function(e,t){if(!t)throw new Error("The options parameter is required.");if(o.has(e))throw new Error(`The event '${e}' is already registered.`);if(t.browserEventName){const n=s.get(t.browserEventName);n?n.push(e):s.set(t.browserEventName,[e]),i.forEach((n=>n(e,t.browserEventName)))}o.set(e,t)},rootComponents:b,_internal:{navigationManager:ye,domWrapper:Ne,Virtualize:Ce,PageTitle:Re,InputFile:De,getJSDataStreamChunk:async function(e,t,n){return e instanceof Blob?await async function(e,t,n){const r=e.slice(t,t+n),o=await r.arrayBuffer();return new Uint8Array(o)}(e,t,n):function(e,t,n){return new Uint8Array(e.buffer,e.byteOffset+t,n)}(e,t,n)},receiveDotNetDataStream:function(t,n,r,o){let s=Oe.get(t);if(!s){const n=new ReadableStream({start(e){Oe.set(t,e),s=e}});e.jsCallDispatcher.supplyDotNetStream(t,n)}o?(s.error(o),Oe.delete(t)):0===r?(s.close(),Oe.delete(t)):s.enqueue(n.length===r?n:n.subarray(0,r))},attachWebRendererInterop:function(t,n,r,o){if(_.has(t))throw new Error(`Interop methods are already registered for renderer ${t}`);_.set(t,n),Object.keys(r).length>0&&function(t,n,r){if(p)throw new Error("Dynamic root components have already been enabled.");p=t,y=n;for(const[t,o]of Object.entries(r)){const r=e.jsCallDispatcher.findJSFunction(t,0);for(const e of o)r(e,n[e])}}(N(t),r,o)}}};let Fe;function Me(e){return Fe=e,Fe}window.Blazor=Be;const Te=window.chrome&&navigator.userAgent.indexOf("Edge")<0;let je=!1,Le=!1;function Pe(){return(je||Le)&&Te}let xe=!1;async function He(e=""){let t=document.querySelector("#blazor-error-ui");t&&(t.style.display="block",e&&t.firstChild&&(t.firstChild.textContent=`\n\t${e}\t\n`)),xe||(xe=!0,document.querySelectorAll("#blazor-error-ui .reload").forEach((e=>{e.onclick=function(e){location.reload(),e.preventDefault()}})),document.querySelectorAll("#blazor-error-ui .dismiss").forEach((e=>{e.onclick=function(e){const t=document.querySelector("#blazor-error-ui");t&&(t.style.display="none"),e.preventDefault()}})))}class $e{constructor(e,t){this.bootConfig=e,this.applicationEnvironment=t}static async initAsync(e,t){const n=void 0!==e?e("manifest","blazor.boot.json","_framework/blazor.boot.json",""):a("_framework/blazor.boot.json"),r=n instanceof Promise?await n:await a(null!=n?n:"_framework/blazor.boot.json"),o=t||r.headers.get("Blazor-Environment")||"Production",s=await r.json();return s.modifiableAssemblies=r.headers.get("DOTNET-MODIFIABLE-ASSEMBLIES"),new $e(s,o);async function a(e){return fetch(e,{method:"GET",credentials:"include",cache:"no-cache"})}}}var Je;let ze;!function(e){e[e.Sharded=0]="Sharded",e[e.All=1]="All",e[e.Invariant=2]="Invariant"}(Je||(Je={}));const Ue=Math.pow(2,32),Ge=Math.pow(2,21)-1;let We=null;function Ke(e){return Module.HEAP32[e>>2]}const Ve={start:function(t){return new Promise(((n,r)=>{(function(e){je=!!e.bootConfig.resources.pdb,Le=e.bootConfig.debugBuild;const t=navigator.platform.match(/^Mac/i)?"Cmd":"Alt";Pe()&&console.info(`Debugging hotkey: Shift+${t}+D (when application has focus)`),document.addEventListener("keydown",(e=>{e.shiftKey&&(e.metaKey||e.altKey)&&"KeyD"===e.code&&(Le||je?Te?function(){const e=document.createElement("a");e.href=`_framework/debug?url=${encodeURIComponent(location.href)}`,e.target="_blank",e.rel="noopener noreferrer",e.click()}():console.error("Currently, only Microsoft Edge (80+), or Google Chrome, are supported for debugging."):console.error("Cannot start debugging, because the application was not compiled with debugging enabled."))}))})(t),window.Browser={init:()=>{}},function(o){const s=document.createElement("script");window.__wasmmodulecallback__=()=>{window.Module=function(t,n,r){const o=t.bootConfig.resources,s=window.Module||{},a=["DEBUGGING ENABLED"];s.print=e=>a.indexOf(e)<0&&console.log(e),s.printErr=e=>{console.error(e),He()},s.preRun=s.preRun||[],s.postRun=s.postRun||[],s.preloadPlugins=[];const i="dotnet.wasm",c=t.loadResources(o.assembly,(e=>`_framework/${e}`),"assembly"),l=t.loadResources(o.pdb||{},(e=>`_framework/${e}`),"pdb"),u=t.loadResource(i,"_framework/dotnet.wasm",t.bootConfig.resources.runtime["dotnet.wasm"],"dotnetwasm"),d="dotnet.timezones.blat";let f,m;if(t.bootConfig.resources.runtime.hasOwnProperty(d)&&(f=t.loadResource(d,"_framework/dotnet.timezones.blat",t.bootConfig.resources.runtime["dotnet.timezones.blat"],"globalization")),t.bootConfig.icuDataMode!=Je.Invariant){const e=t.startOptions.applicationCulture||navigator.languages&&navigator.languages[0],n=function(e,t){if(!t||e.icuDataMode===Je.All)return"icudt.dat";const n=t.split("-")[0];return["en","fr","it","de","es"].includes(n)?"icudt_EFIGS.dat":["zh","ko","ja"].includes(n)?"icudt_CJK.dat":"icudt_no_CJK.dat"}(t.bootConfig,e);m=t.loadResource(n,`_framework/${n}`,t.bootConfig.resources.runtime[n],"globalization")}return s.instantiateWasm=(e,t)=>((async()=>{let n;try{const t=await u;n=await async function(e,t){if("function"==typeof WebAssembly.instantiateStreaming)try{return(await WebAssembly.instantiateStreaming(e.response,t)).instance}catch(e){console.info("Streaming compilation failed. Falling back to ArrayBuffer instantiation. ",e)}const n=await e.response.then((e=>e.arrayBuffer()));return(await WebAssembly.instantiate(n,t)).instance}(t,e)}catch(e){throw s.printErr(e),e}t(n)})(),[]),s.onRuntimeInitialized=()=>{m||MONO.mono_wasm_setenv("DOTNET_SYSTEM_GLOBALIZATION_INVARIANT","1")},s.preRun.push((()=>{ze=cwrap("mono_wasm_add_assembly",null,["string","number","number"]),MONO.loaded_files=[],f&&async function(e){const t="blazor:timezonedata";addRunDependency(t);const n=await e.response,r=await n.arrayBuffer();Module.FS_createPath("/","usr",!0,!0),Module.FS_createPath("/usr/","share",!0,!0),Module.FS_createPath("/usr/share/","zoneinfo",!0,!0),MONO.mono_wasm_load_data_archive(new Uint8Array(r),"/usr/share/zoneinfo/"),removeRunDependency(t)}(f),m&&async function(e){const t="blazor:icudata";addRunDependency(t);const n=await e.response,r=new Uint8Array(await n.arrayBuffer()),o=MONO.mono_wasm_load_bytes_into_heap(r);if(!MONO.mono_wasm_load_icu_data(o))throw new Error("Error loading ICU asset.");removeRunDependency(t)}(m),c.forEach((e=>h(e,Qe(e.name,".dll")))),l.forEach((e=>h(e,e.name))),Be._internal.dotNetCriticalError=e=>{s.printErr(BINDING.conv_string(e)||"(null)")},Be._internal.getSatelliteAssemblies=e=>{const n=BINDING.mono_array_to_js_array(e),r=t.bootConfig.resources.satelliteResources;if(t.startOptions.applicationCulture||navigator.languages&&navigator.languages[0],r){const e=Promise.all(n.filter((e=>r.hasOwnProperty(e))).map((e=>t.loadResources(r[e],(e=>`_framework/${e}`),"assembly"))).reduce(((e,t)=>e.concat(t)),new Array).map((async e=>(await e.response).arrayBuffer())));return BINDING.js_to_mono_obj(e.then((e=>(e.length&&(Be._internal.readSatelliteAssemblies=()=>{const t=BINDING.mono_obj_array_new(e.length);for(var n=0;n<e.length;n++)BINDING.mono_obj_array_set(t,n,BINDING.js_typed_array_to_array(new Uint8Array(e[n])));return t}),e.length))))}return BINDING.js_to_mono_obj(Promise.resolve(0))};const e={};Be._internal.getLazyAssemblies=n=>{const r=BINDING.mono_array_to_js_array(n),o=t.bootConfig.resources.lazyAssembly;if(!o)throw new Error("No assemblies have been marked as lazy-loadable. Use the 'BlazorWebAssemblyLazyLoad' item group in your project file to enable lazy loading an assembly.");var s=r.filter((e=>o.hasOwnProperty(e)));if(s.length!=r.length){var a=r.filter((e=>!s.includes(e)));throw new Error(`${a.join()} must be marked with 'BlazorWebAssemblyLazyLoad' item group in your project file to allow lazy-loading.`)}let i;if(Pe()){const e=t.bootConfig.resources.pdb,n=s.map((e=>Qe(e,".pdb")));e&&(i=Promise.all(n.map((e=>o.hasOwnProperty(e)?t.loadResource(e,`_framework/${e}`,o[e],"pdb"):null)).map((async e=>e?(await e.response).arrayBuffer():null))))}const c=Promise.all(s.map((e=>t.loadResource(e,`_framework/${e}`,o[e],"assembly"))).map((async e=>(await e.response).arrayBuffer())));return BINDING.js_to_mono_obj(Promise.all([c,i]).then((t=>(e.assemblies=t[0],e.pdbs=t[1],e.assemblies.length&&(Be._internal.readLazyAssemblies=()=>{const{assemblies:t}=e;if(!t)return BINDING.mono_obj_array_new(0);const n=BINDING.mono_obj_array_new(t.length);for(let e=0;e<t.length;e++){const r=t[e];BINDING.mono_obj_array_set(n,e,BINDING.js_typed_array_to_array(new Uint8Array(r)))}return n},Be._internal.readLazyPdbs=()=>{const{assemblies:t,pdbs:n}=e;if(!t)return BINDING.mono_obj_array_new(0);const r=BINDING.mono_obj_array_new(t.length);for(let e=0;e<t.length;e++){const t=n&&n[e]?new Uint8Array(n[e]):new Uint8Array;BINDING.mono_obj_array_set(r,e,BINDING.js_typed_array_to_array(t))}return r}),e.assemblies.length))))}})),s.postRun.push((()=>{t.bootConfig.debugBuild&&t.bootConfig.cacheBootResources&&t.logToConsole(),t.purgeUnusedCacheEntriesAsync(),t.bootConfig.icuDataMode===Je.Sharded&&(MONO.mono_wasm_setenv("__BLAZOR_SHARDED_ICU","1"),t.startOptions.applicationCulture&&MONO.mono_wasm_setenv("LANG",`${t.startOptions.applicationCulture}.UTF-8`));let r="UTC";try{r=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}MONO.mono_wasm_setenv("TZ",r||"UTC"),t.bootConfig.modifiableAssemblies&&MONO.mono_wasm_setenv("DOTNET_MODIFIABLE_ASSEMBLIES",t.bootConfig.modifiableAssemblies),cwrap("mono_wasm_load_runtime",null,["string","number"])("appBinDir",Pe()?-1:0),MONO.mono_wasm_runtime_ready(),function(){const t=qe("Microsoft.AspNetCore.Components.WebAssembly","Microsoft.AspNetCore.Components.WebAssembly.Services.DefaultWebAssemblyJSRuntime","InvokeDotNet"),n=qe("Microsoft.AspNetCore.Components.WebAssembly","Microsoft.AspNetCore.Components.WebAssembly.Services.DefaultWebAssemblyJSRuntime","BeginInvokeDotNet"),r=qe("Microsoft.AspNetCore.Components.WebAssembly","Microsoft.AspNetCore.Components.WebAssembly.Services.DefaultWebAssemblyJSRuntime","EndInvokeJS"),o=qe("Microsoft.AspNetCore.Components.WebAssembly","Microsoft.AspNetCore.Components.WebAssembly.Services.DefaultWebAssemblyJSRuntime","NotifyByteArrayAvailable");e.attachDispatcher({beginInvokeDotNetFromJS:(e,t,r,o,s)=>{if(et(),!o&&!t)throw new Error("Either assemblyName or dotNetObjectId must have a non null value.");const a=o?o.toString():t;n(e?e.toString():null,a,r,s)},endInvokeJSFromDotNet:(e,t,n)=>{r(n)},sendByteArray:(e,t)=>{Ze=t,o(e)},invokeDotNetFromJS:(e,n,r,o)=>(et(),t(e||null,n,r?r.toString():null,o))})}(),n()})),s;async function h(e,t){const n=`blazor:${e.name}`;addRunDependency(n);try{const n=await e.response.then((e=>e.arrayBuffer())),r=new Uint8Array(n),s=Module._malloc(r.length);new Uint8Array(Module.HEAPU8.buffer,s,r.length).set(r),ze(t,s,r.length),MONO.loaded_files.push((o=e.url,Xe.href=o,Xe.href))}catch(e){return void r(e)}var o;removeRunDependency(n)}}(t,n,r),function(e){if("undefined"==typeof WebAssembly||!WebAssembly.validate)throw new Error("This browser does not support WebAssembly.");const t=Object.keys(e.bootConfig.resources.runtime).filter((e=>e.startsWith("dotnet.")&&e.endsWith(".js")))[0],n=e.bootConfig.resources.runtime[t],r=document.createElement("script");if(r.src=`_framework/${t}`,r.defer=!0,e.bootConfig.cacheBootResources&&(r.integrity=n,r.crossOrigin="anonymous"),e.startOptions.loadBootResource){const o="dotnetjs",s=e.startOptions.loadBootResource(o,t,r.src,n);if("string"==typeof s)r.src=s;else if(s)throw new Error(`For a ${o} resource, custom loaders must supply a URI string.`)}document.body.appendChild(r)}(t)},s.text="var Module; window.__wasmmodulecallback__(); delete window.__wasmmodulecallback__;",document.body.appendChild(s)}()}))},callEntryPoint:async function(e){const t=[[]];try{await BINDING.call_assembly_entry_point(e,t,"m")}catch(e){console.error(e),He()}},toUint8Array:function(e){const t=Ye(e),n=Ke(t),r=new Uint8Array(n);return r.set(Module.HEAPU8.subarray(t+4,t+4+n)),r},getArrayLength:function(e){return Ke(Ye(e))},getArrayEntryPtr:function(e,t,n){return Ye(e)+4+t*n},getObjectFieldsBaseAddress:function(e){return e+8},readInt16Field:function(e,t){return n=e+(t||0),Module.HEAP16[n>>1];var n},readInt32Field:function(e,t){return Ke(e+(t||0))},readUint64Field:function(e,t){return function(e){const t=e>>2,n=Module.HEAPU32[t+1];if(n>Ge)throw new Error(`Cannot read uint64 with high order part ${n}, because the result would exceed Number.MAX_SAFE_INTEGER.`);return n*Ue+Module.HEAPU32[t]}(e+(t||0))},readFloatField:function(e,t){return n=e+(t||0),Module.HEAPF32[n>>2];var n},readObjectField:function(e,t){return Ke(e+(t||0))},readStringField:function(e,t,n){const r=Ke(e+(t||0));if(0===r)return null;if(n){const e=BINDING.unbox_mono_obj(r);return"boolean"==typeof e?e?"":null:e}let o;return We?(o=We.stringCache.get(r),void 0===o&&(o=BINDING.conv_string(r),We.stringCache.set(r,o))):o=BINDING.conv_string(r),o},readStructField:function(e,t){return e+(t||0)},beginHeapLock:function(){return et(),We=new tt,We},invokeWhenHeapUnlocked:function(e){We?We.enqueuePostReleaseAction(e):e()}},Xe=document.createElement("a");function Ye(e){return e+12}function qe(e,t,n){const r=`[${e}] ${t}:${n}`;return BINDING.bind_static_method(r)}let Ze=null;function Qe(e,t){const n=e.lastIndexOf(".");if(n<0)throw new Error(`No extension to replace in '${e}'`);return e.substr(0,n)+t}function et(){if(We)throw new Error("Assertion failed - heap is currently locked")}class tt{constructor(){this.stringCache=new Map}enqueuePostReleaseAction(e){this.postReleaseActions||(this.postReleaseActions=[]),this.postReleaseActions.push(e)}release(){var e;if(We!==this)throw new Error("Trying to release a lock which isn't current");for(We=null;null===(e=this.postReleaseActions)||void 0===e?void 0:e.length;)this.postReleaseActions.shift()(),et()}}class nt{constructor(e){this.batchAddress=e,this.arrayRangeReader=rt,this.arrayBuilderSegmentReader=ot,this.diffReader=st,this.editReader=at,this.frameReader=it}updatedComponents(){return Fe.readStructField(this.batchAddress,0)}referenceFrames(){return Fe.readStructField(this.batchAddress,rt.structLength)}disposedComponentIds(){return Fe.readStructField(this.batchAddress,2*rt.structLength)}disposedEventHandlerIds(){return Fe.readStructField(this.batchAddress,3*rt.structLength)}updatedComponentsEntry(e,t){return ct(e,t,st.structLength)}referenceFramesEntry(e,t){return ct(e,t,it.structLength)}disposedComponentIdsEntry(e,t){const n=ct(e,t,4);return Fe.readInt32Field(n)}disposedEventHandlerIdsEntry(e,t){const n=ct(e,t,8);return Fe.readUint64Field(n)}}const rt={structLength:8,values:e=>Fe.readObjectField(e,0),count:e=>Fe.readInt32Field(e,4)},ot={structLength:12,values:e=>{const t=Fe.readObjectField(e,0),n=Fe.getObjectFieldsBaseAddress(t);return Fe.readObjectField(n,0)},offset:e=>Fe.readInt32Field(e,4),count:e=>Fe.readInt32Field(e,8)},st={structLength:4+ot.structLength,componentId:e=>Fe.readInt32Field(e,0),edits:e=>Fe.readStructField(e,4),editsEntry:(e,t)=>ct(e,t,at.structLength)},at={structLength:20,editType:e=>Fe.readInt32Field(e,0),siblingIndex:e=>Fe.readInt32Field(e,4),newTreeIndex:e=>Fe.readInt32Field(e,8),moveToSiblingIndex:e=>Fe.readInt32Field(e,8),removedAttributeName:e=>Fe.readStringField(e,16)},it={structLength:36,frameType:e=>Fe.readInt16Field(e,4),subtreeLength:e=>Fe.readInt32Field(e,8),elementReferenceCaptureId:e=>Fe.readStringField(e,16),componentId:e=>Fe.readInt32Field(e,12),elementName:e=>Fe.readStringField(e,16),textContent:e=>Fe.readStringField(e,16),markupContent:e=>Fe.readStringField(e,16),attributeName:e=>Fe.readStringField(e,16),attributeValue:e=>Fe.readStringField(e,24,!0),attributeEventHandlerId:e=>Fe.readUint64Field(e,8)};function ct(e,t,n){return Fe.getArrayEntryPtr(e,t,n)}class lt{constructor(e,t,n){this.bootConfig=e,this.cacheIfUsed=t,this.startOptions=n,this.usedCacheKeys={},this.networkLoads={},this.cacheLoads={}}static async initAsync(e,t){const n=await async function(e){if(!e.cacheBootResources||"undefined"==typeof caches)return null;if(!1===window.isSecureContext)return null;const t=`blazor-resources-${document.baseURI.substring(document.location.origin.length)}`;try{return await caches.open(t)||null}catch{return null}}(e);return new lt(e,n,t)}loadResources(e,t,n){return Object.keys(e).map((r=>this.loadResource(r,t(r),e[r],n)))}loadResource(e,t,n,r){return{name:e,url:t,response:this.cacheIfUsed?this.loadResourceWithCaching(this.cacheIfUsed,e,t,n,r):this.loadResourceWithoutCaching(e,t,n,r)}}logToConsole(){const e=Object.values(this.cacheLoads),t=Object.values(this.networkLoads),n=ut(e),r=ut(t),o=n+r;if(0===o)return;const s=this.bootConfig.linkerEnabled?"%c":"\n%cThis application was built with linking (tree shaking) disabled. Published applications will be significantly smaller.";console.groupCollapsed(`%cblazor%c Loaded ${dt(o)} resources${s}`,"background: purple; color: white; padding: 1px 3px; border-radius: 3px;","font-weight: bold;","font-weight: normal;"),e.length&&(console.groupCollapsed(`Loaded ${dt(n)} resources from cache`),console.table(this.cacheLoads),console.groupEnd()),t.length&&(console.groupCollapsed(`Loaded ${dt(r)} resources from network`),console.table(this.networkLoads),console.groupEnd()),console.groupEnd()}async purgeUnusedCacheEntriesAsync(){const e=this.cacheIfUsed;if(e){const t=(await e.keys()).map((async t=>{t.url in this.usedCacheKeys||await e.delete(t)}));await Promise.all(t)}}async loadResourceWithCaching(e,t,n,r,o){if(!r||0===r.length)throw new Error("Content hash is required");const s=Ee(`${n}.${r}`);let a;this.usedCacheKeys[s]=!0;try{a=await e.match(s)}catch{}if(a){const e=parseInt(a.headers.get("content-length")||"0");return this.cacheLoads[t]={responseBytes:e},a}{const a=await this.loadResourceWithoutCaching(t,n,r,o);return this.addToCacheAsync(e,t,s,a),a}}loadResourceWithoutCaching(e,t,n,r){if(this.startOptions.loadBootResource){const o=this.startOptions.loadBootResource(r,e,t,n);if(o instanceof Promise)return o;"string"==typeof o&&(t=o)}return fetch(t,{cache:"no-cache",integrity:this.bootConfig.cacheBootResources?n:void 0})}async addToCacheAsync(e,t,n,r){const o=await r.clone().arrayBuffer(),s=function(e){if("undefined"!=typeof performance)return performance.getEntriesByName(e)[0]}(r.url),a=s&&s.encodedBodySize||void 0;this.networkLoads[t]={responseBytes:a};const i=new Response(o,{headers:{"content-type":r.headers.get("content-type")||"","content-length":(a||r.headers.get("content-length")||"").toString()}});try{await e.put(n,i)}catch{}}}function ut(e){return e.reduce(((e,t)=>e+(t.responseBytes||0)),0)}function dt(e){return`${(e/1048576).toFixed(2)} MB`}class ft{static async initAsync(e){Be._internal.getApplicationEnvironment=()=>BINDING.js_string_to_mono_string(e.applicationEnvironment);const t=await Promise.all((e.bootConfig.config||[]).filter((t=>"appsettings.json"===t||t===`appsettings.${e.applicationEnvironment}.json`)).map((async e=>({name:e,content:await n(e)}))));async function n(e){const t=await fetch(e,{method:"GET",credentials:"include",cache:"no-cache"});return new Uint8Array(await t.arrayBuffer())}Be._internal.getConfig=e=>{const n=BINDING.conv_string(e),r=t.find((e=>e.name===n));return r?BINDING.js_typed_array_to_array(r.content):void 0}}}class mt{constructor(e){this.preregisteredComponents=e;const t={};for(let n=0;n<e.length;n++){const r=e[n];t[r.id]=r}this.componentsById=t}resolveRegisteredElement(e){const t=Number.parseInt(e);return Number.isNaN(t)?void 0:function(e,t){if(!e.parentNode)throw new Error(`Comment not connected to the DOM ${e.textContent}`);const n=e.parentNode,r=j(n,!0),o=z(r);return Array.from(n.childNodes).forEach((e=>o.push(e))),e[M]=r,t&&(e[T]=t,j(t)),j(e)}(this.componentsById[t].start,this.componentsById[t].end)}getParameterValues(e){return this.componentsById[e].parameterValues}getParameterDefinitions(e){return this.componentsById[e].parameterDefinitions}getTypeName(e){return this.componentsById[e].typeName}getAssembly(e){return this.componentsById[e].assembly}getId(e){return this.preregisteredComponents[e].id}getCount(){return this.preregisteredComponents.length}}const ht=/^\s*Blazor-Component-State:(?<state>[a-zA-Z0-9\+\/=]+)$/;function pt(e){var t;if(e.nodeType===Node.COMMENT_NODE){const n=e.textContent||"",r=ht.exec(n),o=r&&r.groups&&r.groups.state;return o&&(null===(t=e.parentNode)||void 0===t||t.removeChild(e)),o}if(!e.hasChildNodes())return;const n=e.childNodes;for(let e=0;e<n.length;e++){const t=pt(n[e]);if(t)return t}}function yt(e,t){if(!e.hasChildNodes())return[];const n=[],r=new Et(e.childNodes);for(;r.next()&&r.currentElement;){const e=bt(r,t);if(e)n.push(e);else{const e=yt(r.currentElement,t);for(let t=0;t<e.length;t++){const r=e[t];n.push(r)}}}return n}const gt=new RegExp(/^\s*Blazor:[^{]*(?<descriptor>.*)$/);function bt(e,t){const n=e.currentElement;if(n&&n.nodeType===Node.COMMENT_NODE&&n.textContent){const r=gt.exec(n.textContent),o=r&&r.groups&&r.groups.descriptor;if(!o)return;try{const r=function(e){const t=JSON.parse(e),{type:n}=t;if("server"!==n&&"webassembly"!==n)throw new Error(`Invalid component type '${n}'.`);return t}(o);switch(t){case"webassembly":return function(e,t,n){const{type:r,assembly:o,typeName:s,parameterDefinitions:a,parameterValues:i,prerenderId:c}=e;if("webassembly"===r){if(!o)throw new Error("assembly must be defined when using a descriptor.");if(!s)throw new Error("typeName must be defined when using a descriptor.");if(c){const e=wt(c,n);if(!e)throw new Error(`Could not find an end component comment for '${t}'`);return{type:r,assembly:o,typeName:s,parameterDefinitions:a&&atob(a),parameterValues:i&&atob(i),start:t,prerenderId:c,end:e}}return{type:r,assembly:o,typeName:s,parameterDefinitions:a&&atob(a),parameterValues:i&&atob(i),start:t}}}(r,n,e);case"server":return function(e,t,n){const{type:r,descriptor:o,sequence:s,prerenderId:a}=e;if("server"===r){if(!o)throw new Error("descriptor must be defined when using a descriptor.");if(void 0===s)throw new Error("sequence must be defined when using a descriptor.");if(!Number.isInteger(s))throw new Error(`Error parsing the sequence '${s}' for component '${JSON.stringify(e)}'`);if(a){const e=wt(a,n);if(!e)throw new Error(`Could not find an end component comment for '${t}'`);return{type:r,sequence:s,descriptor:o,start:t,prerenderId:a,end:e}}return{type:r,sequence:s,descriptor:o,start:t}}}(r,n,e)}}catch(e){throw new Error(`Found malformed component comment at ${n.textContent}`)}}}function wt(e,t){for(;t.next()&&t.currentElement;){const n=t.currentElement;if(n.nodeType!==Node.COMMENT_NODE)continue;if(!n.textContent)continue;const r=gt.exec(n.textContent),o=r&&r[1];if(o)return vt(o,e),n}}function vt(e,t){const n=JSON.parse(e);if(1!==Object.keys(n).length)throw new Error(`Invalid end of component comment: '${e}'`);const r=n.prerenderId;if(!r)throw new Error(`End of component comment must have a value for the prerendered property: '${e}'`);if(r!==t)throw new Error(`End of component comment prerendered property must match the start comment prerender id: '${t}', '${r}'`)}class Et{constructor(e){this.childNodes=e,this.currentIndex=-1,this.length=e.length}next(){return this.currentIndex++,this.currentIndex<this.length?(this.currentElement=this.childNodes[this.currentIndex],!0):(this.currentElement=void 0,!1)}}class _t{constructor(e,t,n,r,o,s,a){this.id=_t.globalId++,this.type=e,this.assembly=r,this.typeName=o,this.parameterDefinitions=s,this.parameterValues=a,this.start=t,this.end=n}}_t.globalId=1;class It{constructor(){this.afterStartedCallbacks=[]}async importInitializersAsync(e,t){await Promise.all(e.map((e=>async function(e,n){const r=function(e){const t=document.baseURI;return t.endsWith("/")?`${t}${e}`:`${t}/${e}`}(n),o=await import(r);if(void 0===o)return;const{beforeStart:s,afterStarted:a}=o;return a&&e.afterStartedCallbacks.push(a),s?s(...t):void 0}(this,e))))}async invokeAfterStartedCallbacks(e){await Promise.all(this.afterStartedCallbacks.map((t=>t(e))))}}let Nt=!1;async function Ct(t){if(Nt)throw new Error("Blazor has already started.");Nt=!0,C=(e,t,n)=>{(function(e){return ue[e]})(e).eventDelegator.getHandler(t)&&Ve.invokeWhenHeapUnlocked(n)},Be._internal.applyHotReload=(t,n,r)=>{e.invokeMethod("Microsoft.AspNetCore.Components.WebAssembly","ApplyHotReloadDelta",t,n,r)},Be._internal.getApplyUpdateCapabilities=()=>e.invokeMethod("Microsoft.AspNetCore.Components.WebAssembly","GetApplyUpdateCapabilities"),Be._internal.invokeJSFromDotNet=At,Be._internal.endInvokeDotNetFromJS=St,Be._internal.receiveByteArray=Rt,Be._internal.retrieveByteArray=Dt;const n=Me(Ve);Be.platform=n,Be._internal.renderBatch=(e,t)=>{const n=Ve.beginHeapLock();try{!function(e,t){const n=ue[e];if(!n)throw new Error(`There is no browser renderer with ID ${e}.`);const r=t.arrayRangeReader,o=t.updatedComponents(),s=r.values(o),a=r.count(o),i=t.referenceFrames(),c=r.values(i),l=t.diffReader;for(let e=0;e<a;e++){const r=t.updatedComponentsEntry(s,e),o=l.componentId(r),a=l.edits(r);n.updateComponent(t,o,a,c)}const u=t.disposedComponentIds(),d=r.values(u),f=r.count(u);for(let e=0;e<f;e++){const r=t.disposedComponentIdsEntry(d,e);n.disposeComponent(r)}const m=t.disposedEventHandlerIds(),h=r.values(m),p=r.count(m);for(let e=0;e<p;e++){const r=t.disposedEventHandlerIdsEntry(h,e);n.disposeEventHandler(r)}de&&(de=!1,window.scrollTo&&window.scrollTo(0,0))}(e,new nt(t))}finally{n.release()}};const r=Be._internal.navigationManager.getBaseURI,o=Be._internal.navigationManager.getLocationHref;Be._internal.navigationManager.getUnmarshalledBaseURI=()=>BINDING.js_string_to_mono_string(r()),Be._internal.navigationManager.getUnmarshalledLocationHref=()=>BINDING.js_string_to_mono_string(o()),Be._internal.navigationManager.listenForNavigationEvents((async(t,n)=>{await e.invokeMethodAsync("Microsoft.AspNetCore.Components.WebAssembly","NotifyLocationChanged",t,n)}));const s=null!=t?t:{},a=s.environment,i=$e.initAsync(s.loadBootResource,a),c=function(e,t){return function(e){const t=yt(e,"webassembly"),n=[];for(let e=0;e<t.length;e++){const r=t[e],o=new _t(r.type,r.start,r.end,r.assembly,r.typeName,r.parameterDefinitions,r.parameterValues);n.push(o)}return n.sort(((e,t)=>e.id-t.id))}(e)}(document),l=new mt(c);Be._internal.registeredComponents={getRegisteredComponentsCount:()=>l.getCount(),getId:e=>l.getId(e),getAssembly:e=>BINDING.js_string_to_mono_string(l.getAssembly(e)),getTypeName:e=>BINDING.js_string_to_mono_string(l.getTypeName(e)),getParameterDefinitions:e=>BINDING.js_string_to_mono_string(l.getParameterDefinitions(e)||""),getParameterValues:e=>BINDING.js_string_to_mono_string(l.getParameterValues(e)||"")},Be._internal.getPersistedState=()=>BINDING.js_string_to_mono_string(pt(document)||""),Be._internal.attachRootComponentToElement=(e,t,n)=>{const r=l.resolveRegisteredElement(e);r?fe(n,r,t,!1):function(e,t,n){const r="::after";let o=!1;if(e.endsWith(r))e=e.slice(0,-r.length),o=!0;else if(e.endsWith("::before"))throw new Error("The '::before' selector is not supported.");const s=function(e){const t=h.get(e);if(t)return h.delete(e),t}(e)||document.querySelector(e);if(!s)throw new Error(`Could not find any element matching selector '${e}'.`);fe(n||0,j(s,!0),t,o)}(e,t,n)};const u=await i,d=await async function(e,t){const n=e.resources.libraryInitializers,r=new It;return n&&await r.importInitializersAsync(Object.keys(n),[t,e.resources.extensions]),r}(u.bootConfig,s),[f]=await Promise.all([lt.initAsync(u.bootConfig,s||{}),ft.initAsync(u)]);try{await n.start(f)}catch(e){throw new Error(`Failed to start platform. Reason: ${e}`)}n.callEntryPoint(f.bootConfig.entryAssembly),d.invokeAfterStartedCallbacks(Be)}function At(t,n,r,o){const s=Ve.readStringField(t,0),a=Ve.readInt32Field(t,4),i=Ve.readStringField(t,8),c=Ve.readUint64Field(t,20);if(null!==i){const n=Ve.readUint64Field(t,12);if(0!==n)return e.jsCallDispatcher.beginInvokeJSFromDotNet(n,s,i,a,c),0;{const t=e.jsCallDispatcher.invokeJSFromDotNet(s,i,a,c);return null===t?0:BINDING.js_string_to_mono_string(t)}}{const t=e.jsCallDispatcher.findJSFunction(s,c).call(null,n,r,o);switch(a){case e.JSCallResultType.Default:return t;case e.JSCallResultType.JSObjectReference:return e.createJSObjectReference(t).__jsObjectId;case e.JSCallResultType.JSStreamReference:const n=e.createJSStreamReference(t),r=JSON.stringify(n);return BINDING.js_string_to_mono_string(r);default:throw new Error(`Invalid JS call result type '${a}'.`)}}}function St(t,n,r){const o=BINDING.conv_string(t),s=0!==n,a=BINDING.conv_string(r);e.jsCallDispatcher.endInvokeDotNetFromJS(o,s,a)}function Rt(t,n){const r=t,o=Ve.toUint8Array(n);e.jsCallDispatcher.receiveByteArray(r,o)}function Dt(){if(null===Ze)throw new Error("Byte array not available for transfer");return BINDING.js_typed_array_to_array(Ze)}Be.start=Ct,document&&document.currentScript&&"false"!==document.currentScript.getAttribute("autostart")&&Ct().catch((e=>{"undefined"!=typeof Module&&Module.printErr?Module.printErr(e):console.error(e)}))})();
|
|
|
|
|