@okta/okta-auth-js
Advanced tools
Comparing version 1.17.0 to 1.17.1
@@ -44,4 +44,4 @@ /*! | ||
*/ | ||
!function(t){"use strict";if("function"==typeof bootstrap)bootstrap("promise",t);else{e.exports=t()}}(function(){"use strict";function e(e){return function(){return Q.apply(e,arguments)}}function r(e){return e===Object(e)}function o(e){return"[object StopIteration]"===oe(e)||e instanceof B}function i(e,t){if(K&&t.stack&&"object"==typeof e&&null!==e&&e.stack&&e.stack.indexOf(ie)===-1){for(var n=[],r=t;r;r=r.source)r.stack&&n.unshift(r.stack);n.unshift(e.stack);var o=n.join("\n"+ie+"\n");e.stack=s(o)}}function s(e){for(var t=e.split("\n"),n=[],r=0;r<t.length;++r){var o=t[r];c(o)||a(o)||!o||n.push(o)}return n.join("\n")}function a(e){return e.indexOf("(module.js:")!==-1||e.indexOf("(node.js:")!==-1}function u(e){var t=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(e);if(t)return[t[1],Number(t[2])];var n=/at ([^ ]+):(\d+):(?:\d+)$/.exec(e);if(n)return[n[1],Number(n[2])];var r=/.*@(.+):(\d+)$/.exec(e);return r?[r[1],Number(r[2])]:void 0}function c(e){var t=u(e);if(!t)return!1;var n=t[0],r=t[1];return n===X&&r>=J&&r<=fe}function f(){if(K)try{throw new Error}catch(e){var t=e.stack.split("\n"),n=t[0].indexOf("@")>0?t[1]:t[2],r=u(n);if(!r)return;return X=r[0],r[1]}}function p(e,t,n){return function(){return"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(t+" is deprecated, use "+n+" instead.",new Error("").stack),e.apply(e,arguments)}}function l(e){return e instanceof y?e:T(e)?C(e):O(e)}function d(){function e(e){t=e,i.source=e,$(n,function(t,n){l.nextTick(function(){e.promiseDispatch.apply(e,n)})},void 0),n=void 0,r=void 0}var t,n=[],r=[],o=te(d.prototype),i=te(y.prototype);if(i.promiseDispatch=function(e,o,i){var s=Y(arguments);n?(n.push(s),"when"===o&&i[1]&&r.push(i[1])):l.nextTick(function(){t.promiseDispatch.apply(t,s)})},i.valueOf=function(){if(n)return i;var e=g(t);return w(e)&&(t=e),e},i.inspect=function(){return t?t.inspect():{state:"pending"}},l.longStackSupport&&K)try{throw new Error}catch(s){i.stack=s.stack.substring(s.stack.indexOf("\n")+1)}return o.promise=i,o.resolve=function(n){t||e(l(n))},o.fulfill=function(n){t||e(O(n))},o.reject=function(n){t||e(S(n))},o.notify=function(e){t||$(r,function(t,n){l.nextTick(function(){n(e)})},void 0)},o}function h(e){if("function"!=typeof e)throw new TypeError("resolver must be a function.");var t=d();try{e(t.resolve,t.reject,t.notify)}catch(n){t.reject(n)}return t.promise}function m(e){return h(function(t,n){for(var r=0,o=e.length;r<o;r++)l(e[r]).then(t,n)})}function y(e,t,n){void 0===t&&(t=function(e){return S(new Error("Promise does not support operation: "+e))}),void 0===n&&(n=function(){return{state:"unknown"}});var r=te(y.prototype);if(r.promiseDispatch=function(n,o,i){var s;try{s=e[o]?e[o].apply(r,i):t.call(r,o,i)}catch(a){s=S(a)}n&&n(s)},r.inspect=n,n){var o=n();"rejected"===o.state&&(r.exception=o.reason),r.valueOf=function(){var e=n();return"pending"===e.state||"rejected"===e.state?r:e.value}}return r}function v(e,t,n,r){return l(e).then(t,n,r)}function g(e){if(w(e)){var t=e.inspect();if("fulfilled"===t.state)return t.value}return e}function w(e){return e instanceof y}function T(e){return r(e)&&"function"==typeof e.then}function k(e){return w(e)&&"pending"===e.inspect().state}function _(e){return!w(e)||"fulfilled"===e.inspect().state}function A(e){return w(e)&&"rejected"===e.inspect().state}function x(){se.length=0,ae.length=0,ce||(ce=!0)}function b(e,n){ce&&("object"==typeof t&&"function"==typeof t.emit&&l.nextTick.runAfter(function(){Z(ae,e)!==-1&&(t.emit("unhandledRejection",n,e),ue.push(e))}),ae.push(e),n&&"undefined"!=typeof n.stack?se.push(n.stack):se.push("(no stack) "+n))}function E(e){if(ce){var n=Z(ae,e);n!==-1&&("object"==typeof t&&"function"==typeof t.emit&&l.nextTick.runAfter(function(){var r=Z(ue,e);r!==-1&&(t.emit("rejectionHandled",se[n],e),ue.splice(r,1))}),ae.splice(n,1),se.splice(n,1))}}function S(e){var t=y({when:function(t){return t&&E(this),t?t(e):this}},function(){return this},function(){return{state:"rejected",reason:e}});return b(t,e),t}function O(e){return y({when:function(){return e},get:function(t){return e[t]},set:function(t,n){e[t]=n},"delete":function(t){delete e[t]},post:function(t,n){return null===t||void 0===t?e.apply(void 0,n):e[t].apply(e,n)},apply:function(t,n){return e.apply(t,n)},keys:function(){return re(e)}},void 0,function(){return{state:"fulfilled",value:e}})}function C(e){var t=d();return l.nextTick(function(){try{e.then(t.resolve,t.reject,t.notify)}catch(n){t.reject(n)}}),t.promise}function R(e){return y({isDef:function(){}},function(t,n){return M(e,t,n)},function(){return l(e).inspect()})}function j(e,t,n){return l(e).spread(t,n)}function U(e){return function(){function t(e,t){var s;if("undefined"==typeof StopIteration){try{s=n[e](t)}catch(a){return S(a)}return s.done?l(s.value):v(s.value,r,i)}try{s=n[e](t)}catch(a){return o(a)?l(a.value):S(a)}return v(s,r,i)}var n=e.apply(this,arguments),r=t.bind(t,"next"),i=t.bind(t,"throw");return r()}}function I(e){l.done(l.async(e)())}function N(e){throw new B(e)}function P(e){return function(){return j([this,D(arguments)],function(t,n){return e.apply(t,n)})}}function M(e,t,n){return l(e).dispatch(t,n)}function D(e){return v(e,function(e){var t=0,n=d();return $(e,function(r,o,i){var s;w(o)&&"fulfilled"===(s=o.inspect()).state?e[i]=s.value:(++t,v(o,function(r){e[i]=r,0===--t&&n.resolve(e)},n.reject,function(e){n.notify({index:i,value:e})}))},void 0),0===t&&n.resolve(e),n.promise})}function q(e){if(0===e.length)return l.resolve();var t=l.defer(),n=0;return $(e,function(r,o,i){function s(e){t.resolve(e)}function a(){n--,0===n&&t.reject(new Error("Can't get fulfillment value from any promise, all promises were rejected."))}function u(e){t.notify({index:i,value:e})}var c=e[i];n++,v(c,s,a,u)},void 0),t.promise}function L(e){return v(e,function(e){return e=ee(e,l),v(D(ee(e,function(e){return v(e,G,G)})),function(){return e})})}function H(e){return l(e).allSettled()}function F(e,t){return l(e).then(void 0,void 0,t)}function W(e,t){return l(e).nodeify(t)}var K=!1;try{throw new Error}catch(z){K=!!z.stack}var X,B,J=f(),G=function(){},V=function(){function e(){for(var e,t;o.next;)o=o.next,e=o.task,o.task=void 0,t=o.domain,t&&(o.domain=void 0,t.enter()),r(e,t);for(;c.length;)e=c.pop(),r(e);s=!1}function r(t,n){try{t()}catch(r){if(u)throw n&&n.exit(),setTimeout(e,0),n&&n.enter(),r;setTimeout(function(){throw r},0)}n&&n.exit()}var o={task:void 0,next:null},i=o,s=!1,a=void 0,u=!1,c=[];if(V=function(e){i=i.next={task:e,domain:u&&t.domain,next:null},s||(s=!0,a())},"object"==typeof t&&"[object process]"===t.toString()&&t.nextTick)u=!0,a=function(){t.nextTick(e)};else if("function"==typeof n)a="undefined"!=typeof window?n.bind(window,e):function(){n(e)};else if("undefined"!=typeof MessageChannel){var f=new MessageChannel;f.port1.onmessage=function(){a=p,f.port1.onmessage=e,e()};var p=function(){f.port2.postMessage(0)};a=function(){setTimeout(e,0),p()}}else a=function(){setTimeout(e,0)};return V.runAfter=function(e){c.push(e),s||(s=!0,a())},V}(),Q=Function.call,Y=e(Array.prototype.slice),$=e(Array.prototype.reduce||function(e,t){var n=0,r=this.length;if(1===arguments.length)for(;;){if(n in this){t=this[n++];break}if(++n>=r)throw new TypeError}for(;n<r;n++)n in this&&(t=e(t,this[n],n));return t}),Z=e(Array.prototype.indexOf||function(e){for(var t=0;t<this.length;t++)if(this[t]===e)return t;return-1}),ee=e(Array.prototype.map||function(e,t){var n=this,r=[];return $(n,function(o,i,s){r.push(e.call(t,i,s,n))},void 0),r}),te=Object.create||function(e){function t(){}return t.prototype=e,new t},ne=e(Object.prototype.hasOwnProperty),re=Object.keys||function(e){var t=[];for(var n in e)ne(e,n)&&t.push(n);return t},oe=e(Object.prototype.toString);B="undefined"!=typeof ReturnValue?ReturnValue:function(e){this.value=e};var ie="From previous event:";l.resolve=l,l.nextTick=V,l.longStackSupport=!1,"object"==typeof t&&t&&t.env&&t.env.Q_DEBUG&&(l.longStackSupport=!0),l.defer=d,d.prototype.makeNodeResolver=function(){var e=this;return function(t,n){t?e.reject(t):arguments.length>2?e.resolve(Y(arguments,1)):e.resolve(n)}},l.Promise=h,l.promise=h,h.race=m,h.all=D,h.reject=S,h.resolve=l,l.passByCopy=function(e){return e},y.prototype.passByCopy=function(){return this},l.join=function(e,t){return l(e).join(t)},y.prototype.join=function(e){return l([this,e]).spread(function(e,t){if(e===t)return e;throw new Error("Can't join: not the same: "+e+" "+t)})},l.race=m,y.prototype.race=function(){return this.then(l.race)},l.makePromise=y,y.prototype.toString=function(){return"[object Promise]"},y.prototype.then=function(e,t,n){function r(t){try{return"function"==typeof e?e(t):t}catch(n){return S(n)}}function o(e){if("function"==typeof t){i(e,a);try{return t(e)}catch(n){return S(n)}}return S(e)}function s(e){return"function"==typeof n?n(e):e}var a=this,u=d(),c=!1;return l.nextTick(function(){a.promiseDispatch(function(e){c||(c=!0,u.resolve(r(e)))},"when",[function(e){c||(c=!0,u.resolve(o(e)))}])}),a.promiseDispatch(void 0,"when",[void 0,function(e){var t,n=!1;try{t=s(e)}catch(r){if(n=!0,!l.onerror)throw r;l.onerror(r)}n||u.notify(t)}]),u.promise},l.tap=function(e,t){return l(e).tap(t)},y.prototype.tap=function(e){return e=l(e),this.then(function(t){return e.fcall(t).thenResolve(t)})},l.when=v,y.prototype.thenResolve=function(e){return this.then(function(){return e})},l.thenResolve=function(e,t){return l(e).thenResolve(t)},y.prototype.thenReject=function(e){return this.then(function(){throw e})},l.thenReject=function(e,t){return l(e).thenReject(t)},l.nearer=g,l.isPromise=w,l.isPromiseAlike=T,l.isPending=k,y.prototype.isPending=function(){return"pending"===this.inspect().state},l.isFulfilled=_,y.prototype.isFulfilled=function(){return"fulfilled"===this.inspect().state},l.isRejected=A,y.prototype.isRejected=function(){return"rejected"===this.inspect().state};var se=[],ae=[],ue=[],ce=!0;l.resetUnhandledRejections=x,l.getUnhandledReasons=function(){return se.slice()},l.stopUnhandledRejectionTracking=function(){x(),ce=!1},x(),l.reject=S,l.fulfill=O,l.master=R,l.spread=j,y.prototype.spread=function(e,t){return this.all().then(function(t){return e.apply(void 0,t)},t)},l.async=U,l.spawn=I,l["return"]=N,l.promised=P,l.dispatch=M,y.prototype.dispatch=function(e,t){var n=this,r=d();return l.nextTick(function(){n.promiseDispatch(r.resolve,e,t)}),r.promise},l.get=function(e,t){return l(e).dispatch("get",[t])},y.prototype.get=function(e){return this.dispatch("get",[e])},l.set=function(e,t,n){return l(e).dispatch("set",[t,n])},y.prototype.set=function(e,t){return this.dispatch("set",[e,t])},l.del=l["delete"]=function(e,t){return l(e).dispatch("delete",[t])},y.prototype.del=y.prototype["delete"]=function(e){return this.dispatch("delete",[e])},l.mapply=l.post=function(e,t,n){return l(e).dispatch("post",[t,n])},y.prototype.mapply=y.prototype.post=function(e,t){return this.dispatch("post",[e,t])},l.send=l.mcall=l.invoke=function(e,t){return l(e).dispatch("post",[t,Y(arguments,2)])},y.prototype.send=y.prototype.mcall=y.prototype.invoke=function(e){return this.dispatch("post",[e,Y(arguments,1)])},l.fapply=function(e,t){return l(e).dispatch("apply",[void 0,t])},y.prototype.fapply=function(e){return this.dispatch("apply",[void 0,e])},l["try"]=l.fcall=function(e){return l(e).dispatch("apply",[void 0,Y(arguments,1)])},y.prototype.fcall=function(){return this.dispatch("apply",[void 0,Y(arguments)])},l.fbind=function(e){var t=l(e),n=Y(arguments,1);return function(){return t.dispatch("apply",[this,n.concat(Y(arguments))])}},y.prototype.fbind=function(){var e=this,t=Y(arguments);return function(){return e.dispatch("apply",[this,t.concat(Y(arguments))])}},l.keys=function(e){return l(e).dispatch("keys",[])},y.prototype.keys=function(){return this.dispatch("keys",[])},l.all=D,y.prototype.all=function(){return D(this)},l.any=q,y.prototype.any=function(){return q(this)},l.allResolved=p(L,"allResolved","allSettled"),y.prototype.allResolved=function(){return L(this)},l.allSettled=H,y.prototype.allSettled=function(){return this.then(function(e){return D(ee(e,function(e){function t(){return e.inspect()}return e=l(e),e.then(t,t)}))})},l.fail=l["catch"]=function(e,t){return l(e).then(void 0,t)},y.prototype.fail=y.prototype["catch"]=function(e){return this.then(void 0,e)},l.progress=F,y.prototype.progress=function(e){return this.then(void 0,void 0,e)},l.fin=l["finally"]=function(e,t){return l(e)["finally"](t)},y.prototype.fin=y.prototype["finally"]=function(e){return e=l(e),this.then(function(t){return e.fcall().then(function(){return t})},function(t){return e.fcall().then(function(){throw t})})},l.done=function(e,t,n,r){return l(e).done(t,n,r)},y.prototype.done=function(e,n,r){var o=function(e){l.nextTick(function(){if(i(e,s),!l.onerror)throw e;l.onerror(e)})},s=e||n||r?this.then(e,n,r):this;"object"==typeof t&&t&&t.domain&&(o=t.domain.bind(o)),s.then(void 0,o)},l.timeout=function(e,t,n){return l(e).timeout(t,n)},y.prototype.timeout=function(e,t){var n=d(),r=setTimeout(function(){t&&"string"!=typeof t||(t=new Error(t||"Timed out after "+e+" ms"),t.code="ETIMEDOUT"),n.reject(t)},e);return this.then(function(e){clearTimeout(r),n.resolve(e)},function(e){clearTimeout(r),n.reject(e)},n.notify),n.promise},l.delay=function(e,t){return void 0===t&&(t=e,e=void 0),l(e).delay(t)},y.prototype.delay=function(e){return this.then(function(t){var n=d();return setTimeout(function(){n.resolve(t)},e),n.promise})},l.nfapply=function(e,t){return l(e).nfapply(t)},y.prototype.nfapply=function(e){var t=d(),n=Y(e);return n.push(t.makeNodeResolver()),this.fapply(n).fail(t.reject),t.promise},l.nfcall=function(e){var t=Y(arguments,1);return l(e).nfapply(t)},y.prototype.nfcall=function(){var e=Y(arguments),t=d();return e.push(t.makeNodeResolver()),this.fapply(e).fail(t.reject),t.promise},l.nfbind=l.denodeify=function(e){var t=Y(arguments,1);return function(){var n=t.concat(Y(arguments)),r=d();return n.push(r.makeNodeResolver()),l(e).fapply(n).fail(r.reject),r.promise}},y.prototype.nfbind=y.prototype.denodeify=function(){var e=Y(arguments);return e.unshift(this),l.denodeify.apply(void 0,e)},l.nbind=function(e,t){var n=Y(arguments,2);return function(){function r(){return e.apply(t,arguments)}var o=n.concat(Y(arguments)),i=d();return o.push(i.makeNodeResolver()),l(r).fapply(o).fail(i.reject),i.promise}},y.prototype.nbind=function(){var e=Y(arguments,0);return e.unshift(this),l.nbind.apply(void 0,e)},l.nmapply=l.npost=function(e,t,n){return l(e).npost(t,n)},y.prototype.nmapply=y.prototype.npost=function(e,t){var n=Y(t||[]),r=d();return n.push(r.makeNodeResolver()),this.dispatch("post",[e,n]).fail(r.reject),r.promise},l.nsend=l.nmcall=l.ninvoke=function(e,t){var n=Y(arguments,2),r=d();return n.push(r.makeNodeResolver()),l(e).dispatch("post",[t,n]).fail(r.reject),r.promise},y.prototype.nsend=y.prototype.nmcall=y.prototype.ninvoke=function(e){var t=Y(arguments,1),n=d();return t.push(n.makeNodeResolver()),this.dispatch("post",[e,t]).fail(n.reject),n.promise},l.nodeify=W,y.prototype.nodeify=function(e){return e?void this.then(function(t){l.nextTick(function(){e(null,t)})},function(t){l.nextTick(function(){e(t)})}):this},l.noConflict=function(){throw new Error("Q.noConflict only works when Q is used as a global")};var fe=f();return l})}).call(t,n(9),n(10).setImmediate)},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(f===setTimeout)return setTimeout(e,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(e,0);try{return f(e,0)}catch(t){try{return f.call(null,e,0)}catch(t){return f.call(this,e,0)}}}function i(e){if(p===clearTimeout)return clearTimeout(e);if((p===r||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function s(){m&&d&&(m=!1,d.length?h=d.concat(h):y=-1,h.length&&a())}function a(){if(!m){var e=o(s);m=!0;for(var t=h.length;t;){for(d=h,h=[];++y<t;)d&&d[y].run();y=-1,t=h.length}d=null,m=!1,i(e)}}function u(e,t){this.fun=e,this.array=t}function c(){}var f,p,l=e.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:n}catch(e){f=n}try{p="function"==typeof clearTimeout?clearTimeout:r}catch(e){p=r}}();var d,h=[],m=!1,y=-1;l.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];h.push(new u(e,t)),1!==h.length||m||o(a)},u.prototype.run=function(){this.fun.apply(null,this.array)},l.title="browser",l.browser=!0,l.env={},l.argv=[],l.version="",l.versions={},l.on=c,l.addListener=c,l.once=c,l.off=c,l.removeListener=c,l.removeAllListeners=c,l.emit=c,l.prependListener=c,l.prependOnceListener=c,l.listeners=function(e){return[]},l.binding=function(e){throw new Error("process.binding is not supported")},l.cwd=function(){return"/"},l.chdir=function(e){throw new Error("process.chdir is not supported")},l.umask=function(){return 0}},function(e,t,n){(function(e,r){function o(e,t){this._id=e,this._clearFn=t}var i=n(9).nextTick,s=Function.prototype.apply,a=Array.prototype.slice,u={},c=0;t.setTimeout=function(){return new o(s.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new o(s.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},t.setImmediate="function"==typeof e?e:function(e){var n=c++,r=!(arguments.length<2)&&a.call(arguments,1);return u[n]=!0,i(function(){u[n]&&(r?e.apply(null,r):e.call(null),t.clearImmediate(n))}),n},t.clearImmediate="function"==typeof r?r:function(e){delete u[e]}}).call(t,n(10).setImmediate,n(10).clearImmediate)},function(e,t,n){function r(e){return!(!e||!e.accessToken&&!e.idToken||!Array.isArray(e.scopes))}function o(e,t,n){e.addEventListener?e.addEventListener(t,n):e.attachEvent("on"+t,n)}function i(e,t,n){e.removeEventListener?e.removeEventListener(t,n):e.detachEvent("on"+t,n)}function s(e){var t=document.createElement("iframe");return t.style.display="none",t.src=e,document.body.appendChild(t)}function a(e,t){var n=t.popupTitle||"External Identity Provider User Authentication",r="toolbar=no, scrollbars=yes, resizable=yes, top=100, left=500, width=600, height=600";if(h.isIE11OrLess()){var o=window.open("/",n,r);return o.location.href=e,o}return window.open(e,n,r)}function u(e,t){return d.get(e,(t||e.options.url)+"/.well-known/openid-configuration",{cacheResponse:!0})}function c(e,t,n){return u(e,t).then(function(t){var r=t.jwks_uri,o=v.getStorage(),i=o[r];if(i&&Date.now()/1e3<i.expiresAt){var s=h.find(i.response.keys,{kid:n});if(s)return s}return v.clearStorage(r),d.get(e,r,{cacheResponse:!0}).then(function(e){var t=h.find(e.keys,{kid:n});if(t)return t;throw new y("The key id, "+n+", was not found in the server's keys")})})}function f(e,t,n,r,o){if(!t||!r||!n)throw new y("The jwt, iss, and aud arguments are all required");if(o&&t.nonce!==o)throw new y("OAuth flow response nonce doesn't match request nonce");var i=Math.floor((new Date).getTime()/1e3);if(t.iss!==r)throw new y("The issuer ["+t.iss+"] does not match ["+r+"]");if(t.aud!==n)throw new y("The audience ["+t.aud+"] does not match ["+n+"]");if(t.iat>t.exp)throw new y("The JWT expired before it was issued");if(i-e.options.maxClockSkew>t.exp)throw new y("The JWT expired and is no longer valid");if(t.iat>i+e.options.maxClockSkew)throw new y("The JWT was issued in the future")}function p(e,t,n){n=n||{};var r=h.removeTrailingSlash(n.authorizeUrl)||e.options.authorizeUrl,o=h.removeTrailingSlash(n.issuer)||e.options.issuer,i=h.removeTrailingSlash(n.userinfoUrl)||e.options.userinfoUrl;if(o&&!/^https?:/.test(o)&&(o=e.options.url+"/oauth2/"+o),!o&&r&&t.responseType.indexOf("id_token")!==-1)throw new y("Cannot request idToken with an authorizeUrl without an issuer");if(!o&&t.responseType.indexOf("token")!==-1){if(r&&!i)throw new y("Cannot request accessToken with an authorizeUrl without an issuer or userinfoUrl");if(i&&!r)throw new y("Cannot request token with an userinfoUrl without an issuer or authorizeUrl")}var s=new RegExp("^https?://.*?/oauth2/.+");return o=o||e.options.url,s.test(o)?(r=r||o+"/v1/authorize",i=i||o+"/v1/userinfo"):(r=r||o+"/oauth2/v1/authorize",i=i||o+"/oauth2/v1/userinfo"),{issuer:o,authorizeUrl:r,userinfoUrl:i}}function l(e){for(var t,n=/\+/g,r=/([^&=]+)=?([^&]*)/g,o=e.substring(1),i={};;){if(t=r.exec(o),!t)break;var s=t[1],a=t[2];"id_token"===s||"access_token"===s||"code"===s?i[s]=a:i[s]=decodeURIComponent(a.replace(n," "))}return i}var d=n(12),h=n(13),m=n(15),y=n(17),v=m.getHttpCache();e.exports={getWellKnown:u,getKey:c,validateClaims:f,getOAuthUrls:p,loadFrame:s,loadPopup:a,hashToObject:l,isToken:r,addListener:o,removeListener:i}},function(e,t,n){function r(e,t){t=t||{};var n=t.url,r=t.method,o=t.args,i=t.saveAuthnState,l=t.accessToken,d=u.getHttpCache();if(t.cacheResponse){var h=d.getStorage(),m=h[n];if(m&&Date.now()/1e3<m.expiresAt)return c.resolve(m.response)}var y={Accept:"application/json","Content-Type":"application/json","X-Okta-User-Agent-Extended":e.userAgent};s.extend(y,e.options.headers,t.headers),l&&s.isString(l)&&(y.Authorization="Bearer "+l);var v,g,w={headers:y,data:o||void 0};return new c(e.options.ajaxRequest(r,n,w)).then(function(e){return g=e.responseText,g&&s.isString(g)&&(g=JSON.parse(g)),i&&(g.stateToken||a.deleteCookie(p.STATE_TOKEN_COOKIE_NAME)),g&&g.stateToken&&g.expiresAt&&a.setCookie(p.STATE_TOKEN_COOKIE_NAME,g.stateToken,g.expiresAt),g&&t.cacheResponse&&d.updateStorage(n,{expiresAt:Math.floor(Date.now()/1e3)+p.DEFAULT_CACHE_DURATION,response:g}),g}).fail(function(t){var n=t.responseText||{};if(s.isString(n))try{n=JSON.parse(n)}catch(r){n={errorSummary:"Unknown error"}}throw t.status>=500&&(n.errorSummary="Unknown error"),e.options.transformErrorXHR&&(t=e.options.transformErrorXHR(s.clone(t))),v=new f(n,t),"E0000011"===v.errorCode&&a.deleteCookie(p.STATE_TOKEN_COOKIE_NAME),v})}function o(e,t,n){t=s.isAbsoluteUrl(t)?t:e.options.url+t;var o={url:t,method:"GET"};return s.extend(o,n),r(e,o)}function i(e,t,n,o){t=s.isAbsoluteUrl(t)?t:e.options.url+t;var i={url:t,method:"POST",args:n,saveAuthnState:!0};return s.extend(i,o),r(e,i)}var s=n(13),a=n(14),u=n(15),c=n(8),f=n(19),p=n(18);e.exports={get:o,post:i,httpRequest:r}},function(e,t){var n=e.exports;n.base64UrlToBase64=function(e){return e.replace(/\-/g,"+").replace(/_/g,"/")},n.base64UrlToString=function(e){var t=n.base64UrlToBase64(e);switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Not a valid Base64Url"}var r=atob(t);try{return decodeURIComponent(escape(r))}catch(o){return r}},n.stringToBuffer=function(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t},n.base64UrlDecode=function(e){return atob(n.base64UrlToBase64(e))},n.bind=function(e,t){var n=Array.prototype.slice.call(arguments,2);return function(){var r=Array.prototype.slice.call(arguments);return r=n.concat(r),e.apply(t,r)}},n.isAbsoluteUrl=function(e){return/^(?:[a-z]+:)?\/\//i.test(e)},n.isString=function(e){return"[object String]"===Object.prototype.toString.call(e)},n.isObject=function(e){return"[object Object]"===Object.prototype.toString.call(e)},n.isNumber=function(e){return"[object Number]"===Object.prototype.toString.call(e)},n.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},n.isoToUTCString=function(e){var t=e.match(/\d+/g),n=Date.UTC(t[0],t[1]-1,t[2],t[3],t[4],t[5]),r=new Date(n);return r.toUTCString()},n.toQueryParams=function(e){var t=[];if(null!==e)for(var n in e)e.hasOwnProperty(n)&&void 0!==e[n]&&null!==e[n]&&t.push(n+"="+encodeURIComponent(e[n]));return t.length?"?"+t.join("&"):""},n.genRandomString=function(e){for(var t="abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",n="",r=0,o=t.length;r<e;++r)n+=t[Math.floor(Math.random()*o)];return n},n.extend=function(){var e=arguments[0],t=[].slice.call(arguments,1);t.forEach(function(t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})},n.removeNils=function(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];null!==r&&void 0!==r&&(t[n]=r)}return t},n.clone=function(e){if(e){var t=JSON.stringify(e);if(t)return JSON.parse(t)}return e},n.omit=function(e){var t=Array.prototype.slice.call(arguments,1),r={};for(var o in e)e.hasOwnProperty(o)&&t.indexOf(o)==-1&&(r[o]=e[o]);return n.clone(r)},n.find=function(e,t){for(var n=e.length;n--;){var r=e[n],o=!0;for(var i in t)if(t.hasOwnProperty(i)&&r[i]!==t[i]){o=!1;break}if(o)return r}},n.getLink=function(e,t,r){if(e&&e._links){var o=n.clone(e._links[t]);return o&&o.name&&r?o.name===r?o:void 0:o}},n.getNativeConsole=function(){return window.console},n.getConsole=function(){var e=n.getNativeConsole();return e&&e.log?e:{log:function(){}}},n.warn=function(e){n.getConsole().log("[okta-auth-sdk] WARN: "+e)},n.deprecate=function(e){n.getConsole().log("[okta-auth-sdk] DEPRECATION: "+e)},n.deprecateWrap=function(e,t){return function(){return n.deprecate(e),t.apply(null,arguments)}},n.removeTrailingSlash=function(e){if(e)return"/"===e.slice(-1)?e.slice(0,-1):e},n.isIE11OrLess=function(){return!!document.documentMode&&document.documentMode<=11}},function(e,t,n){function r(e,t,n){var o="";n&&(o=" expires="+s.isoToUTCString(n)+";");var i=e+"="+t+"; path=/;"+o;return r._setDocumentCookie(i),i}function o(e){var t=new RegExp(e+"=([^;]*)"),n=o._getDocumentCookie().match(t);if(n){var r=n[1];return r}}function i(e){r(e,"","1970-01-01T00:00:00Z")}var s=n(13);r._setDocumentCookie=function(e){document.cookie=e},o._getDocumentCookie=function(){return document.cookie},e.exports={setCookie:r,getCookie:o,deleteCookie:i}},function(e,t,n){var r=n(14),o=n(16),i=n(18),s={};s.browserHasLocalStorage=function(){try{return!!s.getLocalStorage()}catch(e){return!1}},s.browserHasSessionStorage=function(){try{return!!s.getSessionStorage()}catch(e){return!1}},s.getHttpCache=function(){return s.browserHasLocalStorage()?o(s.getLocalStorage(),i.CACHE_STORAGE_NAME):s.browserHasSessionStorage()?o(s.getSessionStorage(),i.CACHE_STORAGE_NAME):o(s.getCookieStorage(),i.CACHE_STORAGE_NAME)},s.getLocalStorage=function(){return localStorage},s.getSessionStorage=function(){return sessionStorage},s.getCookieStorage=function(){return{getItem:r.getCookie,setItem:function(e,t){r.setCookie(e,t,"2038-01-19T03:14:07.000Z")}}},e.exports=s},function(e,t,n){function r(e,t){function n(){var n=e.getItem(t);n=n||"{}";try{return JSON.parse(n)}catch(r){throw new o("Unable to parse storage string: "+t)}}function r(n){try{var r=JSON.stringify(n);e.setItem(t,r)}catch(i){throw new o("Unable to set storage: "+t)}}function i(e){e||r({});var t=n();delete t[e],r(t)}function s(e,t){var o=n();o[e]=t,r(o)}return{getStorage:n,setStorage:r,clearStorage:i,updateStorage:s}}var o=n(17);e.exports=r},function(e,t){function n(e,t){this.name="AuthSdkError",this.message=e,this.errorCode="INTERNAL",this.errorSummary=e,this.errorLink="INTERNAL",this.errorId="INTERNAL",this.errorCauses=[],t&&(this.xhr=t)}n.prototype=new Error,e.exports=n},function(e,t){e.exports={STATE_TOKEN_COOKIE_NAME:"oktaStateToken",DEFAULT_POLLING_DELAY:500,DEFAULT_MAX_CLOCK_SKEW:300,DEFAULT_CACHE_DURATION:86400,FRAME_ID:"okta-oauth-helper-frame",REDIRECT_OAUTH_PARAMS_COOKIE_NAME:"okta-oauth-redirect-params",REDIRECT_STATE_COOKIE_NAME:"okta-oauth-state",REDIRECT_NONCE_COOKIE_NAME:"okta-oauth-nonce",TOKEN_STORAGE_NAME:"okta-token-storage",CACHE_STORAGE_NAME:"okta-cache-storage",SDK_VERSION:"1.16.0"}},function(e,t){function n(e,t){this.name="AuthApiError",this.message=e.errorSummary,this.errorSummary=e.errorSummary,this.errorCode=e.errorCode,this.errorLink=e.errorLink,this.errorId=e.errorId,this.errorCauses=e.errorCauses,t&&(this.xhr=t)}n.prototype=new Error,e.exports=n},function(e,t,n){function r(e,t){var n={};return m.extend(n,t),!n.stateToken&&e.stateToken&&(n.stateToken=e.stateToken),n}function o(e){return r(e)}function i(e,t){return t=r(e,t),h.post(e,e.options.url+"/api/v1/authn",t)}function s(e,t){if(!t||!t.stateToken){var n=e.tx.exists._getCookie(w.STATE_TOKEN_COOKIE_NAME);if(!n)return y.reject(new v("No transaction to resume"));t={stateToken:n}}return e.tx.status(t).then(function(t){return new d(e,t)})}function a(e){return!!e.tx.exists._getCookie(w.STATE_TOKEN_COOKIE_NAME)}function u(e,t,n,r){return h.post(e,t,n,r).then(function(t){return new d(e,t)})}function c(e,t,n){return function(r){function i(){var n={};if("function"==typeof u)try{n.autoPush=!!u()}catch(r){return y.reject(new v("AutoPush resulted in an error."))}else void 0!==u&&null!==u&&(n.autoPush=!!u);if("function"==typeof a)try{n.rememberDevice=!!a()}catch(r){return y.reject(new v("RememberDevice resulted in an error."))}else void 0!==a&&null!==a&&(n.rememberDevice=!!a);var i=c.href+m.toQueryParams(n);return h.post(e,i,o(t),{saveAuthnState:!1})}var s,a,u;m.isNumber(r)?s=r:m.isObject(r)&&(s=r.delay,a=r.rememberDevice,u=r.autoPush),s||0===s||(s=w.DEFAULT_POLLING_DELAY);var c=m.getLink(t,"next","poll");n.isPolling=!0;var f=0,p=function(){return n.isPolling?i().then(function(t){if(f=0,t.factorResult&&"WAITING"===t.factorResult){if(!n.isPolling)throw new g;return y.delay(s).then(p)}return n.isPolling=!1,new d(e,t)}).fail(function(e){if(e.xhr&&(0===e.xhr.status||429===e.xhr.status)&&f<=4){var t=1e3*Math.pow(2,f);return f++,y.delay(t).then(p)}throw e}):y.reject(new g)};return p().fail(function(e){throw n.isPolling=!1,e})}}function f(e,t,n,o,i){if(Array.isArray(o))return function(r,s){if(!r)throw new v("Must provide a link name");var a=m.find(o,{name:r});if(!a)throw new v("No link found for that name");return f(e,t,n,a,i)(s)};if(o.hints&&o.hints.allow&&1===o.hints.allow.length){var s=o.hints.allow[0];switch(s){case"GET":return function(){return h.get(e,o.href)};case"POST":return function(s){i&&i.isPolling&&(i.isPolling=!1);var a=r(t,s);"MFA_ENROLL"===t.status&&m.extend(a,{factorType:n.factorType,provider:n.provider});var c={},f=a.autoPush;if(void 0!==f){if("function"==typeof f)try{c.autoPush=!!f()}catch(p){return y.reject(new v("AutoPush resulted in an error."))}else null!==f&&(c.autoPush=!!f);a=m.omit(a,"autoPush")}var l=a.rememberDevice;if(void 0!==l){if("function"==typeof l)try{c.rememberDevice=!!l()}catch(p){return y.reject(new v("RememberDevice resulted in an error."))}else null!==l&&(c.rememberDevice=!!l);a=m.omit(a,"rememberDevice")}else a.profile&&void 0!==a.profile.updatePhone&&(a.profile.updatePhone&&(c.updatePhone=!0),a.profile=m.omit(a.profile,"updatePhone"));var d=o.href+m.toQueryParams(c);return u(e,d,a)}}}}function p(e,t,n,r){var o={};for(var i in n._links)if(n._links.hasOwnProperty(i)){var s=n._links[i];if("next"===i&&(i=s.name),s.type)o[i]=s;else switch(i){case"poll":o.poll=c(e,t,r);break;default:var a=f(e,t,n,s,r);a&&(o[i]=a)}}return o}function l(e,t,n,r){if(n=n||t,n=m.clone(n),Array.isArray(n)){for(var o=[],i=0,s=n.length;i<s;i++)o.push(l(e,t,n[i],r));return o}var a=n._embedded||{};for(var u in a)a.hasOwnProperty(u)&&(m.isObject(a[u])||Array.isArray(a[u]))&&(a[u]=l(e,t,a[u],r));var c=p(e,t,n,r);return m.extend(a,c),n=m.omit(n,"_embedded","_links"),m.extend(n,a),n}function d(e,t){t&&(this.data=t,m.extend(this,l(e,t,t,{})),delete this.stateToken,"RECOVERY_CHALLENGE"!==t.status||t._links||(this.cancel=function(){return new y(new d(e))}))}var h=n(12),m=n(13),y=n(8),v=n(17),g=n(21),w=n(18);e.exports={transactionStatus:i,resumeTransaction:s,transactionExists:a,postToTransaction:u}},function(e,t){function n(){this.name="AuthPollStopError",this.message="The poll was stopped by the sdk"}n.prototype=new Error,e.exports=n},function(e,t,n){function r(e){return e.session.get().then(function(e){ | ||
return"ACTIVE"===e.status}).fail(function(){return!1})}function o(e){return c.get(e,"/api/v1/sessions/me").then(function(t){var n=u.omit(t,"_links");return n.refresh=function(){return c.post(e,u.getLink(t,"refresh").href)},n.user=function(){return c.get(e,u.getLink(t,"user").href)},n}).fail(function(){return{status:"INACTIVE"}})}function i(e){return c.httpRequest(e,{url:e.options.url+"/api/v1/sessions/me",method:"DELETE"})}function s(e){return c.post(e,"/api/v1/sessions/me/lifecycle/refresh")}function a(e,t,n){n=n||window.location.href,window.location=e.options.url+"/login/sessionCookieRedirect"+u.toQueryParams({checkAccountSetupComplete:!0,token:t,redirectUrl:n})}var u=n(13),c=n(12);e.exports={sessionExists:r,getSession:o,closeSession:i,refreshSession:s,setCookieAndRedirect:a}},function(e,t,n){function r(e){var t,n=e.split(".");try{t={header:JSON.parse(_.base64UrlToString(n[0])),payload:JSON.parse(_.base64UrlToString(n[1])),signature:n[2]}}catch(r){throw new E("Malformed token")}return t}function o(e,t,n){function r(e){var t;if(t=n.expirationTime||0===n.expirationTime?n.expirationTime:Math.floor(Date.now()/1e3),e&&e>t)return!0}function o(e){if(!n.audience)return!0;for(var t=Array.isArray(n.audience)?n.audience:[n.audience],r=Array.isArray(e)?e:[e],o=t.length;o--;){var i=t[o];if(r.indexOf(i)!==-1)return!0}}return n=n||{},e.features.isTokenVerifySupported()?A.getWellKnown(e).then(function(t){return k.get(e,t.jwks_uri)}).then(function(e){var n=e.keys[0];return b.verifyToken(t,n)}).then(function(i){if(!i)return!1;var s=e.token.decode(t);return!r(s.payload.exp)&&(!!o(s.payload.aud)&&(!n.issuer||n.issuer===s.payload.iss))}):x.reject(new E("This browser doesn't support crypto.subtle"))}function i(e,t,n,o){return(new x).then(function(){if(!t||!t.idToken)throw new E("Only idTokens may be verified");var i=r(t.idToken);return A.validateClaims(e,i.payload,t.clientId,t.issuer,n),o||!e.features.isTokenVerifySupported()?t:A.getKey(e,t.issuer,i.header.kid).then(function(e){return b.verifyToken(t.idToken,e)}).then(function(e){if(!e)throw new E("The token signature is not valid");return t})})}function s(e,t){return t=t||{},t.display=null,t.prompt="none",d(e,t)}function a(e,t,n){function r(t){!t.data||t.origin!==e.options.url||t.data&&_.isString(n)&&t.data.state!==n||o.resolve(t.data)}var o=x.defer();return A.addListener(window,"message",r),o.promise.timeout(t||12e4,new E("OAuth flow timed out")).fin(function(){A.removeListener(window,"message",r)})}function u(e,t,n){function r(){try{t&&t.location&&t.location.hash?o.resolve(A.hashToObject(t.location.hash)):t&&!t.closed&&setTimeout(r,500)}catch(e){setTimeout(r,500)}}var o=x.defer();return r(),o.promise.timeout(n||12e4,new E("OAuth flow timed out"))}function c(e,t,n,r){r=r||{};var o=t.responseType,s=_.clone(t.scopes),a=t.clientId||e.options.clientId;return(new x).then(function(){if(n.error||n.error_description)throw new S(n.error,n.error_description);if(n.state!==t.state)throw new E("OAuth flow response state doesn't match request state");var o={};if(n.access_token&&(o.token={accessToken:n.access_token,expiresAt:Number(n.expires_in)+Math.floor(Date.now()/1e3),tokenType:n.token_type,scopes:s,authorizeUrl:r.authorizeUrl,userinfoUrl:r.userinfoUrl}),n.code&&(o.code={authorizationCode:n.code}),n.id_token){var u=e.token.decode(n.id_token),c={idToken:n.id_token,claims:u.payload,expiresAt:u.payload.exp,scopes:s,authorizeUrl:r.authorizeUrl,issuer:r.issuer,clientId:a};return i(e,c,t.nonce,!0).then(function(){return o.id_token=c,o})}return o}).then(function(e){if(!Array.isArray(o))return e[o];if(!e.token&&!e.id_token)throw new E("Unable to parse OAuth flow response");return o.map(function(t){return e[t]})})}function f(e,t){t=_.clone(t)||{},t.scope&&(_.deprecate('The param "scope" is equivalent to "scopes". Use "scopes" instead.'),t.scopes=t.scope,delete t.scope);var n={clientId:e.options.clientId,redirectUri:e.options.redirectUri||window.location.href,responseType:"id_token",responseMode:"okta_post_message",state:_.genRandomString(64),nonce:_.genRandomString(64),scopes:["openid","email"]};return _.extend(n,t),n}function p(e){if(!e.clientId)throw new E("A clientId must be specified in the OktaAuth constructor to get a token");if(_.isString(e.responseType)&&e.responseType.indexOf(" ")!==-1)throw new E("Multiple OAuth responseTypes must be defined as an array");var t=_.removeNils({client_id:e.clientId,redirect_uri:e.redirectUri,response_type:e.responseType,response_mode:e.responseMode,state:e.state,nonce:e.nonce,prompt:e.prompt,display:e.display,sessionToken:e.sessionToken,idp:e.idp,max_age:e.maxAge});if(Array.isArray(t.response_type)&&(t.response_type=t.response_type.join(" ")),e.responseType.indexOf("id_token")!==-1&&e.scopes.indexOf("openid")===-1)throw new E("openid scope must be specified in the scopes argument when requesting an id_token");return t.scope=e.scopes.join(" "),t}function l(e){var t=p(e);return _.toQueryParams(t)}function d(e,t,n){function r(e){var t=/^(https?\:\/\/)?([^:\/?#]*(?:\:[0-9]+)?)/;return t.exec(e)[0]}function o(e){e.closed&&O.reject(new E("Unable to parse OAuth flow response"))}t=t||{},n=n||{};var i=f(e,t),s={prompt:"none",responseMode:"okta_post_message",display:null},p={display:"popup"};t.sessionToken?_.extend(i,s):t.idp&&_.extend(i,p);var d,h;try{h=A.getOAuthUrls(e,i,n),d=h.authorizeUrl+l(i)}catch(m){return x.reject(m)}var y;switch(y=i.sessionToken||null===i.display?"IFRAME":"popup"===i.display?"POPUP":"IMPLICIT"){case"IFRAME":var v=a(e,n.timeout,i.state),g=A.loadFrame(d);return v.then(function(t){return c(e,i,t,h)}).fin(function(){document.body.contains(g)&&g.parentElement.removeChild(g)});case"POPUP":var w;if("okta_post_message"===i.responseMode){if(!e.features.isPopupPostMessageSupported())return x.reject(new E("This browser doesn't have full postMessage support"));w=a(e,n.timeout,i.state)}var T={popupTitle:n.popupTitle},k=A.loadPopup(d,T);if("fragment"===i.responseMode){var b=r(e.idToken.authorize._getLocationHref()),S=r(i.redirectUri);if(b!==S)return x.reject(new E("Using fragment, the redirectUri origin ("+S+") must match the origin of this page ("+b+")"));w=u(e,k,n.timeout)}var O=x.defer(),C=setInterval(function(){o(k)},500);return w.then(function(e){O.resolve(e)}).fail(function(e){O.reject(e)}),O.promise.then(function(t){return c(e,i,t,h)}).fin(function(){k.closed||(clearInterval(C),k.close())});default:return x.reject(new E("The full page redirect flow is not supported"))}}function h(e,t,n){var r=_.clone(t)||{};return _.extend(r,{prompt:"none",responseMode:"okta_post_message",display:null}),d(e,r,n)}function m(e,t,n){var r=_.clone(t)||{};return _.extend(r,{display:"popup"}),d(e,r,n)}function y(e,t,n){t=_.clone(t)||{};var r=f(e,t);if(!t.responseMode){var o=r.responseType;o.indexOf("code")!==-1&&(_.isString(o)||Array.isArray(o)&&1===o.length)?_.extend(r,{responseMode:"query"}):_.extend(r,{responseMode:"fragment"})}var i=A.getOAuthUrls(e,r,n),s=i.authorizeUrl+l(r);C.setCookie(O.REDIRECT_OAUTH_PARAMS_COOKIE_NAME,JSON.stringify({responseType:r.responseType,state:r.state,nonce:r.nonce,scopes:r.scopes,urls:i})),C.setCookie(O.REDIRECT_NONCE_COOKIE_NAME,r.nonce),C.setCookie(O.REDIRECT_STATE_COOKIE_NAME,r.state),e.token.getWithRedirect._setLocation(s)}function v(e,t){if(!A.isToken(t))return x.reject(new E("Refresh must be passed a token with an array of scopes and an accessToken or idToken"));var n;return n=t.accessToken?"token":"id_token",e.token.getWithoutPrompt({responseType:n,scopes:t.scopes},{authorizeUrl:t.authorizeUrl,userinfoUrl:t.userinfoUrl,issuer:t.issuer})}function g(e){var t=e.token.parseFromUrl._getHistory(),n=e.token.parseFromUrl._getDocument(),r=e.token.parseFromUrl._getLocation();t&&t.replaceState?t.replaceState(null,n.title,r.pathname+r.search):r.hash=""}function w(e,t){var n=e.token.parseFromUrl._getLocation(),r=n.hash;t&&(r=t.substring(t.indexOf("#")));var o=C.getCookie(O.REDIRECT_OAUTH_PARAMS_COOKIE_NAME);if(!r||!o)return x.reject(new E("Unable to parse a token from the url"));try{var i=JSON.parse(o),s=i.urls;delete i.urls,C.deleteCookie(O.REDIRECT_OAUTH_PARAMS_COOKIE_NAME)}catch(a){return x.reject(new E("Unable to parse the "+O.REDIRECT_OAUTH_PARAMS_COOKIE_NAME+" cookie: "+a.message))}return x.resolve(A.hashToObject(r)).then(function(n){return t||g(e),c(e,i,n,s)})}function T(e,t){return t&&(A.isToken(t)||t.accessToken||t.userinfoUrl)?k.httpRequest(e,{url:t.userinfoUrl,method:"GET",accessToken:t.accessToken}).fail(function(e){if(e.xhr&&(401===e.xhr.status||403===e.xhr.status)){var t=e.xhr.getResponseHeader("WWW-Authenticate");if(t){var n=t.match(/error="(.*?)"/)||[],r=t.match(/error_description="(.*?)"/)||[],o=n[1],i=r[1];o&&i&&(e=new S(o,i))}}throw e}):x.reject(new E("getUserInfo requires an access token object"))}var k=n(12),_=n(13),A=n(11),x=n(8),b=n(24),E=n(17),S=n(25),O=n(18),C=n(14);e.exports={getToken:d,getWithoutPrompt:h,getWithPopup:m,getWithRedirect:y,parseFromUrl:w,refreshIdToken:s,decodeToken:r,verifyIdToken:o,refreshToken:v,getUserInfo:T,verifyToken:i}},function(e,t,n){function r(e,t){t=o.clone(t);var n="jwk",r={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},i=!0,s=["verify"];return delete t.use,crypto.subtle.importKey(n,t,r,i,s).then(function(t){var n=e.split("."),i=o.stringToBuffer(n[0]+"."+n[1]),s=o.base64UrlDecode(n[2]),a=o.stringToBuffer(s);return crypto.subtle.verify(r,t,a,i)})}var o=n(13);e.exports={verifyToken:r}},function(e,t){function n(e,t){this.name="OAuthError",this.message=t,this.errorCode=e,this.errorSummary=t}n.prototype=new Error,e.exports=n},function(e,t,n){function r(e,t,n){e.emitter.emit("expired",t,n)}function o(e,t){clearTimeout(e.refreshTimeouts[t]),delete e.refreshTimeouts[t]}function i(e){var t=e.refreshTimeouts;for(var n in t)t.hasOwnProperty(n)&&o(e,n);e.refreshTimeouts={}}function s(e,t,n,i,s){var a=1e3*s.expiresAt-Date.now();a<0&&(a=0);var u=setTimeout(function(){return t.autoRefresh?p(e,t,n,i):void(1e3*s.expiresAt<=Date.now()&&(f(t,n,i),r(t,i,s)))},a);o(t,i),t.refreshTimeouts[i]=u}function a(e,t,n){try{var r=n.getStorage()}catch(o){return void t.emitter.emit("error",o)}for(var i in r)if(r.hasOwnProperty(i)){var a=r[i];s(e,t,n,i,a)}}function u(e,t,n,r,o){var i=n.getStorage();if(!h.isObject(o)||!o.scopes||!o.expiresAt&&0!==o.expiresAt||!o.idToken&&!o.accessToken)throw new m("Token must be an Object with scopes, expiresAt, and an idToken or accessToken properties");i[r]=o,n.setStorage(i),s(e,t,n,r,o)}function c(e,t){var n=e.getStorage();return n[t]}function f(e,t,n){o(e,n);var r=t.getStorage();delete r[n],t.setStorage(r)}function p(e,t,n,i){try{var s=c(n,i);if(!s)throw new m("The tokenManager has no token for the key: "+i)}catch(a){return v.reject(a)}return o(t,i),e.token.refresh(s).then(function(r){return u(e,t,n,i,r),t.emitter.emit("refreshed",i,r,s),r}).fail(function(e){throw"OAuthError"===e.name&&(f(t,n,i),r(t,i,s)),e})}function l(e,t){i(e),t.clearStorage()}function d(e,t){t=t||{},t.storage=t.storage||"localStorage",t.autoRefresh||t.autoRefresh===!1||(t.autoRefresh=!0),"localStorage"!==t.storage||y.browserHasLocalStorage()||(h.warn("This browser doesn't support localStorage. Switching to sessionStorage."),t.storage="sessionStorage"),"sessionStorage"!==t.storage||y.browserHasSessionStorage()||(h.warn("This browser doesn't support sessionStorage. Switching to cookie-based storage."),t.storage="cookie");var n;switch(t.storage){case"localStorage":n=T(localStorage,w.TOKEN_STORAGE_NAME);break;case"sessionStorage":n=T(sessionStorage,w.TOKEN_STORAGE_NAME);break;case"cookie":n=T(y.getCookieStorage(),w.TOKEN_STORAGE_NAME);break;default:throw new m("Unrecognized storage option")}var r={emitter:new g,autoRefresh:t.autoRefresh,refreshTimeouts:{}};this.add=h.bind(u,this,e,r,n),this.get=h.bind(c,this,n),this.remove=h.bind(f,this,r,n),this.clear=h.bind(l,this,r,n),this.refresh=h.bind(p,this,e,r,n),this.on=h.bind(r.emitter.on,r.emitter),this.off=h.bind(r.emitter.off,r.emitter),a(e,r,n)}var h=n(13),m=n(17),y=n(15),v=n(8),g=n(27),w=n(18),T=n(16);e.exports=d},function(e,t){function n(){}n.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){function r(){o.off(e,r),t.apply(n,arguments)}var o=this;return r._=t,this.on(e,r,n)},emit:function(e){var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;for(r;r<o;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],o=[];if(r&&t)for(var i=0,s=r.length;i<s;i++)r[i].fn!==t&&r[i].fn._!==t&&o.push(r[i]);return o.length?n[e]=o:delete n[e],this}},e.exports=n}])}); | ||
!function(t){"use strict";if("function"==typeof bootstrap)bootstrap("promise",t);else{e.exports=t()}}(function(){"use strict";function e(e){return function(){return Q.apply(e,arguments)}}function r(e){return e===Object(e)}function o(e){return"[object StopIteration]"===oe(e)||e instanceof B}function i(e,t){if(K&&t.stack&&"object"==typeof e&&null!==e&&e.stack&&e.stack.indexOf(ie)===-1){for(var n=[],r=t;r;r=r.source)r.stack&&n.unshift(r.stack);n.unshift(e.stack);var o=n.join("\n"+ie+"\n");e.stack=s(o)}}function s(e){for(var t=e.split("\n"),n=[],r=0;r<t.length;++r){var o=t[r];c(o)||a(o)||!o||n.push(o)}return n.join("\n")}function a(e){return e.indexOf("(module.js:")!==-1||e.indexOf("(node.js:")!==-1}function u(e){var t=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(e);if(t)return[t[1],Number(t[2])];var n=/at ([^ ]+):(\d+):(?:\d+)$/.exec(e);if(n)return[n[1],Number(n[2])];var r=/.*@(.+):(\d+)$/.exec(e);return r?[r[1],Number(r[2])]:void 0}function c(e){var t=u(e);if(!t)return!1;var n=t[0],r=t[1];return n===X&&r>=J&&r<=fe}function f(){if(K)try{throw new Error}catch(e){var t=e.stack.split("\n"),n=t[0].indexOf("@")>0?t[1]:t[2],r=u(n);if(!r)return;return X=r[0],r[1]}}function p(e,t,n){return function(){return"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(t+" is deprecated, use "+n+" instead.",new Error("").stack),e.apply(e,arguments)}}function l(e){return e instanceof y?e:T(e)?C(e):O(e)}function d(){function e(e){t=e,i.source=e,$(n,function(t,n){l.nextTick(function(){e.promiseDispatch.apply(e,n)})},void 0),n=void 0,r=void 0}var t,n=[],r=[],o=te(d.prototype),i=te(y.prototype);if(i.promiseDispatch=function(e,o,i){var s=Y(arguments);n?(n.push(s),"when"===o&&i[1]&&r.push(i[1])):l.nextTick(function(){t.promiseDispatch.apply(t,s)})},i.valueOf=function(){if(n)return i;var e=g(t);return w(e)&&(t=e),e},i.inspect=function(){return t?t.inspect():{state:"pending"}},l.longStackSupport&&K)try{throw new Error}catch(s){i.stack=s.stack.substring(s.stack.indexOf("\n")+1)}return o.promise=i,o.resolve=function(n){t||e(l(n))},o.fulfill=function(n){t||e(O(n))},o.reject=function(n){t||e(S(n))},o.notify=function(e){t||$(r,function(t,n){l.nextTick(function(){n(e)})},void 0)},o}function h(e){if("function"!=typeof e)throw new TypeError("resolver must be a function.");var t=d();try{e(t.resolve,t.reject,t.notify)}catch(n){t.reject(n)}return t.promise}function m(e){return h(function(t,n){for(var r=0,o=e.length;r<o;r++)l(e[r]).then(t,n)})}function y(e,t,n){void 0===t&&(t=function(e){return S(new Error("Promise does not support operation: "+e))}),void 0===n&&(n=function(){return{state:"unknown"}});var r=te(y.prototype);if(r.promiseDispatch=function(n,o,i){var s;try{s=e[o]?e[o].apply(r,i):t.call(r,o,i)}catch(a){s=S(a)}n&&n(s)},r.inspect=n,n){var o=n();"rejected"===o.state&&(r.exception=o.reason),r.valueOf=function(){var e=n();return"pending"===e.state||"rejected"===e.state?r:e.value}}return r}function v(e,t,n,r){return l(e).then(t,n,r)}function g(e){if(w(e)){var t=e.inspect();if("fulfilled"===t.state)return t.value}return e}function w(e){return e instanceof y}function T(e){return r(e)&&"function"==typeof e.then}function k(e){return w(e)&&"pending"===e.inspect().state}function _(e){return!w(e)||"fulfilled"===e.inspect().state}function A(e){return w(e)&&"rejected"===e.inspect().state}function x(){se.length=0,ae.length=0,ce||(ce=!0)}function b(e,n){ce&&("object"==typeof t&&"function"==typeof t.emit&&l.nextTick.runAfter(function(){Z(ae,e)!==-1&&(t.emit("unhandledRejection",n,e),ue.push(e))}),ae.push(e),n&&"undefined"!=typeof n.stack?se.push(n.stack):se.push("(no stack) "+n))}function E(e){if(ce){var n=Z(ae,e);n!==-1&&("object"==typeof t&&"function"==typeof t.emit&&l.nextTick.runAfter(function(){var r=Z(ue,e);r!==-1&&(t.emit("rejectionHandled",se[n],e),ue.splice(r,1))}),ae.splice(n,1),se.splice(n,1))}}function S(e){var t=y({when:function(t){return t&&E(this),t?t(e):this}},function(){return this},function(){return{state:"rejected",reason:e}});return b(t,e),t}function O(e){return y({when:function(){return e},get:function(t){return e[t]},set:function(t,n){e[t]=n},"delete":function(t){delete e[t]},post:function(t,n){return null===t||void 0===t?e.apply(void 0,n):e[t].apply(e,n)},apply:function(t,n){return e.apply(t,n)},keys:function(){return re(e)}},void 0,function(){return{state:"fulfilled",value:e}})}function C(e){var t=d();return l.nextTick(function(){try{e.then(t.resolve,t.reject,t.notify)}catch(n){t.reject(n)}}),t.promise}function R(e){return y({isDef:function(){}},function(t,n){return M(e,t,n)},function(){return l(e).inspect()})}function j(e,t,n){return l(e).spread(t,n)}function U(e){return function(){function t(e,t){var s;if("undefined"==typeof StopIteration){try{s=n[e](t)}catch(a){return S(a)}return s.done?l(s.value):v(s.value,r,i)}try{s=n[e](t)}catch(a){return o(a)?l(a.value):S(a)}return v(s,r,i)}var n=e.apply(this,arguments),r=t.bind(t,"next"),i=t.bind(t,"throw");return r()}}function I(e){l.done(l.async(e)())}function N(e){throw new B(e)}function P(e){return function(){return j([this,D(arguments)],function(t,n){return e.apply(t,n)})}}function M(e,t,n){return l(e).dispatch(t,n)}function D(e){return v(e,function(e){var t=0,n=d();return $(e,function(r,o,i){var s;w(o)&&"fulfilled"===(s=o.inspect()).state?e[i]=s.value:(++t,v(o,function(r){e[i]=r,0===--t&&n.resolve(e)},n.reject,function(e){n.notify({index:i,value:e})}))},void 0),0===t&&n.resolve(e),n.promise})}function q(e){if(0===e.length)return l.resolve();var t=l.defer(),n=0;return $(e,function(r,o,i){function s(e){t.resolve(e)}function a(){n--,0===n&&t.reject(new Error("Can't get fulfillment value from any promise, all promises were rejected."))}function u(e){t.notify({index:i,value:e})}var c=e[i];n++,v(c,s,a,u)},void 0),t.promise}function L(e){return v(e,function(e){return e=ee(e,l),v(D(ee(e,function(e){return v(e,G,G)})),function(){return e})})}function H(e){return l(e).allSettled()}function F(e,t){return l(e).then(void 0,void 0,t)}function W(e,t){return l(e).nodeify(t)}var K=!1;try{throw new Error}catch(z){K=!!z.stack}var X,B,J=f(),G=function(){},V=function(){function e(){for(var e,t;o.next;)o=o.next,e=o.task,o.task=void 0,t=o.domain,t&&(o.domain=void 0,t.enter()),r(e,t);for(;c.length;)e=c.pop(),r(e);s=!1}function r(t,n){try{t()}catch(r){if(u)throw n&&n.exit(),setTimeout(e,0),n&&n.enter(),r;setTimeout(function(){throw r},0)}n&&n.exit()}var o={task:void 0,next:null},i=o,s=!1,a=void 0,u=!1,c=[];if(V=function(e){i=i.next={task:e,domain:u&&t.domain,next:null},s||(s=!0,a())},"object"==typeof t&&"[object process]"===t.toString()&&t.nextTick)u=!0,a=function(){t.nextTick(e)};else if("function"==typeof n)a="undefined"!=typeof window?n.bind(window,e):function(){n(e)};else if("undefined"!=typeof MessageChannel){var f=new MessageChannel;f.port1.onmessage=function(){a=p,f.port1.onmessage=e,e()};var p=function(){f.port2.postMessage(0)};a=function(){setTimeout(e,0),p()}}else a=function(){setTimeout(e,0)};return V.runAfter=function(e){c.push(e),s||(s=!0,a())},V}(),Q=Function.call,Y=e(Array.prototype.slice),$=e(Array.prototype.reduce||function(e,t){var n=0,r=this.length;if(1===arguments.length)for(;;){if(n in this){t=this[n++];break}if(++n>=r)throw new TypeError}for(;n<r;n++)n in this&&(t=e(t,this[n],n));return t}),Z=e(Array.prototype.indexOf||function(e){for(var t=0;t<this.length;t++)if(this[t]===e)return t;return-1}),ee=e(Array.prototype.map||function(e,t){var n=this,r=[];return $(n,function(o,i,s){r.push(e.call(t,i,s,n))},void 0),r}),te=Object.create||function(e){function t(){}return t.prototype=e,new t},ne=e(Object.prototype.hasOwnProperty),re=Object.keys||function(e){var t=[];for(var n in e)ne(e,n)&&t.push(n);return t},oe=e(Object.prototype.toString);B="undefined"!=typeof ReturnValue?ReturnValue:function(e){this.value=e};var ie="From previous event:";l.resolve=l,l.nextTick=V,l.longStackSupport=!1,"object"==typeof t&&t&&t.env&&t.env.Q_DEBUG&&(l.longStackSupport=!0),l.defer=d,d.prototype.makeNodeResolver=function(){var e=this;return function(t,n){t?e.reject(t):arguments.length>2?e.resolve(Y(arguments,1)):e.resolve(n)}},l.Promise=h,l.promise=h,h.race=m,h.all=D,h.reject=S,h.resolve=l,l.passByCopy=function(e){return e},y.prototype.passByCopy=function(){return this},l.join=function(e,t){return l(e).join(t)},y.prototype.join=function(e){return l([this,e]).spread(function(e,t){if(e===t)return e;throw new Error("Can't join: not the same: "+e+" "+t)})},l.race=m,y.prototype.race=function(){return this.then(l.race)},l.makePromise=y,y.prototype.toString=function(){return"[object Promise]"},y.prototype.then=function(e,t,n){function r(t){try{return"function"==typeof e?e(t):t}catch(n){return S(n)}}function o(e){if("function"==typeof t){i(e,a);try{return t(e)}catch(n){return S(n)}}return S(e)}function s(e){return"function"==typeof n?n(e):e}var a=this,u=d(),c=!1;return l.nextTick(function(){a.promiseDispatch(function(e){c||(c=!0,u.resolve(r(e)))},"when",[function(e){c||(c=!0,u.resolve(o(e)))}])}),a.promiseDispatch(void 0,"when",[void 0,function(e){var t,n=!1;try{t=s(e)}catch(r){if(n=!0,!l.onerror)throw r;l.onerror(r)}n||u.notify(t)}]),u.promise},l.tap=function(e,t){return l(e).tap(t)},y.prototype.tap=function(e){return e=l(e),this.then(function(t){return e.fcall(t).thenResolve(t)})},l.when=v,y.prototype.thenResolve=function(e){return this.then(function(){return e})},l.thenResolve=function(e,t){return l(e).thenResolve(t)},y.prototype.thenReject=function(e){return this.then(function(){throw e})},l.thenReject=function(e,t){return l(e).thenReject(t)},l.nearer=g,l.isPromise=w,l.isPromiseAlike=T,l.isPending=k,y.prototype.isPending=function(){return"pending"===this.inspect().state},l.isFulfilled=_,y.prototype.isFulfilled=function(){return"fulfilled"===this.inspect().state},l.isRejected=A,y.prototype.isRejected=function(){return"rejected"===this.inspect().state};var se=[],ae=[],ue=[],ce=!0;l.resetUnhandledRejections=x,l.getUnhandledReasons=function(){return se.slice()},l.stopUnhandledRejectionTracking=function(){x(),ce=!1},x(),l.reject=S,l.fulfill=O,l.master=R,l.spread=j,y.prototype.spread=function(e,t){return this.all().then(function(t){return e.apply(void 0,t)},t)},l.async=U,l.spawn=I,l["return"]=N,l.promised=P,l.dispatch=M,y.prototype.dispatch=function(e,t){var n=this,r=d();return l.nextTick(function(){n.promiseDispatch(r.resolve,e,t)}),r.promise},l.get=function(e,t){return l(e).dispatch("get",[t])},y.prototype.get=function(e){return this.dispatch("get",[e])},l.set=function(e,t,n){return l(e).dispatch("set",[t,n])},y.prototype.set=function(e,t){return this.dispatch("set",[e,t])},l.del=l["delete"]=function(e,t){return l(e).dispatch("delete",[t])},y.prototype.del=y.prototype["delete"]=function(e){return this.dispatch("delete",[e])},l.mapply=l.post=function(e,t,n){return l(e).dispatch("post",[t,n])},y.prototype.mapply=y.prototype.post=function(e,t){return this.dispatch("post",[e,t])},l.send=l.mcall=l.invoke=function(e,t){return l(e).dispatch("post",[t,Y(arguments,2)])},y.prototype.send=y.prototype.mcall=y.prototype.invoke=function(e){return this.dispatch("post",[e,Y(arguments,1)])},l.fapply=function(e,t){return l(e).dispatch("apply",[void 0,t])},y.prototype.fapply=function(e){return this.dispatch("apply",[void 0,e])},l["try"]=l.fcall=function(e){return l(e).dispatch("apply",[void 0,Y(arguments,1)])},y.prototype.fcall=function(){return this.dispatch("apply",[void 0,Y(arguments)])},l.fbind=function(e){var t=l(e),n=Y(arguments,1);return function(){return t.dispatch("apply",[this,n.concat(Y(arguments))])}},y.prototype.fbind=function(){var e=this,t=Y(arguments);return function(){return e.dispatch("apply",[this,t.concat(Y(arguments))])}},l.keys=function(e){return l(e).dispatch("keys",[])},y.prototype.keys=function(){return this.dispatch("keys",[])},l.all=D,y.prototype.all=function(){return D(this)},l.any=q,y.prototype.any=function(){return q(this)},l.allResolved=p(L,"allResolved","allSettled"),y.prototype.allResolved=function(){return L(this)},l.allSettled=H,y.prototype.allSettled=function(){return this.then(function(e){return D(ee(e,function(e){function t(){return e.inspect()}return e=l(e),e.then(t,t)}))})},l.fail=l["catch"]=function(e,t){return l(e).then(void 0,t)},y.prototype.fail=y.prototype["catch"]=function(e){return this.then(void 0,e)},l.progress=F,y.prototype.progress=function(e){return this.then(void 0,void 0,e)},l.fin=l["finally"]=function(e,t){return l(e)["finally"](t)},y.prototype.fin=y.prototype["finally"]=function(e){return e=l(e),this.then(function(t){return e.fcall().then(function(){return t})},function(t){return e.fcall().then(function(){throw t})})},l.done=function(e,t,n,r){return l(e).done(t,n,r)},y.prototype.done=function(e,n,r){var o=function(e){l.nextTick(function(){if(i(e,s),!l.onerror)throw e;l.onerror(e)})},s=e||n||r?this.then(e,n,r):this;"object"==typeof t&&t&&t.domain&&(o=t.domain.bind(o)),s.then(void 0,o)},l.timeout=function(e,t,n){return l(e).timeout(t,n)},y.prototype.timeout=function(e,t){var n=d(),r=setTimeout(function(){t&&"string"!=typeof t||(t=new Error(t||"Timed out after "+e+" ms"),t.code="ETIMEDOUT"),n.reject(t)},e);return this.then(function(e){clearTimeout(r),n.resolve(e)},function(e){clearTimeout(r),n.reject(e)},n.notify),n.promise},l.delay=function(e,t){return void 0===t&&(t=e,e=void 0),l(e).delay(t)},y.prototype.delay=function(e){return this.then(function(t){var n=d();return setTimeout(function(){n.resolve(t)},e),n.promise})},l.nfapply=function(e,t){return l(e).nfapply(t)},y.prototype.nfapply=function(e){var t=d(),n=Y(e);return n.push(t.makeNodeResolver()),this.fapply(n).fail(t.reject),t.promise},l.nfcall=function(e){var t=Y(arguments,1);return l(e).nfapply(t)},y.prototype.nfcall=function(){var e=Y(arguments),t=d();return e.push(t.makeNodeResolver()),this.fapply(e).fail(t.reject),t.promise},l.nfbind=l.denodeify=function(e){var t=Y(arguments,1);return function(){var n=t.concat(Y(arguments)),r=d();return n.push(r.makeNodeResolver()),l(e).fapply(n).fail(r.reject),r.promise}},y.prototype.nfbind=y.prototype.denodeify=function(){var e=Y(arguments);return e.unshift(this),l.denodeify.apply(void 0,e)},l.nbind=function(e,t){var n=Y(arguments,2);return function(){function r(){return e.apply(t,arguments)}var o=n.concat(Y(arguments)),i=d();return o.push(i.makeNodeResolver()),l(r).fapply(o).fail(i.reject),i.promise}},y.prototype.nbind=function(){var e=Y(arguments,0);return e.unshift(this),l.nbind.apply(void 0,e)},l.nmapply=l.npost=function(e,t,n){return l(e).npost(t,n)},y.prototype.nmapply=y.prototype.npost=function(e,t){var n=Y(t||[]),r=d();return n.push(r.makeNodeResolver()),this.dispatch("post",[e,n]).fail(r.reject),r.promise},l.nsend=l.nmcall=l.ninvoke=function(e,t){var n=Y(arguments,2),r=d();return n.push(r.makeNodeResolver()),l(e).dispatch("post",[t,n]).fail(r.reject),r.promise},y.prototype.nsend=y.prototype.nmcall=y.prototype.ninvoke=function(e){var t=Y(arguments,1),n=d();return t.push(n.makeNodeResolver()),this.dispatch("post",[e,t]).fail(n.reject),n.promise},l.nodeify=W,y.prototype.nodeify=function(e){return e?void this.then(function(t){l.nextTick(function(){e(null,t)})},function(t){l.nextTick(function(){e(t)})}):this},l.noConflict=function(){throw new Error("Q.noConflict only works when Q is used as a global")};var fe=f();return l})}).call(t,n(9),n(10).setImmediate)},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(f===setTimeout)return setTimeout(e,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(e,0);try{return f(e,0)}catch(t){try{return f.call(null,e,0)}catch(t){return f.call(this,e,0)}}}function i(e){if(p===clearTimeout)return clearTimeout(e);if((p===r||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function s(){m&&d&&(m=!1,d.length?h=d.concat(h):y=-1,h.length&&a())}function a(){if(!m){var e=o(s);m=!0;for(var t=h.length;t;){for(d=h,h=[];++y<t;)d&&d[y].run();y=-1,t=h.length}d=null,m=!1,i(e)}}function u(e,t){this.fun=e,this.array=t}function c(){}var f,p,l=e.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:n}catch(e){f=n}try{p="function"==typeof clearTimeout?clearTimeout:r}catch(e){p=r}}();var d,h=[],m=!1,y=-1;l.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];h.push(new u(e,t)),1!==h.length||m||o(a)},u.prototype.run=function(){this.fun.apply(null,this.array)},l.title="browser",l.browser=!0,l.env={},l.argv=[],l.version="",l.versions={},l.on=c,l.addListener=c,l.once=c,l.off=c,l.removeListener=c,l.removeAllListeners=c,l.emit=c,l.prependListener=c,l.prependOnceListener=c,l.listeners=function(e){return[]},l.binding=function(e){throw new Error("process.binding is not supported")},l.cwd=function(){return"/"},l.chdir=function(e){throw new Error("process.chdir is not supported")},l.umask=function(){return 0}},function(e,t,n){(function(e,r){function o(e,t){this._id=e,this._clearFn=t}var i=n(9).nextTick,s=Function.prototype.apply,a=Array.prototype.slice,u={},c=0;t.setTimeout=function(){return new o(s.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new o(s.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},t.setImmediate="function"==typeof e?e:function(e){var n=c++,r=!(arguments.length<2)&&a.call(arguments,1);return u[n]=!0,i(function(){u[n]&&(r?e.apply(null,r):e.call(null),t.clearImmediate(n))}),n},t.clearImmediate="function"==typeof r?r:function(e){delete u[e]}}).call(t,n(10).setImmediate,n(10).clearImmediate)},function(e,t,n){function r(e){return!(!e||!e.accessToken&&!e.idToken||!Array.isArray(e.scopes))}function o(e,t,n){e.addEventListener?e.addEventListener(t,n):e.attachEvent("on"+t,n)}function i(e,t,n){e.removeEventListener?e.removeEventListener(t,n):e.detachEvent("on"+t,n)}function s(e){var t=document.createElement("iframe");return t.style.display="none",t.src=e,document.body.appendChild(t)}function a(e,t){var n=t.popupTitle||"External Identity Provider User Authentication",r="toolbar=no, scrollbars=yes, resizable=yes, top=100, left=500, width=600, height=600";if(h.isIE11OrLess()){var o=window.open("/",n,r);return o.location.href=e,o}return window.open(e,n,r)}function u(e,t){return d.get(e,(t||e.options.url)+"/.well-known/openid-configuration",{cacheResponse:!0})}function c(e,t,n){return u(e,t).then(function(t){var r=t.jwks_uri,o=v.getStorage(),i=o[r];if(i&&Date.now()/1e3<i.expiresAt){var s=h.find(i.response.keys,{kid:n});if(s)return s}return v.clearStorage(r),d.get(e,r,{cacheResponse:!0}).then(function(e){var t=h.find(e.keys,{kid:n});if(t)return t;throw new y("The key id, "+n+", was not found in the server's keys")})})}function f(e,t,n,r,o){if(!t||!r||!n)throw new y("The jwt, iss, and aud arguments are all required");if(o&&t.nonce!==o)throw new y("OAuth flow response nonce doesn't match request nonce");var i=Math.floor((new Date).getTime()/1e3);if(t.iss!==r)throw new y("The issuer ["+t.iss+"] does not match ["+r+"]");if(t.aud!==n)throw new y("The audience ["+t.aud+"] does not match ["+n+"]");if(t.iat>t.exp)throw new y("The JWT expired before it was issued");if(i-e.options.maxClockSkew>t.exp)throw new y("The JWT expired and is no longer valid");if(t.iat>i+e.options.maxClockSkew)throw new y("The JWT was issued in the future")}function p(e,t,n){n=n||{};var r=h.removeTrailingSlash(n.authorizeUrl)||e.options.authorizeUrl,o=h.removeTrailingSlash(n.issuer)||e.options.issuer,i=h.removeTrailingSlash(n.userinfoUrl)||e.options.userinfoUrl;if(o&&!/^https?:/.test(o)&&(o=e.options.url+"/oauth2/"+o),!o&&r&&t.responseType.indexOf("id_token")!==-1)throw new y("Cannot request idToken with an authorizeUrl without an issuer");if(!o&&t.responseType.indexOf("token")!==-1){if(r&&!i)throw new y("Cannot request accessToken with an authorizeUrl without an issuer or userinfoUrl");if(i&&!r)throw new y("Cannot request token with an userinfoUrl without an issuer or authorizeUrl")}var s=new RegExp("^https?://.*?/oauth2/.+");return o=o||e.options.url,s.test(o)?(r=r||o+"/v1/authorize",i=i||o+"/v1/userinfo"):(r=r||o+"/oauth2/v1/authorize",i=i||o+"/oauth2/v1/userinfo"),{issuer:o,authorizeUrl:r,userinfoUrl:i}}function l(e){for(var t,n=/\+/g,r=/([^&=]+)=?([^&]*)/g,o=e.substring(1),i={};;){if(t=r.exec(o),!t)break;var s=t[1],a=t[2];"id_token"===s||"access_token"===s||"code"===s?i[s]=a:i[s]=decodeURIComponent(a.replace(n," "))}return i}var d=n(12),h=n(13),m=n(15),y=n(17),v=m.getHttpCache();e.exports={getWellKnown:u,getKey:c,validateClaims:f,getOAuthUrls:p,loadFrame:s,loadPopup:a,hashToObject:l,isToken:r,addListener:o,removeListener:i}},function(e,t,n){function r(e,t){t=t||{};var n=t.url,r=t.method,o=t.args,i=t.saveAuthnState,l=t.accessToken,d=u.getHttpCache();if(t.cacheResponse){var h=d.getStorage(),m=h[n];if(m&&Date.now()/1e3<m.expiresAt)return c.resolve(m.response)}var y={Accept:"application/json","Content-Type":"application/json","X-Okta-User-Agent-Extended":e.userAgent};s.extend(y,e.options.headers,t.headers),l&&s.isString(l)&&(y.Authorization="Bearer "+l);var v,g,w={headers:y,data:o||void 0};return new c(e.options.ajaxRequest(r,n,w)).then(function(e){return g=e.responseText,g&&s.isString(g)&&(g=JSON.parse(g)),i&&(g.stateToken||a.deleteCookie(p.STATE_TOKEN_COOKIE_NAME)),g&&g.stateToken&&g.expiresAt&&a.setCookie(p.STATE_TOKEN_COOKIE_NAME,g.stateToken,g.expiresAt),g&&t.cacheResponse&&d.updateStorage(n,{expiresAt:Math.floor(Date.now()/1e3)+p.DEFAULT_CACHE_DURATION,response:g}),g}).fail(function(t){var n=t.responseText||{};if(s.isString(n))try{n=JSON.parse(n)}catch(r){n={errorSummary:"Unknown error"}}throw t.status>=500&&(n.errorSummary="Unknown error"),e.options.transformErrorXHR&&(t=e.options.transformErrorXHR(s.clone(t))),v=new f(n,t),"E0000011"===v.errorCode&&a.deleteCookie(p.STATE_TOKEN_COOKIE_NAME),v})}function o(e,t,n){t=s.isAbsoluteUrl(t)?t:e.options.url+t;var o={url:t,method:"GET"};return s.extend(o,n),r(e,o)}function i(e,t,n,o){t=s.isAbsoluteUrl(t)?t:e.options.url+t;var i={url:t,method:"POST",args:n,saveAuthnState:!0};return s.extend(i,o),r(e,i)}var s=n(13),a=n(14),u=n(15),c=n(8),f=n(19),p=n(18);e.exports={get:o,post:i,httpRequest:r}},function(e,t){var n=e.exports;n.base64UrlToBase64=function(e){return e.replace(/\-/g,"+").replace(/_/g,"/")},n.base64UrlToString=function(e){var t=n.base64UrlToBase64(e);switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Not a valid Base64Url"}var r=atob(t);try{return decodeURIComponent(escape(r))}catch(o){return r}},n.stringToBuffer=function(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t},n.base64UrlDecode=function(e){return atob(n.base64UrlToBase64(e))},n.bind=function(e,t){var n=Array.prototype.slice.call(arguments,2);return function(){var r=Array.prototype.slice.call(arguments);return r=n.concat(r),e.apply(t,r)}},n.isAbsoluteUrl=function(e){return/^(?:[a-z]+:)?\/\//i.test(e)},n.isString=function(e){return"[object String]"===Object.prototype.toString.call(e)},n.isObject=function(e){return"[object Object]"===Object.prototype.toString.call(e)},n.isNumber=function(e){return"[object Number]"===Object.prototype.toString.call(e)},n.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},n.isoToUTCString=function(e){var t=e.match(/\d+/g),n=Date.UTC(t[0],t[1]-1,t[2],t[3],t[4],t[5]),r=new Date(n);return r.toUTCString()},n.toQueryParams=function(e){var t=[];if(null!==e)for(var n in e)e.hasOwnProperty(n)&&void 0!==e[n]&&null!==e[n]&&t.push(n+"="+encodeURIComponent(e[n]));return t.length?"?"+t.join("&"):""},n.genRandomString=function(e){for(var t="abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",n="",r=0,o=t.length;r<e;++r)n+=t[Math.floor(Math.random()*o)];return n},n.extend=function(){var e=arguments[0],t=[].slice.call(arguments,1);t.forEach(function(t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})},n.removeNils=function(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];null!==r&&void 0!==r&&(t[n]=r)}return t},n.clone=function(e){if(e){var t=JSON.stringify(e);if(t)return JSON.parse(t)}return e},n.omit=function(e){var t=Array.prototype.slice.call(arguments,1),r={};for(var o in e)e.hasOwnProperty(o)&&t.indexOf(o)==-1&&(r[o]=e[o]);return n.clone(r)},n.find=function(e,t){for(var n=e.length;n--;){var r=e[n],o=!0;for(var i in t)if(t.hasOwnProperty(i)&&r[i]!==t[i]){o=!1;break}if(o)return r}},n.getLink=function(e,t,r){if(e&&e._links){var o=n.clone(e._links[t]);return o&&o.name&&r?o.name===r?o:void 0:o}},n.getNativeConsole=function(){return window.console},n.getConsole=function(){var e=n.getNativeConsole();return e&&e.log?e:{log:function(){}}},n.warn=function(e){n.getConsole().log("[okta-auth-sdk] WARN: "+e)},n.deprecate=function(e){n.getConsole().log("[okta-auth-sdk] DEPRECATION: "+e)},n.deprecateWrap=function(e,t){return function(){return n.deprecate(e),t.apply(null,arguments)}},n.removeTrailingSlash=function(e){if(e)return"/"===e.slice(-1)?e.slice(0,-1):e},n.isIE11OrLess=function(){return!!document.documentMode&&document.documentMode<=11}},function(e,t,n){function r(e,t,n){var o="";n&&(o=" expires="+s.isoToUTCString(n)+";");var i=e+"="+t+"; path=/;"+o;return r._setDocumentCookie(i),i}function o(e){var t=new RegExp(e+"=([^;]*)"),n=o._getDocumentCookie().match(t);if(n){var r=n[1];return r}}function i(e){r(e,"","1970-01-01T00:00:00Z")}var s=n(13);r._setDocumentCookie=function(e){document.cookie=e},o._getDocumentCookie=function(){return document.cookie},e.exports={setCookie:r,getCookie:o,deleteCookie:i}},function(e,t,n){var r=n(14),o=n(16),i=n(18),s={};s.browserHasLocalStorage=function(){try{return!!s.getLocalStorage()}catch(e){return!1}},s.browserHasSessionStorage=function(){try{return!!s.getSessionStorage()}catch(e){return!1}},s.getHttpCache=function(){return s.browserHasLocalStorage()?o(s.getLocalStorage(),i.CACHE_STORAGE_NAME):s.browserHasSessionStorage()?o(s.getSessionStorage(),i.CACHE_STORAGE_NAME):o(s.getCookieStorage(),i.CACHE_STORAGE_NAME)},s.getLocalStorage=function(){return localStorage},s.getSessionStorage=function(){return sessionStorage},s.getCookieStorage=function(){return{getItem:r.getCookie,setItem:function(e,t){r.setCookie(e,t,"2038-01-19T03:14:07.000Z")}}},e.exports=s},function(e,t,n){function r(e,t){function n(){var n=e.getItem(t);n=n||"{}";try{return JSON.parse(n)}catch(r){throw new o("Unable to parse storage string: "+t)}}function r(n){try{var r=JSON.stringify(n);e.setItem(t,r)}catch(i){throw new o("Unable to set storage: "+t)}}function i(e){e||r({});var t=n();delete t[e],r(t)}function s(e,t){var o=n();o[e]=t,r(o)}return{getStorage:n,setStorage:r,clearStorage:i,updateStorage:s}}var o=n(17);e.exports=r},function(e,t){function n(e,t){this.name="AuthSdkError",this.message=e,this.errorCode="INTERNAL",this.errorSummary=e,this.errorLink="INTERNAL",this.errorId="INTERNAL",this.errorCauses=[],t&&(this.xhr=t)}n.prototype=new Error,e.exports=n},function(e,t){e.exports={STATE_TOKEN_COOKIE_NAME:"oktaStateToken",DEFAULT_POLLING_DELAY:500,DEFAULT_MAX_CLOCK_SKEW:300,DEFAULT_CACHE_DURATION:86400,FRAME_ID:"okta-oauth-helper-frame",REDIRECT_OAUTH_PARAMS_COOKIE_NAME:"okta-oauth-redirect-params",REDIRECT_STATE_COOKIE_NAME:"okta-oauth-state",REDIRECT_NONCE_COOKIE_NAME:"okta-oauth-nonce",TOKEN_STORAGE_NAME:"okta-token-storage",CACHE_STORAGE_NAME:"okta-cache-storage",SDK_VERSION:"1.17.1"}},function(e,t){function n(e,t){this.name="AuthApiError",this.message=e.errorSummary,this.errorSummary=e.errorSummary,this.errorCode=e.errorCode,this.errorLink=e.errorLink,this.errorId=e.errorId,this.errorCauses=e.errorCauses,t&&(this.xhr=t)}n.prototype=new Error,e.exports=n},function(e,t,n){function r(e,t){var n={};return m.extend(n,t),!n.stateToken&&e.stateToken&&(n.stateToken=e.stateToken),n}function o(e){return r(e)}function i(e,t){return t=r(e,t),h.post(e,e.options.url+"/api/v1/authn",t)}function s(e,t){if(!t||!t.stateToken){var n=e.tx.exists._getCookie(w.STATE_TOKEN_COOKIE_NAME);if(!n)return y.reject(new v("No transaction to resume"));t={stateToken:n}}return e.tx.status(t).then(function(t){return new d(e,t)})}function a(e){return!!e.tx.exists._getCookie(w.STATE_TOKEN_COOKIE_NAME)}function u(e,t,n,r){return h.post(e,t,n,r).then(function(t){return new d(e,t)})}function c(e,t,n){return function(r){function i(){var n={};if("function"==typeof u)try{n.autoPush=!!u()}catch(r){return y.reject(new v("AutoPush resulted in an error."))}else void 0!==u&&null!==u&&(n.autoPush=!!u);if("function"==typeof a)try{n.rememberDevice=!!a()}catch(r){return y.reject(new v("RememberDevice resulted in an error."))}else void 0!==a&&null!==a&&(n.rememberDevice=!!a);var i=c.href+m.toQueryParams(n);return h.post(e,i,o(t),{saveAuthnState:!1})}var s,a,u;m.isNumber(r)?s=r:m.isObject(r)&&(s=r.delay,a=r.rememberDevice,u=r.autoPush),s||0===s||(s=w.DEFAULT_POLLING_DELAY);var c=m.getLink(t,"next","poll");n.isPolling=!0;var f=0,p=function(){return n.isPolling?i().then(function(t){if(f=0,t.factorResult&&"WAITING"===t.factorResult){if(!n.isPolling)throw new g;return y.delay(s).then(p)}return n.isPolling=!1,new d(e,t)}).fail(function(e){if(e.xhr&&(0===e.xhr.status||429===e.xhr.status)&&f<=4){var t=1e3*Math.pow(2,f);return f++,y.delay(t).then(p)}throw e}):y.reject(new g)};return p().fail(function(e){throw n.isPolling=!1,e})}}function f(e,t,n,o,i){if(Array.isArray(o))return function(r,s){if(!r)throw new v("Must provide a link name");var a=m.find(o,{name:r});if(!a)throw new v("No link found for that name");return f(e,t,n,a,i)(s)};if(o.hints&&o.hints.allow&&1===o.hints.allow.length){var s=o.hints.allow[0];switch(s){case"GET":return function(){return h.get(e,o.href)};case"POST":return function(s){i&&i.isPolling&&(i.isPolling=!1);var a=r(t,s);"MFA_ENROLL"!==t.status&&"FACTOR_ENROLL"!==t.status||m.extend(a,{factorType:n.factorType,provider:n.provider});var c={},f=a.autoPush;if(void 0!==f){if("function"==typeof f)try{c.autoPush=!!f()}catch(p){return y.reject(new v("AutoPush resulted in an error."))}else null!==f&&(c.autoPush=!!f);a=m.omit(a,"autoPush")}var l=a.rememberDevice;if(void 0!==l){if("function"==typeof l)try{c.rememberDevice=!!l()}catch(p){return y.reject(new v("RememberDevice resulted in an error."))}else null!==l&&(c.rememberDevice=!!l);a=m.omit(a,"rememberDevice")}else a.profile&&void 0!==a.profile.updatePhone&&(a.profile.updatePhone&&(c.updatePhone=!0),a.profile=m.omit(a.profile,"updatePhone"));var d=o.href+m.toQueryParams(c);return u(e,d,a)}}}}function p(e,t,n,r){var o={};for(var i in n._links)if(n._links.hasOwnProperty(i)){var s=n._links[i];if("next"===i&&(i=s.name),s.type)o[i]=s;else switch(i){case"poll":o.poll=c(e,t,r);break;default:var a=f(e,t,n,s,r);a&&(o[i]=a)}}return o}function l(e,t,n,r){if(n=n||t,n=m.clone(n),Array.isArray(n)){for(var o=[],i=0,s=n.length;i<s;i++)o.push(l(e,t,n[i],r));return o}var a=n._embedded||{};for(var u in a)a.hasOwnProperty(u)&&(m.isObject(a[u])||Array.isArray(a[u]))&&(a[u]=l(e,t,a[u],r));var c=p(e,t,n,r);return m.extend(a,c),n=m.omit(n,"_embedded","_links"),m.extend(n,a),n}function d(e,t){t&&(this.data=t,m.extend(this,l(e,t,t,{})),delete this.stateToken,"RECOVERY_CHALLENGE"!==t.status||t._links||(this.cancel=function(){return new y(new d(e))}))}var h=n(12),m=n(13),y=n(8),v=n(17),g=n(21),w=n(18);e.exports={transactionStatus:i,resumeTransaction:s,transactionExists:a,postToTransaction:u}},function(e,t){function n(){this.name="AuthPollStopError",this.message="The poll was stopped by the sdk"}n.prototype=new Error,e.exports=n},function(e,t,n){function r(e){ | ||
return e.session.get().then(function(e){return"ACTIVE"===e.status}).fail(function(){return!1})}function o(e){return c.get(e,"/api/v1/sessions/me").then(function(t){var n=u.omit(t,"_links");return n.refresh=function(){return c.post(e,u.getLink(t,"refresh").href)},n.user=function(){return c.get(e,u.getLink(t,"user").href)},n}).fail(function(){return{status:"INACTIVE"}})}function i(e){return c.httpRequest(e,{url:e.options.url+"/api/v1/sessions/me",method:"DELETE"})}function s(e){return c.post(e,"/api/v1/sessions/me/lifecycle/refresh")}function a(e,t,n){n=n||window.location.href,window.location=e.options.url+"/login/sessionCookieRedirect"+u.toQueryParams({checkAccountSetupComplete:!0,token:t,redirectUrl:n})}var u=n(13),c=n(12);e.exports={sessionExists:r,getSession:o,closeSession:i,refreshSession:s,setCookieAndRedirect:a}},function(e,t,n){function r(e){var t,n=e.split(".");try{t={header:JSON.parse(_.base64UrlToString(n[0])),payload:JSON.parse(_.base64UrlToString(n[1])),signature:n[2]}}catch(r){throw new E("Malformed token")}return t}function o(e,t,n){function r(e){var t;if(t=n.expirationTime||0===n.expirationTime?n.expirationTime:Math.floor(Date.now()/1e3),e&&e>t)return!0}function o(e){if(!n.audience)return!0;for(var t=Array.isArray(n.audience)?n.audience:[n.audience],r=Array.isArray(e)?e:[e],o=t.length;o--;){var i=t[o];if(r.indexOf(i)!==-1)return!0}}return n=n||{},e.features.isTokenVerifySupported()?A.getWellKnown(e).then(function(t){return k.get(e,t.jwks_uri)}).then(function(e){var n=e.keys[0];return b.verifyToken(t,n)}).then(function(i){if(!i)return!1;var s=e.token.decode(t);return!r(s.payload.exp)&&(!!o(s.payload.aud)&&(!n.issuer||n.issuer===s.payload.iss))}):x.reject(new E("This browser doesn't support crypto.subtle"))}function i(e,t,n,o){return(new x).then(function(){if(!t||!t.idToken)throw new E("Only idTokens may be verified");var i=r(t.idToken);return A.validateClaims(e,i.payload,t.clientId,t.issuer,n),o||!e.features.isTokenVerifySupported()?t:A.getKey(e,t.issuer,i.header.kid).then(function(e){return b.verifyToken(t.idToken,e)}).then(function(e){if(!e)throw new E("The token signature is not valid");return t})})}function s(e,t){return t=t||{},t.display=null,t.prompt="none",d(e,t)}function a(e,t,n){function r(t){!t.data||t.origin!==e.options.url||t.data&&_.isString(n)&&t.data.state!==n||o.resolve(t.data)}var o=x.defer();return A.addListener(window,"message",r),o.promise.timeout(t||12e4,new E("OAuth flow timed out")).fin(function(){A.removeListener(window,"message",r)})}function u(e,t,n){function r(){try{t&&t.location&&t.location.hash?o.resolve(A.hashToObject(t.location.hash)):t&&!t.closed&&setTimeout(r,500)}catch(e){setTimeout(r,500)}}var o=x.defer();return r(),o.promise.timeout(n||12e4,new E("OAuth flow timed out"))}function c(e,t,n,r){r=r||{};var o=t.responseType,s=_.clone(t.scopes),a=t.clientId||e.options.clientId;return(new x).then(function(){if(n.error||n.error_description)throw new S(n.error,n.error_description);if(n.state!==t.state)throw new E("OAuth flow response state doesn't match request state");var o={};if(n.access_token&&(o.token={accessToken:n.access_token,expiresAt:Number(n.expires_in)+Math.floor(Date.now()/1e3),tokenType:n.token_type,scopes:s,authorizeUrl:r.authorizeUrl,userinfoUrl:r.userinfoUrl}),n.code&&(o.code={authorizationCode:n.code}),n.id_token){var u=e.token.decode(n.id_token),c={idToken:n.id_token,claims:u.payload,expiresAt:u.payload.exp,scopes:s,authorizeUrl:r.authorizeUrl,issuer:r.issuer,clientId:a};return i(e,c,t.nonce,!0).then(function(){return o.id_token=c,o})}return o}).then(function(e){if(!Array.isArray(o))return e[o];if(!e.token&&!e.id_token)throw new E("Unable to parse OAuth flow response");return o.map(function(t){return e[t]})})}function f(e,t){t=_.clone(t)||{},t.scope&&(_.deprecate('The param "scope" is equivalent to "scopes". Use "scopes" instead.'),t.scopes=t.scope,delete t.scope);var n={clientId:e.options.clientId,redirectUri:e.options.redirectUri||window.location.href,responseType:"id_token",responseMode:"okta_post_message",state:_.genRandomString(64),nonce:_.genRandomString(64),scopes:["openid","email"]};return _.extend(n,t),n}function p(e){if(!e.clientId)throw new E("A clientId must be specified in the OktaAuth constructor to get a token");if(_.isString(e.responseType)&&e.responseType.indexOf(" ")!==-1)throw new E("Multiple OAuth responseTypes must be defined as an array");var t=_.removeNils({client_id:e.clientId,redirect_uri:e.redirectUri,response_type:e.responseType,response_mode:e.responseMode,state:e.state,nonce:e.nonce,prompt:e.prompt,display:e.display,sessionToken:e.sessionToken,idp:e.idp,max_age:e.maxAge});if(Array.isArray(t.response_type)&&(t.response_type=t.response_type.join(" ")),e.responseType.indexOf("id_token")!==-1&&e.scopes.indexOf("openid")===-1)throw new E("openid scope must be specified in the scopes argument when requesting an id_token");return t.scope=e.scopes.join(" "),t}function l(e){var t=p(e);return _.toQueryParams(t)}function d(e,t,n){function r(e){var t=/^(https?\:\/\/)?([^:\/?#]*(?:\:[0-9]+)?)/;return t.exec(e)[0]}function o(e){e.closed&&O.reject(new E("Unable to parse OAuth flow response"))}t=t||{},n=n||{};var i=f(e,t),s={prompt:"none",responseMode:"okta_post_message",display:null},p={display:"popup"};t.sessionToken?_.extend(i,s):t.idp&&_.extend(i,p);var d,h;try{h=A.getOAuthUrls(e,i,n),d=h.authorizeUrl+l(i)}catch(m){return x.reject(m)}var y;switch(y=i.sessionToken||null===i.display?"IFRAME":"popup"===i.display?"POPUP":"IMPLICIT"){case"IFRAME":var v=a(e,n.timeout,i.state),g=A.loadFrame(d);return v.then(function(t){return c(e,i,t,h)}).fin(function(){document.body.contains(g)&&g.parentElement.removeChild(g)});case"POPUP":var w;if("okta_post_message"===i.responseMode){if(!e.features.isPopupPostMessageSupported())return x.reject(new E("This browser doesn't have full postMessage support"));w=a(e,n.timeout,i.state)}var T={popupTitle:n.popupTitle},k=A.loadPopup(d,T);if("fragment"===i.responseMode){var b=r(e.idToken.authorize._getLocationHref()),S=r(i.redirectUri);if(b!==S)return x.reject(new E("Using fragment, the redirectUri origin ("+S+") must match the origin of this page ("+b+")"));w=u(e,k,n.timeout)}var O=x.defer(),C=setInterval(function(){o(k)},500);return w.then(function(e){O.resolve(e)}).fail(function(e){O.reject(e)}),O.promise.then(function(t){return c(e,i,t,h)}).fin(function(){k.closed||(clearInterval(C),k.close())});default:return x.reject(new E("The full page redirect flow is not supported"))}}function h(e,t,n){var r=_.clone(t)||{};return _.extend(r,{prompt:"none",responseMode:"okta_post_message",display:null}),d(e,r,n)}function m(e,t,n){var r=_.clone(t)||{};return _.extend(r,{display:"popup"}),d(e,r,n)}function y(e,t,n){t=_.clone(t)||{};var r=f(e,t);if(!t.responseMode){var o=r.responseType;o.indexOf("code")!==-1&&(_.isString(o)||Array.isArray(o)&&1===o.length)?_.extend(r,{responseMode:"query"}):_.extend(r,{responseMode:"fragment"})}var i=A.getOAuthUrls(e,r,n),s=i.authorizeUrl+l(r);C.setCookie(O.REDIRECT_OAUTH_PARAMS_COOKIE_NAME,JSON.stringify({responseType:r.responseType,state:r.state,nonce:r.nonce,scopes:r.scopes,urls:i})),C.setCookie(O.REDIRECT_NONCE_COOKIE_NAME,r.nonce),C.setCookie(O.REDIRECT_STATE_COOKIE_NAME,r.state),e.token.getWithRedirect._setLocation(s)}function v(e,t){if(!A.isToken(t))return x.reject(new E("Refresh must be passed a token with an array of scopes and an accessToken or idToken"));var n;return n=t.accessToken?"token":"id_token",e.token.getWithoutPrompt({responseType:n,scopes:t.scopes},{authorizeUrl:t.authorizeUrl,userinfoUrl:t.userinfoUrl,issuer:t.issuer})}function g(e){var t=e.token.parseFromUrl._getHistory(),n=e.token.parseFromUrl._getDocument(),r=e.token.parseFromUrl._getLocation();t&&t.replaceState?t.replaceState(null,n.title,r.pathname+r.search):r.hash=""}function w(e,t){var n=e.token.parseFromUrl._getLocation(),r=n.hash;t&&(r=t.substring(t.indexOf("#")));var o=C.getCookie(O.REDIRECT_OAUTH_PARAMS_COOKIE_NAME);if(!r||!o)return x.reject(new E("Unable to parse a token from the url"));try{var i=JSON.parse(o),s=i.urls;delete i.urls,C.deleteCookie(O.REDIRECT_OAUTH_PARAMS_COOKIE_NAME)}catch(a){return x.reject(new E("Unable to parse the "+O.REDIRECT_OAUTH_PARAMS_COOKIE_NAME+" cookie: "+a.message))}return x.resolve(A.hashToObject(r)).then(function(n){return t||g(e),c(e,i,n,s)})}function T(e,t){return t&&(A.isToken(t)||t.accessToken||t.userinfoUrl)?k.httpRequest(e,{url:t.userinfoUrl,method:"GET",accessToken:t.accessToken}).fail(function(e){if(e.xhr&&(401===e.xhr.status||403===e.xhr.status)){var t=e.xhr.getResponseHeader("WWW-Authenticate");if(t){var n=t.match(/error="(.*?)"/)||[],r=t.match(/error_description="(.*?)"/)||[],o=n[1],i=r[1];o&&i&&(e=new S(o,i))}}throw e}):x.reject(new E("getUserInfo requires an access token object"))}var k=n(12),_=n(13),A=n(11),x=n(8),b=n(24),E=n(17),S=n(25),O=n(18),C=n(14);e.exports={getToken:d,getWithoutPrompt:h,getWithPopup:m,getWithRedirect:y,parseFromUrl:w,refreshIdToken:s,decodeToken:r,verifyIdToken:o,refreshToken:v,getUserInfo:T,verifyToken:i}},function(e,t,n){function r(e,t){t=o.clone(t);var n="jwk",r={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},i=!0,s=["verify"];return delete t.use,crypto.subtle.importKey(n,t,r,i,s).then(function(t){var n=e.split("."),i=o.stringToBuffer(n[0]+"."+n[1]),s=o.base64UrlDecode(n[2]),a=o.stringToBuffer(s);return crypto.subtle.verify(r,t,a,i)})}var o=n(13);e.exports={verifyToken:r}},function(e,t){function n(e,t){this.name="OAuthError",this.message=t,this.errorCode=e,this.errorSummary=t}n.prototype=new Error,e.exports=n},function(e,t,n){function r(e,t,n){e.emitter.emit("expired",t,n)}function o(e,t){clearTimeout(e.refreshTimeouts[t]),delete e.refreshTimeouts[t]}function i(e){var t=e.refreshTimeouts;for(var n in t)t.hasOwnProperty(n)&&o(e,n);e.refreshTimeouts={}}function s(e,t,n,i,s){var a=1e3*s.expiresAt-Date.now();a<0&&(a=0);var u=setTimeout(function(){return t.autoRefresh?p(e,t,n,i):void(1e3*s.expiresAt<=Date.now()&&(f(t,n,i),r(t,i,s)))},a);o(t,i),t.refreshTimeouts[i]=u}function a(e,t,n){try{var r=n.getStorage()}catch(o){return void t.emitter.emit("error",o)}for(var i in r)if(r.hasOwnProperty(i)){var a=r[i];s(e,t,n,i,a)}}function u(e,t,n,r,o){var i=n.getStorage();if(!h.isObject(o)||!o.scopes||!o.expiresAt&&0!==o.expiresAt||!o.idToken&&!o.accessToken)throw new m("Token must be an Object with scopes, expiresAt, and an idToken or accessToken properties");i[r]=o,n.setStorage(i),s(e,t,n,r,o)}function c(e,t){var n=e.getStorage();return n[t]}function f(e,t,n){o(e,n);var r=t.getStorage();delete r[n],t.setStorage(r)}function p(e,t,n,i){try{var s=c(n,i);if(!s)throw new m("The tokenManager has no token for the key: "+i)}catch(a){return v.reject(a)}return o(t,i),e.token.refresh(s).then(function(r){return u(e,t,n,i,r),t.emitter.emit("refreshed",i,r,s),r}).fail(function(e){throw"OAuthError"===e.name&&(f(t,n,i),r(t,i,s)),e})}function l(e,t){i(e),t.clearStorage()}function d(e,t){t=t||{},t.storage=t.storage||"localStorage",t.autoRefresh||t.autoRefresh===!1||(t.autoRefresh=!0),"localStorage"!==t.storage||y.browserHasLocalStorage()||(h.warn("This browser doesn't support localStorage. Switching to sessionStorage."),t.storage="sessionStorage"),"sessionStorage"!==t.storage||y.browserHasSessionStorage()||(h.warn("This browser doesn't support sessionStorage. Switching to cookie-based storage."),t.storage="cookie");var n;switch(t.storage){case"localStorage":n=T(localStorage,w.TOKEN_STORAGE_NAME);break;case"sessionStorage":n=T(sessionStorage,w.TOKEN_STORAGE_NAME);break;case"cookie":n=T(y.getCookieStorage(),w.TOKEN_STORAGE_NAME);break;default:throw new m("Unrecognized storage option")}var r={emitter:new g,autoRefresh:t.autoRefresh,refreshTimeouts:{}};this.add=h.bind(u,this,e,r,n),this.get=h.bind(c,this,n),this.remove=h.bind(f,this,r,n),this.clear=h.bind(l,this,r,n),this.refresh=h.bind(p,this,e,r,n),this.on=h.bind(r.emitter.on,r.emitter),this.off=h.bind(r.emitter.off,r.emitter),a(e,r,n)}var h=n(13),m=n(17),y=n(15),v=n(8),g=n(27),w=n(18),T=n(16);e.exports=d},function(e,t){function n(){}n.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){function r(){o.off(e,r),t.apply(n,arguments)}var o=this;return r._=t,this.on(e,r,n)},emit:function(e){var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;for(r;r<o;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],o=[];if(r&&t)for(var i=0,s=r.length;i<s;i++)r[i].fn!==t&&r[i].fn._!==t&&o.push(r[i]);return o.length?n[e]=o:delete n[e],this}},e.exports=n}])}); | ||
//# sourceMappingURL=okta-auth-js.min.js.map |
@@ -12,3 +12,3 @@ module.exports = { | ||
"CACHE_STORAGE_NAME": "okta-cache-storage", | ||
"SDK_VERSION": "1.16.0" | ||
"SDK_VERSION": "1.17.1" | ||
}; |
@@ -197,3 +197,3 @@ /* eslint-disable complexity, max-statements */ | ||
if (res.status === 'MFA_ENROLL') { | ||
if (res.status === 'MFA_ENROLL' || res.status === 'FACTOR_ENROLL') { | ||
// Add factorType and provider | ||
@@ -200,0 +200,0 @@ util.extend(data, { |
{ | ||
"name": "@okta/okta-auth-js", | ||
"description": "The Okta Auth SDK", | ||
"version": "1.17.0", | ||
"version": "1.17.1", | ||
"homepage": "https://github.com/okta/okta-auth-js", | ||
@@ -66,5 +66,5 @@ "license": "Apache-2.0", | ||
"okta": { | ||
"commitSha": "f872b346a13badfad795cab104a2716f17938977", | ||
"fullVersion": "1.17.0-20180427163300-f872b34" | ||
"commitSha": "770b1e9e68df49d015574e4c7e032a6145ef8fb4", | ||
"fullVersion": "1.17.1-20190326225933-770b1e9" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
792967