PageSourceSearch

https://www.cheshirewestandchester.gov.uk/_Nl7gMQ_7d09d6bc-3417-44…/js/oidcclient.b7df21d40595b6d442f1.mjs

js cheshirewestandchester.gov.uk collected 2026-09-24 08:58:14 UTC 285,663 bytes, 101 lines download raw bytes

1"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[13],{7(nr){(function(S,q){if(!0)nr.exports=q();else var D,l})(this,function(){return function(at){var S={};function q(D){if(S[D])return S[D].exports;var l=S[D]={i:D,l:!1,exports:{}};return at[D].call(l.exports,l,l.exports,q),l.l=!0,l.exports}return q.m=at,q.c=S,q.d=function(D,l,T){q.o(D,l)||Object.defineProperty(D,l,{enumerable:!0,get:T})},q.r=function(D){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(D,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(D,"__esModule",{value:!0})},q.t=function(D,l){if(1&l&&(D=q(D)),8&l||4&l&&typeof D=="object"&&D&&D.__esModule)return D;var T=Object.create(null);if(q.r(T),Object.defineProperty(T,"default",{enumerable:!0,value:D}),2&l&&typeof D!="string")for(var y in D)q.d(T,y,function(a){return D[a]}.bind(null,y));return T},q.n=function(D){var l=D&&D.__esModule?function(){return D.default}:function(){return D};return q.d(l,"a",l),l},q.o=function(D,l){return Object.prototype.hasOwnProperty.call(D,l)},q.p="",q(q.s=22)}([function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0});var D=function(){function a(u,o){for(var d=0;d<o.length;d++){var k=o[d];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(u,k.key,k)}}return function(u,o,d){return o&&a(u.prototype,o),d&&a(u,d),u}}(),l={debug:function(){},info:function(){},warn:function(){},error:function(){}},T=void 0,y=void 0;(S.Log=function(){function a(){(function(o,d){if(!(o instanceof d))throw new TypeError("Cannot call a class as a function")})(this,a)}return a.reset=function(){y=3,T=l},a.debug=function(){if(y>=4){for(var o=arguments.length,d=Array(o),k=0;k<o;k++)d[k]=arguments[k];T.debug.apply(T,Array.from(d))}},a.info=function(){if(y>=3){for(var o=arguments.length,d=Array(o),k=0;k<o;k++)d[k]=arguments[k];T.info.apply(T,Array.from(d))}},a.warn=function(){if(y>=2){for(var o=arguments.length,d=Array(o),k=0;k<o;k++)d[k]=arguments[k];T.warn.apply(T,Array.from(d))}},a.error=function(){if(y>=1){for(var o=arguments.length,d=Array(o),k=0;k<o;k++)d[k]=arguments[k];T.error.apply(T,Array.from(d))}},D(a,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 y},set:function(o){if(!(0<=o&&o<=4))throw new Error("Invalid log level");y=o}},{key:"logger",get:function(){return T},set:function(o){if(!o.debug&&o.info&&(o.debug=o.info),!(o.debug&&o.info&&o.warn&&o.error))throw new Error("Invalid logger");T=o}}]),a}()).reset()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0});var D=function(){function a(u,o){for(var d=0;d<o.length;d++){var k=o[d];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(u,k.key,k)}}return function(u,o,d){return o&&a(u.prototype,o),d&&a(u,d),u}}(),l={setInterval:function(a){function u(o,d){return a.apply(this,arguments)}return u.toString=function(){return a.toString()},u}(function(a,u){return setInterval(a,u)}),clearInterval:function(a){function u(o){return a.apply(this,arguments)}return u.toString=function(){return a.toString()},u}(function(a){return clearInterval(a)})},T=!1,y=null;S.Global=function(){function a(){(function(o,d){if(!(o instanceof d))throw new TypeError("Cannot call a class as a function")})(this,a)}return a._testing=function(){T=!0},a.setXMLHttpRequest=function(o){y=o},D(a,null,[{key:"location",get:function(){if(!T)return location}},{key:"localStorage",get:function(){if(!T&&typeof window!="undefined")return localStorage}},{key:"sessionStorage",get:function(){if(!T&&typeof window!="undefined")return sessionStorage}},{key:"XMLHttpRequest",get:function(){if(!T&&typeof window!="undefined")return y||XMLHttpRequest}},{key:"timer",get:function(){if(!T)return l}}]),a}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.MetadataService=void 0;var D=function(){function u(o,d){for(var k=0;k<d.length;k++){var w=d[k];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(o,w.key,w)}}return function(o,d,k){return d&&u(o.prototype,d),k&&u(o,k),o}}(),l=q(0),T=q(7);function y(u,o){if(!(u instanceof o))throw new TypeError("Cannot call a class as a function")}var a=".well-known/openid-configuration";S.MetadataService=function(){function u(o){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:T.JsonService;if(y(this,u),!o)throw l.Log.error("MetadataService: No settings passed to MetadataService"),new Error("settings");this._settings=o,this._jsonService=new d(["application/jwk-set+json"])}return u.prototype.resetSigningKeys=function(){this._settings=this._settings||{},this._settings.signingKeys=void 0},u.prototype.getMetadata=function(){var d=this;return this._settings.metadata?(l.Log.debug("MetadataService.getMetadata: Returning metadata from settings"),Promise.resolve(this._settings.metadata)):this.metadataUrl?(l.Log.debug("MetadataService.getMetadata: getting metadata from",this.metadataUrl),this._jsonService.getJson(this.metadataUrl).then(function(k){l.
1Log.debug("MetadataService.getMetadata: json received");var w=d._settings.metadataSeed||{};return d._settings.metadata=Object.assign({},w,k),d._settings.metadata})):(l.Log.error("MetadataService.getMetadata: No authority or metadataUrl configured on settings"),Promise.reject(new Error("No authority or metadataUrl configured on settings")))},u.prototype.getIssuer=function(){return this._getMetadataProperty("issuer")},u.prototype.getAuthorizationEndpoint=function(){return this._getMetadataProperty("authorization_endpoint")},u.prototype.getUserInfoEndpoint=function(){return this._getMetadataProperty("userinfo_endpoint")},u.prototype.getTokenEndpoint=function(){var d=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];return this._getMetadataProperty("token_endpoint",d)},u.prototype.getCheckSessionIframe=function(){return this._getMetadataProperty("check_session_iframe",!0)},u.prototype.getEndSessionEndpoint=function(){return this._getMetadataProperty("end_session_endpoint",!0)},u.prototype.getRevocationEndpoint=function(){return this._getMetadataProperty("revocation_endpoint",!0)},u.prototype.getKeysEndpoint=function(){return this._getMetadataProperty("jwks_uri",!0)},u.prototype._getMetadataProperty=function(d){var k=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return l.Log.debug("MetadataService.getMetadataProperty for: "+d),this.getMetadata().then(function(w){if(l.Log.debug("MetadataService.getMetadataProperty: metadata recieved"),w[d]===void 0){if(k===!0)return void l.Log.warn("MetadataService.getMetadataProperty: Metadata does not contain optional property "+d);throw l.Log.error("MetadataService.getMetadataProperty: Metadata does not contain property "+d),new Error("Metadata does not contain property "+d)}return w[d]})},u.prototype.getSigningKeys=function(){var d=this;return this._settings.signingKeys?(l.Log.debug("MetadataService.getSigningKeys: Returning signingKeys from settings"),Promise.resolve(this._settings.signingKeys)):this._getMetadataProperty("jwks_uri").then(function(k){return l.Log.debug("MetadataService.getSigningKeys: jwks_uri received",k),d._jsonService.getJson(k).then(function(w){if(l.Log.debug("MetadataService.getSigningKeys: key set received",w),!w.keys)throw l.Log.error("MetadataService.getSigningKeys: Missing keys on keyset"),new Error("Missing keys on keyset");return d._settings.signingKeys=w.keys,d._settings.signingKeys})})},D(u,[{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(a)<0&&(this._metadataUrl[this._metadataUrl.length-1]!=="/"&&(this._metadataUrl+="/"),this._metadataUrl+=a))),this._metadataUrl}}]),u}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.UrlUtility=void 0;var D=q(0),l=q(1);S.UrlUtility=function(){function T(){(function(a,u){if(!(a instanceof u))throw new TypeError("Cannot call a class as a function")})(this,T)}return T.addQueryParam=function(a,u,o){return a.indexOf("?")<0&&(a+="?"),a[a.length-1]!=="?"&&(a+="&"),a+=encodeURIComponent(u),a+="=",a+=encodeURIComponent(o)},T.parseUrlFragment=function(a){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"#",o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.Global;typeof a!="string"&&(a=o.location.href);var d=a.lastIndexOf(u);d>=0&&(a=a.substr(d+1)),u==="?"&&(d=a.indexOf("#"))>=0&&(a=a.substr(0,d));for(var k,w={},j=/([^&=]+)=([^&]*)/g,P=0;k=j.exec(a);)if(w[decodeURIComponent(k[1])]=decodeURIComponent(k[2].replace(/\+/g," ")),P++>50)return D.Log.error("UrlUtility.parseUrlFragment: response exceeded expected number of parameters",a),{error:"Response exceeded expected number of parameters"};for(var A in w)return w;return{}},T}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.JoseUtil=void 0;var D=q(26),l=function(y){return y&&y.__esModule?y:{default:y}}(q(33));S.JoseUtil=(0,l.default)({jws:D.jws,KeyUtil:D.KeyUtil,X509:D.X509,crypto:D.crypto,hextob64u:D.hextob64u,b64tohex:D.b64tohex,AllowedSigningAlgs:D.AllowedSigningAlgs})},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.OidcClientSettings=void 0;var D=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},l=function(){function A(F,U){for(var Y=0;Y<U.length;Y++){var O=U[Y];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(F,O.key,O)}}return function(F,U,Y){return U&&A(F.prototype,U),Y&&A(F,Y),F}}(),T=q(0),y=q(23),a=q(6),u=q(24),o=q(2);function d(A,F){if(!(A instanceof F))throw new TypeError("Cannot call a class as a function")}var k=".well-known/openid-configuration",w="id_token",j="openid",P="client_secret_post";S.OidcClientSettings=function(){function A(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},U=F.authority,Y=F.metadataUrl,O=F.metadata,V=F.signingKeys,B=F.metadataSeed,$=F.client_id,et=F.client_secret,nt=F.response_type,H=nt===void 0?w:nt,ut=F.scope,_t=ut===void 0?j:ut,wt=F.redirect_uri,jt=F.post_logout_redirect_uri,xt=F.client_authentication,Zt=xt===void 0?P:xt,Tt=F.prompt,gt=F.display,dt=F.max_age,At=F.ui_locales,Wt=F.acr_values,Kt=F.resource,zt=F.response_mode,$t=F.filterProtocolClaims,ce=$t===void 0||$t,ee=F.loadUserInfo,Ut=ee===void 0||ee,Yt=F.staleStateAge,Vt=Yt===void 0?900:Yt,N=F.clockSkew,c=N===void 0?300:N,h=F.clockService,L=h===void 0?new y.ClockService:h,K=F.userInfoJwtIssuer,J=K===void 0?"OP":K,Z=F.mergeClaims,ot=Z!==void 0&&Z,lt=F.stateStore,yt=lt===void 0?new a.WebStorageStateStore:lt,pt=F.ResponseValidatorCtor,Pt=pt===void 0?u.ResponseValidator:pt,Mt=F.MetadataServiceCtor,Gt=Mt===void 0?o.MetadataService:Mt,ne=F.extraQueryParams,ht=ne===void 0?{}:ne,kt=F.extraTokenParams,vt=kt===void 0?{}:kt;d(this,A),this._authority=U,this._metadataUrl=Y,this._metadata=O,this._metadataSeed=B,this._signingKeys=V,this._client_id=$,this._client_secret=et,this._response_type=H,this._scope=_t,this._redirect_uri=wt,this._post_logout_redirect_uri=jt,this._client_authentication=Zt,this._prompt=Tt,this._display=gt,this._max_age=dt,this._ui_locales=At,this._acr_values=Wt,this._resource=Kt,this._response_mode=zt,this._filterProtocolClaims=!!ce,this._loadUserInfo=!!Ut,this._staleStateAge=Vt,this._clockSkew=c,this._clockService=L,this._userInfoJwtIssuer=J,this._mergeClaims=!!ot,this._stateStore=yt,this._val
1idator=new Pt(this),this._metadataService=new Gt(this),this._extraQueryParams=(ht===void 0?"undefined":D(ht))==="object"?ht:{},this._extraTokenParams=(vt===void 0?"undefined":D(vt))==="object"?vt:{}}return A.prototype.getEpochTime=function(){return this._clockService.getEpochTime()},l(A,[{key:"client_id",get:function(){return this._client_id},set:function(U){if(this._client_id)throw T.Log.error("OidcClientSettings.set_client_id: client_id has already been assigned."),new Error("client_id has already been assigned.");this._client_id=U}},{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(U){if(this._authority)throw T.Log.error("OidcClientSettings.set_authority: authority has already been assigned."),new Error("authority has already been assigned.");this._authority=U}},{key:"metadataUrl",get:function(){return this._metadataUrl||(this._metadataUrl=this.authority,this._metadataUrl&&this._metadataUrl.indexOf(k)<0&&(this._metadataUrl[this._metadataUrl.length-1]!=="/"&&(this._metadataUrl+="/"),this._metadataUrl+=k)),this._metadataUrl}},{key:"metadata",get:function(){return this._metadata},set:function(U){this._metadata=U}},{key:"metadataSeed",get:function(){return this._metadataSeed},set:function(U){this._metadataSeed=U}},{key:"signingKeys",get:function(){return this._signingKeys},set:function(U){this._signingKeys=U}},{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(U){(U===void 0?"undefined":D(U))==="object"?this._extraQueryParams=U:this._extraQueryParams={}}},{key:"extraTokenParams",get:function(){return this._extraTokenParams},set:function(U){(U===void 0?"undefined":D(U))==="object"?this._extraTokenParams=U:this._extraTokenParams={}}}]),A}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.WebStorageStateStore=void 0;var D=q(0),l=q(1);function T(y,a){if(!(y instanceof a))throw new TypeError("Cannot call a class as a function")}S.WebStorageStateStore=function(){function y(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},u=a.prefix,o=u===void 0?"oidc.":u,d=a.store,k=d===void 0?l.Global.localStorage:d;T(this,y),this._store=k,this._prefix=o}return y.prototype.set=function(u,o){return D.Log.debug("WebStorageStateStore.set",u),u=this._prefix+u,this._store.setItem(u,o),Promise.resolve()},y.prototype.get=function(u){D.Log.debug("WebStorageStateStore.get",u),u=this._prefix+u;var o=this._store.getItem(u);return Promise.resolve(o)},y.prototype.remove=function(u){D.Log.debug("WebStorageStateStore.remove",u),u=this._prefix+u;var o=this._store.getItem(u);return this._store.removeItem(u),Promise.resolve(o)},y.prototype.getAllKeys=function(){D.Log.debug("WebStorageStateStore.getAllKeys");for(var u=[],o=0;o<this._store.length;o++){var d=this._store.key(o);d.indexOf(this._prefix)===0&&u.push(d.substr(this._prefix.length))}return Promise.resolve(u)},y}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.JsonService=void 0;var D=q(0),l=q(1);function T(y,a){if(!(y instanceof a))throw new TypeError("Cannot call a class as a function")}S.JsonService=function(){function y(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l.Global.XMLHttpRequest,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;T(this,y),a&&Array.isArray(a)?this._contentTypes=a.slice():this._contentTypes=[],this._contentTypes.push("application/json"),o&&this._contentTypes.push("application/jwt"),this._XMLHttpRequest=u,this._jwtHandler=o}return y.prototype.getJson=function(u,o){var d=this;if(!u)throw D.Log.error("JsonService.getJson: No url passed"),new Error("url");return D.Log.debug("JsonService.getJson, url: ",u),new Promise(function(k,w){var j=new d._XMLHttpRequest;j.open("GET",u);var P=d._contentTypes,A=d._jwtHandler;j.onload=function(){if(D.Log.debug("JsonService.getJson: HTTP response received, status",j.status),j.status===200){var F=j.getResponseHeader("Content-Type");if(F){var U=P.find(function(Y){if(F.startsWith(Y))return!0});if(U=="application/jwt")return void A(j).then(k,w);if(U)try{return void k(JSON.parse(j.responseText))}catch(Y){return D.Log.error("JsonService.getJson: Error parsing JSON response",Y.message),void w(Y)}}w(Error("Invalid response Content-Type: "+F+", from URL: "+u))}else w(Error(j.statusText+" ("+j.status+")"))},j.onerror=function(){D.Log.error("JsonService.getJson: network error"),w(Error("Network Error"))},o&&(D.Log.debug("JsonService.getJson: token passed, setting Authorization header"),j.setRequestHeader("Authorization","Bearer "+o)),j.send()})},y.prototype.postForm=function(u,o,d){var k=this;if(!u)throw D.Log.error("JsonService.postForm: No url passed"),new Error("url");return D.Log.debug("JsonService.postForm, url: ",u),new Promise(function(w,j){var P=new k._XMLHttpRequest;P.open("POST",u);var A=k._contentTypes;P.onload=function(){if(D.Log.debug("JsonService.postForm: HTTP response received, status",P.status),P.status!==200){if(P.status===400&&(V=P.getResponseHeader("Content-Type"))&&A.find(function(B){if(V.startsWith(B))return!0}))try{var O=JSON.parse(P.responseText);if(O&&O.error)return D.Log.error("JsonService.postForm: Error from server: ",O.error),void j(new Error(O.error))}catch(B){return D.Log.error("JsonService.postForm: Error parsing JSON response",B.message),void j(B)}j(Error(P.statusText+" ("+P.status+")"))}else{var V;if((V=P.getResponseHeader("Content-Type"))&&A.find(function(B){if(V.startsWith(B))return!0}))try{return void w(JSON.parse(P.responseText))}catch(B){return D.Log.error("JsonService.postForm: Error parsing JSON response",B.message),void j(B)}j(Error("Invalid response Content-Type: "+V+", from URL: "+u))}},P.onerror=function(){D.Log.error("JsonService.postForm: network error"),j(Error("Network Error"))};var F="";for(var U in o){var Y=o[U];Y&&(F.length>0&&(F+="&"),F+=encodeURIComponent(U),F+="=",F+=encodeURIComponent(Y))}P.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),d!==void 0&&P.setRequestHeader("Authorization","Basic "+btoa(d)),P.send(F)})},y}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.SigninRequest=void 0;var D=q(0),l=q(3),T=q(13);S.SigninRequest=function(){function y(a){var u=a.url,o=a.client_id,d=a.redirect_uri,k=a.response_type,w=a.scope,j=a.authority,P=a.data,A=a.prompt,F=a.display,U=a.max_age,Y=a.ui_locales,O=a.id_token_hint,V=a.login_hint,B=a.acr_values,$=a.resource,et=a.response_mode,nt=a.request,H=a.request_uri,ut=a.extraQueryParams,_t=a.request_type,wt=a.client_secret,jt=a.extraTokenParams,xt=a.skipUserInfo;
1if(function(Kt,zt){if(!(Kt instanceof zt))throw new TypeError("Cannot call a class as a function")}(this,y),!u)throw D.Log.error("SigninRequest.ctor: No url passed"),new Error("url");if(!o)throw D.Log.error("SigninRequest.ctor: No client_id passed"),new Error("client_id");if(!d)throw D.Log.error("SigninRequest.ctor: No redirect_uri passed"),new Error("redirect_uri");if(!k)throw D.Log.error("SigninRequest.ctor: No response_type passed"),new Error("response_type");if(!w)throw D.Log.error("SigninRequest.ctor: No scope passed"),new Error("scope");if(!j)throw D.Log.error("SigninRequest.ctor: No authority passed"),new Error("authority");var Zt=y.isOidc(k),Tt=y.isCode(k);et||(et=y.isCode(k)?"query":null),this.state=new T.SigninState({nonce:Zt,data:P,client_id:o,authority:j,redirect_uri:d,code_verifier:Tt,request_type:_t,response_mode:et,client_secret:wt,scope:w,extraTokenParams:jt,skipUserInfo:xt}),u=l.UrlUtility.addQueryParam(u,"client_id",o),u=l.UrlUtility.addQueryParam(u,"redirect_uri",d),u=l.UrlUtility.addQueryParam(u,"response_type",k),u=l.UrlUtility.addQueryParam(u,"scope",w),u=l.UrlUtility.addQueryParam(u,"state",this.state.id),Zt&&(u=l.UrlUtility.addQueryParam(u,"nonce",this.state.nonce)),Tt&&(u=l.UrlUtility.addQueryParam(u,"code_challenge",this.state.code_challenge),u=l.UrlUtility.addQueryParam(u,"code_challenge_method","S256"));var gt={prompt:A,display:F,max_age:U,ui_locales:Y,id_token_hint:O,login_hint:V,acr_values:B,resource:$,request:nt,request_uri:H,response_mode:et};for(var dt in gt)gt[dt]&&(u=l.UrlUtility.addQueryParam(u,dt,gt[dt]));for(var At in ut)u=l.UrlUtility.addQueryParam(u,At,ut[At]);this.url=u}return y.isOidc=function(u){return!!u.split(/\s+/g).filter(function(o){return o==="id_token"})[0]},y.isOAuth=function(u){return!!u.split(/\s+/g).filter(function(o){return o==="token"})[0]},y.isCode=function(u){return!!u.split(/\s+/g).filter(function(o){return o==="code"})[0]},y}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.State=void 0;var D=function(){function a(u,o){for(var d=0;d<o.length;d++){var k=o[d];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(u,k.key,k)}}return function(u,o,d){return o&&a(u.prototype,o),d&&a(u,d),u}}(),l=q(0),T=function(u){return u&&u.__esModule?u:{default:u}}(q(14));function y(a,u){if(!(a instanceof u))throw new TypeError("Cannot call a class as a function")}S.State=function(){function a(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=u.id,d=u.data,k=u.created,w=u.request_type;y(this,a),this._id=o||(0,T.default)(),this._data=d,this._created=typeof k=="number"&&k>0?k:parseInt(Date.now()/1e3),this._request_type=w}return a.prototype.toStorageString=function(){return l.Log.debug("State.toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})},a.fromStorageString=function(o){return l.Log.debug("State.fromStorageString"),new a(JSON.parse(o))},a.clearStaleState=function(o,d){var k=Date.now()/1e3-d;return o.getAllKeys().then(function(w){l.Log.debug("State.clearStaleState: got keys",w);for(var j=[],P=function(Y){var O=w[Y];F=o.get(O).then(function(V){var B=!1;if(V)try{var $=a.fromStorageString(V);l.Log.debug("State.clearStaleState: got item from key: ",O,$.created),$.created<=k&&(B=!0)}catch(et){l.Log.error("State.clearStaleState: Error parsing state for key",O,et.message),B=!0}else l.Log.debug("State.clearStaleState: no item in storage for key: ",O),B=!0;if(B)return l.Log.debug("State.clearStaleState: removed item for key: ",O),o.remove(O)}),j.push(F)},A=0;A<w.length;A++){var F;P(A)}return l.Log.debug("State.clearStaleState: waiting on promise count:",j.length),Promise.all(j)})},D(a,[{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}}]),a}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.OidcClient=void 0;var D=function(){function P(A,F){for(var U=0;U<F.length;U++){var Y=F[U];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(A,Y.key,Y)}}return function(A,F,U){return F&&P(A.prototype,F),U&&P(A,U),A}}(),l=q(0),T=q(5),y=q(12),a=q(8),u=q(34),o=q(35),d=q(36),k=q(13),w=q(9);function j(P,A){if(!(P instanceof A))throw new TypeError("Cannot call a class as a function")}S.OidcClient=function(){function P(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};j(this,P),A instanceof T.OidcClientSettings?this._settings=A:this._settings=new T.OidcClientSettings(A)}return P.prototype.createSigninRequest=function(){var F=this,U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Y=U.response_type,O=U.scope,V=U.redirect_uri,B=U.data,$=U.state,et=U.prompt,nt=U.display,H=U.max_age,ut=U.ui_locales,_t=U.id_token_hint,wt=U.login_hint,jt=U.acr_values,xt=U.resource,Zt=U.request,Tt=U.request_uri,gt=U.response_mode,dt=U.extraQueryParams,At=U.extraTokenParams,Wt=U.request_type,Kt=U.skipUserInfo,zt=arguments[1];l.Log.debug("OidcClient.createSigninRequest");var $t=this._settings.client_id;Y=Y||this._settings.response_type,O=O||this._settings.scope,V=V||this._settings.redirect_uri,et=et||this._settings.prompt,nt=nt||this._settings.display,H=H||this._settings.max_age,ut=ut||this._settings.ui_locales,jt=jt||this._settings.acr_values,xt=xt||this._settings.resource,gt=gt||this._settings.response_mode,dt=dt||this._settings.extraQueryParams,At=At||this._settings.extraTokenParams;var ce=this._settings.authority;return a.SigninRequest.isCode(Y)&&Y!=="code"?Promise.reject(new Error("OpenID Connect hybrid flow is not supported")):this._metadataService.getAuthorizationEndpoint().then(function(ee){l.Log.debug("OidcClient.createSigninRequest: Received authorization endpoint",ee);var Ut=new a.SigninRequest({url:ee,client_id:$t,redirect_uri:V,response_type:Y,scope:O,data:B||$,authority:ce,prompt:et,display:nt,max_age:H,ui_locales:ut,id_token_hint:_t,login_hint:wt,acr_values:jt,resource:xt,request:Zt,request_uri:Tt,extraQueryParams:dt,extraTokenParams:At,request_type:Wt,response_mode:gt,client_secret:F._settings.client_secret,skipUserInfo:Kt}),Yt=Ut.state;return(zt=zt||F._stateStore).set(Yt.id,Yt.toStorageString()).then(function(){return Ut})})},P.prototype.readSigninResponseState=function(F,U){var Y=arguments.length>2&&arguments[2]!==void 0&&arguments[2];l.Log.debug("OidcClient.readSigninResponseState");var O=this._settings.response_mode==="query"||!this._settings.response_mode&&a.SigninRequest.isCode(this._settings.response_type),V=O?"?":"#",B=new u.SigninResponse(F,V);if(!B.state)return l.Log.error("OidcClient.readSigninResponseState: No state in response"),Promise.reject(new Error("No state in response"));U=U||this._stateStore;var $=Y?U.remove.bind(U):U.get.bind(U);return $(B.state).then(function(et){if(!et)throw l.Log.error("OidcClient.readSigninResponseState: No matching state found in storage"),new Error("No matching state found in storage");return{state:k.SigninState.fromStorageString(et),response:B}})},P.prototype.processSigninResponse=function(F,U){var Y=this;return l.Log.debug("OidcClient.processSigninResponse"),this.readSigninResponseState(F,U,!0).then(function(O){var V=O.state,B=O.response;return l.Log.debug("OidcClient.processSigninResponse: Received state from storage; validating response"),Y._validator.validateSigninResponse(V,B)})},P.prototype.createSignoutRequest=function(){var F=this,U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Y=U.id_token_hint,O=U.data,V=U.state,B=U.post_logout_redirect_uri,$=U.extraQueryParams,et=U.request_type,nt=arguments[1];return l.Log.debug("OidcClient.createSignoutRequest"),B=B||this._settings.post_logout_redirect_uri,$=$||this._settings.extraQueryParams,this._metadataService.getEndSessionEndpoint().then(function(H){if(!H)throw l.Log.error("OidcClient.createSignoutRequest: No end session endpoint url returned"),new Error("no end session endpoint");l.Log.debug("OidcClient.createSignoutRequest: Received end session endpoint",H);
1var ut=new o.SignoutRequest({url:H,id_token_hint:Y,post_logout_redirect_uri:B,data:O||V,extraQueryParams:$,request_type:et}),_t=ut.state;return _t&&(l.Log.debug("OidcClient.createSignoutRequest: Signout request has state to persist"),(nt=nt||F._stateStore).set(_t.id,_t.toStorageString())),ut})},P.prototype.readSignoutResponseState=function(F,U){var Y=arguments.length>2&&arguments[2]!==void 0&&arguments[2];l.Log.debug("OidcClient.readSignoutResponseState");var O=new d.SignoutResponse(F);if(!O.state)return l.Log.debug("OidcClient.readSignoutResponseState: No state in response"),O.error?(l.Log.warn("OidcClient.readSignoutResponseState: Response was error: ",O.error),Promise.reject(new y.ErrorResponse(O))):Promise.resolve({state:void 0,response:O});var V=O.state;U=U||this._stateStore;var B=Y?U.remove.bind(U):U.get.bind(U);return B(V).then(function($){if(!$)throw l.Log.error("OidcClient.readSignoutResponseState: No matching state found in storage"),new Error("No matching state found in storage");return{state:w.State.fromStorageString($),response:O}})},P.prototype.processSignoutResponse=function(F,U){var Y=this;return l.Log.debug("OidcClient.processSignoutResponse"),this.readSignoutResponseState(F,U,!0).then(function(O){var V=O.state,B=O.response;return V?(l.Log.debug("OidcClient.processSignoutResponse: Received state from storage; validating response"),Y._validator.validateSignoutResponse(V,B)):(l.Log.debug("OidcClient.processSignoutResponse: No state from storage; skipping validating response"),B)})},P.prototype.clearStaleState=function(F){return l.Log.debug("OidcClient.clearStaleState"),F=F||this._stateStore,w.State.clearStaleState(F,this.settings.staleStateAge)},D(P,[{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}}]),P}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.TokenClient=void 0;var D=q(7),l=q(2),T=q(0);function y(a,u){if(!(a instanceof u))throw new TypeError("Cannot call a class as a function")}S.TokenClient=function(){function a(u){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:D.JsonService,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.MetadataService;if(y(this,a),!u)throw T.Log.error("TokenClient.ctor: No settings passed"),new Error("settings");this._settings=u,this._jsonService=new o,this._metadataService=new d(this._settings)}return a.prototype.exchangeCode=function(){var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(d=Object.assign({},d)).grant_type=d.grant_type||"authorization_code",d.client_id=d.client_id||this._settings.client_id,d.client_secret=d.client_secret||this._settings.client_secret,d.redirect_uri=d.redirect_uri||this._settings.redirect_uri;var k=void 0,w=d._client_authentication||this._settings._client_authentication;return delete d._client_authentication,d.code?d.redirect_uri?d.code_verifier?d.client_id?d.client_secret||w!="client_secret_basic"?(w=="client_secret_basic"&&(k=d.client_id+":"+d.client_secret,delete d.client_id,delete d.client_secret),this._metadataService.getTokenEndpoint(!1).then(function(j){return T.Log.debug("TokenClient.exchangeCode: Received token endpoint"),o._jsonService.postForm(j,d,k).then(function(P){return T.Log.debug("TokenClient.exchangeCode: response received"),P})})):(T.Log.error("TokenClient.exchangeCode: No client_secret passed"),Promise.reject(new Error("A client_secret is required"))):(T.Log.error("TokenClient.exchangeCode: No client_id passed"),Promise.reject(new Error("A client_id is required"))):(T.Log.error("TokenClient.exchangeCode: No code_verifier passed"),Promise.reject(new Error("A code_verifier is required"))):(T.Log.error("TokenClient.exchangeCode: No redirect_uri passed"),Promise.reject(new Error("A redirect_uri is required"))):(T.Log.error("TokenClient.exchangeCode: No code passed"),Promise.reject(new Error("A code is required")))},a.prototype.exchangeRefreshToken=function(){var o=this,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(d=Object.assign({},d)).grant_type=d.grant_type||"refresh_token",d.client_id=d.client_id||this._settings.client_id,d.client_secret=d.client_secret||this._settings.client_secret;var k=void 0,w=d._client_authentication||this._settings._client_authentication;return delete d._client_authentication,d.refresh_token?d.client_id?(w=="client_secret_basic"&&(k=d.client_id+":"+d.client_secret,delete d.client_id,delete d.client_secret),this._metadataService.getTokenEndpoint(!1).then(function(j){return T.Log.debug("TokenClient.exchangeRefreshToken: Received token endpoint"),o._jsonService.postForm(j,d,k).then(function(P){return T.Log.debug("TokenClient.exchangeRefreshToken: response received"),P})})):(T.Log.error("TokenClient.exchangeRefreshToken: No client_id passed"),Promise.reject(new Error("A client_id is required"))):(T.Log.error("TokenClient.exchangeRefreshToken: No refresh_token passed"),Promise.reject(new Error("A refresh_token is required")))},a}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.ErrorResponse=void 0;var D=q(0);function l(y,a){if(!(y instanceof a))throw new TypeError("Cannot call a class as a function")}function T(y,a){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!a||typeof a!="object"&&typeof a!="function"?y:a}S.ErrorResponse=function(y){function a(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=u.error,d=u.error_description,k=u.error_uri,w=u.state,j=u.session_state;if(l(this,a),!o)throw D.Log.error("No error passed to ErrorResponse"),new Error("error");var P=T(this,y.call(this,d||o));return P.name="ErrorResponse",P.error=o,P.error_description=d,P.error_uri=k,P.state=w,P.session_state=j,P}return function(o,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);o.prototype=Object.create(d&&d.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(o,d):o.__proto__=d)}(a,y),a}(Error)},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.SigninState=void 0;var D=function(){function d(k,w){for(var j=0;j<w.length;j++){var P=w[j];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(k,P.key,P)}}return function(k,w,j){return w&&d(k.prototype,w),j&&d(k,j),k}}(),l=q(0),T=q(9),y=q(4),a=function(k){return k&&k.__esModule?k:{default:k}}(q(14));function u(d,k){if(!(d instanceof k))throw new TypeError("Cannot call a class as a function")}function o(d,k){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!k||typeof k!="object"&&typeof k!="function"?d:k}S.SigninState=function(d){function k(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},j=w.nonce,P=w.authority,A=w.client_id,F=w.redirect_uri,U=w.code_verifier,Y=w.response_mode,O=w.client_secret,V=w.scope,B=w.extraTokenParams,$=w.skipUserInfo;u(this,k);var et=o(this,d.call(this,arguments[0]));if(j===!0?et._nonce=(0,a.default)():j&&(et._nonce=j),U===!0?et._
1code_verifier=(0,a.default)()+(0,a.default)()+(0,a.default)():U&&(et._code_verifier=U),et.code_verifier){var nt=y.JoseUtil.hashString(et.code_verifier,"SHA256");et._code_challenge=y.JoseUtil.hexToBase64Url(nt)}return et._redirect_uri=F,et._authority=P,et._client_id=A,et._response_mode=Y,et._client_secret=O,et._scope=V,et._extraTokenParams=B,et._skipUserInfo=$,et}return function(j,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);j.prototype=Object.create(P&&P.prototype,{constructor:{value:j,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(j,P):j.__proto__=P)}(k,d),k.prototype.toStorageString=function(){return l.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})},k.fromStorageString=function(j){return l.Log.debug("SigninState.fromStorageString"),new k(JSON.parse(j))},D(k,[{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}}]),k}(T.State)},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.default=function(){return(D!="undefined"&&D!==null&&D.getRandomValues!==void 0?l:T)().replace(/-/g,"")};var D=typeof window!="undefined"?window.crypto||window.msCrypto:null;function l(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(y){return(y^D.getRandomValues(new Uint8Array(1))[0]&15>>y/4).toString(16)})}function T(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(y){return(y^16*Math.random()>>y/4).toString(16)})}at.exports=S.default},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.User=void 0;var D=function(){function T(y,a){for(var u=0;u<a.length;u++){var o=a[u];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(y,o.key,o)}}return function(y,a,u){return a&&T(y.prototype,a),u&&T(y,u),y}}(),l=q(0);S.User=function(){function T(y){var a=y.id_token,u=y.session_state,o=y.access_token,d=y.refresh_token,k=y.token_type,w=y.scope,j=y.profile,P=y.expires_at,A=y.state;(function(U,Y){if(!(U instanceof Y))throw new TypeError("Cannot call a class as a function")})(this,T),this.id_token=a,this.session_state=u,this.access_token=o,this.refresh_token=d,this.token_type=k,this.scope=w,this.profile=j,this.expires_at=P,this.state=A}return T.prototype.toStorageString=function(){return l.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})},T.fromStorageString=function(a){return l.Log.debug("User.fromStorageString"),new T(JSON.parse(a))},D(T,[{key:"expires_in",get:function(){if(this.expires_at){var a=parseInt(Date.now()/1e3);return this.expires_at-a}},set:function(a){var u=parseInt(a);if(typeof u=="number"&&u>0){var o=parseInt(Date.now()/1e3);this.expires_at=o+u}}},{key:"expired",get:function(){var a=this.expires_in;if(a!==void 0)return a<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}}]),T}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.AccessTokenEvents=void 0;var D=q(0),l=q(46);function T(y,a){if(!(y instanceof a))throw new TypeError("Cannot call a class as a function")}S.AccessTokenEvents=function(){function y(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},u=a.accessTokenExpiringNotificationTime,o=u===void 0?60:u,d=a.accessTokenExpiringTimer,k=d===void 0?new l.Timer("Access token expiring"):d,w=a.accessTokenExpiredTimer,j=w===void 0?new l.Timer("Access token expired"):w;T(this,y),this._accessTokenExpiringNotificationTime=o,this._accessTokenExpiring=k,this._accessTokenExpired=j}return y.prototype.load=function(u){if(u.access_token&&u.expires_in!==void 0){var o=u.expires_in;
1if(D.Log.debug("AccessTokenEvents.load: access token present, remaining duration:",o),o>0){var d=o-this._accessTokenExpiringNotificationTime;d<=0&&(d=1),D.Log.debug("AccessTokenEvents.load: registering expiring timer in:",d),this._accessTokenExpiring.init(d)}else D.Log.debug("AccessTokenEvents.load: canceling existing expiring timer becase we're past expiration."),this._accessTokenExpiring.cancel();var k=o+1;D.Log.debug("AccessTokenEvents.load: registering expired timer in:",k),this._accessTokenExpired.init(k)}else this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},y.prototype.unload=function(){D.Log.debug("AccessTokenEvents.unload: canceling existing access token timers"),this._accessTokenExpiring.cancel(),this._accessTokenExpired.cancel()},y.prototype.addAccessTokenExpiring=function(u){this._accessTokenExpiring.addHandler(u)},y.prototype.removeAccessTokenExpiring=function(u){this._accessTokenExpiring.removeHandler(u)},y.prototype.addAccessTokenExpired=function(u){this._accessTokenExpired.addHandler(u)},y.prototype.removeAccessTokenExpired=function(u){this._accessTokenExpired.removeHandler(u)},y}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.Event=void 0;var D=q(0);S.Event=function(){function l(T){(function(a,u){if(!(a instanceof u))throw new TypeError("Cannot call a class as a function")})(this,l),this._name=T,this._callbacks=[]}return l.prototype.addHandler=function(y){this._callbacks.push(y)},l.prototype.removeHandler=function(y){var a=this._callbacks.findIndex(function(u){return u===y});a>=0&&this._callbacks.splice(a,1)},l.prototype.raise=function(){D.Log.debug("Event: Raising event: "+this._name);for(var y=0;y<this._callbacks.length;y++){var a;(a=this._callbacks)[y].apply(a,arguments)}},l}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.SessionMonitor=void 0;var D=function(){function u(o,d){for(var k=0;k<d.length;k++){var w=d[k];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(o,w.key,w)}}return function(o,d,k){return d&&u(o.prototype,d),k&&u(o,k),o}}(),l=q(0),T=q(19),y=q(1);function a(u,o){if(!(u instanceof o))throw new TypeError("Cannot call a class as a function")}S.SessionMonitor=function(){function u(o){var d=this,k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:T.CheckSessionIFrame,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:y.Global.timer;if(a(this,u),!o)throw l.Log.error("SessionMonitor.ctor: No user manager passed to SessionMonitor"),new Error("userManager");this._userManager=o,this._CheckSessionIFrameCtor=k,this._timer=w,this._userManager.events.addUserLoaded(this._start.bind(this)),this._userManager.events.addUserUnloaded(this._stop.bind(this)),Promise.resolve(this._userManager.getUser().then(function(j){j?d._start(j):d._settings.monitorAnonymousSession&&d._userManager.querySessionStatus().then(function(P){var A={session_state:P.session_state};P.sub&&P.sid&&(A.profile={sub:P.sub,sid:P.sid}),d._start(A)}).catch(function(P){l.Log.error("SessionMonitor ctor: error from querySessionStatus:",P.message)})}).catch(function(j){l.Log.error("SessionMonitor ctor: error from getUser:",j.message)}))}return u.prototype._start=function(d){var k=this,w=d.session_state;w&&(d.profile?(this._sub=d.profile.sub,this._sid=d.profile.sid,l.Log.debug("SessionMonitor._start: session_state:",w,", sub:",this._sub)):(this._sub=void 0,this._sid=void 0,l.Log.debug("SessionMonitor._start: session_state:",w,", anonymous user")),this._checkSessionIFrame?this._checkSessionIFrame.start(w):this._metadataService.getCheckSessionIframe().then(function(j){if(j){l.Log.debug("SessionMonitor._start: Initializing check session iframe");var P=k._client_id,A=k._checkSessionInterval,F=k._stopCheckSessionOnError;k._checkSessionIFrame=new k._CheckSessionIFrameCtor(k._callback.bind(k),P,j,A,F),k._checkSessionIFrame.load().then(function(){k._checkSessionIFrame.start(w)})}else l.Log.warn("SessionMonitor._start: No check session iframe found in the metadata")}).catch(function(j){l.Log.error("SessionMonitor._start: Error from getCheckSessionIframe:",j.message)}))},u.prototype._stop=function(){var d=this;if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&(l.Log.debug("SessionMonitor._stop"),this._checkSessionIFrame.stop()),this._settings.monitorAnonymousSession)var k=this._timer.setInterval(function(){d._timer.clearInterval(k),d._userManager.querySessionStatus().then(function(w){var j={session_state:w.session_state};w.sub&&w.sid&&(j.profile={sub:w.sub,sid:w.sid}),d._start(j)}).catch(function(w){l.Log.error("SessionMonitor: error from querySessionStatus:",w.message)})},1e3)},u.prototype._callback=function(){var d=this;this._userManager.querySessionStatus().then(function(k){var w=!0;k?k.sub===d._sub?(w=!1,d._checkSessionIFrame.start(k.session_state),k.sid===d._sid?l.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, restarting check session iframe; session_state:",k.session_state):(l.Log.debug("SessionMonitor._callback: Same sub still logged in at OP, session state has changed, restarting check session iframe; session_state:",k.session_state),d._userManager.events._raiseUserSessionChanged())):l.Log.debug("SessionMonitor._callback: Different subject signed into OP:",k.sub):l.Log.debug("SessionMonitor._callback: Subject no longer signed into OP"),w&&(d._sub?(l.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed out event"),d._userManager.events._raiseUserSignedOut()):(l.Log.debug("SessionMonitor._callback: SessionMonitor._callback; raising signed in event"),d._userManager.events._raiseUserSignedIn()))}).catch(function(k){d._sub&&(l.Log.debug("SessionMonitor._callback: Error calling queryCurrentSigninSession; raising signed out event",k.message),d._userManager.events._raiseUserSignedOut())})},D(u,[{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}}]),u}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.CheckSessionIFrame=void 0;var D=q(0);function l(T,y){if(!(T instanceof y))throw new TypeError("Cannot call a class as a function")}S.CheckSessionIFrame=function(){function T(y,a,u,o){var d=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4];l(this,T),this._callback=y,this._client_id=a,this._url=u,this._interval=o||2e3,this._stopOnError=d;var k=u.indexOf("/",u.indexOf("//")+2);this._frame_origin=u.substr(0,k),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=u}return T.prototype.load=function(){var a=this;return new Promise(function(u){a._frame.onload=function(){u()},window.document.body.appendChild(a._frame),a._boundMessageEvent=a._message.bind(a),window.addEventListener("message",a._boundMessageEvent,!1)})},T.prototype._message=function(a){a.origin===this._frame_origin&&a.source===this._frame.contentWindow&&(a.data==="error"?(D.Log.error("CheckSessionIFrame: error message from check session op iframe"),this._stopOnError&&this.stop()):a.data==="changed"?(D.Log.debug("CheckSessionIFrame: changed message from check session op iframe"),this.stop(),this._callback()):D.Log.debug("CheckSessionIFrame: "+a.data+" message from check session op iframe"))},T.prototype.start=function(a){var u=this;if(this._session_state!==a){D.Log.debug("CheckSessionIFrame.start"),this.stop(),this._session_state=a;var o=function(){u._frame.contentWindow.postMessage(u._client_id+" "+u._session_state,u._frame_origin)};o(),this._timer=window.setInterval(o,this._interval)}},T.prototype.stop=function(){this._session_state=null,this._timer&&(D.Log.debug("CheckSessionIFrame.stop"),window.clearInterval(this._timer),this._timer=null)},T}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.TokenRevocationClient=void 0;var D=q(0),l=q(2),T=q(1);function y(o,d){if(!(o instanceof d))throw new TypeError("Cannot call a class as a function")}var a="access_token",u="refresh_token";S.TokenRevocationClient=function(){function o(d){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:T.Global.XMLHttpRequest,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.MetadataService;if(y(this,o),!d)throw D.Log.error("TokenRevocationClient.ctor: No settings provided"),new Error("No settings provided.");this._settings=d,this._XMLHttpRequestCtor=k,this._metadataService=new w(this._settings)}return o.prototype.revoke=function(k,w){var j=this,P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"access_token";if(!k)throw D.Log.error("TokenRevocationClient.revoke: No token provided"),new Error("No token provided.");if(P!==a&&P!=u)throw D.Log.error("TokenRevocationClient.revoke: Invalid token type"),new Error("Invalid token type.");return this._metadataService.getRevocationEndpoint().then(function(A){if(A){D.Log.debug("TokenRevocationClient.revoke: Revoking "+P);var F=j._settings.client_id,U=j._settings.client_secret;return j._revoke(A,F,U,k,P)}if(w)throw D.Log.error("TokenRevocationClient.revoke: Revocation not supported"),new Error("Revocation not supported")})},o.prototype._revoke=function(k,w,j,P,A){var F=this;return new Promise(function(U,Y){var O=new F._XMLHttpRequestCtor;O.open("POST",k),O.onload=function(){D.Log.debug("TokenRevocationClient.revoke: HTTP response received, status",O.status),O.status===200?U():Y(Error(O.statusText+" ("+O.status+")"))},O.onerror=function(){D.Log.debug("TokenRevocationClient.revoke: Network Error."),Y("Network Error")};var V="client_id="+encodeURIComponent(w);j&&(V+="&client_secret="+encodeURIComponent(j)),V+="&token_type_hint="+encodeURIComponent(A),V+="&token="+encodeURIComponent(P),O.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),O.send(V)})},o}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.CordovaPopupWindow=void 0;var D=function(){function T(y,a){for(var u=0;u<a.length;u++){var o=a[u];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(y,o.key,o)}}return function(y,a,u){return a&&T(y.prototype,a),u&&T(y,u),y}}(),l=q(0);S.CordovaPopupWindow=function(){function T(y){var a=this;(function(o,d){if(!(o instanceof d))throw new TypeError("Cannot call a class as a function")})(this,T),this._promise=new Promise(function(u,o){a._resolve=u,a._reject=o}),this.features=y.popupWindowFeatures||"location=no,toolbar=no,zoom=no",this.target=y.popupWindowTarget||"_blank",this.redirect_uri=y.startUrl,l.Log.debug("CordovaPopupWindow.ctor: redirect_uri: "+this.redirect_uri)}return T.prototype._isInAppBrowserInstalled=function(a){return["cordova-plugin-inappbrowser","cordova-plugin-inappbrowser.inappbrowser","org.apache.cordova.inappbrowser"].some(function(u){return a.hasOwnProperty(u)})}
1,T.prototype.navigate=function(a){if(a&&a.url){if(!window.cordova)return this._error("cordova is undefined");var u=window.cordova.require("cordova/plugin_list").metadata;if(this._isInAppBrowserInstalled(u)===!1)return this._error("InAppBrowser plugin not found");this._popup=cordova.InAppBrowser.open(a.url,this.target,this.features),this._popup?(l.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},T.prototype._loadStartCallback=function(a){a.url.indexOf(this.redirect_uri)===0&&this._success({url:a.url})},T.prototype._exitCallback=function(a){this._error(a)},T.prototype._success=function(a){this._cleanup(),l.Log.debug("CordovaPopupWindow: Successful response from cordova popup window"),this._resolve(a)},T.prototype._error=function(a){this._cleanup(),l.Log.error(a),this._reject(new Error(a))},T.prototype.close=function(){this._cleanup()},T.prototype._cleanup=function(){this._popup&&(l.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},D(T,[{key:"promise",get:function(){return this._promise}}]),T}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0});var D=q(0),l=q(10),T=q(5),y=q(6),a=q(37),u=q(38),o=q(16),d=q(2),k=q(48),w=q(49),j=q(19),P=q(20),A=q(18),F=q(1),U=q(15),Y=q(50);S.default={Version:Y.Version,Log:D.Log,OidcClient:l.OidcClient,OidcClientSettings:T.OidcClientSettings,WebStorageStateStore:y.WebStorageStateStore,InMemoryWebStorage:a.InMemoryWebStorage,UserManager:u.UserManager,AccessTokenEvents:o.AccessTokenEvents,MetadataService:d.MetadataService,CordovaPopupNavigator:k.CordovaPopupNavigator,CordovaIFrameNavigator:w.CordovaIFrameNavigator,CheckSessionIFrame:j.CheckSessionIFrame,TokenRevocationClient:P.TokenRevocationClient,SessionMonitor:A.SessionMonitor,Global:F.Global,User:U.User},at.exports=S.default},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.ClockService=function(){function D(){(function(T,y){if(!(T instanceof y))throw new TypeError("Cannot call a class as a function")})(this,D)}return D.prototype.getEpochTime=function(){return Promise.resolve(Date.now()/1e3|0)},D}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.ResponseValidator=void 0;var D=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},l=q(0),T=q(2),y=q(25),a=q(11),u=q(12),o=q(4);function d(w,j){if(!(w instanceof j))throw new TypeError("Cannot call a class as a function")}var k=["nonce","at_hash","iat","nbf","exp","aud","iss","c_hash"];S.ResponseValidator=function(){function w(j){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:T.MetadataService,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:y.UserInfoService,F=arguments.length>3&&arguments[3]!==void 0?arguments[3]:o.JoseUtil,U=arguments.length>4&&arguments[4]!==void 0?arguments[4]:a.TokenClient;if(d(this,w),!j)throw l.Log.error("ResponseValidator.ctor: No settings passed to ResponseValidator"),new Error("settings");this._settings=j,this._metadataService=new P(this._settings),this._userInfoService=new A(this._settings),this._joseUtil=F,this._tokenClient=new U(this._settings)}return w.prototype.validateSigninResponse=function(P,A){var F=this;return l.Log.debug("ResponseValidator.validateSigninResponse"),this._processSigninParams(P,A).then(function(U){return l.Log.debug("ResponseValidator.validateSigninResponse: state processed"),F._validateTokens(P,U).then(function(Y){return l.Log.debug("ResponseValidator.validateSigninResponse: tokens validated"),F._processClaims(P,Y).then(function(O){return l.Log.debug("ResponseValidator.validateSigninResponse: claims processed"),O})})})},w.prototype.validateSignoutResponse=function(P,A){return P.id!==A.state?(l.Log.error("ResponseValidator.validateSignoutResponse: State does not match"),Promise.reject(new Error("State does not match"))):(l.Log.debug("ResponseValidator.validateSignoutResponse: state validated"),A.state=P.data,A.error?(l.Log.warn("ResponseValidator.validateSignoutResponse: Response was error",A.error),Promise.reject(new u.ErrorResponse(A))):Promise.resolve(A))},w.prototype._processSigninParams=function(P,A){if(P.id!==A.state)return l.Log.error("ResponseValidator._processSigninParams: State does not match"),Promise.reject(new Error("State does not match"));if(!P.client_id)return l.Log.error("ResponseValidator._processSigninParams: No client_id on 
1state"),Promise.reject(new Error("No client_id on state"));if(!P.authority)return l.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!==P.authority)return l.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=P.authority;if(this._settings.client_id){if(this._settings.client_id&&this._settings.client_id!==P.client_id)return l.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=P.client_id;return l.Log.debug("ResponseValidator._processSigninParams: state validated"),A.state=P.data,A.error?(l.Log.warn("ResponseValidator._processSigninParams: Response was error",A.error),Promise.reject(new u.ErrorResponse(A))):P.nonce&&!A.id_token?(l.Log.error("ResponseValidator._processSigninParams: Expecting id_token in response"),Promise.reject(new Error("No id_token in response"))):!P.nonce&&A.id_token?(l.Log.error("ResponseValidator._processSigninParams: Not expecting id_token in response"),Promise.reject(new Error("Unexpected id_token in response"))):P.code_verifier&&!A.code?(l.Log.error("ResponseValidator._processSigninParams: Expecting code in response"),Promise.reject(new Error("No code in response"))):!P.code_verifier&&A.code?(l.Log.error("ResponseValidator._processSigninParams: Not expecting code in response"),Promise.reject(new Error("Unexpected code in response"))):(A.scope||(A.scope=P.scope),Promise.resolve(A))},w.prototype._processClaims=function(P,A){var F=this;if(A.isOpenIdConnect){if(l.Log.debug("ResponseValidator._processClaims: response is OIDC, processing claims"),A.profile=this._filterProtocolClaims(A.profile),P.skipUserInfo!==!0&&this._settings.loadUserInfo&&A.access_token)return l.Log.debug("ResponseValidator._processClaims: loading user info"),this._userInfoService.getClaims(A.access_token).then(function(U){return l.Log.debug("ResponseValidator._processClaims: user info claims received from user info endpoint"),U.sub!==A.profile.sub?(l.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"))):(A.profile=F._mergeClaims(A.profile,U),l.Log.debug("ResponseValidator._processClaims: user info claims received, updated profile:",A.profile),A)});l.Log.debug("ResponseValidator._processClaims: not loading user info")}else l.Log.debug("ResponseValidator._processClaims: response is not OIDC, not processing claims");return Promise.resolve(A)},w.prototype._mergeClaims=function(P,A){var F=Object.assign({},P);for(var U in A){var Y=A[U];Array.isArray(Y)||(Y=[Y]);for(var O=0;O<Y.length;O++){var V=Y[O];F[U]?Array.isArray(F[U])?F[U].indexOf(V)<0&&F[U].push(V):F[U]!==V&&((V===void 0?"undefined":D(V))==="object"&&this._settings.mergeClaims?F[U]=this._mergeClaims(F[U],V):F[U]=[F[U],V]):F[U]=V}}return F},w.prototype._filterProtocolClaims=function(P){l.Log.debug("ResponseValidator._filterProtocolClaims, incoming claims:",P);var A=Object.assign({},P);return this._settings._filterProtocolClaims?(k.forEach(function(F){delete A[F]}),l.Log.debug("ResponseValidator._filterProtocolClaims: protocol claims filtered",A)):l.Log.debug("ResponseValidator._filterProtocolClaims: protocol claims not filtered"),A},w.prototype._validateTokens=function(P,A){return A.code?(l.Log.debug("ResponseValidator._validateTokens: Validating code"),this._processCode(P,A)):A.id_token?A.access_token?(l.Log.debug("ResponseValidator._validateTokens: Validating id_token and access_token"),this._validateIdTokenAndAccessToken(P,A)):(l.Log.debug("ResponseValidator._validateTokens: Validating id_token"),this._validateIdToken(P,A)):(l.Log.debug("ResponseValidator._validateTokens: No code to process or id_token to validate"),Promise.resolve(A))},w.prototype._processCode=function(P,A){var F=this,U={client_id:P.client_id,client_secret:P.client_secret,code:A.code,redirect_uri:P.redirect_uri,code_verifier:P.code_verifier};return P.extraTokenParams&&D(P.extraTokenParams)==="object"&&Object.assign(U,P.extraTokenParams),this._tokenClient.exchangeCode(U).then(function(Y){for(var O in Y)A[O]=Y[O];return A.id_token?(l.Log.debug("ResponseValidator._processCode: token response successful, processing id_token"),F._val
1idateIdTokenAttributes(P,A)):(l.Log.debug("ResponseValidator._processCode: token response successful, returning response"),A)})},w.prototype._validateIdTokenAttributes=function(P,A){var F=this;return this._metadataService.getIssuer().then(function(U){var Y=P.client_id,O=F._settings.clockSkew;return l.Log.debug("ResponseValidator._validateIdTokenAttributes: Validaing JWT attributes; using clock skew (in seconds) of: ",O),F._settings.getEpochTime().then(function(V){return F._joseUtil.validateJwtAttributes(A.id_token,U,Y,O,V).then(function(B){return P.nonce&&P.nonce!==B.nonce?(l.Log.error("ResponseValidator._validateIdTokenAttributes: Invalid nonce in id_token"),Promise.reject(new Error("Invalid nonce in id_token"))):B.sub?(A.profile=B,A):(l.Log.error("ResponseValidator._validateIdTokenAttributes: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))})})})},w.prototype._validateIdTokenAndAccessToken=function(P,A){var F=this;return this._validateIdToken(P,A).then(function(U){return F._validateAccessToken(U)})},w.prototype._getSigningKeyForJwt=function(P){var A=this;return this._metadataService.getSigningKeys().then(function(F){var U=P.header.kid;if(!F)return l.Log.error("ResponseValidator._validateIdToken: No signing keys from metadata"),Promise.reject(new Error("No signing keys from metadata"));l.Log.debug("ResponseValidator._validateIdToken: Received signing keys");var Y=void 0;if(U)Y=F.filter(function(O){return O.kid===U})[0];else{if((F=A._filterByAlg(F,P.header.alg)).length>1)return l.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"));Y=F[0]}return Promise.resolve(Y)})},w.prototype._getSigningKeyForJwtWithSingleRetry=function(P){var A=this;return this._getSigningKeyForJwt(P).then(function(F){return F?Promise.resolve(F):(A._metadataService.resetSigningKeys(),A._getSigningKeyForJwt(P))})},w.prototype._validateIdToken=function(P,A){var F=this;if(!P.nonce)return l.Log.error("ResponseValidator._validateIdToken: No nonce on state"),Promise.reject(new Error("No nonce on state"));var U=this._joseUtil.parseJwt(A.id_token);return U&&U.header&&U.payload?P.nonce!==U.payload.nonce?(l.Log.error("ResponseValidator._validateIdToken: Invalid nonce in id_token"),Promise.reject(new Error("Invalid nonce in id_token"))):this._metadataService.getIssuer().then(function(Y){return l.Log.debug("ResponseValidator._validateIdToken: Received issuer"),F._getSigningKeyForJwtWithSingleRetry(U).then(function(O){if(!O)return l.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 V=P.client_id,B=F._settings.clockSkew;return l.Log.debug("ResponseValidator._validateIdToken: Validaing JWT; using clock skew (in seconds) of: ",B),F._joseUtil.validateJwt(A.id_token,O,Y,V,B).then(function(){return l.Log.debug("ResponseValidator._validateIdToken: JWT validation successful"),U.payload.sub?(A.profile=U.payload,A):(l.Log.error("ResponseValidator._validateIdToken: No sub present in id_token"),Promise.reject(new Error("No sub present in id_token")))})})}):(l.Log.error("ResponseValidator._validateIdToken: Failed to parse id_token",U),Promise.reject(new Error("Failed to parse id_token")))},w.prototype._filterByAlg=function(P,A){var F=null;if(A.startsWith("RS"))F="RSA";else if(A.startsWith("PS"))F="PS";else{if(!A.startsWith("ES"))return l.Log.debug("ResponseValidator._filterByAlg: alg not supported: ",A),[];F="EC"}return l.Log.debug("ResponseValidator._filterByAlg: Looking for keys that match kty: ",F),P=P.filter(function(U){return U.kty===F}),l.Log.debug("ResponseValidator._filterByAlg: Number of keys that match kty: ",F,P.length),P},w.prototype._validateAccessToken=function(P){if(!P.profile)return l.Log.error("ResponseValidator._validateAccessToken: No profile loaded from id_token"),Promise.reject(new Error("No profile loaded from id_token"));if(!P.profile.at_hash)return l.Log.error("ResponseValidator._validateAccessToken: No at_hash in id_token"),Promise.reject(new Error("No at_hash in id_token"));if(!P.id_token)return l.Log.error("ResponseValidator._validateAccessToken: No id_token"),Promise.reject(new Error("No id_token"));var A=this._joseUtil.parseJwt(P.id_token);if(!A||!A.header)return l.Log.error("ResponseValidator._validateAccessToken: Failed to parse id_token",A),Promise.reject(new Error("Failed to parse id_token"));var F=A.header.alg;if(!F||F.length!==5)return l.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",F),Promise.reject(new Error("Unsupported alg: "+F));var U=F.substr(2,3);if(!U)return l.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",F,U),Promise.reject(new Error("Unsupported alg: "+F));if((U=parseInt(U))!==256&&U!==384&&U!==512)return l.Log.error("ResponseValidator._validateAccessToken: Unsupported alg:",F,U),Promise.reject(new Error("Unsupported alg: "+F));var Y="sha"+U,O=this._joseUtil.hashString(P.access_token,Y);if(!O)return l.Log.error("ResponseValidator._validateAccessToken: access_token hash failed:",Y),Promise.reject(new Error("Failed to validate at_hash"));var V=O.substr(0,O.length/2),B=this._joseUtil.hexToBase64Url(V);return B!==P.profile.at_hash?(l.Log.error("ResponseValidator._validateAccessToken: Failed to validate at_hash",B,P.profile.at_hash),Promise.reject(new Error("Failed to validate at_hash"))):(l.Log.debug("ResponseValidator._validateAccessToken: success"),Promise.resolve(P))},w}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.UserInfoService=void 0;var D=q(7),l=q(2),T=q(0),y=q(4);function a(u,o){if(!(u instanceof o))throw new TypeError("Cannot call a class as a function")}S.UserInfoService=function(){function u(o){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:D.JsonService,k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.MetadataService,w=arguments.length>3&&arguments[3]!==void 0?arguments[3]:y.JoseUtil;if(a(this,u),!o)throw T.Log.error("UserInfoService.ctor: No settings passed"),new Error("settings");this._settings=o,this._jsonService=new d(void 0,void 0,this._getClaimsFromJwt.bind(this)),this._metadataService=new k(this._settings),this._joseUtil=w}return u.prototype.getClaims=function(d){var k=this;return d?this._metadataService.getUserInfoEndpoint().then(function(w){return T.Log.debug("UserInfoService.getClaims: received userinfo url",w),k._jsonService.getJson(w,d).then(function(j){return T.Log.debug("UserInfoService.getClaims: claims received",j),j})}):(T.Log.error("UserInfoService.getClaims: No token passed"),Promise.reject(new Error("A token is required")))},u.prototype._getClaimsFromJwt=function(d){var k=this;try{var w=this._joseUtil.parseJwt(d.responseText);if(!w||!w.header||!w.payload)return T.Log.error("UserInfoService._getClaimsFromJwt: Failed to parse JWT",w),Promise.reject(new Error("Failed to parse id_token"));var j=w.header.kid,P=void 0;switch(this._settings.userInfoJwtIssuer){case"OP":P=this._metadataService.getIssuer();break;case"ANY":P=Promise.resolve(w.payload.iss);break;default:P=Promise.resolve(this._settings.userInfoJwtIssuer)}return P.then(function(A){return T.Log.debug("UserInfoService._getClaimsFromJwt: Received issuer:"+A),k._metadataService.getSigningKeys().then(function(F){if(!F)return T.Log.error("UserInfoService._getClaimsFromJwt: No signing keys from metadata"),Promise.reject(new Error("No signing keys from metadata"));T.Log.debug("UserInfoService._getClaimsFromJwt: Received signing keys");var U=void 0;if(j)U=F.filter(function(V){return V.kid===j})[0];else{if((F=k._filterByAlg(F,w.header.alg)).length>1)return T.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"));U=F[0]}if(!U)return T.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"));var Y=k._settings.client_id,O=k._settings.clockSkew;return T.Log.debug("UserInfoService._getClaimsFromJwt: Validaing JWT; using clock skew (in seconds) of: ",O),k._joseUtil.validateJwt(d.responseText,U,A,Y,O,void 0,!0).then(function(){return T.Log.debug("UserInfoService._getClaimsFromJwt: JWT validation successful"),w.payload})})})}catch(A){return T.Log.error("UserInfoService._getClaimsFromJwt: Error parsing JWT response",A.message),void reject(A)}},u.prototype._filterByAlg=function(d,k){var w=null;if(k.startsWith("RS"))w="RSA";else if(k.startsWith("PS"))w="PS";else{if(!k.startsWith("ES"))return T.Log.debug("UserInfoService._filterByAlg: alg not supported: ",k),[];w="EC"}return T.Log.debug("UserInfoService._filterByAlg: Looking for keys that match kty: ",w),d=d.filter(function(j){return j.kty===w}),T.Log.debug("UserInfoService._filterByAlg: Number of keys that match kty: ",w,d.length),d},u}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.AllowedSigningAlgs=S.b64tohex=S.hextob64u=S.crypto=S.X509=S.KeyUtil=S.jws=void 0;var D=q(27);S.jws=D.jws,S.KeyUtil=D.KEYUTIL,S.X509=D.X509,S.crypto=D.crypto,S.hextob64u=D.hextob64u,S.b64tohex=D.b64tohex,S.AllowedSigningAlgs=["RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"]},function(at,S,q){"use strict";(function(D){Object.defineProperty(S,"__esModule",{value:!0});var l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T={userAgent:!1},y={};/*!
2Copyright (c) 2011, Yahoo! Inc. All rights reserved.
3Code licensed under the BSD License:
vendor: 9,499 bytes, lines 4-13
4http://developer.yahoo.com/yui/license.html
5version: 2.9.0
6*/if(a===void 0)var a={};a.lang={extend:function(t,r,n){if(!r||!t)throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");var i=function(){};if(i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t,t.superclass=r.prototype,r.prototype.constructor==Object.prototype.constructor&&(r.prototype.constructor=r),n){var s;for(s in n)t.prototype[s]=n[s];var f=function(){},_=["toString","valueOf"];try{/MSIE/.test(T.userAgent)&&(f=function(m,b){for(s=0;s<_.length;s+=1){var x=_[s],R=b[x];typeof R=="function"&&R!=Object.prototype[x]&&(m[x]=R)}})}catch(v){}f(t.prototype,n)}}};/*! CryptoJS v3.1.2 core-fix.js
7 * code.google.com/p/crypto-js
8 * (c) 2009-2013 by Jeff Mott. All rights reserved.
9 * code.google.com/p/crypto-js/wiki/License
10 * THIS IS FIX of 'core.js' to fix Hmac issue.
11 * https://code.google.com/p/crypto-js/issues/detail?id=84
12 * https://crypto-js.googlecode.com/svn-history/r667/branches/3.x/src/core.js
13 */var u,o,d,k,w,j,P,A,F,U,Y,O=O||(u=Math,d=(o={}).lib={},k=d.Base=function(){function e(){}return{extend:function(r){e.prototype=this;var n=new e;return r&&n.mixIn(r),n.hasOwnProperty("init")||(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var r=this.extend();return r.init.apply(r,arguments),r},init:function(){},mixIn:function(r){for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);r.hasOwnProperty("toString")&&(this.toString=r.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),w=d.WordArray=k.extend({init:function(t,r){t=this.words=t||[],this.sigBytes=r!=null?r:4*t.length},toString:function(t){return(t||P).stringify(this)},concat:function(t){var r=this.words,n=t.words,i=this.sigBytes,s=t.sigBytes;if(this.clamp(),i%4)for(var f=0;f<s;f++){var _=n[f>>>2]>>>24-f%4*8&255;r[i+f>>>2]|=_<<24-(i+f)%4*8}else for(f=0;f<s;f+=4)r[i+f>>>2]=n[f>>>2];return this.sigBytes+=s,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=u.ceil(r/4)},clone:function(){var t=k.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var r=[],n=0;n<t;n+=4)r.push(4294967296*u.random()|0);return new w.init(r,t)}}),j=o.enc={},P=j.Hex={stringify:function(t){for(var r=t.words,n=t.sigBytes,i=[],s=0;s<n;s++){var f=r[s>>>2]>>>24-s%4*8&255;i.push((f>>>4).toString(16)),i.push((15&f).toString(16))}return i.join("")},parse:function(t){for(var r=t.length,n=[],i=0;i<r;i+=2)n[i>>>3]|=parseInt(t.substr(i,2),16)<<24-i%8*4;return new w.init(n,r/2)}},A=j.Latin1={stringify:function(t){for(var r=t.words,n=t.sigBytes,i=[],s=0;s<n;s++){var f=r[s>>>2]>>>24-s%4*8&255;i.push(String.fromCharCode(f))}return i.join("")},parse:function(t){for(var r=t.length,n=[],i=0;i<r;i++)n[i>>>2]|=(255&t.charCodeAt(i))<<24-i%4*8;return new w.init(n,r)}},F=j.Utf8={stringify:function(t){try{return decodeURIComponent(escape(A.stringify(t)))}catch(r){throw new Error("Malformed UTF-8 data")}},parse:function(t){return A.parse(unescape(encodeURIComponent(t)))}},U=d.BufferedBlockAlgorithm=k.extend({reset:function(){this._data=new w.init,this._nDataBytes=0},_append:function(t){typeof t=="string"&&(t=F.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(t){var r=this._data,n=r.words,i=r.sigBytes,s=this.blockSize,f=i/(4*s),_=(f=t?u.ceil(f):u.max((0|f)-this._minBufferSize,0))*s,v=u.min(4*_,i);if(_){for(var m=0;m<_;m+=s)this._doProcessBlock(n,m);var b=n.splice(0,_);r.sigBytes-=v}return new w.init(b,v)},clone:function(){var t=k.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),d.Hasher=U.extend({cfg:k.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){U.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(r,n){return new t.init(n).finalize(r)}},_createHmacHelper:function(t){return function(r,n){return new Y.HMAC.init(t,n).finalize(r)}}}),Y=o.algo={},o);(function(e){var t,r=(t=O).lib,n=r.Base,i=r.WordArray;(t=t.x64={}).Word=n.extend({init:function(f,_){this.high=f,this.low=_}}),t.WordArray=n.extend({init:function(f,_){f=this.words=f||[],this.sigBytes=_!=null?_:8*f.length},toX32:function(){for(var f=this.words,_=f.length,v=[],m=0;m<_;m++){var b=f[m];v.push(b.high),v.push(b.low)}return i.create(v,this.sigBytes)},clone:function(){for(var f=n.clone.call(this),_=f.words=this.words.slice(0),v=_.length,m=0;m<v;m++)_[m]=_[m].clone();return f}})})(),function(){var e=O,t=e.lib.WordArray;e.enc.Base64={stringify:function(n){var i=n.words,s=n.sigBytes,f=this._map;n.clamp(),n=[];for(var _=0;_<s;_+=3)for(var v=(i[_>>>2]>>>24-_%4*8&255)<<16|(i[_+1>>>2]>>>24-(_+1)%4*8&255)<<8|i[_+2>>>2]>>>24-(_+2)%4*8&255,m=0;4>m&&_+.75*m<s;m++)n.push(f.charAt(v>>>6*(3-m)&63));if(i=f.charAt(64))for(;n.length%4;)n.push(i);return n.join("")},parse:function(n){var i=n.length,s=this._map;(f=s.charAt(64))&&(f=n.indexOf(f))!=-1&&(i=f);for(var f=[],_=0,v=0;v<i;v++)if(v%4){var m=s.indexOf(n.charAt(v-1))<<v%4*2,b=s.indexOf(n.charAt(v))>>>6-v%4*2;f[_>>>2]|=(m|b)<<24-_%4*8,_++}return t.create(f,_)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(e){for(var t=O,r=(i=t.lib).WordArray,n=i.Hasher,i=t.algo,s=[],f=[],_=function(G){return 4294967296*(G-(0|G))|0},v=2,m=0;64>m;){var b;t:{b=v;for(var x=e.sqrt(b),R=2;R<=x;R++)if(!(b%R)){b=!1;break t}b=!0}b&&(8>m&&(s[m]=_(e.pow(v,.5))),f[m]=_(e.pow(v,1/3)),m++),v++}var M=[];i=i.SHA256=n.extend({_doReset:function(){this._hash=new r.init(s.slice(0))},_doProcessBlock:function(G,X){for(var g=this._hash.words,E=g[0],C=g[1],I=g[2],z=g[3],Q=g[4],st=g[5],tt=g[6],ft=g[7],it=0;64>it;it++){if(16>it)M[it]=0|G[X+it];else{var ct=M[it-15],mt=M[it-2];M[it]=((ct<<25|ct>>>7)^(ct<<14|ct>>>18)^ct>>>3)+M[it-7]+((mt<<15|mt>>>17)^(mt<<13|mt>>>19)^mt>>>10)+M[it-16]}ct=ft+((Q<<26|Q>>>6)^(Q<<21|Q>>>11)^(Q<<7|Q>>>25))+(Q&st^~Q&tt)+f[it]+M[it],mt=((E<<30|E>>>2)^(E<<19|E>>>13)^(E<<10|E>>>22))+(E&C^E&I^C&I),ft=tt,tt=st,st=Q,Q=z+ct|0,z=I,I=C,C=E,E=ct+mt|0}g[0]=g[0]+E|0,g[1]=g[1]+C|0,g[2]=g[2]+I|0,g[3]=g[3]+z|0,g[4]=g[4]+Q|0,g[5]=g[5]+st|0,g[6]=g[6]+tt|0,g[7]=g[7]+ft|0},_doFinalize:function(){var G=this._data,X=G.words,g=8*this._nDataBytes,E=8*G.sigBytes;return X[E>>>5]|=128<<24-E%32,X[14+(E+64>>>9<<4)]=e.floor(g/4294967296),X[15+(E+64>>>9<<4)]=g,G.sigBytes=4*X.length,this._process(),this._hash},clone:function(){var G=n.clone.call(this);return G._hash=this._hash.clone(),G}}),t.SHA256=n._createHelper(i),t.HmacSHA256=n._createHmacHelper(i)}(Math),function(){function e(){return n.create.apply(n,arguments)}for(var t=O,r=t.lib.Hasher,n=(s=t.x64).Word,i=s.WordArray,s=t.algo,f=[e(1116352408,3609767458),e(1899447441,602891725),e(3049323471,3964484399),e(3921009573,2173295548),e(961987163,4081628472),e(1508970993,3053834265),e(2453635748,2937671579),e(2870763221,3664609560),e(3624381080,2734883394),e(310598401,1164996542),e(607225278,1323610764),e(1426881987,3590304994),e(1925078388,4068182383),e(2162078206,991336113),e(2614888103,633803317),e(3248222580,3479774868),e(3835390401,2666613458),e(4022224774,944711139),e(264347078,2341262773),e(604807628,2007800933),e(770255983,1495990901),e(1249150122,1856431235),e(1555081692,3175218132),e(1996064986,2198950837),e(2554220882,3999719339),e(2821834349,766784016),e(2952996808,2566594879),e(3210313671,3203337956),e(3336571891,1034457026),e(3584528711,2466948901),e(113926993,3758326383),e(338241895,168717936),e(666307205,1188179964),e(773529912,1546045734),e(1294757372,1522805485),e(1396182291,2643833823),e(1695183700,2343527390),e(1986661051,1014477480),e(2177026350,1206759142),e(2456956037,344077627),e(2730485921,1290863460),e(2820302411,3158454273),e(3259730800,3505952657),e(3345764771,106217008),e(3516065817,3606008344),e(3600352804,1432725776),e(4094571909,1467031594),e(275423344,851169720),e(430227734,3100823752),e(506948616,1363258195),e(659060556,3750685593),e(883997877,3785050280),e(958139571,3318307427),e(1322822218,3812723403),e(1537002063,2003034995),e(1747873779,3602036899),e(1955562222,1575990012),e(2024104815,1125592928),e(2227730452,2716904306),e(2361852424,442776044),e(2428436474,593698344),e(2756734187,3733110249),e(3204031479,2999351573),e(3329325298,3815920427),e(3391569614,3928383900),e(3515267271,566280711),e(3940187606,3454069534),e(4118630271,4000239992),e(116418474,1914138554),e(174292421,2731055270),e(289380356,3203993006),e(460393269,320620315),e(685471733,587496836),e(852142971,1086792851),e(1017036298,365543100),e(1126000580,2618297676),e(1288033470,3409855158),e(1501505948,4234509866),e(1607167915,987167468),e(1816402316,1246189591)],_=[],v=0;80>v;v++)_[v]=e();s=s.SHA512=r.extend({_doReset:function(){this._hash=new i.init([new n.init(1779033703,4089235720),new n.init(3144134277,2227873595),new n.init(1013904242,4271175723),new n.init(2773480762,1595750129),new n.init(1359893119,2917565137),new n.init(2600822924,725511199),new n.init(528734635,4215389547),new n.init(1541459225,327033209)])},_doProcessBlock:function(b,x){for(var R=(C=this._hash.words)[0],M=C[1],W=C[2],G=C[3],X=C[4],g=C[5],E=C[6],C=C[7],I=R.high,z=R.low,Q=M.high,st=M.low,tt=W.high,ft=W.low,it=G.high,ct=G.low,mt=X.high,Ft=X.low,bt=g.high,Qt=g.low,Ht=E.high,qt=E.low,Ct=C.high,Lt=C.low,Ot=I,Jt=z,we=Q,ye=st,Fe=tt,me=ft,je=it,Ee=ct,oe=mt,re=Ft,De=bt,xe=Qt,Le=Ht,Ae=qt,Me=Ct,ke=Lt,se=0;80>se;
13se++){var de=_[se];if(16>se)var le=de.high=0|b[x+2*se],Et=de.low=0|b[x+2*se+1];else{le=((Et=(le=_[se-15]).high)>>>1|(fe=le.low)<<31)^(Et>>>8|fe<<24)^Et>>>7;var fe=(fe>>>1|Et<<31)^(fe>>>8|Et<<24)^(fe>>>7|Et<<25),_e=((Et=(_e=_[se-2]).high)>>>19|(Nt=_e.low)<<13)^(Et<<3|Nt>>>29)^Et>>>6,Nt=(Nt>>>19|Et<<13)^(Nt<<3|Et>>>29)^(Nt>>>6|Et<<26),He=(Et=_[se-7]).high,pe=(ve=_[se-16]).high,ve=ve.low;le=(le=(le=le+He+((Et=fe+Et.low)>>>0<fe>>>0?1:0))+_e+((Et=Et+Nt)>>>0<Nt>>>0?1:0))+pe+((Et=Et+ve)>>>0<ve>>>0?1:0),de.high=le,de.low=Et}He=oe&De^~oe&Le,ve=re&xe^~re&Ae,de=Ot&we^Ot&Fe^we&Fe;var pr=Jt&ye^Jt&me^ye&me,vr=(fe=(Ot>>>28|Jt<<4)^(Ot<<30|Jt>>>2)^(Ot<<25|Jt>>>7),_e=(Jt>>>28|Ot<<4)^(Jt<<30|Ot>>>2)^(Jt<<25|Ot>>>7),(Nt=f[se]).high),rr=Nt.low;pe=Me+((oe>>>14|re<<18)^(oe>>>18|re<<14)^(oe<<23|re>>>9))+((Nt=ke+((re>>>14|oe<<18)^(re>>>18|oe<<14)^(re<<23|oe>>>9)))>>>0<ke>>>0?1:0),Me=Le,ke=Ae,Le=De,Ae=xe,De=oe,xe=re,oe=je+(pe=(pe=(pe=pe+He+((Nt=Nt+ve)>>>0<ve>>>0?1:0))+vr+((Nt=Nt+rr)>>>0<rr>>>0?1:0))+le+((Nt=Nt+Et)>>>0<Et>>>0?1:0))+((re=Ee+Nt|0)>>>0<Ee>>>0?1:0)|0,je=Fe,Ee=me,Fe=we,me=ye,we=Ot,ye=Jt,Ot=pe+(de=fe+de+((Et=_e+pr)>>>0<_e>>>0?1:0))+((Jt=Nt+Et|0)>>>0<Nt>>>0?1:0)|0}z=R.low=z+Jt,R.high=I+Ot+(z>>>0<Jt>>>0?1:0),st=M.low=st+ye,M.high=Q+we+(st>>>0<ye>>>0?1:0),ft=W.low=ft+me,W.high=tt+Fe+(ft>>>0<me>>>0?1:0),ct=G.low=ct+Ee,G.high=it+je+(ct>>>0<Ee>>>0?1:0),Ft=X.low=Ft+re,X.high=mt+oe+(Ft>>>0<re>>>0?1:0),Qt=g.low=Qt+xe,g.high=bt+De+(Qt>>>0<xe>>>0?1:0),qt=E.low=qt+Ae,E.high=Ht+Le+(qt>>>0<Ae>>>0?1:0),Lt=C.low=Lt+ke,C.high=Ct+Me+(Lt>>>0<ke>>>0?1:0)},_doFinalize:function(){var b=this._data,x=b.words,R=8*this._nDataBytes,M=8*b.sigBytes;return x[M>>>5]|=128<<24-M%32,x[30+(M+128>>>10<<5)]=Math.floor(R/4294967296),x[31+(M+128>>>10<<5)]=R,b.sigBytes=4*x.length,this._process(),this._hash.toX32()},clone:function(){var b=r.clone.call(this);return b._hash=this._hash.clone(),b},blockSize:32}),t.SHA512=r._createHelper(s),t.HmacSHA512=r._createHmacHelper(s)}(),function(){var e=O,t=(i=e.x64).Word,r=i.WordArray,n=(i=e.algo).SHA512,i=i.SHA384=n.extend({_doReset:function(){this._hash=new r.init([new t.init(3418070365,3238371032),new t.init(1654270250,914150663),new t.init(2438529370,812702999),new t.init(355462360,4144912697),new t.init(1731405415,4290775857),new t.init(2394180231,1750603025),new t.init(3675008525,1694076839),new t.init(1203062813,3204075428)])},_doFinalize:function(){var f=n._doFinalize.call(this);return f.sigBytes-=16,f}});e.SHA384=n._createHelper(i),e.HmacSHA384=n._createHmacHelper(i)}();/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
14 */var V,B="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function $(e){var t,r,n="";for(t=0;t+3<=e.length;t+=3)r=parseInt(e.substring(t,t+3),16),n+=B.charAt(r>>6)+B.charAt(63&r);for(t+1==e.length?(r=parseInt(e.substring(t,t+1),16),n+=B.charAt(r<<2)):t+2==e.length&&(r=parseInt(e.substring(t,t+2),16),n+=B.charAt(r>>2)+B.charAt((3&r)<<4)),"=";(3&n.length)>0;)n+="=";return n}function et(e){var t,r,n,i="",s=0;for(t=0;t<e.length&&e.charAt(t)!="=";++t)(n=B.indexOf(e.charAt(t)))<0||(s==0?(i+=xt(n>>2),r=3&n,s=1):s==1?(i+=xt(r<<2|n>>4),r=15&n,s=2):s==2?(i+=xt(r),i+=xt(n>>2),r=3&n,s=3):(i+=xt(r<<2|n>>4),i+=xt(15&n),s=0));return s==1&&(i+=xt(r<<2)),i}function nt(e){var t,r=et(e),n=new Array;for(t=0;2*t<r.length;++t)n[t]=parseInt(r.substring(2*t,2*t+2),16);return n}function H(e,t,r){e!=null&&(typeof e=="number"?this.fromNumber(e,t,r):t==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,t))}function ut(){return new H(null)}T.appName=="Microsoft Internet Explorer"?(H.prototype.am=function(t,r,n,i,s,f){for(var _=32767&r,v=r>>15;--f>=0;){var m=32767&this[t],b=this[t++]>>15,x=v*m+b*_;s=((m=_*m+((32767&x)<<15)+n[i]+(1073741823&s))>>>30)+(x>>>15)+v*b+(s>>>30),n[i++]=1073741823&m}return s},V=30):T.appName!="Netscape"?(H.prototype.am=function(t,r,n,i,s,f){for(;--f>=0;){var _=r*this[t++]+n[i]+s;s=Math.floor(_/67108864),n[i++]=67108863&_}return s},V=26):(H.prototype.am=function(t,r,n,i,s,f){for(var _=16383&r,v=r>>14;--f>=0;){var m=16383&this[t],b=this[t++]>>14,x=v*m+b*_;s=((m=_*m+((16383&x)<<14)+n[i]+s)>>28)+(x>>14)+v*b,n[i++]=268435455&m}return s},V=28),H.prototype.DB=V,H.prototype.DM=(1<<V)-1,H.prototype.DV=1<<V,H.prototype.FV=Math.pow(2,52),H.prototype.F1=52-V,H.prototype.F2=2*V-52;var _t,wt,jt=new Array;for(_t="0".charCodeAt(0),wt=0;wt<=9;++wt)jt[_t++]=wt;for(_t="a".charCodeAt(0),wt=10;wt<36;++wt)jt[_t++]=wt;for(_t="A".charCodeAt(0),wt=10;wt<36;++wt)jt[_t++]=wt;function xt(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function Zt(e,t){var r=jt[e.charCodeAt(t)];return r==null?-1:r}function Tt(e){var t=ut();return t.fromInt(e),t}function gt(e){var t,r=1;return(t=e>>>16)!=0&&(e=t,r+=16),(t=e>>8)!=0&&(e=t,r+=8),(t=e>>4)!=0&&(e=t,r+=4),(t=e>>2)!=0&&(e=t,r+=2),(t=e>>1)!=0&&(e=t,r+=1),r}function dt(e){this.m=e}function At(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>
vendor: 4,203 bytes, line 14
14>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function Wt(e,t){return e&t}function Kt(e,t){return e|t}function zt(e,t){return e^t}function $t(e,t){return e&~t}function ce(e){if(e==0)return-1;var t=0;return!(65535&e)&&(e>>=16,t+=16),!(255&e)&&(e>>=8,t+=8),!(15&e)&&(e>>=4,t+=4),!(3&e)&&(e>>=2,t+=2),!(1&e)&&++t,t}function ee(e){for(var t=0;e!=0;)e&=e-1,++t;return t}function Ut(){}function Yt(e){return e}function Vt(e){this.r2=ut(),this.q3=ut(),H.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}dt.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},dt.prototype.revert=function(t){return t},dt.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},dt.prototype.mulTo=function(t,r,n){t.multiplyTo(r,n),this.reduce(n)},dt.prototype.sqrTo=function(t,r){t.squareTo(r),this.reduce(r)},At.prototype.convert=function(t){var r=ut();return t.abs().dlShiftTo(this.m.t,r),r.divRemTo(this.m,null,r),t.s<0&&r.compareTo(H.ZERO)>0&&this.m.subTo(r,r),r},At.prototype.revert=function(t){var r=ut();return t.copyTo(r),this.reduce(r),r},At.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var r=0;r<this.m.t;++r){var n=32767&t[r],i=n*this.mpl+((n*this.mph+(t[r]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[n=r+this.m.t]+=this.m.am(0,i,t,r,0,this.m.t);t[n]>=t.DV;)t[n]-=t.DV,t[++n]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},At.prototype.mulTo=function(t,r,n){t.multiplyTo(r,n),this.reduce(n)},At.prototype.sqrTo=function(t,r){t.squareTo(r),this.reduce(r)},H.prototype.copyTo=function(t){for(var r=this.t-1;r>=0;--r)t[r]=this[r];t.t=this.t,t.s=this.s},H.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},H.prototype.fromString=function(t,r){var n;if(r==16)n=4;else if(r==8)n=3;else if(r==256)n=8;else if(r==2)n=1;else if(r==32)n=5;else{if(r!=4)return void this.fromRadix(t,r);n=2}this.t=0,this.s=0;for(var i=t.length,s=!1,f=0;--i>=0;){var _=n==8?255&t[i]:Zt(t,i);_<0?t.charAt(i)=="-"&&(s=!0):(s=!1,f==0?this[this.t++]=_:f+n>this.DB?(this[this.t-1]|=(_&(1<<this.DB-f)-1)<<f,this[this.t++]=_>>this.DB-f):this[this.t-1]|=_<<f,(f+=n)>=this.DB&&(f-=this.DB))}n==8&&128&t[0]&&(this.s=-1,f>0&&(this[this.t-1]|=(1<<this.DB-f)-1<<f)),this.clamp(),s&&H.ZERO.subTo(this,this)},H.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},H.prototype.dlShiftTo=function(t,r){var n;for(n=this.t-1;n>=0;--n)r[n+t]=this[n];for(n=t-1;n>=0;--n)r[n]=0;r.t=this.t+t,r.s=this.s},H.prototype.drShiftTo=function(t,r){for(var n=t;n<this.t;++n)r[n-t]=this[n];r.t=Math.max(this.t-t,0),r.s=this.s},H.prototype.lShiftTo=function(t,r){var n,i=t%this.DB,s=this.DB-i,f=(1<<s)-1,_=Math.floor(t/this.DB),v=this.s<<i&this.DM;for(n=this.t-1;n>=0;--n)r[n+_+1]=this[n]>>s|v,v=(this[n]&f)<<i;for(n=_-1;n>=0;--n)r[n]=0;r[_]=v,r.t=this.t+_+1,r.s=this.s,r.clamp()},H.prototype.rShiftTo=function(t,r){r.s=this.s;var n=Math.floor(t/this.DB);if(n>=this.t)r.t=0;else{var i=t%this.DB,s=this.DB-i,f=(1<<i)-1;r[0]=this[n]>>i;for(var _=n+1;_<this.t;++_)r[_-n-1]|=(this[_]&f)<<s,r[_-n]=this[_]>>i;i>0&&(r[this.t-n-1]|=(this.s&f)<<s),r.t=this.t-n,r.clamp()}},H.prototype.subTo=function(t,r){for(var n=0,i=0,s=Math.min(t.t,this.t);n<s;)i+=this[n]-t[n],r[n++]=i&this.DM,i>>=this.DB;if(t.t<this.t){for(i-=t.s;n<this.t;)i+=this[n],r[n++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;n<t.t;)i-=t[n],r[n++]=i&this.DM,i>>=this.DB;i-=t.s}r.s=i<0?-1:0,i<-1?r[n++]=this.DV+i:i>0&&(r[n++]=i),r.t=n,r.clamp()},H.prototype.multiplyTo=function(t,r){var n=this.abs(),i=t.abs(),s=n.t;for(r.t=s+i.t;--s>=0;)r[s]=0;for(s=0;s<i.t;++s)r[s+n.t]=n.am(0,i[s],r,s,0,n.t);r.s=0,r.clamp(),this.s!=t.s&&H.ZERO.subTo(r,r)},H.prototype.squareTo=function(t){for(var r=this.abs(),n=t.t=2*r.t;--n>=0;)t[n]=0;for(n=0;n<r.t-1;++n){var i=r.am(n,r[n],t,2*n,0,1);(t[n+r.t]+=r.am(n+1,2*r[n],t,2*n+1,i,r.t-n-1))>=r.DV&&(t[n+r.t]-=r.DV,t[n+r.t+1]=1)}t.t>0&&(t[t.t-1]+=r.am(n,r[n],t,2*n,0,1)),t.s=0,t.clamp()},H.prototype.divRemTo=function(t,r,n){var i=t.abs();if(!(i.t<=0)){var s=this.abs();if(s.t<i.t)return r!=null&&r.fromInt(0),void(n!=null&&this.copyTo(n));n==null&&(n=ut());var f=ut(),_=this.s,v=t.s,m=this.DB-gt(i[i.t-1]);m>
140?(i.lShiftTo(m,f),s.lShiftTo(m,n)):(i.copyTo(f),s.copyTo(n));var b=f.t,x=f[b-1];if(x!=0){var R=x*(1<<this.F1)+(b>1?f[b-2]>>this.F2:0),M=this.FV/R,W=(1<<this.F1)/R,G=1<<this.F2,X=n.t,g=X-b,E=r==null?ut():r;for(f.dlShiftTo(g,E),n.compareTo(E)>=0&&(n[n.t++]=1,n.subTo(E,n)),H.ONE.dlShiftTo(b,E),E.subTo(f,f);f.t<b;)f[f.t++]=0;for(;--g>=0;){var C=n[--X]==x?this.DM:Math.floor(n[X]*M+(n[X-1]+G)*W);if((n[X]+=f.am(0,C,n,g,0,b))<C)for(f.dlShiftTo(g,E),n.subTo(E,n);n[X]<--C;)n.subTo(E,n)}r!=null&&(n.drShiftTo(b,r),_!=v&&H.ZERO.subTo(r,r)),n.t=b,n.clamp(),m>0&&n.rShiftTo(m,n),_<0&&H.ZERO.subTo(n,n)}}},H.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(!(1&t))return 0;var r=3&t;return(r=(r=(r=(r=r*(2-(15&t)*r)&15)*(2-(255&t)*r)&255)*(2-((65535&t)*r&65535))&65535)*(2-t*r%this.DV)%this.DV)>0?this.DV-r:-r},H.prototype.isEven=function(){return(this.t>0?1&this[0]:this.s)==0},H.prototype.exp=function(t,r){if(t>4294967295||t<1)return H.ONE;var n=ut(),i=ut(),s=r.convert(this),f=gt(t)-1;for(s.copyTo(n);--f>=0;)if(r.sqrTo(n,i),(t&1<<f)>0)r.mulTo(i,s,n);else{var _=n;n=i,i=_}return r.revert(n)},H.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var r;if(t==16)r=4;else if(t==8)r=3;else if(t==2)r=1;else if(t==32)r=5;else{if(t!=4)return this.toRadix(t);r=2}var n,i=(1<<r)-1,s=!1,f="",_=this.t,v=this.DB-_*this.DB%r;if(_-- >0)for(v<this.DB&&(n=this[_]>>v)>0&&(s=!0,f=xt(n));_>=0;)v<r?(n=(this[_]&(1<<v)-1)<<r-v,n|=this[--_]>>(v+=this.DB-r)):(n=this[_]>>(v-=r)&i,v<=0&&(v+=this.DB,--_)),n>0&&(s=!0),s&&(f+=xt(n));return s?f:"0"},H.prototype.negate=function(){var t=ut();return H.ZERO.subTo(this,t),t},H.prototype.abs=function(){return this.s<0?this.negate():this},H.prototype.compareTo=function(t){var r=this.s-t.s;if(r!=0)return r;var n=this.t;if((r=n-t.t)!=0)return this.s<0?-r:r;for(;--n>=0;)if((r=this[n]-t[n])!=0)return r;return 0},H.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+gt(this[this.t-1]^this.s&this.DM)},H.prototype.mod=function(t){var r=ut();return this.abs().divRemTo(t,null,r),this.s<0&&r.compareTo(H.ZERO)>0&&t.subTo(r,r),r},H.prototype.modPowInt=function(t,r){var n;return n=t<256||r.isEven()?new dt(r):new At(r),this.exp(t,n)},H.ZERO=Tt(0),H.ONE=Tt(1),Ut.prototype.convert=Yt,Ut.prototype.revert=Yt,Ut.prototype.mulTo=function(t,r,n){t.multiplyTo(r,n)},Ut.prototype.sqrTo=function(t,r){t.squareTo(r)},Vt.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var r=ut();return t.copyTo(r),this.reduce(r),r},Vt.prototype.revert=function(t){return t},Vt.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},Vt.prototype.mulTo=function(t,r,n){t.multiplyTo(r,n),this.reduce(n)},Vt.prototype.sqrTo=function(t,r){t.squareTo(r),this.reduce(r)};var N=[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],c=(1<<26)/N[N.length-1];/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
15 */function h(){this.i=0,this.j=0,this.S=new Array}H.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},H.prototype.toRadix=function(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var r=this.chunkSize(t),n=Math.pow(t,r),i=Tt(n),s=ut(),f=ut(),_="";for(this.divRemTo(i,s,f);s.signum()>0;)_=(n+f.intValue()).toString(t).substr(1)+_,s.divRemTo(i,s,f);return f.intValue().toString(t)+_},H.prototype.fromRadix=function(t,r){this.fromInt(0),r==null&&(r=10);for(var n=this.chunkSize(r),i=Math.pow(r,n),s=!1,f=0,_=0,v=0;v<t.length;++v){var m=Zt(t,v);m<0?t.charAt(v)=="-"&&this.signum()==0&&(s=!0):(_=r*_+m,++f>=n&&(this.dMultiply(i),this.dAddOffset(_,0),f=0,_=0))}f>0&&(this.dMultiply(Math.pow(r,f)),this.dAddOffset(_,0)),s&&H.ZERO.subTo(this,this)},H.prototype.fromNumber=function(t,r,n){if(typeof r=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(H.ONE.shiftLeft(t-1),Kt,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(r);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(H.ONE.shiftLeft(t-1),this);else{var i=new Array,s=7&t;i.length=1+(t>>3),r.nextBytes(i),s>0?i[0]&=(1<<s)-1:i[0]=0,this.fromString(i,256)}},H.prototype.bitwiseTo=function(t,r,n){var i,s,f=Math.min(t.t,this.t);for(i=0;i<f;++i)n[i]=r(this[i],t[i]);if(t.t<this.t){for(s=t.s&this.DM,i=f;i<this.t;++i)n[i]=r(this[i],s);n.t=this.t}else{for(s=this.s&this.DM,i=f;i<t.t;++i)n[i]=r(s,t[i]);n.t=t.t}n.s=r(this.s,t.s),n.clamp()},H.prototype.changeBit=function(t,r){var n=H.ONE.shiftLeft(t);return this.bitwiseTo(n,r,n),n},H.prototype.addTo=function(t,r){for(var n=0,i=0,s=Math.min(t.t,this.t);n<s;)i+=this[n]+t[n],r[n++]=i&this.DM,i>>=this.DB;if(t.t<this.t){for(i+=t.s;n<this.t;)i+=this[n],r[n++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;n<t.t;)i+=t[n],r[n++]=i&this.DM,i>>=this.DB;i+=t.s}r.s=i<0?-1:0,i>0?r[n++]=i:i<-1&&(r[n++]=this.DV+i),r.t=n,r.clamp()},H.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},H.prototype.dAddOffset=function(t,r){if(t!=0){for(;this.t<=r;)this[this.t++]=0;for(this[r]+=t;this[r]>=this.DV;)this[r]-=this.DV,++r>=this.t&&(this[this.t++]=0),++this[r]}},H.prototype.multiplyLowerTo=function(t,r,n){var i,s=Math.min(this.t+t.t,r);for(n.s=0,n.t=s;s>0;)n[--s]=0;for(i=n.t-this.t;s<i;++s)n[s+this.t]=this.am(0,t[s],n,s,0,this.t);for(i=Math.min(t.t,r);s<i;++s)this.am(0,t[s],n,s,0,r-s);n.clamp()},H.prototype.multiplyUpperTo=function(t,r,n){--r;var i=n.t=this.t+t.t-r;for(n.s=0;--i>=0;)n[i]=0;for(i=Math.max(r-this.t,0);i<t.t;++i)n[this.t+i-r]=this.am(r-i,t[i],n,0,0,this.t+i-r);n.clamp(),n.drShiftTo(1,n)},H.prototype.modInt=function(t){if(t<=0)return 0;var r=this.DV%t,n=this.s<0?t-1:0;if(this.t>0)if(r==0)n=this[0]%t;else for(var i=this.t-1;i>=0;--i)n=(r*n+this[i])%t;return n},H.prototype.millerRabin=function(t){var r=this.subtract(H.ONE),n=r.getLowestSetBit();if(n<=0)return!1;var i=r.shiftRight(n);(t=t+1>>1)>N.length&&(t=N.length);for(var s=ut(),f=0;f<t;++f){s.fromInt(N[Math.floor(Math.random()*N.length)]);var _=s.modPow(i,this);if(_.compareTo(H.ONE)!=0&&_.compareTo(r)!=0){for(var v=1;v++<n&&_.compareTo(r)!=0;)if((_=_.modPowInt(2,this)).compareTo(H.ONE)==0)return!1;if(_.compareTo(r)!=0)return!1}}return!0},H.prototype.clone=function(){var t=ut();return this.copyTo(t),t},H.prototype.intValue=function(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},H.prototype.byteValue=function(){return this.t==0?this.s:this[0]<<24>>24},H.prototype.shortValue=function(){return this.t==0?this.s:this[0]<<16>>16},H.prototype.signum=function(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1},H.prototype.toByteArray=function(){var t=this.t,r=new Array;r[0]=this.s;var n,i=this.DB-t*this.DB%8,s=0;if(t-- >0)for(i<this.DB&&(n=this[t]>>i)!=(this.s&this.DM)>>i&&(r[s++]=n|this.s<<this.DB-i);t>=0;)i<8?(n=(this[t]&(1<<i)-1)<<8-i,n|=this[--t]>>(i+=this.DB-8)):(n=this[t]>>(i-=8)&255,i<=0&&(i+=this.DB,--t)),128&n&&(n|=-256),s==0&&(128&this.s)!=(128&n)&&++s,(s>0||n!=this.s)&&(r[s++]=n);return r},H.prototype.equals=function(t){return this.compareTo(t)==0},H.prototype.min=function(t){return this.compareTo(t)<0?this:t},H.prototype.max=function(t){return this.compareTo(t)>0?this:t},H.prototype.and=function(t){var r=ut();return this.bitwiseTo(t,Wt,r),r},H.prototype.or=function(t){var r=ut();return this.bitwiseTo(t,Kt,r),r},H.prototype.xor=function(t){var r=ut();return this.bitwiseTo(t,zt,r),r},H.prototype.andNot=function(t){var r=ut();return this.bitwiseTo(t,$t,r),r},H.prototype.not=function(){for(var t=ut(),r=0;r<this.t;++r)t[r]=this.DM&~this[r];return t.t=this.t,t.s=~this.s,t},H.prototype.shiftLeft=function(t){var r=ut();return t<0?this.rShiftTo(-t,r):this.lShiftTo(t,r),r},H.prototype.shiftRight=function(t){var r=ut();return t<0?this.lShiftTo(-t,r):this.rShiftTo(t,r),r},H.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(this[t]!=0)return t*this.DB+ce(this[t]);return this.s<0?this.t*this.DB:-1},H.prototype.bitCount=function(){for(var t=0,r=this.s&this.DM,n=0;n<this.t;++n)t+=ee(this[n]^r);return t},H.prototype.testBit=function(t){var r=Math.floor(t/this.DB);return r>=this.t?this.s!=0:(this[r]&1<<t%this.DB)!=0},H.prototype.setBit=function(t){return this.changeBit(t,Kt)},H.prototype.clearBit=function(t){return this.changeBit(t,$t)}
15,H.prototype.flipBit=function(t){return this.changeBit(t,zt)},H.prototype.add=function(t){var r=ut();return this.addTo(t,r),r},H.prototype.subtract=function(t){var r=ut();return this.subTo(t,r),r},H.prototype.multiply=function(t){var r=ut();return this.multiplyTo(t,r),r},H.prototype.divide=function(t){var r=ut();return this.divRemTo(t,r,null),r},H.prototype.remainder=function(t){var r=ut();return this.divRemTo(t,null,r),r},H.prototype.divideAndRemainder=function(t){var r=ut(),n=ut();return this.divRemTo(t,r,n),new Array(r,n)},H.prototype.modPow=function(t,r){var n,i,s=t.bitLength(),f=Tt(1);if(s<=0)return f;n=s<18?1:s<48?3:s<144?4:s<768?5:6,i=s<8?new dt(r):r.isEven()?new Vt(r):new At(r);var _=new Array,v=3,m=n-1,b=(1<<n)-1;if(_[1]=i.convert(this),n>1){var x=ut();for(i.sqrTo(_[1],x);v<=b;)_[v]=ut(),i.mulTo(x,_[v-2],_[v]),v+=2}var R,M,W=t.t-1,G=!0,X=ut();for(s=gt(t[W])-1;W>=0;){for(s>=m?R=t[W]>>s-m&b:(R=(t[W]&(1<<s+1)-1)<<m-s,W>0&&(R|=t[W-1]>>this.DB+s-m)),v=n;!(1&R);)R>>=1,--v;if((s-=v)<0&&(s+=this.DB,--W),G)_[R].copyTo(f),G=!1;else{for(;v>1;)i.sqrTo(f,X),i.sqrTo(X,f),v-=2;v>0?i.sqrTo(f,X):(M=f,f=X,X=M),i.mulTo(X,_[R],f)}for(;W>=0&&!(t[W]&1<<s);)i.sqrTo(f,X),M=f,f=X,X=M,--s<0&&(s=this.DB-1,--W)}return i.revert(f)},H.prototype.modInverse=function(t){var r=t.isEven();if(this.isEven()&&r||t.signum()==0)return H.ZERO;for(var n=t.clone(),i=this.clone(),s=Tt(1),f=Tt(0),_=Tt(0),v=Tt(1);n.signum()!=0;){for(;n.isEven();)n.rShiftTo(1,n),r?(s.isEven()&&f.isEven()||(s.addTo(this,s),f.subTo(t,f)),s.rShiftTo(1,s)):f.isEven()||f.subTo(t,f),f.rShiftTo(1,f);for(;i.isEven();)i.rShiftTo(1,i),r?(_.isEven()&&v.isEven()||(_.addTo(this,_),v.subTo(t,v)),_.rShiftTo(1,_)):v.isEven()||v.subTo(t,v),v.rShiftTo(1,v);n.compareTo(i)>=0?(n.subTo(i,n),r&&s.subTo(_,s),f.subTo(v,f)):(i.subTo(n,i),r&&_.subTo(s,_),v.subTo(f,v))}return i.compareTo(H.ONE)!=0?H.ZERO:v.compareTo(t)>=0?v.subtract(t):v.signum()<0?(v.addTo(t,v),v.signum()<0?v.add(t):v):v},H.prototype.pow=function(t){return this.exp(t,new Ut)},H.prototype.gcd=function(t){var r=this.s<0?this.negate():this.clone(),n=t.s<0?t.negate():t.clone();if(r.compareTo(n)<0){var i=r;r=n,n=i}var s=r.getLowestSetBit(),f=n.getLowestSetBit();if(f<0)return r;for(s<f&&(f=s),f>0&&(r.rShiftTo(f,r),n.rShiftTo(f,n));r.signum()>0;)(s=r.getLowestSetBit())>0&&r.rShiftTo(s,r),(s=n.getLowestSetBit())>0&&n.rShiftTo(s,n),r.compareTo(n)>=0?(r.subTo(n,r),r.rShiftTo(1,r)):(n.subTo(r,n),n.rShiftTo(1,n));return f>0&&n.lShiftTo(f,n),n},H.prototype.isProbablePrime=function(t){var r,n=this.abs();if(n.t==1&&n[0]<=N[N.length-1]){for(r=0;r<N.length;++r)if(n[0]==N[r])return!0;return!1}if(n.isEven())return!1;for(r=1;r<N.length;){for(var i=N[r],s=r+1;s<N.length&&i<c;)i*=N[s++];for(i=n.modInt(i);r<s;)if(i%N[r++]==0)return!1}return n.millerRabin(t)},H.prototype.square=function(){var t=ut();return this.squareTo(t),t},h.prototype.init=function(t){var r,n,i;for(r=0;r<256;++r)this.S[r]=r;for(n=0,r=0;r<256;++r)n=n+this.S[r]+t[r%t.length]&255,i=this.S[r],this.S[r]=this.S[n],this.S[n]=i;this.i=0,this.j=0},h.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]};var L,K,J;/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
16 */function Z(){(function(t){K[J++]^=255&t,K[J++]^=t>>8&255,K[J++]^=t>>16&255,K[J++]^=t>>24&255,J>=256&&(J-=256)})(new Date().getTime())}if(K==null){var ot;if(K=new Array,J=0,y!==void 0&&(y.crypto!==void 0||y.msCrypto!==void 0)){var lt=y.crypto||y.msCrypto;
16if(lt.getRandomValues){var yt=new Uint8Array(32);for(lt.getRandomValues(yt),ot=0;ot<32;++ot)K[J++]=yt[ot]}else if(T.appName=="Netscape"&&T.appVersion<"5"){var pt=y.crypto.random(32);for(ot=0;ot<pt.length;++ot)K[J++]=255&pt.charCodeAt(ot)}}for(;J<256;)ot=Math.floor(65536*Math.random()),K[J++]=ot>>>8,K[J++]=255&ot;J=0,Z()}function Pt(){if(L==null){for(Z(),(L=function(){return new h}()).init(K),J=0;J<K.length;++J)K[J]=0;J=0}return L.next()}function Mt(){}/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
17 */function Gt(e,t){return new H(e,t)}function ne(e,t,r){for(var n="",i=0;n.length<t;)n+=r(String.fromCharCode.apply(String,e.concat([(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i]))),i+=1;return n}function ht(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
18 */function kt(e,t){this.x=t,this.q=e}function vt(e,t,r,n){this.curve=e,this.x=t,this.y=r,this.z=n==null?H.ONE:n,this.zinv=null}function ge(e,t,r){this.q=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new vt(this,null,null)}Mt.prototype.nextBytes=function(t){var r;for(r=0;r<t.length;++r)t[r]=Pt()},ht.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},ht.prototype.setPublic=function(t,r){if(this.isPublic=!0,this.isPrivate=!1,typeof t!="string")this.n=t,this.e=r;else{if(!(t!=null&&r!=null&&t.length>0&&r.length>0))throw"Invalid RSA public key";this.n=Gt(t,16),this.e=parseInt(r,16)}},ht.prototype.encrypt=function(t){var r=function(f,_){if(_<f.length+11)throw"Message too long for RSA";for(var v=new Array,m=f.length-1;m>=0&&_>0;){var b=f.charCodeAt(m--);b<128?v[--_]=b:b>127&&b<2048?(v[--_]=63&b|128,v[--_]=b>>6|192):(v[--_]=63&b|128,v[--_]=b>>6&63|128,v[--_]=b>>12|224)}v[--_]=0;for(var x=new Mt,R=new Array;_>2;){for(R[0]=0;R[0]==0;)x.nextBytes(R);v[--_]=R[0]}return v[--_]=2,v[--_]=0,new H(v)}(t,this.n.bitLength()+7>>3);if(r==null)return null;var n=this.doPublic(r);if(n==null)return null;var i=n.toString(16);return 1&i.length?"0"+i:i},ht.prototype.encryptOAEP=function(t,r,n){var i=function(v,m,b,x){var R=p.crypto.MessageDigest,M=p.crypto.Util,W=null;if(b||(b="sha1"),typeof b=="string"&&(W=R.getCanonicalAlgName(b),x=R.getHashLength(W),b=function(tt){return te(M.hashHex(ae(tt),W))}),v.length+2*x+2>m)throw"Message too long for RSA";var G,X="";for(G=0;G<m-v.length-2*x-2;G+=1)X+="\0";var g=b("")+X+"�"+v,E=new Array(x);new Mt().nextBytes(E);var C=ne(E,g.length,b),I=[];for(G=0;G<g.length;G+=1)I[G]=g.charCodeAt(G)^C.charCodeAt(G);var z=ne(I,E.length,b),Q=[0];for(G=0;G<E.length;G+=1)Q[G+1]=E[G]^z.charCodeAt(G);
vendor: 6,934 bytes, line 18
18return new H(Q.concat(I))}(t,this.n.bitLength()+7>>3,r,n);if(i==null)return null;var s=this.doPublic(i);if(s==null)return null;var f=s.toString(16);return 1&f.length?"0"+f:f},ht.prototype.type="RSA",kt.prototype.equals=function(t){return t==this||this.q.equals(t.q)&&this.x.equals(t.x)},kt.prototype.toBigInteger=function(){return this.x},kt.prototype.negate=function(){return new kt(this.q,this.x.negate().mod(this.q))},kt.prototype.add=function(t){return new kt(this.q,this.x.add(t.toBigInteger()).mod(this.q))},kt.prototype.subtract=function(t){return new kt(this.q,this.x.subtract(t.toBigInteger()).mod(this.q))},kt.prototype.multiply=function(t){return new kt(this.q,this.x.multiply(t.toBigInteger()).mod(this.q))},kt.prototype.square=function(){return new kt(this.q,this.x.square().mod(this.q))},kt.prototype.divide=function(t){return new kt(this.q,this.x.multiply(t.toBigInteger().modInverse(this.q)).mod(this.q))},vt.prototype.getX=function(){return this.zinv==null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))},vt.prototype.getY=function(){return this.zinv==null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))},vt.prototype.equals=function(t){return t==this||(this.isInfinity()?t.isInfinity():t.isInfinity()?this.isInfinity():!!t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(H.ZERO)&&t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(H.ZERO))},vt.prototype.isInfinity=function(){return this.x==null&&this.y==null||this.z.equals(H.ZERO)&&!this.y.toBigInteger().equals(H.ZERO)},vt.prototype.negate=function(){return new vt(this.curve,this.x,this.y.negate(),this.z)},vt.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var r=t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q),n=t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q);if(H.ZERO.equals(n))return H.ZERO.equals(r)?this.twice():this.curve.getInfinity();var i=new H("3"),s=this.x.toBigInteger(),f=this.y.toBigInteger(),_=(t.x.toBigInteger(),t.y.toBigInteger(),n.square()),v=_.multiply(n),m=s.multiply(_),b=r.square().multiply(this.z),x=b.subtract(m.shiftLeft(1)).multiply(t.z).subtract(v).multiply(n).mod(this.curve.q),R=m.multiply(i).multiply(r).subtract(f.multiply(v)).subtract(b.multiply(r)).multiply(t.z).add(r.multiply(v)).mod(this.curve.q),M=v.multiply(this.z).multiply(t.z).mod(this.curve.q);return new vt(this.curve,this.curve.fromBigInteger(x),this.curve.fromBigInteger(R),M)},vt.prototype.twice=function(){if(this.isInfinity())return this;if(this.y.toBigInteger().signum()==0)return this.curve.getInfinity();var t=new H("3"),r=this.x.toBigInteger(),n=this.y.toBigInteger(),i=n.multiply(this.z),s=i.multiply(n).mod(this.curve.q),f=this.curve.a.toBigInteger(),_=r.square().multiply(t);H.ZERO.equals(f)||(_=_.add(this.z.square().multiply(f)));var v=(_=_.mod(this.curve.q)).square().subtract(r.shiftLeft(3).multiply(s)).shiftLeft(1).multiply(i).mod(this.curve.q),m=_.multiply(t).multiply(r).subtract(s.shiftLeft(1)).shiftLeft(2).multiply(s).subtract(_.square().multiply(_)).mod(this.curve.q),b=i.square().multiply(i).shiftLeft(3).mod(this.curve.q);return new vt(this.curve,this.curve.fromBigInteger(v),this.curve.fromBigInteger(m),b)},vt.prototype.multiply=function(t){if(this.isInfinity())return this;if(t.signum()==0)return this.curve.getInfinity();var r,n=t,i=n.multiply(new H("3")),s=this.negate(),f=this,_=this.curve.q.subtract(t),v=_.multiply(new H("3")),m=new vt(this.curve,this.x,this.y),b=m.negate();for(r=i.bitLength()-2;r>0;--r){f=f.twice();var x=i.testBit(r);x!=n.testBit(r)&&(f=f.add(x?this:s))}for(r=v.bitLength()-2;r>0;--r){m=m.twice();var R=v.testBit(r);R!=_.testBit(r)&&(m=m.add(R?m:b))}return f},vt.prototype.multiplyTwo=function(t,r,n){var i;i=t.bitLength()>n.bitLength()?t.bitLength()-1:n.bitLength()-1;for(var s=this.curve.getInfinity(),f=this.add(r);i>=0;)s=s.twice(),t.testBit(i)?s=n.testBit(i)?s.add(f):s.add(this):n.testBit(i)&&(s=s.add(r)),--i;return s},ge.prototype.getQ=function(){return this.q},ge.prototype.getA=function(){return this.a},ge.prototype.getB=function(){return this.b},ge.prototype.equals=function(t){return t==this||this.q.equals(t.q)&&this.a.equals(t.a)&&this.b.equals(t.b)},ge.prototype.getInfinity=function(){return this.infinity},ge.prototype.fromBigInteger=function(t){return new kt(this.q,t)},ge.prototype.decodePointHex=function(t){switch(parseInt(t.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:return null;case 4:case 6:case 7:var r=(t.length-2)/2,n=t.substr(2,r),i=t.substr(r+2,r);return new vt(this,this.fromBigInteger(new H(n,16)),this.fromBigInteger(new H(i,16)));default:return null}},kt.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},vt.prototype.getEncoded=function(e){var t=function(f,_){var v=f.toByteArrayUnsigned();if(_<v.length)v=v.slice(v.length-_);else for(;_>v.length;)v.unshift(0);return v},r=this.getX().toBigInteger(),n=this.getY().toBigInteger(),i=t(r,32);return e?n.isEven()?i.unshift(2):i.unshift(3):(i.unshift(4),i=i.concat(t(n,32))),i},vt.decodeFrom=function(e,t){t[0];var r=t.length-1,n=t.slice(1,1+r/2),i=t.slice(1+r/2,1+r);n.unshift(0),i.unshift(0);var s=new H(n),f=new H(i);return new vt(e,e.fromBigInteger(s),e.fromBigInteger(f))},vt.decodeFromHex=function(e,t){t.substr(0,2);var r=t.length-2,n=t.substr(2,r/2),i=t.substr(2+r/2,r/2),s=new H(n,16),f=new H(i,16);return new vt(e,e.fromBigInteger(s),e.fromBigInteger(f))},vt.prototype.add2D=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;if(this.x.equals(e.x))return this.y.equals(e.y)?this.twice():this.curve.getInfinity();var t=e.x.subtract(this.x),r=e.y.subtract(this.y).divide(t),n=r.square().subtract(this.x).subtract(e.x),i=r.multiply(this.x.subtract(n)).subtract(this.y);return new vt(this.curve,n,i)},vt.prototype.twice2D=function(){if(this.isInfinity())return this;if(this.y.toBigInteger().signum()==0)return this.curve.getInfinity();var e=this.curve.fromBigInteger(H.valueOf(2)),t=this.curve.fromBigInteger(H.valueOf(3)),r=this.x.square().multiply(t).add(this.curve.a).divide(this.y.multiply(e)),n=r.square().subtract(this.x.multiply(e)),i=r.multiply(this.x.subtract(n)).subtract(this.y);return new vt(this.curve,n,i)},vt.prototype.multiply2D=function(e){if(this.isInfinity())return this;if(e.signum()==0)return this.curve.getInfinity();var t,r=e,n=r.multiply(new H("3")),i=this.negate(),s=this;for(t=n.bitLength()-2;t>0;--t){s=s.twice();var f=n.testBit(t);f!=r.testBit(t)&&(s=s.add2D(f?this:i))}return s},vt.prototype.isOnCurve=function(){var e=this.getX().toBigInteger(),t=this.getY().toBigInteger(),r=this.curve.getA
18().toBigInteger(),n=this.curve.getB().toBigInteger(),i=this.curve.getQ(),s=t.multiply(t).mod(i),f=e.multiply(e).multiply(e).add(r.multiply(e)).add(n).mod(i);return s.equals(f)},vt.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},vt.prototype.validate=function(){var e=this.curve.getQ();if(this.isInfinity())throw new Error("Point is at infinity.");var t=this.getX().toBigInteger(),r=this.getY().toBigInteger();if(t.compareTo(H.ONE)<0||t.compareTo(e.subtract(H.ONE))>0)throw new Error("x coordinate out of bounds");if(r.compareTo(H.ONE)<0||r.compareTo(e.subtract(H.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(e).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0};/*! Mike Samuel (c) 2009 | code.google.com/p/json-sans-eval
19 */var Ke=function(){var e=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"),r={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:`
20`,r:"\r",t:"	"};function n(f,_,v){return _?r[_]:String.fromCharCode(parseInt(v,16))}var i=new String(""),s=Object.hasOwnProperty;return function(f,_){var v,m,b=f.match(e),x=b[0],R=!1;x==="{"?v={}:x==="["?v=[]:(v=[],R=!0);for(var M=[v],W=1-R,G=b.length;W<G;++W){var X;switch((x=b[W]).charCodeAt(0)){default:(X=M[0])[m||X.length]=+x,m=void 0;break;case 34:if((x=x.substring(1,x.length-1)).indexOf("\\")!==-1&&(x=x.replace(t,n)),X=M[0],!m){if(!(X instanceof Array)){m=x||i;break}m=X.length}X[m]=x,m=void 0;break;case 91:X=M[0],M.unshift(X[m||X.length]=[]),m=void 0;break;case 93:M.shift();break;case 102:(X=M[0])[m||X.length]=!1,m=void 0;break;case 110:(X=M[0])[m||X.length]=null,m=void 0;break;case 116:(X=M[0])[m||X.length]=!0,m=void 0;break;case 123:X=M[0],M.unshift(X[m||X.length]={}),m=void 0;break;case 125:M.shift()}}if(R){if(M.length!==1)throw new Error;v=v[0]}else if(M.length)throw new Error;return _&&(v=function g(E,C){var I=E[C];if(I&&(I===void 0?"undefined":l(I))==="object"){var z=null;for(var Q in I)if(s.call(I,Q)&&I!==E){var st=g(I,Q);st!==void 0?I[Q]=st:(z||(z=[]),z.push(Q))}if(z)for(var tt=z.length;--tt>=0;)delete I[z[tt]]}return _.call(E,C,I)}({"":v},"")),v}}();p!==void 0&&p||(S.KJUR=p={}),p.asn1!==void 0&&p.asn1||(p.asn1={}),p.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if(t.substr(0,1)!="-")t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var r=t.substr(1).length;r%2==1?r+=1:t.match(/^[0-7]/)||(r+=2);for(var n="",i=0;i<r;i++)n+="f";t=new H(n,16).xor(e).add(H.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return Xt(e,t)},this.newObject=function(e){var t=p.asn1,r=t.ASN1Object,n=t.DERBoolean,i=t.DERInteger,s=t.DERBitString,f=t.DEROctetString,_=t.DERNull,v=t.DERObjectIdentifier,m=t.DEREnumerated,b=t.DERUTF8String,x=t.DERNumericString,R=t.DERPrintableString,M=t.DERTeletexString,W=t.DERIA5String,G=t.DERUTCTime,X=t.DERGeneralizedTime,g=t.DERVisibleString,E=t.DERBMPString,C=t.DERSequence,I=t.DERSet,z=t.DERTaggedObject,Q=t.ASN1Util.newObject;if(e instanceof t.ASN1Object)return e;var st=Object.keys(e);if(st.length!=1)throw new Error("key of param shall be only one.");var tt=st[0];if(":asn1:bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":"+tt+":")==-1)throw new Error("undefined key: "+tt);if(tt=="bool")return new n(e[tt]);if(tt=="int")return new i(e[tt]);if(tt=="bitstr")return new s(e[tt]);if(tt=="octstr")return new f(e[tt]);if(tt=="null")return new _(e[tt]);if(tt=="oid")return new v(e[tt]);if(tt=="enum")return new m(e[tt]);if(tt=="utf8str")return new b(e[tt]);if(tt=="numstr")return new x(e[tt]);if(tt=="prnstr")return new R(e[tt]);if(tt=="telstr")return new M(e[tt]);if(tt=="ia5str")return new W(e[tt]);if(tt=="utctime")return new G(e[tt]);if(tt=="gentime")return new X(e[tt]);if(tt=="visstr")return new g(e[tt]);if(tt=="bmpstr")return new E(e[tt]);if(tt=="asn1")return new r(e[tt]);if(tt=="seq"){for(var ft=e[tt],it=[],ct=0;ct<ft.length;ct++){var mt=Q(ft[ct]);it.push(mt)}return new C({array:it})}if(tt=="set"){for(ft=e[tt],it=[],ct=0;ct<ft.length;ct++)mt=Q(ft[ct]),it.push(mt);return new I({array:it})}if(tt=="tag"){var Ft=e[tt];if(Object.prototype.toString.call(Ft)==="[object Array]"&&Ft.length==3){var bt=Q(Ft[2]);return new z({tag:Ft[0],explicit:Ft[1],obj:bt})}return new z(Ft)}},this.jsonToASN1HEX=function(e){return this.newObject(e).getEncodedHex()}},p.asn1.ASN1Util.oidHexToInt=function(e){for(var t="",r=parseInt(e.substr(0,2),16),n=(t=Math.floor(r/40)+"."+r%40,""),i=2;i<e.length;i+=2){var s=("00000000"+parseInt(e.substr(i,2),16).toString(2)).slice(-8);n+=s.substr(1,7),s.substr(0,1)=="0"&&(t=t+"."+new H(n,2).toString(10),n="")}return t},p.asn1.ASN1Util.oidIntToHex=function(e){var t=function(v){var m=v.toString(16);return m.length==1&&(m="0"+m),m},r=function(v){var m="",b=new H(v,10).toString(2),x=7-b.length%7;x==7&&(x=0);for(var R="",M=0;M<x;M++)R+="0";for(b=R+b,M=0;M<b.length-1;M+=7){var W=b.substr(M,7);M!=b.length-7&&(W="1"+W),m+=t(parseInt(W,2))}return m};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var n="",i=e.split("."),s=40*parseInt(i[0])+parseInt(i[1]);n+=t(s),i.splice(0,2);for(var f=0;f<i.length;f++)n+=r(i[f]);return n},p.asn1.ASN1Object=function(e){this.params=null,this.getLengthHexFromValue=function(){if(this.hV===void 0||this.hV==null)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);var t=this.hV.length/2,r=t.toString(16);if(r.length%2==1&&(r="0"+r),t<128)return r;var n=r.length/2;if(n>15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);return(128+n).toString(16)+r},this.getEncodedHex=function(){return(this.hTLV==null||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(t){this.params=t},e!=null&&e.tlv!=null&&(this.hTLV=e.tlv,this.isModified=!1)},p.asn1.DERAbstractString=function(e){p.asn1.DERAbstractString.superclass.constructor.call(this),this.get
20String=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=Ne(this.s).toLowerCase()},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},e!==void 0&&(typeof e=="string"?this.setString(e):e.str!==void 0?this.setString(e.str):e.hex!==void 0&&this.setStringHex(e.hex))},a.lang.extend(p.asn1.DERAbstractString,p.asn1.ASN1Object),p.asn1.DERAbstractTime=function(e){p.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(t){var r=t.getTime()+6e4*t.getTimezoneOffset();return new Date(r)},this.formatDate=function(t,r,n){var i=this.zeroPadding,s=this.localDateToUTC(t),f=String(s.getFullYear());r=="utc"&&(f=f.substr(2,2));var _=f+i(String(s.getMonth()+1),2)+i(String(s.getDate()),2)+i(String(s.getHours()),2)+i(String(s.getMinutes()),2)+i(String(s.getSeconds()),2);if(n===!0){var v=s.getMilliseconds();if(v!=0){var m=i(String(v),3);_=_+"."+(m=m.replace(/[0]+$/,""))}}return _+"Z"},this.zeroPadding=function(t,r){return t.length>=r?t:new Array(r-t.length+1).join("0")+t},this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=he(t)},this.setByDateValue=function(t,r,n,i,s,f){var _=new Date(Date.UTC(t,r-1,n,i,s,f,0));this.setByDate(_)},this.getFreshValueHex=function(){return this.hV}},a.lang.extend(p.asn1.DERAbstractTime,p.asn1.ASN1Object),p.asn1.DERAbstractStructured=function(e){p.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,e!==void 0&&e.array!==void 0&&(this.asn1Array=e.array)},a.lang.extend(p.asn1.DERAbstractStructured,p.asn1.ASN1Object),p.asn1.DERBoolean=function(e){p.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV=e==0?"010100":"0101ff"},a.lang.extend(p.asn1.DERBoolean,p.asn1.ASN1Object),p.asn1.DERInteger=function(e){p.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=p.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var r=new H(String(t),10);this.setByBigInteger(r)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},e!==void 0&&(e.bigint!==void 0?this.setByBigInteger(e.bigint):e.int!==void 0?this.setByInteger(e.int):typeof e=="number"?this.setByInteger(e):e.hex!==void 0&&this.setValueHex(e.hex))},a.lang.extend(p.asn1.DERInteger,p.asn1.ASN1Object),p.asn1.DERBitString=function(e){if(e!==void 0&&e.obj!==void 0){var t=p.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}p.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(r){this.hTLV=null,this.isModified=!0,this.hV=r},this.setUnusedBitsAndHexValue=function(r,n){if(r<0||7<r)throw"unused bits shall be from 0 to 7: u = "+r;var i="0"+r;this.hTLV=null,this.isModified=!0,this.hV=i+n},this.setByBinaryString=function(r){var n=8-(r=r.replace(/0+$/,"")).length%8;n==8&&(n=0);for(var i=0;i<=n;i++)r+="0";var s="";for(i=0;i<r.length-1;i+=8){var f=r.substr(i,8),_=parseInt(f,2).toString(16);_.length==1&&(_="0"+_),s+=_}this.hTLV=null,this.isModified=!0,this.hV="0"+n+s},this.setByBooleanArray=function(r){for(var n="",i=0;i<r.length;i++)r[i]==1?n+="1":n+="0";this.setByBinaryString(n)},this.newFalseArray=function(r){for(var n=new Array(r),i=0;i<r;i++)n[i]=!1;return n},this.getFreshValueHex=function(){return this.hV},e!==void 0&&(typeof e=="string"&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):e.hex!==void 0?this.setHexValueIncludingUnusedBits(e.hex):e.bin!==void 0?this.setByBinaryString(e.bin):e.array!==void 0&&this.setByBooleanArray(e.array))},a.lang.extend(p.asn1.DERBitString,p.asn1.ASN1Object),p.asn1.DEROctetString=function(e){if(e!==void 0&&e.obj!==void 0){var t=p.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}p.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},a.lang.extend(p.asn1.DEROctetString,p.asn1.DERAbstractString),p.asn1.DERNull=function(){p.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},a.lang.extend(p.asn1.DERNull,p.asn1.ASN1Object),p.asn1.DERObjectIdentifier=function(e){p.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueOidString=function(t){var r=function(i){var s=function(R){var M=R.toString(16);return M.length==1&&(M="0"+M),M},f=function(R){var M="",W=parseInt(R,10).toString(2),G=7-W.length%7;G==7&&(G=0);for(var X="",g=0;g<G;g++)X+="0";for(W=X+W,g=0;g<W.length-1;g+=7){var E=W.substr(g,7);g!=W.length-7&&(E="1"+E),M+=s(parseInt(E,2))}return M};try{if(!i.match(/^[0-9.]+$/))return null;var _="",v=i.split("."),m=40*parseInt(v[0],10)+parseInt(v[1],10);_+=s(m),v.splice(0,2);for(var b=0;b<v.length;b++)_+=f(v[b]);return _}catch(x){return null}}(t);if(r==null)throw new Error("malformed oid string: "+t);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=r},this.setValueName=function(t){var r=p.asn1.x509.OID.name2oid(t);if(r==="")throw new Error("DERObjectIdentifier oidName undefined: "+t);this.setValueOidString(r)},this.setValueNameOrOid=function(t){t.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(t):this.setValueName(t)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(t){typeof t=="string"?this.setValueNameOrOid(t):t.oid!==void 0?this.setValueNameOrOid(t.oid):t.name!==void 0?this.setValueNameOrOid(t.name):t.hex!==void 0&&this.setValueHex(t.hex)},e!==void 0&&this.setByParam(e)},a.lang.extend(p.asn1.DERObjectIdentifier,p.asn1.ASN1Object),p.asn1.DEREnumerated=function(e){p.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=p.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var r=new H(String(t),10);this.setByBigInteger(r)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},e!==void 0&&(e.int!==void 0?this.setByInteger(e.int):typeof e=="number"?this.setByInteger(e):e.hex!==void 0&&this.setValueHex(e.hex))},a.lang.extend(p.asn1.DEREnumerated,p.asn1.ASN1Object),p.asn1.DERUTF8String=function(e){p.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},a.lang.extend(p.asn1.DERUTF8String,p.asn1.DERAbstractString),p.asn1.DERNumericString=function(e){p.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},a.lang.extend(p.asn1.DERNumericString,p.asn1.DERAbstractString),p.asn1.DERPrintableString=function(e){p.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},a.lang.extend(p.asn1.DERPrintableString,p.asn1.DERAbstractString),p.asn1.DERTeletexString=function(e){p.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},a.lang.extend(p.asn1.DERTeletexString,p.asn1.DERAbstractString),p.asn1.DERIA5String=function(e){p.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},a.lang.extend(p.asn1.DERIA5String,p.asn1.DERAbstractString),p.asn1.DERVisibleString=function(e){p.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="1a"},a.lang.extend(p.asn1.DERVisibleString,p.asn1.DERAbstractString),p.asn1.DERBMPString=function(e){p.asn1.DERBMPString.superclass.constructor.call(this,e),this.hT="1e"},a.lang.extend(p.asn1.DERBMPString,p.asn1.DERAbstractString),p.asn1.DERUTCTime=function(e){p.asn1.DERUTCTime.superclass.constructor.call(this,e),this.hT="17",this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"utc"),this.hV=he(this.s)},this.getFreshValueHex=function(){return this.date===void 0&&this.s===void 0&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=he(this.s)),this.hV},e!==void 0&&(e.str!==void 0?this.setString(e.str):typeof e=="string"&&e.match(/^[0-9]{12}Z$/)?this.setString(e):e.hex!==void 0?this.setStringHex(e.hex):e.date!==void 0&&this.setByDate(e.date))},a.lang.extend(p.asn1.DERUTCTime,p.asn1.DERAbstractTime),p.asn1.DERGeneralizedTime=function(e){p.asn1.DERGeneralizedTime.superclass.constructor.call(this,e),this.hT="18",this.withMillis=!1,this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=he(this.s)},this.getFreshValueHex=function(){return this.date===void 0&&this.s===void 0&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=he(this.s)),this.hV},e!==void 0&&(e.str!==void 0?this.setString(e.str):typeof e=="string"&&e.match(/^[0-9]{14}Z$/)?this.setString(e):e.hex!==void 0?this.setStringHex(e.hex):e.date!==void 0&&this.setByDate(e.date),e.millis===!0&&(this.withMillis=!0))},a.lang.extend(p.asn1.DERGeneralizedTime,p.asn1.DERAbstractTime),p.asn1.DERSequence=function(e){p.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var t="",r=0;r<this.asn1Array.length;r++)t+=this.asn1Array[r].getEncodedHex();return this.hV=t,this.hV}},a.lang.extend(p.asn1.DERSequence,p.asn1.DERAbstractStructured),p.asn1.DERSet=function(e){p.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var t=new Array,r=0;r<this.asn1Array.length;r++){var n=this.asn1Array[r];t.push(n.getEncodedHex())}return this.sortFlag==1&&t.sort(),this.hV=t.join(""),this.hV},e!==void 0&&e.sortflag!==void 0&&e.sortflag==0&&(this.sortFlag=!1)},a.lang.extend(p.asn1.DERSet,p.asn1.DERAbstractStructured),p.asn1.DERTaggedObject=function(e){p.asn1.DERTaggedObject.
20superclass.constructor.call(this);var t=p.asn1;this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(r,n,i){this.hT=n,this.isExplicit=r,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(/^../,n),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(r){r.tag!=null&&(this.hT=r.tag),r.explicit!=null&&(this.isExplicit=r.explicit),r.tage!=null&&(this.hT=r.tage,this.isExplicit=!0),r.tagi!=null&&(this.hT=r.tagi,this.isExplicit=!1),r.obj!=null&&(r.obj instanceof t.ASN1Object?(this.asn1Object=r.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)):l(r.obj)=="object"&&(this.asn1Object=t.ASN1Util.newObject(r.obj),this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},e!=null&&this.setByParam(e)},a.lang.extend(p.asn1.DERTaggedObject,p.asn1.ASN1Object);var p,Se,ie,rt=new function(){};function Ve(e){for(var t=new Array,r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function qe(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t}function Pe(e){for(var t="",r=0;r<e.length;r++){var n=e[r].toString(16);n.length==1&&(n="0"+n),t+=n}return t}function he(e){return Pe(Ve(e))}function Ce(e){return e=(e=(e=e.replace(/\=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")}function be(e){return e.length%4==2?e+="==":e.length%4==3&&(e+="="),e=(e=e.replace(/-/g,"+")).replace(/_/g,"/")}function Dt(e){return e.length%2==1&&(e="0"+e),Ce($(e))}function St(e){return et(be(e))}function Ne(e){return Te(Ie(e))}function Bt(e){return decodeURIComponent(Re(e))}function te(e){for(var t="",r=0;r<e.length-1;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t}function ae(e){for(var t="",r=0;r<e.length;r++)t+=("0"+e.charCodeAt(r).toString(16)).slice(-2);return t}function Je(e){return $(e)}function We(e){var t=Je(e).replace(/(.{64})/g,`$1\r
21`);return t=t.replace(/\r\n$/,"")}function ze(e){return et(e.replace(/[^0-9A-Za-z\/+=]*/g,""))}function Xt(e,t){return"-----BEGIN "+t+`-----\r
22`+We(e)+`\r
23-----END `+t+`-----\r
24`}function ue(e,t){if(e.indexOf("-----BEGIN ")==-1)throw"can't find PEM header: "+t;return ze(e=t!==void 0?(e=e.replace(new RegExp("^[^]*-----BEGIN "+t+"-----"),"")).replace(new RegExp("-----END "+t+"-----[^]*$"),""):(e=e.replace(/^[^]*-----BEGIN [^-]+-----/,"")).replace(/-----END [^-]+-----[^]*$/,""))}function Ue(e){var t,r,n,i,s,f,_,v,m,b,x;if(x=e.match(/^(\d{2}|\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(|\.\d+)Z$/))return v=x[1],t=parseInt(v),v.length===2&&(50<=t&&t<100?t=1900+t:0<=t&&t<50&&(t=2e3+t)),r=parseInt(x[2])-1,n=parseInt(x[3]),i=parseInt(x[4]),s=parseInt(x[5]),f=parseInt(x[6]),_=0,(m=x[7])!==""&&(b=(m.substr(1)+"00").substr(0,3),_=parseInt(b)),Date.UTC(t,r,n,i,s,f,_);throw"unsupported zulu format: "+e}function Ye(e){return~~(Ue(e)/1e3)}function Te(e){return e.replace(/%/g,"")}function Re(e){return e.replace(/(..)/g,"%$1")}function Ge(e){var t="malformed IPv6 address";if(!e.match(/^[0-9A-Fa-f:]+$/))throw t;var r=(e=e.toLowerCase()).split(":").length-1;if(r<2)throw t;var n=":".repeat(7-r+2),i=(e=e.replace("::",n)).split(":");if(i.length!=8)throw t;for(var s=0;s<8;s++)i[s]=("0000"+i[s]).slice(-4);return i.join("")}function Xe(e){if(!e.match(/^[0-9A-Fa-f]{32}$/))throw"malformed IPv6 address octet";for(var t=(e=e.toLowerCase()).match(/.{1,4}/g),r=0;r<8;r++)t[r]=t[r].replace(/^0+/,""),t[r]==""&&(t[r]="0");var n=(e=":"+t.join(":")+":").match(/:(0:){2,}/g);if(n===null)return e.slice(1,-1);var i="";for(r=0;r<n.length;r++)n[r].length>i.length&&(i=n[r]);return(e=e.replace(i,"::")).slice(1,-1)}function Be(e){var t="malformed hex value";if(!e.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw t;if(e.length!=8)return e.length==32?Xe(e):e;try{return parseInt(e.substr(0,2),16)+"."+parseInt(e.substr(2,2),16)+"."+parseInt(e.substr(4,2),16)+"."+parseInt(e.substr(6,2),16)}catch(r){throw t}}function Ie(e){for(var t=encodeURIComponent(e),r="",n=0;n<t.length;n++)t[n]=="%"?(r+=t.substr(n,3),n+=2):r=r+"%"+he(t[n]);return r}function Qe(e){return!(e.length%2!=0||!e.match(/^[0-9a-f]+$/)&&!e.match(/^[0-9A-F]+$/))}function Oe(e){return e.length%2==1?"0"+e:e.substr(0,1)>"7"?"00"+e:e}rt.getLblen=function(e,t){if(e.substr(t+2,1)!="8")return 1;var r=parseInt(e.substr(t+3,1));return r==0?-1:0<r&&r<10?r+1:-2},rt.getL=function(e,t){var r=rt.getLblen(e,t);return r<1?"":e.substr(t+2,2*r)},rt.getVblen=function(e,t){var r;return(r=rt.getL(e,t))==""?-1:(r.substr(0,1)==="8"?new H(r.substr(2),16):new H(r,16)).intValue()},rt.getVidx=function(e,t){var r=rt.getLblen(e,t);return r<0?r:t+2*(r+1)},rt.getV=function(e,t){var r=rt.getVidx(e,t),n=rt.getVblen(e,t);return e.substr(r,2*n)},rt.getTLV=function(e,t){return e.substr(t,2)+rt.getL(e,t)+rt.getV(e,t)},rt.getTLVblen=function(e,t){return 2+2*rt.getLblen(e,t)+2*rt.getVblen(e,t)},rt.getNextSiblingIdx=function(e,t){return rt.getVidx(e,t)+2*rt.getVblen(e,t)},rt.getChildIdx=function(e,t){var r,n,i,s=rt,f=[];r=s.getVidx(e,t),n=2*s.getVblen(e,t),e.substr(t,2)=="03"&&(r+=2,n-=2),i=0;for(var _=r;i<=n;){var v=s.getTLVblen(e,_);if((i+=v)<=n&&f.push(_),_+=v,i>=n)break}return f},rt.getNthChildIdx=function(e,t,r){return rt.getChildIdx(e,t)[r]},rt.getIdxbyList=function(e,t,r,n){var i,s,f=rt;
24return r.length==0?n!==void 0&&e.substr(t,2)!==n?-1:t:(i=r.shift())>=(s=f.getChildIdx(e,t)).length?-1:f.getIdxbyList(e,s[i],r,n)},rt.getIdxbyListEx=function(e,t,r,n){var i,s,f=rt;if(r.length==0)return n!==void 0&&e.substr(t,2)!==n?-1:t;i=r.shift(),s=f.getChildIdx(e,t);for(var _=0,v=0;v<s.length;v++){var m=e.substr(s[v],2);if(typeof i=="number"&&!f.isContextTag(m)&&_==i||typeof i=="string"&&f.isContextTag(m,i))return f.getIdxbyListEx(e,s[v],r,n);f.isContextTag(m)||_++}return-1},rt.getTLVbyList=function(e,t,r,n){var i=rt,s=i.getIdxbyList(e,t,r,n);return s==-1||s>=e.length?null:i.getTLV(e,s)},rt.getTLVbyListEx=function(e,t,r,n){var i=rt,s=i.getIdxbyListEx(e,t,r,n);return s==-1?null:i.getTLV(e,s)},rt.getVbyList=function(e,t,r,n,i){var s,f,_=rt;return(s=_.getIdxbyList(e,t,r,n))==-1||s>=e.length?null:(f=_.getV(e,s),i===!0&&(f=f.substr(2)),f)},rt.getVbyListEx=function(e,t,r,n,i){var s,f,_=rt;return(s=_.getIdxbyListEx(e,t,r,n))==-1?null:(f=_.getV(e,s),e.substr(s,2)=="03"&&i!==!1&&(f=f.substr(2)),f)},rt.getInt=function(e,t,r){r==null&&(r=-1);try{var n=e.substr(t,2);if(n!="02"&&n!="03")return r;var i=rt.getV(e,t);return n=="02"?parseInt(i,16):function(f){try{var _=f.substr(0,2);if(_=="00")return parseInt(f.substr(2),16);var v=parseInt(_,16),m=f.substr(2),b=parseInt(m,16).toString(2);return b=="0"&&(b="00000000"),b=b.slice(0,0-v),parseInt(b,2)}catch(x){return-1}}(i)}catch(s){return r}},rt.getOID=function(e,t,r){r==null&&(r=null);try{return e.substr(t,2)!="06"?r:function(i){if(!Qe(i))return null;try{var s=[],f=i.substr(0,2),_=parseInt(f,16);s[0]=new String(Math.floor(_/40)),s[1]=new String(_%40);for(var v=i.substr(2),m=[],b=0;b<v.length/2;b++)m.push(parseInt(v.substr(2*b,2),16));var x=[],R="";for(b=0;b<m.length;b++)128&m[b]?R+=Ze((127&m[b]).toString(2),7):(R+=Ze((127&m[b]).toString(2),7),x.push(new String(parseInt(R,2))),R="");var M=s.join(".");return x.length>0&&(M=M+"."+x.join(".")),M}catch(W){return null}}(rt.getV(e,t))}catch(n){return r}},rt.getOIDName=function(e,t,r){r==null&&(r=null);try{var n=rt.getOID(e,t,r);if(n==r)return r;var i=p.asn1.x509.OID.oid2name(n);return i==""?n:i}catch(s){return r}},rt.getString=function(e,t,r){r==null&&(r=null);try{return te(rt.getV(e,t))}catch(n){return r}},rt.hextooidstr=function(e){var t=function(R,M){return R.length>=M?R:new Array(M-R.length+1).join("0")+R},r=[],n=e.substr(0,2),i=parseInt(n,16);r[0]=new String(Math.floor(i/40)),r[1]=new String(i%40);for(var s=e.substr(2),f=[],_=0;_<s.length/2;_++)f.push(parseInt(s.substr(2*_,2),16));var v=[],m="";for(_=0;_<f.length;_++)128&f[_]?m+=t((127&f[_]).toString(2),7):(m+=t((127&f[_]).toString(2),7),v.push(new String(parseInt(m,2))),m="");var b=r.join(".");return v.length>0&&(b=b+"."+v.join(".")),b},rt.dump=function(e,t,r,n){var i=rt,s=i.getV,f=i.dump,_=i.getChildIdx,v=e;e instanceof p.asn1.ASN1Object&&(v=e.getEncodedHex());var m=function(tt,ft){return tt.length<=2*ft?tt:tt.substr(0,ft)+"..(total "+tt.length/2+"bytes).."+tt.substr(tt.length-ft,ft)};t===void 0&&(t={ommit_long_octet:32}),r===void 0&&(r=0),n===void 0&&(n="");var b,x=t.ommit_long_octet;if((b=v.substr(r,2))=="01")return(R=s(v,r))=="00"?n+`BOOLEAN FALSE
25`:n+`BOOLEAN TRUE
26`;if(b=="02")return n+"INTEGER "+m(R=s(v,r),x)+`
27`;if(b=="03"){var R=s(v,r);if(i.isASN1HEX(R.substr(2))){var M=n+`BITSTRING, encapsulates
28`;return M+=f(R.substr(2),t,0,n+"  ")}return n+"BITSTRING "+m(R,x)+`
29`}if(b=="04")return R=s(v,r),i.isASN1HEX(R)?(M=n+`OCTETSTRING, encapsulates
30`,M+=f(R,t,0,n+"  ")):n+"OCTETSTRING "+m(R,x)+`
31`;if(b=="05")return n+`NULL
32`;if(b=="06"){var W=s(v,r),G=p.asn1.ASN1Util.oidHexToInt(W),X=p.asn1.x509.OID.oid2name(G),g=G.replace(/\./g," ");return X!=""?n+"ObjectIdentifier "+X+" ("+g+`)
33`:n+"ObjectIdentifier ("+g+`)
34`}if(b=="0a")return n+"ENUMERATED "+parseInt(s(v,r))+`
35`;if(b=="0c")return n+"UTF8String '"+Bt(s(v,r))+`'
36`;if(b=="13")return n+"PrintableString '"+Bt(s(v,r))+`'
37`;if(b=="14")return n+"TeletexString '"+Bt(s(v,r))+`'
38`;if(b=="16")return n+"IA5String '"+Bt(s(v,r))+`'
39`;if(b=="17")return n+"UTCTime "+Bt(s(v,r))+`
40`;if(b=="18")return n+"GeneralizedTime "+Bt(s(v,r))+`
41`;if(b=="1a")return n+"VisualString '"+Bt(s(v,r))+`'
42`;if(b=="1e")return n+"BMPString '"+Bt(s(v,r))+`'
43`;if(b=="30"){if(v.substr(r,4)=="3000")return n+`SEQUENCE {}
44`;M=n+`SEQUENCE
45`;var E=t;if(((z=_(v,r)).length==2||z.length==3)&&v.substr(z[0],2)=="06"&&v.substr(z[z.length-1],2)=="04"){X=i.oidname(s(v,z[0]));var C=JSON.parse(JSON.stringify(t));C.x509ExtName=X,E=C}for(var I=0;I<z.length;I++)M+=f(v,E,z[I],n+"  ");return M}if(b=="31"){M=n+`SET
46`;var z=_(v,r);for(I=0;I<z.length;I++)M+=f(v,t,z[I],n+"  ");return M}if(128&(b=parseInt(b,16))){var Q=31&b;if(32&b){for(M=n+"["+Q+`]
47`,z=_(v,r),I=0;I<z.length;I++)M+=f(v,t,z[I],n+"  ");return M}if(R=s(v,r),rt.isASN1HEX(R)){var M=n+"["+Q+`]
48`;return M+=f(R,t,0,n+"  ")}return(R.substr(0,8)=="68747470"||t.x509ExtName==="subjectAltName"&&Q==2)&&(R=Bt(R)),M=n+"["+Q+"] "+R+`
49`}return n+"UNKNOWN("+b+") "+s(v,r)+`
50`},rt.isContextTag=function(e,t){var r,n;e=e.toLowerCase();try{r=parseInt(e,16)}catch(i){return-1}if(t===void 0)return(192&r)==128;try{return t.match(/^\[[0-9]+\]$/)!=null&&!((n=parseInt(t.substr(1,t.length-1),10))>31)&&(192&r)==128&&(31&r)==n}catch(i){return!1}},rt.isASN1HEX=function(e){var t=rt;if(e.length%2==1)return!1;var r=t.getVblen(e,0),n=e.substr(0,2),i=t.getL(e,0);return e.length-n.length-i.length==2*r},rt.checkStrictDER=function(e,t,r,n,i){var s=rt;if(r===void 0){if(typeof e!="string")throw new Error("not hex string");if(e=e.toLowerCase(),!p.lang.String.isHex(e))throw new Error("not hex string");r=e.length,i=(n=e.length/2)<128?1:Math.ceil(n.toString(16))+1}if(s.getL(e,t).length>2*i)throw new Error("L of TLV too long: idx="+t);var f=s.getVblen(e,t);if(f>n)throw new Error("value of L too long than hex: idx="+t);var _=s.getTLV(e,t),v=_.length-2-s.getL(e,t).length;if(v!==2*f)throw new Error("V string length and L's value not the same:"+v+"/"+2*f);if(t===0&&e.length!=_.length)throw new Error("total length and TLV length unmatch:"+e.length+"!="+_.length);var m=e.substr(t,2);if(m==="02"){var b=s.getVidx(e,t);if(e.substr(b,2)=="00"&&e.charCodeAt(b+2)<56)throw new Error("not least zeros for DER INTEGER")}if(32&parseInt(m,16)){for(var x=s.getVblen(e,t),R=0,M=s.getChildIdx(e,t),W=0;W<M.length;W++)R+=s.getTLV(e,M[W]).length,s.checkStrictDER(e,M[W],r,n,i);if(2*x!=R)throw new Error("sum of children's TLV length and L unmatch: "+2*x+"!="+
50R)}},rt.oidname=function(e){var t=p.asn1;p.lang.String.isHex(e)&&(e=t.ASN1Util.oidHexToInt(e));var r=t.x509.OID.oid2name(e);return r===""&&(r=e),r},p!==void 0&&p||(S.KJUR=p={}),p.lang!==void 0&&p.lang||(p.lang={}),p.lang.String=function(){},typeof D=="function"?(S.utf8tob64u=Se=function(t){return Ce(D.from(t,"utf8").toString("base64"))},S.b64utoutf8=ie=function(t){return D.from(be(t),"base64").toString("utf8")}):(S.utf8tob64u=Se=function(t){return Dt(Te(Ie(t)))},S.b64utoutf8=ie=function(t){return decodeURIComponent(Re(St(t)))}),p.lang.String.isInteger=function(e){return!!e.match(/^[0-9]+$/)||!!e.match(/^-[0-9]+$/)},p.lang.String.isHex=function(e){return Qe(e)},p.lang.String.isBase64=function(e){return!(!(e=e.replace(/\s+/g,"")).match(/^[0-9A-Za-z+\/]+={0,3}$/)||e.length%4!=0)},p.lang.String.isBase64URL=function(e){return!e.match(/[+/=]/)&&(e=be(e),p.lang.String.isBase64(e))},p.lang.String.isIntegerArray=function(e){return!!(e=e.replace(/\s+/g,"")).match(/^\[[0-9,]+\]$/)},p.lang.String.isPrintable=function(e){return e.match(/^[0-9A-Za-z '()+,-./:=?]*$/)!==null},p.lang.String.isIA5=function(e){return e.match(/^[\x20-\x21\x23-\x7f]*$/)!==null},p.lang.String.isMail=function(e){return e.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)!==null};var Ze=function(t,r,n){return n==null&&(n="0"),t.length>=r?t:new Array(r-t.length+1).join(n)+t};p!==void 0&&p||(S.KJUR=p={}),p.crypto!==void 0&&p.crypto||(p.crypto={}),p.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:O.algo.MD5,sha1:O.algo.SHA1,sha224:O.algo.SHA224,sha256:O.algo.SHA256,sha384:O.algo.SHA384,sha512:O.algo.SHA512,ripemd160:O.algo.RIPEMD160},this.getDigestInfoHex=function(e,t){if(this.DIGESTINFOHEAD[t]===void 0)throw"alg not supported in Util.DIGESTINFOHEAD: "+t;return this.DIGESTINFOHEAD[t]+e},this.getPaddedDigestInfoHex=function(e,t,r){var n=this.getDigestInfoHex(e,t),i=r/4;if(n.length+22>i)throw"key is too short for SigAlg: keylen="+r+","+t;for(var s="0001",f="00"+n,_="",v=i-s.length-f.length,m=0;m<v;m+=2)_+="ff";return s+_+f},this.hashString=function(e,t){return new p.crypto.MessageDigest({alg:t}).digestString(e)},this.hashHex=function(e,t){return new p.crypto.MessageDigest({alg:t}).digestHex(e)},this.sha1=function(e){return this.hashString(e,"sha1")},this.sha256=function(e){return this.hashString(e,"sha256")},this.sha256Hex=function(e){return this.hashHex(e,"sha256")},this.sha512=function(e){return this.hashString(e,"sha512")},this.sha512Hex=function(e){return this.hashHex(e,"sha512")},this.isKey=function(e){return e instanceof ht||e instanceof p.crypto.DSA||e instanceof p.crypto.ECDSA}},p.crypto.Util.md5=function(e){return new p.crypto.MessageDigest({alg:"md5",prov:"cryptojs"}).digestString(e)},p.crypto.Util.ripemd160=function(e){return new p.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"}).digestString(e)}
50,p.crypto.Util.SECURERANDOMGEN=new Mt,p.crypto.Util.getRandomHexOfNbytes=function(e){var t=new Array(e);return p.crypto.Util.SECURERANDOMGEN.nextBytes(t),Pe(t)},p.crypto.Util.getRandomBigIntegerOfNbytes=function(e){return new H(p.crypto.Util.getRandomHexOfNbytes(e),16)},p.crypto.Util.getRandomHexOfNbits=function(e){var t=e%8,r=new Array((e-t)/8+1);return p.crypto.Util.SECURERANDOMGEN.nextBytes(r),r[0]=(255<<t&255^255)&r[0],Pe(r)},p.crypto.Util.getRandomBigIntegerOfNbits=function(e){return new H(p.crypto.Util.getRandomHexOfNbits(e),16)},p.crypto.Util.getRandomBigIntegerZeroToMax=function(e){for(var t=e.bitLength();;){var r=p.crypto.Util.getRandomBigIntegerOfNbits(t);if(e.compareTo(r)!=-1)return r}},p.crypto.Util.getRandomBigIntegerMinToMax=function(e,t){var r=e.compareTo(t);if(r==1)throw"biMin is greater than biMax";if(r==0)return e;var n=t.subtract(e);return p.crypto.Util.getRandomBigIntegerZeroToMax(n).add(e)},p.crypto.MessageDigest=function(e){this.setAlgAndProvider=function(t,r){if((t=p.crypto.MessageDigest.getCanonicalAlgName(t))!==null&&r===void 0&&(r=p.crypto.Util.DEFAULTPROVIDER[t]),":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(t)!=-1&&r=="cryptojs"){try{this.md=p.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[t].create()}catch(n){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+n}this.updateString=function(n){this.md.update(n)},this.updateHex=function(n){var i=O.enc.Hex.parse(n);this.md.update(i)},this.digest=function(){return this.md.finalize().toString(O.enc.Hex)},this.digestString=function(n){return this.updateString(n),this.digest()},this.digestHex=function(n){return this.updateHex(n),this.digest()}}if(":sha256:".indexOf(t)!=-1&&r=="sjcl"){try{this.md=new sjcl.hash.sha256}catch(n){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+n}this.updateString=function(n){this.md.update(n)},this.updateHex=function(n){var i=sjcl.codec.hex.toBits(n);this.md.update(i)},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(t){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(t){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(t){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},e!==void 0&&e.alg!==void 0&&(this.algName=e.alg,e.prov===void 0&&(this.provName=p.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},p.crypto.MessageDigest.getCanonicalAlgName=function(e){return typeof e=="string"&&(e=(e=e.toLowerCase()).replace(/-/,"")),e},p.crypto.MessageDigest.getHashLength=function(e){var t=p.crypto.MessageDigest,r=t.getCanonicalAlgName(e);if(t.HASHLENGTH[r]===void 0)throw"not supported algorithm: "+e;return t.HASHLENGTH[r]},p.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},p.crypto.Mac=function(e){this.setAlgAndProvider=function(t,r){if((t=t.toLowerCase())==null&&(t="hmacsha1"),(t=t.toLowerCase()).substr(0,4)!="hmac")throw"setAlgAndProvider unsupported HMAC alg: "+t;r===void 0&&(r=p.crypto.Util.DEFAULTPROVIDER[t]),this.algProv=t+"/"+r;var n=t.substr(4);if(":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(n)!=-1&&r=="cryptojs"){try{var i=p.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[n];this.mac=O.algo.HMAC.create(i,this.pass)}catch(s){throw"setAlgAndProvider hash alg set fail hashAlg="+n+"/"+s}this.updateString=function(s){this.mac.update(s)},this.updateHex=function(s){var f=O.enc.Hex.parse(s);this.mac.update(f)},this.doFinal=function(){return this.mac.finalize().toString(O.enc.Hex)},this.doFinalString=function(s){return this.updateString(s),this.doFinal()},this.doFinalHex=function(s){return this.updateHex(s),this.doFinal()}}},this.updateString=function(t){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(t){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(t){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},this.setPassword=function(t){if(typeof t=="string"){var r=t;return t.length%2!=1&&t.match(/^[0-9A-Fa-f]+$/)||(r=ae(t)),void(this.pass=O.enc.Hex.parse(r))}if((t===void 0?"undefined":l(t))!="object")throw"KJUR.crypto.Mac unsupported password type: "+t;if(r=null,t.hex!==void 0){if(t.hex.length%2!=0||!t.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex password: "+t.hex;r=t.hex}if(t.utf8!==void 0&&(r=Ne(t.utf8)),t.rstr!==void 0&&(r=ae(t.rstr)),t.b64!==void 0&&(r=et(t.b64)),t.b64u!==void 0&&(r=St(t.b64u)),r==null)throw"KJUR.crypto.Mac unsupported password type: "+t;this.pass=O.enc.Hex.parse(r)},e!==void 0&&(e.pass!==void 0&&this.setPassword(e.pass),e.alg!==void 0&&(this.algName=e.alg,e.prov===void 0&&(this.provName=p.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},p.crypto.Signature=function(e){var t=null;if(this._setAlgNames=function(){var r=this.algName.match(/^(.+)with(.+)$/);r&&(this.mdAlgName=r[1].toLowerCase(),this.pubkeyAlgName=r[2].toLowerCase(),this.pubkeyAlgName=="rsaandmgf1"&&this.mdAlgName=="sha"&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(r,n){for(var i="",s=n/4-r.length,f=0;f<s;f++)i+="0";return i+r},this.setAlgAndProvider=function(r,n){if(this._setAlgNames(),n!="cryptojs/jsrsa")throw new Error("provider not supported: "+n);if(":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)!=-1){try{this.md=new p.crypto.MessageDigest({alg:this.mdAlgName})}catch(i){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+i)}this.init=function(i,s){var f=null;try{f=s===void 0?Rt.getKey(i):Rt.getKey(i,s)}catch(_){throw"init failed:"+_}if(f.isPrivate===!0)this.prvKey=f,this.state="SIGN";else{if(f.isPublic!==!0)throw"init failed.:"+f;this.pubKey=f,this.state="VERIFY"}},this.updateString=function(i){this.md.updateString(i)},this.updateHex=function(i){this.md.updateHex(i)},this.sign=function(){if(this.sHashHex=this.md.digest(),this.prvKey===void 0&&this.ecprvhex!==void 0&&this.eccurvename!==void 0&&p.crypto.ECDSA!==void 0&&(this.prvKey=new p.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof ht&&this.pubkeyAlgName==="rsaandmgf1")this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof ht&&this.pubkeyAlgName==="rsa")this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof p.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof p.crypto.DSA))throw"Signature: unsupported private key alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign},this.signString=function(i){return this.updateString(i),this.sign()},this.signHex=function(i){return this.updateHex(i),this.sign()},this.verify=function(i){if(this.sHashHex=this.md.digest(),this.pubKey===void 0&&this.ecpubhex!==void 0&&this.eccurvename!==void 0&&p.crypto.ECDSA!==void 0&&(this.pubKey=new p.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof ht&&this.pubkeyAlgName==="rsaandmgf1")return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,i,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof ht&&this.pubkeyAlgName==="rsa")return this.pubKey.verifyWithMessageHash(this.sHashHex,i);if(p.crypto.ECDSA!==void 0&&this.pubKey instanceof p.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,i);if(p.crypto.DSA!==void 0&&this.pubKey instanceof p.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,i);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(r,n){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(r){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(r){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(r){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(r){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(r){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=e,e!==void 0&&(e.alg!==void 0&&(this.algName=e.alg,e.prov===void 0?this.provName=p.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=e.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),e.psssaltlen!==void 0&&(this.pssSaltLen=e.psssaltlen),e.prvkeypem!==void 0)){if(e.prvkeypas!==void 0)throw"both prvkeypem and prvkeypas parameters not supported";try{t=Rt.getKey(e.prvkeypem),this.init(t)}catch(r){throw"fatal error to load pem private key: "+r}}},p.crypto.Cipher=function(e){},p.crypto.Cipher.encrypt=function(e,t,r){if(t instanceof ht&&t.isPublic){var n=p.crypto.Cipher.getAlgByKeyAndName(t,r);
50if(n==="RSA")return t.encrypt(e);if(n==="RSAOAEP")return t.encryptOAEP(e,"sha1");var i=n.match(/^RSAOAEP(\d+)$/);if(i!==null)return t.encryptOAEP(e,"sha"+i[1]);throw"Cipher.encrypt: unsupported algorithm for RSAKey: "+r}throw"Cipher.encrypt: unsupported key or algorithm"},p.crypto.Cipher.decrypt=function(e,t,r){if(t instanceof ht&&t.isPrivate){var n=p.crypto.Cipher.getAlgByKeyAndName(t,r);if(n==="RSA")return t.decrypt(e);if(n==="RSAOAEP")return t.decryptOAEP(e,"sha1");var i=n.match(/^RSAOAEP(\d+)$/);if(i!==null)return t.decryptOAEP(e,"sha"+i[1]);throw"Cipher.decrypt: unsupported algorithm for RSAKey: "+r}throw"Cipher.decrypt: unsupported key or algorithm"},p.crypto.Cipher.getAlgByKeyAndName=function(e,t){if(e instanceof ht){if(":RSA:RSAOAEP:RSAOAEP224:RSAOAEP256:RSAOAEP384:RSAOAEP512:".indexOf(t)!=-1)return t;if(t==null)return"RSA";throw"getAlgByKeyAndName: not supported algorithm name for RSAKey: "+t}throw"getAlgByKeyAndName: not supported algorithm name: "+t},p.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"}},p!==void 0&&p||(S.KJUR=p={}),p.crypto!==void 0&&p.crypto||(p.crypto={}),p.crypto.ECDSA=function(e){var t=Error,r=H,n=vt,i=p.crypto.ECDSA,s=p.crypto.ECParameterDB,f=i.getName,_=rt,v=_.getVbyListEx,m=_.isASN1HEX,b=new Mt;this.type="EC",this.isPrivate=!1,this.isPublic=!1,this.getBigRandom=function(x){return new r(x.bitLength(),b).mod(x.subtract(r.ONE)).add(r.ONE)},this.setNamedCurve=function(x){this.ecparams=s.getByName(x),this.prvKeyHex=null,this.pubKeyHex=null,this.curveName=x},this.setPrivateKeyHex=function(x){this.isPrivate=!0,this.prvKeyHex=x},this.setPublicKeyHex=function(x){this.isPublic=!0,this.pubKeyHex=x},this.getPublicKeyXYHex=function(){var x=this.pubKeyHex;if(x.substr(0,2)!=="04")throw"this method supports uncompressed format(04) only";var R=this.ecparams.keylen/4;if(x.length!==2+2*R)throw"malformed public key hex length";var M={};return M.x=x.substr(2,R),M.y=x.substr(2+R),M},this.getShortNISTPCurveName=function(){var x=this.curveName;return x==="secp256r1"||x==="NIST P-256"||x==="P-256"||x==="prime256v1"?"P-256":x==="secp384r1"||x==="NIST P-384"||x==="P-384"?"P-384":null},this.generateKeyPairHex=function(){var x=this.ecparams.n,R=this.getBigRandom(x),M=this.ecparams.G.multiply(R),W=M.getX().toBigInteger(),G=M.getY().toBigInteger(),X=this.ecparams.keylen/4,g=("0000000000"+R.toString(16)).slice(-X),E="04"+("0000000000"+W.toString(16)).slice(-X)+("0000000000"+G.toString(16)).slice(-X);return this.setPrivateKeyHex(g),this.setPublicKeyHex(E),{ecprvhex:g,ecpubhex:E}},this.signWithMessageHash=function(x){return this.signHex(x,this.prvKeyHex)},this.signHex=function(x,R){var M=new r(R,16),W=this.ecparams.n,G=new r(x.substring(0,this.ecparams.keylen/4),16);do var X=this.getBigRandom(W),g=this.ecparams.G.multiply(X).getX().toBigInteger().mod(W);while(g.compareTo(r.ZERO)<=0);var E=X.modInverse(W).multiply(G.add(M.multiply(g))).mod(W);return i.biRSSigToASN1Sig(g,E)},this.sign=function(x,R){var M=R,W=this.ecparams.n,G=r.fromByteArrayUnsigned(x);do var X=this.getBigRandom(W),g=this.ecparams.G.multiply(X).getX().toBigInteger().mod(W);while(g.compareTo(H.ZERO)<=0);var E=X.modInverse(W).multiply(G.add(M.multiply(g))).mod(W);return this.serializeSig(g,E)},this.verifyWithMessageHash=function(x,R){return this.verifyHex(x,R,this.pubKeyHex)},this.verifyHex=function(x,R,M){try{var W,G,X=i.parseSigHex(R);W=X.r,G=X.s;var g=n.decodeFromHex(this.ecparams.curve,M),E=new r(x.substring(0,this.ecparams.keylen/4),16);return this.verifyRaw(E,W,G,g)}catch(C){return!1}},this.verify=function(x,R,M){var W,G,X;if(Bitcoin.Util.isArray(R)){var g=this.parseSig(R);W=g.r,G=g.s}else{if((R===void 0?"undefined":l(R))!=="object"||!R.r||!R.s)throw"Invalid value for signature";W=R.r,G=R.s}if(M instanceof vt)X=M;else{if(!Bitcoin.Util.isArray(M))throw"Invalid format for pubkey value, must be byte array or ECPointFp";X=n.decodeFrom(this.ecparams.curve,M)}var E=r.fromByteArrayUnsigned(x);return this.verifyRaw(E,W,G,X)},this.verifyRaw=function(x,R,M,W){var G=this.ecparams.n,X=this.ecparams.G;if(R.compareTo(r.ONE)<0||R.compareTo(G)>=0||M.compareTo(r.ONE)<0||M.compareTo(G)>=0)return!1;var g=M.modInverse(G),E=x.multiply(g).mod(G),C=R.multiply(g).mod(G);return X.multiply(E).add(W.multiply(C)).getX().toBigInteger().mod(G).equals(R)},this.serializeSig=function(x,R){var M=x.toByteArraySigned(),W=R.toByteArraySigned(),G=[];return G.push(2),G.push(M.length),(G=G.concat(M)).push(2),G.push(W.length),(G=G.concat(W)).unshift(G.length),G.unshift(48),G},this.parseSig=function(x){var R;if(x[0]!=48)throw new Error("Signature not a valid DERSequence");if(x[R=2]!=2)throw new Error("First element in signature must be a DERInteger");var M=x.slice(R+2,R+2+x[R+1]);if(x[R+=2+x[R+1]]!=2)throw new Error("Second element in signature must be a DERInteger");var W=x.slice(R+2,R+2+x[R+1]);return R+=2+x[R+1],{r:r.fromByteArrayUnsigned(M),s:r.fromByteArrayUnsigned(W)}},this.parseSigCompact=function(x){if(x.length!==65)throw"Signature has the wrong length";var R=x[0]-27;if(R<0||R>7)throw"Invalid signature type";var M=this.ecparams.n;return{r:r.fromByteArrayUnsigned(x.slice(1,33)).mod(M),s:r.fromByteArrayUnsigned(x.slice(33,65)).mod(M),i:R}},this.readPKCS5PrvKeyHex=function(x){if(m(x)===!1)throw new Error("not ASN.1 hex string");var R,M,W;try{R=v(x,0,["[0]",0],"06"),M=v(x,0,[1],"04");try{W=v(x,0,["[1]",0],"03")}catch(G){}}catch(G){throw new Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=f(R),this.curveName===void 0)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(W),this.setPrivateKeyHex(M),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(x){if(m(x)===!1)throw new t("not ASN.1 hex string");var R,M,W;try{v(x,0,[1,0],"06"),R=v(x,0,[1,1],"06"),M=v(x,0,[2,0,1],"04");try{W=v(x,0,[2,0,"[1]",0],"03")}catch(G){}}catch(G){throw new t("malformed PKCS#8 plain ECC private key")}if(this.curveName=f(R),this.curveName===void 0)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(W),this.setPrivateKeyHex(M),this.isPublic=!1},this.readPKCS8PubKeyHex=function(x){if(m(x)===!1)throw new t("not ASN.1 hex string");var R,M;try{v(x,0,[0,0],"06"),R=v(x,0,[0,1],"06"),M=v(x,0,[1],"03")}catch(W){throw new t("malformed PKCS#8 ECC public key")}if(this.curveName=f(R),this.curveName===null)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(M)},this.readCertPubKeyHex=function(x,R){if(m(x)===!1)throw new t("not ASN.1 hex string");var M,W;try{M=v(x,0,[0,5,0,1],"06"),W=v(x,0,[0,5,1],"03")}catch(G){throw new t("malformed X.509 certificate ECC public key")}if(this.curveName=f(M),this.curveName===null)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(W)},e!==void 0&&e.curve!==void 0&&(this.curveName=e.curve),this.curveName===void 0&&(this.curveName="secp256r1"),this.setNamedCurve(this.curveName),e!==void 0&&(e.prv!==void 0&&this.setPrivateKeyHex(e.prv),e.pub!==void 0&&this.setPublicKeyHex(e.pub))},p.crypto.ECDSA.parseSigHex=function(e){var t=p.crypto.ECDSA.parseSigHexInHexRS(e);return{r:new H(t.r,16),s:new H(t.s,16)}},p.crypto.ECDSA.parseSigHexInHexRS=function(e){var t=rt,r=t.getChildIdx,n=t.getV;if(t.checkStrictDER(e,0),e.substr(0,2)!="30")throw new Error("signature is not a ASN.1 sequence");var i=r(e,0);if(i.length!=2)throw new Error("signature shall have two elements");var s=i[0],f=i[1];if(e.substr(s,2)!="02")throw new Error("1st item not ASN.1 integer");if(e.substr(f,2)!="02")throw new Error("2nd item not ASN.1 integer");return{r:n(e,s),s:n(e,f)}},p.crypto.ECDSA.asn1SigToConcatSig=function(e){var t=p.crypto.ECDSA.parseSigHexInHexRS(e),r=t.r,n=t.s;if(r.substr(0,2)=="00"&&r.length%32==2&&(r=r.substr(2)),n.substr(0,2)=="00"&&n.length%32==2&&(n=n.substr(2)),r.length%32==30&&(r="00"+r),n.length%32==30&&(n="00"+n),r.length%32!=0)throw"unknown ECDSA sig r length error";if(n.length%32!=0)throw"unknown ECDSA sig s length error";return r+n},p.crypto.ECDSA.concatSigToASN1Sig=function(e){if(e.length/2*8%128!=0)throw"unknown ECDSA concatinated r-s sig  length error";var t=e.substr(0,e.length/2),r=e.substr(e.length/2);return p.crypto.ECDSA.hexRSSigToASN1Sig(t,r)},p.crypto.ECDSA.hexRSSigToASN1Sig=function(e,t){var r=new H(e,16),n=new H(t,16);return p.crypto.ECDSA.biRSSigToASN1Sig(r,n)},p.crypto.ECDSA.biRSSigToASN1Sig=function(e,t){var r=p.asn1,n=new r.DERInteger({bigint:e}),i=new r.DERInteger({bigint:t});return new r.DERSequence({array:[n,i]}).getEncodedHex()},p.crypto.ECDSA.getName=function(e){return e==="2b8104001f"?"secp192k1":e==="2a8648ce3d030107"?"secp256r1":e==="2b8104000a"?"secp256k1":e==="2b81040021"?"secp224r1":e==="2b81040022"?"secp384r1":"|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(e)!==-1?"secp256r1":"|secp256k1|".indexOf(e)!==-1?"secp256k1":"|secp224r1|
50NIST P-224|P-224|".indexOf(e)!==-1?"secp224r1":"|secp384r1|NIST P-384|P-384|".indexOf(e)!==-1?"secp384r1":null},p!==void 0&&p||(S.KJUR=p={}),p.crypto!==void 0&&p.crypto||(p.crypto={}),p.crypto.ECParameterDB=new function(){var e={},t={};function r(n){return new H(n,16)}this.getByName=function(n){var i=n;if(t[i]!==void 0&&(i=t[n]),e[i]!==void 0)return e[i];throw"unregistered EC curve name: "+i},this.regist=function(n,i,s,f,_,v,m,b,x,R,M,W){e[n]={};var G=r(s),X=r(f),g=r(_),E=r(v),C=r(m),I=new ge(G,X,g),z=I.decodePointHex("04"+b+x);e[n].name=n,e[n].keylen=i,e[n].curve=I,e[n].G=z,e[n].n=E,e[n].h=C,e[n].oid=M,e[n].info=W;for(var Q=0;Q<R.length;Q++)t[R[Q]]=n}},p.crypto.ECParameterDB.regist("secp128r1",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC","E87579C11079F43DD824993C2CEE5ED3","FFFFFFFE0000000075A30D1B9038A115","1","161FF7528B899B2D0C28607CA52C5B86","CF5AC8395BAFEB13C02DA292DDED7A83",[],"","secp128r1 : SECG curve over a 128 bit prime field"),p.crypto.ECParameterDB.regist("secp160k1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB","938CF935318FDCED6BC28286531733C3F03C4FEE",[],"","secp160k1 : SECG curve over a 160 bit prime field"),p.crypto.ECParameterDB.regist("secp160r1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45","0100000000000000000001F4C8F927AED3CA752257","1","4A96B5688EF573284664698968C38BB913CBFC82","23A628553168947D59DCC912042351377AC5FB32",[],"","secp160r1 : SECG curve over a 160 bit prime field"),p.crypto.ECParameterDB.regist("secp192k1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",[]),p.crypto.ECParameterDB.regist("secp192r1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",[]),p.crypto.ECParameterDB.regist("secp224r1",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",[]),p.crypto.ECParameterDB.regist("secp256k1",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","1","79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",[]),p.crypto.ECParameterDB.regist("secp256r1",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",["NIST P-256","P-256","prime256v1"]),p.crypto.ECParameterDB.regist("secp384r1",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f",["NIST P-384","P-384"]),p.crypto.ECParameterDB.regist("secp521r1",521,"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC","051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409","1","C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66","011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650",["NIST P-521","P-521"]);var Rt=function(){var e=function(m,b,x){return t(O.AES,m,b,x)},t=function(m,b,x,R){var M=O.enc.Hex.parse(b),W=O.enc.Hex.parse(x),G=O.enc.Hex.parse(R),X={};X.key=W,X.iv=G,X.ciphertext=M;var g=m.decrypt(X,W,{iv:G});return O.enc.Hex.stringify(g)},r=function(m,b,x){return n(O.AES,m,b,x)},n=function(m,b,x,R){var M=O.enc.Hex.parse(b),W=O.enc.Hex.parse(x),G=O.enc.Hex.parse(R),X=m.encrypt(M,W,{iv:G}),g=O.enc.Hex.parse(X.toString());return O.enc.Base64.stringify(g)},i={"AES-256-CBC":{proc:e,eproc:r,keylen:32,ivlen:16},"AES-192-CBC":{proc:e,eproc:r,keylen:24,ivlen:16},"AES-128-CBC":{proc:e,eproc:r,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:function(m,b,x){return t(O.TripleDES,m,b,x)},eproc:function(m,b,x){return n(O.TripleDES,m,b,x)},keylen:24,ivlen:8},"DES-CBC":{proc:function(m,b,x){return t(O.DES,m,b,x)},eproc:function(m,b,x){return n(O.DES,m,b,x)},keylen:8,ivlen:8}},s=function(m){var b={},x=m.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));
50x&&(b.cipher=x[1],b.ivsalt=x[2]);var R=m.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));R&&(b.type=R[1]);var M=-1,W=0;m.indexOf(`\r
51\r
52`)!=-1&&(M=m.indexOf(`\r
53\r
54`),W=2),m.indexOf(`
55
56`)!=-1&&(M=m.indexOf(`
57
58`),W=1);var G=m.indexOf("-----END");if(M!=-1&&G!=-1){var X=m.substring(M+2*W,G-W);X=X.replace(/\s+/g,""),b.data=X}return b},f=function(m,b,x){for(var R=x.substring(0,16),M=O.enc.Hex.parse(R),W=O.enc.Utf8.parse(b),G=i[m].keylen+i[m].ivlen,X="",g=null;;){var E=O.algo.MD5.create();if(g!=null&&E.update(g),E.update(W),E.update(M),g=E.finalize(),(X+=O.enc.Hex.stringify(g)).length>=2*G)break}var C={};return C.keyhex=X.substr(0,2*i[m].keylen),C.ivhex=X.substr(2*i[m].keylen,2*i[m].ivlen),C},_=function(m,b,x,R){var M=O.enc.Base64.parse(m),W=O.enc.Hex.stringify(M);return(0,i[b].proc)(W,x,R)};return{version:"1.0.0",parsePKCS5PEM:function(m){return s(m)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(m,b,x){return f(m,b,x)},decryptKeyB64:function(m,b,x,R){return _(m,b,x,R)},getDecryptedKeyHex:function(m,b){var x=s(m),R=(x.type,x.cipher),M=x.ivsalt,W=x.data,G=f(R,b,M).keyhex;return _(W,R,G,M)},getEncryptedPKCS5PEMFromPrvKeyHex:function(m,b,x,R,M){var W="";if(R!==void 0&&R!=null||(R="AES-256-CBC"),i[R]===void 0)throw"KEYUTIL unsupported algorithm: "+R;M!==void 0&&M!=null||(M=function(g){var E=O.lib.WordArray.random(g);return O.enc.Hex.stringify(E)}(i[R].ivlen).toUpperCase());var G=function(g,E,C,I){return(0,i[E].eproc)(g,C,I)}(b,R,f(R,x,M).keyhex,M);return W="-----BEGIN "+m+` PRIVATE KEY-----\r
59`,W+=`Proc-Type: 4,ENCRYPTED\r
60`,W+="DEK-Info: "+R+","+M+`\r
61`,W+=`\r
62`,W+=G.replace(/(.{64})/g,`$1\r
63`),W+=`\r
64-----END `+m+` PRIVATE KEY-----\r
65`},parseHexOfEncryptedPKCS8:function(m){var b=rt,x=b.getChildIdx,R=b.getV,M={},W=x(m,0);if(W.length!=2)throw"malformed format: SEQUENCE(0).items != 2: "+W.length;M.ciphertext=R(m,W[1]);var G=x(m,W[0]);if(G.length!=2)throw"malformed format: SEQUENCE(0.0).items != 2: "+G.length;if(R(m,G[0])!="2a864886f70d01050d")throw"this only supports pkcs5PBES2";var X=x(m,G[1]);if(G.length!=2)throw"malformed format: SEQUENCE(0.0.1).items != 2: "+X.length;var g=x(m,X[1]);if(g.length!=2)throw"malformed format: SEQUENCE(0.0.1.1).items != 2: "+g.length;if(R(m,g[0])!="2a864886f70d0307")throw"this only supports TripleDES";M.encryptionSchemeAlg="TripleDES",M.encryptionSchemeIV=R(m,g[1]);var E=x(m,X[0]);if(E.length!=2)throw"malformed format: SEQUENCE(0.0.1.0).items != 2: "+E.length;if(R(m,E[0])!="2a864886f70d01050c")throw"this only supports pkcs5PBKDF2";var C=x(m,E[1]);if(C.length<2)throw"malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+C.length;M.pbkdf2Salt=R(m,C[0]);var I=R(m,C[1]);try{M.pbkdf2Iter=parseInt(I,16)}catch(z){throw"malformed format pbkdf2Iter: "+I}return M},getPBKDF2KeyHexFromParam:function(m,b){var x=O.enc.Hex.parse(m.pbkdf2Salt),R=m.pbkdf2Iter,M=O.PBKDF2(b,x,{keySize:6,iterations:R});return O.enc.Hex.stringify(M)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(m,b){var x=ue(m,"ENCRYPTED PRIVATE KEY"),R=this.parseHexOfEncryptedPKCS8(x),M=Rt.getPBKDF2KeyHexFromParam(R,b),W={};W.ciphertext=O.enc.Hex.parse(R.ciphertext);var G=O.enc.Hex.parse(M),X=O.enc.Hex.parse(R.encryptionSchemeIV),g=O.TripleDES.decrypt(W,G,{iv:X});return O.enc.Hex.stringify(g)},getKeyFromEncryptedPKCS8PEM:function(m,b){var x=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(m,b);return this.getKeyFromPlainPrivatePKCS8Hex(x)},parsePlainPrivatePKCS8Hex:function(m){var b=rt,x=b.getChildIdx,R=b.getV,M={algparam:null};if(m.substr(0,2)!="30")throw"malformed plain PKCS8 private key(code:001)";var W=x(m,0);if(W.length!=3)throw"malformed plain PKCS8 private key(code:002)";if(m.substr(W[1],2)!="30")throw"malformed PKCS8 private key(code:003)";var G=x(m,W[1]);if(G.length!=2)throw"malformed PKCS8 private key(code:004)";if(m.substr(G[0],2)!="06")throw"malformed PKCS8 private key(code:005)";if(M.algoid=R(m,G[0]),m.substr(G[1],2)=="06"&&(M.algparam=R(m,G[1])),m.substr(W[2],2)!="04")throw"malformed PKCS8 private key(code:006)";return M.keyidx=b.getVidx(m,W[2]),M},getKeyFromPlainPrivatePKCS8PEM:function(m){var b=ue(m,"PRIVATE KEY");
65return this.getKeyFromPlainPrivatePKCS8Hex(b)},getKeyFromPlainPrivatePKCS8Hex:function(m){var b,x=this.parsePlainPrivatePKCS8Hex(m);if(x.algoid=="2a864886f70d010101")b=new ht;else if(x.algoid=="2a8648ce380401")b=new p.crypto.DSA;else{if(x.algoid!="2a8648ce3d0201")throw"unsupported private key algorithm";b=new p.crypto.ECDSA}return b.readPKCS8PrvKeyHex(m),b},_getKeyFromPublicPKCS8Hex:function(m){var b,x=rt.getVbyList(m,0,[0,0],"06");if(x==="2a864886f70d010101")b=new ht;else if(x==="2a8648ce380401")b=new p.crypto.DSA;else{if(x!=="2a8648ce3d0201")throw"unsupported PKCS#8 public key hex";b=new p.crypto.ECDSA}return b.readPKCS8PubKeyHex(m),b},parsePublicRawRSAKeyHex:function(m){var b=rt,x=b.getChildIdx,R=b.getV,M={};if(m.substr(0,2)!="30")throw"malformed RSA key(code:001)";var W=x(m,0);if(W.length!=2)throw"malformed RSA key(code:002)";if(m.substr(W[0],2)!="02")throw"malformed RSA key(code:003)";if(M.n=R(m,W[0]),m.substr(W[1],2)!="02")throw"malformed RSA key(code:004)";return M.e=R(m,W[1]),M},parsePublicPKCS8Hex:function(m){var b=rt,x=b.getChildIdx,R=b.getV,M={algparam:null},W=x(m,0);if(W.length!=2)throw"outer DERSequence shall have 2 elements: "+W.length;var G=W[0];if(m.substr(G,2)!="30")throw"malformed PKCS8 public key(code:001)";var X=x(m,G);if(X.length!=2)throw"malformed PKCS8 public key(code:002)";if(m.substr(X[0],2)!="06")throw"malformed PKCS8 public key(code:003)";if(M.algoid=R(m,X[0]),m.substr(X[1],2)=="06"?M.algparam=R(m,X[1]):m.substr(X[1],2)=="30"&&(M.algparam={},M.algparam.p=b.getVbyList(m,X[1],[0],"02"),M.algparam.q=b.getVbyList(m,X[1],[1],"02"),M.algparam.g=b.getVbyList(m,X[1],[2],"02")),m.substr(W[1],2)!="03")throw"malformed PKCS8 public key(code:004)";return M.key=R(m,W[1]).substr(2),M}}}();Rt.getKey=function(e,t,r){var n=(X=rt).getChildIdx,i=(X.getV,X.getVbyList),s=p.crypto,f=s.ECDSA,_=s.DSA,v=ht,m=ue,b=Rt;if(v!==void 0&&e instanceof v||f!==void 0&&e instanceof f||_!==void 0&&e instanceof _)return e;if(e.curve!==void 0&&e.xy!==void 0&&e.d===void 0)return new f({pub:e.xy,curve:e.curve});if(e.curve!==void 0&&e.d!==void 0)return new f({prv:e.d,curve:e.curve});if(e.kty===void 0&&e.n!==void 0&&e.e!==void 0&&e.d===void 0)return(ct=new v).setPublic(e.n,e.e),ct;if(e.kty===void 0&&e.n!==void 0&&e.e!==void 0&&e.d!==void 0&&e.p!==void 0&&e.q!==void 0&&e.dp!==void 0&&e.dq!==void 0&&e.co!==void 0&&e.qi===void 0)return(ct=new v).setPrivateEx(e.n,e.e,e.d,e.p,e.q,e.dp,e.dq,e.co),ct;if(e.kty===void 0&&e.n!==void 0&&e.e!==void 0&&e.d!==void 0&&e.p===void 0)return(ct=new v).setPrivate(e.n,e.e,e.d),ct;if(e.p!==void 0&&e.q!==void 0&&e.g!==void 0&&e.y!==void 0&&e.x===void 0)return(ct=new _).setPublic(e.p,e.q,e.g,e.y),ct;if(e.p!==void 0&&e.q!==void 0&&e.g!==void 0&&e.y!==void 0&&e.x!==void 0)return(ct=new _).setPrivate(e.p,e.q,e.g,e.y,e.x),ct;if(e.kty==="RSA"&&e.n!==void 0&&e.e!==void 0&&e.d===void 0)return(ct=new v).setPublic(St(e.n),St(e.e)),ct;if(e.kty==="RSA"&&e.n!==void 0&&e.e!==void 0&&e.d!==void 0&&e.p!==void 0&&e.q!==void 0&&e.dp!==void 0&&e.dq!==void 0&&e.qi!==void 0)return(ct=new v).setPrivateEx(St(e.n),St(e.e),St(e.d),St(e.p),St(e.q),St(e.dp),St(e.dq),St(e.qi)),ct;if(e.kty==="RSA"&&e.n!==void 0&&e.e!==void 0&&e.d!==void 0)return(ct=new v).setPrivate(St(e.n),St(e.e),St(e.d)),ct;if(e.kty==="EC"&&e.crv!==void 0&&e.x!==void 0&&e.y!==void 0&&e.d===void 0){var x=(it=new f({curve:e.crv})).ecparams.keylen/4,R="04"+("0000000000"+St(e.x)).slice(-x)+("0000000000"+St(e.y)).slice(-x);return it.setPublicKeyHex(R),it}if(e.kty==="EC"&&e.crv!==void 0&&e.x!==void 0&&e.y!==void 0&&e.d!==void 0){x=(it=new f({curve:e.crv})).ecparams.keylen/4,R="04"+("0000000000"+St(e.x)).slice(-x)+("0000000000"+St(e.y)).slice(-x);var M=("0000000000"+St(e.d)).slice(-x);return it.setPublicKeyHex(R),it.setPrivateKeyHex(M),it}if(r==="pkcs5prv"){var W,G=e,X=rt;if((W=n(G,0)).length===9)(ct=new v).readPKCS5PrvKeyHex(G);else if(W.length===6)(ct=new _).readPKCS5PrvKeyHex(G);else{if(!(W.length>2&&G.substr(W[1],2)==="04"))throw"unsupported PKCS#1/5 hexadecimal key";(ct=new f).readPKCS5PrvKeyHex(G)}return ct}if(r==="pkcs8prv")return ct=b.getKeyFromPlainPrivatePKCS8Hex(e);if(r==="pkcs8pub")return b._getKeyFromPublicPKCS8Hex(e);if(r==="x509pub")return It.getPublicKeyFromCertHex(e);if(e.indexOf("-END CERTIFICATE-",0)!=-1||e.indexOf("-END X509 CERTIFICATE-",0)!=-1||e.indexOf("-END TRUSTED CERTIFICATE-",0)!=-1)return It.getPublicKeyFromCertPEM(e);if(e.indexOf("-END PUBLIC KEY-")!=-1){var g=ue(e,"PUBLIC KEY");return b._getKeyFromPublicPKCS8Hex(g)}if(e.indexOf("-END RSA PRIVATE KEY-")!=-1&&e.indexOf("4,ENCRYPTED")==-1){var E=m(e,"RSA PRIVATE KEY");return b.getKey(E,null,"pkcs5prv")}if(e.indexOf("-END DSA PRIVATE KEY-")!=-1&&e.indexOf("4,ENCRYPTED")==-1){var C=i(bt=m(e,"DSA PRIVATE KEY"),0,[1],"02"),I=i(bt,0,[2],"02"),z=i(bt,0,[3],"02"),Q=i(bt,0,[4],"02"),st=i(bt,0,[5],"02");return(ct=new _).setPrivate(new H(C,16),new H(I,16),new H(z,16),new H(Q,16),new H(st,16)),ct}if(e.indexOf("-END EC PRIVATE KEY-")!=-1&&e.indexOf("4,ENCRYPTED")==-1)return E=m(e,"EC PRIVATE KEY"),b.getKey(E,null,"pkcs5prv");if(e.indexOf("-END PRIVATE KEY-")!=-1)return b.getKeyFromPlainPrivateP
65KCS8PEM(e);if(e.indexOf("-END RSA PRIVATE KEY-")!=-1&&e.indexOf("4,ENCRYPTED")!=-1){var tt=b.getDecryptedKeyHex(e,t),ft=new ht;return ft.readPKCS5PrvKeyHex(tt),ft}if(e.indexOf("-END EC PRIVATE KEY-")!=-1&&e.indexOf("4,ENCRYPTED")!=-1){var it,ct=i(bt=b.getDecryptedKeyHex(e,t),0,[1],"04"),mt=i(bt,0,[2,0],"06"),Ft=i(bt,0,[3,0],"03").substr(2);if(p.crypto.OID.oidhex2name[mt]===void 0)throw"undefined OID(hex) in KJUR.crypto.OID: "+mt;return(it=new f({curve:p.crypto.OID.oidhex2name[mt]})).setPublicKeyHex(Ft),it.setPrivateKeyHex(ct),it.isPublic=!1,it}if(e.indexOf("-END DSA PRIVATE KEY-")!=-1&&e.indexOf("4,ENCRYPTED")!=-1){var bt;return C=i(bt=b.getDecryptedKeyHex(e,t),0,[1],"02"),I=i(bt,0,[2],"02"),z=i(bt,0,[3],"02"),Q=i(bt,0,[4],"02"),st=i(bt,0,[5],"02"),(ct=new _).setPrivate(new H(C,16),new H(I,16),new H(z,16),new H(Q,16),new H(st,16)),ct}if(e.indexOf("-END ENCRYPTED PRIVATE KEY-")!=-1)return b.getKeyFromEncryptedPKCS8PEM(e,t);throw new Error("not supported argument")},Rt.generateKeypair=function(e,t){if(e=="RSA"){var r=t;(f=new ht).generate(r,"10001"),f.isPrivate=!0,f.isPublic=!0;var n=new ht,i=f.n.toString(16),s=f.e.toString(16);return n.setPublic(i,s),n.isPrivate=!1,n.isPublic=!0,(_={}).prvKeyObj=f,_.pubKeyObj=n,_}if(e=="EC"){var f,_,v=t,m=new p.crypto.ECDSA({curve:v}).generateKeyPairHex();return(f=new p.crypto.ECDSA({curve:v})).setPublicKeyHex(m.ecpubhex),f.setPrivateKeyHex(m.ecprvhex),f.isPrivate=!0,f.isPublic=!1,(n=new p.crypto.ECDSA({curve:v})).setPublicKeyHex(m.ecpubhex),n.isPrivate=!1,n.isPublic=!0,(_={}).prvKeyObj=f,_.pubKeyObj=n,_}throw"unknown algorithm: "+e},Rt.getPEM=function(e,t,r,n,i,s){var f=p,_=f.asn1,v=_.DERObjectIdentifier,m=_.DERInteger,b=_.ASN1Util.newObject,x=_.x509.SubjectPublicKeyInfo,R=f.crypto,M=R.DSA,W=R.ECDSA,G=ht;function X(it){return b({seq:[{int:0},{int:{bigint:it.n}},{int:it.e},{int:{bigint:it.d}},{int:{bigint:it.p}},{int:{bigint:it.q}},{int:{bigint:it.dmp1}},{int:{bigint:it.dmq1}},{int:{bigint:it.coeff}}]})}function g(it){return b({seq:[{int:1},{octstr:{hex:it.prvKeyHex}},{tag:["a0",!0,{oid:{name:it.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+it.pubKeyHex}}]}]})}function E(it){return b({seq:[{int:0},{int:{bigint:it.p}},{int:{bigint:it.q}},{int:{bigint:it.g}},{int:{bigint:it.y}},{int:{bigint:it.x}}]})}if((G!==void 0&&e instanceof G||M!==void 0&&e instanceof M||W!==void 0&&e instanceof W)&&e.isPublic==1&&(t===void 0||t=="PKCS8PUB"))return Xt(Q=new x(e).getEncodedHex(),"PUBLIC KEY");if(t=="PKCS1PRV"&&G!==void 0&&e instanceof G&&(r===void 0||r==null)&&e.isPrivate==1)return Xt(Q=X(e).getEncodedHex(),"RSA PRIVATE KEY");if(t=="PKCS1PRV"&&W!==void 0&&e instanceof W&&(r===void 0||r==null)&&e.isPrivate==1){var C=new v({name:e.curveName}).getEncodedHex(),I=g(e).getEncodedHex(),z="";return z+=Xt(C,"EC PARAMETERS"),z+=Xt(I,"EC PRIVATE KEY")}if(t=="PKCS1PRV"&&M!==void 0&&e instanceof M&&(r===void 0||r==null)&&e.isPrivate==1)return Xt(Q=E(e).getEncodedHex(),"DSA PRIVATE KEY");if(t=="PKCS5PRV"&&G!==void 0&&e instanceof G&&r!==void 0&&r!=null&&e.isPrivate==1){var Q=X(e).getEncodedHex();return n===void 0&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",Q,r,n,s)}if(t=="PKCS5PRV"&&W!==void 0&&e instanceof W&&r!==void 0&&r!=null&&e.isPrivate==1)return Q=g(e).getEncodedHex(),n===void 0&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",Q,r,n,s);if(t=="PKCS5PRV"&&M!==void 0&&e instanceof M&&r!==void 0&&r!=null&&e.isPrivate==1)return Q=E(e).getEncodedHex(),n===void 0&&(n="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",Q,r,n,s);var st=function(ct,mt){var Ft=tt(ct,mt);return new b({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:Ft.pbkdf2Salt}},{int:Ft.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:Ft.encryptionSchemeIV}}]}]}]},{octstr:{hex:Ft.ciphertext}}]}).getEncodedHex()},tt=function(ct,mt){var Ft=O.lib.WordArray.random(8),bt=O.lib.WordArray.random(8),Qt=O.PBKDF2(mt,Ft,{keySize:6,iterations:100}),Ht=O.enc.Hex.parse(ct),qt=O.TripleDES.encrypt(Ht,Qt,{iv:bt})+"",Ct={};return Ct.ciphertext=qt,Ct.pbkdf2Salt=O.enc.Hex.stringify(Ft),Ct.pbkdf2Iter=100,Ct.encryptionSchemeAlg="DES-EDE3-CBC",Ct.encryptionSchemeIV=O.enc.Hex.stringify(bt),Ct};if(t=="PKCS8PRV"&&G!=null&&e instanceof G&&e.isPrivate==1){var ft=X(e).getEncodedHex();return Q=b({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:ft}}]}).getEncodedHex(),r===void 0||r==null?Xt(Q,"PRIVATE KEY"):Xt(I=st(Q,r),"ENCRYPTED PRIVATE KEY")}if(t=="PKCS8PRV"&&W!==void 0&&e instanceof W&&e.isPrivate==1)return ft=new b({seq:[{int:1},{octstr:{hex:e.prvKeyHex}},{tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]}]}).getEncodedHex(),Q=b({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:e.curveName}}]},{octstr:{hex:ft}}]}).getEncodedHex(),r===void 0||r==null?Xt(Q,"PRIVATE KEY"):Xt(I=st(Q,r),"ENCRYPTED PRIVATE KEY");if(t=="PKCS8PRV"&&M!==void 0&&e instanceof M&&e.isPrivate==1)return ft=new m({bigint:e.x}).getEncodedHex(),Q=b({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]}]},{octstr:{hex:ft}}]}).getEncodedHex(),r===void 0||r==null?Xt(Q,"PRIVATE KEY"):Xt(I=st(Q,r),"ENCRYPTED PRIVATE KEY");throw new Error("unsupported object nor format")},Rt.getKeyFromCSRPEM=function(e){var t=ue(e,"CERTIFICATE REQUEST");return Rt.getKeyFromCSRHex(t)},Rt.getKeyFromCSRHex=function(e){var t=Rt.parseCSRHex(e);return Rt.getKey(t.p8pubkeyhex,null,"pkcs8pub")},Rt.parseCSRHex=function(e){var t=rt,r=t.getChildIdx,n=t.getTLV,i={},s=e;if(s.substr(0,2)!="30")throw"malformed CSR(code:001)";var f=r(s,0);if(f.length<1)throw"malformed CSR(code:002)";if(s.substr(f[0],2)!="30")throw"malformed CSR(code:003)";var _=r(s,f[0]);if(_.length<3)throw"malformed CSR(code:004)";return i.p8pubkeyhex=n(s,_[2]),i},Rt.getKeyID=function(e){var t=Rt,r=rt;typeof e=="string"&&e.indexOf("BEGIN ")!=-1&&(e=t.getKey(e));var n=ue(t.getPEM(e)),i=r.getIdxbyList(n,0,[1]),s=r.getV(n,i).substring(2);return p.crypto.Util.hashHex(s,"sha1")},Rt.getJWKFromKey=function(e){var t={};if(e instanceof ht&&e.isPrivate)return t.kty="RSA",t.n=Dt(e.n.toString(16)),t.e=Dt(e.e.toString(16)),t.d=Dt(e.d.toString(16)),t.p=Dt(e.p.toString(16)),t.q=Dt(e.q.toString(16)),t.dp=Dt
65(e.dmp1.toString(16)),t.dq=Dt(e.dmq1.toString(16)),t.qi=Dt(e.coeff.toString(16)),t;if(e instanceof ht&&e.isPublic)return t.kty="RSA",t.n=Dt(e.n.toString(16)),t.e=Dt(e.e.toString(16)),t;if(e instanceof p.crypto.ECDSA&&e.isPrivate){if((n=e.getShortNISTPCurveName())!=="P-256"&&n!=="P-384")throw"unsupported curve name for JWT: "+n;var r=e.getPublicKeyXYHex();return t.kty="EC",t.crv=n,t.x=Dt(r.x),t.y=Dt(r.y),t.d=Dt(e.prvKeyHex),t}if(e instanceof p.crypto.ECDSA&&e.isPublic){var n;if((n=e.getShortNISTPCurveName())!=="P-256"&&n!=="P-384")throw"unsupported curve name for JWT: "+n;return r=e.getPublicKeyXYHex(),t.kty="EC",t.crv=n,t.x=Dt(r.x),t.y=Dt(r.y),t}throw"not supported key object"},ht.getPosArrayOfChildrenFromHex=function(e){return rt.getChildIdx(e,0)},ht.getHexValueArrayOfChildrenFromHex=function(e){var t,r=rt.getV,n=r(e,(t=ht.getPosArrayOfChildrenFromHex(e))[0]),i=r(e,t[1]),s=r(e,t[2]),f=r(e,t[3]),_=r(e,t[4]),v=r(e,t[5]),m=r(e,t[6]),b=r(e,t[7]),x=r(e,t[8]);return(t=new Array).push(n,i,s,f,_,v,m,b,x),t},ht.prototype.readPrivateKeyFromPEMString=function(e){var t=ue(e),r=ht.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])},ht.prototype.readPKCS5PrvKeyHex=function(e){var t=ht.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},ht.prototype.readPKCS8PrvKeyHex=function(e){var t,r,n,i,s,f,_,v,m=rt,b=m.getVbyListEx;if(m.isASN1HEX(e)===!1)throw new Error("not ASN.1 hex string");try{t=b(e,0,[2,0,1],"02"),r=b(e,0,[2,0,2],"02"),n=b(e,0,[2,0,3],"02"),i=b(e,0,[2,0,4],"02"),s=b(e,0,[2,0,5],"02"),f=b(e,0,[2,0,6],"02"),_=b(e,0,[2,0,7],"02"),v=b(e,0,[2,0,8],"02")}catch(x){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,r,n,i,s,f,_,v)},ht.prototype.readPKCS5PubKeyHex=function(e){var t=rt,r=t.getV;if(t.isASN1HEX(e)===!1)throw new Error("keyHex is not ASN.1 hex string");var n=t.getChildIdx(e,0);if(n.length!==2||e.substr(n[0],2)!=="02"||e.substr(n[1],2)!=="02")throw new Error("wrong hex for PKCS#5 public key");var i=r(e,n[0]),s=r(e,n[1]);this.setPublic(i,s)},ht.prototype.readPKCS8PubKeyHex=function(e){var t=rt;if(t.isASN1HEX(e)===!1)throw new Error("not ASN.1 hex string");if(t.getTLVbyListEx(e,0,[0,0])!=="06092a864886f70d010101")throw new Error("not PKCS8 RSA public key");var r=t.getTLVbyListEx(e,0,[1,0]);this.readPKCS5PubKeyHex(r)},ht.prototype.readCertPubKeyHex=function(e,t){var r,n;(r=new It).readCertHex(e),n=r.getPublicKeyHex(),this.readPKCS8PubKeyHex(n)};var ir=new RegExp("[^0-9a-f]","gi");function $e(e,t){for(var r="",n=t/4-e.length,i=0;i<n;i++)r+="0";return r+e}function tr(e,t,r){for(var n="",i=0;n.length<t;)n+=te(r(ae(e+String.fromCharCode.apply(String,[(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i])))),i+=1;return n}function er(e){for(var t in p.crypto.Util.DIGESTINFOHEAD){var r=p.crypto.Util.DIGESTINFOHEAD[t],n=r.length;if(e.substring(0,n)==r)return[t,e.substring(n)]}return[]}function It(e){var t,r=rt,n=r.getChildIdx,i=r.getV,s=r.getTLV,f=r.getVbyList,_=r.getVbyListEx,v=r.getTLVbyList,m=r.getTLVbyListEx,b=r.getIdxbyList,x=r.getIdxbyListEx,R=r.getVidx,M=r.oidname,W=r.hextooidstr,G=It,X=ue;try{t=p.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(g){}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 this.hex===null||this.version!==0?this.version:v(this.hex,0,[0,0])!=="a003020102"?(this.version=1,this.foffset=-1,1):(this.version=3,3)},this.getSerialNumberHex=function(){return _(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var g=m(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(g)},this.getAlgorithmIdentifierName=function(g){for(var E in t)if(g===t[E])return E;return M(_(g,0,[0],"06"))},this.getIssuer=function(){return this.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return v(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){return G.hex2dn(this.getIssuerHex())},this.getSubject=function(){return this.getX500Name(this.getSubjectHex())}
65,this.getSubjectHex=function(){return v(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){return G.hex2dn(this.getSubjectHex())},this.getNotBefore=function(){var g=f(this.hex,0,[0,4+this.foffset,0]);return g=g.replace(/(..)/g,"%$1"),g=decodeURIComponent(g)},this.getNotAfter=function(){var g=f(this.hex,0,[0,4+this.foffset,1]);return g=g.replace(/(..)/g,"%$1"),g=decodeURIComponent(g)},this.getPublicKeyHex=function(){return r.getTLVbyList(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyIdx=function(){return b(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var g=this.getPublicKeyIdx();return b(this.hex,g,[1,0],"30")},this.getPublicKey=function(){return Rt.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var g=v(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(g)},this.getSignatureValueHex=function(){return f(this.hex,0,[2],"03",!0)},this.verifySignature=function(g){var E=this.getSignatureAlgorithmField(),C=this.getSignatureValueHex(),I=v(this.hex,0,[0],"30"),z=new p.crypto.Signature({alg:E});return z.init(g),z.updateHex(I),z.verify(C)},this.parseExt=function(g){var E,C,I;if(g===void 0){if(I=this.hex,this.version!==3)return-1;E=b(I,0,[0,7,0],"30"),C=n(I,E)}else{I=ue(g);var z=b(I,0,[0,3,0,0],"06");if(i(I,z)!="2a864886f70d01090e")return void(this.aExtInfo=new Array);E=b(I,0,[0,3,0,1,0],"30"),C=n(I,E),this.hex=I}this.aExtInfo=new Array;for(var Q=0;Q<C.length;Q++){var st={critical:!1},tt=0;n(I,C[Q]).length===3&&(st.critical=!0,tt=1),st.oid=r.hextooidstr(f(I,C[Q],[0],"06"));var ft=b(I,C[Q],[1+tt]);st.vidx=R(I,ft),this.aExtInfo.push(st)}},this.getExtInfo=function(g){var E=this.aExtInfo,C=g;if(g.match(/^[0-9.]+$/)||(C=p.asn1.x509.OID.name2oid(g)),C!==""){for(var I=0;I<E.length;I++)if(E[I].oid===C)return E[I]}},this.getExtBasicConstraints=function(g,E){if(g===void 0&&E===void 0){var C=this.getExtInfo("basicConstraints");if(C===void 0)return;g=s(this.hex,C.vidx),E=C.critical}var I={extname:"basicConstraints"};if(E&&(I.critical=!0),g==="3000")return I;if(g==="30030101ff")return I.cA=!0,I;if(g.substr(0,12)==="30060101ff02"){var z=i(g,10),Q=parseInt(z,16);return I.cA=!0,I.pathLen=Q,I}throw new Error("hExtV parse error: "+g)},this.getExtKeyUsage=function(g,E){if(g===void 0&&E===void 0){var C=this.getExtInfo("keyUsage");if(C===void 0)return;g=s(this.hex,C.vidx),E=C.critical}var I={extname:"keyUsage"};return E&&(I.critical=!0),I.names=this.getExtKeyUsageString(g).split(","),I},this.getExtKeyUsageBin=function(g){if(g===void 0){var E=this.getExtInfo("keyUsage");if(E===void 0)return"";g=s(this.hex,E.vidx)}if(g.length!=8&&g.length!=10)throw new Error("malformed key usage value: "+g);var C="000000000000000"+parseInt(g.substr(6),16).toString(2);return g.length==8&&(C=C.slice(-8)),g.length==10&&(C=C.slice(-16)),(C=C.replace(/0+$/,""))==""&&(C="0"),C},this.getExtKeyUsageString=function(g){for(var E=this.getExtKeyUsageBin(g),C=new Array,I=0;I<E.length;I++)E.substr(I,1)=="1"&&C.push(It.KEYUSAGE_NAME[I]);return C.join(",")},this.getExtSubjectKeyIdentifier=function(g,E){if(g===void 0&&E===void 0){var C=this.getExtInfo("subjectKeyIdentifier");if(C===void 0)return;g=s(this.hex,C.vidx),E=C.critical}var I={extname:"subjectKeyIdentifier"};E&&(I.critical=!0);var z=i(g,0);return I.kid={hex:z},I},this.getExtAuthorityKeyIdentifier=function(g,E){if(g===void 0&&E===void 0){var C=this.getExtInfo("authorityKeyIdentifier");if(C===void 0)return;g=s(this.hex,C.vidx),E=C.critical}var I={extname:"authorityKeyIdentifier"};E&&(I.critical=!0);for(var z=n(g,0),Q=0;Q<z.length;Q++){var st=g.substr(z[Q],2);if(st==="80"&&(I.kid={hex:i(g,z[Q])}),st==="a1"){var tt=s(g,z[Q]),ft=this.getGeneralNames(tt);I.issuer=ft[0].dn}st==="82"&&(I.sn={hex:i(g,z[Q])})}return I},this.getExtExtKeyUsage=function(g,E){if(g===void 0&&E===void 0){var C=this.getExtInfo("extKeyUsage");if(C===void 0)return;g=s(this.hex,C.vidx),E=C.critical}var I={extname:"extKeyUsage",array:[]};E&&(I.critical=!0);for(var z=n(g,0),Q=0;Q<z.length;Q++)I.array.push(M(i(g,z[Q])));return I},this.getExtExtKeyUsageName=function(){var g=this.getExtInfo("extKeyUsage");if(g===void 0)return g;var E=new Array,C=s(this.hex,g.vidx);if(C==="")return E;for(var I=n(C,0),z=0;z<I.length;z++)E.push(M(i(C,I[z])));return E},this.getExtSubjectAltName=function(g,E){if(g===void 0&&E===void 0){var C=this.getExtInfo("subjectAltName");if(C===void 0)return;g=s(this.hex,C.vidx),E=C.critical}var I={extname:"subjectAltName",array:[]};return E&&(I.critical=!0),I.array=this.getGeneralNames(g),I},this.getExtIssuerAltName=function(g,E){if(g===void 0&&E===void 0){var C=this.getExtInfo("issuerAltName");if(C===void 0)return;g=s(this.hex,C.vidx),E=C.critical}var I={extname:"issuerAltName",array:[]};return E&&(I.critical=!0),I.array=this.getGeneralNames(g),I},this.getGeneralNames=function(g){for(var E=n(g,0),C=[],I=0;I<E.length;I++){var z=this.getGeneralName(s(g,E[I]));z!==void 0&&C.push(z)}return C},this.getGeneralName=function(g){var E=g.substr(0,2),C=i(g,0),I=te(C);return E=="81"?{rfc822:I}:E=="82"?{dns:I}:E=="86"?{uri:I}:E=="87"?{ip:Be(C)}:E=="a4"?{dn:this.getX500Name(C)}:void 0},this.getExtSubjectAltName2=function(){var g,E,C,I=this.getExtInfo("subjectAltName");if(I===void 0)return I;for(var z=new Array,Q=s(this.hex,I.vidx),st=n(Q,0),tt=0;tt<st.length;tt++)C=Q.substr(st[tt],2),g=i(Q,st[tt]),C==="81"&&(E=Bt(g),z.push(["MAIL",E])),C==="82"&&(E=Bt(g),z.push(["DNS",E])),C==="84"&&(E=It.hex2dn(g,0),z.push(["DN",E])),C==="86"&&(E=Bt(g),z.push(["URI",E])),C==="87"&&(E=Be(g),z.push(["IP",E]));return z},this.getExtCRLDistributionPoints=function(g,E){if(g===void 0&&E===void 0){var C=this.getExtInfo("cRLDistributionPoints");if(C===void 0)return;g=s(this.hex,C.vidx),E=C.critical}var I={extname:"cRLDistributionPoints",array:[]};E&&(I.critical=!0);for(var z=n(g,0),Q=0;Q<z.length;Q++){var st=s(g,z[Q]);I.array.push(this.getDistributionPoint(st))}return I},this.getDistributionPoint=function(g){for(var E={},C=n(g,0),I=0;I<C.length;I++){var z=g.substr(C[I],2),Q=s(g,C[I]);z=="a0"&&(E.dpname=this.getDistributionPointName(Q))}return E},this.getDistributionPointName=function(g){for(var E={},C=n(g,0),I=0;I<C.length;I++){var z=g.substr(C[I],2),Q=s(g,C[I]);z=="a0"&&(E.full=this.getGeneralNames(Q))}return E},this.getExtCRLDistributionPointsURI=function(){var g=this.getExtInfo("cRLDistributionPoints");if(g===void 0)return g;for(var E=new Array,C=n(this.hex,g.vidx),I=0;I<C.length;I++)try{var z=Bt(f(this.hex,C[I],[0,0,0],"86"));E.push(z)}catch(Q){}return E},this.getExtAIAInfo=function(){var g=this.getExtInfo("authorityInfoAccess");if(g===void 0)return g;for(var E={ocsp:[],caissuer:[]},C=n(this.hex,g.vidx),I=0;I<C.length;I++){var z=f(this.hex,C[I],[0],"06"),Q=f(this.hex,C[I],[1],"86");z==="2b06010505073001"&&E.ocsp.push(Bt(Q)),z==="2b06010505073002"&&E.caissuer.push(Bt(Q))}return E},this.getExtAuthorityInfoAccess=function(g,E){if(g===void 0&&E===void 0){var C=this.getExtInfo("authorityInfoAccess");if(C===void 0)return;g=s(this.hex,C.vidx),E=C.critical}var I={extname:"authorityInfoAccess",array:[]};E&&(I.critical=!0);for(var z=n(g,0),Q=0;Q<z.length;Q++){var st=_(g,z[Q],[0],"06"),tt=Bt(f(g,z[Q],[1],"86"));if(st=="2b06010505073001")I.array.push({ocsp:tt});else{if(st!="2b06010505073002")throw new Error("unknown method: "+st);I.array.push({caissuer:tt})}}return I},this.getExtCertificatePolicies=function(g,E){if(g===void 0&&E===void 0){var C=this.getExtInfo("certificatePolicies");if(C===void 0)return;g=s(this.hex,C.vidx),E=C.critical}var I={extname:"certificatePolicies",array:[]};E&&(I.critical=!0);for(var z=n(g,0),Q=0;Q<z.length;Q++){var st=s(g,z[Q]),tt=this.getPolicyInformation(st);I.array.push(tt)}return I},this.getPolicyInformation=function(g){var E={},C=f(g,0,[0],"06");E.policyoid=M(C);var I=x(g,0,[1],"30");if(I!=-1){E.array=[];for(var z=n(g,I),Q=0;Q<z.length;Q++){var st=s(g,z[Q]),tt=this.getPolicyQualifierInfo(st);E.array.push(tt)}}return E},this.getPolicyQualifierInfo=function(g){var E={},C=f(g,0,[0],"06");
65if(C==="2b06010505070201"){var I=_(g,0,[1],"16");E.cps=te(I)}else if(C==="2b06010505070202"){var z=v(g,0,[1],"30");E.unotice=this.getUserNotice(z)}return E},this.getUserNotice=function(g){for(var E={},C=n(g,0),I=0;I<C.length;I++){var z=s(g,C[I]);z.substr(0,2)!="30"&&(E.exptext=this.getDisplayText(z))}return E},this.getDisplayText=function(g){var E={};return E.type={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"}[g.substr(0,2)],E.str=te(i(g,0)),E},this.getExtCRLNumber=function(g,E){var C={extname:"cRLNumber"};if(E&&(C.critical=!0),g.substr(0,2)=="02")return C.num={hex:i(g,0)},C;throw new Error("hExtV parse error: "+g)},this.getExtCRLReason=function(g,E){var C={extname:"cRLReason"};if(E&&(C.critical=!0),g.substr(0,2)=="0a")return C.code=parseInt(i(g,0),16),C;throw new Error("hExtV parse error: "+g)},this.getExtOcspNonce=function(g,E){var C={extname:"ocspNonce"};E&&(C.critical=!0);var I=i(g,0);return C.hex=I,C},this.getExtOcspNoCheck=function(g,E){var C={extname:"ocspNoCheck"};return E&&(C.critical=!0),C},this.getExtAdobeTimeStamp=function(g,E){if(g===void 0&&E===void 0){var C=this.getExtInfo("adobeTimeStamp");if(C===void 0)return;g=s(this.hex,C.vidx),E=C.critical}var I={extname:"adobeTimeStamp"};E&&(I.critical=!0);var z=n(g,0);if(z.length>1){var Q=s(g,z[1]),st=this.getGeneralName(Q);st.uri!=null&&(I.uri=st.uri)}if(z.length>2){var tt=s(g,z[2]);tt=="0101ff"&&(I.reqauth=!0),tt=="010100"&&(I.reqauth=!1)}return I},this.getX500NameRule=function(g){for(var E=null,C=[],I=0;I<g.length;I++)for(var z=g[I],Q=0;Q<z.length;Q++)C.push(z[Q]);for(I=0;I<C.length;I++){var st=C[I],tt=st.ds,ft=st.value,it=st.type;if(""+tt,tt!="prn"&&tt!="utf8"&&tt!="ia5")return"mixed";if(tt=="ia5"){if(it!="CN")return"mixed";if(p.lang.String.isMail(ft))continue;return"mixed"}if(it=="C"){if(tt=="prn")continue;return"mixed"}if(""+tt,E==null)E=tt;else if(E!==tt)return"mixed"}return E==null?"prn":E},this.getX500Name=function(g){var E=this.getX500NameArray(g);return{array:E,str:this.dnarraytostr(E)}},this.getX500NameArray=function(g){for(var E=[],C=n(g,0),I=0;I<C.length;I++)E.push(this.getRDN(s(g,C[I])));return E},this.getRDN=function(g){for(var E=[],C=n(g,0),I=0;I<C.length;I++)E.push(this.getAttrTypeAndValue(s(g,C[I])));return E},this.getAttrTypeAndValue=function(g){var E={type:null,value:null,ds:null},C=n(g,0),I=f(g,C[0],[],"06"),z=f(g,C[1],[]),Q=p.asn1.ASN1Util.oidHexToInt(I);return E.type=p.asn1.x509.OID.oid2atype(Q),E.value=te(z),E.ds=this.HEX2STAG[g.substr(C[1],2)],E},this.readCertPEM=function(g){this.readCertHex(X(g))},this.readCertHex=function(g){this.hex=g,this.getVersion();try{b(this.hex,0,[0,7],"a3"),this.parseExt()}catch(E){}},this.getParam=function(){var g={};return g.version=this.getVersion(),g.serial={hex:this.getSerialNumberHex()},g.sigalg=this.getSignatureAlgorithmField(),g.issuer=this.getIssuer(),g.notbefore=this.getNotBefore(),g.notafter=this.getNotAfter(),g.subject=this.getSubject(),g.sbjpubkey=Xt(this.getPublicKeyHex(),"PUBLIC KEY"),this.aExtInfo.length>0&&(g.ext=this.getExtParamArray()),g.sighex=this.getSignatureValueHex(),g},this.getExtParamArray=function(g){g==null&&x(this.hex,0,[0,"[3]"])!=-1&&(g=m(this.hex,0,[0,"[3]",0],"30"));for(var E=[],C=n(g,0),I=0;I<C.length;I++){var z=s(g,C[I]),Q=this.getExtParam(z);Q!=null&&E.push(Q)}return E},this.getExtParam=function(g){var E=n(g,0).length;if(E!=2&&E!=3)throw new Error("wrong number elements in Extension: "+E+" "+g);var C=W(f(g,0,[0],"06")),I=!1;E==3&&v(g,0,[1])=="0101ff"&&(I=!0);var z=v(g,0,[E-1,0]),Q=void 0;if(C=="2.5.29.14"?Q=this.getExtSubjectKeyIdentifier(z,I):C=="2.5.29.15"?Q=this.getExtKeyUsage(z,I):C=="2.5.29.17"?Q=this.getExtSubjectAltName(z,I):C=="2.5.29.18"?Q=this.getExtIssuerAltName(z,I):C=="2.5.29.19"?Q=this.getExtBasicConstraints(z,I):C=="2.5.29.31"?Q=this.getExtCRLDistributionPoints(z,I):C=="2.5.29.32"?Q=this.getExtCertificatePolicies(z,I):C=="2.5.29.35"?Q=this.getExtAuthorityKeyIdentifier(z,I):C=="2.5.29.37"?Q=this.getExtExtKeyUsage(z,I):C=="1.3.6.1.5.5.7.1.1"?Q=this.getExtAuthorityInfoAccess(z,I):C=="2.5.29.20"?Q=this.getExtCRLNumber(z,I):C=="2.5.29.21"?Q=this.getExtCRLReason(z,I):C=="1.3.6.1.5.5.7.48.1.2"?Q=this.getExtOcspNonce(z,I):C=="1.3.6.1.5.5.7.48.1.5"?Q=this.getExtOcspNoCheck(z,I):C=="1.2.840.113583.1.1.9.1"&&(Q=this.getExtAdobeTimeStamp(z,I)),Q!=null)return Q;var st={extname:C,extn:z};return I&&(st.critical=!0),st},this.findExt=function(g,E){for(var C=0;C<g.length;C++)if(g[C].extname==E)return g[C];return null},this.updateExtCDPFullURI=function(g,E){var C=this.findExt(g,"cRLDistributionPoints");if(C!=null&&C.array!=null){for(var I=C.array,z=0;z<I.length;z++)if(I[z].dpname!=null&&I[z].dpname.full!=null)for(var Q=I[z].dpname.full,st=0;st<Q.length;st++){var tt=Q[z];tt.uri!=null&&(tt.uri=E)}}},this.updateExtAIAOCSP=function(g,E){var C=this.findExt(g,"authorityInfoAccess");if(C!=null&&C.array!=null)for(var I=C.array,z=0;z<I.length;z++)I[z].ocsp!=null&&(I[z].ocsp=E)},this.updateExtAIACAIssuer=function(g,E){var C=this.findExt(g,"authorityInfoAccess");if(C!=null&&C.array!=null)for(var I=C.array,z=0;z<I.length;z++)I[z].caissuer!=null&&(I[z].caissuer=E)},this.dnarraytostr=function(g){return"/"+g.map(function(E){return function(I){return I.map(function(z){return function(st){return st.type+"="+st.value}(z)}).join("+")}(E)}).join("/")},this.getInfo=function(){var g,E,C,I=function(Qt){return JSON.stringify(Qt.array).replace(/[\[\]\{\}\"]/g,"")},z=function(Qt){for(var Ht="",qt=Qt.array,Ct=0;Ct<qt.length;Ct++){var Lt=qt[Ct];
65if(Ht+="    policy oid: "+Lt.policyoid+`
66`,Lt.array!==void 0)for(var Ot=0;Ot<Lt.array.length;Ot++){var Jt=Lt.array[Ot];Jt.cps!==void 0&&(Ht+="    cps: "+Jt.cps+`
67`)}}return Ht},Q=function(Qt){for(var Ht="",qt=Qt.array,Ct=0;Ct<qt.length;Ct++){var Lt=qt[Ct];try{Lt.dpname.full[0].uri!==void 0&&(Ht+="    "+Lt.dpname.full[0].uri+`
68`)}catch(Ot){}try{Lt.dname.full[0].dn.hex!==void 0&&(Ht+="    "+It.hex2dn(Lt.dpname.full[0].dn.hex)+`
69`)}catch(Ot){}}return Ht},st=function(Qt){for(var Ht="",qt=Qt.array,Ct=0;Ct<qt.length;Ct++){var Lt=qt[Ct];Lt.caissuer!==void 0&&(Ht+="    caissuer: "+Lt.caissuer+`
70`),Lt.ocsp!==void 0&&(Ht+="    ocsp: "+Lt.ocsp+`
71`)}return Ht};if(g=`Basic Fields
72`,g+="  serial number: "+this.getSerialNumberHex()+`
73`,g+="  signature algorithm: "+this.getSignatureAlgorithmField()+`
74`,g+="  issuer: "+this.getIssuerString()+`
75`,g+="  notBefore: "+this.getNotBefore()+`
76`,g+="  notAfter: "+this.getNotAfter()+`
77`,g+="  subject: "+this.getSubjectString()+`
78`,g+=`  subject public key info: 
79`,g+="    key algorithm: "+(E=this.getPublicKey()).type+`
80`,E.type==="RSA"&&(g+="    n="+Oe(E.n.toString(16)).substr(0,16)+`...
81`,g+="    e="+Oe(E.e.toString(16))+`
82`),(C=this.aExtInfo)!=null){g+=`X509v3 Extensions:
83`;for(var tt=0;tt<C.length;tt++){var ft=C[tt],it=p.asn1.x509.OID.oid2name(ft.oid);it===""&&(it=ft.oid);var ct="";if(ft.critical===!0&&(ct="CRITICAL"),g+="  "+it+" "+ct+`:
84`,it==="basicConstraints"){var mt=this.getExtBasicConstraints();mt.cA===void 0?g+=`    {}
85`:(g+="    cA=true",mt.pathLen!==void 0&&(g+=", pathLen="+mt.pathLen),g+=`
86`)}else if(it==="keyUsage")g+="    "+this.getExtKeyUsageString()+`
87`;else if(it==="subjectKeyIdentifier")g+="    "+this.getExtSubjectKeyIdentifier().kid.hex+`
88`;else if(it==="authorityKeyIdentifier"){var Ft=this.getExtAuthorityKeyIdentifier();Ft.kid!==void 0&&(g+="    kid="+Ft.kid.hex+`
89`)}else it==="extKeyUsage"?g+="    "+this.getExtExtKeyUsage().array.join(", ")+`
90`:it==="subjectAltName"?g+="    "+I(this.getExtSubjectAltName())+`
91`:it==="cRLDistributionPoints"?g+=Q(this.getExtCRLDistributionPoints()):it==="authorityInfoAccess"?g+=st(this.getExtAuthorityInfoAccess()):it==="certificatePolicies"&&(g+=z(this.getExtCertificatePolicies()))}}return g+="signature algorithm: "+this.getSignatureAlgorithmName()+`
92`,g+="signature: "+this.getSignatureValueHex().substr(0,16)+`...
93`},typeof e=="string"&&(e.indexOf("-----BEGIN")!=-1?this.readCertPEM(e):p.lang.String.isHex(e)&&this.readCertHex(e))}ht.prototype.sign=function(e,t){var r=function(i){return p.crypto.Util.hashString(i,t)}(e);return this.signWithMessageHash(r,t)},ht.prototype.signWithMessageHash=function(e,t){var r=Gt(p.crypto.Util.getPaddedDigestInfoHex(e,t,this.n.bitLength()),16);return $e(this.doPrivate(r).toString(16),this.n.bitLength())},ht.prototype.signPSS=function(e,t,r){var n=function(s){return p.crypto.Util.hashHex(s,t)}(ae(e));return r===void 0&&(r=-1),this.signWithMessageHashPSS(n,t,r)},ht.prototype.signWithMessageHashPSS=function(e,t,r){var n,i=te(e),s=i.length,f=this.n.bitLength()-1,_=Math.ceil(f/8),v=function(g){return p.crypto.Util.hashHex(g,t)};if(r===-1||r===void 0)r=s;else if(r===-2)r=_-s-2;else if(r<-2)throw new Error("invalid salt length");if(_<s+r+2)throw new Error("data too long");var m="";r>0&&(m=new Array(r),new Mt().nextBytes(m),m=String.fromCharCode.apply(String,m));var b=te(v(ae("\0\0\0\0\0\0\0\0"+i+m))),x=[];for(n=0;n<_-r-s-2;n+=1)x[n]=0;var R=String.fromCharCode.apply(String,x)+"�"+m,M=tr(b,R.length,v),W=[];for(n=0;n<R.length;n+=1)W[n]=R.charCodeAt(n)^M.charCodeAt(n);var G=65280>>8*_-f&255;for(W[0]&=~G,n=0;n<s;n++)W.push(b.charCodeAt(n));return W.push(188),$e(this.doPrivate(new H(W)).toString(16),this.n.bitLength())},ht.prototype.verify=function(e,t){var r=Gt(t=(t=t.replace(ir,"")).replace(/[ \n]+/g,""),16);if(r.bitLength()>this.n.bitLength())return 0;var n=er(this.doPublic(r).toString(16).replace(/^1f+00/,""));if(n.length==0)return!1;var i=n[0];return n[1]==function(f){return p.crypto.Util.hashString(f,i)}(e)},ht.prototype.verifyWithMessageHash=function(e,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var r=Gt(t,16);if(r.bitLength()>this.n.bitLength())return 0;var n=er(this.doPublic(r).toString(16).replace(/^1f+00/,""));return n.length==0?!1:(n[0],n[1]==e)},ht.prototype.verifyPSS=function(e,t,r,n){var i=function(f){return p.crypto.Util.hashHex(f,r)}(ae(e));return n===void 0&&(n=-1),this.verifyWithMessageHashPSS(i,t,r,n)},ht.prototype.verifyWithMessageHashPSS=function(e,t,r,n){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i,s=new H(t,16),f=function(C){return p.crypto.Util.hashHex(C,r)},_=te(e),v=_.length,m=this.n.bitLength()-1,b=Math.ceil(m/8);if(n===-1||n===void 0)n=v;else if(n===-2)n=b-v-2;else if(n<-2)throw new Error("invalid salt length");if(b<v+n+2)throw new Error("data too long");var x=this.doPublic(s).toByteArray();for(i=0;i<x.length;i+=1)x[i]&=255;for(;x.length<b;)x.unshift(0);if(x[b-1]!==188)throw new Error("encoded message does not end in 0xbc");var R=(x=String.fromCharCode.apply(String,x)).substr(0,b-v-1),M=x.substr(R.length,v),W=65280>>8*b-m&255;
93if(R.charCodeAt(0)&W)throw new Error("bits beyond keysize not zero");var G=tr(M,R.length,f),X=[];for(i=0;i<R.length;i+=1)X[i]=R.charCodeAt(i)^G.charCodeAt(i);X[0]&=~W;var g=b-v-n-2;for(i=0;i<g;i+=1)if(X[i]!==0)throw new Error("leftmost octets not zero");if(X[g]!==1)throw new Error("0x01 marker not found");return M===te(f(ae("\0\0\0\0\0\0\0\0"+_+String.fromCharCode.apply(String,X.slice(-n)))))},ht.SALT_LEN_HLEN=-1,ht.SALT_LEN_MAX=-2,ht.SALT_LEN_RECOVER=-2,It.hex2dn=function(e,t){if(t===void 0&&(t=0),e.substr(t,2)!=="30")throw new Error("malformed DN");for(var r=new Array,n=rt.getChildIdx(e,t),i=0;i<n.length;i++)r.push(It.hex2rdn(e,n[i]));return"/"+(r=r.map(function(s){return s.replace("/","\\/")})).join("/")},It.hex2rdn=function(e,t){if(t===void 0&&(t=0),e.substr(t,2)!=="31")throw new Error("malformed RDN");for(var r=new Array,n=rt.getChildIdx(e,t),i=0;i<n.length;i++)r.push(It.hex2attrTypeValue(e,n[i]));return(r=r.map(function(s){return s.replace("+","\\+")})).join("+")},It.hex2attrTypeValue=function(e,t){var r=rt,n=r.getV;if(t===void 0&&(t=0),e.substr(t,2)!=="30")throw new Error("malformed attribute type and value");var i=r.getChildIdx(e,t);i.length!==2||e.substr(i[0],2);var s=n(e,i[0]),f=p.asn1.ASN1Util.oidHexToInt(s);return p.asn1.x509.OID.oid2atype(f)+"="+te(n(e,i[1]))},It.getPublicKeyFromCertHex=function(e){var t=new It;return t.readCertHex(e),t.getPublicKey()},It.getPublicKeyFromCertPEM=function(e){var t=new It;return t.readCertPEM(e),t.getPublicKey()},It.getPublicKeyInfoPropOfCertPEM=function(e){var t,r,n=rt.getVbyList,i={};return i.algparam=null,(t=new It).readCertPEM(e),r=t.getPublicKeyHex(),i.keyhex=n(r,0,[1],"03").substr(2),i.algoid=n(r,0,[0,0],"06"),i.algoid==="2a8648ce3d0201"&&(i.algparam=n(r,0,[0,1],"06")),i},It.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"],p!==void 0&&p||(S.KJUR=p={}),p.jws!==void 0&&p.jws||(p.jws={}),p.jws.JWS=function(){var e=p.jws.JWS.isSafeJSONString;this.parseJWS=function(t,r){if(this.parsedJWS===void 0||!r&&this.parsedJWS.sigvalH===void 0){var n=t.match(/^([^.]+)\.([^.]+)\.([^.]+)$/);if(n==null)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";var i=n[1],s=n[2],f=n[3],_=i+"."+s;if(this.parsedJWS={},this.parsedJWS.headB64U=i,this.parsedJWS.payloadB64U=s,this.parsedJWS.sigvalB64U=f,this.parsedJWS.si=_,!r){var v=St(f),m=Gt(v,16);this.parsedJWS.sigvalH=v,this.parsedJWS.sigvalBI=m}var b=ie(i),x=ie(s);if(this.parsedJWS.headS=b,this.parsedJWS.payloadS=x,!e(b,this.parsedJWS,"headP"))throw"malformed JSON string for JWS Head: "+b}}},p.jws.JWS.sign=function(e,t,r,n,i){var s,f,_,v=p,m=v.jws.JWS,b=m.readSafeJSONString,x=m.isSafeJSONString,R=v.crypto,M=(R.ECDSA,R.Mac),W=R.Signature,G=JSON;if(typeof t!="string"&&(t===void 0?"undefined":l(t))!="object")throw"spHeader must be JSON string or object: "+t;if((t===void 0?"undefined":l(t))=="object"&&(f=t,s=G.stringify(f)),typeof t=="string"){if(!x(s=t))throw"JWS Head is not safe JSON string: "+s;f=b(s)}if(_=r,(r===void 0?"undefined":l(r))=="object"&&(_=G.stringify(r)),e!=""&&e!=null||f.alg===void 0||(e=f.alg),e!=""&&e!=null&&f.alg===void 0&&(f.alg=e,s=G.stringify(f)),e!==f.alg)throw"alg and sHeader.alg doesn't match: "+e+"!="+f.alg;var X=null;if(m.jwsalg2sigalg[e]===void 0)throw"unsupported alg name: "+e;X=m.jwsalg2sigalg[e];var g=Se(s)+"."+Se(_),E="";if(X.substr(0,4)=="Hmac"){if(n===void 0)throw"mac key shall be specified for HS* alg";var C=new M({alg:X,prov:"cryptojs",pass:n});C.updateString(g),E=C.doFinal()}else if(X.indexOf("withECDSA")!=-1){(z=new W({alg:X})).init(n,i),z.updateString(g);var I=z.sign();E=p.crypto.ECDSA.asn1SigToConcatSig(I)}else{var z;X!="none"&&((z=new W({alg:X})).init(n,i),z.updateString(g),E=z.sign())}return g+"."+Dt(E)},p.jws.JWS.verify=function(e,t,r){var n,i=p,s=i.jws.JWS,f=s.readSafeJSONString,_=i.crypto,v=_.ECDSA,m=_.Mac,b=_.Signature;l(ht)!==void 0&&(n=ht);var x=e.split(".");if(x.length!==3)return!1;var R=x[0]+"."+x[1],M=St(x[2]),W=f(ie(x[0])),G=null,X=null;if(W.alg===void 0)throw"algorithm not specified in header";if(X=(G=W.alg).substr(0,2),r!=null&&Object.prototype.toString.call(r)==="[object Array]"&&r.length>0&&(":"+r.join(":")+":").indexOf(":"+G+":")==-1)throw"algorithm '"+G+"' not accepted in the list";if(G!="none"&&t===null)throw"key shall be specified to verify.";if(typeof t=="string"&&t.indexOf("-----BEGIN ")!=-1&&(t=Rt.getKey(t)),!(X!="RS"&&X!="PS"||t instanceof n))throw"key shall be a RSAKey obj for RS* and PS* algs";if(X=="ES"&&!(t instanceof v))throw"key shall be a ECDSA obj for ES* algs";var g=null;if(s.jwsalg2sigalg[W.alg]===void 0)throw"unsupported alg name: "+G;if((g=s.jwsalg2sigalg[G])=="none")throw"not supported";if(g.substr(0,4)=="Hmac"){if(t===void 0)throw"hexadecimal key shall be specified for HMAC";var E=new m({alg:g,pass:t});return E.updateString(R),M==E.doFinal()}if(g.indexOf("withECDSA")!=-1){var C,I=null;try{I=v.concatSigToASN1Sig(M)}catch(z){return!1}return(C=new b({alg:g}
93)).init(t),C.updateString(R),C.verify(I)}return(C=new b({alg:g})).init(t),C.updateString(R),C.verify(M)},p.jws.JWS.parse=function(e){var t,r,n,i=e.split("."),s={};if(i.length!=2&&i.length!=3)throw"malformed sJWS: wrong number of '.' splitted elements";return t=i[0],r=i[1],i.length==3&&(n=i[2]),s.headerObj=p.jws.JWS.readSafeJSONString(ie(t)),s.payloadObj=p.jws.JWS.readSafeJSONString(ie(r)),s.headerPP=JSON.stringify(s.headerObj,null,"  "),s.payloadObj==null?s.payloadPP=ie(r):s.payloadPP=JSON.stringify(s.payloadObj,null,"  "),n!==void 0&&(s.sigHex=St(n)),s},p.jws.JWS.verifyJWT=function(e,t,r){var n=p.jws,i=n.JWS,s=i.readSafeJSONString,f=i.inArray,_=i.includedArray,v=e.split("."),m=v[0],b=v[1],x=(St(v[2]),s(ie(m))),R=s(ie(b));if(x.alg===void 0)return!1;if(r.alg===void 0)throw"acceptField.alg shall be specified";if(!f(x.alg,r.alg)||R.iss!==void 0&&l(r.iss)==="object"&&!f(R.iss,r.iss)||R.sub!==void 0&&l(r.sub)==="object"&&!f(R.sub,r.sub))return!1;if(R.aud!==void 0&&l(r.aud)==="object"){if(typeof R.aud=="string"){if(!f(R.aud,r.aud))return!1}else if(l(R.aud)=="object"&&!_(R.aud,r.aud))return!1}var M=n.IntDate.getNow();return r.verifyAt!==void 0&&typeof r.verifyAt=="number"&&(M=r.verifyAt),r.gracePeriod!==void 0&&typeof r.gracePeriod=="number"||(r.gracePeriod=0),!(R.exp!==void 0&&typeof R.exp=="number"&&R.exp+r.gracePeriod<M)&&!(R.nbf!==void 0&&typeof R.nbf=="number"&&M<R.nbf-r.gracePeriod)&&!(R.iat!==void 0&&typeof R.iat=="number"&&M<R.iat-r.gracePeriod)&&(R.jti===void 0||r.jti===void 0||R.jti===r.jti)&&!!i.verify(e,t,r.alg)},p.jws.JWS.includedArray=function(e,t){var r=p.jws.JWS.inArray;if(e===null||(e===void 0?"undefined":l(e))!=="object"||typeof e.length!="number")return!1;for(var n=0;n<e.length;n++)if(!r(e[n],t))return!1;return!0},p.jws.JWS.inArray=function(e,t){if(t===null||(t===void 0?"undefined":l(t))!=="object"||typeof t.length!="number")return!1;for(var r=0;r<t.length;r++)if(t[r]==e)return!0;return!1},p.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"},p.jws.JWS.isSafeJSONString=function(e,t,r){var n=null;try{return((n=Ke(e))===void 0?"undefined":l(n))!="object"||n.constructor===Array?0:(t&&(t[r]=n),1)}catch(i){return 0}},p.jws.JWS.readSafeJSONString=function(e){var t=null;try{return((t=Ke(e))===void 0?"undefined":l(t))!="object"||t.constructor===Array?null:t}catch(r){return null}},p.jws.JWS.getEncodedSignatureValueFromJWS=function(e){var t=e.match(/^[^.]+\.[^.]+\.([^.]+)$/);if(t==null)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";return t[1]},p.jws.JWS.getJWKthumbprint=function(e){if(e.kty!=="RSA"&&e.kty!=="EC"&&e.kty!=="oct")throw"unsupported algorithm for JWK Thumprint";var t="{";if(e.kty==="RSA"){if(typeof e.n!="string"||typeof e.e!="string")throw"wrong n and e value for RSA key";t+='"e":"'+e.e+'",',t+='"kty":"'+e.kty+'",',t+='"n":"'+e.n+'"}'}else if(e.kty==="EC"){if(typeof e.crv!="string"||typeof e.x!="string"||typeof e.y!="string")throw"wrong crv, x and y value for EC key";t+='"crv":"'+e.crv+'",',t+='"kty":"'+e.kty+'",',t+='"x":"'+e.x+'",',t+='"y":"'+e.y+'"}'}else if(e.kty==="oct"){if(typeof e.k!="string")throw"wrong k value for oct(symmetric) key";t+='"kty":"'+e.kty+'",',t+='"k":"'+e.k+'"}'}var r=ae(t);return Dt(p.crypto.Util.hashHex(r,"sha256"))},p.jws.IntDate={},p.jws.IntDate.get=function(e){var t=p.jws.IntDate,r=t.getNow,n=t.getZulu;if(e=="now")return r();if(e=="now + 1hour")return r()+3600;if(e=="now + 1day")return r()+86400;if(e=="now + 1month")return r()+2592e3;if(e=="now + 1year")return r()+31536e3;if(e.match(/Z$/))return n(e);if(e.match(/^[0-9]+$/))return parseInt(e);throw"unsupported format: "+e},p.jws.IntDate.getZulu=function(e){return Ye(e)},p.jws.IntDate.getNow=function(){return~~(new Date/1e3)},p.jws.IntDate.intDate2UTCString=function(e){return new Date(1e3*e).toUTCString()},p.jws.IntDate.intDate2Zulu=function(e){var t=new Date(1e3*e);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"},S.SecureRandom=Mt,S.rng_seed_time=Z,S.BigInteger=H,S.RSAKey=ht;var or=p.crypto.EDSA;S.EDSA=or;var sr=p.crypto.DSA;S.DSA=sr;var ar=p.crypto.Signature;S.Signature=ar;var ur=p.crypto.MessageDigest;S.MessageDigest=ur;var cr=p.crypto.Mac;S.Mac=cr;var hr=p.crypto.Cipher;S.Cipher=hr,S.KEYUTIL=Rt,S.ASN1HEX=rt,S.X509=It,S.CryptoJS=O,S.b64tohex=et,S.b64toBA=nt,S.stoBA=Ve,S.BAtos=qe,S.BAtohex=Pe,S.stohex=he,S.stob64=function(t){return $(he(t))},S.stob64u=function(t){return Ce($(he(t)))},S.b64utos=function(t){return qe(nt(be(t)))},S.b64tob64u=Ce,S.b64utob64=be,S.hex2b64=$,S.hextob64u=Dt,S.b64utohex=St,S.utf8tob64u=Se,S.b64utoutf8=ie,S.utf8tob64=function(t){return $(Te(Ie(t)))},S.b64toutf8=function(t){return decodeURIComponent(Re(et(t)))},S.utf8tohex=Ne,S.hextoutf8=Bt,S.hextorstr=te,S.rstrtohex=ae,S.hextob64=Je,S.hextob64nl=We,S.b64nltohex=ze,S.hextopem=Xt,S.pemtohex=ue,S.hextoArrayBuffer=function(t){if(t.length%2!=0)throw"input is not even length";if(t.match(/^[0-9A-Fa-f]+$/)==null)throw"input is not hexadecimal";for(var r=new ArrayBuffer(t.length/2),n=new DataView(r),i=0;i<t.length/2;i++)n.setUint8(i,parseInt(t.substr(2*i,2),16));return r},S.ArrayBuffertohex=function(t){for(var r="",n=new DataView(t),i=0;i<t.byteLength;i++)r+=("00"+n.getUint8(i).toString(16)).slice(-2);return r},S.zulutomsec=Ue,S.zulutosec=Ye,S.zulutodate=function(t){return new Date(Ue(t))},S.datetozulu=function(t,r,n){var i,s=t.getUTCFullYear();if(r){if(s<1950||2049<s)throw"not proper year for UTCTime: "+s;i=(""+s).slice(-2)}else i=("000"+s).slice(-4);if(i+=("0"+(t.getUTCMonth()+1)).slice(-2),i+=("0"+t.getUTCDate()).slice(-2),i+=("0"+t.getUTCHours()).slice(-2),i+=("0"+t.getUTCMinutes()).slice(-2),i+=("0"+t.getUTCSeconds()).slice(-2),n){var f=t.getUTCMilliseconds();f!==0&&(i+="."+(f=(f=("00"+f).slice(-3)).replace(/0+$/g,"")))}return i+="Z"},S.uricmptohex=Te,S.hextouricmp=Re,S.ipv6tohex=Ge,S.hextoipv6=Xe,S.hextoip=Be,S.iptohex=function(t){var r="malformed IP address";if(!(t=t.toLowerCase(t)).match(/^[0-9.]+$/)){if(t.match(/^[0-9a-f:]+$/)&&t.indexOf(":")!==-1)return Ge(t);throw r}var n=t.split(".");if(n.length!==4)throw r;var i="";try{for(var s=0;s<4;s++)i+=("0"+parseInt(n[s]).toString(16)).slice(-2);return i}catch(f){throw r}},S.encodeURIComponentAll=Ie,S.newline_toUnix=function(t){return t=t.replace(/\r\n/gm,`
94`)},S.newline_toDos=function(t){return t=(t=t.replace(/\r\n/gm,`
95`)).replace(/\n/gm,`\r
96`)},S.hextoposhex=Oe,S.intarystrtohex=function(t){t=(t=(t=t.replace(/^\s*\[\s*/,"")).replace(/\s*\]\s*$/,"")).replace(/\s*/g,"");try{return t.split(/,/).map(function(r,n,i){var s=parseInt(r);if(s<0||255<s)throw"integer not in range 0-255";return("00"+s.toString(16)).slice(-2)}).join("")}catch(r){throw"malformed integer array string: "+r}},S.strdiffidx=function(t,r){var n=t.length;t.length>r.length&&(n=r.length);for(var i=0;i<n;i++)if(t.charCodeAt(i)!=r.charCodeAt(i))return i;return t.length!=r.length?n:-1}
96,S.KJUR=p;var lr=p.crypto;S.crypto=lr;var fr=p.asn1;S.asn1=fr;var gr=p.jws;S.jws=gr;var dr=p.lang;S.lang=dr}).call(this,q(28).Buffer)},function(at,S,q){"use strict";(function(D){/*!
97 * The buffer module from node.js, for the browser.
98 *
99 * @author   Feross Aboukhadijeh <http://feross.org>
100 * @license  MIT
101 */var l=q(30),T=q(31),y=q(32);function a(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(N,c){if(a()<c)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(N=new Uint8Array(c)).__proto__=o.prototype:(N===null&&(N=new o(c)),N.length=c),N}function o(N,c,h){if(!(o.TYPED_ARRAY_SUPPORT||this instanceof o))return new o(N,c,h);if(typeof N=="number"){if(typeof c=="string")throw new Error("If encoding is specified then the first argument must be a string");return w(this,N)}return d(this,N,c,h)}function d(N,c,h,L){if(typeof c=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&c instanceof ArrayBuffer?function(J,Z,ot,lt){if(Z.byteLength,ot<0||Z.byteLength<ot)throw new RangeError("'offset' is out of bounds");if(Z.byteLength<ot+(lt||0))throw new RangeError("'length' is out of bounds");return Z=ot===void 0&&lt===void 0?new Uint8Array(Z):lt===void 0?new Uint8Array(Z,ot):new Uint8Array(Z,ot,lt),o.TYPED_ARRAY_SUPPORT?(J=Z).__proto__=o.prototype:J=j(J,Z),J}(N,c,h,L):typeof c=="string"?function(J,Z,ot){if(typeof ot=="string"&&ot!==""||(ot="utf8"),!o.isEncoding(ot))throw new TypeError('"encoding" must be a valid string encoding');var lt=0|A(Z,ot),yt=(J=u(J,lt)).write(Z,ot);return yt!==lt&&(J=J.slice(0,yt)),J}(N,c,h):function(J,Z){if(o.isBuffer(Z)){var ot=0|P(Z.length);return(J=u(J,ot)).length===0||Z.copy(J,0,0,ot),J}if(Z){if(typeof ArrayBuffer!="undefined"&&Z.buffer instanceof ArrayBuffer||"length"in Z)return typeof Z.length!="number"||function(yt){return yt!=yt}(Z.length)?u(J,0):j(J,Z);if(Z.type==="Buffer"&&y(Z.data))return j(J,Z.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(N,c)}function k(N){if(typeof N!="number")throw new TypeError('"size" argument must be a number');if(N<0)throw new RangeError('"size" argument must not be negative')}function w(N,c){if(k(c),N=u(N,c<0?0:0|P(c)),!o.TYPED_ARRAY_SUPPORT)for(var h=0;h<c;++h)N[h]=0;return N}function j(N,c){var h=c.length<0?0:0|P(c.length);N=u(N,h);for(var L=0;L<h;L+=1)N[L]=255&c[L];return N}function P(N){if(N>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|N}function A(N,c){if(o.isBuffer(N))return N.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(N)||N instanceof ArrayBuffer))return N.byteLength;typeof N!="string"&&(N=""+N);var h=N.length;if(h===0)return 0;for(var L=!1;;)switch(c){case"ascii":case"latin1":case"binary":return h;case"utf8":case"utf-8":case void 0:return Ut(N).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*h;case"hex":return h>>>1;case"base64":return Yt(N).length;default:if(L)return Ut(N).length;c=(""+c).toLowerCase(),L=!0}}function F(N,c,h){var L=!1;if((c===void 0||c<0)&&(c=0),c>this.length||((h===void 0||h>this.length)&&(h=this.length),h<=0)||(h>>>=0)<=(c>>>=0))return"";for(N||(N="utf8");;)switch(N){case"hex":return Zt(this,c,h);case"utf8":case"utf-8":return _t(this,c,h);case"ascii":return jt(this,c,h);case"latin1":case"binary":return xt(this,c,h);case"base64":return ut(this,c,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Tt(this,c,h);default:if(L)throw new TypeError("Unknown encoding: "+N);N=(N+"").toLowerCase(),L=!0}}function U(N,c,h){var L=N[c];N[c]=N[h],N[h]=L}function Y(N,c,h,L,K){if(N.length===0)return-1;if(typeof h=="string"?(L=h,h=0):h>2147483647?h=2147483647:h<-2147483648&&(h=-2147483648),h=+h,isNaN(h)&&(h=K?0:N.length-1),h<0&&(h=N.length+h),h>=N.length){if(K)return-1;h=N.length-1}else if(h<0){if(!K)return-1;h=0}if(typeof c=="string"&&(c=o.from(c,L)),o.isBuffer(c))return c.length===0?-1:O(N,c,h,L,K);if(typeof c=="number")return c&=255,o.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?K?Uint8Array.prototype.indexOf.call(N,c,h):Uint8Array.prototype.lastIndexOf.call(N,c,h):O(N,[c],h,L,K);throw new TypeError("val must be string, number or Buffer")}function O(N,c,h,L,K){var J,Z=1,ot=N.length,lt=c.length;if(L!==void 0&&((L=String(L).toLowerCase())==="ucs2"||L==="ucs-2"||L==="utf16le"||L==="utf-16le")){if(N.length<2||c.length<2)return-1;Z=2,ot/=2,lt/=2,h/=2}function yt(Gt,ne){return Z===1?Gt[ne]:Gt.readUInt16BE(ne*Z)}if(K){var pt=-1;for(J=h;J<ot;J++)if(yt(N,J)===yt(c,pt===-1?0:J-pt)){if(pt===-1&&(pt=J),J-pt+1===lt)return pt*Z}else pt!==-1&&(J-=J-pt),pt=-1}else for(h+lt>ot&&(h=ot-lt),J=h;J>=0;J--){for(var Pt=!0,Mt=0;Mt<lt;Mt++)if(yt(N,J+Mt)!==yt(c,Mt)){Pt=!1;break}if(Pt)return J}return-1}function V(N,c,h,L){h=Number(h)||0;var K=N.length-h;L?(L=Number(L))>K&&(L=K):L=K;var J=c.length;
101if(J%2!=0)throw new TypeError("Invalid hex string");L>J/2&&(L=J/2);for(var Z=0;Z<L;++Z){var ot=parseInt(c.substr(2*Z,2),16);if(isNaN(ot))return Z;N[h+Z]=ot}return Z}function B(N,c,h,L){return Vt(Ut(c,N.length-h),N,h,L)}function $(N,c,h,L){return Vt(function(J){for(var Z=[],ot=0;ot<J.length;++ot)Z.push(255&J.charCodeAt(ot));return Z}(c),N,h,L)}function et(N,c,h,L){return $(N,c,h,L)}function nt(N,c,h,L){return Vt(Yt(c),N,h,L)}function H(N,c,h,L){return Vt(function(J,Z){for(var ot,lt,yt,pt=[],Pt=0;Pt<J.length&&!((Z-=2)<0);++Pt)lt=(ot=J.charCodeAt(Pt))>>8,yt=ot%256,pt.push(yt),pt.push(lt);return pt}(c,N.length-h),N,h,L)}function ut(N,c,h){return c===0&&h===N.length?l.fromByteArray(N):l.fromByteArray(N.slice(c,h))}function _t(N,c,h){h=Math.min(N.length,h);for(var L=[],K=c;K<h;){var J,Z,ot,lt,yt=N[K],pt=null,Pt=yt>239?4:yt>223?3:yt>191?2:1;if(K+Pt<=h)switch(Pt){case 1:yt<128&&(pt=yt);break;case 2:(192&(J=N[K+1]))==128&&(lt=(31&yt)<<6|63&J)>127&&(pt=lt);break;case 3:J=N[K+1],Z=N[K+2],(192&J)==128&&(192&Z)==128&&(lt=(15&yt)<<12|(63&J)<<6|63&Z)>2047&&(lt<55296||lt>57343)&&(pt=lt);break;case 4:J=N[K+1],Z=N[K+2],ot=N[K+3],(192&J)==128&&(192&Z)==128&&(192&ot)==128&&(lt=(15&yt)<<18|(63&J)<<12|(63&Z)<<6|63&ot)>65535&&lt<1114112&&(pt=lt)}pt===null?(pt=65533,Pt=1):pt>65535&&(pt-=65536,L.push(pt>>>10&1023|55296),pt=56320|1023&pt),L.push(pt),K+=Pt}return function(Gt){var ne=Gt.length;if(ne<=wt)return String.fromCharCode.apply(String,Gt);for(var ht="",kt=0;kt<ne;)ht+=String.fromCharCode.apply(String,Gt.slice(kt,kt+=wt));return ht}(L)}S.Buffer=o,S.SlowBuffer=function(c){return+c!=c&&(c=0),o.alloc(+c)},S.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=D.TYPED_ARRAY_SUPPORT!==void 0?D.TYPED_ARRAY_SUPPORT:function(){try{var c=new Uint8Array(1);return c.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},c.foo()===42&&typeof c.subarray=="function"&&c.subarray(1,1).byteLength===0}catch(h){return!1}}(),S.kMaxLength=a(),o.poolSize=8192,o._augment=function(N){return N.__proto__=o.prototype,N},o.from=function(N,c,h){return d(null,N,c,h)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(N,c,h){return function(K,J,Z,ot){return k(J),J<=0?u(K,J):Z!==void 0?typeof ot=="string"?u(K,J).fill(Z,ot):u(K,J).fill(Z):u(K,J)}(null,N,c,h)},o.allocUnsafe=function(N){return w(null,N)},o.allocUnsafeSlow=function(N){return w(null,N)},o.isBuffer=function(c){return!(c==null||!c._isBuffer)},o.compare=function(c,h){if(!o.isBuffer(c)||!o.isBuffer(h))throw new TypeError("Arguments must be Buffers");if(c===h)return 0;for(var L=c.length,K=h.length,J=0,Z=Math.min(L,K);J<Z;++J)if(c[J]!==h[J]){L=c[J],K=h[J];break}return L<K?-1:K<L?1:0},o.isEncoding=function(c){switch(String(c).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}},o.concat=function(c,h){if(!y(c))throw new TypeError('"list" argument must be an Array of Buffers');if(c.length===0)return o.alloc(0);var L;if(h===void 0)for(h=0,L=0;L<c.length;++L)h+=c[L].length;var K=o.allocUnsafe(h),J=0;for(L=0;L<c.length;++L){var Z=c[L];if(!o.isBuffer(Z))throw new TypeError('"list" argument must be an Array of Buffers');Z.copy(K,J),J+=Z.length}return K},o.byteLength=A,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var c=this.length;if(c%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var h=0;h<c;h+=2)U(this,h,h+1);return this},o.prototype.swap32=function(){var c=this.length;if(c%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var h=0;h<c;h+=4)U(this,h,h+3),U(this,h+1,h+2);return this},o.prototype.swap64=function(){var c=this.length;if(c%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var h=0;h<c;h+=8)U(this,h,h+7),U(this,h+1,h+6),U(this,h+2,h+5),U(this,h+3,h+4);return this},o.prototype.toString=function(){var c=0|this.length;return c===0?"":arguments.length===0?_t(this,0,c):F.apply(this,arguments)},o.prototype.equals=function(c){if(!o.isBuffer(c))throw new TypeError("Argument must be a Buffer");return this===c||o.compare(this,c)===0},o.prototype.inspect=function(){var c="",h=S.INSPECT_MAX_BYTES;return this.length>0&&(c=this.toString("hex",0,h).match(/.{2}/g).join(" "),this.length>h&&(c+=" ... ")),"<Buffer "+c+">"},o.prototype.compare=function(c,h,L,K,J){if(!o.isBuffer(c))throw new TypeError("Argument must be a Buffer");if(h===void 0&&(h=0),L===void 0&&(L=c?c.length:0),K===void 0&&(K=0),J===void 0&&(J=this.length),h<0||L>c.length||K<0||J>this.length)throw new RangeError("out of range index");if(K>=J&&h>=L)return 0;if(K>=J)return-1;if(h>=L)return 1;if(this===c)return 0;for(var Z=(J>>>=0)-(K>>>=0),ot=(L>>>=0)-(h>>>=0),lt=Math.min(Z,ot),yt=this.slice(K,J),pt=c.slice(h,L),Pt=0;Pt<lt;++Pt)if(yt[Pt]!==pt[Pt]){Z=yt[Pt],ot=pt[Pt];break}return Z<ot?-1:ot<Z?1:0},o.prototype.includes=function(c,h,L){return this.indexOf(c,h,L)!==-1},o.prototype.indexOf=function(c,h,L){return Y(this,c,h,L,!0)},o.prototype.lastIndexOf=function(c,h,L){return Y(this,c,h,L,!1)}
vendor: 5,343 bytes, line 101
101,o.prototype.write=function(c,h,L,K){if(h===void 0)K="utf8",L=this.length,h=0;else if(L===void 0&&typeof h=="string")K=h,L=this.length,h=0;else{if(!isFinite(h))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");h|=0,isFinite(L)?(L|=0,K===void 0&&(K="utf8")):(K=L,L=void 0)}var J=this.length-h;if((L===void 0||L>J)&&(L=J),c.length>0&&(L<0||h<0)||h>this.length)throw new RangeError("Attempt to write outside buffer bounds");K||(K="utf8");for(var Z=!1;;)switch(K){case"hex":return V(this,c,h,L);case"utf8":case"utf-8":return B(this,c,h,L);case"ascii":return $(this,c,h,L);case"latin1":case"binary":return et(this,c,h,L);case"base64":return nt(this,c,h,L);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return H(this,c,h,L);default:if(Z)throw new TypeError("Unknown encoding: "+K);K=(""+K).toLowerCase(),Z=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var wt=4096;function jt(N,c,h){var L="";h=Math.min(N.length,h);for(var K=c;K<h;++K)L+=String.fromCharCode(127&N[K]);return L}function xt(N,c,h){var L="";h=Math.min(N.length,h);for(var K=c;K<h;++K)L+=String.fromCharCode(N[K]);return L}function Zt(N,c,h){var L=N.length;(!c||c<0)&&(c=0),(!h||h<0||h>L)&&(h=L);for(var K="",J=c;J<h;++J)K+=ee(N[J]);return K}function Tt(N,c,h){for(var L=N.slice(c,h),K="",J=0;J<L.length;J+=2)K+=String.fromCharCode(L[J]+256*L[J+1]);return K}function gt(N,c,h){if(N%1!=0||N<0)throw new RangeError("offset is not uint");if(N+c>h)throw new RangeError("Trying to access beyond buffer length")}function dt(N,c,h,L,K,J){if(!o.isBuffer(N))throw new TypeError('"buffer" argument must be a Buffer instance');if(c>K||c<J)throw new RangeError('"value" argument is out of bounds');if(h+L>N.length)throw new RangeError("Index out of range")}function At(N,c,h,L){c<0&&(c=65535+c+1);for(var K=0,J=Math.min(N.length-h,2);K<J;++K)N[h+K]=(c&255<<8*(L?K:1-K))>>>8*(L?K:1-K)}function Wt(N,c,h,L){c<0&&(c=4294967295+c+1);for(var K=0,J=Math.min(N.length-h,4);K<J;++K)N[h+K]=c>>>8*(L?K:3-K)&255}function Kt(N,c,h,L,K,J){if(h+L>N.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("Index out of range")}function zt(N,c,h,L,K){return K||Kt(N,0,h,4),T.write(N,c,h,L,23,4),h+4}function $t(N,c,h,L,K){return K||Kt(N,0,h,8),T.write(N,c,h,L,52,8),h+8}o.prototype.slice=function(c,h){var L,K=this.length;if((c=~~c)<0?(c+=K)<0&&(c=0):c>K&&(c=K),(h=h===void 0?K:~~h)<0?(h+=K)<0&&(h=0):h>K&&(h=K),h<c&&(h=c),o.TYPED_ARRAY_SUPPORT)(L=this.subarray(c,h)).__proto__=o.prototype;else{var J=h-c;L=new o(J,void 0);for(var Z=0;Z<J;++Z)L[Z]=this[Z+c]}return L},o.prototype.readUIntLE=function(c,h,L){c|=0,h|=0,L||gt(c,h,this.length);for(var K=this[c],J=1,Z=0;++Z<h&&(J*=256);)K+=this[c+Z]*J;return K},o.prototype.readUIntBE=function(c,h,L){c|=0,h|=0,L||gt(c,h,this.length);for(var K=this[c+--h],J=1;h>0&&(J*=256);)K+=this[c+--h]*J;return K},o.prototype.readUInt8=function(c,h){return h||gt(c,1,this.length),this[c]},o.prototype.readUInt16LE=function(c,h){return h||gt(c,2,this.length),this[c]|this[c+1]<<8},o.prototype.readUInt16BE=function(c,h){return h||gt(c,2,this.length),this[c]<<8|this[c+1]},o.prototype.readUInt32LE=function(c,h){return h||gt(c,4,this.length),(this[c]|this[c+1]<<8|this[c+2]<<16)+16777216*this[c+3]},o.prototype.readUInt32BE=function(c,h){return h||gt(c,4,this.length),16777216*this[c]+(this[c+1]<<16|this[c+2]<<8|this[c+3])},o.prototype.readIntLE=function(c,h,L){c|=0,h|=0,L||gt(c,h,this.length);for(var K=this[c],J=1,Z=0;++Z<h&&(J*=256);)K+=this[c+Z]*J;return K>=(J*=128)&&(K-=Math.pow(2,8*h)),K},o.prototype.readIntBE=function(c,h,L){c|=0,h|=0,L||gt(c,h,this.length);for(var K=h,J=1,Z=this[c+--K];K>0&&(J*=256);)Z+=this[c+--K]*J;return Z>=(J*=128)&&(Z-=Math.pow(2,8*h)),Z},o.prototype.readInt8=function(c,h){return h||gt(c,1,this.length),128&this[c]?-1*(255-this[c]+1):this[c]},o.prototype.readInt16LE=function(c,h){h||gt(c,2,this.length);var L=this[c]|this[c+1]<<8;return 32768&L?4294901760|L:L},o.prototype.readInt16BE=function(c,h){h||gt(c,2,this.length);var L=this[c+1]|this[c]<<8;return 32768&L?4294901760|L:L},o.prototype.readInt32LE=function(c,h){return h||gt(c,4,this.length),this[c]|this[c+1]<<8|this[c+2]<<16|this[c+3]<<24},o.prototype.readInt32BE=function(c,h){return h||gt(c,4,this.length),this[c]<<24|this[c+1]<<16|this[c+2]<<8|this[c+3]},o.prototype.readFloatLE=function(c,h){return h||gt(c,4,this.length),T.read(this,c,!0,23,4)},o.prototype.readFloatBE=function(c,h){return h||gt(c,4,this.length),T.read(this,c,!1,23,4)},o.prototype.readDoubleLE=function(c,h){return h||gt(c,8,this.length),T.read(this,c,!0,52,8)},o.prototype.readDoubleBE=function(c,h){return h||gt(c,8,this.length),T.read(this,c,!1,52,8)},o.prototype.writeUIntLE=function(c,h,L,K){c=+c,h|=0,L|=0,K||dt(this,c,h,L,Math.pow(2,8*L)-1,0);var J=1,Z=0;for(this[h]=255&c;++Z<L&&(J*=256);)this[h+Z]=c/J&255;return h+L},o.prototype.writeUIntBE=function(c,h,L,K){c=+c,h|=0,L|=0,K||dt(this,c,h,L,Math.pow(2,8*L)-1,0);var J=L-1,Z=1;for(this[h+J]=255&c;--J>=0&&(Z*=256);)this[h+J]=c/Z&255;return h+L},o.prototype.writeUInt8=function(c,h,L){return c=+c,h|=0,L||dt(this,c,h,1,255,0),o.TYPED_ARRAY_SUPPORT||(c=Math.floor(c)),this[h]=255&c,h+1},o.prototype.writeUInt16LE=function(c,h,L){return c=+c,h|=0,L||dt(this,c,h,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[h]=255&c,this[h+1]=c>>>
1018):At(this,c,h,!0),h+2},o.prototype.writeUInt16BE=function(c,h,L){return c=+c,h|=0,L||dt(this,c,h,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[h]=c>>>8,this[h+1]=255&c):At(this,c,h,!1),h+2},o.prototype.writeUInt32LE=function(c,h,L){return c=+c,h|=0,L||dt(this,c,h,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[h+3]=c>>>24,this[h+2]=c>>>16,this[h+1]=c>>>8,this[h]=255&c):Wt(this,c,h,!0),h+4},o.prototype.writeUInt32BE=function(c,h,L){return c=+c,h|=0,L||dt(this,c,h,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[h]=c>>>24,this[h+1]=c>>>16,this[h+2]=c>>>8,this[h+3]=255&c):Wt(this,c,h,!1),h+4},o.prototype.writeIntLE=function(c,h,L,K){if(c=+c,h|=0,!K){var J=Math.pow(2,8*L-1);dt(this,c,h,L,J-1,-J)}var Z=0,ot=1,lt=0;for(this[h]=255&c;++Z<L&&(ot*=256);)c<0&&lt===0&&this[h+Z-1]!==0&&(lt=1),this[h+Z]=(c/ot>>0)-lt&255;return h+L},o.prototype.writeIntBE=function(c,h,L,K){if(c=+c,h|=0,!K){var J=Math.pow(2,8*L-1);dt(this,c,h,L,J-1,-J)}var Z=L-1,ot=1,lt=0;for(this[h+Z]=255&c;--Z>=0&&(ot*=256);)c<0&&lt===0&&this[h+Z+1]!==0&&(lt=1),this[h+Z]=(c/ot>>0)-lt&255;return h+L},o.prototype.writeInt8=function(c,h,L){return c=+c,h|=0,L||dt(this,c,h,1,127,-128),o.TYPED_ARRAY_SUPPORT||(c=Math.floor(c)),c<0&&(c=255+c+1),this[h]=255&c,h+1},o.prototype.writeInt16LE=function(c,h,L){return c=+c,h|=0,L||dt(this,c,h,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[h]=255&c,this[h+1]=c>>>8):At(this,c,h,!0),h+2},o.prototype.writeInt16BE=function(c,h,L){return c=+c,h|=0,L||dt(this,c,h,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[h]=c>>>8,this[h+1]=255&c):At(this,c,h,!1),h+2},o.prototype.writeInt32LE=function(c,h,L){return c=+c,h|=0,L||dt(this,c,h,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[h]=255&c,this[h+1]=c>>>8,this[h+2]=c>>>16,this[h+3]=c>>>24):Wt(this,c,h,!0),h+4},o.prototype.writeInt32BE=function(c,h,L){return c=+c,h|=0,L||dt(this,c,h,4,2147483647,-2147483648),c<0&&(c=4294967295+c+1),o.TYPED_ARRAY_SUPPORT?(this[h]=c>>>24,this[h+1]=c>>>16,this[h+2]=c>>>8,this[h+3]=255&c):Wt(this,c,h,!1),h+4},o.prototype.writeFloatLE=function(c,h,L){return zt(this,c,h,!0,L)},o.prototype.writeFloatBE=function(c,h,L){return zt(this,c,h,!1,L)},o.prototype.writeDoubleLE=function(c,h,L){return $t(this,c,h,!0,L)},o.prototype.writeDoubleBE=function(c,h,L){return $t(this,c,h,!1,L)},o.prototype.copy=function(c,h,L,K){if(L||(L=0),K||K===0||(K=this.length),h>=c.length&&(h=c.length),h||(h=0),K>0&&K<L&&(K=L),K===L||c.length===0||this.length===0)return 0;if(h<0)throw new RangeError("targetStart out of bounds");if(L<0||L>=this.length)throw new RangeError("sourceStart out of bounds");if(K<0)throw new RangeError("sourceEnd out of bounds");K>this.length&&(K=this.length),c.length-h<K-L&&(K=c.length-h+L);var J,Z=K-L;if(this===c&&L<h&&h<K)for(J=Z-1;J>=0;--J)c[J+h]=this[J+L];else if(Z<1e3||!o.TYPED_ARRAY_SUPPORT)for(J=0;J<Z;++J)c[J+h]=this[J+L];else Uint8Array.prototype.set.call(c,this.subarray(L,L+Z),h);return Z},o.prototype.fill=function(c,h,L,K){if(typeof c=="string"){if(typeof h=="string"?(K=h,h=0,L=this.length):typeof L=="string"&&(K=L,L=this.length),c.length===1){var J=c.charCodeAt(0);J<256&&(c=J)}if(K!==void 0&&typeof K!="string")throw new TypeError("encoding must be a string");if(typeof K=="string"&&!o.isEncoding(K))throw new TypeError("Unknown encoding: "+K)}else typeof c=="number"&&(c&=255);if(h<0||this.length<h||this.length<L)throw new RangeError("Out of range index");if(L<=h)return this;var Z;if(h>>>=0,L=L===void 0?this.length:L>>>0,c||(c=0),typeof c=="number")for(Z=h;Z<L;++Z)this[Z]=c;else{var ot=o.isBuffer(c)?c:Ut(new o(c,K).toString()),lt=ot.length;for(Z=0;Z<L-h;++Z)this[Z+h]=ot[Z%lt]}return this};var ce=/[^+\/0-9A-Za-z-_]/g;function ee(N){return N<16?"0"+N.toString(16):N.toString(16)}function Ut(N,c){var h;c=c||1/0;for(var L=N.length,K=null,J=[],Z=0;Z<L;++Z){if((h=N.charCodeAt(Z))>55295&&h<57344){if(!K){if(h>56319){(c-=3)>-1&&J.push(239,191,189);continue}if(Z+1===L){(c-=3)>-1&&J.push(239,191,189);continue}K=h;continue}if(h<56320){(c-=3)>-1&&J.push(239,191,189),K=h;continue}h=65536+(K-55296<<10|h-56320)}else K&&(c-=3)>-1&&J.push(239,191,189);if(K=null,h<128){if((c-=1)<0)break;J.push(h)}else if(h<2048){if((c-=2)<0)break;J.push(h>>6|192,63&h|128)}
101else if(h<65536){if((c-=3)<0)break;J.push(h>>12|224,h>>6&63|128,63&h|128)}else{if(!(h<1114112))throw new Error("Invalid code point");if((c-=4)<0)break;J.push(h>>18|240,h>>12&63|128,h>>6&63|128,63&h|128)}}return J}function Yt(N){return l.toByteArray(function(h){if((h=function(K){return K.trim?K.trim():K.replace(/^\s+|\s+$/g,"")}(h).replace(ce,"")).length<2)return"";for(;h.length%4!=0;)h+="=";return h}(N))}function Vt(N,c,h,L){for(var K=0;K<L&&!(K+h>=c.length||K>=N.length);++K)c[K+h]=N[K];return K}}).call(this,q(29))},function(at,S){var q;q=function(){return this}();try{q=q||new Function("return this")()}catch(D){typeof window=="object"&&(q=window)}at.exports=q},function(at,S,q){"use strict";S.byteLength=function(w){var j=o(w),P=j[0],A=j[1];return 3*(P+A)/4-A},S.toByteArray=function(w){var j,P,A=o(w),F=A[0],U=A[1],Y=new T(function($,et,nt){return 3*(et+nt)/4-nt}(0,F,U)),O=0,V=U>0?F-4:F;for(P=0;P<V;P+=4)j=l[w.charCodeAt(P)]<<18|l[w.charCodeAt(P+1)]<<12|l[w.charCodeAt(P+2)]<<6|l[w.charCodeAt(P+3)],Y[O++]=j>>16&255,Y[O++]=j>>8&255,Y[O++]=255&j;return U===2&&(j=l[w.charCodeAt(P)]<<2|l[w.charCodeAt(P+1)]>>4,Y[O++]=255&j),U===1&&(j=l[w.charCodeAt(P)]<<10|l[w.charCodeAt(P+1)]<<4|l[w.charCodeAt(P+2)]>>2,Y[O++]=j>>8&255,Y[O++]=255&j),Y},S.fromByteArray=function(w){for(var j,P=w.length,A=P%3,F=[],U=16383,Y=0,O=P-A;Y<O;Y+=U)F.push(d(w,Y,Y+U>O?O:Y+U));return A===1?(j=w[P-1],F.push(D[j>>2]+D[j<<4&63]+"==")):A===2&&(j=(w[P-2]<<8)+w[P-1],F.push(D[j>>10]+D[j>>4&63]+D[j<<2&63]+"=")),F.join("")};for(var D=[],l=[],T=typeof Uint8Array!="undefined"?Uint8Array:Array,y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=y.length;a<u;++a)D[a]=y[a],l[y.charCodeAt(a)]=a;function o(k){var w=k.length;if(w%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var j=k.indexOf("=");return j===-1&&(j=w),[j,j===w?0:4-j%4]}function d(k,w,j){for(var P,A,F=[],U=w;U<j;U+=3)P=(k[U]<<16&16711680)+(k[U+1]<<8&65280)+(255&k[U+2]),F.push(D[(A=P)>>18&63]+D[A>>12&63]+D[A>>6&63]+D[63&A]);return F.join("")}l["-".charCodeAt(0)]=62,l["_".charCodeAt(0)]=63},function(at,S){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */S.read=function(q,D,l,T,y){var a,u,o=8*y-T-1,d=(1<<o)-1,k=d>>1,w=-7,j=l?y-1:0,P=l?-1:1,A=q[D+j];for(j+=P,a=A&(1<<-w)-1,A>>=-w,w+=o;w>0;a=256*a+q[D+j],j+=P,w-=8);for(u=a&(1<<-w)-1,a>>=-w,w+=T;w>0;u=256*u+q[D+j],j+=P,w-=8);if(a===0)a=1-k;else{if(a===d)return u?NaN:1/0*(A?-1:1);u+=Math.pow(2,T),a-=k}return(A?-1:1)*u*Math.pow(2,a-T)},S.write=function(q,D,l,T,y,a){var u,o,d,k=8*a-y-1,w=(1<<k)-1,j=w>>1,P=y===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=T?0:a-1,F=T?1:-1,U=D<0||D===0&&1/D<0?1:0;for(D=Math.abs(D),isNaN(D)||D===1/0?(o=isNaN(D)?1:0,u=w):(u=Math.floor(Math.log(D)/Math.LN2),D*(d=Math.pow(2,-u))<1&&(u--,d*=2),(D+=u+j>=1?P/d:P*Math.pow(2,1-j))*d>=2&&(u++,d/=2),u+j>=w?(o=0,u=w):u+j>=1?(o=(D*d-1)*Math.pow(2,y),u+=j):(o=D*Math.pow(2,j-1)*Math.pow(2,y),u=0));y>=8;q[l+A]=255&o,A+=F,o/=256,y-=8);for(u=u<<y|o,k+=y;k>0;q[l+A]=255&u,A+=F,u/=256,k-=8);q[l+A-F]|=128*U}},function(at,S){var q={}.toString;at.exports=Array.isArray||function(D){return q.call(D)=="[object Array]"}},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.default=function(T){var y=T.jws,a=T.KeyUtil,u=T.X509,o=T.crypto,d=T.hextob64u,k=T.b64tohex,w=T.AllowedSigningAlgs;return function(){function j(){(function(A,F){if(!(A instanceof F))throw new TypeError("Cannot call a class as a function")})(this,j)}return j.parseJwt=function(A){D.Log.debug("JoseUtil.parseJwt");try{var F=y.JWS.parse(A);return{header:F.headerObj,payload:F.payloadObj}}catch(U){D.Log.error(U)}},j.validateJwt=function(A,F,U,Y,O,V,B){D.Log.debug("JoseUtil.validateJwt");try{if(F.kty==="RSA")if(F.e&&F.n)F=a.getKey(F);else{if(!F.x5c||!F.x5c.length)return D.Log.error("JoseUtil.validateJwt: RSA key missing key material",F),Promise.reject(new Error("RSA key missing key material"));var $=k(F.x5c[0]);F=u.getPublicKeyFromCertHex($)}else{if(F.kty!=="EC")return D.Log.error("JoseUtil.validateJwt: Unsupported key type",F&&F.kty),Promise.reject(new Error(F.kty)
101);if(!(F.crv&&F.x&&F.y))return D.Log.error("JoseUtil.validateJwt: EC key missing key material",F),Promise.reject(new Error("EC key missing key material"));F=a.getKey(F)}return j._validateJwt(A,F,U,Y,O,V,B)}catch(et){return D.Log.error(et&&et.message||et),Promise.reject("JWT validation failed")}},j.validateJwtAttributes=function(A,F,U,Y,O,V){Y||(Y=0),O||(O=parseInt(Date.now()/1e3));var B=j.parseJwt(A).payload;if(!B.iss)return D.Log.error("JoseUtil._validateJwt: issuer was not provided"),Promise.reject(new Error("issuer was not provided"));if(B.iss!==F)return D.Log.error("JoseUtil._validateJwt: Invalid issuer in token",B.iss),Promise.reject(new Error("Invalid issuer in token: "+B.iss));if(!B.aud)return D.Log.error("JoseUtil._validateJwt: aud was not provided"),Promise.reject(new Error("aud was not provided"));if(!(B.aud===U||Array.isArray(B.aud)&&B.aud.indexOf(U)>=0))return D.Log.error("JoseUtil._validateJwt: Invalid audience in token",B.aud),Promise.reject(new Error("Invalid audience in token: "+B.aud));if(B.azp&&B.azp!==U)return D.Log.error("JoseUtil._validateJwt: Invalid azp in token",B.azp),Promise.reject(new Error("Invalid azp in token: "+B.azp));if(!V){var $=O+Y,et=O-Y;if(!B.iat)return D.Log.error("JoseUtil._validateJwt: iat was not provided"),Promise.reject(new Error("iat was not provided"));if($<B.iat)return D.Log.error("JoseUtil._validateJwt: iat is in the future",B.iat),Promise.reject(new Error("iat is in the future: "+B.iat));if(B.nbf&&$<B.nbf)return D.Log.error("JoseUtil._validateJwt: nbf is in the future",B.nbf),Promise.reject(new Error("nbf is in the future: "+B.nbf));if(!B.exp)return D.Log.error("JoseUtil._validateJwt: exp was not provided"),Promise.reject(new Error("exp was not provided"));if(B.exp<et)return D.Log.error("JoseUtil._validateJwt: exp is in the past",B.exp),Promise.reject(new Error("exp is in the past:"+B.exp))}return Promise.resolve(B)},j._validateJwt=function(A,F,U,Y,O,V,B){return j.validateJwtAttributes(A,U,Y,O,V,B).then(function($){try{return y.JWS.verify(A,F,w)?$:(D.Log.error("JoseUtil._validateJwt: signature validation failed"),Promise.reject(new Error("signature validation failed")))}catch(et){return D.Log.error(et&&et.message||et),Promise.reject(new Error("signature validation failed"))}})},j.hashString=function(A,F){try{return o.Util.hashString(A,F)}catch(U){D.Log.error(U)}},j.hexToBase64Url=function(A){try{return d(A)}catch(F){D.Log.error(F)}},j}()};var D=q(0);at.exports=S.default},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.SigninResponse=void 0;var D=function(){function y(a,u){for(var o=0;o<u.length;o++){var d=u[o];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(a,u,o){return u&&y(a.prototype,u),o&&y(a,o),a}}(),l=q(3);function T(y,a){if(!(y instanceof a))throw new TypeError("Cannot call a class as a function")}S.SigninResponse=function(){function y(a){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"#";T(this,y);var o=l.UrlUtility.parseUrlFragment(a,u);this.error=o.error,this.error_description=o.error_description,this.error_uri=o.error_uri,this.code=o.code,this.state=o.state,this.id_token=o.id_token,this.session_state=o.session_state,this.access_token=o.access_token,this.token_type=o.token_type,this.scope=o.scope,this.profile=void 0,this.expires_in=o.expires_in}return D(y,[{key:"expires_in",get:function(){if(this.expires_at){var u=parseInt(Date.now()/1e3);return this.expires_at-u}},set:function(u){var o=parseInt(u);if(typeof o=="number"&&o>0){var d=parseInt(Date.now()/1e3);this.expires_at=d+o}}},{key:"expired",get:function(){var u=this.expires_in;if(u!==void 0)return u<=0}},{key:"scopes",get:function(){return(this.scope||"").split(" ")}},{key:"isOpenIdConnect",get:function(){return this.scopes.indexOf("openid")>=0||!!this.id_token}}]),y}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.SignoutRequest=void 0;var D=q(0),l=q(3),T=q(9);S.SignoutRequest=function y(a){var u=a.url,o=a.id_token_hint,d=a.post_logout_redirect_uri,k=a.data,w=a.extraQueryParams,j=a.request_type;if(function(F,U){if(!(F instanceof U))throw new TypeError("Cannot call a class as a function")}(this,y),!u)throw D.Log.error("SignoutRequest.ctor: No url passed"),new Error("url");for(var P in o&&(u=l.UrlUtility.addQueryParam(u,"id_token_hint",o)),d&&(u=l.UrlUtility.addQueryParam(u,"post_logout_redirect_uri",d),k&&(this.state=new T.State({data:k,request_type:j}),u=l.UrlUtility.addQueryParam(u,"state",this.state.id))),w)u=l.UrlUtility.addQueryParam(u,P,w[P]);this.url=u}},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.SignoutResponse=void 0;var D=q(3);S.SignoutResponse=function l(T){(function(u,o){if(!(u instanceof o))throw new TypeError("Cannot call a class as a function")})(this,l);var y=D.UrlUtility.parseUrlFragment(T,"?");this.error=y.error,this.error_description=y.error_description,this.error_uri=y.error_uri,this.state=y.state}},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.InMemoryWebStorage=void 0;var D=function(){function T(y,a){for(var u=0;u<a.length;u++){var o=a[u];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(y,o.key,o)}}return function(y,a,u){return a&&T(y.prototype,a),u&&T(y,u),y}}(),l=q(0);S.InMemoryWebStorage=function(){function T(){(function(a,u){if(!(a instanceof u))throw new TypeError("Cannot call a class as a function")})(this,T),this._data={}}return T.prototype.getItem=function(a){return l.Log.debug("InMemoryWebStorage.getItem",a),this._data[a]},T.prototype.setItem=function(a,u){l.Log.debug("InMemoryWebStorage.setItem",a),this._data[a]=u},T.prototype.removeItem=function(a){l.Log.debug("InMemoryWebStorage.removeItem",a),delete this._data[a]},T.prototype.key=function(a){return Object.getOwnPropertyNames(this._data)[a]},D(T,[{key:"length",get:function(){return Object.getOwnPropertyNames(this._data).length}}]),T}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.UserManager=void 0;var D=function(){function U(Y,O){for(var V=0;V<O.length;V++){var B=O[V];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(Y,B.key,B)}}return function(Y,O,V){return O&&U(Y.prototype,O),V&&U(Y,V),Y}}(),l=q(0),T=q(10),y=q(39),a=q(15),u=q(45),o=q(47),d=q(18),k=q(8),w=q(20),j=q(11),P=q(4);function A(U,Y){if(!(U instanceof Y))throw new TypeError("Cannot call a class as a function")}function F(U,Y){if(!U)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!Y||typeof Y!="object"&&typeof Y!="function"?U:Y}S.UserManager=function(U){function Y(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o.SilentRenewService,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:d.SessionMonitor,$=arguments.length>3&&arguments[3]!==void 0?arguments[3]:w.TokenRevocationClient,et=arguments.length>4&&arguments[4]!==void 0?arguments[4]:j.TokenClient,nt=arguments.length>5&&arguments[5]!==void 0?arguments[5]:P.JoseUtil;A(this,Y),O instanceof y.UserManagerSettings||(O=new y.UserManagerSettings(O));var H=F(this,U.call(this,O));return H._events=new u.UserManagerEvents(O),H._silentRenewService=new V(H),H.settings.automaticSilentRenew&&(l.Log.debug("UserManager.ctor: automaticSilentRenew is configured, setting up silent renew"),H.startSilentRenew()),H.settings.monitorSession&&(l.Log.debug("UserManager.ctor: monitorSession is configured, setting up session monitor"),H._sessionMonitor=new B(H
101)),H._tokenRevocationClient=new $(H._settings),H._tokenClient=new et(H._settings),H._joseUtil=nt,H}return function(V,B){if(typeof B!="function"&&B!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof B);V.prototype=Object.create(B&&B.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}}),B&&(Object.setPrototypeOf?Object.setPrototypeOf(V,B):V.__proto__=B)}(Y,U),Y.prototype.getUser=function(){var V=this;return this._loadUser().then(function(B){return B?(l.Log.info("UserManager.getUser: user loaded"),V._events.load(B,!1),B):(l.Log.info("UserManager.getUser: user not found in storage"),null)})},Y.prototype.removeUser=function(){var V=this;return this.storeUser(null).then(function(){l.Log.info("UserManager.removeUser: user removed from storage"),V._events.unload()})},Y.prototype.signinRedirect=function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(V=Object.assign({},V)).request_type="si:r";var B={useReplaceToNavigate:V.useReplaceToNavigate};return this._signinStart(V,this._redirectNavigator,B).then(function(){l.Log.info("UserManager.signinRedirect: successful")})},Y.prototype.signinRedirectCallback=function(V){return this._signinEnd(V||this._redirectNavigator.url).then(function(B){return B.profile&&B.profile.sub?l.Log.info("UserManager.signinRedirectCallback: successful, signed in sub: ",B.profile.sub):l.Log.info("UserManager.signinRedirectCallback: no sub"),B})},Y.prototype.signinPopup=function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(V=Object.assign({},V)).request_type="si:p";var B=V.redirect_uri||this.settings.popup_redirect_uri||this.settings.redirect_uri;return B?(V.redirect_uri=B,V.display="popup",this._signin(V,this._popupNavigator,{startUrl:B,popupWindowFeatures:V.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:V.popupWindowTarget||this.settings.popupWindowTarget}).then(function($){return $&&($.profile&&$.profile.sub?l.Log.info("UserManager.signinPopup: signinPopup successful, signed in sub: ",$.profile.sub):l.Log.info("UserManager.signinPopup: no sub")),$})):(l.Log.error("UserManager.signinPopup: No popup_redirect_uri or redirect_uri configured"),Promise.reject(new Error("No popup_redirect_uri or redirect_uri configured")))},Y.prototype.signinPopupCallback=function(V){return this._signinCallback(V,this._popupNavigator).then(function(B){return B&&(B.profile&&B.profile.sub?l.Log.info("UserManager.signinPopupCallback: successful, signed in sub: ",B.profile.sub):l.Log.info("UserManager.signinPopupCallback: no sub")),B}).catch(function(B){l.Log.error(B.message)})},Y.prototype.signinSilent=function(){var V=this,B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return B=Object.assign({},B),this._loadUser().then(function($){return $&&$.refresh_token?(B.refresh_token=$.refresh_token,V._useRefreshToken(B)):(B.request_type="si:s",B.id_token_hint=B.id_token_hint||V.settings.includeIdTokenInSilentRenew&&$&&$.id_token,$&&V._settings.validateSubOnSilentRenew&&(l.Log.debug("UserManager.signinSilent, subject prior to silent renew: ",$.profile.sub),B.current_sub=$.profile.sub),V._signinSilentIframe(B))})},Y.prototype._useRefreshToken=function(){var V=this,B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this._tokenClient.exchangeRefreshToken(B).then(function($){return $?$.access_token?V._loadUser().then(function(et){if(et){var nt=Promise.resolve();return $.id_token&&(nt=V._validateIdTokenFromTokenRefreshToken(et.profile,$.id_token)),nt.then(function(){return l.Log.debug("UserManager._useRefreshToken: refresh token response success"),et.id_token=$.id_token||et.id_token,et.access_token=$.access_token,et.refresh_token=$.refresh_token||et.refresh_token,et.expires_in=$.expires_in,V.storeUser(et).then(function(){return V._events.load(et),et})})}return null}):(l.Log.error("UserManager._useRefreshToken: No access token returned from token endpoint"),Promise.reject("No access token returned from token endpoint")):(l.Log.error("UserManager._useRefreshToken: No response returned from token endpoint"),Promise.reject("No response returned from token endpoint"))})},Y.prototype._validateIdTokenFromTokenRefreshToken=function(V,B){var $=this;return this._metadataService.getIssuer().then(function(et){return $.settings.getEpochTime().then(function(nt){return $._joseUtil.validateJwtAttributes(B,et,$._settings.client_id,$._settings.clockSkew,nt).then(function(H){return H?H.sub!==V.sub?(l.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"))):H.auth_time&&H.auth_time!==V.auth_time?(l.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"))):H.azp&&H.azp!==V.azp?(l.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"))):!H.azp&&V.azp?(l.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:(l.Log.error("UserManager._validateIdTokenFromTokenRefreshToken: Failed to validate id_token"),Promise.reject(new Error("Failed to validate id_token")))})})})},Y.prototype._signinSilentIframe=function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},B=V.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return B?(V.redirect_uri=B,V.prompt=V.prompt||"none",this._signin(V,this._iframeNavigator,{startUrl:B,silentRequestTimeout:V.silentRequestTimeout||this.settings.silentRequestTimeout}).then(function($){return $&&($.profile&&$.profile.sub?l.Log.info("UserManager.signinSilent: successful, signed in sub: ",$.profile.sub):l.Log.info("UserManager.signinSilent: no sub")),$})):(l.Log.error("UserManager.signinSilent: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},Y.prototype.signinSilentCallback=function(V){return this._signinCallback(V,this._iframeNavigator).then(function(B){return B&&(B.profile&&B.profile.sub?l.Log.info("UserManager.signinSilentCallback: successful, signed in sub: ",B.profile.sub):l.Log.info("UserManager.signinSilentCallback: no sub")),B})},Y.prototype.signinCallback=function(V){var B=this;return this.readSigninResponseState(V).then(function($){var et=$.state;return $.response,et.request_type==="si:r"?B.signinRedirectCallback(V):et.request_type==="si:p"?B.signinPopupCallback(V):et.request_type==="si:s"?B.signinSilentCallback(V):Promise.reject(new Error("invalid response_type in state"))})},Y.prototype.signoutCallback=function(V,B){var $=this;return this.readSignoutResponseState(V).then(function(et){var nt=et.state,H=et.response;return nt?nt.request_type==="so:r"?$.signoutRedirectCallback(V):nt.request_type==="so:p"?$.signoutPopupCallback(V,B):Promise.reject(new Error("invalid response_type in state")):H})},Y.prototype.querySessionStatus=function(){var V=this,B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(B=Object.assign({},B)).request_type="si:s";var $=B.redirect_uri||this.settings.silent_redirect_uri||this.settings.redirect_uri;return $?(B.redirect_uri=$,B.prompt="none",B.response_type=B.response_type||this.settings.query_status_response_type,B.scope=B.scope||"openid",B.skipUserInfo=!0,this._signinStart(B,this._iframeNavigator,{startUrl:$,silentRequestTimeout:B.silentRequestTimeout||this.settings.silentRequestTimeout}).then(function(et){return V.processSigninResponse(et.url).then(function(nt){if(l.Log.debug("UserManager.querySessionStatus: got signin response"),nt.session_state&&nt.profile.sub)return l.Log.info("UserManager.querySessionStatus: querySessionStatus success for sub: ",nt.profile.sub),{session_state:nt.session_state,sub:nt.profile.sub,sid:nt.profile.sid};l.Log.info("querySessionStatus successful, user not authenticated")}
101).catch(function(nt){if(nt.session_state&&V.settings.monitorAnonymousSession&&(nt.message=="login_required"||nt.message=="consent_required"||nt.message=="interaction_required"||nt.message=="account_selection_required"))return l.Log.info("UserManager.querySessionStatus: querySessionStatus success for anonymous user"),{session_state:nt.session_state};throw nt})})):(l.Log.error("UserManager.querySessionStatus: No silent_redirect_uri configured"),Promise.reject(new Error("No silent_redirect_uri configured")))},Y.prototype._signin=function(V,B){var $=this,et=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._signinStart(V,B,et).then(function(nt){return $._signinEnd(nt.url,V)})},Y.prototype._signinStart=function(V,B){var $=this,et=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return B.prepare(et).then(function(nt){return l.Log.debug("UserManager._signinStart: got navigator window handle"),$.createSigninRequest(V).then(function(H){return l.Log.debug("UserManager._signinStart: got signin request"),et.url=H.url,et.id=H.state.id,nt.navigate(et)}).catch(function(H){throw nt.close&&(l.Log.debug("UserManager._signinStart: Error after preparing navigator, closing navigator window"),nt.close()),H})})},Y.prototype._signinEnd=function(V){var B=this,$=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.processSigninResponse(V).then(function(et){l.Log.debug("UserManager._signinEnd: got signin response");var nt=new a.User(et);if($.current_sub){if($.current_sub!==nt.profile.sub)return l.Log.debug("UserManager._signinEnd: current user does not match user returned from signin. sub from signin: ",nt.profile.sub),Promise.reject(new Error("login_required"));l.Log.debug("UserManager._signinEnd: current user matches user returned from signin")}return B.storeUser(nt).then(function(){return l.Log.debug("UserManager._signinEnd: user stored"),B._events.load(nt),nt})})},Y.prototype._signinCallback=function(V,B){l.Log.debug("UserManager._signinCallback");var $=this._settings.response_mode==="query"||!this._settings.response_mode&&k.SigninRequest.isCode(this._settings.response_type)?"?":"#";return B.callback(V,void 0,$)},Y.prototype.signoutRedirect=function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(V=Object.assign({},V)).request_type="so:r";var B=V.post_logout_redirect_uri||this.settings.post_logout_redirect_uri;B&&(V.post_logout_redirect_uri=B);var $={useReplaceToNavigate:V.useReplaceToNavigate};return this._signoutStart(V,this._redirectNavigator,$).then(function(){l.Log.info("UserManager.signoutRedirect: successful")})},Y.prototype.signoutRedirectCallback=function(V){return this._signoutEnd(V||this._redirectNavigator.url).then(function(B){return l.Log.info("UserManager.signoutRedirectCallback: successful"),B})},Y.prototype.signoutPopup=function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(V=Object.assign({},V)).request_type="so:p";var B=V.post_logout_redirect_uri||this.settings.popup_post_logout_redirect_uri||this.settings.post_logout_redirect_uri;return V.post_logout_redirect_uri=B,V.display="popup",V.post_logout_redirect_uri&&(V.state=V.state||{}),this._signout(V,this._popupNavigator,{startUrl:B,popupWindowFeatures:V.popupWindowFeatures||this.settings.popupWindowFeatures,popupWindowTarget:V.popupWindowTarget||this.settings.popupWindowTarget}).then(function(){l.Log.info("UserManager.signoutPopup: successful")})},Y.prototype.signoutPopupCallback=function(V,B){return B===void 0&&typeof V=="boolean"&&(B=V,V=null),this._popupNavigator.callback(V,B,"?").then(function(){l.Log.info("UserManager.signoutPopupCallback: successful")})},Y.prototype._signout=function(V,B){var $=this,et=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this._signoutStart(V,B,et).then(function(nt){return $._signoutEnd(nt.url)})},Y.prototype._signoutStart=function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},B=this,$=arguments[1],et=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return $.prepare(et).then(function(nt){return l.Log.debug("UserManager._signoutStart: got navigator window handle"),B._loadUser().then(function(H){return l.Log.debug("UserManager._signoutStart: loaded current user from storage"),(B._settings.revokeAccessTokenOnSignout?B._revokeInternal(H):Promise.resolve()).then(function(){var ut=V.id_token_hint||H&&H.id_token;return ut&&(l.Log.debug("UserManager._signoutStart: Setting id_token into signout request"),V.id_token_hint=ut),B.removeUser().then(function(){return l.Log.debug("UserManager._signoutStart: user removed, creating signout request"),B.createSignoutRequest
101(V).then(function(_t){return l.Log.debug("UserManager._signoutStart: got signout request"),et.url=_t.url,_t.state&&(et.id=_t.state.id),nt.navigate(et)})})})}).catch(function(H){throw nt.close&&(l.Log.debug("UserManager._signoutStart: Error after preparing navigator, closing navigator window"),nt.close()),H})})},Y.prototype._signoutEnd=function(V){return this.processSignoutResponse(V).then(function(B){return l.Log.debug("UserManager._signoutEnd: got signout response"),B})},Y.prototype.revokeAccessToken=function(){var V=this;return this._loadUser().then(function(B){return V._revokeInternal(B,!0).then(function($){if($)return l.Log.debug("UserManager.revokeAccessToken: removing token properties from user and re-storing"),B.access_token=null,B.refresh_token=null,B.expires_at=null,B.token_type=null,V.storeUser(B).then(function(){l.Log.debug("UserManager.revokeAccessToken: user stored"),V._events.load(B)})})}).then(function(){l.Log.info("UserManager.revokeAccessToken: access token revoked successfully")})},Y.prototype._revokeInternal=function(V,B){var $=this;if(V){var et=V.access_token,nt=V.refresh_token;return this._revokeAccessTokenInternal(et,B).then(function(H){return $._revokeRefreshTokenInternal(nt,B).then(function(ut){return H||ut||l.Log.debug("UserManager.revokeAccessToken: no need to revoke due to no token(s), or JWT format"),H||ut})})}return Promise.resolve(!1)},Y.prototype._revokeAccessTokenInternal=function(V,B){return!V||V.indexOf(".")>=0?Promise.resolve(!1):this._tokenRevocationClient.revoke(V,B).then(function(){return!0})},Y.prototype._revokeRefreshTokenInternal=function(V,B){return V?this._tokenRevocationClient.revoke(V,B,"refresh_token").then(function(){return!0}):Promise.resolve(!1)},Y.prototype.startSilentRenew=function(){this._silentRenewService.start()},Y.prototype.stopSilentRenew=function(){this._silentRenewService.stop()},Y.prototype._loadUser=function(){return this._userStore.get(this._userStoreKey).then(function(V){return V?(l.Log.debug("UserManager._loadUser: user storageString loaded"),a.User.fromStorageString(V)):(l.Log.debug("UserManager._loadUser: no user storageString"),null)})},Y.prototype.storeUser=function(V){if(V){l.Log.debug("UserManager.storeUser: storing user");var B=V.toStorageString();return this._userStore.set(this._userStoreKey,B)}return l.Log.debug("storeUser.storeUser: removing user"),this._userStore.remove(this._userStoreKey)},D(Y,[{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}}]),Y}(T.OidcClient)},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.UserManagerSettings=void 0;var D=function(){function j(P,A){for(var F=0;F<A.length;F++){var U=A[F];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(P,U.key,U)}}return function(P,A,F){return A&&j(P.prototype,A),F&&j(P,F),P}}(),l=(q(0),q(5)),T=q(40),y=q(41),a=q(43),u=q(6),o=q(1),d=q(8);function k(j,P){if(!(j instanceof P))throw new TypeError("Cannot call a class as a function")}function w(j,P){if(!j)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!P||typeof P!="object"&&typeof P!="function"?j:P}S.UserManagerSettings=function(j){function P(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},F=A.popup_redirect_uri,U=A.popup_post_logout_redirect_uri,Y=A.popupWindowFeatures,O=A.popupWindowTarget,V=A.silent_redirect_uri,B=A.silentRequestTimeout,$=A.automaticSilentRenew,et=$!==void 0&&$,nt=A.validateSubOnSilentRenew,H=nt!==void 0&&nt,ut=A.includeIdTokenInSilentRenew,_t=ut===void 0||ut,wt=A.monitorSession,jt=wt===void 0||wt,xt=A.monitorAnonymousSession,Zt=xt!==void 0&&xt,Tt=A.checkSessionInterval,gt=Tt===void 0?2e3:Tt,dt=A.stopCheckSessionOnError,At=dt===void 0||dt,Wt=A.query_status_response_type,Kt=A.revokeAccessTokenOnSignout,zt=Kt!==void 0&&Kt,$t=A.accessTokenExpiringNotificationTime,ce=$t===void 0?60:$t,ee=A.redirectNavigator,Ut=ee===void 0?new T.RedirectNavigator:ee,Yt=A.popupNavigator,Vt=Yt===void 0?new y.PopupNavigator:Yt,N=A.iframeNavigator,c=N===void 0?new a.IFrameNavigator:N,h=A.userStore,L=h===void 0?new u.WebStorageStateStore({store:o.Global.sessionStorage}):h;k(this,P);var K=w(this,j.call(this,arguments[0]));return K._popup_redirect_uri=F,K._popup_post_logout_redirect_uri=U,K._popupWindowFeatures=Y,K._popupWindowTarget=O,K._silent_redirect_uri=V,K._silentRequestTimeout=B,K._automaticSilentRenew=et,K._validateSubOnSilentRenew=H,K._includeIdTokenInSilentRenew=_t,K._accessTokenExpiringNotificationTime=ce,K._monitorSession=jt,K._monitorAnonymousSession=Zt,K._checkSessionInterval=gt,K._stopCheckSessionOnError=At,Wt?K._query_status_response_type=Wt:arguments[0]&&arguments[0].response_type?K._query_status_response_type=d.SigninRequest.isOidc(arguments[0].response_type)?"id_token":"code":K._query_status_response_type="id_token",K._revokeAccessTokenOnSignout=zt,K._redirectNavigator=Ut,K._popupNavigator=Vt,K._iframeNavigator=c,K._userStore=L,K}return function(F,U){if(typeof U!="function"&&U!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof U);F.prototype=Object.create(U&&U.prototype,{constructor:{value:F,enumerable:!1,writable:!0,configurable:!0}}),U&&(Object.setPrototypeOf?Object.setPrototypeOf(F,U):F.__proto__=U)}(P,j),D(P,[{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._val
101idateSubOnSilentRenew}},{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}}]),P}(l.OidcClientSettings)},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.RedirectNavigator=void 0;var D=function(){function T(y,a){for(var u=0;u<a.length;u++){var o=a[u];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(y,o.key,o)}}return function(y,a,u){return a&&T(y.prototype,a),u&&T(y,u),y}}(),l=q(0);S.RedirectNavigator=function(){function T(){(function(a,u){if(!(a instanceof u))throw new TypeError("Cannot call a class as a function")})(this,T)}return T.prototype.prepare=function(){return Promise.resolve(this)},T.prototype.navigate=function(a){return a&&a.url?(a.useReplaceToNavigate?window.location.replace(a.url):window.location=a.url,Promise.resolve()):(l.Log.error("RedirectNavigator.navigate: No url provided"),Promise.reject(new Error("No url provided")))},D(T,[{key:"url",get:function(){return window.location.href}}]),T}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.PopupNavigator=void 0;var D=q(0),l=q(42);S.PopupNavigator=function(){function T(){(function(a,u){if(!(a instanceof u))throw new TypeError("Cannot call a class as a function")})(this,T)}return T.prototype.prepare=function(a){var u=new l.PopupWindow(a);return Promise.resolve(u)},T.prototype.callback=function(a,u,o){D.Log.debug("PopupNavigator.callback");try{return l.PopupWindow.notifyOpener(a,u,o),Promise.resolve()}catch(d){return Promise.reject(d)}},T}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.PopupWindow=void 0;var D=function(){function y(a,u){for(var o=0;o<u.length;o++){var d=u[o];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(a,u,o){return u&&y(a.prototype,u),o&&y(a,o),a}}(),l=q(0),T=q(3);S.PopupWindow=function(){function y(a){var u=this;(function(w,j){if(!(w instanceof j))throw new TypeError("Cannot call a class as a function")})(this,y),this._promise=new Promise(function(k,w){u._resolve=k,u._reject=w});var o=a.popupWindowTarget||"_blank",d=a.popupWindowFeatures||"location=no,toolbar=no,width=500,height=500,left=100,top=100;";this._popup=window.open("",o,d),this._popup&&(l.Log.debug("PopupWindow.ctor: popup successfully created"),this._checkForPopupClosedTimer=window.setInterval(this._checkForPopupClosed.bind(this),500))}return y.prototype.navigate=function(u){return this._popup?u&&u.url?(l.Log.debug("PopupWindow.navigate: Setting URL in popup"),this._id=u.id,this._id&&(window["popupCallback_"+u.id]=this._callback.bind(this)),this._popup.focus(),this._popup.window.location=u.url):(this._error("PopupWindow.navigate: no url provided"),this._error("No url provided")):this._error("PopupWindow.navigate: Error opening popup window"),this.promise},y.prototype._success=function(u){l.Log.debug("PopupWindow.callback: Successful response from popup window"),this._cleanup(),this._resolve(u)},y.prototype._error=function(u){l.Log.error("PopupWindow.error: ",u),this._cleanup(),this._reject(new Error(u))},y.prototype.close=function(){this._cleanup(!1)},y.prototype._cleanup=function(u){l.Log.debug("PopupWindow.cleanup"),window.clearInterval(this._checkForPopupClosedTimer),this._checkForPopupClosedTimer=null,delete window["popupCallback_"+this._id],this._popup&&!u&&this._popup.close(),this._popup=null},y.prototype._checkForPopupClosed=function(){this._popup&&!this._popup.closed||this._error("Popup window closed")},y.prototype._callback=function(u,o){this._cleanup(o),u?(l.Log.debug("PopupWindow.callback success"),this._success({url:u})):(l.Log.debug("PopupWindow.callback: Invalid response from popup"),this._error("Invalid response from popup"))},y.notifyOpener=function(u,o,d){if(window.opener){if(u=u||window.location.href){var k=T.UrlUtility.parseUrlFragment(u,d);if(k.state){var w="popupCallback_"+k.state,j=window.opener[w];j?(l.Log.debug("PopupWindow.notifyOpener: passing url message to opener"),j(u,o)):l.Log.warn("PopupWindow.notifyOpener: no matching callback found on opener")}else l.Log.warn("PopupWindow.notifyOpener: no state found in response url")}}else l.Log.warn("PopupWindow.notifyOpener: no window.opener. Can't complete notification.")},D(y,[{key:"promise",get:function(){return this._promise}}]),y}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.IFrameNavigator=void 0;var D=q(0),l=q(44);S.IFrameNavigator=function(){function T(){(function(a,u){if(!(a instanceof u))throw new TypeError("Cannot call a class as a function")})(this,T)}return T.prototype.prepare=function(a){var u=new l.IFrameWindow(a);return Promise.resolve(u)},T.prototype.callback=function(a){D.Log.debug("IFrameNavigator.callback");try{return l.IFrameWindow.notifyParent(a),Promise.resolve()}catch(u){return Promise.reject(u)}},T}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.IFrameWindow=void 0;var D=function(){function T(y,a){for(var u=0;u<a.length;u++){var o=a[u];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(y,o.key,o)}}return function(y,a,u){return a&&T(y.prototype,a),u&&T(y,u),y}}(),l=q(0);S.IFrameWindow=function(){function T(y){var a=this;(function(o,d){if(!(o instanceof d))throw new TypeError("Cannot call a class as a function")})(this,T),this._promise=new Promise(function(u,o){a._resolve=u,a._reject=o}),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)}
101return T.prototype.navigate=function(a){if(a&&a.url){var u=a.silentRequestTimeout||1e4;l.Log.debug("IFrameWindow.navigate: Using timeout of:",u),this._timer=window.setTimeout(this._timeout.bind(this),u),this._frame.src=a.url}else this._error("No url provided");return this.promise},T.prototype._success=function(a){this._cleanup(),l.Log.debug("IFrameWindow: Successful response from frame window"),this._resolve(a)},T.prototype._error=function(a){this._cleanup(),l.Log.error(a),this._reject(new Error(a))},T.prototype.close=function(){this._cleanup()},T.prototype._cleanup=function(){this._frame&&(l.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)},T.prototype._timeout=function(){l.Log.debug("IFrameWindow.timeout"),this._error("Frame window timed out")},T.prototype._message=function(a){if(l.Log.debug("IFrameWindow.message"),this._timer&&a.origin===this._origin&&a.source===this._frame.contentWindow&&typeof a.data=="string"&&(a.data.startsWith("http://")||a.data.startsWith("https://"))){var u=a.data;u?this._success({url:u}):this._error("Invalid response from frame")}},T.notifyParent=function(a){l.Log.debug("IFrameWindow.notifyParent"),(a=a||window.location.href)&&(l.Log.debug("IFrameWindow.notifyParent: posting url message to parent"),window.parent.postMessage(a,location.protocol+"//"+location.host))},D(T,[{key:"promise",get:function(){return this._promise}},{key:"_origin",get:function(){return location.protocol+"//"+location.host}}]),T}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.UserManagerEvents=void 0;var D=q(0),l=q(16),T=q(17);S.UserManagerEvents=function(y){function a(u){(function(k,w){if(!(k instanceof w))throw new TypeError("Cannot call a class as a function")})(this,a);var o=function(k,w){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!w||typeof w!="object"&&typeof w!="function"?k:w}(this,y.call(this,u));return o._userLoaded=new T.Event("User loaded"),o._userUnloaded=new T.Event("User unloaded"),o._silentRenewError=ne
101w T.Event("Silent renew error"),o._userSignedIn=new T.Event("User signed in"),o._userSignedOut=new T.Event("User signed out"),o._userSessionChanged=new T.Event("User session changed"),o}return function(o,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);o.prototype=Object.create(d&&d.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(o,d):o.__proto__=d)}(a,y),a.prototype.load=function(o){var d=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];D.Log.debug("UserManagerEvents.load"),y.prototype.load.call(this,o),d&&this._userLoaded.raise(o)},a.prototype.unload=function(){D.Log.debug("UserManagerEvents.unload"),y.prototype.unload.call(this),this._userUnloaded.raise()},a.prototype.addUserLoaded=function(o){this._userLoaded.addHandler(o)},a.prototype.removeUserLoaded=function(o){this._userLoaded.removeHandler(o)},a.prototype.addUserUnloaded=function(o){this._userUnloaded.addHandler(o)},a.prototype.removeUserUnloaded=function(o){this._userUnloaded.removeHandler(o)},a.prototype.addSilentRenewError=function(o){this._silentRenewError.addHandler(o)},a.prototype.removeSilentRenewError=function(o){this._silentRenewError.removeHandler(o)},a.prototype._raiseSilentRenewError=function(o){D.Log.debug("UserManagerEvents._raiseSilentRenewError",o.message),this._silentRenewError.raise(o)},a.prototype.addUserSignedIn=function(o){this._userSignedIn.addHandler(o)},a.prototype.removeUserSignedIn=function(o){this._userSignedIn.removeHandler(o)},a.prototype._raiseUserSignedIn=function(){D.Log.debug("UserManagerEvents._raiseUserSignedIn"),this._userSignedIn.raise()},a.prototype.addUserSignedOut=function(o){this._userSignedOut.addHandler(o)},a.prototype.removeUserSignedOut=function(o){this._userSignedOut.removeHandler(o)},a.prototype._raiseUserSignedOut=function(){D.Log.debug("UserManagerEvents._raiseUserSignedOut"),this._userSignedOut.raise()},a.prototype.addUserSessionChanged=function(o){this._userSessionChanged.addHandler(o)},a.prototype.removeUserSessionChanged=function(o){this._userSessionChanged.removeHandler(o)},a.prototype._raiseUserSessionChanged=function(){D.Log.debug("UserManagerEvents._raiseUserSessionChanged"),this._userSessionChanged.raise()},a}(l.AccessTokenEvents)},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.Timer=void 0;var D=function(){function o(d,k){for(var w=0;w<k.length;w++){var j=k[w];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(d,j.key,j)}}return function(d,k,w){return k&&o(d.prototype,k),w&&o(d,w),d}}(),l=q(0),T=q(1),y=q(17);function a(o,d){if(!(o instanceof d))throw new TypeError("Cannot call a class as a function")}function u(o,d){if(!o)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!d||typeof d!="object"&&typeof d!="function"?o:d}S.Timer=function(o){function d(k){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:T.Global.timer,j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;a(this,d);var P=u(this,o.call(this,k));return P._timer=w,P._nowFunc=j||function(){return Date.now()/1e3},P}return function(w,j){if(typeof j!="function"&&j!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof j);w.prototype=Object.create(j&&j.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),j&&(Object.setPrototypeOf?Object.setPrototypeOf(w,j):w.__proto__=j)}(d,o),d.prototype.init=function(w){w<=0&&(w=1),w=parseInt(w);var j=this.now+w;if(this.expiration===j&&this._timerHandle)l.Log.debug("Timer.init timer "+this._name+" skipping initialization since already initialized for expiration:",this.expiration);else{this.cancel(),l.Log.debug("Timer.init timer "+this._name+" for duration:",w),this._expiration=j;var P=5;w<P&&(P=w),this._timerHandle=this._timer.setInterval(this._callback.bind(this),1e3*P)}},d.prototype.cancel=function(){this._timerHandle&&(l.Log.debug("Timer.cancel: ",this._name),this._timer.clearInterval(this._timerHandle),this._timerHandle=null)},d.prototype._callback=function(){var w=this._expiration-this.now;l.Log.debug("Timer.callback; "+this._name+" timer expires in:",w),this._expiration<=this.now&&(this.cancel(),o.prototype.raise.call(this))}
101,D(d,[{key:"now",get:function(){return parseInt(this._nowFunc())}},{key:"expiration",get:function(){return this._expiration}}]),d}(y.Event)},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.SilentRenewService=void 0;var D=q(0);S.SilentRenewService=function(){function l(T){(function(a,u){if(!(a instanceof u))throw new TypeError("Cannot call a class as a function")})(this,l),this._userManager=T}return l.prototype.start=function(){this._callback||(this._callback=this._tokenExpiring.bind(this),this._userManager.events.addAccessTokenExpiring(this._callback),this._userManager.getUser().then(function(y){}).catch(function(y){D.Log.error("SilentRenewService.start: Error from getUser:",y.message)}))},l.prototype.stop=function(){this._callback&&(this._userManager.events.removeAccessTokenExpiring(this._callback),delete this._callback)},l.prototype._tokenExpiring=function(){var y=this;this._userManager.signinSilent().then(function(a){D.Log.debug("SilentRenewService._tokenExpiring: Silent token renewal successful")},function(a){D.Log.error("SilentRenewService._tokenExpiring: Error from signinSilent:",a.message),y._userManager.events._raiseSilentRenewError(a)})},l}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.CordovaPopupNavigator=void 0;var D=q(21);S.CordovaPopupNavigator=function(){function l(){(function(y,a){if(!(y instanceof a))throw new TypeError("Cannot call a class as a function")})(this,l)}return l.prototype.prepare=function(y){var a=new D.CordovaPopupWindow(y);return Promise.resolve(a)},l}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.CordovaIFrameNavigator=void 0;var D=q(21);S.CordovaIFrameNavigator=function(){function l(){(function(y,a){if(!(y instanceof a))throw new TypeError("Cannot call a class as a function")})(this,l)}return l.prototype.prepare=function(y){y.popupWindowFeatures="hidden=yes";var a=new D.CordovaPopupWindow(y);return Promise.resolve(a)},l}()},function(at,S,q){"use strict";Object.defineProperty(S,"__esModule",{value:!0}),S.Version="1.11.5"}])})}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.