Socket
Socket
Sign inDemoInstall

@quintype/bridgekeeper-js

Package Overview
Dependencies
53
Maintainers
27
Versions
128
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.8.2-feature-otp.0 to 2.8.2-feature-otp.1

2

dist/index.js

@@ -1,1 +0,1 @@

module.exports=function(t){var r={};function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var o in t)e.d(n,o,function(r){return t[r]}.bind(null,o));return n},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},e.p="",e(e.s=3)}([function(t,r,e){t.exports=e(2)},function(t,r){function e(t,r,e,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void e(t)}u.done?r(c):Promise.resolve(c).then(n,o)}t.exports=function(t){return function(){var r=this,n=arguments;return new Promise((function(o,i){var a=t.apply(r,n);function u(t){e(a,o,i,u,c,"next",t)}function c(t){e(a,o,i,u,c,"throw",t)}u(void 0)}))}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,r,e){var n=function(t){"use strict";var r=Object.prototype,e=r.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function u(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{u({},"")}catch(t){u=function(t,r,e){return t[r]=e}}function c(t,r,e,n){var o=r&&r.prototype instanceof l?r:l,i=Object.create(o.prototype),a=new j(n||[]);return i._invoke=function(t,r,e){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return T()}for(e.method=o,e.arg=i;;){var a=e.delegate;if(a){var u=w(a,e);if(u){if(u===f)continue;return u}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===n)throw n="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n="executing";var c=s(t,r,e);if("normal"===c.type){if(n=e.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:e.done}}"throw"===c.type&&(n="completed",e.method="throw",e.arg=c.arg)}}}(t,e,a),i}function s(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function l(){}function p(){}function h(){}var d={};d[o]=function(){return this};var v=Object.getPrototypeOf,y=v&&v(v(O([])));y&&y!==r&&e.call(y,o)&&(d=y);var g=h.prototype=l.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(r){u(t,r,(function(t){return this._invoke(r,t)}))}))}function b(t,r){var n;this._invoke=function(o,i){function a(){return new r((function(n,a){!function n(o,i,a,u){var c=s(t[o],t,i);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==typeof l&&e.call(l,"__await")?r.resolve(l.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):r.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function w(t,r){var e=t.iterator[r.method];if(void 0===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=void 0,w(t,r),"throw"===r.method))return f;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=s(e,t.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,f;var o=n.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,f):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,f)}function _(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function x(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function O(t){if(t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function r(){for(;++n<t.length;)if(e.call(t,n))return r.value=t[n],r.done=!1,r;return r.value=void 0,r.done=!0,r};return i.next=i}}return{next:T}}function T(){return{value:void 0,done:!0}}return p.prototype=g.constructor=h,h.constructor=p,p.displayName=u(h,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===p||"GeneratorFunction"===(r.displayName||r.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,u(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(b.prototype),b.prototype[i]=function(){return this},t.AsyncIterator=b,t.async=function(r,e,n,o,i){void 0===i&&(i=Promise);var a=new b(c(r,e,n,o),i);return t.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),u(g,a,"Generator"),g[o]=function(){return this},g.toString=function(){return"[object Generator]"},t.keys=function(t){var r=[];for(var e in t)r.push(e);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=O,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&e.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(e,n){return a.type="throw",a.arg=t,r.next=e,n&&(r.method="next",r.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=e.call(i,"catchLoc"),c=e.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,r){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&e.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),f},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),x(e),f}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;x(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,e){return this.delegate={iterator:O(t),resultName:r,nextLoc:e},"next"===this.method&&(this.arg=void 0),f}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,r,e){"use strict";e.r(r),e.d(r,"currentUser",(function(){return c})),e.d(r,"forgotPassword",(function(){return y})),e.d(r,"getAutoSSOUrl",(function(){return _})),e.d(r,"getOauthAuthorizeUrl",(function(){return x})),e.d(r,"login",(function(){return p})),e.d(r,"logout",(function(){return u})),e.d(r,"oauthAuthorize",(function(){return w})),e.d(r,"register",(function(){return s})),e.d(r,"resetPassword",(function(){return m})),e.d(r,"resetPasswordWithToken",(function(){return g})),e.d(r,"sendOtp",(function(){return f})),e.d(r,"sendVerificationLink",(function(){return b})),e.d(r,"signImage",(function(){return d})),e.d(r,"updateUserProfile",(function(){return h})),e.d(r,"updateWithOtp",(function(){return l})),e.d(r,"uploadS3ToTemp",(function(){return v})),e.d(r,"withAppleLogin",(function(){return G})),e.d(r,"withFacebookLogin",(function(){return J})),e.d(r,"withGoogleLogin",(function(){return Y})),e.d(r,"withLinkedinLogin",(function(){return Q}));var n=e(1),o=e.n(n),i=e(0),a=e.n(i),u=function(){var t=o()(a.a.mark((function t(){return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch("/api/auth/v1/logout");case 3:return t.abrupt("return",t.sent);case 6:return t.prev=6,t.t0=t.catch(0),t.next=10,Promise.reject(t.t0);case 10:return t.abrupt("return",t.sent);case 11:case"end":return t.stop()}}),t,null,[[0,6]])})));return function(){return t.apply(this,arguments)}}(),c=function(){var t=o()(a.a.mark((function t(){var r,e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch("/api/auth/v1/users/me");case 3:return r=t.sent,t.next=6,r.json();case 6:return e=t.sent,t.abrupt("return",e);case 10:return t.prev=10,t.t0=t.catch(0),t.next=14,Promise.reject(t.t0);case 14:return t.abrupt("return",t.sent);case 15:case"end":return t.stop()}}),t,null,[[0,10]])})));return function(){return t.apply(this,arguments)}}(),s=function(){var t=o()(a.a.mark((function t(r){var e,n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch("/api/auth/v1/signup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r),credentials:"same-origin"});case 3:return e=t.sent,t.next=6,e.json();case 6:return n=t.sent,t.next=9,Promise.resolve(n);case 9:return t.abrupt("return",t.sent);case 12:return t.prev=12,t.t0=t.catch(0),t.next=16,Promise.reject(t.t0);case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t,null,[[0,12]])})));return function(r){return t.apply(this,arguments)}}(),f=function(){var t=o()(a.a.mark((function t(r){var e,n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch("/api/auth/v1/users/send-otp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r),credentials:"same-origin"});case 3:return e=t.sent,t.next=6,e.json();case 6:return n=t.sent,t.next=9,Promise.resolve(n);case 9:return t.abrupt("return",t.sent);case 12:return t.prev=12,t.t0=t.catch(0),t.next=16,Promise.reject(t.t0);case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t,null,[[0,12]])})));return function(r){return t.apply(this,arguments)}}(),l=function(){var t=o()(a.a.mark((function t(r){var e;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e={"verification-status":"email"},t.next=4,fetch("/api/auth/v1/users/update-with-otp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({otp:"".concat(r),user:e}),credentials:"same-origin"});case 4:return t.abrupt("return",t.sent);case 7:return t.prev=7,t.t0=t.catch(0),t.next=11,Promise.reject(t.t0);case 11:return t.abrupt("return",t.sent);case 12:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(r){return t.apply(this,arguments)}}(),p=function(t){return new Promise((function(r,e){fetch("/api/auth/v1/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),credentials:"same-origin"}).then((function(t){return t.json()})).then((function(t){return r(t)})).catch((function(t){return e(t)}))}))},h=function(){var t=o()(a.a.mark((function t(r){var e,n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch("/api/auth/v1/users/profile",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r),credentials:"same-origin"});case 3:return e=t.sent,t.next=6,e.json();case 6:return n=t.sent,t.next=9,Promise.resolve(n);case 9:return t.abrupt("return",t.sent);case 12:return t.prev=12,t.t0=t.catch(0),t.next=16,Promise.reject(t.t0);case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t,null,[[0,12]])})));return function(r){return t.apply(this,arguments)}}(),d=function(t,r){var e="/api/sign?file-name=".concat(t,"&mime-type=").concat(r);return fetch(e).then((function(t){return t.json()}))},v=function(){var t=o()(a.a.mark((function t(r,e){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n={method:"POST",body:e,redirect:"follow"},t.abrupt("return",fetch(r,n).then((function(t){return t})).catch((function(t){return console.error(t)})));case 2:case"end":return t.stop()}}),t)})));return function(r,e){return t.apply(this,arguments)}}(),y=function(t){return new Promise((function(r,e){fetch("/api/auth/v1/users/forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),credentials:"same-origin"}).then((function(t){return t.json()})).then((function(t){return r(t)})).catch((function(t){return e(t)}))}))},g=function(t){return new Promise((function(r,e){fetch("/api/auth/v1/users/reset-password-with-token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),credentials:"same-origin"}).then((function(t){return t.json()})).then((function(t){return r(t)})).catch((function(t){return e(t)}))}))},m=function(t){return new Promise((function(r,e){fetch("/api/auth/v1/users/reset-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),credentials:"same-origin"}).then((function(t){return t.json()})).then((function(t){return r(t)})).catch((function(t){return e(t)}))}))},b=function(){var t=o()(a.a.mark((function t(r,e){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch("/api/auth/v1/users/send-verification-link",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:r,"redirect-url":e}),credentials:"same-origin"});case 3:return n=t.sent,t.next=6,n.json();case 6:return t.abrupt("return",t.sent);case 9:return t.prev=9,t.t0=t.catch(0),t.abrupt("return",t.t0);case 12:case"end":return t.stop()}}),t,null,[[0,9]])})));return function(r,e){return t.apply(this,arguments)}}(),w=function(){var t=o()(a.a.mark((function t(r,e,n){var o,i,u=arguments;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=u.length>3&&void 0!==u[3]&&u[3],t.prev=1,t.next=4,fetch("/api/auth/v1/oauth/authorize?client_id=".concat(r,"&redirect_uri=").concat(e,"&callback_uri=").concat(n,"&response_type=code&allow_ajax=").concat(o));case 4:return i=t.sent,t.next=7,i.json();case 7:return t.abrupt("return",t.sent);case 10:return t.prev=10,t.t0=t.catch(1),t.abrupt("return",t.t0);case 13:case"end":return t.stop()}}),t,null,[[1,10]])})));return function(r,e,n){return t.apply(this,arguments)}}(),_=function(t,r,e){try{var n=e.replace("?logged_in=false","");return"/api/auth/v1/oauth/auto-sso/authorize?client_id=".concat(t,"&redirect_uri=").concat(r,"&callback_uri=").concat(n,"&response_type=code")}catch(t){return t}},x=function(t,r,e){try{var n=e.replace("?logged_in=false","");return"/api/auth/v1/oauth/authorize?client_id=".concat(t,"&redirect_uri=").concat(r,"&callback_uri=").concat(n,"&response_type=code")}catch(t){return t}},j=function(){return(j=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},O=function(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;var n=Array(t),o=0;for(r=0;r<e;r++)for(var i=arguments[r],a=0,u=i.length;a<u;a++,o++)n[o]=i[a];return n},T=function(t,r,e){if(void 0===e&&(e=!1),!t||!r||"object"!=typeof t||"object"!=typeof r)return t;var n=j({},t);for(var o in r)r.hasOwnProperty(o)&&(r[o]instanceof Array&&t[o]instanceof Array?n[o]=e?O(t[o],r[o]):r[o]:"object"==typeof r[o]&&"object"==typeof t[o]?n[o]=T(t[o],r[o],e):n[o]=r[o]);return n},P=function(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;var n=Array(t),o=0;for(r=0;r<e;r++)for(var i=arguments[r],a=0,u=i.length;a<u;a++,o++)n[o]=i[a];return n},E={defaults:{},errorType:null,polyfills:{fetch:null,FormData:null,URLSearchParams:null,performance:null,PerformanceObserver:null,AbortController:null},polyfill:function(t,r){for(var e=void 0===r?{}:r,n=e.doThrow,o=void 0===n||n,i=e.instance,a=void 0!==i&&i,u=[],c=2;c<arguments.length;c++)u[c-2]=arguments[c];var s=this.polyfills[t]||("undefined"!=typeof self?self[t]:null)||("undefined"!=typeof global?global[t]:null);if(o&&!s)throw new Error(t+" is not defined");return a&&s?new(s.bind.apply(s,P([void 0],u))):s}},L=function(t,r,e,n){if(!t.getEntriesByName)return!1;var o=t.getEntriesByName(r);return!!(o&&o.length>0)&&(e(o.reverse()[0]),n.clearMeasures&&n.clearMeasures(r),k.callbacks.delete(r),k.callbacks.size<1&&(k.observer.disconnect(),n.clearResourceTimings&&n.clearResourceTimings()),!0)},k={callbacks:new Map,observer:null,observe:function(t,r){if(t&&r){var e=E.polyfill("performance",{doThrow:!1});(function(t,r){return!k.observer&&t&&r&&(k.observer=new r((function(r){k.callbacks.forEach((function(e,n){L(r,n,e,t)}))})),t.clearResourceTimings&&t.clearResourceTimings()),k.observer})(e,E.polyfill("PerformanceObserver",{doThrow:!1}))&&(L(e,t,r,e)||(k.callbacks.size<1&&k.observer.observe({entryTypes:["resource","measure"]}),k.callbacks.set(t,r)))}}},N=k,S=function(t){this.error=t},A=function(){return(A=Object.assign||function(t){for(var r,e=1,n=arguments.length;e<n;e++)for(var o in r=arguments[e])Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return t}).apply(this,arguments)},C=function(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;var n=Array(t),o=0;for(r=0;r<e;r++)for(var i=arguments[r],a=0,u=i.length;a<u;a++,o++)n[o]=i[a];return n},F=function(){function t(t,r,e,n,o,i){void 0===e&&(e=new Map),void 0===n&&(n=[]),void 0===o&&(o=[]),void 0===i&&(i=[]),this._url=t,this._options=r,this._catchers=e,this._resolvers=n,this._middlewares=o,this._deferredChain=i}return t.factory=function(r,e){return void 0===r&&(r=""),void 0===e&&(e={}),new t(r,e)},t.prototype.selfFactory=function(r){var e=void 0===r?{}:r,n=e.url,o=void 0===n?this._url:n,i=e.options,a=void 0===i?this._options:i,u=e.catchers,c=void 0===u?this._catchers:u,s=e.resolvers,f=void 0===s?this._resolvers:s,l=e.middlewares,p=void 0===l?this._middlewares:l,h=e.deferredChain,d=void 0===h?this._deferredChain:h;return new t(o,A({},a),new Map(c),C(f),C(p),C(d))},t.prototype.defaults=function(t,r){return void 0===r&&(r=!1),E.defaults=r?T(E.defaults,t):t,this},t.prototype.errorType=function(t){return E.errorType=t,this},t.prototype.polyfills=function(t){return E.polyfills=A(A({},E.polyfills),t),this},t.prototype.url=function(t,r){if(void 0===r&&(r=!1),r)return this.selfFactory({url:t});var e=this._url.split("?");return this.selfFactory({url:e.length>1?e[0]+t+"?"+e[1]:this._url+t})},t.prototype.options=function(t,r){return void 0===r&&(r=!0),this.selfFactory({options:r?T(this._options,t):t})},t.prototype.query=function(t,r){return void 0===r&&(r=!1),this.selfFactory({url:I(this._url,t,r)})},t.prototype.headers=function(t){return this.selfFactory({options:T(this._options,{headers:t||{}})})},t.prototype.accept=function(t){return this.headers({Accept:t})},t.prototype.content=function(t){var r;return this.headers(((r={})["Content-Type"]=t,r))},t.prototype.auth=function(t){return this.headers({Authorization:t})},t.prototype.catcher=function(t,r){var e=new Map(this._catchers);return e.set(t,r),this.selfFactory({catchers:e})},t.prototype.signal=function(t){return this.selfFactory({options:A(A({},this._options),{signal:t.signal})})},t.prototype.resolve=function(t,r){return void 0===r&&(r=!1),this.selfFactory({resolvers:r?[t]:C(this._resolvers,[t])})},t.prototype.defer=function(t,r){return void 0===r&&(r=!1),this.selfFactory({deferredChain:r?[t]:C(this._deferredChain,[t])})},t.prototype.middlewares=function(t,r){return void 0===r&&(r=!1),this.selfFactory({middlewares:r?t:C(this._middlewares,t)})},t.prototype.method=function(t,r,e){void 0===r&&(r={}),void 0===e&&(e=null);var n=this._options.headers,o=e?"object"!=typeof e||n&&!Object.entries(n).every((function(t){var r=t[0],e=t[1];return r.toLowerCase()!=="Content-Type".toLowerCase()||e.startsWith("application/json")}))?this.body(e):this.json(e):this;return function(t){var r=t._url,e=t._catchers,n=t._resolvers,o=t._middlewares,i=t._options,a=new Map(e),u=T(E.defaults,i),c=E.polyfill("AbortController",{doThrow:!1,instance:!0});!u.signal&&c&&(u.signal=c.signal);var s={ref:null,clear:function(){s.ref&&(clearTimeout(s.ref),s.ref=null)}},f=function(t){return function(r){return 0===t.length?r:1===t.length?t[0](r):t.reduceRight((function(e,n,o){return o===t.length-2?n(e(r)):n(e)}))}}(o)(E.polyfill("fetch"))(r,u),l=f.catch((function(t){throw new S(t)})).then((function(t){return s.clear(),t.ok?t:t[E.errorType||"text"]().then((function(r){var e=new Error(r);throw e[E.errorType||"text"]=r,e.status=t.status,e.response=t,e}))})),p=function(r){return r.catch((function(r){s.clear();var e=r instanceof S?r.error:r;if(r instanceof S&&a.has("__fromFetch"))return a.get("__fromFetch")(e,t);if(a.has(e.status))return a.get(e.status)(e,t);if(a.has(e.name))return a.get(e.name)(e,t);throw e}))},h=function(t){return function(r){return p(t?l.then((function(r){return r&&r[t]()})).then((function(t){return r?r(t):t})):l.then((function(t){return r?r(t):t})))}},d={res:h(null),json:h("json"),blob:h("blob"),formData:h("formData"),arrayBuffer:h("arrayBuffer"),text:h("text"),perfs:function(t){return f.then((function(r){return N.observe(r.url,t)})),d},setTimeout:function(t,r){return void 0===r&&(r=c),s.clear(),s.ref=setTimeout((function(){return r.abort()}),t),d},controller:function(){return[c,d]},error:function(t,r){return a.set(t,r),d},badRequest:function(t){return d.error(400,t)},unauthorized:function(t){return d.error(401,t)},forbidden:function(t){return d.error(403,t)},notFound:function(t){return d.error(404,t)},timeout:function(t){return d.error(408,t)},internalError:function(t){return d.error(500,t)},fetchError:function(t){return d.error("__fromFetch",t)},onAbort:function(t){return d.error("AbortError",t)}};return n.reduce((function(r,e){return e(r,t)}),d)}((o=o.options(A(A({},r),{method:t})))._deferredChain.reduce((function(t,r){return r(t,t._url,t._options)}),o))},t.prototype.get=function(t){return this.method("GET",t)},t.prototype.delete=function(t){return this.method("DELETE",t)},t.prototype.put=function(t,r){return this.method("PUT",r,t)},t.prototype.post=function(t,r){return this.method("POST",r,t)},t.prototype.patch=function(t,r){return this.method("PATCH",r,t)},t.prototype.head=function(t){return this.method("HEAD",t)},t.prototype.opts=function(t){return this.method("OPTIONS",t)},t.prototype.replay=function(t){return this.method(this._options.method,t)},t.prototype.body=function(t){return this.selfFactory({options:A(A({},this._options),{body:t})})},t.prototype.json=function(t){var r,e=null===(r=Object.entries(this._options.headers||{}).find((function(t){var r=t[0],e=t[1];return r.toLowerCase()==="Content-Type".toLowerCase()&&e.startsWith("application/json")})))||void 0===r?void 0:r[1];return this.content(e||"application/json").body(JSON.stringify(t))},t.prototype.formData=function(t,r){return void 0===r&&(r=!1),this.body(function t(r,e,n,o){void 0===e&&(e=!1);void 0===n&&(n=E.polyfill("FormData",{instance:!0}));void 0===o&&(o=[]);return Object.entries(r).forEach((function(r){var i=r[0],a=r[1],u=o.reduce((function(t,r){return t?t+"["+r+"]":r}),null);if(u=u?u+"["+i+"]":i,a instanceof Array)for(var c=0,s=a;c<s.length;c++){var f=s[c];n.append(u+"[]",f)}else!e||"object"!=typeof a||e instanceof Array&&e.includes(i)?n.append(u,a):null!==a&&t(a,e,n,C(o,[i]))})),n}(t,r))},t.prototype.formUrl=function(t){return this.body("string"==typeof t?t:(r=t,Object.keys(r).map((function(t){var e=r[t];return e instanceof Array?e.map((function(r){return M(t,r)})).join("&"):M(t,e)})).join("&"))).content("application/x-www-form-urlencoded");var r},t}(),I=function(t,r,e){var n;if("string"==typeof r)n=r;else{var o=E.polyfill("URLSearchParams",{instance:!0});for(var i in r)if(r[i]instanceof Array)for(var a=0,u=r[i];a<u.length;a++){var c=u[a];o.append(i,c)}else o.append(i,r[i]);n=o.toString()}var s=t.split("?");return e||s.length<2?s[0]+"?"+n:t+"&"+n};function M(t,r){return encodeURIComponent(t)+"="+encodeURIComponent("object"==typeof r?JSON.stringify(r):""+r)}var U=F.factory;U.default=F.factory;var D=U().options({credentials:"same-origin"});var R=function(t){var r=t.provider,e=t.initialize,n=t.socialLogin,o=t.redirectUrl,i="/api/auth/v1/login?auth-provider=".concat(r,"&redirect-url=").concat(o);return e&&e(),{login:function(){return z(n,r)},serverSideLoginPath:i}};R.defaultProps={initialize:function(){},socialLogin:function(){Promise.reject("EXPECT_REDIRECT")},redirectUrl:"/"};var z=function(){var t=o()(a.a.mark((function t(r,e){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r();case 2:return n=t.sent,t.abrupt("return",B(e,n));case 4:case"end":return t.stop()}}),t)})));return function(r,e){return t.apply(this,arguments)}}(),B=function(t,r){return function(t,r){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=e.mountAt,o=void 0===n?global.qtMountAt||"":n;return D.url("".concat(o).concat(t)).post(r)}("/api/login/".concat(t),{token:r,"set-session":!0}).json((function(t){return t}))},G=function(t){return R({provider:"apple",redirectUrl:t})},J=function(t){var r=t.appId,e=t.scope,n=t.emailMandatory,o=t.redirectUrl;return R({provider:"facebook",initialize:function(){return W(r)},socialLogin:function(){return V({scope:e,emailMandatory:n})},redirectUrl:o})},W=function(t){var r,e,n,o,i;global.FB||(global.fbAsyncInit=global.fbAsyncInit||function(){global.FB.init({appId:t,xfbml:!0,version:"v3.1"})},r=document,e="script",n="facebook-jssdk",i=r.getElementsByTagName(e)[0],r.getElementById(n)||((o=r.createElement(e)).id=n,o.src="https://connect.facebook.net/en_US/sdk.js",i.parentNode.insertBefore(o,i)))},q=function(t){return new Promise((function(r,e){return global.FB.login((function(t){return"connected"===t.status?r({"access-token":t.authResponse.accessToken}):e("NOT_GRANTED")}),t)}))},H=function(t){return new Promise((function(r,e){return global.FB.api("/me",{fields:"email"},(function(n){return n.email?r(t):e("NO_EMAIL")}))}))},V=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.scope,e=t.emailMandatory;if(!global.FB)return Promise.reject("NOT_LOADED");var n=function(){var t=o()(a.a.mark((function t(){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,q({scope:r});case 3:return n=t.sent,t.abrupt("return",e?H(n):n);case 7:t.prev=7,t.t0=t.catch(0),console.log("error",t.t0);case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}();return n()};J.defaultProps={scope:"email",emailMandatory:!1};var Y=function(t){var r=t.clientId,e=t.scope,n=t.emailMandatory,o=t.redirectUrl;return R({provider:"google",initialize:function(){return X(r,e)},socialLogin:function(){return K({emailMandatory:n})},redirectUrl:o})},K=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.emailMandatory;if(!global.gapi||!global.gapi.client)return Promise.reject("NOT_LOADED");var e=global.gapi.auth2.getAuthInstance();if(!e)return Promise.reject("NOT_LOADED");var n=function(){var t=o()(a.a.mark((function t(){var n;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.signIn();case 3:return n=t.sent,t.abrupt("return",r&&!n.getBasicProfile().getEmail()?Promise.reject("NO_EMAIL"):{"access-token":n.getAuthResponse().access_token});case 7:t.prev=7,t.t0=t.catch(0),Promise.reject("NOT_GRANTED");case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}();return n()},X=function(t,r){if(!global.gapi){var e=document.createElement("script");e.src="https://apis.google.com/js/api.js",e.async=!0,e.defer=!0,e.onload=function(){return function(t,r){global.gapi.load("client:auth2",(function(){return global.gapi.client.init({clientId:t,scope:r})}))}(t,r)},document.getElementsByTagName("body")[0].appendChild(e)}};Y.defaultProps={scope:"email",emailMandatory:!1};var Q=function(t){var r=t.clientKey,e=t.redirectUrl;return R({provider:"linkedin",initialize:function(){return Z(r)},socialLogin:function(){return $()},redirectUrl:e})},Z=function(t){if(!global.IN){var r=document.createElement("script");r.src="//platform.linkedin.com/in.js",r.type="text/javascript",r.async=!0,r.defer=!0,r.innerHTML="\n api_key: ".concat(t,"\n"),document.getElementsByTagName("body")[0].appendChild(r)}},$=function(){return global.IN&&global.IN.User?new Promise((function(t,r){global.IN.User.authorize((function(){global.IN.User.isAuthorized()?t({"access-token":global.IN.ENV.auth.oauth_token,client:!0}):r("NOT_GRANTED")}))})):Promise.reject("NOT_LOADED")}}]);
module.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=4)}([function(t,e,r){t.exports=r(3)},function(t,e){function r(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function u(t){r(a,o,i,u,c,"next",t)}function c(t){r(a,o,i,u,c,"throw",t)}u(void 0)}))}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof l?e:l,i=Object.create(o.prototype),a=new O(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return P()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=w(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,a),i}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function l(){}function p(){}function h(){}var d={};d[o]=function(){return this};var v=Object.getPrototypeOf,y=v&&v(v(x([])));y&&y!==e&&r.call(y,o)&&(d=y);var g=h.prototype=l.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var n;this._invoke=function(o,i){function a(){return new e((function(n,a){!function n(o,i,a,u){var c=s(t[o],t,i);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function x(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:P}}function P(){return{value:void 0,done:!0}}return p.prototype=g.constructor=h,h.constructor=p,p.displayName=u(h,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,u(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(b.prototype),b.prototype[i]=function(){return this},t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),u(g,a,"Generator"),g[o]=function(){return this},g.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=x,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),_(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;_(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:x(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){"use strict";r.r(e),r.d(e,"currentUser",(function(){return p})),r.d(e,"forgotPassword",(function(){return w})),r.d(e,"getAutoSSOUrl",(function(){return P})),r.d(e,"getOauthAuthorizeUrl",(function(){return T})),r.d(e,"login",(function(){return y})),r.d(e,"logout",(function(){return l})),r.d(e,"oauthAuthorize",(function(){return x})),r.d(e,"register",(function(){return h})),r.d(e,"resetPassword",(function(){return _})),r.d(e,"resetPasswordWithToken",(function(){return j})),r.d(e,"sendOtp",(function(){return d})),r.d(e,"sendVerificationLink",(function(){return O})),r.d(e,"signImage",(function(){return m})),r.d(e,"updateUserProfile",(function(){return g})),r.d(e,"updateWithOtp",(function(){return v})),r.d(e,"uploadS3ToTemp",(function(){return b})),r.d(e,"withAppleLogin",(function(){return H})),r.d(e,"withFacebookLogin",(function(){return V})),r.d(e,"withGoogleLogin",(function(){return Z})),r.d(e,"withLinkedinLogin",(function(){return et}));var n=r(2),o=r.n(n),i=r(1),a=r.n(i),u=r(0),c=r.n(u);function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function f(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var l=function(){var t=a()(c.a.mark((function t(){return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch("/api/auth/v1/logout");case 3:return t.abrupt("return",t.sent);case 6:return t.prev=6,t.t0=t.catch(0),t.next=10,Promise.reject(t.t0);case 10:return t.abrupt("return",t.sent);case 11:case"end":return t.stop()}}),t,null,[[0,6]])})));return function(){return t.apply(this,arguments)}}(),p=function(){var t=a()(c.a.mark((function t(){var e,r;return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch("/api/auth/v1/users/me");case 3:return e=t.sent,t.next=6,e.json();case 6:return r=t.sent,t.abrupt("return",r);case 10:return t.prev=10,t.t0=t.catch(0),t.next=14,Promise.reject(t.t0);case 14:return t.abrupt("return",t.sent);case 15:case"end":return t.stop()}}),t,null,[[0,10]])})));return function(){return t.apply(this,arguments)}}(),h=function(){var t=a()(c.a.mark((function t(e){var r,n;return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch("/api/auth/v1/signup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),credentials:"same-origin"});case 3:return r=t.sent,t.next=6,r.json();case 6:return n=t.sent,t.next=9,Promise.resolve(n);case 9:return t.abrupt("return",t.sent);case 12:return t.prev=12,t.t0=t.catch(0),t.next=16,Promise.reject(t.t0);case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t,null,[[0,12]])})));return function(e){return t.apply(this,arguments)}}(),d=function(){var t=a()(c.a.mark((function t(e){var r,n;return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch("/api/auth/v1/users/send-otp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),credentials:"same-origin"});case 3:return r=t.sent,t.next=6,r.json();case 6:return n=f(f({},n=t.sent),{},{status:r.status}),t.next=10,Promise.resolve(n);case 10:return t.abrupt("return",t.sent);case 13:return t.prev=13,t.t0=t.catch(0),t.next=17,Promise.reject(t.t0);case 17:return t.abrupt("return",t.sent);case 18:case"end":return t.stop()}}),t,null,[[0,13]])})));return function(e){return t.apply(this,arguments)}}(),v=function(){var t=a()(c.a.mark((function t(e,r){return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch("/api/auth/v1/users/update-with-otp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({otp:"".concat(e),user:r}),credentials:"same-origin"});case 3:return t.abrupt("return",t.sent);case 6:return t.prev=6,t.t0=t.catch(0),t.next=10,Promise.reject(t.t0);case 10:return t.abrupt("return",t.sent);case 11:case"end":return t.stop()}}),t,null,[[0,6]])})));return function(e,r){return t.apply(this,arguments)}}(),y=function(t){return new Promise((function(e,r){fetch("/api/auth/v1/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),credentials:"same-origin"}).then((function(t){return t.json()})).then((function(t){return e(t)})).catch((function(t){return r(t)}))}))},g=function(){var t=a()(c.a.mark((function t(e){var r,n;return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch("/api/auth/v1/users/profile",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),credentials:"same-origin"});case 3:return r=t.sent,t.next=6,r.json();case 6:return n=t.sent,t.next=9,Promise.resolve(n);case 9:return t.abrupt("return",t.sent);case 12:return t.prev=12,t.t0=t.catch(0),t.next=16,Promise.reject(t.t0);case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t,null,[[0,12]])})));return function(e){return t.apply(this,arguments)}}(),m=function(t,e){var r="/api/sign?file-name=".concat(t,"&mime-type=").concat(e);return fetch(r).then((function(t){return t.json()}))},b=function(){var t=a()(c.a.mark((function t(e,r){var n;return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n={method:"POST",body:r,redirect:"follow"},t.abrupt("return",fetch(e,n).then((function(t){return t})).catch((function(t){return console.error(t)})));case 2:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),w=function(t){return new Promise((function(e,r){fetch("/api/auth/v1/users/forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),credentials:"same-origin"}).then((function(t){return t.json()})).then((function(t){return e(t)})).catch((function(t){return r(t)}))}))},j=function(t){return new Promise((function(e,r){fetch("/api/auth/v1/users/reset-password-with-token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),credentials:"same-origin"}).then((function(t){return t.json()})).then((function(t){return e(t)})).catch((function(t){return r(t)}))}))},_=function(t){return new Promise((function(e,r){fetch("/api/auth/v1/users/reset-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),credentials:"same-origin"}).then((function(t){return t.json()})).then((function(t){return e(t)})).catch((function(t){return r(t)}))}))},O=function(){var t=a()(c.a.mark((function t(e,r){var n;return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch("/api/auth/v1/users/send-verification-link",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,"redirect-url":r}),credentials:"same-origin"});case 3:return n=t.sent,t.next=6,n.json();case 6:return t.abrupt("return",t.sent);case 9:return t.prev=9,t.t0=t.catch(0),t.abrupt("return",t.t0);case 12:case"end":return t.stop()}}),t,null,[[0,9]])})));return function(e,r){return t.apply(this,arguments)}}(),x=function(){var t=a()(c.a.mark((function t(e,r,n){var o,i,a=arguments;return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=a.length>3&&void 0!==a[3]&&a[3],t.prev=1,t.next=4,fetch("/api/auth/v1/oauth/authorize?client_id=".concat(e,"&redirect_uri=").concat(r,"&callback_uri=").concat(n,"&response_type=code&allow_ajax=").concat(o));case 4:return i=t.sent,t.next=7,i.json();case 7:return t.abrupt("return",t.sent);case 10:return t.prev=10,t.t0=t.catch(1),t.abrupt("return",t.t0);case 13:case"end":return t.stop()}}),t,null,[[1,10]])})));return function(e,r,n){return t.apply(this,arguments)}}(),P=function(t,e,r){try{var n=r.replace("?logged_in=false","");return"/api/auth/v1/oauth/auto-sso/authorize?client_id=".concat(t,"&redirect_uri=").concat(e,"&callback_uri=").concat(n,"&response_type=code")}catch(t){return t}},T=function(t,e,r){try{var n=r.replace("?logged_in=false","");return"/api/auth/v1/oauth/authorize?client_id=".concat(t,"&redirect_uri=").concat(e,"&callback_uri=").concat(n,"&response_type=code")}catch(t){return t}},E=function(){return(E=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},L=function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],a=0,u=i.length;a<u;a++,o++)n[o]=i[a];return n},k=function(t,e,r){if(void 0===r&&(r=!1),!t||!e||"object"!=typeof t||"object"!=typeof e)return t;var n=E({},t);for(var o in e)e.hasOwnProperty(o)&&(e[o]instanceof Array&&t[o]instanceof Array?n[o]=r?L(t[o],e[o]):e[o]:"object"==typeof e[o]&&"object"==typeof t[o]?n[o]=k(t[o],e[o],r):n[o]=e[o]);return n},N=function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],a=0,u=i.length;a<u;a++,o++)n[o]=i[a];return n},S={defaults:{},errorType:null,polyfills:{fetch:null,FormData:null,URLSearchParams:null,performance:null,PerformanceObserver:null,AbortController:null},polyfill:function(t,e){for(var r=void 0===e?{}:e,n=r.doThrow,o=void 0===n||n,i=r.instance,a=void 0!==i&&i,u=[],c=2;c<arguments.length;c++)u[c-2]=arguments[c];var s=this.polyfills[t]||("undefined"!=typeof self?self[t]:null)||("undefined"!=typeof global?global[t]:null);if(o&&!s)throw new Error(t+" is not defined");return a&&s?new(s.bind.apply(s,N([void 0],u))):s}},A=function(t,e,r,n){if(!t.getEntriesByName)return!1;var o=t.getEntriesByName(e);return!!(o&&o.length>0)&&(r(o.reverse()[0]),n.clearMeasures&&n.clearMeasures(e),C.callbacks.delete(e),C.callbacks.size<1&&(C.observer.disconnect(),n.clearResourceTimings&&n.clearResourceTimings()),!0)},C={callbacks:new Map,observer:null,observe:function(t,e){if(t&&e){var r=S.polyfill("performance",{doThrow:!1});(function(t,e){return!C.observer&&t&&e&&(C.observer=new e((function(e){C.callbacks.forEach((function(r,n){A(e,n,r,t)}))})),t.clearResourceTimings&&t.clearResourceTimings()),C.observer})(r,S.polyfill("PerformanceObserver",{doThrow:!1}))&&(A(r,t,e,r)||(C.callbacks.size<1&&C.observer.observe({entryTypes:["resource","measure"]}),C.callbacks.set(t,e)))}}},F=C,I=function(t){this.error=t},M=function(){return(M=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},D=function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],a=0,u=i.length;a<u;a++,o++)n[o]=i[a];return n},U=function(){function t(t,e,r,n,o,i){void 0===r&&(r=new Map),void 0===n&&(n=[]),void 0===o&&(o=[]),void 0===i&&(i=[]),this._url=t,this._options=e,this._catchers=r,this._resolvers=n,this._middlewares=o,this._deferredChain=i}return t.factory=function(e,r){return void 0===e&&(e=""),void 0===r&&(r={}),new t(e,r)},t.prototype.selfFactory=function(e){var r=void 0===e?{}:e,n=r.url,o=void 0===n?this._url:n,i=r.options,a=void 0===i?this._options:i,u=r.catchers,c=void 0===u?this._catchers:u,s=r.resolvers,f=void 0===s?this._resolvers:s,l=r.middlewares,p=void 0===l?this._middlewares:l,h=r.deferredChain,d=void 0===h?this._deferredChain:h;return new t(o,M({},a),new Map(c),D(f),D(p),D(d))},t.prototype.defaults=function(t,e){return void 0===e&&(e=!1),S.defaults=e?k(S.defaults,t):t,this},t.prototype.errorType=function(t){return S.errorType=t,this},t.prototype.polyfills=function(t){return S.polyfills=M(M({},S.polyfills),t),this},t.prototype.url=function(t,e){if(void 0===e&&(e=!1),e)return this.selfFactory({url:t});var r=this._url.split("?");return this.selfFactory({url:r.length>1?r[0]+t+"?"+r[1]:this._url+t})},t.prototype.options=function(t,e){return void 0===e&&(e=!0),this.selfFactory({options:e?k(this._options,t):t})},t.prototype.query=function(t,e){return void 0===e&&(e=!1),this.selfFactory({url:R(this._url,t,e)})},t.prototype.headers=function(t){return this.selfFactory({options:k(this._options,{headers:t||{}})})},t.prototype.accept=function(t){return this.headers({Accept:t})},t.prototype.content=function(t){var e;return this.headers(((e={})["Content-Type"]=t,e))},t.prototype.auth=function(t){return this.headers({Authorization:t})},t.prototype.catcher=function(t,e){var r=new Map(this._catchers);return r.set(t,e),this.selfFactory({catchers:r})},t.prototype.signal=function(t){return this.selfFactory({options:M(M({},this._options),{signal:t.signal})})},t.prototype.resolve=function(t,e){return void 0===e&&(e=!1),this.selfFactory({resolvers:e?[t]:D(this._resolvers,[t])})},t.prototype.defer=function(t,e){return void 0===e&&(e=!1),this.selfFactory({deferredChain:e?[t]:D(this._deferredChain,[t])})},t.prototype.middlewares=function(t,e){return void 0===e&&(e=!1),this.selfFactory({middlewares:e?t:D(this._middlewares,t)})},t.prototype.method=function(t,e,r){void 0===e&&(e={}),void 0===r&&(r=null);var n=this._options.headers,o=r?"object"!=typeof r||n&&!Object.entries(n).every((function(t){var e=t[0],r=t[1];return e.toLowerCase()!=="Content-Type".toLowerCase()||r.startsWith("application/json")}))?this.body(r):this.json(r):this;return function(t){var e=t._url,r=t._catchers,n=t._resolvers,o=t._middlewares,i=t._options,a=new Map(r),u=k(S.defaults,i),c=S.polyfill("AbortController",{doThrow:!1,instance:!0});!u.signal&&c&&(u.signal=c.signal);var s={ref:null,clear:function(){s.ref&&(clearTimeout(s.ref),s.ref=null)}},f=function(t){return function(e){return 0===t.length?e:1===t.length?t[0](e):t.reduceRight((function(r,n,o){return o===t.length-2?n(r(e)):n(r)}))}}(o)(S.polyfill("fetch"))(e,u),l=f.catch((function(t){throw new I(t)})).then((function(t){return s.clear(),t.ok?t:t[S.errorType||"text"]().then((function(e){var r=new Error(e);throw r[S.errorType||"text"]=e,r.status=t.status,r.response=t,r}))})),p=function(e){return e.catch((function(e){s.clear();var r=e instanceof I?e.error:e;if(e instanceof I&&a.has("__fromFetch"))return a.get("__fromFetch")(r,t);if(a.has(r.status))return a.get(r.status)(r,t);if(a.has(r.name))return a.get(r.name)(r,t);throw r}))},h=function(t){return function(e){return p(t?l.then((function(e){return e&&e[t]()})).then((function(t){return e?e(t):t})):l.then((function(t){return e?e(t):t})))}},d={res:h(null),json:h("json"),blob:h("blob"),formData:h("formData"),arrayBuffer:h("arrayBuffer"),text:h("text"),perfs:function(t){return f.then((function(e){return F.observe(e.url,t)})),d},setTimeout:function(t,e){return void 0===e&&(e=c),s.clear(),s.ref=setTimeout((function(){return e.abort()}),t),d},controller:function(){return[c,d]},error:function(t,e){return a.set(t,e),d},badRequest:function(t){return d.error(400,t)},unauthorized:function(t){return d.error(401,t)},forbidden:function(t){return d.error(403,t)},notFound:function(t){return d.error(404,t)},timeout:function(t){return d.error(408,t)},internalError:function(t){return d.error(500,t)},fetchError:function(t){return d.error("__fromFetch",t)},onAbort:function(t){return d.error("AbortError",t)}};return n.reduce((function(e,r){return r(e,t)}),d)}((o=o.options(M(M({},e),{method:t})))._deferredChain.reduce((function(t,e){return e(t,t._url,t._options)}),o))},t.prototype.get=function(t){return this.method("GET",t)},t.prototype.delete=function(t){return this.method("DELETE",t)},t.prototype.put=function(t,e){return this.method("PUT",e,t)},t.prototype.post=function(t,e){return this.method("POST",e,t)},t.prototype.patch=function(t,e){return this.method("PATCH",e,t)},t.prototype.head=function(t){return this.method("HEAD",t)},t.prototype.opts=function(t){return this.method("OPTIONS",t)},t.prototype.replay=function(t){return this.method(this._options.method,t)},t.prototype.body=function(t){return this.selfFactory({options:M(M({},this._options),{body:t})})},t.prototype.json=function(t){var e,r=null===(e=Object.entries(this._options.headers||{}).find((function(t){var e=t[0],r=t[1];return e.toLowerCase()==="Content-Type".toLowerCase()&&r.startsWith("application/json")})))||void 0===e?void 0:e[1];return this.content(r||"application/json").body(JSON.stringify(t))},t.prototype.formData=function(t,e){return void 0===e&&(e=!1),this.body(function t(e,r,n,o){void 0===r&&(r=!1);void 0===n&&(n=S.polyfill("FormData",{instance:!0}));void 0===o&&(o=[]);return Object.entries(e).forEach((function(e){var i=e[0],a=e[1],u=o.reduce((function(t,e){return t?t+"["+e+"]":e}),null);if(u=u?u+"["+i+"]":i,a instanceof Array)for(var c=0,s=a;c<s.length;c++){var f=s[c];n.append(u+"[]",f)}else!r||"object"!=typeof a||r instanceof Array&&r.includes(i)?n.append(u,a):null!==a&&t(a,r,n,D(o,[i]))})),n}(t,e))},t.prototype.formUrl=function(t){return this.body("string"==typeof t?t:(e=t,Object.keys(e).map((function(t){var r=e[t];return r instanceof Array?r.map((function(e){return z(t,e)})).join("&"):z(t,r)})).join("&"))).content("application/x-www-form-urlencoded");var e},t}(),R=function(t,e,r){var n;if("string"==typeof e)n=e;else{var o=S.polyfill("URLSearchParams",{instance:!0});for(var i in e)if(e[i]instanceof Array)for(var a=0,u=e[i];a<u.length;a++){var c=u[a];o.append(i,c)}else o.append(i,e[i]);n=o.toString()}var s=t.split("?");return r||s.length<2?s[0]+"?"+n:t+"&"+n};function z(t,e){return encodeURIComponent(t)+"="+encodeURIComponent("object"==typeof e?JSON.stringify(e):""+e)}var B=U.factory;B.default=U.factory;var G=B().options({credentials:"same-origin"});var J=function(t){var e=t.provider,r=t.initialize,n=t.socialLogin,o=t.redirectUrl,i="/api/auth/v1/login?auth-provider=".concat(e,"&redirect-url=").concat(o);return r&&r(),{login:function(){return W(n,e)},serverSideLoginPath:i}};J.defaultProps={initialize:function(){},socialLogin:function(){Promise.reject("EXPECT_REDIRECT")},redirectUrl:"/"};var W=function(){var t=a()(c.a.mark((function t(e,r){var n;return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e();case 2:return n=t.sent,t.abrupt("return",q(r,n));case 4:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),q=function(t,e){return function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.mountAt,o=void 0===n?global.qtMountAt||"":n;return G.url("".concat(o).concat(t)).post(e)}("/api/login/".concat(t),{token:e,"set-session":!0}).json((function(t){return t}))},H=function(t){return J({provider:"apple",redirectUrl:t})},V=function(t){var e=t.appId,r=t.scope,n=t.emailMandatory,o=t.redirectUrl;return J({provider:"facebook",initialize:function(){return Y(e)},socialLogin:function(){return Q({scope:r,emailMandatory:n})},redirectUrl:o})},Y=function(t){var e,r,n,o,i;global.FB||(global.fbAsyncInit=global.fbAsyncInit||function(){global.FB.init({appId:t,xfbml:!0,version:"v3.1"})},e=document,r="script",n="facebook-jssdk",i=e.getElementsByTagName(r)[0],e.getElementById(n)||((o=e.createElement(r)).id=n,o.src="https://connect.facebook.net/en_US/sdk.js",i.parentNode.insertBefore(o,i)))},K=function(t){return new Promise((function(e,r){return global.FB.login((function(t){return"connected"===t.status?e({"access-token":t.authResponse.accessToken}):r("NOT_GRANTED")}),t)}))},X=function(t){return new Promise((function(e,r){return global.FB.api("/me",{fields:"email"},(function(n){return n.email?e(t):r("NO_EMAIL")}))}))},Q=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.scope,r=t.emailMandatory;if(!global.FB)return Promise.reject("NOT_LOADED");var n=function(){var t=a()(c.a.mark((function t(){var n;return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,K({scope:e});case 3:return n=t.sent,t.abrupt("return",r?X(n):n);case 7:t.prev=7,t.t0=t.catch(0),console.log("error",t.t0);case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}();return n()};V.defaultProps={scope:"email",emailMandatory:!1};var Z=function(t){var e=t.clientId,r=t.scope,n=t.emailMandatory,o=t.redirectUrl;return J({provider:"google",initialize:function(){return tt(e,r)},socialLogin:function(){return $({emailMandatory:n})},redirectUrl:o})},$=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.emailMandatory;if(!global.gapi||!global.gapi.client)return Promise.reject("NOT_LOADED");var r=global.gapi.auth2.getAuthInstance();if(!r)return Promise.reject("NOT_LOADED");var n=function(){var t=a()(c.a.mark((function t(){var n;return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,r.signIn();case 3:return n=t.sent,t.abrupt("return",e&&!n.getBasicProfile().getEmail()?Promise.reject("NO_EMAIL"):{"access-token":n.getAuthResponse().access_token});case 7:t.prev=7,t.t0=t.catch(0),Promise.reject("NOT_GRANTED");case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}();return n()},tt=function(t,e){if(!global.gapi){var r=document.createElement("script");r.src="https://apis.google.com/js/api.js",r.async=!0,r.defer=!0,r.onload=function(){return function(t,e){global.gapi.load("client:auth2",(function(){return global.gapi.client.init({clientId:t,scope:e})}))}(t,e)},document.getElementsByTagName("body")[0].appendChild(r)}};Z.defaultProps={scope:"email",emailMandatory:!1};var et=function(t){var e=t.clientKey,r=t.redirectUrl;return J({provider:"linkedin",initialize:function(){return rt(e)},socialLogin:function(){return nt()},redirectUrl:r})},rt=function(t){if(!global.IN){var e=document.createElement("script");e.src="//platform.linkedin.com/in.js",e.type="text/javascript",e.async=!0,e.defer=!0,e.innerHTML="\n api_key: ".concat(t,"\n"),document.getElementsByTagName("body")[0].appendChild(e)}},nt=function(){return global.IN&&global.IN.User?new Promise((function(t,e){global.IN.User.authorize((function(){global.IN.User.isAuthorized()?t({"access-token":global.IN.ENV.auth.oauth_token,client:!0}):e("NOT_GRANTED")}))})):Promise.reject("NOT_LOADED")}}]);
{
"name": "@quintype/bridgekeeper-js",
"version": "2.8.2-feature-otp.0",
"version": "2.8.2-feature-otp.1",
"description": "APIs to support bridgekeeper login and registration",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -123,3 +123,4 @@ /**

});
const result = await response.json();
let result = await response.json();
result = { ...result, status: response.status };
return await Promise.resolve(result);

@@ -155,8 +156,4 @@ } catch (err) {

export const updateWithOtp = async (otp) => {
export const updateWithOtp = async (otp, user) => {
try {
const user = {
"verification-status": "email",
};
return await fetch("/api/auth/v1/users/update-with-otp", {

@@ -163,0 +160,0 @@ method: "POST",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc